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

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

_ZN3glz17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES0_EEED2Ev:
  569|  41.8M|      {
  570|  41.8M|         free_data();
  571|  41.8M|         free_index();
  572|  41.8M|      }
_ZN3glz17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES0_EEE9free_dataEv:
  266|  41.9M|      {
  267|  41.9M|         destroy_all();
  268|  41.9M|         ::operator delete(data_);
  269|  41.9M|         data_ = nullptr;
  270|  41.9M|         size_ = 0;
  271|  41.9M|         capacity_ = 0;
  272|  41.9M|      }
_ZN3glz17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES0_EEE11destroy_allEv:
  259|  54.6M|      {
  260|   100M|         for (uint32_t i = 0; i < size_; ++i) {
  ------------------
  |  Branch (260:31): [True: 45.7M, False: 54.6M]
  ------------------
  261|  45.7M|            std::destroy_at(data_ + i);
  262|  45.7M|         }
  263|  54.6M|      }
_ZN3glz17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES0_EEE10free_indexEv:
  308|  41.9M|      {
  309|  41.9M|         std::free(index_);
  310|  41.9M|         index_ = nullptr;
  311|  41.9M|      }
_ZN3glz17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES0_EEEC2Ev:
  566|  22.3M|      ordered_small_map() = default;
_ZN3glz17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES0_EEEaSEOS4_:
  628|  3.92k|      {
  629|  3.92k|         if (this != &other) {
  ------------------
  |  Branch (629:14): [True: 3.92k, False: 0]
  ------------------
  630|  3.92k|            free_data();
  631|  3.92k|            free_index();
  632|  3.92k|            data_ = other.data_;
  633|  3.92k|            size_ = other.size_;
  634|  3.92k|            capacity_ = other.capacity_;
  635|  3.92k|            index_ = other.index_;
  636|  3.92k|            other.data_ = nullptr;
  637|  3.92k|            other.size_ = 0;
  638|  3.92k|            other.capacity_ = 0;
  639|  3.92k|            other.index_ = nullptr;
  640|  3.92k|         }
  641|  3.92k|         return *this;
  642|  3.92k|      }
_ZN3glz17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES0_EEEC2EOS4_:
  610|  19.5M|         : data_(other.data_), size_(other.size_), capacity_(other.capacity_), index_(other.index_)
  611|  19.5M|      {
  612|  19.5M|         other.data_ = nullptr;
  613|  19.5M|         other.size_ = 0;
  614|  19.5M|         other.capacity_ = 0;
  615|  19.5M|         other.index_ = nullptr;
  616|  19.5M|      }
_ZNK3glz17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES0_EEE5emptyEv:
  662|  19.5M|      [[nodiscard]] bool empty() const noexcept { return size_ == 0; }
_ZN3glz17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES0_EEE5beginEv:
  645|  19.4M|      iterator begin() noexcept { return data_; }
_ZN3glz17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES0_EEE3endEv:
  649|  54.5M|      iterator end() noexcept { return data_ + size_; }
_ZN3glz17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES0_EEE11linear_findINSt3__112basic_stringIcNS6_11char_traitsIcEENS6_9allocatorIcEEEEEEPNS6_4pairISC_S3_EERKT_:
  421|  30.1M|      {
  422|  75.5M|         for (uint32_t i = 0; i < size_; ++i) {
  ------------------
  |  Branch (422:31): [True: 48.1M, False: 27.4M]
  ------------------
  423|  48.1M|            if (data_[i].first == key) return data_ + i;
  ------------------
  |  Branch (423:17): [True: 2.65M, False: 45.4M]
  ------------------
  424|  48.1M|         }
  425|  27.4M|         return data_ + size_;
  426|  30.1M|      }
_ZN3glz17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES0_EEE14grow_if_neededEv:
  217|  31.8M|      {
  218|  31.8M|         if (size_ == capacity_) {
  ------------------
  |  Branch (218:14): [True: 12.7M, False: 19.0M]
  ------------------
  219|  12.7M|            if (size_ == max_u32) {
  ------------------
  |  Branch (219:17): [True: 0, False: 12.7M]
  ------------------
  220|      0|               throw_capacity_overflow();
  221|      0|            }
  222|  12.7M|            const uint32_t new_cap = next_data_capacity(capacity_);
  223|  12.7M|            reallocate_data(new_cap);
  224|  12.7M|         }
  225|  31.8M|      }
_ZN3glz17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES0_EEE18next_data_capacityEj:
  120|  12.7M|      {
  121|  12.7M|         if (current == 0) return 4;
  ------------------
  |  Branch (121:14): [True: 10.8M, False: 1.90M]
  ------------------
  122|  1.90M|         if (current > (max_u32 / 2)) return max_u32;
  ------------------
  |  Branch (122:14): [True: 0, False: 1.90M]
  ------------------
  123|  1.90M|         return current * 2;
  124|  1.90M|      }
_ZN3glz17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES0_EEE15reallocate_dataEj:
  205|  12.7M|      {
  206|  12.7M|         if (new_cap < size_) {
  ------------------
  |  Branch (206:14): [True: 0, False: 12.7M]
  ------------------
  207|      0|            throw_capacity_overflow();
  208|      0|         }
  209|  12.7M|         auto* new_data = allocate_and_relocate(new_cap);
  210|  12.7M|         destroy_all();
  211|  12.7M|         ::operator delete(data_);
  212|  12.7M|         data_ = new_data;
  213|  12.7M|         capacity_ = new_cap;
  214|  12.7M|      }
_ZN3glz17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES0_EEE21allocate_and_relocateEj:
  159|  12.7M|      {
  160|  12.7M|         auto* new_data = static_cast<value_type*>(::operator new(checked_data_allocation_bytes(new_cap)));
  161|  12.7M|#if __cpp_exceptions
  162|  12.7M|         uint32_t constructed = 0;
  163|  12.7M|         try {
  164|  26.6M|            for (; constructed < size_; ++constructed) {
  ------------------
  |  Branch (164:20): [True: 13.8M, False: 12.7M]
  ------------------
  165|  13.8M|               std::construct_at(new_data + constructed, std::move_if_noexcept(data_[constructed]));
  166|  13.8M|            }
  167|  12.7M|         }
  168|  12.7M|         catch (...) {
  169|      0|            destroy_range(new_data, constructed);
  170|      0|            ::operator delete(new_data);
  171|      0|            throw;
  172|      0|         }
  173|       |#else
  174|       |         for (uint32_t i = 0; i < size_; ++i) {
  175|       |            std::construct_at(new_data + i, std::move_if_noexcept(data_[i]));
  176|       |         }
  177|       |#endif
  178|  12.7M|         return new_data;
  179|  12.7M|      }
_ZN3glz17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES0_EEE29checked_data_allocation_bytesEj:
  134|  12.7M|      {
  135|  12.7M|         if (count > ((std::numeric_limits<size_t>::max)() / sizeof(value_type))) {
  ------------------
  |  Branch (135:14): [True: 0, False: 12.7M]
  ------------------
  136|      0|            GLZ_THROW_OR_ABORT(std::bad_alloc{});
  ------------------
  |  |    8|      0|#define GLZ_THROW_OR_ABORT(EXC) (throw(EXC))
  ------------------
  137|      0|         }
  138|  12.7M|         return static_cast<size_t>(count) * sizeof(value_type);
  139|  12.7M|      }
_ZN3glz17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES0_EEE8hash_keyENSt3__117basic_string_viewIcNS5_11char_traitsIcEEEE:
   97|  18.2M|      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|  8.54M|      {
  286|  8.54M|         const uint32_t a = h & bloom_mask;
  287|  8.54M|         const uint32_t b = (h >> 10) & bloom_mask;
  288|  8.54M|         return (index_->bloom[a >> 3] & (uint8_t(1) << (a & 7))) && (index_->bloom[b >> 3] & (uint8_t(1) << (b & 7)));
  ------------------
  |  Branch (288:17): [True: 4.65M, False: 3.89M]
  |  Branch (288:70): [True: 4.45M, False: 195k]
  ------------------
  289|  8.54M|      }
_ZN3glz17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES0_EEE17index_find_or_posINSt3__112basic_stringIcNS6_11char_traitsIcEENS6_9allocatorIcEEEEEENS4_17index_find_resultERKT_j:
  400|  4.97M|      {
  401|  4.97M|         ensure_index();
  402|       |
  403|  4.97M|         const auto* base = index_entries();
  404|  4.97M|         const auto* idx_end = base + index_->size;
  405|  4.97M|         const auto* p = branchless_lower_bound(base, index_->size, h);
  406|  4.97M|         const size_t pos = static_cast<size_t>(p - base);
  407|       |
  408|       |         // Scan adjacent entries with matching hash
  409|  5.00M|         for (auto* scan = p; scan != idx_end && scan->key_hash == h; ++scan) {
  ------------------
  |  Branch (409:31): [True: 4.98M, False: 13.5k]
  |  Branch (409:50): [True: 4.63M, False: 352k]
  ------------------
  410|  4.63M|            if (data_[scan->index].first == key) {
  ------------------
  |  Branch (410:17): [True: 4.60M, False: 28.0k]
  ------------------
  411|  4.60M|               return {data_ + scan->index, pos, h};
  412|  4.60M|            }
  413|  4.63M|         }
  414|       |
  415|   365k|         return {data_ + size_, pos, h};
  416|  4.97M|      }
_ZNK3glz17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES0_EEE12ensure_indexEv:
  360|  4.97M|      {
  361|  4.97M|         if (size_ <= linear_search_threshold) return;
  ------------------
  |  Branch (361:14): [True: 0, False: 4.97M]
  ------------------
  362|  4.97M|         const auto current = index_size();
  363|  4.97M|         if (current == size_) return; // fully current
  ------------------
  |  Branch (363:14): [True: 3.40M, False: 1.56M]
  ------------------
  364|       |
  365|  1.56M|         if (current == 0 || (size_ - current) > linear_search_threshold) {
  ------------------
  |  Branch (365:14): [True: 296k, False: 1.26M]
  |  Branch (365:30): [True: 80.9k, False: 1.18M]
  ------------------
  366|   377k|            rebuild_index(); // full rebuild
  367|   377k|            return;
  368|   377k|         }
  369|       |
  370|       |         // Incrementally insert-sort the few new entries
  371|  3.69M|         for (uint32_t i = current; i < size_; ++i) {
  ------------------
  |  Branch (371:37): [True: 2.50M, False: 1.18M]
  ------------------
  372|  2.50M|            const hash_index_entry entry{hash_key(data_[i].first), i};
  373|  2.50M|            const auto* base = index_entries();
  374|  2.50M|            const auto* p = branchless_lower_bound(base, index_->size, entry.key_hash);
  375|  2.50M|            auto pos = static_cast<size_t>(p - base);
  376|       |
  377|  2.50M|            const uint32_t m = index_->size;
  378|  2.50M|            ensure_index_capacity(static_cast<size_type>(m) + 1);
  379|  2.50M|            auto* entries = index_entries();
  380|  2.50M|            if (pos < m) {
  ------------------
  |  Branch (380:17): [True: 2.36M, False: 137k]
  ------------------
  381|  2.36M|               std::memmove(entries + pos + 1, entries + pos, (m - pos) * sizeof(hash_index_entry));
  382|  2.36M|            }
  383|  2.50M|            entries[pos] = entry;
  384|  2.50M|            index_->size = i + 1;
  385|  2.50M|         }
  386|  1.18M|      }
_ZNK3glz17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES0_EEE13rebuild_indexEv:
  343|   377k|      {
  344|   377k|         ensure_index_capacity(static_cast<size_type>(size_));
  345|   377k|         bloom_clear();
  346|   377k|         auto* entries = index_entries();
  347|  7.02M|         for (uint32_t i = 0; i < size_; ++i) {
  ------------------
  |  Branch (347:31): [True: 6.64M, False: 377k]
  ------------------
  348|  6.64M|            const uint32_t h = hash_key(data_[i].first);
  349|  6.64M|            entries[i] = {h, i};
  350|  6.64M|            bloom_set(h);
  351|  6.64M|         }
  352|   377k|         std::sort(entries, entries + size_, [](const auto& a, const auto& b) { return a.key_hash < b.key_hash; });
  353|   377k|         index_->size = size_;
  354|   377k|      }
_ZNK3glz17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES0_EEE11bloom_clearEv:
  291|   377k|      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|  35.9M|         std::sort(entries, entries + size_, [](const auto& a, const auto& b) { return a.key_hash < b.key_hash; });
_ZN3glz17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES0_EEE22branchless_lower_boundEPKNS4_16hash_index_entryEmj:
  440|  7.47M|      {
  441|  48.8M|         while (len > 1) {
  ------------------
  |  Branch (441:17): [True: 41.3M, False: 7.47M]
  ------------------
  442|  41.3M|            size_t half = len / 2;
  443|  41.3M|            p += (p[half - 1].key_hash < target) * half;
  444|  41.3M|            len -= half;
  445|  41.3M|         }
  446|       |         // Final element check: advance past it if it's less than target
  447|  7.47M|         p += (len == 1 && p->key_hash < target);
  ------------------
  |  Branch (447:16): [True: 7.47M, False: 0]
  |  Branch (447:28): [True: 150k, False: 7.32M]
  ------------------
  448|  7.47M|         return p;
  449|  7.47M|      }
_ZNK3glz17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES0_EEE9bloom_setEj:
  277|  11.1M|      {
  278|  11.1M|         const uint32_t a = h & bloom_mask;
  279|  11.1M|         const uint32_t b = (h >> 10) & bloom_mask;
  280|  11.1M|         index_->bloom[a >> 3] |= uint8_t(1) << (a & 7);
  281|  11.1M|         index_->bloom[b >> 3] |= uint8_t(1) << (b & 7);
  282|  11.1M|      }
_ZNK3glz17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES0_EEE10index_sizeEv:
  300|  5.33M|      uint32_t index_size() const noexcept { return index_ ? index_->size : 0; }
  ------------------
  |  Branch (300:53): [True: 5.04M, False: 296k]
  ------------------
_ZNK3glz17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES0_EEE21ensure_index_capacityEm:
  314|  3.24M|      {
  315|  3.24M|         if (needed == 0) return;
  ------------------
  |  Branch (315:14): [True: 0, False: 3.24M]
  ------------------
  316|  3.24M|         if (needed > static_cast<size_type>(max_u32)) {
  ------------------
  |  Branch (316:14): [True: 0, False: 3.24M]
  ------------------
  317|      0|            throw_index_overflow();
  318|      0|         }
  319|  3.24M|         const auto needed_u32 = static_cast<uint32_t>(needed);
  320|  3.24M|         if (index_ && index_->capacity >= needed_u32) return;
  ------------------
  |  Branch (320:14): [True: 2.95M, False: 296k]
  |  Branch (320:24): [True: 2.79M, False: 160k]
  ------------------
  321|   457k|         uint32_t cap = index_ ? index_->capacity : 0;
  ------------------
  |  Branch (321:25): [True: 160k, False: 296k]
  ------------------
  322|   915k|         while (cap < needed_u32) {
  ------------------
  |  Branch (322:17): [True: 457k, False: 457k]
  ------------------
  323|   457k|            const uint32_t next = next_index_capacity(cap);
  324|   457k|            if (next <= cap) {
  ------------------
  |  Branch (324:17): [True: 0, False: 457k]
  ------------------
  325|      0|               throw_index_overflow();
  326|      0|            }
  327|   457k|            cap = next;
  328|   457k|         }
  329|   457k|         auto* block = static_cast<index_header*>(std::realloc(index_, checked_index_allocation_bytes(cap)));
  330|   457k|         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: 457k]
  ------------------
  331|   457k|         if (!index_) {
  ------------------
  |  Branch (331:14): [True: 296k, False: 160k]
  ------------------
  332|   296k|            block->size = 0;
  333|   296k|            std::memset(block->bloom, 0, bloom_bytes);
  334|   296k|         }
  335|   457k|         block->capacity = cap;
  336|   457k|         index_ = block;
  337|   457k|      }
_ZN3glz17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES0_EEE19next_index_capacityEj:
  127|   457k|      {
  128|   457k|         if (current == 0) return 16;
  ------------------
  |  Branch (128:14): [True: 296k, False: 161k]
  ------------------
  129|   161k|         if (current > (max_u32 / 2)) return max_u32;
  ------------------
  |  Branch (129:14): [True: 0, False: 161k]
  ------------------
  130|   161k|         return current * 2;
  131|   161k|      }
_ZN3glz17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES0_EEE30checked_index_allocation_bytesEj:
  142|   457k|      {
  143|   457k|         constexpr size_t header = sizeof(index_header);
  144|   457k|         constexpr size_t entry = sizeof(hash_index_entry);
  145|   457k|         if (count > (((std::numeric_limits<size_t>::max)() - header) / entry)) {
  ------------------
  |  Branch (145:14): [True: 0, False: 457k]
  ------------------
  146|      0|            GLZ_THROW_OR_ABORT(std::bad_alloc{});
  ------------------
  |  |    8|      0|#define GLZ_THROW_OR_ABORT(EXC) (throw(EXC))
  ------------------
  147|      0|         }
  148|   457k|         return header + static_cast<size_t>(count) * entry;
  149|   457k|      }
_ZNK3glz17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES0_EEE13index_entriesEv:
  296|  10.7M|      {
  297|  10.7M|         return static_cast<hash_index_entry*>(static_cast<void*>(index_ + 1));
  298|  10.7M|      }
_ZN3glz17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES0_EEE4findINSt3__112basic_stringIcNS6_11char_traitsIcEENS6_9allocatorIcEEEEEEPNS6_4pairISC_S3_EERKT_:
  902|   109k|      {
  903|   109k|         if (size_ <= linear_search_threshold) {
  ------------------
  |  Branch (903:14): [True: 109k, False: 0]
  ------------------
  904|   109k|            return linear_find(key);
  905|   109k|         }
  906|      0|         return index_find(key);
  907|   109k|      }
_ZN3glz17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES0_EEE6insertEONSt3__14pairINS5_12basic_stringIcNS5_11char_traitsIcEENS5_9allocatorIcEEEES3_EE:
  719|   109k|      {
  720|   109k|         if (size_ <= linear_search_threshold) {
  ------------------
  |  Branch (720:14): [True: 109k, False: 0]
  ------------------
  721|   109k|            auto it = linear_find(value.first);
  722|   109k|            if (it != end()) return {it, false};
  ------------------
  |  Branch (722:17): [True: 0, False: 109k]
  ------------------
  723|   109k|            push_back_impl(std::move(value));
  724|   109k|            return {data_ + size_ - 1, true};
  725|   109k|         }
  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|   109k|      {
  236|   109k|         grow_if_needed();
  237|   109k|         std::construct_at(data_ + size_, std::move(val));
  238|   109k|         ++size_;
  239|   109k|      }
_ZN3glz17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES0_EEE7emplaceINSt3__112basic_stringIcNS6_11char_traitsIcEENS6_9allocatorIcEEEEJS3_EEENS6_4pairIPNSD_ISC_S3_EEbEEOT_DpOT0_:
  746|  38.9M|      {
  747|  38.9M|         return try_emplace(std::forward<K>(key), std::forward<Args>(args)...);
  748|  38.9M|      }
_ZN3glz17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES0_EEE11try_emplaceINSt3__112basic_stringIcNS6_11char_traitsIcEENS6_9allocatorIcEEEEJS3_EEENS6_4pairIPNSD_ISC_S3_EEbEEOT_DpOT0_:
  752|  38.9M|      {
  753|  38.9M|         if (size_ <= linear_search_threshold) {
  ------------------
  |  Branch (753:14): [True: 29.9M, False: 9.06M]
  ------------------
  754|  29.9M|            auto it = linear_find(key);
  755|  29.9M|            if (it != end()) return {it, false};
  ------------------
  |  Branch (755:17): [True: 2.65M, False: 27.2M]
  ------------------
  756|  27.2M|            emplace_back_kv(std::forward<K>(key), std::forward<Args>(args)...);
  757|  27.2M|            return {data_ + size_ - 1, true};
  758|  29.9M|         }
  759|  9.06M|         const uint32_t h = hash_key(key);
  760|  9.06M|         if (try_bloom_insert(h, [&] { emplace_back_kv(std::forward<K>(key), std::forward<Args>(args)...); })) {
  ------------------
  |  Branch (760:14): [True: 4.09M, False: 4.97M]
  ------------------
  761|  4.09M|            return {data_ + size_ - 1, true};
  762|  4.09M|         }
  763|  4.97M|         auto [it, pos, _] = index_find_or_pos(key, h);
  764|  4.97M|         if (it != end()) return {it, false};
  ------------------
  |  Branch (764:14): [True: 4.60M, False: 365k]
  ------------------
  765|   365k|         emplace_back_kv(std::forward<K>(key), std::forward<Args>(args)...);
  766|   365k|         bloom_set(h);
  767|   365k|         if (index_size() > 0) {
  ------------------
  |  Branch (767:14): [True: 365k, False: 0]
  ------------------
  768|   365k|            const uint32_t n = index_->size;
  769|   365k|            ensure_index_capacity(static_cast<size_type>(n) + 1);
  770|   365k|            auto* entries = index_entries();
  771|   365k|            if (pos < n) {
  ------------------
  |  Branch (771:17): [True: 352k, False: 13.4k]
  ------------------
  772|   352k|               std::memmove(entries + pos + 1, entries + pos, (n - pos) * sizeof(hash_index_entry));
  773|   352k|            }
  774|   365k|            entries[pos] = {h, static_cast<uint32_t>(size_ - 1)};
  775|   365k|            index_->size = size_;
  776|   365k|         }
  777|   365k|         return {data_ + size_ - 1, true};
  778|  4.97M|      }
_ZN3glz17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES0_EEE15emplace_back_kvINSt3__112basic_stringIcNS6_11char_traitsIcEENS6_9allocatorIcEEEEJS3_EEEvOT_DpOT0_:
  251|  31.7M|      {
  252|  31.7M|         grow_if_needed();
  253|  31.7M|         std::construct_at(data_ + size_, std::piecewise_construct, std::forward_as_tuple(std::forward<K>(key)),
  254|  31.7M|                           std::forward_as_tuple(std::forward<Args>(args)...));
  255|  31.7M|         ++size_;
  256|  31.7M|      }
_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|  9.06M|      {
  530|  9.06M|         if (index_ && size_ <= bloom_threshold && !bloom_maybe_contains(h)) {
  ------------------
  |  Branch (530:14): [True: 8.76M, False: 296k]
  |  Branch (530:24): [True: 8.54M, False: 219k]
  |  Branch (530:52): [True: 4.09M, False: 4.45M]
  ------------------
  531|       |            // Definitely not present — skip the search
  532|  4.09M|            append_fn();
  533|  4.09M|            bloom_set(h);
  534|       |            // Index is now stale (index_->size < size_), will rebuild on next lookup or false positive
  535|  4.09M|            return true;
  536|  4.09M|         }
  537|  4.97M|         return false;
  538|  9.06M|      }
_ZZN3glz17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES0_EEE11try_emplaceINSt3__112basic_stringIcNS6_11char_traitsIcEENS6_9allocatorIcEEEEJS3_EEENS6_4pairIPNSD_ISC_S3_EEbEEOT_DpOT0_ENKUlvE_clEv:
  760|  4.09M|         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|  12.3k|      size_type size() const noexcept { return size_; }

_ZN3glz12ensure_spaceINSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEETkNS_10is_contextENS_7contextEEEbRT0_RT_m:
  210|  65.4M|   {
  211|  65.4M|      using Buffer = std::remove_cvref_t<B>;
  212|       |
  213|  65.4M|      if constexpr (vector_like<Buffer>) {
  214|  65.4M|         if (required > b.size()) [[unlikely]] {
  ------------------
  |  Branch (214:14): [True: 1.22M, False: 64.2M]
  ------------------
  215|  1.22M|            grow_buffer(b, required);
  216|  1.22M|         }
  217|  65.4M|         return true;
  218|       |      }
  219|       |      else if constexpr (has_bounded_capacity<Buffer>) {
  220|       |         if (required > buffer_traits<Buffer>::capacity(b)) [[unlikely]] {
  221|       |            ctx.error = error_code::buffer_overflow;
  222|       |            return false;
  223|       |         }
  224|       |         return true;
  225|       |      }
  226|       |      else {
  227|       |         return true; // Raw pointer or other - trust caller
  228|       |      }
  229|  65.4M|   }
_ZN3glz11grow_bufferINSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEEEvRT_m:
   88|  1.22M|   {
   89|  1.22M|      using traits = buffer_traits<std::remove_cvref_t<B>>;
   90|  1.22M|      if constexpr (requires { traits::grow(b, required); }) {
   91|  1.22M|         traits::grow(b, required);
   92|       |      }
   93|       |      else {
   94|       |         // A user specialization written before `grow` existed: keep the growth it used to get.
   95|       |         b.resize(2 * required);
   96|       |      }
   97|  1.22M|   }
_ZN3glz13buffer_traitsINSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEE4growERS7_mQL_ZNS_13buffer_traits12is_resizableEE:
   63|  1.22M|      {
   64|  1.22M|         b.resize(2 * required);
   65|  1.22M|      }
_ZN3glz13buffer_traitsINSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEE8finalizeERS7_m:
   69|  3.87M|      {
   70|  3.87M|         if constexpr (is_resizable) {
   71|  3.87M|            b.resize(written);
   72|  3.87M|         }
   73|       |         // For fixed buffers: no-op, count is returned in result
   74|  3.87M|      }

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

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

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

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

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

_ZN3glz9sweethash7sweet32ITkNS0_16contiguous_rangeENSt3__117basic_string_viewIcNS2_11char_traitsIcEEEEEEjRKT_j:
  270|  18.2M|   {
  271|  18.2M|      return sweet32(static_cast<const void*>(s.data()), s.size(), seed);
  272|  18.2M|   }
_ZN3glz9sweethash7sweet32EPKvmj:
  154|  18.2M|   {
  155|  18.2M|      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|  18.2M|      if (len <= 8) {
  ------------------
  |  Branch (158:11): [True: 10.3M, False: 7.87M]
  ------------------
  159|  10.3M|         uint64_t v = 0;
  160|  10.3M|         switch (len) {
  161|   569k|         case 8:
  ------------------
  |  Branch (161:10): [True: 569k, False: 9.77M]
  ------------------
  162|   569k|            std::memcpy(&v, p, 8);
  163|   569k|            break;
  164|   280k|         case 7:
  ------------------
  |  Branch (164:10): [True: 280k, False: 10.0M]
  ------------------
  165|   280k|            std::memcpy(&v, p, 7);
  166|   280k|            break;
  167|   579k|         case 6:
  ------------------
  |  Branch (167:10): [True: 579k, False: 9.76M]
  ------------------
  168|   579k|            std::memcpy(&v, p, 6);
  169|   579k|            break;
  170|   989k|         case 5:
  ------------------
  |  Branch (170:10): [True: 989k, False: 9.35M]
  ------------------
  171|   989k|            std::memcpy(&v, p, 5);
  172|   989k|            break;
  173|   779k|         case 4:
  ------------------
  |  Branch (173:10): [True: 779k, False: 9.56M]
  ------------------
  174|   779k|            std::memcpy(&v, p, 4);
  175|   779k|            break;
  176|  1.44M|         case 3:
  ------------------
  |  Branch (176:10): [True: 1.44M, False: 8.89M]
  ------------------
  177|  1.44M|            std::memcpy(&v, p, 3);
  178|  1.44M|            break;
  179|  1.04M|         case 2:
  ------------------
  |  Branch (179:10): [True: 1.04M, False: 9.30M]
  ------------------
  180|  1.04M|            std::memcpy(&v, p, 2);
  181|  1.04M|            break;
  182|  2.73M|         case 1:
  ------------------
  |  Branch (182:10): [True: 2.73M, False: 7.61M]
  ------------------
  183|  2.73M|            v = p[0];
  184|  2.73M|            break;
  185|  1.92M|         default:
  ------------------
  |  Branch (185:10): [True: 1.92M, False: 8.42M]
  ------------------
  186|  1.92M|            break;
  187|  10.3M|         }
  188|  10.3M|         v = v ^ seed ^ (len + 1);
  189|  10.3M|         return static_cast<uint32_t>(v) ^ static_cast<uint32_t>(v >> 32);
  190|  10.3M|      }
  191|       |
  192|       |      // Full hash for inputs > 8 bytes
  193|  7.87M|      uint64_t seed64 = (static_cast<uint64_t>(seed) << 32) | static_cast<uint64_t>(seed);
  194|  7.87M|      uint64_t h = (seed64 ^ prime4) + (len * prime1);
  195|  7.87M|      const uint8_t* const end = p + len;
  196|       |
  197|  7.87M|      if (len >= 32) {
  ------------------
  |  Branch (197:11): [True: 2.86M, False: 5.00M]
  ------------------
  198|  2.86M|         uint64_t h1 = h;
  199|  2.86M|         uint64_t h2 = (seed64 * prime2) ^ prime3;
  200|  2.86M|         uint64_t h3 = (seed64 * prime3) ^ prime4;
  201|  2.86M|         uint64_t h4 = (seed64 * prime4) ^ prime5;
  202|       |
  203|  14.7M|         do {
  204|  14.7M|            uint64_t k1, k2, k3, k4;
  205|  14.7M|            std::memcpy(&k1, p, 8);
  206|  14.7M|            std::memcpy(&k2, p + 8, 8);
  207|  14.7M|            std::memcpy(&k3, p + 16, 8);
  208|  14.7M|            std::memcpy(&k4, p + 24, 8);
  209|       |
  210|  14.7M|            k1 = k1 * prime2;
  211|  14.7M|            k1 = k1 ^ (k1 >> 47);
  212|  14.7M|            h1 = h1 ^ k1;
  213|  14.7M|            h1 = h1 * prime1;
  214|       |
  215|  14.7M|            k2 = k2 * prime3;
  216|  14.7M|            k2 = k2 ^ (k2 >> 47);
  217|  14.7M|            h2 = h2 ^ k2;
  218|  14.7M|            h2 = h2 * prime2;
  219|       |
  220|  14.7M|            k3 = k3 * prime4;
  221|  14.7M|            k3 = k3 ^ (k3 >> 47);
  222|  14.7M|            h3 = h3 ^ k3;
  223|  14.7M|            h3 = h3 * prime3;
  224|       |
  225|  14.7M|            k4 = k4 * prime5;
  226|  14.7M|            k4 = k4 ^ (k4 >> 47);
  227|  14.7M|            h4 = h4 ^ k4;
  228|  14.7M|            h4 = h4 * prime4;
  229|       |
  230|  14.7M|            p = p + 32;
  231|  14.7M|            len = len - 32;
  232|  14.7M|         } while (len >= 32);
  ------------------
  |  Branch (232:19): [True: 11.8M, False: 2.86M]
  ------------------
  233|       |
  234|  2.86M|         h = h1 + h2 + h3 + h4;
  235|  2.86M|      }
  236|       |
  237|  19.5M|      while (len >= 8) {
  ------------------
  |  Branch (237:14): [True: 11.6M, False: 7.87M]
  ------------------
  238|  11.6M|         uint64_t k;
  239|  11.6M|         std::memcpy(&k, p, 8);
  240|  11.6M|         k = k * prime2;
  241|  11.6M|         k = k ^ (k >> 47);
  242|  11.6M|         h = h ^ k;
  243|  11.6M|         h = h * prime1;
  244|  11.6M|         p = p + 8;
  245|  11.6M|         len = len - 8;
  246|  11.6M|      }
  247|       |
  248|  7.87M|      if (len > 0) {
  ------------------
  |  Branch (248:11): [True: 6.74M, False: 1.12M]
  ------------------
  249|  6.74M|         uint64_t k;
  250|  6.74M|         std::memcpy(&k, end - 8, 8);
  251|  6.74M|         k = k * prime2;
  252|  6.74M|         k = k ^ (k >> 47);
  253|  6.74M|         k = k * prime3;
  254|  6.74M|         h = h ^ k;
  255|  6.74M|      }
  256|       |
  257|  7.87M|      h = mix64(h);
  258|  7.87M|      return static_cast<uint32_t>(h) ^ static_cast<uint32_t>(h >> 32);
  259|  18.2M|   }
_ZN3glz9sweethash5mix64Em:
   33|  7.87M|   {
   34|  7.87M|      v = v ^ (v >> 33);
   35|  7.87M|      v = v * prime2;
   36|  7.87M|      v = v ^ (v >> 29);
   37|  7.87M|      v = v * prime3;
   38|  7.87M|      return v;
   39|  7.87M|   }

_ZN3glz12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEC2Ev:
  338|  73.7M|      generic_json() = default;
_ZN3glz12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEED2Ev:
  114|   127M|      ~generic_json() = default;
_ZN3glz12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEaSEDn:
  231|    202|      {
  232|    202|         data = value;
  233|    202|         return *this;
  234|    202|      }
_ZN3glz12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEaSEOS3_:
  342|  22.2M|      generic_json& operator=(generic_json&&) = default;
_ZN3glz12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEC2EOS3_:
  341|  53.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_:
  210|   109k|      {
  211|   109k|         if (holds<null_t>()) data = object_t{};
  ------------------
  |  Branch (211:14): [True: 109k, False: 0]
  ------------------
  212|   109k|         auto& object = std::get<object_t>(data);
  213|   109k|         auto iter = object.find(key);
  214|   109k|         if (iter == object.end()) {
  ------------------
  |  Branch (214:14): [True: 109k, False: 0]
  ------------------
  215|   109k|            iter = object.insert(std::make_pair(std::string(key), generic_json{})).first;
  216|   109k|         }
  217|   109k|         return iter->second;
  218|   109k|      }
_ZNK3glz12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEE5holdsIDnEEbv:
  201|  4.10M|      {
  202|  4.10M|         return std::holds_alternative<T>(data);
  203|  4.10M|      }
_ZNK3glz12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEE7is_nullEv:
  418|  3.99M|      [[nodiscard]] bool is_null() const noexcept { return holds<std::nullptr_t>(); }
_ZN3glz12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEE6get_ifINSt3__112basic_stringIcNS5_11char_traitsIcEENS5_9allocatorIcEEEEEEPT_v:
  153|  4.84M|      {
  154|  4.84M|         return std::get_if<T>(&data);
  155|  4.84M|      }
_ZNK3glz12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEE4sizeEv:
  534|  23.6k|      {
  535|  23.6k|         if (auto* v = get_if<object_t>()) {
  ------------------
  |  Branch (535:20): [True: 12.3k, False: 11.2k]
  ------------------
  536|  12.3k|            return v->size();
  537|  12.3k|         }
  538|  11.2k|         else if (auto* v = get_if<array_t>()) {
  ------------------
  |  Branch (538:25): [True: 2.03k, False: 9.20k]
  ------------------
  539|  2.03k|            return v->size();
  540|  2.03k|         }
  541|  9.20k|         else if (auto* v = get_if<std::string>()) {
  ------------------
  |  Branch (541:25): [True: 7.26k, False: 1.93k]
  ------------------
  542|  7.26k|            return v->size();
  543|  7.26k|         }
  544|  1.93k|         else {
  545|  1.93k|            return 0;
  546|  1.93k|         }
  547|  23.6k|      }
_ZNK3glz12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEE6get_ifINS2_IS3_EEEEPKT_v:
  159|  23.6k|      {
  160|  23.6k|         return std::get_if<T>(&data);
  161|  23.6k|      }
_ZNK3glz12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEE6get_ifINSt3__16vectorIS3_NS5_9allocatorIS3_EEEEEEPKT_v:
  159|  11.2k|      {
  160|  11.2k|         return std::get_if<T>(&data);
  161|  11.2k|      }
_ZNK3glz12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEE6get_ifINSt3__112basic_stringIcNS5_11char_traitsIcEENS5_9allocatorIcEEEEEEPKT_v:
  159|  9.20k|      {
  160|  9.20k|         return std::get_if<T>(&data);
  161|  9.20k|      }

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

_ZN3glz6detail18sse2_string_escapeIcRZNS_2toILj10ENSt3__112basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEEE2opITnDaXtlNS_4optsELj10ELb1ELb0ELb1ELb1EEERS9_SD_TkNS_10is_contextERNS_7contextEmEEvOT1_OT2_OT0_RT3_EUlvE0_EEvRPKcSR_RPT_mSL_:
   17|  3.95M|   {
   18|       |      // SSE2: 16 bytes at a time with direct comparison instructions
   19|  3.95M|      if (n > 15) {
  ------------------
  |  Branch (19:11): [True: 1.56M, False: 2.38M]
  ------------------
   20|  1.56M|         const __m128i quote_vec = _mm_set1_epi8('"');
   21|  1.56M|         const __m128i bs_vec = _mm_set1_epi8('\\');
   22|  1.56M|         const __m128i ctrl_mask = _mm_set1_epi8(static_cast<int8_t>(0xE0));
   23|  1.56M|         const __m128i zero = _mm_setzero_si128();
   24|       |
   25|  30.1M|         for (const char* end_m15 = e - 15; c < end_m15;) {
  ------------------
  |  Branch (25:45): [True: 28.5M, False: 1.56M]
  ------------------
   26|  28.5M|            __m128i v = _mm_loadu_si128(reinterpret_cast<const __m128i*>(c));
   27|  28.5M|            _mm_storeu_si128(reinterpret_cast<__m128i*>(data), v);
   28|       |
   29|  28.5M|            const uint32_t mask = static_cast<uint32_t>(
   30|  28.5M|               _mm_movemask_epi8(_mm_or_si128(_mm_or_si128(_mm_cmpeq_epi8(v, quote_vec), _mm_cmpeq_epi8(v, bs_vec)),
   31|  28.5M|                                              _mm_cmpeq_epi8(_mm_and_si128(v, ctrl_mask), zero))));
   32|       |
   33|  28.5M|            if (mask == 0) {
  ------------------
  |  Branch (33:17): [True: 3.47M, False: 25.0M]
  ------------------
   34|  3.47M|               data += 16;
   35|  3.47M|               c += 16;
   36|  3.47M|               continue;
   37|  3.47M|            }
   38|       |
   39|  25.0M|            const uint32_t length = countr_zero(mask);
   40|  25.0M|            c += length;
   41|  25.0M|            data += length;
   42|  25.0M|            write_escape();
   43|  25.0M|         }
   44|  1.56M|      }
   45|  3.95M|   }
_ZN3glz6detail18sse2_string_escapeIcRZNS_2toILj10ENSt3__112basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEEE2opITnDaXtlNS_4optsELj10ELb1ELb0ELb1ELb1EEERS9_RKS9_TkNS_10is_contextERNS_7contextEmEEvOT1_OT2_OT0_RT3_EUlvE0_EEvRPKcST_RPT_mSN_:
   17|  24.5M|   {
   18|       |      // SSE2: 16 bytes at a time with direct comparison instructions
   19|  24.5M|      if (n > 15) {
  ------------------
  |  Branch (19:11): [True: 10.1M, False: 14.3M]
  ------------------
   20|  10.1M|         const __m128i quote_vec = _mm_set1_epi8('"');
   21|  10.1M|         const __m128i bs_vec = _mm_set1_epi8('\\');
   22|  10.1M|         const __m128i ctrl_mask = _mm_set1_epi8(static_cast<int8_t>(0xE0));
   23|  10.1M|         const __m128i zero = _mm_setzero_si128();
   24|       |
   25|  5.69G|         for (const char* end_m15 = e - 15; c < end_m15;) {
  ------------------
  |  Branch (25:45): [True: 5.68G, False: 10.1M]
  ------------------
   26|  5.68G|            __m128i v = _mm_loadu_si128(reinterpret_cast<const __m128i*>(c));
   27|  5.68G|            _mm_storeu_si128(reinterpret_cast<__m128i*>(data), v);
   28|       |
   29|  5.68G|            const uint32_t mask = static_cast<uint32_t>(
   30|  5.68G|               _mm_movemask_epi8(_mm_or_si128(_mm_or_si128(_mm_cmpeq_epi8(v, quote_vec), _mm_cmpeq_epi8(v, bs_vec)),
   31|  5.68G|                                              _mm_cmpeq_epi8(_mm_and_si128(v, ctrl_mask), zero))));
   32|       |
   33|  5.68G|            if (mask == 0) {
  ------------------
  |  Branch (33:17): [True: 29.3M, False: 5.65G]
  ------------------
   34|  29.3M|               data += 16;
   35|  29.3M|               c += 16;
   36|  29.3M|               continue;
   37|  29.3M|            }
   38|       |
   39|  5.65G|            const uint32_t length = countr_zero(mask);
   40|  5.65G|            c += length;
   41|  5.65G|            data += length;
   42|  5.65G|            write_escape();
   43|  5.65G|         }
   44|  10.1M|      }
   45|  24.5M|   }

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

_ZN3glz4dumpILb1ENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEEEvNS1_17basic_string_viewIcS4_EERT0_Rm:
  154|   155k|   {
  155|   155k|      const auto n = str.size();
  156|   155k|      if constexpr (vector_like<B>) {
  157|   155k|         if constexpr (Checked) {
  158|   155k|            const auto k = ix + n;
  159|   155k|            if (ix + n > b.size()) [[unlikely]] {
  ------------------
  |  Branch (159:17): [True: 0, False: 155k]
  ------------------
  160|      0|               grow_buffer(b, k);
  161|      0|            }
  162|   155k|         }
  163|   155k|      }
  164|   155k|      std::memcpy(&b[ix], str.data(), n);
  165|   155k|      ix += n;
  166|   155k|   }
_ZN3glz4dumpILb1ENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEETkNS_10byte_sizedEcEEvT1_RT0_Rm:
  112|  44.3M|   {
  113|  44.3M|      if constexpr (Checked && vector_like<B>) {
  114|  44.3M|         if (ix == b.size()) [[unlikely]] {
  ------------------
  |  Branch (114:14): [True: 1.69k, False: 44.3M]
  ------------------
  115|  1.69k|            grow_buffer(b, b.size() == 0 ? 64 : ix + 1);
  ------------------
  |  Branch (115:28): [True: 0, False: 1.69k]
  ------------------
  116|  1.69k|         }
  117|  44.3M|      }
  118|  44.3M|      assign_maybe_cast(c, b, ix);
  119|  44.3M|      ++ix;
  120|  44.3M|   }
_ZN3glz17assign_maybe_castITkNS_10byte_sizedEcNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEEEvT_RT0_Rm:
   57|  44.3M|   {
   58|  44.3M|      using V = std::decay_t<decltype(b[0])>;
   59|  44.3M|      using C = std::decay_t<decltype(c)>;
   60|  44.3M|      if constexpr (std::same_as<V, C>) {
   61|  44.3M|         b[ix] = c;
   62|       |      }
   63|       |      else {
   64|       |         b[ix] = static_cast<V>(c);
   65|       |      }
   66|  44.3M|   }

_ZN3glz10fast_float10from_charsIdciEENS0_19from_chars_result_tIT0_EEPKS3_S6_RT_NS0_12chars_formatE:
 4237|  3.84M|           chars_format fmt /*= chars_format::general*/) noexcept {
 4238|  3.84M|  return from_chars_caller<T>::call(first, last, value,
 4239|  3.84M|                                    parse_options_t<UC>(fmt));
 4240|  3.84M|}
_ZN3glz10fast_float17from_chars_callerIdE4callIcEENS0_19from_chars_result_tIT_EEPKS5_S8_RdNS0_15parse_options_tIS5_EE:
 4195|  3.84M|       parse_options_t<UC> options) noexcept {
 4196|  3.84M|    return from_chars_advanced(first, last, value, options);
 4197|  3.84M|  }
_ZN3glz10fast_float19from_chars_advancedIdcEENS0_19from_chars_result_tIT0_EEPKS3_S6_RT_NS0_15parse_options_tIS3_EE:
 4443|  3.84M|                    parse_options_t<UC> options) noexcept {
 4444|  3.84M|  return from_chars_advanced_caller<
 4445|  3.84M|      size_t(is_supported_float_type<T>::value) +
 4446|  3.84M|      2 * size_t(is_supported_integer_type<T>::value)>::call(first, last, value,
 4447|  3.84M|                                                             options);
 4448|  3.84M|}
_ZN3glz10fast_float26from_chars_advanced_callerILm1EE4callIdcEENS0_19from_chars_result_tIT0_EEPKS5_S8_RT_NS0_15parse_options_tIS5_EE:
 4426|  3.84M|       parse_options_t<UC> options) noexcept {
 4427|  3.84M|    return from_chars_float_advanced(first, last, value, options);
 4428|  3.84M|  }
_ZN3glz10fast_float25from_chars_float_advancedIdcEENS0_19from_chars_result_tIT0_EEPKS3_S6_RT_NS0_15parse_options_tIS3_EE:
 4338|  3.84M|                          parse_options_t<UC> options) noexcept {
 4339|       |
 4340|  3.84M|  static_assert(is_supported_float_type<T>::value,
 4341|  3.84M|                "only some floating-point types are supported");
 4342|  3.84M|  static_assert(is_supported_char_type<UC>::value,
 4343|  3.84M|                "only char, wchar_t, char16_t and char32_t are supported");
 4344|       |
 4345|  3.84M|  chars_format const fmt = detail::adjust_for_feature_macros(options.format);
 4346|       |
 4347|  3.84M|  from_chars_result_t<UC> answer;
 4348|  3.84M|  if (uint64_t(fmt & chars_format::skip_white_space)) {
  ------------------
  |  Branch (4348:7): [True: 0, False: 3.84M]
  ------------------
 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|  3.84M|  if (first == last) {
  ------------------
  |  Branch (4353:7): [True: 702, False: 3.84M]
  ------------------
 4354|    702|    answer.ec = std::errc::invalid_argument;
 4355|    702|    answer.ptr = first;
 4356|    702|    return answer;
 4357|    702|  }
 4358|  3.84M|  parsed_number_string_t<UC> pns =
 4359|  3.84M|      uint64_t(fmt & detail::basic_json_fmt)
  ------------------
  |  Branch (4359:7): [True: 0, False: 3.84M]
  ------------------
 4360|  3.84M|          ? parse_number_string<true, UC>(first, last, options)
 4361|  3.84M|          : parse_number_string<false, UC>(first, last, options);
 4362|  3.84M|  if (!pns.valid) {
  ------------------
  |  Branch (4362:7): [True: 366k, False: 3.47M]
  ------------------
 4363|   366k|    if (uint64_t(fmt & chars_format::no_infnan)) {
  ------------------
  |  Branch (4363:9): [True: 0, False: 366k]
  ------------------
 4364|      0|      answer.ec = std::errc::invalid_argument;
 4365|      0|      answer.ptr = first;
 4366|      0|      return answer;
 4367|   366k|    } else {
 4368|   366k|      return detail::parse_infnan(first, last, value, fmt);
 4369|   366k|    }
 4370|   366k|  }
 4371|       |
 4372|       |  // call overload that takes parsed_number_string_t directly.
 4373|  3.47M|  return from_chars_advanced(pns, value);
 4374|  3.84M|}
_ZN3glz10fast_float6detail25adjust_for_feature_macrosENS0_12chars_formatE:
 1375|  7.68M|constexpr chars_format adjust_for_feature_macros(chars_format fmt) {
 1376|  7.68M|  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|  7.68M|      ;
 1384|  7.68M|}
_ZN3glz10fast_floatanENS0_12chars_formatES1_:
 1340|  26.0M|constexpr chars_format operator&(chars_format lhs, chars_format rhs) noexcept {
 1341|  26.0M|  using int_type = std::underlying_type<chars_format>::type;
 1342|  26.0M|  return static_cast<chars_format>(static_cast<int_type>(lhs) &
 1343|  26.0M|                                   static_cast<int_type>(rhs));
 1344|  26.0M|}
_ZN3glz10fast_float4spanIKcEC2Ev:
  438|  8.41M|  constexpr span() : ptr(nullptr), length(0) {}
_ZN3glz10fast_float18report_parse_errorIcEENS0_22parsed_number_string_tIT_EEPKS3_NS0_11parse_errorE:
 1727|   366k|report_parse_error(UC const *p, parse_error error) {
 1728|   366k|  parsed_number_string_t<UC> answer;
 1729|   366k|  answer.valid = false;
 1730|   366k|  answer.lastmatch = p;
 1731|   366k|  answer.error = error;
 1732|   366k|  return answer;
 1733|   366k|}
_ZN3glz10fast_float10is_integerIcEEbT_:
 1481|   285k|fastfloat_really_inline constexpr bool is_integer(UC c) noexcept {
 1482|   285k|  return !(c > UC('9') || c < UC('0'));
  ------------------
  |  Branch (1482:12): [True: 3.04k, False: 282k]
  |  Branch (1482:27): [True: 11.4k, False: 270k]
  ------------------
 1483|   285k|}
_ZN3glz10fast_float11digit_valueIcEEmT_:
 1489|  48.2M|fastfloat_really_inline constexpr uint64_t digit_value(UC c) noexcept {
 1490|  48.2M|  return uint64_t(uint8_t(c) - uint8_t('0'));
 1491|  48.2M|}
_ZN3glz10fast_float4spanIKcEC2EPS2_m:
  436|  4.06M|  constexpr span(T const *_ptr, size_t _length) : ptr(_ptr), length(_length) {}
_ZN3glz10fast_float26loop_parse_if_eight_digitsERPKcS2_Rm:
 1679|   228k|                           uint64_t &i) {
 1680|       |  // optimizes better than parse_if_eight_digits_unrolled() for UC = char.
 1681|   679k|  while ((std::distance(p, pend) >= 8) &&
  ------------------
  |  Branch (1681:10): [True: 493k, False: 185k]
  ------------------
 1682|   493k|         is_made_of_eight_digits_fast(read8_to_u64(p))) {
  ------------------
  |  Branch (1682:10): [True: 451k, False: 42.5k]
  ------------------
 1683|   451k|    i = i * 100000000 +
 1684|   451k|        parse_eight_digits_unrolled(read8_to_u64(
 1685|   451k|            p)); // in rare cases, this will overflow, but that's ok
 1686|   451k|    p += 8;
 1687|   451k|  }
 1688|   228k|}
_ZN3glz10fast_float28is_made_of_eight_digits_fastEm:
 1597|   493k|is_made_of_eight_digits_fast(uint64_t val) noexcept {
 1598|   493k|  return !((((val + 0x4646464646464646) | (val - 0x3030303030303030)) &
 1599|   493k|            0x8080808080808080));
 1600|   493k|}
_ZN3glz10fast_float12read8_to_u64IcEEmPKT_:
 1503|  1.24M|read8_to_u64(UC const *chars) {
 1504|  1.24M|  if (cpp20_and_in_constexpr() || !std::is_same<UC, char>::value) {
  ------------------
  |  Branch (1504:7): [Folded, False: 0]
  |  Branch (1504:35): [Folded, False: 0]
  ------------------
 1505|      0|    uint64_t val = 0;
 1506|      0|    for (int i = 0; i < 8; ++i) {
  ------------------
  |  Branch (1506:21): [True: 0, False: 0]
  ------------------
 1507|      0|      val |= uint64_t(uint8_t(*chars)) << (i * 8);
 1508|      0|      ++chars;
 1509|      0|    }
 1510|      0|    return val;
 1511|      0|  }
 1512|  1.24M|  uint64_t val;
 1513|  1.24M|  ::memcpy(&val, chars, sizeof(uint64_t));
 1514|       |#if GLZ_FASTFLOAT_IS_BIG_ENDIAN == 1
 1515|       |  // Need to read as-if the number was in little-endian order.
 1516|       |  val = byteswap(val);
 1517|       |#endif
 1518|  1.24M|  return val;
 1519|  1.24M|}
_ZN3glz10fast_float27parse_eight_digits_unrolledEm:
 1575|   751k|parse_eight_digits_unrolled(uint64_t val) {
 1576|   751k|  uint64_t const mask = 0x000000FF000000FF;
 1577|   751k|  uint64_t const mul1 = 0x000F424000000064; // 100 + (1000000ULL << 32)
 1578|   751k|  uint64_t const mul2 = 0x0000271000000001; // 1 + (10000ULL << 32)
 1579|   751k|  val -= 0x3030303030303030;
 1580|   751k|  val = (val * 10) + (val >> 8); // val = (val * 2561) >> 8;
 1581|   751k|  val = (((val & mask) * mul1) + (((val >> 16) & mask) * mul2)) >> 32;
 1582|   751k|  return uint32_t(val);
 1583|   751k|}
_ZNK3glz10fast_float4spanIKcE3lenEv:
  440|   752k|  constexpr size_t len() const noexcept { return length; }
_ZN3glz10fast_float19parse_number_stringILb0EcEENS0_22parsed_number_string_tIT0_EEPKS3_S6_NS0_15parse_options_tIS3_EE:
 1740|  3.84M|                    parse_options_t<UC> options) noexcept {
 1741|  3.84M|  chars_format const fmt = detail::adjust_for_feature_macros(options.format);
 1742|  3.84M|  UC const decimal_point = options.decimal_point;
 1743|       |
 1744|  3.84M|  parsed_number_string_t<UC> answer;
 1745|  3.84M|  answer.valid = false;
 1746|  3.84M|  answer.too_many_digits = false;
 1747|       |  // assume p < pend, so dereference without checks;
 1748|  3.84M|  answer.negative = (*p == UC('-'));
 1749|       |  // C++17 20.19.3.(7.1) explicitly forbids '+' sign here
 1750|  3.84M|  if ((*p == UC('-')) || (uint64_t(fmt & chars_format::allow_leading_plus) &&
  ------------------
  |  Branch (1750:7): [True: 37.3k, False: 3.80M]
  |  Branch (1750:27): [True: 0, False: 3.80M]
  ------------------
 1751|  37.3k|                          !basic_json_fmt && *p == UC('+'))) {
  ------------------
  |  Branch (1751:27): [True: 0, Folded]
  |  Branch (1751:46): [True: 0, False: 0]
  ------------------
 1752|  37.3k|    ++p;
 1753|  37.3k|    if (p == pend) {
  ------------------
  |  Branch (1753:9): [True: 1.92k, False: 35.3k]
  ------------------
 1754|  1.92k|      return report_parse_error<UC>(
 1755|  1.92k|          p, parse_error::missing_integer_or_dot_after_sign);
 1756|  1.92k|    }
 1757|  35.3k|    GLZ_FASTFLOAT_IF_CONSTEXPR17(basic_json_fmt) {
  ------------------
  |  |  127|  35.3k|#define GLZ_FASTFLOAT_IF_CONSTEXPR17(x) if constexpr (x)
  ------------------
 1758|  35.3k|      if (!is_integer(*p)) { // a sign must be followed by an integer
 1759|  35.3k|        return report_parse_error<UC>(p,
 1760|  35.3k|                                      parse_error::missing_integer_after_sign);
 1761|  35.3k|      }
 1762|  35.3k|    }
 1763|  35.3k|    else {
 1764|  35.3k|      if (!is_integer(*p) &&
  ------------------
  |  Branch (1764:11): [True: 9.49k, False: 25.8k]
  ------------------
 1765|  9.49k|          (*p !=
  ------------------
  |  Branch (1765:11): [True: 2.48k, False: 7.01k]
  ------------------
 1766|  9.49k|           decimal_point)) { // a sign must be followed by an integer or the dot
 1767|  2.48k|        return report_parse_error<UC>(
 1768|  2.48k|            p, parse_error::missing_integer_or_dot_after_sign);
 1769|  2.48k|      }
 1770|  35.3k|    }
 1771|  35.3k|  }
 1772|  3.83M|  UC const *const start_digits = p;
 1773|       |
 1774|  3.83M|  uint64_t i = 0; // an unsigned int avoids signed overflows (which are bad)
 1775|       |
 1776|  3.83M|  uint64_t digit;
 1777|  50.8M|  while ((p != pend) && (digit = digit_value(*p)) <= 9) {
  ------------------
  |  Branch (1777:10): [True: 48.0M, False: 2.75M]
  |  Branch (1777:25): [True: 46.9M, False: 1.08M]
  ------------------
 1778|       |    // a multiplication by 10 is cheaper than an arbitrary integer
 1779|       |    // multiplication
 1780|  46.9M|    i = 10 * i + digit; // might overflow, we will handle the overflow later
 1781|  46.9M|    ++p;
 1782|  46.9M|  }
 1783|  3.83M|  UC const *const end_of_integer_part = p;
 1784|  3.83M|  int64_t digit_count = int64_t(end_of_integer_part - start_digits);
 1785|  3.83M|  answer.integer = span<UC const>(start_digits, size_t(digit_count));
 1786|  3.83M|  GLZ_FASTFLOAT_IF_CONSTEXPR17(basic_json_fmt) {
  ------------------
  |  |  127|  3.83M|#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|  3.83M|  int64_t exponent = 0;
 1798|  3.83M|  bool const has_decimal_point = (p != pend) && (*p == decimal_point);
  ------------------
  |  Branch (1798:34): [True: 1.08M, False: 2.75M]
  |  Branch (1798:49): [True: 228k, False: 851k]
  ------------------
 1799|  3.83M|  if (has_decimal_point) {
  ------------------
  |  Branch (1799:7): [True: 228k, False: 3.61M]
  ------------------
 1800|   228k|    ++p;
 1801|   228k|    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|   228k|    loop_parse_if_eight_digits(p, pend, i);
 1805|       |
 1806|   328k|    while ((p != pend) && (digit = digit_value(*p)) <= 9) {
  ------------------
  |  Branch (1806:12): [True: 240k, False: 87.4k]
  |  Branch (1806:27): [True: 99.5k, False: 141k]
  ------------------
 1807|  99.5k|      ++p;
 1808|  99.5k|      i = i * 10 + digit; // in rare cases, this will overflow, but that's ok
 1809|  99.5k|    }
 1810|   228k|    exponent = before - p;
 1811|   228k|    answer.fraction = span<UC const>(before, size_t(p - before));
 1812|   228k|    digit_count -= exponent;
 1813|   228k|  }
 1814|  3.83M|  GLZ_FASTFLOAT_IF_CONSTEXPR17(basic_json_fmt) {
  ------------------
  |  |  127|  3.83M|#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|  3.83M|  else if (digit_count == 0) { // we must have encountered at least one integer!
  ------------------
  |  Branch (1821:12): [True: 362k, False: 3.47M]
  ------------------
 1822|   362k|    return report_parse_error<UC>(p, parse_error::no_digits_in_mantissa);
 1823|   362k|  }
 1824|  3.47M|  int64_t exp_number = 0; // explicit exponential part
 1825|  3.83M|  if ((uint64_t(fmt & chars_format::scientific) && (p != pend) &&
  ------------------
  |  Branch (1825:8): [True: 3.47M, False: 364k]
  |  Branch (1825:52): [True: 689k, False: 2.78M]
  ------------------
 1826|   689k|       ((UC('e') == *p) || (UC('E') == *p))) ||
  ------------------
  |  Branch (1826:9): [True: 2.70k, False: 686k]
  |  Branch (1826:28): [True: 6.77k, False: 679k]
  ------------------
 1827|  3.46M|      (uint64_t(fmt & detail::basic_fortran_fmt) && (p != pend) &&
  ------------------
  |  Branch (1827:8): [True: 0, False: 3.46M]
  |  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|  9.48k|        (UC('D') == *p)))) {
  ------------------
  |  Branch (1829:9): [True: 0, False: 0]
  ------------------
 1830|  9.48k|    UC const *location_of_e = p;
 1831|  9.48k|    if ((UC('e') == *p) || (UC('E') == *p) || (UC('d') == *p) ||
  ------------------
  |  Branch (1831:9): [True: 2.70k, False: 6.77k]
  |  Branch (1831:28): [True: 6.77k, False: 0]
  |  Branch (1831:47): [True: 0, False: 0]
  ------------------
 1832|  9.48k|        (UC('D') == *p)) {
  ------------------
  |  Branch (1832:9): [True: 0, False: 0]
  ------------------
 1833|  9.48k|      ++p;
 1834|  9.48k|    }
 1835|  9.48k|    bool neg_exp = false;
 1836|  9.48k|    if ((p != pend) && (UC('-') == *p)) {
  ------------------
  |  Branch (1836:9): [True: 8.87k, False: 606]
  |  Branch (1836:24): [True: 2.92k, False: 5.95k]
  ------------------
 1837|  2.92k|      neg_exp = true;
 1838|  2.92k|      ++p;
 1839|  6.55k|    } else if ((p != pend) &&
  ------------------
  |  Branch (1839:16): [True: 5.95k, False: 606]
  ------------------
 1840|  5.95k|               (UC('+') ==
  ------------------
  |  Branch (1840:16): [True: 368, False: 5.58k]
  ------------------
 1841|  5.95k|                *p)) { // '+' on exponent is allowed by C++17 20.19.3.(7.1)
 1842|    368|      ++p;
 1843|    368|    }
 1844|  9.48k|    if ((p == pend) || !is_integer(*p)) {
  ------------------
  |  Branch (1844:9): [True: 616, False: 8.86k]
  |  Branch (1844:24): [True: 2.76k, False: 6.10k]
  ------------------
 1845|  3.37k|      if (!uint64_t(fmt & chars_format::fixed)) {
  ------------------
  |  Branch (1845:11): [True: 0, False: 3.37k]
  ------------------
 1846|       |        // The exponential part is invalid for scientific notation, so it must
 1847|       |        // be a trailing token for fixed notation. However, fixed notation is
 1848|       |        // disabled, so report a scientific notation error.
 1849|      0|        return report_parse_error<UC>(p, parse_error::missing_exponential_part);
 1850|      0|      }
 1851|       |      // Otherwise, we will be ignoring the 'e'.
 1852|  3.37k|      p = location_of_e;
 1853|  6.10k|    } else {
 1854|   244k|      while ((p != pend) && is_integer(*p)) {
  ------------------
  |  Branch (1854:14): [True: 240k, False: 3.82k]
  |  Branch (1854:29): [True: 238k, False: 2.28k]
  ------------------
 1855|   238k|        uint8_t exp_digit = uint8_t(*p - UC('0'));
 1856|   238k|        if (exp_number < 0x10000000) {
  ------------------
  |  Branch (1856:13): [True: 31.7k, False: 206k]
  ------------------
 1857|  31.7k|          exp_number = 10 * exp_number + exp_digit;
 1858|  31.7k|        }
 1859|   238k|        ++p;
 1860|   238k|      }
 1861|  6.10k|      if (neg_exp) {
  ------------------
  |  Branch (1861:11): [True: 2.91k, False: 3.18k]
  ------------------
 1862|  2.91k|        exp_number = -exp_number;
 1863|  2.91k|      }
 1864|  6.10k|      exponent += exp_number;
 1865|  6.10k|    }
 1866|  3.82M|  } else {
 1867|       |    // If it scientific and not fixed, we have to bail out.
 1868|  3.82M|    if (uint64_t(fmt & chars_format::scientific) &&
  ------------------
  |  Branch (1868:9): [True: 3.46M, False: 364k]
  ------------------
 1869|  3.46M|        !uint64_t(fmt & chars_format::fixed)) {
  ------------------
  |  Branch (1869:9): [True: 0, False: 3.46M]
  ------------------
 1870|      0|      return report_parse_error<UC>(p, parse_error::missing_exponential_part);
 1871|      0|    }
 1872|  3.82M|  }
 1873|  3.83M|  answer.lastmatch = p;
 1874|  3.83M|  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|  3.83M|  if (digit_count > 19) { // this is uncommon
  ------------------
  |  Branch (1881:7): [True: 718k, False: 3.12M]
  ------------------
 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|   718k|    UC const *start = start_digits;
 1887|  22.2M|    while ((start != pend) && (*start == UC('0') || *start == decimal_point)) {
  ------------------
  |  Branch (1887:12): [True: 22.2M, False: 1.28k]
  |  Branch (1887:32): [True: 21.4M, False: 755k]
  |  Branch (1887:53): [True: 38.3k, False: 717k]
  ------------------
 1888|  21.5M|      if (*start == UC('0')) {
  ------------------
  |  Branch (1888:11): [True: 21.4M, False: 38.3k]
  ------------------
 1889|  21.4M|        digit_count--;
 1890|  21.4M|      }
 1891|  21.5M|      start++;
 1892|  21.5M|    }
 1893|       |
 1894|   718k|    if (digit_count > 19) {
  ------------------
  |  Branch (1894:9): [True: 708k, False: 10.5k]
  ------------------
 1895|   708k|      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|   708k|      i = 0;
 1900|   708k|      p = answer.integer.ptr;
 1901|   708k|      UC const *int_end = p + answer.integer.len();
 1902|   708k|      uint64_t const minimal_nineteen_digit_integer{1000000000000000000};
 1903|  31.0M|      while ((i < minimal_nineteen_digit_integer) && (p != int_end)) {
  ------------------
  |  Branch (1903:14): [True: 30.3M, False: 695k]
  |  Branch (1903:54): [True: 30.2M, False: 12.8k]
  ------------------
 1904|  30.2M|        i = i * 10 + uint64_t(*p - UC('0'));
 1905|  30.2M|        ++p;
 1906|  30.2M|      }
 1907|   708k|      if (i >= minimal_nineteen_digit_integer) { // We have a big integers
  ------------------
  |  Branch (1907:11): [True: 695k, False: 12.8k]
  ------------------
 1908|   695k|        exponent = end_of_integer_part - p + exp_number;
 1909|   695k|      } else { // We have a value with a fractional component.
 1910|  12.8k|        p = answer.fraction.ptr;
 1911|  12.8k|        UC const *frac_end = p + answer.fraction.len();
 1912|   613k|        while ((i < minimal_nineteen_digit_integer) && (p != frac_end)) {
  ------------------
  |  Branch (1912:16): [True: 601k, False: 12.8k]
  |  Branch (1912:56): [True: 601k, False: 0]
  ------------------
 1913|   601k|          i = i * 10 + uint64_t(*p - UC('0'));
 1914|   601k|          ++p;
 1915|   601k|        }
 1916|  12.8k|        exponent = answer.fraction.ptr - p + exp_number;
 1917|  12.8k|      }
 1918|       |      // We have now corrected both exponent and i, to a truncated value
 1919|   708k|    }
 1920|   718k|  }
 1921|  3.83M|  answer.exponent = exponent;
 1922|  3.83M|  answer.mantissa = i;
 1923|  3.83M|  return answer;
 1924|  3.83M|}
_ZN3glz10fast_float6detail12parse_infnanIdcEENS0_19from_chars_result_tIT0_EEPKS4_S7_RT_NS0_12chars_formatE:
 4076|   366k|                                       T &value, chars_format fmt) noexcept {
 4077|   366k|  from_chars_result_t<UC> answer{};
 4078|   366k|  answer.ptr = first;
 4079|   366k|  answer.ec = std::errc(); // be optimistic
 4080|       |  // assume first < last, so dereference without checks;
 4081|   366k|  bool const minusSign = (*first == UC('-'));
 4082|       |  // C++17 20.19.3.(7.1) explicitly forbids '+' sign here
 4083|   366k|  if ((*first == UC('-')) ||
  ------------------
  |  Branch (4083:7): [True: 5.14k, False: 361k]
  ------------------
 4084|   361k|      (uint64_t(fmt & chars_format::allow_leading_plus) &&
  ------------------
  |  Branch (4084:8): [True: 0, False: 361k]
  ------------------
 4085|  5.14k|       (*first == UC('+')))) {
  ------------------
  |  Branch (4085:8): [True: 0, False: 0]
  ------------------
 4086|  5.14k|    ++first;
 4087|  5.14k|  }
 4088|   366k|  if (last - first >= 3) {
  ------------------
  |  Branch (4088:7): [True: 253k, False: 112k]
  ------------------
 4089|   253k|    if (fastfloat_strncasecmp(first, str_const_nan<UC>(), 3)) {
  ------------------
  |  Branch (4089:9): [True: 27.5k, False: 226k]
  ------------------
 4090|  27.5k|      answer.ptr = (first += 3);
 4091|  27.5k|      value = minusSign ? -std::numeric_limits<T>::quiet_NaN()
  ------------------
  |  Branch (4091:15): [True: 102, False: 27.4k]
  ------------------
 4092|  27.5k|                        : 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|  27.5k|      if (first != last && *first == UC('(')) {
  ------------------
  |  Branch (4095:11): [True: 27.3k, False: 202]
  |  Branch (4095:28): [True: 21.2k, False: 6.09k]
  ------------------
 4096|   111k|        for (UC const *ptr = first + 1; ptr != last; ++ptr) {
  ------------------
  |  Branch (4096:41): [True: 102k, False: 8.34k]
  ------------------
 4097|   102k|          if (*ptr == UC(')')) {
  ------------------
  |  Branch (4097:15): [True: 206, False: 102k]
  ------------------
 4098|    206|            answer.ptr = ptr + 1; // valid nan(n-char-seq-opt)
 4099|    206|            break;
 4100|   102k|          } else if (!((UC('a') <= *ptr && *ptr <= UC('z')) ||
  ------------------
  |  Branch (4100:25): [True: 17.4k, False: 85.1k]
  |  Branch (4100:44): [True: 17.1k, False: 318]
  ------------------
 4101|  85.4k|                       (UC('A') <= *ptr && *ptr <= UC('Z')) ||
  ------------------
  |  Branch (4101:25): [True: 44.5k, False: 40.8k]
  |  Branch (4101:44): [True: 43.4k, False: 1.07k]
  ------------------
 4102|  41.9k|                       (UC('0') <= *ptr && *ptr <= UC('9')) || *ptr == UC('_')))
  ------------------
  |  Branch (4102:25): [True: 30.4k, False: 11.5k]
  |  Branch (4102:44): [True: 29.2k, False: 1.17k]
  |  Branch (4102:64): [True: 0, False: 12.6k]
  ------------------
 4103|  12.6k|            break; // forbidden char, not nan(n-char-seq-opt)
 4104|   102k|        }
 4105|  21.2k|      }
 4106|  27.5k|      return answer;
 4107|  27.5k|    }
 4108|   226k|    if (fastfloat_strncasecmp(first, str_const_inf<UC>(), 3)) {
  ------------------
  |  Branch (4108:9): [True: 790, False: 225k]
  ------------------
 4109|    790|      if ((last - first >= 8) &&
  ------------------
  |  Branch (4109:11): [True: 488, False: 302]
  ------------------
 4110|    488|          fastfloat_strncasecmp(first + 3, str_const_inf<UC>() + 3, 5)) {
  ------------------
  |  Branch (4110:11): [True: 70, False: 418]
  ------------------
 4111|     70|        answer.ptr = first + 8;
 4112|    720|      } else {
 4113|    720|        answer.ptr = first + 3;
 4114|    720|      }
 4115|    790|      value = minusSign ? -std::numeric_limits<T>::infinity()
  ------------------
  |  Branch (4115:15): [True: 228, False: 562]
  ------------------
 4116|    790|                        : std::numeric_limits<T>::infinity();
 4117|    790|      return answer;
 4118|    790|    }
 4119|   226k|  }
 4120|   338k|  answer.ec = std::errc::invalid_argument;
 4121|   338k|  return answer;
 4122|   366k|}
_ZN3glz10fast_float21fastfloat_strncasecmpIcEEbPKT_S4_m:
  417|   480k|                      size_t length) {
  418|   745k|  for (size_t i = 0; i < length; ++i) {
  ------------------
  |  Branch (418:22): [True: 717k, False: 28.4k]
  ------------------
  419|   717k|    UC const actual = actual_mixedcase[i];
  420|   717k|    if ((actual < 256 ? actual | 32 : actual) != expected_lowercase[i]) {
  ------------------
  |  Branch (420:9): [True: 452k, False: 265k]
  |  Branch (420:10): [True: 717k, False: 0]
  ------------------
  421|   452k|      return false;
  422|   452k|    }
  423|   717k|  }
  424|  28.4k|  return true;
  425|   480k|}
_ZN3glz10fast_float13str_const_nanIcEEPKT_v:
 1186|   253k|template <> constexpr char const *str_const_nan<char>() { return "nan"; }
_ZN3glz10fast_float13str_const_infIcEEPKT_v:
 1206|   226k|template <> constexpr char const *str_const_inf<char>() { return "infinity"; }
_ZN3glz10fast_float19from_chars_advancedIdcEENS0_19from_chars_result_tIT0_EERNS0_22parsed_number_string_tIS3_EERT_:
 4249|  3.47M|from_chars_advanced(parsed_number_string_t<UC> &pns, T &value) noexcept {
 4250|       |
 4251|  3.47M|  static_assert(is_supported_float_type<T>::value,
 4252|  3.47M|                "only some floating-point types are supported");
 4253|  3.47M|  static_assert(is_supported_char_type<UC>::value,
 4254|  3.47M|                "only char, wchar_t, char16_t and char32_t are supported");
 4255|       |
 4256|  3.47M|  from_chars_result_t<UC> answer;
 4257|       |
 4258|  3.47M|  answer.ec = std::errc(); // be optimistic
 4259|  3.47M|  answer.ptr = pns.lastmatch;
 4260|       |  // The implementation of the Clinger's fast path is convoluted because
 4261|       |  // we want round-to-nearest in all cases, irrespective of the rounding mode
 4262|       |  // selected on the thread.
 4263|       |  // We proceed optimistically, assuming that detail::rounds_to_nearest()
 4264|       |  // returns true.
 4265|  3.47M|  if (binary_format<T>::min_exponent_fast_path() <= pns.exponent &&
  ------------------
  |  Branch (4265:7): [True: 3.46M, False: 13.1k]
  ------------------
 4266|  3.46M|      pns.exponent <= binary_format<T>::max_exponent_fast_path() &&
  ------------------
  |  Branch (4266:7): [True: 3.45M, False: 6.96k]
  ------------------
 4267|  3.45M|      !pns.too_many_digits) {
  ------------------
  |  Branch (4267:7): [True: 2.76M, False: 693k]
  ------------------
 4268|       |    // Unfortunately, the conventional Clinger's fast path is only possible
 4269|       |    // when the system rounds to the nearest float.
 4270|       |    //
 4271|       |    // We expect the next branch to almost always be selected.
 4272|       |    // We could check it first (before the previous branch), but
 4273|       |    // there might be performance advantages at having the check
 4274|       |    // be last.
 4275|  2.76M|    if (!cpp20_and_in_constexpr() && detail::rounds_to_nearest()) {
  ------------------
  |  Branch (4275:9): [True: 2.76M, Folded]
  |  Branch (4275:38): [True: 2.76M, False: 0]
  ------------------
 4276|       |      // We have that fegetround() == FE_TONEAREST.
 4277|       |      // Next is Clinger's fast path.
 4278|  2.76M|      if (pns.mantissa <= binary_format<T>::max_mantissa_fast_path()) {
  ------------------
  |  Branch (4278:11): [True: 2.74M, False: 15.9k]
  ------------------
 4279|  2.74M|        value = T(pns.mantissa);
 4280|  2.74M|        if (pns.exponent < 0) {
  ------------------
  |  Branch (4280:13): [True: 34.5k, False: 2.70M]
  ------------------
 4281|  34.5k|          value = value / binary_format<T>::exact_power_of_ten(-pns.exponent);
 4282|  2.70M|        } else {
 4283|  2.70M|          value = value * binary_format<T>::exact_power_of_ten(pns.exponent);
 4284|  2.70M|        }
 4285|  2.74M|        if (pns.negative) {
  ------------------
  |  Branch (4285:13): [True: 30.4k, False: 2.71M]
  ------------------
 4286|  30.4k|          value = -value;
 4287|  30.4k|        }
 4288|  2.74M|        return answer;
 4289|  2.74M|      }
 4290|  2.76M|    } else {
 4291|       |      // We do not have that fegetround() == FE_TONEAREST.
 4292|       |      // Next is a modified Clinger's fast path, inspired by Jakub Jelínek's
 4293|       |      // proposal
 4294|      0|      if (pns.exponent >= 0 &&
  ------------------
  |  Branch (4294:11): [True: 0, False: 0]
  ------------------
 4295|      0|          pns.mantissa <=
  ------------------
  |  Branch (4295:11): [True: 0, False: 0]
  ------------------
 4296|      0|              binary_format<T>::max_mantissa_fast_path(pns.exponent)) {
 4297|      0|#if defined(__clang__) || defined(GLZ_FASTFLOAT_32BIT)
 4298|       |        // Clang may map 0 to -0.0 when fegetround() == FE_DOWNWARD
 4299|      0|        if (pns.mantissa == 0) {
  ------------------
  |  Branch (4299:13): [True: 0, False: 0]
  ------------------
 4300|      0|          value = pns.negative ? T(-0.) : T(0.);
  ------------------
  |  Branch (4300:19): [True: 0, False: 0]
  ------------------
 4301|      0|          return answer;
 4302|      0|        }
 4303|      0|#endif
 4304|      0|        value = T(pns.mantissa) *
 4305|      0|                binary_format<T>::exact_power_of_ten(pns.exponent);
 4306|      0|        if (pns.negative) {
  ------------------
  |  Branch (4306:13): [True: 0, False: 0]
  ------------------
 4307|      0|          value = -value;
 4308|      0|        }
 4309|      0|        return answer;
 4310|      0|      }
 4311|      0|    }
 4312|  2.76M|  }
 4313|   729k|  adjusted_mantissa am =
 4314|   729k|      compute_float<binary_format<T>>(pns.exponent, pns.mantissa);
 4315|   729k|  if (pns.too_many_digits && am.power2 >= 0) {
  ------------------
  |  Branch (4315:7): [True: 708k, False: 21.6k]
  |  Branch (4315:30): [True: 708k, False: 0]
  ------------------
 4316|   708k|    if (am != compute_float<binary_format<T>>(pns.exponent, pns.mantissa + 1)) {
  ------------------
  |  Branch (4316:9): [True: 18.0k, False: 690k]
  ------------------
 4317|  18.0k|      am = compute_error<binary_format<T>>(pns.exponent, pns.mantissa);
 4318|  18.0k|    }
 4319|   708k|  }
 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|   729k|  if (am.power2 < 0) {
  ------------------
  |  Branch (4323:7): [True: 18.0k, False: 711k]
  ------------------
 4324|  18.0k|    am = digit_comp<T>(pns, am);
 4325|  18.0k|  }
 4326|   729k|  to_float(pns.negative, am, value);
 4327|       |  // Test for over/underflow.
 4328|   729k|  if ((pns.mantissa != 0 && am.mantissa == 0 && am.power2 == 0) ||
  ------------------
  |  Branch (4328:8): [True: 728k, False: 1.67k]
  |  Branch (4328:29): [True: 5.88k, False: 722k]
  |  Branch (4328:49): [True: 752, False: 5.13k]
  ------------------
 4329|   729k|      am.power2 == binary_format<T>::infinite_power()) {
  ------------------
  |  Branch (4329:7): [True: 1.56k, False: 727k]
  ------------------
 4330|  2.32k|    answer.ec = std::errc::result_out_of_range;
 4331|  2.32k|  }
 4332|   729k|  return answer;
 4333|  3.47M|}
_ZN3glz10fast_float13binary_formatIdE22min_exponent_fast_pathEv:
  695|  3.47M|inline constexpr int binary_format<double>::min_exponent_fast_path() {
  696|       |#if (FLT_EVAL_METHOD != 1) && (FLT_EVAL_METHOD != 0)
  697|       |  return 0;
  698|       |#else
  699|  3.47M|  return -22;
  700|  3.47M|#endif
  701|  3.47M|}
_ZN3glz10fast_float13binary_formatIdE22max_exponent_fast_pathEv:
  767|  3.46M|inline constexpr int binary_format<double>::max_exponent_fast_path() {
  768|  3.46M|  return 22;
  769|  3.46M|}
_ZN3glz10fast_float6detail17rounds_to_nearestEv:
 4129|  2.76M|fastfloat_really_inline bool rounds_to_nearest() noexcept {
 4130|       |  // https://lemire.me/blog/2020/06/26/gcc-not-nearest/
 4131|       |#if (FLT_EVAL_METHOD != 1) && (FLT_EVAL_METHOD != 0)
 4132|       |  return false;
 4133|       |#endif
 4134|       |  // See
 4135|       |  // A fast function to check your floating-point rounding mode
 4136|       |  // https://lemire.me/blog/2022/11/16/a-fast-function-to-check-your-floating-point-rounding-mode/
 4137|       |  //
 4138|       |  // This function is meant to be equivalent to :
 4139|       |  // prior: #include <cfenv>
 4140|       |  //  return fegetround() == FE_TONEAREST;
 4141|       |  // However, it is expected to be much faster than the fegetround()
 4142|       |  // function call.
 4143|       |  //
 4144|       |  // The volatile keyword prevents the compiler from computing the function
 4145|       |  // at compile-time.
 4146|       |  // There might be other ways to prevent compile-time optimizations (e.g.,
 4147|       |  // asm). The value does not need to be std::numeric_limits<float>::min(), any
 4148|       |  // small value so that 1 + x should round to 1 would do (after accounting for
 4149|       |  // excess precision, as in 387 instructions).
 4150|  2.76M|  static float volatile fmin = (std::numeric_limits<float>::min)();
 4151|  2.76M|  float fmini = fmin; // we copy it so that it gets loaded at most once.
 4152|       |//
 4153|       |// Explanation:
 4154|       |// Only when fegetround() == FE_TONEAREST do we have that
 4155|       |// fmin + 1.0f == 1.0f - fmin.
 4156|       |//
 4157|       |// FE_UPWARD:
 4158|       |//  fmin + 1.0f > 1
 4159|       |//  1.0f - fmin == 1
 4160|       |//
 4161|       |// FE_DOWNWARD or  FE_TOWARDZERO:
 4162|       |//  fmin + 1.0f == 1
 4163|       |//  1.0f - fmin < 1
 4164|       |//
 4165|       |// Note: This may fail to be accurate if fast-math has been
 4166|       |// enabled, as rounding conventions may not apply.
 4167|       |#ifdef GLZ_FASTFLOAT_VISUAL_STUDIO
 4168|       |#pragma warning(push)
 4169|       |//  todo: is there a VS warning?
 4170|       |//  see
 4171|       |//  https://stackoverflow.com/questions/46079446/is-there-a-warning-for-floating-point-equality-checking-in-visual-studio-2013
 4172|       |#elif defined(__clang__)
 4173|       |#pragma clang diagnostic push
 4174|  2.76M|#pragma clang diagnostic ignored "-Wfloat-equal"
 4175|       |#elif defined(__GNUC__)
 4176|       |#pragma GCC diagnostic push
 4177|       |#pragma GCC diagnostic ignored "-Wfloat-equal"
 4178|       |#endif
 4179|  2.76M|  return (fmini + 1.0f == 1.0f - fmini);
 4180|       |#ifdef GLZ_FASTFLOAT_VISUAL_STUDIO
 4181|       |#pragma warning(pop)
 4182|       |#elif defined(__clang__)
 4183|       |#pragma clang diagnostic pop
 4184|       |#elif defined(__GNUC__)
 4185|       |#pragma GCC diagnostic pop
 4186|       |#endif
 4187|  2.76M|}
_ZN3glz10fast_float13binary_formatIdE22max_mantissa_fast_pathEv:
  777|  2.76M|inline constexpr uint64_t binary_format<double>::max_mantissa_fast_path() {
  778|  2.76M|  return uint64_t(2) << mantissa_explicit_bits();
  779|  2.76M|}
_ZN3glz10fast_float13binary_formatIdE22mantissa_explicit_bitsEv:
  713|  7.94M|inline constexpr int binary_format<double>::mantissa_explicit_bits() {
  714|  7.94M|  return 52;
  715|  7.94M|}
_ZN3glz10fast_float13binary_formatIdE18exact_power_of_tenEl:
 1057|  2.74M|binary_format<double>::exact_power_of_ten(int64_t power) {
 1058|       |  // Work around clang bug https://godbolt.org/z/zedh7rrhc
 1059|  2.74M|  return (void)powers_of_ten[0], powers_of_ten[power];
 1060|  2.74M|}
_ZN3glz10fast_float13compute_floatINS0_13binary_formatIdEEEENS0_17adjusted_mantissaElm:
 2852|  1.43M|compute_float(int64_t q, uint64_t w) noexcept {
 2853|  1.43M|  adjusted_mantissa answer;
 2854|  1.43M|  if ((w == 0) || (q < binary::smallest_power_of_ten())) {
  ------------------
  |  Branch (2854:7): [True: 1.67k, False: 1.43M]
  |  Branch (2854:19): [True: 844, False: 1.43M]
  ------------------
 2855|  2.51k|    answer.power2 = 0;
 2856|  2.51k|    answer.mantissa = 0;
 2857|       |    // result should be zero
 2858|  2.51k|    return answer;
 2859|  2.51k|  }
 2860|  1.43M|  if (q > binary::largest_power_of_ten()) {
  ------------------
  |  Branch (2860:7): [True: 1.44k, False: 1.43M]
  ------------------
 2861|       |    // we want to get infinity:
 2862|  1.44k|    answer.power2 = binary::infinite_power();
 2863|  1.44k|    answer.mantissa = 0;
 2864|  1.44k|    return answer;
 2865|  1.44k|  }
 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|  1.43M|  int lz = leading_zeroes(w);
 2871|  1.43M|  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|  1.43M|  value128 product =
 2880|  1.43M|      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|  1.43M|  int upperbit = int(product.high >> 63);
 2891|  1.43M|  int shift = upperbit + 64 - binary::mantissa_explicit_bits() - 3;
 2892|       |
 2893|  1.43M|  answer.mantissa = product.high >> shift;
 2894|       |
 2895|  1.43M|  answer.power2 = int32_t(detail::power(int32_t(q)) + upperbit - lz -
 2896|  1.43M|                          binary::minimum_exponent());
 2897|  1.43M|  if (answer.power2 <= 0) { // we have a subnormal?
  ------------------
  |  Branch (2897:7): [True: 3.38k, False: 1.43M]
  ------------------
 2898|       |    // Here have that answer.power2 <= 0 so -answer.power2 >= 0
 2899|  3.38k|    if (-answer.power2 + 1 >=
  ------------------
  |  Branch (2899:9): [True: 190, False: 3.19k]
  ------------------
 2900|  3.38k|        64) { // if we have more than 64 bits below the minimum exponent, you
 2901|       |              // have a zero for sure.
 2902|    190|      answer.power2 = 0;
 2903|    190|      answer.mantissa = 0;
 2904|       |      // result should be zero
 2905|    190|      return answer;
 2906|    190|    }
 2907|       |    // next line is safe because -answer.power2 + 1 < 64
 2908|  3.19k|    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|  3.19k|    answer.mantissa += (answer.mantissa & 1); // round up
 2913|  3.19k|    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|  3.19k|    answer.power2 =
 2922|  3.19k|        (answer.mantissa < (uint64_t(1) << binary::mantissa_explicit_bits()))
  ------------------
  |  Branch (2922:9): [True: 3.19k, False: 4]
  ------------------
 2923|  3.19k|            ? 0
 2924|  3.19k|            : 1;
 2925|  3.19k|    return answer;
 2926|  3.38k|  }
 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|  1.43M|  if ((product.low <= 1) && (q >= binary::min_exponent_round_to_even()) &&
  ------------------
  |  Branch (2931:7): [True: 567k, False: 862k]
  |  Branch (2931:29): [True: 567k, False: 610]
  ------------------
 2932|   567k|      (q <= binary::max_exponent_round_to_even()) &&
  ------------------
  |  Branch (2932:7): [True: 566k, False: 222]
  ------------------
 2933|   566k|      ((answer.mantissa & 3) == 1)) { // we may fall between two floats!
  ------------------
  |  Branch (2933:7): [True: 457k, False: 109k]
  ------------------
 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|   457k|    if ((answer.mantissa << shift) == product.high) {
  ------------------
  |  Branch (2939:9): [True: 6.41k, False: 450k]
  ------------------
 2940|  6.41k|      answer.mantissa &= ~uint64_t(1); // flip it so that we do not round up
 2941|  6.41k|    }
 2942|   457k|  }
 2943|       |
 2944|  1.43M|  answer.mantissa += (answer.mantissa & 1); // round up
 2945|  1.43M|  answer.mantissa >>= 1;
 2946|  1.43M|  if (answer.mantissa >= (uint64_t(2) << binary::mantissa_explicit_bits())) {
  ------------------
  |  Branch (2946:7): [True: 3.22k, False: 1.42M]
  ------------------
 2947|  3.22k|    answer.mantissa = (uint64_t(1) << binary::mantissa_explicit_bits());
 2948|  3.22k|    answer.power2++; // undo previous addition
 2949|  3.22k|  }
 2950|       |
 2951|  1.43M|  answer.mantissa &= ~(uint64_t(1) << binary::mantissa_explicit_bits());
 2952|  1.43M|  if (answer.power2 >= binary::infinite_power()) { // infinity
  ------------------
  |  Branch (2952:7): [True: 942, False: 1.42M]
  ------------------
 2953|    942|    answer.power2 = binary::infinite_power();
 2954|    942|    answer.mantissa = 0;
 2955|    942|  }
 2956|  1.43M|  return answer;
 2957|  1.43M|}
_ZN3glz10fast_float17adjusted_mantissaC2Ev:
  568|  1.47M|  adjusted_mantissa() = default;
_ZN3glz10fast_float13binary_formatIdE21smallest_power_of_tenEv:
 1077|  1.43M|inline constexpr int binary_format<double>::smallest_power_of_ten() {
 1078|  1.43M|  return -342;
 1079|  1.43M|}
_ZN3glz10fast_float13binary_formatIdE20largest_power_of_tenEv:
 1068|  1.43M|template <> inline constexpr int binary_format<double>::largest_power_of_ten() {
 1069|  1.43M|  return 308;
 1070|  1.43M|}
_ZN3glz10fast_float14leading_zeroesEm:
  488|  1.46M|leading_zeroes(uint64_t input_num) {
  489|  1.46M|  assert(input_num > 0);
  ------------------
  |  Branch (489:3): [True: 1.46M, False: 0]
  ------------------
  490|  1.46M|  if (cpp20_and_in_constexpr()) {
  ------------------
  |  Branch (490:7): [Folded, False: 1.46M]
  ------------------
  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|  1.46M|  return __builtin_clzll(input_num);
  505|  1.46M|#endif
  506|  1.46M|}
_ZN3glz10fast_float29compute_product_approximationILi55EEENS0_8value128Elm:
 2771|  1.45M|compute_product_approximation(int64_t q, uint64_t w) {
 2772|  1.45M|  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|  1.45M|  value128 firstproduct =
 2777|  1.45M|      full_multiplication(w, powers::power_of_five_128[index]);
 2778|  1.45M|  static_assert((bit_precision >= 0) && (bit_precision <= 64),
 2779|  1.45M|                " precision should  be in (0,64]");
 2780|  1.45M|  constexpr uint64_t precision_mask =
 2781|  1.45M|      (bit_precision < 64) ? (uint64_t(0xFFFFFFFFFFFFFFFF) >> bit_precision)
  ------------------
  |  Branch (2781:7): [True: 0, Folded]
  ------------------
 2782|  1.45M|                           : uint64_t(0xFFFFFFFFFFFFFFFF);
 2783|  1.45M|  if ((firstproduct.high & precision_mask) ==
  ------------------
  |  Branch (2783:7): [True: 8.37k, False: 1.44M]
  ------------------
 2784|  1.45M|      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|  8.37k|    value128 secondproduct =
 2789|  8.37k|        full_multiplication(w, powers::power_of_five_128[index + 1]);
 2790|  8.37k|    firstproduct.low += secondproduct.high;
 2791|  8.37k|    if (secondproduct.high > firstproduct.low) {
  ------------------
  |  Branch (2791:9): [True: 3.26k, False: 5.10k]
  ------------------
 2792|  3.26k|      firstproduct.high++;
 2793|  3.26k|    }
 2794|  8.37k|  }
 2795|  1.45M|  return firstproduct;
 2796|  1.45M|}
_ZN3glz10fast_float19full_multiplicationEmm:
  540|  1.46M|full_multiplication(uint64_t a, uint64_t b) {
  541|  1.46M|  if (cpp20_and_in_constexpr()) {
  ------------------
  |  Branch (541:7): [Folded, False: 1.46M]
  ------------------
  542|      0|    value128 answer;
  543|      0|    answer.low = umul128_generic(a, b, &answer.high);
  544|      0|    return answer;
  545|      0|  }
  546|  1.46M|  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|  1.46M|  answer.low = uint64_t(r);
  558|  1.46M|  answer.high = uint64_t(r >> 64);
  559|       |#else
  560|       |  answer.low = umul128_generic(a, b, &answer.high);
  561|       |#endif
  562|  1.46M|  return answer;
  563|  1.46M|}
_ZN3glz10fast_float8value128C2Ev:
  454|  1.46M|  constexpr value128() : low(0), high(0) {}
_ZN3glz10fast_float6detail5powerEi:
 2814|  1.45M|constexpr fastfloat_really_inline int32_t power(int32_t q) noexcept {
 2815|  1.45M|  return (((152170 + 65536) * q) >> 16) + 63;
 2816|  1.45M|}
_ZN3glz10fast_float13binary_formatIdE16minimum_exponentEv:
  742|  1.47M|template <> inline constexpr int binary_format<double>::minimum_exponent() {
  743|  1.47M|  return -1023;
  744|  1.47M|}
_ZN3glz10fast_float13binary_formatIdE26min_exponent_round_to_evenEv:
  733|   567k|inline constexpr int binary_format<double>::min_exponent_round_to_even() {
  734|   567k|  return -4;
  735|   567k|}
_ZN3glz10fast_float13binary_formatIdE26max_exponent_round_to_evenEv:
  723|   567k|inline constexpr int binary_format<double>::max_exponent_round_to_even() {
  724|   567k|  return 23;
  725|   567k|}
_ZNK3glz10fast_float17adjusted_mantissaneERKS1_:
  574|   708k|  constexpr bool operator!=(adjusted_mantissa const &o) const {
  575|   708k|    return mantissa != o.mantissa || power2 != o.power2;
  ------------------
  |  Branch (575:12): [True: 18.0k, False: 690k]
  |  Branch (575:38): [True: 0, False: 690k]
  ------------------
  576|   708k|  }
_ZN3glz10fast_float13compute_errorINS0_13binary_formatIdEEEENS0_17adjusted_mantissaElm:
 2837|  18.0k|compute_error(int64_t q, uint64_t w) noexcept {
 2838|  18.0k|  int lz = leading_zeroes(w);
 2839|  18.0k|  w <<= lz;
 2840|  18.0k|  value128 product =
 2841|  18.0k|      compute_product_approximation<binary::mantissa_explicit_bits() + 3>(q, w);
 2842|  18.0k|  return compute_error_scaled<binary>(q, product.high, lz);
 2843|  18.0k|}
_ZN3glz10fast_float20compute_error_scaledINS0_13binary_formatIdEEEENS0_17adjusted_mantissaElmi:
 2823|  18.0k|compute_error_scaled(int64_t q, uint64_t w, int lz) noexcept {
 2824|  18.0k|  int hilz = int(w >> 63) ^ 1;
 2825|  18.0k|  adjusted_mantissa answer;
 2826|  18.0k|  answer.mantissa = w << hilz;
 2827|  18.0k|  int bias = binary::mantissa_explicit_bits() - binary::minimum_exponent();
 2828|  18.0k|  answer.power2 = int32_t(detail::power(int32_t(q)) + bias - hilz - lz - 62 +
 2829|  18.0k|                          invalid_am_bias);
 2830|  18.0k|  return answer;
 2831|  18.0k|}
_ZN3glz10fast_float10digit_compIdcEENS0_17adjusted_mantissaERNS0_22parsed_number_string_tIT0_EES2_:
 4034|  18.0k|digit_comp(parsed_number_string_t<UC> &num, adjusted_mantissa am) noexcept {
 4035|       |  // remove the invalid exponent bias
 4036|  18.0k|  am.power2 -= invalid_am_bias;
 4037|       |
 4038|  18.0k|  int32_t sci_exp = scientific_exponent(num);
 4039|  18.0k|  size_t max_digits = binary_format<T>::max_digits();
 4040|  18.0k|  size_t digits = 0;
 4041|  18.0k|  bigint bigmant;
 4042|  18.0k|  parse_mantissa(bigmant, num, max_digits, digits);
 4043|       |  // can't underflow, since digits is at most max_digits.
 4044|  18.0k|  int32_t exponent = sci_exp + 1 - int32_t(digits);
 4045|  18.0k|  if (exponent >= 0) {
  ------------------
  |  Branch (4045:7): [True: 6.12k, False: 11.9k]
  ------------------
 4046|  6.12k|    return positive_digit_comp<T>(bigmant, exponent);
 4047|  11.9k|  } else {
 4048|  11.9k|    return negative_digit_comp<T>(bigmant, am, exponent);
 4049|  11.9k|  }
 4050|  18.0k|}
_ZN3glz10fast_float19scientific_exponentIcEEiRNS0_22parsed_number_string_tIT_EE:
 3640|  18.0k|scientific_exponent(parsed_number_string_t<UC> &num) noexcept {
 3641|  18.0k|  uint64_t mantissa = num.mantissa;
 3642|  18.0k|  int32_t exponent = int32_t(num.exponent);
 3643|  90.2k|  while (mantissa >= 10000) {
  ------------------
  |  Branch (3643:10): [True: 72.2k, False: 18.0k]
  ------------------
 3644|  72.2k|    mantissa /= 10000;
 3645|  72.2k|    exponent += 4;
 3646|  72.2k|  }
 3647|  36.1k|  while (mantissa >= 100) {
  ------------------
  |  Branch (3647:10): [True: 18.0k, False: 18.0k]
  ------------------
 3648|  18.0k|    mantissa /= 100;
 3649|  18.0k|    exponent += 2;
 3650|  18.0k|  }
 3651|  18.0k|  while (mantissa >= 10) {
  ------------------
  |  Branch (3651:10): [True: 0, False: 18.0k]
  ------------------
 3652|      0|    mantissa /= 10;
 3653|      0|    exponent += 1;
 3654|      0|  }
 3655|  18.0k|  return exponent;
 3656|  18.0k|}
_ZN3glz10fast_float13binary_formatIdE10max_digitsEv:
 1085|  18.0k|template <> inline constexpr size_t binary_format<double>::max_digits() {
 1086|  18.0k|  return 769;
 1087|  18.0k|}
_ZN3glz10fast_float6bigintC2Ev:
 3399|  18.0k|  GLZ_FASTFLOAT_CONSTEXPR20 bigint() : vec() {}
_ZN3glz10fast_float8stackvecILt62EEC2Ev:
 3006|   103k|  stackvec() = default;
_ZN3glz10fast_float14parse_mantissaIcEEvRNS0_6bigintERNS0_22parsed_number_string_tIT_EEmRm:
 3859|  18.0k|               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|  18.0k|  size_t counter = 0;
 3864|  18.0k|  digits = 0;
 3865|  18.0k|  limb value = 0;
 3866|  18.0k|#ifdef GLZ_FASTFLOAT_64BIT_LIMB
 3867|  18.0k|  size_t step = 19;
 3868|       |#else
 3869|       |  size_t step = 9;
 3870|       |#endif
 3871|       |
 3872|       |  // process all integer digits.
 3873|  18.0k|  UC const *p = num.integer.ptr;
 3874|  18.0k|  UC const *pend = p + num.integer.len();
 3875|  18.0k|  skip_zeros(p, pend);
 3876|       |  // process all digits, in increments of step per loop
 3877|  36.3k|  while (p != pend) {
  ------------------
  |  Branch (3877:10): [True: 18.2k, False: 18.0k]
  ------------------
 3878|  39.0k|    while ((std::distance(p, pend) >= 8) && (step - counter >= 8) &&
  ------------------
  |  Branch (3878:12): [True: 27.2k, False: 11.8k]
  |  Branch (3878:45): [True: 20.7k, False: 6.42k]
  ------------------
 3879|  20.7k|           (max_digits - digits >= 8)) {
  ------------------
  |  Branch (3879:12): [True: 20.7k, False: 0]
  ------------------
 3880|  20.7k|      parse_eight_digits(p, value, counter, digits);
 3881|  20.7k|    }
 3882|  77.5k|    while (counter < step && p != pend && digits < max_digits) {
  ------------------
  |  Branch (3882:12): [True: 69.0k, False: 8.52k]
  |  Branch (3882:30): [True: 59.2k, False: 9.75k]
  |  Branch (3882:43): [True: 59.2k, False: 0]
  ------------------
 3883|  59.2k|      parse_one_digit(p, value, counter, digits);
 3884|  59.2k|    }
 3885|  18.2k|    if (digits == max_digits) {
  ------------------
  |  Branch (3885:9): [True: 0, False: 18.2k]
  ------------------
 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|  18.2k|    } else {
 3897|  18.2k|      add_native(result, limb(powers_of_ten_uint64[counter]), value);
 3898|  18.2k|      counter = 0;
 3899|  18.2k|      value = 0;
 3900|  18.2k|    }
 3901|  18.2k|  }
 3902|       |
 3903|       |  // add our fraction digits, if they're available.
 3904|  18.0k|  if (num.fraction.ptr != nullptr) {
  ------------------
  |  Branch (3904:7): [True: 12.9k, False: 5.08k]
  ------------------
 3905|  12.9k|    p = num.fraction.ptr;
 3906|  12.9k|    pend = p + num.fraction.len();
 3907|  12.9k|    if (digits == 0) {
  ------------------
  |  Branch (3907:9): [True: 8.29k, False: 4.67k]
  ------------------
 3908|  8.29k|      skip_zeros(p, pend);
 3909|  8.29k|    }
 3910|       |    // process all digits, in increments of step per loop
 3911|   156k|    while (p != pend) {
  ------------------
  |  Branch (3911:12): [True: 146k, False: 10.4k]
  ------------------
 3912|   425k|      while ((std::distance(p, pend) >= 8) && (step - counter >= 8) &&
  ------------------
  |  Branch (3912:14): [True: 413k, False: 11.8k]
  |  Branch (3912:47): [True: 281k, False: 132k]
  ------------------
 3913|   281k|             (max_digits - digits >= 8)) {
  ------------------
  |  Branch (3913:14): [True: 279k, False: 1.99k]
  ------------------
 3914|   279k|        parse_eight_digits(p, value, counter, digits);
 3915|   279k|      }
 3916|   589k|      while (counter < step && p != pend && digits < max_digits) {
  ------------------
  |  Branch (3916:14): [True: 454k, False: 134k]
  |  Branch (3916:32): [True: 444k, False: 9.49k]
  |  Branch (3916:45): [True: 442k, False: 2.22k]
  ------------------
 3917|   442k|        parse_one_digit(p, value, counter, digits);
 3918|   442k|      }
 3919|   146k|      if (digits == max_digits) {
  ------------------
  |  Branch (3919:11): [True: 2.49k, False: 144k]
  ------------------
 3920|       |        // add the temporary value, then check if we've truncated any digits
 3921|  2.49k|        add_native(result, limb(powers_of_ten_uint64[counter]), value);
 3922|  2.49k|        bool truncated = is_truncated(p, pend);
 3923|  2.49k|        if (truncated) {
  ------------------
  |  Branch (3923:13): [True: 866, False: 1.63k]
  ------------------
 3924|    866|          round_up_bigint(result, digits);
 3925|    866|        }
 3926|  2.49k|        return;
 3927|   144k|      } else {
 3928|   144k|        add_native(result, limb(powers_of_ten_uint64[counter]), value);
 3929|   144k|        counter = 0;
 3930|   144k|        value = 0;
 3931|   144k|      }
 3932|   146k|    }
 3933|  12.9k|  }
 3934|       |
 3935|  15.5k|  if (counter != 0) {
  ------------------
  |  Branch (3935:7): [True: 0, False: 15.5k]
  ------------------
 3936|      0|    add_native(result, limb(powers_of_ten_uint64[counter]), value);
 3937|      0|  }
 3938|  15.5k|}
_ZN3glz10fast_float10skip_zerosIcEEvRPKT_S4_:
 3773|  26.3k|skip_zeros(UC const *&first, UC const *last) noexcept {
 3774|  26.3k|  uint64_t val;
 3775|  79.1k|  while (!cpp20_and_in_constexpr() &&
  ------------------
  |  Branch (3775:10): [True: 79.1k, Folded]
  ------------------
 3776|  79.1k|         std::distance(first, last) >= int_cmp_len<UC>()) {
  ------------------
  |  Branch (3776:10): [True: 70.3k, False: 8.74k]
  ------------------
 3777|  70.3k|    ::memcpy(&val, first, sizeof(uint64_t));
 3778|  70.3k|    if (val != int_cmp_zeros<UC>()) {
  ------------------
  |  Branch (3778:9): [True: 17.5k, False: 52.7k]
  ------------------
 3779|  17.5k|      break;
 3780|  17.5k|    }
 3781|  52.7k|    first += int_cmp_len<UC>();
 3782|  52.7k|  }
 3783|  75.8k|  while (first != last) {
  ------------------
  |  Branch (3783:10): [True: 67.5k, False: 8.29k]
  ------------------
 3784|  67.5k|    if (*first != UC('0')) {
  ------------------
  |  Branch (3784:9): [True: 18.0k, False: 49.4k]
  ------------------
 3785|  18.0k|      break;
 3786|  18.0k|    }
 3787|  49.4k|    first++;
 3788|  49.4k|  }
 3789|  26.3k|}
_ZN3glz10fast_float11int_cmp_lenIcEEiv:
 1180|   162k|template <typename UC> constexpr int int_cmp_len() {
 1181|   162k|  return sizeof(uint64_t) / sizeof(UC);
 1182|   162k|}
_ZN3glz10fast_float13int_cmp_zerosIcEEmv:
 1170|  84.9k|template <typename UC> constexpr uint64_t int_cmp_zeros() {
 1171|  84.9k|  static_assert((sizeof(UC) == 1) || (sizeof(UC) == 2) || (sizeof(UC) == 4),
 1172|  84.9k|                "Unsupported character size");
 1173|  84.9k|  return (sizeof(UC) == 1) ? 0x3030303030303030
  ------------------
  |  Branch (1173:10): [True: 84.9k, Folded]
  ------------------
 1174|  84.9k|         : (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|  84.9k|}
_ZN3glz10fast_float18parse_eight_digitsIcEEvRPKT_RmS6_S6_:
 3824|   299k|                   size_t &count) noexcept {
 3825|   299k|  value = value * 100000000 + parse_eight_digits_unrolled(p);
 3826|   299k|  p += 8;
 3827|   299k|  counter += 8;
 3828|   299k|  count += 8;
 3829|   299k|}
_ZN3glz10fast_float27parse_eight_digits_unrolledIcEEjPKT_:
 1588|   299k|parse_eight_digits_unrolled(UC const *chars) noexcept {
 1589|   299k|  if (cpp20_and_in_constexpr() || !has_simd_opt<UC>()) {
  ------------------
  |  Branch (1589:7): [Folded, False: 0]
  |  Branch (1589:35): [True: 0, Folded]
  ------------------
 1590|   299k|    return parse_eight_digits_unrolled(read8_to_u64(chars)); // truncation okay
 1591|   299k|  }
 1592|      0|  return parse_eight_digits_unrolled(simd_read8_to_u64(chars));
 1593|   299k|}
_ZN3glz10fast_float15parse_one_digitIcEEvRPKT_RmS6_S6_:
 3834|   501k|                size_t &count) noexcept {
 3835|   501k|  value = value * 10 + limb(*p - UC('0'));
 3836|   501k|  p++;
 3837|   501k|  counter++;
 3838|   501k|  count++;
 3839|   501k|}
_ZN3glz10fast_float10add_nativeERNS0_6bigintEmm:
 3842|   165k|add_native(bigint &big, limb power, limb value) noexcept {
 3843|   165k|  big.mul(power);
 3844|   165k|  big.add(value);
 3845|   165k|}
_ZN3glz10fast_float6bigint3mulEm:
 3552|   165k|  GLZ_FASTFLOAT_CONSTEXPR20 bool mul(limb y) noexcept { return small_mul(vec, y); }
_ZN3glz10fast_float9small_mulILt62EEEbRNS0_8stackvecIXT_EEEm:
 3249|   284k|                                            limb y) noexcept {
 3250|   284k|  limb carry = 0;
 3251|  3.81M|  for (size_t index = 0; index < vec.len(); index++) {
  ------------------
  |  Branch (3251:26): [True: 3.52M, False: 284k]
  ------------------
 3252|  3.52M|    vec[index] = scalar_mul(vec[index], y, carry);
 3253|  3.52M|  }
 3254|   284k|  if (carry != 0) {
  ------------------
  |  Branch (3254:7): [True: 257k, False: 26.9k]
  ------------------
 3255|   257k|    GLZ_FASTFLOAT_TRY(vec.try_push(carry));
  ------------------
  |  |  354|   257k|  {                                                                            \
  |  |  355|   257k|    if (!(x))                                                                  \
  |  |  ------------------
  |  |  |  Branch (355:9): [True: 0, False: 257k]
  |  |  ------------------
  |  |  356|   257k|      return false;                                                            \
  |  |  357|   257k|  }
  ------------------
 3256|   257k|  }
 3257|   284k|  return true;
 3258|   284k|}
_ZNK3glz10fast_float8stackvecILt62EE3lenEv:
 3039|  5.07M|  constexpr size_t len() const noexcept { return length; }
_ZN3glz10fast_float10scalar_mulEmmRm:
 3196|  3.52M|scalar_mul(limb x, limb y, limb &carry) noexcept {
 3197|  3.52M|#ifdef GLZ_FASTFLOAT_64BIT_LIMB
 3198|  3.52M|#if defined(__SIZEOF_INT128__)
 3199|       |  // GCC and clang both define it as an extension.
 3200|  3.52M|  __uint128_t z = __uint128_t(x) * __uint128_t(y) + __uint128_t(carry);
 3201|  3.52M|  carry = limb(z >> limb_bits);
 3202|  3.52M|  return limb(z);
 3203|       |#else
 3204|       |  // fallback, no native 128-bit integer multiplication with carry.
 3205|       |  // on msvc, this optimizes identically, somehow.
 3206|       |  value128 z = full_multiplication(x, y);
 3207|       |  bool overflow;
 3208|       |  z.low = scalar_add(z.low, carry, overflow);
 3209|       |  z.high += uint64_t(overflow); // cannot overflow
 3210|       |  carry = z.high;
 3211|       |  return z.low;
 3212|       |#endif
 3213|       |#else
 3214|       |  uint64_t z = uint64_t(x) * uint64_t(y) + uint64_t(carry);
 3215|       |  carry = limb(z >> limb_bits);
 3216|       |  return limb(z);
 3217|       |#endif
 3218|  3.52M|}
_ZN3glz10fast_float8stackvecILt62EEixEm:
 3017|  9.14M|  GLZ_FASTFLOAT_CONSTEXPR14 limb &operator[](size_t index) noexcept {
 3018|  9.14M|    GLZ_FASTFLOAT_DEBUG_ASSERT(index < length);
  ------------------
  |  |  349|  9.14M|  { ((void)(x)); }
  ------------------
 3019|  9.14M|    return data[index];
 3020|  9.14M|  }
_ZN3glz10fast_float8stackvecILt62EE8try_pushEm:
 3052|   280k|  GLZ_FASTFLOAT_CONSTEXPR14 bool try_push(limb value) noexcept {
 3053|   280k|    if (len() < capacity()) {
  ------------------
  |  Branch (3053:9): [True: 280k, False: 0]
  ------------------
 3054|   280k|      push_unchecked(value);
 3055|   280k|      return true;
 3056|   280k|    } else {
 3057|      0|      return false;
 3058|      0|    }
 3059|   280k|  }
_ZNK3glz10fast_float8stackvecILt62EE8capacityEv:
 3043|   454k|  constexpr size_t capacity() const noexcept { return size; }
_ZN3glz10fast_float8stackvecILt62EE14push_uncheckedEm:
 3046|   291k|  GLZ_FASTFLOAT_CONSTEXPR14 void push_unchecked(limb value) noexcept {
 3047|   291k|    data[length] = value;
 3048|   291k|    length++;
 3049|   291k|  }
_ZN3glz10fast_float6bigint3addEm:
 3554|   165k|  GLZ_FASTFLOAT_CONSTEXPR20 bool add(limb y) noexcept { return small_add(vec, y); }
_ZN3glz10fast_float9small_addILt62EEEbRNS0_8stackvecIXT_EEEm:
 3242|   165k|small_add(stackvec<size> &vec, limb y) noexcept {
 3243|   165k|  return small_add_from(vec, y, 0);
 3244|   165k|}
_ZN3glz10fast_float14small_add_fromILt62EEEbRNS0_8stackvecIXT_EEEmm:
 3224|   165k|                                                 size_t start) noexcept {
 3225|   165k|  size_t index = start;
 3226|   165k|  limb carry = y;
 3227|   165k|  bool overflow;
 3228|   201k|  while (carry != 0 && index < vec.len()) {
  ------------------
  |  Branch (3228:10): [True: 54.3k, False: 147k]
  |  Branch (3228:24): [True: 36.0k, False: 18.2k]
  ------------------
 3229|  36.0k|    vec[index] = scalar_add(vec[index], carry, overflow);
 3230|  36.0k|    carry = limb(overflow);
 3231|  36.0k|    index += 1;
 3232|  36.0k|  }
 3233|   165k|  if (carry != 0) {
  ------------------
  |  Branch (3233:7): [True: 18.2k, False: 147k]
  ------------------
 3234|  18.2k|    GLZ_FASTFLOAT_TRY(vec.try_push(carry));
  ------------------
  |  |  354|  18.2k|  {                                                                            \
  |  |  355|  18.2k|    if (!(x))                                                                  \
  |  |  ------------------
  |  |  |  Branch (355:9): [True: 0, False: 18.2k]
  |  |  ------------------
  |  |  356|  18.2k|      return false;                                                            \
  |  |  357|  18.2k|  }
  ------------------
 3235|  18.2k|  }
 3236|   165k|  return true;
 3237|   165k|}
_ZN3glz10fast_float10scalar_addEmmRb:
 3176|  1.34M|scalar_add(limb x, limb y, bool &overflow) noexcept {
 3177|  1.34M|  limb z;
 3178|       |// gcc and clang
 3179|  1.34M|#if defined(__has_builtin)
 3180|  1.34M|#if __has_builtin(__builtin_add_overflow)
 3181|  1.34M|  if (!cpp20_and_in_constexpr()) {
  ------------------
  |  Branch (3181:7): [True: 1.34M, Folded]
  ------------------
 3182|  1.34M|    overflow = __builtin_add_overflow(x, y, &z);
 3183|  1.34M|    return z;
 3184|  1.34M|  }
 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.34M|}
_ZN3glz10fast_float12is_truncatedIcEEbPKT_S4_:
 3795|  2.49k|is_truncated(UC const *first, UC const *last) noexcept {
 3796|       |  // do 8-bit optimizations, can just compare to 8 literal 0s.
 3797|  2.49k|  uint64_t val;
 3798|  16.6k|  while (!cpp20_and_in_constexpr() &&
  ------------------
  |  Branch (3798:10): [True: 16.6k, Folded]
  ------------------
 3799|  16.6k|         std::distance(first, last) >= int_cmp_len<UC>()) {
  ------------------
  |  Branch (3799:10): [True: 14.5k, False: 2.06k]
  ------------------
 3800|  14.5k|    ::memcpy(&val, first, sizeof(uint64_t));
 3801|  14.5k|    if (val != int_cmp_zeros<UC>()) {
  ------------------
  |  Branch (3801:9): [True: 434, False: 14.1k]
  ------------------
 3802|    434|      return true;
 3803|    434|    }
 3804|  14.1k|    first += int_cmp_len<UC>();
 3805|  14.1k|  }
 3806|  6.90k|  while (first != last) {
  ------------------
  |  Branch (3806:10): [True: 5.27k, False: 1.63k]
  ------------------
 3807|  5.27k|    if (*first != UC('0')) {
  ------------------
  |  Branch (3807:9): [True: 432, False: 4.84k]
  ------------------
 3808|    432|      return true;
 3809|    432|    }
 3810|  4.84k|    ++first;
 3811|  4.84k|  }
 3812|  1.63k|  return false;
 3813|  2.06k|}
_ZN3glz10fast_float15round_up_bigintERNS0_6bigintERm:
 3848|    866|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|    866|  add_native(big, 10, 1);
 3852|    866|  count++;
 3853|    866|}
_ZN3glz10fast_float19positive_digit_compIdEENS0_17adjusted_mantissaERNS0_6bigintEi:
 3942|  6.12k|positive_digit_comp(bigint &bigmant, int32_t exponent) noexcept {
 3943|  6.12k|  GLZ_FASTFLOAT_ASSERT(bigmant.pow10(uint32_t(exponent)));
  ------------------
  |  |  344|  6.12k|  { ((void)(x)); }
  ------------------
 3944|  6.12k|  adjusted_mantissa answer;
 3945|  6.12k|  bool truncated;
 3946|  6.12k|  answer.mantissa = bigmant.hi64(truncated);
 3947|  6.12k|  int bias = binary_format<T>::mantissa_explicit_bits() -
 3948|  6.12k|             binary_format<T>::minimum_exponent();
 3949|  6.12k|  answer.power2 = bigmant.bit_length() - 64 + bias;
 3950|       |
 3951|  6.12k|  round<T>(answer, [truncated](adjusted_mantissa &a, int32_t shift) {
 3952|  6.12k|    round_nearest_tie_even(
 3953|  6.12k|        a, shift,
 3954|  6.12k|        [truncated](bool is_odd, bool is_halfway, bool is_above) -> bool {
 3955|  6.12k|          return is_above || (is_halfway && truncated) ||
 3956|  6.12k|                 (is_odd && is_halfway);
 3957|  6.12k|        });
 3958|  6.12k|  });
 3959|       |
 3960|  6.12k|  return answer;
 3961|  6.12k|}
_ZN3glz10fast_float6bigint5pow10Ej:
 3591|  6.12k|  GLZ_FASTFLOAT_CONSTEXPR20 bool pow10(uint32_t exp) noexcept {
 3592|  6.12k|    GLZ_FASTFLOAT_TRY(pow5(exp));
  ------------------
  |  |  354|  6.12k|  {                                                                            \
  |  |  355|  6.12k|    if (!(x))                                                                  \
  |  |  ------------------
  |  |  |  Branch (355:9): [True: 0, False: 6.12k]
  |  |  ------------------
  |  |  356|  6.12k|      return false;                                                            \
  |  |  357|  6.12k|  }
  ------------------
 3593|  6.12k|    return pow2(exp);
 3594|  6.12k|  }
_ZN3glz10fast_float6bigint4pow5Ej:
 3560|  18.0k|  GLZ_FASTFLOAT_CONSTEXPR20 bool pow5(uint32_t exp) noexcept {
 3561|       |    // multiply by a power of 5
 3562|  18.0k|    size_t large_length = sizeof(large_power_of_5) / sizeof(limb);
 3563|  18.0k|    limb_span large = limb_span(large_power_of_5, large_length);
 3564|  36.4k|    while (exp >= large_step) {
  ------------------
  |  Branch (3564:12): [True: 18.4k, False: 18.0k]
  ------------------
 3565|  18.4k|      GLZ_FASTFLOAT_TRY(large_mul(vec, large));
  ------------------
  |  |  354|  18.4k|  {                                                                            \
  |  |  355|  18.4k|    if (!(x))                                                                  \
  |  |  ------------------
  |  |  |  Branch (355:9): [True: 0, False: 18.4k]
  |  |  ------------------
  |  |  356|  18.4k|      return false;                                                            \
  |  |  357|  18.4k|  }
  ------------------
 3566|  18.4k|      exp -= large_step;
 3567|  18.4k|    }
 3568|  18.0k|#ifdef GLZ_FASTFLOAT_64BIT_LIMB
 3569|  18.0k|    uint32_t small_step = 27;
 3570|  18.0k|    limb max_native = 7450580596923828125UL;
 3571|       |#else
 3572|       |    uint32_t small_step = 13;
 3573|       |    limb max_native = 1220703125U;
 3574|       |#endif
 3575|  33.8k|    while (exp >= small_step) {
  ------------------
  |  Branch (3575:12): [True: 15.7k, False: 18.0k]
  ------------------
 3576|  15.7k|      GLZ_FASTFLOAT_TRY(small_mul(vec, max_native));
  ------------------
  |  |  354|  15.7k|  {                                                                            \
  |  |  355|  15.7k|    if (!(x))                                                                  \
  |  |  ------------------
  |  |  |  Branch (355:9): [True: 0, False: 15.7k]
  |  |  ------------------
  |  |  356|  15.7k|      return false;                                                            \
  |  |  357|  15.7k|  }
  ------------------
 3577|  15.7k|      exp -= small_step;
 3578|  15.7k|    }
 3579|  18.0k|    if (exp != 0) {
  ------------------
  |  Branch (3579:9): [True: 10.9k, False: 7.11k]
  ------------------
 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|  10.9k|      GLZ_FASTFLOAT_TRY(small_mul(
  ------------------
  |  |  354|  10.9k|  {                                                                            \
  |  |  355|  10.9k|    if (!(x))                                                                  \
  |  |  ------------------
  |  |  |  Branch (355:9): [True: 0, False: 10.9k]
  |  |  ------------------
  |  |  356|  10.9k|      return false;                                                            \
  |  |  357|  10.9k|  }
  ------------------
 3584|  10.9k|          vec, limb(((void)small_power_of_5[0], small_power_of_5[exp]))));
 3585|  10.9k|    }
 3586|       |
 3587|  18.0k|    return true;
 3588|  18.0k|  }
_ZN3glz10fast_float4spanImEC2EPKmm:
  436|   128k|  constexpr span(T const *_ptr, size_t _length) : ptr(_ptr), length(_length) {}
_ZN3glz10fast_float9large_mulILt62EEEbRNS0_8stackvecIXT_EEENS0_4spanImEE:
 3329|  18.4k|GLZ_FASTFLOAT_CONSTEXPR20 bool large_mul(stackvec<size> &x, limb_span y) noexcept {
 3330|  18.4k|  if (y.len() == 1) {
  ------------------
  |  Branch (3330:7): [True: 0, False: 18.4k]
  ------------------
 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|  18.4k|  } else {
 3333|  18.4k|    GLZ_FASTFLOAT_TRY(long_mul(x, y));
  ------------------
  |  |  354|  18.4k|  {                                                                            \
  |  |  355|  18.4k|    if (!(x))                                                                  \
  |  |  ------------------
  |  |  |  Branch (355:9): [True: 0, False: 18.4k]
  |  |  ------------------
  |  |  356|  18.4k|      return false;                                                            \
  |  |  357|  18.4k|  }
  ------------------
 3334|  18.4k|  }
 3335|  18.4k|  return true;
 3336|  18.4k|}
_ZNK3glz10fast_float4spanImE3lenEv:
  440|  1.52M|  constexpr size_t len() const noexcept { return length; }
_ZNK3glz10fast_float4spanImEixEm:
  442|   993k|  GLZ_FASTFLOAT_CONSTEXPR14 const T &operator[](size_t index) const noexcept {
  443|   993k|    GLZ_FASTFLOAT_DEBUG_ASSERT(index < length);
  ------------------
  |  |  349|   993k|  { ((void)(x)); }
  ------------------
  444|   993k|    return ptr[index];
  445|   993k|  }
_ZN3glz10fast_float8long_mulILt62EEEbRNS0_8stackvecIXT_EEENS0_4spanImEE:
 3301|  18.4k|GLZ_FASTFLOAT_CONSTEXPR20 bool long_mul(stackvec<size> &x, limb_span y) noexcept {
 3302|  18.4k|  limb_span xs = limb_span(x.data, x.len());
 3303|  18.4k|  stackvec<size> z(xs);
 3304|  18.4k|  limb_span zs = limb_span(z.data, z.len());
 3305|       |
 3306|  18.4k|  if (y.len() != 0) {
  ------------------
  |  Branch (3306:7): [True: 18.4k, False: 0]
  ------------------
 3307|  18.4k|    limb y0 = y[0];
 3308|  18.4k|    GLZ_FASTFLOAT_TRY(small_mul(x, y0));
  ------------------
  |  |  354|  18.4k|  {                                                                            \
  |  |  355|  18.4k|    if (!(x))                                                                  \
  |  |  ------------------
  |  |  |  Branch (355:9): [True: 0, False: 18.4k]
  |  |  ------------------
  |  |  356|  18.4k|      return false;                                                            \
  |  |  357|  18.4k|  }
  ------------------
 3309|  92.0k|    for (size_t index = 1; index < y.len(); index++) {
  ------------------
  |  Branch (3309:28): [True: 73.6k, False: 18.4k]
  ------------------
 3310|  73.6k|      limb yi = y[index];
 3311|  73.6k|      stackvec<size> zi;
 3312|  73.6k|      if (yi != 0) {
  ------------------
  |  Branch (3312:11): [True: 73.6k, False: 0]
  ------------------
 3313|       |        // re-use the same buffer throughout
 3314|  73.6k|        zi.set_len(0);
 3315|  73.6k|        GLZ_FASTFLOAT_TRY(zi.try_extend(zs));
  ------------------
  |  |  354|  73.6k|  {                                                                            \
  |  |  355|  73.6k|    if (!(x))                                                                  \
  |  |  ------------------
  |  |  |  Branch (355:9): [True: 0, False: 73.6k]
  |  |  ------------------
  |  |  356|  73.6k|      return false;                                                            \
  |  |  357|  73.6k|  }
  ------------------
 3316|  73.6k|        GLZ_FASTFLOAT_TRY(small_mul(zi, yi));
  ------------------
  |  |  354|  73.6k|  {                                                                            \
  |  |  355|  73.6k|    if (!(x))                                                                  \
  |  |  ------------------
  |  |  |  Branch (355:9): [True: 0, False: 73.6k]
  |  |  ------------------
  |  |  356|  73.6k|      return false;                                                            \
  |  |  357|  73.6k|  }
  ------------------
 3317|  73.6k|        limb_span zis = limb_span(zi.data, zi.len());
 3318|  73.6k|        GLZ_FASTFLOAT_TRY(large_add_from(x, zis, index));
  ------------------
  |  |  354|  73.6k|  {                                                                            \
  |  |  355|  73.6k|    if (!(x))                                                                  \
  |  |  ------------------
  |  |  |  Branch (355:9): [True: 0, False: 73.6k]
  |  |  ------------------
  |  |  356|  73.6k|      return false;                                                            \
  |  |  357|  73.6k|  }
  ------------------
 3319|  73.6k|      }
 3320|  73.6k|    }
 3321|  18.4k|  }
 3322|       |
 3323|  18.4k|  x.normalize();
 3324|  18.4k|  return true;
 3325|  18.4k|}
_ZN3glz10fast_float8stackvecILt62EEC2ENS0_4spanImEE:
 3013|  18.4k|  GLZ_FASTFLOAT_CONSTEXPR20 stackvec(limb_span s) {
 3014|  18.4k|    GLZ_FASTFLOAT_ASSERT(try_extend(s));
  ------------------
  |  |  344|  18.4k|  { ((void)(x)); }
  ------------------
 3015|  18.4k|  }
_ZN3glz10fast_float8stackvecILt62EE7set_lenEm:
 3035|   248k|  GLZ_FASTFLOAT_CONSTEXPR14 void set_len(size_t len) noexcept {
 3036|   248k|    length = uint16_t(len);
 3037|   248k|  }
_ZN3glz10fast_float8stackvecILt62EE10try_extendENS0_4spanImEE:
 3069|  92.0k|  GLZ_FASTFLOAT_CONSTEXPR20 bool try_extend(limb_span s) noexcept {
 3070|  92.0k|    if (len() + s.len() <= capacity()) {
  ------------------
  |  Branch (3070:9): [True: 92.0k, False: 0]
  ------------------
 3071|  92.0k|      extend_unchecked(s);
 3072|  92.0k|      return true;
 3073|  92.0k|    } else {
 3074|      0|      return false;
 3075|      0|    }
 3076|  92.0k|  }
_ZN3glz10fast_float8stackvecILt62EE16extend_uncheckedENS0_4spanImEE:
 3062|  92.0k|  GLZ_FASTFLOAT_CONSTEXPR20 void extend_unchecked(limb_span s) noexcept {
 3063|  92.0k|    limb *ptr = data + length;
 3064|  92.0k|    std::copy_n(s.ptr, s.len(), ptr);
 3065|  92.0k|    set_len(len() + s.len());
 3066|  92.0k|  }
_ZN3glz10fast_float14large_add_fromILt62EEEbRNS0_8stackvecIXT_EEENS0_4spanImEEm:
 3264|  73.6k|                                          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|  73.6k|  if (x.len() < start || y.len() > x.len() - start) {
  ------------------
  |  Branch (3267:7): [True: 0, False: 73.6k]
  |  Branch (3267:26): [True: 73.6k, False: 0]
  ------------------
 3268|  73.6k|    GLZ_FASTFLOAT_TRY(x.try_resize(y.len() + start, 0));
  ------------------
  |  |  354|  73.6k|  {                                                                            \
  |  |  355|  73.6k|    if (!(x))                                                                  \
  |  |  ------------------
  |  |  |  Branch (355:9): [True: 0, False: 73.6k]
  |  |  ------------------
  |  |  356|  73.6k|      return false;                                                            \
  |  |  357|  73.6k|  }
  ------------------
 3269|  73.6k|  }
 3270|       |
 3271|  73.6k|  bool carry = false;
 3272|   974k|  for (size_t index = 0; index < y.len(); index++) {
  ------------------
  |  Branch (3272:26): [True: 901k, False: 73.6k]
  ------------------
 3273|   901k|    limb xi = x[index + start];
 3274|   901k|    limb yi = y[index];
 3275|   901k|    bool c1 = false;
 3276|   901k|    bool c2 = false;
 3277|   901k|    xi = scalar_add(xi, yi, c1);
 3278|   901k|    if (carry) {
  ------------------
  |  Branch (3278:9): [True: 404k, False: 496k]
  ------------------
 3279|   404k|      xi = scalar_add(xi, 1, c2);
 3280|   404k|    }
 3281|   901k|    x[index + start] = xi;
 3282|   901k|    carry = c1 | c2;
 3283|   901k|  }
 3284|       |
 3285|       |  // handle overflow
 3286|  73.6k|  if (carry) {
  ------------------
  |  Branch (3286:7): [True: 0, False: 73.6k]
  ------------------
 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|  73.6k|  return true;
 3290|  73.6k|}
_ZN3glz10fast_float8stackvecILt62EE10try_resizeEmm:
 3095|  73.6k|  GLZ_FASTFLOAT_CONSTEXPR20 bool try_resize(size_t new_len, limb value) noexcept {
 3096|  73.6k|    if (new_len > capacity()) {
  ------------------
  |  Branch (3096:9): [True: 0, False: 73.6k]
  ------------------
 3097|      0|      return false;
 3098|  73.6k|    } else {
 3099|  73.6k|      resize_unchecked(new_len, value);
 3100|  73.6k|      return true;
 3101|  73.6k|    }
 3102|  73.6k|  }
_ZN3glz10fast_float8stackvecILt62EE16resize_uncheckedEmm:
 3082|  73.6k|  void resize_unchecked(size_t new_len, limb value) noexcept {
 3083|  73.6k|    if (new_len > len()) {
  ------------------
  |  Branch (3083:9): [True: 73.6k, False: 0]
  ------------------
 3084|  73.6k|      size_t count = new_len - len();
 3085|  73.6k|      limb *first = data + len();
 3086|  73.6k|      limb *last = first + count;
 3087|  73.6k|      ::std::fill(first, last, value);
 3088|  73.6k|      set_len(new_len);
 3089|  73.6k|    } else {
 3090|      0|      set_len(new_len);
 3091|      0|    }
 3092|  73.6k|  }
_ZN3glz10fast_float8stackvecILt62EE9normalizeEv:
 3118|  30.3k|  GLZ_FASTFLOAT_CONSTEXPR14 void normalize() noexcept {
 3119|  30.3k|    while (len() > 0 && rindex(0) == 0) {
  ------------------
  |  Branch (3119:12): [True: 30.3k, False: 0]
  |  Branch (3119:25): [True: 0, False: 30.3k]
  ------------------
 3120|      0|      length--;
 3121|      0|    }
 3122|  30.3k|  }
_ZNK3glz10fast_float8stackvecILt62EE6rindexEm:
 3028|  48.7k|  GLZ_FASTFLOAT_CONSTEXPR14 const limb &rindex(size_t index) const noexcept {
 3029|  48.7k|    GLZ_FASTFLOAT_DEBUG_ASSERT(index < length);
  ------------------
  |  |  349|  48.7k|  { ((void)(x)); }
  ------------------
 3030|  48.7k|    size_t rindex = length - index - 1;
 3031|  48.7k|    return data[rindex];
 3032|  48.7k|  }
_ZN3glz10fast_float6bigint4pow2Ej:
 3557|  17.8k|  GLZ_FASTFLOAT_CONSTEXPR20 bool pow2(uint32_t exp) noexcept { return shl(exp); }
_ZN3glz10fast_float6bigint3shlEm:
 3519|  17.8k|  GLZ_FASTFLOAT_CONSTEXPR20 bool shl(size_t n) noexcept {
 3520|  17.8k|    size_t rem = n % limb_bits;
 3521|  17.8k|    size_t div = n / limb_bits;
 3522|  17.8k|    if (rem != 0) {
  ------------------
  |  Branch (3522:9): [True: 10.5k, False: 7.28k]
  ------------------
 3523|  10.5k|      GLZ_FASTFLOAT_TRY(shl_bits(rem));
  ------------------
  |  |  354|  10.5k|  {                                                                            \
  |  |  355|  10.5k|    if (!(x))                                                                  \
  |  |  ------------------
  |  |  |  Branch (355:9): [True: 0, False: 10.5k]
  |  |  ------------------
  |  |  356|  10.5k|      return false;                                                            \
  |  |  357|  10.5k|  }
  ------------------
 3524|  10.5k|    }
 3525|  17.8k|    if (div != 0) {
  ------------------
  |  Branch (3525:9): [True: 9.26k, False: 8.58k]
  ------------------
 3526|  9.26k|      GLZ_FASTFLOAT_TRY(shl_limbs(div));
  ------------------
  |  |  354|  9.26k|  {                                                                            \
  |  |  355|  9.26k|    if (!(x))                                                                  \
  |  |  ------------------
  |  |  |  Branch (355:9): [True: 0, False: 9.26k]
  |  |  ------------------
  |  |  356|  9.26k|      return false;                                                            \
  |  |  357|  9.26k|  }
  ------------------
 3527|  9.26k|    }
 3528|  17.8k|    return true;
 3529|  17.8k|  }
_ZN3glz10fast_float6bigint8shl_bitsEm:
 3472|  10.5k|  GLZ_FASTFLOAT_CONSTEXPR20 bool shl_bits(size_t n) noexcept {
 3473|       |    // Internally, for each item, we shift left by n, and add the previous
 3474|       |    // right shifted limb-bits.
 3475|       |    // For example, we transform (for u8) shifted left 2, to:
 3476|       |    //      b10100100 b01000010
 3477|       |    //      b10 b10010001 b00001000
 3478|  10.5k|    GLZ_FASTFLOAT_DEBUG_ASSERT(n != 0);
  ------------------
  |  |  349|  10.5k|  { ((void)(x)); }
  ------------------
 3479|  10.5k|    GLZ_FASTFLOAT_DEBUG_ASSERT(n < sizeof(limb) * 8);
  ------------------
  |  |  349|  10.5k|  { ((void)(x)); }
  ------------------
 3480|       |
 3481|  10.5k|    size_t shl = n;
 3482|  10.5k|    size_t shr = limb_bits - shl;
 3483|  10.5k|    limb prev = 0;
 3484|   120k|    for (size_t index = 0; index < vec.len(); index++) {
  ------------------
  |  Branch (3484:28): [True: 110k, False: 10.5k]
  ------------------
 3485|   110k|      limb xi = vec[index];
 3486|   110k|      vec[index] = (xi << shl) | (prev >> shr);
 3487|   110k|      prev = xi;
 3488|   110k|    }
 3489|       |
 3490|  10.5k|    limb carry = prev >> shr;
 3491|  10.5k|    if (carry != 0) {
  ------------------
  |  Branch (3491:9): [True: 4.42k, False: 6.13k]
  ------------------
 3492|  4.42k|      return vec.try_push(carry);
 3493|  4.42k|    }
 3494|  6.13k|    return true;
 3495|  10.5k|  }
_ZN3glz10fast_float6bigint9shl_limbsEm:
 3498|  9.26k|  GLZ_FASTFLOAT_CONSTEXPR20 bool shl_limbs(size_t n) noexcept {
 3499|  9.26k|    GLZ_FASTFLOAT_DEBUG_ASSERT(n != 0);
  ------------------
  |  |  349|  9.26k|  { ((void)(x)); }
  ------------------
 3500|  9.26k|    if (n + vec.len() > vec.capacity()) {
  ------------------
  |  Branch (3500:9): [True: 0, False: 9.26k]
  ------------------
 3501|      0|      return false;
 3502|  9.26k|    } else if (!vec.is_empty()) {
  ------------------
  |  Branch (3502:16): [True: 9.26k, False: 0]
  ------------------
 3503|       |      // move limbs
 3504|  9.26k|      limb *dst = vec.data + n;
 3505|  9.26k|      limb const *src = vec.data;
 3506|  9.26k|      std::copy_backward(src, src + vec.len(), dst + vec.len());
 3507|       |      // fill in empty limbs
 3508|  9.26k|      limb *first = vec.data;
 3509|  9.26k|      limb *last = first + n;
 3510|  9.26k|      ::std::fill(first, last, 0);
 3511|  9.26k|      vec.set_len(n + vec.len());
 3512|  9.26k|      return true;
 3513|  9.26k|    } else {
 3514|      0|      return true;
 3515|      0|    }
 3516|  9.26k|  }
_ZNK3glz10fast_float8stackvecILt62EE8is_emptyEv:
 3041|  15.3k|  constexpr bool is_empty() const noexcept { return length == 0; }
_ZNK3glz10fast_float6bigint4hi64ERb:
 3418|  6.12k|  GLZ_FASTFLOAT_CONSTEXPR20 uint64_t hi64(bool &truncated) const noexcept {
 3419|  6.12k|#ifdef GLZ_FASTFLOAT_64BIT_LIMB
 3420|  6.12k|    if (vec.len() == 0) {
  ------------------
  |  Branch (3420:9): [True: 0, False: 6.12k]
  ------------------
 3421|      0|      return empty_hi64(truncated);
 3422|  6.12k|    } else if (vec.len() == 1) {
  ------------------
  |  Branch (3422:16): [True: 1.02k, False: 5.09k]
  ------------------
 3423|  1.02k|      return uint64_hi64(vec.rindex(0), truncated);
 3424|  5.09k|    } else {
 3425|  5.09k|      uint64_t result = uint64_hi64(vec.rindex(0), vec.rindex(1), truncated);
 3426|  5.09k|      truncated |= vec.nonzero(2);
 3427|  5.09k|      return result;
 3428|  5.09k|    }
 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|  6.12k|  }
_ZN3glz10fast_float11uint64_hi64EmRb:
 3132|  1.02k|uint64_hi64(uint64_t r0, bool &truncated) noexcept {
 3133|  1.02k|  truncated = false;
 3134|  1.02k|  int shl = leading_zeroes(r0);
 3135|  1.02k|  return r0 << shl;
 3136|  1.02k|}
_ZN3glz10fast_float11uint64_hi64EmmRb:
 3139|  5.09k|uint64_hi64(uint64_t r0, uint64_t r1, bool &truncated) noexcept {
 3140|  5.09k|  int shl = leading_zeroes(r0);
 3141|  5.09k|  if (shl == 0) {
  ------------------
  |  Branch (3141:7): [True: 260, False: 4.83k]
  ------------------
 3142|    260|    truncated = r1 != 0;
 3143|    260|    return r0;
 3144|  4.83k|  } else {
 3145|  4.83k|    int shr = 64 - shl;
 3146|  4.83k|    truncated = (r1 << shl) != 0;
 3147|  4.83k|    return (r0 << shl) | (r1 >> shr);
 3148|  4.83k|  }
 3149|  5.09k|}
_ZNK3glz10fast_float8stackvecILt62EE7nonzeroEm:
 3107|  5.09k|  GLZ_FASTFLOAT_CONSTEXPR14 bool nonzero(size_t index) const noexcept {
 3108|  5.09k|    while (index < len()) {
  ------------------
  |  Branch (3108:12): [True: 1.09k, False: 4.00k]
  ------------------
 3109|  1.09k|      if (rindex(index) != 0) {
  ------------------
  |  Branch (3109:11): [True: 1.09k, False: 0]
  ------------------
 3110|  1.09k|        return true;
 3111|  1.09k|      }
 3112|      0|      index++;
 3113|      0|    }
 3114|  4.00k|    return false;
 3115|  5.09k|  }
_ZNK3glz10fast_float6bigint10bit_lengthEv:
 3547|  6.12k|  GLZ_FASTFLOAT_CONSTEXPR20 int bit_length() const noexcept {
 3548|  6.12k|    int lz = ctlz();
 3549|  6.12k|    return int(limb_bits * vec.len()) - lz;
 3550|  6.12k|  }
_ZNK3glz10fast_float6bigint4ctlzEv:
 3532|  6.12k|  GLZ_FASTFLOAT_CONSTEXPR20 int ctlz() const noexcept {
 3533|  6.12k|    if (vec.is_empty()) {
  ------------------
  |  Branch (3533:9): [True: 0, False: 6.12k]
  ------------------
 3534|      0|      return 0;
 3535|  6.12k|    } else {
 3536|  6.12k|#ifdef GLZ_FASTFLOAT_64BIT_LIMB
 3537|  6.12k|      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|  6.12k|    }
 3544|  6.12k|  }
_ZN3glz10fast_float5roundIdZNS0_19positive_digit_compIdEENS0_17adjusted_mantissaERNS0_6bigintEiEUlRS3_iE_EEvS6_T0_:
 3707|  6.12k|                                                         callback cb) noexcept {
 3708|  6.12k|  int32_t mantissa_shift = 64 - binary_format<T>::mantissa_explicit_bits() - 1;
 3709|  6.12k|  if (-am.power2 >= mantissa_shift) {
  ------------------
  |  Branch (3709:7): [True: 0, False: 6.12k]
  ------------------
 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|  6.12k|  cb(am, mantissa_shift);
 3723|       |
 3724|       |  // check for carry
 3725|  6.12k|  if (am.mantissa >=
  ------------------
  |  Branch (3725:7): [True: 0, False: 6.12k]
  ------------------
 3726|  6.12k|      (uint64_t(2) << binary_format<T>::mantissa_explicit_bits())) {
 3727|      0|    am.mantissa = (uint64_t(1) << binary_format<T>::mantissa_explicit_bits());
 3728|      0|    am.power2++;
 3729|      0|  }
 3730|       |
 3731|       |  // check for infinite: we could have carried to an infinite power
 3732|  6.12k|  am.mantissa &= ~(uint64_t(1) << binary_format<T>::mantissa_explicit_bits());
 3733|  6.12k|  if (am.power2 >= binary_format<T>::infinite_power()) {
  ------------------
  |  Branch (3733:7): [True: 0, False: 6.12k]
  ------------------
 3734|      0|    am.power2 = binary_format<T>::infinite_power();
 3735|      0|    am.mantissa = 0;
 3736|      0|  }
 3737|  6.12k|}
_ZZN3glz10fast_float19positive_digit_compIdEENS0_17adjusted_mantissaERNS0_6bigintEiENKUlRS2_iE_clES5_i:
 3951|  6.12k|  round<T>(answer, [truncated](adjusted_mantissa &a, int32_t shift) {
 3952|  6.12k|    round_nearest_tie_even(
 3953|  6.12k|        a, shift,
 3954|  6.12k|        [truncated](bool is_odd, bool is_halfway, bool is_above) -> bool {
 3955|  6.12k|          return is_above || (is_halfway && truncated) ||
 3956|  6.12k|                 (is_odd && is_halfway);
 3957|  6.12k|        });
 3958|  6.12k|  });
_ZN3glz10fast_float22round_nearest_tie_evenIZZNS0_19positive_digit_compIdEENS0_17adjusted_mantissaERNS0_6bigintEiENKUlRS3_iE_clES6_iEUlbbbE_EEvS6_iT_:
 3742|  6.12k|                       callback cb) noexcept {
 3743|  6.12k|  uint64_t const mask = (shift == 64) ? UINT64_MAX : (uint64_t(1) << shift) - 1;
  ------------------
  |  Branch (3743:25): [True: 0, False: 6.12k]
  ------------------
 3744|  6.12k|  uint64_t const halfway = (shift == 0) ? 0 : uint64_t(1) << (shift - 1);
  ------------------
  |  Branch (3744:28): [True: 0, False: 6.12k]
  ------------------
 3745|  6.12k|  uint64_t truncated_bits = am.mantissa & mask;
 3746|  6.12k|  bool is_above = truncated_bits > halfway;
 3747|  6.12k|  bool is_halfway = truncated_bits == halfway;
 3748|       |
 3749|       |  // shift digits into position
 3750|  6.12k|  if (shift == 64) {
  ------------------
  |  Branch (3750:7): [True: 0, False: 6.12k]
  ------------------
 3751|      0|    am.mantissa = 0;
 3752|  6.12k|  } else {
 3753|  6.12k|    am.mantissa >>= shift;
 3754|  6.12k|  }
 3755|  6.12k|  am.power2 += shift;
 3756|       |
 3757|  6.12k|  bool is_odd = (am.mantissa & 1) == 1;
 3758|  6.12k|  am.mantissa += uint64_t(cb(is_odd, is_halfway, is_above));
 3759|  6.12k|}
_ZZZN3glz10fast_float19positive_digit_compIdEENS0_17adjusted_mantissaERNS0_6bigintEiENKUlRS2_iE_clES5_iENKUlbbbE_clEbbb:
 3954|  6.12k|        [truncated](bool is_odd, bool is_halfway, bool is_above) -> bool {
 3955|  6.12k|          return is_above || (is_halfway && truncated) ||
  ------------------
  |  Branch (3955:18): [True: 2.21k, False: 3.90k]
  |  Branch (3955:31): [True: 2.61k, False: 1.29k]
  |  Branch (3955:45): [True: 340, False: 2.27k]
  ------------------
 3956|  3.56k|                 (is_odd && is_halfway);
  ------------------
  |  Branch (3956:19): [True: 608, False: 2.96k]
  |  Branch (3956:29): [True: 372, False: 236]
  ------------------
 3957|  6.12k|        });
_ZN3glz10fast_float19negative_digit_compIdEENS0_17adjusted_mantissaERNS0_6bigintES2_i:
 3970|  11.9k|    bigint &bigmant, adjusted_mantissa am, int32_t exponent) noexcept {
 3971|  11.9k|  bigint &real_digits = bigmant;
 3972|  11.9k|  int32_t real_exp = exponent;
 3973|       |
 3974|       |  // get the value of `b`, rounded down, and get a bigint representation of b+h
 3975|  11.9k|  adjusted_mantissa am_b = am;
 3976|       |  // gcc7 buf: use a lambda to remove the noexcept qualifier bug with
 3977|       |  // -Wnoexcept-type.
 3978|  11.9k|  round<T>(am_b,
 3979|  11.9k|           [](adjusted_mantissa &a, int32_t shift) { round_down(a, shift); });
 3980|  11.9k|  T b;
 3981|  11.9k|  to_float(false, am_b, b);
 3982|  11.9k|  adjusted_mantissa theor = to_extended_halfway(b);
 3983|  11.9k|  bigint theor_digits(theor.mantissa);
 3984|  11.9k|  int32_t theor_exp = theor.power2;
 3985|       |
 3986|       |  // scale real digits and theor digits to be same power.
 3987|  11.9k|  int32_t pow2_exp = theor_exp - real_exp;
 3988|  11.9k|  uint32_t pow5_exp = uint32_t(-real_exp);
 3989|  11.9k|  if (pow5_exp != 0) {
  ------------------
  |  Branch (3989:7): [True: 11.9k, False: 0]
  ------------------
 3990|  11.9k|    GLZ_FASTFLOAT_ASSERT(theor_digits.pow5(pow5_exp));
  ------------------
  |  |  344|  11.9k|  { ((void)(x)); }
  ------------------
 3991|  11.9k|  }
 3992|  11.9k|  if (pow2_exp > 0) {
  ------------------
  |  Branch (3992:7): [True: 6.34k, False: 5.58k]
  ------------------
 3993|  6.34k|    GLZ_FASTFLOAT_ASSERT(theor_digits.pow2(uint32_t(pow2_exp)));
  ------------------
  |  |  344|  6.34k|  { ((void)(x)); }
  ------------------
 3994|  6.34k|  } else if (pow2_exp < 0) {
  ------------------
  |  Branch (3994:14): [True: 5.38k, False: 202]
  ------------------
 3995|  5.38k|    GLZ_FASTFLOAT_ASSERT(real_digits.pow2(uint32_t(-pow2_exp)));
  ------------------
  |  |  344|  5.38k|  { ((void)(x)); }
  ------------------
 3996|  5.38k|  }
 3997|       |
 3998|       |  // compare digits, and use it to director rounding
 3999|  11.9k|  int ord = real_digits.compare(theor_digits);
 4000|  11.9k|  adjusted_mantissa answer = am;
 4001|  11.9k|  round<T>(answer, [ord](adjusted_mantissa &a, int32_t shift) {
 4002|  11.9k|    round_nearest_tie_even(
 4003|  11.9k|        a, shift, [ord](bool is_odd, bool _, bool __) -> bool {
 4004|  11.9k|          (void)_;  // not needed, since we've done our comparison
 4005|  11.9k|          (void)__; // not needed, since we've done our comparison
 4006|  11.9k|          if (ord > 0) {
 4007|  11.9k|            return true;
 4008|  11.9k|          } else if (ord < 0) {
 4009|  11.9k|            return false;
 4010|  11.9k|          } else {
 4011|  11.9k|            return is_odd;
 4012|  11.9k|          }
 4013|  11.9k|        });
 4014|  11.9k|  });
 4015|       |
 4016|  11.9k|  return answer;
 4017|  11.9k|}
_ZN3glz10fast_float5roundIdZNS0_19negative_digit_compIdEENS0_17adjusted_mantissaERNS0_6bigintES3_iEUlRS3_iE_EEvS6_T0_:
 3707|  11.9k|                                                         callback cb) noexcept {
 3708|  11.9k|  int32_t mantissa_shift = 64 - binary_format<T>::mantissa_explicit_bits() - 1;
 3709|  11.9k|  if (-am.power2 >= mantissa_shift) {
  ------------------
  |  Branch (3709:7): [True: 92, False: 11.8k]
  ------------------
 3710|       |    // have a denormal float
 3711|     92|    int32_t shift = -am.power2 + 1;
 3712|     92|    cb(am, (std::min<int32_t>)(shift, 64));
 3713|       |    // check for round-up: if rounding-nearest carried us to the hidden bit.
 3714|     92|    am.power2 = (am.mantissa <
  ------------------
  |  Branch (3714:17): [True: 92, False: 0]
  ------------------
 3715|     92|                 (uint64_t(1) << binary_format<T>::mantissa_explicit_bits()))
 3716|     92|                    ? 0
 3717|     92|                    : 1;
 3718|     92|    return;
 3719|     92|  }
 3720|       |
 3721|       |  // have a normal float, use the default shift.
 3722|  11.8k|  cb(am, mantissa_shift);
 3723|       |
 3724|       |  // check for carry
 3725|  11.8k|  if (am.mantissa >=
  ------------------
  |  Branch (3725:7): [True: 0, False: 11.8k]
  ------------------
 3726|  11.8k|      (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|  11.8k|  am.mantissa &= ~(uint64_t(1) << binary_format<T>::mantissa_explicit_bits());
 3733|  11.8k|  if (am.power2 >= binary_format<T>::infinite_power()) {
  ------------------
  |  Branch (3733:7): [True: 0, False: 11.8k]
  ------------------
 3734|      0|    am.power2 = binary_format<T>::infinite_power();
 3735|      0|    am.mantissa = 0;
 3736|      0|  }
 3737|  11.8k|}
_ZZN3glz10fast_float19negative_digit_compIdEENS0_17adjusted_mantissaERNS0_6bigintES2_iENKUlRS2_iE_clES5_i:
 3979|  11.9k|           [](adjusted_mantissa &a, int32_t shift) { round_down(a, shift); });
_ZN3glz10fast_float10round_downERNS0_17adjusted_mantissaEi:
 3762|  11.9k|round_down(adjusted_mantissa &am, int32_t shift) noexcept {
 3763|  11.9k|  if (shift == 64) {
  ------------------
  |  Branch (3763:7): [True: 0, False: 11.9k]
  ------------------
 3764|      0|    am.mantissa = 0;
 3765|  11.9k|  } else {
 3766|  11.9k|    am.mantissa >>= shift;
 3767|  11.9k|  }
 3768|  11.9k|  am.power2 += shift;
 3769|  11.9k|}
_ZN3glz10fast_float19to_extended_halfwayIdEENS0_17adjusted_mantissaET_:
 3696|  11.9k|to_extended_halfway(T value) noexcept {
 3697|  11.9k|  adjusted_mantissa am = to_extended(value);
 3698|  11.9k|  am.mantissa <<= 1;
 3699|  11.9k|  am.mantissa += 1;
 3700|  11.9k|  am.power2 -= 1;
 3701|  11.9k|  return am;
 3702|  11.9k|}
_ZN3glz10fast_float11to_extendedIdEENS0_17adjusted_mantissaET_:
 3661|  11.9k|to_extended(T value) noexcept {
 3662|  11.9k|  using equiv_uint = equiv_uint_t<T>;
 3663|  11.9k|  constexpr equiv_uint exponent_mask = binary_format<T>::exponent_mask();
 3664|  11.9k|  constexpr equiv_uint mantissa_mask = binary_format<T>::mantissa_mask();
 3665|  11.9k|  constexpr equiv_uint hidden_bit_mask = binary_format<T>::hidden_bit_mask();
 3666|       |
 3667|  11.9k|  adjusted_mantissa am;
 3668|  11.9k|  int32_t bias = binary_format<T>::mantissa_explicit_bits() -
 3669|  11.9k|                 binary_format<T>::minimum_exponent();
 3670|  11.9k|  equiv_uint bits;
 3671|  11.9k|#if GLZ_FASTFLOAT_HAS_BIT_CAST
 3672|  11.9k|  bits = std::bit_cast<equiv_uint>(value);
 3673|       |#else
 3674|       |  ::memcpy(&bits, &value, sizeof(T));
 3675|       |#endif
 3676|  11.9k|  if ((bits & exponent_mask) == 0) {
  ------------------
  |  Branch (3676:7): [True: 92, False: 11.8k]
  ------------------
 3677|       |    // denormal
 3678|     92|    am.power2 = 1 - bias;
 3679|     92|    am.mantissa = bits & mantissa_mask;
 3680|  11.8k|  } else {
 3681|       |    // normal
 3682|  11.8k|    am.power2 = int32_t((bits & exponent_mask) >>
 3683|  11.8k|                        binary_format<T>::mantissa_explicit_bits());
 3684|  11.8k|    am.power2 -= bias;
 3685|  11.8k|    am.mantissa = (bits & mantissa_mask) | hidden_bit_mask;
 3686|  11.8k|  }
 3687|       |
 3688|  11.9k|  return am;
 3689|  11.9k|}
_ZN3glz10fast_float6bigintC2Em:
 3406|  11.9k|  GLZ_FASTFLOAT_CONSTEXPR20 bigint(uint64_t value) : vec() {
 3407|  11.9k|#ifdef GLZ_FASTFLOAT_64BIT_LIMB
 3408|  11.9k|    vec.push_unchecked(value);
 3409|       |#else
 3410|       |    vec.push_unchecked(uint32_t(value));
 3411|       |    vec.push_unchecked(uint32_t(value >> 32));
 3412|       |#endif
 3413|  11.9k|    vec.normalize();
 3414|  11.9k|  }
_ZNK3glz10fast_float6bigint7compareERKS1_:
 3451|  11.9k|  GLZ_FASTFLOAT_CONSTEXPR20 int compare(bigint const &other) const noexcept {
 3452|  11.9k|    if (vec.len() > other.vec.len()) {
  ------------------
  |  Branch (3452:9): [True: 0, False: 11.9k]
  ------------------
 3453|      0|      return 1;
 3454|  11.9k|    } else if (vec.len() < other.vec.len()) {
  ------------------
  |  Branch (3454:16): [True: 0, False: 11.9k]
  ------------------
 3455|      0|      return -1;
 3456|  11.9k|    } else {
 3457|  47.8k|      for (size_t index = vec.len(); index > 0; index--) {
  ------------------
  |  Branch (3457:38): [True: 46.8k, False: 928]
  ------------------
 3458|  46.8k|        limb xi = vec[index - 1];
 3459|  46.8k|        limb yi = other.vec[index - 1];
 3460|  46.8k|        if (xi > yi) {
  ------------------
  |  Branch (3460:13): [True: 2.08k, False: 44.7k]
  ------------------
 3461|  2.08k|          return 1;
 3462|  44.7k|        } else if (xi < yi) {
  ------------------
  |  Branch (3462:20): [True: 8.91k, False: 35.8k]
  ------------------
 3463|  8.91k|          return -1;
 3464|  8.91k|        }
 3465|  46.8k|      }
 3466|    928|      return 0;
 3467|  11.9k|    }
 3468|  11.9k|  }
_ZNK3glz10fast_float8stackvecILt62EEixEm:
 3022|  93.7k|  GLZ_FASTFLOAT_CONSTEXPR14 const limb &operator[](size_t index) const noexcept {
 3023|  93.7k|    GLZ_FASTFLOAT_DEBUG_ASSERT(index < length);
  ------------------
  |  |  349|  93.7k|  { ((void)(x)); }
  ------------------
 3024|  93.7k|    return data[index];
 3025|  93.7k|  }
_ZN3glz10fast_float5roundIdZNS0_19negative_digit_compIdEENS0_17adjusted_mantissaERNS0_6bigintES3_iEUlRS3_iE0_EEvS6_T0_:
 3707|  11.9k|                                                         callback cb) noexcept {
 3708|  11.9k|  int32_t mantissa_shift = 64 - binary_format<T>::mantissa_explicit_bits() - 1;
 3709|  11.9k|  if (-am.power2 >= mantissa_shift) {
  ------------------
  |  Branch (3709:7): [True: 92, False: 11.8k]
  ------------------
 3710|       |    // have a denormal float
 3711|     92|    int32_t shift = -am.power2 + 1;
 3712|     92|    cb(am, (std::min<int32_t>)(shift, 64));
 3713|       |    // check for round-up: if rounding-nearest carried us to the hidden bit.
 3714|     92|    am.power2 = (am.mantissa <
  ------------------
  |  Branch (3714:17): [True: 92, False: 0]
  ------------------
 3715|     92|                 (uint64_t(1) << binary_format<T>::mantissa_explicit_bits()))
 3716|     92|                    ? 0
 3717|     92|                    : 1;
 3718|     92|    return;
 3719|     92|  }
 3720|       |
 3721|       |  // have a normal float, use the default shift.
 3722|  11.8k|  cb(am, mantissa_shift);
 3723|       |
 3724|       |  // check for carry
 3725|  11.8k|  if (am.mantissa >=
  ------------------
  |  Branch (3725:7): [True: 0, False: 11.8k]
  ------------------
 3726|  11.8k|      (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|  11.8k|  am.mantissa &= ~(uint64_t(1) << binary_format<T>::mantissa_explicit_bits());
 3733|  11.8k|  if (am.power2 >= binary_format<T>::infinite_power()) {
  ------------------
  |  Branch (3733:7): [True: 0, False: 11.8k]
  ------------------
 3734|      0|    am.power2 = binary_format<T>::infinite_power();
 3735|      0|    am.mantissa = 0;
 3736|      0|  }
 3737|  11.8k|}
_ZZN3glz10fast_float19negative_digit_compIdEENS0_17adjusted_mantissaERNS0_6bigintES2_iENKUlRS2_iE0_clES5_i:
 4001|  11.9k|  round<T>(answer, [ord](adjusted_mantissa &a, int32_t shift) {
 4002|  11.9k|    round_nearest_tie_even(
 4003|  11.9k|        a, shift, [ord](bool is_odd, bool _, bool __) -> bool {
 4004|  11.9k|          (void)_;  // not needed, since we've done our comparison
 4005|  11.9k|          (void)__; // not needed, since we've done our comparison
 4006|  11.9k|          if (ord > 0) {
 4007|  11.9k|            return true;
 4008|  11.9k|          } else if (ord < 0) {
 4009|  11.9k|            return false;
 4010|  11.9k|          } else {
 4011|  11.9k|            return is_odd;
 4012|  11.9k|          }
 4013|  11.9k|        });
 4014|  11.9k|  });
_ZN3glz10fast_float22round_nearest_tie_evenIZZNS0_19negative_digit_compIdEENS0_17adjusted_mantissaERNS0_6bigintES3_iENKUlRS3_iE0_clES6_iEUlbbbE_EEvS6_iT_:
 3742|  11.9k|                       callback cb) noexcept {
 3743|  11.9k|  uint64_t const mask = (shift == 64) ? UINT64_MAX : (uint64_t(1) << shift) - 1;
  ------------------
  |  Branch (3743:25): [True: 0, False: 11.9k]
  ------------------
 3744|  11.9k|  uint64_t const halfway = (shift == 0) ? 0 : uint64_t(1) << (shift - 1);
  ------------------
  |  Branch (3744:28): [True: 0, False: 11.9k]
  ------------------
 3745|  11.9k|  uint64_t truncated_bits = am.mantissa & mask;
 3746|  11.9k|  bool is_above = truncated_bits > halfway;
 3747|  11.9k|  bool is_halfway = truncated_bits == halfway;
 3748|       |
 3749|       |  // shift digits into position
 3750|  11.9k|  if (shift == 64) {
  ------------------
  |  Branch (3750:7): [True: 0, False: 11.9k]
  ------------------
 3751|      0|    am.mantissa = 0;
 3752|  11.9k|  } else {
 3753|  11.9k|    am.mantissa >>= shift;
 3754|  11.9k|  }
 3755|  11.9k|  am.power2 += shift;
 3756|       |
 3757|  11.9k|  bool is_odd = (am.mantissa & 1) == 1;
 3758|  11.9k|  am.mantissa += uint64_t(cb(is_odd, is_halfway, is_above));
 3759|  11.9k|}
_ZZZN3glz10fast_float19negative_digit_compIdEENS0_17adjusted_mantissaERNS0_6bigintES2_iENKUlRS2_iE0_clES5_iENKUlbbbE_clEbbb:
 4003|  11.9k|        a, shift, [ord](bool is_odd, bool _, bool __) -> bool {
 4004|  11.9k|          (void)_;  // not needed, since we've done our comparison
 4005|  11.9k|          (void)__; // not needed, since we've done our comparison
 4006|  11.9k|          if (ord > 0) {
  ------------------
  |  Branch (4006:15): [True: 2.08k, False: 9.83k]
  ------------------
 4007|  2.08k|            return true;
 4008|  9.83k|          } else if (ord < 0) {
  ------------------
  |  Branch (4008:22): [True: 8.91k, False: 928]
  ------------------
 4009|  8.91k|            return false;
 4010|  8.91k|          } else {
 4011|    928|            return is_odd;
 4012|    928|          }
 4013|  11.9k|        });
_ZN3glz10fast_float8to_floatIdEEvbNS0_17adjusted_mantissaERT_:
 1131|   741k|to_float(bool negative, adjusted_mantissa am, T &value) {
 1132|   741k|  using equiv_uint = equiv_uint_t<T>;
 1133|   741k|  equiv_uint word = equiv_uint(am.mantissa);
 1134|   741k|  word = equiv_uint(word | equiv_uint(am.power2)
 1135|   741k|                               << binary_format<T>::mantissa_explicit_bits());
 1136|   741k|  word =
 1137|   741k|      equiv_uint(word | equiv_uint(negative) << binary_format<T>::sign_index());
 1138|   741k|#if GLZ_FASTFLOAT_HAS_BIT_CAST
 1139|   741k|  value = std::bit_cast<T>(word);
 1140|       |#else
 1141|       |  ::memcpy(&value, &word, sizeof(T));
 1142|       |#endif
 1143|   741k|}
_ZN3glz10fast_float13binary_formatIdE10sign_indexEv:
  758|   741k|template <> inline constexpr int binary_format<double>::sign_index() {
  759|   741k|  return 63;
  760|   741k|}
_ZN3glz10fast_float13binary_formatIdE14infinite_powerEv:
  750|  2.19M|template <> inline constexpr int binary_format<double>::infinite_power() {
  751|  2.19M|  return 0x7FF;
  752|  2.19M|}
_ZN3glz10fast_float15parse_options_tIcEC2ENS0_12chars_formatEci:
  217|  3.84M|      : format(fmt), decimal_point(dot), base(b) {}

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

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

_ZNK3glz4yaml12yaml_context12indent_stackMUlvE_clEv:
   97|  7.87M|      std::vector<int16_t> indent_stack = [] {
   98|  7.87M|         std::vector<int16_t> v;
   99|  7.87M|         v.reserve(max_yaml_recursive_depth);
  100|  7.87M|         return v;
  101|  7.87M|      }();
_ZNK3glz4yaml12yaml_context15reset_line_memoEv:
  324|   148k|      {
  325|   148k|         memo_line_begin = nullptr;
  326|   148k|         memo_verified_end = nullptr;
  327|   148k|         memo_first_tab = nullptr;
  328|   148k|         memo_first_content = nullptr;
  329|   148k|      }
_ZN3glz4yaml19skip_document_startIRPKcS3_NS0_12yaml_contextEEEvOT_T0_RT1_:
 1011|   148k|   {
 1012|   148k|      ctx.secondary_tag_handle_overridden = false;
 1013|       |
 1014|       |      // Skip leading blank/comment-only lines before directives or document start.
 1015|   154k|      while (it != end) {
  ------------------
  |  Branch (1015:14): [True: 154k, False: 80]
  ------------------
 1016|   154k|         auto line = it;
 1017|   154k|         skip_inline_ws(line, end);
 1018|   154k|         if (line == end) {
  ------------------
  |  Branch (1018:14): [True: 16, False: 154k]
  ------------------
 1019|     16|            it = line;
 1020|     16|            break;
 1021|     16|         }
 1022|   154k|         if (*line == '#') {
  ------------------
  |  Branch (1022:14): [True: 1.37k, False: 152k]
  ------------------
 1023|  1.37k|            it = line;
 1024|  1.37k|            skip_comment(it, end);
 1025|  1.37k|            skip_newline(it, end);
 1026|  1.37k|            continue;
 1027|  1.37k|         }
 1028|   152k|         if (*line == '\n' || *line == '\r') {
  ------------------
  |  Branch (1028:14): [True: 1.88k, False: 151k]
  |  Branch (1028:31): [True: 2.95k, False: 148k]
  ------------------
 1029|  4.83k|            it = line;
 1030|  4.83k|            skip_newline(it, end);
 1031|  4.83k|            continue;
 1032|  4.83k|         }
 1033|   148k|         it = line;
 1034|   148k|         break;
 1035|   152k|      }
 1036|       |
 1037|       |      // Track if we've seen a %YAML directive (duplicates are an error per spec)
 1038|   148k|      bool seen_yaml_directive = false;
 1039|   148k|      bool saw_any_directive = false;
 1040|   148k|      bool consumed_document_start = false;
 1041|       |
 1042|       |      // Process YAML directives (lines starting with %) until we hit --- or content
 1043|       |      // Directives must appear at the start of a line and before ---
 1044|   155k|      while (it != end && *it == '%') {
  ------------------
  |  Branch (1044:14): [True: 154k, False: 718]
  |  Branch (1044:27): [True: 7.72k, False: 147k]
  ------------------
 1045|  7.72k|         saw_any_directive = true;
 1046|  7.72k|         ++it; // Skip the '%'
 1047|       |
 1048|       |         // Parse directive name
 1049|  7.72k|         auto name_start = it;
 1050|  58.3k|         while (it != end && *it != ' ' && *it != '\t' && *it != '\n' && *it != '\r') {
  ------------------
  |  Branch (1050:17): [True: 58.1k, False: 200]
  |  Branch (1050:30): [True: 54.8k, False: 3.28k]
  |  Branch (1050:44): [True: 52.1k, False: 2.70k]
  |  Branch (1050:59): [True: 51.5k, False: 616]
  |  Branch (1050:74): [True: 50.6k, False: 916]
  ------------------
 1051|  50.6k|            ++it;
 1052|  50.6k|         }
 1053|  7.72k|         std::string_view directive_name(name_start, static_cast<size_t>(it - name_start));
 1054|       |
 1055|       |         // Check for %YAML directive
 1056|  7.72k|         if (directive_name == "YAML") {
  ------------------
  |  Branch (1056:14): [True: 194, False: 7.53k]
  ------------------
 1057|       |            // Error on duplicate %YAML directive (per spec: "It is an error to specify
 1058|       |            // more than one YAML directive for the same document")
 1059|    194|            if (seen_yaml_directive) {
  ------------------
  |  Branch (1059:17): [True: 4, False: 190]
  ------------------
 1060|      4|               ctx.error = error_code::syntax_error;
 1061|      4|               return;
 1062|      4|            }
 1063|    190|            seen_yaml_directive = true;
 1064|       |
 1065|       |            // Skip whitespace before version
 1066|    878|            while (it != end && (*it == ' ' || *it == '\t')) {
  ------------------
  |  Branch (1066:20): [True: 868, False: 10]
  |  Branch (1066:34): [True: 464, False: 404]
  |  Branch (1066:48): [True: 224, False: 180]
  ------------------
 1067|    688|               ++it;
 1068|    688|            }
 1069|       |
 1070|       |            // Parse major.minor version and reject malformed forms.
 1071|    190|            if (it == end || *it < '0' || *it > '9') {
  ------------------
  |  Branch (1071:17): [True: 10, False: 180]
  |  Branch (1071:30): [True: 24, False: 156]
  |  Branch (1071:43): [True: 4, False: 152]
  ------------------
 1072|     38|               ctx.error = error_code::syntax_error;
 1073|     38|               return;
 1074|     38|            }
 1075|       |            // Clamp rather than accumulate without bound. An int accumulator overflows on a long
 1076|       |            // digit run -- undefined behavior, and in practice a wrap that carries a huge version
 1077|       |            // back into the accepted range, so "%YAML 4294967296.0" was read as major version 0.
 1078|       |            //
 1079|       |            // Clamping is safe because the accumulator only grows: it stops updating once it has
 1080|       |            // already reached max_tracked_version, so a clamped value is always at least that
 1081|       |            // large, and the clamp is far above the threshold checked below. A version big enough
 1082|       |            // to freeze the accumulator therefore still compares greater and is still rejected.
 1083|       |            // The bound is deliberately independent of that threshold, so raising the threshold
 1084|       |            // later cannot quietly reintroduce the wrap. Peak value is 999, well inside int.
 1085|    152|            constexpr int max_tracked_version = 100;
 1086|    152|            int major_version = 0;
 1087|  1.00k|            while (it != end && *it >= '0' && *it <= '9') {
  ------------------
  |  Branch (1087:20): [True: 992, False: 16]
  |  Branch (1087:33): [True: 868, False: 124]
  |  Branch (1087:47): [True: 856, False: 12]
  ------------------
 1088|    856|               if (major_version < max_tracked_version) {
  ------------------
  |  Branch (1088:20): [True: 456, False: 400]
  ------------------
 1089|    456|                  major_version = major_version * 10 + (*it - '0');
 1090|    456|               }
 1091|    856|               ++it;
 1092|    856|            }
 1093|    152|            if (it == end || *it != '.') {
  ------------------
  |  Branch (1093:17): [True: 16, False: 136]
  |  Branch (1093:30): [True: 40, False: 96]
  ------------------
 1094|     56|               ctx.error = error_code::syntax_error;
 1095|     56|               return;
 1096|     56|            }
 1097|     96|            ++it; // skip '.'
 1098|     96|            if (it == end || *it < '0' || *it > '9') {
  ------------------
  |  Branch (1098:17): [True: 2, False: 94]
  |  Branch (1098:30): [True: 6, False: 88]
  |  Branch (1098:43): [True: 4, False: 84]
  ------------------
 1099|     12|               ctx.error = error_code::syntax_error;
 1100|     12|               return;
 1101|     12|            }
 1102|    388|            while (it != end && *it >= '0' && *it <= '9') {
  ------------------
  |  Branch (1102:20): [True: 382, False: 6]
  |  Branch (1102:33): [True: 308, False: 74]
  |  Branch (1102:47): [True: 304, False: 4]
  ------------------
 1103|    304|               ++it;
 1104|    304|            }
 1105|       |
 1106|       |            // Check for major version > 1 (per spec: should be rejected)
 1107|     84|            if (major_version > 1) {
  ------------------
  |  Branch (1107:17): [True: 12, False: 72]
  ------------------
 1108|     12|               ctx.error = error_code::syntax_error;
 1109|     12|               return;
 1110|     12|            }
 1111|       |
 1112|       |            // After the version, only spaces/tabs and optional comment are allowed.
 1113|       |            // A '#' must be separated by at least one space.
 1114|     72|            if (it != end && *it == '#') {
  ------------------
  |  Branch (1114:17): [True: 68, False: 4]
  |  Branch (1114:30): [True: 4, False: 64]
  ------------------
 1115|      4|               ctx.error = error_code::syntax_error;
 1116|      4|               return;
 1117|      4|            }
 1118|    580|            while (it != end && (*it == ' ' || *it == '\t')) {
  ------------------
  |  Branch (1118:20): [True: 572, False: 8]
  |  Branch (1118:34): [True: 264, False: 308]
  |  Branch (1118:48): [True: 248, False: 60]
  ------------------
 1119|    512|               ++it;
 1120|    512|            }
 1121|     68|            if (it != end && *it != '\n' && *it != '\r' && *it != '#') {
  ------------------
  |  Branch (1121:17): [True: 60, False: 8]
  |  Branch (1121:30): [True: 52, False: 8]
  |  Branch (1121:45): [True: 44, False: 8]
  |  Branch (1121:60): [True: 36, False: 8]
  ------------------
 1122|     36|               ctx.error = error_code::syntax_error;
 1123|     36|               return;
 1124|     36|            }
 1125|     68|         }
 1126|  7.53k|         else if (directive_name == "TAG") {
  ------------------
  |  Branch (1126:19): [True: 4.27k, False: 3.25k]
  ------------------
 1127|  12.0k|            while (it != end && (*it == ' ' || *it == '\t')) {
  ------------------
  |  Branch (1127:20): [True: 12.0k, False: 20]
  |  Branch (1127:34): [True: 5.03k, False: 6.99k]
  |  Branch (1127:48): [True: 2.73k, False: 4.25k]
  ------------------
 1128|  7.77k|               ++it;
 1129|  7.77k|            }
 1130|       |
 1131|  4.27k|            auto handle_start = it;
 1132|  18.3k|            while (it != end && *it != ' ' && *it != '\t' && *it != '\n' && *it != '\r') {
  ------------------
  |  Branch (1132:20): [True: 18.2k, False: 66]
  |  Branch (1132:33): [True: 14.4k, False: 3.87k]
  |  Branch (1132:47): [True: 14.1k, False: 316]
  |  Branch (1132:62): [True: 14.0k, False: 16]
  |  Branch (1132:77): [True: 14.0k, False: 4]
  ------------------
 1133|  14.0k|               ++it;
 1134|  14.0k|            }
 1135|  4.27k|            const std::string_view handle(handle_start, static_cast<size_t>(it - handle_start));
 1136|       |
 1137|  10.3k|            while (it != end && (*it == ' ' || *it == '\t')) {
  ------------------
  |  Branch (1137:20): [True: 10.2k, False: 90]
  |  Branch (1137:34): [True: 5.57k, False: 4.69k]
  |  Branch (1137:48): [True: 508, False: 4.18k]
  ------------------
 1138|  6.08k|               ++it;
 1139|  6.08k|            }
 1140|       |
 1141|  4.27k|            auto prefix_start = it;
 1142|  27.0k|            while (it != end && *it != ' ' && *it != '\t' && *it != '\n' && *it != '\r') {
  ------------------
  |  Branch (1142:20): [True: 26.9k, False: 190]
  |  Branch (1142:33): [True: 24.0k, False: 2.80k]
  |  Branch (1142:47): [True: 23.8k, False: 272]
  |  Branch (1142:62): [True: 23.0k, False: 812]
  |  Branch (1142:77): [True: 22.8k, False: 196]
  ------------------
 1143|  22.8k|               ++it;
 1144|  22.8k|            }
 1145|  4.27k|            const std::string_view prefix(prefix_start, static_cast<size_t>(it - prefix_start));
 1146|       |
 1147|  4.27k|            if (handle.empty() || prefix.empty()) {
  ------------------
  |  Branch (1147:17): [True: 36, False: 4.24k]
  |  Branch (1147:35): [True: 74, False: 4.16k]
  ------------------
 1148|    110|               ctx.error = error_code::syntax_error;
 1149|    110|               return;
 1150|    110|            }
 1151|       |
 1152|  4.16k|            if (handle == "!!") {
  ------------------
  |  Branch (1152:17): [True: 1.19k, False: 2.97k]
  ------------------
 1153|  1.19k|               ctx.secondary_tag_handle_overridden = (prefix != "tag:yaml.org,2002:");
 1154|  1.19k|            }
 1155|  4.16k|         }
 1156|       |         // %TAG and other directives are silently skipped (per spec: should be ignored)
 1157|       |
 1158|       |         // Skip to end of directive line
 1159|   133k|         while (it != end && *it != '\n' && *it != '\r') {
  ------------------
  |  Branch (1159:17): [True: 133k, False: 480]
  |  Branch (1159:30): [True: 130k, False: 3.22k]
  |  Branch (1159:45): [True: 126k, False: 3.75k]
  ------------------
 1160|   126k|            ++it;
 1161|   126k|         }
 1162|       |         // Skip the newline
 1163|  7.45k|         skip_newline(it, end);
 1164|       |         // Skip blank and comment-only lines between directives and document start.
 1165|  9.45k|         while (it != end) {
  ------------------
  |  Branch (1165:17): [True: 8.84k, False: 610]
  ------------------
 1166|  8.84k|            auto line = it;
 1167|  8.84k|            skip_inline_ws(line, end);
 1168|  8.84k|            if (line == end) {
  ------------------
  |  Branch (1168:17): [True: 12, False: 8.83k]
  ------------------
 1169|     12|               it = line;
 1170|     12|               break;
 1171|     12|            }
 1172|  8.83k|            if (*line == '#') {
  ------------------
  |  Branch (1172:17): [True: 728, False: 8.10k]
  ------------------
 1173|    728|               it = line;
 1174|    728|               skip_comment(it, end);
 1175|    728|               skip_newline(it, end);
 1176|    728|               continue;
 1177|    728|            }
 1178|  8.10k|            if (*line == '\n' || *line == '\r') {
  ------------------
  |  Branch (1178:17): [True: 488, False: 7.61k]
  |  Branch (1178:34): [True: 784, False: 6.83k]
  ------------------
 1179|  1.27k|               it = line;
 1180|  1.27k|               skip_newline(it, end);
 1181|  1.27k|               continue;
 1182|  1.27k|            }
 1183|  6.83k|            break;
 1184|  8.10k|         }
 1185|  7.45k|      }
 1186|       |
 1187|       |      // Check for ---
 1188|   147k|      if (end - it >= 3 && it[0] == '-' && it[1] == '-' && it[2] == '-') {
  ------------------
  |  Branch (1188:11): [True: 146k, False: 1.72k]
  |  Branch (1188:28): [True: 3.11k, False: 143k]
  |  Branch (1188:44): [True: 322, False: 2.79k]
  |  Branch (1188:60): [True: 264, False: 58]
  ------------------
 1189|    264|         auto after = it + 3;
 1190|       |         // Must be followed by whitespace, newline, or end
 1191|    264|         if (after == end || *after == ' ' || *after == '\t' || *after == '\n' || *after == '\r' || *after == '#') {
  ------------------
  |  Branch (1191:14): [True: 4, False: 260]
  |  Branch (1191:30): [True: 40, False: 220]
  |  Branch (1191:47): [True: 84, False: 136]
  |  Branch (1191:65): [True: 24, False: 112]
  |  Branch (1191:83): [True: 36, False: 76]
  |  Branch (1191:101): [True: 32, False: 44]
  ------------------
 1192|    220|            auto content = after;
 1193|  1.03k|            while (content != end && (*content == ' ' || *content == '\t')) {
  ------------------
  |  Branch (1193:20): [True: 1.01k, False: 14]
  |  Branch (1193:39): [True: 244, False: 774]
  |  Branch (1193:58): [True: 568, False: 206]
  ------------------
 1194|    812|               ++content;
 1195|    812|            }
 1196|       |            // Per yaml-test-suite, block mappings cannot begin on the same line as '---'.
 1197|    220|            if (content != end && *content != '\n' && *content != '\r' && *content != '#' &&
  ------------------
  |  Branch (1197:17): [True: 206, False: 14]
  |  Branch (1197:35): [True: 178, False: 28]
  |  Branch (1197:55): [True: 134, False: 44]
  |  Branch (1197:75): [True: 102, False: 32]
  ------------------
 1198|    102|                line_could_be_block_mapping(content, end)) {
  ------------------
  |  Branch (1198:17): [True: 22, False: 80]
  ------------------
 1199|     22|               ctx.error = error_code::syntax_error;
 1200|     22|               return;
 1201|     22|            }
 1202|    198|            consumed_document_start = true;
 1203|    198|            it = after;
 1204|       |            // Skip rest of line (whitespace and optional comment)
 1205|    198|            skip_ws_and_comment(it, end);
 1206|    198|            skip_newline(it, end);
 1207|    198|         }
 1208|    264|      }
 1209|       |
 1210|       |      // A directives section must be followed by a document start marker.
 1211|   147k|      if (saw_any_directive && !consumed_document_start) {
  ------------------
  |  Branch (1211:11): [True: 808, False: 147k]
  |  Branch (1211:32): [True: 794, False: 14]
  ------------------
 1212|    794|         ctx.error = error_code::syntax_error;
 1213|    794|         return;
 1214|    794|      }
 1215|   147k|   }
_ZN3glz4yaml14skip_inline_wsIRPKcS3_EEvOT_T0_:
  794|   259M|   {
  795|   293M|      while (it != end && (*it == ' ' || *it == '\t')) {
  ------------------
  |  Branch (795:14): [True: 292M, False: 1.14M]
  |  Branch (795:28): [True: 31.9M, False: 260M]
  |  Branch (795:42): [True: 2.15M, False: 258M]
  ------------------
  796|  34.0M|         ++it;
  797|  34.0M|      }
  798|   259M|   }
_ZN3glz4yaml12skip_commentIRPKcS3_EEvOT_T0_:
  803|  11.6M|   {
  804|  11.6M|      if (it != end && *it == '#') {
  ------------------
  |  Branch (804:11): [True: 10.8M, False: 813k]
  |  Branch (804:24): [True: 4.27M, False: 6.53M]
  ------------------
  805|  74.0M|         while (it != end && *it != '\n' && *it != '\r') {
  ------------------
  |  Branch (805:17): [True: 74.0M, False: 83.1k]
  |  Branch (805:30): [True: 70.7M, False: 3.27M]
  |  Branch (805:45): [True: 69.8M, False: 916k]
  ------------------
  806|  69.8M|            ++it;
  807|  69.8M|         }
  808|  4.27M|      }
  809|  11.6M|   }
_ZN3glz4yaml27line_could_be_block_mappingIPKcS3_EEbT_T0_:
  936|  3.50M|   {
  937|  3.50M|      const auto stop = implicit_key_scan_end(it, end);
  938|  3.50M|      bool prev_was_whitespace = true; // Start of value acts like after whitespace
  939|  3.50M|      int flow_depth = 0;
  940|   220M|      while (it != stop) {
  ------------------
  |  Branch (940:14): [True: 220M, False: 397k]
  ------------------
  941|   220M|         const char c = *it;
  942|   220M|         if (c == '\n' || c == '\r') {
  ------------------
  |  Branch (942:14): [True: 836k, False: 219M]
  |  Branch (942:27): [True: 766k, False: 218M]
  ------------------
  943|  1.60M|            return false;
  944|  1.60M|         }
  945|   218M|         if (c == ':' && flow_depth == 0) {
  ------------------
  |  Branch (945:14): [True: 5.49M, False: 213M]
  |  Branch (945:26): [True: 3.08M, False: 2.41M]
  ------------------
  946|  3.08M|            ++it;
  947|       |            // Colon followed by space, newline, or end indicates a mapping key
  948|  3.08M|            if (it == end || *it == ' ' || *it == '\t' || *it == '\n' || *it == '\r') {
  ------------------
  |  Branch (948:17): [True: 55.5k, False: 3.02M]
  |  Branch (948:30): [True: 1.04M, False: 1.98M]
  |  Branch (948:44): [True: 48.3k, False: 1.93M]
  |  Branch (948:59): [True: 83.4k, False: 1.84M]
  |  Branch (948:74): [True: 181k, False: 1.66M]
  ------------------
  949|  1.41M|               return true;
  950|  1.41M|            }
  951|       |            // Otherwise this ':' is part of plain content (e.g., "::", "http://").
  952|       |            // Continue scanning for a later mapping separator on the same line.
  953|  1.66M|            prev_was_whitespace = false;
  954|  1.66M|            continue;
  955|  3.08M|         }
  956|       |         // Per YAML spec: # only starts a comment when preceded by whitespace
  957|       |         // Stop scanning if we hit a comment - any colon after is not a key indicator
  958|   215M|         if (c == '#' && flow_depth == 0 && prev_was_whitespace) {
  ------------------
  |  Branch (958:14): [True: 3.03M, False: 212M]
  |  Branch (958:26): [True: 1.06M, False: 1.96M]
  |  Branch (958:45): [True: 66.9k, False: 999k]
  ------------------
  959|  66.9k|            return false;
  960|  66.9k|         }
  961|       |         // Skip over quoted strings only when they start a quoted token.
  962|       |         // Quote characters are otherwise valid in plain scalars/keys.
  963|   215M|         if ((c == '"' || c == '\'') && prev_was_whitespace) {
  ------------------
  |  Branch (963:15): [True: 411k, False: 215M]
  |  Branch (963:27): [True: 441k, False: 214M]
  |  Branch (963:41): [True: 60.9k, False: 792k]
  ------------------
  964|  60.9k|            const char quote = c;
  965|  60.9k|            ++it;
  966|  1.71M|            while (it != stop && *it != quote) {
  ------------------
  |  Branch (966:20): [True: 1.70M, False: 5.47k]
  |  Branch (966:34): [True: 1.67M, False: 30.4k]
  ------------------
  967|  1.67M|               if (*it == '\\' && quote == '"') {
  ------------------
  |  Branch (967:20): [True: 19.1k, False: 1.65M]
  |  Branch (967:35): [True: 12.0k, False: 7.15k]
  ------------------
  968|  12.0k|                  ++it; // Skip escape character
  969|  12.0k|                  if (it != stop) ++it; // Skip escaped character
  ------------------
  |  Branch (969:23): [True: 11.7k, False: 298]
  ------------------
  970|  12.0k|               }
  971|  1.66M|               else if (*it == '\n' || *it == '\r') {
  ------------------
  |  Branch (971:25): [True: 14.2k, False: 1.65M]
  |  Branch (971:40): [True: 10.8k, False: 1.63M]
  ------------------
  972|       |                  // Unterminated quote on this line
  973|  25.0k|                  return false;
  974|  25.0k|               }
  975|  1.63M|               else {
  976|  1.63M|                  ++it;
  977|  1.63M|               }
  978|  1.67M|            }
  979|  35.9k|            if (it != stop) ++it; // Skip closing quote
  ------------------
  |  Branch (979:17): [True: 30.4k, False: 5.47k]
  ------------------
  980|  35.9k|            prev_was_whitespace = false;
  981|  35.9k|            continue;
  982|  60.9k|         }
  983|   215M|         if (c == '[' || c == '{') {
  ------------------
  |  Branch (983:14): [True: 2.14M, False: 213M]
  |  Branch (983:26): [True: 3.41M, False: 210M]
  ------------------
  984|  5.56M|            ++flow_depth;
  985|  5.56M|            prev_was_whitespace = false;
  986|  5.56M|            ++it;
  987|  5.56M|            continue;
  988|  5.56M|         }
  989|   210M|         if ((c == ']' || c == '}') && flow_depth > 0) {
  ------------------
  |  Branch (989:15): [True: 332k, False: 209M]
  |  Branch (989:27): [True: 1.29M, False: 208M]
  |  Branch (989:40): [True: 940k, False: 685k]
  ------------------
  990|   940k|            --flow_depth;
  991|   940k|            prev_was_whitespace = false;
  992|   940k|            ++it;
  993|   940k|            continue;
  994|   940k|         }
  995|   209M|         prev_was_whitespace = (c == ' ' || c == '\t');
  ------------------
  |  Branch (995:33): [True: 12.5M, False: 196M]
  |  Branch (995:45): [True: 2.34M, False: 194M]
  ------------------
  996|   209M|         ++it;
  997|   209M|      }
  998|   397k|      return false;
  999|  3.50M|   }
_ZN3glz4yaml21implicit_key_scan_endIPKcS3_EET_S4_T0_:
   85|  22.1M|   {
   86|  22.1M|      const size_t remaining = size_t(end - it);
   87|  22.1M|      return it + (remaining < max_implicit_key_lookahead ? remaining : max_implicit_key_lookahead);
  ------------------
  |  Branch (87:20): [True: 18.7M, False: 3.40M]
  ------------------
   88|  22.1M|   }
_ZN3glz4yaml19skip_ws_and_commentIRPKcS3_EEvOT_T0_:
  814|  3.05M|   {
  815|  3.05M|      skip_inline_ws(it, end);
  816|  3.05M|      skip_comment(it, end);
  817|  3.05M|   }
_ZN3glz4yaml17at_document_startIRPKcS3_EEbOT_T0_:
 1221|  8.80M|   {
 1222|  8.80M|      if (end - it >= 3 && it[0] == '-' && it[1] == '-' && it[2] == '-') {
  ------------------
  |  Branch (1222:11): [True: 8.66M, False: 140k]
  |  Branch (1222:28): [True: 276k, False: 8.39M]
  |  Branch (1222:44): [True: 80.4k, False: 196k]
  |  Branch (1222:60): [True: 61.5k, False: 18.9k]
  ------------------
 1223|  61.5k|         auto after = it + 3;
 1224|  61.5k|         return after == end || *after == ' ' || *after == '\t' || *after == '\n' || *after == '\r';
  ------------------
  |  Branch (1224:17): [True: 9.19k, False: 52.3k]
  |  Branch (1224:33): [True: 5.68k, False: 46.6k]
  |  Branch (1224:50): [True: 9.78k, False: 36.8k]
  |  Branch (1224:68): [True: 4.81k, False: 32.0k]
  |  Branch (1224:86): [True: 2.48k, False: 29.5k]
  ------------------
 1225|  61.5k|      }
 1226|  8.74M|      return false;
 1227|  8.80M|   }
_ZN3glz4yaml15at_document_endIRPKcS3_EEbOT_T0_:
 1233|  15.2M|   {
 1234|  15.2M|      if (end - it >= 3 && it[0] == '.' && it[1] == '.' && it[2] == '.') {
  ------------------
  |  Branch (1234:11): [True: 14.9M, False: 269k]
  |  Branch (1234:28): [True: 292k, False: 14.6M]
  |  Branch (1234:44): [True: 133k, False: 158k]
  |  Branch (1234:60): [True: 109k, False: 24.8k]
  ------------------
 1235|   109k|         auto after = it + 3;
 1236|   451k|         while (after != end && (*after == ' ' || *after == '\t')) ++after;
  ------------------
  |  Branch (1236:17): [True: 434k, False: 16.9k]
  |  Branch (1236:34): [True: 127k, False: 307k]
  |  Branch (1236:51): [True: 215k, False: 92.0k]
  ------------------
 1237|   109k|         return after == end || *after == '\n' || *after == '\r' || *after == '#';
  ------------------
  |  Branch (1237:17): [True: 16.9k, False: 92.0k]
  |  Branch (1237:33): [True: 16.4k, False: 75.6k]
  |  Branch (1237:51): [True: 13.4k, False: 62.1k]
  |  Branch (1237:69): [True: 12.6k, False: 49.5k]
  ------------------
 1238|   109k|      }
 1239|  15.1M|      return false;
 1240|  15.2M|   }
_ZN3glz4yaml25skip_ws_newlines_commentsIRPKcS3_EEvOT_T0_:
  857|  26.2M|   {
  858|  27.3M|      while (it != end) {
  ------------------
  |  Branch (858:14): [True: 27.3M, False: 1.81k]
  ------------------
  859|  27.3M|         if (*it == ' ' || *it == '\t') {
  ------------------
  |  Branch (859:14): [True: 316k, False: 26.9M]
  |  Branch (859:28): [True: 36.2k, False: 26.9M]
  ------------------
  860|   352k|            ++it;
  861|   352k|         }
  862|  26.9M|         else if (*it == '\n' || *it == '\r') {
  ------------------
  |  Branch (862:19): [True: 355k, False: 26.5M]
  |  Branch (862:34): [True: 171k, False: 26.4M]
  ------------------
  863|   527k|            skip_newline(it, end);
  864|   527k|         }
  865|  26.4M|         else if (*it == '#') {
  ------------------
  |  Branch (865:19): [True: 170k, False: 26.2M]
  ------------------
  866|   170k|            skip_comment(it, end);
  867|   170k|         }
  868|  26.2M|         else {
  869|  26.2M|            break;
  870|  26.2M|         }
  871|  27.3M|      }
  872|  26.2M|   }
_ZN3glz4yaml17parse_anchor_nameIPKcS3_EENSt3__117basic_string_viewIcNS4_11char_traitsIcEEEERT_T0_:
 1321|  25.6M|   {
 1322|  25.6M|      auto start = it;
 1323|  25.6M|      if (start == end) return {};
  ------------------
  |  Branch (1323:11): [True: 3.03k, False: 25.6M]
  ------------------
 1324|  1.55G|      while (it != end) {
  ------------------
  |  Branch (1324:14): [True: 1.55G, False: 198k]
  ------------------
 1325|  1.55G|         const char c = *it;
 1326|       |         // Per YAML, anchor names end at whitespace or flow indicators.
 1327|       |         // Colon is allowed in anchor names.
 1328|  1.55G|         if (c == ' ' || c == '\t' || c == '\n' || c == '\r' || c == ',' || c == '[' || c == ']' || c == '{' ||
  ------------------
  |  Branch (1328:14): [True: 15.7M, False: 1.53G]
  |  Branch (1328:26): [True: 584k, False: 1.53G]
  |  Branch (1328:39): [True: 1.05M, False: 1.53G]
  |  Branch (1328:52): [True: 1.15M, False: 1.53G]
  |  Branch (1328:65): [True: 1.71M, False: 1.53G]
  |  Branch (1328:77): [True: 142k, False: 1.53G]
  |  Branch (1328:89): [True: 40.9k, False: 1.53G]
  |  Branch (1328:101): [True: 1.09M, False: 1.52G]
  ------------------
 1329|  1.52G|             c == '}') {
  ------------------
  |  Branch (1329:14): [True: 3.96M, False: 1.52G]
  ------------------
 1330|  25.4M|            break;
 1331|  25.4M|         }
 1332|  1.52G|         ++it;
 1333|  1.52G|      }
 1334|  25.6M|      return std::string_view(&*start, static_cast<size_t>(it - start));
 1335|  25.6M|   }
_ZNK3glz4yaml12yaml_context23transparent_string_hashclENSt3__117basic_string_viewIcNS3_11char_traitsIcEEEE:
  134|  63.9M|         size_t operator()(std::string_view key) const noexcept { return std::hash<std::string_view>{}(key); }
_ZNK3glz4yaml12yaml_context24transparent_string_equalclENSt3__117basic_string_viewIcNS3_11char_traitsIcEEEES7_:
  141|  18.8M|         bool operator()(std::string_view lhs, std::string_view rhs) const noexcept { return lhs == rhs; }
_ZN3glz4yaml14parse_yaml_tagIPKcS3_NS0_12yaml_contextEEENS0_8yaml_tagERT_T0_RKT1_:
  745|  64.1M|   {
  746|  64.1M|      return parse_yaml_tag(it, end, !ctx.secondary_tag_handle_overridden);
  747|  64.1M|   }
_ZN3glz4yaml14parse_yaml_tagIPKcS3_EENS0_8yaml_tagERT_T0_b:
  626|  64.1M|   {
  627|  64.1M|      if (it == end || *it != '!') {
  ------------------
  |  Branch (627:11): [True: 0, False: 64.1M]
  |  Branch (627:24): [True: 61.4M, False: 2.76M]
  ------------------
  628|  61.4M|         return yaml_tag::none;
  629|  61.4M|      }
  630|       |
  631|  2.76M|      ++it; // skip first !
  632|       |
  633|  2.76M|      if (it == end) {
  ------------------
  |  Branch (633:11): [True: 436, False: 2.76M]
  ------------------
  634|    436|         return yaml_tag::unknown;
  635|    436|      }
  636|       |
  637|       |      // Check for !! (shorthand tag)
  638|  2.76M|      if (*it == '!') {
  ------------------
  |  Branch (638:11): [True: 1.27M, False: 1.49M]
  ------------------
  639|  1.27M|         ++it; // skip second !
  640|       |
  641|       |         // Read tag name
  642|  1.27M|         auto tag_start = it;
  643|  9.15M|         while (it != end && !plain_scalar_end_table[static_cast<uint8_t>(*it)]) {
  ------------------
  |  Branch (643:17): [True: 9.14M, False: 3.65k]
  |  Branch (643:30): [True: 7.87M, False: 1.27M]
  ------------------
  644|  7.87M|            ++it;
  645|  7.87M|         }
  646|       |
  647|  1.27M|         std::string_view tag_name(tag_start, static_cast<size_t>(it - tag_start));
  648|  1.27M|         if (tag_name.empty() || malformed_tag_token(tag_name)) {
  ------------------
  |  Branch (648:14): [True: 522, False: 1.27M]
  |  Branch (648:34): [True: 0, False: 1.27M]
  ------------------
  649|    522|            return yaml_tag::unknown;
  650|    522|         }
  651|  1.27M|         if (it != end && malformed_tag_termination(*it)) {
  ------------------
  |  Branch (651:14): [True: 1.27M, False: 3.62k]
  |  Branch (651:27): [True: 392, False: 1.27M]
  ------------------
  652|    392|            return yaml_tag::unknown;
  653|    392|         }
  654|       |
  655|       |         // Skip whitespace after tag
  656|  3.09M|         while (it != end && (*it == ' ' || *it == '\t')) {
  ------------------
  |  Branch (656:17): [True: 3.08M, False: 7.66k]
  |  Branch (656:31): [True: 653k, False: 2.43M]
  |  Branch (656:45): [True: 1.16M, False: 1.26M]
  ------------------
  657|  1.81M|            ++it;
  658|  1.81M|         }
  659|       |
  660|  1.27M|         if (!allow_core_schema_secondary_handle) {
  ------------------
  |  Branch (660:14): [True: 12, False: 1.27M]
  ------------------
  661|     12|            return yaml_tag::none;
  662|     12|         }
  663|       |
  664|       |         // Match known tags
  665|  1.27M|         if (tag_name == "str") return yaml_tag::str;
  ------------------
  |  Branch (665:14): [True: 25.6k, False: 1.25M]
  ------------------
  666|  1.25M|         if (tag_name == "int") return yaml_tag::int_tag;
  ------------------
  |  Branch (666:14): [True: 84.5k, False: 1.16M]
  ------------------
  667|  1.16M|         if (tag_name == "float") return yaml_tag::float_tag;
  ------------------
  |  Branch (667:14): [True: 1.04k, False: 1.16M]
  ------------------
  668|  1.16M|         if (tag_name == "bool") return yaml_tag::bool_tag;
  ------------------
  |  Branch (668:14): [True: 173k, False: 992k]
  ------------------
  669|   992k|         if (tag_name == "null") return yaml_tag::null_tag;
  ------------------
  |  Branch (669:14): [True: 9.14k, False: 982k]
  ------------------
  670|   982k|         if (tag_name == "map") return yaml_tag::map;
  ------------------
  |  Branch (670:14): [True: 185k, False: 797k]
  ------------------
  671|   797k|         if (tag_name == "seq") return yaml_tag::seq;
  ------------------
  |  Branch (671:14): [True: 334k, False: 463k]
  ------------------
  672|       |
  673|       |         // Unrecognized shorthand tag (e.g., !!omap) — ignore and parse value normally
  674|   463k|         return yaml_tag::none;
  675|   797k|      }
  676|       |
  677|       |      // Check for verbatim tag !<...>
  678|  1.49M|      if (*it == '<') {
  ------------------
  |  Branch (678:11): [True: 6.89k, False: 1.48M]
  ------------------
  679|  6.89k|         ++it;
  680|  6.89k|         auto tag_start = it;
  681|  2.01M|         while (it != end && *it != '>') {
  ------------------
  |  Branch (681:17): [True: 2.01M, False: 316]
  |  Branch (681:30): [True: 2.00M, False: 6.57k]
  ------------------
  682|  2.00M|            ++it;
  683|  2.00M|         }
  684|  6.89k|         if (it == end) {
  ------------------
  |  Branch (684:14): [True: 316, False: 6.57k]
  ------------------
  685|    316|            return yaml_tag::unknown;
  686|    316|         }
  687|       |
  688|  6.57k|         std::string_view tag_uri(tag_start, static_cast<size_t>(it - tag_start));
  689|  6.57k|         if (tag_uri.empty() || malformed_tag_token(tag_uri)) {
  ------------------
  |  Branch (689:14): [True: 62, False: 6.51k]
  |  Branch (689:33): [True: 272, False: 6.24k]
  ------------------
  690|    334|            return yaml_tag::unknown;
  691|    334|         }
  692|  6.24k|         ++it; // skip >
  693|  6.24k|         if (it != end && malformed_tag_termination(*it)) {
  ------------------
  |  Branch (693:14): [True: 5.88k, False: 358]
  |  Branch (693:27): [True: 224, False: 5.66k]
  ------------------
  694|    224|            return yaml_tag::unknown;
  695|    224|         }
  696|       |
  697|       |         // Skip whitespace after tag
  698|  15.5k|         while (it != end && (*it == ' ' || *it == '\t')) {
  ------------------
  |  Branch (698:17): [True: 14.7k, False: 796]
  |  Branch (698:31): [True: 5.16k, False: 9.55k]
  |  Branch (698:45): [True: 4.33k, False: 5.22k]
  ------------------
  699|  9.49k|            ++it;
  700|  9.49k|         }
  701|       |
  702|       |         // Match known YAML 1.2 URIs
  703|  6.02k|         if (tag_uri == "tag:yaml.org,2002:str") return yaml_tag::str;
  ------------------
  |  Branch (703:14): [True: 190, False: 5.83k]
  ------------------
  704|  5.83k|         if (tag_uri == "tag:yaml.org,2002:int") return yaml_tag::int_tag;
  ------------------
  |  Branch (704:14): [True: 66, False: 5.76k]
  ------------------
  705|  5.76k|         if (tag_uri == "tag:yaml.org,2002:float") return yaml_tag::float_tag;
  ------------------
  |  Branch (705:14): [True: 352, False: 5.41k]
  ------------------
  706|  5.41k|         if (tag_uri == "tag:yaml.org,2002:bool") return yaml_tag::bool_tag;
  ------------------
  |  Branch (706:14): [True: 66, False: 5.34k]
  ------------------
  707|  5.34k|         if (tag_uri == "tag:yaml.org,2002:null") return yaml_tag::null_tag;
  ------------------
  |  Branch (707:14): [True: 102, False: 5.24k]
  ------------------
  708|  5.24k|         if (tag_uri == "tag:yaml.org,2002:map") return yaml_tag::map;
  ------------------
  |  Branch (708:14): [True: 70, False: 5.17k]
  ------------------
  709|  5.17k|         if (tag_uri == "tag:yaml.org,2002:seq") return yaml_tag::seq;
  ------------------
  |  Branch (709:14): [True: 66, False: 5.10k]
  ------------------
  710|       |
  711|       |         // Unrecognized verbatim tag — ignore and parse value normally
  712|  5.10k|         return yaml_tag::none;
  713|  5.17k|      }
  714|       |
  715|       |      // Named tag !name - skip it and read name
  716|  1.48M|      auto tag_start = it;
  717|  8.30M|      while (it != end && !plain_scalar_end_table[static_cast<uint8_t>(*it)]) {
  ------------------
  |  Branch (717:14): [True: 8.29M, False: 4.72k]
  |  Branch (717:27): [True: 6.81M, False: 1.47M]
  ------------------
  718|  6.81M|         ++it;
  719|  6.81M|      }
  720|  1.48M|      std::string_view tag_name(tag_start, static_cast<size_t>(it - tag_start));
  721|  1.48M|      if (!tag_name.empty() && malformed_tag_token(tag_name)) {
  ------------------
  |  Branch (721:11): [True: 1.14M, False: 343k]
  |  Branch (721:32): [True: 0, False: 1.14M]
  ------------------
  722|      0|         return yaml_tag::unknown;
  723|      0|      }
  724|  1.48M|      if (!tag_name.empty() && it != end && malformed_tag_termination(*it)) {
  ------------------
  |  Branch (724:11): [True: 1.14M, False: 343k]
  |  Branch (724:32): [True: 1.13M, False: 4.72k]
  |  Branch (724:45): [True: 944, False: 1.13M]
  ------------------
  725|    944|         return yaml_tag::unknown;
  726|    944|      }
  727|       |
  728|       |      // Skip whitespace after tag
  729|  2.83M|      while (it != end && (*it == ' ' || *it == '\t')) {
  ------------------
  |  Branch (729:14): [True: 2.83M, False: 4.87k]
  |  Branch (729:28): [True: 267k, False: 2.56M]
  |  Branch (729:42): [True: 1.08M, False: 1.47M]
  ------------------
  730|  1.35M|         ++it;
  731|  1.35M|      }
  732|       |
  733|       |      // Unrecognized named tag — ignore and parse value normally
  734|  1.48M|      return yaml_tag::none;
  735|  1.48M|   }
_ZN3glz4yaml19malformed_tag_tokenENSt3__117basic_string_viewIcNS1_11char_traitsIcEEEE:
  604|  2.42M|   {
  605|       |      // Reject obviously malformed tag tokens used by conformance tests.
  606|       |      // Unknown-but-well-formed tags are still ignored.
  607|  16.6M|      for (const char c : token) {
  ------------------
  |  Branch (607:25): [True: 16.6M, False: 2.42M]
  ------------------
  608|  16.6M|         if (c == '{' || c == '}') return true;
  ------------------
  |  Branch (608:14): [True: 62, False: 16.6M]
  |  Branch (608:26): [True: 210, False: 16.6M]
  ------------------
  609|  16.6M|      }
  610|  2.42M|      return false;
  611|  2.42M|   }
_ZN3glz4yaml25malformed_tag_terminationEc:
  614|  2.41M|   {
  615|  2.41M|      return !(c == ' ' || c == '\t' || c == '\n' || c == '\r' || c == '#' || c == ',' || c == ']' || c == '}');
  ------------------
  |  Branch (615:16): [True: 483k, False: 1.93M]
  |  Branch (615:28): [True: 1.57M, False: 354k]
  |  Branch (615:41): [True: 227k, False: 126k]
  |  Branch (615:54): [True: 43.7k, False: 83.2k]
  |  Branch (615:67): [True: 43.7k, False: 39.4k]
  |  Branch (615:79): [True: 31.4k, False: 8.02k]
  |  Branch (615:91): [True: 2.31k, False: 5.71k]
  |  Branch (615:103): [True: 4.15k, False: 1.56k]
  ------------------
  616|  2.41M|   }
_ZN3glz4yaml20tag_valid_for_stringENS0_8yaml_tagE:
  751|  41.8M|   {
  752|  41.8M|      return tag == yaml_tag::none || tag == yaml_tag::str;
  ------------------
  |  Branch (752:14): [True: 41.8M, False: 3.44k]
  |  Branch (752:39): [True: 3.32k, False: 126]
  ------------------
  753|  41.8M|   }
_ZN3glz4yaml17tag_valid_for_mapENS0_8yaml_tagE:
  787|  11.2M|   {
  788|  11.2M|      return tag == yaml_tag::none || tag == yaml_tag::map;
  ------------------
  |  Branch (788:14): [True: 11.2M, False: 1.87k]
  |  Branch (788:39): [True: 1.84k, False: 28]
  ------------------
  789|  11.2M|   }
_ZNK3glz4yaml12yaml_context23alias_span_is_replayingEPKcS3_:
  154|  5.34M|      {
  155|  19.7M|         for (const auto& [b, e] : active_alias_spans) {
  ------------------
  |  Branch (155:34): [True: 19.7M, False: 5.34M]
  ------------------
  156|  19.7M|            if (b == begin && e == end) return true;
  ------------------
  |  Branch (156:17): [True: 5.57k, False: 19.7M]
  |  Branch (156:31): [True: 2.93k, False: 2.64k]
  ------------------
  157|  19.7M|         }
  158|  5.34M|         return false;
  159|  5.34M|      }
_ZN3glz4yaml12yaml_context22charge_alias_expansionEm:
  174|  6.58M|      {
  175|  6.58M|         if (alias_expansion_budget == 0) {
  ------------------
  |  Branch (175:14): [True: 0, False: 6.58M]
  ------------------
  176|      0|            return true; // unbudgeted
  177|      0|         }
  178|  6.58M|         if (bytes >= alias_expansion_budget) {
  ------------------
  |  Branch (178:14): [True: 124, False: 6.58M]
  ------------------
  179|    124|            alias_expansion_budget = 1; // latch: spent, and still not "unbudgeted"
  180|    124|            return false;
  181|    124|         }
  182|  6.58M|         alias_expansion_budget -= bytes;
  183|  6.58M|         return true;
  184|  6.58M|      }
_ZN3glz4yaml12yaml_context11push_indentEi:
  106|  7.59M|      {
  107|  7.59M|         if (indent_stack.size() >= max_yaml_recursive_depth) [[unlikely]] {
  ------------------
  |  Branch (107:14): [True: 0, False: 7.59M]
  ------------------
  108|      0|            error = error_code::exceeded_max_recursive_depth;
  109|      0|            return false;
  110|      0|         }
  111|  7.59M|         indent_stack.push_back(static_cast<int16_t>(indent));
  112|  7.59M|         return true;
  113|  7.59M|      }
_ZN3glz4yaml20skip_ws_and_newlinesIRPKcS3_EEvOT_T0_:
  842|  66.4M|   {
  843|  86.2M|      while (it != end && (*it == ' ' || *it == '\t' || *it == '\n' || *it == '\r')) {
  ------------------
  |  Branch (843:14): [True: 86.2M, False: 29.0k]
  |  Branch (843:28): [True: 8.54M, False: 77.7M]
  |  Branch (843:42): [True: 3.69M, False: 74.0M]
  |  Branch (843:57): [True: 4.66M, False: 69.3M]
  |  Branch (843:72): [True: 2.96M, False: 66.3M]
  ------------------
  844|  19.8M|         if (*it == '\n' || *it == '\r') {
  ------------------
  |  Branch (844:14): [True: 4.66M, False: 15.2M]
  |  Branch (844:29): [True: 2.96M, False: 12.2M]
  ------------------
  845|  7.63M|            skip_newline(it, end);
  846|  7.63M|         }
  847|  12.2M|         else {
  848|  12.2M|            ++it;
  849|  12.2M|         }
  850|  19.8M|      }
  851|  66.4M|   }
_ZN3glz4yaml19detect_scalar_styleEc:
 1339|  6.27M|   {
 1340|  6.27M|      switch (c) {
 1341|  41.0k|      case '"':
  ------------------
  |  Branch (1341:7): [True: 41.0k, False: 6.23M]
  ------------------
 1342|  41.0k|         return scalar_style::double_quoted;
 1343|  93.2k|      case '\'':
  ------------------
  |  Branch (1343:7): [True: 93.2k, False: 6.18M]
  ------------------
 1344|  93.2k|         return scalar_style::single_quoted;
 1345|  18.0k|      case '|':
  ------------------
  |  Branch (1345:7): [True: 18.0k, False: 6.26M]
  ------------------
 1346|  18.0k|         return scalar_style::literal_block;
 1347|  38.9k|      case '>':
  ------------------
  |  Branch (1347:7): [True: 38.9k, False: 6.24M]
  ------------------
 1348|  38.9k|         return scalar_style::folded_block;
 1349|  6.08M|      default:
  ------------------
  |  Branch (1349:7): [True: 6.08M, False: 191k]
  ------------------
 1350|  6.08M|         return scalar_style::plain;
 1351|  6.27M|      }
 1352|  6.27M|   }
_ZN3glz4yaml23skip_folded_line_indentINS0_12yaml_contextEEEbRPKcS4_RT_Pi:
  908|  1.12M|   {
  909|  1.12M|      bool saw_space = false;
  910|  1.12M|      int indent_count = 0;
  911|  1.70M|      while (src < src_end && (*src == ' ' || *src == '\t')) {
  ------------------
  |  Branch (911:14): [True: 1.62M, False: 74.6k]
  |  Branch (911:32): [True: 323k, False: 1.30M]
  |  Branch (911:47): [True: 251k, False: 1.05M]
  ------------------
  912|       |         // In nested block contexts, a tab at indentation column 0 is invalid.
  913|   575k|         if (*src == '\t' && !saw_space && ctx.current_indent() >= 0) {
  ------------------
  |  Branch (913:14): [True: 251k, False: 323k]
  |  Branch (913:30): [True: 78.7k, False: 173k]
  |  Branch (913:44): [True: 64, False: 78.6k]
  ------------------
  914|     64|            ctx.error = error_code::syntax_error;
  915|     64|            return false;
  916|     64|         }
  917|   575k|         if (*src == ' ') saw_space = true;
  ------------------
  |  Branch (917:14): [True: 323k, False: 251k]
  ------------------
  918|   575k|         ++indent_count;
  919|   575k|         ++src;
  920|   575k|      }
  921|  1.12M|      if (ctx.current_indent() >= 0 && src < src_end && *src != '\n' && *src != '\r' &&
  ------------------
  |  Branch (921:11): [True: 277k, False: 847k]
  |  Branch (921:40): [True: 253k, False: 23.7k]
  |  Branch (921:57): [True: 188k, False: 64.7k]
  |  Branch (921:73): [True: 156k, False: 31.9k]
  ------------------
  922|   156k|          indent_count < ctx.current_indent()) {
  ------------------
  |  Branch (922:11): [True: 208, False: 156k]
  ------------------
  923|    208|         ctx.error = error_code::syntax_error;
  924|    208|         return false;
  925|    208|      }
  926|  1.12M|      if (indent_out) *indent_out = indent_count;
  ------------------
  |  Branch (926:11): [True: 1.12M, False: 0]
  ------------------
  927|  1.12M|      return true;
  928|  1.12M|   }
_ZN3glz4yaml27starts_with_document_markerIPKcS3_EEbT_T0_:
  885|   899k|   {
  886|   899k|      if (src >= src_end) return false;
  ------------------
  |  Branch (886:11): [True: 71.0k, False: 828k]
  ------------------
  887|   828k|      if ((src_end - src) >= 3) {
  ------------------
  |  Branch (887:11): [True: 809k, False: 18.2k]
  ------------------
  888|   809k|         if (src[0] == '-' && src[1] == '-' && src[2] == '-') {
  ------------------
  |  Branch (888:14): [True: 39.7k, False: 770k]
  |  Branch (888:31): [True: 22.1k, False: 17.5k]
  |  Branch (888:48): [True: 5.68k, False: 16.4k]
  ------------------
  889|  5.68k|            const auto* after = src + 3;
  890|  5.68k|            return after == src_end || *after == ' ' || *after == '\t' || *after == '\n' || *after == '\r' ||
  ------------------
  |  Branch (890:20): [True: 30, False: 5.65k]
  |  Branch (890:40): [True: 34, False: 5.62k]
  |  Branch (890:57): [True: 30, False: 5.59k]
  |  Branch (890:75): [True: 38, False: 5.55k]
  |  Branch (890:93): [True: 30, False: 5.52k]
  ------------------
  891|  5.52k|                   *after == '#';
  ------------------
  |  Branch (891:20): [True: 24, False: 5.50k]
  ------------------
  892|  5.68k|         }
  893|   804k|         if (src[0] == '.' && src[1] == '.' && src[2] == '.') {
  ------------------
  |  Branch (893:14): [True: 29.6k, False: 774k]
  |  Branch (893:31): [True: 12.5k, False: 17.0k]
  |  Branch (893:48): [True: 1.86k, False: 10.7k]
  ------------------
  894|  1.86k|            const auto* after = src + 3;
  895|  1.86k|            return after == src_end || *after == ' ' || *after == '\t' || *after == '\n' || *after == '\r' ||
  ------------------
  |  Branch (895:20): [True: 38, False: 1.82k]
  |  Branch (895:40): [True: 34, False: 1.79k]
  |  Branch (895:57): [True: 36, False: 1.75k]
  |  Branch (895:75): [True: 30, False: 1.72k]
  |  Branch (895:93): [True: 46, False: 1.68k]
  ------------------
  896|  1.68k|                   *after == '#';
  ------------------
  |  Branch (896:20): [True: 28, False: 1.65k]
  ------------------
  897|  1.86k|         }
  898|   804k|      }
  899|   820k|      return false;
  900|   828k|   }
_ZN3glz4yaml19tag_valid_for_floatENS0_8yaml_tagE:
  763|  4.63M|   {
  764|  4.63M|      return tag == yaml_tag::none || tag == yaml_tag::float_tag || tag == yaml_tag::int_tag;
  ------------------
  |  Branch (764:14): [True: 4.63M, False: 2.00k]
  |  Branch (764:39): [True: 552, False: 1.45k]
  |  Branch (764:69): [True: 466, False: 984]
  ------------------
  765|  4.63M|   }
_ZN3glz4yaml18tag_valid_for_boolENS0_8yaml_tagE:
  769|   346k|   {
  770|   346k|      return tag == yaml_tag::none || tag == yaml_tag::bool_tag;
  ------------------
  |  Branch (770:14): [True: 333k, False: 13.1k]
  |  Branch (770:39): [True: 13.1k, False: 24]
  ------------------
  771|   346k|   }
_ZN3glz4yaml12is_yaml_nullENSt3__117basic_string_viewIcNS1_11char_traitsIcEEEE:
 1374|   107k|   {
 1375|   107k|      return s == "null" || s == "Null" || s == "NULL" || s == "~" || s.empty();
  ------------------
  |  Branch (1375:14): [True: 89.4k, False: 17.9k]
  |  Branch (1375:29): [True: 8.44k, False: 9.50k]
  |  Branch (1375:44): [True: 4.79k, False: 4.71k]
  |  Branch (1375:59): [True: 0, False: 4.71k]
  |  Branch (1375:71): [True: 4.30k, False: 414]
  ------------------
 1376|   107k|   }
_ZN3glz4yaml14measure_indentILb1ERPKcS3_NS0_12yaml_contextEEEiOT0_T1_RT2_:
 1250|  2.92M|   {
 1251|  2.92M|      int32_t indent = 0;
 1252|  3.98M|      while (it != end && *it == ' ') {
  ------------------
  |  Branch (1252:14): [True: 3.64M, False: 339k]
  |  Branch (1252:27): [True: 1.06M, False: 2.58M]
  ------------------
 1253|  1.06M|         ++indent;
 1254|  1.06M|         ++it;
 1255|  1.06M|      }
 1256|       |      // YAML spec: "Tab characters must not be used for indentation"
 1257|  2.92M|      if constexpr (error_on_tab) {
 1258|  2.92M|         if (it != end && *it == '\t') {
  ------------------
  |  Branch (1258:14): [True: 2.58M, False: 339k]
  |  Branch (1258:27): [True: 150, False: 2.58M]
  ------------------
 1259|    150|            ctx.error = error_code::syntax_error;
 1260|    150|         }
 1261|       |      }
 1262|       |      else {
 1263|       |         // In block scalar context: tabs after spaces are content, not indentation.
 1264|       |         // Only error when tab is the first character (pure tab indentation).
 1265|       |         if (indent == 0 && it != end && *it == '\t') {
 1266|       |            ctx.error = error_code::syntax_error;
 1267|       |         }
 1268|       |      }
 1269|  2.92M|      return indent;
 1270|  2.92M|   }
_ZNK3glz4yaml12yaml_context13line_begin_ofEPKc:
  302|  17.4M|      {
  303|  17.4M|         if (!stream_begin || p < stream_begin) {
  ------------------
  |  Branch (303:14): [True: 0, False: 17.4M]
  |  Branch (303:31): [True: 0, False: 17.4M]
  ------------------
  304|      0|            return p;
  305|      0|         }
  306|  17.4M|         memoize_line(p);
  307|  17.4M|         return memo_line_begin;
  308|  17.4M|      }
_ZNK3glz4yaml12yaml_context12memoize_lineEPKc:
  266|  17.4M|      {
  267|  17.4M|         if (memo_line_begin && p >= memo_line_begin && p <= memo_verified_end) {
  ------------------
  |  Branch (267:14): [True: 17.0M, False: 451k]
  |  Branch (267:33): [True: 15.6M, False: 1.39M]
  |  Branch (267:57): [True: 7.66M, False: 7.94M]
  ------------------
  268|  7.66M|            return;
  269|  7.66M|         }
  270|       |         // A query past the memoized span only has to walk the new bytes; one before it (or with
  271|       |         // no memo yet) walks all the way back.
  272|  9.79M|         const bool extends = memo_line_begin && p > memo_verified_end;
  ------------------
  |  Branch (272:31): [True: 9.34M, False: 451k]
  |  Branch (272:50): [True: 7.94M, False: 1.39M]
  ------------------
  273|  9.79M|         const char* const floor = extends ? memo_verified_end : stream_begin;
  ------------------
  |  Branch (273:36): [True: 7.94M, False: 1.84M]
  ------------------
  274|  9.79M|         const char* first_tab = nullptr;
  275|  9.79M|         const char* first_content = nullptr;
  276|  9.79M|         const char* q = p;
  277|   927M|         while (q > floor) {
  ------------------
  |  Branch (277:17): [True: 924M, False: 3.44M]
  ------------------
  278|   924M|            const char c = *(q - 1);
  279|   924M|            if (c == '\n' || c == '\r') break;
  ------------------
  |  Branch (279:17): [True: 3.55M, False: 920M]
  |  Branch (279:30): [True: 2.79M, False: 917M]
  ------------------
  280|   917M|            --q;
  281|       |            // Walking backward, the last one seen is the earliest one on the line.
  282|   917M|            if (c == '\t')
  ------------------
  |  Branch (282:17): [True: 4.19M, False: 913M]
  ------------------
  283|  4.19M|               first_tab = q;
  284|   913M|            else if (c != ' ')
  ------------------
  |  Branch (284:22): [True: 880M, False: 33.0M]
  ------------------
  285|   880M|               first_content = q;
  286|   917M|         }
  287|  9.79M|         if (extends && q == floor) {
  ------------------
  |  Branch (287:14): [True: 7.94M, False: 1.84M]
  |  Branch (287:25): [True: 3.16M, False: 4.78M]
  ------------------
  288|       |            // The new bytes continue the memoized line, so anything it already found is earlier.
  289|  3.16M|            if (memo_first_tab) first_tab = memo_first_tab;
  ------------------
  |  Branch (289:17): [True: 126k, False: 3.03M]
  ------------------
  290|  3.16M|            if (memo_first_content) first_content = memo_first_content;
  ------------------
  |  Branch (290:17): [True: 2.21M, False: 945k]
  ------------------
  291|  3.16M|         }
  292|  6.63M|         else {
  293|  6.63M|            memo_line_begin = q;
  294|  6.63M|         }
  295|  9.79M|         memo_verified_end = p;
  296|  9.79M|         memo_first_tab = first_tab;
  297|  9.79M|         memo_first_content = first_content;
  298|  9.79M|      }
_ZN3glz4yaml12yaml_context10pop_indentEv:
  116|  7.07M|      {
  117|  7.07M|         if (!indent_stack.empty()) {
  ------------------
  |  Branch (117:14): [True: 7.07M, False: 0]
  ------------------
  118|  7.07M|            indent_stack.pop_back();
  119|  7.07M|         }
  120|  7.07M|      }
_ZN3glz4yaml17tag_valid_for_seqENS0_8yaml_tagE:
  781|  4.04M|   {
  782|  4.04M|      return tag == yaml_tag::none || tag == yaml_tag::seq;
  ------------------
  |  Branch (782:14): [True: 4.01M, False: 26.6k]
  |  Branch (782:39): [True: 26.5k, False: 24]
  ------------------
  783|  4.04M|   }
_ZN3glz4yaml12yaml_context20charge_key_expansionEm:
  194|  3.87M|      {
  195|  3.87M|         if (key_expansion_budget == 0) {
  ------------------
  |  Branch (195:14): [True: 0, False: 3.87M]
  ------------------
  196|      0|            return true; // unbudgeted
  197|      0|         }
  198|  3.87M|         if (bytes >= key_expansion_budget) {
  ------------------
  |  Branch (198:14): [True: 572, False: 3.87M]
  ------------------
  199|    572|            key_expansion_budget = 1; // latch: spent, and still not "unbudgeted"
  200|    572|            return false;
  201|    572|         }
  202|  3.87M|         key_expansion_budget -= bytes;
  203|  3.87M|         return true;
  204|  3.87M|      }
_ZN3glz4yaml14measure_indentILb0ERPKcS3_NS0_12yaml_contextEEEiOT0_T1_RT2_:
 1250|  2.20M|   {
 1251|  2.20M|      int32_t indent = 0;
 1252|  4.39M|      while (it != end && *it == ' ') {
  ------------------
  |  Branch (1252:14): [True: 4.27M, False: 116k]
  |  Branch (1252:27): [True: 2.19M, False: 2.08M]
  ------------------
 1253|  2.19M|         ++indent;
 1254|  2.19M|         ++it;
 1255|  2.19M|      }
 1256|       |      // YAML spec: "Tab characters must not be used for indentation"
 1257|       |      if constexpr (error_on_tab) {
 1258|       |         if (it != end && *it == '\t') {
 1259|       |            ctx.error = error_code::syntax_error;
 1260|       |         }
 1261|       |      }
 1262|  2.20M|      else {
 1263|       |         // In block scalar context: tabs after spaces are content, not indentation.
 1264|       |         // Only error when tab is the first character (pure tab indentation).
 1265|  2.20M|         if (indent == 0 && it != end && *it == '\t') {
  ------------------
  |  Branch (1265:14): [True: 1.07M, False: 1.13M]
  |  Branch (1265:29): [True: 955k, False: 115k]
  |  Branch (1265:42): [True: 270, False: 954k]
  ------------------
 1266|    270|            ctx.error = error_code::syntax_error;
 1267|    270|         }
 1268|  2.20M|      }
 1269|  2.20M|      return indent;
 1270|  2.20M|   }
_ZNK3glz4yaml12yaml_context16make_speculativeEv:
  339|  7.72M|      {
  340|  7.72M|         yaml_context c{};
  341|  7.72M|         c.indent_stack = indent_stack;
  342|  7.72M|         c.anchors = anchors;
  343|  7.72M|         c.active_alias_spans = active_alias_spans;
  344|       |         // Speculative work is real work: a probe that expands aliases spends the same budget,
  345|       |         // and the sites that adopt a probe's anchors adopt what it spent along with them.
  346|  7.72M|         c.alias_expansion_budget = alias_expansion_budget;
  347|       |         // Likewise for key text: a probe that built a complex key did the work whether or not
  348|       |         // its alternative is adopted, and an attempt that is never billed can be repeated free.
  349|  7.72M|         c.key_expansion_budget = key_expansion_budget;
  350|  7.72M|         c.sequence_item_value_context = sequence_item_value_context;
  351|  7.72M|         c.sequence_dash_indent = sequence_dash_indent;
  352|  7.72M|         c.explicit_mapping_key_context = explicit_mapping_key_context;
  353|  7.72M|         c.allow_indentless_sequence = allow_indentless_sequence;
  354|  7.72M|         c.stream_begin = stream_begin;
  355|       |         // The line memo only records what the buffer says, so a probe may keep using it.
  356|  7.72M|         c.memo_line_begin = memo_line_begin;
  357|  7.72M|         c.memo_verified_end = memo_verified_end;
  358|  7.72M|         c.memo_first_tab = memo_first_tab;
  359|  7.72M|         c.memo_first_content = memo_first_content;
  360|  7.72M|         c.secondary_tag_handle_overridden = secondary_tag_handle_overridden;
  361|       |         // Carry the recursion depth so a speculative type-probe shares the parent's budget
  362|       |         // and can't reset the stack-overflow guard partway down a deeply nested value.
  363|  7.72M|         c.depth = depth;
  364|  7.72M|         return c;
  365|  7.72M|      }
_ZNK3glz4yaml12yaml_context14current_indentEv:
  103|   105M|      int32_t current_indent() const noexcept { return indent_stack.empty() ? int32_t(-1) : indent_stack.back(); }
  ------------------
  |  Branch (103:56): [True: 73.1M, False: 32.1M]
  ------------------
_ZNK3glz4yaml12yaml_context18line_prefix_beforeEPKc:
  311|  13.4M|      {
  312|  13.4M|         const char* const begin = line_begin_of(p);
  313|  13.4M|         if (begin >= p) {
  ------------------
  |  Branch (313:14): [True: 3.34M, False: 10.1M]
  ------------------
  314|  3.34M|            return {};
  315|  3.34M|         }
  316|  10.1M|         return {int32_t(p - begin), memo_first_tab && memo_first_tab < p,
  ------------------
  |  Branch (316:38): [True: 2.30M, False: 7.83M]
  |  Branch (316:56): [True: 2.30M, False: 7.49k]
  ------------------
  317|  10.1M|                 memo_first_content && memo_first_content < p};
  ------------------
  |  Branch (317:18): [True: 9.39M, False: 747k]
  |  Branch (317:40): [True: 9.38M, False: 4.63k]
  ------------------
  318|  13.4M|      }
_ZN3glz4yaml12skip_newlineIRPKcS3_EEbOT_T0_:
  822|  99.0M|   {
  823|  99.0M|      if (it == end) return false;
  ------------------
  |  Branch (823:11): [True: 150k, False: 98.9M]
  ------------------
  824|       |
  825|  98.9M|      if (*it == '\r') {
  ------------------
  |  Branch (825:11): [True: 43.5M, False: 55.3M]
  ------------------
  826|  43.5M|         ++it;
  827|  43.5M|         if (it != end && *it == '\n') {
  ------------------
  |  Branch (827:14): [True: 42.3M, False: 1.22M]
  |  Branch (827:27): [True: 1.94M, False: 40.3M]
  ------------------
  828|  1.94M|            ++it;
  829|  1.94M|         }
  830|  43.5M|         return true;
  831|  43.5M|      }
  832|  55.3M|      else if (*it == '\n') {
  ------------------
  |  Branch (832:16): [True: 55.3M, False: 80]
  ------------------
  833|  55.3M|         ++it;
  834|  55.3M|         return true;
  835|  55.3M|      }
  836|     80|      return false;
  837|  98.9M|   }

_ZN3glz5parseILj450EE2opITnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1EEERNS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEETkNS_10is_contextERNS_4yaml12yaml_contextERPKcSD_EEvOT0_OT1_OT2_T3_:
   69|  37.0k|      {
   70|  37.0k|         if constexpr (requires { ctx.stream_begin; }) {
   71|  37.0k|            if (!ctx.stream_begin && it != end) {
  ------------------
  |  Branch (71:17): [True: 37.0k, False: 0]
  |  Branch (71:38): [True: 37.0k, False: 0]
  ------------------
   72|  37.0k|               ctx.stream_begin = &*it;
   73|       |               // The line memo holds pointers into whatever buffer filled it, so a reused
   74|       |               // context must not carry a previous read's into this one.
   75|  37.0k|               if constexpr (requires { ctx.reset_line_memo(); }) {
   76|  37.0k|                  ctx.reset_line_memo();
   77|  37.0k|               }
   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|  37.0k|               if constexpr (requires { ctx.alias_expansion_budget; } && requires { size_t(end - it); }) {
   82|  37.0k|                  const size_t scaled = size_t(end - it) * yaml::max_alias_expansion_factor;
   83|  37.0k|                  ctx.alias_expansion_budget =
   84|  37.0k|                     scaled > yaml::min_alias_expansion_bytes ? scaled : yaml::min_alias_expansion_bytes;
  ------------------
  |  Branch (84:22): [True: 252, False: 36.7k]
  ------------------
   85|  37.0k|               }
   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|  37.0k|               if constexpr (requires { ctx.key_expansion_budget; } && requires { size_t(end - it); }) {
   89|  37.0k|                  const size_t scaled = size_t(end - it) * yaml::max_key_expansion_factor;
   90|  37.0k|                  ctx.key_expansion_budget =
   91|  37.0k|                     scaled > yaml::min_key_expansion_bytes ? scaled : yaml::min_key_expansion_bytes;
  ------------------
  |  Branch (91:22): [True: 252, False: 36.7k]
  ------------------
   92|  37.0k|               }
   93|  37.0k|            }
   94|  37.0k|         }
   95|       |         // Skip YAML directives and document start marker (---) if present
   96|  37.0k|         yaml::skip_document_start(it, end, ctx);
   97|  37.0k|         if (bool(ctx.error)) [[unlikely]] {
  ------------------
  |  Branch (97:14): [True: 276, False: 36.7k]
  ------------------
   98|    276|            return;
   99|    276|         }
  100|       |
  101|  36.7k|         using V = std::remove_cvref_t<T>;
  102|  36.7k|         if (it == end) {
  ------------------
  |  Branch (102:14): [True: 54, False: 36.7k]
  ------------------
  103|       |            // An empty document is a valid YAML null document.
  104|     54|            if constexpr (requires { value = nullptr; }) {
  105|     54|               value = nullptr;
  106|     54|               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|     54|         }
  117|       |
  118|       |         // A bare document boundary marker at root denotes an empty document.
  119|       |         // Examples: "---\n---\n", "# comment\n...\n"
  120|  36.7k|         if (yaml::at_document_start(it, end) || yaml::at_document_end(it, end)) {
  ------------------
  |  Branch (120:14): [True: 59, False: 36.7k]
  |  Branch (120:50): [True: 18, False: 36.6k]
  ------------------
  121|     23|            if constexpr (requires { value = nullptr; }) {
  122|     23|               value = nullptr;
  123|     23|               return;
  124|       |            }
  125|       |            else if constexpr (nullable_like<V>) {
  126|       |               value = {};
  127|       |               return;
  128|       |            }
  129|       |            else {
  130|       |               ctx.error = error_code::unexpected_end;
  131|       |               return;
  132|       |            }
  133|     23|         }
  134|       |
  135|      0|         from<YAML, V>::template op<Opts>(std::forward<T>(value), std::forward<Ctx>(ctx), std::forward<It0>(it), end);
  136|       |
  137|       |         // A directive line (%YAML/%TAG/...) is only valid in the document prefix.
  138|       |         // If parsing stopped before the end and we encounter a directive in the
  139|       |         // remaining tail, treat it as malformed stream structure. This is a document-level
  140|       |         // concern, so only enforce it at the document root: a nested call (e.g. a tagged
  141|       |         // variant handing a custom alternative its body) is mid-document and its tail
  142|       |         // belongs to an enclosing node, not this value.
  143|  36.7k|         if constexpr (!check_partial_read(Opts)) {
  144|  36.7k|            if (!bool(ctx.error) && ctx.current_indent() < 0) {
  ------------------
  |  Branch (144:17): [True: 7.15k, False: 29.6k]
  |  Branch (144:37): [True: 7.15k, False: 0]
  ------------------
  145|  7.15k|               auto is_document_start = [&](auto pos) {
  146|  7.15k|                  if (end - pos >= 3 && pos[0] == '-' && pos[1] == '-' && pos[2] == '-') {
  147|  7.15k|                     auto after = pos + 3;
  148|  7.15k|                     return after == end || *after == ' ' || *after == '\t' || *after == '\n' || *after == '\r' ||
  149|  7.15k|                            *after == '#';
  150|  7.15k|                  }
  151|  7.15k|                  return false;
  152|  7.15k|               };
  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|  7.15k|               if constexpr (requires { ctx.line_prefix_before(it); }) {
  162|  7.15k|                  if (it != end && ctx.line_prefix_before(it).has_content) {
  ------------------
  |  Branch (162:23): [True: 1.22k, False: 5.92k]
  |  Branch (162:23): [True: 857, False: 6.29k]
  |  Branch (162:36): [True: 857, False: 371]
  ------------------
  163|    857|                     auto rest = it;
  164|  1.68k|                     while (rest != end && (*rest == ' ' || *rest == '\t')) ++rest;
  ------------------
  |  Branch (164:29): [True: 1.65k, False: 35]
  |  Branch (164:45): [True: 495, False: 1.15k]
  |  Branch (164:61): [True: 334, False: 822]
  ------------------
  165|    857|                     if (rest != end && *rest != '\n' && *rest != '\r' && *rest != '#') {
  ------------------
  |  Branch (165:26): [True: 822, False: 35]
  |  Branch (165:41): [True: 565, False: 257]
  |  Branch (165:58): [True: 334, False: 231]
  |  Branch (165:75): [True: 252, False: 82]
  ------------------
  166|    252|                        ctx.error = error_code::syntax_error;
  167|    252|                        return;
  168|    252|                     }
  169|    857|                  }
  170|  7.15k|               }
  171|       |
  172|  6.90k|               auto tail_scan = it;
  173|  7.15k|               bool seen_document_end_marker = false;
  174|  15.2k|               while (tail_scan != end) {
  ------------------
  |  Branch (174:23): [True: 8.72k, False: 6.56k]
  ------------------
  175|  8.72k|                  auto line = tail_scan;
  176|  11.8k|                  while (line != end && (*line == ' ' || *line == '\t')) ++line;
  ------------------
  |  Branch (176:26): [True: 11.7k, False: 64]
  |  Branch (176:42): [True: 2.51k, False: 9.22k]
  |  Branch (176:58): [True: 569, False: 8.65k]
  ------------------
  177|  8.72k|                  if (line != tail_scan && line != end && *line != '\n' && *line != '\r' && *line != '#') {
  ------------------
  |  Branch (177:23): [True: 1.33k, False: 7.38k]
  |  Branch (177:44): [True: 1.27k, False: 64]
  |  Branch (177:59): [True: 891, False: 383]
  |  Branch (177:76): [True: 543, False: 348]
  |  Branch (177:93): [True: 104, False: 439]
  ------------------
  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|    104|                     const char first = *line;
  182|    104|                     const bool explicit_or_structural_start =
  183|    104|                        (first == ':' || first == '?' || first == '!' || first == '&' || first == '*' || first == '[' ||
  ------------------
  |  Branch (183:26): [True: 9, False: 95]
  |  Branch (183:42): [True: 2, False: 93]
  |  Branch (183:58): [True: 3, False: 90]
  |  Branch (183:74): [True: 3, False: 87]
  |  Branch (183:90): [True: 6, False: 81]
  |  Branch (183:106): [True: 3, False: 78]
  ------------------
  184|     78|                         first == '{' || first == '"' || first == '\'' || first == '-');
  ------------------
  |  Branch (184:26): [True: 2, False: 76]
  |  Branch (184:42): [True: 2, False: 74]
  |  Branch (184:58): [True: 2, False: 72]
  |  Branch (184:75): [True: 4, False: 68]
  ------------------
  185|    104|                     if (!explicit_or_structural_start) {
  ------------------
  |  Branch (185:26): [True: 68, False: 36]
  ------------------
  186|     68|                        auto scan = line;
  187|  1.15k|                        while (scan != end && *scan != '\n' && *scan != '\r') {
  ------------------
  |  Branch (187:32): [True: 1.12k, False: 32]
  |  Branch (187:47): [True: 1.11k, False: 7]
  |  Branch (187:64): [True: 1.11k, False: 2]
  ------------------
  188|  1.11k|                           if (*scan == ':') {
  ------------------
  |  Branch (188:32): [True: 340, False: 776]
  ------------------
  189|    340|                              auto after = scan + 1;
  190|    340|                              if (after == end || *after == ' ' || *after == '\t' || *after == '\n' || *after == '\r') {
  ------------------
  |  Branch (190:35): [True: 13, False: 327]
  |  Branch (190:51): [True: 3, False: 324]
  |  Branch (190:68): [True: 3, False: 321]
  |  Branch (190:86): [True: 3, False: 318]
  |  Branch (190:104): [True: 5, False: 313]
  ------------------
  191|     27|                                 ctx.error = error_code::syntax_error;
  192|     27|                                 return;
  193|     27|                              }
  194|    340|                           }
  195|  1.08k|                           ++scan;
  196|  1.08k|                        }
  197|     68|                     }
  198|     77|                     return;
  199|    104|                  }
  200|  8.61k|                  if (line == end) {
  ------------------
  |  Branch (200:23): [True: 64, False: 8.55k]
  ------------------
  201|     64|                     return;
  202|     64|                  }
  203|  8.55k|                  if (*line == ':' || *line == '?') {
  ------------------
  |  Branch (203:23): [True: 23, False: 8.53k]
  |  Branch (203:39): [True: 12, False: 8.51k]
  ------------------
  204|     35|                     return; // Explicit key/value continuation.
  205|     35|                  }
  206|  8.51k|                  if (*line == '\n' || *line == '\r') {
  ------------------
  |  Branch (206:23): [True: 3.46k, False: 5.05k]
  |  Branch (206:40): [True: 2.61k, False: 2.44k]
  ------------------
  207|  6.07k|                     tail_scan = line;
  208|  6.07k|                     yaml::skip_newline(tail_scan, end);
  209|  6.07k|                     continue;
  210|  6.07k|                  }
  211|  2.44k|                  if (*line == '#') {
  ------------------
  |  Branch (211:23): [True: 1.39k, False: 1.05k]
  ------------------
  212|  11.5k|                     while (tail_scan != end && *tail_scan != '\n' && *tail_scan != '\r') ++tail_scan;
  ------------------
  |  Branch (212:29): [True: 11.4k, False: 80]
  |  Branch (212:49): [True: 10.9k, False: 492]
  |  Branch (212:71): [True: 10.1k, False: 825]
  ------------------
  213|  1.39k|                     yaml::skip_newline(tail_scan, end);
  214|  1.39k|                     continue;
  215|  1.39k|                  }
  216|  1.05k|                  if (yaml::at_document_end(line, end)) {
  ------------------
  |  Branch (216:23): [True: 663, False: 387]
  ------------------
  217|    663|                     seen_document_end_marker = true;
  218|  8.92k|                     while (tail_scan != end && *tail_scan != '\n' && *tail_scan != '\r') ++tail_scan;
  ------------------
  |  Branch (218:29): [True: 8.84k, False: 84]
  |  Branch (218:49): [True: 8.49k, False: 341]
  |  Branch (218:71): [True: 8.26k, False: 238]
  ------------------
  219|    663|                     yaml::skip_newline(tail_scan, end);
  220|    663|                     continue;
  221|    663|                  }
  222|    387|                  if (is_document_start(line)) {
  ------------------
  |  Branch (222:23): [True: 114, False: 273]
  ------------------
  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|    114|                     auto header = line + 3;
  228|    763|                     while (header != end && (*header == ' ' || *header == '\t')) ++header;
  ------------------
  |  Branch (228:29): [True: 741, False: 22]
  |  Branch (228:47): [True: 341, False: 400]
  |  Branch (228:65): [True: 308, False: 92]
  ------------------
  229|    114|                     if (header != end && *header == '!') {
  ------------------
  |  Branch (229:26): [True: 92, False: 22]
  |  Branch (229:43): [True: 41, False: 51]
  ------------------
  230|     41|                        auto tag_end = header + 1;
  231|  43.9k|                        while (tag_end != end && *tag_end != ' ' && *tag_end != '\t' && *tag_end != '\n' &&
  ------------------
  |  Branch (231:32): [True: 43.9k, False: 11]
  |  Branch (231:50): [True: 43.9k, False: 13]
  |  Branch (231:69): [True: 43.9k, False: 8]
  |  Branch (231:89): [True: 43.9k, False: 5]
  ------------------
  232|  43.9k|                               *tag_end != '\r' && *tag_end != '#') {
  ------------------
  |  Branch (232:32): [True: 43.9k, False: 1]
  |  Branch (232:52): [True: 43.9k, False: 3]
  ------------------
  233|  43.9k|                           ++tag_end;
  234|  43.9k|                        }
  235|     41|                        std::string_view tag_token(header, static_cast<size_t>(tag_end - header));
  236|     41|                        const auto second_bang = tag_token.find('!', 1);
  237|     41|                        if (second_bang != std::string_view::npos) {
  ------------------
  |  Branch (237:29): [True: 22, False: 19]
  ------------------
  238|     22|                           std::string_view handle = tag_token.substr(0, second_bang + 1);
  239|     22|                           if (handle != "!" && handle != "!!") {
  ------------------
  |  Branch (239:32): [True: 22, False: 0]
  |  Branch (239:49): [True: 20, False: 2]
  ------------------
  240|     20|                              ctx.error = error_code::syntax_error;
  241|     20|                              return;
  242|     20|                           }
  243|     22|                        }
  244|     41|                     }
  245|     94|                     return; // Additional documents are allowed in the stream tail.
  246|    114|                  }
  247|    273|                  if (line != end && *line == '%') {
  ------------------
  |  Branch (247:23): [True: 273, False: 0]
  |  Branch (247:38): [True: 10, False: 263]
  ------------------
  248|       |                     // YAML directives are only valid in document prefixes. A directive
  249|       |                     // encountered mid-document (without a prior ...) is malformed.
  250|     10|                     if (!seen_document_end_marker) {
  ------------------
  |  Branch (250:26): [True: 7, False: 3]
  ------------------
  251|      7|                        ctx.error = error_code::syntax_error;
  252|      7|                        return;
  253|      7|                     }
  254|      3|                     return;
  255|     10|                  }
  256|    263|                  if (seen_document_end_marker) {
  ------------------
  |  Branch (256:23): [True: 35, False: 228]
  ------------------
  257|     35|                     return; // Implicit next document after explicit document end marker.
  258|     35|                  }
  259|    228|                  ctx.error = error_code::syntax_error;
  260|    228|                  return;
  261|    263|               }
  262|  7.15k|            }
  263|  36.7k|         }
  264|  36.7k|      }
_ZN3glz4fromILj450ENS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEEE2opITnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1EEERS4_TkNS_10is_contextERNS_4yaml12yaml_contextERPKcSD_EEvOT0_OT1_OT2_T3_:
  274|   672k|      {
  275|   672k|         using V = std::decay_t<decltype(get_member(std::declval<Value>(), meta_wrapper_v<T>))>;
  276|   672k|         from<YAML, V>::template op<Opts>(get_member(std::forward<Value>(value), meta_wrapper_v<T>),
  277|   672k|                                          std::forward<Ctx>(ctx), std::forward<It0>(it), end);
  278|   672k|      }
_ZN3glz4fromILj450ENSt3__17variantIJDndNS1_12basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEbNS1_6vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS6_ISD_EEEENSC_ISD_EEEEEE2opITnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1EEERPKcRSH_TkNS_10is_contextERNS_4yaml12yaml_contextESM_EEvOT1_OT2_OT0_T3_:
 5635|   874k|      {
 5636|       |         // Inside op() rather than at class scope: read_supported is `requires { from<Format, T>{}; }`,
 5637|       |         // so a class-scope assert turns that feature probe into a hard error instead of `false`.
 5638|   874k|         static_assert(content_v<std::remove_cvref_t<T>>.empty(),
 5639|   874k|                       "Adjacent variant tagging (glz::meta `content`) is implemented for JSON and "
 5640|   874k|                       "BEVE but not yet for YAML. Reading this variant as YAML would silently expect "
 5641|   874k|                       "the internally tagged shape, so it is rejected here instead.");
 5642|   874k|         if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (5642:14): [True: 0, False: 874k]
  ------------------
 5643|      0|            return;
 5644|       |
 5645|       |         // Every nested generic/variant value routes back through this reader, so bounding
 5646|       |         // depth here caps flow-collection and flow-embedded mapping recursion that the
 5647|       |         // indent stack does not cover.
 5648|   874k|         depth_guard guard{ctx, yaml::max_yaml_recursive_depth};
 5649|   874k|         if (!guard) [[unlikely]]
  ------------------
  |  Branch (5649:14): [True: 38, False: 874k]
  ------------------
 5650|     38|            return;
 5651|       |
 5652|       |         // At root level (indent == -1), skip leading whitespace, newlines, and comments
 5653|       |         // For nested values, only skip inline whitespace to preserve block structure
 5654|   874k|         if (ctx.current_indent() < 0) {
  ------------------
  |  Branch (5654:14): [True: 113k, False: 760k]
  ------------------
 5655|   113k|            yaml::skip_ws_newlines_comments(it, end);
 5656|   113k|         }
 5657|   760k|         else {
 5658|   760k|            yaml::skip_inline_ws(it, end);
 5659|   760k|         }
 5660|       |
 5661|   874k|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (5661:14): [True: 71, False: 874k]
  ------------------
 5662|     71|            ctx.error = error_code::unexpected_end;
 5663|     71|            return;
 5664|     71|         }
 5665|       |
 5666|       |         // Tagged variants: a discriminator key (meta::tag) selects the alternative, with the
 5667|       |         // matching meta::ids entry naming each type. This mirrors the JSON behavior so the
 5668|       |         // same variant definitions round-trip across both formats.
 5669|       |         if constexpr (not tag_v<std::remove_cvref_t<T>>.empty()) {
 5670|       |            using V = std::remove_cvref_t<T>;
 5671|       |            const bool value_is_mapping =
 5672|       |               (*it == '{') || (!yaml::check_flow_context(Opts) && yaml::line_could_be_block_mapping(it, end));
 5673|       |            if (value_is_mapping) {
 5674|       |               // The mapping's keys sit at the column of `it`. Recover that column from the buffer:
 5675|       |               // the indent stack carries the parent context's indent (a struct member, a sequence
 5676|       |               // item, etc. each push a different offset), not this mapping's true column (see helper).
 5677|       |               const int32_t mapping_column = tagged_mapping_visual_indent(ctx, it, ctx.current_indent() + 1);
 5678|       |               auto tag_ctx = ctx.make_speculative();
 5679|       |               const size_t index = scan_variant_tag_index<V, Opts>(tag_ctx, it, end, mapping_column);
 5680|       |               ctx.alias_expansion_budget = tag_ctx.alias_expansion_budget; // charged even if no tag matched
 5681|       |               ctx.key_expansion_budget = tag_ctx.key_expansion_budget;
 5682|       |               if (index < ids_v<V>.size()) {
 5683|       |                  static constexpr auto tag_literal = string_literal_from_view<tag_v<V>.size()>(tag_v<V>);
 5684|       |                  emplace_runtime_variant(value, index);
 5685|       |                  // Establish the mapping's true column on the indent stack for the alternative parse.
 5686|       |                  // The chosen object is then parsed - and the discriminator's inline value skipped -
 5687|       |                  // at a consistent indent in every context, so a tag on the first key does not fold
 5688|       |                  // the following sibling entries into its value (no special-casing needed downstream).
 5689|       |                  if (!ctx.push_indent(mapping_column)) [[unlikely]] {
 5690|       |                     ctx.error = error_code::exceeded_max_recursive_depth;
 5691|       |                     return;
 5692|       |                  }
 5693|       |                  std::visit(
 5694|       |                     [&](auto&& alt) {
 5695|       |                        using Alt = std::remove_cvref_t<decltype(alt)>;
 5696|       |                        if constexpr ((glaze_object_t<Alt> || reflectable<Alt>) && not custom_read<Alt>) {
 5697|       |                           // Parse the mapping into the resolved struct; the tag key is skipped.
 5698|       |                           from<YAML, Alt>::template op<Opts, tag_literal>(alt, ctx, it, end);
 5699|       |                        }
 5700|       |                        else if constexpr (custom_read<Alt>) {
 5701|       |                           // Custom alternatives read the mapping body themselves and cannot skip an
 5702|       |                           // interior tag key the way reflected objects do, so the tag must be the
 5703|       |                           // first key (glaze always writes it first). Consume that leading "tag: id"
 5704|       |                           // entry, then hand the remaining mapping to the custom handler.
 5705|       |                           if constexpr (yaml::check_flow_context(Opts)) {
 5706|       |                              ctx.error = error_code::feature_not_supported;
 5707|       |                              ctx.custom_error_message =
 5708|       |                                 "custom variant alternatives are not supported in YAML flow style";
 5709|       |                           }
 5710|       |                           else {
 5711|       |                              ctx.scratch.clear();
 5712|       |                              if (yaml::parse_yaml_key(ctx.scratch, ctx, it, end, false)) {
 5713|       |                                 if (std::string_view{ctx.scratch} != tag_v<V>) {
 5714|       |                                    ctx.error = error_code::feature_not_supported;
 5715|       |                                    ctx.custom_error_message =
 5716|       |                                       "the tag must be the first key for a custom variant alternative";
 5717|       |                                 }
 5718|       |                                 else {
 5719|       |                                    yaml::skip_inline_ws(it, end);
 5720|       |                                    if (it == end || *it != ':') {
 5721|       |                                       ctx.error = error_code::syntax_error;
 5722|       |                                    }
 5723|       |                                    else {
 5724|       |                                       ++it;
 5725|       |                                       yaml::skip_inline_ws(it, end);
 5726|       |                                       yaml::skip_unknown_block_value<Opts>(ctx, it, end, mapping_column);
 5727|       |                                       if (!bool(ctx.error)) {
 5728|       |                                          // If nothing but trailing whitespace/comments remains, the tag
 5729|       |                                          // was the whole mapping: leave the alternative default.
 5730|       |                                          auto probe = it;
 5731|       |                                          yaml::skip_ws_newlines_comments(probe, end);
 5732|       |                                          if (probe == end) {
 5733|       |                                             it = probe;
 5734|       |                                          }
 5735|       |                                          else {
 5736|       |                                             // Publish the mapping's column so the custom handler's block
 5737|       |                                             // mapping (which would otherwise discover its own indent) reads
 5738|       |                                             // the remaining entries at the variant's indent and dedents
 5739|       |                                             // correctly in every context (root, sequence, nested).
 5740|       |                                             ctx.forced_block_mapping_indent = mapping_column;
 5741|       |                                             from<YAML, Alt>::template op<Opts>(alt, ctx, it, end);
 5742|       |                                             ctx.forced_block_mapping_indent = -1;
 5743|       |                                          }
 5744|       |                                       }
 5745|       |                                    }
 5746|       |                                 }
 5747|       |                              }
 5748|       |                           }
 5749|       |                        }
 5750|       |                        else {
 5751|       |                           // Non-object alternative (e.g. std::monostate): the emplaced default is
 5752|       |                           // the value, but the mapping must still be consumed.
 5753|       |                           walk_tagged_mapping<Opts>(
 5754|       |                              ctx, it, end, tag_v<V>, mapping_column,
 5755|       |                              [&](auto&& c, auto&& i, auto&& e, int32_t line_indent, bool in_flow) {
 5756|       |                                 yaml::skip_yaml_value<Opts>(c, i, e, in_flow ? 0 : line_indent, in_flow);
 5757|       |                              });
 5758|       |                        }
 5759|       |                     },
 5760|       |                     value);
 5761|       |                  ctx.pop_indent();
 5762|       |                  return;
 5763|       |               }
 5764|       |               // No resolvable tag key was found. Fall through to structural deduction:
 5765|       |               // if the alternatives are distinguishable by their fields this still succeeds,
 5766|       |               // otherwise the deduction path reports no_matching_variant_type.
 5767|       |            }
 5768|       |         }
 5769|       |
 5770|   874k|         if constexpr (yaml_variant_is_auto_deducible<std::remove_cvref_t<T>>()) {
 5771|   874k|            using V = std::remove_cvref_t<T>;
 5772|   874k|            using counts = yaml_variant_type_count<V>;
 5773|   874k|            const char c = *it;
 5774|   874k|            auto is_plain_scalar_boundary = [](const char ch) {
 5775|   874k|               switch (ch) {
 5776|   874k|               case ' ':
 5777|   874k|               case '\t':
 5778|   874k|               case '\n':
 5779|   874k|               case '\r':
 5780|   874k|               case ',':
 5781|   874k|               case ']':
 5782|   874k|               case '}':
 5783|   874k|                  return true;
 5784|   874k|               default:
 5785|   874k|                  return false;
 5786|   874k|               }
 5787|   874k|            };
 5788|       |
 5789|   874k|            auto has_indented_block_continuation = [&](auto word_end) {
 5790|   874k|               if constexpr (yaml::check_flow_context(Opts)) {
 5791|   874k|                  return false;
 5792|   874k|               }
 5793|   874k|               if (ctx.current_indent() < 0) {
 5794|   874k|                  return false;
 5795|   874k|               }
 5796|   874k|               if (word_end == end || (*word_end != '\n' && *word_end != '\r')) {
 5797|   874k|                  return false;
 5798|   874k|               }
 5799|       |
 5800|   874k|               auto look = word_end;
 5801|   874k|               yaml::skip_newline(look, end);
 5802|   874k|               while (look != end) {
 5803|   874k|                  int32_t line_indent = 0;
 5804|   874k|                  while (look != end && *look == ' ') {
 5805|   874k|                     ++line_indent;
 5806|   874k|                     ++look;
 5807|   874k|                  }
 5808|   874k|                  if (look != end && *look == '\t') {
 5809|   874k|                     return false;
 5810|   874k|                  }
 5811|   874k|                  if (look == end || *look == '\n' || *look == '\r') {
 5812|   874k|                     if (look != end) {
 5813|   874k|                        yaml::skip_newline(look, end);
 5814|   874k|                        continue;
 5815|   874k|                     }
 5816|   874k|                     return false;
 5817|   874k|                  }
 5818|   874k|                  if (*look == '#') {
 5819|   874k|                     yaml::skip_comment(look, end);
 5820|   874k|                     if (look != end && (*look == '\n' || *look == '\r')) {
 5821|   874k|                        yaml::skip_newline(look, end);
 5822|   874k|                        continue;
 5823|   874k|                     }
 5824|   874k|                     return false;
 5825|   874k|                  }
 5826|       |
 5827|       |                  // If the next non-empty line is an implicit mapping entry,
 5828|       |                  // don't treat it as scalar continuation for auto-deduced
 5829|       |                  // booleans/nulls.
 5830|   874k|                  {
 5831|   874k|                     auto scan = look;
 5832|   874k|                     while (scan != end && *scan != '\n' && *scan != '\r') {
 5833|   874k|                        if (*scan == ':') {
 5834|   874k|                           auto after_colon = scan + 1;
 5835|   874k|                           if (after_colon == end || *after_colon == ' ' || *after_colon == '\t' ||
 5836|   874k|                               *after_colon == '\n' || *after_colon == '\r') {
 5837|   874k|                              return false;
 5838|   874k|                           }
 5839|   874k|                        }
 5840|   874k|                        ++scan;
 5841|   874k|                     }
 5842|   874k|                  }
 5843|       |
 5844|   874k|                  return line_indent > ctx.current_indent();
 5845|   874k|               }
 5846|   874k|               return false;
 5847|   874k|            };
 5848|   874k|            auto is_word_boundary = [&](const auto ptr) {
 5849|   874k|               if (ptr == end) {
 5850|   874k|                  return true;
 5851|   874k|               }
 5852|   874k|               if (*ptr == ':') {
 5853|   874k|                  auto next = ptr + 1;
 5854|   874k|                  return (next == end) || *next == ' ' || *next == '\t' || *next == '\n' || *next == '\r';
 5855|   874k|               }
 5856|   874k|               return is_plain_scalar_boundary(*ptr);
 5857|   874k|            };
 5858|       |
 5859|   874k|            switch (c) {
 5860|   159k|            case '&': {
  ------------------
  |  Branch (5860:13): [True: 159k, False: 714k]
  ------------------
 5861|       |               // Anchor before value: parse name, then re-dispatch
 5862|   159k|               ++it;
 5863|   159k|               auto aname = yaml::parse_anchor_name(it, end);
 5864|   159k|               if (aname.empty()) {
  ------------------
  |  Branch (5864:20): [True: 97, False: 159k]
  ------------------
 5865|     97|                  ctx.error = error_code::syntax_error;
 5866|     97|                  return;
 5867|     97|               }
 5868|   159k|               yaml::skip_inline_ws(it, end);
 5869|   159k|               bool anchor_on_same_line = true;
 5870|   159k|               bool value_is_indentless_sequence = false;
 5871|   159k|               if (it == end || *it == '\n' || *it == '\r' || *it == '#') {
  ------------------
  |  Branch (5871:20): [True: 2.95k, False: 156k]
  |  Branch (5871:33): [True: 16.2k, False: 140k]
  |  Branch (5871:48): [True: 14.8k, False: 125k]
  |  Branch (5871:63): [True: 5.05k, False: 120k]
  ------------------
 5872|       |                  // Anchor followed by end-of-line. Check if the value continues on the
 5873|       |                  // next line (indented past current context) or if this is an empty node.
 5874|  39.1k|                  bool value_on_next_line = false;
 5875|  39.1k|                  if (it != end) {
  ------------------
  |  Branch (5875:23): [True: 36.1k, False: 2.95k]
  ------------------
 5876|  36.1k|                     auto peek = it;
 5877|       |                     // Skip comment if present
 5878|  36.1k|                     if (*peek == '#') {
  ------------------
  |  Branch (5878:26): [True: 5.05k, False: 31.1k]
  ------------------
 5879|  1.59M|                        while (peek != end && *peek != '\n' && *peek != '\r') ++peek;
  ------------------
  |  Branch (5879:32): [True: 1.59M, False: 409]
  |  Branch (5879:47): [True: 1.59M, False: 2.11k]
  |  Branch (5879:64): [True: 1.58M, False: 2.53k]
  ------------------
 5880|  5.05k|                     }
 5881|       |                     // Skip newline
 5882|  36.1k|                     if (peek != end && (*peek == '\n' || *peek == '\r')) {
  ------------------
  |  Branch (5882:26): [True: 35.7k, False: 409]
  |  Branch (5882:42): [True: 18.3k, False: 17.4k]
  |  Branch (5882:59): [True: 17.4k, False: 0]
  ------------------
 5883|  35.7k|                        yaml::skip_newline(peek, end);
 5884|       |                        // Skip blank lines
 5885|  62.0k|                        while (peek != end && (*peek == '\n' || *peek == '\r')) {
  ------------------
  |  Branch (5885:32): [True: 56.9k, False: 5.15k]
  |  Branch (5885:48): [True: 1.68k, False: 55.2k]
  |  Branch (5885:65): [True: 24.6k, False: 30.6k]
  ------------------
 5886|  26.3k|                           yaml::skip_newline(peek, end);
 5887|  26.3k|                        }
 5888|       |                        // Measure indent of next content line
 5889|  35.7k|                        int32_t next_indent = 0;
 5890|  58.8k|                        while (peek != end && *peek == ' ') {
  ------------------
  |  Branch (5890:32): [True: 53.4k, False: 5.40k]
  |  Branch (5890:47): [True: 23.1k, False: 30.3k]
  ------------------
 5891|  23.1k|                           ++next_indent;
 5892|  23.1k|                           ++peek;
 5893|  23.1k|                        }
 5894|  35.7k|                        if (peek != end && *peek != '\n' && *peek != '\r') {
  ------------------
  |  Branch (5894:29): [True: 30.3k, False: 5.40k]
  |  Branch (5894:44): [True: 30.0k, False: 296]
  |  Branch (5894:61): [True: 29.6k, False: 451]
  ------------------
 5895|  29.6k|                           const bool indentless_sequence =
 5896|  29.6k|                              (!ctx.sequence_item_value_context) && (*peek == '-') &&
  ------------------
  |  Branch (5896:31): [True: 26.4k, False: 3.17k]
  |  Branch (5896:69): [True: 14.9k, False: 11.5k]
  ------------------
 5897|  14.9k|                              ((peek + 1) == end ||
  ------------------
  |  Branch (5897:32): [True: 516, False: 14.4k]
  ------------------
 5898|  14.4k|                               yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*(peek + 1))]) &&
  ------------------
  |  Branch (5898:32): [True: 14.1k, False: 318]
  ------------------
 5899|  14.6k|                              (next_indent == ctx.current_indent() ||
  ------------------
  |  Branch (5899:32): [True: 12.0k, False: 2.55k]
  ------------------
 5900|  2.55k|                               (ctx.current_indent() > 0 && (next_indent + 1) == ctx.current_indent()));
  ------------------
  |  Branch (5900:33): [True: 1.25k, False: 1.29k]
  |  Branch (5900:61): [True: 980, False: 277]
  ------------------
 5901|  29.6k|                           value_is_indentless_sequence = indentless_sequence;
 5902|  29.6k|                           const bool same_indent_property_node =
 5903|  29.6k|                              (next_indent == ctx.current_indent()) &&
  ------------------
  |  Branch (5903:31): [True: 17.3k, False: 12.2k]
  ------------------
 5904|  17.3k|                              (*peek == '!' || *peek == '&' || *peek == '*' || *peek == '[' || *peek == '{' ||
  ------------------
  |  Branch (5904:32): [True: 311, False: 17.0k]
  |  Branch (5904:48): [True: 3.21k, False: 13.8k]
  |  Branch (5904:64): [True: 156, False: 13.6k]
  |  Branch (5904:80): [True: 288, False: 13.3k]
  |  Branch (5904:96): [True: 47, False: 13.3k]
  ------------------
 5905|  13.3k|                               *peek == '"' || *peek == '\'' || *peek == '|' || *peek == '>');
  ------------------
  |  Branch (5905:32): [True: 76, False: 13.2k]
  |  Branch (5905:48): [True: 100, False: 13.1k]
  |  Branch (5905:65): [True: 553, False: 12.6k]
  |  Branch (5905:81): [True: 40, False: 12.5k]
  ------------------
 5906|  29.6k|                           value_on_next_line =
 5907|  29.6k|                              (next_indent > ctx.current_indent()) || indentless_sequence || same_indent_property_node;
  ------------------
  |  Branch (5907:31): [True: 7.67k, False: 21.9k]
  |  Branch (5907:71): [True: 13.0k, False: 8.89k]
  |  Branch (5907:94): [True: 4.78k, False: 4.11k]
  ------------------
 5908|  29.6k|                        }
 5909|  35.7k|                     }
 5910|  36.1k|                  }
 5911|  39.1k|                  if (!value_on_next_line) {
  ------------------
  |  Branch (5911:23): [True: 13.6k, False: 25.5k]
  ------------------
 5912|       |                     // Anchor on empty/null node — store empty span, leave value as default
 5913|  13.6k|                     ctx.anchors[std::string(aname)] = {&*it, &*it, ctx.current_indent()};
 5914|  13.6k|                     return;
 5915|  13.6k|                  }
 5916|       |                  // Value is on next line — advance past newline/blank lines to the content
 5917|  25.5k|                  if (*it == '#') {
  ------------------
  |  Branch (5917:23): [True: 1.85k, False: 23.6k]
  ------------------
 5918|  1.38M|                     while (it != end && *it != '\n' && *it != '\r') ++it;
  ------------------
  |  Branch (5918:29): [True: 1.38M, False: 0]
  |  Branch (5918:42): [True: 1.38M, False: 509]
  |  Branch (5918:57): [True: 1.38M, False: 1.34k]
  ------------------
 5919|  1.85k|                  }
 5920|  25.5k|                  if (it != end) yaml::skip_newline(it, end);
  ------------------
  |  Branch (5920:23): [True: 25.5k, False: 0]
  ------------------
 5921|  30.0k|                  while (it != end && (*it == '\n' || *it == '\r')) {
  ------------------
  |  Branch (5921:26): [True: 30.0k, False: 0]
  |  Branch (5921:40): [True: 1.12k, False: 28.9k]
  |  Branch (5921:55): [True: 3.44k, False: 25.5k]
  ------------------
 5922|  4.56k|                     yaml::skip_newline(it, end);
 5923|  4.56k|                  }
 5924|  25.5k|                  yaml::skip_inline_ws(it, end);
 5925|  25.5k|                  anchor_on_same_line = false;
 5926|  25.5k|               }
 5927|       |
 5928|   145k|               if constexpr (!yaml::check_flow_context(Opts)) {
 5929|   145k|                  if (anchor_on_same_line && *it == '-' &&
  ------------------
  |  Branch (5929:23): [True: 120k, False: 25.5k]
  |  Branch (5929:46): [True: 555, False: 119k]
  ------------------
 5930|    555|                      ((it + 1) == end || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*(it + 1))])) {
  ------------------
  |  Branch (5930:24): [True: 17, False: 538]
  |  Branch (5930:43): [True: 8, False: 530]
  ------------------
 5931|       |                     // "&anchor - item" is malformed in block context.
 5932|     25|                     ctx.error = error_code::syntax_error;
 5933|     25|                     return;
 5934|     25|                  }
 5935|   145k|               }
 5936|       |
 5937|       |               // Anchor on alias (&anchor *alias) is invalid per YAML spec.
 5938|       |               // But alias-as-key (&anchor *alias : value) is valid.
 5939|   145k|               if (it != end && *it == '*' && !yaml::alias_token_is_mapping_key(it, end)) {
  ------------------
  |  Branch (5939:20): [True: 145k, False: 36]
  |  Branch (5939:33): [True: 1.30k, False: 144k]
  |  Branch (5939:47): [True: 97, False: 1.21k]
  ------------------
 5940|     97|                  ctx.error = error_code::syntax_error;
 5941|     97|                  return;
 5942|     97|               }
 5943|       |
 5944|   145k|               if constexpr (!yaml::check_flow_context(Opts)) {
 5945|   145k|                  if (!anchor_on_same_line && it != end && *it == '&') {
  ------------------
  |  Branch (5945:23): [True: 25.4k, False: 120k]
  |  Branch (5945:47): [True: 25.4k, False: 11]
  |  Branch (5945:60): [True: 4.48k, False: 21.0k]
  ------------------
 5946|  4.48k|                     auto probe = it + 1;
 5947|  4.48k|                     auto nested_anchor_name = yaml::parse_anchor_name(probe, end);
 5948|  4.48k|                     if (nested_anchor_name.empty()) {
  ------------------
  |  Branch (5948:26): [True: 11, False: 4.47k]
  ------------------
 5949|     11|                        ctx.error = error_code::syntax_error;
 5950|     11|                        return;
 5951|     11|                     }
 5952|  4.47k|                     yaml::skip_inline_ws(probe, end);
 5953|       |                     // Allow nested anchor usage only when it clearly starts a
 5954|       |                     // nested mapping entry ("&k key: value"). Otherwise this is
 5955|       |                     // a second anchor on the same node (4JVG-style), which is invalid.
 5956|  4.47k|                     if (!yaml::line_could_be_block_mapping(probe, end)) {
  ------------------
  |  Branch (5956:26): [True: 43, False: 4.43k]
  ------------------
 5957|     43|                        ctx.error = error_code::syntax_error;
 5958|     43|                        return;
 5959|     43|                     }
 5960|  4.47k|                  }
 5961|   145k|               }
 5962|       |
 5963|   145k|               const char* anchor_start = &*it;
 5964|   145k|               const int32_t anchor_indent = ctx.current_indent();
 5965|       |
 5966|   145k|               if constexpr (!yaml::check_flow_context(Opts)) {
 5967|       |                  // Check if the anchor is on a block-mapping key (&name key: value).
 5968|       |                  // Only when the anchor and key are on the SAME line — if the value was on the
 5969|       |                  // next line, the anchor applies to the entire next-line content.
 5970|   145k|                  if (anchor_on_same_line && yaml::line_could_be_block_mapping(it, end)) {
  ------------------
  |  Branch (5970:23): [True: 120k, False: 25.5k]
  |  Branch (5970:46): [True: 48.6k, False: 71.6k]
  ------------------
 5971|  48.6k|                     auto key_start = it;
 5972|  48.6k|                     if (*key_start == '!') {
  ------------------
  |  Branch (5972:26): [True: 1.51k, False: 47.1k]
  ------------------
 5973|  1.51k|                        const auto key_tag = yaml::parse_yaml_tag(key_start, end, ctx);
 5974|  1.51k|                        if (key_tag == yaml::yaml_tag::unknown || !yaml::tag_valid_for_string(key_tag)) {
  ------------------
  |  Branch (5974:29): [True: 6, False: 1.50k]
  |  Branch (5974:67): [True: 8, False: 1.50k]
  ------------------
 5975|     14|                           ctx.error = error_code::syntax_error;
 5976|     14|                           return;
 5977|     14|                        }
 5978|  1.50k|                        yaml::skip_inline_ws(key_start, end);
 5979|  1.50k|                        if (key_start == end) {
  ------------------
  |  Branch (5979:29): [True: 1, False: 1.50k]
  ------------------
 5980|      1|                           ctx.error = error_code::unexpected_end;
 5981|      1|                           return;
 5982|      1|                        }
 5983|  1.50k|                        if (*key_start == '\n' || *key_start == '\r') {
  ------------------
  |  Branch (5983:29): [True: 1, False: 1.49k]
  |  Branch (5983:51): [True: 1, False: 1.49k]
  ------------------
 5984|      2|                           ctx.error = error_code::syntax_error;
 5985|      2|                           return;
 5986|      2|                        }
 5987|       |
 5988|       |                        // Re-apply the anchor-on-alias rule now that the tag is consumed. The
 5989|       |                        // check above ran before the tag, so "&anchor !tag *alias" reached the
 5990|       |                        // key-span registration below while the untagged spelling was rejected;
 5991|       |                        // an alias node carries no other properties either way.
 5992|  1.49k|                        if (*key_start == '*' && !yaml::alias_token_is_mapping_key(key_start, end)) {
  ------------------
  |  Branch (5992:29): [True: 614, False: 884]
  |  Branch (5992:50): [True: 6, False: 608]
  ------------------
 5993|      6|                           ctx.error = error_code::syntax_error;
 5994|      6|                           return;
 5995|      6|                        }
 5996|  1.49k|                     }
 5997|       |
 5998|       |                     // Find the key span by scanning to the key-value separator
 5999|  48.6k|                     auto key_scan = key_start;
 6000|  48.6k|                     auto key_end = key_start;
 6001|  48.6k|                     if (*key_scan == '"' || *key_scan == '\'') {
  ------------------
  |  Branch (6001:26): [True: 367, False: 48.2k]
  |  Branch (6001:46): [True: 360, False: 47.9k]
  ------------------
 6002|       |                        // Quoted key: skip to closing quote
 6003|    727|                        const char quote = *key_scan;
 6004|    727|                        ++key_scan;
 6005|  4.52k|                        while (key_scan != end && *key_scan != quote) {
  ------------------
  |  Branch (6005:32): [True: 4.52k, False: 1]
  |  Branch (6005:51): [True: 3.80k, False: 726]
  ------------------
 6006|  3.80k|                           if (*key_scan == '\\' && quote == '"') {
  ------------------
  |  Branch (6006:32): [True: 724, False: 3.07k]
  |  Branch (6006:53): [True: 337, False: 387]
  ------------------
 6007|    337|                              ++key_scan;
 6008|    337|                              if (key_scan != end) ++key_scan;
  ------------------
  |  Branch (6008:35): [True: 337, False: 0]
  ------------------
 6009|    337|                           }
 6010|  3.46k|                           else {
 6011|  3.46k|                              ++key_scan;
 6012|  3.46k|                           }
 6013|  3.80k|                        }
 6014|    727|                        if (key_scan == end) {
  ------------------
  |  Branch (6014:29): [True: 1, False: 726]
  ------------------
 6015|      1|                           ctx.error = error_code::syntax_error;
 6016|      1|                           return;
 6017|      1|                        }
 6018|    726|                        ++key_scan; // past closing quote
 6019|    726|                        key_end = key_scan;
 6020|    726|                        yaml::skip_inline_ws(key_scan, end);
 6021|    726|                     }
 6022|  47.9k|                     else {
 6023|       |                        // Plain key: scan to ':'
 6024|  1.75M|                        while (key_scan != end) {
  ------------------
  |  Branch (6024:32): [True: 1.75M, False: 1]
  ------------------
 6025|  1.75M|                           if (*key_scan == ':') {
  ------------------
  |  Branch (6025:32): [True: 94.4k, False: 1.66M]
  ------------------
 6026|  94.4k|                              auto next = key_scan + 1;
 6027|  94.4k|                              if (next == end || *next == ' ' || *next == '\t' || *next == '\n' || *next == '\r') {
  ------------------
  |  Branch (6027:35): [True: 1.36k, False: 93.0k]
  |  Branch (6027:50): [True: 36.0k, False: 57.0k]
  |  Branch (6027:66): [True: 1.91k, False: 55.1k]
  |  Branch (6027:83): [True: 2.31k, False: 52.8k]
  |  Branch (6027:100): [True: 6.28k, False: 46.5k]
  ------------------
 6028|  47.9k|                                 break;
 6029|  47.9k|                              }
 6030|  94.4k|                           }
 6031|  1.70M|                           ++key_scan;
 6032|  1.70M|                        }
 6033|  47.9k|                        key_end = key_scan;
 6034|  59.0k|                        while (key_end != key_start && (*(key_end - 1) == ' ' || *(key_end - 1) == '\t')) {
  ------------------
  |  Branch (6034:32): [True: 55.7k, False: 3.24k]
  |  Branch (6034:57): [True: 10.5k, False: 45.1k]
  |  Branch (6034:82): [True: 522, False: 44.6k]
  ------------------
 6035|  11.0k|                           --key_end;
 6036|  11.0k|                        }
 6037|  47.9k|                     }
 6038|  48.6k|                     if (key_scan == end || *key_scan != ':') {
  ------------------
  |  Branch (6038:26): [True: 3, False: 48.6k]
  |  Branch (6038:45): [True: 58, False: 48.5k]
  ------------------
 6039|     61|                        ctx.error = error_code::syntax_error;
 6040|     61|                        return;
 6041|     61|                     }
 6042|       |                     // Store anchor with just the key text span
 6043|  48.5k|                     ctx.anchors[std::string(aname)] = {&*key_start, &*key_end, anchor_indent};
 6044|  48.5k|                     it = key_start;
 6045|       |                     // Parse as an object alternative so complex keys (e.g. flow collections) stay in mapping context.
 6046|  48.5k|                     if constexpr (counts::n_object > 0) {
 6047|  48.5k|                        process_yaml_variant_alternatives<V, is_yaml_variant_object>::template op<Opts>(value, ctx, it,
 6048|  48.5k|                                                                                                        end);
 6049|       |                     }
 6050|       |                     else {
 6051|       |                        from<YAML, V>::template op<Opts>(value, ctx, it, end);
 6052|       |                     }
 6053|  48.5k|                     return;
 6054|  48.6k|                  }
 6055|   145k|               }
 6056|       |
 6057|  97.1k|               const bool prev_allow_indentless_sequence = ctx.allow_indentless_sequence;
 6058|   145k|               ctx.allow_indentless_sequence = value_is_indentless_sequence;
 6059|   145k|               from<YAML, V>::template op<Opts>(value, ctx, it, end);
 6060|   145k|               ctx.allow_indentless_sequence = prev_allow_indentless_sequence;
 6061|   145k|               if (!bool(ctx.error)) {
  ------------------
  |  Branch (6061:20): [True: 94.4k, False: 51.3k]
  ------------------
 6062|  94.4k|                  ctx.anchors[std::string(aname)] = {anchor_start, &*it, anchor_indent};
 6063|  94.4k|               }
 6064|   145k|               return;
 6065|   145k|            }
 6066|  75.9k|            case '*': {
  ------------------
  |  Branch (6066:13): [True: 75.9k, False: 798k]
  ------------------
 6067|       |               // In block context, "*alias : value" starts a mapping with an alias key.
 6068|  75.9k|               if constexpr (!yaml::check_flow_context(Opts)) {
 6069|  75.9k|                  if (yaml::alias_token_is_mapping_key(it, end)) {
  ------------------
  |  Branch (6069:23): [True: 4.45k, False: 71.4k]
  ------------------
 6070|  4.45k|                     if constexpr (counts::n_object > 0) {
 6071|  4.45k|                        process_yaml_variant_alternatives<V, is_yaml_variant_object>::template op<Opts>(value, ctx, it,
 6072|  4.45k|                                                                                                        end);
 6073|  4.45k|                        return;
 6074|       |                     }
 6075|       |                     else {
 6076|       |                        ctx.error = error_code::syntax_error;
 6077|       |                        return;
 6078|       |                     }
 6079|  4.45k|                  }
 6080|  75.9k|               }
 6081|       |
 6082|       |               // Alias value: look up anchor and replay
 6083|      0|               yaml::handle_alias<Opts>(value, ctx, it, end);
 6084|  75.9k|               return;
 6085|   145k|            }
 6086|  71.2k|            case '!': {
  ------------------
  |  Branch (6086:13): [True: 71.2k, False: 803k]
  ------------------
 6087|       |               // Tag - parse it and dispatch based on tag type
 6088|  71.2k|               const auto tag = yaml::parse_yaml_tag(it, end, ctx);
 6089|  71.2k|               if (tag == yaml::yaml_tag::unknown) {
  ------------------
  |  Branch (6089:20): [True: 62, False: 71.1k]
  ------------------
 6090|     62|                  ctx.error = error_code::syntax_error;
 6091|     62|                  return;
 6092|     62|               }
 6093|  71.1k|               yaml::skip_inline_ws(it, end);
 6094|  71.1k|               if (it != end && *it == '#') {
  ------------------
  |  Branch (6094:20): [True: 70.4k, False: 743]
  |  Branch (6094:33): [True: 3.60k, False: 66.8k]
  ------------------
 6095|  3.60k|                  yaml::skip_comment(it, end);
 6096|  3.60k|               }
 6097|  71.1k|               if (it != end && (*it == '\n' || *it == '\r')) {
  ------------------
  |  Branch (6097:20): [True: 70.1k, False: 1.03k]
  |  Branch (6097:34): [True: 4.52k, False: 65.6k]
  |  Branch (6097:49): [True: 6.95k, False: 58.6k]
  ------------------
 6098|  11.4k|                  auto content = it;
 6099|  11.4k|                  yaml::skip_newline(content, end);
 6100|  11.4k|                  yaml::skip_to_content(content, end);
 6101|       |
 6102|  11.4k|                  bool consume_following_content = false;
 6103|  11.4k|                  auto content_token = content;
 6104|  11.4k|                  if (content != end) {
  ------------------
  |  Branch (6104:23): [True: 10.4k, False: 991]
  ------------------
 6105|  10.4k|                     auto indent_probe = content;
 6106|  10.4k|                     const int32_t content_indent = yaml::measure_indent<false>(indent_probe, end, ctx);
 6107|  10.4k|                     if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (6107:26): [True: 1, False: 10.4k]
  ------------------
 6108|      1|                        return;
 6109|  10.4k|                     content_token = indent_probe;
 6110|       |
 6111|       |                     // A tag at the end of a sequence/map entry has an empty value
 6112|       |                     // unless the next non-empty content is nested under the current node.
 6113|  10.4k|                     bool tagged_indentless_sequence = false;
 6114|  10.4k|                     if (tag == yaml::yaml_tag::seq && indent_probe != end && *indent_probe == '-') {
  ------------------
  |  Branch (6114:26): [True: 2.55k, False: 7.92k]
  |  Branch (6114:56): [True: 2.55k, False: 0]
  |  Branch (6114:79): [True: 2.30k, False: 251]
  ------------------
 6115|  2.30k|                        const auto after_dash = indent_probe + 1;
 6116|  2.30k|                        if (after_dash == end ||
  ------------------
  |  Branch (6116:29): [True: 12, False: 2.29k]
  ------------------
 6117|  2.29k|                            yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*after_dash)]) {
  ------------------
  |  Branch (6117:29): [True: 2.00k, False: 294]
  ------------------
 6118|  2.01k|                           tagged_indentless_sequence =
 6119|  2.01k|                              (content_indent == ctx.current_indent()) ||
  ------------------
  |  Branch (6119:31): [True: 502, False: 1.51k]
  ------------------
 6120|  1.51k|                              (ctx.current_indent() > 0 && (content_indent + 1) == ctx.current_indent());
  ------------------
  |  Branch (6120:32): [True: 364, False: 1.14k]
  |  Branch (6120:60): [True: 343, False: 21]
  ------------------
 6121|  2.01k|                        }
 6122|  2.30k|                     }
 6123|       |
 6124|  10.4k|                     consume_following_content = (ctx.current_indent() < 0) ||
  ------------------
  |  Branch (6124:50): [True: 1.39k, False: 9.09k]
  ------------------
 6125|  9.09k|                                                 (content_indent > ctx.current_indent()) || tagged_indentless_sequence;
  ------------------
  |  Branch (6125:50): [True: 2.98k, False: 6.10k]
  |  Branch (6125:93): [True: 845, False: 5.25k]
  ------------------
 6126|  10.4k|                  }
 6127|       |
 6128|  11.4k|                  if (consume_following_content) {
  ------------------
  |  Branch (6128:23): [True: 5.23k, False: 6.24k]
  ------------------
 6129|  5.23k|                     it = content_token;
 6130|  5.23k|                  }
 6131|  6.24k|                  else {
 6132|  6.24k|                     if (tag == yaml::yaml_tag::str) {
  ------------------
  |  Branch (6132:26): [True: 93, False: 6.15k]
  ------------------
 6133|     93|                        if constexpr (counts::n_str > 0) {
 6134|     93|                           constexpr auto first_idx = yaml_variant_first_index_v<V, is_yaml_variant_str>;
 6135|     93|                           using StrType = std::variant_alternative_t<first_idx, V>;
 6136|     93|                           value = StrType{};
 6137|     93|                           return;
 6138|     93|                        }
 6139|     93|                     }
 6140|  6.24k|                     if (tag == yaml::yaml_tag::null_tag) {
  ------------------
  |  Branch (6140:26): [True: 205, False: 6.04k]
  ------------------
 6141|    205|                        if constexpr (counts::n_null > 0) {
 6142|    205|                           constexpr auto first_idx = yaml_variant_first_index_v<V, is_yaml_variant_null>;
 6143|    205|                           using NullType = std::variant_alternative_t<first_idx, V>;
 6144|    205|                           if (!std::holds_alternative<NullType>(value)) value = NullType{};
  ------------------
  |  Branch (6144:32): [True: 0, False: 205]
  ------------------
 6145|    205|                           return;
 6146|    205|                        }
 6147|    205|                     }
 6148|  6.24k|                     if (tag == yaml::yaml_tag::none) {
  ------------------
  |  Branch (6148:26): [True: 3.57k, False: 2.67k]
  ------------------
 6149|  3.57k|                        if constexpr (counts::n_null > 0) {
 6150|  3.57k|                           constexpr auto first_idx = yaml_variant_first_index_v<V, is_yaml_variant_null>;
 6151|  3.57k|                           using NullType = std::variant_alternative_t<first_idx, V>;
 6152|  3.57k|                           if (!std::holds_alternative<NullType>(value)) value = NullType{};
  ------------------
  |  Branch (6152:32): [True: 0, False: 3.57k]
  ------------------
 6153|  3.57k|                           return;
 6154|  3.57k|                        }
 6155|  3.57k|                     }
 6156|  6.24k|                  }
 6157|  11.4k|               }
 6158|  71.1k|               if constexpr (!yaml::check_flow_context(Opts)) {
 6159|       |                  // In block context, a comma immediately after a tag token is malformed
 6160|       |                  // (e.g., "!!str, value"). Flow context has legitimate ", ] }" usage.
 6161|  71.1k|                  if (it != end && *it == ',') {
  ------------------
  |  Branch (6161:23): [True: 66.2k, False: 4.90k]
  |  Branch (6161:36): [True: 9, False: 66.2k]
  ------------------
 6162|      9|                     ctx.error = error_code::syntax_error;
 6163|      9|                     return;
 6164|      9|                  }
 6165|  71.1k|                  if constexpr (counts::n_object > 0) {
 6166|       |                     // Tagged keys like "!!str key: value" must parse as mappings.
 6167|  71.1k|                     const bool starts_block_sequence_entry =
 6168|  71.1k|                        (it != end && *it == '-') &&
  ------------------
  |  Branch (6168:26): [True: 66.2k, False: 4.90k]
  |  Branch (6168:39): [True: 3.46k, False: 62.7k]
  ------------------
 6169|  3.46k|                        ((it + 1) == end || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*(it + 1))]);
  ------------------
  |  Branch (6169:26): [True: 337, False: 3.13k]
  |  Branch (6169:45): [True: 2.73k, False: 400]
  ------------------
 6170|  71.1k|                     if (!starts_block_sequence_entry && yaml::line_could_be_block_mapping(it, end)) {
  ------------------
  |  Branch (6170:26): [True: 64.2k, False: 6.94k]
  |  Branch (6170:58): [True: 8.16k, False: 56.0k]
  ------------------
 6171|       |                        // Re-dispatch from the post-tag token so '&key key: val' is
 6172|       |                        // handled by the anchor-aware key path, not as a map-level anchor.
 6173|  8.16k|                        from<YAML, V>::template op<Opts>(value, ctx, it, end);
 6174|  8.16k|                        return;
 6175|  8.16k|                     }
 6176|  71.1k|                  }
 6177|  71.1k|               }
 6178|  71.1k|               if (it == end) {
  ------------------
  |  Branch (6178:20): [True: 1.03k, False: 70.1k]
  ------------------
 6179|  1.03k|                  if (tag == yaml::yaml_tag::str) {
  ------------------
  |  Branch (6179:23): [True: 360, False: 672]
  ------------------
 6180|    360|                     if constexpr (counts::n_str > 0) {
 6181|    360|                        constexpr auto first_idx = yaml_variant_first_index_v<V, is_yaml_variant_str>;
 6182|    360|                        using StrType = std::variant_alternative_t<first_idx, V>;
 6183|    360|                        value = StrType{};
 6184|    360|                        return;
 6185|    360|                     }
 6186|    360|                  }
 6187|  1.03k|                  if (tag == yaml::yaml_tag::none) {
  ------------------
  |  Branch (6187:23): [True: 659, False: 373]
  ------------------
 6188|    659|                     if constexpr (counts::n_null > 0) {
 6189|    659|                        constexpr auto first_idx = yaml_variant_first_index_v<V, is_yaml_variant_null>;
 6190|    659|                        using NullType = std::variant_alternative_t<first_idx, V>;
 6191|    659|                        if (!std::holds_alternative<NullType>(value)) value = NullType{};
  ------------------
  |  Branch (6191:29): [True: 0, False: 659]
  ------------------
 6192|    659|                        return;
 6193|    659|                     }
 6194|    659|                  }
 6195|      0|                  ctx.error = error_code::unexpected_end;
 6196|  1.03k|                  return;
 6197|  1.03k|               }
 6198|  70.1k|               switch (tag) {
 6199|    318|               case yaml::yaml_tag::str:
  ------------------
  |  Branch (6199:16): [True: 318, False: 69.8k]
  ------------------
 6200|    318|                  process_yaml_variant_alternatives<V, is_yaml_variant_str>::template op<Opts>(value, ctx, it, end);
 6201|    318|                  return;
 6202|  3.35k|               case yaml::yaml_tag::int_tag:
  ------------------
  |  Branch (6202:16): [True: 3.35k, False: 66.7k]
  ------------------
 6203|  3.36k|               case yaml::yaml_tag::float_tag:
  ------------------
  |  Branch (6203:16): [True: 12, False: 70.1k]
  ------------------
 6204|  3.36k|                  if constexpr (counts::n_num > 0) {
 6205|  3.36k|                     process_yaml_variant_alternatives<V, is_yaml_variant_num>::template op<Opts>(value, ctx, it, end);
 6206|  3.36k|                     return;
 6207|       |                  }
 6208|       |                  else { // else used to fix MSVC unreachable code warning
 6209|       |                     ctx.error = error_code::syntax_error;
 6210|       |                     return;
 6211|       |                  }
 6212|  8.37k|               case yaml::yaml_tag::bool_tag:
  ------------------
  |  Branch (6212:16): [True: 5.00k, False: 65.1k]
  ------------------
 6213|  8.37k|                  if constexpr (counts::n_bool > 0) {
 6214|  8.37k|                     process_yaml_variant_alternatives<V, is_yaml_variant_bool>::template op<Opts>(value, ctx, it, end);
 6215|  8.37k|                     return;
 6216|       |                  }
 6217|       |                  else { // else used to fix MSVC unreachable code warning
 6218|       |                     ctx.error = error_code::syntax_error;
 6219|       |                     return;
 6220|       |                  }
 6221|  8.73k|               case yaml::yaml_tag::null_tag:
  ------------------
  |  Branch (6221:16): [True: 356, False: 69.7k]
  ------------------
 6222|  8.73k|                  if constexpr (counts::n_null > 0) {
 6223|  8.73k|                     constexpr auto first_idx = yaml_variant_first_index_v<V, is_yaml_variant_null>;
 6224|  8.73k|                     using NullType = std::variant_alternative_t<first_idx, V>;
 6225|  8.73k|                     if (!std::holds_alternative<NullType>(value)) value = NullType{};
  ------------------
  |  Branch (6225:26): [True: 0, False: 8.73k]
  ------------------
 6226|  8.73k|                     from<YAML, NullType>::template op<Opts>(std::get<NullType>(value), ctx, it, end);
 6227|  8.73k|                     return;
 6228|       |                  }
 6229|       |                  else { // else used to fix MSVC unreachable code warning
 6230|       |                     ctx.error = error_code::syntax_error;
 6231|       |                     return;
 6232|       |                  }
 6233|  13.3k|               case yaml::yaml_tag::map:
  ------------------
  |  Branch (6233:16): [True: 4.65k, False: 65.4k]
  ------------------
 6234|  13.3k|                  if constexpr (counts::n_object > 0) {
 6235|  13.3k|                     process_yaml_variant_alternatives<V, is_yaml_variant_object>::template op<Opts>(value, ctx, it,
 6236|  13.3k|                                                                                                     end);
 6237|  13.3k|                     return;
 6238|       |                  }
 6239|       |                  else { // else used to fix MSVC unreachable code warning
 6240|       |                     ctx.error = error_code::syntax_error;
 6241|       |                     return;
 6242|       |                  }
 6243|  19.9k|               case yaml::yaml_tag::seq:
  ------------------
  |  Branch (6243:16): [True: 6.57k, False: 63.5k]
  ------------------
 6244|  19.9k|                  if constexpr (counts::n_array > 0) {
 6245|  19.9k|                     const bool prev_allow_indentless_sequence = ctx.allow_indentless_sequence;
 6246|  19.9k|                     if constexpr (!yaml::check_flow_context(Opts)) {
 6247|  19.9k|                        if (it != end && *it == '-') {
  ------------------
  |  Branch (6247:29): [True: 6.57k, False: 13.3k]
  |  Branch (6247:42): [True: 2.20k, False: 4.36k]
  ------------------
 6248|  2.20k|                           ctx.allow_indentless_sequence = true;
 6249|  2.20k|                        }
 6250|  19.9k|                     }
 6251|  19.9k|                     process_yaml_variant_alternatives<V, is_yaml_variant_array>::template op<Opts>(value, ctx, it,
 6252|  19.9k|                                                                                                    end);
 6253|  19.9k|                     ctx.allow_indentless_sequence = prev_allow_indentless_sequence;
 6254|  19.9k|                     return;
 6255|       |                  }
 6256|       |                  else { // else used to fix MSVC unreachable code warning
 6257|       |                     ctx.error = error_code::syntax_error;
 6258|       |                     return;
 6259|       |                  }
 6260|  57.7k|               default: {
  ------------------
  |  Branch (6260:16): [True: 37.8k, False: 32.3k]
  ------------------
 6261|       |                  // Explicit unknown/non-core tags disable implicit scalar resolution.
 6262|       |                  // Preserve collection kinds, otherwise treat as string content.
 6263|  57.7k|                  if (it != end && *it == '*') {
  ------------------
  |  Branch (6263:23): [True: 37.8k, False: 19.9k]
  |  Branch (6263:36): [True: 26.6k, False: 11.1k]
  ------------------
 6264|  26.6k|                     yaml::handle_alias<Opts>(value, ctx, it, end);
 6265|  26.6k|                     return;
 6266|  26.6k|                  }
 6267|       |
 6268|  31.1k|                  if constexpr (counts::n_array > 0) {
 6269|  31.1k|                     if (it != end && *it == '[') {
  ------------------
  |  Branch (6269:26): [True: 11.1k, False: 19.9k]
  |  Branch (6269:39): [True: 332, False: 10.8k]
  ------------------
 6270|    332|                        process_yaml_variant_alternatives<V, is_yaml_variant_array>::template op<Opts>(value, ctx, it,
 6271|    332|                                                                                                       end);
 6272|    332|                        return;
 6273|    332|                     }
 6274|  31.1k|                  }
 6275|  31.1k|                  if constexpr (counts::n_object > 0) {
 6276|  31.1k|                     if (it != end && *it == '{') {
  ------------------
  |  Branch (6276:26): [True: 10.8k, False: 20.2k]
  |  Branch (6276:39): [True: 784, False: 10.0k]
  ------------------
 6277|    784|                        process_yaml_variant_alternatives<V, is_yaml_variant_object>::template op<Opts>(value, ctx, it,
 6278|    784|                                                                                                        end);
 6279|    784|                        return;
 6280|    784|                     }
 6281|  31.1k|                  }
 6282|       |
 6283|  31.1k|                  if constexpr (!yaml::check_flow_context(Opts)) {
 6284|  31.1k|                     if constexpr (counts::n_array > 0) {
 6285|  31.1k|                        const bool starts_block_sequence_entry =
 6286|  31.1k|                           (it != end && *it == '-') &&
  ------------------
  |  Branch (6286:29): [True: 10.0k, False: 21.0k]
  |  Branch (6286:42): [True: 720, False: 9.35k]
  ------------------
 6287|    720|                           ((it + 1) == end || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*(it + 1))]);
  ------------------
  |  Branch (6287:29): [True: 320, False: 400]
  |  Branch (6287:48): [True: 317, False: 83]
  ------------------
 6288|  31.1k|                        if (starts_block_sequence_entry) {
  ------------------
  |  Branch (6288:29): [True: 637, False: 30.5k]
  ------------------
 6289|    637|                           process_yaml_variant_alternatives<V, is_yaml_variant_array>::template op<Opts>(value, ctx,
 6290|    637|                                                                                                          it, end);
 6291|    637|                           return;
 6292|    637|                        }
 6293|  31.1k|                     }
 6294|  31.1k|                     if constexpr (counts::n_object > 0) {
 6295|  31.1k|                        const bool starts_explicit_mapping_indicator =
 6296|  31.1k|                           (it != end && (*it == '?' || *it == ':')) &&
  ------------------
  |  Branch (6296:29): [True: 9.43k, False: 21.7k]
  |  Branch (6296:43): [True: 1.13k, False: 8.30k]
  |  Branch (6296:57): [True: 327, False: 7.97k]
  ------------------
 6297|  1.45k|                           ((it + 1) == end || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*(it + 1))]);
  ------------------
  |  Branch (6297:29): [True: 278, False: 1.18k]
  |  Branch (6297:48): [True: 799, False: 382]
  ------------------
 6298|  31.1k|                        if (starts_explicit_mapping_indicator) {
  ------------------
  |  Branch (6298:29): [True: 1.07k, False: 30.0k]
  ------------------
 6299|  1.07k|                           process_yaml_variant_alternatives<V, is_yaml_variant_object>::template op<Opts>(value, ctx,
 6300|  1.07k|                                                                                                           it, end);
 6301|  1.07k|                           return;
 6302|  1.07k|                        }
 6303|  30.0k|                        if (yaml::line_could_be_block_mapping(it, end)) {
  ------------------
  |  Branch (6303:29): [True: 0, False: 30.0k]
  ------------------
 6304|      0|                           process_yaml_variant_alternatives<V, is_yaml_variant_object>::template op<Opts>(value, ctx,
 6305|      0|                                                                                                           it, end);
 6306|      0|                           return;
 6307|      0|                        }
 6308|  30.0k|                     }
 6309|  31.1k|                  }
 6310|       |
 6311|  31.1k|                  if constexpr (counts::n_str > 0) {
 6312|  31.1k|                     process_yaml_variant_alternatives<V, is_yaml_variant_str>::template op<Opts>(value, ctx, it, end);
 6313|  31.1k|                     return;
 6314|  31.1k|                  }
 6315|       |
 6316|       |                  // Fall back if no string alternative exists.
 6317|      0|                  from<YAML, V>::template op<Opts>(value, ctx, it, end);
 6318|  31.1k|                  return;
 6319|  57.7k|               }
 6320|  70.1k|               }
 6321|      0|               return;
 6322|  70.1k|            }
 6323|  28.3k|            case '{':
  ------------------
  |  Branch (6323:13): [True: 28.3k, False: 845k]
  ------------------
 6324|  28.3k|               if constexpr (!yaml::check_flow_context(Opts)) {
 6325|       |                  // In block context, "{...}: value" can be a complex mapping key.
 6326|  28.3k|                  if (ctx.current_indent() < 0 && yaml::line_could_be_block_mapping(it, end)) {
  ------------------
  |  Branch (6326:23): [True: 7.95k, False: 20.4k]
  |  Branch (6326:51): [True: 1.37k, False: 6.57k]
  ------------------
 6327|  1.37k|                     process_yaml_variant_alternatives<V, is_yaml_variant_object>::template op<Opts>(value, ctx, it,
 6328|  1.37k|                                                                                                     end);
 6329|  1.37k|                     return;
 6330|  1.37k|                  }
 6331|  28.3k|               }
 6332|       |               // Flow mapping - object type
 6333|  27.0k|               process_yaml_variant_alternatives<V, is_yaml_variant_object>::template op<Opts>(value, ctx, it, end);
 6334|  28.3k|               return;
 6335|  31.6k|            case '[':
  ------------------
  |  Branch (6335:13): [True: 31.6k, False: 842k]
  ------------------
 6336|  31.6k|               if constexpr (!yaml::check_flow_context(Opts)) {
 6337|       |                  // In block context, "[...]: value" can be a complex mapping key.
 6338|  31.6k|                  if (ctx.current_indent() < 0 && yaml::line_could_be_block_mapping(it, end)) {
  ------------------
  |  Branch (6338:23): [True: 19.4k, False: 12.1k]
  |  Branch (6338:51): [True: 285, False: 19.1k]
  ------------------
 6339|    285|                     process_yaml_variant_alternatives<V, is_yaml_variant_object>::template op<Opts>(value, ctx, it,
 6340|    285|                                                                                                     end);
 6341|    285|                     return;
 6342|    285|                  }
 6343|  31.6k|               }
 6344|       |               // Flow sequence - array type
 6345|  31.3k|               process_yaml_variant_alternatives<V, is_yaml_variant_array>::template op<Opts>(value, ctx, it, end);
 6346|  31.6k|               return;
 6347|   136k|            case '?':
  ------------------
  |  Branch (6347:13): [True: 136k, False: 738k]
  ------------------
 6348|       |               // Explicit mapping key indicator ("? key")
 6349|   136k|               if ((end - it >= 2) && it[1] == '\t') {
  ------------------
  |  Branch (6349:20): [True: 135k, False: 518]
  |  Branch (6349:39): [True: 5, False: 135k]
  ------------------
 6350|      5|                  ctx.error = error_code::syntax_error;
 6351|      5|                  return;
 6352|      5|               }
 6353|   136k|               if ((end - it >= 2) && (it[1] == ' ' || it[1] == '\n' || it[1] == '\r')) {
  ------------------
  |  Branch (6353:20): [True: 135k, False: 518]
  |  Branch (6353:40): [True: 48.3k, False: 87.2k]
  |  Branch (6353:56): [True: 79.6k, False: 7.57k]
  |  Branch (6353:73): [True: 2.29k, False: 5.28k]
  ------------------
 6354|   130k|                  if constexpr (counts::n_object > 0) {
 6355|   130k|                     process_yaml_variant_alternatives<V, is_yaml_variant_object>::template op<Opts>(value, ctx, it,
 6356|   130k|                                                                                                     end);
 6357|   130k|                     return;
 6358|   130k|                  }
 6359|   130k|               }
 6360|      0|               parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6361|   136k|               return;
 6362|     12|            case '%':
  ------------------
  |  Branch (6362:13): [True: 12, False: 874k]
  ------------------
 6363|       |               // Reserved directive indicator is not a plain scalar start.
 6364|     12|               ctx.error = error_code::syntax_error;
 6365|     12|               return;
 6366|    926|            case '"':
  ------------------
  |  Branch (6366:13): [True: 926, False: 873k]
  ------------------
 6367|  2.16k|            case '\'':
  ------------------
  |  Branch (6367:13): [True: 1.23k, False: 873k]
  ------------------
 6368|       |               // Could be a quoted string OR a quoted key in a block mapping
 6369|       |               // Try block mapping first (e.g., "key": value), then fall back to string
 6370|  2.16k|               parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6371|  2.16k|               return;
 6372|  7.74k|            case 't':
  ------------------
  |  Branch (6372:13): [True: 7.74k, False: 866k]
  ------------------
 6373|  29.9k|            case 'T':
  ------------------
  |  Branch (6373:13): [True: 22.1k, False: 852k]
  ------------------
 6374|       |               // Could be "true", "True", "TRUE", or a key/string starting with t/T
 6375|  29.9k|               if constexpr (counts::n_bool > 0) {
 6376|  29.9k|                  if ((end - it >= 4) && ((it[1] == 'r' && it[2] == 'u' && it[3] == 'e') ||
  ------------------
  |  Branch (6376:23): [True: 29.6k, False: 288]
  |  Branch (6376:44): [True: 25.4k, False: 4.15k]
  |  Branch (6376:60): [True: 24.3k, False: 1.14k]
  |  Branch (6376:76): [True: 23.8k, False: 446]
  ------------------
 6377|  24.2k|                                          (it[1] == 'R' && it[2] == 'U' && it[3] == 'E'))) {
  ------------------
  |  Branch (6377:44): [True: 2.18k, False: 3.56k]
  |  Branch (6377:60): [True: 1.23k, False: 946]
  |  Branch (6377:76): [True: 334, False: 903]
  ------------------
 6378|       |                     // Check what follows the word "true"
 6379|  24.2k|                     const auto after_true = it + 4;
 6380|  24.2k|                     const bool at_word_boundary = is_word_boundary(after_true);
 6381|       |
 6382|  24.2k|                     if (at_word_boundary) {
  ------------------
  |  Branch (6382:26): [True: 23.5k, False: 638]
  ------------------
 6383|  23.5k|                        if (has_indented_block_continuation(after_true)) {
  ------------------
  |  Branch (6383:29): [True: 400, False: 23.1k]
  ------------------
 6384|    400|                           parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6385|    400|                           return;
 6386|    400|                        }
 6387|       |                        // Check if this is a key (followed by ": ") rather than a boolean value
 6388|       |                        // "true: value" should parse as {true: value}, not as the boolean true
 6389|  23.1k|                        if ((end - it > 4) && it[4] == ':' &&
  ------------------
  |  Branch (6389:29): [True: 22.8k, False: 350]
  |  Branch (6389:47): [True: 19.0k, False: 3.79k]
  ------------------
 6390|  19.0k|                            (end - it == 5 || it[5] == ' ' || it[5] == '\t' || it[5] == '\n' || it[5] == '\r')) {
  ------------------
  |  Branch (6390:30): [True: 435, False: 18.5k]
  |  Branch (6390:47): [True: 17.9k, False: 628]
  |  Branch (6390:63): [True: 291, False: 337]
  |  Branch (6390:80): [True: 266, False: 71]
  |  Branch (6390:97): [True: 71, False: 0]
  ------------------
 6391|       |                           // This is "true:" followed by space/tab/newline/end - treat as key
 6392|  19.0k|                           parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6393|  19.0k|                           return;
 6394|  19.0k|                        }
 6395|  4.14k|                        process_yaml_variant_alternatives<V, is_yaml_variant_bool>::template op<Opts>(value, ctx, it,
 6396|  4.14k|                                                                                                      end);
 6397|  4.14k|                        return;
 6398|  23.1k|                     }
 6399|       |                     // "true" is followed by more characters (e.g., "True\b") - treat as string
 6400|  24.2k|                  }
 6401|  29.9k|               }
 6402|  6.33k|               parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6403|  29.9k|               return;
 6404|  8.27k|            case 'f':
  ------------------
  |  Branch (6404:13): [True: 8.27k, False: 865k]
  ------------------
 6405|  13.0k|            case 'F':
  ------------------
  |  Branch (6405:13): [True: 4.74k, False: 869k]
  ------------------
 6406|       |               // Could be "false", "False", "FALSE", or a key/string starting with f/F
 6407|  13.0k|               if constexpr (counts::n_bool > 0) {
 6408|  13.0k|                  if ((end - it >= 5) && ((it[1] == 'a' && it[2] == 'l' && it[3] == 's' && it[4] == 'e') ||
  ------------------
  |  Branch (6408:23): [True: 12.4k, False: 570]
  |  Branch (6408:44): [True: 6.42k, False: 6.02k]
  |  Branch (6408:60): [True: 3.98k, False: 2.43k]
  |  Branch (6408:76): [True: 3.51k, False: 472]
  |  Branch (6408:92): [True: 3.19k, False: 324]
  ------------------
 6409|  9.26k|                                          (it[1] == 'A' && it[2] == 'L' && it[3] == 'S' && it[4] == 'E'))) {
  ------------------
  |  Branch (6409:44): [True: 2.33k, False: 6.92k]
  |  Branch (6409:60): [True: 1.89k, False: 437]
  |  Branch (6409:76): [True: 1.52k, False: 370]
  |  Branch (6409:92): [True: 1.38k, False: 141]
  ------------------
 6410|       |                     // Check what follows the word "false"
 6411|  4.57k|                     const auto after_false = it + 5;
 6412|  4.57k|                     const bool at_word_boundary = is_word_boundary(after_false);
 6413|       |
 6414|  4.57k|                     if (at_word_boundary) {
  ------------------
  |  Branch (6414:26): [True: 3.93k, False: 644]
  ------------------
 6415|  3.93k|                        if (has_indented_block_continuation(after_false)) {
  ------------------
  |  Branch (6415:29): [True: 344, False: 3.58k]
  ------------------
 6416|    344|                           parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6417|    344|                           return;
 6418|    344|                        }
 6419|       |                        // Check if this is a key (followed by ": ") rather than a boolean value
 6420|       |                        // "false: value" should parse as {false: value}, not as the boolean false
 6421|  3.58k|                        if ((end - it > 5) && it[5] == ':' &&
  ------------------
  |  Branch (6421:29): [True: 3.31k, False: 274]
  |  Branch (6421:47): [True: 1.91k, False: 1.39k]
  ------------------
 6422|  1.91k|                            (end - it == 6 || it[6] == ' ' || it[6] == '\t' || it[6] == '\n' || it[6] == '\r')) {
  ------------------
  |  Branch (6422:30): [True: 309, False: 1.60k]
  |  Branch (6422:47): [True: 253, False: 1.35k]
  |  Branch (6422:63): [True: 892, False: 462]
  |  Branch (6422:80): [True: 79, False: 383]
  |  Branch (6422:97): [True: 383, False: 0]
  ------------------
 6423|       |                           // This is "false:" followed by space/tab/newline/end - treat as key
 6424|  1.91k|                           parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6425|  1.91k|                           return;
 6426|  1.91k|                        }
 6427|  1.67k|                        process_yaml_variant_alternatives<V, is_yaml_variant_bool>::template op<Opts>(value, ctx, it,
 6428|  1.67k|                                                                                                      end);
 6429|  1.67k|                        return;
 6430|  3.58k|                     }
 6431|       |                     // "false" is followed by more characters (e.g., "False\b") - treat as string
 6432|  4.57k|                  }
 6433|  13.0k|               }
 6434|  9.08k|               parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6435|  13.0k|               return;
 6436|  6.26k|            case 'n':
  ------------------
  |  Branch (6436:13): [True: 6.26k, False: 867k]
  ------------------
 6437|  9.62k|            case 'N':
  ------------------
  |  Branch (6437:13): [True: 3.35k, False: 870k]
  ------------------
 6438|       |               // Could be "null", "Null", "NULL", or a key/string starting with n/N
 6439|  9.62k|               if constexpr (counts::n_null > 0) {
 6440|  9.62k|                  if ((end - it >= 4) && ((it[1] == 'u' && it[2] == 'l' && it[3] == 'l') ||
  ------------------
  |  Branch (6440:23): [True: 9.29k, False: 324]
  |  Branch (6440:44): [True: 6.24k, False: 3.05k]
  |  Branch (6440:60): [True: 5.44k, False: 798]
  |  Branch (6440:76): [True: 4.88k, False: 560]
  ------------------
 6441|  5.52k|                                          (it[1] == 'U' && it[2] == 'L' && it[3] == 'L'))) {
  ------------------
  |  Branch (6441:44): [True: 2.08k, False: 2.32k]
  |  Branch (6441:60): [True: 1.66k, False: 416]
  |  Branch (6441:76): [True: 642, False: 1.02k]
  ------------------
 6442|       |                     // Check what follows the word "null"
 6443|  5.52k|                     const auto after_null = it + 4;
 6444|  5.52k|                     const bool at_word_boundary = is_word_boundary(after_null);
 6445|       |
 6446|  5.52k|                     if (at_word_boundary) {
  ------------------
  |  Branch (6446:26): [True: 4.96k, False: 566]
  ------------------
 6447|  4.96k|                        if (has_indented_block_continuation(after_null)) {
  ------------------
  |  Branch (6447:29): [True: 276, False: 4.68k]
  ------------------
 6448|    276|                           parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6449|    276|                           return;
 6450|    276|                        }
 6451|       |                        // Check if this is a key (followed by ": ") rather than a null value
 6452|       |                        // "null: value" should parse as {null: value}, not as the null type
 6453|  4.68k|                        if ((end - it > 4) && it[4] == ':' &&
  ------------------
  |  Branch (6453:29): [True: 4.27k, False: 408]
  |  Branch (6453:47): [True: 1.80k, False: 2.47k]
  ------------------
 6454|  1.80k|                            (end - it == 5 || it[5] == ' ' || it[5] == '\t' || it[5] == '\n' || it[5] == '\r')) {
  ------------------
  |  Branch (6454:30): [True: 629, False: 1.17k]
  |  Branch (6454:47): [True: 329, False: 844]
  |  Branch (6454:63): [True: 388, False: 456]
  |  Branch (6454:80): [True: 319, False: 137]
  |  Branch (6454:97): [True: 137, False: 0]
  ------------------
 6455|       |                           // This is "null:" followed by space/tab/newline/end - treat as key
 6456|  1.80k|                           parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6457|  1.80k|                           return;
 6458|  1.80k|                        }
 6459|  2.88k|                        constexpr auto first_idx = yaml_variant_first_index_v<V, is_yaml_variant_null>;
 6460|  2.88k|                        using NullType = std::variant_alternative_t<first_idx, V>;
 6461|  2.88k|                        if (!std::holds_alternative<NullType>(value)) value = NullType{};
  ------------------
  |  Branch (6461:29): [True: 0, False: 2.88k]
  ------------------
 6462|  2.88k|                        from<YAML, NullType>::template op<Opts>(std::get<NullType>(value), ctx, it, end);
 6463|  2.88k|                        return;
 6464|  4.68k|                     }
 6465|       |                     // "null" is followed by more characters (e.g., "Null\b") - treat as string
 6466|  5.52k|                  }
 6467|  9.62k|               }
 6468|  4.65k|               parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6469|  9.62k|               return;
 6470|    391|            case '~':
  ------------------
  |  Branch (6470:13): [True: 391, False: 873k]
  ------------------
 6471|       |               // Null indicator
 6472|    391|               if constexpr (counts::n_null > 0) {
 6473|    391|                  constexpr auto first_idx = yaml_variant_first_index_v<V, is_yaml_variant_null>;
 6474|    391|                  using NullType = std::variant_alternative_t<first_idx, V>;
 6475|    391|                  if (!std::holds_alternative<NullType>(value)) value = NullType{};
  ------------------
  |  Branch (6475:23): [True: 0, False: 391]
  ------------------
 6476|    391|                  from<YAML, NullType>::template op<Opts>(std::get<NullType>(value), ctx, it, end);
 6477|    391|                  return;
 6478|    391|               }
 6479|      0|               break; // Fall through to try other types
 6480|  51.1k|            case '-':
  ------------------
  |  Branch (6480:13): [True: 51.1k, False: 823k]
  ------------------
 6481|       |               // Could be negative number or block sequence indicator
 6482|  51.1k|               if (((it + 1) == end) || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(it[1])]) {
  ------------------
  |  Branch (6482:20): [True: 767, False: 50.4k]
  |  Branch (6482:41): [True: 43.4k, False: 6.98k]
  ------------------
 6483|       |                  // Block sequence indicator "- "
 6484|  44.1k|                  if constexpr (counts::n_array > 0) {
 6485|  44.1k|                     process_yaml_variant_alternatives<V, is_yaml_variant_array>::template op<Opts>(value, ctx, it,
 6486|  44.1k|                                                                                                    end);
 6487|  44.1k|                     return;
 6488|  44.1k|                  }
 6489|  44.1k|               }
 6490|  51.1k|               if constexpr (counts::n_num > 0) {
 6491|  51.1k|                  if ((end - it >= 2) && (std::isdigit(static_cast<unsigned char>(it[1])) || it[1] == '.')) {
  ------------------
  |  Branch (6491:23): [True: 6.98k, False: 44.1k]
  |  Branch (6491:43): [True: 739, False: 6.25k]
  |  Branch (6491:94): [True: 609, False: 5.64k]
  ------------------
 6492|  1.34k|                     process_yaml_variant_alternatives<V, is_yaml_variant_num>::template op<Opts>(value, ctx, it, end);
 6493|  1.34k|                     return;
 6494|  1.34k|                  }
 6495|  51.1k|               }
 6496|  49.8k|               parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6497|  51.1k|               return;
 6498|  2.88k|            case '+':
  ------------------
  |  Branch (6498:13): [True: 2.88k, False: 871k]
  ------------------
 6499|  9.92k|            case '.':
  ------------------
  |  Branch (6499:13): [True: 7.03k, False: 867k]
  ------------------
 6500|       |               // Could be a number (.5, +5, .inf, etc.) or a string (.c, .cpp, +name, etc.)
 6501|       |               // Try parsing as number speculatively, fall back to string on failure
 6502|  9.92k|               if constexpr (counts::n_num > 0) {
 6503|  9.92k|                  auto start_it = it;
 6504|  9.92k|                  auto temp_ctx = ctx.make_speculative();
 6505|  9.92k|                  process_yaml_variant_alternatives<V, is_yaml_variant_num>::template op<Opts>(value, temp_ctx, it,
 6506|  9.92k|                                                                                               end);
 6507|  9.92k|                  ctx.alias_expansion_budget = temp_ctx.alias_expansion_budget; // charged even if rejected
 6508|  9.92k|                  ctx.key_expansion_budget = temp_ctx.key_expansion_budget;
 6509|  9.92k|                  if (!bool(temp_ctx.error)) {
  ------------------
  |  Branch (6509:23): [True: 2.18k, False: 7.73k]
  ------------------
 6510|  2.18k|                     ctx.anchors = std::move(temp_ctx.anchors);
 6511|  2.18k|                     return; // Successfully parsed as number
 6512|  2.18k|                  }
 6513|  7.73k|                  it = start_it; // Restore and fall through to string
 6514|  7.73k|               }
 6515|      0|               parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6516|  9.92k|               return;
 6517|   255k|            default:
  ------------------
  |  Branch (6517:13): [True: 255k, False: 619k]
  ------------------
 6518|       |               // Check for digit (0-9) - numeric or block mapping key starting with digit
 6519|   255k|               if (c >= '0' && c <= '9') {
  ------------------
  |  Branch (6519:20): [True: 193k, False: 61.6k]
  |  Branch (6519:32): [True: 49.1k, False: 144k]
  ------------------
 6520|       |                  // Try block mapping first (e.g., "123key: value")
 6521|  49.1k|                  if (try_parse_block_mapping_into_variant<V, Opts>(value, ctx, it, end)) {
  ------------------
  |  Branch (6521:23): [True: 30.2k, False: 18.9k]
  ------------------
 6522|  30.2k|                     return;
 6523|  30.2k|                  }
 6524|       |                  // Try numeric value speculatively - values like "12:30" look numeric but aren't
 6525|  18.9k|                  if constexpr (counts::n_num > 0) {
 6526|  18.9k|                     auto start_it = it;
 6527|  18.9k|                     auto temp_ctx = ctx.make_speculative();
 6528|  18.9k|                     process_yaml_variant_alternatives<V, is_yaml_variant_num>::template op<Opts>(value, temp_ctx, it,
 6529|  18.9k|                                                                                                  end);
 6530|  18.9k|                     ctx.alias_expansion_budget = temp_ctx.alias_expansion_budget; // charged even if rejected
 6531|  18.9k|                     ctx.key_expansion_budget = temp_ctx.key_expansion_budget;
 6532|  18.9k|                     if (!bool(temp_ctx.error)) {
  ------------------
  |  Branch (6532:26): [True: 3.73k, False: 15.2k]
  ------------------
 6533|  3.73k|                        ctx.anchors = std::move(temp_ctx.anchors);
 6534|  3.73k|                        return; // Successfully parsed as number
 6535|  3.73k|                     }
 6536|  15.2k|                     it = start_it; // Restore and fall through to string
 6537|  15.2k|                  }
 6538|       |                  // Fall through to string
 6539|      0|                  process_yaml_variant_alternatives<V, is_yaml_variant_str>::template op<Opts>(value, ctx, it, end);
 6540|  18.9k|                  return;
 6541|  49.1k|               }
 6542|       |               // Plain scalar - try block mapping, then string
 6543|   205k|               parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6544|   205k|               return;
 6545|   874k|            }
 6546|   874k|         }
 6547|       |
 6548|       |         // For non-auto-deducible variants or fallback, try each type until one succeeds
 6549|      0|         constexpr auto N = std::variant_size_v<std::remove_cvref_t<T>>;
 6550|       |
 6551|       |         // This fold discards each alternative's error and reports only that nothing fit, which
 6552|       |         // misdiagnoses a document that exhausted an expansion budget as merely the wrong shape.
 6553|       |         // Kept aside and used only if no alternative parsed, so a later one that does parse
 6554|       |         // (possible under a latched budget if it materializes no key text) is unaffected.
 6555|   874k|         error_code expansion_error{};
 6556|   874k|         std::string_view expansion_message{};
 6557|       |
 6558|   874k|         auto try_parse = [&]<size_t I>() -> bool {
 6559|   874k|            using V = std::variant_alternative_t<I, std::remove_cvref_t<T>>;
 6560|   874k|            auto start = it;
 6561|       |
 6562|   874k|            V v{};
 6563|   874k|            auto temp_ctx = ctx.make_speculative();
 6564|   874k|            from<YAML, V>::template op<Opts>(v, temp_ctx, it, end);
 6565|   874k|            ctx.alias_expansion_budget = temp_ctx.alias_expansion_budget; // charged even if rejected
 6566|   874k|            ctx.key_expansion_budget = temp_ctx.key_expansion_budget;
 6567|       |
 6568|   874k|            if (!bool(temp_ctx.error)) {
 6569|   874k|               value = std::move(v);
 6570|   874k|               ctx.anchors = std::move(temp_ctx.anchors);
 6571|   874k|               return true;
 6572|   874k|            }
 6573|       |
 6574|   874k|            if (temp_ctx.error == error_code::exceeded_max_expansion && expansion_error == error_code::none) {
 6575|   874k|               expansion_error = temp_ctx.error;
 6576|   874k|               expansion_message = temp_ctx.custom_error_message;
 6577|   874k|            }
 6578|   874k|            it = start;
 6579|   874k|            return false;
 6580|   874k|         };
 6581|       |
 6582|   874k|         bool parsed = false;
 6583|   874k|         [&]<size_t... Is>(std::index_sequence<Is...>) {
 6584|   874k|            ((parsed = parsed || try_parse.template operator()<Is>()), ...);
 6585|   874k|         }(std::make_index_sequence<N>{});
 6586|       |
 6587|   874k|         if (!parsed) {
  ------------------
  |  Branch (6587:14): [True: 0, False: 874k]
  ------------------
 6588|      0|            if (expansion_error != error_code::none) {
  ------------------
  |  Branch (6588:17): [True: 0, False: 0]
  ------------------
 6589|      0|               ctx.error = expansion_error;
 6590|      0|               ctx.custom_error_message = expansion_message;
 6591|      0|            }
 6592|      0|            else {
 6593|      0|               ctx.error = error_code::no_matching_variant_type;
 6594|      0|            }
 6595|      0|         }
 6596|   874k|      }
_ZN3glz4yaml26alias_token_is_mapping_keyIPKcS3_EEbT_T0_:
  371|  11.5M|      {
  372|  11.5M|         if (it == end || *it != '*') return false;
  ------------------
  |  Branch (372:14): [True: 0, False: 11.5M]
  |  Branch (372:27): [True: 11.0M, False: 508k]
  ------------------
  373|   508k|         ++it; // skip '*'
  374|   508k|         auto name = parse_anchor_name(it, end);
  375|   508k|         if (name.empty()) return false;
  ------------------
  |  Branch (375:14): [True: 412, False: 508k]
  ------------------
  376|   508k|         skip_inline_ws(it, end);
  377|   508k|         return (it != end && *it == ':') &&
  ------------------
  |  Branch (377:18): [True: 491k, False: 16.6k]
  |  Branch (377:31): [True: 104k, False: 387k]
  ------------------
  378|   104k|                ((it + 1) == end || whitespace_or_line_end_table[static_cast<uint8_t>(*(it + 1))]);
  ------------------
  |  Branch (378:18): [True: 5.23k, False: 99.2k]
  |  Branch (378:37): [True: 84.4k, False: 14.7k]
  ------------------
  379|   508k|      }
_ZN3glz33process_yaml_variant_alternativesINSt3__17variantIJDndNS1_12basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEbNS1_6vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS6_ISD_EEEENSC_ISD_EEEEENS_22is_yaml_variant_objectEE2opITnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1EEERSH_TkNS_10is_contextERNS_4yaml12yaml_contextERPKcSR_EEvOT0_OT1_OT2_T3_:
 5205|   421k|      {
 5206|   421k|         constexpr auto category_count = yaml_variant_count_v<Variant, Trait>;
 5207|       |
 5208|       |         if constexpr (category_count == 0) {
 5209|       |            ctx.error = error_code::no_matching_variant_type;
 5210|       |         }
 5211|   421k|         else if constexpr (category_count == 1) {
 5212|       |            // Only one type in this category, use it directly
 5213|   421k|            constexpr auto first_idx = yaml_variant_first_index_v<Variant, Trait>;
 5214|   421k|            using V = std::variant_alternative_t<first_idx, Variant>;
 5215|   421k|            if (!std::holds_alternative<V>(value)) value = V{};
  ------------------
  |  Branch (5215:17): [True: 421k, False: 0]
  ------------------
 5216|   421k|            from<YAML, V>::template op<Opts>(std::get<V>(value), ctx, it, end);
 5217|       |         }
 5218|       |         else {
 5219|       |            // Multiple types in this category, try each one
 5220|       |            constexpr auto N = std::variant_size_v<Variant>;
 5221|       |            bool found_match{};
 5222|       |            size_t match_idx = 0;
 5223|       |            // Only the last alternative propagates its error, so an alternative that exhausted an
 5224|       |            // expansion budget would otherwise be reported as no_matching_variant_type -- a wrong
 5225|       |            // diagnosis for a document that is hostile rather than merely the wrong shape. Held
 5226|       |            // aside and used only if nothing matched, so an alternative that does succeed later
 5227|       |            // (one that materializes no key text can still parse under a latched budget) is
 5228|       |            // unaffected.
 5229|       |            error_code expansion_error{};
 5230|       |            std::string_view expansion_message{};
 5231|       |
 5232|       |            for_each<N>([&]<size_t I>() {
 5233|       |               if (found_match) {
 5234|       |                  return;
 5235|       |               }
 5236|       |               using V = std::variant_alternative_t<I, Variant>;
 5237|       |               if constexpr (Trait<V>::value) {
 5238|       |                  auto copy_it = it;
 5239|       |                  if (!std::holds_alternative<V>(value)) {
 5240|       |                     value = V{};
 5241|       |                  }
 5242|       |
 5243|       |                  auto temp_ctx = ctx.make_speculative();
 5244|       |                  from<YAML, V>::template op<Opts>(std::get<V>(value), temp_ctx, it, end);
 5245|       |
 5246|       |                  // Charged whether or not the alternative fit: a rejected probe still replayed
 5247|       |                  // whatever aliases it reached, and an attempt that is never billed is an
 5248|       |                  // attempt that can be repeated for free.
 5249|       |                  ctx.alias_expansion_budget = temp_ctx.alias_expansion_budget;
 5250|       |                  ctx.key_expansion_budget = temp_ctx.key_expansion_budget;
 5251|       |
 5252|       |                  if (!bool(temp_ctx.error)) {
 5253|       |                     found_match = true;
 5254|       |                     ctx.anchors = std::move(temp_ctx.anchors);
 5255|       |                  }
 5256|       |                  else {
 5257|       |                     it = copy_it;
 5258|       |                     if (temp_ctx.error == error_code::exceeded_max_expansion && expansion_error == error_code::none) {
 5259|       |                        expansion_error = temp_ctx.error;
 5260|       |                        expansion_message = temp_ctx.custom_error_message;
 5261|       |                     }
 5262|       |                     if (match_idx + 1 < category_count) {
 5263|       |                        // Not the last type, continue trying
 5264|       |                     }
 5265|       |                     else {
 5266|       |                        // Last type failed, propagate error
 5267|       |                        ctx.error = temp_ctx.error;
 5268|       |                        ctx.custom_error_message = temp_ctx.custom_error_message;
 5269|       |                     }
 5270|       |                  }
 5271|       |                  ++match_idx;
 5272|       |               }
 5273|       |            });
 5274|       |
 5275|       |            if (!found_match && !bool(ctx.error)) {
 5276|       |               if (expansion_error != error_code::none) {
 5277|       |                  ctx.error = expansion_error;
 5278|       |                  ctx.custom_error_message = expansion_message;
 5279|       |               }
 5280|       |               else {
 5281|       |                  ctx.error = error_code::no_matching_variant_type;
 5282|       |               }
 5283|       |            }
 5284|       |         }
 5285|   421k|      }
_ZN3glz4fromILj450ENS_17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES1_EEEEE2opITnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1EEERPKcRS5_TkNS_10is_contextERNS_4yaml12yaml_contextESA_EEvOT1_OT2_OT0_T3_:
 4515|   423k|      {
 4516|   423k|         if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4516:14): [True: 0, False: 423k]
  ------------------
 4517|      0|            return;
 4518|       |
 4519|   423k|         yaml::node_preamble_state preamble{};
 4520|   423k|         if (yaml::parse_node_preamble<Opts, yaml::node_property_policy{true, true, false, false}>(
  ------------------
  |  Branch (4520:14): [True: 2.19k, False: 421k]
  ------------------
 4521|   423k|                value, ctx, it, end, preamble, [](yaml::yaml_tag tag) { return yaml::tag_valid_for_map(tag); }))
 4522|  2.19k|            return;
 4523|       |
 4524|   421k|         using key_t = typename std::remove_cvref_t<T>::key_type;
 4525|   421k|         using val_t = typename std::remove_cvref_t<T>::mapped_type;
 4526|       |
 4527|       |         // Reading a YAML mapping MERGES into the target: an entry overwrites the
 4528|       |         // value of a key that existed before the read and adds new keys, while
 4529|       |         // pre-existing keys the document does not mention are preserved (like a
 4530|       |         // struct/object read, and like json/read.hpp's per-key value[key]).
 4531|       |         // Within a single document a repeated key keeps its FIRST value -- YAML
 4532|       |         // mappings disallow duplicate keys and the conformance suite expects
 4533|       |         // first-wins, which falls out of emplace into an empty map. Any
 4534|       |         // pre-existing entry the document leaves untouched is restored on scope
 4535|       |         // exit (including error paths). When the target starts empty (the common
 4536|       |         // case) this is a no-op with negligible cost.
 4537|   421k|         std::remove_cvref_t<T> preexisting_entries;
 4538|   421k|         if (!value.empty()) {
  ------------------
  |  Branch (4538:14): [True: 0, False: 421k]
  ------------------
 4539|      0|            preexisting_entries = std::move(value);
 4540|      0|            value.clear();
 4541|      0|         }
 4542|   421k|         struct merge_restore_guard
 4543|   421k|         {
 4544|   421k|            std::remove_cvref_t<T>& target;
 4545|   421k|            std::remove_cvref_t<T>& saved;
 4546|   421k|            ~merge_restore_guard()
 4547|   421k|            {
 4548|       |               // emplace is a no-op for keys the document already wrote, so only
 4549|       |               // untouched pre-existing entries are put back.
 4550|   421k|               for (auto& entry : saved) {
 4551|   421k|                  target.emplace(entry.first, std::move(entry.second));
 4552|   421k|               }
 4553|   421k|            }
 4554|   421k|         } merge_restore{value, preexisting_entries};
 4555|       |
 4556|   421k|         const bool treat_as_block_mapping =
 4557|   421k|            !yaml::check_flow_context(Opts) && *it == '{' && yaml::inline_value_has_plain_mapping_indicator(it, end);
  ------------------
  |  Branch (4557:13): [True: 421k, Folded]
  |  Branch (4557:48): [True: 32.4k, False: 388k]
  |  Branch (4557:62): [True: 1.20k, False: 31.2k]
  ------------------
 4558|       |
 4559|   421k|         if (*it == '{' && !treat_as_block_mapping) {
  ------------------
  |  Branch (4559:14): [True: 32.4k, False: 388k]
  |  Branch (4559:28): [True: 31.2k, False: 1.20k]
  ------------------
 4560|       |            // Flow mapping
 4561|  31.2k|            ++it;
 4562|       |            // Skip whitespace and newlines after opening brace
 4563|  31.2k|            yaml::skip_ws_and_newlines(it, end);
 4564|       |
 4565|  31.2k|            if (it != end && *it == '}') {
  ------------------
  |  Branch (4565:17): [True: 30.8k, False: 455]
  |  Branch (4565:30): [True: 2.87k, False: 27.9k]
  ------------------
 4566|  2.87k|               ++it;
 4567|  2.87k|               yaml::validate_flow_node_adjacent_tail(ctx, it, end);
 4568|  2.87k|               if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4568:20): [True: 5, False: 2.87k]
  ------------------
 4569|      5|                  return;
 4570|  2.87k|               yaml::finalize_node_anchor(preamble.node_props, ctx, it);
 4571|  2.87k|               return;
 4572|  2.87k|            }
 4573|       |
 4574|   188k|            while (it != end) {
  ------------------
  |  Branch (4574:20): [True: 186k, False: 2.32k]
  ------------------
 4575|       |               // Skip whitespace and newlines at start of each iteration
 4576|   186k|               yaml::skip_ws_and_newlines(it, end);
 4577|       |
 4578|   186k|               if (it != end && *it == '}') {
  ------------------
  |  Branch (4578:20): [True: 186k, False: 0]
  |  Branch (4578:33): [True: 2.79k, False: 183k]
  ------------------
 4579|  2.79k|                  ++it;
 4580|  2.79k|                  yaml::validate_flow_node_adjacent_tail(ctx, it, end);
 4581|  2.79k|                  if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4581:23): [True: 6, False: 2.79k]
  ------------------
 4582|      6|                     return;
 4583|  2.79k|                  break;
 4584|  2.79k|               }
 4585|       |
 4586|   183k|               bool explicit_flow_key = false;
 4587|   183k|               auto explicit_probe = it;
 4588|   183k|               yaml::skip_inline_ws(explicit_probe, end);
 4589|   183k|               if (explicit_probe != end && *explicit_probe == '?') {
  ------------------
  |  Branch (4589:20): [True: 183k, False: 0]
  |  Branch (4589:45): [True: 20.1k, False: 163k]
  ------------------
 4590|  20.1k|                  const auto after_q = explicit_probe + 1;
 4591|  20.1k|                  if (after_q == end || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*after_q)] ||
  ------------------
  |  Branch (4591:23): [True: 9, False: 20.1k]
  |  Branch (4591:41): [True: 3.95k, False: 16.2k]
  ------------------
 4592|  16.8k|                      *after_q == ',' || *after_q == '}') {
  ------------------
  |  Branch (4592:23): [True: 12.5k, False: 3.68k]
  |  Branch (4592:42): [True: 336, False: 3.34k]
  ------------------
 4593|  16.8k|                     explicit_flow_key = true;
 4594|  16.8k|                     it = explicit_probe + 1;
 4595|  16.8k|                     yaml::skip_flow_ws_and_newlines(ctx, it, end);
 4596|  16.8k|                     if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4596:26): [True: 1, False: 16.8k]
  ------------------
 4597|      1|                        return;
 4598|  16.8k|                  }
 4599|  20.1k|               }
 4600|       |               // Parse key
 4601|   183k|               key_t key{};
 4602|   183k|               if constexpr (std::same_as<std::remove_cvref_t<key_t>, std::string>) {
 4603|   183k|                  if (explicit_flow_key && it != end && (*it == ':' || *it == ',' || *it == '}')) {
  ------------------
  |  Branch (4603:23): [True: 16.8k, False: 166k]
  |  Branch (4603:44): [True: 16.8k, False: 14]
  |  Branch (4603:58): [True: 351, False: 16.4k]
  |  Branch (4603:72): [True: 12.5k, False: 3.93k]
  |  Branch (4603:86): [True: 414, False: 3.51k]
  ------------------
 4604|  13.3k|                     key.clear();
 4605|  13.3k|                  }
 4606|   170k|                  else {
 4607|   170k|                     auto key_probe = it;
 4608|   170k|                     yaml::skip_inline_ws(key_probe, end);
 4609|       |
 4610|       |                     // Use full node parsing only for structurally complex flow keys.
 4611|       |                     // Plain/quoted/alias keys stay on parse_yaml_key() for compatibility.
 4612|   170k|                     bool parse_complex_flow_key = false;
 4613|   170k|                     if (key_probe != end) {
  ------------------
  |  Branch (4613:26): [True: 170k, False: 14]
  ------------------
 4614|   170k|                        if (*key_probe == '[' || *key_probe == '{') {
  ------------------
  |  Branch (4614:29): [True: 611, False: 169k]
  |  Branch (4614:50): [True: 3.81k, False: 165k]
  ------------------
 4615|  4.43k|                           parse_complex_flow_key = true;
 4616|  4.43k|                        }
 4617|   165k|                        else if (*key_probe == '&') {
  ------------------
  |  Branch (4617:34): [True: 18.3k, False: 147k]
  ------------------
 4618|  18.3k|                           ++key_probe;
 4619|  18.3k|                           yaml::parse_anchor_name(key_probe, end);
 4620|  18.3k|                           yaml::skip_inline_ws(key_probe, end);
 4621|  18.3k|                           if (key_probe != end && (*key_probe == '[' || *key_probe == '{')) {
  ------------------
  |  Branch (4621:32): [True: 18.3k, False: 47]
  |  Branch (4621:53): [True: 300, False: 18.0k]
  |  Branch (4621:74): [True: 516, False: 17.5k]
  ------------------
 4622|    816|                              parse_complex_flow_key = true;
 4623|    816|                           }
 4624|  18.3k|                        }
 4625|   170k|                     }
 4626|       |
 4627|   170k|                     if (parse_complex_flow_key) {
  ------------------
  |  Branch (4627:26): [True: 5.24k, False: 165k]
  ------------------
 4628|  5.24k|                        glz::generic key_node{};
 4629|  5.24k|                        from<YAML, glz::generic>::template op<yaml::flow_context_on<Opts>()>(key_node, ctx, it, end);
 4630|  5.24k|                        if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4630:29): [True: 565, False: 4.68k]
  ------------------
 4631|    565|                           return;
 4632|  4.68k|                        if (!yaml::materialize_key(key, key_node, ctx)) [[unlikely]]
  ------------------
  |  Branch (4632:29): [True: 1, False: 4.68k]
  ------------------
 4633|      1|                           return;
 4634|  4.68k|                     }
 4635|   165k|                     else {
 4636|   165k|                        if (!yaml::parse_yaml_key(key, ctx, it, end, true)) {
  ------------------
  |  Branch (4636:29): [True: 503, False: 164k]
  ------------------
 4637|    503|                           return;
 4638|    503|                        }
 4639|   165k|                     }
 4640|   170k|                  }
 4641|       |               }
 4642|       |               else {
 4643|       |                  if (explicit_flow_key && it != end && (*it == ':' || *it == ',' || *it == '}')) {
 4644|       |                     ctx.error = error_code::syntax_error;
 4645|       |                     return;
 4646|       |                  }
 4647|       |                  from<YAML, key_t>::template op<yaml::flow_context_on<Opts>()>(key, ctx, it, end);
 4648|       |                  if (bool(ctx.error)) [[unlikely]]
 4649|       |                     return;
 4650|       |               }
 4651|       |
 4652|       |               // Separation between flow key and ':' may include comments/newlines.
 4653|       |               // In flow context, newlines are allowed between key and ':'.
 4654|   182k|               yaml::skip_flow_ws_and_newlines(ctx, it, end);
 4655|   183k|               if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4655:20): [True: 6, False: 183k]
  ------------------
 4656|      6|                  return;
 4657|       |
 4658|   183k|               auto parse_implicit_null = [&](val_t& val) -> bool {
 4659|   183k|                  if constexpr (nullable_like<std::remove_cvref_t<val_t>>) {
 4660|   183k|                     val = {};
 4661|   183k|                     return true;
 4662|   183k|                  }
 4663|   183k|                  else if constexpr (std::same_as<std::remove_cvref_t<val_t>, glz::generic>) {
 4664|   183k|                     val = glz::generic{};
 4665|   183k|                     return true;
 4666|   183k|                  }
 4667|   183k|                  else {
 4668|   183k|                     static constexpr std::string_view null_value{"null"};
 4669|   183k|                     auto null_it = null_value.data();
 4670|   183k|                     from<YAML, val_t>::template op<yaml::flow_context_on<Opts>()>(
 4671|   183k|                        val, ctx, null_it, null_value.data() + null_value.size());
 4672|   183k|                     return !bool(ctx.error);
 4673|   183k|                  }
 4674|   183k|               };
 4675|       |
 4676|   183k|               if (it != end && (*it == ',' || *it == '}')) {
  ------------------
  |  Branch (4676:20): [True: 181k, False: 2.05k]
  |  Branch (4676:34): [True: 138k, False: 42.8k]
  |  Branch (4676:48): [True: 7.75k, False: 35.0k]
  ------------------
 4677|   146k|                  val_t val{};
 4678|   146k|                  if (!parse_implicit_null(val)) [[unlikely]]
  ------------------
  |  Branch (4678:23): [True: 0, False: 146k]
  ------------------
 4679|      0|                     return;
 4680|       |
 4681|   146k|                  value.emplace(std::move(key), std::move(val));
 4682|       |
 4683|   146k|                  if (*it == '}') {
  ------------------
  |  Branch (4683:23): [True: 7.75k, False: 138k]
  ------------------
 4684|  7.75k|                     ++it;
 4685|  7.75k|                     yaml::validate_flow_node_adjacent_tail(ctx, it, end);
 4686|  7.75k|                     if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4686:26): [True: 10, False: 7.74k]
  ------------------
 4687|     10|                        return;
 4688|  7.74k|                     break;
 4689|  7.75k|                  }
 4690|       |
 4691|   138k|                  ++it; // skip comma
 4692|   138k|                  yaml::skip_ws_and_newlines(it, end);
 4693|   138k|                  continue;
 4694|   146k|               }
 4695|       |
 4696|  37.1k|               if (it == end || *it != ':') {
  ------------------
  |  Branch (4696:20): [True: 2.05k, False: 35.0k]
  |  Branch (4696:33): [True: 114, False: 34.9k]
  ------------------
 4697|  1.10k|                  ctx.error = error_code::syntax_error;
 4698|  1.10k|                  return;
 4699|  1.10k|               }
 4700|  36.0k|               ++it;
 4701|       |
 4702|  36.0k|               yaml::skip_flow_ws_and_newlines(ctx, it, end);
 4703|  36.0k|               if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4703:20): [True: 4, False: 36.0k]
  ------------------
 4704|      4|                  return;
 4705|       |
 4706|       |               // Omitted value after an explicit ':' maps to an implicit null.
 4707|  36.0k|               if (it != end && (*it == ',' || *it == '}')) {
  ------------------
  |  Branch (4707:20): [True: 34.4k, False: 1.54k]
  |  Branch (4707:34): [True: 2.59k, False: 31.8k]
  |  Branch (4707:48): [True: 10.4k, False: 21.4k]
  ------------------
 4708|  13.0k|                  val_t val{};
 4709|  13.0k|                  if (!parse_implicit_null(val)) [[unlikely]]
  ------------------
  |  Branch (4709:23): [True: 0, False: 13.0k]
  ------------------
 4710|      0|                     return;
 4711|       |
 4712|  13.0k|                  value.emplace(std::move(key), std::move(val));
 4713|       |
 4714|  13.0k|                  if (*it == '}') {
  ------------------
  |  Branch (4714:23): [True: 10.4k, False: 2.59k]
  ------------------
 4715|  10.4k|                     ++it;
 4716|  10.4k|                     yaml::validate_flow_node_adjacent_tail(ctx, it, end);
 4717|  10.4k|                     if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4717:26): [True: 3, False: 10.4k]
  ------------------
 4718|      3|                        return;
 4719|  10.4k|                     break;
 4720|  10.4k|                  }
 4721|       |
 4722|  2.59k|                  ++it; // skip comma
 4723|  2.59k|                  yaml::skip_ws_and_newlines(it, end);
 4724|  2.59k|                  continue;
 4725|  13.0k|               }
 4726|       |
 4727|       |               // Parse value
 4728|  22.9k|               val_t val{};
 4729|  22.9k|               from<YAML, val_t>::template op<yaml::flow_context_on<Opts>()>(val, ctx, it, end);
 4730|  22.9k|               if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4730:20): [True: 692, False: 22.2k]
  ------------------
 4731|    692|                  return;
 4732|       |
 4733|  22.2k|               value.emplace(std::move(key), std::move(val));
 4734|       |
 4735|  22.2k|               yaml::skip_inline_ws(it, end);
 4736|       |
 4737|  22.2k|               if (it != end && *it == '}') {
  ------------------
  |  Branch (4737:20): [True: 21.0k, False: 1.18k]
  |  Branch (4737:33): [True: 1.61k, False: 19.4k]
  ------------------
 4738|  1.61k|                  ++it;
 4739|  1.61k|                  yaml::validate_flow_node_adjacent_tail(ctx, it, end);
 4740|  1.61k|                  if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4740:23): [True: 8, False: 1.60k]
  ------------------
 4741|      8|                     return;
 4742|  1.60k|                  break;
 4743|  1.61k|               }
 4744|  20.6k|               else if (it != end && *it == ',') {
  ------------------
  |  Branch (4744:25): [True: 19.4k, False: 1.18k]
  |  Branch (4744:38): [True: 17.1k, False: 2.27k]
  ------------------
 4745|  17.1k|                  ++it;
 4746|       |                  // Skip whitespace and newlines after comma
 4747|  17.1k|                  yaml::skip_ws_and_newlines(it, end);
 4748|  17.1k|               }
 4749|  3.46k|               else if (it != end && (*it == '\n' || *it == '\r')) {
  ------------------
  |  Branch (4749:25): [True: 2.27k, False: 1.18k]
  |  Branch (4749:39): [True: 1.90k, False: 369]
  |  Branch (4749:54): [True: 308, False: 61]
  ------------------
 4750|       |                  // Newlines may precede either the closing brace or the
 4751|       |                  // separator comma for the next entry.
 4752|  2.21k|                  yaml::skip_ws_and_newlines(it, end);
 4753|  2.21k|                  if (it != end && *it == '}') {
  ------------------
  |  Branch (4753:23): [True: 2.20k, False: 14]
  |  Branch (4753:36): [True: 386, False: 1.81k]
  ------------------
 4754|    386|                     ++it;
 4755|    386|                     yaml::validate_flow_node_adjacent_tail(ctx, it, end);
 4756|    386|                     if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4756:26): [True: 1, False: 385]
  ------------------
 4757|      1|                        return;
 4758|    385|                     break;
 4759|    386|                  }
 4760|  1.83k|                  if (it != end && *it == ',') {
  ------------------
  |  Branch (4760:23): [True: 1.81k, False: 14]
  |  Branch (4760:36): [True: 1.81k, False: 4]
  ------------------
 4761|  1.81k|                     ++it;
 4762|  1.81k|                     yaml::skip_ws_and_newlines(it, end);
 4763|  1.81k|                     continue;
 4764|  1.81k|                  }
 4765|     18|                  ctx.error = error_code::syntax_error;
 4766|     18|                  return;
 4767|  1.83k|               }
 4768|  1.24k|               else {
 4769|  1.24k|                  ctx.error = error_code::syntax_error;
 4770|  1.24k|                  return;
 4771|  1.24k|               }
 4772|  22.2k|            }
 4773|  28.4k|         }
 4774|   389k|         else {
 4775|       |            // Block mapping - use shared loop with map-specific callback
 4776|   389k|            yaml::parse_block_mapping_loop<Opts>(
 4777|   389k|               ctx, it, end, int32_t(-1), [&](auto& ctx, auto& it, auto end, int32_t line_indent) -> bool {
 4778|   389k|                  auto parse_map_value = [&](val_t& val) -> bool {
 4779|   389k|                     if (it != end && !yaml::line_end_or_comment_table[static_cast<uint8_t>(*it)]) {
 4780|   389k|                        bool line_starts_with_explicit_value_indicator = false;
 4781|       |
 4782|       |                        // Inline mapping values in block context cannot start with a
 4783|       |                        // plain "key: value" pair on the same line (e.g. "a: b: c").
 4784|       |                        // Such constructs are malformed unless wrapped in flow
 4785|       |                        // delimiters ({...} / [...]) or quoted.
 4786|   389k|                        if constexpr (std::is_pointer_v<std::decay_t<decltype(it)>>) {
 4787|   389k|                           if (ctx.stream_begin) {
 4788|   389k|                              auto is_line_content_start = [&](auto pos) {
 4789|   389k|                                 return !ctx.line_prefix_before(pos).has_content;
 4790|   389k|                              };
 4791|       |
 4792|   389k|                              auto line_has_explicit_value_indicator = [&](auto pos) {
 4793|   389k|                                 const char* line = ctx.line_begin_of(pos);
 4794|   389k|                                 while (line != end && (*line == ' ' || *line == '\t')) ++line;
 4795|   389k|                                 return line != end && *line == ':';
 4796|   389k|                              };
 4797|       |
 4798|   389k|                              if (!is_line_content_start(it) &&
 4799|   389k|                                  yaml::inline_value_has_plain_mapping_indicator(it, end) &&
 4800|   389k|                                  !line_has_explicit_value_indicator(it)) {
 4801|   389k|                                 ctx.error = error_code::syntax_error;
 4802|   389k|                                 return false;
 4803|   389k|                              }
 4804|   389k|                              line_starts_with_explicit_value_indicator = line_has_explicit_value_indicator(it);
 4805|   389k|                           }
 4806|   389k|                        }
 4807|       |
 4808|   389k|                        if (*it == '-' &&
 4809|   389k|                            ((it + 1) == end || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*(it + 1))]) &&
 4810|   389k|                            !line_starts_with_explicit_value_indicator) {
 4811|       |                           // "key: - item" is not valid block sequence syntax.
 4812|   389k|                           ctx.error = error_code::syntax_error;
 4813|   389k|                           return false;
 4814|   389k|                        }
 4815|       |
 4816|   389k|                        if (!ctx.push_indent(line_indent + 1)) [[unlikely]]
 4817|   389k|                           return false;
 4818|   389k|                        from<YAML, val_t>::template op<Opts>(val, ctx, it, end);
 4819|   389k|                        ctx.pop_indent();
 4820|   389k|                     }
 4821|   389k|                     else {
 4822|   389k|                        int32_t nested_indent = yaml::detect_nested_value_indent(ctx, it, end, line_indent);
 4823|   389k|                        if (nested_indent >= 0) {
 4824|   389k|                           yaml::skip_to_content(it, end);
 4825|   389k|                           if (it != end && *it == ':' && (it + 1) != end && *(it + 1) == '\t') {
 4826|   389k|                              ctx.error = error_code::syntax_error;
 4827|   389k|                              return false;
 4828|   389k|                           }
 4829|       |                           // A struct value reads the pushed indent as its own key column;
 4830|       |                           // every other value type reads it as the enclosing baseline.
 4831|   389k|                           const int32_t value_indent =
 4832|   389k|                              yaml::receives_block_mapping_column<val_t>() ? nested_indent : nested_indent - 1;
 4833|   389k|                           if (!ctx.push_indent(value_indent)) [[unlikely]]
 4834|   389k|                              return false;
 4835|   389k|                           from<YAML, val_t>::template op<Opts>(val, ctx, it, end);
 4836|   389k|                           ctx.pop_indent();
 4837|   389k|                        }
 4838|   389k|                     }
 4839|   389k|                     return !bool(ctx.error);
 4840|   389k|                  };
 4841|       |
 4842|       |                  // Explicit key entry form:
 4843|       |                  // ? key
 4844|       |                  // : value
 4845|   389k|                  if (*it == '?' && ((it + 1) != end) && *(it + 1) == '\t') {
 4846|   389k|                     ctx.error = error_code::syntax_error;
 4847|   389k|                     return false;
 4848|   389k|                  }
 4849|   389k|                  if (*it == '?' && ((it + 1) == end || *(it + 1) == ' ' || *(it + 1) == '\n' || *(it + 1) == '\r')) {
 4850|   389k|                     ++it; // skip '?'
 4851|   389k|                     yaml::skip_inline_ws(it, end);
 4852|       |
 4853|   389k|                     const int32_t explicit_value_indicator_indent =
 4854|   389k|                        (ctx.current_indent() < 0) ? 0 : (ctx.current_indent() + 1);
 4855|       |
 4856|   389k|                     key_t key{};
 4857|   389k|                     if constexpr (std::same_as<std::remove_cvref_t<key_t>, std::string>) {
 4858|   389k|                        auto to_string_key = [&](glz::generic& key_node) {
 4859|   389k|                           return yaml::materialize_key(key, key_node, ctx);
 4860|   389k|                        };
 4861|       |
 4862|   389k|                        auto key_it = it;
 4863|   389k|                        yaml::skip_inline_ws(key_it, end);
 4864|       |
 4865|   389k|                        auto content = key_it;
 4866|   389k|                        yaml::skip_to_content(content, end);
 4867|   389k|                        bool handled_anchor_only_empty_key = false;
 4868|       |
 4869|       |                        // Anchor on an empty explicit key node:
 4870|       |                        //   ? &a
 4871|       |                        //   : value
 4872|   389k|                        if (content != end && *content == '&') {
 4873|   389k|                           auto anchor_probe = content + 1;
 4874|   389k|                           auto anchor_name = yaml::parse_anchor_name(anchor_probe, end);
 4875|   389k|                           if (!anchor_name.empty()) {
 4876|   389k|                              auto after_anchor = anchor_probe;
 4877|   389k|                              yaml::skip_inline_ws(after_anchor, end);
 4878|       |
 4879|   389k|                              auto value_indicator = after_anchor;
 4880|   389k|                              if (value_indicator != end && *value_indicator == ':') {
 4881|   389k|                                 key.clear();
 4882|   389k|                                 ctx.anchors[std::string(anchor_name)] = {content, content, ctx.current_indent()};
 4883|   389k|                                 it = value_indicator;
 4884|   389k|                                 handled_anchor_only_empty_key = true;
 4885|   389k|                              }
 4886|   389k|                              else {
 4887|   389k|                                 if (value_indicator != end && *value_indicator == '#') {
 4888|   389k|                                    yaml::skip_comment(value_indicator, end);
 4889|   389k|                                 }
 4890|   389k|                                 if (value_indicator != end && (*value_indicator == '\n' || *value_indicator == '\r')) {
 4891|   389k|                                    yaml::skip_newline(value_indicator, end);
 4892|   389k|                                    auto value_line = value_indicator;
 4893|   389k|                                    int32_t value_indent = yaml::measure_indent(value_line, end, ctx);
 4894|   389k|                                    if (bool(ctx.error)) [[unlikely]]
 4895|   389k|                                       return false;
 4896|   389k|                                    if (value_line != end && *value_line == ':' &&
 4897|   389k|                                        value_indent == explicit_value_indicator_indent) {
 4898|   389k|                                       key.clear();
 4899|   389k|                                       ctx.anchors[std::string(anchor_name)] = {content, content, ctx.current_indent()};
 4900|   389k|                                       it = value_line;
 4901|   389k|                                       handled_anchor_only_empty_key = true;
 4902|   389k|                                    }
 4903|   389k|                                    else if (value_line != end && *value_line == ':') {
 4904|       |                                       // In explicit-key form ("? &a"), a following ':'
 4905|       |                                       // starts the outer value indicator only at the same
 4906|       |                                       // indentation. A deeper-indented ': value' is malformed.
 4907|   389k|                                       ctx.error = error_code::syntax_error;
 4908|   389k|                                       return false;
 4909|   389k|                                    }
 4910|   389k|                                 }
 4911|   389k|                              }
 4912|   389k|                           }
 4913|   389k|                        }
 4914|       |
 4915|   389k|                        const bool key_content_spans_lines = [&] {
 4916|   389k|                           auto scan = key_it;
 4917|   389k|                           while (scan != content && scan != end) {
 4918|   389k|                              if (*scan == '\n' || *scan == '\r') return true;
 4919|   389k|                              ++scan;
 4920|   389k|                           }
 4921|   389k|                           return false;
 4922|   389k|                        }();
 4923|       |
 4924|   389k|                        if (handled_anchor_only_empty_key) {
 4925|       |                           // 'it' already points to the explicit value indicator ':'
 4926|   389k|                        }
 4927|   389k|                        else if (content == end || (*content == ':' && key_content_spans_lines)) {
 4928|   389k|                           key.clear();
 4929|   389k|                           it = content;
 4930|   389k|                        }
 4931|   389k|                        else {
 4932|       |                           // Explicit mapping keys ('? key-node') are full YAML nodes.
 4933|       |                           // Parse the key node structurally (not via plain-key scanning)
 4934|       |                           // so inputs like '? []: x' and '? JSON: like' are interpreted
 4935|       |                           // as complex keys, not split into implicit key/value pairs.
 4936|   389k|                           auto key_node_it = content;
 4937|   389k|                           auto key_node_end = end;
 4938|   389k|                           if constexpr (std::is_pointer_v<std::decay_t<It>>) {
 4939|       |                              // In explicit-key form, a following standalone ':'
 4940|       |                              // line (same or lower indentation) belongs to the
 4941|       |                              // outer mapping value, not the key node itself.
 4942|   389k|                              auto scan = content;
 4943|   389k|                              while (scan != end) {
 4944|   389k|                                 while (scan != end && *scan != '\n' && *scan != '\r') {
 4945|   389k|                                    ++scan;
 4946|   389k|                                 }
 4947|   389k|                                 if (scan == end) {
 4948|   389k|                                    break;
 4949|   389k|                                 }
 4950|       |
 4951|   389k|                                 yaml::skip_newline(scan, end);
 4952|   389k|                                 auto line_start = scan;
 4953|       |
 4954|   389k|                                 int32_t indicator_indent = 0;
 4955|   389k|                                 while (scan != end && *scan == ' ') {
 4956|   389k|                                    ++indicator_indent;
 4957|   389k|                                    ++scan;
 4958|   389k|                                 }
 4959|       |
 4960|   389k|                                 if (scan != end && *scan == ':') {
 4961|   389k|                                    const auto after_colon = scan + 1;
 4962|   389k|                                    if ((after_colon == end ||
 4963|   389k|                                         yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*after_colon)]) &&
 4964|   389k|                                        indicator_indent <= line_indent) {
 4965|   389k|                                       key_node_end = line_start;
 4966|   389k|                                       break;
 4967|   389k|                                    }
 4968|   389k|                                 }
 4969|   389k|                              }
 4970|   389k|                           }
 4971|       |
 4972|   389k|                           glz::generic key_node{};
 4973|   389k|                           const bool prev_explicit_mapping_key_context = ctx.explicit_mapping_key_context;
 4974|   389k|                           ctx.explicit_mapping_key_context = true;
 4975|   389k|                           from<YAML, glz::generic>::template op<Opts>(key_node, ctx, key_node_it, key_node_end);
 4976|   389k|                           ctx.explicit_mapping_key_context = prev_explicit_mapping_key_context;
 4977|   389k|                           if (bool(ctx.error)) [[unlikely]]
 4978|   389k|                              return false;
 4979|   389k|                           it = key_node_it;
 4980|   389k|                           if (!to_string_key(key_node)) [[unlikely]]
 4981|   389k|                              return false;
 4982|   389k|                        }
 4983|   389k|                     }
 4984|   389k|                     else {
 4985|   389k|                        if (it != end && !yaml::line_end_or_comment_table[static_cast<uint8_t>(*it)]) {
 4986|   389k|                           from<YAML, key_t>::template op<Opts>(key, ctx, it, end);
 4987|   389k|                           if (bool(ctx.error)) [[unlikely]]
 4988|   389k|                              return false;
 4989|   389k|                        }
 4990|   389k|                     }
 4991|       |
 4992|   389k|                     yaml::skip_inline_ws(it, end);
 4993|   389k|                     yaml::skip_comment(it, end);
 4994|       |
 4995|       |                     // Value indicator may appear on the next line at the same indent.
 4996|   389k|                     if (it != end && (*it == '\n' || *it == '\r')) {
 4997|   389k|                        auto probe = it;
 4998|   389k|                        bool found_value_indicator = false;
 4999|       |
 5000|   389k|                        while (probe != end && (*probe == '\n' || *probe == '\r')) {
 5001|   389k|                           yaml::skip_newline(probe, end);
 5002|       |
 5003|   389k|                           auto value_line = probe;
 5004|   389k|                           int32_t value_indent = yaml::measure_indent(value_line, end, ctx);
 5005|   389k|                           if (bool(ctx.error)) [[unlikely]]
 5006|   389k|                              return false;
 5007|       |
 5008|   389k|                           if (value_line == end || *value_line == '\n' || *value_line == '\r') {
 5009|   389k|                              probe = value_line;
 5010|   389k|                              continue; // blank line
 5011|   389k|                           }
 5012|   389k|                           if (*value_line == '#') {
 5013|   389k|                              yaml::skip_comment(value_line, end);
 5014|   389k|                              probe = value_line;
 5015|   389k|                              continue; // comment-only line
 5016|   389k|                           }
 5017|   389k|                           if (*value_line == ':' && value_indent == explicit_value_indicator_indent) {
 5018|   389k|                              it = value_line;
 5019|   389k|                              found_value_indicator = true;
 5020|   389k|                           }
 5021|   389k|                           break;
 5022|   389k|                        }
 5023|       |
 5024|   389k|                        if (found_value_indicator) {
 5025|   389k|                           yaml::skip_inline_ws(it, end);
 5026|   389k|                        }
 5027|   389k|                     }
 5028|       |
 5029|   389k|                     val_t val{};
 5030|   389k|                     if (it != end && *it == ':') {
 5031|   389k|                        ++it;
 5032|   389k|                        if (it != end && *it == '\t') {
 5033|   389k|                           ctx.error = error_code::syntax_error;
 5034|   389k|                           return false;
 5035|   389k|                        }
 5036|   389k|                        if (it != end && (*it == '\n' || *it == '\r')) {
 5037|   389k|                           auto probe = it;
 5038|   389k|                           yaml::skip_newline(probe, end);
 5039|   389k|                           while (probe != end && *probe == ' ') ++probe;
 5040|   389k|                           if (probe != end && *probe == ':' && ((probe + 1) != end) && *(probe + 1) == '\t') {
 5041|   389k|                              ctx.error = error_code::syntax_error;
 5042|   389k|                              return false;
 5043|   389k|                           }
 5044|   389k|                        }
 5045|   389k|                        yaml::skip_inline_ws(it, end);
 5046|   389k|                        if (!parse_map_value(val)) [[unlikely]]
 5047|   389k|                           return false;
 5048|   389k|                     }
 5049|       |
 5050|   389k|                     value.emplace(std::move(key), std::move(val));
 5051|   389k|                     return true;
 5052|   389k|                  }
 5053|       |
 5054|   389k|                  key_t key{};
 5055|   389k|                  if constexpr (std::same_as<std::remove_cvref_t<key_t>, std::string>) {
 5056|   389k|                     auto key_probe = it;
 5057|   389k|                     yaml::skip_inline_ws(key_probe, end);
 5058|   389k|                     const bool complex_flow_key = (key_probe != end && (*key_probe == '[' || *key_probe == '{'));
 5059|   389k|                     if (complex_flow_key) {
 5060|   389k|                        glz::generic key_node{};
 5061|   389k|                        from<YAML, glz::generic>::template op<yaml::flow_context_on<Opts>()>(key_node, ctx, it, end);
 5062|   389k|                        if (bool(ctx.error)) [[unlikely]]
 5063|   389k|                           return false;
 5064|   389k|                        if (!yaml::materialize_key(key, key_node, ctx)) [[unlikely]]
 5065|   389k|                           return false;
 5066|   389k|                     }
 5067|   389k|                     else {
 5068|   389k|                        if (!yaml::parse_yaml_key(key, ctx, it, end, false)) {
 5069|   389k|                           return false;
 5070|   389k|                        }
 5071|   389k|                     }
 5072|   389k|                  }
 5073|   389k|                  else {
 5074|   389k|                     from<YAML, key_t>::template op<Opts>(key, ctx, it, end);
 5075|   389k|                     if (bool(ctx.error)) [[unlikely]]
 5076|   389k|                        return false;
 5077|   389k|                  }
 5078|       |
 5079|   389k|                  yaml::skip_inline_ws(it, end);
 5080|       |
 5081|   389k|                  if (it == end || *it != ':') {
 5082|   389k|                     ctx.error = error_code::syntax_error;
 5083|   389k|                     return false;
 5084|   389k|                  }
 5085|   389k|                  ++it;
 5086|   389k|                  yaml::skip_inline_ws(it, end);
 5087|       |
 5088|   389k|                  val_t val{};
 5089|   389k|                  if (!parse_map_value(val)) [[unlikely]]
 5090|   389k|                     return false;
 5091|       |
 5092|   389k|                  value.emplace(std::move(key), std::move(val));
 5093|   389k|                  return true;
 5094|   389k|               });
 5095|   389k|         }
 5096|       |
 5097|   415k|         yaml::finalize_node_anchor(preamble.node_props, ctx, it);
 5098|   415k|      }
_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|   423k|      {
  466|   423k|         skip_inline_ws(it, end);
  467|       |
  468|   423k|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (468:14): [True: 3, False: 423k]
  ------------------
  469|      3|            if constexpr (!AllowEmptyInput) {
  470|      3|               ctx.error = error_code::unexpected_end;
  471|      3|            }
  472|      3|            return true;
  473|      3|         }
  474|       |
  475|   423k|         preamble.tag = parse_yaml_tag(it, end, ctx);
  476|   423k|         if (preamble.tag == yaml_tag::unknown) [[unlikely]] {
  ------------------
  |  Branch (476:14): [True: 3, False: 423k]
  ------------------
  477|      3|            ctx.error = error_code::syntax_error;
  478|      3|            return true;
  479|      3|         }
  480|   423k|         if (!tag_validator(preamble.tag)) [[unlikely]] {
  ------------------
  |  Branch (480:14): [True: 2, False: 423k]
  ------------------
  481|      2|            ctx.error = error_code::syntax_error;
  482|      2|            return true;
  483|      2|         }
  484|       |
  485|   423k|         skip_inline_ws(it, end);
  486|       |
  487|   423k|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (487:14): [True: 2, False: 423k]
  ------------------
  488|      2|            if constexpr (!AllowEmptyInput) {
  489|      2|               ctx.error = error_code::unexpected_end;
  490|      2|            }
  491|      2|            return true;
  492|      2|         }
  493|       |
  494|   423k|         if (parse_node_properties<Opts, PropertyPolicy>(std::forward<T>(value), ctx, it, end, preamble.node_props)) {
  ------------------
  |  Branch (494:14): [True: 2.18k, False: 421k]
  ------------------
  495|  2.18k|            return true;
  496|  2.18k|         }
  497|       |
  498|   421k|         return false;
  499|   423k|      }
_ZZN3glz4fromILj450ENS_17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES1_EEEEE2opITnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1EEERPKcRS5_TkNS_10is_contextERNS_4yaml12yaml_contextESA_EEvOT1_OT2_OT0_T3_ENKUlNSD_8yaml_tagEE_clESN_:
 4521|   423k|                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|   423k|      {
  409|   423k|         state.has_anchor = false;
  410|   423k|         state.anchor_name.clear();
  411|   423k|         state.anchor_start = nullptr;
  412|   423k|         state.anchor_indent = ctx.current_indent();
  413|       |
  414|   423k|         if constexpr (Policy.allow_alias) {
  415|   423k|            if constexpr (Policy.alias_can_be_mapping_key) {
  416|   423k|               if (!alias_token_is_mapping_key(it, end)) {
  ------------------
  |  Branch (416:20): [True: 417k, False: 6.12k]
  ------------------
  417|   417k|                  if (handle_alias<Opts>(std::forward<T>(value), ctx, it, end)) return true;
  ------------------
  |  Branch (417:23): [True: 2.15k, False: 415k]
  ------------------
  418|   417k|               }
  419|       |            }
  420|       |            else {
  421|       |               if (handle_alias<Opts>(std::forward<T>(value), ctx, it, end)) return true;
  422|       |            }
  423|   423k|         }
  424|       |
  425|   423k|         if (it != end && *it == '&') {
  ------------------
  |  Branch (425:14): [True: 421k, False: 2.15k]
  |  Branch (425:27): [True: 27.2k, False: 393k]
  ------------------
  426|  27.2k|            ++it;
  427|  27.2k|            auto name = parse_anchor_name(it, end);
  428|  27.2k|            if (name.empty()) {
  ------------------
  |  Branch (428:17): [True: 11, False: 27.2k]
  ------------------
  429|     11|               ctx.error = error_code::syntax_error;
  430|     11|               return true;
  431|     11|            }
  432|  27.2k|            skip_inline_ws(it, end);
  433|  27.2k|            if (it == end) {
  ------------------
  |  Branch (433:17): [True: 24, False: 27.2k]
  ------------------
  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|  27.2k|            state.has_anchor = true;
  446|  27.2k|            state.anchor_name = std::string(name);
  447|  27.2k|            state.anchor_start = &*it;
  448|  27.2k|         }
  449|       |
  450|   423k|         return false;
  451|   423k|      }
_ZN3glz4yaml12handle_aliasITnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1EEERNS_17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES3_EEEENS0_12yaml_contextEPKcSB_EEbOT0_RT1_RT2_T3_:
  300|   417k|      {
  301|   417k|         if (it == end || *it != '*') return false;
  ------------------
  |  Branch (301:14): [True: 0, False: 417k]
  |  Branch (301:27): [True: 415k, False: 2.15k]
  ------------------
  302|       |
  303|  2.15k|         ++it; // skip '*'
  304|  2.15k|         auto name = parse_anchor_name(it, end);
  305|  2.15k|         if (name.empty()) {
  ------------------
  |  Branch (305:14): [True: 5, False: 2.14k]
  ------------------
  306|      5|            ctx.error = error_code::syntax_error;
  307|      5|            return true;
  308|      5|         }
  309|       |
  310|  2.14k|         auto anchor_it = ctx.anchors.find(name);
  311|  2.14k|         if (anchor_it == ctx.anchors.end()) {
  ------------------
  |  Branch (311:14): [True: 23, False: 2.12k]
  ------------------
  312|     23|            ctx.error = error_code::syntax_error; // undefined alias
  313|     23|            return true;
  314|     23|         }
  315|       |
  316|       |         // Copied rather than referenced: the replay below can replace ctx.anchors wholesale
  317|       |         // (a speculative parse hands its own map back), which would dangle a reference here.
  318|  2.12k|         const auto span = anchor_it->second;
  319|       |
  320|       |         // Empty anchor span (anchor on null/empty node) — leave value as default
  321|  2.12k|         if (span.begin == span.end) {
  ------------------
  |  Branch (321:14): [True: 627, False: 1.49k]
  ------------------
  322|    627|            return true;
  323|    627|         }
  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.49k|         if (ctx.alias_span_is_replaying(span.begin, span.end)) [[unlikely]] {
  ------------------
  |  Branch (328:14): [True: 17, False: 1.48k]
  ------------------
  329|     17|            ctx.error = error_code::syntax_error; // cyclic alias
  330|     17|            return true;
  331|     17|         }
  332|       |
  333|       |         // Replaying an anchor re-enters the reader directly, bypassing the variant reader's
  334|       |         // depth guard, so this is the only depth accounting a chain of aliases into a
  335|       |         // non-variant target gets. The cycle check above stops the unbounded case; this bounds
  336|       |         // a legitimate but deeply chained one.
  337|  1.48k|         depth_guard guard{ctx, yaml::max_yaml_recursive_depth};
  338|  1.48k|         if (!guard) [[unlikely]]
  ------------------
  |  Branch (338:14): [True: 1, False: 1.48k]
  ------------------
  339|      1|            return true;
  340|       |
  341|  1.48k|         if (!ctx.charge_alias_expansion(static_cast<size_t>(span.end - span.begin))) [[unlikely]] {
  ------------------
  |  Branch (341:14): [True: 0, False: 1.48k]
  ------------------
  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.48k|         auto replay_it = span.begin;
  348|  1.48k|         auto replay_end = span.end;
  349|       |
  350|       |         // Save indent context and set up for replay
  351|  1.48k|         auto saved_indent_stack = std::move(ctx.indent_stack);
  352|  1.48k|         ctx.indent_stack.clear();
  353|  1.48k|         if (span.base_indent > 0) {
  ------------------
  |  Branch (353:14): [True: 1.05k, False: 421]
  ------------------
  354|  1.05k|            ctx.push_indent(span.base_indent - 1);
  355|  1.05k|         }
  356|       |
  357|  1.48k|         ctx.active_alias_spans.emplace_back(span.begin, span.end);
  358|       |
  359|  1.48k|         using V = std::remove_cvref_t<T>;
  360|  1.48k|         from<YAML, V>::template op<Opts>(std::forward<T>(value), ctx, replay_it, replay_end);
  361|       |
  362|  1.48k|         ctx.active_alias_spans.pop_back();
  363|       |
  364|       |         // Restore indent context
  365|  1.48k|         ctx.indent_stack = std::move(saved_indent_stack);
  366|  1.48k|         return true;
  367|  1.48k|      }
_ZN3glz4yaml40inline_value_has_plain_mapping_indicatorIPKcS3_EEbT_T0_:
 3036|  3.94M|      {
 3037|  3.94M|         const auto stop = yaml::implicit_key_scan_end(pos, end);
 3038|  3.94M|         int flow_depth = 0;
 3039|  43.3M|         while (pos != stop) {
  ------------------
  |  Branch (3039:17): [True: 43.0M, False: 207k]
  ------------------
 3040|  43.0M|            const char c = *pos;
 3041|  43.0M|            if (c == '\n' || c == '\r' || c == '#') return false;
  ------------------
  |  Branch (3041:17): [True: 1.02M, False: 42.0M]
  |  Branch (3041:30): [True: 216k, False: 41.8M]
  |  Branch (3041:43): [True: 1.57M, False: 40.2M]
  ------------------
 3042|  40.2M|            if (c == '"' || c == '\'') {
  ------------------
  |  Branch (3042:17): [True: 162k, False: 40.1M]
  |  Branch (3042:29): [True: 159k, False: 39.9M]
  ------------------
 3043|   321k|               const char quote = c;
 3044|   321k|               ++pos;
 3045|  14.8M|               while (pos != stop && *pos != quote) {
  ------------------
  |  Branch (3045:23): [True: 14.8M, False: 67.3k]
  |  Branch (3045:38): [True: 14.5M, False: 254k]
  ------------------
 3046|  14.5M|                  if (*pos == '\\' && quote == '"') {
  ------------------
  |  Branch (3046:23): [True: 218k, False: 14.3M]
  |  Branch (3046:39): [True: 189k, False: 28.7k]
  ------------------
 3047|   189k|                     ++pos;
 3048|   189k|                     if (pos != stop) ++pos;
  ------------------
  |  Branch (3048:26): [True: 186k, False: 3.57k]
  ------------------
 3049|   189k|                  }
 3050|  14.3M|                  else {
 3051|  14.3M|                     ++pos;
 3052|  14.3M|                  }
 3053|  14.5M|               }
 3054|   321k|               if (pos != stop) ++pos;
  ------------------
  |  Branch (3054:20): [True: 254k, False: 67.3k]
  ------------------
 3055|   321k|               continue;
 3056|   321k|            }
 3057|  39.9M|            if (c == '[' || c == '{') {
  ------------------
  |  Branch (3057:17): [True: 164k, False: 39.7M]
  |  Branch (3057:29): [True: 697k, False: 39.0M]
  ------------------
 3058|   862k|               ++flow_depth;
 3059|   862k|               ++pos;
 3060|   862k|               continue;
 3061|   862k|            }
 3062|  39.0M|            if ((c == ']' || c == '}') && flow_depth > 0) {
  ------------------
  |  Branch (3062:18): [True: 87.1k, False: 39.0M]
  |  Branch (3062:30): [True: 392k, False: 38.6M]
  |  Branch (3062:43): [True: 231k, False: 247k]
  ------------------
 3063|   231k|               --flow_depth;
 3064|   231k|               ++pos;
 3065|   231k|               continue;
 3066|   231k|            }
 3067|  38.8M|            if (c == ':' && flow_depth == 0) {
  ------------------
  |  Branch (3067:17): [True: 1.33M, False: 37.5M]
  |  Branch (3067:29): [True: 924k, False: 406k]
  ------------------
 3068|   924k|               const auto next = pos + 1;
 3069|   924k|               return (next == end) || *next == ' ' || *next == '\t' || *next == '\n' || *next == '\r';
  ------------------
  |  Branch (3069:23): [True: 5.04k, False: 919k]
  |  Branch (3069:40): [True: 324k, False: 595k]
  |  Branch (3069:56): [True: 11.3k, False: 583k]
  |  Branch (3069:73): [True: 18.4k, False: 565k]
  |  Branch (3069:90): [True: 36.5k, False: 528k]
  ------------------
 3070|   924k|            }
 3071|  37.9M|            ++pos;
 3072|  37.9M|         }
 3073|   207k|         return false;
 3074|  3.94M|      }
_ZN3glz4yaml32validate_flow_node_adjacent_tailINS0_12yaml_contextEPKcS4_EEvRT_RT0_T1_:
  937|  6.41M|      {
  938|  6.41M|         if (it == end) return;
  ------------------
  |  Branch (938:14): [True: 2.29M, False: 4.11M]
  ------------------
  939|  4.11M|         const char c = *it;
  940|       |         // After a flow collection closes, the next character must be a structural
  941|       |         // separator or whitespace/comment. Adjacent plain content is malformed.
  942|  4.11M|         if (c == ' ' || c == '\t' || c == '\n' || c == '\r' || c == '#' || c == ',' || c == ']' || c == '}' ||
  ------------------
  |  Branch (942:14): [True: 517k, False: 3.60M]
  |  Branch (942:26): [True: 138k, False: 3.46M]
  |  Branch (942:39): [True: 99.2k, False: 3.36M]
  |  Branch (942:52): [True: 239k, False: 3.12M]
  |  Branch (942:65): [True: 50.3k, False: 3.07M]
  |  Branch (942:77): [True: 2.56M, False: 509k]
  |  Branch (942:89): [True: 45.0k, False: 464k]
  |  Branch (942:101): [True: 126k, False: 337k]
  ------------------
  943|  4.11M|             c == ':') {
  ------------------
  |  Branch (943:14): [True: 335k, False: 2.53k]
  ------------------
  944|  4.11M|            return;
  945|  4.11M|         }
  946|  2.53k|         ctx.error = error_code::syntax_error;
  947|  2.53k|      }
_ZN3glz4yaml20finalize_node_anchorINS0_12yaml_contextEPKcEEvRNS0_19node_property_stateERT_T0_:
  455|  25.8M|      {
  456|  25.8M|         if (state.has_anchor && !bool(ctx.error)) {
  ------------------
  |  Branch (456:14): [True: 426k, False: 25.4M]
  |  Branch (456:34): [True: 398k, False: 27.6k]
  ------------------
  457|   398k|            ctx.anchors[std::move(state.anchor_name)] = {state.anchor_start, &*it, state.anchor_indent};
  458|   398k|         }
  459|  25.8M|      }
_ZN3glz4yaml25skip_flow_ws_and_newlinesINS0_12yaml_contextEPKcS4_EEvRT_RT0_T1_Pb:
  859|  56.2M|      {
  860|  56.2M|         bool at_line_start = false;
  861|  56.2M|         bool saw_separation_ws = false;
  862|  56.2M|         bool line_has_indent = false;
  863|  82.8M|         while (it != end) {
  ------------------
  |  Branch (863:17): [True: 82.1M, False: 665k]
  ------------------
  864|  82.1M|            if (*it == ' ') {
  ------------------
  |  Branch (864:17): [True: 12.4M, False: 69.7M]
  ------------------
  865|  12.4M|               ++it;
  866|  12.4M|               saw_separation_ws = true;
  867|  12.4M|               if (at_line_start) line_has_indent = true;
  ------------------
  |  Branch (867:20): [True: 5.36M, False: 7.08M]
  ------------------
  868|  12.4M|               continue;
  869|  12.4M|            }
  870|  69.7M|            if (*it == '\t') {
  ------------------
  |  Branch (870:17): [True: 4.46M, False: 65.2M]
  ------------------
  871|  4.46M|               if (at_line_start && !line_has_indent) {
  ------------------
  |  Branch (871:20): [True: 375k, False: 4.09M]
  |  Branch (871:37): [True: 65.0k, False: 310k]
  ------------------
  872|  65.0k|                  auto probe = it;
  873|   272k|                  while (probe != end && (*probe == ' ' || *probe == '\t')) ++probe;
  ------------------
  |  Branch (873:26): [True: 265k, False: 7.55k]
  |  Branch (873:43): [True: 42.2k, False: 222k]
  |  Branch (873:60): [True: 165k, False: 57.5k]
  ------------------
  874|  65.0k|                  if (probe != end && *probe != '\n' && *probe != '\r' && *probe != '#') {
  ------------------
  |  Branch (874:23): [True: 57.5k, False: 7.55k]
  |  Branch (874:39): [True: 50.6k, False: 6.80k]
  |  Branch (874:57): [True: 24.7k, False: 25.9k]
  |  Branch (874:75): [True: 21.5k, False: 3.27k]
  ------------------
  875|  21.5k|                     const char c = *probe;
  876|  21.5k|                     const bool allowed_flow_delim = (c == ']' || c == '}' || c == '[' || c == '{' || c == ',');
  ------------------
  |  Branch (876:55): [True: 2.41k, False: 19.0k]
  |  Branch (876:67): [True: 1.43k, False: 17.6k]
  |  Branch (876:79): [True: 70, False: 17.5k]
  |  Branch (876:91): [True: 520, False: 17.0k]
  |  Branch (876:103): [True: 16.9k, False: 166]
  ------------------
  877|  21.5k|                     if (!allowed_flow_delim) {
  ------------------
  |  Branch (877:26): [True: 166, False: 21.3k]
  ------------------
  878|    166|                        ctx.error = error_code::syntax_error;
  879|    166|                        return;
  880|    166|                     }
  881|  21.5k|                  }
  882|  65.0k|               }
  883|  4.46M|               ++it;
  884|  4.46M|               saw_separation_ws = true;
  885|  4.46M|               if (at_line_start) line_has_indent = true;
  ------------------
  |  Branch (885:20): [True: 375k, False: 4.09M]
  ------------------
  886|  4.46M|               continue;
  887|  4.46M|            }
  888|  65.2M|            if (*it == '\n' || *it == '\r') {
  ------------------
  |  Branch (888:17): [True: 2.92M, False: 62.3M]
  |  Branch (888:32): [True: 6.06M, False: 56.2M]
  ------------------
  889|  8.99M|               skip_newline(it, end);
  890|  8.99M|               if (saw_line_break) *saw_line_break = true;
  ------------------
  |  Branch (890:20): [True: 105k, False: 8.88M]
  ------------------
  891|  8.99M|               at_line_start = true;
  892|  8.99M|               saw_separation_ws = true;
  893|  8.99M|               line_has_indent = false;
  894|  8.99M|               continue;
  895|  8.99M|            }
  896|  56.2M|            if (*it == '#') {
  ------------------
  |  Branch (896:17): [True: 688k, False: 55.5M]
  ------------------
  897|       |               // In flow style, comments require separation from the previous token.
  898|       |               // Allow comment-only lines and comments after inline whitespace, but
  899|       |               // reject adjacency forms like ",#comment" (CVW2).
  900|   688k|               bool separated_by_prev_ws = false;
  901|   688k|               if constexpr (std::is_pointer_v<std::decay_t<It>>) {
  902|   688k|                  if (ctx.stream_begin && it > ctx.stream_begin) {
  ------------------
  |  Branch (902:23): [True: 688k, False: 0]
  |  Branch (902:43): [True: 688k, False: 0]
  ------------------
  903|   688k|                     const char prev = *(it - 1);
  904|   688k|                     separated_by_prev_ws = (prev == ' ' || prev == '\t');
  ------------------
  |  Branch (904:46): [True: 449k, False: 239k]
  |  Branch (904:61): [True: 20.2k, False: 218k]
  ------------------
  905|   688k|                  }
  906|   688k|               }
  907|   688k|               if (!(at_line_start || saw_separation_ws || separated_by_prev_ws)) {
  ------------------
  |  Branch (907:22): [True: 515k, False: 173k]
  |  Branch (907:39): [True: 29.5k, False: 143k]
  |  Branch (907:60): [True: 117k, False: 26.3k]
  ------------------
  908|  26.3k|                  break;
  909|  26.3k|               }
  910|   662k|               skip_comment(it, end);
  911|   662k|               if (it != end && (*it == '\n' || *it == '\r')) {
  ------------------
  |  Branch (911:20): [True: 653k, False: 9.44k]
  |  Branch (911:34): [True: 400k, False: 252k]
  |  Branch (911:49): [True: 252k, False: 0]
  ------------------
  912|   653k|                  skip_newline(it, end);
  913|   653k|                  if (saw_line_break) *saw_line_break = true;
  ------------------
  |  Branch (913:23): [True: 978, False: 652k]
  ------------------
  914|   653k|                  at_line_start = true;
  915|   653k|                  saw_separation_ws = true;
  916|   653k|                  continue;
  917|   653k|               }
  918|  9.44k|               continue;
  919|   662k|            }
  920|       |
  921|       |            // In block context, multiline flow nodes require indentation on content
  922|       |            // continuation lines (except structural tokens).
  923|  55.5M|            if (at_line_start && ctx.current_indent() >= 0 && !line_has_indent) {
  ------------------
  |  Branch (923:17): [True: 7.65M, False: 47.8M]
  |  Branch (923:34): [True: 371k, False: 7.28M]
  |  Branch (923:63): [True: 170k, False: 201k]
  ------------------
  924|   170k|               const char c = *it;
  925|   170k|               const bool structural = (c == ']' || c == '}' || c == ',');
  ------------------
  |  Branch (925:41): [True: 10.1k, False: 160k]
  |  Branch (925:53): [True: 4.05k, False: 156k]
  |  Branch (925:65): [True: 155k, False: 658]
  ------------------
  926|   170k|               if (!structural) {
  ------------------
  |  Branch (926:20): [True: 658, False: 169k]
  ------------------
  927|    658|                  ctx.error = error_code::syntax_error;
  928|    658|                  return;
  929|    658|               }
  930|   170k|            }
  931|  55.5M|            break;
  932|  55.5M|         }
  933|  56.2M|      }
_ZN3glz4fromILj450ENS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEEE2opITnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1ELb0ELb0ELb0ELb0ELj1EEERS4_TkNS_10is_contextERNS_4yaml12yaml_contextERPKcSD_EEvOT0_OT1_OT2_T3_:
  274|  3.06M|      {
  275|  3.06M|         using V = std::decay_t<decltype(get_member(std::declval<Value>(), meta_wrapper_v<T>))>;
  276|  3.06M|         from<YAML, V>::template op<Opts>(get_member(std::forward<Value>(value), meta_wrapper_v<T>),
  277|  3.06M|                                          std::forward<Ctx>(ctx), std::forward<It0>(it), end);
  278|  3.06M|      }
_ZN3glz4fromILj450ENSt3__17variantIJDndNS1_12basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEbNS1_6vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS6_ISD_EEEENSC_ISD_EEEEEE2opITnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1ELb0ELb0ELb0ELb0ELj1EEERPKcRSH_TkNS_10is_contextERNS_4yaml12yaml_contextESM_EEvOT1_OT2_OT0_T3_:
 5635|  4.48M|      {
 5636|       |         // Inside op() rather than at class scope: read_supported is `requires { from<Format, T>{}; }`,
 5637|       |         // so a class-scope assert turns that feature probe into a hard error instead of `false`.
 5638|  4.48M|         static_assert(content_v<std::remove_cvref_t<T>>.empty(),
 5639|  4.48M|                       "Adjacent variant tagging (glz::meta `content`) is implemented for JSON and "
 5640|  4.48M|                       "BEVE but not yet for YAML. Reading this variant as YAML would silently expect "
 5641|  4.48M|                       "the internally tagged shape, so it is rejected here instead.");
 5642|  4.48M|         if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (5642:14): [True: 0, False: 4.48M]
  ------------------
 5643|      0|            return;
 5644|       |
 5645|       |         // Every nested generic/variant value routes back through this reader, so bounding
 5646|       |         // depth here caps flow-collection and flow-embedded mapping recursion that the
 5647|       |         // indent stack does not cover.
 5648|  4.48M|         depth_guard guard{ctx, yaml::max_yaml_recursive_depth};
 5649|  4.48M|         if (!guard) [[unlikely]]
  ------------------
  |  Branch (5649:14): [True: 37, False: 4.48M]
  ------------------
 5650|     37|            return;
 5651|       |
 5652|       |         // At root level (indent == -1), skip leading whitespace, newlines, and comments
 5653|       |         // For nested values, only skip inline whitespace to preserve block structure
 5654|  4.48M|         if (ctx.current_indent() < 0) {
  ------------------
  |  Branch (5654:14): [True: 3.60M, False: 878k]
  ------------------
 5655|  3.60M|            yaml::skip_ws_newlines_comments(it, end);
 5656|  3.60M|         }
 5657|   878k|         else {
 5658|   878k|            yaml::skip_inline_ws(it, end);
 5659|   878k|         }
 5660|       |
 5661|  4.48M|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (5661:14): [True: 769, False: 4.48M]
  ------------------
 5662|    769|            ctx.error = error_code::unexpected_end;
 5663|    769|            return;
 5664|    769|         }
 5665|       |
 5666|       |         // Tagged variants: a discriminator key (meta::tag) selects the alternative, with the
 5667|       |         // matching meta::ids entry naming each type. This mirrors the JSON behavior so the
 5668|       |         // same variant definitions round-trip across both formats.
 5669|       |         if constexpr (not tag_v<std::remove_cvref_t<T>>.empty()) {
 5670|       |            using V = std::remove_cvref_t<T>;
 5671|       |            const bool value_is_mapping =
 5672|       |               (*it == '{') || (!yaml::check_flow_context(Opts) && yaml::line_could_be_block_mapping(it, end));
 5673|       |            if (value_is_mapping) {
 5674|       |               // The mapping's keys sit at the column of `it`. Recover that column from the buffer:
 5675|       |               // the indent stack carries the parent context's indent (a struct member, a sequence
 5676|       |               // item, etc. each push a different offset), not this mapping's true column (see helper).
 5677|       |               const int32_t mapping_column = tagged_mapping_visual_indent(ctx, it, ctx.current_indent() + 1);
 5678|       |               auto tag_ctx = ctx.make_speculative();
 5679|       |               const size_t index = scan_variant_tag_index<V, Opts>(tag_ctx, it, end, mapping_column);
 5680|       |               ctx.alias_expansion_budget = tag_ctx.alias_expansion_budget; // charged even if no tag matched
 5681|       |               ctx.key_expansion_budget = tag_ctx.key_expansion_budget;
 5682|       |               if (index < ids_v<V>.size()) {
 5683|       |                  static constexpr auto tag_literal = string_literal_from_view<tag_v<V>.size()>(tag_v<V>);
 5684|       |                  emplace_runtime_variant(value, index);
 5685|       |                  // Establish the mapping's true column on the indent stack for the alternative parse.
 5686|       |                  // The chosen object is then parsed - and the discriminator's inline value skipped -
 5687|       |                  // at a consistent indent in every context, so a tag on the first key does not fold
 5688|       |                  // the following sibling entries into its value (no special-casing needed downstream).
 5689|       |                  if (!ctx.push_indent(mapping_column)) [[unlikely]] {
 5690|       |                     ctx.error = error_code::exceeded_max_recursive_depth;
 5691|       |                     return;
 5692|       |                  }
 5693|       |                  std::visit(
 5694|       |                     [&](auto&& alt) {
 5695|       |                        using Alt = std::remove_cvref_t<decltype(alt)>;
 5696|       |                        if constexpr ((glaze_object_t<Alt> || reflectable<Alt>) && not custom_read<Alt>) {
 5697|       |                           // Parse the mapping into the resolved struct; the tag key is skipped.
 5698|       |                           from<YAML, Alt>::template op<Opts, tag_literal>(alt, ctx, it, end);
 5699|       |                        }
 5700|       |                        else if constexpr (custom_read<Alt>) {
 5701|       |                           // Custom alternatives read the mapping body themselves and cannot skip an
 5702|       |                           // interior tag key the way reflected objects do, so the tag must be the
 5703|       |                           // first key (glaze always writes it first). Consume that leading "tag: id"
 5704|       |                           // entry, then hand the remaining mapping to the custom handler.
 5705|       |                           if constexpr (yaml::check_flow_context(Opts)) {
 5706|       |                              ctx.error = error_code::feature_not_supported;
 5707|       |                              ctx.custom_error_message =
 5708|       |                                 "custom variant alternatives are not supported in YAML flow style";
 5709|       |                           }
 5710|       |                           else {
 5711|       |                              ctx.scratch.clear();
 5712|       |                              if (yaml::parse_yaml_key(ctx.scratch, ctx, it, end, false)) {
 5713|       |                                 if (std::string_view{ctx.scratch} != tag_v<V>) {
 5714|       |                                    ctx.error = error_code::feature_not_supported;
 5715|       |                                    ctx.custom_error_message =
 5716|       |                                       "the tag must be the first key for a custom variant alternative";
 5717|       |                                 }
 5718|       |                                 else {
 5719|       |                                    yaml::skip_inline_ws(it, end);
 5720|       |                                    if (it == end || *it != ':') {
 5721|       |                                       ctx.error = error_code::syntax_error;
 5722|       |                                    }
 5723|       |                                    else {
 5724|       |                                       ++it;
 5725|       |                                       yaml::skip_inline_ws(it, end);
 5726|       |                                       yaml::skip_unknown_block_value<Opts>(ctx, it, end, mapping_column);
 5727|       |                                       if (!bool(ctx.error)) {
 5728|       |                                          // If nothing but trailing whitespace/comments remains, the tag
 5729|       |                                          // was the whole mapping: leave the alternative default.
 5730|       |                                          auto probe = it;
 5731|       |                                          yaml::skip_ws_newlines_comments(probe, end);
 5732|       |                                          if (probe == end) {
 5733|       |                                             it = probe;
 5734|       |                                          }
 5735|       |                                          else {
 5736|       |                                             // Publish the mapping's column so the custom handler's block
 5737|       |                                             // mapping (which would otherwise discover its own indent) reads
 5738|       |                                             // the remaining entries at the variant's indent and dedents
 5739|       |                                             // correctly in every context (root, sequence, nested).
 5740|       |                                             ctx.forced_block_mapping_indent = mapping_column;
 5741|       |                                             from<YAML, Alt>::template op<Opts>(alt, ctx, it, end);
 5742|       |                                             ctx.forced_block_mapping_indent = -1;
 5743|       |                                          }
 5744|       |                                       }
 5745|       |                                    }
 5746|       |                                 }
 5747|       |                              }
 5748|       |                           }
 5749|       |                        }
 5750|       |                        else {
 5751|       |                           // Non-object alternative (e.g. std::monostate): the emplaced default is
 5752|       |                           // the value, but the mapping must still be consumed.
 5753|       |                           walk_tagged_mapping<Opts>(
 5754|       |                              ctx, it, end, tag_v<V>, mapping_column,
 5755|       |                              [&](auto&& c, auto&& i, auto&& e, int32_t line_indent, bool in_flow) {
 5756|       |                                 yaml::skip_yaml_value<Opts>(c, i, e, in_flow ? 0 : line_indent, in_flow);
 5757|       |                              });
 5758|       |                        }
 5759|       |                     },
 5760|       |                     value);
 5761|       |                  ctx.pop_indent();
 5762|       |                  return;
 5763|       |               }
 5764|       |               // No resolvable tag key was found. Fall through to structural deduction:
 5765|       |               // if the alternatives are distinguishable by their fields this still succeeds,
 5766|       |               // otherwise the deduction path reports no_matching_variant_type.
 5767|       |            }
 5768|       |         }
 5769|       |
 5770|  4.48M|         if constexpr (yaml_variant_is_auto_deducible<std::remove_cvref_t<T>>()) {
 5771|  4.48M|            using V = std::remove_cvref_t<T>;
 5772|  4.48M|            using counts = yaml_variant_type_count<V>;
 5773|  4.48M|            const char c = *it;
 5774|  4.48M|            auto is_plain_scalar_boundary = [](const char ch) {
 5775|  4.48M|               switch (ch) {
 5776|  4.48M|               case ' ':
 5777|  4.48M|               case '\t':
 5778|  4.48M|               case '\n':
 5779|  4.48M|               case '\r':
 5780|  4.48M|               case ',':
 5781|  4.48M|               case ']':
 5782|  4.48M|               case '}':
 5783|  4.48M|                  return true;
 5784|  4.48M|               default:
 5785|  4.48M|                  return false;
 5786|  4.48M|               }
 5787|  4.48M|            };
 5788|       |
 5789|  4.48M|            auto has_indented_block_continuation = [&](auto word_end) {
 5790|  4.48M|               if constexpr (yaml::check_flow_context(Opts)) {
 5791|  4.48M|                  return false;
 5792|  4.48M|               }
 5793|  4.48M|               if (ctx.current_indent() < 0) {
 5794|  4.48M|                  return false;
 5795|  4.48M|               }
 5796|  4.48M|               if (word_end == end || (*word_end != '\n' && *word_end != '\r')) {
 5797|  4.48M|                  return false;
 5798|  4.48M|               }
 5799|       |
 5800|  4.48M|               auto look = word_end;
 5801|  4.48M|               yaml::skip_newline(look, end);
 5802|  4.48M|               while (look != end) {
 5803|  4.48M|                  int32_t line_indent = 0;
 5804|  4.48M|                  while (look != end && *look == ' ') {
 5805|  4.48M|                     ++line_indent;
 5806|  4.48M|                     ++look;
 5807|  4.48M|                  }
 5808|  4.48M|                  if (look != end && *look == '\t') {
 5809|  4.48M|                     return false;
 5810|  4.48M|                  }
 5811|  4.48M|                  if (look == end || *look == '\n' || *look == '\r') {
 5812|  4.48M|                     if (look != end) {
 5813|  4.48M|                        yaml::skip_newline(look, end);
 5814|  4.48M|                        continue;
 5815|  4.48M|                     }
 5816|  4.48M|                     return false;
 5817|  4.48M|                  }
 5818|  4.48M|                  if (*look == '#') {
 5819|  4.48M|                     yaml::skip_comment(look, end);
 5820|  4.48M|                     if (look != end && (*look == '\n' || *look == '\r')) {
 5821|  4.48M|                        yaml::skip_newline(look, end);
 5822|  4.48M|                        continue;
 5823|  4.48M|                     }
 5824|  4.48M|                     return false;
 5825|  4.48M|                  }
 5826|       |
 5827|       |                  // If the next non-empty line is an implicit mapping entry,
 5828|       |                  // don't treat it as scalar continuation for auto-deduced
 5829|       |                  // booleans/nulls.
 5830|  4.48M|                  {
 5831|  4.48M|                     auto scan = look;
 5832|  4.48M|                     while (scan != end && *scan != '\n' && *scan != '\r') {
 5833|  4.48M|                        if (*scan == ':') {
 5834|  4.48M|                           auto after_colon = scan + 1;
 5835|  4.48M|                           if (after_colon == end || *after_colon == ' ' || *after_colon == '\t' ||
 5836|  4.48M|                               *after_colon == '\n' || *after_colon == '\r') {
 5837|  4.48M|                              return false;
 5838|  4.48M|                           }
 5839|  4.48M|                        }
 5840|  4.48M|                        ++scan;
 5841|  4.48M|                     }
 5842|  4.48M|                  }
 5843|       |
 5844|  4.48M|                  return line_indent > ctx.current_indent();
 5845|  4.48M|               }
 5846|  4.48M|               return false;
 5847|  4.48M|            };
 5848|  4.48M|            auto is_word_boundary = [&](const auto ptr) {
 5849|  4.48M|               if (ptr == end) {
 5850|  4.48M|                  return true;
 5851|  4.48M|               }
 5852|  4.48M|               if (*ptr == ':') {
 5853|  4.48M|                  auto next = ptr + 1;
 5854|  4.48M|                  return (next == end) || *next == ' ' || *next == '\t' || *next == '\n' || *next == '\r';
 5855|  4.48M|               }
 5856|  4.48M|               return is_plain_scalar_boundary(*ptr);
 5857|  4.48M|            };
 5858|       |
 5859|  4.48M|            switch (c) {
 5860|   817k|            case '&': {
  ------------------
  |  Branch (5860:13): [True: 817k, False: 3.66M]
  ------------------
 5861|       |               // Anchor before value: parse name, then re-dispatch
 5862|   817k|               ++it;
 5863|   817k|               auto aname = yaml::parse_anchor_name(it, end);
 5864|   817k|               if (aname.empty()) {
  ------------------
  |  Branch (5864:20): [True: 108, False: 817k]
  ------------------
 5865|    108|                  ctx.error = error_code::syntax_error;
 5866|    108|                  return;
 5867|    108|               }
 5868|   817k|               yaml::skip_inline_ws(it, end);
 5869|   817k|               bool anchor_on_same_line = true;
 5870|   817k|               bool value_is_indentless_sequence = false;
 5871|   817k|               if (it == end || *it == '\n' || *it == '\r' || *it == '#') {
  ------------------
  |  Branch (5871:20): [True: 4.51k, False: 812k]
  |  Branch (5871:33): [True: 33.7k, False: 778k]
  |  Branch (5871:48): [True: 58.9k, False: 719k]
  |  Branch (5871:63): [True: 13.0k, False: 706k]
  ------------------
 5872|       |                  // Anchor followed by end-of-line. Check if the value continues on the
 5873|       |                  // next line (indented past current context) or if this is an empty node.
 5874|   110k|                  bool value_on_next_line = false;
 5875|   110k|                  if (it != end) {
  ------------------
  |  Branch (5875:23): [True: 105k, False: 4.51k]
  ------------------
 5876|   105k|                     auto peek = it;
 5877|       |                     // Skip comment if present
 5878|   105k|                     if (*peek == '#') {
  ------------------
  |  Branch (5878:26): [True: 13.0k, False: 92.6k]
  ------------------
 5879|   266k|                        while (peek != end && *peek != '\n' && *peek != '\r') ++peek;
  ------------------
  |  Branch (5879:32): [True: 266k, False: 28]
  |  Branch (5879:47): [True: 260k, False: 5.24k]
  |  Branch (5879:64): [True: 253k, False: 7.80k]
  ------------------
 5880|  13.0k|                     }
 5881|       |                     // Skip newline
 5882|   105k|                     if (peek != end && (*peek == '\n' || *peek == '\r')) {
  ------------------
  |  Branch (5882:26): [True: 105k, False: 28]
  |  Branch (5882:42): [True: 38.9k, False: 66.7k]
  |  Branch (5882:59): [True: 66.7k, False: 0]
  ------------------
 5883|   105k|                        yaml::skip_newline(peek, end);
 5884|       |                        // Skip blank lines
 5885|   148k|                        while (peek != end && (*peek == '\n' || *peek == '\r')) {
  ------------------
  |  Branch (5885:32): [True: 146k, False: 1.73k]
  |  Branch (5885:48): [True: 27.5k, False: 118k]
  |  Branch (5885:65): [True: 14.7k, False: 103k]
  ------------------
 5886|  42.3k|                           yaml::skip_newline(peek, end);
 5887|  42.3k|                        }
 5888|       |                        // Measure indent of next content line
 5889|   105k|                        int32_t next_indent = 0;
 5890|   168k|                        while (peek != end && *peek == ' ') {
  ------------------
  |  Branch (5890:32): [True: 166k, False: 1.96k]
  |  Branch (5890:47): [True: 62.9k, False: 103k]
  ------------------
 5891|  62.9k|                           ++next_indent;
 5892|  62.9k|                           ++peek;
 5893|  62.9k|                        }
 5894|   105k|                        if (peek != end && *peek != '\n' && *peek != '\r') {
  ------------------
  |  Branch (5894:29): [True: 103k, False: 1.96k]
  |  Branch (5894:44): [True: 100k, False: 3.10k]
  |  Branch (5894:61): [True: 100k, False: 636]
  ------------------
 5895|   100k|                           const bool indentless_sequence =
 5896|   100k|                              (!ctx.sequence_item_value_context) && (*peek == '-') &&
  ------------------
  |  Branch (5896:31): [True: 98.3k, False: 1.67k]
  |  Branch (5896:69): [True: 47.6k, False: 50.7k]
  ------------------
 5897|  47.6k|                              ((peek + 1) == end ||
  ------------------
  |  Branch (5897:32): [True: 586, False: 47.0k]
  ------------------
 5898|  47.0k|                               yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*(peek + 1))]) &&
  ------------------
  |  Branch (5898:32): [True: 45.8k, False: 1.18k]
  ------------------
 5899|  46.4k|                              (next_indent == ctx.current_indent() ||
  ------------------
  |  Branch (5899:32): [True: 2.92k, False: 43.5k]
  ------------------
 5900|  43.5k|                               (ctx.current_indent() > 0 && (next_indent + 1) == ctx.current_indent()));
  ------------------
  |  Branch (5900:33): [True: 6.23k, False: 37.3k]
  |  Branch (5900:61): [True: 5.73k, False: 496]
  ------------------
 5901|   100k|                           value_is_indentless_sequence = indentless_sequence;
 5902|   100k|                           const bool same_indent_property_node =
 5903|   100k|                              (next_indent == ctx.current_indent()) &&
  ------------------
  |  Branch (5903:31): [True: 12.9k, False: 87.1k]
  ------------------
 5904|  12.9k|                              (*peek == '!' || *peek == '&' || *peek == '*' || *peek == '[' || *peek == '{' ||
  ------------------
  |  Branch (5904:32): [True: 541, False: 12.3k]
  |  Branch (5904:48): [True: 353, False: 12.0k]
  |  Branch (5904:64): [True: 119, False: 11.8k]
  |  Branch (5904:80): [True: 270, False: 11.6k]
  |  Branch (5904:96): [True: 415, False: 11.2k]
  ------------------
 5905|  11.2k|                               *peek == '"' || *peek == '\'' || *peek == '|' || *peek == '>');
  ------------------
  |  Branch (5905:32): [True: 860, False: 10.3k]
  |  Branch (5905:48): [True: 376, False: 9.96k]
  |  Branch (5905:65): [True: 352, False: 9.61k]
  |  Branch (5905:81): [True: 492, False: 9.12k]
  ------------------
 5906|   100k|                           value_on_next_line =
 5907|   100k|                              (next_indent > ctx.current_indent()) || indentless_sequence || same_indent_property_node;
  ------------------
  |  Branch (5907:31): [True: 78.5k, False: 21.5k]
  |  Branch (5907:71): [True: 8.66k, False: 12.8k]
  |  Branch (5907:94): [True: 3.77k, False: 9.07k]
  ------------------
 5908|   100k|                        }
 5909|   105k|                     }
 5910|   105k|                  }
 5911|   110k|                  if (!value_on_next_line) {
  ------------------
  |  Branch (5911:23): [True: 19.3k, False: 90.9k]
  ------------------
 5912|       |                     // Anchor on empty/null node — store empty span, leave value as default
 5913|  19.3k|                     ctx.anchors[std::string(aname)] = {&*it, &*it, ctx.current_indent()};
 5914|  19.3k|                     return;
 5915|  19.3k|                  }
 5916|       |                  // Value is on next line — advance past newline/blank lines to the content
 5917|  90.9k|                  if (*it == '#') {
  ------------------
  |  Branch (5917:23): [True: 12.3k, False: 78.5k]
  ------------------
 5918|   254k|                     while (it != end && *it != '\n' && *it != '\r') ++it;
  ------------------
  |  Branch (5918:29): [True: 254k, False: 0]
  |  Branch (5918:42): [True: 249k, False: 5.03k]
  |  Branch (5918:57): [True: 241k, False: 7.35k]
  ------------------
 5919|  12.3k|                  }
 5920|  90.9k|                  if (it != end) yaml::skip_newline(it, end);
  ------------------
  |  Branch (5920:23): [True: 90.9k, False: 0]
  ------------------
 5921|   125k|                  while (it != end && (*it == '\n' || *it == '\r')) {
  ------------------
  |  Branch (5921:26): [True: 125k, False: 0]
  |  Branch (5921:40): [True: 23.4k, False: 101k]
  |  Branch (5921:55): [True: 10.9k, False: 90.9k]
  ------------------
 5922|  34.3k|                     yaml::skip_newline(it, end);
 5923|  34.3k|                  }
 5924|  90.9k|                  yaml::skip_inline_ws(it, end);
 5925|  90.9k|                  anchor_on_same_line = false;
 5926|  90.9k|               }
 5927|       |
 5928|       |               if constexpr (!yaml::check_flow_context(Opts)) {
 5929|       |                  if (anchor_on_same_line && *it == '-' &&
 5930|       |                      ((it + 1) == end || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*(it + 1))])) {
 5931|       |                     // "&anchor - item" is malformed in block context.
 5932|       |                     ctx.error = error_code::syntax_error;
 5933|       |                     return;
 5934|       |                  }
 5935|       |               }
 5936|       |
 5937|       |               // Anchor on alias (&anchor *alias) is invalid per YAML spec.
 5938|       |               // But alias-as-key (&anchor *alias : value) is valid.
 5939|   797k|               if (it != end && *it == '*' && !yaml::alias_token_is_mapping_key(it, end)) {
  ------------------
  |  Branch (5939:20): [True: 797k, False: 7]
  |  Branch (5939:33): [True: 543, False: 797k]
  |  Branch (5939:47): [True: 40, False: 503]
  ------------------
 5940|     40|                  ctx.error = error_code::syntax_error;
 5941|     40|                  return;
 5942|     40|               }
 5943|       |
 5944|       |               if constexpr (!yaml::check_flow_context(Opts)) {
 5945|       |                  if (!anchor_on_same_line && it != end && *it == '&') {
 5946|       |                     auto probe = it + 1;
 5947|       |                     auto nested_anchor_name = yaml::parse_anchor_name(probe, end);
 5948|       |                     if (nested_anchor_name.empty()) {
 5949|       |                        ctx.error = error_code::syntax_error;
 5950|       |                        return;
 5951|       |                     }
 5952|       |                     yaml::skip_inline_ws(probe, end);
 5953|       |                     // Allow nested anchor usage only when it clearly starts a
 5954|       |                     // nested mapping entry ("&k key: value"). Otherwise this is
 5955|       |                     // a second anchor on the same node (4JVG-style), which is invalid.
 5956|       |                     if (!yaml::line_could_be_block_mapping(probe, end)) {
 5957|       |                        ctx.error = error_code::syntax_error;
 5958|       |                        return;
 5959|       |                     }
 5960|       |                  }
 5961|       |               }
 5962|       |
 5963|   797k|               const char* anchor_start = &*it;
 5964|   797k|               const int32_t anchor_indent = ctx.current_indent();
 5965|       |
 5966|       |               if constexpr (!yaml::check_flow_context(Opts)) {
 5967|       |                  // Check if the anchor is on a block-mapping key (&name key: value).
 5968|       |                  // Only when the anchor and key are on the SAME line — if the value was on the
 5969|       |                  // next line, the anchor applies to the entire next-line content.
 5970|       |                  if (anchor_on_same_line && yaml::line_could_be_block_mapping(it, end)) {
 5971|       |                     auto key_start = it;
 5972|       |                     if (*key_start == '!') {
 5973|       |                        const auto key_tag = yaml::parse_yaml_tag(key_start, end, ctx);
 5974|       |                        if (key_tag == yaml::yaml_tag::unknown || !yaml::tag_valid_for_string(key_tag)) {
 5975|       |                           ctx.error = error_code::syntax_error;
 5976|       |                           return;
 5977|       |                        }
 5978|       |                        yaml::skip_inline_ws(key_start, end);
 5979|       |                        if (key_start == end) {
 5980|       |                           ctx.error = error_code::unexpected_end;
 5981|       |                           return;
 5982|       |                        }
 5983|       |                        if (*key_start == '\n' || *key_start == '\r') {
 5984|       |                           ctx.error = error_code::syntax_error;
 5985|       |                           return;
 5986|       |                        }
 5987|       |
 5988|       |                        // Re-apply the anchor-on-alias rule now that the tag is consumed. The
 5989|       |                        // check above ran before the tag, so "&anchor !tag *alias" reached the
 5990|       |                        // key-span registration below while the untagged spelling was rejected;
 5991|       |                        // an alias node carries no other properties either way.
 5992|       |                        if (*key_start == '*' && !yaml::alias_token_is_mapping_key(key_start, end)) {
 5993|       |                           ctx.error = error_code::syntax_error;
 5994|       |                           return;
 5995|       |                        }
 5996|       |                     }
 5997|       |
 5998|       |                     // Find the key span by scanning to the key-value separator
 5999|       |                     auto key_scan = key_start;
 6000|       |                     auto key_end = key_start;
 6001|       |                     if (*key_scan == '"' || *key_scan == '\'') {
 6002|       |                        // Quoted key: skip to closing quote
 6003|       |                        const char quote = *key_scan;
 6004|       |                        ++key_scan;
 6005|       |                        while (key_scan != end && *key_scan != quote) {
 6006|       |                           if (*key_scan == '\\' && quote == '"') {
 6007|       |                              ++key_scan;
 6008|       |                              if (key_scan != end) ++key_scan;
 6009|       |                           }
 6010|       |                           else {
 6011|       |                              ++key_scan;
 6012|       |                           }
 6013|       |                        }
 6014|       |                        if (key_scan == end) {
 6015|       |                           ctx.error = error_code::syntax_error;
 6016|       |                           return;
 6017|       |                        }
 6018|       |                        ++key_scan; // past closing quote
 6019|       |                        key_end = key_scan;
 6020|       |                        yaml::skip_inline_ws(key_scan, end);
 6021|       |                     }
 6022|       |                     else {
 6023|       |                        // Plain key: scan to ':'
 6024|       |                        while (key_scan != end) {
 6025|       |                           if (*key_scan == ':') {
 6026|       |                              auto next = key_scan + 1;
 6027|       |                              if (next == end || *next == ' ' || *next == '\t' || *next == '\n' || *next == '\r') {
 6028|       |                                 break;
 6029|       |                              }
 6030|       |                           }
 6031|       |                           ++key_scan;
 6032|       |                        }
 6033|       |                        key_end = key_scan;
 6034|       |                        while (key_end != key_start && (*(key_end - 1) == ' ' || *(key_end - 1) == '\t')) {
 6035|       |                           --key_end;
 6036|       |                        }
 6037|       |                     }
 6038|       |                     if (key_scan == end || *key_scan != ':') {
 6039|       |                        ctx.error = error_code::syntax_error;
 6040|       |                        return;
 6041|       |                     }
 6042|       |                     // Store anchor with just the key text span
 6043|       |                     ctx.anchors[std::string(aname)] = {&*key_start, &*key_end, anchor_indent};
 6044|       |                     it = key_start;
 6045|       |                     // Parse as an object alternative so complex keys (e.g. flow collections) stay in mapping context.
 6046|       |                     if constexpr (counts::n_object > 0) {
 6047|       |                        process_yaml_variant_alternatives<V, is_yaml_variant_object>::template op<Opts>(value, ctx, it,
 6048|       |                                                                                                        end);
 6049|       |                     }
 6050|       |                     else {
 6051|       |                        from<YAML, V>::template op<Opts>(value, ctx, it, end);
 6052|       |                     }
 6053|       |                     return;
 6054|       |                  }
 6055|       |               }
 6056|       |
 6057|   797k|               const bool prev_allow_indentless_sequence = ctx.allow_indentless_sequence;
 6058|   797k|               ctx.allow_indentless_sequence = value_is_indentless_sequence;
 6059|   797k|               from<YAML, V>::template op<Opts>(value, ctx, it, end);
 6060|   797k|               ctx.allow_indentless_sequence = prev_allow_indentless_sequence;
 6061|   797k|               if (!bool(ctx.error)) {
  ------------------
  |  Branch (6061:20): [True: 788k, False: 9.48k]
  ------------------
 6062|   788k|                  ctx.anchors[std::string(aname)] = {anchor_start, &*it, anchor_indent};
 6063|   788k|               }
 6064|   797k|               return;
 6065|   797k|            }
 6066|   585k|            case '*': {
  ------------------
  |  Branch (6066:13): [True: 585k, False: 3.89M]
  ------------------
 6067|       |               // In block context, "*alias : value" starts a mapping with an alias key.
 6068|       |               if constexpr (!yaml::check_flow_context(Opts)) {
 6069|       |                  if (yaml::alias_token_is_mapping_key(it, end)) {
 6070|       |                     if constexpr (counts::n_object > 0) {
 6071|       |                        process_yaml_variant_alternatives<V, is_yaml_variant_object>::template op<Opts>(value, ctx, it,
 6072|       |                                                                                                        end);
 6073|       |                        return;
 6074|       |                     }
 6075|       |                     else {
 6076|       |                        ctx.error = error_code::syntax_error;
 6077|       |                        return;
 6078|       |                     }
 6079|       |                  }
 6080|       |               }
 6081|       |
 6082|       |               // Alias value: look up anchor and replay
 6083|   585k|               yaml::handle_alias<Opts>(value, ctx, it, end);
 6084|   585k|               return;
 6085|   797k|            }
 6086|   204k|            case '!': {
  ------------------
  |  Branch (6086:13): [True: 204k, False: 4.27M]
  ------------------
 6087|       |               // Tag - parse it and dispatch based on tag type
 6088|   204k|               const auto tag = yaml::parse_yaml_tag(it, end, ctx);
 6089|   204k|               if (tag == yaml::yaml_tag::unknown) {
  ------------------
  |  Branch (6089:20): [True: 50, False: 204k]
  ------------------
 6090|     50|                  ctx.error = error_code::syntax_error;
 6091|     50|                  return;
 6092|     50|               }
 6093|   204k|               yaml::skip_inline_ws(it, end);
 6094|   204k|               if (it != end && *it == '#') {
  ------------------
  |  Branch (6094:20): [True: 203k, False: 922]
  |  Branch (6094:33): [True: 8.38k, False: 194k]
  ------------------
 6095|  8.38k|                  yaml::skip_comment(it, end);
 6096|  8.38k|               }
 6097|   204k|               if (it != end && (*it == '\n' || *it == '\r')) {
  ------------------
  |  Branch (6097:20): [True: 202k, False: 1.30k]
  |  Branch (6097:34): [True: 30.7k, False: 172k]
  |  Branch (6097:49): [True: 21.4k, False: 150k]
  ------------------
 6098|  52.1k|                  auto content = it;
 6099|  52.1k|                  yaml::skip_newline(content, end);
 6100|  52.1k|                  yaml::skip_to_content(content, end);
 6101|       |
 6102|  52.1k|                  bool consume_following_content = false;
 6103|  52.1k|                  auto content_token = content;
 6104|  52.1k|                  if (content != end) {
  ------------------
  |  Branch (6104:23): [True: 50.8k, False: 1.33k]
  ------------------
 6105|  50.8k|                     auto indent_probe = content;
 6106|  50.8k|                     const int32_t content_indent = yaml::measure_indent<false>(indent_probe, end, ctx);
 6107|  50.8k|                     if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (6107:26): [True: 3, False: 50.8k]
  ------------------
 6108|      3|                        return;
 6109|  50.8k|                     content_token = indent_probe;
 6110|       |
 6111|       |                     // A tag at the end of a sequence/map entry has an empty value
 6112|       |                     // unless the next non-empty content is nested under the current node.
 6113|  50.8k|                     bool tagged_indentless_sequence = false;
 6114|  50.8k|                     if (tag == yaml::yaml_tag::seq && indent_probe != end && *indent_probe == '-') {
  ------------------
  |  Branch (6114:26): [True: 8.08k, False: 42.7k]
  |  Branch (6114:56): [True: 8.08k, False: 0]
  |  Branch (6114:79): [True: 7.06k, False: 1.02k]
  ------------------
 6115|  7.06k|                        const auto after_dash = indent_probe + 1;
 6116|  7.06k|                        if (after_dash == end ||
  ------------------
  |  Branch (6116:29): [True: 337, False: 6.72k]
  ------------------
 6117|  6.72k|                            yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*after_dash)]) {
  ------------------
  |  Branch (6117:29): [True: 3.14k, False: 3.57k]
  ------------------
 6118|  3.48k|                           tagged_indentless_sequence =
 6119|  3.48k|                              (content_indent == ctx.current_indent()) ||
  ------------------
  |  Branch (6119:31): [True: 404, False: 3.08k]
  ------------------
 6120|  3.08k|                              (ctx.current_indent() > 0 && (content_indent + 1) == ctx.current_indent());
  ------------------
  |  Branch (6120:32): [True: 436, False: 2.64k]
  |  Branch (6120:60): [True: 315, False: 121]
  ------------------
 6121|  3.48k|                        }
 6122|  7.06k|                     }
 6123|       |
 6124|  50.8k|                     consume_following_content = (ctx.current_indent() < 0) ||
  ------------------
  |  Branch (6124:50): [True: 29.1k, False: 21.7k]
  ------------------
 6125|  21.7k|                                                 (content_indent > ctx.current_indent()) || tagged_indentless_sequence;
  ------------------
  |  Branch (6125:50): [True: 4.86k, False: 16.8k]
  |  Branch (6125:93): [True: 719, False: 16.1k]
  ------------------
 6126|  50.8k|                  }
 6127|       |
 6128|  52.1k|                  if (consume_following_content) {
  ------------------
  |  Branch (6128:23): [True: 34.7k, False: 17.4k]
  ------------------
 6129|  34.7k|                     it = content_token;
 6130|  34.7k|                  }
 6131|  17.4k|                  else {
 6132|  17.4k|                     if (tag == yaml::yaml_tag::str) {
  ------------------
  |  Branch (6132:26): [True: 931, False: 16.5k]
  ------------------
 6133|    931|                        if constexpr (counts::n_str > 0) {
 6134|    931|                           constexpr auto first_idx = yaml_variant_first_index_v<V, is_yaml_variant_str>;
 6135|    931|                           using StrType = std::variant_alternative_t<first_idx, V>;
 6136|    931|                           value = StrType{};
 6137|    931|                           return;
 6138|    931|                        }
 6139|    931|                     }
 6140|  17.4k|                     if (tag == yaml::yaml_tag::null_tag) {
  ------------------
  |  Branch (6140:26): [True: 341, False: 17.1k]
  ------------------
 6141|    341|                        if constexpr (counts::n_null > 0) {
 6142|    341|                           constexpr auto first_idx = yaml_variant_first_index_v<V, is_yaml_variant_null>;
 6143|    341|                           using NullType = std::variant_alternative_t<first_idx, V>;
 6144|    341|                           if (!std::holds_alternative<NullType>(value)) value = NullType{};
  ------------------
  |  Branch (6144:32): [True: 0, False: 341]
  ------------------
 6145|    341|                           return;
 6146|    341|                        }
 6147|    341|                     }
 6148|  17.4k|                     if (tag == yaml::yaml_tag::none) {
  ------------------
  |  Branch (6148:26): [True: 14.4k, False: 3.02k]
  ------------------
 6149|  14.4k|                        if constexpr (counts::n_null > 0) {
 6150|  14.4k|                           constexpr auto first_idx = yaml_variant_first_index_v<V, is_yaml_variant_null>;
 6151|  14.4k|                           using NullType = std::variant_alternative_t<first_idx, V>;
 6152|  14.4k|                           if (!std::holds_alternative<NullType>(value)) value = NullType{};
  ------------------
  |  Branch (6152:32): [True: 0, False: 14.4k]
  ------------------
 6153|  14.4k|                           return;
 6154|  14.4k|                        }
 6155|  14.4k|                     }
 6156|  17.4k|                  }
 6157|  52.1k|               }
 6158|       |               if constexpr (!yaml::check_flow_context(Opts)) {
 6159|       |                  // In block context, a comma immediately after a tag token is malformed
 6160|       |                  // (e.g., "!!str, value"). Flow context has legitimate ", ] }" usage.
 6161|       |                  if (it != end && *it == ',') {
 6162|       |                     ctx.error = error_code::syntax_error;
 6163|       |                     return;
 6164|       |                  }
 6165|       |                  if constexpr (counts::n_object > 0) {
 6166|       |                     // Tagged keys like "!!str key: value" must parse as mappings.
 6167|       |                     const bool starts_block_sequence_entry =
 6168|       |                        (it != end && *it == '-') &&
 6169|       |                        ((it + 1) == end || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*(it + 1))]);
 6170|       |                     if (!starts_block_sequence_entry && yaml::line_could_be_block_mapping(it, end)) {
 6171|       |                        // Re-dispatch from the post-tag token so '&key key: val' is
 6172|       |                        // handled by the anchor-aware key path, not as a map-level anchor.
 6173|       |                        from<YAML, V>::template op<Opts>(value, ctx, it, end);
 6174|       |                        return;
 6175|       |                     }
 6176|       |                  }
 6177|       |               }
 6178|   204k|               if (it == end) {
  ------------------
  |  Branch (6178:20): [True: 1.30k, False: 202k]
  ------------------
 6179|  1.30k|                  if (tag == yaml::yaml_tag::str) {
  ------------------
  |  Branch (6179:23): [True: 280, False: 1.02k]
  ------------------
 6180|    280|                     if constexpr (counts::n_str > 0) {
 6181|    280|                        constexpr auto first_idx = yaml_variant_first_index_v<V, is_yaml_variant_str>;
 6182|    280|                        using StrType = std::variant_alternative_t<first_idx, V>;
 6183|    280|                        value = StrType{};
 6184|    280|                        return;
 6185|    280|                     }
 6186|    280|                  }
 6187|  1.30k|                  if (tag == yaml::yaml_tag::none) {
  ------------------
  |  Branch (6187:23): [True: 1.01k, False: 290]
  ------------------
 6188|  1.01k|                     if constexpr (counts::n_null > 0) {
 6189|  1.01k|                        constexpr auto first_idx = yaml_variant_first_index_v<V, is_yaml_variant_null>;
 6190|  1.01k|                        using NullType = std::variant_alternative_t<first_idx, V>;
 6191|  1.01k|                        if (!std::holds_alternative<NullType>(value)) value = NullType{};
  ------------------
  |  Branch (6191:29): [True: 0, False: 1.01k]
  ------------------
 6192|  1.01k|                        return;
 6193|  1.01k|                     }
 6194|  1.01k|                  }
 6195|      0|                  ctx.error = error_code::unexpected_end;
 6196|  1.30k|                  return;
 6197|  1.30k|               }
 6198|   202k|               switch (tag) {
 6199|  1.13k|               case yaml::yaml_tag::str:
  ------------------
  |  Branch (6199:16): [True: 1.13k, False: 201k]
  ------------------
 6200|  1.13k|                  process_yaml_variant_alternatives<V, is_yaml_variant_str>::template op<Opts>(value, ctx, it, end);
 6201|  1.13k|                  return;
 6202|  9.76k|               case yaml::yaml_tag::int_tag:
  ------------------
  |  Branch (6202:16): [True: 9.76k, False: 193k]
  ------------------
 6203|  9.93k|               case yaml::yaml_tag::float_tag:
  ------------------
  |  Branch (6203:16): [True: 174, False: 202k]
  ------------------
 6204|  9.93k|                  if constexpr (counts::n_num > 0) {
 6205|  9.93k|                     process_yaml_variant_alternatives<V, is_yaml_variant_num>::template op<Opts>(value, ctx, it, end);
 6206|  9.93k|                     return;
 6207|       |                  }
 6208|       |                  else { // else used to fix MSVC unreachable code warning
 6209|       |                     ctx.error = error_code::syntax_error;
 6210|       |                     return;
 6211|       |                  }
 6212|  26.8k|               case yaml::yaml_tag::bool_tag:
  ------------------
  |  Branch (6212:16): [True: 16.9k, False: 185k]
  ------------------
 6213|  26.8k|                  if constexpr (counts::n_bool > 0) {
 6214|  26.8k|                     process_yaml_variant_alternatives<V, is_yaml_variant_bool>::template op<Opts>(value, ctx, it, end);
 6215|  26.8k|                     return;
 6216|       |                  }
 6217|       |                  else { // else used to fix MSVC unreachable code warning
 6218|       |                     ctx.error = error_code::syntax_error;
 6219|       |                     return;
 6220|       |                  }
 6221|  27.4k|               case yaml::yaml_tag::null_tag:
  ------------------
  |  Branch (6221:16): [True: 600, False: 202k]
  ------------------
 6222|  27.4k|                  if constexpr (counts::n_null > 0) {
 6223|  27.4k|                     constexpr auto first_idx = yaml_variant_first_index_v<V, is_yaml_variant_null>;
 6224|  27.4k|                     using NullType = std::variant_alternative_t<first_idx, V>;
 6225|  27.4k|                     if (!std::holds_alternative<NullType>(value)) value = NullType{};
  ------------------
  |  Branch (6225:26): [True: 0, False: 27.4k]
  ------------------
 6226|  27.4k|                     from<YAML, NullType>::template op<Opts>(std::get<NullType>(value), ctx, it, end);
 6227|  27.4k|                     return;
 6228|       |                  }
 6229|       |                  else { // else used to fix MSVC unreachable code warning
 6230|       |                     ctx.error = error_code::syntax_error;
 6231|       |                     return;
 6232|       |                  }
 6233|  55.8k|               case yaml::yaml_tag::map:
  ------------------
  |  Branch (6233:16): [True: 28.4k, False: 174k]
  ------------------
 6234|  55.8k|                  if constexpr (counts::n_object > 0) {
 6235|  55.8k|                     process_yaml_variant_alternatives<V, is_yaml_variant_object>::template op<Opts>(value, ctx, it,
 6236|  55.8k|                                                                                                     end);
 6237|  55.8k|                     return;
 6238|       |                  }
 6239|       |                  else { // else used to fix MSVC unreachable code warning
 6240|       |                     ctx.error = error_code::syntax_error;
 6241|       |                     return;
 6242|       |                  }
 6243|  83.7k|               case yaml::yaml_tag::seq:
  ------------------
  |  Branch (6243:16): [True: 27.8k, False: 174k]
  ------------------
 6244|  83.7k|                  if constexpr (counts::n_array > 0) {
 6245|  83.7k|                     const bool prev_allow_indentless_sequence = ctx.allow_indentless_sequence;
 6246|       |                     if constexpr (!yaml::check_flow_context(Opts)) {
 6247|       |                        if (it != end && *it == '-') {
 6248|       |                           ctx.allow_indentless_sequence = true;
 6249|       |                        }
 6250|       |                     }
 6251|  83.7k|                     process_yaml_variant_alternatives<V, is_yaml_variant_array>::template op<Opts>(value, ctx, it,
 6252|  83.7k|                                                                                                    end);
 6253|  83.7k|                     ctx.allow_indentless_sequence = prev_allow_indentless_sequence;
 6254|  83.7k|                     return;
 6255|       |                  }
 6256|       |                  else { // else used to fix MSVC unreachable code warning
 6257|       |                     ctx.error = error_code::syntax_error;
 6258|       |                     return;
 6259|       |                  }
 6260|   185k|               default: {
  ------------------
  |  Branch (6260:16): [True: 102k, False: 100k]
  ------------------
 6261|       |                  // Explicit unknown/non-core tags disable implicit scalar resolution.
 6262|       |                  // Preserve collection kinds, otherwise treat as string content.
 6263|   185k|                  if (it != end && *it == '*') {
  ------------------
  |  Branch (6263:23): [True: 102k, False: 83.7k]
  |  Branch (6263:36): [True: 32.9k, False: 69.2k]
  ------------------
 6264|  32.9k|                     yaml::handle_alias<Opts>(value, ctx, it, end);
 6265|  32.9k|                     return;
 6266|  32.9k|                  }
 6267|       |
 6268|   152k|                  if constexpr (counts::n_array > 0) {
 6269|   152k|                     if (it != end && *it == '[') {
  ------------------
  |  Branch (6269:26): [True: 69.2k, False: 83.7k]
  |  Branch (6269:39): [True: 2.91k, False: 66.2k]
  ------------------
 6270|  2.91k|                        process_yaml_variant_alternatives<V, is_yaml_variant_array>::template op<Opts>(value, ctx, it,
 6271|  2.91k|                                                                                                       end);
 6272|  2.91k|                        return;
 6273|  2.91k|                     }
 6274|   152k|                  }
 6275|   152k|                  if constexpr (counts::n_object > 0) {
 6276|   152k|                     if (it != end && *it == '{') {
  ------------------
  |  Branch (6276:26): [True: 66.2k, False: 86.7k]
  |  Branch (6276:39): [True: 11.2k, False: 55.0k]
  ------------------
 6277|  11.2k|                        process_yaml_variant_alternatives<V, is_yaml_variant_object>::template op<Opts>(value, ctx, it,
 6278|  11.2k|                                                                                                        end);
 6279|  11.2k|                        return;
 6280|  11.2k|                     }
 6281|   152k|                  }
 6282|       |
 6283|       |                  if constexpr (!yaml::check_flow_context(Opts)) {
 6284|       |                     if constexpr (counts::n_array > 0) {
 6285|       |                        const bool starts_block_sequence_entry =
 6286|       |                           (it != end && *it == '-') &&
 6287|       |                           ((it + 1) == end || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*(it + 1))]);
 6288|       |                        if (starts_block_sequence_entry) {
 6289|       |                           process_yaml_variant_alternatives<V, is_yaml_variant_array>::template op<Opts>(value, ctx,
 6290|       |                                                                                                          it, end);
 6291|       |                           return;
 6292|       |                        }
 6293|       |                     }
 6294|       |                     if constexpr (counts::n_object > 0) {
 6295|       |                        const bool starts_explicit_mapping_indicator =
 6296|       |                           (it != end && (*it == '?' || *it == ':')) &&
 6297|       |                           ((it + 1) == end || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*(it + 1))]);
 6298|       |                        if (starts_explicit_mapping_indicator) {
 6299|       |                           process_yaml_variant_alternatives<V, is_yaml_variant_object>::template op<Opts>(value, ctx,
 6300|       |                                                                                                           it, end);
 6301|       |                           return;
 6302|       |                        }
 6303|       |                        if (yaml::line_could_be_block_mapping(it, end)) {
 6304|       |                           process_yaml_variant_alternatives<V, is_yaml_variant_object>::template op<Opts>(value, ctx,
 6305|       |                                                                                                           it, end);
 6306|       |                           return;
 6307|       |                        }
 6308|       |                     }
 6309|       |                  }
 6310|       |
 6311|   152k|                  if constexpr (counts::n_str > 0) {
 6312|   152k|                     process_yaml_variant_alternatives<V, is_yaml_variant_str>::template op<Opts>(value, ctx, it, end);
 6313|   152k|                     return;
 6314|   152k|                  }
 6315|       |
 6316|       |                  // Fall back if no string alternative exists.
 6317|      0|                  from<YAML, V>::template op<Opts>(value, ctx, it, end);
 6318|   152k|                  return;
 6319|   185k|               }
 6320|   202k|               }
 6321|      0|               return;
 6322|   202k|            }
 6323|   802k|            case '{':
  ------------------
  |  Branch (6323:13): [True: 802k, False: 3.67M]
  ------------------
 6324|       |               if constexpr (!yaml::check_flow_context(Opts)) {
 6325|       |                  // In block context, "{...}: value" can be a complex mapping key.
 6326|       |                  if (ctx.current_indent() < 0 && yaml::line_could_be_block_mapping(it, end)) {
 6327|       |                     process_yaml_variant_alternatives<V, is_yaml_variant_object>::template op<Opts>(value, ctx, it,
 6328|       |                                                                                                     end);
 6329|       |                     return;
 6330|       |                  }
 6331|       |               }
 6332|       |               // Flow mapping - object type
 6333|   802k|               process_yaml_variant_alternatives<V, is_yaml_variant_object>::template op<Opts>(value, ctx, it, end);
 6334|   802k|               return;
 6335|  53.6k|            case '[':
  ------------------
  |  Branch (6335:13): [True: 53.6k, False: 4.42M]
  ------------------
 6336|       |               if constexpr (!yaml::check_flow_context(Opts)) {
 6337|       |                  // In block context, "[...]: value" can be a complex mapping key.
 6338|       |                  if (ctx.current_indent() < 0 && yaml::line_could_be_block_mapping(it, end)) {
 6339|       |                     process_yaml_variant_alternatives<V, is_yaml_variant_object>::template op<Opts>(value, ctx, it,
 6340|       |                                                                                                     end);
 6341|       |                     return;
 6342|       |                  }
 6343|       |               }
 6344|       |               // Flow sequence - array type
 6345|  53.6k|               process_yaml_variant_alternatives<V, is_yaml_variant_array>::template op<Opts>(value, ctx, it, end);
 6346|  53.6k|               return;
 6347|   179k|            case '?':
  ------------------
  |  Branch (6347:13): [True: 179k, False: 4.30M]
  ------------------
 6348|       |               // Explicit mapping key indicator ("? key")
 6349|   179k|               if ((end - it >= 2) && it[1] == '\t') {
  ------------------
  |  Branch (6349:20): [True: 177k, False: 2.07k]
  |  Branch (6349:39): [True: 3, False: 177k]
  ------------------
 6350|      3|                  ctx.error = error_code::syntax_error;
 6351|      3|                  return;
 6352|      3|               }
 6353|   179k|               if ((end - it >= 2) && (it[1] == ' ' || it[1] == '\n' || it[1] == '\r')) {
  ------------------
  |  Branch (6353:20): [True: 177k, False: 2.07k]
  |  Branch (6353:40): [True: 57.8k, False: 119k]
  |  Branch (6353:56): [True: 76.7k, False: 42.8k]
  |  Branch (6353:73): [True: 16.6k, False: 26.1k]
  ------------------
 6354|   151k|                  if constexpr (counts::n_object > 0) {
 6355|   151k|                     process_yaml_variant_alternatives<V, is_yaml_variant_object>::template op<Opts>(value, ctx, it,
 6356|   151k|                                                                                                     end);
 6357|   151k|                     return;
 6358|   151k|                  }
 6359|   151k|               }
 6360|      0|               parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6361|   179k|               return;
 6362|    111|            case '%':
  ------------------
  |  Branch (6362:13): [True: 111, False: 4.48M]
  ------------------
 6363|       |               // Reserved directive indicator is not a plain scalar start.
 6364|    111|               ctx.error = error_code::syntax_error;
 6365|    111|               return;
 6366|  5.96k|            case '"':
  ------------------
  |  Branch (6366:13): [True: 5.96k, False: 4.47M]
  ------------------
 6367|  12.1k|            case '\'':
  ------------------
  |  Branch (6367:13): [True: 6.15k, False: 4.47M]
  ------------------
 6368|       |               // Could be a quoted string OR a quoted key in a block mapping
 6369|       |               // Try block mapping first (e.g., "key": value), then fall back to string
 6370|  12.1k|               parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6371|  12.1k|               return;
 6372|  34.1k|            case 't':
  ------------------
  |  Branch (6372:13): [True: 34.1k, False: 4.44M]
  ------------------
 6373|  39.9k|            case 'T':
  ------------------
  |  Branch (6373:13): [True: 5.82k, False: 4.47M]
  ------------------
 6374|       |               // Could be "true", "True", "TRUE", or a key/string starting with t/T
 6375|  39.9k|               if constexpr (counts::n_bool > 0) {
 6376|  39.9k|                  if ((end - it >= 4) && ((it[1] == 'r' && it[2] == 'u' && it[3] == 'e') ||
  ------------------
  |  Branch (6376:23): [True: 39.4k, False: 533]
  |  Branch (6376:44): [True: 27.4k, False: 11.9k]
  |  Branch (6376:60): [True: 21.1k, False: 6.33k]
  |  Branch (6376:76): [True: 18.2k, False: 2.84k]
  ------------------
 6377|  21.1k|                                          (it[1] == 'R' && it[2] == 'U' && it[3] == 'E'))) {
  ------------------
  |  Branch (6377:44): [True: 6.20k, False: 14.9k]
  |  Branch (6377:60): [True: 2.21k, False: 3.98k]
  |  Branch (6377:76): [True: 1.04k, False: 1.17k]
  ------------------
 6378|       |                     // Check what follows the word "true"
 6379|  19.3k|                     const auto after_true = it + 4;
 6380|  19.3k|                     const bool at_word_boundary = is_word_boundary(after_true);
 6381|       |
 6382|  19.3k|                     if (at_word_boundary) {
  ------------------
  |  Branch (6382:26): [True: 12.0k, False: 7.30k]
  ------------------
 6383|  12.0k|                        if (has_indented_block_continuation(after_true)) {
  ------------------
  |  Branch (6383:29): [True: 0, False: 12.0k]
  ------------------
 6384|      0|                           parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6385|      0|                           return;
 6386|      0|                        }
 6387|       |                        // Check if this is a key (followed by ": ") rather than a boolean value
 6388|       |                        // "true: value" should parse as {true: value}, not as the boolean true
 6389|  12.0k|                        if ((end - it > 4) && it[4] == ':' &&
  ------------------
  |  Branch (6389:29): [True: 9.84k, False: 2.15k]
  |  Branch (6389:47): [True: 7.45k, False: 2.39k]
  ------------------
 6390|  7.45k|                            (end - it == 5 || it[5] == ' ' || it[5] == '\t' || it[5] == '\n' || it[5] == '\r')) {
  ------------------
  |  Branch (6390:30): [True: 2.41k, False: 5.03k]
  |  Branch (6390:47): [True: 3.38k, False: 1.65k]
  |  Branch (6390:63): [True: 680, False: 977]
  |  Branch (6390:80): [True: 373, False: 604]
  |  Branch (6390:97): [True: 604, False: 0]
  ------------------
 6391|       |                           // This is "true:" followed by space/tab/newline/end - treat as key
 6392|  7.45k|                           parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6393|  7.45k|                           return;
 6394|  7.45k|                        }
 6395|  4.54k|                        process_yaml_variant_alternatives<V, is_yaml_variant_bool>::template op<Opts>(value, ctx, it,
 6396|  4.54k|                                                                                                      end);
 6397|  4.54k|                        return;
 6398|  12.0k|                     }
 6399|       |                     // "true" is followed by more characters (e.g., "True\b") - treat as string
 6400|  19.3k|                  }
 6401|  39.9k|               }
 6402|  27.9k|               parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6403|  39.9k|               return;
 6404|  61.6k|            case 'f':
  ------------------
  |  Branch (6404:13): [True: 61.6k, False: 4.41M]
  ------------------
 6405|  76.3k|            case 'F':
  ------------------
  |  Branch (6405:13): [True: 14.6k, False: 4.46M]
  ------------------
 6406|       |               // Could be "false", "False", "FALSE", or a key/string starting with f/F
 6407|  76.3k|               if constexpr (counts::n_bool > 0) {
 6408|  76.3k|                  if ((end - it >= 5) && ((it[1] == 'a' && it[2] == 'l' && it[3] == 's' && it[4] == 'e') ||
  ------------------
  |  Branch (6408:23): [True: 75.1k, False: 1.19k]
  |  Branch (6408:44): [True: 49.4k, False: 25.6k]
  |  Branch (6408:60): [True: 41.1k, False: 8.31k]
  |  Branch (6408:76): [True: 39.7k, False: 1.32k]
  |  Branch (6408:92): [True: 18.3k, False: 21.4k]
  ------------------
 6409|  56.7k|                                          (it[1] == 'A' && it[2] == 'L' && it[3] == 'S' && it[4] == 'E'))) {
  ------------------
  |  Branch (6409:44): [True: 7.29k, False: 49.4k]
  |  Branch (6409:60): [True: 5.32k, False: 1.97k]
  |  Branch (6409:76): [True: 4.68k, False: 632]
  |  Branch (6409:92): [True: 3.17k, False: 1.51k]
  ------------------
 6410|       |                     // Check what follows the word "false"
 6411|  21.5k|                     const auto after_false = it + 5;
 6412|  21.5k|                     const bool at_word_boundary = is_word_boundary(after_false);
 6413|       |
 6414|  21.5k|                     if (at_word_boundary) {
  ------------------
  |  Branch (6414:26): [True: 19.8k, False: 1.73k]
  ------------------
 6415|  19.8k|                        if (has_indented_block_continuation(after_false)) {
  ------------------
  |  Branch (6415:29): [True: 0, False: 19.8k]
  ------------------
 6416|      0|                           parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6417|      0|                           return;
 6418|      0|                        }
 6419|       |                        // Check if this is a key (followed by ": ") rather than a boolean value
 6420|       |                        // "false: value" should parse as {false: value}, not as the boolean false
 6421|  19.8k|                        if ((end - it > 5) && it[5] == ':' &&
  ------------------
  |  Branch (6421:29): [True: 17.3k, False: 2.50k]
  |  Branch (6421:47): [True: 12.2k, False: 5.03k]
  ------------------
 6422|  12.2k|                            (end - it == 6 || it[6] == ' ' || it[6] == '\t' || it[6] == '\n' || it[6] == '\r')) {
  ------------------
  |  Branch (6422:30): [True: 413, False: 11.8k]
  |  Branch (6422:47): [True: 594, False: 11.2k]
  |  Branch (6422:63): [True: 290, False: 10.9k]
  |  Branch (6422:80): [True: 1.64k, False: 9.33k]
  |  Branch (6422:97): [True: 9.33k, False: 0]
  ------------------
 6423|       |                           // This is "false:" followed by space/tab/newline/end - treat as key
 6424|  12.2k|                           parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6425|  12.2k|                           return;
 6426|  12.2k|                        }
 6427|  7.53k|                        process_yaml_variant_alternatives<V, is_yaml_variant_bool>::template op<Opts>(value, ctx, it,
 6428|  7.53k|                                                                                                      end);
 6429|  7.53k|                        return;
 6430|  19.8k|                     }
 6431|       |                     // "false" is followed by more characters (e.g., "False\b") - treat as string
 6432|  21.5k|                  }
 6433|  76.3k|               }
 6434|  56.4k|               parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6435|  76.3k|               return;
 6436|  47.3k|            case 'n':
  ------------------
  |  Branch (6436:13): [True: 47.3k, False: 4.43M]
  ------------------
 6437|  58.6k|            case 'N':
  ------------------
  |  Branch (6437:13): [True: 11.2k, False: 4.46M]
  ------------------
 6438|       |               // Could be "null", "Null", "NULL", or a key/string starting with n/N
 6439|  58.6k|               if constexpr (counts::n_null > 0) {
 6440|  58.6k|                  if ((end - it >= 4) && ((it[1] == 'u' && it[2] == 'l' && it[3] == 'l') ||
  ------------------
  |  Branch (6440:23): [True: 57.3k, False: 1.26k]
  |  Branch (6440:44): [True: 39.1k, False: 18.2k]
  |  Branch (6440:60): [True: 31.7k, False: 7.43k]
  |  Branch (6440:76): [True: 27.6k, False: 4.03k]
  ------------------
 6441|  29.6k|                                          (it[1] == 'U' && it[2] == 'L' && it[3] == 'L'))) {
  ------------------
  |  Branch (6441:44): [True: 1.34k, False: 28.3k]
  |  Branch (6441:60): [True: 979, False: 366]
  |  Branch (6441:76): [True: 653, False: 326]
  ------------------
 6442|       |                     // Check what follows the word "null"
 6443|  28.3k|                     const auto after_null = it + 4;
 6444|  28.3k|                     const bool at_word_boundary = is_word_boundary(after_null);
 6445|       |
 6446|  28.3k|                     if (at_word_boundary) {
  ------------------
  |  Branch (6446:26): [True: 23.2k, False: 5.10k]
  ------------------
 6447|  23.2k|                        if (has_indented_block_continuation(after_null)) {
  ------------------
  |  Branch (6447:29): [True: 0, False: 23.2k]
  ------------------
 6448|      0|                           parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6449|      0|                           return;
 6450|      0|                        }
 6451|       |                        // Check if this is a key (followed by ": ") rather than a null value
 6452|       |                        // "null: value" should parse as {null: value}, not as the null type
 6453|  23.2k|                        if ((end - it > 4) && it[4] == ':' &&
  ------------------
  |  Branch (6453:29): [True: 22.8k, False: 347]
  |  Branch (6453:47): [True: 12.4k, False: 10.3k]
  ------------------
 6454|  12.4k|                            (end - it == 5 || it[5] == ' ' || it[5] == '\t' || it[5] == '\n' || it[5] == '\r')) {
  ------------------
  |  Branch (6454:30): [True: 400, False: 12.0k]
  |  Branch (6454:47): [True: 644, False: 11.4k]
  |  Branch (6454:63): [True: 10.6k, False: 806]
  |  Branch (6454:80): [True: 374, False: 432]
  |  Branch (6454:97): [True: 432, False: 0]
  ------------------
 6455|       |                           // This is "null:" followed by space/tab/newline/end - treat as key
 6456|  12.4k|                           parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6457|  12.4k|                           return;
 6458|  12.4k|                        }
 6459|  10.7k|                        constexpr auto first_idx = yaml_variant_first_index_v<V, is_yaml_variant_null>;
 6460|  10.7k|                        using NullType = std::variant_alternative_t<first_idx, V>;
 6461|  10.7k|                        if (!std::holds_alternative<NullType>(value)) value = NullType{};
  ------------------
  |  Branch (6461:29): [True: 0, False: 10.7k]
  ------------------
 6462|  10.7k|                        from<YAML, NullType>::template op<Opts>(std::get<NullType>(value), ctx, it, end);
 6463|  10.7k|                        return;
 6464|  23.2k|                     }
 6465|       |                     // "null" is followed by more characters (e.g., "Null\b") - treat as string
 6466|  28.3k|                  }
 6467|  58.6k|               }
 6468|  35.3k|               parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6469|  58.6k|               return;
 6470|  1.36k|            case '~':
  ------------------
  |  Branch (6470:13): [True: 1.36k, False: 4.47M]
  ------------------
 6471|       |               // Null indicator
 6472|  1.36k|               if constexpr (counts::n_null > 0) {
 6473|  1.36k|                  constexpr auto first_idx = yaml_variant_first_index_v<V, is_yaml_variant_null>;
 6474|  1.36k|                  using NullType = std::variant_alternative_t<first_idx, V>;
 6475|  1.36k|                  if (!std::holds_alternative<NullType>(value)) value = NullType{};
  ------------------
  |  Branch (6475:23): [True: 0, False: 1.36k]
  ------------------
 6476|  1.36k|                  from<YAML, NullType>::template op<Opts>(std::get<NullType>(value), ctx, it, end);
 6477|  1.36k|                  return;
 6478|  1.36k|               }
 6479|      0|               break; // Fall through to try other types
 6480|   436k|            case '-':
  ------------------
  |  Branch (6480:13): [True: 436k, False: 4.04M]
  ------------------
 6481|       |               // Could be negative number or block sequence indicator
 6482|   436k|               if (((it + 1) == end) || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(it[1])]) {
  ------------------
  |  Branch (6482:20): [True: 4.86k, False: 431k]
  |  Branch (6482:41): [True: 324k, False: 107k]
  ------------------
 6483|       |                  // Block sequence indicator "- "
 6484|   329k|                  if constexpr (counts::n_array > 0) {
 6485|   329k|                     process_yaml_variant_alternatives<V, is_yaml_variant_array>::template op<Opts>(value, ctx, it,
 6486|   329k|                                                                                                    end);
 6487|   329k|                     return;
 6488|   329k|                  }
 6489|   329k|               }
 6490|   436k|               if constexpr (counts::n_num > 0) {
 6491|   436k|                  if ((end - it >= 2) && (std::isdigit(static_cast<unsigned char>(it[1])) || it[1] == '.')) {
  ------------------
  |  Branch (6491:23): [True: 107k, False: 329k]
  |  Branch (6491:43): [True: 1.97k, False: 105k]
  |  Branch (6491:94): [True: 48.5k, False: 57.0k]
  ------------------
 6492|  50.5k|                     process_yaml_variant_alternatives<V, is_yaml_variant_num>::template op<Opts>(value, ctx, it, end);
 6493|  50.5k|                     return;
 6494|  50.5k|                  }
 6495|   436k|               }
 6496|   386k|               parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6497|   436k|               return;
 6498|  25.9k|            case '+':
  ------------------
  |  Branch (6498:13): [True: 25.9k, False: 4.45M]
  ------------------
 6499|  45.3k|            case '.':
  ------------------
  |  Branch (6499:13): [True: 19.4k, False: 4.46M]
  ------------------
 6500|       |               // Could be a number (.5, +5, .inf, etc.) or a string (.c, .cpp, +name, etc.)
 6501|       |               // Try parsing as number speculatively, fall back to string on failure
 6502|  45.3k|               if constexpr (counts::n_num > 0) {
 6503|  45.3k|                  auto start_it = it;
 6504|  45.3k|                  auto temp_ctx = ctx.make_speculative();
 6505|  45.3k|                  process_yaml_variant_alternatives<V, is_yaml_variant_num>::template op<Opts>(value, temp_ctx, it,
 6506|  45.3k|                                                                                               end);
 6507|  45.3k|                  ctx.alias_expansion_budget = temp_ctx.alias_expansion_budget; // charged even if rejected
 6508|  45.3k|                  ctx.key_expansion_budget = temp_ctx.key_expansion_budget;
 6509|  45.3k|                  if (!bool(temp_ctx.error)) {
  ------------------
  |  Branch (6509:23): [True: 5.31k, False: 40.0k]
  ------------------
 6510|  5.31k|                     ctx.anchors = std::move(temp_ctx.anchors);
 6511|  5.31k|                     return; // Successfully parsed as number
 6512|  5.31k|                  }
 6513|  40.0k|                  it = start_it; // Restore and fall through to string
 6514|  40.0k|               }
 6515|      0|               parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6516|  45.3k|               return;
 6517|  1.16M|            default:
  ------------------
  |  Branch (6517:13): [True: 1.16M, False: 3.31M]
  ------------------
 6518|       |               // Check for digit (0-9) - numeric or block mapping key starting with digit
 6519|  1.16M|               if (c >= '0' && c <= '9') {
  ------------------
  |  Branch (6519:20): [True: 842k, False: 324k]
  |  Branch (6519:32): [True: 654k, False: 187k]
  ------------------
 6520|       |                  // Try block mapping first (e.g., "123key: value")
 6521|   654k|                  if (try_parse_block_mapping_into_variant<V, Opts>(value, ctx, it, end)) {
  ------------------
  |  Branch (6521:23): [True: 5.96k, False: 648k]
  ------------------
 6522|  5.96k|                     return;
 6523|  5.96k|                  }
 6524|       |                  // Try numeric value speculatively - values like "12:30" look numeric but aren't
 6525|   648k|                  if constexpr (counts::n_num > 0) {
 6526|   648k|                     auto start_it = it;
 6527|   648k|                     auto temp_ctx = ctx.make_speculative();
 6528|   648k|                     process_yaml_variant_alternatives<V, is_yaml_variant_num>::template op<Opts>(value, temp_ctx, it,
 6529|   648k|                                                                                                  end);
 6530|   648k|                     ctx.alias_expansion_budget = temp_ctx.alias_expansion_budget; // charged even if rejected
 6531|   648k|                     ctx.key_expansion_budget = temp_ctx.key_expansion_budget;
 6532|   648k|                     if (!bool(temp_ctx.error)) {
  ------------------
  |  Branch (6532:26): [True: 580k, False: 68.2k]
  ------------------
 6533|   580k|                        ctx.anchors = std::move(temp_ctx.anchors);
 6534|   580k|                        return; // Successfully parsed as number
 6535|   580k|                     }
 6536|  68.2k|                     it = start_it; // Restore and fall through to string
 6537|  68.2k|                  }
 6538|       |                  // Fall through to string
 6539|      0|                  process_yaml_variant_alternatives<V, is_yaml_variant_str>::template op<Opts>(value, ctx, it, end);
 6540|   648k|                  return;
 6541|   654k|               }
 6542|       |               // Plain scalar - try block mapping, then string
 6543|   512k|               parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6544|   512k|               return;
 6545|  4.48M|            }
 6546|  4.48M|         }
 6547|       |
 6548|       |         // For non-auto-deducible variants or fallback, try each type until one succeeds
 6549|      0|         constexpr auto N = std::variant_size_v<std::remove_cvref_t<T>>;
 6550|       |
 6551|       |         // This fold discards each alternative's error and reports only that nothing fit, which
 6552|       |         // misdiagnoses a document that exhausted an expansion budget as merely the wrong shape.
 6553|       |         // Kept aside and used only if no alternative parsed, so a later one that does parse
 6554|       |         // (possible under a latched budget if it materializes no key text) is unaffected.
 6555|  4.48M|         error_code expansion_error{};
 6556|  4.48M|         std::string_view expansion_message{};
 6557|       |
 6558|  4.48M|         auto try_parse = [&]<size_t I>() -> bool {
 6559|  4.48M|            using V = std::variant_alternative_t<I, std::remove_cvref_t<T>>;
 6560|  4.48M|            auto start = it;
 6561|       |
 6562|  4.48M|            V v{};
 6563|  4.48M|            auto temp_ctx = ctx.make_speculative();
 6564|  4.48M|            from<YAML, V>::template op<Opts>(v, temp_ctx, it, end);
 6565|  4.48M|            ctx.alias_expansion_budget = temp_ctx.alias_expansion_budget; // charged even if rejected
 6566|  4.48M|            ctx.key_expansion_budget = temp_ctx.key_expansion_budget;
 6567|       |
 6568|  4.48M|            if (!bool(temp_ctx.error)) {
 6569|  4.48M|               value = std::move(v);
 6570|  4.48M|               ctx.anchors = std::move(temp_ctx.anchors);
 6571|  4.48M|               return true;
 6572|  4.48M|            }
 6573|       |
 6574|  4.48M|            if (temp_ctx.error == error_code::exceeded_max_expansion && expansion_error == error_code::none) {
 6575|  4.48M|               expansion_error = temp_ctx.error;
 6576|  4.48M|               expansion_message = temp_ctx.custom_error_message;
 6577|  4.48M|            }
 6578|  4.48M|            it = start;
 6579|  4.48M|            return false;
 6580|  4.48M|         };
 6581|       |
 6582|  4.48M|         bool parsed = false;
 6583|  4.48M|         [&]<size_t... Is>(std::index_sequence<Is...>) {
 6584|  4.48M|            ((parsed = parsed || try_parse.template operator()<Is>()), ...);
 6585|  4.48M|         }(std::make_index_sequence<N>{});
 6586|       |
 6587|  4.48M|         if (!parsed) {
  ------------------
  |  Branch (6587:14): [True: 0, False: 4.48M]
  ------------------
 6588|      0|            if (expansion_error != error_code::none) {
  ------------------
  |  Branch (6588:17): [True: 0, False: 0]
  ------------------
 6589|      0|               ctx.error = expansion_error;
 6590|      0|               ctx.custom_error_message = expansion_message;
 6591|      0|            }
 6592|      0|            else {
 6593|      0|               ctx.error = error_code::no_matching_variant_type;
 6594|      0|            }
 6595|      0|         }
 6596|  4.48M|      }
_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|   618k|      {
  301|   618k|         if (it == end || *it != '*') return false;
  ------------------
  |  Branch (301:14): [True: 0, False: 618k]
  |  Branch (301:27): [True: 0, False: 618k]
  ------------------
  302|       |
  303|   618k|         ++it; // skip '*'
  304|   618k|         auto name = parse_anchor_name(it, end);
  305|   618k|         if (name.empty()) {
  ------------------
  |  Branch (305:14): [True: 111, False: 618k]
  ------------------
  306|    111|            ctx.error = error_code::syntax_error;
  307|    111|            return true;
  308|    111|         }
  309|       |
  310|   618k|         auto anchor_it = ctx.anchors.find(name);
  311|   618k|         if (anchor_it == ctx.anchors.end()) {
  ------------------
  |  Branch (311:14): [True: 432, False: 618k]
  ------------------
  312|    432|            ctx.error = error_code::syntax_error; // undefined alias
  313|    432|            return true;
  314|    432|         }
  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|   618k|         const auto span = anchor_it->second;
  319|       |
  320|       |         // Empty anchor span (anchor on null/empty node) — leave value as default
  321|   618k|         if (span.begin == span.end) {
  ------------------
  |  Branch (321:14): [True: 4.59k, False: 613k]
  ------------------
  322|  4.59k|            return true;
  323|  4.59k|         }
  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|   613k|         if (ctx.alias_span_is_replaying(span.begin, span.end)) [[unlikely]] {
  ------------------
  |  Branch (328:14): [True: 22, False: 613k]
  ------------------
  329|     22|            ctx.error = error_code::syntax_error; // cyclic alias
  330|     22|            return true;
  331|     22|         }
  332|       |
  333|       |         // Replaying an anchor re-enters the reader directly, bypassing the variant reader's
  334|       |         // depth guard, so this is the only depth accounting a chain of aliases into a
  335|       |         // non-variant target gets. The cycle check above stops the unbounded case; this bounds
  336|       |         // a legitimate but deeply chained one.
  337|   613k|         depth_guard guard{ctx, yaml::max_yaml_recursive_depth};
  338|   613k|         if (!guard) [[unlikely]]
  ------------------
  |  Branch (338:14): [True: 2, False: 613k]
  ------------------
  339|      2|            return true;
  340|       |
  341|   613k|         if (!ctx.charge_alias_expansion(static_cast<size_t>(span.end - span.begin))) [[unlikely]] {
  ------------------
  |  Branch (341:14): [True: 12, False: 613k]
  ------------------
  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|   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: 21.4k, False: 592k]
  ------------------
  354|  21.4k|            ctx.push_indent(span.base_indent - 1);
  355|  21.4k|         }
  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_4optsELj450ELb0ELb0ELb1ELb1ELb0ELb0ELb0ELb0ELj1EEERSH_TkNS_10is_contextERNS_4yaml12yaml_contextERPKcSR_EEvOT0_OT1_OT2_T3_:
 5205|   714k|      {
 5206|   714k|         constexpr auto category_count = yaml_variant_count_v<Variant, Trait>;
 5207|       |
 5208|       |         if constexpr (category_count == 0) {
 5209|       |            ctx.error = error_code::no_matching_variant_type;
 5210|       |         }
 5211|   714k|         else if constexpr (category_count == 1) {
 5212|       |            // Only one type in this category, use it directly
 5213|   714k|            constexpr auto first_idx = yaml_variant_first_index_v<Variant, Trait>;
 5214|   714k|            using V = std::variant_alternative_t<first_idx, Variant>;
 5215|   714k|            if (!std::holds_alternative<V>(value)) value = V{};
  ------------------
  |  Branch (5215:17): [True: 714k, False: 0]
  ------------------
 5216|   714k|            from<YAML, V>::template op<Opts>(std::get<V>(value), ctx, it, end);
 5217|       |         }
 5218|       |         else {
 5219|       |            // Multiple types in this category, try each one
 5220|       |            constexpr auto N = std::variant_size_v<Variant>;
 5221|       |            bool found_match{};
 5222|       |            size_t match_idx = 0;
 5223|       |            // Only the last alternative propagates its error, so an alternative that exhausted an
 5224|       |            // expansion budget would otherwise be reported as no_matching_variant_type -- a wrong
 5225|       |            // diagnosis for a document that is hostile rather than merely the wrong shape. Held
 5226|       |            // aside and used only if nothing matched, so an alternative that does succeed later
 5227|       |            // (one that materializes no key text can still parse under a latched budget) is
 5228|       |            // unaffected.
 5229|       |            error_code expansion_error{};
 5230|       |            std::string_view expansion_message{};
 5231|       |
 5232|       |            for_each<N>([&]<size_t I>() {
 5233|       |               if (found_match) {
 5234|       |                  return;
 5235|       |               }
 5236|       |               using V = std::variant_alternative_t<I, Variant>;
 5237|       |               if constexpr (Trait<V>::value) {
 5238|       |                  auto copy_it = it;
 5239|       |                  if (!std::holds_alternative<V>(value)) {
 5240|       |                     value = V{};
 5241|       |                  }
 5242|       |
 5243|       |                  auto temp_ctx = ctx.make_speculative();
 5244|       |                  from<YAML, V>::template op<Opts>(std::get<V>(value), temp_ctx, it, end);
 5245|       |
 5246|       |                  // Charged whether or not the alternative fit: a rejected probe still replayed
 5247|       |                  // whatever aliases it reached, and an attempt that is never billed is an
 5248|       |                  // attempt that can be repeated for free.
 5249|       |                  ctx.alias_expansion_budget = temp_ctx.alias_expansion_budget;
 5250|       |                  ctx.key_expansion_budget = temp_ctx.key_expansion_budget;
 5251|       |
 5252|       |                  if (!bool(temp_ctx.error)) {
 5253|       |                     found_match = true;
 5254|       |                     ctx.anchors = std::move(temp_ctx.anchors);
 5255|       |                  }
 5256|       |                  else {
 5257|       |                     it = copy_it;
 5258|       |                     if (temp_ctx.error == error_code::exceeded_max_expansion && expansion_error == error_code::none) {
 5259|       |                        expansion_error = temp_ctx.error;
 5260|       |                        expansion_message = temp_ctx.custom_error_message;
 5261|       |                     }
 5262|       |                     if (match_idx + 1 < category_count) {
 5263|       |                        // Not the last type, continue trying
 5264|       |                     }
 5265|       |                     else {
 5266|       |                        // Last type failed, propagate error
 5267|       |                        ctx.error = temp_ctx.error;
 5268|       |                        ctx.custom_error_message = temp_ctx.custom_error_message;
 5269|       |                     }
 5270|       |                  }
 5271|       |                  ++match_idx;
 5272|       |               }
 5273|       |            });
 5274|       |
 5275|       |            if (!found_match && !bool(ctx.error)) {
 5276|       |               if (expansion_error != error_code::none) {
 5277|       |                  ctx.error = expansion_error;
 5278|       |                  ctx.custom_error_message = expansion_message;
 5279|       |               }
 5280|       |               else {
 5281|       |                  ctx.error = error_code::no_matching_variant_type;
 5282|       |               }
 5283|       |            }
 5284|       |         }
 5285|   714k|      }
_ZN3glz4fromILj450ENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEE2opITnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1ELb0ELb0ELb0ELb0ELj1EEERPKcRS7_TkNS_10is_contextERNS_4yaml12yaml_contextESC_EEvOT1_OT2_OT0_T3_:
 1892|   745k|      {
 1893|   745k|         if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (1893:14): [True: 2.99k, False: 742k]
  ------------------
 1894|  2.99k|            return;
 1895|       |
 1896|   742k|         yaml::node_preamble_state preamble{};
 1897|   742k|         if (yaml::parse_node_preamble<Opts, yaml::node_property_policy{true, false, false, true}>(
  ------------------
  |  Branch (1897:14): [True: 31.0k, False: 710k]
  ------------------
 1898|   742k|                value, ctx, it, end, preamble, [](yaml::yaml_tag tag) { return yaml::tag_valid_for_string(tag); }))
 1899|  31.0k|            return;
 1900|       |
 1901|   710k|         std::string str;
 1902|   710k|         const auto style = yaml::detect_scalar_style(*it);
 1903|       |
 1904|   710k|         switch (style) {
  ------------------
  |  Branch (1904:18): [True: 710k, False: 0]
  ------------------
 1905|  4.55k|         case yaml::scalar_style::double_quoted:
  ------------------
  |  Branch (1905:10): [True: 4.55k, False: 706k]
  ------------------
 1906|  4.55k|            yaml::parse_double_quoted_string(str, ctx, it, end);
 1907|  4.55k|            break;
 1908|  6.23k|         case yaml::scalar_style::single_quoted:
  ------------------
  |  Branch (1908:10): [True: 6.23k, False: 704k]
  ------------------
 1909|  6.23k|            yaml::parse_single_quoted_string(str, ctx, it, end);
 1910|  6.23k|            break;
 1911|  1.67k|         case yaml::scalar_style::literal_block:
  ------------------
  |  Branch (1911:10): [True: 1.67k, False: 709k]
  ------------------
 1912|  5.95k|         case yaml::scalar_style::folded_block:
  ------------------
  |  Branch (1912:10): [True: 4.28k, False: 706k]
  ------------------
 1913|       |            // For same-line mapping/sequence values, parsing context is typically pushed
 1914|       |            // one column past the key/item indicator; block scalar indentation is relative
 1915|       |            // to the parent line indent.
 1916|  5.95k|            yaml::parse_block_scalar(str, ctx, it, end,
 1917|  5.95k|                                     ctx.current_indent() > 0 ? (ctx.current_indent() - 1) : ctx.current_indent());
  ------------------
  |  Branch (1917:38): [True: 1.09k, False: 4.86k]
  ------------------
 1918|  5.95k|            break;
 1919|   694k|         case yaml::scalar_style::plain:
  ------------------
  |  Branch (1919:10): [True: 694k, False: 16.7k]
  ------------------
 1920|       |            // In block context with known indent, use multiline parsing to support
 1921|       |            // plain scalars that span multiple lines (folding behavior)
 1922|       |            if constexpr (!yaml::check_flow_context(Opts)) {
 1923|       |               if (ctx.current_indent() >= 0) {
 1924|       |                  yaml::parse_plain_scalar_multiline(str, ctx, it, end, ctx.current_indent());
 1925|       |               }
 1926|       |               else {
 1927|       |                  // Top-level plain scalars may continue on same-indent or indented lines.
 1928|       |                  yaml::parse_plain_scalar_multiline(str, ctx, it, end, int32_t(0));
 1929|       |               }
 1930|       |            }
 1931|   694k|            else {
 1932|   694k|               yaml::parse_plain_scalar(str, ctx, it, end, true);
 1933|   694k|            }
 1934|   694k|            break;
 1935|   710k|         }
 1936|       |
 1937|   710k|         if (!bool(ctx.error)) {
  ------------------
  |  Branch (1937:14): [True: 710k, False: 218]
  ------------------
 1938|   710k|            value = std::move(str);
 1939|   710k|            yaml::finalize_node_anchor(preamble.node_props, ctx, it);
 1940|   710k|         }
 1941|   710k|      }
_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|   742k|      {
  466|   742k|         skip_inline_ws(it, end);
  467|       |
  468|   742k|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (468:14): [True: 6, False: 742k]
  ------------------
  469|      6|            if constexpr (!AllowEmptyInput) {
  470|      6|               ctx.error = error_code::unexpected_end;
  471|      6|            }
  472|      6|            return true;
  473|      6|         }
  474|       |
  475|   742k|         preamble.tag = parse_yaml_tag(it, end, ctx);
  476|   742k|         if (preamble.tag == yaml_tag::unknown) [[unlikely]] {
  ------------------
  |  Branch (476:14): [True: 23, False: 742k]
  ------------------
  477|     23|            ctx.error = error_code::syntax_error;
  478|     23|            return true;
  479|     23|         }
  480|   742k|         if (!tag_validator(preamble.tag)) [[unlikely]] {
  ------------------
  |  Branch (480:14): [True: 2, False: 742k]
  ------------------
  481|      2|            ctx.error = error_code::syntax_error;
  482|      2|            return true;
  483|      2|         }
  484|       |
  485|   742k|         skip_inline_ws(it, end);
  486|       |
  487|   742k|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (487:14): [True: 6, False: 742k]
  ------------------
  488|      6|            if constexpr (!AllowEmptyInput) {
  489|      6|               ctx.error = error_code::unexpected_end;
  490|      6|            }
  491|      6|            return true;
  492|      6|         }
  493|       |
  494|   742k|         if (parse_node_properties<Opts, PropertyPolicy>(std::forward<T>(value), ctx, it, end, preamble.node_props)) {
  ------------------
  |  Branch (494:14): [True: 31.0k, False: 710k]
  ------------------
  495|  31.0k|            return true;
  496|  31.0k|         }
  497|       |
  498|   710k|         return false;
  499|   742k|      }
_ZZN3glz4fromILj450ENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEE2opITnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1ELb0ELb0ELb0ELb0ELj1EEERPKcRS7_TkNS_10is_contextERNS_4yaml12yaml_contextESC_EEvOT1_OT2_OT0_T3_ENKUlNSF_8yaml_tagEE_clESP_:
 1898|   742k|                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|   742k|      {
  409|   742k|         state.has_anchor = false;
  410|   742k|         state.anchor_name.clear();
  411|   742k|         state.anchor_start = nullptr;
  412|   742k|         state.anchor_indent = ctx.current_indent();
  413|       |
  414|   742k|         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|   742k|            else {
  421|   742k|               if (handle_alias<Opts>(std::forward<T>(value), ctx, it, end)) return true;
  ------------------
  |  Branch (421:20): [True: 31.0k, False: 711k]
  ------------------
  422|   742k|            }
  423|   742k|         }
  424|       |
  425|   742k|         if (it != end && *it == '&') {
  ------------------
  |  Branch (425:14): [True: 711k, False: 31.0k]
  |  Branch (425:27): [True: 8.80k, False: 702k]
  ------------------
  426|  8.80k|            ++it;
  427|  8.80k|            auto name = parse_anchor_name(it, end);
  428|  8.80k|            if (name.empty()) {
  ------------------
  |  Branch (428:17): [True: 7, False: 8.79k]
  ------------------
  429|      7|               ctx.error = error_code::syntax_error;
  430|      7|               return true;
  431|      7|            }
  432|  8.79k|            skip_inline_ws(it, end);
  433|  8.79k|            if (it == end) {
  ------------------
  |  Branch (433:17): [True: 20, False: 8.77k]
  ------------------
  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|  8.77k|            if constexpr (Policy.disallow_anchor_on_alias) {
  440|  8.77k|               if (*it == '*') {
  ------------------
  |  Branch (440:20): [True: 8, False: 8.76k]
  ------------------
  441|      8|                  ctx.error = error_code::syntax_error;
  442|      8|                  return true;
  443|      8|               }
  444|  8.77k|            }
  445|  8.76k|            state.has_anchor = true;
  446|  8.77k|            state.anchor_name = std::string(name);
  447|  8.77k|            state.anchor_start = &*it;
  448|  8.77k|         }
  449|       |
  450|   742k|         return false;
  451|   742k|      }
_ZN3glz4yaml12handle_aliasITnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1ELb0ELb0ELb0ELb0ELj1EEERNSt3__112basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEENS0_12yaml_contextEPKcSD_EEbOT0_RT1_RT2_T3_:
  300|   742k|      {
  301|   742k|         if (it == end || *it != '*') return false;
  ------------------
  |  Branch (301:14): [True: 0, False: 742k]
  |  Branch (301:27): [True: 711k, False: 31.0k]
  ------------------
  302|       |
  303|  31.0k|         ++it; // skip '*'
  304|  31.0k|         auto name = parse_anchor_name(it, end);
  305|  31.0k|         if (name.empty()) {
  ------------------
  |  Branch (305:14): [True: 7, False: 31.0k]
  ------------------
  306|      7|            ctx.error = error_code::syntax_error;
  307|      7|            return true;
  308|      7|         }
  309|       |
  310|  31.0k|         auto anchor_it = ctx.anchors.find(name);
  311|  31.0k|         if (anchor_it == ctx.anchors.end()) {
  ------------------
  |  Branch (311:14): [True: 16, False: 31.0k]
  ------------------
  312|     16|            ctx.error = error_code::syntax_error; // undefined alias
  313|     16|            return true;
  314|     16|         }
  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|  31.0k|         const auto span = anchor_it->second;
  319|       |
  320|       |         // Empty anchor span (anchor on null/empty node) — leave value as default
  321|  31.0k|         if (span.begin == span.end) {
  ------------------
  |  Branch (321:14): [True: 781, False: 30.2k]
  ------------------
  322|    781|            return true;
  323|    781|         }
  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|  30.2k|         if (ctx.alias_span_is_replaying(span.begin, span.end)) [[unlikely]] {
  ------------------
  |  Branch (328:14): [True: 4, False: 30.2k]
  ------------------
  329|      4|            ctx.error = error_code::syntax_error; // cyclic alias
  330|      4|            return true;
  331|      4|         }
  332|       |
  333|       |         // Replaying an anchor re-enters the reader directly, bypassing the variant reader's
  334|       |         // depth guard, so this is the only depth accounting a chain of aliases into a
  335|       |         // non-variant target gets. The cycle check above stops the unbounded case; this bounds
  336|       |         // a legitimate but deeply chained one.
  337|  30.2k|         depth_guard guard{ctx, yaml::max_yaml_recursive_depth};
  338|  30.2k|         if (!guard) [[unlikely]]
  ------------------
  |  Branch (338:14): [True: 1, False: 30.2k]
  ------------------
  339|      1|            return true;
  340|       |
  341|  30.2k|         if (!ctx.charge_alias_expansion(static_cast<size_t>(span.end - span.begin))) [[unlikely]] {
  ------------------
  |  Branch (341:14): [True: 1, False: 30.2k]
  ------------------
  342|      1|            ctx.error = error_code::exceeded_max_expansion;
  343|      1|            ctx.custom_error_message = "alias expansion";
  344|      1|            return true;
  345|      1|         }
  346|       |
  347|  30.2k|         auto replay_it = span.begin;
  348|  30.2k|         auto replay_end = span.end;
  349|       |
  350|       |         // Save indent context and set up for replay
  351|  30.2k|         auto saved_indent_stack = std::move(ctx.indent_stack);
  352|  30.2k|         ctx.indent_stack.clear();
  353|  30.2k|         if (span.base_indent > 0) {
  ------------------
  |  Branch (353:14): [True: 907, False: 29.3k]
  ------------------
  354|    907|            ctx.push_indent(span.base_indent - 1);
  355|    907|         }
  356|       |
  357|  30.2k|         ctx.active_alias_spans.emplace_back(span.begin, span.end);
  358|       |
  359|  30.2k|         using V = std::remove_cvref_t<T>;
  360|  30.2k|         from<YAML, V>::template op<Opts>(std::forward<T>(value), ctx, replay_it, replay_end);
  361|       |
  362|  30.2k|         ctx.active_alias_spans.pop_back();
  363|       |
  364|       |         // Restore indent context
  365|  30.2k|         ctx.indent_stack = std::move(saved_indent_stack);
  366|  30.2k|         return true;
  367|  30.2k|      }
_ZN3glz4yaml26parse_double_quoted_stringINS0_12yaml_contextEPKcS4_EEvRNSt3__112basic_stringIcNS5_11char_traitsIcEENS5_9allocatorIcEEEERT_RT0_T1_:
  505|   202k|      {
  506|   202k|         static constexpr size_t string_padding_bytes = 8;
  507|       |
  508|   202k|         if (it == end || *it != '"') [[unlikely]] {
  ------------------
  |  Branch (508:14): [True: 0, False: 202k]
  |  Branch (508:27): [True: 0, False: 202k]
  ------------------
  509|      0|            ctx.error = error_code::expected_quote;
  510|      0|            return;
  511|      0|         }
  512|       |
  513|   202k|         ++it; // skip opening quote
  514|   202k|         auto start = it;
  515|       |
  516|       |         // Pass 1: Find closing quote byte-by-byte (need to handle newlines and escapes)
  517|  24.3M|         while (it != end && *it != '"') {
  ------------------
  |  Branch (517:17): [True: 24.3M, False: 660]
  |  Branch (517:30): [True: 24.1M, False: 201k]
  ------------------
  518|  24.1M|            if (*it == '\\') {
  ------------------
  |  Branch (518:17): [True: 824k, False: 23.3M]
  ------------------
  519|   824k|               ++it;
  520|   824k|               if (it == end) [[unlikely]] {
  ------------------
  |  Branch (520:20): [True: 38, False: 824k]
  ------------------
  521|     38|                  ctx.error = error_code::unexpected_end;
  522|     38|                  return;
  523|     38|               }
  524|   824k|            }
  525|  24.1M|            ++it;
  526|  24.1M|         }
  527|       |
  528|   202k|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (528:14): [True: 660, False: 201k]
  ------------------
  529|    660|            ctx.error = error_code::unexpected_end;
  530|    660|            return;
  531|    660|         }
  532|       |
  533|       |         // Allocate buffer with room for potential expansion and SWAR padding
  534|       |         // Some YAML escapes expand: \L, \P -> 3 bytes UTF-8
  535|   201k|         const auto input_len = static_cast<size_t>(it - start);
  536|   201k|         value.resize(input_len + (input_len / 2) + string_padding_bytes);
  537|   201k|         auto* dst = value.data();
  538|   201k|         auto* const dst_start = dst;
  539|       |
  540|       |         // Pass 2: Copy and process escapes and line folding
  541|   201k|         auto src = start;
  542|   201k|         const auto* const src_end = &*it;
  543|       |         // Track position past which we should not trim. Escape-produced characters
  544|       |         // (even whitespace like \t) are content and must not be trimmed by line folding.
  545|   201k|         auto* last_non_trimmable = dst;
  546|       |
  547|  15.1M|         while (src < src_end) {
  ------------------
  |  Branch (547:17): [True: 14.9M, False: 201k]
  ------------------
  548|       |            // Check for newline - needs line folding
  549|  14.9M|            if (*src == '\n' || *src == '\r') {
  ------------------
  |  Branch (549:17): [True: 170k, False: 14.8M]
  |  Branch (549:33): [True: 184k, False: 14.6M]
  ------------------
  550|       |               // Trim trailing LITERAL whitespace from output before processing newline.
  551|       |               // Escape-produced whitespace (e.g. from \t) is preserved.
  552|   354k|               dst = (std::max)(last_non_trimmable, dst_start);
  553|       |
  554|       |               // Skip the newline
  555|   354k|               if (*src == '\r' && (src + 1) < src_end && *(src + 1) == '\n') {
  ------------------
  |  Branch (555:20): [True: 184k, False: 170k]
  |  Branch (555:36): [True: 184k, False: 308]
  |  Branch (555:59): [True: 8.42k, False: 175k]
  ------------------
  556|  8.42k|                  src += 2; // CRLF
  557|  8.42k|               }
  558|   346k|               else {
  559|   346k|                  ++src;
  560|   346k|               }
  561|       |
  562|       |               // Skip leading indentation on the next line.
  563|   354k|               int indent_count = 0;
  564|   354k|               if (!yaml::skip_folded_line_indent(src, src_end, ctx, &indent_count)) return;
  ------------------
  |  Branch (564:20): [True: 60, False: 354k]
  ------------------
  565|   354k|               if (indent_count == 0 && yaml::starts_with_document_marker(src, src_end)) {
  ------------------
  |  Branch (565:20): [True: 266k, False: 87.8k]
  |  Branch (565:41): [True: 96, False: 266k]
  ------------------
  566|     96|                  ctx.error = error_code::syntax_error;
  567|     96|                  return;
  568|     96|               }
  569|       |
  570|       |               // Check if this is a blank line (another newline follows)
  571|   354k|               if (src < src_end && (*src == '\n' || *src == '\r')) {
  ------------------
  |  Branch (571:20): [True: 346k, False: 8.17k]
  |  Branch (571:38): [True: 46.4k, False: 300k]
  |  Branch (571:54): [True: 47.7k, False: 252k]
  ------------------
  572|       |                  // Blank line(s) - output newlines for each blank line
  573|   402k|                  while (src < src_end && (*src == '\n' || *src == '\r')) {
  ------------------
  |  Branch (573:26): [True: 400k, False: 1.64k]
  |  Branch (573:44): [True: 190k, False: 210k]
  |  Branch (573:60): [True: 117k, False: 92.4k]
  ------------------
  574|   308k|                     *dst++ = '\n';
  575|       |                     // Skip the newline
  576|   308k|                     if (*src == '\r' && (src + 1) < src_end && *(src + 1) == '\n') {
  ------------------
  |  Branch (576:26): [True: 117k, False: 190k]
  |  Branch (576:42): [True: 117k, False: 838]
  |  Branch (576:65): [True: 26.6k, False: 90.4k]
  ------------------
  577|  26.6k|                        src += 2; // CRLF
  578|  26.6k|                     }
  579|   281k|                     else {
  580|   281k|                        ++src;
  581|   281k|                     }
  582|   308k|                     int blank_indent_count = 0;
  583|   308k|                     if (!yaml::skip_folded_line_indent(src, src_end, ctx, &blank_indent_count)) return;
  ------------------
  |  Branch (583:26): [True: 52, False: 308k]
  ------------------
  584|   308k|                     if (blank_indent_count == 0 && yaml::starts_with_document_marker(src, src_end)) {
  ------------------
  |  Branch (584:26): [True: 260k, False: 47.5k]
  |  Branch (584:53): [True: 70, False: 260k]
  ------------------
  585|     70|                        ctx.error = error_code::syntax_error;
  586|     70|                        return;
  587|     70|                     }
  588|   308k|                  }
  589|       |                  // Don't add space - we're now at content after blank line(s)
  590|  94.1k|               }
  591|   260k|               else {
  592|       |                  // Single newline - fold to space
  593|   260k|                  *dst++ = ' ';
  594|   260k|               }
  595|   354k|               last_non_trimmable = dst;
  596|   354k|               continue;
  597|   354k|            }
  598|       |
  599|  14.6M|            if (*src == '\\') {
  ------------------
  |  Branch (599:17): [True: 538k, False: 14.0M]
  ------------------
  600|   538k|               ++src;
  601|   538k|               if (src >= src_end) [[unlikely]] {
  ------------------
  |  Branch (601:20): [True: 0, False: 538k]
  ------------------
  602|       |                  // Shouldn't happen - we validated in pass 1
  603|      0|                  ctx.error = error_code::syntax_error;
  604|      0|                  return;
  605|      0|               }
  606|       |
  607|   538k|               const unsigned char esc = static_cast<unsigned char>(*src);
  608|       |
  609|       |               // Check for escaped newline (line continuation - no space)
  610|   538k|               if (esc == '\n' || esc == '\r') {
  ------------------
  |  Branch (610:20): [True: 4.83k, False: 533k]
  |  Branch (610:35): [True: 16.2k, False: 517k]
  ------------------
  611|       |                  // Skip the newline
  612|  21.0k|                  if (esc == '\r' && (src + 1) < src_end && *(src + 1) == '\n') {
  ------------------
  |  Branch (612:23): [True: 16.2k, False: 4.83k]
  |  Branch (612:38): [True: 15.8k, False: 438]
  |  Branch (612:61): [True: 9.36k, False: 6.44k]
  ------------------
  613|  9.36k|                     src += 2; // CRLF
  614|  9.36k|                  }
  615|  11.7k|                  else {
  616|  11.7k|                     ++src;
  617|  11.7k|                  }
  618|       |
  619|  21.0k|                  int indent_count = 0;
  620|  21.0k|                  if (!yaml::skip_folded_line_indent(src, src_end, ctx, &indent_count)) return;
  ------------------
  |  Branch (620:23): [True: 46, False: 21.0k]
  ------------------
  621|  21.0k|                  if (indent_count == 0 && yaml::starts_with_document_marker(src, src_end)) {
  ------------------
  |  Branch (621:23): [True: 19.0k, False: 1.96k]
  |  Branch (621:44): [True: 78, False: 18.9k]
  ------------------
  622|     78|                     ctx.error = error_code::syntax_error;
  623|     78|                     return;
  624|     78|                  }
  625|       |                  // No output - this is line continuation without space
  626|  20.9k|                  last_non_trimmable = dst;
  627|  20.9k|                  continue;
  628|  21.0k|               }
  629|       |
  630|       |               // Check simple escape table first
  631|   517k|               if (yaml_escape_is_simple[esc]) {
  ------------------
  |  Branch (631:20): [True: 340k, False: 176k]
  ------------------
  632|   340k|                  *dst++ = yaml_unescape_table[esc];
  633|   340k|                  ++src;
  634|   340k|               }
  635|       |               // Handle escapes requiring special processing
  636|   176k|               else if (yaml_escape_needs_special[esc]) {
  ------------------
  |  Branch (636:25): [True: 154k, False: 22.0k]
  ------------------
  637|   154k|                  ++src; // skip escape char
  638|   154k|                  switch (esc) {
  639|  19.8k|                  case 'x': {
  ------------------
  |  Branch (639:19): [True: 19.8k, False: 135k]
  ------------------
  640|       |                     // \xXX - 2 hex digits
  641|  19.8k|                     if (static_cast<size_t>(src_end - src) < 2) [[unlikely]] {
  ------------------
  |  Branch (641:26): [True: 6, False: 19.8k]
  ------------------
  642|      6|                        ctx.error = error_code::syntax_error;
  643|      6|                        return;
  644|      6|                     }
  645|  19.8k|                     const uint32_t hi = digit_hex_table[static_cast<unsigned char>(src[0])];
  646|  19.8k|                     const uint32_t lo = digit_hex_table[static_cast<unsigned char>(src[1])];
  647|  19.8k|                     if ((hi | lo) & 0xF0) [[unlikely]] {
  ------------------
  |  Branch (647:26): [True: 36, False: 19.8k]
  ------------------
  648|     36|                        ctx.error = error_code::syntax_error;
  649|     36|                        return;
  650|     36|                     }
  651|  19.8k|                     const uint32_t codepoint = (hi << 4) | lo;
  652|  19.8k|                     src += 2;
  653|  19.8k|                     dst += code_point_to_utf8(codepoint, dst);
  654|  19.8k|                     break;
  655|  19.8k|                  }
  656|    986|                  case 'u': {
  ------------------
  |  Branch (656:19): [True: 986, False: 153k]
  ------------------
  657|       |                     // \uXXXX - 4 hex digits
  658|    986|                     if (static_cast<size_t>(src_end - src) < 4) [[unlikely]] {
  ------------------
  |  Branch (658:26): [True: 18, False: 968]
  ------------------
  659|     18|                        ctx.error = error_code::syntax_error;
  660|     18|                        return;
  661|     18|                     }
  662|    968|                     const uint32_t codepoint = hex_to_u32(src);
  663|    968|                     if (codepoint == 0xFFFFFFFFu || (codepoint >= 0xD800 && codepoint <= 0xDFFF)) [[unlikely]] {
  ------------------
  |  Branch (663:26): [True: 34, False: 934]
  |  Branch (663:55): [True: 258, False: 676]
  |  Branch (663:78): [True: 26, False: 232]
  ------------------
  664|     60|                        ctx.error = error_code::syntax_error;
  665|     60|                        return;
  666|     60|                     }
  667|    908|                     src += 4;
  668|    908|                     dst += code_point_to_utf8(codepoint, dst);
  669|    908|                     break;
  670|    968|                  }
  671|   128k|                  case 'U': {
  ------------------
  |  Branch (671:19): [True: 128k, False: 26.7k]
  ------------------
  672|       |                     // \UXXXXXXXX - 8 hex digits
  673|   128k|                     if (static_cast<size_t>(src_end - src) < 8) [[unlikely]] {
  ------------------
  |  Branch (673:26): [True: 10, False: 128k]
  ------------------
  674|     10|                        ctx.error = error_code::syntax_error;
  675|     10|                        return;
  676|     10|                     }
  677|   128k|                     const uint32_t hi = hex_to_u32(src);
  678|   128k|                     const uint32_t lo = hex_to_u32(src + 4);
  679|   128k|                     if ((hi | lo) == 0xFFFFFFFFu) [[unlikely]] {
  ------------------
  |  Branch (679:26): [True: 94, False: 128k]
  ------------------
  680|     94|                        ctx.error = error_code::syntax_error;
  681|     94|                        return;
  682|     94|                     }
  683|   128k|                     const uint32_t codepoint = (hi << 16) | lo;
  684|   128k|                     src += 8;
  685|   128k|                     if (codepoint >= 0xD800 && codepoint <= 0xDFFF) [[unlikely]] {
  ------------------
  |  Branch (685:26): [True: 62.6k, False: 65.4k]
  |  Branch (685:49): [True: 10, False: 62.6k]
  ------------------
  686|     10|                        ctx.error = error_code::syntax_error;
  687|     10|                        return;
  688|     10|                     }
  689|   128k|                     if (codepoint <= 0x10FFFF) {
  ------------------
  |  Branch (689:26): [True: 65.8k, False: 62.2k]
  ------------------
  690|  65.8k|                        dst += code_point_to_utf8(codepoint, dst);
  691|  65.8k|                     }
  692|   128k|                     break;
  693|   128k|                  }
  694|  3.28k|                  case 'N': {
  ------------------
  |  Branch (694:19): [True: 3.28k, False: 151k]
  ------------------
  695|       |                     // Next line U+0085
  696|  3.28k|                     dst += code_point_to_utf8(0x0085, dst);
  697|  3.28k|                     break;
  698|   128k|                  }
  699|  1.28k|                  case '_': {
  ------------------
  |  Branch (699:19): [True: 1.28k, False: 153k]
  ------------------
  700|       |                     // Non-breaking space U+00A0
  701|  1.28k|                     dst += code_point_to_utf8(0x00A0, dst);
  702|  1.28k|                     break;
  703|   128k|                  }
  704|    902|                  case 'L': {
  ------------------
  |  Branch (704:19): [True: 902, False: 154k]
  ------------------
  705|       |                     // Line separator U+2028
  706|    902|                     dst += code_point_to_utf8(0x2028, dst);
  707|    902|                     break;
  708|   128k|                  }
  709|    386|                  case 'P': {
  ------------------
  |  Branch (709:19): [True: 386, False: 154k]
  ------------------
  710|       |                     // Paragraph separator U+2029
  711|    386|                     dst += code_point_to_utf8(0x2029, dst);
  712|    386|                     break;
  713|   128k|                  }
  714|      0|                  default:
  ------------------
  |  Branch (714:19): [True: 0, False: 154k]
  ------------------
  715|      0|                     break;
  716|   154k|                  }
  717|   154k|               }
  718|  22.0k|               else {
  719|       |                  // Preserve unknown escapes for compatibility, but reject a subset that
  720|       |                  // YAML test-suite marks as malformed in double-quoted scalars.
  721|  22.0k|                  if (esc == '.' || esc == '\'') {
  ------------------
  |  Branch (721:23): [True: 14, False: 21.9k]
  |  Branch (721:37): [True: 28, False: 21.9k]
  ------------------
  722|     42|                     ctx.error = error_code::syntax_error;
  723|     42|                     return;
  724|     42|                  }
  725|  21.9k|                  *dst++ = '\\';
  726|  21.9k|                  *dst++ = static_cast<char>(esc);
  727|  21.9k|                  ++src;
  728|  21.9k|               }
  729|       |               // All escape-produced characters are content, not trimmable
  730|   516k|               last_non_trimmable = dst;
  731|   516k|            }
  732|  14.0M|            else {
  733|  14.0M|               const char ch = *src++;
  734|  14.0M|               *dst++ = ch;
  735|       |               // Only update non-trimmable for non-whitespace literal characters
  736|  14.0M|               if (ch != ' ' && ch != '\t') {
  ------------------
  |  Branch (736:20): [True: 13.1M, False: 926k]
  |  Branch (736:33): [True: 12.3M, False: 853k]
  ------------------
  737|  12.3M|                  last_non_trimmable = dst;
  738|  12.3M|               }
  739|  14.0M|            }
  740|  14.6M|         }
  741|       |
  742|       |         // Resize to actual length
  743|   201k|         value.resize(static_cast<size_t>(dst - dst_start));
  744|   201k|         ++it; // skip closing quote
  745|   201k|      }
_ZN3glz4yaml26parse_single_quoted_stringINS0_12yaml_contextEPKcS4_EEvRNSt3__112basic_stringIcNS5_11char_traitsIcEENS5_9allocatorIcEEEERT_RT0_T1_:
  752|   213k|      {
  753|   213k|         static constexpr size_t string_padding_bytes = 8;
  754|       |
  755|   213k|         if (it == end || *it != '\'') [[unlikely]] {
  ------------------
  |  Branch (755:14): [True: 0, False: 213k]
  |  Branch (755:27): [True: 0, False: 213k]
  ------------------
  756|      0|            ctx.error = error_code::expected_quote;
  757|      0|            return;
  758|      0|         }
  759|       |
  760|   213k|         ++it; // skip opening quote
  761|   213k|         auto start = it;
  762|       |
  763|       |         // Pass 1: Find closing quote (handling '' escapes)
  764|  12.4M|         while (it != end) {
  ------------------
  |  Branch (764:17): [True: 12.4M, False: 832]
  ------------------
  765|  12.4M|            if (*it == '\'') {
  ------------------
  |  Branch (765:17): [True: 260k, False: 12.2M]
  ------------------
  766|   260k|               if ((it + 1) != end && *(it + 1) == '\'') {
  ------------------
  |  Branch (766:20): [True: 255k, False: 4.70k]
  |  Branch (766:39): [True: 47.0k, False: 208k]
  ------------------
  767|  47.0k|                  it += 2; // Skip escaped quote
  768|  47.0k|               }
  769|   213k|               else {
  770|   213k|                  break; // Found closing quote
  771|   213k|               }
  772|   260k|            }
  773|  12.2M|            else {
  774|  12.2M|               ++it;
  775|  12.2M|            }
  776|  12.4M|         }
  777|       |
  778|   213k|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (778:14): [True: 832, False: 213k]
  ------------------
  779|    832|            ctx.error = error_code::unexpected_end;
  780|    832|            return;
  781|    832|         }
  782|       |
  783|   213k|         const auto input_len = static_cast<size_t>(it - start);
  784|   213k|         value.resize(input_len + string_padding_bytes);
  785|   213k|         auto* dst = value.data();
  786|   213k|         auto* const dst_start = dst;
  787|   213k|         auto src = start;
  788|   213k|         const auto* const src_end = &*it;
  789|       |
  790|       |         // Pass 2: Process content with line folding and '' escapes
  791|  12.2M|         while (src < src_end) {
  ------------------
  |  Branch (791:17): [True: 11.9M, False: 212k]
  ------------------
  792|       |            // Check for newline - needs line folding
  793|  11.9M|            if (*src == '\n' || *src == '\r') {
  ------------------
  |  Branch (793:17): [True: 254k, False: 11.7M]
  |  Branch (793:33): [True: 89.1k, False: 11.6M]
  ------------------
  794|       |               // Trim trailing whitespace from output before processing newline
  795|   382k|               while (dst > dst_start && (*(dst - 1) == ' ' || *(dst - 1) == '\t')) {
  ------------------
  |  Branch (795:23): [True: 380k, False: 1.78k]
  |  Branch (795:43): [True: 32.4k, False: 348k]
  |  Branch (795:64): [True: 6.29k, False: 342k]
  ------------------
  796|  38.7k|                  --dst;
  797|  38.7k|               }
  798|       |
  799|       |               // Skip the newline
  800|   343k|               if (*src == '\r' && (src + 1) < src_end && *(src + 1) == '\n') {
  ------------------
  |  Branch (800:20): [True: 89.1k, False: 254k]
  |  Branch (800:36): [True: 88.0k, False: 1.04k]
  |  Branch (800:59): [True: 2.61k, False: 85.4k]
  ------------------
  801|  2.61k|                  src += 2; // CRLF
  802|  2.61k|               }
  803|   341k|               else {
  804|   341k|                  ++src;
  805|   341k|               }
  806|       |
  807|       |               // Skip leading indentation on the next line.
  808|   343k|               int indent_count = 0;
  809|   343k|               if (!yaml::skip_folded_line_indent(src, src_end, ctx, &indent_count)) return;
  ------------------
  |  Branch (809:20): [True: 40, False: 343k]
  ------------------
  810|   343k|               if (indent_count == 0 && yaml::starts_with_document_marker(src, src_end)) {
  ------------------
  |  Branch (810:20): [True: 273k, False: 70.6k]
  |  Branch (810:41): [True: 76, False: 273k]
  ------------------
  811|     76|                  ctx.error = error_code::syntax_error;
  812|     76|                  return;
  813|     76|               }
  814|       |
  815|       |               // Check if this is a blank line (another newline follows)
  816|   343k|               if (src < src_end && (*src == '\n' || *src == '\r')) {
  ------------------
  |  Branch (816:20): [True: 281k, False: 61.8k]
  |  Branch (816:38): [True: 14.8k, False: 267k]
  |  Branch (816:54): [True: 32.3k, False: 234k]
  ------------------
  817|       |                  // Blank line(s) - output newlines for each blank line
  818|   144k|                  while (src < src_end && (*src == '\n' || *src == '\r')) {
  ------------------
  |  Branch (818:26): [True: 142k, False: 1.73k]
  |  Branch (818:44): [True: 42.0k, False: 100k]
  |  Branch (818:60): [True: 55.0k, False: 45.2k]
  ------------------
  819|  97.0k|                     *dst++ = '\n';
  820|       |                     // Skip the newline
  821|  97.0k|                     if (*src == '\r' && (src + 1) < src_end && *(src + 1) == '\n') {
  ------------------
  |  Branch (821:26): [True: 55.0k, False: 42.0k]
  |  Branch (821:42): [True: 54.6k, False: 420]
  |  Branch (821:65): [True: 3.29k, False: 51.3k]
  ------------------
  822|  3.29k|                        src += 2; // CRLF
  823|  3.29k|                     }
  824|  93.7k|                     else {
  825|  93.7k|                        ++src;
  826|  93.7k|                     }
  827|  97.0k|                     int blank_indent_count = 0;
  828|  97.0k|                     if (!yaml::skip_folded_line_indent(src, src_end, ctx, &blank_indent_count)) return;
  ------------------
  |  Branch (828:26): [True: 74, False: 96.9k]
  ------------------
  829|  96.9k|                     if (blank_indent_count == 0 && yaml::starts_with_document_marker(src, src_end)) {
  ------------------
  |  Branch (829:26): [True: 79.3k, False: 17.6k]
  |  Branch (829:53): [True: 78, False: 79.2k]
  ------------------
  830|     78|                        ctx.error = error_code::syntax_error;
  831|     78|                        return;
  832|     78|                     }
  833|  96.9k|                  }
  834|       |                  // Don't add space - we're now at content after blank line(s)
  835|  47.1k|               }
  836|   296k|               else {
  837|       |                  // Single newline - fold to space
  838|   296k|                  *dst++ = ' ';
  839|   296k|               }
  840|   343k|               continue;
  841|   343k|            }
  842|       |
  843|  11.6M|            if (*src == '\'') {
  ------------------
  |  Branch (843:17): [True: 46.9k, False: 11.6M]
  ------------------
  844|       |               // Must be '' (escaped quote) - we validated this in pass 1
  845|  46.9k|               *dst++ = '\'';
  846|  46.9k|               src += 2;
  847|  46.9k|            }
  848|  11.6M|            else {
  849|  11.6M|               *dst++ = *src++;
  850|  11.6M|            }
  851|  11.6M|         }
  852|       |
  853|   212k|         value.resize(static_cast<size_t>(dst - dst_start));
  854|   212k|         ++it; // skip closing quote
  855|   212k|      }
_ZN3glz4yaml18parse_block_scalarINS0_12yaml_contextEPKcS4_EEvRNSt3__112basic_stringIcNS5_11char_traitsIcEENS5_9allocatorIcEEEERT_RT0_T1_i:
 1315|  56.9k|      {
 1316|  56.9k|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (1316:14): [True: 0, False: 56.9k]
  ------------------
 1317|      0|            ctx.error = error_code::unexpected_end;
 1318|      0|            return;
 1319|      0|         }
 1320|       |
 1321|  56.9k|         const char indicator = *it;
 1322|  56.9k|         ++it;
 1323|  56.9k|         const auto header_start = it;
 1324|       |
 1325|       |         // Chomping indicator: - (strip), + (keep), or none (clip)
 1326|  56.9k|         char chomping = ' '; // default: clip
 1327|  56.9k|         int explicit_indent = 0;
 1328|  56.9k|         bool seen_chomping = false;
 1329|  56.9k|         bool seen_indent = false;
 1330|       |
 1331|  83.1k|         while (it != end && *it != '\n' && *it != '\r') {
  ------------------
  |  Branch (1331:17): [True: 77.5k, False: 5.63k]
  |  Branch (1331:30): [True: 49.6k, False: 27.9k]
  |  Branch (1331:45): [True: 28.1k, False: 21.4k]
  ------------------
 1332|  28.1k|            if (*it == '-' || *it == '+') {
  ------------------
  |  Branch (1332:17): [True: 984, False: 27.2k]
  |  Branch (1332:31): [True: 6.29k, False: 20.9k]
  ------------------
 1333|  7.27k|               if (seen_chomping) {
  ------------------
  |  Branch (1333:20): [True: 10, False: 7.26k]
  ------------------
 1334|     10|                  ctx.error = error_code::syntax_error;
 1335|     10|                  return;
 1336|     10|               }
 1337|  7.26k|               seen_chomping = true;
 1338|  7.26k|               chomping = *it;
 1339|  7.26k|            }
 1340|  20.9k|            else if (*it >= '1' && *it <= '9') {
  ------------------
  |  Branch (1340:22): [True: 7.38k, False: 13.5k]
  |  Branch (1340:36): [True: 7.28k, False: 100]
  ------------------
 1341|  7.28k|               if (seen_indent) {
  ------------------
  |  Branch (1341:20): [True: 6, False: 7.28k]
  ------------------
 1342|       |                  // YAML indentation indicator is a single digit [1-9].
 1343|      6|                  ctx.error = error_code::syntax_error;
 1344|      6|                  return;
 1345|      6|               }
 1346|  7.28k|               seen_indent = true;
 1347|  7.28k|               explicit_indent = *it - '0';
 1348|  7.28k|            }
 1349|  13.6k|            else if (*it == '0') {
  ------------------
  |  Branch (1349:22): [True: 8, False: 13.6k]
  ------------------
 1350|       |               // Indentation indicator 0 is invalid by spec.
 1351|      8|               ctx.error = error_code::syntax_error;
 1352|      8|               return;
 1353|      8|            }
 1354|  13.6k|            else if (*it == ' ' || *it == '\t') {
  ------------------
  |  Branch (1354:22): [True: 10.5k, False: 3.06k]
  |  Branch (1354:36): [True: 1.15k, False: 1.91k]
  ------------------
 1355|       |               // Skip whitespace
 1356|  11.6k|            }
 1357|  1.91k|            else if (*it == '#') {
  ------------------
  |  Branch (1357:22): [True: 1.67k, False: 236]
  ------------------
 1358|       |               // Block scalar comments require separation whitespace.
 1359|  1.67k|               if (it == header_start || (*(it - 1) != ' ' && *(it - 1) != '\t')) {
  ------------------
  |  Branch (1359:20): [True: 16, False: 1.66k]
  |  Branch (1359:43): [True: 318, False: 1.34k]
  |  Branch (1359:63): [True: 8, False: 310]
  ------------------
 1360|     24|                  ctx.error = error_code::syntax_error;
 1361|     24|                  return;
 1362|     24|               }
 1363|       |               // Skip comment
 1364|  30.2k|               while (it != end && *it != '\n' && *it != '\r') {
  ------------------
  |  Branch (1364:23): [True: 30.0k, False: 230]
  |  Branch (1364:36): [True: 29.3k, False: 642]
  |  Branch (1364:51): [True: 28.5k, False: 782]
  ------------------
 1365|  28.5k|                  ++it;
 1366|  28.5k|               }
 1367|  1.65k|               break;
 1368|  1.67k|            }
 1369|    236|            else {
 1370|    236|               ctx.error = error_code::syntax_error;
 1371|    236|               return;
 1372|    236|            }
 1373|  26.2k|            ++it;
 1374|  26.2k|         }
 1375|       |
 1376|       |         // Skip newline after indicator
 1377|  56.6k|         if (!skip_newline(it, end)) {
  ------------------
  |  Branch (1377:14): [True: 5.86k, False: 50.8k]
  ------------------
 1378|       |            // Empty block scalar
 1379|  5.86k|            value.clear();
 1380|  5.86k|            return;
 1381|  5.86k|         }
 1382|       |
 1383|  50.8k|         value.clear();
 1384|       |
 1385|       |         // Determine content indentation
 1386|  50.8k|         int32_t content_indent = -1;
 1387|  50.8k|         int32_t leading_blank_indent_max = -1;
 1388|  50.8k|         bool first_line = true;
 1389|  50.8k|         bool previous_line_starts_with_tab = false;
 1390|  50.8k|         bool previous_line_more_indented = false;
 1391|  50.8k|         std::string trailing_newlines;
 1392|       |
 1393|   441k|         while (it != end) {
  ------------------
  |  Branch (1393:17): [True: 422k, False: 18.3k]
  ------------------
 1394|   422k|            auto line_start = it;
 1395|   422k|            int32_t line_indent = measure_indent<false>(it, end, ctx);
 1396|   422k|            if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (1396:17): [True: 40, False: 422k]
  ------------------
 1397|     40|               return;
 1398|       |
 1399|       |            // Check for blank line
 1400|   422k|            if (it == end || *it == '\n' || *it == '\r') {
  ------------------
  |  Branch (1400:17): [True: 508, False: 422k]
  |  Branch (1400:30): [True: 249k, False: 173k]
  |  Branch (1400:45): [True: 37.6k, False: 135k]
  ------------------
 1401|       |               // In literal mode, a line with more spaces than content_indent
 1402|       |               // has whitespace content that must be preserved.
 1403|   287k|               if (content_indent >= 0 && line_indent > content_indent && indicator == '|') {
  ------------------
  |  Branch (1403:20): [True: 235k, False: 51.5k]
  |  Branch (1403:43): [True: 2.11k, False: 233k]
  |  Branch (1403:75): [True: 1.41k, False: 694]
  ------------------
 1404|  1.41k|                  it = line_start;
 1405|  2.59k|                  for (int32_t i = 0; i < content_indent && it != end && *it == ' '; ++i) {
  ------------------
  |  Branch (1405:39): [True: 1.18k, False: 1.41k]
  |  Branch (1405:61): [True: 1.18k, False: 0]
  |  Branch (1405:74): [True: 1.18k, False: 0]
  ------------------
 1406|  1.18k|                     ++it;
 1407|  1.18k|                  }
 1408|       |                  // Fall through to content processing below
 1409|  1.41k|               }
 1410|   285k|               else {
 1411|   285k|                  if (content_indent < 0) {
  ------------------
  |  Branch (1411:23): [True: 51.5k, False: 234k]
  ------------------
 1412|  51.5k|                     leading_blank_indent_max = (std::max)(leading_blank_indent_max, line_indent);
 1413|  51.5k|                  }
 1414|   285k|                  trailing_newlines.push_back('\n');
 1415|   285k|                  skip_newline(it, end);
 1416|   285k|                  continue;
 1417|   285k|               }
 1418|   287k|            }
 1419|       |
 1420|       |            // Top-level zero-indented block scalars must stop at document boundary markers.
 1421|   136k|            if (base_indent < 0 && line_indent == 0 && (at_document_start(it, end) || at_document_end(it, end))) {
  ------------------
  |  Branch (1421:17): [True: 122k, False: 14.5k]
  |  Branch (1421:36): [True: 103k, False: 18.5k]
  |  Branch (1421:57): [True: 10.2k, False: 93.6k]
  |  Branch (1421:87): [True: 3.65k, False: 89.9k]
  ------------------
 1422|  13.8k|               it = line_start;
 1423|  13.8k|               break;
 1424|  13.8k|            }
 1425|       |
 1426|       |            // First content line determines indentation
 1427|   123k|            if (content_indent < 0) {
  ------------------
  |  Branch (1427:17): [True: 47.7k, False: 75.3k]
  ------------------
 1428|  47.7k|               if (explicit_indent > 0) {
  ------------------
  |  Branch (1428:20): [True: 7.18k, False: 40.5k]
  ------------------
 1429|  7.18k|                  content_indent = base_indent + explicit_indent;
 1430|  7.18k|               }
 1431|  40.5k|               else {
 1432|  40.5k|                  content_indent = line_indent;
 1433|  40.5k|               }
 1434|       |
 1435|  47.7k|               if (content_indent <= base_indent) {
  ------------------
  |  Branch (1435:20): [True: 10.5k, False: 37.2k]
  ------------------
 1436|  10.5k|                  it = line_start;
 1437|  10.5k|                  break;
 1438|  10.5k|               }
 1439|  37.2k|               if (leading_blank_indent_max > content_indent) {
  ------------------
  |  Branch (1439:20): [True: 12, False: 37.1k]
  ------------------
 1440|     12|                  ctx.error = error_code::syntax_error;
 1441|     12|                  return;
 1442|     12|               }
 1443|  37.2k|            }
 1444|       |
 1445|       |            // Check if we've dedented
 1446|   112k|            if (line_indent < content_indent) {
  ------------------
  |  Branch (1446:17): [True: 8.04k, False: 104k]
  ------------------
 1447|  8.04k|               it = line_start;
 1448|  8.04k|               break;
 1449|  8.04k|            }
 1450|       |
 1451|       |            // Skip to content_indent level
 1452|   104k|            it = line_start;
 1453|   183k|            for (int32_t i = 0; i < content_indent && it != end && *it == ' '; ++i) {
  ------------------
  |  Branch (1453:33): [True: 78.8k, False: 104k]
  |  Branch (1453:55): [True: 78.8k, False: 0]
  |  Branch (1453:68): [True: 78.8k, False: 0]
  ------------------
 1454|  78.8k|               ++it;
 1455|  78.8k|            }
 1456|       |
 1457|   104k|            const bool current_line_starts_with_tab = (it != end && *it == '\t');
  ------------------
  |  Branch (1457:56): [True: 104k, False: 0]
  |  Branch (1457:69): [True: 1.61k, False: 102k]
  ------------------
 1458|   104k|            const bool current_line_more_indented = (line_indent > content_indent);
 1459|       |
 1460|       |            // Add previous newlines
 1461|   104k|            if (first_line) {
  ------------------
  |  Branch (1461:17): [True: 31.1k, False: 73.3k]
  ------------------
 1462|       |               // Leading blank lines are part of block scalar content
 1463|  31.1k|               value += trailing_newlines;
 1464|  31.1k|            }
 1465|  73.3k|            else {
 1466|  73.3k|               if (indicator == '|') {
  ------------------
  |  Branch (1466:20): [True: 27.5k, False: 45.7k]
  ------------------
 1467|       |                  // Literal: preserve newlines
 1468|  27.5k|                  value += trailing_newlines;
 1469|  27.5k|               }
 1470|  45.7k|               else {
 1471|       |                  // Folded: single newline becomes space, paragraph breaks keep one newline.
 1472|       |                  // Folding does not apply adjacent to "more indented" or tab-leading lines.
 1473|  45.7k|                  const size_t break_count = trailing_newlines.size();
 1474|  45.7k|                  const bool adjacent_special = previous_line_starts_with_tab || current_line_starts_with_tab ||
  ------------------
  |  Branch (1474:49): [True: 1.36k, False: 44.4k]
  |  Branch (1474:82): [True: 372, False: 44.0k]
  ------------------
 1475|  44.0k|                                                previous_line_more_indented || current_line_more_indented;
  ------------------
  |  Branch (1475:49): [True: 4.02k, False: 40.0k]
  |  Branch (1475:80): [True: 7.73k, False: 32.2k]
  ------------------
 1476|  45.7k|                  if (break_count == 1) {
  ------------------
  |  Branch (1476:23): [True: 32.6k, False: 13.1k]
  ------------------
 1477|  32.6k|                     if (adjacent_special) {
  ------------------
  |  Branch (1477:26): [True: 7.82k, False: 24.8k]
  ------------------
 1478|  7.82k|                        value.push_back('\n');
 1479|  7.82k|                     }
 1480|  24.8k|                     else {
 1481|  24.8k|                        value.push_back(' ');
 1482|  24.8k|                     }
 1483|  32.6k|                  }
 1484|  13.1k|                  else if (break_count > 1) {
  ------------------
  |  Branch (1484:28): [True: 13.1k, False: 0]
  ------------------
 1485|  13.1k|                     const size_t preserve_count = adjacent_special ? break_count : (break_count - 1);
  ------------------
  |  Branch (1485:52): [True: 5.67k, False: 7.42k]
  ------------------
 1486|  13.1k|                     value.append(preserve_count, '\n');
 1487|  13.1k|                  }
 1488|  45.7k|               }
 1489|  73.3k|            }
 1490|   104k|            trailing_newlines.clear();
 1491|   104k|            first_line = false;
 1492|   104k|            previous_line_starts_with_tab = current_line_starts_with_tab;
 1493|   104k|            previous_line_more_indented = current_line_more_indented;
 1494|       |
 1495|       |            // Read line content
 1496|  46.1M|            while (it != end && *it != '\n' && *it != '\r') {
  ------------------
  |  Branch (1496:20): [True: 46.1M, False: 13.8k]
  |  Branch (1496:33): [True: 46.1M, False: 35.8k]
  |  Branch (1496:48): [True: 46.0M, False: 54.8k]
  ------------------
 1497|  46.0M|               value.push_back(*it);
 1498|  46.0M|               ++it;
 1499|  46.0M|            }
 1500|       |
 1501|   104k|            trailing_newlines.push_back('\n');
 1502|   104k|            skip_newline(it, end);
 1503|   104k|         }
 1504|       |
 1505|       |         // Apply chomping
 1506|  50.7k|         if (chomping == '-') {
  ------------------
  |  Branch (1506:14): [True: 942, False: 49.8k]
  ------------------
 1507|       |            // Strip: remove all trailing newlines
 1508|    942|         }
 1509|  49.8k|         else if (chomping == '+') {
  ------------------
  |  Branch (1509:19): [True: 6.27k, False: 43.5k]
  ------------------
 1510|       |            // Keep: preserve all trailing newlines
 1511|  6.27k|            value += trailing_newlines;
 1512|  6.27k|         }
 1513|  43.5k|         else {
 1514|       |            // Clip: single trailing newline
 1515|  43.5k|            if (!value.empty()) {
  ------------------
  |  Branch (1515:17): [True: 25.7k, False: 17.7k]
  ------------------
 1516|  25.7k|               value.push_back('\n');
 1517|  25.7k|            }
 1518|  43.5k|         }
 1519|  50.7k|      }
_ZN3glz4yaml18parse_plain_scalarINS0_12yaml_contextEPKcS4_EEvRNSt3__112basic_stringIcNS5_11char_traitsIcEENS5_9allocatorIcEEEERT_RT0_T1_b:
 1009|  5.48M|      {
 1010|  5.48M|         value.clear();
 1011|       |
 1012|   416M|         while (it != end) {
  ------------------
  |  Branch (1012:17): [True: 415M, False: 1.32M]
  ------------------
 1013|   415M|            const char c = *it;
 1014|       |
 1015|       |            // End conditions
 1016|   415M|            if (c == '\n' || c == '\r') {
  ------------------
  |  Branch (1016:17): [True: 3.05M, False: 412M]
  |  Branch (1016:30): [True: 4.80M, False: 407M]
  ------------------
 1017|  7.85M|               if (in_flow) {
  ------------------
  |  Branch (1017:20): [True: 7.81M, False: 48.4k]
  ------------------
 1018|  7.81M|                  auto continuation = it;
 1019|  7.81M|                  skip_newline(continuation, end);
 1020|  7.81M|                  bool continuation_is_comment = false;
 1021|       |
 1022|  7.81M|                  while (continuation != end) {
  ------------------
  |  Branch (1022:26): [True: 7.76M, False: 45.8k]
  ------------------
 1023|  13.2M|                     while (continuation != end && (*continuation == ' ' || *continuation == '\t')) {
  ------------------
  |  Branch (1023:29): [True: 13.2M, False: 6.59k]
  |  Branch (1023:53): [True: 4.60M, False: 8.63M]
  |  Branch (1023:77): [True: 875k, False: 7.75M]
  ------------------
 1024|  5.48M|                        ++continuation;
 1025|  5.48M|                     }
 1026|  7.76M|                     if (continuation != end && *continuation == '#') {
  ------------------
  |  Branch (1026:26): [True: 7.75M, False: 6.59k]
  |  Branch (1026:49): [True: 142k, False: 7.61M]
  ------------------
 1027|       |                        // Comment lines terminate plain flow scalars; the caller
 1028|       |                        // will consume comments/separators outside this scalar.
 1029|   142k|                        continuation_is_comment = true;
 1030|   142k|                        break;
 1031|   142k|                     }
 1032|  7.62M|                     break;
 1033|  7.76M|                  }
 1034|       |
 1035|  7.81M|                  if (continuation_is_comment || continuation == end || *continuation == ',' || *continuation == ']' ||
  ------------------
  |  Branch (1035:23): [True: 142k, False: 7.66M]
  |  Branch (1035:50): [True: 52.4k, False: 7.61M]
  |  Branch (1035:73): [True: 262k, False: 7.35M]
  |  Branch (1035:97): [True: 2.68k, False: 7.35M]
  ------------------
 1036|  7.35M|                      *continuation == '}' || *continuation == ':') {
  ------------------
  |  Branch (1036:23): [True: 41.0k, False: 7.30M]
  |  Branch (1036:47): [True: 40.7k, False: 7.26M]
  ------------------
 1037|   541k|                     break;
 1038|   541k|                  }
 1039|       |
 1040|  13.5M|                  while (!value.empty() && (value.back() == ' ' || value.back() == '\t')) {
  ------------------
  |  Branch (1040:26): [True: 13.1M, False: 402k]
  |  Branch (1040:45): [True: 5.68M, False: 7.44M]
  |  Branch (1040:68): [True: 581k, False: 6.86M]
  ------------------
 1041|  6.26M|                     value.pop_back();
 1042|  6.26M|                  }
 1043|  7.26M|                  if (!value.empty()) {
  ------------------
  |  Branch (1043:23): [True: 6.86M, False: 402k]
  ------------------
 1044|  6.86M|                     value.push_back(' ');
 1045|  6.86M|                  }
 1046|  7.26M|                  it = continuation;
 1047|  7.26M|                  continue;
 1048|  7.81M|               }
 1049|  48.4k|               break;
 1050|  7.85M|            }
 1051|       |
 1052|       |            // Per YAML spec: # only starts a comment when preceded by whitespace
 1053|       |            // "foo#bar" is a valid plain scalar, but "foo #bar" has a comment
 1054|   407M|            if (c == '#') {
  ------------------
  |  Branch (1054:17): [True: 3.30M, False: 403M]
  ------------------
 1055|       |               // Check if preceded by whitespace (comment indicator)
 1056|  3.30M|               if (value.empty() || value.back() == ' ' || value.back() == '\t') {
  ------------------
  |  Branch (1056:20): [True: 3.10k, False: 3.30M]
  |  Branch (1056:37): [True: 66.8k, False: 3.23M]
  |  Branch (1056:60): [True: 4.65k, False: 3.22M]
  ------------------
 1057|  74.6k|                  break; // This is a comment
 1058|  74.6k|               }
 1059|       |               // Otherwise # is part of the scalar value
 1060|  3.30M|            }
 1061|       |
 1062|       |            // Flow indicators end plain scalars in flow context
 1063|   407M|            if (in_flow && (c == ',' || c == ']' || c == '}')) break;
  ------------------
  |  Branch (1063:17): [True: 392M, False: 15.0M]
  |  Branch (1063:29): [True: 2.51M, False: 389M]
  |  Branch (1063:41): [True: 130k, False: 389M]
  |  Branch (1063:53): [True: 501k, False: 388M]
  ------------------
 1064|       |
 1065|       |            // Colon followed by space/newline ends plain scalar
 1066|   404M|            if (c == ':') {
  ------------------
  |  Branch (1066:17): [True: 1.43M, False: 402M]
  ------------------
 1067|  1.43M|               if ((it + 1) == end || *(it + 1) == ' ' || *(it + 1) == '\t' || *(it + 1) == '\n' || *(it + 1) == '\r') {
  ------------------
  |  Branch (1067:20): [True: 25.8k, False: 1.40M]
  |  Branch (1067:39): [True: 140k, False: 1.26M]
  |  Branch (1067:59): [True: 22.3k, False: 1.24M]
  |  Branch (1067:80): [True: 26.1k, False: 1.21M]
  |  Branch (1067:101): [True: 75.7k, False: 1.14M]
  ------------------
 1068|   290k|                  break;
 1069|   290k|               }
 1070|  1.14M|               if (in_flow && (*(it + 1) == ',' || *(it + 1) == ']' || *(it + 1) == '}')) {
  ------------------
  |  Branch (1070:20): [True: 1.12M, False: 15.3k]
  |  Branch (1070:32): [True: 37.8k, False: 1.08M]
  |  Branch (1070:52): [True: 11.9k, False: 1.07M]
  |  Branch (1070:72): [True: 5.57k, False: 1.07M]
  ------------------
 1071|  55.3k|                  break;
 1072|  55.3k|               }
 1073|  1.14M|            }
 1074|       |
 1075|   403M|            value.push_back(c);
 1076|   403M|            ++it;
 1077|   403M|         }
 1078|       |
 1079|       |         // Trim trailing whitespace
 1080|  8.18M|         while (!value.empty() && (value.back() == ' ' || value.back() == '\t')) {
  ------------------
  |  Branch (1080:17): [True: 7.80M, False: 384k]
  |  Branch (1080:36): [True: 1.00M, False: 6.79M]
  |  Branch (1080:59): [True: 1.69M, False: 5.10M]
  ------------------
 1081|  2.70M|            value.pop_back();
 1082|  2.70M|         }
 1083|       |
 1084|  5.48M|         if (in_flow && (value == "---" || value == "..." || value == "-")) {
  ------------------
  |  Branch (1084:14): [True: 5.36M, False: 118k]
  |  Branch (1084:26): [True: 10, False: 5.36M]
  |  Branch (1084:44): [True: 10, False: 5.36M]
  |  Branch (1084:62): [True: 32, False: 5.36M]
  ------------------
 1085|     52|            ctx.error = error_code::syntax_error;
 1086|     52|         }
 1087|  5.48M|      }
_ZN3glz33process_yaml_variant_alternativesINSt3__17variantIJDndNS1_12basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEbNS1_6vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS6_ISD_EEEENSC_ISD_EEEEENS_19is_yaml_variant_numEE2opITnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1ELb0ELb0ELb0ELb0ELj1EEERSH_TkNS_10is_contextERNS_4yaml12yaml_contextERPKcSR_EEvOT0_OT1_OT2_T3_:
 5205|   754k|      {
 5206|   754k|         constexpr auto category_count = yaml_variant_count_v<Variant, Trait>;
 5207|       |
 5208|       |         if constexpr (category_count == 0) {
 5209|       |            ctx.error = error_code::no_matching_variant_type;
 5210|       |         }
 5211|   754k|         else if constexpr (category_count == 1) {
 5212|       |            // Only one type in this category, use it directly
 5213|   754k|            constexpr auto first_idx = yaml_variant_first_index_v<Variant, Trait>;
 5214|   754k|            using V = std::variant_alternative_t<first_idx, Variant>;
 5215|   754k|            if (!std::holds_alternative<V>(value)) value = V{};
  ------------------
  |  Branch (5215:17): [True: 754k, False: 0]
  ------------------
 5216|   754k|            from<YAML, V>::template op<Opts>(std::get<V>(value), ctx, it, end);
 5217|       |         }
 5218|       |         else {
 5219|       |            // Multiple types in this category, try each one
 5220|       |            constexpr auto N = std::variant_size_v<Variant>;
 5221|       |            bool found_match{};
 5222|       |            size_t match_idx = 0;
 5223|       |            // Only the last alternative propagates its error, so an alternative that exhausted an
 5224|       |            // expansion budget would otherwise be reported as no_matching_variant_type -- a wrong
 5225|       |            // diagnosis for a document that is hostile rather than merely the wrong shape. Held
 5226|       |            // aside and used only if nothing matched, so an alternative that does succeed later
 5227|       |            // (one that materializes no key text can still parse under a latched budget) is
 5228|       |            // unaffected.
 5229|       |            error_code expansion_error{};
 5230|       |            std::string_view expansion_message{};
 5231|       |
 5232|       |            for_each<N>([&]<size_t I>() {
 5233|       |               if (found_match) {
 5234|       |                  return;
 5235|       |               }
 5236|       |               using V = std::variant_alternative_t<I, Variant>;
 5237|       |               if constexpr (Trait<V>::value) {
 5238|       |                  auto copy_it = it;
 5239|       |                  if (!std::holds_alternative<V>(value)) {
 5240|       |                     value = V{};
 5241|       |                  }
 5242|       |
 5243|       |                  auto temp_ctx = ctx.make_speculative();
 5244|       |                  from<YAML, V>::template op<Opts>(std::get<V>(value), temp_ctx, it, end);
 5245|       |
 5246|       |                  // Charged whether or not the alternative fit: a rejected probe still replayed
 5247|       |                  // whatever aliases it reached, and an attempt that is never billed is an
 5248|       |                  // attempt that can be repeated for free.
 5249|       |                  ctx.alias_expansion_budget = temp_ctx.alias_expansion_budget;
 5250|       |                  ctx.key_expansion_budget = temp_ctx.key_expansion_budget;
 5251|       |
 5252|       |                  if (!bool(temp_ctx.error)) {
 5253|       |                     found_match = true;
 5254|       |                     ctx.anchors = std::move(temp_ctx.anchors);
 5255|       |                  }
 5256|       |                  else {
 5257|       |                     it = copy_it;
 5258|       |                     if (temp_ctx.error == error_code::exceeded_max_expansion && expansion_error == error_code::none) {
 5259|       |                        expansion_error = temp_ctx.error;
 5260|       |                        expansion_message = temp_ctx.custom_error_message;
 5261|       |                     }
 5262|       |                     if (match_idx + 1 < category_count) {
 5263|       |                        // Not the last type, continue trying
 5264|       |                     }
 5265|       |                     else {
 5266|       |                        // Last type failed, propagate error
 5267|       |                        ctx.error = temp_ctx.error;
 5268|       |                        ctx.custom_error_message = temp_ctx.custom_error_message;
 5269|       |                     }
 5270|       |                  }
 5271|       |                  ++match_idx;
 5272|       |               }
 5273|       |            });
 5274|       |
 5275|       |            if (!found_match && !bool(ctx.error)) {
 5276|       |               if (expansion_error != error_code::none) {
 5277|       |                  ctx.error = expansion_error;
 5278|       |                  ctx.custom_error_message = expansion_message;
 5279|       |               }
 5280|       |               else {
 5281|       |                  ctx.error = error_code::no_matching_variant_type;
 5282|       |               }
 5283|       |            }
 5284|       |         }
 5285|   754k|      }
_ZN3glz4fromILj450EdE2opITnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1ELb0ELb0ELb0ELb0ELj1EEERPKcRdTkNS_10is_contextERNS_4yaml12yaml_contextES5_EEvOT1_OT2_OT0_T3_:
 2047|   758k|      {
 2048|   758k|         if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2048:14): [True: 0, False: 758k]
  ------------------
 2049|      0|            return;
 2050|       |
 2051|   758k|         yaml::node_preamble_state preamble{};
 2052|   758k|         if (yaml::parse_node_preamble<Opts>(value, ctx, it, end, preamble, [](yaml::yaml_tag tag) {
  ------------------
  |  Branch (2052:14): [True: 6.32k, False: 752k]
  ------------------
 2053|   758k|                if constexpr (std::floating_point<std::remove_cvref_t<T>>) {
 2054|   758k|                   return yaml::tag_valid_for_float(tag);
 2055|   758k|                }
 2056|   758k|                else {
 2057|   758k|                   return yaml::tag_valid_for_int(tag);
 2058|   758k|                }
 2059|   758k|             }))
 2060|  6.32k|            return;
 2061|       |
 2062|   752k|         auto finalize = [&] { yaml::finalize_node_anchor(preamble.node_props, ctx, it); };
 2063|       |
 2064|       |         // Check for special float values
 2065|   752k|         if constexpr (std::floating_point<std::remove_cvref_t<T>>) {
 2066|   752k|            auto start = it;
 2067|       |
 2068|       |            // Check for .inf, .nan, -.inf, etc.
 2069|   752k|            if (*it == '.') {
  ------------------
  |  Branch (2069:17): [True: 21.7k, False: 730k]
  ------------------
 2070|  21.7k|               ++it;
 2071|  21.7k|               if (it + 3 <= end && (std::string_view(it, 3) == "inf" || std::string_view(it, 3) == "Inf" ||
  ------------------
  |  Branch (2071:20): [True: 20.7k, False: 1.04k]
  |  Branch (2071:38): [True: 1.24k, False: 19.4k]
  |  Branch (2071:74): [True: 1.81k, False: 17.6k]
  ------------------
 2072|  17.6k|                                     std::string_view(it, 3) == "INF")) {
  ------------------
  |  Branch (2072:38): [True: 1.80k, False: 15.8k]
  ------------------
 2073|  4.86k|                  value = std::numeric_limits<std::remove_cvref_t<T>>::infinity();
 2074|  4.86k|                  it += 3;
 2075|  4.86k|                  finalize();
 2076|  4.86k|                  return;
 2077|  4.86k|               }
 2078|  16.9k|               if (it + 3 <= end && (std::string_view(it, 3) == "nan" || std::string_view(it, 3) == "NaN" ||
  ------------------
  |  Branch (2078:20): [True: 15.8k, False: 1.04k]
  |  Branch (2078:38): [True: 299, False: 15.5k]
  |  Branch (2078:74): [True: 597, False: 14.9k]
  ------------------
 2079|  14.9k|                                     std::string_view(it, 3) == "NAN")) {
  ------------------
  |  Branch (2079:38): [True: 1.18k, False: 13.7k]
  ------------------
 2080|  2.08k|                  value = std::numeric_limits<std::remove_cvref_t<T>>::quiet_NaN();
 2081|  2.08k|                  it += 3;
 2082|  2.08k|                  finalize();
 2083|  2.08k|                  return;
 2084|  2.08k|               }
 2085|  14.8k|               it = start;
 2086|  14.8k|            }
 2087|       |
 2088|   745k|            if (*it == '-' || *it == '+') {
  ------------------
  |  Branch (2088:17): [True: 51.1k, False: 694k]
  |  Branch (2088:31): [True: 25.9k, False: 668k]
  ------------------
 2089|  77.0k|               const char sign = *it;
 2090|  77.0k|               ++it;
 2091|  77.0k|               if (it != end && *it == '.') {
  ------------------
  |  Branch (2091:20): [True: 76.6k, False: 402]
  |  Branch (2091:33): [True: 51.2k, False: 25.4k]
  ------------------
 2092|  51.2k|                  ++it;
 2093|  51.2k|                  if (it + 3 <= end && (std::string_view(it, 3) == "inf" || std::string_view(it, 3) == "Inf" ||
  ------------------
  |  Branch (2093:23): [True: 50.8k, False: 412]
  |  Branch (2093:41): [True: 41.4k, False: 9.32k]
  |  Branch (2093:77): [True: 867, False: 8.45k]
  ------------------
 2094|  49.2k|                                        std::string_view(it, 3) == "INF")) {
  ------------------
  |  Branch (2094:41): [True: 6.86k, False: 1.59k]
  ------------------
 2095|  49.2k|                     if (sign == '-') {
  ------------------
  |  Branch (2095:26): [True: 48.7k, False: 442]
  ------------------
 2096|  48.7k|                        value = -std::numeric_limits<std::remove_cvref_t<T>>::infinity();
 2097|  48.7k|                     }
 2098|    442|                     else {
 2099|    442|                        value = std::numeric_limits<std::remove_cvref_t<T>>::infinity();
 2100|    442|                     }
 2101|  49.2k|                     it += 3;
 2102|  49.2k|                     finalize();
 2103|  49.2k|                     return;
 2104|  49.2k|                  }
 2105|  51.2k|               }
 2106|  27.8k|               it = start;
 2107|  27.8k|            }
 2108|   745k|         }
 2109|       |
 2110|       |         // Parse as plain scalar and convert
 2111|   696k|         auto start = it;
 2112|       |
 2113|       |         // Find end of number - use same rules as plain scalar for colons
 2114|  21.9M|         while (it != end) {
  ------------------
  |  Branch (2114:17): [True: 21.8M, False: 65.6k]
  ------------------
 2115|  21.8M|            const char c = *it;
 2116|  21.8M|            if (c == ' ' || c == '\t' || c == '\n' || c == '\r' || c == ',' || c == ']' || c == '}' || c == '#') {
  ------------------
  |  Branch (2116:17): [True: 38.5k, False: 21.8M]
  |  Branch (2116:29): [True: 49.2k, False: 21.8M]
  |  Branch (2116:42): [True: 5.15k, False: 21.7M]
  |  Branch (2116:55): [True: 45.0k, False: 21.7M]
  |  Branch (2116:68): [True: 525k, False: 21.2M]
  |  Branch (2116:80): [True: 1.89k, False: 21.2M]
  |  Branch (2116:92): [True: 2.41k, False: 21.2M]
  |  Branch (2116:104): [True: 14.2k, False: 21.2M]
  ------------------
 2117|   682k|               break;
 2118|   682k|            }
 2119|       |            // Colon only ends number if followed by space/tab/newline/end (YAML mapping indicator)
 2120|  21.2M|            if (c == ':') {
  ------------------
  |  Branch (2120:17): [True: 24.5k, False: 21.1M]
  ------------------
 2121|  24.5k|               if ((it + 1) == end || *(it + 1) == ' ' || *(it + 1) == '\t' || *(it + 1) == '\n' || *(it + 1) == '\r') {
  ------------------
  |  Branch (2121:20): [True: 495, False: 24.0k]
  |  Branch (2121:39): [True: 1.64k, False: 22.3k]
  |  Branch (2121:59): [True: 377, False: 21.9k]
  |  Branch (2121:80): [True: 1.36k, False: 20.6k]
  |  Branch (2121:101): [True: 563, False: 20.0k]
  ------------------
 2122|  4.44k|                  break;
 2123|  4.44k|               }
 2124|  24.5k|            }
 2125|  21.2M|            ++it;
 2126|  21.2M|         }
 2127|       |
 2128|   752k|         const std::string_view num_str(&*start, static_cast<size_t>(it - start));
 2129|       |
 2130|   752k|         if (num_str.empty()) {
  ------------------
  |  Branch (2130:14): [True: 658, False: 751k]
  ------------------
 2131|    658|            ctx.error = error_code::parse_number_failure;
 2132|    658|            return;
 2133|    658|         }
 2134|       |
 2135|       |         // Handle hex, octal, binary
 2136|       |         if constexpr (std::integral<std::remove_cvref_t<T>>) {
 2137|       |            if (num_str.size() > 2 && num_str[0] == '0') {
 2138|       |               int base = 10;
 2139|       |               size_t offset = 0;
 2140|       |
 2141|       |               if (num_str[1] == 'x' || num_str[1] == 'X') {
 2142|       |                  base = 16;
 2143|       |                  offset = 2;
 2144|       |               }
 2145|       |               else if (num_str[1] == 'o' || num_str[1] == 'O') {
 2146|       |                  base = 8;
 2147|       |                  offset = 2;
 2148|       |               }
 2149|       |               else if (num_str[1] == 'b' || num_str[1] == 'B') {
 2150|       |                  base = 2;
 2151|       |                  offset = 2;
 2152|       |               }
 2153|       |
 2154|       |               if (base != 10) {
 2155|       |                  const auto digits = num_str.substr(offset);
 2156|       |                  const bool has_underscores = (digits.find('_') != std::string_view::npos);
 2157|       |
 2158|       |                  std::string clean_storage;
 2159|       |                  std::string_view clean_view;
 2160|       |
 2161|       |                  if (has_underscores) {
 2162|       |                     clean_storage.reserve(digits.size());
 2163|       |                     for (char c : digits) {
 2164|       |                        if (c != '_') {
 2165|       |                           clean_storage.push_back(c);
 2166|       |                        }
 2167|       |                     }
 2168|       |                     clean_view = clean_storage;
 2169|       |                  }
 2170|       |                  else {
 2171|       |                     clean_view = digits;
 2172|       |                  }
 2173|       |
 2174|       |                  auto [ptr, ec] =
 2175|       |                     std::from_chars(clean_view.data(), clean_view.data() + clean_view.size(), value, base);
 2176|       |                  if (ec != std::errc{}) {
 2177|       |                     ctx.error = error_code::parse_number_failure;
 2178|       |                  }
 2179|       |                  finalize();
 2180|       |                  return;
 2181|       |               }
 2182|       |            }
 2183|       |         }
 2184|   751k|         else if constexpr (std::floating_point<std::remove_cvref_t<T>>) {
 2185|   751k|            bool negative = false;
 2186|   751k|            std::string_view digits = num_str;
 2187|       |
 2188|   751k|            if (!digits.empty() && (digits.front() == '+' || digits.front() == '-')) {
  ------------------
  |  Branch (2188:17): [True: 695k, False: 56.1k]
  |  Branch (2188:37): [True: 25.4k, False: 669k]
  |  Branch (2188:62): [True: 2.37k, False: 667k]
  ------------------
 2189|  27.8k|               negative = (digits.front() == '-');
 2190|  27.8k|               digits.remove_prefix(1);
 2191|  27.8k|            }
 2192|       |
 2193|   751k|            if (digits.size() > 2 && digits[0] == '0') {
  ------------------
  |  Branch (2193:17): [True: 191k, False: 560k]
  |  Branch (2193:38): [True: 57.0k, False: 134k]
  ------------------
 2194|  57.0k|               int base = 10;
 2195|  57.0k|               size_t offset = 0;
 2196|       |
 2197|  57.0k|               if (digits[1] == 'x' || digits[1] == 'X') {
  ------------------
  |  Branch (2197:20): [True: 3.20k, False: 53.8k]
  |  Branch (2197:40): [True: 367, False: 53.4k]
  ------------------
 2198|  3.56k|                  base = 16;
 2199|  3.56k|                  offset = 2;
 2200|  3.56k|               }
 2201|  53.4k|               else if (digits[1] == 'o' || digits[1] == 'O') {
  ------------------
  |  Branch (2201:25): [True: 1.34k, False: 52.1k]
  |  Branch (2201:45): [True: 1.06k, False: 51.0k]
  ------------------
 2202|  2.40k|                  base = 8;
 2203|  2.40k|                  offset = 2;
 2204|  2.40k|               }
 2205|  51.0k|               else if (digits[1] == 'b' || digits[1] == 'B') {
  ------------------
  |  Branch (2205:25): [True: 463, False: 50.6k]
  |  Branch (2205:45): [True: 253, False: 50.3k]
  ------------------
 2206|    716|                  base = 2;
 2207|    716|                  offset = 2;
 2208|    716|               }
 2209|       |
 2210|  57.0k|               if (base != 10) {
  ------------------
  |  Branch (2210:20): [True: 6.68k, False: 50.3k]
  ------------------
 2211|  6.68k|                  auto raw_digits = digits.substr(offset);
 2212|  6.68k|                  const bool has_underscores = (raw_digits.find('_') != std::string_view::npos);
 2213|       |
 2214|  6.68k|                  std::string clean_storage;
 2215|  6.68k|                  std::string_view clean_view;
 2216|  6.68k|                  if (has_underscores) {
  ------------------
  |  Branch (2216:23): [True: 2.05k, False: 4.63k]
  ------------------
 2217|  2.05k|                     clean_storage.reserve(raw_digits.size());
 2218|  2.03M|                     for (char c : raw_digits) {
  ------------------
  |  Branch (2218:34): [True: 2.03M, False: 2.05k]
  ------------------
 2219|  2.03M|                        if (c != '_') {
  ------------------
  |  Branch (2219:29): [True: 2.02M, False: 5.47k]
  ------------------
 2220|  2.02M|                           clean_storage.push_back(c);
 2221|  2.02M|                        }
 2222|  2.03M|                     }
 2223|  2.05k|                     clean_view = clean_storage;
 2224|  2.05k|                  }
 2225|  4.63k|                  else {
 2226|  4.63k|                     clean_view = raw_digits;
 2227|  4.63k|                  }
 2228|       |
 2229|  6.68k|                  uint64_t parsed_int{};
 2230|  6.68k|                  auto [ptr, ec] =
 2231|  6.68k|                     std::from_chars(clean_view.data(), clean_view.data() + clean_view.size(), parsed_int, base);
 2232|  6.68k|                  if (ec != std::errc{} || ptr != (clean_view.data() + clean_view.size())) {
  ------------------
  |  Branch (2232:23): [True: 2.32k, False: 4.36k]
  |  Branch (2232:44): [True: 2.68k, False: 1.67k]
  ------------------
 2233|  5.01k|                     ctx.error = error_code::parse_number_failure;
 2234|  5.01k|                     finalize();
 2235|  5.01k|                     return;
 2236|  5.01k|                  }
 2237|       |
 2238|  1.67k|                  const auto as_float = static_cast<std::remove_cvref_t<T>>(parsed_int);
 2239|  1.67k|                  value = negative ? -as_float : as_float;
  ------------------
  |  Branch (2239:27): [True: 400, False: 1.27k]
  ------------------
 2240|  1.67k|                  finalize();
 2241|  1.67k|                  return;
 2242|  6.68k|               }
 2243|  57.0k|            }
 2244|   751k|         }
 2245|       |
 2246|       |         // Standard number parsing - only allocate if underscores present
 2247|   744k|         const bool has_underscores = (num_str.find('_') != std::string_view::npos);
 2248|       |
 2249|   751k|         std::string clean_storage;
 2250|   751k|         std::string_view clean_view;
 2251|       |
 2252|   751k|         if (has_underscores) {
  ------------------
  |  Branch (2252:14): [True: 2.48k, False: 749k]
  ------------------
 2253|  2.48k|            clean_storage.reserve(num_str.size());
 2254|  9.51M|            for (char c : num_str) {
  ------------------
  |  Branch (2254:25): [True: 9.51M, False: 2.48k]
  ------------------
 2255|  9.51M|               if (c != '_') {
  ------------------
  |  Branch (2255:20): [True: 9.50M, False: 8.44k]
  ------------------
 2256|  9.50M|                  clean_storage.push_back(c);
 2257|  9.50M|               }
 2258|  9.51M|            }
 2259|  2.48k|            clean_view = clean_storage;
 2260|  2.48k|         }
 2261|   749k|         else {
 2262|   749k|            clean_view = num_str;
 2263|   749k|         }
 2264|       |
 2265|       |         // YAML allows leading '+' for positive numbers, but C++ from_chars doesn't
 2266|       |         // Strip leading '+' if present
 2267|   751k|         auto parse_view = clean_view;
 2268|   751k|         if (!parse_view.empty() && parse_view.front() == '+') {
  ------------------
  |  Branch (2268:14): [True: 688k, False: 62.9k]
  |  Branch (2268:37): [True: 25.4k, False: 663k]
  ------------------
 2269|  25.4k|            parse_view.remove_prefix(1);
 2270|  25.4k|            if (parse_view.empty()) {
  ------------------
  |  Branch (2270:17): [True: 6.36k, False: 19.1k]
  ------------------
 2271|  6.36k|               ctx.error = error_code::parse_number_failure;
 2272|  6.36k|               return;
 2273|  6.36k|            }
 2274|  25.4k|         }
 2275|       |
 2276|   745k|         if constexpr (std::floating_point<std::remove_cvref_t<T>>) {
 2277|   745k|            auto result = glz::fast_float::from_chars(parse_view.data(), parse_view.data() + parse_view.size(), value);
 2278|       |            // Check both for errors and that all input was consumed (e.g., "12:30" is not a valid number)
 2279|   745k|            if (result.ec != std::errc{} || result.ptr != parse_view.data() + parse_view.size()) {
  ------------------
  |  Branch (2279:17): [True: 94.5k, False: 650k]
  |  Branch (2279:45): [True: 63.0k, False: 587k]
  ------------------
 2280|  94.7k|               ctx.error = error_code::parse_number_failure;
 2281|  94.7k|            }
 2282|       |         }
 2283|       |         else {
 2284|       |            auto [ptr, ec] = std::from_chars(parse_view.data(), parse_view.data() + parse_view.size(), value);
 2285|       |            // Check both for errors and that all input was consumed
 2286|       |            if (ec != std::errc{} || ptr != parse_view.data() + parse_view.size()) {
 2287|       |               ctx.error = error_code::parse_number_failure;
 2288|       |            }
 2289|       |         }
 2290|       |
 2291|   745k|         finalize();
 2292|   745k|      }
_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|   758k|      {
  466|   758k|         skip_inline_ws(it, end);
  467|       |
  468|   758k|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (468:14): [True: 212, False: 758k]
  ------------------
  469|    212|            if constexpr (!AllowEmptyInput) {
  470|    212|               ctx.error = error_code::unexpected_end;
  471|    212|            }
  472|    212|            return true;
  473|    212|         }
  474|       |
  475|   758k|         preamble.tag = parse_yaml_tag(it, end, ctx);
  476|   758k|         if (preamble.tag == yaml_tag::unknown) [[unlikely]] {
  ------------------
  |  Branch (476:14): [True: 137, False: 758k]
  ------------------
  477|    137|            ctx.error = error_code::syntax_error;
  478|    137|            return true;
  479|    137|         }
  480|   758k|         if (!tag_validator(preamble.tag)) [[unlikely]] {
  ------------------
  |  Branch (480:14): [True: 128, False: 758k]
  ------------------
  481|    128|            ctx.error = error_code::syntax_error;
  482|    128|            return true;
  483|    128|         }
  484|       |
  485|   758k|         skip_inline_ws(it, end);
  486|       |
  487|   758k|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (487:14): [True: 85, False: 758k]
  ------------------
  488|     85|            if constexpr (!AllowEmptyInput) {
  489|     85|               ctx.error = error_code::unexpected_end;
  490|     85|            }
  491|     85|            return true;
  492|     85|         }
  493|       |
  494|   758k|         if (parse_node_properties<Opts, PropertyPolicy>(std::forward<T>(value), ctx, it, end, preamble.node_props)) {
  ------------------
  |  Branch (494:14): [True: 5.76k, False: 752k]
  ------------------
  495|  5.76k|            return true;
  496|  5.76k|         }
  497|       |
  498|   752k|         return false;
  499|   758k|      }
_ZZN3glz4fromILj450EdE2opITnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1ELb0ELb0ELb0ELb0ELj1EEERPKcRdTkNS_10is_contextERNS_4yaml12yaml_contextES5_EEvOT1_OT2_OT0_T3_ENKUlNS8_8yaml_tagEE_clESI_:
 2052|   758k|         if (yaml::parse_node_preamble<Opts>(value, ctx, it, end, preamble, [](yaml::yaml_tag tag) {
 2053|   758k|                if constexpr (std::floating_point<std::remove_cvref_t<T>>) {
 2054|   758k|                   return yaml::tag_valid_for_float(tag);
 2055|       |                }
 2056|       |                else {
 2057|       |                   return yaml::tag_valid_for_int(tag);
 2058|       |                }
 2059|   758k|             }))
_ZN3glz4yaml21parse_node_propertiesITnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1ELb0ELb0ELb0ELb0ELj1EEEXtlNS0_20node_property_policyELb1EEERdNS0_12yaml_contextEPKcS7_EEbOT1_RT2_RT3_T4_RNS0_19node_property_stateE:
  408|   758k|      {
  409|   758k|         state.has_anchor = false;
  410|   758k|         state.anchor_name.clear();
  411|   758k|         state.anchor_start = nullptr;
  412|   758k|         state.anchor_indent = ctx.current_indent();
  413|       |
  414|   758k|         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|   758k|            else {
  421|   758k|               if (handle_alias<Opts>(std::forward<T>(value), ctx, it, end)) return true;
  ------------------
  |  Branch (421:20): [True: 5.35k, False: 752k]
  ------------------
  422|   758k|            }
  423|   758k|         }
  424|       |
  425|   758k|         if (it != end && *it == '&') {
  ------------------
  |  Branch (425:14): [True: 752k, False: 5.35k]
  |  Branch (425:27): [True: 6.41k, False: 746k]
  ------------------
  426|  6.41k|            ++it;
  427|  6.41k|            auto name = parse_anchor_name(it, end);
  428|  6.41k|            if (name.empty()) {
  ------------------
  |  Branch (428:17): [True: 269, False: 6.14k]
  ------------------
  429|    269|               ctx.error = error_code::syntax_error;
  430|    269|               return true;
  431|    269|            }
  432|  6.14k|            skip_inline_ws(it, end);
  433|  6.14k|            if (it == end) {
  ------------------
  |  Branch (433:17): [True: 143, False: 6.00k]
  ------------------
  434|    143|               if constexpr (!Policy.allow_empty_after_anchor) {
  435|    143|                  ctx.error = error_code::unexpected_end;
  436|    143|               }
  437|    143|               return true;
  438|    143|            }
  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.00k|            state.has_anchor = true;
  446|  6.00k|            state.anchor_name = std::string(name);
  447|  6.00k|            state.anchor_start = &*it;
  448|  6.00k|         }
  449|       |
  450|   757k|         return false;
  451|   758k|      }
_ZN3glz4yaml12handle_aliasITnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1ELb0ELb0ELb0ELb0ELj1EEERdNS0_12yaml_contextEPKcS6_EEbOT0_RT1_RT2_T3_:
  300|   758k|      {
  301|   758k|         if (it == end || *it != '*') return false;
  ------------------
  |  Branch (301:14): [True: 0, False: 758k]
  |  Branch (301:27): [True: 752k, False: 5.35k]
  ------------------
  302|       |
  303|  5.35k|         ++it; // skip '*'
  304|  5.35k|         auto name = parse_anchor_name(it, end);
  305|  5.35k|         if (name.empty()) {
  ------------------
  |  Branch (305:14): [True: 133, False: 5.21k]
  ------------------
  306|    133|            ctx.error = error_code::syntax_error;
  307|    133|            return true;
  308|    133|         }
  309|       |
  310|  5.21k|         auto anchor_it = ctx.anchors.find(name);
  311|  5.21k|         if (anchor_it == ctx.anchors.end()) {
  ------------------
  |  Branch (311:14): [True: 390, False: 4.82k]
  ------------------
  312|    390|            ctx.error = error_code::syntax_error; // undefined alias
  313|    390|            return true;
  314|    390|         }
  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.82k|         const auto span = anchor_it->second;
  319|       |
  320|       |         // Empty anchor span (anchor on null/empty node) — leave value as default
  321|  4.82k|         if (span.begin == span.end) {
  ------------------
  |  Branch (321:14): [True: 611, False: 4.21k]
  ------------------
  322|    611|            return true;
  323|    611|         }
  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.21k|         if (ctx.alias_span_is_replaying(span.begin, span.end)) [[unlikely]] {
  ------------------
  |  Branch (328:14): [True: 5, False: 4.21k]
  ------------------
  329|      5|            ctx.error = error_code::syntax_error; // cyclic alias
  330|      5|            return true;
  331|      5|         }
  332|       |
  333|       |         // Replaying an anchor re-enters the reader directly, bypassing the variant reader's
  334|       |         // depth guard, so this is the only depth accounting a chain of aliases into a
  335|       |         // non-variant target gets. The cycle check above stops the unbounded case; this bounds
  336|       |         // a legitimate but deeply chained one.
  337|  4.21k|         depth_guard guard{ctx, yaml::max_yaml_recursive_depth};
  338|  4.21k|         if (!guard) [[unlikely]]
  ------------------
  |  Branch (338:14): [True: 1, False: 4.21k]
  ------------------
  339|      1|            return true;
  340|       |
  341|  4.21k|         if (!ctx.charge_alias_expansion(static_cast<size_t>(span.end - span.begin))) [[unlikely]] {
  ------------------
  |  Branch (341:14): [True: 0, False: 4.21k]
  ------------------
  342|      0|            ctx.error = error_code::exceeded_max_expansion;
  343|      0|            ctx.custom_error_message = "alias expansion";
  344|      0|            return true;
  345|      0|         }
  346|       |
  347|  4.21k|         auto replay_it = span.begin;
  348|  4.21k|         auto replay_end = span.end;
  349|       |
  350|       |         // Save indent context and set up for replay
  351|  4.21k|         auto saved_indent_stack = std::move(ctx.indent_stack);
  352|  4.21k|         ctx.indent_stack.clear();
  353|  4.21k|         if (span.base_indent > 0) {
  ------------------
  |  Branch (353:14): [True: 2.42k, False: 1.79k]
  ------------------
  354|  2.42k|            ctx.push_indent(span.base_indent - 1);
  355|  2.42k|         }
  356|       |
  357|  4.21k|         ctx.active_alias_spans.emplace_back(span.begin, span.end);
  358|       |
  359|  4.21k|         using V = std::remove_cvref_t<T>;
  360|  4.21k|         from<YAML, V>::template op<Opts>(std::forward<T>(value), ctx, replay_it, replay_end);
  361|       |
  362|  4.21k|         ctx.active_alias_spans.pop_back();
  363|       |
  364|       |         // Restore indent context
  365|  4.21k|         ctx.indent_stack = std::move(saved_indent_stack);
  366|  4.21k|         return true;
  367|  4.21k|      }
_ZZN3glz4fromILj450EdE2opITnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1ELb0ELb0ELb0ELb0ELj1EEERPKcRdTkNS_10is_contextERNS_4yaml12yaml_contextES5_EEvOT1_OT2_OT0_T3_ENKUlvE_clEv:
 2062|   745k|         auto finalize = [&] { yaml::finalize_node_anchor(preamble.node_props, ctx, it); };
_ZN3glz33process_yaml_variant_alternativesINSt3__17variantIJDndNS1_12basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEbNS1_6vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS6_ISD_EEEENSC_ISD_EEEEENS_20is_yaml_variant_boolEE2opITnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1ELb0ELb0ELb0ELb0ELj1EEERSH_TkNS_10is_contextERNS_4yaml12yaml_contextERPKcSR_EEvOT0_OT1_OT2_T3_:
 5205|  28.9k|      {
 5206|  28.9k|         constexpr auto category_count = yaml_variant_count_v<Variant, Trait>;
 5207|       |
 5208|       |         if constexpr (category_count == 0) {
 5209|       |            ctx.error = error_code::no_matching_variant_type;
 5210|       |         }
 5211|  28.9k|         else if constexpr (category_count == 1) {
 5212|       |            // Only one type in this category, use it directly
 5213|  28.9k|            constexpr auto first_idx = yaml_variant_first_index_v<Variant, Trait>;
 5214|  28.9k|            using V = std::variant_alternative_t<first_idx, Variant>;
 5215|  28.9k|            if (!std::holds_alternative<V>(value)) value = V{};
  ------------------
  |  Branch (5215:17): [True: 28.9k, False: 0]
  ------------------
 5216|  28.9k|            from<YAML, V>::template op<Opts>(std::get<V>(value), ctx, it, end);
 5217|       |         }
 5218|       |         else {
 5219|       |            // Multiple types in this category, try each one
 5220|       |            constexpr auto N = std::variant_size_v<Variant>;
 5221|       |            bool found_match{};
 5222|       |            size_t match_idx = 0;
 5223|       |            // Only the last alternative propagates its error, so an alternative that exhausted an
 5224|       |            // expansion budget would otherwise be reported as no_matching_variant_type -- a wrong
 5225|       |            // diagnosis for a document that is hostile rather than merely the wrong shape. Held
 5226|       |            // aside and used only if nothing matched, so an alternative that does succeed later
 5227|       |            // (one that materializes no key text can still parse under a latched budget) is
 5228|       |            // unaffected.
 5229|       |            error_code expansion_error{};
 5230|       |            std::string_view expansion_message{};
 5231|       |
 5232|       |            for_each<N>([&]<size_t I>() {
 5233|       |               if (found_match) {
 5234|       |                  return;
 5235|       |               }
 5236|       |               using V = std::variant_alternative_t<I, Variant>;
 5237|       |               if constexpr (Trait<V>::value) {
 5238|       |                  auto copy_it = it;
 5239|       |                  if (!std::holds_alternative<V>(value)) {
 5240|       |                     value = V{};
 5241|       |                  }
 5242|       |
 5243|       |                  auto temp_ctx = ctx.make_speculative();
 5244|       |                  from<YAML, V>::template op<Opts>(std::get<V>(value), temp_ctx, it, end);
 5245|       |
 5246|       |                  // Charged whether or not the alternative fit: a rejected probe still replayed
 5247|       |                  // whatever aliases it reached, and an attempt that is never billed is an
 5248|       |                  // attempt that can be repeated for free.
 5249|       |                  ctx.alias_expansion_budget = temp_ctx.alias_expansion_budget;
 5250|       |                  ctx.key_expansion_budget = temp_ctx.key_expansion_budget;
 5251|       |
 5252|       |                  if (!bool(temp_ctx.error)) {
 5253|       |                     found_match = true;
 5254|       |                     ctx.anchors = std::move(temp_ctx.anchors);
 5255|       |                  }
 5256|       |                  else {
 5257|       |                     it = copy_it;
 5258|       |                     if (temp_ctx.error == error_code::exceeded_max_expansion && expansion_error == error_code::none) {
 5259|       |                        expansion_error = temp_ctx.error;
 5260|       |                        expansion_message = temp_ctx.custom_error_message;
 5261|       |                     }
 5262|       |                     if (match_idx + 1 < category_count) {
 5263|       |                        // Not the last type, continue trying
 5264|       |                     }
 5265|       |                     else {
 5266|       |                        // Last type failed, propagate error
 5267|       |                        ctx.error = temp_ctx.error;
 5268|       |                        ctx.custom_error_message = temp_ctx.custom_error_message;
 5269|       |                     }
 5270|       |                  }
 5271|       |                  ++match_idx;
 5272|       |               }
 5273|       |            });
 5274|       |
 5275|       |            if (!found_match && !bool(ctx.error)) {
 5276|       |               if (expansion_error != error_code::none) {
 5277|       |                  ctx.error = expansion_error;
 5278|       |                  ctx.custom_error_message = expansion_message;
 5279|       |               }
 5280|       |               else {
 5281|       |                  ctx.error = error_code::no_matching_variant_type;
 5282|       |               }
 5283|       |            }
 5284|       |         }
 5285|  28.9k|      }
_ZN3glz4fromILj450EbE2opITnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1ELb0ELb0ELb0ELb0ELj1EEERPKcRbTkNS_10is_contextERNS_4yaml12yaml_contextES5_EEvOT1_OT2_OT0_T3_:
 2012|  38.6k|      {
 2013|  38.6k|         if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2013:14): [True: 0, False: 38.6k]
  ------------------
 2014|      0|            return;
 2015|       |
 2016|  38.6k|         yaml::node_preamble_state preamble{};
 2017|  38.6k|         if (yaml::parse_node_preamble<Opts>(value, ctx, it, end, preamble,
  ------------------
  |  Branch (2017:14): [True: 10.3k, False: 28.3k]
  ------------------
 2018|  38.6k|                                             [](yaml::yaml_tag tag) { return yaml::tag_valid_for_bool(tag); }))
 2019|  10.3k|            return;
 2020|       |
 2021|       |         // Parse as plain scalar first
 2022|  28.3k|         std::string str;
 2023|  28.3k|         yaml::parse_plain_scalar(str, ctx, it, end, yaml::check_flow_context(Opts));
 2024|       |
 2025|  28.3k|         if (str == "true" || str == "True" || str == "TRUE" || str == "yes" || str == "Yes" || str == "YES" ||
  ------------------
  |  Branch (2025:14): [True: 3.02k, False: 25.3k]
  |  Branch (2025:31): [True: 760, False: 24.5k]
  |  Branch (2025:48): [True: 759, False: 23.7k]
  |  Branch (2025:65): [True: 403, False: 23.3k]
  |  Branch (2025:81): [True: 2.25k, False: 21.1k]
  |  Branch (2025:97): [True: 1.11k, False: 20.0k]
  ------------------
 2026|  20.0k|             str == "on" || str == "On" || str == "ON") {
  ------------------
  |  Branch (2026:14): [True: 1.07k, False: 18.9k]
  |  Branch (2026:29): [True: 307, False: 18.6k]
  |  Branch (2026:44): [True: 446, False: 18.1k]
  ------------------
 2027|  10.1k|            value = true;
 2028|  10.1k|         }
 2029|  18.1k|         else if (str == "false" || str == "False" || str == "FALSE" || str == "no" || str == "No" || str == "NO" ||
  ------------------
  |  Branch (2029:19): [True: 11.8k, False: 6.32k]
  |  Branch (2029:37): [True: 346, False: 5.97k]
  |  Branch (2029:55): [True: 3.11k, False: 2.86k]
  |  Branch (2029:73): [True: 456, False: 2.41k]
  |  Branch (2029:88): [True: 483, False: 1.92k]
  |  Branch (2029:103): [True: 662, False: 1.26k]
  ------------------
 2030|  18.0k|                  str == "off" || str == "Off" || str == "OFF") {
  ------------------
  |  Branch (2030:19): [True: 455, False: 811]
  |  Branch (2030:35): [True: 367, False: 444]
  |  Branch (2030:51): [True: 295, False: 149]
  ------------------
 2031|  18.0k|            value = false;
 2032|  18.0k|         }
 2033|    149|         else {
 2034|    149|            ctx.error = error_code::expected_true_or_false;
 2035|    149|         }
 2036|       |
 2037|  28.3k|         yaml::finalize_node_anchor(preamble.node_props, ctx, it);
 2038|  28.3k|      }
_ZN3glz4yaml19parse_node_preambleITnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1ELb0ELb0ELb0ELb0ELj1EEEXtlNS0_20node_property_policyELb1EEELb0ERbNS0_12yaml_contextEPKcS7_ZNS_4fromILj450EbE2opITnDaXtlS2_Lj450ELb0ELb0ELb1ELb1ELb0ELb0ELb0ELb0ELj1EEERS7_S4_TkNS_10is_contextERS5_S7_EEvOT1_OT2_OT0_T3_EUlNS0_8yaml_tagEE_EEbSG_RSJ_RT4_T5_RNS0_19node_preamble_stateEOT6_:
  465|  38.6k|      {
  466|  38.6k|         skip_inline_ws(it, end);
  467|       |
  468|  38.6k|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (468:14): [True: 4, False: 38.6k]
  ------------------
  469|      4|            if constexpr (!AllowEmptyInput) {
  470|      4|               ctx.error = error_code::unexpected_end;
  471|      4|            }
  472|      4|            return true;
  473|      4|         }
  474|       |
  475|  38.6k|         preamble.tag = parse_yaml_tag(it, end, ctx);
  476|  38.6k|         if (preamble.tag == yaml_tag::unknown) [[unlikely]] {
  ------------------
  |  Branch (476:14): [True: 3, False: 38.6k]
  ------------------
  477|      3|            ctx.error = error_code::syntax_error;
  478|      3|            return true;
  479|      3|         }
  480|  38.6k|         if (!tag_validator(preamble.tag)) [[unlikely]] {
  ------------------
  |  Branch (480:14): [True: 2, False: 38.6k]
  ------------------
  481|      2|            ctx.error = error_code::syntax_error;
  482|      2|            return true;
  483|      2|         }
  484|       |
  485|  38.6k|         skip_inline_ws(it, end);
  486|       |
  487|  38.6k|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (487:14): [True: 1, False: 38.6k]
  ------------------
  488|      1|            if constexpr (!AllowEmptyInput) {
  489|      1|               ctx.error = error_code::unexpected_end;
  490|      1|            }
  491|      1|            return true;
  492|      1|         }
  493|       |
  494|  38.6k|         if (parse_node_properties<Opts, PropertyPolicy>(std::forward<T>(value), ctx, it, end, preamble.node_props)) {
  ------------------
  |  Branch (494:14): [True: 10.3k, False: 28.3k]
  ------------------
  495|  10.3k|            return true;
  496|  10.3k|         }
  497|       |
  498|  28.3k|         return false;
  499|  38.6k|      }
_ZZN3glz4fromILj450EbE2opITnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1ELb0ELb0ELb0ELb0ELj1EEERPKcRbTkNS_10is_contextERNS_4yaml12yaml_contextES5_EEvOT1_OT2_OT0_T3_ENKUlNS8_8yaml_tagEE_clESI_:
 2018|  38.6k|                                             [](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|  38.6k|      {
  409|  38.6k|         state.has_anchor = false;
  410|  38.6k|         state.anchor_name.clear();
  411|  38.6k|         state.anchor_start = nullptr;
  412|  38.6k|         state.anchor_indent = ctx.current_indent();
  413|       |
  414|  38.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|  38.6k|            else {
  421|  38.6k|               if (handle_alias<Opts>(std::forward<T>(value), ctx, it, end)) return true;
  ------------------
  |  Branch (421:20): [True: 10.3k, False: 28.3k]
  ------------------
  422|  38.6k|            }
  423|  38.6k|         }
  424|       |
  425|  38.6k|         if (it != end && *it == '&') {
  ------------------
  |  Branch (425:14): [True: 28.3k, False: 10.3k]
  |  Branch (425:27): [True: 7.98k, False: 20.3k]
  ------------------
  426|  7.98k|            ++it;
  427|  7.98k|            auto name = parse_anchor_name(it, end);
  428|  7.98k|            if (name.empty()) {
  ------------------
  |  Branch (428:17): [True: 3, False: 7.98k]
  ------------------
  429|      3|               ctx.error = error_code::syntax_error;
  430|      3|               return true;
  431|      3|            }
  432|  7.98k|            skip_inline_ws(it, end);
  433|  7.98k|            if (it == end) {
  ------------------
  |  Branch (433:17): [True: 16, False: 7.96k]
  ------------------
  434|     16|               if constexpr (!Policy.allow_empty_after_anchor) {
  435|     16|                  ctx.error = error_code::unexpected_end;
  436|     16|               }
  437|     16|               return true;
  438|     16|            }
  439|       |            if constexpr (Policy.disallow_anchor_on_alias) {
  440|       |               if (*it == '*') {
  441|       |                  ctx.error = error_code::syntax_error;
  442|       |                  return true;
  443|       |               }
  444|       |            }
  445|  7.96k|            state.has_anchor = true;
  446|  7.96k|            state.anchor_name = std::string(name);
  447|  7.96k|            state.anchor_start = &*it;
  448|  7.96k|         }
  449|       |
  450|  38.6k|         return false;
  451|  38.6k|      }
_ZN3glz4yaml12handle_aliasITnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1ELb0ELb0ELb0ELb0ELj1EEERbNS0_12yaml_contextEPKcS6_EEbOT0_RT1_RT2_T3_:
  300|  38.6k|      {
  301|  38.6k|         if (it == end || *it != '*') return false;
  ------------------
  |  Branch (301:14): [True: 0, False: 38.6k]
  |  Branch (301:27): [True: 28.3k, False: 10.3k]
  ------------------
  302|       |
  303|  10.3k|         ++it; // skip '*'
  304|  10.3k|         auto name = parse_anchor_name(it, end);
  305|  10.3k|         if (name.empty()) {
  ------------------
  |  Branch (305:14): [True: 9, False: 10.3k]
  ------------------
  306|      9|            ctx.error = error_code::syntax_error;
  307|      9|            return true;
  308|      9|         }
  309|       |
  310|  10.3k|         auto anchor_it = ctx.anchors.find(name);
  311|  10.3k|         if (anchor_it == ctx.anchors.end()) {
  ------------------
  |  Branch (311:14): [True: 17, False: 10.2k]
  ------------------
  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|  10.2k|         const auto span = anchor_it->second;
  319|       |
  320|       |         // Empty anchor span (anchor on null/empty node) — leave value as default
  321|  10.2k|         if (span.begin == span.end) {
  ------------------
  |  Branch (321:14): [True: 603, False: 9.69k]
  ------------------
  322|    603|            return true;
  323|    603|         }
  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.69k|         if (ctx.alias_span_is_replaying(span.begin, span.end)) [[unlikely]] {
  ------------------
  |  Branch (328:14): [True: 7, False: 9.68k]
  ------------------
  329|      7|            ctx.error = error_code::syntax_error; // cyclic alias
  330|      7|            return true;
  331|      7|         }
  332|       |
  333|       |         // Replaying an anchor re-enters the reader directly, bypassing the variant reader's
  334|       |         // depth guard, so this is the only depth accounting a chain of aliases into a
  335|       |         // non-variant target gets. The cycle check above stops the unbounded case; this bounds
  336|       |         // a legitimate but deeply chained one.
  337|  9.68k|         depth_guard guard{ctx, yaml::max_yaml_recursive_depth};
  338|  9.68k|         if (!guard) [[unlikely]]
  ------------------
  |  Branch (338:14): [True: 0, False: 9.68k]
  ------------------
  339|      0|            return true;
  340|       |
  341|  9.68k|         if (!ctx.charge_alias_expansion(static_cast<size_t>(span.end - span.begin))) [[unlikely]] {
  ------------------
  |  Branch (341:14): [True: 0, False: 9.68k]
  ------------------
  342|      0|            ctx.error = error_code::exceeded_max_expansion;
  343|      0|            ctx.custom_error_message = "alias expansion";
  344|      0|            return true;
  345|      0|         }
  346|       |
  347|  9.68k|         auto replay_it = span.begin;
  348|  9.68k|         auto replay_end = span.end;
  349|       |
  350|       |         // Save indent context and set up for replay
  351|  9.68k|         auto saved_indent_stack = std::move(ctx.indent_stack);
  352|  9.68k|         ctx.indent_stack.clear();
  353|  9.68k|         if (span.base_indent > 0) {
  ------------------
  |  Branch (353:14): [True: 337, False: 9.35k]
  ------------------
  354|    337|            ctx.push_indent(span.base_indent - 1);
  355|    337|         }
  356|       |
  357|  9.68k|         ctx.active_alias_spans.emplace_back(span.begin, span.end);
  358|       |
  359|  9.68k|         using V = std::remove_cvref_t<T>;
  360|  9.68k|         from<YAML, V>::template op<Opts>(std::forward<T>(value), ctx, replay_it, replay_end);
  361|       |
  362|  9.68k|         ctx.active_alias_spans.pop_back();
  363|       |
  364|       |         // Restore indent context
  365|  9.68k|         ctx.indent_stack = std::move(saved_indent_stack);
  366|  9.68k|         return true;
  367|  9.68k|      }
_ZN3glz4fromILj450EDnE2opITnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1ELb0ELb0ELb0ELb0ELj1EEERPKcRDnTkNS_10is_contextERNS_4yaml12yaml_contextES5_EEvOT1_OT2_OT0_T3_:
 2398|  12.7k|      {
 2399|  12.7k|         if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2399:14): [True: 0, False: 12.7k]
  ------------------
 2400|      0|            return;
 2401|       |
 2402|  12.7k|         yaml::skip_inline_ws(it, end);
 2403|       |
 2404|  12.7k|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (2404:14): [True: 3, False: 12.7k]
  ------------------
 2405|      3|            ctx.error = error_code::unexpected_end;
 2406|      3|            return;
 2407|      3|         }
 2408|       |
 2409|       |         // Check for null values: null, Null, NULL, ~
 2410|  12.7k|         if (*it == '~') {
  ------------------
  |  Branch (2410:14): [True: 1.36k, False: 11.3k]
  ------------------
 2411|  1.36k|            ++it;
 2412|  1.36k|            return;
 2413|  1.36k|         }
 2414|       |
 2415|       |         // Parse as plain scalar and check if it's a null keyword
 2416|  11.3k|         auto start = it;
 2417|   100k|         while (it != end && !yaml::plain_scalar_end_table[static_cast<uint8_t>(*it)]) {
  ------------------
  |  Branch (2417:17): [True: 100k, False: 357]
  |  Branch (2417:30): [True: 89.6k, False: 10.9k]
  ------------------
 2418|  89.6k|            ++it;
 2419|  89.6k|         }
 2420|       |
 2421|  11.3k|         std::string_view str{start, static_cast<size_t>(it - start)};
 2422|  11.3k|         if (!yaml::is_yaml_null(str)) {
  ------------------
  |  Branch (2422:14): [True: 44, False: 11.2k]
  ------------------
 2423|     44|            ctx.error = error_code::syntax_error;
 2424|     44|         }
 2425|  11.3k|      }
_ZN3glz33process_yaml_variant_alternativesINSt3__17variantIJDndNS1_12basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEbNS1_6vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS6_ISD_EEEENSC_ISD_EEEEENS_22is_yaml_variant_objectEE2opITnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1ELb0ELb0ELb0ELb0ELj1EEERSH_TkNS_10is_contextERNS_4yaml12yaml_contextERPKcSR_EEvOT0_OT1_OT2_T3_:
 5205|  1.21M|      {
 5206|  1.21M|         constexpr auto category_count = yaml_variant_count_v<Variant, Trait>;
 5207|       |
 5208|       |         if constexpr (category_count == 0) {
 5209|       |            ctx.error = error_code::no_matching_variant_type;
 5210|       |         }
 5211|  1.21M|         else if constexpr (category_count == 1) {
 5212|       |            // Only one type in this category, use it directly
 5213|  1.21M|            constexpr auto first_idx = yaml_variant_first_index_v<Variant, Trait>;
 5214|  1.21M|            using V = std::variant_alternative_t<first_idx, Variant>;
 5215|  1.21M|            if (!std::holds_alternative<V>(value)) value = V{};
  ------------------
  |  Branch (5215:17): [True: 1.21M, False: 0]
  ------------------
 5216|  1.21M|            from<YAML, V>::template op<Opts>(std::get<V>(value), ctx, it, end);
 5217|       |         }
 5218|       |         else {
 5219|       |            // Multiple types in this category, try each one
 5220|       |            constexpr auto N = std::variant_size_v<Variant>;
 5221|       |            bool found_match{};
 5222|       |            size_t match_idx = 0;
 5223|       |            // Only the last alternative propagates its error, so an alternative that exhausted an
 5224|       |            // expansion budget would otherwise be reported as no_matching_variant_type -- a wrong
 5225|       |            // diagnosis for a document that is hostile rather than merely the wrong shape. Held
 5226|       |            // aside and used only if nothing matched, so an alternative that does succeed later
 5227|       |            // (one that materializes no key text can still parse under a latched budget) is
 5228|       |            // unaffected.
 5229|       |            error_code expansion_error{};
 5230|       |            std::string_view expansion_message{};
 5231|       |
 5232|       |            for_each<N>([&]<size_t I>() {
 5233|       |               if (found_match) {
 5234|       |                  return;
 5235|       |               }
 5236|       |               using V = std::variant_alternative_t<I, Variant>;
 5237|       |               if constexpr (Trait<V>::value) {
 5238|       |                  auto copy_it = it;
 5239|       |                  if (!std::holds_alternative<V>(value)) {
 5240|       |                     value = V{};
 5241|       |                  }
 5242|       |
 5243|       |                  auto temp_ctx = ctx.make_speculative();
 5244|       |                  from<YAML, V>::template op<Opts>(std::get<V>(value), temp_ctx, it, end);
 5245|       |
 5246|       |                  // Charged whether or not the alternative fit: a rejected probe still replayed
 5247|       |                  // whatever aliases it reached, and an attempt that is never billed is an
 5248|       |                  // attempt that can be repeated for free.
 5249|       |                  ctx.alias_expansion_budget = temp_ctx.alias_expansion_budget;
 5250|       |                  ctx.key_expansion_budget = temp_ctx.key_expansion_budget;
 5251|       |
 5252|       |                  if (!bool(temp_ctx.error)) {
 5253|       |                     found_match = true;
 5254|       |                     ctx.anchors = std::move(temp_ctx.anchors);
 5255|       |                  }
 5256|       |                  else {
 5257|       |                     it = copy_it;
 5258|       |                     if (temp_ctx.error == error_code::exceeded_max_expansion && expansion_error == error_code::none) {
 5259|       |                        expansion_error = temp_ctx.error;
 5260|       |                        expansion_message = temp_ctx.custom_error_message;
 5261|       |                     }
 5262|       |                     if (match_idx + 1 < category_count) {
 5263|       |                        // Not the last type, continue trying
 5264|       |                     }
 5265|       |                     else {
 5266|       |                        // Last type failed, propagate error
 5267|       |                        ctx.error = temp_ctx.error;
 5268|       |                        ctx.custom_error_message = temp_ctx.custom_error_message;
 5269|       |                     }
 5270|       |                  }
 5271|       |                  ++match_idx;
 5272|       |               }
 5273|       |            });
 5274|       |
 5275|       |            if (!found_match && !bool(ctx.error)) {
 5276|       |               if (expansion_error != error_code::none) {
 5277|       |                  ctx.error = expansion_error;
 5278|       |                  ctx.custom_error_message = expansion_message;
 5279|       |               }
 5280|       |               else {
 5281|       |                  ctx.error = error_code::no_matching_variant_type;
 5282|       |               }
 5283|       |            }
 5284|       |         }
 5285|  1.21M|      }
_ZN3glz4fromILj450ENS_17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES1_EEEEE2opITnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1ELb0ELb0ELb0ELb0ELj1EEERPKcRS5_TkNS_10is_contextERNS_4yaml12yaml_contextESA_EEvOT1_OT2_OT0_T3_:
 4515|  1.23M|      {
 4516|  1.23M|         if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4516:14): [True: 0, False: 1.23M]
  ------------------
 4517|      0|            return;
 4518|       |
 4519|  1.23M|         yaml::node_preamble_state preamble{};
 4520|  1.23M|         if (yaml::parse_node_preamble<Opts, yaml::node_property_policy{true, true, false, false}>(
  ------------------
  |  Branch (4520:14): [True: 22.0k, False: 1.21M]
  ------------------
 4521|  1.23M|                value, ctx, it, end, preamble, [](yaml::yaml_tag tag) { return yaml::tag_valid_for_map(tag); }))
 4522|  22.0k|            return;
 4523|       |
 4524|  1.21M|         using key_t = typename std::remove_cvref_t<T>::key_type;
 4525|  1.21M|         using val_t = typename std::remove_cvref_t<T>::mapped_type;
 4526|       |
 4527|       |         // Reading a YAML mapping MERGES into the target: an entry overwrites the
 4528|       |         // value of a key that existed before the read and adds new keys, while
 4529|       |         // pre-existing keys the document does not mention are preserved (like a
 4530|       |         // struct/object read, and like json/read.hpp's per-key value[key]).
 4531|       |         // Within a single document a repeated key keeps its FIRST value -- YAML
 4532|       |         // mappings disallow duplicate keys and the conformance suite expects
 4533|       |         // first-wins, which falls out of emplace into an empty map. Any
 4534|       |         // pre-existing entry the document leaves untouched is restored on scope
 4535|       |         // exit (including error paths). When the target starts empty (the common
 4536|       |         // case) this is a no-op with negligible cost.
 4537|  1.21M|         std::remove_cvref_t<T> preexisting_entries;
 4538|  1.21M|         if (!value.empty()) {
  ------------------
  |  Branch (4538:14): [True: 0, False: 1.21M]
  ------------------
 4539|      0|            preexisting_entries = std::move(value);
 4540|      0|            value.clear();
 4541|      0|         }
 4542|  1.21M|         struct merge_restore_guard
 4543|  1.21M|         {
 4544|  1.21M|            std::remove_cvref_t<T>& target;
 4545|  1.21M|            std::remove_cvref_t<T>& saved;
 4546|  1.21M|            ~merge_restore_guard()
 4547|  1.21M|            {
 4548|       |               // emplace is a no-op for keys the document already wrote, so only
 4549|       |               // untouched pre-existing entries are put back.
 4550|  1.21M|               for (auto& entry : saved) {
 4551|  1.21M|                  target.emplace(entry.first, std::move(entry.second));
 4552|  1.21M|               }
 4553|  1.21M|            }
 4554|  1.21M|         } merge_restore{value, preexisting_entries};
 4555|       |
 4556|  1.21M|         const bool treat_as_block_mapping =
 4557|  1.21M|            !yaml::check_flow_context(Opts) && *it == '{' && yaml::inline_value_has_plain_mapping_indicator(it, end);
  ------------------
  |  Branch (4557:13): [Folded, False: 1.21M]
  |  Branch (4557:48): [True: 0, False: 0]
  |  Branch (4557:62): [True: 0, False: 0]
  ------------------
 4558|       |
 4559|  1.21M|         if (*it == '{' && !treat_as_block_mapping) {
  ------------------
  |  Branch (4559:14): [True: 832k, False: 381k]
  |  Branch (4559:28): [True: 0, Folded]
  ------------------
 4560|       |            // Flow mapping
 4561|   832k|            ++it;
 4562|       |            // Skip whitespace and newlines after opening brace
 4563|   832k|            yaml::skip_ws_and_newlines(it, end);
 4564|       |
 4565|   832k|            if (it != end && *it == '}') {
  ------------------
  |  Branch (4565:17): [True: 831k, False: 810]
  |  Branch (4565:30): [True: 14.5k, False: 816k]
  ------------------
 4566|  14.5k|               ++it;
 4567|  14.5k|               yaml::validate_flow_node_adjacent_tail(ctx, it, end);
 4568|  14.5k|               if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4568:20): [True: 9, False: 14.5k]
  ------------------
 4569|      9|                  return;
 4570|  14.5k|               yaml::finalize_node_anchor(preamble.node_props, ctx, it);
 4571|  14.5k|               return;
 4572|  14.5k|            }
 4573|       |
 4574|  4.17M|            while (it != end) {
  ------------------
  |  Branch (4574:20): [True: 4.17M, False: 2.30k]
  ------------------
 4575|       |               // Skip whitespace and newlines at start of each iteration
 4576|  4.17M|               yaml::skip_ws_and_newlines(it, end);
 4577|       |
 4578|  4.17M|               if (it != end && *it == '}') {
  ------------------
  |  Branch (4578:20): [True: 4.17M, False: 0]
  |  Branch (4578:33): [True: 29.2k, False: 4.14M]
  ------------------
 4579|  29.2k|                  ++it;
 4580|  29.2k|                  yaml::validate_flow_node_adjacent_tail(ctx, it, end);
 4581|  29.2k|                  if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4581:23): [True: 19, False: 29.2k]
  ------------------
 4582|     19|                     return;
 4583|  29.2k|                  break;
 4584|  29.2k|               }
 4585|       |
 4586|  4.14M|               bool explicit_flow_key = false;
 4587|  4.14M|               auto explicit_probe = it;
 4588|  4.14M|               yaml::skip_inline_ws(explicit_probe, end);
 4589|  4.14M|               if (explicit_probe != end && *explicit_probe == '?') {
  ------------------
  |  Branch (4589:20): [True: 4.14M, False: 0]
  |  Branch (4589:45): [True: 73.0k, False: 4.06M]
  ------------------
 4590|  73.0k|                  const auto after_q = explicit_probe + 1;
 4591|  73.0k|                  if (after_q == end || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*after_q)] ||
  ------------------
  |  Branch (4591:23): [True: 8, False: 73.0k]
  |  Branch (4591:41): [True: 41.8k, False: 31.1k]
  ------------------
 4592|  48.7k|                      *after_q == ',' || *after_q == '}') {
  ------------------
  |  Branch (4592:23): [True: 6.17k, False: 24.9k]
  |  Branch (4592:42): [True: 682, False: 24.2k]
  ------------------
 4593|  48.7k|                     explicit_flow_key = true;
 4594|  48.7k|                     it = explicit_probe + 1;
 4595|  48.7k|                     yaml::skip_flow_ws_and_newlines(ctx, it, end);
 4596|  48.7k|                     if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4596:26): [True: 4, False: 48.7k]
  ------------------
 4597|      4|                        return;
 4598|  48.7k|                  }
 4599|  73.0k|               }
 4600|       |               // Parse key
 4601|  4.14M|               key_t key{};
 4602|  4.14M|               if constexpr (std::same_as<std::remove_cvref_t<key_t>, std::string>) {
 4603|  4.14M|                  if (explicit_flow_key && it != end && (*it == ':' || *it == ',' || *it == '}')) {
  ------------------
  |  Branch (4603:23): [True: 48.7k, False: 4.09M]
  |  Branch (4603:44): [True: 48.7k, False: 15]
  |  Branch (4603:58): [True: 1.42k, False: 47.3k]
  |  Branch (4603:72): [True: 8.02k, False: 39.2k]
  |  Branch (4603:86): [True: 1.02k, False: 38.2k]
  ------------------
 4604|  10.4k|                     key.clear();
 4605|  10.4k|                  }
 4606|  4.13M|                  else {
 4607|  4.13M|                     auto key_probe = it;
 4608|  4.13M|                     yaml::skip_inline_ws(key_probe, end);
 4609|       |
 4610|       |                     // Use full node parsing only for structurally complex flow keys.
 4611|       |                     // Plain/quoted/alias keys stay on parse_yaml_key() for compatibility.
 4612|  4.13M|                     bool parse_complex_flow_key = false;
 4613|  4.13M|                     if (key_probe != end) {
  ------------------
  |  Branch (4613:26): [True: 4.13M, False: 15]
  ------------------
 4614|  4.13M|                        if (*key_probe == '[' || *key_probe == '{') {
  ------------------
  |  Branch (4614:29): [True: 8.43k, False: 4.12M]
  |  Branch (4614:50): [True: 19.2k, False: 4.10M]
  ------------------
 4615|  27.7k|                           parse_complex_flow_key = true;
 4616|  27.7k|                        }
 4617|  4.10M|                        else if (*key_probe == '&') {
  ------------------
  |  Branch (4617:34): [True: 778k, False: 3.32M]
  ------------------
 4618|   778k|                           ++key_probe;
 4619|   778k|                           yaml::parse_anchor_name(key_probe, end);
 4620|   778k|                           yaml::skip_inline_ws(key_probe, end);
 4621|   778k|                           if (key_probe != end && (*key_probe == '[' || *key_probe == '{')) {
  ------------------
  |  Branch (4621:32): [True: 778k, False: 65]
  |  Branch (4621:53): [True: 5.03k, False: 773k]
  |  Branch (4621:74): [True: 168k, False: 605k]
  ------------------
 4622|   173k|                              parse_complex_flow_key = true;
 4623|   173k|                           }
 4624|   778k|                        }
 4625|  4.13M|                     }
 4626|       |
 4627|  4.13M|                     if (parse_complex_flow_key) {
  ------------------
  |  Branch (4627:26): [True: 200k, False: 3.93M]
  ------------------
 4628|   200k|                        glz::generic key_node{};
 4629|   200k|                        from<YAML, glz::generic>::template op<yaml::flow_context_on<Opts>()>(key_node, ctx, it, end);
 4630|   200k|                        if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4630:29): [True: 9.35k, False: 191k]
  ------------------
 4631|  9.35k|                           return;
 4632|   191k|                        if (!yaml::materialize_key(key, key_node, ctx)) [[unlikely]]
  ------------------
  |  Branch (4632:29): [True: 38, False: 191k]
  ------------------
 4633|     38|                           return;
 4634|   191k|                     }
 4635|  3.93M|                     else {
 4636|  3.93M|                        if (!yaml::parse_yaml_key(key, ctx, it, end, true)) {
  ------------------
  |  Branch (4636:29): [True: 4.20k, False: 3.92M]
  ------------------
 4637|  4.20k|                           return;
 4638|  4.20k|                        }
 4639|  3.93M|                     }
 4640|  4.13M|                  }
 4641|       |               }
 4642|       |               else {
 4643|       |                  if (explicit_flow_key && it != end && (*it == ':' || *it == ',' || *it == '}')) {
 4644|       |                     ctx.error = error_code::syntax_error;
 4645|       |                     return;
 4646|       |                  }
 4647|       |                  from<YAML, key_t>::template op<yaml::flow_context_on<Opts>()>(key, ctx, it, end);
 4648|       |                  if (bool(ctx.error)) [[unlikely]]
 4649|       |                     return;
 4650|       |               }
 4651|       |
 4652|       |               // Separation between flow key and ':' may include comments/newlines.
 4653|       |               // In flow context, newlines are allowed between key and ':'.
 4654|  4.12M|               yaml::skip_flow_ws_and_newlines(ctx, it, end);
 4655|  4.14M|               if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4655:20): [True: 17, False: 4.14M]
  ------------------
 4656|     17|                  return;
 4657|       |
 4658|  4.14M|               auto parse_implicit_null = [&](val_t& val) -> bool {
 4659|  4.14M|                  if constexpr (nullable_like<std::remove_cvref_t<val_t>>) {
 4660|  4.14M|                     val = {};
 4661|  4.14M|                     return true;
 4662|  4.14M|                  }
 4663|  4.14M|                  else if constexpr (std::same_as<std::remove_cvref_t<val_t>, glz::generic>) {
 4664|  4.14M|                     val = glz::generic{};
 4665|  4.14M|                     return true;
 4666|  4.14M|                  }
 4667|  4.14M|                  else {
 4668|  4.14M|                     static constexpr std::string_view null_value{"null"};
 4669|  4.14M|                     auto null_it = null_value.data();
 4670|  4.14M|                     from<YAML, val_t>::template op<yaml::flow_context_on<Opts>()>(
 4671|  4.14M|                        val, ctx, null_it, null_value.data() + null_value.size());
 4672|  4.14M|                     return !bool(ctx.error);
 4673|  4.14M|                  }
 4674|  4.14M|               };
 4675|       |
 4676|  4.14M|               if (it != end && (*it == ',' || *it == '}')) {
  ------------------
  |  Branch (4676:20): [True: 4.12M, False: 16.0k]
  |  Branch (4676:34): [True: 2.38M, False: 1.73M]
  |  Branch (4676:48): [True: 142k, False: 1.59M]
  ------------------
 4677|  2.52M|                  val_t val{};
 4678|  2.52M|                  if (!parse_implicit_null(val)) [[unlikely]]
  ------------------
  |  Branch (4678:23): [True: 0, False: 2.52M]
  ------------------
 4679|      0|                     return;
 4680|       |
 4681|  2.52M|                  value.emplace(std::move(key), std::move(val));
 4682|       |
 4683|  2.52M|                  if (*it == '}') {
  ------------------
  |  Branch (4683:23): [True: 142k, False: 2.38M]
  ------------------
 4684|   142k|                     ++it;
 4685|   142k|                     yaml::validate_flow_node_adjacent_tail(ctx, it, end);
 4686|   142k|                     if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4686:26): [True: 137, False: 142k]
  ------------------
 4687|    137|                        return;
 4688|   142k|                     break;
 4689|   142k|                  }
 4690|       |
 4691|  2.38M|                  ++it; // skip comma
 4692|  2.38M|                  yaml::skip_ws_and_newlines(it, end);
 4693|  2.38M|                  continue;
 4694|  2.52M|               }
 4695|       |
 4696|  1.61M|               if (it == end || *it != ':') {
  ------------------
  |  Branch (4696:20): [True: 16.0k, False: 1.59M]
  |  Branch (4696:33): [True: 808, False: 1.59M]
  ------------------
 4697|  3.28k|                  ctx.error = error_code::syntax_error;
 4698|  3.28k|                  return;
 4699|  3.28k|               }
 4700|  1.60M|               ++it;
 4701|       |
 4702|  1.60M|               yaml::skip_flow_ws_and_newlines(ctx, it, end);
 4703|  1.60M|               if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4703:20): [True: 15, False: 1.60M]
  ------------------
 4704|     15|                  return;
 4705|       |
 4706|       |               // Omitted value after an explicit ':' maps to an implicit null.
 4707|  1.60M|               if (it != end && (*it == ',' || *it == '}')) {
  ------------------
  |  Branch (4707:20): [True: 1.59M, False: 13.7k]
  |  Branch (4707:34): [True: 168k, False: 1.42M]
  |  Branch (4707:48): [True: 13.0k, False: 1.41M]
  ------------------
 4708|   181k|                  val_t val{};
 4709|   181k|                  if (!parse_implicit_null(val)) [[unlikely]]
  ------------------
  |  Branch (4709:23): [True: 0, False: 181k]
  ------------------
 4710|      0|                     return;
 4711|       |
 4712|   181k|                  value.emplace(std::move(key), std::move(val));
 4713|       |
 4714|   181k|                  if (*it == '}') {
  ------------------
  |  Branch (4714:23): [True: 13.0k, False: 168k]
  ------------------
 4715|  13.0k|                     ++it;
 4716|  13.0k|                     yaml::validate_flow_node_adjacent_tail(ctx, it, end);
 4717|  13.0k|                     if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4717:26): [True: 10, False: 13.0k]
  ------------------
 4718|     10|                        return;
 4719|  13.0k|                     break;
 4720|  13.0k|                  }
 4721|       |
 4722|   168k|                  ++it; // skip comma
 4723|   168k|                  yaml::skip_ws_and_newlines(it, end);
 4724|   168k|                  continue;
 4725|   181k|               }
 4726|       |
 4727|       |               // Parse value
 4728|  1.42M|               val_t val{};
 4729|  1.42M|               from<YAML, val_t>::template op<yaml::flow_context_on<Opts>()>(val, ctx, it, end);
 4730|  1.42M|               if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4730:20): [True: 3.25k, False: 1.42M]
  ------------------
 4731|  3.25k|                  return;
 4732|       |
 4733|  1.42M|               value.emplace(std::move(key), std::move(val));
 4734|       |
 4735|  1.42M|               yaml::skip_inline_ws(it, end);
 4736|       |
 4737|  1.42M|               if (it != end && *it == '}') {
  ------------------
  |  Branch (4737:20): [True: 1.40M, False: 13.9k]
  |  Branch (4737:33): [True: 579k, False: 830k]
  ------------------
 4738|   579k|                  ++it;
 4739|   579k|                  yaml::validate_flow_node_adjacent_tail(ctx, it, end);
 4740|   579k|                  if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4740:23): [True: 153, False: 578k]
  ------------------
 4741|    153|                     return;
 4742|   578k|                  break;
 4743|   579k|               }
 4744|   844k|               else if (it != end && *it == ',') {
  ------------------
  |  Branch (4744:25): [True: 830k, False: 13.9k]
  |  Branch (4744:38): [True: 746k, False: 83.4k]
  ------------------
 4745|   746k|                  ++it;
 4746|       |                  // Skip whitespace and newlines after comma
 4747|   746k|                  yaml::skip_ws_and_newlines(it, end);
 4748|   746k|               }
 4749|  97.4k|               else if (it != end && (*it == '\n' || *it == '\r')) {
  ------------------
  |  Branch (4749:25): [True: 83.4k, False: 13.9k]
  |  Branch (4749:39): [True: 38.4k, False: 44.9k]
  |  Branch (4749:54): [True: 44.6k, False: 318]
  ------------------
 4750|       |                  // Newlines may precede either the closing brace or the
 4751|       |                  // separator comma for the next entry.
 4752|  83.1k|                  yaml::skip_ws_and_newlines(it, end);
 4753|  83.1k|                  if (it != end && *it == '}') {
  ------------------
  |  Branch (4753:23): [True: 83.0k, False: 39]
  |  Branch (4753:36): [True: 30.2k, False: 52.7k]
  ------------------
 4754|  30.2k|                     ++it;
 4755|  30.2k|                     yaml::validate_flow_node_adjacent_tail(ctx, it, end);
 4756|  30.2k|                     if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4756:26): [True: 15, False: 30.2k]
  ------------------
 4757|     15|                        return;
 4758|  30.2k|                     break;
 4759|  30.2k|                  }
 4760|  52.8k|                  if (it != end && *it == ',') {
  ------------------
  |  Branch (4760:23): [True: 52.7k, False: 39]
  |  Branch (4760:36): [True: 52.7k, False: 90]
  ------------------
 4761|  52.7k|                     ++it;
 4762|  52.7k|                     yaml::skip_ws_and_newlines(it, end);
 4763|  52.7k|                     continue;
 4764|  52.7k|                  }
 4765|    129|                  ctx.error = error_code::syntax_error;
 4766|    129|                  return;
 4767|  52.8k|               }
 4768|  14.2k|               else {
 4769|  14.2k|                  ctx.error = error_code::syntax_error;
 4770|  14.2k|                  return;
 4771|  14.2k|               }
 4772|  1.42M|            }
 4773|   817k|         }
 4774|   381k|         else {
 4775|       |            // Block mapping - use shared loop with map-specific callback
 4776|   381k|            yaml::parse_block_mapping_loop<Opts>(
 4777|   381k|               ctx, it, end, int32_t(-1), [&](auto& ctx, auto& it, auto end, int32_t line_indent) -> bool {
 4778|   381k|                  auto parse_map_value = [&](val_t& val) -> bool {
 4779|   381k|                     if (it != end && !yaml::line_end_or_comment_table[static_cast<uint8_t>(*it)]) {
 4780|   381k|                        bool line_starts_with_explicit_value_indicator = false;
 4781|       |
 4782|       |                        // Inline mapping values in block context cannot start with a
 4783|       |                        // plain "key: value" pair on the same line (e.g. "a: b: c").
 4784|       |                        // Such constructs are malformed unless wrapped in flow
 4785|       |                        // delimiters ({...} / [...]) or quoted.
 4786|   381k|                        if constexpr (std::is_pointer_v<std::decay_t<decltype(it)>>) {
 4787|   381k|                           if (ctx.stream_begin) {
 4788|   381k|                              auto is_line_content_start = [&](auto pos) {
 4789|   381k|                                 return !ctx.line_prefix_before(pos).has_content;
 4790|   381k|                              };
 4791|       |
 4792|   381k|                              auto line_has_explicit_value_indicator = [&](auto pos) {
 4793|   381k|                                 const char* line = ctx.line_begin_of(pos);
 4794|   381k|                                 while (line != end && (*line == ' ' || *line == '\t')) ++line;
 4795|   381k|                                 return line != end && *line == ':';
 4796|   381k|                              };
 4797|       |
 4798|   381k|                              if (!is_line_content_start(it) &&
 4799|   381k|                                  yaml::inline_value_has_plain_mapping_indicator(it, end) &&
 4800|   381k|                                  !line_has_explicit_value_indicator(it)) {
 4801|   381k|                                 ctx.error = error_code::syntax_error;
 4802|   381k|                                 return false;
 4803|   381k|                              }
 4804|   381k|                              line_starts_with_explicit_value_indicator = line_has_explicit_value_indicator(it);
 4805|   381k|                           }
 4806|   381k|                        }
 4807|       |
 4808|   381k|                        if (*it == '-' &&
 4809|   381k|                            ((it + 1) == end || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*(it + 1))]) &&
 4810|   381k|                            !line_starts_with_explicit_value_indicator) {
 4811|       |                           // "key: - item" is not valid block sequence syntax.
 4812|   381k|                           ctx.error = error_code::syntax_error;
 4813|   381k|                           return false;
 4814|   381k|                        }
 4815|       |
 4816|   381k|                        if (!ctx.push_indent(line_indent + 1)) [[unlikely]]
 4817|   381k|                           return false;
 4818|   381k|                        from<YAML, val_t>::template op<Opts>(val, ctx, it, end);
 4819|   381k|                        ctx.pop_indent();
 4820|   381k|                     }
 4821|   381k|                     else {
 4822|   381k|                        int32_t nested_indent = yaml::detect_nested_value_indent(ctx, it, end, line_indent);
 4823|   381k|                        if (nested_indent >= 0) {
 4824|   381k|                           yaml::skip_to_content(it, end);
 4825|   381k|                           if (it != end && *it == ':' && (it + 1) != end && *(it + 1) == '\t') {
 4826|   381k|                              ctx.error = error_code::syntax_error;
 4827|   381k|                              return false;
 4828|   381k|                           }
 4829|       |                           // A struct value reads the pushed indent as its own key column;
 4830|       |                           // every other value type reads it as the enclosing baseline.
 4831|   381k|                           const int32_t value_indent =
 4832|   381k|                              yaml::receives_block_mapping_column<val_t>() ? nested_indent : nested_indent - 1;
 4833|   381k|                           if (!ctx.push_indent(value_indent)) [[unlikely]]
 4834|   381k|                              return false;
 4835|   381k|                           from<YAML, val_t>::template op<Opts>(val, ctx, it, end);
 4836|   381k|                           ctx.pop_indent();
 4837|   381k|                        }
 4838|   381k|                     }
 4839|   381k|                     return !bool(ctx.error);
 4840|   381k|                  };
 4841|       |
 4842|       |                  // Explicit key entry form:
 4843|       |                  // ? key
 4844|       |                  // : value
 4845|   381k|                  if (*it == '?' && ((it + 1) != end) && *(it + 1) == '\t') {
 4846|   381k|                     ctx.error = error_code::syntax_error;
 4847|   381k|                     return false;
 4848|   381k|                  }
 4849|   381k|                  if (*it == '?' && ((it + 1) == end || *(it + 1) == ' ' || *(it + 1) == '\n' || *(it + 1) == '\r')) {
 4850|   381k|                     ++it; // skip '?'
 4851|   381k|                     yaml::skip_inline_ws(it, end);
 4852|       |
 4853|   381k|                     const int32_t explicit_value_indicator_indent =
 4854|   381k|                        (ctx.current_indent() < 0) ? 0 : (ctx.current_indent() + 1);
 4855|       |
 4856|   381k|                     key_t key{};
 4857|   381k|                     if constexpr (std::same_as<std::remove_cvref_t<key_t>, std::string>) {
 4858|   381k|                        auto to_string_key = [&](glz::generic& key_node) {
 4859|   381k|                           return yaml::materialize_key(key, key_node, ctx);
 4860|   381k|                        };
 4861|       |
 4862|   381k|                        auto key_it = it;
 4863|   381k|                        yaml::skip_inline_ws(key_it, end);
 4864|       |
 4865|   381k|                        auto content = key_it;
 4866|   381k|                        yaml::skip_to_content(content, end);
 4867|   381k|                        bool handled_anchor_only_empty_key = false;
 4868|       |
 4869|       |                        // Anchor on an empty explicit key node:
 4870|       |                        //   ? &a
 4871|       |                        //   : value
 4872|   381k|                        if (content != end && *content == '&') {
 4873|   381k|                           auto anchor_probe = content + 1;
 4874|   381k|                           auto anchor_name = yaml::parse_anchor_name(anchor_probe, end);
 4875|   381k|                           if (!anchor_name.empty()) {
 4876|   381k|                              auto after_anchor = anchor_probe;
 4877|   381k|                              yaml::skip_inline_ws(after_anchor, end);
 4878|       |
 4879|   381k|                              auto value_indicator = after_anchor;
 4880|   381k|                              if (value_indicator != end && *value_indicator == ':') {
 4881|   381k|                                 key.clear();
 4882|   381k|                                 ctx.anchors[std::string(anchor_name)] = {content, content, ctx.current_indent()};
 4883|   381k|                                 it = value_indicator;
 4884|   381k|                                 handled_anchor_only_empty_key = true;
 4885|   381k|                              }
 4886|   381k|                              else {
 4887|   381k|                                 if (value_indicator != end && *value_indicator == '#') {
 4888|   381k|                                    yaml::skip_comment(value_indicator, end);
 4889|   381k|                                 }
 4890|   381k|                                 if (value_indicator != end && (*value_indicator == '\n' || *value_indicator == '\r')) {
 4891|   381k|                                    yaml::skip_newline(value_indicator, end);
 4892|   381k|                                    auto value_line = value_indicator;
 4893|   381k|                                    int32_t value_indent = yaml::measure_indent(value_line, end, ctx);
 4894|   381k|                                    if (bool(ctx.error)) [[unlikely]]
 4895|   381k|                                       return false;
 4896|   381k|                                    if (value_line != end && *value_line == ':' &&
 4897|   381k|                                        value_indent == explicit_value_indicator_indent) {
 4898|   381k|                                       key.clear();
 4899|   381k|                                       ctx.anchors[std::string(anchor_name)] = {content, content, ctx.current_indent()};
 4900|   381k|                                       it = value_line;
 4901|   381k|                                       handled_anchor_only_empty_key = true;
 4902|   381k|                                    }
 4903|   381k|                                    else if (value_line != end && *value_line == ':') {
 4904|       |                                       // In explicit-key form ("? &a"), a following ':'
 4905|       |                                       // starts the outer value indicator only at the same
 4906|       |                                       // indentation. A deeper-indented ': value' is malformed.
 4907|   381k|                                       ctx.error = error_code::syntax_error;
 4908|   381k|                                       return false;
 4909|   381k|                                    }
 4910|   381k|                                 }
 4911|   381k|                              }
 4912|   381k|                           }
 4913|   381k|                        }
 4914|       |
 4915|   381k|                        const bool key_content_spans_lines = [&] {
 4916|   381k|                           auto scan = key_it;
 4917|   381k|                           while (scan != content && scan != end) {
 4918|   381k|                              if (*scan == '\n' || *scan == '\r') return true;
 4919|   381k|                              ++scan;
 4920|   381k|                           }
 4921|   381k|                           return false;
 4922|   381k|                        }();
 4923|       |
 4924|   381k|                        if (handled_anchor_only_empty_key) {
 4925|       |                           // 'it' already points to the explicit value indicator ':'
 4926|   381k|                        }
 4927|   381k|                        else if (content == end || (*content == ':' && key_content_spans_lines)) {
 4928|   381k|                           key.clear();
 4929|   381k|                           it = content;
 4930|   381k|                        }
 4931|   381k|                        else {
 4932|       |                           // Explicit mapping keys ('? key-node') are full YAML nodes.
 4933|       |                           // Parse the key node structurally (not via plain-key scanning)
 4934|       |                           // so inputs like '? []: x' and '? JSON: like' are interpreted
 4935|       |                           // as complex keys, not split into implicit key/value pairs.
 4936|   381k|                           auto key_node_it = content;
 4937|   381k|                           auto key_node_end = end;
 4938|   381k|                           if constexpr (std::is_pointer_v<std::decay_t<It>>) {
 4939|       |                              // In explicit-key form, a following standalone ':'
 4940|       |                              // line (same or lower indentation) belongs to the
 4941|       |                              // outer mapping value, not the key node itself.
 4942|   381k|                              auto scan = content;
 4943|   381k|                              while (scan != end) {
 4944|   381k|                                 while (scan != end && *scan != '\n' && *scan != '\r') {
 4945|   381k|                                    ++scan;
 4946|   381k|                                 }
 4947|   381k|                                 if (scan == end) {
 4948|   381k|                                    break;
 4949|   381k|                                 }
 4950|       |
 4951|   381k|                                 yaml::skip_newline(scan, end);
 4952|   381k|                                 auto line_start = scan;
 4953|       |
 4954|   381k|                                 int32_t indicator_indent = 0;
 4955|   381k|                                 while (scan != end && *scan == ' ') {
 4956|   381k|                                    ++indicator_indent;
 4957|   381k|                                    ++scan;
 4958|   381k|                                 }
 4959|       |
 4960|   381k|                                 if (scan != end && *scan == ':') {
 4961|   381k|                                    const auto after_colon = scan + 1;
 4962|   381k|                                    if ((after_colon == end ||
 4963|   381k|                                         yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*after_colon)]) &&
 4964|   381k|                                        indicator_indent <= line_indent) {
 4965|   381k|                                       key_node_end = line_start;
 4966|   381k|                                       break;
 4967|   381k|                                    }
 4968|   381k|                                 }
 4969|   381k|                              }
 4970|   381k|                           }
 4971|       |
 4972|   381k|                           glz::generic key_node{};
 4973|   381k|                           const bool prev_explicit_mapping_key_context = ctx.explicit_mapping_key_context;
 4974|   381k|                           ctx.explicit_mapping_key_context = true;
 4975|   381k|                           from<YAML, glz::generic>::template op<Opts>(key_node, ctx, key_node_it, key_node_end);
 4976|   381k|                           ctx.explicit_mapping_key_context = prev_explicit_mapping_key_context;
 4977|   381k|                           if (bool(ctx.error)) [[unlikely]]
 4978|   381k|                              return false;
 4979|   381k|                           it = key_node_it;
 4980|   381k|                           if (!to_string_key(key_node)) [[unlikely]]
 4981|   381k|                              return false;
 4982|   381k|                        }
 4983|   381k|                     }
 4984|   381k|                     else {
 4985|   381k|                        if (it != end && !yaml::line_end_or_comment_table[static_cast<uint8_t>(*it)]) {
 4986|   381k|                           from<YAML, key_t>::template op<Opts>(key, ctx, it, end);
 4987|   381k|                           if (bool(ctx.error)) [[unlikely]]
 4988|   381k|                              return false;
 4989|   381k|                        }
 4990|   381k|                     }
 4991|       |
 4992|   381k|                     yaml::skip_inline_ws(it, end);
 4993|   381k|                     yaml::skip_comment(it, end);
 4994|       |
 4995|       |                     // Value indicator may appear on the next line at the same indent.
 4996|   381k|                     if (it != end && (*it == '\n' || *it == '\r')) {
 4997|   381k|                        auto probe = it;
 4998|   381k|                        bool found_value_indicator = false;
 4999|       |
 5000|   381k|                        while (probe != end && (*probe == '\n' || *probe == '\r')) {
 5001|   381k|                           yaml::skip_newline(probe, end);
 5002|       |
 5003|   381k|                           auto value_line = probe;
 5004|   381k|                           int32_t value_indent = yaml::measure_indent(value_line, end, ctx);
 5005|   381k|                           if (bool(ctx.error)) [[unlikely]]
 5006|   381k|                              return false;
 5007|       |
 5008|   381k|                           if (value_line == end || *value_line == '\n' || *value_line == '\r') {
 5009|   381k|                              probe = value_line;
 5010|   381k|                              continue; // blank line
 5011|   381k|                           }
 5012|   381k|                           if (*value_line == '#') {
 5013|   381k|                              yaml::skip_comment(value_line, end);
 5014|   381k|                              probe = value_line;
 5015|   381k|                              continue; // comment-only line
 5016|   381k|                           }
 5017|   381k|                           if (*value_line == ':' && value_indent == explicit_value_indicator_indent) {
 5018|   381k|                              it = value_line;
 5019|   381k|                              found_value_indicator = true;
 5020|   381k|                           }
 5021|   381k|                           break;
 5022|   381k|                        }
 5023|       |
 5024|   381k|                        if (found_value_indicator) {
 5025|   381k|                           yaml::skip_inline_ws(it, end);
 5026|   381k|                        }
 5027|   381k|                     }
 5028|       |
 5029|   381k|                     val_t val{};
 5030|   381k|                     if (it != end && *it == ':') {
 5031|   381k|                        ++it;
 5032|   381k|                        if (it != end && *it == '\t') {
 5033|   381k|                           ctx.error = error_code::syntax_error;
 5034|   381k|                           return false;
 5035|   381k|                        }
 5036|   381k|                        if (it != end && (*it == '\n' || *it == '\r')) {
 5037|   381k|                           auto probe = it;
 5038|   381k|                           yaml::skip_newline(probe, end);
 5039|   381k|                           while (probe != end && *probe == ' ') ++probe;
 5040|   381k|                           if (probe != end && *probe == ':' && ((probe + 1) != end) && *(probe + 1) == '\t') {
 5041|   381k|                              ctx.error = error_code::syntax_error;
 5042|   381k|                              return false;
 5043|   381k|                           }
 5044|   381k|                        }
 5045|   381k|                        yaml::skip_inline_ws(it, end);
 5046|   381k|                        if (!parse_map_value(val)) [[unlikely]]
 5047|   381k|                           return false;
 5048|   381k|                     }
 5049|       |
 5050|   381k|                     value.emplace(std::move(key), std::move(val));
 5051|   381k|                     return true;
 5052|   381k|                  }
 5053|       |
 5054|   381k|                  key_t key{};
 5055|   381k|                  if constexpr (std::same_as<std::remove_cvref_t<key_t>, std::string>) {
 5056|   381k|                     auto key_probe = it;
 5057|   381k|                     yaml::skip_inline_ws(key_probe, end);
 5058|   381k|                     const bool complex_flow_key = (key_probe != end && (*key_probe == '[' || *key_probe == '{'));
 5059|   381k|                     if (complex_flow_key) {
 5060|   381k|                        glz::generic key_node{};
 5061|   381k|                        from<YAML, glz::generic>::template op<yaml::flow_context_on<Opts>()>(key_node, ctx, it, end);
 5062|   381k|                        if (bool(ctx.error)) [[unlikely]]
 5063|   381k|                           return false;
 5064|   381k|                        if (!yaml::materialize_key(key, key_node, ctx)) [[unlikely]]
 5065|   381k|                           return false;
 5066|   381k|                     }
 5067|   381k|                     else {
 5068|   381k|                        if (!yaml::parse_yaml_key(key, ctx, it, end, false)) {
 5069|   381k|                           return false;
 5070|   381k|                        }
 5071|   381k|                     }
 5072|   381k|                  }
 5073|   381k|                  else {
 5074|   381k|                     from<YAML, key_t>::template op<Opts>(key, ctx, it, end);
 5075|   381k|                     if (bool(ctx.error)) [[unlikely]]
 5076|   381k|                        return false;
 5077|   381k|                  }
 5078|       |
 5079|   381k|                  yaml::skip_inline_ws(it, end);
 5080|       |
 5081|   381k|                  if (it == end || *it != ':') {
 5082|   381k|                     ctx.error = error_code::syntax_error;
 5083|   381k|                     return false;
 5084|   381k|                  }
 5085|   381k|                  ++it;
 5086|   381k|                  yaml::skip_inline_ws(it, end);
 5087|       |
 5088|   381k|                  val_t val{};
 5089|   381k|                  if (!parse_map_value(val)) [[unlikely]]
 5090|   381k|                     return false;
 5091|       |
 5092|   381k|                  value.emplace(std::move(key), std::move(val));
 5093|   381k|                  return true;
 5094|   381k|               });
 5095|   381k|         }
 5096|       |
 5097|  1.17M|         yaml::finalize_node_anchor(preamble.node_props, ctx, it);
 5098|  1.17M|      }
_ZN3glz4yaml19parse_node_preambleITnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1ELb0ELb0ELb0ELb0ELj1EEEXtlNS0_20node_property_policyELb1ELb1EEELb0ERNS_17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES4_EEEENS0_12yaml_contextEPKcSC_ZNS_4fromILj450ES8_E2opITnDaXtlS2_Lj450ELb0ELb0ELb1ELb1ELb0ELb0ELb0ELb0ELj1EEERSC_S9_TkNS_10is_contextERSA_SC_EEvOT1_OT2_OT0_T3_EUlNS0_8yaml_tagEE_EEbSL_RSO_RT4_T5_RNS0_19node_preamble_stateEOT6_:
  465|  1.23M|      {
  466|  1.23M|         skip_inline_ws(it, end);
  467|       |
  468|  1.23M|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (468:14): [True: 7, False: 1.23M]
  ------------------
  469|      7|            if constexpr (!AllowEmptyInput) {
  470|      7|               ctx.error = error_code::unexpected_end;
  471|      7|            }
  472|      7|            return true;
  473|      7|         }
  474|       |
  475|  1.23M|         preamble.tag = parse_yaml_tag(it, end, ctx);
  476|  1.23M|         if (preamble.tag == yaml_tag::unknown) [[unlikely]] {
  ------------------
  |  Branch (476:14): [True: 3, False: 1.23M]
  ------------------
  477|      3|            ctx.error = error_code::syntax_error;
  478|      3|            return true;
  479|      3|         }
  480|  1.23M|         if (!tag_validator(preamble.tag)) [[unlikely]] {
  ------------------
  |  Branch (480:14): [True: 3, False: 1.23M]
  ------------------
  481|      3|            ctx.error = error_code::syntax_error;
  482|      3|            return true;
  483|      3|         }
  484|       |
  485|  1.23M|         skip_inline_ws(it, end);
  486|       |
  487|  1.23M|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (487:14): [True: 4, False: 1.23M]
  ------------------
  488|      4|            if constexpr (!AllowEmptyInput) {
  489|      4|               ctx.error = error_code::unexpected_end;
  490|      4|            }
  491|      4|            return true;
  492|      4|         }
  493|       |
  494|  1.23M|         if (parse_node_properties<Opts, PropertyPolicy>(std::forward<T>(value), ctx, it, end, preamble.node_props)) {
  ------------------
  |  Branch (494:14): [True: 22.0k, False: 1.21M]
  ------------------
  495|  22.0k|            return true;
  496|  22.0k|         }
  497|       |
  498|  1.21M|         return false;
  499|  1.23M|      }
_ZZN3glz4fromILj450ENS_17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES1_EEEEE2opITnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1ELb0ELb0ELb0ELb0ELj1EEERPKcRS5_TkNS_10is_contextERNS_4yaml12yaml_contextESA_EEvOT1_OT2_OT0_T3_ENKUlNSD_8yaml_tagEE_clESN_:
 4521|  1.23M|                value, ctx, it, end, preamble, [](yaml::yaml_tag tag) { return yaml::tag_valid_for_map(tag); }))
_ZN3glz4yaml21parse_node_propertiesITnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1ELb0ELb0ELb0ELb0ELj1EEEXtlNS0_20node_property_policyELb1ELb1EEERNS_17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES4_EEEENS0_12yaml_contextEPKcSC_EEbOT1_RT2_RT3_T4_RNS0_19node_property_stateE:
  408|  1.23M|      {
  409|  1.23M|         state.has_anchor = false;
  410|  1.23M|         state.anchor_name.clear();
  411|  1.23M|         state.anchor_start = nullptr;
  412|  1.23M|         state.anchor_indent = ctx.current_indent();
  413|       |
  414|  1.23M|         if constexpr (Policy.allow_alias) {
  415|  1.23M|            if constexpr (Policy.alias_can_be_mapping_key) {
  416|  1.23M|               if (!alias_token_is_mapping_key(it, end)) {
  ------------------
  |  Branch (416:20): [True: 1.23M, False: 402]
  ------------------
  417|  1.23M|                  if (handle_alias<Opts>(std::forward<T>(value), ctx, it, end)) return true;
  ------------------
  |  Branch (417:23): [True: 22.0k, False: 1.21M]
  ------------------
  418|  1.23M|               }
  419|       |            }
  420|       |            else {
  421|       |               if (handle_alias<Opts>(std::forward<T>(value), ctx, it, end)) return true;
  422|       |            }
  423|  1.23M|         }
  424|       |
  425|  1.23M|         if (it != end && *it == '&') {
  ------------------
  |  Branch (425:14): [True: 1.21M, False: 22.0k]
  |  Branch (425:27): [True: 5.04k, False: 1.20M]
  ------------------
  426|  5.04k|            ++it;
  427|  5.04k|            auto name = parse_anchor_name(it, end);
  428|  5.04k|            if (name.empty()) {
  ------------------
  |  Branch (428:17): [True: 4, False: 5.04k]
  ------------------
  429|      4|               ctx.error = error_code::syntax_error;
  430|      4|               return true;
  431|      4|            }
  432|  5.04k|            skip_inline_ws(it, end);
  433|  5.04k|            if (it == end) {
  ------------------
  |  Branch (433:17): [True: 15, False: 5.02k]
  ------------------
  434|     15|               if constexpr (!Policy.allow_empty_after_anchor) {
  435|     15|                  ctx.error = error_code::unexpected_end;
  436|     15|               }
  437|     15|               return true;
  438|     15|            }
  439|       |            if constexpr (Policy.disallow_anchor_on_alias) {
  440|       |               if (*it == '*') {
  441|       |                  ctx.error = error_code::syntax_error;
  442|       |                  return true;
  443|       |               }
  444|       |            }
  445|  5.02k|            state.has_anchor = true;
  446|  5.02k|            state.anchor_name = std::string(name);
  447|  5.02k|            state.anchor_start = &*it;
  448|  5.02k|         }
  449|       |
  450|  1.23M|         return false;
  451|  1.23M|      }
_ZN3glz4yaml12handle_aliasITnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1ELb0ELb0ELb0ELb0ELj1EEERNS_17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES3_EEEENS0_12yaml_contextEPKcSB_EEbOT0_RT1_RT2_T3_:
  300|  1.23M|      {
  301|  1.23M|         if (it == end || *it != '*') return false;
  ------------------
  |  Branch (301:14): [True: 0, False: 1.23M]
  |  Branch (301:27): [True: 1.21M, False: 22.0k]
  ------------------
  302|       |
  303|  22.0k|         ++it; // skip '*'
  304|  22.0k|         auto name = parse_anchor_name(it, end);
  305|  22.0k|         if (name.empty()) {
  ------------------
  |  Branch (305:14): [True: 7, False: 22.0k]
  ------------------
  306|      7|            ctx.error = error_code::syntax_error;
  307|      7|            return true;
  308|      7|         }
  309|       |
  310|  22.0k|         auto anchor_it = ctx.anchors.find(name);
  311|  22.0k|         if (anchor_it == ctx.anchors.end()) {
  ------------------
  |  Branch (311:14): [True: 32, False: 22.0k]
  ------------------
  312|     32|            ctx.error = error_code::syntax_error; // undefined alias
  313|     32|            return true;
  314|     32|         }
  315|       |
  316|       |         // Copied rather than referenced: the replay below can replace ctx.anchors wholesale
  317|       |         // (a speculative parse hands its own map back), which would dangle a reference here.
  318|  22.0k|         const auto span = anchor_it->second;
  319|       |
  320|       |         // Empty anchor span (anchor on null/empty node) — leave value as default
  321|  22.0k|         if (span.begin == span.end) {
  ------------------
  |  Branch (321:14): [True: 468, False: 21.5k]
  ------------------
  322|    468|            return true;
  323|    468|         }
  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.5k|         if (ctx.alias_span_is_replaying(span.begin, span.end)) [[unlikely]] {
  ------------------
  |  Branch (328:14): [True: 8, False: 21.5k]
  ------------------
  329|      8|            ctx.error = error_code::syntax_error; // cyclic alias
  330|      8|            return true;
  331|      8|         }
  332|       |
  333|       |         // Replaying an anchor re-enters the reader directly, bypassing the variant reader's
  334|       |         // depth guard, so this is the only depth accounting a chain of aliases into a
  335|       |         // non-variant target gets. The cycle check above stops the unbounded case; this bounds
  336|       |         // a legitimate but deeply chained one.
  337|  21.5k|         depth_guard guard{ctx, yaml::max_yaml_recursive_depth};
  338|  21.5k|         if (!guard) [[unlikely]]
  ------------------
  |  Branch (338:14): [True: 2, False: 21.5k]
  ------------------
  339|      2|            return true;
  340|       |
  341|  21.5k|         if (!ctx.charge_alias_expansion(static_cast<size_t>(span.end - span.begin))) [[unlikely]] {
  ------------------
  |  Branch (341:14): [True: 1, False: 21.5k]
  ------------------
  342|      1|            ctx.error = error_code::exceeded_max_expansion;
  343|      1|            ctx.custom_error_message = "alias expansion";
  344|      1|            return true;
  345|      1|         }
  346|       |
  347|  21.5k|         auto replay_it = span.begin;
  348|  21.5k|         auto replay_end = span.end;
  349|       |
  350|       |         // Save indent context and set up for replay
  351|  21.5k|         auto saved_indent_stack = std::move(ctx.indent_stack);
  352|  21.5k|         ctx.indent_stack.clear();
  353|  21.5k|         if (span.base_indent > 0) {
  ------------------
  |  Branch (353:14): [True: 952, False: 20.5k]
  ------------------
  354|    952|            ctx.push_indent(span.base_indent - 1);
  355|    952|         }
  356|       |
  357|  21.5k|         ctx.active_alias_spans.emplace_back(span.begin, span.end);
  358|       |
  359|  21.5k|         using V = std::remove_cvref_t<T>;
  360|  21.5k|         from<YAML, V>::template op<Opts>(std::forward<T>(value), ctx, replay_it, replay_end);
  361|       |
  362|  21.5k|         ctx.active_alias_spans.pop_back();
  363|       |
  364|       |         // Restore indent context
  365|  21.5k|         ctx.indent_stack = std::move(saved_indent_stack);
  366|  21.5k|         return true;
  367|  21.5k|      }
_ZZN3glz4fromILj450ENS_17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES1_EEEEE2opITnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1ELb0ELb0ELb0ELb0ELj1EEERPKcRS5_TkNS_10is_contextERNS_4yaml12yaml_contextESA_EEvOT1_OT2_OT0_T3_ENKUlRS4_E_clESN_:
 4658|  2.71M|               auto parse_implicit_null = [&](val_t& val) -> bool {
 4659|       |                  if constexpr (nullable_like<std::remove_cvref_t<val_t>>) {
 4660|       |                     val = {};
 4661|       |                     return true;
 4662|       |                  }
 4663|  2.71M|                  else if constexpr (std::same_as<std::remove_cvref_t<val_t>, glz::generic>) {
 4664|  2.71M|                     val = glz::generic{};
 4665|  2.71M|                     return true;
 4666|       |                  }
 4667|       |                  else {
 4668|       |                     static constexpr std::string_view null_value{"null"};
 4669|       |                     auto null_it = null_value.data();
 4670|       |                     from<YAML, val_t>::template op<yaml::flow_context_on<Opts>()>(
 4671|       |                        val, ctx, null_it, null_value.data() + null_value.size());
 4672|       |                     return !bool(ctx.error);
 4673|       |                  }
 4674|  2.71M|               };
_ZN3glz4yaml24parse_block_mapping_loopITnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1ELb0ELb0ELb0ELb0ELj1EEENS0_12yaml_contextEPKcS5_ZNS_4fromILj450ENS_17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES7_EEEEE2opITnDaXtlS2_Lj450ELb0ELb0ELb1ELb1ELb0ELb0ELb0ELb0ELj1EEERS5_RSB_TkNS_10is_contextERS3_S5_EEvOT1_OT2_OT0_T3_EUlRT_RSL_SH_iE_EEvSQ_RSH_SJ_iOSN_:
 3633|   381k|      {
 3634|       |         // A tagged-variant custom alternative hands its body (at the variant's own column) to a
 3635|       |         // discover-mode reader. Honor the known indent it published so continuation/dedent are
 3636|       |         // judged against the outer parent, not the body itself. One-shot: reset on observation.
 3637|   381k|         if (ctx.forced_block_mapping_indent >= 0) {
  ------------------
  |  Branch (3637:14): [True: 0, False: 381k]
  ------------------
 3638|      0|            if (mapping_indent < 0) {
  ------------------
  |  Branch (3638:17): [True: 0, False: 0]
  ------------------
 3639|      0|               mapping_indent = ctx.forced_block_mapping_indent;
 3640|      0|            }
 3641|      0|            ctx.forced_block_mapping_indent = -1;
 3642|      0|         }
 3643|   381k|         const int32_t parent_indent = ctx.current_indent();
 3644|   381k|         const bool discover_indent = (mapping_indent < 0);
 3645|   381k|         bool first_key = !discover_indent;
 3646|   381k|         bool discovered_first_key_mid_line = false;
 3647|   381k|         int32_t discovered_first_key_visual_indent = 0;
 3648|       |
 3649|   869k|         while (it != end) {
  ------------------
  |  Branch (3649:17): [True: 540k, False: 328k]
  ------------------
 3650|   540k|            auto line_start = it;
 3651|   540k|            int32_t line_indent = first_key ? mapping_indent : 0;
  ------------------
  |  Branch (3651:35): [True: 0, False: 540k]
  ------------------
 3652|       |
 3653|       |            // Skip blank lines and comments, measure indent
 3654|   737k|            while (it != end) {
  ------------------
  |  Branch (3654:20): [True: 732k, False: 5.17k]
  ------------------
 3655|   732k|               if (*it == '#') {
  ------------------
  |  Branch (3655:20): [True: 56.7k, False: 675k]
  ------------------
 3656|  56.7k|                  skip_comment(it, end);
 3657|  56.7k|                  skip_newline(it, end);
 3658|  56.7k|                  first_key = false;
 3659|  56.7k|                  line_indent = 0;
 3660|  56.7k|               }
 3661|   675k|               else if (*it == '\n' || *it == '\r') {
  ------------------
  |  Branch (3661:25): [True: 16.8k, False: 658k]
  |  Branch (3661:40): [True: 72.2k, False: 586k]
  ------------------
 3662|  89.0k|                  skip_newline(it, end);
 3663|  89.0k|                  first_key = false;
 3664|  89.0k|                  line_indent = 0;
 3665|  89.0k|               }
 3666|   586k|               else if (*it == ' ') {
  ------------------
  |  Branch (3666:25): [True: 110k, False: 476k]
  ------------------
 3667|   110k|                  line_start = it;
 3668|   110k|                  line_indent = 0;
 3669|   272k|                  while (it != end && *it == ' ') {
  ------------------
  |  Branch (3669:26): [True: 271k, False: 1.14k]
  |  Branch (3669:39): [True: 162k, False: 108k]
  ------------------
 3670|   162k|                     ++line_indent;
 3671|   162k|                     ++it;
 3672|   162k|                  }
 3673|       |
 3674|   110k|                  bool saw_tab = false;
 3675|   125k|                  while (it != end && (*it == ' ' || *it == '\t')) {
  ------------------
  |  Branch (3675:26): [True: 124k, False: 1.22k]
  |  Branch (3675:40): [True: 896, False: 123k]
  |  Branch (3675:54): [True: 14.9k, False: 108k]
  ------------------
 3676|  15.8k|                     saw_tab = saw_tab || (*it == '\t');
  ------------------
  |  Branch (3676:32): [True: 14.9k, False: 910]
  |  Branch (3676:43): [True: 910, False: 0]
  ------------------
 3677|  15.8k|                     ++it;
 3678|  15.8k|                  }
 3679|       |
 3680|   110k|                  if (it == end || *it == '\n' || *it == '\r' || *it == '#') {
  ------------------
  |  Branch (3680:23): [True: 1.22k, False: 108k]
  |  Branch (3680:36): [True: 4.76k, False: 104k]
  |  Branch (3680:51): [True: 1.47k, False: 102k]
  |  Branch (3680:66): [True: 40.1k, False: 62.4k]
  ------------------
 3681|  47.5k|                     first_key = false;
 3682|  47.5k|                     line_indent = 0;
 3683|  47.5k|                     continue; // Blank or comment line
 3684|  47.5k|                  }
 3685|       |
 3686|  62.4k|                  if (saw_tab) {
  ------------------
  |  Branch (3686:23): [True: 13, False: 62.4k]
  ------------------
 3687|     13|                     ctx.error = error_code::syntax_error;
 3688|     13|                     return;
 3689|     13|                  }
 3690|       |
 3691|       |                  // Early dedent check
 3692|  62.4k|                  if (mapping_indent >= 0 && line_indent < mapping_indent) {
  ------------------
  |  Branch (3692:23): [True: 60.0k, False: 2.45k]
  |  Branch (3692:46): [True: 374, False: 59.6k]
  ------------------
 3693|    374|                     it = line_start;
 3694|    374|                     return;
 3695|    374|                  }
 3696|       |
 3697|  62.1k|                  first_key = false;
 3698|  62.1k|                  break; // Found content
 3699|  62.4k|               }
 3700|   476k|               else if (*it == '\t') {
  ------------------
  |  Branch (3700:25): [True: 3.29k, False: 473k]
  ------------------
 3701|  3.29k|                  line_start = it;
 3702|  14.6k|                  while (it != end && (*it == ' ' || *it == '\t')) ++it;
  ------------------
  |  Branch (3702:26): [True: 13.2k, False: 1.37k]
  |  Branch (3702:40): [True: 4.15k, False: 9.13k]
  |  Branch (3702:54): [True: 7.21k, False: 1.91k]
  ------------------
 3703|  3.29k|                  if (it == end || *it == '\n' || *it == '\r' || *it == '#') {
  ------------------
  |  Branch (3703:23): [True: 1.37k, False: 1.91k]
  |  Branch (3703:36): [True: 469, False: 1.44k]
  |  Branch (3703:51): [True: 710, False: 738]
  |  Branch (3703:66): [True: 721, False: 17]
  ------------------
 3704|  3.27k|                     first_key = false;
 3705|  3.27k|                     line_indent = 0;
 3706|  3.27k|                     continue; // Blank or comment-only line with tab indentation
 3707|  3.27k|                  }
 3708|     17|                  ctx.error = error_code::syntax_error;
 3709|     17|                  return;
 3710|  3.29k|               }
 3711|   473k|               else {
 3712|   473k|                  line_start = it;
 3713|   473k|                  break; // Content at column 0
 3714|   473k|               }
 3715|   732k|            }
 3716|       |
 3717|   540k|            if (it == end) break;
  ------------------
  |  Branch (3717:17): [True: 5.17k, False: 535k]
  ------------------
 3718|       |
 3719|       |            // Document boundaries terminate the current mapping in both discovered
 3720|       |            // and fixed-indent modes.
 3721|   535k|            if (at_document_end(it, end) || at_document_start(it, end)) break;
  ------------------
  |  Branch (3721:17): [True: 1.62k, False: 533k]
  |  Branch (3721:45): [True: 1.73k, False: 532k]
  ------------------
 3722|       |
 3723|       |            // Dedent checks (skip on first key for struct case)
 3724|       |            // Must check BEFORE establishing mapping_indent so the first discovered key
 3725|       |            // isn't rejected by the parent_indent check (mapping_indent is still -1).
 3726|   532k|            if (!first_key) {
  ------------------
  |  Branch (3726:17): [True: 532k, False: 0]
  ------------------
 3727|       |               // Parent indent check for nested maps (only after mapping_indent established)
 3728|   532k|               if (discover_indent && mapping_indent >= 0 && parent_indent >= 0 && line_indent <= parent_indent) {
  ------------------
  |  Branch (3728:20): [True: 532k, False: 0]
  |  Branch (3728:39): [True: 151k, False: 381k]
  |  Branch (3728:62): [True: 45.0k, False: 105k]
  |  Branch (3728:84): [True: 33.4k, False: 11.5k]
  ------------------
 3729|  33.4k|                  it = line_start;
 3730|  33.4k|                  return;
 3731|  33.4k|               }
 3732|   498k|               if (mapping_indent >= 0 && line_indent < mapping_indent) {
  ------------------
  |  Branch (3732:20): [True: 117k, False: 381k]
  |  Branch (3732:43): [True: 407, False: 117k]
  ------------------
 3733|    407|                  it = line_start;
 3734|    407|                  return;
 3735|    407|               }
 3736|   498k|            }
 3737|       |
 3738|       |            // Establish mapping indent from first key (map case)
 3739|   498k|            bool established_mapping_indent_this_line = false;
 3740|   498k|            if (mapping_indent < 0) {
  ------------------
  |  Branch (3740:17): [True: 381k, False: 117k]
  ------------------
 3741|   381k|               mapping_indent = line_indent;
 3742|   381k|               established_mapping_indent_this_line = true;
 3743|   381k|               discovered_first_key_visual_indent = line_indent;
 3744|   381k|               if constexpr (std::is_pointer_v<std::decay_t<It>>) {
 3745|   381k|                  if (ctx.stream_begin && line_start > ctx.stream_begin) {
  ------------------
  |  Branch (3745:23): [True: 381k, False: 0]
  |  Branch (3745:43): [True: 381k, False: 0]
  ------------------
 3746|   381k|                     const auto prefix = ctx.line_prefix_before(line_start);
 3747|   381k|                     if (prefix.has_tab) {
  ------------------
  |  Branch (3747:26): [True: 209, False: 380k]
  ------------------
 3748|    209|                        ctx.error = error_code::syntax_error;
 3749|    209|                        return;
 3750|    209|                     }
 3751|       |
 3752|   380k|                     discovered_first_key_mid_line = prefix.has_content;
 3753|   380k|                     if (mapping_indent == 0 && prefix.column > 0) {
  ------------------
  |  Branch (3753:26): [True: 378k, False: 2.45k]
  |  Branch (3753:49): [True: 279k, False: 98.9k]
  ------------------
 3754|   279k|                        discovered_first_key_visual_indent = prefix.column;
 3755|   279k|                     }
 3756|   380k|                  }
 3757|   381k|               }
 3758|   381k|            }
 3759|       |
 3760|       |            // In discovered-indent block mappings, sibling keys must stay at the same
 3761|       |            // indent level, except when the first key started mid-line (e.g. "--- k: v").
 3762|   498k|            if (discover_indent && mapping_indent >= 0 && !established_mapping_indent_this_line &&
  ------------------
  |  Branch (3762:17): [True: 497k, False: 209]
  |  Branch (3762:36): [True: 497k, False: 0]
  |  Branch (3762:59): [True: 117k, False: 380k]
  ------------------
 3763|   117k|                !discovered_first_key_mid_line) {
  ------------------
  |  Branch (3763:17): [True: 27.9k, False: 89.1k]
  ------------------
 3764|  27.9k|               if (mapping_indent == 0 && discovered_first_key_visual_indent > 0) {
  ------------------
  |  Branch (3764:20): [True: 27.7k, False: 261]
  |  Branch (3764:43): [True: 9.58k, False: 18.1k]
  ------------------
 3765|  9.58k|                  if (line_indent > discovered_first_key_visual_indent) {
  ------------------
  |  Branch (3765:23): [True: 8, False: 9.57k]
  ------------------
 3766|      8|                     ctx.error = error_code::syntax_error;
 3767|      8|                     return;
 3768|      8|                  }
 3769|  9.57k|                  if (line_indent < discovered_first_key_visual_indent) {
  ------------------
  |  Branch (3769:23): [True: 1.60k, False: 7.97k]
  ------------------
 3770|  1.60k|                     it = line_start;
 3771|  1.60k|                     return;
 3772|  1.60k|                  }
 3773|  9.57k|               }
 3774|  18.4k|               else if (line_indent > mapping_indent &&
  ------------------
  |  Branch (3774:25): [True: 555, False: 17.8k]
  ------------------
 3775|    555|                        (parent_indent < 0 || mapping_indent > 0 ||
  ------------------
  |  Branch (3775:26): [True: 34, False: 521]
  |  Branch (3775:47): [True: 1, False: 520]
  ------------------
 3776|    520|                         (parent_indent >= 0 && mapping_indent == 0 && line_indent > (parent_indent + 1)))) {
  ------------------
  |  Branch (3776:27): [True: 520, False: 0]
  |  Branch (3776:49): [True: 520, False: 0]
  |  Branch (3776:72): [True: 4, False: 516]
  ------------------
 3777|     39|                  ctx.error = error_code::syntax_error;
 3778|     39|                  return;
 3779|     39|               }
 3780|  27.9k|            }
 3781|       |
 3782|       |            // Sequence indicator check (struct case only - map parser lets key parsing
 3783|       |            // handle '- ' which produces appropriate errors for misindented items)
 3784|   496k|            if (!discover_indent && *it == '-' &&
  ------------------
  |  Branch (3784:17): [True: 0, False: 496k]
  |  Branch (3784:37): [True: 0, False: 0]
  ------------------
 3785|      0|                ((it + 1) == end || *(it + 1) == ' ' || *(it + 1) == '\t' || *(it + 1) == '\n')) {
  ------------------
  |  Branch (3785:18): [True: 0, False: 0]
  |  Branch (3785:37): [True: 0, False: 0]
  |  Branch (3785:57): [True: 0, False: 0]
  |  Branch (3785:78): [True: 0, False: 0]
  ------------------
 3786|      0|               it = line_start;
 3787|      0|               return;
 3788|      0|            }
 3789|       |
 3790|       |            // Skip indented comment lines
 3791|   496k|            if (*it == '#') {
  ------------------
  |  Branch (3791:17): [True: 0, False: 496k]
  ------------------
 3792|      0|               skip_comment(it, end);
 3793|      0|               first_key = false;
 3794|      0|               continue;
 3795|      0|            }
 3796|       |
 3797|       |            // Skip blank/empty lines after indent
 3798|   496k|            if (*it == '\n' || *it == '\r') {
  ------------------
  |  Branch (3798:17): [True: 209, False: 496k]
  |  Branch (3798:32): [True: 0, False: 496k]
  ------------------
 3799|      0|               first_key = false;
 3800|      0|               continue;
 3801|      0|            }
 3802|       |
 3803|       |            // While parsing an explicit mapping key node ('? key-node'),
 3804|       |            // a subsequent standalone ':' at the same indentation starts
 3805|       |            // the outer value indicator and must terminate this key-node map.
 3806|       |            // Keep same-line ': x' on the first key-node line valid.
 3807|   496k|            if (ctx.explicit_mapping_key_context && !established_mapping_indent_this_line && *it == ':') {
  ------------------
  |  Branch (3807:17): [True: 129k, False: 366k]
  |  Branch (3807:53): [True: 22.5k, False: 107k]
  |  Branch (3807:94): [True: 6.13k, False: 16.4k]
  ------------------
 3808|  6.13k|               const auto after_colon = it + 1;
 3809|  6.13k|               const int32_t explicit_value_indicator_indent = (parent_indent < 0) ? 0 : (parent_indent + 1);
  ------------------
  |  Branch (3809:64): [True: 5.07k, False: 1.05k]
  ------------------
 3810|  6.13k|               if ((after_colon == end || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*after_colon)]) &&
  ------------------
  |  Branch (3810:21): [True: 321, False: 5.80k]
  |  Branch (3810:43): [True: 2.21k, False: 3.59k]
  ------------------
 3811|  2.53k|                   line_indent == explicit_value_indicator_indent) {
  ------------------
  |  Branch (3811:20): [True: 583, False: 1.95k]
  ------------------
 3812|    583|                  it = line_start;
 3813|    583|                  return;
 3814|    583|               }
 3815|  6.13k|            }
 3816|       |
 3817|       |            // Process this mapping entry (key + colon + value)
 3818|   495k|            int32_t effective_line_indent = line_indent;
 3819|   495k|            if (discover_indent && established_mapping_indent_this_line &&
  ------------------
  |  Branch (3819:17): [True: 495k, False: 209]
  |  Branch (3819:36): [True: 380k, False: 114k]
  ------------------
 3820|   380k|                discovered_first_key_visual_indent > effective_line_indent &&
  ------------------
  |  Branch (3820:17): [True: 279k, False: 101k]
  ------------------
 3821|   279k|                !(discovered_first_key_mid_line && parent_indent < 0)) {
  ------------------
  |  Branch (3821:19): [True: 237k, False: 41.6k]
  |  Branch (3821:52): [True: 136k, False: 101k]
  ------------------
 3822|       |               // The first discovered key has no indentation of its own left to measure: it may
 3823|       |               // begin mid-line (a sequence entry's "- key: value"), or the caller may have already
 3824|       |               // consumed the line's indentation before handing the mapping over. Pass its visual
 3825|       |               // column so the entry judges its value against the key's real indent -- otherwise a
 3826|       |               // key with an empty value takes the following sibling line for nested content
 3827|       |               // (issue #2827) and same-line block scalars compute the wrong indentation.
 3828|       |               // The exception is a ROOT mapping whose first key begins mid-line, which means node
 3829|       |               // properties sit ahead of it (`!!str &a1 "foo":`): those belong to the document node
 3830|       |               // rather than to the key's column, so the measured indent stands. Conformance tests
 3831|       |               // 7FWL and HMQ5 pin that case.
 3832|   143k|               effective_line_indent = discovered_first_key_visual_indent;
 3833|   143k|            }
 3834|       |
 3835|   495k|            if (!process_entry(ctx, it, end, effective_line_indent)) {
  ------------------
  |  Branch (3835:17): [True: 7.49k, False: 488k]
  ------------------
 3836|  7.49k|               return;
 3837|  7.49k|            }
 3838|   488k|            first_key = false;
 3839|       |
 3840|   488k|            if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (3840:17): [True: 0, False: 488k]
  ------------------
 3841|      0|               return;
 3842|       |
 3843|   488k|            if constexpr (yaml::check_flow_context(Opts)) {
 3844|       |               // In flow context, an implicit "key: value" pair used as a sequence entry
 3845|       |               // ends at ',', ']', or '}'. Let the enclosing flow parser consume it.
 3846|   488k|               auto flow_end = it;
 3847|   488k|               skip_flow_ws_and_newlines(ctx, flow_end, end);
 3848|   488k|               if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (3848:20): [True: 38, False: 488k]
  ------------------
 3849|     38|                  return;
 3850|   488k|               if (flow_end != end && (*flow_end == ',' || *flow_end == ']' || *flow_end == '}')) {
  ------------------
  |  Branch (3850:20): [True: 393k, False: 94.6k]
  |  Branch (3850:40): [True: 178k, False: 214k]
  |  Branch (3850:60): [True: 7.30k, False: 207k]
  |  Branch (3850:80): [True: 52.4k, False: 155k]
  ------------------
 3851|   238k|                  it = flow_end;
 3852|   238k|                  return;
 3853|   238k|               }
 3854|   488k|            }
 3855|       |
 3856|       |            // Trailing whitespace handling (peek-ahead pattern).
 3857|       |            // After parsing, iterator may be at leading indent of next line.
 3858|       |            // Don't consume it - let the outer loop handle indent measurement.
 3859|   488k|            if (it != end) {
  ------------------
  |  Branch (3859:17): [True: 171k, False: 316k]
  ------------------
 3860|   171k|               if (*it == ' ' || *it == '\t') {
  ------------------
  |  Branch (3860:20): [True: 54.2k, False: 117k]
  |  Branch (3860:34): [True: 645, False: 117k]
  ------------------
 3861|  54.9k|                  auto peek = it;
 3862|  54.9k|                  skip_inline_ws(peek, end);
 3863|  54.9k|                  if (peek != end && *peek != '\n' && *peek != '\r' && *peek != '#') {
  ------------------
  |  Branch (3863:23): [True: 51.6k, False: 3.24k]
  |  Branch (3863:38): [True: 49.9k, False: 1.72k]
  |  Branch (3863:55): [True: 48.7k, False: 1.25k]
  |  Branch (3863:72): [True: 47.8k, False: 885]
  ------------------
 3864|  47.8k|                     continue; // At leading indent of new line
 3865|  47.8k|                  }
 3866|  54.9k|               }
 3867|   124k|               skip_inline_ws(it, end);
 3868|   124k|               if (it != end && *it == '#') {
  ------------------
  |  Branch (3868:20): [True: 120k, False: 3.24k]
  |  Branch (3868:33): [True: 9.17k, False: 111k]
  ------------------
 3869|  9.17k|                  if constexpr (std::is_pointer_v<std::decay_t<It>>) {
 3870|  9.17k|                     if (it > line_start) {
  ------------------
  |  Branch (3870:26): [True: 9.17k, False: 0]
  ------------------
 3871|  9.17k|                        const char prev = *(it - 1);
 3872|  9.17k|                        if (prev != ' ' && prev != '\t' && prev != '\n' && prev != '\r') {
  ------------------
  |  Branch (3872:29): [True: 2.21k, False: 6.96k]
  |  Branch (3872:44): [True: 1.51k, False: 696]
  |  Branch (3872:60): [True: 491, False: 1.02k]
  |  Branch (3872:76): [True: 6, False: 485]
  ------------------
 3873|      6|                           ctx.error = error_code::syntax_error;
 3874|      6|                           return;
 3875|      6|                        }
 3876|  9.17k|                     }
 3877|  9.17k|                  }
 3878|  9.17k|               }
 3879|  9.16k|               skip_comment(it, end);
 3880|   124k|               if (it != end && (*it == '\n' || *it == '\r')) {
  ------------------
  |  Branch (3880:20): [True: 120k, False: 3.29k]
  |  Branch (3880:34): [True: 36.0k, False: 84.8k]
  |  Branch (3880:49): [True: 33.8k, False: 50.9k]
  ------------------
 3881|  69.8k|                  skip_newline(it, end);
 3882|  69.8k|               }
 3883|  54.2k|               else if (it != end) {
  ------------------
  |  Branch (3883:25): [True: 50.9k, False: 3.29k]
  ------------------
 3884|       |                  // The entry stopped part way along its line with something other than
 3885|       |                  // whitespace or a comment after it -- a ':' its value could not take as a
 3886|       |                  // separator, say. The next pass measures indent as though this were the start
 3887|       |                  // of a line, so what is left of the real one is lost; reject it instead.
 3888|  50.9k|                  if constexpr (requires { ctx.line_prefix_before(it); }) {
 3889|  50.9k|                     if (ctx.line_prefix_before(it).has_content) {
  ------------------
  |  Branch (3889:26): [True: 293, False: 50.6k]
  ------------------
 3890|    293|                        ctx.error = error_code::syntax_error;
 3891|    293|                        return;
 3892|    293|                     }
 3893|  50.9k|                  }
 3894|  50.9k|               }
 3895|   124k|            }
 3896|   488k|         }
 3897|   381k|      }
_ZZN3glz4fromILj450ENS_17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES1_EEEEE2opITnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1ELb0ELb0ELb0ELb0ELj1EEERPKcRS5_TkNS_10is_contextERNS_4yaml12yaml_contextESA_EEvOT1_OT2_OT0_T3_ENKUlRT_RSK_SG_iE_clISE_SA_SA_EEbSO_SP_SG_i:
 4777|   495k|               ctx, it, end, int32_t(-1), [&](auto& ctx, auto& it, auto end, int32_t line_indent) -> bool {
 4778|   495k|                  auto parse_map_value = [&](val_t& val) -> bool {
 4779|   495k|                     if (it != end && !yaml::line_end_or_comment_table[static_cast<uint8_t>(*it)]) {
 4780|   495k|                        bool line_starts_with_explicit_value_indicator = false;
 4781|       |
 4782|       |                        // Inline mapping values in block context cannot start with a
 4783|       |                        // plain "key: value" pair on the same line (e.g. "a: b: c").
 4784|       |                        // Such constructs are malformed unless wrapped in flow
 4785|       |                        // delimiters ({...} / [...]) or quoted.
 4786|   495k|                        if constexpr (std::is_pointer_v<std::decay_t<decltype(it)>>) {
 4787|   495k|                           if (ctx.stream_begin) {
 4788|   495k|                              auto is_line_content_start = [&](auto pos) {
 4789|   495k|                                 return !ctx.line_prefix_before(pos).has_content;
 4790|   495k|                              };
 4791|       |
 4792|   495k|                              auto line_has_explicit_value_indicator = [&](auto pos) {
 4793|   495k|                                 const char* line = ctx.line_begin_of(pos);
 4794|   495k|                                 while (line != end && (*line == ' ' || *line == '\t')) ++line;
 4795|   495k|                                 return line != end && *line == ':';
 4796|   495k|                              };
 4797|       |
 4798|   495k|                              if (!is_line_content_start(it) &&
 4799|   495k|                                  yaml::inline_value_has_plain_mapping_indicator(it, end) &&
 4800|   495k|                                  !line_has_explicit_value_indicator(it)) {
 4801|   495k|                                 ctx.error = error_code::syntax_error;
 4802|   495k|                                 return false;
 4803|   495k|                              }
 4804|   495k|                              line_starts_with_explicit_value_indicator = line_has_explicit_value_indicator(it);
 4805|   495k|                           }
 4806|   495k|                        }
 4807|       |
 4808|   495k|                        if (*it == '-' &&
 4809|   495k|                            ((it + 1) == end || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*(it + 1))]) &&
 4810|   495k|                            !line_starts_with_explicit_value_indicator) {
 4811|       |                           // "key: - item" is not valid block sequence syntax.
 4812|   495k|                           ctx.error = error_code::syntax_error;
 4813|   495k|                           return false;
 4814|   495k|                        }
 4815|       |
 4816|   495k|                        if (!ctx.push_indent(line_indent + 1)) [[unlikely]]
 4817|   495k|                           return false;
 4818|   495k|                        from<YAML, val_t>::template op<Opts>(val, ctx, it, end);
 4819|   495k|                        ctx.pop_indent();
 4820|   495k|                     }
 4821|   495k|                     else {
 4822|   495k|                        int32_t nested_indent = yaml::detect_nested_value_indent(ctx, it, end, line_indent);
 4823|   495k|                        if (nested_indent >= 0) {
 4824|   495k|                           yaml::skip_to_content(it, end);
 4825|   495k|                           if (it != end && *it == ':' && (it + 1) != end && *(it + 1) == '\t') {
 4826|   495k|                              ctx.error = error_code::syntax_error;
 4827|   495k|                              return false;
 4828|   495k|                           }
 4829|       |                           // A struct value reads the pushed indent as its own key column;
 4830|       |                           // every other value type reads it as the enclosing baseline.
 4831|   495k|                           const int32_t value_indent =
 4832|   495k|                              yaml::receives_block_mapping_column<val_t>() ? nested_indent : nested_indent - 1;
 4833|   495k|                           if (!ctx.push_indent(value_indent)) [[unlikely]]
 4834|   495k|                              return false;
 4835|   495k|                           from<YAML, val_t>::template op<Opts>(val, ctx, it, end);
 4836|   495k|                           ctx.pop_indent();
 4837|   495k|                        }
 4838|   495k|                     }
 4839|   495k|                     return !bool(ctx.error);
 4840|   495k|                  };
 4841|       |
 4842|       |                  // Explicit key entry form:
 4843|       |                  // ? key
 4844|       |                  // : value
 4845|   495k|                  if (*it == '?' && ((it + 1) != end) && *(it + 1) == '\t') {
  ------------------
  |  Branch (4845:23): [True: 196k, False: 299k]
  |  Branch (4845:37): [True: 195k, False: 572]
  |  Branch (4845:58): [True: 2, False: 195k]
  ------------------
 4846|      2|                     ctx.error = error_code::syntax_error;
 4847|      2|                     return false;
 4848|      2|                  }
 4849|   495k|                  if (*it == '?' && ((it + 1) == end || *(it + 1) == ' ' || *(it + 1) == '\n' || *(it + 1) == '\r')) {
  ------------------
  |  Branch (4849:23): [True: 196k, False: 299k]
  |  Branch (4849:38): [True: 572, False: 195k]
  |  Branch (4849:57): [True: 82.4k, False: 113k]
  |  Branch (4849:77): [True: 84.2k, False: 29.2k]
  |  Branch (4849:98): [True: 22.3k, False: 6.91k]
  ------------------
 4850|   189k|                     ++it; // skip '?'
 4851|   189k|                     yaml::skip_inline_ws(it, end);
 4852|       |
 4853|   189k|                     const int32_t explicit_value_indicator_indent =
 4854|   189k|                        (ctx.current_indent() < 0) ? 0 : (ctx.current_indent() + 1);
  ------------------
  |  Branch (4854:25): [True: 113k, False: 76.0k]
  ------------------
 4855|       |
 4856|   189k|                     key_t key{};
 4857|   189k|                     if constexpr (std::same_as<std::remove_cvref_t<key_t>, std::string>) {
 4858|   189k|                        auto to_string_key = [&](glz::generic& key_node) {
 4859|   189k|                           return yaml::materialize_key(key, key_node, ctx);
 4860|   189k|                        };
 4861|       |
 4862|   189k|                        auto key_it = it;
 4863|   189k|                        yaml::skip_inline_ws(key_it, end);
 4864|       |
 4865|   189k|                        auto content = key_it;
 4866|   189k|                        yaml::skip_to_content(content, end);
 4867|   189k|                        bool handled_anchor_only_empty_key = false;
 4868|       |
 4869|       |                        // Anchor on an empty explicit key node:
 4870|       |                        //   ? &a
 4871|       |                        //   : value
 4872|   189k|                        if (content != end && *content == '&') {
  ------------------
  |  Branch (4872:29): [True: 186k, False: 3.06k]
  |  Branch (4872:47): [True: 57.3k, False: 129k]
  ------------------
 4873|  57.3k|                           auto anchor_probe = content + 1;
 4874|  57.3k|                           auto anchor_name = yaml::parse_anchor_name(anchor_probe, end);
 4875|  57.3k|                           if (!anchor_name.empty()) {
  ------------------
  |  Branch (4875:32): [True: 57.3k, False: 13]
  ------------------
 4876|  57.3k|                              auto after_anchor = anchor_probe;
 4877|  57.3k|                              yaml::skip_inline_ws(after_anchor, end);
 4878|       |
 4879|  57.3k|                              auto value_indicator = after_anchor;
 4880|  57.3k|                              if (value_indicator != end && *value_indicator == ':') {
  ------------------
  |  Branch (4880:35): [True: 55.2k, False: 2.08k]
  |  Branch (4880:61): [True: 3.96k, False: 51.2k]
  ------------------
 4881|  3.96k|                                 key.clear();
 4882|  3.96k|                                 ctx.anchors[std::string(anchor_name)] = {content, content, ctx.current_indent()};
 4883|  3.96k|                                 it = value_indicator;
 4884|  3.96k|                                 handled_anchor_only_empty_key = true;
 4885|  3.96k|                              }
 4886|  53.3k|                              else {
 4887|  53.3k|                                 if (value_indicator != end && *value_indicator == '#') {
  ------------------
  |  Branch (4887:38): [True: 51.2k, False: 2.08k]
  |  Branch (4887:64): [True: 1.76k, False: 49.5k]
  ------------------
 4888|  1.76k|                                    yaml::skip_comment(value_indicator, end);
 4889|  1.76k|                                 }
 4890|  53.3k|                                 if (value_indicator != end && (*value_indicator == '\n' || *value_indicator == '\r')) {
  ------------------
  |  Branch (4890:38): [True: 51.2k, False: 2.08k]
  |  Branch (4890:65): [True: 16.3k, False: 34.9k]
  |  Branch (4890:93): [True: 10.8k, False: 24.0k]
  ------------------
 4891|  27.2k|                                    yaml::skip_newline(value_indicator, end);
 4892|  27.2k|                                    auto value_line = value_indicator;
 4893|  27.2k|                                    int32_t value_indent = yaml::measure_indent(value_line, end, ctx);
 4894|  27.2k|                                    if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4894:41): [True: 2, False: 27.2k]
  ------------------
 4895|      2|                                       return false;
 4896|  27.2k|                                    if (value_line != end && *value_line == ':' &&
  ------------------
  |  Branch (4896:41): [True: 26.5k, False: 717]
  |  Branch (4896:62): [True: 4.41k, False: 22.1k]
  ------------------
 4897|  4.41k|                                        value_indent == explicit_value_indicator_indent) {
  ------------------
  |  Branch (4897:41): [True: 4.40k, False: 4]
  ------------------
 4898|  4.40k|                                       key.clear();
 4899|  4.40k|                                       ctx.anchors[std::string(anchor_name)] = {content, content, ctx.current_indent()};
 4900|  4.40k|                                       it = value_line;
 4901|  4.40k|                                       handled_anchor_only_empty_key = true;
 4902|  4.40k|                                    }
 4903|  22.8k|                                    else if (value_line != end && *value_line == ':') {
  ------------------
  |  Branch (4903:46): [True: 22.1k, False: 717]
  |  Branch (4903:67): [True: 4, False: 22.1k]
  ------------------
 4904|       |                                       // In explicit-key form ("? &a"), a following ':'
 4905|       |                                       // starts the outer value indicator only at the same
 4906|       |                                       // indentation. A deeper-indented ': value' is malformed.
 4907|      4|                                       ctx.error = error_code::syntax_error;
 4908|      4|                                       return false;
 4909|      4|                                    }
 4910|  27.2k|                                 }
 4911|  53.3k|                              }
 4912|  57.3k|                           }
 4913|  57.3k|                        }
 4914|       |
 4915|   189k|                        const bool key_content_spans_lines = [&] {
 4916|   189k|                           auto scan = key_it;
 4917|   189k|                           while (scan != content && scan != end) {
 4918|   189k|                              if (*scan == '\n' || *scan == '\r') return true;
 4919|   189k|                              ++scan;
 4920|   189k|                           }
 4921|   189k|                           return false;
 4922|   189k|                        }();
 4923|       |
 4924|   189k|                        if (handled_anchor_only_empty_key) {
  ------------------
  |  Branch (4924:29): [True: 8.37k, False: 181k]
  ------------------
 4925|       |                           // 'it' already points to the explicit value indicator ':'
 4926|  8.37k|                        }
 4927|   181k|                        else if (content == end || (*content == ':' && key_content_spans_lines)) {
  ------------------
  |  Branch (4927:34): [True: 3.06k, False: 178k]
  |  Branch (4927:53): [True: 3.91k, False: 174k]
  |  Branch (4927:72): [True: 1.59k, False: 2.31k]
  ------------------
 4928|  4.65k|                           key.clear();
 4929|  4.65k|                           it = content;
 4930|  4.65k|                        }
 4931|   176k|                        else {
 4932|       |                           // Explicit mapping keys ('? key-node') are full YAML nodes.
 4933|       |                           // Parse the key node structurally (not via plain-key scanning)
 4934|       |                           // so inputs like '? []: x' and '? JSON: like' are interpreted
 4935|       |                           // as complex keys, not split into implicit key/value pairs.
 4936|   176k|                           auto key_node_it = content;
 4937|   176k|                           auto key_node_end = end;
 4938|   176k|                           if constexpr (std::is_pointer_v<std::decay_t<It>>) {
 4939|       |                              // In explicit-key form, a following standalone ':'
 4940|       |                              // line (same or lower indentation) belongs to the
 4941|       |                              // outer mapping value, not the key node itself.
 4942|   176k|                              auto scan = content;
 4943|  2.81M|                              while (scan != end) {
  ------------------
  |  Branch (4943:38): [True: 2.78M, False: 30.4k]
  ------------------
 4944|   110M|                                 while (scan != end && *scan != '\n' && *scan != '\r') {
  ------------------
  |  Branch (4944:41): [True: 110M, False: 112k]
  |  Branch (4944:56): [True: 108M, False: 1.73M]
  |  Branch (4944:73): [True: 107M, False: 937k]
  ------------------
 4945|   107M|                                    ++scan;
 4946|   107M|                                 }
 4947|  2.78M|                                 if (scan == end) {
  ------------------
  |  Branch (4947:38): [True: 112k, False: 2.67M]
  ------------------
 4948|   112k|                                    break;
 4949|   112k|                                 }
 4950|       |
 4951|  2.67M|                                 yaml::skip_newline(scan, end);
 4952|  2.67M|                                 auto line_start = scan;
 4953|       |
 4954|  2.67M|                                 int32_t indicator_indent = 0;
 4955|  3.46M|                                 while (scan != end && *scan == ' ') {
  ------------------
  |  Branch (4955:41): [True: 3.43M, False: 30.4k]
  |  Branch (4955:56): [True: 790k, False: 2.64M]
  ------------------
 4956|   790k|                                    ++indicator_indent;
 4957|   790k|                                    ++scan;
 4958|   790k|                                 }
 4959|       |
 4960|  2.67M|                                 if (scan != end && *scan == ':') {
  ------------------
  |  Branch (4960:38): [True: 2.64M, False: 30.4k]
  |  Branch (4960:53): [True: 89.6k, False: 2.55M]
  ------------------
 4961|  89.6k|                                    const auto after_colon = scan + 1;
 4962|  89.6k|                                    if ((after_colon == end ||
  ------------------
  |  Branch (4962:42): [True: 1.34k, False: 88.3k]
  ------------------
 4963|  88.3k|                                         yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*after_colon)]) &&
  ------------------
  |  Branch (4963:42): [True: 56.9k, False: 31.4k]
  ------------------
 4964|  58.2k|                                        indicator_indent <= line_indent) {
  ------------------
  |  Branch (4964:41): [True: 33.4k, False: 24.8k]
  ------------------
 4965|  33.4k|                                       key_node_end = line_start;
 4966|  33.4k|                                       break;
 4967|  33.4k|                                    }
 4968|  89.6k|                                 }
 4969|  2.67M|                              }
 4970|   176k|                           }
 4971|       |
 4972|   176k|                           glz::generic key_node{};
 4973|   176k|                           const bool prev_explicit_mapping_key_context = ctx.explicit_mapping_key_context;
 4974|   176k|                           ctx.explicit_mapping_key_context = true;
 4975|   176k|                           from<YAML, glz::generic>::template op<Opts>(key_node, ctx, key_node_it, key_node_end);
 4976|   176k|                           ctx.explicit_mapping_key_context = prev_explicit_mapping_key_context;
 4977|   176k|                           if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4977:32): [True: 1.30k, False: 175k]
  ------------------
 4978|  1.30k|                              return false;
 4979|   175k|                           it = key_node_it;
 4980|   175k|                           if (!to_string_key(key_node)) [[unlikely]]
  ------------------
  |  Branch (4980:32): [True: 9, False: 175k]
  ------------------
 4981|      9|                              return false;
 4982|   175k|                        }
 4983|       |                     }
 4984|       |                     else {
 4985|       |                        if (it != end && !yaml::line_end_or_comment_table[static_cast<uint8_t>(*it)]) {
 4986|       |                           from<YAML, key_t>::template op<Opts>(key, ctx, it, end);
 4987|       |                           if (bool(ctx.error)) [[unlikely]]
 4988|       |                              return false;
 4989|       |                        }
 4990|       |                     }
 4991|       |
 4992|   188k|                     yaml::skip_inline_ws(it, end);
 4993|   189k|                     yaml::skip_comment(it, end);
 4994|       |
 4995|       |                     // Value indicator may appear on the next line at the same indent.
 4996|   189k|                     if (it != end && (*it == '\n' || *it == '\r')) {
  ------------------
  |  Branch (4996:26): [True: 157k, False: 31.8k]
  |  Branch (4996:40): [True: 12.7k, False: 144k]
  |  Branch (4996:55): [True: 21.2k, False: 123k]
  ------------------
 4997|  34.0k|                        auto probe = it;
 4998|  34.0k|                        bool found_value_indicator = false;
 4999|       |
 5000|  64.2k|                        while (probe != end && (*probe == '\n' || *probe == '\r')) {
  ------------------
  |  Branch (5000:32): [True: 55.7k, False: 8.42k]
  |  Branch (5000:49): [True: 21.9k, False: 33.8k]
  |  Branch (5000:67): [True: 33.8k, False: 0]
  ------------------
 5001|  55.7k|                           yaml::skip_newline(probe, end);
 5002|       |
 5003|  55.7k|                           auto value_line = probe;
 5004|  55.7k|                           int32_t value_indent = yaml::measure_indent(value_line, end, ctx);
 5005|  55.7k|                           if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (5005:32): [True: 7, False: 55.7k]
  ------------------
 5006|      7|                              return false;
 5007|       |
 5008|  55.7k|                           if (value_line == end || *value_line == '\n' || *value_line == '\r') {
  ------------------
  |  Branch (5008:32): [True: 7.90k, False: 47.8k]
  |  Branch (5008:53): [True: 5.40k, False: 42.4k]
  |  Branch (5008:76): [True: 9.95k, False: 32.5k]
  ------------------
 5009|  23.2k|                              probe = value_line;
 5010|  23.2k|                              continue; // blank line
 5011|  23.2k|                           }
 5012|  32.5k|                           if (*value_line == '#') {
  ------------------
  |  Branch (5012:32): [True: 6.90k, False: 25.6k]
  ------------------
 5013|  6.90k|                              yaml::skip_comment(value_line, end);
 5014|  6.90k|                              probe = value_line;
 5015|  6.90k|                              continue; // comment-only line
 5016|  6.90k|                           }
 5017|  25.6k|                           if (*value_line == ':' && value_indent == explicit_value_indicator_indent) {
  ------------------
  |  Branch (5017:32): [True: 7.66k, False: 17.9k]
  |  Branch (5017:54): [True: 2.99k, False: 4.67k]
  ------------------
 5018|  2.99k|                              it = value_line;
 5019|  2.99k|                              found_value_indicator = true;
 5020|  2.99k|                           }
 5021|  25.6k|                           break;
 5022|  32.5k|                        }
 5023|       |
 5024|  34.0k|                        if (found_value_indicator) {
  ------------------
  |  Branch (5024:29): [True: 2.99k, False: 31.0k]
  ------------------
 5025|  2.99k|                           yaml::skip_inline_ws(it, end);
 5026|  2.99k|                        }
 5027|  34.0k|                     }
 5028|       |
 5029|   189k|                     val_t val{};
 5030|   189k|                     if (it != end && *it == ':') {
  ------------------
  |  Branch (5030:26): [True: 157k, False: 31.8k]
  |  Branch (5030:39): [True: 52.4k, False: 105k]
  ------------------
 5031|  52.4k|                        ++it;
 5032|  52.4k|                        if (it != end && *it == '\t') {
  ------------------
  |  Branch (5032:29): [True: 50.8k, False: 1.61k]
  |  Branch (5032:42): [True: 13, False: 50.8k]
  ------------------
 5033|     13|                           ctx.error = error_code::syntax_error;
 5034|     13|                           return false;
 5035|     13|                        }
 5036|  52.4k|                        if (it != end && (*it == '\n' || *it == '\r')) {
  ------------------
  |  Branch (5036:29): [True: 50.8k, False: 1.61k]
  |  Branch (5036:43): [True: 5.10k, False: 45.7k]
  |  Branch (5036:58): [True: 6.21k, False: 39.5k]
  ------------------
 5037|  11.3k|                           auto probe = it;
 5038|  11.3k|                           yaml::skip_newline(probe, end);
 5039|  21.0k|                           while (probe != end && *probe == ' ') ++probe;
  ------------------
  |  Branch (5039:35): [True: 19.8k, False: 1.26k]
  |  Branch (5039:51): [True: 9.77k, False: 10.0k]
  ------------------
 5040|  11.3k|                           if (probe != end && *probe == ':' && ((probe + 1) != end) && *(probe + 1) == '\t') {
  ------------------
  |  Branch (5040:32): [True: 10.0k, False: 1.26k]
  |  Branch (5040:48): [True: 3.18k, False: 6.86k]
  |  Branch (5040:65): [True: 3.11k, False: 73]
  |  Branch (5040:89): [True: 1, False: 3.11k]
  ------------------
 5041|      1|                              ctx.error = error_code::syntax_error;
 5042|      1|                              return false;
 5043|      1|                           }
 5044|  11.3k|                        }
 5045|  52.4k|                        yaml::skip_inline_ws(it, end);
 5046|  52.4k|                        if (!parse_map_value(val)) [[unlikely]]
  ------------------
  |  Branch (5046:29): [True: 253, False: 52.1k]
  ------------------
 5047|    253|                           return false;
 5048|  52.4k|                     }
 5049|       |
 5050|   189k|                     value.emplace(std::move(key), std::move(val));
 5051|   189k|                     return true;
 5052|   189k|                  }
 5053|       |
 5054|   306k|                  key_t key{};
 5055|   306k|                  if constexpr (std::same_as<std::remove_cvref_t<key_t>, std::string>) {
 5056|   306k|                     auto key_probe = it;
 5057|   306k|                     yaml::skip_inline_ws(key_probe, end);
 5058|   306k|                     const bool complex_flow_key = (key_probe != end && (*key_probe == '[' || *key_probe == '{'));
  ------------------
  |  Branch (5058:53): [True: 306k, False: 0]
  |  Branch (5058:74): [True: 802, False: 305k]
  |  Branch (5058:95): [True: 867, False: 304k]
  ------------------
 5059|   306k|                     if (complex_flow_key) {
  ------------------
  |  Branch (5059:26): [True: 1.66k, False: 304k]
  ------------------
 5060|  1.66k|                        glz::generic key_node{};
 5061|  1.66k|                        from<YAML, glz::generic>::template op<yaml::flow_context_on<Opts>()>(key_node, ctx, it, end);
 5062|  1.66k|                        if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (5062:29): [True: 531, False: 1.13k]
  ------------------
 5063|    531|                           return false;
 5064|  1.13k|                        if (!yaml::materialize_key(key, key_node, ctx)) [[unlikely]]
  ------------------
  |  Branch (5064:29): [True: 0, False: 1.13k]
  ------------------
 5065|      0|                           return false;
 5066|  1.13k|                     }
 5067|   304k|                     else {
 5068|   304k|                        if (!yaml::parse_yaml_key(key, ctx, it, end, false)) {
  ------------------
  |  Branch (5068:29): [True: 139, False: 304k]
  ------------------
 5069|    139|                           return false;
 5070|    139|                        }
 5071|   304k|                     }
 5072|       |                  }
 5073|       |                  else {
 5074|       |                     from<YAML, key_t>::template op<Opts>(key, ctx, it, end);
 5075|       |                     if (bool(ctx.error)) [[unlikely]]
 5076|       |                        return false;
 5077|       |                  }
 5078|       |
 5079|   305k|                  yaml::skip_inline_ws(it, end);
 5080|       |
 5081|   306k|                  if (it == end || *it != ':') {
  ------------------
  |  Branch (5081:23): [True: 906, False: 305k]
  |  Branch (5081:36): [True: 218, False: 305k]
  ------------------
 5082|    454|                     ctx.error = error_code::syntax_error;
 5083|    454|                     return false;
 5084|    454|                  }
 5085|   305k|                  ++it;
 5086|   305k|                  yaml::skip_inline_ws(it, end);
 5087|       |
 5088|   305k|                  val_t val{};
 5089|   305k|                  if (!parse_map_value(val)) [[unlikely]]
  ------------------
  |  Branch (5089:23): [True: 4.77k, False: 300k]
  ------------------
 5090|  4.77k|                     return false;
 5091|       |
 5092|   300k|                  value.emplace(std::move(key), std::move(val));
 5093|   300k|                  return true;
 5094|   305k|               });
_ZZZN3glz4fromILj450ENS_17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES1_EEEEE2opITnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1ELb0ELb0ELb0ELb0ELj1EEERPKcRS5_TkNS_10is_contextERNS_4yaml12yaml_contextESA_EEvOT1_OT2_OT0_T3_ENKUlRT_RSK_SG_iE_clISE_SA_SA_EEbSO_SP_SG_iENKUlvE_clEv:
 4915|   189k|                        const bool key_content_spans_lines = [&] {
 4916|   189k|                           auto scan = key_it;
 4917|   209k|                           while (scan != content && scan != end) {
  ------------------
  |  Branch (4917:35): [True: 133k, False: 75.6k]
  |  Branch (4917:54): [True: 133k, False: 0]
  ------------------
 4918|   133k|                              if (*scan == '\n' || *scan == '\r') return true;
  ------------------
  |  Branch (4918:35): [True: 85.9k, False: 47.6k]
  |  Branch (4918:52): [True: 27.9k, False: 19.6k]
  ------------------
 4919|  19.6k|                              ++scan;
 4920|  19.6k|                           }
 4921|  75.6k|                           return false;
 4922|   189k|                        }();
_ZZZN3glz4fromILj450ENS_17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES1_EEEEE2opITnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1ELb0ELb0ELb0ELb0ELj1EEERPKcRS5_TkNS_10is_contextERNS_4yaml12yaml_contextESA_EEvOT1_OT2_OT0_T3_ENKUlRT_RSK_SG_iE_clISE_SA_SA_EEbSO_SP_SG_iENKUlRS4_E0_clESS_:
 4858|   175k|                        auto to_string_key = [&](glz::generic& key_node) {
 4859|   175k|                           return yaml::materialize_key(key, key_node, ctx);
 4860|   175k|                        };
_ZZZN3glz4fromILj450ENS_17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES1_EEEEE2opITnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1ELb0ELb0ELb0ELb0ELj1EEERPKcRS5_TkNS_10is_contextERNS_4yaml12yaml_contextESA_EEvOT1_OT2_OT0_T3_ENKUlRT_RSK_SG_iE_clISE_SA_SA_EEbSO_SP_SG_iENKUlRS4_E_clESS_:
 4778|   357k|                  auto parse_map_value = [&](val_t& val) -> bool {
 4779|   357k|                     if (it != end && !yaml::line_end_or_comment_table[static_cast<uint8_t>(*it)]) {
  ------------------
  |  Branch (4779:26): [True: 346k, False: 10.9k]
  |  Branch (4779:39): [True: 247k, False: 99.2k]
  ------------------
 4780|   247k|                        bool line_starts_with_explicit_value_indicator = false;
 4781|       |
 4782|       |                        // Inline mapping values in block context cannot start with a
 4783|       |                        // plain "key: value" pair on the same line (e.g. "a: b: c").
 4784|       |                        // Such constructs are malformed unless wrapped in flow
 4785|       |                        // delimiters ({...} / [...]) or quoted.
 4786|   247k|                        if constexpr (std::is_pointer_v<std::decay_t<decltype(it)>>) {
 4787|   247k|                           if (ctx.stream_begin) {
  ------------------
  |  Branch (4787:32): [True: 247k, False: 0]
  ------------------
 4788|   247k|                              auto is_line_content_start = [&](auto pos) {
 4789|   247k|                                 return !ctx.line_prefix_before(pos).has_content;
 4790|   247k|                              };
 4791|       |
 4792|   247k|                              auto line_has_explicit_value_indicator = [&](auto pos) {
 4793|   247k|                                 const char* line = ctx.line_begin_of(pos);
 4794|   247k|                                 while (line != end && (*line == ' ' || *line == '\t')) ++line;
 4795|   247k|                                 return line != end && *line == ':';
 4796|   247k|                              };
 4797|       |
 4798|   247k|                              if (!is_line_content_start(it) &&
  ------------------
  |  Branch (4798:35): [True: 247k, False: 0]
  ------------------
 4799|   247k|                                  yaml::inline_value_has_plain_mapping_indicator(it, end) &&
  ------------------
  |  Branch (4799:35): [True: 31.4k, False: 215k]
  ------------------
 4800|  31.4k|                                  !line_has_explicit_value_indicator(it)) {
  ------------------
  |  Branch (4800:35): [True: 422, False: 31.0k]
  ------------------
 4801|    422|                                 ctx.error = error_code::syntax_error;
 4802|    422|                                 return false;
 4803|    422|                              }
 4804|   246k|                              line_starts_with_explicit_value_indicator = line_has_explicit_value_indicator(it);
 4805|   246k|                           }
 4806|   247k|                        }
 4807|       |
 4808|   247k|                        if (*it == '-' &&
  ------------------
  |  Branch (4808:29): [True: 3.56k, False: 243k]
  ------------------
 4809|  3.56k|                            ((it + 1) == end || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*(it + 1))]) &&
  ------------------
  |  Branch (4809:30): [True: 364, False: 3.19k]
  |  Branch (4809:49): [True: 1.87k, False: 1.31k]
  ------------------
 4810|  2.24k|                            !line_starts_with_explicit_value_indicator) {
  ------------------
  |  Branch (4810:29): [True: 7, False: 2.23k]
  ------------------
 4811|       |                           // "key: - item" is not valid block sequence syntax.
 4812|      7|                           ctx.error = error_code::syntax_error;
 4813|      7|                           return false;
 4814|      7|                        }
 4815|       |
 4816|   247k|                        if (!ctx.push_indent(line_indent + 1)) [[unlikely]]
  ------------------
  |  Branch (4816:29): [True: 0, False: 247k]
  ------------------
 4817|      0|                           return false;
 4818|   247k|                        from<YAML, val_t>::template op<Opts>(val, ctx, it, end);
 4819|   247k|                        ctx.pop_indent();
 4820|   247k|                     }
 4821|   110k|                     else {
 4822|   110k|                        int32_t nested_indent = yaml::detect_nested_value_indent(ctx, it, end, line_indent);
 4823|   110k|                        if (nested_indent >= 0) {
  ------------------
  |  Branch (4823:29): [True: 43.8k, False: 66.3k]
  ------------------
 4824|  43.8k|                           yaml::skip_to_content(it, end);
 4825|  43.8k|                           if (it != end && *it == ':' && (it + 1) != end && *(it + 1) == '\t') {
  ------------------
  |  Branch (4825:32): [True: 43.8k, False: 0]
  |  Branch (4825:45): [True: 0, False: 43.8k]
  |  Branch (4825:59): [True: 0, False: 0]
  |  Branch (4825:78): [True: 0, False: 0]
  ------------------
 4826|      0|                              ctx.error = error_code::syntax_error;
 4827|      0|                              return false;
 4828|      0|                           }
 4829|       |                           // A struct value reads the pushed indent as its own key column;
 4830|       |                           // every other value type reads it as the enclosing baseline.
 4831|  43.8k|                           const int32_t value_indent =
 4832|  43.8k|                              yaml::receives_block_mapping_column<val_t>() ? nested_indent : nested_indent - 1;
  ------------------
  |  Branch (4832:31): [Folded, False: 43.8k]
  ------------------
 4833|  43.8k|                           if (!ctx.push_indent(value_indent)) [[unlikely]]
  ------------------
  |  Branch (4833:32): [True: 0, False: 43.8k]
  ------------------
 4834|      0|                              return false;
 4835|  43.8k|                           from<YAML, val_t>::template op<Opts>(val, ctx, it, end);
 4836|  43.8k|                           ctx.pop_indent();
 4837|  43.8k|                        }
 4838|   110k|                     }
 4839|   357k|                     return !bool(ctx.error);
 4840|   357k|                  };
_ZZZZN3glz4fromILj450ENS_17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES1_EEEEE2opITnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1ELb0ELb0ELb0ELb0ELj1EEERPKcRS5_TkNS_10is_contextERNS_4yaml12yaml_contextESA_EEvOT1_OT2_OT0_T3_ENKUlRT_RSK_SG_iE_clISE_SA_SA_EEbSO_SP_SG_iENKUlRS4_E_clESS_ENKUlSN_E_clISA_EEDaSN_:
 4788|   247k|                              auto is_line_content_start = [&](auto pos) {
 4789|   247k|                                 return !ctx.line_prefix_before(pos).has_content;
 4790|   247k|                              };
_ZZZZN3glz4fromILj450ENS_17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES1_EEEEE2opITnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1ELb0ELb0ELb0ELb0ELj1EEERPKcRS5_TkNS_10is_contextERNS_4yaml12yaml_contextESA_EEvOT1_OT2_OT0_T3_ENKUlRT_RSK_SG_iE_clISE_SA_SA_EEbSO_SP_SG_iENKUlRS4_E_clESS_ENKUlSN_E0_clISA_EEDaSN_:
 4792|   278k|                              auto line_has_explicit_value_indicator = [&](auto pos) {
 4793|   278k|                                 const char* line = ctx.line_begin_of(pos);
 4794|   459k|                                 while (line != end && (*line == ' ' || *line == '\t')) ++line;
  ------------------
  |  Branch (4794:41): [True: 459k, False: 0]
  |  Branch (4794:57): [True: 179k, False: 279k]
  |  Branch (4794:73): [True: 1.13k, False: 278k]
  ------------------
 4795|   278k|                                 return line != end && *line == ':';
  ------------------
  |  Branch (4795:41): [True: 278k, False: 0]
  |  Branch (4795:56): [True: 126k, False: 151k]
  ------------------
 4796|   278k|                              };
_ZN3glz4yaml26detect_nested_value_indentINS0_12yaml_contextEPKcS4_EEiRT_RT0_T1_i:
 3418|  1.45M|      {
 3419|  1.45M|         skip_ws_and_comment(it, end);
 3420|  1.45M|         if (it == end || (*it != '\n' && *it != '\r')) {
  ------------------
  |  Branch (3420:14): [True: 140k, False: 1.31M]
  |  Branch (3420:28): [True: 890k, False: 423k]
  |  Branch (3420:43): [True: 0, False: 890k]
  ------------------
 3421|   140k|            return -1;
 3422|   140k|         }
 3423|  1.31M|         skip_newline(it, end);
 3424|  1.31M|         auto content_start = it;
 3425|       |
 3426|       |         // Peek ahead to find the first content line (skip blank/comment lines)
 3427|  1.31M|         auto peek = it;
 3428|  1.79M|         while (peek != end) {
  ------------------
  |  Branch (3428:17): [True: 1.68M, False: 115k]
  ------------------
 3429|  1.68M|            if (*peek == '\n' || *peek == '\r') {
  ------------------
  |  Branch (3429:17): [True: 132k, False: 1.55M]
  |  Branch (3429:34): [True: 155k, False: 1.39M]
  ------------------
 3430|   288k|               skip_newline(peek, end);
 3431|   288k|            }
 3432|  1.39M|            else if (*peek == '#') {
  ------------------
  |  Branch (3432:22): [True: 45.3k, False: 1.35M]
  ------------------
 3433|  45.3k|               skip_comment(peek, end);
 3434|  45.3k|            }
 3435|  1.35M|            else if (*peek == ' ') {
  ------------------
  |  Branch (3435:22): [True: 1.01M, False: 334k]
  ------------------
 3436|  1.01M|               auto line_start = peek;
 3437|  2.73M|               while (peek != end && *peek == ' ') ++peek;
  ------------------
  |  Branch (3437:23): [True: 2.70M, False: 29.2k]
  |  Branch (3437:38): [True: 1.71M, False: 986k]
  ------------------
 3438|  1.01M|               if (peek == end || *peek == '\n' || *peek == '\r') {
  ------------------
  |  Branch (3438:20): [True: 29.2k, False: 986k]
  |  Branch (3438:35): [True: 10.3k, False: 976k]
  |  Branch (3438:52): [True: 15.0k, False: 961k]
  ------------------
 3439|  54.6k|                  continue; // blank line with trailing spaces
 3440|  54.6k|               }
 3441|   961k|               if (*peek == '#') {
  ------------------
  |  Branch (3441:20): [True: 55.7k, False: 905k]
  ------------------
 3442|  55.7k|                  skip_comment(peek, end);
 3443|  55.7k|                  continue; // comment-only line
 3444|  55.7k|               }
 3445|       |               // YAML allows node properties to appear on standalone lines before the
 3446|       |               // actual node value, for example:
 3447|       |               //   key:
 3448|       |               //     !tag
 3449|       |               //     &anchor
 3450|       |               //     actual: value
 3451|       |               // This loop recognizes chains of properties (`!tag`, `&anchor`, optional
 3452|       |               // inline spaces/comments) and treats those lines as non-content so they do
 3453|       |               // not incorrectly define nested indentation.
 3454|   905k|               {
 3455|   905k|                  auto prop = peek;
 3456|   905k|                  bool saw_property = false;
 3457|  1.00M|                  while (prop != end) {
  ------------------
  |  Branch (3457:26): [True: 1.00M, False: 532]
  ------------------
 3458|  1.00M|                     if (*prop == '!') {
  ------------------
  |  Branch (3458:26): [True: 17.0k, False: 983k]
  ------------------
 3459|  17.0k|                        const auto tag = parse_yaml_tag(prop, end, ctx);
 3460|  17.0k|                        if (tag == yaml_tag::unknown) break;
  ------------------
  |  Branch (3460:29): [True: 316, False: 16.7k]
  ------------------
 3461|  16.7k|                        saw_property = true;
 3462|  16.7k|                        skip_inline_ws(prop, end);
 3463|  16.7k|                        continue;
 3464|  17.0k|                     }
 3465|   983k|                     if (*prop == '&') {
  ------------------
  |  Branch (3465:26): [True: 80.2k, False: 903k]
  ------------------
 3466|  80.2k|                        ++prop;
 3467|  80.2k|                        auto aname = parse_anchor_name(prop, end);
 3468|  80.2k|                        if (aname.empty()) break;
  ------------------
  |  Branch (3468:29): [True: 1.13k, False: 79.0k]
  ------------------
 3469|  79.0k|                        saw_property = true;
 3470|  79.0k|                        skip_inline_ws(prop, end);
 3471|  79.0k|                        continue;
 3472|  80.2k|                     }
 3473|   903k|                     break;
 3474|   983k|                  }
 3475|   905k|                  if (saw_property) {
  ------------------
  |  Branch (3475:23): [True: 57.5k, False: 848k]
  ------------------
 3476|  57.5k|                     auto tail = prop;
 3477|  57.5k|                     skip_inline_ws(tail, end);
 3478|  57.5k|                     if (tail == end || *tail == '\n' || *tail == '\r' || *tail == '#') {
  ------------------
  |  Branch (3478:26): [True: 604, False: 56.9k]
  |  Branch (3478:41): [True: 25.2k, False: 31.6k]
  |  Branch (3478:58): [True: 13.5k, False: 18.1k]
  |  Branch (3478:75): [True: 3.21k, False: 14.9k]
  ------------------
 3479|  42.6k|                        if (tail != end && *tail == '#') {
  ------------------
  |  Branch (3479:29): [True: 42.0k, False: 604]
  |  Branch (3479:44): [True: 3.21k, False: 38.7k]
  ------------------
 3480|  3.21k|                           skip_comment(tail, end);
 3481|  3.21k|                        }
 3482|  42.6k|                        if (tail != end && (*tail == '\n' || *tail == '\r')) {
  ------------------
  |  Branch (3482:29): [True: 41.9k, False: 694]
  |  Branch (3482:45): [True: 25.8k, False: 16.1k]
  |  Branch (3482:62): [True: 16.1k, False: 0]
  ------------------
 3483|  41.9k|                           skip_newline(tail, end);
 3484|  41.9k|                        }
 3485|  42.6k|                        peek = tail;
 3486|  42.6k|                        continue;
 3487|  42.6k|                     }
 3488|  57.5k|                  }
 3489|   905k|               }
 3490|   862k|               peek = line_start; // content found, restore to measure properly
 3491|   862k|               break;
 3492|   905k|            }
 3493|   334k|            else {
 3494|   334k|               break; // content at column 0
 3495|   334k|            }
 3496|  1.68M|         }
 3497|       |
 3498|       |         // Measure indent of the content line
 3499|  1.31M|         int32_t content_indent = measure_indent<false>(peek, end, ctx);
 3500|  1.31M|         if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (3500:14): [True: 200, False: 1.31M]
  ------------------
 3501|    200|            return -1;
 3502|       |
 3503|       |         // Tabs in indentation-like positions are only allowed when they are plain
 3504|       |         // scalar content. Structural lines (mapping keys/entries) remain errors.
 3505|  1.31M|         if (peek != end && *peek == '\t') {
  ------------------
  |  Branch (3505:14): [True: 1.19M, False: 115k]
  |  Branch (3505:29): [True: 19.1k, False: 1.17M]
  ------------------
 3506|  19.1k|            auto probe = peek;
 3507|  86.6k|            while (probe != end && (*probe == ' ' || *probe == '\t')) ++probe;
  ------------------
  |  Branch (3507:20): [True: 86.4k, False: 226]
  |  Branch (3507:37): [True: 11.7k, False: 74.6k]
  |  Branch (3507:54): [True: 55.7k, False: 18.8k]
  ------------------
 3508|  19.1k|            if (probe != end && *probe != '\n' && *probe != '\r' && *probe != '#') {
  ------------------
  |  Branch (3508:17): [True: 18.8k, False: 226]
  |  Branch (3508:33): [True: 16.8k, False: 1.99k]
  |  Branch (3508:51): [True: 16.5k, False: 332]
  |  Branch (3508:69): [True: 15.9k, False: 638]
  ------------------
 3509|  15.9k|               const bool looks_sequence_entry =
 3510|  15.9k|                  (*probe == '-') &&
  ------------------
  |  Branch (3510:19): [True: 226, False: 15.6k]
  ------------------
 3511|    226|                  ((probe + 1) == end || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*(probe + 1))]);
  ------------------
  |  Branch (3511:20): [True: 2, False: 224]
  |  Branch (3511:42): [True: 4, False: 220]
  ------------------
 3512|  15.9k|               const bool looks_explicit_entry =
 3513|  15.9k|                  (*probe == '?' || *probe == ':') &&
  ------------------
  |  Branch (3513:20): [True: 322, False: 15.6k]
  |  Branch (3513:37): [True: 372, False: 15.2k]
  ------------------
 3514|    694|                  ((probe + 1) == end || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*(probe + 1))]);
  ------------------
  |  Branch (3514:20): [True: 24, False: 670]
  |  Branch (3514:42): [True: 16, False: 654]
  ------------------
 3515|  15.9k|               bool looks_mapping_key = false;
 3516|  15.9k|               auto scan = probe;
 3517|   244k|               while (scan != end && *scan != '\n' && *scan != '\r') {
  ------------------
  |  Branch (3517:23): [True: 242k, False: 2.09k]
  |  Branch (3517:38): [True: 240k, False: 2.40k]
  |  Branch (3517:55): [True: 229k, False: 11.2k]
  ------------------
 3518|   229k|                  if (*scan == ':') {
  ------------------
  |  Branch (3518:23): [True: 2.61k, False: 226k]
  ------------------
 3519|  2.61k|                     const auto after = scan + 1;
 3520|  2.61k|                     if (after == end || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*after)]) {
  ------------------
  |  Branch (3520:26): [True: 112, False: 2.50k]
  |  Branch (3520:42): [True: 50, False: 2.45k]
  ------------------
 3521|    162|                        looks_mapping_key = true;
 3522|    162|                        break;
 3523|    162|                     }
 3524|  2.61k|                  }
 3525|   228k|                  ++scan;
 3526|   228k|               }
 3527|  15.9k|               if (looks_sequence_entry || looks_explicit_entry || looks_mapping_key) {
  ------------------
  |  Branch (3527:20): [True: 6, False: 15.9k]
  |  Branch (3527:44): [True: 40, False: 15.8k]
  |  Branch (3527:68): [True: 128, False: 15.7k]
  ------------------
 3528|    174|                  ctx.error = error_code::syntax_error;
 3529|    174|                  return -1;
 3530|    174|               }
 3531|  15.9k|            }
 3532|  19.1k|         }
 3533|       |
 3534|  1.31M|         const int32_t effective_line_indent = (line_indent < 0) ? 0 : line_indent;
  ------------------
  |  Branch (3534:48): [True: 0, False: 1.31M]
  ------------------
 3535|  1.31M|         if (content_indent > effective_line_indent && peek != end && *peek != '\n' && *peek != '\r') {
  ------------------
  |  Branch (3535:14): [True: 429k, False: 883k]
  |  Branch (3535:56): [True: 429k, False: 0]
  |  Branch (3535:71): [True: 429k, False: 0]
  |  Branch (3535:88): [True: 429k, False: 0]
  ------------------
 3536|   429k|            it = content_start;
 3537|   429k|            return content_indent;
 3538|   429k|         }
 3539|       |
 3540|       |         // YAML allows "indentless sequences" as mapping values:
 3541|       |         // key:
 3542|       |         // - item
 3543|   883k|         if (content_indent == effective_line_indent && peek != end && *peek == '-') {
  ------------------
  |  Branch (3543:14): [True: 537k, False: 346k]
  |  Branch (3543:57): [True: 485k, False: 52.0k]
  |  Branch (3543:72): [True: 50.0k, False: 435k]
  ------------------
 3544|  50.0k|            const auto after_dash = peek + 1;
 3545|  50.0k|            if (after_dash == end || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*after_dash)]) {
  ------------------
  |  Branch (3545:17): [True: 102, False: 49.9k]
  |  Branch (3545:38): [True: 46.0k, False: 3.96k]
  ------------------
 3546|  46.1k|               it = content_start;
 3547|  46.1k|               return content_indent;
 3548|  46.1k|            }
 3549|  50.0k|         }
 3550|       |
 3551|   837k|         it = content_start;
 3552|   837k|         return -1;
 3553|   883k|      }
_ZZN3glz4fromILj450ENS_17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES1_EEEEE2opITnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1ELb0ELb0ELb0ELb0ELj1EEERPKcRS5_TkNS_10is_contextERNS_4yaml12yaml_contextESA_EEvOT1_OT2_OT0_T3_EN19merge_restore_guardD2Ev:
 4547|  1.21M|            {
 4548|       |               // emplace is a no-op for keys the document already wrote, so only
 4549|       |               // untouched pre-existing entries are put back.
 4550|  1.21M|               for (auto& entry : saved) {
  ------------------
  |  Branch (4550:33): [True: 0, False: 1.21M]
  ------------------
 4551|      0|                  target.emplace(entry.first, std::move(entry.second));
 4552|      0|               }
 4553|  1.21M|            }
_ZN3glz33process_yaml_variant_alternativesINSt3__17variantIJDndNS1_12basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEbNS1_6vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS6_ISD_EEEENSC_ISD_EEEEENS_21is_yaml_variant_arrayEE2opITnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1ELb0ELb0ELb0ELb0ELj1EEERSH_TkNS_10is_contextERNS_4yaml12yaml_contextERPKcSR_EEvOT0_OT1_OT2_T3_:
 5205|   413k|      {
 5206|   413k|         constexpr auto category_count = yaml_variant_count_v<Variant, Trait>;
 5207|       |
 5208|       |         if constexpr (category_count == 0) {
 5209|       |            ctx.error = error_code::no_matching_variant_type;
 5210|       |         }
 5211|   413k|         else if constexpr (category_count == 1) {
 5212|       |            // Only one type in this category, use it directly
 5213|   413k|            constexpr auto first_idx = yaml_variant_first_index_v<Variant, Trait>;
 5214|   413k|            using V = std::variant_alternative_t<first_idx, Variant>;
 5215|   413k|            if (!std::holds_alternative<V>(value)) value = V{};
  ------------------
  |  Branch (5215:17): [True: 413k, False: 0]
  ------------------
 5216|   413k|            from<YAML, V>::template op<Opts>(std::get<V>(value), ctx, it, end);
 5217|       |         }
 5218|       |         else {
 5219|       |            // Multiple types in this category, try each one
 5220|       |            constexpr auto N = std::variant_size_v<Variant>;
 5221|       |            bool found_match{};
 5222|       |            size_t match_idx = 0;
 5223|       |            // Only the last alternative propagates its error, so an alternative that exhausted an
 5224|       |            // expansion budget would otherwise be reported as no_matching_variant_type -- a wrong
 5225|       |            // diagnosis for a document that is hostile rather than merely the wrong shape. Held
 5226|       |            // aside and used only if nothing matched, so an alternative that does succeed later
 5227|       |            // (one that materializes no key text can still parse under a latched budget) is
 5228|       |            // unaffected.
 5229|       |            error_code expansion_error{};
 5230|       |            std::string_view expansion_message{};
 5231|       |
 5232|       |            for_each<N>([&]<size_t I>() {
 5233|       |               if (found_match) {
 5234|       |                  return;
 5235|       |               }
 5236|       |               using V = std::variant_alternative_t<I, Variant>;
 5237|       |               if constexpr (Trait<V>::value) {
 5238|       |                  auto copy_it = it;
 5239|       |                  if (!std::holds_alternative<V>(value)) {
 5240|       |                     value = V{};
 5241|       |                  }
 5242|       |
 5243|       |                  auto temp_ctx = ctx.make_speculative();
 5244|       |                  from<YAML, V>::template op<Opts>(std::get<V>(value), temp_ctx, it, end);
 5245|       |
 5246|       |                  // Charged whether or not the alternative fit: a rejected probe still replayed
 5247|       |                  // whatever aliases it reached, and an attempt that is never billed is an
 5248|       |                  // attempt that can be repeated for free.
 5249|       |                  ctx.alias_expansion_budget = temp_ctx.alias_expansion_budget;
 5250|       |                  ctx.key_expansion_budget = temp_ctx.key_expansion_budget;
 5251|       |
 5252|       |                  if (!bool(temp_ctx.error)) {
 5253|       |                     found_match = true;
 5254|       |                     ctx.anchors = std::move(temp_ctx.anchors);
 5255|       |                  }
 5256|       |                  else {
 5257|       |                     it = copy_it;
 5258|       |                     if (temp_ctx.error == error_code::exceeded_max_expansion && expansion_error == error_code::none) {
 5259|       |                        expansion_error = temp_ctx.error;
 5260|       |                        expansion_message = temp_ctx.custom_error_message;
 5261|       |                     }
 5262|       |                     if (match_idx + 1 < category_count) {
 5263|       |                        // Not the last type, continue trying
 5264|       |                     }
 5265|       |                     else {
 5266|       |                        // Last type failed, propagate error
 5267|       |                        ctx.error = temp_ctx.error;
 5268|       |                        ctx.custom_error_message = temp_ctx.custom_error_message;
 5269|       |                     }
 5270|       |                  }
 5271|       |                  ++match_idx;
 5272|       |               }
 5273|       |            });
 5274|       |
 5275|       |            if (!found_match && !bool(ctx.error)) {
 5276|       |               if (expansion_error != error_code::none) {
 5277|       |                  ctx.error = expansion_error;
 5278|       |                  ctx.custom_error_message = expansion_message;
 5279|       |               }
 5280|       |               else {
 5281|       |                  ctx.error = error_code::no_matching_variant_type;
 5282|       |               }
 5283|       |            }
 5284|       |         }
 5285|   413k|      }
_ZN3glz4fromILj450ENSt3__16vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS1_9allocatorIS6_EEEEE2opITnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1ELb0ELb0ELb0ELb0ELj1EEERPKcRS9_TkNS_10is_contextERNS_4yaml12yaml_contextESE_EEvOT1_OT2_OT0_T3_:
 4098|   428k|      {
 4099|   428k|         if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4099:14): [True: 0, False: 428k]
  ------------------
 4100|      0|            return;
 4101|       |
 4102|       |         // Peek ahead to check for tag (don't consume indentation for block sequences)
 4103|   428k|         auto peek = it;
 4104|   428k|         yaml::node_preamble_state preamble{};
 4105|   428k|         if (yaml::parse_node_preamble<Opts>(value, ctx, peek, end, preamble,
  ------------------
  |  Branch (4105:14): [True: 16.3k, False: 412k]
  ------------------
 4106|   428k|                                             [](yaml::yaml_tag tag) { return yaml::tag_valid_for_seq(tag); })) {
 4107|  16.3k|            it = peek;
 4108|  16.3k|            return;
 4109|  16.3k|         }
 4110|       |
 4111|   412k|         if (*peek == '[') {
  ------------------
  |  Branch (4111:14): [True: 57.5k, False: 355k]
  ------------------
 4112|       |            // Flow sequence - consume whitespace and parse
 4113|  57.5k|            it = peek;
 4114|  57.5k|            yaml::parse_flow_sequence<Opts>(value, ctx, it, end);
 4115|  57.5k|         }
 4116|   355k|         else if (*peek == '-') {
  ------------------
  |  Branch (4116:19): [True: 354k, False: 77]
  ------------------
 4117|       |            // Block sequence - don't consume leading whitespace, let parse_block_sequence handle it
 4118|       |            // But if there was a tag, we need to advance past it
 4119|   354k|            if (preamble.tag != yaml::yaml_tag::none || preamble.node_props.has_anchor) {
  ------------------
  |  Branch (4119:17): [True: 2.83k, False: 352k]
  |  Branch (4119:57): [True: 2.53k, False: 349k]
  ------------------
 4120|  5.37k|               it = peek;
 4121|  5.37k|            }
 4122|   354k|            int32_t seq_indent = ctx.current_indent();
 4123|   354k|            if (*it == '-' && ctx.current_indent() >= 0) {
  ------------------
  |  Branch (4123:17): [True: 354k, False: 443]
  |  Branch (4123:31): [True: 64.0k, False: 290k]
  ------------------
 4124|  64.0k|               seq_indent = ctx.allow_indentless_sequence ? (ctx.current_indent() > 0 ? (ctx.current_indent() - 1) : 0)
  ------------------
  |  Branch (4124:29): [True: 9.37k, False: 54.6k]
  |  Branch (4124:62): [True: 6.66k, False: 2.71k]
  ------------------
 4125|  64.0k|                                                          : (ctx.current_indent() + 1);
 4126|  64.0k|            }
 4127|   354k|            yaml::parse_block_sequence<Opts>(value, ctx, it, end, seq_indent);
 4128|   354k|         }
 4129|     77|         else {
 4130|     77|            ctx.error = error_code::syntax_error;
 4131|     77|         }
 4132|       |
 4133|   412k|         yaml::finalize_node_anchor(preamble.node_props, ctx, it);
 4134|   412k|      }
_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|   428k|      {
  466|   428k|         skip_inline_ws(it, end);
  467|       |
  468|   428k|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (468:14): [True: 7, False: 428k]
  ------------------
  469|      7|            if constexpr (!AllowEmptyInput) {
  470|      7|               ctx.error = error_code::unexpected_end;
  471|      7|            }
  472|      7|            return true;
  473|      7|         }
  474|       |
  475|   428k|         preamble.tag = parse_yaml_tag(it, end, ctx);
  476|   428k|         if (preamble.tag == yaml_tag::unknown) [[unlikely]] {
  ------------------
  |  Branch (476:14): [True: 2, False: 428k]
  ------------------
  477|      2|            ctx.error = error_code::syntax_error;
  478|      2|            return true;
  479|      2|         }
  480|   428k|         if (!tag_validator(preamble.tag)) [[unlikely]] {
  ------------------
  |  Branch (480:14): [True: 1, False: 428k]
  ------------------
  481|      1|            ctx.error = error_code::syntax_error;
  482|      1|            return true;
  483|      1|         }
  484|       |
  485|   428k|         skip_inline_ws(it, end);
  486|       |
  487|   428k|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (487:14): [True: 2, False: 428k]
  ------------------
  488|      2|            if constexpr (!AllowEmptyInput) {
  489|      2|               ctx.error = error_code::unexpected_end;
  490|      2|            }
  491|      2|            return true;
  492|      2|         }
  493|       |
  494|   428k|         if (parse_node_properties<Opts, PropertyPolicy>(std::forward<T>(value), ctx, it, end, preamble.node_props)) {
  ------------------
  |  Branch (494:14): [True: 16.3k, False: 412k]
  ------------------
  495|  16.3k|            return true;
  496|  16.3k|         }
  497|       |
  498|   412k|         return false;
  499|   428k|      }
_ZZN3glz4fromILj450ENSt3__16vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS1_9allocatorIS6_EEEEE2opITnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1ELb0ELb0ELb0ELb0ELj1EEERPKcRS9_TkNS_10is_contextERNS_4yaml12yaml_contextESE_EEvOT1_OT2_OT0_T3_ENKUlNSH_8yaml_tagEE_clESR_:
 4106|   428k|                                             [](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|   428k|      {
  409|   428k|         state.has_anchor = false;
  410|   428k|         state.anchor_name.clear();
  411|   428k|         state.anchor_start = nullptr;
  412|   428k|         state.anchor_indent = ctx.current_indent();
  413|       |
  414|   428k|         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|   428k|            else {
  421|   428k|               if (handle_alias<Opts>(std::forward<T>(value), ctx, it, end)) return true;
  ------------------
  |  Branch (421:20): [True: 16.3k, False: 412k]
  ------------------
  422|   428k|            }
  423|   428k|         }
  424|       |
  425|   428k|         if (it != end && *it == '&') {
  ------------------
  |  Branch (425:14): [True: 412k, False: 16.3k]
  |  Branch (425:27): [True: 3.23k, False: 409k]
  ------------------
  426|  3.23k|            ++it;
  427|  3.23k|            auto name = parse_anchor_name(it, end);
  428|  3.23k|            if (name.empty()) {
  ------------------
  |  Branch (428:17): [True: 7, False: 3.23k]
  ------------------
  429|      7|               ctx.error = error_code::syntax_error;
  430|      7|               return true;
  431|      7|            }
  432|  3.23k|            skip_inline_ws(it, end);
  433|  3.23k|            if (it == end) {
  ------------------
  |  Branch (433:17): [True: 30, False: 3.20k]
  ------------------
  434|     30|               if constexpr (!Policy.allow_empty_after_anchor) {
  435|     30|                  ctx.error = error_code::unexpected_end;
  436|     30|               }
  437|     30|               return true;
  438|     30|            }
  439|       |            if constexpr (Policy.disallow_anchor_on_alias) {
  440|       |               if (*it == '*') {
  441|       |                  ctx.error = error_code::syntax_error;
  442|       |                  return true;
  443|       |               }
  444|       |            }
  445|  3.20k|            state.has_anchor = true;
  446|  3.20k|            state.anchor_name = std::string(name);
  447|  3.20k|            state.anchor_start = &*it;
  448|  3.20k|         }
  449|       |
  450|   428k|         return false;
  451|   428k|      }
_ZN3glz4yaml12handle_aliasITnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1ELb0ELb0ELb0ELb0ELj1EEERNSt3__16vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS3_9allocatorIS8_EEEENS0_12yaml_contextEPKcSF_EEbOT0_RT1_RT2_T3_:
  300|   428k|      {
  301|   428k|         if (it == end || *it != '*') return false;
  ------------------
  |  Branch (301:14): [True: 0, False: 428k]
  |  Branch (301:27): [True: 412k, False: 16.3k]
  ------------------
  302|       |
  303|  16.3k|         ++it; // skip '*'
  304|  16.3k|         auto name = parse_anchor_name(it, end);
  305|  16.3k|         if (name.empty()) {
  ------------------
  |  Branch (305:14): [True: 3, False: 16.3k]
  ------------------
  306|      3|            ctx.error = error_code::syntax_error;
  307|      3|            return true;
  308|      3|         }
  309|       |
  310|  16.3k|         auto anchor_it = ctx.anchors.find(name);
  311|  16.3k|         if (anchor_it == ctx.anchors.end()) {
  ------------------
  |  Branch (311:14): [True: 20, False: 16.3k]
  ------------------
  312|     20|            ctx.error = error_code::syntax_error; // undefined alias
  313|     20|            return true;
  314|     20|         }
  315|       |
  316|       |         // Copied rather than referenced: the replay below can replace ctx.anchors wholesale
  317|       |         // (a speculative parse hands its own map back), which would dangle a reference here.
  318|  16.3k|         const auto span = anchor_it->second;
  319|       |
  320|       |         // Empty anchor span (anchor on null/empty node) — leave value as default
  321|  16.3k|         if (span.begin == span.end) {
  ------------------
  |  Branch (321:14): [True: 1.07k, False: 15.2k]
  ------------------
  322|  1.07k|            return true;
  323|  1.07k|         }
  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.2k|         if (ctx.alias_span_is_replaying(span.begin, span.end)) [[unlikely]] {
  ------------------
  |  Branch (328:14): [True: 6, False: 15.2k]
  ------------------
  329|      6|            ctx.error = error_code::syntax_error; // cyclic alias
  330|      6|            return true;
  331|      6|         }
  332|       |
  333|       |         // Replaying an anchor re-enters the reader directly, bypassing the variant reader's
  334|       |         // depth guard, so this is the only depth accounting a chain of aliases into a
  335|       |         // non-variant target gets. The cycle check above stops the unbounded case; this bounds
  336|       |         // a legitimate but deeply chained one.
  337|  15.2k|         depth_guard guard{ctx, yaml::max_yaml_recursive_depth};
  338|  15.2k|         if (!guard) [[unlikely]]
  ------------------
  |  Branch (338:14): [True: 1, False: 15.2k]
  ------------------
  339|      1|            return true;
  340|       |
  341|  15.2k|         if (!ctx.charge_alias_expansion(static_cast<size_t>(span.end - span.begin))) [[unlikely]] {
  ------------------
  |  Branch (341:14): [True: 1, False: 15.2k]
  ------------------
  342|      1|            ctx.error = error_code::exceeded_max_expansion;
  343|      1|            ctx.custom_error_message = "alias expansion";
  344|      1|            return true;
  345|      1|         }
  346|       |
  347|  15.2k|         auto replay_it = span.begin;
  348|  15.2k|         auto replay_end = span.end;
  349|       |
  350|       |         // Save indent context and set up for replay
  351|  15.2k|         auto saved_indent_stack = std::move(ctx.indent_stack);
  352|  15.2k|         ctx.indent_stack.clear();
  353|  15.2k|         if (span.base_indent > 0) {
  ------------------
  |  Branch (353:14): [True: 1.67k, False: 13.5k]
  ------------------
  354|  1.67k|            ctx.push_indent(span.base_indent - 1);
  355|  1.67k|         }
  356|       |
  357|  15.2k|         ctx.active_alias_spans.emplace_back(span.begin, span.end);
  358|       |
  359|  15.2k|         using V = std::remove_cvref_t<T>;
  360|  15.2k|         from<YAML, V>::template op<Opts>(std::forward<T>(value), ctx, replay_it, replay_end);
  361|       |
  362|  15.2k|         ctx.active_alias_spans.pop_back();
  363|       |
  364|       |         // Restore indent context
  365|  15.2k|         ctx.indent_stack = std::move(saved_indent_stack);
  366|  15.2k|         return true;
  367|  15.2k|      }
_ZN3glz4yaml19parse_flow_sequenceITnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1ELb0ELb0ELb0ELb0ELj1EEERNSt3__16vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS3_9allocatorIS8_EEEENS0_12yaml_contextEPKcSF_EEvOT0_RT1_RT2_T3_:
 2596|  57.5k|      {
 2597|  57.5k|         using V = std::remove_cvref_t<T>;
 2598|  57.5k|         using value_type = typename V::value_type;
 2599|       |
 2600|  57.5k|         struct sequence_container_adapter
 2601|  57.5k|         {
 2602|  57.5k|            size_t index = 0;
 2603|       |
 2604|  57.5k|            inline bool fixed_capacity_reached(const V& container) const noexcept
 2605|  57.5k|            {
 2606|  57.5k|               if constexpr (!resizable<V>) {
 2607|  57.5k|                  return index >= container.size();
 2608|  57.5k|               }
 2609|  57.5k|               else {
 2610|  57.5k|                  (void)container;
 2611|  57.5k|                  return false;
 2612|  57.5k|               }
 2613|  57.5k|            }
 2614|       |
 2615|  57.5k|            inline void commit_fixed_slot() noexcept { ++index; }
 2616|       |
 2617|  57.5k|            inline void append(V& container, value_type&& element) noexcept
 2618|  57.5k|            {
 2619|  57.5k|               if constexpr (emplace_backable<V>) {
 2620|  57.5k|                  container.emplace_back(std::move(element));
 2621|  57.5k|               }
 2622|  57.5k|               else if constexpr (emplaceable<V>) {
 2623|  57.5k|                  container.emplace(std::move(element));
 2624|  57.5k|               }
 2625|  57.5k|            }
 2626|  57.5k|         };
 2627|       |
 2628|  57.5k|         if (it == end || *it != '[') [[unlikely]] {
  ------------------
  |  Branch (2628:14): [True: 0, False: 57.5k]
  |  Branch (2628:27): [True: 0, False: 57.5k]
  ------------------
 2629|      0|            ctx.error = error_code::syntax_error;
 2630|      0|            return;
 2631|      0|         }
 2632|       |
 2633|       |         // Overwrite (do not append to) any pre-existing contents. Must happen
 2634|       |         // before the empty-array early return below so that `[]` also clears.
 2635|  57.5k|         clear_sequence_before_read<Opts>(value);
 2636|       |
 2637|  57.5k|         ++it; // Skip '['
 2638|       |         // Skip whitespace and newlines after opening bracket (YAML allows multi-line flow sequences)
 2639|  57.5k|         skip_flow_ws_and_newlines(ctx, it, end);
 2640|  57.5k|         if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2640:14): [True: 4, False: 57.5k]
  ------------------
 2641|      4|            return;
 2642|       |
 2643|       |         // Handle empty array
 2644|  57.5k|         if (it != end && *it == ']') {
  ------------------
  |  Branch (2644:14): [True: 57.0k, False: 495]
  |  Branch (2644:27): [True: 10.2k, False: 46.7k]
  ------------------
 2645|  10.2k|            ++it;
 2646|  10.2k|            validate_flow_node_adjacent_tail(ctx, it, end);
 2647|  10.2k|            if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2647:17): [True: 5, False: 10.2k]
  ------------------
 2648|      5|               return;
 2649|       |            if constexpr (!yaml::check_flow_context(Opts)) {
 2650|       |               if (ctx.current_indent() < 0) {
 2651|       |                  validate_root_flow_tail_after_close(ctx, it, end);
 2652|       |               }
 2653|       |            }
 2654|  10.2k|            return;
 2655|  10.2k|         }
 2656|       |
 2657|  47.2k|         bool just_saw_comma = false;
 2658|  47.2k|         sequence_container_adapter adapter{};
 2659|       |
 2660|  47.2k|         if constexpr (emplace_backable<V> || emplaceable<V>) {
 2661|       |            // Dynamic containers append items (vector-like and set-like)
 2662|  86.8k|            while (it != end) {
  ------------------
  |  Branch (2662:20): [True: 85.8k, False: 943]
  ------------------
 2663|  85.8k|               skip_flow_ws_and_newlines(ctx, it, end);
 2664|  85.8k|               if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2664:20): [True: 0, False: 85.8k]
  ------------------
 2665|      0|                  return;
 2666|       |
 2667|  85.8k|               if (it == end) [[unlikely]] {
  ------------------
  |  Branch (2667:20): [True: 0, False: 85.8k]
  ------------------
 2668|      0|                  ctx.error = error_code::unexpected_end;
 2669|      0|                  return;
 2670|      0|               }
 2671|       |
 2672|  85.8k|               if (*it == ']') {
  ------------------
  |  Branch (2672:20): [True: 6.27k, False: 79.5k]
  ------------------
 2673|  6.27k|                  if (just_saw_comma) {
  ------------------
  |  Branch (2673:23): [True: 6.27k, False: 0]
  ------------------
 2674|  6.27k|                     ++it;
 2675|  6.27k|                     validate_flow_node_adjacent_tail(ctx, it, end);
 2676|  6.27k|                     if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2676:26): [True: 4, False: 6.26k]
  ------------------
 2677|      4|                        return;
 2678|       |                     if constexpr (!yaml::check_flow_context(Opts)) {
 2679|       |                        if (ctx.current_indent() < 0) {
 2680|       |                           validate_root_flow_tail_after_close(ctx, it, end);
 2681|       |                        }
 2682|       |                     }
 2683|  6.26k|                     return;
 2684|  6.27k|                  }
 2685|      0|                  ctx.error = error_code::syntax_error;
 2686|      0|                  return;
 2687|  6.27k|               }
 2688|       |
 2689|  79.5k|               if (*it == ',' || *it == '#') {
  ------------------
  |  Branch (2689:20): [True: 174, False: 79.4k]
  |  Branch (2689:34): [True: 9, False: 79.4k]
  ------------------
 2690|    183|                  ctx.error = error_code::syntax_error;
 2691|    183|                  return;
 2692|    183|               }
 2693|  79.4k|               just_saw_comma = false;
 2694|       |
 2695|  79.4k|               value_type element{};
 2696|  79.4k|               from<YAML, value_type>::template op<flow_context_on<Opts>()>(element, ctx, it, end);
 2697|       |
 2698|  79.4k|               if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2698:20): [True: 8.90k, False: 70.5k]
  ------------------
 2699|  8.90k|                  return;
 2700|       |
 2701|  70.5k|               bool saw_line_break_before_separator = false;
 2702|  70.5k|               skip_flow_ws_and_newlines(ctx, it, end, &saw_line_break_before_separator);
 2703|  70.5k|               if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2703:20): [True: 12, False: 70.4k]
  ------------------
 2704|     12|                  return;
 2705|       |
 2706|  70.4k|               if (it != end && *it == ':') {
  ------------------
  |  Branch (2706:20): [True: 69.0k, False: 1.42k]
  |  Branch (2706:33): [True: 10.7k, False: 58.3k]
  ------------------
 2707|       |                  // In flow sequences, implicit key-value pairs must be on a single line.
 2708|  10.7k|                  if (saw_line_break_before_separator) {
  ------------------
  |  Branch (2708:23): [True: 26, False: 10.6k]
  ------------------
 2709|     26|                     ctx.error = error_code::syntax_error;
 2710|     26|                     return;
 2711|     26|                  }
 2712|  10.6k|                  if constexpr (std::same_as<std::remove_cvref_t<value_type>, glz::generic>) {
 2713|  10.6k|                     glz::generic key_node = std::move(element);
 2714|  10.6k|                     ++it;
 2715|  10.6k|                     skip_inline_ws(it, end);
 2716|       |
 2717|  10.6k|                     glz::generic mapped{};
 2718|  10.6k|                     from<YAML, glz::generic>::template op<flow_context_on<Opts>()>(mapped, ctx, it, end);
 2719|  10.6k|                     if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2719:26): [True: 565, False: 10.1k]
  ------------------
 2720|    565|                        return;
 2721|       |
 2722|  10.1k|                     std::string key;
 2723|  10.1k|                     if (!yaml::materialize_key(key, key_node, ctx)) [[unlikely]]
  ------------------
  |  Branch (2723:26): [True: 8, False: 10.1k]
  ------------------
 2724|      8|                        return;
 2725|       |
 2726|  10.1k|                     glz::generic pair{};
 2727|  10.1k|                     pair[key] = std::move(mapped);
 2728|  10.1k|                     element = std::move(pair);
 2729|       |
 2730|  10.1k|                     skip_flow_ws_and_newlines(ctx, it, end);
 2731|  10.1k|                     if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2731:26): [True: 2, False: 10.1k]
  ------------------
 2732|      2|                        return;
 2733|       |                  }
 2734|       |                  else {
 2735|       |                     ctx.error = error_code::syntax_error;
 2736|       |                     return;
 2737|       |                  }
 2738|  10.6k|               }
 2739|       |
 2740|  70.4k|               adapter.append(value, std::move(element));
 2741|       |
 2742|  70.4k|               if (it == end) [[unlikely]] {
  ------------------
  |  Branch (2742:20): [True: 1.49k, False: 68.9k]
  ------------------
 2743|  1.49k|                  ctx.error = error_code::unexpected_end;
 2744|  1.49k|                  return;
 2745|  1.49k|               }
 2746|       |
 2747|  68.9k|               if (*it == ']') {
  ------------------
  |  Branch (2747:20): [True: 28.2k, False: 40.7k]
  ------------------
 2748|  28.2k|                  ++it;
 2749|  28.2k|                  validate_flow_node_adjacent_tail(ctx, it, end);
 2750|  28.2k|                  if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2750:23): [True: 36, False: 28.1k]
  ------------------
 2751|     36|                     return;
 2752|       |                  if constexpr (!yaml::check_flow_context(Opts)) {
 2753|       |                     if (ctx.current_indent() < 0) {
 2754|       |                        validate_root_flow_tail_after_close(ctx, it, end);
 2755|       |                     }
 2756|       |                  }
 2757|  28.1k|                  return;
 2758|  28.2k|               }
 2759|  40.7k|               else if (*it == ',') {
  ------------------
  |  Branch (2759:25): [True: 39.5k, False: 1.20k]
  ------------------
 2760|  39.5k|                  ++it;
 2761|  39.5k|                  just_saw_comma = true;
 2762|  39.5k|                  skip_flow_ws_and_newlines(ctx, it, end);
 2763|  39.5k|                  if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2763:23): [True: 13, False: 39.5k]
  ------------------
 2764|     13|                     return;
 2765|  39.5k|               }
 2766|  1.20k|               else {
 2767|  1.20k|                  ctx.error = error_code::syntax_error;
 2768|  1.20k|                  return;
 2769|  1.20k|               }
 2770|  68.9k|            }
 2771|       |         }
 2772|       |         else if constexpr (!resizable<V>) {
 2773|       |            // Fixed-size containers (std::array)
 2774|       |            while (it != end && !adapter.fixed_capacity_reached(value)) {
 2775|       |               skip_flow_ws_and_newlines(ctx, it, end);
 2776|       |               if (bool(ctx.error)) [[unlikely]]
 2777|       |                  return;
 2778|       |
 2779|       |               if (it == end) [[unlikely]] {
 2780|       |                  ctx.error = error_code::unexpected_end;
 2781|       |                  return;
 2782|       |               }
 2783|       |
 2784|       |               if (*it == ']') {
 2785|       |                  if (just_saw_comma) {
 2786|       |                     ++it;
 2787|       |                     validate_flow_node_adjacent_tail(ctx, it, end);
 2788|       |                     if (bool(ctx.error)) [[unlikely]]
 2789|       |                        return;
 2790|       |                     if constexpr (!yaml::check_flow_context(Opts)) {
 2791|       |                        if (ctx.current_indent() < 0) {
 2792|       |                           validate_root_flow_tail_after_close(ctx, it, end);
 2793|       |                        }
 2794|       |                     }
 2795|       |                     return;
 2796|       |                  }
 2797|       |                  ctx.error = error_code::syntax_error;
 2798|       |                  return;
 2799|       |               }
 2800|       |
 2801|       |               if (*it == ',' || *it == '#') {
 2802|       |                  ctx.error = error_code::syntax_error;
 2803|       |                  return;
 2804|       |               }
 2805|       |               just_saw_comma = false;
 2806|       |
 2807|       |               from<YAML, value_type>::template op<flow_context_on<Opts>()>(value[adapter.index], ctx, it, end);
 2808|       |
 2809|       |               if (bool(ctx.error)) [[unlikely]]
 2810|       |                  return;
 2811|       |
 2812|       |               adapter.commit_fixed_slot();
 2813|       |               skip_flow_ws_and_newlines(ctx, it, end);
 2814|       |               if (bool(ctx.error)) [[unlikely]]
 2815|       |                  return;
 2816|       |
 2817|       |               if (it == end) [[unlikely]] {
 2818|       |                  ctx.error = error_code::unexpected_end;
 2819|       |                  return;
 2820|       |               }
 2821|       |
 2822|       |               if (*it == ']') {
 2823|       |                  ++it;
 2824|       |                  validate_flow_node_adjacent_tail(ctx, it, end);
 2825|       |                  if (bool(ctx.error)) [[unlikely]]
 2826|       |                     return;
 2827|       |                  if constexpr (!yaml::check_flow_context(Opts)) {
 2828|       |                     if (ctx.current_indent() < 0) {
 2829|       |                        validate_root_flow_tail_after_close(ctx, it, end);
 2830|       |                     }
 2831|       |                  }
 2832|       |                  return;
 2833|       |               }
 2834|       |               else if (*it == ',') {
 2835|       |                  ++it;
 2836|       |                  just_saw_comma = true;
 2837|       |                  skip_flow_ws_and_newlines(ctx, it, end);
 2838|       |                  if (bool(ctx.error)) [[unlikely]]
 2839|       |                     return;
 2840|       |               }
 2841|       |               else {
 2842|       |                  ctx.error = error_code::syntax_error;
 2843|       |                  return;
 2844|       |               }
 2845|       |            }
 2846|       |
 2847|       |            // If we exited because the fixed-size container is full but haven't seen ']',
 2848|       |            // skip to the closing bracket to consume overflow elements.
 2849|       |            int bracket_depth = 1;
 2850|       |            while (it != end && bracket_depth > 0) {
 2851|       |               if (*it == '[') {
 2852|       |                  ++bracket_depth;
 2853|       |               }
 2854|       |               else if (*it == ']') {
 2855|       |                  --bracket_depth;
 2856|       |               }
 2857|       |               ++it;
 2858|       |            }
 2859|       |         }
 2860|       |         else {
 2861|       |            ctx.error = error_code::syntax_error;
 2862|       |            return;
 2863|       |         }
 2864|  47.2k|      }
_ZN3glz4yaml26clear_sequence_before_readITnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1ELb0ELb0ELb0ELb0ELj1EEENSt3__16vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS3_9allocatorIS8_EEEEEEvRT0_:
 2580|   412k|      {
 2581|   412k|         if constexpr (emplace_backable<V> && requires { value.clear(); }) {
 2582|       |            // vector-like: honor the append_arrays option, matching json/read.hpp
 2583|   412k|            if constexpr (!check_append_arrays(Opts)) {
 2584|   412k|               value.clear();
 2585|   412k|            }
 2586|       |         }
 2587|       |         else if constexpr (emplaceable<V> && requires { value.clear(); }) {
 2588|       |            // set-like: json/read.hpp clears unconditionally; append_arrays does not apply
 2589|       |            value.clear();
 2590|       |         }
 2591|   412k|      }
_ZZN3glz4yaml19parse_flow_sequenceITnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1ELb0ELb0ELb0ELb0ELj1EEERNSt3__16vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS3_9allocatorIS8_EEEENS0_12yaml_contextEPKcSF_EEvOT0_RT1_RT2_T3_EN26sequence_container_adapter6appendESC_OS8_:
 2618|  69.8k|            {
 2619|  69.8k|               if constexpr (emplace_backable<V>) {
 2620|  69.8k|                  container.emplace_back(std::move(element));
 2621|       |               }
 2622|       |               else if constexpr (emplaceable<V>) {
 2623|       |                  container.emplace(std::move(element));
 2624|       |               }
 2625|  69.8k|            }
_ZN3glz4yaml20parse_block_sequenceITnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1ELb0ELb0ELb0ELb0ELj1EEERNSt3__16vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS3_9allocatorIS8_EEEENS0_12yaml_contextEPKcSF_EEvOT0_RT1_RT2_T3_i:
 3081|   354k|      {
 3082|   354k|         using V = std::remove_cvref_t<T>;
 3083|   354k|         using value_type = typename V::value_type;
 3084|       |
 3085|   354k|         struct sequence_container_adapter
 3086|   354k|         {
 3087|   354k|            size_t index = 0;
 3088|       |
 3089|   354k|            inline bool fixed_capacity_reached(const V& container) const noexcept
 3090|   354k|            {
 3091|   354k|               if constexpr (!resizable<V>) {
 3092|   354k|                  return index >= container.size();
 3093|   354k|               }
 3094|   354k|               else {
 3095|   354k|                  (void)container;
 3096|   354k|                  return false;
 3097|   354k|               }
 3098|   354k|            }
 3099|       |
 3100|   354k|            inline void commit_fixed_slot() noexcept { ++index; }
 3101|       |
 3102|   354k|            inline void append(V& container, value_type&& element) noexcept
 3103|   354k|            {
 3104|   354k|               if constexpr (emplace_backable<V>) {
 3105|   354k|                  container.emplace_back(std::move(element));
 3106|   354k|               }
 3107|   354k|               else if constexpr (emplaceable<V>) {
 3108|   354k|                  container.emplace(std::move(element));
 3109|   354k|               }
 3110|   354k|            }
 3111|   354k|         };
 3112|       |
 3113|       |         // Overwrite (do not append to) any pre-existing contents. A block
 3114|       |         // sequence is only entered once a '-' item is confirmed, so clearing
 3115|       |         // up front correctly (re)assigns the container to the parsed sequence.
 3116|   354k|         clear_sequence_before_read<Opts>(value);
 3117|       |
 3118|   354k|         sequence_container_adapter adapter{};
 3119|       |
 3120|       |         // Track if this is the first item (for handling whitespace-consumed case)
 3121|   354k|         bool first_item = true;
 3122|   354k|         bool has_pending_item_anchor = false;
 3123|   354k|         std::string pending_item_anchor_name{};
 3124|   354k|         int32_t pending_item_anchor_indent = sequence_indent;
 3125|       |
 3126|   861k|         while (it != end) {
  ------------------
  |  Branch (3126:17): [True: 722k, False: 139k]
  ------------------
 3127|       |            // For fixed-size arrays (e.g. std::array), stop when we've filled all elements.
 3128|       |            // Exclude emplaceable types (e.g. std::set) which are not resizable but grow dynamically.
 3129|       |            if constexpr (!resizable<V> && !emplaceable<V>) {
 3130|       |               if (adapter.fixed_capacity_reached(value)) {
 3131|       |                  return;
 3132|       |               }
 3133|       |            }
 3134|       |
 3135|       |            // Skip blank lines and comments, track indent
 3136|   722k|            int32_t line_indent = 0;
 3137|   722k|            int32_t dash_col = -1; // actual column of the '-' on the line
 3138|   722k|            auto line_start = it;
 3139|       |
 3140|  1.24M|            while (it != end) {
  ------------------
  |  Branch (3140:20): [True: 1.24M, False: 8.19k]
  ------------------
 3141|  1.24M|               if (*it == '#') {
  ------------------
  |  Branch (3141:20): [True: 105k, False: 1.13M]
  ------------------
 3142|   105k|                  skip_comment(it, end);
 3143|   105k|                  skip_newline(it, end);
 3144|   105k|                  line_start = it;
 3145|   105k|                  line_indent = 0;
 3146|   105k|               }
 3147|  1.13M|               else if (*it == '\n' || *it == '\r') {
  ------------------
  |  Branch (3147:25): [True: 131k, False: 1.00M]
  |  Branch (3147:40): [True: 133k, False: 870k]
  ------------------
 3148|   265k|                  skip_newline(it, end);
 3149|   265k|                  line_start = it;
 3150|   265k|                  line_indent = 0;
 3151|   265k|               }
 3152|   870k|               else if (*it == ' ') {
  ------------------
  |  Branch (3152:25): [True: 215k, False: 655k]
  ------------------
 3153|   215k|                  line_start = it;
 3154|   215k|                  line_indent = 0;
 3155|   581k|                  while (it != end && *it == ' ') {
  ------------------
  |  Branch (3155:26): [True: 580k, False: 1.41k]
  |  Branch (3155:39): [True: 366k, False: 213k]
  ------------------
 3156|   366k|                     ++line_indent;
 3157|   366k|                     ++it;
 3158|   366k|                  }
 3159|       |
 3160|   215k|                  bool saw_tab = false;
 3161|   222k|                  while (it != end && (*it == ' ' || *it == '\t')) {
  ------------------
  |  Branch (3161:26): [True: 220k, False: 1.85k]
  |  Branch (3161:40): [True: 3.86k, False: 216k]
  |  Branch (3161:54): [True: 3.37k, False: 213k]
  ------------------
 3162|  7.23k|                     saw_tab = saw_tab || (*it == '\t');
  ------------------
  |  Branch (3162:32): [True: 5.70k, False: 1.53k]
  |  Branch (3162:43): [True: 1.53k, False: 0]
  ------------------
 3163|  7.23k|                     ++it;
 3164|  7.23k|                  }
 3165|       |
 3166|   215k|                  if (it == end || *it == '\n' || *it == '\r' || *it == '#') {
  ------------------
  |  Branch (3166:23): [True: 1.85k, False: 213k]
  |  Branch (3166:36): [True: 2.60k, False: 210k]
  |  Branch (3166:51): [True: 41.8k, False: 168k]
  |  Branch (3166:66): [True: 101k, False: 67.3k]
  ------------------
 3167|       |                     // Blank or comment line - continue to next line
 3168|   147k|                     if (it != end && *it == '#') {
  ------------------
  |  Branch (3168:26): [True: 145k, False: 1.85k]
  |  Branch (3168:39): [True: 101k, False: 44.5k]
  ------------------
 3169|   101k|                        skip_comment(it, end);
 3170|   101k|                     }
 3171|   147k|                     line_indent = 0;
 3172|   147k|                     continue;
 3173|   147k|                  }
 3174|       |
 3175|  67.3k|                  if (saw_tab) {
  ------------------
  |  Branch (3175:23): [True: 10, False: 67.3k]
  ------------------
 3176|     10|                     ctx.error = error_code::syntax_error;
 3177|     10|                     return;
 3178|     10|                  }
 3179|  67.3k|                  break; // Found content
 3180|  67.3k|               }
 3181|   655k|               else if (*it == '\t') {
  ------------------
  |  Branch (3181:25): [True: 9.06k, False: 646k]
  ------------------
 3182|  9.06k|                  line_start = it;
 3183|  19.9k|                  while (it != end && (*it == ' ' || *it == '\t')) ++it;
  ------------------
  |  Branch (3183:26): [True: 19.2k, False: 694]
  |  Branch (3183:40): [True: 1.00k, False: 18.2k]
  |  Branch (3183:54): [True: 9.88k, False: 8.37k]
  ------------------
 3184|  9.06k|                  if (it == end || *it == '\n' || *it == '\r' || *it == '#') {
  ------------------
  |  Branch (3184:23): [True: 694, False: 8.37k]
  |  Branch (3184:36): [True: 341, False: 8.02k]
  |  Branch (3184:51): [True: 4.36k, False: 3.66k]
  |  Branch (3184:66): [True: 3.65k, False: 10]
  ------------------
 3185|  9.05k|                     if (it != end && *it == '#') {
  ------------------
  |  Branch (3185:26): [True: 8.36k, False: 694]
  |  Branch (3185:39): [True: 3.65k, False: 4.70k]
  ------------------
 3186|  3.65k|                        skip_comment(it, end);
 3187|  3.65k|                     }
 3188|  9.05k|                     line_indent = 0;
 3189|  9.05k|                     continue;
 3190|  9.05k|                  }
 3191|     10|                  ctx.error = error_code::syntax_error;
 3192|     10|                  return;
 3193|  9.06k|               }
 3194|   646k|               else {
 3195|       |                  // At content (no leading space on this line)
 3196|       |                  // If first item and at '-', whitespace was consumed by caller;
 3197|       |                  // treat as having correct indentation
 3198|   646k|                  if (first_item && *it == '-') {
  ------------------
  |  Branch (3198:23): [True: 354k, False: 291k]
  |  Branch (3198:37): [True: 354k, False: 441]
  ------------------
 3199|   354k|                     line_indent = sequence_indent;
 3200|   354k|                     if constexpr (std::is_pointer_v<std::decay_t<It>>) {
 3201|   354k|                        if (ctx.stream_begin && it > ctx.stream_begin) {
  ------------------
  |  Branch (3201:29): [True: 354k, False: 0]
  |  Branch (3201:49): [True: 354k, False: 0]
  ------------------
 3202|   354k|                           auto probe = it;
 3203|   354k|                           int32_t leading_ws = 0;
 3204|   354k|                           bool saw_tab = false;
 3205|   649k|                           while (probe > ctx.stream_begin && (*(probe - 1) == ' ' || *(probe - 1) == '\t')) {
  ------------------
  |  Branch (3205:35): [True: 649k, False: 0]
  |  Branch (3205:64): [True: 288k, False: 360k]
  |  Branch (3205:87): [True: 6.18k, False: 354k]
  ------------------
 3206|   295k|                              --probe;
 3207|   295k|                              ++leading_ws;
 3208|   295k|                              saw_tab = saw_tab || (*probe == '\t');
  ------------------
  |  Branch (3208:41): [True: 2.93k, False: 292k]
  |  Branch (3208:52): [True: 3.47k, False: 288k]
  ------------------
 3209|   295k|                           }
 3210|   354k|                           if (probe == ctx.stream_begin || *(probe - 1) == '\n' || *(probe - 1) == '\r') {
  ------------------
  |  Branch (3210:32): [True: 0, False: 354k]
  |  Branch (3210:61): [True: 11.6k, False: 342k]
  |  Branch (3210:85): [True: 83.4k, False: 259k]
  ------------------
 3211|  95.0k|                              if (saw_tab) {
  ------------------
  |  Branch (3211:35): [True: 3, False: 95.0k]
  ------------------
 3212|      3|                                 ctx.error = error_code::syntax_error;
 3213|      3|                                 return;
 3214|      3|                              }
 3215|  95.0k|                              line_indent = (std::max)(line_indent, leading_ws);
 3216|  95.0k|                           }
 3217|   354k|                        }
 3218|   354k|                     }
 3219|   354k|                  }
 3220|   354k|                  break;
 3221|   646k|               }
 3222|  1.24M|            }
 3223|       |
 3224|   722k|            if (it == end) break;
  ------------------
  |  Branch (3224:17): [True: 8.19k, False: 713k]
  ------------------
 3225|       |
 3226|       |            // Check for document end marker
 3227|   713k|            if (at_document_end(it, end)) break;
  ------------------
  |  Branch (3227:17): [True: 2.56k, False: 711k]
  ------------------
 3228|       |
 3229|       |            // Check for dedent
 3230|   711k|            if (line_indent < sequence_indent) {
  ------------------
  |  Branch (3230:17): [True: 19.0k, False: 692k]
  ------------------
 3231|  19.0k|               it = line_start;
 3232|  19.0k|               return;
 3233|  19.0k|            }
 3234|       |
 3235|   692k|            if (*it == '&') {
  ------------------
  |  Branch (3235:17): [True: 18.0k, False: 674k]
  ------------------
 3236|       |               // Standalone anchor lines before "- item" are only supported for
 3237|       |               // indentless mapping values. At top-level block sequences these are
 3238|       |               // malformed in yaml-test-suite cases.
 3239|  18.0k|               if (!ctx.allow_indentless_sequence) {
  ------------------
  |  Branch (3239:20): [True: 4, False: 18.0k]
  ------------------
 3240|      4|                  ctx.error = error_code::syntax_error;
 3241|      4|                  return;
 3242|      4|               }
 3243|       |
 3244|  18.0k|               ++it;
 3245|  18.0k|               auto pending_name = parse_anchor_name(it, end);
 3246|  18.0k|               if (pending_name.empty()) {
  ------------------
  |  Branch (3246:20): [True: 9, False: 18.0k]
  ------------------
 3247|      9|                  ctx.error = error_code::syntax_error;
 3248|      9|                  return;
 3249|      9|               }
 3250|  18.0k|               skip_inline_ws(it, end);
 3251|  18.0k|               if (it != end && *it == '#') {
  ------------------
  |  Branch (3251:20): [True: 17.9k, False: 32]
  |  Branch (3251:33): [True: 8.54k, False: 9.43k]
  ------------------
 3252|  8.54k|                  skip_comment(it, end);
 3253|  8.54k|               }
 3254|       |
 3255|  18.0k|               has_pending_item_anchor = true;
 3256|  18.0k|               pending_item_anchor_name = std::string(pending_name);
 3257|  18.0k|               pending_item_anchor_indent = line_indent;
 3258|       |
 3259|  18.0k|               if (it == end || (*it != '\n' && *it != '\r')) {
  ------------------
  |  Branch (3259:20): [True: 42, False: 17.9k]
  |  Branch (3259:34): [True: 12.5k, False: 5.45k]
  |  Branch (3259:49): [True: 37, False: 12.4k]
  ------------------
 3260|     79|                  ctx.error = error_code::syntax_error;
 3261|     79|                  return;
 3262|     79|               }
 3263|       |
 3264|  17.9k|               skip_newline(it, end);
 3265|  17.9k|               continue;
 3266|  18.0k|            }
 3267|       |
 3268|       |            // Expect dash for sequence item
 3269|   674k|            if (*it != '-') {
  ------------------
  |  Branch (3269:17): [True: 172k, False: 501k]
  ------------------
 3270|   172k|               it = line_start;
 3271|   172k|               return;
 3272|   172k|            }
 3273|       |
 3274|       |            // Compute the actual column of this sequence dash.
 3275|       |            // This is needed by plain-scalar multiline folding to distinguish
 3276|       |            // sibling "- item" entries from deeper "- " continuation content.
 3277|   501k|            dash_col = line_indent;
 3278|   501k|            if constexpr (std::is_pointer_v<std::decay_t<It>>) {
 3279|   501k|               if (ctx.stream_begin) {
  ------------------
  |  Branch (3279:20): [True: 501k, False: 3]
  ------------------
 3280|   501k|                  dash_col = ctx.line_prefix_before(&*it).column;
 3281|   501k|               }
 3282|   501k|            }
 3283|       |
 3284|   501k|            ++it; // Skip '-'
 3285|       |
 3286|       |            // Check for valid sequence item indicator (- followed by space or newline)
 3287|   501k|            if (it != end && !yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*it)]) {
  ------------------
  |  Branch (3287:17): [True: 496k, False: 5.23k]
  |  Branch (3287:30): [True: 12.1k, False: 484k]
  ------------------
 3288|       |               // Not a sequence item (could be a number like -5)
 3289|  12.1k|               it = line_start;
 3290|  12.1k|               return;
 3291|  12.1k|            }
 3292|       |
 3293|   489k|            bool saw_tab_after_dash = false;
 3294|  2.27M|            while (it != end && (*it == ' ' || *it == '\t')) {
  ------------------
  |  Branch (3294:20): [True: 2.26M, False: 6.42k]
  |  Branch (3294:34): [True: 1.62M, False: 637k]
  |  Branch (3294:48): [True: 154k, False: 482k]
  ------------------
 3295|  1.78M|               saw_tab_after_dash = saw_tab_after_dash || (*it == '\t');
  ------------------
  |  Branch (3295:37): [True: 1.24M, False: 533k]
  |  Branch (3295:59): [True: 119k, False: 413k]
  ------------------
 3296|  1.78M|               ++it;
 3297|  1.78M|            }
 3298|       |            // A tab-separated nested "- " marker is not valid block indentation.
 3299|   489k|            if (saw_tab_after_dash && it != end && *it == '-') {
  ------------------
  |  Branch (3299:17): [True: 119k, False: 369k]
  |  Branch (3299:39): [True: 119k, False: 400]
  |  Branch (3299:52): [True: 13.1k, False: 105k]
  ------------------
 3300|  13.1k|               const auto after_dash = it + 1;
 3301|  13.1k|               if (after_dash == end || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*after_dash)]) {
  ------------------
  |  Branch (3301:20): [True: 3, False: 13.1k]
  |  Branch (3301:41): [True: 1, False: 13.1k]
  ------------------
 3302|      4|                  ctx.error = error_code::syntax_error;
 3303|      4|                  return;
 3304|      4|               }
 3305|  13.1k|            }
 3306|       |
 3307|       |            // Get reference to element to parse into
 3308|   489k|            auto parse_element = [&](auto& element) {
 3309|   489k|               const char* element_start = (it != end) ? &*it : nullptr;
 3310|       |
 3311|       |               // Check what follows
 3312|   489k|               if (it != end && !yaml::line_end_or_comment_table[static_cast<uint8_t>(*it)]) {
 3313|       |                  // Content on same line as dash - set indent to one less than content column
 3314|       |                  // This allows nested block mappings to continue parsing keys at the content indent
 3315|       |                  // For "- key: val", if dash is at column 0, content is at column 2
 3316|       |                  // We set parent indent to 1 so keys at column 2 pass the "indent > parent" check
 3317|   489k|                  if (!ctx.push_indent(line_indent + 1)) [[unlikely]]
 3318|   489k|                     return;
 3319|   489k|                  const bool prev_sequence_item_value_context = ctx.sequence_item_value_context;
 3320|   489k|                  const int32_t prev_sequence_dash_indent = ctx.sequence_dash_indent;
 3321|   489k|                  ctx.sequence_item_value_context = true;
 3322|   489k|                  ctx.sequence_dash_indent = dash_col;
 3323|   489k|                  from<YAML, value_type>::template op<Opts>(element, ctx, it, end);
 3324|   489k|                  ctx.sequence_dash_indent = prev_sequence_dash_indent;
 3325|   489k|                  ctx.sequence_item_value_context = prev_sequence_item_value_context;
 3326|   489k|                  ctx.pop_indent();
 3327|   489k|               }
 3328|   489k|               else {
 3329|       |                  // Value on next line - nested block
 3330|   489k|                  skip_ws_and_comment(it, end);
 3331|   489k|                  skip_newline(it, end);
 3332|       |
 3333|       |                  // Get indent of nested content
 3334|   489k|                  auto nested_start = it;
 3335|   489k|                  int32_t nested_indent = measure_indent(it, end, ctx);
 3336|   489k|                  if (bool(ctx.error)) [[unlikely]]
 3337|   489k|                     return;
 3338|   489k|                  it = nested_start;
 3339|       |
 3340|       |                  // Content is nested only if indented more than the current line.
 3341|       |                  // When line_indent is negative (root level), use 0 as the baseline.
 3342|       |                  // This prevents content at column 0 from being treated as nested.
 3343|   489k|                  const int32_t effective_line_indent = (line_indent < 0) ? 0 : line_indent;
 3344|   489k|                  if (nested_indent > effective_line_indent) {
 3345|       |                     // Save and set indent for nested parsing.
 3346|       |                     // A struct element reads the pushed indent as its own key column; every
 3347|       |                     // other element type reads it as the enclosing baseline, so it gets one
 3348|       |                     // less than the content indent and its content passes "indent > parent".
 3349|   489k|                     const int32_t element_indent =
 3350|   489k|                        receives_block_mapping_column<value_type>() ? nested_indent : nested_indent - 1;
 3351|   489k|                     if (!ctx.push_indent(element_indent)) [[unlikely]]
 3352|   489k|                        return;
 3353|   489k|                     const bool prev_sequence_item_value_context = ctx.sequence_item_value_context;
 3354|   489k|                     const int32_t prev_sequence_dash_indent = ctx.sequence_dash_indent;
 3355|   489k|                     ctx.sequence_item_value_context = true;
 3356|   489k|                     ctx.sequence_dash_indent = dash_col;
 3357|   489k|                     from<YAML, value_type>::template op<Opts>(element, ctx, it, end);
 3358|   489k|                     ctx.sequence_dash_indent = prev_sequence_dash_indent;
 3359|   489k|                     ctx.sequence_item_value_context = prev_sequence_item_value_context;
 3360|   489k|                     ctx.pop_indent();
 3361|   489k|                  }
 3362|       |                  // else: empty element (default constructed)
 3363|   489k|               }
 3364|       |
 3365|   489k|               if (has_pending_item_anchor && !bool(ctx.error)) {
 3366|   489k|                  const char* element_end = (it != end) ? &*it : element_start;
 3367|   489k|                  ctx.anchors[std::move(pending_item_anchor_name)] = {element_start, element_end,
 3368|   489k|                                                                      pending_item_anchor_indent};
 3369|   489k|                  has_pending_item_anchor = false;
 3370|   489k|               }
 3371|   489k|            };
 3372|       |
 3373|   489k|            if constexpr (emplace_backable<V>) {
 3374|   489k|               auto& element = value.emplace_back();
 3375|   489k|               parse_element(element);
 3376|       |            }
 3377|       |            else if constexpr (emplaceable<V>) {
 3378|       |               value_type element{};
 3379|       |               parse_element(element);
 3380|       |               if (!bool(ctx.error)) {
 3381|       |                  adapter.append(value, std::move(element));
 3382|       |               }
 3383|       |            }
 3384|       |            else if constexpr (!resizable<V>) {
 3385|       |               parse_element(value[adapter.index]);
 3386|       |               adapter.commit_fixed_slot();
 3387|       |            }
 3388|       |            else {
 3389|       |               ctx.error = error_code::syntax_error;
 3390|       |               return;
 3391|       |            }
 3392|       |
 3393|   489k|            first_item = false;
 3394|       |
 3395|   489k|            if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (3395:17): [True: 304, False: 488k]
  ------------------
 3396|    304|               return;
 3397|       |
 3398|       |            // Note: after parsing nested block content, iterator may already be
 3399|       |            // at the start of the next line. The outer loop will handle it.
 3400|   489k|         }
 3401|   354k|      }
_ZZN3glz4yaml20parse_block_sequenceITnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1ELb0ELb0ELb0ELb0ELj1EEERNSt3__16vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS3_9allocatorIS8_EEEENS0_12yaml_contextEPKcSF_EEvOT0_RT1_RT2_T3_iENKUlRT_E_clIS8_EEDaSO_:
 3308|   489k|            auto parse_element = [&](auto& element) {
 3309|   489k|               const char* element_start = (it != end) ? &*it : nullptr;
  ------------------
  |  Branch (3309:44): [True: 482k, False: 6.42k]
  ------------------
 3310|       |
 3311|       |               // Check what follows
 3312|   489k|               if (it != end && !yaml::line_end_or_comment_table[static_cast<uint8_t>(*it)]) {
  ------------------
  |  Branch (3312:20): [True: 482k, False: 6.42k]
  |  Branch (3312:33): [True: 246k, False: 235k]
  ------------------
 3313|       |                  // Content on same line as dash - set indent to one less than content column
 3314|       |                  // This allows nested block mappings to continue parsing keys at the content indent
 3315|       |                  // For "- key: val", if dash is at column 0, content is at column 2
 3316|       |                  // We set parent indent to 1 so keys at column 2 pass the "indent > parent" check
 3317|   246k|                  if (!ctx.push_indent(line_indent + 1)) [[unlikely]]
  ------------------
  |  Branch (3317:23): [True: 0, False: 246k]
  ------------------
 3318|      0|                     return;
 3319|   246k|                  const bool prev_sequence_item_value_context = ctx.sequence_item_value_context;
 3320|   246k|                  const int32_t prev_sequence_dash_indent = ctx.sequence_dash_indent;
 3321|   246k|                  ctx.sequence_item_value_context = true;
 3322|   246k|                  ctx.sequence_dash_indent = dash_col;
 3323|   246k|                  from<YAML, value_type>::template op<Opts>(element, ctx, it, end);
 3324|   246k|                  ctx.sequence_dash_indent = prev_sequence_dash_indent;
 3325|   246k|                  ctx.sequence_item_value_context = prev_sequence_item_value_context;
 3326|   246k|                  ctx.pop_indent();
 3327|   246k|               }
 3328|   242k|               else {
 3329|       |                  // Value on next line - nested block
 3330|   242k|                  skip_ws_and_comment(it, end);
 3331|   242k|                  skip_newline(it, end);
 3332|       |
 3333|       |                  // Get indent of nested content
 3334|   242k|                  auto nested_start = it;
 3335|   242k|                  int32_t nested_indent = measure_indent(it, end, ctx);
 3336|   242k|                  if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (3336:23): [True: 3, False: 242k]
  ------------------
 3337|      3|                     return;
 3338|   242k|                  it = nested_start;
 3339|       |
 3340|       |                  // Content is nested only if indented more than the current line.
 3341|       |                  // When line_indent is negative (root level), use 0 as the baseline.
 3342|       |                  // This prevents content at column 0 from being treated as nested.
 3343|   242k|                  const int32_t effective_line_indent = (line_indent < 0) ? 0 : line_indent;
  ------------------
  |  Branch (3343:57): [True: 58.0k, False: 184k]
  ------------------
 3344|   242k|                  if (nested_indent > effective_line_indent) {
  ------------------
  |  Branch (3344:23): [True: 73.2k, False: 169k]
  ------------------
 3345|       |                     // Save and set indent for nested parsing.
 3346|       |                     // A struct element reads the pushed indent as its own key column; every
 3347|       |                     // other element type reads it as the enclosing baseline, so it gets one
 3348|       |                     // less than the content indent and its content passes "indent > parent".
 3349|  73.2k|                     const int32_t element_indent =
 3350|  73.2k|                        receives_block_mapping_column<value_type>() ? nested_indent : nested_indent - 1;
  ------------------
  |  Branch (3350:25): [Folded, False: 73.2k]
  ------------------
 3351|  73.2k|                     if (!ctx.push_indent(element_indent)) [[unlikely]]
  ------------------
  |  Branch (3351:26): [True: 0, False: 73.2k]
  ------------------
 3352|      0|                        return;
 3353|  73.2k|                     const bool prev_sequence_item_value_context = ctx.sequence_item_value_context;
 3354|  73.2k|                     const int32_t prev_sequence_dash_indent = ctx.sequence_dash_indent;
 3355|  73.2k|                     ctx.sequence_item_value_context = true;
 3356|  73.2k|                     ctx.sequence_dash_indent = dash_col;
 3357|  73.2k|                     from<YAML, value_type>::template op<Opts>(element, ctx, it, end);
 3358|  73.2k|                     ctx.sequence_dash_indent = prev_sequence_dash_indent;
 3359|  73.2k|                     ctx.sequence_item_value_context = prev_sequence_item_value_context;
 3360|  73.2k|                     ctx.pop_indent();
 3361|  73.2k|                  }
 3362|       |                  // else: empty element (default constructed)
 3363|   242k|               }
 3364|       |
 3365|   489k|               if (has_pending_item_anchor && !bool(ctx.error)) {
  ------------------
  |  Branch (3365:20): [True: 5.25k, False: 484k]
  |  Branch (3365:47): [True: 5.21k, False: 42]
  ------------------
 3366|  5.21k|                  const char* element_end = (it != end) ? &*it : element_start;
  ------------------
  |  Branch (3366:45): [True: 4.79k, False: 411]
  ------------------
 3367|  5.21k|                  ctx.anchors[std::move(pending_item_anchor_name)] = {element_start, element_end,
 3368|  5.21k|                                                                      pending_item_anchor_indent};
 3369|  5.21k|                  has_pending_item_anchor = false;
 3370|  5.21k|               }
 3371|   489k|            };
_ZN3glz29parse_block_mapping_or_stringINSt3__17variantIJDndNS1_12basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEbNS1_6vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS6_ISD_EEEENSC_ISD_EEEEETnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1ELb0ELb0ELb0ELb0ELj1EEERSH_RNS_4yaml12yaml_contextERPKcSO_EEvOT1_OT2_OT3_T4_:
 5423|   801k|   {
 5424|   801k|      if constexpr (yaml::check_flow_context(Opts)) {
 5425|       |         // In flow context, only treat plain content as an implicit "key: value"
 5426|       |         // when a mapping separator appears before the next top-level flow delimiter.
 5427|   801k|         auto could_be_implicit_flow_pair = [&](auto pos) {
 5428|       |            // Bounded by the longest implicit key the spec allows: unbounded, this probe runs
 5429|       |            // once per entry per nesting level over the whole remaining flow collection.
 5430|   801k|            const auto stop = yaml::implicit_key_scan_end(pos, end);
 5431|   801k|            int depth = 0;
 5432|   801k|            while (pos != stop) {
 5433|   801k|               const char c = *pos;
 5434|   801k|               if (c == '"' || c == '\'') {
 5435|   801k|                  const char quote = c;
 5436|   801k|                  ++pos;
 5437|   801k|                  while (pos != stop && *pos != quote) {
 5438|   801k|                     if (*pos == '\\' && quote == '"') {
 5439|   801k|                        ++pos;
 5440|   801k|                        if (pos != stop) ++pos;
 5441|   801k|                     }
 5442|   801k|                     else {
 5443|   801k|                        ++pos;
 5444|   801k|                     }
 5445|   801k|                  }
 5446|   801k|                  if (pos != stop) ++pos;
 5447|   801k|                  continue;
 5448|   801k|               }
 5449|   801k|               if (c == '[' || c == '{') {
 5450|   801k|                  ++depth;
 5451|   801k|                  ++pos;
 5452|   801k|                  continue;
 5453|   801k|               }
 5454|   801k|               if (c == ']' || c == '}') {
 5455|   801k|                  if (depth == 0) return false;
 5456|   801k|                  --depth;
 5457|   801k|                  ++pos;
 5458|   801k|                  continue;
 5459|   801k|               }
 5460|   801k|               if (c == ',' && depth == 0) return false;
 5461|   801k|               if (c == ':' && depth == 0) {
 5462|   801k|                  auto next = pos + 1;
 5463|   801k|                  return next == end || *next == ' ' || *next == '\t' || *next == '\n' || *next == '\r';
 5464|   801k|               }
 5465|   801k|               ++pos;
 5466|   801k|            }
 5467|   801k|            return false;
 5468|   801k|         };
 5469|       |
 5470|   801k|         if (could_be_implicit_flow_pair(it) || line_could_be_flow_mapping(it, end)) {
  ------------------
  |  Branch (5470:14): [True: 214k, False: 587k]
  |  Branch (5470:49): [True: 19.3k, False: 568k]
  ------------------
 5471|   233k|            if (try_parse_block_mapping_into_variant<Variant, Opts>(value, ctx, it, end)) {
  ------------------
  |  Branch (5471:17): [True: 208k, False: 25.4k]
  ------------------
 5472|   208k|               return;
 5473|   208k|            }
 5474|  25.4k|            if (bool(ctx.error)) {
  ------------------
  |  Branch (5474:17): [True: 3.14k, False: 22.3k]
  ------------------
 5475|  3.14k|               return;
 5476|  3.14k|            }
 5477|  25.4k|         }
 5478|       |
 5479|   590k|         process_yaml_variant_alternatives<Variant, is_yaml_variant_str>::template op<Opts>(value, ctx, it, end);
 5480|   590k|         return;
 5481|   801k|      }
 5482|       |
 5483|   801k|      if (try_parse_block_mapping_into_variant<Variant, Opts>(value, ctx, it, end)) {
  ------------------
  |  Branch (5483:11): [True: 0, False: 801k]
  ------------------
 5484|      0|         return;
 5485|      0|      }
 5486|       |      // If an error was set (e.g., malformed flow collection in value), don't try to parse as string
 5487|   801k|      if (bool(ctx.error)) {
  ------------------
  |  Branch (5487:11): [True: 0, False: 801k]
  ------------------
 5488|      0|         return;
 5489|      0|      }
 5490|   801k|      process_yaml_variant_alternatives<Variant, is_yaml_variant_str>::template op<Opts>(value, ctx, it, end);
 5491|   801k|   }
_ZZN3glz29parse_block_mapping_or_stringINSt3__17variantIJDndNS1_12basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEbNS1_6vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS6_ISD_EEEENSC_ISD_EEEEETnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1ELb0ELb0ELb0ELb0ELj1EEERSH_RNS_4yaml12yaml_contextERPKcSO_EEvOT1_OT2_OT3_T4_ENKUlT_E_clISO_EEDaSX_:
 5427|   801k|         auto could_be_implicit_flow_pair = [&](auto pos) {
 5428|       |            // Bounded by the longest implicit key the spec allows: unbounded, this probe runs
 5429|       |            // once per entry per nesting level over the whole remaining flow collection.
 5430|   801k|            const auto stop = yaml::implicit_key_scan_end(pos, end);
 5431|   801k|            int depth = 0;
 5432|  33.9M|            while (pos != stop) {
  ------------------
  |  Branch (5432:20): [True: 33.7M, False: 230k]
  ------------------
 5433|  33.7M|               const char c = *pos;
 5434|  33.7M|               if (c == '"' || c == '\'') {
  ------------------
  |  Branch (5434:20): [True: 205k, False: 33.5M]
  |  Branch (5434:32): [True: 136k, False: 33.3M]
  ------------------
 5435|   341k|                  const char quote = c;
 5436|   341k|                  ++pos;
 5437|  25.8M|                  while (pos != stop && *pos != quote) {
  ------------------
  |  Branch (5437:26): [True: 25.7M, False: 84.0k]
  |  Branch (5437:41): [True: 25.4M, False: 257k]
  ------------------
 5438|  25.4M|                     if (*pos == '\\' && quote == '"') {
  ------------------
  |  Branch (5438:26): [True: 148k, False: 25.3M]
  |  Branch (5438:42): [True: 104k, False: 44.4k]
  ------------------
 5439|   104k|                        ++pos;
 5440|   104k|                        if (pos != stop) ++pos;
  ------------------
  |  Branch (5440:29): [True: 100k, False: 4.05k]
  ------------------
 5441|   104k|                     }
 5442|  25.3M|                     else {
 5443|  25.3M|                        ++pos;
 5444|  25.3M|                     }
 5445|  25.4M|                  }
 5446|   341k|                  if (pos != stop) ++pos;
  ------------------
  |  Branch (5446:23): [True: 257k, False: 84.0k]
  ------------------
 5447|   341k|                  continue;
 5448|   341k|               }
 5449|  33.3M|               if (c == '[' || c == '{') {
  ------------------
  |  Branch (5449:20): [True: 1.28M, False: 32.1M]
  |  Branch (5449:32): [True: 341k, False: 31.7M]
  ------------------
 5450|  1.63M|                  ++depth;
 5451|  1.63M|                  ++pos;
 5452|  1.63M|                  continue;
 5453|  1.63M|               }
 5454|  31.7M|               if (c == ']' || c == '}') {
  ------------------
  |  Branch (5454:20): [True: 50.2k, False: 31.7M]
  |  Branch (5454:32): [True: 116k, False: 31.5M]
  ------------------
 5455|   166k|                  if (depth == 0) return false;
  ------------------
  |  Branch (5455:23): [True: 69.7k, False: 97.1k]
  ------------------
 5456|  97.1k|                  --depth;
 5457|  97.1k|                  ++pos;
 5458|  97.1k|                  continue;
 5459|   166k|               }
 5460|  31.5M|               if (c == ',' && depth == 0) return false;
  ------------------
  |  Branch (5460:20): [True: 1.39M, False: 30.2M]
  |  Branch (5460:32): [True: 222k, False: 1.17M]
  ------------------
 5461|  31.3M|               if (c == ':' && depth == 0) {
  ------------------
  |  Branch (5461:20): [True: 759k, False: 30.6M]
  |  Branch (5461:32): [True: 279k, False: 479k]
  ------------------
 5462|   279k|                  auto next = pos + 1;
 5463|   279k|                  return next == end || *next == ' ' || *next == '\t' || *next == '\n' || *next == '\r';
  ------------------
  |  Branch (5463:26): [True: 8.06k, False: 271k]
  |  Branch (5463:41): [True: 132k, False: 138k]
  |  Branch (5463:57): [True: 20.7k, False: 117k]
  |  Branch (5463:74): [True: 20.2k, False: 97.4k]
  |  Branch (5463:91): [True: 32.6k, False: 64.8k]
  ------------------
 5464|   279k|               }
 5465|  31.0M|               ++pos;
 5466|  31.0M|            }
 5467|   230k|            return false;
 5468|   801k|         };
_ZN3glz26line_could_be_flow_mappingIPKcS2_EEbT_T0_:
 5293|  9.08M|   {
 5294|  9.08M|      const auto stop = yaml::implicit_key_scan_end(it, end);
 5295|  9.08M|      int flow_depth = 0;
 5296|  9.08M|      bool prev_was_whitespace = true;
 5297|  9.08M|      bool key_supports_adjacent_value = false;
 5298|       |
 5299|   183M|      while (it != stop) {
  ------------------
  |  Branch (5299:14): [True: 182M, False: 433k]
  ------------------
 5300|   182M|         const char c = *it;
 5301|   182M|         if (c == '\n' || c == '\r') {
  ------------------
  |  Branch (5301:14): [True: 1.34M, False: 181M]
  |  Branch (5301:27): [True: 1.20M, False: 180M]
  ------------------
 5302|  2.55M|            return false;
 5303|  2.55M|         }
 5304|   180M|         if (flow_depth == 0 && (c == ',' || c == ']' || c == '}')) {
  ------------------
  |  Branch (5304:14): [True: 153M, False: 26.8M]
  |  Branch (5304:34): [True: 3.55M, False: 149M]
  |  Branch (5304:46): [True: 113k, False: 149M]
  |  Branch (5304:58): [True: 354k, False: 149M]
  ------------------
 5305|  4.02M|            return false;
 5306|  4.02M|         }
 5307|   176M|         if (c == '#' && flow_depth == 0 && prev_was_whitespace) {
  ------------------
  |  Branch (5307:14): [True: 1.44M, False: 174M]
  |  Branch (5307:26): [True: 915k, False: 531k]
  |  Branch (5307:45): [True: 18.7k, False: 896k]
  ------------------
 5308|  18.7k|            return false;
 5309|  18.7k|         }
 5310|   176M|         if ((c == '"' || c == '\'') && prev_was_whitespace) {
  ------------------
  |  Branch (5310:15): [True: 696k, False: 175M]
  |  Branch (5310:27): [True: 1.00M, False: 174M]
  |  Branch (5310:41): [True: 146k, False: 1.55M]
  ------------------
 5311|   146k|            const char quote = c;
 5312|   146k|            ++it;
 5313|  1.50M|            while (it != stop && *it != quote) {
  ------------------
  |  Branch (5313:20): [True: 1.49M, False: 5.78k]
  |  Branch (5313:34): [True: 1.44M, False: 51.0k]
  ------------------
 5314|  1.44M|               if (*it == '\\' && quote == '"') {
  ------------------
  |  Branch (5314:20): [True: 26.0k, False: 1.41M]
  |  Branch (5314:35): [True: 23.3k, False: 2.69k]
  ------------------
 5315|  23.3k|                  ++it;
 5316|  23.3k|                  if (it != stop) ++it;
  ------------------
  |  Branch (5316:23): [True: 22.5k, False: 852]
  ------------------
 5317|  23.3k|               }
 5318|  1.42M|               else if (*it == '\n' || *it == '\r') {
  ------------------
  |  Branch (5318:25): [True: 63.5k, False: 1.35M]
  |  Branch (5318:40): [True: 26.0k, False: 1.33M]
  ------------------
 5319|  89.5k|                  return false;
 5320|  89.5k|               }
 5321|  1.33M|               else {
 5322|  1.33M|                  ++it;
 5323|  1.33M|               }
 5324|  1.44M|            }
 5325|  56.8k|            if (it != stop) ++it;
  ------------------
  |  Branch (5325:17): [True: 51.0k, False: 5.78k]
  ------------------
 5326|  56.8k|            key_supports_adjacent_value = true;
 5327|  56.8k|            prev_was_whitespace = false;
 5328|  56.8k|            continue;
 5329|   146k|         }
 5330|   175M|         if (c == '[' || c == '{') {
  ------------------
  |  Branch (5330:14): [True: 4.10M, False: 171M]
  |  Branch (5330:26): [True: 755k, False: 171M]
  ------------------
 5331|  4.86M|            ++flow_depth;
 5332|  4.86M|            key_supports_adjacent_value = false;
 5333|  4.86M|            prev_was_whitespace = false;
 5334|  4.86M|            ++it;
 5335|  4.86M|            continue;
 5336|  4.86M|         }
 5337|   171M|         if (c == ']' || c == '}') {
  ------------------
  |  Branch (5337:14): [True: 87.5k, False: 170M]
  |  Branch (5337:26): [True: 196k, False: 170M]
  ------------------
 5338|   283k|            if (flow_depth > 0) {
  ------------------
  |  Branch (5338:17): [True: 283k, False: 0]
  ------------------
 5339|   283k|               --flow_depth;
 5340|   283k|               if (flow_depth == 0) {
  ------------------
  |  Branch (5340:20): [True: 92.1k, False: 191k]
  ------------------
 5341|  92.1k|                  key_supports_adjacent_value = true;
 5342|  92.1k|               }
 5343|   283k|               prev_was_whitespace = false;
 5344|   283k|               ++it;
 5345|   283k|               continue;
 5346|   283k|            }
 5347|      0|            return false;
 5348|   283k|         }
 5349|   170M|         if (c == ':' && flow_depth == 0) {
  ------------------
  |  Branch (5349:14): [True: 2.49M, False: 168M]
  |  Branch (5349:26): [True: 1.97M, False: 524k]
  ------------------
 5350|  1.97M|            const auto next = it + 1;
 5351|  1.97M|            if (next == end || *next == ' ' || *next == '\t' || *next == '\n' || *next == '\r') {
  ------------------
  |  Branch (5351:17): [True: 43.6k, False: 1.92M]
  |  Branch (5351:32): [True: 984k, False: 943k]
  |  Branch (5351:48): [True: 116k, False: 826k]
  |  Branch (5351:65): [True: 128k, False: 697k]
  |  Branch (5351:82): [True: 269k, False: 428k]
  ------------------
 5352|  1.54M|               return true;
 5353|  1.54M|            }
 5354|   428k|            if (key_supports_adjacent_value) {
  ------------------
  |  Branch (5354:17): [True: 43.2k, False: 384k]
  ------------------
 5355|  43.2k|               return true;
 5356|  43.2k|            }
 5357|   384k|            return false;
 5358|   428k|         }
 5359|       |
 5360|   168M|         key_supports_adjacent_value = false;
 5361|   168M|         prev_was_whitespace = (c == ' ' || c == '\t');
  ------------------
  |  Branch (5361:33): [True: 16.3M, False: 152M]
  |  Branch (5361:45): [True: 2.76M, False: 149M]
  ------------------
 5362|   168M|         ++it;
 5363|   168M|      }
 5364|       |
 5365|   433k|      return false;
 5366|  9.08M|   }
_ZZN3glz4fromILj450ENSt3__17variantIJDndNS1_12basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEbNS1_6vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS6_ISD_EEEENSC_ISD_EEEEEE2opITnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1ELb0ELb0ELb0ELb0ELj1EEERPKcRSH_TkNS_10is_contextERNS_4yaml12yaml_contextESM_EEvOT1_OT2_OT0_T3_ENKUlT_E0_clISM_EEDaSZ_:
 5848|  69.1k|            auto is_word_boundary = [&](const auto ptr) {
 5849|  69.1k|               if (ptr == end) {
  ------------------
  |  Branch (5849:20): [True: 5.00k, False: 64.1k]
  ------------------
 5850|  5.00k|                  return true;
 5851|  5.00k|               }
 5852|  64.1k|               if (*ptr == ':') {
  ------------------
  |  Branch (5852:20): [True: 40.2k, False: 23.9k]
  ------------------
 5853|  40.2k|                  auto next = ptr + 1;
 5854|  40.2k|                  return (next == end) || *next == ' ' || *next == '\t' || *next == '\n' || *next == '\r';
  ------------------
  |  Branch (5854:26): [True: 3.23k, False: 37.0k]
  |  Branch (5854:43): [True: 4.61k, False: 32.4k]
  |  Branch (5854:59): [True: 11.6k, False: 20.8k]
  |  Branch (5854:76): [True: 2.39k, False: 18.4k]
  |  Branch (5854:93): [True: 10.3k, False: 8.04k]
  ------------------
 5855|  40.2k|               }
 5856|  23.9k|               return is_plain_scalar_boundary(*ptr);
 5857|  64.1k|            };
_ZZN3glz4fromILj450ENSt3__17variantIJDndNS1_12basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEbNS1_6vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS6_ISD_EEEENSC_ISD_EEEEEE2opITnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1ELb0ELb0ELb0ELb0ELj1EEERPKcRSH_TkNS_10is_contextERNS_4yaml12yaml_contextESM_EEvOT1_OT2_OT0_T3_ENKUlcE_clEc:
 5774|  23.9k|            auto is_plain_scalar_boundary = [](const char ch) {
 5775|  23.9k|               switch (ch) {
 5776|    518|               case ' ':
  ------------------
  |  Branch (5776:16): [True: 518, False: 23.3k]
  ------------------
 5777|  1.19k|               case '\t':
  ------------------
  |  Branch (5777:16): [True: 673, False: 23.2k]
  ------------------
 5778|  6.86k|               case '\n':
  ------------------
  |  Branch (5778:16): [True: 5.67k, False: 18.2k]
  ------------------
 5779|  7.74k|               case '\r':
  ------------------
  |  Branch (5779:16): [True: 885, False: 23.0k]
  ------------------
 5780|  13.2k|               case ',':
  ------------------
  |  Branch (5780:16): [True: 5.53k, False: 18.3k]
  ------------------
 5781|  13.8k|               case ']':
  ------------------
  |  Branch (5781:16): [True: 586, False: 23.3k]
  ------------------
 5782|  17.8k|               case '}':
  ------------------
  |  Branch (5782:16): [True: 3.94k, False: 19.9k]
  ------------------
 5783|  17.8k|                  return true;
 5784|  6.09k|               default:
  ------------------
  |  Branch (5784:16): [True: 6.09k, False: 17.8k]
  ------------------
 5785|  6.09k|                  return false;
 5786|  23.9k|               }
 5787|  23.9k|            };
_ZZN3glz4fromILj450ENSt3__17variantIJDndNS1_12basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEbNS1_6vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS6_ISD_EEEENSC_ISD_EEEEEE2opITnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1ELb0ELb0ELb0ELb0ELj1EEERPKcRSH_TkNS_10is_contextERNS_4yaml12yaml_contextESM_EEvOT1_OT2_OT0_T3_ENKUlT_E_clISM_EEDaSZ_:
 5789|  55.0k|            auto has_indented_block_continuation = [&](auto word_end) {
 5790|  55.0k|               if constexpr (yaml::check_flow_context(Opts)) {
 5791|  55.0k|                  return false;
 5792|  55.0k|               }
 5793|  55.0k|               if (ctx.current_indent() < 0) {
  ------------------
  |  Branch (5793:20): [True: 0, False: 55.0k]
  ------------------
 5794|      0|                  return false;
 5795|      0|               }
 5796|  55.0k|               if (word_end == end || (*word_end != '\n' && *word_end != '\r')) {
  ------------------
  |  Branch (5796:20): [True: 55.0k, False: 0]
  |  Branch (5796:40): [True: 0, False: 0]
  |  Branch (5796:61): [True: 0, False: 0]
  ------------------
 5797|      0|                  return false;
 5798|      0|               }
 5799|       |
 5800|  55.0k|               auto look = word_end;
 5801|  55.0k|               yaml::skip_newline(look, end);
 5802|  55.0k|               while (look != end) {
  ------------------
  |  Branch (5802:23): [True: 0, False: 55.0k]
  ------------------
 5803|      0|                  int32_t line_indent = 0;
 5804|      0|                  while (look != end && *look == ' ') {
  ------------------
  |  Branch (5804:26): [True: 0, False: 0]
  |  Branch (5804:41): [True: 0, False: 0]
  ------------------
 5805|      0|                     ++line_indent;
 5806|      0|                     ++look;
 5807|      0|                  }
 5808|      0|                  if (look != end && *look == '\t') {
  ------------------
  |  Branch (5808:23): [True: 0, False: 0]
  |  Branch (5808:38): [True: 0, False: 0]
  ------------------
 5809|      0|                     return false;
 5810|      0|                  }
 5811|      0|                  if (look == end || *look == '\n' || *look == '\r') {
  ------------------
  |  Branch (5811:23): [True: 0, False: 0]
  |  Branch (5811:38): [True: 0, False: 0]
  |  Branch (5811:55): [True: 0, False: 0]
  ------------------
 5812|      0|                     if (look != end) {
  ------------------
  |  Branch (5812:26): [True: 0, False: 0]
  ------------------
 5813|      0|                        yaml::skip_newline(look, end);
 5814|      0|                        continue;
 5815|      0|                     }
 5816|      0|                     return false;
 5817|      0|                  }
 5818|      0|                  if (*look == '#') {
  ------------------
  |  Branch (5818:23): [True: 0, False: 0]
  ------------------
 5819|      0|                     yaml::skip_comment(look, end);
 5820|      0|                     if (look != end && (*look == '\n' || *look == '\r')) {
  ------------------
  |  Branch (5820:26): [True: 0, False: 0]
  |  Branch (5820:42): [True: 0, False: 0]
  |  Branch (5820:59): [True: 0, False: 0]
  ------------------
 5821|      0|                        yaml::skip_newline(look, end);
 5822|      0|                        continue;
 5823|      0|                     }
 5824|      0|                     return false;
 5825|      0|                  }
 5826|       |
 5827|       |                  // If the next non-empty line is an implicit mapping entry,
 5828|       |                  // don't treat it as scalar continuation for auto-deduced
 5829|       |                  // booleans/nulls.
 5830|      0|                  {
 5831|      0|                     auto scan = look;
 5832|      0|                     while (scan != end && *scan != '\n' && *scan != '\r') {
  ------------------
  |  Branch (5832:29): [True: 0, False: 0]
  |  Branch (5832:44): [True: 0, False: 0]
  |  Branch (5832:61): [True: 0, False: 0]
  ------------------
 5833|      0|                        if (*scan == ':') {
  ------------------
  |  Branch (5833:29): [True: 0, False: 0]
  ------------------
 5834|      0|                           auto after_colon = scan + 1;
 5835|      0|                           if (after_colon == end || *after_colon == ' ' || *after_colon == '\t' ||
  ------------------
  |  Branch (5835:32): [True: 0, False: 0]
  |  Branch (5835:54): [True: 0, False: 0]
  |  Branch (5835:77): [True: 0, False: 0]
  ------------------
 5836|      0|                               *after_colon == '\n' || *after_colon == '\r') {
  ------------------
  |  Branch (5836:32): [True: 0, False: 0]
  |  Branch (5836:56): [True: 0, False: 0]
  ------------------
 5837|      0|                              return false;
 5838|      0|                           }
 5839|      0|                        }
 5840|      0|                        ++scan;
 5841|      0|                     }
 5842|      0|                  }
 5843|       |
 5844|      0|                  return line_indent > ctx.current_indent();
 5845|      0|               }
 5846|  55.0k|               return false;
 5847|  55.0k|            };
_ZN3glz36try_parse_block_mapping_into_variantINSt3__17variantIJDndNS1_12basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEbNS1_6vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS6_ISD_EEEENSC_ISD_EEEEETnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1ELb0ELb0ELb0ELb0ELj1EEERSH_RNS_4yaml12yaml_contextERPKcSO_EEbOT1_OT2_OT3_T4_:
 5377|   888k|   {
 5378|   888k|      using counts = yaml_variant_type_count<Variant>;
 5379|       |      if constexpr (counts::n_object == 0) {
 5380|       |         return false;
 5381|       |      }
 5382|   888k|      else {
 5383|       |         // Quick check: if no viable mapping separator in the current span,
 5384|       |         // avoid expensive speculative parse.
 5385|   888k|         const bool could_be_mapping = [&] {
 5386|   888k|            if constexpr (yaml::check_flow_context(Opts)) {
 5387|   888k|               return line_could_be_flow_mapping(it, end);
 5388|   888k|            }
 5389|   888k|            else {
 5390|   888k|               return yaml::line_could_be_block_mapping(it, end);
 5391|   888k|            }
 5392|   888k|         }();
 5393|   888k|         if (!could_be_mapping) {
  ------------------
  |  Branch (5393:14): [True: 667k, False: 220k]
  ------------------
 5394|   667k|            return false;
 5395|   667k|         }
 5396|       |         // Full parse attempt - use a temporary context that inherits indent from parent
 5397|   220k|         auto temp_ctx = ctx.make_speculative();
 5398|   220k|         process_yaml_variant_alternatives<Variant, is_yaml_variant_object>::template op<Opts>(value, temp_ctx, it,
 5399|   220k|                                                                                               end);
 5400|   220k|         ctx.alias_expansion_budget = temp_ctx.alias_expansion_budget; // charged even if rejected
 5401|   220k|         ctx.key_expansion_budget = temp_ctx.key_expansion_budget;
 5402|   220k|         if (!bool(temp_ctx.error)) {
  ------------------
  |  Branch (5402:14): [True: 214k, False: 6.22k]
  ------------------
 5403|   214k|            ctx.anchors = std::move(temp_ctx.anchors);
 5404|   214k|            return true;
 5405|   214k|         }
 5406|       |         // The line matched "key: value" pattern but parsing failed.
 5407|       |         // This indicates malformed content (e.g., unclosed flow collection),
 5408|       |         // so propagate the error rather than silently falling back to string.
 5409|  6.22k|         ctx.error = temp_ctx.error;
 5410|  6.22k|         ctx.custom_error_message = temp_ctx.custom_error_message;
 5411|  6.22k|         return false;
 5412|   220k|      }
 5413|   888k|   }
_ZZN3glz36try_parse_block_mapping_into_variantINSt3__17variantIJDndNS1_12basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEbNS1_6vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS6_ISD_EEEENSC_ISD_EEEEETnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1ELb0ELb0ELb0ELb0ELj1EEERSH_RNS_4yaml12yaml_contextERPKcSO_EEbOT1_OT2_OT3_T4_ENKUlvE_clEv:
 5385|   888k|         const bool could_be_mapping = [&] {
 5386|   888k|            if constexpr (yaml::check_flow_context(Opts)) {
 5387|   888k|               return line_could_be_flow_mapping(it, end);
 5388|       |            }
 5389|       |            else {
 5390|       |               return yaml::line_could_be_block_mapping(it, end);
 5391|       |            }
 5392|   888k|         }();
_ZN3glz4yaml15materialize_keyILb1ENS0_12yaml_contextEEEbRNSt3__112basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEERNS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEERT0_:
   38|  3.99M|   {
   39|  3.99M|      if constexpr (empty_on_null) {
   40|  3.99M|         if (key_node.is_null()) {
  ------------------
  |  Branch (40:14): [True: 131k, False: 3.86M]
  ------------------
   41|   131k|            key.clear();
   42|   131k|            return true;
   43|   131k|         }
   44|  3.99M|      }
   45|  3.99M|      if (auto* s = key_node.template get_if<std::string>()) {
  ------------------
  |  Branch (45:17): [True: 901k, False: 3.09M]
  ------------------
   46|   901k|         key = *s;
   47|   901k|         return true;
   48|   901k|      }
   49|  3.09M|      key.clear();
   50|  3.09M|      (void)glz::write_json(key_node, key);
   51|  3.09M|      if constexpr (requires { ctx.charge_key_expansion(size_t{}); }) {
   52|  3.09M|         if (!ctx.charge_key_expansion(key.size())) [[unlikely]] {
  ------------------
  |  Branch (52:14): [True: 474, False: 3.09M]
  ------------------
   53|    474|            ctx.error = error_code::exceeded_max_expansion;
   54|    474|            ctx.custom_error_message = "complex key expansion";
   55|    474|            return false;
   56|    474|         }
   57|  3.09M|      }
   58|  3.09M|      return true;
   59|  3.99M|   }
_ZN3glz4yaml14parse_yaml_keyINS0_12yaml_contextEPKcS4_EEbRNSt3__112basic_stringIcNS5_11char_traitsIcEENS5_9allocatorIcEEEERT_RT0_T1_b:
 1524|  35.2M|      {
 1525|  35.2M|         key.clear();
 1526|  35.2M|         skip_inline_ws(it, end);
 1527|       |
 1528|  35.2M|         if (it == end) {
  ------------------
  |  Branch (1528:14): [True: 88, False: 35.2M]
  ------------------
 1529|     88|            ctx.error = error_code::unexpected_end;
 1530|     88|            return false;
 1531|     88|         }
 1532|       |
 1533|  35.2M|         auto validate_key_tag = [&](const yaml_tag tag) {
 1534|  35.2M|            if (tag == yaml_tag::unknown) {
 1535|  35.2M|               ctx.error = error_code::syntax_error;
 1536|  35.2M|               return false;
 1537|  35.2M|            }
 1538|  35.2M|            if (!tag_valid_for_string(tag)) {
 1539|  35.2M|               ctx.error = error_code::syntax_error;
 1540|  35.2M|               return false;
 1541|  35.2M|            }
 1542|  35.2M|            return true;
 1543|  35.2M|         };
 1544|       |
 1545|       |         // Tags on keys (e.g. "!!str : value")
 1546|  35.2M|         auto key_tag = parse_yaml_tag(it, end, ctx);
 1547|  35.2M|         if (!validate_key_tag(key_tag)) {
  ------------------
  |  Branch (1547:14): [True: 100, False: 35.2M]
  ------------------
 1548|    100|            return false;
 1549|    100|         }
 1550|  35.2M|         skip_inline_ws(it, end);
 1551|  35.2M|         if (it == end) {
  ------------------
  |  Branch (1551:14): [True: 102, False: 35.2M]
  ------------------
 1552|    102|            ctx.error = error_code::unexpected_end;
 1553|    102|            return false;
 1554|    102|         }
 1555|       |
 1556|       |         // Handle alias as key (*name resolves to anchor value)
 1557|  35.2M|         if (*it == '*') {
  ------------------
  |  Branch (1557:14): [True: 1.27M, False: 33.9M]
  ------------------
 1558|  1.27M|            ++it;
 1559|  1.27M|            auto name = parse_anchor_name(it, end);
 1560|  1.27M|            if (name.empty()) {
  ------------------
  |  Branch (1560:17): [True: 272, False: 1.27M]
  ------------------
 1561|    272|               ctx.error = error_code::syntax_error;
 1562|    272|               return false;
 1563|    272|            }
 1564|  1.27M|            auto anchor_it = ctx.anchors.find(name);
 1565|  1.27M|            if (anchor_it == ctx.anchors.end()) {
  ------------------
  |  Branch (1565:17): [True: 10.3k, False: 1.26M]
  ------------------
 1566|  10.3k|               ctx.error = error_code::syntax_error; // undefined alias
 1567|  10.3k|               return false;
 1568|  10.3k|            }
 1569|  1.26M|            auto& span = anchor_it->second;
 1570|  1.26M|            if (span.begin == span.end) {
  ------------------
  |  Branch (1570:17): [True: 22.5k, False: 1.24M]
  ------------------
 1571|  22.5k|               key.clear(); // empty anchor
 1572|  22.5k|            }
 1573|  1.24M|            else if (!ctx.charge_alias_expansion(static_cast<size_t>(span.end - span.begin))) [[unlikely]] {
  ------------------
  |  Branch (1573:22): [True: 6, False: 1.24M]
  ------------------
 1574|       |               // A key alias replays its anchor the same way a value alias does, and a complex
 1575|       |               // key hands the span to the full reader, so it is charged the same way.
 1576|      6|               ctx.error = error_code::exceeded_max_expansion;
 1577|      6|               ctx.custom_error_message = "alias expansion";
 1578|      6|               return false;
 1579|      6|            }
 1580|  1.24M|            else {
 1581|       |               // Replay the anchor span to extract the key string
 1582|  1.24M|               auto replay_it = span.begin;
 1583|  1.24M|               auto replay_end = span.end;
 1584|  1.24M|               if (*replay_it == '"') {
  ------------------
  |  Branch (1584:20): [True: 578, False: 1.24M]
  ------------------
 1585|    578|                  parse_double_quoted_string(key, ctx, replay_it, replay_end);
 1586|    578|               }
 1587|  1.24M|               else if (*replay_it == '\'') {
  ------------------
  |  Branch (1587:25): [True: 1.64k, False: 1.24M]
  ------------------
 1588|  1.64k|                  parse_single_quoted_string(key, ctx, replay_it, replay_end);
 1589|  1.64k|               }
 1590|  1.24M|               else if (*replay_it == '[' || *replay_it == '{') {
  ------------------
  |  Branch (1590:25): [True: 10.1k, False: 1.23M]
  |  Branch (1590:46): [True: 380k, False: 851k]
  ------------------
 1591|       |                  // Canonicalize complex alias keys (flow seq/map) to a stable string form.
 1592|   390k|                  glz::generic key_node{};
 1593|   390k|                  auto temp_ctx = ctx.make_speculative();
 1594|   390k|                  from<YAML, glz::generic>::template op<flow_context_on<opts{.error_on_unknown_keys = false}>()>(
 1595|   390k|                     key_node, temp_ctx, replay_it, replay_end);
 1596|   390k|                  ctx.alias_expansion_budget = temp_ctx.alias_expansion_budget; // charged even if rejected
 1597|   390k|                  ctx.key_expansion_budget = temp_ctx.key_expansion_budget;
 1598|   390k|                  if (bool(temp_ctx.error)) [[unlikely]] {
  ------------------
  |  Branch (1598:23): [True: 79.5k, False: 310k]
  ------------------
 1599|  79.5k|                     ctx.error = temp_ctx.error;
 1600|  79.5k|                     ctx.custom_error_message = temp_ctx.custom_error_message;
 1601|  79.5k|                     return false;
 1602|  79.5k|                  }
 1603|   310k|                  ctx.anchors = std::move(temp_ctx.anchors);
 1604|       |
 1605|   310k|                  if (!yaml::materialize_key<false>(key, key_node, ctx)) [[unlikely]] {
  ------------------
  |  Branch (1605:23): [True: 68, False: 310k]
  ------------------
 1606|     68|                     return false;
 1607|     68|                  }
 1608|   310k|               }
 1609|   851k|               else {
 1610|   851k|                  bool parse_structured_alias_key = false;
 1611|   851k|                  if (*replay_it == '-' &&
  ------------------
  |  Branch (1611:23): [True: 206k, False: 645k]
  ------------------
 1612|   206k|                      ((replay_it + 1) == replay_end ||
  ------------------
  |  Branch (1612:24): [True: 8.82k, False: 197k]
  ------------------
 1613|   197k|                       yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*(replay_it + 1))])) {
  ------------------
  |  Branch (1613:24): [True: 168k, False: 29.1k]
  ------------------
 1614|   177k|                     parse_structured_alias_key = true;
 1615|   177k|                  }
 1616|   674k|                  else {
 1617|   674k|                     auto scan = replay_it;
 1618|  27.0M|                     while (scan != replay_end) {
  ------------------
  |  Branch (1618:29): [True: 27.0M, False: 42.5k]
  ------------------
 1619|  27.0M|                        if (*scan == ':') {
  ------------------
  |  Branch (1619:29): [True: 434k, False: 26.5M]
  ------------------
 1620|   434k|                           const auto after_colon = scan + 1;
 1621|   434k|                           if (after_colon == replay_end ||
  ------------------
  |  Branch (1621:32): [True: 11.4k, False: 422k]
  ------------------
 1622|   422k|                               yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*after_colon)]) {
  ------------------
  |  Branch (1622:32): [True: 208k, False: 214k]
  ------------------
 1623|   219k|                              parse_structured_alias_key = true;
 1624|   219k|                              break;
 1625|   219k|                           }
 1626|   434k|                        }
 1627|  26.7M|                        if (*scan == '\n' || *scan == '\r') {
  ------------------
  |  Branch (1627:29): [True: 264k, False: 26.5M]
  |  Branch (1627:46): [True: 148k, False: 26.3M]
  ------------------
 1628|   412k|                           break;
 1629|   412k|                        }
 1630|  26.3M|                        ++scan;
 1631|  26.3M|                     }
 1632|   674k|                  }
 1633|   851k|                  if (!parse_structured_alias_key) {
  ------------------
  |  Branch (1633:23): [True: 454k, False: 397k]
  ------------------
 1634|  23.4M|                     for (auto p = replay_it; p != replay_end; ++p) {
  ------------------
  |  Branch (1634:47): [True: 23.3M, False: 42.5k]
  ------------------
 1635|  23.3M|                        if (*p == '\n' || *p == '\r') {
  ------------------
  |  Branch (1635:29): [True: 264k, False: 23.1M]
  |  Branch (1635:43): [True: 148k, False: 22.9M]
  ------------------
 1636|   412k|                           parse_structured_alias_key = true;
 1637|   412k|                           break;
 1638|   412k|                        }
 1639|  23.3M|                     }
 1640|   454k|                  }
 1641|       |
 1642|   851k|                  if (parse_structured_alias_key) {
  ------------------
  |  Branch (1642:23): [True: 809k, False: 42.5k]
  ------------------
 1643|   809k|                     glz::generic key_node{};
 1644|   809k|                     auto temp_ctx = ctx.make_speculative();
 1645|   809k|                     from<YAML, glz::generic>::template op<opts{.error_on_unknown_keys = false}>(key_node, temp_ctx,
 1646|   809k|                                                                                                 replay_it, replay_end);
 1647|   809k|                     ctx.alias_expansion_budget = temp_ctx.alias_expansion_budget; // charged even if rejected
 1648|   809k|                     ctx.key_expansion_budget = temp_ctx.key_expansion_budget;
 1649|   809k|                     if (bool(temp_ctx.error)) [[unlikely]] {
  ------------------
  |  Branch (1649:26): [True: 141k, False: 668k]
  ------------------
 1650|   141k|                        ctx.error = temp_ctx.error;
 1651|   141k|                        ctx.custom_error_message = temp_ctx.custom_error_message;
 1652|   141k|                        return false;
 1653|   141k|                     }
 1654|   668k|                     ctx.anchors = std::move(temp_ctx.anchors);
 1655|       |
 1656|   668k|                     if (!yaml::materialize_key<false>(key, key_node, ctx)) [[unlikely]] {
  ------------------
  |  Branch (1656:26): [True: 30, False: 668k]
  ------------------
 1657|     30|                        return false;
 1658|     30|                     }
 1659|   668k|                  }
 1660|  42.5k|                  else {
 1661|  42.5k|                     parse_plain_scalar(key, ctx, replay_it, replay_end, false);
 1662|  42.5k|                  }
 1663|   851k|               }
 1664|  1.24M|            }
 1665|  1.04M|            return !bool(ctx.error);
 1666|  1.26M|         }
 1667|       |
 1668|       |         // Handle anchor on key (&name before key text)
 1669|  33.9M|         bool has_key_anchor = false;
 1670|  33.9M|         std::string key_anchor_name;
 1671|  33.9M|         if (*it == '&') {
  ------------------
  |  Branch (1671:14): [True: 4.43M, False: 29.5M]
  ------------------
 1672|  4.43M|            ++it;
 1673|  4.43M|            auto name = parse_anchor_name(it, end);
 1674|  4.43M|            if (name.empty()) {
  ------------------
  |  Branch (1674:17): [True: 374, False: 4.43M]
  ------------------
 1675|    374|               ctx.error = error_code::syntax_error;
 1676|    374|               return false;
 1677|    374|            }
 1678|  4.43M|            skip_inline_ws(it, end);
 1679|  4.43M|            if (it == end) {
  ------------------
  |  Branch (1679:17): [True: 520, False: 4.43M]
  ------------------
 1680|    520|               ctx.error = error_code::unexpected_end;
 1681|    520|               return false;
 1682|    520|            }
 1683|       |            // Anchor on alias is invalid per YAML spec
 1684|  4.43M|            if (*it == '*') {
  ------------------
  |  Branch (1684:17): [True: 28, False: 4.43M]
  ------------------
 1685|     28|               ctx.error = error_code::syntax_error;
 1686|     28|               return false;
 1687|     28|            }
 1688|  4.43M|            has_key_anchor = true;
 1689|  4.43M|            key_anchor_name = std::string(name);
 1690|  4.43M|         }
 1691|       |
 1692|       |         // Allow node-property order "&anchor !!str key: value" for mapping keys.
 1693|  33.9M|         if (*it == '!') {
  ------------------
  |  Branch (1693:14): [True: 6.34k, False: 33.9M]
  ------------------
 1694|  6.34k|            if (key_tag != yaml_tag::none) {
  ------------------
  |  Branch (1694:17): [True: 10, False: 6.33k]
  ------------------
 1695|       |               // Duplicate tag properties on the same key node are malformed.
 1696|     10|               ctx.error = error_code::syntax_error;
 1697|     10|               return false;
 1698|     10|            }
 1699|  6.33k|            key_tag = parse_yaml_tag(it, end, ctx);
 1700|  6.33k|            if (!validate_key_tag(key_tag)) {
  ------------------
  |  Branch (1700:17): [True: 40, False: 6.29k]
  ------------------
 1701|     40|               return false;
 1702|     40|            }
 1703|  6.29k|            skip_inline_ws(it, end);
 1704|  6.29k|            if (it == end) {
  ------------------
  |  Branch (1704:17): [True: 30, False: 6.26k]
  ------------------
 1705|     30|               ctx.error = error_code::unexpected_end;
 1706|     30|               return false;
 1707|     30|            }
 1708|  6.29k|         }
 1709|       |
 1710|  33.9M|         const char* key_start = &*it;
 1711|  33.9M|         bool quoted_key_spans_lines = false;
 1712|       |
 1713|  33.9M|         if (*it == '"') {
  ------------------
  |  Branch (1713:14): [True: 160k, False: 33.7M]
  ------------------
 1714|   160k|            auto quoted_start = it;
 1715|   160k|            parse_double_quoted_string(key, ctx, it, end);
 1716|   160k|            if (!bool(ctx.error)) {
  ------------------
  |  Branch (1716:17): [True: 160k, False: 310]
  ------------------
 1717|  2.16M|               for (auto p = quoted_start; p != it; ++p) {
  ------------------
  |  Branch (1717:44): [True: 2.02M, False: 145k]
  ------------------
 1718|  2.02M|                  if (*p == '\n' || *p == '\r') {
  ------------------
  |  Branch (1718:23): [True: 13.3k, False: 2.00M]
  |  Branch (1718:37): [True: 1.63k, False: 2.00M]
  ------------------
 1719|  14.9k|                     quoted_key_spans_lines = true;
 1720|  14.9k|                     break;
 1721|  14.9k|                  }
 1722|  2.02M|               }
 1723|   160k|            }
 1724|   160k|         }
 1725|  33.7M|         else if (*it == '\'') {
  ------------------
  |  Branch (1725:19): [True: 119k, False: 33.6M]
  ------------------
 1726|   119k|            auto quoted_start = it;
 1727|   119k|            parse_single_quoted_string(key, ctx, it, end);
 1728|   119k|            if (!bool(ctx.error)) {
  ------------------
  |  Branch (1728:17): [True: 118k, False: 440]
  ------------------
 1729|   750k|               for (auto p = quoted_start; p != it; ++p) {
  ------------------
  |  Branch (1729:44): [True: 739k, False: 11.3k]
  ------------------
 1730|   739k|                  if (*p == '\n' || *p == '\r') {
  ------------------
  |  Branch (1730:23): [True: 104k, False: 634k]
  |  Branch (1730:37): [True: 2.89k, False: 631k]
  ------------------
 1731|   107k|                     quoted_key_spans_lines = true;
 1732|   107k|                     break;
 1733|   107k|                  }
 1734|   739k|               }
 1735|   118k|            }
 1736|   119k|         }
 1737|  33.6M|         else {
 1738|       |            // Plain key - read until colon
 1739|   839M|            while (it != end) {
  ------------------
  |  Branch (1739:20): [True: 839M, False: 12.9k]
  ------------------
 1740|   839M|               const char c = *it;
 1741|   839M|               if (c == ':') {
  ------------------
  |  Branch (1741:20): [True: 22.2M, False: 817M]
  ------------------
 1742|       |                  // Check if this ends the key
 1743|  22.2M|                  if ((it + 1) == end || *(it + 1) == ' ' || *(it + 1) == '\t' || *(it + 1) == '\n' ||
  ------------------
  |  Branch (1743:23): [True: 92.7k, False: 22.1M]
  |  Branch (1743:42): [True: 5.10M, False: 17.0M]
  |  Branch (1743:62): [True: 3.14M, False: 13.8M]
  |  Branch (1743:83): [True: 906k, False: 12.9M]
  ------------------
 1744|  14.1M|                      *(it + 1) == '\r') {
  ------------------
  |  Branch (1744:23): [True: 4.92M, False: 8.03M]
  ------------------
 1745|  14.1M|                     break;
 1746|  14.1M|                  }
 1747|  8.03M|                  if (in_flow && (*(it + 1) == ',' || *(it + 1) == ']' || *(it + 1) == '}')) {
  ------------------
  |  Branch (1747:23): [True: 6.09M, False: 1.93M]
  |  Branch (1747:35): [True: 55.9k, False: 6.04M]
  |  Branch (1747:55): [True: 32, False: 6.04M]
  |  Branch (1747:75): [True: 61.3k, False: 5.98M]
  ------------------
 1748|   117k|                     break;
 1749|   117k|                  }
 1750|  8.03M|               }
 1751|   825M|               if (c == '\n' || c == '\r') {
  ------------------
  |  Branch (1751:20): [True: 16.9M, False: 808M]
  |  Branch (1751:33): [True: 8.44M, False: 800M]
  ------------------
 1752|  25.3M|                  if (!in_flow) break;
  ------------------
  |  Branch (1752:23): [True: 2.80k, False: 25.3M]
  ------------------
 1753|       |
 1754|  25.3M|                  auto continuation = it;
 1755|  25.3M|                  skip_newline(continuation, end);
 1756|  25.3M|                  int32_t continuation_indent = 0;
 1757|  42.2M|                  while (continuation != end && (*continuation == ' ' || *continuation == '\t')) {
  ------------------
  |  Branch (1757:26): [True: 42.2M, False: 264]
  |  Branch (1757:50): [True: 14.2M, False: 28.0M]
  |  Branch (1757:74): [True: 2.66M, False: 25.3M]
  ------------------
 1758|  16.8M|                     if (*continuation == ' ') ++continuation_indent;
  ------------------
  |  Branch (1758:26): [True: 14.2M, False: 2.66M]
  ------------------
 1759|  16.8M|                     ++continuation;
 1760|  16.8M|                  }
 1761|       |
 1762|  25.3M|                  if (continuation == end) {
  ------------------
  |  Branch (1762:23): [True: 264, False: 25.3M]
  ------------------
 1763|    264|                     break;
 1764|    264|                  }
 1765|       |
 1766|  25.3M|                  if (*continuation == '#') {
  ------------------
  |  Branch (1766:23): [True: 637k, False: 24.7M]
  ------------------
 1767|   637k|                     it = continuation;
 1768|   637k|                     skip_comment(it, end);
 1769|   637k|                     if (it != end && (*it == '\n' || *it == '\r')) {
  ------------------
  |  Branch (1769:26): [True: 637k, False: 44]
  |  Branch (1769:40): [True: 583k, False: 53.9k]
  |  Branch (1769:55): [True: 53.9k, False: 0]
  ------------------
 1770|   637k|                        skip_newline(it, end);
 1771|   637k|                        continue;
 1772|   637k|                     }
 1773|     44|                     break;
 1774|   637k|                  }
 1775|       |
 1776|       |                  // A continuation line starting with flow terminators or ':' does
 1777|       |                  // not belong to the key content.
 1778|  24.7M|                  if (*continuation == ',' || *continuation == ']' || *continuation == '}' || *continuation == ':') {
  ------------------
  |  Branch (1778:23): [True: 415k, False: 24.3M]
  |  Branch (1778:47): [True: 22, False: 24.3M]
  |  Branch (1778:71): [True: 98.3k, False: 24.2M]
  |  Branch (1778:95): [True: 917k, False: 23.3M]
  ------------------
 1779|  1.43M|                     break;
 1780|  1.43M|                  }
 1781|       |
 1782|  23.3M|                  if (ctx.explicit_mapping_key_context) {
  ------------------
  |  Branch (1782:23): [True: 17.7k, False: 23.2M]
  ------------------
 1783|  17.7k|                     if (*continuation == '?' || *continuation == ':') {
  ------------------
  |  Branch (1783:26): [True: 1.80k, False: 15.9k]
  |  Branch (1783:50): [True: 0, False: 15.9k]
  ------------------
 1784|  1.80k|                        auto after = continuation + 1;
 1785|  1.80k|                        if (after == end || *after == ' ' || *after == '\t' || *after == '\n' || *after == '\r') {
  ------------------
  |  Branch (1785:29): [True: 8, False: 1.79k]
  |  Branch (1785:45): [True: 6, False: 1.79k]
  |  Branch (1785:62): [True: 6, False: 1.78k]
  |  Branch (1785:80): [True: 6, False: 1.77k]
  |  Branch (1785:98): [True: 10, False: 1.76k]
  ------------------
 1786|     36|                           break;
 1787|     36|                        }
 1788|  1.80k|                     }
 1789|       |
 1790|  17.7k|                     if (*continuation == '&' || *continuation == '*' || *continuation == '!') {
  ------------------
  |  Branch (1790:26): [True: 10, False: 17.7k]
  |  Branch (1790:50): [True: 12, False: 17.7k]
  |  Branch (1790:74): [True: 10, False: 17.7k]
  ------------------
 1791|     32|                        break;
 1792|     32|                     }
 1793|       |
 1794|  17.7k|                     if (*continuation == '-') {
  ------------------
  |  Branch (1794:26): [True: 1.03k, False: 16.6k]
  ------------------
 1795|  1.03k|                        auto after = continuation + 1;
 1796|  1.03k|                        if (after == end || *after == ' ' || *after == '\t' || *after == '\n' || *after == '\r') {
  ------------------
  |  Branch (1796:29): [True: 6, False: 1.02k]
  |  Branch (1796:45): [True: 6, False: 1.02k]
  |  Branch (1796:62): [True: 6, False: 1.01k]
  |  Branch (1796:80): [True: 6, False: 1.01k]
  |  Branch (1796:98): [True: 6, False: 1.00k]
  ------------------
 1797|     30|                           break;
 1798|     30|                        }
 1799|  1.03k|                     }
 1800|       |
 1801|  17.6k|                     if (ctx.current_indent() >= 0 && continuation_indent <= ctx.current_indent()) {
  ------------------
  |  Branch (1801:26): [True: 1.14k, False: 16.5k]
  |  Branch (1801:55): [True: 934, False: 214]
  ------------------
 1802|    934|                        break;
 1803|    934|                     }
 1804|       |
 1805|       |                     // A continuation line that contains an implicit mapping-key
 1806|       |                     // indicator (": " / ":\n") starts a new entry, not key text.
 1807|  16.7k|                     {
 1808|  16.7k|                        auto scan = continuation;
 1809|   117k|                        while (scan != end && *scan != '\n' && *scan != '\r') {
  ------------------
  |  Branch (1809:32): [True: 117k, False: 562]
  |  Branch (1809:47): [True: 115k, False: 2.04k]
  |  Branch (1809:64): [True: 101k, False: 14.0k]
  ------------------
 1810|   101k|                           if (*scan == ':') {
  ------------------
  |  Branch (1810:32): [True: 1.87k, False: 99.1k]
  ------------------
 1811|  1.87k|                              auto after_colon = scan + 1;
 1812|  1.87k|                              const bool tight_key_colon =
 1813|  1.87k|                                 (scan == continuation) || (*(scan - 1) != ' ' && *(scan - 1) != '\t');
  ------------------
  |  Branch (1813:34): [True: 0, False: 1.87k]
  |  Branch (1813:61): [True: 824, False: 1.04k]
  |  Branch (1813:83): [True: 758, False: 66]
  ------------------
 1814|  1.87k|                              if (tight_key_colon &&
  ------------------
  |  Branch (1814:35): [True: 758, False: 1.11k]
  ------------------
 1815|    758|                                  (after_colon == end || *after_colon == ' ' || *after_colon == '\t' ||
  ------------------
  |  Branch (1815:36): [True: 20, False: 738]
  |  Branch (1815:58): [True: 16, False: 722]
  |  Branch (1815:81): [True: 6, False: 716]
  ------------------
 1816|    716|                                   *after_colon == '\n' || *after_colon == '\r')) {
  ------------------
  |  Branch (1816:36): [True: 10, False: 706]
  |  Branch (1816:60): [True: 6, False: 700]
  ------------------
 1817|     58|                                 break;
 1818|     58|                              }
 1819|  1.87k|                           }
 1820|   100k|                           ++scan;
 1821|   100k|                        }
 1822|  16.7k|                        if (scan != end && *scan == ':') {
  ------------------
  |  Branch (1822:29): [True: 16.1k, False: 562]
  |  Branch (1822:44): [True: 58, False: 16.1k]
  ------------------
 1823|     58|                           break;
 1824|     58|                        }
 1825|  16.7k|                     }
 1826|  16.7k|                  }
 1827|       |
 1828|  23.3M|                  if (!key.empty() && key.back() != ' ') {
  ------------------
  |  Branch (1828:23): [True: 22.9M, False: 396k]
  |  Branch (1828:39): [True: 13.0M, False: 9.90M]
  ------------------
 1829|  13.0M|                     key.push_back(' ');
 1830|  13.0M|                  }
 1831|  23.3M|                  it = continuation;
 1832|  23.3M|                  continue;
 1833|  23.3M|               }
 1834|   800M|               if (in_flow && (c == ',' || c == ']' || c == '}')) break;
  ------------------
  |  Branch (1834:20): [True: 704M, False: 95.8M]
  |  Branch (1834:32): [True: 17.1M, False: 687M]
  |  Branch (1834:44): [True: 348, False: 687M]
  |  Branch (1834:56): [True: 666k, False: 686M]
  ------------------
 1835|   782M|               if (c == '#') {
  ------------------
  |  Branch (1835:20): [True: 14.6M, False: 767M]
  ------------------
 1836|  14.6M|                  if (key.empty() || key.back() == ' ' || key.back() == '\t') break;
  ------------------
  |  Branch (1836:23): [True: 14.8k, False: 14.6M]
  |  Branch (1836:38): [True: 44.9k, False: 14.5M]
  |  Branch (1836:59): [True: 3.05k, False: 14.5M]
  ------------------
 1837|  14.6M|               }
 1838|       |
 1839|   782M|               key.push_back(c);
 1840|   782M|               ++it;
 1841|   782M|            }
 1842|       |
 1843|       |            // Trim trailing whitespace from key
 1844|  38.6M|            while (!key.empty() && (key.back() == ' ' || key.back() == '\t')) {
  ------------------
  |  Branch (1844:20): [True: 32.4M, False: 6.19M]
  |  Branch (1844:37): [True: 4.33M, False: 28.0M]
  |  Branch (1844:58): [True: 632k, False: 27.4M]
  ------------------
 1845|  4.96M|               key.pop_back();
 1846|  4.96M|            }
 1847|       |
 1848|       |            // Empty keys are valid YAML (":" in block or flow mappings).
 1849|  33.6M|         }
 1850|       |
 1851|  33.9M|         if (bool(ctx.error)) return false;
  ------------------
  |  Branch (1851:14): [True: 750, False: 33.9M]
  ------------------
 1852|       |
 1853|       |         // Implicit mapping keys must be single-line in both block and flow styles.
 1854|  33.9M|         if (quoted_key_spans_lines && !in_flow) {
  ------------------
  |  Branch (1854:14): [True: 122k, False: 33.8M]
  |  Branch (1854:40): [True: 98, False: 122k]
  ------------------
 1855|     98|            ctx.error = error_code::syntax_error;
 1856|     98|            return false;
 1857|     98|         }
 1858|       |
 1859|       |         // Store anchor on key if present
 1860|  33.9M|         if (has_key_anchor) {
  ------------------
  |  Branch (1860:14): [True: 4.43M, False: 29.5M]
  ------------------
 1861|  4.43M|            ctx.anchors[std::move(key_anchor_name)] = {key_start, &*it, ctx.current_indent()};
 1862|  4.43M|         }
 1863|       |
 1864|  33.9M|         return true;
 1865|  33.9M|      }
_ZZN3glz4yaml14parse_yaml_keyINS0_12yaml_contextEPKcS4_EEbRNSt3__112basic_stringIcNS5_11char_traitsIcEENS5_9allocatorIcEEEERT_RT0_T1_bENKUlNS0_8yaml_tagEE_clESI_:
 1533|  35.2M|         auto validate_key_tag = [&](const yaml_tag tag) {
 1534|  35.2M|            if (tag == yaml_tag::unknown) {
  ------------------
  |  Branch (1534:17): [True: 86, False: 35.2M]
  ------------------
 1535|     86|               ctx.error = error_code::syntax_error;
 1536|     86|               return false;
 1537|     86|            }
 1538|  35.2M|            if (!tag_valid_for_string(tag)) {
  ------------------
  |  Branch (1538:17): [True: 54, False: 35.2M]
  ------------------
 1539|     54|               ctx.error = error_code::syntax_error;
 1540|     54|               return false;
 1541|     54|            }
 1542|  35.2M|            return true;
 1543|  35.2M|         };
_ZN3glz4fromILj450ENS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEEE2opITnDaXtlNS_4optsELj10ELb1ELb0ELb0ELb1ELb0ELb0ELb0ELb0ELj1EEERS4_TkNS_10is_contextERNS_4yaml12yaml_contextERPKcSD_EEvOT0_OT1_OT2_T3_:
  274|  8.73M|      {
  275|  8.73M|         using V = std::decay_t<decltype(get_member(std::declval<Value>(), meta_wrapper_v<T>))>;
  276|  8.73M|         from<YAML, V>::template op<Opts>(get_member(std::forward<Value>(value), meta_wrapper_v<T>),
  277|  8.73M|                                          std::forward<Ctx>(ctx), std::forward<It0>(it), end);
  278|  8.73M|      }
_ZN3glz4fromILj450ENSt3__17variantIJDndNS1_12basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEbNS1_6vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS6_ISD_EEEENSC_ISD_EEEEEE2opITnDaXtlNS_4optsELj10ELb1ELb0ELb0ELb1ELb0ELb0ELb0ELb0ELj1EEERPKcRSH_TkNS_10is_contextERNS_4yaml12yaml_contextESM_EEvOT1_OT2_OT0_T3_:
 5635|  12.9M|      {
 5636|       |         // Inside op() rather than at class scope: read_supported is `requires { from<Format, T>{}; }`,
 5637|       |         // so a class-scope assert turns that feature probe into a hard error instead of `false`.
 5638|  12.9M|         static_assert(content_v<std::remove_cvref_t<T>>.empty(),
 5639|  12.9M|                       "Adjacent variant tagging (glz::meta `content`) is implemented for JSON and "
 5640|  12.9M|                       "BEVE but not yet for YAML. Reading this variant as YAML would silently expect "
 5641|  12.9M|                       "the internally tagged shape, so it is rejected here instead.");
 5642|  12.9M|         if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (5642:14): [True: 0, False: 12.9M]
  ------------------
 5643|      0|            return;
 5644|       |
 5645|       |         // Every nested generic/variant value routes back through this reader, so bounding
 5646|       |         // depth here caps flow-collection and flow-embedded mapping recursion that the
 5647|       |         // indent stack does not cover.
 5648|  12.9M|         depth_guard guard{ctx, yaml::max_yaml_recursive_depth};
 5649|  12.9M|         if (!guard) [[unlikely]]
  ------------------
  |  Branch (5649:14): [True: 2.47k, False: 12.9M]
  ------------------
 5650|  2.47k|            return;
 5651|       |
 5652|       |         // At root level (indent == -1), skip leading whitespace, newlines, and comments
 5653|       |         // For nested values, only skip inline whitespace to preserve block structure
 5654|  12.9M|         if (ctx.current_indent() < 0) {
  ------------------
  |  Branch (5654:14): [True: 10.2M, False: 2.71M]
  ------------------
 5655|  10.2M|            yaml::skip_ws_newlines_comments(it, end);
 5656|  10.2M|         }
 5657|  2.71M|         else {
 5658|  2.71M|            yaml::skip_inline_ws(it, end);
 5659|  2.71M|         }
 5660|       |
 5661|  12.9M|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (5661:14): [True: 116, False: 12.9M]
  ------------------
 5662|    116|            ctx.error = error_code::unexpected_end;
 5663|    116|            return;
 5664|    116|         }
 5665|       |
 5666|       |         // Tagged variants: a discriminator key (meta::tag) selects the alternative, with the
 5667|       |         // matching meta::ids entry naming each type. This mirrors the JSON behavior so the
 5668|       |         // same variant definitions round-trip across both formats.
 5669|       |         if constexpr (not tag_v<std::remove_cvref_t<T>>.empty()) {
 5670|       |            using V = std::remove_cvref_t<T>;
 5671|       |            const bool value_is_mapping =
 5672|       |               (*it == '{') || (!yaml::check_flow_context(Opts) && yaml::line_could_be_block_mapping(it, end));
 5673|       |            if (value_is_mapping) {
 5674|       |               // The mapping's keys sit at the column of `it`. Recover that column from the buffer:
 5675|       |               // the indent stack carries the parent context's indent (a struct member, a sequence
 5676|       |               // item, etc. each push a different offset), not this mapping's true column (see helper).
 5677|       |               const int32_t mapping_column = tagged_mapping_visual_indent(ctx, it, ctx.current_indent() + 1);
 5678|       |               auto tag_ctx = ctx.make_speculative();
 5679|       |               const size_t index = scan_variant_tag_index<V, Opts>(tag_ctx, it, end, mapping_column);
 5680|       |               ctx.alias_expansion_budget = tag_ctx.alias_expansion_budget; // charged even if no tag matched
 5681|       |               ctx.key_expansion_budget = tag_ctx.key_expansion_budget;
 5682|       |               if (index < ids_v<V>.size()) {
 5683|       |                  static constexpr auto tag_literal = string_literal_from_view<tag_v<V>.size()>(tag_v<V>);
 5684|       |                  emplace_runtime_variant(value, index);
 5685|       |                  // Establish the mapping's true column on the indent stack for the alternative parse.
 5686|       |                  // The chosen object is then parsed - and the discriminator's inline value skipped -
 5687|       |                  // at a consistent indent in every context, so a tag on the first key does not fold
 5688|       |                  // the following sibling entries into its value (no special-casing needed downstream).
 5689|       |                  if (!ctx.push_indent(mapping_column)) [[unlikely]] {
 5690|       |                     ctx.error = error_code::exceeded_max_recursive_depth;
 5691|       |                     return;
 5692|       |                  }
 5693|       |                  std::visit(
 5694|       |                     [&](auto&& alt) {
 5695|       |                        using Alt = std::remove_cvref_t<decltype(alt)>;
 5696|       |                        if constexpr ((glaze_object_t<Alt> || reflectable<Alt>) && not custom_read<Alt>) {
 5697|       |                           // Parse the mapping into the resolved struct; the tag key is skipped.
 5698|       |                           from<YAML, Alt>::template op<Opts, tag_literal>(alt, ctx, it, end);
 5699|       |                        }
 5700|       |                        else if constexpr (custom_read<Alt>) {
 5701|       |                           // Custom alternatives read the mapping body themselves and cannot skip an
 5702|       |                           // interior tag key the way reflected objects do, so the tag must be the
 5703|       |                           // first key (glaze always writes it first). Consume that leading "tag: id"
 5704|       |                           // entry, then hand the remaining mapping to the custom handler.
 5705|       |                           if constexpr (yaml::check_flow_context(Opts)) {
 5706|       |                              ctx.error = error_code::feature_not_supported;
 5707|       |                              ctx.custom_error_message =
 5708|       |                                 "custom variant alternatives are not supported in YAML flow style";
 5709|       |                           }
 5710|       |                           else {
 5711|       |                              ctx.scratch.clear();
 5712|       |                              if (yaml::parse_yaml_key(ctx.scratch, ctx, it, end, false)) {
 5713|       |                                 if (std::string_view{ctx.scratch} != tag_v<V>) {
 5714|       |                                    ctx.error = error_code::feature_not_supported;
 5715|       |                                    ctx.custom_error_message =
 5716|       |                                       "the tag must be the first key for a custom variant alternative";
 5717|       |                                 }
 5718|       |                                 else {
 5719|       |                                    yaml::skip_inline_ws(it, end);
 5720|       |                                    if (it == end || *it != ':') {
 5721|       |                                       ctx.error = error_code::syntax_error;
 5722|       |                                    }
 5723|       |                                    else {
 5724|       |                                       ++it;
 5725|       |                                       yaml::skip_inline_ws(it, end);
 5726|       |                                       yaml::skip_unknown_block_value<Opts>(ctx, it, end, mapping_column);
 5727|       |                                       if (!bool(ctx.error)) {
 5728|       |                                          // If nothing but trailing whitespace/comments remains, the tag
 5729|       |                                          // was the whole mapping: leave the alternative default.
 5730|       |                                          auto probe = it;
 5731|       |                                          yaml::skip_ws_newlines_comments(probe, end);
 5732|       |                                          if (probe == end) {
 5733|       |                                             it = probe;
 5734|       |                                          }
 5735|       |                                          else {
 5736|       |                                             // Publish the mapping's column so the custom handler's block
 5737|       |                                             // mapping (which would otherwise discover its own indent) reads
 5738|       |                                             // the remaining entries at the variant's indent and dedents
 5739|       |                                             // correctly in every context (root, sequence, nested).
 5740|       |                                             ctx.forced_block_mapping_indent = mapping_column;
 5741|       |                                             from<YAML, Alt>::template op<Opts>(alt, ctx, it, end);
 5742|       |                                             ctx.forced_block_mapping_indent = -1;
 5743|       |                                          }
 5744|       |                                       }
 5745|       |                                    }
 5746|       |                                 }
 5747|       |                              }
 5748|       |                           }
 5749|       |                        }
 5750|       |                        else {
 5751|       |                           // Non-object alternative (e.g. std::monostate): the emplaced default is
 5752|       |                           // the value, but the mapping must still be consumed.
 5753|       |                           walk_tagged_mapping<Opts>(
 5754|       |                              ctx, it, end, tag_v<V>, mapping_column,
 5755|       |                              [&](auto&& c, auto&& i, auto&& e, int32_t line_indent, bool in_flow) {
 5756|       |                                 yaml::skip_yaml_value<Opts>(c, i, e, in_flow ? 0 : line_indent, in_flow);
 5757|       |                              });
 5758|       |                        }
 5759|       |                     },
 5760|       |                     value);
 5761|       |                  ctx.pop_indent();
 5762|       |                  return;
 5763|       |               }
 5764|       |               // No resolvable tag key was found. Fall through to structural deduction:
 5765|       |               // if the alternatives are distinguishable by their fields this still succeeds,
 5766|       |               // otherwise the deduction path reports no_matching_variant_type.
 5767|       |            }
 5768|       |         }
 5769|       |
 5770|  12.9M|         if constexpr (yaml_variant_is_auto_deducible<std::remove_cvref_t<T>>()) {
 5771|  12.9M|            using V = std::remove_cvref_t<T>;
 5772|  12.9M|            using counts = yaml_variant_type_count<V>;
 5773|  12.9M|            const char c = *it;
 5774|  12.9M|            auto is_plain_scalar_boundary = [](const char ch) {
 5775|  12.9M|               switch (ch) {
 5776|  12.9M|               case ' ':
 5777|  12.9M|               case '\t':
 5778|  12.9M|               case '\n':
 5779|  12.9M|               case '\r':
 5780|  12.9M|               case ',':
 5781|  12.9M|               case ']':
 5782|  12.9M|               case '}':
 5783|  12.9M|                  return true;
 5784|  12.9M|               default:
 5785|  12.9M|                  return false;
 5786|  12.9M|               }
 5787|  12.9M|            };
 5788|       |
 5789|  12.9M|            auto has_indented_block_continuation = [&](auto word_end) {
 5790|  12.9M|               if constexpr (yaml::check_flow_context(Opts)) {
 5791|  12.9M|                  return false;
 5792|  12.9M|               }
 5793|  12.9M|               if (ctx.current_indent() < 0) {
 5794|  12.9M|                  return false;
 5795|  12.9M|               }
 5796|  12.9M|               if (word_end == end || (*word_end != '\n' && *word_end != '\r')) {
 5797|  12.9M|                  return false;
 5798|  12.9M|               }
 5799|       |
 5800|  12.9M|               auto look = word_end;
 5801|  12.9M|               yaml::skip_newline(look, end);
 5802|  12.9M|               while (look != end) {
 5803|  12.9M|                  int32_t line_indent = 0;
 5804|  12.9M|                  while (look != end && *look == ' ') {
 5805|  12.9M|                     ++line_indent;
 5806|  12.9M|                     ++look;
 5807|  12.9M|                  }
 5808|  12.9M|                  if (look != end && *look == '\t') {
 5809|  12.9M|                     return false;
 5810|  12.9M|                  }
 5811|  12.9M|                  if (look == end || *look == '\n' || *look == '\r') {
 5812|  12.9M|                     if (look != end) {
 5813|  12.9M|                        yaml::skip_newline(look, end);
 5814|  12.9M|                        continue;
 5815|  12.9M|                     }
 5816|  12.9M|                     return false;
 5817|  12.9M|                  }
 5818|  12.9M|                  if (*look == '#') {
 5819|  12.9M|                     yaml::skip_comment(look, end);
 5820|  12.9M|                     if (look != end && (*look == '\n' || *look == '\r')) {
 5821|  12.9M|                        yaml::skip_newline(look, end);
 5822|  12.9M|                        continue;
 5823|  12.9M|                     }
 5824|  12.9M|                     return false;
 5825|  12.9M|                  }
 5826|       |
 5827|       |                  // If the next non-empty line is an implicit mapping entry,
 5828|       |                  // don't treat it as scalar continuation for auto-deduced
 5829|       |                  // booleans/nulls.
 5830|  12.9M|                  {
 5831|  12.9M|                     auto scan = look;
 5832|  12.9M|                     while (scan != end && *scan != '\n' && *scan != '\r') {
 5833|  12.9M|                        if (*scan == ':') {
 5834|  12.9M|                           auto after_colon = scan + 1;
 5835|  12.9M|                           if (after_colon == end || *after_colon == ' ' || *after_colon == '\t' ||
 5836|  12.9M|                               *after_colon == '\n' || *after_colon == '\r') {
 5837|  12.9M|                              return false;
 5838|  12.9M|                           }
 5839|  12.9M|                        }
 5840|  12.9M|                        ++scan;
 5841|  12.9M|                     }
 5842|  12.9M|                  }
 5843|       |
 5844|  12.9M|                  return line_indent > ctx.current_indent();
 5845|  12.9M|               }
 5846|  12.9M|               return false;
 5847|  12.9M|            };
 5848|  12.9M|            auto is_word_boundary = [&](const auto ptr) {
 5849|  12.9M|               if (ptr == end) {
 5850|  12.9M|                  return true;
 5851|  12.9M|               }
 5852|  12.9M|               if (*ptr == ':') {
 5853|  12.9M|                  auto next = ptr + 1;
 5854|  12.9M|                  return (next == end) || *next == ' ' || *next == '\t' || *next == '\n' || *next == '\r';
 5855|  12.9M|               }
 5856|  12.9M|               return is_plain_scalar_boundary(*ptr);
 5857|  12.9M|            };
 5858|       |
 5859|  12.9M|            switch (c) {
 5860|  2.46M|            case '&': {
  ------------------
  |  Branch (5860:13): [True: 2.46M, False: 10.4M]
  ------------------
 5861|       |               // Anchor before value: parse name, then re-dispatch
 5862|  2.46M|               ++it;
 5863|  2.46M|               auto aname = yaml::parse_anchor_name(it, end);
 5864|  2.46M|               if (aname.empty()) {
  ------------------
  |  Branch (5864:20): [True: 48, False: 2.46M]
  ------------------
 5865|     48|                  ctx.error = error_code::syntax_error;
 5866|     48|                  return;
 5867|     48|               }
 5868|  2.46M|               yaml::skip_inline_ws(it, end);
 5869|  2.46M|               bool anchor_on_same_line = true;
 5870|  2.46M|               bool value_is_indentless_sequence = false;
 5871|  2.46M|               if (it == end || *it == '\n' || *it == '\r' || *it == '#') {
  ------------------
  |  Branch (5871:20): [True: 9.16k, False: 2.45M]
  |  Branch (5871:33): [True: 109k, False: 2.34M]
  |  Branch (5871:48): [True: 88.6k, False: 2.25M]
  |  Branch (5871:63): [True: 61.8k, False: 2.19M]
  ------------------
 5872|       |                  // Anchor followed by end-of-line. Check if the value continues on the
 5873|       |                  // next line (indented past current context) or if this is an empty node.
 5874|   268k|                  bool value_on_next_line = false;
 5875|   268k|                  if (it != end) {
  ------------------
  |  Branch (5875:23): [True: 259k, False: 9.16k]
  ------------------
 5876|   259k|                     auto peek = it;
 5877|       |                     // Skip comment if present
 5878|   259k|                     if (*peek == '#') {
  ------------------
  |  Branch (5878:26): [True: 61.8k, False: 197k]
  ------------------
 5879|  1.94M|                        while (peek != end && *peek != '\n' && *peek != '\r') ++peek;
  ------------------
  |  Branch (5879:32): [True: 1.94M, False: 0]
  |  Branch (5879:47): [True: 1.92M, False: 23.8k]
  |  Branch (5879:64): [True: 1.88M, False: 38.0k]
  ------------------
 5880|  61.8k|                     }
 5881|       |                     // Skip newline
 5882|   259k|                     if (peek != end && (*peek == '\n' || *peek == '\r')) {
  ------------------
  |  Branch (5882:26): [True: 259k, False: 0]
  |  Branch (5882:42): [True: 133k, False: 126k]
  |  Branch (5882:59): [True: 126k, False: 0]
  ------------------
 5883|   259k|                        yaml::skip_newline(peek, end);
 5884|       |                        // Skip blank lines
 5885|   353k|                        while (peek != end && (*peek == '\n' || *peek == '\r')) {
  ------------------
  |  Branch (5885:32): [True: 346k, False: 6.31k]
  |  Branch (5885:48): [True: 56.1k, False: 290k]
  |  Branch (5885:65): [True: 37.2k, False: 253k]
  ------------------
 5886|  93.4k|                           yaml::skip_newline(peek, end);
 5887|  93.4k|                        }
 5888|       |                        // Measure indent of next content line
 5889|   259k|                        int32_t next_indent = 0;
 5890|   441k|                        while (peek != end && *peek == ' ') {
  ------------------
  |  Branch (5890:32): [True: 435k, False: 6.59k]
  |  Branch (5890:47): [True: 181k, False: 253k]
  ------------------
 5891|   181k|                           ++next_indent;
 5892|   181k|                           ++peek;
 5893|   181k|                        }
 5894|   259k|                        if (peek != end && *peek != '\n' && *peek != '\r') {
  ------------------
  |  Branch (5894:29): [True: 253k, False: 6.59k]
  |  Branch (5894:44): [True: 239k, False: 13.6k]
  |  Branch (5894:61): [True: 236k, False: 2.93k]
  ------------------
 5895|   236k|                           const bool indentless_sequence =
 5896|   236k|                              (!ctx.sequence_item_value_context) && (*peek == '-') &&
  ------------------
  |  Branch (5896:31): [True: 234k, False: 2.07k]
  |  Branch (5896:69): [True: 77.3k, False: 157k]
  ------------------
 5897|  77.3k|                              ((peek + 1) == end ||
  ------------------
  |  Branch (5897:32): [True: 1.09k, False: 76.2k]
  ------------------
 5898|  76.2k|                               yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*(peek + 1))]) &&
  ------------------
  |  Branch (5898:32): [True: 72.3k, False: 3.96k]
  ------------------
 5899|  73.4k|                              (next_indent == ctx.current_indent() ||
  ------------------
  |  Branch (5899:32): [True: 15.3k, False: 58.0k]
  ------------------
 5900|  58.0k|                               (ctx.current_indent() > 0 && (next_indent + 1) == ctx.current_indent()));
  ------------------
  |  Branch (5900:33): [True: 29.8k, False: 28.2k]
  |  Branch (5900:61): [True: 27.5k, False: 2.30k]
  ------------------
 5901|   236k|                           value_is_indentless_sequence = indentless_sequence;
 5902|   236k|                           const bool same_indent_property_node =
 5903|   236k|                              (next_indent == ctx.current_indent()) &&
  ------------------
  |  Branch (5903:31): [True: 39.5k, False: 197k]
  ------------------
 5904|  39.5k|                              (*peek == '!' || *peek == '&' || *peek == '*' || *peek == '[' || *peek == '{' ||
  ------------------
  |  Branch (5904:32): [True: 1.02k, False: 38.5k]
  |  Branch (5904:48): [True: 728, False: 37.7k]
  |  Branch (5904:64): [True: 240, False: 37.5k]
  |  Branch (5904:80): [True: 448, False: 37.0k]
  |  Branch (5904:96): [True: 1.79k, False: 35.2k]
  ------------------
 5905|  35.2k|                               *peek == '"' || *peek == '\'' || *peek == '|' || *peek == '>');
  ------------------
  |  Branch (5905:32): [True: 1.51k, False: 33.7k]
  |  Branch (5905:48): [True: 782, False: 33.0k]
  |  Branch (5905:65): [True: 246, False: 32.7k]
  |  Branch (5905:81): [True: 262, False: 32.4k]
  ------------------
 5906|   236k|                           value_on_next_line =
 5907|   236k|                              (next_indent > ctx.current_indent()) || indentless_sequence || same_indent_property_node;
  ------------------
  |  Branch (5907:31): [True: 160k, False: 75.7k]
  |  Branch (5907:71): [True: 42.8k, False: 32.8k]
  |  Branch (5907:94): [True: 7.04k, False: 25.8k]
  ------------------
 5908|   236k|                        }
 5909|   259k|                     }
 5910|   259k|                  }
 5911|   268k|                  if (!value_on_next_line) {
  ------------------
  |  Branch (5911:23): [True: 58.2k, False: 210k]
  ------------------
 5912|       |                     // Anchor on empty/null node — store empty span, leave value as default
 5913|  58.2k|                     ctx.anchors[std::string(aname)] = {&*it, &*it, ctx.current_indent()};
 5914|  58.2k|                     return;
 5915|  58.2k|                  }
 5916|       |                  // Value is on next line — advance past newline/blank lines to the content
 5917|   210k|                  if (*it == '#') {
  ------------------
  |  Branch (5917:23): [True: 59.5k, False: 151k]
  ------------------
 5918|  1.89M|                     while (it != end && *it != '\n' && *it != '\r') ++it;
  ------------------
  |  Branch (5918:29): [True: 1.89M, False: 0]
  |  Branch (5918:42): [True: 1.87M, False: 22.7k]
  |  Branch (5918:57): [True: 1.83M, False: 36.7k]
  ------------------
 5919|  59.5k|                  }
 5920|   210k|                  if (it != end) yaml::skip_newline(it, end);
  ------------------
  |  Branch (5920:23): [True: 210k, False: 0]
  ------------------
 5921|   287k|                  while (it != end && (*it == '\n' || *it == '\r')) {
  ------------------
  |  Branch (5921:26): [True: 287k, False: 0]
  |  Branch (5921:40): [True: 50.3k, False: 237k]
  |  Branch (5921:55): [True: 26.4k, False: 210k]
  ------------------
 5922|  76.7k|                     yaml::skip_newline(it, end);
 5923|  76.7k|                  }
 5924|   210k|                  yaml::skip_inline_ws(it, end);
 5925|   210k|                  anchor_on_same_line = false;
 5926|   210k|               }
 5927|       |
 5928|       |               if constexpr (!yaml::check_flow_context(Opts)) {
 5929|       |                  if (anchor_on_same_line && *it == '-' &&
 5930|       |                      ((it + 1) == end || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*(it + 1))])) {
 5931|       |                     // "&anchor - item" is malformed in block context.
 5932|       |                     ctx.error = error_code::syntax_error;
 5933|       |                     return;
 5934|       |                  }
 5935|       |               }
 5936|       |
 5937|       |               // Anchor on alias (&anchor *alias) is invalid per YAML spec.
 5938|       |               // But alias-as-key (&anchor *alias : value) is valid.
 5939|  2.40M|               if (it != end && *it == '*' && !yaml::alias_token_is_mapping_key(it, end)) {
  ------------------
  |  Branch (5939:20): [True: 2.40M, False: 6]
  |  Branch (5939:33): [True: 2.29k, False: 2.40M]
  |  Branch (5939:47): [True: 20, False: 2.27k]
  ------------------
 5940|     20|                  ctx.error = error_code::syntax_error;
 5941|     20|                  return;
 5942|     20|               }
 5943|       |
 5944|       |               if constexpr (!yaml::check_flow_context(Opts)) {
 5945|       |                  if (!anchor_on_same_line && it != end && *it == '&') {
 5946|       |                     auto probe = it + 1;
 5947|       |                     auto nested_anchor_name = yaml::parse_anchor_name(probe, end);
 5948|       |                     if (nested_anchor_name.empty()) {
 5949|       |                        ctx.error = error_code::syntax_error;
 5950|       |                        return;
 5951|       |                     }
 5952|       |                     yaml::skip_inline_ws(probe, end);
 5953|       |                     // Allow nested anchor usage only when it clearly starts a
 5954|       |                     // nested mapping entry ("&k key: value"). Otherwise this is
 5955|       |                     // a second anchor on the same node (4JVG-style), which is invalid.
 5956|       |                     if (!yaml::line_could_be_block_mapping(probe, end)) {
 5957|       |                        ctx.error = error_code::syntax_error;
 5958|       |                        return;
 5959|       |                     }
 5960|       |                  }
 5961|       |               }
 5962|       |
 5963|  2.40M|               const char* anchor_start = &*it;
 5964|  2.40M|               const int32_t anchor_indent = ctx.current_indent();
 5965|       |
 5966|       |               if constexpr (!yaml::check_flow_context(Opts)) {
 5967|       |                  // Check if the anchor is on a block-mapping key (&name key: value).
 5968|       |                  // Only when the anchor and key are on the SAME line — if the value was on the
 5969|       |                  // next line, the anchor applies to the entire next-line content.
 5970|       |                  if (anchor_on_same_line && yaml::line_could_be_block_mapping(it, end)) {
 5971|       |                     auto key_start = it;
 5972|       |                     if (*key_start == '!') {
 5973|       |                        const auto key_tag = yaml::parse_yaml_tag(key_start, end, ctx);
 5974|       |                        if (key_tag == yaml::yaml_tag::unknown || !yaml::tag_valid_for_string(key_tag)) {
 5975|       |                           ctx.error = error_code::syntax_error;
 5976|       |                           return;
 5977|       |                        }
 5978|       |                        yaml::skip_inline_ws(key_start, end);
 5979|       |                        if (key_start == end) {
 5980|       |                           ctx.error = error_code::unexpected_end;
 5981|       |                           return;
 5982|       |                        }
 5983|       |                        if (*key_start == '\n' || *key_start == '\r') {
 5984|       |                           ctx.error = error_code::syntax_error;
 5985|       |                           return;
 5986|       |                        }
 5987|       |
 5988|       |                        // Re-apply the anchor-on-alias rule now that the tag is consumed. The
 5989|       |                        // check above ran before the tag, so "&anchor !tag *alias" reached the
 5990|       |                        // key-span registration below while the untagged spelling was rejected;
 5991|       |                        // an alias node carries no other properties either way.
 5992|       |                        if (*key_start == '*' && !yaml::alias_token_is_mapping_key(key_start, end)) {
 5993|       |                           ctx.error = error_code::syntax_error;
 5994|       |                           return;
 5995|       |                        }
 5996|       |                     }
 5997|       |
 5998|       |                     // Find the key span by scanning to the key-value separator
 5999|       |                     auto key_scan = key_start;
 6000|       |                     auto key_end = key_start;
 6001|       |                     if (*key_scan == '"' || *key_scan == '\'') {
 6002|       |                        // Quoted key: skip to closing quote
 6003|       |                        const char quote = *key_scan;
 6004|       |                        ++key_scan;
 6005|       |                        while (key_scan != end && *key_scan != quote) {
 6006|       |                           if (*key_scan == '\\' && quote == '"') {
 6007|       |                              ++key_scan;
 6008|       |                              if (key_scan != end) ++key_scan;
 6009|       |                           }
 6010|       |                           else {
 6011|       |                              ++key_scan;
 6012|       |                           }
 6013|       |                        }
 6014|       |                        if (key_scan == end) {
 6015|       |                           ctx.error = error_code::syntax_error;
 6016|       |                           return;
 6017|       |                        }
 6018|       |                        ++key_scan; // past closing quote
 6019|       |                        key_end = key_scan;
 6020|       |                        yaml::skip_inline_ws(key_scan, end);
 6021|       |                     }
 6022|       |                     else {
 6023|       |                        // Plain key: scan to ':'
 6024|       |                        while (key_scan != end) {
 6025|       |                           if (*key_scan == ':') {
 6026|       |                              auto next = key_scan + 1;
 6027|       |                              if (next == end || *next == ' ' || *next == '\t' || *next == '\n' || *next == '\r') {
 6028|       |                                 break;
 6029|       |                              }
 6030|       |                           }
 6031|       |                           ++key_scan;
 6032|       |                        }
 6033|       |                        key_end = key_scan;
 6034|       |                        while (key_end != key_start && (*(key_end - 1) == ' ' || *(key_end - 1) == '\t')) {
 6035|       |                           --key_end;
 6036|       |                        }
 6037|       |                     }
 6038|       |                     if (key_scan == end || *key_scan != ':') {
 6039|       |                        ctx.error = error_code::syntax_error;
 6040|       |                        return;
 6041|       |                     }
 6042|       |                     // Store anchor with just the key text span
 6043|       |                     ctx.anchors[std::string(aname)] = {&*key_start, &*key_end, anchor_indent};
 6044|       |                     it = key_start;
 6045|       |                     // Parse as an object alternative so complex keys (e.g. flow collections) stay in mapping context.
 6046|       |                     if constexpr (counts::n_object > 0) {
 6047|       |                        process_yaml_variant_alternatives<V, is_yaml_variant_object>::template op<Opts>(value, ctx, it,
 6048|       |                                                                                                        end);
 6049|       |                     }
 6050|       |                     else {
 6051|       |                        from<YAML, V>::template op<Opts>(value, ctx, it, end);
 6052|       |                     }
 6053|       |                     return;
 6054|       |                  }
 6055|       |               }
 6056|       |
 6057|  2.40M|               const bool prev_allow_indentless_sequence = ctx.allow_indentless_sequence;
 6058|  2.40M|               ctx.allow_indentless_sequence = value_is_indentless_sequence;
 6059|  2.40M|               from<YAML, V>::template op<Opts>(value, ctx, it, end);
 6060|  2.40M|               ctx.allow_indentless_sequence = prev_allow_indentless_sequence;
 6061|  2.40M|               if (!bool(ctx.error)) {
  ------------------
  |  Branch (6061:20): [True: 2.39M, False: 7.16k]
  ------------------
 6062|  2.39M|                  ctx.anchors[std::string(aname)] = {anchor_start, &*it, anchor_indent};
 6063|  2.39M|               }
 6064|  2.40M|               return;
 6065|  2.40M|            }
 6066|  1.79M|            case '*': {
  ------------------
  |  Branch (6066:13): [True: 1.79M, False: 11.1M]
  ------------------
 6067|       |               // In block context, "*alias : value" starts a mapping with an alias key.
 6068|       |               if constexpr (!yaml::check_flow_context(Opts)) {
 6069|       |                  if (yaml::alias_token_is_mapping_key(it, end)) {
 6070|       |                     if constexpr (counts::n_object > 0) {
 6071|       |                        process_yaml_variant_alternatives<V, is_yaml_variant_object>::template op<Opts>(value, ctx, it,
 6072|       |                                                                                                        end);
 6073|       |                        return;
 6074|       |                     }
 6075|       |                     else {
 6076|       |                        ctx.error = error_code::syntax_error;
 6077|       |                        return;
 6078|       |                     }
 6079|       |                  }
 6080|       |               }
 6081|       |
 6082|       |               // Alias value: look up anchor and replay
 6083|  1.79M|               yaml::handle_alias<Opts>(value, ctx, it, end);
 6084|  1.79M|               return;
 6085|  2.40M|            }
 6086|   704k|            case '!': {
  ------------------
  |  Branch (6086:13): [True: 704k, False: 12.2M]
  ------------------
 6087|       |               // Tag - parse it and dispatch based on tag type
 6088|   704k|               const auto tag = yaml::parse_yaml_tag(it, end, ctx);
 6089|   704k|               if (tag == yaml::yaml_tag::unknown) {
  ------------------
  |  Branch (6089:20): [True: 34, False: 704k]
  ------------------
 6090|     34|                  ctx.error = error_code::syntax_error;
 6091|     34|                  return;
 6092|     34|               }
 6093|   704k|               yaml::skip_inline_ws(it, end);
 6094|   704k|               if (it != end && *it == '#') {
  ------------------
  |  Branch (6094:20): [True: 702k, False: 1.91k]
  |  Branch (6094:33): [True: 15.4k, False: 686k]
  ------------------
 6095|  15.4k|                  yaml::skip_comment(it, end);
 6096|  15.4k|               }
 6097|   704k|               if (it != end && (*it == '\n' || *it == '\r')) {
  ------------------
  |  Branch (6097:20): [True: 701k, False: 2.29k]
  |  Branch (6097:34): [True: 97.7k, False: 604k]
  |  Branch (6097:49): [True: 76.8k, False: 527k]
  ------------------
 6098|   174k|                  auto content = it;
 6099|   174k|                  yaml::skip_newline(content, end);
 6100|   174k|                  yaml::skip_to_content(content, end);
 6101|       |
 6102|   174k|                  bool consume_following_content = false;
 6103|   174k|                  auto content_token = content;
 6104|   174k|                  if (content != end) {
  ------------------
  |  Branch (6104:23): [True: 170k, False: 4.03k]
  ------------------
 6105|   170k|                     auto indent_probe = content;
 6106|   170k|                     const int32_t content_indent = yaml::measure_indent<false>(indent_probe, end, ctx);
 6107|   170k|                     if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (6107:26): [True: 6, False: 170k]
  ------------------
 6108|      6|                        return;
 6109|   170k|                     content_token = indent_probe;
 6110|       |
 6111|       |                     // A tag at the end of a sequence/map entry has an empty value
 6112|       |                     // unless the next non-empty content is nested under the current node.
 6113|   170k|                     bool tagged_indentless_sequence = false;
 6114|   170k|                     if (tag == yaml::yaml_tag::seq && indent_probe != end && *indent_probe == '-') {
  ------------------
  |  Branch (6114:26): [True: 34.5k, False: 136k]
  |  Branch (6114:56): [True: 34.5k, False: 0]
  |  Branch (6114:79): [True: 32.9k, False: 1.62k]
  ------------------
 6115|  32.9k|                        const auto after_dash = indent_probe + 1;
 6116|  32.9k|                        if (after_dash == end ||
  ------------------
  |  Branch (6116:29): [True: 270, False: 32.6k]
  ------------------
 6117|  32.6k|                            yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*after_dash)]) {
  ------------------
  |  Branch (6117:29): [True: 6.40k, False: 26.2k]
  ------------------
 6118|  6.67k|                           tagged_indentless_sequence =
 6119|  6.67k|                              (content_indent == ctx.current_indent()) ||
  ------------------
  |  Branch (6119:31): [True: 274, False: 6.39k]
  ------------------
 6120|  6.39k|                              (ctx.current_indent() > 0 && (content_indent + 1) == ctx.current_indent());
  ------------------
  |  Branch (6120:32): [True: 404, False: 5.99k]
  |  Branch (6120:60): [True: 208, False: 196]
  ------------------
 6121|  6.67k|                        }
 6122|  32.9k|                     }
 6123|       |
 6124|   170k|                     consume_following_content = (ctx.current_indent() < 0) ||
  ------------------
  |  Branch (6124:50): [True: 92.7k, False: 77.8k]
  ------------------
 6125|  77.8k|                                                 (content_indent > ctx.current_indent()) || tagged_indentless_sequence;
  ------------------
  |  Branch (6125:50): [True: 35.4k, False: 42.3k]
  |  Branch (6125:93): [True: 482, False: 41.8k]
  ------------------
 6126|   170k|                  }
 6127|       |
 6128|   174k|                  if (consume_following_content) {
  ------------------
  |  Branch (6128:23): [True: 128k, False: 45.9k]
  ------------------
 6129|   128k|                     it = content_token;
 6130|   128k|                  }
 6131|  45.9k|                  else {
 6132|  45.9k|                     if (tag == yaml::yaml_tag::str) {
  ------------------
  |  Branch (6132:26): [True: 1.98k, False: 43.9k]
  ------------------
 6133|  1.98k|                        if constexpr (counts::n_str > 0) {
 6134|  1.98k|                           constexpr auto first_idx = yaml_variant_first_index_v<V, is_yaml_variant_str>;
 6135|  1.98k|                           using StrType = std::variant_alternative_t<first_idx, V>;
 6136|  1.98k|                           value = StrType{};
 6137|  1.98k|                           return;
 6138|  1.98k|                        }
 6139|  1.98k|                     }
 6140|  45.9k|                     if (tag == yaml::yaml_tag::null_tag) {
  ------------------
  |  Branch (6140:26): [True: 598, False: 45.3k]
  ------------------
 6141|    598|                        if constexpr (counts::n_null > 0) {
 6142|    598|                           constexpr auto first_idx = yaml_variant_first_index_v<V, is_yaml_variant_null>;
 6143|    598|                           using NullType = std::variant_alternative_t<first_idx, V>;
 6144|    598|                           if (!std::holds_alternative<NullType>(value)) value = NullType{};
  ------------------
  |  Branch (6144:32): [True: 0, False: 598]
  ------------------
 6145|    598|                           return;
 6146|    598|                        }
 6147|    598|                     }
 6148|  45.9k|                     if (tag == yaml::yaml_tag::none) {
  ------------------
  |  Branch (6148:26): [True: 35.5k, False: 10.3k]
  ------------------
 6149|  35.5k|                        if constexpr (counts::n_null > 0) {
 6150|  35.5k|                           constexpr auto first_idx = yaml_variant_first_index_v<V, is_yaml_variant_null>;
 6151|  35.5k|                           using NullType = std::variant_alternative_t<first_idx, V>;
 6152|  35.5k|                           if (!std::holds_alternative<NullType>(value)) value = NullType{};
  ------------------
  |  Branch (6152:32): [True: 0, False: 35.5k]
  ------------------
 6153|  35.5k|                           return;
 6154|  35.5k|                        }
 6155|  35.5k|                     }
 6156|  45.9k|                  }
 6157|   174k|               }
 6158|       |               if constexpr (!yaml::check_flow_context(Opts)) {
 6159|       |                  // In block context, a comma immediately after a tag token is malformed
 6160|       |                  // (e.g., "!!str, value"). Flow context has legitimate ", ] }" usage.
 6161|       |                  if (it != end && *it == ',') {
 6162|       |                     ctx.error = error_code::syntax_error;
 6163|       |                     return;
 6164|       |                  }
 6165|       |                  if constexpr (counts::n_object > 0) {
 6166|       |                     // Tagged keys like "!!str key: value" must parse as mappings.
 6167|       |                     const bool starts_block_sequence_entry =
 6168|       |                        (it != end && *it == '-') &&
 6169|       |                        ((it + 1) == end || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*(it + 1))]);
 6170|       |                     if (!starts_block_sequence_entry && yaml::line_could_be_block_mapping(it, end)) {
 6171|       |                        // Re-dispatch from the post-tag token so '&key key: val' is
 6172|       |                        // handled by the anchor-aware key path, not as a map-level anchor.
 6173|       |                        from<YAML, V>::template op<Opts>(value, ctx, it, end);
 6174|       |                        return;
 6175|       |                     }
 6176|       |                  }
 6177|       |               }
 6178|   704k|               if (it == end) {
  ------------------
  |  Branch (6178:20): [True: 2.29k, False: 701k]
  ------------------
 6179|  2.29k|                  if (tag == yaml::yaml_tag::str) {
  ------------------
  |  Branch (6179:23): [True: 618, False: 1.67k]
  ------------------
 6180|    618|                     if constexpr (counts::n_str > 0) {
 6181|    618|                        constexpr auto first_idx = yaml_variant_first_index_v<V, is_yaml_variant_str>;
 6182|    618|                        using StrType = std::variant_alternative_t<first_idx, V>;
 6183|    618|                        value = StrType{};
 6184|    618|                        return;
 6185|    618|                     }
 6186|    618|                  }
 6187|  2.29k|                  if (tag == yaml::yaml_tag::none) {
  ------------------
  |  Branch (6187:23): [True: 1.67k, False: 624]
  ------------------
 6188|  1.67k|                     if constexpr (counts::n_null > 0) {
 6189|  1.67k|                        constexpr auto first_idx = yaml_variant_first_index_v<V, is_yaml_variant_null>;
 6190|  1.67k|                        using NullType = std::variant_alternative_t<first_idx, V>;
 6191|  1.67k|                        if (!std::holds_alternative<NullType>(value)) value = NullType{};
  ------------------
  |  Branch (6191:29): [True: 0, False: 1.67k]
  ------------------
 6192|  1.67k|                        return;
 6193|  1.67k|                     }
 6194|  1.67k|                  }
 6195|      0|                  ctx.error = error_code::unexpected_end;
 6196|  2.29k|                  return;
 6197|  2.29k|               }
 6198|   701k|               switch (tag) {
 6199|  6.32k|               case yaml::yaml_tag::str:
  ------------------
  |  Branch (6199:16): [True: 6.32k, False: 695k]
  ------------------
 6200|  6.32k|                  process_yaml_variant_alternatives<V, is_yaml_variant_str>::template op<Opts>(value, ctx, it, end);
 6201|  6.32k|                  return;
 6202|  19.4k|               case yaml::yaml_tag::int_tag:
  ------------------
  |  Branch (6202:16): [True: 19.4k, False: 682k]
  ------------------
 6203|  19.5k|               case yaml::yaml_tag::float_tag:
  ------------------
  |  Branch (6203:16): [True: 80, False: 701k]
  ------------------
 6204|  19.5k|                  if constexpr (counts::n_num > 0) {
 6205|  19.5k|                     process_yaml_variant_alternatives<V, is_yaml_variant_num>::template op<Opts>(value, ctx, it, end);
 6206|  19.5k|                     return;
 6207|       |                  }
 6208|       |                  else { // else used to fix MSVC unreachable code warning
 6209|       |                     ctx.error = error_code::syntax_error;
 6210|       |                     return;
 6211|       |                  }
 6212|  76.1k|               case yaml::yaml_tag::bool_tag:
  ------------------
  |  Branch (6212:16): [True: 56.6k, False: 645k]
  ------------------
 6213|  76.1k|                  if constexpr (counts::n_bool > 0) {
 6214|  76.1k|                     process_yaml_variant_alternatives<V, is_yaml_variant_bool>::template op<Opts>(value, ctx, it, end);
 6215|  76.1k|                     return;
 6216|       |                  }
 6217|       |                  else { // else used to fix MSVC unreachable code warning
 6218|       |                     ctx.error = error_code::syntax_error;
 6219|       |                     return;
 6220|       |                  }
 6221|  76.9k|               case yaml::yaml_tag::null_tag:
  ------------------
  |  Branch (6221:16): [True: 768, False: 701k]
  ------------------
 6222|  76.9k|                  if constexpr (counts::n_null > 0) {
 6223|  76.9k|                     constexpr auto first_idx = yaml_variant_first_index_v<V, is_yaml_variant_null>;
 6224|  76.9k|                     using NullType = std::variant_alternative_t<first_idx, V>;
 6225|  76.9k|                     if (!std::holds_alternative<NullType>(value)) value = NullType{};
  ------------------
  |  Branch (6225:26): [True: 0, False: 76.9k]
  ------------------
 6226|  76.9k|                     from<YAML, NullType>::template op<Opts>(std::get<NullType>(value), ctx, it, end);
 6227|  76.9k|                     return;
 6228|       |                  }
 6229|       |                  else { // else used to fix MSVC unreachable code warning
 6230|       |                     ctx.error = error_code::syntax_error;
 6231|       |                     return;
 6232|       |                  }
 6233|   120k|               case yaml::yaml_tag::map:
  ------------------
  |  Branch (6233:16): [True: 43.9k, False: 657k]
  ------------------
 6234|   120k|                  if constexpr (counts::n_object > 0) {
 6235|   120k|                     process_yaml_variant_alternatives<V, is_yaml_variant_object>::template op<Opts>(value, ctx, it,
 6236|   120k|                                                                                                     end);
 6237|   120k|                     return;
 6238|       |                  }
 6239|       |                  else { // else used to fix MSVC unreachable code warning
 6240|       |                     ctx.error = error_code::syntax_error;
 6241|       |                     return;
 6242|       |                  }
 6243|   262k|               case yaml::yaml_tag::seq:
  ------------------
  |  Branch (6243:16): [True: 141k, False: 560k]
  ------------------
 6244|   262k|                  if constexpr (counts::n_array > 0) {
 6245|   262k|                     const bool prev_allow_indentless_sequence = ctx.allow_indentless_sequence;
 6246|       |                     if constexpr (!yaml::check_flow_context(Opts)) {
 6247|       |                        if (it != end && *it == '-') {
 6248|       |                           ctx.allow_indentless_sequence = true;
 6249|       |                        }
 6250|       |                     }
 6251|   262k|                     process_yaml_variant_alternatives<V, is_yaml_variant_array>::template op<Opts>(value, ctx, it,
 6252|   262k|                                                                                                    end);
 6253|   262k|                     ctx.allow_indentless_sequence = prev_allow_indentless_sequence;
 6254|   262k|                     return;
 6255|       |                  }
 6256|       |                  else { // else used to fix MSVC unreachable code warning
 6257|       |                     ctx.error = error_code::syntax_error;
 6258|       |                     return;
 6259|       |                  }
 6260|   657k|               default: {
  ------------------
  |  Branch (6260:16): [True: 394k, False: 307k]
  ------------------
 6261|       |                  // Explicit unknown/non-core tags disable implicit scalar resolution.
 6262|       |                  // Preserve collection kinds, otherwise treat as string content.
 6263|   657k|                  if (it != end && *it == '*') {
  ------------------
  |  Branch (6263:23): [True: 394k, False: 262k]
  |  Branch (6263:36): [True: 33.2k, False: 361k]
  ------------------
 6264|  33.2k|                     yaml::handle_alias<Opts>(value, ctx, it, end);
 6265|  33.2k|                     return;
 6266|  33.2k|                  }
 6267|       |
 6268|   624k|                  if constexpr (counts::n_array > 0) {
 6269|   624k|                     if (it != end && *it == '[') {
  ------------------
  |  Branch (6269:26): [True: 361k, False: 262k]
  |  Branch (6269:39): [True: 628, False: 360k]
  ------------------
 6270|    628|                        process_yaml_variant_alternatives<V, is_yaml_variant_array>::template op<Opts>(value, ctx, it,
 6271|    628|                                                                                                       end);
 6272|    628|                        return;
 6273|    628|                     }
 6274|   624k|                  }
 6275|   624k|                  if constexpr (counts::n_object > 0) {
 6276|   624k|                     if (it != end && *it == '{') {
  ------------------
  |  Branch (6276:26): [True: 360k, False: 263k]
  |  Branch (6276:39): [True: 80.5k, False: 280k]
  ------------------
 6277|  80.5k|                        process_yaml_variant_alternatives<V, is_yaml_variant_object>::template op<Opts>(value, ctx, it,
 6278|  80.5k|                                                                                                        end);
 6279|  80.5k|                        return;
 6280|  80.5k|                     }
 6281|   624k|                  }
 6282|       |
 6283|       |                  if constexpr (!yaml::check_flow_context(Opts)) {
 6284|       |                     if constexpr (counts::n_array > 0) {
 6285|       |                        const bool starts_block_sequence_entry =
 6286|       |                           (it != end && *it == '-') &&
 6287|       |                           ((it + 1) == end || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*(it + 1))]);
 6288|       |                        if (starts_block_sequence_entry) {
 6289|       |                           process_yaml_variant_alternatives<V, is_yaml_variant_array>::template op<Opts>(value, ctx,
 6290|       |                                                                                                          it, end);
 6291|       |                           return;
 6292|       |                        }
 6293|       |                     }
 6294|       |                     if constexpr (counts::n_object > 0) {
 6295|       |                        const bool starts_explicit_mapping_indicator =
 6296|       |                           (it != end && (*it == '?' || *it == ':')) &&
 6297|       |                           ((it + 1) == end || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*(it + 1))]);
 6298|       |                        if (starts_explicit_mapping_indicator) {
 6299|       |                           process_yaml_variant_alternatives<V, is_yaml_variant_object>::template op<Opts>(value, ctx,
 6300|       |                                                                                                           it, end);
 6301|       |                           return;
 6302|       |                        }
 6303|       |                        if (yaml::line_could_be_block_mapping(it, end)) {
 6304|       |                           process_yaml_variant_alternatives<V, is_yaml_variant_object>::template op<Opts>(value, ctx,
 6305|       |                                                                                                           it, end);
 6306|       |                           return;
 6307|       |                        }
 6308|       |                     }
 6309|       |                  }
 6310|       |
 6311|   624k|                  if constexpr (counts::n_str > 0) {
 6312|   624k|                     process_yaml_variant_alternatives<V, is_yaml_variant_str>::template op<Opts>(value, ctx, it, end);
 6313|   624k|                     return;
 6314|   624k|                  }
 6315|       |
 6316|       |                  // Fall back if no string alternative exists.
 6317|      0|                  from<YAML, V>::template op<Opts>(value, ctx, it, end);
 6318|   624k|                  return;
 6319|   657k|               }
 6320|   701k|               }
 6321|      0|               return;
 6322|   701k|            }
 6323|  2.50M|            case '{':
  ------------------
  |  Branch (6323:13): [True: 2.50M, False: 10.4M]
  ------------------
 6324|       |               if constexpr (!yaml::check_flow_context(Opts)) {
 6325|       |                  // In block context, "{...}: value" can be a complex mapping key.
 6326|       |                  if (ctx.current_indent() < 0 && yaml::line_could_be_block_mapping(it, end)) {
 6327|       |                     process_yaml_variant_alternatives<V, is_yaml_variant_object>::template op<Opts>(value, ctx, it,
 6328|       |                                                                                                     end);
 6329|       |                     return;
 6330|       |                  }
 6331|       |               }
 6332|       |               // Flow mapping - object type
 6333|  2.50M|               process_yaml_variant_alternatives<V, is_yaml_variant_object>::template op<Opts>(value, ctx, it, end);
 6334|  2.50M|               return;
 6335|   157k|            case '[':
  ------------------
  |  Branch (6335:13): [True: 157k, False: 12.7M]
  ------------------
 6336|       |               if constexpr (!yaml::check_flow_context(Opts)) {
 6337|       |                  // In block context, "[...]: value" can be a complex mapping key.
 6338|       |                  if (ctx.current_indent() < 0 && yaml::line_could_be_block_mapping(it, end)) {
 6339|       |                     process_yaml_variant_alternatives<V, is_yaml_variant_object>::template op<Opts>(value, ctx, it,
 6340|       |                                                                                                     end);
 6341|       |                     return;
 6342|       |                  }
 6343|       |               }
 6344|       |               // Flow sequence - array type
 6345|   157k|               process_yaml_variant_alternatives<V, is_yaml_variant_array>::template op<Opts>(value, ctx, it, end);
 6346|   157k|               return;
 6347|   645k|            case '?':
  ------------------
  |  Branch (6347:13): [True: 645k, False: 12.2M]
  ------------------
 6348|       |               // Explicit mapping key indicator ("? key")
 6349|   645k|               if ((end - it >= 2) && it[1] == '\t') {
  ------------------
  |  Branch (6349:20): [True: 600k, False: 45.1k]
  |  Branch (6349:39): [True: 6, False: 600k]
  ------------------
 6350|      6|                  ctx.error = error_code::syntax_error;
 6351|      6|                  return;
 6352|      6|               }
 6353|   645k|               if ((end - it >= 2) && (it[1] == ' ' || it[1] == '\n' || it[1] == '\r')) {
  ------------------
  |  Branch (6353:20): [True: 600k, False: 45.1k]
  |  Branch (6353:40): [True: 178k, False: 421k]
  |  Branch (6353:56): [True: 219k, False: 202k]
  |  Branch (6353:73): [True: 91.5k, False: 111k]
  ------------------
 6354|   489k|                  if constexpr (counts::n_object > 0) {
 6355|   489k|                     process_yaml_variant_alternatives<V, is_yaml_variant_object>::template op<Opts>(value, ctx, it,
 6356|   489k|                                                                                                     end);
 6357|   489k|                     return;
 6358|   489k|                  }
 6359|   489k|               }
 6360|      0|               parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6361|   645k|               return;
 6362|     20|            case '%':
  ------------------
  |  Branch (6362:13): [True: 20, False: 12.9M]
  ------------------
 6363|       |               // Reserved directive indicator is not a plain scalar start.
 6364|     20|               ctx.error = error_code::syntax_error;
 6365|     20|               return;
 6366|  17.0k|            case '"':
  ------------------
  |  Branch (6366:13): [True: 17.0k, False: 12.9M]
  ------------------
 6367|  64.7k|            case '\'':
  ------------------
  |  Branch (6367:13): [True: 47.7k, False: 12.8M]
  ------------------
 6368|       |               // Could be a quoted string OR a quoted key in a block mapping
 6369|       |               // Try block mapping first (e.g., "key": value), then fall back to string
 6370|  64.7k|               parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6371|  64.7k|               return;
 6372|  96.5k|            case 't':
  ------------------
  |  Branch (6372:13): [True: 96.5k, False: 12.8M]
  ------------------
 6373|   116k|            case 'T':
  ------------------
  |  Branch (6373:13): [True: 19.5k, False: 12.9M]
  ------------------
 6374|       |               // Could be "true", "True", "TRUE", or a key/string starting with t/T
 6375|   116k|               if constexpr (counts::n_bool > 0) {
 6376|   116k|                  if ((end - it >= 4) && ((it[1] == 'r' && it[2] == 'u' && it[3] == 'e') ||
  ------------------
  |  Branch (6376:23): [True: 113k, False: 2.98k]
  |  Branch (6376:44): [True: 86.4k, False: 26.6k]
  |  Branch (6376:60): [True: 61.4k, False: 24.9k]
  |  Branch (6376:76): [True: 59.1k, False: 2.28k]
  ------------------
 6377|  62.7k|                                          (it[1] == 'R' && it[2] == 'U' && it[3] == 'E'))) {
  ------------------
  |  Branch (6377:44): [True: 11.6k, False: 42.3k]
  |  Branch (6377:60): [True: 7.67k, False: 3.96k]
  |  Branch (6377:76): [True: 3.63k, False: 4.04k]
  ------------------
 6378|       |                     // Check what follows the word "true"
 6379|  62.7k|                     const auto after_true = it + 4;
 6380|  62.7k|                     const bool at_word_boundary = is_word_boundary(after_true);
 6381|       |
 6382|  62.7k|                     if (at_word_boundary) {
  ------------------
  |  Branch (6382:26): [True: 30.2k, False: 32.5k]
  ------------------
 6383|  30.2k|                        if (has_indented_block_continuation(after_true)) {
  ------------------
  |  Branch (6383:29): [True: 0, False: 30.2k]
  ------------------
 6384|      0|                           parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6385|      0|                           return;
 6386|      0|                        }
 6387|       |                        // Check if this is a key (followed by ": ") rather than a boolean value
 6388|       |                        // "true: value" should parse as {true: value}, not as the boolean true
 6389|  30.2k|                        if ((end - it > 4) && it[4] == ':' &&
  ------------------
  |  Branch (6389:29): [True: 29.7k, False: 520]
  |  Branch (6389:47): [True: 21.2k, False: 8.45k]
  ------------------
 6390|  21.2k|                            (end - it == 5 || it[5] == ' ' || it[5] == '\t' || it[5] == '\n' || it[5] == '\r')) {
  ------------------
  |  Branch (6390:30): [True: 9.67k, False: 11.6k]
  |  Branch (6390:47): [True: 6.95k, False: 4.67k]
  |  Branch (6390:63): [True: 2.38k, False: 2.28k]
  |  Branch (6390:80): [True: 658, False: 1.62k]
  |  Branch (6390:97): [True: 1.62k, False: 0]
  ------------------
 6391|       |                           // This is "true:" followed by space/tab/newline/end - treat as key
 6392|  21.2k|                           parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6393|  21.2k|                           return;
 6394|  21.2k|                        }
 6395|  8.97k|                        process_yaml_variant_alternatives<V, is_yaml_variant_bool>::template op<Opts>(value, ctx, it,
 6396|  8.97k|                                                                                                      end);
 6397|  8.97k|                        return;
 6398|  30.2k|                     }
 6399|       |                     // "true" is followed by more characters (e.g., "True\b") - treat as string
 6400|  62.7k|                  }
 6401|   116k|               }
 6402|  85.8k|               parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6403|   116k|               return;
 6404|   161k|            case 'f':
  ------------------
  |  Branch (6404:13): [True: 161k, False: 12.7M]
  ------------------
 6405|   205k|            case 'F':
  ------------------
  |  Branch (6405:13): [True: 44.5k, False: 12.8M]
  ------------------
 6406|       |               // Could be "false", "False", "FALSE", or a key/string starting with f/F
 6407|   205k|               if constexpr (counts::n_bool > 0) {
 6408|   205k|                  if ((end - it >= 5) && ((it[1] == 'a' && it[2] == 'l' && it[3] == 's' && it[4] == 'e') ||
  ------------------
  |  Branch (6408:23): [True: 201k, False: 4.08k]
  |  Branch (6408:44): [True: 91.9k, False: 109k]
  |  Branch (6408:60): [True: 81.3k, False: 10.5k]
  |  Branch (6408:76): [True: 79.1k, False: 2.16k]
  |  Branch (6408:92): [True: 55.0k, False: 24.1k]
  ------------------
 6409|   146k|                                          (it[1] == 'A' && it[2] == 'L' && it[3] == 'S' && it[4] == 'E'))) {
  ------------------
  |  Branch (6409:44): [True: 36.0k, False: 110k]
  |  Branch (6409:60): [True: 31.1k, False: 4.86k]
  |  Branch (6409:76): [True: 29.8k, False: 1.36k]
  |  Branch (6409:92): [True: 15.4k, False: 14.4k]
  ------------------
 6410|       |                     // Check what follows the word "false"
 6411|  70.4k|                     const auto after_false = it + 5;
 6412|  70.4k|                     const bool at_word_boundary = is_word_boundary(after_false);
 6413|       |
 6414|  70.4k|                     if (at_word_boundary) {
  ------------------
  |  Branch (6414:26): [True: 63.2k, False: 7.25k]
  ------------------
 6415|  63.2k|                        if (has_indented_block_continuation(after_false)) {
  ------------------
  |  Branch (6415:29): [True: 0, False: 63.2k]
  ------------------
 6416|      0|                           parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6417|      0|                           return;
 6418|      0|                        }
 6419|       |                        // Check if this is a key (followed by ": ") rather than a boolean value
 6420|       |                        // "false: value" should parse as {false: value}, not as the boolean false
 6421|  63.2k|                        if ((end - it > 5) && it[5] == ':' &&
  ------------------
  |  Branch (6421:29): [True: 62.6k, False: 562]
  |  Branch (6421:47): [True: 45.6k, False: 17.0k]
  ------------------
 6422|  45.6k|                            (end - it == 6 || it[6] == ' ' || it[6] == '\t' || it[6] == '\n' || it[6] == '\r')) {
  ------------------
  |  Branch (6422:30): [True: 254, False: 45.3k]
  |  Branch (6422:47): [True: 1.97k, False: 43.4k]
  |  Branch (6422:63): [True: 550, False: 42.8k]
  |  Branch (6422:80): [True: 2.98k, False: 39.8k]
  |  Branch (6422:97): [True: 39.8k, False: 0]
  ------------------
 6423|       |                           // This is "false:" followed by space/tab/newline/end - treat as key
 6424|  45.6k|                           parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6425|  45.6k|                           return;
 6426|  45.6k|                        }
 6427|  17.6k|                        process_yaml_variant_alternatives<V, is_yaml_variant_bool>::template op<Opts>(value, ctx, it,
 6428|  17.6k|                                                                                                      end);
 6429|  17.6k|                        return;
 6430|  63.2k|                     }
 6431|       |                     // "false" is followed by more characters (e.g., "False\b") - treat as string
 6432|  70.4k|                  }
 6433|   205k|               }
 6434|   142k|               parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6435|   205k|               return;
 6436|   146k|            case 'n':
  ------------------
  |  Branch (6436:13): [True: 146k, False: 12.7M]
  ------------------
 6437|   198k|            case 'N':
  ------------------
  |  Branch (6437:13): [True: 51.9k, False: 12.8M]
  ------------------
 6438|       |               // Could be "null", "Null", "NULL", or a key/string starting with n/N
 6439|   198k|               if constexpr (counts::n_null > 0) {
 6440|   198k|                  if ((end - it >= 4) && ((it[1] == 'u' && it[2] == 'l' && it[3] == 'l') ||
  ------------------
  |  Branch (6440:23): [True: 196k, False: 2.04k]
  |  Branch (6440:44): [True: 122k, False: 73.9k]
  |  Branch (6440:60): [True: 77.6k, False: 44.5k]
  |  Branch (6440:76): [True: 65.6k, False: 11.9k]
  ------------------
 6441|   130k|                                          (it[1] == 'U' && it[2] == 'L' && it[3] == 'L'))) {
  ------------------
  |  Branch (6441:44): [True: 3.67k, False: 126k]
  |  Branch (6441:60): [True: 2.37k, False: 1.30k]
  |  Branch (6441:76): [True: 1.93k, False: 440]
  ------------------
 6442|       |                     // Check what follows the word "null"
 6443|  67.6k|                     const auto after_null = it + 4;
 6444|  67.6k|                     const bool at_word_boundary = is_word_boundary(after_null);
 6445|       |
 6446|  67.6k|                     if (at_word_boundary) {
  ------------------
  |  Branch (6446:26): [True: 49.6k, False: 17.9k]
  ------------------
 6447|  49.6k|                        if (has_indented_block_continuation(after_null)) {
  ------------------
  |  Branch (6447:29): [True: 0, False: 49.6k]
  ------------------
 6448|      0|                           parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6449|      0|                           return;
 6450|      0|                        }
 6451|       |                        // Check if this is a key (followed by ": ") rather than a null value
 6452|       |                        // "null: value" should parse as {null: value}, not as the null type
 6453|  49.6k|                        if ((end - it > 4) && it[4] == ':' &&
  ------------------
  |  Branch (6453:29): [True: 48.7k, False: 902]
  |  Branch (6453:47): [True: 4.62k, False: 44.1k]
  ------------------
 6454|  4.62k|                            (end - it == 5 || it[5] == ' ' || it[5] == '\t' || it[5] == '\n' || it[5] == '\r')) {
  ------------------
  |  Branch (6454:30): [True: 958, False: 3.66k]
  |  Branch (6454:47): [True: 814, False: 2.85k]
  |  Branch (6454:63): [True: 666, False: 2.18k]
  |  Branch (6454:80): [True: 832, False: 1.35k]
  |  Branch (6454:97): [True: 1.35k, False: 0]
  ------------------
 6455|       |                           // This is "null:" followed by space/tab/newline/end - treat as key
 6456|  4.62k|                           parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6457|  4.62k|                           return;
 6458|  4.62k|                        }
 6459|  45.0k|                        constexpr auto first_idx = yaml_variant_first_index_v<V, is_yaml_variant_null>;
 6460|  45.0k|                        using NullType = std::variant_alternative_t<first_idx, V>;
 6461|  45.0k|                        if (!std::holds_alternative<NullType>(value)) value = NullType{};
  ------------------
  |  Branch (6461:29): [True: 0, False: 45.0k]
  ------------------
 6462|  45.0k|                        from<YAML, NullType>::template op<Opts>(std::get<NullType>(value), ctx, it, end);
 6463|  45.0k|                        return;
 6464|  49.6k|                     }
 6465|       |                     // "null" is followed by more characters (e.g., "Null\b") - treat as string
 6466|  67.6k|                  }
 6467|   198k|               }
 6468|   148k|               parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6469|   198k|               return;
 6470|  3.74k|            case '~':
  ------------------
  |  Branch (6470:13): [True: 3.74k, False: 12.9M]
  ------------------
 6471|       |               // Null indicator
 6472|  3.74k|               if constexpr (counts::n_null > 0) {
 6473|  3.74k|                  constexpr auto first_idx = yaml_variant_first_index_v<V, is_yaml_variant_null>;
 6474|  3.74k|                  using NullType = std::variant_alternative_t<first_idx, V>;
 6475|  3.74k|                  if (!std::holds_alternative<NullType>(value)) value = NullType{};
  ------------------
  |  Branch (6475:23): [True: 0, False: 3.74k]
  ------------------
 6476|  3.74k|                  from<YAML, NullType>::template op<Opts>(std::get<NullType>(value), ctx, it, end);
 6477|  3.74k|                  return;
 6478|  3.74k|               }
 6479|      0|               break; // Fall through to try other types
 6480|  1.65M|            case '-':
  ------------------
  |  Branch (6480:13): [True: 1.65M, False: 11.2M]
  ------------------
 6481|       |               // Could be negative number or block sequence indicator
 6482|  1.65M|               if (((it + 1) == end) || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(it[1])]) {
  ------------------
  |  Branch (6482:20): [True: 20.6k, False: 1.63M]
  |  Branch (6482:41): [True: 1.21M, False: 427k]
  ------------------
 6483|       |                  // Block sequence indicator "- "
 6484|  1.23M|                  if constexpr (counts::n_array > 0) {
 6485|  1.23M|                     process_yaml_variant_alternatives<V, is_yaml_variant_array>::template op<Opts>(value, ctx, it,
 6486|  1.23M|                                                                                                    end);
 6487|  1.23M|                     return;
 6488|  1.23M|                  }
 6489|  1.23M|               }
 6490|  1.65M|               if constexpr (counts::n_num > 0) {
 6491|  1.65M|                  if ((end - it >= 2) && (std::isdigit(static_cast<unsigned char>(it[1])) || it[1] == '.')) {
  ------------------
  |  Branch (6491:23): [True: 427k, False: 1.23M]
  |  Branch (6491:43): [True: 13.5k, False: 413k]
  |  Branch (6491:94): [True: 314k, False: 98.8k]
  ------------------
 6492|   328k|                     process_yaml_variant_alternatives<V, is_yaml_variant_num>::template op<Opts>(value, ctx, it, end);
 6493|   328k|                     return;
 6494|   328k|                  }
 6495|  1.65M|               }
 6496|  1.33M|               parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6497|  1.65M|               return;
 6498|   110k|            case '+':
  ------------------
  |  Branch (6498:13): [True: 110k, False: 12.8M]
  ------------------
 6499|   183k|            case '.':
  ------------------
  |  Branch (6499:13): [True: 73.6k, False: 12.8M]
  ------------------
 6500|       |               // Could be a number (.5, +5, .inf, etc.) or a string (.c, .cpp, +name, etc.)
 6501|       |               // Try parsing as number speculatively, fall back to string on failure
 6502|   183k|               if constexpr (counts::n_num > 0) {
 6503|   183k|                  auto start_it = it;
 6504|   183k|                  auto temp_ctx = ctx.make_speculative();
 6505|   183k|                  process_yaml_variant_alternatives<V, is_yaml_variant_num>::template op<Opts>(value, temp_ctx, it,
 6506|   183k|                                                                                               end);
 6507|   183k|                  ctx.alias_expansion_budget = temp_ctx.alias_expansion_budget; // charged even if rejected
 6508|   183k|                  ctx.key_expansion_budget = temp_ctx.key_expansion_budget;
 6509|   183k|                  if (!bool(temp_ctx.error)) {
  ------------------
  |  Branch (6509:23): [True: 16.2k, False: 167k]
  ------------------
 6510|  16.2k|                     ctx.anchors = std::move(temp_ctx.anchors);
 6511|  16.2k|                     return; // Successfully parsed as number
 6512|  16.2k|                  }
 6513|   167k|                  it = start_it; // Restore and fall through to string
 6514|   167k|               }
 6515|      0|               parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6516|   183k|               return;
 6517|  2.22M|            default:
  ------------------
  |  Branch (6517:13): [True: 2.22M, False: 10.7M]
  ------------------
 6518|       |               // Check for digit (0-9) - numeric or block mapping key starting with digit
 6519|  2.22M|               if (c >= '0' && c <= '9') {
  ------------------
  |  Branch (6519:20): [True: 1.41M, False: 815k]
  |  Branch (6519:32): [True: 782k, False: 629k]
  ------------------
 6520|       |                  // Try block mapping first (e.g., "123key: value")
 6521|   782k|                  if (try_parse_block_mapping_into_variant<V, Opts>(value, ctx, it, end)) {
  ------------------
  |  Branch (6521:23): [True: 18.4k, False: 764k]
  ------------------
 6522|  18.4k|                     return;
 6523|  18.4k|                  }
 6524|       |                  // Try numeric value speculatively - values like "12:30" look numeric but aren't
 6525|   764k|                  if constexpr (counts::n_num > 0) {
 6526|   764k|                     auto start_it = it;
 6527|   764k|                     auto temp_ctx = ctx.make_speculative();
 6528|   764k|                     process_yaml_variant_alternatives<V, is_yaml_variant_num>::template op<Opts>(value, temp_ctx, it,
 6529|   764k|                                                                                                  end);
 6530|   764k|                     ctx.alias_expansion_budget = temp_ctx.alias_expansion_budget; // charged even if rejected
 6531|   764k|                     ctx.key_expansion_budget = temp_ctx.key_expansion_budget;
 6532|   764k|                     if (!bool(temp_ctx.error)) {
  ------------------
  |  Branch (6532:26): [True: 363k, False: 400k]
  ------------------
 6533|   363k|                        ctx.anchors = std::move(temp_ctx.anchors);
 6534|   363k|                        return; // Successfully parsed as number
 6535|   363k|                     }
 6536|   400k|                     it = start_it; // Restore and fall through to string
 6537|   400k|                  }
 6538|       |                  // Fall through to string
 6539|      0|                  process_yaml_variant_alternatives<V, is_yaml_variant_str>::template op<Opts>(value, ctx, it, end);
 6540|   764k|                  return;
 6541|   782k|               }
 6542|       |               // Plain scalar - try block mapping, then string
 6543|  1.44M|               parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6544|  1.44M|               return;
 6545|  12.9M|            }
 6546|  12.9M|         }
 6547|       |
 6548|       |         // For non-auto-deducible variants or fallback, try each type until one succeeds
 6549|      0|         constexpr auto N = std::variant_size_v<std::remove_cvref_t<T>>;
 6550|       |
 6551|       |         // This fold discards each alternative's error and reports only that nothing fit, which
 6552|       |         // misdiagnoses a document that exhausted an expansion budget as merely the wrong shape.
 6553|       |         // Kept aside and used only if no alternative parsed, so a later one that does parse
 6554|       |         // (possible under a latched budget if it materializes no key text) is unaffected.
 6555|  12.9M|         error_code expansion_error{};
 6556|  12.9M|         std::string_view expansion_message{};
 6557|       |
 6558|  12.9M|         auto try_parse = [&]<size_t I>() -> bool {
 6559|  12.9M|            using V = std::variant_alternative_t<I, std::remove_cvref_t<T>>;
 6560|  12.9M|            auto start = it;
 6561|       |
 6562|  12.9M|            V v{};
 6563|  12.9M|            auto temp_ctx = ctx.make_speculative();
 6564|  12.9M|            from<YAML, V>::template op<Opts>(v, temp_ctx, it, end);
 6565|  12.9M|            ctx.alias_expansion_budget = temp_ctx.alias_expansion_budget; // charged even if rejected
 6566|  12.9M|            ctx.key_expansion_budget = temp_ctx.key_expansion_budget;
 6567|       |
 6568|  12.9M|            if (!bool(temp_ctx.error)) {
 6569|  12.9M|               value = std::move(v);
 6570|  12.9M|               ctx.anchors = std::move(temp_ctx.anchors);
 6571|  12.9M|               return true;
 6572|  12.9M|            }
 6573|       |
 6574|  12.9M|            if (temp_ctx.error == error_code::exceeded_max_expansion && expansion_error == error_code::none) {
 6575|  12.9M|               expansion_error = temp_ctx.error;
 6576|  12.9M|               expansion_message = temp_ctx.custom_error_message;
 6577|  12.9M|            }
 6578|  12.9M|            it = start;
 6579|  12.9M|            return false;
 6580|  12.9M|         };
 6581|       |
 6582|  12.9M|         bool parsed = false;
 6583|  12.9M|         [&]<size_t... Is>(std::index_sequence<Is...>) {
 6584|  12.9M|            ((parsed = parsed || try_parse.template operator()<Is>()), ...);
 6585|  12.9M|         }(std::make_index_sequence<N>{});
 6586|       |
 6587|  12.9M|         if (!parsed) {
  ------------------
  |  Branch (6587:14): [True: 0, False: 12.9M]
  ------------------
 6588|      0|            if (expansion_error != error_code::none) {
  ------------------
  |  Branch (6588:17): [True: 0, False: 0]
  ------------------
 6589|      0|               ctx.error = expansion_error;
 6590|      0|               ctx.custom_error_message = expansion_message;
 6591|      0|            }
 6592|      0|            else {
 6593|      0|               ctx.error = error_code::no_matching_variant_type;
 6594|      0|            }
 6595|      0|         }
 6596|  12.9M|      }
_ZN3glz4yaml12handle_aliasITnDaXtlNS_4optsELj10ELb1ELb0ELb0ELb1ELb0ELb0ELb0ELb0ELj1EEERNSt3__17variantIJDndNS3_12basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEEbNS3_6vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS8_ISF_EEEENSE_ISF_EEEEENS0_12yaml_contextEPKcSN_EEbOT0_RT1_RT2_T3_:
  300|  1.82M|      {
  301|  1.82M|         if (it == end || *it != '*') return false;
  ------------------
  |  Branch (301:14): [True: 0, False: 1.82M]
  |  Branch (301:27): [True: 0, False: 1.82M]
  ------------------
  302|       |
  303|  1.82M|         ++it; // skip '*'
  304|  1.82M|         auto name = parse_anchor_name(it, end);
  305|  1.82M|         if (name.empty()) {
  ------------------
  |  Branch (305:14): [True: 34, False: 1.82M]
  ------------------
  306|     34|            ctx.error = error_code::syntax_error;
  307|     34|            return true;
  308|     34|         }
  309|       |
  310|  1.82M|         auto anchor_it = ctx.anchors.find(name);
  311|  1.82M|         if (anchor_it == ctx.anchors.end()) {
  ------------------
  |  Branch (311:14): [True: 50, False: 1.82M]
  ------------------
  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|  1.82M|         const auto span = anchor_it->second;
  319|       |
  320|       |         // Empty anchor span (anchor on null/empty node) — leave value as default
  321|  1.82M|         if (span.begin == span.end) {
  ------------------
  |  Branch (321:14): [True: 33.1k, False: 1.79M]
  ------------------
  322|  33.1k|            return true;
  323|  33.1k|         }
  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.79M|         if (ctx.alias_span_is_replaying(span.begin, span.end)) [[unlikely]] {
  ------------------
  |  Branch (328:14): [True: 462, False: 1.79M]
  ------------------
  329|    462|            ctx.error = error_code::syntax_error; // cyclic alias
  330|    462|            return true;
  331|    462|         }
  332|       |
  333|       |         // Replaying an anchor re-enters the reader directly, bypassing the variant reader's
  334|       |         // depth guard, so this is the only depth accounting a chain of aliases into a
  335|       |         // non-variant target gets. The cycle check above stops the unbounded case; this bounds
  336|       |         // a legitimate but deeply chained one.
  337|  1.79M|         depth_guard guard{ctx, yaml::max_yaml_recursive_depth};
  338|  1.79M|         if (!guard) [[unlikely]]
  ------------------
  |  Branch (338:14): [True: 12, False: 1.79M]
  ------------------
  339|     12|            return true;
  340|       |
  341|  1.79M|         if (!ctx.charge_alias_expansion(static_cast<size_t>(span.end - span.begin))) [[unlikely]] {
  ------------------
  |  Branch (341:14): [True: 24, False: 1.79M]
  ------------------
  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|  1.79M|         auto replay_it = span.begin;
  348|  1.79M|         auto replay_end = span.end;
  349|       |
  350|       |         // Save indent context and set up for replay
  351|  1.79M|         auto saved_indent_stack = std::move(ctx.indent_stack);
  352|  1.79M|         ctx.indent_stack.clear();
  353|  1.79M|         if (span.base_indent > 0) {
  ------------------
  |  Branch (353:14): [True: 42.5k, False: 1.75M]
  ------------------
  354|  42.5k|            ctx.push_indent(span.base_indent - 1);
  355|  42.5k|         }
  356|       |
  357|  1.79M|         ctx.active_alias_spans.emplace_back(span.begin, span.end);
  358|       |
  359|  1.79M|         using V = std::remove_cvref_t<T>;
  360|  1.79M|         from<YAML, V>::template op<Opts>(std::forward<T>(value), ctx, replay_it, replay_end);
  361|       |
  362|  1.79M|         ctx.active_alias_spans.pop_back();
  363|       |
  364|       |         // Restore indent context
  365|  1.79M|         ctx.indent_stack = std::move(saved_indent_stack);
  366|  1.79M|         return true;
  367|  1.79M|      }
_ZN3glz33process_yaml_variant_alternativesINSt3__17variantIJDndNS1_12basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEbNS1_6vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS6_ISD_EEEENSC_ISD_EEEEENS_19is_yaml_variant_strEE2opITnDaXtlNS_4optsELj10ELb1ELb0ELb0ELb1ELb0ELb0ELb0ELb0ELj1EEERSH_TkNS_10is_contextERNS_4yaml12yaml_contextERPKcSR_EEvOT0_OT1_OT2_T3_:
 5205|  2.49M|      {
 5206|  2.49M|         constexpr auto category_count = yaml_variant_count_v<Variant, Trait>;
 5207|       |
 5208|       |         if constexpr (category_count == 0) {
 5209|       |            ctx.error = error_code::no_matching_variant_type;
 5210|       |         }
 5211|  2.49M|         else if constexpr (category_count == 1) {
 5212|       |            // Only one type in this category, use it directly
 5213|  2.49M|            constexpr auto first_idx = yaml_variant_first_index_v<Variant, Trait>;
 5214|  2.49M|            using V = std::variant_alternative_t<first_idx, Variant>;
 5215|  2.49M|            if (!std::holds_alternative<V>(value)) value = V{};
  ------------------
  |  Branch (5215:17): [True: 2.49M, False: 0]
  ------------------
 5216|  2.49M|            from<YAML, V>::template op<Opts>(std::get<V>(value), ctx, it, end);
 5217|       |         }
 5218|       |         else {
 5219|       |            // Multiple types in this category, try each one
 5220|       |            constexpr auto N = std::variant_size_v<Variant>;
 5221|       |            bool found_match{};
 5222|       |            size_t match_idx = 0;
 5223|       |            // Only the last alternative propagates its error, so an alternative that exhausted an
 5224|       |            // expansion budget would otherwise be reported as no_matching_variant_type -- a wrong
 5225|       |            // diagnosis for a document that is hostile rather than merely the wrong shape. Held
 5226|       |            // aside and used only if nothing matched, so an alternative that does succeed later
 5227|       |            // (one that materializes no key text can still parse under a latched budget) is
 5228|       |            // unaffected.
 5229|       |            error_code expansion_error{};
 5230|       |            std::string_view expansion_message{};
 5231|       |
 5232|       |            for_each<N>([&]<size_t I>() {
 5233|       |               if (found_match) {
 5234|       |                  return;
 5235|       |               }
 5236|       |               using V = std::variant_alternative_t<I, Variant>;
 5237|       |               if constexpr (Trait<V>::value) {
 5238|       |                  auto copy_it = it;
 5239|       |                  if (!std::holds_alternative<V>(value)) {
 5240|       |                     value = V{};
 5241|       |                  }
 5242|       |
 5243|       |                  auto temp_ctx = ctx.make_speculative();
 5244|       |                  from<YAML, V>::template op<Opts>(std::get<V>(value), temp_ctx, it, end);
 5245|       |
 5246|       |                  // Charged whether or not the alternative fit: a rejected probe still replayed
 5247|       |                  // whatever aliases it reached, and an attempt that is never billed is an
 5248|       |                  // attempt that can be repeated for free.
 5249|       |                  ctx.alias_expansion_budget = temp_ctx.alias_expansion_budget;
 5250|       |                  ctx.key_expansion_budget = temp_ctx.key_expansion_budget;
 5251|       |
 5252|       |                  if (!bool(temp_ctx.error)) {
 5253|       |                     found_match = true;
 5254|       |                     ctx.anchors = std::move(temp_ctx.anchors);
 5255|       |                  }
 5256|       |                  else {
 5257|       |                     it = copy_it;
 5258|       |                     if (temp_ctx.error == error_code::exceeded_max_expansion && expansion_error == error_code::none) {
 5259|       |                        expansion_error = temp_ctx.error;
 5260|       |                        expansion_message = temp_ctx.custom_error_message;
 5261|       |                     }
 5262|       |                     if (match_idx + 1 < category_count) {
 5263|       |                        // Not the last type, continue trying
 5264|       |                     }
 5265|       |                     else {
 5266|       |                        // Last type failed, propagate error
 5267|       |                        ctx.error = temp_ctx.error;
 5268|       |                        ctx.custom_error_message = temp_ctx.custom_error_message;
 5269|       |                     }
 5270|       |                  }
 5271|       |                  ++match_idx;
 5272|       |               }
 5273|       |            });
 5274|       |
 5275|       |            if (!found_match && !bool(ctx.error)) {
 5276|       |               if (expansion_error != error_code::none) {
 5277|       |                  ctx.error = expansion_error;
 5278|       |                  ctx.custom_error_message = expansion_message;
 5279|       |               }
 5280|       |               else {
 5281|       |                  ctx.error = error_code::no_matching_variant_type;
 5282|       |               }
 5283|       |            }
 5284|       |         }
 5285|  2.49M|      }
_ZN3glz4fromILj450ENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEE2opITnDaXtlNS_4optsELj10ELb1ELb0ELb0ELb1ELb0ELb0ELb0ELb0ELj1EEERPKcRS7_TkNS_10is_contextERNS_4yaml12yaml_contextESC_EEvOT1_OT2_OT0_T3_:
 1892|  2.68M|      {
 1893|  2.68M|         if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (1893:14): [True: 850, False: 2.68M]
  ------------------
 1894|    850|            return;
 1895|       |
 1896|  2.68M|         yaml::node_preamble_state preamble{};
 1897|  2.68M|         if (yaml::parse_node_preamble<Opts, yaml::node_property_policy{true, false, false, true}>(
  ------------------
  |  Branch (1897:14): [True: 196k, False: 2.48M]
  ------------------
 1898|  2.68M|                value, ctx, it, end, preamble, [](yaml::yaml_tag tag) { return yaml::tag_valid_for_string(tag); }))
 1899|   196k|            return;
 1900|       |
 1901|  2.48M|         std::string str;
 1902|  2.48M|         const auto style = yaml::detect_scalar_style(*it);
 1903|       |
 1904|  2.48M|         switch (style) {
  ------------------
  |  Branch (1904:18): [True: 2.48M, False: 0]
  ------------------
 1905|  14.2k|         case yaml::scalar_style::double_quoted:
  ------------------
  |  Branch (1905:10): [True: 14.2k, False: 2.47M]
  ------------------
 1906|  14.2k|            yaml::parse_double_quoted_string(str, ctx, it, end);
 1907|  14.2k|            break;
 1908|  52.0k|         case yaml::scalar_style::single_quoted:
  ------------------
  |  Branch (1908:10): [True: 52.0k, False: 2.43M]
  ------------------
 1909|  52.0k|            yaml::parse_single_quoted_string(str, ctx, it, end);
 1910|  52.0k|            break;
 1911|  1.79k|         case yaml::scalar_style::literal_block:
  ------------------
  |  Branch (1911:10): [True: 1.79k, False: 2.48M]
  ------------------
 1912|  9.02k|         case yaml::scalar_style::folded_block:
  ------------------
  |  Branch (1912:10): [True: 7.22k, False: 2.48M]
  ------------------
 1913|       |            // For same-line mapping/sequence values, parsing context is typically pushed
 1914|       |            // one column past the key/item indicator; block scalar indentation is relative
 1915|       |            // to the parent line indent.
 1916|  9.02k|            yaml::parse_block_scalar(str, ctx, it, end,
 1917|  9.02k|                                     ctx.current_indent() > 0 ? (ctx.current_indent() - 1) : ctx.current_indent());
  ------------------
  |  Branch (1917:38): [True: 1.52k, False: 7.49k]
  ------------------
 1918|  9.02k|            break;
 1919|  2.41M|         case yaml::scalar_style::plain:
  ------------------
  |  Branch (1919:10): [True: 2.41M, False: 75.2k]
  ------------------
 1920|       |            // In block context with known indent, use multiline parsing to support
 1921|       |            // plain scalars that span multiple lines (folding behavior)
 1922|       |            if constexpr (!yaml::check_flow_context(Opts)) {
 1923|       |               if (ctx.current_indent() >= 0) {
 1924|       |                  yaml::parse_plain_scalar_multiline(str, ctx, it, end, ctx.current_indent());
 1925|       |               }
 1926|       |               else {
 1927|       |                  // Top-level plain scalars may continue on same-indent or indented lines.
 1928|       |                  yaml::parse_plain_scalar_multiline(str, ctx, it, end, int32_t(0));
 1929|       |               }
 1930|       |            }
 1931|  2.41M|            else {
 1932|  2.41M|               yaml::parse_plain_scalar(str, ctx, it, end, true);
 1933|  2.41M|            }
 1934|  2.41M|            break;
 1935|  2.48M|         }
 1936|       |
 1937|  2.48M|         if (!bool(ctx.error)) {
  ------------------
  |  Branch (1937:14): [True: 2.48M, False: 182]
  ------------------
 1938|  2.48M|            value = std::move(str);
 1939|  2.48M|            yaml::finalize_node_anchor(preamble.node_props, ctx, it);
 1940|  2.48M|         }
 1941|  2.48M|      }
_ZN3glz4yaml19parse_node_preambleITnDaXtlNS_4optsELj10ELb1ELb0ELb0ELb1ELb0ELb0ELb0ELb0ELj1EEEXtlNS0_20node_property_policyELb1ELb0ELb0ELb1EEELb0ERNSt3__112basic_stringIcNS4_11char_traitsIcEENS4_9allocatorIcEEEENS0_12yaml_contextEPKcSE_ZNS_4fromILj450ESA_E2opITnDaXtlS2_Lj10ELb1ELb0ELb0ELb1ELb0ELb0ELb0ELb0ELj1EEERSE_SB_TkNS_10is_contextERSC_SE_EEvOT1_OT2_OT0_T3_EUlNS0_8yaml_tagEE_EEbSN_RSQ_RT4_T5_RNS0_19node_preamble_stateEOT6_:
  465|  2.68M|      {
  466|  2.68M|         skip_inline_ws(it, end);
  467|       |
  468|  2.68M|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (468:14): [True: 6, False: 2.68M]
  ------------------
  469|      6|            if constexpr (!AllowEmptyInput) {
  470|      6|               ctx.error = error_code::unexpected_end;
  471|      6|            }
  472|      6|            return true;
  473|      6|         }
  474|       |
  475|  2.68M|         preamble.tag = parse_yaml_tag(it, end, ctx);
  476|  2.68M|         if (preamble.tag == yaml_tag::unknown) [[unlikely]] {
  ------------------
  |  Branch (476:14): [True: 6, False: 2.68M]
  ------------------
  477|      6|            ctx.error = error_code::syntax_error;
  478|      6|            return true;
  479|      6|         }
  480|  2.68M|         if (!tag_validator(preamble.tag)) [[unlikely]] {
  ------------------
  |  Branch (480:14): [True: 6, False: 2.68M]
  ------------------
  481|      6|            ctx.error = error_code::syntax_error;
  482|      6|            return true;
  483|      6|         }
  484|       |
  485|  2.68M|         skip_inline_ws(it, end);
  486|       |
  487|  2.68M|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (487:14): [True: 14, False: 2.68M]
  ------------------
  488|     14|            if constexpr (!AllowEmptyInput) {
  489|     14|               ctx.error = error_code::unexpected_end;
  490|     14|            }
  491|     14|            return true;
  492|     14|         }
  493|       |
  494|  2.68M|         if (parse_node_properties<Opts, PropertyPolicy>(std::forward<T>(value), ctx, it, end, preamble.node_props)) {
  ------------------
  |  Branch (494:14): [True: 196k, False: 2.48M]
  ------------------
  495|   196k|            return true;
  496|   196k|         }
  497|       |
  498|  2.48M|         return false;
  499|  2.68M|      }
_ZZN3glz4fromILj450ENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEE2opITnDaXtlNS_4optsELj10ELb1ELb0ELb0ELb1ELb0ELb0ELb0ELb0ELj1EEERPKcRS7_TkNS_10is_contextERNS_4yaml12yaml_contextESC_EEvOT1_OT2_OT0_T3_ENKUlNSF_8yaml_tagEE_clESP_:
 1898|  2.68M|                value, ctx, it, end, preamble, [](yaml::yaml_tag tag) { return yaml::tag_valid_for_string(tag); }))
_ZN3glz4yaml21parse_node_propertiesITnDaXtlNS_4optsELj10ELb1ELb0ELb0ELb1ELb0ELb0ELb0ELb0ELj1EEEXtlNS0_20node_property_policyELb1ELb0ELb0ELb1EEERNSt3__112basic_stringIcNS4_11char_traitsIcEENS4_9allocatorIcEEEENS0_12yaml_contextEPKcSE_EEbOT1_RT2_RT3_T4_RNS0_19node_property_stateE:
  408|  2.68M|      {
  409|  2.68M|         state.has_anchor = false;
  410|  2.68M|         state.anchor_name.clear();
  411|  2.68M|         state.anchor_start = nullptr;
  412|  2.68M|         state.anchor_indent = ctx.current_indent();
  413|       |
  414|  2.68M|         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.68M|            else {
  421|  2.68M|               if (handle_alias<Opts>(std::forward<T>(value), ctx, it, end)) return true;
  ------------------
  |  Branch (421:20): [True: 196k, False: 2.48M]
  ------------------
  422|  2.68M|            }
  423|  2.68M|         }
  424|       |
  425|  2.68M|         if (it != end && *it == '&') {
  ------------------
  |  Branch (425:14): [True: 2.48M, False: 196k]
  |  Branch (425:27): [True: 30.8k, False: 2.45M]
  ------------------
  426|  30.8k|            ++it;
  427|  30.8k|            auto name = parse_anchor_name(it, end);
  428|  30.8k|            if (name.empty()) {
  ------------------
  |  Branch (428:17): [True: 24, False: 30.7k]
  ------------------
  429|     24|               ctx.error = error_code::syntax_error;
  430|     24|               return true;
  431|     24|            }
  432|  30.7k|            skip_inline_ws(it, end);
  433|  30.7k|            if (it == end) {
  ------------------
  |  Branch (433:17): [True: 14, False: 30.7k]
  ------------------
  434|     14|               if constexpr (!Policy.allow_empty_after_anchor) {
  435|     14|                  ctx.error = error_code::unexpected_end;
  436|     14|               }
  437|     14|               return true;
  438|     14|            }
  439|  30.7k|            if constexpr (Policy.disallow_anchor_on_alias) {
  440|  30.7k|               if (*it == '*') {
  ------------------
  |  Branch (440:20): [True: 6, False: 30.7k]
  ------------------
  441|      6|                  ctx.error = error_code::syntax_error;
  442|      6|                  return true;
  443|      6|               }
  444|  30.7k|            }
  445|  30.7k|            state.has_anchor = true;
  446|  30.7k|            state.anchor_name = std::string(name);
  447|  30.7k|            state.anchor_start = &*it;
  448|  30.7k|         }
  449|       |
  450|  2.68M|         return false;
  451|  2.68M|      }
_ZN3glz4yaml12handle_aliasITnDaXtlNS_4optsELj10ELb1ELb0ELb0ELb1ELb0ELb0ELb0ELb0ELj1EEERNSt3__112basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEENS0_12yaml_contextEPKcSD_EEbOT0_RT1_RT2_T3_:
  300|  2.68M|      {
  301|  2.68M|         if (it == end || *it != '*') return false;
  ------------------
  |  Branch (301:14): [True: 0, False: 2.68M]
  |  Branch (301:27): [True: 2.48M, False: 196k]
  ------------------
  302|       |
  303|   196k|         ++it; // skip '*'
  304|   196k|         auto name = parse_anchor_name(it, end);
  305|   196k|         if (name.empty()) {
  ------------------
  |  Branch (305:14): [True: 20, False: 196k]
  ------------------
  306|     20|            ctx.error = error_code::syntax_error;
  307|     20|            return true;
  308|     20|         }
  309|       |
  310|   196k|         auto anchor_it = ctx.anchors.find(name);
  311|   196k|         if (anchor_it == ctx.anchors.end()) {
  ------------------
  |  Branch (311:14): [True: 46, False: 195k]
  ------------------
  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|   195k|         const auto span = anchor_it->second;
  319|       |
  320|       |         // Empty anchor span (anchor on null/empty node) — leave value as default
  321|   195k|         if (span.begin == span.end) {
  ------------------
  |  Branch (321:14): [True: 6.13k, False: 189k]
  ------------------
  322|  6.13k|            return true;
  323|  6.13k|         }
  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|   189k|         if (ctx.alias_span_is_replaying(span.begin, span.end)) [[unlikely]] {
  ------------------
  |  Branch (328:14): [True: 10, False: 189k]
  ------------------
  329|     10|            ctx.error = error_code::syntax_error; // cyclic alias
  330|     10|            return true;
  331|     10|         }
  332|       |
  333|       |         // Replaying an anchor re-enters the reader directly, bypassing the variant reader's
  334|       |         // depth guard, so this is the only depth accounting a chain of aliases into a
  335|       |         // non-variant target gets. The cycle check above stops the unbounded case; this bounds
  336|       |         // a legitimate but deeply chained one.
  337|   189k|         depth_guard guard{ctx, yaml::max_yaml_recursive_depth};
  338|   189k|         if (!guard) [[unlikely]]
  ------------------
  |  Branch (338:14): [True: 24, False: 189k]
  ------------------
  339|     24|            return true;
  340|       |
  341|   189k|         if (!ctx.charge_alias_expansion(static_cast<size_t>(span.end - span.begin))) [[unlikely]] {
  ------------------
  |  Branch (341:14): [True: 6, False: 189k]
  ------------------
  342|      6|            ctx.error = error_code::exceeded_max_expansion;
  343|      6|            ctx.custom_error_message = "alias expansion";
  344|      6|            return true;
  345|      6|         }
  346|       |
  347|   189k|         auto replay_it = span.begin;
  348|   189k|         auto replay_end = span.end;
  349|       |
  350|       |         // Save indent context and set up for replay
  351|   189k|         auto saved_indent_stack = std::move(ctx.indent_stack);
  352|   189k|         ctx.indent_stack.clear();
  353|   189k|         if (span.base_indent > 0) {
  ------------------
  |  Branch (353:14): [True: 1.80k, False: 187k]
  ------------------
  354|  1.80k|            ctx.push_indent(span.base_indent - 1);
  355|  1.80k|         }
  356|       |
  357|   189k|         ctx.active_alias_spans.emplace_back(span.begin, span.end);
  358|       |
  359|   189k|         using V = std::remove_cvref_t<T>;
  360|   189k|         from<YAML, V>::template op<Opts>(std::forward<T>(value), ctx, replay_it, replay_end);
  361|       |
  362|   189k|         ctx.active_alias_spans.pop_back();
  363|       |
  364|       |         // Restore indent context
  365|   189k|         ctx.indent_stack = std::move(saved_indent_stack);
  366|   189k|         return true;
  367|   189k|      }
_ZN3glz33process_yaml_variant_alternativesINSt3__17variantIJDndNS1_12basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEbNS1_6vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS6_ISD_EEEENSC_ISD_EEEEENS_19is_yaml_variant_numEE2opITnDaXtlNS_4optsELj10ELb1ELb0ELb0ELb1ELb0ELb0ELb0ELb0ELj1EEERSH_TkNS_10is_contextERNS_4yaml12yaml_contextERPKcSR_EEvOT0_OT1_OT2_T3_:
 5205|  1.29M|      {
 5206|  1.29M|         constexpr auto category_count = yaml_variant_count_v<Variant, Trait>;
 5207|       |
 5208|       |         if constexpr (category_count == 0) {
 5209|       |            ctx.error = error_code::no_matching_variant_type;
 5210|       |         }
 5211|  1.29M|         else if constexpr (category_count == 1) {
 5212|       |            // Only one type in this category, use it directly
 5213|  1.29M|            constexpr auto first_idx = yaml_variant_first_index_v<Variant, Trait>;
 5214|  1.29M|            using V = std::variant_alternative_t<first_idx, Variant>;
 5215|  1.29M|            if (!std::holds_alternative<V>(value)) value = V{};
  ------------------
  |  Branch (5215:17): [True: 1.29M, False: 0]
  ------------------
 5216|  1.29M|            from<YAML, V>::template op<Opts>(std::get<V>(value), ctx, it, end);
 5217|       |         }
 5218|       |         else {
 5219|       |            // Multiple types in this category, try each one
 5220|       |            constexpr auto N = std::variant_size_v<Variant>;
 5221|       |            bool found_match{};
 5222|       |            size_t match_idx = 0;
 5223|       |            // Only the last alternative propagates its error, so an alternative that exhausted an
 5224|       |            // expansion budget would otherwise be reported as no_matching_variant_type -- a wrong
 5225|       |            // diagnosis for a document that is hostile rather than merely the wrong shape. Held
 5226|       |            // aside and used only if nothing matched, so an alternative that does succeed later
 5227|       |            // (one that materializes no key text can still parse under a latched budget) is
 5228|       |            // unaffected.
 5229|       |            error_code expansion_error{};
 5230|       |            std::string_view expansion_message{};
 5231|       |
 5232|       |            for_each<N>([&]<size_t I>() {
 5233|       |               if (found_match) {
 5234|       |                  return;
 5235|       |               }
 5236|       |               using V = std::variant_alternative_t<I, Variant>;
 5237|       |               if constexpr (Trait<V>::value) {
 5238|       |                  auto copy_it = it;
 5239|       |                  if (!std::holds_alternative<V>(value)) {
 5240|       |                     value = V{};
 5241|       |                  }
 5242|       |
 5243|       |                  auto temp_ctx = ctx.make_speculative();
 5244|       |                  from<YAML, V>::template op<Opts>(std::get<V>(value), temp_ctx, it, end);
 5245|       |
 5246|       |                  // Charged whether or not the alternative fit: a rejected probe still replayed
 5247|       |                  // whatever aliases it reached, and an attempt that is never billed is an
 5248|       |                  // attempt that can be repeated for free.
 5249|       |                  ctx.alias_expansion_budget = temp_ctx.alias_expansion_budget;
 5250|       |                  ctx.key_expansion_budget = temp_ctx.key_expansion_budget;
 5251|       |
 5252|       |                  if (!bool(temp_ctx.error)) {
 5253|       |                     found_match = true;
 5254|       |                     ctx.anchors = std::move(temp_ctx.anchors);
 5255|       |                  }
 5256|       |                  else {
 5257|       |                     it = copy_it;
 5258|       |                     if (temp_ctx.error == error_code::exceeded_max_expansion && expansion_error == error_code::none) {
 5259|       |                        expansion_error = temp_ctx.error;
 5260|       |                        expansion_message = temp_ctx.custom_error_message;
 5261|       |                     }
 5262|       |                     if (match_idx + 1 < category_count) {
 5263|       |                        // Not the last type, continue trying
 5264|       |                     }
 5265|       |                     else {
 5266|       |                        // Last type failed, propagate error
 5267|       |                        ctx.error = temp_ctx.error;
 5268|       |                        ctx.custom_error_message = temp_ctx.custom_error_message;
 5269|       |                     }
 5270|       |                  }
 5271|       |                  ++match_idx;
 5272|       |               }
 5273|       |            });
 5274|       |
 5275|       |            if (!found_match && !bool(ctx.error)) {
 5276|       |               if (expansion_error != error_code::none) {
 5277|       |                  ctx.error = expansion_error;
 5278|       |                  ctx.custom_error_message = expansion_message;
 5279|       |               }
 5280|       |               else {
 5281|       |                  ctx.error = error_code::no_matching_variant_type;
 5282|       |               }
 5283|       |            }
 5284|       |         }
 5285|  1.29M|      }
_ZN3glz4fromILj450EdE2opITnDaXtlNS_4optsELj10ELb1ELb0ELb0ELb1ELb0ELb0ELb0ELb0ELj1EEERPKcRdTkNS_10is_contextERNS_4yaml12yaml_contextES5_EEvOT1_OT2_OT0_T3_:
 2047|  1.30M|      {
 2048|  1.30M|         if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2048:14): [True: 0, False: 1.30M]
  ------------------
 2049|      0|            return;
 2050|       |
 2051|  1.30M|         yaml::node_preamble_state preamble{};
 2052|  1.30M|         if (yaml::parse_node_preamble<Opts>(value, ctx, it, end, preamble, [](yaml::yaml_tag tag) {
  ------------------
  |  Branch (2052:14): [True: 13.8k, False: 1.29M]
  ------------------
 2053|  1.30M|                if constexpr (std::floating_point<std::remove_cvref_t<T>>) {
 2054|  1.30M|                   return yaml::tag_valid_for_float(tag);
 2055|  1.30M|                }
 2056|  1.30M|                else {
 2057|  1.30M|                   return yaml::tag_valid_for_int(tag);
 2058|  1.30M|                }
 2059|  1.30M|             }))
 2060|  13.8k|            return;
 2061|       |
 2062|  1.29M|         auto finalize = [&] { yaml::finalize_node_anchor(preamble.node_props, ctx, it); };
 2063|       |
 2064|       |         // Check for special float values
 2065|  1.29M|         if constexpr (std::floating_point<std::remove_cvref_t<T>>) {
 2066|  1.29M|            auto start = it;
 2067|       |
 2068|       |            // Check for .inf, .nan, -.inf, etc.
 2069|  1.29M|            if (*it == '.') {
  ------------------
  |  Branch (2069:17): [True: 74.9k, False: 1.21M]
  ------------------
 2070|  74.9k|               ++it;
 2071|  74.9k|               if (it + 3 <= end && (std::string_view(it, 3) == "inf" || std::string_view(it, 3) == "Inf" ||
  ------------------
  |  Branch (2071:20): [True: 65.4k, False: 9.46k]
  |  Branch (2071:38): [True: 874, False: 64.5k]
  |  Branch (2071:74): [True: 1.77k, False: 62.8k]
  ------------------
 2072|  62.8k|                                     std::string_view(it, 3) == "INF")) {
  ------------------
  |  Branch (2072:38): [True: 4.69k, False: 58.1k]
  ------------------
 2073|  7.34k|                  value = std::numeric_limits<std::remove_cvref_t<T>>::infinity();
 2074|  7.34k|                  it += 3;
 2075|  7.34k|                  finalize();
 2076|  7.34k|                  return;
 2077|  7.34k|               }
 2078|  67.5k|               if (it + 3 <= end && (std::string_view(it, 3) == "nan" || std::string_view(it, 3) == "NaN" ||
  ------------------
  |  Branch (2078:20): [True: 58.1k, False: 9.46k]
  |  Branch (2078:38): [True: 764, False: 57.3k]
  |  Branch (2078:74): [True: 1.76k, False: 55.5k]
  ------------------
 2079|  55.5k|                                     std::string_view(it, 3) == "NAN")) {
  ------------------
  |  Branch (2079:38): [True: 3.72k, False: 51.8k]
  ------------------
 2080|  6.25k|                  value = std::numeric_limits<std::remove_cvref_t<T>>::quiet_NaN();
 2081|  6.25k|                  it += 3;
 2082|  6.25k|                  finalize();
 2083|  6.25k|                  return;
 2084|  6.25k|               }
 2085|  61.3k|               it = start;
 2086|  61.3k|            }
 2087|       |
 2088|  1.27M|            if (*it == '-' || *it == '+') {
  ------------------
  |  Branch (2088:17): [True: 329k, False: 948k]
  |  Branch (2088:31): [True: 110k, False: 838k]
  ------------------
 2089|   439k|               const char sign = *it;
 2090|   439k|               ++it;
 2091|   439k|               if (it != end && *it == '.') {
  ------------------
  |  Branch (2091:20): [True: 437k, False: 2.06k]
  |  Branch (2091:33): [True: 322k, False: 114k]
  ------------------
 2092|   322k|                  ++it;
 2093|   322k|                  if (it + 3 <= end && (std::string_view(it, 3) == "inf" || std::string_view(it, 3) == "Inf" ||
  ------------------
  |  Branch (2093:23): [True: 321k, False: 1.18k]
  |  Branch (2093:41): [True: 312k, False: 8.61k]
  |  Branch (2093:77): [True: 1.68k, False: 6.93k]
  ------------------
 2094|   316k|                                        std::string_view(it, 3) == "INF")) {
  ------------------
  |  Branch (2094:41): [True: 2.48k, False: 4.44k]
  ------------------
 2095|   316k|                     if (sign == '-') {
  ------------------
  |  Branch (2095:26): [True: 314k, False: 1.92k]
  ------------------
 2096|   314k|                        value = -std::numeric_limits<std::remove_cvref_t<T>>::infinity();
 2097|   314k|                     }
 2098|  1.92k|                     else {
 2099|  1.92k|                        value = std::numeric_limits<std::remove_cvref_t<T>>::infinity();
 2100|  1.92k|                     }
 2101|   316k|                     it += 3;
 2102|   316k|                     finalize();
 2103|   316k|                     return;
 2104|   316k|                  }
 2105|   322k|               }
 2106|   122k|               it = start;
 2107|   122k|            }
 2108|  1.27M|         }
 2109|       |
 2110|       |         // Parse as plain scalar and convert
 2111|   960k|         auto start = it;
 2112|       |
 2113|       |         // Find end of number - use same rules as plain scalar for colons
 2114|  32.9M|         while (it != end) {
  ------------------
  |  Branch (2114:17): [True: 32.5M, False: 349k]
  ------------------
 2115|  32.5M|            const char c = *it;
 2116|  32.5M|            if (c == ' ' || c == '\t' || c == '\n' || c == '\r' || c == ',' || c == ']' || c == '}' || c == '#') {
  ------------------
  |  Branch (2116:17): [True: 414k, False: 32.1M]
  |  Branch (2116:29): [True: 335k, False: 31.8M]
  |  Branch (2116:42): [True: 12.2k, False: 31.8M]
  |  Branch (2116:55): [True: 30.2k, False: 31.7M]
  |  Branch (2116:68): [True: 80.0k, False: 31.6M]
  |  Branch (2116:80): [True: 2.58k, False: 31.6M]
  |  Branch (2116:92): [True: 8.45k, False: 31.6M]
  |  Branch (2116:104): [True: 49.3k, False: 31.6M]
  ------------------
 2117|   932k|               break;
 2118|   932k|            }
 2119|       |            // Colon only ends number if followed by space/tab/newline/end (YAML mapping indicator)
 2120|  31.6M|            if (c == ':') {
  ------------------
  |  Branch (2120:17): [True: 80.2k, False: 31.5M]
  ------------------
 2121|  80.2k|               if ((it + 1) == end || *(it + 1) == ' ' || *(it + 1) == '\t' || *(it + 1) == '\n' || *(it + 1) == '\r') {
  ------------------
  |  Branch (2121:20): [True: 1.55k, False: 78.6k]
  |  Branch (2121:39): [True: 2.37k, False: 76.2k]
  |  Branch (2121:59): [True: 856, False: 75.4k]
  |  Branch (2121:80): [True: 4.14k, False: 71.2k]
  |  Branch (2121:101): [True: 716, False: 70.5k]
  ------------------
 2122|  9.64k|                  break;
 2123|  9.64k|               }
 2124|  80.2k|            }
 2125|  31.6M|            ++it;
 2126|  31.6M|         }
 2127|       |
 2128|  1.29M|         const std::string_view num_str(&*start, static_cast<size_t>(it - start));
 2129|       |
 2130|  1.29M|         if (num_str.empty()) {
  ------------------
  |  Branch (2130:14): [True: 304, False: 1.29M]
  ------------------
 2131|    304|            ctx.error = error_code::parse_number_failure;
 2132|    304|            return;
 2133|    304|         }
 2134|       |
 2135|       |         // Handle hex, octal, binary
 2136|       |         if constexpr (std::integral<std::remove_cvref_t<T>>) {
 2137|       |            if (num_str.size() > 2 && num_str[0] == '0') {
 2138|       |               int base = 10;
 2139|       |               size_t offset = 0;
 2140|       |
 2141|       |               if (num_str[1] == 'x' || num_str[1] == 'X') {
 2142|       |                  base = 16;
 2143|       |                  offset = 2;
 2144|       |               }
 2145|       |               else if (num_str[1] == 'o' || num_str[1] == 'O') {
 2146|       |                  base = 8;
 2147|       |                  offset = 2;
 2148|       |               }
 2149|       |               else if (num_str[1] == 'b' || num_str[1] == 'B') {
 2150|       |                  base = 2;
 2151|       |                  offset = 2;
 2152|       |               }
 2153|       |
 2154|       |               if (base != 10) {
 2155|       |                  const auto digits = num_str.substr(offset);
 2156|       |                  const bool has_underscores = (digits.find('_') != std::string_view::npos);
 2157|       |
 2158|       |                  std::string clean_storage;
 2159|       |                  std::string_view clean_view;
 2160|       |
 2161|       |                  if (has_underscores) {
 2162|       |                     clean_storage.reserve(digits.size());
 2163|       |                     for (char c : digits) {
 2164|       |                        if (c != '_') {
 2165|       |                           clean_storage.push_back(c);
 2166|       |                        }
 2167|       |                     }
 2168|       |                     clean_view = clean_storage;
 2169|       |                  }
 2170|       |                  else {
 2171|       |                     clean_view = digits;
 2172|       |                  }
 2173|       |
 2174|       |                  auto [ptr, ec] =
 2175|       |                     std::from_chars(clean_view.data(), clean_view.data() + clean_view.size(), value, base);
 2176|       |                  if (ec != std::errc{}) {
 2177|       |                     ctx.error = error_code::parse_number_failure;
 2178|       |                  }
 2179|       |                  finalize();
 2180|       |                  return;
 2181|       |               }
 2182|       |            }
 2183|       |         }
 2184|  1.29M|         else if constexpr (std::floating_point<std::remove_cvref_t<T>>) {
 2185|  1.29M|            bool negative = false;
 2186|  1.29M|            std::string_view digits = num_str;
 2187|       |
 2188|  1.29M|            if (!digits.empty() && (digits.front() == '+' || digits.front() == '-')) {
  ------------------
  |  Branch (2188:17): [True: 960k, False: 330k]
  |  Branch (2188:37): [True: 108k, False: 852k]
  |  Branch (2188:62): [True: 14.2k, False: 837k]
  ------------------
 2189|   122k|               negative = (digits.front() == '-');
 2190|   122k|               digits.remove_prefix(1);
 2191|   122k|            }
 2192|       |
 2193|  1.29M|            if (digits.size() > 2 && digits[0] == '0') {
  ------------------
  |  Branch (2193:17): [True: 517k, False: 773k]
  |  Branch (2193:38): [True: 367k, False: 149k]
  ------------------
 2194|   367k|               int base = 10;
 2195|   367k|               size_t offset = 0;
 2196|       |
 2197|   367k|               if (digits[1] == 'x' || digits[1] == 'X') {
  ------------------
  |  Branch (2197:20): [True: 12.1k, False: 355k]
  |  Branch (2197:40): [True: 658, False: 355k]
  ------------------
 2198|  12.8k|                  base = 16;
 2199|  12.8k|                  offset = 2;
 2200|  12.8k|               }
 2201|   355k|               else if (digits[1] == 'o' || digits[1] == 'O') {
  ------------------
  |  Branch (2201:25): [True: 5.01k, False: 350k]
  |  Branch (2201:45): [True: 4.74k, False: 345k]
  ------------------
 2202|  9.76k|                  base = 8;
 2203|  9.76k|                  offset = 2;
 2204|  9.76k|               }
 2205|   345k|               else if (digits[1] == 'b' || digits[1] == 'B') {
  ------------------
  |  Branch (2205:25): [True: 2.11k, False: 343k]
  |  Branch (2205:45): [True: 1.51k, False: 341k]
  ------------------
 2206|  3.62k|                  base = 2;
 2207|  3.62k|                  offset = 2;
 2208|  3.62k|               }
 2209|       |
 2210|   367k|               if (base != 10) {
  ------------------
  |  Branch (2210:20): [True: 26.1k, False: 341k]
  ------------------
 2211|  26.1k|                  auto raw_digits = digits.substr(offset);
 2212|  26.1k|                  const bool has_underscores = (raw_digits.find('_') != std::string_view::npos);
 2213|       |
 2214|  26.1k|                  std::string clean_storage;
 2215|  26.1k|                  std::string_view clean_view;
 2216|  26.1k|                  if (has_underscores) {
  ------------------
  |  Branch (2216:23): [True: 6.00k, False: 20.1k]
  ------------------
 2217|  6.00k|                     clean_storage.reserve(raw_digits.size());
 2218|  1.45M|                     for (char c : raw_digits) {
  ------------------
  |  Branch (2218:34): [True: 1.45M, False: 6.00k]
  ------------------
 2219|  1.45M|                        if (c != '_') {
  ------------------
  |  Branch (2219:29): [True: 1.44M, False: 7.06k]
  ------------------
 2220|  1.44M|                           clean_storage.push_back(c);
 2221|  1.44M|                        }
 2222|  1.45M|                     }
 2223|  6.00k|                     clean_view = clean_storage;
 2224|  6.00k|                  }
 2225|  20.1k|                  else {
 2226|  20.1k|                     clean_view = raw_digits;
 2227|  20.1k|                  }
 2228|       |
 2229|  26.1k|                  uint64_t parsed_int{};
 2230|  26.1k|                  auto [ptr, ec] =
 2231|  26.1k|                     std::from_chars(clean_view.data(), clean_view.data() + clean_view.size(), parsed_int, base);
 2232|  26.1k|                  if (ec != std::errc{} || ptr != (clean_view.data() + clean_view.size())) {
  ------------------
  |  Branch (2232:23): [True: 9.26k, False: 16.9k]
  |  Branch (2232:44): [True: 10.6k, False: 6.26k]
  ------------------
 2233|  19.9k|                     ctx.error = error_code::parse_number_failure;
 2234|  19.9k|                     finalize();
 2235|  19.9k|                     return;
 2236|  19.9k|                  }
 2237|       |
 2238|  6.26k|                  const auto as_float = static_cast<std::remove_cvref_t<T>>(parsed_int);
 2239|  6.26k|                  value = negative ? -as_float : as_float;
  ------------------
  |  Branch (2239:27): [True: 1.65k, False: 4.60k]
  ------------------
 2240|  6.26k|                  finalize();
 2241|  6.26k|                  return;
 2242|  26.1k|               }
 2243|   367k|            }
 2244|  1.29M|         }
 2245|       |
 2246|       |         // Standard number parsing - only allocate if underscores present
 2247|  1.26M|         const bool has_underscores = (num_str.find('_') != std::string_view::npos);
 2248|       |
 2249|  1.29M|         std::string clean_storage;
 2250|  1.29M|         std::string_view clean_view;
 2251|       |
 2252|  1.29M|         if (has_underscores) {
  ------------------
  |  Branch (2252:14): [True: 9.78k, False: 1.28M]
  ------------------
 2253|  9.78k|            clean_storage.reserve(num_str.size());
 2254|  1.35M|            for (char c : num_str) {
  ------------------
  |  Branch (2254:25): [True: 1.35M, False: 9.78k]
  ------------------
 2255|  1.35M|               if (c != '_') {
  ------------------
  |  Branch (2255:20): [True: 1.31M, False: 43.3k]
  ------------------
 2256|  1.31M|                  clean_storage.push_back(c);
 2257|  1.31M|               }
 2258|  1.35M|            }
 2259|  9.78k|            clean_view = clean_storage;
 2260|  9.78k|         }
 2261|  1.28M|         else {
 2262|  1.28M|            clean_view = num_str;
 2263|  1.28M|         }
 2264|       |
 2265|       |         // YAML allows leading '+' for positive numbers, but C++ from_chars doesn't
 2266|       |         // Strip leading '+' if present
 2267|  1.29M|         auto parse_view = clean_view;
 2268|  1.29M|         if (!parse_view.empty() && parse_view.front() == '+') {
  ------------------
  |  Branch (2268:14): [True: 934k, False: 356k]
  |  Branch (2268:37): [True: 108k, False: 825k]
  ------------------
 2269|   108k|            parse_view.remove_prefix(1);
 2270|   108k|            if (parse_view.empty()) {
  ------------------
  |  Branch (2270:17): [True: 11.2k, False: 96.9k]
  ------------------
 2271|  11.2k|               ctx.error = error_code::parse_number_failure;
 2272|  11.2k|               return;
 2273|  11.2k|            }
 2274|   108k|         }
 2275|       |
 2276|  1.27M|         if constexpr (std::floating_point<std::remove_cvref_t<T>>) {
 2277|  1.27M|            auto result = glz::fast_float::from_chars(parse_view.data(), parse_view.data() + parse_view.size(), value);
 2278|       |            // Check both for errors and that all input was consumed (e.g., "12:30" is not a valid number)
 2279|  1.27M|            if (result.ec != std::errc{} || result.ptr != parse_view.data() + parse_view.size()) {
  ------------------
  |  Branch (2279:17): [True: 500k, False: 778k]
  |  Branch (2279:45): [True: 392k, False: 386k]
  ------------------
 2280|   536k|               ctx.error = error_code::parse_number_failure;
 2281|   536k|            }
 2282|       |         }
 2283|       |         else {
 2284|       |            auto [ptr, ec] = std::from_chars(parse_view.data(), parse_view.data() + parse_view.size(), value);
 2285|       |            // Check both for errors and that all input was consumed
 2286|       |            if (ec != std::errc{} || ptr != parse_view.data() + parse_view.size()) {
 2287|       |               ctx.error = error_code::parse_number_failure;
 2288|       |            }
 2289|       |         }
 2290|       |
 2291|  1.27M|         finalize();
 2292|  1.27M|      }
_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.30M|      {
  466|  1.30M|         skip_inline_ws(it, end);
  467|       |
  468|  1.30M|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (468:14): [True: 152, False: 1.30M]
  ------------------
  469|    152|            if constexpr (!AllowEmptyInput) {
  470|    152|               ctx.error = error_code::unexpected_end;
  471|    152|            }
  472|    152|            return true;
  473|    152|         }
  474|       |
  475|  1.30M|         preamble.tag = parse_yaml_tag(it, end, ctx);
  476|  1.30M|         if (preamble.tag == yaml_tag::unknown) [[unlikely]] {
  ------------------
  |  Branch (476:14): [True: 54, False: 1.30M]
  ------------------
  477|     54|            ctx.error = error_code::syntax_error;
  478|     54|            return true;
  479|     54|         }
  480|  1.30M|         if (!tag_validator(preamble.tag)) [[unlikely]] {
  ------------------
  |  Branch (480:14): [True: 10, False: 1.30M]
  ------------------
  481|     10|            ctx.error = error_code::syntax_error;
  482|     10|            return true;
  483|     10|         }
  484|       |
  485|  1.30M|         skip_inline_ws(it, end);
  486|       |
  487|  1.30M|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (487:14): [True: 10, False: 1.30M]
  ------------------
  488|     10|            if constexpr (!AllowEmptyInput) {
  489|     10|               ctx.error = error_code::unexpected_end;
  490|     10|            }
  491|     10|            return true;
  492|     10|         }
  493|       |
  494|  1.30M|         if (parse_node_properties<Opts, PropertyPolicy>(std::forward<T>(value), ctx, it, end, preamble.node_props)) {
  ------------------
  |  Branch (494:14): [True: 13.6k, False: 1.29M]
  ------------------
  495|  13.6k|            return true;
  496|  13.6k|         }
  497|       |
  498|  1.29M|         return false;
  499|  1.30M|      }
_ZZN3glz4fromILj450EdE2opITnDaXtlNS_4optsELj10ELb1ELb0ELb0ELb1ELb0ELb0ELb0ELb0ELj1EEERPKcRdTkNS_10is_contextERNS_4yaml12yaml_contextES5_EEvOT1_OT2_OT0_T3_ENKUlNS8_8yaml_tagEE_clESI_:
 2052|  1.30M|         if (yaml::parse_node_preamble<Opts>(value, ctx, it, end, preamble, [](yaml::yaml_tag tag) {
 2053|  1.30M|                if constexpr (std::floating_point<std::remove_cvref_t<T>>) {
 2054|  1.30M|                   return yaml::tag_valid_for_float(tag);
 2055|       |                }
 2056|       |                else {
 2057|       |                   return yaml::tag_valid_for_int(tag);
 2058|       |                }
 2059|  1.30M|             }))
_ZN3glz4yaml21parse_node_propertiesITnDaXtlNS_4optsELj10ELb1ELb0ELb0ELb1ELb0ELb0ELb0ELb0ELj1EEEXtlNS0_20node_property_policyELb1EEERdNS0_12yaml_contextEPKcS7_EEbOT1_RT2_RT3_T4_RNS0_19node_property_stateE:
  408|  1.30M|      {
  409|  1.30M|         state.has_anchor = false;
  410|  1.30M|         state.anchor_name.clear();
  411|  1.30M|         state.anchor_start = nullptr;
  412|  1.30M|         state.anchor_indent = ctx.current_indent();
  413|       |
  414|  1.30M|         if constexpr (Policy.allow_alias) {
  415|       |            if constexpr (Policy.alias_can_be_mapping_key) {
  416|       |               if (!alias_token_is_mapping_key(it, end)) {
  417|       |                  if (handle_alias<Opts>(std::forward<T>(value), ctx, it, end)) return true;
  418|       |               }
  419|       |            }
  420|  1.30M|            else {
  421|  1.30M|               if (handle_alias<Opts>(std::forward<T>(value), ctx, it, end)) return true;
  ------------------
  |  Branch (421:20): [True: 13.6k, False: 1.29M]
  ------------------
  422|  1.30M|            }
  423|  1.30M|         }
  424|       |
  425|  1.30M|         if (it != end && *it == '&') {
  ------------------
  |  Branch (425:14): [True: 1.29M, False: 13.6k]
  |  Branch (425:27): [True: 6.54k, False: 1.28M]
  ------------------
  426|  6.54k|            ++it;
  427|  6.54k|            auto name = parse_anchor_name(it, end);
  428|  6.54k|            if (name.empty()) {
  ------------------
  |  Branch (428:17): [True: 12, False: 6.53k]
  ------------------
  429|     12|               ctx.error = error_code::syntax_error;
  430|     12|               return true;
  431|     12|            }
  432|  6.53k|            skip_inline_ws(it, end);
  433|  6.53k|            if (it == end) {
  ------------------
  |  Branch (433:17): [True: 16, False: 6.51k]
  ------------------
  434|     16|               if constexpr (!Policy.allow_empty_after_anchor) {
  435|     16|                  ctx.error = error_code::unexpected_end;
  436|     16|               }
  437|     16|               return true;
  438|     16|            }
  439|       |            if constexpr (Policy.disallow_anchor_on_alias) {
  440|       |               if (*it == '*') {
  441|       |                  ctx.error = error_code::syntax_error;
  442|       |                  return true;
  443|       |               }
  444|       |            }
  445|  6.51k|            state.has_anchor = true;
  446|  6.51k|            state.anchor_name = std::string(name);
  447|  6.51k|            state.anchor_start = &*it;
  448|  6.51k|         }
  449|       |
  450|  1.30M|         return false;
  451|  1.30M|      }
_ZN3glz4yaml12handle_aliasITnDaXtlNS_4optsELj10ELb1ELb0ELb0ELb1ELb0ELb0ELb0ELb0ELj1EEERdNS0_12yaml_contextEPKcS6_EEbOT0_RT1_RT2_T3_:
  300|  1.30M|      {
  301|  1.30M|         if (it == end || *it != '*') return false;
  ------------------
  |  Branch (301:14): [True: 0, False: 1.30M]
  |  Branch (301:27): [True: 1.29M, False: 13.6k]
  ------------------
  302|       |
  303|  13.6k|         ++it; // skip '*'
  304|  13.6k|         auto name = parse_anchor_name(it, end);
  305|  13.6k|         if (name.empty()) {
  ------------------
  |  Branch (305:14): [True: 38, False: 13.5k]
  ------------------
  306|     38|            ctx.error = error_code::syntax_error;
  307|     38|            return true;
  308|     38|         }
  309|       |
  310|  13.5k|         auto anchor_it = ctx.anchors.find(name);
  311|  13.5k|         if (anchor_it == ctx.anchors.end()) {
  ------------------
  |  Branch (311:14): [True: 158, False: 13.4k]
  ------------------
  312|    158|            ctx.error = error_code::syntax_error; // undefined alias
  313|    158|            return true;
  314|    158|         }
  315|       |
  316|       |         // Copied rather than referenced: the replay below can replace ctx.anchors wholesale
  317|       |         // (a speculative parse hands its own map back), which would dangle a reference here.
  318|  13.4k|         const auto span = anchor_it->second;
  319|       |
  320|       |         // Empty anchor span (anchor on null/empty node) — leave value as default
  321|  13.4k|         if (span.begin == span.end) {
  ------------------
  |  Branch (321:14): [True: 4.16k, False: 9.26k]
  ------------------
  322|  4.16k|            return true;
  323|  4.16k|         }
  324|       |
  325|       |         // An anchor is invisible to itself while it expands. A span that aliases the name it
  326|       |         // defines -- reachable because a mapping key's anchor is registered over the key text
  327|       |         // before that text is parsed -- would otherwise replay itself forever.
  328|  9.26k|         if (ctx.alias_span_is_replaying(span.begin, span.end)) [[unlikely]] {
  ------------------
  |  Branch (328:14): [True: 14, False: 9.25k]
  ------------------
  329|     14|            ctx.error = error_code::syntax_error; // cyclic alias
  330|     14|            return true;
  331|     14|         }
  332|       |
  333|       |         // Replaying an anchor re-enters the reader directly, bypassing the variant reader's
  334|       |         // depth guard, so this is the only depth accounting a chain of aliases into a
  335|       |         // non-variant target gets. The cycle check above stops the unbounded case; this bounds
  336|       |         // a legitimate but deeply chained one.
  337|  9.25k|         depth_guard guard{ctx, yaml::max_yaml_recursive_depth};
  338|  9.25k|         if (!guard) [[unlikely]]
  ------------------
  |  Branch (338:14): [True: 6, False: 9.24k]
  ------------------
  339|      6|            return true;
  340|       |
  341|  9.24k|         if (!ctx.charge_alias_expansion(static_cast<size_t>(span.end - span.begin))) [[unlikely]] {
  ------------------
  |  Branch (341:14): [True: 0, False: 9.24k]
  ------------------
  342|      0|            ctx.error = error_code::exceeded_max_expansion;
  343|      0|            ctx.custom_error_message = "alias expansion";
  344|      0|            return true;
  345|      0|         }
  346|       |
  347|  9.24k|         auto replay_it = span.begin;
  348|  9.24k|         auto replay_end = span.end;
  349|       |
  350|       |         // Save indent context and set up for replay
  351|  9.24k|         auto saved_indent_stack = std::move(ctx.indent_stack);
  352|  9.24k|         ctx.indent_stack.clear();
  353|  9.24k|         if (span.base_indent > 0) {
  ------------------
  |  Branch (353:14): [True: 5.63k, False: 3.61k]
  ------------------
  354|  5.63k|            ctx.push_indent(span.base_indent - 1);
  355|  5.63k|         }
  356|       |
  357|  9.24k|         ctx.active_alias_spans.emplace_back(span.begin, span.end);
  358|       |
  359|  9.24k|         using V = std::remove_cvref_t<T>;
  360|  9.24k|         from<YAML, V>::template op<Opts>(std::forward<T>(value), ctx, replay_it, replay_end);
  361|       |
  362|  9.24k|         ctx.active_alias_spans.pop_back();
  363|       |
  364|       |         // Restore indent context
  365|  9.24k|         ctx.indent_stack = std::move(saved_indent_stack);
  366|  9.24k|         return true;
  367|  9.24k|      }
_ZZN3glz4fromILj450EdE2opITnDaXtlNS_4optsELj10ELb1ELb0ELb0ELb1ELb0ELb0ELb0ELb0ELj1EEERPKcRdTkNS_10is_contextERNS_4yaml12yaml_contextES5_EEvOT1_OT2_OT0_T3_ENKUlvE_clEv:
 2062|  1.27M|         auto finalize = [&] { yaml::finalize_node_anchor(preamble.node_props, ctx, it); };
_ZN3glz33process_yaml_variant_alternativesINSt3__17variantIJDndNS1_12basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEbNS1_6vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS6_ISD_EEEENSC_ISD_EEEEENS_20is_yaml_variant_boolEE2opITnDaXtlNS_4optsELj10ELb1ELb0ELb0ELb1ELb0ELb0ELb0ELb0ELj1EEERSH_TkNS_10is_contextERNS_4yaml12yaml_contextERPKcSR_EEvOT0_OT1_OT2_T3_:
 5205|  83.2k|      {
 5206|  83.2k|         constexpr auto category_count = yaml_variant_count_v<Variant, Trait>;
 5207|       |
 5208|       |         if constexpr (category_count == 0) {
 5209|       |            ctx.error = error_code::no_matching_variant_type;
 5210|       |         }
 5211|  83.2k|         else if constexpr (category_count == 1) {
 5212|       |            // Only one type in this category, use it directly
 5213|  83.2k|            constexpr auto first_idx = yaml_variant_first_index_v<Variant, Trait>;
 5214|  83.2k|            using V = std::variant_alternative_t<first_idx, Variant>;
 5215|  83.2k|            if (!std::holds_alternative<V>(value)) value = V{};
  ------------------
  |  Branch (5215:17): [True: 83.2k, False: 0]
  ------------------
 5216|  83.2k|            from<YAML, V>::template op<Opts>(std::get<V>(value), ctx, it, end);
 5217|       |         }
 5218|       |         else {
 5219|       |            // Multiple types in this category, try each one
 5220|       |            constexpr auto N = std::variant_size_v<Variant>;
 5221|       |            bool found_match{};
 5222|       |            size_t match_idx = 0;
 5223|       |            // Only the last alternative propagates its error, so an alternative that exhausted an
 5224|       |            // expansion budget would otherwise be reported as no_matching_variant_type -- a wrong
 5225|       |            // diagnosis for a document that is hostile rather than merely the wrong shape. Held
 5226|       |            // aside and used only if nothing matched, so an alternative that does succeed later
 5227|       |            // (one that materializes no key text can still parse under a latched budget) is
 5228|       |            // unaffected.
 5229|       |            error_code expansion_error{};
 5230|       |            std::string_view expansion_message{};
 5231|       |
 5232|       |            for_each<N>([&]<size_t I>() {
 5233|       |               if (found_match) {
 5234|       |                  return;
 5235|       |               }
 5236|       |               using V = std::variant_alternative_t<I, Variant>;
 5237|       |               if constexpr (Trait<V>::value) {
 5238|       |                  auto copy_it = it;
 5239|       |                  if (!std::holds_alternative<V>(value)) {
 5240|       |                     value = V{};
 5241|       |                  }
 5242|       |
 5243|       |                  auto temp_ctx = ctx.make_speculative();
 5244|       |                  from<YAML, V>::template op<Opts>(std::get<V>(value), temp_ctx, it, end);
 5245|       |
 5246|       |                  // Charged whether or not the alternative fit: a rejected probe still replayed
 5247|       |                  // whatever aliases it reached, and an attempt that is never billed is an
 5248|       |                  // attempt that can be repeated for free.
 5249|       |                  ctx.alias_expansion_budget = temp_ctx.alias_expansion_budget;
 5250|       |                  ctx.key_expansion_budget = temp_ctx.key_expansion_budget;
 5251|       |
 5252|       |                  if (!bool(temp_ctx.error)) {
 5253|       |                     found_match = true;
 5254|       |                     ctx.anchors = std::move(temp_ctx.anchors);
 5255|       |                  }
 5256|       |                  else {
 5257|       |                     it = copy_it;
 5258|       |                     if (temp_ctx.error == error_code::exceeded_max_expansion && expansion_error == error_code::none) {
 5259|       |                        expansion_error = temp_ctx.error;
 5260|       |                        expansion_message = temp_ctx.custom_error_message;
 5261|       |                     }
 5262|       |                     if (match_idx + 1 < category_count) {
 5263|       |                        // Not the last type, continue trying
 5264|       |                     }
 5265|       |                     else {
 5266|       |                        // Last type failed, propagate error
 5267|       |                        ctx.error = temp_ctx.error;
 5268|       |                        ctx.custom_error_message = temp_ctx.custom_error_message;
 5269|       |                     }
 5270|       |                  }
 5271|       |                  ++match_idx;
 5272|       |               }
 5273|       |            });
 5274|       |
 5275|       |            if (!found_match && !bool(ctx.error)) {
 5276|       |               if (expansion_error != error_code::none) {
 5277|       |                  ctx.error = expansion_error;
 5278|       |                  ctx.custom_error_message = expansion_message;
 5279|       |               }
 5280|       |               else {
 5281|       |                  ctx.error = error_code::no_matching_variant_type;
 5282|       |               }
 5283|       |            }
 5284|       |         }
 5285|  83.2k|      }
_ZN3glz4fromILj450EbE2opITnDaXtlNS_4optsELj10ELb1ELb0ELb0ELb1ELb0ELb0ELb0ELb0ELj1EEERPKcRbTkNS_10is_contextERNS_4yaml12yaml_contextES5_EEvOT1_OT2_OT0_T3_:
 2012|   112k|      {
 2013|   112k|         if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2013:14): [True: 0, False: 112k]
  ------------------
 2014|      0|            return;
 2015|       |
 2016|   112k|         yaml::node_preamble_state preamble{};
 2017|   112k|         if (yaml::parse_node_preamble<Opts>(value, ctx, it, end, preamble,
  ------------------
  |  Branch (2017:14): [True: 33.3k, False: 78.8k]
  ------------------
 2018|   112k|                                             [](yaml::yaml_tag tag) { return yaml::tag_valid_for_bool(tag); }))
 2019|  33.3k|            return;
 2020|       |
 2021|       |         // Parse as plain scalar first
 2022|  78.8k|         std::string str;
 2023|  78.8k|         yaml::parse_plain_scalar(str, ctx, it, end, yaml::check_flow_context(Opts));
 2024|       |
 2025|  78.8k|         if (str == "true" || str == "True" || str == "TRUE" || str == "yes" || str == "Yes" || str == "YES" ||
  ------------------
  |  Branch (2025:14): [True: 4.78k, False: 74.0k]
  |  Branch (2025:31): [True: 2.86k, False: 71.2k]
  |  Branch (2025:48): [True: 1.31k, False: 69.9k]
  |  Branch (2025:65): [True: 1.71k, False: 68.2k]
  |  Branch (2025:81): [True: 6.83k, False: 61.3k]
  |  Branch (2025:97): [True: 3.74k, False: 57.6k]
  ------------------
 2026|  57.6k|             str == "on" || str == "On" || str == "ON") {
  ------------------
  |  Branch (2026:14): [True: 3.41k, False: 54.2k]
  |  Branch (2026:29): [True: 1.38k, False: 52.8k]
  |  Branch (2026:44): [True: 542, False: 52.2k]
  ------------------
 2027|  26.5k|            value = true;
 2028|  26.5k|         }
 2029|  52.2k|         else if (str == "false" || str == "False" || str == "FALSE" || str == "no" || str == "No" || str == "NO" ||
  ------------------
  |  Branch (2029:19): [True: 30.1k, False: 22.1k]
  |  Branch (2029:37): [True: 456, False: 21.7k]
  |  Branch (2029:55): [True: 13.4k, False: 8.26k]
  |  Branch (2029:73): [True: 1.18k, False: 7.08k]
  |  Branch (2029:88): [True: 2.88k, False: 4.20k]
  |  Branch (2029:103): [True: 1.24k, False: 2.95k]
  ------------------
 2030|  52.0k|                  str == "off" || str == "Off" || str == "OFF") {
  ------------------
  |  Branch (2030:19): [True: 306, False: 2.64k]
  |  Branch (2030:35): [True: 1.00k, False: 1.64k]
  |  Branch (2030:51): [True: 1.43k, False: 208]
  ------------------
 2031|  52.0k|            value = false;
 2032|  52.0k|         }
 2033|    208|         else {
 2034|    208|            ctx.error = error_code::expected_true_or_false;
 2035|    208|         }
 2036|       |
 2037|  78.8k|         yaml::finalize_node_anchor(preamble.node_props, ctx, it);
 2038|  78.8k|      }
_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|   112k|      {
  466|   112k|         skip_inline_ws(it, end);
  467|       |
  468|   112k|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (468:14): [True: 6, False: 112k]
  ------------------
  469|      6|            if constexpr (!AllowEmptyInput) {
  470|      6|               ctx.error = error_code::unexpected_end;
  471|      6|            }
  472|      6|            return true;
  473|      6|         }
  474|       |
  475|   112k|         preamble.tag = parse_yaml_tag(it, end, ctx);
  476|   112k|         if (preamble.tag == yaml_tag::unknown) [[unlikely]] {
  ------------------
  |  Branch (476:14): [True: 6, False: 112k]
  ------------------
  477|      6|            ctx.error = error_code::syntax_error;
  478|      6|            return true;
  479|      6|         }
  480|   112k|         if (!tag_validator(preamble.tag)) [[unlikely]] {
  ------------------
  |  Branch (480:14): [True: 6, False: 112k]
  ------------------
  481|      6|            ctx.error = error_code::syntax_error;
  482|      6|            return true;
  483|      6|         }
  484|       |
  485|   112k|         skip_inline_ws(it, end);
  486|       |
  487|   112k|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (487:14): [True: 6, False: 112k]
  ------------------
  488|      6|            if constexpr (!AllowEmptyInput) {
  489|      6|               ctx.error = error_code::unexpected_end;
  490|      6|            }
  491|      6|            return true;
  492|      6|         }
  493|       |
  494|   112k|         if (parse_node_properties<Opts, PropertyPolicy>(std::forward<T>(value), ctx, it, end, preamble.node_props)) {
  ------------------
  |  Branch (494:14): [True: 33.3k, False: 78.8k]
  ------------------
  495|  33.3k|            return true;
  496|  33.3k|         }
  497|       |
  498|  78.8k|         return false;
  499|   112k|      }
_ZZN3glz4fromILj450EbE2opITnDaXtlNS_4optsELj10ELb1ELb0ELb0ELb1ELb0ELb0ELb0ELb0ELj1EEERPKcRbTkNS_10is_contextERNS_4yaml12yaml_contextES5_EEvOT1_OT2_OT0_T3_ENKUlNS8_8yaml_tagEE_clESI_:
 2018|   112k|                                             [](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|   112k|      {
  409|   112k|         state.has_anchor = false;
  410|   112k|         state.anchor_name.clear();
  411|   112k|         state.anchor_start = nullptr;
  412|   112k|         state.anchor_indent = ctx.current_indent();
  413|       |
  414|   112k|         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|   112k|            else {
  421|   112k|               if (handle_alias<Opts>(std::forward<T>(value), ctx, it, end)) return true;
  ------------------
  |  Branch (421:20): [True: 33.2k, False: 78.9k]
  ------------------
  422|   112k|            }
  423|   112k|         }
  424|       |
  425|   112k|         if (it != end && *it == '&') {
  ------------------
  |  Branch (425:14): [True: 78.9k, False: 33.2k]
  |  Branch (425:27): [True: 26.5k, False: 52.3k]
  ------------------
  426|  26.5k|            ++it;
  427|  26.5k|            auto name = parse_anchor_name(it, end);
  428|  26.5k|            if (name.empty()) {
  ------------------
  |  Branch (428:17): [True: 6, False: 26.5k]
  ------------------
  429|      6|               ctx.error = error_code::syntax_error;
  430|      6|               return true;
  431|      6|            }
  432|  26.5k|            skip_inline_ws(it, end);
  433|  26.5k|            if (it == end) {
  ------------------
  |  Branch (433:17): [True: 16, False: 26.5k]
  ------------------
  434|     16|               if constexpr (!Policy.allow_empty_after_anchor) {
  435|     16|                  ctx.error = error_code::unexpected_end;
  436|     16|               }
  437|     16|               return true;
  438|     16|            }
  439|       |            if constexpr (Policy.disallow_anchor_on_alias) {
  440|       |               if (*it == '*') {
  441|       |                  ctx.error = error_code::syntax_error;
  442|       |                  return true;
  443|       |               }
  444|       |            }
  445|  26.5k|            state.has_anchor = true;
  446|  26.5k|            state.anchor_name = std::string(name);
  447|  26.5k|            state.anchor_start = &*it;
  448|  26.5k|         }
  449|       |
  450|   112k|         return false;
  451|   112k|      }
_ZN3glz4yaml12handle_aliasITnDaXtlNS_4optsELj10ELb1ELb0ELb0ELb1ELb0ELb0ELb0ELb0ELj1EEERbNS0_12yaml_contextEPKcS6_EEbOT0_RT1_RT2_T3_:
  300|   112k|      {
  301|   112k|         if (it == end || *it != '*') return false;
  ------------------
  |  Branch (301:14): [True: 0, False: 112k]
  |  Branch (301:27): [True: 78.9k, False: 33.2k]
  ------------------
  302|       |
  303|  33.2k|         ++it; // skip '*'
  304|  33.2k|         auto name = parse_anchor_name(it, end);
  305|  33.2k|         if (name.empty()) {
  ------------------
  |  Branch (305:14): [True: 8, False: 33.2k]
  ------------------
  306|      8|            ctx.error = error_code::syntax_error;
  307|      8|            return true;
  308|      8|         }
  309|       |
  310|  33.2k|         auto anchor_it = ctx.anchors.find(name);
  311|  33.2k|         if (anchor_it == ctx.anchors.end()) {
  ------------------
  |  Branch (311:14): [True: 54, False: 33.2k]
  ------------------
  312|     54|            ctx.error = error_code::syntax_error; // undefined alias
  313|     54|            return true;
  314|     54|         }
  315|       |
  316|       |         // Copied rather than referenced: the replay below can replace ctx.anchors wholesale
  317|       |         // (a speculative parse hands its own map back), which would dangle a reference here.
  318|  33.2k|         const auto span = anchor_it->second;
  319|       |
  320|       |         // Empty anchor span (anchor on null/empty node) — leave value as default
  321|  33.2k|         if (span.begin == span.end) {
  ------------------
  |  Branch (321:14): [True: 4.24k, False: 28.9k]
  ------------------
  322|  4.24k|            return true;
  323|  4.24k|         }
  324|       |
  325|       |         // An anchor is invisible to itself while it expands. A span that aliases the name it
  326|       |         // defines -- reachable because a mapping key's anchor is registered over the key text
  327|       |         // before that text is parsed -- would otherwise replay itself forever.
  328|  28.9k|         if (ctx.alias_span_is_replaying(span.begin, span.end)) [[unlikely]] {
  ------------------
  |  Branch (328:14): [True: 0, False: 28.9k]
  ------------------
  329|      0|            ctx.error = error_code::syntax_error; // cyclic alias
  330|      0|            return true;
  331|      0|         }
  332|       |
  333|       |         // Replaying an anchor re-enters the reader directly, bypassing the variant reader's
  334|       |         // depth guard, so this is the only depth accounting a chain of aliases into a
  335|       |         // non-variant target gets. The cycle check above stops the unbounded case; this bounds
  336|       |         // a legitimate but deeply chained one.
  337|  28.9k|         depth_guard guard{ctx, yaml::max_yaml_recursive_depth};
  338|  28.9k|         if (!guard) [[unlikely]]
  ------------------
  |  Branch (338:14): [True: 0, False: 28.9k]
  ------------------
  339|      0|            return true;
  340|       |
  341|  28.9k|         if (!ctx.charge_alias_expansion(static_cast<size_t>(span.end - span.begin))) [[unlikely]] {
  ------------------
  |  Branch (341:14): [True: 0, False: 28.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|  28.9k|         auto replay_it = span.begin;
  348|  28.9k|         auto replay_end = span.end;
  349|       |
  350|       |         // Save indent context and set up for replay
  351|  28.9k|         auto saved_indent_stack = std::move(ctx.indent_stack);
  352|  28.9k|         ctx.indent_stack.clear();
  353|  28.9k|         if (span.base_indent > 0) {
  ------------------
  |  Branch (353:14): [True: 620, False: 28.3k]
  ------------------
  354|    620|            ctx.push_indent(span.base_indent - 1);
  355|    620|         }
  356|       |
  357|  28.9k|         ctx.active_alias_spans.emplace_back(span.begin, span.end);
  358|       |
  359|  28.9k|         using V = std::remove_cvref_t<T>;
  360|  28.9k|         from<YAML, V>::template op<Opts>(std::forward<T>(value), ctx, replay_it, replay_end);
  361|       |
  362|  28.9k|         ctx.active_alias_spans.pop_back();
  363|       |
  364|       |         // Restore indent context
  365|  28.9k|         ctx.indent_stack = std::move(saved_indent_stack);
  366|  28.9k|         return true;
  367|  28.9k|      }
_ZN3glz4fromILj450EDnE2opITnDaXtlNS_4optsELj10ELb1ELb0ELb0ELb1ELb0ELb0ELb0ELb0ELj1EEERPKcRDnTkNS_10is_contextERNS_4yaml12yaml_contextES5_EEvOT1_OT2_OT0_T3_:
 2398|  49.5k|      {
 2399|  49.5k|         if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2399:14): [True: 0, False: 49.5k]
  ------------------
 2400|      0|            return;
 2401|       |
 2402|  49.5k|         yaml::skip_inline_ws(it, end);
 2403|       |
 2404|  49.5k|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (2404:14): [True: 6, False: 49.5k]
  ------------------
 2405|      6|            ctx.error = error_code::unexpected_end;
 2406|      6|            return;
 2407|      6|         }
 2408|       |
 2409|       |         // Check for null values: null, Null, NULL, ~
 2410|  49.5k|         if (*it == '~') {
  ------------------
  |  Branch (2410:14): [True: 3.74k, False: 45.8k]
  ------------------
 2411|  3.74k|            ++it;
 2412|  3.74k|            return;
 2413|  3.74k|         }
 2414|       |
 2415|       |         // Parse as plain scalar and check if it's a null keyword
 2416|  45.8k|         auto start = it;
 2417|   226k|         while (it != end && !yaml::plain_scalar_end_table[static_cast<uint8_t>(*it)]) {
  ------------------
  |  Branch (2417:17): [True: 225k, False: 926]
  |  Branch (2417:30): [True: 180k, False: 44.9k]
  ------------------
 2418|   180k|            ++it;
 2419|   180k|         }
 2420|       |
 2421|  45.8k|         std::string_view str{start, static_cast<size_t>(it - start)};
 2422|  45.8k|         if (!yaml::is_yaml_null(str)) {
  ------------------
  |  Branch (2422:14): [True: 58, False: 45.7k]
  ------------------
 2423|     58|            ctx.error = error_code::syntax_error;
 2424|     58|         }
 2425|  45.8k|      }
_ZN3glz33process_yaml_variant_alternativesINSt3__17variantIJDndNS1_12basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEbNS1_6vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS6_ISD_EEEENSC_ISD_EEEEENS_22is_yaml_variant_objectEE2opITnDaXtlNS_4optsELj10ELb1ELb0ELb0ELb1ELb0ELb0ELb0ELb0ELj1EEERSH_TkNS_10is_contextERNS_4yaml12yaml_contextERPKcSR_EEvOT0_OT1_OT2_T3_:
 5205|  3.70M|      {
 5206|  3.70M|         constexpr auto category_count = yaml_variant_count_v<Variant, Trait>;
 5207|       |
 5208|       |         if constexpr (category_count == 0) {
 5209|       |            ctx.error = error_code::no_matching_variant_type;
 5210|       |         }
 5211|  3.70M|         else if constexpr (category_count == 1) {
 5212|       |            // Only one type in this category, use it directly
 5213|  3.70M|            constexpr auto first_idx = yaml_variant_first_index_v<Variant, Trait>;
 5214|  3.70M|            using V = std::variant_alternative_t<first_idx, Variant>;
 5215|  3.70M|            if (!std::holds_alternative<V>(value)) value = V{};
  ------------------
  |  Branch (5215:17): [True: 3.70M, False: 0]
  ------------------
 5216|  3.70M|            from<YAML, V>::template op<Opts>(std::get<V>(value), ctx, it, end);
 5217|       |         }
 5218|       |         else {
 5219|       |            // Multiple types in this category, try each one
 5220|       |            constexpr auto N = std::variant_size_v<Variant>;
 5221|       |            bool found_match{};
 5222|       |            size_t match_idx = 0;
 5223|       |            // Only the last alternative propagates its error, so an alternative that exhausted an
 5224|       |            // expansion budget would otherwise be reported as no_matching_variant_type -- a wrong
 5225|       |            // diagnosis for a document that is hostile rather than merely the wrong shape. Held
 5226|       |            // aside and used only if nothing matched, so an alternative that does succeed later
 5227|       |            // (one that materializes no key text can still parse under a latched budget) is
 5228|       |            // unaffected.
 5229|       |            error_code expansion_error{};
 5230|       |            std::string_view expansion_message{};
 5231|       |
 5232|       |            for_each<N>([&]<size_t I>() {
 5233|       |               if (found_match) {
 5234|       |                  return;
 5235|       |               }
 5236|       |               using V = std::variant_alternative_t<I, Variant>;
 5237|       |               if constexpr (Trait<V>::value) {
 5238|       |                  auto copy_it = it;
 5239|       |                  if (!std::holds_alternative<V>(value)) {
 5240|       |                     value = V{};
 5241|       |                  }
 5242|       |
 5243|       |                  auto temp_ctx = ctx.make_speculative();
 5244|       |                  from<YAML, V>::template op<Opts>(std::get<V>(value), temp_ctx, it, end);
 5245|       |
 5246|       |                  // Charged whether or not the alternative fit: a rejected probe still replayed
 5247|       |                  // whatever aliases it reached, and an attempt that is never billed is an
 5248|       |                  // attempt that can be repeated for free.
 5249|       |                  ctx.alias_expansion_budget = temp_ctx.alias_expansion_budget;
 5250|       |                  ctx.key_expansion_budget = temp_ctx.key_expansion_budget;
 5251|       |
 5252|       |                  if (!bool(temp_ctx.error)) {
 5253|       |                     found_match = true;
 5254|       |                     ctx.anchors = std::move(temp_ctx.anchors);
 5255|       |                  }
 5256|       |                  else {
 5257|       |                     it = copy_it;
 5258|       |                     if (temp_ctx.error == error_code::exceeded_max_expansion && expansion_error == error_code::none) {
 5259|       |                        expansion_error = temp_ctx.error;
 5260|       |                        expansion_message = temp_ctx.custom_error_message;
 5261|       |                     }
 5262|       |                     if (match_idx + 1 < category_count) {
 5263|       |                        // Not the last type, continue trying
 5264|       |                     }
 5265|       |                     else {
 5266|       |                        // Last type failed, propagate error
 5267|       |                        ctx.error = temp_ctx.error;
 5268|       |                        ctx.custom_error_message = temp_ctx.custom_error_message;
 5269|       |                     }
 5270|       |                  }
 5271|       |                  ++match_idx;
 5272|       |               }
 5273|       |            });
 5274|       |
 5275|       |            if (!found_match && !bool(ctx.error)) {
 5276|       |               if (expansion_error != error_code::none) {
 5277|       |                  ctx.error = expansion_error;
 5278|       |                  ctx.custom_error_message = expansion_message;
 5279|       |               }
 5280|       |               else {
 5281|       |                  ctx.error = error_code::no_matching_variant_type;
 5282|       |               }
 5283|       |            }
 5284|       |         }
 5285|  3.70M|      }
_ZN3glz4fromILj450ENS_17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES1_EEEEE2opITnDaXtlNS_4optsELj10ELb1ELb0ELb0ELb1ELb0ELb0ELb0ELb0ELj1EEERPKcRS5_TkNS_10is_contextERNS_4yaml12yaml_contextESA_EEvOT1_OT2_OT0_T3_:
 4515|  3.72M|      {
 4516|  3.72M|         if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4516:14): [True: 0, False: 3.72M]
  ------------------
 4517|      0|            return;
 4518|       |
 4519|  3.72M|         yaml::node_preamble_state preamble{};
 4520|  3.72M|         if (yaml::parse_node_preamble<Opts, yaml::node_property_policy{true, true, false, false}>(
  ------------------
  |  Branch (4520:14): [True: 21.3k, False: 3.70M]
  ------------------
 4521|  3.72M|                value, ctx, it, end, preamble, [](yaml::yaml_tag tag) { return yaml::tag_valid_for_map(tag); }))
 4522|  21.3k|            return;
 4523|       |
 4524|  3.70M|         using key_t = typename std::remove_cvref_t<T>::key_type;
 4525|  3.70M|         using val_t = typename std::remove_cvref_t<T>::mapped_type;
 4526|       |
 4527|       |         // Reading a YAML mapping MERGES into the target: an entry overwrites the
 4528|       |         // value of a key that existed before the read and adds new keys, while
 4529|       |         // pre-existing keys the document does not mention are preserved (like a
 4530|       |         // struct/object read, and like json/read.hpp's per-key value[key]).
 4531|       |         // Within a single document a repeated key keeps its FIRST value -- YAML
 4532|       |         // mappings disallow duplicate keys and the conformance suite expects
 4533|       |         // first-wins, which falls out of emplace into an empty map. Any
 4534|       |         // pre-existing entry the document leaves untouched is restored on scope
 4535|       |         // exit (including error paths). When the target starts empty (the common
 4536|       |         // case) this is a no-op with negligible cost.
 4537|  3.70M|         std::remove_cvref_t<T> preexisting_entries;
 4538|  3.70M|         if (!value.empty()) {
  ------------------
  |  Branch (4538:14): [True: 0, False: 3.70M]
  ------------------
 4539|      0|            preexisting_entries = std::move(value);
 4540|      0|            value.clear();
 4541|      0|         }
 4542|  3.70M|         struct merge_restore_guard
 4543|  3.70M|         {
 4544|  3.70M|            std::remove_cvref_t<T>& target;
 4545|  3.70M|            std::remove_cvref_t<T>& saved;
 4546|  3.70M|            ~merge_restore_guard()
 4547|  3.70M|            {
 4548|       |               // emplace is a no-op for keys the document already wrote, so only
 4549|       |               // untouched pre-existing entries are put back.
 4550|  3.70M|               for (auto& entry : saved) {
 4551|  3.70M|                  target.emplace(entry.first, std::move(entry.second));
 4552|  3.70M|               }
 4553|  3.70M|            }
 4554|  3.70M|         } merge_restore{value, preexisting_entries};
 4555|       |
 4556|  3.70M|         const bool treat_as_block_mapping =
 4557|  3.70M|            !yaml::check_flow_context(Opts) && *it == '{' && yaml::inline_value_has_plain_mapping_indicator(it, end);
  ------------------
  |  Branch (4557:13): [Folded, False: 3.70M]
  |  Branch (4557:48): [True: 0, False: 0]
  |  Branch (4557:62): [True: 0, False: 0]
  ------------------
 4558|       |
 4559|  3.70M|         if (*it == '{' && !treat_as_block_mapping) {
  ------------------
  |  Branch (4559:14): [True: 2.59M, False: 1.11M]
  |  Branch (4559:28): [True: 0, Folded]
  ------------------
 4560|       |            // Flow mapping
 4561|  2.59M|            ++it;
 4562|       |            // Skip whitespace and newlines after opening brace
 4563|  2.59M|            yaml::skip_ws_and_newlines(it, end);
 4564|       |
 4565|  2.59M|            if (it != end && *it == '}') {
  ------------------
  |  Branch (4565:17): [True: 2.58M, False: 2.01k]
  |  Branch (4565:30): [True: 75.2k, False: 2.51M]
  ------------------
 4566|  75.2k|               ++it;
 4567|  75.2k|               yaml::validate_flow_node_adjacent_tail(ctx, it, end);
 4568|  75.2k|               if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4568:20): [True: 12, False: 75.1k]
  ------------------
 4569|     12|                  return;
 4570|  75.1k|               yaml::finalize_node_anchor(preamble.node_props, ctx, it);
 4571|  75.1k|               return;
 4572|  75.2k|            }
 4573|       |
 4574|  14.8M|            while (it != end) {
  ------------------
  |  Branch (4574:20): [True: 14.8M, False: 7.14k]
  ------------------
 4575|       |               // Skip whitespace and newlines at start of each iteration
 4576|  14.8M|               yaml::skip_ws_and_newlines(it, end);
 4577|       |
 4578|  14.8M|               if (it != end && *it == '}') {
  ------------------
  |  Branch (4578:20): [True: 14.8M, False: 0]
  |  Branch (4578:33): [True: 236k, False: 14.5M]
  ------------------
 4579|   236k|                  ++it;
 4580|   236k|                  yaml::validate_flow_node_adjacent_tail(ctx, it, end);
 4581|   236k|                  if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4581:23): [True: 6, False: 236k]
  ------------------
 4582|      6|                     return;
 4583|   236k|                  break;
 4584|   236k|               }
 4585|       |
 4586|  14.5M|               bool explicit_flow_key = false;
 4587|  14.5M|               auto explicit_probe = it;
 4588|  14.5M|               yaml::skip_inline_ws(explicit_probe, end);
 4589|  14.5M|               if (explicit_probe != end && *explicit_probe == '?') {
  ------------------
  |  Branch (4589:20): [True: 14.5M, False: 0]
  |  Branch (4589:45): [True: 358k, False: 14.2M]
  ------------------
 4590|   358k|                  const auto after_q = explicit_probe + 1;
 4591|   358k|                  if (after_q == end || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*after_q)] ||
  ------------------
  |  Branch (4591:23): [True: 6, False: 358k]
  |  Branch (4591:41): [True: 171k, False: 186k]
  ------------------
 4592|   198k|                      *after_q == ',' || *after_q == '}') {
  ------------------
  |  Branch (4592:23): [True: 25.4k, False: 161k]
  |  Branch (4592:42): [True: 1.68k, False: 159k]
  ------------------
 4593|   198k|                     explicit_flow_key = true;
 4594|   198k|                     it = explicit_probe + 1;
 4595|   198k|                     yaml::skip_flow_ws_and_newlines(ctx, it, end);
 4596|   198k|                     if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4596:26): [True: 6, False: 198k]
  ------------------
 4597|      6|                        return;
 4598|   198k|                  }
 4599|   358k|               }
 4600|       |               // Parse key
 4601|  14.5M|               key_t key{};
 4602|  14.5M|               if constexpr (std::same_as<std::remove_cvref_t<key_t>, std::string>) {
 4603|  14.5M|                  if (explicit_flow_key && it != end && (*it == ':' || *it == ',' || *it == '}')) {
  ------------------
  |  Branch (4603:23): [True: 198k, False: 14.3M]
  |  Branch (4603:44): [True: 198k, False: 10]
  |  Branch (4603:58): [True: 6.36k, False: 192k]
  |  Branch (4603:72): [True: 27.4k, False: 165k]
  |  Branch (4603:86): [True: 3.85k, False: 161k]
  ------------------
 4604|  37.6k|                     key.clear();
 4605|  37.6k|                  }
 4606|  14.5M|                  else {
 4607|  14.5M|                     auto key_probe = it;
 4608|  14.5M|                     yaml::skip_inline_ws(key_probe, end);
 4609|       |
 4610|       |                     // Use full node parsing only for structurally complex flow keys.
 4611|       |                     // Plain/quoted/alias keys stay on parse_yaml_key() for compatibility.
 4612|  14.5M|                     bool parse_complex_flow_key = false;
 4613|  14.5M|                     if (key_probe != end) {
  ------------------
  |  Branch (4613:26): [True: 14.5M, False: 10]
  ------------------
 4614|  14.5M|                        if (*key_probe == '[' || *key_probe == '{') {
  ------------------
  |  Branch (4614:29): [True: 19.4k, False: 14.5M]
  |  Branch (4614:50): [True: 58.9k, False: 14.4M]
  ------------------
 4615|  78.3k|                           parse_complex_flow_key = true;
 4616|  78.3k|                        }
 4617|  14.4M|                        else if (*key_probe == '&') {
  ------------------
  |  Branch (4617:34): [True: 2.42M, False: 12.0M]
  ------------------
 4618|  2.42M|                           ++key_probe;
 4619|  2.42M|                           yaml::parse_anchor_name(key_probe, end);
 4620|  2.42M|                           yaml::skip_inline_ws(key_probe, end);
 4621|  2.42M|                           if (key_probe != end && (*key_probe == '[' || *key_probe == '{')) {
  ------------------
  |  Branch (4621:32): [True: 2.42M, False: 44]
  |  Branch (4621:53): [True: 7.70k, False: 2.41M]
  |  Branch (4621:74): [True: 552k, False: 1.86M]
  ------------------
 4622|   559k|                              parse_complex_flow_key = true;
 4623|   559k|                           }
 4624|  2.42M|                        }
 4625|  14.5M|                     }
 4626|       |
 4627|  14.5M|                     if (parse_complex_flow_key) {
  ------------------
  |  Branch (4627:26): [True: 638k, False: 13.9M]
  ------------------
 4628|   638k|                        glz::generic key_node{};
 4629|   638k|                        from<YAML, glz::generic>::template op<yaml::flow_context_on<Opts>()>(key_node, ctx, it, end);
 4630|   638k|                        if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4630:29): [True: 5.17k, False: 633k]
  ------------------
 4631|  5.17k|                           return;
 4632|   633k|                        if (!yaml::materialize_key(key, key_node, ctx)) [[unlikely]]
  ------------------
  |  Branch (4632:29): [True: 14, False: 633k]
  ------------------
 4633|     14|                           return;
 4634|   633k|                     }
 4635|  13.9M|                     else {
 4636|  13.9M|                        if (!yaml::parse_yaml_key(key, ctx, it, end, true)) {
  ------------------
  |  Branch (4636:29): [True: 83.4k, False: 13.8M]
  ------------------
 4637|  83.4k|                           return;
 4638|  83.4k|                        }
 4639|  13.9M|                     }
 4640|  14.5M|                  }
 4641|       |               }
 4642|       |               else {
 4643|       |                  if (explicit_flow_key && it != end && (*it == ':' || *it == ',' || *it == '}')) {
 4644|       |                     ctx.error = error_code::syntax_error;
 4645|       |                     return;
 4646|       |                  }
 4647|       |                  from<YAML, key_t>::template op<yaml::flow_context_on<Opts>()>(key, ctx, it, end);
 4648|       |                  if (bool(ctx.error)) [[unlikely]]
 4649|       |                     return;
 4650|       |               }
 4651|       |
 4652|       |               // Separation between flow key and ':' may include comments/newlines.
 4653|       |               // In flow context, newlines are allowed between key and ':'.
 4654|  14.4M|               yaml::skip_flow_ws_and_newlines(ctx, it, end);
 4655|  14.5M|               if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4655:20): [True: 10, False: 14.5M]
  ------------------
 4656|     10|                  return;
 4657|       |
 4658|  14.5M|               auto parse_implicit_null = [&](val_t& val) -> bool {
 4659|  14.5M|                  if constexpr (nullable_like<std::remove_cvref_t<val_t>>) {
 4660|  14.5M|                     val = {};
 4661|  14.5M|                     return true;
 4662|  14.5M|                  }
 4663|  14.5M|                  else if constexpr (std::same_as<std::remove_cvref_t<val_t>, glz::generic>) {
 4664|  14.5M|                     val = glz::generic{};
 4665|  14.5M|                     return true;
 4666|  14.5M|                  }
 4667|  14.5M|                  else {
 4668|  14.5M|                     static constexpr std::string_view null_value{"null"};
 4669|  14.5M|                     auto null_it = null_value.data();
 4670|  14.5M|                     from<YAML, val_t>::template op<yaml::flow_context_on<Opts>()>(
 4671|  14.5M|                        val, ctx, null_it, null_value.data() + null_value.size());
 4672|  14.5M|                     return !bool(ctx.error);
 4673|  14.5M|                  }
 4674|  14.5M|               };
 4675|       |
 4676|  14.5M|               if (it != end && (*it == ',' || *it == '}')) {
  ------------------
  |  Branch (4676:20): [True: 14.4M, False: 88.7k]
  |  Branch (4676:34): [True: 9.14M, False: 5.34M]
  |  Branch (4676:48): [True: 470k, False: 4.87M]
  ------------------
 4677|  9.61M|                  val_t val{};
 4678|  9.61M|                  if (!parse_implicit_null(val)) [[unlikely]]
  ------------------
  |  Branch (4678:23): [True: 0, False: 9.61M]
  ------------------
 4679|      0|                     return;
 4680|       |
 4681|  9.61M|                  value.emplace(std::move(key), std::move(val));
 4682|       |
 4683|  9.61M|                  if (*it == '}') {
  ------------------
  |  Branch (4683:23): [True: 470k, False: 9.14M]
  ------------------
 4684|   470k|                     ++it;
 4685|   470k|                     yaml::validate_flow_node_adjacent_tail(ctx, it, end);
 4686|   470k|                     if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4686:26): [True: 16, False: 470k]
  ------------------
 4687|     16|                        return;
 4688|   470k|                     break;
 4689|   470k|                  }
 4690|       |
 4691|  9.14M|                  ++it; // skip comma
 4692|  9.14M|                  yaml::skip_ws_and_newlines(it, end);
 4693|  9.14M|                  continue;
 4694|  9.61M|               }
 4695|       |
 4696|  4.96M|               if (it == end || *it != ':') {
  ------------------
  |  Branch (4696:20): [True: 88.7k, False: 4.87M]
  |  Branch (4696:33): [True: 72, False: 4.87M]
  ------------------
 4697|    164|                  ctx.error = error_code::syntax_error;
 4698|    164|                  return;
 4699|    164|               }
 4700|  4.96M|               ++it;
 4701|       |
 4702|  4.96M|               yaml::skip_flow_ws_and_newlines(ctx, it, end);
 4703|  4.96M|               if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4703:20): [True: 6, False: 4.96M]
  ------------------
 4704|      6|                  return;
 4705|       |
 4706|       |               // Omitted value after an explicit ':' maps to an implicit null.
 4707|  4.96M|               if (it != end && (*it == ',' || *it == '}')) {
  ------------------
  |  Branch (4707:20): [True: 4.87M, False: 88.6k]
  |  Branch (4707:34): [True: 441k, False: 4.43M]
  |  Branch (4707:48): [True: 34.7k, False: 4.39M]
  ------------------
 4708|   476k|                  val_t val{};
 4709|   476k|                  if (!parse_implicit_null(val)) [[unlikely]]
  ------------------
  |  Branch (4709:23): [True: 0, False: 476k]
  ------------------
 4710|      0|                     return;
 4711|       |
 4712|   476k|                  value.emplace(std::move(key), std::move(val));
 4713|       |
 4714|   476k|                  if (*it == '}') {
  ------------------
  |  Branch (4714:23): [True: 34.7k, False: 441k]
  ------------------
 4715|  34.7k|                     ++it;
 4716|  34.7k|                     yaml::validate_flow_node_adjacent_tail(ctx, it, end);
 4717|  34.7k|                     if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4717:26): [True: 6, False: 34.7k]
  ------------------
 4718|      6|                        return;
 4719|  34.7k|                     break;
 4720|  34.7k|                  }
 4721|       |
 4722|   441k|                  ++it; // skip comma
 4723|   441k|                  yaml::skip_ws_and_newlines(it, end);
 4724|   441k|                  continue;
 4725|   476k|               }
 4726|       |
 4727|       |               // Parse value
 4728|  4.48M|               val_t val{};
 4729|  4.48M|               from<YAML, val_t>::template op<yaml::flow_context_on<Opts>()>(val, ctx, it, end);
 4730|  4.48M|               if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4730:20): [True: 2.89k, False: 4.48M]
  ------------------
 4731|  2.89k|                  return;
 4732|       |
 4733|  4.48M|               value.emplace(std::move(key), std::move(val));
 4734|       |
 4735|  4.48M|               yaml::skip_inline_ws(it, end);
 4736|       |
 4737|  4.48M|               if (it != end && *it == '}') {
  ------------------
  |  Branch (4737:20): [True: 4.39M, False: 88.6k]
  |  Branch (4737:33): [True: 1.64M, False: 2.75M]
  ------------------
 4738|  1.64M|                  ++it;
 4739|  1.64M|                  yaml::validate_flow_node_adjacent_tail(ctx, it, end);
 4740|  1.64M|                  if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4740:23): [True: 6, False: 1.64M]
  ------------------
 4741|      6|                     return;
 4742|  1.64M|                  break;
 4743|  1.64M|               }
 4744|  2.84M|               else if (it != end && *it == ',') {
  ------------------
  |  Branch (4744:25): [True: 2.75M, False: 88.6k]
  |  Branch (4744:38): [True: 2.58M, False: 166k]
  ------------------
 4745|  2.58M|                  ++it;
 4746|       |                  // Skip whitespace and newlines after comma
 4747|  2.58M|                  yaml::skip_ws_and_newlines(it, end);
 4748|  2.58M|               }
 4749|   255k|               else if (it != end && (*it == '\n' || *it == '\r')) {
  ------------------
  |  Branch (4749:25): [True: 166k, False: 88.6k]
  |  Branch (4749:39): [True: 96.3k, False: 70.0k]
  |  Branch (4749:54): [True: 69.9k, False: 24]
  ------------------
 4750|       |                  // Newlines may precede either the closing brace or the
 4751|       |                  // separator comma for the next entry.
 4752|   166k|                  yaml::skip_ws_and_newlines(it, end);
 4753|   166k|                  if (it != end && *it == '}') {
  ------------------
  |  Branch (4753:23): [True: 166k, False: 10]
  |  Branch (4753:36): [True: 34.0k, False: 132k]
  ------------------
 4754|  34.0k|                     ++it;
 4755|  34.0k|                     yaml::validate_flow_node_adjacent_tail(ctx, it, end);
 4756|  34.0k|                     if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4756:26): [True: 6, False: 34.0k]
  ------------------
 4757|      6|                        return;
 4758|  34.0k|                     break;
 4759|  34.0k|                  }
 4760|   132k|                  if (it != end && *it == ',') {
  ------------------
  |  Branch (4760:23): [True: 132k, False: 10]
  |  Branch (4760:36): [True: 132k, False: 14]
  ------------------
 4761|   132k|                     ++it;
 4762|   132k|                     yaml::skip_ws_and_newlines(it, end);
 4763|   132k|                     continue;
 4764|   132k|                  }
 4765|     24|                  ctx.error = error_code::syntax_error;
 4766|     24|                  return;
 4767|   132k|               }
 4768|  88.7k|               else {
 4769|  88.7k|                  ctx.error = error_code::syntax_error;
 4770|  88.7k|                  return;
 4771|  88.7k|               }
 4772|  4.48M|            }
 4773|  2.51M|         }
 4774|  1.11M|         else {
 4775|       |            // Block mapping - use shared loop with map-specific callback
 4776|  1.11M|            yaml::parse_block_mapping_loop<Opts>(
 4777|  1.11M|               ctx, it, end, int32_t(-1), [&](auto& ctx, auto& it, auto end, int32_t line_indent) -> bool {
 4778|  1.11M|                  auto parse_map_value = [&](val_t& val) -> bool {
 4779|  1.11M|                     if (it != end && !yaml::line_end_or_comment_table[static_cast<uint8_t>(*it)]) {
 4780|  1.11M|                        bool line_starts_with_explicit_value_indicator = false;
 4781|       |
 4782|       |                        // Inline mapping values in block context cannot start with a
 4783|       |                        // plain "key: value" pair on the same line (e.g. "a: b: c").
 4784|       |                        // Such constructs are malformed unless wrapped in flow
 4785|       |                        // delimiters ({...} / [...]) or quoted.
 4786|  1.11M|                        if constexpr (std::is_pointer_v<std::decay_t<decltype(it)>>) {
 4787|  1.11M|                           if (ctx.stream_begin) {
 4788|  1.11M|                              auto is_line_content_start = [&](auto pos) {
 4789|  1.11M|                                 return !ctx.line_prefix_before(pos).has_content;
 4790|  1.11M|                              };
 4791|       |
 4792|  1.11M|                              auto line_has_explicit_value_indicator = [&](auto pos) {
 4793|  1.11M|                                 const char* line = ctx.line_begin_of(pos);
 4794|  1.11M|                                 while (line != end && (*line == ' ' || *line == '\t')) ++line;
 4795|  1.11M|                                 return line != end && *line == ':';
 4796|  1.11M|                              };
 4797|       |
 4798|  1.11M|                              if (!is_line_content_start(it) &&
 4799|  1.11M|                                  yaml::inline_value_has_plain_mapping_indicator(it, end) &&
 4800|  1.11M|                                  !line_has_explicit_value_indicator(it)) {
 4801|  1.11M|                                 ctx.error = error_code::syntax_error;
 4802|  1.11M|                                 return false;
 4803|  1.11M|                              }
 4804|  1.11M|                              line_starts_with_explicit_value_indicator = line_has_explicit_value_indicator(it);
 4805|  1.11M|                           }
 4806|  1.11M|                        }
 4807|       |
 4808|  1.11M|                        if (*it == '-' &&
 4809|  1.11M|                            ((it + 1) == end || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*(it + 1))]) &&
 4810|  1.11M|                            !line_starts_with_explicit_value_indicator) {
 4811|       |                           // "key: - item" is not valid block sequence syntax.
 4812|  1.11M|                           ctx.error = error_code::syntax_error;
 4813|  1.11M|                           return false;
 4814|  1.11M|                        }
 4815|       |
 4816|  1.11M|                        if (!ctx.push_indent(line_indent + 1)) [[unlikely]]
 4817|  1.11M|                           return false;
 4818|  1.11M|                        from<YAML, val_t>::template op<Opts>(val, ctx, it, end);
 4819|  1.11M|                        ctx.pop_indent();
 4820|  1.11M|                     }
 4821|  1.11M|                     else {
 4822|  1.11M|                        int32_t nested_indent = yaml::detect_nested_value_indent(ctx, it, end, line_indent);
 4823|  1.11M|                        if (nested_indent >= 0) {
 4824|  1.11M|                           yaml::skip_to_content(it, end);
 4825|  1.11M|                           if (it != end && *it == ':' && (it + 1) != end && *(it + 1) == '\t') {
 4826|  1.11M|                              ctx.error = error_code::syntax_error;
 4827|  1.11M|                              return false;
 4828|  1.11M|                           }
 4829|       |                           // A struct value reads the pushed indent as its own key column;
 4830|       |                           // every other value type reads it as the enclosing baseline.
 4831|  1.11M|                           const int32_t value_indent =
 4832|  1.11M|                              yaml::receives_block_mapping_column<val_t>() ? nested_indent : nested_indent - 1;
 4833|  1.11M|                           if (!ctx.push_indent(value_indent)) [[unlikely]]
 4834|  1.11M|                              return false;
 4835|  1.11M|                           from<YAML, val_t>::template op<Opts>(val, ctx, it, end);
 4836|  1.11M|                           ctx.pop_indent();
 4837|  1.11M|                        }
 4838|  1.11M|                     }
 4839|  1.11M|                     return !bool(ctx.error);
 4840|  1.11M|                  };
 4841|       |
 4842|       |                  // Explicit key entry form:
 4843|       |                  // ? key
 4844|       |                  // : value
 4845|  1.11M|                  if (*it == '?' && ((it + 1) != end) && *(it + 1) == '\t') {
 4846|  1.11M|                     ctx.error = error_code::syntax_error;
 4847|  1.11M|                     return false;
 4848|  1.11M|                  }
 4849|  1.11M|                  if (*it == '?' && ((it + 1) == end || *(it + 1) == ' ' || *(it + 1) == '\n' || *(it + 1) == '\r')) {
 4850|  1.11M|                     ++it; // skip '?'
 4851|  1.11M|                     yaml::skip_inline_ws(it, end);
 4852|       |
 4853|  1.11M|                     const int32_t explicit_value_indicator_indent =
 4854|  1.11M|                        (ctx.current_indent() < 0) ? 0 : (ctx.current_indent() + 1);
 4855|       |
 4856|  1.11M|                     key_t key{};
 4857|  1.11M|                     if constexpr (std::same_as<std::remove_cvref_t<key_t>, std::string>) {
 4858|  1.11M|                        auto to_string_key = [&](glz::generic& key_node) {
 4859|  1.11M|                           return yaml::materialize_key(key, key_node, ctx);
 4860|  1.11M|                        };
 4861|       |
 4862|  1.11M|                        auto key_it = it;
 4863|  1.11M|                        yaml::skip_inline_ws(key_it, end);
 4864|       |
 4865|  1.11M|                        auto content = key_it;
 4866|  1.11M|                        yaml::skip_to_content(content, end);
 4867|  1.11M|                        bool handled_anchor_only_empty_key = false;
 4868|       |
 4869|       |                        // Anchor on an empty explicit key node:
 4870|       |                        //   ? &a
 4871|       |                        //   : value
 4872|  1.11M|                        if (content != end && *content == '&') {
 4873|  1.11M|                           auto anchor_probe = content + 1;
 4874|  1.11M|                           auto anchor_name = yaml::parse_anchor_name(anchor_probe, end);
 4875|  1.11M|                           if (!anchor_name.empty()) {
 4876|  1.11M|                              auto after_anchor = anchor_probe;
 4877|  1.11M|                              yaml::skip_inline_ws(after_anchor, end);
 4878|       |
 4879|  1.11M|                              auto value_indicator = after_anchor;
 4880|  1.11M|                              if (value_indicator != end && *value_indicator == ':') {
 4881|  1.11M|                                 key.clear();
 4882|  1.11M|                                 ctx.anchors[std::string(anchor_name)] = {content, content, ctx.current_indent()};
 4883|  1.11M|                                 it = value_indicator;
 4884|  1.11M|                                 handled_anchor_only_empty_key = true;
 4885|  1.11M|                              }
 4886|  1.11M|                              else {
 4887|  1.11M|                                 if (value_indicator != end && *value_indicator == '#') {
 4888|  1.11M|                                    yaml::skip_comment(value_indicator, end);
 4889|  1.11M|                                 }
 4890|  1.11M|                                 if (value_indicator != end && (*value_indicator == '\n' || *value_indicator == '\r')) {
 4891|  1.11M|                                    yaml::skip_newline(value_indicator, end);
 4892|  1.11M|                                    auto value_line = value_indicator;
 4893|  1.11M|                                    int32_t value_indent = yaml::measure_indent(value_line, end, ctx);
 4894|  1.11M|                                    if (bool(ctx.error)) [[unlikely]]
 4895|  1.11M|                                       return false;
 4896|  1.11M|                                    if (value_line != end && *value_line == ':' &&
 4897|  1.11M|                                        value_indent == explicit_value_indicator_indent) {
 4898|  1.11M|                                       key.clear();
 4899|  1.11M|                                       ctx.anchors[std::string(anchor_name)] = {content, content, ctx.current_indent()};
 4900|  1.11M|                                       it = value_line;
 4901|  1.11M|                                       handled_anchor_only_empty_key = true;
 4902|  1.11M|                                    }
 4903|  1.11M|                                    else if (value_line != end && *value_line == ':') {
 4904|       |                                       // In explicit-key form ("? &a"), a following ':'
 4905|       |                                       // starts the outer value indicator only at the same
 4906|       |                                       // indentation. A deeper-indented ': value' is malformed.
 4907|  1.11M|                                       ctx.error = error_code::syntax_error;
 4908|  1.11M|                                       return false;
 4909|  1.11M|                                    }
 4910|  1.11M|                                 }
 4911|  1.11M|                              }
 4912|  1.11M|                           }
 4913|  1.11M|                        }
 4914|       |
 4915|  1.11M|                        const bool key_content_spans_lines = [&] {
 4916|  1.11M|                           auto scan = key_it;
 4917|  1.11M|                           while (scan != content && scan != end) {
 4918|  1.11M|                              if (*scan == '\n' || *scan == '\r') return true;
 4919|  1.11M|                              ++scan;
 4920|  1.11M|                           }
 4921|  1.11M|                           return false;
 4922|  1.11M|                        }();
 4923|       |
 4924|  1.11M|                        if (handled_anchor_only_empty_key) {
 4925|       |                           // 'it' already points to the explicit value indicator ':'
 4926|  1.11M|                        }
 4927|  1.11M|                        else if (content == end || (*content == ':' && key_content_spans_lines)) {
 4928|  1.11M|                           key.clear();
 4929|  1.11M|                           it = content;
 4930|  1.11M|                        }
 4931|  1.11M|                        else {
 4932|       |                           // Explicit mapping keys ('? key-node') are full YAML nodes.
 4933|       |                           // Parse the key node structurally (not via plain-key scanning)
 4934|       |                           // so inputs like '? []: x' and '? JSON: like' are interpreted
 4935|       |                           // as complex keys, not split into implicit key/value pairs.
 4936|  1.11M|                           auto key_node_it = content;
 4937|  1.11M|                           auto key_node_end = end;
 4938|  1.11M|                           if constexpr (std::is_pointer_v<std::decay_t<It>>) {
 4939|       |                              // In explicit-key form, a following standalone ':'
 4940|       |                              // line (same or lower indentation) belongs to the
 4941|       |                              // outer mapping value, not the key node itself.
 4942|  1.11M|                              auto scan = content;
 4943|  1.11M|                              while (scan != end) {
 4944|  1.11M|                                 while (scan != end && *scan != '\n' && *scan != '\r') {
 4945|  1.11M|                                    ++scan;
 4946|  1.11M|                                 }
 4947|  1.11M|                                 if (scan == end) {
 4948|  1.11M|                                    break;
 4949|  1.11M|                                 }
 4950|       |
 4951|  1.11M|                                 yaml::skip_newline(scan, end);
 4952|  1.11M|                                 auto line_start = scan;
 4953|       |
 4954|  1.11M|                                 int32_t indicator_indent = 0;
 4955|  1.11M|                                 while (scan != end && *scan == ' ') {
 4956|  1.11M|                                    ++indicator_indent;
 4957|  1.11M|                                    ++scan;
 4958|  1.11M|                                 }
 4959|       |
 4960|  1.11M|                                 if (scan != end && *scan == ':') {
 4961|  1.11M|                                    const auto after_colon = scan + 1;
 4962|  1.11M|                                    if ((after_colon == end ||
 4963|  1.11M|                                         yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*after_colon)]) &&
 4964|  1.11M|                                        indicator_indent <= line_indent) {
 4965|  1.11M|                                       key_node_end = line_start;
 4966|  1.11M|                                       break;
 4967|  1.11M|                                    }
 4968|  1.11M|                                 }
 4969|  1.11M|                              }
 4970|  1.11M|                           }
 4971|       |
 4972|  1.11M|                           glz::generic key_node{};
 4973|  1.11M|                           const bool prev_explicit_mapping_key_context = ctx.explicit_mapping_key_context;
 4974|  1.11M|                           ctx.explicit_mapping_key_context = true;
 4975|  1.11M|                           from<YAML, glz::generic>::template op<Opts>(key_node, ctx, key_node_it, key_node_end);
 4976|  1.11M|                           ctx.explicit_mapping_key_context = prev_explicit_mapping_key_context;
 4977|  1.11M|                           if (bool(ctx.error)) [[unlikely]]
 4978|  1.11M|                              return false;
 4979|  1.11M|                           it = key_node_it;
 4980|  1.11M|                           if (!to_string_key(key_node)) [[unlikely]]
 4981|  1.11M|                              return false;
 4982|  1.11M|                        }
 4983|  1.11M|                     }
 4984|  1.11M|                     else {
 4985|  1.11M|                        if (it != end && !yaml::line_end_or_comment_table[static_cast<uint8_t>(*it)]) {
 4986|  1.11M|                           from<YAML, key_t>::template op<Opts>(key, ctx, it, end);
 4987|  1.11M|                           if (bool(ctx.error)) [[unlikely]]
 4988|  1.11M|                              return false;
 4989|  1.11M|                        }
 4990|  1.11M|                     }
 4991|       |
 4992|  1.11M|                     yaml::skip_inline_ws(it, end);
 4993|  1.11M|                     yaml::skip_comment(it, end);
 4994|       |
 4995|       |                     // Value indicator may appear on the next line at the same indent.
 4996|  1.11M|                     if (it != end && (*it == '\n' || *it == '\r')) {
 4997|  1.11M|                        auto probe = it;
 4998|  1.11M|                        bool found_value_indicator = false;
 4999|       |
 5000|  1.11M|                        while (probe != end && (*probe == '\n' || *probe == '\r')) {
 5001|  1.11M|                           yaml::skip_newline(probe, end);
 5002|       |
 5003|  1.11M|                           auto value_line = probe;
 5004|  1.11M|                           int32_t value_indent = yaml::measure_indent(value_line, end, ctx);
 5005|  1.11M|                           if (bool(ctx.error)) [[unlikely]]
 5006|  1.11M|                              return false;
 5007|       |
 5008|  1.11M|                           if (value_line == end || *value_line == '\n' || *value_line == '\r') {
 5009|  1.11M|                              probe = value_line;
 5010|  1.11M|                              continue; // blank line
 5011|  1.11M|                           }
 5012|  1.11M|                           if (*value_line == '#') {
 5013|  1.11M|                              yaml::skip_comment(value_line, end);
 5014|  1.11M|                              probe = value_line;
 5015|  1.11M|                              continue; // comment-only line
 5016|  1.11M|                           }
 5017|  1.11M|                           if (*value_line == ':' && value_indent == explicit_value_indicator_indent) {
 5018|  1.11M|                              it = value_line;
 5019|  1.11M|                              found_value_indicator = true;
 5020|  1.11M|                           }
 5021|  1.11M|                           break;
 5022|  1.11M|                        }
 5023|       |
 5024|  1.11M|                        if (found_value_indicator) {
 5025|  1.11M|                           yaml::skip_inline_ws(it, end);
 5026|  1.11M|                        }
 5027|  1.11M|                     }
 5028|       |
 5029|  1.11M|                     val_t val{};
 5030|  1.11M|                     if (it != end && *it == ':') {
 5031|  1.11M|                        ++it;
 5032|  1.11M|                        if (it != end && *it == '\t') {
 5033|  1.11M|                           ctx.error = error_code::syntax_error;
 5034|  1.11M|                           return false;
 5035|  1.11M|                        }
 5036|  1.11M|                        if (it != end && (*it == '\n' || *it == '\r')) {
 5037|  1.11M|                           auto probe = it;
 5038|  1.11M|                           yaml::skip_newline(probe, end);
 5039|  1.11M|                           while (probe != end && *probe == ' ') ++probe;
 5040|  1.11M|                           if (probe != end && *probe == ':' && ((probe + 1) != end) && *(probe + 1) == '\t') {
 5041|  1.11M|                              ctx.error = error_code::syntax_error;
 5042|  1.11M|                              return false;
 5043|  1.11M|                           }
 5044|  1.11M|                        }
 5045|  1.11M|                        yaml::skip_inline_ws(it, end);
 5046|  1.11M|                        if (!parse_map_value(val)) [[unlikely]]
 5047|  1.11M|                           return false;
 5048|  1.11M|                     }
 5049|       |
 5050|  1.11M|                     value.emplace(std::move(key), std::move(val));
 5051|  1.11M|                     return true;
 5052|  1.11M|                  }
 5053|       |
 5054|  1.11M|                  key_t key{};
 5055|  1.11M|                  if constexpr (std::same_as<std::remove_cvref_t<key_t>, std::string>) {
 5056|  1.11M|                     auto key_probe = it;
 5057|  1.11M|                     yaml::skip_inline_ws(key_probe, end);
 5058|  1.11M|                     const bool complex_flow_key = (key_probe != end && (*key_probe == '[' || *key_probe == '{'));
 5059|  1.11M|                     if (complex_flow_key) {
 5060|  1.11M|                        glz::generic key_node{};
 5061|  1.11M|                        from<YAML, glz::generic>::template op<yaml::flow_context_on<Opts>()>(key_node, ctx, it, end);
 5062|  1.11M|                        if (bool(ctx.error)) [[unlikely]]
 5063|  1.11M|                           return false;
 5064|  1.11M|                        if (!yaml::materialize_key(key, key_node, ctx)) [[unlikely]]
 5065|  1.11M|                           return false;
 5066|  1.11M|                     }
 5067|  1.11M|                     else {
 5068|  1.11M|                        if (!yaml::parse_yaml_key(key, ctx, it, end, false)) {
 5069|  1.11M|                           return false;
 5070|  1.11M|                        }
 5071|  1.11M|                     }
 5072|  1.11M|                  }
 5073|  1.11M|                  else {
 5074|  1.11M|                     from<YAML, key_t>::template op<Opts>(key, ctx, it, end);
 5075|  1.11M|                     if (bool(ctx.error)) [[unlikely]]
 5076|  1.11M|                        return false;
 5077|  1.11M|                  }
 5078|       |
 5079|  1.11M|                  yaml::skip_inline_ws(it, end);
 5080|       |
 5081|  1.11M|                  if (it == end || *it != ':') {
 5082|  1.11M|                     ctx.error = error_code::syntax_error;
 5083|  1.11M|                     return false;
 5084|  1.11M|                  }
 5085|  1.11M|                  ++it;
 5086|  1.11M|                  yaml::skip_inline_ws(it, end);
 5087|       |
 5088|  1.11M|                  val_t val{};
 5089|  1.11M|                  if (!parse_map_value(val)) [[unlikely]]
 5090|  1.11M|                     return false;
 5091|       |
 5092|  1.11M|                  value.emplace(std::move(key), std::move(val));
 5093|  1.11M|                  return true;
 5094|  1.11M|               });
 5095|  1.11M|         }
 5096|       |
 5097|  3.53M|         yaml::finalize_node_anchor(preamble.node_props, ctx, it);
 5098|  3.53M|      }
_ZN3glz4yaml19parse_node_preambleITnDaXtlNS_4optsELj10ELb1ELb0ELb0ELb1ELb0ELb0ELb0ELb0ELj1EEEXtlNS0_20node_property_policyELb1ELb1EEELb0ERNS_17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES4_EEEENS0_12yaml_contextEPKcSC_ZNS_4fromILj450ES8_E2opITnDaXtlS2_Lj10ELb1ELb0ELb0ELb1ELb0ELb0ELb0ELb0ELj1EEERSC_S9_TkNS_10is_contextERSA_SC_EEvOT1_OT2_OT0_T3_EUlNS0_8yaml_tagEE_EEbSL_RSO_RT4_T5_RNS0_19node_preamble_stateEOT6_:
  465|  3.72M|      {
  466|  3.72M|         skip_inline_ws(it, end);
  467|       |
  468|  3.72M|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (468:14): [True: 6, False: 3.72M]
  ------------------
  469|      6|            if constexpr (!AllowEmptyInput) {
  470|      6|               ctx.error = error_code::unexpected_end;
  471|      6|            }
  472|      6|            return true;
  473|      6|         }
  474|       |
  475|  3.72M|         preamble.tag = parse_yaml_tag(it, end, ctx);
  476|  3.72M|         if (preamble.tag == yaml_tag::unknown) [[unlikely]] {
  ------------------
  |  Branch (476:14): [True: 6, False: 3.72M]
  ------------------
  477|      6|            ctx.error = error_code::syntax_error;
  478|      6|            return true;
  479|      6|         }
  480|  3.72M|         if (!tag_validator(preamble.tag)) [[unlikely]] {
  ------------------
  |  Branch (480:14): [True: 6, False: 3.72M]
  ------------------
  481|      6|            ctx.error = error_code::syntax_error;
  482|      6|            return true;
  483|      6|         }
  484|       |
  485|  3.72M|         skip_inline_ws(it, end);
  486|       |
  487|  3.72M|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (487:14): [True: 6, False: 3.72M]
  ------------------
  488|      6|            if constexpr (!AllowEmptyInput) {
  489|      6|               ctx.error = error_code::unexpected_end;
  490|      6|            }
  491|      6|            return true;
  492|      6|         }
  493|       |
  494|  3.72M|         if (parse_node_properties<Opts, PropertyPolicy>(std::forward<T>(value), ctx, it, end, preamble.node_props)) {
  ------------------
  |  Branch (494:14): [True: 21.3k, False: 3.70M]
  ------------------
  495|  21.3k|            return true;
  496|  21.3k|         }
  497|       |
  498|  3.70M|         return false;
  499|  3.72M|      }
_ZZN3glz4fromILj450ENS_17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES1_EEEEE2opITnDaXtlNS_4optsELj10ELb1ELb0ELb0ELb1ELb0ELb0ELb0ELb0ELj1EEERPKcRS5_TkNS_10is_contextERNS_4yaml12yaml_contextESA_EEvOT1_OT2_OT0_T3_ENKUlNSD_8yaml_tagEE_clESN_:
 4521|  3.72M|                value, ctx, it, end, preamble, [](yaml::yaml_tag tag) { return yaml::tag_valid_for_map(tag); }))
_ZN3glz4yaml21parse_node_propertiesITnDaXtlNS_4optsELj10ELb1ELb0ELb0ELb1ELb0ELb0ELb0ELb0ELj1EEEXtlNS0_20node_property_policyELb1ELb1EEERNS_17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES4_EEEENS0_12yaml_contextEPKcSC_EEbOT1_RT2_RT3_T4_RNS0_19node_property_stateE:
  408|  3.72M|      {
  409|  3.72M|         state.has_anchor = false;
  410|  3.72M|         state.anchor_name.clear();
  411|  3.72M|         state.anchor_start = nullptr;
  412|  3.72M|         state.anchor_indent = ctx.current_indent();
  413|       |
  414|  3.72M|         if constexpr (Policy.allow_alias) {
  415|  3.72M|            if constexpr (Policy.alias_can_be_mapping_key) {
  416|  3.72M|               if (!alias_token_is_mapping_key(it, end)) {
  ------------------
  |  Branch (416:20): [True: 3.72M, False: 2.68k]
  ------------------
  417|  3.72M|                  if (handle_alias<Opts>(std::forward<T>(value), ctx, it, end)) return true;
  ------------------
  |  Branch (417:23): [True: 21.3k, False: 3.70M]
  ------------------
  418|  3.72M|               }
  419|       |            }
  420|       |            else {
  421|       |               if (handle_alias<Opts>(std::forward<T>(value), ctx, it, end)) return true;
  422|       |            }
  423|  3.72M|         }
  424|       |
  425|  3.72M|         if (it != end && *it == '&') {
  ------------------
  |  Branch (425:14): [True: 3.70M, False: 21.3k]
  |  Branch (425:27): [True: 13.9k, False: 3.69M]
  ------------------
  426|  13.9k|            ++it;
  427|  13.9k|            auto name = parse_anchor_name(it, end);
  428|  13.9k|            if (name.empty()) {
  ------------------
  |  Branch (428:17): [True: 10, False: 13.9k]
  ------------------
  429|     10|               ctx.error = error_code::syntax_error;
  430|     10|               return true;
  431|     10|            }
  432|  13.9k|            skip_inline_ws(it, end);
  433|  13.9k|            if (it == end) {
  ------------------
  |  Branch (433:17): [True: 14, False: 13.8k]
  ------------------
  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|  13.8k|            state.has_anchor = true;
  446|  13.8k|            state.anchor_name = std::string(name);
  447|  13.8k|            state.anchor_start = &*it;
  448|  13.8k|         }
  449|       |
  450|  3.72M|         return false;
  451|  3.72M|      }
_ZN3glz4yaml12handle_aliasITnDaXtlNS_4optsELj10ELb1ELb0ELb0ELb1ELb0ELb0ELb0ELb0ELj1EEERNS_17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES3_EEEENS0_12yaml_contextEPKcSB_EEbOT0_RT1_RT2_T3_:
  300|  3.72M|      {
  301|  3.72M|         if (it == end || *it != '*') return false;
  ------------------
  |  Branch (301:14): [True: 0, False: 3.72M]
  |  Branch (301:27): [True: 3.70M, False: 21.3k]
  ------------------
  302|       |
  303|  21.3k|         ++it; // skip '*'
  304|  21.3k|         auto name = parse_anchor_name(it, end);
  305|  21.3k|         if (name.empty()) {
  ------------------
  |  Branch (305:14): [True: 16, False: 21.2k]
  ------------------
  306|     16|            ctx.error = error_code::syntax_error;
  307|     16|            return true;
  308|     16|         }
  309|       |
  310|  21.2k|         auto anchor_it = ctx.anchors.find(name);
  311|  21.2k|         if (anchor_it == ctx.anchors.end()) {
  ------------------
  |  Branch (311:14): [True: 56, False: 21.2k]
  ------------------
  312|     56|            ctx.error = error_code::syntax_error; // undefined alias
  313|     56|            return true;
  314|     56|         }
  315|       |
  316|       |         // Copied rather than referenced: the replay below can replace ctx.anchors wholesale
  317|       |         // (a speculative parse hands its own map back), which would dangle a reference here.
  318|  21.2k|         const auto span = anchor_it->second;
  319|       |
  320|       |         // Empty anchor span (anchor on null/empty node) — leave value as default
  321|  21.2k|         if (span.begin == span.end) {
  ------------------
  |  Branch (321:14): [True: 4.15k, False: 17.0k]
  ------------------
  322|  4.15k|            return true;
  323|  4.15k|         }
  324|       |
  325|       |         // An anchor is invisible to itself while it expands. A span that aliases the name it
  326|       |         // defines -- reachable because a mapping key's anchor is registered over the key text
  327|       |         // before that text is parsed -- would otherwise replay itself forever.
  328|  17.0k|         if (ctx.alias_span_is_replaying(span.begin, span.end)) [[unlikely]] {
  ------------------
  |  Branch (328:14): [True: 42, False: 17.0k]
  ------------------
  329|     42|            ctx.error = error_code::syntax_error; // cyclic alias
  330|     42|            return true;
  331|     42|         }
  332|       |
  333|       |         // Replaying an anchor re-enters the reader directly, bypassing the variant reader's
  334|       |         // depth guard, so this is the only depth accounting a chain of aliases into a
  335|       |         // non-variant target gets. The cycle check above stops the unbounded case; this bounds
  336|       |         // a legitimate but deeply chained one.
  337|  17.0k|         depth_guard guard{ctx, yaml::max_yaml_recursive_depth};
  338|  17.0k|         if (!guard) [[unlikely]]
  ------------------
  |  Branch (338:14): [True: 6, False: 17.0k]
  ------------------
  339|      6|            return true;
  340|       |
  341|  17.0k|         if (!ctx.charge_alias_expansion(static_cast<size_t>(span.end - span.begin))) [[unlikely]] {
  ------------------
  |  Branch (341:14): [True: 0, False: 17.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|  17.0k|         auto replay_it = span.begin;
  348|  17.0k|         auto replay_end = span.end;
  349|       |
  350|       |         // Save indent context and set up for replay
  351|  17.0k|         auto saved_indent_stack = std::move(ctx.indent_stack);
  352|  17.0k|         ctx.indent_stack.clear();
  353|  17.0k|         if (span.base_indent > 0) {
  ------------------
  |  Branch (353:14): [True: 2.50k, False: 14.5k]
  ------------------
  354|  2.50k|            ctx.push_indent(span.base_indent - 1);
  355|  2.50k|         }
  356|       |
  357|  17.0k|         ctx.active_alias_spans.emplace_back(span.begin, span.end);
  358|       |
  359|  17.0k|         using V = std::remove_cvref_t<T>;
  360|  17.0k|         from<YAML, V>::template op<Opts>(std::forward<T>(value), ctx, replay_it, replay_end);
  361|       |
  362|  17.0k|         ctx.active_alias_spans.pop_back();
  363|       |
  364|       |         // Restore indent context
  365|  17.0k|         ctx.indent_stack = std::move(saved_indent_stack);
  366|  17.0k|         return true;
  367|  17.0k|      }
_ZZN3glz4fromILj450ENS_17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES1_EEEEE2opITnDaXtlNS_4optsELj10ELb1ELb0ELb0ELb1ELb0ELb0ELb0ELb0ELj1EEERPKcRS5_TkNS_10is_contextERNS_4yaml12yaml_contextESA_EEvOT1_OT2_OT0_T3_ENKUlRS4_E_clESN_:
 4658|  10.0M|               auto parse_implicit_null = [&](val_t& val) -> bool {
 4659|       |                  if constexpr (nullable_like<std::remove_cvref_t<val_t>>) {
 4660|       |                     val = {};
 4661|       |                     return true;
 4662|       |                  }
 4663|  10.0M|                  else if constexpr (std::same_as<std::remove_cvref_t<val_t>, glz::generic>) {
 4664|  10.0M|                     val = glz::generic{};
 4665|  10.0M|                     return true;
 4666|       |                  }
 4667|       |                  else {
 4668|       |                     static constexpr std::string_view null_value{"null"};
 4669|       |                     auto null_it = null_value.data();
 4670|       |                     from<YAML, val_t>::template op<yaml::flow_context_on<Opts>()>(
 4671|       |                        val, ctx, null_it, null_value.data() + null_value.size());
 4672|       |                     return !bool(ctx.error);
 4673|       |                  }
 4674|  10.0M|               };
_ZN3glz4yaml24parse_block_mapping_loopITnDaXtlNS_4optsELj10ELb1ELb0ELb0ELb1ELb0ELb0ELb0ELb0ELj1EEENS0_12yaml_contextEPKcS5_ZNS_4fromILj450ENS_17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES7_EEEEE2opITnDaXtlS2_Lj10ELb1ELb0ELb0ELb1ELb0ELb0ELb0ELb0ELj1EEERS5_RSB_TkNS_10is_contextERS3_S5_EEvOT1_OT2_OT0_T3_EUlRT_RSL_SH_iE_EEvSQ_RSH_SJ_iOSN_:
 3633|  1.11M|      {
 3634|       |         // A tagged-variant custom alternative hands its body (at the variant's own column) to a
 3635|       |         // discover-mode reader. Honor the known indent it published so continuation/dedent are
 3636|       |         // judged against the outer parent, not the body itself. One-shot: reset on observation.
 3637|  1.11M|         if (ctx.forced_block_mapping_indent >= 0) {
  ------------------
  |  Branch (3637:14): [True: 0, False: 1.11M]
  ------------------
 3638|      0|            if (mapping_indent < 0) {
  ------------------
  |  Branch (3638:17): [True: 0, False: 0]
  ------------------
 3639|      0|               mapping_indent = ctx.forced_block_mapping_indent;
 3640|      0|            }
 3641|      0|            ctx.forced_block_mapping_indent = -1;
 3642|      0|         }
 3643|  1.11M|         const int32_t parent_indent = ctx.current_indent();
 3644|  1.11M|         const bool discover_indent = (mapping_indent < 0);
 3645|  1.11M|         bool first_key = !discover_indent;
 3646|  1.11M|         bool discovered_first_key_mid_line = false;
 3647|  1.11M|         int32_t discovered_first_key_visual_indent = 0;
 3648|       |
 3649|  2.57M|         while (it != end) {
  ------------------
  |  Branch (3649:17): [True: 1.58M, False: 997k]
  ------------------
 3650|  1.58M|            auto line_start = it;
 3651|  1.58M|            int32_t line_indent = first_key ? mapping_indent : 0;
  ------------------
  |  Branch (3651:35): [True: 0, False: 1.58M]
  ------------------
 3652|       |
 3653|       |            // Skip blank lines and comments, measure indent
 3654|  2.15M|            while (it != end) {
  ------------------
  |  Branch (3654:20): [True: 2.13M, False: 17.1k]
  ------------------
 3655|  2.13M|               if (*it == '#') {
  ------------------
  |  Branch (3655:20): [True: 143k, False: 1.98M]
  ------------------
 3656|   143k|                  skip_comment(it, end);
 3657|   143k|                  skip_newline(it, end);
 3658|   143k|                  first_key = false;
 3659|   143k|                  line_indent = 0;
 3660|   143k|               }
 3661|  1.98M|               else if (*it == '\n' || *it == '\r') {
  ------------------
  |  Branch (3661:25): [True: 66.0k, False: 1.92M]
  |  Branch (3661:40): [True: 228k, False: 1.69M]
  ------------------
 3662|   294k|                  skip_newline(it, end);
 3663|   294k|                  first_key = false;
 3664|   294k|                  line_indent = 0;
 3665|   294k|               }
 3666|  1.69M|               else if (*it == ' ') {
  ------------------
  |  Branch (3666:25): [True: 256k, False: 1.43M]
  ------------------
 3667|   256k|                  line_start = it;
 3668|   256k|                  line_indent = 0;
 3669|   586k|                  while (it != end && *it == ' ') {
  ------------------
  |  Branch (3669:26): [True: 583k, False: 2.66k]
  |  Branch (3669:39): [True: 329k, False: 253k]
  ------------------
 3670|   329k|                     ++line_indent;
 3671|   329k|                     ++it;
 3672|   329k|                  }
 3673|       |
 3674|   256k|                  bool saw_tab = false;
 3675|   258k|                  while (it != end && (*it == ' ' || *it == '\t')) {
  ------------------
  |  Branch (3675:26): [True: 256k, False: 2.76k]
  |  Branch (3675:40): [True: 1.02k, False: 255k]
  |  Branch (3675:54): [True: 1.39k, False: 253k]
  ------------------
 3676|  2.41k|                     saw_tab = saw_tab || (*it == '\t');
  ------------------
  |  Branch (3676:32): [True: 1.67k, False: 746]
  |  Branch (3676:43): [True: 746, False: 0]
  ------------------
 3677|  2.41k|                     ++it;
 3678|  2.41k|                  }
 3679|       |
 3680|   256k|                  if (it == end || *it == '\n' || *it == '\r' || *it == '#') {
  ------------------
  |  Branch (3680:23): [True: 2.76k, False: 253k]
  |  Branch (3680:36): [True: 21.1k, False: 232k]
  |  Branch (3680:51): [True: 5.54k, False: 227k]
  |  Branch (3680:66): [True: 90.2k, False: 136k]
  ------------------
 3681|   119k|                     first_key = false;
 3682|   119k|                     line_indent = 0;
 3683|   119k|                     continue; // Blank or comment line
 3684|   119k|                  }
 3685|       |
 3686|   136k|                  if (saw_tab) {
  ------------------
  |  Branch (3686:23): [True: 10, False: 136k]
  ------------------
 3687|     10|                     ctx.error = error_code::syntax_error;
 3688|     10|                     return;
 3689|     10|                  }
 3690|       |
 3691|       |                  // Early dedent check
 3692|   136k|                  if (mapping_indent >= 0 && line_indent < mapping_indent) {
  ------------------
  |  Branch (3692:23): [True: 130k, False: 6.49k]
  |  Branch (3692:46): [True: 1.38k, False: 128k]
  ------------------
 3693|  1.38k|                     it = line_start;
 3694|  1.38k|                     return;
 3695|  1.38k|                  }
 3696|       |
 3697|   135k|                  first_key = false;
 3698|   135k|                  break; // Found content
 3699|   136k|               }
 3700|  1.43M|               else if (*it == '\t') {
  ------------------
  |  Branch (3700:25): [True: 9.41k, False: 1.42M]
  ------------------
 3701|  9.41k|                  line_start = it;
 3702|  30.8k|                  while (it != end && (*it == ' ' || *it == '\t')) ++it;
  ------------------
  |  Branch (3702:26): [True: 28.7k, False: 2.01k]
  |  Branch (3702:40): [True: 3.08k, False: 25.7k]
  |  Branch (3702:54): [True: 18.3k, False: 7.39k]
  ------------------
 3703|  9.41k|                  if (it == end || *it == '\n' || *it == '\r' || *it == '#') {
  ------------------
  |  Branch (3703:23): [True: 2.01k, False: 7.39k]
  |  Branch (3703:36): [True: 830, False: 6.56k]
  |  Branch (3703:51): [True: 4.02k, False: 2.54k]
  |  Branch (3703:66): [True: 2.53k, False: 18]
  ------------------
 3704|  9.39k|                     first_key = false;
 3705|  9.39k|                     line_indent = 0;
 3706|  9.39k|                     continue; // Blank or comment-only line with tab indentation
 3707|  9.39k|                  }
 3708|     18|                  ctx.error = error_code::syntax_error;
 3709|     18|                  return;
 3710|  9.41k|               }
 3711|  1.42M|               else {
 3712|  1.42M|                  line_start = it;
 3713|  1.42M|                  break; // Content at column 0
 3714|  1.42M|               }
 3715|  2.13M|            }
 3716|       |
 3717|  1.58M|            if (it == end) break;
  ------------------
  |  Branch (3717:17): [True: 17.1k, False: 1.56M]
  ------------------
 3718|       |
 3719|       |            // Document boundaries terminate the current mapping in both discovered
 3720|       |            // and fixed-indent modes.
 3721|  1.56M|            if (at_document_end(it, end) || at_document_start(it, end)) break;
  ------------------
  |  Branch (3721:17): [True: 902, False: 1.56M]
  |  Branch (3721:45): [True: 2.67k, False: 1.56M]
  ------------------
 3722|       |
 3723|       |            // Dedent checks (skip on first key for struct case)
 3724|       |            // Must check BEFORE establishing mapping_indent so the first discovered key
 3725|       |            // isn't rejected by the parent_indent check (mapping_indent is still -1).
 3726|  1.56M|            if (!first_key) {
  ------------------
  |  Branch (3726:17): [True: 1.56M, False: 0]
  ------------------
 3727|       |               // Parent indent check for nested maps (only after mapping_indent established)
 3728|  1.56M|               if (discover_indent && mapping_indent >= 0 && parent_indent >= 0 && line_indent <= parent_indent) {
  ------------------
  |  Branch (3728:20): [True: 1.56M, False: 0]
  |  Branch (3728:39): [True: 447k, False: 1.11M]
  |  Branch (3728:62): [True: 77.6k, False: 370k]
  |  Branch (3728:84): [True: 63.9k, False: 13.7k]
  ------------------
 3729|  63.9k|                  it = line_start;
 3730|  63.9k|                  return;
 3731|  63.9k|               }
 3732|  1.49M|               if (mapping_indent >= 0 && line_indent < mapping_indent) {
  ------------------
  |  Branch (3732:20): [True: 383k, False: 1.11M]
  |  Branch (3732:43): [True: 290, False: 383k]
  ------------------
 3733|    290|                  it = line_start;
 3734|    290|                  return;
 3735|    290|               }
 3736|  1.49M|            }
 3737|       |
 3738|       |            // Establish mapping indent from first key (map case)
 3739|  1.49M|            bool established_mapping_indent_this_line = false;
 3740|  1.49M|            if (mapping_indent < 0) {
  ------------------
  |  Branch (3740:17): [True: 1.11M, False: 383k]
  ------------------
 3741|  1.11M|               mapping_indent = line_indent;
 3742|  1.11M|               established_mapping_indent_this_line = true;
 3743|  1.11M|               discovered_first_key_visual_indent = line_indent;
 3744|  1.11M|               if constexpr (std::is_pointer_v<std::decay_t<It>>) {
 3745|  1.11M|                  if (ctx.stream_begin && line_start > ctx.stream_begin) {
  ------------------
  |  Branch (3745:23): [True: 1.11M, False: 0]
  |  Branch (3745:43): [True: 1.11M, False: 0]
  ------------------
 3746|  1.11M|                     const auto prefix = ctx.line_prefix_before(line_start);
 3747|  1.11M|                     if (prefix.has_tab) {
  ------------------
  |  Branch (3747:26): [True: 58, False: 1.11M]
  ------------------
 3748|     58|                        ctx.error = error_code::syntax_error;
 3749|     58|                        return;
 3750|     58|                     }
 3751|       |
 3752|  1.11M|                     discovered_first_key_mid_line = prefix.has_content;
 3753|  1.11M|                     if (mapping_indent == 0 && prefix.column > 0) {
  ------------------
  |  Branch (3753:26): [True: 1.10M, False: 6.49k]
  |  Branch (3753:49): [True: 781k, False: 324k]
  ------------------
 3754|   781k|                        discovered_first_key_visual_indent = prefix.column;
 3755|   781k|                     }
 3756|  1.11M|                  }
 3757|  1.11M|               }
 3758|  1.11M|            }
 3759|       |
 3760|       |            // In discovered-indent block mappings, sibling keys must stay at the same
 3761|       |            // indent level, except when the first key started mid-line (e.g. "--- k: v").
 3762|  1.49M|            if (discover_indent && mapping_indent >= 0 && !established_mapping_indent_this_line &&
  ------------------
  |  Branch (3762:17): [True: 1.49M, False: 58]
  |  Branch (3762:36): [True: 1.49M, False: 0]
  |  Branch (3762:59): [True: 383k, False: 1.11M]
  ------------------
 3763|   383k|                !discovered_first_key_mid_line) {
  ------------------
  |  Branch (3763:17): [True: 114k, False: 269k]
  ------------------
 3764|   114k|               if (mapping_indent == 0 && discovered_first_key_visual_indent > 0) {
  ------------------
  |  Branch (3764:20): [True: 113k, False: 486]
  |  Branch (3764:43): [True: 41.1k, False: 72.8k]
  ------------------
 3765|  41.1k|                  if (line_indent > discovered_first_key_visual_indent) {
  ------------------
  |  Branch (3765:23): [True: 10, False: 41.0k]
  ------------------
 3766|     10|                     ctx.error = error_code::syntax_error;
 3767|     10|                     return;
 3768|     10|                  }
 3769|  41.0k|                  if (line_indent < discovered_first_key_visual_indent) {
  ------------------
  |  Branch (3769:23): [True: 8.72k, False: 32.3k]
  ------------------
 3770|  8.72k|                     it = line_start;
 3771|  8.72k|                     return;
 3772|  8.72k|                  }
 3773|  41.0k|               }
 3774|  73.3k|               else if (line_indent > mapping_indent &&
  ------------------
  |  Branch (3774:25): [True: 710, False: 72.6k]
  ------------------
 3775|    710|                        (parent_indent < 0 || mapping_indent > 0 ||
  ------------------
  |  Branch (3775:26): [True: 6, False: 704]
  |  Branch (3775:47): [True: 0, False: 704]
  ------------------
 3776|    704|                         (parent_indent >= 0 && mapping_indent == 0 && line_indent > (parent_indent + 1)))) {
  ------------------
  |  Branch (3776:27): [True: 704, False: 0]
  |  Branch (3776:49): [True: 704, False: 0]
  |  Branch (3776:72): [True: 6, False: 698]
  ------------------
 3777|     12|                  ctx.error = error_code::syntax_error;
 3778|     12|                  return;
 3779|     12|               }
 3780|   114k|            }
 3781|       |
 3782|       |            // Sequence indicator check (struct case only - map parser lets key parsing
 3783|       |            // handle '- ' which produces appropriate errors for misindented items)
 3784|  1.48M|            if (!discover_indent && *it == '-' &&
  ------------------
  |  Branch (3784:17): [True: 0, False: 1.48M]
  |  Branch (3784:37): [True: 0, False: 0]
  ------------------
 3785|      0|                ((it + 1) == end || *(it + 1) == ' ' || *(it + 1) == '\t' || *(it + 1) == '\n')) {
  ------------------
  |  Branch (3785:18): [True: 0, False: 0]
  |  Branch (3785:37): [True: 0, False: 0]
  |  Branch (3785:57): [True: 0, False: 0]
  |  Branch (3785:78): [True: 0, False: 0]
  ------------------
 3786|      0|               it = line_start;
 3787|      0|               return;
 3788|      0|            }
 3789|       |
 3790|       |            // Skip indented comment lines
 3791|  1.48M|            if (*it == '#') {
  ------------------
  |  Branch (3791:17): [True: 0, False: 1.48M]
  ------------------
 3792|      0|               skip_comment(it, end);
 3793|      0|               first_key = false;
 3794|      0|               continue;
 3795|      0|            }
 3796|       |
 3797|       |            // Skip blank/empty lines after indent
 3798|  1.48M|            if (*it == '\n' || *it == '\r') {
  ------------------
  |  Branch (3798:17): [True: 58, False: 1.48M]
  |  Branch (3798:32): [True: 0, False: 1.48M]
  ------------------
 3799|      0|               first_key = false;
 3800|      0|               continue;
 3801|      0|            }
 3802|       |
 3803|       |            // While parsing an explicit mapping key node ('? key-node'),
 3804|       |            // a subsequent standalone ':' at the same indentation starts
 3805|       |            // the outer value indicator and must terminate this key-node map.
 3806|       |            // Keep same-line ': x' on the first key-node line valid.
 3807|  1.48M|            if (ctx.explicit_mapping_key_context && !established_mapping_indent_this_line && *it == ':') {
  ------------------
  |  Branch (3807:17): [True: 334k, False: 1.15M]
  |  Branch (3807:53): [True: 60.6k, False: 273k]
  |  Branch (3807:94): [True: 11.0k, False: 49.5k]
  ------------------
 3808|  11.0k|               const auto after_colon = it + 1;
 3809|  11.0k|               const int32_t explicit_value_indicator_indent = (parent_indent < 0) ? 0 : (parent_indent + 1);
  ------------------
  |  Branch (3809:64): [True: 10.6k, False: 408]
  ------------------
 3810|  11.0k|               if ((after_colon == end || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*after_colon)]) &&
  ------------------
  |  Branch (3810:21): [True: 94, False: 10.9k]
  |  Branch (3810:43): [True: 2.47k, False: 8.52k]
  ------------------
 3811|  2.56k|                   line_indent == explicit_value_indicator_indent) {
  ------------------
  |  Branch (3811:20): [True: 242, False: 2.32k]
  ------------------
 3812|    242|                  it = line_start;
 3813|    242|                  return;
 3814|    242|               }
 3815|  11.0k|            }
 3816|       |
 3817|       |            // Process this mapping entry (key + colon + value)
 3818|  1.48M|            int32_t effective_line_indent = line_indent;
 3819|  1.48M|            if (discover_indent && established_mapping_indent_this_line &&
  ------------------
  |  Branch (3819:17): [True: 1.48M, False: 58]
  |  Branch (3819:36): [True: 1.11M, False: 374k]
  ------------------
 3820|  1.11M|                discovered_first_key_visual_indent > effective_line_indent &&
  ------------------
  |  Branch (3820:17): [True: 781k, False: 331k]
  ------------------
 3821|   781k|                !(discovered_first_key_mid_line && parent_indent < 0)) {
  ------------------
  |  Branch (3821:19): [True: 671k, False: 109k]
  |  Branch (3821:52): [True: 432k, False: 239k]
  ------------------
 3822|       |               // The first discovered key has no indentation of its own left to measure: it may
 3823|       |               // begin mid-line (a sequence entry's "- key: value"), or the caller may have already
 3824|       |               // consumed the line's indentation before handing the mapping over. Pass its visual
 3825|       |               // column so the entry judges its value against the key's real indent -- otherwise a
 3826|       |               // key with an empty value takes the following sibling line for nested content
 3827|       |               // (issue #2827) and same-line block scalars compute the wrong indentation.
 3828|       |               // The exception is a ROOT mapping whose first key begins mid-line, which means node
 3829|       |               // properties sit ahead of it (`!!str &a1 "foo":`): those belong to the document node
 3830|       |               // rather than to the key's column, so the measured indent stands. Conformance tests
 3831|       |               // 7FWL and HMQ5 pin that case.
 3832|   348k|               effective_line_indent = discovered_first_key_visual_indent;
 3833|   348k|            }
 3834|       |
 3835|  1.48M|            if (!process_entry(ctx, it, end, effective_line_indent)) {
  ------------------
  |  Branch (3835:17): [True: 20.5k, False: 1.46M]
  ------------------
 3836|  20.5k|               return;
 3837|  20.5k|            }
 3838|  1.46M|            first_key = false;
 3839|       |
 3840|  1.46M|            if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (3840:17): [True: 0, False: 1.46M]
  ------------------
 3841|      0|               return;
 3842|       |
 3843|  1.46M|            if constexpr (yaml::check_flow_context(Opts)) {
 3844|       |               // In flow context, an implicit "key: value" pair used as a sequence entry
 3845|       |               // ends at ',', ']', or '}'. Let the enclosing flow parser consume it.
 3846|  1.46M|               auto flow_end = it;
 3847|  1.46M|               skip_flow_ws_and_newlines(ctx, flow_end, end);
 3848|  1.46M|               if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (3848:20): [True: 10, False: 1.46M]
  ------------------
 3849|     10|                  return;
 3850|  1.46M|               if (flow_end != end && (*flow_end == ',' || *flow_end == ']' || *flow_end == '}')) {
  ------------------
  |  Branch (3850:20): [True: 1.21M, False: 247k]
  |  Branch (3850:40): [True: 547k, False: 671k]
  |  Branch (3850:60): [True: 15.7k, False: 655k]
  |  Branch (3850:80): [True: 202k, False: 452k]
  ------------------
 3851|   766k|                  it = flow_end;
 3852|   766k|                  return;
 3853|   766k|               }
 3854|  1.46M|            }
 3855|       |
 3856|       |            // Trailing whitespace handling (peek-ahead pattern).
 3857|       |            // After parsing, iterator may be at leading indent of next line.
 3858|       |            // Don't consume it - let the outer loop handle indent measurement.
 3859|  1.46M|            if (it != end) {
  ------------------
  |  Branch (3859:17): [True: 498k, False: 967k]
  ------------------
 3860|   498k|               if (*it == ' ' || *it == '\t') {
  ------------------
  |  Branch (3860:20): [True: 119k, False: 379k]
  |  Branch (3860:34): [True: 5.15k, False: 374k]
  ------------------
 3861|   124k|                  auto peek = it;
 3862|   124k|                  skip_inline_ws(peek, end);
 3863|   124k|                  if (peek != end && *peek != '\n' && *peek != '\r' && *peek != '#') {
  ------------------
  |  Branch (3863:23): [True: 109k, False: 14.7k]
  |  Branch (3863:38): [True: 105k, False: 3.54k]
  |  Branch (3863:55): [True: 98.4k, False: 7.47k]
  |  Branch (3863:72): [True: 95.4k, False: 2.98k]
  ------------------
 3864|  95.4k|                     continue; // At leading indent of new line
 3865|  95.4k|                  }
 3866|   124k|               }
 3867|   403k|               skip_inline_ws(it, end);
 3868|   403k|               if (it != end && *it == '#') {
  ------------------
  |  Branch (3868:20): [True: 388k, False: 14.7k]
  |  Branch (3868:33): [True: 30.9k, False: 357k]
  ------------------
 3869|  30.9k|                  if constexpr (std::is_pointer_v<std::decay_t<It>>) {
 3870|  30.9k|                     if (it > line_start) {
  ------------------
  |  Branch (3870:26): [True: 30.9k, False: 0]
  ------------------
 3871|  30.9k|                        const char prev = *(it - 1);
 3872|  30.9k|                        if (prev != ' ' && prev != '\t' && prev != '\n' && prev != '\r') {
  ------------------
  |  Branch (3872:29): [True: 5.95k, False: 25.0k]
  |  Branch (3872:44): [True: 5.06k, False: 888]
  |  Branch (3872:60): [True: 1.31k, False: 3.75k]
  |  Branch (3872:76): [True: 6, False: 1.30k]
  ------------------
 3873|      6|                           ctx.error = error_code::syntax_error;
 3874|      6|                           return;
 3875|      6|                        }
 3876|  30.9k|                     }
 3877|  30.9k|                  }
 3878|  30.9k|               }
 3879|  30.9k|               skip_comment(it, end);
 3880|   403k|               if (it != end && (*it == '\n' || *it == '\r')) {
  ------------------
  |  Branch (3880:20): [True: 388k, False: 14.7k]
  |  Branch (3880:34): [True: 110k, False: 278k]
  |  Branch (3880:49): [True: 107k, False: 171k]
  ------------------
 3881|   217k|                  skip_newline(it, end);
 3882|   217k|               }
 3883|   186k|               else if (it != end) {
  ------------------
  |  Branch (3883:25): [True: 171k, False: 14.7k]
  ------------------
 3884|       |                  // The entry stopped part way along its line with something other than
 3885|       |                  // whitespace or a comment after it -- a ':' its value could not take as a
 3886|       |                  // separator, say. The next pass measures indent as though this were the start
 3887|       |                  // of a line, so what is left of the real one is lost; reject it instead.
 3888|   171k|                  if constexpr (requires { ctx.line_prefix_before(it); }) {
 3889|   171k|                     if (ctx.line_prefix_before(it).has_content) {
  ------------------
  |  Branch (3889:26): [True: 98, False: 171k]
  ------------------
 3890|     98|                        ctx.error = error_code::syntax_error;
 3891|     98|                        return;
 3892|     98|                     }
 3893|   171k|                  }
 3894|   171k|               }
 3895|   403k|            }
 3896|  1.46M|         }
 3897|  1.11M|      }
_ZZN3glz4fromILj450ENS_17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES1_EEEEE2opITnDaXtlNS_4optsELj10ELb1ELb0ELb0ELb1ELb0ELb0ELb0ELb0ELj1EEERPKcRS5_TkNS_10is_contextERNS_4yaml12yaml_contextESA_EEvOT1_OT2_OT0_T3_ENKUlRT_RSK_SG_iE_clISE_SA_SA_EEbSO_SP_SG_i:
 4777|  1.48M|               ctx, it, end, int32_t(-1), [&](auto& ctx, auto& it, auto end, int32_t line_indent) -> bool {
 4778|  1.48M|                  auto parse_map_value = [&](val_t& val) -> bool {
 4779|  1.48M|                     if (it != end && !yaml::line_end_or_comment_table[static_cast<uint8_t>(*it)]) {
 4780|  1.48M|                        bool line_starts_with_explicit_value_indicator = false;
 4781|       |
 4782|       |                        // Inline mapping values in block context cannot start with a
 4783|       |                        // plain "key: value" pair on the same line (e.g. "a: b: c").
 4784|       |                        // Such constructs are malformed unless wrapped in flow
 4785|       |                        // delimiters ({...} / [...]) or quoted.
 4786|  1.48M|                        if constexpr (std::is_pointer_v<std::decay_t<decltype(it)>>) {
 4787|  1.48M|                           if (ctx.stream_begin) {
 4788|  1.48M|                              auto is_line_content_start = [&](auto pos) {
 4789|  1.48M|                                 return !ctx.line_prefix_before(pos).has_content;
 4790|  1.48M|                              };
 4791|       |
 4792|  1.48M|                              auto line_has_explicit_value_indicator = [&](auto pos) {
 4793|  1.48M|                                 const char* line = ctx.line_begin_of(pos);
 4794|  1.48M|                                 while (line != end && (*line == ' ' || *line == '\t')) ++line;
 4795|  1.48M|                                 return line != end && *line == ':';
 4796|  1.48M|                              };
 4797|       |
 4798|  1.48M|                              if (!is_line_content_start(it) &&
 4799|  1.48M|                                  yaml::inline_value_has_plain_mapping_indicator(it, end) &&
 4800|  1.48M|                                  !line_has_explicit_value_indicator(it)) {
 4801|  1.48M|                                 ctx.error = error_code::syntax_error;
 4802|  1.48M|                                 return false;
 4803|  1.48M|                              }
 4804|  1.48M|                              line_starts_with_explicit_value_indicator = line_has_explicit_value_indicator(it);
 4805|  1.48M|                           }
 4806|  1.48M|                        }
 4807|       |
 4808|  1.48M|                        if (*it == '-' &&
 4809|  1.48M|                            ((it + 1) == end || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*(it + 1))]) &&
 4810|  1.48M|                            !line_starts_with_explicit_value_indicator) {
 4811|       |                           // "key: - item" is not valid block sequence syntax.
 4812|  1.48M|                           ctx.error = error_code::syntax_error;
 4813|  1.48M|                           return false;
 4814|  1.48M|                        }
 4815|       |
 4816|  1.48M|                        if (!ctx.push_indent(line_indent + 1)) [[unlikely]]
 4817|  1.48M|                           return false;
 4818|  1.48M|                        from<YAML, val_t>::template op<Opts>(val, ctx, it, end);
 4819|  1.48M|                        ctx.pop_indent();
 4820|  1.48M|                     }
 4821|  1.48M|                     else {
 4822|  1.48M|                        int32_t nested_indent = yaml::detect_nested_value_indent(ctx, it, end, line_indent);
 4823|  1.48M|                        if (nested_indent >= 0) {
 4824|  1.48M|                           yaml::skip_to_content(it, end);
 4825|  1.48M|                           if (it != end && *it == ':' && (it + 1) != end && *(it + 1) == '\t') {
 4826|  1.48M|                              ctx.error = error_code::syntax_error;
 4827|  1.48M|                              return false;
 4828|  1.48M|                           }
 4829|       |                           // A struct value reads the pushed indent as its own key column;
 4830|       |                           // every other value type reads it as the enclosing baseline.
 4831|  1.48M|                           const int32_t value_indent =
 4832|  1.48M|                              yaml::receives_block_mapping_column<val_t>() ? nested_indent : nested_indent - 1;
 4833|  1.48M|                           if (!ctx.push_indent(value_indent)) [[unlikely]]
 4834|  1.48M|                              return false;
 4835|  1.48M|                           from<YAML, val_t>::template op<Opts>(val, ctx, it, end);
 4836|  1.48M|                           ctx.pop_indent();
 4837|  1.48M|                        }
 4838|  1.48M|                     }
 4839|  1.48M|                     return !bool(ctx.error);
 4840|  1.48M|                  };
 4841|       |
 4842|       |                  // Explicit key entry form:
 4843|       |                  // ? key
 4844|       |                  // : value
 4845|  1.48M|                  if (*it == '?' && ((it + 1) != end) && *(it + 1) == '\t') {
  ------------------
  |  Branch (4845:23): [True: 642k, False: 844k]
  |  Branch (4845:37): [True: 641k, False: 1.36k]
  |  Branch (4845:58): [True: 6, False: 641k]
  ------------------
 4846|      6|                     ctx.error = error_code::syntax_error;
 4847|      6|                     return false;
 4848|      6|                  }
 4849|  1.48M|                  if (*it == '?' && ((it + 1) == end || *(it + 1) == ' ' || *(it + 1) == '\n' || *(it + 1) == '\r')) {
  ------------------
  |  Branch (4849:23): [True: 642k, False: 844k]
  |  Branch (4849:38): [True: 1.36k, False: 641k]
  |  Branch (4849:57): [True: 259k, False: 381k]
  |  Branch (4849:77): [True: 236k, False: 145k]
  |  Branch (4849:98): [True: 124k, False: 20.6k]
  ------------------
 4850|   622k|                     ++it; // skip '?'
 4851|   622k|                     yaml::skip_inline_ws(it, end);
 4852|       |
 4853|   622k|                     const int32_t explicit_value_indicator_indent =
 4854|   622k|                        (ctx.current_indent() < 0) ? 0 : (ctx.current_indent() + 1);
  ------------------
  |  Branch (4854:25): [True: 436k, False: 185k]
  ------------------
 4855|       |
 4856|   622k|                     key_t key{};
 4857|   622k|                     if constexpr (std::same_as<std::remove_cvref_t<key_t>, std::string>) {
 4858|   622k|                        auto to_string_key = [&](glz::generic& key_node) {
 4859|   622k|                           return yaml::materialize_key(key, key_node, ctx);
 4860|   622k|                        };
 4861|       |
 4862|   622k|                        auto key_it = it;
 4863|   622k|                        yaml::skip_inline_ws(key_it, end);
 4864|       |
 4865|   622k|                        auto content = key_it;
 4866|   622k|                        yaml::skip_to_content(content, end);
 4867|   622k|                        bool handled_anchor_only_empty_key = false;
 4868|       |
 4869|       |                        // Anchor on an empty explicit key node:
 4870|       |                        //   ? &a
 4871|       |                        //   : value
 4872|   622k|                        if (content != end && *content == '&') {
  ------------------
  |  Branch (4872:29): [True: 612k, False: 9.99k]
  |  Branch (4872:47): [True: 189k, False: 422k]
  ------------------
 4873|   189k|                           auto anchor_probe = content + 1;
 4874|   189k|                           auto anchor_name = yaml::parse_anchor_name(anchor_probe, end);
 4875|   189k|                           if (!anchor_name.empty()) {
  ------------------
  |  Branch (4875:32): [True: 189k, False: 14]
  ------------------
 4876|   189k|                              auto after_anchor = anchor_probe;
 4877|   189k|                              yaml::skip_inline_ws(after_anchor, end);
 4878|       |
 4879|   189k|                              auto value_indicator = after_anchor;
 4880|   189k|                              if (value_indicator != end && *value_indicator == ':') {
  ------------------
  |  Branch (4880:35): [True: 187k, False: 2.82k]
  |  Branch (4880:61): [True: 8.69k, False: 178k]
  ------------------
 4881|  8.69k|                                 key.clear();
 4882|  8.69k|                                 ctx.anchors[std::string(anchor_name)] = {content, content, ctx.current_indent()};
 4883|  8.69k|                                 it = value_indicator;
 4884|  8.69k|                                 handled_anchor_only_empty_key = true;
 4885|  8.69k|                              }
 4886|   181k|                              else {
 4887|   181k|                                 if (value_indicator != end && *value_indicator == '#') {
  ------------------
  |  Branch (4887:38): [True: 178k, False: 2.82k]
  |  Branch (4887:64): [True: 5.53k, False: 172k]
  ------------------
 4888|  5.53k|                                    yaml::skip_comment(value_indicator, end);
 4889|  5.53k|                                 }
 4890|   181k|                                 if (value_indicator != end && (*value_indicator == '\n' || *value_indicator == '\r')) {
  ------------------
  |  Branch (4890:38): [True: 178k, False: 2.82k]
  |  Branch (4890:65): [True: 49.2k, False: 129k]
  |  Branch (4890:93): [True: 37.2k, False: 91.7k]
  ------------------
 4891|  86.5k|                                    yaml::skip_newline(value_indicator, end);
 4892|  86.5k|                                    auto value_line = value_indicator;
 4893|  86.5k|                                    int32_t value_indent = yaml::measure_indent(value_line, end, ctx);
 4894|  86.5k|                                    if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4894:41): [True: 10, False: 86.5k]
  ------------------
 4895|     10|                                       return false;
 4896|  86.5k|                                    if (value_line != end && *value_line == ':' &&
  ------------------
  |  Branch (4896:41): [True: 85.0k, False: 1.46k]
  |  Branch (4896:62): [True: 12.5k, False: 72.5k]
  ------------------
 4897|  12.5k|                                        value_indent == explicit_value_indicator_indent) {
  ------------------
  |  Branch (4897:41): [True: 12.5k, False: 6]
  ------------------
 4898|  12.5k|                                       key.clear();
 4899|  12.5k|                                       ctx.anchors[std::string(anchor_name)] = {content, content, ctx.current_indent()};
 4900|  12.5k|                                       it = value_line;
 4901|  12.5k|                                       handled_anchor_only_empty_key = true;
 4902|  12.5k|                                    }
 4903|  74.0k|                                    else if (value_line != end && *value_line == ':') {
  ------------------
  |  Branch (4903:46): [True: 72.5k, False: 1.46k]
  |  Branch (4903:67): [True: 6, False: 72.5k]
  ------------------
 4904|       |                                       // In explicit-key form ("? &a"), a following ':'
 4905|       |                                       // starts the outer value indicator only at the same
 4906|       |                                       // indentation. A deeper-indented ': value' is malformed.
 4907|      6|                                       ctx.error = error_code::syntax_error;
 4908|      6|                                       return false;
 4909|      6|                                    }
 4910|  86.5k|                                 }
 4911|   181k|                              }
 4912|   189k|                           }
 4913|   189k|                        }
 4914|       |
 4915|   621k|                        const bool key_content_spans_lines = [&] {
 4916|   621k|                           auto scan = key_it;
 4917|   621k|                           while (scan != content && scan != end) {
 4918|   621k|                              if (*scan == '\n' || *scan == '\r') return true;
 4919|   621k|                              ++scan;
 4920|   621k|                           }
 4921|   621k|                           return false;
 4922|   621k|                        }();
 4923|       |
 4924|   621k|                        if (handled_anchor_only_empty_key) {
  ------------------
  |  Branch (4924:29): [True: 21.2k, False: 600k]
  ------------------
 4925|       |                           // 'it' already points to the explicit value indicator ':'
 4926|  21.2k|                        }
 4927|   600k|                        else if (content == end || (*content == ':' && key_content_spans_lines)) {
  ------------------
  |  Branch (4927:34): [True: 9.99k, False: 590k]
  |  Branch (4927:53): [True: 9.32k, False: 581k]
  |  Branch (4927:72): [True: 4.48k, False: 4.84k]
  ------------------
 4928|  14.4k|                           key.clear();
 4929|  14.4k|                           it = content;
 4930|  14.4k|                        }
 4931|   586k|                        else {
 4932|       |                           // Explicit mapping keys ('? key-node') are full YAML nodes.
 4933|       |                           // Parse the key node structurally (not via plain-key scanning)
 4934|       |                           // so inputs like '? []: x' and '? JSON: like' are interpreted
 4935|       |                           // as complex keys, not split into implicit key/value pairs.
 4936|   586k|                           auto key_node_it = content;
 4937|   586k|                           auto key_node_end = end;
 4938|   586k|                           if constexpr (std::is_pointer_v<std::decay_t<It>>) {
 4939|       |                              // In explicit-key form, a following standalone ':'
 4940|       |                              // line (same or lower indentation) belongs to the
 4941|       |                              // outer mapping value, not the key node itself.
 4942|   586k|                              auto scan = content;
 4943|  6.62M|                              while (scan != end) {
  ------------------
  |  Branch (4943:38): [True: 6.54M, False: 75.2k]
  ------------------
 4944|   213M|                                 while (scan != end && *scan != '\n' && *scan != '\r') {
  ------------------
  |  Branch (4944:41): [True: 212M, False: 379k]
  |  Branch (4944:56): [True: 209M, False: 3.56M]
  |  Branch (4944:73): [True: 206M, False: 2.59M]
  ------------------
 4945|   206M|                                    ++scan;
 4946|   206M|                                 }
 4947|  6.54M|                                 if (scan == end) {
  ------------------
  |  Branch (4947:38): [True: 379k, False: 6.16M]
  ------------------
 4948|   379k|                                    break;
 4949|   379k|                                 }
 4950|       |
 4951|  6.16M|                                 yaml::skip_newline(scan, end);
 4952|  6.16M|                                 auto line_start = scan;
 4953|       |
 4954|  6.16M|                                 int32_t indicator_indent = 0;
 4955|  7.99M|                                 while (scan != end && *scan == ' ') {
  ------------------
  |  Branch (4955:41): [True: 7.92M, False: 75.2k]
  |  Branch (4955:56): [True: 1.83M, False: 6.09M]
  ------------------
 4956|  1.83M|                                    ++indicator_indent;
 4957|  1.83M|                                    ++scan;
 4958|  1.83M|                                 }
 4959|       |
 4960|  6.16M|                                 if (scan != end && *scan == ':') {
  ------------------
  |  Branch (4960:38): [True: 6.09M, False: 75.2k]
  |  Branch (4960:53): [True: 268k, False: 5.82M]
  ------------------
 4961|   268k|                                    const auto after_colon = scan + 1;
 4962|   268k|                                    if ((after_colon == end ||
  ------------------
  |  Branch (4962:42): [True: 1.91k, False: 266k]
  ------------------
 4963|   266k|                                         yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*after_colon)]) &&
  ------------------
  |  Branch (4963:42): [True: 200k, False: 65.9k]
  ------------------
 4964|   202k|                                        indicator_indent <= line_indent) {
  ------------------
  |  Branch (4964:41): [True: 131k, False: 70.6k]
  ------------------
 4965|   131k|                                       key_node_end = line_start;
 4966|   131k|                                       break;
 4967|   131k|                                    }
 4968|   268k|                                 }
 4969|  6.16M|                              }
 4970|   586k|                           }
 4971|       |
 4972|   586k|                           glz::generic key_node{};
 4973|   586k|                           const bool prev_explicit_mapping_key_context = ctx.explicit_mapping_key_context;
 4974|   586k|                           ctx.explicit_mapping_key_context = true;
 4975|   586k|                           from<YAML, glz::generic>::template op<Opts>(key_node, ctx, key_node_it, key_node_end);
 4976|   586k|                           ctx.explicit_mapping_key_context = prev_explicit_mapping_key_context;
 4977|   586k|                           if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4977:32): [True: 4.53k, False: 581k]
  ------------------
 4978|  4.53k|                              return false;
 4979|   581k|                           it = key_node_it;
 4980|   581k|                           if (!to_string_key(key_node)) [[unlikely]]
  ------------------
  |  Branch (4980:32): [True: 6, False: 581k]
  ------------------
 4981|      6|                              return false;
 4982|   581k|                        }
 4983|       |                     }
 4984|       |                     else {
 4985|       |                        if (it != end && !yaml::line_end_or_comment_table[static_cast<uint8_t>(*it)]) {
 4986|       |                           from<YAML, key_t>::template op<Opts>(key, ctx, it, end);
 4987|       |                           if (bool(ctx.error)) [[unlikely]]
 4988|       |                              return false;
 4989|       |                        }
 4990|       |                     }
 4991|       |
 4992|   617k|                     yaml::skip_inline_ws(it, end);
 4993|   622k|                     yaml::skip_comment(it, end);
 4994|       |
 4995|       |                     // Value indicator may appear on the next line at the same indent.
 4996|   622k|                     if (it != end && (*it == '\n' || *it == '\r')) {
  ------------------
  |  Branch (4996:26): [True: 537k, False: 84.3k]
  |  Branch (4996:40): [True: 40.2k, False: 497k]
  |  Branch (4996:55): [True: 79.4k, False: 417k]
  ------------------
 4997|   119k|                        auto probe = it;
 4998|   119k|                        bool found_value_indicator = false;
 4999|       |
 5000|   267k|                        while (probe != end && (*probe == '\n' || *probe == '\r')) {
  ------------------
  |  Branch (5000:32): [True: 247k, False: 19.4k]
  |  Branch (5000:49): [True: 79.4k, False: 168k]
  |  Branch (5000:67): [True: 168k, False: 0]
  ------------------
 5001|   247k|                           yaml::skip_newline(probe, end);
 5002|       |
 5003|   247k|                           auto value_line = probe;
 5004|   247k|                           int32_t value_indent = yaml::measure_indent(value_line, end, ctx);
 5005|   247k|                           if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (5005:32): [True: 18, False: 247k]
  ------------------
 5006|     18|                              return false;
 5007|       |
 5008|   247k|                           if (value_line == end || *value_line == '\n' || *value_line == '\r') {
  ------------------
  |  Branch (5008:32): [True: 12.7k, False: 234k]
  |  Branch (5008:53): [True: 30.5k, False: 204k]
  |  Branch (5008:76): [True: 71.9k, False: 132k]
  ------------------
 5009|   115k|                              probe = value_line;
 5010|   115k|                              continue; // blank line
 5011|   115k|                           }
 5012|   132k|                           if (*value_line == '#') {
  ------------------
  |  Branch (5012:32): [True: 32.0k, False: 100k]
  ------------------
 5013|  32.0k|                              yaml::skip_comment(value_line, end);
 5014|  32.0k|                              probe = value_line;
 5015|  32.0k|                              continue; // comment-only line
 5016|  32.0k|                           }
 5017|   100k|                           if (*value_line == ':' && value_indent == explicit_value_indicator_indent) {
  ------------------
  |  Branch (5017:32): [True: 26.7k, False: 73.5k]
  |  Branch (5017:54): [True: 20.8k, False: 5.84k]
  ------------------
 5018|  20.8k|                              it = value_line;
 5019|  20.8k|                              found_value_indicator = true;
 5020|  20.8k|                           }
 5021|   100k|                           break;
 5022|   132k|                        }
 5023|       |
 5024|   119k|                        if (found_value_indicator) {
  ------------------
  |  Branch (5024:29): [True: 20.8k, False: 98.8k]
  ------------------
 5025|  20.8k|                           yaml::skip_inline_ws(it, end);
 5026|  20.8k|                        }
 5027|   119k|                     }
 5028|       |
 5029|   621k|                     val_t val{};
 5030|   621k|                     if (it != end && *it == ':') {
  ------------------
  |  Branch (5030:26): [True: 537k, False: 84.3k]
  |  Branch (5030:39): [True: 185k, False: 352k]
  ------------------
 5031|   185k|                        ++it;
 5032|   185k|                        if (it != end && *it == '\t') {
  ------------------
  |  Branch (5032:29): [True: 178k, False: 6.67k]
  |  Branch (5032:42): [True: 6, False: 178k]
  ------------------
 5033|      6|                           ctx.error = error_code::syntax_error;
 5034|      6|                           return false;
 5035|      6|                        }
 5036|   185k|                        if (it != end && (*it == '\n' || *it == '\r')) {
  ------------------
  |  Branch (5036:29): [True: 178k, False: 6.67k]
  |  Branch (5036:43): [True: 16.3k, False: 162k]
  |  Branch (5036:58): [True: 19.6k, False: 142k]
  ------------------
 5037|  35.9k|                           auto probe = it;
 5038|  35.9k|                           yaml::skip_newline(probe, end);
 5039|  60.8k|                           while (probe != end && *probe == ' ') ++probe;
  ------------------
  |  Branch (5039:35): [True: 53.6k, False: 7.23k]
  |  Branch (5039:51): [True: 24.9k, False: 28.6k]
  ------------------
 5040|  35.9k|                           if (probe != end && *probe == ':' && ((probe + 1) != end) && *(probe + 1) == '\t') {
  ------------------
  |  Branch (5040:32): [True: 28.6k, False: 7.23k]
  |  Branch (5040:48): [True: 6.15k, False: 22.5k]
  |  Branch (5040:65): [True: 6.14k, False: 6]
  |  Branch (5040:89): [True: 0, False: 6.14k]
  ------------------
 5041|      0|                              ctx.error = error_code::syntax_error;
 5042|      0|                              return false;
 5043|      0|                           }
 5044|  35.9k|                        }
 5045|   185k|                        yaml::skip_inline_ws(it, end);
 5046|   185k|                        if (!parse_map_value(val)) [[unlikely]]
  ------------------
  |  Branch (5046:29): [True: 474, False: 184k]
  ------------------
 5047|    474|                           return false;
 5048|   185k|                     }
 5049|       |
 5050|   621k|                     value.emplace(std::move(key), std::move(val));
 5051|   621k|                     return true;
 5052|   621k|                  }
 5053|       |
 5054|   865k|                  key_t key{};
 5055|   865k|                  if constexpr (std::same_as<std::remove_cvref_t<key_t>, std::string>) {
 5056|   865k|                     auto key_probe = it;
 5057|   865k|                     yaml::skip_inline_ws(key_probe, end);
 5058|   865k|                     const bool complex_flow_key = (key_probe != end && (*key_probe == '[' || *key_probe == '{'));
  ------------------
  |  Branch (5058:53): [True: 865k, False: 0]
  |  Branch (5058:74): [True: 2.00k, False: 863k]
  |  Branch (5058:95): [True: 2.37k, False: 860k]
  ------------------
 5059|   865k|                     if (complex_flow_key) {
  ------------------
  |  Branch (5059:26): [True: 4.38k, False: 860k]
  ------------------
 5060|  4.38k|                        glz::generic key_node{};
 5061|  4.38k|                        from<YAML, glz::generic>::template op<yaml::flow_context_on<Opts>()>(key_node, ctx, it, end);
 5062|  4.38k|                        if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (5062:29): [True: 1.18k, False: 3.19k]
  ------------------
 5063|  1.18k|                           return false;
 5064|  3.19k|                        if (!yaml::materialize_key(key, key_node, ctx)) [[unlikely]]
  ------------------
  |  Branch (5064:29): [True: 0, False: 3.19k]
  ------------------
 5065|      0|                           return false;
 5066|  3.19k|                     }
 5067|   860k|                     else {
 5068|   860k|                        if (!yaml::parse_yaml_key(key, ctx, it, end, false)) {
  ------------------
  |  Branch (5068:29): [True: 11.7k, False: 848k]
  ------------------
 5069|  11.7k|                           return false;
 5070|  11.7k|                        }
 5071|   860k|                     }
 5072|       |                  }
 5073|       |                  else {
 5074|       |                     from<YAML, key_t>::template op<Opts>(key, ctx, it, end);
 5075|       |                     if (bool(ctx.error)) [[unlikely]]
 5076|       |                        return false;
 5077|       |                  }
 5078|       |
 5079|   852k|                  yaml::skip_inline_ws(it, end);
 5080|       |
 5081|   865k|                  if (it == end || *it != ':') {
  ------------------
  |  Branch (5081:23): [True: 13.1k, False: 852k]
  |  Branch (5081:36): [True: 96, False: 851k]
  ------------------
 5082|    256|                     ctx.error = error_code::syntax_error;
 5083|    256|                     return false;
 5084|    256|                  }
 5085|   864k|                  ++it;
 5086|   864k|                  yaml::skip_inline_ws(it, end);
 5087|       |
 5088|   864k|                  val_t val{};
 5089|   864k|                  if (!parse_map_value(val)) [[unlikely]]
  ------------------
  |  Branch (5089:23): [True: 2.24k, False: 862k]
  ------------------
 5090|  2.24k|                     return false;
 5091|       |
 5092|   862k|                  value.emplace(std::move(key), std::move(val));
 5093|   862k|                  return true;
 5094|   864k|               });
_ZZZN3glz4fromILj450ENS_17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES1_EEEEE2opITnDaXtlNS_4optsELj10ELb1ELb0ELb0ELb1ELb0ELb0ELb0ELb0ELj1EEERPKcRS5_TkNS_10is_contextERNS_4yaml12yaml_contextESA_EEvOT1_OT2_OT0_T3_ENKUlRT_RSK_SG_iE_clISE_SA_SA_EEbSO_SP_SG_iENKUlvE_clEv:
 4915|   621k|                        const bool key_content_spans_lines = [&] {
 4916|   621k|                           auto scan = key_it;
 4917|   642k|                           while (scan != content && scan != end) {
  ------------------
  |  Branch (4917:35): [True: 422k, False: 220k]
  |  Branch (4917:54): [True: 422k, False: 0]
  ------------------
 4918|   422k|                              if (*scan == '\n' || *scan == '\r') return true;
  ------------------
  |  Branch (4918:35): [True: 240k, False: 181k]
  |  Branch (4918:52): [True: 160k, False: 20.5k]
  ------------------
 4919|  20.5k|                              ++scan;
 4920|  20.5k|                           }
 4921|   220k|                           return false;
 4922|   621k|                        }();
_ZZZN3glz4fromILj450ENS_17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES1_EEEEE2opITnDaXtlNS_4optsELj10ELb1ELb0ELb0ELb1ELb0ELb0ELb0ELb0ELj1EEERPKcRS5_TkNS_10is_contextERNS_4yaml12yaml_contextESA_EEvOT1_OT2_OT0_T3_ENKUlRT_RSK_SG_iE_clISE_SA_SA_EEbSO_SP_SG_iENKUlRS4_E0_clESS_:
 4858|   581k|                        auto to_string_key = [&](glz::generic& key_node) {
 4859|   581k|                           return yaml::materialize_key(key, key_node, ctx);
 4860|   581k|                        };
_ZZZN3glz4fromILj450ENS_17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES1_EEEEE2opITnDaXtlNS_4optsELj10ELb1ELb0ELb0ELb1ELb0ELb0ELb0ELb0ELj1EEERPKcRS5_TkNS_10is_contextERNS_4yaml12yaml_contextESA_EEvOT1_OT2_OT0_T3_ENKUlRT_RSK_SG_iE_clISE_SA_SA_EEbSO_SP_SG_iENKUlRS4_E_clESS_:
 4778|  1.03M|                  auto parse_map_value = [&](val_t& val) -> bool {
 4779|  1.03M|                     if (it != end && !yaml::line_end_or_comment_table[static_cast<uint8_t>(*it)]) {
  ------------------
  |  Branch (4779:26): [True: 1.00M, False: 30.7k]
  |  Branch (4779:39): [True: 692k, False: 313k]
  ------------------
 4780|   692k|                        bool line_starts_with_explicit_value_indicator = false;
 4781|       |
 4782|       |                        // Inline mapping values in block context cannot start with a
 4783|       |                        // plain "key: value" pair on the same line (e.g. "a: b: c").
 4784|       |                        // Such constructs are malformed unless wrapped in flow
 4785|       |                        // delimiters ({...} / [...]) or quoted.
 4786|   692k|                        if constexpr (std::is_pointer_v<std::decay_t<decltype(it)>>) {
 4787|   692k|                           if (ctx.stream_begin) {
  ------------------
  |  Branch (4787:32): [True: 692k, False: 0]
  ------------------
 4788|   692k|                              auto is_line_content_start = [&](auto pos) {
 4789|   692k|                                 return !ctx.line_prefix_before(pos).has_content;
 4790|   692k|                              };
 4791|       |
 4792|   692k|                              auto line_has_explicit_value_indicator = [&](auto pos) {
 4793|   692k|                                 const char* line = ctx.line_begin_of(pos);
 4794|   692k|                                 while (line != end && (*line == ' ' || *line == '\t')) ++line;
 4795|   692k|                                 return line != end && *line == ':';
 4796|   692k|                              };
 4797|       |
 4798|   692k|                              if (!is_line_content_start(it) &&
  ------------------
  |  Branch (4798:35): [True: 692k, False: 0]
  ------------------
 4799|   692k|                                  yaml::inline_value_has_plain_mapping_indicator(it, end) &&
  ------------------
  |  Branch (4799:35): [True: 91.7k, False: 600k]
  ------------------
 4800|  91.7k|                                  !line_has_explicit_value_indicator(it)) {
  ------------------
  |  Branch (4800:35): [True: 18, False: 91.7k]
  ------------------
 4801|     18|                                 ctx.error = error_code::syntax_error;
 4802|     18|                                 return false;
 4803|     18|                              }
 4804|   692k|                              line_starts_with_explicit_value_indicator = line_has_explicit_value_indicator(it);
 4805|   692k|                           }
 4806|   692k|                        }
 4807|       |
 4808|   692k|                        if (*it == '-' &&
  ------------------
  |  Branch (4808:29): [True: 21.4k, False: 670k]
  ------------------
 4809|  21.4k|                            ((it + 1) == end || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*(it + 1))]) &&
  ------------------
  |  Branch (4809:30): [True: 72, False: 21.4k]
  |  Branch (4809:49): [True: 12.9k, False: 8.49k]
  ------------------
 4810|  12.9k|                            !line_starts_with_explicit_value_indicator) {
  ------------------
  |  Branch (4810:29): [True: 12, False: 12.9k]
  ------------------
 4811|       |                           // "key: - item" is not valid block sequence syntax.
 4812|     12|                           ctx.error = error_code::syntax_error;
 4813|     12|                           return false;
 4814|     12|                        }
 4815|       |
 4816|   692k|                        if (!ctx.push_indent(line_indent + 1)) [[unlikely]]
  ------------------
  |  Branch (4816:29): [True: 0, False: 692k]
  ------------------
 4817|      0|                           return false;
 4818|   692k|                        from<YAML, val_t>::template op<Opts>(val, ctx, it, end);
 4819|   692k|                        ctx.pop_indent();
 4820|   692k|                     }
 4821|   344k|                     else {
 4822|   344k|                        int32_t nested_indent = yaml::detect_nested_value_indent(ctx, it, end, line_indent);
 4823|   344k|                        if (nested_indent >= 0) {
  ------------------
  |  Branch (4823:29): [True: 154k, False: 189k]
  ------------------
 4824|   154k|                           yaml::skip_to_content(it, end);
 4825|   154k|                           if (it != end && *it == ':' && (it + 1) != end && *(it + 1) == '\t') {
  ------------------
  |  Branch (4825:32): [True: 154k, False: 0]
  |  Branch (4825:45): [True: 0, False: 154k]
  |  Branch (4825:59): [True: 0, False: 0]
  |  Branch (4825:78): [True: 0, False: 0]
  ------------------
 4826|      0|                              ctx.error = error_code::syntax_error;
 4827|      0|                              return false;
 4828|      0|                           }
 4829|       |                           // A struct value reads the pushed indent as its own key column;
 4830|       |                           // every other value type reads it as the enclosing baseline.
 4831|   154k|                           const int32_t value_indent =
 4832|   154k|                              yaml::receives_block_mapping_column<val_t>() ? nested_indent : nested_indent - 1;
  ------------------
  |  Branch (4832:31): [Folded, False: 154k]
  ------------------
 4833|   154k|                           if (!ctx.push_indent(value_indent)) [[unlikely]]
  ------------------
  |  Branch (4833:32): [True: 0, False: 154k]
  ------------------
 4834|      0|                              return false;
 4835|   154k|                           from<YAML, val_t>::template op<Opts>(val, ctx, it, end);
 4836|   154k|                           ctx.pop_indent();
 4837|   154k|                        }
 4838|   344k|                     }
 4839|  1.03M|                     return !bool(ctx.error);
 4840|  1.03M|                  };
_ZZZZN3glz4fromILj450ENS_17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES1_EEEEE2opITnDaXtlNS_4optsELj10ELb1ELb0ELb0ELb1ELb0ELb0ELb0ELb0ELj1EEERPKcRS5_TkNS_10is_contextERNS_4yaml12yaml_contextESA_EEvOT1_OT2_OT0_T3_ENKUlRT_RSK_SG_iE_clISE_SA_SA_EEbSO_SP_SG_iENKUlRS4_E_clESS_ENKUlSN_E_clISA_EEDaSN_:
 4788|   692k|                              auto is_line_content_start = [&](auto pos) {
 4789|   692k|                                 return !ctx.line_prefix_before(pos).has_content;
 4790|   692k|                              };
_ZZZZN3glz4fromILj450ENS_17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES1_EEEEE2opITnDaXtlNS_4optsELj10ELb1ELb0ELb0ELb1ELb0ELb0ELb0ELb0ELj1EEERPKcRS5_TkNS_10is_contextERNS_4yaml12yaml_contextESA_EEvOT1_OT2_OT0_T3_ENKUlRT_RSK_SG_iE_clISE_SA_SA_EEbSO_SP_SG_iENKUlRS4_E_clESS_ENKUlSN_E0_clISA_EEDaSN_:
 4792|   784k|                              auto line_has_explicit_value_indicator = [&](auto pos) {
 4793|   784k|                                 const char* line = ctx.line_begin_of(pos);
 4794|  1.02M|                                 while (line != end && (*line == ' ' || *line == '\t')) ++line;
  ------------------
  |  Branch (4794:41): [True: 1.02M, False: 0]
  |  Branch (4794:57): [True: 239k, False: 786k]
  |  Branch (4794:73): [True: 2.20k, False: 784k]
  ------------------
 4795|   784k|                                 return line != end && *line == ':';
  ------------------
  |  Branch (4795:41): [True: 784k, False: 0]
  |  Branch (4795:56): [True: 400k, False: 383k]
  ------------------
 4796|   784k|                              };
_ZZN3glz4fromILj450ENS_17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES1_EEEEE2opITnDaXtlNS_4optsELj10ELb1ELb0ELb0ELb1ELb0ELb0ELb0ELb0ELj1EEERPKcRS5_TkNS_10is_contextERNS_4yaml12yaml_contextESA_EEvOT1_OT2_OT0_T3_EN19merge_restore_guardD2Ev:
 4547|  3.70M|            {
 4548|       |               // emplace is a no-op for keys the document already wrote, so only
 4549|       |               // untouched pre-existing entries are put back.
 4550|  3.70M|               for (auto& entry : saved) {
  ------------------
  |  Branch (4550:33): [True: 0, False: 3.70M]
  ------------------
 4551|      0|                  target.emplace(entry.first, std::move(entry.second));
 4552|      0|               }
 4553|  3.70M|            }
_ZN3glz33process_yaml_variant_alternativesINSt3__17variantIJDndNS1_12basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEbNS1_6vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS6_ISD_EEEENSC_ISD_EEEEENS_21is_yaml_variant_arrayEE2opITnDaXtlNS_4optsELj10ELb1ELb0ELb0ELb1ELb0ELb0ELb0ELb0ELj1EEERSH_TkNS_10is_contextERNS_4yaml12yaml_contextERPKcSR_EEvOT0_OT1_OT2_T3_:
 5205|  1.53M|      {
 5206|  1.53M|         constexpr auto category_count = yaml_variant_count_v<Variant, Trait>;
 5207|       |
 5208|       |         if constexpr (category_count == 0) {
 5209|       |            ctx.error = error_code::no_matching_variant_type;
 5210|       |         }
 5211|  1.53M|         else if constexpr (category_count == 1) {
 5212|       |            // Only one type in this category, use it directly
 5213|  1.53M|            constexpr auto first_idx = yaml_variant_first_index_v<Variant, Trait>;
 5214|  1.53M|            using V = std::variant_alternative_t<first_idx, Variant>;
 5215|  1.53M|            if (!std::holds_alternative<V>(value)) value = V{};
  ------------------
  |  Branch (5215:17): [True: 1.53M, False: 0]
  ------------------
 5216|  1.53M|            from<YAML, V>::template op<Opts>(std::get<V>(value), ctx, it, end);
 5217|       |         }
 5218|       |         else {
 5219|       |            // Multiple types in this category, try each one
 5220|       |            constexpr auto N = std::variant_size_v<Variant>;
 5221|       |            bool found_match{};
 5222|       |            size_t match_idx = 0;
 5223|       |            // Only the last alternative propagates its error, so an alternative that exhausted an
 5224|       |            // expansion budget would otherwise be reported as no_matching_variant_type -- a wrong
 5225|       |            // diagnosis for a document that is hostile rather than merely the wrong shape. Held
 5226|       |            // aside and used only if nothing matched, so an alternative that does succeed later
 5227|       |            // (one that materializes no key text can still parse under a latched budget) is
 5228|       |            // unaffected.
 5229|       |            error_code expansion_error{};
 5230|       |            std::string_view expansion_message{};
 5231|       |
 5232|       |            for_each<N>([&]<size_t I>() {
 5233|       |               if (found_match) {
 5234|       |                  return;
 5235|       |               }
 5236|       |               using V = std::variant_alternative_t<I, Variant>;
 5237|       |               if constexpr (Trait<V>::value) {
 5238|       |                  auto copy_it = it;
 5239|       |                  if (!std::holds_alternative<V>(value)) {
 5240|       |                     value = V{};
 5241|       |                  }
 5242|       |
 5243|       |                  auto temp_ctx = ctx.make_speculative();
 5244|       |                  from<YAML, V>::template op<Opts>(std::get<V>(value), temp_ctx, it, end);
 5245|       |
 5246|       |                  // Charged whether or not the alternative fit: a rejected probe still replayed
 5247|       |                  // whatever aliases it reached, and an attempt that is never billed is an
 5248|       |                  // attempt that can be repeated for free.
 5249|       |                  ctx.alias_expansion_budget = temp_ctx.alias_expansion_budget;
 5250|       |                  ctx.key_expansion_budget = temp_ctx.key_expansion_budget;
 5251|       |
 5252|       |                  if (!bool(temp_ctx.error)) {
 5253|       |                     found_match = true;
 5254|       |                     ctx.anchors = std::move(temp_ctx.anchors);
 5255|       |                  }
 5256|       |                  else {
 5257|       |                     it = copy_it;
 5258|       |                     if (temp_ctx.error == error_code::exceeded_max_expansion && expansion_error == error_code::none) {
 5259|       |                        expansion_error = temp_ctx.error;
 5260|       |                        expansion_message = temp_ctx.custom_error_message;
 5261|       |                     }
 5262|       |                     if (match_idx + 1 < category_count) {
 5263|       |                        // Not the last type, continue trying
 5264|       |                     }
 5265|       |                     else {
 5266|       |                        // Last type failed, propagate error
 5267|       |                        ctx.error = temp_ctx.error;
 5268|       |                        ctx.custom_error_message = temp_ctx.custom_error_message;
 5269|       |                     }
 5270|       |                  }
 5271|       |                  ++match_idx;
 5272|       |               }
 5273|       |            });
 5274|       |
 5275|       |            if (!found_match && !bool(ctx.error)) {
 5276|       |               if (expansion_error != error_code::none) {
 5277|       |                  ctx.error = expansion_error;
 5278|       |                  ctx.custom_error_message = expansion_message;
 5279|       |               }
 5280|       |               else {
 5281|       |                  ctx.error = error_code::no_matching_variant_type;
 5282|       |               }
 5283|       |            }
 5284|       |         }
 5285|  1.53M|      }
_ZN3glz4fromILj450ENSt3__16vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS1_9allocatorIS6_EEEEE2opITnDaXtlNS_4optsELj10ELb1ELb0ELb0ELb1ELb0ELb0ELb0ELb0ELj1EEERPKcRS9_TkNS_10is_contextERNS_4yaml12yaml_contextESE_EEvOT1_OT2_OT0_T3_:
 4098|  1.62M|      {
 4099|  1.62M|         if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4099:14): [True: 0, False: 1.62M]
  ------------------
 4100|      0|            return;
 4101|       |
 4102|       |         // Peek ahead to check for tag (don't consume indentation for block sequences)
 4103|  1.62M|         auto peek = it;
 4104|  1.62M|         yaml::node_preamble_state preamble{};
 4105|  1.62M|         if (yaml::parse_node_preamble<Opts>(value, ctx, peek, end, preamble,
  ------------------
  |  Branch (4105:14): [True: 95.5k, False: 1.52M]
  ------------------
 4106|  1.62M|                                             [](yaml::yaml_tag tag) { return yaml::tag_valid_for_seq(tag); })) {
 4107|  95.5k|            it = peek;
 4108|  95.5k|            return;
 4109|  95.5k|         }
 4110|       |
 4111|  1.52M|         if (*peek == '[') {
  ------------------
  |  Branch (4111:14): [True: 160k, False: 1.36M]
  ------------------
 4112|       |            // Flow sequence - consume whitespace and parse
 4113|   160k|            it = peek;
 4114|   160k|            yaml::parse_flow_sequence<Opts>(value, ctx, it, end);
 4115|   160k|         }
 4116|  1.36M|         else if (*peek == '-') {
  ------------------
  |  Branch (4116:19): [True: 1.36M, False: 144]
  ------------------
 4117|       |            // Block sequence - don't consume leading whitespace, let parse_block_sequence handle it
 4118|       |            // But if there was a tag, we need to advance past it
 4119|  1.36M|            if (preamble.tag != yaml::yaml_tag::none || preamble.node_props.has_anchor) {
  ------------------
  |  Branch (4119:17): [True: 8.92k, False: 1.35M]
  |  Branch (4119:57): [True: 3.16k, False: 1.35M]
  ------------------
 4120|  12.0k|               it = peek;
 4121|  12.0k|            }
 4122|  1.36M|            int32_t seq_indent = ctx.current_indent();
 4123|  1.36M|            if (*it == '-' && ctx.current_indent() >= 0) {
  ------------------
  |  Branch (4123:17): [True: 1.36M, False: 2.20k]
  |  Branch (4123:31): [True: 308k, False: 1.05M]
  ------------------
 4124|   308k|               seq_indent = ctx.allow_indentless_sequence ? (ctx.current_indent() > 0 ? (ctx.current_indent() - 1) : 0)
  ------------------
  |  Branch (4124:29): [True: 44.5k, False: 264k]
  |  Branch (4124:62): [True: 29.0k, False: 15.5k]
  ------------------
 4125|   308k|                                                          : (ctx.current_indent() + 1);
 4126|   308k|            }
 4127|  1.36M|            yaml::parse_block_sequence<Opts>(value, ctx, it, end, seq_indent);
 4128|  1.36M|         }
 4129|    144|         else {
 4130|    144|            ctx.error = error_code::syntax_error;
 4131|    144|         }
 4132|       |
 4133|  1.52M|         yaml::finalize_node_anchor(preamble.node_props, ctx, it);
 4134|  1.52M|      }
_ZN3glz4yaml19parse_node_preambleITnDaXtlNS_4optsELj10ELb1ELb0ELb0ELb1ELb0ELb0ELb0ELb0ELj1EEEXtlNS0_20node_property_policyELb1EEELb0ERNSt3__16vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS4_9allocatorIS9_EEEENS0_12yaml_contextEPKcSG_ZNS_4fromILj450ESC_E2opITnDaXtlS2_Lj10ELb1ELb0ELb0ELb1ELb0ELb0ELb0ELb0ELj1EEERSG_SD_TkNS_10is_contextERSE_SG_EEvOT1_OT2_OT0_T3_EUlNS0_8yaml_tagEE_EEbSP_RSS_RT4_T5_RNS0_19node_preamble_stateEOT6_:
  465|  1.62M|      {
  466|  1.62M|         skip_inline_ws(it, end);
  467|       |
  468|  1.62M|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (468:14): [True: 10, False: 1.62M]
  ------------------
  469|     10|            if constexpr (!AllowEmptyInput) {
  470|     10|               ctx.error = error_code::unexpected_end;
  471|     10|            }
  472|     10|            return true;
  473|     10|         }
  474|       |
  475|  1.62M|         preamble.tag = parse_yaml_tag(it, end, ctx);
  476|  1.62M|         if (preamble.tag == yaml_tag::unknown) [[unlikely]] {
  ------------------
  |  Branch (476:14): [True: 6, False: 1.62M]
  ------------------
  477|      6|            ctx.error = error_code::syntax_error;
  478|      6|            return true;
  479|      6|         }
  480|  1.62M|         if (!tag_validator(preamble.tag)) [[unlikely]] {
  ------------------
  |  Branch (480:14): [True: 6, False: 1.62M]
  ------------------
  481|      6|            ctx.error = error_code::syntax_error;
  482|      6|            return true;
  483|      6|         }
  484|       |
  485|  1.62M|         skip_inline_ws(it, end);
  486|       |
  487|  1.62M|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (487:14): [True: 6, False: 1.62M]
  ------------------
  488|      6|            if constexpr (!AllowEmptyInput) {
  489|      6|               ctx.error = error_code::unexpected_end;
  490|      6|            }
  491|      6|            return true;
  492|      6|         }
  493|       |
  494|  1.62M|         if (parse_node_properties<Opts, PropertyPolicy>(std::forward<T>(value), ctx, it, end, preamble.node_props)) {
  ------------------
  |  Branch (494:14): [True: 95.4k, False: 1.52M]
  ------------------
  495|  95.4k|            return true;
  496|  95.4k|         }
  497|       |
  498|  1.52M|         return false;
  499|  1.62M|      }
_ZZN3glz4fromILj450ENSt3__16vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS1_9allocatorIS6_EEEEE2opITnDaXtlNS_4optsELj10ELb1ELb0ELb0ELb1ELb0ELb0ELb0ELb0ELj1EEERPKcRS9_TkNS_10is_contextERNS_4yaml12yaml_contextESE_EEvOT1_OT2_OT0_T3_ENKUlNSH_8yaml_tagEE_clESR_:
 4106|  1.62M|                                             [](yaml::yaml_tag tag) { return yaml::tag_valid_for_seq(tag); })) {
_ZN3glz4yaml21parse_node_propertiesITnDaXtlNS_4optsELj10ELb1ELb0ELb0ELb1ELb0ELb0ELb0ELb0ELj1EEEXtlNS0_20node_property_policyELb1EEERNSt3__16vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS4_9allocatorIS9_EEEENS0_12yaml_contextEPKcSG_EEbOT1_RT2_RT3_T4_RNS0_19node_property_stateE:
  408|  1.62M|      {
  409|  1.62M|         state.has_anchor = false;
  410|  1.62M|         state.anchor_name.clear();
  411|  1.62M|         state.anchor_start = nullptr;
  412|  1.62M|         state.anchor_indent = ctx.current_indent();
  413|       |
  414|  1.62M|         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.62M|            else {
  421|  1.62M|               if (handle_alias<Opts>(std::forward<T>(value), ctx, it, end)) return true;
  ------------------
  |  Branch (421:20): [True: 95.4k, False: 1.52M]
  ------------------
  422|  1.62M|            }
  423|  1.62M|         }
  424|       |
  425|  1.62M|         if (it != end && *it == '&') {
  ------------------
  |  Branch (425:14): [True: 1.52M, False: 95.4k]
  |  Branch (425:27): [True: 4.75k, False: 1.52M]
  ------------------
  426|  4.75k|            ++it;
  427|  4.75k|            auto name = parse_anchor_name(it, end);
  428|  4.75k|            if (name.empty()) {
  ------------------
  |  Branch (428:17): [True: 20, False: 4.73k]
  ------------------
  429|     20|               ctx.error = error_code::syntax_error;
  430|     20|               return true;
  431|     20|            }
  432|  4.73k|            skip_inline_ws(it, end);
  433|  4.73k|            if (it == end) {
  ------------------
  |  Branch (433:17): [True: 24, False: 4.70k]
  ------------------
  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|  4.70k|            state.has_anchor = true;
  446|  4.70k|            state.anchor_name = std::string(name);
  447|  4.70k|            state.anchor_start = &*it;
  448|  4.70k|         }
  449|       |
  450|  1.62M|         return false;
  451|  1.62M|      }
_ZN3glz4yaml12handle_aliasITnDaXtlNS_4optsELj10ELb1ELb0ELb0ELb1ELb0ELb0ELb0ELb0ELj1EEERNSt3__16vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS3_9allocatorIS8_EEEENS0_12yaml_contextEPKcSF_EEbOT0_RT1_RT2_T3_:
  300|  1.62M|      {
  301|  1.62M|         if (it == end || *it != '*') return false;
  ------------------
  |  Branch (301:14): [True: 0, False: 1.62M]
  |  Branch (301:27): [True: 1.52M, False: 95.4k]
  ------------------
  302|       |
  303|  95.4k|         ++it; // skip '*'
  304|  95.4k|         auto name = parse_anchor_name(it, end);
  305|  95.4k|         if (name.empty()) {
  ------------------
  |  Branch (305:14): [True: 20, False: 95.4k]
  ------------------
  306|     20|            ctx.error = error_code::syntax_error;
  307|     20|            return true;
  308|     20|         }
  309|       |
  310|  95.4k|         auto anchor_it = ctx.anchors.find(name);
  311|  95.4k|         if (anchor_it == ctx.anchors.end()) {
  ------------------
  |  Branch (311:14): [True: 26, False: 95.3k]
  ------------------
  312|     26|            ctx.error = error_code::syntax_error; // undefined alias
  313|     26|            return true;
  314|     26|         }
  315|       |
  316|       |         // Copied rather than referenced: the replay below can replace ctx.anchors wholesale
  317|       |         // (a speculative parse hands its own map back), which would dangle a reference here.
  318|  95.3k|         const auto span = anchor_it->second;
  319|       |
  320|       |         // Empty anchor span (anchor on null/empty node) — leave value as default
  321|  95.3k|         if (span.begin == span.end) {
  ------------------
  |  Branch (321:14): [True: 4.19k, False: 91.2k]
  ------------------
  322|  4.19k|            return true;
  323|  4.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|  91.2k|         if (ctx.alias_span_is_replaying(span.begin, span.end)) [[unlikely]] {
  ------------------
  |  Branch (328:14): [True: 44, False: 91.1k]
  ------------------
  329|     44|            ctx.error = error_code::syntax_error; // cyclic alias
  330|     44|            return true;
  331|     44|         }
  332|       |
  333|       |         // Replaying an anchor re-enters the reader directly, bypassing the variant reader's
  334|       |         // depth guard, so this is the only depth accounting a chain of aliases into a
  335|       |         // non-variant target gets. The cycle check above stops the unbounded case; this bounds
  336|       |         // a legitimate but deeply chained one.
  337|  91.1k|         depth_guard guard{ctx, yaml::max_yaml_recursive_depth};
  338|  91.1k|         if (!guard) [[unlikely]]
  ------------------
  |  Branch (338:14): [True: 6, False: 91.1k]
  ------------------
  339|      6|            return true;
  340|       |
  341|  91.1k|         if (!ctx.charge_alias_expansion(static_cast<size_t>(span.end - span.begin))) [[unlikely]] {
  ------------------
  |  Branch (341:14): [True: 4, False: 91.1k]
  ------------------
  342|      4|            ctx.error = error_code::exceeded_max_expansion;
  343|      4|            ctx.custom_error_message = "alias expansion";
  344|      4|            return true;
  345|      4|         }
  346|       |
  347|  91.1k|         auto replay_it = span.begin;
  348|  91.1k|         auto replay_end = span.end;
  349|       |
  350|       |         // Save indent context and set up for replay
  351|  91.1k|         auto saved_indent_stack = std::move(ctx.indent_stack);
  352|  91.1k|         ctx.indent_stack.clear();
  353|  91.1k|         if (span.base_indent > 0) {
  ------------------
  |  Branch (353:14): [True: 1.35k, False: 89.8k]
  ------------------
  354|  1.35k|            ctx.push_indent(span.base_indent - 1);
  355|  1.35k|         }
  356|       |
  357|  91.1k|         ctx.active_alias_spans.emplace_back(span.begin, span.end);
  358|       |
  359|  91.1k|         using V = std::remove_cvref_t<T>;
  360|  91.1k|         from<YAML, V>::template op<Opts>(std::forward<T>(value), ctx, replay_it, replay_end);
  361|       |
  362|  91.1k|         ctx.active_alias_spans.pop_back();
  363|       |
  364|       |         // Restore indent context
  365|  91.1k|         ctx.indent_stack = std::move(saved_indent_stack);
  366|  91.1k|         return true;
  367|  91.1k|      }
_ZN3glz4yaml19parse_flow_sequenceITnDaXtlNS_4optsELj10ELb1ELb0ELb0ELb1ELb0ELb0ELb0ELb0ELj1EEERNSt3__16vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS3_9allocatorIS8_EEEENS0_12yaml_contextEPKcSF_EEvOT0_RT1_RT2_T3_:
 2596|   160k|      {
 2597|   160k|         using V = std::remove_cvref_t<T>;
 2598|   160k|         using value_type = typename V::value_type;
 2599|       |
 2600|   160k|         struct sequence_container_adapter
 2601|   160k|         {
 2602|   160k|            size_t index = 0;
 2603|       |
 2604|   160k|            inline bool fixed_capacity_reached(const V& container) const noexcept
 2605|   160k|            {
 2606|   160k|               if constexpr (!resizable<V>) {
 2607|   160k|                  return index >= container.size();
 2608|   160k|               }
 2609|   160k|               else {
 2610|   160k|                  (void)container;
 2611|   160k|                  return false;
 2612|   160k|               }
 2613|   160k|            }
 2614|       |
 2615|   160k|            inline void commit_fixed_slot() noexcept { ++index; }
 2616|       |
 2617|   160k|            inline void append(V& container, value_type&& element) noexcept
 2618|   160k|            {
 2619|   160k|               if constexpr (emplace_backable<V>) {
 2620|   160k|                  container.emplace_back(std::move(element));
 2621|   160k|               }
 2622|   160k|               else if constexpr (emplaceable<V>) {
 2623|   160k|                  container.emplace(std::move(element));
 2624|   160k|               }
 2625|   160k|            }
 2626|   160k|         };
 2627|       |
 2628|   160k|         if (it == end || *it != '[') [[unlikely]] {
  ------------------
  |  Branch (2628:14): [True: 0, False: 160k]
  |  Branch (2628:27): [True: 0, False: 160k]
  ------------------
 2629|      0|            ctx.error = error_code::syntax_error;
 2630|      0|            return;
 2631|      0|         }
 2632|       |
 2633|       |         // Overwrite (do not append to) any pre-existing contents. Must happen
 2634|       |         // before the empty-array early return below so that `[]` also clears.
 2635|   160k|         clear_sequence_before_read<Opts>(value);
 2636|       |
 2637|   160k|         ++it; // Skip '['
 2638|       |         // Skip whitespace and newlines after opening bracket (YAML allows multi-line flow sequences)
 2639|   160k|         skip_flow_ws_and_newlines(ctx, it, end);
 2640|   160k|         if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2640:14): [True: 6, False: 160k]
  ------------------
 2641|      6|            return;
 2642|       |
 2643|       |         // Handle empty array
 2644|   160k|         if (it != end && *it == ']') {
  ------------------
  |  Branch (2644:14): [True: 159k, False: 518]
  |  Branch (2644:27): [True: 26.2k, False: 133k]
  ------------------
 2645|  26.2k|            ++it;
 2646|  26.2k|            validate_flow_node_adjacent_tail(ctx, it, end);
 2647|  26.2k|            if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2647:17): [True: 6, False: 26.1k]
  ------------------
 2648|      6|               return;
 2649|       |            if constexpr (!yaml::check_flow_context(Opts)) {
 2650|       |               if (ctx.current_indent() < 0) {
 2651|       |                  validate_root_flow_tail_after_close(ctx, it, end);
 2652|       |               }
 2653|       |            }
 2654|  26.1k|            return;
 2655|  26.2k|         }
 2656|       |
 2657|   134k|         bool just_saw_comma = false;
 2658|   134k|         sequence_container_adapter adapter{};
 2659|       |
 2660|   134k|         if constexpr (emplace_backable<V> || emplaceable<V>) {
 2661|       |            // Dynamic containers append items (vector-like and set-like)
 2662|   242k|            while (it != end) {
  ------------------
  |  Branch (2662:20): [True: 241k, False: 972]
  ------------------
 2663|   241k|               skip_flow_ws_and_newlines(ctx, it, end);
 2664|   241k|               if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2664:20): [True: 0, False: 241k]
  ------------------
 2665|      0|                  return;
 2666|       |
 2667|   241k|               if (it == end) [[unlikely]] {
  ------------------
  |  Branch (2667:20): [True: 0, False: 241k]
  ------------------
 2668|      0|                  ctx.error = error_code::unexpected_end;
 2669|      0|                  return;
 2670|      0|               }
 2671|       |
 2672|   241k|               if (*it == ']') {
  ------------------
  |  Branch (2672:20): [True: 19.7k, False: 221k]
  ------------------
 2673|  19.7k|                  if (just_saw_comma) {
  ------------------
  |  Branch (2673:23): [True: 19.7k, False: 0]
  ------------------
 2674|  19.7k|                     ++it;
 2675|  19.7k|                     validate_flow_node_adjacent_tail(ctx, it, end);
 2676|  19.7k|                     if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2676:26): [True: 6, False: 19.7k]
  ------------------
 2677|      6|                        return;
 2678|       |                     if constexpr (!yaml::check_flow_context(Opts)) {
 2679|       |                        if (ctx.current_indent() < 0) {
 2680|       |                           validate_root_flow_tail_after_close(ctx, it, end);
 2681|       |                        }
 2682|       |                     }
 2683|  19.7k|                     return;
 2684|  19.7k|                  }
 2685|      0|                  ctx.error = error_code::syntax_error;
 2686|      0|                  return;
 2687|  19.7k|               }
 2688|       |
 2689|   221k|               if (*it == ',' || *it == '#') {
  ------------------
  |  Branch (2689:20): [True: 6, False: 221k]
  |  Branch (2689:34): [True: 22, False: 221k]
  ------------------
 2690|     28|                  ctx.error = error_code::syntax_error;
 2691|     28|                  return;
 2692|     28|               }
 2693|   221k|               just_saw_comma = false;
 2694|       |
 2695|   221k|               value_type element{};
 2696|   221k|               from<YAML, value_type>::template op<flow_context_on<Opts>()>(element, ctx, it, end);
 2697|       |
 2698|   221k|               if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2698:20): [True: 4.58k, False: 216k]
  ------------------
 2699|  4.58k|                  return;
 2700|       |
 2701|   216k|               bool saw_line_break_before_separator = false;
 2702|   216k|               skip_flow_ws_and_newlines(ctx, it, end, &saw_line_break_before_separator);
 2703|   216k|               if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2703:20): [True: 12, False: 216k]
  ------------------
 2704|     12|                  return;
 2705|       |
 2706|   216k|               if (it != end && *it == ':') {
  ------------------
  |  Branch (2706:20): [True: 216k, False: 362]
  |  Branch (2706:33): [True: 29.5k, False: 186k]
  ------------------
 2707|       |                  // In flow sequences, implicit key-value pairs must be on a single line.
 2708|  29.5k|                  if (saw_line_break_before_separator) {
  ------------------
  |  Branch (2708:23): [True: 6, False: 29.5k]
  ------------------
 2709|      6|                     ctx.error = error_code::syntax_error;
 2710|      6|                     return;
 2711|      6|                  }
 2712|  29.5k|                  if constexpr (std::same_as<std::remove_cvref_t<value_type>, glz::generic>) {
 2713|  29.5k|                     glz::generic key_node = std::move(element);
 2714|  29.5k|                     ++it;
 2715|  29.5k|                     skip_inline_ws(it, end);
 2716|       |
 2717|  29.5k|                     glz::generic mapped{};
 2718|  29.5k|                     from<YAML, glz::generic>::template op<flow_context_on<Opts>()>(mapped, ctx, it, end);
 2719|  29.5k|                     if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2719:26): [True: 238, False: 29.3k]
  ------------------
 2720|    238|                        return;
 2721|       |
 2722|  29.3k|                     std::string key;
 2723|  29.3k|                     if (!yaml::materialize_key(key, key_node, ctx)) [[unlikely]]
  ------------------
  |  Branch (2723:26): [True: 4, False: 29.3k]
  ------------------
 2724|      4|                        return;
 2725|       |
 2726|  29.3k|                     glz::generic pair{};
 2727|  29.3k|                     pair[key] = std::move(mapped);
 2728|  29.3k|                     element = std::move(pair);
 2729|       |
 2730|  29.3k|                     skip_flow_ws_and_newlines(ctx, it, end);
 2731|  29.3k|                     if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2731:26): [True: 6, False: 29.3k]
  ------------------
 2732|      6|                        return;
 2733|       |                  }
 2734|       |                  else {
 2735|       |                     ctx.error = error_code::syntax_error;
 2736|       |                     return;
 2737|       |                  }
 2738|  29.5k|               }
 2739|       |
 2740|   216k|               adapter.append(value, std::move(element));
 2741|       |
 2742|   216k|               if (it == end) [[unlikely]] {
  ------------------
  |  Branch (2742:20): [True: 366, False: 216k]
  ------------------
 2743|    366|                  ctx.error = error_code::unexpected_end;
 2744|    366|                  return;
 2745|    366|               }
 2746|       |
 2747|   216k|               if (*it == ']') {
  ------------------
  |  Branch (2747:20): [True: 108k, False: 108k]
  ------------------
 2748|   108k|                  ++it;
 2749|   108k|                  validate_flow_node_adjacent_tail(ctx, it, end);
 2750|   108k|                  if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2750:23): [True: 8, False: 108k]
  ------------------
 2751|      8|                     return;
 2752|       |                  if constexpr (!yaml::check_flow_context(Opts)) {
 2753|       |                     if (ctx.current_indent() < 0) {
 2754|       |                        validate_root_flow_tail_after_close(ctx, it, end);
 2755|       |                     }
 2756|       |                  }
 2757|   108k|                  return;
 2758|   108k|               }
 2759|   108k|               else if (*it == ',') {
  ------------------
  |  Branch (2759:25): [True: 107k, False: 396]
  ------------------
 2760|   107k|                  ++it;
 2761|   107k|                  just_saw_comma = true;
 2762|   107k|                  skip_flow_ws_and_newlines(ctx, it, end);
 2763|   107k|                  if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2763:23): [True: 6, False: 107k]
  ------------------
 2764|      6|                     return;
 2765|   107k|               }
 2766|    396|               else {
 2767|    396|                  ctx.error = error_code::syntax_error;
 2768|    396|                  return;
 2769|    396|               }
 2770|   216k|            }
 2771|       |         }
 2772|       |         else if constexpr (!resizable<V>) {
 2773|       |            // Fixed-size containers (std::array)
 2774|       |            while (it != end && !adapter.fixed_capacity_reached(value)) {
 2775|       |               skip_flow_ws_and_newlines(ctx, it, end);
 2776|       |               if (bool(ctx.error)) [[unlikely]]
 2777|       |                  return;
 2778|       |
 2779|       |               if (it == end) [[unlikely]] {
 2780|       |                  ctx.error = error_code::unexpected_end;
 2781|       |                  return;
 2782|       |               }
 2783|       |
 2784|       |               if (*it == ']') {
 2785|       |                  if (just_saw_comma) {
 2786|       |                     ++it;
 2787|       |                     validate_flow_node_adjacent_tail(ctx, it, end);
 2788|       |                     if (bool(ctx.error)) [[unlikely]]
 2789|       |                        return;
 2790|       |                     if constexpr (!yaml::check_flow_context(Opts)) {
 2791|       |                        if (ctx.current_indent() < 0) {
 2792|       |                           validate_root_flow_tail_after_close(ctx, it, end);
 2793|       |                        }
 2794|       |                     }
 2795|       |                     return;
 2796|       |                  }
 2797|       |                  ctx.error = error_code::syntax_error;
 2798|       |                  return;
 2799|       |               }
 2800|       |
 2801|       |               if (*it == ',' || *it == '#') {
 2802|       |                  ctx.error = error_code::syntax_error;
 2803|       |                  return;
 2804|       |               }
 2805|       |               just_saw_comma = false;
 2806|       |
 2807|       |               from<YAML, value_type>::template op<flow_context_on<Opts>()>(value[adapter.index], ctx, it, end);
 2808|       |
 2809|       |               if (bool(ctx.error)) [[unlikely]]
 2810|       |                  return;
 2811|       |
 2812|       |               adapter.commit_fixed_slot();
 2813|       |               skip_flow_ws_and_newlines(ctx, it, end);
 2814|       |               if (bool(ctx.error)) [[unlikely]]
 2815|       |                  return;
 2816|       |
 2817|       |               if (it == end) [[unlikely]] {
 2818|       |                  ctx.error = error_code::unexpected_end;
 2819|       |                  return;
 2820|       |               }
 2821|       |
 2822|       |               if (*it == ']') {
 2823|       |                  ++it;
 2824|       |                  validate_flow_node_adjacent_tail(ctx, it, end);
 2825|       |                  if (bool(ctx.error)) [[unlikely]]
 2826|       |                     return;
 2827|       |                  if constexpr (!yaml::check_flow_context(Opts)) {
 2828|       |                     if (ctx.current_indent() < 0) {
 2829|       |                        validate_root_flow_tail_after_close(ctx, it, end);
 2830|       |                     }
 2831|       |                  }
 2832|       |                  return;
 2833|       |               }
 2834|       |               else if (*it == ',') {
 2835|       |                  ++it;
 2836|       |                  just_saw_comma = true;
 2837|       |                  skip_flow_ws_and_newlines(ctx, it, end);
 2838|       |                  if (bool(ctx.error)) [[unlikely]]
 2839|       |                     return;
 2840|       |               }
 2841|       |               else {
 2842|       |                  ctx.error = error_code::syntax_error;
 2843|       |                  return;
 2844|       |               }
 2845|       |            }
 2846|       |
 2847|       |            // If we exited because the fixed-size container is full but haven't seen ']',
 2848|       |            // skip to the closing bracket to consume overflow elements.
 2849|       |            int bracket_depth = 1;
 2850|       |            while (it != end && bracket_depth > 0) {
 2851|       |               if (*it == '[') {
 2852|       |                  ++bracket_depth;
 2853|       |               }
 2854|       |               else if (*it == ']') {
 2855|       |                  --bracket_depth;
 2856|       |               }
 2857|       |               ++it;
 2858|       |            }
 2859|       |         }
 2860|       |         else {
 2861|       |            ctx.error = error_code::syntax_error;
 2862|       |            return;
 2863|       |         }
 2864|   134k|      }
_ZN3glz4yaml26clear_sequence_before_readITnDaXtlNS_4optsELj10ELb1ELb0ELb0ELb1ELb0ELb0ELb0ELb0ELj1EEENSt3__16vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS3_9allocatorIS8_EEEEEEvRT0_:
 2580|  1.52M|      {
 2581|  1.52M|         if constexpr (emplace_backable<V> && requires { value.clear(); }) {
 2582|       |            // vector-like: honor the append_arrays option, matching json/read.hpp
 2583|  1.52M|            if constexpr (!check_append_arrays(Opts)) {
 2584|  1.52M|               value.clear();
 2585|  1.52M|            }
 2586|       |         }
 2587|       |         else if constexpr (emplaceable<V> && requires { value.clear(); }) {
 2588|       |            // set-like: json/read.hpp clears unconditionally; append_arrays does not apply
 2589|       |            value.clear();
 2590|       |         }
 2591|  1.52M|      }
_ZZN3glz4yaml19parse_flow_sequenceITnDaXtlNS_4optsELj10ELb1ELb0ELb0ELb1ELb0ELb0ELb0ELb0ELj1EEERNSt3__16vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS3_9allocatorIS8_EEEENS0_12yaml_contextEPKcSF_EEvOT0_RT1_RT2_T3_EN26sequence_container_adapter6appendESC_OS8_:
 2618|   216k|            {
 2619|   216k|               if constexpr (emplace_backable<V>) {
 2620|   216k|                  container.emplace_back(std::move(element));
 2621|       |               }
 2622|       |               else if constexpr (emplaceable<V>) {
 2623|       |                  container.emplace(std::move(element));
 2624|       |               }
 2625|   216k|            }
_ZN3glz4yaml20parse_block_sequenceITnDaXtlNS_4optsELj10ELb1ELb0ELb0ELb1ELb0ELb0ELb0ELb0ELj1EEERNSt3__16vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS3_9allocatorIS8_EEEENS0_12yaml_contextEPKcSF_EEvOT0_RT1_RT2_T3_i:
 3081|  1.36M|      {
 3082|  1.36M|         using V = std::remove_cvref_t<T>;
 3083|  1.36M|         using value_type = typename V::value_type;
 3084|       |
 3085|  1.36M|         struct sequence_container_adapter
 3086|  1.36M|         {
 3087|  1.36M|            size_t index = 0;
 3088|       |
 3089|  1.36M|            inline bool fixed_capacity_reached(const V& container) const noexcept
 3090|  1.36M|            {
 3091|  1.36M|               if constexpr (!resizable<V>) {
 3092|  1.36M|                  return index >= container.size();
 3093|  1.36M|               }
 3094|  1.36M|               else {
 3095|  1.36M|                  (void)container;
 3096|  1.36M|                  return false;
 3097|  1.36M|               }
 3098|  1.36M|            }
 3099|       |
 3100|  1.36M|            inline void commit_fixed_slot() noexcept { ++index; }
 3101|       |
 3102|  1.36M|            inline void append(V& container, value_type&& element) noexcept
 3103|  1.36M|            {
 3104|  1.36M|               if constexpr (emplace_backable<V>) {
 3105|  1.36M|                  container.emplace_back(std::move(element));
 3106|  1.36M|               }
 3107|  1.36M|               else if constexpr (emplaceable<V>) {
 3108|  1.36M|                  container.emplace(std::move(element));
 3109|  1.36M|               }
 3110|  1.36M|            }
 3111|  1.36M|         };
 3112|       |
 3113|       |         // Overwrite (do not append to) any pre-existing contents. A block
 3114|       |         // sequence is only entered once a '-' item is confirmed, so clearing
 3115|       |         // up front correctly (re)assigns the container to the parsed sequence.
 3116|  1.36M|         clear_sequence_before_read<Opts>(value);
 3117|       |
 3118|  1.36M|         sequence_container_adapter adapter{};
 3119|       |
 3120|       |         // Track if this is the first item (for handling whitespace-consumed case)
 3121|  1.36M|         bool first_item = true;
 3122|  1.36M|         bool has_pending_item_anchor = false;
 3123|  1.36M|         std::string pending_item_anchor_name{};
 3124|  1.36M|         int32_t pending_item_anchor_indent = sequence_indent;
 3125|       |
 3126|  3.06M|         while (it != end) {
  ------------------
  |  Branch (3126:17): [True: 2.65M, False: 412k]
  ------------------
 3127|       |            // For fixed-size arrays (e.g. std::array), stop when we've filled all elements.
 3128|       |            // Exclude emplaceable types (e.g. std::set) which are not resizable but grow dynamically.
 3129|       |            if constexpr (!resizable<V> && !emplaceable<V>) {
 3130|       |               if (adapter.fixed_capacity_reached(value)) {
 3131|       |                  return;
 3132|       |               }
 3133|       |            }
 3134|       |
 3135|       |            // Skip blank lines and comments, track indent
 3136|  2.65M|            int32_t line_indent = 0;
 3137|  2.65M|            int32_t dash_col = -1; // actual column of the '-' on the line
 3138|  2.65M|            auto line_start = it;
 3139|       |
 3140|  3.84M|            while (it != end) {
  ------------------
  |  Branch (3140:20): [True: 3.81M, False: 27.5k]
  ------------------
 3141|  3.81M|               if (*it == '#') {
  ------------------
  |  Branch (3141:20): [True: 246k, False: 3.56M]
  ------------------
 3142|   246k|                  skip_comment(it, end);
 3143|   246k|                  skip_newline(it, end);
 3144|   246k|                  line_start = it;
 3145|   246k|                  line_indent = 0;
 3146|   246k|               }
 3147|  3.56M|               else if (*it == '\n' || *it == '\r') {
  ------------------
  |  Branch (3147:25): [True: 381k, False: 3.18M]
  |  Branch (3147:40): [True: 237k, False: 2.95M]
  ------------------
 3148|   619k|                  skip_newline(it, end);
 3149|   619k|                  line_start = it;
 3150|   619k|                  line_indent = 0;
 3151|   619k|               }
 3152|  2.95M|               else if (*it == ' ') {
  ------------------
  |  Branch (3152:25): [True: 950k, False: 2.00M]
  ------------------
 3153|   950k|                  line_start = it;
 3154|   950k|                  line_indent = 0;
 3155|  4.10M|                  while (it != end && *it == ' ') {
  ------------------
  |  Branch (3155:26): [True: 4.10M, False: 4.09k]
  |  Branch (3155:39): [True: 3.15M, False: 946k]
  ------------------
 3156|  3.15M|                     ++line_indent;
 3157|  3.15M|                     ++it;
 3158|  3.15M|                  }
 3159|       |
 3160|   950k|                  bool saw_tab = false;
 3161|   963k|                  while (it != end && (*it == ' ' || *it == '\t')) {
  ------------------
  |  Branch (3161:26): [True: 958k, False: 4.76k]
  |  Branch (3161:40): [True: 7.08k, False: 951k]
  |  Branch (3161:54): [True: 5.84k, False: 945k]
  ------------------
 3162|  12.9k|                     saw_tab = saw_tab || (*it == '\t');
  ------------------
  |  Branch (3162:32): [True: 10.7k, False: 2.14k]
  |  Branch (3162:43): [True: 2.14k, False: 0]
  ------------------
 3163|  12.9k|                     ++it;
 3164|  12.9k|                  }
 3165|       |
 3166|   950k|                  if (it == end || *it == '\n' || *it == '\r' || *it == '#') {
  ------------------
  |  Branch (3166:23): [True: 4.76k, False: 945k]
  |  Branch (3166:36): [True: 26.0k, False: 919k]
  |  Branch (3166:51): [True: 14.2k, False: 905k]
  |  Branch (3166:66): [True: 233k, False: 672k]
  ------------------
 3167|       |                     // Blank or comment line - continue to next line
 3168|   278k|                     if (it != end && *it == '#') {
  ------------------
  |  Branch (3168:26): [True: 273k, False: 4.76k]
  |  Branch (3168:39): [True: 233k, False: 40.2k]
  ------------------
 3169|   233k|                        skip_comment(it, end);
 3170|   233k|                     }
 3171|   278k|                     line_indent = 0;
 3172|   278k|                     continue;
 3173|   278k|                  }
 3174|       |
 3175|   672k|                  if (saw_tab) {
  ------------------
  |  Branch (3175:23): [True: 22, False: 672k]
  ------------------
 3176|     22|                     ctx.error = error_code::syntax_error;
 3177|     22|                     return;
 3178|     22|                  }
 3179|   672k|                  break; // Found content
 3180|   672k|               }
 3181|  2.00M|               else if (*it == '\t') {
  ------------------
  |  Branch (3181:25): [True: 48.4k, False: 1.95M]
  ------------------
 3182|  48.4k|                  line_start = it;
 3183|  99.7k|                  while (it != end && (*it == ' ' || *it == '\t')) ++it;
  ------------------
  |  Branch (3183:26): [True: 98.6k, False: 1.09k]
  |  Branch (3183:40): [True: 2.11k, False: 96.5k]
  |  Branch (3183:54): [True: 49.1k, False: 47.3k]
  ------------------
 3184|  48.4k|                  if (it == end || *it == '\n' || *it == '\r' || *it == '#') {
  ------------------
  |  Branch (3184:23): [True: 1.09k, False: 47.3k]
  |  Branch (3184:36): [True: 410, False: 46.9k]
  |  Branch (3184:51): [True: 35.6k, False: 11.3k]
  |  Branch (3184:66): [True: 11.2k, False: 24]
  ------------------
 3185|  48.4k|                     if (it != end && *it == '#') {
  ------------------
  |  Branch (3185:26): [True: 47.3k, False: 1.09k]
  |  Branch (3185:39): [True: 11.2k, False: 36.0k]
  ------------------
 3186|  11.2k|                        skip_comment(it, end);
 3187|  11.2k|                     }
 3188|  48.4k|                     line_indent = 0;
 3189|  48.4k|                     continue;
 3190|  48.4k|                  }
 3191|     24|                  ctx.error = error_code::syntax_error;
 3192|     24|                  return;
 3193|  48.4k|               }
 3194|  1.95M|               else {
 3195|       |                  // At content (no leading space on this line)
 3196|       |                  // If first item and at '-', whitespace was consumed by caller;
 3197|       |                  // treat as having correct indentation
 3198|  1.95M|                  if (first_item && *it == '-') {
  ------------------
  |  Branch (3198:23): [True: 1.36M, False: 584k]
  |  Branch (3198:37): [True: 1.36M, False: 2.20k]
  ------------------
 3199|  1.36M|                     line_indent = sequence_indent;
 3200|  1.36M|                     if constexpr (std::is_pointer_v<std::decay_t<It>>) {
 3201|  1.36M|                        if (ctx.stream_begin && it > ctx.stream_begin) {
  ------------------
  |  Branch (3201:29): [True: 1.36M, False: 0]
  |  Branch (3201:49): [True: 1.36M, False: 0]
  ------------------
 3202|  1.36M|                           auto probe = it;
 3203|  1.36M|                           int32_t leading_ws = 0;
 3204|  1.36M|                           bool saw_tab = false;
 3205|  2.75M|                           while (probe > ctx.stream_begin && (*(probe - 1) == ' ' || *(probe - 1) == '\t')) {
  ------------------
  |  Branch (3205:35): [True: 2.75M, False: 0]
  |  Branch (3205:64): [True: 1.37M, False: 1.37M]
  |  Branch (3205:87): [True: 14.4k, False: 1.36M]
  ------------------
 3206|  1.38M|                              --probe;
 3207|  1.38M|                              ++leading_ws;
 3208|  1.38M|                              saw_tab = saw_tab || (*probe == '\t');
  ------------------
  |  Branch (3208:41): [True: 5.55k, False: 1.38M]
  |  Branch (3208:52): [True: 10.0k, False: 1.37M]
  ------------------
 3209|  1.38M|                           }
 3210|  1.36M|                           if (probe == ctx.stream_begin || *(probe - 1) == '\n' || *(probe - 1) == '\r') {
  ------------------
  |  Branch (3210:32): [True: 0, False: 1.36M]
  |  Branch (3210:61): [True: 55.3k, False: 1.30M]
  |  Branch (3210:85): [True: 105k, False: 1.20M]
  ------------------
 3211|   160k|                              if (saw_tab) {
  ------------------
  |  Branch (3211:35): [True: 8, False: 160k]
  ------------------
 3212|      8|                                 ctx.error = error_code::syntax_error;
 3213|      8|                                 return;
 3214|      8|                              }
 3215|   160k|                              line_indent = (std::max)(line_indent, leading_ws);
 3216|   160k|                           }
 3217|  1.36M|                        }
 3218|  1.36M|                     }
 3219|  1.36M|                  }
 3220|  1.36M|                  break;
 3221|  1.95M|               }
 3222|  3.81M|            }
 3223|       |
 3224|  2.65M|            if (it == end) break;
  ------------------
  |  Branch (3224:17): [True: 27.5k, False: 2.62M]
  ------------------
 3225|       |
 3226|       |            // Check for document end marker
 3227|  2.62M|            if (at_document_end(it, end)) break;
  ------------------
  |  Branch (3227:17): [True: 3.14k, False: 2.62M]
  ------------------
 3228|       |
 3229|       |            // Check for dedent
 3230|  2.62M|            if (line_indent < sequence_indent) {
  ------------------
  |  Branch (3230:17): [True: 97.4k, False: 2.52M]
  ------------------
 3231|  97.4k|               it = line_start;
 3232|  97.4k|               return;
 3233|  97.4k|            }
 3234|       |
 3235|  2.52M|            if (*it == '&') {
  ------------------
  |  Branch (3235:17): [True: 101k, False: 2.42M]
  ------------------
 3236|       |               // Standalone anchor lines before "- item" are only supported for
 3237|       |               // indentless mapping values. At top-level block sequences these are
 3238|       |               // malformed in yaml-test-suite cases.
 3239|   101k|               if (!ctx.allow_indentless_sequence) {
  ------------------
  |  Branch (3239:20): [True: 18, False: 101k]
  ------------------
 3240|     18|                  ctx.error = error_code::syntax_error;
 3241|     18|                  return;
 3242|     18|               }
 3243|       |
 3244|   101k|               ++it;
 3245|   101k|               auto pending_name = parse_anchor_name(it, end);
 3246|   101k|               if (pending_name.empty()) {
  ------------------
  |  Branch (3246:20): [True: 20, False: 101k]
  ------------------
 3247|     20|                  ctx.error = error_code::syntax_error;
 3248|     20|                  return;
 3249|     20|               }
 3250|   101k|               skip_inline_ws(it, end);
 3251|   101k|               if (it != end && *it == '#') {
  ------------------
  |  Branch (3251:20): [True: 101k, False: 16]
  |  Branch (3251:33): [True: 50.4k, False: 50.7k]
  ------------------
 3252|  50.4k|                  skip_comment(it, end);
 3253|  50.4k|               }
 3254|       |
 3255|   101k|               has_pending_item_anchor = true;
 3256|   101k|               pending_item_anchor_name = std::string(pending_name);
 3257|   101k|               pending_item_anchor_indent = line_indent;
 3258|       |
 3259|   101k|               if (it == end || (*it != '\n' && *it != '\r')) {
  ------------------
  |  Branch (3259:20): [True: 16, False: 101k]
  |  Branch (3259:34): [True: 73.0k, False: 28.1k]
  |  Branch (3259:49): [True: 76, False: 72.9k]
  ------------------
 3260|     92|                  ctx.error = error_code::syntax_error;
 3261|     92|                  return;
 3262|     92|               }
 3263|       |
 3264|   101k|               skip_newline(it, end);
 3265|   101k|               continue;
 3266|   101k|            }
 3267|       |
 3268|       |            // Expect dash for sequence item
 3269|  2.42M|            if (*it != '-') {
  ------------------
  |  Branch (3269:17): [True: 755k, False: 1.66M]
  ------------------
 3270|   755k|               it = line_start;
 3271|   755k|               return;
 3272|   755k|            }
 3273|       |
 3274|       |            // Compute the actual column of this sequence dash.
 3275|       |            // This is needed by plain-scalar multiline folding to distinguish
 3276|       |            // sibling "- item" entries from deeper "- " continuation content.
 3277|  1.66M|            dash_col = line_indent;
 3278|  1.66M|            if constexpr (std::is_pointer_v<std::decay_t<It>>) {
 3279|  1.66M|               if (ctx.stream_begin) {
  ------------------
  |  Branch (3279:20): [True: 1.66M, False: 8]
  ------------------
 3280|  1.66M|                  dash_col = ctx.line_prefix_before(&*it).column;
 3281|  1.66M|               }
 3282|  1.66M|            }
 3283|       |
 3284|  1.66M|            ++it; // Skip '-'
 3285|       |
 3286|       |            // Check for valid sequence item indicator (- followed by space or newline)
 3287|  1.66M|            if (it != end && !yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*it)]) {
  ------------------
  |  Branch (3287:17): [True: 1.64M, False: 20.9k]
  |  Branch (3287:30): [True: 69.7k, False: 1.57M]
  ------------------
 3288|       |               // Not a sequence item (could be a number like -5)
 3289|  69.7k|               it = line_start;
 3290|  69.7k|               return;
 3291|  69.7k|            }
 3292|       |
 3293|  1.59M|            bool saw_tab_after_dash = false;
 3294|  4.25M|            while (it != end && (*it == ' ' || *it == '\t')) {
  ------------------
  |  Branch (3294:20): [True: 4.22M, False: 29.4k]
  |  Branch (3294:34): [True: 2.07M, False: 2.15M]
  |  Branch (3294:48): [True: 585k, False: 1.56M]
  ------------------
 3295|  2.65M|               saw_tab_after_dash = saw_tab_after_dash || (*it == '\t');
  ------------------
  |  Branch (3295:37): [True: 452k, False: 2.20M]
  |  Branch (3295:59): [True: 471k, False: 1.73M]
  ------------------
 3296|  2.65M|               ++it;
 3297|  2.65M|            }
 3298|       |            // A tab-separated nested "- " marker is not valid block indentation.
 3299|  1.59M|            if (saw_tab_after_dash && it != end && *it == '-') {
  ------------------
  |  Branch (3299:17): [True: 471k, False: 1.12M]
  |  Branch (3299:39): [True: 466k, False: 4.98k]
  |  Branch (3299:52): [True: 5.37k, False: 460k]
  ------------------
 3300|  5.37k|               const auto after_dash = it + 1;
 3301|  5.37k|               if (after_dash == end || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*after_dash)]) {
  ------------------
  |  Branch (3301:20): [True: 6, False: 5.36k]
  |  Branch (3301:41): [True: 6, False: 5.36k]
  ------------------
 3302|     12|                  ctx.error = error_code::syntax_error;
 3303|     12|                  return;
 3304|     12|               }
 3305|  5.37k|            }
 3306|       |
 3307|       |            // Get reference to element to parse into
 3308|  1.59M|            auto parse_element = [&](auto& element) {
 3309|  1.59M|               const char* element_start = (it != end) ? &*it : nullptr;
 3310|       |
 3311|       |               // Check what follows
 3312|  1.59M|               if (it != end && !yaml::line_end_or_comment_table[static_cast<uint8_t>(*it)]) {
 3313|       |                  // Content on same line as dash - set indent to one less than content column
 3314|       |                  // This allows nested block mappings to continue parsing keys at the content indent
 3315|       |                  // For "- key: val", if dash is at column 0, content is at column 2
 3316|       |                  // We set parent indent to 1 so keys at column 2 pass the "indent > parent" check
 3317|  1.59M|                  if (!ctx.push_indent(line_indent + 1)) [[unlikely]]
 3318|  1.59M|                     return;
 3319|  1.59M|                  const bool prev_sequence_item_value_context = ctx.sequence_item_value_context;
 3320|  1.59M|                  const int32_t prev_sequence_dash_indent = ctx.sequence_dash_indent;
 3321|  1.59M|                  ctx.sequence_item_value_context = true;
 3322|  1.59M|                  ctx.sequence_dash_indent = dash_col;
 3323|  1.59M|                  from<YAML, value_type>::template op<Opts>(element, ctx, it, end);
 3324|  1.59M|                  ctx.sequence_dash_indent = prev_sequence_dash_indent;
 3325|  1.59M|                  ctx.sequence_item_value_context = prev_sequence_item_value_context;
 3326|  1.59M|                  ctx.pop_indent();
 3327|  1.59M|               }
 3328|  1.59M|               else {
 3329|       |                  // Value on next line - nested block
 3330|  1.59M|                  skip_ws_and_comment(it, end);
 3331|  1.59M|                  skip_newline(it, end);
 3332|       |
 3333|       |                  // Get indent of nested content
 3334|  1.59M|                  auto nested_start = it;
 3335|  1.59M|                  int32_t nested_indent = measure_indent(it, end, ctx);
 3336|  1.59M|                  if (bool(ctx.error)) [[unlikely]]
 3337|  1.59M|                     return;
 3338|  1.59M|                  it = nested_start;
 3339|       |
 3340|       |                  // Content is nested only if indented more than the current line.
 3341|       |                  // When line_indent is negative (root level), use 0 as the baseline.
 3342|       |                  // This prevents content at column 0 from being treated as nested.
 3343|  1.59M|                  const int32_t effective_line_indent = (line_indent < 0) ? 0 : line_indent;
 3344|  1.59M|                  if (nested_indent > effective_line_indent) {
 3345|       |                     // Save and set indent for nested parsing.
 3346|       |                     // A struct element reads the pushed indent as its own key column; every
 3347|       |                     // other element type reads it as the enclosing baseline, so it gets one
 3348|       |                     // less than the content indent and its content passes "indent > parent".
 3349|  1.59M|                     const int32_t element_indent =
 3350|  1.59M|                        receives_block_mapping_column<value_type>() ? nested_indent : nested_indent - 1;
 3351|  1.59M|                     if (!ctx.push_indent(element_indent)) [[unlikely]]
 3352|  1.59M|                        return;
 3353|  1.59M|                     const bool prev_sequence_item_value_context = ctx.sequence_item_value_context;
 3354|  1.59M|                     const int32_t prev_sequence_dash_indent = ctx.sequence_dash_indent;
 3355|  1.59M|                     ctx.sequence_item_value_context = true;
 3356|  1.59M|                     ctx.sequence_dash_indent = dash_col;
 3357|  1.59M|                     from<YAML, value_type>::template op<Opts>(element, ctx, it, end);
 3358|  1.59M|                     ctx.sequence_dash_indent = prev_sequence_dash_indent;
 3359|  1.59M|                     ctx.sequence_item_value_context = prev_sequence_item_value_context;
 3360|  1.59M|                     ctx.pop_indent();
 3361|  1.59M|                  }
 3362|       |                  // else: empty element (default constructed)
 3363|  1.59M|               }
 3364|       |
 3365|  1.59M|               if (has_pending_item_anchor && !bool(ctx.error)) {
 3366|  1.59M|                  const char* element_end = (it != end) ? &*it : element_start;
 3367|  1.59M|                  ctx.anchors[std::move(pending_item_anchor_name)] = {element_start, element_end,
 3368|  1.59M|                                                                      pending_item_anchor_indent};
 3369|  1.59M|                  has_pending_item_anchor = false;
 3370|  1.59M|               }
 3371|  1.59M|            };
 3372|       |
 3373|  1.59M|            if constexpr (emplace_backable<V>) {
 3374|  1.59M|               auto& element = value.emplace_back();
 3375|  1.59M|               parse_element(element);
 3376|       |            }
 3377|       |            else if constexpr (emplaceable<V>) {
 3378|       |               value_type element{};
 3379|       |               parse_element(element);
 3380|       |               if (!bool(ctx.error)) {
 3381|       |                  adapter.append(value, std::move(element));
 3382|       |               }
 3383|       |            }
 3384|       |            else if constexpr (!resizable<V>) {
 3385|       |               parse_element(value[adapter.index]);
 3386|       |               adapter.commit_fixed_slot();
 3387|       |            }
 3388|       |            else {
 3389|       |               ctx.error = error_code::syntax_error;
 3390|       |               return;
 3391|       |            }
 3392|       |
 3393|  1.59M|            first_item = false;
 3394|       |
 3395|  1.59M|            if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (3395:17): [True: 862, False: 1.59M]
  ------------------
 3396|    862|               return;
 3397|       |
 3398|       |            // Note: after parsing nested block content, iterator may already be
 3399|       |            // at the start of the next line. The outer loop will handle it.
 3400|  1.59M|         }
 3401|  1.36M|      }
_ZZN3glz4yaml20parse_block_sequenceITnDaXtlNS_4optsELj10ELb1ELb0ELb0ELb1ELb0ELb0ELb0ELb0ELj1EEERNSt3__16vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS3_9allocatorIS8_EEEENS0_12yaml_contextEPKcSF_EEvOT0_RT1_RT2_T3_iENKUlRT_E_clIS8_EEDaSO_:
 3308|  1.59M|            auto parse_element = [&](auto& element) {
 3309|  1.59M|               const char* element_start = (it != end) ? &*it : nullptr;
  ------------------
  |  Branch (3309:44): [True: 1.56M, False: 29.4k]
  ------------------
 3310|       |
 3311|       |               // Check what follows
 3312|  1.59M|               if (it != end && !yaml::line_end_or_comment_table[static_cast<uint8_t>(*it)]) {
  ------------------
  |  Branch (3312:20): [True: 1.56M, False: 29.4k]
  |  Branch (3312:33): [True: 1.17M, False: 390k]
  ------------------
 3313|       |                  // Content on same line as dash - set indent to one less than content column
 3314|       |                  // This allows nested block mappings to continue parsing keys at the content indent
 3315|       |                  // For "- key: val", if dash is at column 0, content is at column 2
 3316|       |                  // We set parent indent to 1 so keys at column 2 pass the "indent > parent" check
 3317|  1.17M|                  if (!ctx.push_indent(line_indent + 1)) [[unlikely]]
  ------------------
  |  Branch (3317:23): [True: 0, False: 1.17M]
  ------------------
 3318|      0|                     return;
 3319|  1.17M|                  const bool prev_sequence_item_value_context = ctx.sequence_item_value_context;
 3320|  1.17M|                  const int32_t prev_sequence_dash_indent = ctx.sequence_dash_indent;
 3321|  1.17M|                  ctx.sequence_item_value_context = true;
 3322|  1.17M|                  ctx.sequence_dash_indent = dash_col;
 3323|  1.17M|                  from<YAML, value_type>::template op<Opts>(element, ctx, it, end);
 3324|  1.17M|                  ctx.sequence_dash_indent = prev_sequence_dash_indent;
 3325|  1.17M|                  ctx.sequence_item_value_context = prev_sequence_item_value_context;
 3326|  1.17M|                  ctx.pop_indent();
 3327|  1.17M|               }
 3328|   420k|               else {
 3329|       |                  // Value on next line - nested block
 3330|   420k|                  skip_ws_and_comment(it, end);
 3331|   420k|                  skip_newline(it, end);
 3332|       |
 3333|       |                  // Get indent of nested content
 3334|   420k|                  auto nested_start = it;
 3335|   420k|                  int32_t nested_indent = measure_indent(it, end, ctx);
 3336|   420k|                  if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (3336:23): [True: 6, False: 420k]
  ------------------
 3337|      6|                     return;
 3338|   420k|                  it = nested_start;
 3339|       |
 3340|       |                  // Content is nested only if indented more than the current line.
 3341|       |                  // When line_indent is negative (root level), use 0 as the baseline.
 3342|       |                  // This prevents content at column 0 from being treated as nested.
 3343|   420k|                  const int32_t effective_line_indent = (line_indent < 0) ? 0 : line_indent;
  ------------------
  |  Branch (3343:57): [True: 38.2k, False: 382k]
  ------------------
 3344|   420k|                  if (nested_indent > effective_line_indent) {
  ------------------
  |  Branch (3344:23): [True: 44.8k, False: 375k]
  ------------------
 3345|       |                     // Save and set indent for nested parsing.
 3346|       |                     // A struct element reads the pushed indent as its own key column; every
 3347|       |                     // other element type reads it as the enclosing baseline, so it gets one
 3348|       |                     // less than the content indent and its content passes "indent > parent".
 3349|  44.8k|                     const int32_t element_indent =
 3350|  44.8k|                        receives_block_mapping_column<value_type>() ? nested_indent : nested_indent - 1;
  ------------------
  |  Branch (3350:25): [Folded, False: 44.8k]
  ------------------
 3351|  44.8k|                     if (!ctx.push_indent(element_indent)) [[unlikely]]
  ------------------
  |  Branch (3351:26): [True: 0, False: 44.8k]
  ------------------
 3352|      0|                        return;
 3353|  44.8k|                     const bool prev_sequence_item_value_context = ctx.sequence_item_value_context;
 3354|  44.8k|                     const int32_t prev_sequence_dash_indent = ctx.sequence_dash_indent;
 3355|  44.8k|                     ctx.sequence_item_value_context = true;
 3356|  44.8k|                     ctx.sequence_dash_indent = dash_col;
 3357|  44.8k|                     from<YAML, value_type>::template op<Opts>(element, ctx, it, end);
 3358|  44.8k|                     ctx.sequence_dash_indent = prev_sequence_dash_indent;
 3359|  44.8k|                     ctx.sequence_item_value_context = prev_sequence_item_value_context;
 3360|  44.8k|                     ctx.pop_indent();
 3361|  44.8k|                  }
 3362|       |                  // else: empty element (default constructed)
 3363|   420k|               }
 3364|       |
 3365|  1.59M|               if (has_pending_item_anchor && !bool(ctx.error)) {
  ------------------
  |  Branch (3365:20): [True: 27.0k, False: 1.56M]
  |  Branch (3365:47): [True: 26.9k, False: 94]
  ------------------
 3366|  26.9k|                  const char* element_end = (it != end) ? &*it : element_start;
  ------------------
  |  Branch (3366:45): [True: 24.1k, False: 2.77k]
  ------------------
 3367|  26.9k|                  ctx.anchors[std::move(pending_item_anchor_name)] = {element_start, element_end,
 3368|  26.9k|                                                                      pending_item_anchor_indent};
 3369|  26.9k|                  has_pending_item_anchor = false;
 3370|  26.9k|               }
 3371|  1.59M|            };
_ZN3glz29parse_block_mapping_or_stringINSt3__17variantIJDndNS1_12basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEbNS1_6vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS6_ISD_EEEENSC_ISD_EEEEETnDaXtlNS_4optsELj10ELb1ELb0ELb0ELb1ELb0ELb0ELb0ELb0ELj1EEERSH_RNS_4yaml12yaml_contextERPKcSO_EEvOT1_OT2_OT3_T4_:
 5423|  2.37M|   {
 5424|  2.37M|      if constexpr (yaml::check_flow_context(Opts)) {
 5425|       |         // In flow context, only treat plain content as an implicit "key: value"
 5426|       |         // when a mapping separator appears before the next top-level flow delimiter.
 5427|  2.37M|         auto could_be_implicit_flow_pair = [&](auto pos) {
 5428|       |            // Bounded by the longest implicit key the spec allows: unbounded, this probe runs
 5429|       |            // once per entry per nesting level over the whole remaining flow collection.
 5430|  2.37M|            const auto stop = yaml::implicit_key_scan_end(pos, end);
 5431|  2.37M|            int depth = 0;
 5432|  2.37M|            while (pos != stop) {
 5433|  2.37M|               const char c = *pos;
 5434|  2.37M|               if (c == '"' || c == '\'') {
 5435|  2.37M|                  const char quote = c;
 5436|  2.37M|                  ++pos;
 5437|  2.37M|                  while (pos != stop && *pos != quote) {
 5438|  2.37M|                     if (*pos == '\\' && quote == '"') {
 5439|  2.37M|                        ++pos;
 5440|  2.37M|                        if (pos != stop) ++pos;
 5441|  2.37M|                     }
 5442|  2.37M|                     else {
 5443|  2.37M|                        ++pos;
 5444|  2.37M|                     }
 5445|  2.37M|                  }
 5446|  2.37M|                  if (pos != stop) ++pos;
 5447|  2.37M|                  continue;
 5448|  2.37M|               }
 5449|  2.37M|               if (c == '[' || c == '{') {
 5450|  2.37M|                  ++depth;
 5451|  2.37M|                  ++pos;
 5452|  2.37M|                  continue;
 5453|  2.37M|               }
 5454|  2.37M|               if (c == ']' || c == '}') {
 5455|  2.37M|                  if (depth == 0) return false;
 5456|  2.37M|                  --depth;
 5457|  2.37M|                  ++pos;
 5458|  2.37M|                  continue;
 5459|  2.37M|               }
 5460|  2.37M|               if (c == ',' && depth == 0) return false;
 5461|  2.37M|               if (c == ':' && depth == 0) {
 5462|  2.37M|                  auto next = pos + 1;
 5463|  2.37M|                  return next == end || *next == ' ' || *next == '\t' || *next == '\n' || *next == '\r';
 5464|  2.37M|               }
 5465|  2.37M|               ++pos;
 5466|  2.37M|            }
 5467|  2.37M|            return false;
 5468|  2.37M|         };
 5469|       |
 5470|  2.37M|         if (could_be_implicit_flow_pair(it) || line_could_be_flow_mapping(it, end)) {
  ------------------
  |  Branch (5470:14): [True: 592k, False: 1.78M]
  |  Branch (5470:49): [True: 44.1k, False: 1.74M]
  ------------------
 5471|   636k|            if (try_parse_block_mapping_into_variant<Variant, Opts>(value, ctx, it, end)) {
  ------------------
  |  Branch (5471:17): [True: 568k, False: 68.2k]
  ------------------
 5472|   568k|               return;
 5473|   568k|            }
 5474|  68.2k|            if (bool(ctx.error)) {
  ------------------
  |  Branch (5474:17): [True: 1.88k, False: 66.3k]
  ------------------
 5475|  1.88k|               return;
 5476|  1.88k|            }
 5477|  68.2k|         }
 5478|       |
 5479|  1.80M|         process_yaml_variant_alternatives<Variant, is_yaml_variant_str>::template op<Opts>(value, ctx, it, end);
 5480|  1.80M|         return;
 5481|  2.37M|      }
 5482|       |
 5483|  2.37M|      if (try_parse_block_mapping_into_variant<Variant, Opts>(value, ctx, it, end)) {
  ------------------
  |  Branch (5483:11): [True: 0, False: 2.37M]
  ------------------
 5484|      0|         return;
 5485|      0|      }
 5486|       |      // If an error was set (e.g., malformed flow collection in value), don't try to parse as string
 5487|  2.37M|      if (bool(ctx.error)) {
  ------------------
  |  Branch (5487:11): [True: 0, False: 2.37M]
  ------------------
 5488|      0|         return;
 5489|      0|      }
 5490|  2.37M|      process_yaml_variant_alternatives<Variant, is_yaml_variant_str>::template op<Opts>(value, ctx, it, end);
 5491|  2.37M|   }
_ZZN3glz29parse_block_mapping_or_stringINSt3__17variantIJDndNS1_12basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEbNS1_6vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS6_ISD_EEEENSC_ISD_EEEEETnDaXtlNS_4optsELj10ELb1ELb0ELb0ELb1ELb0ELb0ELb0ELb0ELj1EEERSH_RNS_4yaml12yaml_contextERPKcSO_EEvOT1_OT2_OT3_T4_ENKUlT_E_clISO_EEDaSX_:
 5427|  2.37M|         auto could_be_implicit_flow_pair = [&](auto pos) {
 5428|       |            // Bounded by the longest implicit key the spec allows: unbounded, this probe runs
 5429|       |            // once per entry per nesting level over the whole remaining flow collection.
 5430|  2.37M|            const auto stop = yaml::implicit_key_scan_end(pos, end);
 5431|  2.37M|            int depth = 0;
 5432|  84.0M|            while (pos != stop) {
  ------------------
  |  Branch (5432:20): [True: 83.3M, False: 649k]
  ------------------
 5433|  83.3M|               const char c = *pos;
 5434|  83.3M|               if (c == '"' || c == '\'') {
  ------------------
  |  Branch (5434:20): [True: 643k, False: 82.7M]
  |  Branch (5434:32): [True: 351k, False: 82.3M]
  ------------------
 5435|   995k|                  const char quote = c;
 5436|   995k|                  ++pos;
 5437|  76.3M|                  while (pos != stop && *pos != quote) {
  ------------------
  |  Branch (5437:26): [True: 76.0M, False: 256k]
  |  Branch (5437:41): [True: 75.3M, False: 739k]
  ------------------
 5438|  75.3M|                     if (*pos == '\\' && quote == '"') {
  ------------------
  |  Branch (5438:26): [True: 386k, False: 74.9M]
  |  Branch (5438:42): [True: 262k, False: 124k]
  ------------------
 5439|   262k|                        ++pos;
 5440|   262k|                        if (pos != stop) ++pos;
  ------------------
  |  Branch (5440:29): [True: 238k, False: 23.6k]
  ------------------
 5441|   262k|                     }
 5442|  75.0M|                     else {
 5443|  75.0M|                        ++pos;
 5444|  75.0M|                     }
 5445|  75.3M|                  }
 5446|   995k|                  if (pos != stop) ++pos;
  ------------------
  |  Branch (5446:23): [True: 739k, False: 256k]
  ------------------
 5447|   995k|                  continue;
 5448|   995k|               }
 5449|  82.3M|               if (c == '[' || c == '{') {
  ------------------
  |  Branch (5449:20): [True: 1.00M, False: 81.3M]
  |  Branch (5449:32): [True: 810k, False: 80.5M]
  ------------------
 5450|  1.81M|                  ++depth;
 5451|  1.81M|                  ++pos;
 5452|  1.81M|                  continue;
 5453|  1.81M|               }
 5454|  80.5M|               if (c == ']' || c == '}') {
  ------------------
  |  Branch (5454:20): [True: 150k, False: 80.4M]
  |  Branch (5454:32): [True: 360k, False: 80.0M]
  ------------------
 5455|   511k|                  if (depth == 0) return false;
  ------------------
  |  Branch (5455:23): [True: 210k, False: 300k]
  ------------------
 5456|   300k|                  --depth;
 5457|   300k|                  ++pos;
 5458|   300k|                  continue;
 5459|   511k|               }
 5460|  80.0M|               if (c == ',' && depth == 0) return false;
  ------------------
  |  Branch (5460:20): [True: 3.59M, False: 76.4M]
  |  Branch (5460:32): [True: 728k, False: 2.86M]
  ------------------
 5461|  79.3M|               if (c == ':' && depth == 0) {
  ------------------
  |  Branch (5461:20): [True: 2.00M, False: 77.3M]
  |  Branch (5461:32): [True: 791k, False: 1.21M]
  ------------------
 5462|   791k|                  auto next = pos + 1;
 5463|   791k|                  return next == end || *next == ' ' || *next == '\t' || *next == '\n' || *next == '\r';
  ------------------
  |  Branch (5463:26): [True: 24.2k, False: 767k]
  |  Branch (5463:41): [True: 369k, False: 397k]
  |  Branch (5463:57): [True: 35.9k, False: 361k]
  |  Branch (5463:74): [True: 54.8k, False: 306k]
  |  Branch (5463:91): [True: 107k, False: 199k]
  ------------------
 5464|   791k|               }
 5465|  78.5M|               ++pos;
 5466|  78.5M|            }
 5467|   649k|            return false;
 5468|  2.37M|         };
_ZZN3glz4fromILj450ENSt3__17variantIJDndNS1_12basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEbNS1_6vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS6_ISD_EEEENSC_ISD_EEEEEE2opITnDaXtlNS_4optsELj10ELb1ELb0ELb0ELb1ELb0ELb0ELb0ELb0ELj1EEERPKcRSH_TkNS_10is_contextERNS_4yaml12yaml_contextESM_EEvOT1_OT2_OT0_T3_ENKUlT_E0_clISM_EEDaSZ_:
 5848|   200k|            auto is_word_boundary = [&](const auto ptr) {
 5849|   200k|               if (ptr == end) {
  ------------------
  |  Branch (5849:20): [True: 1.98k, False: 198k]
  ------------------
 5850|  1.98k|                  return true;
 5851|  1.98k|               }
 5852|   198k|               if (*ptr == ':') {
  ------------------
  |  Branch (5852:20): [True: 101k, False: 97.3k]
  ------------------
 5853|   101k|                  auto next = ptr + 1;
 5854|   101k|                  return (next == end) || *next == ' ' || *next == '\t' || *next == '\n' || *next == '\r';
  ------------------
  |  Branch (5854:26): [True: 10.8k, False: 90.6k]
  |  Branch (5854:43): [True: 9.73k, False: 80.9k]
  |  Branch (5854:59): [True: 3.60k, False: 77.3k]
  |  Branch (5854:76): [True: 4.47k, False: 72.8k]
  |  Branch (5854:93): [True: 42.8k, False: 30.0k]
  ------------------
 5855|   101k|               }
 5856|  97.3k|               return is_plain_scalar_boundary(*ptr);
 5857|   198k|            };
_ZZN3glz4fromILj450ENSt3__17variantIJDndNS1_12basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEbNS1_6vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS6_ISD_EEEENSC_ISD_EEEEEE2opITnDaXtlNS_4optsELj10ELb1ELb0ELb0ELb1ELb0ELb0ELb0ELb0ELj1EEERPKcRSH_TkNS_10is_contextERNS_4yaml12yaml_contextESM_EEvOT1_OT2_OT0_T3_ENKUlcE_clEc:
 5774|  97.3k|            auto is_plain_scalar_boundary = [](const char ch) {
 5775|  97.3k|               switch (ch) {
 5776|  3.88k|               case ' ':
  ------------------
  |  Branch (5776:16): [True: 3.88k, False: 93.4k]
  ------------------
 5777|  5.97k|               case '\t':
  ------------------
  |  Branch (5777:16): [True: 2.09k, False: 95.2k]
  ------------------
 5778|  22.7k|               case '\n':
  ------------------
  |  Branch (5778:16): [True: 16.7k, False: 80.6k]
  ------------------
 5779|  24.8k|               case '\r':
  ------------------
  |  Branch (5779:16): [True: 2.15k, False: 95.1k]
  ------------------
 5780|  41.7k|               case ',':
  ------------------
  |  Branch (5780:16): [True: 16.9k, False: 80.4k]
  ------------------
 5781|  44.0k|               case ']':
  ------------------
  |  Branch (5781:16): [True: 2.27k, False: 95.0k]
  ------------------
 5782|  69.6k|               case '}':
  ------------------
  |  Branch (5782:16): [True: 25.6k, False: 71.7k]
  ------------------
 5783|  69.6k|                  return true;
 5784|  27.6k|               default:
  ------------------
  |  Branch (5784:16): [True: 27.6k, False: 69.6k]
  ------------------
 5785|  27.6k|                  return false;
 5786|  97.3k|               }
 5787|  97.3k|            };
_ZZN3glz4fromILj450ENSt3__17variantIJDndNS1_12basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEbNS1_6vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS6_ISD_EEEENSC_ISD_EEEEEE2opITnDaXtlNS_4optsELj10ELb1ELb0ELb0ELb1ELb0ELb0ELb0ELb0ELj1EEERPKcRSH_TkNS_10is_contextERNS_4yaml12yaml_contextESM_EEvOT1_OT2_OT0_T3_ENKUlT_E_clISM_EEDaSZ_:
 5789|   143k|            auto has_indented_block_continuation = [&](auto word_end) {
 5790|   143k|               if constexpr (yaml::check_flow_context(Opts)) {
 5791|   143k|                  return false;
 5792|   143k|               }
 5793|   143k|               if (ctx.current_indent() < 0) {
  ------------------
  |  Branch (5793:20): [True: 0, False: 143k]
  ------------------
 5794|      0|                  return false;
 5795|      0|               }
 5796|   143k|               if (word_end == end || (*word_end != '\n' && *word_end != '\r')) {
  ------------------
  |  Branch (5796:20): [True: 143k, False: 0]
  |  Branch (5796:40): [True: 0, False: 0]
  |  Branch (5796:61): [True: 0, False: 0]
  ------------------
 5797|      0|                  return false;
 5798|      0|               }
 5799|       |
 5800|   143k|               auto look = word_end;
 5801|   143k|               yaml::skip_newline(look, end);
 5802|   143k|               while (look != end) {
  ------------------
  |  Branch (5802:23): [True: 0, False: 143k]
  ------------------
 5803|      0|                  int32_t line_indent = 0;
 5804|      0|                  while (look != end && *look == ' ') {
  ------------------
  |  Branch (5804:26): [True: 0, False: 0]
  |  Branch (5804:41): [True: 0, False: 0]
  ------------------
 5805|      0|                     ++line_indent;
 5806|      0|                     ++look;
 5807|      0|                  }
 5808|      0|                  if (look != end && *look == '\t') {
  ------------------
  |  Branch (5808:23): [True: 0, False: 0]
  |  Branch (5808:38): [True: 0, False: 0]
  ------------------
 5809|      0|                     return false;
 5810|      0|                  }
 5811|      0|                  if (look == end || *look == '\n' || *look == '\r') {
  ------------------
  |  Branch (5811:23): [True: 0, False: 0]
  |  Branch (5811:38): [True: 0, False: 0]
  |  Branch (5811:55): [True: 0, False: 0]
  ------------------
 5812|      0|                     if (look != end) {
  ------------------
  |  Branch (5812:26): [True: 0, False: 0]
  ------------------
 5813|      0|                        yaml::skip_newline(look, end);
 5814|      0|                        continue;
 5815|      0|                     }
 5816|      0|                     return false;
 5817|      0|                  }
 5818|      0|                  if (*look == '#') {
  ------------------
  |  Branch (5818:23): [True: 0, False: 0]
  ------------------
 5819|      0|                     yaml::skip_comment(look, end);
 5820|      0|                     if (look != end && (*look == '\n' || *look == '\r')) {
  ------------------
  |  Branch (5820:26): [True: 0, False: 0]
  |  Branch (5820:42): [True: 0, False: 0]
  |  Branch (5820:59): [True: 0, False: 0]
  ------------------
 5821|      0|                        yaml::skip_newline(look, end);
 5822|      0|                        continue;
 5823|      0|                     }
 5824|      0|                     return false;
 5825|      0|                  }
 5826|       |
 5827|       |                  // If the next non-empty line is an implicit mapping entry,
 5828|       |                  // don't treat it as scalar continuation for auto-deduced
 5829|       |                  // booleans/nulls.
 5830|      0|                  {
 5831|      0|                     auto scan = look;
 5832|      0|                     while (scan != end && *scan != '\n' && *scan != '\r') {
  ------------------
  |  Branch (5832:29): [True: 0, False: 0]
  |  Branch (5832:44): [True: 0, False: 0]
  |  Branch (5832:61): [True: 0, False: 0]
  ------------------
 5833|      0|                        if (*scan == ':') {
  ------------------
  |  Branch (5833:29): [True: 0, False: 0]
  ------------------
 5834|      0|                           auto after_colon = scan + 1;
 5835|      0|                           if (after_colon == end || *after_colon == ' ' || *after_colon == '\t' ||
  ------------------
  |  Branch (5835:32): [True: 0, False: 0]
  |  Branch (5835:54): [True: 0, False: 0]
  |  Branch (5835:77): [True: 0, False: 0]
  ------------------
 5836|      0|                               *after_colon == '\n' || *after_colon == '\r') {
  ------------------
  |  Branch (5836:32): [True: 0, False: 0]
  |  Branch (5836:56): [True: 0, False: 0]
  ------------------
 5837|      0|                              return false;
 5838|      0|                           }
 5839|      0|                        }
 5840|      0|                        ++scan;
 5841|      0|                     }
 5842|      0|                  }
 5843|       |
 5844|      0|                  return line_indent > ctx.current_indent();
 5845|      0|               }
 5846|   143k|               return false;
 5847|   143k|            };
_ZN3glz36try_parse_block_mapping_into_variantINSt3__17variantIJDndNS1_12basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEbNS1_6vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS6_ISD_EEEENSC_ISD_EEEEETnDaXtlNS_4optsELj10ELb1ELb0ELb0ELb1ELb0ELb0ELb0ELb0ELj1EEERSH_RNS_4yaml12yaml_contextERPKcSO_EEbOT1_OT2_OT3_T4_:
 5377|  1.41M|   {
 5378|  1.41M|      using counts = yaml_variant_type_count<Variant>;
 5379|       |      if constexpr (counts::n_object == 0) {
 5380|       |         return false;
 5381|       |      }
 5382|  1.41M|      else {
 5383|       |         // Quick check: if no viable mapping separator in the current span,
 5384|       |         // avoid expensive speculative parse.
 5385|  1.41M|         const bool could_be_mapping = [&] {
 5386|  1.41M|            if constexpr (yaml::check_flow_context(Opts)) {
 5387|  1.41M|               return line_could_be_flow_mapping(it, end);
 5388|  1.41M|            }
 5389|  1.41M|            else {
 5390|  1.41M|               return yaml::line_could_be_block_mapping(it, end);
 5391|  1.41M|            }
 5392|  1.41M|         }();
 5393|  1.41M|         if (!could_be_mapping) {
  ------------------
  |  Branch (5393:14): [True: 829k, False: 589k]
  ------------------
 5394|   829k|            return false;
 5395|   829k|         }
 5396|       |         // Full parse attempt - use a temporary context that inherits indent from parent
 5397|   589k|         auto temp_ctx = ctx.make_speculative();
 5398|   589k|         process_yaml_variant_alternatives<Variant, is_yaml_variant_object>::template op<Opts>(value, temp_ctx, it,
 5399|   589k|                                                                                               end);
 5400|   589k|         ctx.alias_expansion_budget = temp_ctx.alias_expansion_budget; // charged even if rejected
 5401|   589k|         ctx.key_expansion_budget = temp_ctx.key_expansion_budget;
 5402|   589k|         if (!bool(temp_ctx.error)) {
  ------------------
  |  Branch (5402:14): [True: 586k, False: 2.87k]
  ------------------
 5403|   586k|            ctx.anchors = std::move(temp_ctx.anchors);
 5404|   586k|            return true;
 5405|   586k|         }
 5406|       |         // The line matched "key: value" pattern but parsing failed.
 5407|       |         // This indicates malformed content (e.g., unclosed flow collection),
 5408|       |         // so propagate the error rather than silently falling back to string.
 5409|  2.87k|         ctx.error = temp_ctx.error;
 5410|  2.87k|         ctx.custom_error_message = temp_ctx.custom_error_message;
 5411|  2.87k|         return false;
 5412|   589k|      }
 5413|  1.41M|   }
_ZZN3glz36try_parse_block_mapping_into_variantINSt3__17variantIJDndNS1_12basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEbNS1_6vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS6_ISD_EEEENSC_ISD_EEEEETnDaXtlNS_4optsELj10ELb1ELb0ELb0ELb1ELb0ELb0ELb0ELb0ELj1EEERSH_RNS_4yaml12yaml_contextERPKcSO_EEbOT1_OT2_OT3_T4_ENKUlvE_clEv:
 5385|  1.41M|         const bool could_be_mapping = [&] {
 5386|  1.41M|            if constexpr (yaml::check_flow_context(Opts)) {
 5387|  1.41M|               return line_could_be_flow_mapping(it, end);
 5388|       |            }
 5389|       |            else {
 5390|       |               return yaml::line_could_be_block_mapping(it, end);
 5391|       |            }
 5392|  1.41M|         }();
_ZN3glz4yaml15materialize_keyILb0ENS0_12yaml_contextEEEbRNSt3__112basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEERNS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEERT0_:
   38|   979k|   {
   39|       |      if constexpr (empty_on_null) {
   40|       |         if (key_node.is_null()) {
   41|       |            key.clear();
   42|       |            return true;
   43|       |         }
   44|       |      }
   45|   979k|      if (auto* s = key_node.template get_if<std::string>()) {
  ------------------
  |  Branch (45:17): [True: 66.1k, False: 912k]
  ------------------
   46|  66.1k|         key = *s;
   47|  66.1k|         return true;
   48|  66.1k|      }
   49|   912k|      key.clear();
   50|   912k|      (void)glz::write_json(key_node, key);
   51|   912k|      if constexpr (requires { ctx.charge_key_expansion(size_t{}); }) {
   52|   912k|         if (!ctx.charge_key_expansion(key.size())) [[unlikely]] {
  ------------------
  |  Branch (52:14): [True: 98, False: 912k]
  ------------------
   53|     98|            ctx.error = error_code::exceeded_max_expansion;
   54|     98|            ctx.custom_error_message = "complex key expansion";
   55|     98|            return false;
   56|     98|         }
   57|   912k|      }
   58|   912k|      return true;
   59|   979k|   }
_ZN3glz4fromILj450ENS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEEE2opITnDaXtlNS_4optsELj10ELb1ELb0ELb0ELb1EEERS4_TkNS_10is_contextERNS_4yaml12yaml_contextERPKcSD_EEvOT0_OT1_OT2_T3_:
  274|  1.91M|      {
  275|  1.91M|         using V = std::decay_t<decltype(get_member(std::declval<Value>(), meta_wrapper_v<T>))>;
  276|  1.91M|         from<YAML, V>::template op<Opts>(get_member(std::forward<Value>(value), meta_wrapper_v<T>),
  277|  1.91M|                                          std::forward<Ctx>(ctx), std::forward<It0>(it), end);
  278|  1.91M|      }
_ZN3glz4fromILj450ENSt3__17variantIJDndNS1_12basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEbNS1_6vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS6_ISD_EEEENSC_ISD_EEEEEE2opITnDaXtlNS_4optsELj10ELb1ELb0ELb0ELb1EEERPKcRSH_TkNS_10is_contextERNS_4yaml12yaml_contextESM_EEvOT1_OT2_OT0_T3_:
 5635|  2.24M|      {
 5636|       |         // Inside op() rather than at class scope: read_supported is `requires { from<Format, T>{}; }`,
 5637|       |         // so a class-scope assert turns that feature probe into a hard error instead of `false`.
 5638|  2.24M|         static_assert(content_v<std::remove_cvref_t<T>>.empty(),
 5639|  2.24M|                       "Adjacent variant tagging (glz::meta `content`) is implemented for JSON and "
 5640|  2.24M|                       "BEVE but not yet for YAML. Reading this variant as YAML would silently expect "
 5641|  2.24M|                       "the internally tagged shape, so it is rejected here instead.");
 5642|  2.24M|         if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (5642:14): [True: 0, False: 2.24M]
  ------------------
 5643|      0|            return;
 5644|       |
 5645|       |         // Every nested generic/variant value routes back through this reader, so bounding
 5646|       |         // depth here caps flow-collection and flow-embedded mapping recursion that the
 5647|       |         // indent stack does not cover.
 5648|  2.24M|         depth_guard guard{ctx, yaml::max_yaml_recursive_depth};
 5649|  2.24M|         if (!guard) [[unlikely]]
  ------------------
  |  Branch (5649:14): [True: 2.77k, False: 2.23M]
  ------------------
 5650|  2.77k|            return;
 5651|       |
 5652|       |         // At root level (indent == -1), skip leading whitespace, newlines, and comments
 5653|       |         // For nested values, only skip inline whitespace to preserve block structure
 5654|  2.23M|         if (ctx.current_indent() < 0) {
  ------------------
  |  Branch (5654:14): [True: 1.26M, False: 969k]
  ------------------
 5655|  1.26M|            yaml::skip_ws_newlines_comments(it, end);
 5656|  1.26M|         }
 5657|   969k|         else {
 5658|   969k|            yaml::skip_inline_ws(it, end);
 5659|   969k|         }
 5660|       |
 5661|  2.23M|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (5661:14): [True: 58, False: 2.23M]
  ------------------
 5662|     58|            ctx.error = error_code::unexpected_end;
 5663|     58|            return;
 5664|     58|         }
 5665|       |
 5666|       |         // Tagged variants: a discriminator key (meta::tag) selects the alternative, with the
 5667|       |         // matching meta::ids entry naming each type. This mirrors the JSON behavior so the
 5668|       |         // same variant definitions round-trip across both formats.
 5669|       |         if constexpr (not tag_v<std::remove_cvref_t<T>>.empty()) {
 5670|       |            using V = std::remove_cvref_t<T>;
 5671|       |            const bool value_is_mapping =
 5672|       |               (*it == '{') || (!yaml::check_flow_context(Opts) && yaml::line_could_be_block_mapping(it, end));
 5673|       |            if (value_is_mapping) {
 5674|       |               // The mapping's keys sit at the column of `it`. Recover that column from the buffer:
 5675|       |               // the indent stack carries the parent context's indent (a struct member, a sequence
 5676|       |               // item, etc. each push a different offset), not this mapping's true column (see helper).
 5677|       |               const int32_t mapping_column = tagged_mapping_visual_indent(ctx, it, ctx.current_indent() + 1);
 5678|       |               auto tag_ctx = ctx.make_speculative();
 5679|       |               const size_t index = scan_variant_tag_index<V, Opts>(tag_ctx, it, end, mapping_column);
 5680|       |               ctx.alias_expansion_budget = tag_ctx.alias_expansion_budget; // charged even if no tag matched
 5681|       |               ctx.key_expansion_budget = tag_ctx.key_expansion_budget;
 5682|       |               if (index < ids_v<V>.size()) {
 5683|       |                  static constexpr auto tag_literal = string_literal_from_view<tag_v<V>.size()>(tag_v<V>);
 5684|       |                  emplace_runtime_variant(value, index);
 5685|       |                  // Establish the mapping's true column on the indent stack for the alternative parse.
 5686|       |                  // The chosen object is then parsed - and the discriminator's inline value skipped -
 5687|       |                  // at a consistent indent in every context, so a tag on the first key does not fold
 5688|       |                  // the following sibling entries into its value (no special-casing needed downstream).
 5689|       |                  if (!ctx.push_indent(mapping_column)) [[unlikely]] {
 5690|       |                     ctx.error = error_code::exceeded_max_recursive_depth;
 5691|       |                     return;
 5692|       |                  }
 5693|       |                  std::visit(
 5694|       |                     [&](auto&& alt) {
 5695|       |                        using Alt = std::remove_cvref_t<decltype(alt)>;
 5696|       |                        if constexpr ((glaze_object_t<Alt> || reflectable<Alt>) && not custom_read<Alt>) {
 5697|       |                           // Parse the mapping into the resolved struct; the tag key is skipped.
 5698|       |                           from<YAML, Alt>::template op<Opts, tag_literal>(alt, ctx, it, end);
 5699|       |                        }
 5700|       |                        else if constexpr (custom_read<Alt>) {
 5701|       |                           // Custom alternatives read the mapping body themselves and cannot skip an
 5702|       |                           // interior tag key the way reflected objects do, so the tag must be the
 5703|       |                           // first key (glaze always writes it first). Consume that leading "tag: id"
 5704|       |                           // entry, then hand the remaining mapping to the custom handler.
 5705|       |                           if constexpr (yaml::check_flow_context(Opts)) {
 5706|       |                              ctx.error = error_code::feature_not_supported;
 5707|       |                              ctx.custom_error_message =
 5708|       |                                 "custom variant alternatives are not supported in YAML flow style";
 5709|       |                           }
 5710|       |                           else {
 5711|       |                              ctx.scratch.clear();
 5712|       |                              if (yaml::parse_yaml_key(ctx.scratch, ctx, it, end, false)) {
 5713|       |                                 if (std::string_view{ctx.scratch} != tag_v<V>) {
 5714|       |                                    ctx.error = error_code::feature_not_supported;
 5715|       |                                    ctx.custom_error_message =
 5716|       |                                       "the tag must be the first key for a custom variant alternative";
 5717|       |                                 }
 5718|       |                                 else {
 5719|       |                                    yaml::skip_inline_ws(it, end);
 5720|       |                                    if (it == end || *it != ':') {
 5721|       |                                       ctx.error = error_code::syntax_error;
 5722|       |                                    }
 5723|       |                                    else {
 5724|       |                                       ++it;
 5725|       |                                       yaml::skip_inline_ws(it, end);
 5726|       |                                       yaml::skip_unknown_block_value<Opts>(ctx, it, end, mapping_column);
 5727|       |                                       if (!bool(ctx.error)) {
 5728|       |                                          // If nothing but trailing whitespace/comments remains, the tag
 5729|       |                                          // was the whole mapping: leave the alternative default.
 5730|       |                                          auto probe = it;
 5731|       |                                          yaml::skip_ws_newlines_comments(probe, end);
 5732|       |                                          if (probe == end) {
 5733|       |                                             it = probe;
 5734|       |                                          }
 5735|       |                                          else {
 5736|       |                                             // Publish the mapping's column so the custom handler's block
 5737|       |                                             // mapping (which would otherwise discover its own indent) reads
 5738|       |                                             // the remaining entries at the variant's indent and dedents
 5739|       |                                             // correctly in every context (root, sequence, nested).
 5740|       |                                             ctx.forced_block_mapping_indent = mapping_column;
 5741|       |                                             from<YAML, Alt>::template op<Opts>(alt, ctx, it, end);
 5742|       |                                             ctx.forced_block_mapping_indent = -1;
 5743|       |                                          }
 5744|       |                                       }
 5745|       |                                    }
 5746|       |                                 }
 5747|       |                              }
 5748|       |                           }
 5749|       |                        }
 5750|       |                        else {
 5751|       |                           // Non-object alternative (e.g. std::monostate): the emplaced default is
 5752|       |                           // the value, but the mapping must still be consumed.
 5753|       |                           walk_tagged_mapping<Opts>(
 5754|       |                              ctx, it, end, tag_v<V>, mapping_column,
 5755|       |                              [&](auto&& c, auto&& i, auto&& e, int32_t line_indent, bool in_flow) {
 5756|       |                                 yaml::skip_yaml_value<Opts>(c, i, e, in_flow ? 0 : line_indent, in_flow);
 5757|       |                              });
 5758|       |                        }
 5759|       |                     },
 5760|       |                     value);
 5761|       |                  ctx.pop_indent();
 5762|       |                  return;
 5763|       |               }
 5764|       |               // No resolvable tag key was found. Fall through to structural deduction:
 5765|       |               // if the alternatives are distinguishable by their fields this still succeeds,
 5766|       |               // otherwise the deduction path reports no_matching_variant_type.
 5767|       |            }
 5768|       |         }
 5769|       |
 5770|  2.23M|         if constexpr (yaml_variant_is_auto_deducible<std::remove_cvref_t<T>>()) {
 5771|  2.23M|            using V = std::remove_cvref_t<T>;
 5772|  2.23M|            using counts = yaml_variant_type_count<V>;
 5773|  2.23M|            const char c = *it;
 5774|  2.23M|            auto is_plain_scalar_boundary = [](const char ch) {
 5775|  2.23M|               switch (ch) {
 5776|  2.23M|               case ' ':
 5777|  2.23M|               case '\t':
 5778|  2.23M|               case '\n':
 5779|  2.23M|               case '\r':
 5780|  2.23M|               case ',':
 5781|  2.23M|               case ']':
 5782|  2.23M|               case '}':
 5783|  2.23M|                  return true;
 5784|  2.23M|               default:
 5785|  2.23M|                  return false;
 5786|  2.23M|               }
 5787|  2.23M|            };
 5788|       |
 5789|  2.23M|            auto has_indented_block_continuation = [&](auto word_end) {
 5790|  2.23M|               if constexpr (yaml::check_flow_context(Opts)) {
 5791|  2.23M|                  return false;
 5792|  2.23M|               }
 5793|  2.23M|               if (ctx.current_indent() < 0) {
 5794|  2.23M|                  return false;
 5795|  2.23M|               }
 5796|  2.23M|               if (word_end == end || (*word_end != '\n' && *word_end != '\r')) {
 5797|  2.23M|                  return false;
 5798|  2.23M|               }
 5799|       |
 5800|  2.23M|               auto look = word_end;
 5801|  2.23M|               yaml::skip_newline(look, end);
 5802|  2.23M|               while (look != end) {
 5803|  2.23M|                  int32_t line_indent = 0;
 5804|  2.23M|                  while (look != end && *look == ' ') {
 5805|  2.23M|                     ++line_indent;
 5806|  2.23M|                     ++look;
 5807|  2.23M|                  }
 5808|  2.23M|                  if (look != end && *look == '\t') {
 5809|  2.23M|                     return false;
 5810|  2.23M|                  }
 5811|  2.23M|                  if (look == end || *look == '\n' || *look == '\r') {
 5812|  2.23M|                     if (look != end) {
 5813|  2.23M|                        yaml::skip_newline(look, end);
 5814|  2.23M|                        continue;
 5815|  2.23M|                     }
 5816|  2.23M|                     return false;
 5817|  2.23M|                  }
 5818|  2.23M|                  if (*look == '#') {
 5819|  2.23M|                     yaml::skip_comment(look, end);
 5820|  2.23M|                     if (look != end && (*look == '\n' || *look == '\r')) {
 5821|  2.23M|                        yaml::skip_newline(look, end);
 5822|  2.23M|                        continue;
 5823|  2.23M|                     }
 5824|  2.23M|                     return false;
 5825|  2.23M|                  }
 5826|       |
 5827|       |                  // If the next non-empty line is an implicit mapping entry,
 5828|       |                  // don't treat it as scalar continuation for auto-deduced
 5829|       |                  // booleans/nulls.
 5830|  2.23M|                  {
 5831|  2.23M|                     auto scan = look;
 5832|  2.23M|                     while (scan != end && *scan != '\n' && *scan != '\r') {
 5833|  2.23M|                        if (*scan == ':') {
 5834|  2.23M|                           auto after_colon = scan + 1;
 5835|  2.23M|                           if (after_colon == end || *after_colon == ' ' || *after_colon == '\t' ||
 5836|  2.23M|                               *after_colon == '\n' || *after_colon == '\r') {
 5837|  2.23M|                              return false;
 5838|  2.23M|                           }
 5839|  2.23M|                        }
 5840|  2.23M|                        ++scan;
 5841|  2.23M|                     }
 5842|  2.23M|                  }
 5843|       |
 5844|  2.23M|                  return line_indent > ctx.current_indent();
 5845|  2.23M|               }
 5846|  2.23M|               return false;
 5847|  2.23M|            };
 5848|  2.23M|            auto is_word_boundary = [&](const auto ptr) {
 5849|  2.23M|               if (ptr == end) {
 5850|  2.23M|                  return true;
 5851|  2.23M|               }
 5852|  2.23M|               if (*ptr == ':') {
 5853|  2.23M|                  auto next = ptr + 1;
 5854|  2.23M|                  return (next == end) || *next == ' ' || *next == '\t' || *next == '\n' || *next == '\r';
 5855|  2.23M|               }
 5856|  2.23M|               return is_plain_scalar_boundary(*ptr);
 5857|  2.23M|            };
 5858|       |
 5859|  2.23M|            switch (c) {
 5860|   400k|            case '&': {
  ------------------
  |  Branch (5860:13): [True: 400k, False: 1.83M]
  ------------------
 5861|       |               // Anchor before value: parse name, then re-dispatch
 5862|   400k|               ++it;
 5863|   400k|               auto aname = yaml::parse_anchor_name(it, end);
 5864|   400k|               if (aname.empty()) {
  ------------------
  |  Branch (5864:20): [True: 40, False: 400k]
  ------------------
 5865|     40|                  ctx.error = error_code::syntax_error;
 5866|     40|                  return;
 5867|     40|               }
 5868|   400k|               yaml::skip_inline_ws(it, end);
 5869|   400k|               bool anchor_on_same_line = true;
 5870|   400k|               bool value_is_indentless_sequence = false;
 5871|   400k|               if (it == end || *it == '\n' || *it == '\r' || *it == '#') {
  ------------------
  |  Branch (5871:20): [True: 9.16k, False: 390k]
  |  Branch (5871:33): [True: 56.8k, False: 334k]
  |  Branch (5871:48): [True: 61.9k, False: 272k]
  |  Branch (5871:63): [True: 16.0k, False: 256k]
  ------------------
 5872|       |                  // Anchor followed by end-of-line. Check if the value continues on the
 5873|       |                  // next line (indented past current context) or if this is an empty node.
 5874|   144k|                  bool value_on_next_line = false;
 5875|   144k|                  if (it != end) {
  ------------------
  |  Branch (5875:23): [True: 134k, False: 9.16k]
  ------------------
 5876|   134k|                     auto peek = it;
 5877|       |                     // Skip comment if present
 5878|   134k|                     if (*peek == '#') {
  ------------------
  |  Branch (5878:26): [True: 16.0k, False: 118k]
  ------------------
 5879|   325k|                        while (peek != end && *peek != '\n' && *peek != '\r') ++peek;
  ------------------
  |  Branch (5879:32): [True: 324k, False: 586]
  |  Branch (5879:47): [True: 315k, False: 8.98k]
  |  Branch (5879:64): [True: 309k, False: 6.48k]
  ------------------
 5880|  16.0k|                     }
 5881|       |                     // Skip newline
 5882|   134k|                     if (peek != end && (*peek == '\n' || *peek == '\r')) {
  ------------------
  |  Branch (5882:26): [True: 134k, False: 586]
  |  Branch (5882:42): [True: 65.8k, False: 68.4k]
  |  Branch (5882:59): [True: 68.4k, False: 0]
  ------------------
 5883|   134k|                        yaml::skip_newline(peek, end);
 5884|       |                        // Skip blank lines
 5885|   204k|                        while (peek != end && (*peek == '\n' || *peek == '\r')) {
  ------------------
  |  Branch (5885:32): [True: 202k, False: 2.86k]
  |  Branch (5885:48): [True: 37.5k, False: 164k]
  |  Branch (5885:65): [True: 33.0k, False: 131k]
  ------------------
 5886|  70.6k|                           yaml::skip_newline(peek, end);
 5887|  70.6k|                        }
 5888|       |                        // Measure indent of next content line
 5889|   134k|                        int32_t next_indent = 0;
 5890|   239k|                        while (peek != end && *peek == ' ') {
  ------------------
  |  Branch (5890:32): [True: 236k, False: 3.46k]
  |  Branch (5890:47): [True: 105k, False: 130k]
  ------------------
 5891|   105k|                           ++next_indent;
 5892|   105k|                           ++peek;
 5893|   105k|                        }
 5894|   134k|                        if (peek != end && *peek != '\n' && *peek != '\r') {
  ------------------
  |  Branch (5894:29): [True: 130k, False: 3.46k]
  |  Branch (5894:44): [True: 127k, False: 2.93k]
  |  Branch (5894:61): [True: 126k, False: 1.22k]
  ------------------
 5895|   126k|                           const bool indentless_sequence =
 5896|   126k|                              (!ctx.sequence_item_value_context) && (*peek == '-') &&
  ------------------
  |  Branch (5896:31): [True: 117k, False: 9.39k]
  |  Branch (5896:69): [True: 22.0k, False: 95.2k]
  ------------------
 5897|  22.0k|                              ((peek + 1) == end ||
  ------------------
  |  Branch (5897:32): [True: 1.92k, False: 20.0k]
  ------------------
 5898|  20.0k|                               yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*(peek + 1))]) &&
  ------------------
  |  Branch (5898:32): [True: 18.5k, False: 1.48k]
  ------------------
 5899|  20.5k|                              (next_indent == ctx.current_indent() ||
  ------------------
  |  Branch (5899:32): [True: 2.10k, False: 18.4k]
  ------------------
 5900|  18.4k|                               (ctx.current_indent() > 0 && (next_indent + 1) == ctx.current_indent()));
  ------------------
  |  Branch (5900:33): [True: 7.49k, False: 10.9k]
  |  Branch (5900:61): [True: 7.11k, False: 380]
  ------------------
 5901|   126k|                           value_is_indentless_sequence = indentless_sequence;
 5902|   126k|                           const bool same_indent_property_node =
 5903|   126k|                              (next_indent == ctx.current_indent()) &&
  ------------------
  |  Branch (5903:31): [True: 21.4k, False: 105k]
  ------------------
 5904|  21.4k|                              (*peek == '!' || *peek == '&' || *peek == '*' || *peek == '[' || *peek == '{' ||
  ------------------
  |  Branch (5904:32): [True: 1.74k, False: 19.6k]
  |  Branch (5904:48): [True: 1.20k, False: 18.4k]
  |  Branch (5904:64): [True: 80, False: 18.4k]
  |  Branch (5904:80): [True: 512, False: 17.8k]
  |  Branch (5904:96): [True: 1.52k, False: 16.3k]
  ------------------
 5905|  16.3k|                               *peek == '"' || *peek == '\'' || *peek == '|' || *peek == '>');
  ------------------
  |  Branch (5905:32): [True: 278, False: 16.0k]
  |  Branch (5905:48): [True: 478, False: 15.6k]
  |  Branch (5905:65): [True: 280, False: 15.3k]
  |  Branch (5905:81): [True: 70, False: 15.2k]
  ------------------
 5906|   126k|                           value_on_next_line =
 5907|   126k|                              (next_indent > ctx.current_indent()) || indentless_sequence || same_indent_property_node;
  ------------------
  |  Branch (5907:31): [True: 92.8k, False: 33.8k]
  |  Branch (5907:71): [True: 9.21k, False: 24.6k]
  |  Branch (5907:94): [True: 6.18k, False: 18.4k]
  ------------------
 5908|   126k|                        }
 5909|   134k|                     }
 5910|   134k|                  }
 5911|   144k|                  if (!value_on_next_line) {
  ------------------
  |  Branch (5911:23): [True: 35.8k, False: 108k]
  ------------------
 5912|       |                     // Anchor on empty/null node — store empty span, leave value as default
 5913|  35.8k|                     ctx.anchors[std::string(aname)] = {&*it, &*it, ctx.current_indent()};
 5914|  35.8k|                     return;
 5915|  35.8k|                  }
 5916|       |                  // Value is on next line — advance past newline/blank lines to the content
 5917|   108k|                  if (*it == '#') {
  ------------------
  |  Branch (5917:23): [True: 12.9k, False: 95.2k]
  ------------------
 5918|   217k|                     while (it != end && *it != '\n' && *it != '\r') ++it;
  ------------------
  |  Branch (5918:29): [True: 217k, False: 0]
  |  Branch (5918:42): [True: 210k, False: 7.25k]
  |  Branch (5918:57): [True: 204k, False: 5.66k]
  ------------------
 5919|  12.9k|                  }
 5920|   108k|                  if (it != end) yaml::skip_newline(it, end);
  ------------------
  |  Branch (5920:23): [True: 108k, False: 0]
  ------------------
 5921|   171k|                  while (it != end && (*it == '\n' || *it == '\r')) {
  ------------------
  |  Branch (5921:26): [True: 171k, False: 0]
  |  Branch (5921:40): [True: 35.6k, False: 136k]
  |  Branch (5921:55): [True: 28.0k, False: 108k]
  ------------------
 5922|  63.7k|                     yaml::skip_newline(it, end);
 5923|  63.7k|                  }
 5924|   108k|                  yaml::skip_inline_ws(it, end);
 5925|   108k|                  anchor_on_same_line = false;
 5926|   108k|               }
 5927|       |
 5928|   364k|               if constexpr (!yaml::check_flow_context(Opts)) {
 5929|   364k|                  if (anchor_on_same_line && *it == '-' &&
  ------------------
  |  Branch (5929:23): [True: 256k, False: 108k]
  |  Branch (5929:46): [True: 6.52k, False: 249k]
  ------------------
 5930|  6.52k|                      ((it + 1) == end || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*(it + 1))])) {
  ------------------
  |  Branch (5930:24): [True: 6, False: 6.51k]
  |  Branch (5930:43): [True: 6, False: 6.50k]
  ------------------
 5931|       |                     // "&anchor - item" is malformed in block context.
 5932|     12|                     ctx.error = error_code::syntax_error;
 5933|     12|                     return;
 5934|     12|                  }
 5935|   364k|               }
 5936|       |
 5937|       |               // Anchor on alias (&anchor *alias) is invalid per YAML spec.
 5938|       |               // But alias-as-key (&anchor *alias : value) is valid.
 5939|   364k|               if (it != end && *it == '*' && !yaml::alias_token_is_mapping_key(it, end)) {
  ------------------
  |  Branch (5939:20): [True: 364k, False: 24]
  |  Branch (5939:33): [True: 1.73k, False: 362k]
  |  Branch (5939:47): [True: 22, False: 1.71k]
  ------------------
 5940|     22|                  ctx.error = error_code::syntax_error;
 5941|     22|                  return;
 5942|     22|               }
 5943|       |
 5944|   364k|               if constexpr (!yaml::check_flow_context(Opts)) {
 5945|   364k|                  if (!anchor_on_same_line && it != end && *it == '&') {
  ------------------
  |  Branch (5945:23): [True: 108k, False: 256k]
  |  Branch (5945:47): [True: 108k, False: 12]
  |  Branch (5945:60): [True: 3.48k, False: 104k]
  ------------------
 5946|  3.48k|                     auto probe = it + 1;
 5947|  3.48k|                     auto nested_anchor_name = yaml::parse_anchor_name(probe, end);
 5948|  3.48k|                     if (nested_anchor_name.empty()) {
  ------------------
  |  Branch (5948:26): [True: 10, False: 3.47k]
  ------------------
 5949|     10|                        ctx.error = error_code::syntax_error;
 5950|     10|                        return;
 5951|     10|                     }
 5952|  3.47k|                     yaml::skip_inline_ws(probe, end);
 5953|       |                     // Allow nested anchor usage only when it clearly starts a
 5954|       |                     // nested mapping entry ("&k key: value"). Otherwise this is
 5955|       |                     // a second anchor on the same node (4JVG-style), which is invalid.
 5956|  3.47k|                     if (!yaml::line_could_be_block_mapping(probe, end)) {
  ------------------
  |  Branch (5956:26): [True: 52, False: 3.42k]
  ------------------
 5957|     52|                        ctx.error = error_code::syntax_error;
 5958|     52|                        return;
 5959|     52|                     }
 5960|  3.47k|                  }
 5961|   364k|               }
 5962|       |
 5963|   364k|               const char* anchor_start = &*it;
 5964|   364k|               const int32_t anchor_indent = ctx.current_indent();
 5965|       |
 5966|   364k|               if constexpr (!yaml::check_flow_context(Opts)) {
 5967|       |                  // Check if the anchor is on a block-mapping key (&name key: value).
 5968|       |                  // Only when the anchor and key are on the SAME line — if the value was on the
 5969|       |                  // next line, the anchor applies to the entire next-line content.
 5970|   364k|                  if (anchor_on_same_line && yaml::line_could_be_block_mapping(it, end)) {
  ------------------
  |  Branch (5970:23): [True: 256k, False: 108k]
  |  Branch (5970:46): [True: 58.5k, False: 197k]
  ------------------
 5971|  58.5k|                     auto key_start = it;
 5972|  58.5k|                     if (*key_start == '!') {
  ------------------
  |  Branch (5972:26): [True: 2.36k, False: 56.2k]
  ------------------
 5973|  2.36k|                        const auto key_tag = yaml::parse_yaml_tag(key_start, end, ctx);
 5974|  2.36k|                        if (key_tag == yaml::yaml_tag::unknown || !yaml::tag_valid_for_string(key_tag)) {
  ------------------
  |  Branch (5974:29): [True: 6, False: 2.35k]
  |  Branch (5974:67): [True: 6, False: 2.34k]
  ------------------
 5975|     12|                           ctx.error = error_code::syntax_error;
 5976|     12|                           return;
 5977|     12|                        }
 5978|  2.34k|                        yaml::skip_inline_ws(key_start, end);
 5979|  2.34k|                        if (key_start == end) {
  ------------------
  |  Branch (5979:29): [True: 6, False: 2.34k]
  ------------------
 5980|      6|                           ctx.error = error_code::unexpected_end;
 5981|      6|                           return;
 5982|      6|                        }
 5983|  2.34k|                        if (*key_start == '\n' || *key_start == '\r') {
  ------------------
  |  Branch (5983:29): [True: 6, False: 2.33k]
  |  Branch (5983:51): [True: 6, False: 2.33k]
  ------------------
 5984|     12|                           ctx.error = error_code::syntax_error;
 5985|     12|                           return;
 5986|     12|                        }
 5987|       |
 5988|       |                        // Re-apply the anchor-on-alias rule now that the tag is consumed. The
 5989|       |                        // check above ran before the tag, so "&anchor !tag *alias" reached the
 5990|       |                        // key-span registration below while the untagged spelling was rejected;
 5991|       |                        // an alias node carries no other properties either way.
 5992|  2.33k|                        if (*key_start == '*' && !yaml::alias_token_is_mapping_key(key_start, end)) {
  ------------------
  |  Branch (5992:29): [True: 832, False: 1.49k]
  |  Branch (5992:50): [True: 6, False: 826]
  ------------------
 5993|      6|                           ctx.error = error_code::syntax_error;
 5994|      6|                           return;
 5995|      6|                        }
 5996|  2.33k|                     }
 5997|       |
 5998|       |                     // Find the key span by scanning to the key-value separator
 5999|  58.5k|                     auto key_scan = key_start;
 6000|  58.5k|                     auto key_end = key_start;
 6001|  58.5k|                     if (*key_scan == '"' || *key_scan == '\'') {
  ------------------
  |  Branch (6001:26): [True: 122, False: 58.4k]
  |  Branch (6001:46): [True: 268, False: 58.1k]
  ------------------
 6002|       |                        // Quoted key: skip to closing quote
 6003|    390|                        const char quote = *key_scan;
 6004|    390|                        ++key_scan;
 6005|  8.68k|                        while (key_scan != end && *key_scan != quote) {
  ------------------
  |  Branch (6005:32): [True: 8.68k, False: 0]
  |  Branch (6005:51): [True: 8.29k, False: 390]
  ------------------
 6006|  8.29k|                           if (*key_scan == '\\' && quote == '"') {
  ------------------
  |  Branch (6006:32): [True: 288, False: 8.00k]
  |  Branch (6006:53): [True: 226, False: 62]
  ------------------
 6007|    226|                              ++key_scan;
 6008|    226|                              if (key_scan != end) ++key_scan;
  ------------------
  |  Branch (6008:35): [True: 226, False: 0]
  ------------------
 6009|    226|                           }
 6010|  8.07k|                           else {
 6011|  8.07k|                              ++key_scan;
 6012|  8.07k|                           }
 6013|  8.29k|                        }
 6014|    390|                        if (key_scan == end) {
  ------------------
  |  Branch (6014:29): [True: 0, False: 390]
  ------------------
 6015|      0|                           ctx.error = error_code::syntax_error;
 6016|      0|                           return;
 6017|      0|                        }
 6018|    390|                        ++key_scan; // past closing quote
 6019|    390|                        key_end = key_scan;
 6020|    390|                        yaml::skip_inline_ws(key_scan, end);
 6021|    390|                     }
 6022|  58.1k|                     else {
 6023|       |                        // Plain key: scan to ':'
 6024|   827k|                        while (key_scan != end) {
  ------------------
  |  Branch (6024:32): [True: 827k, False: 6]
  ------------------
 6025|   827k|                           if (*key_scan == ':') {
  ------------------
  |  Branch (6025:32): [True: 85.9k, False: 741k]
  ------------------
 6026|  85.9k|                              auto next = key_scan + 1;
 6027|  85.9k|                              if (next == end || *next == ' ' || *next == '\t' || *next == '\n' || *next == '\r') {
  ------------------
  |  Branch (6027:35): [True: 5.52k, False: 80.4k]
  |  Branch (6027:50): [True: 26.8k, False: 53.6k]
  |  Branch (6027:66): [True: 3.67k, False: 49.9k]
  |  Branch (6027:83): [True: 4.71k, False: 45.2k]
  |  Branch (6027:100): [True: 17.4k, False: 27.8k]
  ------------------
 6028|  58.1k|                                 break;
 6029|  58.1k|                              }
 6030|  85.9k|                           }
 6031|   769k|                           ++key_scan;
 6032|   769k|                        }
 6033|  58.1k|                        key_end = key_scan;
 6034|  67.5k|                        while (key_end != key_start && (*(key_end - 1) == ' ' || *(key_end - 1) == '\t')) {
  ------------------
  |  Branch (6034:32): [True: 61.4k, False: 6.06k]
  |  Branch (6034:57): [True: 8.08k, False: 53.3k]
  |  Branch (6034:82): [True: 1.29k, False: 52.0k]
  ------------------
 6035|  9.38k|                           --key_end;
 6036|  9.38k|                        }
 6037|  58.1k|                     }
 6038|  58.5k|                     if (key_scan == end || *key_scan != ':') {
  ------------------
  |  Branch (6038:26): [True: 6, False: 58.5k]
  |  Branch (6038:45): [True: 40, False: 58.4k]
  ------------------
 6039|     46|                        ctx.error = error_code::syntax_error;
 6040|     46|                        return;
 6041|     46|                     }
 6042|       |                     // Store anchor with just the key text span
 6043|  58.4k|                     ctx.anchors[std::string(aname)] = {&*key_start, &*key_end, anchor_indent};
 6044|  58.4k|                     it = key_start;
 6045|       |                     // Parse as an object alternative so complex keys (e.g. flow collections) stay in mapping context.
 6046|  58.4k|                     if constexpr (counts::n_object > 0) {
 6047|  58.4k|                        process_yaml_variant_alternatives<V, is_yaml_variant_object>::template op<Opts>(value, ctx, it,
 6048|  58.4k|                                                                                                        end);
 6049|       |                     }
 6050|       |                     else {
 6051|       |                        from<YAML, V>::template op<Opts>(value, ctx, it, end);
 6052|       |                     }
 6053|  58.4k|                     return;
 6054|  58.5k|                  }
 6055|   364k|               }
 6056|       |
 6057|   305k|               const bool prev_allow_indentless_sequence = ctx.allow_indentless_sequence;
 6058|   364k|               ctx.allow_indentless_sequence = value_is_indentless_sequence;
 6059|   364k|               from<YAML, V>::template op<Opts>(value, ctx, it, end);
 6060|   364k|               ctx.allow_indentless_sequence = prev_allow_indentless_sequence;
 6061|   364k|               if (!bool(ctx.error)) {
  ------------------
  |  Branch (6061:20): [True: 277k, False: 86.5k]
  ------------------
 6062|   277k|                  ctx.anchors[std::string(aname)] = {anchor_start, &*it, anchor_indent};
 6063|   277k|               }
 6064|   364k|               return;
 6065|   364k|            }
 6066|  25.2k|            case '*': {
  ------------------
  |  Branch (6066:13): [True: 25.2k, False: 2.21M]
  ------------------
 6067|       |               // In block context, "*alias : value" starts a mapping with an alias key.
 6068|  25.2k|               if constexpr (!yaml::check_flow_context(Opts)) {
 6069|  25.2k|                  if (yaml::alias_token_is_mapping_key(it, end)) {
  ------------------
  |  Branch (6069:23): [True: 13.6k, False: 11.6k]
  ------------------
 6070|  13.6k|                     if constexpr (counts::n_object > 0) {
 6071|  13.6k|                        process_yaml_variant_alternatives<V, is_yaml_variant_object>::template op<Opts>(value, ctx, it,
 6072|  13.6k|                                                                                                        end);
 6073|  13.6k|                        return;
 6074|       |                     }
 6075|       |                     else {
 6076|       |                        ctx.error = error_code::syntax_error;
 6077|       |                        return;
 6078|       |                     }
 6079|  13.6k|                  }
 6080|  25.2k|               }
 6081|       |
 6082|       |               // Alias value: look up anchor and replay
 6083|      0|               yaml::handle_alias<Opts>(value, ctx, it, end);
 6084|  25.2k|               return;
 6085|   364k|            }
 6086|   243k|            case '!': {
  ------------------
  |  Branch (6086:13): [True: 243k, False: 1.99M]
  ------------------
 6087|       |               // Tag - parse it and dispatch based on tag type
 6088|   243k|               const auto tag = yaml::parse_yaml_tag(it, end, ctx);
 6089|   243k|               if (tag == yaml::yaml_tag::unknown) {
  ------------------
  |  Branch (6089:20): [True: 14, False: 243k]
  ------------------
 6090|     14|                  ctx.error = error_code::syntax_error;
 6091|     14|                  return;
 6092|     14|               }
 6093|   243k|               yaml::skip_inline_ws(it, end);
 6094|   243k|               if (it != end && *it == '#') {
  ------------------
  |  Branch (6094:20): [True: 239k, False: 3.62k]
  |  Branch (6094:33): [True: 5.73k, False: 234k]
  ------------------
 6095|  5.73k|                  yaml::skip_comment(it, end);
 6096|  5.73k|               }
 6097|   243k|               if (it != end && (*it == '\n' || *it == '\r')) {
  ------------------
  |  Branch (6097:20): [True: 239k, False: 4.32k]
  |  Branch (6097:34): [True: 31.6k, False: 207k]
  |  Branch (6097:49): [True: 26.9k, False: 180k]
  ------------------
 6098|  58.6k|                  auto content = it;
 6099|  58.6k|                  yaml::skip_newline(content, end);
 6100|  58.6k|                  yaml::skip_to_content(content, end);
 6101|       |
 6102|  58.6k|                  bool consume_following_content = false;
 6103|  58.6k|                  auto content_token = content;
 6104|  58.6k|                  if (content != end) {
  ------------------
  |  Branch (6104:23): [True: 53.3k, False: 5.25k]
  ------------------
 6105|  53.3k|                     auto indent_probe = content;
 6106|  53.3k|                     const int32_t content_indent = yaml::measure_indent<false>(indent_probe, end, ctx);
 6107|  53.3k|                     if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (6107:26): [True: 8, False: 53.3k]
  ------------------
 6108|      8|                        return;
 6109|  53.3k|                     content_token = indent_probe;
 6110|       |
 6111|       |                     // A tag at the end of a sequence/map entry has an empty value
 6112|       |                     // unless the next non-empty content is nested under the current node.
 6113|  53.3k|                     bool tagged_indentless_sequence = false;
 6114|  53.3k|                     if (tag == yaml::yaml_tag::seq && indent_probe != end && *indent_probe == '-') {
  ------------------
  |  Branch (6114:26): [True: 7.06k, False: 46.3k]
  |  Branch (6114:56): [True: 7.06k, False: 0]
  |  Branch (6114:79): [True: 6.40k, False: 658]
  ------------------
 6115|  6.40k|                        const auto after_dash = indent_probe + 1;
 6116|  6.40k|                        if (after_dash == end ||
  ------------------
  |  Branch (6116:29): [True: 542, False: 5.86k]
  ------------------
 6117|  5.94k|                            yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*after_dash)]) {
  ------------------
  |  Branch (6117:29): [True: 5.40k, False: 462]
  ------------------
 6118|  5.94k|                           tagged_indentless_sequence =
 6119|  5.94k|                              (content_indent == ctx.current_indent()) ||
  ------------------
  |  Branch (6119:31): [True: 312, False: 5.63k]
  ------------------
 6120|  5.63k|                              (ctx.current_indent() > 0 && (content_indent + 1) == ctx.current_indent());
  ------------------
  |  Branch (6120:32): [True: 3.19k, False: 2.44k]
  |  Branch (6120:60): [True: 1.17k, False: 2.01k]
  ------------------
 6121|  5.94k|                        }
 6122|  6.40k|                     }
 6123|       |
 6124|  53.3k|                     consume_following_content = (ctx.current_indent() < 0) ||
  ------------------
  |  Branch (6124:50): [True: 23.2k, False: 30.1k]
  ------------------
 6125|  30.1k|                                                 (content_indent > ctx.current_indent()) || tagged_indentless_sequence;
  ------------------
  |  Branch (6125:50): [True: 6.48k, False: 23.6k]
  |  Branch (6125:93): [True: 1.48k, False: 22.1k]
  ------------------
 6126|  53.3k|                  }
 6127|       |
 6128|  58.6k|                  if (consume_following_content) {
  ------------------
  |  Branch (6128:23): [True: 31.1k, False: 27.4k]
  ------------------
 6129|  31.1k|                     it = content_token;
 6130|  31.1k|                  }
 6131|  27.4k|                  else {
 6132|  27.4k|                     if (tag == yaml::yaml_tag::str) {
  ------------------
  |  Branch (6132:26): [True: 380, False: 27.0k]
  ------------------
 6133|    380|                        if constexpr (counts::n_str > 0) {
 6134|    380|                           constexpr auto first_idx = yaml_variant_first_index_v<V, is_yaml_variant_str>;
 6135|    380|                           using StrType = std::variant_alternative_t<first_idx, V>;
 6136|    380|                           value = StrType{};
 6137|    380|                           return;
 6138|    380|                        }
 6139|    380|                     }
 6140|  27.4k|                     if (tag == yaml::yaml_tag::null_tag) {
  ------------------
  |  Branch (6140:26): [True: 1.45k, False: 25.9k]
  ------------------
 6141|  1.45k|                        if constexpr (counts::n_null > 0) {
 6142|  1.45k|                           constexpr auto first_idx = yaml_variant_first_index_v<V, is_yaml_variant_null>;
 6143|  1.45k|                           using NullType = std::variant_alternative_t<first_idx, V>;
 6144|  1.45k|                           if (!std::holds_alternative<NullType>(value)) value = NullType{};
  ------------------
  |  Branch (6144:32): [True: 0, False: 1.45k]
  ------------------
 6145|  1.45k|                           return;
 6146|  1.45k|                        }
 6147|  1.45k|                     }
 6148|  27.4k|                     if (tag == yaml::yaml_tag::none) {
  ------------------
  |  Branch (6148:26): [True: 24.5k, False: 2.92k]
  ------------------
 6149|  24.5k|                        if constexpr (counts::n_null > 0) {
 6150|  24.5k|                           constexpr auto first_idx = yaml_variant_first_index_v<V, is_yaml_variant_null>;
 6151|  24.5k|                           using NullType = std::variant_alternative_t<first_idx, V>;
 6152|  24.5k|                           if (!std::holds_alternative<NullType>(value)) value = NullType{};
  ------------------
  |  Branch (6152:32): [True: 0, False: 24.5k]
  ------------------
 6153|  24.5k|                           return;
 6154|  24.5k|                        }
 6155|  24.5k|                     }
 6156|  27.4k|                  }
 6157|  58.6k|               }
 6158|   243k|               if constexpr (!yaml::check_flow_context(Opts)) {
 6159|       |                  // In block context, a comma immediately after a tag token is malformed
 6160|       |                  // (e.g., "!!str, value"). Flow context has legitimate ", ] }" usage.
 6161|   243k|                  if (it != end && *it == ',') {
  ------------------
  |  Branch (6161:23): [True: 212k, False: 30.6k]
  |  Branch (6161:36): [True: 6, False: 212k]
  ------------------
 6162|      6|                     ctx.error = error_code::syntax_error;
 6163|      6|                     return;
 6164|      6|                  }
 6165|   243k|                  if constexpr (counts::n_object > 0) {
 6166|       |                     // Tagged keys like "!!str key: value" must parse as mappings.
 6167|   243k|                     const bool starts_block_sequence_entry =
 6168|   243k|                        (it != end && *it == '-') &&
  ------------------
  |  Branch (6168:26): [True: 212k, False: 30.6k]
  |  Branch (6168:39): [True: 10.2k, False: 202k]
  ------------------
 6169|  10.2k|                        ((it + 1) == end || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*(it + 1))]);
  ------------------
  |  Branch (6169:26): [True: 748, False: 9.53k]
  |  Branch (6169:45): [True: 8.39k, False: 1.14k]
  ------------------
 6170|   243k|                     if (!starts_block_sequence_entry && yaml::line_could_be_block_mapping(it, end)) {
  ------------------
  |  Branch (6170:26): [True: 207k, False: 35.4k]
  |  Branch (6170:58): [True: 5.15k, False: 202k]
  ------------------
 6171|       |                        // Re-dispatch from the post-tag token so '&key key: val' is
 6172|       |                        // handled by the anchor-aware key path, not as a map-level anchor.
 6173|  5.15k|                        from<YAML, V>::template op<Opts>(value, ctx, it, end);
 6174|  5.15k|                        return;
 6175|  5.15k|                     }
 6176|   243k|                  }
 6177|   243k|               }
 6178|   243k|               if (it == end) {
  ------------------
  |  Branch (6178:20): [True: 4.32k, False: 239k]
  ------------------
 6179|  4.32k|                  if (tag == yaml::yaml_tag::str) {
  ------------------
  |  Branch (6179:23): [True: 346, False: 3.98k]
  ------------------
 6180|    346|                     if constexpr (counts::n_str > 0) {
 6181|    346|                        constexpr auto first_idx = yaml_variant_first_index_v<V, is_yaml_variant_str>;
 6182|    346|                        using StrType = std::variant_alternative_t<first_idx, V>;
 6183|    346|                        value = StrType{};
 6184|    346|                        return;
 6185|    346|                     }
 6186|    346|                  }
 6187|  4.32k|                  if (tag == yaml::yaml_tag::none) {
  ------------------
  |  Branch (6187:23): [True: 3.97k, False: 352]
  ------------------
 6188|  3.97k|                     if constexpr (counts::n_null > 0) {
 6189|  3.97k|                        constexpr auto first_idx = yaml_variant_first_index_v<V, is_yaml_variant_null>;
 6190|  3.97k|                        using NullType = std::variant_alternative_t<first_idx, V>;
 6191|  3.97k|                        if (!std::holds_alternative<NullType>(value)) value = NullType{};
  ------------------
  |  Branch (6191:29): [True: 0, False: 3.97k]
  ------------------
 6192|  3.97k|                        return;
 6193|  3.97k|                     }
 6194|  3.97k|                  }
 6195|      0|                  ctx.error = error_code::unexpected_end;
 6196|  4.32k|                  return;
 6197|  4.32k|               }
 6198|   239k|               switch (tag) {
 6199|    438|               case yaml::yaml_tag::str:
  ------------------
  |  Branch (6199:16): [True: 438, False: 238k]
  ------------------
 6200|    438|                  process_yaml_variant_alternatives<V, is_yaml_variant_str>::template op<Opts>(value, ctx, it, end);
 6201|    438|                  return;
 6202|  12.6k|               case yaml::yaml_tag::int_tag:
  ------------------
  |  Branch (6202:16): [True: 12.6k, False: 226k]
  ------------------
 6203|  12.7k|               case yaml::yaml_tag::float_tag:
  ------------------
  |  Branch (6203:16): [True: 82, False: 238k]
  ------------------
 6204|  12.7k|                  if constexpr (counts::n_num > 0) {
 6205|  12.7k|                     process_yaml_variant_alternatives<V, is_yaml_variant_num>::template op<Opts>(value, ctx, it, end);
 6206|  12.7k|                     return;
 6207|       |                  }
 6208|       |                  else { // else used to fix MSVC unreachable code warning
 6209|       |                     ctx.error = error_code::syntax_error;
 6210|       |                     return;
 6211|       |                  }
 6212|  27.5k|               case yaml::yaml_tag::bool_tag:
  ------------------
  |  Branch (6212:16): [True: 14.8k, False: 224k]
  ------------------
 6213|  27.5k|                  if constexpr (counts::n_bool > 0) {
 6214|  27.5k|                     process_yaml_variant_alternatives<V, is_yaml_variant_bool>::template op<Opts>(value, ctx, it, end);
 6215|  27.5k|                     return;
 6216|       |                  }
 6217|       |                  else { // else used to fix MSVC unreachable code warning
 6218|       |                     ctx.error = error_code::syntax_error;
 6219|       |                     return;
 6220|       |                  }
 6221|  27.9k|               case yaml::yaml_tag::null_tag:
  ------------------
  |  Branch (6221:16): [True: 382, False: 238k]
  ------------------
 6222|  27.9k|                  if constexpr (counts::n_null > 0) {
 6223|  27.9k|                     constexpr auto first_idx = yaml_variant_first_index_v<V, is_yaml_variant_null>;
 6224|  27.9k|                     using NullType = std::variant_alternative_t<first_idx, V>;
 6225|  27.9k|                     if (!std::holds_alternative<NullType>(value)) value = NullType{};
  ------------------
  |  Branch (6225:26): [True: 0, False: 27.9k]
  ------------------
 6226|  27.9k|                     from<YAML, NullType>::template op<Opts>(std::get<NullType>(value), ctx, it, end);
 6227|  27.9k|                     return;
 6228|       |                  }
 6229|       |                  else { // else used to fix MSVC unreachable code warning
 6230|       |                     ctx.error = error_code::syntax_error;
 6231|       |                     return;
 6232|       |                  }
 6233|  34.6k|               case yaml::yaml_tag::map:
  ------------------
  |  Branch (6233:16): [True: 6.75k, False: 232k]
  ------------------
 6234|  34.6k|                  if constexpr (counts::n_object > 0) {
 6235|  34.6k|                     process_yaml_variant_alternatives<V, is_yaml_variant_object>::template op<Opts>(value, ctx, it,
 6236|  34.6k|                                                                                                     end);
 6237|  34.6k|                     return;
 6238|       |                  }
 6239|       |                  else { // else used to fix MSVC unreachable code warning
 6240|       |                     ctx.error = error_code::syntax_error;
 6241|       |                     return;
 6242|       |                  }
 6243|  53.2k|               case yaml::yaml_tag::seq:
  ------------------
  |  Branch (6243:16): [True: 18.5k, False: 220k]
  ------------------
 6244|  53.2k|                  if constexpr (counts::n_array > 0) {
 6245|  53.2k|                     const bool prev_allow_indentless_sequence = ctx.allow_indentless_sequence;
 6246|  53.2k|                     if constexpr (!yaml::check_flow_context(Opts)) {
 6247|  53.2k|                        if (it != end && *it == '-') {
  ------------------
  |  Branch (6247:29): [True: 18.5k, False: 34.6k]
  |  Branch (6247:42): [True: 6.39k, False: 12.1k]
  ------------------
 6248|  6.39k|                           ctx.allow_indentless_sequence = true;
 6249|  6.39k|                        }
 6250|  53.2k|                     }
 6251|  53.2k|                     process_yaml_variant_alternatives<V, is_yaml_variant_array>::template op<Opts>(value, ctx, it,
 6252|  53.2k|                                                                                                    end);
 6253|  53.2k|                     ctx.allow_indentless_sequence = prev_allow_indentless_sequence;
 6254|  53.2k|                     return;
 6255|       |                  }
 6256|       |                  else { // else used to fix MSVC unreachable code warning
 6257|       |                     ctx.error = error_code::syntax_error;
 6258|       |                     return;
 6259|       |                  }
 6260|   207k|               default: {
  ------------------
  |  Branch (6260:16): [True: 153k, False: 85.1k]
  ------------------
 6261|       |                  // Explicit unknown/non-core tags disable implicit scalar resolution.
 6262|       |                  // Preserve collection kinds, otherwise treat as string content.
 6263|   207k|                  if (it != end && *it == '*') {
  ------------------
  |  Branch (6263:23): [True: 153k, False: 53.2k]
  |  Branch (6263:36): [True: 2.51k, False: 151k]
  ------------------
 6264|  2.51k|                     yaml::handle_alias<Opts>(value, ctx, it, end);
 6265|  2.51k|                     return;
 6266|  2.51k|                  }
 6267|       |
 6268|   204k|                  if constexpr (counts::n_array > 0) {
 6269|   204k|                     if (it != end && *it == '[') {
  ------------------
  |  Branch (6269:26): [True: 151k, False: 53.2k]
  |  Branch (6269:39): [True: 1.06k, False: 150k]
  ------------------
 6270|  1.06k|                        process_yaml_variant_alternatives<V, is_yaml_variant_array>::template op<Opts>(value, ctx, it,
 6271|  1.06k|                                                                                                       end);
 6272|  1.06k|                        return;
 6273|  1.06k|                     }
 6274|   204k|                  }
 6275|   204k|                  if constexpr (counts::n_object > 0) {
 6276|   204k|                     if (it != end && *it == '{') {
  ------------------
  |  Branch (6276:26): [True: 150k, False: 54.2k]
  |  Branch (6276:39): [True: 107k, False: 42.7k]
  ------------------
 6277|   107k|                        process_yaml_variant_alternatives<V, is_yaml_variant_object>::template op<Opts>(value, ctx, it,
 6278|   107k|                                                                                                        end);
 6279|   107k|                        return;
 6280|   107k|                     }
 6281|   204k|                  }
 6282|       |
 6283|   204k|                  if constexpr (!yaml::check_flow_context(Opts)) {
 6284|   204k|                     if constexpr (counts::n_array > 0) {
 6285|   204k|                        const bool starts_block_sequence_entry =
 6286|   204k|                           (it != end && *it == '-') &&
  ------------------
  |  Branch (6286:29): [True: 42.7k, False: 161k]
  |  Branch (6286:42): [True: 3.88k, False: 38.9k]
  ------------------
 6287|  3.88k|                           ((it + 1) == end || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*(it + 1))]);
  ------------------
  |  Branch (6287:29): [True: 206, False: 3.67k]
  |  Branch (6287:48): [True: 2.99k, False: 676]
  ------------------
 6288|   204k|                        if (starts_block_sequence_entry) {
  ------------------
  |  Branch (6288:29): [True: 3.20k, False: 201k]
  ------------------
 6289|  3.20k|                           process_yaml_variant_alternatives<V, is_yaml_variant_array>::template op<Opts>(value, ctx,
 6290|  3.20k|                                                                                                          it, end);
 6291|  3.20k|                           return;
 6292|  3.20k|                        }
 6293|   204k|                     }
 6294|   204k|                     if constexpr (counts::n_object > 0) {
 6295|   204k|                        const bool starts_explicit_mapping_indicator =
 6296|   204k|                           (it != end && (*it == '?' || *it == ':')) &&
  ------------------
  |  Branch (6296:29): [True: 39.5k, False: 165k]
  |  Branch (6296:43): [True: 2.80k, False: 36.7k]
  |  Branch (6296:57): [True: 402, False: 36.3k]
  ------------------
 6297|  3.21k|                           ((it + 1) == end || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*(it + 1))]);
  ------------------
  |  Branch (6297:29): [True: 194, False: 3.01k]
  |  Branch (6297:48): [True: 1.82k, False: 1.19k]
  ------------------
 6298|   204k|                        if (starts_explicit_mapping_indicator) {
  ------------------
  |  Branch (6298:29): [True: 2.01k, False: 202k]
  ------------------
 6299|  2.01k|                           process_yaml_variant_alternatives<V, is_yaml_variant_object>::template op<Opts>(value, ctx,
 6300|  2.01k|                                                                                                           it, end);
 6301|  2.01k|                           return;
 6302|  2.01k|                        }
 6303|   202k|                        if (yaml::line_could_be_block_mapping(it, end)) {
  ------------------
  |  Branch (6303:29): [True: 0, False: 202k]
  ------------------
 6304|      0|                           process_yaml_variant_alternatives<V, is_yaml_variant_object>::template op<Opts>(value, ctx,
 6305|      0|                                                                                                           it, end);
 6306|      0|                           return;
 6307|      0|                        }
 6308|   202k|                     }
 6309|   204k|                  }
 6310|       |
 6311|   204k|                  if constexpr (counts::n_str > 0) {
 6312|   204k|                     process_yaml_variant_alternatives<V, is_yaml_variant_str>::template op<Opts>(value, ctx, it, end);
 6313|   204k|                     return;
 6314|   204k|                  }
 6315|       |
 6316|       |                  // Fall back if no string alternative exists.
 6317|      0|                  from<YAML, V>::template op<Opts>(value, ctx, it, end);
 6318|   204k|                  return;
 6319|   207k|               }
 6320|   239k|               }
 6321|      0|               return;
 6322|   239k|            }
 6323|   115k|            case '{':
  ------------------
  |  Branch (6323:13): [True: 115k, False: 2.12M]
  ------------------
 6324|   115k|               if constexpr (!yaml::check_flow_context(Opts)) {
 6325|       |                  // In block context, "{...}: value" can be a complex mapping key.
 6326|   115k|                  if (ctx.current_indent() < 0 && yaml::line_could_be_block_mapping(it, end)) {
  ------------------
  |  Branch (6326:23): [True: 74.0k, False: 41.0k]
  |  Branch (6326:51): [True: 2.16k, False: 71.8k]
  ------------------
 6327|  2.16k|                     process_yaml_variant_alternatives<V, is_yaml_variant_object>::template op<Opts>(value, ctx, it,
 6328|  2.16k|                                                                                                     end);
 6329|  2.16k|                     return;
 6330|  2.16k|                  }
 6331|   115k|               }
 6332|       |               // Flow mapping - object type
 6333|   112k|               process_yaml_variant_alternatives<V, is_yaml_variant_object>::template op<Opts>(value, ctx, it, end);
 6334|   115k|               return;
 6335|  41.4k|            case '[':
  ------------------
  |  Branch (6335:13): [True: 41.4k, False: 2.19M]
  ------------------
 6336|  41.4k|               if constexpr (!yaml::check_flow_context(Opts)) {
 6337|       |                  // In block context, "[...]: value" can be a complex mapping key.
 6338|  41.4k|                  if (ctx.current_indent() < 0 && yaml::line_could_be_block_mapping(it, end)) {
  ------------------
  |  Branch (6338:23): [True: 18.1k, False: 23.2k]
  |  Branch (6338:51): [True: 382, False: 17.8k]
  ------------------
 6339|    382|                     process_yaml_variant_alternatives<V, is_yaml_variant_object>::template op<Opts>(value, ctx, it,
 6340|    382|                                                                                                     end);
 6341|    382|                     return;
 6342|    382|                  }
 6343|  41.4k|               }
 6344|       |               // Flow sequence - array type
 6345|  41.0k|               process_yaml_variant_alternatives<V, is_yaml_variant_array>::template op<Opts>(value, ctx, it, end);
 6346|  41.4k|               return;
 6347|   432k|            case '?':
  ------------------
  |  Branch (6347:13): [True: 432k, False: 1.80M]
  ------------------
 6348|       |               // Explicit mapping key indicator ("? key")
 6349|   432k|               if ((end - it >= 2) && it[1] == '\t') {
  ------------------
  |  Branch (6349:20): [True: 391k, False: 40.4k]
  |  Branch (6349:39): [True: 6, False: 391k]
  ------------------
 6350|      6|                  ctx.error = error_code::syntax_error;
 6351|      6|                  return;
 6352|      6|               }
 6353|   432k|               if ((end - it >= 2) && (it[1] == ' ' || it[1] == '\n' || it[1] == '\r')) {
  ------------------
  |  Branch (6353:20): [True: 391k, False: 40.4k]
  |  Branch (6353:40): [True: 125k, False: 266k]
  |  Branch (6353:56): [True: 157k, False: 108k]
  |  Branch (6353:73): [True: 42.3k, False: 65.8k]
  ------------------
 6354|   325k|                  if constexpr (counts::n_object > 0) {
 6355|   325k|                     process_yaml_variant_alternatives<V, is_yaml_variant_object>::template op<Opts>(value, ctx, it,
 6356|   325k|                                                                                                     end);
 6357|   325k|                     return;
 6358|   325k|                  }
 6359|   325k|               }
 6360|      0|               parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6361|   432k|               return;
 6362|      6|            case '%':
  ------------------
  |  Branch (6362:13): [True: 6, False: 2.23M]
  ------------------
 6363|       |               // Reserved directive indicator is not a plain scalar start.
 6364|      6|               ctx.error = error_code::syntax_error;
 6365|      6|               return;
 6366|  7.07k|            case '"':
  ------------------
  |  Branch (6366:13): [True: 7.07k, False: 2.23M]
  ------------------
 6367|  18.8k|            case '\'':
  ------------------
  |  Branch (6367:13): [True: 11.8k, False: 2.22M]
  ------------------
 6368|       |               // Could be a quoted string OR a quoted key in a block mapping
 6369|       |               // Try block mapping first (e.g., "key": value), then fall back to string
 6370|  18.8k|               parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6371|  18.8k|               return;
 6372|  42.3k|            case 't':
  ------------------
  |  Branch (6372:13): [True: 42.3k, False: 2.19M]
  ------------------
 6373|  52.8k|            case 'T':
  ------------------
  |  Branch (6373:13): [True: 10.4k, False: 2.22M]
  ------------------
 6374|       |               // Could be "true", "True", "TRUE", or a key/string starting with t/T
 6375|  52.8k|               if constexpr (counts::n_bool > 0) {
 6376|  52.8k|                  if ((end - it >= 4) && ((it[1] == 'r' && it[2] == 'u' && it[3] == 'e') ||
  ------------------
  |  Branch (6376:23): [True: 51.7k, False: 1.07k]
  |  Branch (6376:44): [True: 42.0k, False: 9.74k]
  |  Branch (6376:60): [True: 39.6k, False: 2.35k]
  |  Branch (6376:76): [True: 37.5k, False: 2.14k]
  ------------------
 6377|  38.8k|                                          (it[1] == 'R' && it[2] == 'U' && it[3] == 'E'))) {
  ------------------
  |  Branch (6377:44): [True: 2.30k, False: 11.9k]
  |  Branch (6377:60): [True: 1.68k, False: 622]
  |  Branch (6377:76): [True: 1.35k, False: 322]
  ------------------
 6378|       |                     // Check what follows the word "true"
 6379|  38.8k|                     const auto after_true = it + 4;
 6380|  38.8k|                     const bool at_word_boundary = is_word_boundary(after_true);
 6381|       |
 6382|  38.8k|                     if (at_word_boundary) {
  ------------------
  |  Branch (6382:26): [True: 36.8k, False: 1.99k]
  ------------------
 6383|  36.8k|                        if (has_indented_block_continuation(after_true)) {
  ------------------
  |  Branch (6383:29): [True: 246, False: 36.6k]
  ------------------
 6384|    246|                           parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6385|    246|                           return;
 6386|    246|                        }
 6387|       |                        // Check if this is a key (followed by ": ") rather than a boolean value
 6388|       |                        // "true: value" should parse as {true: value}, not as the boolean true
 6389|  36.6k|                        if ((end - it > 4) && it[4] == ':' &&
  ------------------
  |  Branch (6389:29): [True: 33.2k, False: 3.38k]
  |  Branch (6389:47): [True: 26.5k, False: 6.68k]
  ------------------
 6390|  26.5k|                            (end - it == 5 || it[5] == ' ' || it[5] == '\t' || it[5] == '\n' || it[5] == '\r')) {
  ------------------
  |  Branch (6390:30): [True: 18.3k, False: 8.21k]
  |  Branch (6390:47): [True: 4.29k, False: 3.92k]
  |  Branch (6390:63): [True: 726, False: 3.19k]
  |  Branch (6390:80): [True: 468, False: 2.72k]
  |  Branch (6390:97): [True: 2.72k, False: 0]
  ------------------
 6391|       |                           // This is "true:" followed by space/tab/newline/end - treat as key
 6392|  26.5k|                           parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6393|  26.5k|                           return;
 6394|  26.5k|                        }
 6395|  10.0k|                        process_yaml_variant_alternatives<V, is_yaml_variant_bool>::template op<Opts>(value, ctx, it,
 6396|  10.0k|                                                                                                      end);
 6397|  10.0k|                        return;
 6398|  36.6k|                     }
 6399|       |                     // "true" is followed by more characters (e.g., "True\b") - treat as string
 6400|  38.8k|                  }
 6401|  52.8k|               }
 6402|  15.9k|               parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6403|  52.8k|               return;
 6404|  43.5k|            case 'f':
  ------------------
  |  Branch (6404:13): [True: 43.5k, False: 2.19M]
  ------------------
 6405|  50.9k|            case 'F':
  ------------------
  |  Branch (6405:13): [True: 7.45k, False: 2.23M]
  ------------------
 6406|       |               // Could be "false", "False", "FALSE", or a key/string starting with f/F
 6407|  50.9k|               if constexpr (counts::n_bool > 0) {
 6408|  50.9k|                  if ((end - it >= 5) && ((it[1] == 'a' && it[2] == 'l' && it[3] == 's' && it[4] == 'e') ||
  ------------------
  |  Branch (6408:23): [True: 48.0k, False: 2.91k]
  |  Branch (6408:44): [True: 33.3k, False: 14.7k]
  |  Branch (6408:60): [True: 25.9k, False: 7.37k]
  |  Branch (6408:76): [True: 22.4k, False: 3.48k]
  |  Branch (6408:92): [True: 13.7k, False: 8.68k]
  ------------------
 6409|  34.2k|                                          (it[1] == 'A' && it[2] == 'L' && it[3] == 'S' && it[4] == 'E'))) {
  ------------------
  |  Branch (6409:44): [True: 2.89k, False: 31.3k]
  |  Branch (6409:60): [True: 2.22k, False: 666]
  |  Branch (6409:76): [True: 1.63k, False: 596]
  |  Branch (6409:92): [True: 1.04k, False: 584]
  ------------------
 6410|       |                     // Check what follows the word "false"
 6411|  14.8k|                     const auto after_false = it + 5;
 6412|  14.8k|                     const bool at_word_boundary = is_word_boundary(after_false);
 6413|       |
 6414|  14.8k|                     if (at_word_boundary) {
  ------------------
  |  Branch (6414:26): [True: 14.0k, False: 814]
  ------------------
 6415|  14.0k|                        if (has_indented_block_continuation(after_false)) {
  ------------------
  |  Branch (6415:29): [True: 538, False: 13.4k]
  ------------------
 6416|    538|                           parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6417|    538|                           return;
 6418|    538|                        }
 6419|       |                        // Check if this is a key (followed by ": ") rather than a boolean value
 6420|       |                        // "false: value" should parse as {false: value}, not as the boolean false
 6421|  13.4k|                        if ((end - it > 5) && it[5] == ':' &&
  ------------------
  |  Branch (6421:29): [True: 12.5k, False: 936]
  |  Branch (6421:47): [True: 3.04k, False: 9.50k]
  ------------------
 6422|  3.04k|                            (end - it == 6 || it[6] == ' ' || it[6] == '\t' || it[6] == '\n' || it[6] == '\r')) {
  ------------------
  |  Branch (6422:30): [True: 230, False: 2.81k]
  |  Branch (6422:47): [True: 1.06k, False: 1.74k]
  |  Branch (6422:63): [True: 550, False: 1.19k]
  |  Branch (6422:80): [True: 756, False: 440]
  |  Branch (6422:97): [True: 440, False: 0]
  ------------------
 6423|       |                           // This is "false:" followed by space/tab/newline/end - treat as key
 6424|  3.04k|                           parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6425|  3.04k|                           return;
 6426|  3.04k|                        }
 6427|  10.4k|                        process_yaml_variant_alternatives<V, is_yaml_variant_bool>::template op<Opts>(value, ctx, it,
 6428|  10.4k|                                                                                                      end);
 6429|  10.4k|                        return;
 6430|  13.4k|                     }
 6431|       |                     // "false" is followed by more characters (e.g., "False\b") - treat as string
 6432|  14.8k|                  }
 6433|  50.9k|               }
 6434|  36.9k|               parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6435|  50.9k|               return;
 6436|  11.5k|            case 'n':
  ------------------
  |  Branch (6436:13): [True: 11.5k, False: 2.22M]
  ------------------
 6437|  29.4k|            case 'N':
  ------------------
  |  Branch (6437:13): [True: 17.9k, False: 2.22M]
  ------------------
 6438|       |               // Could be "null", "Null", "NULL", or a key/string starting with n/N
 6439|  29.4k|               if constexpr (counts::n_null > 0) {
 6440|  29.4k|                  if ((end - it >= 4) && ((it[1] == 'u' && it[2] == 'l' && it[3] == 'l') ||
  ------------------
  |  Branch (6440:23): [True: 27.6k, False: 1.79k]
  |  Branch (6440:44): [True: 10.3k, False: 17.2k]
  |  Branch (6440:60): [True: 9.60k, False: 774]
  |  Branch (6440:76): [True: 8.90k, False: 698]
  ------------------
 6441|  18.7k|                                          (it[1] == 'U' && it[2] == 'L' && it[3] == 'L'))) {
  ------------------
  |  Branch (6441:44): [True: 2.75k, False: 15.9k]
  |  Branch (6441:60): [True: 2.13k, False: 624]
  |  Branch (6441:76): [True: 1.33k, False: 800]
  ------------------
 6442|       |                     // Check what follows the word "null"
 6443|  10.2k|                     const auto after_null = it + 4;
 6444|  10.2k|                     const bool at_word_boundary = is_word_boundary(after_null);
 6445|       |
 6446|  10.2k|                     if (at_word_boundary) {
  ------------------
  |  Branch (6446:26): [True: 6.92k, False: 3.31k]
  ------------------
 6447|  6.92k|                        if (has_indented_block_continuation(after_null)) {
  ------------------
  |  Branch (6447:29): [True: 260, False: 6.66k]
  ------------------
 6448|    260|                           parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6449|    260|                           return;
 6450|    260|                        }
 6451|       |                        // Check if this is a key (followed by ": ") rather than a null value
 6452|       |                        // "null: value" should parse as {null: value}, not as the null type
 6453|  6.66k|                        if ((end - it > 4) && it[4] == ':' &&
  ------------------
  |  Branch (6453:29): [True: 5.65k, False: 1.00k]
  |  Branch (6453:47): [True: 3.38k, False: 2.26k]
  ------------------
 6454|  3.38k|                            (end - it == 5 || it[5] == ' ' || it[5] == '\t' || it[5] == '\n' || it[5] == '\r')) {
  ------------------
  |  Branch (6454:30): [True: 282, False: 3.10k]
  |  Branch (6454:47): [True: 372, False: 2.73k]
  |  Branch (6454:63): [True: 96, False: 2.63k]
  |  Branch (6454:80): [True: 1.37k, False: 1.26k]
  |  Branch (6454:97): [True: 1.26k, False: 0]
  ------------------
 6455|       |                           // This is "null:" followed by space/tab/newline/end - treat as key
 6456|  3.38k|                           parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6457|  3.38k|                           return;
 6458|  3.38k|                        }
 6459|  3.27k|                        constexpr auto first_idx = yaml_variant_first_index_v<V, is_yaml_variant_null>;
 6460|  3.27k|                        using NullType = std::variant_alternative_t<first_idx, V>;
 6461|  3.27k|                        if (!std::holds_alternative<NullType>(value)) value = NullType{};
  ------------------
  |  Branch (6461:29): [True: 0, False: 3.27k]
  ------------------
 6462|  3.27k|                        from<YAML, NullType>::template op<Opts>(std::get<NullType>(value), ctx, it, end);
 6463|  3.27k|                        return;
 6464|  6.66k|                     }
 6465|       |                     // "null" is followed by more characters (e.g., "Null\b") - treat as string
 6466|  10.2k|                  }
 6467|  29.4k|               }
 6468|  22.5k|               parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6469|  29.4k|               return;
 6470|    360|            case '~':
  ------------------
  |  Branch (6470:13): [True: 360, False: 2.23M]
  ------------------
 6471|       |               // Null indicator
 6472|    360|               if constexpr (counts::n_null > 0) {
 6473|    360|                  constexpr auto first_idx = yaml_variant_first_index_v<V, is_yaml_variant_null>;
 6474|    360|                  using NullType = std::variant_alternative_t<first_idx, V>;
 6475|    360|                  if (!std::holds_alternative<NullType>(value)) value = NullType{};
  ------------------
  |  Branch (6475:23): [True: 0, False: 360]
  ------------------
 6476|    360|                  from<YAML, NullType>::template op<Opts>(std::get<NullType>(value), ctx, it, end);
 6477|    360|                  return;
 6478|    360|               }
 6479|      0|               break; // Fall through to try other types
 6480|   369k|            case '-':
  ------------------
  |  Branch (6480:13): [True: 369k, False: 1.86M]
  ------------------
 6481|       |               // Could be negative number or block sequence indicator
 6482|   369k|               if (((it + 1) == end) || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(it[1])]) {
  ------------------
  |  Branch (6482:20): [True: 12.1k, False: 356k]
  |  Branch (6482:41): [True: 292k, False: 64.2k]
  ------------------
 6483|       |                  // Block sequence indicator "- "
 6484|   304k|                  if constexpr (counts::n_array > 0) {
 6485|   304k|                     process_yaml_variant_alternatives<V, is_yaml_variant_array>::template op<Opts>(value, ctx, it,
 6486|   304k|                                                                                                    end);
 6487|   304k|                     return;
 6488|   304k|                  }
 6489|   304k|               }
 6490|   369k|               if constexpr (counts::n_num > 0) {
 6491|   369k|                  if ((end - it >= 2) && (std::isdigit(static_cast<unsigned char>(it[1])) || it[1] == '.')) {
  ------------------
  |  Branch (6491:23): [True: 64.2k, False: 304k]
  |  Branch (6491:43): [True: 8.66k, False: 55.6k]
  |  Branch (6491:94): [True: 9.88k, False: 45.7k]
  ------------------
 6492|  18.5k|                     process_yaml_variant_alternatives<V, is_yaml_variant_num>::template op<Opts>(value, ctx, it, end);
 6493|  18.5k|                     return;
 6494|  18.5k|                  }
 6495|   369k|               }
 6496|   350k|               parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6497|   369k|               return;
 6498|  33.4k|            case '+':
  ------------------
  |  Branch (6498:13): [True: 33.4k, False: 2.20M]
  ------------------
 6499|  66.8k|            case '.':
  ------------------
  |  Branch (6499:13): [True: 33.3k, False: 2.20M]
  ------------------
 6500|       |               // Could be a number (.5, +5, .inf, etc.) or a string (.c, .cpp, +name, etc.)
 6501|       |               // Try parsing as number speculatively, fall back to string on failure
 6502|  66.8k|               if constexpr (counts::n_num > 0) {
 6503|  66.8k|                  auto start_it = it;
 6504|  66.8k|                  auto temp_ctx = ctx.make_speculative();
 6505|  66.8k|                  process_yaml_variant_alternatives<V, is_yaml_variant_num>::template op<Opts>(value, temp_ctx, it,
 6506|  66.8k|                                                                                               end);
 6507|  66.8k|                  ctx.alias_expansion_budget = temp_ctx.alias_expansion_budget; // charged even if rejected
 6508|  66.8k|                  ctx.key_expansion_budget = temp_ctx.key_expansion_budget;
 6509|  66.8k|                  if (!bool(temp_ctx.error)) {
  ------------------
  |  Branch (6509:23): [True: 9.93k, False: 56.9k]
  ------------------
 6510|  9.93k|                     ctx.anchors = std::move(temp_ctx.anchors);
 6511|  9.93k|                     return; // Successfully parsed as number
 6512|  9.93k|                  }
 6513|  56.9k|                  it = start_it; // Restore and fall through to string
 6514|  56.9k|               }
 6515|      0|               parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6516|  66.8k|               return;
 6517|   392k|            default:
  ------------------
  |  Branch (6517:13): [True: 392k, False: 1.84M]
  ------------------
 6518|       |               // Check for digit (0-9) - numeric or block mapping key starting with digit
 6519|   392k|               if (c >= '0' && c <= '9') {
  ------------------
  |  Branch (6519:20): [True: 226k, False: 166k]
  |  Branch (6519:32): [True: 76.9k, False: 149k]
  ------------------
 6520|       |                  // Try block mapping first (e.g., "123key: value")
 6521|  76.9k|                  if (try_parse_block_mapping_into_variant<V, Opts>(value, ctx, it, end)) {
  ------------------
  |  Branch (6521:23): [True: 14.6k, False: 62.2k]
  ------------------
 6522|  14.6k|                     return;
 6523|  14.6k|                  }
 6524|       |                  // Try numeric value speculatively - values like "12:30" look numeric but aren't
 6525|  62.2k|                  if constexpr (counts::n_num > 0) {
 6526|  62.2k|                     auto start_it = it;
 6527|  62.2k|                     auto temp_ctx = ctx.make_speculative();
 6528|  62.2k|                     process_yaml_variant_alternatives<V, is_yaml_variant_num>::template op<Opts>(value, temp_ctx, it,
 6529|  62.2k|                                                                                                  end);
 6530|  62.2k|                     ctx.alias_expansion_budget = temp_ctx.alias_expansion_budget; // charged even if rejected
 6531|  62.2k|                     ctx.key_expansion_budget = temp_ctx.key_expansion_budget;
 6532|  62.2k|                     if (!bool(temp_ctx.error)) {
  ------------------
  |  Branch (6532:26): [True: 13.0k, False: 49.1k]
  ------------------
 6533|  13.0k|                        ctx.anchors = std::move(temp_ctx.anchors);
 6534|  13.0k|                        return; // Successfully parsed as number
 6535|  13.0k|                     }
 6536|  49.1k|                     it = start_it; // Restore and fall through to string
 6537|  49.1k|                  }
 6538|       |                  // Fall through to string
 6539|      0|                  process_yaml_variant_alternatives<V, is_yaml_variant_str>::template op<Opts>(value, ctx, it, end);
 6540|  62.2k|                  return;
 6541|  76.9k|               }
 6542|       |               // Plain scalar - try block mapping, then string
 6543|   315k|               parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6544|   315k|               return;
 6545|  2.23M|            }
 6546|  2.23M|         }
 6547|       |
 6548|       |         // For non-auto-deducible variants or fallback, try each type until one succeeds
 6549|      0|         constexpr auto N = std::variant_size_v<std::remove_cvref_t<T>>;
 6550|       |
 6551|       |         // This fold discards each alternative's error and reports only that nothing fit, which
 6552|       |         // misdiagnoses a document that exhausted an expansion budget as merely the wrong shape.
 6553|       |         // Kept aside and used only if no alternative parsed, so a later one that does parse
 6554|       |         // (possible under a latched budget if it materializes no key text) is unaffected.
 6555|  2.23M|         error_code expansion_error{};
 6556|  2.23M|         std::string_view expansion_message{};
 6557|       |
 6558|  2.23M|         auto try_parse = [&]<size_t I>() -> bool {
 6559|  2.23M|            using V = std::variant_alternative_t<I, std::remove_cvref_t<T>>;
 6560|  2.23M|            auto start = it;
 6561|       |
 6562|  2.23M|            V v{};
 6563|  2.23M|            auto temp_ctx = ctx.make_speculative();
 6564|  2.23M|            from<YAML, V>::template op<Opts>(v, temp_ctx, it, end);
 6565|  2.23M|            ctx.alias_expansion_budget = temp_ctx.alias_expansion_budget; // charged even if rejected
 6566|  2.23M|            ctx.key_expansion_budget = temp_ctx.key_expansion_budget;
 6567|       |
 6568|  2.23M|            if (!bool(temp_ctx.error)) {
 6569|  2.23M|               value = std::move(v);
 6570|  2.23M|               ctx.anchors = std::move(temp_ctx.anchors);
 6571|  2.23M|               return true;
 6572|  2.23M|            }
 6573|       |
 6574|  2.23M|            if (temp_ctx.error == error_code::exceeded_max_expansion && expansion_error == error_code::none) {
 6575|  2.23M|               expansion_error = temp_ctx.error;
 6576|  2.23M|               expansion_message = temp_ctx.custom_error_message;
 6577|  2.23M|            }
 6578|  2.23M|            it = start;
 6579|  2.23M|            return false;
 6580|  2.23M|         };
 6581|       |
 6582|  2.23M|         bool parsed = false;
 6583|  2.23M|         [&]<size_t... Is>(std::index_sequence<Is...>) {
 6584|  2.23M|            ((parsed = parsed || try_parse.template operator()<Is>()), ...);
 6585|  2.23M|         }(std::make_index_sequence<N>{});
 6586|       |
 6587|  2.23M|         if (!parsed) {
  ------------------
  |  Branch (6587:14): [True: 0, False: 2.23M]
  ------------------
 6588|      0|            if (expansion_error != error_code::none) {
  ------------------
  |  Branch (6588:17): [True: 0, False: 0]
  ------------------
 6589|      0|               ctx.error = expansion_error;
 6590|      0|               ctx.custom_error_message = expansion_message;
 6591|      0|            }
 6592|      0|            else {
 6593|      0|               ctx.error = error_code::no_matching_variant_type;
 6594|      0|            }
 6595|      0|         }
 6596|  2.23M|      }
_ZN3glz33process_yaml_variant_alternativesINSt3__17variantIJDndNS1_12basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEbNS1_6vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS6_ISD_EEEENSC_ISD_EEEEENS_22is_yaml_variant_objectEE2opITnDaXtlNS_4optsELj10ELb1ELb0ELb0ELb1EEERSH_TkNS_10is_contextERNS_4yaml12yaml_contextERPKcSR_EEvOT0_OT1_OT2_T3_:
 5205|   914k|      {
 5206|   914k|         constexpr auto category_count = yaml_variant_count_v<Variant, Trait>;
 5207|       |
 5208|       |         if constexpr (category_count == 0) {
 5209|       |            ctx.error = error_code::no_matching_variant_type;
 5210|       |         }
 5211|   914k|         else if constexpr (category_count == 1) {
 5212|       |            // Only one type in this category, use it directly
 5213|   914k|            constexpr auto first_idx = yaml_variant_first_index_v<Variant, Trait>;
 5214|   914k|            using V = std::variant_alternative_t<first_idx, Variant>;
 5215|   914k|            if (!std::holds_alternative<V>(value)) value = V{};
  ------------------
  |  Branch (5215:17): [True: 914k, False: 0]
  ------------------
 5216|   914k|            from<YAML, V>::template op<Opts>(std::get<V>(value), ctx, it, end);
 5217|       |         }
 5218|       |         else {
 5219|       |            // Multiple types in this category, try each one
 5220|       |            constexpr auto N = std::variant_size_v<Variant>;
 5221|       |            bool found_match{};
 5222|       |            size_t match_idx = 0;
 5223|       |            // Only the last alternative propagates its error, so an alternative that exhausted an
 5224|       |            // expansion budget would otherwise be reported as no_matching_variant_type -- a wrong
 5225|       |            // diagnosis for a document that is hostile rather than merely the wrong shape. Held
 5226|       |            // aside and used only if nothing matched, so an alternative that does succeed later
 5227|       |            // (one that materializes no key text can still parse under a latched budget) is
 5228|       |            // unaffected.
 5229|       |            error_code expansion_error{};
 5230|       |            std::string_view expansion_message{};
 5231|       |
 5232|       |            for_each<N>([&]<size_t I>() {
 5233|       |               if (found_match) {
 5234|       |                  return;
 5235|       |               }
 5236|       |               using V = std::variant_alternative_t<I, Variant>;
 5237|       |               if constexpr (Trait<V>::value) {
 5238|       |                  auto copy_it = it;
 5239|       |                  if (!std::holds_alternative<V>(value)) {
 5240|       |                     value = V{};
 5241|       |                  }
 5242|       |
 5243|       |                  auto temp_ctx = ctx.make_speculative();
 5244|       |                  from<YAML, V>::template op<Opts>(std::get<V>(value), temp_ctx, it, end);
 5245|       |
 5246|       |                  // Charged whether or not the alternative fit: a rejected probe still replayed
 5247|       |                  // whatever aliases it reached, and an attempt that is never billed is an
 5248|       |                  // attempt that can be repeated for free.
 5249|       |                  ctx.alias_expansion_budget = temp_ctx.alias_expansion_budget;
 5250|       |                  ctx.key_expansion_budget = temp_ctx.key_expansion_budget;
 5251|       |
 5252|       |                  if (!bool(temp_ctx.error)) {
 5253|       |                     found_match = true;
 5254|       |                     ctx.anchors = std::move(temp_ctx.anchors);
 5255|       |                  }
 5256|       |                  else {
 5257|       |                     it = copy_it;
 5258|       |                     if (temp_ctx.error == error_code::exceeded_max_expansion && expansion_error == error_code::none) {
 5259|       |                        expansion_error = temp_ctx.error;
 5260|       |                        expansion_message = temp_ctx.custom_error_message;
 5261|       |                     }
 5262|       |                     if (match_idx + 1 < category_count) {
 5263|       |                        // Not the last type, continue trying
 5264|       |                     }
 5265|       |                     else {
 5266|       |                        // Last type failed, propagate error
 5267|       |                        ctx.error = temp_ctx.error;
 5268|       |                        ctx.custom_error_message = temp_ctx.custom_error_message;
 5269|       |                     }
 5270|       |                  }
 5271|       |                  ++match_idx;
 5272|       |               }
 5273|       |            });
 5274|       |
 5275|       |            if (!found_match && !bool(ctx.error)) {
 5276|       |               if (expansion_error != error_code::none) {
 5277|       |                  ctx.error = expansion_error;
 5278|       |                  ctx.custom_error_message = expansion_message;
 5279|       |               }
 5280|       |               else {
 5281|       |                  ctx.error = error_code::no_matching_variant_type;
 5282|       |               }
 5283|       |            }
 5284|       |         }
 5285|   914k|      }
_ZN3glz4fromILj450ENS_17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES1_EEEEE2opITnDaXtlNS_4optsELj10ELb1ELb0ELb0ELb1EEERPKcRS5_TkNS_10is_contextERNS_4yaml12yaml_contextESA_EEvOT1_OT2_OT0_T3_:
 4515|   917k|      {
 4516|   917k|         if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4516:14): [True: 0, False: 917k]
  ------------------
 4517|      0|            return;
 4518|       |
 4519|   917k|         yaml::node_preamble_state preamble{};
 4520|   917k|         if (yaml::parse_node_preamble<Opts, yaml::node_property_policy{true, true, false, false}>(
  ------------------
  |  Branch (4520:14): [True: 3.35k, False: 914k]
  ------------------
 4521|   917k|                value, ctx, it, end, preamble, [](yaml::yaml_tag tag) { return yaml::tag_valid_for_map(tag); }))
 4522|  3.35k|            return;
 4523|       |
 4524|   914k|         using key_t = typename std::remove_cvref_t<T>::key_type;
 4525|   914k|         using val_t = typename std::remove_cvref_t<T>::mapped_type;
 4526|       |
 4527|       |         // Reading a YAML mapping MERGES into the target: an entry overwrites the
 4528|       |         // value of a key that existed before the read and adds new keys, while
 4529|       |         // pre-existing keys the document does not mention are preserved (like a
 4530|       |         // struct/object read, and like json/read.hpp's per-key value[key]).
 4531|       |         // Within a single document a repeated key keeps its FIRST value -- YAML
 4532|       |         // mappings disallow duplicate keys and the conformance suite expects
 4533|       |         // first-wins, which falls out of emplace into an empty map. Any
 4534|       |         // pre-existing entry the document leaves untouched is restored on scope
 4535|       |         // exit (including error paths). When the target starts empty (the common
 4536|       |         // case) this is a no-op with negligible cost.
 4537|   914k|         std::remove_cvref_t<T> preexisting_entries;
 4538|   914k|         if (!value.empty()) {
  ------------------
  |  Branch (4538:14): [True: 0, False: 914k]
  ------------------
 4539|      0|            preexisting_entries = std::move(value);
 4540|      0|            value.clear();
 4541|      0|         }
 4542|   914k|         struct merge_restore_guard
 4543|   914k|         {
 4544|   914k|            std::remove_cvref_t<T>& target;
 4545|   914k|            std::remove_cvref_t<T>& saved;
 4546|   914k|            ~merge_restore_guard()
 4547|   914k|            {
 4548|       |               // emplace is a no-op for keys the document already wrote, so only
 4549|       |               // untouched pre-existing entries are put back.
 4550|   914k|               for (auto& entry : saved) {
 4551|   914k|                  target.emplace(entry.first, std::move(entry.second));
 4552|   914k|               }
 4553|   914k|            }
 4554|   914k|         } merge_restore{value, preexisting_entries};
 4555|       |
 4556|   914k|         const bool treat_as_block_mapping =
 4557|   914k|            !yaml::check_flow_context(Opts) && *it == '{' && yaml::inline_value_has_plain_mapping_indicator(it, end);
  ------------------
  |  Branch (4557:13): [True: 914k, Folded]
  |  Branch (4557:48): [True: 224k, False: 689k]
  |  Branch (4557:62): [True: 1.65k, False: 222k]
  ------------------
 4558|       |
 4559|   914k|         if (*it == '{' && !treat_as_block_mapping) {
  ------------------
  |  Branch (4559:14): [True: 224k, False: 689k]
  |  Branch (4559:28): [True: 222k, False: 1.65k]
  ------------------
 4560|       |            // Flow mapping
 4561|   222k|            ++it;
 4562|       |            // Skip whitespace and newlines after opening brace
 4563|   222k|            yaml::skip_ws_and_newlines(it, end);
 4564|       |
 4565|   222k|            if (it != end && *it == '}') {
  ------------------
  |  Branch (4565:17): [True: 220k, False: 2.15k]
  |  Branch (4565:30): [True: 5.51k, False: 215k]
  ------------------
 4566|  5.51k|               ++it;
 4567|  5.51k|               yaml::validate_flow_node_adjacent_tail(ctx, it, end);
 4568|  5.51k|               if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4568:20): [True: 6, False: 5.50k]
  ------------------
 4569|      6|                  return;
 4570|  5.50k|               yaml::finalize_node_anchor(preamble.node_props, ctx, it);
 4571|  5.50k|               return;
 4572|  5.51k|            }
 4573|       |
 4574|   721k|            while (it != end) {
  ------------------
  |  Branch (4574:20): [True: 717k, False: 4.38k]
  ------------------
 4575|       |               // Skip whitespace and newlines at start of each iteration
 4576|   717k|               yaml::skip_ws_and_newlines(it, end);
 4577|       |
 4578|   717k|               if (it != end && *it == '}') {
  ------------------
  |  Branch (4578:20): [True: 717k, False: 0]
  |  Branch (4578:33): [True: 11.1k, False: 705k]
  ------------------
 4579|  11.1k|                  ++it;
 4580|  11.1k|                  yaml::validate_flow_node_adjacent_tail(ctx, it, end);
 4581|  11.1k|                  if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4581:23): [True: 10, False: 11.1k]
  ------------------
 4582|     10|                     return;
 4583|  11.1k|                  break;
 4584|  11.1k|               }
 4585|       |
 4586|   705k|               bool explicit_flow_key = false;
 4587|   705k|               auto explicit_probe = it;
 4588|   705k|               yaml::skip_inline_ws(explicit_probe, end);
 4589|   705k|               if (explicit_probe != end && *explicit_probe == '?') {
  ------------------
  |  Branch (4589:20): [True: 705k, False: 0]
  |  Branch (4589:45): [True: 16.3k, False: 689k]
  ------------------
 4590|  16.3k|                  const auto after_q = explicit_probe + 1;
 4591|  16.3k|                  if (after_q == end || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*after_q)] ||
  ------------------
  |  Branch (4591:23): [True: 10, False: 16.3k]
  |  Branch (4591:41): [True: 7.51k, False: 8.80k]
  ------------------
 4592|  9.81k|                      *after_q == ',' || *after_q == '}') {
  ------------------
  |  Branch (4592:23): [True: 1.91k, False: 6.88k]
  |  Branch (4592:42): [True: 374, False: 6.51k]
  ------------------
 4593|  9.81k|                     explicit_flow_key = true;
 4594|  9.81k|                     it = explicit_probe + 1;
 4595|  9.81k|                     yaml::skip_flow_ws_and_newlines(ctx, it, end);
 4596|  9.81k|                     if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4596:26): [True: 6, False: 9.81k]
  ------------------
 4597|      6|                        return;
 4598|  9.81k|                  }
 4599|  16.3k|               }
 4600|       |               // Parse key
 4601|   705k|               key_t key{};
 4602|   705k|               if constexpr (std::same_as<std::remove_cvref_t<key_t>, std::string>) {
 4603|   705k|                  if (explicit_flow_key && it != end && (*it == ':' || *it == ',' || *it == '}')) {
  ------------------
  |  Branch (4603:23): [True: 9.81k, False: 696k]
  |  Branch (4603:44): [True: 9.79k, False: 12]
  |  Branch (4603:58): [True: 398, False: 9.40k]
  |  Branch (4603:72): [True: 1.91k, False: 7.48k]
  |  Branch (4603:86): [True: 1.53k, False: 5.95k]
  ------------------
 4604|  3.84k|                     key.clear();
 4605|  3.84k|                  }
 4606|   702k|                  else {
 4607|   702k|                     auto key_probe = it;
 4608|   702k|                     yaml::skip_inline_ws(key_probe, end);
 4609|       |
 4610|       |                     // Use full node parsing only for structurally complex flow keys.
 4611|       |                     // Plain/quoted/alias keys stay on parse_yaml_key() for compatibility.
 4612|   702k|                     bool parse_complex_flow_key = false;
 4613|   702k|                     if (key_probe != end) {
  ------------------
  |  Branch (4613:26): [True: 702k, False: 12]
  ------------------
 4614|   702k|                        if (*key_probe == '[' || *key_probe == '{') {
  ------------------
  |  Branch (4614:29): [True: 992, False: 701k]
  |  Branch (4614:50): [True: 4.46k, False: 696k]
  ------------------
 4615|  5.45k|                           parse_complex_flow_key = true;
 4616|  5.45k|                        }
 4617|   696k|                        else if (*key_probe == '&') {
  ------------------
  |  Branch (4617:34): [True: 176k, False: 519k]
  ------------------
 4618|   176k|                           ++key_probe;
 4619|   176k|                           yaml::parse_anchor_name(key_probe, end);
 4620|   176k|                           yaml::skip_inline_ws(key_probe, end);
 4621|   176k|                           if (key_probe != end && (*key_probe == '[' || *key_probe == '{')) {
  ------------------
  |  Branch (4621:32): [True: 176k, False: 34]
  |  Branch (4621:53): [True: 1.22k, False: 175k]
  |  Branch (4621:74): [True: 122k, False: 52.8k]
  ------------------
 4622|   124k|                              parse_complex_flow_key = true;
 4623|   124k|                           }
 4624|   176k|                        }
 4625|   702k|                     }
 4626|       |
 4627|   702k|                     if (parse_complex_flow_key) {
  ------------------
  |  Branch (4627:26): [True: 129k, False: 572k]
  ------------------
 4628|   129k|                        glz::generic key_node{};
 4629|   129k|                        from<YAML, glz::generic>::template op<yaml::flow_context_on<Opts>()>(key_node, ctx, it, end);
 4630|   129k|                        if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4630:29): [True: 2.58k, False: 126k]
  ------------------
 4631|  2.58k|                           return;
 4632|   126k|                        if (!yaml::materialize_key(key, key_node, ctx)) [[unlikely]]
  ------------------
  |  Branch (4632:29): [True: 6, False: 126k]
  ------------------
 4633|      6|                           return;
 4634|   126k|                     }
 4635|   572k|                     else {
 4636|   572k|                        if (!yaml::parse_yaml_key(key, ctx, it, end, true)) {
  ------------------
  |  Branch (4636:29): [True: 8.72k, False: 563k]
  ------------------
 4637|  8.72k|                           return;
 4638|  8.72k|                        }
 4639|   572k|                     }
 4640|   702k|                  }
 4641|       |               }
 4642|       |               else {
 4643|       |                  if (explicit_flow_key && it != end && (*it == ':' || *it == ',' || *it == '}')) {
 4644|       |                     ctx.error = error_code::syntax_error;
 4645|       |                     return;
 4646|       |                  }
 4647|       |                  from<YAML, key_t>::template op<yaml::flow_context_on<Opts>()>(key, ctx, it, end);
 4648|       |                  if (bool(ctx.error)) [[unlikely]]
 4649|       |                     return;
 4650|       |               }
 4651|       |
 4652|       |               // Separation between flow key and ':' may include comments/newlines.
 4653|       |               // In flow context, newlines are allowed between key and ':'.
 4654|   694k|               yaml::skip_flow_ws_and_newlines(ctx, it, end);
 4655|   705k|               if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4655:20): [True: 6, False: 705k]
  ------------------
 4656|      6|                  return;
 4657|       |
 4658|   705k|               auto parse_implicit_null = [&](val_t& val) -> bool {
 4659|   705k|                  if constexpr (nullable_like<std::remove_cvref_t<val_t>>) {
 4660|   705k|                     val = {};
 4661|   705k|                     return true;
 4662|   705k|                  }
 4663|   705k|                  else if constexpr (std::same_as<std::remove_cvref_t<val_t>, glz::generic>) {
 4664|   705k|                     val = glz::generic{};
 4665|   705k|                     return true;
 4666|   705k|                  }
 4667|   705k|                  else {
 4668|   705k|                     static constexpr std::string_view null_value{"null"};
 4669|   705k|                     auto null_it = null_value.data();
 4670|   705k|                     from<YAML, val_t>::template op<yaml::flow_context_on<Opts>()>(
 4671|   705k|                        val, ctx, null_it, null_value.data() + null_value.size());
 4672|   705k|                     return !bool(ctx.error);
 4673|   705k|                  }
 4674|   705k|               };
 4675|       |
 4676|   705k|               if (it != end && (*it == ',' || *it == '}')) {
  ------------------
  |  Branch (4676:20): [True: 694k, False: 11.4k]
  |  Branch (4676:34): [True: 452k, False: 242k]
  |  Branch (4676:48): [True: 41.1k, False: 201k]
  ------------------
 4677|   493k|                  val_t val{};
 4678|   493k|                  if (!parse_implicit_null(val)) [[unlikely]]
  ------------------
  |  Branch (4678:23): [True: 0, False: 493k]
  ------------------
 4679|      0|                     return;
 4680|       |
 4681|   493k|                  value.emplace(std::move(key), std::move(val));
 4682|       |
 4683|   493k|                  if (*it == '}') {
  ------------------
  |  Branch (4683:23): [True: 41.1k, False: 452k]
  ------------------
 4684|  41.1k|                     ++it;
 4685|  41.1k|                     yaml::validate_flow_node_adjacent_tail(ctx, it, end);
 4686|  41.1k|                     if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4686:26): [True: 12, False: 41.1k]
  ------------------
 4687|     12|                        return;
 4688|  41.1k|                     break;
 4689|  41.1k|                  }
 4690|       |
 4691|   452k|                  ++it; // skip comma
 4692|   452k|                  yaml::skip_ws_and_newlines(it, end);
 4693|   452k|                  continue;
 4694|   493k|               }
 4695|       |
 4696|   212k|               if (it == end || *it != ':') {
  ------------------
  |  Branch (4696:20): [True: 11.4k, False: 201k]
  |  Branch (4696:33): [True: 56, False: 201k]
  ------------------
 4697|    154|                  ctx.error = error_code::syntax_error;
 4698|    154|                  return;
 4699|    154|               }
 4700|   212k|               ++it;
 4701|       |
 4702|   212k|               yaml::skip_flow_ws_and_newlines(ctx, it, end);
 4703|   212k|               if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4703:20): [True: 6, False: 212k]
  ------------------
 4704|      6|                  return;
 4705|       |
 4706|       |               // Omitted value after an explicit ':' maps to an implicit null.
 4707|   212k|               if (it != end && (*it == ',' || *it == '}')) {
  ------------------
  |  Branch (4707:20): [True: 201k, False: 11.3k]
  |  Branch (4707:34): [True: 6.20k, False: 194k]
  |  Branch (4707:48): [True: 15.9k, False: 178k]
  ------------------
 4708|  22.1k|                  val_t val{};
 4709|  22.1k|                  if (!parse_implicit_null(val)) [[unlikely]]
  ------------------
  |  Branch (4709:23): [True: 0, False: 22.1k]
  ------------------
 4710|      0|                     return;
 4711|       |
 4712|  22.1k|                  value.emplace(std::move(key), std::move(val));
 4713|       |
 4714|  22.1k|                  if (*it == '}') {
  ------------------
  |  Branch (4714:23): [True: 15.9k, False: 6.20k]
  ------------------
 4715|  15.9k|                     ++it;
 4716|  15.9k|                     yaml::validate_flow_node_adjacent_tail(ctx, it, end);
 4717|  15.9k|                     if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4717:26): [True: 8, False: 15.9k]
  ------------------
 4718|      8|                        return;
 4719|  15.9k|                     break;
 4720|  15.9k|                  }
 4721|       |
 4722|  6.20k|                  ++it; // skip comma
 4723|  6.20k|                  yaml::skip_ws_and_newlines(it, end);
 4724|  6.20k|                  continue;
 4725|  22.1k|               }
 4726|       |
 4727|       |               // Parse value
 4728|   190k|               val_t val{};
 4729|   190k|               from<YAML, val_t>::template op<yaml::flow_context_on<Opts>()>(val, ctx, it, end);
 4730|   190k|               if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4730:20): [True: 434, False: 189k]
  ------------------
 4731|    434|                  return;
 4732|       |
 4733|   189k|               value.emplace(std::move(key), std::move(val));
 4734|       |
 4735|   189k|               yaml::skip_inline_ws(it, end);
 4736|       |
 4737|   189k|               if (it != end && *it == '}') {
  ------------------
  |  Branch (4737:20): [True: 178k, False: 11.3k]
  |  Branch (4737:33): [True: 132k, False: 46.2k]
  ------------------
 4738|   132k|                  ++it;
 4739|   132k|                  yaml::validate_flow_node_adjacent_tail(ctx, it, end);
 4740|   132k|                  if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4740:23): [True: 6, False: 132k]
  ------------------
 4741|      6|                     return;
 4742|   132k|                  break;
 4743|   132k|               }
 4744|  57.5k|               else if (it != end && *it == ',') {
  ------------------
  |  Branch (4744:25): [True: 46.2k, False: 11.3k]
  |  Branch (4744:38): [True: 39.8k, False: 6.39k]
  ------------------
 4745|  39.8k|                  ++it;
 4746|       |                  // Skip whitespace and newlines after comma
 4747|  39.8k|                  yaml::skip_ws_and_newlines(it, end);
 4748|  39.8k|               }
 4749|  17.7k|               else if (it != end && (*it == '\n' || *it == '\r')) {
  ------------------
  |  Branch (4749:25): [True: 6.39k, False: 11.3k]
  |  Branch (4749:39): [True: 5.14k, False: 1.24k]
  |  Branch (4749:54): [True: 1.22k, False: 24]
  ------------------
 4750|       |                  // Newlines may precede either the closing brace or the
 4751|       |                  // separator comma for the next entry.
 4752|  6.36k|                  yaml::skip_ws_and_newlines(it, end);
 4753|  6.36k|                  if (it != end && *it == '}') {
  ------------------
  |  Branch (4753:23): [True: 6.36k, False: 6]
  |  Branch (4753:36): [True: 606, False: 5.75k]
  ------------------
 4754|    606|                     ++it;
 4755|    606|                     yaml::validate_flow_node_adjacent_tail(ctx, it, end);
 4756|    606|                     if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4756:26): [True: 6, False: 600]
  ------------------
 4757|      6|                        return;
 4758|    600|                     break;
 4759|    606|                  }
 4760|  5.76k|                  if (it != end && *it == ',') {
  ------------------
  |  Branch (4760:23): [True: 5.75k, False: 6]
  |  Branch (4760:36): [True: 5.74k, False: 10]
  ------------------
 4761|  5.74k|                     ++it;
 4762|  5.74k|                     yaml::skip_ws_and_newlines(it, end);
 4763|  5.74k|                     continue;
 4764|  5.74k|                  }
 4765|     16|                  ctx.error = error_code::syntax_error;
 4766|     16|                  return;
 4767|  5.76k|               }
 4768|  11.4k|               else {
 4769|  11.4k|                  ctx.error = error_code::syntax_error;
 4770|  11.4k|                  return;
 4771|  11.4k|               }
 4772|   189k|            }
 4773|   217k|         }
 4774|   691k|         else {
 4775|       |            // Block mapping - use shared loop with map-specific callback
 4776|   691k|            yaml::parse_block_mapping_loop<Opts>(
 4777|   691k|               ctx, it, end, int32_t(-1), [&](auto& ctx, auto& it, auto end, int32_t line_indent) -> bool {
 4778|   691k|                  auto parse_map_value = [&](val_t& val) -> bool {
 4779|   691k|                     if (it != end && !yaml::line_end_or_comment_table[static_cast<uint8_t>(*it)]) {
 4780|   691k|                        bool line_starts_with_explicit_value_indicator = false;
 4781|       |
 4782|       |                        // Inline mapping values in block context cannot start with a
 4783|       |                        // plain "key: value" pair on the same line (e.g. "a: b: c").
 4784|       |                        // Such constructs are malformed unless wrapped in flow
 4785|       |                        // delimiters ({...} / [...]) or quoted.
 4786|   691k|                        if constexpr (std::is_pointer_v<std::decay_t<decltype(it)>>) {
 4787|   691k|                           if (ctx.stream_begin) {
 4788|   691k|                              auto is_line_content_start = [&](auto pos) {
 4789|   691k|                                 return !ctx.line_prefix_before(pos).has_content;
 4790|   691k|                              };
 4791|       |
 4792|   691k|                              auto line_has_explicit_value_indicator = [&](auto pos) {
 4793|   691k|                                 const char* line = ctx.line_begin_of(pos);
 4794|   691k|                                 while (line != end && (*line == ' ' || *line == '\t')) ++line;
 4795|   691k|                                 return line != end && *line == ':';
 4796|   691k|                              };
 4797|       |
 4798|   691k|                              if (!is_line_content_start(it) &&
 4799|   691k|                                  yaml::inline_value_has_plain_mapping_indicator(it, end) &&
 4800|   691k|                                  !line_has_explicit_value_indicator(it)) {
 4801|   691k|                                 ctx.error = error_code::syntax_error;
 4802|   691k|                                 return false;
 4803|   691k|                              }
 4804|   691k|                              line_starts_with_explicit_value_indicator = line_has_explicit_value_indicator(it);
 4805|   691k|                           }
 4806|   691k|                        }
 4807|       |
 4808|   691k|                        if (*it == '-' &&
 4809|   691k|                            ((it + 1) == end || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*(it + 1))]) &&
 4810|   691k|                            !line_starts_with_explicit_value_indicator) {
 4811|       |                           // "key: - item" is not valid block sequence syntax.
 4812|   691k|                           ctx.error = error_code::syntax_error;
 4813|   691k|                           return false;
 4814|   691k|                        }
 4815|       |
 4816|   691k|                        if (!ctx.push_indent(line_indent + 1)) [[unlikely]]
 4817|   691k|                           return false;
 4818|   691k|                        from<YAML, val_t>::template op<Opts>(val, ctx, it, end);
 4819|   691k|                        ctx.pop_indent();
 4820|   691k|                     }
 4821|   691k|                     else {
 4822|   691k|                        int32_t nested_indent = yaml::detect_nested_value_indent(ctx, it, end, line_indent);
 4823|   691k|                        if (nested_indent >= 0) {
 4824|   691k|                           yaml::skip_to_content(it, end);
 4825|   691k|                           if (it != end && *it == ':' && (it + 1) != end && *(it + 1) == '\t') {
 4826|   691k|                              ctx.error = error_code::syntax_error;
 4827|   691k|                              return false;
 4828|   691k|                           }
 4829|       |                           // A struct value reads the pushed indent as its own key column;
 4830|       |                           // every other value type reads it as the enclosing baseline.
 4831|   691k|                           const int32_t value_indent =
 4832|   691k|                              yaml::receives_block_mapping_column<val_t>() ? nested_indent : nested_indent - 1;
 4833|   691k|                           if (!ctx.push_indent(value_indent)) [[unlikely]]
 4834|   691k|                              return false;
 4835|   691k|                           from<YAML, val_t>::template op<Opts>(val, ctx, it, end);
 4836|   691k|                           ctx.pop_indent();
 4837|   691k|                        }
 4838|   691k|                     }
 4839|   691k|                     return !bool(ctx.error);
 4840|   691k|                  };
 4841|       |
 4842|       |                  // Explicit key entry form:
 4843|       |                  // ? key
 4844|       |                  // : value
 4845|   691k|                  if (*it == '?' && ((it + 1) != end) && *(it + 1) == '\t') {
 4846|   691k|                     ctx.error = error_code::syntax_error;
 4847|   691k|                     return false;
 4848|   691k|                  }
 4849|   691k|                  if (*it == '?' && ((it + 1) == end || *(it + 1) == ' ' || *(it + 1) == '\n' || *(it + 1) == '\r')) {
 4850|   691k|                     ++it; // skip '?'
 4851|   691k|                     yaml::skip_inline_ws(it, end);
 4852|       |
 4853|   691k|                     const int32_t explicit_value_indicator_indent =
 4854|   691k|                        (ctx.current_indent() < 0) ? 0 : (ctx.current_indent() + 1);
 4855|       |
 4856|   691k|                     key_t key{};
 4857|   691k|                     if constexpr (std::same_as<std::remove_cvref_t<key_t>, std::string>) {
 4858|   691k|                        auto to_string_key = [&](glz::generic& key_node) {
 4859|   691k|                           return yaml::materialize_key(key, key_node, ctx);
 4860|   691k|                        };
 4861|       |
 4862|   691k|                        auto key_it = it;
 4863|   691k|                        yaml::skip_inline_ws(key_it, end);
 4864|       |
 4865|   691k|                        auto content = key_it;
 4866|   691k|                        yaml::skip_to_content(content, end);
 4867|   691k|                        bool handled_anchor_only_empty_key = false;
 4868|       |
 4869|       |                        // Anchor on an empty explicit key node:
 4870|       |                        //   ? &a
 4871|       |                        //   : value
 4872|   691k|                        if (content != end && *content == '&') {
 4873|   691k|                           auto anchor_probe = content + 1;
 4874|   691k|                           auto anchor_name = yaml::parse_anchor_name(anchor_probe, end);
 4875|   691k|                           if (!anchor_name.empty()) {
 4876|   691k|                              auto after_anchor = anchor_probe;
 4877|   691k|                              yaml::skip_inline_ws(after_anchor, end);
 4878|       |
 4879|   691k|                              auto value_indicator = after_anchor;
 4880|   691k|                              if (value_indicator != end && *value_indicator == ':') {
 4881|   691k|                                 key.clear();
 4882|   691k|                                 ctx.anchors[std::string(anchor_name)] = {content, content, ctx.current_indent()};
 4883|   691k|                                 it = value_indicator;
 4884|   691k|                                 handled_anchor_only_empty_key = true;
 4885|   691k|                              }
 4886|   691k|                              else {
 4887|   691k|                                 if (value_indicator != end && *value_indicator == '#') {
 4888|   691k|                                    yaml::skip_comment(value_indicator, end);
 4889|   691k|                                 }
 4890|   691k|                                 if (value_indicator != end && (*value_indicator == '\n' || *value_indicator == '\r')) {
 4891|   691k|                                    yaml::skip_newline(value_indicator, end);
 4892|   691k|                                    auto value_line = value_indicator;
 4893|   691k|                                    int32_t value_indent = yaml::measure_indent(value_line, end, ctx);
 4894|   691k|                                    if (bool(ctx.error)) [[unlikely]]
 4895|   691k|                                       return false;
 4896|   691k|                                    if (value_line != end && *value_line == ':' &&
 4897|   691k|                                        value_indent == explicit_value_indicator_indent) {
 4898|   691k|                                       key.clear();
 4899|   691k|                                       ctx.anchors[std::string(anchor_name)] = {content, content, ctx.current_indent()};
 4900|   691k|                                       it = value_line;
 4901|   691k|                                       handled_anchor_only_empty_key = true;
 4902|   691k|                                    }
 4903|   691k|                                    else if (value_line != end && *value_line == ':') {
 4904|       |                                       // In explicit-key form ("? &a"), a following ':'
 4905|       |                                       // starts the outer value indicator only at the same
 4906|       |                                       // indentation. A deeper-indented ': value' is malformed.
 4907|   691k|                                       ctx.error = error_code::syntax_error;
 4908|   691k|                                       return false;
 4909|   691k|                                    }
 4910|   691k|                                 }
 4911|   691k|                              }
 4912|   691k|                           }
 4913|   691k|                        }
 4914|       |
 4915|   691k|                        const bool key_content_spans_lines = [&] {
 4916|   691k|                           auto scan = key_it;
 4917|   691k|                           while (scan != content && scan != end) {
 4918|   691k|                              if (*scan == '\n' || *scan == '\r') return true;
 4919|   691k|                              ++scan;
 4920|   691k|                           }
 4921|   691k|                           return false;
 4922|   691k|                        }();
 4923|       |
 4924|   691k|                        if (handled_anchor_only_empty_key) {
 4925|       |                           // 'it' already points to the explicit value indicator ':'
 4926|   691k|                        }
 4927|   691k|                        else if (content == end || (*content == ':' && key_content_spans_lines)) {
 4928|   691k|                           key.clear();
 4929|   691k|                           it = content;
 4930|   691k|                        }
 4931|   691k|                        else {
 4932|       |                           // Explicit mapping keys ('? key-node') are full YAML nodes.
 4933|       |                           // Parse the key node structurally (not via plain-key scanning)
 4934|       |                           // so inputs like '? []: x' and '? JSON: like' are interpreted
 4935|       |                           // as complex keys, not split into implicit key/value pairs.
 4936|   691k|                           auto key_node_it = content;
 4937|   691k|                           auto key_node_end = end;
 4938|   691k|                           if constexpr (std::is_pointer_v<std::decay_t<It>>) {
 4939|       |                              // In explicit-key form, a following standalone ':'
 4940|       |                              // line (same or lower indentation) belongs to the
 4941|       |                              // outer mapping value, not the key node itself.
 4942|   691k|                              auto scan = content;
 4943|   691k|                              while (scan != end) {
 4944|   691k|                                 while (scan != end && *scan != '\n' && *scan != '\r') {
 4945|   691k|                                    ++scan;
 4946|   691k|                                 }
 4947|   691k|                                 if (scan == end) {
 4948|   691k|                                    break;
 4949|   691k|                                 }
 4950|       |
 4951|   691k|                                 yaml::skip_newline(scan, end);
 4952|   691k|                                 auto line_start = scan;
 4953|       |
 4954|   691k|                                 int32_t indicator_indent = 0;
 4955|   691k|                                 while (scan != end && *scan == ' ') {
 4956|   691k|                                    ++indicator_indent;
 4957|   691k|                                    ++scan;
 4958|   691k|                                 }
 4959|       |
 4960|   691k|                                 if (scan != end && *scan == ':') {
 4961|   691k|                                    const auto after_colon = scan + 1;
 4962|   691k|                                    if ((after_colon == end ||
 4963|   691k|                                         yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*after_colon)]) &&
 4964|   691k|                                        indicator_indent <= line_indent) {
 4965|   691k|                                       key_node_end = line_start;
 4966|   691k|                                       break;
 4967|   691k|                                    }
 4968|   691k|                                 }
 4969|   691k|                              }
 4970|   691k|                           }
 4971|       |
 4972|   691k|                           glz::generic key_node{};
 4973|   691k|                           const bool prev_explicit_mapping_key_context = ctx.explicit_mapping_key_context;
 4974|   691k|                           ctx.explicit_mapping_key_context = true;
 4975|   691k|                           from<YAML, glz::generic>::template op<Opts>(key_node, ctx, key_node_it, key_node_end);
 4976|   691k|                           ctx.explicit_mapping_key_context = prev_explicit_mapping_key_context;
 4977|   691k|                           if (bool(ctx.error)) [[unlikely]]
 4978|   691k|                              return false;
 4979|   691k|                           it = key_node_it;
 4980|   691k|                           if (!to_string_key(key_node)) [[unlikely]]
 4981|   691k|                              return false;
 4982|   691k|                        }
 4983|   691k|                     }
 4984|   691k|                     else {
 4985|   691k|                        if (it != end && !yaml::line_end_or_comment_table[static_cast<uint8_t>(*it)]) {
 4986|   691k|                           from<YAML, key_t>::template op<Opts>(key, ctx, it, end);
 4987|   691k|                           if (bool(ctx.error)) [[unlikely]]
 4988|   691k|                              return false;
 4989|   691k|                        }
 4990|   691k|                     }
 4991|       |
 4992|   691k|                     yaml::skip_inline_ws(it, end);
 4993|   691k|                     yaml::skip_comment(it, end);
 4994|       |
 4995|       |                     // Value indicator may appear on the next line at the same indent.
 4996|   691k|                     if (it != end && (*it == '\n' || *it == '\r')) {
 4997|   691k|                        auto probe = it;
 4998|   691k|                        bool found_value_indicator = false;
 4999|       |
 5000|   691k|                        while (probe != end && (*probe == '\n' || *probe == '\r')) {
 5001|   691k|                           yaml::skip_newline(probe, end);
 5002|       |
 5003|   691k|                           auto value_line = probe;
 5004|   691k|                           int32_t value_indent = yaml::measure_indent(value_line, end, ctx);
 5005|   691k|                           if (bool(ctx.error)) [[unlikely]]
 5006|   691k|                              return false;
 5007|       |
 5008|   691k|                           if (value_line == end || *value_line == '\n' || *value_line == '\r') {
 5009|   691k|                              probe = value_line;
 5010|   691k|                              continue; // blank line
 5011|   691k|                           }
 5012|   691k|                           if (*value_line == '#') {
 5013|   691k|                              yaml::skip_comment(value_line, end);
 5014|   691k|                              probe = value_line;
 5015|   691k|                              continue; // comment-only line
 5016|   691k|                           }
 5017|   691k|                           if (*value_line == ':' && value_indent == explicit_value_indicator_indent) {
 5018|   691k|                              it = value_line;
 5019|   691k|                              found_value_indicator = true;
 5020|   691k|                           }
 5021|   691k|                           break;
 5022|   691k|                        }
 5023|       |
 5024|   691k|                        if (found_value_indicator) {
 5025|   691k|                           yaml::skip_inline_ws(it, end);
 5026|   691k|                        }
 5027|   691k|                     }
 5028|       |
 5029|   691k|                     val_t val{};
 5030|   691k|                     if (it != end && *it == ':') {
 5031|   691k|                        ++it;
 5032|   691k|                        if (it != end && *it == '\t') {
 5033|   691k|                           ctx.error = error_code::syntax_error;
 5034|   691k|                           return false;
 5035|   691k|                        }
 5036|   691k|                        if (it != end && (*it == '\n' || *it == '\r')) {
 5037|   691k|                           auto probe = it;
 5038|   691k|                           yaml::skip_newline(probe, end);
 5039|   691k|                           while (probe != end && *probe == ' ') ++probe;
 5040|   691k|                           if (probe != end && *probe == ':' && ((probe + 1) != end) && *(probe + 1) == '\t') {
 5041|   691k|                              ctx.error = error_code::syntax_error;
 5042|   691k|                              return false;
 5043|   691k|                           }
 5044|   691k|                        }
 5045|   691k|                        yaml::skip_inline_ws(it, end);
 5046|   691k|                        if (!parse_map_value(val)) [[unlikely]]
 5047|   691k|                           return false;
 5048|   691k|                     }
 5049|       |
 5050|   691k|                     value.emplace(std::move(key), std::move(val));
 5051|   691k|                     return true;
 5052|   691k|                  }
 5053|       |
 5054|   691k|                  key_t key{};
 5055|   691k|                  if constexpr (std::same_as<std::remove_cvref_t<key_t>, std::string>) {
 5056|   691k|                     auto key_probe = it;
 5057|   691k|                     yaml::skip_inline_ws(key_probe, end);
 5058|   691k|                     const bool complex_flow_key = (key_probe != end && (*key_probe == '[' || *key_probe == '{'));
 5059|   691k|                     if (complex_flow_key) {
 5060|   691k|                        glz::generic key_node{};
 5061|   691k|                        from<YAML, glz::generic>::template op<yaml::flow_context_on<Opts>()>(key_node, ctx, it, end);
 5062|   691k|                        if (bool(ctx.error)) [[unlikely]]
 5063|   691k|                           return false;
 5064|   691k|                        if (!yaml::materialize_key(key, key_node, ctx)) [[unlikely]]
 5065|   691k|                           return false;
 5066|   691k|                     }
 5067|   691k|                     else {
 5068|   691k|                        if (!yaml::parse_yaml_key(key, ctx, it, end, false)) {
 5069|   691k|                           return false;
 5070|   691k|                        }
 5071|   691k|                     }
 5072|   691k|                  }
 5073|   691k|                  else {
 5074|   691k|                     from<YAML, key_t>::template op<Opts>(key, ctx, it, end);
 5075|   691k|                     if (bool(ctx.error)) [[unlikely]]
 5076|   691k|                        return false;
 5077|   691k|                  }
 5078|       |
 5079|   691k|                  yaml::skip_inline_ws(it, end);
 5080|       |
 5081|   691k|                  if (it == end || *it != ':') {
 5082|   691k|                     ctx.error = error_code::syntax_error;
 5083|   691k|                     return false;
 5084|   691k|                  }
 5085|   691k|                  ++it;
 5086|   691k|                  yaml::skip_inline_ws(it, end);
 5087|       |
 5088|   691k|                  val_t val{};
 5089|   691k|                  if (!parse_map_value(val)) [[unlikely]]
 5090|   691k|                     return false;
 5091|       |
 5092|   691k|                  value.emplace(std::move(key), std::move(val));
 5093|   691k|                  return true;
 5094|   691k|               });
 5095|   691k|         }
 5096|       |
 5097|   896k|         yaml::finalize_node_anchor(preamble.node_props, ctx, it);
 5098|   896k|      }
_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|   917k|      {
  466|   917k|         skip_inline_ws(it, end);
  467|       |
  468|   917k|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (468:14): [True: 6, False: 917k]
  ------------------
  469|      6|            if constexpr (!AllowEmptyInput) {
  470|      6|               ctx.error = error_code::unexpected_end;
  471|      6|            }
  472|      6|            return true;
  473|      6|         }
  474|       |
  475|   917k|         preamble.tag = parse_yaml_tag(it, end, ctx);
  476|   917k|         if (preamble.tag == yaml_tag::unknown) [[unlikely]] {
  ------------------
  |  Branch (476:14): [True: 6, False: 917k]
  ------------------
  477|      6|            ctx.error = error_code::syntax_error;
  478|      6|            return true;
  479|      6|         }
  480|   917k|         if (!tag_validator(preamble.tag)) [[unlikely]] {
  ------------------
  |  Branch (480:14): [True: 6, False: 917k]
  ------------------
  481|      6|            ctx.error = error_code::syntax_error;
  482|      6|            return true;
  483|      6|         }
  484|       |
  485|   917k|         skip_inline_ws(it, end);
  486|       |
  487|   917k|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (487:14): [True: 6, False: 917k]
  ------------------
  488|      6|            if constexpr (!AllowEmptyInput) {
  489|      6|               ctx.error = error_code::unexpected_end;
  490|      6|            }
  491|      6|            return true;
  492|      6|         }
  493|       |
  494|   917k|         if (parse_node_properties<Opts, PropertyPolicy>(std::forward<T>(value), ctx, it, end, preamble.node_props)) {
  ------------------
  |  Branch (494:14): [True: 3.33k, False: 914k]
  ------------------
  495|  3.33k|            return true;
  496|  3.33k|         }
  497|       |
  498|   914k|         return false;
  499|   917k|      }
_ZZN3glz4fromILj450ENS_17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES1_EEEEE2opITnDaXtlNS_4optsELj10ELb1ELb0ELb0ELb1EEERPKcRS5_TkNS_10is_contextERNS_4yaml12yaml_contextESA_EEvOT1_OT2_OT0_T3_ENKUlNSD_8yaml_tagEE_clESN_:
 4521|   917k|                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|   917k|      {
  409|   917k|         state.has_anchor = false;
  410|   917k|         state.anchor_name.clear();
  411|   917k|         state.anchor_start = nullptr;
  412|   917k|         state.anchor_indent = ctx.current_indent();
  413|       |
  414|   917k|         if constexpr (Policy.allow_alias) {
  415|   917k|            if constexpr (Policy.alias_can_be_mapping_key) {
  416|   917k|               if (!alias_token_is_mapping_key(it, end)) {
  ------------------
  |  Branch (416:20): [True: 901k, False: 16.1k]
  ------------------
  417|   901k|                  if (handle_alias<Opts>(std::forward<T>(value), ctx, it, end)) return true;
  ------------------
  |  Branch (417:23): [True: 3.30k, False: 897k]
  ------------------
  418|   901k|               }
  419|       |            }
  420|       |            else {
  421|       |               if (handle_alias<Opts>(std::forward<T>(value), ctx, it, end)) return true;
  422|       |            }
  423|   917k|         }
  424|       |
  425|   917k|         if (it != end && *it == '&') {
  ------------------
  |  Branch (425:14): [True: 914k, False: 3.30k]
  |  Branch (425:27): [True: 21.5k, False: 892k]
  ------------------
  426|  21.5k|            ++it;
  427|  21.5k|            auto name = parse_anchor_name(it, end);
  428|  21.5k|            if (name.empty()) {
  ------------------
  |  Branch (428:17): [True: 14, False: 21.4k]
  ------------------
  429|     14|               ctx.error = error_code::syntax_error;
  430|     14|               return true;
  431|     14|            }
  432|  21.4k|            skip_inline_ws(it, end);
  433|  21.4k|            if (it == end) {
  ------------------
  |  Branch (433:17): [True: 14, False: 21.4k]
  ------------------
  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|  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|   917k|         return false;
  451|   917k|      }
_ZN3glz4yaml12handle_aliasITnDaXtlNS_4optsELj10ELb1ELb0ELb0ELb1EEERNS_17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES3_EEEENS0_12yaml_contextEPKcSB_EEbOT0_RT1_RT2_T3_:
  300|   901k|      {
  301|   901k|         if (it == end || *it != '*') return false;
  ------------------
  |  Branch (301:14): [True: 0, False: 901k]
  |  Branch (301:27): [True: 897k, False: 3.30k]
  ------------------
  302|       |
  303|  3.30k|         ++it; // skip '*'
  304|  3.30k|         auto name = parse_anchor_name(it, end);
  305|  3.30k|         if (name.empty()) {
  ------------------
  |  Branch (305:14): [True: 12, False: 3.29k]
  ------------------
  306|     12|            ctx.error = error_code::syntax_error;
  307|     12|            return true;
  308|     12|         }
  309|       |
  310|  3.29k|         auto anchor_it = ctx.anchors.find(name);
  311|  3.29k|         if (anchor_it == ctx.anchors.end()) {
  ------------------
  |  Branch (311:14): [True: 46, False: 3.24k]
  ------------------
  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|  3.24k|         const auto span = anchor_it->second;
  319|       |
  320|       |         // Empty anchor span (anchor on null/empty node) — leave value as default
  321|  3.24k|         if (span.begin == span.end) {
  ------------------
  |  Branch (321:14): [True: 286, False: 2.96k]
  ------------------
  322|    286|            return true;
  323|    286|         }
  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.96k|         if (ctx.alias_span_is_replaying(span.begin, span.end)) [[unlikely]] {
  ------------------
  |  Branch (328:14): [True: 66, False: 2.89k]
  ------------------
  329|     66|            ctx.error = error_code::syntax_error; // cyclic alias
  330|     66|            return true;
  331|     66|         }
  332|       |
  333|       |         // Replaying an anchor re-enters the reader directly, bypassing the variant reader's
  334|       |         // depth guard, so this is the only depth accounting a chain of aliases into a
  335|       |         // non-variant target gets. The cycle check above stops the unbounded case; this bounds
  336|       |         // a legitimate but deeply chained one.
  337|  2.89k|         depth_guard guard{ctx, yaml::max_yaml_recursive_depth};
  338|  2.89k|         if (!guard) [[unlikely]]
  ------------------
  |  Branch (338:14): [True: 0, False: 2.89k]
  ------------------
  339|      0|            return true;
  340|       |
  341|  2.89k|         if (!ctx.charge_alias_expansion(static_cast<size_t>(span.end - span.begin))) [[unlikely]] {
  ------------------
  |  Branch (341:14): [True: 0, False: 2.89k]
  ------------------
  342|      0|            ctx.error = error_code::exceeded_max_expansion;
  343|      0|            ctx.custom_error_message = "alias expansion";
  344|      0|            return true;
  345|      0|         }
  346|       |
  347|  2.89k|         auto replay_it = span.begin;
  348|  2.89k|         auto replay_end = span.end;
  349|       |
  350|       |         // Save indent context and set up for replay
  351|  2.89k|         auto saved_indent_stack = std::move(ctx.indent_stack);
  352|  2.89k|         ctx.indent_stack.clear();
  353|  2.89k|         if (span.base_indent > 0) {
  ------------------
  |  Branch (353:14): [True: 1.16k, False: 1.73k]
  ------------------
  354|  1.16k|            ctx.push_indent(span.base_indent - 1);
  355|  1.16k|         }
  356|       |
  357|  2.89k|         ctx.active_alias_spans.emplace_back(span.begin, span.end);
  358|       |
  359|  2.89k|         using V = std::remove_cvref_t<T>;
  360|  2.89k|         from<YAML, V>::template op<Opts>(std::forward<T>(value), ctx, replay_it, replay_end);
  361|       |
  362|  2.89k|         ctx.active_alias_spans.pop_back();
  363|       |
  364|       |         // Restore indent context
  365|  2.89k|         ctx.indent_stack = std::move(saved_indent_stack);
  366|  2.89k|         return true;
  367|  2.89k|      }
_ZZN3glz4fromILj450ENS_17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES1_EEEEE2opITnDaXtlNS_4optsELj10ELb1ELb0ELb0ELb1EEERPKcRS5_TkNS_10is_contextERNS_4yaml12yaml_contextESA_EEvOT1_OT2_OT0_T3_ENKUlRS4_E_clESN_:
 4658|   515k|               auto parse_implicit_null = [&](val_t& val) -> bool {
 4659|       |                  if constexpr (nullable_like<std::remove_cvref_t<val_t>>) {
 4660|       |                     val = {};
 4661|       |                     return true;
 4662|       |                  }
 4663|   515k|                  else if constexpr (std::same_as<std::remove_cvref_t<val_t>, glz::generic>) {
 4664|   515k|                     val = glz::generic{};
 4665|   515k|                     return true;
 4666|       |                  }
 4667|       |                  else {
 4668|       |                     static constexpr std::string_view null_value{"null"};
 4669|       |                     auto null_it = null_value.data();
 4670|       |                     from<YAML, val_t>::template op<yaml::flow_context_on<Opts>()>(
 4671|       |                        val, ctx, null_it, null_value.data() + null_value.size());
 4672|       |                     return !bool(ctx.error);
 4673|       |                  }
 4674|   515k|               };
_ZN3glz4yaml24parse_block_mapping_loopITnDaXtlNS_4optsELj10ELb1ELb0ELb0ELb1EEENS0_12yaml_contextEPKcS5_ZNS_4fromILj450ENS_17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES7_EEEEE2opITnDaXtlS2_Lj10ELb1ELb0ELb0ELb1EEERS5_RSB_TkNS_10is_contextERS3_S5_EEvOT1_OT2_OT0_T3_EUlRT_RSL_SH_iE_EEvSQ_RSH_SJ_iOSN_:
 3633|   691k|      {
 3634|       |         // A tagged-variant custom alternative hands its body (at the variant's own column) to a
 3635|       |         // discover-mode reader. Honor the known indent it published so continuation/dedent are
 3636|       |         // judged against the outer parent, not the body itself. One-shot: reset on observation.
 3637|   691k|         if (ctx.forced_block_mapping_indent >= 0) {
  ------------------
  |  Branch (3637:14): [True: 0, False: 691k]
  ------------------
 3638|      0|            if (mapping_indent < 0) {
  ------------------
  |  Branch (3638:17): [True: 0, False: 0]
  ------------------
 3639|      0|               mapping_indent = ctx.forced_block_mapping_indent;
 3640|      0|            }
 3641|      0|            ctx.forced_block_mapping_indent = -1;
 3642|      0|         }
 3643|   691k|         const int32_t parent_indent = ctx.current_indent();
 3644|   691k|         const bool discover_indent = (mapping_indent < 0);
 3645|   691k|         bool first_key = !discover_indent;
 3646|   691k|         bool discovered_first_key_mid_line = false;
 3647|   691k|         int32_t discovered_first_key_visual_indent = 0;
 3648|       |
 3649|  1.50M|         while (it != end) {
  ------------------
  |  Branch (3649:17): [True: 1.13M, False: 371k]
  ------------------
 3650|  1.13M|            auto line_start = it;
 3651|  1.13M|            int32_t line_indent = first_key ? mapping_indent : 0;
  ------------------
  |  Branch (3651:35): [True: 0, False: 1.13M]
  ------------------
 3652|       |
 3653|       |            // Skip blank lines and comments, measure indent
 3654|  1.47M|            while (it != end) {
  ------------------
  |  Branch (3654:20): [True: 1.44M, False: 30.4k]
  ------------------
 3655|  1.44M|               if (*it == '#') {
  ------------------
  |  Branch (3655:20): [True: 97.6k, False: 1.34M]
  ------------------
 3656|  97.6k|                  skip_comment(it, end);
 3657|  97.6k|                  skip_newline(it, end);
 3658|  97.6k|                  first_key = false;
 3659|  97.6k|                  line_indent = 0;
 3660|  97.6k|               }
 3661|  1.34M|               else if (*it == '\n' || *it == '\r') {
  ------------------
  |  Branch (3661:25): [True: 44.9k, False: 1.30M]
  |  Branch (3661:40): [True: 133k, False: 1.16M]
  ------------------
 3662|   178k|                  skip_newline(it, end);
 3663|   178k|                  first_key = false;
 3664|   178k|                  line_indent = 0;
 3665|   178k|               }
 3666|  1.16M|               else if (*it == ' ') {
  ------------------
  |  Branch (3666:25): [True: 173k, False: 995k]
  ------------------
 3667|   173k|                  line_start = it;
 3668|   173k|                  line_indent = 0;
 3669|   466k|                  while (it != end && *it == ' ') {
  ------------------
  |  Branch (3669:26): [True: 462k, False: 3.67k]
  |  Branch (3669:39): [True: 292k, False: 170k]
  ------------------
 3670|   292k|                     ++line_indent;
 3671|   292k|                     ++it;
 3672|   292k|                  }
 3673|       |
 3674|   173k|                  bool saw_tab = false;
 3675|   176k|                  while (it != end && (*it == ' ' || *it == '\t')) {
  ------------------
  |  Branch (3675:26): [True: 172k, False: 3.76k]
  |  Branch (3675:40): [True: 1.27k, False: 171k]
  |  Branch (3675:54): [True: 1.60k, False: 170k]
  ------------------
 3676|  2.87k|                     saw_tab = saw_tab || (*it == '\t');
  ------------------
  |  Branch (3676:32): [True: 1.81k, False: 1.06k]
  |  Branch (3676:43): [True: 1.06k, False: 0]
  ------------------
 3677|  2.87k|                     ++it;
 3678|  2.87k|                  }
 3679|       |
 3680|   173k|                  if (it == end || *it == '\n' || *it == '\r' || *it == '#') {
  ------------------
  |  Branch (3680:23): [True: 3.76k, False: 170k]
  |  Branch (3680:36): [True: 14.3k, False: 155k]
  |  Branch (3680:51): [True: 2.96k, False: 152k]
  |  Branch (3680:66): [True: 36.2k, False: 116k]
  ------------------
 3681|  57.3k|                     first_key = false;
 3682|  57.3k|                     line_indent = 0;
 3683|  57.3k|                     continue; // Blank or comment line
 3684|  57.3k|                  }
 3685|       |
 3686|   116k|                  if (saw_tab) {
  ------------------
  |  Branch (3686:23): [True: 12, False: 116k]
  ------------------
 3687|     12|                     ctx.error = error_code::syntax_error;
 3688|     12|                     return;
 3689|     12|                  }
 3690|       |
 3691|       |                  // Early dedent check
 3692|   116k|                  if (mapping_indent >= 0 && line_indent < mapping_indent) {
  ------------------
  |  Branch (3692:23): [True: 112k, False: 4.26k]
  |  Branch (3692:46): [True: 1.52k, False: 110k]
  ------------------
 3693|  1.52k|                     it = line_start;
 3694|  1.52k|                     return;
 3695|  1.52k|                  }
 3696|       |
 3697|   114k|                  first_key = false;
 3698|   114k|                  break; // Found content
 3699|   116k|               }
 3700|   995k|               else if (*it == '\t') {
  ------------------
  |  Branch (3700:25): [True: 6.78k, False: 988k]
  ------------------
 3701|  6.78k|                  line_start = it;
 3702|  25.0k|                  while (it != end && (*it == ' ' || *it == '\t')) ++it;
  ------------------
  |  Branch (3702:26): [True: 19.7k, False: 5.25k]
  |  Branch (3702:40): [True: 10.3k, False: 9.45k]
  |  Branch (3702:54): [True: 7.92k, False: 1.53k]
  ------------------
 3703|  6.78k|                  if (it == end || *it == '\n' || *it == '\r' || *it == '#') {
  ------------------
  |  Branch (3703:23): [True: 5.25k, False: 1.53k]
  |  Branch (3703:36): [True: 518, False: 1.01k]
  |  Branch (3703:51): [True: 728, False: 284]
  |  Branch (3703:66): [True: 268, False: 16]
  ------------------
 3704|  6.77k|                     first_key = false;
 3705|  6.77k|                     line_indent = 0;
 3706|  6.77k|                     continue; // Blank or comment-only line with tab indentation
 3707|  6.77k|                  }
 3708|     16|                  ctx.error = error_code::syntax_error;
 3709|     16|                  return;
 3710|  6.78k|               }
 3711|   988k|               else {
 3712|   988k|                  line_start = it;
 3713|   988k|                  break; // Content at column 0
 3714|   988k|               }
 3715|  1.44M|            }
 3716|       |
 3717|  1.13M|            if (it == end) break;
  ------------------
  |  Branch (3717:17): [True: 30.4k, False: 1.10M]
  ------------------
 3718|       |
 3719|       |            // Document boundaries terminate the current mapping in both discovered
 3720|       |            // and fixed-indent modes.
 3721|  1.10M|            if (at_document_end(it, end) || at_document_start(it, end)) break;
  ------------------
  |  Branch (3721:17): [True: 2.98k, False: 1.10M]
  |  Branch (3721:45): [True: 6.38k, False: 1.09M]
  ------------------
 3722|       |
 3723|       |            // Dedent checks (skip on first key for struct case)
 3724|       |            // Must check BEFORE establishing mapping_indent so the first discovered key
 3725|       |            // isn't rejected by the parent_indent check (mapping_indent is still -1).
 3726|  1.09M|            if (!first_key) {
  ------------------
  |  Branch (3726:17): [True: 1.09M, False: 0]
  ------------------
 3727|       |               // Parent indent check for nested maps (only after mapping_indent established)
 3728|  1.09M|               if (discover_indent && mapping_indent >= 0 && parent_indent >= 0 && line_indent <= parent_indent) {
  ------------------
  |  Branch (3728:20): [True: 1.09M, False: 0]
  |  Branch (3728:39): [True: 404k, False: 689k]
  |  Branch (3728:62): [True: 132k, False: 271k]
  |  Branch (3728:84): [True: 106k, False: 26.6k]
  ------------------
 3729|   106k|                  it = line_start;
 3730|   106k|                  return;
 3731|   106k|               }
 3732|   988k|               if (mapping_indent >= 0 && line_indent < mapping_indent) {
  ------------------
  |  Branch (3732:20): [True: 298k, False: 689k]
  |  Branch (3732:43): [True: 346, False: 297k]
  ------------------
 3733|    346|                  it = line_start;
 3734|    346|                  return;
 3735|    346|               }
 3736|   988k|            }
 3737|       |
 3738|       |            // Establish mapping indent from first key (map case)
 3739|   987k|            bool established_mapping_indent_this_line = false;
 3740|   987k|            if (mapping_indent < 0) {
  ------------------
  |  Branch (3740:17): [True: 689k, False: 297k]
  ------------------
 3741|   689k|               mapping_indent = line_indent;
 3742|   689k|               established_mapping_indent_this_line = true;
 3743|   689k|               discovered_first_key_visual_indent = line_indent;
 3744|   689k|               if constexpr (std::is_pointer_v<std::decay_t<It>>) {
 3745|   689k|                  if (ctx.stream_begin && line_start > ctx.stream_begin) {
  ------------------
  |  Branch (3745:23): [True: 689k, False: 0]
  |  Branch (3745:43): [True: 689k, False: 0]
  ------------------
 3746|   689k|                     const auto prefix = ctx.line_prefix_before(line_start);
 3747|   689k|                     if (prefix.has_tab) {
  ------------------
  |  Branch (3747:26): [True: 74, False: 689k]
  ------------------
 3748|     74|                        ctx.error = error_code::syntax_error;
 3749|     74|                        return;
 3750|     74|                     }
 3751|       |
 3752|   689k|                     discovered_first_key_mid_line = prefix.has_content;
 3753|   689k|                     if (mapping_indent == 0 && prefix.column > 0) {
  ------------------
  |  Branch (3753:26): [True: 685k, False: 4.26k]
  |  Branch (3753:49): [True: 465k, False: 219k]
  ------------------
 3754|   465k|                        discovered_first_key_visual_indent = prefix.column;
 3755|   465k|                     }
 3756|   689k|                  }
 3757|   689k|               }
 3758|   689k|            }
 3759|       |
 3760|       |            // In discovered-indent block mappings, sibling keys must stay at the same
 3761|       |            // indent level, except when the first key started mid-line (e.g. "--- k: v").
 3762|   987k|            if (discover_indent && mapping_indent >= 0 && !established_mapping_indent_this_line &&
  ------------------
  |  Branch (3762:17): [True: 987k, False: 74]
  |  Branch (3762:36): [True: 987k, False: 0]
  |  Branch (3762:59): [True: 297k, False: 689k]
  ------------------
 3763|   297k|                !discovered_first_key_mid_line) {
  ------------------
  |  Branch (3763:17): [True: 109k, False: 188k]
  ------------------
 3764|   109k|               if (mapping_indent == 0 && discovered_first_key_visual_indent > 0) {
  ------------------
  |  Branch (3764:20): [True: 109k, False: 420]
  |  Branch (3764:43): [True: 22.6k, False: 86.7k]
  ------------------
 3765|  22.6k|                  if (line_indent > discovered_first_key_visual_indent) {
  ------------------
  |  Branch (3765:23): [True: 10, False: 22.6k]
  ------------------
 3766|     10|                     ctx.error = error_code::syntax_error;
 3767|     10|                     return;
 3768|     10|                  }
 3769|  22.6k|                  if (line_indent < discovered_first_key_visual_indent) {
  ------------------
  |  Branch (3769:23): [True: 9.57k, False: 13.1k]
  ------------------
 3770|  9.57k|                     it = line_start;
 3771|  9.57k|                     return;
 3772|  9.57k|                  }
 3773|  22.6k|               }
 3774|  87.1k|               else if (line_indent > mapping_indent &&
  ------------------
  |  Branch (3774:25): [True: 1.73k, False: 85.4k]
  ------------------
 3775|  1.73k|                        (parent_indent < 0 || mapping_indent > 0 ||
  ------------------
  |  Branch (3775:26): [True: 36, False: 1.69k]
  |  Branch (3775:47): [True: 6, False: 1.69k]
  ------------------
 3776|  1.69k|                         (parent_indent >= 0 && mapping_indent == 0 && line_indent > (parent_indent + 1)))) {
  ------------------
  |  Branch (3776:27): [True: 1.69k, False: 0]
  |  Branch (3776:49): [True: 1.69k, False: 0]
  |  Branch (3776:72): [True: 6, False: 1.68k]
  ------------------
 3777|     48|                  ctx.error = error_code::syntax_error;
 3778|     48|                  return;
 3779|     48|               }
 3780|   109k|            }
 3781|       |
 3782|       |            // Sequence indicator check (struct case only - map parser lets key parsing
 3783|       |            // handle '- ' which produces appropriate errors for misindented items)
 3784|   978k|            if (!discover_indent && *it == '-' &&
  ------------------
  |  Branch (3784:17): [True: 0, False: 978k]
  |  Branch (3784:37): [True: 0, False: 0]
  ------------------
 3785|      0|                ((it + 1) == end || *(it + 1) == ' ' || *(it + 1) == '\t' || *(it + 1) == '\n')) {
  ------------------
  |  Branch (3785:18): [True: 0, False: 0]
  |  Branch (3785:37): [True: 0, False: 0]
  |  Branch (3785:57): [True: 0, False: 0]
  |  Branch (3785:78): [True: 0, False: 0]
  ------------------
 3786|      0|               it = line_start;
 3787|      0|               return;
 3788|      0|            }
 3789|       |
 3790|       |            // Skip indented comment lines
 3791|   978k|            if (*it == '#') {
  ------------------
  |  Branch (3791:17): [True: 0, False: 978k]
  ------------------
 3792|      0|               skip_comment(it, end);
 3793|      0|               first_key = false;
 3794|      0|               continue;
 3795|      0|            }
 3796|       |
 3797|       |            // Skip blank/empty lines after indent
 3798|   978k|            if (*it == '\n' || *it == '\r') {
  ------------------
  |  Branch (3798:17): [True: 74, False: 978k]
  |  Branch (3798:32): [True: 0, False: 978k]
  ------------------
 3799|      0|               first_key = false;
 3800|      0|               continue;
 3801|      0|            }
 3802|       |
 3803|       |            // While parsing an explicit mapping key node ('? key-node'),
 3804|       |            // a subsequent standalone ':' at the same indentation starts
 3805|       |            // the outer value indicator and must terminate this key-node map.
 3806|       |            // Keep same-line ': x' on the first key-node line valid.
 3807|   978k|            if (ctx.explicit_mapping_key_context && !established_mapping_indent_this_line && *it == ':') {
  ------------------
  |  Branch (3807:17): [True: 308k, False: 669k]
  |  Branch (3807:53): [True: 46.9k, False: 261k]
  |  Branch (3807:94): [True: 7.61k, False: 39.3k]
  ------------------
 3808|  7.61k|               const auto after_colon = it + 1;
 3809|  7.61k|               const int32_t explicit_value_indicator_indent = (parent_indent < 0) ? 0 : (parent_indent + 1);
  ------------------
  |  Branch (3809:64): [True: 5.62k, False: 1.98k]
  ------------------
 3810|  7.61k|               if ((after_colon == end || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*after_colon)]) &&
  ------------------
  |  Branch (3810:21): [True: 206, False: 7.40k]
  |  Branch (3810:43): [True: 2.39k, False: 5.01k]
  ------------------
 3811|  2.59k|                   line_indent == explicit_value_indicator_indent) {
  ------------------
  |  Branch (3811:20): [True: 264, False: 2.33k]
  ------------------
 3812|    264|                  it = line_start;
 3813|    264|                  return;
 3814|    264|               }
 3815|  7.61k|            }
 3816|       |
 3817|       |            // Process this mapping entry (key + colon + value)
 3818|   978k|            int32_t effective_line_indent = line_indent;
 3819|   978k|            if (discover_indent && established_mapping_indent_this_line &&
  ------------------
  |  Branch (3819:17): [True: 977k, False: 74]
  |  Branch (3819:36): [True: 689k, False: 288k]
  ------------------
 3820|   689k|                discovered_first_key_visual_indent > effective_line_indent &&
  ------------------
  |  Branch (3820:17): [True: 465k, False: 224k]
  ------------------
 3821|   465k|                !(discovered_first_key_mid_line && parent_indent < 0)) {
  ------------------
  |  Branch (3821:19): [True: 420k, False: 44.8k]
  |  Branch (3821:52): [True: 200k, False: 220k]
  ------------------
 3822|       |               // The first discovered key has no indentation of its own left to measure: it may
 3823|       |               // begin mid-line (a sequence entry's "- key: value"), or the caller may have already
 3824|       |               // consumed the line's indentation before handing the mapping over. Pass its visual
 3825|       |               // column so the entry judges its value against the key's real indent -- otherwise a
 3826|       |               // key with an empty value takes the following sibling line for nested content
 3827|       |               // (issue #2827) and same-line block scalars compute the wrong indentation.
 3828|       |               // The exception is a ROOT mapping whose first key begins mid-line, which means node
 3829|       |               // properties sit ahead of it (`!!str &a1 "foo":`): those belong to the document node
 3830|       |               // rather than to the key's column, so the measured indent stands. Conformance tests
 3831|       |               // 7FWL and HMQ5 pin that case.
 3832|   265k|               effective_line_indent = discovered_first_key_visual_indent;
 3833|   265k|            }
 3834|       |
 3835|   978k|            if (!process_entry(ctx, it, end, effective_line_indent)) {
  ------------------
  |  Branch (3835:17): [True: 162k, False: 815k]
  ------------------
 3836|   162k|               return;
 3837|   162k|            }
 3838|   815k|            first_key = false;
 3839|       |
 3840|   815k|            if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (3840:17): [True: 0, False: 815k]
  ------------------
 3841|      0|               return;
 3842|       |
 3843|       |            if constexpr (yaml::check_flow_context(Opts)) {
 3844|       |               // In flow context, an implicit "key: value" pair used as a sequence entry
 3845|       |               // ends at ',', ']', or '}'. Let the enclosing flow parser consume it.
 3846|       |               auto flow_end = it;
 3847|       |               skip_flow_ws_and_newlines(ctx, flow_end, end);
 3848|       |               if (bool(ctx.error)) [[unlikely]]
 3849|       |                  return;
 3850|       |               if (flow_end != end && (*flow_end == ',' || *flow_end == ']' || *flow_end == '}')) {
 3851|       |                  it = flow_end;
 3852|       |                  return;
 3853|       |               }
 3854|       |            }
 3855|       |
 3856|       |            // Trailing whitespace handling (peek-ahead pattern).
 3857|       |            // After parsing, iterator may be at leading indent of next line.
 3858|       |            // Don't consume it - let the outer loop handle indent measurement.
 3859|   815k|            if (it != end) {
  ------------------
  |  Branch (3859:17): [True: 478k, False: 337k]
  ------------------
 3860|   478k|               if (*it == ' ' || *it == '\t') {
  ------------------
  |  Branch (3860:20): [True: 87.8k, False: 390k]
  |  Branch (3860:34): [True: 4.68k, False: 386k]
  ------------------
 3861|  92.5k|                  auto peek = it;
 3862|  92.5k|                  skip_inline_ws(peek, end);
 3863|  92.5k|                  if (peek != end && *peek != '\n' && *peek != '\r' && *peek != '#') {
  ------------------
  |  Branch (3863:23): [True: 83.6k, False: 8.88k]
  |  Branch (3863:38): [True: 79.5k, False: 4.09k]
  |  Branch (3863:55): [True: 77.3k, False: 2.22k]
  |  Branch (3863:72): [True: 75.9k, False: 1.36k]
  ------------------
 3864|  75.9k|                     continue; // At leading indent of new line
 3865|  75.9k|                  }
 3866|  92.5k|               }
 3867|   402k|               skip_inline_ws(it, end);
 3868|   402k|               if (it != end && *it == '#') {
  ------------------
  |  Branch (3868:20): [True: 393k, False: 8.88k]
  |  Branch (3868:33): [True: 17.4k, False: 376k]
  ------------------
 3869|  17.4k|                  if constexpr (std::is_pointer_v<std::decay_t<It>>) {
 3870|  17.4k|                     if (it > line_start) {
  ------------------
  |  Branch (3870:26): [True: 17.4k, False: 0]
  ------------------
 3871|  17.4k|                        const char prev = *(it - 1);
 3872|  17.4k|                        if (prev != ' ' && prev != '\t' && prev != '\n' && prev != '\r') {
  ------------------
  |  Branch (3872:29): [True: 4.60k, False: 12.8k]
  |  Branch (3872:44): [True: 2.75k, False: 1.84k]
  |  Branch (3872:60): [True: 1.00k, False: 1.75k]
  |  Branch (3872:76): [True: 8, False: 998]
  ------------------
 3873|      8|                           ctx.error = error_code::syntax_error;
 3874|      8|                           return;
 3875|      8|                        }
 3876|  17.4k|                     }
 3877|  17.4k|                  }
 3878|  17.4k|               }
 3879|  17.4k|               skip_comment(it, end);
 3880|   402k|               if (it != end && (*it == '\n' || *it == '\r')) {
  ------------------
  |  Branch (3880:20): [True: 393k, False: 9.52k]
  |  Branch (3880:34): [True: 112k, False: 280k]
  |  Branch (3880:49): [True: 155k, False: 124k]
  ------------------
 3881|   268k|                  skip_newline(it, end);
 3882|   268k|               }
 3883|   134k|               else if (it != end) {
  ------------------
  |  Branch (3883:25): [True: 124k, False: 9.52k]
  ------------------
 3884|       |                  // The entry stopped part way along its line with something other than
 3885|       |                  // whitespace or a comment after it -- a ':' its value could not take as a
 3886|       |                  // separator, say. The next pass measures indent as though this were the start
 3887|       |                  // of a line, so what is left of the real one is lost; reject it instead.
 3888|   124k|                  if constexpr (requires { ctx.line_prefix_before(it); }) {
 3889|   124k|                     if (ctx.line_prefix_before(it).has_content) {
  ------------------
  |  Branch (3889:26): [True: 178, False: 124k]
  ------------------
 3890|    178|                        ctx.error = error_code::syntax_error;
 3891|    178|                        return;
 3892|    178|                     }
 3893|   124k|                  }
 3894|   124k|               }
 3895|   402k|            }
 3896|   815k|         }
 3897|   691k|      }
_ZZN3glz4fromILj450ENS_17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES1_EEEEE2opITnDaXtlNS_4optsELj10ELb1ELb0ELb0ELb1EEERPKcRS5_TkNS_10is_contextERNS_4yaml12yaml_contextESA_EEvOT1_OT2_OT0_T3_ENKUlRT_RSK_SG_iE_clISE_SA_SA_EEbSO_SP_SG_i:
 4777|   977k|               ctx, it, end, int32_t(-1), [&](auto& ctx, auto& it, auto end, int32_t line_indent) -> bool {
 4778|   977k|                  auto parse_map_value = [&](val_t& val) -> bool {
 4779|   977k|                     if (it != end && !yaml::line_end_or_comment_table[static_cast<uint8_t>(*it)]) {
 4780|   977k|                        bool line_starts_with_explicit_value_indicator = false;
 4781|       |
 4782|       |                        // Inline mapping values in block context cannot start with a
 4783|       |                        // plain "key: value" pair on the same line (e.g. "a: b: c").
 4784|       |                        // Such constructs are malformed unless wrapped in flow
 4785|       |                        // delimiters ({...} / [...]) or quoted.
 4786|   977k|                        if constexpr (std::is_pointer_v<std::decay_t<decltype(it)>>) {
 4787|   977k|                           if (ctx.stream_begin) {
 4788|   977k|                              auto is_line_content_start = [&](auto pos) {
 4789|   977k|                                 return !ctx.line_prefix_before(pos).has_content;
 4790|   977k|                              };
 4791|       |
 4792|   977k|                              auto line_has_explicit_value_indicator = [&](auto pos) {
 4793|   977k|                                 const char* line = ctx.line_begin_of(pos);
 4794|   977k|                                 while (line != end && (*line == ' ' || *line == '\t')) ++line;
 4795|   977k|                                 return line != end && *line == ':';
 4796|   977k|                              };
 4797|       |
 4798|   977k|                              if (!is_line_content_start(it) &&
 4799|   977k|                                  yaml::inline_value_has_plain_mapping_indicator(it, end) &&
 4800|   977k|                                  !line_has_explicit_value_indicator(it)) {
 4801|   977k|                                 ctx.error = error_code::syntax_error;
 4802|   977k|                                 return false;
 4803|   977k|                              }
 4804|   977k|                              line_starts_with_explicit_value_indicator = line_has_explicit_value_indicator(it);
 4805|   977k|                           }
 4806|   977k|                        }
 4807|       |
 4808|   977k|                        if (*it == '-' &&
 4809|   977k|                            ((it + 1) == end || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*(it + 1))]) &&
 4810|   977k|                            !line_starts_with_explicit_value_indicator) {
 4811|       |                           // "key: - item" is not valid block sequence syntax.
 4812|   977k|                           ctx.error = error_code::syntax_error;
 4813|   977k|                           return false;
 4814|   977k|                        }
 4815|       |
 4816|   977k|                        if (!ctx.push_indent(line_indent + 1)) [[unlikely]]
 4817|   977k|                           return false;
 4818|   977k|                        from<YAML, val_t>::template op<Opts>(val, ctx, it, end);
 4819|   977k|                        ctx.pop_indent();
 4820|   977k|                     }
 4821|   977k|                     else {
 4822|   977k|                        int32_t nested_indent = yaml::detect_nested_value_indent(ctx, it, end, line_indent);
 4823|   977k|                        if (nested_indent >= 0) {
 4824|   977k|                           yaml::skip_to_content(it, end);
 4825|   977k|                           if (it != end && *it == ':' && (it + 1) != end && *(it + 1) == '\t') {
 4826|   977k|                              ctx.error = error_code::syntax_error;
 4827|   977k|                              return false;
 4828|   977k|                           }
 4829|       |                           // A struct value reads the pushed indent as its own key column;
 4830|       |                           // every other value type reads it as the enclosing baseline.
 4831|   977k|                           const int32_t value_indent =
 4832|   977k|                              yaml::receives_block_mapping_column<val_t>() ? nested_indent : nested_indent - 1;
 4833|   977k|                           if (!ctx.push_indent(value_indent)) [[unlikely]]
 4834|   977k|                              return false;
 4835|   977k|                           from<YAML, val_t>::template op<Opts>(val, ctx, it, end);
 4836|   977k|                           ctx.pop_indent();
 4837|   977k|                        }
 4838|   977k|                     }
 4839|   977k|                     return !bool(ctx.error);
 4840|   977k|                  };
 4841|       |
 4842|       |                  // Explicit key entry form:
 4843|       |                  // ? key
 4844|       |                  // : value
 4845|   977k|                  if (*it == '?' && ((it + 1) != end) && *(it + 1) == '\t') {
  ------------------
  |  Branch (4845:23): [True: 445k, False: 532k]
  |  Branch (4845:37): [True: 442k, False: 3.20k]
  |  Branch (4845:58): [True: 8, False: 442k]
  ------------------
 4846|      8|                     ctx.error = error_code::syntax_error;
 4847|      8|                     return false;
 4848|      8|                  }
 4849|   977k|                  if (*it == '?' && ((it + 1) == end || *(it + 1) == ' ' || *(it + 1) == '\n' || *(it + 1) == '\r')) {
  ------------------
  |  Branch (4849:23): [True: 445k, False: 532k]
  |  Branch (4849:38): [True: 3.20k, False: 442k]
  |  Branch (4849:57): [True: 177k, False: 264k]
  |  Branch (4849:77): [True: 178k, False: 85.9k]
  |  Branch (4849:98): [True: 69.9k, False: 15.9k]
  ------------------
 4850|   429k|                     ++it; // skip '?'
 4851|   429k|                     yaml::skip_inline_ws(it, end);
 4852|       |
 4853|   429k|                     const int32_t explicit_value_indicator_indent =
 4854|   429k|                        (ctx.current_indent() < 0) ? 0 : (ctx.current_indent() + 1);
  ------------------
  |  Branch (4854:25): [True: 285k, False: 143k]
  ------------------
 4855|       |
 4856|   429k|                     key_t key{};
 4857|   429k|                     if constexpr (std::same_as<std::remove_cvref_t<key_t>, std::string>) {
 4858|   429k|                        auto to_string_key = [&](glz::generic& key_node) {
 4859|   429k|                           return yaml::materialize_key(key, key_node, ctx);
 4860|   429k|                        };
 4861|       |
 4862|   429k|                        auto key_it = it;
 4863|   429k|                        yaml::skip_inline_ws(key_it, end);
 4864|       |
 4865|   429k|                        auto content = key_it;
 4866|   429k|                        yaml::skip_to_content(content, end);
 4867|   429k|                        bool handled_anchor_only_empty_key = false;
 4868|       |
 4869|       |                        // Anchor on an empty explicit key node:
 4870|       |                        //   ? &a
 4871|       |                        //   : value
 4872|   429k|                        if (content != end && *content == '&') {
  ------------------
  |  Branch (4872:29): [True: 417k, False: 12.2k]
  |  Branch (4872:47): [True: 104k, False: 312k]
  ------------------
 4873|   104k|                           auto anchor_probe = content + 1;
 4874|   104k|                           auto anchor_name = yaml::parse_anchor_name(anchor_probe, end);
 4875|   104k|                           if (!anchor_name.empty()) {
  ------------------
  |  Branch (4875:32): [True: 104k, False: 22]
  ------------------
 4876|   104k|                              auto after_anchor = anchor_probe;
 4877|   104k|                              yaml::skip_inline_ws(after_anchor, end);
 4878|       |
 4879|   104k|                              auto value_indicator = after_anchor;
 4880|   104k|                              if (value_indicator != end && *value_indicator == ':') {
  ------------------
  |  Branch (4880:35): [True: 97.5k, False: 6.90k]
  |  Branch (4880:61): [True: 8.55k, False: 89.0k]
  ------------------
 4881|  8.55k|                                 key.clear();
 4882|  8.55k|                                 ctx.anchors[std::string(anchor_name)] = {content, content, ctx.current_indent()};
 4883|  8.55k|                                 it = value_indicator;
 4884|  8.55k|                                 handled_anchor_only_empty_key = true;
 4885|  8.55k|                              }
 4886|  95.9k|                              else {
 4887|  95.9k|                                 if (value_indicator != end && *value_indicator == '#') {
  ------------------
  |  Branch (4887:38): [True: 89.0k, False: 6.90k]
  |  Branch (4887:64): [True: 6.93k, False: 82.0k]
  ------------------
 4888|  6.93k|                                    yaml::skip_comment(value_indicator, end);
 4889|  6.93k|                                 }
 4890|  95.9k|                                 if (value_indicator != end && (*value_indicator == '\n' || *value_indicator == '\r')) {
  ------------------
  |  Branch (4890:38): [True: 89.0k, False: 6.90k]
  |  Branch (4890:65): [True: 29.7k, False: 59.2k]
  |  Branch (4890:93): [True: 25.3k, False: 33.9k]
  ------------------
 4891|  55.0k|                                    yaml::skip_newline(value_indicator, end);
 4892|  55.0k|                                    auto value_line = value_indicator;
 4893|  55.0k|                                    int32_t value_indent = yaml::measure_indent(value_line, end, ctx);
 4894|  55.0k|                                    if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4894:41): [True: 6, False: 55.0k]
  ------------------
 4895|      6|                                       return false;
 4896|  55.0k|                                    if (value_line != end && *value_line == ':' &&
  ------------------
  |  Branch (4896:41): [True: 53.1k, False: 1.97k]
  |  Branch (4896:62): [True: 5.12k, False: 47.9k]
  ------------------
 4897|  5.12k|                                        value_indent == explicit_value_indicator_indent) {
  ------------------
  |  Branch (4897:41): [True: 5.12k, False: 6]
  ------------------
 4898|  5.12k|                                       key.clear();
 4899|  5.12k|                                       ctx.anchors[std::string(anchor_name)] = {content, content, ctx.current_indent()};
 4900|  5.12k|                                       it = value_line;
 4901|  5.12k|                                       handled_anchor_only_empty_key = true;
 4902|  5.12k|                                    }
 4903|  49.9k|                                    else if (value_line != end && *value_line == ':') {
  ------------------
  |  Branch (4903:46): [True: 47.9k, False: 1.97k]
  |  Branch (4903:67): [True: 6, False: 47.9k]
  ------------------
 4904|       |                                       // In explicit-key form ("? &a"), a following ':'
 4905|       |                                       // starts the outer value indicator only at the same
 4906|       |                                       // indentation. A deeper-indented ': value' is malformed.
 4907|      6|                                       ctx.error = error_code::syntax_error;
 4908|      6|                                       return false;
 4909|      6|                                    }
 4910|  55.0k|                                 }
 4911|  95.9k|                              }
 4912|   104k|                           }
 4913|   104k|                        }
 4914|       |
 4915|   429k|                        const bool key_content_spans_lines = [&] {
 4916|   429k|                           auto scan = key_it;
 4917|   429k|                           while (scan != content && scan != end) {
 4918|   429k|                              if (*scan == '\n' || *scan == '\r') return true;
 4919|   429k|                              ++scan;
 4920|   429k|                           }
 4921|   429k|                           return false;
 4922|   429k|                        }();
 4923|       |
 4924|   429k|                        if (handled_anchor_only_empty_key) {
  ------------------
  |  Branch (4924:29): [True: 13.6k, False: 415k]
  ------------------
 4925|       |                           // 'it' already points to the explicit value indicator ':'
 4926|  13.6k|                        }
 4927|   415k|                        else if (content == end || (*content == ':' && key_content_spans_lines)) {
  ------------------
  |  Branch (4927:34): [True: 12.2k, False: 403k]
  |  Branch (4927:53): [True: 3.89k, False: 399k]
  |  Branch (4927:72): [True: 2.33k, False: 1.56k]
  ------------------
 4928|  14.6k|                           key.clear();
 4929|  14.6k|                           it = content;
 4930|  14.6k|                        }
 4931|   401k|                        else {
 4932|       |                           // Explicit mapping keys ('? key-node') are full YAML nodes.
 4933|       |                           // Parse the key node structurally (not via plain-key scanning)
 4934|       |                           // so inputs like '? []: x' and '? JSON: like' are interpreted
 4935|       |                           // as complex keys, not split into implicit key/value pairs.
 4936|   401k|                           auto key_node_it = content;
 4937|   401k|                           auto key_node_end = end;
 4938|   401k|                           if constexpr (std::is_pointer_v<std::decay_t<It>>) {
 4939|       |                              // In explicit-key form, a following standalone ':'
 4940|       |                              // line (same or lower indentation) belongs to the
 4941|       |                              // outer mapping value, not the key node itself.
 4942|   401k|                              auto scan = content;
 4943|  2.27M|                              while (scan != end) {
  ------------------
  |  Branch (4943:38): [True: 2.19M, False: 81.3k]
  ------------------
 4944|   326M|                                 while (scan != end && *scan != '\n' && *scan != '\r') {
  ------------------
  |  Branch (4944:41): [True: 326M, False: 274k]
  |  Branch (4944:56): [True: 325M, False: 866k]
  |  Branch (4944:73): [True: 324M, False: 1.05M]
  ------------------
 4945|   324M|                                    ++scan;
 4946|   324M|                                 }
 4947|  2.19M|                                 if (scan == end) {
  ------------------
  |  Branch (4947:38): [True: 274k, False: 1.92M]
  ------------------
 4948|   274k|                                    break;
 4949|   274k|                                 }
 4950|       |
 4951|  1.92M|                                 yaml::skip_newline(scan, end);
 4952|  1.92M|                                 auto line_start = scan;
 4953|       |
 4954|  1.92M|                                 int32_t indicator_indent = 0;
 4955|  2.46M|                                 while (scan != end && *scan == ' ') {
  ------------------
  |  Branch (4955:41): [True: 2.38M, False: 81.3k]
  |  Branch (4955:56): [True: 542k, False: 1.84M]
  ------------------
 4956|   542k|                                    ++indicator_indent;
 4957|   542k|                                    ++scan;
 4958|   542k|                                 }
 4959|       |
 4960|  1.92M|                                 if (scan != end && *scan == ':') {
  ------------------
  |  Branch (4960:38): [True: 1.84M, False: 81.3k]
  |  Branch (4960:53): [True: 97.9k, False: 1.74M]
  ------------------
 4961|  97.9k|                                    const auto after_colon = scan + 1;
 4962|  97.9k|                                    if ((after_colon == end ||
  ------------------
  |  Branch (4962:42): [True: 3.06k, False: 94.9k]
  ------------------
 4963|  94.9k|                                         yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*after_colon)]) &&
  ------------------
  |  Branch (4963:42): [True: 64.1k, False: 30.7k]
  ------------------
 4964|  67.2k|                                        indicator_indent <= line_indent) {
  ------------------
  |  Branch (4964:41): [True: 45.0k, False: 22.1k]
  ------------------
 4965|  45.0k|                                       key_node_end = line_start;
 4966|  45.0k|                                       break;
 4967|  45.0k|                                    }
 4968|  97.9k|                                 }
 4969|  1.92M|                              }
 4970|   401k|                           }
 4971|       |
 4972|   401k|                           glz::generic key_node{};
 4973|   401k|                           const bool prev_explicit_mapping_key_context = ctx.explicit_mapping_key_context;
 4974|   401k|                           ctx.explicit_mapping_key_context = true;
 4975|   401k|                           from<YAML, glz::generic>::template op<Opts>(key_node, ctx, key_node_it, key_node_end);
 4976|   401k|                           ctx.explicit_mapping_key_context = prev_explicit_mapping_key_context;
 4977|   401k|                           if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4977:32): [True: 17.8k, False: 383k]
  ------------------
 4978|  17.8k|                              return false;
 4979|   383k|                           it = key_node_it;
 4980|   383k|                           if (!to_string_key(key_node)) [[unlikely]]
  ------------------
  |  Branch (4980:32): [True: 12, False: 383k]
  ------------------
 4981|     12|                              return false;
 4982|   383k|                        }
 4983|       |                     }
 4984|       |                     else {
 4985|       |                        if (it != end && !yaml::line_end_or_comment_table[static_cast<uint8_t>(*it)]) {
 4986|       |                           from<YAML, key_t>::template op<Opts>(key, ctx, it, end);
 4987|       |                           if (bool(ctx.error)) [[unlikely]]
 4988|       |                              return false;
 4989|       |                        }
 4990|       |                     }
 4991|       |
 4992|   411k|                     yaml::skip_inline_ws(it, end);
 4993|   429k|                     yaml::skip_comment(it, end);
 4994|       |
 4995|       |                     // Value indicator may appear on the next line at the same indent.
 4996|   429k|                     if (it != end && (*it == '\n' || *it == '\r')) {
  ------------------
  |  Branch (4996:26): [True: 259k, False: 169k]
  |  Branch (4996:40): [True: 49.0k, False: 210k]
  |  Branch (4996:55): [True: 79.8k, False: 130k]
  ------------------
 4997|   128k|                        auto probe = it;
 4998|   128k|                        bool found_value_indicator = false;
 4999|       |
 5000|   219k|                        while (probe != end && (*probe == '\n' || *probe == '\r')) {
  ------------------
  |  Branch (5000:32): [True: 195k, False: 23.7k]
  |  Branch (5000:49): [True: 65.1k, False: 130k]
  |  Branch (5000:67): [True: 130k, False: 0]
  ------------------
 5001|   195k|                           yaml::skip_newline(probe, end);
 5002|       |
 5003|   195k|                           auto value_line = probe;
 5004|   195k|                           int32_t value_indent = yaml::measure_indent(value_line, end, ctx);
 5005|   195k|                           if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (5005:32): [True: 8, False: 195k]
  ------------------
 5006|      8|                              return false;
 5007|       |
 5008|   195k|                           if (value_line == end || *value_line == '\n' || *value_line == '\r') {
  ------------------
  |  Branch (5008:32): [True: 15.7k, False: 179k]
  |  Branch (5008:53): [True: 11.7k, False: 167k]
  |  Branch (5008:76): [True: 31.2k, False: 136k]
  ------------------
 5009|  58.7k|                              probe = value_line;
 5010|  58.7k|                              continue; // blank line
 5011|  58.7k|                           }
 5012|   136k|                           if (*value_line == '#') {
  ------------------
  |  Branch (5012:32): [True: 31.5k, False: 105k]
  ------------------
 5013|  31.5k|                              yaml::skip_comment(value_line, end);
 5014|  31.5k|                              probe = value_line;
 5015|  31.5k|                              continue; // comment-only line
 5016|  31.5k|                           }
 5017|   105k|                           if (*value_line == ':' && value_indent == explicit_value_indicator_indent) {
  ------------------
  |  Branch (5017:32): [True: 9.16k, False: 96.0k]
  |  Branch (5017:54): [True: 4.02k, False: 5.13k]
  ------------------
 5018|  4.02k|                              it = value_line;
 5019|  4.02k|                              found_value_indicator = true;
 5020|  4.02k|                           }
 5021|   105k|                           break;
 5022|   136k|                        }
 5023|       |
 5024|   128k|                        if (found_value_indicator) {
  ------------------
  |  Branch (5024:29): [True: 4.02k, False: 124k]
  ------------------
 5025|  4.02k|                           yaml::skip_inline_ws(it, end);
 5026|  4.02k|                        }
 5027|   128k|                     }
 5028|       |
 5029|   429k|                     val_t val{};
 5030|   429k|                     if (it != end && *it == ':') {
  ------------------
  |  Branch (5030:26): [True: 259k, False: 169k]
  |  Branch (5030:39): [True: 80.6k, False: 178k]
  ------------------
 5031|  80.6k|                        ++it;
 5032|  80.6k|                        if (it != end && *it == '\t') {
  ------------------
  |  Branch (5032:29): [True: 79.6k, False: 1.04k]
  |  Branch (5032:42): [True: 6, False: 79.6k]
  ------------------
 5033|      6|                           ctx.error = error_code::syntax_error;
 5034|      6|                           return false;
 5035|      6|                        }
 5036|  80.6k|                        if (it != end && (*it == '\n' || *it == '\r')) {
  ------------------
  |  Branch (5036:29): [True: 79.6k, False: 1.04k]
  |  Branch (5036:43): [True: 6.30k, False: 73.3k]
  |  Branch (5036:58): [True: 7.80k, False: 65.5k]
  ------------------
 5037|  14.1k|                           auto probe = it;
 5038|  14.1k|                           yaml::skip_newline(probe, end);
 5039|  26.7k|                           while (probe != end && *probe == ' ') ++probe;
  ------------------
  |  Branch (5039:35): [True: 24.4k, False: 2.30k]
  |  Branch (5039:51): [True: 12.6k, False: 11.8k]
  ------------------
 5040|  14.1k|                           if (probe != end && *probe == ':' && ((probe + 1) != end) && *(probe + 1) == '\t') {
  ------------------
  |  Branch (5040:32): [True: 11.8k, False: 2.30k]
  |  Branch (5040:48): [True: 3.37k, False: 8.43k]
  |  Branch (5040:65): [True: 3.04k, False: 324]
  |  Branch (5040:89): [True: 0, False: 3.04k]
  ------------------
 5041|      0|                              ctx.error = error_code::syntax_error;
 5042|      0|                              return false;
 5043|      0|                           }
 5044|  14.1k|                        }
 5045|  80.6k|                        yaml::skip_inline_ws(it, end);
 5046|  80.6k|                        if (!parse_map_value(val)) [[unlikely]]
  ------------------
  |  Branch (5046:29): [True: 11.1k, False: 69.4k]
  ------------------
 5047|  11.1k|                           return false;
 5048|  80.6k|                     }
 5049|       |
 5050|   418k|                     value.emplace(std::move(key), std::move(val));
 5051|   418k|                     return true;
 5052|   429k|                  }
 5053|       |
 5054|   548k|                  key_t key{};
 5055|   548k|                  if constexpr (std::same_as<std::remove_cvref_t<key_t>, std::string>) {
 5056|   548k|                     auto key_probe = it;
 5057|   548k|                     yaml::skip_inline_ws(key_probe, end);
 5058|   548k|                     const bool complex_flow_key = (key_probe != end && (*key_probe == '[' || *key_probe == '{'));
  ------------------
  |  Branch (5058:53): [True: 548k, False: 0]
  |  Branch (5058:74): [True: 886, False: 547k]
  |  Branch (5058:95): [True: 6.52k, False: 541k]
  ------------------
 5059|   548k|                     if (complex_flow_key) {
  ------------------
  |  Branch (5059:26): [True: 7.41k, False: 541k]
  ------------------
 5060|  7.41k|                        glz::generic key_node{};
 5061|  7.41k|                        from<YAML, glz::generic>::template op<yaml::flow_context_on<Opts>()>(key_node, ctx, it, end);
 5062|  7.41k|                        if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (5062:29): [True: 3.91k, False: 3.49k]
  ------------------
 5063|  3.91k|                           return false;
 5064|  3.49k|                        if (!yaml::materialize_key(key, key_node, ctx)) [[unlikely]]
  ------------------
  |  Branch (5064:29): [True: 0, False: 3.49k]
  ------------------
 5065|      0|                           return false;
 5066|  3.49k|                     }
 5067|   541k|                     else {
 5068|   541k|                        if (!yaml::parse_yaml_key(key, ctx, it, end, false)) {
  ------------------
  |  Branch (5068:29): [True: 101k, False: 440k]
  ------------------
 5069|   101k|                           return false;
 5070|   101k|                        }
 5071|   541k|                     }
 5072|       |                  }
 5073|       |                  else {
 5074|       |                     from<YAML, key_t>::template op<Opts>(key, ctx, it, end);
 5075|       |                     if (bool(ctx.error)) [[unlikely]]
 5076|       |                        return false;
 5077|       |                  }
 5078|       |
 5079|   443k|                  yaml::skip_inline_ws(it, end);
 5080|       |
 5081|   548k|                  if (it == end || *it != ':') {
  ------------------
  |  Branch (5081:23): [True: 105k, False: 443k]
  |  Branch (5081:36): [True: 94, False: 443k]
  ------------------
 5082|    192|                     ctx.error = error_code::syntax_error;
 5083|    192|                     return false;
 5084|    192|                  }
 5085|   548k|                  ++it;
 5086|   548k|                  yaml::skip_inline_ws(it, end);
 5087|       |
 5088|   548k|                  val_t val{};
 5089|   548k|                  if (!parse_map_value(val)) [[unlikely]]
  ------------------
  |  Branch (5089:23): [True: 27.9k, False: 520k]
  ------------------
 5090|  27.9k|                     return false;
 5091|       |
 5092|   520k|                  value.emplace(std::move(key), std::move(val));
 5093|   520k|                  return true;
 5094|   548k|               });
_ZZZN3glz4fromILj450ENS_17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES1_EEEEE2opITnDaXtlNS_4optsELj10ELb1ELb0ELb0ELb1EEERPKcRS5_TkNS_10is_contextERNS_4yaml12yaml_contextESA_EEvOT1_OT2_OT0_T3_ENKUlRT_RSK_SG_iE_clISE_SA_SA_EEbSO_SP_SG_iENKUlvE_clEv:
 4915|   429k|                        const bool key_content_spans_lines = [&] {
 4916|   429k|                           auto scan = key_it;
 4917|   472k|                           while (scan != content && scan != end) {
  ------------------
  |  Branch (4917:35): [True: 329k, False: 143k]
  |  Branch (4917:54): [True: 329k, False: 0]
  ------------------
 4918|   329k|                              if (*scan == '\n' || *scan == '\r') return true;
  ------------------
  |  Branch (4918:35): [True: 189k, False: 139k]
  |  Branch (4918:52): [True: 96.7k, False: 43.0k]
  ------------------
 4919|  43.0k|                              ++scan;
 4920|  43.0k|                           }
 4921|   143k|                           return false;
 4922|   429k|                        }();
_ZZZN3glz4fromILj450ENS_17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES1_EEEEE2opITnDaXtlNS_4optsELj10ELb1ELb0ELb0ELb1EEERPKcRS5_TkNS_10is_contextERNS_4yaml12yaml_contextESA_EEvOT1_OT2_OT0_T3_ENKUlRT_RSK_SG_iE_clISE_SA_SA_EEbSO_SP_SG_iENKUlRS4_E0_clESS_:
 4858|   383k|                        auto to_string_key = [&](glz::generic& key_node) {
 4859|   383k|                           return yaml::materialize_key(key, key_node, ctx);
 4860|   383k|                        };
_ZZZN3glz4fromILj450ENS_17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES1_EEEEE2opITnDaXtlNS_4optsELj10ELb1ELb0ELb0ELb1EEERPKcRS5_TkNS_10is_contextERNS_4yaml12yaml_contextESA_EEvOT1_OT2_OT0_T3_ENKUlRT_RSK_SG_iE_clISE_SA_SA_EEbSO_SP_SG_iENKUlRS4_E_clESS_:
 4778|   524k|                  auto parse_map_value = [&](val_t& val) -> bool {
 4779|   524k|                     if (it != end && !yaml::line_end_or_comment_table[static_cast<uint8_t>(*it)]) {
  ------------------
  |  Branch (4779:26): [True: 481k, False: 42.1k]
  |  Branch (4779:39): [True: 336k, False: 145k]
  ------------------
 4780|   336k|                        bool line_starts_with_explicit_value_indicator = false;
 4781|       |
 4782|       |                        // Inline mapping values in block context cannot start with a
 4783|       |                        // plain "key: value" pair on the same line (e.g. "a: b: c").
 4784|       |                        // Such constructs are malformed unless wrapped in flow
 4785|       |                        // delimiters ({...} / [...]) or quoted.
 4786|   336k|                        if constexpr (std::is_pointer_v<std::decay_t<decltype(it)>>) {
 4787|   336k|                           if (ctx.stream_begin) {
  ------------------
  |  Branch (4787:32): [True: 336k, False: 0]
  ------------------
 4788|   336k|                              auto is_line_content_start = [&](auto pos) {
 4789|   336k|                                 return !ctx.line_prefix_before(pos).has_content;
 4790|   336k|                              };
 4791|       |
 4792|   336k|                              auto line_has_explicit_value_indicator = [&](auto pos) {
 4793|   336k|                                 const char* line = ctx.line_begin_of(pos);
 4794|   336k|                                 while (line != end && (*line == ' ' || *line == '\t')) ++line;
 4795|   336k|                                 return line != end && *line == ':';
 4796|   336k|                              };
 4797|       |
 4798|   336k|                              if (!is_line_content_start(it) &&
  ------------------
  |  Branch (4798:35): [True: 336k, False: 0]
  ------------------
 4799|   336k|                                  yaml::inline_value_has_plain_mapping_indicator(it, end) &&
  ------------------
  |  Branch (4799:35): [True: 15.1k, False: 321k]
  ------------------
 4800|  15.1k|                                  !line_has_explicit_value_indicator(it)) {
  ------------------
  |  Branch (4800:35): [True: 20, False: 15.1k]
  ------------------
 4801|     20|                                 ctx.error = error_code::syntax_error;
 4802|     20|                                 return false;
 4803|     20|                              }
 4804|   336k|                              line_starts_with_explicit_value_indicator = line_has_explicit_value_indicator(it);
 4805|   336k|                           }
 4806|   336k|                        }
 4807|       |
 4808|   336k|                        if (*it == '-' &&
  ------------------
  |  Branch (4808:29): [True: 4.79k, False: 331k]
  ------------------
 4809|  4.79k|                            ((it + 1) == end || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*(it + 1))]) &&
  ------------------
  |  Branch (4809:30): [True: 532, False: 4.26k]
  |  Branch (4809:49): [True: 632, False: 3.63k]
  ------------------
 4810|  1.16k|                            !line_starts_with_explicit_value_indicator) {
  ------------------
  |  Branch (4810:29): [True: 12, False: 1.15k]
  ------------------
 4811|       |                           // "key: - item" is not valid block sequence syntax.
 4812|     12|                           ctx.error = error_code::syntax_error;
 4813|     12|                           return false;
 4814|     12|                        }
 4815|       |
 4816|   336k|                        if (!ctx.push_indent(line_indent + 1)) [[unlikely]]
  ------------------
  |  Branch (4816:29): [True: 0, False: 336k]
  ------------------
 4817|      0|                           return false;
 4818|   336k|                        from<YAML, val_t>::template op<Opts>(val, ctx, it, end);
 4819|   336k|                        ctx.pop_indent();
 4820|   336k|                     }
 4821|   187k|                     else {
 4822|   187k|                        int32_t nested_indent = yaml::detect_nested_value_indent(ctx, it, end, line_indent);
 4823|   187k|                        if (nested_indent >= 0) {
  ------------------
  |  Branch (4823:29): [True: 62.7k, False: 125k]
  ------------------
 4824|  62.7k|                           yaml::skip_to_content(it, end);
 4825|  62.7k|                           if (it != end && *it == ':' && (it + 1) != end && *(it + 1) == '\t') {
  ------------------
  |  Branch (4825:32): [True: 62.7k, False: 0]
  |  Branch (4825:45): [True: 0, False: 62.7k]
  |  Branch (4825:59): [True: 0, False: 0]
  |  Branch (4825:78): [True: 0, False: 0]
  ------------------
 4826|      0|                              ctx.error = error_code::syntax_error;
 4827|      0|                              return false;
 4828|      0|                           }
 4829|       |                           // A struct value reads the pushed indent as its own key column;
 4830|       |                           // every other value type reads it as the enclosing baseline.
 4831|  62.7k|                           const int32_t value_indent =
 4832|  62.7k|                              yaml::receives_block_mapping_column<val_t>() ? nested_indent : nested_indent - 1;
  ------------------
  |  Branch (4832:31): [Folded, False: 62.7k]
  ------------------
 4833|  62.7k|                           if (!ctx.push_indent(value_indent)) [[unlikely]]
  ------------------
  |  Branch (4833:32): [True: 0, False: 62.7k]
  ------------------
 4834|      0|                              return false;
 4835|  62.7k|                           from<YAML, val_t>::template op<Opts>(val, ctx, it, end);
 4836|  62.7k|                           ctx.pop_indent();
 4837|  62.7k|                        }
 4838|   187k|                     }
 4839|   524k|                     return !bool(ctx.error);
 4840|   524k|                  };
_ZZZZN3glz4fromILj450ENS_17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES1_EEEEE2opITnDaXtlNS_4optsELj10ELb1ELb0ELb0ELb1EEERPKcRS5_TkNS_10is_contextERNS_4yaml12yaml_contextESA_EEvOT1_OT2_OT0_T3_ENKUlRT_RSK_SG_iE_clISE_SA_SA_EEbSO_SP_SG_iENKUlRS4_E_clESS_ENKUlSN_E_clISA_EEDaSN_:
 4788|   336k|                              auto is_line_content_start = [&](auto pos) {
 4789|   336k|                                 return !ctx.line_prefix_before(pos).has_content;
 4790|   336k|                              };
_ZZZZN3glz4fromILj450ENS_17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES1_EEEEE2opITnDaXtlNS_4optsELj10ELb1ELb0ELb0ELb1EEERPKcRS5_TkNS_10is_contextERNS_4yaml12yaml_contextESA_EEvOT1_OT2_OT0_T3_ENKUlRT_RSK_SG_iE_clISE_SA_SA_EEbSO_SP_SG_iENKUlRS4_E_clESS_ENKUlSN_E0_clISA_EEDaSN_:
 4792|   351k|                              auto line_has_explicit_value_indicator = [&](auto pos) {
 4793|   351k|                                 const char* line = ctx.line_begin_of(pos);
 4794|   602k|                                 while (line != end && (*line == ' ' || *line == '\t')) ++line;
  ------------------
  |  Branch (4794:41): [True: 602k, False: 0]
  |  Branch (4794:57): [True: 245k, False: 357k]
  |  Branch (4794:73): [True: 5.68k, False: 351k]
  ------------------
 4795|   351k|                                 return line != end && *line == ':';
  ------------------
  |  Branch (4795:41): [True: 351k, False: 0]
  |  Branch (4795:56): [True: 92.6k, False: 258k]
  ------------------
 4796|   351k|                              };
_ZZN3glz4fromILj450ENS_17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES1_EEEEE2opITnDaXtlNS_4optsELj10ELb1ELb0ELb0ELb1EEERPKcRS5_TkNS_10is_contextERNS_4yaml12yaml_contextESA_EEvOT1_OT2_OT0_T3_EN19merge_restore_guardD2Ev:
 4547|   914k|            {
 4548|       |               // emplace is a no-op for keys the document already wrote, so only
 4549|       |               // untouched pre-existing entries are put back.
 4550|   914k|               for (auto& entry : saved) {
  ------------------
  |  Branch (4550:33): [True: 0, False: 914k]
  ------------------
 4551|      0|                  target.emplace(entry.first, std::move(entry.second));
 4552|      0|               }
 4553|   914k|            }
_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|  14.1k|      {
  301|  14.1k|         if (it == end || *it != '*') return false;
  ------------------
  |  Branch (301:14): [True: 0, False: 14.1k]
  |  Branch (301:27): [True: 0, False: 14.1k]
  ------------------
  302|       |
  303|  14.1k|         ++it; // skip '*'
  304|  14.1k|         auto name = parse_anchor_name(it, end);
  305|  14.1k|         if (name.empty()) {
  ------------------
  |  Branch (305:14): [True: 44, False: 14.0k]
  ------------------
  306|     44|            ctx.error = error_code::syntax_error;
  307|     44|            return true;
  308|     44|         }
  309|       |
  310|  14.0k|         auto anchor_it = ctx.anchors.find(name);
  311|  14.0k|         if (anchor_it == ctx.anchors.end()) {
  ------------------
  |  Branch (311:14): [True: 72, False: 14.0k]
  ------------------
  312|     72|            ctx.error = error_code::syntax_error; // undefined alias
  313|     72|            return true;
  314|     72|         }
  315|       |
  316|       |         // Copied rather than referenced: the replay below can replace ctx.anchors wholesale
  317|       |         // (a speculative parse hands its own map back), which would dangle a reference here.
  318|  14.0k|         const auto span = anchor_it->second;
  319|       |
  320|       |         // Empty anchor span (anchor on null/empty node) — leave value as default
  321|  14.0k|         if (span.begin == span.end) {
  ------------------
  |  Branch (321:14): [True: 530, False: 13.4k]
  ------------------
  322|    530|            return true;
  323|    530|         }
  324|       |
  325|       |         // An anchor is invisible to itself while it expands. A span that aliases the name it
  326|       |         // defines -- reachable because a mapping key's anchor is registered over the key text
  327|       |         // before that text is parsed -- would otherwise replay itself forever.
  328|  13.4k|         if (ctx.alias_span_is_replaying(span.begin, span.end)) [[unlikely]] {
  ------------------
  |  Branch (328:14): [True: 970, False: 12.5k]
  ------------------
  329|    970|            ctx.error = error_code::syntax_error; // cyclic alias
  330|    970|            return true;
  331|    970|         }
  332|       |
  333|       |         // Replaying an anchor re-enters the reader directly, bypassing the variant reader's
  334|       |         // depth guard, so this is the only depth accounting a chain of aliases into a
  335|       |         // non-variant target gets. The cycle check above stops the unbounded case; this bounds
  336|       |         // a legitimate but deeply chained one.
  337|  12.5k|         depth_guard guard{ctx, yaml::max_yaml_recursive_depth};
  338|  12.5k|         if (!guard) [[unlikely]]
  ------------------
  |  Branch (338:14): [True: 10, False: 12.4k]
  ------------------
  339|     10|            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: 9.81k, False: 2.67k]
  ------------------
  354|  9.81k|            ctx.push_indent(span.base_indent - 1);
  355|  9.81k|         }
  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|      }
_ZN3glz33process_yaml_variant_alternativesINSt3__17variantIJDndNS1_12basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEbNS1_6vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS6_ISD_EEEENSC_ISD_EEEEENS_19is_yaml_variant_strEE2opITnDaXtlNS_4optsELj10ELb1ELb0ELb0ELb1EEERSH_TkNS_10is_contextERNS_4yaml12yaml_contextERPKcSR_EEvOT0_OT1_OT2_T3_:
 5205|   487k|      {
 5206|   487k|         constexpr auto category_count = yaml_variant_count_v<Variant, Trait>;
 5207|       |
 5208|       |         if constexpr (category_count == 0) {
 5209|       |            ctx.error = error_code::no_matching_variant_type;
 5210|       |         }
 5211|   487k|         else if constexpr (category_count == 1) {
 5212|       |            // Only one type in this category, use it directly
 5213|   487k|            constexpr auto first_idx = yaml_variant_first_index_v<Variant, Trait>;
 5214|   487k|            using V = std::variant_alternative_t<first_idx, Variant>;
 5215|   487k|            if (!std::holds_alternative<V>(value)) value = V{};
  ------------------
  |  Branch (5215:17): [True: 487k, False: 0]
  ------------------
 5216|   487k|            from<YAML, V>::template op<Opts>(std::get<V>(value), ctx, it, end);
 5217|       |         }
 5218|       |         else {
 5219|       |            // Multiple types in this category, try each one
 5220|       |            constexpr auto N = std::variant_size_v<Variant>;
 5221|       |            bool found_match{};
 5222|       |            size_t match_idx = 0;
 5223|       |            // Only the last alternative propagates its error, so an alternative that exhausted an
 5224|       |            // expansion budget would otherwise be reported as no_matching_variant_type -- a wrong
 5225|       |            // diagnosis for a document that is hostile rather than merely the wrong shape. Held
 5226|       |            // aside and used only if nothing matched, so an alternative that does succeed later
 5227|       |            // (one that materializes no key text can still parse under a latched budget) is
 5228|       |            // unaffected.
 5229|       |            error_code expansion_error{};
 5230|       |            std::string_view expansion_message{};
 5231|       |
 5232|       |            for_each<N>([&]<size_t I>() {
 5233|       |               if (found_match) {
 5234|       |                  return;
 5235|       |               }
 5236|       |               using V = std::variant_alternative_t<I, Variant>;
 5237|       |               if constexpr (Trait<V>::value) {
 5238|       |                  auto copy_it = it;
 5239|       |                  if (!std::holds_alternative<V>(value)) {
 5240|       |                     value = V{};
 5241|       |                  }
 5242|       |
 5243|       |                  auto temp_ctx = ctx.make_speculative();
 5244|       |                  from<YAML, V>::template op<Opts>(std::get<V>(value), temp_ctx, it, end);
 5245|       |
 5246|       |                  // Charged whether or not the alternative fit: a rejected probe still replayed
 5247|       |                  // whatever aliases it reached, and an attempt that is never billed is an
 5248|       |                  // attempt that can be repeated for free.
 5249|       |                  ctx.alias_expansion_budget = temp_ctx.alias_expansion_budget;
 5250|       |                  ctx.key_expansion_budget = temp_ctx.key_expansion_budget;
 5251|       |
 5252|       |                  if (!bool(temp_ctx.error)) {
 5253|       |                     found_match = true;
 5254|       |                     ctx.anchors = std::move(temp_ctx.anchors);
 5255|       |                  }
 5256|       |                  else {
 5257|       |                     it = copy_it;
 5258|       |                     if (temp_ctx.error == error_code::exceeded_max_expansion && expansion_error == error_code::none) {
 5259|       |                        expansion_error = temp_ctx.error;
 5260|       |                        expansion_message = temp_ctx.custom_error_message;
 5261|       |                     }
 5262|       |                     if (match_idx + 1 < category_count) {
 5263|       |                        // Not the last type, continue trying
 5264|       |                     }
 5265|       |                     else {
 5266|       |                        // Last type failed, propagate error
 5267|       |                        ctx.error = temp_ctx.error;
 5268|       |                        ctx.custom_error_message = temp_ctx.custom_error_message;
 5269|       |                     }
 5270|       |                  }
 5271|       |                  ++match_idx;
 5272|       |               }
 5273|       |            });
 5274|       |
 5275|       |            if (!found_match && !bool(ctx.error)) {
 5276|       |               if (expansion_error != error_code::none) {
 5277|       |                  ctx.error = expansion_error;
 5278|       |                  ctx.custom_error_message = expansion_message;
 5279|       |               }
 5280|       |               else {
 5281|       |                  ctx.error = error_code::no_matching_variant_type;
 5282|       |               }
 5283|       |            }
 5284|       |         }
 5285|   487k|      }
_ZN3glz4fromILj450ENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEE2opITnDaXtlNS_4optsELj10ELb1ELb0ELb0ELb1EEERPKcRS7_TkNS_10is_contextERNS_4yaml12yaml_contextESC_EEvOT1_OT2_OT0_T3_:
 1892|   494k|      {
 1893|   494k|         if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (1893:14): [True: 14.8k, False: 480k]
  ------------------
 1894|  14.8k|            return;
 1895|       |
 1896|   480k|         yaml::node_preamble_state preamble{};
 1897|   480k|         if (yaml::parse_node_preamble<Opts, yaml::node_property_policy{true, false, false, true}>(
  ------------------
  |  Branch (1897:14): [True: 7.76k, False: 472k]
  ------------------
 1898|   480k|                value, ctx, it, end, preamble, [](yaml::yaml_tag tag) { return yaml::tag_valid_for_string(tag); }))
 1899|  7.76k|            return;
 1900|       |
 1901|   472k|         std::string str;
 1902|   472k|         const auto style = yaml::detect_scalar_style(*it);
 1903|       |
 1904|   472k|         switch (style) {
  ------------------
  |  Branch (1904:18): [True: 472k, False: 0]
  ------------------
 1905|  5.74k|         case yaml::scalar_style::double_quoted:
  ------------------
  |  Branch (1905:10): [True: 5.74k, False: 466k]
  ------------------
 1906|  5.74k|            yaml::parse_double_quoted_string(str, ctx, it, end);
 1907|  5.74k|            break;
 1908|  11.8k|         case yaml::scalar_style::single_quoted:
  ------------------
  |  Branch (1908:10): [True: 11.8k, False: 460k]
  ------------------
 1909|  11.8k|            yaml::parse_single_quoted_string(str, ctx, it, end);
 1910|  11.8k|            break;
 1911|  3.59k|         case yaml::scalar_style::literal_block:
  ------------------
  |  Branch (1911:10): [True: 3.59k, False: 468k]
  ------------------
 1912|  16.3k|         case yaml::scalar_style::folded_block:
  ------------------
  |  Branch (1912:10): [True: 12.7k, False: 459k]
  ------------------
 1913|       |            // For same-line mapping/sequence values, parsing context is typically pushed
 1914|       |            // one column past the key/item indicator; block scalar indentation is relative
 1915|       |            // to the parent line indent.
 1916|  16.3k|            yaml::parse_block_scalar(str, ctx, it, end,
 1917|  16.3k|                                     ctx.current_indent() > 0 ? (ctx.current_indent() - 1) : ctx.current_indent());
  ------------------
  |  Branch (1917:38): [True: 2.81k, False: 13.5k]
  ------------------
 1918|  16.3k|            break;
 1919|   438k|         case yaml::scalar_style::plain:
  ------------------
  |  Branch (1919:10): [True: 438k, False: 33.9k]
  ------------------
 1920|       |            // In block context with known indent, use multiline parsing to support
 1921|       |            // plain scalars that span multiple lines (folding behavior)
 1922|   438k|            if constexpr (!yaml::check_flow_context(Opts)) {
 1923|   438k|               if (ctx.current_indent() >= 0) {
  ------------------
  |  Branch (1923:20): [True: 262k, False: 176k]
  ------------------
 1924|   262k|                  yaml::parse_plain_scalar_multiline(str, ctx, it, end, ctx.current_indent());
 1925|   262k|               }
 1926|   176k|               else {
 1927|       |                  // Top-level plain scalars may continue on same-indent or indented lines.
 1928|   176k|                  yaml::parse_plain_scalar_multiline(str, ctx, it, end, int32_t(0));
 1929|   176k|               }
 1930|       |            }
 1931|       |            else {
 1932|       |               yaml::parse_plain_scalar(str, ctx, it, end, true);
 1933|       |            }
 1934|   438k|            break;
 1935|   472k|         }
 1936|       |
 1937|   472k|         if (!bool(ctx.error)) {
  ------------------
  |  Branch (1937:14): [True: 472k, False: 138]
  ------------------
 1938|   472k|            value = std::move(str);
 1939|   472k|            yaml::finalize_node_anchor(preamble.node_props, ctx, it);
 1940|   472k|         }
 1941|   472k|      }
_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|   480k|      {
  466|   480k|         skip_inline_ws(it, end);
  467|       |
  468|   480k|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (468:14): [True: 14, False: 480k]
  ------------------
  469|     14|            if constexpr (!AllowEmptyInput) {
  470|     14|               ctx.error = error_code::unexpected_end;
  471|     14|            }
  472|     14|            return true;
  473|     14|         }
  474|       |
  475|   480k|         preamble.tag = parse_yaml_tag(it, end, ctx);
  476|   480k|         if (preamble.tag == yaml_tag::unknown) [[unlikely]] {
  ------------------
  |  Branch (476:14): [True: 12, False: 480k]
  ------------------
  477|     12|            ctx.error = error_code::syntax_error;
  478|     12|            return true;
  479|     12|         }
  480|   480k|         if (!tag_validator(preamble.tag)) [[unlikely]] {
  ------------------
  |  Branch (480:14): [True: 6, False: 480k]
  ------------------
  481|      6|            ctx.error = error_code::syntax_error;
  482|      6|            return true;
  483|      6|         }
  484|       |
  485|   480k|         skip_inline_ws(it, end);
  486|       |
  487|   480k|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (487:14): [True: 6, False: 480k]
  ------------------
  488|      6|            if constexpr (!AllowEmptyInput) {
  489|      6|               ctx.error = error_code::unexpected_end;
  490|      6|            }
  491|      6|            return true;
  492|      6|         }
  493|       |
  494|   480k|         if (parse_node_properties<Opts, PropertyPolicy>(std::forward<T>(value), ctx, it, end, preamble.node_props)) {
  ------------------
  |  Branch (494:14): [True: 7.72k, False: 472k]
  ------------------
  495|  7.72k|            return true;
  496|  7.72k|         }
  497|       |
  498|   472k|         return false;
  499|   480k|      }
_ZZN3glz4fromILj450ENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEE2opITnDaXtlNS_4optsELj10ELb1ELb0ELb0ELb1EEERPKcRS7_TkNS_10is_contextERNS_4yaml12yaml_contextESC_EEvOT1_OT2_OT0_T3_ENKUlNSF_8yaml_tagEE_clESP_:
 1898|   480k|                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|   480k|      {
  409|   480k|         state.has_anchor = false;
  410|   480k|         state.anchor_name.clear();
  411|   480k|         state.anchor_start = nullptr;
  412|   480k|         state.anchor_indent = ctx.current_indent();
  413|       |
  414|   480k|         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|   480k|            else {
  421|   480k|               if (handle_alias<Opts>(std::forward<T>(value), ctx, it, end)) return true;
  ------------------
  |  Branch (421:20): [True: 7.67k, False: 472k]
  ------------------
  422|   480k|            }
  423|   480k|         }
  424|       |
  425|   480k|         if (it != end && *it == '&') {
  ------------------
  |  Branch (425:14): [True: 472k, False: 7.67k]
  |  Branch (425:27): [True: 21.8k, False: 450k]
  ------------------
  426|  21.8k|            ++it;
  427|  21.8k|            auto name = parse_anchor_name(it, end);
  428|  21.8k|            if (name.empty()) {
  ------------------
  |  Branch (428:17): [True: 28, False: 21.8k]
  ------------------
  429|     28|               ctx.error = error_code::syntax_error;
  430|     28|               return true;
  431|     28|            }
  432|  21.8k|            skip_inline_ws(it, end);
  433|  21.8k|            if (it == end) {
  ------------------
  |  Branch (433:17): [True: 22, False: 21.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|  21.8k|            if constexpr (Policy.disallow_anchor_on_alias) {
  440|  21.8k|               if (*it == '*') {
  ------------------
  |  Branch (440:20): [True: 6, False: 21.8k]
  ------------------
  441|      6|                  ctx.error = error_code::syntax_error;
  442|      6|                  return true;
  443|      6|               }
  444|  21.8k|            }
  445|  21.8k|            state.has_anchor = true;
  446|  21.8k|            state.anchor_name = std::string(name);
  447|  21.8k|            state.anchor_start = &*it;
  448|  21.8k|         }
  449|       |
  450|   480k|         return false;
  451|   480k|      }
_ZN3glz4yaml12handle_aliasITnDaXtlNS_4optsELj10ELb1ELb0ELb0ELb1EEERNSt3__112basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEENS0_12yaml_contextEPKcSD_EEbOT0_RT1_RT2_T3_:
  300|   480k|      {
  301|   480k|         if (it == end || *it != '*') return false;
  ------------------
  |  Branch (301:14): [True: 0, False: 480k]
  |  Branch (301:27): [True: 472k, False: 7.67k]
  ------------------
  302|       |
  303|  7.67k|         ++it; // skip '*'
  304|  7.67k|         auto name = parse_anchor_name(it, end);
  305|  7.67k|         if (name.empty()) {
  ------------------
  |  Branch (305:14): [True: 18, False: 7.65k]
  ------------------
  306|     18|            ctx.error = error_code::syntax_error;
  307|     18|            return true;
  308|     18|         }
  309|       |
  310|  7.65k|         auto anchor_it = ctx.anchors.find(name);
  311|  7.65k|         if (anchor_it == ctx.anchors.end()) {
  ------------------
  |  Branch (311:14): [True: 44, False: 7.60k]
  ------------------
  312|     44|            ctx.error = error_code::syntax_error; // undefined alias
  313|     44|            return true;
  314|     44|         }
  315|       |
  316|       |         // Copied rather than referenced: the replay below can replace ctx.anchors wholesale
  317|       |         // (a speculative parse hands its own map back), which would dangle a reference here.
  318|  7.60k|         const auto span = anchor_it->second;
  319|       |
  320|       |         // Empty anchor span (anchor on null/empty node) — leave value as default
  321|  7.60k|         if (span.begin == span.end) {
  ------------------
  |  Branch (321:14): [True: 482, False: 7.12k]
  ------------------
  322|    482|            return true;
  323|    482|         }
  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.12k|         if (ctx.alias_span_is_replaying(span.begin, span.end)) [[unlikely]] {
  ------------------
  |  Branch (328:14): [True: 8, False: 7.11k]
  ------------------
  329|      8|            ctx.error = error_code::syntax_error; // cyclic alias
  330|      8|            return true;
  331|      8|         }
  332|       |
  333|       |         // Replaying an anchor re-enters the reader directly, bypassing the variant reader's
  334|       |         // depth guard, so this is the only depth accounting a chain of aliases into a
  335|       |         // non-variant target gets. The cycle check above stops the unbounded case; this bounds
  336|       |         // a legitimate but deeply chained one.
  337|  7.11k|         depth_guard guard{ctx, yaml::max_yaml_recursive_depth};
  338|  7.11k|         if (!guard) [[unlikely]]
  ------------------
  |  Branch (338:14): [True: 24, False: 7.09k]
  ------------------
  339|     24|            return true;
  340|       |
  341|  7.09k|         if (!ctx.charge_alias_expansion(static_cast<size_t>(span.end - span.begin))) [[unlikely]] {
  ------------------
  |  Branch (341:14): [True: 0, False: 7.09k]
  ------------------
  342|      0|            ctx.error = error_code::exceeded_max_expansion;
  343|      0|            ctx.custom_error_message = "alias expansion";
  344|      0|            return true;
  345|      0|         }
  346|       |
  347|  7.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: 1.39k, False: 5.69k]
  ------------------
  354|  1.39k|            ctx.push_indent(span.base_indent - 1);
  355|  1.39k|         }
  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.09k|      }
_ZN3glz4yaml28parse_plain_scalar_multilineINS0_12yaml_contextEPKcS4_EEvRNSt3__112basic_stringIcNS5_11char_traitsIcEENS5_9allocatorIcEEEERT_RT0_T1_i:
 1147|   913k|      {
 1148|   913k|         value.clear();
 1149|       |
 1150|   227M|         while (it != end) {
  ------------------
  |  Branch (1150:17): [True: 226M, False: 257k]
  ------------------
 1151|   226M|            const char c = *it;
 1152|       |
 1153|       |            // Check for newline - potential continuation
 1154|   226M|            if (c == '\n' || c == '\r') {
  ------------------
  |  Branch (1154:17): [True: 741k, False: 226M]
  |  Branch (1154:30): [True: 399k, False: 225M]
  ------------------
 1155|       |               // Trim trailing whitespace from current line
 1156|  1.28M|               while (!value.empty() && (value.back() == ' ' || value.back() == '\t')) {
  ------------------
  |  Branch (1156:23): [True: 1.24M, False: 35.6k]
  |  Branch (1156:42): [True: 90.6k, False: 1.15M]
  |  Branch (1156:65): [True: 49.0k, False: 1.10M]
  ------------------
 1157|   139k|                  value.pop_back();
 1158|   139k|               }
 1159|       |
 1160|       |               // Count consecutive blank lines
 1161|  1.14M|               int blank_lines = 0;
 1162|  1.14M|               auto lookahead = it;
 1163|       |
 1164|  2.55M|               while (lookahead != end) {
  ------------------
  |  Branch (1164:23): [True: 2.41M, False: 142k]
  ------------------
 1165|       |                  // Skip the newline
 1166|  2.41M|                  if (*lookahead == '\r' && (lookahead + 1) != end && *(lookahead + 1) == '\n') {
  ------------------
  |  Branch (1166:23): [True: 1.36M, False: 1.04M]
  |  Branch (1166:45): [True: 1.25M, False: 106k]
  |  Branch (1166:71): [True: 49.2k, False: 1.21M]
  ------------------
 1167|  49.2k|                     ++lookahead;
 1168|  49.2k|                  }
 1169|  2.41M|                  if (lookahead != end && (*lookahead == '\n' || *lookahead == '\r')) {
  ------------------
  |  Branch (1169:23): [True: 2.41M, False: 0]
  |  Branch (1169:44): [True: 1.09M, False: 1.31M]
  |  Branch (1169:66): [True: 1.31M, False: 0]
  ------------------
 1170|  2.41M|                     ++lookahead;
 1171|  2.41M|                  }
 1172|      0|                  else {
 1173|      0|                     break;
 1174|      0|                  }
 1175|       |
 1176|       |                  // Check if this is a blank line or comment-only line
 1177|  2.41M|                  int32_t line_indent = 0;
 1178|       |
 1179|  2.91M|                  while (lookahead != end && (*lookahead == ' ' || *lookahead == '\t')) {
  ------------------
  |  Branch (1179:26): [True: 2.76M, False: 142k]
  |  Branch (1179:47): [True: 400k, False: 2.36M]
  |  Branch (1179:68): [True: 100k, False: 2.26M]
  ------------------
 1180|   501k|                     ++line_indent;
 1181|   501k|                     ++lookahead;
 1182|   501k|                  }
 1183|       |
 1184|  2.41M|                  if (lookahead == end || *lookahead == '\n' || *lookahead == '\r') {
  ------------------
  |  Branch (1184:23): [True: 142k, False: 2.26M]
  |  Branch (1184:43): [True: 303k, False: 1.96M]
  |  Branch (1184:65): [True: 966k, False: 998k]
  ------------------
 1185|       |                     // Blank line
 1186|  1.41M|                     ++blank_lines;
 1187|  1.41M|                     continue;
 1188|  1.41M|                  }
 1189|       |
 1190|   998k|                  if (*lookahead == '#') {
  ------------------
  |  Branch (1190:23): [True: 66.4k, False: 932k]
  ------------------
 1191|       |                     // Comments end plain scalars per YAML spec
 1192|  66.4k|                     return;
 1193|  66.4k|                  }
 1194|       |
 1195|       |                  // Found content - check indentation
 1196|       |                  // Continuation lines must not dedent below the parent block.
 1197|   932k|                  if (line_indent < base_indent) {
  ------------------
  |  Branch (1197:23): [True: 208k, False: 723k]
  ------------------
 1198|       |                     // Dedented - end of scalar
 1199|   208k|                     return;
 1200|   208k|                  }
 1201|       |
 1202|       |                  // Document boundary markers at column 0 start/stop documents and
 1203|       |                  // must terminate a top-level plain scalar continuation.
 1204|   723k|                  if (line_indent == 0 && (at_document_start(lookahead, end) || at_document_end(lookahead, end))) {
  ------------------
  |  Branch (1204:23): [True: 592k, False: 131k]
  |  Branch (1204:44): [True: 3.03k, False: 589k]
  |  Branch (1204:81): [True: 5.24k, False: 583k]
  ------------------
 1205|  8.27k|                     return;
 1206|  8.27k|                  }
 1207|       |
 1208|       |                  // Sequence indicator (- followed by space/newline/end).
 1209|       |                  // Terminates the scalar when the dash is at or above the
 1210|       |                  // enclosing sequence's indicator column, meaning it starts
 1211|       |                  // a sibling entry.  A dash deeper than the indicator is
 1212|       |                  // plain content (yaml-test-suite AB8U).
 1213|   715k|                  if (*lookahead == '-') {
  ------------------
  |  Branch (1213:23): [True: 43.1k, False: 671k]
  ------------------
 1214|  43.1k|                     auto after_dash = lookahead + 1;
 1215|  43.1k|                     if (after_dash == end || *after_dash == ' ' || *after_dash == '\t' || *after_dash == '\n' ||
  ------------------
  |  Branch (1215:26): [True: 766, False: 42.3k]
  |  Branch (1215:47): [True: 4.31k, False: 38.0k]
  |  Branch (1215:69): [True: 2.66k, False: 35.3k]
  |  Branch (1215:92): [True: 6.00k, False: 29.3k]
  ------------------
 1216|  29.3k|                         *after_dash == '\r') {
  ------------------
  |  Branch (1216:26): [True: 1.41k, False: 27.9k]
  ------------------
 1217|  15.1k|                        if (ctx.sequence_dash_indent < 0 || line_indent <= ctx.sequence_dash_indent) {
  ------------------
  |  Branch (1217:29): [True: 3.72k, False: 11.4k]
  |  Branch (1217:61): [True: 9.95k, False: 1.49k]
  ------------------
 1218|  13.6k|                           return;
 1219|  13.6k|                        }
 1220|  15.1k|                     }
 1221|  43.1k|                  }
 1222|       |
 1223|   701k|                  if (ctx.explicit_mapping_key_context) {
  ------------------
  |  Branch (1223:23): [True: 182k, False: 519k]
  ------------------
 1224|       |                     // In explicit mapping keys ("? key"), a following explicit
 1225|       |                     // key/value indicator starts a new mapping entry.
 1226|   182k|                     if (*lookahead == '?' || *lookahead == ':') {
  ------------------
  |  Branch (1226:26): [True: 53.3k, False: 128k]
  |  Branch (1226:47): [True: 15.3k, False: 113k]
  ------------------
 1227|  68.6k|                        auto after = lookahead + 1;
 1228|  68.6k|                        if (after == end || *after == ' ' || *after == '\t' || *after == '\n' || *after == '\r') {
  ------------------
  |  Branch (1228:29): [True: 420, False: 68.2k]
  |  Branch (1228:45): [True: 22.2k, False: 46.0k]
  |  Branch (1228:62): [True: 1.29k, False: 44.7k]
  |  Branch (1228:80): [True: 10.7k, False: 33.9k]
  |  Branch (1228:98): [True: 9.27k, False: 24.6k]
  ------------------
 1229|  43.9k|                           return;
 1230|  43.9k|                        }
 1231|  68.6k|                     }
 1232|       |
 1233|       |                     // Node-property indicators at the start of a continuation
 1234|       |                     // line begin a new key node in explicit-key context.
 1235|   138k|                     if (*lookahead == '&' || *lookahead == '*' || *lookahead == '!') {
  ------------------
  |  Branch (1235:26): [True: 1.13k, False: 137k]
  |  Branch (1235:47): [True: 30.2k, False: 107k]
  |  Branch (1235:68): [True: 528, False: 106k]
  ------------------
 1236|  31.8k|                        return;
 1237|  31.8k|                     }
 1238|   138k|                  }
 1239|       |
 1240|       |                  // In a "- item" value context, an anchor/tag/alias at the start
 1241|       |                  // of a continuation candidate starts a new node, not scalar content.
 1242|   625k|                  if (ctx.sequence_item_value_context &&
  ------------------
  |  Branch (1242:23): [True: 50.9k, False: 574k]
  ------------------
 1243|  50.9k|                      (*lookahead == '&' || *lookahead == '*' || *lookahead == '!')) {
  ------------------
  |  Branch (1243:24): [True: 564, False: 50.3k]
  |  Branch (1243:45): [True: 338, False: 50.0k]
  |  Branch (1243:66): [True: 218, False: 49.8k]
  ------------------
 1244|  1.12k|                     return;
 1245|  1.12k|                  }
 1246|       |
 1247|       |                  // Check for mapping key indicator (content followed by : and space)
 1248|       |                  // This is a heuristic - we look for ": " pattern which indicates a mapping key
 1249|   624k|                  {
 1250|   624k|                     auto scan = lookahead;
 1251|  76.2M|                     while (scan != end && *scan != '\n' && *scan != '\r') {
  ------------------
  |  Branch (1251:29): [True: 76.2M, False: 62.0k]
  |  Branch (1251:44): [True: 75.7M, False: 432k]
  |  Branch (1251:61): [True: 75.7M, False: 85.3k]
  ------------------
 1252|  75.7M|                        if (*scan == ':') {
  ------------------
  |  Branch (1252:29): [True: 138k, False: 75.5M]
  ------------------
 1253|   138k|                           auto after_colon = scan + 1;
 1254|   138k|                           if (after_colon == end || *after_colon == ' ' || *after_colon == '\t' ||
  ------------------
  |  Branch (1254:32): [True: 2.79k, False: 135k]
  |  Branch (1254:54): [True: 24.0k, False: 111k]
  |  Branch (1254:77): [True: 1.57k, False: 109k]
  ------------------
 1255|   109k|                               *after_colon == '\n' || *after_colon == '\r') {
  ------------------
  |  Branch (1255:32): [True: 9.63k, False: 100k]
  |  Branch (1255:56): [True: 6.66k, False: 93.4k]
  ------------------
 1256|       |                              // This looks like a mapping key - end the scalar
 1257|  44.6k|                              return;
 1258|  44.6k|                           }
 1259|   138k|                        }
 1260|  75.6M|                        ++scan;
 1261|  75.6M|                     }
 1262|   624k|                  }
 1263|       |
 1264|       |                  // This is a continuation line
 1265|       |                  // Add appropriate line breaks for blank lines
 1266|  1.71M|                  for (int i = 0; i < blank_lines; ++i) {
  ------------------
  |  Branch (1266:35): [True: 1.13M, False: 579k]
  ------------------
 1267|  1.13M|                     value.push_back('\n');
 1268|  1.13M|                  }
 1269|       |
 1270|       |                  // Add a space to fold the newline (unless we added literal newlines for blank lines)
 1271|   579k|                  if (blank_lines == 0 && !value.empty()) {
  ------------------
  |  Branch (1271:23): [True: 530k, False: 48.9k]
  |  Branch (1271:43): [True: 514k, False: 16.0k]
  ------------------
 1272|   514k|                     value.push_back(' ');
 1273|   514k|                  }
 1274|       |
 1275|       |                  // Move iterator to the content position
 1276|   579k|                  it = lookahead;
 1277|   579k|                  break;
 1278|   624k|               }
 1279|       |
 1280|       |               // If we exhausted the lookahead, we're done
 1281|   722k|               if (lookahead == end) {
  ------------------
  |  Branch (1281:20): [True: 142k, False: 579k]
  ------------------
 1282|   142k|                  return;
 1283|   142k|               }
 1284|       |
 1285|   579k|               continue; // Process the character at the new position
 1286|   722k|            }
 1287|       |
 1288|       |            // Per YAML spec: # only starts a comment when preceded by whitespace
 1289|   225M|            if (c == '#') {
  ------------------
  |  Branch (1289:17): [True: 359k, False: 225M]
  ------------------
 1290|   359k|               if (value.empty() || value.back() == ' ' || value.back() == '\t') {
  ------------------
  |  Branch (1290:20): [True: 2.74k, False: 356k]
  |  Branch (1290:37): [True: 32.0k, False: 324k]
  |  Branch (1290:60): [True: 5.11k, False: 319k]
  ------------------
 1291|  39.9k|                  break; // This is a comment
 1292|  39.9k|               }
 1293|   359k|            }
 1294|       |
 1295|       |            // Colon followed by space/newline ends plain scalar (potential nested mapping)
 1296|   225M|            if (c == ':') {
  ------------------
  |  Branch (1296:17): [True: 555k, False: 225M]
  ------------------
 1297|   555k|               if ((it + 1) == end || *(it + 1) == ' ' || *(it + 1) == '\t' || *(it + 1) == '\n' || *(it + 1) == '\r') {
  ------------------
  |  Branch (1297:20): [True: 4.01k, False: 551k]
  |  Branch (1297:39): [True: 23.8k, False: 527k]
  |  Branch (1297:59): [True: 314, False: 527k]
  |  Branch (1297:80): [True: 3.56k, False: 524k]
  |  Branch (1297:101): [True: 22.6k, False: 501k]
  ------------------
 1298|  54.4k|                  break;
 1299|  54.4k|               }
 1300|   555k|            }
 1301|       |
 1302|   225M|            value.push_back(c);
 1303|   225M|            ++it;
 1304|   225M|         }
 1305|       |
 1306|       |         // Trim trailing whitespace
 1307|   436k|         while (!value.empty() && (value.back() == ' ' || value.back() == '\t')) {
  ------------------
  |  Branch (1307:17): [True: 433k, False: 2.78k]
  |  Branch (1307:36): [True: 73.2k, False: 360k]
  |  Branch (1307:59): [True: 11.4k, False: 349k]
  ------------------
 1308|  84.6k|            value.pop_back();
 1309|  84.6k|         }
 1310|   351k|      }
_ZN3glz33process_yaml_variant_alternativesINSt3__17variantIJDndNS1_12basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEbNS1_6vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS6_ISD_EEEENSC_ISD_EEEEENS_19is_yaml_variant_numEE2opITnDaXtlNS_4optsELj10ELb1ELb0ELb0ELb1EEERSH_TkNS_10is_contextERNS_4yaml12yaml_contextERPKcSR_EEvOT0_OT1_OT2_T3_:
 5205|   160k|      {
 5206|   160k|         constexpr auto category_count = yaml_variant_count_v<Variant, Trait>;
 5207|       |
 5208|       |         if constexpr (category_count == 0) {
 5209|       |            ctx.error = error_code::no_matching_variant_type;
 5210|       |         }
 5211|   160k|         else if constexpr (category_count == 1) {
 5212|       |            // Only one type in this category, use it directly
 5213|   160k|            constexpr auto first_idx = yaml_variant_first_index_v<Variant, Trait>;
 5214|   160k|            using V = std::variant_alternative_t<first_idx, Variant>;
 5215|   160k|            if (!std::holds_alternative<V>(value)) value = V{};
  ------------------
  |  Branch (5215:17): [True: 160k, False: 0]
  ------------------
 5216|   160k|            from<YAML, V>::template op<Opts>(std::get<V>(value), ctx, it, end);
 5217|       |         }
 5218|       |         else {
 5219|       |            // Multiple types in this category, try each one
 5220|       |            constexpr auto N = std::variant_size_v<Variant>;
 5221|       |            bool found_match{};
 5222|       |            size_t match_idx = 0;
 5223|       |            // Only the last alternative propagates its error, so an alternative that exhausted an
 5224|       |            // expansion budget would otherwise be reported as no_matching_variant_type -- a wrong
 5225|       |            // diagnosis for a document that is hostile rather than merely the wrong shape. Held
 5226|       |            // aside and used only if nothing matched, so an alternative that does succeed later
 5227|       |            // (one that materializes no key text can still parse under a latched budget) is
 5228|       |            // unaffected.
 5229|       |            error_code expansion_error{};
 5230|       |            std::string_view expansion_message{};
 5231|       |
 5232|       |            for_each<N>([&]<size_t I>() {
 5233|       |               if (found_match) {
 5234|       |                  return;
 5235|       |               }
 5236|       |               using V = std::variant_alternative_t<I, Variant>;
 5237|       |               if constexpr (Trait<V>::value) {
 5238|       |                  auto copy_it = it;
 5239|       |                  if (!std::holds_alternative<V>(value)) {
 5240|       |                     value = V{};
 5241|       |                  }
 5242|       |
 5243|       |                  auto temp_ctx = ctx.make_speculative();
 5244|       |                  from<YAML, V>::template op<Opts>(std::get<V>(value), temp_ctx, it, end);
 5245|       |
 5246|       |                  // Charged whether or not the alternative fit: a rejected probe still replayed
 5247|       |                  // whatever aliases it reached, and an attempt that is never billed is an
 5248|       |                  // attempt that can be repeated for free.
 5249|       |                  ctx.alias_expansion_budget = temp_ctx.alias_expansion_budget;
 5250|       |                  ctx.key_expansion_budget = temp_ctx.key_expansion_budget;
 5251|       |
 5252|       |                  if (!bool(temp_ctx.error)) {
 5253|       |                     found_match = true;
 5254|       |                     ctx.anchors = std::move(temp_ctx.anchors);
 5255|       |                  }
 5256|       |                  else {
 5257|       |                     it = copy_it;
 5258|       |                     if (temp_ctx.error == error_code::exceeded_max_expansion && expansion_error == error_code::none) {
 5259|       |                        expansion_error = temp_ctx.error;
 5260|       |                        expansion_message = temp_ctx.custom_error_message;
 5261|       |                     }
 5262|       |                     if (match_idx + 1 < category_count) {
 5263|       |                        // Not the last type, continue trying
 5264|       |                     }
 5265|       |                     else {
 5266|       |                        // Last type failed, propagate error
 5267|       |                        ctx.error = temp_ctx.error;
 5268|       |                        ctx.custom_error_message = temp_ctx.custom_error_message;
 5269|       |                     }
 5270|       |                  }
 5271|       |                  ++match_idx;
 5272|       |               }
 5273|       |            });
 5274|       |
 5275|       |            if (!found_match && !bool(ctx.error)) {
 5276|       |               if (expansion_error != error_code::none) {
 5277|       |                  ctx.error = expansion_error;
 5278|       |                  ctx.custom_error_message = expansion_message;
 5279|       |               }
 5280|       |               else {
 5281|       |                  ctx.error = error_code::no_matching_variant_type;
 5282|       |               }
 5283|       |            }
 5284|       |         }
 5285|   160k|      }
_ZN3glz4fromILj450EdE2opITnDaXtlNS_4optsELj10ELb1ELb0ELb0ELb1EEERPKcRdTkNS_10is_contextERNS_4yaml12yaml_contextES5_EEvOT1_OT2_OT0_T3_:
 2047|   162k|      {
 2048|   162k|         if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2048:14): [True: 0, False: 162k]
  ------------------
 2049|      0|            return;
 2050|       |
 2051|   162k|         yaml::node_preamble_state preamble{};
 2052|   162k|         if (yaml::parse_node_preamble<Opts>(value, ctx, it, end, preamble, [](yaml::yaml_tag tag) {
  ------------------
  |  Branch (2052:14): [True: 10.2k, False: 152k]
  ------------------
 2053|   162k|                if constexpr (std::floating_point<std::remove_cvref_t<T>>) {
 2054|   162k|                   return yaml::tag_valid_for_float(tag);
 2055|   162k|                }
 2056|   162k|                else {
 2057|   162k|                   return yaml::tag_valid_for_int(tag);
 2058|   162k|                }
 2059|   162k|             }))
 2060|  10.2k|            return;
 2061|       |
 2062|   152k|         auto finalize = [&] { yaml::finalize_node_anchor(preamble.node_props, ctx, it); };
 2063|       |
 2064|       |         // Check for special float values
 2065|   152k|         if constexpr (std::floating_point<std::remove_cvref_t<T>>) {
 2066|   152k|            auto start = it;
 2067|       |
 2068|       |            // Check for .inf, .nan, -.inf, etc.
 2069|   152k|            if (*it == '.') {
  ------------------
  |  Branch (2069:17): [True: 37.4k, False: 114k]
  ------------------
 2070|  37.4k|               ++it;
 2071|  37.4k|               if (it + 3 <= end && (std::string_view(it, 3) == "inf" || std::string_view(it, 3) == "Inf" ||
  ------------------
  |  Branch (2071:20): [True: 34.8k, False: 2.54k]
  |  Branch (2071:38): [True: 5.47k, False: 29.4k]
  |  Branch (2071:74): [True: 258, False: 29.1k]
  ------------------
 2072|  29.1k|                                     std::string_view(it, 3) == "INF")) {
  ------------------
  |  Branch (2072:38): [True: 1.54k, False: 27.6k]
  ------------------
 2073|  7.27k|                  value = std::numeric_limits<std::remove_cvref_t<T>>::infinity();
 2074|  7.27k|                  it += 3;
 2075|  7.27k|                  finalize();
 2076|  7.27k|                  return;
 2077|  7.27k|               }
 2078|  30.1k|               if (it + 3 <= end && (std::string_view(it, 3) == "nan" || std::string_view(it, 3) == "NaN" ||
  ------------------
  |  Branch (2078:20): [True: 27.6k, False: 2.54k]
  |  Branch (2078:38): [True: 516, False: 27.0k]
  |  Branch (2078:74): [True: 504, False: 26.5k]
  ------------------
 2079|  26.5k|                                     std::string_view(it, 3) == "NAN")) {
  ------------------
  |  Branch (2079:38): [True: 2.91k, False: 23.6k]
  ------------------
 2080|  3.93k|                  value = std::numeric_limits<std::remove_cvref_t<T>>::quiet_NaN();
 2081|  3.93k|                  it += 3;
 2082|  3.93k|                  finalize();
 2083|  3.93k|                  return;
 2084|  3.93k|               }
 2085|  26.2k|               it = start;
 2086|  26.2k|            }
 2087|       |
 2088|   141k|            if (*it == '-' || *it == '+') {
  ------------------
  |  Branch (2088:17): [True: 19.1k, False: 122k]
  |  Branch (2088:31): [True: 33.4k, False: 88.5k]
  ------------------
 2089|  52.6k|               const char sign = *it;
 2090|  52.6k|               ++it;
 2091|  52.6k|               if (it != end && *it == '.') {
  ------------------
  |  Branch (2091:20): [True: 48.9k, False: 3.65k]
  |  Branch (2091:33): [True: 13.3k, False: 35.6k]
  ------------------
 2092|  13.3k|                  ++it;
 2093|  13.3k|                  if (it + 3 <= end && (std::string_view(it, 3) == "inf" || std::string_view(it, 3) == "Inf" ||
  ------------------
  |  Branch (2093:23): [True: 12.5k, False: 764]
  |  Branch (2093:41): [True: 5.42k, False: 7.11k]
  |  Branch (2093:77): [True: 630, False: 6.48k]
  ------------------
 2094|  7.12k|                                        std::string_view(it, 3) == "INF")) {
  ------------------
  |  Branch (2094:41): [True: 1.06k, False: 5.41k]
  ------------------
 2095|  7.12k|                     if (sign == '-') {
  ------------------
  |  Branch (2095:26): [True: 5.55k, False: 1.56k]
  ------------------
 2096|  5.55k|                        value = -std::numeric_limits<std::remove_cvref_t<T>>::infinity();
 2097|  5.55k|                     }
 2098|  1.56k|                     else {
 2099|  1.56k|                        value = std::numeric_limits<std::remove_cvref_t<T>>::infinity();
 2100|  1.56k|                     }
 2101|  7.12k|                     it += 3;
 2102|  7.12k|                     finalize();
 2103|  7.12k|                     return;
 2104|  7.12k|                  }
 2105|  13.3k|               }
 2106|  45.4k|               it = start;
 2107|  45.4k|            }
 2108|   141k|         }
 2109|       |
 2110|       |         // Parse as plain scalar and convert
 2111|   134k|         auto start = it;
 2112|       |
 2113|       |         // Find end of number - use same rules as plain scalar for colons
 2114|  6.97M|         while (it != end) {
  ------------------
  |  Branch (2114:17): [True: 6.93M, False: 42.6k]
  ------------------
 2115|  6.93M|            const char c = *it;
 2116|  6.93M|            if (c == ' ' || c == '\t' || c == '\n' || c == '\r' || c == ',' || c == ']' || c == '}' || c == '#') {
  ------------------
  |  Branch (2116:17): [True: 43.6k, False: 6.89M]
  |  Branch (2116:29): [True: 12.7k, False: 6.87M]
  |  Branch (2116:42): [True: 10.2k, False: 6.86M]
  |  Branch (2116:55): [True: 12.1k, False: 6.85M]
  |  Branch (2116:68): [True: 936, False: 6.85M]
  |  Branch (2116:80): [True: 1.28k, False: 6.85M]
  |  Branch (2116:92): [True: 896, False: 6.85M]
  |  Branch (2116:104): [True: 17.0k, False: 6.83M]
  ------------------
 2117|  98.9k|               break;
 2118|  98.9k|            }
 2119|       |            // Colon only ends number if followed by space/tab/newline/end (YAML mapping indicator)
 2120|  6.83M|            if (c == ':') {
  ------------------
  |  Branch (2120:17): [True: 25.5k, False: 6.80M]
  ------------------
 2121|  25.5k|               if ((it + 1) == end || *(it + 1) == ' ' || *(it + 1) == '\t' || *(it + 1) == '\n' || *(it + 1) == '\r') {
  ------------------
  |  Branch (2121:20): [True: 1.09k, False: 24.4k]
  |  Branch (2121:39): [True: 2.35k, False: 22.1k]
  |  Branch (2121:59): [True: 744, False: 21.3k]
  |  Branch (2121:80): [True: 4.45k, False: 16.9k]
  |  Branch (2121:101): [True: 2.14k, False: 14.8k]
  ------------------
 2122|  10.7k|                  break;
 2123|  10.7k|               }
 2124|  25.5k|            }
 2125|  6.82M|            ++it;
 2126|  6.82M|         }
 2127|       |
 2128|   152k|         const std::string_view num_str(&*start, static_cast<size_t>(it - start));
 2129|       |
 2130|   152k|         if (num_str.empty()) {
  ------------------
  |  Branch (2130:14): [True: 3.60k, False: 148k]
  ------------------
 2131|  3.60k|            ctx.error = error_code::parse_number_failure;
 2132|  3.60k|            return;
 2133|  3.60k|         }
 2134|       |
 2135|       |         // Handle hex, octal, binary
 2136|       |         if constexpr (std::integral<std::remove_cvref_t<T>>) {
 2137|       |            if (num_str.size() > 2 && num_str[0] == '0') {
 2138|       |               int base = 10;
 2139|       |               size_t offset = 0;
 2140|       |
 2141|       |               if (num_str[1] == 'x' || num_str[1] == 'X') {
 2142|       |                  base = 16;
 2143|       |                  offset = 2;
 2144|       |               }
 2145|       |               else if (num_str[1] == 'o' || num_str[1] == 'O') {
 2146|       |                  base = 8;
 2147|       |                  offset = 2;
 2148|       |               }
 2149|       |               else if (num_str[1] == 'b' || num_str[1] == 'B') {
 2150|       |                  base = 2;
 2151|       |                  offset = 2;
 2152|       |               }
 2153|       |
 2154|       |               if (base != 10) {
 2155|       |                  const auto digits = num_str.substr(offset);
 2156|       |                  const bool has_underscores = (digits.find('_') != std::string_view::npos);
 2157|       |
 2158|       |                  std::string clean_storage;
 2159|       |                  std::string_view clean_view;
 2160|       |
 2161|       |                  if (has_underscores) {
 2162|       |                     clean_storage.reserve(digits.size());
 2163|       |                     for (char c : digits) {
 2164|       |                        if (c != '_') {
 2165|       |                           clean_storage.push_back(c);
 2166|       |                        }
 2167|       |                     }
 2168|       |                     clean_view = clean_storage;
 2169|       |                  }
 2170|       |                  else {
 2171|       |                     clean_view = digits;
 2172|       |                  }
 2173|       |
 2174|       |                  auto [ptr, ec] =
 2175|       |                     std::from_chars(clean_view.data(), clean_view.data() + clean_view.size(), value, base);
 2176|       |                  if (ec != std::errc{}) {
 2177|       |                     ctx.error = error_code::parse_number_failure;
 2178|       |                  }
 2179|       |                  finalize();
 2180|       |                  return;
 2181|       |               }
 2182|       |            }
 2183|       |         }
 2184|   148k|         else if constexpr (std::floating_point<std::remove_cvref_t<T>>) {
 2185|   148k|            bool negative = false;
 2186|   148k|            std::string_view digits = num_str;
 2187|       |
 2188|   148k|            if (!digits.empty() && (digits.front() == '+' || digits.front() == '-')) {
  ------------------
  |  Branch (2188:17): [True: 130k, False: 18.3k]
  |  Branch (2188:37): [True: 31.9k, False: 98.5k]
  |  Branch (2188:62): [True: 13.5k, False: 84.9k]
  ------------------
 2189|  45.4k|               negative = (digits.front() == '-');
 2190|  45.4k|               digits.remove_prefix(1);
 2191|  45.4k|            }
 2192|       |
 2193|   148k|            if (digits.size() > 2 && digits[0] == '0') {
  ------------------
  |  Branch (2193:17): [True: 87.1k, False: 61.6k]
  |  Branch (2193:38): [True: 28.2k, False: 58.9k]
  ------------------
 2194|  28.2k|               int base = 10;
 2195|  28.2k|               size_t offset = 0;
 2196|       |
 2197|  28.2k|               if (digits[1] == 'x' || digits[1] == 'X') {
  ------------------
  |  Branch (2197:20): [True: 11.9k, False: 16.2k]
  |  Branch (2197:40): [True: 1.69k, False: 14.5k]
  ------------------
 2198|  13.6k|                  base = 16;
 2199|  13.6k|                  offset = 2;
 2200|  13.6k|               }
 2201|  14.5k|               else if (digits[1] == 'o' || digits[1] == 'O') {
  ------------------
  |  Branch (2201:25): [True: 1.45k, False: 13.0k]
  |  Branch (2201:45): [True: 614, False: 12.4k]
  ------------------
 2202|  2.06k|                  base = 8;
 2203|  2.06k|                  offset = 2;
 2204|  2.06k|               }
 2205|  12.4k|               else if (digits[1] == 'b' || digits[1] == 'B') {
  ------------------
  |  Branch (2205:25): [True: 588, False: 11.8k]
  |  Branch (2205:45): [True: 1.49k, False: 10.4k]
  ------------------
 2206|  2.07k|                  base = 2;
 2207|  2.07k|                  offset = 2;
 2208|  2.07k|               }
 2209|       |
 2210|  28.2k|               if (base != 10) {
  ------------------
  |  Branch (2210:20): [True: 17.8k, False: 10.4k]
  ------------------
 2211|  17.8k|                  auto raw_digits = digits.substr(offset);
 2212|  17.8k|                  const bool has_underscores = (raw_digits.find('_') != std::string_view::npos);
 2213|       |
 2214|  17.8k|                  std::string clean_storage;
 2215|  17.8k|                  std::string_view clean_view;
 2216|  17.8k|                  if (has_underscores) {
  ------------------
  |  Branch (2216:23): [True: 3.70k, False: 14.1k]
  ------------------
 2217|  3.70k|                     clean_storage.reserve(raw_digits.size());
 2218|  81.5k|                     for (char c : raw_digits) {
  ------------------
  |  Branch (2218:34): [True: 81.5k, False: 3.70k]
  ------------------
 2219|  81.5k|                        if (c != '_') {
  ------------------
  |  Branch (2219:29): [True: 71.8k, False: 9.69k]
  ------------------
 2220|  71.8k|                           clean_storage.push_back(c);
 2221|  71.8k|                        }
 2222|  81.5k|                     }
 2223|  3.70k|                     clean_view = clean_storage;
 2224|  3.70k|                  }
 2225|  14.1k|                  else {
 2226|  14.1k|                     clean_view = raw_digits;
 2227|  14.1k|                  }
 2228|       |
 2229|  17.8k|                  uint64_t parsed_int{};
 2230|  17.8k|                  auto [ptr, ec] =
 2231|  17.8k|                     std::from_chars(clean_view.data(), clean_view.data() + clean_view.size(), parsed_int, base);
 2232|  17.8k|                  if (ec != std::errc{} || ptr != (clean_view.data() + clean_view.size())) {
  ------------------
  |  Branch (2232:23): [True: 8.59k, False: 9.24k]
  |  Branch (2232:44): [True: 1.98k, False: 7.25k]
  ------------------
 2233|  10.5k|                     ctx.error = error_code::parse_number_failure;
 2234|  10.5k|                     finalize();
 2235|  10.5k|                     return;
 2236|  10.5k|                  }
 2237|       |
 2238|  7.25k|                  const auto as_float = static_cast<std::remove_cvref_t<T>>(parsed_int);
 2239|  7.25k|                  value = negative ? -as_float : as_float;
  ------------------
  |  Branch (2239:27): [True: 1.87k, False: 5.38k]
  ------------------
 2240|  7.25k|                  finalize();
 2241|  7.25k|                  return;
 2242|  17.8k|               }
 2243|  28.2k|            }
 2244|   148k|         }
 2245|       |
 2246|       |         // Standard number parsing - only allocate if underscores present
 2247|   130k|         const bool has_underscores = (num_str.find('_') != std::string_view::npos);
 2248|       |
 2249|   148k|         std::string clean_storage;
 2250|   148k|         std::string_view clean_view;
 2251|       |
 2252|   148k|         if (has_underscores) {
  ------------------
  |  Branch (2252:14): [True: 5.80k, False: 142k]
  ------------------
 2253|  5.80k|            clean_storage.reserve(num_str.size());
 2254|  4.69M|            for (char c : num_str) {
  ------------------
  |  Branch (2254:25): [True: 4.69M, False: 5.80k]
  ------------------
 2255|  4.69M|               if (c != '_') {
  ------------------
  |  Branch (2255:20): [True: 4.67M, False: 12.7k]
  ------------------
 2256|  4.67M|                  clean_storage.push_back(c);
 2257|  4.67M|               }
 2258|  4.69M|            }
 2259|  5.80k|            clean_view = clean_storage;
 2260|  5.80k|         }
 2261|   142k|         else {
 2262|   142k|            clean_view = num_str;
 2263|   142k|         }
 2264|       |
 2265|       |         // YAML allows leading '+' for positive numbers, but C++ from_chars doesn't
 2266|       |         // Strip leading '+' if present
 2267|   148k|         auto parse_view = clean_view;
 2268|   148k|         if (!parse_view.empty() && parse_view.front() == '+') {
  ------------------
  |  Branch (2268:14): [True: 112k, False: 36.2k]
  |  Branch (2268:37): [True: 31.9k, False: 80.5k]
  ------------------
 2269|  31.9k|            parse_view.remove_prefix(1);
 2270|  31.9k|            if (parse_view.empty()) {
  ------------------
  |  Branch (2270:17): [True: 8.50k, False: 23.4k]
  ------------------
 2271|  8.50k|               ctx.error = error_code::parse_number_failure;
 2272|  8.50k|               return;
 2273|  8.50k|            }
 2274|  31.9k|         }
 2275|       |
 2276|   140k|         if constexpr (std::floating_point<std::remove_cvref_t<T>>) {
 2277|   140k|            auto result = glz::fast_float::from_chars(parse_view.data(), parse_view.data() + parse_view.size(), value);
 2278|       |            // Check both for errors and that all input was consumed (e.g., "12:30" is not a valid number)
 2279|   140k|            if (result.ec != std::errc{} || result.ptr != parse_view.data() + parse_view.size()) {
  ------------------
  |  Branch (2279:17): [True: 78.4k, False: 61.7k]
  |  Branch (2279:45): [True: 33.4k, False: 28.3k]
  ------------------
 2280|  75.7k|               ctx.error = error_code::parse_number_failure;
 2281|  75.7k|            }
 2282|       |         }
 2283|       |         else {
 2284|       |            auto [ptr, ec] = std::from_chars(parse_view.data(), parse_view.data() + parse_view.size(), value);
 2285|       |            // Check both for errors and that all input was consumed
 2286|       |            if (ec != std::errc{} || ptr != parse_view.data() + parse_view.size()) {
 2287|       |               ctx.error = error_code::parse_number_failure;
 2288|       |            }
 2289|       |         }
 2290|       |
 2291|   140k|         finalize();
 2292|   140k|      }
_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|   162k|      {
  466|   162k|         skip_inline_ws(it, end);
  467|       |
  468|   162k|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (468:14): [True: 1.40k, False: 161k]
  ------------------
  469|  1.40k|            if constexpr (!AllowEmptyInput) {
  470|  1.40k|               ctx.error = error_code::unexpected_end;
  471|  1.40k|            }
  472|  1.40k|            return true;
  473|  1.40k|         }
  474|       |
  475|   161k|         preamble.tag = parse_yaml_tag(it, end, ctx);
  476|   161k|         if (preamble.tag == yaml_tag::unknown) [[unlikely]] {
  ------------------
  |  Branch (476:14): [True: 278, False: 160k]
  ------------------
  477|    278|            ctx.error = error_code::syntax_error;
  478|    278|            return true;
  479|    278|         }
  480|   160k|         if (!tag_validator(preamble.tag)) [[unlikely]] {
  ------------------
  |  Branch (480:14): [True: 78, False: 160k]
  ------------------
  481|     78|            ctx.error = error_code::syntax_error;
  482|     78|            return true;
  483|     78|         }
  484|       |
  485|   160k|         skip_inline_ws(it, end);
  486|       |
  487|   160k|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (487:14): [True: 6, False: 160k]
  ------------------
  488|      6|            if constexpr (!AllowEmptyInput) {
  489|      6|               ctx.error = error_code::unexpected_end;
  490|      6|            }
  491|      6|            return true;
  492|      6|         }
  493|       |
  494|   160k|         if (parse_node_properties<Opts, PropertyPolicy>(std::forward<T>(value), ctx, it, end, preamble.node_props)) {
  ------------------
  |  Branch (494:14): [True: 8.49k, False: 152k]
  ------------------
  495|  8.49k|            return true;
  496|  8.49k|         }
  497|       |
  498|   152k|         return false;
  499|   160k|      }
_ZZN3glz4fromILj450EdE2opITnDaXtlNS_4optsELj10ELb1ELb0ELb0ELb1EEERPKcRdTkNS_10is_contextERNS_4yaml12yaml_contextES5_EEvOT1_OT2_OT0_T3_ENKUlNS8_8yaml_tagEE_clESI_:
 2052|   160k|         if (yaml::parse_node_preamble<Opts>(value, ctx, it, end, preamble, [](yaml::yaml_tag tag) {
 2053|   160k|                if constexpr (std::floating_point<std::remove_cvref_t<T>>) {
 2054|   160k|                   return yaml::tag_valid_for_float(tag);
 2055|       |                }
 2056|       |                else {
 2057|       |                   return yaml::tag_valid_for_int(tag);
 2058|       |                }
 2059|   160k|             }))
_ZN3glz4yaml21parse_node_propertiesITnDaXtlNS_4optsELj10ELb1ELb0ELb0ELb1EEEXtlNS0_20node_property_policyELb1EEERdNS0_12yaml_contextEPKcS7_EEbOT1_RT2_RT3_T4_RNS0_19node_property_stateE:
  408|   160k|      {
  409|   160k|         state.has_anchor = false;
  410|   160k|         state.anchor_name.clear();
  411|   160k|         state.anchor_start = nullptr;
  412|   160k|         state.anchor_indent = ctx.current_indent();
  413|       |
  414|   160k|         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|   160k|            else {
  421|   160k|               if (handle_alias<Opts>(std::forward<T>(value), ctx, it, end)) return true;
  ------------------
  |  Branch (421:20): [True: 7.41k, False: 153k]
  ------------------
  422|   160k|            }
  423|   160k|         }
  424|       |
  425|   160k|         if (it != end && *it == '&') {
  ------------------
  |  Branch (425:14): [True: 153k, False: 7.41k]
  |  Branch (425:27): [True: 17.2k, False: 136k]
  ------------------
  426|  17.2k|            ++it;
  427|  17.2k|            auto name = parse_anchor_name(it, end);
  428|  17.2k|            if (name.empty()) {
  ------------------
  |  Branch (428:17): [True: 488, False: 16.7k]
  ------------------
  429|    488|               ctx.error = error_code::syntax_error;
  430|    488|               return true;
  431|    488|            }
  432|  16.7k|            skip_inline_ws(it, end);
  433|  16.7k|            if (it == end) {
  ------------------
  |  Branch (433:17): [True: 590, False: 16.1k]
  ------------------
  434|    590|               if constexpr (!Policy.allow_empty_after_anchor) {
  435|    590|                  ctx.error = error_code::unexpected_end;
  436|    590|               }
  437|    590|               return true;
  438|    590|            }
  439|       |            if constexpr (Policy.disallow_anchor_on_alias) {
  440|       |               if (*it == '*') {
  441|       |                  ctx.error = error_code::syntax_error;
  442|       |                  return true;
  443|       |               }
  444|       |            }
  445|  16.1k|            state.has_anchor = true;
  446|  16.1k|            state.anchor_name = std::string(name);
  447|  16.1k|            state.anchor_start = &*it;
  448|  16.1k|         }
  449|       |
  450|   159k|         return false;
  451|   160k|      }
_ZN3glz4yaml12handle_aliasITnDaXtlNS_4optsELj10ELb1ELb0ELb0ELb1EEERdNS0_12yaml_contextEPKcS6_EEbOT0_RT1_RT2_T3_:
  300|   160k|      {
  301|   160k|         if (it == end || *it != '*') return false;
  ------------------
  |  Branch (301:14): [True: 0, False: 160k]
  |  Branch (301:27): [True: 153k, False: 7.41k]
  ------------------
  302|       |
  303|  7.41k|         ++it; // skip '*'
  304|  7.41k|         auto name = parse_anchor_name(it, end);
  305|  7.41k|         if (name.empty()) {
  ------------------
  |  Branch (305:14): [True: 1.69k, False: 5.72k]
  ------------------
  306|  1.69k|            ctx.error = error_code::syntax_error;
  307|  1.69k|            return true;
  308|  1.69k|         }
  309|       |
  310|  5.72k|         auto anchor_it = ctx.anchors.find(name);
  311|  5.72k|         if (anchor_it == ctx.anchors.end()) {
  ------------------
  |  Branch (311:14): [True: 2.94k, False: 2.78k]
  ------------------
  312|  2.94k|            ctx.error = error_code::syntax_error; // undefined alias
  313|  2.94k|            return true;
  314|  2.94k|         }
  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.78k|         const auto span = anchor_it->second;
  319|       |
  320|       |         // Empty anchor span (anchor on null/empty node) — leave value as default
  321|  2.78k|         if (span.begin == span.end) {
  ------------------
  |  Branch (321:14): [True: 98, False: 2.68k]
  ------------------
  322|     98|            return true;
  323|     98|         }
  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.68k|         if (ctx.alias_span_is_replaying(span.begin, span.end)) [[unlikely]] {
  ------------------
  |  Branch (328:14): [True: 434, False: 2.25k]
  ------------------
  329|    434|            ctx.error = error_code::syntax_error; // cyclic alias
  330|    434|            return true;
  331|    434|         }
  332|       |
  333|       |         // Replaying an anchor re-enters the reader directly, bypassing the variant reader's
  334|       |         // depth guard, so this is the only depth accounting a chain of aliases into a
  335|       |         // non-variant target gets. The cycle check above stops the unbounded case; this bounds
  336|       |         // a legitimate but deeply chained one.
  337|  2.25k|         depth_guard guard{ctx, yaml::max_yaml_recursive_depth};
  338|  2.25k|         if (!guard) [[unlikely]]
  ------------------
  |  Branch (338:14): [True: 16, False: 2.23k]
  ------------------
  339|     16|            return true;
  340|       |
  341|  2.23k|         if (!ctx.charge_alias_expansion(static_cast<size_t>(span.end - span.begin))) [[unlikely]] {
  ------------------
  |  Branch (341:14): [True: 0, False: 2.23k]
  ------------------
  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.23k|         auto replay_it = span.begin;
  348|  2.23k|         auto replay_end = span.end;
  349|       |
  350|       |         // Save indent context and set up for replay
  351|  2.23k|         auto saved_indent_stack = std::move(ctx.indent_stack);
  352|  2.23k|         ctx.indent_stack.clear();
  353|  2.23k|         if (span.base_indent > 0) {
  ------------------
  |  Branch (353:14): [True: 1.76k, False: 468]
  ------------------
  354|  1.76k|            ctx.push_indent(span.base_indent - 1);
  355|  1.76k|         }
  356|       |
  357|  2.23k|         ctx.active_alias_spans.emplace_back(span.begin, span.end);
  358|       |
  359|  2.23k|         using V = std::remove_cvref_t<T>;
  360|  2.23k|         from<YAML, V>::template op<Opts>(std::forward<T>(value), ctx, replay_it, replay_end);
  361|       |
  362|  2.23k|         ctx.active_alias_spans.pop_back();
  363|       |
  364|       |         // Restore indent context
  365|  2.23k|         ctx.indent_stack = std::move(saved_indent_stack);
  366|  2.23k|         return true;
  367|  2.23k|      }
_ZZN3glz4fromILj450EdE2opITnDaXtlNS_4optsELj10ELb1ELb0ELb0ELb1EEERPKcRdTkNS_10is_contextERNS_4yaml12yaml_contextES5_EEvOT1_OT2_OT0_T3_ENKUlvE_clEv:
 2062|   140k|         auto finalize = [&] { yaml::finalize_node_anchor(preamble.node_props, ctx, it); };
_ZN3glz33process_yaml_variant_alternativesINSt3__17variantIJDndNS1_12basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEbNS1_6vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS6_ISD_EEEENSC_ISD_EEEEENS_20is_yaml_variant_boolEE2opITnDaXtlNS_4optsELj10ELb1ELb0ELb0ELb1EEERSH_TkNS_10is_contextERNS_4yaml12yaml_contextERPKcSR_EEvOT0_OT1_OT2_T3_:
 5205|  35.3k|      {
 5206|  35.3k|         constexpr auto category_count = yaml_variant_count_v<Variant, Trait>;
 5207|       |
 5208|       |         if constexpr (category_count == 0) {
 5209|       |            ctx.error = error_code::no_matching_variant_type;
 5210|       |         }
 5211|  35.3k|         else if constexpr (category_count == 1) {
 5212|       |            // Only one type in this category, use it directly
 5213|  35.3k|            constexpr auto first_idx = yaml_variant_first_index_v<Variant, Trait>;
 5214|  35.3k|            using V = std::variant_alternative_t<first_idx, Variant>;
 5215|  35.3k|            if (!std::holds_alternative<V>(value)) value = V{};
  ------------------
  |  Branch (5215:17): [True: 35.3k, False: 0]
  ------------------
 5216|  35.3k|            from<YAML, V>::template op<Opts>(std::get<V>(value), ctx, it, end);
 5217|       |         }
 5218|       |         else {
 5219|       |            // Multiple types in this category, try each one
 5220|       |            constexpr auto N = std::variant_size_v<Variant>;
 5221|       |            bool found_match{};
 5222|       |            size_t match_idx = 0;
 5223|       |            // Only the last alternative propagates its error, so an alternative that exhausted an
 5224|       |            // expansion budget would otherwise be reported as no_matching_variant_type -- a wrong
 5225|       |            // diagnosis for a document that is hostile rather than merely the wrong shape. Held
 5226|       |            // aside and used only if nothing matched, so an alternative that does succeed later
 5227|       |            // (one that materializes no key text can still parse under a latched budget) is
 5228|       |            // unaffected.
 5229|       |            error_code expansion_error{};
 5230|       |            std::string_view expansion_message{};
 5231|       |
 5232|       |            for_each<N>([&]<size_t I>() {
 5233|       |               if (found_match) {
 5234|       |                  return;
 5235|       |               }
 5236|       |               using V = std::variant_alternative_t<I, Variant>;
 5237|       |               if constexpr (Trait<V>::value) {
 5238|       |                  auto copy_it = it;
 5239|       |                  if (!std::holds_alternative<V>(value)) {
 5240|       |                     value = V{};
 5241|       |                  }
 5242|       |
 5243|       |                  auto temp_ctx = ctx.make_speculative();
 5244|       |                  from<YAML, V>::template op<Opts>(std::get<V>(value), temp_ctx, it, end);
 5245|       |
 5246|       |                  // Charged whether or not the alternative fit: a rejected probe still replayed
 5247|       |                  // whatever aliases it reached, and an attempt that is never billed is an
 5248|       |                  // attempt that can be repeated for free.
 5249|       |                  ctx.alias_expansion_budget = temp_ctx.alias_expansion_budget;
 5250|       |                  ctx.key_expansion_budget = temp_ctx.key_expansion_budget;
 5251|       |
 5252|       |                  if (!bool(temp_ctx.error)) {
 5253|       |                     found_match = true;
 5254|       |                     ctx.anchors = std::move(temp_ctx.anchors);
 5255|       |                  }
 5256|       |                  else {
 5257|       |                     it = copy_it;
 5258|       |                     if (temp_ctx.error == error_code::exceeded_max_expansion && expansion_error == error_code::none) {
 5259|       |                        expansion_error = temp_ctx.error;
 5260|       |                        expansion_message = temp_ctx.custom_error_message;
 5261|       |                     }
 5262|       |                     if (match_idx + 1 < category_count) {
 5263|       |                        // Not the last type, continue trying
 5264|       |                     }
 5265|       |                     else {
 5266|       |                        // Last type failed, propagate error
 5267|       |                        ctx.error = temp_ctx.error;
 5268|       |                        ctx.custom_error_message = temp_ctx.custom_error_message;
 5269|       |                     }
 5270|       |                  }
 5271|       |                  ++match_idx;
 5272|       |               }
 5273|       |            });
 5274|       |
 5275|       |            if (!found_match && !bool(ctx.error)) {
 5276|       |               if (expansion_error != error_code::none) {
 5277|       |                  ctx.error = expansion_error;
 5278|       |                  ctx.custom_error_message = expansion_message;
 5279|       |               }
 5280|       |               else {
 5281|       |                  ctx.error = error_code::no_matching_variant_type;
 5282|       |               }
 5283|       |            }
 5284|       |         }
 5285|  35.3k|      }
_ZN3glz4fromILj450EbE2opITnDaXtlNS_4optsELj10ELb1ELb0ELb0ELb1EEERPKcRbTkNS_10is_contextERNS_4yaml12yaml_contextES5_EEvOT1_OT2_OT0_T3_:
 2012|  35.4k|      {
 2013|  35.4k|         if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2013:14): [True: 0, False: 35.4k]
  ------------------
 2014|      0|            return;
 2015|       |
 2016|  35.4k|         yaml::node_preamble_state preamble{};
 2017|  35.4k|         if (yaml::parse_node_preamble<Opts>(value, ctx, it, end, preamble,
  ------------------
  |  Branch (2017:14): [True: 252, False: 35.1k]
  ------------------
 2018|  35.4k|                                             [](yaml::yaml_tag tag) { return yaml::tag_valid_for_bool(tag); }))
 2019|    252|            return;
 2020|       |
 2021|       |         // Parse as plain scalar first
 2022|  35.1k|         std::string str;
 2023|  35.1k|         yaml::parse_plain_scalar(str, ctx, it, end, yaml::check_flow_context(Opts));
 2024|       |
 2025|  35.1k|         if (str == "true" || str == "True" || str == "TRUE" || str == "yes" || str == "Yes" || str == "YES" ||
  ------------------
  |  Branch (2025:14): [True: 4.13k, False: 31.0k]
  |  Branch (2025:31): [True: 4.89k, False: 26.1k]
  |  Branch (2025:48): [True: 1.03k, False: 25.0k]
  |  Branch (2025:65): [True: 614, False: 24.4k]
  |  Branch (2025:81): [True: 194, False: 24.2k]
  |  Branch (2025:97): [True: 222, False: 24.0k]
  ------------------
 2026|  24.0k|             str == "on" || str == "On" || str == "ON") {
  ------------------
  |  Branch (2026:14): [True: 8.33k, False: 15.7k]
  |  Branch (2026:29): [True: 318, False: 15.4k]
  |  Branch (2026:44): [True: 572, False: 14.8k]
  ------------------
 2027|  20.3k|            value = true;
 2028|  20.3k|         }
 2029|  14.8k|         else if (str == "false" || str == "False" || str == "FALSE" || str == "no" || str == "No" || str == "NO" ||
  ------------------
  |  Branch (2029:19): [True: 9.41k, False: 5.43k]
  |  Branch (2029:37): [True: 506, False: 4.92k]
  |  Branch (2029:55): [True: 658, False: 4.27k]
  |  Branch (2029:73): [True: 930, False: 3.34k]
  |  Branch (2029:88): [True: 66, False: 3.27k]
  |  Branch (2029:103): [True: 290, False: 2.98k]
  ------------------
 2030|  14.5k|                  str == "off" || str == "Off" || str == "OFF") {
  ------------------
  |  Branch (2030:19): [True: 324, False: 2.66k]
  |  Branch (2030:35): [True: 262, False: 2.39k]
  |  Branch (2030:51): [True: 2.11k, False: 288]
  ------------------
 2031|  14.5k|            value = false;
 2032|  14.5k|         }
 2033|    288|         else {
 2034|    288|            ctx.error = error_code::expected_true_or_false;
 2035|    288|         }
 2036|       |
 2037|  35.1k|         yaml::finalize_node_anchor(preamble.node_props, ctx, it);
 2038|  35.1k|      }
_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|  35.4k|      {
  466|  35.4k|         skip_inline_ws(it, end);
  467|       |
  468|  35.4k|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (468:14): [True: 14, False: 35.3k]
  ------------------
  469|     14|            if constexpr (!AllowEmptyInput) {
  470|     14|               ctx.error = error_code::unexpected_end;
  471|     14|            }
  472|     14|            return true;
  473|     14|         }
  474|       |
  475|  35.3k|         preamble.tag = parse_yaml_tag(it, end, ctx);
  476|  35.3k|         if (preamble.tag == yaml_tag::unknown) [[unlikely]] {
  ------------------
  |  Branch (476:14): [True: 6, False: 35.3k]
  ------------------
  477|      6|            ctx.error = error_code::syntax_error;
  478|      6|            return true;
  479|      6|         }
  480|  35.3k|         if (!tag_validator(preamble.tag)) [[unlikely]] {
  ------------------
  |  Branch (480:14): [True: 6, False: 35.3k]
  ------------------
  481|      6|            ctx.error = error_code::syntax_error;
  482|      6|            return true;
  483|      6|         }
  484|       |
  485|  35.3k|         skip_inline_ws(it, end);
  486|       |
  487|  35.3k|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (487:14): [True: 6, False: 35.3k]
  ------------------
  488|      6|            if constexpr (!AllowEmptyInput) {
  489|      6|               ctx.error = error_code::unexpected_end;
  490|      6|            }
  491|      6|            return true;
  492|      6|         }
  493|       |
  494|  35.3k|         if (parse_node_properties<Opts, PropertyPolicy>(std::forward<T>(value), ctx, it, end, preamble.node_props)) {
  ------------------
  |  Branch (494:14): [True: 220, False: 35.1k]
  ------------------
  495|    220|            return true;
  496|    220|         }
  497|       |
  498|  35.1k|         return false;
  499|  35.3k|      }
_ZZN3glz4fromILj450EbE2opITnDaXtlNS_4optsELj10ELb1ELb0ELb0ELb1EEERPKcRbTkNS_10is_contextERNS_4yaml12yaml_contextES5_EEvOT1_OT2_OT0_T3_ENKUlNS8_8yaml_tagEE_clESI_:
 2018|  35.3k|                                             [](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|  35.3k|      {
  409|  35.3k|         state.has_anchor = false;
  410|  35.3k|         state.anchor_name.clear();
  411|  35.3k|         state.anchor_start = nullptr;
  412|  35.3k|         state.anchor_indent = ctx.current_indent();
  413|       |
  414|  35.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|  35.3k|            else {
  421|  35.3k|               if (handle_alias<Opts>(std::forward<T>(value), ctx, it, end)) return true;
  ------------------
  |  Branch (421:20): [True: 192, False: 35.1k]
  ------------------
  422|  35.3k|            }
  423|  35.3k|         }
  424|       |
  425|  35.3k|         if (it != end && *it == '&') {
  ------------------
  |  Branch (425:14): [True: 35.1k, False: 192]
  |  Branch (425:27): [True: 2.23k, False: 32.9k]
  ------------------
  426|  2.23k|            ++it;
  427|  2.23k|            auto name = parse_anchor_name(it, end);
  428|  2.23k|            if (name.empty()) {
  ------------------
  |  Branch (428:17): [True: 8, False: 2.22k]
  ------------------
  429|      8|               ctx.error = error_code::syntax_error;
  430|      8|               return true;
  431|      8|            }
  432|  2.22k|            skip_inline_ws(it, end);
  433|  2.22k|            if (it == end) {
  ------------------
  |  Branch (433:17): [True: 20, False: 2.20k]
  ------------------
  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|  2.20k|            state.has_anchor = true;
  446|  2.20k|            state.anchor_name = std::string(name);
  447|  2.20k|            state.anchor_start = &*it;
  448|  2.20k|         }
  449|       |
  450|  35.3k|         return false;
  451|  35.3k|      }
_ZN3glz4yaml12handle_aliasITnDaXtlNS_4optsELj10ELb1ELb0ELb0ELb1EEERbNS0_12yaml_contextEPKcS6_EEbOT0_RT1_RT2_T3_:
  300|  35.3k|      {
  301|  35.3k|         if (it == end || *it != '*') return false;
  ------------------
  |  Branch (301:14): [True: 0, False: 35.3k]
  |  Branch (301:27): [True: 35.1k, False: 192]
  ------------------
  302|       |
  303|    192|         ++it; // skip '*'
  304|    192|         auto name = parse_anchor_name(it, end);
  305|    192|         if (name.empty()) {
  ------------------
  |  Branch (305:14): [True: 22, False: 170]
  ------------------
  306|     22|            ctx.error = error_code::syntax_error;
  307|     22|            return true;
  308|     22|         }
  309|       |
  310|    170|         auto anchor_it = ctx.anchors.find(name);
  311|    170|         if (anchor_it == ctx.anchors.end()) {
  ------------------
  |  Branch (311:14): [True: 42, False: 128]
  ------------------
  312|     42|            ctx.error = error_code::syntax_error; // undefined alias
  313|     42|            return true;
  314|     42|         }
  315|       |
  316|       |         // Copied rather than referenced: the replay below can replace ctx.anchors wholesale
  317|       |         // (a speculative parse hands its own map back), which would dangle a reference here.
  318|    128|         const auto span = anchor_it->second;
  319|       |
  320|       |         // Empty anchor span (anchor on null/empty node) — leave value as default
  321|    128|         if (span.begin == span.end) {
  ------------------
  |  Branch (321:14): [True: 38, False: 90]
  ------------------
  322|     38|            return true;
  323|     38|         }
  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|     90|         if (ctx.alias_span_is_replaying(span.begin, span.end)) [[unlikely]] {
  ------------------
  |  Branch (328:14): [True: 24, False: 66]
  ------------------
  329|     24|            ctx.error = error_code::syntax_error; // cyclic alias
  330|     24|            return true;
  331|     24|         }
  332|       |
  333|       |         // Replaying an anchor re-enters the reader directly, bypassing the variant reader's
  334|       |         // depth guard, so this is the only depth accounting a chain of aliases into a
  335|       |         // non-variant target gets. The cycle check above stops the unbounded case; this bounds
  336|       |         // a legitimate but deeply chained one.
  337|     66|         depth_guard guard{ctx, yaml::max_yaml_recursive_depth};
  338|     66|         if (!guard) [[unlikely]]
  ------------------
  |  Branch (338:14): [True: 0, False: 66]
  ------------------
  339|      0|            return true;
  340|       |
  341|     66|         if (!ctx.charge_alias_expansion(static_cast<size_t>(span.end - span.begin))) [[unlikely]] {
  ------------------
  |  Branch (341:14): [True: 0, False: 66]
  ------------------
  342|      0|            ctx.error = error_code::exceeded_max_expansion;
  343|      0|            ctx.custom_error_message = "alias expansion";
  344|      0|            return true;
  345|      0|         }
  346|       |
  347|     66|         auto replay_it = span.begin;
  348|     66|         auto replay_end = span.end;
  349|       |
  350|       |         // Save indent context and set up for replay
  351|     66|         auto saved_indent_stack = std::move(ctx.indent_stack);
  352|     66|         ctx.indent_stack.clear();
  353|     66|         if (span.base_indent > 0) {
  ------------------
  |  Branch (353:14): [True: 10, False: 56]
  ------------------
  354|     10|            ctx.push_indent(span.base_indent - 1);
  355|     10|         }
  356|       |
  357|     66|         ctx.active_alias_spans.emplace_back(span.begin, span.end);
  358|       |
  359|     66|         using V = std::remove_cvref_t<T>;
  360|     66|         from<YAML, V>::template op<Opts>(std::forward<T>(value), ctx, replay_it, replay_end);
  361|       |
  362|     66|         ctx.active_alias_spans.pop_back();
  363|       |
  364|       |         // Restore indent context
  365|     66|         ctx.indent_stack = std::move(saved_indent_stack);
  366|     66|         return true;
  367|     66|      }
_ZN3glz4fromILj450EDnE2opITnDaXtlNS_4optsELj10ELb1ELb0ELb0ELb1EEERPKcRDnTkNS_10is_contextERNS_4yaml12yaml_contextES5_EEvOT1_OT2_OT0_T3_:
 2398|  4.01k|      {
 2399|  4.01k|         if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2399:14): [True: 0, False: 4.01k]
  ------------------
 2400|      0|            return;
 2401|       |
 2402|  4.01k|         yaml::skip_inline_ws(it, end);
 2403|       |
 2404|  4.01k|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (2404:14): [True: 6, False: 4.01k]
  ------------------
 2405|      6|            ctx.error = error_code::unexpected_end;
 2406|      6|            return;
 2407|      6|         }
 2408|       |
 2409|       |         // Check for null values: null, Null, NULL, ~
 2410|  4.01k|         if (*it == '~') {
  ------------------
  |  Branch (2410:14): [True: 360, False: 3.65k]
  ------------------
 2411|    360|            ++it;
 2412|    360|            return;
 2413|    360|         }
 2414|       |
 2415|       |         // Parse as plain scalar and check if it's a null keyword
 2416|  3.65k|         auto start = it;
 2417|  17.1k|         while (it != end && !yaml::plain_scalar_end_table[static_cast<uint8_t>(*it)]) {
  ------------------
  |  Branch (2417:17): [True: 16.0k, False: 1.02k]
  |  Branch (2417:30): [True: 13.4k, False: 2.62k]
  ------------------
 2418|  13.4k|            ++it;
 2419|  13.4k|         }
 2420|       |
 2421|  3.65k|         std::string_view str{start, static_cast<size_t>(it - start)};
 2422|  3.65k|         if (!yaml::is_yaml_null(str)) {
  ------------------
  |  Branch (2422:14): [True: 56, False: 3.59k]
  ------------------
 2423|     56|            ctx.error = error_code::syntax_error;
 2424|     56|         }
 2425|  3.65k|      }
_ZN3glz33process_yaml_variant_alternativesINSt3__17variantIJDndNS1_12basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEbNS1_6vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS6_ISD_EEEENSC_ISD_EEEEENS_21is_yaml_variant_arrayEE2opITnDaXtlNS_4optsELj10ELb1ELb0ELb0ELb1EEERSH_TkNS_10is_contextERNS_4yaml12yaml_contextERPKcSR_EEvOT0_OT1_OT2_T3_:
 5205|   368k|      {
 5206|   368k|         constexpr auto category_count = yaml_variant_count_v<Variant, Trait>;
 5207|       |
 5208|       |         if constexpr (category_count == 0) {
 5209|       |            ctx.error = error_code::no_matching_variant_type;
 5210|       |         }
 5211|   368k|         else if constexpr (category_count == 1) {
 5212|       |            // Only one type in this category, use it directly
 5213|   368k|            constexpr auto first_idx = yaml_variant_first_index_v<Variant, Trait>;
 5214|   368k|            using V = std::variant_alternative_t<first_idx, Variant>;
 5215|   368k|            if (!std::holds_alternative<V>(value)) value = V{};
  ------------------
  |  Branch (5215:17): [True: 368k, False: 0]
  ------------------
 5216|   368k|            from<YAML, V>::template op<Opts>(std::get<V>(value), ctx, it, end);
 5217|       |         }
 5218|       |         else {
 5219|       |            // Multiple types in this category, try each one
 5220|       |            constexpr auto N = std::variant_size_v<Variant>;
 5221|       |            bool found_match{};
 5222|       |            size_t match_idx = 0;
 5223|       |            // Only the last alternative propagates its error, so an alternative that exhausted an
 5224|       |            // expansion budget would otherwise be reported as no_matching_variant_type -- a wrong
 5225|       |            // diagnosis for a document that is hostile rather than merely the wrong shape. Held
 5226|       |            // aside and used only if nothing matched, so an alternative that does succeed later
 5227|       |            // (one that materializes no key text can still parse under a latched budget) is
 5228|       |            // unaffected.
 5229|       |            error_code expansion_error{};
 5230|       |            std::string_view expansion_message{};
 5231|       |
 5232|       |            for_each<N>([&]<size_t I>() {
 5233|       |               if (found_match) {
 5234|       |                  return;
 5235|       |               }
 5236|       |               using V = std::variant_alternative_t<I, Variant>;
 5237|       |               if constexpr (Trait<V>::value) {
 5238|       |                  auto copy_it = it;
 5239|       |                  if (!std::holds_alternative<V>(value)) {
 5240|       |                     value = V{};
 5241|       |                  }
 5242|       |
 5243|       |                  auto temp_ctx = ctx.make_speculative();
 5244|       |                  from<YAML, V>::template op<Opts>(std::get<V>(value), temp_ctx, it, end);
 5245|       |
 5246|       |                  // Charged whether or not the alternative fit: a rejected probe still replayed
 5247|       |                  // whatever aliases it reached, and an attempt that is never billed is an
 5248|       |                  // attempt that can be repeated for free.
 5249|       |                  ctx.alias_expansion_budget = temp_ctx.alias_expansion_budget;
 5250|       |                  ctx.key_expansion_budget = temp_ctx.key_expansion_budget;
 5251|       |
 5252|       |                  if (!bool(temp_ctx.error)) {
 5253|       |                     found_match = true;
 5254|       |                     ctx.anchors = std::move(temp_ctx.anchors);
 5255|       |                  }
 5256|       |                  else {
 5257|       |                     it = copy_it;
 5258|       |                     if (temp_ctx.error == error_code::exceeded_max_expansion && expansion_error == error_code::none) {
 5259|       |                        expansion_error = temp_ctx.error;
 5260|       |                        expansion_message = temp_ctx.custom_error_message;
 5261|       |                     }
 5262|       |                     if (match_idx + 1 < category_count) {
 5263|       |                        // Not the last type, continue trying
 5264|       |                     }
 5265|       |                     else {
 5266|       |                        // Last type failed, propagate error
 5267|       |                        ctx.error = temp_ctx.error;
 5268|       |                        ctx.custom_error_message = temp_ctx.custom_error_message;
 5269|       |                     }
 5270|       |                  }
 5271|       |                  ++match_idx;
 5272|       |               }
 5273|       |            });
 5274|       |
 5275|       |            if (!found_match && !bool(ctx.error)) {
 5276|       |               if (expansion_error != error_code::none) {
 5277|       |                  ctx.error = expansion_error;
 5278|       |                  ctx.custom_error_message = expansion_message;
 5279|       |               }
 5280|       |               else {
 5281|       |                  ctx.error = error_code::no_matching_variant_type;
 5282|       |               }
 5283|       |            }
 5284|       |         }
 5285|   368k|      }
_ZN3glz4fromILj450ENSt3__16vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS1_9allocatorIS6_EEEEE2opITnDaXtlNS_4optsELj10ELb1ELb0ELb0ELb1EEERPKcRS9_TkNS_10is_contextERNS_4yaml12yaml_contextESE_EEvOT1_OT2_OT0_T3_:
 4098|   372k|      {
 4099|   372k|         if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4099:14): [True: 0, False: 372k]
  ------------------
 4100|      0|            return;
 4101|       |
 4102|       |         // Peek ahead to check for tag (don't consume indentation for block sequences)
 4103|   372k|         auto peek = it;
 4104|   372k|         yaml::node_preamble_state preamble{};
 4105|   372k|         if (yaml::parse_node_preamble<Opts>(value, ctx, peek, end, preamble,
  ------------------
  |  Branch (4105:14): [True: 4.41k, False: 368k]
  ------------------
 4106|   372k|                                             [](yaml::yaml_tag tag) { return yaml::tag_valid_for_seq(tag); })) {
 4107|  4.41k|            it = peek;
 4108|  4.41k|            return;
 4109|  4.41k|         }
 4110|       |
 4111|   368k|         if (*peek == '[') {
  ------------------
  |  Branch (4111:14): [True: 43.0k, False: 325k]
  ------------------
 4112|       |            // Flow sequence - consume whitespace and parse
 4113|  43.0k|            it = peek;
 4114|  43.0k|            yaml::parse_flow_sequence<Opts>(value, ctx, it, end);
 4115|  43.0k|         }
 4116|   325k|         else if (*peek == '-') {
  ------------------
  |  Branch (4116:19): [True: 325k, False: 110]
  ------------------
 4117|       |            // Block sequence - don't consume leading whitespace, let parse_block_sequence handle it
 4118|       |            // But if there was a tag, we need to advance past it
 4119|   325k|            if (preamble.tag != yaml::yaml_tag::none || preamble.node_props.has_anchor) {
  ------------------
  |  Branch (4119:17): [True: 6.35k, False: 319k]
  |  Branch (4119:57): [True: 4.32k, False: 314k]
  ------------------
 4120|  10.6k|               it = peek;
 4121|  10.6k|            }
 4122|   325k|            int32_t seq_indent = ctx.current_indent();
 4123|   325k|            if (*it == '-' && ctx.current_indent() >= 0) {
  ------------------
  |  Branch (4123:17): [True: 325k, False: 190]
  |  Branch (4123:31): [True: 113k, False: 212k]
  ------------------
 4124|   113k|               seq_indent = ctx.allow_indentless_sequence ? (ctx.current_indent() > 0 ? (ctx.current_indent() - 1) : 0)
  ------------------
  |  Branch (4124:29): [True: 17.6k, False: 95.5k]
  |  Branch (4124:62): [True: 14.7k, False: 2.86k]
  ------------------
 4125|   113k|                                                          : (ctx.current_indent() + 1);
 4126|   113k|            }
 4127|   325k|            yaml::parse_block_sequence<Opts>(value, ctx, it, end, seq_indent);
 4128|   325k|         }
 4129|    110|         else {
 4130|    110|            ctx.error = error_code::syntax_error;
 4131|    110|         }
 4132|       |
 4133|   368k|         yaml::finalize_node_anchor(preamble.node_props, ctx, it);
 4134|   368k|      }
_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|   372k|      {
  466|   372k|         skip_inline_ws(it, end);
  467|       |
  468|   372k|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (468:14): [True: 18, False: 372k]
  ------------------
  469|     18|            if constexpr (!AllowEmptyInput) {
  470|     18|               ctx.error = error_code::unexpected_end;
  471|     18|            }
  472|     18|            return true;
  473|     18|         }
  474|       |
  475|   372k|         preamble.tag = parse_yaml_tag(it, end, ctx);
  476|   372k|         if (preamble.tag == yaml_tag::unknown) [[unlikely]] {
  ------------------
  |  Branch (476:14): [True: 6, False: 372k]
  ------------------
  477|      6|            ctx.error = error_code::syntax_error;
  478|      6|            return true;
  479|      6|         }
  480|   372k|         if (!tag_validator(preamble.tag)) [[unlikely]] {
  ------------------
  |  Branch (480:14): [True: 6, False: 372k]
  ------------------
  481|      6|            ctx.error = error_code::syntax_error;
  482|      6|            return true;
  483|      6|         }
  484|       |
  485|   372k|         skip_inline_ws(it, end);
  486|       |
  487|   372k|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (487:14): [True: 6, False: 372k]
  ------------------
  488|      6|            if constexpr (!AllowEmptyInput) {
  489|      6|               ctx.error = error_code::unexpected_end;
  490|      6|            }
  491|      6|            return true;
  492|      6|         }
  493|       |
  494|   372k|         if (parse_node_properties<Opts, PropertyPolicy>(std::forward<T>(value), ctx, it, end, preamble.node_props)) {
  ------------------
  |  Branch (494:14): [True: 4.37k, False: 368k]
  ------------------
  495|  4.37k|            return true;
  496|  4.37k|         }
  497|       |
  498|   368k|         return false;
  499|   372k|      }
_ZZN3glz4fromILj450ENSt3__16vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS1_9allocatorIS6_EEEEE2opITnDaXtlNS_4optsELj10ELb1ELb0ELb0ELb1EEERPKcRS9_TkNS_10is_contextERNS_4yaml12yaml_contextESE_EEvOT1_OT2_OT0_T3_ENKUlNSH_8yaml_tagEE_clESR_:
 4106|   372k|                                             [](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|   372k|      {
  409|   372k|         state.has_anchor = false;
  410|   372k|         state.anchor_name.clear();
  411|   372k|         state.anchor_start = nullptr;
  412|   372k|         state.anchor_indent = ctx.current_indent();
  413|       |
  414|   372k|         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|   372k|            else {
  421|   372k|               if (handle_alias<Opts>(std::forward<T>(value), ctx, it, end)) return true;
  ------------------
  |  Branch (421:20): [True: 4.34k, False: 368k]
  ------------------
  422|   372k|            }
  423|   372k|         }
  424|       |
  425|   372k|         if (it != end && *it == '&') {
  ------------------
  |  Branch (425:14): [True: 368k, False: 4.34k]
  |  Branch (425:27): [True: 5.34k, False: 363k]
  ------------------
  426|  5.34k|            ++it;
  427|  5.34k|            auto name = parse_anchor_name(it, end);
  428|  5.34k|            if (name.empty()) {
  ------------------
  |  Branch (428:17): [True: 12, False: 5.33k]
  ------------------
  429|     12|               ctx.error = error_code::syntax_error;
  430|     12|               return true;
  431|     12|            }
  432|  5.33k|            skip_inline_ws(it, end);
  433|  5.33k|            if (it == end) {
  ------------------
  |  Branch (433:17): [True: 20, False: 5.31k]
  ------------------
  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|  5.31k|            state.has_anchor = true;
  446|  5.31k|            state.anchor_name = std::string(name);
  447|  5.31k|            state.anchor_start = &*it;
  448|  5.31k|         }
  449|       |
  450|   372k|         return false;
  451|   372k|      }
_ZN3glz4yaml12handle_aliasITnDaXtlNS_4optsELj10ELb1ELb0ELb0ELb1EEERNSt3__16vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS3_9allocatorIS8_EEEENS0_12yaml_contextEPKcSF_EEbOT0_RT1_RT2_T3_:
  300|   372k|      {
  301|   372k|         if (it == end || *it != '*') return false;
  ------------------
  |  Branch (301:14): [True: 0, False: 372k]
  |  Branch (301:27): [True: 368k, False: 4.34k]
  ------------------
  302|       |
  303|  4.34k|         ++it; // skip '*'
  304|  4.34k|         auto name = parse_anchor_name(it, end);
  305|  4.34k|         if (name.empty()) {
  ------------------
  |  Branch (305:14): [True: 22, False: 4.32k]
  ------------------
  306|     22|            ctx.error = error_code::syntax_error;
  307|     22|            return true;
  308|     22|         }
  309|       |
  310|  4.32k|         auto anchor_it = ctx.anchors.find(name);
  311|  4.32k|         if (anchor_it == ctx.anchors.end()) {
  ------------------
  |  Branch (311:14): [True: 44, False: 4.27k]
  ------------------
  312|     44|            ctx.error = error_code::syntax_error; // undefined alias
  313|     44|            return true;
  314|     44|         }
  315|       |
  316|       |         // Copied rather than referenced: the replay below can replace ctx.anchors wholesale
  317|       |         // (a speculative parse hands its own map back), which would dangle a reference here.
  318|  4.27k|         const auto span = anchor_it->second;
  319|       |
  320|       |         // Empty anchor span (anchor on null/empty node) — leave value as default
  321|  4.27k|         if (span.begin == span.end) {
  ------------------
  |  Branch (321:14): [True: 68, False: 4.21k]
  ------------------
  322|     68|            return true;
  323|     68|         }
  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.21k|         if (ctx.alias_span_is_replaying(span.begin, span.end)) [[unlikely]] {
  ------------------
  |  Branch (328:14): [True: 22, False: 4.18k]
  ------------------
  329|     22|            ctx.error = error_code::syntax_error; // cyclic alias
  330|     22|            return true;
  331|     22|         }
  332|       |
  333|       |         // Replaying an anchor re-enters the reader directly, bypassing the variant reader's
  334|       |         // depth guard, so this is the only depth accounting a chain of aliases into a
  335|       |         // non-variant target gets. The cycle check above stops the unbounded case; this bounds
  336|       |         // a legitimate but deeply chained one.
  337|  4.18k|         depth_guard guard{ctx, yaml::max_yaml_recursive_depth};
  338|  4.18k|         if (!guard) [[unlikely]]
  ------------------
  |  Branch (338:14): [True: 20, False: 4.16k]
  ------------------
  339|     20|            return true;
  340|       |
  341|  4.16k|         if (!ctx.charge_alias_expansion(static_cast<size_t>(span.end - span.begin))) [[unlikely]] {
  ------------------
  |  Branch (341:14): [True: 0, False: 4.16k]
  ------------------
  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.16k|         auto replay_it = span.begin;
  348|  4.16k|         auto replay_end = span.end;
  349|       |
  350|       |         // Save indent context and set up for replay
  351|  4.16k|         auto saved_indent_stack = std::move(ctx.indent_stack);
  352|  4.16k|         ctx.indent_stack.clear();
  353|  4.16k|         if (span.base_indent > 0) {
  ------------------
  |  Branch (353:14): [True: 1.55k, False: 2.61k]
  ------------------
  354|  1.55k|            ctx.push_indent(span.base_indent - 1);
  355|  1.55k|         }
  356|       |
  357|  4.16k|         ctx.active_alias_spans.emplace_back(span.begin, span.end);
  358|       |
  359|  4.16k|         using V = std::remove_cvref_t<T>;
  360|  4.16k|         from<YAML, V>::template op<Opts>(std::forward<T>(value), ctx, replay_it, replay_end);
  361|       |
  362|  4.16k|         ctx.active_alias_spans.pop_back();
  363|       |
  364|       |         // Restore indent context
  365|  4.16k|         ctx.indent_stack = std::move(saved_indent_stack);
  366|  4.16k|         return true;
  367|  4.16k|      }
_ZN3glz4yaml19parse_flow_sequenceITnDaXtlNS_4optsELj10ELb1ELb0ELb0ELb1EEERNSt3__16vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS3_9allocatorIS8_EEEENS0_12yaml_contextEPKcSF_EEvOT0_RT1_RT2_T3_:
 2596|  43.0k|      {
 2597|  43.0k|         using V = std::remove_cvref_t<T>;
 2598|  43.0k|         using value_type = typename V::value_type;
 2599|       |
 2600|  43.0k|         struct sequence_container_adapter
 2601|  43.0k|         {
 2602|  43.0k|            size_t index = 0;
 2603|       |
 2604|  43.0k|            inline bool fixed_capacity_reached(const V& container) const noexcept
 2605|  43.0k|            {
 2606|  43.0k|               if constexpr (!resizable<V>) {
 2607|  43.0k|                  return index >= container.size();
 2608|  43.0k|               }
 2609|  43.0k|               else {
 2610|  43.0k|                  (void)container;
 2611|  43.0k|                  return false;
 2612|  43.0k|               }
 2613|  43.0k|            }
 2614|       |
 2615|  43.0k|            inline void commit_fixed_slot() noexcept { ++index; }
 2616|       |
 2617|  43.0k|            inline void append(V& container, value_type&& element) noexcept
 2618|  43.0k|            {
 2619|  43.0k|               if constexpr (emplace_backable<V>) {
 2620|  43.0k|                  container.emplace_back(std::move(element));
 2621|  43.0k|               }
 2622|  43.0k|               else if constexpr (emplaceable<V>) {
 2623|  43.0k|                  container.emplace(std::move(element));
 2624|  43.0k|               }
 2625|  43.0k|            }
 2626|  43.0k|         };
 2627|       |
 2628|  43.0k|         if (it == end || *it != '[') [[unlikely]] {
  ------------------
  |  Branch (2628:14): [True: 0, False: 43.0k]
  |  Branch (2628:27): [True: 0, False: 43.0k]
  ------------------
 2629|      0|            ctx.error = error_code::syntax_error;
 2630|      0|            return;
 2631|      0|         }
 2632|       |
 2633|       |         // Overwrite (do not append to) any pre-existing contents. Must happen
 2634|       |         // before the empty-array early return below so that `[]` also clears.
 2635|  43.0k|         clear_sequence_before_read<Opts>(value);
 2636|       |
 2637|  43.0k|         ++it; // Skip '['
 2638|       |         // Skip whitespace and newlines after opening bracket (YAML allows multi-line flow sequences)
 2639|  43.0k|         skip_flow_ws_and_newlines(ctx, it, end);
 2640|  43.0k|         if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2640:14): [True: 6, False: 43.0k]
  ------------------
 2641|      6|            return;
 2642|       |
 2643|       |         // Handle empty array
 2644|  43.0k|         if (it != end && *it == ']') {
  ------------------
  |  Branch (2644:14): [True: 42.3k, False: 716]
  |  Branch (2644:27): [True: 5.20k, False: 37.1k]
  ------------------
 2645|  5.20k|            ++it;
 2646|  5.20k|            validate_flow_node_adjacent_tail(ctx, it, end);
 2647|  5.20k|            if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2647:17): [True: 6, False: 5.19k]
  ------------------
 2648|      6|               return;
 2649|  5.19k|            if constexpr (!yaml::check_flow_context(Opts)) {
 2650|  5.19k|               if (ctx.current_indent() < 0) {
  ------------------
  |  Branch (2650:20): [True: 756, False: 4.43k]
  ------------------
 2651|    756|                  validate_root_flow_tail_after_close(ctx, it, end);
 2652|    756|               }
 2653|  5.19k|            }
 2654|  5.19k|            return;
 2655|  5.20k|         }
 2656|       |
 2657|  37.8k|         bool just_saw_comma = false;
 2658|  37.8k|         sequence_container_adapter adapter{};
 2659|       |
 2660|  37.8k|         if constexpr (emplace_backable<V> || emplaceable<V>) {
 2661|       |            // Dynamic containers append items (vector-like and set-like)
 2662|  72.6k|            while (it != end) {
  ------------------
  |  Branch (2662:20): [True: 67.2k, False: 5.34k]
  ------------------
 2663|  67.2k|               skip_flow_ws_and_newlines(ctx, it, end);
 2664|  67.2k|               if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2664:20): [True: 0, False: 67.2k]
  ------------------
 2665|      0|                  return;
 2666|       |
 2667|  67.2k|               if (it == end) [[unlikely]] {
  ------------------
  |  Branch (2667:20): [True: 0, False: 67.2k]
  ------------------
 2668|      0|                  ctx.error = error_code::unexpected_end;
 2669|      0|                  return;
 2670|      0|               }
 2671|       |
 2672|  67.2k|               if (*it == ']') {
  ------------------
  |  Branch (2672:20): [True: 6.16k, False: 61.1k]
  ------------------
 2673|  6.16k|                  if (just_saw_comma) {
  ------------------
  |  Branch (2673:23): [True: 6.16k, False: 0]
  ------------------
 2674|  6.16k|                     ++it;
 2675|  6.16k|                     validate_flow_node_adjacent_tail(ctx, it, end);
 2676|  6.16k|                     if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2676:26): [True: 10, False: 6.15k]
  ------------------
 2677|     10|                        return;
 2678|  6.15k|                     if constexpr (!yaml::check_flow_context(Opts)) {
 2679|  6.15k|                        if (ctx.current_indent() < 0) {
  ------------------
  |  Branch (2679:29): [True: 630, False: 5.52k]
  ------------------
 2680|    630|                           validate_root_flow_tail_after_close(ctx, it, end);
 2681|    630|                        }
 2682|  6.15k|                     }
 2683|  6.15k|                     return;
 2684|  6.16k|                  }
 2685|      0|                  ctx.error = error_code::syntax_error;
 2686|      0|                  return;
 2687|  6.16k|               }
 2688|       |
 2689|  61.1k|               if (*it == ',' || *it == '#') {
  ------------------
  |  Branch (2689:20): [True: 10, False: 61.0k]
  |  Branch (2689:34): [True: 6, False: 61.0k]
  ------------------
 2690|     16|                  ctx.error = error_code::syntax_error;
 2691|     16|                  return;
 2692|     16|               }
 2693|  61.0k|               just_saw_comma = false;
 2694|       |
 2695|  61.0k|               value_type element{};
 2696|  61.0k|               from<YAML, value_type>::template op<flow_context_on<Opts>()>(element, ctx, it, end);
 2697|       |
 2698|  61.0k|               if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2698:20): [True: 14.5k, False: 46.5k]
  ------------------
 2699|  14.5k|                  return;
 2700|       |
 2701|  46.5k|               bool saw_line_break_before_separator = false;
 2702|  46.5k|               skip_flow_ws_and_newlines(ctx, it, end, &saw_line_break_before_separator);
 2703|  46.5k|               if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2703:20): [True: 6, False: 46.5k]
  ------------------
 2704|      6|                  return;
 2705|       |
 2706|  46.5k|               if (it != end && *it == ':') {
  ------------------
  |  Branch (2706:20): [True: 44.8k, False: 1.67k]
  |  Branch (2706:33): [True: 16.2k, False: 28.6k]
  ------------------
 2707|       |                  // In flow sequences, implicit key-value pairs must be on a single line.
 2708|  16.2k|                  if (saw_line_break_before_separator) {
  ------------------
  |  Branch (2708:23): [True: 10, False: 16.2k]
  ------------------
 2709|     10|                     ctx.error = error_code::syntax_error;
 2710|     10|                     return;
 2711|     10|                  }
 2712|  16.2k|                  if constexpr (std::same_as<std::remove_cvref_t<value_type>, glz::generic>) {
 2713|  16.2k|                     glz::generic key_node = std::move(element);
 2714|  16.2k|                     ++it;
 2715|  16.2k|                     skip_inline_ws(it, end);
 2716|       |
 2717|  16.2k|                     glz::generic mapped{};
 2718|  16.2k|                     from<YAML, glz::generic>::template op<flow_context_on<Opts>()>(mapped, ctx, it, end);
 2719|  16.2k|                     if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2719:26): [True: 758, False: 15.4k]
  ------------------
 2720|    758|                        return;
 2721|       |
 2722|  15.4k|                     std::string key;
 2723|  15.4k|                     if (!yaml::materialize_key(key, key_node, ctx)) [[unlikely]]
  ------------------
  |  Branch (2723:26): [True: 0, False: 15.4k]
  ------------------
 2724|      0|                        return;
 2725|       |
 2726|  15.4k|                     glz::generic pair{};
 2727|  15.4k|                     pair[key] = std::move(mapped);
 2728|  15.4k|                     element = std::move(pair);
 2729|       |
 2730|  15.4k|                     skip_flow_ws_and_newlines(ctx, it, end);
 2731|  15.4k|                     if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2731:26): [True: 6, False: 15.4k]
  ------------------
 2732|      6|                        return;
 2733|       |                  }
 2734|       |                  else {
 2735|       |                     ctx.error = error_code::syntax_error;
 2736|       |                     return;
 2737|       |                  }
 2738|  16.2k|               }
 2739|       |
 2740|  46.5k|               adapter.append(value, std::move(element));
 2741|       |
 2742|  46.5k|               if (it == end) [[unlikely]] {
  ------------------
  |  Branch (2742:20): [True: 1.68k, False: 44.8k]
  ------------------
 2743|  1.68k|                  ctx.error = error_code::unexpected_end;
 2744|  1.68k|                  return;
 2745|  1.68k|               }
 2746|       |
 2747|  44.8k|               if (*it == ']') {
  ------------------
  |  Branch (2747:20): [True: 8.93k, False: 35.9k]
  ------------------
 2748|  8.93k|                  ++it;
 2749|  8.93k|                  validate_flow_node_adjacent_tail(ctx, it, end);
 2750|  8.93k|                  if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2750:23): [True: 20, False: 8.91k]
  ------------------
 2751|     20|                     return;
 2752|  8.91k|                  if constexpr (!yaml::check_flow_context(Opts)) {
 2753|  8.91k|                     if (ctx.current_indent() < 0) {
  ------------------
  |  Branch (2753:26): [True: 1.00k, False: 7.90k]
  ------------------
 2754|  1.00k|                        validate_root_flow_tail_after_close(ctx, it, end);
 2755|  1.00k|                     }
 2756|  8.91k|                  }
 2757|  8.91k|                  return;
 2758|  8.93k|               }
 2759|  35.9k|               else if (*it == ',') {
  ------------------
  |  Branch (2759:25): [True: 34.7k, False: 1.11k]
  ------------------
 2760|  34.7k|                  ++it;
 2761|  34.7k|                  just_saw_comma = true;
 2762|  34.7k|                  skip_flow_ws_and_newlines(ctx, it, end);
 2763|  34.7k|                  if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2763:23): [True: 6, False: 34.7k]
  ------------------
 2764|      6|                     return;
 2765|  34.7k|               }
 2766|  1.11k|               else {
 2767|  1.11k|                  ctx.error = error_code::syntax_error;
 2768|  1.11k|                  return;
 2769|  1.11k|               }
 2770|  44.8k|            }
 2771|       |         }
 2772|       |         else if constexpr (!resizable<V>) {
 2773|       |            // Fixed-size containers (std::array)
 2774|       |            while (it != end && !adapter.fixed_capacity_reached(value)) {
 2775|       |               skip_flow_ws_and_newlines(ctx, it, end);
 2776|       |               if (bool(ctx.error)) [[unlikely]]
 2777|       |                  return;
 2778|       |
 2779|       |               if (it == end) [[unlikely]] {
 2780|       |                  ctx.error = error_code::unexpected_end;
 2781|       |                  return;
 2782|       |               }
 2783|       |
 2784|       |               if (*it == ']') {
 2785|       |                  if (just_saw_comma) {
 2786|       |                     ++it;
 2787|       |                     validate_flow_node_adjacent_tail(ctx, it, end);
 2788|       |                     if (bool(ctx.error)) [[unlikely]]
 2789|       |                        return;
 2790|       |                     if constexpr (!yaml::check_flow_context(Opts)) {
 2791|       |                        if (ctx.current_indent() < 0) {
 2792|       |                           validate_root_flow_tail_after_close(ctx, it, end);
 2793|       |                        }
 2794|       |                     }
 2795|       |                     return;
 2796|       |                  }
 2797|       |                  ctx.error = error_code::syntax_error;
 2798|       |                  return;
 2799|       |               }
 2800|       |
 2801|       |               if (*it == ',' || *it == '#') {
 2802|       |                  ctx.error = error_code::syntax_error;
 2803|       |                  return;
 2804|       |               }
 2805|       |               just_saw_comma = false;
 2806|       |
 2807|       |               from<YAML, value_type>::template op<flow_context_on<Opts>()>(value[adapter.index], ctx, it, end);
 2808|       |
 2809|       |               if (bool(ctx.error)) [[unlikely]]
 2810|       |                  return;
 2811|       |
 2812|       |               adapter.commit_fixed_slot();
 2813|       |               skip_flow_ws_and_newlines(ctx, it, end);
 2814|       |               if (bool(ctx.error)) [[unlikely]]
 2815|       |                  return;
 2816|       |
 2817|       |               if (it == end) [[unlikely]] {
 2818|       |                  ctx.error = error_code::unexpected_end;
 2819|       |                  return;
 2820|       |               }
 2821|       |
 2822|       |               if (*it == ']') {
 2823|       |                  ++it;
 2824|       |                  validate_flow_node_adjacent_tail(ctx, it, end);
 2825|       |                  if (bool(ctx.error)) [[unlikely]]
 2826|       |                     return;
 2827|       |                  if constexpr (!yaml::check_flow_context(Opts)) {
 2828|       |                     if (ctx.current_indent() < 0) {
 2829|       |                        validate_root_flow_tail_after_close(ctx, it, end);
 2830|       |                     }
 2831|       |                  }
 2832|       |                  return;
 2833|       |               }
 2834|       |               else if (*it == ',') {
 2835|       |                  ++it;
 2836|       |                  just_saw_comma = true;
 2837|       |                  skip_flow_ws_and_newlines(ctx, it, end);
 2838|       |                  if (bool(ctx.error)) [[unlikely]]
 2839|       |                     return;
 2840|       |               }
 2841|       |               else {
 2842|       |                  ctx.error = error_code::syntax_error;
 2843|       |                  return;
 2844|       |               }
 2845|       |            }
 2846|       |
 2847|       |            // If we exited because the fixed-size container is full but haven't seen ']',
 2848|       |            // skip to the closing bracket to consume overflow elements.
 2849|       |            int bracket_depth = 1;
 2850|       |            while (it != end && bracket_depth > 0) {
 2851|       |               if (*it == '[') {
 2852|       |                  ++bracket_depth;
 2853|       |               }
 2854|       |               else if (*it == ']') {
 2855|       |                  --bracket_depth;
 2856|       |               }
 2857|       |               ++it;
 2858|       |            }
 2859|       |         }
 2860|       |         else {
 2861|       |            ctx.error = error_code::syntax_error;
 2862|       |            return;
 2863|       |         }
 2864|  37.8k|      }
_ZN3glz4yaml26clear_sequence_before_readITnDaXtlNS_4optsELj10ELb1ELb0ELb0ELb1EEENSt3__16vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS3_9allocatorIS8_EEEEEEvRT0_:
 2580|   368k|      {
 2581|   368k|         if constexpr (emplace_backable<V> && requires { value.clear(); }) {
 2582|       |            // vector-like: honor the append_arrays option, matching json/read.hpp
 2583|   368k|            if constexpr (!check_append_arrays(Opts)) {
 2584|   368k|               value.clear();
 2585|   368k|            }
 2586|       |         }
 2587|       |         else if constexpr (emplaceable<V> && requires { value.clear(); }) {
 2588|       |            // set-like: json/read.hpp clears unconditionally; append_arrays does not apply
 2589|       |            value.clear();
 2590|       |         }
 2591|   368k|      }
_ZN3glz4yaml35validate_root_flow_tail_after_closeINS0_12yaml_contextEPKcS4_EEvRT_RT0_T1_:
  955|  7.11k|      {
  956|  7.11k|         auto is_document_start = [&](auto pos) {
  957|  7.11k|            if (end - pos >= 3 && pos[0] == '-' && pos[1] == '-' && pos[2] == '-') {
  958|  7.11k|               auto after = pos + 3;
  959|  7.11k|               return after == end || *after == ' ' || *after == '\t' || *after == '\n' || *after == '\r' ||
  960|  7.11k|                      *after == '#';
  961|  7.11k|            }
  962|  7.11k|            return false;
  963|  7.11k|         };
  964|       |
  965|  7.11k|         bool at_line_start = false;
  966|  7.11k|         auto tail = it;
  967|  13.6k|         while (tail != end) {
  ------------------
  |  Branch (967:17): [True: 7.98k, False: 5.65k]
  ------------------
  968|  7.98k|            auto line = tail;
  969|  7.98k|            skip_inline_ws(line, end);
  970|       |
  971|  7.98k|            if (line == end) {
  ------------------
  |  Branch (971:17): [True: 218, False: 7.76k]
  ------------------
  972|    218|               return;
  973|    218|            }
  974|       |
  975|  7.76k|            if (*line == '\n' || *line == '\r') {
  ------------------
  |  Branch (975:17): [True: 948, False: 6.81k]
  |  Branch (975:34): [True: 3.28k, False: 3.52k]
  ------------------
  976|  4.23k|               tail = line;
  977|  4.23k|               skip_newline(tail, end);
  978|  4.23k|               at_line_start = true;
  979|  4.23k|               continue;
  980|  4.23k|            }
  981|       |
  982|  3.52k|            if (*line == '#') {
  ------------------
  |  Branch (982:17): [True: 2.35k, False: 1.17k]
  ------------------
  983|  2.35k|               if (!at_line_start && line == it) {
  ------------------
  |  Branch (983:20): [True: 422, False: 1.93k]
  |  Branch (983:38): [True: 36, False: 386]
  ------------------
  984|     36|                  ctx.error = error_code::syntax_error;
  985|     36|                  return;
  986|     36|               }
  987|  2.32k|               tail = line;
  988|  2.32k|               skip_comment(tail, end);
  989|  2.32k|               if (tail != end && (*tail == '\n' || *tail == '\r')) {
  ------------------
  |  Branch (989:20): [True: 2.28k, False: 38]
  |  Branch (989:36): [True: 864, False: 1.42k]
  |  Branch (989:53): [True: 1.42k, False: 0]
  ------------------
  990|  2.28k|                  skip_newline(tail, end);
  991|  2.28k|                  at_line_start = true;
  992|  2.28k|                  continue;
  993|  2.28k|               }
  994|     38|               return;
  995|  2.32k|            }
  996|       |
  997|  1.17k|            if (at_line_start && (at_document_end(line, end) || is_document_start(line))) {
  ------------------
  |  Branch (997:17): [True: 782, False: 388]
  |  Branch (997:35): [True: 454, False: 328]
  |  Branch (997:65): [True: 42, False: 286]
  ------------------
  998|    496|               return;
  999|    496|            }
 1000|       |
 1001|    674|            ctx.error = error_code::syntax_error;
 1002|    674|            return;
 1003|  1.17k|         }
 1004|  7.11k|      }
_ZZN3glz4yaml35validate_root_flow_tail_after_closeINS0_12yaml_contextEPKcS4_EEvRT_RT0_T1_ENKUlS5_E_clIS4_EEDaS5_:
  956|    328|         auto is_document_start = [&](auto pos) {
  957|    328|            if (end - pos >= 3 && pos[0] == '-' && pos[1] == '-' && pos[2] == '-') {
  ------------------
  |  Branch (957:17): [True: 238, False: 90]
  |  Branch (957:35): [True: 58, False: 180]
  |  Branch (957:52): [True: 50, False: 8]
  |  Branch (957:69): [True: 44, False: 6]
  ------------------
  958|     44|               auto after = pos + 3;
  959|     44|               return after == end || *after == ' ' || *after == '\t' || *after == '\n' || *after == '\r' ||
  ------------------
  |  Branch (959:23): [True: 2, False: 42]
  |  Branch (959:39): [True: 14, False: 28]
  |  Branch (959:56): [True: 10, False: 18]
  |  Branch (959:74): [True: 6, False: 12]
  |  Branch (959:92): [True: 6, False: 6]
  ------------------
  960|      6|                      *after == '#';
  ------------------
  |  Branch (960:23): [True: 4, False: 2]
  ------------------
  961|     44|            }
  962|    284|            return false;
  963|    328|         };
_ZZN3glz4yaml19parse_flow_sequenceITnDaXtlNS_4optsELj10ELb1ELb0ELb0ELb1EEERNSt3__16vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS3_9allocatorIS8_EEEENS0_12yaml_contextEPKcSF_EEvOT0_RT1_RT2_T3_EN26sequence_container_adapter6appendESC_OS8_:
 2618|  45.7k|            {
 2619|  45.7k|               if constexpr (emplace_backable<V>) {
 2620|  45.7k|                  container.emplace_back(std::move(element));
 2621|       |               }
 2622|       |               else if constexpr (emplaceable<V>) {
 2623|       |                  container.emplace(std::move(element));
 2624|       |               }
 2625|  45.7k|            }
_ZN3glz4yaml20parse_block_sequenceITnDaXtlNS_4optsELj10ELb1ELb0ELb0ELb1EEERNSt3__16vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS3_9allocatorIS8_EEEENS0_12yaml_contextEPKcSF_EEvOT0_RT1_RT2_T3_i:
 3081|   325k|      {
 3082|   325k|         using V = std::remove_cvref_t<T>;
 3083|   325k|         using value_type = typename V::value_type;
 3084|       |
 3085|   325k|         struct sequence_container_adapter
 3086|   325k|         {
 3087|   325k|            size_t index = 0;
 3088|       |
 3089|   325k|            inline bool fixed_capacity_reached(const V& container) const noexcept
 3090|   325k|            {
 3091|   325k|               if constexpr (!resizable<V>) {
 3092|   325k|                  return index >= container.size();
 3093|   325k|               }
 3094|   325k|               else {
 3095|   325k|                  (void)container;
 3096|   325k|                  return false;
 3097|   325k|               }
 3098|   325k|            }
 3099|       |
 3100|   325k|            inline void commit_fixed_slot() noexcept { ++index; }
 3101|       |
 3102|   325k|            inline void append(V& container, value_type&& element) noexcept
 3103|   325k|            {
 3104|   325k|               if constexpr (emplace_backable<V>) {
 3105|   325k|                  container.emplace_back(std::move(element));
 3106|   325k|               }
 3107|   325k|               else if constexpr (emplaceable<V>) {
 3108|   325k|                  container.emplace(std::move(element));
 3109|   325k|               }
 3110|   325k|            }
 3111|   325k|         };
 3112|       |
 3113|       |         // Overwrite (do not append to) any pre-existing contents. A block
 3114|       |         // sequence is only entered once a '-' item is confirmed, so clearing
 3115|       |         // up front correctly (re)assigns the container to the parsed sequence.
 3116|   325k|         clear_sequence_before_read<Opts>(value);
 3117|       |
 3118|   325k|         sequence_container_adapter adapter{};
 3119|       |
 3120|       |         // Track if this is the first item (for handling whitespace-consumed case)
 3121|   325k|         bool first_item = true;
 3122|   325k|         bool has_pending_item_anchor = false;
 3123|   325k|         std::string pending_item_anchor_name{};
 3124|   325k|         int32_t pending_item_anchor_indent = sequence_indent;
 3125|       |
 3126|   697k|         while (it != end) {
  ------------------
  |  Branch (3126:17): [True: 551k, False: 146k]
  ------------------
 3127|       |            // For fixed-size arrays (e.g. std::array), stop when we've filled all elements.
 3128|       |            // Exclude emplaceable types (e.g. std::set) which are not resizable but grow dynamically.
 3129|       |            if constexpr (!resizable<V> && !emplaceable<V>) {
 3130|       |               if (adapter.fixed_capacity_reached(value)) {
 3131|       |                  return;
 3132|       |               }
 3133|       |            }
 3134|       |
 3135|       |            // Skip blank lines and comments, track indent
 3136|   551k|            int32_t line_indent = 0;
 3137|   551k|            int32_t dash_col = -1; // actual column of the '-' on the line
 3138|   551k|            auto line_start = it;
 3139|       |
 3140|   890k|            while (it != end) {
  ------------------
  |  Branch (3140:20): [True: 859k, False: 31.7k]
  ------------------
 3141|   859k|               if (*it == '#') {
  ------------------
  |  Branch (3141:20): [True: 51.2k, False: 807k]
  ------------------
 3142|  51.2k|                  skip_comment(it, end);
 3143|  51.2k|                  skip_newline(it, end);
 3144|  51.2k|                  line_start = it;
 3145|  51.2k|                  line_indent = 0;
 3146|  51.2k|               }
 3147|   807k|               else if (*it == '\n' || *it == '\r') {
  ------------------
  |  Branch (3147:25): [True: 105k, False: 702k]
  |  Branch (3147:40): [True: 133k, False: 568k]
  ------------------
 3148|   239k|                  skip_newline(it, end);
 3149|   239k|                  line_start = it;
 3150|   239k|                  line_indent = 0;
 3151|   239k|               }
 3152|   568k|               else if (*it == ' ') {
  ------------------
  |  Branch (3152:25): [True: 83.1k, False: 485k]
  ------------------
 3153|  83.1k|                  line_start = it;
 3154|  83.1k|                  line_indent = 0;
 3155|   262k|                  while (it != end && *it == ' ') {
  ------------------
  |  Branch (3155:26): [True: 257k, False: 5.13k]
  |  Branch (3155:39): [True: 179k, False: 78.0k]
  ------------------
 3156|   179k|                     ++line_indent;
 3157|   179k|                     ++it;
 3158|   179k|                  }
 3159|       |
 3160|  83.1k|                  bool saw_tab = false;
 3161|   105k|                  while (it != end && (*it == ' ' || *it == '\t')) {
  ------------------
  |  Branch (3161:26): [True: 98.6k, False: 6.46k]
  |  Branch (3161:40): [True: 10.8k, False: 87.7k]
  |  Branch (3161:54): [True: 11.0k, False: 76.7k]
  ------------------
 3162|  21.9k|                     saw_tab = saw_tab || (*it == '\t');
  ------------------
  |  Branch (3162:32): [True: 14.3k, False: 7.54k]
  |  Branch (3162:43): [True: 7.54k, False: 0]
  ------------------
 3163|  21.9k|                     ++it;
 3164|  21.9k|                  }
 3165|       |
 3166|  83.1k|                  if (it == end || *it == '\n' || *it == '\r' || *it == '#') {
  ------------------
  |  Branch (3166:23): [True: 6.46k, False: 76.7k]
  |  Branch (3166:36): [True: 3.42k, False: 73.2k]
  |  Branch (3166:51): [True: 2.56k, False: 70.7k]
  |  Branch (3166:66): [True: 14.4k, False: 56.2k]
  ------------------
 3167|       |                     // Blank or comment line - continue to next line
 3168|  26.9k|                     if (it != end && *it == '#') {
  ------------------
  |  Branch (3168:26): [True: 20.4k, False: 6.46k]
  |  Branch (3168:39): [True: 14.4k, False: 5.99k]
  ------------------
 3169|  14.4k|                        skip_comment(it, end);
 3170|  14.4k|                     }
 3171|  26.9k|                     line_indent = 0;
 3172|  26.9k|                     continue;
 3173|  26.9k|                  }
 3174|       |
 3175|  56.2k|                  if (saw_tab) {
  ------------------
  |  Branch (3175:23): [True: 26, False: 56.2k]
  ------------------
 3176|     26|                     ctx.error = error_code::syntax_error;
 3177|     26|                     return;
 3178|     26|                  }
 3179|  56.2k|                  break; // Found content
 3180|  56.2k|               }
 3181|   485k|               else if (*it == '\t') {
  ------------------
  |  Branch (3181:25): [True: 22.3k, False: 463k]
  ------------------
 3182|  22.3k|                  line_start = it;
 3183|  58.7k|                  while (it != end && (*it == ' ' || *it == '\t')) ++it;
  ------------------
  |  Branch (3183:26): [True: 51.9k, False: 6.76k]
  |  Branch (3183:40): [True: 8.66k, False: 43.3k]
  |  Branch (3183:54): [True: 27.7k, False: 15.5k]
  ------------------
 3184|  22.3k|                  if (it == end || *it == '\n' || *it == '\r' || *it == '#') {
  ------------------
  |  Branch (3184:23): [True: 6.76k, False: 15.5k]
  |  Branch (3184:36): [True: 3.77k, False: 11.8k]
  |  Branch (3184:51): [True: 8.09k, False: 3.70k]
  |  Branch (3184:66): [True: 3.68k, False: 26]
  ------------------
 3185|  22.3k|                     if (it != end && *it == '#') {
  ------------------
  |  Branch (3185:26): [True: 15.5k, False: 6.76k]
  |  Branch (3185:39): [True: 3.68k, False: 11.8k]
  ------------------
 3186|  3.68k|                        skip_comment(it, end);
 3187|  3.68k|                     }
 3188|  22.3k|                     line_indent = 0;
 3189|  22.3k|                     continue;
 3190|  22.3k|                  }
 3191|     26|                  ctx.error = error_code::syntax_error;
 3192|     26|                  return;
 3193|  22.3k|               }
 3194|   463k|               else {
 3195|       |                  // At content (no leading space on this line)
 3196|       |                  // If first item and at '-', whitespace was consumed by caller;
 3197|       |                  // treat as having correct indentation
 3198|   463k|                  if (first_item && *it == '-') {
  ------------------
  |  Branch (3198:23): [True: 325k, False: 138k]
  |  Branch (3198:37): [True: 325k, False: 190]
  ------------------
 3199|   325k|                     line_indent = sequence_indent;
 3200|   325k|                     if constexpr (std::is_pointer_v<std::decay_t<It>>) {
 3201|   325k|                        if (ctx.stream_begin && it > ctx.stream_begin) {
  ------------------
  |  Branch (3201:29): [True: 325k, False: 0]
  |  Branch (3201:49): [True: 325k, False: 0]
  ------------------
 3202|   325k|                           auto probe = it;
 3203|   325k|                           int32_t leading_ws = 0;
 3204|   325k|                           bool saw_tab = false;
 3205|   705k|                           while (probe > ctx.stream_begin && (*(probe - 1) == ' ' || *(probe - 1) == '\t')) {
  ------------------
  |  Branch (3205:35): [True: 705k, False: 0]
  |  Branch (3205:64): [True: 336k, False: 368k]
  |  Branch (3205:87): [True: 43.1k, False: 325k]
  ------------------
 3206|   380k|                              --probe;
 3207|   380k|                              ++leading_ws;
 3208|   380k|                              saw_tab = saw_tab || (*probe == '\t');
  ------------------
  |  Branch (3208:41): [True: 36.6k, False: 343k]
  |  Branch (3208:52): [True: 8.65k, False: 334k]
  ------------------
 3209|   380k|                           }
 3210|   325k|                           if (probe == ctx.stream_begin || *(probe - 1) == '\n' || *(probe - 1) == '\r') {
  ------------------
  |  Branch (3210:32): [True: 0, False: 325k]
  |  Branch (3210:61): [True: 17.0k, False: 308k]
  |  Branch (3210:85): [True: 33.7k, False: 274k]
  ------------------
 3211|  50.8k|                              if (saw_tab) {
  ------------------
  |  Branch (3211:35): [True: 8, False: 50.8k]
  ------------------
 3212|      8|                                 ctx.error = error_code::syntax_error;
 3213|      8|                                 return;
 3214|      8|                              }
 3215|  50.8k|                              line_indent = (std::max)(line_indent, leading_ws);
 3216|  50.8k|                           }
 3217|   325k|                        }
 3218|   325k|                     }
 3219|   325k|                  }
 3220|   325k|                  break;
 3221|   463k|               }
 3222|   859k|            }
 3223|       |
 3224|   551k|            if (it == end) break;
  ------------------
  |  Branch (3224:17): [True: 31.7k, False: 519k]
  ------------------
 3225|       |
 3226|       |            // Check for document end marker
 3227|   519k|            if (at_document_end(it, end)) break;
  ------------------
  |  Branch (3227:17): [True: 6.69k, False: 512k]
  ------------------
 3228|       |
 3229|       |            // Check for dedent
 3230|   512k|            if (line_indent < sequence_indent) {
  ------------------
  |  Branch (3230:17): [True: 39.7k, False: 473k]
  ------------------
 3231|  39.7k|               it = line_start;
 3232|  39.7k|               return;
 3233|  39.7k|            }
 3234|       |
 3235|   473k|            if (*it == '&') {
  ------------------
  |  Branch (3235:17): [True: 15.4k, False: 457k]
  ------------------
 3236|       |               // Standalone anchor lines before "- item" are only supported for
 3237|       |               // indentless mapping values. At top-level block sequences these are
 3238|       |               // malformed in yaml-test-suite cases.
 3239|  15.4k|               if (!ctx.allow_indentless_sequence) {
  ------------------
  |  Branch (3239:20): [True: 50, False: 15.4k]
  ------------------
 3240|     50|                  ctx.error = error_code::syntax_error;
 3241|     50|                  return;
 3242|     50|               }
 3243|       |
 3244|  15.4k|               ++it;
 3245|  15.4k|               auto pending_name = parse_anchor_name(it, end);
 3246|  15.4k|               if (pending_name.empty()) {
  ------------------
  |  Branch (3246:20): [True: 14, False: 15.4k]
  ------------------
 3247|     14|                  ctx.error = error_code::syntax_error;
 3248|     14|                  return;
 3249|     14|               }
 3250|  15.4k|               skip_inline_ws(it, end);
 3251|  15.4k|               if (it != end && *it == '#') {
  ------------------
  |  Branch (3251:20): [True: 15.4k, False: 12]
  |  Branch (3251:33): [True: 2.60k, False: 12.8k]
  ------------------
 3252|  2.60k|                  skip_comment(it, end);
 3253|  2.60k|               }
 3254|       |
 3255|  15.4k|               has_pending_item_anchor = true;
 3256|  15.4k|               pending_item_anchor_name = std::string(pending_name);
 3257|  15.4k|               pending_item_anchor_indent = line_indent;
 3258|       |
 3259|  15.4k|               if (it == end || (*it != '\n' && *it != '\r')) {
  ------------------
  |  Branch (3259:20): [True: 12, False: 15.4k]
  |  Branch (3259:34): [True: 7.64k, False: 7.76k]
  |  Branch (3259:49): [True: 40, False: 7.60k]
  ------------------
 3260|     52|                  ctx.error = error_code::syntax_error;
 3261|     52|                  return;
 3262|     52|               }
 3263|       |
 3264|  15.3k|               skip_newline(it, end);
 3265|  15.3k|               continue;
 3266|  15.4k|            }
 3267|       |
 3268|       |            // Expect dash for sequence item
 3269|   457k|            if (*it != '-') {
  ------------------
  |  Branch (3269:17): [True: 88.4k, False: 369k]
  ------------------
 3270|  88.4k|               it = line_start;
 3271|  88.4k|               return;
 3272|  88.4k|            }
 3273|       |
 3274|       |            // Compute the actual column of this sequence dash.
 3275|       |            // This is needed by plain-scalar multiline folding to distinguish
 3276|       |            // sibling "- item" entries from deeper "- " continuation content.
 3277|   369k|            dash_col = line_indent;
 3278|   369k|            if constexpr (std::is_pointer_v<std::decay_t<It>>) {
 3279|   369k|               if (ctx.stream_begin) {
  ------------------
  |  Branch (3279:20): [True: 369k, False: 8]
  ------------------
 3280|   369k|                  dash_col = ctx.line_prefix_before(&*it).column;
 3281|   369k|               }
 3282|   369k|            }
 3283|       |
 3284|   369k|            ++it; // Skip '-'
 3285|       |
 3286|       |            // Check for valid sequence item indicator (- followed by space or newline)
 3287|   369k|            if (it != end && !yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*it)]) {
  ------------------
  |  Branch (3287:17): [True: 355k, False: 14.1k]
  |  Branch (3287:30): [True: 8.39k, False: 346k]
  ------------------
 3288|       |               // Not a sequence item (could be a number like -5)
 3289|  8.39k|               it = line_start;
 3290|  8.39k|               return;
 3291|  8.39k|            }
 3292|       |
 3293|   360k|            bool saw_tab_after_dash = false;
 3294|   915k|            while (it != end && (*it == ' ' || *it == '\t')) {
  ------------------
  |  Branch (3294:20): [True: 896k, False: 18.5k]
  |  Branch (3294:34): [True: 378k, False: 517k]
  |  Branch (3294:48): [True: 175k, False: 342k]
  ------------------
 3295|   554k|               saw_tab_after_dash = saw_tab_after_dash || (*it == '\t');
  ------------------
  |  Branch (3295:37): [True: 112k, False: 442k]
  |  Branch (3295:59): [True: 74.6k, False: 367k]
  ------------------
 3296|   554k|               ++it;
 3297|   554k|            }
 3298|       |            // A tab-separated nested "- " marker is not valid block indentation.
 3299|   360k|            if (saw_tab_after_dash && it != end && *it == '-') {
  ------------------
  |  Branch (3299:17): [True: 74.6k, False: 286k]
  |  Branch (3299:39): [True: 70.9k, False: 3.66k]
  |  Branch (3299:52): [True: 1.24k, False: 69.7k]
  ------------------
 3300|  1.24k|               const auto after_dash = it + 1;
 3301|  1.24k|               if (after_dash == end || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*after_dash)]) {
  ------------------
  |  Branch (3301:20): [True: 6, False: 1.24k]
  |  Branch (3301:41): [True: 6, False: 1.23k]
  ------------------
 3302|     12|                  ctx.error = error_code::syntax_error;
 3303|     12|                  return;
 3304|     12|               }
 3305|  1.24k|            }
 3306|       |
 3307|       |            // Get reference to element to parse into
 3308|   360k|            auto parse_element = [&](auto& element) {
 3309|   360k|               const char* element_start = (it != end) ? &*it : nullptr;
 3310|       |
 3311|       |               // Check what follows
 3312|   360k|               if (it != end && !yaml::line_end_or_comment_table[static_cast<uint8_t>(*it)]) {
 3313|       |                  // Content on same line as dash - set indent to one less than content column
 3314|       |                  // This allows nested block mappings to continue parsing keys at the content indent
 3315|       |                  // For "- key: val", if dash is at column 0, content is at column 2
 3316|       |                  // We set parent indent to 1 so keys at column 2 pass the "indent > parent" check
 3317|   360k|                  if (!ctx.push_indent(line_indent + 1)) [[unlikely]]
 3318|   360k|                     return;
 3319|   360k|                  const bool prev_sequence_item_value_context = ctx.sequence_item_value_context;
 3320|   360k|                  const int32_t prev_sequence_dash_indent = ctx.sequence_dash_indent;
 3321|   360k|                  ctx.sequence_item_value_context = true;
 3322|   360k|                  ctx.sequence_dash_indent = dash_col;
 3323|   360k|                  from<YAML, value_type>::template op<Opts>(element, ctx, it, end);
 3324|   360k|                  ctx.sequence_dash_indent = prev_sequence_dash_indent;
 3325|   360k|                  ctx.sequence_item_value_context = prev_sequence_item_value_context;
 3326|   360k|                  ctx.pop_indent();
 3327|   360k|               }
 3328|   360k|               else {
 3329|       |                  // Value on next line - nested block
 3330|   360k|                  skip_ws_and_comment(it, end);
 3331|   360k|                  skip_newline(it, end);
 3332|       |
 3333|       |                  // Get indent of nested content
 3334|   360k|                  auto nested_start = it;
 3335|   360k|                  int32_t nested_indent = measure_indent(it, end, ctx);
 3336|   360k|                  if (bool(ctx.error)) [[unlikely]]
 3337|   360k|                     return;
 3338|   360k|                  it = nested_start;
 3339|       |
 3340|       |                  // Content is nested only if indented more than the current line.
 3341|       |                  // When line_indent is negative (root level), use 0 as the baseline.
 3342|       |                  // This prevents content at column 0 from being treated as nested.
 3343|   360k|                  const int32_t effective_line_indent = (line_indent < 0) ? 0 : line_indent;
 3344|   360k|                  if (nested_indent > effective_line_indent) {
 3345|       |                     // Save and set indent for nested parsing.
 3346|       |                     // A struct element reads the pushed indent as its own key column; every
 3347|       |                     // other element type reads it as the enclosing baseline, so it gets one
 3348|       |                     // less than the content indent and its content passes "indent > parent".
 3349|   360k|                     const int32_t element_indent =
 3350|   360k|                        receives_block_mapping_column<value_type>() ? nested_indent : nested_indent - 1;
 3351|   360k|                     if (!ctx.push_indent(element_indent)) [[unlikely]]
 3352|   360k|                        return;
 3353|   360k|                     const bool prev_sequence_item_value_context = ctx.sequence_item_value_context;
 3354|   360k|                     const int32_t prev_sequence_dash_indent = ctx.sequence_dash_indent;
 3355|   360k|                     ctx.sequence_item_value_context = true;
 3356|   360k|                     ctx.sequence_dash_indent = dash_col;
 3357|   360k|                     from<YAML, value_type>::template op<Opts>(element, ctx, it, end);
 3358|   360k|                     ctx.sequence_dash_indent = prev_sequence_dash_indent;
 3359|   360k|                     ctx.sequence_item_value_context = prev_sequence_item_value_context;
 3360|   360k|                     ctx.pop_indent();
 3361|   360k|                  }
 3362|       |                  // else: empty element (default constructed)
 3363|   360k|               }
 3364|       |
 3365|   360k|               if (has_pending_item_anchor && !bool(ctx.error)) {
 3366|   360k|                  const char* element_end = (it != end) ? &*it : element_start;
 3367|   360k|                  ctx.anchors[std::move(pending_item_anchor_name)] = {element_start, element_end,
 3368|   360k|                                                                      pending_item_anchor_indent};
 3369|   360k|                  has_pending_item_anchor = false;
 3370|   360k|               }
 3371|   360k|            };
 3372|       |
 3373|   360k|            if constexpr (emplace_backable<V>) {
 3374|   360k|               auto& element = value.emplace_back();
 3375|   360k|               parse_element(element);
 3376|       |            }
 3377|       |            else if constexpr (emplaceable<V>) {
 3378|       |               value_type element{};
 3379|       |               parse_element(element);
 3380|       |               if (!bool(ctx.error)) {
 3381|       |                  adapter.append(value, std::move(element));
 3382|       |               }
 3383|       |            }
 3384|       |            else if constexpr (!resizable<V>) {
 3385|       |               parse_element(value[adapter.index]);
 3386|       |               adapter.commit_fixed_slot();
 3387|       |            }
 3388|       |            else {
 3389|       |               ctx.error = error_code::syntax_error;
 3390|       |               return;
 3391|       |            }
 3392|       |
 3393|   360k|            first_item = false;
 3394|       |
 3395|   360k|            if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (3395:17): [True: 3.61k, False: 357k]
  ------------------
 3396|  3.61k|               return;
 3397|       |
 3398|       |            // Note: after parsing nested block content, iterator may already be
 3399|       |            // at the start of the next line. The outer loop will handle it.
 3400|   360k|         }
 3401|   325k|      }
_ZZN3glz4yaml20parse_block_sequenceITnDaXtlNS_4optsELj10ELb1ELb0ELb0ELb1EEERNSt3__16vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS3_9allocatorIS8_EEEENS0_12yaml_contextEPKcSF_EEvOT0_RT1_RT2_T3_iENKUlRT_E_clIS8_EEDaSO_:
 3308|   360k|            auto parse_element = [&](auto& element) {
 3309|   360k|               const char* element_start = (it != end) ? &*it : nullptr;
  ------------------
  |  Branch (3309:44): [True: 342k, False: 18.5k]
  ------------------
 3310|       |
 3311|       |               // Check what follows
 3312|   360k|               if (it != end && !yaml::line_end_or_comment_table[static_cast<uint8_t>(*it)]) {
  ------------------
  |  Branch (3312:20): [True: 342k, False: 18.5k]
  |  Branch (3312:33): [True: 288k, False: 53.4k]
  ------------------
 3313|       |                  // Content on same line as dash - set indent to one less than content column
 3314|       |                  // This allows nested block mappings to continue parsing keys at the content indent
 3315|       |                  // For "- key: val", if dash is at column 0, content is at column 2
 3316|       |                  // We set parent indent to 1 so keys at column 2 pass the "indent > parent" check
 3317|   288k|                  if (!ctx.push_indent(line_indent + 1)) [[unlikely]]
  ------------------
  |  Branch (3317:23): [True: 0, False: 288k]
  ------------------
 3318|      0|                     return;
 3319|   288k|                  const bool prev_sequence_item_value_context = ctx.sequence_item_value_context;
 3320|   288k|                  const int32_t prev_sequence_dash_indent = ctx.sequence_dash_indent;
 3321|   288k|                  ctx.sequence_item_value_context = true;
 3322|   288k|                  ctx.sequence_dash_indent = dash_col;
 3323|   288k|                  from<YAML, value_type>::template op<Opts>(element, ctx, it, end);
 3324|   288k|                  ctx.sequence_dash_indent = prev_sequence_dash_indent;
 3325|   288k|                  ctx.sequence_item_value_context = prev_sequence_item_value_context;
 3326|   288k|                  ctx.pop_indent();
 3327|   288k|               }
 3328|  72.0k|               else {
 3329|       |                  // Value on next line - nested block
 3330|  72.0k|                  skip_ws_and_comment(it, end);
 3331|  72.0k|                  skip_newline(it, end);
 3332|       |
 3333|       |                  // Get indent of nested content
 3334|  72.0k|                  auto nested_start = it;
 3335|  72.0k|                  int32_t nested_indent = measure_indent(it, end, ctx);
 3336|  72.0k|                  if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (3336:23): [True: 6, False: 72.0k]
  ------------------
 3337|      6|                     return;
 3338|  72.0k|                  it = nested_start;
 3339|       |
 3340|       |                  // Content is nested only if indented more than the current line.
 3341|       |                  // When line_indent is negative (root level), use 0 as the baseline.
 3342|       |                  // This prevents content at column 0 from being treated as nested.
 3343|  72.0k|                  const int32_t effective_line_indent = (line_indent < 0) ? 0 : line_indent;
  ------------------
  |  Branch (3343:57): [True: 23.2k, False: 48.8k]
  ------------------
 3344|  72.0k|                  if (nested_indent > effective_line_indent) {
  ------------------
  |  Branch (3344:23): [True: 19.8k, False: 52.1k]
  ------------------
 3345|       |                     // Save and set indent for nested parsing.
 3346|       |                     // A struct element reads the pushed indent as its own key column; every
 3347|       |                     // other element type reads it as the enclosing baseline, so it gets one
 3348|       |                     // less than the content indent and its content passes "indent > parent".
 3349|  19.8k|                     const int32_t element_indent =
 3350|  19.8k|                        receives_block_mapping_column<value_type>() ? nested_indent : nested_indent - 1;
  ------------------
  |  Branch (3350:25): [Folded, False: 19.8k]
  ------------------
 3351|  19.8k|                     if (!ctx.push_indent(element_indent)) [[unlikely]]
  ------------------
  |  Branch (3351:26): [True: 0, False: 19.8k]
  ------------------
 3352|      0|                        return;
 3353|  19.8k|                     const bool prev_sequence_item_value_context = ctx.sequence_item_value_context;
 3354|  19.8k|                     const int32_t prev_sequence_dash_indent = ctx.sequence_dash_indent;
 3355|  19.8k|                     ctx.sequence_item_value_context = true;
 3356|  19.8k|                     ctx.sequence_dash_indent = dash_col;
 3357|  19.8k|                     from<YAML, value_type>::template op<Opts>(element, ctx, it, end);
 3358|  19.8k|                     ctx.sequence_dash_indent = prev_sequence_dash_indent;
 3359|  19.8k|                     ctx.sequence_item_value_context = prev_sequence_item_value_context;
 3360|  19.8k|                     ctx.pop_indent();
 3361|  19.8k|                  }
 3362|       |                  // else: empty element (default constructed)
 3363|  72.0k|               }
 3364|       |
 3365|   360k|               if (has_pending_item_anchor && !bool(ctx.error)) {
  ------------------
  |  Branch (3365:20): [True: 8.69k, False: 352k]
  |  Branch (3365:47): [True: 8.60k, False: 88]
  ------------------
 3366|  8.60k|                  const char* element_end = (it != end) ? &*it : element_start;
  ------------------
  |  Branch (3366:45): [True: 7.40k, False: 1.19k]
  ------------------
 3367|  8.60k|                  ctx.anchors[std::move(pending_item_anchor_name)] = {element_start, element_end,
 3368|  8.60k|                                                                      pending_item_anchor_indent};
 3369|  8.60k|                  has_pending_item_anchor = false;
 3370|  8.60k|               }
 3371|   360k|            };
_ZN3glz29parse_block_mapping_or_stringINSt3__17variantIJDndNS1_12basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEbNS1_6vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS6_ISD_EEEENSC_ISD_EEEEETnDaXtlNS_4optsELj10ELb1ELb0ELb0ELb1EEERSH_RNS_4yaml12yaml_contextERPKcSO_EEvOT1_OT2_OT3_T4_:
 5423|   652k|   {
 5424|       |      if constexpr (yaml::check_flow_context(Opts)) {
 5425|       |         // In flow context, only treat plain content as an implicit "key: value"
 5426|       |         // when a mapping separator appears before the next top-level flow delimiter.
 5427|       |         auto could_be_implicit_flow_pair = [&](auto pos) {
 5428|       |            // Bounded by the longest implicit key the spec allows: unbounded, this probe runs
 5429|       |            // once per entry per nesting level over the whole remaining flow collection.
 5430|       |            const auto stop = yaml::implicit_key_scan_end(pos, end);
 5431|       |            int depth = 0;
 5432|       |            while (pos != stop) {
 5433|       |               const char c = *pos;
 5434|       |               if (c == '"' || c == '\'') {
 5435|       |                  const char quote = c;
 5436|       |                  ++pos;
 5437|       |                  while (pos != stop && *pos != quote) {
 5438|       |                     if (*pos == '\\' && quote == '"') {
 5439|       |                        ++pos;
 5440|       |                        if (pos != stop) ++pos;
 5441|       |                     }
 5442|       |                     else {
 5443|       |                        ++pos;
 5444|       |                     }
 5445|       |                  }
 5446|       |                  if (pos != stop) ++pos;
 5447|       |                  continue;
 5448|       |               }
 5449|       |               if (c == '[' || c == '{') {
 5450|       |                  ++depth;
 5451|       |                  ++pos;
 5452|       |                  continue;
 5453|       |               }
 5454|       |               if (c == ']' || c == '}') {
 5455|       |                  if (depth == 0) return false;
 5456|       |                  --depth;
 5457|       |                  ++pos;
 5458|       |                  continue;
 5459|       |               }
 5460|       |               if (c == ',' && depth == 0) return false;
 5461|       |               if (c == ':' && depth == 0) {
 5462|       |                  auto next = pos + 1;
 5463|       |                  return next == end || *next == ' ' || *next == '\t' || *next == '\n' || *next == '\r';
 5464|       |               }
 5465|       |               ++pos;
 5466|       |            }
 5467|       |            return false;
 5468|       |         };
 5469|       |
 5470|       |         if (could_be_implicit_flow_pair(it) || line_could_be_flow_mapping(it, end)) {
 5471|       |            if (try_parse_block_mapping_into_variant<Variant, Opts>(value, ctx, it, end)) {
 5472|       |               return;
 5473|       |            }
 5474|       |            if (bool(ctx.error)) {
 5475|       |               return;
 5476|       |            }
 5477|       |         }
 5478|       |
 5479|       |         process_yaml_variant_alternatives<Variant, is_yaml_variant_str>::template op<Opts>(value, ctx, it, end);
 5480|       |         return;
 5481|       |      }
 5482|       |
 5483|   652k|      if (try_parse_block_mapping_into_variant<Variant, Opts>(value, ctx, it, end)) {
  ------------------
  |  Branch (5483:11): [True: 207k, False: 445k]
  ------------------
 5484|   207k|         return;
 5485|   207k|      }
 5486|       |      // If an error was set (e.g., malformed flow collection in value), don't try to parse as string
 5487|   445k|      if (bool(ctx.error)) {
  ------------------
  |  Branch (5487:11): [True: 44.3k, False: 400k]
  ------------------
 5488|  44.3k|         return;
 5489|  44.3k|      }
 5490|   400k|      process_yaml_variant_alternatives<Variant, is_yaml_variant_str>::template op<Opts>(value, ctx, it, end);
 5491|   400k|   }
_ZZN3glz4fromILj450ENSt3__17variantIJDndNS1_12basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEbNS1_6vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS6_ISD_EEEENSC_ISD_EEEEEE2opITnDaXtlNS_4optsELj10ELb1ELb0ELb0ELb1EEERPKcRSH_TkNS_10is_contextERNS_4yaml12yaml_contextESM_EEvOT1_OT2_OT0_T3_ENKUlT_E0_clISM_EEDaSZ_:
 5848|  63.9k|            auto is_word_boundary = [&](const auto ptr) {
 5849|  63.9k|               if (ptr == end) {
  ------------------
  |  Branch (5849:20): [True: 5.32k, False: 58.6k]
  ------------------
 5850|  5.32k|                  return true;
 5851|  5.32k|               }
 5852|  58.6k|               if (*ptr == ':') {
  ------------------
  |  Branch (5852:20): [True: 33.9k, False: 24.6k]
  ------------------
 5853|  33.9k|                  auto next = ptr + 1;
 5854|  33.9k|                  return (next == end) || *next == ' ' || *next == '\t' || *next == '\n' || *next == '\r';
  ------------------
  |  Branch (5854:26): [True: 18.8k, False: 15.1k]
  |  Branch (5854:43): [True: 5.73k, False: 9.39k]
  |  Branch (5854:59): [True: 1.37k, False: 8.02k]
  |  Branch (5854:76): [True: 2.60k, False: 5.42k]
  |  Branch (5854:93): [True: 4.43k, False: 994]
  ------------------
 5855|  33.9k|               }
 5856|  24.6k|               return is_plain_scalar_boundary(*ptr);
 5857|  58.6k|            };
_ZZN3glz4fromILj450ENSt3__17variantIJDndNS1_12basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEbNS1_6vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS6_ISD_EEEENSC_ISD_EEEEEE2opITnDaXtlNS_4optsELj10ELb1ELb0ELb0ELb1EEERPKcRSH_TkNS_10is_contextERNS_4yaml12yaml_contextESM_EEvOT1_OT2_OT0_T3_ENKUlcE_clEc:
 5774|  24.6k|            auto is_plain_scalar_boundary = [](const char ch) {
 5775|  24.6k|               switch (ch) {
 5776|  2.16k|               case ' ':
  ------------------
  |  Branch (5776:16): [True: 2.16k, False: 22.4k]
  ------------------
 5777|  2.80k|               case '\t':
  ------------------
  |  Branch (5777:16): [True: 632, False: 23.9k]
  ------------------
 5778|  17.4k|               case '\n':
  ------------------
  |  Branch (5778:16): [True: 14.6k, False: 9.93k]
  ------------------
 5779|  19.3k|               case '\r':
  ------------------
  |  Branch (5779:16): [True: 1.84k, False: 22.7k]
  ------------------
 5780|  19.3k|               case ',':
  ------------------
  |  Branch (5780:16): [True: 6, False: 24.6k]
  ------------------
 5781|  19.4k|               case ']':
  ------------------
  |  Branch (5781:16): [True: 74, False: 24.5k]
  ------------------
 5782|  19.4k|               case '}':
  ------------------
  |  Branch (5782:16): [True: 78, False: 24.5k]
  ------------------
 5783|  19.4k|                  return true;
 5784|  5.13k|               default:
  ------------------
  |  Branch (5784:16): [True: 5.13k, False: 19.4k]
  ------------------
 5785|  5.13k|                  return false;
 5786|  24.6k|               }
 5787|  24.6k|            };
_ZZN3glz4fromILj450ENSt3__17variantIJDndNS1_12basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEbNS1_6vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS6_ISD_EEEENSC_ISD_EEEEEE2opITnDaXtlNS_4optsELj10ELb1ELb0ELb0ELb1EEERPKcRSH_TkNS_10is_contextERNS_4yaml12yaml_contextESM_EEvOT1_OT2_OT0_T3_ENKUlT_E_clISM_EEDaSZ_:
 5789|  57.8k|            auto has_indented_block_continuation = [&](auto word_end) {
 5790|       |               if constexpr (yaml::check_flow_context(Opts)) {
 5791|       |                  return false;
 5792|       |               }
 5793|  57.8k|               if (ctx.current_indent() < 0) {
  ------------------
  |  Branch (5793:20): [True: 30.8k, False: 26.9k]
  ------------------
 5794|  30.8k|                  return false;
 5795|  30.8k|               }
 5796|  26.9k|               if (word_end == end || (*word_end != '\n' && *word_end != '\r')) {
  ------------------
  |  Branch (5796:20): [True: 1.99k, False: 24.9k]
  |  Branch (5796:40): [True: 10.5k, False: 14.4k]
  |  Branch (5796:61): [True: 8.75k, False: 1.77k]
  ------------------
 5797|  10.7k|                  return false;
 5798|  10.7k|               }
 5799|       |
 5800|  16.2k|               auto look = word_end;
 5801|  16.2k|               yaml::skip_newline(look, end);
 5802|  53.2k|               while (look != end) {
  ------------------
  |  Branch (5802:23): [True: 51.8k, False: 1.41k]
  ------------------
 5803|  51.8k|                  int32_t line_indent = 0;
 5804|  83.4k|                  while (look != end && *look == ' ') {
  ------------------
  |  Branch (5804:26): [True: 82.7k, False: 648]
  |  Branch (5804:41): [True: 31.5k, False: 51.1k]
  ------------------
 5805|  31.5k|                     ++line_indent;
 5806|  31.5k|                     ++look;
 5807|  31.5k|                  }
 5808|  51.8k|                  if (look != end && *look == '\t') {
  ------------------
  |  Branch (5808:23): [True: 51.1k, False: 648]
  |  Branch (5808:38): [True: 2.35k, False: 48.8k]
  ------------------
 5809|  2.35k|                     return false;
 5810|  2.35k|                  }
 5811|  49.4k|                  if (look == end || *look == '\n' || *look == '\r') {
  ------------------
  |  Branch (5811:23): [True: 648, False: 48.8k]
  |  Branch (5811:38): [True: 8.35k, False: 40.4k]
  |  Branch (5811:55): [True: 18.1k, False: 22.3k]
  ------------------
 5812|  27.1k|                     if (look != end) {
  ------------------
  |  Branch (5812:26): [True: 26.4k, False: 648]
  ------------------
 5813|  26.4k|                        yaml::skip_newline(look, end);
 5814|  26.4k|                        continue;
 5815|  26.4k|                     }
 5816|    648|                     return false;
 5817|  27.1k|                  }
 5818|  22.3k|                  if (*look == '#') {
  ------------------
  |  Branch (5818:23): [True: 10.9k, False: 11.3k]
  ------------------
 5819|  10.9k|                     yaml::skip_comment(look, end);
 5820|  10.9k|                     if (look != end && (*look == '\n' || *look == '\r')) {
  ------------------
  |  Branch (5820:26): [True: 10.5k, False: 446]
  |  Branch (5820:42): [True: 7.08k, False: 3.46k]
  |  Branch (5820:59): [True: 3.46k, False: 0]
  ------------------
 5821|  10.5k|                        yaml::skip_newline(look, end);
 5822|  10.5k|                        continue;
 5823|  10.5k|                     }
 5824|    446|                     return false;
 5825|  10.9k|                  }
 5826|       |
 5827|       |                  // If the next non-empty line is an implicit mapping entry,
 5828|       |                  // don't treat it as scalar continuation for auto-deduced
 5829|       |                  // booleans/nulls.
 5830|  11.3k|                  {
 5831|  11.3k|                     auto scan = look;
 5832|   442k|                     while (scan != end && *scan != '\n' && *scan != '\r') {
  ------------------
  |  Branch (5832:29): [True: 440k, False: 2.71k]
  |  Branch (5832:44): [True: 437k, False: 2.67k]
  |  Branch (5832:61): [True: 436k, False: 680]
  ------------------
 5833|   436k|                        if (*scan == ':') {
  ------------------
  |  Branch (5833:29): [True: 87.1k, False: 349k]
  ------------------
 5834|  87.1k|                           auto after_colon = scan + 1;
 5835|  87.1k|                           if (after_colon == end || *after_colon == ' ' || *after_colon == '\t' ||
  ------------------
  |  Branch (5835:32): [True: 258, False: 86.8k]
  |  Branch (5835:54): [True: 2.12k, False: 84.7k]
  |  Branch (5835:77): [True: 2.45k, False: 82.2k]
  ------------------
 5836|  82.2k|                               *after_colon == '\n' || *after_colon == '\r') {
  ------------------
  |  Branch (5836:32): [True: 114, False: 82.1k]
  |  Branch (5836:56): [True: 348, False: 81.8k]
  ------------------
 5837|  5.29k|                              return false;
 5838|  5.29k|                           }
 5839|  87.1k|                        }
 5840|   431k|                        ++scan;
 5841|   431k|                     }
 5842|  11.3k|                  }
 5843|       |
 5844|  6.06k|                  return line_indent > ctx.current_indent();
 5845|  11.3k|               }
 5846|  1.41k|               return false;
 5847|  16.2k|            };
_ZN3glz36try_parse_block_mapping_into_variantINSt3__17variantIJDndNS1_12basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEbNS1_6vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS6_ISD_EEEENSC_ISD_EEEEETnDaXtlNS_4optsELj10ELb1ELb0ELb0ELb1EEERSH_RNS_4yaml12yaml_contextERPKcSO_EEbOT1_OT2_OT3_T4_:
 5377|   729k|   {
 5378|   729k|      using counts = yaml_variant_type_count<Variant>;
 5379|       |      if constexpr (counts::n_object == 0) {
 5380|       |         return false;
 5381|       |      }
 5382|   729k|      else {
 5383|       |         // Quick check: if no viable mapping separator in the current span,
 5384|       |         // avoid expensive speculative parse.
 5385|   729k|         const bool could_be_mapping = [&] {
 5386|   729k|            if constexpr (yaml::check_flow_context(Opts)) {
 5387|   729k|               return line_could_be_flow_mapping(it, end);
 5388|   729k|            }
 5389|   729k|            else {
 5390|   729k|               return yaml::line_could_be_block_mapping(it, end);
 5391|   729k|            }
 5392|   729k|         }();
 5393|   729k|         if (!could_be_mapping) {
  ------------------
  |  Branch (5393:14): [True: 445k, False: 284k]
  ------------------
 5394|   445k|            return false;
 5395|   445k|         }
 5396|       |         // Full parse attempt - use a temporary context that inherits indent from parent
 5397|   284k|         auto temp_ctx = ctx.make_speculative();
 5398|   284k|         process_yaml_variant_alternatives<Variant, is_yaml_variant_object>::template op<Opts>(value, temp_ctx, it,
 5399|   284k|                                                                                               end);
 5400|   284k|         ctx.alias_expansion_budget = temp_ctx.alias_expansion_budget; // charged even if rejected
 5401|   284k|         ctx.key_expansion_budget = temp_ctx.key_expansion_budget;
 5402|   284k|         if (!bool(temp_ctx.error)) {
  ------------------
  |  Branch (5402:14): [True: 222k, False: 62.3k]
  ------------------
 5403|   222k|            ctx.anchors = std::move(temp_ctx.anchors);
 5404|   222k|            return true;
 5405|   222k|         }
 5406|       |         // The line matched "key: value" pattern but parsing failed.
 5407|       |         // This indicates malformed content (e.g., unclosed flow collection),
 5408|       |         // so propagate the error rather than silently falling back to string.
 5409|  62.3k|         ctx.error = temp_ctx.error;
 5410|  62.3k|         ctx.custom_error_message = temp_ctx.custom_error_message;
 5411|  62.3k|         return false;
 5412|   284k|      }
 5413|   729k|   }
_ZZN3glz36try_parse_block_mapping_into_variantINSt3__17variantIJDndNS1_12basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEbNS1_6vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS6_ISD_EEEENSC_ISD_EEEEETnDaXtlNS_4optsELj10ELb1ELb0ELb0ELb1EEERSH_RNS_4yaml12yaml_contextERPKcSO_EEbOT1_OT2_OT3_T4_ENKUlvE_clEv:
 5385|   729k|         const bool could_be_mapping = [&] {
 5386|       |            if constexpr (yaml::check_flow_context(Opts)) {
 5387|       |               return line_could_be_flow_mapping(it, end);
 5388|       |            }
 5389|   729k|            else {
 5390|   729k|               return yaml::line_could_be_block_mapping(it, end);
 5391|   729k|            }
 5392|   729k|         }();
_ZZN3glz4fromILj450ENS_17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES1_EEEEE2opITnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1EEERPKcRS5_TkNS_10is_contextERNS_4yaml12yaml_contextESA_EEvOT1_OT2_OT0_T3_ENKUlRS4_E_clESN_:
 4658|   159k|               auto parse_implicit_null = [&](val_t& val) -> bool {
 4659|       |                  if constexpr (nullable_like<std::remove_cvref_t<val_t>>) {
 4660|       |                     val = {};
 4661|       |                     return true;
 4662|       |                  }
 4663|   159k|                  else if constexpr (std::same_as<std::remove_cvref_t<val_t>, glz::generic>) {
 4664|   159k|                     val = glz::generic{};
 4665|   159k|                     return true;
 4666|       |                  }
 4667|       |                  else {
 4668|       |                     static constexpr std::string_view null_value{"null"};
 4669|       |                     auto null_it = null_value.data();
 4670|       |                     from<YAML, val_t>::template op<yaml::flow_context_on<Opts>()>(
 4671|       |                        val, ctx, null_it, null_value.data() + null_value.size());
 4672|       |                     return !bool(ctx.error);
 4673|       |                  }
 4674|   159k|               };
_ZN3glz4yaml24parse_block_mapping_loopITnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1EEENS0_12yaml_contextEPKcS5_ZNS_4fromILj450ENS_17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES7_EEEEE2opITnDaXtlS2_Lj450ELb0ELb0ELb1ELb1EEERS5_RSB_TkNS_10is_contextERS3_S5_EEvOT1_OT2_OT0_T3_EUlRT_RSL_SH_iE_EEvSQ_RSH_SJ_iOSN_:
 3633|   389k|      {
 3634|       |         // A tagged-variant custom alternative hands its body (at the variant's own column) to a
 3635|       |         // discover-mode reader. Honor the known indent it published so continuation/dedent are
 3636|       |         // judged against the outer parent, not the body itself. One-shot: reset on observation.
 3637|   389k|         if (ctx.forced_block_mapping_indent >= 0) {
  ------------------
  |  Branch (3637:14): [True: 0, False: 389k]
  ------------------
 3638|      0|            if (mapping_indent < 0) {
  ------------------
  |  Branch (3638:17): [True: 0, False: 0]
  ------------------
 3639|      0|               mapping_indent = ctx.forced_block_mapping_indent;
 3640|      0|            }
 3641|      0|            ctx.forced_block_mapping_indent = -1;
 3642|      0|         }
 3643|   389k|         const int32_t parent_indent = ctx.current_indent();
 3644|   389k|         const bool discover_indent = (mapping_indent < 0);
 3645|   389k|         bool first_key = !discover_indent;
 3646|   389k|         bool discovered_first_key_mid_line = false;
 3647|   389k|         int32_t discovered_first_key_visual_indent = 0;
 3648|       |
 3649|  1.00M|         while (it != end) {
  ------------------
  |  Branch (3649:17): [True: 808k, False: 201k]
  ------------------
 3650|   808k|            auto line_start = it;
 3651|   808k|            int32_t line_indent = first_key ? mapping_indent : 0;
  ------------------
  |  Branch (3651:35): [True: 0, False: 808k]
  ------------------
 3652|       |
 3653|       |            // Skip blank lines and comments, measure indent
 3654|   893k|            while (it != end) {
  ------------------
  |  Branch (3654:20): [True: 884k, False: 9.24k]
  ------------------
 3655|   884k|               if (*it == '#') {
  ------------------
  |  Branch (3655:20): [True: 14.7k, False: 869k]
  ------------------
 3656|  14.7k|                  skip_comment(it, end);
 3657|  14.7k|                  skip_newline(it, end);
 3658|  14.7k|                  first_key = false;
 3659|  14.7k|                  line_indent = 0;
 3660|  14.7k|               }
 3661|   869k|               else if (*it == '\n' || *it == '\r') {
  ------------------
  |  Branch (3661:25): [True: 13.7k, False: 855k]
  |  Branch (3661:40): [True: 45.7k, False: 810k]
  ------------------
 3662|  59.5k|                  skip_newline(it, end);
 3663|  59.5k|                  first_key = false;
 3664|  59.5k|                  line_indent = 0;
 3665|  59.5k|               }
 3666|   810k|               else if (*it == ' ') {
  ------------------
  |  Branch (3666:25): [True: 335k, False: 474k]
  ------------------
 3667|   335k|                  line_start = it;
 3668|   335k|                  line_indent = 0;
 3669|   869k|                  while (it != end && *it == ' ') {
  ------------------
  |  Branch (3669:26): [True: 868k, False: 1.46k]
  |  Branch (3669:39): [True: 533k, False: 334k]
  ------------------
 3670|   533k|                     ++line_indent;
 3671|   533k|                     ++it;
 3672|   533k|                  }
 3673|       |
 3674|   335k|                  bool saw_tab = false;
 3675|   338k|                  while (it != end && (*it == ' ' || *it == '\t')) {
  ------------------
  |  Branch (3675:26): [True: 336k, False: 1.48k]
  |  Branch (3675:40): [True: 915, False: 335k]
  |  Branch (3675:54): [True: 1.55k, False: 334k]
  ------------------
 3676|  2.47k|                     saw_tab = saw_tab || (*it == '\t');
  ------------------
  |  Branch (3676:32): [True: 1.56k, False: 903]
  |  Branch (3676:43): [True: 903, False: 0]
  ------------------
 3677|  2.47k|                     ++it;
 3678|  2.47k|                  }
 3679|       |
 3680|   335k|                  if (it == end || *it == '\n' || *it == '\r' || *it == '#') {
  ------------------
  |  Branch (3680:23): [True: 1.48k, False: 334k]
  |  Branch (3680:36): [True: 2.70k, False: 331k]
  |  Branch (3680:51): [True: 1.97k, False: 329k]
  |  Branch (3680:66): [True: 3.47k, False: 326k]
  ------------------
 3681|  9.63k|                     first_key = false;
 3682|  9.63k|                     line_indent = 0;
 3683|  9.63k|                     continue; // Blank or comment line
 3684|  9.63k|                  }
 3685|       |
 3686|   326k|                  if (saw_tab) {
  ------------------
  |  Branch (3686:23): [True: 47, False: 326k]
  ------------------
 3687|     47|                     ctx.error = error_code::syntax_error;
 3688|     47|                     return;
 3689|     47|                  }
 3690|       |
 3691|       |                  // Early dedent check
 3692|   326k|                  if (mapping_indent >= 0 && line_indent < mapping_indent) {
  ------------------
  |  Branch (3692:23): [True: 322k, False: 3.42k]
  |  Branch (3692:46): [True: 328, False: 322k]
  ------------------
 3693|    328|                     it = line_start;
 3694|    328|                     return;
 3695|    328|                  }
 3696|       |
 3697|   325k|                  first_key = false;
 3698|   325k|                  break; // Found content
 3699|   326k|               }
 3700|   474k|               else if (*it == '\t') {
  ------------------
  |  Branch (3700:25): [True: 1.55k, False: 472k]
  ------------------
 3701|  1.55k|                  line_start = it;
 3702|  6.19k|                  while (it != end && (*it == ' ' || *it == '\t')) ++it;
  ------------------
  |  Branch (3702:26): [True: 6.03k, False: 161]
  |  Branch (3702:40): [True: 1.09k, False: 4.94k]
  |  Branch (3702:54): [True: 3.55k, False: 1.39k]
  ------------------
 3703|  1.55k|                  if (it == end || *it == '\n' || *it == '\r' || *it == '#') {
  ------------------
  |  Branch (3703:23): [True: 161, False: 1.39k]
  |  Branch (3703:36): [True: 290, False: 1.10k]
  |  Branch (3703:51): [True: 568, False: 534]
  |  Branch (3703:66): [True: 483, False: 51]
  ------------------
 3704|  1.50k|                     first_key = false;
 3705|  1.50k|                     line_indent = 0;
 3706|  1.50k|                     continue; // Blank or comment-only line with tab indentation
 3707|  1.50k|                  }
 3708|     51|                  ctx.error = error_code::syntax_error;
 3709|     51|                  return;
 3710|  1.55k|               }
 3711|   472k|               else {
 3712|   472k|                  line_start = it;
 3713|   472k|                  break; // Content at column 0
 3714|   472k|               }
 3715|   884k|            }
 3716|       |
 3717|   807k|            if (it == end) break;
  ------------------
  |  Branch (3717:17): [True: 9.24k, False: 798k]
  ------------------
 3718|       |
 3719|       |            // Document boundaries terminate the current mapping in both discovered
 3720|       |            // and fixed-indent modes.
 3721|   798k|            if (at_document_end(it, end) || at_document_start(it, end)) break;
  ------------------
  |  Branch (3721:17): [True: 2.73k, False: 795k]
  |  Branch (3721:45): [True: 722, False: 795k]
  ------------------
 3722|       |
 3723|       |            // Dedent checks (skip on first key for struct case)
 3724|       |            // Must check BEFORE establishing mapping_indent so the first discovered key
 3725|       |            // isn't rejected by the parent_indent check (mapping_indent is still -1).
 3726|   795k|            if (!first_key) {
  ------------------
  |  Branch (3726:17): [True: 795k, False: 0]
  ------------------
 3727|       |               // Parent indent check for nested maps (only after mapping_indent established)
 3728|   795k|               if (discover_indent && mapping_indent >= 0 && parent_indent >= 0 && line_indent <= parent_indent) {
  ------------------
  |  Branch (3728:20): [True: 795k, False: 0]
  |  Branch (3728:39): [True: 406k, False: 389k]
  |  Branch (3728:62): [True: 212k, False: 193k]
  |  Branch (3728:84): [True: 152k, False: 60.1k]
  ------------------
 3729|   152k|                  it = line_start;
 3730|   152k|                  return;
 3731|   152k|               }
 3732|   643k|               if (mapping_indent >= 0 && line_indent < mapping_indent) {
  ------------------
  |  Branch (3732:20): [True: 254k, False: 389k]
  |  Branch (3732:43): [True: 28, False: 254k]
  ------------------
 3733|     28|                  it = line_start;
 3734|     28|                  return;
 3735|     28|               }
 3736|   643k|            }
 3737|       |
 3738|       |            // Establish mapping indent from first key (map case)
 3739|   643k|            bool established_mapping_indent_this_line = false;
 3740|   643k|            if (mapping_indent < 0) {
  ------------------
  |  Branch (3740:17): [True: 389k, False: 254k]
  ------------------
 3741|   389k|               mapping_indent = line_indent;
 3742|   389k|               established_mapping_indent_this_line = true;
 3743|   389k|               discovered_first_key_visual_indent = line_indent;
 3744|   389k|               if constexpr (std::is_pointer_v<std::decay_t<It>>) {
 3745|   389k|                  if (ctx.stream_begin && line_start > ctx.stream_begin) {
  ------------------
  |  Branch (3745:23): [True: 389k, False: 0]
  |  Branch (3745:43): [True: 385k, False: 3.94k]
  ------------------
 3746|   385k|                     const auto prefix = ctx.line_prefix_before(line_start);
 3747|   385k|                     if (prefix.has_tab) {
  ------------------
  |  Branch (3747:26): [True: 266, False: 384k]
  ------------------
 3748|    266|                        ctx.error = error_code::syntax_error;
 3749|    266|                        return;
 3750|    266|                     }
 3751|       |
 3752|   384k|                     discovered_first_key_mid_line = prefix.has_content;
 3753|   384k|                     if (mapping_indent == 0 && prefix.column > 0) {
  ------------------
  |  Branch (3753:26): [True: 381k, False: 3.42k]
  |  Branch (3753:49): [True: 309k, False: 71.5k]
  ------------------
 3754|   309k|                        discovered_first_key_visual_indent = prefix.column;
 3755|   309k|                     }
 3756|   384k|                  }
 3757|   389k|               }
 3758|   389k|            }
 3759|       |
 3760|       |            // In discovered-indent block mappings, sibling keys must stay at the same
 3761|       |            // indent level, except when the first key started mid-line (e.g. "--- k: v").
 3762|   643k|            if (discover_indent && mapping_indent >= 0 && !established_mapping_indent_this_line &&
  ------------------
  |  Branch (3762:17): [True: 642k, False: 266]
  |  Branch (3762:36): [True: 642k, False: 0]
  |  Branch (3762:59): [True: 254k, False: 388k]
  ------------------
 3763|   254k|                !discovered_first_key_mid_line) {
  ------------------
  |  Branch (3763:17): [True: 58.0k, False: 195k]
  ------------------
 3764|  58.0k|               if (mapping_indent == 0 && discovered_first_key_visual_indent > 0) {
  ------------------
  |  Branch (3764:20): [True: 57.7k, False: 318]
  |  Branch (3764:43): [True: 38.8k, False: 18.9k]
  ------------------
 3765|  38.8k|                  if (line_indent > discovered_first_key_visual_indent) {
  ------------------
  |  Branch (3765:23): [True: 49, False: 38.7k]
  ------------------
 3766|     49|                     ctx.error = error_code::syntax_error;
 3767|     49|                     return;
 3768|     49|                  }
 3769|  38.7k|                  if (line_indent < discovered_first_key_visual_indent) {
  ------------------
  |  Branch (3769:23): [True: 990, False: 37.7k]
  ------------------
 3770|    990|                     it = line_start;
 3771|    990|                     return;
 3772|    990|                  }
 3773|  38.7k|               }
 3774|  19.2k|               else if (line_indent > mapping_indent &&
  ------------------
  |  Branch (3774:25): [True: 1.15k, False: 18.0k]
  ------------------
 3775|  1.15k|                        (parent_indent < 0 || mapping_indent > 0 ||
  ------------------
  |  Branch (3775:26): [True: 177, False: 973]
  |  Branch (3775:47): [True: 1, False: 972]
  ------------------
 3776|    972|                         (parent_indent >= 0 && mapping_indent == 0 && line_indent > (parent_indent + 1)))) {
  ------------------
  |  Branch (3776:27): [True: 972, False: 0]
  |  Branch (3776:49): [True: 972, False: 0]
  |  Branch (3776:72): [True: 6, False: 966]
  ------------------
 3777|    184|                  ctx.error = error_code::syntax_error;
 3778|    184|                  return;
 3779|    184|               }
 3780|  58.0k|            }
 3781|       |
 3782|       |            // Sequence indicator check (struct case only - map parser lets key parsing
 3783|       |            // handle '- ' which produces appropriate errors for misindented items)
 3784|   641k|            if (!discover_indent && *it == '-' &&
  ------------------
  |  Branch (3784:17): [True: 0, False: 641k]
  |  Branch (3784:37): [True: 0, False: 0]
  ------------------
 3785|      0|                ((it + 1) == end || *(it + 1) == ' ' || *(it + 1) == '\t' || *(it + 1) == '\n')) {
  ------------------
  |  Branch (3785:18): [True: 0, False: 0]
  |  Branch (3785:37): [True: 0, False: 0]
  |  Branch (3785:57): [True: 0, False: 0]
  |  Branch (3785:78): [True: 0, False: 0]
  ------------------
 3786|      0|               it = line_start;
 3787|      0|               return;
 3788|      0|            }
 3789|       |
 3790|       |            // Skip indented comment lines
 3791|   641k|            if (*it == '#') {
  ------------------
  |  Branch (3791:17): [True: 0, False: 641k]
  ------------------
 3792|      0|               skip_comment(it, end);
 3793|      0|               first_key = false;
 3794|      0|               continue;
 3795|      0|            }
 3796|       |
 3797|       |            // Skip blank/empty lines after indent
 3798|   641k|            if (*it == '\n' || *it == '\r') {
  ------------------
  |  Branch (3798:17): [True: 266, False: 641k]
  |  Branch (3798:32): [True: 0, False: 641k]
  ------------------
 3799|      0|               first_key = false;
 3800|      0|               continue;
 3801|      0|            }
 3802|       |
 3803|       |            // While parsing an explicit mapping key node ('? key-node'),
 3804|       |            // a subsequent standalone ':' at the same indentation starts
 3805|       |            // the outer value indicator and must terminate this key-node map.
 3806|       |            // Keep same-line ': x' on the first key-node line valid.
 3807|   641k|            if (ctx.explicit_mapping_key_context && !established_mapping_indent_this_line && *it == ':') {
  ------------------
  |  Branch (3807:17): [True: 281k, False: 360k]
  |  Branch (3807:53): [True: 87.6k, False: 194k]
  |  Branch (3807:94): [True: 22.2k, False: 65.3k]
  ------------------
 3808|  22.2k|               const auto after_colon = it + 1;
 3809|  22.2k|               const int32_t explicit_value_indicator_indent = (parent_indent < 0) ? 0 : (parent_indent + 1);
  ------------------
  |  Branch (3809:64): [True: 18.6k, False: 3.55k]
  ------------------
 3810|  22.2k|               if ((after_colon == end || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*after_colon)]) &&
  ------------------
  |  Branch (3810:21): [True: 23, False: 22.2k]
  |  Branch (3810:43): [True: 17.5k, False: 4.70k]
  ------------------
 3811|  17.5k|                   line_indent == explicit_value_indicator_indent) {
  ------------------
  |  Branch (3811:20): [True: 372, False: 17.1k]
  ------------------
 3812|    372|                  it = line_start;
 3813|    372|                  return;
 3814|    372|               }
 3815|  22.2k|            }
 3816|       |
 3817|       |            // Process this mapping entry (key + colon + value)
 3818|   641k|            int32_t effective_line_indent = line_indent;
 3819|   641k|            if (discover_indent && established_mapping_indent_this_line &&
  ------------------
  |  Branch (3819:17): [True: 641k, False: 266]
  |  Branch (3819:36): [True: 388k, False: 252k]
  ------------------
 3820|   388k|                discovered_first_key_visual_indent > effective_line_indent &&
  ------------------
  |  Branch (3820:17): [True: 309k, False: 78.9k]
  ------------------
 3821|   309k|                !(discovered_first_key_mid_line && parent_indent < 0)) {
  ------------------
  |  Branch (3821:19): [True: 282k, False: 26.9k]
  |  Branch (3821:52): [True: 15.5k, False: 267k]
  ------------------
 3822|       |               // The first discovered key has no indentation of its own left to measure: it may
 3823|       |               // begin mid-line (a sequence entry's "- key: value"), or the caller may have already
 3824|       |               // consumed the line's indentation before handing the mapping over. Pass its visual
 3825|       |               // column so the entry judges its value against the key's real indent -- otherwise a
 3826|       |               // key with an empty value takes the following sibling line for nested content
 3827|       |               // (issue #2827) and same-line block scalars compute the wrong indentation.
 3828|       |               // The exception is a ROOT mapping whose first key begins mid-line, which means node
 3829|       |               // properties sit ahead of it (`!!str &a1 "foo":`): those belong to the document node
 3830|       |               // rather than to the key's column, so the measured indent stands. Conformance tests
 3831|       |               // 7FWL and HMQ5 pin that case.
 3832|   294k|               effective_line_indent = discovered_first_key_visual_indent;
 3833|   294k|            }
 3834|       |
 3835|   641k|            if (!process_entry(ctx, it, end, effective_line_indent)) {
  ------------------
  |  Branch (3835:17): [True: 21.8k, False: 619k]
  ------------------
 3836|  21.8k|               return;
 3837|  21.8k|            }
 3838|   619k|            first_key = false;
 3839|       |
 3840|   619k|            if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (3840:17): [True: 0, False: 619k]
  ------------------
 3841|      0|               return;
 3842|       |
 3843|       |            if constexpr (yaml::check_flow_context(Opts)) {
 3844|       |               // In flow context, an implicit "key: value" pair used as a sequence entry
 3845|       |               // ends at ',', ']', or '}'. Let the enclosing flow parser consume it.
 3846|       |               auto flow_end = it;
 3847|       |               skip_flow_ws_and_newlines(ctx, flow_end, end);
 3848|       |               if (bool(ctx.error)) [[unlikely]]
 3849|       |                  return;
 3850|       |               if (flow_end != end && (*flow_end == ',' || *flow_end == ']' || *flow_end == '}')) {
 3851|       |                  it = flow_end;
 3852|       |                  return;
 3853|       |               }
 3854|       |            }
 3855|       |
 3856|       |            // Trailing whitespace handling (peek-ahead pattern).
 3857|       |            // After parsing, iterator may be at leading indent of next line.
 3858|       |            // Don't consume it - let the outer loop handle indent measurement.
 3859|   619k|            if (it != end) {
  ------------------
  |  Branch (3859:17): [True: 469k, False: 150k]
  ------------------
 3860|   469k|               if (*it == ' ' || *it == '\t') {
  ------------------
  |  Branch (3860:20): [True: 279k, False: 190k]
  |  Branch (3860:34): [True: 4.36k, False: 185k]
  ------------------
 3861|   283k|                  auto peek = it;
 3862|   283k|                  skip_inline_ws(peek, end);
 3863|   283k|                  if (peek != end && *peek != '\n' && *peek != '\r' && *peek != '#') {
  ------------------
  |  Branch (3863:23): [True: 282k, False: 715]
  |  Branch (3863:38): [True: 280k, False: 1.82k]
  |  Branch (3863:55): [True: 279k, False: 1.37k]
  |  Branch (3863:72): [True: 274k, False: 4.56k]
  ------------------
 3864|   274k|                     continue; // At leading indent of new line
 3865|   274k|                  }
 3866|   283k|               }
 3867|   194k|               skip_inline_ws(it, end);
 3868|   194k|               if (it != end && *it == '#') {
  ------------------
  |  Branch (3868:20): [True: 193k, False: 715]
  |  Branch (3868:33): [True: 16.2k, False: 177k]
  ------------------
 3869|  16.2k|                  if constexpr (std::is_pointer_v<std::decay_t<It>>) {
 3870|  16.2k|                     if (it > line_start) {
  ------------------
  |  Branch (3870:26): [True: 16.2k, False: 0]
  ------------------
 3871|  16.2k|                        const char prev = *(it - 1);
 3872|  16.2k|                        if (prev != ' ' && prev != '\t' && prev != '\n' && prev != '\r') {
  ------------------
  |  Branch (3872:29): [True: 5.81k, False: 10.4k]
  |  Branch (3872:44): [True: 1.60k, False: 4.20k]
  |  Branch (3872:60): [True: 849, False: 759]
  |  Branch (3872:76): [True: 16, False: 833]
  ------------------
 3873|     16|                           ctx.error = error_code::syntax_error;
 3874|     16|                           return;
 3875|     16|                        }
 3876|  16.2k|                     }
 3877|  16.2k|                  }
 3878|  16.2k|               }
 3879|  16.2k|               skip_comment(it, end);
 3880|   194k|               if (it != end && (*it == '\n' || *it == '\r')) {
  ------------------
  |  Branch (3880:20): [True: 193k, False: 1.24k]
  |  Branch (3880:34): [True: 67.6k, False: 125k]
  |  Branch (3880:49): [True: 74.9k, False: 50.4k]
  ------------------
 3881|   142k|                  skip_newline(it, end);
 3882|   142k|               }
 3883|  51.6k|               else if (it != end) {
  ------------------
  |  Branch (3883:25): [True: 50.4k, False: 1.24k]
  ------------------
 3884|       |                  // The entry stopped part way along its line with something other than
 3885|       |                  // whitespace or a comment after it -- a ':' its value could not take as a
 3886|       |                  // separator, say. The next pass measures indent as though this were the start
 3887|       |                  // of a line, so what is left of the real one is lost; reject it instead.
 3888|  50.4k|                  if constexpr (requires { ctx.line_prefix_before(it); }) {
 3889|  50.4k|                     if (ctx.line_prefix_before(it).has_content) {
  ------------------
  |  Branch (3889:26): [True: 478, False: 49.9k]
  ------------------
 3890|    478|                        ctx.error = error_code::syntax_error;
 3891|    478|                        return;
 3892|    478|                     }
 3893|  50.4k|                  }
 3894|  50.4k|               }
 3895|   194k|            }
 3896|   619k|         }
 3897|   389k|      }
_ZZN3glz4fromILj450ENS_17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES1_EEEEE2opITnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1EEERPKcRS5_TkNS_10is_contextERNS_4yaml12yaml_contextESA_EEvOT1_OT2_OT0_T3_ENKUlRT_RSK_SG_iE_clISE_SA_SA_EEbSO_SP_SG_i:
 4777|   641k|               ctx, it, end, int32_t(-1), [&](auto& ctx, auto& it, auto end, int32_t line_indent) -> bool {
 4778|   641k|                  auto parse_map_value = [&](val_t& val) -> bool {
 4779|   641k|                     if (it != end && !yaml::line_end_or_comment_table[static_cast<uint8_t>(*it)]) {
 4780|   641k|                        bool line_starts_with_explicit_value_indicator = false;
 4781|       |
 4782|       |                        // Inline mapping values in block context cannot start with a
 4783|       |                        // plain "key: value" pair on the same line (e.g. "a: b: c").
 4784|       |                        // Such constructs are malformed unless wrapped in flow
 4785|       |                        // delimiters ({...} / [...]) or quoted.
 4786|   641k|                        if constexpr (std::is_pointer_v<std::decay_t<decltype(it)>>) {
 4787|   641k|                           if (ctx.stream_begin) {
 4788|   641k|                              auto is_line_content_start = [&](auto pos) {
 4789|   641k|                                 return !ctx.line_prefix_before(pos).has_content;
 4790|   641k|                              };
 4791|       |
 4792|   641k|                              auto line_has_explicit_value_indicator = [&](auto pos) {
 4793|   641k|                                 const char* line = ctx.line_begin_of(pos);
 4794|   641k|                                 while (line != end && (*line == ' ' || *line == '\t')) ++line;
 4795|   641k|                                 return line != end && *line == ':';
 4796|   641k|                              };
 4797|       |
 4798|   641k|                              if (!is_line_content_start(it) &&
 4799|   641k|                                  yaml::inline_value_has_plain_mapping_indicator(it, end) &&
 4800|   641k|                                  !line_has_explicit_value_indicator(it)) {
 4801|   641k|                                 ctx.error = error_code::syntax_error;
 4802|   641k|                                 return false;
 4803|   641k|                              }
 4804|   641k|                              line_starts_with_explicit_value_indicator = line_has_explicit_value_indicator(it);
 4805|   641k|                           }
 4806|   641k|                        }
 4807|       |
 4808|   641k|                        if (*it == '-' &&
 4809|   641k|                            ((it + 1) == end || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*(it + 1))]) &&
 4810|   641k|                            !line_starts_with_explicit_value_indicator) {
 4811|       |                           // "key: - item" is not valid block sequence syntax.
 4812|   641k|                           ctx.error = error_code::syntax_error;
 4813|   641k|                           return false;
 4814|   641k|                        }
 4815|       |
 4816|   641k|                        if (!ctx.push_indent(line_indent + 1)) [[unlikely]]
 4817|   641k|                           return false;
 4818|   641k|                        from<YAML, val_t>::template op<Opts>(val, ctx, it, end);
 4819|   641k|                        ctx.pop_indent();
 4820|   641k|                     }
 4821|   641k|                     else {
 4822|   641k|                        int32_t nested_indent = yaml::detect_nested_value_indent(ctx, it, end, line_indent);
 4823|   641k|                        if (nested_indent >= 0) {
 4824|   641k|                           yaml::skip_to_content(it, end);
 4825|   641k|                           if (it != end && *it == ':' && (it + 1) != end && *(it + 1) == '\t') {
 4826|   641k|                              ctx.error = error_code::syntax_error;
 4827|   641k|                              return false;
 4828|   641k|                           }
 4829|       |                           // A struct value reads the pushed indent as its own key column;
 4830|       |                           // every other value type reads it as the enclosing baseline.
 4831|   641k|                           const int32_t value_indent =
 4832|   641k|                              yaml::receives_block_mapping_column<val_t>() ? nested_indent : nested_indent - 1;
 4833|   641k|                           if (!ctx.push_indent(value_indent)) [[unlikely]]
 4834|   641k|                              return false;
 4835|   641k|                           from<YAML, val_t>::template op<Opts>(val, ctx, it, end);
 4836|   641k|                           ctx.pop_indent();
 4837|   641k|                        }
 4838|   641k|                     }
 4839|   641k|                     return !bool(ctx.error);
 4840|   641k|                  };
 4841|       |
 4842|       |                  // Explicit key entry form:
 4843|       |                  // ? key
 4844|       |                  // : value
 4845|   641k|                  if (*it == '?' && ((it + 1) != end) && *(it + 1) == '\t') {
  ------------------
  |  Branch (4845:23): [True: 182k, False: 458k]
  |  Branch (4845:37): [True: 182k, False: 315]
  |  Branch (4845:58): [True: 7, False: 182k]
  ------------------
 4846|      7|                     ctx.error = error_code::syntax_error;
 4847|      7|                     return false;
 4848|      7|                  }
 4849|   641k|                  if (*it == '?' && ((it + 1) == end || *(it + 1) == ' ' || *(it + 1) == '\n' || *(it + 1) == '\r')) {
  ------------------
  |  Branch (4849:23): [True: 182k, False: 458k]
  |  Branch (4849:38): [True: 315, False: 182k]
  |  Branch (4849:57): [True: 63.4k, False: 118k]
  |  Branch (4849:77): [True: 107k, False: 10.9k]
  |  Branch (4849:98): [True: 5.43k, False: 5.49k]
  ------------------
 4850|   176k|                     ++it; // skip '?'
 4851|   176k|                     yaml::skip_inline_ws(it, end);
 4852|       |
 4853|   176k|                     const int32_t explicit_value_indicator_indent =
 4854|   176k|                        (ctx.current_indent() < 0) ? 0 : (ctx.current_indent() + 1);
  ------------------
  |  Branch (4854:25): [True: 47.7k, False: 129k]
  ------------------
 4855|       |
 4856|   176k|                     key_t key{};
 4857|   176k|                     if constexpr (std::same_as<std::remove_cvref_t<key_t>, std::string>) {
 4858|   176k|                        auto to_string_key = [&](glz::generic& key_node) {
 4859|   176k|                           return yaml::materialize_key(key, key_node, ctx);
 4860|   176k|                        };
 4861|       |
 4862|   176k|                        auto key_it = it;
 4863|   176k|                        yaml::skip_inline_ws(key_it, end);
 4864|       |
 4865|   176k|                        auto content = key_it;
 4866|   176k|                        yaml::skip_to_content(content, end);
 4867|   176k|                        bool handled_anchor_only_empty_key = false;
 4868|       |
 4869|       |                        // Anchor on an empty explicit key node:
 4870|       |                        //   ? &a
 4871|       |                        //   : value
 4872|   176k|                        if (content != end && *content == '&') {
  ------------------
  |  Branch (4872:29): [True: 175k, False: 1.70k]
  |  Branch (4872:47): [True: 50.8k, False: 124k]
  ------------------
 4873|  50.8k|                           auto anchor_probe = content + 1;
 4874|  50.8k|                           auto anchor_name = yaml::parse_anchor_name(anchor_probe, end);
 4875|  50.8k|                           if (!anchor_name.empty()) {
  ------------------
  |  Branch (4875:32): [True: 50.8k, False: 17]
  ------------------
 4876|  50.8k|                              auto after_anchor = anchor_probe;
 4877|  50.8k|                              yaml::skip_inline_ws(after_anchor, end);
 4878|       |
 4879|  50.8k|                              auto value_indicator = after_anchor;
 4880|  50.8k|                              if (value_indicator != end && *value_indicator == ':') {
  ------------------
  |  Branch (4880:35): [True: 48.9k, False: 1.87k]
  |  Branch (4880:61): [True: 2.57k, False: 46.3k]
  ------------------
 4881|  2.57k|                                 key.clear();
 4882|  2.57k|                                 ctx.anchors[std::string(anchor_name)] = {content, content, ctx.current_indent()};
 4883|  2.57k|                                 it = value_indicator;
 4884|  2.57k|                                 handled_anchor_only_empty_key = true;
 4885|  2.57k|                              }
 4886|  48.2k|                              else {
 4887|  48.2k|                                 if (value_indicator != end && *value_indicator == '#') {
  ------------------
  |  Branch (4887:38): [True: 46.3k, False: 1.87k]
  |  Branch (4887:64): [True: 1.53k, False: 44.8k]
  ------------------
 4888|  1.53k|                                    yaml::skip_comment(value_indicator, end);
 4889|  1.53k|                                 }
 4890|  48.2k|                                 if (value_indicator != end && (*value_indicator == '\n' || *value_indicator == '\r')) {
  ------------------
  |  Branch (4890:38): [True: 46.3k, False: 1.88k]
  |  Branch (4890:65): [True: 4.38k, False: 41.9k]
  |  Branch (4890:93): [True: 7.62k, False: 34.3k]
  ------------------
 4891|  12.0k|                                    yaml::skip_newline(value_indicator, end);
 4892|  12.0k|                                    auto value_line = value_indicator;
 4893|  12.0k|                                    int32_t value_indent = yaml::measure_indent(value_line, end, ctx);
 4894|  12.0k|                                    if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4894:41): [True: 1, False: 12.0k]
  ------------------
 4895|      1|                                       return false;
 4896|  12.0k|                                    if (value_line != end && *value_line == ':' &&
  ------------------
  |  Branch (4896:41): [True: 10.3k, False: 1.64k]
  |  Branch (4896:62): [True: 1.09k, False: 9.27k]
  ------------------
 4897|  1.09k|                                        value_indent == explicit_value_indicator_indent) {
  ------------------
  |  Branch (4897:41): [True: 1.08k, False: 12]
  ------------------
 4898|  1.08k|                                       key.clear();
 4899|  1.08k|                                       ctx.anchors[std::string(anchor_name)] = {content, content, ctx.current_indent()};
 4900|  1.08k|                                       it = value_line;
 4901|  1.08k|                                       handled_anchor_only_empty_key = true;
 4902|  1.08k|                                    }
 4903|  10.9k|                                    else if (value_line != end && *value_line == ':') {
  ------------------
  |  Branch (4903:46): [True: 9.28k, False: 1.64k]
  |  Branch (4903:67): [True: 12, False: 9.27k]
  ------------------
 4904|       |                                       // In explicit-key form ("? &a"), a following ':'
 4905|       |                                       // starts the outer value indicator only at the same
 4906|       |                                       // indentation. A deeper-indented ': value' is malformed.
 4907|     12|                                       ctx.error = error_code::syntax_error;
 4908|     12|                                       return false;
 4909|     12|                                    }
 4910|  12.0k|                                 }
 4911|  48.2k|                              }
 4912|  50.8k|                           }
 4913|  50.8k|                        }
 4914|       |
 4915|   176k|                        const bool key_content_spans_lines = [&] {
 4916|   176k|                           auto scan = key_it;
 4917|   176k|                           while (scan != content && scan != end) {
 4918|   176k|                              if (*scan == '\n' || *scan == '\r') return true;
 4919|   176k|                              ++scan;
 4920|   176k|                           }
 4921|   176k|                           return false;
 4922|   176k|                        }();
 4923|       |
 4924|   176k|                        if (handled_anchor_only_empty_key) {
  ------------------
  |  Branch (4924:29): [True: 3.66k, False: 173k]
  ------------------
 4925|       |                           // 'it' already points to the explicit value indicator ':'
 4926|  3.66k|                        }
 4927|   173k|                        else if (content == end || (*content == ':' && key_content_spans_lines)) {
  ------------------
  |  Branch (4927:34): [True: 1.70k, False: 171k]
  |  Branch (4927:53): [True: 4.75k, False: 166k]
  |  Branch (4927:72): [True: 2.51k, False: 2.23k]
  ------------------
 4928|  4.22k|                           key.clear();
 4929|  4.22k|                           it = content;
 4930|  4.22k|                        }
 4931|   169k|                        else {
 4932|       |                           // Explicit mapping keys ('? key-node') are full YAML nodes.
 4933|       |                           // Parse the key node structurally (not via plain-key scanning)
 4934|       |                           // so inputs like '? []: x' and '? JSON: like' are interpreted
 4935|       |                           // as complex keys, not split into implicit key/value pairs.
 4936|   169k|                           auto key_node_it = content;
 4937|   169k|                           auto key_node_end = end;
 4938|   169k|                           if constexpr (std::is_pointer_v<std::decay_t<It>>) {
 4939|       |                              // In explicit-key form, a following standalone ':'
 4940|       |                              // line (same or lower indentation) belongs to the
 4941|       |                              // outer mapping value, not the key node itself.
 4942|   169k|                              auto scan = content;
 4943|  3.28M|                              while (scan != end) {
  ------------------
  |  Branch (4943:38): [True: 3.19M, False: 92.2k]
  ------------------
 4944|   237M|                                 while (scan != end && *scan != '\n' && *scan != '\r') {
  ------------------
  |  Branch (4944:41): [True: 237M, False: 31.5k]
  |  Branch (4944:56): [True: 235M, False: 1.77M]
  |  Branch (4944:73): [True: 234M, False: 1.38M]
  ------------------
 4945|   234M|                                    ++scan;
 4946|   234M|                                 }
 4947|  3.19M|                                 if (scan == end) {
  ------------------
  |  Branch (4947:38): [True: 31.5k, False: 3.16M]
  ------------------
 4948|  31.5k|                                    break;
 4949|  31.5k|                                 }
 4950|       |
 4951|  3.16M|                                 yaml::skip_newline(scan, end);
 4952|  3.16M|                                 auto line_start = scan;
 4953|       |
 4954|  3.16M|                                 int32_t indicator_indent = 0;
 4955|  4.29M|                                 while (scan != end && *scan == ' ') {
  ------------------
  |  Branch (4955:41): [True: 4.20M, False: 92.2k]
  |  Branch (4955:56): [True: 1.13M, False: 3.07M]
  ------------------
 4956|  1.13M|                                    ++indicator_indent;
 4957|  1.13M|                                    ++scan;
 4958|  1.13M|                                 }
 4959|       |
 4960|  3.16M|                                 if (scan != end && *scan == ':') {
  ------------------
  |  Branch (4960:38): [True: 3.07M, False: 92.2k]
  |  Branch (4960:53): [True: 524k, False: 2.54M]
  ------------------
 4961|   524k|                                    const auto after_colon = scan + 1;
 4962|   524k|                                    if ((after_colon == end ||
  ------------------
  |  Branch (4962:42): [True: 756, False: 524k]
  ------------------
 4963|   524k|                                         yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*after_colon)]) &&
  ------------------
  |  Branch (4963:42): [True: 355k, False: 168k]
  ------------------
 4964|   356k|                                        indicator_indent <= line_indent) {
  ------------------
  |  Branch (4964:41): [True: 45.2k, False: 311k]
  ------------------
 4965|  45.2k|                                       key_node_end = line_start;
 4966|  45.2k|                                       break;
 4967|  45.2k|                                    }
 4968|   524k|                                 }
 4969|  3.16M|                              }
 4970|   169k|                           }
 4971|       |
 4972|   169k|                           glz::generic key_node{};
 4973|   169k|                           const bool prev_explicit_mapping_key_context = ctx.explicit_mapping_key_context;
 4974|   169k|                           ctx.explicit_mapping_key_context = true;
 4975|   169k|                           from<YAML, glz::generic>::template op<Opts>(key_node, ctx, key_node_it, key_node_end);
 4976|   169k|                           ctx.explicit_mapping_key_context = prev_explicit_mapping_key_context;
 4977|   169k|                           if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4977:32): [True: 3.58k, False: 165k]
  ------------------
 4978|  3.58k|                              return false;
 4979|   165k|                           it = key_node_it;
 4980|   165k|                           if (!to_string_key(key_node)) [[unlikely]]
  ------------------
  |  Branch (4980:32): [True: 50, False: 165k]
  ------------------
 4981|     50|                              return false;
 4982|   165k|                        }
 4983|       |                     }
 4984|       |                     else {
 4985|       |                        if (it != end && !yaml::line_end_or_comment_table[static_cast<uint8_t>(*it)]) {
 4986|       |                           from<YAML, key_t>::template op<Opts>(key, ctx, it, end);
 4987|       |                           if (bool(ctx.error)) [[unlikely]]
 4988|       |                              return false;
 4989|       |                        }
 4990|       |                     }
 4991|       |
 4992|   173k|                     yaml::skip_inline_ws(it, end);
 4993|   176k|                     yaml::skip_comment(it, end);
 4994|       |
 4995|       |                     // Value indicator may appear on the next line at the same indent.
 4996|   176k|                     if (it != end && (*it == '\n' || *it == '\r')) {
  ------------------
  |  Branch (4996:26): [True: 123k, False: 53.1k]
  |  Branch (4996:40): [True: 15.5k, False: 108k]
  |  Branch (4996:55): [True: 43.3k, False: 64.8k]
  ------------------
 4997|  58.9k|                        auto probe = it;
 4998|  58.9k|                        bool found_value_indicator = false;
 4999|       |
 5000|   128k|                        while (probe != end && (*probe == '\n' || *probe == '\r')) {
  ------------------
  |  Branch (5000:32): [True: 89.1k, False: 38.8k]
  |  Branch (5000:49): [True: 20.6k, False: 68.5k]
  |  Branch (5000:67): [True: 68.5k, False: 0]
  ------------------
 5001|  89.1k|                           yaml::skip_newline(probe, end);
 5002|       |
 5003|  89.1k|                           auto value_line = probe;
 5004|  89.1k|                           int32_t value_indent = yaml::measure_indent(value_line, end, ctx);
 5005|  89.1k|                           if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (5005:32): [True: 12, False: 89.1k]
  ------------------
 5006|     12|                              return false;
 5007|       |
 5008|  89.1k|                           if (value_line == end || *value_line == '\n' || *value_line == '\r') {
  ------------------
  |  Branch (5008:32): [True: 38.8k, False: 50.3k]
  |  Branch (5008:53): [True: 2.57k, False: 47.7k]
  |  Branch (5008:76): [True: 24.3k, False: 23.3k]
  ------------------
 5009|  65.8k|                              probe = value_line;
 5010|  65.8k|                              continue; // blank line
 5011|  65.8k|                           }
 5012|  23.3k|                           if (*value_line == '#') {
  ------------------
  |  Branch (5012:32): [True: 3.33k, False: 20.0k]
  ------------------
 5013|  3.33k|                              yaml::skip_comment(value_line, end);
 5014|  3.33k|                              probe = value_line;
 5015|  3.33k|                              continue; // comment-only line
 5016|  3.33k|                           }
 5017|  20.0k|                           if (*value_line == ':' && value_indent == explicit_value_indicator_indent) {
  ------------------
  |  Branch (5017:32): [True: 5.64k, False: 14.3k]
  |  Branch (5017:54): [True: 1.13k, False: 4.51k]
  ------------------
 5018|  1.13k|                              it = value_line;
 5019|  1.13k|                              found_value_indicator = true;
 5020|  1.13k|                           }
 5021|  20.0k|                           break;
 5022|  23.3k|                        }
 5023|       |
 5024|  58.9k|                        if (found_value_indicator) {
  ------------------
  |  Branch (5024:29): [True: 1.13k, False: 57.7k]
  ------------------
 5025|  1.13k|                           yaml::skip_inline_ws(it, end);
 5026|  1.13k|                        }
 5027|  58.9k|                     }
 5028|       |
 5029|   176k|                     val_t val{};
 5030|   176k|                     if (it != end && *it == ':') {
  ------------------
  |  Branch (5030:26): [True: 123k, False: 53.1k]
  |  Branch (5030:39): [True: 56.7k, False: 67.0k]
  ------------------
 5031|  56.7k|                        ++it;
 5032|  56.7k|                        if (it != end && *it == '\t') {
  ------------------
  |  Branch (5032:29): [True: 55.8k, False: 915]
  |  Branch (5032:42): [True: 4, False: 55.8k]
  ------------------
 5033|      4|                           ctx.error = error_code::syntax_error;
 5034|      4|                           return false;
 5035|      4|                        }
 5036|  56.7k|                        if (it != end && (*it == '\n' || *it == '\r')) {
  ------------------
  |  Branch (5036:29): [True: 55.8k, False: 915]
  |  Branch (5036:43): [True: 1.26k, False: 54.5k]
  |  Branch (5036:58): [True: 6.46k, False: 48.0k]
  ------------------
 5037|  7.73k|                           auto probe = it;
 5038|  7.73k|                           yaml::skip_newline(probe, end);
 5039|  15.7k|                           while (probe != end && *probe == ' ') ++probe;
  ------------------
  |  Branch (5039:35): [True: 13.9k, False: 1.76k]
  |  Branch (5039:51): [True: 8.01k, False: 5.97k]
  ------------------
 5040|  7.73k|                           if (probe != end && *probe == ':' && ((probe + 1) != end) && *(probe + 1) == '\t') {
  ------------------
  |  Branch (5040:32): [True: 5.97k, False: 1.76k]
  |  Branch (5040:48): [True: 1.41k, False: 4.56k]
  |  Branch (5040:65): [True: 1.40k, False: 8]
  |  Branch (5040:89): [True: 2, False: 1.40k]
  ------------------
 5041|      2|                              ctx.error = error_code::syntax_error;
 5042|      2|                              return false;
 5043|      2|                           }
 5044|  7.73k|                        }
 5045|  56.7k|                        yaml::skip_inline_ws(it, end);
 5046|  56.7k|                        if (!parse_map_value(val)) [[unlikely]]
  ------------------
  |  Branch (5046:29): [True: 424, False: 56.2k]
  ------------------
 5047|    424|                           return false;
 5048|  56.7k|                     }
 5049|       |
 5050|   176k|                     value.emplace(std::move(key), std::move(val));
 5051|   176k|                     return true;
 5052|   176k|                  }
 5053|       |
 5054|   464k|                  key_t key{};
 5055|   464k|                  if constexpr (std::same_as<std::remove_cvref_t<key_t>, std::string>) {
 5056|   464k|                     auto key_probe = it;
 5057|   464k|                     yaml::skip_inline_ws(key_probe, end);
 5058|   464k|                     const bool complex_flow_key = (key_probe != end && (*key_probe == '[' || *key_probe == '{'));
  ------------------
  |  Branch (5058:53): [True: 464k, False: 0]
  |  Branch (5058:74): [True: 1.59k, False: 462k]
  |  Branch (5058:95): [True: 2.83k, False: 459k]
  ------------------
 5059|   464k|                     if (complex_flow_key) {
  ------------------
  |  Branch (5059:26): [True: 4.42k, False: 459k]
  ------------------
 5060|  4.42k|                        glz::generic key_node{};
 5061|  4.42k|                        from<YAML, glz::generic>::template op<yaml::flow_context_on<Opts>()>(key_node, ctx, it, end);
 5062|  4.42k|                        if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (5062:29): [True: 508, False: 3.91k]
  ------------------
 5063|    508|                           return false;
 5064|  3.91k|                        if (!yaml::materialize_key(key, key_node, ctx)) [[unlikely]]
  ------------------
  |  Branch (5064:29): [True: 1, False: 3.91k]
  ------------------
 5065|      1|                           return false;
 5066|  3.91k|                     }
 5067|   459k|                     else {
 5068|   459k|                        if (!yaml::parse_yaml_key(key, ctx, it, end, false)) {
  ------------------
  |  Branch (5068:29): [True: 1.40k, False: 458k]
  ------------------
 5069|  1.40k|                           return false;
 5070|  1.40k|                        }
 5071|   459k|                     }
 5072|       |                  }
 5073|       |                  else {
 5074|       |                     from<YAML, key_t>::template op<Opts>(key, ctx, it, end);
 5075|       |                     if (bool(ctx.error)) [[unlikely]]
 5076|       |                        return false;
 5077|       |                  }
 5078|       |
 5079|   462k|                  yaml::skip_inline_ws(it, end);
 5080|       |
 5081|   464k|                  if (it == end || *it != ':') {
  ------------------
  |  Branch (5081:23): [True: 3.08k, False: 461k]
  |  Branch (5081:36): [True: 1.06k, False: 460k]
  ------------------
 5082|  2.22k|                     ctx.error = error_code::syntax_error;
 5083|  2.22k|                     return false;
 5084|  2.22k|                  }
 5085|   462k|                  ++it;
 5086|   462k|                  yaml::skip_inline_ws(it, end);
 5087|       |
 5088|   462k|                  val_t val{};
 5089|   462k|                  if (!parse_map_value(val)) [[unlikely]]
  ------------------
  |  Branch (5089:23): [True: 13.6k, False: 448k]
  ------------------
 5090|  13.6k|                     return false;
 5091|       |
 5092|   448k|                  value.emplace(std::move(key), std::move(val));
 5093|   448k|                  return true;
 5094|   462k|               });
_ZZZN3glz4fromILj450ENS_17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES1_EEEEE2opITnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1EEERPKcRS5_TkNS_10is_contextERNS_4yaml12yaml_contextESA_EEvOT1_OT2_OT0_T3_ENKUlRT_RSK_SG_iE_clISE_SA_SA_EEbSO_SP_SG_iENKUlvE_clEv:
 4915|   176k|                        const bool key_content_spans_lines = [&] {
 4916|   176k|                           auto scan = key_it;
 4917|   190k|                           while (scan != content && scan != end) {
  ------------------
  |  Branch (4917:35): [True: 129k, False: 60.8k]
  |  Branch (4917:54): [True: 129k, False: 0]
  ------------------
 4918|   129k|                              if (*scan == '\n' || *scan == '\r') return true;
  ------------------
  |  Branch (4918:35): [True: 108k, False: 21.1k]
  |  Branch (4918:52): [True: 7.48k, False: 13.7k]
  ------------------
 4919|  13.7k|                              ++scan;
 4920|  13.7k|                           }
 4921|  60.8k|                           return false;
 4922|   176k|                        }();
_ZZZN3glz4fromILj450ENS_17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES1_EEEEE2opITnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1EEERPKcRS5_TkNS_10is_contextERNS_4yaml12yaml_contextESA_EEvOT1_OT2_OT0_T3_ENKUlRT_RSK_SG_iE_clISE_SA_SA_EEbSO_SP_SG_iENKUlRS4_E0_clESS_:
 4858|   165k|                        auto to_string_key = [&](glz::generic& key_node) {
 4859|   165k|                           return yaml::materialize_key(key, key_node, ctx);
 4860|   165k|                        };
_ZZZN3glz4fromILj450ENS_17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES1_EEEEE2opITnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1EEERPKcRS5_TkNS_10is_contextERNS_4yaml12yaml_contextESA_EEvOT1_OT2_OT0_T3_ENKUlRT_RSK_SG_iE_clISE_SA_SA_EEbSO_SP_SG_iENKUlRS4_E_clESS_:
 4778|   516k|                  auto parse_map_value = [&](val_t& val) -> bool {
 4779|   516k|                     if (it != end && !yaml::line_end_or_comment_table[static_cast<uint8_t>(*it)]) {
  ------------------
  |  Branch (4779:26): [True: 510k, False: 6.48k]
  |  Branch (4779:39): [True: 395k, False: 115k]
  ------------------
 4780|   395k|                        bool line_starts_with_explicit_value_indicator = false;
 4781|       |
 4782|       |                        // Inline mapping values in block context cannot start with a
 4783|       |                        // plain "key: value" pair on the same line (e.g. "a: b: c").
 4784|       |                        // Such constructs are malformed unless wrapped in flow
 4785|       |                        // delimiters ({...} / [...]) or quoted.
 4786|   395k|                        if constexpr (std::is_pointer_v<std::decay_t<decltype(it)>>) {
 4787|   395k|                           if (ctx.stream_begin) {
  ------------------
  |  Branch (4787:32): [True: 395k, False: 0]
  ------------------
 4788|   395k|                              auto is_line_content_start = [&](auto pos) {
 4789|   395k|                                 return !ctx.line_prefix_before(pos).has_content;
 4790|   395k|                              };
 4791|       |
 4792|   395k|                              auto line_has_explicit_value_indicator = [&](auto pos) {
 4793|   395k|                                 const char* line = ctx.line_begin_of(pos);
 4794|   395k|                                 while (line != end && (*line == ' ' || *line == '\t')) ++line;
 4795|   395k|                                 return line != end && *line == ':';
 4796|   395k|                              };
 4797|       |
 4798|   395k|                              if (!is_line_content_start(it) &&
  ------------------
  |  Branch (4798:35): [True: 395k, False: 0]
  ------------------
 4799|   395k|                                  yaml::inline_value_has_plain_mapping_indicator(it, end) &&
  ------------------
  |  Branch (4799:35): [True: 39.7k, False: 355k]
  ------------------
 4800|  39.7k|                                  !line_has_explicit_value_indicator(it)) {
  ------------------
  |  Branch (4800:35): [True: 877, False: 38.8k]
  ------------------
 4801|    877|                                 ctx.error = error_code::syntax_error;
 4802|    877|                                 return false;
 4803|    877|                              }
 4804|   394k|                              line_starts_with_explicit_value_indicator = line_has_explicit_value_indicator(it);
 4805|   394k|                           }
 4806|   395k|                        }
 4807|       |
 4808|   395k|                        if (*it == '-' &&
  ------------------
  |  Branch (4808:29): [True: 2.51k, False: 392k]
  ------------------
 4809|  2.51k|                            ((it + 1) == end || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*(it + 1))]) &&
  ------------------
  |  Branch (4809:30): [True: 10, False: 2.50k]
  |  Branch (4809:49): [True: 397, False: 2.10k]
  ------------------
 4810|    407|                            !line_starts_with_explicit_value_indicator) {
  ------------------
  |  Branch (4810:29): [True: 10, False: 397]
  ------------------
 4811|       |                           // "key: - item" is not valid block sequence syntax.
 4812|     10|                           ctx.error = error_code::syntax_error;
 4813|     10|                           return false;
 4814|     10|                        }
 4815|       |
 4816|   395k|                        if (!ctx.push_indent(line_indent + 1)) [[unlikely]]
  ------------------
  |  Branch (4816:29): [True: 0, False: 395k]
  ------------------
 4817|      0|                           return false;
 4818|   395k|                        from<YAML, val_t>::template op<Opts>(val, ctx, it, end);
 4819|   395k|                        ctx.pop_indent();
 4820|   395k|                     }
 4821|   121k|                     else {
 4822|   121k|                        int32_t nested_indent = yaml::detect_nested_value_indent(ctx, it, end, line_indent);
 4823|   121k|                        if (nested_indent >= 0) {
  ------------------
  |  Branch (4823:29): [True: 20.8k, False: 100k]
  ------------------
 4824|  20.8k|                           yaml::skip_to_content(it, end);
 4825|  20.8k|                           if (it != end && *it == ':' && (it + 1) != end && *(it + 1) == '\t') {
  ------------------
  |  Branch (4825:32): [True: 20.8k, False: 0]
  |  Branch (4825:45): [True: 0, False: 20.8k]
  |  Branch (4825:59): [True: 0, False: 0]
  |  Branch (4825:78): [True: 0, False: 0]
  ------------------
 4826|      0|                              ctx.error = error_code::syntax_error;
 4827|      0|                              return false;
 4828|      0|                           }
 4829|       |                           // A struct value reads the pushed indent as its own key column;
 4830|       |                           // every other value type reads it as the enclosing baseline.
 4831|  20.8k|                           const int32_t value_indent =
 4832|  20.8k|                              yaml::receives_block_mapping_column<val_t>() ? nested_indent : nested_indent - 1;
  ------------------
  |  Branch (4832:31): [Folded, False: 20.8k]
  ------------------
 4833|  20.8k|                           if (!ctx.push_indent(value_indent)) [[unlikely]]
  ------------------
  |  Branch (4833:32): [True: 0, False: 20.8k]
  ------------------
 4834|      0|                              return false;
 4835|  20.8k|                           from<YAML, val_t>::template op<Opts>(val, ctx, it, end);
 4836|  20.8k|                           ctx.pop_indent();
 4837|  20.8k|                        }
 4838|   121k|                     }
 4839|   516k|                     return !bool(ctx.error);
 4840|   516k|                  };
_ZZZZN3glz4fromILj450ENS_17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES1_EEEEE2opITnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1EEERPKcRS5_TkNS_10is_contextERNS_4yaml12yaml_contextESA_EEvOT1_OT2_OT0_T3_ENKUlRT_RSK_SG_iE_clISE_SA_SA_EEbSO_SP_SG_iENKUlRS4_E_clESS_ENKUlSN_E_clISA_EEDaSN_:
 4788|   395k|                              auto is_line_content_start = [&](auto pos) {
 4789|   395k|                                 return !ctx.line_prefix_before(pos).has_content;
 4790|   395k|                              };
_ZZZZN3glz4fromILj450ENS_17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES1_EEEEE2opITnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1EEERPKcRS5_TkNS_10is_contextERNS_4yaml12yaml_contextESA_EEvOT1_OT2_OT0_T3_ENKUlRT_RSK_SG_iE_clISE_SA_SA_EEbSO_SP_SG_iENKUlRS4_E_clESS_ENKUlSN_E0_clISA_EEDaSN_:
 4792|   434k|                              auto line_has_explicit_value_indicator = [&](auto pos) {
 4793|   434k|                                 const char* line = ctx.line_begin_of(pos);
 4794|   924k|                                 while (line != end && (*line == ' ' || *line == '\t')) ++line;
  ------------------
  |  Branch (4794:41): [True: 924k, False: 0]
  |  Branch (4794:57): [True: 486k, False: 437k]
  |  Branch (4794:73): [True: 3.65k, False: 434k]
  ------------------
 4795|   434k|                                 return line != end && *line == ':';
  ------------------
  |  Branch (4795:41): [True: 434k, False: 0]
  |  Branch (4795:56): [True: 259k, False: 174k]
  ------------------
 4796|   434k|                              };
_ZZN3glz4fromILj450ENS_17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES1_EEEEE2opITnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1EEERPKcRS5_TkNS_10is_contextERNS_4yaml12yaml_contextESA_EEvOT1_OT2_OT0_T3_EN19merge_restore_guardD2Ev:
 4547|   421k|            {
 4548|       |               // emplace is a no-op for keys the document already wrote, so only
 4549|       |               // untouched pre-existing entries are put back.
 4550|   421k|               for (auto& entry : saved) {
  ------------------
  |  Branch (4550:33): [True: 0, False: 421k]
  ------------------
 4551|      0|                  target.emplace(entry.first, std::move(entry.second));
 4552|      0|               }
 4553|   421k|            }
_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|  98.0k|      {
  301|  98.0k|         if (it == end || *it != '*') return false;
  ------------------
  |  Branch (301:14): [True: 0, False: 98.0k]
  |  Branch (301:27): [True: 0, False: 98.0k]
  ------------------
  302|       |
  303|  98.0k|         ++it; // skip '*'
  304|  98.0k|         auto name = parse_anchor_name(it, end);
  305|  98.0k|         if (name.empty()) {
  ------------------
  |  Branch (305:14): [True: 73, False: 97.9k]
  ------------------
  306|     73|            ctx.error = error_code::syntax_error;
  307|     73|            return true;
  308|     73|         }
  309|       |
  310|  97.9k|         auto anchor_it = ctx.anchors.find(name);
  311|  97.9k|         if (anchor_it == ctx.anchors.end()) {
  ------------------
  |  Branch (311:14): [True: 317, False: 97.6k]
  ------------------
  312|    317|            ctx.error = error_code::syntax_error; // undefined alias
  313|    317|            return true;
  314|    317|         }
  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|  97.6k|         const auto span = anchor_it->second;
  319|       |
  320|       |         // Empty anchor span (anchor on null/empty node) — leave value as default
  321|  97.6k|         if (span.begin == span.end) {
  ------------------
  |  Branch (321:14): [True: 1.27k, False: 96.3k]
  ------------------
  322|  1.27k|            return true;
  323|  1.27k|         }
  324|       |
  325|       |         // An anchor is invisible to itself while it expands. A span that aliases the name it
  326|       |         // defines -- reachable because a mapping key's anchor is registered over the key text
  327|       |         // before that text is parsed -- would otherwise replay itself forever.
  328|  96.3k|         if (ctx.alias_span_is_replaying(span.begin, span.end)) [[unlikely]] {
  ------------------
  |  Branch (328:14): [True: 55, False: 96.3k]
  ------------------
  329|     55|            ctx.error = error_code::syntax_error; // cyclic alias
  330|     55|            return true;
  331|     55|         }
  332|       |
  333|       |         // Replaying an anchor re-enters the reader directly, bypassing the variant reader's
  334|       |         // depth guard, so this is the only depth accounting a chain of aliases into a
  335|       |         // non-variant target gets. The cycle check above stops the unbounded case; this bounds
  336|       |         // a legitimate but deeply chained one.
  337|  96.3k|         depth_guard guard{ctx, yaml::max_yaml_recursive_depth};
  338|  96.3k|         if (!guard) [[unlikely]]
  ------------------
  |  Branch (338:14): [True: 1, False: 96.3k]
  ------------------
  339|      1|            return true;
  340|       |
  341|  96.3k|         if (!ctx.charge_alias_expansion(static_cast<size_t>(span.end - span.begin))) [[unlikely]] {
  ------------------
  |  Branch (341:14): [True: 7, False: 96.3k]
  ------------------
  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|  96.3k|         auto replay_it = span.begin;
  348|  96.3k|         auto replay_end = span.end;
  349|       |
  350|       |         // Save indent context and set up for replay
  351|  96.3k|         auto saved_indent_stack = std::move(ctx.indent_stack);
  352|  96.3k|         ctx.indent_stack.clear();
  353|  96.3k|         if (span.base_indent > 0) {
  ------------------
  |  Branch (353:14): [True: 75.6k, False: 20.6k]
  ------------------
  354|  75.6k|            ctx.push_indent(span.base_indent - 1);
  355|  75.6k|         }
  356|       |
  357|  96.3k|         ctx.active_alias_spans.emplace_back(span.begin, span.end);
  358|       |
  359|  96.3k|         using V = std::remove_cvref_t<T>;
  360|  96.3k|         from<YAML, V>::template op<Opts>(std::forward<T>(value), ctx, replay_it, replay_end);
  361|       |
  362|  96.3k|         ctx.active_alias_spans.pop_back();
  363|       |
  364|       |         // Restore indent context
  365|  96.3k|         ctx.indent_stack = std::move(saved_indent_stack);
  366|  96.3k|         return true;
  367|  96.3k|      }
_ZN3glz4yaml15skip_to_contentIPKcS3_EEvRT_T0_:
 3559|  3.46M|      {
 3560|  5.72M|         while (it != end) {
  ------------------
  |  Branch (3560:17): [True: 5.66M, False: 59.2k]
  ------------------
 3561|  5.66M|            if (*it == '\n' || *it == '\r') {
  ------------------
  |  Branch (3561:17): [True: 1.46M, False: 4.20M]
  |  Branch (3561:32): [True: 654k, False: 3.55M]
  ------------------
 3562|  2.11M|               skip_newline(it, end);
 3563|  2.11M|            }
 3564|  3.55M|            else if (*it == '#') {
  ------------------
  |  Branch (3564:22): [True: 60.7k, False: 3.49M]
  ------------------
 3565|  60.7k|               skip_comment(it, end);
 3566|  60.7k|            }
 3567|  3.49M|            else if (*it == ' ') {
  ------------------
  |  Branch (3567:22): [True: 881k, False: 2.60M]
  ------------------
 3568|   881k|               auto line_start = it;
 3569|  2.29M|               while (it != end && *it == ' ') ++it;
  ------------------
  |  Branch (3569:23): [True: 2.28M, False: 7.91k]
  |  Branch (3569:36): [True: 1.41M, False: 873k]
  ------------------
 3570|   881k|               if (it == end || *it == '\n' || *it == '\r') {
  ------------------
  |  Branch (3570:20): [True: 7.91k, False: 873k]
  |  Branch (3570:33): [True: 10.3k, False: 863k]
  |  Branch (3570:48): [True: 12.1k, False: 851k]
  ------------------
 3571|  30.3k|                  continue; // blank line with trailing spaces
 3572|  30.3k|               }
 3573|   851k|               if (*it == '#') {
  ------------------
  |  Branch (3573:20): [True: 51.7k, False: 799k]
  ------------------
 3574|  51.7k|                  skip_comment(it, end);
 3575|  51.7k|                  continue; // comment-only line
 3576|  51.7k|               }
 3577|   799k|               it = line_start; // content found, restore to start of indent
 3578|   799k|               return;
 3579|   851k|            }
 3580|  2.60M|            else {
 3581|  2.60M|               return; // content at column 0
 3582|  2.60M|            }
 3583|  5.66M|         }
 3584|  3.46M|      }
_ZN3glz33process_yaml_variant_alternativesINSt3__17variantIJDndNS1_12basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEbNS1_6vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS6_ISD_EEEENSC_ISD_EEEEENS_19is_yaml_variant_strEE2opITnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1EEERSH_TkNS_10is_contextERNS_4yaml12yaml_contextERPKcSR_EEvOT0_OT1_OT2_T3_:
 5205|   128k|      {
 5206|   128k|         constexpr auto category_count = yaml_variant_count_v<Variant, Trait>;
 5207|       |
 5208|       |         if constexpr (category_count == 0) {
 5209|       |            ctx.error = error_code::no_matching_variant_type;
 5210|       |         }
 5211|   128k|         else if constexpr (category_count == 1) {
 5212|       |            // Only one type in this category, use it directly
 5213|   128k|            constexpr auto first_idx = yaml_variant_first_index_v<Variant, Trait>;
 5214|   128k|            using V = std::variant_alternative_t<first_idx, Variant>;
 5215|   128k|            if (!std::holds_alternative<V>(value)) value = V{};
  ------------------
  |  Branch (5215:17): [True: 128k, False: 0]
  ------------------
 5216|   128k|            from<YAML, V>::template op<Opts>(std::get<V>(value), ctx, it, end);
 5217|       |         }
 5218|       |         else {
 5219|       |            // Multiple types in this category, try each one
 5220|       |            constexpr auto N = std::variant_size_v<Variant>;
 5221|       |            bool found_match{};
 5222|       |            size_t match_idx = 0;
 5223|       |            // Only the last alternative propagates its error, so an alternative that exhausted an
 5224|       |            // expansion budget would otherwise be reported as no_matching_variant_type -- a wrong
 5225|       |            // diagnosis for a document that is hostile rather than merely the wrong shape. Held
 5226|       |            // aside and used only if nothing matched, so an alternative that does succeed later
 5227|       |            // (one that materializes no key text can still parse under a latched budget) is
 5228|       |            // unaffected.
 5229|       |            error_code expansion_error{};
 5230|       |            std::string_view expansion_message{};
 5231|       |
 5232|       |            for_each<N>([&]<size_t I>() {
 5233|       |               if (found_match) {
 5234|       |                  return;
 5235|       |               }
 5236|       |               using V = std::variant_alternative_t<I, Variant>;
 5237|       |               if constexpr (Trait<V>::value) {
 5238|       |                  auto copy_it = it;
 5239|       |                  if (!std::holds_alternative<V>(value)) {
 5240|       |                     value = V{};
 5241|       |                  }
 5242|       |
 5243|       |                  auto temp_ctx = ctx.make_speculative();
 5244|       |                  from<YAML, V>::template op<Opts>(std::get<V>(value), temp_ctx, it, end);
 5245|       |
 5246|       |                  // Charged whether or not the alternative fit: a rejected probe still replayed
 5247|       |                  // whatever aliases it reached, and an attempt that is never billed is an
 5248|       |                  // attempt that can be repeated for free.
 5249|       |                  ctx.alias_expansion_budget = temp_ctx.alias_expansion_budget;
 5250|       |                  ctx.key_expansion_budget = temp_ctx.key_expansion_budget;
 5251|       |
 5252|       |                  if (!bool(temp_ctx.error)) {
 5253|       |                     found_match = true;
 5254|       |                     ctx.anchors = std::move(temp_ctx.anchors);
 5255|       |                  }
 5256|       |                  else {
 5257|       |                     it = copy_it;
 5258|       |                     if (temp_ctx.error == error_code::exceeded_max_expansion && expansion_error == error_code::none) {
 5259|       |                        expansion_error = temp_ctx.error;
 5260|       |                        expansion_message = temp_ctx.custom_error_message;
 5261|       |                     }
 5262|       |                     if (match_idx + 1 < category_count) {
 5263|       |                        // Not the last type, continue trying
 5264|       |                     }
 5265|       |                     else {
 5266|       |                        // Last type failed, propagate error
 5267|       |                        ctx.error = temp_ctx.error;
 5268|       |                        ctx.custom_error_message = temp_ctx.custom_error_message;
 5269|       |                     }
 5270|       |                  }
 5271|       |                  ++match_idx;
 5272|       |               }
 5273|       |            });
 5274|       |
 5275|       |            if (!found_match && !bool(ctx.error)) {
 5276|       |               if (expansion_error != error_code::none) {
 5277|       |                  ctx.error = expansion_error;
 5278|       |                  ctx.custom_error_message = expansion_message;
 5279|       |               }
 5280|       |               else {
 5281|       |                  ctx.error = error_code::no_matching_variant_type;
 5282|       |               }
 5283|       |            }
 5284|       |         }
 5285|   128k|      }
_ZN3glz4fromILj450ENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEE2opITnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1EEERPKcRS7_TkNS_10is_contextERNS_4yaml12yaml_contextESC_EEvOT1_OT2_OT0_T3_:
 1892|   131k|      {
 1893|   131k|         if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (1893:14): [True: 6.03k, False: 125k]
  ------------------
 1894|  6.03k|            return;
 1895|       |
 1896|   125k|         yaml::node_preamble_state preamble{};
 1897|   125k|         if (yaml::parse_node_preamble<Opts, yaml::node_property_policy{true, false, false, true}>(
  ------------------
  |  Branch (1897:14): [True: 3.58k, False: 121k]
  ------------------
 1898|   125k|                value, ctx, it, end, preamble, [](yaml::yaml_tag tag) { return yaml::tag_valid_for_string(tag); }))
 1899|  3.58k|            return;
 1900|       |
 1901|   121k|         std::string str;
 1902|   121k|         const auto style = yaml::detect_scalar_style(*it);
 1903|       |
 1904|   121k|         switch (style) {
  ------------------
  |  Branch (1904:18): [True: 121k, False: 0]
  ------------------
 1905|    679|         case yaml::scalar_style::double_quoted:
  ------------------
  |  Branch (1905:10): [True: 679, False: 120k]
  ------------------
 1906|    679|            yaml::parse_double_quoted_string(str, ctx, it, end);
 1907|    679|            break;
 1908|  1.08k|         case yaml::scalar_style::single_quoted:
  ------------------
  |  Branch (1908:10): [True: 1.08k, False: 120k]
  ------------------
 1909|  1.08k|            yaml::parse_single_quoted_string(str, ctx, it, end);
 1910|  1.08k|            break;
 1911|  1.48k|         case yaml::scalar_style::literal_block:
  ------------------
  |  Branch (1911:10): [True: 1.48k, False: 120k]
  ------------------
 1912|  2.05k|         case yaml::scalar_style::folded_block:
  ------------------
  |  Branch (1912:10): [True: 565, False: 121k]
  ------------------
 1913|       |            // For same-line mapping/sequence values, parsing context is typically pushed
 1914|       |            // one column past the key/item indicator; block scalar indentation is relative
 1915|       |            // to the parent line indent.
 1916|  2.05k|            yaml::parse_block_scalar(str, ctx, it, end,
 1917|  2.05k|                                     ctx.current_indent() > 0 ? (ctx.current_indent() - 1) : ctx.current_indent());
  ------------------
  |  Branch (1917:38): [True: 390, False: 1.66k]
  ------------------
 1918|  2.05k|            break;
 1919|   117k|         case yaml::scalar_style::plain:
  ------------------
  |  Branch (1919:10): [True: 117k, False: 3.81k]
  ------------------
 1920|       |            // In block context with known indent, use multiline parsing to support
 1921|       |            // plain scalars that span multiple lines (folding behavior)
 1922|   117k|            if constexpr (!yaml::check_flow_context(Opts)) {
 1923|   117k|               if (ctx.current_indent() >= 0) {
  ------------------
  |  Branch (1923:20): [True: 100k, False: 17.6k]
  ------------------
 1924|   100k|                  yaml::parse_plain_scalar_multiline(str, ctx, it, end, ctx.current_indent());
 1925|   100k|               }
 1926|  17.6k|               else {
 1927|       |                  // Top-level plain scalars may continue on same-indent or indented lines.
 1928|  17.6k|                  yaml::parse_plain_scalar_multiline(str, ctx, it, end, int32_t(0));
 1929|  17.6k|               }
 1930|       |            }
 1931|       |            else {
 1932|       |               yaml::parse_plain_scalar(str, ctx, it, end, true);
 1933|       |            }
 1934|   117k|            break;
 1935|   121k|         }
 1936|       |
 1937|   121k|         if (!bool(ctx.error)) {
  ------------------
  |  Branch (1937:14): [True: 121k, False: 191]
  ------------------
 1938|   121k|            value = std::move(str);
 1939|   121k|            yaml::finalize_node_anchor(preamble.node_props, ctx, it);
 1940|   121k|         }
 1941|   121k|      }
_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|   125k|      {
  466|   125k|         skip_inline_ws(it, end);
  467|       |
  468|   125k|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (468:14): [True: 6, False: 125k]
  ------------------
  469|      6|            if constexpr (!AllowEmptyInput) {
  470|      6|               ctx.error = error_code::unexpected_end;
  471|      6|            }
  472|      6|            return true;
  473|      6|         }
  474|       |
  475|   125k|         preamble.tag = parse_yaml_tag(it, end, ctx);
  476|   125k|         if (preamble.tag == yaml_tag::unknown) [[unlikely]] {
  ------------------
  |  Branch (476:14): [True: 7, False: 125k]
  ------------------
  477|      7|            ctx.error = error_code::syntax_error;
  478|      7|            return true;
  479|      7|         }
  480|   125k|         if (!tag_validator(preamble.tag)) [[unlikely]] {
  ------------------
  |  Branch (480:14): [True: 7, False: 125k]
  ------------------
  481|      7|            ctx.error = error_code::syntax_error;
  482|      7|            return true;
  483|      7|         }
  484|       |
  485|   125k|         skip_inline_ws(it, end);
  486|       |
  487|   125k|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (487:14): [True: 17, False: 125k]
  ------------------
  488|     17|            if constexpr (!AllowEmptyInput) {
  489|     17|               ctx.error = error_code::unexpected_end;
  490|     17|            }
  491|     17|            return true;
  492|     17|         }
  493|       |
  494|   125k|         if (parse_node_properties<Opts, PropertyPolicy>(std::forward<T>(value), ctx, it, end, preamble.node_props)) {
  ------------------
  |  Branch (494:14): [True: 3.54k, False: 121k]
  ------------------
  495|  3.54k|            return true;
  496|  3.54k|         }
  497|       |
  498|   121k|         return false;
  499|   125k|      }
_ZZN3glz4fromILj450ENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEE2opITnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1EEERPKcRS7_TkNS_10is_contextERNS_4yaml12yaml_contextESC_EEvOT1_OT2_OT0_T3_ENKUlNSF_8yaml_tagEE_clESP_:
 1898|   125k|                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|   125k|      {
  409|   125k|         state.has_anchor = false;
  410|   125k|         state.anchor_name.clear();
  411|   125k|         state.anchor_start = nullptr;
  412|   125k|         state.anchor_indent = ctx.current_indent();
  413|       |
  414|   125k|         if constexpr (Policy.allow_alias) {
  415|       |            if constexpr (Policy.alias_can_be_mapping_key) {
  416|       |               if (!alias_token_is_mapping_key(it, end)) {
  417|       |                  if (handle_alias<Opts>(std::forward<T>(value), ctx, it, end)) return true;
  418|       |               }
  419|       |            }
  420|   125k|            else {
  421|   125k|               if (handle_alias<Opts>(std::forward<T>(value), ctx, it, end)) return true;
  ------------------
  |  Branch (421:20): [True: 3.51k, False: 121k]
  ------------------
  422|   125k|            }
  423|   125k|         }
  424|       |
  425|   125k|         if (it != end && *it == '&') {
  ------------------
  |  Branch (425:14): [True: 121k, False: 3.51k]
  |  Branch (425:27): [True: 4.77k, False: 116k]
  ------------------
  426|  4.77k|            ++it;
  427|  4.77k|            auto name = parse_anchor_name(it, end);
  428|  4.77k|            if (name.empty()) {
  ------------------
  |  Branch (428:17): [True: 5, False: 4.77k]
  ------------------
  429|      5|               ctx.error = error_code::syntax_error;
  430|      5|               return true;
  431|      5|            }
  432|  4.77k|            skip_inline_ws(it, end);
  433|  4.77k|            if (it == end) {
  ------------------
  |  Branch (433:17): [True: 26, False: 4.74k]
  ------------------
  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|  4.74k|            if constexpr (Policy.disallow_anchor_on_alias) {
  440|  4.74k|               if (*it == '*') {
  ------------------
  |  Branch (440:20): [True: 2, False: 4.74k]
  ------------------
  441|      2|                  ctx.error = error_code::syntax_error;
  442|      2|                  return true;
  443|      2|               }
  444|  4.74k|            }
  445|  4.74k|            state.has_anchor = true;
  446|  4.74k|            state.anchor_name = std::string(name);
  447|  4.74k|            state.anchor_start = &*it;
  448|  4.74k|         }
  449|       |
  450|   125k|         return false;
  451|   125k|      }
_ZN3glz4yaml12handle_aliasITnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1EEERNSt3__112basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEENS0_12yaml_contextEPKcSD_EEbOT0_RT1_RT2_T3_:
  300|   125k|      {
  301|   125k|         if (it == end || *it != '*') return false;
  ------------------
  |  Branch (301:14): [True: 0, False: 125k]
  |  Branch (301:27): [True: 121k, False: 3.51k]
  ------------------
  302|       |
  303|  3.51k|         ++it; // skip '*'
  304|  3.51k|         auto name = parse_anchor_name(it, end);
  305|  3.51k|         if (name.empty()) {
  ------------------
  |  Branch (305:14): [True: 4, False: 3.50k]
  ------------------
  306|      4|            ctx.error = error_code::syntax_error;
  307|      4|            return true;
  308|      4|         }
  309|       |
  310|  3.50k|         auto anchor_it = ctx.anchors.find(name);
  311|  3.50k|         if (anchor_it == ctx.anchors.end()) {
  ------------------
  |  Branch (311:14): [True: 20, False: 3.48k]
  ------------------
  312|     20|            ctx.error = error_code::syntax_error; // undefined alias
  313|     20|            return true;
  314|     20|         }
  315|       |
  316|       |         // Copied rather than referenced: the replay below can replace ctx.anchors wholesale
  317|       |         // (a speculative parse hands its own map back), which would dangle a reference here.
  318|  3.48k|         const auto span = anchor_it->second;
  319|       |
  320|       |         // Empty anchor span (anchor on null/empty node) — leave value as default
  321|  3.48k|         if (span.begin == span.end) {
  ------------------
  |  Branch (321:14): [True: 275, False: 3.21k]
  ------------------
  322|    275|            return true;
  323|    275|         }
  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.21k|         if (ctx.alias_span_is_replaying(span.begin, span.end)) [[unlikely]] {
  ------------------
  |  Branch (328:14): [True: 14, False: 3.19k]
  ------------------
  329|     14|            ctx.error = error_code::syntax_error; // cyclic alias
  330|     14|            return true;
  331|     14|         }
  332|       |
  333|       |         // Replaying an anchor re-enters the reader directly, bypassing the variant reader's
  334|       |         // depth guard, so this is the only depth accounting a chain of aliases into a
  335|       |         // non-variant target gets. The cycle check above stops the unbounded case; this bounds
  336|       |         // a legitimate but deeply chained one.
  337|  3.19k|         depth_guard guard{ctx, yaml::max_yaml_recursive_depth};
  338|  3.19k|         if (!guard) [[unlikely]]
  ------------------
  |  Branch (338:14): [True: 1, False: 3.19k]
  ------------------
  339|      1|            return true;
  340|       |
  341|  3.19k|         if (!ctx.charge_alias_expansion(static_cast<size_t>(span.end - span.begin))) [[unlikely]] {
  ------------------
  |  Branch (341:14): [True: 0, False: 3.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|  3.19k|         auto replay_it = span.begin;
  348|  3.19k|         auto replay_end = span.end;
  349|       |
  350|       |         // Save indent context and set up for replay
  351|  3.19k|         auto saved_indent_stack = std::move(ctx.indent_stack);
  352|  3.19k|         ctx.indent_stack.clear();
  353|  3.19k|         if (span.base_indent > 0) {
  ------------------
  |  Branch (353:14): [True: 1.77k, False: 1.42k]
  ------------------
  354|  1.77k|            ctx.push_indent(span.base_indent - 1);
  355|  1.77k|         }
  356|       |
  357|  3.19k|         ctx.active_alias_spans.emplace_back(span.begin, span.end);
  358|       |
  359|  3.19k|         using V = std::remove_cvref_t<T>;
  360|  3.19k|         from<YAML, V>::template op<Opts>(std::forward<T>(value), ctx, replay_it, replay_end);
  361|       |
  362|  3.19k|         ctx.active_alias_spans.pop_back();
  363|       |
  364|       |         // Restore indent context
  365|  3.19k|         ctx.indent_stack = std::move(saved_indent_stack);
  366|  3.19k|         return true;
  367|  3.19k|      }
_ZN3glz33process_yaml_variant_alternativesINSt3__17variantIJDndNS1_12basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEbNS1_6vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS6_ISD_EEEENSC_ISD_EEEEENS_19is_yaml_variant_numEE2opITnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1EEERSH_TkNS_10is_contextERNS_4yaml12yaml_contextERPKcSR_EEvOT0_OT1_OT2_T3_:
 5205|  33.5k|      {
 5206|  33.5k|         constexpr auto category_count = yaml_variant_count_v<Variant, Trait>;
 5207|       |
 5208|       |         if constexpr (category_count == 0) {
 5209|       |            ctx.error = error_code::no_matching_variant_type;
 5210|       |         }
 5211|  33.5k|         else if constexpr (category_count == 1) {
 5212|       |            // Only one type in this category, use it directly
 5213|  33.5k|            constexpr auto first_idx = yaml_variant_first_index_v<Variant, Trait>;
 5214|  33.5k|            using V = std::variant_alternative_t<first_idx, Variant>;
 5215|  33.5k|            if (!std::holds_alternative<V>(value)) value = V{};
  ------------------
  |  Branch (5215:17): [True: 33.5k, False: 0]
  ------------------
 5216|  33.5k|            from<YAML, V>::template op<Opts>(std::get<V>(value), ctx, it, end);
 5217|       |         }
 5218|       |         else {
 5219|       |            // Multiple types in this category, try each one
 5220|       |            constexpr auto N = std::variant_size_v<Variant>;
 5221|       |            bool found_match{};
 5222|       |            size_t match_idx = 0;
 5223|       |            // Only the last alternative propagates its error, so an alternative that exhausted an
 5224|       |            // expansion budget would otherwise be reported as no_matching_variant_type -- a wrong
 5225|       |            // diagnosis for a document that is hostile rather than merely the wrong shape. Held
 5226|       |            // aside and used only if nothing matched, so an alternative that does succeed later
 5227|       |            // (one that materializes no key text can still parse under a latched budget) is
 5228|       |            // unaffected.
 5229|       |            error_code expansion_error{};
 5230|       |            std::string_view expansion_message{};
 5231|       |
 5232|       |            for_each<N>([&]<size_t I>() {
 5233|       |               if (found_match) {
 5234|       |                  return;
 5235|       |               }
 5236|       |               using V = std::variant_alternative_t<I, Variant>;
 5237|       |               if constexpr (Trait<V>::value) {
 5238|       |                  auto copy_it = it;
 5239|       |                  if (!std::holds_alternative<V>(value)) {
 5240|       |                     value = V{};
 5241|       |                  }
 5242|       |
 5243|       |                  auto temp_ctx = ctx.make_speculative();
 5244|       |                  from<YAML, V>::template op<Opts>(std::get<V>(value), temp_ctx, it, end);
 5245|       |
 5246|       |                  // Charged whether or not the alternative fit: a rejected probe still replayed
 5247|       |                  // whatever aliases it reached, and an attempt that is never billed is an
 5248|       |                  // attempt that can be repeated for free.
 5249|       |                  ctx.alias_expansion_budget = temp_ctx.alias_expansion_budget;
 5250|       |                  ctx.key_expansion_budget = temp_ctx.key_expansion_budget;
 5251|       |
 5252|       |                  if (!bool(temp_ctx.error)) {
 5253|       |                     found_match = true;
 5254|       |                     ctx.anchors = std::move(temp_ctx.anchors);
 5255|       |                  }
 5256|       |                  else {
 5257|       |                     it = copy_it;
 5258|       |                     if (temp_ctx.error == error_code::exceeded_max_expansion && expansion_error == error_code::none) {
 5259|       |                        expansion_error = temp_ctx.error;
 5260|       |                        expansion_message = temp_ctx.custom_error_message;
 5261|       |                     }
 5262|       |                     if (match_idx + 1 < category_count) {
 5263|       |                        // Not the last type, continue trying
 5264|       |                     }
 5265|       |                     else {
 5266|       |                        // Last type failed, propagate error
 5267|       |                        ctx.error = temp_ctx.error;
 5268|       |                        ctx.custom_error_message = temp_ctx.custom_error_message;
 5269|       |                     }
 5270|       |                  }
 5271|       |                  ++match_idx;
 5272|       |               }
 5273|       |            });
 5274|       |
 5275|       |            if (!found_match && !bool(ctx.error)) {
 5276|       |               if (expansion_error != error_code::none) {
 5277|       |                  ctx.error = expansion_error;
 5278|       |                  ctx.custom_error_message = expansion_message;
 5279|       |               }
 5280|       |               else {
 5281|       |                  ctx.error = error_code::no_matching_variant_type;
 5282|       |               }
 5283|       |            }
 5284|       |         }
 5285|  33.5k|      }
_ZN3glz4fromILj450EdE2opITnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1EEERPKcRdTkNS_10is_contextERNS_4yaml12yaml_contextES5_EEvOT1_OT2_OT0_T3_:
 2047|  36.0k|      {
 2048|  36.0k|         if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2048:14): [True: 0, False: 36.0k]
  ------------------
 2049|      0|            return;
 2050|       |
 2051|  36.0k|         yaml::node_preamble_state preamble{};
 2052|  36.0k|         if (yaml::parse_node_preamble<Opts>(value, ctx, it, end, preamble, [](yaml::yaml_tag tag) {
  ------------------
  |  Branch (2052:14): [True: 4.64k, False: 31.4k]
  ------------------
 2053|  36.0k|                if constexpr (std::floating_point<std::remove_cvref_t<T>>) {
 2054|  36.0k|                   return yaml::tag_valid_for_float(tag);
 2055|  36.0k|                }
 2056|  36.0k|                else {
 2057|  36.0k|                   return yaml::tag_valid_for_int(tag);
 2058|  36.0k|                }
 2059|  36.0k|             }))
 2060|  4.64k|            return;
 2061|       |
 2062|  31.4k|         auto finalize = [&] { yaml::finalize_node_anchor(preamble.node_props, ctx, it); };
 2063|       |
 2064|       |         // Check for special float values
 2065|  31.4k|         if constexpr (std::floating_point<std::remove_cvref_t<T>>) {
 2066|  31.4k|            auto start = it;
 2067|       |
 2068|       |            // Check for .inf, .nan, -.inf, etc.
 2069|  31.4k|            if (*it == '.') {
  ------------------
  |  Branch (2069:17): [True: 7.52k, False: 23.8k]
  ------------------
 2070|  7.52k|               ++it;
 2071|  7.52k|               if (it + 3 <= end && (std::string_view(it, 3) == "inf" || std::string_view(it, 3) == "Inf" ||
  ------------------
  |  Branch (2071:20): [True: 7.06k, False: 462]
  |  Branch (2071:38): [True: 514, False: 6.54k]
  |  Branch (2071:74): [True: 153, False: 6.39k]
  ------------------
 2072|  6.39k|                                     std::string_view(it, 3) == "INF")) {
  ------------------
  |  Branch (2072:38): [True: 336, False: 6.05k]
  ------------------
 2073|  1.00k|                  value = std::numeric_limits<std::remove_cvref_t<T>>::infinity();
 2074|  1.00k|                  it += 3;
 2075|  1.00k|                  finalize();
 2076|  1.00k|                  return;
 2077|  1.00k|               }
 2078|  6.51k|               if (it + 3 <= end && (std::string_view(it, 3) == "nan" || std::string_view(it, 3) == "NaN" ||
  ------------------
  |  Branch (2078:20): [True: 6.05k, False: 462]
  |  Branch (2078:38): [True: 325, False: 5.73k]
  |  Branch (2078:74): [True: 574, False: 5.15k]
  ------------------
 2079|  5.15k|                                     std::string_view(it, 3) == "NAN")) {
  ------------------
  |  Branch (2079:38): [True: 311, False: 4.84k]
  ------------------
 2080|  1.21k|                  value = std::numeric_limits<std::remove_cvref_t<T>>::quiet_NaN();
 2081|  1.21k|                  it += 3;
 2082|  1.21k|                  finalize();
 2083|  1.21k|                  return;
 2084|  1.21k|               }
 2085|  5.30k|               it = start;
 2086|  5.30k|            }
 2087|       |
 2088|  29.1k|            if (*it == '-' || *it == '+') {
  ------------------
  |  Branch (2088:17): [True: 1.56k, False: 27.6k]
  |  Branch (2088:31): [True: 2.93k, False: 24.6k]
  ------------------
 2089|  4.50k|               const char sign = *it;
 2090|  4.50k|               ++it;
 2091|  4.50k|               if (it != end && *it == '.') {
  ------------------
  |  Branch (2091:20): [True: 4.41k, False: 96]
  |  Branch (2091:33): [True: 2.44k, False: 1.96k]
  ------------------
 2092|  2.44k|                  ++it;
 2093|  2.44k|                  if (it + 3 <= end && (std::string_view(it, 3) == "inf" || std::string_view(it, 3) == "Inf" ||
  ------------------
  |  Branch (2093:23): [True: 2.08k, False: 361]
  |  Branch (2093:41): [True: 342, False: 1.73k]
  |  Branch (2093:77): [True: 302, False: 1.43k]
  ------------------
 2094|  1.43k|                                        std::string_view(it, 3) == "INF")) {
  ------------------
  |  Branch (2094:41): [True: 319, False: 1.11k]
  ------------------
 2095|    963|                     if (sign == '-') {
  ------------------
  |  Branch (2095:26): [True: 642, False: 321]
  ------------------
 2096|    642|                        value = -std::numeric_limits<std::remove_cvref_t<T>>::infinity();
 2097|    642|                     }
 2098|    321|                     else {
 2099|    321|                        value = std::numeric_limits<std::remove_cvref_t<T>>::infinity();
 2100|    321|                     }
 2101|    963|                     it += 3;
 2102|    963|                     finalize();
 2103|    963|                     return;
 2104|    963|                  }
 2105|  2.44k|               }
 2106|  3.54k|               it = start;
 2107|  3.54k|            }
 2108|  29.1k|         }
 2109|       |
 2110|       |         // Parse as plain scalar and convert
 2111|  28.2k|         auto start = it;
 2112|       |
 2113|       |         // Find end of number - use same rules as plain scalar for colons
 2114|  11.7M|         while (it != end) {
  ------------------
  |  Branch (2114:17): [True: 11.7M, False: 8.34k]
  ------------------
 2115|  11.7M|            const char c = *it;
 2116|  11.7M|            if (c == ' ' || c == '\t' || c == '\n' || c == '\r' || c == ',' || c == ']' || c == '}' || c == '#') {
  ------------------
  |  Branch (2116:17): [True: 7.88k, False: 11.7M]
  |  Branch (2116:29): [True: 1.13k, False: 11.7M]
  |  Branch (2116:42): [True: 3.32k, False: 11.7M]
  |  Branch (2116:55): [True: 1.33k, False: 11.7M]
  |  Branch (2116:68): [True: 1.17k, False: 11.7M]
  |  Branch (2116:80): [True: 623, False: 11.7M]
  |  Branch (2116:92): [True: 965, False: 11.7M]
  |  Branch (2116:104): [True: 3.07k, False: 11.7M]
  ------------------
 2117|  19.5k|               break;
 2118|  19.5k|            }
 2119|       |            // Colon only ends number if followed by space/tab/newline/end (YAML mapping indicator)
 2120|  11.7M|            if (c == ':') {
  ------------------
  |  Branch (2120:17): [True: 16.6k, False: 11.7M]
  ------------------
 2121|  16.6k|               if ((it + 1) == end || *(it + 1) == ' ' || *(it + 1) == '\t' || *(it + 1) == '\n' || *(it + 1) == '\r') {
  ------------------
  |  Branch (2121:20): [True: 687, False: 15.9k]
  |  Branch (2121:39): [True: 1.88k, False: 14.0k]
  |  Branch (2121:59): [True: 97, False: 13.9k]
  |  Branch (2121:80): [True: 499, False: 13.4k]
  |  Branch (2121:101): [True: 380, False: 13.1k]
  ------------------
 2122|  3.54k|                  break;
 2123|  3.54k|               }
 2124|  16.6k|            }
 2125|  11.7M|            ++it;
 2126|  11.7M|         }
 2127|       |
 2128|  31.4k|         const std::string_view num_str(&*start, static_cast<size_t>(it - start));
 2129|       |
 2130|  31.4k|         if (num_str.empty()) {
  ------------------
  |  Branch (2130:14): [True: 1.16k, False: 30.2k]
  ------------------
 2131|  1.16k|            ctx.error = error_code::parse_number_failure;
 2132|  1.16k|            return;
 2133|  1.16k|         }
 2134|       |
 2135|       |         // Handle hex, octal, binary
 2136|       |         if constexpr (std::integral<std::remove_cvref_t<T>>) {
 2137|       |            if (num_str.size() > 2 && num_str[0] == '0') {
 2138|       |               int base = 10;
 2139|       |               size_t offset = 0;
 2140|       |
 2141|       |               if (num_str[1] == 'x' || num_str[1] == 'X') {
 2142|       |                  base = 16;
 2143|       |                  offset = 2;
 2144|       |               }
 2145|       |               else if (num_str[1] == 'o' || num_str[1] == 'O') {
 2146|       |                  base = 8;
 2147|       |                  offset = 2;
 2148|       |               }
 2149|       |               else if (num_str[1] == 'b' || num_str[1] == 'B') {
 2150|       |                  base = 2;
 2151|       |                  offset = 2;
 2152|       |               }
 2153|       |
 2154|       |               if (base != 10) {
 2155|       |                  const auto digits = num_str.substr(offset);
 2156|       |                  const bool has_underscores = (digits.find('_') != std::string_view::npos);
 2157|       |
 2158|       |                  std::string clean_storage;
 2159|       |                  std::string_view clean_view;
 2160|       |
 2161|       |                  if (has_underscores) {
 2162|       |                     clean_storage.reserve(digits.size());
 2163|       |                     for (char c : digits) {
 2164|       |                        if (c != '_') {
 2165|       |                           clean_storage.push_back(c);
 2166|       |                        }
 2167|       |                     }
 2168|       |                     clean_view = clean_storage;
 2169|       |                  }
 2170|       |                  else {
 2171|       |                     clean_view = digits;
 2172|       |                  }
 2173|       |
 2174|       |                  auto [ptr, ec] =
 2175|       |                     std::from_chars(clean_view.data(), clean_view.data() + clean_view.size(), value, base);
 2176|       |                  if (ec != std::errc{}) {
 2177|       |                     ctx.error = error_code::parse_number_failure;
 2178|       |                  }
 2179|       |                  finalize();
 2180|       |                  return;
 2181|       |               }
 2182|       |            }
 2183|       |         }
 2184|  30.2k|         else if constexpr (std::floating_point<std::remove_cvref_t<T>>) {
 2185|  30.2k|            bool negative = false;
 2186|  30.2k|            std::string_view digits = num_str;
 2187|       |
 2188|  30.2k|            if (!digits.empty() && (digits.front() == '+' || digits.front() == '-')) {
  ------------------
  |  Branch (2188:17): [True: 27.0k, False: 3.17k]
  |  Branch (2188:37): [True: 2.61k, False: 24.4k]
  |  Branch (2188:62): [True: 926, False: 23.5k]
  ------------------
 2189|  3.54k|               negative = (digits.front() == '-');
 2190|  3.54k|               digits.remove_prefix(1);
 2191|  3.54k|            }
 2192|       |
 2193|  30.2k|            if (digits.size() > 2 && digits[0] == '0') {
  ------------------
  |  Branch (2193:17): [True: 17.6k, False: 12.5k]
  |  Branch (2193:38): [True: 7.20k, False: 10.4k]
  ------------------
 2194|  7.20k|               int base = 10;
 2195|  7.20k|               size_t offset = 0;
 2196|       |
 2197|  7.20k|               if (digits[1] == 'x' || digits[1] == 'X') {
  ------------------
  |  Branch (2197:20): [True: 2.51k, False: 4.69k]
  |  Branch (2197:40): [True: 1.22k, False: 3.46k]
  ------------------
 2198|  3.74k|                  base = 16;
 2199|  3.74k|                  offset = 2;
 2200|  3.74k|               }
 2201|  3.46k|               else if (digits[1] == 'o' || digits[1] == 'O') {
  ------------------
  |  Branch (2201:25): [True: 82, False: 3.38k]
  |  Branch (2201:45): [True: 454, False: 2.92k]
  ------------------
 2202|    536|                  base = 8;
 2203|    536|                  offset = 2;
 2204|    536|               }
 2205|  2.92k|               else if (digits[1] == 'b' || digits[1] == 'B') {
  ------------------
  |  Branch (2205:25): [True: 159, False: 2.77k]
  |  Branch (2205:45): [True: 296, False: 2.47k]
  ------------------
 2206|    455|                  base = 2;
 2207|    455|                  offset = 2;
 2208|    455|               }
 2209|       |
 2210|  7.20k|               if (base != 10) {
  ------------------
  |  Branch (2210:20): [True: 4.73k, False: 2.47k]
  ------------------
 2211|  4.73k|                  auto raw_digits = digits.substr(offset);
 2212|  4.73k|                  const bool has_underscores = (raw_digits.find('_') != std::string_view::npos);
 2213|       |
 2214|  4.73k|                  std::string clean_storage;
 2215|  4.73k|                  std::string_view clean_view;
 2216|  4.73k|                  if (has_underscores) {
  ------------------
  |  Branch (2216:23): [True: 2.12k, False: 2.60k]
  ------------------
 2217|  2.12k|                     clean_storage.reserve(raw_digits.size());
 2218|  2.33M|                     for (char c : raw_digits) {
  ------------------
  |  Branch (2218:34): [True: 2.33M, False: 2.12k]
  ------------------
 2219|  2.33M|                        if (c != '_') {
  ------------------
  |  Branch (2219:29): [True: 2.32M, False: 3.61k]
  ------------------
 2220|  2.32M|                           clean_storage.push_back(c);
 2221|  2.32M|                        }
 2222|  2.33M|                     }
 2223|  2.12k|                     clean_view = clean_storage;
 2224|  2.12k|                  }
 2225|  2.60k|                  else {
 2226|  2.60k|                     clean_view = raw_digits;
 2227|  2.60k|                  }
 2228|       |
 2229|  4.73k|                  uint64_t parsed_int{};
 2230|  4.73k|                  auto [ptr, ec] =
 2231|  4.73k|                     std::from_chars(clean_view.data(), clean_view.data() + clean_view.size(), parsed_int, base);
 2232|  4.73k|                  if (ec != std::errc{} || ptr != (clean_view.data() + clean_view.size())) {
  ------------------
  |  Branch (2232:23): [True: 2.34k, False: 2.38k]
  |  Branch (2232:44): [True: 1.35k, False: 1.02k]
  ------------------
 2233|  3.70k|                     ctx.error = error_code::parse_number_failure;
 2234|  3.70k|                     finalize();
 2235|  3.70k|                     return;
 2236|  3.70k|                  }
 2237|       |
 2238|  1.02k|                  const auto as_float = static_cast<std::remove_cvref_t<T>>(parsed_int);
 2239|  1.02k|                  value = negative ? -as_float : as_float;
  ------------------
  |  Branch (2239:27): [True: 529, False: 498]
  ------------------
 2240|  1.02k|                  finalize();
 2241|  1.02k|                  return;
 2242|  4.73k|               }
 2243|  7.20k|            }
 2244|  30.2k|         }
 2245|       |
 2246|       |         // Standard number parsing - only allocate if underscores present
 2247|  25.5k|         const bool has_underscores = (num_str.find('_') != std::string_view::npos);
 2248|       |
 2249|  30.2k|         std::string clean_storage;
 2250|  30.2k|         std::string_view clean_view;
 2251|       |
 2252|  30.2k|         if (has_underscores) {
  ------------------
  |  Branch (2252:14): [True: 1.60k, False: 28.6k]
  ------------------
 2253|  1.60k|            clean_storage.reserve(num_str.size());
 2254|  1.76M|            for (char c : num_str) {
  ------------------
  |  Branch (2254:25): [True: 1.76M, False: 1.60k]
  ------------------
 2255|  1.76M|               if (c != '_') {
  ------------------
  |  Branch (2255:20): [True: 1.76M, False: 2.90k]
  ------------------
 2256|  1.76M|                  clean_storage.push_back(c);
 2257|  1.76M|               }
 2258|  1.76M|            }
 2259|  1.60k|            clean_view = clean_storage;
 2260|  1.60k|         }
 2261|  28.6k|         else {
 2262|  28.6k|            clean_view = num_str;
 2263|  28.6k|         }
 2264|       |
 2265|       |         // YAML allows leading '+' for positive numbers, but C++ from_chars doesn't
 2266|       |         // Strip leading '+' if present
 2267|  30.2k|         auto parse_view = clean_view;
 2268|  30.2k|         if (!parse_view.empty() && parse_view.front() == '+') {
  ------------------
  |  Branch (2268:14): [True: 22.2k, False: 7.98k]
  |  Branch (2268:37): [True: 2.60k, False: 19.6k]
  ------------------
 2269|  2.60k|            parse_view.remove_prefix(1);
 2270|  2.60k|            if (parse_view.empty()) {
  ------------------
  |  Branch (2270:17): [True: 511, False: 2.09k]
  ------------------
 2271|    511|               ctx.error = error_code::parse_number_failure;
 2272|    511|               return;
 2273|    511|            }
 2274|  2.60k|         }
 2275|       |
 2276|  29.7k|         if constexpr (std::floating_point<std::remove_cvref_t<T>>) {
 2277|  29.7k|            auto result = glz::fast_float::from_chars(parse_view.data(), parse_view.data() + parse_view.size(), value);
 2278|       |            // Check both for errors and that all input was consumed (e.g., "12:30" is not a valid number)
 2279|  29.7k|            if (result.ec != std::errc{} || result.ptr != parse_view.data() + parse_view.size()) {
  ------------------
  |  Branch (2279:17): [True: 15.1k, False: 14.6k]
  |  Branch (2279:45): [True: 8.36k, False: 6.26k]
  ------------------
 2280|  15.5k|               ctx.error = error_code::parse_number_failure;
 2281|  15.5k|            }
 2282|       |         }
 2283|       |         else {
 2284|       |            auto [ptr, ec] = std::from_chars(parse_view.data(), parse_view.data() + parse_view.size(), value);
 2285|       |            // Check both for errors and that all input was consumed
 2286|       |            if (ec != std::errc{} || ptr != parse_view.data() + parse_view.size()) {
 2287|       |               ctx.error = error_code::parse_number_failure;
 2288|       |            }
 2289|       |         }
 2290|       |
 2291|  29.7k|         finalize();
 2292|  29.7k|      }
_ZN3glz4yaml19parse_node_preambleITnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1EEEXtlNS0_20node_property_policyELb1EEELb0ERdNS0_12yaml_contextEPKcS7_ZNS_4fromILj450EdE2opITnDaXtlS2_Lj450ELb0ELb0ELb1ELb1EEERS7_S4_TkNS_10is_contextERS5_S7_EEvOT1_OT2_OT0_T3_EUlNS0_8yaml_tagEE_EEbSG_RSJ_RT4_T5_RNS0_19node_preamble_stateEOT6_:
  465|  36.0k|      {
  466|  36.0k|         skip_inline_ws(it, end);
  467|       |
  468|  36.0k|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (468:14): [True: 210, False: 35.8k]
  ------------------
  469|    210|            if constexpr (!AllowEmptyInput) {
  470|    210|               ctx.error = error_code::unexpected_end;
  471|    210|            }
  472|    210|            return true;
  473|    210|         }
  474|       |
  475|  35.8k|         preamble.tag = parse_yaml_tag(it, end, ctx);
  476|  35.8k|         if (preamble.tag == yaml_tag::unknown) [[unlikely]] {
  ------------------
  |  Branch (476:14): [True: 333, False: 35.5k]
  ------------------
  477|    333|            ctx.error = error_code::syntax_error;
  478|    333|            return true;
  479|    333|         }
  480|  35.5k|         if (!tag_validator(preamble.tag)) [[unlikely]] {
  ------------------
  |  Branch (480:14): [True: 112, False: 35.3k]
  ------------------
  481|    112|            ctx.error = error_code::syntax_error;
  482|    112|            return true;
  483|    112|         }
  484|       |
  485|  35.3k|         skip_inline_ws(it, end);
  486|       |
  487|  35.3k|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (487:14): [True: 93, False: 35.3k]
  ------------------
  488|     93|            if constexpr (!AllowEmptyInput) {
  489|     93|               ctx.error = error_code::unexpected_end;
  490|     93|            }
  491|     93|            return true;
  492|     93|         }
  493|       |
  494|  35.3k|         if (parse_node_properties<Opts, PropertyPolicy>(std::forward<T>(value), ctx, it, end, preamble.node_props)) {
  ------------------
  |  Branch (494:14): [True: 3.89k, False: 31.4k]
  ------------------
  495|  3.89k|            return true;
  496|  3.89k|         }
  497|       |
  498|  31.4k|         return false;
  499|  35.3k|      }
_ZZN3glz4fromILj450EdE2opITnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1EEERPKcRdTkNS_10is_contextERNS_4yaml12yaml_contextES5_EEvOT1_OT2_OT0_T3_ENKUlNS8_8yaml_tagEE_clESI_:
 2052|  35.5k|         if (yaml::parse_node_preamble<Opts>(value, ctx, it, end, preamble, [](yaml::yaml_tag tag) {
 2053|  35.5k|                if constexpr (std::floating_point<std::remove_cvref_t<T>>) {
 2054|  35.5k|                   return yaml::tag_valid_for_float(tag);
 2055|       |                }
 2056|       |                else {
 2057|       |                   return yaml::tag_valid_for_int(tag);
 2058|       |                }
 2059|  35.5k|             }))
_ZN3glz4yaml21parse_node_propertiesITnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1EEEXtlNS0_20node_property_policyELb1EEERdNS0_12yaml_contextEPKcS7_EEbOT1_RT2_RT3_T4_RNS0_19node_property_stateE:
  408|  35.3k|      {
  409|  35.3k|         state.has_anchor = false;
  410|  35.3k|         state.anchor_name.clear();
  411|  35.3k|         state.anchor_start = nullptr;
  412|  35.3k|         state.anchor_indent = ctx.current_indent();
  413|       |
  414|  35.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|  35.3k|            else {
  421|  35.3k|               if (handle_alias<Opts>(std::forward<T>(value), ctx, it, end)) return true;
  ------------------
  |  Branch (421:20): [True: 3.41k, False: 31.8k]
  ------------------
  422|  35.3k|            }
  423|  35.3k|         }
  424|       |
  425|  35.3k|         if (it != end && *it == '&') {
  ------------------
  |  Branch (425:14): [True: 31.8k, False: 3.41k]
  |  Branch (425:27): [True: 3.05k, False: 28.8k]
  ------------------
  426|  3.05k|            ++it;
  427|  3.05k|            auto name = parse_anchor_name(it, end);
  428|  3.05k|            if (name.empty()) {
  ------------------
  |  Branch (428:17): [True: 221, False: 2.82k]
  ------------------
  429|    221|               ctx.error = error_code::syntax_error;
  430|    221|               return true;
  431|    221|            }
  432|  2.82k|            skip_inline_ws(it, end);
  433|  2.82k|            if (it == end) {
  ------------------
  |  Branch (433:17): [True: 260, False: 2.56k]
  ------------------
  434|    260|               if constexpr (!Policy.allow_empty_after_anchor) {
  435|    260|                  ctx.error = error_code::unexpected_end;
  436|    260|               }
  437|    260|               return true;
  438|    260|            }
  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.56k|            state.has_anchor = true;
  446|  2.56k|            state.anchor_name = std::string(name);
  447|  2.56k|            state.anchor_start = &*it;
  448|  2.56k|         }
  449|       |
  450|  34.8k|         return false;
  451|  35.3k|      }
_ZN3glz4yaml12handle_aliasITnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1EEERdNS0_12yaml_contextEPKcS6_EEbOT0_RT1_RT2_T3_:
  300|  35.3k|      {
  301|  35.3k|         if (it == end || *it != '*') return false;
  ------------------
  |  Branch (301:14): [True: 0, False: 35.3k]
  |  Branch (301:27): [True: 31.8k, False: 3.41k]
  ------------------
  302|       |
  303|  3.41k|         ++it; // skip '*'
  304|  3.41k|         auto name = parse_anchor_name(it, end);
  305|  3.41k|         if (name.empty()) {
  ------------------
  |  Branch (305:14): [True: 245, False: 3.17k]
  ------------------
  306|    245|            ctx.error = error_code::syntax_error;
  307|    245|            return true;
  308|    245|         }
  309|       |
  310|  3.17k|         auto anchor_it = ctx.anchors.find(name);
  311|  3.17k|         if (anchor_it == ctx.anchors.end()) {
  ------------------
  |  Branch (311:14): [True: 532, False: 2.63k]
  ------------------
  312|    532|            ctx.error = error_code::syntax_error; // undefined alias
  313|    532|            return true;
  314|    532|         }
  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.63k|         const auto span = anchor_it->second;
  319|       |
  320|       |         // Empty anchor span (anchor on null/empty node) — leave value as default
  321|  2.63k|         if (span.begin == span.end) {
  ------------------
  |  Branch (321:14): [True: 73, False: 2.56k]
  ------------------
  322|     73|            return true;
  323|     73|         }
  324|       |
  325|       |         // An anchor is invisible to itself while it expands. A span that aliases the name it
  326|       |         // defines -- reachable because a mapping key's anchor is registered over the key text
  327|       |         // before that text is parsed -- would otherwise replay itself forever.
  328|  2.56k|         if (ctx.alias_span_is_replaying(span.begin, span.end)) [[unlikely]] {
  ------------------
  |  Branch (328:14): [True: 90, False: 2.47k]
  ------------------
  329|     90|            ctx.error = error_code::syntax_error; // cyclic alias
  330|     90|            return true;
  331|     90|         }
  332|       |
  333|       |         // Replaying an anchor re-enters the reader directly, bypassing the variant reader's
  334|       |         // depth guard, so this is the only depth accounting a chain of aliases into a
  335|       |         // non-variant target gets. The cycle check above stops the unbounded case; this bounds
  336|       |         // a legitimate but deeply chained one.
  337|  2.47k|         depth_guard guard{ctx, yaml::max_yaml_recursive_depth};
  338|  2.47k|         if (!guard) [[unlikely]]
  ------------------
  |  Branch (338:14): [True: 1, False: 2.47k]
  ------------------
  339|      1|            return true;
  340|       |
  341|  2.47k|         if (!ctx.charge_alias_expansion(static_cast<size_t>(span.end - span.begin))) [[unlikely]] {
  ------------------
  |  Branch (341:14): [True: 0, False: 2.47k]
  ------------------
  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.47k|         auto replay_it = span.begin;
  348|  2.47k|         auto replay_end = span.end;
  349|       |
  350|       |         // Save indent context and set up for replay
  351|  2.47k|         auto saved_indent_stack = std::move(ctx.indent_stack);
  352|  2.47k|         ctx.indent_stack.clear();
  353|  2.47k|         if (span.base_indent > 0) {
  ------------------
  |  Branch (353:14): [True: 2.24k, False: 225]
  ------------------
  354|  2.24k|            ctx.push_indent(span.base_indent - 1);
  355|  2.24k|         }
  356|       |
  357|  2.47k|         ctx.active_alias_spans.emplace_back(span.begin, span.end);
  358|       |
  359|  2.47k|         using V = std::remove_cvref_t<T>;
  360|  2.47k|         from<YAML, V>::template op<Opts>(std::forward<T>(value), ctx, replay_it, replay_end);
  361|       |
  362|  2.47k|         ctx.active_alias_spans.pop_back();
  363|       |
  364|       |         // Restore indent context
  365|  2.47k|         ctx.indent_stack = std::move(saved_indent_stack);
  366|  2.47k|         return true;
  367|  2.47k|      }
_ZZN3glz4fromILj450EdE2opITnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1EEERPKcRdTkNS_10is_contextERNS_4yaml12yaml_contextES5_EEvOT1_OT2_OT0_T3_ENKUlvE_clEv:
 2062|  29.7k|         auto finalize = [&] { yaml::finalize_node_anchor(preamble.node_props, ctx, it); };
_ZN3glz33process_yaml_variant_alternativesINSt3__17variantIJDndNS1_12basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEbNS1_6vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS6_ISD_EEEENSC_ISD_EEEEENS_20is_yaml_variant_boolEE2opITnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1EEERSH_TkNS_10is_contextERNS_4yaml12yaml_contextERPKcSR_EEvOT0_OT1_OT2_T3_:
 5205|  10.8k|      {
 5206|  10.8k|         constexpr auto category_count = yaml_variant_count_v<Variant, Trait>;
 5207|       |
 5208|       |         if constexpr (category_count == 0) {
 5209|       |            ctx.error = error_code::no_matching_variant_type;
 5210|       |         }
 5211|  10.8k|         else if constexpr (category_count == 1) {
 5212|       |            // Only one type in this category, use it directly
 5213|  10.8k|            constexpr auto first_idx = yaml_variant_first_index_v<Variant, Trait>;
 5214|  10.8k|            using V = std::variant_alternative_t<first_idx, Variant>;
 5215|  10.8k|            if (!std::holds_alternative<V>(value)) value = V{};
  ------------------
  |  Branch (5215:17): [True: 10.8k, False: 0]
  ------------------
 5216|  10.8k|            from<YAML, V>::template op<Opts>(std::get<V>(value), ctx, it, end);
 5217|       |         }
 5218|       |         else {
 5219|       |            // Multiple types in this category, try each one
 5220|       |            constexpr auto N = std::variant_size_v<Variant>;
 5221|       |            bool found_match{};
 5222|       |            size_t match_idx = 0;
 5223|       |            // Only the last alternative propagates its error, so an alternative that exhausted an
 5224|       |            // expansion budget would otherwise be reported as no_matching_variant_type -- a wrong
 5225|       |            // diagnosis for a document that is hostile rather than merely the wrong shape. Held
 5226|       |            // aside and used only if nothing matched, so an alternative that does succeed later
 5227|       |            // (one that materializes no key text can still parse under a latched budget) is
 5228|       |            // unaffected.
 5229|       |            error_code expansion_error{};
 5230|       |            std::string_view expansion_message{};
 5231|       |
 5232|       |            for_each<N>([&]<size_t I>() {
 5233|       |               if (found_match) {
 5234|       |                  return;
 5235|       |               }
 5236|       |               using V = std::variant_alternative_t<I, Variant>;
 5237|       |               if constexpr (Trait<V>::value) {
 5238|       |                  auto copy_it = it;
 5239|       |                  if (!std::holds_alternative<V>(value)) {
 5240|       |                     value = V{};
 5241|       |                  }
 5242|       |
 5243|       |                  auto temp_ctx = ctx.make_speculative();
 5244|       |                  from<YAML, V>::template op<Opts>(std::get<V>(value), temp_ctx, it, end);
 5245|       |
 5246|       |                  // Charged whether or not the alternative fit: a rejected probe still replayed
 5247|       |                  // whatever aliases it reached, and an attempt that is never billed is an
 5248|       |                  // attempt that can be repeated for free.
 5249|       |                  ctx.alias_expansion_budget = temp_ctx.alias_expansion_budget;
 5250|       |                  ctx.key_expansion_budget = temp_ctx.key_expansion_budget;
 5251|       |
 5252|       |                  if (!bool(temp_ctx.error)) {
 5253|       |                     found_match = true;
 5254|       |                     ctx.anchors = std::move(temp_ctx.anchors);
 5255|       |                  }
 5256|       |                  else {
 5257|       |                     it = copy_it;
 5258|       |                     if (temp_ctx.error == error_code::exceeded_max_expansion && expansion_error == error_code::none) {
 5259|       |                        expansion_error = temp_ctx.error;
 5260|       |                        expansion_message = temp_ctx.custom_error_message;
 5261|       |                     }
 5262|       |                     if (match_idx + 1 < category_count) {
 5263|       |                        // Not the last type, continue trying
 5264|       |                     }
 5265|       |                     else {
 5266|       |                        // Last type failed, propagate error
 5267|       |                        ctx.error = temp_ctx.error;
 5268|       |                        ctx.custom_error_message = temp_ctx.custom_error_message;
 5269|       |                     }
 5270|       |                  }
 5271|       |                  ++match_idx;
 5272|       |               }
 5273|       |            });
 5274|       |
 5275|       |            if (!found_match && !bool(ctx.error)) {
 5276|       |               if (expansion_error != error_code::none) {
 5277|       |                  ctx.error = expansion_error;
 5278|       |                  ctx.custom_error_message = expansion_message;
 5279|       |               }
 5280|       |               else {
 5281|       |                  ctx.error = error_code::no_matching_variant_type;
 5282|       |               }
 5283|       |            }
 5284|       |         }
 5285|  10.8k|      }
_ZN3glz4fromILj450EbE2opITnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1EEERPKcRbTkNS_10is_contextERNS_4yaml12yaml_contextES5_EEvOT1_OT2_OT0_T3_:
 2012|  11.2k|      {
 2013|  11.2k|         if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2013:14): [True: 0, False: 11.2k]
  ------------------
 2014|      0|            return;
 2015|       |
 2016|  11.2k|         yaml::node_preamble_state preamble{};
 2017|  11.2k|         if (yaml::parse_node_preamble<Opts>(value, ctx, it, end, preamble,
  ------------------
  |  Branch (2017:14): [True: 1.04k, False: 10.1k]
  ------------------
 2018|  11.2k|                                             [](yaml::yaml_tag tag) { return yaml::tag_valid_for_bool(tag); }))
 2019|  1.04k|            return;
 2020|       |
 2021|       |         // Parse as plain scalar first
 2022|  10.1k|         std::string str;
 2023|  10.1k|         yaml::parse_plain_scalar(str, ctx, it, end, yaml::check_flow_context(Opts));
 2024|       |
 2025|  10.1k|         if (str == "true" || str == "True" || str == "TRUE" || str == "yes" || str == "Yes" || str == "YES" ||
  ------------------
  |  Branch (2025:14): [True: 1.93k, False: 8.24k]
  |  Branch (2025:31): [True: 1.88k, False: 6.36k]
  |  Branch (2025:48): [True: 332, False: 6.03k]
  |  Branch (2025:65): [True: 251, False: 5.77k]
  |  Branch (2025:81): [True: 140, False: 5.63k]
  |  Branch (2025:97): [True: 2, False: 5.63k]
  ------------------
 2026|  5.65k|             str == "on" || str == "On" || str == "ON") {
  ------------------
  |  Branch (2026:14): [True: 453, False: 5.18k]
  |  Branch (2026:29): [True: 263, False: 4.92k]
  |  Branch (2026:44): [True: 393, False: 4.52k]
  ------------------
 2027|  5.65k|            value = true;
 2028|  5.65k|         }
 2029|  4.52k|         else if (str == "false" || str == "False" || str == "FALSE" || str == "no" || str == "No" || str == "NO" ||
  ------------------
  |  Branch (2029:19): [True: 673, False: 3.85k]
  |  Branch (2029:37): [True: 162, False: 3.69k]
  |  Branch (2029:55): [True: 847, False: 2.84k]
  |  Branch (2029:73): [True: 2.07k, False: 770]
  |  Branch (2029:88): [True: 279, False: 491]
  |  Branch (2029:103): [True: 152, False: 339]
  ------------------
 2030|  4.36k|                  str == "off" || str == "Off" || str == "OFF") {
  ------------------
  |  Branch (2030:19): [True: 94, False: 245]
  |  Branch (2030:35): [True: 38, False: 207]
  |  Branch (2030:51): [True: 41, False: 166]
  ------------------
 2031|  4.36k|            value = false;
 2032|  4.36k|         }
 2033|    166|         else {
 2034|    166|            ctx.error = error_code::expected_true_or_false;
 2035|    166|         }
 2036|       |
 2037|  10.1k|         yaml::finalize_node_anchor(preamble.node_props, ctx, it);
 2038|  10.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|  11.2k|      {
  466|  11.2k|         skip_inline_ws(it, end);
  467|       |
  468|  11.2k|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (468:14): [True: 3, False: 11.2k]
  ------------------
  469|      3|            if constexpr (!AllowEmptyInput) {
  470|      3|               ctx.error = error_code::unexpected_end;
  471|      3|            }
  472|      3|            return true;
  473|      3|         }
  474|       |
  475|  11.2k|         preamble.tag = parse_yaml_tag(it, end, ctx);
  476|  11.2k|         if (preamble.tag == yaml_tag::unknown) [[unlikely]] {
  ------------------
  |  Branch (476:14): [True: 2, False: 11.2k]
  ------------------
  477|      2|            ctx.error = error_code::syntax_error;
  478|      2|            return true;
  479|      2|         }
  480|  11.2k|         if (!tag_validator(preamble.tag)) [[unlikely]] {
  ------------------
  |  Branch (480:14): [True: 1, False: 11.2k]
  ------------------
  481|      1|            ctx.error = error_code::syntax_error;
  482|      1|            return true;
  483|      1|         }
  484|       |
  485|  11.2k|         skip_inline_ws(it, end);
  486|       |
  487|  11.2k|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (487:14): [True: 2, False: 11.2k]
  ------------------
  488|      2|            if constexpr (!AllowEmptyInput) {
  489|      2|               ctx.error = error_code::unexpected_end;
  490|      2|            }
  491|      2|            return true;
  492|      2|         }
  493|       |
  494|  11.2k|         if (parse_node_properties<Opts, PropertyPolicy>(std::forward<T>(value), ctx, it, end, preamble.node_props)) {
  ------------------
  |  Branch (494:14): [True: 1.03k, False: 10.1k]
  ------------------
  495|  1.03k|            return true;
  496|  1.03k|         }
  497|       |
  498|  10.1k|         return false;
  499|  11.2k|      }
_ZZN3glz4fromILj450EbE2opITnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1EEERPKcRbTkNS_10is_contextERNS_4yaml12yaml_contextES5_EEvOT1_OT2_OT0_T3_ENKUlNS8_8yaml_tagEE_clESI_:
 2018|  11.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|  11.2k|      {
  409|  11.2k|         state.has_anchor = false;
  410|  11.2k|         state.anchor_name.clear();
  411|  11.2k|         state.anchor_start = nullptr;
  412|  11.2k|         state.anchor_indent = ctx.current_indent();
  413|       |
  414|  11.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|  11.2k|            else {
  421|  11.2k|               if (handle_alias<Opts>(std::forward<T>(value), ctx, it, end)) return true;
  ------------------
  |  Branch (421:20): [True: 1.01k, False: 10.2k]
  ------------------
  422|  11.2k|            }
  423|  11.2k|         }
  424|       |
  425|  11.2k|         if (it != end && *it == '&') {
  ------------------
  |  Branch (425:14): [True: 10.2k, False: 1.01k]
  |  Branch (425:27): [True: 2.53k, False: 7.66k]
  ------------------
  426|  2.53k|            ++it;
  427|  2.53k|            auto name = parse_anchor_name(it, end);
  428|  2.53k|            if (name.empty()) {
  ------------------
  |  Branch (428:17): [True: 4, False: 2.53k]
  ------------------
  429|      4|               ctx.error = error_code::syntax_error;
  430|      4|               return true;
  431|      4|            }
  432|  2.53k|            skip_inline_ws(it, end);
  433|  2.53k|            if (it == end) {
  ------------------
  |  Branch (433:17): [True: 13, False: 2.52k]
  ------------------
  434|     13|               if constexpr (!Policy.allow_empty_after_anchor) {
  435|     13|                  ctx.error = error_code::unexpected_end;
  436|     13|               }
  437|     13|               return true;
  438|     13|            }
  439|       |            if constexpr (Policy.disallow_anchor_on_alias) {
  440|       |               if (*it == '*') {
  441|       |                  ctx.error = error_code::syntax_error;
  442|       |                  return true;
  443|       |               }
  444|       |            }
  445|  2.52k|            state.has_anchor = true;
  446|  2.52k|            state.anchor_name = std::string(name);
  447|  2.52k|            state.anchor_start = &*it;
  448|  2.52k|         }
  449|       |
  450|  11.2k|         return false;
  451|  11.2k|      }
_ZN3glz4yaml12handle_aliasITnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1EEERbNS0_12yaml_contextEPKcS6_EEbOT0_RT1_RT2_T3_:
  300|  11.2k|      {
  301|  11.2k|         if (it == end || *it != '*') return false;
  ------------------
  |  Branch (301:14): [True: 0, False: 11.2k]
  |  Branch (301:27): [True: 10.2k, False: 1.01k]
  ------------------
  302|       |
  303|  1.01k|         ++it; // skip '*'
  304|  1.01k|         auto name = parse_anchor_name(it, end);
  305|  1.01k|         if (name.empty()) {
  ------------------
  |  Branch (305:14): [True: 3, False: 1.01k]
  ------------------
  306|      3|            ctx.error = error_code::syntax_error;
  307|      3|            return true;
  308|      3|         }
  309|       |
  310|  1.01k|         auto anchor_it = ctx.anchors.find(name);
  311|  1.01k|         if (anchor_it == ctx.anchors.end()) {
  ------------------
  |  Branch (311:14): [True: 20, False: 994]
  ------------------
  312|     20|            ctx.error = error_code::syntax_error; // undefined alias
  313|     20|            return true;
  314|     20|         }
  315|       |
  316|       |         // Copied rather than referenced: the replay below can replace ctx.anchors wholesale
  317|       |         // (a speculative parse hands its own map back), which would dangle a reference here.
  318|    994|         const auto span = anchor_it->second;
  319|       |
  320|       |         // Empty anchor span (anchor on null/empty node) — leave value as default
  321|    994|         if (span.begin == span.end) {
  ------------------
  |  Branch (321:14): [True: 586, False: 408]
  ------------------
  322|    586|            return true;
  323|    586|         }
  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|    408|         if (ctx.alias_span_is_replaying(span.begin, span.end)) [[unlikely]] {
  ------------------
  |  Branch (328:14): [True: 4, False: 404]
  ------------------
  329|      4|            ctx.error = error_code::syntax_error; // cyclic alias
  330|      4|            return true;
  331|      4|         }
  332|       |
  333|       |         // Replaying an anchor re-enters the reader directly, bypassing the variant reader's
  334|       |         // depth guard, so this is the only depth accounting a chain of aliases into a
  335|       |         // non-variant target gets. The cycle check above stops the unbounded case; this bounds
  336|       |         // a legitimate but deeply chained one.
  337|    404|         depth_guard guard{ctx, yaml::max_yaml_recursive_depth};
  338|    404|         if (!guard) [[unlikely]]
  ------------------
  |  Branch (338:14): [True: 1, False: 403]
  ------------------
  339|      1|            return true;
  340|       |
  341|    403|         if (!ctx.charge_alias_expansion(static_cast<size_t>(span.end - span.begin))) [[unlikely]] {
  ------------------
  |  Branch (341:14): [True: 0, False: 403]
  ------------------
  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|    403|         auto replay_it = span.begin;
  348|    403|         auto replay_end = span.end;
  349|       |
  350|       |         // Save indent context and set up for replay
  351|    403|         auto saved_indent_stack = std::move(ctx.indent_stack);
  352|    403|         ctx.indent_stack.clear();
  353|    403|         if (span.base_indent > 0) {
  ------------------
  |  Branch (353:14): [True: 376, False: 27]
  ------------------
  354|    376|            ctx.push_indent(span.base_indent - 1);
  355|    376|         }
  356|       |
  357|    403|         ctx.active_alias_spans.emplace_back(span.begin, span.end);
  358|       |
  359|    403|         using V = std::remove_cvref_t<T>;
  360|    403|         from<YAML, V>::template op<Opts>(std::forward<T>(value), ctx, replay_it, replay_end);
  361|       |
  362|    403|         ctx.active_alias_spans.pop_back();
  363|       |
  364|       |         // Restore indent context
  365|    403|         ctx.indent_stack = std::move(saved_indent_stack);
  366|    403|         return true;
  367|    403|      }
_ZN3glz4fromILj450EDnE2opITnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1EEERPKcRDnTkNS_10is_contextERNS_4yaml12yaml_contextES5_EEvOT1_OT2_OT0_T3_:
 2398|  3.63k|      {
 2399|  3.63k|         if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2399:14): [True: 0, False: 3.63k]
  ------------------
 2400|      0|            return;
 2401|       |
 2402|  3.63k|         yaml::skip_inline_ws(it, end);
 2403|       |
 2404|  3.63k|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (2404:14): [True: 16, False: 3.61k]
  ------------------
 2405|     16|            ctx.error = error_code::unexpected_end;
 2406|     16|            return;
 2407|     16|         }
 2408|       |
 2409|       |         // Check for null values: null, Null, NULL, ~
 2410|  3.61k|         if (*it == '~') {
  ------------------
  |  Branch (2410:14): [True: 391, False: 3.22k]
  ------------------
 2411|    391|            ++it;
 2412|    391|            return;
 2413|    391|         }
 2414|       |
 2415|       |         // Parse as plain scalar and check if it's a null keyword
 2416|  3.22k|         auto start = it;
 2417|  15.0k|         while (it != end && !yaml::plain_scalar_end_table[static_cast<uint8_t>(*it)]) {
  ------------------
  |  Branch (2417:17): [True: 14.6k, False: 415]
  |  Branch (2417:30): [True: 11.8k, False: 2.81k]
  ------------------
 2418|  11.8k|            ++it;
 2419|  11.8k|         }
 2420|       |
 2421|  3.22k|         std::string_view str{start, static_cast<size_t>(it - start)};
 2422|  3.22k|         if (!yaml::is_yaml_null(str)) {
  ------------------
  |  Branch (2422:14): [True: 25, False: 3.20k]
  ------------------
 2423|     25|            ctx.error = error_code::syntax_error;
 2424|     25|         }
 2425|  3.22k|      }
_ZN3glz33process_yaml_variant_alternativesINSt3__17variantIJDndNS1_12basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEbNS1_6vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS6_ISD_EEEENSC_ISD_EEEEENS_21is_yaml_variant_arrayEE2opITnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1EEERSH_TkNS_10is_contextERNS_4yaml12yaml_contextERPKcSR_EEvOT0_OT1_OT2_T3_:
 5205|  83.0k|      {
 5206|  83.0k|         constexpr auto category_count = yaml_variant_count_v<Variant, Trait>;
 5207|       |
 5208|       |         if constexpr (category_count == 0) {
 5209|       |            ctx.error = error_code::no_matching_variant_type;
 5210|       |         }
 5211|  83.0k|         else if constexpr (category_count == 1) {
 5212|       |            // Only one type in this category, use it directly
 5213|  83.0k|            constexpr auto first_idx = yaml_variant_first_index_v<Variant, Trait>;
 5214|  83.0k|            using V = std::variant_alternative_t<first_idx, Variant>;
 5215|  83.0k|            if (!std::holds_alternative<V>(value)) value = V{};
  ------------------
  |  Branch (5215:17): [True: 83.0k, False: 0]
  ------------------
 5216|  83.0k|            from<YAML, V>::template op<Opts>(std::get<V>(value), ctx, it, end);
 5217|       |         }
 5218|       |         else {
 5219|       |            // Multiple types in this category, try each one
 5220|       |            constexpr auto N = std::variant_size_v<Variant>;
 5221|       |            bool found_match{};
 5222|       |            size_t match_idx = 0;
 5223|       |            // Only the last alternative propagates its error, so an alternative that exhausted an
 5224|       |            // expansion budget would otherwise be reported as no_matching_variant_type -- a wrong
 5225|       |            // diagnosis for a document that is hostile rather than merely the wrong shape. Held
 5226|       |            // aside and used only if nothing matched, so an alternative that does succeed later
 5227|       |            // (one that materializes no key text can still parse under a latched budget) is
 5228|       |            // unaffected.
 5229|       |            error_code expansion_error{};
 5230|       |            std::string_view expansion_message{};
 5231|       |
 5232|       |            for_each<N>([&]<size_t I>() {
 5233|       |               if (found_match) {
 5234|       |                  return;
 5235|       |               }
 5236|       |               using V = std::variant_alternative_t<I, Variant>;
 5237|       |               if constexpr (Trait<V>::value) {
 5238|       |                  auto copy_it = it;
 5239|       |                  if (!std::holds_alternative<V>(value)) {
 5240|       |                     value = V{};
 5241|       |                  }
 5242|       |
 5243|       |                  auto temp_ctx = ctx.make_speculative();
 5244|       |                  from<YAML, V>::template op<Opts>(std::get<V>(value), temp_ctx, it, end);
 5245|       |
 5246|       |                  // Charged whether or not the alternative fit: a rejected probe still replayed
 5247|       |                  // whatever aliases it reached, and an attempt that is never billed is an
 5248|       |                  // attempt that can be repeated for free.
 5249|       |                  ctx.alias_expansion_budget = temp_ctx.alias_expansion_budget;
 5250|       |                  ctx.key_expansion_budget = temp_ctx.key_expansion_budget;
 5251|       |
 5252|       |                  if (!bool(temp_ctx.error)) {
 5253|       |                     found_match = true;
 5254|       |                     ctx.anchors = std::move(temp_ctx.anchors);
 5255|       |                  }
 5256|       |                  else {
 5257|       |                     it = copy_it;
 5258|       |                     if (temp_ctx.error == error_code::exceeded_max_expansion && expansion_error == error_code::none) {
 5259|       |                        expansion_error = temp_ctx.error;
 5260|       |                        expansion_message = temp_ctx.custom_error_message;
 5261|       |                     }
 5262|       |                     if (match_idx + 1 < category_count) {
 5263|       |                        // Not the last type, continue trying
 5264|       |                     }
 5265|       |                     else {
 5266|       |                        // Last type failed, propagate error
 5267|       |                        ctx.error = temp_ctx.error;
 5268|       |                        ctx.custom_error_message = temp_ctx.custom_error_message;
 5269|       |                     }
 5270|       |                  }
 5271|       |                  ++match_idx;
 5272|       |               }
 5273|       |            });
 5274|       |
 5275|       |            if (!found_match && !bool(ctx.error)) {
 5276|       |               if (expansion_error != error_code::none) {
 5277|       |                  ctx.error = expansion_error;
 5278|       |                  ctx.custom_error_message = expansion_message;
 5279|       |               }
 5280|       |               else {
 5281|       |                  ctx.error = error_code::no_matching_variant_type;
 5282|       |               }
 5283|       |            }
 5284|       |         }
 5285|  83.0k|      }
_ZN3glz4fromILj450ENSt3__16vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS1_9allocatorIS6_EEEEE2opITnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1EEERPKcRS9_TkNS_10is_contextERNS_4yaml12yaml_contextESE_EEvOT1_OT2_OT0_T3_:
 4098|  86.4k|      {
 4099|  86.4k|         if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4099:14): [True: 0, False: 86.4k]
  ------------------
 4100|      0|            return;
 4101|       |
 4102|       |         // Peek ahead to check for tag (don't consume indentation for block sequences)
 4103|  86.4k|         auto peek = it;
 4104|  86.4k|         yaml::node_preamble_state preamble{};
 4105|  86.4k|         if (yaml::parse_node_preamble<Opts>(value, ctx, peek, end, preamble,
  ------------------
  |  Branch (4105:14): [True: 3.71k, False: 82.7k]
  ------------------
 4106|  86.4k|                                             [](yaml::yaml_tag tag) { return yaml::tag_valid_for_seq(tag); })) {
 4107|  3.71k|            it = peek;
 4108|  3.71k|            return;
 4109|  3.71k|         }
 4110|       |
 4111|  82.7k|         if (*peek == '[') {
  ------------------
  |  Branch (4111:14): [True: 32.0k, False: 50.6k]
  ------------------
 4112|       |            // Flow sequence - consume whitespace and parse
 4113|  32.0k|            it = peek;
 4114|  32.0k|            yaml::parse_flow_sequence<Opts>(value, ctx, it, end);
 4115|  32.0k|         }
 4116|  50.6k|         else if (*peek == '-') {
  ------------------
  |  Branch (4116:19): [True: 50.6k, False: 87]
  ------------------
 4117|       |            // Block sequence - don't consume leading whitespace, let parse_block_sequence handle it
 4118|       |            // But if there was a tag, we need to advance past it
 4119|  50.6k|            if (preamble.tag != yaml::yaml_tag::none || preamble.node_props.has_anchor) {
  ------------------
  |  Branch (4119:17): [True: 78, False: 50.5k]
  |  Branch (4119:57): [True: 2.49k, False: 48.0k]
  ------------------
 4120|  2.56k|               it = peek;
 4121|  2.56k|            }
 4122|  50.6k|            int32_t seq_indent = ctx.current_indent();
 4123|  50.6k|            if (*it == '-' && ctx.current_indent() >= 0) {
  ------------------
  |  Branch (4123:17): [True: 50.3k, False: 251]
  |  Branch (4123:31): [True: 43.7k, False: 6.65k]
  ------------------
 4124|  43.7k|               seq_indent = ctx.allow_indentless_sequence ? (ctx.current_indent() > 0 ? (ctx.current_indent() - 1) : 0)
  ------------------
  |  Branch (4124:29): [True: 28.8k, False: 14.8k]
  |  Branch (4124:62): [True: 15.8k, False: 13.0k]
  ------------------
 4125|  43.7k|                                                          : (ctx.current_indent() + 1);
 4126|  43.7k|            }
 4127|  50.6k|            yaml::parse_block_sequence<Opts>(value, ctx, it, end, seq_indent);
 4128|  50.6k|         }
 4129|     87|         else {
 4130|     87|            ctx.error = error_code::syntax_error;
 4131|     87|         }
 4132|       |
 4133|  82.7k|         yaml::finalize_node_anchor(preamble.node_props, ctx, it);
 4134|  82.7k|      }
_ZN3glz4yaml19parse_node_preambleITnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1EEEXtlNS0_20node_property_policyELb1EEELb0ERNSt3__16vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS4_9allocatorIS9_EEEENS0_12yaml_contextEPKcSG_ZNS_4fromILj450ESC_E2opITnDaXtlS2_Lj450ELb0ELb0ELb1ELb1EEERSG_SD_TkNS_10is_contextERSE_SG_EEvOT1_OT2_OT0_T3_EUlNS0_8yaml_tagEE_EEbSP_RSS_RT4_T5_RNS0_19node_preamble_stateEOT6_:
  465|  86.4k|      {
  466|  86.4k|         skip_inline_ws(it, end);
  467|       |
  468|  86.4k|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (468:14): [True: 8, False: 86.4k]
  ------------------
  469|      8|            if constexpr (!AllowEmptyInput) {
  470|      8|               ctx.error = error_code::unexpected_end;
  471|      8|            }
  472|      8|            return true;
  473|      8|         }
  474|       |
  475|  86.4k|         preamble.tag = parse_yaml_tag(it, end, ctx);
  476|  86.4k|         if (preamble.tag == yaml_tag::unknown) [[unlikely]] {
  ------------------
  |  Branch (476:14): [True: 2, False: 86.4k]
  ------------------
  477|      2|            ctx.error = error_code::syntax_error;
  478|      2|            return true;
  479|      2|         }
  480|  86.4k|         if (!tag_validator(preamble.tag)) [[unlikely]] {
  ------------------
  |  Branch (480:14): [True: 2, False: 86.4k]
  ------------------
  481|      2|            ctx.error = error_code::syntax_error;
  482|      2|            return true;
  483|      2|         }
  484|       |
  485|  86.4k|         skip_inline_ws(it, end);
  486|       |
  487|  86.4k|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (487:14): [True: 2, False: 86.4k]
  ------------------
  488|      2|            if constexpr (!AllowEmptyInput) {
  489|      2|               ctx.error = error_code::unexpected_end;
  490|      2|            }
  491|      2|            return true;
  492|      2|         }
  493|       |
  494|  86.4k|         if (parse_node_properties<Opts, PropertyPolicy>(std::forward<T>(value), ctx, it, end, preamble.node_props)) {
  ------------------
  |  Branch (494:14): [True: 3.70k, False: 82.7k]
  ------------------
  495|  3.70k|            return true;
  496|  3.70k|         }
  497|       |
  498|  82.7k|         return false;
  499|  86.4k|      }
_ZZN3glz4fromILj450ENSt3__16vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS1_9allocatorIS6_EEEEE2opITnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1EEERPKcRS9_TkNS_10is_contextERNS_4yaml12yaml_contextESE_EEvOT1_OT2_OT0_T3_ENKUlNSH_8yaml_tagEE_clESR_:
 4106|  86.4k|                                             [](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|  86.4k|      {
  409|  86.4k|         state.has_anchor = false;
  410|  86.4k|         state.anchor_name.clear();
  411|  86.4k|         state.anchor_start = nullptr;
  412|  86.4k|         state.anchor_indent = ctx.current_indent();
  413|       |
  414|  86.4k|         if constexpr (Policy.allow_alias) {
  415|       |            if constexpr (Policy.alias_can_be_mapping_key) {
  416|       |               if (!alias_token_is_mapping_key(it, end)) {
  417|       |                  if (handle_alias<Opts>(std::forward<T>(value), ctx, it, end)) return true;
  418|       |               }
  419|       |            }
  420|  86.4k|            else {
  421|  86.4k|               if (handle_alias<Opts>(std::forward<T>(value), ctx, it, end)) return true;
  ------------------
  |  Branch (421:20): [True: 3.67k, False: 82.7k]
  ------------------
  422|  86.4k|            }
  423|  86.4k|         }
  424|       |
  425|  86.4k|         if (it != end && *it == '&') {
  ------------------
  |  Branch (425:14): [True: 82.7k, False: 3.67k]
  |  Branch (425:27): [True: 2.92k, False: 79.8k]
  ------------------
  426|  2.92k|            ++it;
  427|  2.92k|            auto name = parse_anchor_name(it, end);
  428|  2.92k|            if (name.empty()) {
  ------------------
  |  Branch (428:17): [True: 10, False: 2.91k]
  ------------------
  429|     10|               ctx.error = error_code::syntax_error;
  430|     10|               return true;
  431|     10|            }
  432|  2.91k|            skip_inline_ws(it, end);
  433|  2.91k|            if (it == end) {
  ------------------
  |  Branch (433:17): [True: 16, False: 2.89k]
  ------------------
  434|     16|               if constexpr (!Policy.allow_empty_after_anchor) {
  435|     16|                  ctx.error = error_code::unexpected_end;
  436|     16|               }
  437|     16|               return true;
  438|     16|            }
  439|       |            if constexpr (Policy.disallow_anchor_on_alias) {
  440|       |               if (*it == '*') {
  441|       |                  ctx.error = error_code::syntax_error;
  442|       |                  return true;
  443|       |               }
  444|       |            }
  445|  2.89k|            state.has_anchor = true;
  446|  2.89k|            state.anchor_name = std::string(name);
  447|  2.89k|            state.anchor_start = &*it;
  448|  2.89k|         }
  449|       |
  450|  86.3k|         return false;
  451|  86.4k|      }
_ZN3glz4yaml12handle_aliasITnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1EEERNSt3__16vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS3_9allocatorIS8_EEEENS0_12yaml_contextEPKcSF_EEbOT0_RT1_RT2_T3_:
  300|  86.4k|      {
  301|  86.4k|         if (it == end || *it != '*') return false;
  ------------------
  |  Branch (301:14): [True: 0, False: 86.4k]
  |  Branch (301:27): [True: 82.7k, False: 3.67k]
  ------------------
  302|       |
  303|  3.67k|         ++it; // skip '*'
  304|  3.67k|         auto name = parse_anchor_name(it, end);
  305|  3.67k|         if (name.empty()) {
  ------------------
  |  Branch (305:14): [True: 3, False: 3.67k]
  ------------------
  306|      3|            ctx.error = error_code::syntax_error;
  307|      3|            return true;
  308|      3|         }
  309|       |
  310|  3.67k|         auto anchor_it = ctx.anchors.find(name);
  311|  3.67k|         if (anchor_it == ctx.anchors.end()) {
  ------------------
  |  Branch (311:14): [True: 21, False: 3.65k]
  ------------------
  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|  3.65k|         const auto span = anchor_it->second;
  319|       |
  320|       |         // Empty anchor span (anchor on null/empty node) — leave value as default
  321|  3.65k|         if (span.begin == span.end) {
  ------------------
  |  Branch (321:14): [True: 297, False: 3.35k]
  ------------------
  322|    297|            return true;
  323|    297|         }
  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.35k|         if (ctx.alias_span_is_replaying(span.begin, span.end)) [[unlikely]] {
  ------------------
  |  Branch (328:14): [True: 1, False: 3.35k]
  ------------------
  329|      1|            ctx.error = error_code::syntax_error; // cyclic alias
  330|      1|            return true;
  331|      1|         }
  332|       |
  333|       |         // Replaying an anchor re-enters the reader directly, bypassing the variant reader's
  334|       |         // depth guard, so this is the only depth accounting a chain of aliases into a
  335|       |         // non-variant target gets. The cycle check above stops the unbounded case; this bounds
  336|       |         // a legitimate but deeply chained one.
  337|  3.35k|         depth_guard guard{ctx, yaml::max_yaml_recursive_depth};
  338|  3.35k|         if (!guard) [[unlikely]]
  ------------------
  |  Branch (338:14): [True: 0, False: 3.35k]
  ------------------
  339|      0|            return true;
  340|       |
  341|  3.35k|         if (!ctx.charge_alias_expansion(static_cast<size_t>(span.end - span.begin))) [[unlikely]] {
  ------------------
  |  Branch (341:14): [True: 0, False: 3.35k]
  ------------------
  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.35k|         auto replay_it = span.begin;
  348|  3.35k|         auto replay_end = span.end;
  349|       |
  350|       |         // Save indent context and set up for replay
  351|  3.35k|         auto saved_indent_stack = std::move(ctx.indent_stack);
  352|  3.35k|         ctx.indent_stack.clear();
  353|  3.35k|         if (span.base_indent > 0) {
  ------------------
  |  Branch (353:14): [True: 2.65k, False: 703]
  ------------------
  354|  2.65k|            ctx.push_indent(span.base_indent - 1);
  355|  2.65k|         }
  356|       |
  357|  3.35k|         ctx.active_alias_spans.emplace_back(span.begin, span.end);
  358|       |
  359|  3.35k|         using V = std::remove_cvref_t<T>;
  360|  3.35k|         from<YAML, V>::template op<Opts>(std::forward<T>(value), ctx, replay_it, replay_end);
  361|       |
  362|  3.35k|         ctx.active_alias_spans.pop_back();
  363|       |
  364|       |         // Restore indent context
  365|  3.35k|         ctx.indent_stack = std::move(saved_indent_stack);
  366|  3.35k|         return true;
  367|  3.35k|      }
_ZN3glz4yaml19parse_flow_sequenceITnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1EEERNSt3__16vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS3_9allocatorIS8_EEEENS0_12yaml_contextEPKcSF_EEvOT0_RT1_RT2_T3_:
 2596|  32.0k|      {
 2597|  32.0k|         using V = std::remove_cvref_t<T>;
 2598|  32.0k|         using value_type = typename V::value_type;
 2599|       |
 2600|  32.0k|         struct sequence_container_adapter
 2601|  32.0k|         {
 2602|  32.0k|            size_t index = 0;
 2603|       |
 2604|  32.0k|            inline bool fixed_capacity_reached(const V& container) const noexcept
 2605|  32.0k|            {
 2606|  32.0k|               if constexpr (!resizable<V>) {
 2607|  32.0k|                  return index >= container.size();
 2608|  32.0k|               }
 2609|  32.0k|               else {
 2610|  32.0k|                  (void)container;
 2611|  32.0k|                  return false;
 2612|  32.0k|               }
 2613|  32.0k|            }
 2614|       |
 2615|  32.0k|            inline void commit_fixed_slot() noexcept { ++index; }
 2616|       |
 2617|  32.0k|            inline void append(V& container, value_type&& element) noexcept
 2618|  32.0k|            {
 2619|  32.0k|               if constexpr (emplace_backable<V>) {
 2620|  32.0k|                  container.emplace_back(std::move(element));
 2621|  32.0k|               }
 2622|  32.0k|               else if constexpr (emplaceable<V>) {
 2623|  32.0k|                  container.emplace(std::move(element));
 2624|  32.0k|               }
 2625|  32.0k|            }
 2626|  32.0k|         };
 2627|       |
 2628|  32.0k|         if (it == end || *it != '[') [[unlikely]] {
  ------------------
  |  Branch (2628:14): [True: 0, False: 32.0k]
  |  Branch (2628:27): [True: 0, False: 32.0k]
  ------------------
 2629|      0|            ctx.error = error_code::syntax_error;
 2630|      0|            return;
 2631|      0|         }
 2632|       |
 2633|       |         // Overwrite (do not append to) any pre-existing contents. Must happen
 2634|       |         // before the empty-array early return below so that `[]` also clears.
 2635|  32.0k|         clear_sequence_before_read<Opts>(value);
 2636|       |
 2637|  32.0k|         ++it; // Skip '['
 2638|       |         // Skip whitespace and newlines after opening bracket (YAML allows multi-line flow sequences)
 2639|  32.0k|         skip_flow_ws_and_newlines(ctx, it, end);
 2640|  32.0k|         if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2640:14): [True: 11, False: 32.0k]
  ------------------
 2641|     11|            return;
 2642|       |
 2643|       |         // Handle empty array
 2644|  32.0k|         if (it != end && *it == ']') {
  ------------------
  |  Branch (2644:14): [True: 31.6k, False: 396]
  |  Branch (2644:27): [True: 4.63k, False: 26.9k]
  ------------------
 2645|  4.63k|            ++it;
 2646|  4.63k|            validate_flow_node_adjacent_tail(ctx, it, end);
 2647|  4.63k|            if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2647:17): [True: 9, False: 4.63k]
  ------------------
 2648|      9|               return;
 2649|  4.63k|            if constexpr (!yaml::check_flow_context(Opts)) {
 2650|  4.63k|               if (ctx.current_indent() < 0) {
  ------------------
  |  Branch (2650:20): [True: 356, False: 4.27k]
  ------------------
 2651|    356|                  validate_root_flow_tail_after_close(ctx, it, end);
 2652|    356|               }
 2653|  4.63k|            }
 2654|  4.63k|            return;
 2655|  4.63k|         }
 2656|       |
 2657|  27.3k|         bool just_saw_comma = false;
 2658|  27.3k|         sequence_container_adapter adapter{};
 2659|       |
 2660|  27.3k|         if constexpr (emplace_backable<V> || emplaceable<V>) {
 2661|       |            // Dynamic containers append items (vector-like and set-like)
 2662|   544k|            while (it != end) {
  ------------------
  |  Branch (2662:20): [True: 542k, False: 1.65k]
  ------------------
 2663|   542k|               skip_flow_ws_and_newlines(ctx, it, end);
 2664|   542k|               if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2664:20): [True: 0, False: 542k]
  ------------------
 2665|      0|                  return;
 2666|       |
 2667|   542k|               if (it == end) [[unlikely]] {
  ------------------
  |  Branch (2667:20): [True: 0, False: 542k]
  ------------------
 2668|      0|                  ctx.error = error_code::unexpected_end;
 2669|      0|                  return;
 2670|      0|               }
 2671|       |
 2672|   542k|               if (*it == ']') {
  ------------------
  |  Branch (2672:20): [True: 3.75k, False: 538k]
  ------------------
 2673|  3.75k|                  if (just_saw_comma) {
  ------------------
  |  Branch (2673:23): [True: 3.75k, False: 0]
  ------------------
 2674|  3.75k|                     ++it;
 2675|  3.75k|                     validate_flow_node_adjacent_tail(ctx, it, end);
 2676|  3.75k|                     if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2676:26): [True: 4, False: 3.75k]
  ------------------
 2677|      4|                        return;
 2678|  3.75k|                     if constexpr (!yaml::check_flow_context(Opts)) {
 2679|  3.75k|                        if (ctx.current_indent() < 0) {
  ------------------
  |  Branch (2679:29): [True: 479, False: 3.27k]
  ------------------
 2680|    479|                           validate_root_flow_tail_after_close(ctx, it, end);
 2681|    479|                        }
 2682|  3.75k|                     }
 2683|  3.75k|                     return;
 2684|  3.75k|                  }
 2685|      0|                  ctx.error = error_code::syntax_error;
 2686|      0|                  return;
 2687|  3.75k|               }
 2688|       |
 2689|   538k|               if (*it == ',' || *it == '#') {
  ------------------
  |  Branch (2689:20): [True: 251, False: 538k]
  |  Branch (2689:34): [True: 48, False: 538k]
  ------------------
 2690|    299|                  ctx.error = error_code::syntax_error;
 2691|    299|                  return;
 2692|    299|               }
 2693|   538k|               just_saw_comma = false;
 2694|       |
 2695|   538k|               value_type element{};
 2696|   538k|               from<YAML, value_type>::template op<flow_context_on<Opts>()>(element, ctx, it, end);
 2697|       |
 2698|   538k|               if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2698:20): [True: 13.5k, False: 525k]
  ------------------
 2699|  13.5k|                  return;
 2700|       |
 2701|   525k|               bool saw_line_break_before_separator = false;
 2702|   525k|               skip_flow_ws_and_newlines(ctx, it, end, &saw_line_break_before_separator);
 2703|   525k|               if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2703:20): [True: 11, False: 525k]
  ------------------
 2704|     11|                  return;
 2705|       |
 2706|   525k|               if (it != end && *it == ':') {
  ------------------
  |  Branch (2706:20): [True: 522k, False: 2.62k]
  |  Branch (2706:33): [True: 6.49k, False: 515k]
  ------------------
 2707|       |                  // In flow sequences, implicit key-value pairs must be on a single line.
 2708|  6.49k|                  if (saw_line_break_before_separator) {
  ------------------
  |  Branch (2708:23): [True: 36, False: 6.45k]
  ------------------
 2709|     36|                     ctx.error = error_code::syntax_error;
 2710|     36|                     return;
 2711|     36|                  }
 2712|  6.45k|                  if constexpr (std::same_as<std::remove_cvref_t<value_type>, glz::generic>) {
 2713|  6.45k|                     glz::generic key_node = std::move(element);
 2714|  6.45k|                     ++it;
 2715|  6.45k|                     skip_inline_ws(it, end);
 2716|       |
 2717|  6.45k|                     glz::generic mapped{};
 2718|  6.45k|                     from<YAML, glz::generic>::template op<flow_context_on<Opts>()>(mapped, ctx, it, end);
 2719|  6.45k|                     if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2719:26): [True: 352, False: 6.10k]
  ------------------
 2720|    352|                        return;
 2721|       |
 2722|  6.10k|                     std::string key;
 2723|  6.10k|                     if (!yaml::materialize_key(key, key_node, ctx)) [[unlikely]]
  ------------------
  |  Branch (2723:26): [True: 2, False: 6.10k]
  ------------------
 2724|      2|                        return;
 2725|       |
 2726|  6.10k|                     glz::generic pair{};
 2727|  6.10k|                     pair[key] = std::move(mapped);
 2728|  6.10k|                     element = std::move(pair);
 2729|       |
 2730|  6.10k|                     skip_flow_ws_and_newlines(ctx, it, end);
 2731|  6.10k|                     if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2731:26): [True: 3, False: 6.10k]
  ------------------
 2732|      3|                        return;
 2733|       |                  }
 2734|       |                  else {
 2735|       |                     ctx.error = error_code::syntax_error;
 2736|       |                     return;
 2737|       |                  }
 2738|  6.45k|               }
 2739|       |
 2740|   525k|               adapter.append(value, std::move(element));
 2741|       |
 2742|   525k|               if (it == end) [[unlikely]] {
  ------------------
  |  Branch (2742:20): [True: 2.75k, False: 522k]
  ------------------
 2743|  2.75k|                  ctx.error = error_code::unexpected_end;
 2744|  2.75k|                  return;
 2745|  2.75k|               }
 2746|       |
 2747|   522k|               if (*it == ']') {
  ------------------
  |  Branch (2747:20): [True: 4.02k, False: 518k]
  ------------------
 2748|  4.02k|                  ++it;
 2749|  4.02k|                  validate_flow_node_adjacent_tail(ctx, it, end);
 2750|  4.02k|                  if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2750:23): [True: 56, False: 3.97k]
  ------------------
 2751|     56|                     return;
 2752|  3.97k|                  if constexpr (!yaml::check_flow_context(Opts)) {
 2753|  3.97k|                     if (ctx.current_indent() < 0) {
  ------------------
  |  Branch (2753:26): [True: 339, False: 3.63k]
  ------------------
 2754|    339|                        validate_root_flow_tail_after_close(ctx, it, end);
 2755|    339|                     }
 2756|  3.97k|                  }
 2757|  3.97k|                  return;
 2758|  4.02k|               }
 2759|   518k|               else if (*it == ',') {
  ------------------
  |  Branch (2759:25): [True: 516k, False: 1.31k]
  ------------------
 2760|   516k|                  ++it;
 2761|   516k|                  just_saw_comma = true;
 2762|   516k|                  skip_flow_ws_and_newlines(ctx, it, end);
 2763|   516k|                  if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2763:23): [True: 5, False: 516k]
  ------------------
 2764|      5|                     return;
 2765|   516k|               }
 2766|  1.31k|               else {
 2767|  1.31k|                  ctx.error = error_code::syntax_error;
 2768|  1.31k|                  return;
 2769|  1.31k|               }
 2770|   522k|            }
 2771|       |         }
 2772|       |         else if constexpr (!resizable<V>) {
 2773|       |            // Fixed-size containers (std::array)
 2774|       |            while (it != end && !adapter.fixed_capacity_reached(value)) {
 2775|       |               skip_flow_ws_and_newlines(ctx, it, end);
 2776|       |               if (bool(ctx.error)) [[unlikely]]
 2777|       |                  return;
 2778|       |
 2779|       |               if (it == end) [[unlikely]] {
 2780|       |                  ctx.error = error_code::unexpected_end;
 2781|       |                  return;
 2782|       |               }
 2783|       |
 2784|       |               if (*it == ']') {
 2785|       |                  if (just_saw_comma) {
 2786|       |                     ++it;
 2787|       |                     validate_flow_node_adjacent_tail(ctx, it, end);
 2788|       |                     if (bool(ctx.error)) [[unlikely]]
 2789|       |                        return;
 2790|       |                     if constexpr (!yaml::check_flow_context(Opts)) {
 2791|       |                        if (ctx.current_indent() < 0) {
 2792|       |                           validate_root_flow_tail_after_close(ctx, it, end);
 2793|       |                        }
 2794|       |                     }
 2795|       |                     return;
 2796|       |                  }
 2797|       |                  ctx.error = error_code::syntax_error;
 2798|       |                  return;
 2799|       |               }
 2800|       |
 2801|       |               if (*it == ',' || *it == '#') {
 2802|       |                  ctx.error = error_code::syntax_error;
 2803|       |                  return;
 2804|       |               }
 2805|       |               just_saw_comma = false;
 2806|       |
 2807|       |               from<YAML, value_type>::template op<flow_context_on<Opts>()>(value[adapter.index], ctx, it, end);
 2808|       |
 2809|       |               if (bool(ctx.error)) [[unlikely]]
 2810|       |                  return;
 2811|       |
 2812|       |               adapter.commit_fixed_slot();
 2813|       |               skip_flow_ws_and_newlines(ctx, it, end);
 2814|       |               if (bool(ctx.error)) [[unlikely]]
 2815|       |                  return;
 2816|       |
 2817|       |               if (it == end) [[unlikely]] {
 2818|       |                  ctx.error = error_code::unexpected_end;
 2819|       |                  return;
 2820|       |               }
 2821|       |
 2822|       |               if (*it == ']') {
 2823|       |                  ++it;
 2824|       |                  validate_flow_node_adjacent_tail(ctx, it, end);
 2825|       |                  if (bool(ctx.error)) [[unlikely]]
 2826|       |                     return;
 2827|       |                  if constexpr (!yaml::check_flow_context(Opts)) {
 2828|       |                     if (ctx.current_indent() < 0) {
 2829|       |                        validate_root_flow_tail_after_close(ctx, it, end);
 2830|       |                     }
 2831|       |                  }
 2832|       |                  return;
 2833|       |               }
 2834|       |               else if (*it == ',') {
 2835|       |                  ++it;
 2836|       |                  just_saw_comma = true;
 2837|       |                  skip_flow_ws_and_newlines(ctx, it, end);
 2838|       |                  if (bool(ctx.error)) [[unlikely]]
 2839|       |                     return;
 2840|       |               }
 2841|       |               else {
 2842|       |                  ctx.error = error_code::syntax_error;
 2843|       |                  return;
 2844|       |               }
 2845|       |            }
 2846|       |
 2847|       |            // If we exited because the fixed-size container is full but haven't seen ']',
 2848|       |            // skip to the closing bracket to consume overflow elements.
 2849|       |            int bracket_depth = 1;
 2850|       |            while (it != end && bracket_depth > 0) {
 2851|       |               if (*it == '[') {
 2852|       |                  ++bracket_depth;
 2853|       |               }
 2854|       |               else if (*it == ']') {
 2855|       |                  --bracket_depth;
 2856|       |               }
 2857|       |               ++it;
 2858|       |            }
 2859|       |         }
 2860|       |         else {
 2861|       |            ctx.error = error_code::syntax_error;
 2862|       |            return;
 2863|       |         }
 2864|  27.3k|      }
_ZN3glz4yaml26clear_sequence_before_readITnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1EEENSt3__16vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS3_9allocatorIS8_EEEEEEvRT0_:
 2580|  82.6k|      {
 2581|  82.6k|         if constexpr (emplace_backable<V> && requires { value.clear(); }) {
 2582|       |            // vector-like: honor the append_arrays option, matching json/read.hpp
 2583|  82.6k|            if constexpr (!check_append_arrays(Opts)) {
 2584|  82.6k|               value.clear();
 2585|  82.6k|            }
 2586|       |         }
 2587|       |         else if constexpr (emplaceable<V> && requires { value.clear(); }) {
 2588|       |            // set-like: json/read.hpp clears unconditionally; append_arrays does not apply
 2589|       |            value.clear();
 2590|       |         }
 2591|  82.6k|      }
_ZZN3glz4yaml19parse_flow_sequenceITnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1EEERNSt3__16vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS3_9allocatorIS8_EEEENS0_12yaml_contextEPKcSF_EEvOT0_RT1_RT2_T3_EN26sequence_container_adapter6appendESC_OS8_:
 2618|   524k|            {
 2619|   524k|               if constexpr (emplace_backable<V>) {
 2620|   524k|                  container.emplace_back(std::move(element));
 2621|       |               }
 2622|       |               else if constexpr (emplaceable<V>) {
 2623|       |                  container.emplace(std::move(element));
 2624|       |               }
 2625|   524k|            }
_ZN3glz4yaml20parse_block_sequenceITnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1EEERNSt3__16vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS3_9allocatorIS8_EEEENS0_12yaml_contextEPKcSF_EEvOT0_RT1_RT2_T3_i:
 3081|  50.6k|      {
 3082|  50.6k|         using V = std::remove_cvref_t<T>;
 3083|  50.6k|         using value_type = typename V::value_type;
 3084|       |
 3085|  50.6k|         struct sequence_container_adapter
 3086|  50.6k|         {
 3087|  50.6k|            size_t index = 0;
 3088|       |
 3089|  50.6k|            inline bool fixed_capacity_reached(const V& container) const noexcept
 3090|  50.6k|            {
 3091|  50.6k|               if constexpr (!resizable<V>) {
 3092|  50.6k|                  return index >= container.size();
 3093|  50.6k|               }
 3094|  50.6k|               else {
 3095|  50.6k|                  (void)container;
 3096|  50.6k|                  return false;
 3097|  50.6k|               }
 3098|  50.6k|            }
 3099|       |
 3100|  50.6k|            inline void commit_fixed_slot() noexcept { ++index; }
 3101|       |
 3102|  50.6k|            inline void append(V& container, value_type&& element) noexcept
 3103|  50.6k|            {
 3104|  50.6k|               if constexpr (emplace_backable<V>) {
 3105|  50.6k|                  container.emplace_back(std::move(element));
 3106|  50.6k|               }
 3107|  50.6k|               else if constexpr (emplaceable<V>) {
 3108|  50.6k|                  container.emplace(std::move(element));
 3109|  50.6k|               }
 3110|  50.6k|            }
 3111|  50.6k|         };
 3112|       |
 3113|       |         // Overwrite (do not append to) any pre-existing contents. A block
 3114|       |         // sequence is only entered once a '-' item is confirmed, so clearing
 3115|       |         // up front correctly (re)assigns the container to the parsed sequence.
 3116|  50.6k|         clear_sequence_before_read<Opts>(value);
 3117|       |
 3118|  50.6k|         sequence_container_adapter adapter{};
 3119|       |
 3120|       |         // Track if this is the first item (for handling whitespace-consumed case)
 3121|  50.6k|         bool first_item = true;
 3122|  50.6k|         bool has_pending_item_anchor = false;
 3123|  50.6k|         std::string pending_item_anchor_name{};
 3124|  50.6k|         int32_t pending_item_anchor_indent = sequence_indent;
 3125|       |
 3126|   136k|         while (it != end) {
  ------------------
  |  Branch (3126:17): [True: 106k, False: 30.3k]
  ------------------
 3127|       |            // For fixed-size arrays (e.g. std::array), stop when we've filled all elements.
 3128|       |            // Exclude emplaceable types (e.g. std::set) which are not resizable but grow dynamically.
 3129|       |            if constexpr (!resizable<V> && !emplaceable<V>) {
 3130|       |               if (adapter.fixed_capacity_reached(value)) {
 3131|       |                  return;
 3132|       |               }
 3133|       |            }
 3134|       |
 3135|       |            // Skip blank lines and comments, track indent
 3136|   106k|            int32_t line_indent = 0;
 3137|   106k|            int32_t dash_col = -1; // actual column of the '-' on the line
 3138|   106k|            auto line_start = it;
 3139|       |
 3140|   151k|            while (it != end) {
  ------------------
  |  Branch (3140:20): [True: 148k, False: 3.57k]
  ------------------
 3141|   148k|               if (*it == '#') {
  ------------------
  |  Branch (3141:20): [True: 12.0k, False: 135k]
  ------------------
 3142|  12.0k|                  skip_comment(it, end);
 3143|  12.0k|                  skip_newline(it, end);
 3144|  12.0k|                  line_start = it;
 3145|  12.0k|                  line_indent = 0;
 3146|  12.0k|               }
 3147|   135k|               else if (*it == '\n' || *it == '\r') {
  ------------------
  |  Branch (3147:25): [True: 13.4k, False: 122k]
  |  Branch (3147:40): [True: 12.8k, False: 109k]
  ------------------
 3148|  26.3k|                  skip_newline(it, end);
 3149|  26.3k|                  line_start = it;
 3150|  26.3k|                  line_indent = 0;
 3151|  26.3k|               }
 3152|   109k|               else if (*it == ' ') {
  ------------------
  |  Branch (3152:25): [True: 16.5k, False: 93.0k]
  ------------------
 3153|  16.5k|                  line_start = it;
 3154|  16.5k|                  line_indent = 0;
 3155|  40.3k|                  while (it != end && *it == ' ') {
  ------------------
  |  Branch (3155:26): [True: 40.0k, False: 299]
  |  Branch (3155:39): [True: 23.8k, False: 16.2k]
  ------------------
 3156|  23.8k|                     ++line_indent;
 3157|  23.8k|                     ++it;
 3158|  23.8k|                  }
 3159|       |
 3160|  16.5k|                  bool saw_tab = false;
 3161|  18.2k|                  while (it != end && (*it == ' ' || *it == '\t')) {
  ------------------
  |  Branch (3161:26): [True: 17.8k, False: 327]
  |  Branch (3161:40): [True: 756, False: 17.1k]
  |  Branch (3161:54): [True: 872, False: 16.2k]
  ------------------
 3162|  1.62k|                     saw_tab = saw_tab || (*it == '\t');
  ------------------
  |  Branch (3162:32): [True: 1.16k, False: 464]
  |  Branch (3162:43): [True: 464, False: 0]
  ------------------
 3163|  1.62k|                     ++it;
 3164|  1.62k|                  }
 3165|       |
 3166|  16.5k|                  if (it == end || *it == '\n' || *it == '\r' || *it == '#') {
  ------------------
  |  Branch (3166:23): [True: 327, False: 16.2k]
  |  Branch (3166:36): [True: 353, False: 15.8k]
  |  Branch (3166:51): [True: 648, False: 15.2k]
  |  Branch (3166:66): [True: 4.19k, False: 11.0k]
  ------------------
 3167|       |                     // Blank or comment line - continue to next line
 3168|  5.52k|                     if (it != end && *it == '#') {
  ------------------
  |  Branch (3168:26): [True: 5.20k, False: 327]
  |  Branch (3168:39): [True: 4.19k, False: 1.00k]
  ------------------
 3169|  4.19k|                        skip_comment(it, end);
 3170|  4.19k|                     }
 3171|  5.52k|                     line_indent = 0;
 3172|  5.52k|                     continue;
 3173|  5.52k|                  }
 3174|       |
 3175|  11.0k|                  if (saw_tab) {
  ------------------
  |  Branch (3175:23): [True: 9, False: 11.0k]
  ------------------
 3176|      9|                     ctx.error = error_code::syntax_error;
 3177|      9|                     return;
 3178|      9|                  }
 3179|  11.0k|                  break; // Found content
 3180|  11.0k|               }
 3181|  93.0k|               else if (*it == '\t') {
  ------------------
  |  Branch (3181:25): [True: 1.64k, False: 91.4k]
  ------------------
 3182|  1.64k|                  line_start = it;
 3183|  6.30k|                  while (it != end && (*it == ' ' || *it == '\t')) ++it;
  ------------------
  |  Branch (3183:26): [True: 6.13k, False: 172]
  |  Branch (3183:40): [True: 652, False: 5.48k]
  |  Branch (3183:54): [True: 4.01k, False: 1.46k]
  ------------------
 3184|  1.64k|                  if (it == end || *it == '\n' || *it == '\r' || *it == '#') {
  ------------------
  |  Branch (3184:23): [True: 172, False: 1.46k]
  |  Branch (3184:36): [True: 335, False: 1.13k]
  |  Branch (3184:51): [True: 424, False: 710]
  |  Branch (3184:66): [True: 696, False: 14]
  ------------------
 3185|  1.62k|                     if (it != end && *it == '#') {
  ------------------
  |  Branch (3185:26): [True: 1.45k, False: 172]
  |  Branch (3185:39): [True: 696, False: 759]
  ------------------
 3186|    696|                        skip_comment(it, end);
 3187|    696|                     }
 3188|  1.62k|                     line_indent = 0;
 3189|  1.62k|                     continue;
 3190|  1.62k|                  }
 3191|     14|                  ctx.error = error_code::syntax_error;
 3192|     14|                  return;
 3193|  1.64k|               }
 3194|  91.4k|               else {
 3195|       |                  // At content (no leading space on this line)
 3196|       |                  // If first item and at '-', whitespace was consumed by caller;
 3197|       |                  // treat as having correct indentation
 3198|  91.4k|                  if (first_item && *it == '-') {
  ------------------
  |  Branch (3198:23): [True: 50.6k, False: 40.7k]
  |  Branch (3198:37): [True: 50.3k, False: 251]
  ------------------
 3199|  50.3k|                     line_indent = sequence_indent;
 3200|  50.3k|                     if constexpr (std::is_pointer_v<std::decay_t<It>>) {
 3201|  50.3k|                        if (ctx.stream_begin && it > ctx.stream_begin) {
  ------------------
  |  Branch (3201:29): [True: 50.3k, False: 0]
  |  Branch (3201:49): [True: 49.9k, False: 411]
  ------------------
 3202|  49.9k|                           auto probe = it;
 3203|  49.9k|                           int32_t leading_ws = 0;
 3204|  49.9k|                           bool saw_tab = false;
 3205|   109k|                           while (probe > ctx.stream_begin && (*(probe - 1) == ' ' || *(probe - 1) == '\t')) {
  ------------------
  |  Branch (3205:35): [True: 109k, False: 72]
  |  Branch (3205:64): [True: 48.4k, False: 60.6k]
  |  Branch (3205:87): [True: 10.8k, False: 49.8k]
  ------------------
 3206|  59.3k|                              --probe;
 3207|  59.3k|                              ++leading_ws;
 3208|  59.3k|                              saw_tab = saw_tab || (*probe == '\t');
  ------------------
  |  Branch (3208:41): [True: 10.3k, False: 48.9k]
  |  Branch (3208:52): [True: 1.09k, False: 47.8k]
  ------------------
 3209|  59.3k|                           }
 3210|  49.9k|                           if (probe == ctx.stream_begin || *(probe - 1) == '\n' || *(probe - 1) == '\r') {
  ------------------
  |  Branch (3210:32): [True: 72, False: 49.8k]
  |  Branch (3210:61): [True: 15.1k, False: 34.6k]
  |  Branch (3210:85): [True: 6.24k, False: 28.4k]
  ------------------
 3211|  21.5k|                              if (saw_tab) {
  ------------------
  |  Branch (3211:35): [True: 21, False: 21.4k]
  ------------------
 3212|     21|                                 ctx.error = error_code::syntax_error;
 3213|     21|                                 return;
 3214|     21|                              }
 3215|  21.4k|                              line_indent = (std::max)(line_indent, leading_ws);
 3216|  21.4k|                           }
 3217|  49.9k|                        }
 3218|  50.3k|                     }
 3219|  50.3k|                  }
 3220|  50.3k|                  break;
 3221|  91.4k|               }
 3222|   148k|            }
 3223|       |
 3224|   106k|            if (it == end) break;
  ------------------
  |  Branch (3224:17): [True: 3.57k, False: 102k]
  ------------------
 3225|       |
 3226|       |            // Check for document end marker
 3227|   102k|            if (at_document_end(it, end)) break;
  ------------------
  |  Branch (3227:17): [True: 1.81k, False: 100k]
  ------------------
 3228|       |
 3229|       |            // Check for dedent
 3230|   100k|            if (line_indent < sequence_indent) {
  ------------------
  |  Branch (3230:17): [True: 7.27k, False: 93.3k]
  ------------------
 3231|  7.27k|               it = line_start;
 3232|  7.27k|               return;
 3233|  7.27k|            }
 3234|       |
 3235|  93.3k|            if (*it == '&') {
  ------------------
  |  Branch (3235:17): [True: 12.5k, False: 80.7k]
  ------------------
 3236|       |               // Standalone anchor lines before "- item" are only supported for
 3237|       |               // indentless mapping values. At top-level block sequences these are
 3238|       |               // malformed in yaml-test-suite cases.
 3239|  12.5k|               if (!ctx.allow_indentless_sequence) {
  ------------------
  |  Branch (3239:20): [True: 13, False: 12.5k]
  ------------------
 3240|     13|                  ctx.error = error_code::syntax_error;
 3241|     13|                  return;
 3242|     13|               }
 3243|       |
 3244|  12.5k|               ++it;
 3245|  12.5k|               auto pending_name = parse_anchor_name(it, end);
 3246|  12.5k|               if (pending_name.empty()) {
  ------------------
  |  Branch (3246:20): [True: 7, False: 12.5k]
  ------------------
 3247|      7|                  ctx.error = error_code::syntax_error;
 3248|      7|                  return;
 3249|      7|               }
 3250|  12.5k|               skip_inline_ws(it, end);
 3251|  12.5k|               if (it != end && *it == '#') {
  ------------------
  |  Branch (3251:20): [True: 12.5k, False: 30]
  |  Branch (3251:33): [True: 7.31k, False: 5.19k]
  ------------------
 3252|  7.31k|                  skip_comment(it, end);
 3253|  7.31k|               }
 3254|       |
 3255|  12.5k|               has_pending_item_anchor = true;
 3256|  12.5k|               pending_item_anchor_name = std::string(pending_name);
 3257|  12.5k|               pending_item_anchor_indent = line_indent;
 3258|       |
 3259|  12.5k|               if (it == end || (*it != '\n' && *it != '\r')) {
  ------------------
  |  Branch (3259:20): [True: 44, False: 12.4k]
  |  Branch (3259:34): [True: 4.94k, False: 7.55k]
  |  Branch (3259:49): [True: 17, False: 4.93k]
  ------------------
 3260|     61|                  ctx.error = error_code::syntax_error;
 3261|     61|                  return;
 3262|     61|               }
 3263|       |
 3264|  12.4k|               skip_newline(it, end);
 3265|  12.4k|               continue;
 3266|  12.5k|            }
 3267|       |
 3268|       |            // Expect dash for sequence item
 3269|  80.7k|            if (*it != '-') {
  ------------------
  |  Branch (3269:17): [True: 5.74k, False: 75.0k]
  ------------------
 3270|  5.74k|               it = line_start;
 3271|  5.74k|               return;
 3272|  5.74k|            }
 3273|       |
 3274|       |            // Compute the actual column of this sequence dash.
 3275|       |            // This is needed by plain-scalar multiline folding to distinguish
 3276|       |            // sibling "- item" entries from deeper "- " continuation content.
 3277|  75.0k|            dash_col = line_indent;
 3278|  75.0k|            if constexpr (std::is_pointer_v<std::decay_t<It>>) {
 3279|  75.0k|               if (ctx.stream_begin) {
  ------------------
  |  Branch (3279:20): [True: 75.0k, False: 21]
  ------------------
 3280|  75.0k|                  dash_col = ctx.line_prefix_before(&*it).column;
 3281|  75.0k|               }
 3282|  75.0k|            }
 3283|       |
 3284|  75.0k|            ++it; // Skip '-'
 3285|       |
 3286|       |            // Check for valid sequence item indicator (- followed by space or newline)
 3287|  75.0k|            if (it != end && !yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*it)]) {
  ------------------
  |  Branch (3287:17): [True: 71.0k, False: 3.96k]
  |  Branch (3287:30): [True: 1.27k, False: 69.8k]
  ------------------
 3288|       |               // Not a sequence item (could be a number like -5)
 3289|  1.27k|               it = line_start;
 3290|  1.27k|               return;
 3291|  1.27k|            }
 3292|       |
 3293|  73.7k|            bool saw_tab_after_dash = false;
 3294|   135k|            while (it != end && (*it == ' ' || *it == '\t')) {
  ------------------
  |  Branch (3294:20): [True: 131k, False: 4.19k]
  |  Branch (3294:34): [True: 57.2k, False: 74.1k]
  |  Branch (3294:48): [True: 4.58k, False: 69.5k]
  ------------------
 3295|  61.7k|               saw_tab_after_dash = saw_tab_after_dash || (*it == '\t');
  ------------------
  |  Branch (3295:37): [True: 824, False: 60.9k]
  |  Branch (3295:59): [True: 3.88k, False: 57.0k]
  ------------------
 3296|  61.7k|               ++it;
 3297|  61.7k|            }
 3298|       |            // A tab-separated nested "- " marker is not valid block indentation.
 3299|  73.7k|            if (saw_tab_after_dash && it != end && *it == '-') {
  ------------------
  |  Branch (3299:17): [True: 3.88k, False: 69.8k]
  |  Branch (3299:39): [True: 3.79k, False: 90]
  |  Branch (3299:52): [True: 1.34k, False: 2.45k]
  ------------------
 3300|  1.34k|               const auto after_dash = it + 1;
 3301|  1.34k|               if (after_dash == end || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*after_dash)]) {
  ------------------
  |  Branch (3301:20): [True: 5, False: 1.33k]
  |  Branch (3301:41): [True: 1, False: 1.33k]
  ------------------
 3302|      6|                  ctx.error = error_code::syntax_error;
 3303|      6|                  return;
 3304|      6|               }
 3305|  1.34k|            }
 3306|       |
 3307|       |            // Get reference to element to parse into
 3308|  73.7k|            auto parse_element = [&](auto& element) {
 3309|  73.7k|               const char* element_start = (it != end) ? &*it : nullptr;
 3310|       |
 3311|       |               // Check what follows
 3312|  73.7k|               if (it != end && !yaml::line_end_or_comment_table[static_cast<uint8_t>(*it)]) {
 3313|       |                  // Content on same line as dash - set indent to one less than content column
 3314|       |                  // This allows nested block mappings to continue parsing keys at the content indent
 3315|       |                  // For "- key: val", if dash is at column 0, content is at column 2
 3316|       |                  // We set parent indent to 1 so keys at column 2 pass the "indent > parent" check
 3317|  73.7k|                  if (!ctx.push_indent(line_indent + 1)) [[unlikely]]
 3318|  73.7k|                     return;
 3319|  73.7k|                  const bool prev_sequence_item_value_context = ctx.sequence_item_value_context;
 3320|  73.7k|                  const int32_t prev_sequence_dash_indent = ctx.sequence_dash_indent;
 3321|  73.7k|                  ctx.sequence_item_value_context = true;
 3322|  73.7k|                  ctx.sequence_dash_indent = dash_col;
 3323|  73.7k|                  from<YAML, value_type>::template op<Opts>(element, ctx, it, end);
 3324|  73.7k|                  ctx.sequence_dash_indent = prev_sequence_dash_indent;
 3325|  73.7k|                  ctx.sequence_item_value_context = prev_sequence_item_value_context;
 3326|  73.7k|                  ctx.pop_indent();
 3327|  73.7k|               }
 3328|  73.7k|               else {
 3329|       |                  // Value on next line - nested block
 3330|  73.7k|                  skip_ws_and_comment(it, end);
 3331|  73.7k|                  skip_newline(it, end);
 3332|       |
 3333|       |                  // Get indent of nested content
 3334|  73.7k|                  auto nested_start = it;
 3335|  73.7k|                  int32_t nested_indent = measure_indent(it, end, ctx);
 3336|  73.7k|                  if (bool(ctx.error)) [[unlikely]]
 3337|  73.7k|                     return;
 3338|  73.7k|                  it = nested_start;
 3339|       |
 3340|       |                  // Content is nested only if indented more than the current line.
 3341|       |                  // When line_indent is negative (root level), use 0 as the baseline.
 3342|       |                  // This prevents content at column 0 from being treated as nested.
 3343|  73.7k|                  const int32_t effective_line_indent = (line_indent < 0) ? 0 : line_indent;
 3344|  73.7k|                  if (nested_indent > effective_line_indent) {
 3345|       |                     // Save and set indent for nested parsing.
 3346|       |                     // A struct element reads the pushed indent as its own key column; every
 3347|       |                     // other element type reads it as the enclosing baseline, so it gets one
 3348|       |                     // less than the content indent and its content passes "indent > parent".
 3349|  73.7k|                     const int32_t element_indent =
 3350|  73.7k|                        receives_block_mapping_column<value_type>() ? nested_indent : nested_indent - 1;
 3351|  73.7k|                     if (!ctx.push_indent(element_indent)) [[unlikely]]
 3352|  73.7k|                        return;
 3353|  73.7k|                     const bool prev_sequence_item_value_context = ctx.sequence_item_value_context;
 3354|  73.7k|                     const int32_t prev_sequence_dash_indent = ctx.sequence_dash_indent;
 3355|  73.7k|                     ctx.sequence_item_value_context = true;
 3356|  73.7k|                     ctx.sequence_dash_indent = dash_col;
 3357|  73.7k|                     from<YAML, value_type>::template op<Opts>(element, ctx, it, end);
 3358|  73.7k|                     ctx.sequence_dash_indent = prev_sequence_dash_indent;
 3359|  73.7k|                     ctx.sequence_item_value_context = prev_sequence_item_value_context;
 3360|  73.7k|                     ctx.pop_indent();
 3361|  73.7k|                  }
 3362|       |                  // else: empty element (default constructed)
 3363|  73.7k|               }
 3364|       |
 3365|  73.7k|               if (has_pending_item_anchor && !bool(ctx.error)) {
 3366|  73.7k|                  const char* element_end = (it != end) ? &*it : element_start;
 3367|  73.7k|                  ctx.anchors[std::move(pending_item_anchor_name)] = {element_start, element_end,
 3368|  73.7k|                                                                      pending_item_anchor_indent};
 3369|  73.7k|                  has_pending_item_anchor = false;
 3370|  73.7k|               }
 3371|  73.7k|            };
 3372|       |
 3373|  73.7k|            if constexpr (emplace_backable<V>) {
 3374|  73.7k|               auto& element = value.emplace_back();
 3375|  73.7k|               parse_element(element);
 3376|       |            }
 3377|       |            else if constexpr (emplaceable<V>) {
 3378|       |               value_type element{};
 3379|       |               parse_element(element);
 3380|       |               if (!bool(ctx.error)) {
 3381|       |                  adapter.append(value, std::move(element));
 3382|       |               }
 3383|       |            }
 3384|       |            else if constexpr (!resizable<V>) {
 3385|       |               parse_element(value[adapter.index]);
 3386|       |               adapter.commit_fixed_slot();
 3387|       |            }
 3388|       |            else {
 3389|       |               ctx.error = error_code::syntax_error;
 3390|       |               return;
 3391|       |            }
 3392|       |
 3393|  73.7k|            first_item = false;
 3394|       |
 3395|  73.7k|            if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (3395:17): [True: 426, False: 73.3k]
  ------------------
 3396|    426|               return;
 3397|       |
 3398|       |            // Note: after parsing nested block content, iterator may already be
 3399|       |            // at the start of the next line. The outer loop will handle it.
 3400|  73.7k|         }
 3401|  50.6k|      }
_ZZN3glz4yaml20parse_block_sequenceITnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1EEERNSt3__16vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS3_9allocatorIS8_EEEENS0_12yaml_contextEPKcSF_EEvOT0_RT1_RT2_T3_iENKUlRT_E_clIS8_EEDaSO_:
 3308|  73.7k|            auto parse_element = [&](auto& element) {
 3309|  73.7k|               const char* element_start = (it != end) ? &*it : nullptr;
  ------------------
  |  Branch (3309:44): [True: 69.5k, False: 4.17k]
  ------------------
 3310|       |
 3311|       |               // Check what follows
 3312|  73.7k|               if (it != end && !yaml::line_end_or_comment_table[static_cast<uint8_t>(*it)]) {
  ------------------
  |  Branch (3312:20): [True: 69.5k, False: 4.17k]
  |  Branch (3312:33): [True: 37.2k, False: 32.3k]
  ------------------
 3313|       |                  // Content on same line as dash - set indent to one less than content column
 3314|       |                  // This allows nested block mappings to continue parsing keys at the content indent
 3315|       |                  // For "- key: val", if dash is at column 0, content is at column 2
 3316|       |                  // We set parent indent to 1 so keys at column 2 pass the "indent > parent" check
 3317|  37.2k|                  if (!ctx.push_indent(line_indent + 1)) [[unlikely]]
  ------------------
  |  Branch (3317:23): [True: 0, False: 37.2k]
  ------------------
 3318|      0|                     return;
 3319|  37.2k|                  const bool prev_sequence_item_value_context = ctx.sequence_item_value_context;
 3320|  37.2k|                  const int32_t prev_sequence_dash_indent = ctx.sequence_dash_indent;
 3321|  37.2k|                  ctx.sequence_item_value_context = true;
 3322|  37.2k|                  ctx.sequence_dash_indent = dash_col;
 3323|  37.2k|                  from<YAML, value_type>::template op<Opts>(element, ctx, it, end);
 3324|  37.2k|                  ctx.sequence_dash_indent = prev_sequence_dash_indent;
 3325|  37.2k|                  ctx.sequence_item_value_context = prev_sequence_item_value_context;
 3326|  37.2k|                  ctx.pop_indent();
 3327|  37.2k|               }
 3328|  36.5k|               else {
 3329|       |                  // Value on next line - nested block
 3330|  36.5k|                  skip_ws_and_comment(it, end);
 3331|  36.5k|                  skip_newline(it, end);
 3332|       |
 3333|       |                  // Get indent of nested content
 3334|  36.5k|                  auto nested_start = it;
 3335|  36.5k|                  int32_t nested_indent = measure_indent(it, end, ctx);
 3336|  36.5k|                  if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (3336:23): [True: 3, False: 36.5k]
  ------------------
 3337|      3|                     return;
 3338|  36.5k|                  it = nested_start;
 3339|       |
 3340|       |                  // Content is nested only if indented more than the current line.
 3341|       |                  // When line_indent is negative (root level), use 0 as the baseline.
 3342|       |                  // This prevents content at column 0 from being treated as nested.
 3343|  36.5k|                  const int32_t effective_line_indent = (line_indent < 0) ? 0 : line_indent;
  ------------------
  |  Branch (3343:57): [True: 1.60k, False: 34.9k]
  ------------------
 3344|  36.5k|                  if (nested_indent > effective_line_indent) {
  ------------------
  |  Branch (3344:23): [True: 14.7k, False: 21.8k]
  ------------------
 3345|       |                     // Save and set indent for nested parsing.
 3346|       |                     // A struct element reads the pushed indent as its own key column; every
 3347|       |                     // other element type reads it as the enclosing baseline, so it gets one
 3348|       |                     // less than the content indent and its content passes "indent > parent".
 3349|  14.7k|                     const int32_t element_indent =
 3350|  14.7k|                        receives_block_mapping_column<value_type>() ? nested_indent : nested_indent - 1;
  ------------------
  |  Branch (3350:25): [Folded, False: 14.7k]
  ------------------
 3351|  14.7k|                     if (!ctx.push_indent(element_indent)) [[unlikely]]
  ------------------
  |  Branch (3351:26): [True: 0, False: 14.7k]
  ------------------
 3352|      0|                        return;
 3353|  14.7k|                     const bool prev_sequence_item_value_context = ctx.sequence_item_value_context;
 3354|  14.7k|                     const int32_t prev_sequence_dash_indent = ctx.sequence_dash_indent;
 3355|  14.7k|                     ctx.sequence_item_value_context = true;
 3356|  14.7k|                     ctx.sequence_dash_indent = dash_col;
 3357|  14.7k|                     from<YAML, value_type>::template op<Opts>(element, ctx, it, end);
 3358|  14.7k|                     ctx.sequence_dash_indent = prev_sequence_dash_indent;
 3359|  14.7k|                     ctx.sequence_item_value_context = prev_sequence_item_value_context;
 3360|  14.7k|                     ctx.pop_indent();
 3361|  14.7k|                  }
 3362|       |                  // else: empty element (default constructed)
 3363|  36.5k|               }
 3364|       |
 3365|  73.7k|               if (has_pending_item_anchor && !bool(ctx.error)) {
  ------------------
  |  Branch (3365:20): [True: 7.41k, False: 66.3k]
  |  Branch (3365:47): [True: 7.36k, False: 42]
  ------------------
 3366|  7.36k|                  const char* element_end = (it != end) ? &*it : element_start;
  ------------------
  |  Branch (3366:45): [True: 6.51k, False: 850]
  ------------------
 3367|  7.36k|                  ctx.anchors[std::move(pending_item_anchor_name)] = {element_start, element_end,
 3368|  7.36k|                                                                      pending_item_anchor_indent};
 3369|  7.36k|                  has_pending_item_anchor = false;
 3370|  7.36k|               }
 3371|  73.7k|            };
_ZN3glz29parse_block_mapping_or_stringINSt3__17variantIJDndNS1_12basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEbNS1_6vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS6_ISD_EEEENSC_ISD_EEEEETnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1EEERSH_RNS_4yaml12yaml_contextERPKcSO_EEvOT1_OT2_OT3_T4_:
 5423|   271k|   {
 5424|       |      if constexpr (yaml::check_flow_context(Opts)) {
 5425|       |         // In flow context, only treat plain content as an implicit "key: value"
 5426|       |         // when a mapping separator appears before the next top-level flow delimiter.
 5427|       |         auto could_be_implicit_flow_pair = [&](auto pos) {
 5428|       |            // Bounded by the longest implicit key the spec allows: unbounded, this probe runs
 5429|       |            // once per entry per nesting level over the whole remaining flow collection.
 5430|       |            const auto stop = yaml::implicit_key_scan_end(pos, end);
 5431|       |            int depth = 0;
 5432|       |            while (pos != stop) {
 5433|       |               const char c = *pos;
 5434|       |               if (c == '"' || c == '\'') {
 5435|       |                  const char quote = c;
 5436|       |                  ++pos;
 5437|       |                  while (pos != stop && *pos != quote) {
 5438|       |                     if (*pos == '\\' && quote == '"') {
 5439|       |                        ++pos;
 5440|       |                        if (pos != stop) ++pos;
 5441|       |                     }
 5442|       |                     else {
 5443|       |                        ++pos;
 5444|       |                     }
 5445|       |                  }
 5446|       |                  if (pos != stop) ++pos;
 5447|       |                  continue;
 5448|       |               }
 5449|       |               if (c == '[' || c == '{') {
 5450|       |                  ++depth;
 5451|       |                  ++pos;
 5452|       |                  continue;
 5453|       |               }
 5454|       |               if (c == ']' || c == '}') {
 5455|       |                  if (depth == 0) return false;
 5456|       |                  --depth;
 5457|       |                  ++pos;
 5458|       |                  continue;
 5459|       |               }
 5460|       |               if (c == ',' && depth == 0) return false;
 5461|       |               if (c == ':' && depth == 0) {
 5462|       |                  auto next = pos + 1;
 5463|       |                  return next == end || *next == ' ' || *next == '\t' || *next == '\n' || *next == '\r';
 5464|       |               }
 5465|       |               ++pos;
 5466|       |            }
 5467|       |            return false;
 5468|       |         };
 5469|       |
 5470|       |         if (could_be_implicit_flow_pair(it) || line_could_be_flow_mapping(it, end)) {
 5471|       |            if (try_parse_block_mapping_into_variant<Variant, Opts>(value, ctx, it, end)) {
 5472|       |               return;
 5473|       |            }
 5474|       |            if (bool(ctx.error)) {
 5475|       |               return;
 5476|       |            }
 5477|       |         }
 5478|       |
 5479|       |         process_yaml_variant_alternatives<Variant, is_yaml_variant_str>::template op<Opts>(value, ctx, it, end);
 5480|       |         return;
 5481|       |      }
 5482|       |
 5483|   271k|      if (try_parse_block_mapping_into_variant<Variant, Opts>(value, ctx, it, end)) {
  ------------------
  |  Branch (5483:11): [True: 160k, False: 110k]
  ------------------
 5484|   160k|         return;
 5485|   160k|      }
 5486|       |      // If an error was set (e.g., malformed flow collection in value), don't try to parse as string
 5487|   110k|      if (bool(ctx.error)) {
  ------------------
  |  Branch (5487:11): [True: 6.24k, False: 104k]
  ------------------
 5488|  6.24k|         return;
 5489|  6.24k|      }
 5490|   104k|      process_yaml_variant_alternatives<Variant, is_yaml_variant_str>::template op<Opts>(value, ctx, it, end);
 5491|   104k|   }
_ZZN3glz4fromILj450ENSt3__17variantIJDndNS1_12basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEbNS1_6vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS6_ISD_EEEENSC_ISD_EEEEEE2opITnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1EEERPKcRSH_TkNS_10is_contextERNS_4yaml12yaml_contextESM_EEvOT1_OT2_OT0_T3_ENKUlT_E0_clISM_EEDaSZ_:
 5848|  34.3k|            auto is_word_boundary = [&](const auto ptr) {
 5849|  34.3k|               if (ptr == end) {
  ------------------
  |  Branch (5849:20): [True: 1.03k, False: 33.2k]
  ------------------
 5850|  1.03k|                  return true;
 5851|  1.03k|               }
 5852|  33.2k|               if (*ptr == ':') {
  ------------------
  |  Branch (5852:20): [True: 23.2k, False: 10.0k]
  ------------------
 5853|  23.2k|                  auto next = ptr + 1;
 5854|  23.2k|                  return (next == end) || *next == ' ' || *next == '\t' || *next == '\n' || *next == '\r';
  ------------------
  |  Branch (5854:26): [True: 1.37k, False: 21.8k]
  |  Branch (5854:43): [True: 18.5k, False: 3.32k]
  |  Branch (5854:59): [True: 1.57k, False: 1.75k]
  |  Branch (5854:76): [True: 664, False: 1.08k]
  |  Branch (5854:93): [True: 591, False: 495]
  ------------------
 5855|  23.2k|               }
 5856|  10.0k|               return is_plain_scalar_boundary(*ptr);
 5857|  33.2k|            };
_ZZN3glz4fromILj450ENSt3__17variantIJDndNS1_12basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEbNS1_6vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS6_ISD_EEEENSC_ISD_EEEEEE2opITnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1EEERPKcRSH_TkNS_10is_contextERNS_4yaml12yaml_contextESM_EEvOT1_OT2_OT0_T3_ENKUlcE_clEc:
 5774|  10.0k|            auto is_plain_scalar_boundary = [](const char ch) {
 5775|  10.0k|               switch (ch) {
 5776|    353|               case ' ':
  ------------------
  |  Branch (5776:16): [True: 353, False: 9.68k]
  ------------------
 5777|    726|               case '\t':
  ------------------
  |  Branch (5777:16): [True: 373, False: 9.66k]
  ------------------
 5778|  4.65k|               case '\n':
  ------------------
  |  Branch (5778:16): [True: 3.93k, False: 6.11k]
  ------------------
 5779|  7.13k|               case '\r':
  ------------------
  |  Branch (5779:16): [True: 2.47k, False: 7.56k]
  ------------------
 5780|  7.48k|               case ',':
  ------------------
  |  Branch (5780:16): [True: 354, False: 9.68k]
  ------------------
 5781|  8.12k|               case ']':
  ------------------
  |  Branch (5781:16): [True: 638, False: 9.40k]
  ------------------
 5782|  8.68k|               case '}':
  ------------------
  |  Branch (5782:16): [True: 562, False: 9.47k]
  ------------------
 5783|  8.68k|                  return true;
 5784|  1.35k|               default:
  ------------------
  |  Branch (5784:16): [True: 1.35k, False: 8.68k]
  ------------------
 5785|  1.35k|                  return false;
 5786|  10.0k|               }
 5787|  10.0k|            };
_ZZN3glz4fromILj450ENSt3__17variantIJDndNS1_12basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEbNS1_6vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS6_ISD_EEEENSC_ISD_EEEEEE2opITnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1EEERPKcRSH_TkNS_10is_contextERNS_4yaml12yaml_contextESM_EEvOT1_OT2_OT0_T3_ENKUlT_E_clISM_EEDaSZ_:
 5789|  32.4k|            auto has_indented_block_continuation = [&](auto word_end) {
 5790|       |               if constexpr (yaml::check_flow_context(Opts)) {
 5791|       |                  return false;
 5792|       |               }
 5793|  32.4k|               if (ctx.current_indent() < 0) {
  ------------------
  |  Branch (5793:20): [True: 1.78k, False: 30.6k]
  ------------------
 5794|  1.78k|                  return false;
 5795|  1.78k|               }
 5796|  30.6k|               if (word_end == end || (*word_end != '\n' && *word_end != '\r')) {
  ------------------
  |  Branch (5796:20): [True: 674, False: 30.0k]
  |  Branch (5796:40): [True: 26.0k, False: 3.92k]
  |  Branch (5796:61): [True: 23.6k, False: 2.47k]
  ------------------
 5797|  24.2k|                  return false;
 5798|  24.2k|               }
 5799|       |
 5800|  6.39k|               auto look = word_end;
 5801|  6.39k|               yaml::skip_newline(look, end);
 5802|  19.1k|               while (look != end) {
  ------------------
  |  Branch (5802:23): [True: 18.3k, False: 784]
  ------------------
 5803|  18.3k|                  int32_t line_indent = 0;
 5804|  32.6k|                  while (look != end && *look == ' ') {
  ------------------
  |  Branch (5804:26): [True: 32.3k, False: 284]
  |  Branch (5804:41): [True: 14.3k, False: 18.0k]
  ------------------
 5805|  14.3k|                     ++line_indent;
 5806|  14.3k|                     ++look;
 5807|  14.3k|                  }
 5808|  18.3k|                  if (look != end && *look == '\t') {
  ------------------
  |  Branch (5808:23): [True: 18.0k, False: 284]
  |  Branch (5808:38): [True: 395, False: 17.6k]
  ------------------
 5809|    395|                     return false;
 5810|    395|                  }
 5811|  17.9k|                  if (look == end || *look == '\n' || *look == '\r') {
  ------------------
  |  Branch (5811:23): [True: 284, False: 17.6k]
  |  Branch (5811:38): [True: 2.84k, False: 14.8k]
  |  Branch (5811:55): [True: 6.30k, False: 8.50k]
  ------------------
 5812|  9.43k|                     if (look != end) {
  ------------------
  |  Branch (5812:26): [True: 9.14k, False: 284]
  ------------------
 5813|  9.14k|                        yaml::skip_newline(look, end);
 5814|  9.14k|                        continue;
 5815|  9.14k|                     }
 5816|    284|                     return false;
 5817|  9.43k|                  }
 5818|  8.50k|                  if (*look == '#') {
  ------------------
  |  Branch (5818:23): [True: 3.62k, False: 4.88k]
  ------------------
 5819|  3.62k|                     yaml::skip_comment(look, end);
 5820|  3.62k|                     if (look != end && (*look == '\n' || *look == '\r')) {
  ------------------
  |  Branch (5820:26): [True: 3.56k, False: 56]
  |  Branch (5820:42): [True: 2.75k, False: 814]
  |  Branch (5820:59): [True: 814, False: 0]
  ------------------
 5821|  3.56k|                        yaml::skip_newline(look, end);
 5822|  3.56k|                        continue;
 5823|  3.56k|                     }
 5824|     56|                     return false;
 5825|  3.62k|                  }
 5826|       |
 5827|       |                  // If the next non-empty line is an implicit mapping entry,
 5828|       |                  // don't treat it as scalar continuation for auto-deduced
 5829|       |                  // booleans/nulls.
 5830|  4.88k|                  {
 5831|  4.88k|                     auto scan = look;
 5832|   414k|                     while (scan != end && *scan != '\n' && *scan != '\r') {
  ------------------
  |  Branch (5832:29): [True: 413k, False: 177]
  |  Branch (5832:44): [True: 413k, False: 789]
  |  Branch (5832:61): [True: 412k, False: 297]
  ------------------
 5833|   412k|                        if (*scan == ':') {
  ------------------
  |  Branch (5833:29): [True: 32.3k, False: 380k]
  ------------------
 5834|  32.3k|                           auto after_colon = scan + 1;
 5835|  32.3k|                           if (after_colon == end || *after_colon == ' ' || *after_colon == '\t' ||
  ------------------
  |  Branch (5835:32): [True: 127, False: 32.2k]
  |  Branch (5835:54): [True: 1.50k, False: 30.7k]
  |  Branch (5835:77): [True: 1.41k, False: 29.3k]
  ------------------
 5836|  29.3k|                               *after_colon == '\n' || *after_colon == '\r') {
  ------------------
  |  Branch (5836:32): [True: 191, False: 29.1k]
  |  Branch (5836:56): [True: 376, False: 28.7k]
  ------------------
 5837|  3.61k|                              return false;
 5838|  3.61k|                           }
 5839|  32.3k|                        }
 5840|   409k|                        ++scan;
 5841|   409k|                     }
 5842|  4.88k|                  }
 5843|       |
 5844|  1.26k|                  return line_indent > ctx.current_indent();
 5845|  4.88k|               }
 5846|    784|               return false;
 5847|  6.39k|            };
_ZN3glz36try_parse_block_mapping_into_variantINSt3__17variantIJDndNS1_12basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEbNS1_6vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS6_ISD_EEEENSC_ISD_EEEEETnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1EEERSH_RNS_4yaml12yaml_contextERPKcSO_EEbOT1_OT2_OT3_T4_:
 5377|   320k|   {
 5378|   320k|      using counts = yaml_variant_type_count<Variant>;
 5379|       |      if constexpr (counts::n_object == 0) {
 5380|       |         return false;
 5381|       |      }
 5382|   320k|      else {
 5383|       |         // Quick check: if no viable mapping separator in the current span,
 5384|       |         // avoid expensive speculative parse.
 5385|   320k|         const bool could_be_mapping = [&] {
 5386|   320k|            if constexpr (yaml::check_flow_context(Opts)) {
 5387|   320k|               return line_could_be_flow_mapping(it, end);
 5388|   320k|            }
 5389|   320k|            else {
 5390|   320k|               return yaml::line_could_be_block_mapping(it, end);
 5391|   320k|            }
 5392|   320k|         }();
 5393|   320k|         if (!could_be_mapping) {
  ------------------
  |  Branch (5393:14): [True: 117k, False: 203k]
  ------------------
 5394|   117k|            return false;
 5395|   117k|         }
 5396|       |         // Full parse attempt - use a temporary context that inherits indent from parent
 5397|   203k|         auto temp_ctx = ctx.make_speculative();
 5398|   203k|         process_yaml_variant_alternatives<Variant, is_yaml_variant_object>::template op<Opts>(value, temp_ctx, it,
 5399|   203k|                                                                                               end);
 5400|   203k|         ctx.alias_expansion_budget = temp_ctx.alias_expansion_budget; // charged even if rejected
 5401|   203k|         ctx.key_expansion_budget = temp_ctx.key_expansion_budget;
 5402|   203k|         if (!bool(temp_ctx.error)) {
  ------------------
  |  Branch (5402:14): [True: 190k, False: 12.3k]
  ------------------
 5403|   190k|            ctx.anchors = std::move(temp_ctx.anchors);
 5404|   190k|            return true;
 5405|   190k|         }
 5406|       |         // The line matched "key: value" pattern but parsing failed.
 5407|       |         // This indicates malformed content (e.g., unclosed flow collection),
 5408|       |         // so propagate the error rather than silently falling back to string.
 5409|  12.3k|         ctx.error = temp_ctx.error;
 5410|  12.3k|         ctx.custom_error_message = temp_ctx.custom_error_message;
 5411|  12.3k|         return false;
 5412|   203k|      }
 5413|   320k|   }
_ZZN3glz36try_parse_block_mapping_into_variantINSt3__17variantIJDndNS1_12basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEbNS1_6vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS6_ISD_EEEENSC_ISD_EEEEETnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1EEERSH_RNS_4yaml12yaml_contextERPKcSO_EEbOT1_OT2_OT3_T4_ENKUlvE_clEv:
 5385|   320k|         const bool could_be_mapping = [&] {
 5386|       |            if constexpr (yaml::check_flow_context(Opts)) {
 5387|       |               return line_could_be_flow_mapping(it, end);
 5388|       |            }
 5389|   320k|            else {
 5390|   320k|               return yaml::line_could_be_block_mapping(it, end);
 5391|   320k|            }
 5392|   320k|         }();
_ZZN3glz5parseILj450EE2opITnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1EEERNS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEETkNS_10is_contextERNS_4yaml12yaml_contextERPKcSD_EEvOT0_OT1_OT2_T3_ENKUlT_E_clISD_EEDaSM_:
  145|    387|               auto is_document_start = [&](auto pos) {
  146|    387|                  if (end - pos >= 3 && pos[0] == '-' && pos[1] == '-' && pos[2] == '-') {
  ------------------
  |  Branch (146:23): [True: 292, False: 95]
  |  Branch (146:41): [True: 138, False: 154]
  |  Branch (146:58): [True: 124, False: 14]
  |  Branch (146:75): [True: 117, False: 7]
  ------------------
  147|    117|                     auto after = pos + 3;
  148|    117|                     return after == end || *after == ' ' || *after == '\t' || *after == '\n' || *after == '\r' ||
  ------------------
  |  Branch (148:29): [True: 12, False: 105]
  |  Branch (148:45): [True: 32, False: 73]
  |  Branch (148:62): [True: 48, False: 25]
  |  Branch (148:80): [True: 12, False: 13]
  |  Branch (148:98): [True: 9, False: 4]
  ------------------
  149|      4|                            *after == '#';
  ------------------
  |  Branch (149:29): [True: 1, False: 3]
  ------------------
  150|    117|                  }
  151|    270|                  return false;
  152|    387|               };
_ZN3glz9read_yamlITnDaXtlNS_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2EEERNS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEETkNS_10contiguousERKNSt3__16vectorIcNS8_9allocatorIcEEEEEENS_9error_ctxEOT0_OT1_:
 6606|  74.0k|   {
 6607|  74.0k|      if (buffer.empty()) {
  ------------------
  |  Branch (6607:11): [True: 0, False: 74.0k]
  ------------------
 6608|      0|         using V = std::remove_cvref_t<T>;
 6609|      0|         if constexpr (requires { value = nullptr; }) {
 6610|      0|            value = nullptr;
 6611|      0|            return {};
 6612|       |         }
 6613|       |         else if constexpr (nullable_like<V>) {
 6614|       |            value = {};
 6615|       |            return {};
 6616|       |         }
 6617|      0|      }
 6618|      0|      yaml::yaml_context ctx{};
 6619|  74.0k|      return read<set_yaml<Opts>()>(std::forward<T>(value), std::forward<Buffer>(buffer), ctx);
 6620|  74.0k|   }
_ZN3glz5parseILj450EE2opITnDaXtlNS_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2EEERNS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEETkNS_10is_contextERNS3_12yaml_contextERPKcSD_EEvOT0_OT1_OT2_T3_:
   69|  74.0k|      {
   70|  74.0k|         if constexpr (requires { ctx.stream_begin; }) {
   71|  74.0k|            if (!ctx.stream_begin && it != end) {
  ------------------
  |  Branch (71:17): [True: 74.0k, False: 0]
  |  Branch (71:38): [True: 74.0k, False: 0]
  ------------------
   72|  74.0k|               ctx.stream_begin = &*it;
   73|       |               // The line memo holds pointers into whatever buffer filled it, so a reused
   74|       |               // context must not carry a previous read's into this one.
   75|  74.0k|               if constexpr (requires { ctx.reset_line_memo(); }) {
   76|  74.0k|                  ctx.reset_line_memo();
   77|  74.0k|               }
   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|  74.0k|               if constexpr (requires { ctx.alias_expansion_budget; } && requires { size_t(end - it); }) {
   82|  74.0k|                  const size_t scaled = size_t(end - it) * yaml::max_alias_expansion_factor;
   83|  74.0k|                  ctx.alias_expansion_budget =
   84|  74.0k|                     scaled > yaml::min_alias_expansion_bytes ? scaled : yaml::min_alias_expansion_bytes;
  ------------------
  |  Branch (84:22): [True: 508, False: 73.5k]
  ------------------
   85|  74.0k|               }
   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|  74.0k|               if constexpr (requires { ctx.key_expansion_budget; } && requires { size_t(end - it); }) {
   89|  74.0k|                  const size_t scaled = size_t(end - it) * yaml::max_key_expansion_factor;
   90|  74.0k|                  ctx.key_expansion_budget =
   91|  74.0k|                     scaled > yaml::min_key_expansion_bytes ? scaled : yaml::min_key_expansion_bytes;
  ------------------
  |  Branch (91:22): [True: 508, False: 73.5k]
  ------------------
   92|  74.0k|               }
   93|  74.0k|            }
   94|  74.0k|         }
   95|       |         // Skip YAML directives and document start marker (---) if present
   96|  74.0k|         yaml::skip_document_start(it, end, ctx);
   97|  74.0k|         if (bool(ctx.error)) [[unlikely]] {
  ------------------
  |  Branch (97:14): [True: 544, False: 73.5k]
  ------------------
   98|    544|            return;
   99|    544|         }
  100|       |
  101|  73.5k|         using V = std::remove_cvref_t<T>;
  102|  73.5k|         if (it == end) {
  ------------------
  |  Branch (102:14): [True: 70, False: 73.4k]
  ------------------
  103|       |            // An empty document is a valid YAML null document.
  104|     70|            if constexpr (requires { value = nullptr; }) {
  105|     70|               value = nullptr;
  106|     70|               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|     70|         }
  117|       |
  118|       |         // A bare document boundary marker at root denotes an empty document.
  119|       |         // Examples: "---\n---\n", "# comment\n...\n"
  120|  73.5k|         if (yaml::at_document_start(it, end) || yaml::at_document_end(it, end)) {
  ------------------
  |  Branch (120:14): [True: 81, False: 73.4k]
  |  Branch (120:50): [True: 20, False: 73.4k]
  ------------------
  121|     31|            if constexpr (requires { value = nullptr; }) {
  122|     31|               value = nullptr;
  123|     31|               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|     31|         }
  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|  73.5k|         if constexpr (!check_partial_read(Opts)) {
  144|  73.5k|            if (!bool(ctx.error) && ctx.current_indent() < 0) {
  ------------------
  |  Branch (144:17): [True: 13.2k, False: 60.3k]
  |  Branch (144:37): [True: 13.2k, False: 0]
  ------------------
  145|  13.2k|               auto is_document_start = [&](auto pos) {
  146|  13.2k|                  if (end - pos >= 3 && pos[0] == '-' && pos[1] == '-' && pos[2] == '-') {
  147|  13.2k|                     auto after = pos + 3;
  148|  13.2k|                     return after == end || *after == ' ' || *after == '\t' || *after == '\n' || *after == '\r' ||
  149|  13.2k|                            *after == '#';
  150|  13.2k|                  }
  151|  13.2k|                  return false;
  152|  13.2k|               };
  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.2k|               if constexpr (requires { ctx.line_prefix_before(it); }) {
  162|  13.2k|                  if (it != end && ctx.line_prefix_before(it).has_content) {
  ------------------
  |  Branch (162:23): [True: 2.60k, False: 10.6k]
  |  Branch (162:23): [True: 1.74k, False: 11.4k]
  |  Branch (162:36): [True: 1.74k, False: 868]
  ------------------
  163|  1.74k|                     auto rest = it;
  164|  5.13k|                     while (rest != end && (*rest == ' ' || *rest == '\t')) ++rest;
  ------------------
  |  Branch (164:29): [True: 5.10k, False: 35]
  |  Branch (164:45): [True: 1.19k, False: 3.90k]
  |  Branch (164:61): [True: 2.19k, False: 1.70k]
  ------------------
  165|  1.74k|                     if (rest != end && *rest != '\n' && *rest != '\r' && *rest != '#') {
  ------------------
  |  Branch (165:26): [True: 1.70k, False: 35]
  |  Branch (165:41): [True: 1.29k, False: 415]
  |  Branch (165:58): [True: 925, False: 366]
  |  Branch (165:75): [True: 765, False: 160]
  ------------------
  166|    765|                        ctx.error = error_code::syntax_error;
  167|    765|                        return;
  168|    765|                     }
  169|  1.74k|                  }
  170|  13.2k|               }
  171|       |
  172|  12.4k|               auto tail_scan = it;
  173|  13.2k|               bool seen_document_end_marker = false;
  174|  28.6k|               while (tail_scan != end) {
  ------------------
  |  Branch (174:23): [True: 16.7k, False: 11.8k]
  ------------------
  175|  16.7k|                  auto line = tail_scan;
  176|  22.6k|                  while (line != end && (*line == ' ' || *line == '\t')) ++line;
  ------------------
  |  Branch (176:26): [True: 22.6k, False: 64]
  |  Branch (176:42): [True: 4.94k, False: 17.6k]
  |  Branch (176:58): [True: 999, False: 16.6k]
  ------------------
  177|  16.7k|                  if (line != tail_scan && line != end && *line != '\n' && *line != '\r' && *line != '#') {
  ------------------
  |  Branch (177:23): [True: 2.59k, False: 14.1k]
  |  Branch (177:44): [True: 2.53k, False: 64]
  |  Branch (177:59): [True: 1.77k, False: 753]
  |  Branch (177:76): [True: 1.09k, False: 682]
  |  Branch (177:93): [True: 230, False: 865]
  ------------------
  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|    230|                     const char first = *line;
  182|    230|                     const bool explicit_or_structural_start =
  183|    230|                        (first == ':' || first == '?' || first == '!' || first == '&' || first == '*' || first == '[' ||
  ------------------
  |  Branch (183:26): [True: 16, False: 214]
  |  Branch (183:42): [True: 4, False: 210]
  |  Branch (183:58): [True: 5, False: 205]
  |  Branch (183:74): [True: 5, False: 200]
  |  Branch (183:90): [True: 11, False: 189]
  |  Branch (183:106): [True: 5, False: 184]
  ------------------
  184|    184|                         first == '{' || first == '"' || first == '\'' || first == '-');
  ------------------
  |  Branch (184:26): [True: 3, False: 181]
  |  Branch (184:42): [True: 4, False: 177]
  |  Branch (184:58): [True: 3, False: 174]
  |  Branch (184:75): [True: 12, False: 162]
  ------------------
  185|    230|                     if (!explicit_or_structural_start) {
  ------------------
  |  Branch (185:26): [True: 162, False: 68]
  ------------------
  186|    162|                        auto scan = line;
  187|  2.33k|                        while (scan != end && *scan != '\n' && *scan != '\r') {
  ------------------
  |  Branch (187:32): [True: 2.23k, False: 97]
  |  Branch (187:47): [True: 2.22k, False: 15]
  |  Branch (187:64): [True: 2.21k, False: 5]
  ------------------
  188|  2.21k|                           if (*scan == ':') {
  ------------------
  |  Branch (188:32): [True: 646, False: 1.57k]
  ------------------
  189|    646|                              auto after = scan + 1;
  190|    646|                              if (after == end || *after == ' ' || *after == '\t' || *after == '\n' || *after == '\r') {
  ------------------
  |  Branch (190:35): [True: 13, False: 633]
  |  Branch (190:51): [True: 7, False: 626]
  |  Branch (190:68): [True: 7, False: 619]
  |  Branch (190:86): [True: 7, False: 612]
  |  Branch (190:104): [True: 11, False: 601]
  ------------------
  191|     45|                                 ctx.error = error_code::syntax_error;
  192|     45|                                 return;
  193|     45|                              }
  194|    646|                           }
  195|  2.17k|                           ++scan;
  196|  2.17k|                        }
  197|    162|                     }
  198|    185|                     return;
  199|    230|                  }
  200|  16.5k|                  if (line == end) {
  ------------------
  |  Branch (200:23): [True: 64, False: 16.4k]
  ------------------
  201|     64|                     return;
  202|     64|                  }
  203|  16.4k|                  if (*line == ':' || *line == '?') {
  ------------------
  |  Branch (203:23): [True: 43, False: 16.4k]
  |  Branch (203:39): [True: 24, False: 16.3k]
  ------------------
  204|     67|                     return; // Explicit key/value continuation.
  205|     67|                  }
  206|  16.3k|                  if (*line == '\n' || *line == '\r') {
  ------------------
  |  Branch (206:23): [True: 6.74k, False: 9.63k]
  |  Branch (206:40): [True: 4.66k, False: 4.97k]
  ------------------
  207|  11.4k|                     tail_scan = line;
  208|  11.4k|                     yaml::skip_newline(tail_scan, end);
  209|  11.4k|                     continue;
  210|  11.4k|                  }
  211|  4.97k|                  if (*line == '#') {
  ------------------
  |  Branch (211:23): [True: 2.70k, False: 2.26k]
  ------------------
  212|  22.6k|                     while (tail_scan != end && *tail_scan != '\n' && *tail_scan != '\r') ++tail_scan;
  ------------------
  |  Branch (212:29): [True: 22.4k, False: 167]
  |  Branch (212:49): [True: 21.5k, False: 976]
  |  Branch (212:71): [True: 19.9k, False: 1.56k]
  ------------------
  213|  2.70k|                     yaml::skip_newline(tail_scan, end);
  214|  2.70k|                     continue;
  215|  2.70k|                  }
  216|  2.26k|                  if (yaml::at_document_end(line, end)) {
  ------------------
  |  Branch (216:23): [True: 1.28k, False: 987]
  ------------------
  217|  1.28k|                     seen_document_end_marker = true;
  218|  17.3k|                     while (tail_scan != end && *tail_scan != '\n' && *tail_scan != '\r') ++tail_scan;
  ------------------
  |  Branch (218:29): [True: 17.2k, False: 107]
  |  Branch (218:49): [True: 16.6k, False: 688]
  |  Branch (218:71): [True: 16.1k, False: 485]
  ------------------
  219|  1.28k|                     yaml::skip_newline(tail_scan, end);
  220|  1.28k|                     continue;
  221|  1.28k|                  }
  222|    987|                  if (is_document_start(line)) {
  ------------------
  |  Branch (222:23): [True: 214, False: 773]
  ------------------
  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|    214|                     auto header = line + 3;
  228|  1.49k|                     while (header != end && (*header == ' ' || *header == '\t')) ++header;
  ------------------
  |  Branch (228:29): [True: 1.47k, False: 22]
  |  Branch (228:47): [True: 672, False: 803]
  |  Branch (228:65): [True: 611, False: 192]
  ------------------
  229|    214|                     if (header != end && *header == '!') {
  ------------------
  |  Branch (229:26): [True: 192, False: 22]
  |  Branch (229:43): [True: 78, False: 114]
  ------------------
  230|     78|                        auto tag_end = header + 1;
  231|  87.7k|                        while (tag_end != end && *tag_end != ' ' && *tag_end != '\t' && *tag_end != '\n' &&
  ------------------
  |  Branch (231:32): [True: 87.7k, False: 20]
  |  Branch (231:50): [True: 87.7k, False: 25]
  |  Branch (231:69): [True: 87.7k, False: 14]
  |  Branch (231:89): [True: 87.6k, False: 11]
  ------------------
  232|  87.6k|                               *tag_end != '\r' && *tag_end != '#') {
  ------------------
  |  Branch (232:32): [True: 87.6k, False: 3]
  |  Branch (232:52): [True: 87.6k, False: 5]
  ------------------
  233|  87.6k|                           ++tag_end;
  234|  87.6k|                        }
  235|     78|                        std::string_view tag_token(header, static_cast<size_t>(tag_end - header));
  236|     78|                        const auto second_bang = tag_token.find('!', 1);
  237|     78|                        if (second_bang != std::string_view::npos) {
  ------------------
  |  Branch (237:29): [True: 40, False: 38]
  ------------------
  238|     40|                           std::string_view handle = tag_token.substr(0, second_bang + 1);
  239|     40|                           if (handle != "!" && handle != "!!") {
  ------------------
  |  Branch (239:32): [True: 40, False: 0]
  |  Branch (239:49): [True: 37, False: 3]
  ------------------
  240|     37|                              ctx.error = error_code::syntax_error;
  241|     37|                              return;
  242|     37|                           }
  243|     40|                        }
  244|     78|                     }
  245|    177|                     return; // Additional documents are allowed in the stream tail.
  246|    214|                  }
  247|    773|                  if (line != end && *line == '%') {
  ------------------
  |  Branch (247:23): [True: 773, False: 0]
  |  Branch (247:38): [True: 20, False: 753]
  ------------------
  248|       |                     // YAML directives are only valid in document prefixes. A directive
  249|       |                     // encountered mid-document (without a prior ...) is malformed.
  250|     20|                     if (!seen_document_end_marker) {
  ------------------
  |  Branch (250:26): [True: 13, False: 7]
  ------------------
  251|     13|                        ctx.error = error_code::syntax_error;
  252|     13|                        return;
  253|     13|                     }
  254|      7|                     return;
  255|     20|                  }
  256|    753|                  if (seen_document_end_marker) {
  ------------------
  |  Branch (256:23): [True: 94, False: 659]
  ------------------
  257|     94|                     return; // Implicit next document after explicit document end marker.
  258|     94|                  }
  259|    659|                  ctx.error = error_code::syntax_error;
  260|    659|                  return;
  261|    753|               }
  262|  13.2k|            }
  263|  73.5k|         }
  264|  73.5k|      }
_ZN3glz4fromILj450ENS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEEE2opITnDaXtlNS_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2EEERS4_TkNS_10is_contextERNS7_12yaml_contextERPKcSD_EEvOT0_OT1_OT2_T3_:
  274|  1.34M|      {
  275|  1.34M|         using V = std::decay_t<decltype(get_member(std::declval<Value>(), meta_wrapper_v<T>))>;
  276|  1.34M|         from<YAML, V>::template op<Opts>(get_member(std::forward<Value>(value), meta_wrapper_v<T>),
  277|  1.34M|                                          std::forward<Ctx>(ctx), std::forward<It0>(it), end);
  278|  1.34M|      }
_ZN3glz4fromILj450ENSt3__17variantIJDndNS1_12basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEbNS1_6vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS6_ISD_EEEENSC_ISD_EEEEEE2opITnDaXtlNS_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2EEERPKcRSH_TkNS_10is_contextERNSK_12yaml_contextESN_EEvOT1_OT2_OT0_T3_:
 5635|  1.74M|      {
 5636|       |         // Inside op() rather than at class scope: read_supported is `requires { from<Format, T>{}; }`,
 5637|       |         // so a class-scope assert turns that feature probe into a hard error instead of `false`.
 5638|  1.74M|         static_assert(content_v<std::remove_cvref_t<T>>.empty(),
 5639|  1.74M|                       "Adjacent variant tagging (glz::meta `content`) is implemented for JSON and "
 5640|  1.74M|                       "BEVE but not yet for YAML. Reading this variant as YAML would silently expect "
 5641|  1.74M|                       "the internally tagged shape, so it is rejected here instead.");
 5642|  1.74M|         if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (5642:14): [True: 0, False: 1.74M]
  ------------------
 5643|      0|            return;
 5644|       |
 5645|       |         // Every nested generic/variant value routes back through this reader, so bounding
 5646|       |         // depth here caps flow-collection and flow-embedded mapping recursion that the
 5647|       |         // indent stack does not cover.
 5648|  1.74M|         depth_guard guard{ctx, yaml::max_yaml_recursive_depth};
 5649|  1.74M|         if (!guard) [[unlikely]]
  ------------------
  |  Branch (5649:14): [True: 76, False: 1.74M]
  ------------------
 5650|     76|            return;
 5651|       |
 5652|       |         // At root level (indent == -1), skip leading whitespace, newlines, and comments
 5653|       |         // For nested values, only skip inline whitespace to preserve block structure
 5654|  1.74M|         if (ctx.current_indent() < 0) {
  ------------------
  |  Branch (5654:14): [True: 227k, False: 1.52M]
  ------------------
 5655|   227k|            yaml::skip_ws_newlines_comments(it, end);
 5656|   227k|         }
 5657|  1.52M|         else {
 5658|  1.52M|            yaml::skip_inline_ws(it, end);
 5659|  1.52M|         }
 5660|       |
 5661|  1.74M|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (5661:14): [True: 103, False: 1.74M]
  ------------------
 5662|    103|            ctx.error = error_code::unexpected_end;
 5663|    103|            return;
 5664|    103|         }
 5665|       |
 5666|       |         // Tagged variants: a discriminator key (meta::tag) selects the alternative, with the
 5667|       |         // matching meta::ids entry naming each type. This mirrors the JSON behavior so the
 5668|       |         // same variant definitions round-trip across both formats.
 5669|       |         if constexpr (not tag_v<std::remove_cvref_t<T>>.empty()) {
 5670|       |            using V = std::remove_cvref_t<T>;
 5671|       |            const bool value_is_mapping =
 5672|       |               (*it == '{') || (!yaml::check_flow_context(Opts) && yaml::line_could_be_block_mapping(it, end));
 5673|       |            if (value_is_mapping) {
 5674|       |               // The mapping's keys sit at the column of `it`. Recover that column from the buffer:
 5675|       |               // the indent stack carries the parent context's indent (a struct member, a sequence
 5676|       |               // item, etc. each push a different offset), not this mapping's true column (see helper).
 5677|       |               const int32_t mapping_column = tagged_mapping_visual_indent(ctx, it, ctx.current_indent() + 1);
 5678|       |               auto tag_ctx = ctx.make_speculative();
 5679|       |               const size_t index = scan_variant_tag_index<V, Opts>(tag_ctx, it, end, mapping_column);
 5680|       |               ctx.alias_expansion_budget = tag_ctx.alias_expansion_budget; // charged even if no tag matched
 5681|       |               ctx.key_expansion_budget = tag_ctx.key_expansion_budget;
 5682|       |               if (index < ids_v<V>.size()) {
 5683|       |                  static constexpr auto tag_literal = string_literal_from_view<tag_v<V>.size()>(tag_v<V>);
 5684|       |                  emplace_runtime_variant(value, index);
 5685|       |                  // Establish the mapping's true column on the indent stack for the alternative parse.
 5686|       |                  // The chosen object is then parsed - and the discriminator's inline value skipped -
 5687|       |                  // at a consistent indent in every context, so a tag on the first key does not fold
 5688|       |                  // the following sibling entries into its value (no special-casing needed downstream).
 5689|       |                  if (!ctx.push_indent(mapping_column)) [[unlikely]] {
 5690|       |                     ctx.error = error_code::exceeded_max_recursive_depth;
 5691|       |                     return;
 5692|       |                  }
 5693|       |                  std::visit(
 5694|       |                     [&](auto&& alt) {
 5695|       |                        using Alt = std::remove_cvref_t<decltype(alt)>;
 5696|       |                        if constexpr ((glaze_object_t<Alt> || reflectable<Alt>) && not custom_read<Alt>) {
 5697|       |                           // Parse the mapping into the resolved struct; the tag key is skipped.
 5698|       |                           from<YAML, Alt>::template op<Opts, tag_literal>(alt, ctx, it, end);
 5699|       |                        }
 5700|       |                        else if constexpr (custom_read<Alt>) {
 5701|       |                           // Custom alternatives read the mapping body themselves and cannot skip an
 5702|       |                           // interior tag key the way reflected objects do, so the tag must be the
 5703|       |                           // first key (glaze always writes it first). Consume that leading "tag: id"
 5704|       |                           // entry, then hand the remaining mapping to the custom handler.
 5705|       |                           if constexpr (yaml::check_flow_context(Opts)) {
 5706|       |                              ctx.error = error_code::feature_not_supported;
 5707|       |                              ctx.custom_error_message =
 5708|       |                                 "custom variant alternatives are not supported in YAML flow style";
 5709|       |                           }
 5710|       |                           else {
 5711|       |                              ctx.scratch.clear();
 5712|       |                              if (yaml::parse_yaml_key(ctx.scratch, ctx, it, end, false)) {
 5713|       |                                 if (std::string_view{ctx.scratch} != tag_v<V>) {
 5714|       |                                    ctx.error = error_code::feature_not_supported;
 5715|       |                                    ctx.custom_error_message =
 5716|       |                                       "the tag must be the first key for a custom variant alternative";
 5717|       |                                 }
 5718|       |                                 else {
 5719|       |                                    yaml::skip_inline_ws(it, end);
 5720|       |                                    if (it == end || *it != ':') {
 5721|       |                                       ctx.error = error_code::syntax_error;
 5722|       |                                    }
 5723|       |                                    else {
 5724|       |                                       ++it;
 5725|       |                                       yaml::skip_inline_ws(it, end);
 5726|       |                                       yaml::skip_unknown_block_value<Opts>(ctx, it, end, mapping_column);
 5727|       |                                       if (!bool(ctx.error)) {
 5728|       |                                          // If nothing but trailing whitespace/comments remains, the tag
 5729|       |                                          // was the whole mapping: leave the alternative default.
 5730|       |                                          auto probe = it;
 5731|       |                                          yaml::skip_ws_newlines_comments(probe, end);
 5732|       |                                          if (probe == end) {
 5733|       |                                             it = probe;
 5734|       |                                          }
 5735|       |                                          else {
 5736|       |                                             // Publish the mapping's column so the custom handler's block
 5737|       |                                             // mapping (which would otherwise discover its own indent) reads
 5738|       |                                             // the remaining entries at the variant's indent and dedents
 5739|       |                                             // correctly in every context (root, sequence, nested).
 5740|       |                                             ctx.forced_block_mapping_indent = mapping_column;
 5741|       |                                             from<YAML, Alt>::template op<Opts>(alt, ctx, it, end);
 5742|       |                                             ctx.forced_block_mapping_indent = -1;
 5743|       |                                          }
 5744|       |                                       }
 5745|       |                                    }
 5746|       |                                 }
 5747|       |                              }
 5748|       |                           }
 5749|       |                        }
 5750|       |                        else {
 5751|       |                           // Non-object alternative (e.g. std::monostate): the emplaced default is
 5752|       |                           // the value, but the mapping must still be consumed.
 5753|       |                           walk_tagged_mapping<Opts>(
 5754|       |                              ctx, it, end, tag_v<V>, mapping_column,
 5755|       |                              [&](auto&& c, auto&& i, auto&& e, int32_t line_indent, bool in_flow) {
 5756|       |                                 yaml::skip_yaml_value<Opts>(c, i, e, in_flow ? 0 : line_indent, in_flow);
 5757|       |                              });
 5758|       |                        }
 5759|       |                     },
 5760|       |                     value);
 5761|       |                  ctx.pop_indent();
 5762|       |                  return;
 5763|       |               }
 5764|       |               // No resolvable tag key was found. Fall through to structural deduction:
 5765|       |               // if the alternatives are distinguishable by their fields this still succeeds,
 5766|       |               // otherwise the deduction path reports no_matching_variant_type.
 5767|       |            }
 5768|       |         }
 5769|       |
 5770|  1.74M|         if constexpr (yaml_variant_is_auto_deducible<std::remove_cvref_t<T>>()) {
 5771|  1.74M|            using V = std::remove_cvref_t<T>;
 5772|  1.74M|            using counts = yaml_variant_type_count<V>;
 5773|  1.74M|            const char c = *it;
 5774|  1.74M|            auto is_plain_scalar_boundary = [](const char ch) {
 5775|  1.74M|               switch (ch) {
 5776|  1.74M|               case ' ':
 5777|  1.74M|               case '\t':
 5778|  1.74M|               case '\n':
 5779|  1.74M|               case '\r':
 5780|  1.74M|               case ',':
 5781|  1.74M|               case ']':
 5782|  1.74M|               case '}':
 5783|  1.74M|                  return true;
 5784|  1.74M|               default:
 5785|  1.74M|                  return false;
 5786|  1.74M|               }
 5787|  1.74M|            };
 5788|       |
 5789|  1.74M|            auto has_indented_block_continuation = [&](auto word_end) {
 5790|  1.74M|               if constexpr (yaml::check_flow_context(Opts)) {
 5791|  1.74M|                  return false;
 5792|  1.74M|               }
 5793|  1.74M|               if (ctx.current_indent() < 0) {
 5794|  1.74M|                  return false;
 5795|  1.74M|               }
 5796|  1.74M|               if (word_end == end || (*word_end != '\n' && *word_end != '\r')) {
 5797|  1.74M|                  return false;
 5798|  1.74M|               }
 5799|       |
 5800|  1.74M|               auto look = word_end;
 5801|  1.74M|               yaml::skip_newline(look, end);
 5802|  1.74M|               while (look != end) {
 5803|  1.74M|                  int32_t line_indent = 0;
 5804|  1.74M|                  while (look != end && *look == ' ') {
 5805|  1.74M|                     ++line_indent;
 5806|  1.74M|                     ++look;
 5807|  1.74M|                  }
 5808|  1.74M|                  if (look != end && *look == '\t') {
 5809|  1.74M|                     return false;
 5810|  1.74M|                  }
 5811|  1.74M|                  if (look == end || *look == '\n' || *look == '\r') {
 5812|  1.74M|                     if (look != end) {
 5813|  1.74M|                        yaml::skip_newline(look, end);
 5814|  1.74M|                        continue;
 5815|  1.74M|                     }
 5816|  1.74M|                     return false;
 5817|  1.74M|                  }
 5818|  1.74M|                  if (*look == '#') {
 5819|  1.74M|                     yaml::skip_comment(look, end);
 5820|  1.74M|                     if (look != end && (*look == '\n' || *look == '\r')) {
 5821|  1.74M|                        yaml::skip_newline(look, end);
 5822|  1.74M|                        continue;
 5823|  1.74M|                     }
 5824|  1.74M|                     return false;
 5825|  1.74M|                  }
 5826|       |
 5827|       |                  // If the next non-empty line is an implicit mapping entry,
 5828|       |                  // don't treat it as scalar continuation for auto-deduced
 5829|       |                  // booleans/nulls.
 5830|  1.74M|                  {
 5831|  1.74M|                     auto scan = look;
 5832|  1.74M|                     while (scan != end && *scan != '\n' && *scan != '\r') {
 5833|  1.74M|                        if (*scan == ':') {
 5834|  1.74M|                           auto after_colon = scan + 1;
 5835|  1.74M|                           if (after_colon == end || *after_colon == ' ' || *after_colon == '\t' ||
 5836|  1.74M|                               *after_colon == '\n' || *after_colon == '\r') {
 5837|  1.74M|                              return false;
 5838|  1.74M|                           }
 5839|  1.74M|                        }
 5840|  1.74M|                        ++scan;
 5841|  1.74M|                     }
 5842|  1.74M|                  }
 5843|       |
 5844|  1.74M|                  return line_indent > ctx.current_indent();
 5845|  1.74M|               }
 5846|  1.74M|               return false;
 5847|  1.74M|            };
 5848|  1.74M|            auto is_word_boundary = [&](const auto ptr) {
 5849|  1.74M|               if (ptr == end) {
 5850|  1.74M|                  return true;
 5851|  1.74M|               }
 5852|  1.74M|               if (*ptr == ':') {
 5853|  1.74M|                  auto next = ptr + 1;
 5854|  1.74M|                  return (next == end) || *next == ' ' || *next == '\t' || *next == '\n' || *next == '\r';
 5855|  1.74M|               }
 5856|  1.74M|               return is_plain_scalar_boundary(*ptr);
 5857|  1.74M|            };
 5858|       |
 5859|  1.74M|            switch (c) {
 5860|   319k|            case '&': {
  ------------------
  |  Branch (5860:13): [True: 319k, False: 1.42M]
  ------------------
 5861|       |               // Anchor before value: parse name, then re-dispatch
 5862|   319k|               ++it;
 5863|   319k|               auto aname = yaml::parse_anchor_name(it, end);
 5864|   319k|               if (aname.empty()) {
  ------------------
  |  Branch (5864:20): [True: 163, False: 319k]
  ------------------
 5865|    163|                  ctx.error = error_code::syntax_error;
 5866|    163|                  return;
 5867|    163|               }
 5868|   319k|               yaml::skip_inline_ws(it, end);
 5869|   319k|               bool anchor_on_same_line = true;
 5870|   319k|               bool value_is_indentless_sequence = false;
 5871|   319k|               if (it == end || *it == '\n' || *it == '\r' || *it == '#') {
  ------------------
  |  Branch (5871:20): [True: 5.94k, False: 313k]
  |  Branch (5871:33): [True: 32.5k, False: 280k]
  |  Branch (5871:48): [True: 29.7k, False: 250k]
  |  Branch (5871:63): [True: 10.0k, False: 240k]
  ------------------
 5872|       |                  // Anchor followed by end-of-line. Check if the value continues on the
 5873|       |                  // next line (indented past current context) or if this is an empty node.
 5874|  78.3k|                  bool value_on_next_line = false;
 5875|  78.3k|                  if (it != end) {
  ------------------
  |  Branch (5875:23): [True: 72.4k, False: 5.94k]
  ------------------
 5876|  72.4k|                     auto peek = it;
 5877|       |                     // Skip comment if present
 5878|  72.4k|                     if (*peek == '#') {
  ------------------
  |  Branch (5878:26): [True: 10.0k, False: 62.3k]
  ------------------
 5879|  3.18M|                        while (peek != end && *peek != '\n' && *peek != '\r') ++peek;
  ------------------
  |  Branch (5879:32): [True: 3.18M, False: 819]
  |  Branch (5879:47): [True: 3.18M, False: 4.23k]
  |  Branch (5879:64): [True: 3.17M, False: 5.04k]
  ------------------
 5880|  10.0k|                     }
 5881|       |                     // Skip newline
 5882|  72.4k|                     if (peek != end && (*peek == '\n' || *peek == '\r')) {
  ------------------
  |  Branch (5882:26): [True: 71.6k, False: 819]
  |  Branch (5882:42): [True: 36.8k, False: 34.8k]
  |  Branch (5882:59): [True: 34.8k, False: 0]
  ------------------
 5883|  71.6k|                        yaml::skip_newline(peek, end);
 5884|       |                        // Skip blank lines
 5885|   124k|                        while (peek != end && (*peek == '\n' || *peek == '\r')) {
  ------------------
  |  Branch (5885:32): [True: 114k, False: 10.2k]
  |  Branch (5885:48): [True: 3.31k, False: 110k]
  |  Branch (5885:65): [True: 49.4k, False: 61.3k]
  ------------------
 5886|  52.7k|                           yaml::skip_newline(peek, end);
 5887|  52.7k|                        }
 5888|       |                        // Measure indent of next content line
 5889|  71.6k|                        int32_t next_indent = 0;
 5890|   117k|                        while (peek != end && *peek == ' ') {
  ------------------
  |  Branch (5890:32): [True: 107k, False: 10.7k]
  |  Branch (5890:47): [True: 46.1k, False: 60.8k]
  ------------------
 5891|  46.1k|                           ++next_indent;
 5892|  46.1k|                           ++peek;
 5893|  46.1k|                        }
 5894|  71.6k|                        if (peek != end && *peek != '\n' && *peek != '\r') {
  ------------------
  |  Branch (5894:29): [True: 60.8k, False: 10.7k]
  |  Branch (5894:44): [True: 60.2k, False: 592]
  |  Branch (5894:61): [True: 59.3k, False: 905]
  ------------------
 5895|  59.3k|                           const bool indentless_sequence =
 5896|  59.3k|                              (!ctx.sequence_item_value_context) && (*peek == '-') &&
  ------------------
  |  Branch (5896:31): [True: 53.0k, False: 6.35k]
  |  Branch (5896:69): [True: 29.9k, False: 23.1k]
  ------------------
 5897|  29.9k|                              ((peek + 1) == end ||
  ------------------
  |  Branch (5897:32): [True: 1.01k, False: 28.9k]
  ------------------
 5898|  28.9k|                               yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*(peek + 1))]) &&
  ------------------
  |  Branch (5898:32): [True: 28.2k, False: 650]
  ------------------
 5899|  29.2k|                              (next_indent == ctx.current_indent() ||
  ------------------
  |  Branch (5899:32): [True: 24.1k, False: 5.09k]
  ------------------
 5900|  5.09k|                               (ctx.current_indent() > 0 && (next_indent + 1) == ctx.current_indent()));
  ------------------
  |  Branch (5900:33): [True: 2.52k, False: 2.57k]
  |  Branch (5900:61): [True: 1.97k, False: 552]
  ------------------
 5901|  59.3k|                           value_is_indentless_sequence = indentless_sequence;
 5902|  59.3k|                           const bool same_indent_property_node =
 5903|  59.3k|                              (next_indent == ctx.current_indent()) &&
  ------------------
  |  Branch (5903:31): [True: 34.7k, False: 24.6k]
  ------------------
 5904|  34.7k|                              (*peek == '!' || *peek == '&' || *peek == '*' || *peek == '[' || *peek == '{' ||
  ------------------
  |  Branch (5904:32): [True: 626, False: 34.1k]
  |  Branch (5904:48): [True: 6.43k, False: 27.7k]
  |  Branch (5904:64): [True: 312, False: 27.3k]
  |  Branch (5904:80): [True: 576, False: 26.8k]
  |  Branch (5904:96): [True: 93, False: 26.7k]
  ------------------
 5905|  26.7k|                               *peek == '"' || *peek == '\'' || *peek == '|' || *peek == '>');
  ------------------
  |  Branch (5905:32): [True: 153, False: 26.5k]
  |  Branch (5905:48): [True: 200, False: 26.3k]
  |  Branch (5905:65): [True: 1.10k, False: 25.2k]
  |  Branch (5905:81): [True: 79, False: 25.1k]
  ------------------
 5906|  59.3k|                           value_on_next_line =
 5907|  59.3k|                              (next_indent > ctx.current_indent()) || indentless_sequence || same_indent_property_node;
  ------------------
  |  Branch (5907:31): [True: 15.3k, False: 43.9k]
  |  Branch (5907:71): [True: 26.1k, False: 17.8k]
  |  Branch (5907:94): [True: 9.57k, False: 8.26k]
  ------------------
 5908|  59.3k|                        }
 5909|  71.6k|                     }
 5910|  72.4k|                  }
 5911|  78.3k|                  if (!value_on_next_line) {
  ------------------
  |  Branch (5911:23): [True: 27.2k, False: 51.1k]
  ------------------
 5912|       |                     // Anchor on empty/null node — store empty span, leave value as default
 5913|  27.2k|                     ctx.anchors[std::string(aname)] = {&*it, &*it, ctx.current_indent()};
 5914|  27.2k|                     return;
 5915|  27.2k|                  }
 5916|       |                  // Value is on next line — advance past newline/blank lines to the content
 5917|  51.1k|                  if (*it == '#') {
  ------------------
  |  Branch (5917:23): [True: 3.71k, False: 47.4k]
  ------------------
 5918|  2.77M|                     while (it != end && *it != '\n' && *it != '\r') ++it;
  ------------------
  |  Branch (5918:29): [True: 2.77M, False: 0]
  |  Branch (5918:42): [True: 2.77M, False: 1.03k]
  |  Branch (5918:57): [True: 2.76M, False: 2.68k]
  ------------------
 5919|  3.71k|                  }
 5920|  51.1k|                  if (it != end) yaml::skip_newline(it, end);
  ------------------
  |  Branch (5920:23): [True: 51.1k, False: 0]
  ------------------
 5921|  60.3k|                  while (it != end && (*it == '\n' || *it == '\r')) {
  ------------------
  |  Branch (5921:26): [True: 60.3k, False: 0]
  |  Branch (5921:40): [True: 2.25k, False: 58.1k]
  |  Branch (5921:55): [True: 6.98k, False: 51.1k]
  ------------------
 5922|  9.23k|                     yaml::skip_newline(it, end);
 5923|  9.23k|                  }
 5924|  51.1k|                  yaml::skip_inline_ws(it, end);
 5925|  51.1k|                  anchor_on_same_line = false;
 5926|  51.1k|               }
 5927|       |
 5928|   291k|               if constexpr (!yaml::check_flow_context(Opts)) {
 5929|   291k|                  if (anchor_on_same_line && *it == '-' &&
  ------------------
  |  Branch (5929:23): [True: 240k, False: 51.1k]
  |  Branch (5929:46): [True: 1.09k, False: 239k]
  ------------------
 5930|  1.09k|                      ((it + 1) == end || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*(it + 1))])) {
  ------------------
  |  Branch (5930:24): [True: 21, False: 1.07k]
  |  Branch (5930:43): [True: 17, False: 1.05k]
  ------------------
 5931|       |                     // "&anchor - item" is malformed in block context.
 5932|     38|                     ctx.error = error_code::syntax_error;
 5933|     38|                     return;
 5934|     38|                  }
 5935|   291k|               }
 5936|       |
 5937|       |               // Anchor on alias (&anchor *alias) is invalid per YAML spec.
 5938|       |               // But alias-as-key (&anchor *alias : value) is valid.
 5939|   291k|               if (it != end && *it == '*' && !yaml::alias_token_is_mapping_key(it, end)) {
  ------------------
  |  Branch (5939:20): [True: 291k, False: 53]
  |  Branch (5939:33): [True: 2.62k, False: 289k]
  |  Branch (5939:47): [True: 213, False: 2.41k]
  ------------------
 5940|    213|                  ctx.error = error_code::syntax_error;
 5941|    213|                  return;
 5942|    213|               }
 5943|       |
 5944|   291k|               if constexpr (!yaml::check_flow_context(Opts)) {
 5945|   291k|                  if (!anchor_on_same_line && it != end && *it == '&') {
  ------------------
  |  Branch (5945:23): [True: 51.0k, False: 240k]
  |  Branch (5945:47): [True: 51.0k, False: 15]
  |  Branch (5945:60): [True: 8.97k, False: 42.0k]
  ------------------
 5946|  8.97k|                     auto probe = it + 1;
 5947|  8.97k|                     auto nested_anchor_name = yaml::parse_anchor_name(probe, end);
 5948|  8.97k|                     if (nested_anchor_name.empty()) {
  ------------------
  |  Branch (5948:26): [True: 19, False: 8.95k]
  ------------------
 5949|     19|                        ctx.error = error_code::syntax_error;
 5950|     19|                        return;
 5951|     19|                     }
 5952|  8.95k|                     yaml::skip_inline_ws(probe, end);
 5953|       |                     // Allow nested anchor usage only when it clearly starts a
 5954|       |                     // nested mapping entry ("&k key: value"). Otherwise this is
 5955|       |                     // a second anchor on the same node (4JVG-style), which is invalid.
 5956|  8.95k|                     if (!yaml::line_could_be_block_mapping(probe, end)) {
  ------------------
  |  Branch (5956:26): [True: 103, False: 8.85k]
  ------------------
 5957|    103|                        ctx.error = error_code::syntax_error;
 5958|    103|                        return;
 5959|    103|                     }
 5960|  8.95k|                  }
 5961|   291k|               }
 5962|       |
 5963|   291k|               const char* anchor_start = &*it;
 5964|   291k|               const int32_t anchor_indent = ctx.current_indent();
 5965|       |
 5966|   291k|               if constexpr (!yaml::check_flow_context(Opts)) {
 5967|       |                  // Check if the anchor is on a block-mapping key (&name key: value).
 5968|       |                  // Only when the anchor and key are on the SAME line — if the value was on the
 5969|       |                  // next line, the anchor applies to the entire next-line content.
 5970|   291k|                  if (anchor_on_same_line && yaml::line_could_be_block_mapping(it, end)) {
  ------------------
  |  Branch (5970:23): [True: 240k, False: 51.1k]
  |  Branch (5970:46): [True: 96.8k, False: 143k]
  ------------------
 5971|  96.8k|                     auto key_start = it;
 5972|  96.8k|                     if (*key_start == '!') {
  ------------------
  |  Branch (5972:26): [True: 2.99k, False: 93.8k]
  ------------------
 5973|  2.99k|                        const auto key_tag = yaml::parse_yaml_tag(key_start, end, ctx);
 5974|  2.99k|                        if (key_tag == yaml::yaml_tag::unknown || !yaml::tag_valid_for_string(key_tag)) {
  ------------------
  |  Branch (5974:29): [True: 9, False: 2.98k]
  |  Branch (5974:67): [True: 9, False: 2.97k]
  ------------------
 5975|     18|                           ctx.error = error_code::syntax_error;
 5976|     18|                           return;
 5977|     18|                        }
 5978|  2.97k|                        yaml::skip_inline_ws(key_start, end);
 5979|  2.97k|                        if (key_start == end) {
  ------------------
  |  Branch (5979:29): [True: 1, False: 2.97k]
  ------------------
 5980|      1|                           ctx.error = error_code::unexpected_end;
 5981|      1|                           return;
 5982|      1|                        }
 5983|  2.97k|                        if (*key_start == '\n' || *key_start == '\r') {
  ------------------
  |  Branch (5983:29): [True: 2, False: 2.97k]
  |  Branch (5983:51): [True: 2, False: 2.97k]
  ------------------
 5984|      4|                           ctx.error = error_code::syntax_error;
 5985|      4|                           return;
 5986|      4|                        }
 5987|       |
 5988|       |                        // Re-apply the anchor-on-alias rule now that the tag is consumed. The
 5989|       |                        // check above ran before the tag, so "&anchor !tag *alias" reached the
 5990|       |                        // key-span registration below while the untagged spelling was rejected;
 5991|       |                        // an alias node carries no other properties either way.
 5992|  2.97k|                        if (*key_start == '*' && !yaml::alias_token_is_mapping_key(key_start, end)) {
  ------------------
  |  Branch (5992:29): [True: 1.21k, False: 1.75k]
  |  Branch (5992:50): [True: 7, False: 1.21k]
  ------------------
 5993|      7|                           ctx.error = error_code::syntax_error;
 5994|      7|                           return;
 5995|      7|                        }
 5996|  2.97k|                     }
 5997|       |
 5998|       |                     // Find the key span by scanning to the key-value separator
 5999|  96.8k|                     auto key_scan = key_start;
 6000|  96.8k|                     auto key_end = key_start;
 6001|  96.8k|                     if (*key_scan == '"' || *key_scan == '\'') {
  ------------------
  |  Branch (6001:26): [True: 687, False: 96.1k]
  |  Branch (6001:46): [True: 704, False: 95.4k]
  ------------------
 6002|       |                        // Quoted key: skip to closing quote
 6003|  1.39k|                        const char quote = *key_scan;
 6004|  1.39k|                        ++key_scan;
 6005|  8.16k|                        while (key_scan != end && *key_scan != quote) {
  ------------------
  |  Branch (6005:32): [True: 8.16k, False: 3]
  |  Branch (6005:51): [True: 6.77k, False: 1.38k]
  ------------------
 6006|  6.77k|                           if (*key_scan == '\\' && quote == '"') {
  ------------------
  |  Branch (6006:32): [True: 1.18k, False: 5.58k]
  |  Branch (6006:53): [True: 579, False: 606]
  ------------------
 6007|    579|                              ++key_scan;
 6008|    579|                              if (key_scan != end) ++key_scan;
  ------------------
  |  Branch (6008:35): [True: 579, False: 0]
  ------------------
 6009|    579|                           }
 6010|  6.19k|                           else {
 6011|  6.19k|                              ++key_scan;
 6012|  6.19k|                           }
 6013|  6.77k|                        }
 6014|  1.39k|                        if (key_scan == end) {
  ------------------
  |  Branch (6014:29): [True: 3, False: 1.38k]
  ------------------
 6015|      3|                           ctx.error = error_code::syntax_error;
 6016|      3|                           return;
 6017|      3|                        }
 6018|  1.38k|                        ++key_scan; // past closing quote
 6019|  1.38k|                        key_end = key_scan;
 6020|  1.38k|                        yaml::skip_inline_ws(key_scan, end);
 6021|  1.38k|                     }
 6022|  95.4k|                     else {
 6023|       |                        // Plain key: scan to ':'
 6024|  3.50M|                        while (key_scan != end) {
  ------------------
  |  Branch (6024:32): [True: 3.50M, False: 3]
  ------------------
 6025|  3.50M|                           if (*key_scan == ':') {
  ------------------
  |  Branch (6025:32): [True: 188k, False: 3.31M]
  ------------------
 6026|   188k|                              auto next = key_scan + 1;
 6027|   188k|                              if (next == end || *next == ' ' || *next == '\t' || *next == '\n' || *next == '\r') {
  ------------------
  |  Branch (6027:35): [True: 2.45k, False: 185k]
  |  Branch (6027:50): [True: 71.9k, False: 113k]
  |  Branch (6027:66): [True: 3.82k, False: 109k]
  |  Branch (6027:83): [True: 4.61k, False: 105k]
  |  Branch (6027:100): [True: 12.5k, False: 92.6k]
  ------------------
 6028|  95.4k|                                 break;
 6029|  95.4k|                              }
 6030|   188k|                           }
 6031|  3.40M|                           ++key_scan;
 6032|  3.40M|                        }
 6033|  95.4k|                        key_end = key_scan;
 6034|   117k|                        while (key_end != key_start && (*(key_end - 1) == ' ' || *(key_end - 1) == '\t')) {
  ------------------
  |  Branch (6034:32): [True: 110k, False: 6.48k]
  |  Branch (6034:57): [True: 20.7k, False: 89.8k]
  |  Branch (6034:82): [True: 896, False: 88.9k]
  ------------------
 6035|  21.6k|                           --key_end;
 6036|  21.6k|                        }
 6037|  95.4k|                     }
 6038|  96.8k|                     if (key_scan == end || *key_scan != ':') {
  ------------------
  |  Branch (6038:26): [True: 5, False: 96.8k]
  |  Branch (6038:45): [True: 95, False: 96.7k]
  ------------------
 6039|    100|                        ctx.error = error_code::syntax_error;
 6040|    100|                        return;
 6041|    100|                     }
 6042|       |                     // Store anchor with just the key text span
 6043|  96.7k|                     ctx.anchors[std::string(aname)] = {&*key_start, &*key_end, anchor_indent};
 6044|  96.7k|                     it = key_start;
 6045|       |                     // Parse as an object alternative so complex keys (e.g. flow collections) stay in mapping context.
 6046|  96.7k|                     if constexpr (counts::n_object > 0) {
 6047|  96.7k|                        process_yaml_variant_alternatives<V, is_yaml_variant_object>::template op<Opts>(value, ctx, it,
 6048|  96.7k|                                                                                                        end);
 6049|       |                     }
 6050|       |                     else {
 6051|       |                        from<YAML, V>::template op<Opts>(value, ctx, it, end);
 6052|       |                     }
 6053|  96.7k|                     return;
 6054|  96.8k|                  }
 6055|   291k|               }
 6056|       |
 6057|   194k|               const bool prev_allow_indentless_sequence = ctx.allow_indentless_sequence;
 6058|   291k|               ctx.allow_indentless_sequence = value_is_indentless_sequence;
 6059|   291k|               from<YAML, V>::template op<Opts>(value, ctx, it, end);
 6060|   291k|               ctx.allow_indentless_sequence = prev_allow_indentless_sequence;
 6061|   291k|               if (!bool(ctx.error)) {
  ------------------
  |  Branch (6061:20): [True: 189k, False: 102k]
  ------------------
 6062|   189k|                  ctx.anchors[std::string(aname)] = {anchor_start, &*it, anchor_indent};
 6063|   189k|               }
 6064|   291k|               return;
 6065|   291k|            }
 6066|   151k|            case '*': {
  ------------------
  |  Branch (6066:13): [True: 151k, False: 1.59M]
  ------------------
 6067|       |               // In block context, "*alias : value" starts a mapping with an alias key.
 6068|   151k|               if constexpr (!yaml::check_flow_context(Opts)) {
 6069|   151k|                  if (yaml::alias_token_is_mapping_key(it, end)) {
  ------------------
  |  Branch (6069:23): [True: 8.76k, False: 142k]
  ------------------
 6070|  8.76k|                     if constexpr (counts::n_object > 0) {
 6071|  8.76k|                        process_yaml_variant_alternatives<V, is_yaml_variant_object>::template op<Opts>(value, ctx, it,
 6072|  8.76k|                                                                                                        end);
 6073|  8.76k|                        return;
 6074|       |                     }
 6075|       |                     else {
 6076|       |                        ctx.error = error_code::syntax_error;
 6077|       |                        return;
 6078|       |                     }
 6079|  8.76k|                  }
 6080|   151k|               }
 6081|       |
 6082|       |               // Alias value: look up anchor and replay
 6083|      0|               yaml::handle_alias<Opts>(value, ctx, it, end);
 6084|   151k|               return;
 6085|   291k|            }
 6086|   142k|            case '!': {
  ------------------
  |  Branch (6086:13): [True: 142k, False: 1.60M]
  ------------------
 6087|       |               // Tag - parse it and dispatch based on tag type
 6088|   142k|               const auto tag = yaml::parse_yaml_tag(it, end, ctx);
 6089|   142k|               if (tag == yaml::yaml_tag::unknown) {
  ------------------
  |  Branch (6089:20): [True: 117, False: 142k]
  ------------------
 6090|    117|                  ctx.error = error_code::syntax_error;
 6091|    117|                  return;
 6092|    117|               }
 6093|   142k|               yaml::skip_inline_ws(it, end);
 6094|   142k|               if (it != end && *it == '#') {
  ------------------
  |  Branch (6094:20): [True: 140k, False: 1.47k]
  |  Branch (6094:33): [True: 7.16k, False: 133k]
  ------------------
 6095|  7.16k|                  yaml::skip_comment(it, end);
 6096|  7.16k|               }
 6097|   142k|               if (it != end && (*it == '\n' || *it == '\r')) {
  ------------------
  |  Branch (6097:20): [True: 140k, False: 2.04k]
  |  Branch (6097:34): [True: 9.03k, False: 131k]
  |  Branch (6097:49): [True: 13.8k, False: 117k]
  ------------------
 6098|  22.9k|                  auto content = it;
 6099|  22.9k|                  yaml::skip_newline(content, end);
 6100|  22.9k|                  yaml::skip_to_content(content, end);
 6101|       |
 6102|  22.9k|                  bool consume_following_content = false;
 6103|  22.9k|                  auto content_token = content;
 6104|  22.9k|                  if (content != end) {
  ------------------
  |  Branch (6104:23): [True: 20.9k, False: 1.92k]
  ------------------
 6105|  20.9k|                     auto indent_probe = content;
 6106|  20.9k|                     const int32_t content_indent = yaml::measure_indent<false>(indent_probe, end, ctx);
 6107|  20.9k|                     if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (6107:26): [True: 3, False: 20.9k]
  ------------------
 6108|      3|                        return;
 6109|  20.9k|                     content_token = indent_probe;
 6110|       |
 6111|       |                     // A tag at the end of a sequence/map entry has an empty value
 6112|       |                     // unless the next non-empty content is nested under the current node.
 6113|  20.9k|                     bool tagged_indentless_sequence = false;
 6114|  20.9k|                     if (tag == yaml::yaml_tag::seq && indent_probe != end && *indent_probe == '-') {
  ------------------
  |  Branch (6114:26): [True: 5.12k, False: 15.8k]
  |  Branch (6114:56): [True: 5.12k, False: 0]
  |  Branch (6114:79): [True: 4.62k, False: 498]
  ------------------
 6115|  4.62k|                        const auto after_dash = indent_probe + 1;
 6116|  4.62k|                        if (after_dash == end ||
  ------------------
  |  Branch (6116:29): [True: 12, False: 4.61k]
  ------------------
 6117|  4.61k|                            yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*after_dash)]) {
  ------------------
  |  Branch (6117:29): [True: 4.00k, False: 602]
  ------------------
 6118|  4.02k|                           tagged_indentless_sequence =
 6119|  4.02k|                              (content_indent == ctx.current_indent()) ||
  ------------------
  |  Branch (6119:31): [True: 1.00k, False: 3.01k]
  ------------------
 6120|  3.01k|                              (ctx.current_indent() > 0 && (content_indent + 1) == ctx.current_indent());
  ------------------
  |  Branch (6120:32): [True: 720, False: 2.29k]
  |  Branch (6120:60): [True: 681, False: 39]
  ------------------
 6121|  4.02k|                        }
 6122|  4.62k|                     }
 6123|       |
 6124|  20.9k|                     consume_following_content = (ctx.current_indent() < 0) ||
  ------------------
  |  Branch (6124:50): [True: 2.82k, False: 18.1k]
  ------------------
 6125|  18.1k|                                                 (content_indent > ctx.current_indent()) || tagged_indentless_sequence;
  ------------------
  |  Branch (6125:50): [True: 5.97k, False: 12.1k]
  |  Branch (6125:93): [True: 1.68k, False: 10.5k]
  ------------------
 6126|  20.9k|                  }
 6127|       |
 6128|  22.9k|                  if (consume_following_content) {
  ------------------
  |  Branch (6128:23): [True: 10.4k, False: 12.4k]
  ------------------
 6129|  10.4k|                     it = content_token;
 6130|  10.4k|                  }
 6131|  12.4k|                  else {
 6132|  12.4k|                     if (tag == yaml::yaml_tag::str) {
  ------------------
  |  Branch (6132:26): [True: 184, False: 12.2k]
  ------------------
 6133|    184|                        if constexpr (counts::n_str > 0) {
 6134|    184|                           constexpr auto first_idx = yaml_variant_first_index_v<V, is_yaml_variant_str>;
 6135|    184|                           using StrType = std::variant_alternative_t<first_idx, V>;
 6136|    184|                           value = StrType{};
 6137|    184|                           return;
 6138|    184|                        }
 6139|    184|                     }
 6140|  12.4k|                     if (tag == yaml::yaml_tag::null_tag) {
  ------------------
  |  Branch (6140:26): [True: 370, False: 12.0k]
  ------------------
 6141|    370|                        if constexpr (counts::n_null > 0) {
 6142|    370|                           constexpr auto first_idx = yaml_variant_first_index_v<V, is_yaml_variant_null>;
 6143|    370|                           using NullType = std::variant_alternative_t<first_idx, V>;
 6144|    370|                           if (!std::holds_alternative<NullType>(value)) value = NullType{};
  ------------------
  |  Branch (6144:32): [True: 0, False: 370]
  ------------------
 6145|    370|                           return;
 6146|    370|                        }
 6147|    370|                     }
 6148|  12.4k|                     if (tag == yaml::yaml_tag::none) {
  ------------------
  |  Branch (6148:26): [True: 7.12k, False: 5.30k]
  ------------------
 6149|  7.12k|                        if constexpr (counts::n_null > 0) {
 6150|  7.12k|                           constexpr auto first_idx = yaml_variant_first_index_v<V, is_yaml_variant_null>;
 6151|  7.12k|                           using NullType = std::variant_alternative_t<first_idx, V>;
 6152|  7.12k|                           if (!std::holds_alternative<NullType>(value)) value = NullType{};
  ------------------
  |  Branch (6152:32): [True: 0, False: 7.12k]
  ------------------
 6153|  7.12k|                           return;
 6154|  7.12k|                        }
 6155|  7.12k|                     }
 6156|  12.4k|                  }
 6157|  22.9k|               }
 6158|   142k|               if constexpr (!yaml::check_flow_context(Opts)) {
 6159|       |                  // In block context, a comma immediately after a tag token is malformed
 6160|       |                  // (e.g., "!!str, value"). Flow context has legitimate ", ] }" usage.
 6161|   142k|                  if (it != end && *it == ',') {
  ------------------
  |  Branch (6161:23): [True: 132k, False: 9.72k]
  |  Branch (6161:36): [True: 22, False: 132k]
  ------------------
 6162|     22|                     ctx.error = error_code::syntax_error;
 6163|     22|                     return;
 6164|     22|                  }
 6165|   142k|                  if constexpr (counts::n_object > 0) {
 6166|       |                     // Tagged keys like "!!str key: value" must parse as mappings.
 6167|   142k|                     const bool starts_block_sequence_entry =
 6168|   142k|                        (it != end && *it == '-') &&
  ------------------
  |  Branch (6168:26): [True: 132k, False: 9.72k]
  |  Branch (6168:39): [True: 6.93k, False: 125k]
  ------------------
 6169|  6.93k|                        ((it + 1) == end || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*(it + 1))]);
  ------------------
  |  Branch (6169:26): [True: 659, False: 6.27k]
  |  Branch (6169:45): [True: 5.46k, False: 810]
  ------------------
 6170|   142k|                     if (!starts_block_sequence_entry && yaml::line_could_be_block_mapping(it, end)) {
  ------------------
  |  Branch (6170:26): [True: 128k, False: 13.8k]
  |  Branch (6170:58): [True: 16.1k, False: 112k]
  ------------------
 6171|       |                        // Re-dispatch from the post-tag token so '&key key: val' is
 6172|       |                        // handled by the anchor-aware key path, not as a map-level anchor.
 6173|  16.1k|                        from<YAML, V>::template op<Opts>(value, ctx, it, end);
 6174|  16.1k|                        return;
 6175|  16.1k|                     }
 6176|   142k|                  }
 6177|   142k|               }
 6178|   142k|               if (it == end) {
  ------------------
  |  Branch (6178:20): [True: 2.04k, False: 140k]
  ------------------
 6179|  2.04k|                  if (tag == yaml::yaml_tag::str) {
  ------------------
  |  Branch (6179:23): [True: 716, False: 1.33k]
  ------------------
 6180|    716|                     if constexpr (counts::n_str > 0) {
 6181|    716|                        constexpr auto first_idx = yaml_variant_first_index_v<V, is_yaml_variant_str>;
 6182|    716|                        using StrType = std::variant_alternative_t<first_idx, V>;
 6183|    716|                        value = StrType{};
 6184|    716|                        return;
 6185|    716|                     }
 6186|    716|                  }
 6187|  2.04k|                  if (tag == yaml::yaml_tag::none) {
  ------------------
  |  Branch (6187:23): [True: 1.31k, False: 734]
  ------------------
 6188|  1.31k|                     if constexpr (counts::n_null > 0) {
 6189|  1.31k|                        constexpr auto first_idx = yaml_variant_first_index_v<V, is_yaml_variant_null>;
 6190|  1.31k|                        using NullType = std::variant_alternative_t<first_idx, V>;
 6191|  1.31k|                        if (!std::holds_alternative<NullType>(value)) value = NullType{};
  ------------------
  |  Branch (6191:29): [True: 0, False: 1.31k]
  ------------------
 6192|  1.31k|                        return;
 6193|  1.31k|                     }
 6194|  1.31k|                  }
 6195|      0|                  ctx.error = error_code::unexpected_end;
 6196|  2.04k|                  return;
 6197|  2.04k|               }
 6198|   140k|               switch (tag) {
 6199|    631|               case yaml::yaml_tag::str:
  ------------------
  |  Branch (6199:16): [True: 631, False: 139k]
  ------------------
 6200|    631|                  process_yaml_variant_alternatives<V, is_yaml_variant_str>::template op<Opts>(value, ctx, it, end);
 6201|    631|                  return;
 6202|  6.71k|               case yaml::yaml_tag::int_tag:
  ------------------
  |  Branch (6202:16): [True: 6.71k, False: 133k]
  ------------------
 6203|  6.74k|               case yaml::yaml_tag::float_tag:
  ------------------
  |  Branch (6203:16): [True: 27, False: 140k]
  ------------------
 6204|  6.74k|                  if constexpr (counts::n_num > 0) {
 6205|  6.74k|                     process_yaml_variant_alternatives<V, is_yaml_variant_num>::template op<Opts>(value, ctx, it, end);
 6206|  6.74k|                     return;
 6207|       |                  }
 6208|       |                  else { // else used to fix MSVC unreachable code warning
 6209|       |                     ctx.error = error_code::syntax_error;
 6210|       |                     return;
 6211|       |                  }
 6212|  16.7k|               case yaml::yaml_tag::bool_tag:
  ------------------
  |  Branch (6212:16): [True: 10.0k, False: 130k]
  ------------------
 6213|  16.7k|                  if constexpr (counts::n_bool > 0) {
 6214|  16.7k|                     process_yaml_variant_alternatives<V, is_yaml_variant_bool>::template op<Opts>(value, ctx, it, end);
 6215|  16.7k|                     return;
 6216|       |                  }
 6217|       |                  else { // else used to fix MSVC unreachable code warning
 6218|       |                     ctx.error = error_code::syntax_error;
 6219|       |                     return;
 6220|       |                  }
 6221|  17.4k|               case yaml::yaml_tag::null_tag:
  ------------------
  |  Branch (6221:16): [True: 715, False: 139k]
  ------------------
 6222|  17.4k|                  if constexpr (counts::n_null > 0) {
 6223|  17.4k|                     constexpr auto first_idx = yaml_variant_first_index_v<V, is_yaml_variant_null>;
 6224|  17.4k|                     using NullType = std::variant_alternative_t<first_idx, V>;
 6225|  17.4k|                     if (!std::holds_alternative<NullType>(value)) value = NullType{};
  ------------------
  |  Branch (6225:26): [True: 0, False: 17.4k]
  ------------------
 6226|  17.4k|                     from<YAML, NullType>::template op<Opts>(std::get<NullType>(value), ctx, it, end);
 6227|  17.4k|                     return;
 6228|       |                  }
 6229|       |                  else { // else used to fix MSVC unreachable code warning
 6230|       |                     ctx.error = error_code::syntax_error;
 6231|       |                     return;
 6232|       |                  }
 6233|  26.8k|               case yaml::yaml_tag::map:
  ------------------
  |  Branch (6233:16): [True: 9.31k, False: 130k]
  ------------------
 6234|  26.8k|                  if constexpr (counts::n_object > 0) {
 6235|  26.8k|                     process_yaml_variant_alternatives<V, is_yaml_variant_object>::template op<Opts>(value, ctx, it,
 6236|  26.8k|                                                                                                     end);
 6237|  26.8k|                     return;
 6238|       |                  }
 6239|       |                  else { // else used to fix MSVC unreachable code warning
 6240|       |                     ctx.error = error_code::syntax_error;
 6241|       |                     return;
 6242|       |                  }
 6243|  40.0k|               case yaml::yaml_tag::seq:
  ------------------
  |  Branch (6243:16): [True: 13.1k, False: 127k]
  ------------------
 6244|  40.0k|                  if constexpr (counts::n_array > 0) {
 6245|  40.0k|                     const bool prev_allow_indentless_sequence = ctx.allow_indentless_sequence;
 6246|  40.0k|                     if constexpr (!yaml::check_flow_context(Opts)) {
 6247|  40.0k|                        if (it != end && *it == '-') {
  ------------------
  |  Branch (6247:29): [True: 13.1k, False: 26.8k]
  |  Branch (6247:42): [True: 4.40k, False: 8.79k]
  ------------------
 6248|  4.40k|                           ctx.allow_indentless_sequence = true;
 6249|  4.40k|                        }
 6250|  40.0k|                     }
 6251|  40.0k|                     process_yaml_variant_alternatives<V, is_yaml_variant_array>::template op<Opts>(value, ctx, it,
 6252|  40.0k|                                                                                                    end);
 6253|  40.0k|                     ctx.allow_indentless_sequence = prev_allow_indentless_sequence;
 6254|  40.0k|                     return;
 6255|       |                  }
 6256|       |                  else { // else used to fix MSVC unreachable code warning
 6257|       |                     ctx.error = error_code::syntax_error;
 6258|       |                     return;
 6259|       |                  }
 6260|   115k|               default: {
  ------------------
  |  Branch (6260:16): [True: 75.7k, False: 64.4k]
  ------------------
 6261|       |                  // Explicit unknown/non-core tags disable implicit scalar resolution.
 6262|       |                  // Preserve collection kinds, otherwise treat as string content.
 6263|   115k|                  if (it != end && *it == '*') {
  ------------------
  |  Branch (6263:23): [True: 75.7k, False: 40.0k]
  |  Branch (6263:36): [True: 53.2k, False: 22.5k]
  ------------------
 6264|  53.2k|                     yaml::handle_alias<Opts>(value, ctx, it, end);
 6265|  53.2k|                     return;
 6266|  53.2k|                  }
 6267|       |
 6268|  62.5k|                  if constexpr (counts::n_array > 0) {
 6269|  62.5k|                     if (it != end && *it == '[') {
  ------------------
  |  Branch (6269:26): [True: 22.5k, False: 40.0k]
  |  Branch (6269:39): [True: 666, False: 21.8k]
  ------------------
 6270|    666|                        process_yaml_variant_alternatives<V, is_yaml_variant_array>::template op<Opts>(value, ctx, it,
 6271|    666|                                                                                                       end);
 6272|    666|                        return;
 6273|    666|                     }
 6274|  62.5k|                  }
 6275|  62.5k|                  if constexpr (counts::n_object > 0) {
 6276|  62.5k|                     if (it != end && *it == '{') {
  ------------------
  |  Branch (6276:26): [True: 21.8k, False: 40.6k]
  |  Branch (6276:39): [True: 1.57k, False: 20.2k]
  ------------------
 6277|  1.57k|                        process_yaml_variant_alternatives<V, is_yaml_variant_object>::template op<Opts>(value, ctx, it,
 6278|  1.57k|                                                                                                        end);
 6279|  1.57k|                        return;
 6280|  1.57k|                     }
 6281|  62.5k|                  }
 6282|       |
 6283|  62.5k|                  if constexpr (!yaml::check_flow_context(Opts)) {
 6284|  62.5k|                     if constexpr (counts::n_array > 0) {
 6285|  62.5k|                        const bool starts_block_sequence_entry =
 6286|  62.5k|                           (it != end && *it == '-') &&
  ------------------
  |  Branch (6286:29): [True: 20.2k, False: 42.2k]
  |  Branch (6286:42): [True: 1.44k, False: 18.8k]
  ------------------
 6287|  1.44k|                           ((it + 1) == end || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*(it + 1))]);
  ------------------
  |  Branch (6287:29): [True: 634, False: 809]
  |  Branch (6287:48): [True: 632, False: 177]
  ------------------
 6288|  62.5k|                        if (starts_block_sequence_entry) {
  ------------------
  |  Branch (6288:29): [True: 1.26k, False: 61.2k]
  ------------------
 6289|  1.26k|                           process_yaml_variant_alternatives<V, is_yaml_variant_array>::template op<Opts>(value, ctx,
 6290|  1.26k|                                                                                                          it, end);
 6291|  1.26k|                           return;
 6292|  1.26k|                        }
 6293|  62.5k|                     }
 6294|  62.5k|                     if constexpr (counts::n_object > 0) {
 6295|  62.5k|                        const bool starts_explicit_mapping_indicator =
 6296|  62.5k|                           (it != end && (*it == '?' || *it == ':')) &&
  ------------------
  |  Branch (6296:29): [True: 19.0k, False: 43.5k]
  |  Branch (6296:43): [True: 2.25k, False: 16.7k]
  |  Branch (6296:57): [True: 663, False: 16.0k]
  ------------------
 6297|  2.91k|                           ((it + 1) == end || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*(it + 1))]);
  ------------------
  |  Branch (6297:29): [True: 549, False: 2.36k]
  |  Branch (6297:48): [True: 1.59k, False: 777]
  ------------------
 6298|  62.5k|                        if (starts_explicit_mapping_indicator) {
  ------------------
  |  Branch (6298:29): [True: 2.14k, False: 60.3k]
  ------------------
 6299|  2.14k|                           process_yaml_variant_alternatives<V, is_yaml_variant_object>::template op<Opts>(value, ctx,
 6300|  2.14k|                                                                                                           it, end);
 6301|  2.14k|                           return;
 6302|  2.14k|                        }
 6303|  60.3k|                        if (yaml::line_could_be_block_mapping(it, end)) {
  ------------------
  |  Branch (6303:29): [True: 0, False: 60.3k]
  ------------------
 6304|      0|                           process_yaml_variant_alternatives<V, is_yaml_variant_object>::template op<Opts>(value, ctx,
 6305|      0|                                                                                                           it, end);
 6306|      0|                           return;
 6307|      0|                        }
 6308|  60.3k|                     }
 6309|  62.5k|                  }
 6310|       |
 6311|  62.5k|                  if constexpr (counts::n_str > 0) {
 6312|  62.5k|                     process_yaml_variant_alternatives<V, is_yaml_variant_str>::template op<Opts>(value, ctx, it, end);
 6313|  62.5k|                     return;
 6314|  62.5k|                  }
 6315|       |
 6316|       |                  // Fall back if no string alternative exists.
 6317|      0|                  from<YAML, V>::template op<Opts>(value, ctx, it, end);
 6318|  62.5k|                  return;
 6319|   115k|               }
 6320|   140k|               }
 6321|      0|               return;
 6322|   140k|            }
 6323|  56.7k|            case '{':
  ------------------
  |  Branch (6323:13): [True: 56.7k, False: 1.69M]
  ------------------
 6324|  56.7k|               if constexpr (!yaml::check_flow_context(Opts)) {
 6325|       |                  // In block context, "{...}: value" can be a complex mapping key.
 6326|  56.7k|                  if (ctx.current_indent() < 0 && yaml::line_could_be_block_mapping(it, end)) {
  ------------------
  |  Branch (6326:23): [True: 15.9k, False: 40.8k]
  |  Branch (6326:51): [True: 2.64k, False: 13.2k]
  ------------------
 6327|  2.64k|                     process_yaml_variant_alternatives<V, is_yaml_variant_object>::template op<Opts>(value, ctx, it,
 6328|  2.64k|                                                                                                     end);
 6329|  2.64k|                     return;
 6330|  2.64k|                  }
 6331|  56.7k|               }
 6332|       |               // Flow mapping - object type
 6333|  54.1k|               process_yaml_variant_alternatives<V, is_yaml_variant_object>::template op<Opts>(value, ctx, it, end);
 6334|  56.7k|               return;
 6335|  63.2k|            case '[':
  ------------------
  |  Branch (6335:13): [True: 63.2k, False: 1.68M]
  ------------------
 6336|  63.2k|               if constexpr (!yaml::check_flow_context(Opts)) {
 6337|       |                  // In block context, "[...]: value" can be a complex mapping key.
 6338|  63.2k|                  if (ctx.current_indent() < 0 && yaml::line_could_be_block_mapping(it, end)) {
  ------------------
  |  Branch (6338:23): [True: 38.9k, False: 24.2k]
  |  Branch (6338:51): [True: 474, False: 38.5k]
  ------------------
 6339|    474|                     process_yaml_variant_alternatives<V, is_yaml_variant_object>::template op<Opts>(value, ctx, it,
 6340|    474|                                                                                                     end);
 6341|    474|                     return;
 6342|    474|                  }
 6343|  63.2k|               }
 6344|       |               // Flow sequence - array type
 6345|  62.7k|               process_yaml_variant_alternatives<V, is_yaml_variant_array>::template op<Opts>(value, ctx, it, end);
 6346|  63.2k|               return;
 6347|   272k|            case '?':
  ------------------
  |  Branch (6347:13): [True: 272k, False: 1.47M]
  ------------------
 6348|       |               // Explicit mapping key indicator ("? key")
 6349|   272k|               if ((end - it >= 2) && it[1] == '\t') {
  ------------------
  |  Branch (6349:20): [True: 271k, False: 1.02k]
  |  Branch (6349:39): [True: 12, False: 271k]
  ------------------
 6350|     12|                  ctx.error = error_code::syntax_error;
 6351|     12|                  return;
 6352|     12|               }
 6353|   272k|               if ((end - it >= 2) && (it[1] == ' ' || it[1] == '\n' || it[1] == '\r')) {
  ------------------
  |  Branch (6353:20): [True: 271k, False: 1.02k]
  |  Branch (6353:40): [True: 96.7k, False: 174k]
  |  Branch (6353:56): [True: 159k, False: 15.1k]
  |  Branch (6353:73): [True: 4.60k, False: 10.5k]
  ------------------
 6354|   260k|                  if constexpr (counts::n_object > 0) {
 6355|   260k|                     process_yaml_variant_alternatives<V, is_yaml_variant_object>::template op<Opts>(value, ctx, it,
 6356|   260k|                                                                                                     end);
 6357|   260k|                     return;
 6358|   260k|                  }
 6359|   260k|               }
 6360|      0|               parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6361|   272k|               return;
 6362|     27|            case '%':
  ------------------
  |  Branch (6362:13): [True: 27, False: 1.74M]
  ------------------
 6363|       |               // Reserved directive indicator is not a plain scalar start.
 6364|     27|               ctx.error = error_code::syntax_error;
 6365|     27|               return;
 6366|  1.90k|            case '"':
  ------------------
  |  Branch (6366:13): [True: 1.90k, False: 1.74M]
  ------------------
 6367|  4.40k|            case '\'':
  ------------------
  |  Branch (6367:13): [True: 2.49k, False: 1.74M]
  ------------------
 6368|       |               // Could be a quoted string OR a quoted key in a block mapping
 6369|       |               // Try block mapping first (e.g., "key": value), then fall back to string
 6370|  4.40k|               parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6371|  4.40k|               return;
 6372|  15.4k|            case 't':
  ------------------
  |  Branch (6372:13): [True: 15.4k, False: 1.73M]
  ------------------
 6373|  59.7k|            case 'T':
  ------------------
  |  Branch (6373:13): [True: 44.3k, False: 1.70M]
  ------------------
 6374|       |               // Could be "true", "True", "TRUE", or a key/string starting with t/T
 6375|  59.7k|               if constexpr (counts::n_bool > 0) {
 6376|  59.7k|                  if ((end - it >= 4) && ((it[1] == 'r' && it[2] == 'u' && it[3] == 'e') ||
  ------------------
  |  Branch (6376:23): [True: 59.2k, False: 568]
  |  Branch (6376:44): [True: 50.9k, False: 8.28k]
  |  Branch (6376:60): [True: 48.6k, False: 2.29k]
  |  Branch (6376:76): [True: 47.7k, False: 892]
  ------------------
 6377|  48.4k|                                          (it[1] == 'R' && it[2] == 'U' && it[3] == 'E'))) {
  ------------------
  |  Branch (6377:44): [True: 4.36k, False: 7.10k]
  |  Branch (6377:60): [True: 2.47k, False: 1.89k]
  |  Branch (6377:76): [True: 669, False: 1.80k]
  ------------------
 6378|       |                     // Check what follows the word "true"
 6379|  48.4k|                     const auto after_true = it + 4;
 6380|  48.4k|                     const bool at_word_boundary = is_word_boundary(after_true);
 6381|       |
 6382|  48.4k|                     if (at_word_boundary) {
  ------------------
  |  Branch (6382:26): [True: 47.1k, False: 1.28k]
  ------------------
 6383|  47.1k|                        if (has_indented_block_continuation(after_true)) {
  ------------------
  |  Branch (6383:29): [True: 803, False: 46.3k]
  ------------------
 6384|    803|                           parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6385|    803|                           return;
 6386|    803|                        }
 6387|       |                        // Check if this is a key (followed by ": ") rather than a boolean value
 6388|       |                        // "true: value" should parse as {true: value}, not as the boolean true
 6389|  46.3k|                        if ((end - it > 4) && it[4] == ':' &&
  ------------------
  |  Branch (6389:29): [True: 45.6k, False: 693]
  |  Branch (6389:47): [True: 38.0k, False: 7.57k]
  ------------------
 6390|  38.0k|                            (end - it == 5 || it[5] == ' ' || it[5] == '\t' || it[5] == '\n' || it[5] == '\r')) {
  ------------------
  |  Branch (6390:30): [True: 861, False: 37.1k]
  |  Branch (6390:47): [True: 35.9k, False: 1.25k]
  |  Branch (6390:63): [True: 580, False: 674]
  |  Branch (6390:80): [True: 532, False: 142]
  |  Branch (6390:97): [True: 142, False: 0]
  ------------------
 6391|       |                           // This is "true:" followed by space/tab/newline/end - treat as key
 6392|  38.0k|                           parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6393|  38.0k|                           return;
 6394|  38.0k|                        }
 6395|  8.27k|                        process_yaml_variant_alternatives<V, is_yaml_variant_bool>::template op<Opts>(value, ctx, it,
 6396|  8.27k|                                                                                                      end);
 6397|  8.27k|                        return;
 6398|  46.3k|                     }
 6399|       |                     // "true" is followed by more characters (e.g., "True\b") - treat as string
 6400|  48.4k|                  }
 6401|  59.7k|               }
 6402|  12.6k|               parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6403|  59.7k|               return;
 6404|  16.5k|            case 'f':
  ------------------
  |  Branch (6404:13): [True: 16.5k, False: 1.73M]
  ------------------
 6405|  26.0k|            case 'F':
  ------------------
  |  Branch (6405:13): [True: 9.48k, False: 1.73M]
  ------------------
 6406|       |               // Could be "false", "False", "FALSE", or a key/string starting with f/F
 6407|  26.0k|               if constexpr (counts::n_bool > 0) {
 6408|  26.0k|                  if ((end - it >= 5) && ((it[1] == 'a' && it[2] == 'l' && it[3] == 's' && it[4] == 'e') ||
  ------------------
  |  Branch (6408:23): [True: 24.8k, False: 1.12k]
  |  Branch (6408:44): [True: 12.8k, False: 12.0k]
  |  Branch (6408:60): [True: 7.94k, False: 4.87k]
  |  Branch (6408:76): [True: 6.99k, False: 946]
  |  Branch (6408:92): [True: 6.34k, False: 647]
  ------------------
 6409|  18.5k|                                          (it[1] == 'A' && it[2] == 'L' && it[3] == 'S' && it[4] == 'E'))) {
  ------------------
  |  Branch (6409:44): [True: 4.67k, False: 13.8k]
  |  Branch (6409:60): [True: 3.79k, False: 876]
  |  Branch (6409:76): [True: 3.05k, False: 742]
  |  Branch (6409:92): [True: 2.76k, False: 284]
  ------------------
 6410|       |                     // Check what follows the word "false"
 6411|  9.11k|                     const auto after_false = it + 5;
 6412|  9.11k|                     const bool at_word_boundary = is_word_boundary(after_false);
 6413|       |
 6414|  9.11k|                     if (at_word_boundary) {
  ------------------
  |  Branch (6414:26): [True: 7.83k, False: 1.28k]
  ------------------
 6415|  7.83k|                        if (has_indented_block_continuation(after_false)) {
  ------------------
  |  Branch (6415:29): [True: 672, False: 7.16k]
  ------------------
 6416|    672|                           parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6417|    672|                           return;
 6418|    672|                        }
 6419|       |                        // Check if this is a key (followed by ": ") rather than a boolean value
 6420|       |                        // "false: value" should parse as {false: value}, not as the boolean false
 6421|  7.16k|                        if ((end - it > 5) && it[5] == ':' &&
  ------------------
  |  Branch (6421:29): [True: 6.62k, False: 543]
  |  Branch (6421:47): [True: 3.83k, False: 2.78k]
  ------------------
 6422|  3.83k|                            (end - it == 6 || it[6] == ' ' || it[6] == '\t' || it[6] == '\n' || it[6] == '\r')) {
  ------------------
  |  Branch (6422:30): [True: 617, False: 3.21k]
  |  Branch (6422:47): [True: 504, False: 2.71k]
  |  Branch (6422:63): [True: 1.80k, False: 903]
  |  Branch (6422:80): [True: 157, False: 746]
  |  Branch (6422:97): [True: 746, False: 0]
  ------------------
 6423|       |                           // This is "false:" followed by space/tab/newline/end - treat as key
 6424|  3.83k|                           parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6425|  3.83k|                           return;
 6426|  3.83k|                        }
 6427|  3.33k|                        process_yaml_variant_alternatives<V, is_yaml_variant_bool>::template op<Opts>(value, ctx, it,
 6428|  3.33k|                                                                                                      end);
 6429|  3.33k|                        return;
 6430|  7.16k|                     }
 6431|       |                     // "false" is followed by more characters (e.g., "False\b") - treat as string
 6432|  9.11k|                  }
 6433|  26.0k|               }
 6434|  18.1k|               parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6435|  26.0k|               return;
 6436|  12.5k|            case 'n':
  ------------------
  |  Branch (6436:13): [True: 12.5k, False: 1.73M]
  ------------------
 6437|  19.2k|            case 'N':
  ------------------
  |  Branch (6437:13): [True: 6.73k, False: 1.74M]
  ------------------
 6438|       |               // Could be "null", "Null", "NULL", or a key/string starting with n/N
 6439|  19.2k|               if constexpr (counts::n_null > 0) {
 6440|  19.2k|                  if ((end - it >= 4) && ((it[1] == 'u' && it[2] == 'l' && it[3] == 'l') ||
  ------------------
  |  Branch (6440:23): [True: 18.6k, False: 634]
  |  Branch (6440:44): [True: 12.5k, False: 6.12k]
  |  Branch (6440:60): [True: 10.9k, False: 1.60k]
  |  Branch (6440:76): [True: 9.78k, False: 1.12k]
  ------------------
 6441|  11.0k|                                          (it[1] == 'U' && it[2] == 'L' && it[3] == 'L'))) {
  ------------------
  |  Branch (6441:44): [True: 4.16k, False: 4.69k]
  |  Branch (6441:60): [True: 3.32k, False: 832]
  |  Branch (6441:76): [True: 1.28k, False: 2.04k]
  ------------------
 6442|       |                     // Check what follows the word "null"
 6443|  11.0k|                     const auto after_null = it + 4;
 6444|  11.0k|                     const bool at_word_boundary = is_word_boundary(after_null);
 6445|       |
 6446|  11.0k|                     if (at_word_boundary) {
  ------------------
  |  Branch (6446:26): [True: 9.92k, False: 1.13k]
  ------------------
 6447|  9.92k|                        if (has_indented_block_continuation(after_null)) {
  ------------------
  |  Branch (6447:29): [True: 557, False: 9.37k]
  ------------------
 6448|    557|                           parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6449|    557|                           return;
 6450|    557|                        }
 6451|       |                        // Check if this is a key (followed by ": ") rather than a null value
 6452|       |                        // "null: value" should parse as {null: value}, not as the null type
 6453|  9.37k|                        if ((end - it > 4) && it[4] == ':' &&
  ------------------
  |  Branch (6453:29): [True: 8.56k, False: 810]
  |  Branch (6453:47): [True: 3.60k, False: 4.95k]
  ------------------
 6454|  3.60k|                            (end - it == 5 || it[5] == ' ' || it[5] == '\t' || it[5] == '\n' || it[5] == '\r')) {
  ------------------
  |  Branch (6454:30): [True: 1.25k, False: 2.35k]
  |  Branch (6454:47): [True: 662, False: 1.69k]
  |  Branch (6454:63): [True: 776, False: 918]
  |  Branch (6454:80): [True: 642, False: 276]
  |  Branch (6454:97): [True: 276, False: 0]
  ------------------
 6455|       |                           // This is "null:" followed by space/tab/newline/end - treat as key
 6456|  3.60k|                           parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6457|  3.60k|                           return;
 6458|  3.60k|                        }
 6459|  5.76k|                        constexpr auto first_idx = yaml_variant_first_index_v<V, is_yaml_variant_null>;
 6460|  5.76k|                        using NullType = std::variant_alternative_t<first_idx, V>;
 6461|  5.76k|                        if (!std::holds_alternative<NullType>(value)) value = NullType{};
  ------------------
  |  Branch (6461:29): [True: 0, False: 5.76k]
  ------------------
 6462|  5.76k|                        from<YAML, NullType>::template op<Opts>(std::get<NullType>(value), ctx, it, end);
 6463|  5.76k|                        return;
 6464|  9.37k|                     }
 6465|       |                     // "null" is followed by more characters (e.g., "Null\b") - treat as string
 6466|  11.0k|                  }
 6467|  19.2k|               }
 6468|  9.34k|               parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6469|  19.2k|               return;
 6470|    784|            case '~':
  ------------------
  |  Branch (6470:13): [True: 784, False: 1.74M]
  ------------------
 6471|       |               // Null indicator
 6472|    784|               if constexpr (counts::n_null > 0) {
 6473|    784|                  constexpr auto first_idx = yaml_variant_first_index_v<V, is_yaml_variant_null>;
 6474|    784|                  using NullType = std::variant_alternative_t<first_idx, V>;
 6475|    784|                  if (!std::holds_alternative<NullType>(value)) value = NullType{};
  ------------------
  |  Branch (6475:23): [True: 0, False: 784]
  ------------------
 6476|    784|                  from<YAML, NullType>::template op<Opts>(std::get<NullType>(value), ctx, it, end);
 6477|    784|                  return;
 6478|    784|               }
 6479|      0|               break; // Fall through to try other types
 6480|   102k|            case '-':
  ------------------
  |  Branch (6480:13): [True: 102k, False: 1.64M]
  ------------------
 6481|       |               // Could be negative number or block sequence indicator
 6482|   102k|               if (((it + 1) == end) || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(it[1])]) {
  ------------------
  |  Branch (6482:20): [True: 1.46k, False: 100k]
  |  Branch (6482:41): [True: 86.8k, False: 14.0k]
  ------------------
 6483|       |                  // Block sequence indicator "- "
 6484|  88.2k|                  if constexpr (counts::n_array > 0) {
 6485|  88.2k|                     process_yaml_variant_alternatives<V, is_yaml_variant_array>::template op<Opts>(value, ctx, it,
 6486|  88.2k|                                                                                                    end);
 6487|  88.2k|                     return;
 6488|  88.2k|                  }
 6489|  88.2k|               }
 6490|   102k|               if constexpr (counts::n_num > 0) {
 6491|   102k|                  if ((end - it >= 2) && (std::isdigit(static_cast<unsigned char>(it[1])) || it[1] == '.')) {
  ------------------
  |  Branch (6491:23): [True: 14.0k, False: 88.2k]
  |  Branch (6491:43): [True: 1.48k, False: 12.5k]
  |  Branch (6491:94): [True: 1.21k, False: 11.3k]
  ------------------
 6492|  2.69k|                     process_yaml_variant_alternatives<V, is_yaml_variant_num>::template op<Opts>(value, ctx, it, end);
 6493|  2.69k|                     return;
 6494|  2.69k|                  }
 6495|   102k|               }
 6496|  99.6k|               parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6497|   102k|               return;
 6498|  5.76k|            case '+':
  ------------------
  |  Branch (6498:13): [True: 5.76k, False: 1.74M]
  ------------------
 6499|  19.8k|            case '.':
  ------------------
  |  Branch (6499:13): [True: 14.1k, False: 1.73M]
  ------------------
 6500|       |               // Could be a number (.5, +5, .inf, etc.) or a string (.c, .cpp, +name, etc.)
 6501|       |               // Try parsing as number speculatively, fall back to string on failure
 6502|  19.8k|               if constexpr (counts::n_num > 0) {
 6503|  19.8k|                  auto start_it = it;
 6504|  19.8k|                  auto temp_ctx = ctx.make_speculative();
 6505|  19.8k|                  process_yaml_variant_alternatives<V, is_yaml_variant_num>::template op<Opts>(value, temp_ctx, it,
 6506|  19.8k|                                                                                               end);
 6507|  19.8k|                  ctx.alias_expansion_budget = temp_ctx.alias_expansion_budget; // charged even if rejected
 6508|  19.8k|                  ctx.key_expansion_budget = temp_ctx.key_expansion_budget;
 6509|  19.8k|                  if (!bool(temp_ctx.error)) {
  ------------------
  |  Branch (6509:23): [True: 4.32k, False: 15.5k]
  ------------------
 6510|  4.32k|                     ctx.anchors = std::move(temp_ctx.anchors);
 6511|  4.32k|                     return; // Successfully parsed as number
 6512|  4.32k|                  }
 6513|  15.5k|                  it = start_it; // Restore and fall through to string
 6514|  15.5k|               }
 6515|      0|               parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6516|  19.8k|               return;
 6517|   510k|            default:
  ------------------
  |  Branch (6517:13): [True: 510k, False: 1.23M]
  ------------------
 6518|       |               // Check for digit (0-9) - numeric or block mapping key starting with digit
 6519|   510k|               if (c >= '0' && c <= '9') {
  ------------------
  |  Branch (6519:20): [True: 386k, False: 123k]
  |  Branch (6519:32): [True: 98.2k, False: 288k]
  ------------------
 6520|       |                  // Try block mapping first (e.g., "123key: value")
 6521|  98.2k|                  if (try_parse_block_mapping_into_variant<V, Opts>(value, ctx, it, end)) {
  ------------------
  |  Branch (6521:23): [True: 60.5k, False: 37.7k]
  ------------------
 6522|  60.5k|                     return;
 6523|  60.5k|                  }
 6524|       |                  // Try numeric value speculatively - values like "12:30" look numeric but aren't
 6525|  37.7k|                  if constexpr (counts::n_num > 0) {
 6526|  37.7k|                     auto start_it = it;
 6527|  37.7k|                     auto temp_ctx = ctx.make_speculative();
 6528|  37.7k|                     process_yaml_variant_alternatives<V, is_yaml_variant_num>::template op<Opts>(value, temp_ctx, it,
 6529|  37.7k|                                                                                                  end);
 6530|  37.7k|                     ctx.alias_expansion_budget = temp_ctx.alias_expansion_budget; // charged even if rejected
 6531|  37.7k|                     ctx.key_expansion_budget = temp_ctx.key_expansion_budget;
 6532|  37.7k|                     if (!bool(temp_ctx.error)) {
  ------------------
  |  Branch (6532:26): [True: 7.04k, False: 30.6k]
  ------------------
 6533|  7.04k|                        ctx.anchors = std::move(temp_ctx.anchors);
 6534|  7.04k|                        return; // Successfully parsed as number
 6535|  7.04k|                     }
 6536|  30.6k|                     it = start_it; // Restore and fall through to string
 6537|  30.6k|                  }
 6538|       |                  // Fall through to string
 6539|      0|                  process_yaml_variant_alternatives<V, is_yaml_variant_str>::template op<Opts>(value, ctx, it, end);
 6540|  37.7k|                  return;
 6541|  98.2k|               }
 6542|       |               // Plain scalar - try block mapping, then string
 6543|   412k|               parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6544|   412k|               return;
 6545|  1.74M|            }
 6546|  1.74M|         }
 6547|       |
 6548|       |         // For non-auto-deducible variants or fallback, try each type until one succeeds
 6549|      0|         constexpr auto N = std::variant_size_v<std::remove_cvref_t<T>>;
 6550|       |
 6551|       |         // This fold discards each alternative's error and reports only that nothing fit, which
 6552|       |         // misdiagnoses a document that exhausted an expansion budget as merely the wrong shape.
 6553|       |         // Kept aside and used only if no alternative parsed, so a later one that does parse
 6554|       |         // (possible under a latched budget if it materializes no key text) is unaffected.
 6555|  1.74M|         error_code expansion_error{};
 6556|  1.74M|         std::string_view expansion_message{};
 6557|       |
 6558|  1.74M|         auto try_parse = [&]<size_t I>() -> bool {
 6559|  1.74M|            using V = std::variant_alternative_t<I, std::remove_cvref_t<T>>;
 6560|  1.74M|            auto start = it;
 6561|       |
 6562|  1.74M|            V v{};
 6563|  1.74M|            auto temp_ctx = ctx.make_speculative();
 6564|  1.74M|            from<YAML, V>::template op<Opts>(v, temp_ctx, it, end);
 6565|  1.74M|            ctx.alias_expansion_budget = temp_ctx.alias_expansion_budget; // charged even if rejected
 6566|  1.74M|            ctx.key_expansion_budget = temp_ctx.key_expansion_budget;
 6567|       |
 6568|  1.74M|            if (!bool(temp_ctx.error)) {
 6569|  1.74M|               value = std::move(v);
 6570|  1.74M|               ctx.anchors = std::move(temp_ctx.anchors);
 6571|  1.74M|               return true;
 6572|  1.74M|            }
 6573|       |
 6574|  1.74M|            if (temp_ctx.error == error_code::exceeded_max_expansion && expansion_error == error_code::none) {
 6575|  1.74M|               expansion_error = temp_ctx.error;
 6576|  1.74M|               expansion_message = temp_ctx.custom_error_message;
 6577|  1.74M|            }
 6578|  1.74M|            it = start;
 6579|  1.74M|            return false;
 6580|  1.74M|         };
 6581|       |
 6582|  1.74M|         bool parsed = false;
 6583|  1.74M|         [&]<size_t... Is>(std::index_sequence<Is...>) {
 6584|  1.74M|            ((parsed = parsed || try_parse.template operator()<Is>()), ...);
 6585|  1.74M|         }(std::make_index_sequence<N>{});
 6586|       |
 6587|  1.74M|         if (!parsed) {
  ------------------
  |  Branch (6587:14): [True: 0, False: 1.74M]
  ------------------
 6588|      0|            if (expansion_error != error_code::none) {
  ------------------
  |  Branch (6588:17): [True: 0, False: 0]
  ------------------
 6589|      0|               ctx.error = expansion_error;
 6590|      0|               ctx.custom_error_message = expansion_message;
 6591|      0|            }
 6592|      0|            else {
 6593|      0|               ctx.error = error_code::no_matching_variant_type;
 6594|      0|            }
 6595|      0|         }
 6596|  1.74M|      }
_ZN3glz33process_yaml_variant_alternativesINSt3__17variantIJDndNS1_12basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEbNS1_6vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS6_ISD_EEEENSC_ISD_EEEEENS_22is_yaml_variant_objectEE2opITnDaXtlNS_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2EEERSH_TkNS_10is_contextERNSL_12yaml_contextERPKcSR_EEvOT0_OT1_OT2_T3_:
 5205|   842k|      {
 5206|   842k|         constexpr auto category_count = yaml_variant_count_v<Variant, Trait>;
 5207|       |
 5208|       |         if constexpr (category_count == 0) {
 5209|       |            ctx.error = error_code::no_matching_variant_type;
 5210|       |         }
 5211|   842k|         else if constexpr (category_count == 1) {
 5212|       |            // Only one type in this category, use it directly
 5213|   842k|            constexpr auto first_idx = yaml_variant_first_index_v<Variant, Trait>;
 5214|   842k|            using V = std::variant_alternative_t<first_idx, Variant>;
 5215|   842k|            if (!std::holds_alternative<V>(value)) value = V{};
  ------------------
  |  Branch (5215:17): [True: 842k, False: 0]
  ------------------
 5216|   842k|            from<YAML, V>::template op<Opts>(std::get<V>(value), ctx, it, end);
 5217|       |         }
 5218|       |         else {
 5219|       |            // Multiple types in this category, try each one
 5220|       |            constexpr auto N = std::variant_size_v<Variant>;
 5221|       |            bool found_match{};
 5222|       |            size_t match_idx = 0;
 5223|       |            // Only the last alternative propagates its error, so an alternative that exhausted an
 5224|       |            // expansion budget would otherwise be reported as no_matching_variant_type -- a wrong
 5225|       |            // diagnosis for a document that is hostile rather than merely the wrong shape. Held
 5226|       |            // aside and used only if nothing matched, so an alternative that does succeed later
 5227|       |            // (one that materializes no key text can still parse under a latched budget) is
 5228|       |            // unaffected.
 5229|       |            error_code expansion_error{};
 5230|       |            std::string_view expansion_message{};
 5231|       |
 5232|       |            for_each<N>([&]<size_t I>() {
 5233|       |               if (found_match) {
 5234|       |                  return;
 5235|       |               }
 5236|       |               using V = std::variant_alternative_t<I, Variant>;
 5237|       |               if constexpr (Trait<V>::value) {
 5238|       |                  auto copy_it = it;
 5239|       |                  if (!std::holds_alternative<V>(value)) {
 5240|       |                     value = V{};
 5241|       |                  }
 5242|       |
 5243|       |                  auto temp_ctx = ctx.make_speculative();
 5244|       |                  from<YAML, V>::template op<Opts>(std::get<V>(value), temp_ctx, it, end);
 5245|       |
 5246|       |                  // Charged whether or not the alternative fit: a rejected probe still replayed
 5247|       |                  // whatever aliases it reached, and an attempt that is never billed is an
 5248|       |                  // attempt that can be repeated for free.
 5249|       |                  ctx.alias_expansion_budget = temp_ctx.alias_expansion_budget;
 5250|       |                  ctx.key_expansion_budget = temp_ctx.key_expansion_budget;
 5251|       |
 5252|       |                  if (!bool(temp_ctx.error)) {
 5253|       |                     found_match = true;
 5254|       |                     ctx.anchors = std::move(temp_ctx.anchors);
 5255|       |                  }
 5256|       |                  else {
 5257|       |                     it = copy_it;
 5258|       |                     if (temp_ctx.error == error_code::exceeded_max_expansion && expansion_error == error_code::none) {
 5259|       |                        expansion_error = temp_ctx.error;
 5260|       |                        expansion_message = temp_ctx.custom_error_message;
 5261|       |                     }
 5262|       |                     if (match_idx + 1 < category_count) {
 5263|       |                        // Not the last type, continue trying
 5264|       |                     }
 5265|       |                     else {
 5266|       |                        // Last type failed, propagate error
 5267|       |                        ctx.error = temp_ctx.error;
 5268|       |                        ctx.custom_error_message = temp_ctx.custom_error_message;
 5269|       |                     }
 5270|       |                  }
 5271|       |                  ++match_idx;
 5272|       |               }
 5273|       |            });
 5274|       |
 5275|       |            if (!found_match && !bool(ctx.error)) {
 5276|       |               if (expansion_error != error_code::none) {
 5277|       |                  ctx.error = expansion_error;
 5278|       |                  ctx.custom_error_message = expansion_message;
 5279|       |               }
 5280|       |               else {
 5281|       |                  ctx.error = error_code::no_matching_variant_type;
 5282|       |               }
 5283|       |            }
 5284|       |         }
 5285|   842k|      }
_ZN3glz4fromILj450ENS_17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES1_EEEEE2opITnDaXtlNS_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2EEERPKcRS5_TkNS_10is_contextERNS8_12yaml_contextESB_EEvOT1_OT2_OT0_T3_:
 4515|   845k|      {
 4516|   845k|         if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4516:14): [True: 0, False: 845k]
  ------------------
 4517|      0|            return;
 4518|       |
 4519|   845k|         yaml::node_preamble_state preamble{};
 4520|   845k|         if (yaml::parse_node_preamble<Opts, yaml::node_property_policy{true, true, false, false}>(
  ------------------
  |  Branch (4520:14): [True: 4.36k, False: 840k]
  ------------------
 4521|   845k|                value, ctx, it, end, preamble, [](yaml::yaml_tag tag) { return yaml::tag_valid_for_map(tag); }))
 4522|  4.36k|            return;
 4523|       |
 4524|   840k|         using key_t = typename std::remove_cvref_t<T>::key_type;
 4525|   840k|         using val_t = typename std::remove_cvref_t<T>::mapped_type;
 4526|       |
 4527|       |         // Reading a YAML mapping MERGES into the target: an entry overwrites the
 4528|       |         // value of a key that existed before the read and adds new keys, while
 4529|       |         // pre-existing keys the document does not mention are preserved (like a
 4530|       |         // struct/object read, and like json/read.hpp's per-key value[key]).
 4531|       |         // Within a single document a repeated key keeps its FIRST value -- YAML
 4532|       |         // mappings disallow duplicate keys and the conformance suite expects
 4533|       |         // first-wins, which falls out of emplace into an empty map. Any
 4534|       |         // pre-existing entry the document leaves untouched is restored on scope
 4535|       |         // exit (including error paths). When the target starts empty (the common
 4536|       |         // case) this is a no-op with negligible cost.
 4537|   840k|         std::remove_cvref_t<T> preexisting_entries;
 4538|   840k|         if (!value.empty()) {
  ------------------
  |  Branch (4538:14): [True: 0, False: 840k]
  ------------------
 4539|      0|            preexisting_entries = std::move(value);
 4540|      0|            value.clear();
 4541|      0|         }
 4542|   840k|         struct merge_restore_guard
 4543|   840k|         {
 4544|   840k|            std::remove_cvref_t<T>& target;
 4545|   840k|            std::remove_cvref_t<T>& saved;
 4546|   840k|            ~merge_restore_guard()
 4547|   840k|            {
 4548|       |               // emplace is a no-op for keys the document already wrote, so only
 4549|       |               // untouched pre-existing entries are put back.
 4550|   840k|               for (auto& entry : saved) {
 4551|   840k|                  target.emplace(entry.first, std::move(entry.second));
 4552|   840k|               }
 4553|   840k|            }
 4554|   840k|         } merge_restore{value, preexisting_entries};
 4555|       |
 4556|   840k|         const bool treat_as_block_mapping =
 4557|   840k|            !yaml::check_flow_context(Opts) && *it == '{' && yaml::inline_value_has_plain_mapping_indicator(it, end);
  ------------------
  |  Branch (4557:13): [True: 840k, Folded]
  |  Branch (4557:48): [True: 64.9k, False: 775k]
  |  Branch (4557:62): [True: 2.28k, False: 62.6k]
  ------------------
 4558|       |
 4559|   840k|         if (*it == '{' && !treat_as_block_mapping) {
  ------------------
  |  Branch (4559:14): [True: 64.9k, False: 775k]
  |  Branch (4559:28): [True: 62.6k, False: 2.28k]
  ------------------
 4560|       |            // Flow mapping
 4561|  62.6k|            ++it;
 4562|       |            // Skip whitespace and newlines after opening brace
 4563|  62.6k|            yaml::skip_ws_and_newlines(it, end);
 4564|       |
 4565|  62.6k|            if (it != end && *it == '}') {
  ------------------
  |  Branch (4565:17): [True: 61.8k, False: 864]
  |  Branch (4565:30): [True: 5.77k, False: 56.0k]
  ------------------
 4566|  5.77k|               ++it;
 4567|  5.77k|               yaml::validate_flow_node_adjacent_tail(ctx, it, end);
 4568|  5.77k|               if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4568:20): [True: 13, False: 5.76k]
  ------------------
 4569|     13|                  return;
 4570|  5.76k|               yaml::finalize_node_anchor(preamble.node_props, ctx, it);
 4571|  5.76k|               return;
 4572|  5.77k|            }
 4573|       |
 4574|   377k|            while (it != end) {
  ------------------
  |  Branch (4574:20): [True: 373k, False: 4.46k]
  ------------------
 4575|       |               // Skip whitespace and newlines at start of each iteration
 4576|   373k|               yaml::skip_ws_and_newlines(it, end);
 4577|       |
 4578|   373k|               if (it != end && *it == '}') {
  ------------------
  |  Branch (4578:20): [True: 373k, False: 0]
  |  Branch (4578:33): [True: 5.59k, False: 367k]
  ------------------
 4579|  5.59k|                  ++it;
 4580|  5.59k|                  yaml::validate_flow_node_adjacent_tail(ctx, it, end);
 4581|  5.59k|                  if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4581:23): [True: 30, False: 5.56k]
  ------------------
 4582|     30|                     return;
 4583|  5.56k|                  break;
 4584|  5.59k|               }
 4585|       |
 4586|   367k|               bool explicit_flow_key = false;
 4587|   367k|               auto explicit_probe = it;
 4588|   367k|               yaml::skip_inline_ws(explicit_probe, end);
 4589|   367k|               if (explicit_probe != end && *explicit_probe == '?') {
  ------------------
  |  Branch (4589:20): [True: 367k, False: 0]
  |  Branch (4589:45): [True: 40.3k, False: 327k]
  ------------------
 4590|  40.3k|                  const auto after_q = explicit_probe + 1;
 4591|  40.3k|                  if (after_q == end || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*after_q)] ||
  ------------------
  |  Branch (4591:23): [True: 10, False: 40.3k]
  |  Branch (4591:41): [True: 7.92k, False: 32.4k]
  ------------------
 4592|  33.6k|                      *after_q == ',' || *after_q == '}') {
  ------------------
  |  Branch (4592:23): [True: 25.0k, False: 7.37k]
  |  Branch (4592:42): [True: 672, False: 6.70k]
  ------------------
 4593|  33.6k|                     explicit_flow_key = true;
 4594|  33.6k|                     it = explicit_probe + 1;
 4595|  33.6k|                     yaml::skip_flow_ws_and_newlines(ctx, it, end);
 4596|  33.6k|                     if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4596:26): [True: 3, False: 33.6k]
  ------------------
 4597|      3|                        return;
 4598|  33.6k|                  }
 4599|  40.3k|               }
 4600|       |               // Parse key
 4601|   367k|               key_t key{};
 4602|   367k|               if constexpr (std::same_as<std::remove_cvref_t<key_t>, std::string>) {
 4603|   367k|                  if (explicit_flow_key && it != end && (*it == ':' || *it == ',' || *it == '}')) {
  ------------------
  |  Branch (4603:23): [True: 33.6k, False: 334k]
  |  Branch (4603:44): [True: 33.6k, False: 16]
  |  Branch (4603:58): [True: 705, False: 32.9k]
  |  Branch (4603:72): [True: 25.0k, False: 7.86k]
  |  Branch (4603:86): [True: 828, False: 7.04k]
  ------------------
 4604|  26.6k|                     key.clear();
 4605|  26.6k|                  }
 4606|   341k|                  else {
 4607|   341k|                     auto key_probe = it;
 4608|   341k|                     yaml::skip_inline_ws(key_probe, end);
 4609|       |
 4610|       |                     // Use full node parsing only for structurally complex flow keys.
 4611|       |                     // Plain/quoted/alias keys stay on parse_yaml_key() for compatibility.
 4612|   341k|                     bool parse_complex_flow_key = false;
 4613|   341k|                     if (key_probe != end) {
  ------------------
  |  Branch (4613:26): [True: 341k, False: 16]
  ------------------
 4614|   341k|                        if (*key_probe == '[' || *key_probe == '{') {
  ------------------
  |  Branch (4614:29): [True: 1.22k, False: 339k]
  |  Branch (4614:50): [True: 7.63k, False: 332k]
  ------------------
 4615|  8.85k|                           parse_complex_flow_key = true;
 4616|  8.85k|                        }
 4617|   332k|                        else if (*key_probe == '&') {
  ------------------
  |  Branch (4617:34): [True: 36.8k, False: 295k]
  ------------------
 4618|  36.8k|                           ++key_probe;
 4619|  36.8k|                           yaml::parse_anchor_name(key_probe, end);
 4620|  36.8k|                           yaml::skip_inline_ws(key_probe, end);
 4621|  36.8k|                           if (key_probe != end && (*key_probe == '[' || *key_probe == '{')) {
  ------------------
  |  Branch (4621:32): [True: 36.7k, False: 78]
  |  Branch (4621:53): [True: 603, False: 36.1k]
  |  Branch (4621:74): [True: 1.03k, False: 35.1k]
  ------------------
 4622|  1.63k|                              parse_complex_flow_key = true;
 4623|  1.63k|                           }
 4624|  36.8k|                        }
 4625|   341k|                     }
 4626|       |
 4627|   341k|                     if (parse_complex_flow_key) {
  ------------------
  |  Branch (4627:26): [True: 10.4k, False: 330k]
  ------------------
 4628|  10.4k|                        glz::generic key_node{};
 4629|  10.4k|                        from<YAML, glz::generic>::template op<yaml::flow_context_on<Opts>()>(key_node, ctx, it, end);
 4630|  10.4k|                        if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4630:29): [True: 1.20k, False: 9.29k]
  ------------------
 4631|  1.20k|                           return;
 4632|  9.29k|                        if (!yaml::materialize_key(key, key_node, ctx)) [[unlikely]]
  ------------------
  |  Branch (4632:29): [True: 2, False: 9.28k]
  ------------------
 4633|      2|                           return;
 4634|  9.29k|                     }
 4635|   330k|                     else {
 4636|   330k|                        if (!yaml::parse_yaml_key(key, ctx, it, end, true)) {
  ------------------
  |  Branch (4636:29): [True: 1.09k, False: 329k]
  ------------------
 4637|  1.09k|                           return;
 4638|  1.09k|                        }
 4639|   330k|                     }
 4640|   341k|                  }
 4641|       |               }
 4642|       |               else {
 4643|       |                  if (explicit_flow_key && it != end && (*it == ':' || *it == ',' || *it == '}')) {
 4644|       |                     ctx.error = error_code::syntax_error;
 4645|       |                     return;
 4646|       |                  }
 4647|       |                  from<YAML, key_t>::template op<yaml::flow_context_on<Opts>()>(key, ctx, it, end);
 4648|       |                  if (bool(ctx.error)) [[unlikely]]
 4649|       |                     return;
 4650|       |               }
 4651|       |
 4652|       |               // Separation between flow key and ':' may include comments/newlines.
 4653|       |               // In flow context, newlines are allowed between key and ':'.
 4654|   365k|               yaml::skip_flow_ws_and_newlines(ctx, it, end);
 4655|   367k|               if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4655:20): [True: 21, False: 367k]
  ------------------
 4656|     21|                  return;
 4657|       |
 4658|   367k|               auto parse_implicit_null = [&](val_t& val) -> bool {
 4659|   367k|                  if constexpr (nullable_like<std::remove_cvref_t<val_t>>) {
 4660|   367k|                     val = {};
 4661|   367k|                     return true;
 4662|   367k|                  }
 4663|   367k|                  else if constexpr (std::same_as<std::remove_cvref_t<val_t>, glz::generic>) {
 4664|   367k|                     val = glz::generic{};
 4665|   367k|                     return true;
 4666|   367k|                  }
 4667|   367k|                  else {
 4668|   367k|                     static constexpr std::string_view null_value{"null"};
 4669|   367k|                     auto null_it = null_value.data();
 4670|   367k|                     from<YAML, val_t>::template op<yaml::flow_context_on<Opts>()>(
 4671|   367k|                        val, ctx, null_it, null_value.data() + null_value.size());
 4672|   367k|                     return !bool(ctx.error);
 4673|   367k|                  }
 4674|   367k|               };
 4675|       |
 4676|   367k|               if (it != end && (*it == ',' || *it == '}')) {
  ------------------
  |  Branch (4676:20): [True: 363k, False: 4.32k]
  |  Branch (4676:34): [True: 277k, False: 85.6k]
  |  Branch (4676:48): [True: 15.5k, False: 70.1k]
  ------------------
 4677|   293k|                  val_t val{};
 4678|   293k|                  if (!parse_implicit_null(val)) [[unlikely]]
  ------------------
  |  Branch (4678:23): [True: 0, False: 293k]
  ------------------
 4679|      0|                     return;
 4680|       |
 4681|   293k|                  value.emplace(std::move(key), std::move(val));
 4682|       |
 4683|   293k|                  if (*it == '}') {
  ------------------
  |  Branch (4683:23): [True: 15.5k, False: 277k]
  ------------------
 4684|  15.5k|                     ++it;
 4685|  15.5k|                     yaml::validate_flow_node_adjacent_tail(ctx, it, end);
 4686|  15.5k|                     if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4686:26): [True: 42, False: 15.4k]
  ------------------
 4687|     42|                        return;
 4688|  15.4k|                     break;
 4689|  15.5k|                  }
 4690|       |
 4691|   277k|                  ++it; // skip comma
 4692|   277k|                  yaml::skip_ws_and_newlines(it, end);
 4693|   277k|                  continue;
 4694|   293k|               }
 4695|       |
 4696|  74.4k|               if (it == end || *it != ':') {
  ------------------
  |  Branch (4696:20): [True: 4.32k, False: 70.1k]
  |  Branch (4696:33): [True: 271, False: 69.8k]
  ------------------
 4697|  2.28k|                  ctx.error = error_code::syntax_error;
 4698|  2.28k|                  return;
 4699|  2.28k|               }
 4700|  72.1k|               ++it;
 4701|       |
 4702|  72.1k|               yaml::skip_flow_ws_and_newlines(ctx, it, end);
 4703|  72.1k|               if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4703:20): [True: 11, False: 72.1k]
  ------------------
 4704|     11|                  return;
 4705|       |
 4706|       |               // Omitted value after an explicit ':' maps to an implicit null.
 4707|  72.1k|               if (it != end && (*it == ',' || *it == '}')) {
  ------------------
  |  Branch (4707:20): [True: 69.3k, False: 2.78k]
  |  Branch (4707:34): [True: 5.18k, False: 64.2k]
  |  Branch (4707:48): [True: 20.9k, False: 43.2k]
  ------------------
 4708|  26.1k|                  val_t val{};
 4709|  26.1k|                  if (!parse_implicit_null(val)) [[unlikely]]
  ------------------
  |  Branch (4709:23): [True: 0, False: 26.1k]
  ------------------
 4710|      0|                     return;
 4711|       |
 4712|  26.1k|                  value.emplace(std::move(key), std::move(val));
 4713|       |
 4714|  26.1k|                  if (*it == '}') {
  ------------------
  |  Branch (4714:23): [True: 20.9k, False: 5.18k]
  ------------------
 4715|  20.9k|                     ++it;
 4716|  20.9k|                     yaml::validate_flow_node_adjacent_tail(ctx, it, end);
 4717|  20.9k|                     if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4717:26): [True: 10, False: 20.9k]
  ------------------
 4718|     10|                        return;
 4719|  20.9k|                     break;
 4720|  20.9k|                  }
 4721|       |
 4722|  5.18k|                  ++it; // skip comma
 4723|  5.18k|                  yaml::skip_ws_and_newlines(it, end);
 4724|  5.18k|                  continue;
 4725|  26.1k|               }
 4726|       |
 4727|       |               // Parse value
 4728|  46.0k|               val_t val{};
 4729|  46.0k|               from<YAML, val_t>::template op<yaml::flow_context_on<Opts>()>(val, ctx, it, end);
 4730|  46.0k|               if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4730:20): [True: 931, False: 45.1k]
  ------------------
 4731|    931|                  return;
 4732|       |
 4733|  45.1k|               value.emplace(std::move(key), std::move(val));
 4734|       |
 4735|  45.1k|               yaml::skip_inline_ws(it, end);
 4736|       |
 4737|  45.1k|               if (it != end && *it == '}') {
  ------------------
  |  Branch (4737:20): [True: 42.2k, False: 2.94k]
  |  Branch (4737:33): [True: 3.25k, False: 38.9k]
  ------------------
 4738|  3.25k|                  ++it;
 4739|  3.25k|                  yaml::validate_flow_node_adjacent_tail(ctx, it, end);
 4740|  3.25k|                  if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4740:23): [True: 36, False: 3.22k]
  ------------------
 4741|     36|                     return;
 4742|  3.22k|                  break;
 4743|  3.25k|               }
 4744|  41.8k|               else if (it != end && *it == ',') {
  ------------------
  |  Branch (4744:25): [True: 38.9k, False: 2.94k]
  |  Branch (4744:38): [True: 34.3k, False: 4.56k]
  ------------------
 4745|  34.3k|                  ++it;
 4746|       |                  // Skip whitespace and newlines after comma
 4747|  34.3k|                  yaml::skip_ws_and_newlines(it, end);
 4748|  34.3k|               }
 4749|  7.50k|               else if (it != end && (*it == '\n' || *it == '\r')) {
  ------------------
  |  Branch (4749:25): [True: 4.56k, False: 2.94k]
  |  Branch (4749:39): [True: 3.81k, False: 750]
  |  Branch (4749:54): [True: 612, False: 138]
  ------------------
 4750|       |                  // Newlines may precede either the closing brace or the
 4751|       |                  // separator comma for the next entry.
 4752|  4.42k|                  yaml::skip_ws_and_newlines(it, end);
 4753|  4.42k|                  if (it != end && *it == '}') {
  ------------------
  |  Branch (4753:23): [True: 4.41k, False: 15]
  |  Branch (4753:36): [True: 774, False: 3.63k]
  ------------------
 4754|    774|                     ++it;
 4755|    774|                     yaml::validate_flow_node_adjacent_tail(ctx, it, end);
 4756|    774|                     if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4756:26): [True: 3, False: 771]
  ------------------
 4757|      3|                        return;
 4758|    771|                     break;
 4759|    774|                  }
 4760|  3.65k|                  if (it != end && *it == ',') {
  ------------------
  |  Branch (4760:23): [True: 3.63k, False: 15]
  |  Branch (4760:36): [True: 3.62k, False: 12]
  ------------------
 4761|  3.62k|                     ++it;
 4762|  3.62k|                     yaml::skip_ws_and_newlines(it, end);
 4763|  3.62k|                     continue;
 4764|  3.62k|                  }
 4765|     27|                  ctx.error = error_code::syntax_error;
 4766|     27|                  return;
 4767|  3.65k|               }
 4768|  3.08k|               else {
 4769|  3.08k|                  ctx.error = error_code::syntax_error;
 4770|  3.08k|                  return;
 4771|  3.08k|               }
 4772|  45.1k|            }
 4773|  56.8k|         }
 4774|   777k|         else {
 4775|       |            // Block mapping - use shared loop with map-specific callback
 4776|   777k|            yaml::parse_block_mapping_loop<Opts>(
 4777|   777k|               ctx, it, end, int32_t(-1), [&](auto& ctx, auto& it, auto end, int32_t line_indent) -> bool {
 4778|   777k|                  auto parse_map_value = [&](val_t& val) -> bool {
 4779|   777k|                     if (it != end && !yaml::line_end_or_comment_table[static_cast<uint8_t>(*it)]) {
 4780|   777k|                        bool line_starts_with_explicit_value_indicator = false;
 4781|       |
 4782|       |                        // Inline mapping values in block context cannot start with a
 4783|       |                        // plain "key: value" pair on the same line (e.g. "a: b: c").
 4784|       |                        // Such constructs are malformed unless wrapped in flow
 4785|       |                        // delimiters ({...} / [...]) or quoted.
 4786|   777k|                        if constexpr (std::is_pointer_v<std::decay_t<decltype(it)>>) {
 4787|   777k|                           if (ctx.stream_begin) {
 4788|   777k|                              auto is_line_content_start = [&](auto pos) {
 4789|   777k|                                 return !ctx.line_prefix_before(pos).has_content;
 4790|   777k|                              };
 4791|       |
 4792|   777k|                              auto line_has_explicit_value_indicator = [&](auto pos) {
 4793|   777k|                                 const char* line = ctx.line_begin_of(pos);
 4794|   777k|                                 while (line != end && (*line == ' ' || *line == '\t')) ++line;
 4795|   777k|                                 return line != end && *line == ':';
 4796|   777k|                              };
 4797|       |
 4798|   777k|                              if (!is_line_content_start(it) &&
 4799|   777k|                                  yaml::inline_value_has_plain_mapping_indicator(it, end) &&
 4800|   777k|                                  !line_has_explicit_value_indicator(it)) {
 4801|   777k|                                 ctx.error = error_code::syntax_error;
 4802|   777k|                                 return false;
 4803|   777k|                              }
 4804|   777k|                              line_starts_with_explicit_value_indicator = line_has_explicit_value_indicator(it);
 4805|   777k|                           }
 4806|   777k|                        }
 4807|       |
 4808|   777k|                        if (*it == '-' &&
 4809|   777k|                            ((it + 1) == end || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*(it + 1))]) &&
 4810|   777k|                            !line_starts_with_explicit_value_indicator) {
 4811|       |                           // "key: - item" is not valid block sequence syntax.
 4812|   777k|                           ctx.error = error_code::syntax_error;
 4813|   777k|                           return false;
 4814|   777k|                        }
 4815|       |
 4816|   777k|                        if (!ctx.push_indent(line_indent + 1)) [[unlikely]]
 4817|   777k|                           return false;
 4818|   777k|                        from<YAML, val_t>::template op<Opts>(val, ctx, it, end);
 4819|   777k|                        ctx.pop_indent();
 4820|   777k|                     }
 4821|   777k|                     else {
 4822|   777k|                        int32_t nested_indent = yaml::detect_nested_value_indent(ctx, it, end, line_indent);
 4823|   777k|                        if (nested_indent >= 0) {
 4824|   777k|                           yaml::skip_to_content(it, end);
 4825|   777k|                           if (it != end && *it == ':' && (it + 1) != end && *(it + 1) == '\t') {
 4826|   777k|                              ctx.error = error_code::syntax_error;
 4827|   777k|                              return false;
 4828|   777k|                           }
 4829|       |                           // A struct value reads the pushed indent as its own key column;
 4830|       |                           // every other value type reads it as the enclosing baseline.
 4831|   777k|                           const int32_t value_indent =
 4832|   777k|                              yaml::receives_block_mapping_column<val_t>() ? nested_indent : nested_indent - 1;
 4833|   777k|                           if (!ctx.push_indent(value_indent)) [[unlikely]]
 4834|   777k|                              return false;
 4835|   777k|                           from<YAML, val_t>::template op<Opts>(val, ctx, it, end);
 4836|   777k|                           ctx.pop_indent();
 4837|   777k|                        }
 4838|   777k|                     }
 4839|   777k|                     return !bool(ctx.error);
 4840|   777k|                  };
 4841|       |
 4842|       |                  // Explicit key entry form:
 4843|       |                  // ? key
 4844|       |                  // : value
 4845|   777k|                  if (*it == '?' && ((it + 1) != end) && *(it + 1) == '\t') {
 4846|   777k|                     ctx.error = error_code::syntax_error;
 4847|   777k|                     return false;
 4848|   777k|                  }
 4849|   777k|                  if (*it == '?' && ((it + 1) == end || *(it + 1) == ' ' || *(it + 1) == '\n' || *(it + 1) == '\r')) {
 4850|   777k|                     ++it; // skip '?'
 4851|   777k|                     yaml::skip_inline_ws(it, end);
 4852|       |
 4853|   777k|                     const int32_t explicit_value_indicator_indent =
 4854|   777k|                        (ctx.current_indent() < 0) ? 0 : (ctx.current_indent() + 1);
 4855|       |
 4856|   777k|                     key_t key{};
 4857|   777k|                     if constexpr (std::same_as<std::remove_cvref_t<key_t>, std::string>) {
 4858|   777k|                        auto to_string_key = [&](glz::generic& key_node) {
 4859|   777k|                           return yaml::materialize_key(key, key_node, ctx);
 4860|   777k|                        };
 4861|       |
 4862|   777k|                        auto key_it = it;
 4863|   777k|                        yaml::skip_inline_ws(key_it, end);
 4864|       |
 4865|   777k|                        auto content = key_it;
 4866|   777k|                        yaml::skip_to_content(content, end);
 4867|   777k|                        bool handled_anchor_only_empty_key = false;
 4868|       |
 4869|       |                        // Anchor on an empty explicit key node:
 4870|       |                        //   ? &a
 4871|       |                        //   : value
 4872|   777k|                        if (content != end && *content == '&') {
 4873|   777k|                           auto anchor_probe = content + 1;
 4874|   777k|                           auto anchor_name = yaml::parse_anchor_name(anchor_probe, end);
 4875|   777k|                           if (!anchor_name.empty()) {
 4876|   777k|                              auto after_anchor = anchor_probe;
 4877|   777k|                              yaml::skip_inline_ws(after_anchor, end);
 4878|       |
 4879|   777k|                              auto value_indicator = after_anchor;
 4880|   777k|                              if (value_indicator != end && *value_indicator == ':') {
 4881|   777k|                                 key.clear();
 4882|   777k|                                 ctx.anchors[std::string(anchor_name)] = {content, content, ctx.current_indent()};
 4883|   777k|                                 it = value_indicator;
 4884|   777k|                                 handled_anchor_only_empty_key = true;
 4885|   777k|                              }
 4886|   777k|                              else {
 4887|   777k|                                 if (value_indicator != end && *value_indicator == '#') {
 4888|   777k|                                    yaml::skip_comment(value_indicator, end);
 4889|   777k|                                 }
 4890|   777k|                                 if (value_indicator != end && (*value_indicator == '\n' || *value_indicator == '\r')) {
 4891|   777k|                                    yaml::skip_newline(value_indicator, end);
 4892|   777k|                                    auto value_line = value_indicator;
 4893|   777k|                                    int32_t value_indent = yaml::measure_indent(value_line, end, ctx);
 4894|   777k|                                    if (bool(ctx.error)) [[unlikely]]
 4895|   777k|                                       return false;
 4896|   777k|                                    if (value_line != end && *value_line == ':' &&
 4897|   777k|                                        value_indent == explicit_value_indicator_indent) {
 4898|   777k|                                       key.clear();
 4899|   777k|                                       ctx.anchors[std::string(anchor_name)] = {content, content, ctx.current_indent()};
 4900|   777k|                                       it = value_line;
 4901|   777k|                                       handled_anchor_only_empty_key = true;
 4902|   777k|                                    }
 4903|   777k|                                    else if (value_line != end && *value_line == ':') {
 4904|       |                                       // In explicit-key form ("? &a"), a following ':'
 4905|       |                                       // starts the outer value indicator only at the same
 4906|       |                                       // indentation. A deeper-indented ': value' is malformed.
 4907|   777k|                                       ctx.error = error_code::syntax_error;
 4908|   777k|                                       return false;
 4909|   777k|                                    }
 4910|   777k|                                 }
 4911|   777k|                              }
 4912|   777k|                           }
 4913|   777k|                        }
 4914|       |
 4915|   777k|                        const bool key_content_spans_lines = [&] {
 4916|   777k|                           auto scan = key_it;
 4917|   777k|                           while (scan != content && scan != end) {
 4918|   777k|                              if (*scan == '\n' || *scan == '\r') return true;
 4919|   777k|                              ++scan;
 4920|   777k|                           }
 4921|   777k|                           return false;
 4922|   777k|                        }();
 4923|       |
 4924|   777k|                        if (handled_anchor_only_empty_key) {
 4925|       |                           // 'it' already points to the explicit value indicator ':'
 4926|   777k|                        }
 4927|   777k|                        else if (content == end || (*content == ':' && key_content_spans_lines)) {
 4928|   777k|                           key.clear();
 4929|   777k|                           it = content;
 4930|   777k|                        }
 4931|   777k|                        else {
 4932|       |                           // Explicit mapping keys ('? key-node') are full YAML nodes.
 4933|       |                           // Parse the key node structurally (not via plain-key scanning)
 4934|       |                           // so inputs like '? []: x' and '? JSON: like' are interpreted
 4935|       |                           // as complex keys, not split into implicit key/value pairs.
 4936|   777k|                           auto key_node_it = content;
 4937|   777k|                           auto key_node_end = end;
 4938|   777k|                           if constexpr (std::is_pointer_v<std::decay_t<It>>) {
 4939|       |                              // In explicit-key form, a following standalone ':'
 4940|       |                              // line (same or lower indentation) belongs to the
 4941|       |                              // outer mapping value, not the key node itself.
 4942|   777k|                              auto scan = content;
 4943|   777k|                              while (scan != end) {
 4944|   777k|                                 while (scan != end && *scan != '\n' && *scan != '\r') {
 4945|   777k|                                    ++scan;
 4946|   777k|                                 }
 4947|   777k|                                 if (scan == end) {
 4948|   777k|                                    break;
 4949|   777k|                                 }
 4950|       |
 4951|   777k|                                 yaml::skip_newline(scan, end);
 4952|   777k|                                 auto line_start = scan;
 4953|       |
 4954|   777k|                                 int32_t indicator_indent = 0;
 4955|   777k|                                 while (scan != end && *scan == ' ') {
 4956|   777k|                                    ++indicator_indent;
 4957|   777k|                                    ++scan;
 4958|   777k|                                 }
 4959|       |
 4960|   777k|                                 if (scan != end && *scan == ':') {
 4961|   777k|                                    const auto after_colon = scan + 1;
 4962|   777k|                                    if ((after_colon == end ||
 4963|   777k|                                         yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*after_colon)]) &&
 4964|   777k|                                        indicator_indent <= line_indent) {
 4965|   777k|                                       key_node_end = line_start;
 4966|   777k|                                       break;
 4967|   777k|                                    }
 4968|   777k|                                 }
 4969|   777k|                              }
 4970|   777k|                           }
 4971|       |
 4972|   777k|                           glz::generic key_node{};
 4973|   777k|                           const bool prev_explicit_mapping_key_context = ctx.explicit_mapping_key_context;
 4974|   777k|                           ctx.explicit_mapping_key_context = true;
 4975|   777k|                           from<YAML, glz::generic>::template op<Opts>(key_node, ctx, key_node_it, key_node_end);
 4976|   777k|                           ctx.explicit_mapping_key_context = prev_explicit_mapping_key_context;
 4977|   777k|                           if (bool(ctx.error)) [[unlikely]]
 4978|   777k|                              return false;
 4979|   777k|                           it = key_node_it;
 4980|   777k|                           if (!to_string_key(key_node)) [[unlikely]]
 4981|   777k|                              return false;
 4982|   777k|                        }
 4983|   777k|                     }
 4984|   777k|                     else {
 4985|   777k|                        if (it != end && !yaml::line_end_or_comment_table[static_cast<uint8_t>(*it)]) {
 4986|   777k|                           from<YAML, key_t>::template op<Opts>(key, ctx, it, end);
 4987|   777k|                           if (bool(ctx.error)) [[unlikely]]
 4988|   777k|                              return false;
 4989|   777k|                        }
 4990|   777k|                     }
 4991|       |
 4992|   777k|                     yaml::skip_inline_ws(it, end);
 4993|   777k|                     yaml::skip_comment(it, end);
 4994|       |
 4995|       |                     // Value indicator may appear on the next line at the same indent.
 4996|   777k|                     if (it != end && (*it == '\n' || *it == '\r')) {
 4997|   777k|                        auto probe = it;
 4998|   777k|                        bool found_value_indicator = false;
 4999|       |
 5000|   777k|                        while (probe != end && (*probe == '\n' || *probe == '\r')) {
 5001|   777k|                           yaml::skip_newline(probe, end);
 5002|       |
 5003|   777k|                           auto value_line = probe;
 5004|   777k|                           int32_t value_indent = yaml::measure_indent(value_line, end, ctx);
 5005|   777k|                           if (bool(ctx.error)) [[unlikely]]
 5006|   777k|                              return false;
 5007|       |
 5008|   777k|                           if (value_line == end || *value_line == '\n' || *value_line == '\r') {
 5009|   777k|                              probe = value_line;
 5010|   777k|                              continue; // blank line
 5011|   777k|                           }
 5012|   777k|                           if (*value_line == '#') {
 5013|   777k|                              yaml::skip_comment(value_line, end);
 5014|   777k|                              probe = value_line;
 5015|   777k|                              continue; // comment-only line
 5016|   777k|                           }
 5017|   777k|                           if (*value_line == ':' && value_indent == explicit_value_indicator_indent) {
 5018|   777k|                              it = value_line;
 5019|   777k|                              found_value_indicator = true;
 5020|   777k|                           }
 5021|   777k|                           break;
 5022|   777k|                        }
 5023|       |
 5024|   777k|                        if (found_value_indicator) {
 5025|   777k|                           yaml::skip_inline_ws(it, end);
 5026|   777k|                        }
 5027|   777k|                     }
 5028|       |
 5029|   777k|                     val_t val{};
 5030|   777k|                     if (it != end && *it == ':') {
 5031|   777k|                        ++it;
 5032|   777k|                        if (it != end && *it == '\t') {
 5033|   777k|                           ctx.error = error_code::syntax_error;
 5034|   777k|                           return false;
 5035|   777k|                        }
 5036|   777k|                        if (it != end && (*it == '\n' || *it == '\r')) {
 5037|   777k|                           auto probe = it;
 5038|   777k|                           yaml::skip_newline(probe, end);
 5039|   777k|                           while (probe != end && *probe == ' ') ++probe;
 5040|   777k|                           if (probe != end && *probe == ':' && ((probe + 1) != end) && *(probe + 1) == '\t') {
 5041|   777k|                              ctx.error = error_code::syntax_error;
 5042|   777k|                              return false;
 5043|   777k|                           }
 5044|   777k|                        }
 5045|   777k|                        yaml::skip_inline_ws(it, end);
 5046|   777k|                        if (!parse_map_value(val)) [[unlikely]]
 5047|   777k|                           return false;
 5048|   777k|                     }
 5049|       |
 5050|   777k|                     value.emplace(std::move(key), std::move(val));
 5051|   777k|                     return true;
 5052|   777k|                  }
 5053|       |
 5054|   777k|                  key_t key{};
 5055|   777k|                  if constexpr (std::same_as<std::remove_cvref_t<key_t>, std::string>) {
 5056|   777k|                     auto key_probe = it;
 5057|   777k|                     yaml::skip_inline_ws(key_probe, end);
 5058|   777k|                     const bool complex_flow_key = (key_probe != end && (*key_probe == '[' || *key_probe == '{'));
 5059|   777k|                     if (complex_flow_key) {
 5060|   777k|                        glz::generic key_node{};
 5061|   777k|                        from<YAML, glz::generic>::template op<yaml::flow_context_on<Opts>()>(key_node, ctx, it, end);
 5062|   777k|                        if (bool(ctx.error)) [[unlikely]]
 5063|   777k|                           return false;
 5064|   777k|                        if (!yaml::materialize_key(key, key_node, ctx)) [[unlikely]]
 5065|   777k|                           return false;
 5066|   777k|                     }
 5067|   777k|                     else {
 5068|   777k|                        if (!yaml::parse_yaml_key(key, ctx, it, end, false)) {
 5069|   777k|                           return false;
 5070|   777k|                        }
 5071|   777k|                     }
 5072|   777k|                  }
 5073|   777k|                  else {
 5074|   777k|                     from<YAML, key_t>::template op<Opts>(key, ctx, it, end);
 5075|   777k|                     if (bool(ctx.error)) [[unlikely]]
 5076|   777k|                        return false;
 5077|   777k|                  }
 5078|       |
 5079|   777k|                  yaml::skip_inline_ws(it, end);
 5080|       |
 5081|   777k|                  if (it == end || *it != ':') {
 5082|   777k|                     ctx.error = error_code::syntax_error;
 5083|   777k|                     return false;
 5084|   777k|                  }
 5085|   777k|                  ++it;
 5086|   777k|                  yaml::skip_inline_ws(it, end);
 5087|       |
 5088|   777k|                  val_t val{};
 5089|   777k|                  if (!parse_map_value(val)) [[unlikely]]
 5090|   777k|                     return false;
 5091|       |
 5092|   777k|                  value.emplace(std::move(key), std::move(val));
 5093|   777k|                  return true;
 5094|   777k|               });
 5095|   777k|         }
 5096|       |
 5097|   828k|         yaml::finalize_node_anchor(preamble.node_props, ctx, it);
 5098|   828k|      }
_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|   845k|      {
  466|   845k|         skip_inline_ws(it, end);
  467|       |
  468|   845k|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (468:14): [True: 4, False: 845k]
  ------------------
  469|      4|            if constexpr (!AllowEmptyInput) {
  470|      4|               ctx.error = error_code::unexpected_end;
  471|      4|            }
  472|      4|            return true;
  473|      4|         }
  474|       |
  475|   845k|         preamble.tag = parse_yaml_tag(it, end, ctx);
  476|   845k|         if (preamble.tag == yaml_tag::unknown) [[unlikely]] {
  ------------------
  |  Branch (476:14): [True: 5, False: 845k]
  ------------------
  477|      5|            ctx.error = error_code::syntax_error;
  478|      5|            return true;
  479|      5|         }
  480|   845k|         if (!tag_validator(preamble.tag)) [[unlikely]] {
  ------------------
  |  Branch (480:14): [True: 3, False: 844k]
  ------------------
  481|      3|            ctx.error = error_code::syntax_error;
  482|      3|            return true;
  483|      3|         }
  484|       |
  485|   844k|         skip_inline_ws(it, end);
  486|       |
  487|   844k|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (487:14): [True: 6, False: 844k]
  ------------------
  488|      6|            if constexpr (!AllowEmptyInput) {
  489|      6|               ctx.error = error_code::unexpected_end;
  490|      6|            }
  491|      6|            return true;
  492|      6|         }
  493|       |
  494|   844k|         if (parse_node_properties<Opts, PropertyPolicy>(std::forward<T>(value), ctx, it, end, preamble.node_props)) {
  ------------------
  |  Branch (494:14): [True: 4.34k, False: 840k]
  ------------------
  495|  4.34k|            return true;
  496|  4.34k|         }
  497|       |
  498|   840k|         return false;
  499|   844k|      }
_ZZN3glz4fromILj450ENS_17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES1_EEEEE2opITnDaXtlNS_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2EEERPKcRS5_TkNS_10is_contextERNS8_12yaml_contextESB_EEvOT1_OT2_OT0_T3_ENKUlNS8_8yaml_tagEE_clESN_:
 4521|   845k|                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|   844k|      {
  409|   844k|         state.has_anchor = false;
  410|   844k|         state.anchor_name.clear();
  411|   844k|         state.anchor_start = nullptr;
  412|   844k|         state.anchor_indent = ctx.current_indent();
  413|       |
  414|   844k|         if constexpr (Policy.allow_alias) {
  415|   844k|            if constexpr (Policy.alias_can_be_mapping_key) {
  416|   844k|               if (!alias_token_is_mapping_key(it, end)) {
  ------------------
  |  Branch (416:20): [True: 832k, False: 12.0k]
  ------------------
  417|   832k|                  if (handle_alias<Opts>(std::forward<T>(value), ctx, it, end)) return true;
  ------------------
  |  Branch (417:23): [True: 4.29k, False: 828k]
  ------------------
  418|   832k|               }
  419|       |            }
  420|       |            else {
  421|       |               if (handle_alias<Opts>(std::forward<T>(value), ctx, it, end)) return true;
  422|       |            }
  423|   844k|         }
  424|       |
  425|   844k|         if (it != end && *it == '&') {
  ------------------
  |  Branch (425:14): [True: 840k, False: 4.29k]
  |  Branch (425:27): [True: 54.3k, False: 786k]
  ------------------
  426|  54.3k|            ++it;
  427|  54.3k|            auto name = parse_anchor_name(it, end);
  428|  54.3k|            if (name.empty()) {
  ------------------
  |  Branch (428:17): [True: 16, False: 54.3k]
  ------------------
  429|     16|               ctx.error = error_code::syntax_error;
  430|     16|               return true;
  431|     16|            }
  432|  54.3k|            skip_inline_ws(it, end);
  433|  54.3k|            if (it == end) {
  ------------------
  |  Branch (433:17): [True: 27, False: 54.3k]
  ------------------
  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|  54.3k|            state.has_anchor = true;
  446|  54.3k|            state.anchor_name = std::string(name);
  447|  54.3k|            state.anchor_start = &*it;
  448|  54.3k|         }
  449|       |
  450|   844k|         return false;
  451|   844k|      }
_ZN3glz4yaml12handle_aliasITnDaXtlNS0_9yaml_optsELj450ELb1ELb0ELb1ELh2EEERNS_17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES3_EEEENS0_12yaml_contextEPKcSB_EEbOT0_RT1_RT2_T3_:
  300|   832k|      {
  301|   832k|         if (it == end || *it != '*') return false;
  ------------------
  |  Branch (301:14): [True: 0, False: 832k]
  |  Branch (301:27): [True: 828k, False: 4.29k]
  ------------------
  302|       |
  303|  4.29k|         ++it; // skip '*'
  304|  4.29k|         auto name = parse_anchor_name(it, end);
  305|  4.29k|         if (name.empty()) {
  ------------------
  |  Branch (305:14): [True: 8, False: 4.29k]
  ------------------
  306|      8|            ctx.error = error_code::syntax_error;
  307|      8|            return true;
  308|      8|         }
  309|       |
  310|  4.29k|         auto anchor_it = ctx.anchors.find(name);
  311|  4.29k|         if (anchor_it == ctx.anchors.end()) {
  ------------------
  |  Branch (311:14): [True: 72, False: 4.21k]
  ------------------
  312|     72|            ctx.error = error_code::syntax_error; // undefined alias
  313|     72|            return true;
  314|     72|         }
  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.21k|         const auto span = anchor_it->second;
  319|       |
  320|       |         // Empty anchor span (anchor on null/empty node) — leave value as default
  321|  4.21k|         if (span.begin == span.end) {
  ------------------
  |  Branch (321:14): [True: 1.25k, False: 2.96k]
  ------------------
  322|  1.25k|            return true;
  323|  1.25k|         }
  324|       |
  325|       |         // An anchor is invisible to itself while it expands. A span that aliases the name it
  326|       |         // defines -- reachable because a mapping key's anchor is registered over the key text
  327|       |         // before that text is parsed -- would otherwise replay itself forever.
  328|  2.96k|         if (ctx.alias_span_is_replaying(span.begin, span.end)) [[unlikely]] {
  ------------------
  |  Branch (328:14): [True: 27, False: 2.94k]
  ------------------
  329|     27|            ctx.error = error_code::syntax_error; // cyclic alias
  330|     27|            return true;
  331|     27|         }
  332|       |
  333|       |         // Replaying an anchor re-enters the reader directly, bypassing the variant reader's
  334|       |         // depth guard, so this is the only depth accounting a chain of aliases into a
  335|       |         // non-variant target gets. The cycle check above stops the unbounded case; this bounds
  336|       |         // a legitimate but deeply chained one.
  337|  2.94k|         depth_guard guard{ctx, yaml::max_yaml_recursive_depth};
  338|  2.94k|         if (!guard) [[unlikely]]
  ------------------
  |  Branch (338:14): [True: 2, False: 2.93k]
  ------------------
  339|      2|            return true;
  340|       |
  341|  2.93k|         if (!ctx.charge_alias_expansion(static_cast<size_t>(span.end - span.begin))) [[unlikely]] {
  ------------------
  |  Branch (341:14): [True: 0, False: 2.93k]
  ------------------
  342|      0|            ctx.error = error_code::exceeded_max_expansion;
  343|      0|            ctx.custom_error_message = "alias expansion";
  344|      0|            return true;
  345|      0|         }
  346|       |
  347|  2.93k|         auto replay_it = span.begin;
  348|  2.93k|         auto replay_end = span.end;
  349|       |
  350|       |         // Save indent context and set up for replay
  351|  2.93k|         auto saved_indent_stack = std::move(ctx.indent_stack);
  352|  2.93k|         ctx.indent_stack.clear();
  353|  2.93k|         if (span.base_indent > 0) {
  ------------------
  |  Branch (353:14): [True: 2.10k, False: 833]
  ------------------
  354|  2.10k|            ctx.push_indent(span.base_indent - 1);
  355|  2.10k|         }
  356|       |
  357|  2.93k|         ctx.active_alias_spans.emplace_back(span.begin, span.end);
  358|       |
  359|  2.93k|         using V = std::remove_cvref_t<T>;
  360|  2.93k|         from<YAML, V>::template op<Opts>(std::forward<T>(value), ctx, replay_it, replay_end);
  361|       |
  362|  2.93k|         ctx.active_alias_spans.pop_back();
  363|       |
  364|       |         // Restore indent context
  365|  2.93k|         ctx.indent_stack = std::move(saved_indent_stack);
  366|  2.93k|         return true;
  367|  2.93k|      }
_ZN3glz4fromILj450ENS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEEE2opITnDaXtlNS_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj1EEERS4_TkNS_10is_contextERNS7_12yaml_contextERPKcSD_EEvOT0_OT1_OT2_T3_:
  274|  6.10M|      {
  275|  6.10M|         using V = std::decay_t<decltype(get_member(std::declval<Value>(), meta_wrapper_v<T>))>;
  276|  6.10M|         from<YAML, V>::template op<Opts>(get_member(std::forward<Value>(value), meta_wrapper_v<T>),
  277|  6.10M|                                          std::forward<Ctx>(ctx), std::forward<It0>(it), end);
  278|  6.10M|      }
_ZN3glz4fromILj450ENSt3__17variantIJDndNS1_12basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEbNS1_6vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS6_ISD_EEEENSC_ISD_EEEEEE2opITnDaXtlNS_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj1EEERPKcRSH_TkNS_10is_contextERNSK_12yaml_contextESN_EEvOT1_OT2_OT0_T3_:
 5635|  8.90M|      {
 5636|       |         // Inside op() rather than at class scope: read_supported is `requires { from<Format, T>{}; }`,
 5637|       |         // so a class-scope assert turns that feature probe into a hard error instead of `false`.
 5638|  8.90M|         static_assert(content_v<std::remove_cvref_t<T>>.empty(),
 5639|  8.90M|                       "Adjacent variant tagging (glz::meta `content`) is implemented for JSON and "
 5640|  8.90M|                       "BEVE but not yet for YAML. Reading this variant as YAML would silently expect "
 5641|  8.90M|                       "the internally tagged shape, so it is rejected here instead.");
 5642|  8.90M|         if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (5642:14): [True: 0, False: 8.90M]
  ------------------
 5643|      0|            return;
 5644|       |
 5645|       |         // Every nested generic/variant value routes back through this reader, so bounding
 5646|       |         // depth here caps flow-collection and flow-embedded mapping recursion that the
 5647|       |         // indent stack does not cover.
 5648|  8.90M|         depth_guard guard{ctx, yaml::max_yaml_recursive_depth};
 5649|  8.90M|         if (!guard) [[unlikely]]
  ------------------
  |  Branch (5649:14): [True: 77, False: 8.90M]
  ------------------
 5650|     77|            return;
 5651|       |
 5652|       |         // At root level (indent == -1), skip leading whitespace, newlines, and comments
 5653|       |         // For nested values, only skip inline whitespace to preserve block structure
 5654|  8.90M|         if (ctx.current_indent() < 0) {
  ------------------
  |  Branch (5654:14): [True: 7.15M, False: 1.74M]
  ------------------
 5655|  7.15M|            yaml::skip_ws_newlines_comments(it, end);
 5656|  7.15M|         }
 5657|  1.74M|         else {
 5658|  1.74M|            yaml::skip_inline_ws(it, end);
 5659|  1.74M|         }
 5660|       |
 5661|  8.90M|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (5661:14): [True: 812, False: 8.90M]
  ------------------
 5662|    812|            ctx.error = error_code::unexpected_end;
 5663|    812|            return;
 5664|    812|         }
 5665|       |
 5666|       |         // Tagged variants: a discriminator key (meta::tag) selects the alternative, with the
 5667|       |         // matching meta::ids entry naming each type. This mirrors the JSON behavior so the
 5668|       |         // same variant definitions round-trip across both formats.
 5669|       |         if constexpr (not tag_v<std::remove_cvref_t<T>>.empty()) {
 5670|       |            using V = std::remove_cvref_t<T>;
 5671|       |            const bool value_is_mapping =
 5672|       |               (*it == '{') || (!yaml::check_flow_context(Opts) && yaml::line_could_be_block_mapping(it, end));
 5673|       |            if (value_is_mapping) {
 5674|       |               // The mapping's keys sit at the column of `it`. Recover that column from the buffer:
 5675|       |               // the indent stack carries the parent context's indent (a struct member, a sequence
 5676|       |               // item, etc. each push a different offset), not this mapping's true column (see helper).
 5677|       |               const int32_t mapping_column = tagged_mapping_visual_indent(ctx, it, ctx.current_indent() + 1);
 5678|       |               auto tag_ctx = ctx.make_speculative();
 5679|       |               const size_t index = scan_variant_tag_index<V, Opts>(tag_ctx, it, end, mapping_column);
 5680|       |               ctx.alias_expansion_budget = tag_ctx.alias_expansion_budget; // charged even if no tag matched
 5681|       |               ctx.key_expansion_budget = tag_ctx.key_expansion_budget;
 5682|       |               if (index < ids_v<V>.size()) {
 5683|       |                  static constexpr auto tag_literal = string_literal_from_view<tag_v<V>.size()>(tag_v<V>);
 5684|       |                  emplace_runtime_variant(value, index);
 5685|       |                  // Establish the mapping's true column on the indent stack for the alternative parse.
 5686|       |                  // The chosen object is then parsed - and the discriminator's inline value skipped -
 5687|       |                  // at a consistent indent in every context, so a tag on the first key does not fold
 5688|       |                  // the following sibling entries into its value (no special-casing needed downstream).
 5689|       |                  if (!ctx.push_indent(mapping_column)) [[unlikely]] {
 5690|       |                     ctx.error = error_code::exceeded_max_recursive_depth;
 5691|       |                     return;
 5692|       |                  }
 5693|       |                  std::visit(
 5694|       |                     [&](auto&& alt) {
 5695|       |                        using Alt = std::remove_cvref_t<decltype(alt)>;
 5696|       |                        if constexpr ((glaze_object_t<Alt> || reflectable<Alt>) && not custom_read<Alt>) {
 5697|       |                           // Parse the mapping into the resolved struct; the tag key is skipped.
 5698|       |                           from<YAML, Alt>::template op<Opts, tag_literal>(alt, ctx, it, end);
 5699|       |                        }
 5700|       |                        else if constexpr (custom_read<Alt>) {
 5701|       |                           // Custom alternatives read the mapping body themselves and cannot skip an
 5702|       |                           // interior tag key the way reflected objects do, so the tag must be the
 5703|       |                           // first key (glaze always writes it first). Consume that leading "tag: id"
 5704|       |                           // entry, then hand the remaining mapping to the custom handler.
 5705|       |                           if constexpr (yaml::check_flow_context(Opts)) {
 5706|       |                              ctx.error = error_code::feature_not_supported;
 5707|       |                              ctx.custom_error_message =
 5708|       |                                 "custom variant alternatives are not supported in YAML flow style";
 5709|       |                           }
 5710|       |                           else {
 5711|       |                              ctx.scratch.clear();
 5712|       |                              if (yaml::parse_yaml_key(ctx.scratch, ctx, it, end, false)) {
 5713|       |                                 if (std::string_view{ctx.scratch} != tag_v<V>) {
 5714|       |                                    ctx.error = error_code::feature_not_supported;
 5715|       |                                    ctx.custom_error_message =
 5716|       |                                       "the tag must be the first key for a custom variant alternative";
 5717|       |                                 }
 5718|       |                                 else {
 5719|       |                                    yaml::skip_inline_ws(it, end);
 5720|       |                                    if (it == end || *it != ':') {
 5721|       |                                       ctx.error = error_code::syntax_error;
 5722|       |                                    }
 5723|       |                                    else {
 5724|       |                                       ++it;
 5725|       |                                       yaml::skip_inline_ws(it, end);
 5726|       |                                       yaml::skip_unknown_block_value<Opts>(ctx, it, end, mapping_column);
 5727|       |                                       if (!bool(ctx.error)) {
 5728|       |                                          // If nothing but trailing whitespace/comments remains, the tag
 5729|       |                                          // was the whole mapping: leave the alternative default.
 5730|       |                                          auto probe = it;
 5731|       |                                          yaml::skip_ws_newlines_comments(probe, end);
 5732|       |                                          if (probe == end) {
 5733|       |                                             it = probe;
 5734|       |                                          }
 5735|       |                                          else {
 5736|       |                                             // Publish the mapping's column so the custom handler's block
 5737|       |                                             // mapping (which would otherwise discover its own indent) reads
 5738|       |                                             // the remaining entries at the variant's indent and dedents
 5739|       |                                             // correctly in every context (root, sequence, nested).
 5740|       |                                             ctx.forced_block_mapping_indent = mapping_column;
 5741|       |                                             from<YAML, Alt>::template op<Opts>(alt, ctx, it, end);
 5742|       |                                             ctx.forced_block_mapping_indent = -1;
 5743|       |                                          }
 5744|       |                                       }
 5745|       |                                    }
 5746|       |                                 }
 5747|       |                              }
 5748|       |                           }
 5749|       |                        }
 5750|       |                        else {
 5751|       |                           // Non-object alternative (e.g. std::monostate): the emplaced default is
 5752|       |                           // the value, but the mapping must still be consumed.
 5753|       |                           walk_tagged_mapping<Opts>(
 5754|       |                              ctx, it, end, tag_v<V>, mapping_column,
 5755|       |                              [&](auto&& c, auto&& i, auto&& e, int32_t line_indent, bool in_flow) {
 5756|       |                                 yaml::skip_yaml_value<Opts>(c, i, e, in_flow ? 0 : line_indent, in_flow);
 5757|       |                              });
 5758|       |                        }
 5759|       |                     },
 5760|       |                     value);
 5761|       |                  ctx.pop_indent();
 5762|       |                  return;
 5763|       |               }
 5764|       |               // No resolvable tag key was found. Fall through to structural deduction:
 5765|       |               // if the alternatives are distinguishable by their fields this still succeeds,
 5766|       |               // otherwise the deduction path reports no_matching_variant_type.
 5767|       |            }
 5768|       |         }
 5769|       |
 5770|  8.90M|         if constexpr (yaml_variant_is_auto_deducible<std::remove_cvref_t<T>>()) {
 5771|  8.90M|            using V = std::remove_cvref_t<T>;
 5772|  8.90M|            using counts = yaml_variant_type_count<V>;
 5773|  8.90M|            const char c = *it;
 5774|  8.90M|            auto is_plain_scalar_boundary = [](const char ch) {
 5775|  8.90M|               switch (ch) {
 5776|  8.90M|               case ' ':
 5777|  8.90M|               case '\t':
 5778|  8.90M|               case '\n':
 5779|  8.90M|               case '\r':
 5780|  8.90M|               case ',':
 5781|  8.90M|               case ']':
 5782|  8.90M|               case '}':
 5783|  8.90M|                  return true;
 5784|  8.90M|               default:
 5785|  8.90M|                  return false;
 5786|  8.90M|               }
 5787|  8.90M|            };
 5788|       |
 5789|  8.90M|            auto has_indented_block_continuation = [&](auto word_end) {
 5790|  8.90M|               if constexpr (yaml::check_flow_context(Opts)) {
 5791|  8.90M|                  return false;
 5792|  8.90M|               }
 5793|  8.90M|               if (ctx.current_indent() < 0) {
 5794|  8.90M|                  return false;
 5795|  8.90M|               }
 5796|  8.90M|               if (word_end == end || (*word_end != '\n' && *word_end != '\r')) {
 5797|  8.90M|                  return false;
 5798|  8.90M|               }
 5799|       |
 5800|  8.90M|               auto look = word_end;
 5801|  8.90M|               yaml::skip_newline(look, end);
 5802|  8.90M|               while (look != end) {
 5803|  8.90M|                  int32_t line_indent = 0;
 5804|  8.90M|                  while (look != end && *look == ' ') {
 5805|  8.90M|                     ++line_indent;
 5806|  8.90M|                     ++look;
 5807|  8.90M|                  }
 5808|  8.90M|                  if (look != end && *look == '\t') {
 5809|  8.90M|                     return false;
 5810|  8.90M|                  }
 5811|  8.90M|                  if (look == end || *look == '\n' || *look == '\r') {
 5812|  8.90M|                     if (look != end) {
 5813|  8.90M|                        yaml::skip_newline(look, end);
 5814|  8.90M|                        continue;
 5815|  8.90M|                     }
 5816|  8.90M|                     return false;
 5817|  8.90M|                  }
 5818|  8.90M|                  if (*look == '#') {
 5819|  8.90M|                     yaml::skip_comment(look, end);
 5820|  8.90M|                     if (look != end && (*look == '\n' || *look == '\r')) {
 5821|  8.90M|                        yaml::skip_newline(look, end);
 5822|  8.90M|                        continue;
 5823|  8.90M|                     }
 5824|  8.90M|                     return false;
 5825|  8.90M|                  }
 5826|       |
 5827|       |                  // If the next non-empty line is an implicit mapping entry,
 5828|       |                  // don't treat it as scalar continuation for auto-deduced
 5829|       |                  // booleans/nulls.
 5830|  8.90M|                  {
 5831|  8.90M|                     auto scan = look;
 5832|  8.90M|                     while (scan != end && *scan != '\n' && *scan != '\r') {
 5833|  8.90M|                        if (*scan == ':') {
 5834|  8.90M|                           auto after_colon = scan + 1;
 5835|  8.90M|                           if (after_colon == end || *after_colon == ' ' || *after_colon == '\t' ||
 5836|  8.90M|                               *after_colon == '\n' || *after_colon == '\r') {
 5837|  8.90M|                              return false;
 5838|  8.90M|                           }
 5839|  8.90M|                        }
 5840|  8.90M|                        ++scan;
 5841|  8.90M|                     }
 5842|  8.90M|                  }
 5843|       |
 5844|  8.90M|                  return line_indent > ctx.current_indent();
 5845|  8.90M|               }
 5846|  8.90M|               return false;
 5847|  8.90M|            };
 5848|  8.90M|            auto is_word_boundary = [&](const auto ptr) {
 5849|  8.90M|               if (ptr == end) {
 5850|  8.90M|                  return true;
 5851|  8.90M|               }
 5852|  8.90M|               if (*ptr == ':') {
 5853|  8.90M|                  auto next = ptr + 1;
 5854|  8.90M|                  return (next == end) || *next == ' ' || *next == '\t' || *next == '\n' || *next == '\r';
 5855|  8.90M|               }
 5856|  8.90M|               return is_plain_scalar_boundary(*ptr);
 5857|  8.90M|            };
 5858|       |
 5859|  8.90M|            switch (c) {
 5860|  1.62M|            case '&': {
  ------------------
  |  Branch (5860:13): [True: 1.62M, False: 7.28M]
  ------------------
 5861|       |               // Anchor before value: parse name, then re-dispatch
 5862|  1.62M|               ++it;
 5863|  1.62M|               auto aname = yaml::parse_anchor_name(it, end);
 5864|  1.62M|               if (aname.empty()) {
  ------------------
  |  Branch (5864:20): [True: 198, False: 1.62M]
  ------------------
 5865|    198|                  ctx.error = error_code::syntax_error;
 5866|    198|                  return;
 5867|    198|               }
 5868|  1.62M|               yaml::skip_inline_ws(it, end);
 5869|  1.62M|               bool anchor_on_same_line = true;
 5870|  1.62M|               bool value_is_indentless_sequence = false;
 5871|  1.62M|               if (it == end || *it == '\n' || *it == '\r' || *it == '#') {
  ------------------
  |  Branch (5871:20): [True: 8.99k, False: 1.61M]
  |  Branch (5871:33): [True: 66.7k, False: 1.54M]
  |  Branch (5871:48): [True: 117k, False: 1.42M]
  |  Branch (5871:63): [True: 26.0k, False: 1.40M]
  ------------------
 5872|       |                  // Anchor followed by end-of-line. Check if the value continues on the
 5873|       |                  // next line (indented past current context) or if this is an empty node.
 5874|   219k|                  bool value_on_next_line = false;
 5875|   219k|                  if (it != end) {
  ------------------
  |  Branch (5875:23): [True: 210k, False: 8.99k]
  ------------------
 5876|   210k|                     auto peek = it;
 5877|       |                     // Skip comment if present
 5878|   210k|                     if (*peek == '#') {
  ------------------
  |  Branch (5878:26): [True: 26.0k, False: 184k]
  ------------------
 5879|   531k|                        while (peek != end && *peek != '\n' && *peek != '\r') ++peek;
  ------------------
  |  Branch (5879:32): [True: 531k, False: 58]
  |  Branch (5879:47): [True: 520k, False: 10.4k]
  |  Branch (5879:64): [True: 505k, False: 15.5k]
  ------------------
 5880|  26.0k|                     }
 5881|       |                     // Skip newline
 5882|   210k|                     if (peek != end && (*peek == '\n' || *peek == '\r')) {
  ------------------
  |  Branch (5882:26): [True: 210k, False: 58]
  |  Branch (5882:42): [True: 77.2k, False: 132k]
  |  Branch (5882:59): [True: 132k, False: 0]
  ------------------
 5883|   210k|                        yaml::skip_newline(peek, end);
 5884|       |                        // Skip blank lines
 5885|   294k|                        while (peek != end && (*peek == '\n' || *peek == '\r')) {
  ------------------
  |  Branch (5885:32): [True: 291k, False: 3.38k]
  |  Branch (5885:48): [True: 55.0k, False: 236k]
  |  Branch (5885:65): [True: 29.4k, False: 206k]
  ------------------
 5886|  84.5k|                           yaml::skip_newline(peek, end);
 5887|  84.5k|                        }
 5888|       |                        // Measure indent of next content line
 5889|   210k|                        int32_t next_indent = 0;
 5890|   335k|                        while (peek != end && *peek == ' ') {
  ------------------
  |  Branch (5890:32): [True: 331k, False: 3.81k]
  |  Branch (5890:47): [True: 125k, False: 206k]
  ------------------
 5891|   125k|                           ++next_indent;
 5892|   125k|                           ++peek;
 5893|   125k|                        }
 5894|   210k|                        if (peek != end && *peek != '\n' && *peek != '\r') {
  ------------------
  |  Branch (5894:29): [True: 206k, False: 3.81k]
  |  Branch (5894:44): [True: 200k, False: 6.11k]
  |  Branch (5894:61): [True: 198k, False: 1.26k]
  ------------------
 5895|   198k|                           const bool indentless_sequence =
 5896|   198k|                              (!ctx.sequence_item_value_context) && (*peek == '-') &&
  ------------------
  |  Branch (5896:31): [True: 195k, False: 3.31k]
  |  Branch (5896:69): [True: 95.1k, False: 100k]
  ------------------
 5897|  95.1k|                              ((peek + 1) == end ||
  ------------------
  |  Branch (5897:32): [True: 1.16k, False: 93.9k]
  ------------------
 5898|  93.9k|                               yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*(peek + 1))]) &&
  ------------------
  |  Branch (5898:32): [True: 91.5k, False: 2.34k]
  ------------------
 5899|  92.7k|                              (next_indent == ctx.current_indent() ||
  ------------------
  |  Branch (5899:32): [True: 5.82k, False: 86.9k]
  ------------------
 5900|  86.9k|                               (ctx.current_indent() > 0 && (next_indent + 1) == ctx.current_indent()));
  ------------------
  |  Branch (5900:33): [True: 12.3k, False: 74.5k]
  |  Branch (5900:61): [True: 11.4k, False: 974]
  ------------------
 5901|   198k|                           value_is_indentless_sequence = indentless_sequence;
 5902|   198k|                           const bool same_indent_property_node =
 5903|   198k|                              (next_indent == ctx.current_indent()) &&
  ------------------
  |  Branch (5903:31): [True: 25.7k, False: 173k]
  ------------------
 5904|  25.7k|                              (*peek == '!' || *peek == '&' || *peek == '*' || *peek == '[' || *peek == '{' ||
  ------------------
  |  Branch (5904:32): [True: 1.07k, False: 24.6k]
  |  Branch (5904:48): [True: 702, False: 23.9k]
  |  Branch (5904:64): [True: 237, False: 23.6k]
  |  Branch (5904:80): [True: 535, False: 23.1k]
  |  Branch (5904:96): [True: 829, False: 22.3k]
  ------------------
 5905|  22.3k|                               *peek == '"' || *peek == '\'' || *peek == '|' || *peek == '>');
  ------------------
  |  Branch (5905:32): [True: 1.71k, False: 20.6k]
  |  Branch (5905:48): [True: 749, False: 19.8k]
  |  Branch (5905:65): [True: 699, False: 19.1k]
  |  Branch (5905:81): [True: 979, False: 18.1k]
  ------------------
 5906|   198k|                           value_on_next_line =
 5907|   198k|                              (next_indent > ctx.current_indent()) || indentless_sequence || same_indent_property_node;
  ------------------
  |  Branch (5907:31): [True: 156k, False: 42.6k]
  |  Branch (5907:71): [True: 17.2k, False: 25.4k]
  |  Branch (5907:94): [True: 7.52k, False: 17.8k]
  ------------------
 5908|   198k|                        }
 5909|   210k|                     }
 5910|   210k|                  }
 5911|   219k|                  if (!value_on_next_line) {
  ------------------
  |  Branch (5911:23): [True: 38.1k, False: 181k]
  ------------------
 5912|       |                     // Anchor on empty/null node — store empty span, leave value as default
 5913|  38.1k|                     ctx.anchors[std::string(aname)] = {&*it, &*it, ctx.current_indent()};
 5914|  38.1k|                     return;
 5915|  38.1k|                  }
 5916|       |                  // Value is on next line — advance past newline/blank lines to the content
 5917|   181k|                  if (*it == '#') {
  ------------------
  |  Branch (5917:23): [True: 24.7k, False: 156k]
  ------------------
 5918|   507k|                     while (it != end && *it != '\n' && *it != '\r') ++it;
  ------------------
  |  Branch (5918:29): [True: 507k, False: 0]
  |  Branch (5918:42): [True: 497k, False: 10.0k]
  |  Branch (5918:57): [True: 482k, False: 14.6k]
  ------------------
 5919|  24.7k|                  }
 5920|   181k|                  if (it != end) yaml::skip_newline(it, end);
  ------------------
  |  Branch (5920:23): [True: 181k, False: 0]
  ------------------
 5921|   249k|                  while (it != end && (*it == '\n' || *it == '\r')) {
  ------------------
  |  Branch (5921:26): [True: 249k, False: 0]
  |  Branch (5921:40): [True: 46.8k, False: 202k]
  |  Branch (5921:55): [True: 21.8k, False: 181k]
  ------------------
 5922|  68.7k|                     yaml::skip_newline(it, end);
 5923|  68.7k|                  }
 5924|   181k|                  yaml::skip_inline_ws(it, end);
 5925|   181k|                  anchor_on_same_line = false;
 5926|   181k|               }
 5927|       |
 5928|       |               if constexpr (!yaml::check_flow_context(Opts)) {
 5929|       |                  if (anchor_on_same_line && *it == '-' &&
 5930|       |                      ((it + 1) == end || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*(it + 1))])) {
 5931|       |                     // "&anchor - item" is malformed in block context.
 5932|       |                     ctx.error = error_code::syntax_error;
 5933|       |                     return;
 5934|       |                  }
 5935|       |               }
 5936|       |
 5937|       |               // Anchor on alias (&anchor *alias) is invalid per YAML spec.
 5938|       |               // But alias-as-key (&anchor *alias : value) is valid.
 5939|  1.58M|               if (it != end && *it == '*' && !yaml::alias_token_is_mapping_key(it, end)) {
  ------------------
  |  Branch (5939:20): [True: 1.58M, False: 8]
  |  Branch (5939:33): [True: 1.02k, False: 1.58M]
  |  Branch (5939:47): [True: 85, False: 940]
  ------------------
 5940|     85|                  ctx.error = error_code::syntax_error;
 5941|     85|                  return;
 5942|     85|               }
 5943|       |
 5944|       |               if constexpr (!yaml::check_flow_context(Opts)) {
 5945|       |                  if (!anchor_on_same_line && it != end && *it == '&') {
 5946|       |                     auto probe = it + 1;
 5947|       |                     auto nested_anchor_name = yaml::parse_anchor_name(probe, end);
 5948|       |                     if (nested_anchor_name.empty()) {
 5949|       |                        ctx.error = error_code::syntax_error;
 5950|       |                        return;
 5951|       |                     }
 5952|       |                     yaml::skip_inline_ws(probe, end);
 5953|       |                     // Allow nested anchor usage only when it clearly starts a
 5954|       |                     // nested mapping entry ("&k key: value"). Otherwise this is
 5955|       |                     // a second anchor on the same node (4JVG-style), which is invalid.
 5956|       |                     if (!yaml::line_could_be_block_mapping(probe, end)) {
 5957|       |                        ctx.error = error_code::syntax_error;
 5958|       |                        return;
 5959|       |                     }
 5960|       |                  }
 5961|       |               }
 5962|       |
 5963|  1.58M|               const char* anchor_start = &*it;
 5964|  1.58M|               const int32_t anchor_indent = ctx.current_indent();
 5965|       |
 5966|       |               if constexpr (!yaml::check_flow_context(Opts)) {
 5967|       |                  // Check if the anchor is on a block-mapping key (&name key: value).
 5968|       |                  // Only when the anchor and key are on the SAME line — if the value was on the
 5969|       |                  // next line, the anchor applies to the entire next-line content.
 5970|       |                  if (anchor_on_same_line && yaml::line_could_be_block_mapping(it, end)) {
 5971|       |                     auto key_start = it;
 5972|       |                     if (*key_start == '!') {
 5973|       |                        const auto key_tag = yaml::parse_yaml_tag(key_start, end, ctx);
 5974|       |                        if (key_tag == yaml::yaml_tag::unknown || !yaml::tag_valid_for_string(key_tag)) {
 5975|       |                           ctx.error = error_code::syntax_error;
 5976|       |                           return;
 5977|       |                        }
 5978|       |                        yaml::skip_inline_ws(key_start, end);
 5979|       |                        if (key_start == end) {
 5980|       |                           ctx.error = error_code::unexpected_end;
 5981|       |                           return;
 5982|       |                        }
 5983|       |                        if (*key_start == '\n' || *key_start == '\r') {
 5984|       |                           ctx.error = error_code::syntax_error;
 5985|       |                           return;
 5986|       |                        }
 5987|       |
 5988|       |                        // Re-apply the anchor-on-alias rule now that the tag is consumed. The
 5989|       |                        // check above ran before the tag, so "&anchor !tag *alias" reached the
 5990|       |                        // key-span registration below while the untagged spelling was rejected;
 5991|       |                        // an alias node carries no other properties either way.
 5992|       |                        if (*key_start == '*' && !yaml::alias_token_is_mapping_key(key_start, end)) {
 5993|       |                           ctx.error = error_code::syntax_error;
 5994|       |                           return;
 5995|       |                        }
 5996|       |                     }
 5997|       |
 5998|       |                     // Find the key span by scanning to the key-value separator
 5999|       |                     auto key_scan = key_start;
 6000|       |                     auto key_end = key_start;
 6001|       |                     if (*key_scan == '"' || *key_scan == '\'') {
 6002|       |                        // Quoted key: skip to closing quote
 6003|       |                        const char quote = *key_scan;
 6004|       |                        ++key_scan;
 6005|       |                        while (key_scan != end && *key_scan != quote) {
 6006|       |                           if (*key_scan == '\\' && quote == '"') {
 6007|       |                              ++key_scan;
 6008|       |                              if (key_scan != end) ++key_scan;
 6009|       |                           }
 6010|       |                           else {
 6011|       |                              ++key_scan;
 6012|       |                           }
 6013|       |                        }
 6014|       |                        if (key_scan == end) {
 6015|       |                           ctx.error = error_code::syntax_error;
 6016|       |                           return;
 6017|       |                        }
 6018|       |                        ++key_scan; // past closing quote
 6019|       |                        key_end = key_scan;
 6020|       |                        yaml::skip_inline_ws(key_scan, end);
 6021|       |                     }
 6022|       |                     else {
 6023|       |                        // Plain key: scan to ':'
 6024|       |                        while (key_scan != end) {
 6025|       |                           if (*key_scan == ':') {
 6026|       |                              auto next = key_scan + 1;
 6027|       |                              if (next == end || *next == ' ' || *next == '\t' || *next == '\n' || *next == '\r') {
 6028|       |                                 break;
 6029|       |                              }
 6030|       |                           }
 6031|       |                           ++key_scan;
 6032|       |                        }
 6033|       |                        key_end = key_scan;
 6034|       |                        while (key_end != key_start && (*(key_end - 1) == ' ' || *(key_end - 1) == '\t')) {
 6035|       |                           --key_end;
 6036|       |                        }
 6037|       |                     }
 6038|       |                     if (key_scan == end || *key_scan != ':') {
 6039|       |                        ctx.error = error_code::syntax_error;
 6040|       |                        return;
 6041|       |                     }
 6042|       |                     // Store anchor with just the key text span
 6043|       |                     ctx.anchors[std::string(aname)] = {&*key_start, &*key_end, anchor_indent};
 6044|       |                     it = key_start;
 6045|       |                     // Parse as an object alternative so complex keys (e.g. flow collections) stay in mapping context.
 6046|       |                     if constexpr (counts::n_object > 0) {
 6047|       |                        process_yaml_variant_alternatives<V, is_yaml_variant_object>::template op<Opts>(value, ctx, it,
 6048|       |                                                                                                        end);
 6049|       |                     }
 6050|       |                     else {
 6051|       |                        from<YAML, V>::template op<Opts>(value, ctx, it, end);
 6052|       |                     }
 6053|       |                     return;
 6054|       |                  }
 6055|       |               }
 6056|       |
 6057|  1.58M|               const bool prev_allow_indentless_sequence = ctx.allow_indentless_sequence;
 6058|  1.58M|               ctx.allow_indentless_sequence = value_is_indentless_sequence;
 6059|  1.58M|               from<YAML, V>::template op<Opts>(value, ctx, it, end);
 6060|  1.58M|               ctx.allow_indentless_sequence = prev_allow_indentless_sequence;
 6061|  1.58M|               if (!bool(ctx.error)) {
  ------------------
  |  Branch (6061:20): [True: 1.56M, False: 19.0k]
  ------------------
 6062|  1.56M|                  ctx.anchors[std::string(aname)] = {anchor_start, &*it, anchor_indent};
 6063|  1.56M|               }
 6064|  1.58M|               return;
 6065|  1.58M|            }
 6066|  1.16M|            case '*': {
  ------------------
  |  Branch (6066:13): [True: 1.16M, False: 7.74M]
  ------------------
 6067|       |               // In block context, "*alias : value" starts a mapping with an alias key.
 6068|       |               if constexpr (!yaml::check_flow_context(Opts)) {
 6069|       |                  if (yaml::alias_token_is_mapping_key(it, end)) {
 6070|       |                     if constexpr (counts::n_object > 0) {
 6071|       |                        process_yaml_variant_alternatives<V, is_yaml_variant_object>::template op<Opts>(value, ctx, it,
 6072|       |                                                                                                        end);
 6073|       |                        return;
 6074|       |                     }
 6075|       |                     else {
 6076|       |                        ctx.error = error_code::syntax_error;
 6077|       |                        return;
 6078|       |                     }
 6079|       |                  }
 6080|       |               }
 6081|       |
 6082|       |               // Alias value: look up anchor and replay
 6083|  1.16M|               yaml::handle_alias<Opts>(value, ctx, it, end);
 6084|  1.16M|               return;
 6085|  1.58M|            }
 6086|   404k|            case '!': {
  ------------------
  |  Branch (6086:13): [True: 404k, False: 8.49M]
  ------------------
 6087|       |               // Tag - parse it and dispatch based on tag type
 6088|   404k|               const auto tag = yaml::parse_yaml_tag(it, end, ctx);
 6089|   404k|               if (tag == yaml::yaml_tag::unknown) {
  ------------------
  |  Branch (6089:20): [True: 79, False: 404k]
  ------------------
 6090|     79|                  ctx.error = error_code::syntax_error;
 6091|     79|                  return;
 6092|     79|               }
 6093|   404k|               yaml::skip_inline_ws(it, end);
 6094|   404k|               if (it != end && *it == '#') {
  ------------------
  |  Branch (6094:20): [True: 402k, False: 1.80k]
  |  Branch (6094:33): [True: 15.9k, False: 386k]
  ------------------
 6095|  15.9k|                  yaml::skip_comment(it, end);
 6096|  15.9k|               }
 6097|   404k|               if (it != end && (*it == '\n' || *it == '\r')) {
  ------------------
  |  Branch (6097:20): [True: 402k, False: 2.56k]
  |  Branch (6097:34): [True: 61.2k, False: 340k]
  |  Branch (6097:49): [True: 41.8k, False: 299k]
  ------------------
 6098|   103k|                  auto content = it;
 6099|   103k|                  yaml::skip_newline(content, end);
 6100|   103k|                  yaml::skip_to_content(content, end);
 6101|       |
 6102|   103k|                  bool consume_following_content = false;
 6103|   103k|                  auto content_token = content;
 6104|   103k|                  if (content != end) {
  ------------------
  |  Branch (6104:23): [True: 100k, False: 2.61k]
  ------------------
 6105|   100k|                     auto indent_probe = content;
 6106|   100k|                     const int32_t content_indent = yaml::measure_indent<false>(indent_probe, end, ctx);
 6107|   100k|                     if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (6107:26): [True: 5, False: 100k]
  ------------------
 6108|      5|                        return;
 6109|   100k|                     content_token = indent_probe;
 6110|       |
 6111|       |                     // A tag at the end of a sequence/map entry has an empty value
 6112|       |                     // unless the next non-empty content is nested under the current node.
 6113|   100k|                     bool tagged_indentless_sequence = false;
 6114|   100k|                     if (tag == yaml::yaml_tag::seq && indent_probe != end && *indent_probe == '-') {
  ------------------
  |  Branch (6114:26): [True: 15.9k, False: 84.4k]
  |  Branch (6114:56): [True: 15.9k, False: 0]
  |  Branch (6114:79): [True: 13.9k, False: 2.03k]
  ------------------
 6115|  13.9k|                        const auto after_dash = indent_probe + 1;
 6116|  13.9k|                        if (after_dash == end ||
  ------------------
  |  Branch (6116:29): [True: 657, False: 13.2k]
  ------------------
 6117|  13.2k|                            yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*after_dash)]) {
  ------------------
  |  Branch (6117:29): [True: 6.11k, False: 7.12k]
  ------------------
 6118|  6.77k|                           tagged_indentless_sequence =
 6119|  6.77k|                              (content_indent == ctx.current_indent()) ||
  ------------------
  |  Branch (6119:31): [True: 767, False: 6.00k]
  ------------------
 6120|  6.00k|                              (ctx.current_indent() > 0 && (content_indent + 1) == ctx.current_indent());
  ------------------
  |  Branch (6120:32): [True: 869, False: 5.13k]
  |  Branch (6120:60): [True: 629, False: 240]
  ------------------
 6121|  6.77k|                        }
 6122|  13.9k|                     }
 6123|       |
 6124|   100k|                     consume_following_content = (ctx.current_indent() < 0) ||
  ------------------
  |  Branch (6124:50): [True: 57.2k, False: 43.1k]
  ------------------
 6125|  43.1k|                                                 (content_indent > ctx.current_indent()) || tagged_indentless_sequence;
  ------------------
  |  Branch (6125:50): [True: 9.69k, False: 33.4k]
  |  Branch (6125:93): [True: 1.39k, False: 32.0k]
  ------------------
 6126|   100k|                  }
 6127|       |
 6128|   103k|                  if (consume_following_content) {
  ------------------
  |  Branch (6128:23): [True: 68.3k, False: 34.6k]
  ------------------
 6129|  68.3k|                     it = content_token;
 6130|  68.3k|                  }
 6131|  34.6k|                  else {
 6132|  34.6k|                     if (tag == yaml::yaml_tag::str) {
  ------------------
  |  Branch (6132:26): [True: 1.84k, False: 32.7k]
  ------------------
 6133|  1.84k|                        if constexpr (counts::n_str > 0) {
 6134|  1.84k|                           constexpr auto first_idx = yaml_variant_first_index_v<V, is_yaml_variant_str>;
 6135|  1.84k|                           using StrType = std::variant_alternative_t<first_idx, V>;
 6136|  1.84k|                           value = StrType{};
 6137|  1.84k|                           return;
 6138|  1.84k|                        }
 6139|  1.84k|                     }
 6140|  34.6k|                     if (tag == yaml::yaml_tag::null_tag) {
  ------------------
  |  Branch (6140:26): [True: 679, False: 33.9k]
  ------------------
 6141|    679|                        if constexpr (counts::n_null > 0) {
 6142|    679|                           constexpr auto first_idx = yaml_variant_first_index_v<V, is_yaml_variant_null>;
 6143|    679|                           using NullType = std::variant_alternative_t<first_idx, V>;
 6144|    679|                           if (!std::holds_alternative<NullType>(value)) value = NullType{};
  ------------------
  |  Branch (6144:32): [True: 0, False: 679]
  ------------------
 6145|    679|                           return;
 6146|    679|                        }
 6147|    679|                     }
 6148|  34.6k|                     if (tag == yaml::yaml_tag::none) {
  ------------------
  |  Branch (6148:26): [True: 28.6k, False: 5.99k]
  ------------------
 6149|  28.6k|                        if constexpr (counts::n_null > 0) {
 6150|  28.6k|                           constexpr auto first_idx = yaml_variant_first_index_v<V, is_yaml_variant_null>;
 6151|  28.6k|                           using NullType = std::variant_alternative_t<first_idx, V>;
 6152|  28.6k|                           if (!std::holds_alternative<NullType>(value)) value = NullType{};
  ------------------
  |  Branch (6152:32): [True: 0, False: 28.6k]
  ------------------
 6153|  28.6k|                           return;
 6154|  28.6k|                        }
 6155|  28.6k|                     }
 6156|  34.6k|                  }
 6157|   103k|               }
 6158|       |               if constexpr (!yaml::check_flow_context(Opts)) {
 6159|       |                  // In block context, a comma immediately after a tag token is malformed
 6160|       |                  // (e.g., "!!str, value"). Flow context has legitimate ", ] }" usage.
 6161|       |                  if (it != end && *it == ',') {
 6162|       |                     ctx.error = error_code::syntax_error;
 6163|       |                     return;
 6164|       |                  }
 6165|       |                  if constexpr (counts::n_object > 0) {
 6166|       |                     // Tagged keys like "!!str key: value" must parse as mappings.
 6167|       |                     const bool starts_block_sequence_entry =
 6168|       |                        (it != end && *it == '-') &&
 6169|       |                        ((it + 1) == end || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*(it + 1))]);
 6170|       |                     if (!starts_block_sequence_entry && yaml::line_could_be_block_mapping(it, end)) {
 6171|       |                        // Re-dispatch from the post-tag token so '&key key: val' is
 6172|       |                        // handled by the anchor-aware key path, not as a map-level anchor.
 6173|       |                        from<YAML, V>::template op<Opts>(value, ctx, it, end);
 6174|       |                        return;
 6175|       |                     }
 6176|       |                  }
 6177|       |               }
 6178|   404k|               if (it == end) {
  ------------------
  |  Branch (6178:20): [True: 2.56k, False: 402k]
  ------------------
 6179|  2.56k|                  if (tag == yaml::yaml_tag::str) {
  ------------------
  |  Branch (6179:23): [True: 554, False: 2.01k]
  ------------------
 6180|    554|                     if constexpr (counts::n_str > 0) {
 6181|    554|                        constexpr auto first_idx = yaml_variant_first_index_v<V, is_yaml_variant_str>;
 6182|    554|                        using StrType = std::variant_alternative_t<first_idx, V>;
 6183|    554|                        value = StrType{};
 6184|    554|                        return;
 6185|    554|                     }
 6186|    554|                  }
 6187|  2.56k|                  if (tag == yaml::yaml_tag::none) {
  ------------------
  |  Branch (6187:23): [True: 2.00k, False: 565]
  ------------------
 6188|  2.00k|                     if constexpr (counts::n_null > 0) {
 6189|  2.00k|                        constexpr auto first_idx = yaml_variant_first_index_v<V, is_yaml_variant_null>;
 6190|  2.00k|                        using NullType = std::variant_alternative_t<first_idx, V>;
 6191|  2.00k|                        if (!std::holds_alternative<NullType>(value)) value = NullType{};
  ------------------
  |  Branch (6191:29): [True: 0, False: 2.00k]
  ------------------
 6192|  2.00k|                        return;
 6193|  2.00k|                     }
 6194|  2.00k|                  }
 6195|      0|                  ctx.error = error_code::unexpected_end;
 6196|  2.56k|                  return;
 6197|  2.56k|               }
 6198|   402k|               switch (tag) {
 6199|  2.25k|               case yaml::yaml_tag::str:
  ------------------
  |  Branch (6199:16): [True: 2.25k, False: 399k]
  ------------------
 6200|  2.25k|                  process_yaml_variant_alternatives<V, is_yaml_variant_str>::template op<Opts>(value, ctx, it, end);
 6201|  2.25k|                  return;
 6202|  19.3k|               case yaml::yaml_tag::int_tag:
  ------------------
  |  Branch (6202:16): [True: 19.3k, False: 382k]
  ------------------
 6203|  19.6k|               case yaml::yaml_tag::float_tag:
  ------------------
  |  Branch (6203:16): [True: 314, False: 401k]
  ------------------
 6204|  19.6k|                  if constexpr (counts::n_num > 0) {
 6205|  19.6k|                     process_yaml_variant_alternatives<V, is_yaml_variant_num>::template op<Opts>(value, ctx, it, end);
 6206|  19.6k|                     return;
 6207|       |                  }
 6208|       |                  else { // else used to fix MSVC unreachable code warning
 6209|       |                     ctx.error = error_code::syntax_error;
 6210|       |                     return;
 6211|       |                  }
 6212|  53.2k|               case yaml::yaml_tag::bool_tag:
  ------------------
  |  Branch (6212:16): [True: 33.6k, False: 368k]
  ------------------
 6213|  53.2k|                  if constexpr (counts::n_bool > 0) {
 6214|  53.2k|                     process_yaml_variant_alternatives<V, is_yaml_variant_bool>::template op<Opts>(value, ctx, it, end);
 6215|  53.2k|                     return;
 6216|       |                  }
 6217|       |                  else { // else used to fix MSVC unreachable code warning
 6218|       |                     ctx.error = error_code::syntax_error;
 6219|       |                     return;
 6220|       |                  }
 6221|  54.3k|               case yaml::yaml_tag::null_tag:
  ------------------
  |  Branch (6221:16): [True: 1.09k, False: 400k]
  ------------------
 6222|  54.3k|                  if constexpr (counts::n_null > 0) {
 6223|  54.3k|                     constexpr auto first_idx = yaml_variant_first_index_v<V, is_yaml_variant_null>;
 6224|  54.3k|                     using NullType = std::variant_alternative_t<first_idx, V>;
 6225|  54.3k|                     if (!std::holds_alternative<NullType>(value)) value = NullType{};
  ------------------
  |  Branch (6225:26): [True: 0, False: 54.3k]
  ------------------
 6226|  54.3k|                     from<YAML, NullType>::template op<Opts>(std::get<NullType>(value), ctx, it, end);
 6227|  54.3k|                     return;
 6228|       |                  }
 6229|       |                  else { // else used to fix MSVC unreachable code warning
 6230|       |                     ctx.error = error_code::syntax_error;
 6231|       |                     return;
 6232|       |                  }
 6233|   110k|               case yaml::yaml_tag::map:
  ------------------
  |  Branch (6233:16): [True: 56.5k, False: 345k]
  ------------------
 6234|   110k|                  if constexpr (counts::n_object > 0) {
 6235|   110k|                     process_yaml_variant_alternatives<V, is_yaml_variant_object>::template op<Opts>(value, ctx, it,
 6236|   110k|                                                                                                     end);
 6237|   110k|                     return;
 6238|       |                  }
 6239|       |                  else { // else used to fix MSVC unreachable code warning
 6240|       |                     ctx.error = error_code::syntax_error;
 6241|       |                     return;
 6242|       |                  }
 6243|   165k|               case yaml::yaml_tag::seq:
  ------------------
  |  Branch (6243:16): [True: 55.0k, False: 347k]
  ------------------
 6244|   165k|                  if constexpr (counts::n_array > 0) {
 6245|   165k|                     const bool prev_allow_indentless_sequence = ctx.allow_indentless_sequence;
 6246|       |                     if constexpr (!yaml::check_flow_context(Opts)) {
 6247|       |                        if (it != end && *it == '-') {
 6248|       |                           ctx.allow_indentless_sequence = true;
 6249|       |                        }
 6250|       |                     }
 6251|   165k|                     process_yaml_variant_alternatives<V, is_yaml_variant_array>::template op<Opts>(value, ctx, it,
 6252|   165k|                                                                                                    end);
 6253|   165k|                     ctx.allow_indentless_sequence = prev_allow_indentless_sequence;
 6254|   165k|                     return;
 6255|       |                  }
 6256|       |                  else { // else used to fix MSVC unreachable code warning
 6257|       |                     ctx.error = error_code::syntax_error;
 6258|       |                     return;
 6259|       |                  }
 6260|   368k|               default: {
  ------------------
  |  Branch (6260:16): [True: 202k, False: 199k]
  ------------------
 6261|       |                  // Explicit unknown/non-core tags disable implicit scalar resolution.
 6262|       |                  // Preserve collection kinds, otherwise treat as string content.
 6263|   368k|                  if (it != end && *it == '*') {
  ------------------
  |  Branch (6263:23): [True: 202k, False: 165k]
  |  Branch (6263:36): [True: 65.6k, False: 137k]
  ------------------
 6264|  65.6k|                     yaml::handle_alias<Opts>(value, ctx, it, end);
 6265|  65.6k|                     return;
 6266|  65.6k|                  }
 6267|       |
 6268|   302k|                  if constexpr (counts::n_array > 0) {
 6269|   302k|                     if (it != end && *it == '[') {
  ------------------
  |  Branch (6269:26): [True: 137k, False: 165k]
  |  Branch (6269:39): [True: 5.83k, False: 131k]
  ------------------
 6270|  5.83k|                        process_yaml_variant_alternatives<V, is_yaml_variant_array>::template op<Opts>(value, ctx, it,
 6271|  5.83k|                                                                                                       end);
 6272|  5.83k|                        return;
 6273|  5.83k|                     }
 6274|   302k|                  }
 6275|   302k|                  if constexpr (counts::n_object > 0) {
 6276|   302k|                     if (it != end && *it == '{') {
  ------------------
  |  Branch (6276:26): [True: 131k, False: 171k]
  |  Branch (6276:39): [True: 22.5k, False: 108k]
  ------------------
 6277|  22.5k|                        process_yaml_variant_alternatives<V, is_yaml_variant_object>::template op<Opts>(value, ctx, it,
 6278|  22.5k|                                                                                                        end);
 6279|  22.5k|                        return;
 6280|  22.5k|                     }
 6281|   302k|                  }
 6282|       |
 6283|       |                  if constexpr (!yaml::check_flow_context(Opts)) {
 6284|       |                     if constexpr (counts::n_array > 0) {
 6285|       |                        const bool starts_block_sequence_entry =
 6286|       |                           (it != end && *it == '-') &&
 6287|       |                           ((it + 1) == end || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*(it + 1))]);
 6288|       |                        if (starts_block_sequence_entry) {
 6289|       |                           process_yaml_variant_alternatives<V, is_yaml_variant_array>::template op<Opts>(value, ctx,
 6290|       |                                                                                                          it, end);
 6291|       |                           return;
 6292|       |                        }
 6293|       |                     }
 6294|       |                     if constexpr (counts::n_object > 0) {
 6295|       |                        const bool starts_explicit_mapping_indicator =
 6296|       |                           (it != end && (*it == '?' || *it == ':')) &&
 6297|       |                           ((it + 1) == end || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*(it + 1))]);
 6298|       |                        if (starts_explicit_mapping_indicator) {
 6299|       |                           process_yaml_variant_alternatives<V, is_yaml_variant_object>::template op<Opts>(value, ctx,
 6300|       |                                                                                                           it, end);
 6301|       |                           return;
 6302|       |                        }
 6303|       |                        if (yaml::line_could_be_block_mapping(it, end)) {
 6304|       |                           process_yaml_variant_alternatives<V, is_yaml_variant_object>::template op<Opts>(value, ctx,
 6305|       |                                                                                                           it, end);
 6306|       |                           return;
 6307|       |                        }
 6308|       |                     }
 6309|       |                  }
 6310|       |
 6311|   302k|                  if constexpr (counts::n_str > 0) {
 6312|   302k|                     process_yaml_variant_alternatives<V, is_yaml_variant_str>::template op<Opts>(value, ctx, it, end);
 6313|   302k|                     return;
 6314|   302k|                  }
 6315|       |
 6316|       |                  // Fall back if no string alternative exists.
 6317|      0|                  from<YAML, V>::template op<Opts>(value, ctx, it, end);
 6318|   302k|                  return;
 6319|   368k|               }
 6320|   402k|               }
 6321|      0|               return;
 6322|   402k|            }
 6323|  1.59M|            case '{':
  ------------------
  |  Branch (6323:13): [True: 1.59M, False: 7.31M]
  ------------------
 6324|       |               if constexpr (!yaml::check_flow_context(Opts)) {
 6325|       |                  // In block context, "{...}: value" can be a complex mapping key.
 6326|       |                  if (ctx.current_indent() < 0 && yaml::line_could_be_block_mapping(it, end)) {
 6327|       |                     process_yaml_variant_alternatives<V, is_yaml_variant_object>::template op<Opts>(value, ctx, it,
 6328|       |                                                                                                     end);
 6329|       |                     return;
 6330|       |                  }
 6331|       |               }
 6332|       |               // Flow mapping - object type
 6333|  1.59M|               process_yaml_variant_alternatives<V, is_yaml_variant_object>::template op<Opts>(value, ctx, it, end);
 6334|  1.59M|               return;
 6335|   106k|            case '[':
  ------------------
  |  Branch (6335:13): [True: 106k, False: 8.79M]
  ------------------
 6336|       |               if constexpr (!yaml::check_flow_context(Opts)) {
 6337|       |                  // In block context, "[...]: value" can be a complex mapping key.
 6338|       |                  if (ctx.current_indent() < 0 && yaml::line_could_be_block_mapping(it, end)) {
 6339|       |                     process_yaml_variant_alternatives<V, is_yaml_variant_object>::template op<Opts>(value, ctx, it,
 6340|       |                                                                                                     end);
 6341|       |                     return;
 6342|       |                  }
 6343|       |               }
 6344|       |               // Flow sequence - array type
 6345|   106k|               process_yaml_variant_alternatives<V, is_yaml_variant_array>::template op<Opts>(value, ctx, it, end);
 6346|   106k|               return;
 6347|   355k|            case '?':
  ------------------
  |  Branch (6347:13): [True: 355k, False: 8.54M]
  ------------------
 6348|       |               // Explicit mapping key indicator ("? key")
 6349|   355k|               if ((end - it >= 2) && it[1] == '\t') {
  ------------------
  |  Branch (6349:20): [True: 351k, False: 3.97k]
  |  Branch (6349:39): [True: 5, False: 351k]
  ------------------
 6350|      5|                  ctx.error = error_code::syntax_error;
 6351|      5|                  return;
 6352|      5|               }
 6353|   355k|               if ((end - it >= 2) && (it[1] == ' ' || it[1] == '\n' || it[1] == '\r')) {
  ------------------
  |  Branch (6353:20): [True: 351k, False: 3.97k]
  |  Branch (6353:40): [True: 114k, False: 236k]
  |  Branch (6353:56): [True: 151k, False: 85.2k]
  |  Branch (6353:73): [True: 33.2k, False: 51.9k]
  ------------------
 6354|   299k|                  if constexpr (counts::n_object > 0) {
 6355|   299k|                     process_yaml_variant_alternatives<V, is_yaml_variant_object>::template op<Opts>(value, ctx, it,
 6356|   299k|                                                                                                     end);
 6357|   299k|                     return;
 6358|   299k|                  }
 6359|   299k|               }
 6360|      0|               parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6361|   355k|               return;
 6362|    224|            case '%':
  ------------------
  |  Branch (6362:13): [True: 224, False: 8.90M]
  ------------------
 6363|       |               // Reserved directive indicator is not a plain scalar start.
 6364|    224|               ctx.error = error_code::syntax_error;
 6365|    224|               return;
 6366|  11.9k|            case '"':
  ------------------
  |  Branch (6366:13): [True: 11.9k, False: 8.89M]
  ------------------
 6367|  24.1k|            case '\'':
  ------------------
  |  Branch (6367:13): [True: 12.2k, False: 8.89M]
  ------------------
 6368|       |               // Could be a quoted string OR a quoted key in a block mapping
 6369|       |               // Try block mapping first (e.g., "key": value), then fall back to string
 6370|  24.1k|               parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6371|  24.1k|               return;
 6372|  67.8k|            case 't':
  ------------------
  |  Branch (6372:13): [True: 67.8k, False: 8.83M]
  ------------------
 6373|  79.4k|            case 'T':
  ------------------
  |  Branch (6373:13): [True: 11.5k, False: 8.89M]
  ------------------
 6374|       |               // Could be "true", "True", "TRUE", or a key/string starting with t/T
 6375|  79.4k|               if constexpr (counts::n_bool > 0) {
 6376|  79.4k|                  if ((end - it >= 4) && ((it[1] == 'r' && it[2] == 'u' && it[3] == 'e') ||
  ------------------
  |  Branch (6376:23): [True: 78.3k, False: 1.04k]
  |  Branch (6376:44): [True: 54.7k, False: 23.5k]
  |  Branch (6376:60): [True: 42.1k, False: 12.6k]
  |  Branch (6376:76): [True: 36.4k, False: 5.67k]
  ------------------
 6377|  41.8k|                                          (it[1] == 'R' && it[2] == 'U' && it[3] == 'E'))) {
  ------------------
  |  Branch (6377:44): [True: 12.1k, False: 29.7k]
  |  Branch (6377:60): [True: 4.43k, False: 7.68k]
  |  Branch (6377:76): [True: 2.09k, False: 2.34k]
  ------------------
 6378|       |                     // Check what follows the word "true"
 6379|  38.5k|                     const auto after_true = it + 4;
 6380|  38.5k|                     const bool at_word_boundary = is_word_boundary(after_true);
 6381|       |
 6382|  38.5k|                     if (at_word_boundary) {
  ------------------
  |  Branch (6382:26): [True: 23.9k, False: 14.6k]
  ------------------
 6383|  23.9k|                        if (has_indented_block_continuation(after_true)) {
  ------------------
  |  Branch (6383:29): [True: 0, False: 23.9k]
  ------------------
 6384|      0|                           parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6385|      0|                           return;
 6386|      0|                        }
 6387|       |                        // Check if this is a key (followed by ": ") rather than a boolean value
 6388|       |                        // "true: value" should parse as {true: value}, not as the boolean true
 6389|  23.9k|                        if ((end - it > 4) && it[4] == ':' &&
  ------------------
  |  Branch (6389:29): [True: 19.6k, False: 4.30k]
  |  Branch (6389:47): [True: 14.8k, False: 4.77k]
  ------------------
 6390|  14.8k|                            (end - it == 5 || it[5] == ' ' || it[5] == '\t' || it[5] == '\n' || it[5] == '\r')) {
  ------------------
  |  Branch (6390:30): [True: 4.83k, False: 10.0k]
  |  Branch (6390:47): [True: 6.76k, False: 3.29k]
  |  Branch (6390:63): [True: 1.35k, False: 1.94k]
  |  Branch (6390:80): [True: 746, False: 1.19k]
  |  Branch (6390:97): [True: 1.19k, False: 0]
  ------------------
 6391|       |                           // This is "true:" followed by space/tab/newline/end - treat as key
 6392|  14.8k|                           parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6393|  14.8k|                           return;
 6394|  14.8k|                        }
 6395|  9.07k|                        process_yaml_variant_alternatives<V, is_yaml_variant_bool>::template op<Opts>(value, ctx, it,
 6396|  9.07k|                                                                                                      end);
 6397|  9.07k|                        return;
 6398|  23.9k|                     }
 6399|       |                     // "true" is followed by more characters (e.g., "True\b") - treat as string
 6400|  38.5k|                  }
 6401|  79.4k|               }
 6402|  55.4k|               parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6403|  79.4k|               return;
 6404|   122k|            case 'f':
  ------------------
  |  Branch (6404:13): [True: 122k, False: 8.78M]
  ------------------
 6405|   151k|            case 'F':
  ------------------
  |  Branch (6405:13): [True: 29.3k, False: 8.87M]
  ------------------
 6406|       |               // Could be "false", "False", "FALSE", or a key/string starting with f/F
 6407|   151k|               if constexpr (counts::n_bool > 0) {
 6408|   151k|                  if ((end - it >= 5) && ((it[1] == 'a' && it[2] == 'l' && it[3] == 's' && it[4] == 'e') ||
  ------------------
  |  Branch (6408:23): [True: 149k, False: 2.34k]
  |  Branch (6408:44): [True: 98.5k, False: 50.9k]
  |  Branch (6408:60): [True: 81.9k, False: 16.6k]
  |  Branch (6408:76): [True: 79.2k, False: 2.63k]
  |  Branch (6408:92): [True: 36.5k, False: 42.7k]
  ------------------
 6409|   112k|                                          (it[1] == 'A' && it[2] == 'L' && it[3] == 'S' && it[4] == 'E'))) {
  ------------------
  |  Branch (6409:44): [True: 14.3k, False: 98.5k]
  |  Branch (6409:60): [True: 10.6k, False: 3.75k]
  |  Branch (6409:76): [True: 9.37k, False: 1.26k]
  |  Branch (6409:92): [True: 6.35k, False: 3.02k]
  ------------------
 6410|       |                     // Check what follows the word "false"
 6411|  42.8k|                     const auto after_false = it + 5;
 6412|  42.8k|                     const bool at_word_boundary = is_word_boundary(after_false);
 6413|       |
 6414|  42.8k|                     if (at_word_boundary) {
  ------------------
  |  Branch (6414:26): [True: 39.4k, False: 3.45k]
  ------------------
 6415|  39.4k|                        if (has_indented_block_continuation(after_false)) {
  ------------------
  |  Branch (6415:29): [True: 0, False: 39.4k]
  ------------------
 6416|      0|                           parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6417|      0|                           return;
 6418|      0|                        }
 6419|       |                        // Check if this is a key (followed by ": ") rather than a boolean value
 6420|       |                        // "false: value" should parse as {false: value}, not as the boolean false
 6421|  39.4k|                        if ((end - it > 5) && it[5] == ':' &&
  ------------------
  |  Branch (6421:29): [True: 34.4k, False: 5.00k]
  |  Branch (6421:47): [True: 24.4k, False: 10.0k]
  ------------------
 6422|  24.4k|                            (end - it == 6 || it[6] == ' ' || it[6] == '\t' || it[6] == '\n' || it[6] == '\r')) {
  ------------------
  |  Branch (6422:30): [True: 823, False: 23.5k]
  |  Branch (6422:47): [True: 1.18k, False: 22.4k]
  |  Branch (6422:63): [True: 577, False: 21.8k]
  |  Branch (6422:80): [True: 3.27k, False: 18.5k]
  |  Branch (6422:97): [True: 18.5k, False: 0]
  ------------------
 6423|       |                           // This is "false:" followed by space/tab/newline/end - treat as key
 6424|  24.4k|                           parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6425|  24.4k|                           return;
 6426|  24.4k|                        }
 6427|  15.0k|                        process_yaml_variant_alternatives<V, is_yaml_variant_bool>::template op<Opts>(value, ctx, it,
 6428|  15.0k|                                                                                                      end);
 6429|  15.0k|                        return;
 6430|  39.4k|                     }
 6431|       |                     // "false" is followed by more characters (e.g., "False\b") - treat as string
 6432|  42.8k|                  }
 6433|   151k|               }
 6434|   112k|               parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6435|   151k|               return;
 6436|  94.2k|            case 'n':
  ------------------
  |  Branch (6436:13): [True: 94.2k, False: 8.80M]
  ------------------
 6437|   116k|            case 'N':
  ------------------
  |  Branch (6437:13): [True: 22.4k, False: 8.88M]
  ------------------
 6438|       |               // Could be "null", "Null", "NULL", or a key/string starting with n/N
 6439|   116k|               if constexpr (counts::n_null > 0) {
 6440|   116k|                  if ((end - it >= 4) && ((it[1] == 'u' && it[2] == 'l' && it[3] == 'l') ||
  ------------------
  |  Branch (6440:23): [True: 114k, False: 2.50k]
  |  Branch (6440:44): [True: 78.1k, False: 36.0k]
  |  Branch (6440:60): [True: 63.3k, False: 14.7k]
  |  Branch (6440:76): [True: 55.2k, False: 8.05k]
  ------------------
 6441|  58.9k|                                          (it[1] == 'U' && it[2] == 'L' && it[3] == 'L'))) {
  ------------------
  |  Branch (6441:44): [True: 2.65k, False: 56.2k]
  |  Branch (6441:60): [True: 1.92k, False: 728]
  |  Branch (6441:76): [True: 1.28k, False: 643]
  ------------------
 6442|       |                     // Check what follows the word "null"
 6443|  56.5k|                     const auto after_null = it + 4;
 6444|  56.5k|                     const bool at_word_boundary = is_word_boundary(after_null);
 6445|       |
 6446|  56.5k|                     if (at_word_boundary) {
  ------------------
  |  Branch (6446:26): [True: 46.3k, False: 10.1k]
  ------------------
 6447|  46.3k|                        if (has_indented_block_continuation(after_null)) {
  ------------------
  |  Branch (6447:29): [True: 0, False: 46.3k]
  ------------------
 6448|      0|                           parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6449|      0|                           return;
 6450|      0|                        }
 6451|       |                        // Check if this is a key (followed by ": ") rather than a null value
 6452|       |                        // "null: value" should parse as {null: value}, not as the null type
 6453|  46.3k|                        if ((end - it > 4) && it[4] == ':' &&
  ------------------
  |  Branch (6453:29): [True: 45.6k, False: 687]
  |  Branch (6453:47): [True: 24.9k, False: 20.7k]
  ------------------
 6454|  24.9k|                            (end - it == 5 || it[5] == ' ' || it[5] == '\t' || it[5] == '\n' || it[5] == '\r')) {
  ------------------
  |  Branch (6454:30): [True: 797, False: 24.1k]
  |  Branch (6454:47): [True: 1.28k, False: 22.8k]
  |  Branch (6454:63): [True: 21.2k, False: 1.61k]
  |  Branch (6454:80): [True: 747, False: 863]
  |  Branch (6454:97): [True: 863, False: 0]
  ------------------
 6455|       |                           // This is "null:" followed by space/tab/newline/end - treat as key
 6456|  24.9k|                           parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6457|  24.9k|                           return;
 6458|  24.9k|                        }
 6459|  21.3k|                        constexpr auto first_idx = yaml_variant_first_index_v<V, is_yaml_variant_null>;
 6460|  21.3k|                        using NullType = std::variant_alternative_t<first_idx, V>;
 6461|  21.3k|                        if (!std::holds_alternative<NullType>(value)) value = NullType{};
  ------------------
  |  Branch (6461:29): [True: 0, False: 21.3k]
  ------------------
 6462|  21.3k|                        from<YAML, NullType>::template op<Opts>(std::get<NullType>(value), ctx, it, end);
 6463|  21.3k|                        return;
 6464|  46.3k|                     }
 6465|       |                     // "null" is followed by more characters (e.g., "Null\b") - treat as string
 6466|  56.5k|                  }
 6467|   116k|               }
 6468|  70.3k|               parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6469|   116k|               return;
 6470|  2.73k|            case '~':
  ------------------
  |  Branch (6470:13): [True: 2.73k, False: 8.90M]
  ------------------
 6471|       |               // Null indicator
 6472|  2.73k|               if constexpr (counts::n_null > 0) {
 6473|  2.73k|                  constexpr auto first_idx = yaml_variant_first_index_v<V, is_yaml_variant_null>;
 6474|  2.73k|                  using NullType = std::variant_alternative_t<first_idx, V>;
 6475|  2.73k|                  if (!std::holds_alternative<NullType>(value)) value = NullType{};
  ------------------
  |  Branch (6475:23): [True: 0, False: 2.73k]
  ------------------
 6476|  2.73k|                  from<YAML, NullType>::template op<Opts>(std::get<NullType>(value), ctx, it, end);
 6477|  2.73k|                  return;
 6478|  2.73k|               }
 6479|      0|               break; // Fall through to try other types
 6480|   867k|            case '-':
  ------------------
  |  Branch (6480:13): [True: 867k, False: 8.03M]
  ------------------
 6481|       |               // Could be negative number or block sequence indicator
 6482|   867k|               if (((it + 1) == end) || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(it[1])]) {
  ------------------
  |  Branch (6482:20): [True: 9.68k, False: 858k]
  |  Branch (6482:41): [True: 643k, False: 214k]
  ------------------
 6483|       |                  // Block sequence indicator "- "
 6484|   653k|                  if constexpr (counts::n_array > 0) {
 6485|   653k|                     process_yaml_variant_alternatives<V, is_yaml_variant_array>::template op<Opts>(value, ctx, it,
 6486|   653k|                                                                                                    end);
 6487|   653k|                     return;
 6488|   653k|                  }
 6489|   653k|               }
 6490|   867k|               if constexpr (counts::n_num > 0) {
 6491|   867k|                  if ((end - it >= 2) && (std::isdigit(static_cast<unsigned char>(it[1])) || it[1] == '.')) {
  ------------------
  |  Branch (6491:23): [True: 214k, False: 653k]
  |  Branch (6491:43): [True: 3.90k, False: 210k]
  |  Branch (6491:94): [True: 97.1k, False: 113k]
  ------------------
 6492|   101k|                     process_yaml_variant_alternatives<V, is_yaml_variant_num>::template op<Opts>(value, ctx, it, end);
 6493|   101k|                     return;
 6494|   101k|                  }
 6495|   867k|               }
 6496|   766k|               parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6497|   867k|               return;
 6498|  51.6k|            case '+':
  ------------------
  |  Branch (6498:13): [True: 51.6k, False: 8.85M]
  ------------------
 6499|  90.2k|            case '.':
  ------------------
  |  Branch (6499:13): [True: 38.6k, False: 8.86M]
  ------------------
 6500|       |               // Could be a number (.5, +5, .inf, etc.) or a string (.c, .cpp, +name, etc.)
 6501|       |               // Try parsing as number speculatively, fall back to string on failure
 6502|  90.2k|               if constexpr (counts::n_num > 0) {
 6503|  90.2k|                  auto start_it = it;
 6504|  90.2k|                  auto temp_ctx = ctx.make_speculative();
 6505|  90.2k|                  process_yaml_variant_alternatives<V, is_yaml_variant_num>::template op<Opts>(value, temp_ctx, it,
 6506|  90.2k|                                                                                               end);
 6507|  90.2k|                  ctx.alias_expansion_budget = temp_ctx.alias_expansion_budget; // charged even if rejected
 6508|  90.2k|                  ctx.key_expansion_budget = temp_ctx.key_expansion_budget;
 6509|  90.2k|                  if (!bool(temp_ctx.error)) {
  ------------------
  |  Branch (6509:23): [True: 10.5k, False: 79.6k]
  ------------------
 6510|  10.5k|                     ctx.anchors = std::move(temp_ctx.anchors);
 6511|  10.5k|                     return; // Successfully parsed as number
 6512|  10.5k|                  }
 6513|  79.6k|                  it = start_it; // Restore and fall through to string
 6514|  79.6k|               }
 6515|      0|               parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6516|  90.2k|               return;
 6517|  2.32M|            default:
  ------------------
  |  Branch (6517:13): [True: 2.32M, False: 6.57M]
  ------------------
 6518|       |               // Check for digit (0-9) - numeric or block mapping key starting with digit
 6519|  2.32M|               if (c >= '0' && c <= '9') {
  ------------------
  |  Branch (6519:20): [True: 1.68M, False: 645k]
  |  Branch (6519:32): [True: 1.30M, False: 373k]
  ------------------
 6520|       |                  // Try block mapping first (e.g., "123key: value")
 6521|  1.30M|                  if (try_parse_block_mapping_into_variant<V, Opts>(value, ctx, it, end)) {
  ------------------
  |  Branch (6521:23): [True: 11.8k, False: 1.29M]
  ------------------
 6522|  11.8k|                     return;
 6523|  11.8k|                  }
 6524|       |                  // Try numeric value speculatively - values like "12:30" look numeric but aren't
 6525|  1.29M|                  if constexpr (counts::n_num > 0) {
 6526|  1.29M|                     auto start_it = it;
 6527|  1.29M|                     auto temp_ctx = ctx.make_speculative();
 6528|  1.29M|                     process_yaml_variant_alternatives<V, is_yaml_variant_num>::template op<Opts>(value, temp_ctx, it,
 6529|  1.29M|                                                                                                  end);
 6530|  1.29M|                     ctx.alias_expansion_budget = temp_ctx.alias_expansion_budget; // charged even if rejected
 6531|  1.29M|                     ctx.key_expansion_budget = temp_ctx.key_expansion_budget;
 6532|  1.29M|                     if (!bool(temp_ctx.error)) {
  ------------------
  |  Branch (6532:26): [True: 1.16M, False: 136k]
  ------------------
 6533|  1.16M|                        ctx.anchors = std::move(temp_ctx.anchors);
 6534|  1.16M|                        return; // Successfully parsed as number
 6535|  1.16M|                     }
 6536|   136k|                     it = start_it; // Restore and fall through to string
 6537|   136k|                  }
 6538|       |                  // Fall through to string
 6539|      0|                  process_yaml_variant_alternatives<V, is_yaml_variant_str>::template op<Opts>(value, ctx, it, end);
 6540|  1.29M|                  return;
 6541|  1.30M|               }
 6542|       |               // Plain scalar - try block mapping, then string
 6543|  1.01M|               parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6544|  1.01M|               return;
 6545|  8.90M|            }
 6546|  8.90M|         }
 6547|       |
 6548|       |         // For non-auto-deducible variants or fallback, try each type until one succeeds
 6549|      0|         constexpr auto N = std::variant_size_v<std::remove_cvref_t<T>>;
 6550|       |
 6551|       |         // This fold discards each alternative's error and reports only that nothing fit, which
 6552|       |         // misdiagnoses a document that exhausted an expansion budget as merely the wrong shape.
 6553|       |         // Kept aside and used only if no alternative parsed, so a later one that does parse
 6554|       |         // (possible under a latched budget if it materializes no key text) is unaffected.
 6555|  8.90M|         error_code expansion_error{};
 6556|  8.90M|         std::string_view expansion_message{};
 6557|       |
 6558|  8.90M|         auto try_parse = [&]<size_t I>() -> bool {
 6559|  8.90M|            using V = std::variant_alternative_t<I, std::remove_cvref_t<T>>;
 6560|  8.90M|            auto start = it;
 6561|       |
 6562|  8.90M|            V v{};
 6563|  8.90M|            auto temp_ctx = ctx.make_speculative();
 6564|  8.90M|            from<YAML, V>::template op<Opts>(v, temp_ctx, it, end);
 6565|  8.90M|            ctx.alias_expansion_budget = temp_ctx.alias_expansion_budget; // charged even if rejected
 6566|  8.90M|            ctx.key_expansion_budget = temp_ctx.key_expansion_budget;
 6567|       |
 6568|  8.90M|            if (!bool(temp_ctx.error)) {
 6569|  8.90M|               value = std::move(v);
 6570|  8.90M|               ctx.anchors = std::move(temp_ctx.anchors);
 6571|  8.90M|               return true;
 6572|  8.90M|            }
 6573|       |
 6574|  8.90M|            if (temp_ctx.error == error_code::exceeded_max_expansion && expansion_error == error_code::none) {
 6575|  8.90M|               expansion_error = temp_ctx.error;
 6576|  8.90M|               expansion_message = temp_ctx.custom_error_message;
 6577|  8.90M|            }
 6578|  8.90M|            it = start;
 6579|  8.90M|            return false;
 6580|  8.90M|         };
 6581|       |
 6582|  8.90M|         bool parsed = false;
 6583|  8.90M|         [&]<size_t... Is>(std::index_sequence<Is...>) {
 6584|  8.90M|            ((parsed = parsed || try_parse.template operator()<Is>()), ...);
 6585|  8.90M|         }(std::make_index_sequence<N>{});
 6586|       |
 6587|  8.90M|         if (!parsed) {
  ------------------
  |  Branch (6587:14): [True: 0, False: 8.90M]
  ------------------
 6588|      0|            if (expansion_error != error_code::none) {
  ------------------
  |  Branch (6588:17): [True: 0, False: 0]
  ------------------
 6589|      0|               ctx.error = expansion_error;
 6590|      0|               ctx.custom_error_message = expansion_message;
 6591|      0|            }
 6592|      0|            else {
 6593|      0|               ctx.error = error_code::no_matching_variant_type;
 6594|      0|            }
 6595|      0|         }
 6596|  8.90M|      }
_ZN3glz4yaml12handle_aliasITnDaXtlNS0_9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj1EEERNSt3__17variantIJDndNS3_12basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEEbNS3_6vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS8_ISF_EEEENSE_ISF_EEEEENS0_12yaml_contextEPKcSN_EEbOT0_RT1_RT2_T3_:
  300|  1.22M|      {
  301|  1.22M|         if (it == end || *it != '*') return false;
  ------------------
  |  Branch (301:14): [True: 0, False: 1.22M]
  |  Branch (301:27): [True: 0, False: 1.22M]
  ------------------
  302|       |
  303|  1.22M|         ++it; // skip '*'
  304|  1.22M|         auto name = parse_anchor_name(it, end);
  305|  1.22M|         if (name.empty()) {
  ------------------
  |  Branch (305:14): [True: 196, False: 1.22M]
  ------------------
  306|    196|            ctx.error = error_code::syntax_error;
  307|    196|            return true;
  308|    196|         }
  309|       |
  310|  1.22M|         auto anchor_it = ctx.anchors.find(name);
  311|  1.22M|         if (anchor_it == ctx.anchors.end()) {
  ------------------
  |  Branch (311:14): [True: 2.39k, False: 1.22M]
  ------------------
  312|  2.39k|            ctx.error = error_code::syntax_error; // undefined alias
  313|  2.39k|            return true;
  314|  2.39k|         }
  315|       |
  316|       |         // Copied rather than referenced: the replay below can replace ctx.anchors wholesale
  317|       |         // (a speculative parse hands its own map back), which would dangle a reference here.
  318|  1.22M|         const auto span = anchor_it->second;
  319|       |
  320|       |         // Empty anchor span (anchor on null/empty node) — leave value as default
  321|  1.22M|         if (span.begin == span.end) {
  ------------------
  |  Branch (321:14): [True: 9.15k, False: 1.21M]
  ------------------
  322|  9.15k|            return true;
  323|  9.15k|         }
  324|       |
  325|       |         // An anchor is invisible to itself while it expands. A span that aliases the name it
  326|       |         // defines -- reachable because a mapping key's anchor is registered over the key text
  327|       |         // before that text is parsed -- would otherwise replay itself forever.
  328|  1.21M|         if (ctx.alias_span_is_replaying(span.begin, span.end)) [[unlikely]] {
  ------------------
  |  Branch (328:14): [True: 37, False: 1.21M]
  ------------------
  329|     37|            ctx.error = error_code::syntax_error; // cyclic alias
  330|     37|            return true;
  331|     37|         }
  332|       |
  333|       |         // Replaying an anchor re-enters the reader directly, bypassing the variant reader's
  334|       |         // depth guard, so this is the only depth accounting a chain of aliases into a
  335|       |         // non-variant target gets. The cycle check above stops the unbounded case; this bounds
  336|       |         // a legitimate but deeply chained one.
  337|  1.21M|         depth_guard guard{ctx, yaml::max_yaml_recursive_depth};
  338|  1.21M|         if (!guard) [[unlikely]]
  ------------------
  |  Branch (338:14): [True: 3, False: 1.21M]
  ------------------
  339|      3|            return true;
  340|       |
  341|  1.21M|         if (!ctx.charge_alias_expansion(static_cast<size_t>(span.end - span.begin))) [[unlikely]] {
  ------------------
  |  Branch (341:14): [True: 22, False: 1.21M]
  ------------------
  342|     22|            ctx.error = error_code::exceeded_max_expansion;
  343|     22|            ctx.custom_error_message = "alias expansion";
  344|     22|            return true;
  345|     22|         }
  346|       |
  347|  1.21M|         auto replay_it = span.begin;
  348|  1.21M|         auto replay_end = span.end;
  349|       |
  350|       |         // Save indent context and set up for replay
  351|  1.21M|         auto saved_indent_stack = std::move(ctx.indent_stack);
  352|  1.21M|         ctx.indent_stack.clear();
  353|  1.21M|         if (span.base_indent > 0) {
  ------------------
  |  Branch (353:14): [True: 42.5k, False: 1.17M]
  ------------------
  354|  42.5k|            ctx.push_indent(span.base_indent - 1);
  355|  42.5k|         }
  356|       |
  357|  1.21M|         ctx.active_alias_spans.emplace_back(span.begin, span.end);
  358|       |
  359|  1.21M|         using V = std::remove_cvref_t<T>;
  360|  1.21M|         from<YAML, V>::template op<Opts>(std::forward<T>(value), ctx, replay_it, replay_end);
  361|       |
  362|  1.21M|         ctx.active_alias_spans.pop_back();
  363|       |
  364|       |         // Restore indent context
  365|  1.21M|         ctx.indent_stack = std::move(saved_indent_stack);
  366|  1.21M|         return true;
  367|  1.21M|      }
_ZN3glz33process_yaml_variant_alternativesINSt3__17variantIJDndNS1_12basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEbNS1_6vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS6_ISD_EEEENSC_ISD_EEEEENS_19is_yaml_variant_strEE2opITnDaXtlNS_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj1EEERSH_TkNS_10is_contextERNSL_12yaml_contextERPKcSR_EEvOT0_OT1_OT2_T3_:
 5205|  1.42M|      {
 5206|  1.42M|         constexpr auto category_count = yaml_variant_count_v<Variant, Trait>;
 5207|       |
 5208|       |         if constexpr (category_count == 0) {
 5209|       |            ctx.error = error_code::no_matching_variant_type;
 5210|       |         }
 5211|  1.42M|         else if constexpr (category_count == 1) {
 5212|       |            // Only one type in this category, use it directly
 5213|  1.42M|            constexpr auto first_idx = yaml_variant_first_index_v<Variant, Trait>;
 5214|  1.42M|            using V = std::variant_alternative_t<first_idx, Variant>;
 5215|  1.42M|            if (!std::holds_alternative<V>(value)) value = V{};
  ------------------
  |  Branch (5215:17): [True: 1.42M, False: 0]
  ------------------
 5216|  1.42M|            from<YAML, V>::template op<Opts>(std::get<V>(value), ctx, it, end);
 5217|       |         }
 5218|       |         else {
 5219|       |            // Multiple types in this category, try each one
 5220|       |            constexpr auto N = std::variant_size_v<Variant>;
 5221|       |            bool found_match{};
 5222|       |            size_t match_idx = 0;
 5223|       |            // Only the last alternative propagates its error, so an alternative that exhausted an
 5224|       |            // expansion budget would otherwise be reported as no_matching_variant_type -- a wrong
 5225|       |            // diagnosis for a document that is hostile rather than merely the wrong shape. Held
 5226|       |            // aside and used only if nothing matched, so an alternative that does succeed later
 5227|       |            // (one that materializes no key text can still parse under a latched budget) is
 5228|       |            // unaffected.
 5229|       |            error_code expansion_error{};
 5230|       |            std::string_view expansion_message{};
 5231|       |
 5232|       |            for_each<N>([&]<size_t I>() {
 5233|       |               if (found_match) {
 5234|       |                  return;
 5235|       |               }
 5236|       |               using V = std::variant_alternative_t<I, Variant>;
 5237|       |               if constexpr (Trait<V>::value) {
 5238|       |                  auto copy_it = it;
 5239|       |                  if (!std::holds_alternative<V>(value)) {
 5240|       |                     value = V{};
 5241|       |                  }
 5242|       |
 5243|       |                  auto temp_ctx = ctx.make_speculative();
 5244|       |                  from<YAML, V>::template op<Opts>(std::get<V>(value), temp_ctx, it, end);
 5245|       |
 5246|       |                  // Charged whether or not the alternative fit: a rejected probe still replayed
 5247|       |                  // whatever aliases it reached, and an attempt that is never billed is an
 5248|       |                  // attempt that can be repeated for free.
 5249|       |                  ctx.alias_expansion_budget = temp_ctx.alias_expansion_budget;
 5250|       |                  ctx.key_expansion_budget = temp_ctx.key_expansion_budget;
 5251|       |
 5252|       |                  if (!bool(temp_ctx.error)) {
 5253|       |                     found_match = true;
 5254|       |                     ctx.anchors = std::move(temp_ctx.anchors);
 5255|       |                  }
 5256|       |                  else {
 5257|       |                     it = copy_it;
 5258|       |                     if (temp_ctx.error == error_code::exceeded_max_expansion && expansion_error == error_code::none) {
 5259|       |                        expansion_error = temp_ctx.error;
 5260|       |                        expansion_message = temp_ctx.custom_error_message;
 5261|       |                     }
 5262|       |                     if (match_idx + 1 < category_count) {
 5263|       |                        // Not the last type, continue trying
 5264|       |                     }
 5265|       |                     else {
 5266|       |                        // Last type failed, propagate error
 5267|       |                        ctx.error = temp_ctx.error;
 5268|       |                        ctx.custom_error_message = temp_ctx.custom_error_message;
 5269|       |                     }
 5270|       |                  }
 5271|       |                  ++match_idx;
 5272|       |               }
 5273|       |            });
 5274|       |
 5275|       |            if (!found_match && !bool(ctx.error)) {
 5276|       |               if (expansion_error != error_code::none) {
 5277|       |                  ctx.error = expansion_error;
 5278|       |                  ctx.custom_error_message = expansion_message;
 5279|       |               }
 5280|       |               else {
 5281|       |                  ctx.error = error_code::no_matching_variant_type;
 5282|       |               }
 5283|       |            }
 5284|       |         }
 5285|  1.42M|      }
_ZN3glz4fromILj450ENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEE2opITnDaXtlNS_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj1EEERPKcRS7_TkNS_10is_contextERNSA_12yaml_contextESD_EEvOT1_OT2_OT0_T3_:
 1892|  1.48M|      {
 1893|  1.48M|         if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (1893:14): [True: 5.98k, False: 1.47M]
  ------------------
 1894|  5.98k|            return;
 1895|       |
 1896|  1.47M|         yaml::node_preamble_state preamble{};
 1897|  1.47M|         if (yaml::parse_node_preamble<Opts, yaml::node_property_policy{true, false, false, true}>(
  ------------------
  |  Branch (1897:14): [True: 61.9k, False: 1.41M]
  ------------------
 1898|  1.47M|                value, ctx, it, end, preamble, [](yaml::yaml_tag tag) { return yaml::tag_valid_for_string(tag); }))
 1899|  61.9k|            return;
 1900|       |
 1901|  1.41M|         std::string str;
 1902|  1.41M|         const auto style = yaml::detect_scalar_style(*it);
 1903|       |
 1904|  1.41M|         switch (style) {
  ------------------
  |  Branch (1904:18): [True: 1.41M, False: 0]
  ------------------
 1905|  9.11k|         case yaml::scalar_style::double_quoted:
  ------------------
  |  Branch (1905:10): [True: 9.11k, False: 1.40M]
  ------------------
 1906|  9.11k|            yaml::parse_double_quoted_string(str, ctx, it, end);
 1907|  9.11k|            break;
 1908|  12.4k|         case yaml::scalar_style::single_quoted:
  ------------------
  |  Branch (1908:10): [True: 12.4k, False: 1.40M]
  ------------------
 1909|  12.4k|            yaml::parse_single_quoted_string(str, ctx, it, end);
 1910|  12.4k|            break;
 1911|  3.34k|         case yaml::scalar_style::literal_block:
  ------------------
  |  Branch (1911:10): [True: 3.34k, False: 1.41M]
  ------------------
 1912|  11.6k|         case yaml::scalar_style::folded_block:
  ------------------
  |  Branch (1912:10): [True: 8.33k, False: 1.40M]
  ------------------
 1913|       |            // For same-line mapping/sequence values, parsing context is typically pushed
 1914|       |            // one column past the key/item indicator; block scalar indentation is relative
 1915|       |            // to the parent line indent.
 1916|  11.6k|            yaml::parse_block_scalar(str, ctx, it, end,
 1917|  11.6k|                                     ctx.current_indent() > 0 ? (ctx.current_indent() - 1) : ctx.current_indent());
  ------------------
  |  Branch (1917:38): [True: 2.19k, False: 9.48k]
  ------------------
 1918|  11.6k|            break;
 1919|  1.38M|         case yaml::scalar_style::plain:
  ------------------
  |  Branch (1919:10): [True: 1.38M, False: 33.2k]
  ------------------
 1920|       |            // In block context with known indent, use multiline parsing to support
 1921|       |            // plain scalars that span multiple lines (folding behavior)
 1922|       |            if constexpr (!yaml::check_flow_context(Opts)) {
 1923|       |               if (ctx.current_indent() >= 0) {
 1924|       |                  yaml::parse_plain_scalar_multiline(str, ctx, it, end, ctx.current_indent());
 1925|       |               }
 1926|       |               else {
 1927|       |                  // Top-level plain scalars may continue on same-indent or indented lines.
 1928|       |                  yaml::parse_plain_scalar_multiline(str, ctx, it, end, int32_t(0));
 1929|       |               }
 1930|       |            }
 1931|  1.38M|            else {
 1932|  1.38M|               yaml::parse_plain_scalar(str, ctx, it, end, true);
 1933|  1.38M|            }
 1934|  1.38M|            break;
 1935|  1.41M|         }
 1936|       |
 1937|  1.41M|         if (!bool(ctx.error)) {
  ------------------
  |  Branch (1937:14): [True: 1.41M, False: 454]
  ------------------
 1938|  1.41M|            value = std::move(str);
 1939|  1.41M|            yaml::finalize_node_anchor(preamble.node_props, ctx, it);
 1940|  1.41M|         }
 1941|  1.41M|      }
_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.47M|      {
  466|  1.47M|         skip_inline_ws(it, end);
  467|       |
  468|  1.47M|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (468:14): [True: 7, False: 1.47M]
  ------------------
  469|      7|            if constexpr (!AllowEmptyInput) {
  470|      7|               ctx.error = error_code::unexpected_end;
  471|      7|            }
  472|      7|            return true;
  473|      7|         }
  474|       |
  475|  1.47M|         preamble.tag = parse_yaml_tag(it, end, ctx);
  476|  1.47M|         if (preamble.tag == yaml_tag::unknown) [[unlikely]] {
  ------------------
  |  Branch (476:14): [True: 41, False: 1.47M]
  ------------------
  477|     41|            ctx.error = error_code::syntax_error;
  478|     41|            return true;
  479|     41|         }
  480|  1.47M|         if (!tag_validator(preamble.tag)) [[unlikely]] {
  ------------------
  |  Branch (480:14): [True: 5, False: 1.47M]
  ------------------
  481|      5|            ctx.error = error_code::syntax_error;
  482|      5|            return true;
  483|      5|         }
  484|       |
  485|  1.47M|         skip_inline_ws(it, end);
  486|       |
  487|  1.47M|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (487:14): [True: 11, False: 1.47M]
  ------------------
  488|     11|            if constexpr (!AllowEmptyInput) {
  489|     11|               ctx.error = error_code::unexpected_end;
  490|     11|            }
  491|     11|            return true;
  492|     11|         }
  493|       |
  494|  1.47M|         if (parse_node_properties<Opts, PropertyPolicy>(std::forward<T>(value), ctx, it, end, preamble.node_props)) {
  ------------------
  |  Branch (494:14): [True: 61.9k, False: 1.41M]
  ------------------
  495|  61.9k|            return true;
  496|  61.9k|         }
  497|       |
  498|  1.41M|         return false;
  499|  1.47M|      }
_ZZN3glz4fromILj450ENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEE2opITnDaXtlNS_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj1EEERPKcRS7_TkNS_10is_contextERNSA_12yaml_contextESD_EEvOT1_OT2_OT0_T3_ENKUlNSA_8yaml_tagEE_clESP_:
 1898|  1.47M|                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.47M|      {
  409|  1.47M|         state.has_anchor = false;
  410|  1.47M|         state.anchor_name.clear();
  411|  1.47M|         state.anchor_start = nullptr;
  412|  1.47M|         state.anchor_indent = ctx.current_indent();
  413|       |
  414|  1.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|  1.47M|            else {
  421|  1.47M|               if (handle_alias<Opts>(std::forward<T>(value), ctx, it, end)) return true;
  ------------------
  |  Branch (421:20): [True: 61.8k, False: 1.41M]
  ------------------
  422|  1.47M|            }
  423|  1.47M|         }
  424|       |
  425|  1.47M|         if (it != end && *it == '&') {
  ------------------
  |  Branch (425:14): [True: 1.41M, False: 61.8k]
  |  Branch (425:27): [True: 17.2k, False: 1.39M]
  ------------------
  426|  17.2k|            ++it;
  427|  17.2k|            auto name = parse_anchor_name(it, end);
  428|  17.2k|            if (name.empty()) {
  ------------------
  |  Branch (428:17): [True: 12, False: 17.2k]
  ------------------
  429|     12|               ctx.error = error_code::syntax_error;
  430|     12|               return true;
  431|     12|            }
  432|  17.2k|            skip_inline_ws(it, end);
  433|  17.2k|            if (it == end) {
  ------------------
  |  Branch (433:17): [True: 33, False: 17.2k]
  ------------------
  434|     33|               if constexpr (!Policy.allow_empty_after_anchor) {
  435|     33|                  ctx.error = error_code::unexpected_end;
  436|     33|               }
  437|     33|               return true;
  438|     33|            }
  439|  17.2k|            if constexpr (Policy.disallow_anchor_on_alias) {
  440|  17.2k|               if (*it == '*') {
  ------------------
  |  Branch (440:20): [True: 18, False: 17.2k]
  ------------------
  441|     18|                  ctx.error = error_code::syntax_error;
  442|     18|                  return true;
  443|     18|               }
  444|  17.2k|            }
  445|  17.2k|            state.has_anchor = true;
  446|  17.2k|            state.anchor_name = std::string(name);
  447|  17.2k|            state.anchor_start = &*it;
  448|  17.2k|         }
  449|       |
  450|  1.47M|         return false;
  451|  1.47M|      }
_ZN3glz4yaml12handle_aliasITnDaXtlNS0_9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj1EEERNSt3__112basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEENS0_12yaml_contextEPKcSD_EEbOT0_RT1_RT2_T3_:
  300|  1.47M|      {
  301|  1.47M|         if (it == end || *it != '*') return false;
  ------------------
  |  Branch (301:14): [True: 0, False: 1.47M]
  |  Branch (301:27): [True: 1.41M, False: 61.8k]
  ------------------
  302|       |
  303|  61.8k|         ++it; // skip '*'
  304|  61.8k|         auto name = parse_anchor_name(it, end);
  305|  61.8k|         if (name.empty()) {
  ------------------
  |  Branch (305:14): [True: 11, False: 61.8k]
  ------------------
  306|     11|            ctx.error = error_code::syntax_error;
  307|     11|            return true;
  308|     11|         }
  309|       |
  310|  61.8k|         auto anchor_it = ctx.anchors.find(name);
  311|  61.8k|         if (anchor_it == ctx.anchors.end()) {
  ------------------
  |  Branch (311:14): [True: 47, False: 61.7k]
  ------------------
  312|     47|            ctx.error = error_code::syntax_error; // undefined alias
  313|     47|            return true;
  314|     47|         }
  315|       |
  316|       |         // Copied rather than referenced: the replay below can replace ctx.anchors wholesale
  317|       |         // (a speculative parse hands its own map back), which would dangle a reference here.
  318|  61.7k|         const auto span = anchor_it->second;
  319|       |
  320|       |         // Empty anchor span (anchor on null/empty node) — leave value as default
  321|  61.7k|         if (span.begin == span.end) {
  ------------------
  |  Branch (321:14): [True: 1.55k, False: 60.2k]
  ------------------
  322|  1.55k|            return true;
  323|  1.55k|         }
  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|  60.2k|         if (ctx.alias_span_is_replaying(span.begin, span.end)) [[unlikely]] {
  ------------------
  |  Branch (328:14): [True: 6, False: 60.2k]
  ------------------
  329|      6|            ctx.error = error_code::syntax_error; // cyclic alias
  330|      6|            return true;
  331|      6|         }
  332|       |
  333|       |         // Replaying an anchor re-enters the reader directly, bypassing the variant reader's
  334|       |         // depth guard, so this is the only depth accounting a chain of aliases into a
  335|       |         // non-variant target gets. The cycle check above stops the unbounded case; this bounds
  336|       |         // a legitimate but deeply chained one.
  337|  60.2k|         depth_guard guard{ctx, yaml::max_yaml_recursive_depth};
  338|  60.2k|         if (!guard) [[unlikely]]
  ------------------
  |  Branch (338:14): [True: 2, False: 60.2k]
  ------------------
  339|      2|            return true;
  340|       |
  341|  60.2k|         if (!ctx.charge_alias_expansion(static_cast<size_t>(span.end - span.begin))) [[unlikely]] {
  ------------------
  |  Branch (341:14): [True: 2, False: 60.2k]
  ------------------
  342|      2|            ctx.error = error_code::exceeded_max_expansion;
  343|      2|            ctx.custom_error_message = "alias expansion";
  344|      2|            return true;
  345|      2|         }
  346|       |
  347|  60.2k|         auto replay_it = span.begin;
  348|  60.2k|         auto replay_end = span.end;
  349|       |
  350|       |         // Save indent context and set up for replay
  351|  60.2k|         auto saved_indent_stack = std::move(ctx.indent_stack);
  352|  60.2k|         ctx.indent_stack.clear();
  353|  60.2k|         if (span.base_indent > 0) {
  ------------------
  |  Branch (353:14): [True: 1.80k, False: 58.4k]
  ------------------
  354|  1.80k|            ctx.push_indent(span.base_indent - 1);
  355|  1.80k|         }
  356|       |
  357|  60.2k|         ctx.active_alias_spans.emplace_back(span.begin, span.end);
  358|       |
  359|  60.2k|         using V = std::remove_cvref_t<T>;
  360|  60.2k|         from<YAML, V>::template op<Opts>(std::forward<T>(value), ctx, replay_it, replay_end);
  361|       |
  362|  60.2k|         ctx.active_alias_spans.pop_back();
  363|       |
  364|       |         // Restore indent context
  365|  60.2k|         ctx.indent_stack = std::move(saved_indent_stack);
  366|  60.2k|         return true;
  367|  60.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_:
 5205|  1.50M|      {
 5206|  1.50M|         constexpr auto category_count = yaml_variant_count_v<Variant, Trait>;
 5207|       |
 5208|       |         if constexpr (category_count == 0) {
 5209|       |            ctx.error = error_code::no_matching_variant_type;
 5210|       |         }
 5211|  1.50M|         else if constexpr (category_count == 1) {
 5212|       |            // Only one type in this category, use it directly
 5213|  1.50M|            constexpr auto first_idx = yaml_variant_first_index_v<Variant, Trait>;
 5214|  1.50M|            using V = std::variant_alternative_t<first_idx, Variant>;
 5215|  1.50M|            if (!std::holds_alternative<V>(value)) value = V{};
  ------------------
  |  Branch (5215:17): [True: 1.50M, False: 0]
  ------------------
 5216|  1.50M|            from<YAML, V>::template op<Opts>(std::get<V>(value), ctx, it, end);
 5217|       |         }
 5218|       |         else {
 5219|       |            // Multiple types in this category, try each one
 5220|       |            constexpr auto N = std::variant_size_v<Variant>;
 5221|       |            bool found_match{};
 5222|       |            size_t match_idx = 0;
 5223|       |            // Only the last alternative propagates its error, so an alternative that exhausted an
 5224|       |            // expansion budget would otherwise be reported as no_matching_variant_type -- a wrong
 5225|       |            // diagnosis for a document that is hostile rather than merely the wrong shape. Held
 5226|       |            // aside and used only if nothing matched, so an alternative that does succeed later
 5227|       |            // (one that materializes no key text can still parse under a latched budget) is
 5228|       |            // unaffected.
 5229|       |            error_code expansion_error{};
 5230|       |            std::string_view expansion_message{};
 5231|       |
 5232|       |            for_each<N>([&]<size_t I>() {
 5233|       |               if (found_match) {
 5234|       |                  return;
 5235|       |               }
 5236|       |               using V = std::variant_alternative_t<I, Variant>;
 5237|       |               if constexpr (Trait<V>::value) {
 5238|       |                  auto copy_it = it;
 5239|       |                  if (!std::holds_alternative<V>(value)) {
 5240|       |                     value = V{};
 5241|       |                  }
 5242|       |
 5243|       |                  auto temp_ctx = ctx.make_speculative();
 5244|       |                  from<YAML, V>::template op<Opts>(std::get<V>(value), temp_ctx, it, end);
 5245|       |
 5246|       |                  // Charged whether or not the alternative fit: a rejected probe still replayed
 5247|       |                  // whatever aliases it reached, and an attempt that is never billed is an
 5248|       |                  // attempt that can be repeated for free.
 5249|       |                  ctx.alias_expansion_budget = temp_ctx.alias_expansion_budget;
 5250|       |                  ctx.key_expansion_budget = temp_ctx.key_expansion_budget;
 5251|       |
 5252|       |                  if (!bool(temp_ctx.error)) {
 5253|       |                     found_match = true;
 5254|       |                     ctx.anchors = std::move(temp_ctx.anchors);
 5255|       |                  }
 5256|       |                  else {
 5257|       |                     it = copy_it;
 5258|       |                     if (temp_ctx.error == error_code::exceeded_max_expansion && expansion_error == error_code::none) {
 5259|       |                        expansion_error = temp_ctx.error;
 5260|       |                        expansion_message = temp_ctx.custom_error_message;
 5261|       |                     }
 5262|       |                     if (match_idx + 1 < category_count) {
 5263|       |                        // Not the last type, continue trying
 5264|       |                     }
 5265|       |                     else {
 5266|       |                        // Last type failed, propagate error
 5267|       |                        ctx.error = temp_ctx.error;
 5268|       |                        ctx.custom_error_message = temp_ctx.custom_error_message;
 5269|       |                     }
 5270|       |                  }
 5271|       |                  ++match_idx;
 5272|       |               }
 5273|       |            });
 5274|       |
 5275|       |            if (!found_match && !bool(ctx.error)) {
 5276|       |               if (expansion_error != error_code::none) {
 5277|       |                  ctx.error = expansion_error;
 5278|       |                  ctx.custom_error_message = expansion_message;
 5279|       |               }
 5280|       |               else {
 5281|       |                  ctx.error = error_code::no_matching_variant_type;
 5282|       |               }
 5283|       |            }
 5284|       |         }
 5285|  1.50M|      }
_ZN3glz4fromILj450EdE2opITnDaXtlNS_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj1EEERPKcRdTkNS_10is_contextERNS3_12yaml_contextES6_EEvOT1_OT2_OT0_T3_:
 2047|  1.51M|      {
 2048|  1.51M|         if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2048:14): [True: 0, False: 1.51M]
  ------------------
 2049|      0|            return;
 2050|       |
 2051|  1.51M|         yaml::node_preamble_state preamble{};
 2052|  1.51M|         if (yaml::parse_node_preamble<Opts>(value, ctx, it, end, preamble, [](yaml::yaml_tag tag) {
  ------------------
  |  Branch (2052:14): [True: 12.4k, False: 1.50M]
  ------------------
 2053|  1.51M|                if constexpr (std::floating_point<std::remove_cvref_t<T>>) {
 2054|  1.51M|                   return yaml::tag_valid_for_float(tag);
 2055|  1.51M|                }
 2056|  1.51M|                else {
 2057|  1.51M|                   return yaml::tag_valid_for_int(tag);
 2058|  1.51M|                }
 2059|  1.51M|             }))
 2060|  12.4k|            return;
 2061|       |
 2062|  1.50M|         auto finalize = [&] { yaml::finalize_node_anchor(preamble.node_props, ctx, it); };
 2063|       |
 2064|       |         // Check for special float values
 2065|  1.50M|         if constexpr (std::floating_point<std::remove_cvref_t<T>>) {
 2066|  1.50M|            auto start = it;
 2067|       |
 2068|       |            // Check for .inf, .nan, -.inf, etc.
 2069|  1.50M|            if (*it == '.') {
  ------------------
  |  Branch (2069:17): [True: 43.2k, False: 1.45M]
  ------------------
 2070|  43.2k|               ++it;
 2071|  43.2k|               if (it + 3 <= end && (std::string_view(it, 3) == "inf" || std::string_view(it, 3) == "Inf" ||
  ------------------
  |  Branch (2071:20): [True: 41.2k, False: 2.01k]
  |  Branch (2071:38): [True: 2.48k, False: 38.7k]
  |  Branch (2071:74): [True: 3.62k, False: 35.1k]
  ------------------
 2072|  35.1k|                                     std::string_view(it, 3) == "INF")) {
  ------------------
  |  Branch (2072:38): [True: 3.61k, False: 31.5k]
  ------------------
 2073|  9.72k|                  value = std::numeric_limits<std::remove_cvref_t<T>>::infinity();
 2074|  9.72k|                  it += 3;
 2075|  9.72k|                  finalize();
 2076|  9.72k|                  return;
 2077|  9.72k|               }
 2078|  33.5k|               if (it + 3 <= end && (std::string_view(it, 3) == "nan" || std::string_view(it, 3) == "NaN" ||
  ------------------
  |  Branch (2078:20): [True: 31.5k, False: 2.01k]
  |  Branch (2078:38): [True: 599, False: 30.9k]
  |  Branch (2078:74): [True: 1.19k, False: 29.7k]
  ------------------
 2079|  29.7k|                                     std::string_view(it, 3) == "NAN")) {
  ------------------
  |  Branch (2079:38): [True: 2.34k, False: 27.4k]
  ------------------
 2080|  4.13k|                  value = std::numeric_limits<std::remove_cvref_t<T>>::quiet_NaN();
 2081|  4.13k|                  it += 3;
 2082|  4.13k|                  finalize();
 2083|  4.13k|                  return;
 2084|  4.13k|               }
 2085|  29.4k|               it = start;
 2086|  29.4k|            }
 2087|       |
 2088|  1.48M|            if (*it == '-' || *it == '+') {
  ------------------
  |  Branch (2088:17): [True: 102k, False: 1.38M]
  |  Branch (2088:31): [True: 51.6k, False: 1.33M]
  ------------------
 2089|   153k|               const char sign = *it;
 2090|   153k|               ++it;
 2091|   153k|               if (it != end && *it == '.') {
  ------------------
  |  Branch (2091:20): [True: 153k, False: 794]
  |  Branch (2091:33): [True: 102k, False: 50.6k]
  ------------------
 2092|   102k|                  ++it;
 2093|   102k|                  if (it + 3 <= end && (std::string_view(it, 3) == "inf" || std::string_view(it, 3) == "Inf" ||
  ------------------
  |  Branch (2093:23): [True: 101k, False: 795]
  |  Branch (2093:41): [True: 82.9k, False: 18.6k]
  |  Branch (2093:77): [True: 1.72k, False: 16.9k]
  ------------------
 2094|  98.4k|                                        std::string_view(it, 3) == "INF")) {
  ------------------
  |  Branch (2094:41): [True: 13.7k, False: 3.19k]
  ------------------
 2095|  98.4k|                     if (sign == '-') {
  ------------------
  |  Branch (2095:26): [True: 97.5k, False: 881]
  ------------------
 2096|  97.5k|                        value = -std::numeric_limits<std::remove_cvref_t<T>>::infinity();
 2097|  97.5k|                     }
 2098|    881|                     else {
 2099|    881|                        value = std::numeric_limits<std::remove_cvref_t<T>>::infinity();
 2100|    881|                     }
 2101|  98.4k|                     it += 3;
 2102|  98.4k|                     finalize();
 2103|  98.4k|                     return;
 2104|  98.4k|                  }
 2105|   102k|               }
 2106|  55.4k|               it = start;
 2107|  55.4k|            }
 2108|  1.48M|         }
 2109|       |
 2110|       |         // Parse as plain scalar and convert
 2111|  1.39M|         auto start = it;
 2112|       |
 2113|       |         // Find end of number - use same rules as plain scalar for colons
 2114|  43.8M|         while (it != end) {
  ------------------
  |  Branch (2114:17): [True: 43.7M, False: 131k]
  ------------------
 2115|  43.7M|            const char c = *it;
 2116|  43.7M|            if (c == ' ' || c == '\t' || c == '\n' || c == '\r' || c == ',' || c == ']' || c == '}' || c == '#') {
  ------------------
  |  Branch (2116:17): [True: 76.6k, False: 43.6M]
  |  Branch (2116:29): [True: 98.5k, False: 43.5M]
  |  Branch (2116:42): [True: 10.2k, False: 43.5M]
  |  Branch (2116:55): [True: 89.9k, False: 43.4M]
  |  Branch (2116:68): [True: 1.05M, False: 42.4M]
  |  Branch (2116:80): [True: 3.75k, False: 42.4M]
  |  Branch (2116:92): [True: 4.83k, False: 42.4M]
  |  Branch (2116:104): [True: 28.3k, False: 42.3M]
  ------------------
 2117|  1.36M|               break;
 2118|  1.36M|            }
 2119|       |            // Colon only ends number if followed by space/tab/newline/end (YAML mapping indicator)
 2120|  42.3M|            if (c == ':') {
  ------------------
  |  Branch (2120:17): [True: 47.6k, False: 42.3M]
  ------------------
 2121|  47.6k|               if ((it + 1) == end || *(it + 1) == ' ' || *(it + 1) == '\t' || *(it + 1) == '\n' || *(it + 1) == '\r') {
  ------------------
  |  Branch (2121:20): [True: 795, False: 46.8k]
  |  Branch (2121:39): [True: 3.27k, False: 43.5k]
  |  Branch (2121:59): [True: 752, False: 42.8k]
  |  Branch (2121:80): [True: 2.58k, False: 40.2k]
  |  Branch (2121:101): [True: 1.11k, False: 39.1k]
  ------------------
 2122|  8.51k|                  break;
 2123|  8.51k|               }
 2124|  47.6k|            }
 2125|  42.3M|            ++it;
 2126|  42.3M|         }
 2127|       |
 2128|  1.50M|         const std::string_view num_str(&*start, static_cast<size_t>(it - start));
 2129|       |
 2130|  1.50M|         if (num_str.empty()) {
  ------------------
  |  Branch (2130:14): [True: 1.32k, False: 1.50M]
  ------------------
 2131|  1.32k|            ctx.error = error_code::parse_number_failure;
 2132|  1.32k|            return;
 2133|  1.32k|         }
 2134|       |
 2135|       |         // Handle hex, octal, binary
 2136|       |         if constexpr (std::integral<std::remove_cvref_t<T>>) {
 2137|       |            if (num_str.size() > 2 && num_str[0] == '0') {
 2138|       |               int base = 10;
 2139|       |               size_t offset = 0;
 2140|       |
 2141|       |               if (num_str[1] == 'x' || num_str[1] == 'X') {
 2142|       |                  base = 16;
 2143|       |                  offset = 2;
 2144|       |               }
 2145|       |               else if (num_str[1] == 'o' || num_str[1] == 'O') {
 2146|       |                  base = 8;
 2147|       |                  offset = 2;
 2148|       |               }
 2149|       |               else if (num_str[1] == 'b' || num_str[1] == 'B') {
 2150|       |                  base = 2;
 2151|       |                  offset = 2;
 2152|       |               }
 2153|       |
 2154|       |               if (base != 10) {
 2155|       |                  const auto digits = num_str.substr(offset);
 2156|       |                  const bool has_underscores = (digits.find('_') != std::string_view::npos);
 2157|       |
 2158|       |                  std::string clean_storage;
 2159|       |                  std::string_view clean_view;
 2160|       |
 2161|       |                  if (has_underscores) {
 2162|       |                     clean_storage.reserve(digits.size());
 2163|       |                     for (char c : digits) {
 2164|       |                        if (c != '_') {
 2165|       |                           clean_storage.push_back(c);
 2166|       |                        }
 2167|       |                     }
 2168|       |                     clean_view = clean_storage;
 2169|       |                  }
 2170|       |                  else {
 2171|       |                     clean_view = digits;
 2172|       |                  }
 2173|       |
 2174|       |                  auto [ptr, ec] =
 2175|       |                     std::from_chars(clean_view.data(), clean_view.data() + clean_view.size(), value, base);
 2176|       |                  if (ec != std::errc{}) {
 2177|       |                     ctx.error = error_code::parse_number_failure;
 2178|       |                  }
 2179|       |                  finalize();
 2180|       |                  return;
 2181|       |               }
 2182|       |            }
 2183|       |         }
 2184|  1.50M|         else if constexpr (std::floating_point<std::remove_cvref_t<T>>) {
 2185|  1.50M|            bool negative = false;
 2186|  1.50M|            std::string_view digits = num_str;
 2187|       |
 2188|  1.50M|            if (!digits.empty() && (digits.front() == '+' || digits.front() == '-')) {
  ------------------
  |  Branch (2188:17): [True: 1.38M, False: 112k]
  |  Branch (2188:37): [True: 50.7k, False: 1.33M]
  |  Branch (2188:62): [True: 4.71k, False: 1.33M]
  ------------------
 2189|  55.4k|               negative = (digits.front() == '-');
 2190|  55.4k|               digits.remove_prefix(1);
 2191|  55.4k|            }
 2192|       |
 2193|  1.50M|            if (digits.size() > 2 && digits[0] == '0') {
  ------------------
  |  Branch (2193:17): [True: 382k, False: 1.11M]
  |  Branch (2193:38): [True: 113k, False: 268k]
  ------------------
 2194|   113k|               int base = 10;
 2195|   113k|               size_t offset = 0;
 2196|       |
 2197|   113k|               if (digits[1] == 'x' || digits[1] == 'X') {
  ------------------
  |  Branch (2197:20): [True: 6.39k, False: 107k]
  |  Branch (2197:40): [True: 669, False: 106k]
  ------------------
 2198|  7.06k|                  base = 16;
 2199|  7.06k|                  offset = 2;
 2200|  7.06k|               }
 2201|   106k|               else if (digits[1] == 'o' || digits[1] == 'O') {
  ------------------
  |  Branch (2201:25): [True: 2.65k, False: 104k]
  |  Branch (2201:45): [True: 2.12k, False: 101k]
  ------------------
 2202|  4.77k|                  base = 8;
 2203|  4.77k|                  offset = 2;
 2204|  4.77k|               }
 2205|   101k|               else if (digits[1] == 'b' || digits[1] == 'B') {
  ------------------
  |  Branch (2205:25): [True: 916, False: 101k]
  |  Branch (2205:45): [True: 507, False: 100k]
  ------------------
 2206|  1.42k|                  base = 2;
 2207|  1.42k|                  offset = 2;
 2208|  1.42k|               }
 2209|       |
 2210|   113k|               if (base != 10) {
  ------------------
  |  Branch (2210:20): [True: 13.2k, False: 100k]
  ------------------
 2211|  13.2k|                  auto raw_digits = digits.substr(offset);
 2212|  13.2k|                  const bool has_underscores = (raw_digits.find('_') != std::string_view::npos);
 2213|       |
 2214|  13.2k|                  std::string clean_storage;
 2215|  13.2k|                  std::string_view clean_view;
 2216|  13.2k|                  if (has_underscores) {
  ------------------
  |  Branch (2216:23): [True: 4.07k, False: 9.18k]
  ------------------
 2217|  4.07k|                     clean_storage.reserve(raw_digits.size());
 2218|  4.05M|                     for (char c : raw_digits) {
  ------------------
  |  Branch (2218:34): [True: 4.05M, False: 4.07k]
  ------------------
 2219|  4.05M|                        if (c != '_') {
  ------------------
  |  Branch (2219:29): [True: 4.04M, False: 9.74k]
  ------------------
 2220|  4.04M|                           clean_storage.push_back(c);
 2221|  4.04M|                        }
 2222|  4.05M|                     }
 2223|  4.07k|                     clean_view = clean_storage;
 2224|  4.07k|                  }
 2225|  9.18k|                  else {
 2226|  9.18k|                     clean_view = raw_digits;
 2227|  9.18k|                  }
 2228|       |
 2229|  13.2k|                  uint64_t parsed_int{};
 2230|  13.2k|                  auto [ptr, ec] =
 2231|  13.2k|                     std::from_chars(clean_view.data(), clean_view.data() + clean_view.size(), parsed_int, base);
 2232|  13.2k|                  if (ec != std::errc{} || ptr != (clean_view.data() + clean_view.size())) {
  ------------------
  |  Branch (2232:23): [True: 4.55k, False: 8.71k]
  |  Branch (2232:44): [True: 5.38k, False: 3.32k]
  ------------------
 2233|  9.93k|                     ctx.error = error_code::parse_number_failure;
 2234|  9.93k|                     finalize();
 2235|  9.93k|                     return;
 2236|  9.93k|                  }
 2237|       |
 2238|  3.32k|                  const auto as_float = static_cast<std::remove_cvref_t<T>>(parsed_int);
 2239|  3.32k|                  value = negative ? -as_float : as_float;
  ------------------
  |  Branch (2239:27): [True: 784, False: 2.54k]
  ------------------
 2240|  3.32k|                  finalize();
 2241|  3.32k|                  return;
 2242|  13.2k|               }
 2243|   113k|            }
 2244|  1.50M|         }
 2245|       |
 2246|       |         // Standard number parsing - only allocate if underscores present
 2247|  1.48M|         const bool has_underscores = (num_str.find('_') != std::string_view::npos);
 2248|       |
 2249|  1.50M|         std::string clean_storage;
 2250|  1.50M|         std::string_view clean_view;
 2251|       |
 2252|  1.50M|         if (has_underscores) {
  ------------------
  |  Branch (2252:14): [True: 4.94k, False: 1.49M]
  ------------------
 2253|  4.94k|            clean_storage.reserve(num_str.size());
 2254|  19.0M|            for (char c : num_str) {
  ------------------
  |  Branch (2254:25): [True: 19.0M, False: 4.94k]
  ------------------
 2255|  19.0M|               if (c != '_') {
  ------------------
  |  Branch (2255:20): [True: 19.0M, False: 16.8k]
  ------------------
 2256|  19.0M|                  clean_storage.push_back(c);
 2257|  19.0M|               }
 2258|  19.0M|            }
 2259|  4.94k|            clean_view = clean_storage;
 2260|  4.94k|         }
 2261|  1.49M|         else {
 2262|  1.49M|            clean_view = num_str;
 2263|  1.49M|         }
 2264|       |
 2265|       |         // YAML allows leading '+' for positive numbers, but C++ from_chars doesn't
 2266|       |         // Strip leading '+' if present
 2267|  1.50M|         auto parse_view = clean_view;
 2268|  1.50M|         if (!parse_view.empty() && parse_view.front() == '+') {
  ------------------
  |  Branch (2268:14): [True: 1.37M, False: 125k]
  |  Branch (2268:37): [True: 50.7k, False: 1.32M]
  ------------------
 2269|  50.7k|            parse_view.remove_prefix(1);
 2270|  50.7k|            if (parse_view.empty()) {
  ------------------
  |  Branch (2270:17): [True: 12.6k, False: 38.0k]
  ------------------
 2271|  12.6k|               ctx.error = error_code::parse_number_failure;
 2272|  12.6k|               return;
 2273|  12.6k|            }
 2274|  50.7k|         }
 2275|       |
 2276|  1.48M|         if constexpr (std::floating_point<std::remove_cvref_t<T>>) {
 2277|  1.48M|            auto result = glz::fast_float::from_chars(parse_view.data(), parse_view.data() + parse_view.size(), value);
 2278|       |            // Check both for errors and that all input was consumed (e.g., "12:30" is not a valid number)
 2279|  1.48M|            if (result.ec != std::errc{} || result.ptr != parse_view.data() + parse_view.size()) {
  ------------------
  |  Branch (2279:17): [True: 188k, False: 1.30M]
  |  Branch (2279:45): [True: 125k, False: 1.17M]
  ------------------
 2280|   188k|               ctx.error = error_code::parse_number_failure;
 2281|   188k|            }
 2282|       |         }
 2283|       |         else {
 2284|       |            auto [ptr, ec] = std::from_chars(parse_view.data(), parse_view.data() + parse_view.size(), value);
 2285|       |            // Check both for errors and that all input was consumed
 2286|       |            if (ec != std::errc{} || ptr != parse_view.data() + parse_view.size()) {
 2287|       |               ctx.error = error_code::parse_number_failure;
 2288|       |            }
 2289|       |         }
 2290|       |
 2291|  1.48M|         finalize();
 2292|  1.48M|      }
_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|  1.51M|      {
  466|  1.51M|         skip_inline_ws(it, end);
  467|       |
  468|  1.51M|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (468:14): [True: 444, False: 1.51M]
  ------------------
  469|    444|            if constexpr (!AllowEmptyInput) {
  470|    444|               ctx.error = error_code::unexpected_end;
  471|    444|            }
  472|    444|            return true;
  473|    444|         }
  474|       |
  475|  1.51M|         preamble.tag = parse_yaml_tag(it, end, ctx);
  476|  1.51M|         if (preamble.tag == yaml_tag::unknown) [[unlikely]] {
  ------------------
  |  Branch (476:14): [True: 268, False: 1.51M]
  ------------------
  477|    268|            ctx.error = error_code::syntax_error;
  478|    268|            return true;
  479|    268|         }
  480|  1.51M|         if (!tag_validator(preamble.tag)) [[unlikely]] {
  ------------------
  |  Branch (480:14): [True: 261, False: 1.51M]
  ------------------
  481|    261|            ctx.error = error_code::syntax_error;
  482|    261|            return true;
  483|    261|         }
  484|       |
  485|  1.51M|         skip_inline_ws(it, end);
  486|       |
  487|  1.51M|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (487:14): [True: 174, False: 1.51M]
  ------------------
  488|    174|            if constexpr (!AllowEmptyInput) {
  489|    174|               ctx.error = error_code::unexpected_end;
  490|    174|            }
  491|    174|            return true;
  492|    174|         }
  493|       |
  494|  1.51M|         if (parse_node_properties<Opts, PropertyPolicy>(std::forward<T>(value), ctx, it, end, preamble.node_props)) {
  ------------------
  |  Branch (494:14): [True: 11.2k, False: 1.50M]
  ------------------
  495|  11.2k|            return true;
  496|  11.2k|         }
  497|       |
  498|  1.50M|         return false;
  499|  1.51M|      }
_ZZN3glz4fromILj450EdE2opITnDaXtlNS_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj1EEERPKcRdTkNS_10is_contextERNS3_12yaml_contextES6_EEvOT1_OT2_OT0_T3_ENKUlNS3_8yaml_tagEE_clESI_:
 2052|  1.51M|         if (yaml::parse_node_preamble<Opts>(value, ctx, it, end, preamble, [](yaml::yaml_tag tag) {
 2053|  1.51M|                if constexpr (std::floating_point<std::remove_cvref_t<T>>) {
 2054|  1.51M|                   return yaml::tag_valid_for_float(tag);
 2055|       |                }
 2056|       |                else {
 2057|       |                   return yaml::tag_valid_for_int(tag);
 2058|       |                }
 2059|  1.51M|             }))
_ZN3glz4yaml21parse_node_propertiesITnDaXtlNS0_9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj1EEEXtlNS0_20node_property_policyELb1EEERdNS0_12yaml_contextEPKcS7_EEbOT1_RT2_RT3_T4_RNS0_19node_property_stateE:
  408|  1.51M|      {
  409|  1.51M|         state.has_anchor = false;
  410|  1.51M|         state.anchor_name.clear();
  411|  1.51M|         state.anchor_start = nullptr;
  412|  1.51M|         state.anchor_indent = ctx.current_indent();
  413|       |
  414|  1.51M|         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.51M|            else {
  421|  1.51M|               if (handle_alias<Opts>(std::forward<T>(value), ctx, it, end)) return true;
  ------------------
  |  Branch (421:20): [True: 10.5k, False: 1.50M]
  ------------------
  422|  1.51M|            }
  423|  1.51M|         }
  424|       |
  425|  1.51M|         if (it != end && *it == '&') {
  ------------------
  |  Branch (425:14): [True: 1.50M, False: 10.5k]
  |  Branch (425:27): [True: 12.6k, False: 1.49M]
  ------------------
  426|  12.6k|            ++it;
  427|  12.6k|            auto name = parse_anchor_name(it, end);
  428|  12.6k|            if (name.empty()) {
  ------------------
  |  Branch (428:17): [True: 453, False: 12.1k]
  ------------------
  429|    453|               ctx.error = error_code::syntax_error;
  430|    453|               return true;
  431|    453|            }
  432|  12.1k|            skip_inline_ws(it, end);
  433|  12.1k|            if (it == end) {
  ------------------
  |  Branch (433:17): [True: 298, False: 11.8k]
  ------------------
  434|    298|               if constexpr (!Policy.allow_empty_after_anchor) {
  435|    298|                  ctx.error = error_code::unexpected_end;
  436|    298|               }
  437|    298|               return true;
  438|    298|            }
  439|       |            if constexpr (Policy.disallow_anchor_on_alias) {
  440|       |               if (*it == '*') {
  441|       |                  ctx.error = error_code::syntax_error;
  442|       |                  return true;
  443|       |               }
  444|       |            }
  445|  11.8k|            state.has_anchor = true;
  446|  11.8k|            state.anchor_name = std::string(name);
  447|  11.8k|            state.anchor_start = &*it;
  448|  11.8k|         }
  449|       |
  450|  1.51M|         return false;
  451|  1.51M|      }
_ZN3glz4yaml12handle_aliasITnDaXtlNS0_9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj1EEERdNS0_12yaml_contextEPKcS6_EEbOT0_RT1_RT2_T3_:
  300|  1.51M|      {
  301|  1.51M|         if (it == end || *it != '*') return false;
  ------------------
  |  Branch (301:14): [True: 0, False: 1.51M]
  |  Branch (301:27): [True: 1.50M, 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: 261, False: 10.2k]
  ------------------
  306|    261|            ctx.error = error_code::syntax_error;
  307|    261|            return true;
  308|    261|         }
  309|       |
  310|  10.2k|         auto anchor_it = ctx.anchors.find(name);
  311|  10.2k|         if (anchor_it == ctx.anchors.end()) {
  ------------------
  |  Branch (311:14): [True: 821, False: 9.42k]
  ------------------
  312|    821|            ctx.error = error_code::syntax_error; // undefined alias
  313|    821|            return true;
  314|    821|         }
  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.42k|         const auto span = anchor_it->second;
  319|       |
  320|       |         // Empty anchor span (anchor on null/empty node) — leave value as default
  321|  9.42k|         if (span.begin == span.end) {
  ------------------
  |  Branch (321:14): [True: 1.21k, False: 8.21k]
  ------------------
  322|  1.21k|            return true;
  323|  1.21k|         }
  324|       |
  325|       |         // An anchor is invisible to itself while it expands. A span that aliases the name it
  326|       |         // defines -- reachable because a mapping key's anchor is registered over the key text
  327|       |         // before that text is parsed -- would otherwise replay itself forever.
  328|  8.21k|         if (ctx.alias_span_is_replaying(span.begin, span.end)) [[unlikely]] {
  ------------------
  |  Branch (328:14): [True: 9, False: 8.20k]
  ------------------
  329|      9|            ctx.error = error_code::syntax_error; // cyclic alias
  330|      9|            return true;
  331|      9|         }
  332|       |
  333|       |         // Replaying an anchor re-enters the reader directly, bypassing the variant reader's
  334|       |         // depth guard, so this is the only depth accounting a chain of aliases into a
  335|       |         // non-variant target gets. The cycle check above stops the unbounded case; this bounds
  336|       |         // a legitimate but deeply chained one.
  337|  8.20k|         depth_guard guard{ctx, yaml::max_yaml_recursive_depth};
  338|  8.20k|         if (!guard) [[unlikely]]
  ------------------
  |  Branch (338:14): [True: 2, False: 8.19k]
  ------------------
  339|      2|            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: 4.83k, False: 3.36k]
  ------------------
  354|  4.83k|            ctx.push_indent(span.base_indent - 1);
  355|  4.83k|         }
  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|      }
_ZZN3glz4fromILj450EdE2opITnDaXtlNS_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj1EEERPKcRdTkNS_10is_contextERNS3_12yaml_contextES6_EEvOT1_OT2_OT0_T3_ENKUlvE_clEv:
 2062|  1.48M|         auto finalize = [&] { yaml::finalize_node_anchor(preamble.node_props, ctx, it); };
_ZN3glz33process_yaml_variant_alternativesINSt3__17variantIJDndNS1_12basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEbNS1_6vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS6_ISD_EEEENSC_ISD_EEEEENS_20is_yaml_variant_boolEE2opITnDaXtlNS_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj1EEERSH_TkNS_10is_contextERNSL_12yaml_contextERPKcSR_EEvOT0_OT1_OT2_T3_:
 5205|  57.7k|      {
 5206|  57.7k|         constexpr auto category_count = yaml_variant_count_v<Variant, Trait>;
 5207|       |
 5208|       |         if constexpr (category_count == 0) {
 5209|       |            ctx.error = error_code::no_matching_variant_type;
 5210|       |         }
 5211|  57.7k|         else if constexpr (category_count == 1) {
 5212|       |            // Only one type in this category, use it directly
 5213|  57.7k|            constexpr auto first_idx = yaml_variant_first_index_v<Variant, Trait>;
 5214|  57.7k|            using V = std::variant_alternative_t<first_idx, Variant>;
 5215|  57.7k|            if (!std::holds_alternative<V>(value)) value = V{};
  ------------------
  |  Branch (5215:17): [True: 57.7k, False: 0]
  ------------------
 5216|  57.7k|            from<YAML, V>::template op<Opts>(std::get<V>(value), ctx, it, end);
 5217|       |         }
 5218|       |         else {
 5219|       |            // Multiple types in this category, try each one
 5220|       |            constexpr auto N = std::variant_size_v<Variant>;
 5221|       |            bool found_match{};
 5222|       |            size_t match_idx = 0;
 5223|       |            // Only the last alternative propagates its error, so an alternative that exhausted an
 5224|       |            // expansion budget would otherwise be reported as no_matching_variant_type -- a wrong
 5225|       |            // diagnosis for a document that is hostile rather than merely the wrong shape. Held
 5226|       |            // aside and used only if nothing matched, so an alternative that does succeed later
 5227|       |            // (one that materializes no key text can still parse under a latched budget) is
 5228|       |            // unaffected.
 5229|       |            error_code expansion_error{};
 5230|       |            std::string_view expansion_message{};
 5231|       |
 5232|       |            for_each<N>([&]<size_t I>() {
 5233|       |               if (found_match) {
 5234|       |                  return;
 5235|       |               }
 5236|       |               using V = std::variant_alternative_t<I, Variant>;
 5237|       |               if constexpr (Trait<V>::value) {
 5238|       |                  auto copy_it = it;
 5239|       |                  if (!std::holds_alternative<V>(value)) {
 5240|       |                     value = V{};
 5241|       |                  }
 5242|       |
 5243|       |                  auto temp_ctx = ctx.make_speculative();
 5244|       |                  from<YAML, V>::template op<Opts>(std::get<V>(value), temp_ctx, it, end);
 5245|       |
 5246|       |                  // Charged whether or not the alternative fit: a rejected probe still replayed
 5247|       |                  // whatever aliases it reached, and an attempt that is never billed is an
 5248|       |                  // attempt that can be repeated for free.
 5249|       |                  ctx.alias_expansion_budget = temp_ctx.alias_expansion_budget;
 5250|       |                  ctx.key_expansion_budget = temp_ctx.key_expansion_budget;
 5251|       |
 5252|       |                  if (!bool(temp_ctx.error)) {
 5253|       |                     found_match = true;
 5254|       |                     ctx.anchors = std::move(temp_ctx.anchors);
 5255|       |                  }
 5256|       |                  else {
 5257|       |                     it = copy_it;
 5258|       |                     if (temp_ctx.error == error_code::exceeded_max_expansion && expansion_error == error_code::none) {
 5259|       |                        expansion_error = temp_ctx.error;
 5260|       |                        expansion_message = temp_ctx.custom_error_message;
 5261|       |                     }
 5262|       |                     if (match_idx + 1 < category_count) {
 5263|       |                        // Not the last type, continue trying
 5264|       |                     }
 5265|       |                     else {
 5266|       |                        // Last type failed, propagate error
 5267|       |                        ctx.error = temp_ctx.error;
 5268|       |                        ctx.custom_error_message = temp_ctx.custom_error_message;
 5269|       |                     }
 5270|       |                  }
 5271|       |                  ++match_idx;
 5272|       |               }
 5273|       |            });
 5274|       |
 5275|       |            if (!found_match && !bool(ctx.error)) {
 5276|       |               if (expansion_error != error_code::none) {
 5277|       |                  ctx.error = expansion_error;
 5278|       |                  ctx.custom_error_message = expansion_message;
 5279|       |               }
 5280|       |               else {
 5281|       |                  ctx.error = error_code::no_matching_variant_type;
 5282|       |               }
 5283|       |            }
 5284|       |         }
 5285|  57.7k|      }
_ZN3glz4fromILj450EbE2opITnDaXtlNS_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj1EEERPKcRbTkNS_10is_contextERNS3_12yaml_contextES6_EEvOT1_OT2_OT0_T3_:
 2012|  76.9k|      {
 2013|  76.9k|         if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2013:14): [True: 0, False: 76.9k]
  ------------------
 2014|      0|            return;
 2015|       |
 2016|  76.9k|         yaml::node_preamble_state preamble{};
 2017|  76.9k|         if (yaml::parse_node_preamble<Opts>(value, ctx, it, end, preamble,
  ------------------
  |  Branch (2017:14): [True: 20.5k, False: 56.3k]
  ------------------
 2018|  76.9k|                                             [](yaml::yaml_tag tag) { return yaml::tag_valid_for_bool(tag); }))
 2019|  20.5k|            return;
 2020|       |
 2021|       |         // Parse as plain scalar first
 2022|  56.3k|         std::string str;
 2023|  56.3k|         yaml::parse_plain_scalar(str, ctx, it, end, yaml::check_flow_context(Opts));
 2024|       |
 2025|  56.3k|         if (str == "true" || str == "True" || str == "TRUE" || str == "yes" || str == "Yes" || str == "YES" ||
  ------------------
  |  Branch (2025:14): [True: 6.03k, False: 50.3k]
  |  Branch (2025:31): [True: 1.51k, False: 48.8k]
  |  Branch (2025:48): [True: 1.51k, False: 47.3k]
  |  Branch (2025:65): [True: 804, False: 46.5k]
  |  Branch (2025:81): [True: 4.51k, False: 41.9k]
  |  Branch (2025:97): [True: 2.22k, False: 39.7k]
  ------------------
 2026|  39.7k|             str == "on" || str == "On" || str == "ON") {
  ------------------
  |  Branch (2026:14): [True: 2.13k, False: 37.6k]
  |  Branch (2026:29): [True: 609, False: 37.0k]
  |  Branch (2026:44): [True: 891, False: 36.1k]
  ------------------
 2027|  20.2k|            value = true;
 2028|  20.2k|         }
 2029|  36.1k|         else if (str == "false" || str == "False" || str == "FALSE" || str == "no" || str == "No" || str == "NO" ||
  ------------------
  |  Branch (2029:19): [True: 23.5k, False: 12.5k]
  |  Branch (2029:37): [True: 687, False: 11.9k]
  |  Branch (2029:55): [True: 6.21k, False: 5.68k]
  |  Branch (2029:73): [True: 884, False: 4.80k]
  |  Branch (2029:88): [True: 944, False: 3.85k]
  |  Branch (2029:103): [True: 1.32k, False: 2.53k]
  ------------------
 2030|  35.8k|                  str == "off" || str == "Off" || str == "OFF") {
  ------------------
  |  Branch (2030:19): [True: 907, False: 1.63k]
  |  Branch (2030:35): [True: 729, False: 901]
  |  Branch (2030:51): [True: 588, False: 313]
  ------------------
 2031|  35.8k|            value = false;
 2032|  35.8k|         }
 2033|    313|         else {
 2034|    313|            ctx.error = error_code::expected_true_or_false;
 2035|    313|         }
 2036|       |
 2037|  56.3k|         yaml::finalize_node_anchor(preamble.node_props, ctx, it);
 2038|  56.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|  76.9k|      {
  466|  76.9k|         skip_inline_ws(it, end);
  467|       |
  468|  76.9k|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (468:14): [True: 5, False: 76.9k]
  ------------------
  469|      5|            if constexpr (!AllowEmptyInput) {
  470|      5|               ctx.error = error_code::unexpected_end;
  471|      5|            }
  472|      5|            return true;
  473|      5|         }
  474|       |
  475|  76.9k|         preamble.tag = parse_yaml_tag(it, end, ctx);
  476|  76.9k|         if (preamble.tag == yaml_tag::unknown) [[unlikely]] {
  ------------------
  |  Branch (476:14): [True: 5, False: 76.9k]
  ------------------
  477|      5|            ctx.error = error_code::syntax_error;
  478|      5|            return true;
  479|      5|         }
  480|  76.9k|         if (!tag_validator(preamble.tag)) [[unlikely]] {
  ------------------
  |  Branch (480:14): [True: 3, False: 76.9k]
  ------------------
  481|      3|            ctx.error = error_code::syntax_error;
  482|      3|            return true;
  483|      3|         }
  484|       |
  485|  76.9k|         skip_inline_ws(it, end);
  486|       |
  487|  76.9k|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (487:14): [True: 3, False: 76.9k]
  ------------------
  488|      3|            if constexpr (!AllowEmptyInput) {
  489|      3|               ctx.error = error_code::unexpected_end;
  490|      3|            }
  491|      3|            return true;
  492|      3|         }
  493|       |
  494|  76.9k|         if (parse_node_properties<Opts, PropertyPolicy>(std::forward<T>(value), ctx, it, end, preamble.node_props)) {
  ------------------
  |  Branch (494:14): [True: 20.5k, False: 56.3k]
  ------------------
  495|  20.5k|            return true;
  496|  20.5k|         }
  497|       |
  498|  56.3k|         return false;
  499|  76.9k|      }
_ZZN3glz4fromILj450EbE2opITnDaXtlNS_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj1EEERPKcRbTkNS_10is_contextERNS3_12yaml_contextES6_EEvOT1_OT2_OT0_T3_ENKUlNS3_8yaml_tagEE_clESI_:
 2018|  76.9k|                                             [](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|  76.9k|      {
  409|  76.9k|         state.has_anchor = false;
  410|  76.9k|         state.anchor_name.clear();
  411|  76.9k|         state.anchor_start = nullptr;
  412|  76.9k|         state.anchor_indent = ctx.current_indent();
  413|       |
  414|  76.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|  76.9k|            else {
  421|  76.9k|               if (handle_alias<Opts>(std::forward<T>(value), ctx, it, end)) return true;
  ------------------
  |  Branch (421:20): [True: 20.5k, False: 56.4k]
  ------------------
  422|  76.9k|            }
  423|  76.9k|         }
  424|       |
  425|  76.9k|         if (it != end && *it == '&') {
  ------------------
  |  Branch (425:14): [True: 56.4k, False: 20.5k]
  |  Branch (425:27): [True: 15.8k, False: 40.5k]
  ------------------
  426|  15.8k|            ++it;
  427|  15.8k|            auto name = parse_anchor_name(it, end);
  428|  15.8k|            if (name.empty()) {
  ------------------
  |  Branch (428:17): [True: 5, False: 15.8k]
  ------------------
  429|      5|               ctx.error = error_code::syntax_error;
  430|      5|               return true;
  431|      5|            }
  432|  15.8k|            skip_inline_ws(it, end);
  433|  15.8k|            if (it == end) {
  ------------------
  |  Branch (433:17): [True: 27, False: 15.8k]
  ------------------
  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|  15.8k|            state.has_anchor = true;
  446|  15.8k|            state.anchor_name = std::string(name);
  447|  15.8k|            state.anchor_start = &*it;
  448|  15.8k|         }
  449|       |
  450|  76.9k|         return false;
  451|  76.9k|      }
_ZN3glz4yaml12handle_aliasITnDaXtlNS0_9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj1EEERbNS0_12yaml_contextEPKcS6_EEbOT0_RT1_RT2_T3_:
  300|  76.9k|      {
  301|  76.9k|         if (it == end || *it != '*') return false;
  ------------------
  |  Branch (301:14): [True: 0, False: 76.9k]
  |  Branch (301:27): [True: 56.4k, False: 20.5k]
  ------------------
  302|       |
  303|  20.5k|         ++it; // skip '*'
  304|  20.5k|         auto name = parse_anchor_name(it, end);
  305|  20.5k|         if (name.empty()) {
  ------------------
  |  Branch (305:14): [True: 14, False: 20.5k]
  ------------------
  306|     14|            ctx.error = error_code::syntax_error;
  307|     14|            return true;
  308|     14|         }
  309|       |
  310|  20.5k|         auto anchor_it = ctx.anchors.find(name);
  311|  20.5k|         if (anchor_it == ctx.anchors.end()) {
  ------------------
  |  Branch (311:14): [True: 49, False: 20.4k]
  ------------------
  312|     49|            ctx.error = error_code::syntax_error; // undefined alias
  313|     49|            return true;
  314|     49|         }
  315|       |
  316|       |         // Copied rather than referenced: the replay below can replace ctx.anchors wholesale
  317|       |         // (a speculative parse hands its own map back), which would dangle a reference here.
  318|  20.4k|         const auto span = anchor_it->second;
  319|       |
  320|       |         // Empty anchor span (anchor on null/empty node) — leave value as default
  321|  20.4k|         if (span.begin == span.end) {
  ------------------
  |  Branch (321:14): [True: 1.20k, False: 19.2k]
  ------------------
  322|  1.20k|            return true;
  323|  1.20k|         }
  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|  19.2k|         if (ctx.alias_span_is_replaying(span.begin, span.end)) [[unlikely]] {
  ------------------
  |  Branch (328:14): [True: 11, False: 19.2k]
  ------------------
  329|     11|            ctx.error = error_code::syntax_error; // cyclic alias
  330|     11|            return true;
  331|     11|         }
  332|       |
  333|       |         // Replaying an anchor re-enters the reader directly, bypassing the variant reader's
  334|       |         // depth guard, so this is the only depth accounting a chain of aliases into a
  335|       |         // non-variant target gets. The cycle check above stops the unbounded case; this bounds
  336|       |         // a legitimate but deeply chained one.
  337|  19.2k|         depth_guard guard{ctx, yaml::max_yaml_recursive_depth};
  338|  19.2k|         if (!guard) [[unlikely]]
  ------------------
  |  Branch (338:14): [True: 0, False: 19.2k]
  ------------------
  339|      0|            return true;
  340|       |
  341|  19.2k|         if (!ctx.charge_alias_expansion(static_cast<size_t>(span.end - span.begin))) [[unlikely]] {
  ------------------
  |  Branch (341:14): [True: 0, False: 19.2k]
  ------------------
  342|      0|            ctx.error = error_code::exceeded_max_expansion;
  343|      0|            ctx.custom_error_message = "alias expansion";
  344|      0|            return true;
  345|      0|         }
  346|       |
  347|  19.2k|         auto replay_it = span.begin;
  348|  19.2k|         auto replay_end = span.end;
  349|       |
  350|       |         // Save indent context and set up for replay
  351|  19.2k|         auto saved_indent_stack = std::move(ctx.indent_stack);
  352|  19.2k|         ctx.indent_stack.clear();
  353|  19.2k|         if (span.base_indent > 0) {
  ------------------
  |  Branch (353:14): [True: 667, False: 18.5k]
  ------------------
  354|    667|            ctx.push_indent(span.base_indent - 1);
  355|    667|         }
  356|       |
  357|  19.2k|         ctx.active_alias_spans.emplace_back(span.begin, span.end);
  358|       |
  359|  19.2k|         using V = std::remove_cvref_t<T>;
  360|  19.2k|         from<YAML, V>::template op<Opts>(std::forward<T>(value), ctx, replay_it, replay_end);
  361|       |
  362|  19.2k|         ctx.active_alias_spans.pop_back();
  363|       |
  364|       |         // Restore indent context
  365|  19.2k|         ctx.indent_stack = std::move(saved_indent_stack);
  366|  19.2k|         return true;
  367|  19.2k|      }
_ZN3glz4fromILj450EDnE2opITnDaXtlNS_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj1EEERPKcRDnTkNS_10is_contextERNS3_12yaml_contextES6_EEvOT1_OT2_OT0_T3_:
 2398|  25.2k|      {
 2399|  25.2k|         if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2399:14): [True: 0, False: 25.2k]
  ------------------
 2400|      0|            return;
 2401|       |
 2402|  25.2k|         yaml::skip_inline_ws(it, end);
 2403|       |
 2404|  25.2k|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (2404:14): [True: 4, False: 25.2k]
  ------------------
 2405|      4|            ctx.error = error_code::unexpected_end;
 2406|      4|            return;
 2407|      4|         }
 2408|       |
 2409|       |         // Check for null values: null, Null, NULL, ~
 2410|  25.2k|         if (*it == '~') {
  ------------------
  |  Branch (2410:14): [True: 2.73k, False: 22.4k]
  ------------------
 2411|  2.73k|            ++it;
 2412|  2.73k|            return;
 2413|  2.73k|         }
 2414|       |
 2415|       |         // Parse as plain scalar and check if it's a null keyword
 2416|  22.4k|         auto start = it;
 2417|   201k|         while (it != end && !yaml::plain_scalar_end_table[static_cast<uint8_t>(*it)]) {
  ------------------
  |  Branch (2417:17): [True: 200k, False: 710]
  |  Branch (2417:30): [True: 178k, False: 21.7k]
  ------------------
 2418|   178k|            ++it;
 2419|   178k|         }
 2420|       |
 2421|  22.4k|         std::string_view str{start, static_cast<size_t>(it - start)};
 2422|  22.4k|         if (!yaml::is_yaml_null(str)) {
  ------------------
  |  Branch (2422:14): [True: 89, False: 22.3k]
  ------------------
 2423|     89|            ctx.error = error_code::syntax_error;
 2424|     89|         }
 2425|  22.4k|      }
_ZN3glz33process_yaml_variant_alternativesINSt3__17variantIJDndNS1_12basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEbNS1_6vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS6_ISD_EEEENSC_ISD_EEEEENS_22is_yaml_variant_objectEE2opITnDaXtlNS_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj1EEERSH_TkNS_10is_contextERNSL_12yaml_contextERPKcSR_EEvOT0_OT1_OT2_T3_:
 5205|  2.40M|      {
 5206|  2.40M|         constexpr auto category_count = yaml_variant_count_v<Variant, Trait>;
 5207|       |
 5208|       |         if constexpr (category_count == 0) {
 5209|       |            ctx.error = error_code::no_matching_variant_type;
 5210|       |         }
 5211|  2.40M|         else if constexpr (category_count == 1) {
 5212|       |            // Only one type in this category, use it directly
 5213|  2.40M|            constexpr auto first_idx = yaml_variant_first_index_v<Variant, Trait>;
 5214|  2.40M|            using V = std::variant_alternative_t<first_idx, Variant>;
 5215|  2.40M|            if (!std::holds_alternative<V>(value)) value = V{};
  ------------------
  |  Branch (5215:17): [True: 2.40M, False: 0]
  ------------------
 5216|  2.40M|            from<YAML, V>::template op<Opts>(std::get<V>(value), ctx, it, end);
 5217|       |         }
 5218|       |         else {
 5219|       |            // Multiple types in this category, try each one
 5220|       |            constexpr auto N = std::variant_size_v<Variant>;
 5221|       |            bool found_match{};
 5222|       |            size_t match_idx = 0;
 5223|       |            // Only the last alternative propagates its error, so an alternative that exhausted an
 5224|       |            // expansion budget would otherwise be reported as no_matching_variant_type -- a wrong
 5225|       |            // diagnosis for a document that is hostile rather than merely the wrong shape. Held
 5226|       |            // aside and used only if nothing matched, so an alternative that does succeed later
 5227|       |            // (one that materializes no key text can still parse under a latched budget) is
 5228|       |            // unaffected.
 5229|       |            error_code expansion_error{};
 5230|       |            std::string_view expansion_message{};
 5231|       |
 5232|       |            for_each<N>([&]<size_t I>() {
 5233|       |               if (found_match) {
 5234|       |                  return;
 5235|       |               }
 5236|       |               using V = std::variant_alternative_t<I, Variant>;
 5237|       |               if constexpr (Trait<V>::value) {
 5238|       |                  auto copy_it = it;
 5239|       |                  if (!std::holds_alternative<V>(value)) {
 5240|       |                     value = V{};
 5241|       |                  }
 5242|       |
 5243|       |                  auto temp_ctx = ctx.make_speculative();
 5244|       |                  from<YAML, V>::template op<Opts>(std::get<V>(value), temp_ctx, it, end);
 5245|       |
 5246|       |                  // Charged whether or not the alternative fit: a rejected probe still replayed
 5247|       |                  // whatever aliases it reached, and an attempt that is never billed is an
 5248|       |                  // attempt that can be repeated for free.
 5249|       |                  ctx.alias_expansion_budget = temp_ctx.alias_expansion_budget;
 5250|       |                  ctx.key_expansion_budget = temp_ctx.key_expansion_budget;
 5251|       |
 5252|       |                  if (!bool(temp_ctx.error)) {
 5253|       |                     found_match = true;
 5254|       |                     ctx.anchors = std::move(temp_ctx.anchors);
 5255|       |                  }
 5256|       |                  else {
 5257|       |                     it = copy_it;
 5258|       |                     if (temp_ctx.error == error_code::exceeded_max_expansion && expansion_error == error_code::none) {
 5259|       |                        expansion_error = temp_ctx.error;
 5260|       |                        expansion_message = temp_ctx.custom_error_message;
 5261|       |                     }
 5262|       |                     if (match_idx + 1 < category_count) {
 5263|       |                        // Not the last type, continue trying
 5264|       |                     }
 5265|       |                     else {
 5266|       |                        // Last type failed, propagate error
 5267|       |                        ctx.error = temp_ctx.error;
 5268|       |                        ctx.custom_error_message = temp_ctx.custom_error_message;
 5269|       |                     }
 5270|       |                  }
 5271|       |                  ++match_idx;
 5272|       |               }
 5273|       |            });
 5274|       |
 5275|       |            if (!found_match && !bool(ctx.error)) {
 5276|       |               if (expansion_error != error_code::none) {
 5277|       |                  ctx.error = expansion_error;
 5278|       |                  ctx.custom_error_message = expansion_message;
 5279|       |               }
 5280|       |               else {
 5281|       |                  ctx.error = error_code::no_matching_variant_type;
 5282|       |               }
 5283|       |            }
 5284|       |         }
 5285|  2.40M|      }
_ZN3glz4fromILj450ENS_17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES1_EEEEE2opITnDaXtlNS_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj1EEERPKcRS5_TkNS_10is_contextERNS8_12yaml_contextESB_EEvOT1_OT2_OT0_T3_:
 4515|  2.45M|      {
 4516|  2.45M|         if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4516:14): [True: 0, False: 2.45M]
  ------------------
 4517|      0|            return;
 4518|       |
 4519|  2.45M|         yaml::node_preamble_state preamble{};
 4520|  2.45M|         if (yaml::parse_node_preamble<Opts, yaml::node_property_policy{true, true, false, false}>(
  ------------------
  |  Branch (4520:14): [True: 43.8k, False: 2.40M]
  ------------------
 4521|  2.45M|                value, ctx, it, end, preamble, [](yaml::yaml_tag tag) { return yaml::tag_valid_for_map(tag); }))
 4522|  43.8k|            return;
 4523|       |
 4524|  2.40M|         using key_t = typename std::remove_cvref_t<T>::key_type;
 4525|  2.40M|         using val_t = typename std::remove_cvref_t<T>::mapped_type;
 4526|       |
 4527|       |         // Reading a YAML mapping MERGES into the target: an entry overwrites the
 4528|       |         // value of a key that existed before the read and adds new keys, while
 4529|       |         // pre-existing keys the document does not mention are preserved (like a
 4530|       |         // struct/object read, and like json/read.hpp's per-key value[key]).
 4531|       |         // Within a single document a repeated key keeps its FIRST value -- YAML
 4532|       |         // mappings disallow duplicate keys and the conformance suite expects
 4533|       |         // first-wins, which falls out of emplace into an empty map. Any
 4534|       |         // pre-existing entry the document leaves untouched is restored on scope
 4535|       |         // exit (including error paths). When the target starts empty (the common
 4536|       |         // case) this is a no-op with negligible cost.
 4537|  2.40M|         std::remove_cvref_t<T> preexisting_entries;
 4538|  2.40M|         if (!value.empty()) {
  ------------------
  |  Branch (4538:14): [True: 0, False: 2.40M]
  ------------------
 4539|      0|            preexisting_entries = std::move(value);
 4540|      0|            value.clear();
 4541|      0|         }
 4542|  2.40M|         struct merge_restore_guard
 4543|  2.40M|         {
 4544|  2.40M|            std::remove_cvref_t<T>& target;
 4545|  2.40M|            std::remove_cvref_t<T>& saved;
 4546|  2.40M|            ~merge_restore_guard()
 4547|  2.40M|            {
 4548|       |               // emplace is a no-op for keys the document already wrote, so only
 4549|       |               // untouched pre-existing entries are put back.
 4550|  2.40M|               for (auto& entry : saved) {
 4551|  2.40M|                  target.emplace(entry.first, std::move(entry.second));
 4552|  2.40M|               }
 4553|  2.40M|            }
 4554|  2.40M|         } merge_restore{value, preexisting_entries};
 4555|       |
 4556|  2.40M|         const bool treat_as_block_mapping =
 4557|  2.40M|            !yaml::check_flow_context(Opts) && *it == '{' && yaml::inline_value_has_plain_mapping_indicator(it, end);
  ------------------
  |  Branch (4557:13): [Folded, False: 2.40M]
  |  Branch (4557:48): [True: 0, False: 0]
  |  Branch (4557:62): [True: 0, False: 0]
  ------------------
 4558|       |
 4559|  2.40M|         if (*it == '{' && !treat_as_block_mapping) {
  ------------------
  |  Branch (4559:14): [True: 1.65M, False: 755k]
  |  Branch (4559:28): [True: 0, Folded]
  ------------------
 4560|       |            // Flow mapping
 4561|  1.65M|            ++it;
 4562|       |            // Skip whitespace and newlines after opening brace
 4563|  1.65M|            yaml::skip_ws_and_newlines(it, end);
 4564|       |
 4565|  1.65M|            if (it != end && *it == '}') {
  ------------------
  |  Branch (4565:17): [True: 1.65M, False: 1.47k]
  |  Branch (4565:30): [True: 29.0k, False: 1.62M]
  ------------------
 4566|  29.0k|               ++it;
 4567|  29.0k|               yaml::validate_flow_node_adjacent_tail(ctx, it, end);
 4568|  29.0k|               if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4568:20): [True: 21, False: 29.0k]
  ------------------
 4569|     21|                  return;
 4570|  29.0k|               yaml::finalize_node_anchor(preamble.node_props, ctx, it);
 4571|  29.0k|               return;
 4572|  29.0k|            }
 4573|       |
 4574|  8.29M|            while (it != end) {
  ------------------
  |  Branch (4574:20): [True: 8.29M, False: 4.24k]
  ------------------
 4575|       |               // Skip whitespace and newlines at start of each iteration
 4576|  8.29M|               yaml::skip_ws_and_newlines(it, end);
 4577|       |
 4578|  8.29M|               if (it != end && *it == '}') {
  ------------------
  |  Branch (4578:20): [True: 8.29M, False: 0]
  |  Branch (4578:33): [True: 58.3k, False: 8.23M]
  ------------------
 4579|  58.3k|                  ++it;
 4580|  58.3k|                  yaml::validate_flow_node_adjacent_tail(ctx, it, end);
 4581|  58.3k|                  if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4581:23): [True: 50, False: 58.3k]
  ------------------
 4582|     50|                     return;
 4583|  58.3k|                  break;
 4584|  58.3k|               }
 4585|       |
 4586|  8.23M|               bool explicit_flow_key = false;
 4587|  8.23M|               auto explicit_probe = it;
 4588|  8.23M|               yaml::skip_inline_ws(explicit_probe, end);
 4589|  8.23M|               if (explicit_probe != end && *explicit_probe == '?') {
  ------------------
  |  Branch (4589:20): [True: 8.23M, False: 0]
  |  Branch (4589:45): [True: 145k, False: 8.08M]
  ------------------
 4590|   145k|                  const auto after_q = explicit_probe + 1;
 4591|   145k|                  if (after_q == end || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*after_q)] ||
  ------------------
  |  Branch (4591:23): [True: 9, False: 145k]
  |  Branch (4591:41): [True: 83.5k, False: 61.8k]
  ------------------
 4592|  97.1k|                      *after_q == ',' || *after_q == '}') {
  ------------------
  |  Branch (4592:23): [True: 12.2k, False: 49.5k]
  |  Branch (4592:42): [True: 1.36k, False: 48.1k]
  ------------------
 4593|  97.1k|                     explicit_flow_key = true;
 4594|  97.1k|                     it = explicit_probe + 1;
 4595|  97.1k|                     yaml::skip_flow_ws_and_newlines(ctx, it, end);
 4596|  97.1k|                     if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4596:26): [True: 10, False: 97.1k]
  ------------------
 4597|     10|                        return;
 4598|  97.1k|                  }
 4599|   145k|               }
 4600|       |               // Parse key
 4601|  8.23M|               key_t key{};
 4602|  8.23M|               if constexpr (std::same_as<std::remove_cvref_t<key_t>, std::string>) {
 4603|  8.23M|                  if (explicit_flow_key && it != end && (*it == ':' || *it == ',' || *it == '}')) {
  ------------------
  |  Branch (4603:23): [True: 97.1k, False: 8.13M]
  |  Branch (4603:44): [True: 97.1k, False: 17]
  |  Branch (4603:58): [True: 2.72k, False: 94.4k]
  |  Branch (4603:72): [True: 15.9k, False: 78.4k]
  |  Branch (4603:86): [True: 2.04k, False: 76.3k]
  ------------------
 4604|  20.7k|                     key.clear();
 4605|  20.7k|                  }
 4606|  8.21M|                  else {
 4607|  8.21M|                     auto key_probe = it;
 4608|  8.21M|                     yaml::skip_inline_ws(key_probe, end);
 4609|       |
 4610|       |                     // Use full node parsing only for structurally complex flow keys.
 4611|       |                     // Plain/quoted/alias keys stay on parse_yaml_key() for compatibility.
 4612|  8.21M|                     bool parse_complex_flow_key = false;
 4613|  8.21M|                     if (key_probe != end) {
  ------------------
  |  Branch (4613:26): [True: 8.21M, False: 17]
  ------------------
 4614|  8.21M|                        if (*key_probe == '[' || *key_probe == '{') {
  ------------------
  |  Branch (4614:29): [True: 16.7k, False: 8.19M]
  |  Branch (4614:50): [True: 38.3k, False: 8.15M]
  ------------------
 4615|  55.1k|                           parse_complex_flow_key = true;
 4616|  55.1k|                        }
 4617|  8.15M|                        else if (*key_probe == '&') {
  ------------------
  |  Branch (4617:34): [True: 1.54M, False: 6.61M]
  ------------------
 4618|  1.54M|                           ++key_probe;
 4619|  1.54M|                           yaml::parse_anchor_name(key_probe, end);
 4620|  1.54M|                           yaml::skip_inline_ws(key_probe, end);
 4621|  1.54M|                           if (key_probe != end && (*key_probe == '[' || *key_probe == '{')) {
  ------------------
  |  Branch (4621:32): [True: 1.54M, False: 115]
  |  Branch (4621:53): [True: 10.0k, False: 1.53M]
  |  Branch (4621:74): [True: 334k, False: 1.20M]
  ------------------
 4622|   344k|                              parse_complex_flow_key = true;
 4623|   344k|                           }
 4624|  1.54M|                        }
 4625|  8.21M|                     }
 4626|       |
 4627|  8.21M|                     if (parse_complex_flow_key) {
  ------------------
  |  Branch (4627:26): [True: 399k, False: 7.81M]
  ------------------
 4628|   399k|                        glz::generic key_node{};
 4629|   399k|                        from<YAML, glz::generic>::template op<yaml::flow_context_on<Opts>()>(key_node, ctx, it, end);
 4630|   399k|                        if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4630:29): [True: 18.8k, False: 380k]
  ------------------
 4631|  18.8k|                           return;
 4632|   380k|                        if (!yaml::materialize_key(key, key_node, ctx)) [[unlikely]]
  ------------------
  |  Branch (4632:29): [True: 74, False: 380k]
  ------------------
 4633|     74|                           return;
 4634|   380k|                     }
 4635|  7.81M|                     else {
 4636|  7.81M|                        if (!yaml::parse_yaml_key(key, ctx, it, end, true)) {
  ------------------
  |  Branch (4636:29): [True: 9.55k, False: 7.80M]
  ------------------
 4637|  9.55k|                           return;
 4638|  9.55k|                        }
 4639|  7.81M|                     }
 4640|  8.21M|                  }
 4641|       |               }
 4642|       |               else {
 4643|       |                  if (explicit_flow_key && it != end && (*it == ':' || *it == ',' || *it == '}')) {
 4644|       |                     ctx.error = error_code::syntax_error;
 4645|       |                     return;
 4646|       |                  }
 4647|       |                  from<YAML, key_t>::template op<yaml::flow_context_on<Opts>()>(key, ctx, it, end);
 4648|       |                  if (bool(ctx.error)) [[unlikely]]
 4649|       |                     return;
 4650|       |               }
 4651|       |
 4652|       |               // Separation between flow key and ':' may include comments/newlines.
 4653|       |               // In flow context, newlines are allowed between key and ':'.
 4654|  8.20M|               yaml::skip_flow_ws_and_newlines(ctx, it, end);
 4655|  8.23M|               if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4655:20): [True: 37, False: 8.23M]
  ------------------
 4656|     37|                  return;
 4657|       |
 4658|  8.23M|               auto parse_implicit_null = [&](val_t& val) -> bool {
 4659|  8.23M|                  if constexpr (nullable_like<std::remove_cvref_t<val_t>>) {
 4660|  8.23M|                     val = {};
 4661|  8.23M|                     return true;
 4662|  8.23M|                  }
 4663|  8.23M|                  else if constexpr (std::same_as<std::remove_cvref_t<val_t>, glz::generic>) {
 4664|  8.23M|                     val = glz::generic{};
 4665|  8.23M|                     return true;
 4666|  8.23M|                  }
 4667|  8.23M|                  else {
 4668|  8.23M|                     static constexpr std::string_view null_value{"null"};
 4669|  8.23M|                     auto null_it = null_value.data();
 4670|  8.23M|                     from<YAML, val_t>::template op<yaml::flow_context_on<Opts>()>(
 4671|  8.23M|                        val, ctx, null_it, null_value.data() + null_value.size());
 4672|  8.23M|                     return !bool(ctx.error);
 4673|  8.23M|                  }
 4674|  8.23M|               };
 4675|       |
 4676|  8.23M|               if (it != end && (*it == ',' || *it == '}')) {
  ------------------
  |  Branch (4676:20): [True: 8.20M, False: 32.3k]
  |  Branch (4676:34): [True: 4.74M, False: 3.45M]
  |  Branch (4676:48): [True: 283k, False: 3.16M]
  ------------------
 4677|  5.03M|                  val_t val{};
 4678|  5.03M|                  if (!parse_implicit_null(val)) [[unlikely]]
  ------------------
  |  Branch (4678:23): [True: 0, False: 5.03M]
  ------------------
 4679|      0|                     return;
 4680|       |
 4681|  5.03M|                  value.emplace(std::move(key), std::move(val));
 4682|       |
 4683|  5.03M|                  if (*it == '}') {
  ------------------
  |  Branch (4683:23): [True: 283k, False: 4.74M]
  ------------------
 4684|   283k|                     ++it;
 4685|   283k|                     yaml::validate_flow_node_adjacent_tail(ctx, it, end);
 4686|   283k|                     if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4686:26): [True: 291, False: 283k]
  ------------------
 4687|    291|                        return;
 4688|   283k|                     break;
 4689|   283k|                  }
 4690|       |
 4691|  4.74M|                  ++it; // skip comma
 4692|  4.74M|                  yaml::skip_ws_and_newlines(it, end);
 4693|  4.74M|                  continue;
 4694|  5.03M|               }
 4695|       |
 4696|  3.20M|               if (it == end || *it != ':') {
  ------------------
  |  Branch (4696:20): [True: 32.3k, False: 3.16M]
  |  Branch (4696:33): [True: 1.74k, False: 3.16M]
  ------------------
 4697|  5.60k|                  ctx.error = error_code::syntax_error;
 4698|  5.60k|                  return;
 4699|  5.60k|               }
 4700|  3.19M|               ++it;
 4701|       |
 4702|  3.19M|               yaml::skip_flow_ws_and_newlines(ctx, it, end);
 4703|  3.19M|               if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4703:20): [True: 33, False: 3.19M]
  ------------------
 4704|     33|                  return;
 4705|       |
 4706|       |               // Omitted value after an explicit ':' maps to an implicit null.
 4707|  3.19M|               if (it != end && (*it == ',' || *it == '}')) {
  ------------------
  |  Branch (4707:20): [True: 3.16M, False: 28.6k]
  |  Branch (4707:34): [True: 335k, False: 2.83M]
  |  Branch (4707:48): [True: 26.0k, False: 2.80M]
  ------------------
 4708|   361k|                  val_t val{};
 4709|   361k|                  if (!parse_implicit_null(val)) [[unlikely]]
  ------------------
  |  Branch (4709:23): [True: 0, False: 361k]
  ------------------
 4710|      0|                     return;
 4711|       |
 4712|   361k|                  value.emplace(std::move(key), std::move(val));
 4713|       |
 4714|   361k|                  if (*it == '}') {
  ------------------
  |  Branch (4714:23): [True: 26.0k, False: 335k]
  ------------------
 4715|  26.0k|                     ++it;
 4716|  26.0k|                     yaml::validate_flow_node_adjacent_tail(ctx, it, end);
 4717|  26.0k|                     if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4717:26): [True: 19, False: 25.9k]
  ------------------
 4718|     19|                        return;
 4719|  25.9k|                     break;
 4720|  26.0k|                  }
 4721|       |
 4722|   335k|                  ++it; // skip comma
 4723|   335k|                  yaml::skip_ws_and_newlines(it, end);
 4724|   335k|                  continue;
 4725|   361k|               }
 4726|       |
 4727|       |               // Parse value
 4728|  2.83M|               val_t val{};
 4729|  2.83M|               from<YAML, val_t>::template op<yaml::flow_context_on<Opts>()>(val, ctx, it, end);
 4730|  2.83M|               if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4730:20): [True: 6.48k, False: 2.82M]
  ------------------
 4731|  6.48k|                  return;
 4732|       |
 4733|  2.82M|               value.emplace(std::move(key), std::move(val));
 4734|       |
 4735|  2.82M|               yaml::skip_inline_ws(it, end);
 4736|       |
 4737|  2.82M|               if (it != end && *it == '}') {
  ------------------
  |  Branch (4737:20): [True: 2.79M, False: 29.1k]
  |  Branch (4737:33): [True: 1.14M, False: 1.64M]
  ------------------
 4738|  1.14M|                  ++it;
 4739|  1.14M|                  yaml::validate_flow_node_adjacent_tail(ctx, it, end);
 4740|  1.14M|                  if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4740:23): [True: 316, False: 1.14M]
  ------------------
 4741|    316|                     return;
 4742|  1.14M|                  break;
 4743|  1.14M|               }
 4744|  1.67M|               else if (it != end && *it == ',') {
  ------------------
  |  Branch (4744:25): [True: 1.64M, False: 29.1k]
  |  Branch (4744:38): [True: 1.48M, False: 165k]
  ------------------
 4745|  1.48M|                  ++it;
 4746|       |                  // Skip whitespace and newlines after comma
 4747|  1.48M|                  yaml::skip_ws_and_newlines(it, end);
 4748|  1.48M|               }
 4749|   194k|               else if (it != end && (*it == '\n' || *it == '\r')) {
  ------------------
  |  Branch (4749:25): [True: 165k, False: 29.1k]
  |  Branch (4749:39): [True: 76.6k, False: 88.9k]
  |  Branch (4749:54): [True: 88.2k, False: 649]
  ------------------
 4750|       |                  // Newlines may precede either the closing brace or the
 4751|       |                  // separator comma for the next entry.
 4752|   164k|                  yaml::skip_ws_and_newlines(it, end);
 4753|   164k|                  if (it != end && *it == '}') {
  ------------------
  |  Branch (4753:23): [True: 164k, False: 41]
  |  Branch (4753:36): [True: 60.5k, False: 104k]
  ------------------
 4754|  60.5k|                     ++it;
 4755|  60.5k|                     yaml::validate_flow_node_adjacent_tail(ctx, it, end);
 4756|  60.5k|                     if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4756:26): [True: 32, False: 60.5k]
  ------------------
 4757|     32|                        return;
 4758|  60.5k|                     break;
 4759|  60.5k|                  }
 4760|   104k|                  if (it != end && *it == ',') {
  ------------------
  |  Branch (4760:23): [True: 104k, False: 41]
  |  Branch (4760:36): [True: 104k, False: 190]
  ------------------
 4761|   104k|                     ++it;
 4762|   104k|                     yaml::skip_ws_and_newlines(it, end);
 4763|   104k|                     continue;
 4764|   104k|                  }
 4765|    231|                  ctx.error = error_code::syntax_error;
 4766|    231|                  return;
 4767|   104k|               }
 4768|  29.7k|               else {
 4769|  29.7k|                  ctx.error = error_code::syntax_error;
 4770|  29.7k|                  return;
 4771|  29.7k|               }
 4772|  2.82M|            }
 4773|  1.62M|         }
 4774|   755k|         else {
 4775|       |            // Block mapping - use shared loop with map-specific callback
 4776|   755k|            yaml::parse_block_mapping_loop<Opts>(
 4777|   755k|               ctx, it, end, int32_t(-1), [&](auto& ctx, auto& it, auto end, int32_t line_indent) -> bool {
 4778|   755k|                  auto parse_map_value = [&](val_t& val) -> bool {
 4779|   755k|                     if (it != end && !yaml::line_end_or_comment_table[static_cast<uint8_t>(*it)]) {
 4780|   755k|                        bool line_starts_with_explicit_value_indicator = false;
 4781|       |
 4782|       |                        // Inline mapping values in block context cannot start with a
 4783|       |                        // plain "key: value" pair on the same line (e.g. "a: b: c").
 4784|       |                        // Such constructs are malformed unless wrapped in flow
 4785|       |                        // delimiters ({...} / [...]) or quoted.
 4786|   755k|                        if constexpr (std::is_pointer_v<std::decay_t<decltype(it)>>) {
 4787|   755k|                           if (ctx.stream_begin) {
 4788|   755k|                              auto is_line_content_start = [&](auto pos) {
 4789|   755k|                                 return !ctx.line_prefix_before(pos).has_content;
 4790|   755k|                              };
 4791|       |
 4792|   755k|                              auto line_has_explicit_value_indicator = [&](auto pos) {
 4793|   755k|                                 const char* line = ctx.line_begin_of(pos);
 4794|   755k|                                 while (line != end && (*line == ' ' || *line == '\t')) ++line;
 4795|   755k|                                 return line != end && *line == ':';
 4796|   755k|                              };
 4797|       |
 4798|   755k|                              if (!is_line_content_start(it) &&
 4799|   755k|                                  yaml::inline_value_has_plain_mapping_indicator(it, end) &&
 4800|   755k|                                  !line_has_explicit_value_indicator(it)) {
 4801|   755k|                                 ctx.error = error_code::syntax_error;
 4802|   755k|                                 return false;
 4803|   755k|                              }
 4804|   755k|                              line_starts_with_explicit_value_indicator = line_has_explicit_value_indicator(it);
 4805|   755k|                           }
 4806|   755k|                        }
 4807|       |
 4808|   755k|                        if (*it == '-' &&
 4809|   755k|                            ((it + 1) == end || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*(it + 1))]) &&
 4810|   755k|                            !line_starts_with_explicit_value_indicator) {
 4811|       |                           // "key: - item" is not valid block sequence syntax.
 4812|   755k|                           ctx.error = error_code::syntax_error;
 4813|   755k|                           return false;
 4814|   755k|                        }
 4815|       |
 4816|   755k|                        if (!ctx.push_indent(line_indent + 1)) [[unlikely]]
 4817|   755k|                           return false;
 4818|   755k|                        from<YAML, val_t>::template op<Opts>(val, ctx, it, end);
 4819|   755k|                        ctx.pop_indent();
 4820|   755k|                     }
 4821|   755k|                     else {
 4822|   755k|                        int32_t nested_indent = yaml::detect_nested_value_indent(ctx, it, end, line_indent);
 4823|   755k|                        if (nested_indent >= 0) {
 4824|   755k|                           yaml::skip_to_content(it, end);
 4825|   755k|                           if (it != end && *it == ':' && (it + 1) != end && *(it + 1) == '\t') {
 4826|   755k|                              ctx.error = error_code::syntax_error;
 4827|   755k|                              return false;
 4828|   755k|                           }
 4829|       |                           // A struct value reads the pushed indent as its own key column;
 4830|       |                           // every other value type reads it as the enclosing baseline.
 4831|   755k|                           const int32_t value_indent =
 4832|   755k|                              yaml::receives_block_mapping_column<val_t>() ? nested_indent : nested_indent - 1;
 4833|   755k|                           if (!ctx.push_indent(value_indent)) [[unlikely]]
 4834|   755k|                              return false;
 4835|   755k|                           from<YAML, val_t>::template op<Opts>(val, ctx, it, end);
 4836|   755k|                           ctx.pop_indent();
 4837|   755k|                        }
 4838|   755k|                     }
 4839|   755k|                     return !bool(ctx.error);
 4840|   755k|                  };
 4841|       |
 4842|       |                  // Explicit key entry form:
 4843|       |                  // ? key
 4844|       |                  // : value
 4845|   755k|                  if (*it == '?' && ((it + 1) != end) && *(it + 1) == '\t') {
 4846|   755k|                     ctx.error = error_code::syntax_error;
 4847|   755k|                     return false;
 4848|   755k|                  }
 4849|   755k|                  if (*it == '?' && ((it + 1) == end || *(it + 1) == ' ' || *(it + 1) == '\n' || *(it + 1) == '\r')) {
 4850|   755k|                     ++it; // skip '?'
 4851|   755k|                     yaml::skip_inline_ws(it, end);
 4852|       |
 4853|   755k|                     const int32_t explicit_value_indicator_indent =
 4854|   755k|                        (ctx.current_indent() < 0) ? 0 : (ctx.current_indent() + 1);
 4855|       |
 4856|   755k|                     key_t key{};
 4857|   755k|                     if constexpr (std::same_as<std::remove_cvref_t<key_t>, std::string>) {
 4858|   755k|                        auto to_string_key = [&](glz::generic& key_node) {
 4859|   755k|                           return yaml::materialize_key(key, key_node, ctx);
 4860|   755k|                        };
 4861|       |
 4862|   755k|                        auto key_it = it;
 4863|   755k|                        yaml::skip_inline_ws(key_it, end);
 4864|       |
 4865|   755k|                        auto content = key_it;
 4866|   755k|                        yaml::skip_to_content(content, end);
 4867|   755k|                        bool handled_anchor_only_empty_key = false;
 4868|       |
 4869|       |                        // Anchor on an empty explicit key node:
 4870|       |                        //   ? &a
 4871|       |                        //   : value
 4872|   755k|                        if (content != end && *content == '&') {
 4873|   755k|                           auto anchor_probe = content + 1;
 4874|   755k|                           auto anchor_name = yaml::parse_anchor_name(anchor_probe, end);
 4875|   755k|                           if (!anchor_name.empty()) {
 4876|   755k|                              auto after_anchor = anchor_probe;
 4877|   755k|                              yaml::skip_inline_ws(after_anchor, end);
 4878|       |
 4879|   755k|                              auto value_indicator = after_anchor;
 4880|   755k|                              if (value_indicator != end && *value_indicator == ':') {
 4881|   755k|                                 key.clear();
 4882|   755k|                                 ctx.anchors[std::string(anchor_name)] = {content, content, ctx.current_indent()};
 4883|   755k|                                 it = value_indicator;
 4884|   755k|                                 handled_anchor_only_empty_key = true;
 4885|   755k|                              }
 4886|   755k|                              else {
 4887|   755k|                                 if (value_indicator != end && *value_indicator == '#') {
 4888|   755k|                                    yaml::skip_comment(value_indicator, end);
 4889|   755k|                                 }
 4890|   755k|                                 if (value_indicator != end && (*value_indicator == '\n' || *value_indicator == '\r')) {
 4891|   755k|                                    yaml::skip_newline(value_indicator, end);
 4892|   755k|                                    auto value_line = value_indicator;
 4893|   755k|                                    int32_t value_indent = yaml::measure_indent(value_line, end, ctx);
 4894|   755k|                                    if (bool(ctx.error)) [[unlikely]]
 4895|   755k|                                       return false;
 4896|   755k|                                    if (value_line != end && *value_line == ':' &&
 4897|   755k|                                        value_indent == explicit_value_indicator_indent) {
 4898|   755k|                                       key.clear();
 4899|   755k|                                       ctx.anchors[std::string(anchor_name)] = {content, content, ctx.current_indent()};
 4900|   755k|                                       it = value_line;
 4901|   755k|                                       handled_anchor_only_empty_key = true;
 4902|   755k|                                    }
 4903|   755k|                                    else if (value_line != end && *value_line == ':') {
 4904|       |                                       // In explicit-key form ("? &a"), a following ':'
 4905|       |                                       // starts the outer value indicator only at the same
 4906|       |                                       // indentation. A deeper-indented ': value' is malformed.
 4907|   755k|                                       ctx.error = error_code::syntax_error;
 4908|   755k|                                       return false;
 4909|   755k|                                    }
 4910|   755k|                                 }
 4911|   755k|                              }
 4912|   755k|                           }
 4913|   755k|                        }
 4914|       |
 4915|   755k|                        const bool key_content_spans_lines = [&] {
 4916|   755k|                           auto scan = key_it;
 4917|   755k|                           while (scan != content && scan != end) {
 4918|   755k|                              if (*scan == '\n' || *scan == '\r') return true;
 4919|   755k|                              ++scan;
 4920|   755k|                           }
 4921|   755k|                           return false;
 4922|   755k|                        }();
 4923|       |
 4924|   755k|                        if (handled_anchor_only_empty_key) {
 4925|       |                           // 'it' already points to the explicit value indicator ':'
 4926|   755k|                        }
 4927|   755k|                        else if (content == end || (*content == ':' && key_content_spans_lines)) {
 4928|   755k|                           key.clear();
 4929|   755k|                           it = content;
 4930|   755k|                        }
 4931|   755k|                        else {
 4932|       |                           // Explicit mapping keys ('? key-node') are full YAML nodes.
 4933|       |                           // Parse the key node structurally (not via plain-key scanning)
 4934|       |                           // so inputs like '? []: x' and '? JSON: like' are interpreted
 4935|       |                           // as complex keys, not split into implicit key/value pairs.
 4936|   755k|                           auto key_node_it = content;
 4937|   755k|                           auto key_node_end = end;
 4938|   755k|                           if constexpr (std::is_pointer_v<std::decay_t<It>>) {
 4939|       |                              // In explicit-key form, a following standalone ':'
 4940|       |                              // line (same or lower indentation) belongs to the
 4941|       |                              // outer mapping value, not the key node itself.
 4942|   755k|                              auto scan = content;
 4943|   755k|                              while (scan != end) {
 4944|   755k|                                 while (scan != end && *scan != '\n' && *scan != '\r') {
 4945|   755k|                                    ++scan;
 4946|   755k|                                 }
 4947|   755k|                                 if (scan == end) {
 4948|   755k|                                    break;
 4949|   755k|                                 }
 4950|       |
 4951|   755k|                                 yaml::skip_newline(scan, end);
 4952|   755k|                                 auto line_start = scan;
 4953|       |
 4954|   755k|                                 int32_t indicator_indent = 0;
 4955|   755k|                                 while (scan != end && *scan == ' ') {
 4956|   755k|                                    ++indicator_indent;
 4957|   755k|                                    ++scan;
 4958|   755k|                                 }
 4959|       |
 4960|   755k|                                 if (scan != end && *scan == ':') {
 4961|   755k|                                    const auto after_colon = scan + 1;
 4962|   755k|                                    if ((after_colon == end ||
 4963|   755k|                                         yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*after_colon)]) &&
 4964|   755k|                                        indicator_indent <= line_indent) {
 4965|   755k|                                       key_node_end = line_start;
 4966|   755k|                                       break;
 4967|   755k|                                    }
 4968|   755k|                                 }
 4969|   755k|                              }
 4970|   755k|                           }
 4971|       |
 4972|   755k|                           glz::generic key_node{};
 4973|   755k|                           const bool prev_explicit_mapping_key_context = ctx.explicit_mapping_key_context;
 4974|   755k|                           ctx.explicit_mapping_key_context = true;
 4975|   755k|                           from<YAML, glz::generic>::template op<Opts>(key_node, ctx, key_node_it, key_node_end);
 4976|   755k|                           ctx.explicit_mapping_key_context = prev_explicit_mapping_key_context;
 4977|   755k|                           if (bool(ctx.error)) [[unlikely]]
 4978|   755k|                              return false;
 4979|   755k|                           it = key_node_it;
 4980|   755k|                           if (!to_string_key(key_node)) [[unlikely]]
 4981|   755k|                              return false;
 4982|   755k|                        }
 4983|   755k|                     }
 4984|   755k|                     else {
 4985|   755k|                        if (it != end && !yaml::line_end_or_comment_table[static_cast<uint8_t>(*it)]) {
 4986|   755k|                           from<YAML, key_t>::template op<Opts>(key, ctx, it, end);
 4987|   755k|                           if (bool(ctx.error)) [[unlikely]]
 4988|   755k|                              return false;
 4989|   755k|                        }
 4990|   755k|                     }
 4991|       |
 4992|   755k|                     yaml::skip_inline_ws(it, end);
 4993|   755k|                     yaml::skip_comment(it, end);
 4994|       |
 4995|       |                     // Value indicator may appear on the next line at the same indent.
 4996|   755k|                     if (it != end && (*it == '\n' || *it == '\r')) {
 4997|   755k|                        auto probe = it;
 4998|   755k|                        bool found_value_indicator = false;
 4999|       |
 5000|   755k|                        while (probe != end && (*probe == '\n' || *probe == '\r')) {
 5001|   755k|                           yaml::skip_newline(probe, end);
 5002|       |
 5003|   755k|                           auto value_line = probe;
 5004|   755k|                           int32_t value_indent = yaml::measure_indent(value_line, end, ctx);
 5005|   755k|                           if (bool(ctx.error)) [[unlikely]]
 5006|   755k|                              return false;
 5007|       |
 5008|   755k|                           if (value_line == end || *value_line == '\n' || *value_line == '\r') {
 5009|   755k|                              probe = value_line;
 5010|   755k|                              continue; // blank line
 5011|   755k|                           }
 5012|   755k|                           if (*value_line == '#') {
 5013|   755k|                              yaml::skip_comment(value_line, end);
 5014|   755k|                              probe = value_line;
 5015|   755k|                              continue; // comment-only line
 5016|   755k|                           }
 5017|   755k|                           if (*value_line == ':' && value_indent == explicit_value_indicator_indent) {
 5018|   755k|                              it = value_line;
 5019|   755k|                              found_value_indicator = true;
 5020|   755k|                           }
 5021|   755k|                           break;
 5022|   755k|                        }
 5023|       |
 5024|   755k|                        if (found_value_indicator) {
 5025|   755k|                           yaml::skip_inline_ws(it, end);
 5026|   755k|                        }
 5027|   755k|                     }
 5028|       |
 5029|   755k|                     val_t val{};
 5030|   755k|                     if (it != end && *it == ':') {
 5031|   755k|                        ++it;
 5032|   755k|                        if (it != end && *it == '\t') {
 5033|   755k|                           ctx.error = error_code::syntax_error;
 5034|   755k|                           return false;
 5035|   755k|                        }
 5036|   755k|                        if (it != end && (*it == '\n' || *it == '\r')) {
 5037|   755k|                           auto probe = it;
 5038|   755k|                           yaml::skip_newline(probe, end);
 5039|   755k|                           while (probe != end && *probe == ' ') ++probe;
 5040|   755k|                           if (probe != end && *probe == ':' && ((probe + 1) != end) && *(probe + 1) == '\t') {
 5041|   755k|                              ctx.error = error_code::syntax_error;
 5042|   755k|                              return false;
 5043|   755k|                           }
 5044|   755k|                        }
 5045|   755k|                        yaml::skip_inline_ws(it, end);
 5046|   755k|                        if (!parse_map_value(val)) [[unlikely]]
 5047|   755k|                           return false;
 5048|   755k|                     }
 5049|       |
 5050|   755k|                     value.emplace(std::move(key), std::move(val));
 5051|   755k|                     return true;
 5052|   755k|                  }
 5053|       |
 5054|   755k|                  key_t key{};
 5055|   755k|                  if constexpr (std::same_as<std::remove_cvref_t<key_t>, std::string>) {
 5056|   755k|                     auto key_probe = it;
 5057|   755k|                     yaml::skip_inline_ws(key_probe, end);
 5058|   755k|                     const bool complex_flow_key = (key_probe != end && (*key_probe == '[' || *key_probe == '{'));
 5059|   755k|                     if (complex_flow_key) {
 5060|   755k|                        glz::generic key_node{};
 5061|   755k|                        from<YAML, glz::generic>::template op<yaml::flow_context_on<Opts>()>(key_node, ctx, it, end);
 5062|   755k|                        if (bool(ctx.error)) [[unlikely]]
 5063|   755k|                           return false;
 5064|   755k|                        if (!yaml::materialize_key(key, key_node, ctx)) [[unlikely]]
 5065|   755k|                           return false;
 5066|   755k|                     }
 5067|   755k|                     else {
 5068|   755k|                        if (!yaml::parse_yaml_key(key, ctx, it, end, false)) {
 5069|   755k|                           return false;
 5070|   755k|                        }
 5071|   755k|                     }
 5072|   755k|                  }
 5073|   755k|                  else {
 5074|   755k|                     from<YAML, key_t>::template op<Opts>(key, ctx, it, end);
 5075|   755k|                     if (bool(ctx.error)) [[unlikely]]
 5076|   755k|                        return false;
 5077|   755k|                  }
 5078|       |
 5079|   755k|                  yaml::skip_inline_ws(it, end);
 5080|       |
 5081|   755k|                  if (it == end || *it != ':') {
 5082|   755k|                     ctx.error = error_code::syntax_error;
 5083|   755k|                     return false;
 5084|   755k|                  }
 5085|   755k|                  ++it;
 5086|   755k|                  yaml::skip_inline_ws(it, end);
 5087|       |
 5088|   755k|                  val_t val{};
 5089|   755k|                  if (!parse_map_value(val)) [[unlikely]]
 5090|   755k|                     return false;
 5091|       |
 5092|   755k|                  value.emplace(std::move(key), std::move(val));
 5093|   755k|                  return true;
 5094|   755k|               });
 5095|   755k|         }
 5096|       |
 5097|  2.33M|         yaml::finalize_node_anchor(preamble.node_props, ctx, it);
 5098|  2.33M|      }
_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.45M|      {
  466|  2.45M|         skip_inline_ws(it, end);
  467|       |
  468|  2.45M|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (468:14): [True: 8, False: 2.45M]
  ------------------
  469|      8|            if constexpr (!AllowEmptyInput) {
  470|      8|               ctx.error = error_code::unexpected_end;
  471|      8|            }
  472|      8|            return true;
  473|      8|         }
  474|       |
  475|  2.45M|         preamble.tag = parse_yaml_tag(it, end, ctx);
  476|  2.45M|         if (preamble.tag == yaml_tag::unknown) [[unlikely]] {
  ------------------
  |  Branch (476:14): [True: 5, False: 2.45M]
  ------------------
  477|      5|            ctx.error = error_code::syntax_error;
  478|      5|            return true;
  479|      5|         }
  480|  2.45M|         if (!tag_validator(preamble.tag)) [[unlikely]] {
  ------------------
  |  Branch (480:14): [True: 5, False: 2.45M]
  ------------------
  481|      5|            ctx.error = error_code::syntax_error;
  482|      5|            return true;
  483|      5|         }
  484|       |
  485|  2.45M|         skip_inline_ws(it, end);
  486|       |
  487|  2.45M|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (487:14): [True: 7, False: 2.45M]
  ------------------
  488|      7|            if constexpr (!AllowEmptyInput) {
  489|      7|               ctx.error = error_code::unexpected_end;
  490|      7|            }
  491|      7|            return true;
  492|      7|         }
  493|       |
  494|  2.45M|         if (parse_node_properties<Opts, PropertyPolicy>(std::forward<T>(value), ctx, it, end, preamble.node_props)) {
  ------------------
  |  Branch (494:14): [True: 43.8k, False: 2.40M]
  ------------------
  495|  43.8k|            return true;
  496|  43.8k|         }
  497|       |
  498|  2.40M|         return false;
  499|  2.45M|      }
_ZZN3glz4fromILj450ENS_17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES1_EEEEE2opITnDaXtlNS_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj1EEERPKcRS5_TkNS_10is_contextERNS8_12yaml_contextESB_EEvOT1_OT2_OT0_T3_ENKUlNS8_8yaml_tagEE_clESN_:
 4521|  2.45M|                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.45M|      {
  409|  2.45M|         state.has_anchor = false;
  410|  2.45M|         state.anchor_name.clear();
  411|  2.45M|         state.anchor_start = nullptr;
  412|  2.45M|         state.anchor_indent = ctx.current_indent();
  413|       |
  414|  2.45M|         if constexpr (Policy.allow_alias) {
  415|  2.45M|            if constexpr (Policy.alias_can_be_mapping_key) {
  416|  2.45M|               if (!alias_token_is_mapping_key(it, end)) {
  ------------------
  |  Branch (416:20): [True: 2.45M, False: 802]
  ------------------
  417|  2.45M|                  if (handle_alias<Opts>(std::forward<T>(value), ctx, it, end)) return true;
  ------------------
  |  Branch (417:23): [True: 43.8k, False: 2.40M]
  ------------------
  418|  2.45M|               }
  419|       |            }
  420|       |            else {
  421|       |               if (handle_alias<Opts>(std::forward<T>(value), ctx, it, end)) return true;
  422|       |            }
  423|  2.45M|         }
  424|       |
  425|  2.45M|         if (it != end && *it == '&') {
  ------------------
  |  Branch (425:14): [True: 2.40M, False: 43.8k]
  |  Branch (425:27): [True: 10.0k, False: 2.39M]
  ------------------
  426|  10.0k|            ++it;
  427|  10.0k|            auto name = parse_anchor_name(it, end);
  428|  10.0k|            if (name.empty()) {
  ------------------
  |  Branch (428:17): [True: 7, False: 10.0k]
  ------------------
  429|      7|               ctx.error = error_code::syntax_error;
  430|      7|               return true;
  431|      7|            }
  432|  10.0k|            skip_inline_ws(it, end);
  433|  10.0k|            if (it == end) {
  ------------------
  |  Branch (433:17): [True: 20, False: 9.99k]
  ------------------
  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|  9.99k|            state.has_anchor = true;
  446|  9.99k|            state.anchor_name = std::string(name);
  447|  9.99k|            state.anchor_start = &*it;
  448|  9.99k|         }
  449|       |
  450|  2.45M|         return false;
  451|  2.45M|      }
_ZN3glz4yaml12handle_aliasITnDaXtlNS0_9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj1EEERNS_17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES3_EEEENS0_12yaml_contextEPKcSB_EEbOT0_RT1_RT2_T3_:
  300|  2.45M|      {
  301|  2.45M|         if (it == end || *it != '*') return false;
  ------------------
  |  Branch (301:14): [True: 0, False: 2.45M]
  |  Branch (301:27): [True: 2.40M, False: 43.8k]
  ------------------
  302|       |
  303|  43.8k|         ++it; // skip '*'
  304|  43.8k|         auto name = parse_anchor_name(it, end);
  305|  43.8k|         if (name.empty()) {
  ------------------
  |  Branch (305:14): [True: 17, False: 43.8k]
  ------------------
  306|     17|            ctx.error = error_code::syntax_error;
  307|     17|            return true;
  308|     17|         }
  309|       |
  310|  43.8k|         auto anchor_it = ctx.anchors.find(name);
  311|  43.8k|         if (anchor_it == ctx.anchors.end()) {
  ------------------
  |  Branch (311:14): [True: 76, False: 43.7k]
  ------------------
  312|     76|            ctx.error = error_code::syntax_error; // undefined alias
  313|     76|            return true;
  314|     76|         }
  315|       |
  316|       |         // Copied rather than referenced: the replay below can replace ctx.anchors wholesale
  317|       |         // (a speculative parse hands its own map back), which would dangle a reference here.
  318|  43.7k|         const auto span = anchor_it->second;
  319|       |
  320|       |         // Empty anchor span (anchor on null/empty node) — leave value as default
  321|  43.7k|         if (span.begin == span.end) {
  ------------------
  |  Branch (321:14): [True: 934, False: 42.8k]
  ------------------
  322|    934|            return true;
  323|    934|         }
  324|       |
  325|       |         // An anchor is invisible to itself while it expands. A span that aliases the name it
  326|       |         // defines -- reachable because a mapping key's anchor is registered over the key text
  327|       |         // before that text is parsed -- would otherwise replay itself forever.
  328|  42.8k|         if (ctx.alias_span_is_replaying(span.begin, span.end)) [[unlikely]] {
  ------------------
  |  Branch (328:14): [True: 13, False: 42.8k]
  ------------------
  329|     13|            ctx.error = error_code::syntax_error; // cyclic alias
  330|     13|            return true;
  331|     13|         }
  332|       |
  333|       |         // Replaying an anchor re-enters the reader directly, bypassing the variant reader's
  334|       |         // depth guard, so this is the only depth accounting a chain of aliases into a
  335|       |         // non-variant target gets. The cycle check above stops the unbounded case; this bounds
  336|       |         // a legitimate but deeply chained one.
  337|  42.8k|         depth_guard guard{ctx, yaml::max_yaml_recursive_depth};
  338|  42.8k|         if (!guard) [[unlikely]]
  ------------------
  |  Branch (338:14): [True: 4, False: 42.8k]
  ------------------
  339|      4|            return true;
  340|       |
  341|  42.8k|         if (!ctx.charge_alias_expansion(static_cast<size_t>(span.end - span.begin))) [[unlikely]] {
  ------------------
  |  Branch (341:14): [True: 2, False: 42.7k]
  ------------------
  342|      2|            ctx.error = error_code::exceeded_max_expansion;
  343|      2|            ctx.custom_error_message = "alias expansion";
  344|      2|            return true;
  345|      2|         }
  346|       |
  347|  42.7k|         auto replay_it = span.begin;
  348|  42.7k|         auto replay_end = span.end;
  349|       |
  350|       |         // Save indent context and set up for replay
  351|  42.7k|         auto saved_indent_stack = std::move(ctx.indent_stack);
  352|  42.7k|         ctx.indent_stack.clear();
  353|  42.7k|         if (span.base_indent > 0) {
  ------------------
  |  Branch (353:14): [True: 1.88k, False: 40.9k]
  ------------------
  354|  1.88k|            ctx.push_indent(span.base_indent - 1);
  355|  1.88k|         }
  356|       |
  357|  42.7k|         ctx.active_alias_spans.emplace_back(span.begin, span.end);
  358|       |
  359|  42.7k|         using V = std::remove_cvref_t<T>;
  360|  42.7k|         from<YAML, V>::template op<Opts>(std::forward<T>(value), ctx, replay_it, replay_end);
  361|       |
  362|  42.7k|         ctx.active_alias_spans.pop_back();
  363|       |
  364|       |         // Restore indent context
  365|  42.7k|         ctx.indent_stack = std::move(saved_indent_stack);
  366|  42.7k|         return true;
  367|  42.8k|      }
_ZZN3glz4fromILj450ENS_17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES1_EEEEE2opITnDaXtlNS_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj1EEERPKcRS5_TkNS_10is_contextERNS8_12yaml_contextESB_EEvOT1_OT2_OT0_T3_ENKUlRS4_E_clESN_:
 4658|  5.39M|               auto parse_implicit_null = [&](val_t& val) -> bool {
 4659|       |                  if constexpr (nullable_like<std::remove_cvref_t<val_t>>) {
 4660|       |                     val = {};
 4661|       |                     return true;
 4662|       |                  }
 4663|  5.39M|                  else if constexpr (std::same_as<std::remove_cvref_t<val_t>, glz::generic>) {
 4664|  5.39M|                     val = glz::generic{};
 4665|  5.39M|                     return true;
 4666|       |                  }
 4667|       |                  else {
 4668|       |                     static constexpr std::string_view null_value{"null"};
 4669|       |                     auto null_it = null_value.data();
 4670|       |                     from<YAML, val_t>::template op<yaml::flow_context_on<Opts>()>(
 4671|       |                        val, ctx, null_it, null_value.data() + null_value.size());
 4672|       |                     return !bool(ctx.error);
 4673|       |                  }
 4674|  5.39M|               };
_ZN3glz4yaml24parse_block_mapping_loopITnDaXtlNS0_9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj1EEENS0_12yaml_contextEPKcS5_ZNS_4fromILj450ENS_17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES7_EEEEE2opITnDaXtlS2_Lj450ELb1ELb0ELb1ELh2ELb0ELj1EEERS5_RSB_TkNS_10is_contextERS3_S5_EEvOT1_OT2_OT0_T3_EUlRT_RSL_SH_iE_EEvSQ_RSH_SJ_iOSN_:
 3633|   755k|      {
 3634|       |         // A tagged-variant custom alternative hands its body (at the variant's own column) to a
 3635|       |         // discover-mode reader. Honor the known indent it published so continuation/dedent are
 3636|       |         // judged against the outer parent, not the body itself. One-shot: reset on observation.
 3637|   755k|         if (ctx.forced_block_mapping_indent >= 0) {
  ------------------
  |  Branch (3637:14): [True: 0, False: 755k]
  ------------------
 3638|      0|            if (mapping_indent < 0) {
  ------------------
  |  Branch (3638:17): [True: 0, False: 0]
  ------------------
 3639|      0|               mapping_indent = ctx.forced_block_mapping_indent;
 3640|      0|            }
 3641|      0|            ctx.forced_block_mapping_indent = -1;
 3642|      0|         }
 3643|   755k|         const int32_t parent_indent = ctx.current_indent();
 3644|   755k|         const bool discover_indent = (mapping_indent < 0);
 3645|   755k|         bool first_key = !discover_indent;
 3646|   755k|         bool discovered_first_key_mid_line = false;
 3647|   755k|         int32_t discovered_first_key_visual_indent = 0;
 3648|       |
 3649|  1.72M|         while (it != end) {
  ------------------
  |  Branch (3649:17): [True: 1.07M, False: 651k]
  ------------------
 3650|  1.07M|            auto line_start = it;
 3651|  1.07M|            int32_t line_indent = first_key ? mapping_indent : 0;
  ------------------
  |  Branch (3651:35): [True: 0, False: 1.07M]
  ------------------
 3652|       |
 3653|       |            // Skip blank lines and comments, measure indent
 3654|  1.46M|            while (it != end) {
  ------------------
  |  Branch (3654:20): [True: 1.45M, False: 10.1k]
  ------------------
 3655|  1.45M|               if (*it == '#') {
  ------------------
  |  Branch (3655:20): [True: 113k, False: 1.34M]
  ------------------
 3656|   113k|                  skip_comment(it, end);
 3657|   113k|                  skip_newline(it, end);
 3658|   113k|                  first_key = false;
 3659|   113k|                  line_indent = 0;
 3660|   113k|               }
 3661|  1.34M|               else if (*it == '\n' || *it == '\r') {
  ------------------
  |  Branch (3661:25): [True: 33.4k, False: 1.30M]
  |  Branch (3661:40): [True: 144k, False: 1.16M]
  ------------------
 3662|   177k|                  skip_newline(it, end);
 3663|   177k|                  first_key = false;
 3664|   177k|                  line_indent = 0;
 3665|   177k|               }
 3666|  1.16M|               else if (*it == ' ') {
  ------------------
  |  Branch (3666:25): [True: 219k, False: 944k]
  ------------------
 3667|   219k|                  line_start = it;
 3668|   219k|                  line_indent = 0;
 3669|   543k|                  while (it != end && *it == ' ') {
  ------------------
  |  Branch (3669:26): [True: 540k, False: 2.21k]
  |  Branch (3669:39): [True: 323k, False: 217k]
  ------------------
 3670|   323k|                     ++line_indent;
 3671|   323k|                     ++it;
 3672|   323k|                  }
 3673|       |
 3674|   219k|                  bool saw_tab = false;
 3675|   251k|                  while (it != end && (*it == ' ' || *it == '\t')) {
  ------------------
  |  Branch (3675:26): [True: 248k, False: 2.36k]
  |  Branch (3675:40): [True: 1.82k, False: 246k]
  |  Branch (3675:54): [True: 29.8k, False: 217k]
  ------------------
 3676|  31.6k|                     saw_tab = saw_tab || (*it == '\t');
  ------------------
  |  Branch (3676:32): [True: 29.8k, False: 1.81k]
  |  Branch (3676:43): [True: 1.81k, False: 0]
  ------------------
 3677|  31.6k|                     ++it;
 3678|  31.6k|                  }
 3679|       |
 3680|   219k|                  if (it == end || *it == '\n' || *it == '\r' || *it == '#') {
  ------------------
  |  Branch (3680:23): [True: 2.36k, False: 217k]
  |  Branch (3680:36): [True: 9.43k, False: 207k]
  |  Branch (3680:51): [True: 2.92k, False: 204k]
  |  Branch (3680:66): [True: 80.2k, False: 124k]
  ------------------
 3681|  94.9k|                     first_key = false;
 3682|  94.9k|                     line_indent = 0;
 3683|  94.9k|                     continue; // Blank or comment line
 3684|  94.9k|                  }
 3685|       |
 3686|   124k|                  if (saw_tab) {
  ------------------
  |  Branch (3686:23): [True: 39, False: 124k]
  ------------------
 3687|     39|                     ctx.error = error_code::syntax_error;
 3688|     39|                     return;
 3689|     39|                  }
 3690|       |
 3691|       |                  // Early dedent check
 3692|   124k|                  if (mapping_indent >= 0 && line_indent < mapping_indent) {
  ------------------
  |  Branch (3692:23): [True: 119k, False: 4.89k]
  |  Branch (3692:46): [True: 748, False: 118k]
  ------------------
 3693|    748|                     it = line_start;
 3694|    748|                     return;
 3695|    748|                  }
 3696|       |
 3697|   123k|                  first_key = false;
 3698|   123k|                  break; // Found content
 3699|   124k|               }
 3700|   944k|               else if (*it == '\t') {
  ------------------
  |  Branch (3700:25): [True: 6.58k, False: 938k]
  ------------------
 3701|  6.58k|                  line_start = it;
 3702|  29.3k|                  while (it != end && (*it == ' ' || *it == '\t')) ++it;
  ------------------
  |  Branch (3702:26): [True: 26.6k, False: 2.74k]
  |  Branch (3702:40): [True: 8.29k, False: 18.3k]
  |  Branch (3702:54): [True: 14.4k, False: 3.84k]
  ------------------
 3703|  6.58k|                  if (it == end || *it == '\n' || *it == '\r' || *it == '#') {
  ------------------
  |  Branch (3703:23): [True: 2.74k, False: 3.84k]
  |  Branch (3703:36): [True: 936, False: 2.90k]
  |  Branch (3703:51): [True: 1.42k, False: 1.48k]
  |  Branch (3703:66): [True: 1.44k, False: 45]
  ------------------
 3704|  6.54k|                     first_key = false;
 3705|  6.54k|                     line_indent = 0;
 3706|  6.54k|                     continue; // Blank or comment-only line with tab indentation
 3707|  6.54k|                  }
 3708|     45|                  ctx.error = error_code::syntax_error;
 3709|     45|                  return;
 3710|  6.58k|               }
 3711|   938k|               else {
 3712|   938k|                  line_start = it;
 3713|   938k|                  break; // Content at column 0
 3714|   938k|               }
 3715|  1.45M|            }
 3716|       |
 3717|  1.07M|            if (it == end) break;
  ------------------
  |  Branch (3717:17): [True: 10.1k, False: 1.06M]
  ------------------
 3718|       |
 3719|       |            // Document boundaries terminate the current mapping in both discovered
 3720|       |            // and fixed-indent modes.
 3721|  1.06M|            if (at_document_end(it, end) || at_document_start(it, end)) break;
  ------------------
  |  Branch (3721:17): [True: 2.91k, False: 1.05M]
  |  Branch (3721:45): [True: 3.45k, False: 1.05M]
  ------------------
 3722|       |
 3723|       |            // Dedent checks (skip on first key for struct case)
 3724|       |            // Must check BEFORE establishing mapping_indent so the first discovered key
 3725|       |            // isn't rejected by the parent_indent check (mapping_indent is still -1).
 3726|  1.05M|            if (!first_key) {
  ------------------
  |  Branch (3726:17): [True: 1.05M, False: 0]
  ------------------
 3727|       |               // Parent indent check for nested maps (only after mapping_indent established)
 3728|  1.05M|               if (discover_indent && mapping_indent >= 0 && parent_indent >= 0 && line_indent <= parent_indent) {
  ------------------
  |  Branch (3728:20): [True: 1.05M, False: 0]
  |  Branch (3728:39): [True: 300k, False: 755k]
  |  Branch (3728:62): [True: 89.6k, False: 210k]
  |  Branch (3728:84): [True: 66.5k, False: 23.1k]
  ------------------
 3729|  66.5k|                  it = line_start;
 3730|  66.5k|                  return;
 3731|  66.5k|               }
 3732|   989k|               if (mapping_indent >= 0 && line_indent < mapping_indent) {
  ------------------
  |  Branch (3732:20): [True: 233k, False: 755k]
  |  Branch (3732:43): [True: 814, False: 232k]
  ------------------
 3733|    814|                  it = line_start;
 3734|    814|                  return;
 3735|    814|               }
 3736|   989k|            }
 3737|       |
 3738|       |            // Establish mapping indent from first key (map case)
 3739|   988k|            bool established_mapping_indent_this_line = false;
 3740|   988k|            if (mapping_indent < 0) {
  ------------------
  |  Branch (3740:17): [True: 755k, False: 232k]
  ------------------
 3741|   755k|               mapping_indent = line_indent;
 3742|   755k|               established_mapping_indent_this_line = true;
 3743|   755k|               discovered_first_key_visual_indent = line_indent;
 3744|   755k|               if constexpr (std::is_pointer_v<std::decay_t<It>>) {
 3745|   755k|                  if (ctx.stream_begin && line_start > ctx.stream_begin) {
  ------------------
  |  Branch (3745:23): [True: 755k, False: 0]
  |  Branch (3745:43): [True: 755k, False: 0]
  ------------------
 3746|   755k|                     const auto prefix = ctx.line_prefix_before(line_start);
 3747|   755k|                     if (prefix.has_tab) {
  ------------------
  |  Branch (3747:26): [True: 423, False: 755k]
  ------------------
 3748|    423|                        ctx.error = error_code::syntax_error;
 3749|    423|                        return;
 3750|    423|                     }
 3751|       |
 3752|   755k|                     discovered_first_key_mid_line = prefix.has_content;
 3753|   755k|                     if (mapping_indent == 0 && prefix.column > 0) {
  ------------------
  |  Branch (3753:26): [True: 750k, False: 4.89k]
  |  Branch (3753:49): [True: 554k, False: 195k]
  ------------------
 3754|   554k|                        discovered_first_key_visual_indent = prefix.column;
 3755|   554k|                     }
 3756|   755k|                  }
 3757|   755k|               }
 3758|   755k|            }
 3759|       |
 3760|       |            // In discovered-indent block mappings, sibling keys must stay at the same
 3761|       |            // indent level, except when the first key started mid-line (e.g. "--- k: v").
 3762|   988k|            if (discover_indent && mapping_indent >= 0 && !established_mapping_indent_this_line &&
  ------------------
  |  Branch (3762:17): [True: 987k, False: 423]
  |  Branch (3762:36): [True: 987k, False: 0]
  |  Branch (3762:59): [True: 232k, False: 755k]
  ------------------
 3763|   232k|                !discovered_first_key_mid_line) {
  ------------------
  |  Branch (3763:17): [True: 55.1k, False: 177k]
  ------------------
 3764|  55.1k|               if (mapping_indent == 0 && discovered_first_key_visual_indent > 0) {
  ------------------
  |  Branch (3764:20): [True: 54.6k, False: 523]
  |  Branch (3764:43): [True: 18.9k, False: 35.6k]
  ------------------
 3765|  18.9k|                  if (line_indent > discovered_first_key_visual_indent) {
  ------------------
  |  Branch (3765:23): [True: 17, False: 18.9k]
  ------------------
 3766|     17|                     ctx.error = error_code::syntax_error;
 3767|     17|                     return;
 3768|     17|                  }
 3769|  18.9k|                  if (line_indent < discovered_first_key_visual_indent) {
  ------------------
  |  Branch (3769:23): [True: 3.15k, False: 15.7k]
  ------------------
 3770|  3.15k|                     it = line_start;
 3771|  3.15k|                     return;
 3772|  3.15k|                  }
 3773|  18.9k|               }
 3774|  36.1k|               else if (line_indent > mapping_indent &&
  ------------------
  |  Branch (3774:25): [True: 1.10k, False: 35.0k]
  ------------------
 3775|  1.10k|                        (parent_indent < 0 || mapping_indent > 0 ||
  ------------------
  |  Branch (3775:26): [True: 71, False: 1.03k]
  |  Branch (3775:47): [True: 2, False: 1.03k]
  ------------------
 3776|  1.03k|                         (parent_indent >= 0 && mapping_indent == 0 && line_indent > (parent_indent + 1)))) {
  ------------------
  |  Branch (3776:27): [True: 1.03k, False: 0]
  |  Branch (3776:49): [True: 1.03k, False: 0]
  |  Branch (3776:72): [True: 7, False: 1.02k]
  ------------------
 3777|     80|                  ctx.error = error_code::syntax_error;
 3778|     80|                  return;
 3779|     80|               }
 3780|  55.1k|            }
 3781|       |
 3782|       |            // Sequence indicator check (struct case only - map parser lets key parsing
 3783|       |            // handle '- ' which produces appropriate errors for misindented items)
 3784|   985k|            if (!discover_indent && *it == '-' &&
  ------------------
  |  Branch (3784:17): [True: 0, False: 985k]
  |  Branch (3784:37): [True: 0, False: 0]
  ------------------
 3785|      0|                ((it + 1) == end || *(it + 1) == ' ' || *(it + 1) == '\t' || *(it + 1) == '\n')) {
  ------------------
  |  Branch (3785:18): [True: 0, False: 0]
  |  Branch (3785:37): [True: 0, False: 0]
  |  Branch (3785:57): [True: 0, False: 0]
  |  Branch (3785:78): [True: 0, False: 0]
  ------------------
 3786|      0|               it = line_start;
 3787|      0|               return;
 3788|      0|            }
 3789|       |
 3790|       |            // Skip indented comment lines
 3791|   985k|            if (*it == '#') {
  ------------------
  |  Branch (3791:17): [True: 0, False: 985k]
  ------------------
 3792|      0|               skip_comment(it, end);
 3793|      0|               first_key = false;
 3794|      0|               continue;
 3795|      0|            }
 3796|       |
 3797|       |            // Skip blank/empty lines after indent
 3798|   985k|            if (*it == '\n' || *it == '\r') {
  ------------------
  |  Branch (3798:17): [True: 423, False: 984k]
  |  Branch (3798:32): [True: 0, False: 984k]
  ------------------
 3799|      0|               first_key = false;
 3800|      0|               continue;
 3801|      0|            }
 3802|       |
 3803|       |            // While parsing an explicit mapping key node ('? key-node'),
 3804|       |            // a subsequent standalone ':' at the same indentation starts
 3805|       |            // the outer value indicator and must terminate this key-node map.
 3806|       |            // Keep same-line ': x' on the first key-node line valid.
 3807|   985k|            if (ctx.explicit_mapping_key_context && !established_mapping_indent_this_line && *it == ':') {
  ------------------
  |  Branch (3807:17): [True: 256k, False: 728k]
  |  Branch (3807:53): [True: 44.6k, False: 212k]
  |  Branch (3807:94): [True: 12.2k, False: 32.3k]
  ------------------
 3808|  12.2k|               const auto after_colon = it + 1;
 3809|  12.2k|               const int32_t explicit_value_indicator_indent = (parent_indent < 0) ? 0 : (parent_indent + 1);
  ------------------
  |  Branch (3809:64): [True: 10.1k, False: 2.10k]
  ------------------
 3810|  12.2k|               if ((after_colon == end || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*after_colon)]) &&
  ------------------
  |  Branch (3810:21): [True: 637, False: 11.5k]
  |  Branch (3810:43): [True: 4.41k, False: 7.18k]
  ------------------
 3811|  5.04k|                   line_indent == explicit_value_indicator_indent) {
  ------------------
  |  Branch (3811:20): [True: 1.14k, False: 3.89k]
  ------------------
 3812|  1.14k|                  it = line_start;
 3813|  1.14k|                  return;
 3814|  1.14k|               }
 3815|  12.2k|            }
 3816|       |
 3817|       |            // Process this mapping entry (key + colon + value)
 3818|   983k|            int32_t effective_line_indent = line_indent;
 3819|   983k|            if (discover_indent && established_mapping_indent_this_line &&
  ------------------
  |  Branch (3819:17): [True: 983k, False: 423]
  |  Branch (3819:36): [True: 755k, False: 228k]
  ------------------
 3820|   755k|                discovered_first_key_visual_indent > effective_line_indent &&
  ------------------
  |  Branch (3820:17): [True: 554k, False: 200k]
  ------------------
 3821|   554k|                !(discovered_first_key_mid_line && parent_indent < 0)) {
  ------------------
  |  Branch (3821:19): [True: 472k, False: 82.0k]
  |  Branch (3821:52): [True: 270k, False: 202k]
  ------------------
 3822|       |               // The first discovered key has no indentation of its own left to measure: it may
 3823|       |               // begin mid-line (a sequence entry's "- key: value"), or the caller may have already
 3824|       |               // consumed the line's indentation before handing the mapping over. Pass its visual
 3825|       |               // column so the entry judges its value against the key's real indent -- otherwise a
 3826|       |               // key with an empty value takes the following sibling line for nested content
 3827|       |               // (issue #2827) and same-line block scalars compute the wrong indentation.
 3828|       |               // The exception is a ROOT mapping whose first key begins mid-line, which means node
 3829|       |               // properties sit ahead of it (`!!str &a1 "foo":`): those belong to the document node
 3830|       |               // rather than to the key's column, so the measured indent stands. Conformance tests
 3831|       |               // 7FWL and HMQ5 pin that case.
 3832|   284k|               effective_line_indent = discovered_first_key_visual_indent;
 3833|   284k|            }
 3834|       |
 3835|   983k|            if (!process_entry(ctx, it, end, effective_line_indent)) {
  ------------------
  |  Branch (3835:17): [True: 15.0k, False: 968k]
  ------------------
 3836|  15.0k|               return;
 3837|  15.0k|            }
 3838|   968k|            first_key = false;
 3839|       |
 3840|   968k|            if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (3840:17): [True: 0, False: 968k]
  ------------------
 3841|      0|               return;
 3842|       |
 3843|   968k|            if constexpr (yaml::check_flow_context(Opts)) {
 3844|       |               // In flow context, an implicit "key: value" pair used as a sequence entry
 3845|       |               // ends at ',', ']', or '}'. Let the enclosing flow parser consume it.
 3846|   968k|               auto flow_end = it;
 3847|   968k|               skip_flow_ws_and_newlines(ctx, flow_end, end);
 3848|   968k|               if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (3848:20): [True: 98, False: 968k]
  ------------------
 3849|     98|                  return;
 3850|   968k|               if (flow_end != end && (*flow_end == ',' || *flow_end == ']' || *flow_end == '}')) {
  ------------------
  |  Branch (3850:20): [True: 781k, False: 186k]
  |  Branch (3850:40): [True: 354k, False: 427k]
  |  Branch (3850:60): [True: 14.4k, False: 412k]
  |  Branch (3850:80): [True: 104k, False: 307k]
  ------------------
 3851|   474k|                  it = flow_end;
 3852|   474k|                  return;
 3853|   474k|               }
 3854|   968k|            }
 3855|       |
 3856|       |            // Trailing whitespace handling (peek-ahead pattern).
 3857|       |            // After parsing, iterator may be at leading indent of next line.
 3858|       |            // Don't consume it - let the outer loop handle indent measurement.
 3859|   968k|            if (it != end) {
  ------------------
  |  Branch (3859:17): [True: 341k, False: 627k]
  ------------------
 3860|   341k|               if (*it == ' ' || *it == '\t') {
  ------------------
  |  Branch (3860:20): [True: 108k, False: 233k]
  |  Branch (3860:34): [True: 1.29k, False: 231k]
  ------------------
 3861|   109k|                  auto peek = it;
 3862|   109k|                  skip_inline_ws(peek, end);
 3863|   109k|                  if (peek != end && *peek != '\n' && *peek != '\r' && *peek != '#') {
  ------------------
  |  Branch (3863:23): [True: 102k, False: 6.40k]
  |  Branch (3863:38): [True: 99.5k, False: 3.43k]
  |  Branch (3863:55): [True: 97.0k, False: 2.49k]
  |  Branch (3863:72): [True: 95.2k, False: 1.75k]
  ------------------
 3864|  95.2k|                     continue; // At leading indent of new line
 3865|  95.2k|                  }
 3866|   109k|               }
 3867|   245k|               skip_inline_ws(it, end);
 3868|   245k|               if (it != end && *it == '#') {
  ------------------
  |  Branch (3868:20): [True: 239k, False: 6.40k]
  |  Branch (3868:33): [True: 18.3k, False: 221k]
  ------------------
 3869|  18.3k|                  if constexpr (std::is_pointer_v<std::decay_t<It>>) {
 3870|  18.3k|                     if (it > line_start) {
  ------------------
  |  Branch (3870:26): [True: 18.3k, False: 0]
  ------------------
 3871|  18.3k|                        const char prev = *(it - 1);
 3872|  18.3k|                        if (prev != ' ' && prev != '\t' && prev != '\n' && prev != '\r') {
  ------------------
  |  Branch (3872:29): [True: 4.41k, False: 13.9k]
  |  Branch (3872:44): [True: 3.02k, False: 1.39k]
  |  Branch (3872:60): [True: 979, False: 2.04k]
  |  Branch (3872:76): [True: 13, False: 966]
  ------------------
 3873|     13|                           ctx.error = error_code::syntax_error;
 3874|     13|                           return;
 3875|     13|                        }
 3876|  18.3k|                     }
 3877|  18.3k|                  }
 3878|  18.3k|               }
 3879|  18.3k|               skip_comment(it, end);
 3880|   245k|               if (it != end && (*it == '\n' || *it == '\r')) {
  ------------------
  |  Branch (3880:20): [True: 239k, False: 6.49k]
  |  Branch (3880:34): [True: 71.4k, False: 167k]
  |  Branch (3880:49): [True: 67.2k, False: 100k]
  ------------------
 3881|   138k|                  skip_newline(it, end);
 3882|   138k|               }
 3883|   107k|               else if (it != end) {
  ------------------
  |  Branch (3883:25): [True: 100k, False: 6.49k]
  ------------------
 3884|       |                  // The entry stopped part way along its line with something other than
 3885|       |                  // whitespace or a comment after it -- a ':' its value could not take as a
 3886|       |                  // separator, say. The next pass measures indent as though this were the start
 3887|       |                  // of a line, so what is left of the real one is lost; reject it instead.
 3888|   100k|                  if constexpr (requires { ctx.line_prefix_before(it); }) {
 3889|   100k|                     if (ctx.line_prefix_before(it).has_content) {
  ------------------
  |  Branch (3889:26): [True: 618, False: 100k]
  ------------------
 3890|    618|                        ctx.error = error_code::syntax_error;
 3891|    618|                        return;
 3892|    618|                     }
 3893|   100k|                  }
 3894|   100k|               }
 3895|   245k|            }
 3896|   968k|         }
 3897|   755k|      }
_ZZN3glz4fromILj450ENS_17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES1_EEEEE2opITnDaXtlNS_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj1EEERPKcRS5_TkNS_10is_contextERNS8_12yaml_contextESB_EEvOT1_OT2_OT0_T3_ENKUlRT_RSK_SG_iE_clISE_SB_SB_EEbSO_SP_SG_i:
 4777|   983k|               ctx, it, end, int32_t(-1), [&](auto& ctx, auto& it, auto end, int32_t line_indent) -> bool {
 4778|   983k|                  auto parse_map_value = [&](val_t& val) -> bool {
 4779|   983k|                     if (it != end && !yaml::line_end_or_comment_table[static_cast<uint8_t>(*it)]) {
 4780|   983k|                        bool line_starts_with_explicit_value_indicator = false;
 4781|       |
 4782|       |                        // Inline mapping values in block context cannot start with a
 4783|       |                        // plain "key: value" pair on the same line (e.g. "a: b: c").
 4784|       |                        // Such constructs are malformed unless wrapped in flow
 4785|       |                        // delimiters ({...} / [...]) or quoted.
 4786|   983k|                        if constexpr (std::is_pointer_v<std::decay_t<decltype(it)>>) {
 4787|   983k|                           if (ctx.stream_begin) {
 4788|   983k|                              auto is_line_content_start = [&](auto pos) {
 4789|   983k|                                 return !ctx.line_prefix_before(pos).has_content;
 4790|   983k|                              };
 4791|       |
 4792|   983k|                              auto line_has_explicit_value_indicator = [&](auto pos) {
 4793|   983k|                                 const char* line = ctx.line_begin_of(pos);
 4794|   983k|                                 while (line != end && (*line == ' ' || *line == '\t')) ++line;
 4795|   983k|                                 return line != end && *line == ':';
 4796|   983k|                              };
 4797|       |
 4798|   983k|                              if (!is_line_content_start(it) &&
 4799|   983k|                                  yaml::inline_value_has_plain_mapping_indicator(it, end) &&
 4800|   983k|                                  !line_has_explicit_value_indicator(it)) {
 4801|   983k|                                 ctx.error = error_code::syntax_error;
 4802|   983k|                                 return false;
 4803|   983k|                              }
 4804|   983k|                              line_starts_with_explicit_value_indicator = line_has_explicit_value_indicator(it);
 4805|   983k|                           }
 4806|   983k|                        }
 4807|       |
 4808|   983k|                        if (*it == '-' &&
 4809|   983k|                            ((it + 1) == end || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*(it + 1))]) &&
 4810|   983k|                            !line_starts_with_explicit_value_indicator) {
 4811|       |                           // "key: - item" is not valid block sequence syntax.
 4812|   983k|                           ctx.error = error_code::syntax_error;
 4813|   983k|                           return false;
 4814|   983k|                        }
 4815|       |
 4816|   983k|                        if (!ctx.push_indent(line_indent + 1)) [[unlikely]]
 4817|   983k|                           return false;
 4818|   983k|                        from<YAML, val_t>::template op<Opts>(val, ctx, it, end);
 4819|   983k|                        ctx.pop_indent();
 4820|   983k|                     }
 4821|   983k|                     else {
 4822|   983k|                        int32_t nested_indent = yaml::detect_nested_value_indent(ctx, it, end, line_indent);
 4823|   983k|                        if (nested_indent >= 0) {
 4824|   983k|                           yaml::skip_to_content(it, end);
 4825|   983k|                           if (it != end && *it == ':' && (it + 1) != end && *(it + 1) == '\t') {
 4826|   983k|                              ctx.error = error_code::syntax_error;
 4827|   983k|                              return false;
 4828|   983k|                           }
 4829|       |                           // A struct value reads the pushed indent as its own key column;
 4830|       |                           // every other value type reads it as the enclosing baseline.
 4831|   983k|                           const int32_t value_indent =
 4832|   983k|                              yaml::receives_block_mapping_column<val_t>() ? nested_indent : nested_indent - 1;
 4833|   983k|                           if (!ctx.push_indent(value_indent)) [[unlikely]]
 4834|   983k|                              return false;
 4835|   983k|                           from<YAML, val_t>::template op<Opts>(val, ctx, it, end);
 4836|   983k|                           ctx.pop_indent();
 4837|   983k|                        }
 4838|   983k|                     }
 4839|   983k|                     return !bool(ctx.error);
 4840|   983k|                  };
 4841|       |
 4842|       |                  // Explicit key entry form:
 4843|       |                  // ? key
 4844|       |                  // : value
 4845|   983k|                  if (*it == '?' && ((it + 1) != end) && *(it + 1) == '\t') {
  ------------------
  |  Branch (4845:23): [True: 388k, False: 594k]
  |  Branch (4845:37): [True: 387k, False: 1.13k]
  |  Branch (4845:58): [True: 3, False: 387k]
  ------------------
 4846|      3|                     ctx.error = error_code::syntax_error;
 4847|      3|                     return false;
 4848|      3|                  }
 4849|   983k|                  if (*it == '?' && ((it + 1) == end || *(it + 1) == ' ' || *(it + 1) == '\n' || *(it + 1) == '\r')) {
  ------------------
  |  Branch (4849:23): [True: 388k, False: 594k]
  |  Branch (4849:38): [True: 1.13k, False: 387k]
  |  Branch (4849:57): [True: 163k, False: 224k]
  |  Branch (4849:77): [True: 166k, False: 57.9k]
  |  Branch (4849:98): [True: 44.2k, False: 13.6k]
  ------------------
 4850|   374k|                     ++it; // skip '?'
 4851|   374k|                     yaml::skip_inline_ws(it, end);
 4852|       |
 4853|   374k|                     const int32_t explicit_value_indicator_indent =
 4854|   374k|                        (ctx.current_indent() < 0) ? 0 : (ctx.current_indent() + 1);
  ------------------
  |  Branch (4854:25): [True: 224k, False: 150k]
  ------------------
 4855|       |
 4856|   374k|                     key_t key{};
 4857|   374k|                     if constexpr (std::same_as<std::remove_cvref_t<key_t>, std::string>) {
 4858|   374k|                        auto to_string_key = [&](glz::generic& key_node) {
 4859|   374k|                           return yaml::materialize_key(key, key_node, ctx);
 4860|   374k|                        };
 4861|       |
 4862|   374k|                        auto key_it = it;
 4863|   374k|                        yaml::skip_inline_ws(key_it, end);
 4864|       |
 4865|   374k|                        auto content = key_it;
 4866|   374k|                        yaml::skip_to_content(content, end);
 4867|   374k|                        bool handled_anchor_only_empty_key = false;
 4868|       |
 4869|       |                        // Anchor on an empty explicit key node:
 4870|       |                        //   ? &a
 4871|       |                        //   : value
 4872|   374k|                        if (content != end && *content == '&') {
  ------------------
  |  Branch (4872:29): [True: 368k, False: 6.03k]
  |  Branch (4872:47): [True: 113k, False: 255k]
  ------------------
 4873|   113k|                           auto anchor_probe = content + 1;
 4874|   113k|                           auto anchor_name = yaml::parse_anchor_name(anchor_probe, end);
 4875|   113k|                           if (!anchor_name.empty()) {
  ------------------
  |  Branch (4875:32): [True: 113k, False: 21]
  ------------------
 4876|   113k|                              auto after_anchor = anchor_probe;
 4877|   113k|                              yaml::skip_inline_ws(after_anchor, end);
 4878|       |
 4879|   113k|                              auto value_indicator = after_anchor;
 4880|   113k|                              if (value_indicator != end && *value_indicator == ':') {
  ------------------
  |  Branch (4880:35): [True: 109k, False: 4.13k]
  |  Branch (4880:61): [True: 7.90k, False: 101k]
  ------------------
 4881|  7.90k|                                 key.clear();
 4882|  7.90k|                                 ctx.anchors[std::string(anchor_name)] = {content, content, ctx.current_indent()};
 4883|  7.90k|                                 it = value_indicator;
 4884|  7.90k|                                 handled_anchor_only_empty_key = true;
 4885|  7.90k|                              }
 4886|   105k|                              else {
 4887|   105k|                                 if (value_indicator != end && *value_indicator == '#') {
  ------------------
  |  Branch (4887:38): [True: 101k, False: 4.13k]
  |  Branch (4887:64): [True: 3.50k, False: 97.6k]
  ------------------
 4888|  3.50k|                                    yaml::skip_comment(value_indicator, end);
 4889|  3.50k|                                 }
 4890|   105k|                                 if (value_indicator != end && (*value_indicator == '\n' || *value_indicator == '\r')) {
  ------------------
  |  Branch (4890:38): [True: 101k, False: 4.15k]
  |  Branch (4890:65): [True: 32.4k, False: 68.7k]
  |  Branch (4890:93): [True: 21.5k, False: 47.1k]
  ------------------
 4891|  53.9k|                                    yaml::skip_newline(value_indicator, end);
 4892|  53.9k|                                    auto value_line = value_indicator;
 4893|  53.9k|                                    int32_t value_indent = yaml::measure_indent(value_line, end, ctx);
 4894|  53.9k|                                    if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4894:41): [True: 3, False: 53.9k]
  ------------------
 4895|      3|                                       return false;
 4896|  53.9k|                                    if (value_line != end && *value_line == ':' &&
  ------------------
  |  Branch (4896:41): [True: 52.5k, False: 1.39k]
  |  Branch (4896:62): [True: 8.82k, False: 43.7k]
  ------------------
 4897|  8.82k|                                        value_indent == explicit_value_indicator_indent) {
  ------------------
  |  Branch (4897:41): [True: 8.81k, False: 9]
  ------------------
 4898|  8.81k|                                       key.clear();
 4899|  8.81k|                                       ctx.anchors[std::string(anchor_name)] = {content, content, ctx.current_indent()};
 4900|  8.81k|                                       it = value_line;
 4901|  8.81k|                                       handled_anchor_only_empty_key = true;
 4902|  8.81k|                                    }
 4903|  45.1k|                                    else if (value_line != end && *value_line == ':') {
  ------------------
  |  Branch (4903:46): [True: 43.7k, False: 1.39k]
  |  Branch (4903:67): [True: 9, False: 43.7k]
  ------------------
 4904|       |                                       // In explicit-key form ("? &a"), a following ':'
 4905|       |                                       // starts the outer value indicator only at the same
 4906|       |                                       // indentation. A deeper-indented ': value' is malformed.
 4907|      9|                                       ctx.error = error_code::syntax_error;
 4908|      9|                                       return false;
 4909|      9|                                    }
 4910|  53.9k|                                 }
 4911|   105k|                              }
 4912|   113k|                           }
 4913|   113k|                        }
 4914|       |
 4915|   374k|                        const bool key_content_spans_lines = [&] {
 4916|   374k|                           auto scan = key_it;
 4917|   374k|                           while (scan != content && scan != end) {
 4918|   374k|                              if (*scan == '\n' || *scan == '\r') return true;
 4919|   374k|                              ++scan;
 4920|   374k|                           }
 4921|   374k|                           return false;
 4922|   374k|                        }();
 4923|       |
 4924|   374k|                        if (handled_anchor_only_empty_key) {
  ------------------
  |  Branch (4924:29): [True: 16.7k, False: 358k]
  ------------------
 4925|       |                           // 'it' already points to the explicit value indicator ':'
 4926|  16.7k|                        }
 4927|   358k|                        else if (content == end || (*content == ':' && key_content_spans_lines)) {
  ------------------
  |  Branch (4927:34): [True: 6.03k, False: 352k]
  |  Branch (4927:53): [True: 7.59k, False: 344k]
  |  Branch (4927:72): [True: 3.16k, False: 4.42k]
  ------------------
 4928|  9.20k|                           key.clear();
 4929|  9.20k|                           it = content;
 4930|  9.20k|                        }
 4931|   348k|                        else {
 4932|       |                           // Explicit mapping keys ('? key-node') are full YAML nodes.
 4933|       |                           // Parse the key node structurally (not via plain-key scanning)
 4934|       |                           // so inputs like '? []: x' and '? JSON: like' are interpreted
 4935|       |                           // as complex keys, not split into implicit key/value pairs.
 4936|   348k|                           auto key_node_it = content;
 4937|   348k|                           auto key_node_end = end;
 4938|   348k|                           if constexpr (std::is_pointer_v<std::decay_t<It>>) {
 4939|       |                              // In explicit-key form, a following standalone ':'
 4940|       |                              // line (same or lower indentation) belongs to the
 4941|       |                              // outer mapping value, not the key node itself.
 4942|   348k|                              auto scan = content;
 4943|  5.45M|                              while (scan != end) {
  ------------------
  |  Branch (4943:38): [True: 5.39M, False: 59.0k]
  ------------------
 4944|   219M|                                 while (scan != end && *scan != '\n' && *scan != '\r') {
  ------------------
  |  Branch (4944:41): [True: 219M, False: 223k]
  |  Branch (4944:56): [True: 216M, False: 3.31M]
  |  Branch (4944:73): [True: 214M, False: 1.85M]
  ------------------
 4945|   214M|                                    ++scan;
 4946|   214M|                                 }
 4947|  5.39M|                                 if (scan == end) {
  ------------------
  |  Branch (4947:38): [True: 223k, False: 5.17M]
  ------------------
 4948|   223k|                                    break;
 4949|   223k|                                 }
 4950|       |
 4951|  5.17M|                                 yaml::skip_newline(scan, end);
 4952|  5.17M|                                 auto line_start = scan;
 4953|       |
 4954|  5.17M|                                 int32_t indicator_indent = 0;
 4955|  6.73M|                                 while (scan != end && *scan == ' ') {
  ------------------
  |  Branch (4955:41): [True: 6.67M, False: 59.0k]
  |  Branch (4955:56): [True: 1.56M, False: 5.11M]
  ------------------
 4956|  1.56M|                                    ++indicator_indent;
 4957|  1.56M|                                    ++scan;
 4958|  1.56M|                                 }
 4959|       |
 4960|  5.17M|                                 if (scan != end && *scan == ':') {
  ------------------
  |  Branch (4960:38): [True: 5.11M, False: 59.0k]
  |  Branch (4960:53): [True: 177k, False: 4.93M]
  ------------------
 4961|   177k|                                    const auto after_colon = scan + 1;
 4962|   177k|                                    if ((after_colon == end ||
  ------------------
  |  Branch (4962:42): [True: 2.52k, False: 175k]
  ------------------
 4963|   175k|                                         yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*after_colon)]) &&
  ------------------
  |  Branch (4963:42): [True: 112k, False: 62.2k]
  ------------------
 4964|   115k|                                        indicator_indent <= line_indent) {
  ------------------
  |  Branch (4964:41): [True: 66.2k, False: 49.1k]
  ------------------
 4965|  66.2k|                                       key_node_end = line_start;
 4966|  66.2k|                                       break;
 4967|  66.2k|                                    }
 4968|   177k|                                 }
 4969|  5.17M|                              }
 4970|   348k|                           }
 4971|       |
 4972|   348k|                           glz::generic key_node{};
 4973|   348k|                           const bool prev_explicit_mapping_key_context = ctx.explicit_mapping_key_context;
 4974|   348k|                           ctx.explicit_mapping_key_context = true;
 4975|   348k|                           from<YAML, glz::generic>::template op<Opts>(key_node, ctx, key_node_it, key_node_end);
 4976|   348k|                           ctx.explicit_mapping_key_context = prev_explicit_mapping_key_context;
 4977|   348k|                           if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4977:32): [True: 2.64k, False: 346k]
  ------------------
 4978|  2.64k|                              return false;
 4979|   346k|                           it = key_node_it;
 4980|   346k|                           if (!to_string_key(key_node)) [[unlikely]]
  ------------------
  |  Branch (4980:32): [True: 18, False: 346k]
  ------------------
 4981|     18|                              return false;
 4982|   346k|                        }
 4983|       |                     }
 4984|       |                     else {
 4985|       |                        if (it != end && !yaml::line_end_or_comment_table[static_cast<uint8_t>(*it)]) {
 4986|       |                           from<YAML, key_t>::template op<Opts>(key, ctx, it, end);
 4987|       |                           if (bool(ctx.error)) [[unlikely]]
 4988|       |                              return false;
 4989|       |                        }
 4990|       |                     }
 4991|       |
 4992|   372k|                     yaml::skip_inline_ws(it, end);
 4993|   374k|                     yaml::skip_comment(it, end);
 4994|       |
 4995|       |                     // Value indicator may appear on the next line at the same indent.
 4996|   374k|                     if (it != end && (*it == '\n' || *it == '\r')) {
  ------------------
  |  Branch (4996:26): [True: 311k, False: 62.8k]
  |  Branch (4996:40): [True: 25.3k, False: 286k]
  |  Branch (4996:55): [True: 42.2k, False: 244k]
  ------------------
 4997|  67.5k|                        auto probe = it;
 4998|  67.5k|                        bool found_value_indicator = false;
 4999|       |
 5000|   127k|                        while (probe != end && (*probe == '\n' || *probe == '\r')) {
  ------------------
  |  Branch (5000:32): [True: 110k, False: 16.5k]
  |  Branch (5000:49): [True: 43.5k, False: 67.2k]
  |  Branch (5000:67): [True: 67.2k, False: 0]
  ------------------
 5001|   110k|                           yaml::skip_newline(probe, end);
 5002|       |
 5003|   110k|                           auto value_line = probe;
 5004|   110k|                           int32_t value_indent = yaml::measure_indent(value_line, end, ctx);
 5005|   110k|                           if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (5005:32): [True: 9, False: 110k]
  ------------------
 5006|      9|                              return false;
 5007|       |
 5008|   110k|                           if (value_line == end || *value_line == '\n' || *value_line == '\r') {
  ------------------
  |  Branch (5008:32): [True: 15.5k, False: 95.2k]
  |  Branch (5008:53): [True: 10.6k, False: 84.5k]
  |  Branch (5008:76): [True: 19.8k, False: 64.7k]
  ------------------
 5009|  46.0k|                              probe = value_line;
 5010|  46.0k|                              continue; // blank line
 5011|  46.0k|                           }
 5012|  64.7k|                           if (*value_line == '#') {
  ------------------
  |  Branch (5012:32): [True: 13.7k, False: 50.9k]
  ------------------
 5013|  13.7k|                              yaml::skip_comment(value_line, end);
 5014|  13.7k|                              probe = value_line;
 5015|  13.7k|                              continue; // comment-only line
 5016|  13.7k|                           }
 5017|  50.9k|                           if (*value_line == ':' && value_indent == explicit_value_indicator_indent) {
  ------------------
  |  Branch (5017:32): [True: 15.3k, False: 35.6k]
  |  Branch (5017:54): [True: 5.97k, False: 9.34k]
  ------------------
 5018|  5.97k|                              it = value_line;
 5019|  5.97k|                              found_value_indicator = true;
 5020|  5.97k|                           }
 5021|  50.9k|                           break;
 5022|  64.7k|                        }
 5023|       |
 5024|  67.5k|                        if (found_value_indicator) {
  ------------------
  |  Branch (5024:29): [True: 5.97k, False: 61.6k]
  ------------------
 5025|  5.97k|                           yaml::skip_inline_ws(it, end);
 5026|  5.97k|                        }
 5027|  67.5k|                     }
 5028|       |
 5029|   374k|                     val_t val{};
 5030|   374k|                     if (it != end && *it == ':') {
  ------------------
  |  Branch (5030:26): [True: 311k, False: 62.8k]
  |  Branch (5030:39): [True: 103k, False: 208k]
  ------------------
 5031|   103k|                        ++it;
 5032|   103k|                        if (it != end && *it == '\t') {
  ------------------
  |  Branch (5032:29): [True: 100k, False: 3.13k]
  |  Branch (5032:42): [True: 26, False: 100k]
  ------------------
 5033|     26|                           ctx.error = error_code::syntax_error;
 5034|     26|                           return false;
 5035|     26|                        }
 5036|   103k|                        if (it != end && (*it == '\n' || *it == '\r')) {
  ------------------
  |  Branch (5036:29): [True: 100k, False: 3.13k]
  |  Branch (5036:43): [True: 10.0k, False: 90.4k]
  |  Branch (5036:58): [True: 12.3k, False: 78.1k]
  ------------------
 5037|  22.4k|                           auto probe = it;
 5038|  22.4k|                           yaml::skip_newline(probe, end);
 5039|  41.9k|                           while (probe != end && *probe == ' ') ++probe;
  ------------------
  |  Branch (5039:35): [True: 39.4k, False: 2.48k]
  |  Branch (5039:51): [True: 19.4k, False: 19.9k]
  ------------------
 5040|  22.4k|                           if (probe != end && *probe == ':' && ((probe + 1) != end) && *(probe + 1) == '\t') {
  ------------------
  |  Branch (5040:32): [True: 19.9k, False: 2.48k]
  |  Branch (5040:48): [True: 6.36k, False: 13.5k]
  |  Branch (5040:65): [True: 6.21k, False: 143]
  |  Branch (5040:89): [True: 3, False: 6.21k]
  ------------------
 5041|      3|                              ctx.error = error_code::syntax_error;
 5042|      3|                              return false;
 5043|      3|                           }
 5044|  22.4k|                        }
 5045|   103k|                        yaml::skip_inline_ws(it, end);
 5046|   103k|                        if (!parse_map_value(val)) [[unlikely]]
  ------------------
  |  Branch (5046:29): [True: 502, False: 103k]
  ------------------
 5047|    502|                           return false;
 5048|   103k|                     }
 5049|       |
 5050|   374k|                     value.emplace(std::move(key), std::move(val));
 5051|   374k|                     return true;
 5052|   374k|                  }
 5053|       |
 5054|   608k|                  key_t key{};
 5055|   608k|                  if constexpr (std::same_as<std::remove_cvref_t<key_t>, std::string>) {
 5056|   608k|                     auto key_probe = it;
 5057|   608k|                     yaml::skip_inline_ws(key_probe, end);
 5058|   608k|                     const bool complex_flow_key = (key_probe != end && (*key_probe == '[' || *key_probe == '{'));
  ------------------
  |  Branch (5058:53): [True: 608k, False: 0]
  |  Branch (5058:74): [True: 1.60k, False: 607k]
  |  Branch (5058:95): [True: 1.71k, False: 605k]
  ------------------
 5059|   608k|                     if (complex_flow_key) {
  ------------------
  |  Branch (5059:26): [True: 3.32k, False: 605k]
  ------------------
 5060|  3.32k|                        glz::generic key_node{};
 5061|  3.32k|                        from<YAML, glz::generic>::template op<yaml::flow_context_on<Opts>()>(key_node, ctx, it, end);
 5062|  3.32k|                        if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (5062:29): [True: 1.07k, False: 2.24k]
  ------------------
 5063|  1.07k|                           return false;
 5064|  2.24k|                        if (!yaml::materialize_key(key, key_node, ctx)) [[unlikely]]
  ------------------
  |  Branch (5064:29): [True: 0, False: 2.24k]
  ------------------
 5065|      0|                           return false;
 5066|  2.24k|                     }
 5067|   605k|                     else {
 5068|   605k|                        if (!yaml::parse_yaml_key(key, ctx, it, end, false)) {
  ------------------
  |  Branch (5068:29): [True: 289, False: 605k]
  ------------------
 5069|    289|                           return false;
 5070|    289|                        }
 5071|   605k|                     }
 5072|       |                  }
 5073|       |                  else {
 5074|       |                     from<YAML, key_t>::template op<Opts>(key, ctx, it, end);
 5075|       |                     if (bool(ctx.error)) [[unlikely]]
 5076|       |                        return false;
 5077|       |                  }
 5078|       |
 5079|   607k|                  yaml::skip_inline_ws(it, end);
 5080|       |
 5081|   608k|                  if (it == end || *it != ':') {
  ------------------
  |  Branch (5081:23): [True: 2.01k, False: 606k]
  |  Branch (5081:36): [True: 429, False: 606k]
  ------------------
 5082|  1.08k|                     ctx.error = error_code::syntax_error;
 5083|  1.08k|                     return false;
 5084|  1.08k|                  }
 5085|   607k|                  ++it;
 5086|   607k|                  yaml::skip_inline_ws(it, end);
 5087|       |
 5088|   607k|                  val_t val{};
 5089|   607k|                  if (!parse_map_value(val)) [[unlikely]]
  ------------------
  |  Branch (5089:23): [True: 9.40k, False: 598k]
  ------------------
 5090|  9.40k|                     return false;
 5091|       |
 5092|   598k|                  value.emplace(std::move(key), std::move(val));
 5093|   598k|                  return true;
 5094|   607k|               });
_ZZZN3glz4fromILj450ENS_17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES1_EEEEE2opITnDaXtlNS_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj1EEERPKcRS5_TkNS_10is_contextERNS8_12yaml_contextESB_EEvOT1_OT2_OT0_T3_ENKUlRT_RSK_SG_iE_clISE_SB_SB_EEbSO_SP_SG_iENKUlvE_clEv:
 4915|   374k|                        const bool key_content_spans_lines = [&] {
 4916|   374k|                           auto scan = key_it;
 4917|   414k|                           while (scan != content && scan != end) {
  ------------------
  |  Branch (4917:35): [True: 264k, False: 149k]
  |  Branch (4917:54): [True: 264k, False: 0]
  ------------------
 4918|   264k|                              if (*scan == '\n' || *scan == '\r') return true;
  ------------------
  |  Branch (4918:35): [True: 169k, False: 94.9k]
  |  Branch (4918:52): [True: 55.4k, False: 39.4k]
  ------------------
 4919|  39.4k|                              ++scan;
 4920|  39.4k|                           }
 4921|   149k|                           return false;
 4922|   374k|                        }();
_ZZZN3glz4fromILj450ENS_17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES1_EEEEE2opITnDaXtlNS_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj1EEERPKcRS5_TkNS_10is_contextERNS8_12yaml_contextESB_EEvOT1_OT2_OT0_T3_ENKUlRT_RSK_SG_iE_clISE_SB_SB_EEbSO_SP_SG_iENKUlRS4_E0_clESS_:
 4858|   346k|                        auto to_string_key = [&](glz::generic& key_node) {
 4859|   346k|                           return yaml::materialize_key(key, key_node, ctx);
 4860|   346k|                        };
_ZZZN3glz4fromILj450ENS_17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES1_EEEEE2opITnDaXtlNS_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj1EEERPKcRS5_TkNS_10is_contextERNS8_12yaml_contextESB_EEvOT1_OT2_OT0_T3_ENKUlRT_RSK_SG_iE_clISE_SB_SB_EEbSO_SP_SG_iENKUlRS4_E_clESS_:
 4778|   709k|                  auto parse_map_value = [&](val_t& val) -> bool {
 4779|   709k|                     if (it != end && !yaml::line_end_or_comment_table[static_cast<uint8_t>(*it)]) {
  ------------------
  |  Branch (4779:26): [True: 688k, False: 21.4k]
  |  Branch (4779:39): [True: 491k, False: 196k]
  ------------------
 4780|   491k|                        bool line_starts_with_explicit_value_indicator = false;
 4781|       |
 4782|       |                        // Inline mapping values in block context cannot start with a
 4783|       |                        // plain "key: value" pair on the same line (e.g. "a: b: c").
 4784|       |                        // Such constructs are malformed unless wrapped in flow
 4785|       |                        // delimiters ({...} / [...]) or quoted.
 4786|   491k|                        if constexpr (std::is_pointer_v<std::decay_t<decltype(it)>>) {
 4787|   491k|                           if (ctx.stream_begin) {
  ------------------
  |  Branch (4787:32): [True: 491k, False: 0]
  ------------------
 4788|   491k|                              auto is_line_content_start = [&](auto pos) {
 4789|   491k|                                 return !ctx.line_prefix_before(pos).has_content;
 4790|   491k|                              };
 4791|       |
 4792|   491k|                              auto line_has_explicit_value_indicator = [&](auto pos) {
 4793|   491k|                                 const char* line = ctx.line_begin_of(pos);
 4794|   491k|                                 while (line != end && (*line == ' ' || *line == '\t')) ++line;
 4795|   491k|                                 return line != end && *line == ':';
 4796|   491k|                              };
 4797|       |
 4798|   491k|                              if (!is_line_content_start(it) &&
  ------------------
  |  Branch (4798:35): [True: 491k, False: 0]
  ------------------
 4799|   491k|                                  yaml::inline_value_has_plain_mapping_indicator(it, end) &&
  ------------------
  |  Branch (4799:35): [True: 62.5k, False: 429k]
  ------------------
 4800|  62.5k|                                  !line_has_explicit_value_indicator(it)) {
  ------------------
  |  Branch (4800:35): [True: 546, False: 61.9k]
  ------------------
 4801|    546|                                 ctx.error = error_code::syntax_error;
 4802|    546|                                 return false;
 4803|    546|                              }
 4804|   491k|                              line_starts_with_explicit_value_indicator = line_has_explicit_value_indicator(it);
 4805|   491k|                           }
 4806|   491k|                        }
 4807|       |
 4808|   491k|                        if (*it == '-' &&
  ------------------
  |  Branch (4808:29): [True: 7.09k, False: 484k]
  ------------------
 4809|  7.09k|                            ((it + 1) == end || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*(it + 1))]) &&
  ------------------
  |  Branch (4809:30): [True: 722, False: 6.37k]
  |  Branch (4809:49): [True: 3.74k, False: 2.62k]
  ------------------
 4810|  4.46k|                            !line_starts_with_explicit_value_indicator) {
  ------------------
  |  Branch (4810:29): [True: 13, False: 4.45k]
  ------------------
 4811|       |                           // "key: - item" is not valid block sequence syntax.
 4812|     13|                           ctx.error = error_code::syntax_error;
 4813|     13|                           return false;
 4814|     13|                        }
 4815|       |
 4816|   491k|                        if (!ctx.push_indent(line_indent + 1)) [[unlikely]]
  ------------------
  |  Branch (4816:29): [True: 0, False: 491k]
  ------------------
 4817|      0|                           return false;
 4818|   491k|                        from<YAML, val_t>::template op<Opts>(val, ctx, it, end);
 4819|   491k|                        ctx.pop_indent();
 4820|   491k|                     }
 4821|   218k|                     else {
 4822|   218k|                        int32_t nested_indent = yaml::detect_nested_value_indent(ctx, it, end, line_indent);
 4823|   218k|                        if (nested_indent >= 0) {
  ------------------
  |  Branch (4823:29): [True: 87.0k, False: 131k]
  ------------------
 4824|  87.0k|                           yaml::skip_to_content(it, end);
 4825|  87.0k|                           if (it != end && *it == ':' && (it + 1) != end && *(it + 1) == '\t') {
  ------------------
  |  Branch (4825:32): [True: 87.0k, False: 0]
  |  Branch (4825:45): [True: 0, False: 87.0k]
  |  Branch (4825:59): [True: 0, False: 0]
  |  Branch (4825:78): [True: 0, False: 0]
  ------------------
 4826|      0|                              ctx.error = error_code::syntax_error;
 4827|      0|                              return false;
 4828|      0|                           }
 4829|       |                           // A struct value reads the pushed indent as its own key column;
 4830|       |                           // every other value type reads it as the enclosing baseline.
 4831|  87.0k|                           const int32_t value_indent =
 4832|  87.0k|                              yaml::receives_block_mapping_column<val_t>() ? nested_indent : nested_indent - 1;
  ------------------
  |  Branch (4832:31): [Folded, False: 87.0k]
  ------------------
 4833|  87.0k|                           if (!ctx.push_indent(value_indent)) [[unlikely]]
  ------------------
  |  Branch (4833:32): [True: 0, False: 87.0k]
  ------------------
 4834|      0|                              return false;
 4835|  87.0k|                           from<YAML, val_t>::template op<Opts>(val, ctx, it, end);
 4836|  87.0k|                           ctx.pop_indent();
 4837|  87.0k|                        }
 4838|   218k|                     }
 4839|   709k|                     return !bool(ctx.error);
 4840|   709k|                  };
_ZZZZN3glz4fromILj450ENS_17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES1_EEEEE2opITnDaXtlNS_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj1EEERPKcRS5_TkNS_10is_contextERNS8_12yaml_contextESB_EEvOT1_OT2_OT0_T3_ENKUlRT_RSK_SG_iE_clISE_SB_SB_EEbSO_SP_SG_iENKUlRS4_E_clESS_ENKUlSN_E_clISB_EEDaSN_:
 4788|   491k|                              auto is_line_content_start = [&](auto pos) {
 4789|   491k|                                 return !ctx.line_prefix_before(pos).has_content;
 4790|   491k|                              };
_ZZZZN3glz4fromILj450ENS_17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES1_EEEEE2opITnDaXtlNS_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj1EEERPKcRS5_TkNS_10is_contextERNS8_12yaml_contextESB_EEvOT1_OT2_OT0_T3_ENKUlRT_RSK_SG_iE_clISE_SB_SB_EEbSO_SP_SG_iENKUlRS4_E_clESS_ENKUlSN_E0_clISB_EEDaSN_:
 4792|   553k|                              auto line_has_explicit_value_indicator = [&](auto pos) {
 4793|   553k|                                 const char* line = ctx.line_begin_of(pos);
 4794|   913k|                                 while (line != end && (*line == ' ' || *line == '\t')) ++line;
  ------------------
  |  Branch (4794:41): [True: 913k, False: 0]
  |  Branch (4794:57): [True: 357k, False: 555k]
  |  Branch (4794:73): [True: 2.25k, False: 553k]
  ------------------
 4795|   553k|                                 return line != end && *line == ':';
  ------------------
  |  Branch (4795:41): [True: 553k, False: 0]
  |  Branch (4795:56): [True: 252k, False: 300k]
  ------------------
 4796|   553k|                              };
_ZZN3glz4fromILj450ENS_17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES1_EEEEE2opITnDaXtlNS_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj1EEERPKcRS5_TkNS_10is_contextERNS8_12yaml_contextESB_EEvOT1_OT2_OT0_T3_EN19merge_restore_guardD2Ev:
 4547|  2.40M|            {
 4548|       |               // emplace is a no-op for keys the document already wrote, so only
 4549|       |               // untouched pre-existing entries are put back.
 4550|  2.40M|               for (auto& entry : saved) {
  ------------------
  |  Branch (4550:33): [True: 0, False: 2.40M]
  ------------------
 4551|      0|                  target.emplace(entry.first, std::move(entry.second));
 4552|      0|               }
 4553|  2.40M|            }
_ZN3glz33process_yaml_variant_alternativesINSt3__17variantIJDndNS1_12basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEbNS1_6vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS6_ISD_EEEENSC_ISD_EEEEENS_21is_yaml_variant_arrayEE2opITnDaXtlNS_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj1EEERSH_TkNS_10is_contextERNSL_12yaml_contextERPKcSR_EEvOT0_OT1_OT2_T3_:
 5205|   820k|      {
 5206|   820k|         constexpr auto category_count = yaml_variant_count_v<Variant, Trait>;
 5207|       |
 5208|       |         if constexpr (category_count == 0) {
 5209|       |            ctx.error = error_code::no_matching_variant_type;
 5210|       |         }
 5211|   820k|         else if constexpr (category_count == 1) {
 5212|       |            // Only one type in this category, use it directly
 5213|   820k|            constexpr auto first_idx = yaml_variant_first_index_v<Variant, Trait>;
 5214|   820k|            using V = std::variant_alternative_t<first_idx, Variant>;
 5215|   820k|            if (!std::holds_alternative<V>(value)) value = V{};
  ------------------
  |  Branch (5215:17): [True: 820k, False: 0]
  ------------------
 5216|   820k|            from<YAML, V>::template op<Opts>(std::get<V>(value), ctx, it, end);
 5217|       |         }
 5218|       |         else {
 5219|       |            // Multiple types in this category, try each one
 5220|       |            constexpr auto N = std::variant_size_v<Variant>;
 5221|       |            bool found_match{};
 5222|       |            size_t match_idx = 0;
 5223|       |            // Only the last alternative propagates its error, so an alternative that exhausted an
 5224|       |            // expansion budget would otherwise be reported as no_matching_variant_type -- a wrong
 5225|       |            // diagnosis for a document that is hostile rather than merely the wrong shape. Held
 5226|       |            // aside and used only if nothing matched, so an alternative that does succeed later
 5227|       |            // (one that materializes no key text can still parse under a latched budget) is
 5228|       |            // unaffected.
 5229|       |            error_code expansion_error{};
 5230|       |            std::string_view expansion_message{};
 5231|       |
 5232|       |            for_each<N>([&]<size_t I>() {
 5233|       |               if (found_match) {
 5234|       |                  return;
 5235|       |               }
 5236|       |               using V = std::variant_alternative_t<I, Variant>;
 5237|       |               if constexpr (Trait<V>::value) {
 5238|       |                  auto copy_it = it;
 5239|       |                  if (!std::holds_alternative<V>(value)) {
 5240|       |                     value = V{};
 5241|       |                  }
 5242|       |
 5243|       |                  auto temp_ctx = ctx.make_speculative();
 5244|       |                  from<YAML, V>::template op<Opts>(std::get<V>(value), temp_ctx, it, end);
 5245|       |
 5246|       |                  // Charged whether or not the alternative fit: a rejected probe still replayed
 5247|       |                  // whatever aliases it reached, and an attempt that is never billed is an
 5248|       |                  // attempt that can be repeated for free.
 5249|       |                  ctx.alias_expansion_budget = temp_ctx.alias_expansion_budget;
 5250|       |                  ctx.key_expansion_budget = temp_ctx.key_expansion_budget;
 5251|       |
 5252|       |                  if (!bool(temp_ctx.error)) {
 5253|       |                     found_match = true;
 5254|       |                     ctx.anchors = std::move(temp_ctx.anchors);
 5255|       |                  }
 5256|       |                  else {
 5257|       |                     it = copy_it;
 5258|       |                     if (temp_ctx.error == error_code::exceeded_max_expansion && expansion_error == error_code::none) {
 5259|       |                        expansion_error = temp_ctx.error;
 5260|       |                        expansion_message = temp_ctx.custom_error_message;
 5261|       |                     }
 5262|       |                     if (match_idx + 1 < category_count) {
 5263|       |                        // Not the last type, continue trying
 5264|       |                     }
 5265|       |                     else {
 5266|       |                        // Last type failed, propagate error
 5267|       |                        ctx.error = temp_ctx.error;
 5268|       |                        ctx.custom_error_message = temp_ctx.custom_error_message;
 5269|       |                     }
 5270|       |                  }
 5271|       |                  ++match_idx;
 5272|       |               }
 5273|       |            });
 5274|       |
 5275|       |            if (!found_match && !bool(ctx.error)) {
 5276|       |               if (expansion_error != error_code::none) {
 5277|       |                  ctx.error = expansion_error;
 5278|       |                  ctx.custom_error_message = expansion_message;
 5279|       |               }
 5280|       |               else {
 5281|       |                  ctx.error = error_code::no_matching_variant_type;
 5282|       |               }
 5283|       |            }
 5284|       |         }
 5285|   820k|      }
_ZN3glz4fromILj450ENSt3__16vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS1_9allocatorIS6_EEEEE2opITnDaXtlNS_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj1EEERPKcRS9_TkNS_10is_contextERNSC_12yaml_contextESF_EEvOT1_OT2_OT0_T3_:
 4098|   850k|      {
 4099|   850k|         if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4099:14): [True: 0, False: 850k]
  ------------------
 4100|      0|            return;
 4101|       |
 4102|       |         // Peek ahead to check for tag (don't consume indentation for block sequences)
 4103|   850k|         auto peek = it;
 4104|   850k|         yaml::node_preamble_state preamble{};
 4105|   850k|         if (yaml::parse_node_preamble<Opts>(value, ctx, peek, end, preamble,
  ------------------
  |  Branch (4105:14): [True: 32.4k, False: 817k]
  ------------------
 4106|   850k|                                             [](yaml::yaml_tag tag) { return yaml::tag_valid_for_seq(tag); })) {
 4107|  32.4k|            it = peek;
 4108|  32.4k|            return;
 4109|  32.4k|         }
 4110|       |
 4111|   817k|         if (*peek == '[') {
  ------------------
  |  Branch (4111:14): [True: 113k, False: 704k]
  ------------------
 4112|       |            // Flow sequence - consume whitespace and parse
 4113|   113k|            it = peek;
 4114|   113k|            yaml::parse_flow_sequence<Opts>(value, ctx, it, end);
 4115|   113k|         }
 4116|   704k|         else if (*peek == '-') {
  ------------------
  |  Branch (4116:19): [True: 704k, False: 164]
  ------------------
 4117|       |            // Block sequence - don't consume leading whitespace, let parse_block_sequence handle it
 4118|       |            // But if there was a tag, we need to advance past it
 4119|   704k|            if (preamble.tag != yaml::yaml_tag::none || preamble.node_props.has_anchor) {
  ------------------
  |  Branch (4119:17): [True: 5.46k, False: 698k]
  |  Branch (4119:57): [True: 5.06k, False: 693k]
  ------------------
 4120|  10.5k|               it = peek;
 4121|  10.5k|            }
 4122|   704k|            int32_t seq_indent = ctx.current_indent();
 4123|   704k|            if (*it == '-' && ctx.current_indent() >= 0) {
  ------------------
  |  Branch (4123:17): [True: 703k, False: 886]
  |  Branch (4123:31): [True: 127k, False: 576k]
  ------------------
 4124|   127k|               seq_indent = ctx.allow_indentless_sequence ? (ctx.current_indent() > 0 ? (ctx.current_indent() - 1) : 0)
  ------------------
  |  Branch (4124:29): [True: 18.6k, False: 108k]
  |  Branch (4124:62): [True: 13.2k, False: 5.40k]
  ------------------
 4125|   127k|                                                          : (ctx.current_indent() + 1);
 4126|   127k|            }
 4127|   704k|            yaml::parse_block_sequence<Opts>(value, ctx, it, end, seq_indent);
 4128|   704k|         }
 4129|    164|         else {
 4130|    164|            ctx.error = error_code::syntax_error;
 4131|    164|         }
 4132|       |
 4133|   817k|         yaml::finalize_node_anchor(preamble.node_props, ctx, it);
 4134|   817k|      }
_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|   850k|      {
  466|   850k|         skip_inline_ws(it, end);
  467|       |
  468|   850k|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (468:14): [True: 9, False: 850k]
  ------------------
  469|      9|            if constexpr (!AllowEmptyInput) {
  470|      9|               ctx.error = error_code::unexpected_end;
  471|      9|            }
  472|      9|            return true;
  473|      9|         }
  474|       |
  475|   850k|         preamble.tag = parse_yaml_tag(it, end, ctx);
  476|   850k|         if (preamble.tag == yaml_tag::unknown) [[unlikely]] {
  ------------------
  |  Branch (476:14): [True: 3, False: 850k]
  ------------------
  477|      3|            ctx.error = error_code::syntax_error;
  478|      3|            return true;
  479|      3|         }
  480|   850k|         if (!tag_validator(preamble.tag)) [[unlikely]] {
  ------------------
  |  Branch (480:14): [True: 3, False: 850k]
  ------------------
  481|      3|            ctx.error = error_code::syntax_error;
  482|      3|            return true;
  483|      3|         }
  484|       |
  485|   850k|         skip_inline_ws(it, end);
  486|       |
  487|   850k|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (487:14): [True: 4, False: 850k]
  ------------------
  488|      4|            if constexpr (!AllowEmptyInput) {
  489|      4|               ctx.error = error_code::unexpected_end;
  490|      4|            }
  491|      4|            return true;
  492|      4|         }
  493|       |
  494|   850k|         if (parse_node_properties<Opts, PropertyPolicy>(std::forward<T>(value), ctx, it, end, preamble.node_props)) {
  ------------------
  |  Branch (494:14): [True: 32.4k, False: 817k]
  ------------------
  495|  32.4k|            return true;
  496|  32.4k|         }
  497|       |
  498|   817k|         return false;
  499|   850k|      }
_ZZN3glz4fromILj450ENSt3__16vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS1_9allocatorIS6_EEEEE2opITnDaXtlNS_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj1EEERPKcRS9_TkNS_10is_contextERNSC_12yaml_contextESF_EEvOT1_OT2_OT0_T3_ENKUlNSC_8yaml_tagEE_clESR_:
 4106|   850k|                                             [](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|   850k|      {
  409|   850k|         state.has_anchor = false;
  410|   850k|         state.anchor_name.clear();
  411|   850k|         state.anchor_start = nullptr;
  412|   850k|         state.anchor_indent = ctx.current_indent();
  413|       |
  414|   850k|         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|   850k|            else {
  421|   850k|               if (handle_alias<Opts>(std::forward<T>(value), ctx, it, end)) return true;
  ------------------
  |  Branch (421:20): [True: 32.3k, False: 818k]
  ------------------
  422|   850k|            }
  423|   850k|         }
  424|       |
  425|   850k|         if (it != end && *it == '&') {
  ------------------
  |  Branch (425:14): [True: 818k, False: 32.3k]
  |  Branch (425:27): [True: 6.45k, False: 811k]
  ------------------
  426|  6.45k|            ++it;
  427|  6.45k|            auto name = parse_anchor_name(it, end);
  428|  6.45k|            if (name.empty()) {
  ------------------
  |  Branch (428:17): [True: 12, False: 6.44k]
  ------------------
  429|     12|               ctx.error = error_code::syntax_error;
  430|     12|               return true;
  431|     12|            }
  432|  6.44k|            skip_inline_ws(it, end);
  433|  6.44k|            if (it == end) {
  ------------------
  |  Branch (433:17): [True: 47, False: 6.39k]
  ------------------
  434|     47|               if constexpr (!Policy.allow_empty_after_anchor) {
  435|     47|                  ctx.error = error_code::unexpected_end;
  436|     47|               }
  437|     47|               return true;
  438|     47|            }
  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.39k|            state.has_anchor = true;
  446|  6.39k|            state.anchor_name = std::string(name);
  447|  6.39k|            state.anchor_start = &*it;
  448|  6.39k|         }
  449|       |
  450|   850k|         return false;
  451|   850k|      }
_ZN3glz4yaml12handle_aliasITnDaXtlNS0_9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj1EEERNSt3__16vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS3_9allocatorIS8_EEEENS0_12yaml_contextEPKcSF_EEbOT0_RT1_RT2_T3_:
  300|   850k|      {
  301|   850k|         if (it == end || *it != '*') return false;
  ------------------
  |  Branch (301:14): [True: 0, False: 850k]
  |  Branch (301:27): [True: 818k, False: 32.3k]
  ------------------
  302|       |
  303|  32.3k|         ++it; // skip '*'
  304|  32.3k|         auto name = parse_anchor_name(it, end);
  305|  32.3k|         if (name.empty()) {
  ------------------
  |  Branch (305:14): [True: 5, False: 32.3k]
  ------------------
  306|      5|            ctx.error = error_code::syntax_error;
  307|      5|            return true;
  308|      5|         }
  309|       |
  310|  32.3k|         auto anchor_it = ctx.anchors.find(name);
  311|  32.3k|         if (anchor_it == ctx.anchors.end()) {
  ------------------
  |  Branch (311:14): [True: 52, False: 32.2k]
  ------------------
  312|     52|            ctx.error = error_code::syntax_error; // undefined alias
  313|     52|            return true;
  314|     52|         }
  315|       |
  316|       |         // Copied rather than referenced: the replay below can replace ctx.anchors wholesale
  317|       |         // (a speculative parse hands its own map back), which would dangle a reference here.
  318|  32.2k|         const auto span = anchor_it->second;
  319|       |
  320|       |         // Empty anchor span (anchor on null/empty node) — leave value as default
  321|  32.2k|         if (span.begin == span.end) {
  ------------------
  |  Branch (321:14): [True: 2.14k, False: 30.1k]
  ------------------
  322|  2.14k|            return true;
  323|  2.14k|         }
  324|       |
  325|       |         // An anchor is invisible to itself while it expands. A span that aliases the name it
  326|       |         // defines -- reachable because a mapping key's anchor is registered over the key text
  327|       |         // before that text is parsed -- would otherwise replay itself forever.
  328|  30.1k|         if (ctx.alias_span_is_replaying(span.begin, span.end)) [[unlikely]] {
  ------------------
  |  Branch (328:14): [True: 10, False: 30.1k]
  ------------------
  329|     10|            ctx.error = error_code::syntax_error; // cyclic alias
  330|     10|            return true;
  331|     10|         }
  332|       |
  333|       |         // Replaying an anchor re-enters the reader directly, bypassing the variant reader's
  334|       |         // depth guard, so this is the only depth accounting a chain of aliases into a
  335|       |         // non-variant target gets. The cycle check above stops the unbounded case; this bounds
  336|       |         // a legitimate but deeply chained one.
  337|  30.1k|         depth_guard guard{ctx, yaml::max_yaml_recursive_depth};
  338|  30.1k|         if (!guard) [[unlikely]]
  ------------------
  |  Branch (338:14): [True: 2, False: 30.1k]
  ------------------
  339|      2|            return true;
  340|       |
  341|  30.1k|         if (!ctx.charge_alias_expansion(static_cast<size_t>(span.end - span.begin))) [[unlikely]] {
  ------------------
  |  Branch (341:14): [True: 2, False: 30.1k]
  ------------------
  342|      2|            ctx.error = error_code::exceeded_max_expansion;
  343|      2|            ctx.custom_error_message = "alias expansion";
  344|      2|            return true;
  345|      2|         }
  346|       |
  347|  30.1k|         auto replay_it = span.begin;
  348|  30.1k|         auto replay_end = span.end;
  349|       |
  350|       |         // Save indent context and set up for replay
  351|  30.1k|         auto saved_indent_stack = std::move(ctx.indent_stack);
  352|  30.1k|         ctx.indent_stack.clear();
  353|  30.1k|         if (span.base_indent > 0) {
  ------------------
  |  Branch (353:14): [True: 3.29k, False: 26.8k]
  ------------------
  354|  3.29k|            ctx.push_indent(span.base_indent - 1);
  355|  3.29k|         }
  356|       |
  357|  30.1k|         ctx.active_alias_spans.emplace_back(span.begin, span.end);
  358|       |
  359|  30.1k|         using V = std::remove_cvref_t<T>;
  360|  30.1k|         from<YAML, V>::template op<Opts>(std::forward<T>(value), ctx, replay_it, replay_end);
  361|       |
  362|  30.1k|         ctx.active_alias_spans.pop_back();
  363|       |
  364|       |         // Restore indent context
  365|  30.1k|         ctx.indent_stack = std::move(saved_indent_stack);
  366|  30.1k|         return true;
  367|  30.1k|      }
_ZN3glz4yaml19parse_flow_sequenceITnDaXtlNS0_9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj1EEERNSt3__16vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS3_9allocatorIS8_EEEENS0_12yaml_contextEPKcSF_EEvOT0_RT1_RT2_T3_:
 2596|   113k|      {
 2597|   113k|         using V = std::remove_cvref_t<T>;
 2598|   113k|         using value_type = typename V::value_type;
 2599|       |
 2600|   113k|         struct sequence_container_adapter
 2601|   113k|         {
 2602|   113k|            size_t index = 0;
 2603|       |
 2604|   113k|            inline bool fixed_capacity_reached(const V& container) const noexcept
 2605|   113k|            {
 2606|   113k|               if constexpr (!resizable<V>) {
 2607|   113k|                  return index >= container.size();
 2608|   113k|               }
 2609|   113k|               else {
 2610|   113k|                  (void)container;
 2611|   113k|                  return false;
 2612|   113k|               }
 2613|   113k|            }
 2614|       |
 2615|   113k|            inline void commit_fixed_slot() noexcept { ++index; }
 2616|       |
 2617|   113k|            inline void append(V& container, value_type&& element) noexcept
 2618|   113k|            {
 2619|   113k|               if constexpr (emplace_backable<V>) {
 2620|   113k|                  container.emplace_back(std::move(element));
 2621|   113k|               }
 2622|   113k|               else if constexpr (emplaceable<V>) {
 2623|   113k|                  container.emplace(std::move(element));
 2624|   113k|               }
 2625|   113k|            }
 2626|   113k|         };
 2627|       |
 2628|   113k|         if (it == end || *it != '[') [[unlikely]] {
  ------------------
  |  Branch (2628:14): [True: 0, False: 113k]
  |  Branch (2628:27): [True: 0, False: 113k]
  ------------------
 2629|      0|            ctx.error = error_code::syntax_error;
 2630|      0|            return;
 2631|      0|         }
 2632|       |
 2633|       |         // Overwrite (do not append to) any pre-existing contents. Must happen
 2634|       |         // before the empty-array early return below so that `[]` also clears.
 2635|   113k|         clear_sequence_before_read<Opts>(value);
 2636|       |
 2637|   113k|         ++it; // Skip '['
 2638|       |         // Skip whitespace and newlines after opening bracket (YAML allows multi-line flow sequences)
 2639|   113k|         skip_flow_ws_and_newlines(ctx, it, end);
 2640|   113k|         if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2640:14): [True: 12, False: 113k]
  ------------------
 2641|     12|            return;
 2642|       |
 2643|       |         // Handle empty array
 2644|   113k|         if (it != end && *it == ']') {
  ------------------
  |  Branch (2644:14): [True: 112k, False: 904]
  |  Branch (2644:27): [True: 20.3k, False: 92.4k]
  ------------------
 2645|  20.3k|            ++it;
 2646|  20.3k|            validate_flow_node_adjacent_tail(ctx, it, end);
 2647|  20.3k|            if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2647:17): [True: 11, False: 20.3k]
  ------------------
 2648|     11|               return;
 2649|       |            if constexpr (!yaml::check_flow_context(Opts)) {
 2650|       |               if (ctx.current_indent() < 0) {
 2651|       |                  validate_root_flow_tail_after_close(ctx, it, end);
 2652|       |               }
 2653|       |            }
 2654|  20.3k|            return;
 2655|  20.3k|         }
 2656|       |
 2657|  93.3k|         bool just_saw_comma = false;
 2658|  93.3k|         sequence_container_adapter adapter{};
 2659|       |
 2660|  93.3k|         if constexpr (emplace_backable<V> || emplaceable<V>) {
 2661|       |            // Dynamic containers append items (vector-like and set-like)
 2662|   171k|            while (it != end) {
  ------------------
  |  Branch (2662:20): [True: 169k, False: 1.72k]
  ------------------
 2663|   169k|               skip_flow_ws_and_newlines(ctx, it, end);
 2664|   169k|               if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2664:20): [True: 0, False: 169k]
  ------------------
 2665|      0|                  return;
 2666|       |
 2667|   169k|               if (it == end) [[unlikely]] {
  ------------------
  |  Branch (2667:20): [True: 0, False: 169k]
  ------------------
 2668|      0|                  ctx.error = error_code::unexpected_end;
 2669|      0|                  return;
 2670|      0|               }
 2671|       |
 2672|   169k|               if (*it == ']') {
  ------------------
  |  Branch (2672:20): [True: 12.4k, False: 157k]
  ------------------
 2673|  12.4k|                  if (just_saw_comma) {
  ------------------
  |  Branch (2673:23): [True: 12.4k, False: 0]
  ------------------
 2674|  12.4k|                     ++it;
 2675|  12.4k|                     validate_flow_node_adjacent_tail(ctx, it, end);
 2676|  12.4k|                     if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2676:26): [True: 11, False: 12.4k]
  ------------------
 2677|     11|                        return;
 2678|       |                     if constexpr (!yaml::check_flow_context(Opts)) {
 2679|       |                        if (ctx.current_indent() < 0) {
 2680|       |                           validate_root_flow_tail_after_close(ctx, it, end);
 2681|       |                        }
 2682|       |                     }
 2683|  12.4k|                     return;
 2684|  12.4k|                  }
 2685|      0|                  ctx.error = error_code::syntax_error;
 2686|      0|                  return;
 2687|  12.4k|               }
 2688|       |
 2689|   157k|               if (*it == ',' || *it == '#') {
  ------------------
  |  Branch (2689:20): [True: 348, False: 156k]
  |  Branch (2689:34): [True: 18, False: 156k]
  ------------------
 2690|    366|                  ctx.error = error_code::syntax_error;
 2691|    366|                  return;
 2692|    366|               }
 2693|   156k|               just_saw_comma = false;
 2694|       |
 2695|   156k|               value_type element{};
 2696|   156k|               from<YAML, value_type>::template op<flow_context_on<Opts>()>(element, ctx, it, end);
 2697|       |
 2698|   156k|               if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2698:20): [True: 18.4k, False: 138k]
  ------------------
 2699|  18.4k|                  return;
 2700|       |
 2701|   138k|               bool saw_line_break_before_separator = false;
 2702|   138k|               skip_flow_ws_and_newlines(ctx, it, end, &saw_line_break_before_separator);
 2703|   138k|               if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2703:20): [True: 27, False: 138k]
  ------------------
 2704|     27|                  return;
 2705|       |
 2706|   138k|               if (it != end && *it == ':') {
  ------------------
  |  Branch (2706:20): [True: 136k, False: 2.28k]
  |  Branch (2706:33): [True: 21.1k, False: 115k]
  ------------------
 2707|       |                  // In flow sequences, implicit key-value pairs must be on a single line.
 2708|  21.1k|                  if (saw_line_break_before_separator) {
  ------------------
  |  Branch (2708:23): [True: 53, False: 21.0k]
  ------------------
 2709|     53|                     ctx.error = error_code::syntax_error;
 2710|     53|                     return;
 2711|     53|                  }
 2712|  21.0k|                  if constexpr (std::same_as<std::remove_cvref_t<value_type>, glz::generic>) {
 2713|  21.0k|                     glz::generic key_node = std::move(element);
 2714|  21.0k|                     ++it;
 2715|  21.0k|                     skip_inline_ws(it, end);
 2716|       |
 2717|  21.0k|                     glz::generic mapped{};
 2718|  21.0k|                     from<YAML, glz::generic>::template op<flow_context_on<Opts>()>(mapped, ctx, it, end);
 2719|  21.0k|                     if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2719:26): [True: 1.11k, False: 19.9k]
  ------------------
 2720|  1.11k|                        return;
 2721|       |
 2722|  19.9k|                     std::string key;
 2723|  19.9k|                     if (!yaml::materialize_key(key, key_node, ctx)) [[unlikely]]
  ------------------
  |  Branch (2723:26): [True: 17, False: 19.9k]
  ------------------
 2724|     17|                        return;
 2725|       |
 2726|  19.9k|                     glz::generic pair{};
 2727|  19.9k|                     pair[key] = std::move(mapped);
 2728|  19.9k|                     element = std::move(pair);
 2729|       |
 2730|  19.9k|                     skip_flow_ws_and_newlines(ctx, it, end);
 2731|  19.9k|                     if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2731:26): [True: 5, False: 19.9k]
  ------------------
 2732|      5|                        return;
 2733|       |                  }
 2734|       |                  else {
 2735|       |                     ctx.error = error_code::syntax_error;
 2736|       |                     return;
 2737|       |                  }
 2738|  21.0k|               }
 2739|       |
 2740|   138k|               adapter.append(value, std::move(element));
 2741|       |
 2742|   138k|               if (it == end) [[unlikely]] {
  ------------------
  |  Branch (2742:20): [True: 2.42k, False: 135k]
  ------------------
 2743|  2.42k|                  ctx.error = error_code::unexpected_end;
 2744|  2.42k|                  return;
 2745|  2.42k|               }
 2746|       |
 2747|   135k|               if (*it == ']') {
  ------------------
  |  Branch (2747:20): [True: 55.4k, False: 80.4k]
  ------------------
 2748|  55.4k|                  ++it;
 2749|  55.4k|                  validate_flow_node_adjacent_tail(ctx, it, end);
 2750|  55.4k|                  if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2750:23): [True: 80, False: 55.3k]
  ------------------
 2751|     80|                     return;
 2752|       |                  if constexpr (!yaml::check_flow_context(Opts)) {
 2753|       |                     if (ctx.current_indent() < 0) {
 2754|       |                        validate_root_flow_tail_after_close(ctx, it, end);
 2755|       |                     }
 2756|       |                  }
 2757|  55.3k|                  return;
 2758|  55.4k|               }
 2759|  80.4k|               else if (*it == ',') {
  ------------------
  |  Branch (2759:25): [True: 78.0k, False: 2.43k]
  ------------------
 2760|  78.0k|                  ++it;
 2761|  78.0k|                  just_saw_comma = true;
 2762|  78.0k|                  skip_flow_ws_and_newlines(ctx, it, end);
 2763|  78.0k|                  if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2763:23): [True: 28, False: 78.0k]
  ------------------
 2764|     28|                     return;
 2765|  78.0k|               }
 2766|  2.43k|               else {
 2767|  2.43k|                  ctx.error = error_code::syntax_error;
 2768|  2.43k|                  return;
 2769|  2.43k|               }
 2770|   135k|            }
 2771|       |         }
 2772|       |         else if constexpr (!resizable<V>) {
 2773|       |            // Fixed-size containers (std::array)
 2774|       |            while (it != end && !adapter.fixed_capacity_reached(value)) {
 2775|       |               skip_flow_ws_and_newlines(ctx, it, end);
 2776|       |               if (bool(ctx.error)) [[unlikely]]
 2777|       |                  return;
 2778|       |
 2779|       |               if (it == end) [[unlikely]] {
 2780|       |                  ctx.error = error_code::unexpected_end;
 2781|       |                  return;
 2782|       |               }
 2783|       |
 2784|       |               if (*it == ']') {
 2785|       |                  if (just_saw_comma) {
 2786|       |                     ++it;
 2787|       |                     validate_flow_node_adjacent_tail(ctx, it, end);
 2788|       |                     if (bool(ctx.error)) [[unlikely]]
 2789|       |                        return;
 2790|       |                     if constexpr (!yaml::check_flow_context(Opts)) {
 2791|       |                        if (ctx.current_indent() < 0) {
 2792|       |                           validate_root_flow_tail_after_close(ctx, it, end);
 2793|       |                        }
 2794|       |                     }
 2795|       |                     return;
 2796|       |                  }
 2797|       |                  ctx.error = error_code::syntax_error;
 2798|       |                  return;
 2799|       |               }
 2800|       |
 2801|       |               if (*it == ',' || *it == '#') {
 2802|       |                  ctx.error = error_code::syntax_error;
 2803|       |                  return;
 2804|       |               }
 2805|       |               just_saw_comma = false;
 2806|       |
 2807|       |               from<YAML, value_type>::template op<flow_context_on<Opts>()>(value[adapter.index], ctx, it, end);
 2808|       |
 2809|       |               if (bool(ctx.error)) [[unlikely]]
 2810|       |                  return;
 2811|       |
 2812|       |               adapter.commit_fixed_slot();
 2813|       |               skip_flow_ws_and_newlines(ctx, it, end);
 2814|       |               if (bool(ctx.error)) [[unlikely]]
 2815|       |                  return;
 2816|       |
 2817|       |               if (it == end) [[unlikely]] {
 2818|       |                  ctx.error = error_code::unexpected_end;
 2819|       |                  return;
 2820|       |               }
 2821|       |
 2822|       |               if (*it == ']') {
 2823|       |                  ++it;
 2824|       |                  validate_flow_node_adjacent_tail(ctx, it, end);
 2825|       |                  if (bool(ctx.error)) [[unlikely]]
 2826|       |                     return;
 2827|       |                  if constexpr (!yaml::check_flow_context(Opts)) {
 2828|       |                     if (ctx.current_indent() < 0) {
 2829|       |                        validate_root_flow_tail_after_close(ctx, it, end);
 2830|       |                     }
 2831|       |                  }
 2832|       |                  return;
 2833|       |               }
 2834|       |               else if (*it == ',') {
 2835|       |                  ++it;
 2836|       |                  just_saw_comma = true;
 2837|       |                  skip_flow_ws_and_newlines(ctx, it, end);
 2838|       |                  if (bool(ctx.error)) [[unlikely]]
 2839|       |                     return;
 2840|       |               }
 2841|       |               else {
 2842|       |                  ctx.error = error_code::syntax_error;
 2843|       |                  return;
 2844|       |               }
 2845|       |            }
 2846|       |
 2847|       |            // If we exited because the fixed-size container is full but haven't seen ']',
 2848|       |            // skip to the closing bracket to consume overflow elements.
 2849|       |            int bracket_depth = 1;
 2850|       |            while (it != end && bracket_depth > 0) {
 2851|       |               if (*it == '[') {
 2852|       |                  ++bracket_depth;
 2853|       |               }
 2854|       |               else if (*it == ']') {
 2855|       |                  --bracket_depth;
 2856|       |               }
 2857|       |               ++it;
 2858|       |            }
 2859|       |         }
 2860|       |         else {
 2861|       |            ctx.error = error_code::syntax_error;
 2862|       |            return;
 2863|       |         }
 2864|  93.3k|      }
_ZN3glz4yaml26clear_sequence_before_readITnDaXtlNS0_9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj1EEENSt3__16vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS3_9allocatorIS8_EEEEEEvRT0_:
 2580|   817k|      {
 2581|   817k|         if constexpr (emplace_backable<V> && requires { value.clear(); }) {
 2582|       |            // vector-like: honor the append_arrays option, matching json/read.hpp
 2583|   817k|            if constexpr (!check_append_arrays(Opts)) {
 2584|   817k|               value.clear();
 2585|   817k|            }
 2586|       |         }
 2587|       |         else if constexpr (emplaceable<V> && requires { value.clear(); }) {
 2588|       |            // set-like: json/read.hpp clears unconditionally; append_arrays does not apply
 2589|       |            value.clear();
 2590|       |         }
 2591|   817k|      }
_ZZN3glz4yaml19parse_flow_sequenceITnDaXtlNS0_9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj1EEERNSt3__16vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS3_9allocatorIS8_EEEENS0_12yaml_contextEPKcSF_EEvOT0_RT1_RT2_T3_EN26sequence_container_adapter6appendESC_OS8_:
 2618|   137k|            {
 2619|   137k|               if constexpr (emplace_backable<V>) {
 2620|   137k|                  container.emplace_back(std::move(element));
 2621|       |               }
 2622|       |               else if constexpr (emplaceable<V>) {
 2623|       |                  container.emplace(std::move(element));
 2624|       |               }
 2625|   137k|            }
_ZN3glz4yaml20parse_block_sequenceITnDaXtlNS0_9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj1EEERNSt3__16vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS3_9allocatorIS8_EEEENS0_12yaml_contextEPKcSF_EEvOT0_RT1_RT2_T3_i:
 3081|   704k|      {
 3082|   704k|         using V = std::remove_cvref_t<T>;
 3083|   704k|         using value_type = typename V::value_type;
 3084|       |
 3085|   704k|         struct sequence_container_adapter
 3086|   704k|         {
 3087|   704k|            size_t index = 0;
 3088|       |
 3089|   704k|            inline bool fixed_capacity_reached(const V& container) const noexcept
 3090|   704k|            {
 3091|   704k|               if constexpr (!resizable<V>) {
 3092|   704k|                  return index >= container.size();
 3093|   704k|               }
 3094|   704k|               else {
 3095|   704k|                  (void)container;
 3096|   704k|                  return false;
 3097|   704k|               }
 3098|   704k|            }
 3099|       |
 3100|   704k|            inline void commit_fixed_slot() noexcept { ++index; }
 3101|       |
 3102|   704k|            inline void append(V& container, value_type&& element) noexcept
 3103|   704k|            {
 3104|   704k|               if constexpr (emplace_backable<V>) {
 3105|   704k|                  container.emplace_back(std::move(element));
 3106|   704k|               }
 3107|   704k|               else if constexpr (emplaceable<V>) {
 3108|   704k|                  container.emplace(std::move(element));
 3109|   704k|               }
 3110|   704k|            }
 3111|   704k|         };
 3112|       |
 3113|       |         // Overwrite (do not append to) any pre-existing contents. A block
 3114|       |         // sequence is only entered once a '-' item is confirmed, so clearing
 3115|       |         // up front correctly (re)assigns the container to the parsed sequence.
 3116|   704k|         clear_sequence_before_read<Opts>(value);
 3117|       |
 3118|   704k|         sequence_container_adapter adapter{};
 3119|       |
 3120|       |         // Track if this is the first item (for handling whitespace-consumed case)
 3121|   704k|         bool first_item = true;
 3122|   704k|         bool has_pending_item_anchor = false;
 3123|   704k|         std::string pending_item_anchor_name{};
 3124|   704k|         int32_t pending_item_anchor_indent = sequence_indent;
 3125|       |
 3126|  1.71M|         while (it != end) {
  ------------------
  |  Branch (3126:17): [True: 1.43M, False: 277k]
  ------------------
 3127|       |            // For fixed-size arrays (e.g. std::array), stop when we've filled all elements.
 3128|       |            // Exclude emplaceable types (e.g. std::set) which are not resizable but grow dynamically.
 3129|       |            if constexpr (!resizable<V> && !emplaceable<V>) {
 3130|       |               if (adapter.fixed_capacity_reached(value)) {
 3131|       |                  return;
 3132|       |               }
 3133|       |            }
 3134|       |
 3135|       |            // Skip blank lines and comments, track indent
 3136|  1.43M|            int32_t line_indent = 0;
 3137|  1.43M|            int32_t dash_col = -1; // actual column of the '-' on the line
 3138|  1.43M|            auto line_start = it;
 3139|       |
 3140|  2.48M|            while (it != end) {
  ------------------
  |  Branch (3140:20): [True: 2.47M, False: 16.2k]
  ------------------
 3141|  2.47M|               if (*it == '#') {
  ------------------
  |  Branch (3141:20): [True: 210k, False: 2.26M]
  ------------------
 3142|   210k|                  skip_comment(it, end);
 3143|   210k|                  skip_newline(it, end);
 3144|   210k|                  line_start = it;
 3145|   210k|                  line_indent = 0;
 3146|   210k|               }
 3147|  2.26M|               else if (*it == '\n' || *it == '\r') {
  ------------------
  |  Branch (3147:25): [True: 262k, False: 1.99M]
  |  Branch (3147:40): [True: 267k, False: 1.73M]
  ------------------
 3148|   529k|                  skip_newline(it, end);
 3149|   529k|                  line_start = it;
 3150|   529k|                  line_indent = 0;
 3151|   529k|               }
 3152|  1.73M|               else if (*it == ' ') {
  ------------------
  |  Branch (3152:25): [True: 429k, False: 1.30M]
  ------------------
 3153|   429k|                  line_start = it;
 3154|   429k|                  line_indent = 0;
 3155|  1.16M|                  while (it != end && *it == ' ') {
  ------------------
  |  Branch (3155:26): [True: 1.16M, False: 2.78k]
  |  Branch (3155:39): [True: 733k, False: 427k]
  ------------------
 3156|   733k|                     ++line_indent;
 3157|   733k|                     ++it;
 3158|   733k|                  }
 3159|       |
 3160|   429k|                  bool saw_tab = false;
 3161|   444k|                  while (it != end && (*it == ' ' || *it == '\t')) {
  ------------------
  |  Branch (3161:26): [True: 440k, False: 3.65k]
  |  Branch (3161:40): [True: 7.71k, False: 432k]
  |  Branch (3161:54): [True: 6.72k, False: 426k]
  ------------------
 3162|  14.4k|                     saw_tab = saw_tab || (*it == '\t');
  ------------------
  |  Branch (3162:32): [True: 11.3k, False: 3.05k]
  |  Branch (3162:43): [True: 3.05k, False: 0]
  ------------------
 3163|  14.4k|                     ++it;
 3164|  14.4k|                  }
 3165|       |
 3166|   429k|                  if (it == end || *it == '\n' || *it == '\r' || *it == '#') {
  ------------------
  |  Branch (3166:23): [True: 3.65k, False: 426k]
  |  Branch (3166:36): [True: 5.21k, False: 420k]
  |  Branch (3166:51): [True: 83.7k, False: 337k]
  |  Branch (3166:66): [True: 202k, False: 134k]
  ------------------
 3167|       |                     // Blank or comment line - continue to next line
 3168|   295k|                     if (it != end && *it == '#') {
  ------------------
  |  Branch (3168:26): [True: 291k, False: 3.65k]
  |  Branch (3168:39): [True: 202k, False: 89.0k]
  ------------------
 3169|   202k|                        skip_comment(it, end);
 3170|   202k|                     }
 3171|   295k|                     line_indent = 0;
 3172|   295k|                     continue;
 3173|   295k|                  }
 3174|       |
 3175|   134k|                  if (saw_tab) {
  ------------------
  |  Branch (3175:23): [True: 23, False: 134k]
  ------------------
 3176|     23|                     ctx.error = error_code::syntax_error;
 3177|     23|                     return;
 3178|     23|                  }
 3179|   134k|                  break; // Found content
 3180|   134k|               }
 3181|  1.30M|               else if (*it == '\t') {
  ------------------
  |  Branch (3181:25): [True: 18.0k, False: 1.28M]
  ------------------
 3182|  18.0k|                  line_start = it;
 3183|  39.7k|                  while (it != end && (*it == ' ' || *it == '\t')) ++it;
  ------------------
  |  Branch (3183:26): [True: 38.3k, False: 1.37k]
  |  Branch (3183:40): [True: 1.99k, False: 36.3k]
  |  Branch (3183:54): [True: 19.7k, False: 16.6k]
  ------------------
 3184|  18.0k|                  if (it == end || *it == '\n' || *it == '\r' || *it == '#') {
  ------------------
  |  Branch (3184:23): [True: 1.37k, False: 16.6k]
  |  Branch (3184:36): [True: 683, False: 16.0k]
  |  Branch (3184:51): [True: 8.72k, False: 7.28k]
  |  Branch (3184:66): [True: 7.25k, False: 26]
  ------------------
 3185|  18.0k|                     if (it != end && *it == '#') {
  ------------------
  |  Branch (3185:26): [True: 16.6k, False: 1.37k]
  |  Branch (3185:39): [True: 7.25k, False: 9.41k]
  ------------------
 3186|  7.25k|                        skip_comment(it, end);
 3187|  7.25k|                     }
 3188|  18.0k|                     line_indent = 0;
 3189|  18.0k|                     continue;
 3190|  18.0k|                  }
 3191|     26|                  ctx.error = error_code::syntax_error;
 3192|     26|                  return;
 3193|  18.0k|               }
 3194|  1.28M|               else {
 3195|       |                  // At content (no leading space on this line)
 3196|       |                  // If first item and at '-', whitespace was consumed by caller;
 3197|       |                  // treat as having correct indentation
 3198|  1.28M|                  if (first_item && *it == '-') {
  ------------------
  |  Branch (3198:23): [True: 704k, False: 579k]
  |  Branch (3198:37): [True: 703k, False: 882]
  ------------------
 3199|   703k|                     line_indent = sequence_indent;
 3200|   703k|                     if constexpr (std::is_pointer_v<std::decay_t<It>>) {
 3201|   703k|                        if (ctx.stream_begin && it > ctx.stream_begin) {
  ------------------
  |  Branch (3201:29): [True: 703k, False: 0]
  |  Branch (3201:49): [True: 703k, False: 0]
  ------------------
 3202|   703k|                           auto probe = it;
 3203|   703k|                           int32_t leading_ws = 0;
 3204|   703k|                           bool saw_tab = false;
 3205|  1.28M|                           while (probe > ctx.stream_begin && (*(probe - 1) == ' ' || *(probe - 1) == '\t')) {
  ------------------
  |  Branch (3205:35): [True: 1.28M, False: 0]
  |  Branch (3205:64): [True: 572k, False: 715k]
  |  Branch (3205:87): [True: 12.0k, False: 703k]
  ------------------
 3206|   584k|                              --probe;
 3207|   584k|                              ++leading_ws;
 3208|   584k|                              saw_tab = saw_tab || (*probe == '\t');
  ------------------
  |  Branch (3208:41): [True: 5.76k, False: 578k]
  |  Branch (3208:52): [True: 6.71k, False: 571k]
  ------------------
 3209|   584k|                           }
 3210|   703k|                           if (probe == ctx.stream_begin || *(probe - 1) == '\n' || *(probe - 1) == '\r') {
  ------------------
  |  Branch (3210:32): [True: 0, False: 703k]
  |  Branch (3210:61): [True: 23.1k, False: 680k]
  |  Branch (3210:85): [True: 166k, False: 513k]
  ------------------
 3211|   189k|                              if (saw_tab) {
  ------------------
  |  Branch (3211:35): [True: 4, False: 189k]
  ------------------
 3212|      4|                                 ctx.error = error_code::syntax_error;
 3213|      4|                                 return;
 3214|      4|                              }
 3215|   189k|                              line_indent = (std::max)(line_indent, leading_ws);
 3216|   189k|                           }
 3217|   703k|                        }
 3218|   703k|                     }
 3219|   703k|                  }
 3220|   703k|                  break;
 3221|  1.28M|               }
 3222|  2.47M|            }
 3223|       |
 3224|  1.43M|            if (it == end) break;
  ------------------
  |  Branch (3224:17): [True: 16.2k, False: 1.41M]
  ------------------
 3225|       |
 3226|       |            // Check for document end marker
 3227|  1.41M|            if (at_document_end(it, end)) break;
  ------------------
  |  Branch (3227:17): [True: 5.05k, False: 1.41M]
  ------------------
 3228|       |
 3229|       |            // Check for dedent
 3230|  1.41M|            if (line_indent < sequence_indent) {
  ------------------
  |  Branch (3230:17): [True: 37.9k, False: 1.37M]
  ------------------
 3231|  37.9k|               it = line_start;
 3232|  37.9k|               return;
 3233|  37.9k|            }
 3234|       |
 3235|  1.37M|            if (*it == '&') {
  ------------------
  |  Branch (3235:17): [True: 35.7k, False: 1.33M]
  ------------------
 3236|       |               // Standalone anchor lines before "- item" are only supported for
 3237|       |               // indentless mapping values. At top-level block sequences these are
 3238|       |               // malformed in yaml-test-suite cases.
 3239|  35.7k|               if (!ctx.allow_indentless_sequence) {
  ------------------
  |  Branch (3239:20): [True: 7, False: 35.7k]
  ------------------
 3240|      7|                  ctx.error = error_code::syntax_error;
 3241|      7|                  return;
 3242|      7|               }
 3243|       |
 3244|  35.7k|               ++it;
 3245|  35.7k|               auto pending_name = parse_anchor_name(it, end);
 3246|  35.7k|               if (pending_name.empty()) {
  ------------------
  |  Branch (3246:20): [True: 16, False: 35.7k]
  ------------------
 3247|     16|                  ctx.error = error_code::syntax_error;
 3248|     16|                  return;
 3249|     16|               }
 3250|  35.7k|               skip_inline_ws(it, end);
 3251|  35.7k|               if (it != end && *it == '#') {
  ------------------
  |  Branch (3251:20): [True: 35.6k, False: 65]
  |  Branch (3251:33): [True: 17.0k, False: 18.6k]
  ------------------
 3252|  17.0k|                  skip_comment(it, end);
 3253|  17.0k|               }
 3254|       |
 3255|  35.7k|               has_pending_item_anchor = true;
 3256|  35.7k|               pending_item_anchor_name = std::string(pending_name);
 3257|  35.7k|               pending_item_anchor_indent = line_indent;
 3258|       |
 3259|  35.7k|               if (it == end || (*it != '\n' && *it != '\r')) {
  ------------------
  |  Branch (3259:20): [True: 86, False: 35.6k]
  |  Branch (3259:34): [True: 24.8k, False: 10.8k]
  |  Branch (3259:49): [True: 82, False: 24.7k]
  ------------------
 3260|    168|                  ctx.error = error_code::syntax_error;
 3261|    168|                  return;
 3262|    168|               }
 3263|       |
 3264|  35.5k|               skip_newline(it, end);
 3265|  35.5k|               continue;
 3266|  35.7k|            }
 3267|       |
 3268|       |            // Expect dash for sequence item
 3269|  1.33M|            if (*it != '-') {
  ------------------
  |  Branch (3269:17): [True: 342k, False: 996k]
  ------------------
 3270|   342k|               it = line_start;
 3271|   342k|               return;
 3272|   342k|            }
 3273|       |
 3274|       |            // Compute the actual column of this sequence dash.
 3275|       |            // This is needed by plain-scalar multiline folding to distinguish
 3276|       |            // sibling "- item" entries from deeper "- " continuation content.
 3277|   996k|            dash_col = line_indent;
 3278|   996k|            if constexpr (std::is_pointer_v<std::decay_t<It>>) {
 3279|   996k|               if (ctx.stream_begin) {
  ------------------
  |  Branch (3279:20): [True: 996k, False: 4]
  ------------------
 3280|   996k|                  dash_col = ctx.line_prefix_before(&*it).column;
 3281|   996k|               }
 3282|   996k|            }
 3283|       |
 3284|   996k|            ++it; // Skip '-'
 3285|       |
 3286|       |            // Check for valid sequence item indicator (- followed by space or newline)
 3287|   996k|            if (it != end && !yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*it)]) {
  ------------------
  |  Branch (3287:17): [True: 986k, False: 10.3k]
  |  Branch (3287:30): [True: 24.0k, False: 962k]
  ------------------
 3288|       |               // Not a sequence item (could be a number like -5)
 3289|  24.0k|               it = line_start;
 3290|  24.0k|               return;
 3291|  24.0k|            }
 3292|       |
 3293|   972k|            bool saw_tab_after_dash = false;
 3294|  4.47M|            while (it != end && (*it == ' ' || *it == '\t')) {
  ------------------
  |  Branch (3294:20): [True: 4.45M, False: 12.7k]
  |  Branch (3294:34): [True: 3.19M, False: 1.26M]
  |  Branch (3294:48): [True: 303k, False: 960k]
  ------------------
 3295|  3.49M|               saw_tab_after_dash = saw_tab_after_dash || (*it == '\t');
  ------------------
  |  Branch (3295:37): [True: 2.44M, False: 1.05M]
  |  Branch (3295:59): [True: 235k, False: 821k]
  ------------------
 3296|  3.49M|               ++it;
 3297|  3.49M|            }
 3298|       |            // A tab-separated nested "- " marker is not valid block indentation.
 3299|   972k|            if (saw_tab_after_dash && it != end && *it == '-') {
  ------------------
  |  Branch (3299:17): [True: 235k, False: 737k]
  |  Branch (3299:39): [True: 234k, False: 771]
  |  Branch (3299:52): [True: 26.3k, False: 208k]
  ------------------
 3300|  26.3k|               const auto after_dash = it + 1;
 3301|  26.3k|               if (after_dash == end || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*after_dash)]) {
  ------------------
  |  Branch (3301:20): [True: 4, False: 26.3k]
  |  Branch (3301:41): [True: 3, False: 26.3k]
  ------------------
 3302|      7|                  ctx.error = error_code::syntax_error;
 3303|      7|                  return;
 3304|      7|               }
 3305|  26.3k|            }
 3306|       |
 3307|       |            // Get reference to element to parse into
 3308|   972k|            auto parse_element = [&](auto& element) {
 3309|   972k|               const char* element_start = (it != end) ? &*it : nullptr;
 3310|       |
 3311|       |               // Check what follows
 3312|   972k|               if (it != end && !yaml::line_end_or_comment_table[static_cast<uint8_t>(*it)]) {
 3313|       |                  // Content on same line as dash - set indent to one less than content column
 3314|       |                  // This allows nested block mappings to continue parsing keys at the content indent
 3315|       |                  // For "- key: val", if dash is at column 0, content is at column 2
 3316|       |                  // We set parent indent to 1 so keys at column 2 pass the "indent > parent" check
 3317|   972k|                  if (!ctx.push_indent(line_indent + 1)) [[unlikely]]
 3318|   972k|                     return;
 3319|   972k|                  const bool prev_sequence_item_value_context = ctx.sequence_item_value_context;
 3320|   972k|                  const int32_t prev_sequence_dash_indent = ctx.sequence_dash_indent;
 3321|   972k|                  ctx.sequence_item_value_context = true;
 3322|   972k|                  ctx.sequence_dash_indent = dash_col;
 3323|   972k|                  from<YAML, value_type>::template op<Opts>(element, ctx, it, end);
 3324|   972k|                  ctx.sequence_dash_indent = prev_sequence_dash_indent;
 3325|   972k|                  ctx.sequence_item_value_context = prev_sequence_item_value_context;
 3326|   972k|                  ctx.pop_indent();
 3327|   972k|               }
 3328|   972k|               else {
 3329|       |                  // Value on next line - nested block
 3330|   972k|                  skip_ws_and_comment(it, end);
 3331|   972k|                  skip_newline(it, end);
 3332|       |
 3333|       |                  // Get indent of nested content
 3334|   972k|                  auto nested_start = it;
 3335|   972k|                  int32_t nested_indent = measure_indent(it, end, ctx);
 3336|   972k|                  if (bool(ctx.error)) [[unlikely]]
 3337|   972k|                     return;
 3338|   972k|                  it = nested_start;
 3339|       |
 3340|       |                  // Content is nested only if indented more than the current line.
 3341|       |                  // When line_indent is negative (root level), use 0 as the baseline.
 3342|       |                  // This prevents content at column 0 from being treated as nested.
 3343|   972k|                  const int32_t effective_line_indent = (line_indent < 0) ? 0 : line_indent;
 3344|   972k|                  if (nested_indent > effective_line_indent) {
 3345|       |                     // Save and set indent for nested parsing.
 3346|       |                     // A struct element reads the pushed indent as its own key column; every
 3347|       |                     // other element type reads it as the enclosing baseline, so it gets one
 3348|       |                     // less than the content indent and its content passes "indent > parent".
 3349|   972k|                     const int32_t element_indent =
 3350|   972k|                        receives_block_mapping_column<value_type>() ? nested_indent : nested_indent - 1;
 3351|   972k|                     if (!ctx.push_indent(element_indent)) [[unlikely]]
 3352|   972k|                        return;
 3353|   972k|                     const bool prev_sequence_item_value_context = ctx.sequence_item_value_context;
 3354|   972k|                     const int32_t prev_sequence_dash_indent = ctx.sequence_dash_indent;
 3355|   972k|                     ctx.sequence_item_value_context = true;
 3356|   972k|                     ctx.sequence_dash_indent = dash_col;
 3357|   972k|                     from<YAML, value_type>::template op<Opts>(element, ctx, it, end);
 3358|   972k|                     ctx.sequence_dash_indent = prev_sequence_dash_indent;
 3359|   972k|                     ctx.sequence_item_value_context = prev_sequence_item_value_context;
 3360|   972k|                     ctx.pop_indent();
 3361|   972k|                  }
 3362|       |                  // else: empty element (default constructed)
 3363|   972k|               }
 3364|       |
 3365|   972k|               if (has_pending_item_anchor && !bool(ctx.error)) {
 3366|   972k|                  const char* element_end = (it != end) ? &*it : element_start;
 3367|   972k|                  ctx.anchors[std::move(pending_item_anchor_name)] = {element_start, element_end,
 3368|   972k|                                                                      pending_item_anchor_indent};
 3369|   972k|                  has_pending_item_anchor = false;
 3370|   972k|               }
 3371|   972k|            };
 3372|       |
 3373|   972k|            if constexpr (emplace_backable<V>) {
 3374|   972k|               auto& element = value.emplace_back();
 3375|   972k|               parse_element(element);
 3376|       |            }
 3377|       |            else if constexpr (emplaceable<V>) {
 3378|       |               value_type element{};
 3379|       |               parse_element(element);
 3380|       |               if (!bool(ctx.error)) {
 3381|       |                  adapter.append(value, std::move(element));
 3382|       |               }
 3383|       |            }
 3384|       |            else if constexpr (!resizable<V>) {
 3385|       |               parse_element(value[adapter.index]);
 3386|       |               adapter.commit_fixed_slot();
 3387|       |            }
 3388|       |            else {
 3389|       |               ctx.error = error_code::syntax_error;
 3390|       |               return;
 3391|       |            }
 3392|       |
 3393|   972k|            first_item = false;
 3394|       |
 3395|   972k|            if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (3395:17): [True: 570, False: 972k]
  ------------------
 3396|    570|               return;
 3397|       |
 3398|       |            // Note: after parsing nested block content, iterator may already be
 3399|       |            // at the start of the next line. The outer loop will handle it.
 3400|   972k|         }
 3401|   704k|      }
_ZZN3glz4yaml20parse_block_sequenceITnDaXtlNS0_9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj1EEERNSt3__16vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS3_9allocatorIS8_EEEENS0_12yaml_contextEPKcSF_EEvOT0_RT1_RT2_T3_iENKUlRT_E_clIS8_EEDaSO_:
 3308|   972k|            auto parse_element = [&](auto& element) {
 3309|   972k|               const char* element_start = (it != end) ? &*it : nullptr;
  ------------------
  |  Branch (3309:44): [True: 960k, False: 12.7k]
  ------------------
 3310|       |
 3311|       |               // Check what follows
 3312|   972k|               if (it != end && !yaml::line_end_or_comment_table[static_cast<uint8_t>(*it)]) {
  ------------------
  |  Branch (3312:20): [True: 960k, False: 12.7k]
  |  Branch (3312:33): [True: 491k, False: 468k]
  ------------------
 3313|       |                  // Content on same line as dash - set indent to one less than content column
 3314|       |                  // This allows nested block mappings to continue parsing keys at the content indent
 3315|       |                  // For "- key: val", if dash is at column 0, content is at column 2
 3316|       |                  // We set parent indent to 1 so keys at column 2 pass the "indent > parent" check
 3317|   491k|                  if (!ctx.push_indent(line_indent + 1)) [[unlikely]]
  ------------------
  |  Branch (3317:23): [True: 0, False: 491k]
  ------------------
 3318|      0|                     return;
 3319|   491k|                  const bool prev_sequence_item_value_context = ctx.sequence_item_value_context;
 3320|   491k|                  const int32_t prev_sequence_dash_indent = ctx.sequence_dash_indent;
 3321|   491k|                  ctx.sequence_item_value_context = true;
 3322|   491k|                  ctx.sequence_dash_indent = dash_col;
 3323|   491k|                  from<YAML, value_type>::template op<Opts>(element, ctx, it, end);
 3324|   491k|                  ctx.sequence_dash_indent = prev_sequence_dash_indent;
 3325|   491k|                  ctx.sequence_item_value_context = prev_sequence_item_value_context;
 3326|   491k|                  ctx.pop_indent();
 3327|   491k|               }
 3328|   480k|               else {
 3329|       |                  // Value on next line - nested block
 3330|   480k|                  skip_ws_and_comment(it, end);
 3331|   480k|                  skip_newline(it, end);
 3332|       |
 3333|       |                  // Get indent of nested content
 3334|   480k|                  auto nested_start = it;
 3335|   480k|                  int32_t nested_indent = measure_indent(it, end, ctx);
 3336|   480k|                  if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (3336:23): [True: 5, False: 480k]
  ------------------
 3337|      5|                     return;
 3338|   480k|                  it = nested_start;
 3339|       |
 3340|       |                  // Content is nested only if indented more than the current line.
 3341|       |                  // When line_indent is negative (root level), use 0 as the baseline.
 3342|       |                  // This prevents content at column 0 from being treated as nested.
 3343|   480k|                  const int32_t effective_line_indent = (line_indent < 0) ? 0 : line_indent;
  ------------------
  |  Branch (3343:57): [True: 112k, False: 368k]
  ------------------
 3344|   480k|                  if (nested_indent > effective_line_indent) {
  ------------------
  |  Branch (3344:23): [True: 146k, False: 334k]
  ------------------
 3345|       |                     // Save and set indent for nested parsing.
 3346|       |                     // A struct element reads the pushed indent as its own key column; every
 3347|       |                     // other element type reads it as the enclosing baseline, so it gets one
 3348|       |                     // less than the content indent and its content passes "indent > parent".
 3349|   146k|                     const int32_t element_indent =
 3350|   146k|                        receives_block_mapping_column<value_type>() ? nested_indent : nested_indent - 1;
  ------------------
  |  Branch (3350:25): [Folded, False: 146k]
  ------------------
 3351|   146k|                     if (!ctx.push_indent(element_indent)) [[unlikely]]
  ------------------
  |  Branch (3351:26): [True: 0, False: 146k]
  ------------------
 3352|      0|                        return;
 3353|   146k|                     const bool prev_sequence_item_value_context = ctx.sequence_item_value_context;
 3354|   146k|                     const int32_t prev_sequence_dash_indent = ctx.sequence_dash_indent;
 3355|   146k|                     ctx.sequence_item_value_context = true;
 3356|   146k|                     ctx.sequence_dash_indent = dash_col;
 3357|   146k|                     from<YAML, value_type>::template op<Opts>(element, ctx, it, end);
 3358|   146k|                     ctx.sequence_dash_indent = prev_sequence_dash_indent;
 3359|   146k|                     ctx.sequence_item_value_context = prev_sequence_item_value_context;
 3360|   146k|                     ctx.pop_indent();
 3361|   146k|                  }
 3362|       |                  // else: empty element (default constructed)
 3363|   480k|               }
 3364|       |
 3365|   972k|               if (has_pending_item_anchor && !bool(ctx.error)) {
  ------------------
  |  Branch (3365:20): [True: 10.4k, False: 962k]
  |  Branch (3365:47): [True: 10.3k, False: 82]
  ------------------
 3366|  10.3k|                  const char* element_end = (it != end) ? &*it : element_start;
  ------------------
  |  Branch (3366:45): [True: 9.50k, False: 821]
  ------------------
 3367|  10.3k|                  ctx.anchors[std::move(pending_item_anchor_name)] = {element_start, element_end,
 3368|  10.3k|                                                                      pending_item_anchor_indent};
 3369|  10.3k|                  has_pending_item_anchor = false;
 3370|  10.3k|               }
 3371|   972k|            };
_ZN3glz29parse_block_mapping_or_stringINSt3__17variantIJDndNS1_12basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEbNS1_6vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS6_ISD_EEEENSC_ISD_EEEEETnDaXtlNS_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj1EEERSH_RNSI_12yaml_contextERPKcSO_EEvOT1_OT2_OT3_T4_:
 5423|  1.59M|   {
 5424|  1.59M|      if constexpr (yaml::check_flow_context(Opts)) {
 5425|       |         // In flow context, only treat plain content as an implicit "key: value"
 5426|       |         // when a mapping separator appears before the next top-level flow delimiter.
 5427|  1.59M|         auto could_be_implicit_flow_pair = [&](auto pos) {
 5428|       |            // Bounded by the longest implicit key the spec allows: unbounded, this probe runs
 5429|       |            // once per entry per nesting level over the whole remaining flow collection.
 5430|  1.59M|            const auto stop = yaml::implicit_key_scan_end(pos, end);
 5431|  1.59M|            int depth = 0;
 5432|  1.59M|            while (pos != stop) {
 5433|  1.59M|               const char c = *pos;
 5434|  1.59M|               if (c == '"' || c == '\'') {
 5435|  1.59M|                  const char quote = c;
 5436|  1.59M|                  ++pos;
 5437|  1.59M|                  while (pos != stop && *pos != quote) {
 5438|  1.59M|                     if (*pos == '\\' && quote == '"') {
 5439|  1.59M|                        ++pos;
 5440|  1.59M|                        if (pos != stop) ++pos;
 5441|  1.59M|                     }
 5442|  1.59M|                     else {
 5443|  1.59M|                        ++pos;
 5444|  1.59M|                     }
 5445|  1.59M|                  }
 5446|  1.59M|                  if (pos != stop) ++pos;
 5447|  1.59M|                  continue;
 5448|  1.59M|               }
 5449|  1.59M|               if (c == '[' || c == '{') {
 5450|  1.59M|                  ++depth;
 5451|  1.59M|                  ++pos;
 5452|  1.59M|                  continue;
 5453|  1.59M|               }
 5454|  1.59M|               if (c == ']' || c == '}') {
 5455|  1.59M|                  if (depth == 0) return false;
 5456|  1.59M|                  --depth;
 5457|  1.59M|                  ++pos;
 5458|  1.59M|                  continue;
 5459|  1.59M|               }
 5460|  1.59M|               if (c == ',' && depth == 0) return false;
 5461|  1.59M|               if (c == ':' && depth == 0) {
 5462|  1.59M|                  auto next = pos + 1;
 5463|  1.59M|                  return next == end || *next == ' ' || *next == '\t' || *next == '\n' || *next == '\r';
 5464|  1.59M|               }
 5465|  1.59M|               ++pos;
 5466|  1.59M|            }
 5467|  1.59M|            return false;
 5468|  1.59M|         };
 5469|       |
 5470|  1.59M|         if (could_be_implicit_flow_pair(it) || line_could_be_flow_mapping(it, end)) {
  ------------------
  |  Branch (5470:14): [True: 425k, False: 1.16M]
  |  Branch (5470:49): [True: 38.5k, False: 1.13M]
  ------------------
 5471|   463k|            if (try_parse_block_mapping_into_variant<Variant, Opts>(value, ctx, it, end)) {
  ------------------
  |  Branch (5471:17): [True: 413k, False: 50.4k]
  ------------------
 5472|   413k|               return;
 5473|   413k|            }
 5474|  50.4k|            if (bool(ctx.error)) {
  ------------------
  |  Branch (5474:17): [True: 6.36k, False: 44.1k]
  ------------------
 5475|  6.36k|               return;
 5476|  6.36k|            }
 5477|  50.4k|         }
 5478|       |
 5479|  1.17M|         process_yaml_variant_alternatives<Variant, is_yaml_variant_str>::template op<Opts>(value, ctx, it, end);
 5480|  1.17M|         return;
 5481|  1.59M|      }
 5482|       |
 5483|  1.59M|      if (try_parse_block_mapping_into_variant<Variant, Opts>(value, ctx, it, end)) {
  ------------------
  |  Branch (5483:11): [True: 0, False: 1.59M]
  ------------------
 5484|      0|         return;
 5485|      0|      }
 5486|       |      // If an error was set (e.g., malformed flow collection in value), don't try to parse as string
 5487|  1.59M|      if (bool(ctx.error)) {
  ------------------
  |  Branch (5487:11): [True: 0, False: 1.59M]
  ------------------
 5488|      0|         return;
 5489|      0|      }
 5490|  1.59M|      process_yaml_variant_alternatives<Variant, is_yaml_variant_str>::template op<Opts>(value, ctx, it, end);
 5491|  1.59M|   }
_ZZN3glz29parse_block_mapping_or_stringINSt3__17variantIJDndNS1_12basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEbNS1_6vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS6_ISD_EEEENSC_ISD_EEEEETnDaXtlNS_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj1EEERSH_RNSI_12yaml_contextERPKcSO_EEvOT1_OT2_OT3_T4_ENKUlT_E_clISO_EEDaSX_:
 5427|  1.59M|         auto could_be_implicit_flow_pair = [&](auto pos) {
 5428|       |            // Bounded by the longest implicit key the spec allows: unbounded, this probe runs
 5429|       |            // once per entry per nesting level over the whole remaining flow collection.
 5430|  1.59M|            const auto stop = yaml::implicit_key_scan_end(pos, end);
 5431|  1.59M|            int depth = 0;
 5432|  67.4M|            while (pos != stop) {
  ------------------
  |  Branch (5432:20): [True: 66.9M, False: 459k]
  ------------------
 5433|  66.9M|               const char c = *pos;
 5434|  66.9M|               if (c == '"' || c == '\'') {
  ------------------
  |  Branch (5434:20): [True: 409k, False: 66.5M]
  |  Branch (5434:32): [True: 267k, False: 66.2M]
  ------------------
 5435|   677k|                  const char quote = c;
 5436|   677k|                  ++pos;
 5437|  51.5M|                  while (pos != stop && *pos != quote) {
  ------------------
  |  Branch (5437:26): [True: 51.3M, False: 167k]
  |  Branch (5437:41): [True: 50.8M, False: 510k]
  ------------------
 5438|  50.8M|                     if (*pos == '\\' && quote == '"') {
  ------------------
  |  Branch (5438:26): [True: 296k, False: 50.5M]
  |  Branch (5438:42): [True: 208k, False: 88.5k]
  ------------------
 5439|   208k|                        ++pos;
 5440|   208k|                        if (pos != stop) ++pos;
  ------------------
  |  Branch (5440:29): [True: 200k, False: 7.96k]
  ------------------
 5441|   208k|                     }
 5442|  50.6M|                     else {
 5443|  50.6M|                        ++pos;
 5444|  50.6M|                     }
 5445|  50.8M|                  }
 5446|   677k|                  if (pos != stop) ++pos;
  ------------------
  |  Branch (5446:23): [True: 510k, False: 167k]
  ------------------
 5447|   677k|                  continue;
 5448|   677k|               }
 5449|  66.2M|               if (c == '[' || c == '{') {
  ------------------
  |  Branch (5449:20): [True: 2.56M, False: 63.7M]
  |  Branch (5449:32): [True: 675k, False: 63.0M]
  ------------------
 5450|  3.24M|                  ++depth;
 5451|  3.24M|                  ++pos;
 5452|  3.24M|                  continue;
 5453|  3.24M|               }
 5454|  63.0M|               if (c == ']' || c == '}') {
  ------------------
  |  Branch (5454:20): [True: 99.8k, False: 62.9M]
  |  Branch (5454:32): [True: 231k, False: 62.7M]
  ------------------
 5455|   331k|                  if (depth == 0) return false;
  ------------------
  |  Branch (5455:23): [True: 138k, False: 192k]
  ------------------
 5456|   192k|                  --depth;
 5457|   192k|                  ++pos;
 5458|   192k|                  continue;
 5459|   331k|               }
 5460|  62.7M|               if (c == ',' && depth == 0) return false;
  ------------------
  |  Branch (5460:20): [True: 2.78M, False: 59.9M]
  |  Branch (5460:32): [True: 442k, False: 2.33M]
  ------------------
 5461|  62.2M|               if (c == ':' && depth == 0) {
  ------------------
  |  Branch (5461:20): [True: 1.50M, False: 60.7M]
  |  Branch (5461:32): [True: 554k, False: 948k]
  ------------------
 5462|   554k|                  auto next = pos + 1;
 5463|   554k|                  return next == end || *next == ' ' || *next == '\t' || *next == '\n' || *next == '\r';
  ------------------
  |  Branch (5463:26): [True: 15.8k, False: 538k]
  |  Branch (5463:41): [True: 263k, False: 274k]
  |  Branch (5463:57): [True: 41.3k, False: 233k]
  |  Branch (5463:74): [True: 39.8k, False: 193k]
  |  Branch (5463:91): [True: 64.8k, False: 128k]
  ------------------
 5464|   554k|               }
 5465|  61.7M|               ++pos;
 5466|  61.7M|            }
 5467|   459k|            return false;
 5468|  1.59M|         };
_ZZN3glz4fromILj450ENSt3__17variantIJDndNS1_12basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEbNS1_6vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS6_ISD_EEEENSC_ISD_EEEEEE2opITnDaXtlNS_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj1EEERPKcRSH_TkNS_10is_contextERNSK_12yaml_contextESN_EEvOT1_OT2_OT0_T3_ENKUlT_E0_clISN_EEDaSZ_:
 5848|   137k|            auto is_word_boundary = [&](const auto ptr) {
 5849|   137k|               if (ptr == end) {
  ------------------
  |  Branch (5849:20): [True: 9.99k, False: 128k]
  ------------------
 5850|  9.99k|                  return true;
 5851|  9.99k|               }
 5852|   128k|               if (*ptr == ':') {
  ------------------
  |  Branch (5852:20): [True: 80.3k, False: 47.6k]
  ------------------
 5853|  80.3k|                  auto next = ptr + 1;
 5854|  80.3k|                  return (next == end) || *next == ' ' || *next == '\t' || *next == '\n' || *next == '\r';
  ------------------
  |  Branch (5854:26): [True: 6.45k, False: 73.8k]
  |  Branch (5854:43): [True: 9.22k, False: 64.6k]
  |  Branch (5854:59): [True: 23.2k, False: 41.4k]
  |  Branch (5854:76): [True: 4.77k, False: 36.6k]
  |  Branch (5854:93): [True: 20.6k, False: 16.0k]
  ------------------
 5855|  80.3k|               }
 5856|  47.6k|               return is_plain_scalar_boundary(*ptr);
 5857|   128k|            };
_ZZN3glz4fromILj450ENSt3__17variantIJDndNS1_12basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEbNS1_6vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS6_ISD_EEEENSC_ISD_EEEEEE2opITnDaXtlNS_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj1EEERPKcRSH_TkNS_10is_contextERNSK_12yaml_contextESN_EEvOT1_OT2_OT0_T3_ENKUlcE_clEc:
 5774|  47.6k|            auto is_plain_scalar_boundary = [](const char ch) {
 5775|  47.6k|               switch (ch) {
 5776|  1.02k|               case ' ':
  ------------------
  |  Branch (5776:16): [True: 1.02k, False: 46.6k]
  ------------------
 5777|  2.36k|               case '\t':
  ------------------
  |  Branch (5777:16): [True: 1.33k, False: 46.3k]
  ------------------
 5778|  13.6k|               case '\n':
  ------------------
  |  Branch (5778:16): [True: 11.3k, False: 36.3k]
  ------------------
 5779|  15.4k|               case '\r':
  ------------------
  |  Branch (5779:16): [True: 1.76k, False: 45.9k]
  ------------------
 5780|  26.4k|               case ',':
  ------------------
  |  Branch (5780:16): [True: 11.0k, False: 36.6k]
  ------------------
 5781|  27.6k|               case ']':
  ------------------
  |  Branch (5781:16): [True: 1.10k, False: 46.5k]
  ------------------
 5782|  35.4k|               case '}':
  ------------------
  |  Branch (5782:16): [True: 7.89k, False: 39.7k]
  ------------------
 5783|  35.4k|                  return true;
 5784|  12.1k|               default:
  ------------------
  |  Branch (5784:16): [True: 12.1k, False: 35.4k]
  ------------------
 5785|  12.1k|                  return false;
 5786|  47.6k|               }
 5787|  47.6k|            };
_ZZN3glz4fromILj450ENSt3__17variantIJDndNS1_12basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEbNS1_6vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS6_ISD_EEEENSC_ISD_EEEEEE2opITnDaXtlNS_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj1EEERPKcRSH_TkNS_10is_contextERNSK_12yaml_contextESN_EEvOT1_OT2_OT0_T3_ENKUlT_E_clISN_EEDaSZ_:
 5789|   109k|            auto has_indented_block_continuation = [&](auto word_end) {
 5790|   109k|               if constexpr (yaml::check_flow_context(Opts)) {
 5791|   109k|                  return false;
 5792|   109k|               }
 5793|   109k|               if (ctx.current_indent() < 0) {
  ------------------
  |  Branch (5793:20): [True: 0, False: 109k]
  ------------------
 5794|      0|                  return false;
 5795|      0|               }
 5796|   109k|               if (word_end == end || (*word_end != '\n' && *word_end != '\r')) {
  ------------------
  |  Branch (5796:20): [True: 109k, False: 0]
  |  Branch (5796:40): [True: 0, False: 0]
  |  Branch (5796:61): [True: 0, False: 0]
  ------------------
 5797|      0|                  return false;
 5798|      0|               }
 5799|       |
 5800|   109k|               auto look = word_end;
 5801|   109k|               yaml::skip_newline(look, end);
 5802|   109k|               while (look != end) {
  ------------------
  |  Branch (5802:23): [True: 0, False: 109k]
  ------------------
 5803|      0|                  int32_t line_indent = 0;
 5804|      0|                  while (look != end && *look == ' ') {
  ------------------
  |  Branch (5804:26): [True: 0, False: 0]
  |  Branch (5804:41): [True: 0, False: 0]
  ------------------
 5805|      0|                     ++line_indent;
 5806|      0|                     ++look;
 5807|      0|                  }
 5808|      0|                  if (look != end && *look == '\t') {
  ------------------
  |  Branch (5808:23): [True: 0, False: 0]
  |  Branch (5808:38): [True: 0, False: 0]
  ------------------
 5809|      0|                     return false;
 5810|      0|                  }
 5811|      0|                  if (look == end || *look == '\n' || *look == '\r') {
  ------------------
  |  Branch (5811:23): [True: 0, False: 0]
  |  Branch (5811:38): [True: 0, False: 0]
  |  Branch (5811:55): [True: 0, False: 0]
  ------------------
 5812|      0|                     if (look != end) {
  ------------------
  |  Branch (5812:26): [True: 0, False: 0]
  ------------------
 5813|      0|                        yaml::skip_newline(look, end);
 5814|      0|                        continue;
 5815|      0|                     }
 5816|      0|                     return false;
 5817|      0|                  }
 5818|      0|                  if (*look == '#') {
  ------------------
  |  Branch (5818:23): [True: 0, False: 0]
  ------------------
 5819|      0|                     yaml::skip_comment(look, end);
 5820|      0|                     if (look != end && (*look == '\n' || *look == '\r')) {
  ------------------
  |  Branch (5820:26): [True: 0, False: 0]
  |  Branch (5820:42): [True: 0, False: 0]
  |  Branch (5820:59): [True: 0, False: 0]
  ------------------
 5821|      0|                        yaml::skip_newline(look, end);
 5822|      0|                        continue;
 5823|      0|                     }
 5824|      0|                     return false;
 5825|      0|                  }
 5826|       |
 5827|       |                  // If the next non-empty line is an implicit mapping entry,
 5828|       |                  // don't treat it as scalar continuation for auto-deduced
 5829|       |                  // booleans/nulls.
 5830|      0|                  {
 5831|      0|                     auto scan = look;
 5832|      0|                     while (scan != end && *scan != '\n' && *scan != '\r') {
  ------------------
  |  Branch (5832:29): [True: 0, False: 0]
  |  Branch (5832:44): [True: 0, False: 0]
  |  Branch (5832:61): [True: 0, False: 0]
  ------------------
 5833|      0|                        if (*scan == ':') {
  ------------------
  |  Branch (5833:29): [True: 0, False: 0]
  ------------------
 5834|      0|                           auto after_colon = scan + 1;
 5835|      0|                           if (after_colon == end || *after_colon == ' ' || *after_colon == '\t' ||
  ------------------
  |  Branch (5835:32): [True: 0, False: 0]
  |  Branch (5835:54): [True: 0, False: 0]
  |  Branch (5835:77): [True: 0, False: 0]
  ------------------
 5836|      0|                               *after_colon == '\n' || *after_colon == '\r') {
  ------------------
  |  Branch (5836:32): [True: 0, False: 0]
  |  Branch (5836:56): [True: 0, False: 0]
  ------------------
 5837|      0|                              return false;
 5838|      0|                           }
 5839|      0|                        }
 5840|      0|                        ++scan;
 5841|      0|                     }
 5842|      0|                  }
 5843|       |
 5844|      0|                  return line_indent > ctx.current_indent();
 5845|      0|               }
 5846|   109k|               return false;
 5847|   109k|            };
_ZN3glz36try_parse_block_mapping_into_variantINSt3__17variantIJDndNS1_12basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEbNS1_6vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS6_ISD_EEEENSC_ISD_EEEEETnDaXtlNS_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj1EEERSH_RNSI_12yaml_contextERPKcSO_EEbOT1_OT2_OT3_T4_:
 5377|  1.77M|   {
 5378|  1.77M|      using counts = yaml_variant_type_count<Variant>;
 5379|       |      if constexpr (counts::n_object == 0) {
 5380|       |         return false;
 5381|       |      }
 5382|  1.77M|      else {
 5383|       |         // Quick check: if no viable mapping separator in the current span,
 5384|       |         // avoid expensive speculative parse.
 5385|  1.77M|         const bool could_be_mapping = [&] {
 5386|  1.77M|            if constexpr (yaml::check_flow_context(Opts)) {
 5387|  1.77M|               return line_could_be_flow_mapping(it, end);
 5388|  1.77M|            }
 5389|  1.77M|            else {
 5390|  1.77M|               return yaml::line_could_be_block_mapping(it, end);
 5391|  1.77M|            }
 5392|  1.77M|         }();
 5393|  1.77M|         if (!could_be_mapping) {
  ------------------
  |  Branch (5393:14): [True: 1.33M, False: 437k]
  ------------------
 5394|  1.33M|            return false;
 5395|  1.33M|         }
 5396|       |         // Full parse attempt - use a temporary context that inherits indent from parent
 5397|   437k|         auto temp_ctx = ctx.make_speculative();
 5398|   437k|         process_yaml_variant_alternatives<Variant, is_yaml_variant_object>::template op<Opts>(value, temp_ctx, it,
 5399|   437k|                                                                                               end);
 5400|   437k|         ctx.alias_expansion_budget = temp_ctx.alias_expansion_budget; // charged even if rejected
 5401|   437k|         ctx.key_expansion_budget = temp_ctx.key_expansion_budget;
 5402|   437k|         if (!bool(temp_ctx.error)) {
  ------------------
  |  Branch (5402:14): [True: 425k, False: 12.4k]
  ------------------
 5403|   425k|            ctx.anchors = std::move(temp_ctx.anchors);
 5404|   425k|            return true;
 5405|   425k|         }
 5406|       |         // The line matched "key: value" pattern but parsing failed.
 5407|       |         // This indicates malformed content (e.g., unclosed flow collection),
 5408|       |         // so propagate the error rather than silently falling back to string.
 5409|  12.4k|         ctx.error = temp_ctx.error;
 5410|  12.4k|         ctx.custom_error_message = temp_ctx.custom_error_message;
 5411|  12.4k|         return false;
 5412|   437k|      }
 5413|  1.77M|   }
_ZZN3glz36try_parse_block_mapping_into_variantINSt3__17variantIJDndNS1_12basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEbNS1_6vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS6_ISD_EEEENSC_ISD_EEEEETnDaXtlNS_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj1EEERSH_RNSI_12yaml_contextERPKcSO_EEbOT1_OT2_OT3_T4_ENKUlvE_clEv:
 5385|  1.77M|         const bool could_be_mapping = [&] {
 5386|  1.77M|            if constexpr (yaml::check_flow_context(Opts)) {
 5387|  1.77M|               return line_could_be_flow_mapping(it, end);
 5388|       |            }
 5389|       |            else {
 5390|       |               return yaml::line_could_be_block_mapping(it, end);
 5391|       |            }
 5392|  1.77M|         }();
_ZZN3glz4fromILj450ENS_17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES1_EEEEE2opITnDaXtlNS_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2EEERPKcRS5_TkNS_10is_contextERNS8_12yaml_contextESB_EEvOT1_OT2_OT0_T3_ENKUlRS4_E_clESN_:
 4658|   319k|               auto parse_implicit_null = [&](val_t& val) -> bool {
 4659|       |                  if constexpr (nullable_like<std::remove_cvref_t<val_t>>) {
 4660|       |                     val = {};
 4661|       |                     return true;
 4662|       |                  }
 4663|   319k|                  else if constexpr (std::same_as<std::remove_cvref_t<val_t>, glz::generic>) {
 4664|   319k|                     val = glz::generic{};
 4665|   319k|                     return true;
 4666|       |                  }
 4667|       |                  else {
 4668|       |                     static constexpr std::string_view null_value{"null"};
 4669|       |                     auto null_it = null_value.data();
 4670|       |                     from<YAML, val_t>::template op<yaml::flow_context_on<Opts>()>(
 4671|       |                        val, ctx, null_it, null_value.data() + null_value.size());
 4672|       |                     return !bool(ctx.error);
 4673|       |                  }
 4674|   319k|               };
_ZN3glz4yaml24parse_block_mapping_loopITnDaXtlNS0_9yaml_optsELj450ELb1ELb0ELb1ELh2EEENS0_12yaml_contextEPKcS5_ZNS_4fromILj450ENS_17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES7_EEEEE2opITnDaXtlS2_Lj450ELb1ELb0ELb1ELh2EEERS5_RSB_TkNS_10is_contextERS3_S5_EEvOT1_OT2_OT0_T3_EUlRT_RSL_SH_iE_EEvSQ_RSH_SJ_iOSN_:
 3633|   777k|      {
 3634|       |         // A tagged-variant custom alternative hands its body (at the variant's own column) to a
 3635|       |         // discover-mode reader. Honor the known indent it published so continuation/dedent are
 3636|       |         // judged against the outer parent, not the body itself. One-shot: reset on observation.
 3637|   777k|         if (ctx.forced_block_mapping_indent >= 0) {
  ------------------
  |  Branch (3637:14): [True: 0, False: 777k]
  ------------------
 3638|      0|            if (mapping_indent < 0) {
  ------------------
  |  Branch (3638:17): [True: 0, False: 0]
  ------------------
 3639|      0|               mapping_indent = ctx.forced_block_mapping_indent;
 3640|      0|            }
 3641|      0|            ctx.forced_block_mapping_indent = -1;
 3642|      0|         }
 3643|   777k|         const int32_t parent_indent = ctx.current_indent();
 3644|   777k|         const bool discover_indent = (mapping_indent < 0);
 3645|   777k|         bool first_key = !discover_indent;
 3646|   777k|         bool discovered_first_key_mid_line = false;
 3647|   777k|         int32_t discovered_first_key_visual_indent = 0;
 3648|       |
 3649|  2.01M|         while (it != end) {
  ------------------
  |  Branch (3649:17): [True: 1.61M, False: 400k]
  ------------------
 3650|  1.61M|            auto line_start = it;
 3651|  1.61M|            int32_t line_indent = first_key ? mapping_indent : 0;
  ------------------
  |  Branch (3651:35): [True: 0, False: 1.61M]
  ------------------
 3652|       |
 3653|       |            // Skip blank lines and comments, measure indent
 3654|  1.78M|            while (it != end) {
  ------------------
  |  Branch (3654:20): [True: 1.76M, False: 18.2k]
  ------------------
 3655|  1.76M|               if (*it == '#') {
  ------------------
  |  Branch (3655:20): [True: 29.5k, False: 1.73M]
  ------------------
 3656|  29.5k|                  skip_comment(it, end);
 3657|  29.5k|                  skip_newline(it, end);
 3658|  29.5k|                  first_key = false;
 3659|  29.5k|                  line_indent = 0;
 3660|  29.5k|               }
 3661|  1.73M|               else if (*it == '\n' || *it == '\r') {
  ------------------
  |  Branch (3661:25): [True: 27.4k, False: 1.71M]
  |  Branch (3661:40): [True: 91.6k, False: 1.61M]
  ------------------
 3662|   119k|                  skip_newline(it, end);
 3663|   119k|                  first_key = false;
 3664|   119k|                  line_indent = 0;
 3665|   119k|               }
 3666|  1.61M|               else if (*it == ' ') {
  ------------------
  |  Branch (3666:25): [True: 671k, False: 947k]
  ------------------
 3667|   671k|                  line_start = it;
 3668|   671k|                  line_indent = 0;
 3669|  1.73M|                  while (it != end && *it == ' ') {
  ------------------
  |  Branch (3669:26): [True: 1.73M, False: 2.82k]
  |  Branch (3669:39): [True: 1.06M, False: 668k]
  ------------------
 3670|  1.06M|                     ++line_indent;
 3671|  1.06M|                     ++it;
 3672|  1.06M|                  }
 3673|       |
 3674|   671k|                  bool saw_tab = false;
 3675|   676k|                  while (it != end && (*it == ' ' || *it == '\t')) {
  ------------------
  |  Branch (3675:26): [True: 673k, False: 2.84k]
  |  Branch (3675:40): [True: 1.89k, False: 671k]
  |  Branch (3675:54): [True: 3.09k, False: 668k]
  ------------------
 3676|  4.98k|                     saw_tab = saw_tab || (*it == '\t');
  ------------------
  |  Branch (3676:32): [True: 3.17k, False: 1.81k]
  |  Branch (3676:43): [True: 1.81k, False: 0]
  ------------------
 3677|  4.98k|                     ++it;
 3678|  4.98k|                  }
 3679|       |
 3680|   671k|                  if (it == end || *it == '\n' || *it == '\r' || *it == '#') {
  ------------------
  |  Branch (3680:23): [True: 2.84k, False: 668k]
  |  Branch (3680:36): [True: 5.39k, False: 663k]
  |  Branch (3680:51): [True: 3.94k, False: 659k]
  |  Branch (3680:66): [True: 6.94k, False: 652k]
  ------------------
 3681|  19.1k|                     first_key = false;
 3682|  19.1k|                     line_indent = 0;
 3683|  19.1k|                     continue; // Blank or comment line
 3684|  19.1k|                  }
 3685|       |
 3686|   652k|                  if (saw_tab) {
  ------------------
  |  Branch (3686:23): [True: 104, False: 652k]
  ------------------
 3687|    104|                     ctx.error = error_code::syntax_error;
 3688|    104|                     return;
 3689|    104|                  }
 3690|       |
 3691|       |                  // Early dedent check
 3692|   652k|                  if (mapping_indent >= 0 && line_indent < mapping_indent) {
  ------------------
  |  Branch (3692:23): [True: 645k, False: 6.83k]
  |  Branch (3692:46): [True: 657, False: 644k]
  ------------------
 3693|    657|                     it = line_start;
 3694|    657|                     return;
 3695|    657|                  }
 3696|       |
 3697|   651k|                  first_key = false;
 3698|   651k|                  break; // Found content
 3699|   652k|               }
 3700|   947k|               else if (*it == '\t') {
  ------------------
  |  Branch (3700:25): [True: 3.11k, False: 944k]
  ------------------
 3701|  3.11k|                  line_start = it;
 3702|  12.4k|                  while (it != end && (*it == ' ' || *it == '\t')) ++it;
  ------------------
  |  Branch (3702:26): [True: 12.1k, False: 302]
  |  Branch (3702:40): [True: 2.21k, False: 9.95k]
  |  Branch (3702:54): [True: 7.14k, False: 2.81k]
  ------------------
 3703|  3.11k|                  if (it == end || *it == '\n' || *it == '\r' || *it == '#') {
  ------------------
  |  Branch (3703:23): [True: 302, False: 2.81k]
  |  Branch (3703:36): [True: 576, False: 2.23k]
  |  Branch (3703:51): [True: 1.13k, False: 1.10k]
  |  Branch (3703:66): [True: 961, False: 140]
  ------------------
 3704|  2.97k|                     first_key = false;
 3705|  2.97k|                     line_indent = 0;
 3706|  2.97k|                     continue; // Blank or comment-only line with tab indentation
 3707|  2.97k|                  }
 3708|    140|                  ctx.error = error_code::syntax_error;
 3709|    140|                  return;
 3710|  3.11k|               }
 3711|   944k|               else {
 3712|   944k|                  line_start = it;
 3713|   944k|                  break; // Content at column 0
 3714|   944k|               }
 3715|  1.76M|            }
 3716|       |
 3717|  1.61M|            if (it == end) break;
  ------------------
  |  Branch (3717:17): [True: 18.2k, False: 1.59M]
  ------------------
 3718|       |
 3719|       |            // Document boundaries terminate the current mapping in both discovered
 3720|       |            // and fixed-indent modes.
 3721|  1.59M|            if (at_document_end(it, end) || at_document_start(it, end)) break;
  ------------------
  |  Branch (3721:17): [True: 5.37k, False: 1.59M]
  |  Branch (3721:45): [True: 1.37k, False: 1.58M]
  ------------------
 3722|       |
 3723|       |            // Dedent checks (skip on first key for struct case)
 3724|       |            // Must check BEFORE establishing mapping_indent so the first discovered key
 3725|       |            // isn't rejected by the parent_indent check (mapping_indent is still -1).
 3726|  1.58M|            if (!first_key) {
  ------------------
  |  Branch (3726:17): [True: 1.58M, False: 0]
  ------------------
 3727|       |               // Parent indent check for nested maps (only after mapping_indent established)
 3728|  1.58M|               if (discover_indent && mapping_indent >= 0 && parent_indent >= 0 && line_indent <= parent_indent) {
  ------------------
  |  Branch (3728:20): [True: 1.58M, False: 0]
  |  Branch (3728:39): [True: 813k, False: 776k]
  |  Branch (3728:62): [True: 424k, False: 388k]
  |  Branch (3728:84): [True: 304k, False: 120k]
  ------------------
 3729|   304k|                  it = line_start;
 3730|   304k|                  return;
 3731|   304k|               }
 3732|  1.28M|               if (mapping_indent >= 0 && line_indent < mapping_indent) {
  ------------------
  |  Branch (3732:20): [True: 508k, False: 776k]
  |  Branch (3732:43): [True: 58, False: 508k]
  ------------------
 3733|     58|                  it = line_start;
 3734|     58|                  return;
 3735|     58|               }
 3736|  1.28M|            }
 3737|       |
 3738|       |            // Establish mapping indent from first key (map case)
 3739|  1.28M|            bool established_mapping_indent_this_line = false;
 3740|  1.28M|            if (mapping_indent < 0) {
  ------------------
  |  Branch (3740:17): [True: 776k, False: 508k]
  ------------------
 3741|   776k|               mapping_indent = line_indent;
 3742|   776k|               established_mapping_indent_this_line = true;
 3743|   776k|               discovered_first_key_visual_indent = line_indent;
 3744|   776k|               if constexpr (std::is_pointer_v<std::decay_t<It>>) {
 3745|   776k|                  if (ctx.stream_begin && line_start > ctx.stream_begin) {
  ------------------
  |  Branch (3745:23): [True: 776k, False: 0]
  |  Branch (3745:43): [True: 768k, False: 7.52k]
  ------------------
 3746|   768k|                     const auto prefix = ctx.line_prefix_before(line_start);
 3747|   768k|                     if (prefix.has_tab) {
  ------------------
  |  Branch (3747:26): [True: 396, False: 768k]
  ------------------
 3748|    396|                        ctx.error = error_code::syntax_error;
 3749|    396|                        return;
 3750|    396|                     }
 3751|       |
 3752|   768k|                     discovered_first_key_mid_line = prefix.has_content;
 3753|   768k|                     if (mapping_indent == 0 && prefix.column > 0) {
  ------------------
  |  Branch (3753:26): [True: 761k, False: 6.83k]
  |  Branch (3753:49): [True: 618k, False: 143k]
  ------------------
 3754|   618k|                        discovered_first_key_visual_indent = prefix.column;
 3755|   618k|                     }
 3756|   768k|                  }
 3757|   776k|               }
 3758|   776k|            }
 3759|       |
 3760|       |            // In discovered-indent block mappings, sibling keys must stay at the same
 3761|       |            // indent level, except when the first key started mid-line (e.g. "--- k: v").
 3762|  1.28M|            if (discover_indent && mapping_indent >= 0 && !established_mapping_indent_this_line &&
  ------------------
  |  Branch (3762:17): [True: 1.28M, False: 396]
  |  Branch (3762:36): [True: 1.28M, False: 0]
  |  Branch (3762:59): [True: 508k, False: 775k]
  ------------------
 3763|   508k|                !discovered_first_key_mid_line) {
  ------------------
  |  Branch (3763:17): [True: 116k, False: 392k]
  ------------------
 3764|   116k|               if (mapping_indent == 0 && discovered_first_key_visual_indent > 0) {
  ------------------
  |  Branch (3764:20): [True: 115k, False: 639]
  |  Branch (3764:43): [True: 77.7k, False: 38.1k]
  ------------------
 3765|  77.7k|                  if (line_indent > discovered_first_key_visual_indent) {
  ------------------
  |  Branch (3765:23): [True: 100, False: 77.6k]
  ------------------
 3766|    100|                     ctx.error = error_code::syntax_error;
 3767|    100|                     return;
 3768|    100|                  }
 3769|  77.6k|                  if (line_indent < discovered_first_key_visual_indent) {
  ------------------
  |  Branch (3769:23): [True: 2.03k, False: 75.6k]
  ------------------
 3770|  2.03k|                     it = line_start;
 3771|  2.03k|                     return;
 3772|  2.03k|                  }
 3773|  77.6k|               }
 3774|  38.8k|               else if (line_indent > mapping_indent &&
  ------------------
  |  Branch (3774:25): [True: 2.31k, False: 36.4k]
  ------------------
 3775|  2.31k|                        (parent_indent < 0 || mapping_indent > 0 ||
  ------------------
  |  Branch (3775:26): [True: 369, False: 1.94k]
  |  Branch (3775:47): [True: 3, False: 1.94k]
  ------------------
 3776|  1.94k|                         (parent_indent >= 0 && mapping_indent == 0 && line_indent > (parent_indent + 1)))) {
  ------------------
  |  Branch (3776:27): [True: 1.94k, False: 0]
  |  Branch (3776:49): [True: 1.94k, False: 0]
  |  Branch (3776:72): [True: 11, False: 1.93k]
  ------------------
 3777|    383|                  ctx.error = error_code::syntax_error;
 3778|    383|                  return;
 3779|    383|               }
 3780|   116k|            }
 3781|       |
 3782|       |            // Sequence indicator check (struct case only - map parser lets key parsing
 3783|       |            // handle '- ' which produces appropriate errors for misindented items)
 3784|  1.28M|            if (!discover_indent && *it == '-' &&
  ------------------
  |  Branch (3784:17): [True: 0, False: 1.28M]
  |  Branch (3784:37): [True: 0, False: 0]
  ------------------
 3785|      0|                ((it + 1) == end || *(it + 1) == ' ' || *(it + 1) == '\t' || *(it + 1) == '\n')) {
  ------------------
  |  Branch (3785:18): [True: 0, False: 0]
  |  Branch (3785:37): [True: 0, False: 0]
  |  Branch (3785:57): [True: 0, False: 0]
  |  Branch (3785:78): [True: 0, False: 0]
  ------------------
 3786|      0|               it = line_start;
 3787|      0|               return;
 3788|      0|            }
 3789|       |
 3790|       |            // Skip indented comment lines
 3791|  1.28M|            if (*it == '#') {
  ------------------
  |  Branch (3791:17): [True: 0, False: 1.28M]
  ------------------
 3792|      0|               skip_comment(it, end);
 3793|      0|               first_key = false;
 3794|      0|               continue;
 3795|      0|            }
 3796|       |
 3797|       |            // Skip blank/empty lines after indent
 3798|  1.28M|            if (*it == '\n' || *it == '\r') {
  ------------------
  |  Branch (3798:17): [True: 396, False: 1.28M]
  |  Branch (3798:32): [True: 0, False: 1.28M]
  ------------------
 3799|      0|               first_key = false;
 3800|      0|               continue;
 3801|      0|            }
 3802|       |
 3803|       |            // While parsing an explicit mapping key node ('? key-node'),
 3804|       |            // a subsequent standalone ':' at the same indentation starts
 3805|       |            // the outer value indicator and must terminate this key-node map.
 3806|       |            // Keep same-line ': x' on the first key-node line valid.
 3807|  1.28M|            if (ctx.explicit_mapping_key_context && !established_mapping_indent_this_line && *it == ':') {
  ------------------
  |  Branch (3807:17): [True: 563k, False: 719k]
  |  Branch (3807:53): [True: 175k, False: 387k]
  |  Branch (3807:94): [True: 44.4k, False: 130k]
  ------------------
 3808|  44.4k|               const auto after_colon = it + 1;
 3809|  44.4k|               const int32_t explicit_value_indicator_indent = (parent_indent < 0) ? 0 : (parent_indent + 1);
  ------------------
  |  Branch (3809:64): [True: 37.3k, False: 7.11k]
  ------------------
 3810|  44.4k|               if ((after_colon == end || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*after_colon)]) &&
  ------------------
  |  Branch (3810:21): [True: 37, False: 44.4k]
  |  Branch (3810:43): [True: 35.0k, False: 9.43k]
  ------------------
 3811|  35.0k|                   line_indent == explicit_value_indicator_indent) {
  ------------------
  |  Branch (3811:20): [True: 743, False: 34.3k]
  ------------------
 3812|    743|                  it = line_start;
 3813|    743|                  return;
 3814|    743|               }
 3815|  44.4k|            }
 3816|       |
 3817|       |            // Process this mapping entry (key + colon + value)
 3818|  1.28M|            int32_t effective_line_indent = line_indent;
 3819|  1.28M|            if (discover_indent && established_mapping_indent_this_line &&
  ------------------
  |  Branch (3819:17): [True: 1.28M, False: 396]
  |  Branch (3819:36): [True: 775k, False: 505k]
  ------------------
 3820|   775k|                discovered_first_key_visual_indent > effective_line_indent &&
  ------------------
  |  Branch (3820:17): [True: 618k, False: 157k]
  ------------------
 3821|   618k|                !(discovered_first_key_mid_line && parent_indent < 0)) {
  ------------------
  |  Branch (3821:19): [True: 564k, False: 53.7k]
  |  Branch (3821:52): [True: 30.9k, False: 533k]
  ------------------
 3822|       |               // The first discovered key has no indentation of its own left to measure: it may
 3823|       |               // begin mid-line (a sequence entry's "- key: value"), or the caller may have already
 3824|       |               // consumed the line's indentation before handing the mapping over. Pass its visual
 3825|       |               // column so the entry judges its value against the key's real indent -- otherwise a
 3826|       |               // key with an empty value takes the following sibling line for nested content
 3827|       |               // (issue #2827) and same-line block scalars compute the wrong indentation.
 3828|       |               // The exception is a ROOT mapping whose first key begins mid-line, which means node
 3829|       |               // properties sit ahead of it (`!!str &a1 "foo":`): those belong to the document node
 3830|       |               // rather than to the key's column, so the measured indent stands. Conformance tests
 3831|       |               // 7FWL and HMQ5 pin that case.
 3832|   587k|               effective_line_indent = discovered_first_key_visual_indent;
 3833|   587k|            }
 3834|       |
 3835|  1.28M|            if (!process_entry(ctx, it, end, effective_line_indent)) {
  ------------------
  |  Branch (3835:17): [True: 44.1k, False: 1.23M]
  ------------------
 3836|  44.1k|               return;
 3837|  44.1k|            }
 3838|  1.23M|            first_key = false;
 3839|       |
 3840|  1.23M|            if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (3840:17): [True: 0, False: 1.23M]
  ------------------
 3841|      0|               return;
 3842|       |
 3843|       |            if constexpr (yaml::check_flow_context(Opts)) {
 3844|       |               // In flow context, an implicit "key: value" pair used as a sequence entry
 3845|       |               // ends at ',', ']', or '}'. Let the enclosing flow parser consume it.
 3846|       |               auto flow_end = it;
 3847|       |               skip_flow_ws_and_newlines(ctx, flow_end, end);
 3848|       |               if (bool(ctx.error)) [[unlikely]]
 3849|       |                  return;
 3850|       |               if (flow_end != end && (*flow_end == ',' || *flow_end == ']' || *flow_end == '}')) {
 3851|       |                  it = flow_end;
 3852|       |                  return;
 3853|       |               }
 3854|       |            }
 3855|       |
 3856|       |            // Trailing whitespace handling (peek-ahead pattern).
 3857|       |            // After parsing, iterator may be at leading indent of next line.
 3858|       |            // Don't consume it - let the outer loop handle indent measurement.
 3859|  1.23M|            if (it != end) {
  ------------------
  |  Branch (3859:17): [True: 939k, False: 298k]
  ------------------
 3860|   939k|               if (*it == ' ' || *it == '\t') {
  ------------------
  |  Branch (3860:20): [True: 558k, False: 380k]
  |  Branch (3860:34): [True: 8.73k, False: 372k]
  ------------------
 3861|   567k|                  auto peek = it;
 3862|   567k|                  skip_inline_ws(peek, end);
 3863|   567k|                  if (peek != end && *peek != '\n' && *peek != '\r' && *peek != '#') {
  ------------------
  |  Branch (3863:23): [True: 565k, False: 1.32k]
  |  Branch (3863:38): [True: 562k, False: 3.64k]
  |  Branch (3863:55): [True: 559k, False: 2.74k]
  |  Branch (3863:72): [True: 550k, False: 9.13k]
  ------------------
 3864|   550k|                     continue; // At leading indent of new line
 3865|   550k|                  }
 3866|   567k|               }
 3867|   388k|               skip_inline_ws(it, end);
 3868|   388k|               if (it != end && *it == '#') {
  ------------------
  |  Branch (3868:20): [True: 387k, False: 1.32k]
  |  Branch (3868:33): [True: 32.5k, False: 355k]
  ------------------
 3869|  32.5k|                  if constexpr (std::is_pointer_v<std::decay_t<It>>) {
 3870|  32.5k|                     if (it > line_start) {
  ------------------
  |  Branch (3870:26): [True: 32.5k, False: 0]
  ------------------
 3871|  32.5k|                        const char prev = *(it - 1);
 3872|  32.5k|                        if (prev != ' ' && prev != '\t' && prev != '\n' && prev != '\r') {
  ------------------
  |  Branch (3872:29): [True: 11.6k, False: 20.9k]
  |  Branch (3872:44): [True: 3.21k, False: 8.41k]
  |  Branch (3872:60): [True: 1.69k, False: 1.51k]
  |  Branch (3872:76): [True: 35, False: 1.66k]
  ------------------
 3873|     35|                           ctx.error = error_code::syntax_error;
 3874|     35|                           return;
 3875|     35|                        }
 3876|  32.5k|                     }
 3877|  32.5k|                  }
 3878|  32.5k|               }
 3879|  32.5k|               skip_comment(it, end);
 3880|   388k|               if (it != end && (*it == '\n' || *it == '\r')) {
  ------------------
  |  Branch (3880:20): [True: 386k, False: 2.40k]
  |  Branch (3880:34): [True: 135k, False: 251k]
  |  Branch (3880:49): [True: 149k, False: 101k]
  ------------------
 3881|   285k|                  skip_newline(it, end);
 3882|   285k|               }
 3883|   103k|               else if (it != end) {
  ------------------
  |  Branch (3883:25): [True: 101k, False: 2.40k]
  ------------------
 3884|       |                  // The entry stopped part way along its line with something other than
 3885|       |                  // whitespace or a comment after it -- a ':' its value could not take as a
 3886|       |                  // separator, say. The next pass measures indent as though this were the start
 3887|       |                  // of a line, so what is left of the real one is lost; reject it instead.
 3888|   101k|                  if constexpr (requires { ctx.line_prefix_before(it); }) {
 3889|   101k|                     if (ctx.line_prefix_before(it).has_content) {
  ------------------
  |  Branch (3889:26): [True: 1.01k, False: 100k]
  ------------------
 3890|  1.01k|                        ctx.error = error_code::syntax_error;
 3891|  1.01k|                        return;
 3892|  1.01k|                     }
 3893|   101k|                  }
 3894|   101k|               }
 3895|   388k|            }
 3896|  1.23M|         }
 3897|   777k|      }
_ZZN3glz4fromILj450ENS_17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES1_EEEEE2opITnDaXtlNS_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2EEERPKcRS5_TkNS_10is_contextERNS8_12yaml_contextESB_EEvOT1_OT2_OT0_T3_ENKUlRT_RSK_SG_iE_clISE_SB_SB_EEbSO_SP_SG_i:
 4777|  1.28M|               ctx, it, end, int32_t(-1), [&](auto& ctx, auto& it, auto end, int32_t line_indent) -> bool {
 4778|  1.28M|                  auto parse_map_value = [&](val_t& val) -> bool {
 4779|  1.28M|                     if (it != end && !yaml::line_end_or_comment_table[static_cast<uint8_t>(*it)]) {
 4780|  1.28M|                        bool line_starts_with_explicit_value_indicator = false;
 4781|       |
 4782|       |                        // Inline mapping values in block context cannot start with a
 4783|       |                        // plain "key: value" pair on the same line (e.g. "a: b: c").
 4784|       |                        // Such constructs are malformed unless wrapped in flow
 4785|       |                        // delimiters ({...} / [...]) or quoted.
 4786|  1.28M|                        if constexpr (std::is_pointer_v<std::decay_t<decltype(it)>>) {
 4787|  1.28M|                           if (ctx.stream_begin) {
 4788|  1.28M|                              auto is_line_content_start = [&](auto pos) {
 4789|  1.28M|                                 return !ctx.line_prefix_before(pos).has_content;
 4790|  1.28M|                              };
 4791|       |
 4792|  1.28M|                              auto line_has_explicit_value_indicator = [&](auto pos) {
 4793|  1.28M|                                 const char* line = ctx.line_begin_of(pos);
 4794|  1.28M|                                 while (line != end && (*line == ' ' || *line == '\t')) ++line;
 4795|  1.28M|                                 return line != end && *line == ':';
 4796|  1.28M|                              };
 4797|       |
 4798|  1.28M|                              if (!is_line_content_start(it) &&
 4799|  1.28M|                                  yaml::inline_value_has_plain_mapping_indicator(it, end) &&
 4800|  1.28M|                                  !line_has_explicit_value_indicator(it)) {
 4801|  1.28M|                                 ctx.error = error_code::syntax_error;
 4802|  1.28M|                                 return false;
 4803|  1.28M|                              }
 4804|  1.28M|                              line_starts_with_explicit_value_indicator = line_has_explicit_value_indicator(it);
 4805|  1.28M|                           }
 4806|  1.28M|                        }
 4807|       |
 4808|  1.28M|                        if (*it == '-' &&
 4809|  1.28M|                            ((it + 1) == end || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*(it + 1))]) &&
 4810|  1.28M|                            !line_starts_with_explicit_value_indicator) {
 4811|       |                           // "key: - item" is not valid block sequence syntax.
 4812|  1.28M|                           ctx.error = error_code::syntax_error;
 4813|  1.28M|                           return false;
 4814|  1.28M|                        }
 4815|       |
 4816|  1.28M|                        if (!ctx.push_indent(line_indent + 1)) [[unlikely]]
 4817|  1.28M|                           return false;
 4818|  1.28M|                        from<YAML, val_t>::template op<Opts>(val, ctx, it, end);
 4819|  1.28M|                        ctx.pop_indent();
 4820|  1.28M|                     }
 4821|  1.28M|                     else {
 4822|  1.28M|                        int32_t nested_indent = yaml::detect_nested_value_indent(ctx, it, end, line_indent);
 4823|  1.28M|                        if (nested_indent >= 0) {
 4824|  1.28M|                           yaml::skip_to_content(it, end);
 4825|  1.28M|                           if (it != end && *it == ':' && (it + 1) != end && *(it + 1) == '\t') {
 4826|  1.28M|                              ctx.error = error_code::syntax_error;
 4827|  1.28M|                              return false;
 4828|  1.28M|                           }
 4829|       |                           // A struct value reads the pushed indent as its own key column;
 4830|       |                           // every other value type reads it as the enclosing baseline.
 4831|  1.28M|                           const int32_t value_indent =
 4832|  1.28M|                              yaml::receives_block_mapping_column<val_t>() ? nested_indent : nested_indent - 1;
 4833|  1.28M|                           if (!ctx.push_indent(value_indent)) [[unlikely]]
 4834|  1.28M|                              return false;
 4835|  1.28M|                           from<YAML, val_t>::template op<Opts>(val, ctx, it, end);
 4836|  1.28M|                           ctx.pop_indent();
 4837|  1.28M|                        }
 4838|  1.28M|                     }
 4839|  1.28M|                     return !bool(ctx.error);
 4840|  1.28M|                  };
 4841|       |
 4842|       |                  // Explicit key entry form:
 4843|       |                  // ? key
 4844|       |                  // : value
 4845|  1.28M|                  if (*it == '?' && ((it + 1) != end) && *(it + 1) == '\t') {
  ------------------
  |  Branch (4845:23): [True: 364k, False: 916k]
  |  Branch (4845:37): [True: 364k, False: 590]
  |  Branch (4845:58): [True: 13, False: 364k]
  ------------------
 4846|     13|                     ctx.error = error_code::syntax_error;
 4847|     13|                     return false;
 4848|     13|                  }
 4849|  1.28M|                  if (*it == '?' && ((it + 1) == end || *(it + 1) == ' ' || *(it + 1) == '\n' || *(it + 1) == '\r')) {
  ------------------
  |  Branch (4849:23): [True: 364k, False: 916k]
  |  Branch (4849:38): [True: 590, False: 364k]
  |  Branch (4849:57): [True: 126k, False: 237k]
  |  Branch (4849:77): [True: 215k, False: 21.8k]
  |  Branch (4849:98): [True: 10.8k, False: 10.9k]
  ------------------
 4850|   353k|                     ++it; // skip '?'
 4851|   353k|                     yaml::skip_inline_ws(it, end);
 4852|       |
 4853|   353k|                     const int32_t explicit_value_indicator_indent =
 4854|   353k|                        (ctx.current_indent() < 0) ? 0 : (ctx.current_indent() + 1);
  ------------------
  |  Branch (4854:25): [True: 95.5k, False: 258k]
  ------------------
 4855|       |
 4856|   353k|                     key_t key{};
 4857|   353k|                     if constexpr (std::same_as<std::remove_cvref_t<key_t>, std::string>) {
 4858|   353k|                        auto to_string_key = [&](glz::generic& key_node) {
 4859|   353k|                           return yaml::materialize_key(key, key_node, ctx);
 4860|   353k|                        };
 4861|       |
 4862|   353k|                        auto key_it = it;
 4863|   353k|                        yaml::skip_inline_ws(key_it, end);
 4864|       |
 4865|   353k|                        auto content = key_it;
 4866|   353k|                        yaml::skip_to_content(content, end);
 4867|   353k|                        bool handled_anchor_only_empty_key = false;
 4868|       |
 4869|       |                        // Anchor on an empty explicit key node:
 4870|       |                        //   ? &a
 4871|       |                        //   : value
 4872|   353k|                        if (content != end && *content == '&') {
  ------------------
  |  Branch (4872:29): [True: 350k, False: 3.28k]
  |  Branch (4872:47): [True: 101k, False: 248k]
  ------------------
 4873|   101k|                           auto anchor_probe = content + 1;
 4874|   101k|                           auto anchor_name = yaml::parse_anchor_name(anchor_probe, end);
 4875|   101k|                           if (!anchor_name.empty()) {
  ------------------
  |  Branch (4875:32): [True: 101k, False: 28]
  ------------------
 4876|   101k|                              auto after_anchor = anchor_probe;
 4877|   101k|                              yaml::skip_inline_ws(after_anchor, end);
 4878|       |
 4879|   101k|                              auto value_indicator = after_anchor;
 4880|   101k|                              if (value_indicator != end && *value_indicator == ':') {
  ------------------
  |  Branch (4880:35): [True: 97.8k, False: 3.74k]
  |  Branch (4880:61): [True: 5.15k, False: 92.7k]
  ------------------
 4881|  5.15k|                                 key.clear();
 4882|  5.15k|                                 ctx.anchors[std::string(anchor_name)] = {content, content, ctx.current_indent()};
 4883|  5.15k|                                 it = value_indicator;
 4884|  5.15k|                                 handled_anchor_only_empty_key = true;
 4885|  5.15k|                              }
 4886|  96.4k|                              else {
 4887|  96.4k|                                 if (value_indicator != end && *value_indicator == '#') {
  ------------------
  |  Branch (4887:38): [True: 92.7k, False: 3.74k]
  |  Branch (4887:64): [True: 3.06k, False: 89.6k]
  ------------------
 4888|  3.06k|                                    yaml::skip_comment(value_indicator, end);
 4889|  3.06k|                                 }
 4890|  96.4k|                                 if (value_indicator != end && (*value_indicator == '\n' || *value_indicator == '\r')) {
  ------------------
  |  Branch (4890:38): [True: 92.7k, False: 3.76k]
  |  Branch (4890:65): [True: 8.76k, False: 83.9k]
  |  Branch (4890:93): [True: 15.2k, False: 68.6k]
  ------------------
 4891|  24.0k|                                    yaml::skip_newline(value_indicator, end);
 4892|  24.0k|                                    auto value_line = value_indicator;
 4893|  24.0k|                                    int32_t value_indent = yaml::measure_indent(value_line, end, ctx);
 4894|  24.0k|                                    if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4894:41): [True: 4, False: 24.0k]
  ------------------
 4895|      4|                                       return false;
 4896|  24.0k|                                    if (value_line != end && *value_line == ':' &&
  ------------------
  |  Branch (4896:41): [True: 20.7k, False: 3.24k]
  |  Branch (4896:62): [True: 2.20k, False: 18.5k]
  ------------------
 4897|  2.20k|                                        value_indent == explicit_value_indicator_indent) {
  ------------------
  |  Branch (4897:41): [True: 2.17k, False: 28]
  ------------------
 4898|  2.17k|                                       key.clear();
 4899|  2.17k|                                       ctx.anchors[std::string(anchor_name)] = {content, content, ctx.current_indent()};
 4900|  2.17k|                                       it = value_line;
 4901|  2.17k|                                       handled_anchor_only_empty_key = true;
 4902|  2.17k|                                    }
 4903|  21.8k|                                    else if (value_line != end && *value_line == ':') {
  ------------------
  |  Branch (4903:46): [True: 18.6k, False: 3.24k]
  |  Branch (4903:67): [True: 28, False: 18.5k]
  ------------------
 4904|       |                                       // In explicit-key form ("? &a"), a following ':'
 4905|       |                                       // starts the outer value indicator only at the same
 4906|       |                                       // indentation. A deeper-indented ': value' is malformed.
 4907|     28|                                       ctx.error = error_code::syntax_error;
 4908|     28|                                       return false;
 4909|     28|                                    }
 4910|  24.0k|                                 }
 4911|  96.4k|                              }
 4912|   101k|                           }
 4913|   101k|                        }
 4914|       |
 4915|   353k|                        const bool key_content_spans_lines = [&] {
 4916|   353k|                           auto scan = key_it;
 4917|   353k|                           while (scan != content && scan != end) {
 4918|   353k|                              if (*scan == '\n' || *scan == '\r') return true;
 4919|   353k|                              ++scan;
 4920|   353k|                           }
 4921|   353k|                           return false;
 4922|   353k|                        }();
 4923|       |
 4924|   353k|                        if (handled_anchor_only_empty_key) {
  ------------------
  |  Branch (4924:29): [True: 7.32k, False: 346k]
  ------------------
 4925|       |                           // 'it' already points to the explicit value indicator ':'
 4926|  7.32k|                        }
 4927|   346k|                        else if (content == end || (*content == ':' && key_content_spans_lines)) {
  ------------------
  |  Branch (4927:34): [True: 3.28k, False: 342k]
  |  Branch (4927:53): [True: 9.51k, False: 333k]
  |  Branch (4927:72): [True: 5.04k, False: 4.47k]
  ------------------
 4928|  8.33k|                           key.clear();
 4929|  8.33k|                           it = content;
 4930|  8.33k|                        }
 4931|   337k|                        else {
 4932|       |                           // Explicit mapping keys ('? key-node') are full YAML nodes.
 4933|       |                           // Parse the key node structurally (not via plain-key scanning)
 4934|       |                           // so inputs like '? []: x' and '? JSON: like' are interpreted
 4935|       |                           // as complex keys, not split into implicit key/value pairs.
 4936|   337k|                           auto key_node_it = content;
 4937|   337k|                           auto key_node_end = end;
 4938|   337k|                           if constexpr (std::is_pointer_v<std::decay_t<It>>) {
 4939|       |                              // In explicit-key form, a following standalone ':'
 4940|       |                              // line (same or lower indentation) belongs to the
 4941|       |                              // outer mapping value, not the key node itself.
 4942|   337k|                              auto scan = content;
 4943|  6.57M|                              while (scan != end) {
  ------------------
  |  Branch (4943:38): [True: 6.39M, False: 181k]
  ------------------
 4944|   475M|                                 while (scan != end && *scan != '\n' && *scan != '\r') {
  ------------------
  |  Branch (4944:41): [True: 475M, False: 65.9k]
  |  Branch (4944:56): [True: 471M, False: 3.55M]
  |  Branch (4944:73): [True: 469M, False: 2.76M]
  ------------------
 4945|   469M|                                    ++scan;
 4946|   469M|                                 }
 4947|  6.39M|                                 if (scan == end) {
  ------------------
  |  Branch (4947:38): [True: 65.9k, False: 6.32M]
  ------------------
 4948|  65.9k|                                    break;
 4949|  65.9k|                                 }
 4950|       |
 4951|  6.32M|                                 yaml::skip_newline(scan, end);
 4952|  6.32M|                                 auto line_start = scan;
 4953|       |
 4954|  6.32M|                                 int32_t indicator_indent = 0;
 4955|  8.59M|                                 while (scan != end && *scan == ' ') {
  ------------------
  |  Branch (4955:41): [True: 8.41M, False: 181k]
  |  Branch (4955:56): [True: 2.26M, False: 6.14M]
  ------------------
 4956|  2.26M|                                    ++indicator_indent;
 4957|  2.26M|                                    ++scan;
 4958|  2.26M|                                 }
 4959|       |
 4960|  6.32M|                                 if (scan != end && *scan == ':') {
  ------------------
  |  Branch (4960:38): [True: 6.14M, False: 181k]
  |  Branch (4960:53): [True: 1.04M, False: 5.09M]
  ------------------
 4961|  1.04M|                                    const auto after_colon = scan + 1;
 4962|  1.04M|                                    if ((after_colon == end ||
  ------------------
  |  Branch (4962:42): [True: 854, False: 1.04M]
  ------------------
 4963|  1.04M|                                         yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*after_colon)]) &&
  ------------------
  |  Branch (4963:42): [True: 711k, False: 337k]
  ------------------
 4964|   711k|                                        indicator_indent <= line_indent) {
  ------------------
  |  Branch (4964:41): [True: 90.1k, False: 621k]
  ------------------
 4965|  90.1k|                                       key_node_end = line_start;
 4966|  90.1k|                                       break;
 4967|  90.1k|                                    }
 4968|  1.04M|                                 }
 4969|  6.32M|                              }
 4970|   337k|                           }
 4971|       |
 4972|   337k|                           glz::generic key_node{};
 4973|   337k|                           const bool prev_explicit_mapping_key_context = ctx.explicit_mapping_key_context;
 4974|   337k|                           ctx.explicit_mapping_key_context = true;
 4975|   337k|                           from<YAML, glz::generic>::template op<Opts>(key_node, ctx, key_node_it, key_node_end);
 4976|   337k|                           ctx.explicit_mapping_key_context = prev_explicit_mapping_key_context;
 4977|   337k|                           if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4977:32): [True: 7.49k, False: 330k]
  ------------------
 4978|  7.49k|                              return false;
 4979|   330k|                           it = key_node_it;
 4980|   330k|                           if (!to_string_key(key_node)) [[unlikely]]
  ------------------
  |  Branch (4980:32): [True: 98, False: 330k]
  ------------------
 4981|     98|                              return false;
 4982|   330k|                        }
 4983|       |                     }
 4984|       |                     else {
 4985|       |                        if (it != end && !yaml::line_end_or_comment_table[static_cast<uint8_t>(*it)]) {
 4986|       |                           from<YAML, key_t>::template op<Opts>(key, ctx, it, end);
 4987|       |                           if (bool(ctx.error)) [[unlikely]]
 4988|       |                              return false;
 4989|       |                        }
 4990|       |                     }
 4991|       |
 4992|   346k|                     yaml::skip_inline_ws(it, end);
 4993|   353k|                     yaml::skip_comment(it, end);
 4994|       |
 4995|       |                     // Value indicator may appear on the next line at the same indent.
 4996|   353k|                     if (it != end && (*it == '\n' || *it == '\r')) {
  ------------------
  |  Branch (4996:26): [True: 247k, False: 106k]
  |  Branch (4996:40): [True: 30.9k, False: 216k]
  |  Branch (4996:55): [True: 86.7k, False: 129k]
  ------------------
 4997|   117k|                        auto probe = it;
 4998|   117k|                        bool found_value_indicator = false;
 4999|       |
 5000|   255k|                        while (probe != end && (*probe == '\n' || *probe == '\r')) {
  ------------------
  |  Branch (5000:32): [True: 178k, False: 77.5k]
  |  Branch (5000:49): [True: 40.9k, False: 137k]
  |  Branch (5000:67): [True: 137k, False: 0]
  ------------------
 5001|   178k|                           yaml::skip_newline(probe, end);
 5002|       |
 5003|   178k|                           auto value_line = probe;
 5004|   178k|                           int32_t value_indent = yaml::measure_indent(value_line, end, ctx);
 5005|   178k|                           if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (5005:32): [True: 19, False: 178k]
  ------------------
 5006|     19|                              return false;
 5007|       |
 5008|   178k|                           if (value_line == end || *value_line == '\n' || *value_line == '\r') {
  ------------------
  |  Branch (5008:32): [True: 77.5k, False: 100k]
  |  Branch (5008:53): [True: 4.99k, False: 95.5k]
  |  Branch (5008:76): [True: 48.8k, False: 46.7k]
  ------------------
 5009|   131k|                              probe = value_line;
 5010|   131k|                              continue; // blank line
 5011|   131k|                           }
 5012|  46.7k|                           if (*value_line == '#') {
  ------------------
  |  Branch (5012:32): [True: 6.65k, False: 40.0k]
  ------------------
 5013|  6.65k|                              yaml::skip_comment(value_line, end);
 5014|  6.65k|                              probe = value_line;
 5015|  6.65k|                              continue; // comment-only line
 5016|  6.65k|                           }
 5017|  40.0k|                           if (*value_line == ':' && value_indent == explicit_value_indicator_indent) {
  ------------------
  |  Branch (5017:32): [True: 11.2k, False: 28.7k]
  |  Branch (5017:54): [True: 2.25k, False: 9.02k]
  ------------------
 5018|  2.25k|                              it = value_line;
 5019|  2.25k|                              found_value_indicator = true;
 5020|  2.25k|                           }
 5021|  40.0k|                           break;
 5022|  46.7k|                        }
 5023|       |
 5024|   117k|                        if (found_value_indicator) {
  ------------------
  |  Branch (5024:29): [True: 2.25k, False: 115k]
  ------------------
 5025|  2.25k|                           yaml::skip_inline_ws(it, end);
 5026|  2.25k|                        }
 5027|   117k|                     }
 5028|       |
 5029|   353k|                     val_t val{};
 5030|   353k|                     if (it != end && *it == ':') {
  ------------------
  |  Branch (5030:26): [True: 247k, False: 106k]
  |  Branch (5030:39): [True: 113k, False: 134k]
  ------------------
 5031|   113k|                        ++it;
 5032|   113k|                        if (it != end && *it == '\t') {
  ------------------
  |  Branch (5032:29): [True: 111k, False: 1.76k]
  |  Branch (5032:42): [True: 9, False: 111k]
  ------------------
 5033|      9|                           ctx.error = error_code::syntax_error;
 5034|      9|                           return false;
 5035|      9|                        }
 5036|   113k|                        if (it != end && (*it == '\n' || *it == '\r')) {
  ------------------
  |  Branch (5036:29): [True: 111k, False: 1.76k]
  |  Branch (5036:43): [True: 2.53k, False: 109k]
  |  Branch (5036:58): [True: 12.9k, False: 96.1k]
  ------------------
 5037|  15.4k|                           auto probe = it;
 5038|  15.4k|                           yaml::skip_newline(probe, end);
 5039|  31.5k|                           while (probe != end && *probe == ' ') ++probe;
  ------------------
  |  Branch (5039:35): [True: 28.0k, False: 3.49k]
  |  Branch (5039:51): [True: 16.0k, False: 11.9k]
  ------------------
 5040|  15.4k|                           if (probe != end && *probe == ':' && ((probe + 1) != end) && *(probe + 1) == '\t') {
  ------------------
  |  Branch (5040:32): [True: 11.9k, False: 3.49k]
  |  Branch (5040:48): [True: 2.81k, False: 9.16k]
  |  Branch (5040:65): [True: 2.81k, False: 8]
  |  Branch (5040:89): [True: 4, False: 2.80k]
  ------------------
 5041|      4|                              ctx.error = error_code::syntax_error;
 5042|      4|                              return false;
 5043|      4|                           }
 5044|  15.4k|                        }
 5045|   113k|                        yaml::skip_inline_ws(it, end);
 5046|   113k|                        if (!parse_map_value(val)) [[unlikely]]
  ------------------
  |  Branch (5046:29): [True: 841, False: 112k]
  ------------------
 5047|    841|                           return false;
 5048|   113k|                     }
 5049|       |
 5050|   352k|                     value.emplace(std::move(key), std::move(val));
 5051|   352k|                     return true;
 5052|   353k|                  }
 5053|       |
 5054|   927k|                  key_t key{};
 5055|   927k|                  if constexpr (std::same_as<std::remove_cvref_t<key_t>, std::string>) {
 5056|   927k|                     auto key_probe = it;
 5057|   927k|                     yaml::skip_inline_ws(key_probe, end);
 5058|   927k|                     const bool complex_flow_key = (key_probe != end && (*key_probe == '[' || *key_probe == '{'));
  ------------------
  |  Branch (5058:53): [True: 927k, False: 0]
  |  Branch (5058:74): [True: 3.08k, False: 924k]
  |  Branch (5058:95): [True: 5.54k, False: 919k]
  ------------------
 5059|   927k|                     if (complex_flow_key) {
  ------------------
  |  Branch (5059:26): [True: 8.62k, False: 919k]
  ------------------
 5060|  8.62k|                        glz::generic key_node{};
 5061|  8.62k|                        from<YAML, glz::generic>::template op<yaml::flow_context_on<Opts>()>(key_node, ctx, it, end);
 5062|  8.62k|                        if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (5062:29): [True: 973, False: 7.65k]
  ------------------
 5063|    973|                           return false;
 5064|  7.65k|                        if (!yaml::materialize_key(key, key_node, ctx)) [[unlikely]]
  ------------------
  |  Branch (5064:29): [True: 2, False: 7.65k]
  ------------------
 5065|      2|                           return false;
 5066|  7.65k|                     }
 5067|   919k|                     else {
 5068|   919k|                        if (!yaml::parse_yaml_key(key, ctx, it, end, false)) {
  ------------------
  |  Branch (5068:29): [True: 3.32k, False: 915k]
  ------------------
 5069|  3.32k|                           return false;
 5070|  3.32k|                        }
 5071|   919k|                     }
 5072|       |                  }
 5073|       |                  else {
 5074|       |                     from<YAML, key_t>::template op<Opts>(key, ctx, it, end);
 5075|       |                     if (bool(ctx.error)) [[unlikely]]
 5076|       |                        return false;
 5077|       |                  }
 5078|       |
 5079|   923k|                  yaml::skip_inline_ws(it, end);
 5080|       |
 5081|   927k|                  if (it == end || *it != ':') {
  ------------------
  |  Branch (5081:23): [True: 6.63k, False: 921k]
  |  Branch (5081:36): [True: 2.10k, False: 919k]
  ------------------
 5082|  4.44k|                     ctx.error = error_code::syntax_error;
 5083|  4.44k|                     return false;
 5084|  4.44k|                  }
 5085|   923k|                  ++it;
 5086|   923k|                  yaml::skip_inline_ws(it, end);
 5087|       |
 5088|   923k|                  val_t val{};
 5089|   923k|                  if (!parse_map_value(val)) [[unlikely]]
  ------------------
  |  Branch (5089:23): [True: 26.8k, False: 896k]
  ------------------
 5090|  26.8k|                     return false;
 5091|       |
 5092|   896k|                  value.emplace(std::move(key), std::move(val));
 5093|   896k|                  return true;
 5094|   923k|               });
_ZZZN3glz4fromILj450ENS_17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES1_EEEEE2opITnDaXtlNS_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2EEERPKcRS5_TkNS_10is_contextERNS8_12yaml_contextESB_EEvOT1_OT2_OT0_T3_ENKUlRT_RSK_SG_iE_clISE_SB_SB_EEbSO_SP_SG_iENKUlvE_clEv:
 4915|   353k|                        const bool key_content_spans_lines = [&] {
 4916|   353k|                           auto scan = key_it;
 4917|   381k|                           while (scan != content && scan != end) {
  ------------------
  |  Branch (4917:35): [True: 259k, False: 121k]
  |  Branch (4917:54): [True: 259k, False: 0]
  ------------------
 4918|   259k|                              if (*scan == '\n' || *scan == '\r') return true;
  ------------------
  |  Branch (4918:35): [True: 217k, False: 42.5k]
  |  Branch (4918:52): [True: 15.0k, False: 27.5k]
  ------------------
 4919|  27.5k|                              ++scan;
 4920|  27.5k|                           }
 4921|   121k|                           return false;
 4922|   353k|                        }();
_ZZZN3glz4fromILj450ENS_17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES1_EEEEE2opITnDaXtlNS_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2EEERPKcRS5_TkNS_10is_contextERNS8_12yaml_contextESB_EEvOT1_OT2_OT0_T3_ENKUlRT_RSK_SG_iE_clISE_SB_SB_EEbSO_SP_SG_iENKUlRS4_E0_clESS_:
 4858|   330k|                        auto to_string_key = [&](glz::generic& key_node) {
 4859|   330k|                           return yaml::materialize_key(key, key_node, ctx);
 4860|   330k|                        };
_ZZZN3glz4fromILj450ENS_17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES1_EEEEE2opITnDaXtlNS_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2EEERPKcRS5_TkNS_10is_contextERNS8_12yaml_contextESB_EEvOT1_OT2_OT0_T3_ENKUlRT_RSK_SG_iE_clISE_SB_SB_EEbSO_SP_SG_iENKUlRS4_E_clESS_:
 4778|  1.03M|                  auto parse_map_value = [&](val_t& val) -> bool {
 4779|  1.03M|                     if (it != end && !yaml::line_end_or_comment_table[static_cast<uint8_t>(*it)]) {
  ------------------
  |  Branch (4779:26): [True: 1.02M, False: 12.0k]
  |  Branch (4779:39): [True: 790k, False: 230k]
  ------------------
 4780|   790k|                        bool line_starts_with_explicit_value_indicator = false;
 4781|       |
 4782|       |                        // Inline mapping values in block context cannot start with a
 4783|       |                        // plain "key: value" pair on the same line (e.g. "a: b: c").
 4784|       |                        // Such constructs are malformed unless wrapped in flow
 4785|       |                        // delimiters ({...} / [...]) or quoted.
 4786|   790k|                        if constexpr (std::is_pointer_v<std::decay_t<decltype(it)>>) {
 4787|   790k|                           if (ctx.stream_begin) {
  ------------------
  |  Branch (4787:32): [True: 790k, False: 0]
  ------------------
 4788|   790k|                              auto is_line_content_start = [&](auto pos) {
 4789|   790k|                                 return !ctx.line_prefix_before(pos).has_content;
 4790|   790k|                              };
 4791|       |
 4792|   790k|                              auto line_has_explicit_value_indicator = [&](auto pos) {
 4793|   790k|                                 const char* line = ctx.line_begin_of(pos);
 4794|   790k|                                 while (line != end && (*line == ' ' || *line == '\t')) ++line;
 4795|   790k|                                 return line != end && *line == ':';
 4796|   790k|                              };
 4797|       |
 4798|   790k|                              if (!is_line_content_start(it) &&
  ------------------
  |  Branch (4798:35): [True: 790k, False: 0]
  ------------------
 4799|   790k|                                  yaml::inline_value_has_plain_mapping_indicator(it, end) &&
  ------------------
  |  Branch (4799:35): [True: 78.7k, False: 711k]
  ------------------
 4800|  78.7k|                                  !line_has_explicit_value_indicator(it)) {
  ------------------
  |  Branch (4800:35): [True: 1.13k, False: 77.6k]
  ------------------
 4801|  1.13k|                                 ctx.error = error_code::syntax_error;
 4802|  1.13k|                                 return false;
 4803|  1.13k|                              }
 4804|   788k|                              line_starts_with_explicit_value_indicator = line_has_explicit_value_indicator(it);
 4805|   788k|                           }
 4806|   790k|                        }
 4807|       |
 4808|   790k|                        if (*it == '-' &&
  ------------------
  |  Branch (4808:29): [True: 5.02k, False: 785k]
  ------------------
 4809|  5.02k|                            ((it + 1) == end || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*(it + 1))]) &&
  ------------------
  |  Branch (4809:30): [True: 11, False: 5.01k]
  |  Branch (4809:49): [True: 788, False: 4.22k]
  ------------------
 4810|    799|                            !line_starts_with_explicit_value_indicator) {
  ------------------
  |  Branch (4810:29): [True: 17, False: 782]
  ------------------
 4811|       |                           // "key: - item" is not valid block sequence syntax.
 4812|     17|                           ctx.error = error_code::syntax_error;
 4813|     17|                           return false;
 4814|     17|                        }
 4815|       |
 4816|   790k|                        if (!ctx.push_indent(line_indent + 1)) [[unlikely]]
  ------------------
  |  Branch (4816:29): [True: 0, False: 790k]
  ------------------
 4817|      0|                           return false;
 4818|   790k|                        from<YAML, val_t>::template op<Opts>(val, ctx, it, end);
 4819|   790k|                        ctx.pop_indent();
 4820|   790k|                     }
 4821|   242k|                     else {
 4822|   242k|                        int32_t nested_indent = yaml::detect_nested_value_indent(ctx, it, end, line_indent);
 4823|   242k|                        if (nested_indent >= 0) {
  ------------------
  |  Branch (4823:29): [True: 41.7k, False: 200k]
  ------------------
 4824|  41.7k|                           yaml::skip_to_content(it, end);
 4825|  41.7k|                           if (it != end && *it == ':' && (it + 1) != end && *(it + 1) == '\t') {
  ------------------
  |  Branch (4825:32): [True: 41.7k, False: 0]
  |  Branch (4825:45): [True: 0, False: 41.7k]
  |  Branch (4825:59): [True: 0, False: 0]
  |  Branch (4825:78): [True: 0, False: 0]
  ------------------
 4826|      0|                              ctx.error = error_code::syntax_error;
 4827|      0|                              return false;
 4828|      0|                           }
 4829|       |                           // A struct value reads the pushed indent as its own key column;
 4830|       |                           // every other value type reads it as the enclosing baseline.
 4831|  41.7k|                           const int32_t value_indent =
 4832|  41.7k|                              yaml::receives_block_mapping_column<val_t>() ? nested_indent : nested_indent - 1;
  ------------------
  |  Branch (4832:31): [Folded, False: 41.7k]
  ------------------
 4833|  41.7k|                           if (!ctx.push_indent(value_indent)) [[unlikely]]
  ------------------
  |  Branch (4833:32): [True: 0, False: 41.7k]
  ------------------
 4834|      0|                              return false;
 4835|  41.7k|                           from<YAML, val_t>::template op<Opts>(val, ctx, it, end);
 4836|  41.7k|                           ctx.pop_indent();
 4837|  41.7k|                        }
 4838|   242k|                     }
 4839|  1.03M|                     return !bool(ctx.error);
 4840|  1.03M|                  };
_ZZZZN3glz4fromILj450ENS_17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES1_EEEEE2opITnDaXtlNS_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2EEERPKcRS5_TkNS_10is_contextERNS8_12yaml_contextESB_EEvOT1_OT2_OT0_T3_ENKUlRT_RSK_SG_iE_clISE_SB_SB_EEbSO_SP_SG_iENKUlRS4_E_clESS_ENKUlSN_E_clISB_EEDaSN_:
 4788|   790k|                              auto is_line_content_start = [&](auto pos) {
 4789|   790k|                                 return !ctx.line_prefix_before(pos).has_content;
 4790|   790k|                              };
_ZZZZN3glz4fromILj450ENS_17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES1_EEEEE2opITnDaXtlNS_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2EEERPKcRS5_TkNS_10is_contextERNS8_12yaml_contextESB_EEvOT1_OT2_OT0_T3_ENKUlRT_RSK_SG_iE_clISE_SB_SB_EEbSO_SP_SG_iENKUlRS4_E_clESS_ENKUlSN_E0_clISB_EEDaSN_:
 4792|   867k|                              auto line_has_explicit_value_indicator = [&](auto pos) {
 4793|   867k|                                 const char* line = ctx.line_begin_of(pos);
 4794|  1.84M|                                 while (line != end && (*line == ' ' || *line == '\t')) ++line;
  ------------------
  |  Branch (4794:41): [True: 1.84M, False: 0]
  |  Branch (4794:57): [True: 972k, False: 874k]
  |  Branch (4794:73): [True: 7.31k, False: 867k]
  ------------------
 4795|   867k|                                 return line != end && *line == ':';
  ------------------
  |  Branch (4795:41): [True: 867k, False: 0]
  |  Branch (4795:56): [True: 518k, False: 349k]
  ------------------
 4796|   867k|                              };
_ZZN3glz4fromILj450ENS_17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES1_EEEEE2opITnDaXtlNS_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2EEERPKcRS5_TkNS_10is_contextERNS8_12yaml_contextESB_EEvOT1_OT2_OT0_T3_EN19merge_restore_guardD2Ev:
 4547|   840k|            {
 4548|       |               // emplace is a no-op for keys the document already wrote, so only
 4549|       |               // untouched pre-existing entries are put back.
 4550|   840k|               for (auto& entry : saved) {
  ------------------
  |  Branch (4550:33): [True: 0, False: 840k]
  ------------------
 4551|      0|                  target.emplace(entry.first, std::move(entry.second));
 4552|      0|               }
 4553|   840k|            }
_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|   196k|      {
  301|   196k|         if (it == end || *it != '*') return false;
  ------------------
  |  Branch (301:14): [True: 0, False: 196k]
  |  Branch (301:27): [True: 0, False: 196k]
  ------------------
  302|       |
  303|   196k|         ++it; // skip '*'
  304|   196k|         auto name = parse_anchor_name(it, end);
  305|   196k|         if (name.empty()) {
  ------------------
  |  Branch (305:14): [True: 130, False: 196k]
  ------------------
  306|    130|            ctx.error = error_code::syntax_error;
  307|    130|            return true;
  308|    130|         }
  309|       |
  310|   196k|         auto anchor_it = ctx.anchors.find(name);
  311|   196k|         if (anchor_it == ctx.anchors.end()) {
  ------------------
  |  Branch (311:14): [True: 1.25k, False: 194k]
  ------------------
  312|  1.25k|            ctx.error = error_code::syntax_error; // undefined alias
  313|  1.25k|            return true;
  314|  1.25k|         }
  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|   194k|         const auto span = anchor_it->second;
  319|       |
  320|       |         // Empty anchor span (anchor on null/empty node) — leave value as default
  321|   194k|         if (span.begin == span.end) {
  ------------------
  |  Branch (321:14): [True: 2.54k, False: 192k]
  ------------------
  322|  2.54k|            return true;
  323|  2.54k|         }
  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|   192k|         if (ctx.alias_span_is_replaying(span.begin, span.end)) [[unlikely]] {
  ------------------
  |  Branch (328:14): [True: 90, False: 192k]
  ------------------
  329|     90|            ctx.error = error_code::syntax_error; // cyclic alias
  330|     90|            return true;
  331|     90|         }
  332|       |
  333|       |         // Replaying an anchor re-enters the reader directly, bypassing the variant reader's
  334|       |         // depth guard, so this is the only depth accounting a chain of aliases into a
  335|       |         // non-variant target gets. The cycle check above stops the unbounded case; this bounds
  336|       |         // a legitimate but deeply chained one.
  337|   192k|         depth_guard guard{ctx, yaml::max_yaml_recursive_depth};
  338|   192k|         if (!guard) [[unlikely]]
  ------------------
  |  Branch (338:14): [True: 3, False: 192k]
  ------------------
  339|      3|            return true;
  340|       |
  341|   192k|         if (!ctx.charge_alias_expansion(static_cast<size_t>(span.end - span.begin))) [[unlikely]] {
  ------------------
  |  Branch (341:14): [True: 14, False: 192k]
  ------------------
  342|     14|            ctx.error = error_code::exceeded_max_expansion;
  343|     14|            ctx.custom_error_message = "alias expansion";
  344|     14|            return true;
  345|     14|         }
  346|       |
  347|   192k|         auto replay_it = span.begin;
  348|   192k|         auto replay_end = span.end;
  349|       |
  350|       |         // Save indent context and set up for replay
  351|   192k|         auto saved_indent_stack = std::move(ctx.indent_stack);
  352|   192k|         ctx.indent_stack.clear();
  353|   192k|         if (span.base_indent > 0) {
  ------------------
  |  Branch (353:14): [True: 150k, False: 41.2k]
  ------------------
  354|   150k|            ctx.push_indent(span.base_indent - 1);
  355|   150k|         }
  356|       |
  357|   192k|         ctx.active_alias_spans.emplace_back(span.begin, span.end);
  358|       |
  359|   192k|         using V = std::remove_cvref_t<T>;
  360|   192k|         from<YAML, V>::template op<Opts>(std::forward<T>(value), ctx, replay_it, replay_end);
  361|       |
  362|   192k|         ctx.active_alias_spans.pop_back();
  363|       |
  364|       |         // Restore indent context
  365|   192k|         ctx.indent_stack = std::move(saved_indent_stack);
  366|   192k|         return true;
  367|   192k|      }
_ZN3glz33process_yaml_variant_alternativesINSt3__17variantIJDndNS1_12basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEbNS1_6vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS6_ISD_EEEENSC_ISD_EEEEENS_19is_yaml_variant_strEE2opITnDaXtlNS_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2EEERSH_TkNS_10is_contextERNSL_12yaml_contextERPKcSR_EEvOT0_OT1_OT2_T3_:
 5205|   257k|      {
 5206|   257k|         constexpr auto category_count = yaml_variant_count_v<Variant, Trait>;
 5207|       |
 5208|       |         if constexpr (category_count == 0) {
 5209|       |            ctx.error = error_code::no_matching_variant_type;
 5210|       |         }
 5211|   257k|         else if constexpr (category_count == 1) {
 5212|       |            // Only one type in this category, use it directly
 5213|   257k|            constexpr auto first_idx = yaml_variant_first_index_v<Variant, Trait>;
 5214|   257k|            using V = std::variant_alternative_t<first_idx, Variant>;
 5215|   257k|            if (!std::holds_alternative<V>(value)) value = V{};
  ------------------
  |  Branch (5215:17): [True: 257k, False: 0]
  ------------------
 5216|   257k|            from<YAML, V>::template op<Opts>(std::get<V>(value), ctx, it, end);
 5217|       |         }
 5218|       |         else {
 5219|       |            // Multiple types in this category, try each one
 5220|       |            constexpr auto N = std::variant_size_v<Variant>;
 5221|       |            bool found_match{};
 5222|       |            size_t match_idx = 0;
 5223|       |            // Only the last alternative propagates its error, so an alternative that exhausted an
 5224|       |            // expansion budget would otherwise be reported as no_matching_variant_type -- a wrong
 5225|       |            // diagnosis for a document that is hostile rather than merely the wrong shape. Held
 5226|       |            // aside and used only if nothing matched, so an alternative that does succeed later
 5227|       |            // (one that materializes no key text can still parse under a latched budget) is
 5228|       |            // unaffected.
 5229|       |            error_code expansion_error{};
 5230|       |            std::string_view expansion_message{};
 5231|       |
 5232|       |            for_each<N>([&]<size_t I>() {
 5233|       |               if (found_match) {
 5234|       |                  return;
 5235|       |               }
 5236|       |               using V = std::variant_alternative_t<I, Variant>;
 5237|       |               if constexpr (Trait<V>::value) {
 5238|       |                  auto copy_it = it;
 5239|       |                  if (!std::holds_alternative<V>(value)) {
 5240|       |                     value = V{};
 5241|       |                  }
 5242|       |
 5243|       |                  auto temp_ctx = ctx.make_speculative();
 5244|       |                  from<YAML, V>::template op<Opts>(std::get<V>(value), temp_ctx, it, end);
 5245|       |
 5246|       |                  // Charged whether or not the alternative fit: a rejected probe still replayed
 5247|       |                  // whatever aliases it reached, and an attempt that is never billed is an
 5248|       |                  // attempt that can be repeated for free.
 5249|       |                  ctx.alias_expansion_budget = temp_ctx.alias_expansion_budget;
 5250|       |                  ctx.key_expansion_budget = temp_ctx.key_expansion_budget;
 5251|       |
 5252|       |                  if (!bool(temp_ctx.error)) {
 5253|       |                     found_match = true;
 5254|       |                     ctx.anchors = std::move(temp_ctx.anchors);
 5255|       |                  }
 5256|       |                  else {
 5257|       |                     it = copy_it;
 5258|       |                     if (temp_ctx.error == error_code::exceeded_max_expansion && expansion_error == error_code::none) {
 5259|       |                        expansion_error = temp_ctx.error;
 5260|       |                        expansion_message = temp_ctx.custom_error_message;
 5261|       |                     }
 5262|       |                     if (match_idx + 1 < category_count) {
 5263|       |                        // Not the last type, continue trying
 5264|       |                     }
 5265|       |                     else {
 5266|       |                        // Last type failed, propagate error
 5267|       |                        ctx.error = temp_ctx.error;
 5268|       |                        ctx.custom_error_message = temp_ctx.custom_error_message;
 5269|       |                     }
 5270|       |                  }
 5271|       |                  ++match_idx;
 5272|       |               }
 5273|       |            });
 5274|       |
 5275|       |            if (!found_match && !bool(ctx.error)) {
 5276|       |               if (expansion_error != error_code::none) {
 5277|       |                  ctx.error = expansion_error;
 5278|       |                  ctx.custom_error_message = expansion_message;
 5279|       |               }
 5280|       |               else {
 5281|       |                  ctx.error = error_code::no_matching_variant_type;
 5282|       |               }
 5283|       |            }
 5284|       |         }
 5285|   257k|      }
_ZN3glz4fromILj450ENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEE2opITnDaXtlNS_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2EEERPKcRS7_TkNS_10is_contextERNSA_12yaml_contextESD_EEvOT1_OT2_OT0_T3_:
 1892|   264k|      {
 1893|   264k|         if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (1893:14): [True: 11.7k, False: 252k]
  ------------------
 1894|  11.7k|            return;
 1895|       |
 1896|   252k|         yaml::node_preamble_state preamble{};
 1897|   252k|         if (yaml::parse_node_preamble<Opts, yaml::node_property_policy{true, false, false, true}>(
  ------------------
  |  Branch (1897:14): [True: 7.14k, False: 245k]
  ------------------
 1898|   252k|                value, ctx, it, end, preamble, [](yaml::yaml_tag tag) { return yaml::tag_valid_for_string(tag); }))
 1899|  7.14k|            return;
 1900|       |
 1901|   245k|         std::string str;
 1902|   245k|         const auto style = yaml::detect_scalar_style(*it);
 1903|       |
 1904|   245k|         switch (style) {
  ------------------
  |  Branch (1904:18): [True: 245k, False: 0]
  ------------------
 1905|  1.42k|         case yaml::scalar_style::double_quoted:
  ------------------
  |  Branch (1905:10): [True: 1.42k, False: 243k]
  ------------------
 1906|  1.42k|            yaml::parse_double_quoted_string(str, ctx, it, end);
 1907|  1.42k|            break;
 1908|  2.20k|         case yaml::scalar_style::single_quoted:
  ------------------
  |  Branch (1908:10): [True: 2.20k, False: 243k]
  ------------------
 1909|  2.20k|            yaml::parse_single_quoted_string(str, ctx, it, end);
 1910|  2.20k|            break;
 1911|  2.98k|         case yaml::scalar_style::literal_block:
  ------------------
  |  Branch (1911:10): [True: 2.98k, False: 242k]
  ------------------
 1912|  4.12k|         case yaml::scalar_style::folded_block:
  ------------------
  |  Branch (1912:10): [True: 1.14k, False: 244k]
  ------------------
 1913|       |            // For same-line mapping/sequence values, parsing context is typically pushed
 1914|       |            // one column past the key/item indicator; block scalar indentation is relative
 1915|       |            // to the parent line indent.
 1916|  4.12k|            yaml::parse_block_scalar(str, ctx, it, end,
 1917|  4.12k|                                     ctx.current_indent() > 0 ? (ctx.current_indent() - 1) : ctx.current_indent());
  ------------------
  |  Branch (1917:38): [True: 785, False: 3.34k]
  ------------------
 1918|  4.12k|            break;
 1919|   237k|         case yaml::scalar_style::plain:
  ------------------
  |  Branch (1919:10): [True: 237k, False: 7.76k]
  ------------------
 1920|       |            // In block context with known indent, use multiline parsing to support
 1921|       |            // plain scalars that span multiple lines (folding behavior)
 1922|   237k|            if constexpr (!yaml::check_flow_context(Opts)) {
 1923|   237k|               if (ctx.current_indent() >= 0) {
  ------------------
  |  Branch (1923:20): [True: 201k, False: 36.3k]
  ------------------
 1924|   201k|                  yaml::parse_plain_scalar_multiline(str, ctx, it, end, ctx.current_indent());
 1925|   201k|               }
 1926|  36.3k|               else {
 1927|       |                  // Top-level plain scalars may continue on same-indent or indented lines.
 1928|  36.3k|                  yaml::parse_plain_scalar_multiline(str, ctx, it, end, int32_t(0));
 1929|  36.3k|               }
 1930|       |            }
 1931|       |            else {
 1932|       |               yaml::parse_plain_scalar(str, ctx, it, end, true);
 1933|       |            }
 1934|   237k|            break;
 1935|   245k|         }
 1936|       |
 1937|   245k|         if (!bool(ctx.error)) {
  ------------------
  |  Branch (1937:14): [True: 244k, False: 443]
  ------------------
 1938|   244k|            value = std::move(str);
 1939|   244k|            yaml::finalize_node_anchor(preamble.node_props, ctx, it);
 1940|   244k|         }
 1941|   245k|      }
_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|   252k|      {
  466|   252k|         skip_inline_ws(it, end);
  467|       |
  468|   252k|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (468:14): [True: 7, False: 252k]
  ------------------
  469|      7|            if constexpr (!AllowEmptyInput) {
  470|      7|               ctx.error = error_code::unexpected_end;
  471|      7|            }
  472|      7|            return true;
  473|      7|         }
  474|       |
  475|   252k|         preamble.tag = parse_yaml_tag(it, end, ctx);
  476|   252k|         if (preamble.tag == yaml_tag::unknown) [[unlikely]] {
  ------------------
  |  Branch (476:14): [True: 15, False: 252k]
  ------------------
  477|     15|            ctx.error = error_code::syntax_error;
  478|     15|            return true;
  479|     15|         }
  480|   252k|         if (!tag_validator(preamble.tag)) [[unlikely]] {
  ------------------
  |  Branch (480:14): [True: 13, False: 252k]
  ------------------
  481|     13|            ctx.error = error_code::syntax_error;
  482|     13|            return true;
  483|     13|         }
  484|       |
  485|   252k|         skip_inline_ws(it, end);
  486|       |
  487|   252k|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (487:14): [True: 29, False: 252k]
  ------------------
  488|     29|            if constexpr (!AllowEmptyInput) {
  489|     29|               ctx.error = error_code::unexpected_end;
  490|     29|            }
  491|     29|            return true;
  492|     29|         }
  493|       |
  494|   252k|         if (parse_node_properties<Opts, PropertyPolicy>(std::forward<T>(value), ctx, it, end, preamble.node_props)) {
  ------------------
  |  Branch (494:14): [True: 7.08k, False: 245k]
  ------------------
  495|  7.08k|            return true;
  496|  7.08k|         }
  497|       |
  498|   245k|         return false;
  499|   252k|      }
_ZZN3glz4fromILj450ENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEE2opITnDaXtlNS_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2EEERPKcRS7_TkNS_10is_contextERNSA_12yaml_contextESD_EEvOT1_OT2_OT0_T3_ENKUlNSA_8yaml_tagEE_clESP_:
 1898|   252k|                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|   252k|      {
  409|   252k|         state.has_anchor = false;
  410|   252k|         state.anchor_name.clear();
  411|   252k|         state.anchor_start = nullptr;
  412|   252k|         state.anchor_indent = ctx.current_indent();
  413|       |
  414|   252k|         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|   252k|            else {
  421|   252k|               if (handle_alias<Opts>(std::forward<T>(value), ctx, it, end)) return true;
  ------------------
  |  Branch (421:20): [True: 7.02k, False: 245k]
  ------------------
  422|   252k|            }
  423|   252k|         }
  424|       |
  425|   252k|         if (it != end && *it == '&') {
  ------------------
  |  Branch (425:14): [True: 245k, False: 7.02k]
  |  Branch (425:27): [True: 9.55k, False: 235k]
  ------------------
  426|  9.55k|            ++it;
  427|  9.55k|            auto name = parse_anchor_name(it, end);
  428|  9.55k|            if (name.empty()) {
  ------------------
  |  Branch (428:17): [True: 10, False: 9.54k]
  ------------------
  429|     10|               ctx.error = error_code::syntax_error;
  430|     10|               return true;
  431|     10|            }
  432|  9.54k|            skip_inline_ws(it, end);
  433|  9.54k|            if (it == end) {
  ------------------
  |  Branch (433:17): [True: 47, False: 9.49k]
  ------------------
  434|     47|               if constexpr (!Policy.allow_empty_after_anchor) {
  435|     47|                  ctx.error = error_code::unexpected_end;
  436|     47|               }
  437|     47|               return true;
  438|     47|            }
  439|  9.49k|            if constexpr (Policy.disallow_anchor_on_alias) {
  440|  9.49k|               if (*it == '*') {
  ------------------
  |  Branch (440:20): [True: 5, False: 9.49k]
  ------------------
  441|      5|                  ctx.error = error_code::syntax_error;
  442|      5|                  return true;
  443|      5|               }
  444|  9.49k|            }
  445|  9.49k|            state.has_anchor = true;
  446|  9.49k|            state.anchor_name = std::string(name);
  447|  9.49k|            state.anchor_start = &*it;
  448|  9.49k|         }
  449|       |
  450|   252k|         return false;
  451|   252k|      }
_ZN3glz4yaml12handle_aliasITnDaXtlNS0_9yaml_optsELj450ELb1ELb0ELb1ELh2EEERNSt3__112basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEENS0_12yaml_contextEPKcSD_EEbOT0_RT1_RT2_T3_:
  300|   252k|      {
  301|   252k|         if (it == end || *it != '*') return false;
  ------------------
  |  Branch (301:14): [True: 0, False: 252k]
  |  Branch (301:27): [True: 245k, False: 7.02k]
  ------------------
  302|       |
  303|  7.02k|         ++it; // skip '*'
  304|  7.02k|         auto name = parse_anchor_name(it, end);
  305|  7.02k|         if (name.empty()) {
  ------------------
  |  Branch (305:14): [True: 9, False: 7.01k]
  ------------------
  306|      9|            ctx.error = error_code::syntax_error;
  307|      9|            return true;
  308|      9|         }
  309|       |
  310|  7.01k|         auto anchor_it = ctx.anchors.find(name);
  311|  7.01k|         if (anchor_it == ctx.anchors.end()) {
  ------------------
  |  Branch (311:14): [True: 61, False: 6.95k]
  ------------------
  312|     61|            ctx.error = error_code::syntax_error; // undefined alias
  313|     61|            return true;
  314|     61|         }
  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.95k|         const auto span = anchor_it->second;
  319|       |
  320|       |         // Empty anchor span (anchor on null/empty node) — leave value as default
  321|  6.95k|         if (span.begin == span.end) {
  ------------------
  |  Branch (321:14): [True: 548, False: 6.40k]
  ------------------
  322|    548|            return true;
  323|    548|         }
  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.40k|         if (ctx.alias_span_is_replaying(span.begin, span.end)) [[unlikely]] {
  ------------------
  |  Branch (328:14): [True: 26, False: 6.37k]
  ------------------
  329|     26|            ctx.error = error_code::syntax_error; // cyclic alias
  330|     26|            return true;
  331|     26|         }
  332|       |
  333|       |         // Replaying an anchor re-enters the reader directly, bypassing the variant reader's
  334|       |         // depth guard, so this is the only depth accounting a chain of aliases into a
  335|       |         // non-variant target gets. The cycle check above stops the unbounded case; this bounds
  336|       |         // a legitimate but deeply chained one.
  337|  6.37k|         depth_guard guard{ctx, yaml::max_yaml_recursive_depth};
  338|  6.37k|         if (!guard) [[unlikely]]
  ------------------
  |  Branch (338:14): [True: 2, False: 6.37k]
  ------------------
  339|      2|            return true;
  340|       |
  341|  6.37k|         if (!ctx.charge_alias_expansion(static_cast<size_t>(span.end - span.begin))) [[unlikely]] {
  ------------------
  |  Branch (341:14): [True: 0, False: 6.37k]
  ------------------
  342|      0|            ctx.error = error_code::exceeded_max_expansion;
  343|      0|            ctx.custom_error_message = "alias expansion";
  344|      0|            return true;
  345|      0|         }
  346|       |
  347|  6.37k|         auto replay_it = span.begin;
  348|  6.37k|         auto replay_end = span.end;
  349|       |
  350|       |         // Save indent context and set up for replay
  351|  6.37k|         auto saved_indent_stack = std::move(ctx.indent_stack);
  352|  6.37k|         ctx.indent_stack.clear();
  353|  6.37k|         if (span.base_indent > 0) {
  ------------------
  |  Branch (353:14): [True: 3.54k, False: 2.83k]
  ------------------
  354|  3.54k|            ctx.push_indent(span.base_indent - 1);
  355|  3.54k|         }
  356|       |
  357|  6.37k|         ctx.active_alias_spans.emplace_back(span.begin, span.end);
  358|       |
  359|  6.37k|         using V = std::remove_cvref_t<T>;
  360|  6.37k|         from<YAML, V>::template op<Opts>(std::forward<T>(value), ctx, replay_it, replay_end);
  361|       |
  362|  6.37k|         ctx.active_alias_spans.pop_back();
  363|       |
  364|       |         // Restore indent context
  365|  6.37k|         ctx.indent_stack = std::move(saved_indent_stack);
  366|  6.37k|         return true;
  367|  6.37k|      }
_ZN3glz33process_yaml_variant_alternativesINSt3__17variantIJDndNS1_12basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEbNS1_6vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS6_ISD_EEEENSC_ISD_EEEEENS_19is_yaml_variant_numEE2opITnDaXtlNS_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2EEERSH_TkNS_10is_contextERNSL_12yaml_contextERPKcSR_EEvOT0_OT1_OT2_T3_:
 5205|  67.0k|      {
 5206|  67.0k|         constexpr auto category_count = yaml_variant_count_v<Variant, Trait>;
 5207|       |
 5208|       |         if constexpr (category_count == 0) {
 5209|       |            ctx.error = error_code::no_matching_variant_type;
 5210|       |         }
 5211|  67.0k|         else if constexpr (category_count == 1) {
 5212|       |            // Only one type in this category, use it directly
 5213|  67.0k|            constexpr auto first_idx = yaml_variant_first_index_v<Variant, Trait>;
 5214|  67.0k|            using V = std::variant_alternative_t<first_idx, Variant>;
 5215|  67.0k|            if (!std::holds_alternative<V>(value)) value = V{};
  ------------------
  |  Branch (5215:17): [True: 67.0k, False: 0]
  ------------------
 5216|  67.0k|            from<YAML, V>::template op<Opts>(std::get<V>(value), ctx, it, end);
 5217|       |         }
 5218|       |         else {
 5219|       |            // Multiple types in this category, try each one
 5220|       |            constexpr auto N = std::variant_size_v<Variant>;
 5221|       |            bool found_match{};
 5222|       |            size_t match_idx = 0;
 5223|       |            // Only the last alternative propagates its error, so an alternative that exhausted an
 5224|       |            // expansion budget would otherwise be reported as no_matching_variant_type -- a wrong
 5225|       |            // diagnosis for a document that is hostile rather than merely the wrong shape. Held
 5226|       |            // aside and used only if nothing matched, so an alternative that does succeed later
 5227|       |            // (one that materializes no key text can still parse under a latched budget) is
 5228|       |            // unaffected.
 5229|       |            error_code expansion_error{};
 5230|       |            std::string_view expansion_message{};
 5231|       |
 5232|       |            for_each<N>([&]<size_t I>() {
 5233|       |               if (found_match) {
 5234|       |                  return;
 5235|       |               }
 5236|       |               using V = std::variant_alternative_t<I, Variant>;
 5237|       |               if constexpr (Trait<V>::value) {
 5238|       |                  auto copy_it = it;
 5239|       |                  if (!std::holds_alternative<V>(value)) {
 5240|       |                     value = V{};
 5241|       |                  }
 5242|       |
 5243|       |                  auto temp_ctx = ctx.make_speculative();
 5244|       |                  from<YAML, V>::template op<Opts>(std::get<V>(value), temp_ctx, it, end);
 5245|       |
 5246|       |                  // Charged whether or not the alternative fit: a rejected probe still replayed
 5247|       |                  // whatever aliases it reached, and an attempt that is never billed is an
 5248|       |                  // attempt that can be repeated for free.
 5249|       |                  ctx.alias_expansion_budget = temp_ctx.alias_expansion_budget;
 5250|       |                  ctx.key_expansion_budget = temp_ctx.key_expansion_budget;
 5251|       |
 5252|       |                  if (!bool(temp_ctx.error)) {
 5253|       |                     found_match = true;
 5254|       |                     ctx.anchors = std::move(temp_ctx.anchors);
 5255|       |                  }
 5256|       |                  else {
 5257|       |                     it = copy_it;
 5258|       |                     if (temp_ctx.error == error_code::exceeded_max_expansion && expansion_error == error_code::none) {
 5259|       |                        expansion_error = temp_ctx.error;
 5260|       |                        expansion_message = temp_ctx.custom_error_message;
 5261|       |                     }
 5262|       |                     if (match_idx + 1 < category_count) {
 5263|       |                        // Not the last type, continue trying
 5264|       |                     }
 5265|       |                     else {
 5266|       |                        // Last type failed, propagate error
 5267|       |                        ctx.error = temp_ctx.error;
 5268|       |                        ctx.custom_error_message = temp_ctx.custom_error_message;
 5269|       |                     }
 5270|       |                  }
 5271|       |                  ++match_idx;
 5272|       |               }
 5273|       |            });
 5274|       |
 5275|       |            if (!found_match && !bool(ctx.error)) {
 5276|       |               if (expansion_error != error_code::none) {
 5277|       |                  ctx.error = expansion_error;
 5278|       |                  ctx.custom_error_message = expansion_message;
 5279|       |               }
 5280|       |               else {
 5281|       |                  ctx.error = error_code::no_matching_variant_type;
 5282|       |               }
 5283|       |            }
 5284|       |         }
 5285|  67.0k|      }
_ZN3glz4fromILj450EdE2opITnDaXtlNS_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2EEERPKcRdTkNS_10is_contextERNS3_12yaml_contextES6_EEvOT1_OT2_OT0_T3_:
 2047|  71.9k|      {
 2048|  71.9k|         if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2048:14): [True: 0, False: 71.9k]
  ------------------
 2049|      0|            return;
 2050|       |
 2051|  71.9k|         yaml::node_preamble_state preamble{};
 2052|  71.9k|         if (yaml::parse_node_preamble<Opts>(value, ctx, it, end, preamble, [](yaml::yaml_tag tag) {
  ------------------
  |  Branch (2052:14): [True: 9.02k, False: 62.8k]
  ------------------
 2053|  71.9k|                if constexpr (std::floating_point<std::remove_cvref_t<T>>) {
 2054|  71.9k|                   return yaml::tag_valid_for_float(tag);
 2055|  71.9k|                }
 2056|  71.9k|                else {
 2057|  71.9k|                   return yaml::tag_valid_for_int(tag);
 2058|  71.9k|                }
 2059|  71.9k|             }))
 2060|  9.02k|            return;
 2061|       |
 2062|  62.8k|         auto finalize = [&] { yaml::finalize_node_anchor(preamble.node_props, ctx, it); };
 2063|       |
 2064|       |         // Check for special float values
 2065|  62.8k|         if constexpr (std::floating_point<std::remove_cvref_t<T>>) {
 2066|  62.8k|            auto start = it;
 2067|       |
 2068|       |            // Check for .inf, .nan, -.inf, etc.
 2069|  62.8k|            if (*it == '.') {
  ------------------
  |  Branch (2069:17): [True: 15.0k, False: 47.8k]
  ------------------
 2070|  15.0k|               ++it;
 2071|  15.0k|               if (it + 3 <= end && (std::string_view(it, 3) == "inf" || std::string_view(it, 3) == "Inf" ||
  ------------------
  |  Branch (2071:20): [True: 14.2k, False: 847]
  |  Branch (2071:38): [True: 1.02k, False: 13.1k]
  |  Branch (2071:74): [True: 306, False: 12.8k]
  ------------------
 2072|  12.8k|                                     std::string_view(it, 3) == "INF")) {
  ------------------
  |  Branch (2072:38): [True: 672, False: 12.2k]
  ------------------
 2073|  2.00k|                  value = std::numeric_limits<std::remove_cvref_t<T>>::infinity();
 2074|  2.00k|                  it += 3;
 2075|  2.00k|                  finalize();
 2076|  2.00k|                  return;
 2077|  2.00k|               }
 2078|  13.0k|               if (it + 3 <= end && (std::string_view(it, 3) == "nan" || std::string_view(it, 3) == "NaN" ||
  ------------------
  |  Branch (2078:20): [True: 12.2k, False: 847]
  |  Branch (2078:38): [True: 650, False: 11.5k]
  |  Branch (2078:74): [True: 1.14k, False: 10.4k]
  ------------------
 2079|  10.4k|                                     std::string_view(it, 3) == "NAN")) {
  ------------------
  |  Branch (2079:38): [True: 622, False: 9.79k]
  ------------------
 2080|  2.42k|                  value = std::numeric_limits<std::remove_cvref_t<T>>::quiet_NaN();
 2081|  2.42k|                  it += 3;
 2082|  2.42k|                  finalize();
 2083|  2.42k|                  return;
 2084|  2.42k|               }
 2085|  10.6k|               it = start;
 2086|  10.6k|            }
 2087|       |
 2088|  58.4k|            if (*it == '-' || *it == '+') {
  ------------------
  |  Branch (2088:17): [True: 3.13k, False: 55.3k]
  |  Branch (2088:31): [True: 5.87k, False: 49.4k]
  ------------------
 2089|  9.00k|               const char sign = *it;
 2090|  9.00k|               ++it;
 2091|  9.00k|               if (it != end && *it == '.') {
  ------------------
  |  Branch (2091:20): [True: 8.82k, False: 185]
  |  Branch (2091:33): [True: 4.87k, False: 3.94k]
  ------------------
 2092|  4.87k|                  ++it;
 2093|  4.87k|                  if (it + 3 <= end && (std::string_view(it, 3) == "inf" || std::string_view(it, 3) == "Inf" ||
  ------------------
  |  Branch (2093:23): [True: 4.18k, False: 690]
  |  Branch (2093:41): [True: 685, False: 3.50k]
  |  Branch (2093:77): [True: 601, False: 2.90k]
  ------------------
 2094|  2.90k|                                        std::string_view(it, 3) == "INF")) {
  ------------------
  |  Branch (2094:41): [True: 638, False: 2.26k]
  ------------------
 2095|  1.92k|                     if (sign == '-') {
  ------------------
  |  Branch (2095:26): [True: 1.28k, False: 642]
  ------------------
 2096|  1.28k|                        value = -std::numeric_limits<std::remove_cvref_t<T>>::infinity();
 2097|  1.28k|                     }
 2098|    642|                     else {
 2099|    642|                        value = std::numeric_limits<std::remove_cvref_t<T>>::infinity();
 2100|    642|                     }
 2101|  1.92k|                     it += 3;
 2102|  1.92k|                     finalize();
 2103|  1.92k|                     return;
 2104|  1.92k|                  }
 2105|  4.87k|               }
 2106|  7.08k|               it = start;
 2107|  7.08k|            }
 2108|  58.4k|         }
 2109|       |
 2110|       |         // Parse as plain scalar and convert
 2111|  56.5k|         auto start = it;
 2112|       |
 2113|       |         // Find end of number - use same rules as plain scalar for colons
 2114|  23.5M|         while (it != end) {
  ------------------
  |  Branch (2114:17): [True: 23.5M, False: 17.0k]
  ------------------
 2115|  23.5M|            const char c = *it;
 2116|  23.5M|            if (c == ' ' || c == '\t' || c == '\n' || c == '\r' || c == ',' || c == ']' || c == '}' || c == '#') {
  ------------------
  |  Branch (2116:17): [True: 15.7k, False: 23.5M]
  |  Branch (2116:29): [True: 2.25k, False: 23.5M]
  |  Branch (2116:42): [True: 6.64k, False: 23.4M]
  |  Branch (2116:55): [True: 2.66k, False: 23.4M]
  |  Branch (2116:68): [True: 2.36k, False: 23.4M]
  |  Branch (2116:80): [True: 1.28k, False: 23.4M]
  |  Branch (2116:92): [True: 1.93k, False: 23.4M]
  |  Branch (2116:104): [True: 6.17k, False: 23.4M]
  ------------------
 2117|  39.0k|               break;
 2118|  39.0k|            }
 2119|       |            // Colon only ends number if followed by space/tab/newline/end (YAML mapping indicator)
 2120|  23.4M|            if (c == ':') {
  ------------------
  |  Branch (2120:17): [True: 33.1k, False: 23.4M]
  ------------------
 2121|  33.1k|               if ((it + 1) == end || *(it + 1) == ' ' || *(it + 1) == '\t' || *(it + 1) == '\n' || *(it + 1) == '\r') {
  ------------------
  |  Branch (2121:20): [True: 1.00k, False: 32.1k]
  |  Branch (2121:39): [True: 3.75k, False: 28.3k]
  |  Branch (2121:59): [True: 198, False: 28.1k]
  |  Branch (2121:80): [True: 996, False: 27.2k]
  |  Branch (2121:101): [True: 757, False: 26.4k]
  ------------------
 2122|  6.71k|                  break;
 2123|  6.71k|               }
 2124|  33.1k|            }
 2125|  23.4M|            ++it;
 2126|  23.4M|         }
 2127|       |
 2128|  62.8k|         const std::string_view num_str(&*start, static_cast<size_t>(it - start));
 2129|       |
 2130|  62.8k|         if (num_str.empty()) {
  ------------------
  |  Branch (2130:14): [True: 2.31k, False: 60.5k]
  ------------------
 2131|  2.31k|            ctx.error = error_code::parse_number_failure;
 2132|  2.31k|            return;
 2133|  2.31k|         }
 2134|       |
 2135|       |         // Handle hex, octal, binary
 2136|       |         if constexpr (std::integral<std::remove_cvref_t<T>>) {
 2137|       |            if (num_str.size() > 2 && num_str[0] == '0') {
 2138|       |               int base = 10;
 2139|       |               size_t offset = 0;
 2140|       |
 2141|       |               if (num_str[1] == 'x' || num_str[1] == 'X') {
 2142|       |                  base = 16;
 2143|       |                  offset = 2;
 2144|       |               }
 2145|       |               else if (num_str[1] == 'o' || num_str[1] == 'O') {
 2146|       |                  base = 8;
 2147|       |                  offset = 2;
 2148|       |               }
 2149|       |               else if (num_str[1] == 'b' || num_str[1] == 'B') {
 2150|       |                  base = 2;
 2151|       |                  offset = 2;
 2152|       |               }
 2153|       |
 2154|       |               if (base != 10) {
 2155|       |                  const auto digits = num_str.substr(offset);
 2156|       |                  const bool has_underscores = (digits.find('_') != std::string_view::npos);
 2157|       |
 2158|       |                  std::string clean_storage;
 2159|       |                  std::string_view clean_view;
 2160|       |
 2161|       |                  if (has_underscores) {
 2162|       |                     clean_storage.reserve(digits.size());
 2163|       |                     for (char c : digits) {
 2164|       |                        if (c != '_') {
 2165|       |                           clean_storage.push_back(c);
 2166|       |                        }
 2167|       |                     }
 2168|       |                     clean_view = clean_storage;
 2169|       |                  }
 2170|       |                  else {
 2171|       |                     clean_view = digits;
 2172|       |                  }
 2173|       |
 2174|       |                  auto [ptr, ec] =
 2175|       |                     std::from_chars(clean_view.data(), clean_view.data() + clean_view.size(), value, base);
 2176|       |                  if (ec != std::errc{}) {
 2177|       |                     ctx.error = error_code::parse_number_failure;
 2178|       |                  }
 2179|       |                  finalize();
 2180|       |                  return;
 2181|       |               }
 2182|       |            }
 2183|       |         }
 2184|  60.5k|         else if constexpr (std::floating_point<std::remove_cvref_t<T>>) {
 2185|  60.5k|            bool negative = false;
 2186|  60.5k|            std::string_view digits = num_str;
 2187|       |
 2188|  60.5k|            if (!digits.empty() && (digits.front() == '+' || digits.front() == '-')) {
  ------------------
  |  Branch (2188:17): [True: 54.2k, False: 6.35k]
  |  Branch (2188:37): [True: 5.23k, False: 48.9k]
  |  Branch (2188:62): [True: 1.84k, False: 47.1k]
  ------------------
 2189|  7.08k|               negative = (digits.front() == '-');
 2190|  7.08k|               digits.remove_prefix(1);
 2191|  7.08k|            }
 2192|       |
 2193|  60.5k|            if (digits.size() > 2 && digits[0] == '0') {
  ------------------
  |  Branch (2193:17): [True: 35.3k, False: 25.1k]
  |  Branch (2193:38): [True: 14.4k, False: 20.9k]
  ------------------
 2194|  14.4k|               int base = 10;
 2195|  14.4k|               size_t offset = 0;
 2196|       |
 2197|  14.4k|               if (digits[1] == 'x' || digits[1] == 'X') {
  ------------------
  |  Branch (2197:20): [True: 4.93k, False: 9.46k]
  |  Branch (2197:40): [True: 2.47k, False: 6.99k]
  ------------------
 2198|  7.40k|                  base = 16;
 2199|  7.40k|                  offset = 2;
 2200|  7.40k|               }
 2201|  6.99k|               else if (digits[1] == 'o' || digits[1] == 'O') {
  ------------------
  |  Branch (2201:25): [True: 164, False: 6.83k]
  |  Branch (2201:45): [True: 909, False: 5.92k]
  ------------------
 2202|  1.07k|                  base = 8;
 2203|  1.07k|                  offset = 2;
 2204|  1.07k|               }
 2205|  5.92k|               else if (digits[1] == 'b' || digits[1] == 'B') {
  ------------------
  |  Branch (2205:25): [True: 321, False: 5.60k]
  |  Branch (2205:45): [True: 600, False: 5.00k]
  ------------------
 2206|    921|                  base = 2;
 2207|    921|                  offset = 2;
 2208|    921|               }
 2209|       |
 2210|  14.4k|               if (base != 10) {
  ------------------
  |  Branch (2210:20): [True: 9.40k, False: 5.00k]
  ------------------
 2211|  9.40k|                  auto raw_digits = digits.substr(offset);
 2212|  9.40k|                  const bool has_underscores = (raw_digits.find('_') != std::string_view::npos);
 2213|       |
 2214|  9.40k|                  std::string clean_storage;
 2215|  9.40k|                  std::string_view clean_view;
 2216|  9.40k|                  if (has_underscores) {
  ------------------
  |  Branch (2216:23): [True: 4.22k, False: 5.18k]
  ------------------
 2217|  4.22k|                     clean_storage.reserve(raw_digits.size());
 2218|  4.66M|                     for (char c : raw_digits) {
  ------------------
  |  Branch (2218:34): [True: 4.66M, False: 4.22k]
  ------------------
 2219|  4.66M|                        if (c != '_') {
  ------------------
  |  Branch (2219:29): [True: 4.65M, False: 7.19k]
  ------------------
 2220|  4.65M|                           clean_storage.push_back(c);
 2221|  4.65M|                        }
 2222|  4.66M|                     }
 2223|  4.22k|                     clean_view = clean_storage;
 2224|  4.22k|                  }
 2225|  5.18k|                  else {
 2226|  5.18k|                     clean_view = raw_digits;
 2227|  5.18k|                  }
 2228|       |
 2229|  9.40k|                  uint64_t parsed_int{};
 2230|  9.40k|                  auto [ptr, ec] =
 2231|  9.40k|                     std::from_chars(clean_view.data(), clean_view.data() + clean_view.size(), parsed_int, base);
 2232|  9.40k|                  if (ec != std::errc{} || ptr != (clean_view.data() + clean_view.size())) {
  ------------------
  |  Branch (2232:23): [True: 4.65k, False: 4.75k]
  |  Branch (2232:44): [True: 2.73k, False: 2.01k]
  ------------------
 2233|  7.38k|                     ctx.error = error_code::parse_number_failure;
 2234|  7.38k|                     finalize();
 2235|  7.38k|                     return;
 2236|  7.38k|                  }
 2237|       |
 2238|  2.01k|                  const auto as_float = static_cast<std::remove_cvref_t<T>>(parsed_int);
 2239|  2.01k|                  value = negative ? -as_float : as_float;
  ------------------
  |  Branch (2239:27): [True: 1.05k, False: 960]
  ------------------
 2240|  2.01k|                  finalize();
 2241|  2.01k|                  return;
 2242|  9.40k|               }
 2243|  14.4k|            }
 2244|  60.5k|         }
 2245|       |
 2246|       |         // Standard number parsing - only allocate if underscores present
 2247|  51.1k|         const bool has_underscores = (num_str.find('_') != std::string_view::npos);
 2248|       |
 2249|  60.5k|         std::string clean_storage;
 2250|  60.5k|         std::string_view clean_view;
 2251|       |
 2252|  60.5k|         if (has_underscores) {
  ------------------
  |  Branch (2252:14): [True: 3.19k, False: 57.3k]
  ------------------
 2253|  3.19k|            clean_storage.reserve(num_str.size());
 2254|  3.53M|            for (char c : num_str) {
  ------------------
  |  Branch (2254:25): [True: 3.53M, False: 3.19k]
  ------------------
 2255|  3.53M|               if (c != '_') {
  ------------------
  |  Branch (2255:20): [True: 3.53M, False: 5.83k]
  ------------------
 2256|  3.53M|                  clean_storage.push_back(c);
 2257|  3.53M|               }
 2258|  3.53M|            }
 2259|  3.19k|            clean_view = clean_storage;
 2260|  3.19k|         }
 2261|  57.3k|         else {
 2262|  57.3k|            clean_view = num_str;
 2263|  57.3k|         }
 2264|       |
 2265|       |         // YAML allows leading '+' for positive numbers, but C++ from_chars doesn't
 2266|       |         // Strip leading '+' if present
 2267|  60.5k|         auto parse_view = clean_view;
 2268|  60.5k|         if (!parse_view.empty() && parse_view.front() == '+') {
  ------------------
  |  Branch (2268:14): [True: 44.6k, False: 15.9k]
  |  Branch (2268:37): [True: 5.20k, False: 39.4k]
  ------------------
 2269|  5.20k|            parse_view.remove_prefix(1);
 2270|  5.20k|            if (parse_view.empty()) {
  ------------------
  |  Branch (2270:17): [True: 1.02k, False: 4.18k]
  ------------------
 2271|  1.02k|               ctx.error = error_code::parse_number_failure;
 2272|  1.02k|               return;
 2273|  1.02k|            }
 2274|  5.20k|         }
 2275|       |
 2276|  59.5k|         if constexpr (std::floating_point<std::remove_cvref_t<T>>) {
 2277|  59.5k|            auto result = glz::fast_float::from_chars(parse_view.data(), parse_view.data() + parse_view.size(), value);
 2278|       |            // Check both for errors and that all input was consumed (e.g., "12:30" is not a valid number)
 2279|  59.5k|            if (result.ec != std::errc{} || result.ptr != parse_view.data() + parse_view.size()) {
  ------------------
  |  Branch (2279:17): [True: 30.2k, False: 29.2k]
  |  Branch (2279:45): [True: 17.2k, False: 12.0k]
  ------------------
 2280|  31.6k|               ctx.error = error_code::parse_number_failure;
 2281|  31.6k|            }
 2282|       |         }
 2283|       |         else {
 2284|       |            auto [ptr, ec] = std::from_chars(parse_view.data(), parse_view.data() + parse_view.size(), value);
 2285|       |            // Check both for errors and that all input was consumed
 2286|       |            if (ec != std::errc{} || ptr != parse_view.data() + parse_view.size()) {
 2287|       |               ctx.error = error_code::parse_number_failure;
 2288|       |            }
 2289|       |         }
 2290|       |
 2291|  59.5k|         finalize();
 2292|  59.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|  71.9k|      {
  466|  71.9k|         skip_inline_ws(it, end);
  467|       |
  468|  71.9k|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (468:14): [True: 366, False: 71.5k]
  ------------------
  469|    366|            if constexpr (!AllowEmptyInput) {
  470|    366|               ctx.error = error_code::unexpected_end;
  471|    366|            }
  472|    366|            return true;
  473|    366|         }
  474|       |
  475|  71.5k|         preamble.tag = parse_yaml_tag(it, end, ctx);
  476|  71.5k|         if (preamble.tag == yaml_tag::unknown) [[unlikely]] {
  ------------------
  |  Branch (476:14): [True: 610, False: 70.9k]
  ------------------
  477|    610|            ctx.error = error_code::syntax_error;
  478|    610|            return true;
  479|    610|         }
  480|  70.9k|         if (!tag_validator(preamble.tag)) [[unlikely]] {
  ------------------
  |  Branch (480:14): [True: 187, False: 70.7k]
  ------------------
  481|    187|            ctx.error = error_code::syntax_error;
  482|    187|            return true;
  483|    187|         }
  484|       |
  485|  70.7k|         skip_inline_ws(it, end);
  486|       |
  487|  70.7k|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (487:14): [True: 207, False: 70.5k]
  ------------------
  488|    207|            if constexpr (!AllowEmptyInput) {
  489|    207|               ctx.error = error_code::unexpected_end;
  490|    207|            }
  491|    207|            return true;
  492|    207|         }
  493|       |
  494|  70.5k|         if (parse_node_properties<Opts, PropertyPolicy>(std::forward<T>(value), ctx, it, end, preamble.node_props)) {
  ------------------
  |  Branch (494:14): [True: 7.65k, False: 62.8k]
  ------------------
  495|  7.65k|            return true;
  496|  7.65k|         }
  497|       |
  498|  62.8k|         return false;
  499|  70.5k|      }
_ZZN3glz4fromILj450EdE2opITnDaXtlNS_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2EEERPKcRdTkNS_10is_contextERNS3_12yaml_contextES6_EEvOT1_OT2_OT0_T3_ENKUlNS3_8yaml_tagEE_clESI_:
 2052|  70.9k|         if (yaml::parse_node_preamble<Opts>(value, ctx, it, end, preamble, [](yaml::yaml_tag tag) {
 2053|  70.9k|                if constexpr (std::floating_point<std::remove_cvref_t<T>>) {
 2054|  70.9k|                   return yaml::tag_valid_for_float(tag);
 2055|       |                }
 2056|       |                else {
 2057|       |                   return yaml::tag_valid_for_int(tag);
 2058|       |                }
 2059|  70.9k|             }))
_ZN3glz4yaml21parse_node_propertiesITnDaXtlNS0_9yaml_optsELj450ELb1ELb0ELb1ELh2EEEXtlNS0_20node_property_policyELb1EEERdNS0_12yaml_contextEPKcS7_EEbOT1_RT2_RT3_T4_RNS0_19node_property_stateE:
  408|  70.5k|      {
  409|  70.5k|         state.has_anchor = false;
  410|  70.5k|         state.anchor_name.clear();
  411|  70.5k|         state.anchor_start = nullptr;
  412|  70.5k|         state.anchor_indent = ctx.current_indent();
  413|       |
  414|  70.5k|         if constexpr (Policy.allow_alias) {
  415|       |            if constexpr (Policy.alias_can_be_mapping_key) {
  416|       |               if (!alias_token_is_mapping_key(it, end)) {
  417|       |                  if (handle_alias<Opts>(std::forward<T>(value), ctx, it, end)) return true;
  418|       |               }
  419|       |            }
  420|  70.5k|            else {
  421|  70.5k|               if (handle_alias<Opts>(std::forward<T>(value), ctx, it, end)) return true;
  ------------------
  |  Branch (421:20): [True: 6.79k, False: 63.7k]
  ------------------
  422|  70.5k|            }
  423|  70.5k|         }
  424|       |
  425|  70.5k|         if (it != end && *it == '&') {
  ------------------
  |  Branch (425:14): [True: 63.7k, False: 6.79k]
  |  Branch (425:27): [True: 5.92k, False: 57.8k]
  ------------------
  426|  5.92k|            ++it;
  427|  5.92k|            auto name = parse_anchor_name(it, end);
  428|  5.92k|            if (name.empty()) {
  ------------------
  |  Branch (428:17): [True: 415, False: 5.51k]
  ------------------
  429|    415|               ctx.error = error_code::syntax_error;
  430|    415|               return true;
  431|    415|            }
  432|  5.51k|            skip_inline_ws(it, end);
  433|  5.51k|            if (it == end) {
  ------------------
  |  Branch (433:17): [True: 446, False: 5.06k]
  ------------------
  434|    446|               if constexpr (!Policy.allow_empty_after_anchor) {
  435|    446|                  ctx.error = error_code::unexpected_end;
  436|    446|               }
  437|    446|               return true;
  438|    446|            }
  439|       |            if constexpr (Policy.disallow_anchor_on_alias) {
  440|       |               if (*it == '*') {
  441|       |                  ctx.error = error_code::syntax_error;
  442|       |                  return true;
  443|       |               }
  444|       |            }
  445|  5.06k|            state.has_anchor = true;
  446|  5.06k|            state.anchor_name = std::string(name);
  447|  5.06k|            state.anchor_start = &*it;
  448|  5.06k|         }
  449|       |
  450|  69.6k|         return false;
  451|  70.5k|      }
_ZN3glz4yaml12handle_aliasITnDaXtlNS0_9yaml_optsELj450ELb1ELb0ELb1ELh2EEERdNS0_12yaml_contextEPKcS6_EEbOT0_RT1_RT2_T3_:
  300|  70.5k|      {
  301|  70.5k|         if (it == end || *it != '*') return false;
  ------------------
  |  Branch (301:14): [True: 0, False: 70.5k]
  |  Branch (301:27): [True: 63.7k, False: 6.79k]
  ------------------
  302|       |
  303|  6.79k|         ++it; // skip '*'
  304|  6.79k|         auto name = parse_anchor_name(it, end);
  305|  6.79k|         if (name.empty()) {
  ------------------
  |  Branch (305:14): [True: 451, False: 6.34k]
  ------------------
  306|    451|            ctx.error = error_code::syntax_error;
  307|    451|            return true;
  308|    451|         }
  309|       |
  310|  6.34k|         auto anchor_it = ctx.anchors.find(name);
  311|  6.34k|         if (anchor_it == ctx.anchors.end()) {
  ------------------
  |  Branch (311:14): [True: 1.13k, False: 5.20k]
  ------------------
  312|  1.13k|            ctx.error = error_code::syntax_error; // undefined alias
  313|  1.13k|            return true;
  314|  1.13k|         }
  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.20k|         const auto span = anchor_it->second;
  319|       |
  320|       |         // Empty anchor span (anchor on null/empty node) — leave value as default
  321|  5.20k|         if (span.begin == span.end) {
  ------------------
  |  Branch (321:14): [True: 146, False: 5.06k]
  ------------------
  322|    146|            return true;
  323|    146|         }
  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.06k|         if (ctx.alias_span_is_replaying(span.begin, span.end)) [[unlikely]] {
  ------------------
  |  Branch (328:14): [True: 176, False: 4.88k]
  ------------------
  329|    176|            ctx.error = error_code::syntax_error; // cyclic alias
  330|    176|            return true;
  331|    176|         }
  332|       |
  333|       |         // Replaying an anchor re-enters the reader directly, bypassing the variant reader's
  334|       |         // depth guard, so this is the only depth accounting a chain of aliases into a
  335|       |         // non-variant target gets. The cycle check above stops the unbounded case; this bounds
  336|       |         // a legitimate but deeply chained one.
  337|  4.88k|         depth_guard guard{ctx, yaml::max_yaml_recursive_depth};
  338|  4.88k|         if (!guard) [[unlikely]]
  ------------------
  |  Branch (338:14): [True: 2, False: 4.88k]
  ------------------
  339|      2|            return true;
  340|       |
  341|  4.88k|         if (!ctx.charge_alias_expansion(static_cast<size_t>(span.end - span.begin))) [[unlikely]] {
  ------------------
  |  Branch (341:14): [True: 0, False: 4.88k]
  ------------------
  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.88k|         auto replay_it = span.begin;
  348|  4.88k|         auto replay_end = span.end;
  349|       |
  350|       |         // Save indent context and set up for replay
  351|  4.88k|         auto saved_indent_stack = std::move(ctx.indent_stack);
  352|  4.88k|         ctx.indent_stack.clear();
  353|  4.88k|         if (span.base_indent > 0) {
  ------------------
  |  Branch (353:14): [True: 4.44k, False: 435]
  ------------------
  354|  4.44k|            ctx.push_indent(span.base_indent - 1);
  355|  4.44k|         }
  356|       |
  357|  4.88k|         ctx.active_alias_spans.emplace_back(span.begin, span.end);
  358|       |
  359|  4.88k|         using V = std::remove_cvref_t<T>;
  360|  4.88k|         from<YAML, V>::template op<Opts>(std::forward<T>(value), ctx, replay_it, replay_end);
  361|       |
  362|  4.88k|         ctx.active_alias_spans.pop_back();
  363|       |
  364|       |         // Restore indent context
  365|  4.88k|         ctx.indent_stack = std::move(saved_indent_stack);
  366|  4.88k|         return true;
  367|  4.88k|      }
_ZZN3glz4fromILj450EdE2opITnDaXtlNS_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2EEERPKcRdTkNS_10is_contextERNS3_12yaml_contextES6_EEvOT1_OT2_OT0_T3_ENKUlvE_clEv:
 2062|  59.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_:
 5205|  21.6k|      {
 5206|  21.6k|         constexpr auto category_count = yaml_variant_count_v<Variant, Trait>;
 5207|       |
 5208|       |         if constexpr (category_count == 0) {
 5209|       |            ctx.error = error_code::no_matching_variant_type;
 5210|       |         }
 5211|  21.6k|         else if constexpr (category_count == 1) {
 5212|       |            // Only one type in this category, use it directly
 5213|  21.6k|            constexpr auto first_idx = yaml_variant_first_index_v<Variant, Trait>;
 5214|  21.6k|            using V = std::variant_alternative_t<first_idx, Variant>;
 5215|  21.6k|            if (!std::holds_alternative<V>(value)) value = V{};
  ------------------
  |  Branch (5215:17): [True: 21.6k, False: 0]
  ------------------
 5216|  21.6k|            from<YAML, V>::template op<Opts>(std::get<V>(value), ctx, it, end);
 5217|       |         }
 5218|       |         else {
 5219|       |            // Multiple types in this category, try each one
 5220|       |            constexpr auto N = std::variant_size_v<Variant>;
 5221|       |            bool found_match{};
 5222|       |            size_t match_idx = 0;
 5223|       |            // Only the last alternative propagates its error, so an alternative that exhausted an
 5224|       |            // expansion budget would otherwise be reported as no_matching_variant_type -- a wrong
 5225|       |            // diagnosis for a document that is hostile rather than merely the wrong shape. Held
 5226|       |            // aside and used only if nothing matched, so an alternative that does succeed later
 5227|       |            // (one that materializes no key text can still parse under a latched budget) is
 5228|       |            // unaffected.
 5229|       |            error_code expansion_error{};
 5230|       |            std::string_view expansion_message{};
 5231|       |
 5232|       |            for_each<N>([&]<size_t I>() {
 5233|       |               if (found_match) {
 5234|       |                  return;
 5235|       |               }
 5236|       |               using V = std::variant_alternative_t<I, Variant>;
 5237|       |               if constexpr (Trait<V>::value) {
 5238|       |                  auto copy_it = it;
 5239|       |                  if (!std::holds_alternative<V>(value)) {
 5240|       |                     value = V{};
 5241|       |                  }
 5242|       |
 5243|       |                  auto temp_ctx = ctx.make_speculative();
 5244|       |                  from<YAML, V>::template op<Opts>(std::get<V>(value), temp_ctx, it, end);
 5245|       |
 5246|       |                  // Charged whether or not the alternative fit: a rejected probe still replayed
 5247|       |                  // whatever aliases it reached, and an attempt that is never billed is an
 5248|       |                  // attempt that can be repeated for free.
 5249|       |                  ctx.alias_expansion_budget = temp_ctx.alias_expansion_budget;
 5250|       |                  ctx.key_expansion_budget = temp_ctx.key_expansion_budget;
 5251|       |
 5252|       |                  if (!bool(temp_ctx.error)) {
 5253|       |                     found_match = true;
 5254|       |                     ctx.anchors = std::move(temp_ctx.anchors);
 5255|       |                  }
 5256|       |                  else {
 5257|       |                     it = copy_it;
 5258|       |                     if (temp_ctx.error == error_code::exceeded_max_expansion && expansion_error == error_code::none) {
 5259|       |                        expansion_error = temp_ctx.error;
 5260|       |                        expansion_message = temp_ctx.custom_error_message;
 5261|       |                     }
 5262|       |                     if (match_idx + 1 < category_count) {
 5263|       |                        // Not the last type, continue trying
 5264|       |                     }
 5265|       |                     else {
 5266|       |                        // Last type failed, propagate error
 5267|       |                        ctx.error = temp_ctx.error;
 5268|       |                        ctx.custom_error_message = temp_ctx.custom_error_message;
 5269|       |                     }
 5270|       |                  }
 5271|       |                  ++match_idx;
 5272|       |               }
 5273|       |            });
 5274|       |
 5275|       |            if (!found_match && !bool(ctx.error)) {
 5276|       |               if (expansion_error != error_code::none) {
 5277|       |                  ctx.error = expansion_error;
 5278|       |                  ctx.custom_error_message = expansion_message;
 5279|       |               }
 5280|       |               else {
 5281|       |                  ctx.error = error_code::no_matching_variant_type;
 5282|       |               }
 5283|       |            }
 5284|       |         }
 5285|  21.6k|      }
_ZN3glz4fromILj450EbE2opITnDaXtlNS_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2EEERPKcRbTkNS_10is_contextERNS3_12yaml_contextES6_EEvOT1_OT2_OT0_T3_:
 2012|  22.4k|      {
 2013|  22.4k|         if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2013:14): [True: 0, False: 22.4k]
  ------------------
 2014|      0|            return;
 2015|       |
 2016|  22.4k|         yaml::node_preamble_state preamble{};
 2017|  22.4k|         if (yaml::parse_node_preamble<Opts>(value, ctx, it, end, preamble,
  ------------------
  |  Branch (2017:14): [True: 2.09k, False: 20.3k]
  ------------------
 2018|  22.4k|                                             [](yaml::yaml_tag tag) { return yaml::tag_valid_for_bool(tag); }))
 2019|  2.09k|            return;
 2020|       |
 2021|       |         // Parse as plain scalar first
 2022|  20.3k|         std::string str;
 2023|  20.3k|         yaml::parse_plain_scalar(str, ctx, it, end, yaml::check_flow_context(Opts));
 2024|       |
 2025|  20.3k|         if (str == "true" || str == "True" || str == "TRUE" || str == "yes" || str == "Yes" || str == "YES" ||
  ------------------
  |  Branch (2025:14): [True: 3.86k, False: 16.4k]
  |  Branch (2025:31): [True: 3.76k, False: 12.7k]
  |  Branch (2025:48): [True: 659, False: 12.0k]
  |  Branch (2025:65): [True: 500, False: 11.5k]
  |  Branch (2025:81): [True: 278, False: 11.2k]
  |  Branch (2025:97): [True: 3, False: 11.2k]
  ------------------
 2026|  11.2k|             str == "on" || str == "On" || str == "ON") {
  ------------------
  |  Branch (2026:14): [True: 900, False: 10.3k]
  |  Branch (2026:29): [True: 522, False: 9.86k]
  |  Branch (2026:44): [True: 784, False: 9.07k]
  ------------------
 2027|  11.2k|            value = true;
 2028|  11.2k|         }
 2029|  9.07k|         else if (str == "false" || str == "False" || str == "FALSE" || str == "no" || str == "No" || str == "NO" ||
  ------------------
  |  Branch (2029:19): [True: 1.33k, False: 7.74k]
  |  Branch (2029:37): [True: 322, False: 7.41k]
  |  Branch (2029:55): [True: 1.69k, False: 5.72k]
  |  Branch (2029:73): [True: 4.14k, False: 1.57k]
  |  Branch (2029:88): [True: 556, False: 1.02k]
  |  Branch (2029:103): [True: 301, False: 721]
  ------------------
 2030|  8.69k|                  str == "off" || str == "Off" || str == "OFF") {
  ------------------
  |  Branch (2030:19): [True: 187, False: 534]
  |  Branch (2030:35): [True: 75, False: 459]
  |  Branch (2030:51): [True: 80, False: 379]
  ------------------
 2031|  8.69k|            value = false;
 2032|  8.69k|         }
 2033|    379|         else {
 2034|    379|            ctx.error = error_code::expected_true_or_false;
 2035|    379|         }
 2036|       |
 2037|  20.3k|         yaml::finalize_node_anchor(preamble.node_props, ctx, it);
 2038|  20.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|  22.4k|      {
  466|  22.4k|         skip_inline_ws(it, end);
  467|       |
  468|  22.4k|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (468:14): [True: 3, False: 22.4k]
  ------------------
  469|      3|            if constexpr (!AllowEmptyInput) {
  470|      3|               ctx.error = error_code::unexpected_end;
  471|      3|            }
  472|      3|            return true;
  473|      3|         }
  474|       |
  475|  22.4k|         preamble.tag = parse_yaml_tag(it, end, ctx);
  476|  22.4k|         if (preamble.tag == yaml_tag::unknown) [[unlikely]] {
  ------------------
  |  Branch (476:14): [True: 3, False: 22.4k]
  ------------------
  477|      3|            ctx.error = error_code::syntax_error;
  478|      3|            return true;
  479|      3|         }
  480|  22.4k|         if (!tag_validator(preamble.tag)) [[unlikely]] {
  ------------------
  |  Branch (480:14): [True: 3, False: 22.4k]
  ------------------
  481|      3|            ctx.error = error_code::syntax_error;
  482|      3|            return true;
  483|      3|         }
  484|       |
  485|  22.4k|         skip_inline_ws(it, end);
  486|       |
  487|  22.4k|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (487:14): [True: 4, False: 22.4k]
  ------------------
  488|      4|            if constexpr (!AllowEmptyInput) {
  489|      4|               ctx.error = error_code::unexpected_end;
  490|      4|            }
  491|      4|            return true;
  492|      4|         }
  493|       |
  494|  22.4k|         if (parse_node_properties<Opts, PropertyPolicy>(std::forward<T>(value), ctx, it, end, preamble.node_props)) {
  ------------------
  |  Branch (494:14): [True: 2.07k, False: 20.3k]
  ------------------
  495|  2.07k|            return true;
  496|  2.07k|         }
  497|       |
  498|  20.3k|         return false;
  499|  22.4k|      }
_ZZN3glz4fromILj450EbE2opITnDaXtlNS_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2EEERPKcRbTkNS_10is_contextERNS3_12yaml_contextES6_EEvOT1_OT2_OT0_T3_ENKUlNS3_8yaml_tagEE_clESI_:
 2018|  22.4k|                                             [](yaml::yaml_tag tag) { return yaml::tag_valid_for_bool(tag); }))
_ZN3glz4yaml21parse_node_propertiesITnDaXtlNS0_9yaml_optsELj450ELb1ELb0ELb1ELh2EEEXtlNS0_20node_property_policyELb1EEERbNS0_12yaml_contextEPKcS7_EEbOT1_RT2_RT3_T4_RNS0_19node_property_stateE:
  408|  22.4k|      {
  409|  22.4k|         state.has_anchor = false;
  410|  22.4k|         state.anchor_name.clear();
  411|  22.4k|         state.anchor_start = nullptr;
  412|  22.4k|         state.anchor_indent = ctx.current_indent();
  413|       |
  414|  22.4k|         if constexpr (Policy.allow_alias) {
  415|       |            if constexpr (Policy.alias_can_be_mapping_key) {
  416|       |               if (!alias_token_is_mapping_key(it, end)) {
  417|       |                  if (handle_alias<Opts>(std::forward<T>(value), ctx, it, end)) return true;
  418|       |               }
  419|       |            }
  420|  22.4k|            else {
  421|  22.4k|               if (handle_alias<Opts>(std::forward<T>(value), ctx, it, end)) return true;
  ------------------
  |  Branch (421:20): [True: 2.04k, False: 20.3k]
  ------------------
  422|  22.4k|            }
  423|  22.4k|         }
  424|       |
  425|  22.4k|         if (it != end && *it == '&') {
  ------------------
  |  Branch (425:14): [True: 20.3k, False: 2.04k]
  |  Branch (425:27): [True: 5.08k, False: 15.2k]
  ------------------
  426|  5.08k|            ++it;
  427|  5.08k|            auto name = parse_anchor_name(it, end);
  428|  5.08k|            if (name.empty()) {
  ------------------
  |  Branch (428:17): [True: 8, False: 5.07k]
  ------------------
  429|      8|               ctx.error = error_code::syntax_error;
  430|      8|               return true;
  431|      8|            }
  432|  5.07k|            skip_inline_ws(it, end);
  433|  5.07k|            if (it == end) {
  ------------------
  |  Branch (433:17): [True: 23, False: 5.05k]
  ------------------
  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|  5.05k|            state.has_anchor = true;
  446|  5.05k|            state.anchor_name = std::string(name);
  447|  5.05k|            state.anchor_start = &*it;
  448|  5.05k|         }
  449|       |
  450|  22.3k|         return false;
  451|  22.4k|      }
_ZN3glz4yaml12handle_aliasITnDaXtlNS0_9yaml_optsELj450ELb1ELb0ELb1ELh2EEERbNS0_12yaml_contextEPKcS6_EEbOT0_RT1_RT2_T3_:
  300|  22.4k|      {
  301|  22.4k|         if (it == end || *it != '*') return false;
  ------------------
  |  Branch (301:14): [True: 0, False: 22.4k]
  |  Branch (301:27): [True: 20.3k, False: 2.04k]
  ------------------
  302|       |
  303|  2.04k|         ++it; // skip '*'
  304|  2.04k|         auto name = parse_anchor_name(it, end);
  305|  2.04k|         if (name.empty()) {
  ------------------
  |  Branch (305:14): [True: 6, False: 2.04k]
  ------------------
  306|      6|            ctx.error = error_code::syntax_error;
  307|      6|            return true;
  308|      6|         }
  309|       |
  310|  2.04k|         auto anchor_it = ctx.anchors.find(name);
  311|  2.04k|         if (anchor_it == ctx.anchors.end()) {
  ------------------
  |  Branch (311:14): [True: 53, False: 1.98k]
  ------------------
  312|     53|            ctx.error = error_code::syntax_error; // undefined alias
  313|     53|            return true;
  314|     53|         }
  315|       |
  316|       |         // Copied rather than referenced: the replay below can replace ctx.anchors wholesale
  317|       |         // (a speculative parse hands its own map back), which would dangle a reference here.
  318|  1.98k|         const auto span = anchor_it->second;
  319|       |
  320|       |         // Empty anchor span (anchor on null/empty node) — leave value as default
  321|  1.98k|         if (span.begin == span.end) {
  ------------------
  |  Branch (321:14): [True: 1.17k, False: 812]
  ------------------
  322|  1.17k|            return true;
  323|  1.17k|         }
  324|       |
  325|       |         // An anchor is invisible to itself while it expands. A span that aliases the name it
  326|       |         // defines -- reachable because a mapping key's anchor is registered over the key text
  327|       |         // before that text is parsed -- would otherwise replay itself forever.
  328|    812|         if (ctx.alias_span_is_replaying(span.begin, span.end)) [[unlikely]] {
  ------------------
  |  Branch (328:14): [True: 9, False: 803]
  ------------------
  329|      9|            ctx.error = error_code::syntax_error; // cyclic alias
  330|      9|            return true;
  331|      9|         }
  332|       |
  333|       |         // Replaying an anchor re-enters the reader directly, bypassing the variant reader's
  334|       |         // depth guard, so this is the only depth accounting a chain of aliases into a
  335|       |         // non-variant target gets. The cycle check above stops the unbounded case; this bounds
  336|       |         // a legitimate but deeply chained one.
  337|    803|         depth_guard guard{ctx, yaml::max_yaml_recursive_depth};
  338|    803|         if (!guard) [[unlikely]]
  ------------------
  |  Branch (338:14): [True: 2, False: 801]
  ------------------
  339|      2|            return true;
  340|       |
  341|    801|         if (!ctx.charge_alias_expansion(static_cast<size_t>(span.end - span.begin))) [[unlikely]] {
  ------------------
  |  Branch (341:14): [True: 0, False: 801]
  ------------------
  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|    801|         auto replay_it = span.begin;
  348|    801|         auto replay_end = span.end;
  349|       |
  350|       |         // Save indent context and set up for replay
  351|    801|         auto saved_indent_stack = std::move(ctx.indent_stack);
  352|    801|         ctx.indent_stack.clear();
  353|    801|         if (span.base_indent > 0) {
  ------------------
  |  Branch (353:14): [True: 750, False: 51]
  ------------------
  354|    750|            ctx.push_indent(span.base_indent - 1);
  355|    750|         }
  356|       |
  357|    801|         ctx.active_alias_spans.emplace_back(span.begin, span.end);
  358|       |
  359|    801|         using V = std::remove_cvref_t<T>;
  360|    801|         from<YAML, V>::template op<Opts>(std::forward<T>(value), ctx, replay_it, replay_end);
  361|       |
  362|    801|         ctx.active_alias_spans.pop_back();
  363|       |
  364|       |         // Restore indent context
  365|    801|         ctx.indent_stack = std::move(saved_indent_stack);
  366|    801|         return true;
  367|    801|      }
_ZN3glz4fromILj450EDnE2opITnDaXtlNS_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2EEERPKcRDnTkNS_10is_contextERNS3_12yaml_contextES6_EEvOT1_OT2_OT0_T3_:
 2398|  7.26k|      {
 2399|  7.26k|         if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2399:14): [True: 0, False: 7.26k]
  ------------------
 2400|      0|            return;
 2401|       |
 2402|  7.26k|         yaml::skip_inline_ws(it, end);
 2403|       |
 2404|  7.26k|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (2404:14): [True: 20, False: 7.24k]
  ------------------
 2405|     20|            ctx.error = error_code::unexpected_end;
 2406|     20|            return;
 2407|     20|         }
 2408|       |
 2409|       |         // Check for null values: null, Null, NULL, ~
 2410|  7.24k|         if (*it == '~') {
  ------------------
  |  Branch (2410:14): [True: 784, False: 6.46k]
  ------------------
 2411|    784|            ++it;
 2412|    784|            return;
 2413|    784|         }
 2414|       |
 2415|       |         // Parse as plain scalar and check if it's a null keyword
 2416|  6.46k|         auto start = it;
 2417|  30.1k|         while (it != end && !yaml::plain_scalar_end_table[static_cast<uint8_t>(*it)]) {
  ------------------
  |  Branch (2417:17): [True: 29.2k, False: 833]
  |  Branch (2417:30): [True: 23.6k, False: 5.62k]
  ------------------
 2418|  23.6k|            ++it;
 2419|  23.6k|         }
 2420|       |
 2421|  6.46k|         std::string_view str{start, static_cast<size_t>(it - start)};
 2422|  6.46k|         if (!yaml::is_yaml_null(str)) {
  ------------------
  |  Branch (2422:14): [True: 61, False: 6.40k]
  ------------------
 2423|     61|            ctx.error = error_code::syntax_error;
 2424|     61|         }
 2425|  6.46k|      }
_ZN3glz33process_yaml_variant_alternativesINSt3__17variantIJDndNS1_12basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEbNS1_6vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS6_ISD_EEEENSC_ISD_EEEEENS_21is_yaml_variant_arrayEE2opITnDaXtlNS_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2EEERSH_TkNS_10is_contextERNSL_12yaml_contextERPKcSR_EEvOT0_OT1_OT2_T3_:
 5205|   166k|      {
 5206|   166k|         constexpr auto category_count = yaml_variant_count_v<Variant, Trait>;
 5207|       |
 5208|       |         if constexpr (category_count == 0) {
 5209|       |            ctx.error = error_code::no_matching_variant_type;
 5210|       |         }
 5211|   166k|         else if constexpr (category_count == 1) {
 5212|       |            // Only one type in this category, use it directly
 5213|   166k|            constexpr auto first_idx = yaml_variant_first_index_v<Variant, Trait>;
 5214|   166k|            using V = std::variant_alternative_t<first_idx, Variant>;
 5215|   166k|            if (!std::holds_alternative<V>(value)) value = V{};
  ------------------
  |  Branch (5215:17): [True: 166k, False: 0]
  ------------------
 5216|   166k|            from<YAML, V>::template op<Opts>(std::get<V>(value), ctx, it, end);
 5217|       |         }
 5218|       |         else {
 5219|       |            // Multiple types in this category, try each one
 5220|       |            constexpr auto N = std::variant_size_v<Variant>;
 5221|       |            bool found_match{};
 5222|       |            size_t match_idx = 0;
 5223|       |            // Only the last alternative propagates its error, so an alternative that exhausted an
 5224|       |            // expansion budget would otherwise be reported as no_matching_variant_type -- a wrong
 5225|       |            // diagnosis for a document that is hostile rather than merely the wrong shape. Held
 5226|       |            // aside and used only if nothing matched, so an alternative that does succeed later
 5227|       |            // (one that materializes no key text can still parse under a latched budget) is
 5228|       |            // unaffected.
 5229|       |            error_code expansion_error{};
 5230|       |            std::string_view expansion_message{};
 5231|       |
 5232|       |            for_each<N>([&]<size_t I>() {
 5233|       |               if (found_match) {
 5234|       |                  return;
 5235|       |               }
 5236|       |               using V = std::variant_alternative_t<I, Variant>;
 5237|       |               if constexpr (Trait<V>::value) {
 5238|       |                  auto copy_it = it;
 5239|       |                  if (!std::holds_alternative<V>(value)) {
 5240|       |                     value = V{};
 5241|       |                  }
 5242|       |
 5243|       |                  auto temp_ctx = ctx.make_speculative();
 5244|       |                  from<YAML, V>::template op<Opts>(std::get<V>(value), temp_ctx, it, end);
 5245|       |
 5246|       |                  // Charged whether or not the alternative fit: a rejected probe still replayed
 5247|       |                  // whatever aliases it reached, and an attempt that is never billed is an
 5248|       |                  // attempt that can be repeated for free.
 5249|       |                  ctx.alias_expansion_budget = temp_ctx.alias_expansion_budget;
 5250|       |                  ctx.key_expansion_budget = temp_ctx.key_expansion_budget;
 5251|       |
 5252|       |                  if (!bool(temp_ctx.error)) {
 5253|       |                     found_match = true;
 5254|       |                     ctx.anchors = std::move(temp_ctx.anchors);
 5255|       |                  }
 5256|       |                  else {
 5257|       |                     it = copy_it;
 5258|       |                     if (temp_ctx.error == error_code::exceeded_max_expansion && expansion_error == error_code::none) {
 5259|       |                        expansion_error = temp_ctx.error;
 5260|       |                        expansion_message = temp_ctx.custom_error_message;
 5261|       |                     }
 5262|       |                     if (match_idx + 1 < category_count) {
 5263|       |                        // Not the last type, continue trying
 5264|       |                     }
 5265|       |                     else {
 5266|       |                        // Last type failed, propagate error
 5267|       |                        ctx.error = temp_ctx.error;
 5268|       |                        ctx.custom_error_message = temp_ctx.custom_error_message;
 5269|       |                     }
 5270|       |                  }
 5271|       |                  ++match_idx;
 5272|       |               }
 5273|       |            });
 5274|       |
 5275|       |            if (!found_match && !bool(ctx.error)) {
 5276|       |               if (expansion_error != error_code::none) {
 5277|       |                  ctx.error = expansion_error;
 5278|       |                  ctx.custom_error_message = expansion_message;
 5279|       |               }
 5280|       |               else {
 5281|       |                  ctx.error = error_code::no_matching_variant_type;
 5282|       |               }
 5283|       |            }
 5284|       |         }
 5285|   166k|      }
_ZN3glz4fromILj450ENSt3__16vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS1_9allocatorIS6_EEEEE2opITnDaXtlNS_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2EEERPKcRS9_TkNS_10is_contextERNSC_12yaml_contextESF_EEvOT1_OT2_OT0_T3_:
 4098|   172k|      {
 4099|   172k|         if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4099:14): [True: 0, False: 172k]
  ------------------
 4100|      0|            return;
 4101|       |
 4102|       |         // Peek ahead to check for tag (don't consume indentation for block sequences)
 4103|   172k|         auto peek = it;
 4104|   172k|         yaml::node_preamble_state preamble{};
 4105|   172k|         if (yaml::parse_node_preamble<Opts>(value, ctx, peek, end, preamble,
  ------------------
  |  Branch (4105:14): [True: 7.46k, False: 165k]
  ------------------
 4106|   172k|                                             [](yaml::yaml_tag tag) { return yaml::tag_valid_for_seq(tag); })) {
 4107|  7.46k|            it = peek;
 4108|  7.46k|            return;
 4109|  7.46k|         }
 4110|       |
 4111|   165k|         if (*peek == '[') {
  ------------------
  |  Branch (4111:14): [True: 64.0k, False: 101k]
  ------------------
 4112|       |            // Flow sequence - consume whitespace and parse
 4113|  64.0k|            it = peek;
 4114|  64.0k|            yaml::parse_flow_sequence<Opts>(value, ctx, it, end);
 4115|  64.0k|         }
 4116|   101k|         else if (*peek == '-') {
  ------------------
  |  Branch (4116:19): [True: 101k, False: 198]
  ------------------
 4117|       |            // Block sequence - don't consume leading whitespace, let parse_block_sequence handle it
 4118|       |            // But if there was a tag, we need to advance past it
 4119|   101k|            if (preamble.tag != yaml::yaml_tag::none || preamble.node_props.has_anchor) {
  ------------------
  |  Branch (4119:17): [True: 156, False: 100k]
  |  Branch (4119:57): [True: 4.99k, False: 95.9k]
  ------------------
 4120|  5.15k|               it = peek;
 4121|  5.15k|            }
 4122|   101k|            int32_t seq_indent = ctx.current_indent();
 4123|   101k|            if (*it == '-' && ctx.current_indent() >= 0) {
  ------------------
  |  Branch (4123:17): [True: 100k, False: 502]
  |  Branch (4123:31): [True: 87.3k, False: 13.2k]
  ------------------
 4124|  87.3k|               seq_indent = ctx.allow_indentless_sequence ? (ctx.current_indent() > 0 ? (ctx.current_indent() - 1) : 0)
  ------------------
  |  Branch (4124:29): [True: 57.7k, False: 29.6k]
  |  Branch (4124:62): [True: 31.6k, False: 26.1k]
  ------------------
 4125|  87.3k|                                                          : (ctx.current_indent() + 1);
 4126|  87.3k|            }
 4127|   101k|            yaml::parse_block_sequence<Opts>(value, ctx, it, end, seq_indent);
 4128|   101k|         }
 4129|    198|         else {
 4130|    198|            ctx.error = error_code::syntax_error;
 4131|    198|         }
 4132|       |
 4133|   165k|         yaml::finalize_node_anchor(preamble.node_props, ctx, it);
 4134|   165k|      }
_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|   172k|      {
  466|   172k|         skip_inline_ws(it, end);
  467|       |
  468|   172k|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (468:14): [True: 9, False: 172k]
  ------------------
  469|      9|            if constexpr (!AllowEmptyInput) {
  470|      9|               ctx.error = error_code::unexpected_end;
  471|      9|            }
  472|      9|            return true;
  473|      9|         }
  474|       |
  475|   172k|         preamble.tag = parse_yaml_tag(it, end, ctx);
  476|   172k|         if (preamble.tag == yaml_tag::unknown) [[unlikely]] {
  ------------------
  |  Branch (476:14): [True: 3, False: 172k]
  ------------------
  477|      3|            ctx.error = error_code::syntax_error;
  478|      3|            return true;
  479|      3|         }
  480|   172k|         if (!tag_validator(preamble.tag)) [[unlikely]] {
  ------------------
  |  Branch (480:14): [True: 3, False: 172k]
  ------------------
  481|      3|            ctx.error = error_code::syntax_error;
  482|      3|            return true;
  483|      3|         }
  484|       |
  485|   172k|         skip_inline_ws(it, end);
  486|       |
  487|   172k|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (487:14): [True: 6, False: 172k]
  ------------------
  488|      6|            if constexpr (!AllowEmptyInput) {
  489|      6|               ctx.error = error_code::unexpected_end;
  490|      6|            }
  491|      6|            return true;
  492|      6|         }
  493|       |
  494|   172k|         if (parse_node_properties<Opts, PropertyPolicy>(std::forward<T>(value), ctx, it, end, preamble.node_props)) {
  ------------------
  |  Branch (494:14): [True: 7.44k, False: 165k]
  ------------------
  495|  7.44k|            return true;
  496|  7.44k|         }
  497|       |
  498|   165k|         return false;
  499|   172k|      }
_ZZN3glz4fromILj450ENSt3__16vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS1_9allocatorIS6_EEEEE2opITnDaXtlNS_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2EEERPKcRS9_TkNS_10is_contextERNSC_12yaml_contextESF_EEvOT1_OT2_OT0_T3_ENKUlNSC_8yaml_tagEE_clESR_:
 4106|   172k|                                             [](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|   172k|      {
  409|   172k|         state.has_anchor = false;
  410|   172k|         state.anchor_name.clear();
  411|   172k|         state.anchor_start = nullptr;
  412|   172k|         state.anchor_indent = ctx.current_indent();
  413|       |
  414|   172k|         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|   172k|            else {
  421|   172k|               if (handle_alias<Opts>(std::forward<T>(value), ctx, it, end)) return true;
  ------------------
  |  Branch (421:20): [True: 7.39k, False: 165k]
  ------------------
  422|   172k|            }
  423|   172k|         }
  424|       |
  425|   172k|         if (it != end && *it == '&') {
  ------------------
  |  Branch (425:14): [True: 165k, False: 7.39k]
  |  Branch (425:27): [True: 5.85k, False: 159k]
  ------------------
  426|  5.85k|            ++it;
  427|  5.85k|            auto name = parse_anchor_name(it, end);
  428|  5.85k|            if (name.empty()) {
  ------------------
  |  Branch (428:17): [True: 14, False: 5.83k]
  ------------------
  429|     14|               ctx.error = error_code::syntax_error;
  430|     14|               return true;
  431|     14|            }
  432|  5.83k|            skip_inline_ws(it, end);
  433|  5.83k|            if (it == end) {
  ------------------
  |  Branch (433:17): [True: 30, False: 5.80k]
  ------------------
  434|     30|               if constexpr (!Policy.allow_empty_after_anchor) {
  435|     30|                  ctx.error = error_code::unexpected_end;
  436|     30|               }
  437|     30|               return true;
  438|     30|            }
  439|       |            if constexpr (Policy.disallow_anchor_on_alias) {
  440|       |               if (*it == '*') {
  441|       |                  ctx.error = error_code::syntax_error;
  442|       |                  return true;
  443|       |               }
  444|       |            }
  445|  5.80k|            state.has_anchor = true;
  446|  5.80k|            state.anchor_name = std::string(name);
  447|  5.80k|            state.anchor_start = &*it;
  448|  5.80k|         }
  449|       |
  450|   172k|         return false;
  451|   172k|      }
_ZN3glz4yaml12handle_aliasITnDaXtlNS0_9yaml_optsELj450ELb1ELb0ELb1ELh2EEERNSt3__16vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS3_9allocatorIS8_EEEENS0_12yaml_contextEPKcSF_EEbOT0_RT1_RT2_T3_:
  300|   172k|      {
  301|   172k|         if (it == end || *it != '*') return false;
  ------------------
  |  Branch (301:14): [True: 0, False: 172k]
  |  Branch (301:27): [True: 165k, False: 7.39k]
  ------------------
  302|       |
  303|  7.39k|         ++it; // skip '*'
  304|  7.39k|         auto name = parse_anchor_name(it, end);
  305|  7.39k|         if (name.empty()) {
  ------------------
  |  Branch (305:14): [True: 7, False: 7.38k]
  ------------------
  306|      7|            ctx.error = error_code::syntax_error;
  307|      7|            return true;
  308|      7|         }
  309|       |
  310|  7.38k|         auto anchor_it = ctx.anchors.find(name);
  311|  7.38k|         if (anchor_it == ctx.anchors.end()) {
  ------------------
  |  Branch (311:14): [True: 63, False: 7.32k]
  ------------------
  312|     63|            ctx.error = error_code::syntax_error; // undefined alias
  313|     63|            return true;
  314|     63|         }
  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.32k|         const auto span = anchor_it->second;
  319|       |
  320|       |         // Empty anchor span (anchor on null/empty node) — leave value as default
  321|  7.32k|         if (span.begin == span.end) {
  ------------------
  |  Branch (321:14): [True: 594, False: 6.73k]
  ------------------
  322|    594|            return true;
  323|    594|         }
  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.73k|         if (ctx.alias_span_is_replaying(span.begin, span.end)) [[unlikely]] {
  ------------------
  |  Branch (328:14): [True: 3, False: 6.72k]
  ------------------
  329|      3|            ctx.error = error_code::syntax_error; // cyclic alias
  330|      3|            return true;
  331|      3|         }
  332|       |
  333|       |         // Replaying an anchor re-enters the reader directly, bypassing the variant reader's
  334|       |         // depth guard, so this is the only depth accounting a chain of aliases into a
  335|       |         // non-variant target gets. The cycle check above stops the unbounded case; this bounds
  336|       |         // a legitimate but deeply chained one.
  337|  6.72k|         depth_guard guard{ctx, yaml::max_yaml_recursive_depth};
  338|  6.72k|         if (!guard) [[unlikely]]
  ------------------
  |  Branch (338:14): [True: 0, False: 6.72k]
  ------------------
  339|      0|            return true;
  340|       |
  341|  6.72k|         if (!ctx.charge_alias_expansion(static_cast<size_t>(span.end - span.begin))) [[unlikely]] {
  ------------------
  |  Branch (341:14): [True: 0, False: 6.72k]
  ------------------
  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.72k|         auto replay_it = span.begin;
  348|  6.72k|         auto replay_end = span.end;
  349|       |
  350|       |         // Save indent context and set up for replay
  351|  6.72k|         auto saved_indent_stack = std::move(ctx.indent_stack);
  352|  6.72k|         ctx.indent_stack.clear();
  353|  6.72k|         if (span.base_indent > 0) {
  ------------------
  |  Branch (353:14): [True: 5.31k, False: 1.41k]
  ------------------
  354|  5.31k|            ctx.push_indent(span.base_indent - 1);
  355|  5.31k|         }
  356|       |
  357|  6.72k|         ctx.active_alias_spans.emplace_back(span.begin, span.end);
  358|       |
  359|  6.72k|         using V = std::remove_cvref_t<T>;
  360|  6.72k|         from<YAML, V>::template op<Opts>(std::forward<T>(value), ctx, replay_it, replay_end);
  361|       |
  362|  6.72k|         ctx.active_alias_spans.pop_back();
  363|       |
  364|       |         // Restore indent context
  365|  6.72k|         ctx.indent_stack = std::move(saved_indent_stack);
  366|  6.72k|         return true;
  367|  6.72k|      }
_ZN3glz4yaml19parse_flow_sequenceITnDaXtlNS0_9yaml_optsELj450ELb1ELb0ELb1ELh2EEERNSt3__16vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS3_9allocatorIS8_EEEENS0_12yaml_contextEPKcSF_EEvOT0_RT1_RT2_T3_:
 2596|  64.0k|      {
 2597|  64.0k|         using V = std::remove_cvref_t<T>;
 2598|  64.0k|         using value_type = typename V::value_type;
 2599|       |
 2600|  64.0k|         struct sequence_container_adapter
 2601|  64.0k|         {
 2602|  64.0k|            size_t index = 0;
 2603|       |
 2604|  64.0k|            inline bool fixed_capacity_reached(const V& container) const noexcept
 2605|  64.0k|            {
 2606|  64.0k|               if constexpr (!resizable<V>) {
 2607|  64.0k|                  return index >= container.size();
 2608|  64.0k|               }
 2609|  64.0k|               else {
 2610|  64.0k|                  (void)container;
 2611|  64.0k|                  return false;
 2612|  64.0k|               }
 2613|  64.0k|            }
 2614|       |
 2615|  64.0k|            inline void commit_fixed_slot() noexcept { ++index; }
 2616|       |
 2617|  64.0k|            inline void append(V& container, value_type&& element) noexcept
 2618|  64.0k|            {
 2619|  64.0k|               if constexpr (emplace_backable<V>) {
 2620|  64.0k|                  container.emplace_back(std::move(element));
 2621|  64.0k|               }
 2622|  64.0k|               else if constexpr (emplaceable<V>) {
 2623|  64.0k|                  container.emplace(std::move(element));
 2624|  64.0k|               }
 2625|  64.0k|            }
 2626|  64.0k|         };
 2627|       |
 2628|  64.0k|         if (it == end || *it != '[') [[unlikely]] {
  ------------------
  |  Branch (2628:14): [True: 0, False: 64.0k]
  |  Branch (2628:27): [True: 0, False: 64.0k]
  ------------------
 2629|      0|            ctx.error = error_code::syntax_error;
 2630|      0|            return;
 2631|      0|         }
 2632|       |
 2633|       |         // Overwrite (do not append to) any pre-existing contents. Must happen
 2634|       |         // before the empty-array early return below so that `[]` also clears.
 2635|  64.0k|         clear_sequence_before_read<Opts>(value);
 2636|       |
 2637|  64.0k|         ++it; // Skip '['
 2638|       |         // Skip whitespace and newlines after opening bracket (YAML allows multi-line flow sequences)
 2639|  64.0k|         skip_flow_ws_and_newlines(ctx, it, end);
 2640|  64.0k|         if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2640:14): [True: 32, False: 64.0k]
  ------------------
 2641|     32|            return;
 2642|       |
 2643|       |         // Handle empty array
 2644|  64.0k|         if (it != end && *it == ']') {
  ------------------
  |  Branch (2644:14): [True: 63.3k, False: 746]
  |  Branch (2644:27): [True: 9.28k, False: 54.0k]
  ------------------
 2645|  9.28k|            ++it;
 2646|  9.28k|            validate_flow_node_adjacent_tail(ctx, it, end);
 2647|  9.28k|            if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2647:17): [True: 23, False: 9.26k]
  ------------------
 2648|     23|               return;
 2649|  9.26k|            if constexpr (!yaml::check_flow_context(Opts)) {
 2650|  9.26k|               if (ctx.current_indent() < 0) {
  ------------------
  |  Branch (2650:20): [True: 726, False: 8.53k]
  ------------------
 2651|    726|                  validate_root_flow_tail_after_close(ctx, it, end);
 2652|    726|               }
 2653|  9.26k|            }
 2654|  9.26k|            return;
 2655|  9.28k|         }
 2656|       |
 2657|  54.7k|         bool just_saw_comma = false;
 2658|  54.7k|         sequence_container_adapter adapter{};
 2659|       |
 2660|  54.7k|         if constexpr (emplace_backable<V> || emplaceable<V>) {
 2661|       |            // Dynamic containers append items (vector-like and set-like)
 2662|  1.08M|            while (it != end) {
  ------------------
  |  Branch (2662:20): [True: 1.08M, False: 3.14k]
  ------------------
 2663|  1.08M|               skip_flow_ws_and_newlines(ctx, it, end);
 2664|  1.08M|               if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2664:20): [True: 0, False: 1.08M]
  ------------------
 2665|      0|                  return;
 2666|       |
 2667|  1.08M|               if (it == end) [[unlikely]] {
  ------------------
  |  Branch (2667:20): [True: 0, False: 1.08M]
  ------------------
 2668|      0|                  ctx.error = error_code::unexpected_end;
 2669|      0|                  return;
 2670|      0|               }
 2671|       |
 2672|  1.08M|               if (*it == ']') {
  ------------------
  |  Branch (2672:20): [True: 7.50k, False: 1.07M]
  ------------------
 2673|  7.50k|                  if (just_saw_comma) {
  ------------------
  |  Branch (2673:23): [True: 7.50k, False: 0]
  ------------------
 2674|  7.50k|                     ++it;
 2675|  7.50k|                     validate_flow_node_adjacent_tail(ctx, it, end);
 2676|  7.50k|                     if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2676:26): [True: 12, False: 7.48k]
  ------------------
 2677|     12|                        return;
 2678|  7.48k|                     if constexpr (!yaml::check_flow_context(Opts)) {
 2679|  7.48k|                        if (ctx.current_indent() < 0) {
  ------------------
  |  Branch (2679:29): [True: 962, False: 6.52k]
  ------------------
 2680|    962|                           validate_root_flow_tail_after_close(ctx, it, end);
 2681|    962|                        }
 2682|  7.48k|                     }
 2683|  7.48k|                     return;
 2684|  7.50k|                  }
 2685|      0|                  ctx.error = error_code::syntax_error;
 2686|      0|                  return;
 2687|  7.50k|               }
 2688|       |
 2689|  1.07M|               if (*it == ',' || *it == '#') {
  ------------------
  |  Branch (2689:20): [True: 504, False: 1.07M]
  |  Branch (2689:34): [True: 97, False: 1.07M]
  ------------------
 2690|    601|                  ctx.error = error_code::syntax_error;
 2691|    601|                  return;
 2692|    601|               }
 2693|  1.07M|               just_saw_comma = false;
 2694|       |
 2695|  1.07M|               value_type element{};
 2696|  1.07M|               from<YAML, value_type>::template op<flow_context_on<Opts>()>(element, ctx, it, end);
 2697|       |
 2698|  1.07M|               if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2698:20): [True: 27.8k, False: 1.04M]
  ------------------
 2699|  27.8k|                  return;
 2700|       |
 2701|  1.04M|               bool saw_line_break_before_separator = false;
 2702|  1.04M|               skip_flow_ws_and_newlines(ctx, it, end, &saw_line_break_before_separator);
 2703|  1.04M|               if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2703:20): [True: 24, False: 1.04M]
  ------------------
 2704|     24|                  return;
 2705|       |
 2706|  1.04M|               if (it != end && *it == ':') {
  ------------------
  |  Branch (2706:20): [True: 1.04M, False: 4.47k]
  |  Branch (2706:33): [True: 12.9k, False: 1.03M]
  ------------------
 2707|       |                  // In flow sequences, implicit key-value pairs must be on a single line.
 2708|  12.9k|                  if (saw_line_break_before_separator) {
  ------------------
  |  Branch (2708:23): [True: 75, False: 12.8k]
  ------------------
 2709|     75|                     ctx.error = error_code::syntax_error;
 2710|     75|                     return;
 2711|     75|                  }
 2712|  12.8k|                  if constexpr (std::same_as<std::remove_cvref_t<value_type>, glz::generic>) {
 2713|  12.8k|                     glz::generic key_node = std::move(element);
 2714|  12.8k|                     ++it;
 2715|  12.8k|                     skip_inline_ws(it, end);
 2716|       |
 2717|  12.8k|                     glz::generic mapped{};
 2718|  12.8k|                     from<YAML, glz::generic>::template op<flow_context_on<Opts>()>(mapped, ctx, it, end);
 2719|  12.8k|                     if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2719:26): [True: 651, False: 12.2k]
  ------------------
 2720|    651|                        return;
 2721|       |
 2722|  12.2k|                     std::string key;
 2723|  12.2k|                     if (!yaml::materialize_key(key, key_node, ctx)) [[unlikely]]
  ------------------
  |  Branch (2723:26): [True: 5, False: 12.2k]
  ------------------
 2724|      5|                        return;
 2725|       |
 2726|  12.2k|                     glz::generic pair{};
 2727|  12.2k|                     pair[key] = std::move(mapped);
 2728|  12.2k|                     element = std::move(pair);
 2729|       |
 2730|  12.2k|                     skip_flow_ws_and_newlines(ctx, it, end);
 2731|  12.2k|                     if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2731:26): [True: 7, False: 12.2k]
  ------------------
 2732|      7|                        return;
 2733|       |                  }
 2734|       |                  else {
 2735|       |                     ctx.error = error_code::syntax_error;
 2736|       |                     return;
 2737|       |                  }
 2738|  12.8k|               }
 2739|       |
 2740|  1.04M|               adapter.append(value, std::move(element));
 2741|       |
 2742|  1.04M|               if (it == end) [[unlikely]] {
  ------------------
  |  Branch (2742:20): [True: 4.76k, False: 1.04M]
  ------------------
 2743|  4.76k|                  ctx.error = error_code::unexpected_end;
 2744|  4.76k|                  return;
 2745|  4.76k|               }
 2746|       |
 2747|  1.04M|               if (*it == ']') {
  ------------------
  |  Branch (2747:20): [True: 8.10k, False: 1.03M]
  ------------------
 2748|  8.10k|                  ++it;
 2749|  8.10k|                  validate_flow_node_adjacent_tail(ctx, it, end);
 2750|  8.10k|                  if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2750:23): [True: 191, False: 7.91k]
  ------------------
 2751|    191|                     return;
 2752|  7.91k|                  if constexpr (!yaml::check_flow_context(Opts)) {
 2753|  7.91k|                     if (ctx.current_indent() < 0) {
  ------------------
  |  Branch (2753:26): [True: 676, False: 7.23k]
  ------------------
 2754|    676|                        validate_root_flow_tail_after_close(ctx, it, end);
 2755|    676|                     }
 2756|  7.91k|                  }
 2757|  7.91k|                  return;
 2758|  8.10k|               }
 2759|  1.03M|               else if (*it == ',') {
  ------------------
  |  Branch (2759:25): [True: 1.03M, False: 2.72k]
  ------------------
 2760|  1.03M|                  ++it;
 2761|  1.03M|                  just_saw_comma = true;
 2762|  1.03M|                  skip_flow_ws_and_newlines(ctx, it, end);
 2763|  1.03M|                  if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2763:23): [True: 12, False: 1.03M]
  ------------------
 2764|     12|                     return;
 2765|  1.03M|               }
 2766|  2.72k|               else {
 2767|  2.72k|                  ctx.error = error_code::syntax_error;
 2768|  2.72k|                  return;
 2769|  2.72k|               }
 2770|  1.04M|            }
 2771|       |         }
 2772|       |         else if constexpr (!resizable<V>) {
 2773|       |            // Fixed-size containers (std::array)
 2774|       |            while (it != end && !adapter.fixed_capacity_reached(value)) {
 2775|       |               skip_flow_ws_and_newlines(ctx, it, end);
 2776|       |               if (bool(ctx.error)) [[unlikely]]
 2777|       |                  return;
 2778|       |
 2779|       |               if (it == end) [[unlikely]] {
 2780|       |                  ctx.error = error_code::unexpected_end;
 2781|       |                  return;
 2782|       |               }
 2783|       |
 2784|       |               if (*it == ']') {
 2785|       |                  if (just_saw_comma) {
 2786|       |                     ++it;
 2787|       |                     validate_flow_node_adjacent_tail(ctx, it, end);
 2788|       |                     if (bool(ctx.error)) [[unlikely]]
 2789|       |                        return;
 2790|       |                     if constexpr (!yaml::check_flow_context(Opts)) {
 2791|       |                        if (ctx.current_indent() < 0) {
 2792|       |                           validate_root_flow_tail_after_close(ctx, it, end);
 2793|       |                        }
 2794|       |                     }
 2795|       |                     return;
 2796|       |                  }
 2797|       |                  ctx.error = error_code::syntax_error;
 2798|       |                  return;
 2799|       |               }
 2800|       |
 2801|       |               if (*it == ',' || *it == '#') {
 2802|       |                  ctx.error = error_code::syntax_error;
 2803|       |                  return;
 2804|       |               }
 2805|       |               just_saw_comma = false;
 2806|       |
 2807|       |               from<YAML, value_type>::template op<flow_context_on<Opts>()>(value[adapter.index], ctx, it, end);
 2808|       |
 2809|       |               if (bool(ctx.error)) [[unlikely]]
 2810|       |                  return;
 2811|       |
 2812|       |               adapter.commit_fixed_slot();
 2813|       |               skip_flow_ws_and_newlines(ctx, it, end);
 2814|       |               if (bool(ctx.error)) [[unlikely]]
 2815|       |                  return;
 2816|       |
 2817|       |               if (it == end) [[unlikely]] {
 2818|       |                  ctx.error = error_code::unexpected_end;
 2819|       |                  return;
 2820|       |               }
 2821|       |
 2822|       |               if (*it == ']') {
 2823|       |                  ++it;
 2824|       |                  validate_flow_node_adjacent_tail(ctx, it, end);
 2825|       |                  if (bool(ctx.error)) [[unlikely]]
 2826|       |                     return;
 2827|       |                  if constexpr (!yaml::check_flow_context(Opts)) {
 2828|       |                     if (ctx.current_indent() < 0) {
 2829|       |                        validate_root_flow_tail_after_close(ctx, it, end);
 2830|       |                     }
 2831|       |                  }
 2832|       |                  return;
 2833|       |               }
 2834|       |               else if (*it == ',') {
 2835|       |                  ++it;
 2836|       |                  just_saw_comma = true;
 2837|       |                  skip_flow_ws_and_newlines(ctx, it, end);
 2838|       |                  if (bool(ctx.error)) [[unlikely]]
 2839|       |                     return;
 2840|       |               }
 2841|       |               else {
 2842|       |                  ctx.error = error_code::syntax_error;
 2843|       |                  return;
 2844|       |               }
 2845|       |            }
 2846|       |
 2847|       |            // If we exited because the fixed-size container is full but haven't seen ']',
 2848|       |            // skip to the closing bracket to consume overflow elements.
 2849|       |            int bracket_depth = 1;
 2850|       |            while (it != end && bracket_depth > 0) {
 2851|       |               if (*it == '[') {
 2852|       |                  ++bracket_depth;
 2853|       |               }
 2854|       |               else if (*it == ']') {
 2855|       |                  --bracket_depth;
 2856|       |               }
 2857|       |               ++it;
 2858|       |            }
 2859|       |         }
 2860|       |         else {
 2861|       |            ctx.error = error_code::syntax_error;
 2862|       |            return;
 2863|       |         }
 2864|  54.7k|      }
_ZN3glz4yaml26clear_sequence_before_readITnDaXtlNS0_9yaml_optsELj450ELb1ELb0ELb1ELh2EEENSt3__16vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS3_9allocatorIS8_EEEEEEvRT0_:
 2580|   165k|      {
 2581|   165k|         if constexpr (emplace_backable<V> && requires { value.clear(); }) {
 2582|       |            // vector-like: honor the append_arrays option, matching json/read.hpp
 2583|   165k|            if constexpr (!check_append_arrays(Opts)) {
 2584|   165k|               value.clear();
 2585|   165k|            }
 2586|       |         }
 2587|       |         else if constexpr (emplaceable<V> && requires { value.clear(); }) {
 2588|       |            // set-like: json/read.hpp clears unconditionally; append_arrays does not apply
 2589|       |            value.clear();
 2590|       |         }
 2591|   165k|      }
_ZZN3glz4yaml19parse_flow_sequenceITnDaXtlNS0_9yaml_optsELj450ELb1ELb0ELb1ELh2EEERNSt3__16vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS3_9allocatorIS8_EEEENS0_12yaml_contextEPKcSF_EEvOT0_RT1_RT2_T3_EN26sequence_container_adapter6appendESC_OS8_:
 2618|  1.04M|            {
 2619|  1.04M|               if constexpr (emplace_backable<V>) {
 2620|  1.04M|                  container.emplace_back(std::move(element));
 2621|       |               }
 2622|       |               else if constexpr (emplaceable<V>) {
 2623|       |                  container.emplace(std::move(element));
 2624|       |               }
 2625|  1.04M|            }
_ZN3glz4yaml20parse_block_sequenceITnDaXtlNS0_9yaml_optsELj450ELb1ELb0ELb1ELh2EEERNSt3__16vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS3_9allocatorIS8_EEEENS0_12yaml_contextEPKcSF_EEvOT0_RT1_RT2_T3_i:
 3081|   101k|      {
 3082|   101k|         using V = std::remove_cvref_t<T>;
 3083|   101k|         using value_type = typename V::value_type;
 3084|       |
 3085|   101k|         struct sequence_container_adapter
 3086|   101k|         {
 3087|   101k|            size_t index = 0;
 3088|       |
 3089|   101k|            inline bool fixed_capacity_reached(const V& container) const noexcept
 3090|   101k|            {
 3091|   101k|               if constexpr (!resizable<V>) {
 3092|   101k|                  return index >= container.size();
 3093|   101k|               }
 3094|   101k|               else {
 3095|   101k|                  (void)container;
 3096|   101k|                  return false;
 3097|   101k|               }
 3098|   101k|            }
 3099|       |
 3100|   101k|            inline void commit_fixed_slot() noexcept { ++index; }
 3101|       |
 3102|   101k|            inline void append(V& container, value_type&& element) noexcept
 3103|   101k|            {
 3104|   101k|               if constexpr (emplace_backable<V>) {
 3105|   101k|                  container.emplace_back(std::move(element));
 3106|   101k|               }
 3107|   101k|               else if constexpr (emplaceable<V>) {
 3108|   101k|                  container.emplace(std::move(element));
 3109|   101k|               }
 3110|   101k|            }
 3111|   101k|         };
 3112|       |
 3113|       |         // Overwrite (do not append to) any pre-existing contents. A block
 3114|       |         // sequence is only entered once a '-' item is confirmed, so clearing
 3115|       |         // up front correctly (re)assigns the container to the parsed sequence.
 3116|   101k|         clear_sequence_before_read<Opts>(value);
 3117|       |
 3118|   101k|         sequence_container_adapter adapter{};
 3119|       |
 3120|       |         // Track if this is the first item (for handling whitespace-consumed case)
 3121|   101k|         bool first_item = true;
 3122|   101k|         bool has_pending_item_anchor = false;
 3123|   101k|         std::string pending_item_anchor_name{};
 3124|   101k|         int32_t pending_item_anchor_indent = sequence_indent;
 3125|       |
 3126|   274k|         while (it != end) {
  ------------------
  |  Branch (3126:17): [True: 213k, False: 60.5k]
  ------------------
 3127|       |            // For fixed-size arrays (e.g. std::array), stop when we've filled all elements.
 3128|       |            // Exclude emplaceable types (e.g. std::set) which are not resizable but grow dynamically.
 3129|       |            if constexpr (!resizable<V> && !emplaceable<V>) {
 3130|       |               if (adapter.fixed_capacity_reached(value)) {
 3131|       |                  return;
 3132|       |               }
 3133|       |            }
 3134|       |
 3135|       |            // Skip blank lines and comments, track indent
 3136|   213k|            int32_t line_indent = 0;
 3137|   213k|            int32_t dash_col = -1; // actual column of the '-' on the line
 3138|   213k|            auto line_start = it;
 3139|       |
 3140|   307k|            while (it != end) {
  ------------------
  |  Branch (3140:20): [True: 300k, False: 7.00k]
  ------------------
 3141|   300k|               if (*it == '#') {
  ------------------
  |  Branch (3141:20): [True: 24.7k, False: 275k]
  ------------------
 3142|  24.7k|                  skip_comment(it, end);
 3143|  24.7k|                  skip_newline(it, end);
 3144|  24.7k|                  line_start = it;
 3145|  24.7k|                  line_indent = 0;
 3146|  24.7k|               }
 3147|   275k|               else if (*it == '\n' || *it == '\r') {
  ------------------
  |  Branch (3147:25): [True: 28.1k, False: 247k]
  |  Branch (3147:40): [True: 25.6k, False: 221k]
  ------------------
 3148|  53.7k|                  skip_newline(it, end);
 3149|  53.7k|                  line_start = it;
 3150|  53.7k|                  line_indent = 0;
 3151|  53.7k|               }
 3152|   221k|               else if (*it == ' ') {
  ------------------
  |  Branch (3152:25): [True: 33.8k, False: 187k]
  ------------------
 3153|  33.8k|                  line_start = it;
 3154|  33.8k|                  line_indent = 0;
 3155|  81.8k|                  while (it != end && *it == ' ') {
  ------------------
  |  Branch (3155:26): [True: 81.3k, False: 565]
  |  Branch (3155:39): [True: 48.0k, False: 33.2k]
  ------------------
 3156|  48.0k|                     ++line_indent;
 3157|  48.0k|                     ++it;
 3158|  48.0k|                  }
 3159|       |
 3160|  33.8k|                  bool saw_tab = false;
 3161|  37.0k|                  while (it != end && (*it == ' ' || *it == '\t')) {
  ------------------
  |  Branch (3161:26): [True: 36.4k, False: 611]
  |  Branch (3161:40): [True: 1.51k, False: 34.9k]
  |  Branch (3161:54): [True: 1.74k, False: 33.2k]
  ------------------
 3162|  3.25k|                     saw_tab = saw_tab || (*it == '\t');
  ------------------
  |  Branch (3162:32): [True: 2.32k, False: 928]
  |  Branch (3162:43): [True: 928, False: 0]
  ------------------
 3163|  3.25k|                     ++it;
 3164|  3.25k|                  }
 3165|       |
 3166|  33.8k|                  if (it == end || *it == '\n' || *it == '\r' || *it == '#') {
  ------------------
  |  Branch (3166:23): [True: 611, False: 33.2k]
  |  Branch (3166:36): [True: 705, False: 32.5k]
  |  Branch (3166:51): [True: 1.28k, False: 31.2k]
  |  Branch (3166:66): [True: 9.07k, False: 22.1k]
  ------------------
 3167|       |                     // Blank or comment line - continue to next line
 3168|  11.6k|                     if (it != end && *it == '#') {
  ------------------
  |  Branch (3168:26): [True: 11.0k, False: 611]
  |  Branch (3168:39): [True: 9.07k, False: 1.99k]
  ------------------
 3169|  9.07k|                        skip_comment(it, end);
 3170|  9.07k|                     }
 3171|  11.6k|                     line_indent = 0;
 3172|  11.6k|                     continue;
 3173|  11.6k|                  }
 3174|       |
 3175|  22.1k|                  if (saw_tab) {
  ------------------
  |  Branch (3175:23): [True: 24, False: 22.1k]
  ------------------
 3176|     24|                     ctx.error = error_code::syntax_error;
 3177|     24|                     return;
 3178|     24|                  }
 3179|  22.1k|                  break; // Found content
 3180|  22.1k|               }
 3181|   187k|               else if (*it == '\t') {
  ------------------
  |  Branch (3181:25): [True: 3.28k, False: 184k]
  ------------------
 3182|  3.28k|                  line_start = it;
 3183|  12.4k|                  while (it != end && (*it == ' ' || *it == '\t')) ++it;
  ------------------
  |  Branch (3183:26): [True: 12.1k, False: 325]
  |  Branch (3183:40): [True: 1.31k, False: 10.8k]
  |  Branch (3183:54): [True: 7.87k, False: 2.96k]
  ------------------
 3184|  3.28k|                  if (it == end || *it == '\n' || *it == '\r' || *it == '#') {
  ------------------
  |  Branch (3184:23): [True: 325, False: 2.96k]
  |  Branch (3184:36): [True: 647, False: 2.31k]
  |  Branch (3184:51): [True: 837, False: 1.47k]
  |  Branch (3184:66): [True: 1.44k, False: 38]
  ------------------
 3185|  3.24k|                     if (it != end && *it == '#') {
  ------------------
  |  Branch (3185:26): [True: 2.92k, False: 325]
  |  Branch (3185:39): [True: 1.44k, False: 1.48k]
  ------------------
 3186|  1.44k|                        skip_comment(it, end);
 3187|  1.44k|                     }
 3188|  3.24k|                     line_indent = 0;
 3189|  3.24k|                     continue;
 3190|  3.24k|                  }
 3191|     38|                  ctx.error = error_code::syntax_error;
 3192|     38|                  return;
 3193|  3.28k|               }
 3194|   184k|               else {
 3195|       |                  // At content (no leading space on this line)
 3196|       |                  // If first item and at '-', whitespace was consumed by caller;
 3197|       |                  // treat as having correct indentation
 3198|   184k|                  if (first_item && *it == '-') {
  ------------------
  |  Branch (3198:23): [True: 101k, False: 83.4k]
  |  Branch (3198:37): [True: 100k, False: 502]
  ------------------
 3199|   100k|                     line_indent = sequence_indent;
 3200|   100k|                     if constexpr (std::is_pointer_v<std::decay_t<It>>) {
 3201|   100k|                        if (ctx.stream_begin && it > ctx.stream_begin) {
  ------------------
  |  Branch (3201:29): [True: 100k, False: 0]
  |  Branch (3201:49): [True: 99.7k, False: 821]
  ------------------
 3202|  99.7k|                           auto probe = it;
 3203|  99.7k|                           int32_t leading_ws = 0;
 3204|  99.7k|                           bool saw_tab = false;
 3205|   218k|                           while (probe > ctx.stream_begin && (*(probe - 1) == ' ' || *(probe - 1) == '\t')) {
  ------------------
  |  Branch (3205:35): [True: 217k, False: 133]
  |  Branch (3205:64): [True: 96.7k, False: 121k]
  |  Branch (3205:87): [True: 21.5k, False: 99.6k]
  ------------------
 3206|   118k|                              --probe;
 3207|   118k|                              ++leading_ws;
 3208|   118k|                              saw_tab = saw_tab || (*probe == '\t');
  ------------------
  |  Branch (3208:41): [True: 20.5k, False: 97.7k]
  |  Branch (3208:52): [True: 2.16k, False: 95.5k]
  ------------------
 3209|   118k|                           }
 3210|  99.7k|                           if (probe == ctx.stream_begin || *(probe - 1) == '\n' || *(probe - 1) == '\r') {
  ------------------
  |  Branch (3210:32): [True: 133, False: 99.6k]
  |  Branch (3210:61): [True: 30.4k, False: 69.2k]
  |  Branch (3210:85): [True: 12.4k, False: 56.8k]
  ------------------
 3211|  42.9k|                              if (saw_tab) {
  ------------------
  |  Branch (3211:35): [True: 33, False: 42.9k]
  ------------------
 3212|     33|                                 ctx.error = error_code::syntax_error;
 3213|     33|                                 return;
 3214|     33|                              }
 3215|  42.9k|                              line_indent = (std::max)(line_indent, leading_ws);
 3216|  42.9k|                           }
 3217|  99.7k|                        }
 3218|   100k|                     }
 3219|   100k|                  }
 3220|   100k|                  break;
 3221|   184k|               }
 3222|   300k|            }
 3223|       |
 3224|   213k|            if (it == end) break;
  ------------------
  |  Branch (3224:17): [True: 7.00k, False: 206k]
  ------------------
 3225|       |
 3226|       |            // Check for document end marker
 3227|   206k|            if (at_document_end(it, end)) break;
  ------------------
  |  Branch (3227:17): [True: 3.56k, False: 203k]
  ------------------
 3228|       |
 3229|       |            // Check for dedent
 3230|   203k|            if (line_indent < sequence_indent) {
  ------------------
  |  Branch (3230:17): [True: 14.6k, False: 188k]
  ------------------
 3231|  14.6k|               it = line_start;
 3232|  14.6k|               return;
 3233|  14.6k|            }
 3234|       |
 3235|   188k|            if (*it == '&') {
  ------------------
  |  Branch (3235:17): [True: 25.6k, False: 162k]
  ------------------
 3236|       |               // Standalone anchor lines before "- item" are only supported for
 3237|       |               // indentless mapping values. At top-level block sequences these are
 3238|       |               // malformed in yaml-test-suite cases.
 3239|  25.6k|               if (!ctx.allow_indentless_sequence) {
  ------------------
  |  Branch (3239:20): [True: 26, False: 25.6k]
  ------------------
 3240|     26|                  ctx.error = error_code::syntax_error;
 3241|     26|                  return;
 3242|     26|               }
 3243|       |
 3244|  25.6k|               ++it;
 3245|  25.6k|               auto pending_name = parse_anchor_name(it, end);
 3246|  25.6k|               if (pending_name.empty()) {
  ------------------
  |  Branch (3246:20): [True: 12, False: 25.6k]
  ------------------
 3247|     12|                  ctx.error = error_code::syntax_error;
 3248|     12|                  return;
 3249|     12|               }
 3250|  25.6k|               skip_inline_ws(it, end);
 3251|  25.6k|               if (it != end && *it == '#') {
  ------------------
  |  Branch (3251:20): [True: 25.5k, False: 58]
  |  Branch (3251:33): [True: 14.7k, False: 10.8k]
  ------------------
 3252|  14.7k|                  skip_comment(it, end);
 3253|  14.7k|               }
 3254|       |
 3255|  25.6k|               has_pending_item_anchor = true;
 3256|  25.6k|               pending_item_anchor_name = std::string(pending_name);
 3257|  25.6k|               pending_item_anchor_indent = line_indent;
 3258|       |
 3259|  25.6k|               if (it == end || (*it != '\n' && *it != '\r')) {
  ------------------
  |  Branch (3259:20): [True: 87, False: 25.5k]
  |  Branch (3259:34): [True: 9.90k, False: 15.6k]
  |  Branch (3259:49): [True: 44, False: 9.86k]
  ------------------
 3260|    131|                  ctx.error = error_code::syntax_error;
 3261|    131|                  return;
 3262|    131|               }
 3263|       |
 3264|  25.4k|               skip_newline(it, end);
 3265|  25.4k|               continue;
 3266|  25.6k|            }
 3267|       |
 3268|       |            // Expect dash for sequence item
 3269|   162k|            if (*it != '-') {
  ------------------
  |  Branch (3269:17): [True: 11.6k, False: 151k]
  ------------------
 3270|  11.6k|               it = line_start;
 3271|  11.6k|               return;
 3272|  11.6k|            }
 3273|       |
 3274|       |            // Compute the actual column of this sequence dash.
 3275|       |            // This is needed by plain-scalar multiline folding to distinguish
 3276|       |            // sibling "- item" entries from deeper "- " continuation content.
 3277|   151k|            dash_col = line_indent;
 3278|   151k|            if constexpr (std::is_pointer_v<std::decay_t<It>>) {
 3279|   151k|               if (ctx.stream_begin) {
  ------------------
  |  Branch (3279:20): [True: 151k, False: 33]
  ------------------
 3280|   151k|                  dash_col = ctx.line_prefix_before(&*it).column;
 3281|   151k|               }
 3282|   151k|            }
 3283|       |
 3284|   151k|            ++it; // Skip '-'
 3285|       |
 3286|       |            // Check for valid sequence item indicator (- followed by space or newline)
 3287|   151k|            if (it != end && !yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*it)]) {
  ------------------
  |  Branch (3287:17): [True: 143k, False: 7.82k]
  |  Branch (3287:30): [True: 2.64k, False: 140k]
  ------------------
 3288|       |               // Not a sequence item (could be a number like -5)
 3289|  2.64k|               it = line_start;
 3290|  2.64k|               return;
 3291|  2.64k|            }
 3292|       |
 3293|   148k|            bool saw_tab_after_dash = false;
 3294|   271k|            while (it != end && (*it == ' ' || *it == '\t')) {
  ------------------
  |  Branch (3294:20): [True: 263k, False: 8.24k]
  |  Branch (3294:34): [True: 114k, False: 149k]
  |  Branch (3294:48): [True: 9.15k, False: 140k]
  ------------------
 3295|   123k|               saw_tab_after_dash = saw_tab_after_dash || (*it == '\t');
  ------------------
  |  Branch (3295:37): [True: 1.62k, False: 121k]
  |  Branch (3295:59): [True: 7.75k, False: 114k]
  ------------------
 3296|   123k|               ++it;
 3297|   123k|            }
 3298|       |            // A tab-separated nested "- " marker is not valid block indentation.
 3299|   148k|            if (saw_tab_after_dash && it != end && *it == '-') {
  ------------------
  |  Branch (3299:17): [True: 7.75k, False: 140k]
  |  Branch (3299:39): [True: 7.59k, False: 160]
  |  Branch (3299:52): [True: 2.68k, False: 4.91k]
  ------------------
 3300|  2.68k|               const auto after_dash = it + 1;
 3301|  2.68k|               if (after_dash == end || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*after_dash)]) {
  ------------------
  |  Branch (3301:20): [True: 6, False: 2.67k]
  |  Branch (3301:41): [True: 3, False: 2.67k]
  ------------------
 3302|      9|                  ctx.error = error_code::syntax_error;
 3303|      9|                  return;
 3304|      9|               }
 3305|  2.68k|            }
 3306|       |
 3307|       |            // Get reference to element to parse into
 3308|   148k|            auto parse_element = [&](auto& element) {
 3309|   148k|               const char* element_start = (it != end) ? &*it : nullptr;
 3310|       |
 3311|       |               // Check what follows
 3312|   148k|               if (it != end && !yaml::line_end_or_comment_table[static_cast<uint8_t>(*it)]) {
 3313|       |                  // Content on same line as dash - set indent to one less than content column
 3314|       |                  // This allows nested block mappings to continue parsing keys at the content indent
 3315|       |                  // For "- key: val", if dash is at column 0, content is at column 2
 3316|       |                  // We set parent indent to 1 so keys at column 2 pass the "indent > parent" check
 3317|   148k|                  if (!ctx.push_indent(line_indent + 1)) [[unlikely]]
 3318|   148k|                     return;
 3319|   148k|                  const bool prev_sequence_item_value_context = ctx.sequence_item_value_context;
 3320|   148k|                  const int32_t prev_sequence_dash_indent = ctx.sequence_dash_indent;
 3321|   148k|                  ctx.sequence_item_value_context = true;
 3322|   148k|                  ctx.sequence_dash_indent = dash_col;
 3323|   148k|                  from<YAML, value_type>::template op<Opts>(element, ctx, it, end);
 3324|   148k|                  ctx.sequence_dash_indent = prev_sequence_dash_indent;
 3325|   148k|                  ctx.sequence_item_value_context = prev_sequence_item_value_context;
 3326|   148k|                  ctx.pop_indent();
 3327|   148k|               }
 3328|   148k|               else {
 3329|       |                  // Value on next line - nested block
 3330|   148k|                  skip_ws_and_comment(it, end);
 3331|   148k|                  skip_newline(it, end);
 3332|       |
 3333|       |                  // Get indent of nested content
 3334|   148k|                  auto nested_start = it;
 3335|   148k|                  int32_t nested_indent = measure_indent(it, end, ctx);
 3336|   148k|                  if (bool(ctx.error)) [[unlikely]]
 3337|   148k|                     return;
 3338|   148k|                  it = nested_start;
 3339|       |
 3340|       |                  // Content is nested only if indented more than the current line.
 3341|       |                  // When line_indent is negative (root level), use 0 as the baseline.
 3342|       |                  // This prevents content at column 0 from being treated as nested.
 3343|   148k|                  const int32_t effective_line_indent = (line_indent < 0) ? 0 : line_indent;
 3344|   148k|                  if (nested_indent > effective_line_indent) {
 3345|       |                     // Save and set indent for nested parsing.
 3346|       |                     // A struct element reads the pushed indent as its own key column; every
 3347|       |                     // other element type reads it as the enclosing baseline, so it gets one
 3348|       |                     // less than the content indent and its content passes "indent > parent".
 3349|   148k|                     const int32_t element_indent =
 3350|   148k|                        receives_block_mapping_column<value_type>() ? nested_indent : nested_indent - 1;
 3351|   148k|                     if (!ctx.push_indent(element_indent)) [[unlikely]]
 3352|   148k|                        return;
 3353|   148k|                     const bool prev_sequence_item_value_context = ctx.sequence_item_value_context;
 3354|   148k|                     const int32_t prev_sequence_dash_indent = ctx.sequence_dash_indent;
 3355|   148k|                     ctx.sequence_item_value_context = true;
 3356|   148k|                     ctx.sequence_dash_indent = dash_col;
 3357|   148k|                     from<YAML, value_type>::template op<Opts>(element, ctx, it, end);
 3358|   148k|                     ctx.sequence_dash_indent = prev_sequence_dash_indent;
 3359|   148k|                     ctx.sequence_item_value_context = prev_sequence_item_value_context;
 3360|   148k|                     ctx.pop_indent();
 3361|   148k|                  }
 3362|       |                  // else: empty element (default constructed)
 3363|   148k|               }
 3364|       |
 3365|   148k|               if (has_pending_item_anchor && !bool(ctx.error)) {
 3366|   148k|                  const char* element_end = (it != end) ? &*it : element_start;
 3367|   148k|                  ctx.anchors[std::move(pending_item_anchor_name)] = {element_start, element_end,
 3368|   148k|                                                                      pending_item_anchor_indent};
 3369|   148k|                  has_pending_item_anchor = false;
 3370|   148k|               }
 3371|   148k|            };
 3372|       |
 3373|   148k|            if constexpr (emplace_backable<V>) {
 3374|   148k|               auto& element = value.emplace_back();
 3375|   148k|               parse_element(element);
 3376|       |            }
 3377|       |            else if constexpr (emplaceable<V>) {
 3378|       |               value_type element{};
 3379|       |               parse_element(element);
 3380|       |               if (!bool(ctx.error)) {
 3381|       |                  adapter.append(value, std::move(element));
 3382|       |               }
 3383|       |            }
 3384|       |            else if constexpr (!resizable<V>) {
 3385|       |               parse_element(value[adapter.index]);
 3386|       |               adapter.commit_fixed_slot();
 3387|       |            }
 3388|       |            else {
 3389|       |               ctx.error = error_code::syntax_error;
 3390|       |               return;
 3391|       |            }
 3392|       |
 3393|   148k|            first_item = false;
 3394|       |
 3395|   148k|            if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (3395:17): [True: 870, False: 147k]
  ------------------
 3396|    870|               return;
 3397|       |
 3398|       |            // Note: after parsing nested block content, iterator may already be
 3399|       |            // at the start of the next line. The outer loop will handle it.
 3400|   148k|         }
 3401|   101k|      }
_ZZN3glz4yaml20parse_block_sequenceITnDaXtlNS0_9yaml_optsELj450ELb1ELb0ELb1ELh2EEERNSt3__16vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS3_9allocatorIS8_EEEENS0_12yaml_contextEPKcSF_EEvOT0_RT1_RT2_T3_iENKUlRT_E_clIS8_EEDaSO_:
 3308|   148k|            auto parse_element = [&](auto& element) {
 3309|   148k|               const char* element_start = (it != end) ? &*it : nullptr;
  ------------------
  |  Branch (3309:44): [True: 140k, False: 8.21k]
  ------------------
 3310|       |
 3311|       |               // Check what follows
 3312|   148k|               if (it != end && !yaml::line_end_or_comment_table[static_cast<uint8_t>(*it)]) {
  ------------------
  |  Branch (3312:20): [True: 140k, False: 8.21k]
  |  Branch (3312:33): [True: 74.3k, False: 65.9k]
  ------------------
 3313|       |                  // Content on same line as dash - set indent to one less than content column
 3314|       |                  // This allows nested block mappings to continue parsing keys at the content indent
 3315|       |                  // For "- key: val", if dash is at column 0, content is at column 2
 3316|       |                  // We set parent indent to 1 so keys at column 2 pass the "indent > parent" check
 3317|  74.3k|                  if (!ctx.push_indent(line_indent + 1)) [[unlikely]]
  ------------------
  |  Branch (3317:23): [True: 0, False: 74.3k]
  ------------------
 3318|      0|                     return;
 3319|  74.3k|                  const bool prev_sequence_item_value_context = ctx.sequence_item_value_context;
 3320|  74.3k|                  const int32_t prev_sequence_dash_indent = ctx.sequence_dash_indent;
 3321|  74.3k|                  ctx.sequence_item_value_context = true;
 3322|  74.3k|                  ctx.sequence_dash_indent = dash_col;
 3323|  74.3k|                  from<YAML, value_type>::template op<Opts>(element, ctx, it, end);
 3324|  74.3k|                  ctx.sequence_dash_indent = prev_sequence_dash_indent;
 3325|  74.3k|                  ctx.sequence_item_value_context = prev_sequence_item_value_context;
 3326|  74.3k|                  ctx.pop_indent();
 3327|  74.3k|               }
 3328|  74.1k|               else {
 3329|       |                  // Value on next line - nested block
 3330|  74.1k|                  skip_ws_and_comment(it, end);
 3331|  74.1k|                  skip_newline(it, end);
 3332|       |
 3333|       |                  // Get indent of nested content
 3334|  74.1k|                  auto nested_start = it;
 3335|  74.1k|                  int32_t nested_indent = measure_indent(it, end, ctx);
 3336|  74.1k|                  if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (3336:23): [True: 8, False: 74.1k]
  ------------------
 3337|      8|                     return;
 3338|  74.1k|                  it = nested_start;
 3339|       |
 3340|       |                  // Content is nested only if indented more than the current line.
 3341|       |                  // When line_indent is negative (root level), use 0 as the baseline.
 3342|       |                  // This prevents content at column 0 from being treated as nested.
 3343|  74.1k|                  const int32_t effective_line_indent = (line_indent < 0) ? 0 : line_indent;
  ------------------
  |  Branch (3343:57): [True: 3.20k, False: 70.9k]
  ------------------
 3344|  74.1k|                  if (nested_indent > effective_line_indent) {
  ------------------
  |  Branch (3344:23): [True: 29.4k, False: 44.6k]
  ------------------
 3345|       |                     // Save and set indent for nested parsing.
 3346|       |                     // A struct element reads the pushed indent as its own key column; every
 3347|       |                     // other element type reads it as the enclosing baseline, so it gets one
 3348|       |                     // less than the content indent and its content passes "indent > parent".
 3349|  29.4k|                     const int32_t element_indent =
 3350|  29.4k|                        receives_block_mapping_column<value_type>() ? nested_indent : nested_indent - 1;
  ------------------
  |  Branch (3350:25): [Folded, False: 29.4k]
  ------------------
 3351|  29.4k|                     if (!ctx.push_indent(element_indent)) [[unlikely]]
  ------------------
  |  Branch (3351:26): [True: 0, False: 29.4k]
  ------------------
 3352|      0|                        return;
 3353|  29.4k|                     const bool prev_sequence_item_value_context = ctx.sequence_item_value_context;
 3354|  29.4k|                     const int32_t prev_sequence_dash_indent = ctx.sequence_dash_indent;
 3355|  29.4k|                     ctx.sequence_item_value_context = true;
 3356|  29.4k|                     ctx.sequence_dash_indent = dash_col;
 3357|  29.4k|                     from<YAML, value_type>::template op<Opts>(element, ctx, it, end);
 3358|  29.4k|                     ctx.sequence_dash_indent = prev_sequence_dash_indent;
 3359|  29.4k|                     ctx.sequence_item_value_context = prev_sequence_item_value_context;
 3360|  29.4k|                     ctx.pop_indent();
 3361|  29.4k|                  }
 3362|       |                  // else: empty element (default constructed)
 3363|  74.1k|               }
 3364|       |
 3365|   148k|               if (has_pending_item_anchor && !bool(ctx.error)) {
  ------------------
  |  Branch (3365:20): [True: 15.3k, False: 133k]
  |  Branch (3365:47): [True: 15.2k, False: 80]
  ------------------
 3366|  15.2k|                  const char* element_end = (it != end) ? &*it : element_start;
  ------------------
  |  Branch (3366:45): [True: 13.5k, False: 1.70k]
  ------------------
 3367|  15.2k|                  ctx.anchors[std::move(pending_item_anchor_name)] = {element_start, element_end,
 3368|  15.2k|                                                                      pending_item_anchor_indent};
 3369|  15.2k|                  has_pending_item_anchor = false;
 3370|  15.2k|               }
 3371|   148k|            };
_ZN3glz29parse_block_mapping_or_stringINSt3__17variantIJDndNS1_12basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEbNS1_6vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS6_ISD_EEEENSC_ISD_EEEEETnDaXtlNS_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2EEERSH_RNSI_12yaml_contextERPKcSO_EEvOT1_OT2_OT3_T4_:
 5423|   542k|   {
 5424|       |      if constexpr (yaml::check_flow_context(Opts)) {
 5425|       |         // In flow context, only treat plain content as an implicit "key: value"
 5426|       |         // when a mapping separator appears before the next top-level flow delimiter.
 5427|       |         auto could_be_implicit_flow_pair = [&](auto pos) {
 5428|       |            // Bounded by the longest implicit key the spec allows: unbounded, this probe runs
 5429|       |            // once per entry per nesting level over the whole remaining flow collection.
 5430|       |            const auto stop = yaml::implicit_key_scan_end(pos, end);
 5431|       |            int depth = 0;
 5432|       |            while (pos != stop) {
 5433|       |               const char c = *pos;
 5434|       |               if (c == '"' || c == '\'') {
 5435|       |                  const char quote = c;
 5436|       |                  ++pos;
 5437|       |                  while (pos != stop && *pos != quote) {
 5438|       |                     if (*pos == '\\' && quote == '"') {
 5439|       |                        ++pos;
 5440|       |                        if (pos != stop) ++pos;
 5441|       |                     }
 5442|       |                     else {
 5443|       |                        ++pos;
 5444|       |                     }
 5445|       |                  }
 5446|       |                  if (pos != stop) ++pos;
 5447|       |                  continue;
 5448|       |               }
 5449|       |               if (c == '[' || c == '{') {
 5450|       |                  ++depth;
 5451|       |                  ++pos;
 5452|       |                  continue;
 5453|       |               }
 5454|       |               if (c == ']' || c == '}') {
 5455|       |                  if (depth == 0) return false;
 5456|       |                  --depth;
 5457|       |                  ++pos;
 5458|       |                  continue;
 5459|       |               }
 5460|       |               if (c == ',' && depth == 0) return false;
 5461|       |               if (c == ':' && depth == 0) {
 5462|       |                  auto next = pos + 1;
 5463|       |                  return next == end || *next == ' ' || *next == '\t' || *next == '\n' || *next == '\r';
 5464|       |               }
 5465|       |               ++pos;
 5466|       |            }
 5467|       |            return false;
 5468|       |         };
 5469|       |
 5470|       |         if (could_be_implicit_flow_pair(it) || line_could_be_flow_mapping(it, end)) {
 5471|       |            if (try_parse_block_mapping_into_variant<Variant, Opts>(value, ctx, it, end)) {
 5472|       |               return;
 5473|       |            }
 5474|       |            if (bool(ctx.error)) {
 5475|       |               return;
 5476|       |            }
 5477|       |         }
 5478|       |
 5479|       |         process_yaml_variant_alternatives<Variant, is_yaml_variant_str>::template op<Opts>(value, ctx, it, end);
 5480|       |         return;
 5481|       |      }
 5482|       |
 5483|   542k|      if (try_parse_block_mapping_into_variant<Variant, Opts>(value, ctx, it, end)) {
  ------------------
  |  Branch (5483:11): [True: 320k, False: 222k]
  ------------------
 5484|   320k|         return;
 5485|   320k|      }
 5486|       |      // If an error was set (e.g., malformed flow collection in value), don't try to parse as string
 5487|   222k|      if (bool(ctx.error)) {
  ------------------
  |  Branch (5487:11): [True: 12.6k, False: 209k]
  ------------------
 5488|  12.6k|         return;
 5489|  12.6k|      }
 5490|   209k|      process_yaml_variant_alternatives<Variant, is_yaml_variant_str>::template op<Opts>(value, ctx, it, end);
 5491|   209k|   }
_ZZN3glz4fromILj450ENSt3__17variantIJDndNS1_12basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEbNS1_6vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS6_ISD_EEEENSC_ISD_EEEEEE2opITnDaXtlNS_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2EEERPKcRSH_TkNS_10is_contextERNSK_12yaml_contextESN_EEvOT1_OT2_OT0_T3_ENKUlT_E0_clISN_EEDaSZ_:
 5848|  68.6k|            auto is_word_boundary = [&](const auto ptr) {
 5849|  68.6k|               if (ptr == end) {
  ------------------
  |  Branch (5849:20): [True: 2.04k, False: 66.5k]
  ------------------
 5850|  2.04k|                  return true;
 5851|  2.04k|               }
 5852|  66.5k|               if (*ptr == ':') {
  ------------------
  |  Branch (5852:20): [True: 46.4k, False: 20.0k]
  ------------------
 5853|  46.4k|                  auto next = ptr + 1;
 5854|  46.4k|                  return (next == end) || *next == ' ' || *next == '\t' || *next == '\n' || *next == '\r';
  ------------------
  |  Branch (5854:26): [True: 2.72k, False: 43.7k]
  |  Branch (5854:43): [True: 37.1k, False: 6.65k]
  |  Branch (5854:59): [True: 3.16k, False: 3.49k]
  |  Branch (5854:76): [True: 1.33k, False: 2.16k]
  |  Branch (5854:93): [True: 1.16k, False: 998]
  ------------------
 5855|  46.4k|               }
 5856|  20.0k|               return is_plain_scalar_boundary(*ptr);
 5857|  66.5k|            };
_ZZN3glz4fromILj450ENSt3__17variantIJDndNS1_12basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEbNS1_6vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS6_ISD_EEEENSC_ISD_EEEEEE2opITnDaXtlNS_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2EEERPKcRSH_TkNS_10is_contextERNSK_12yaml_contextESN_EEvOT1_OT2_OT0_T3_ENKUlcE_clEc:
 5774|  20.0k|            auto is_plain_scalar_boundary = [](const char ch) {
 5775|  20.0k|               switch (ch) {
 5776|    704|               case ' ':
  ------------------
  |  Branch (5776:16): [True: 704, False: 19.3k]
  ------------------
 5777|  1.44k|               case '\t':
  ------------------
  |  Branch (5777:16): [True: 745, False: 19.3k]
  ------------------
 5778|  9.31k|               case '\n':
  ------------------
  |  Branch (5778:16): [True: 7.86k, False: 12.1k]
  ------------------
 5779|  14.2k|               case '\r':
  ------------------
  |  Branch (5779:16): [True: 4.93k, False: 15.1k]
  ------------------
 5780|  14.9k|               case ',':
  ------------------
  |  Branch (5780:16): [True: 708, False: 19.3k]
  ------------------
 5781|  16.2k|               case ']':
  ------------------
  |  Branch (5781:16): [True: 1.27k, False: 18.7k]
  ------------------
 5782|  17.3k|               case '}':
  ------------------
  |  Branch (5782:16): [True: 1.12k, False: 18.9k]
  ------------------
 5783|  17.3k|                  return true;
 5784|  2.70k|               default:
  ------------------
  |  Branch (5784:16): [True: 2.70k, False: 17.3k]
  ------------------
 5785|  2.70k|                  return false;
 5786|  20.0k|               }
 5787|  20.0k|            };
_ZZN3glz4fromILj450ENSt3__17variantIJDndNS1_12basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEbNS1_6vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS6_ISD_EEEENSC_ISD_EEEEEE2opITnDaXtlNS_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2EEERPKcRSH_TkNS_10is_contextERNSK_12yaml_contextESN_EEvOT1_OT2_OT0_T3_ENKUlT_E_clISN_EEDaSZ_:
 5789|  64.8k|            auto has_indented_block_continuation = [&](auto word_end) {
 5790|       |               if constexpr (yaml::check_flow_context(Opts)) {
 5791|       |                  return false;
 5792|       |               }
 5793|  64.8k|               if (ctx.current_indent() < 0) {
  ------------------
  |  Branch (5793:20): [True: 3.55k, False: 61.3k]
  ------------------
 5794|  3.55k|                  return false;
 5795|  3.55k|               }
 5796|  61.3k|               if (word_end == end || (*word_end != '\n' && *word_end != '\r')) {
  ------------------
  |  Branch (5796:20): [True: 1.34k, False: 59.9k]
  |  Branch (5796:40): [True: 52.1k, False: 7.85k]
  |  Branch (5796:61): [True: 47.2k, False: 4.92k]
  ------------------
 5797|  48.5k|                  return false;
 5798|  48.5k|               }
 5799|       |
 5800|  12.7k|               auto look = word_end;
 5801|  12.7k|               yaml::skip_newline(look, end);
 5802|  38.1k|               while (look != end) {
  ------------------
  |  Branch (5802:23): [True: 36.6k, False: 1.54k]
  ------------------
 5803|  36.6k|                  int32_t line_indent = 0;
 5804|  65.2k|                  while (look != end && *look == ' ') {
  ------------------
  |  Branch (5804:26): [True: 64.7k, False: 558]
  |  Branch (5804:41): [True: 28.6k, False: 36.0k]
  ------------------
 5805|  28.6k|                     ++line_indent;
 5806|  28.6k|                     ++look;
 5807|  28.6k|                  }
 5808|  36.6k|                  if (look != end && *look == '\t') {
  ------------------
  |  Branch (5808:23): [True: 36.0k, False: 558]
  |  Branch (5808:38): [True: 791, False: 35.3k]
  ------------------
 5809|    791|                     return false;
 5810|    791|                  }
 5811|  35.8k|                  if (look == end || *look == '\n' || *look == '\r') {
  ------------------
  |  Branch (5811:23): [True: 558, False: 35.3k]
  |  Branch (5811:38): [True: 5.70k, False: 29.6k]
  |  Branch (5811:55): [True: 12.5k, False: 17.0k]
  ------------------
 5812|  18.8k|                     if (look != end) {
  ------------------
  |  Branch (5812:26): [True: 18.2k, False: 558]
  ------------------
 5813|  18.2k|                        yaml::skip_newline(look, end);
 5814|  18.2k|                        continue;
 5815|  18.2k|                     }
 5816|    558|                     return false;
 5817|  18.8k|                  }
 5818|  17.0k|                  if (*look == '#') {
  ------------------
  |  Branch (5818:23): [True: 7.23k, False: 9.77k]
  ------------------
 5819|  7.23k|                     yaml::skip_comment(look, end);
 5820|  7.23k|                     if (look != end && (*look == '\n' || *look == '\r')) {
  ------------------
  |  Branch (5820:26): [True: 7.11k, False: 115]
  |  Branch (5820:42): [True: 5.49k, False: 1.62k]
  |  Branch (5820:59): [True: 1.62k, False: 0]
  ------------------
 5821|  7.11k|                        yaml::skip_newline(look, end);
 5822|  7.11k|                        continue;
 5823|  7.11k|                     }
 5824|    115|                     return false;
 5825|  7.23k|                  }
 5826|       |
 5827|       |                  // If the next non-empty line is an implicit mapping entry,
 5828|       |                  // don't treat it as scalar continuation for auto-deduced
 5829|       |                  // booleans/nulls.
 5830|  9.77k|                  {
 5831|  9.77k|                     auto scan = look;
 5832|   828k|                     while (scan != end && *scan != '\n' && *scan != '\r') {
  ------------------
  |  Branch (5832:29): [True: 827k, False: 395]
  |  Branch (5832:44): [True: 826k, False: 1.56k]
  |  Branch (5832:61): [True: 825k, False: 597]
  ------------------
 5833|   825k|                        if (*scan == ':') {
  ------------------
  |  Branch (5833:29): [True: 64.7k, False: 760k]
  ------------------
 5834|  64.7k|                           auto after_colon = scan + 1;
 5835|  64.7k|                           if (after_colon == end || *after_colon == ' ' || *after_colon == '\t' ||
  ------------------
  |  Branch (5835:32): [True: 242, False: 64.5k]
  |  Branch (5835:54): [True: 3.00k, False: 61.5k]
  |  Branch (5835:77): [True: 2.83k, False: 58.6k]
  ------------------
 5836|  58.6k|                               *after_colon == '\n' || *after_colon == '\r') {
  ------------------
  |  Branch (5836:32): [True: 383, False: 58.3k]
  |  Branch (5836:56): [True: 752, False: 57.5k]
  ------------------
 5837|  7.22k|                              return false;
 5838|  7.22k|                           }
 5839|  64.7k|                        }
 5840|   818k|                        ++scan;
 5841|   818k|                     }
 5842|  9.77k|                  }
 5843|       |
 5844|  2.55k|                  return line_indent > ctx.current_indent();
 5845|  9.77k|               }
 5846|  1.54k|               return false;
 5847|  12.7k|            };
_ZN3glz36try_parse_block_mapping_into_variantINSt3__17variantIJDndNS1_12basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEbNS1_6vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS6_ISD_EEEENSC_ISD_EEEEETnDaXtlNS_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2EEERSH_RNSI_12yaml_contextERPKcSO_EEbOT1_OT2_OT3_T4_:
 5377|   641k|   {
 5378|   641k|      using counts = yaml_variant_type_count<Variant>;
 5379|       |      if constexpr (counts::n_object == 0) {
 5380|       |         return false;
 5381|       |      }
 5382|   641k|      else {
 5383|       |         // Quick check: if no viable mapping separator in the current span,
 5384|       |         // avoid expensive speculative parse.
 5385|   641k|         const bool could_be_mapping = [&] {
 5386|   641k|            if constexpr (yaml::check_flow_context(Opts)) {
 5387|   641k|               return line_could_be_flow_mapping(it, end);
 5388|   641k|            }
 5389|   641k|            else {
 5390|   641k|               return yaml::line_could_be_block_mapping(it, end);
 5391|   641k|            }
 5392|   641k|         }();
 5393|   641k|         if (!could_be_mapping) {
  ------------------
  |  Branch (5393:14): [True: 235k, False: 405k]
  ------------------
 5394|   235k|            return false;
 5395|   235k|         }
 5396|       |         // Full parse attempt - use a temporary context that inherits indent from parent
 5397|   405k|         auto temp_ctx = ctx.make_speculative();
 5398|   405k|         process_yaml_variant_alternatives<Variant, is_yaml_variant_object>::template op<Opts>(value, temp_ctx, it,
 5399|   405k|                                                                                               end);
 5400|   405k|         ctx.alias_expansion_budget = temp_ctx.alias_expansion_budget; // charged even if rejected
 5401|   405k|         ctx.key_expansion_budget = temp_ctx.key_expansion_budget;
 5402|   405k|         if (!bool(temp_ctx.error)) {
  ------------------
  |  Branch (5402:14): [True: 381k, False: 24.4k]
  ------------------
 5403|   381k|            ctx.anchors = std::move(temp_ctx.anchors);
 5404|   381k|            return true;
 5405|   381k|         }
 5406|       |         // The line matched "key: value" pattern but parsing failed.
 5407|       |         // This indicates malformed content (e.g., unclosed flow collection),
 5408|       |         // so propagate the error rather than silently falling back to string.
 5409|  24.4k|         ctx.error = temp_ctx.error;
 5410|  24.4k|         ctx.custom_error_message = temp_ctx.custom_error_message;
 5411|  24.4k|         return false;
 5412|   405k|      }
 5413|   641k|   }
_ZZN3glz36try_parse_block_mapping_into_variantINSt3__17variantIJDndNS1_12basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEbNS1_6vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS6_ISD_EEEENSC_ISD_EEEEETnDaXtlNS_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2EEERSH_RNSI_12yaml_contextERPKcSO_EEbOT1_OT2_OT3_T4_ENKUlvE_clEv:
 5385|   641k|         const bool could_be_mapping = [&] {
 5386|       |            if constexpr (yaml::check_flow_context(Opts)) {
 5387|       |               return line_could_be_flow_mapping(it, end);
 5388|       |            }
 5389|   641k|            else {
 5390|   641k|               return yaml::line_could_be_block_mapping(it, end);
 5391|   641k|            }
 5392|   641k|         }();
_ZZN3glz5parseILj450EE2opITnDaXtlNS_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2EEERNS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEETkNS_10is_contextERNS3_12yaml_contextERPKcSD_EEvOT0_OT1_OT2_T3_ENKUlT_E_clISD_EEDaSM_:
  145|    987|               auto is_document_start = [&](auto pos) {
  146|    987|                  if (end - pos >= 3 && pos[0] == '-' && pos[1] == '-' && pos[2] == '-') {
  ------------------
  |  Branch (146:23): [True: 642, False: 345]
  |  Branch (146:41): [True: 271, False: 371]
  |  Branch (146:58): [True: 237, False: 34]
  |  Branch (146:75): [True: 222, False: 15]
  ------------------
  147|    222|                     auto after = pos + 3;
  148|    222|                     return after == end || *after == ' ' || *after == '\t' || *after == '\n' || *after == '\r' ||
  ------------------
  |  Branch (148:29): [True: 12, False: 210]
  |  Branch (148:45): [True: 60, False: 150]
  |  Branch (148:62): [True: 93, False: 57]
  |  Branch (148:80): [True: 27, False: 30]
  |  Branch (148:98): [True: 20, False: 10]
  ------------------
  149|     10|                            *after == '#';
  ------------------
  |  Branch (149:29): [True: 2, False: 8]
  ------------------
  150|    222|                  }
  151|    765|                  return false;
  152|    987|               };
_ZN3glz9read_yamlITnDaXtlNS_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2EEERNS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEETkNS_10contiguousERNSt3__16vectorIcNS8_9allocatorIcEEEEEENS_9error_ctxEOT0_OT1_:
 6606|  37.0k|   {
 6607|  37.0k|      if (buffer.empty()) {
  ------------------
  |  Branch (6607:11): [True: 0, False: 37.0k]
  ------------------
 6608|      0|         using V = std::remove_cvref_t<T>;
 6609|      0|         if constexpr (requires { value = nullptr; }) {
 6610|      0|            value = nullptr;
 6611|      0|            return {};
 6612|       |         }
 6613|       |         else if constexpr (nullable_like<V>) {
 6614|       |            value = {};
 6615|       |            return {};
 6616|       |         }
 6617|      0|      }
 6618|      0|      yaml::yaml_context ctx{};
 6619|  37.0k|      return read<set_yaml<Opts>()>(std::forward<T>(value), std::forward<Buffer>(buffer), ctx);
 6620|  37.0k|   }
_ZN3glz5parseILj450EE2opITnDaXtlNS_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj32EEERNS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEETkNS_10is_contextERNS3_12yaml_contextERPKcSD_EEvOT0_OT1_OT2_T3_:
   69|  37.0k|      {
   70|  37.0k|         if constexpr (requires { ctx.stream_begin; }) {
   71|  37.0k|            if (!ctx.stream_begin && it != end) {
  ------------------
  |  Branch (71:17): [True: 37.0k, False: 0]
  |  Branch (71:38): [True: 37.0k, False: 0]
  ------------------
   72|  37.0k|               ctx.stream_begin = &*it;
   73|       |               // The line memo holds pointers into whatever buffer filled it, so a reused
   74|       |               // context must not carry a previous read's into this one.
   75|  37.0k|               if constexpr (requires { ctx.reset_line_memo(); }) {
   76|  37.0k|                  ctx.reset_line_memo();
   77|  37.0k|               }
   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|  37.0k|               if constexpr (requires { ctx.alias_expansion_budget; } && requires { size_t(end - it); }) {
   82|  37.0k|                  const size_t scaled = size_t(end - it) * yaml::max_alias_expansion_factor;
   83|  37.0k|                  ctx.alias_expansion_budget =
   84|  37.0k|                     scaled > yaml::min_alias_expansion_bytes ? scaled : yaml::min_alias_expansion_bytes;
  ------------------
  |  Branch (84:22): [True: 256, False: 36.7k]
  ------------------
   85|  37.0k|               }
   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|  37.0k|               if constexpr (requires { ctx.key_expansion_budget; } && requires { size_t(end - it); }) {
   89|  37.0k|                  const size_t scaled = size_t(end - it) * yaml::max_key_expansion_factor;
   90|  37.0k|                  ctx.key_expansion_budget =
   91|  37.0k|                     scaled > yaml::min_key_expansion_bytes ? scaled : yaml::min_key_expansion_bytes;
  ------------------
  |  Branch (91:22): [True: 256, False: 36.7k]
  ------------------
   92|  37.0k|               }
   93|  37.0k|            }
   94|  37.0k|         }
   95|       |         // Skip YAML directives and document start marker (---) if present
   96|  37.0k|         yaml::skip_document_start(it, end, ctx);
   97|  37.0k|         if (bool(ctx.error)) [[unlikely]] {
  ------------------
  |  Branch (97:14): [True: 268, False: 36.7k]
  ------------------
   98|    268|            return;
   99|    268|         }
  100|       |
  101|  36.7k|         using V = std::remove_cvref_t<T>;
  102|  36.7k|         if (it == end) {
  ------------------
  |  Branch (102:14): [True: 16, False: 36.7k]
  ------------------
  103|       |            // An empty document is a valid YAML null document.
  104|     16|            if constexpr (requires { value = nullptr; }) {
  105|     16|               value = nullptr;
  106|     16|               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|     16|         }
  117|       |
  118|       |         // A bare document boundary marker at root denotes an empty document.
  119|       |         // Examples: "---\n---\n", "# comment\n...\n"
  120|  36.7k|         if (yaml::at_document_start(it, end) || yaml::at_document_end(it, end)) {
  ------------------
  |  Branch (120:14): [True: 22, False: 36.7k]
  |  Branch (120:50): [True: 2, False: 36.7k]
  ------------------
  121|      8|            if constexpr (requires { value = nullptr; }) {
  122|      8|               value = nullptr;
  123|      8|               return;
  124|       |            }
  125|       |            else if constexpr (nullable_like<V>) {
  126|       |               value = {};
  127|       |               return;
  128|       |            }
  129|       |            else {
  130|       |               ctx.error = error_code::unexpected_end;
  131|       |               return;
  132|       |            }
  133|      8|         }
  134|       |
  135|      0|         from<YAML, V>::template op<Opts>(std::forward<T>(value), std::forward<Ctx>(ctx), std::forward<It0>(it), end);
  136|       |
  137|       |         // A directive line (%YAML/%TAG/...) is only valid in the document prefix.
  138|       |         // If parsing stopped before the end and we encounter a directive in the
  139|       |         // remaining tail, treat it as malformed stream structure. This is a document-level
  140|       |         // concern, so only enforce it at the document root: a nested call (e.g. a tagged
  141|       |         // variant handing a custom alternative its body) is mid-document and its tail
  142|       |         // belongs to an enclosing node, not this value.
  143|  36.7k|         if constexpr (!check_partial_read(Opts)) {
  144|  36.7k|            if (!bool(ctx.error) && ctx.current_indent() < 0) {
  ------------------
  |  Branch (144:17): [True: 6.06k, False: 30.7k]
  |  Branch (144:37): [True: 6.06k, False: 0]
  ------------------
  145|  6.06k|               auto is_document_start = [&](auto pos) {
  146|  6.06k|                  if (end - pos >= 3 && pos[0] == '-' && pos[1] == '-' && pos[2] == '-') {
  147|  6.06k|                     auto after = pos + 3;
  148|  6.06k|                     return after == end || *after == ' ' || *after == '\t' || *after == '\n' || *after == '\r' ||
  149|  6.06k|                            *after == '#';
  150|  6.06k|                  }
  151|  6.06k|                  return false;
  152|  6.06k|               };
  153|       |
  154|       |               // The scan below reads the tail a line at a time, which only means anything if the
  155|       |               // tail starts at one. A root node can stop mid-line -- a plain scalar ends at a
  156|       |               // ':' it is not allowed to take as a separator, a flow collection ends at its
  157|       |               // bracket -- and what sits after it there is leftover content on that line, not
  158|       |               // the opening of a new one. Only inline whitespace and a comment may follow. Let
  159|       |               // the line scan see anything else and it misreads it: a leftover ':' passes as an
  160|       |               // explicit-key continuation and the remainder of the document falls on the floor.
  161|  6.06k|               if constexpr (requires { ctx.line_prefix_before(it); }) {
  162|  6.06k|                  if (it != end && ctx.line_prefix_before(it).has_content) {
  ------------------
  |  Branch (162:23): [True: 1.38k, False: 4.68k]
  |  Branch (162:23): [True: 884, False: 5.18k]
  |  Branch (162:36): [True: 884, False: 497]
  ------------------
  163|    884|                     auto rest = it;
  164|  3.45k|                     while (rest != end && (*rest == ' ' || *rest == '\t')) ++rest;
  ------------------
  |  Branch (164:29): [True: 3.45k, False: 0]
  |  Branch (164:45): [True: 704, False: 2.74k]
  |  Branch (164:61): [True: 1.86k, False: 884]
  ------------------
  165|    884|                     if (rest != end && *rest != '\n' && *rest != '\r' && *rest != '#') {
  ------------------
  |  Branch (165:26): [True: 884, False: 0]
  |  Branch (165:41): [True: 726, False: 158]
  |  Branch (165:58): [True: 591, False: 135]
  |  Branch (165:75): [True: 513, False: 78]
  ------------------
  166|    513|                        ctx.error = error_code::syntax_error;
  167|    513|                        return;
  168|    513|                     }
  169|    884|                  }
  170|  6.06k|               }
  171|       |
  172|  5.55k|               auto tail_scan = it;
  173|  6.06k|               bool seen_document_end_marker = false;
  174|  13.3k|               while (tail_scan != end) {
  ------------------
  |  Branch (174:23): [True: 8.02k, False: 5.31k]
  ------------------
  175|  8.02k|                  auto line = tail_scan;
  176|  10.8k|                  while (line != end && (*line == ' ' || *line == '\t')) ++line;
  ------------------
  |  Branch (176:26): [True: 10.8k, False: 0]
  |  Branch (176:42): [True: 2.43k, False: 8.45k]
  |  Branch (176:58): [True: 430, False: 8.02k]
  ------------------
  177|  8.02k|                  if (line != tail_scan && line != end && *line != '\n' && *line != '\r' && *line != '#') {
  ------------------
  |  Branch (177:23): [True: 1.25k, False: 6.76k]
  |  Branch (177:44): [True: 1.25k, False: 0]
  |  Branch (177:59): [True: 886, False: 370]
  |  Branch (177:76): [True: 552, False: 334]
  |  Branch (177:93): [True: 126, False: 426]
  ------------------
  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|    126|                     const char first = *line;
  182|    126|                     const bool explicit_or_structural_start =
  183|    126|                        (first == ':' || first == '?' || first == '!' || first == '&' || first == '*' || first == '[' ||
  ------------------
  |  Branch (183:26): [True: 7, False: 119]
  |  Branch (183:42): [True: 2, False: 117]
  |  Branch (183:58): [True: 2, False: 115]
  |  Branch (183:74): [True: 2, False: 113]
  |  Branch (183:90): [True: 5, False: 108]
  |  Branch (183:106): [True: 2, False: 106]
  ------------------
  184|    106|                         first == '{' || first == '"' || first == '\'' || first == '-');
  ------------------
  |  Branch (184:26): [True: 1, False: 105]
  |  Branch (184:42): [True: 2, False: 103]
  |  Branch (184:58): [True: 1, False: 102]
  |  Branch (184:75): [True: 8, False: 94]
  ------------------
  185|    126|                     if (!explicit_or_structural_start) {
  ------------------
  |  Branch (185:26): [True: 94, False: 32]
  ------------------
  186|     94|                        auto scan = line;
  187|  1.17k|                        while (scan != end && *scan != '\n' && *scan != '\r') {
  ------------------
  |  Branch (187:32): [True: 1.11k, False: 65]
  |  Branch (187:47): [True: 1.10k, False: 8]
  |  Branch (187:64): [True: 1.10k, False: 3]
  ------------------
  188|  1.10k|                           if (*scan == ':') {
  ------------------
  |  Branch (188:32): [True: 306, False: 796]
  ------------------
  189|    306|                              auto after = scan + 1;
  190|    306|                              if (after == end || *after == ' ' || *after == '\t' || *after == '\n' || *after == '\r') {
  ------------------
  |  Branch (190:35): [True: 0, False: 306]
  |  Branch (190:51): [True: 4, False: 302]
  |  Branch (190:68): [True: 4, False: 298]
  |  Branch (190:86): [True: 4, False: 294]
  |  Branch (190:104): [True: 6, False: 288]
  ------------------
  191|     18|                                 ctx.error = error_code::syntax_error;
  192|     18|                                 return;
  193|     18|                              }
  194|    306|                           }
  195|  1.08k|                           ++scan;
  196|  1.08k|                        }
  197|     94|                     }
  198|    108|                     return;
  199|    126|                  }
  200|  7.89k|                  if (line == end) {
  ------------------
  |  Branch (200:23): [True: 0, False: 7.89k]
  ------------------
  201|      0|                     return;
  202|      0|                  }
  203|  7.89k|                  if (*line == ':' || *line == '?') {
  ------------------
  |  Branch (203:23): [True: 20, False: 7.87k]
  |  Branch (203:39): [True: 12, False: 7.86k]
  ------------------
  204|     32|                     return; // Explicit key/value continuation.
  205|     32|                  }
  206|  7.86k|                  if (*line == '\n' || *line == '\r') {
  ------------------
  |  Branch (206:23): [True: 3.28k, False: 4.57k]
  |  Branch (206:40): [True: 2.05k, False: 2.52k]
  ------------------
  207|  5.33k|                     tail_scan = line;
  208|  5.33k|                     yaml::skip_newline(tail_scan, end);
  209|  5.33k|                     continue;
  210|  5.33k|                  }
  211|  2.52k|                  if (*line == '#') {
  ------------------
  |  Branch (211:23): [True: 1.31k, False: 1.21k]
  ------------------
  212|  11.1k|                     while (tail_scan != end && *tail_scan != '\n' && *tail_scan != '\r') ++tail_scan;
  ------------------
  |  Branch (212:29): [True: 11.0k, False: 87]
  |  Branch (212:49): [True: 10.5k, False: 484]
  |  Branch (212:71): [True: 9.80k, False: 739]
  ------------------
  213|  1.31k|                     yaml::skip_newline(tail_scan, end);
  214|  1.31k|                     continue;
  215|  1.31k|                  }
  216|  1.21k|                  if (yaml::at_document_end(line, end)) {
  ------------------
  |  Branch (216:23): [True: 617, False: 600]
  ------------------
  217|    617|                     seen_document_end_marker = true;
  218|  8.47k|                     while (tail_scan != end && *tail_scan != '\n' && *tail_scan != '\r') ++tail_scan;
  ------------------
  |  Branch (218:29): [True: 8.44k, False: 23]
  |  Branch (218:49): [True: 8.10k, False: 347]
  |  Branch (218:71): [True: 7.85k, False: 247]
  ------------------
  219|    617|                     yaml::skip_newline(tail_scan, end);
  220|    617|                     continue;
  221|    617|                  }
  222|    600|                  if (is_document_start(line)) {
  ------------------
  |  Branch (222:23): [True: 100, False: 500]
  ------------------
  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|    100|                     auto header = line + 3;
  228|    734|                     while (header != end && (*header == ' ' || *header == '\t')) ++header;
  ------------------
  |  Branch (228:29): [True: 734, False: 0]
  |  Branch (228:47): [True: 331, False: 403]
  |  Branch (228:65): [True: 303, False: 100]
  ------------------
  229|    100|                     if (header != end && *header == '!') {
  ------------------
  |  Branch (229:26): [True: 100, False: 0]
  |  Branch (229:43): [True: 37, False: 63]
  ------------------
  230|     37|                        auto tag_end = header + 1;
  231|  43.7k|                        while (tag_end != end && *tag_end != ' ' && *tag_end != '\t' && *tag_end != '\n' &&
  ------------------
  |  Branch (231:32): [True: 43.7k, False: 9]
  |  Branch (231:50): [True: 43.7k, False: 12]
  |  Branch (231:69): [True: 43.7k, False: 6]
  |  Branch (231:89): [True: 43.7k, False: 6]
  ------------------
  232|  43.7k|                               *tag_end != '\r' && *tag_end != '#') {
  ------------------
  |  Branch (232:32): [True: 43.7k, False: 2]
  |  Branch (232:52): [True: 43.7k, False: 2]
  ------------------
  233|  43.7k|                           ++tag_end;
  234|  43.7k|                        }
  235|     37|                        std::string_view tag_token(header, static_cast<size_t>(tag_end - header));
  236|     37|                        const auto second_bang = tag_token.find('!', 1);
  237|     37|                        if (second_bang != std::string_view::npos) {
  ------------------
  |  Branch (237:29): [True: 18, False: 19]
  ------------------
  238|     18|                           std::string_view handle = tag_token.substr(0, second_bang + 1);
  239|     18|                           if (handle != "!" && handle != "!!") {
  ------------------
  |  Branch (239:32): [True: 18, False: 0]
  |  Branch (239:49): [True: 17, False: 1]
  ------------------
  240|     17|                              ctx.error = error_code::syntax_error;
  241|     17|                              return;
  242|     17|                           }
  243|     18|                        }
  244|     37|                     }
  245|     83|                     return; // Additional documents are allowed in the stream tail.
  246|    100|                  }
  247|    500|                  if (line != end && *line == '%') {
  ------------------
  |  Branch (247:23): [True: 500, False: 0]
  |  Branch (247:38): [True: 10, False: 490]
  ------------------
  248|       |                     // YAML directives are only valid in document prefixes. A directive
  249|       |                     // encountered mid-document (without a prior ...) is malformed.
  250|     10|                     if (!seen_document_end_marker) {
  ------------------
  |  Branch (250:26): [True: 6, False: 4]
  ------------------
  251|      6|                        ctx.error = error_code::syntax_error;
  252|      6|                        return;
  253|      6|                     }
  254|      4|                     return;
  255|     10|                  }
  256|    490|                  if (seen_document_end_marker) {
  ------------------
  |  Branch (256:23): [True: 59, False: 431]
  ------------------
  257|     59|                     return; // Implicit next document after explicit document end marker.
  258|     59|                  }
  259|    431|                  ctx.error = error_code::syntax_error;
  260|    431|                  return;
  261|    490|               }
  262|  6.06k|            }
  263|  36.7k|         }
  264|  36.7k|      }
_ZN3glz4fromILj450ENS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEEE2opITnDaXtlNS_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj32EEERS4_TkNS_10is_contextERNS7_12yaml_contextERPKcSD_EEvOT0_OT1_OT2_T3_:
  274|   673k|      {
  275|   673k|         using V = std::decay_t<decltype(get_member(std::declval<Value>(), meta_wrapper_v<T>))>;
  276|   673k|         from<YAML, V>::template op<Opts>(get_member(std::forward<Value>(value), meta_wrapper_v<T>),
  277|   673k|                                          std::forward<Ctx>(ctx), std::forward<It0>(it), end);
  278|   673k|      }
_ZN3glz4fromILj450ENSt3__17variantIJDndNS1_12basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEbNS1_6vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS6_ISD_EEEENSC_ISD_EEEEEE2opITnDaXtlNS_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj32EEERPKcRSH_TkNS_10is_contextERNSK_12yaml_contextESN_EEvOT1_OT2_OT0_T3_:
 5635|   874k|      {
 5636|       |         // Inside op() rather than at class scope: read_supported is `requires { from<Format, T>{}; }`,
 5637|       |         // so a class-scope assert turns that feature probe into a hard error instead of `false`.
 5638|   874k|         static_assert(content_v<std::remove_cvref_t<T>>.empty(),
 5639|   874k|                       "Adjacent variant tagging (glz::meta `content`) is implemented for JSON and "
 5640|   874k|                       "BEVE but not yet for YAML. Reading this variant as YAML would silently expect "
 5641|   874k|                       "the internally tagged shape, so it is rejected here instead.");
 5642|   874k|         if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (5642:14): [True: 0, False: 874k]
  ------------------
 5643|      0|            return;
 5644|       |
 5645|       |         // Every nested generic/variant value routes back through this reader, so bounding
 5646|       |         // depth here caps flow-collection and flow-embedded mapping recursion that the
 5647|       |         // indent stack does not cover.
 5648|   874k|         depth_guard guard{ctx, yaml::max_yaml_recursive_depth};
 5649|   874k|         if (!guard) [[unlikely]]
  ------------------
  |  Branch (5649:14): [True: 38, False: 874k]
  ------------------
 5650|     38|            return;
 5651|       |
 5652|       |         // At root level (indent == -1), skip leading whitespace, newlines, and comments
 5653|       |         // For nested values, only skip inline whitespace to preserve block structure
 5654|   874k|         if (ctx.current_indent() < 0) {
  ------------------
  |  Branch (5654:14): [True: 114k, False: 760k]
  ------------------
 5655|   114k|            yaml::skip_ws_newlines_comments(it, end);
 5656|   114k|         }
 5657|   760k|         else {
 5658|   760k|            yaml::skip_inline_ws(it, end);
 5659|   760k|         }
 5660|       |
 5661|   874k|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (5661:14): [True: 32, False: 874k]
  ------------------
 5662|     32|            ctx.error = error_code::unexpected_end;
 5663|     32|            return;
 5664|     32|         }
 5665|       |
 5666|       |         // Tagged variants: a discriminator key (meta::tag) selects the alternative, with the
 5667|       |         // matching meta::ids entry naming each type. This mirrors the JSON behavior so the
 5668|       |         // same variant definitions round-trip across both formats.
 5669|       |         if constexpr (not tag_v<std::remove_cvref_t<T>>.empty()) {
 5670|       |            using V = std::remove_cvref_t<T>;
 5671|       |            const bool value_is_mapping =
 5672|       |               (*it == '{') || (!yaml::check_flow_context(Opts) && yaml::line_could_be_block_mapping(it, end));
 5673|       |            if (value_is_mapping) {
 5674|       |               // The mapping's keys sit at the column of `it`. Recover that column from the buffer:
 5675|       |               // the indent stack carries the parent context's indent (a struct member, a sequence
 5676|       |               // item, etc. each push a different offset), not this mapping's true column (see helper).
 5677|       |               const int32_t mapping_column = tagged_mapping_visual_indent(ctx, it, ctx.current_indent() + 1);
 5678|       |               auto tag_ctx = ctx.make_speculative();
 5679|       |               const size_t index = scan_variant_tag_index<V, Opts>(tag_ctx, it, end, mapping_column);
 5680|       |               ctx.alias_expansion_budget = tag_ctx.alias_expansion_budget; // charged even if no tag matched
 5681|       |               ctx.key_expansion_budget = tag_ctx.key_expansion_budget;
 5682|       |               if (index < ids_v<V>.size()) {
 5683|       |                  static constexpr auto tag_literal = string_literal_from_view<tag_v<V>.size()>(tag_v<V>);
 5684|       |                  emplace_runtime_variant(value, index);
 5685|       |                  // Establish the mapping's true column on the indent stack for the alternative parse.
 5686|       |                  // The chosen object is then parsed - and the discriminator's inline value skipped -
 5687|       |                  // at a consistent indent in every context, so a tag on the first key does not fold
 5688|       |                  // the following sibling entries into its value (no special-casing needed downstream).
 5689|       |                  if (!ctx.push_indent(mapping_column)) [[unlikely]] {
 5690|       |                     ctx.error = error_code::exceeded_max_recursive_depth;
 5691|       |                     return;
 5692|       |                  }
 5693|       |                  std::visit(
 5694|       |                     [&](auto&& alt) {
 5695|       |                        using Alt = std::remove_cvref_t<decltype(alt)>;
 5696|       |                        if constexpr ((glaze_object_t<Alt> || reflectable<Alt>) && not custom_read<Alt>) {
 5697|       |                           // Parse the mapping into the resolved struct; the tag key is skipped.
 5698|       |                           from<YAML, Alt>::template op<Opts, tag_literal>(alt, ctx, it, end);
 5699|       |                        }
 5700|       |                        else if constexpr (custom_read<Alt>) {
 5701|       |                           // Custom alternatives read the mapping body themselves and cannot skip an
 5702|       |                           // interior tag key the way reflected objects do, so the tag must be the
 5703|       |                           // first key (glaze always writes it first). Consume that leading "tag: id"
 5704|       |                           // entry, then hand the remaining mapping to the custom handler.
 5705|       |                           if constexpr (yaml::check_flow_context(Opts)) {
 5706|       |                              ctx.error = error_code::feature_not_supported;
 5707|       |                              ctx.custom_error_message =
 5708|       |                                 "custom variant alternatives are not supported in YAML flow style";
 5709|       |                           }
 5710|       |                           else {
 5711|       |                              ctx.scratch.clear();
 5712|       |                              if (yaml::parse_yaml_key(ctx.scratch, ctx, it, end, false)) {
 5713|       |                                 if (std::string_view{ctx.scratch} != tag_v<V>) {
 5714|       |                                    ctx.error = error_code::feature_not_supported;
 5715|       |                                    ctx.custom_error_message =
 5716|       |                                       "the tag must be the first key for a custom variant alternative";
 5717|       |                                 }
 5718|       |                                 else {
 5719|       |                                    yaml::skip_inline_ws(it, end);
 5720|       |                                    if (it == end || *it != ':') {
 5721|       |                                       ctx.error = error_code::syntax_error;
 5722|       |                                    }
 5723|       |                                    else {
 5724|       |                                       ++it;
 5725|       |                                       yaml::skip_inline_ws(it, end);
 5726|       |                                       yaml::skip_unknown_block_value<Opts>(ctx, it, end, mapping_column);
 5727|       |                                       if (!bool(ctx.error)) {
 5728|       |                                          // If nothing but trailing whitespace/comments remains, the tag
 5729|       |                                          // was the whole mapping: leave the alternative default.
 5730|       |                                          auto probe = it;
 5731|       |                                          yaml::skip_ws_newlines_comments(probe, end);
 5732|       |                                          if (probe == end) {
 5733|       |                                             it = probe;
 5734|       |                                          }
 5735|       |                                          else {
 5736|       |                                             // Publish the mapping's column so the custom handler's block
 5737|       |                                             // mapping (which would otherwise discover its own indent) reads
 5738|       |                                             // the remaining entries at the variant's indent and dedents
 5739|       |                                             // correctly in every context (root, sequence, nested).
 5740|       |                                             ctx.forced_block_mapping_indent = mapping_column;
 5741|       |                                             from<YAML, Alt>::template op<Opts>(alt, ctx, it, end);
 5742|       |                                             ctx.forced_block_mapping_indent = -1;
 5743|       |                                          }
 5744|       |                                       }
 5745|       |                                    }
 5746|       |                                 }
 5747|       |                              }
 5748|       |                           }
 5749|       |                        }
 5750|       |                        else {
 5751|       |                           // Non-object alternative (e.g. std::monostate): the emplaced default is
 5752|       |                           // the value, but the mapping must still be consumed.
 5753|       |                           walk_tagged_mapping<Opts>(
 5754|       |                              ctx, it, end, tag_v<V>, mapping_column,
 5755|       |                              [&](auto&& c, auto&& i, auto&& e, int32_t line_indent, bool in_flow) {
 5756|       |                                 yaml::skip_yaml_value<Opts>(c, i, e, in_flow ? 0 : line_indent, in_flow);
 5757|       |                              });
 5758|       |                        }
 5759|       |                     },
 5760|       |                     value);
 5761|       |                  ctx.pop_indent();
 5762|       |                  return;
 5763|       |               }
 5764|       |               // No resolvable tag key was found. Fall through to structural deduction:
 5765|       |               // if the alternatives are distinguishable by their fields this still succeeds,
 5766|       |               // otherwise the deduction path reports no_matching_variant_type.
 5767|       |            }
 5768|       |         }
 5769|       |
 5770|   874k|         if constexpr (yaml_variant_is_auto_deducible<std::remove_cvref_t<T>>()) {
 5771|   874k|            using V = std::remove_cvref_t<T>;
 5772|   874k|            using counts = yaml_variant_type_count<V>;
 5773|   874k|            const char c = *it;
 5774|   874k|            auto is_plain_scalar_boundary = [](const char ch) {
 5775|   874k|               switch (ch) {
 5776|   874k|               case ' ':
 5777|   874k|               case '\t':
 5778|   874k|               case '\n':
 5779|   874k|               case '\r':
 5780|   874k|               case ',':
 5781|   874k|               case ']':
 5782|   874k|               case '}':
 5783|   874k|                  return true;
 5784|   874k|               default:
 5785|   874k|                  return false;
 5786|   874k|               }
 5787|   874k|            };
 5788|       |
 5789|   874k|            auto has_indented_block_continuation = [&](auto word_end) {
 5790|   874k|               if constexpr (yaml::check_flow_context(Opts)) {
 5791|   874k|                  return false;
 5792|   874k|               }
 5793|   874k|               if (ctx.current_indent() < 0) {
 5794|   874k|                  return false;
 5795|   874k|               }
 5796|   874k|               if (word_end == end || (*word_end != '\n' && *word_end != '\r')) {
 5797|   874k|                  return false;
 5798|   874k|               }
 5799|       |
 5800|   874k|               auto look = word_end;
 5801|   874k|               yaml::skip_newline(look, end);
 5802|   874k|               while (look != end) {
 5803|   874k|                  int32_t line_indent = 0;
 5804|   874k|                  while (look != end && *look == ' ') {
 5805|   874k|                     ++line_indent;
 5806|   874k|                     ++look;
 5807|   874k|                  }
 5808|   874k|                  if (look != end && *look == '\t') {
 5809|   874k|                     return false;
 5810|   874k|                  }
 5811|   874k|                  if (look == end || *look == '\n' || *look == '\r') {
 5812|   874k|                     if (look != end) {
 5813|   874k|                        yaml::skip_newline(look, end);
 5814|   874k|                        continue;
 5815|   874k|                     }
 5816|   874k|                     return false;
 5817|   874k|                  }
 5818|   874k|                  if (*look == '#') {
 5819|   874k|                     yaml::skip_comment(look, end);
 5820|   874k|                     if (look != end && (*look == '\n' || *look == '\r')) {
 5821|   874k|                        yaml::skip_newline(look, end);
 5822|   874k|                        continue;
 5823|   874k|                     }
 5824|   874k|                     return false;
 5825|   874k|                  }
 5826|       |
 5827|       |                  // If the next non-empty line is an implicit mapping entry,
 5828|       |                  // don't treat it as scalar continuation for auto-deduced
 5829|       |                  // booleans/nulls.
 5830|   874k|                  {
 5831|   874k|                     auto scan = look;
 5832|   874k|                     while (scan != end && *scan != '\n' && *scan != '\r') {
 5833|   874k|                        if (*scan == ':') {
 5834|   874k|                           auto after_colon = scan + 1;
 5835|   874k|                           if (after_colon == end || *after_colon == ' ' || *after_colon == '\t' ||
 5836|   874k|                               *after_colon == '\n' || *after_colon == '\r') {
 5837|   874k|                              return false;
 5838|   874k|                           }
 5839|   874k|                        }
 5840|   874k|                        ++scan;
 5841|   874k|                     }
 5842|   874k|                  }
 5843|       |
 5844|   874k|                  return line_indent > ctx.current_indent();
 5845|   874k|               }
 5846|   874k|               return false;
 5847|   874k|            };
 5848|   874k|            auto is_word_boundary = [&](const auto ptr) {
 5849|   874k|               if (ptr == end) {
 5850|   874k|                  return true;
 5851|   874k|               }
 5852|   874k|               if (*ptr == ':') {
 5853|   874k|                  auto next = ptr + 1;
 5854|   874k|                  return (next == end) || *next == ' ' || *next == '\t' || *next == '\n' || *next == '\r';
 5855|   874k|               }
 5856|   874k|               return is_plain_scalar_boundary(*ptr);
 5857|   874k|            };
 5858|       |
 5859|   874k|            switch (c) {
 5860|   159k|            case '&': {
  ------------------
  |  Branch (5860:13): [True: 159k, False: 714k]
  ------------------
 5861|       |               // Anchor before value: parse name, then re-dispatch
 5862|   159k|               ++it;
 5863|   159k|               auto aname = yaml::parse_anchor_name(it, end);
 5864|   159k|               if (aname.empty()) {
  ------------------
  |  Branch (5864:20): [True: 66, False: 159k]
  ------------------
 5865|     66|                  ctx.error = error_code::syntax_error;
 5866|     66|                  return;
 5867|     66|               }
 5868|   159k|               yaml::skip_inline_ws(it, end);
 5869|   159k|               bool anchor_on_same_line = true;
 5870|   159k|               bool value_is_indentless_sequence = false;
 5871|   159k|               if (it == end || *it == '\n' || *it == '\r' || *it == '#') {
  ------------------
  |  Branch (5871:20): [True: 2.98k, False: 156k]
  |  Branch (5871:33): [True: 16.3k, False: 140k]
  |  Branch (5871:48): [True: 14.8k, False: 125k]
  |  Branch (5871:63): [True: 5.04k, False: 120k]
  ------------------
 5872|       |                  // Anchor followed by end-of-line. Check if the value continues on the
 5873|       |                  // next line (indented past current context) or if this is an empty node.
 5874|  39.2k|                  bool value_on_next_line = false;
 5875|  39.2k|                  if (it != end) {
  ------------------
  |  Branch (5875:23): [True: 36.2k, False: 2.98k]
  ------------------
 5876|  36.2k|                     auto peek = it;
 5877|       |                     // Skip comment if present
 5878|  36.2k|                     if (*peek == '#') {
  ------------------
  |  Branch (5878:26): [True: 5.04k, False: 31.2k]
  ------------------
 5879|  1.59M|                        while (peek != end && *peek != '\n' && *peek != '\r') ++peek;
  ------------------
  |  Branch (5879:32): [True: 1.59M, False: 410]
  |  Branch (5879:47): [True: 1.59M, False: 2.12k]
  |  Branch (5879:64): [True: 1.58M, False: 2.51k]
  ------------------
 5880|  5.04k|                     }
 5881|       |                     // Skip newline
 5882|  36.2k|                     if (peek != end && (*peek == '\n' || *peek == '\r')) {
  ------------------
  |  Branch (5882:26): [True: 35.8k, False: 410]
  |  Branch (5882:42): [True: 18.4k, False: 17.4k]
  |  Branch (5882:59): [True: 17.4k, False: 0]
  ------------------
 5883|  35.8k|                        yaml::skip_newline(peek, end);
 5884|       |                        // Skip blank lines
 5885|  62.2k|                        while (peek != end && (*peek == '\n' || *peek == '\r')) {
  ------------------
  |  Branch (5885:32): [True: 57.1k, False: 5.11k]
  |  Branch (5885:48): [True: 1.62k, False: 55.5k]
  |  Branch (5885:65): [True: 24.7k, False: 30.7k]
  ------------------
 5886|  26.4k|                           yaml::skip_newline(peek, end);
 5887|  26.4k|                        }
 5888|       |                        // Measure indent of next content line
 5889|  35.8k|                        int32_t next_indent = 0;
 5890|  58.9k|                        while (peek != end && *peek == ' ') {
  ------------------
  |  Branch (5890:32): [True: 53.5k, False: 5.33k]
  |  Branch (5890:47): [True: 23.0k, False: 30.5k]
  ------------------
 5891|  23.0k|                           ++next_indent;
 5892|  23.0k|                           ++peek;
 5893|  23.0k|                        }
 5894|  35.8k|                        if (peek != end && *peek != '\n' && *peek != '\r') {
  ------------------
  |  Branch (5894:29): [True: 30.5k, False: 5.33k]
  |  Branch (5894:44): [True: 30.2k, False: 296]
  |  Branch (5894:61): [True: 29.7k, False: 454]
  ------------------
 5895|  29.7k|                           const bool indentless_sequence =
 5896|  29.7k|                              (!ctx.sequence_item_value_context) && (*peek == '-') &&
  ------------------
  |  Branch (5896:31): [True: 26.5k, False: 3.17k]
  |  Branch (5896:69): [True: 14.9k, False: 11.6k]
  ------------------
 5897|  14.9k|                              ((peek + 1) == end ||
  ------------------
  |  Branch (5897:32): [True: 497, False: 14.4k]
  ------------------
 5898|  14.4k|                               yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*(peek + 1))]) &&
  ------------------
  |  Branch (5898:32): [True: 14.1k, False: 332]
  ------------------
 5899|  14.6k|                              (next_indent == ctx.current_indent() ||
  ------------------
  |  Branch (5899:32): [True: 12.0k, False: 2.54k]
  ------------------
 5900|  2.54k|                               (ctx.current_indent() > 0 && (next_indent + 1) == ctx.current_indent()));
  ------------------
  |  Branch (5900:33): [True: 1.27k, False: 1.27k]
  |  Branch (5900:61): [True: 996, False: 275]
  ------------------
 5901|  29.7k|                           value_is_indentless_sequence = indentless_sequence;
 5902|  29.7k|                           const bool same_indent_property_node =
 5903|  29.7k|                              (next_indent == ctx.current_indent()) &&
  ------------------
  |  Branch (5903:31): [True: 17.4k, False: 12.3k]
  ------------------
 5904|  17.4k|                              (*peek == '!' || *peek == '&' || *peek == '*' || *peek == '[' || *peek == '{' ||
  ------------------
  |  Branch (5904:32): [True: 315, False: 17.0k]
  |  Branch (5904:48): [True: 3.21k, False: 13.8k]
  |  Branch (5904:64): [True: 156, False: 13.7k]
  |  Branch (5904:80): [True: 288, False: 13.4k]
  |  Branch (5904:96): [True: 46, False: 13.3k]
  ------------------
 5905|  13.3k|                               *peek == '"' || *peek == '\'' || *peek == '|' || *peek == '>');
  ------------------
  |  Branch (5905:32): [True: 77, False: 13.3k]
  |  Branch (5905:48): [True: 100, False: 13.2k]
  |  Branch (5905:65): [True: 552, False: 12.6k]
  |  Branch (5905:81): [True: 39, False: 12.6k]
  ------------------
 5906|  29.7k|                           value_on_next_line =
 5907|  29.7k|                              (next_indent > ctx.current_indent()) || indentless_sequence || same_indent_property_node;
  ------------------
  |  Branch (5907:31): [True: 7.72k, False: 22.0k]
  |  Branch (5907:71): [True: 13.0k, False: 8.94k]
  |  Branch (5907:94): [True: 4.79k, False: 4.15k]
  ------------------
 5908|  29.7k|                        }
 5909|  35.8k|                     }
 5910|  36.2k|                  }
 5911|  39.2k|                  if (!value_on_next_line) {
  ------------------
  |  Branch (5911:23): [True: 13.6k, False: 25.6k]
  ------------------
 5912|       |                     // Anchor on empty/null node — store empty span, leave value as default
 5913|  13.6k|                     ctx.anchors[std::string(aname)] = {&*it, &*it, ctx.current_indent()};
 5914|  13.6k|                     return;
 5915|  13.6k|                  }
 5916|       |                  // Value is on next line — advance past newline/blank lines to the content
 5917|  25.6k|                  if (*it == '#') {
  ------------------
  |  Branch (5917:23): [True: 1.85k, False: 23.7k]
  ------------------
 5918|  1.38M|                     while (it != end && *it != '\n' && *it != '\r') ++it;
  ------------------
  |  Branch (5918:29): [True: 1.38M, False: 0]
  |  Branch (5918:42): [True: 1.38M, False: 521]
  |  Branch (5918:57): [True: 1.38M, False: 1.33k]
  ------------------
 5919|  1.85k|                  }
 5920|  25.6k|                  if (it != end) yaml::skip_newline(it, end);
  ------------------
  |  Branch (5920:23): [True: 25.6k, False: 0]
  ------------------
 5921|  30.2k|                  while (it != end && (*it == '\n' || *it == '\r')) {
  ------------------
  |  Branch (5921:26): [True: 30.2k, False: 0]
  |  Branch (5921:40): [True: 1.13k, False: 29.1k]
  |  Branch (5921:55): [True: 3.53k, False: 25.6k]
  ------------------
 5922|  4.67k|                     yaml::skip_newline(it, end);
 5923|  4.67k|                  }
 5924|  25.6k|                  yaml::skip_inline_ws(it, end);
 5925|  25.6k|                  anchor_on_same_line = false;
 5926|  25.6k|               }
 5927|       |
 5928|   146k|               if constexpr (!yaml::check_flow_context(Opts)) {
 5929|   146k|                  if (anchor_on_same_line && *it == '-' &&
  ------------------
  |  Branch (5929:23): [True: 120k, False: 25.6k]
  |  Branch (5929:46): [True: 536, False: 119k]
  ------------------
 5930|    536|                      ((it + 1) == end || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*(it + 1))])) {
  ------------------
  |  Branch (5930:24): [True: 4, False: 532]
  |  Branch (5930:43): [True: 9, False: 523]
  ------------------
 5931|       |                     // "&anchor - item" is malformed in block context.
 5932|     13|                     ctx.error = error_code::syntax_error;
 5933|     13|                     return;
 5934|     13|                  }
 5935|   146k|               }
 5936|       |
 5937|       |               // Anchor on alias (&anchor *alias) is invalid per YAML spec.
 5938|       |               // But alias-as-key (&anchor *alias : value) is valid.
 5939|   146k|               if (it != end && *it == '*' && !yaml::alias_token_is_mapping_key(it, end)) {
  ------------------
  |  Branch (5939:20): [True: 145k, False: 17]
  |  Branch (5939:33): [True: 1.31k, False: 144k]
  |  Branch (5939:47): [True: 116, False: 1.20k]
  ------------------
 5940|    116|                  ctx.error = error_code::syntax_error;
 5941|    116|                  return;
 5942|    116|               }
 5943|       |
 5944|   145k|               if constexpr (!yaml::check_flow_context(Opts)) {
 5945|   145k|                  if (!anchor_on_same_line && it != end && *it == '&') {
  ------------------
  |  Branch (5945:23): [True: 25.5k, False: 120k]
  |  Branch (5945:47): [True: 25.5k, False: 4]
  |  Branch (5945:60): [True: 4.49k, False: 21.0k]
  ------------------
 5946|  4.49k|                     auto probe = it + 1;
 5947|  4.49k|                     auto nested_anchor_name = yaml::parse_anchor_name(probe, end);
 5948|  4.49k|                     if (nested_anchor_name.empty()) {
  ------------------
  |  Branch (5948:26): [True: 8, False: 4.48k]
  ------------------
 5949|      8|                        ctx.error = error_code::syntax_error;
 5950|      8|                        return;
 5951|      8|                     }
 5952|  4.48k|                     yaml::skip_inline_ws(probe, end);
 5953|       |                     // Allow nested anchor usage only when it clearly starts a
 5954|       |                     // nested mapping entry ("&k key: value"). Otherwise this is
 5955|       |                     // a second anchor on the same node (4JVG-style), which is invalid.
 5956|  4.48k|                     if (!yaml::line_could_be_block_mapping(probe, end)) {
  ------------------
  |  Branch (5956:26): [True: 60, False: 4.42k]
  ------------------
 5957|     60|                        ctx.error = error_code::syntax_error;
 5958|     60|                        return;
 5959|     60|                     }
 5960|  4.48k|                  }
 5961|   145k|               }
 5962|       |
 5963|   145k|               const char* anchor_start = &*it;
 5964|   145k|               const int32_t anchor_indent = ctx.current_indent();
 5965|       |
 5966|   145k|               if constexpr (!yaml::check_flow_context(Opts)) {
 5967|       |                  // Check if the anchor is on a block-mapping key (&name key: value).
 5968|       |                  // Only when the anchor and key are on the SAME line — if the value was on the
 5969|       |                  // next line, the anchor applies to the entire next-line content.
 5970|   145k|                  if (anchor_on_same_line && yaml::line_could_be_block_mapping(it, end)) {
  ------------------
  |  Branch (5970:23): [True: 120k, False: 25.6k]
  |  Branch (5970:46): [True: 48.1k, False: 72.0k]
  ------------------
 5971|  48.1k|                     auto key_start = it;
 5972|  48.1k|                     if (*key_start == '!') {
  ------------------
  |  Branch (5972:26): [True: 1.48k, False: 46.7k]
  ------------------
 5973|  1.48k|                        const auto key_tag = yaml::parse_yaml_tag(key_start, end, ctx);
 5974|  1.48k|                        if (key_tag == yaml::yaml_tag::unknown || !yaml::tag_valid_for_string(key_tag)) {
  ------------------
  |  Branch (5974:29): [True: 3, False: 1.47k]
  |  Branch (5974:67): [True: 1, False: 1.47k]
  ------------------
 5975|      4|                           ctx.error = error_code::syntax_error;
 5976|      4|                           return;
 5977|      4|                        }
 5978|  1.47k|                        yaml::skip_inline_ws(key_start, end);
 5979|  1.47k|                        if (key_start == end) {
  ------------------
  |  Branch (5979:29): [True: 0, False: 1.47k]
  ------------------
 5980|      0|                           ctx.error = error_code::unexpected_end;
 5981|      0|                           return;
 5982|      0|                        }
 5983|  1.47k|                        if (*key_start == '\n' || *key_start == '\r') {
  ------------------
  |  Branch (5983:29): [True: 1, False: 1.47k]
  |  Branch (5983:51): [True: 1, False: 1.47k]
  ------------------
 5984|      2|                           ctx.error = error_code::syntax_error;
 5985|      2|                           return;
 5986|      2|                        }
 5987|       |
 5988|       |                        // Re-apply the anchor-on-alias rule now that the tag is consumed. The
 5989|       |                        // check above ran before the tag, so "&anchor !tag *alias" reached the
 5990|       |                        // key-span registration below while the untagged spelling was rejected;
 5991|       |                        // an alias node carries no other properties either way.
 5992|  1.47k|                        if (*key_start == '*' && !yaml::alias_token_is_mapping_key(key_start, end)) {
  ------------------
  |  Branch (5992:29): [True: 604, False: 870]
  |  Branch (5992:50): [True: 1, False: 603]
  ------------------
 5993|      1|                           ctx.error = error_code::syntax_error;
 5994|      1|                           return;
 5995|      1|                        }
 5996|  1.47k|                     }
 5997|       |
 5998|       |                     // Find the key span by scanning to the key-value separator
 5999|  48.1k|                     auto key_scan = key_start;
 6000|  48.1k|                     auto key_end = key_start;
 6001|  48.1k|                     if (*key_scan == '"' || *key_scan == '\'') {
  ------------------
  |  Branch (6001:26): [True: 320, False: 47.8k]
  |  Branch (6001:46): [True: 344, False: 47.5k]
  ------------------
 6002|       |                        // Quoted key: skip to closing quote
 6003|    664|                        const char quote = *key_scan;
 6004|    664|                        ++key_scan;
 6005|  3.63k|                        while (key_scan != end && *key_scan != quote) {
  ------------------
  |  Branch (6005:32): [True: 3.63k, False: 2]
  |  Branch (6005:51): [True: 2.97k, False: 662]
  ------------------
 6006|  2.97k|                           if (*key_scan == '\\' && quote == '"') {
  ------------------
  |  Branch (6006:32): [True: 461, False: 2.51k]
  |  Branch (6006:53): [True: 242, False: 219]
  ------------------
 6007|    242|                              ++key_scan;
 6008|    242|                              if (key_scan != end) ++key_scan;
  ------------------
  |  Branch (6008:35): [True: 242, False: 0]
  ------------------
 6009|    242|                           }
 6010|  2.73k|                           else {
 6011|  2.73k|                              ++key_scan;
 6012|  2.73k|                           }
 6013|  2.97k|                        }
 6014|    664|                        if (key_scan == end) {
  ------------------
  |  Branch (6014:29): [True: 2, False: 662]
  ------------------
 6015|      2|                           ctx.error = error_code::syntax_error;
 6016|      2|                           return;
 6017|      2|                        }
 6018|    662|                        ++key_scan; // past closing quote
 6019|    662|                        key_end = key_scan;
 6020|    662|                        yaml::skip_inline_ws(key_scan, end);
 6021|    662|                     }
 6022|  47.5k|                     else {
 6023|       |                        // Plain key: scan to ':'
 6024|  1.74M|                        while (key_scan != end) {
  ------------------
  |  Branch (6024:32): [True: 1.74M, False: 2]
  ------------------
 6025|  1.74M|                           if (*key_scan == ':') {
  ------------------
  |  Branch (6025:32): [True: 93.6k, False: 1.65M]
  ------------------
 6026|  93.6k|                              auto next = key_scan + 1;
 6027|  93.6k|                              if (next == end || *next == ' ' || *next == '\t' || *next == '\n' || *next == '\r') {
  ------------------
  |  Branch (6027:35): [True: 1.09k, False: 92.5k]
  |  Branch (6027:50): [True: 35.9k, False: 56.5k]
  |  Branch (6027:66): [True: 1.91k, False: 54.6k]
  |  Branch (6027:83): [True: 2.29k, False: 52.3k]
  |  Branch (6027:100): [True: 6.26k, False: 46.0k]
  ------------------
 6028|  47.5k|                                 break;
 6029|  47.5k|                              }
 6030|  93.6k|                           }
 6031|  1.69M|                           ++key_scan;
 6032|  1.69M|                        }
 6033|  47.5k|                        key_end = key_scan;
 6034|  58.1k|                        while (key_end != key_start && (*(key_end - 1) == ' ' || *(key_end - 1) == '\t')) {
  ------------------
  |  Branch (6034:32): [True: 54.8k, False: 3.24k]
  |  Branch (6034:57): [True: 10.2k, False: 44.6k]
  |  Branch (6034:82): [True: 374, False: 44.2k]
  ------------------
 6035|  10.5k|                           --key_end;
 6036|  10.5k|                        }
 6037|  47.5k|                     }
 6038|  48.1k|                     if (key_scan == end || *key_scan != ':') {
  ------------------
  |  Branch (6038:26): [True: 2, False: 48.1k]
  |  Branch (6038:45): [True: 37, False: 48.1k]
  ------------------
 6039|     39|                        ctx.error = error_code::syntax_error;
 6040|     39|                        return;
 6041|     39|                     }
 6042|       |                     // Store anchor with just the key text span
 6043|  48.1k|                     ctx.anchors[std::string(aname)] = {&*key_start, &*key_end, anchor_indent};
 6044|  48.1k|                     it = key_start;
 6045|       |                     // Parse as an object alternative so complex keys (e.g. flow collections) stay in mapping context.
 6046|  48.1k|                     if constexpr (counts::n_object > 0) {
 6047|  48.1k|                        process_yaml_variant_alternatives<V, is_yaml_variant_object>::template op<Opts>(value, ctx, it,
 6048|  48.1k|                                                                                                        end);
 6049|       |                     }
 6050|       |                     else {
 6051|       |                        from<YAML, V>::template op<Opts>(value, ctx, it, end);
 6052|       |                     }
 6053|  48.1k|                     return;
 6054|  48.1k|                  }
 6055|   145k|               }
 6056|       |
 6057|  97.7k|               const bool prev_allow_indentless_sequence = ctx.allow_indentless_sequence;
 6058|   145k|               ctx.allow_indentless_sequence = value_is_indentless_sequence;
 6059|   145k|               from<YAML, V>::template op<Opts>(value, ctx, it, end);
 6060|   145k|               ctx.allow_indentless_sequence = prev_allow_indentless_sequence;
 6061|   145k|               if (!bool(ctx.error)) {
  ------------------
  |  Branch (6061:20): [True: 94.8k, False: 51.0k]
  ------------------
 6062|  94.8k|                  ctx.anchors[std::string(aname)] = {anchor_start, &*it, anchor_indent};
 6063|  94.8k|               }
 6064|   145k|               return;
 6065|   146k|            }
 6066|  75.8k|            case '*': {
  ------------------
  |  Branch (6066:13): [True: 75.8k, False: 798k]
  ------------------
 6067|       |               // In block context, "*alias : value" starts a mapping with an alias key.
 6068|  75.8k|               if constexpr (!yaml::check_flow_context(Opts)) {
 6069|  75.8k|                  if (yaml::alias_token_is_mapping_key(it, end)) {
  ------------------
  |  Branch (6069:23): [True: 4.31k, False: 71.5k]
  ------------------
 6070|  4.31k|                     if constexpr (counts::n_object > 0) {
 6071|  4.31k|                        process_yaml_variant_alternatives<V, is_yaml_variant_object>::template op<Opts>(value, ctx, it,
 6072|  4.31k|                                                                                                        end);
 6073|  4.31k|                        return;
 6074|       |                     }
 6075|       |                     else {
 6076|       |                        ctx.error = error_code::syntax_error;
 6077|       |                        return;
 6078|       |                     }
 6079|  4.31k|                  }
 6080|  75.8k|               }
 6081|       |
 6082|       |               // Alias value: look up anchor and replay
 6083|      0|               yaml::handle_alias<Opts>(value, ctx, it, end);
 6084|  75.8k|               return;
 6085|   146k|            }
 6086|  71.1k|            case '!': {
  ------------------
  |  Branch (6086:13): [True: 71.1k, False: 803k]
  ------------------
 6087|       |               // Tag - parse it and dispatch based on tag type
 6088|  71.1k|               const auto tag = yaml::parse_yaml_tag(it, end, ctx);
 6089|  71.1k|               if (tag == yaml::yaml_tag::unknown) {
  ------------------
  |  Branch (6089:20): [True: 55, False: 71.1k]
  ------------------
 6090|     55|                  ctx.error = error_code::syntax_error;
 6091|     55|                  return;
 6092|     55|               }
 6093|  71.1k|               yaml::skip_inline_ws(it, end);
 6094|  71.1k|               if (it != end && *it == '#') {
  ------------------
  |  Branch (6094:20): [True: 70.4k, False: 728]
  |  Branch (6094:33): [True: 3.56k, False: 66.8k]
  ------------------
 6095|  3.56k|                  yaml::skip_comment(it, end);
 6096|  3.56k|               }
 6097|  71.1k|               if (it != end && (*it == '\n' || *it == '\r')) {
  ------------------
  |  Branch (6097:20): [True: 70.1k, False: 1.01k]
  |  Branch (6097:34): [True: 4.51k, False: 65.5k]
  |  Branch (6097:49): [True: 6.91k, False: 58.6k]
  ------------------
 6098|  11.4k|                  auto content = it;
 6099|  11.4k|                  yaml::skip_newline(content, end);
 6100|  11.4k|                  yaml::skip_to_content(content, end);
 6101|       |
 6102|  11.4k|                  bool consume_following_content = false;
 6103|  11.4k|                  auto content_token = content;
 6104|  11.4k|                  if (content != end) {
  ------------------
  |  Branch (6104:23): [True: 10.5k, False: 931]
  ------------------
 6105|  10.5k|                     auto indent_probe = content;
 6106|  10.5k|                     const int32_t content_indent = yaml::measure_indent<false>(indent_probe, end, ctx);
 6107|  10.5k|                     if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (6107:26): [True: 2, False: 10.5k]
  ------------------
 6108|      2|                        return;
 6109|  10.5k|                     content_token = indent_probe;
 6110|       |
 6111|       |                     // A tag at the end of a sequence/map entry has an empty value
 6112|       |                     // unless the next non-empty content is nested under the current node.
 6113|  10.5k|                     bool tagged_indentless_sequence = false;
 6114|  10.5k|                     if (tag == yaml::yaml_tag::seq && indent_probe != end && *indent_probe == '-') {
  ------------------
  |  Branch (6114:26): [True: 2.56k, False: 7.93k]
  |  Branch (6114:56): [True: 2.56k, False: 0]
  |  Branch (6114:79): [True: 2.31k, False: 247]
  ------------------
 6115|  2.31k|                        const auto after_dash = indent_probe + 1;
 6116|  2.31k|                        if (after_dash == end ||
  ------------------
  |  Branch (6116:29): [True: 0, False: 2.31k]
  ------------------
 6117|  2.31k|                            yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*after_dash)]) {
  ------------------
  |  Branch (6117:29): [True: 2.00k, False: 308]
  ------------------
 6118|  2.00k|                           tagged_indentless_sequence =
 6119|  2.00k|                              (content_indent == ctx.current_indent()) ||
  ------------------
  |  Branch (6119:31): [True: 502, False: 1.50k]
  ------------------
 6120|  1.50k|                              (ctx.current_indent() > 0 && (content_indent + 1) == ctx.current_indent());
  ------------------
  |  Branch (6120:32): [True: 356, False: 1.14k]
  |  Branch (6120:60): [True: 338, False: 18]
  ------------------
 6121|  2.00k|                        }
 6122|  2.31k|                     }
 6123|       |
 6124|  10.5k|                     consume_following_content = (ctx.current_indent() < 0) ||
  ------------------
  |  Branch (6124:50): [True: 1.42k, False: 9.07k]
  ------------------
 6125|  9.07k|                                                 (content_indent > ctx.current_indent()) || tagged_indentless_sequence;
  ------------------
  |  Branch (6125:50): [True: 2.98k, False: 6.08k]
  |  Branch (6125:93): [True: 840, False: 5.24k]
  ------------------
 6126|  10.5k|                  }
 6127|       |
 6128|  11.4k|                  if (consume_following_content) {
  ------------------
  |  Branch (6128:23): [True: 5.25k, False: 6.17k]
  ------------------
 6129|  5.25k|                     it = content_token;
 6130|  5.25k|                  }
 6131|  6.17k|                  else {
 6132|  6.17k|                     if (tag == yaml::yaml_tag::str) {
  ------------------
  |  Branch (6132:26): [True: 91, False: 6.08k]
  ------------------
 6133|     91|                        if constexpr (counts::n_str > 0) {
 6134|     91|                           constexpr auto first_idx = yaml_variant_first_index_v<V, is_yaml_variant_str>;
 6135|     91|                           using StrType = std::variant_alternative_t<first_idx, V>;
 6136|     91|                           value = StrType{};
 6137|     91|                           return;
 6138|     91|                        }
 6139|     91|                     }
 6140|  6.17k|                     if (tag == yaml::yaml_tag::null_tag) {
  ------------------
  |  Branch (6140:26): [True: 165, False: 6.01k]
  ------------------
 6141|    165|                        if constexpr (counts::n_null > 0) {
 6142|    165|                           constexpr auto first_idx = yaml_variant_first_index_v<V, is_yaml_variant_null>;
 6143|    165|                           using NullType = std::variant_alternative_t<first_idx, V>;
 6144|    165|                           if (!std::holds_alternative<NullType>(value)) value = NullType{};
  ------------------
  |  Branch (6144:32): [True: 0, False: 165]
  ------------------
 6145|    165|                           return;
 6146|    165|                        }
 6147|    165|                     }
 6148|  6.17k|                     if (tag == yaml::yaml_tag::none) {
  ------------------
  |  Branch (6148:26): [True: 3.54k, False: 2.63k]
  ------------------
 6149|  3.54k|                        if constexpr (counts::n_null > 0) {
 6150|  3.54k|                           constexpr auto first_idx = yaml_variant_first_index_v<V, is_yaml_variant_null>;
 6151|  3.54k|                           using NullType = std::variant_alternative_t<first_idx, V>;
 6152|  3.54k|                           if (!std::holds_alternative<NullType>(value)) value = NullType{};
  ------------------
  |  Branch (6152:32): [True: 0, False: 3.54k]
  ------------------
 6153|  3.54k|                           return;
 6154|  3.54k|                        }
 6155|  3.54k|                     }
 6156|  6.17k|                  }
 6157|  11.4k|               }
 6158|  71.1k|               if constexpr (!yaml::check_flow_context(Opts)) {
 6159|       |                  // In block context, a comma immediately after a tag token is malformed
 6160|       |                  // (e.g., "!!str, value"). Flow context has legitimate ", ] }" usage.
 6161|  71.1k|                  if (it != end && *it == ',') {
  ------------------
  |  Branch (6161:23): [True: 66.3k, False: 4.81k]
  |  Branch (6161:36): [True: 13, False: 66.2k]
  ------------------
 6162|     13|                     ctx.error = error_code::syntax_error;
 6163|     13|                     return;
 6164|     13|                  }
 6165|  71.1k|                  if constexpr (counts::n_object > 0) {
 6166|       |                     // Tagged keys like "!!str key: value" must parse as mappings.
 6167|  71.1k|                     const bool starts_block_sequence_entry =
 6168|  71.1k|                        (it != end && *it == '-') &&
  ------------------
  |  Branch (6168:26): [True: 66.2k, False: 4.81k]
  |  Branch (6168:39): [True: 3.46k, False: 62.8k]
  ------------------
 6169|  3.46k|                        ((it + 1) == end || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*(it + 1))]);
  ------------------
  |  Branch (6169:26): [True: 322, False: 3.14k]
  |  Branch (6169:45): [True: 2.73k, False: 410]
  ------------------
 6170|  71.1k|                     if (!starts_block_sequence_entry && yaml::line_could_be_block_mapping(it, end)) {
  ------------------
  |  Branch (6170:26): [True: 64.2k, False: 6.85k]
  |  Branch (6170:58): [True: 7.99k, False: 56.2k]
  ------------------
 6171|       |                        // Re-dispatch from the post-tag token so '&key key: val' is
 6172|       |                        // handled by the anchor-aware key path, not as a map-level anchor.
 6173|  7.99k|                        from<YAML, V>::template op<Opts>(value, ctx, it, end);
 6174|  7.99k|                        return;
 6175|  7.99k|                     }
 6176|  71.1k|                  }
 6177|  71.1k|               }
 6178|  71.1k|               if (it == end) {
  ------------------
  |  Branch (6178:20): [True: 1.01k, False: 70.1k]
  ------------------
 6179|  1.01k|                  if (tag == yaml::yaml_tag::str) {
  ------------------
  |  Branch (6179:23): [True: 356, False: 660]
  ------------------
 6180|    356|                     if constexpr (counts::n_str > 0) {
 6181|    356|                        constexpr auto first_idx = yaml_variant_first_index_v<V, is_yaml_variant_str>;
 6182|    356|                        using StrType = std::variant_alternative_t<first_idx, V>;
 6183|    356|                        value = StrType{};
 6184|    356|                        return;
 6185|    356|                     }
 6186|    356|                  }
 6187|  1.01k|                  if (tag == yaml::yaml_tag::none) {
  ------------------
  |  Branch (6187:23): [True: 655, False: 361]
  ------------------
 6188|    655|                     if constexpr (counts::n_null > 0) {
 6189|    655|                        constexpr auto first_idx = yaml_variant_first_index_v<V, is_yaml_variant_null>;
 6190|    655|                        using NullType = std::variant_alternative_t<first_idx, V>;
 6191|    655|                        if (!std::holds_alternative<NullType>(value)) value = NullType{};
  ------------------
  |  Branch (6191:29): [True: 0, False: 655]
  ------------------
 6192|    655|                        return;
 6193|    655|                     }
 6194|    655|                  }
 6195|      0|                  ctx.error = error_code::unexpected_end;
 6196|  1.01k|                  return;
 6197|  1.01k|               }
 6198|  70.1k|               switch (tag) {
 6199|    313|               case yaml::yaml_tag::str:
  ------------------
  |  Branch (6199:16): [True: 313, False: 69.8k]
  ------------------
 6200|    313|                  process_yaml_variant_alternatives<V, is_yaml_variant_str>::template op<Opts>(value, ctx, it, end);
 6201|    313|                  return;
 6202|  3.35k|               case yaml::yaml_tag::int_tag:
  ------------------
  |  Branch (6202:16): [True: 3.35k, False: 66.7k]
  ------------------
 6203|  3.37k|               case yaml::yaml_tag::float_tag:
  ------------------
  |  Branch (6203:16): [True: 15, False: 70.0k]
  ------------------
 6204|  3.37k|                  if constexpr (counts::n_num > 0) {
 6205|  3.37k|                     process_yaml_variant_alternatives<V, is_yaml_variant_num>::template op<Opts>(value, ctx, it, end);
 6206|  3.37k|                     return;
 6207|       |                  }
 6208|       |                  else { // else used to fix MSVC unreachable code warning
 6209|       |                     ctx.error = error_code::syntax_error;
 6210|       |                     return;
 6211|       |                  }
 6212|  8.40k|               case yaml::yaml_tag::bool_tag:
  ------------------
  |  Branch (6212:16): [True: 5.02k, False: 65.0k]
  ------------------
 6213|  8.40k|                  if constexpr (counts::n_bool > 0) {
 6214|  8.40k|                     process_yaml_variant_alternatives<V, is_yaml_variant_bool>::template op<Opts>(value, ctx, it, end);
 6215|  8.40k|                     return;
 6216|       |                  }
 6217|       |                  else { // else used to fix MSVC unreachable code warning
 6218|       |                     ctx.error = error_code::syntax_error;
 6219|       |                     return;
 6220|       |                  }
 6221|  8.76k|               case yaml::yaml_tag::null_tag:
  ------------------
  |  Branch (6221:16): [True: 359, False: 69.7k]
  ------------------
 6222|  8.76k|                  if constexpr (counts::n_null > 0) {
 6223|  8.76k|                     constexpr auto first_idx = yaml_variant_first_index_v<V, is_yaml_variant_null>;
 6224|  8.76k|                     using NullType = std::variant_alternative_t<first_idx, V>;
 6225|  8.76k|                     if (!std::holds_alternative<NullType>(value)) value = NullType{};
  ------------------
  |  Branch (6225:26): [True: 0, False: 8.76k]
  ------------------
 6226|  8.76k|                     from<YAML, NullType>::template op<Opts>(std::get<NullType>(value), ctx, it, end);
 6227|  8.76k|                     return;
 6228|       |                  }
 6229|       |                  else { // else used to fix MSVC unreachable code warning
 6230|       |                     ctx.error = error_code::syntax_error;
 6231|       |                     return;
 6232|       |                  }
 6233|  13.4k|               case yaml::yaml_tag::map:
  ------------------
  |  Branch (6233:16): [True: 4.66k, False: 65.4k]
  ------------------
 6234|  13.4k|                  if constexpr (counts::n_object > 0) {
 6235|  13.4k|                     process_yaml_variant_alternatives<V, is_yaml_variant_object>::template op<Opts>(value, ctx, it,
 6236|  13.4k|                                                                                                     end);
 6237|  13.4k|                     return;
 6238|       |                  }
 6239|       |                  else { // else used to fix MSVC unreachable code warning
 6240|       |                     ctx.error = error_code::syntax_error;
 6241|       |                     return;
 6242|       |                  }
 6243|  20.0k|               case yaml::yaml_tag::seq:
  ------------------
  |  Branch (6243:16): [True: 6.62k, False: 63.4k]
  ------------------
 6244|  20.0k|                  if constexpr (counts::n_array > 0) {
 6245|  20.0k|                     const bool prev_allow_indentless_sequence = ctx.allow_indentless_sequence;
 6246|  20.0k|                     if constexpr (!yaml::check_flow_context(Opts)) {
 6247|  20.0k|                        if (it != end && *it == '-') {
  ------------------
  |  Branch (6247:29): [True: 6.62k, False: 13.4k]
  |  Branch (6247:42): [True: 2.20k, False: 4.42k]
  ------------------
 6248|  2.20k|                           ctx.allow_indentless_sequence = true;
 6249|  2.20k|                        }
 6250|  20.0k|                     }
 6251|  20.0k|                     process_yaml_variant_alternatives<V, is_yaml_variant_array>::template op<Opts>(value, ctx, it,
 6252|  20.0k|                                                                                                    end);
 6253|  20.0k|                     ctx.allow_indentless_sequence = prev_allow_indentless_sequence;
 6254|  20.0k|                     return;
 6255|       |                  }
 6256|       |                  else { // else used to fix MSVC unreachable code warning
 6257|       |                     ctx.error = error_code::syntax_error;
 6258|       |                     return;
 6259|       |                  }
 6260|  57.9k|               default: {
  ------------------
  |  Branch (6260:16): [True: 37.9k, False: 32.1k]
  ------------------
 6261|       |                  // Explicit unknown/non-core tags disable implicit scalar resolution.
 6262|       |                  // Preserve collection kinds, otherwise treat as string content.
 6263|  57.9k|                  if (it != end && *it == '*') {
  ------------------
  |  Branch (6263:23): [True: 37.9k, False: 20.0k]
  |  Branch (6263:36): [True: 26.6k, False: 11.3k]
  ------------------
 6264|  26.6k|                     yaml::handle_alias<Opts>(value, ctx, it, end);
 6265|  26.6k|                     return;
 6266|  26.6k|                  }
 6267|       |
 6268|  31.3k|                  if constexpr (counts::n_array > 0) {
 6269|  31.3k|                     if (it != end && *it == '[') {
  ------------------
  |  Branch (6269:26): [True: 11.3k, False: 20.0k]
  |  Branch (6269:39): [True: 334, False: 10.9k]
  ------------------
 6270|    334|                        process_yaml_variant_alternatives<V, is_yaml_variant_array>::template op<Opts>(value, ctx, it,
 6271|    334|                                                                                                       end);
 6272|    334|                        return;
 6273|    334|                     }
 6274|  31.3k|                  }
 6275|  31.3k|                  if constexpr (counts::n_object > 0) {
 6276|  31.3k|                     if (it != end && *it == '{') {
  ------------------
  |  Branch (6276:26): [True: 10.9k, False: 20.3k]
  |  Branch (6276:39): [True: 793, False: 10.2k]
  ------------------
 6277|    793|                        process_yaml_variant_alternatives<V, is_yaml_variant_object>::template op<Opts>(value, ctx, it,
 6278|    793|                                                                                                        end);
 6279|    793|                        return;
 6280|    793|                     }
 6281|  31.3k|                  }
 6282|       |
 6283|  31.3k|                  if constexpr (!yaml::check_flow_context(Opts)) {
 6284|  31.3k|                     if constexpr (counts::n_array > 0) {
 6285|  31.3k|                        const bool starts_block_sequence_entry =
 6286|  31.3k|                           (it != end && *it == '-') &&
  ------------------
  |  Branch (6286:29): [True: 10.2k, False: 21.1k]
  |  Branch (6286:42): [True: 723, False: 9.47k]
  ------------------
 6287|    723|                           ((it + 1) == end || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*(it + 1))]);
  ------------------
  |  Branch (6287:29): [True: 314, False: 409]
  |  Branch (6287:48): [True: 315, False: 94]
  ------------------
 6288|  31.3k|                        if (starts_block_sequence_entry) {
  ------------------
  |  Branch (6288:29): [True: 629, False: 30.7k]
  ------------------
 6289|    629|                           process_yaml_variant_alternatives<V, is_yaml_variant_array>::template op<Opts>(value, ctx,
 6290|    629|                                                                                                          it, end);
 6291|    629|                           return;
 6292|    629|                        }
 6293|  31.3k|                     }
 6294|  31.3k|                     if constexpr (counts::n_object > 0) {
 6295|  31.3k|                        const bool starts_explicit_mapping_indicator =
 6296|  31.3k|                           (it != end && (*it == '?' || *it == ':')) &&
  ------------------
  |  Branch (6296:29): [True: 9.57k, False: 21.7k]
  |  Branch (6296:43): [True: 1.12k, False: 8.44k]
  |  Branch (6296:57): [True: 336, False: 8.11k]
  ------------------
 6297|  1.45k|                           ((it + 1) == end || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*(it + 1))]);
  ------------------
  |  Branch (6297:29): [True: 271, False: 1.18k]
  |  Branch (6297:48): [True: 792, False: 395]
  ------------------
 6298|  31.3k|                        if (starts_explicit_mapping_indicator) {
  ------------------
  |  Branch (6298:29): [True: 1.06k, False: 30.3k]
  ------------------
 6299|  1.06k|                           process_yaml_variant_alternatives<V, is_yaml_variant_object>::template op<Opts>(value, ctx,
 6300|  1.06k|                                                                                                           it, end);
 6301|  1.06k|                           return;
 6302|  1.06k|                        }
 6303|  30.3k|                        if (yaml::line_could_be_block_mapping(it, end)) {
  ------------------
  |  Branch (6303:29): [True: 0, False: 30.3k]
  ------------------
 6304|      0|                           process_yaml_variant_alternatives<V, is_yaml_variant_object>::template op<Opts>(value, ctx,
 6305|      0|                                                                                                           it, end);
 6306|      0|                           return;
 6307|      0|                        }
 6308|  30.3k|                     }
 6309|  31.3k|                  }
 6310|       |
 6311|  31.3k|                  if constexpr (counts::n_str > 0) {
 6312|  31.3k|                     process_yaml_variant_alternatives<V, is_yaml_variant_str>::template op<Opts>(value, ctx, it, end);
 6313|  31.3k|                     return;
 6314|  31.3k|                  }
 6315|       |
 6316|       |                  // Fall back if no string alternative exists.
 6317|      0|                  from<YAML, V>::template op<Opts>(value, ctx, it, end);
 6318|  31.3k|                  return;
 6319|  57.9k|               }
 6320|  70.1k|               }
 6321|      0|               return;
 6322|  70.1k|            }
 6323|  28.3k|            case '{':
  ------------------
  |  Branch (6323:13): [True: 28.3k, False: 846k]
  ------------------
 6324|  28.3k|               if constexpr (!yaml::check_flow_context(Opts)) {
 6325|       |                  // In block context, "{...}: value" can be a complex mapping key.
 6326|  28.3k|                  if (ctx.current_indent() < 0 && yaml::line_could_be_block_mapping(it, end)) {
  ------------------
  |  Branch (6326:23): [True: 7.96k, False: 20.4k]
  |  Branch (6326:51): [True: 1.27k, False: 6.68k]
  ------------------
 6327|  1.27k|                     process_yaml_variant_alternatives<V, is_yaml_variant_object>::template op<Opts>(value, ctx, it,
 6328|  1.27k|                                                                                                     end);
 6329|  1.27k|                     return;
 6330|  1.27k|                  }
 6331|  28.3k|               }
 6332|       |               // Flow mapping - object type
 6333|  27.1k|               process_yaml_variant_alternatives<V, is_yaml_variant_object>::template op<Opts>(value, ctx, it, end);
 6334|  28.3k|               return;
 6335|  31.5k|            case '[':
  ------------------
  |  Branch (6335:13): [True: 31.5k, False: 842k]
  ------------------
 6336|  31.5k|               if constexpr (!yaml::check_flow_context(Opts)) {
 6337|       |                  // In block context, "[...]: value" can be a complex mapping key.
 6338|  31.5k|                  if (ctx.current_indent() < 0 && yaml::line_could_be_block_mapping(it, end)) {
  ------------------
  |  Branch (6338:23): [True: 19.4k, False: 12.1k]
  |  Branch (6338:51): [True: 189, False: 19.3k]
  ------------------
 6339|    189|                     process_yaml_variant_alternatives<V, is_yaml_variant_object>::template op<Opts>(value, ctx, it,
 6340|    189|                                                                                                     end);
 6341|    189|                     return;
 6342|    189|                  }
 6343|  31.5k|               }
 6344|       |               // Flow sequence - array type
 6345|  31.4k|               process_yaml_variant_alternatives<V, is_yaml_variant_array>::template op<Opts>(value, ctx, it, end);
 6346|  31.5k|               return;
 6347|   135k|            case '?':
  ------------------
  |  Branch (6347:13): [True: 135k, False: 738k]
  ------------------
 6348|       |               // Explicit mapping key indicator ("? key")
 6349|   135k|               if ((end - it >= 2) && it[1] == '\t') {
  ------------------
  |  Branch (6349:20): [True: 135k, False: 502]
  |  Branch (6349:39): [True: 7, False: 135k]
  ------------------
 6350|      7|                  ctx.error = error_code::syntax_error;
 6351|      7|                  return;
 6352|      7|               }
 6353|   135k|               if ((end - it >= 2) && (it[1] == ' ' || it[1] == '\n' || it[1] == '\r')) {
  ------------------
  |  Branch (6353:20): [True: 135k, False: 502]
  |  Branch (6353:40): [True: 48.3k, False: 87.1k]
  |  Branch (6353:56): [True: 79.5k, False: 7.60k]
  |  Branch (6353:73): [True: 2.30k, False: 5.29k]
  ------------------
 6354|   130k|                  if constexpr (counts::n_object > 0) {
 6355|   130k|                     process_yaml_variant_alternatives<V, is_yaml_variant_object>::template op<Opts>(value, ctx, it,
 6356|   130k|                                                                                                     end);
 6357|   130k|                     return;
 6358|   130k|                  }
 6359|   130k|               }
 6360|      0|               parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6361|   135k|               return;
 6362|     15|            case '%':
  ------------------
  |  Branch (6362:13): [True: 15, False: 874k]
  ------------------
 6363|       |               // Reserved directive indicator is not a plain scalar start.
 6364|     15|               ctx.error = error_code::syntax_error;
 6365|     15|               return;
 6366|    979|            case '"':
  ------------------
  |  Branch (6366:13): [True: 979, False: 873k]
  ------------------
 6367|  2.23k|            case '\'':
  ------------------
  |  Branch (6367:13): [True: 1.25k, False: 873k]
  ------------------
 6368|       |               // Could be a quoted string OR a quoted key in a block mapping
 6369|       |               // Try block mapping first (e.g., "key": value), then fall back to string
 6370|  2.23k|               parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6371|  2.23k|               return;
 6372|  7.72k|            case 't':
  ------------------
  |  Branch (6372:13): [True: 7.72k, False: 866k]
  ------------------
 6373|  29.8k|            case 'T':
  ------------------
  |  Branch (6373:13): [True: 22.1k, False: 852k]
  ------------------
 6374|       |               // Could be "true", "True", "TRUE", or a key/string starting with t/T
 6375|  29.8k|               if constexpr (counts::n_bool > 0) {
 6376|  29.8k|                  if ((end - it >= 4) && ((it[1] == 'r' && it[2] == 'u' && it[3] == 'e') ||
  ------------------
  |  Branch (6376:23): [True: 29.5k, False: 280]
  |  Branch (6376:44): [True: 25.4k, False: 4.13k]
  |  Branch (6376:60): [True: 24.3k, False: 1.14k]
  |  Branch (6376:76): [True: 23.8k, False: 446]
  ------------------
 6377|  24.2k|                                          (it[1] == 'R' && it[2] == 'U' && it[3] == 'E'))) {
  ------------------
  |  Branch (6377:44): [True: 2.18k, False: 3.54k]
  |  Branch (6377:60): [True: 1.23k, False: 948]
  |  Branch (6377:76): [True: 335, False: 900]
  ------------------
 6378|       |                     // Check what follows the word "true"
 6379|  24.2k|                     const auto after_true = it + 4;
 6380|  24.2k|                     const bool at_word_boundary = is_word_boundary(after_true);
 6381|       |
 6382|  24.2k|                     if (at_word_boundary) {
  ------------------
  |  Branch (6382:26): [True: 23.5k, False: 650]
  ------------------
 6383|  23.5k|                        if (has_indented_block_continuation(after_true)) {
  ------------------
  |  Branch (6383:29): [True: 403, False: 23.1k]
  ------------------
 6384|    403|                           parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6385|    403|                           return;
 6386|    403|                        }
 6387|       |                        // Check if this is a key (followed by ": ") rather than a boolean value
 6388|       |                        // "true: value" should parse as {true: value}, not as the boolean true
 6389|  23.1k|                        if ((end - it > 4) && it[4] == ':' &&
  ------------------
  |  Branch (6389:29): [True: 22.8k, False: 343]
  |  Branch (6389:47): [True: 19.0k, False: 3.78k]
  ------------------
 6390|  19.0k|                            (end - it == 5 || it[5] == ' ' || it[5] == '\t' || it[5] == '\n' || it[5] == '\r')) {
  ------------------
  |  Branch (6390:30): [True: 426, False: 18.5k]
  |  Branch (6390:47): [True: 17.9k, False: 626]
  |  Branch (6390:63): [True: 289, False: 337]
  |  Branch (6390:80): [True: 266, False: 71]
  |  Branch (6390:97): [True: 71, False: 0]
  ------------------
 6391|       |                           // This is "true:" followed by space/tab/newline/end - treat as key
 6392|  19.0k|                           parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6393|  19.0k|                           return;
 6394|  19.0k|                        }
 6395|  4.12k|                        process_yaml_variant_alternatives<V, is_yaml_variant_bool>::template op<Opts>(value, ctx, it,
 6396|  4.12k|                                                                                                      end);
 6397|  4.12k|                        return;
 6398|  23.1k|                     }
 6399|       |                     // "true" is followed by more characters (e.g., "True\b") - treat as string
 6400|  24.2k|                  }
 6401|  29.8k|               }
 6402|  6.32k|               parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6403|  29.8k|               return;
 6404|  8.24k|            case 'f':
  ------------------
  |  Branch (6404:13): [True: 8.24k, False: 866k]
  ------------------
 6405|  12.9k|            case 'F':
  ------------------
  |  Branch (6405:13): [True: 4.73k, False: 869k]
  ------------------
 6406|       |               // Could be "false", "False", "FALSE", or a key/string starting with f/F
 6407|  12.9k|               if constexpr (counts::n_bool > 0) {
 6408|  12.9k|                  if ((end - it >= 5) && ((it[1] == 'a' && it[2] == 'l' && it[3] == 's' && it[4] == 'e') ||
  ------------------
  |  Branch (6408:23): [True: 12.4k, False: 551]
  |  Branch (6408:44): [True: 6.38k, False: 6.03k]
  |  Branch (6408:60): [True: 3.95k, False: 2.43k]
  |  Branch (6408:76): [True: 3.47k, False: 474]
  |  Branch (6408:92): [True: 3.15k, False: 323]
  ------------------
 6409|  9.27k|                                          (it[1] == 'A' && it[2] == 'L' && it[3] == 'S' && it[4] == 'E'))) {
  ------------------
  |  Branch (6409:44): [True: 2.33k, False: 6.93k]
  |  Branch (6409:60): [True: 1.89k, False: 439]
  |  Branch (6409:76): [True: 1.52k, False: 372]
  |  Branch (6409:92): [True: 1.38k, False: 143]
  ------------------
 6410|       |                     // Check what follows the word "false"
 6411|  4.53k|                     const auto after_false = it + 5;
 6412|  4.53k|                     const bool at_word_boundary = is_word_boundary(after_false);
 6413|       |
 6414|  4.53k|                     if (at_word_boundary) {
  ------------------
  |  Branch (6414:26): [True: 3.90k, False: 636]
  ------------------
 6415|  3.90k|                        if (has_indented_block_continuation(after_false)) {
  ------------------
  |  Branch (6415:29): [True: 328, False: 3.57k]
  ------------------
 6416|    328|                           parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6417|    328|                           return;
 6418|    328|                        }
 6419|       |                        // Check if this is a key (followed by ": ") rather than a boolean value
 6420|       |                        // "false: value" should parse as {false: value}, not as the boolean false
 6421|  3.57k|                        if ((end - it > 5) && it[5] == ':' &&
  ------------------
  |  Branch (6421:29): [True: 3.30k, False: 269]
  |  Branch (6421:47): [True: 1.91k, False: 1.39k]
  ------------------
 6422|  1.91k|                            (end - it == 6 || it[6] == ' ' || it[6] == '\t' || it[6] == '\n' || it[6] == '\r')) {
  ------------------
  |  Branch (6422:30): [True: 308, False: 1.60k]
  |  Branch (6422:47): [True: 251, False: 1.35k]
  |  Branch (6422:63): [True: 915, False: 441]
  |  Branch (6422:80): [True: 78, False: 363]
  |  Branch (6422:97): [True: 363, False: 0]
  ------------------
 6423|       |                           // This is "false:" followed by space/tab/newline/end - treat as key
 6424|  1.91k|                           parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6425|  1.91k|                           return;
 6426|  1.91k|                        }
 6427|  1.66k|                        process_yaml_variant_alternatives<V, is_yaml_variant_bool>::template op<Opts>(value, ctx, it,
 6428|  1.66k|                                                                                                      end);
 6429|  1.66k|                        return;
 6430|  3.57k|                     }
 6431|       |                     // "false" is followed by more characters (e.g., "False\b") - treat as string
 6432|  4.53k|                  }
 6433|  12.9k|               }
 6434|  9.07k|               parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6435|  12.9k|               return;
 6436|  6.27k|            case 'n':
  ------------------
  |  Branch (6436:13): [True: 6.27k, False: 868k]
  ------------------
 6437|  9.65k|            case 'N':
  ------------------
  |  Branch (6437:13): [True: 3.38k, False: 871k]
  ------------------
 6438|       |               // Could be "null", "Null", "NULL", or a key/string starting with n/N
 6439|  9.65k|               if constexpr (counts::n_null > 0) {
 6440|  9.65k|                  if ((end - it >= 4) && ((it[1] == 'u' && it[2] == 'l' && it[3] == 'l') ||
  ------------------
  |  Branch (6440:23): [True: 9.34k, False: 310]
  |  Branch (6440:44): [True: 6.26k, False: 3.07k]
  |  Branch (6440:60): [True: 5.46k, False: 807]
  |  Branch (6440:76): [True: 4.89k, False: 563]
  ------------------
 6441|  5.53k|                                          (it[1] == 'U' && it[2] == 'L' && it[3] == 'L'))) {
  ------------------
  |  Branch (6441:44): [True: 2.07k, False: 2.36k]
  |  Branch (6441:60): [True: 1.66k, False: 416]
  |  Branch (6441:76): [True: 640, False: 1.02k]
  ------------------
 6442|       |                     // Check what follows the word "null"
 6443|  5.53k|                     const auto after_null = it + 4;
 6444|  5.53k|                     const bool at_word_boundary = is_word_boundary(after_null);
 6445|       |
 6446|  5.53k|                     if (at_word_boundary) {
  ------------------
  |  Branch (6446:26): [True: 4.96k, False: 573]
  ------------------
 6447|  4.96k|                        if (has_indented_block_continuation(after_null)) {
  ------------------
  |  Branch (6447:29): [True: 281, False: 4.68k]
  ------------------
 6448|    281|                           parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6449|    281|                           return;
 6450|    281|                        }
 6451|       |                        // Check if this is a key (followed by ": ") rather than a null value
 6452|       |                        // "null: value" should parse as {null: value}, not as the null type
 6453|  4.68k|                        if ((end - it > 4) && it[4] == ':' &&
  ------------------
  |  Branch (6453:29): [True: 4.28k, False: 402]
  |  Branch (6453:47): [True: 1.80k, False: 2.47k]
  ------------------
 6454|  1.80k|                            (end - it == 5 || it[5] == ' ' || it[5] == '\t' || it[5] == '\n' || it[5] == '\r')) {
  ------------------
  |  Branch (6454:30): [True: 621, False: 1.18k]
  |  Branch (6454:47): [True: 333, False: 850]
  |  Branch (6454:63): [True: 388, False: 462]
  |  Branch (6454:80): [True: 323, False: 139]
  |  Branch (6454:97): [True: 139, False: 0]
  ------------------
 6455|       |                           // This is "null:" followed by space/tab/newline/end - treat as key
 6456|  1.80k|                           parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6457|  1.80k|                           return;
 6458|  1.80k|                        }
 6459|  2.88k|                        constexpr auto first_idx = yaml_variant_first_index_v<V, is_yaml_variant_null>;
 6460|  2.88k|                        using NullType = std::variant_alternative_t<first_idx, V>;
 6461|  2.88k|                        if (!std::holds_alternative<NullType>(value)) value = NullType{};
  ------------------
  |  Branch (6461:29): [True: 0, False: 2.88k]
  ------------------
 6462|  2.88k|                        from<YAML, NullType>::template op<Opts>(std::get<NullType>(value), ctx, it, end);
 6463|  2.88k|                        return;
 6464|  4.68k|                     }
 6465|       |                     // "null" is followed by more characters (e.g., "Null\b") - treat as string
 6466|  5.53k|                  }
 6467|  9.65k|               }
 6468|  4.68k|               parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6469|  9.65k|               return;
 6470|    393|            case '~':
  ------------------
  |  Branch (6470:13): [True: 393, False: 874k]
  ------------------
 6471|       |               // Null indicator
 6472|    393|               if constexpr (counts::n_null > 0) {
 6473|    393|                  constexpr auto first_idx = yaml_variant_first_index_v<V, is_yaml_variant_null>;
 6474|    393|                  using NullType = std::variant_alternative_t<first_idx, V>;
 6475|    393|                  if (!std::holds_alternative<NullType>(value)) value = NullType{};
  ------------------
  |  Branch (6475:23): [True: 0, False: 393]
  ------------------
 6476|    393|                  from<YAML, NullType>::template op<Opts>(std::get<NullType>(value), ctx, it, end);
 6477|    393|                  return;
 6478|    393|               }
 6479|      0|               break; // Fall through to try other types
 6480|  51.1k|            case '-':
  ------------------
  |  Branch (6480:13): [True: 51.1k, False: 823k]
  ------------------
 6481|       |               // Could be negative number or block sequence indicator
 6482|  51.1k|               if (((it + 1) == end) || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(it[1])]) {
  ------------------
  |  Branch (6482:20): [True: 696, False: 50.4k]
  |  Branch (6482:41): [True: 43.3k, False: 7.04k]
  ------------------
 6483|       |                  // Block sequence indicator "- "
 6484|  44.0k|                  if constexpr (counts::n_array > 0) {
 6485|  44.0k|                     process_yaml_variant_alternatives<V, is_yaml_variant_array>::template op<Opts>(value, ctx, it,
 6486|  44.0k|                                                                                                    end);
 6487|  44.0k|                     return;
 6488|  44.0k|                  }
 6489|  44.0k|               }
 6490|  51.1k|               if constexpr (counts::n_num > 0) {
 6491|  51.1k|                  if ((end - it >= 2) && (std::isdigit(static_cast<unsigned char>(it[1])) || it[1] == '.')) {
  ------------------
  |  Branch (6491:23): [True: 7.04k, False: 44.0k]
  |  Branch (6491:43): [True: 741, False: 6.30k]
  |  Branch (6491:94): [True: 610, False: 5.69k]
  ------------------
 6492|  1.35k|                     process_yaml_variant_alternatives<V, is_yaml_variant_num>::template op<Opts>(value, ctx, it, end);
 6493|  1.35k|                     return;
 6494|  1.35k|                  }
 6495|  51.1k|               }
 6496|  49.7k|               parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6497|  51.1k|               return;
 6498|  2.88k|            case '+':
  ------------------
  |  Branch (6498:13): [True: 2.88k, False: 871k]
  ------------------
 6499|  9.94k|            case '.':
  ------------------
  |  Branch (6499:13): [True: 7.06k, False: 867k]
  ------------------
 6500|       |               // Could be a number (.5, +5, .inf, etc.) or a string (.c, .cpp, +name, etc.)
 6501|       |               // Try parsing as number speculatively, fall back to string on failure
 6502|  9.94k|               if constexpr (counts::n_num > 0) {
 6503|  9.94k|                  auto start_it = it;
 6504|  9.94k|                  auto temp_ctx = ctx.make_speculative();
 6505|  9.94k|                  process_yaml_variant_alternatives<V, is_yaml_variant_num>::template op<Opts>(value, temp_ctx, it,
 6506|  9.94k|                                                                                               end);
 6507|  9.94k|                  ctx.alias_expansion_budget = temp_ctx.alias_expansion_budget; // charged even if rejected
 6508|  9.94k|                  ctx.key_expansion_budget = temp_ctx.key_expansion_budget;
 6509|  9.94k|                  if (!bool(temp_ctx.error)) {
  ------------------
  |  Branch (6509:23): [True: 2.13k, False: 7.81k]
  ------------------
 6510|  2.13k|                     ctx.anchors = std::move(temp_ctx.anchors);
 6511|  2.13k|                     return; // Successfully parsed as number
 6512|  2.13k|                  }
 6513|  7.81k|                  it = start_it; // Restore and fall through to string
 6514|  7.81k|               }
 6515|      0|               parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6516|  9.94k|               return;
 6517|   255k|            default:
  ------------------
  |  Branch (6517:13): [True: 255k, False: 618k]
  ------------------
 6518|       |               // Check for digit (0-9) - numeric or block mapping key starting with digit
 6519|   255k|               if (c >= '0' && c <= '9') {
  ------------------
  |  Branch (6519:20): [True: 193k, False: 62.2k]
  |  Branch (6519:32): [True: 49.1k, False: 144k]
  ------------------
 6520|       |                  // Try block mapping first (e.g., "123key: value")
 6521|  49.1k|                  if (try_parse_block_mapping_into_variant<V, Opts>(value, ctx, it, end)) {
  ------------------
  |  Branch (6521:23): [True: 30.3k, False: 18.7k]
  ------------------
 6522|  30.3k|                     return;
 6523|  30.3k|                  }
 6524|       |                  // Try numeric value speculatively - values like "12:30" look numeric but aren't
 6525|  18.7k|                  if constexpr (counts::n_num > 0) {
 6526|  18.7k|                     auto start_it = it;
 6527|  18.7k|                     auto temp_ctx = ctx.make_speculative();
 6528|  18.7k|                     process_yaml_variant_alternatives<V, is_yaml_variant_num>::template op<Opts>(value, temp_ctx, it,
 6529|  18.7k|                                                                                                  end);
 6530|  18.7k|                     ctx.alias_expansion_budget = temp_ctx.alias_expansion_budget; // charged even if rejected
 6531|  18.7k|                     ctx.key_expansion_budget = temp_ctx.key_expansion_budget;
 6532|  18.7k|                     if (!bool(temp_ctx.error)) {
  ------------------
  |  Branch (6532:26): [True: 3.31k, False: 15.4k]
  ------------------
 6533|  3.31k|                        ctx.anchors = std::move(temp_ctx.anchors);
 6534|  3.31k|                        return; // Successfully parsed as number
 6535|  3.31k|                     }
 6536|  15.4k|                     it = start_it; // Restore and fall through to string
 6537|  15.4k|                  }
 6538|       |                  // Fall through to string
 6539|      0|                  process_yaml_variant_alternatives<V, is_yaml_variant_str>::template op<Opts>(value, ctx, it, end);
 6540|  18.7k|                  return;
 6541|  49.1k|               }
 6542|       |               // Plain scalar - try block mapping, then string
 6543|   206k|               parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6544|   206k|               return;
 6545|   874k|            }
 6546|   874k|         }
 6547|       |
 6548|       |         // For non-auto-deducible variants or fallback, try each type until one succeeds
 6549|      0|         constexpr auto N = std::variant_size_v<std::remove_cvref_t<T>>;
 6550|       |
 6551|       |         // This fold discards each alternative's error and reports only that nothing fit, which
 6552|       |         // misdiagnoses a document that exhausted an expansion budget as merely the wrong shape.
 6553|       |         // Kept aside and used only if no alternative parsed, so a later one that does parse
 6554|       |         // (possible under a latched budget if it materializes no key text) is unaffected.
 6555|   874k|         error_code expansion_error{};
 6556|   874k|         std::string_view expansion_message{};
 6557|       |
 6558|   874k|         auto try_parse = [&]<size_t I>() -> bool {
 6559|   874k|            using V = std::variant_alternative_t<I, std::remove_cvref_t<T>>;
 6560|   874k|            auto start = it;
 6561|       |
 6562|   874k|            V v{};
 6563|   874k|            auto temp_ctx = ctx.make_speculative();
 6564|   874k|            from<YAML, V>::template op<Opts>(v, temp_ctx, it, end);
 6565|   874k|            ctx.alias_expansion_budget = temp_ctx.alias_expansion_budget; // charged even if rejected
 6566|   874k|            ctx.key_expansion_budget = temp_ctx.key_expansion_budget;
 6567|       |
 6568|   874k|            if (!bool(temp_ctx.error)) {
 6569|   874k|               value = std::move(v);
 6570|   874k|               ctx.anchors = std::move(temp_ctx.anchors);
 6571|   874k|               return true;
 6572|   874k|            }
 6573|       |
 6574|   874k|            if (temp_ctx.error == error_code::exceeded_max_expansion && expansion_error == error_code::none) {
 6575|   874k|               expansion_error = temp_ctx.error;
 6576|   874k|               expansion_message = temp_ctx.custom_error_message;
 6577|   874k|            }
 6578|   874k|            it = start;
 6579|   874k|            return false;
 6580|   874k|         };
 6581|       |
 6582|   874k|         bool parsed = false;
 6583|   874k|         [&]<size_t... Is>(std::index_sequence<Is...>) {
 6584|   874k|            ((parsed = parsed || try_parse.template operator()<Is>()), ...);
 6585|   874k|         }(std::make_index_sequence<N>{});
 6586|       |
 6587|   874k|         if (!parsed) {
  ------------------
  |  Branch (6587:14): [True: 0, False: 874k]
  ------------------
 6588|      0|            if (expansion_error != error_code::none) {
  ------------------
  |  Branch (6588:17): [True: 0, False: 0]
  ------------------
 6589|      0|               ctx.error = expansion_error;
 6590|      0|               ctx.custom_error_message = expansion_message;
 6591|      0|            }
 6592|      0|            else {
 6593|      0|               ctx.error = error_code::no_matching_variant_type;
 6594|      0|            }
 6595|      0|         }
 6596|   874k|      }
_ZN3glz33process_yaml_variant_alternativesINSt3__17variantIJDndNS1_12basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEbNS1_6vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS6_ISD_EEEENSC_ISD_EEEEENS_22is_yaml_variant_objectEE2opITnDaXtlNS_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj32EEERSH_TkNS_10is_contextERNSL_12yaml_contextERPKcSR_EEvOT0_OT1_OT2_T3_:
 5205|   420k|      {
 5206|   420k|         constexpr auto category_count = yaml_variant_count_v<Variant, Trait>;
 5207|       |
 5208|       |         if constexpr (category_count == 0) {
 5209|       |            ctx.error = error_code::no_matching_variant_type;
 5210|       |         }
 5211|   420k|         else if constexpr (category_count == 1) {
 5212|       |            // Only one type in this category, use it directly
 5213|   420k|            constexpr auto first_idx = yaml_variant_first_index_v<Variant, Trait>;
 5214|   420k|            using V = std::variant_alternative_t<first_idx, Variant>;
 5215|   420k|            if (!std::holds_alternative<V>(value)) value = V{};
  ------------------
  |  Branch (5215:17): [True: 420k, False: 0]
  ------------------
 5216|   420k|            from<YAML, V>::template op<Opts>(std::get<V>(value), ctx, it, end);
 5217|       |         }
 5218|       |         else {
 5219|       |            // Multiple types in this category, try each one
 5220|       |            constexpr auto N = std::variant_size_v<Variant>;
 5221|       |            bool found_match{};
 5222|       |            size_t match_idx = 0;
 5223|       |            // Only the last alternative propagates its error, so an alternative that exhausted an
 5224|       |            // expansion budget would otherwise be reported as no_matching_variant_type -- a wrong
 5225|       |            // diagnosis for a document that is hostile rather than merely the wrong shape. Held
 5226|       |            // aside and used only if nothing matched, so an alternative that does succeed later
 5227|       |            // (one that materializes no key text can still parse under a latched budget) is
 5228|       |            // unaffected.
 5229|       |            error_code expansion_error{};
 5230|       |            std::string_view expansion_message{};
 5231|       |
 5232|       |            for_each<N>([&]<size_t I>() {
 5233|       |               if (found_match) {
 5234|       |                  return;
 5235|       |               }
 5236|       |               using V = std::variant_alternative_t<I, Variant>;
 5237|       |               if constexpr (Trait<V>::value) {
 5238|       |                  auto copy_it = it;
 5239|       |                  if (!std::holds_alternative<V>(value)) {
 5240|       |                     value = V{};
 5241|       |                  }
 5242|       |
 5243|       |                  auto temp_ctx = ctx.make_speculative();
 5244|       |                  from<YAML, V>::template op<Opts>(std::get<V>(value), temp_ctx, it, end);
 5245|       |
 5246|       |                  // Charged whether or not the alternative fit: a rejected probe still replayed
 5247|       |                  // whatever aliases it reached, and an attempt that is never billed is an
 5248|       |                  // attempt that can be repeated for free.
 5249|       |                  ctx.alias_expansion_budget = temp_ctx.alias_expansion_budget;
 5250|       |                  ctx.key_expansion_budget = temp_ctx.key_expansion_budget;
 5251|       |
 5252|       |                  if (!bool(temp_ctx.error)) {
 5253|       |                     found_match = true;
 5254|       |                     ctx.anchors = std::move(temp_ctx.anchors);
 5255|       |                  }
 5256|       |                  else {
 5257|       |                     it = copy_it;
 5258|       |                     if (temp_ctx.error == error_code::exceeded_max_expansion && expansion_error == error_code::none) {
 5259|       |                        expansion_error = temp_ctx.error;
 5260|       |                        expansion_message = temp_ctx.custom_error_message;
 5261|       |                     }
 5262|       |                     if (match_idx + 1 < category_count) {
 5263|       |                        // Not the last type, continue trying
 5264|       |                     }
 5265|       |                     else {
 5266|       |                        // Last type failed, propagate error
 5267|       |                        ctx.error = temp_ctx.error;
 5268|       |                        ctx.custom_error_message = temp_ctx.custom_error_message;
 5269|       |                     }
 5270|       |                  }
 5271|       |                  ++match_idx;
 5272|       |               }
 5273|       |            });
 5274|       |
 5275|       |            if (!found_match && !bool(ctx.error)) {
 5276|       |               if (expansion_error != error_code::none) {
 5277|       |                  ctx.error = expansion_error;
 5278|       |                  ctx.custom_error_message = expansion_message;
 5279|       |               }
 5280|       |               else {
 5281|       |                  ctx.error = error_code::no_matching_variant_type;
 5282|       |               }
 5283|       |            }
 5284|       |         }
 5285|   420k|      }
_ZN3glz4fromILj450ENS_17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES1_EEEEE2opITnDaXtlNS_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj32EEERPKcRS5_TkNS_10is_contextERNS8_12yaml_contextESB_EEvOT1_OT2_OT0_T3_:
 4515|   421k|      {
 4516|   421k|         if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4516:14): [True: 0, False: 421k]
  ------------------
 4517|      0|            return;
 4518|       |
 4519|   421k|         yaml::node_preamble_state preamble{};
 4520|   421k|         if (yaml::parse_node_preamble<Opts, yaml::node_property_policy{true, true, false, false}>(
  ------------------
  |  Branch (4520:14): [True: 2.16k, False: 419k]
  ------------------
 4521|   421k|                value, ctx, it, end, preamble, [](yaml::yaml_tag tag) { return yaml::tag_valid_for_map(tag); }))
 4522|  2.16k|            return;
 4523|       |
 4524|   419k|         using key_t = typename std::remove_cvref_t<T>::key_type;
 4525|   419k|         using val_t = typename std::remove_cvref_t<T>::mapped_type;
 4526|       |
 4527|       |         // Reading a YAML mapping MERGES into the target: an entry overwrites the
 4528|       |         // value of a key that existed before the read and adds new keys, while
 4529|       |         // pre-existing keys the document does not mention are preserved (like a
 4530|       |         // struct/object read, and like json/read.hpp's per-key value[key]).
 4531|       |         // Within a single document a repeated key keeps its FIRST value -- YAML
 4532|       |         // mappings disallow duplicate keys and the conformance suite expects
 4533|       |         // first-wins, which falls out of emplace into an empty map. Any
 4534|       |         // pre-existing entry the document leaves untouched is restored on scope
 4535|       |         // exit (including error paths). When the target starts empty (the common
 4536|       |         // case) this is a no-op with negligible cost.
 4537|   419k|         std::remove_cvref_t<T> preexisting_entries;
 4538|   419k|         if (!value.empty()) {
  ------------------
  |  Branch (4538:14): [True: 0, False: 419k]
  ------------------
 4539|      0|            preexisting_entries = std::move(value);
 4540|      0|            value.clear();
 4541|      0|         }
 4542|   419k|         struct merge_restore_guard
 4543|   419k|         {
 4544|   419k|            std::remove_cvref_t<T>& target;
 4545|   419k|            std::remove_cvref_t<T>& saved;
 4546|   419k|            ~merge_restore_guard()
 4547|   419k|            {
 4548|       |               // emplace is a no-op for keys the document already wrote, so only
 4549|       |               // untouched pre-existing entries are put back.
 4550|   419k|               for (auto& entry : saved) {
 4551|   419k|                  target.emplace(entry.first, std::move(entry.second));
 4552|   419k|               }
 4553|   419k|            }
 4554|   419k|         } merge_restore{value, preexisting_entries};
 4555|       |
 4556|   419k|         const bool treat_as_block_mapping =
 4557|   419k|            !yaml::check_flow_context(Opts) && *it == '{' && yaml::inline_value_has_plain_mapping_indicator(it, end);
  ------------------
  |  Branch (4557:13): [True: 419k, Folded]
  |  Branch (4557:48): [True: 32.4k, False: 387k]
  |  Branch (4557:62): [True: 1.08k, False: 31.3k]
  ------------------
 4558|       |
 4559|   419k|         if (*it == '{' && !treat_as_block_mapping) {
  ------------------
  |  Branch (4559:14): [True: 32.4k, False: 387k]
  |  Branch (4559:28): [True: 31.3k, False: 1.08k]
  ------------------
 4560|       |            // Flow mapping
 4561|  31.3k|            ++it;
 4562|       |            // Skip whitespace and newlines after opening brace
 4563|  31.3k|            yaml::skip_ws_and_newlines(it, end);
 4564|       |
 4565|  31.3k|            if (it != end && *it == '}') {
  ------------------
  |  Branch (4565:17): [True: 30.9k, False: 409]
  |  Branch (4565:30): [True: 2.90k, False: 28.0k]
  ------------------
 4566|  2.90k|               ++it;
 4567|  2.90k|               yaml::validate_flow_node_adjacent_tail(ctx, it, end);
 4568|  2.90k|               if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4568:20): [True: 8, False: 2.89k]
  ------------------
 4569|      8|                  return;
 4570|  2.89k|               yaml::finalize_node_anchor(preamble.node_props, ctx, it);
 4571|  2.89k|               return;
 4572|  2.90k|            }
 4573|       |
 4574|   189k|            while (it != end) {
  ------------------
  |  Branch (4574:20): [True: 186k, False: 2.14k]
  ------------------
 4575|       |               // Skip whitespace and newlines at start of each iteration
 4576|   186k|               yaml::skip_ws_and_newlines(it, end);
 4577|       |
 4578|   186k|               if (it != end && *it == '}') {
  ------------------
  |  Branch (4578:20): [True: 186k, False: 0]
  |  Branch (4578:33): [True: 2.80k, False: 184k]
  ------------------
 4579|  2.80k|                  ++it;
 4580|  2.80k|                  yaml::validate_flow_node_adjacent_tail(ctx, it, end);
 4581|  2.80k|                  if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4581:23): [True: 24, False: 2.77k]
  ------------------
 4582|     24|                     return;
 4583|  2.77k|                  break;
 4584|  2.80k|               }
 4585|       |
 4586|   184k|               bool explicit_flow_key = false;
 4587|   184k|               auto explicit_probe = it;
 4588|   184k|               yaml::skip_inline_ws(explicit_probe, end);
 4589|   184k|               if (explicit_probe != end && *explicit_probe == '?') {
  ------------------
  |  Branch (4589:20): [True: 184k, False: 0]
  |  Branch (4589:45): [True: 20.1k, False: 163k]
  ------------------
 4590|  20.1k|                  const auto after_q = explicit_probe + 1;
 4591|  20.1k|                  if (after_q == end || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*after_q)] ||
  ------------------
  |  Branch (4591:23): [True: 1, False: 20.1k]
  |  Branch (4591:41): [True: 3.96k, False: 16.2k]
  ------------------
 4592|  16.8k|                      *after_q == ',' || *after_q == '}') {
  ------------------
  |  Branch (4592:23): [True: 12.5k, False: 3.69k]
  |  Branch (4592:42): [True: 336, False: 3.35k]
  ------------------
 4593|  16.8k|                     explicit_flow_key = true;
 4594|  16.8k|                     it = explicit_probe + 1;
 4595|  16.8k|                     yaml::skip_flow_ws_and_newlines(ctx, it, end);
 4596|  16.8k|                     if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4596:26): [True: 2, False: 16.8k]
  ------------------
 4597|      2|                        return;
 4598|  16.8k|                  }
 4599|  20.1k|               }
 4600|       |               // Parse key
 4601|   184k|               key_t key{};
 4602|   184k|               if constexpr (std::same_as<std::remove_cvref_t<key_t>, std::string>) {
 4603|   184k|                  if (explicit_flow_key && it != end && (*it == ':' || *it == ',' || *it == '}')) {
  ------------------
  |  Branch (4603:23): [True: 16.8k, False: 167k]
  |  Branch (4603:44): [True: 16.8k, False: 2]
  |  Branch (4603:58): [True: 354, False: 16.4k]
  |  Branch (4603:72): [True: 12.5k, False: 3.93k]
  |  Branch (4603:86): [True: 414, False: 3.52k]
  ------------------
 4604|  13.3k|                     key.clear();
 4605|  13.3k|                  }
 4606|   170k|                  else {
 4607|   170k|                     auto key_probe = it;
 4608|   170k|                     yaml::skip_inline_ws(key_probe, end);
 4609|       |
 4610|       |                     // Use full node parsing only for structurally complex flow keys.
 4611|       |                     // Plain/quoted/alias keys stay on parse_yaml_key() for compatibility.
 4612|   170k|                     bool parse_complex_flow_key = false;
 4613|   170k|                     if (key_probe != end) {
  ------------------
  |  Branch (4613:26): [True: 170k, False: 2]
  ------------------
 4614|   170k|                        if (*key_probe == '[' || *key_probe == '{') {
  ------------------
  |  Branch (4614:29): [True: 611, False: 170k]
  |  Branch (4614:50): [True: 3.81k, False: 166k]
  ------------------
 4615|  4.42k|                           parse_complex_flow_key = true;
 4616|  4.42k|                        }
 4617|   166k|                        else if (*key_probe == '&') {
  ------------------
  |  Branch (4617:34): [True: 18.4k, False: 147k]
  ------------------
 4618|  18.4k|                           ++key_probe;
 4619|  18.4k|                           yaml::parse_anchor_name(key_probe, end);
 4620|  18.4k|                           yaml::skip_inline_ws(key_probe, end);
 4621|  18.4k|                           if (key_probe != end && (*key_probe == '[' || *key_probe == '{')) {
  ------------------
  |  Branch (4621:32): [True: 18.4k, False: 31]
  |  Branch (4621:53): [True: 303, False: 18.1k]
  |  Branch (4621:74): [True: 520, False: 17.6k]
  ------------------
 4622|    823|                              parse_complex_flow_key = true;
 4623|    823|                           }
 4624|  18.4k|                        }
 4625|   170k|                     }
 4626|       |
 4627|   170k|                     if (parse_complex_flow_key) {
  ------------------
  |  Branch (4627:26): [True: 5.25k, False: 165k]
  ------------------
 4628|  5.25k|                        glz::generic key_node{};
 4629|  5.25k|                        from<YAML, glz::generic>::template op<yaml::flow_context_on<Opts>()>(key_node, ctx, it, end);
 4630|  5.25k|                        if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4630:29): [True: 641, False: 4.60k]
  ------------------
 4631|    641|                           return;
 4632|  4.60k|                        if (!yaml::materialize_key(key, key_node, ctx)) [[unlikely]]
  ------------------
  |  Branch (4632:29): [True: 1, False: 4.60k]
  ------------------
 4633|      1|                           return;
 4634|  4.60k|                     }
 4635|   165k|                     else {
 4636|   165k|                        if (!yaml::parse_yaml_key(key, ctx, it, end, true)) {
  ------------------
  |  Branch (4636:29): [True: 593, False: 164k]
  ------------------
 4637|    593|                           return;
 4638|    593|                        }
 4639|   165k|                     }
 4640|   170k|                  }
 4641|       |               }
 4642|       |               else {
 4643|       |                  if (explicit_flow_key && it != end && (*it == ':' || *it == ',' || *it == '}')) {
 4644|       |                     ctx.error = error_code::syntax_error;
 4645|       |                     return;
 4646|       |                  }
 4647|       |                  from<YAML, key_t>::template op<yaml::flow_context_on<Opts>()>(key, ctx, it, end);
 4648|       |                  if (bool(ctx.error)) [[unlikely]]
 4649|       |                     return;
 4650|       |               }
 4651|       |
 4652|       |               // Separation between flow key and ':' may include comments/newlines.
 4653|       |               // In flow context, newlines are allowed between key and ':'.
 4654|   182k|               yaml::skip_flow_ws_and_newlines(ctx, it, end);
 4655|   184k|               if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4655:20): [True: 15, False: 184k]
  ------------------
 4656|     15|                  return;
 4657|       |
 4658|   184k|               auto parse_implicit_null = [&](val_t& val) -> bool {
 4659|   184k|                  if constexpr (nullable_like<std::remove_cvref_t<val_t>>) {
 4660|   184k|                     val = {};
 4661|   184k|                     return true;
 4662|   184k|                  }
 4663|   184k|                  else if constexpr (std::same_as<std::remove_cvref_t<val_t>, glz::generic>) {
 4664|   184k|                     val = glz::generic{};
 4665|   184k|                     return true;
 4666|   184k|                  }
 4667|   184k|                  else {
 4668|   184k|                     static constexpr std::string_view null_value{"null"};
 4669|   184k|                     auto null_it = null_value.data();
 4670|   184k|                     from<YAML, val_t>::template op<yaml::flow_context_on<Opts>()>(
 4671|   184k|                        val, ctx, null_it, null_value.data() + null_value.size());
 4672|   184k|                     return !bool(ctx.error);
 4673|   184k|                  }
 4674|   184k|               };
 4675|       |
 4676|   184k|               if (it != end && (*it == ',' || *it == '}')) {
  ------------------
  |  Branch (4676:20): [True: 181k, False: 2.26k]
  |  Branch (4676:34): [True: 138k, False: 42.8k]
  |  Branch (4676:48): [True: 7.76k, False: 35.1k]
  ------------------
 4677|   146k|                  val_t val{};
 4678|   146k|                  if (!parse_implicit_null(val)) [[unlikely]]
  ------------------
  |  Branch (4678:23): [True: 0, False: 146k]
  ------------------
 4679|      0|                     return;
 4680|       |
 4681|   146k|                  value.emplace(std::move(key), std::move(val));
 4682|       |
 4683|   146k|                  if (*it == '}') {
  ------------------
  |  Branch (4683:23): [True: 7.76k, False: 138k]
  ------------------
 4684|  7.76k|                     ++it;
 4685|  7.76k|                     yaml::validate_flow_node_adjacent_tail(ctx, it, end);
 4686|  7.76k|                     if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4686:26): [True: 32, False: 7.73k]
  ------------------
 4687|     32|                        return;
 4688|  7.73k|                     break;
 4689|  7.76k|                  }
 4690|       |
 4691|   138k|                  ++it; // skip comma
 4692|   138k|                  yaml::skip_ws_and_newlines(it, end);
 4693|   138k|                  continue;
 4694|   146k|               }
 4695|       |
 4696|  37.3k|               if (it == end || *it != ':') {
  ------------------
  |  Branch (4696:20): [True: 2.26k, False: 35.1k]
  |  Branch (4696:33): [True: 157, False: 34.9k]
  ------------------
 4697|  1.18k|                  ctx.error = error_code::syntax_error;
 4698|  1.18k|                  return;
 4699|  1.18k|               }
 4700|  36.1k|               ++it;
 4701|       |
 4702|  36.1k|               yaml::skip_flow_ws_and_newlines(ctx, it, end);
 4703|  36.1k|               if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4703:20): [True: 7, False: 36.1k]
  ------------------
 4704|      7|                  return;
 4705|       |
 4706|       |               // Omitted value after an explicit ':' maps to an implicit null.
 4707|  36.1k|               if (it != end && (*it == ',' || *it == '}')) {
  ------------------
  |  Branch (4707:20): [True: 34.9k, False: 1.23k]
  |  Branch (4707:34): [True: 2.59k, False: 32.3k]
  |  Branch (4707:48): [True: 10.4k, False: 21.8k]
  ------------------
 4708|  13.0k|                  val_t val{};
 4709|  13.0k|                  if (!parse_implicit_null(val)) [[unlikely]]
  ------------------
  |  Branch (4709:23): [True: 0, False: 13.0k]
  ------------------
 4710|      0|                     return;
 4711|       |
 4712|  13.0k|                  value.emplace(std::move(key), std::move(val));
 4713|       |
 4714|  13.0k|                  if (*it == '}') {
  ------------------
  |  Branch (4714:23): [True: 10.4k, False: 2.59k]
  ------------------
 4715|  10.4k|                     ++it;
 4716|  10.4k|                     yaml::validate_flow_node_adjacent_tail(ctx, it, end);
 4717|  10.4k|                     if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4717:26): [True: 7, False: 10.4k]
  ------------------
 4718|      7|                        return;
 4719|  10.4k|                     break;
 4720|  10.4k|                  }
 4721|       |
 4722|  2.59k|                  ++it; // skip comma
 4723|  2.59k|                  yaml::skip_ws_and_newlines(it, end);
 4724|  2.59k|                  continue;
 4725|  13.0k|               }
 4726|       |
 4727|       |               // Parse value
 4728|  23.1k|               val_t val{};
 4729|  23.1k|               from<YAML, val_t>::template op<yaml::flow_context_on<Opts>()>(val, ctx, it, end);
 4730|  23.1k|               if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4730:20): [True: 239, False: 22.8k]
  ------------------
 4731|    239|                  return;
 4732|       |
 4733|  22.8k|               value.emplace(std::move(key), std::move(val));
 4734|       |
 4735|  22.8k|               yaml::skip_inline_ws(it, end);
 4736|       |
 4737|  22.8k|               if (it != end && *it == '}') {
  ------------------
  |  Branch (4737:20): [True: 21.1k, False: 1.75k]
  |  Branch (4737:33): [True: 1.64k, False: 19.4k]
  ------------------
 4738|  1.64k|                  ++it;
 4739|  1.64k|                  yaml::validate_flow_node_adjacent_tail(ctx, it, end);
 4740|  1.64k|                  if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4740:23): [True: 28, False: 1.61k]
  ------------------
 4741|     28|                     return;
 4742|  1.61k|                  break;
 4743|  1.64k|               }
 4744|  21.2k|               else if (it != end && *it == ',') {
  ------------------
  |  Branch (4744:25): [True: 19.4k, False: 1.75k]
  |  Branch (4744:38): [True: 17.2k, False: 2.28k]
  ------------------
 4745|  17.2k|                  ++it;
 4746|       |                  // Skip whitespace and newlines after comma
 4747|  17.2k|                  yaml::skip_ws_and_newlines(it, end);
 4748|  17.2k|               }
 4749|  4.04k|               else if (it != end && (*it == '\n' || *it == '\r')) {
  ------------------
  |  Branch (4749:25): [True: 2.28k, False: 1.75k]
  |  Branch (4749:39): [True: 1.90k, False: 381]
  |  Branch (4749:54): [True: 304, False: 77]
  ------------------
 4750|       |                  // Newlines may precede either the closing brace or the
 4751|       |                  // separator comma for the next entry.
 4752|  2.20k|                  yaml::skip_ws_and_newlines(it, end);
 4753|  2.20k|                  if (it != end && *it == '}') {
  ------------------
  |  Branch (4753:23): [True: 2.20k, False: 1]
  |  Branch (4753:36): [True: 388, False: 1.82k]
  ------------------
 4754|    388|                     ++it;
 4755|    388|                     yaml::validate_flow_node_adjacent_tail(ctx, it, end);
 4756|    388|                     if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4756:26): [True: 2, False: 386]
  ------------------
 4757|      2|                        return;
 4758|    386|                     break;
 4759|    388|                  }
 4760|  1.82k|                  if (it != end && *it == ',') {
  ------------------
  |  Branch (4760:23): [True: 1.82k, False: 1]
  |  Branch (4760:36): [True: 1.81k, False: 8]
  ------------------
 4761|  1.81k|                     ++it;
 4762|  1.81k|                     yaml::skip_ws_and_newlines(it, end);
 4763|  1.81k|                     continue;
 4764|  1.81k|                  }
 4765|      9|                  ctx.error = error_code::syntax_error;
 4766|      9|                  return;
 4767|  1.82k|               }
 4768|  1.83k|               else {
 4769|  1.83k|                  ctx.error = error_code::syntax_error;
 4770|  1.83k|                  return;
 4771|  1.83k|               }
 4772|  22.8k|            }
 4773|  28.4k|         }
 4774|   388k|         else {
 4775|       |            // Block mapping - use shared loop with map-specific callback
 4776|   388k|            yaml::parse_block_mapping_loop<Opts>(
 4777|   388k|               ctx, it, end, int32_t(-1), [&](auto& ctx, auto& it, auto end, int32_t line_indent) -> bool {
 4778|   388k|                  auto parse_map_value = [&](val_t& val) -> bool {
 4779|   388k|                     if (it != end && !yaml::line_end_or_comment_table[static_cast<uint8_t>(*it)]) {
 4780|   388k|                        bool line_starts_with_explicit_value_indicator = false;
 4781|       |
 4782|       |                        // Inline mapping values in block context cannot start with a
 4783|       |                        // plain "key: value" pair on the same line (e.g. "a: b: c").
 4784|       |                        // Such constructs are malformed unless wrapped in flow
 4785|       |                        // delimiters ({...} / [...]) or quoted.
 4786|   388k|                        if constexpr (std::is_pointer_v<std::decay_t<decltype(it)>>) {
 4787|   388k|                           if (ctx.stream_begin) {
 4788|   388k|                              auto is_line_content_start = [&](auto pos) {
 4789|   388k|                                 return !ctx.line_prefix_before(pos).has_content;
 4790|   388k|                              };
 4791|       |
 4792|   388k|                              auto line_has_explicit_value_indicator = [&](auto pos) {
 4793|   388k|                                 const char* line = ctx.line_begin_of(pos);
 4794|   388k|                                 while (line != end && (*line == ' ' || *line == '\t')) ++line;
 4795|   388k|                                 return line != end && *line == ':';
 4796|   388k|                              };
 4797|       |
 4798|   388k|                              if (!is_line_content_start(it) &&
 4799|   388k|                                  yaml::inline_value_has_plain_mapping_indicator(it, end) &&
 4800|   388k|                                  !line_has_explicit_value_indicator(it)) {
 4801|   388k|                                 ctx.error = error_code::syntax_error;
 4802|   388k|                                 return false;
 4803|   388k|                              }
 4804|   388k|                              line_starts_with_explicit_value_indicator = line_has_explicit_value_indicator(it);
 4805|   388k|                           }
 4806|   388k|                        }
 4807|       |
 4808|   388k|                        if (*it == '-' &&
 4809|   388k|                            ((it + 1) == end || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*(it + 1))]) &&
 4810|   388k|                            !line_starts_with_explicit_value_indicator) {
 4811|       |                           // "key: - item" is not valid block sequence syntax.
 4812|   388k|                           ctx.error = error_code::syntax_error;
 4813|   388k|                           return false;
 4814|   388k|                        }
 4815|       |
 4816|   388k|                        if (!ctx.push_indent(line_indent + 1)) [[unlikely]]
 4817|   388k|                           return false;
 4818|   388k|                        from<YAML, val_t>::template op<Opts>(val, ctx, it, end);
 4819|   388k|                        ctx.pop_indent();
 4820|   388k|                     }
 4821|   388k|                     else {
 4822|   388k|                        int32_t nested_indent = yaml::detect_nested_value_indent(ctx, it, end, line_indent);
 4823|   388k|                        if (nested_indent >= 0) {
 4824|   388k|                           yaml::skip_to_content(it, end);
 4825|   388k|                           if (it != end && *it == ':' && (it + 1) != end && *(it + 1) == '\t') {
 4826|   388k|                              ctx.error = error_code::syntax_error;
 4827|   388k|                              return false;
 4828|   388k|                           }
 4829|       |                           // A struct value reads the pushed indent as its own key column;
 4830|       |                           // every other value type reads it as the enclosing baseline.
 4831|   388k|                           const int32_t value_indent =
 4832|   388k|                              yaml::receives_block_mapping_column<val_t>() ? nested_indent : nested_indent - 1;
 4833|   388k|                           if (!ctx.push_indent(value_indent)) [[unlikely]]
 4834|   388k|                              return false;
 4835|   388k|                           from<YAML, val_t>::template op<Opts>(val, ctx, it, end);
 4836|   388k|                           ctx.pop_indent();
 4837|   388k|                        }
 4838|   388k|                     }
 4839|   388k|                     return !bool(ctx.error);
 4840|   388k|                  };
 4841|       |
 4842|       |                  // Explicit key entry form:
 4843|       |                  // ? key
 4844|       |                  // : value
 4845|   388k|                  if (*it == '?' && ((it + 1) != end) && *(it + 1) == '\t') {
 4846|   388k|                     ctx.error = error_code::syntax_error;
 4847|   388k|                     return false;
 4848|   388k|                  }
 4849|   388k|                  if (*it == '?' && ((it + 1) == end || *(it + 1) == ' ' || *(it + 1) == '\n' || *(it + 1) == '\r')) {
 4850|   388k|                     ++it; // skip '?'
 4851|   388k|                     yaml::skip_inline_ws(it, end);
 4852|       |
 4853|   388k|                     const int32_t explicit_value_indicator_indent =
 4854|   388k|                        (ctx.current_indent() < 0) ? 0 : (ctx.current_indent() + 1);
 4855|       |
 4856|   388k|                     key_t key{};
 4857|   388k|                     if constexpr (std::same_as<std::remove_cvref_t<key_t>, std::string>) {
 4858|   388k|                        auto to_string_key = [&](glz::generic& key_node) {
 4859|   388k|                           return yaml::materialize_key(key, key_node, ctx);
 4860|   388k|                        };
 4861|       |
 4862|   388k|                        auto key_it = it;
 4863|   388k|                        yaml::skip_inline_ws(key_it, end);
 4864|       |
 4865|   388k|                        auto content = key_it;
 4866|   388k|                        yaml::skip_to_content(content, end);
 4867|   388k|                        bool handled_anchor_only_empty_key = false;
 4868|       |
 4869|       |                        // Anchor on an empty explicit key node:
 4870|       |                        //   ? &a
 4871|       |                        //   : value
 4872|   388k|                        if (content != end && *content == '&') {
 4873|   388k|                           auto anchor_probe = content + 1;
 4874|   388k|                           auto anchor_name = yaml::parse_anchor_name(anchor_probe, end);
 4875|   388k|                           if (!anchor_name.empty()) {
 4876|   388k|                              auto after_anchor = anchor_probe;
 4877|   388k|                              yaml::skip_inline_ws(after_anchor, end);
 4878|       |
 4879|   388k|                              auto value_indicator = after_anchor;
 4880|   388k|                              if (value_indicator != end && *value_indicator == ':') {
 4881|   388k|                                 key.clear();
 4882|   388k|                                 ctx.anchors[std::string(anchor_name)] = {content, content, ctx.current_indent()};
 4883|   388k|                                 it = value_indicator;
 4884|   388k|                                 handled_anchor_only_empty_key = true;
 4885|   388k|                              }
 4886|   388k|                              else {
 4887|   388k|                                 if (value_indicator != end && *value_indicator == '#') {
 4888|   388k|                                    yaml::skip_comment(value_indicator, end);
 4889|   388k|                                 }
 4890|   388k|                                 if (value_indicator != end && (*value_indicator == '\n' || *value_indicator == '\r')) {
 4891|   388k|                                    yaml::skip_newline(value_indicator, end);
 4892|   388k|                                    auto value_line = value_indicator;
 4893|   388k|                                    int32_t value_indent = yaml::measure_indent(value_line, end, ctx);
 4894|   388k|                                    if (bool(ctx.error)) [[unlikely]]
 4895|   388k|                                       return false;
 4896|   388k|                                    if (value_line != end && *value_line == ':' &&
 4897|   388k|                                        value_indent == explicit_value_indicator_indent) {
 4898|   388k|                                       key.clear();
 4899|   388k|                                       ctx.anchors[std::string(anchor_name)] = {content, content, ctx.current_indent()};
 4900|   388k|                                       it = value_line;
 4901|   388k|                                       handled_anchor_only_empty_key = true;
 4902|   388k|                                    }
 4903|   388k|                                    else if (value_line != end && *value_line == ':') {
 4904|       |                                       // In explicit-key form ("? &a"), a following ':'
 4905|       |                                       // starts the outer value indicator only at the same
 4906|       |                                       // indentation. A deeper-indented ': value' is malformed.
 4907|   388k|                                       ctx.error = error_code::syntax_error;
 4908|   388k|                                       return false;
 4909|   388k|                                    }
 4910|   388k|                                 }
 4911|   388k|                              }
 4912|   388k|                           }
 4913|   388k|                        }
 4914|       |
 4915|   388k|                        const bool key_content_spans_lines = [&] {
 4916|   388k|                           auto scan = key_it;
 4917|   388k|                           while (scan != content && scan != end) {
 4918|   388k|                              if (*scan == '\n' || *scan == '\r') return true;
 4919|   388k|                              ++scan;
 4920|   388k|                           }
 4921|   388k|                           return false;
 4922|   388k|                        }();
 4923|       |
 4924|   388k|                        if (handled_anchor_only_empty_key) {
 4925|       |                           // 'it' already points to the explicit value indicator ':'
 4926|   388k|                        }
 4927|   388k|                        else if (content == end || (*content == ':' && key_content_spans_lines)) {
 4928|   388k|                           key.clear();
 4929|   388k|                           it = content;
 4930|   388k|                        }
 4931|   388k|                        else {
 4932|       |                           // Explicit mapping keys ('? key-node') are full YAML nodes.
 4933|       |                           // Parse the key node structurally (not via plain-key scanning)
 4934|       |                           // so inputs like '? []: x' and '? JSON: like' are interpreted
 4935|       |                           // as complex keys, not split into implicit key/value pairs.
 4936|   388k|                           auto key_node_it = content;
 4937|   388k|                           auto key_node_end = end;
 4938|   388k|                           if constexpr (std::is_pointer_v<std::decay_t<It>>) {
 4939|       |                              // In explicit-key form, a following standalone ':'
 4940|       |                              // line (same or lower indentation) belongs to the
 4941|       |                              // outer mapping value, not the key node itself.
 4942|   388k|                              auto scan = content;
 4943|   388k|                              while (scan != end) {
 4944|   388k|                                 while (scan != end && *scan != '\n' && *scan != '\r') {
 4945|   388k|                                    ++scan;
 4946|   388k|                                 }
 4947|   388k|                                 if (scan == end) {
 4948|   388k|                                    break;
 4949|   388k|                                 }
 4950|       |
 4951|   388k|                                 yaml::skip_newline(scan, end);
 4952|   388k|                                 auto line_start = scan;
 4953|       |
 4954|   388k|                                 int32_t indicator_indent = 0;
 4955|   388k|                                 while (scan != end && *scan == ' ') {
 4956|   388k|                                    ++indicator_indent;
 4957|   388k|                                    ++scan;
 4958|   388k|                                 }
 4959|       |
 4960|   388k|                                 if (scan != end && *scan == ':') {
 4961|   388k|                                    const auto after_colon = scan + 1;
 4962|   388k|                                    if ((after_colon == end ||
 4963|   388k|                                         yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*after_colon)]) &&
 4964|   388k|                                        indicator_indent <= line_indent) {
 4965|   388k|                                       key_node_end = line_start;
 4966|   388k|                                       break;
 4967|   388k|                                    }
 4968|   388k|                                 }
 4969|   388k|                              }
 4970|   388k|                           }
 4971|       |
 4972|   388k|                           glz::generic key_node{};
 4973|   388k|                           const bool prev_explicit_mapping_key_context = ctx.explicit_mapping_key_context;
 4974|   388k|                           ctx.explicit_mapping_key_context = true;
 4975|   388k|                           from<YAML, glz::generic>::template op<Opts>(key_node, ctx, key_node_it, key_node_end);
 4976|   388k|                           ctx.explicit_mapping_key_context = prev_explicit_mapping_key_context;
 4977|   388k|                           if (bool(ctx.error)) [[unlikely]]
 4978|   388k|                              return false;
 4979|   388k|                           it = key_node_it;
 4980|   388k|                           if (!to_string_key(key_node)) [[unlikely]]
 4981|   388k|                              return false;
 4982|   388k|                        }
 4983|   388k|                     }
 4984|   388k|                     else {
 4985|   388k|                        if (it != end && !yaml::line_end_or_comment_table[static_cast<uint8_t>(*it)]) {
 4986|   388k|                           from<YAML, key_t>::template op<Opts>(key, ctx, it, end);
 4987|   388k|                           if (bool(ctx.error)) [[unlikely]]
 4988|   388k|                              return false;
 4989|   388k|                        }
 4990|   388k|                     }
 4991|       |
 4992|   388k|                     yaml::skip_inline_ws(it, end);
 4993|   388k|                     yaml::skip_comment(it, end);
 4994|       |
 4995|       |                     // Value indicator may appear on the next line at the same indent.
 4996|   388k|                     if (it != end && (*it == '\n' || *it == '\r')) {
 4997|   388k|                        auto probe = it;
 4998|   388k|                        bool found_value_indicator = false;
 4999|       |
 5000|   388k|                        while (probe != end && (*probe == '\n' || *probe == '\r')) {
 5001|   388k|                           yaml::skip_newline(probe, end);
 5002|       |
 5003|   388k|                           auto value_line = probe;
 5004|   388k|                           int32_t value_indent = yaml::measure_indent(value_line, end, ctx);
 5005|   388k|                           if (bool(ctx.error)) [[unlikely]]
 5006|   388k|                              return false;
 5007|       |
 5008|   388k|                           if (value_line == end || *value_line == '\n' || *value_line == '\r') {
 5009|   388k|                              probe = value_line;
 5010|   388k|                              continue; // blank line
 5011|   388k|                           }
 5012|   388k|                           if (*value_line == '#') {
 5013|   388k|                              yaml::skip_comment(value_line, end);
 5014|   388k|                              probe = value_line;
 5015|   388k|                              continue; // comment-only line
 5016|   388k|                           }
 5017|   388k|                           if (*value_line == ':' && value_indent == explicit_value_indicator_indent) {
 5018|   388k|                              it = value_line;
 5019|   388k|                              found_value_indicator = true;
 5020|   388k|                           }
 5021|   388k|                           break;
 5022|   388k|                        }
 5023|       |
 5024|   388k|                        if (found_value_indicator) {
 5025|   388k|                           yaml::skip_inline_ws(it, end);
 5026|   388k|                        }
 5027|   388k|                     }
 5028|       |
 5029|   388k|                     val_t val{};
 5030|   388k|                     if (it != end && *it == ':') {
 5031|   388k|                        ++it;
 5032|   388k|                        if (it != end && *it == '\t') {
 5033|   388k|                           ctx.error = error_code::syntax_error;
 5034|   388k|                           return false;
 5035|   388k|                        }
 5036|   388k|                        if (it != end && (*it == '\n' || *it == '\r')) {
 5037|   388k|                           auto probe = it;
 5038|   388k|                           yaml::skip_newline(probe, end);
 5039|   388k|                           while (probe != end && *probe == ' ') ++probe;
 5040|   388k|                           if (probe != end && *probe == ':' && ((probe + 1) != end) && *(probe + 1) == '\t') {
 5041|   388k|                              ctx.error = error_code::syntax_error;
 5042|   388k|                              return false;
 5043|   388k|                           }
 5044|   388k|                        }
 5045|   388k|                        yaml::skip_inline_ws(it, end);
 5046|   388k|                        if (!parse_map_value(val)) [[unlikely]]
 5047|   388k|                           return false;
 5048|   388k|                     }
 5049|       |
 5050|   388k|                     value.emplace(std::move(key), std::move(val));
 5051|   388k|                     return true;
 5052|   388k|                  }
 5053|       |
 5054|   388k|                  key_t key{};
 5055|   388k|                  if constexpr (std::same_as<std::remove_cvref_t<key_t>, std::string>) {
 5056|   388k|                     auto key_probe = it;
 5057|   388k|                     yaml::skip_inline_ws(key_probe, end);
 5058|   388k|                     const bool complex_flow_key = (key_probe != end && (*key_probe == '[' || *key_probe == '{'));
 5059|   388k|                     if (complex_flow_key) {
 5060|   388k|                        glz::generic key_node{};
 5061|   388k|                        from<YAML, glz::generic>::template op<yaml::flow_context_on<Opts>()>(key_node, ctx, it, end);
 5062|   388k|                        if (bool(ctx.error)) [[unlikely]]
 5063|   388k|                           return false;
 5064|   388k|                        if (!yaml::materialize_key(key, key_node, ctx)) [[unlikely]]
 5065|   388k|                           return false;
 5066|   388k|                     }
 5067|   388k|                     else {
 5068|   388k|                        if (!yaml::parse_yaml_key(key, ctx, it, end, false)) {
 5069|   388k|                           return false;
 5070|   388k|                        }
 5071|   388k|                     }
 5072|   388k|                  }
 5073|   388k|                  else {
 5074|   388k|                     from<YAML, key_t>::template op<Opts>(key, ctx, it, end);
 5075|   388k|                     if (bool(ctx.error)) [[unlikely]]
 5076|   388k|                        return false;
 5077|   388k|                  }
 5078|       |
 5079|   388k|                  yaml::skip_inline_ws(it, end);
 5080|       |
 5081|   388k|                  if (it == end || *it != ':') {
 5082|   388k|                     ctx.error = error_code::syntax_error;
 5083|   388k|                     return false;
 5084|   388k|                  }
 5085|   388k|                  ++it;
 5086|   388k|                  yaml::skip_inline_ws(it, end);
 5087|       |
 5088|   388k|                  val_t val{};
 5089|   388k|                  if (!parse_map_value(val)) [[unlikely]]
 5090|   388k|                     return false;
 5091|       |
 5092|   388k|                  value.emplace(std::move(key), std::move(val));
 5093|   388k|                  return true;
 5094|   388k|               });
 5095|   388k|         }
 5096|       |
 5097|   413k|         yaml::finalize_node_anchor(preamble.node_props, ctx, it);
 5098|   413k|      }
_ZN3glz4yaml19parse_node_preambleITnDaXtlNS0_9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj32EEEXtlNS0_20node_property_policyELb1ELb1EEELb0ERNS_17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES4_EEEENS0_12yaml_contextEPKcSC_ZNS_4fromILj450ES8_E2opITnDaXtlS2_Lj450ELb1ELb0ELb1ELh2ELb0ELj32EEERSC_S9_TkNS_10is_contextERSA_SC_EEvOT1_OT2_OT0_T3_EUlNS0_8yaml_tagEE_EEbSL_RSO_RT4_T5_RNS0_19node_preamble_stateEOT6_:
  465|   421k|      {
  466|   421k|         skip_inline_ws(it, end);
  467|       |
  468|   421k|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (468:14): [True: 1, False: 421k]
  ------------------
  469|      1|            if constexpr (!AllowEmptyInput) {
  470|      1|               ctx.error = error_code::unexpected_end;
  471|      1|            }
  472|      1|            return true;
  473|      1|         }
  474|       |
  475|   421k|         preamble.tag = parse_yaml_tag(it, end, ctx);
  476|   421k|         if (preamble.tag == yaml_tag::unknown) [[unlikely]] {
  ------------------
  |  Branch (476:14): [True: 2, False: 421k]
  ------------------
  477|      2|            ctx.error = error_code::syntax_error;
  478|      2|            return true;
  479|      2|         }
  480|   421k|         if (!tag_validator(preamble.tag)) [[unlikely]] {
  ------------------
  |  Branch (480:14): [True: 1, False: 421k]
  ------------------
  481|      1|            ctx.error = error_code::syntax_error;
  482|      1|            return true;
  483|      1|         }
  484|       |
  485|   421k|         skip_inline_ws(it, end);
  486|       |
  487|   421k|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (487:14): [True: 4, False: 421k]
  ------------------
  488|      4|            if constexpr (!AllowEmptyInput) {
  489|      4|               ctx.error = error_code::unexpected_end;
  490|      4|            }
  491|      4|            return true;
  492|      4|         }
  493|       |
  494|   421k|         if (parse_node_properties<Opts, PropertyPolicy>(std::forward<T>(value), ctx, it, end, preamble.node_props)) {
  ------------------
  |  Branch (494:14): [True: 2.15k, False: 419k]
  ------------------
  495|  2.15k|            return true;
  496|  2.15k|         }
  497|       |
  498|   419k|         return false;
  499|   421k|      }
_ZZN3glz4fromILj450ENS_17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES1_EEEEE2opITnDaXtlNS_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj32EEERPKcRS5_TkNS_10is_contextERNS8_12yaml_contextESB_EEvOT1_OT2_OT0_T3_ENKUlNS8_8yaml_tagEE_clESN_:
 4521|   421k|                value, ctx, it, end, preamble, [](yaml::yaml_tag tag) { return yaml::tag_valid_for_map(tag); }))
_ZN3glz4yaml21parse_node_propertiesITnDaXtlNS0_9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj32EEEXtlNS0_20node_property_policyELb1ELb1EEERNS_17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES4_EEEENS0_12yaml_contextEPKcSC_EEbOT1_RT2_RT3_T4_RNS0_19node_property_stateE:
  408|   421k|      {
  409|   421k|         state.has_anchor = false;
  410|   421k|         state.anchor_name.clear();
  411|   421k|         state.anchor_start = nullptr;
  412|   421k|         state.anchor_indent = ctx.current_indent();
  413|       |
  414|   421k|         if constexpr (Policy.allow_alias) {
  415|   421k|            if constexpr (Policy.alias_can_be_mapping_key) {
  416|   421k|               if (!alias_token_is_mapping_key(it, end)) {
  ------------------
  |  Branch (416:20): [True: 415k, False: 5.96k]
  ------------------
  417|   415k|                  if (handle_alias<Opts>(std::forward<T>(value), ctx, it, end)) return true;
  ------------------
  |  Branch (417:23): [True: 2.14k, False: 413k]
  ------------------
  418|   415k|               }
  419|       |            }
  420|       |            else {
  421|       |               if (handle_alias<Opts>(std::forward<T>(value), ctx, it, end)) return true;
  422|       |            }
  423|   421k|         }
  424|       |
  425|   421k|         if (it != end && *it == '&') {
  ------------------
  |  Branch (425:14): [True: 419k, False: 2.14k]
  |  Branch (425:27): [True: 27.0k, False: 392k]
  ------------------
  426|  27.0k|            ++it;
  427|  27.0k|            auto name = parse_anchor_name(it, end);
  428|  27.0k|            if (name.empty()) {
  ------------------
  |  Branch (428:17): [True: 5, False: 27.0k]
  ------------------
  429|      5|               ctx.error = error_code::syntax_error;
  430|      5|               return true;
  431|      5|            }
  432|  27.0k|            skip_inline_ws(it, end);
  433|  27.0k|            if (it == end) {
  ------------------
  |  Branch (433:17): [True: 3, False: 27.0k]
  ------------------
  434|      3|               if constexpr (!Policy.allow_empty_after_anchor) {
  435|      3|                  ctx.error = error_code::unexpected_end;
  436|      3|               }
  437|      3|               return true;
  438|      3|            }
  439|       |            if constexpr (Policy.disallow_anchor_on_alias) {
  440|       |               if (*it == '*') {
  441|       |                  ctx.error = error_code::syntax_error;
  442|       |                  return true;
  443|       |               }
  444|       |            }
  445|  27.0k|            state.has_anchor = true;
  446|  27.0k|            state.anchor_name = std::string(name);
  447|  27.0k|            state.anchor_start = &*it;
  448|  27.0k|         }
  449|       |
  450|   421k|         return false;
  451|   421k|      }
_ZN3glz4yaml12handle_aliasITnDaXtlNS0_9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj32EEERNS_17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES3_EEEENS0_12yaml_contextEPKcSB_EEbOT0_RT1_RT2_T3_:
  300|   415k|      {
  301|   415k|         if (it == end || *it != '*') return false;
  ------------------
  |  Branch (301:14): [True: 0, False: 415k]
  |  Branch (301:27): [True: 413k, False: 2.14k]
  ------------------
  302|       |
  303|  2.14k|         ++it; // skip '*'
  304|  2.14k|         auto name = parse_anchor_name(it, end);
  305|  2.14k|         if (name.empty()) {
  ------------------
  |  Branch (305:14): [True: 3, False: 2.14k]
  ------------------
  306|      3|            ctx.error = error_code::syntax_error;
  307|      3|            return true;
  308|      3|         }
  309|       |
  310|  2.14k|         auto anchor_it = ctx.anchors.find(name);
  311|  2.14k|         if (anchor_it == ctx.anchors.end()) {
  ------------------
  |  Branch (311:14): [True: 49, False: 2.09k]
  ------------------
  312|     49|            ctx.error = error_code::syntax_error; // undefined alias
  313|     49|            return true;
  314|     49|         }
  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.09k|         const auto span = anchor_it->second;
  319|       |
  320|       |         // Empty anchor span (anchor on null/empty node) — leave value as default
  321|  2.09k|         if (span.begin == span.end) {
  ------------------
  |  Branch (321:14): [True: 625, False: 1.46k]
  ------------------
  322|    625|            return true;
  323|    625|         }
  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.46k|         if (ctx.alias_span_is_replaying(span.begin, span.end)) [[unlikely]] {
  ------------------
  |  Branch (328:14): [True: 10, False: 1.45k]
  ------------------
  329|     10|            ctx.error = error_code::syntax_error; // cyclic alias
  330|     10|            return true;
  331|     10|         }
  332|       |
  333|       |         // Replaying an anchor re-enters the reader directly, bypassing the variant reader's
  334|       |         // depth guard, so this is the only depth accounting a chain of aliases into a
  335|       |         // non-variant target gets. The cycle check above stops the unbounded case; this bounds
  336|       |         // a legitimate but deeply chained one.
  337|  1.45k|         depth_guard guard{ctx, yaml::max_yaml_recursive_depth};
  338|  1.45k|         if (!guard) [[unlikely]]
  ------------------
  |  Branch (338:14): [True: 1, False: 1.45k]
  ------------------
  339|      1|            return true;
  340|       |
  341|  1.45k|         if (!ctx.charge_alias_expansion(static_cast<size_t>(span.end - span.begin))) [[unlikely]] {
  ------------------
  |  Branch (341:14): [True: 0, False: 1.45k]
  ------------------
  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.45k|         auto replay_it = span.begin;
  348|  1.45k|         auto replay_end = span.end;
  349|       |
  350|       |         // Save indent context and set up for replay
  351|  1.45k|         auto saved_indent_stack = std::move(ctx.indent_stack);
  352|  1.45k|         ctx.indent_stack.clear();
  353|  1.45k|         if (span.base_indent > 0) {
  ------------------
  |  Branch (353:14): [True: 1.04k, False: 412]
  ------------------
  354|  1.04k|            ctx.push_indent(span.base_indent - 1);
  355|  1.04k|         }
  356|       |
  357|  1.45k|         ctx.active_alias_spans.emplace_back(span.begin, span.end);
  358|       |
  359|  1.45k|         using V = std::remove_cvref_t<T>;
  360|  1.45k|         from<YAML, V>::template op<Opts>(std::forward<T>(value), ctx, replay_it, replay_end);
  361|       |
  362|  1.45k|         ctx.active_alias_spans.pop_back();
  363|       |
  364|       |         // Restore indent context
  365|  1.45k|         ctx.indent_stack = std::move(saved_indent_stack);
  366|  1.45k|         return true;
  367|  1.45k|      }
_ZN3glz4fromILj450ENS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEEE2opITnDaXtlNS_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj33EEERS4_TkNS_10is_contextERNS7_12yaml_contextERPKcSD_EEvOT0_OT1_OT2_T3_:
  274|  3.03M|      {
  275|  3.03M|         using V = std::decay_t<decltype(get_member(std::declval<Value>(), meta_wrapper_v<T>))>;
  276|  3.03M|         from<YAML, V>::template op<Opts>(get_member(std::forward<Value>(value), meta_wrapper_v<T>),
  277|  3.03M|                                          std::forward<Ctx>(ctx), std::forward<It0>(it), end);
  278|  3.03M|      }
_ZN3glz4fromILj450ENSt3__17variantIJDndNS1_12basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEbNS1_6vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS6_ISD_EEEENSC_ISD_EEEEEE2opITnDaXtlNS_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj33EEERPKcRSH_TkNS_10is_contextERNSK_12yaml_contextESN_EEvOT1_OT2_OT0_T3_:
 5635|  4.42M|      {
 5636|       |         // Inside op() rather than at class scope: read_supported is `requires { from<Format, T>{}; }`,
 5637|       |         // so a class-scope assert turns that feature probe into a hard error instead of `false`.
 5638|  4.42M|         static_assert(content_v<std::remove_cvref_t<T>>.empty(),
 5639|  4.42M|                       "Adjacent variant tagging (glz::meta `content`) is implemented for JSON and "
 5640|  4.42M|                       "BEVE but not yet for YAML. Reading this variant as YAML would silently expect "
 5641|  4.42M|                       "the internally tagged shape, so it is rejected here instead.");
 5642|  4.42M|         if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (5642:14): [True: 0, False: 4.42M]
  ------------------
 5643|      0|            return;
 5644|       |
 5645|       |         // Every nested generic/variant value routes back through this reader, so bounding
 5646|       |         // depth here caps flow-collection and flow-embedded mapping recursion that the
 5647|       |         // indent stack does not cover.
 5648|  4.42M|         depth_guard guard{ctx, yaml::max_yaml_recursive_depth};
 5649|  4.42M|         if (!guard) [[unlikely]]
  ------------------
  |  Branch (5649:14): [True: 40, False: 4.42M]
  ------------------
 5650|     40|            return;
 5651|       |
 5652|       |         // At root level (indent == -1), skip leading whitespace, newlines, and comments
 5653|       |         // For nested values, only skip inline whitespace to preserve block structure
 5654|  4.42M|         if (ctx.current_indent() < 0) {
  ------------------
  |  Branch (5654:14): [True: 3.55M, False: 869k]
  ------------------
 5655|  3.55M|            yaml::skip_ws_newlines_comments(it, end);
 5656|  3.55M|         }
 5657|   869k|         else {
 5658|   869k|            yaml::skip_inline_ws(it, end);
 5659|   869k|         }
 5660|       |
 5661|  4.42M|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (5661:14): [True: 43, False: 4.42M]
  ------------------
 5662|     43|            ctx.error = error_code::unexpected_end;
 5663|     43|            return;
 5664|     43|         }
 5665|       |
 5666|       |         // Tagged variants: a discriminator key (meta::tag) selects the alternative, with the
 5667|       |         // matching meta::ids entry naming each type. This mirrors the JSON behavior so the
 5668|       |         // same variant definitions round-trip across both formats.
 5669|       |         if constexpr (not tag_v<std::remove_cvref_t<T>>.empty()) {
 5670|       |            using V = std::remove_cvref_t<T>;
 5671|       |            const bool value_is_mapping =
 5672|       |               (*it == '{') || (!yaml::check_flow_context(Opts) && yaml::line_could_be_block_mapping(it, end));
 5673|       |            if (value_is_mapping) {
 5674|       |               // The mapping's keys sit at the column of `it`. Recover that column from the buffer:
 5675|       |               // the indent stack carries the parent context's indent (a struct member, a sequence
 5676|       |               // item, etc. each push a different offset), not this mapping's true column (see helper).
 5677|       |               const int32_t mapping_column = tagged_mapping_visual_indent(ctx, it, ctx.current_indent() + 1);
 5678|       |               auto tag_ctx = ctx.make_speculative();
 5679|       |               const size_t index = scan_variant_tag_index<V, Opts>(tag_ctx, it, end, mapping_column);
 5680|       |               ctx.alias_expansion_budget = tag_ctx.alias_expansion_budget; // charged even if no tag matched
 5681|       |               ctx.key_expansion_budget = tag_ctx.key_expansion_budget;
 5682|       |               if (index < ids_v<V>.size()) {
 5683|       |                  static constexpr auto tag_literal = string_literal_from_view<tag_v<V>.size()>(tag_v<V>);
 5684|       |                  emplace_runtime_variant(value, index);
 5685|       |                  // Establish the mapping's true column on the indent stack for the alternative parse.
 5686|       |                  // The chosen object is then parsed - and the discriminator's inline value skipped -
 5687|       |                  // at a consistent indent in every context, so a tag on the first key does not fold
 5688|       |                  // the following sibling entries into its value (no special-casing needed downstream).
 5689|       |                  if (!ctx.push_indent(mapping_column)) [[unlikely]] {
 5690|       |                     ctx.error = error_code::exceeded_max_recursive_depth;
 5691|       |                     return;
 5692|       |                  }
 5693|       |                  std::visit(
 5694|       |                     [&](auto&& alt) {
 5695|       |                        using Alt = std::remove_cvref_t<decltype(alt)>;
 5696|       |                        if constexpr ((glaze_object_t<Alt> || reflectable<Alt>) && not custom_read<Alt>) {
 5697|       |                           // Parse the mapping into the resolved struct; the tag key is skipped.
 5698|       |                           from<YAML, Alt>::template op<Opts, tag_literal>(alt, ctx, it, end);
 5699|       |                        }
 5700|       |                        else if constexpr (custom_read<Alt>) {
 5701|       |                           // Custom alternatives read the mapping body themselves and cannot skip an
 5702|       |                           // interior tag key the way reflected objects do, so the tag must be the
 5703|       |                           // first key (glaze always writes it first). Consume that leading "tag: id"
 5704|       |                           // entry, then hand the remaining mapping to the custom handler.
 5705|       |                           if constexpr (yaml::check_flow_context(Opts)) {
 5706|       |                              ctx.error = error_code::feature_not_supported;
 5707|       |                              ctx.custom_error_message =
 5708|       |                                 "custom variant alternatives are not supported in YAML flow style";
 5709|       |                           }
 5710|       |                           else {
 5711|       |                              ctx.scratch.clear();
 5712|       |                              if (yaml::parse_yaml_key(ctx.scratch, ctx, it, end, false)) {
 5713|       |                                 if (std::string_view{ctx.scratch} != tag_v<V>) {
 5714|       |                                    ctx.error = error_code::feature_not_supported;
 5715|       |                                    ctx.custom_error_message =
 5716|       |                                       "the tag must be the first key for a custom variant alternative";
 5717|       |                                 }
 5718|       |                                 else {
 5719|       |                                    yaml::skip_inline_ws(it, end);
 5720|       |                                    if (it == end || *it != ':') {
 5721|       |                                       ctx.error = error_code::syntax_error;
 5722|       |                                    }
 5723|       |                                    else {
 5724|       |                                       ++it;
 5725|       |                                       yaml::skip_inline_ws(it, end);
 5726|       |                                       yaml::skip_unknown_block_value<Opts>(ctx, it, end, mapping_column);
 5727|       |                                       if (!bool(ctx.error)) {
 5728|       |                                          // If nothing but trailing whitespace/comments remains, the tag
 5729|       |                                          // was the whole mapping: leave the alternative default.
 5730|       |                                          auto probe = it;
 5731|       |                                          yaml::skip_ws_newlines_comments(probe, end);
 5732|       |                                          if (probe == end) {
 5733|       |                                             it = probe;
 5734|       |                                          }
 5735|       |                                          else {
 5736|       |                                             // Publish the mapping's column so the custom handler's block
 5737|       |                                             // mapping (which would otherwise discover its own indent) reads
 5738|       |                                             // the remaining entries at the variant's indent and dedents
 5739|       |                                             // correctly in every context (root, sequence, nested).
 5740|       |                                             ctx.forced_block_mapping_indent = mapping_column;
 5741|       |                                             from<YAML, Alt>::template op<Opts>(alt, ctx, it, end);
 5742|       |                                             ctx.forced_block_mapping_indent = -1;
 5743|       |                                          }
 5744|       |                                       }
 5745|       |                                    }
 5746|       |                                 }
 5747|       |                              }
 5748|       |                           }
 5749|       |                        }
 5750|       |                        else {
 5751|       |                           // Non-object alternative (e.g. std::monostate): the emplaced default is
 5752|       |                           // the value, but the mapping must still be consumed.
 5753|       |                           walk_tagged_mapping<Opts>(
 5754|       |                              ctx, it, end, tag_v<V>, mapping_column,
 5755|       |                              [&](auto&& c, auto&& i, auto&& e, int32_t line_indent, bool in_flow) {
 5756|       |                                 yaml::skip_yaml_value<Opts>(c, i, e, in_flow ? 0 : line_indent, in_flow);
 5757|       |                              });
 5758|       |                        }
 5759|       |                     },
 5760|       |                     value);
 5761|       |                  ctx.pop_indent();
 5762|       |                  return;
 5763|       |               }
 5764|       |               // No resolvable tag key was found. Fall through to structural deduction:
 5765|       |               // if the alternatives are distinguishable by their fields this still succeeds,
 5766|       |               // otherwise the deduction path reports no_matching_variant_type.
 5767|       |            }
 5768|       |         }
 5769|       |
 5770|  4.42M|         if constexpr (yaml_variant_is_auto_deducible<std::remove_cvref_t<T>>()) {
 5771|  4.42M|            using V = std::remove_cvref_t<T>;
 5772|  4.42M|            using counts = yaml_variant_type_count<V>;
 5773|  4.42M|            const char c = *it;
 5774|  4.42M|            auto is_plain_scalar_boundary = [](const char ch) {
 5775|  4.42M|               switch (ch) {
 5776|  4.42M|               case ' ':
 5777|  4.42M|               case '\t':
 5778|  4.42M|               case '\n':
 5779|  4.42M|               case '\r':
 5780|  4.42M|               case ',':
 5781|  4.42M|               case ']':
 5782|  4.42M|               case '}':
 5783|  4.42M|                  return true;
 5784|  4.42M|               default:
 5785|  4.42M|                  return false;
 5786|  4.42M|               }
 5787|  4.42M|            };
 5788|       |
 5789|  4.42M|            auto has_indented_block_continuation = [&](auto word_end) {
 5790|  4.42M|               if constexpr (yaml::check_flow_context(Opts)) {
 5791|  4.42M|                  return false;
 5792|  4.42M|               }
 5793|  4.42M|               if (ctx.current_indent() < 0) {
 5794|  4.42M|                  return false;
 5795|  4.42M|               }
 5796|  4.42M|               if (word_end == end || (*word_end != '\n' && *word_end != '\r')) {
 5797|  4.42M|                  return false;
 5798|  4.42M|               }
 5799|       |
 5800|  4.42M|               auto look = word_end;
 5801|  4.42M|               yaml::skip_newline(look, end);
 5802|  4.42M|               while (look != end) {
 5803|  4.42M|                  int32_t line_indent = 0;
 5804|  4.42M|                  while (look != end && *look == ' ') {
 5805|  4.42M|                     ++line_indent;
 5806|  4.42M|                     ++look;
 5807|  4.42M|                  }
 5808|  4.42M|                  if (look != end && *look == '\t') {
 5809|  4.42M|                     return false;
 5810|  4.42M|                  }
 5811|  4.42M|                  if (look == end || *look == '\n' || *look == '\r') {
 5812|  4.42M|                     if (look != end) {
 5813|  4.42M|                        yaml::skip_newline(look, end);
 5814|  4.42M|                        continue;
 5815|  4.42M|                     }
 5816|  4.42M|                     return false;
 5817|  4.42M|                  }
 5818|  4.42M|                  if (*look == '#') {
 5819|  4.42M|                     yaml::skip_comment(look, end);
 5820|  4.42M|                     if (look != end && (*look == '\n' || *look == '\r')) {
 5821|  4.42M|                        yaml::skip_newline(look, end);
 5822|  4.42M|                        continue;
 5823|  4.42M|                     }
 5824|  4.42M|                     return false;
 5825|  4.42M|                  }
 5826|       |
 5827|       |                  // If the next non-empty line is an implicit mapping entry,
 5828|       |                  // don't treat it as scalar continuation for auto-deduced
 5829|       |                  // booleans/nulls.
 5830|  4.42M|                  {
 5831|  4.42M|                     auto scan = look;
 5832|  4.42M|                     while (scan != end && *scan != '\n' && *scan != '\r') {
 5833|  4.42M|                        if (*scan == ':') {
 5834|  4.42M|                           auto after_colon = scan + 1;
 5835|  4.42M|                           if (after_colon == end || *after_colon == ' ' || *after_colon == '\t' ||
 5836|  4.42M|                               *after_colon == '\n' || *after_colon == '\r') {
 5837|  4.42M|                              return false;
 5838|  4.42M|                           }
 5839|  4.42M|                        }
 5840|  4.42M|                        ++scan;
 5841|  4.42M|                     }
 5842|  4.42M|                  }
 5843|       |
 5844|  4.42M|                  return line_indent > ctx.current_indent();
 5845|  4.42M|               }
 5846|  4.42M|               return false;
 5847|  4.42M|            };
 5848|  4.42M|            auto is_word_boundary = [&](const auto ptr) {
 5849|  4.42M|               if (ptr == end) {
 5850|  4.42M|                  return true;
 5851|  4.42M|               }
 5852|  4.42M|               if (*ptr == ':') {
 5853|  4.42M|                  auto next = ptr + 1;
 5854|  4.42M|                  return (next == end) || *next == ' ' || *next == '\t' || *next == '\n' || *next == '\r';
 5855|  4.42M|               }
 5856|  4.42M|               return is_plain_scalar_boundary(*ptr);
 5857|  4.42M|            };
 5858|       |
 5859|  4.42M|            switch (c) {
 5860|   805k|            case '&': {
  ------------------
  |  Branch (5860:13): [True: 805k, False: 3.61M]
  ------------------
 5861|       |               // Anchor before value: parse name, then re-dispatch
 5862|   805k|               ++it;
 5863|   805k|               auto aname = yaml::parse_anchor_name(it, end);
 5864|   805k|               if (aname.empty()) {
  ------------------
  |  Branch (5864:20): [True: 90, False: 805k]
  ------------------
 5865|     90|                  ctx.error = error_code::syntax_error;
 5866|     90|                  return;
 5867|     90|               }
 5868|   805k|               yaml::skip_inline_ws(it, end);
 5869|   805k|               bool anchor_on_same_line = true;
 5870|   805k|               bool value_is_indentless_sequence = false;
 5871|   805k|               if (it == end || *it == '\n' || *it == '\r' || *it == '#') {
  ------------------
  |  Branch (5871:20): [True: 4.48k, False: 801k]
  |  Branch (5871:33): [True: 33.0k, False: 768k]
  |  Branch (5871:48): [True: 58.3k, False: 710k]
  |  Branch (5871:63): [True: 13.0k, False: 697k]
  ------------------
 5872|       |                  // Anchor followed by end-of-line. Check if the value continues on the
 5873|       |                  // next line (indented past current context) or if this is an empty node.
 5874|   108k|                  bool value_on_next_line = false;
 5875|   108k|                  if (it != end) {
  ------------------
  |  Branch (5875:23): [True: 104k, False: 4.48k]
  ------------------
 5876|   104k|                     auto peek = it;
 5877|       |                     // Skip comment if present
 5878|   104k|                     if (*peek == '#') {
  ------------------
  |  Branch (5878:26): [True: 13.0k, False: 91.3k]
  ------------------
 5879|   265k|                        while (peek != end && *peek != '\n' && *peek != '\r') ++peek;
  ------------------
  |  Branch (5879:32): [True: 265k, False: 30]
  |  Branch (5879:47): [True: 259k, False: 5.24k]
  |  Branch (5879:64): [True: 252k, False: 7.73k]
  ------------------
 5880|  13.0k|                     }
 5881|       |                     // Skip newline
 5882|   104k|                     if (peek != end && (*peek == '\n' || *peek == '\r')) {
  ------------------
  |  Branch (5882:26): [True: 104k, False: 30]
  |  Branch (5882:42): [True: 38.2k, False: 66.1k]
  |  Branch (5882:59): [True: 66.1k, False: 0]
  ------------------
 5883|   104k|                        yaml::skip_newline(peek, end);
 5884|       |                        // Skip blank lines
 5885|   146k|                        while (peek != end && (*peek == '\n' || *peek == '\r')) {
  ------------------
  |  Branch (5885:32): [True: 144k, False: 1.64k]
  |  Branch (5885:48): [True: 27.5k, False: 117k]
  |  Branch (5885:65): [True: 14.6k, False: 102k]
  ------------------
 5886|  42.1k|                           yaml::skip_newline(peek, end);
 5887|  42.1k|                        }
 5888|       |                        // Measure indent of next content line
 5889|   104k|                        int32_t next_indent = 0;
 5890|   166k|                        while (peek != end && *peek == ' ') {
  ------------------
  |  Branch (5890:32): [True: 164k, False: 1.85k]
  |  Branch (5890:47): [True: 62.3k, False: 102k]
  ------------------
 5891|  62.3k|                           ++next_indent;
 5892|  62.3k|                           ++peek;
 5893|  62.3k|                        }
 5894|   104k|                        if (peek != end && *peek != '\n' && *peek != '\r') {
  ------------------
  |  Branch (5894:29): [True: 102k, False: 1.85k]
  |  Branch (5894:44): [True: 99.4k, False: 3.01k]
  |  Branch (5894:61): [True: 98.8k, False: 633]
  ------------------
 5895|  98.8k|                           const bool indentless_sequence =
 5896|  98.8k|                              (!ctx.sequence_item_value_context) && (*peek == '-') &&
  ------------------
  |  Branch (5896:31): [True: 97.2k, False: 1.63k]
  |  Branch (5896:69): [True: 47.4k, False: 49.7k]
  ------------------
 5897|  47.4k|                              ((peek + 1) == end ||
  ------------------
  |  Branch (5897:32): [True: 574, False: 46.8k]
  ------------------
 5898|  46.8k|                               yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*(peek + 1))]) &&
  ------------------
  |  Branch (5898:32): [True: 45.7k, False: 1.16k]
  ------------------
 5899|  46.2k|                              (next_indent == ctx.current_indent() ||
  ------------------
  |  Branch (5899:32): [True: 2.89k, False: 43.3k]
  ------------------
 5900|  43.3k|                               (ctx.current_indent() > 0 && (next_indent + 1) == ctx.current_indent()));
  ------------------
  |  Branch (5900:33): [True: 6.16k, False: 37.2k]
  |  Branch (5900:61): [True: 5.68k, False: 478]
  ------------------
 5901|  98.8k|                           value_is_indentless_sequence = indentless_sequence;
 5902|  98.8k|                           const bool same_indent_property_node =
 5903|  98.8k|                              (next_indent == ctx.current_indent()) &&
  ------------------
  |  Branch (5903:31): [True: 12.7k, False: 86.0k]
  ------------------
 5904|  12.7k|                              (*peek == '!' || *peek == '&' || *peek == '*' || *peek == '[' || *peek == '{' ||
  ------------------
  |  Branch (5904:32): [True: 536, False: 12.2k]
  |  Branch (5904:48): [True: 349, False: 11.9k]
  |  Branch (5904:64): [True: 118, False: 11.7k]
  |  Branch (5904:80): [True: 265, False: 11.5k]
  |  Branch (5904:96): [True: 414, False: 11.1k]
  ------------------
 5905|  11.1k|                               *peek == '"' || *peek == '\'' || *peek == '|' || *peek == '>');
  ------------------
  |  Branch (5905:32): [True: 858, False: 10.2k]
  |  Branch (5905:48): [True: 373, False: 9.88k]
  |  Branch (5905:65): [True: 347, False: 9.53k]
  |  Branch (5905:81): [True: 487, False: 9.05k]
  ------------------
 5906|  98.8k|                           value_on_next_line =
 5907|  98.8k|                              (next_indent > ctx.current_indent()) || indentless_sequence || same_indent_property_node;
  ------------------
  |  Branch (5907:31): [True: 77.7k, False: 21.1k]
  |  Branch (5907:71): [True: 8.58k, False: 12.5k]
  |  Branch (5907:94): [True: 3.74k, False: 8.81k]
  ------------------
 5908|  98.8k|                        }
 5909|   104k|                     }
 5910|   104k|                  }
 5911|   108k|                  if (!value_on_next_line) {
  ------------------
  |  Branch (5911:23): [True: 18.8k, False: 90.0k]
  ------------------
 5912|       |                     // Anchor on empty/null node — store empty span, leave value as default
 5913|  18.8k|                     ctx.anchors[std::string(aname)] = {&*it, &*it, ctx.current_indent()};
 5914|  18.8k|                     return;
 5915|  18.8k|                  }
 5916|       |                  // Value is on next line — advance past newline/blank lines to the content
 5917|  90.0k|                  if (*it == '#') {
  ------------------
  |  Branch (5917:23): [True: 12.3k, False: 77.7k]
  ------------------
 5918|   253k|                     while (it != end && *it != '\n' && *it != '\r') ++it;
  ------------------
  |  Branch (5918:29): [True: 253k, False: 0]
  |  Branch (5918:42): [True: 248k, False: 5.04k]
  |  Branch (5918:57): [True: 240k, False: 7.29k]
  ------------------
 5919|  12.3k|                  }
 5920|  90.0k|                  if (it != end) yaml::skip_newline(it, end);
  ------------------
  |  Branch (5920:23): [True: 90.0k, False: 0]
  ------------------
 5921|   124k|                  while (it != end && (*it == '\n' || *it == '\r')) {
  ------------------
  |  Branch (5921:26): [True: 124k, False: 0]
  |  Branch (5921:40): [True: 23.4k, False: 101k]
  |  Branch (5921:55): [True: 10.9k, False: 90.0k]
  ------------------
 5922|  34.3k|                     yaml::skip_newline(it, end);
 5923|  34.3k|                  }
 5924|  90.0k|                  yaml::skip_inline_ws(it, end);
 5925|  90.0k|                  anchor_on_same_line = false;
 5926|  90.0k|               }
 5927|       |
 5928|       |               if constexpr (!yaml::check_flow_context(Opts)) {
 5929|       |                  if (anchor_on_same_line && *it == '-' &&
 5930|       |                      ((it + 1) == end || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*(it + 1))])) {
 5931|       |                     // "&anchor - item" is malformed in block context.
 5932|       |                     ctx.error = error_code::syntax_error;
 5933|       |                     return;
 5934|       |                  }
 5935|       |               }
 5936|       |
 5937|       |               // Anchor on alias (&anchor *alias) is invalid per YAML spec.
 5938|       |               // But alias-as-key (&anchor *alias : value) is valid.
 5939|   787k|               if (it != end && *it == '*' && !yaml::alias_token_is_mapping_key(it, end)) {
  ------------------
  |  Branch (5939:20): [True: 787k, False: 1]
  |  Branch (5939:33): [True: 482, False: 786k]
  |  Branch (5939:47): [True: 45, False: 437]
  ------------------
 5940|     45|                  ctx.error = error_code::syntax_error;
 5941|     45|                  return;
 5942|     45|               }
 5943|       |
 5944|       |               if constexpr (!yaml::check_flow_context(Opts)) {
 5945|       |                  if (!anchor_on_same_line && it != end && *it == '&') {
 5946|       |                     auto probe = it + 1;
 5947|       |                     auto nested_anchor_name = yaml::parse_anchor_name(probe, end);
 5948|       |                     if (nested_anchor_name.empty()) {
 5949|       |                        ctx.error = error_code::syntax_error;
 5950|       |                        return;
 5951|       |                     }
 5952|       |                     yaml::skip_inline_ws(probe, end);
 5953|       |                     // Allow nested anchor usage only when it clearly starts a
 5954|       |                     // nested mapping entry ("&k key: value"). Otherwise this is
 5955|       |                     // a second anchor on the same node (4JVG-style), which is invalid.
 5956|       |                     if (!yaml::line_could_be_block_mapping(probe, end)) {
 5957|       |                        ctx.error = error_code::syntax_error;
 5958|       |                        return;
 5959|       |                     }
 5960|       |                  }
 5961|       |               }
 5962|       |
 5963|   787k|               const char* anchor_start = &*it;
 5964|   787k|               const int32_t anchor_indent = ctx.current_indent();
 5965|       |
 5966|       |               if constexpr (!yaml::check_flow_context(Opts)) {
 5967|       |                  // Check if the anchor is on a block-mapping key (&name key: value).
 5968|       |                  // Only when the anchor and key are on the SAME line — if the value was on the
 5969|       |                  // next line, the anchor applies to the entire next-line content.
 5970|       |                  if (anchor_on_same_line && yaml::line_could_be_block_mapping(it, end)) {
 5971|       |                     auto key_start = it;
 5972|       |                     if (*key_start == '!') {
 5973|       |                        const auto key_tag = yaml::parse_yaml_tag(key_start, end, ctx);
 5974|       |                        if (key_tag == yaml::yaml_tag::unknown || !yaml::tag_valid_for_string(key_tag)) {
 5975|       |                           ctx.error = error_code::syntax_error;
 5976|       |                           return;
 5977|       |                        }
 5978|       |                        yaml::skip_inline_ws(key_start, end);
 5979|       |                        if (key_start == end) {
 5980|       |                           ctx.error = error_code::unexpected_end;
 5981|       |                           return;
 5982|       |                        }
 5983|       |                        if (*key_start == '\n' || *key_start == '\r') {
 5984|       |                           ctx.error = error_code::syntax_error;
 5985|       |                           return;
 5986|       |                        }
 5987|       |
 5988|       |                        // Re-apply the anchor-on-alias rule now that the tag is consumed. The
 5989|       |                        // check above ran before the tag, so "&anchor !tag *alias" reached the
 5990|       |                        // key-span registration below while the untagged spelling was rejected;
 5991|       |                        // an alias node carries no other properties either way.
 5992|       |                        if (*key_start == '*' && !yaml::alias_token_is_mapping_key(key_start, end)) {
 5993|       |                           ctx.error = error_code::syntax_error;
 5994|       |                           return;
 5995|       |                        }
 5996|       |                     }
 5997|       |
 5998|       |                     // Find the key span by scanning to the key-value separator
 5999|       |                     auto key_scan = key_start;
 6000|       |                     auto key_end = key_start;
 6001|       |                     if (*key_scan == '"' || *key_scan == '\'') {
 6002|       |                        // Quoted key: skip to closing quote
 6003|       |                        const char quote = *key_scan;
 6004|       |                        ++key_scan;
 6005|       |                        while (key_scan != end && *key_scan != quote) {
 6006|       |                           if (*key_scan == '\\' && quote == '"') {
 6007|       |                              ++key_scan;
 6008|       |                              if (key_scan != end) ++key_scan;
 6009|       |                           }
 6010|       |                           else {
 6011|       |                              ++key_scan;
 6012|       |                           }
 6013|       |                        }
 6014|       |                        if (key_scan == end) {
 6015|       |                           ctx.error = error_code::syntax_error;
 6016|       |                           return;
 6017|       |                        }
 6018|       |                        ++key_scan; // past closing quote
 6019|       |                        key_end = key_scan;
 6020|       |                        yaml::skip_inline_ws(key_scan, end);
 6021|       |                     }
 6022|       |                     else {
 6023|       |                        // Plain key: scan to ':'
 6024|       |                        while (key_scan != end) {
 6025|       |                           if (*key_scan == ':') {
 6026|       |                              auto next = key_scan + 1;
 6027|       |                              if (next == end || *next == ' ' || *next == '\t' || *next == '\n' || *next == '\r') {
 6028|       |                                 break;
 6029|       |                              }
 6030|       |                           }
 6031|       |                           ++key_scan;
 6032|       |                        }
 6033|       |                        key_end = key_scan;
 6034|       |                        while (key_end != key_start && (*(key_end - 1) == ' ' || *(key_end - 1) == '\t')) {
 6035|       |                           --key_end;
 6036|       |                        }
 6037|       |                     }
 6038|       |                     if (key_scan == end || *key_scan != ':') {
 6039|       |                        ctx.error = error_code::syntax_error;
 6040|       |                        return;
 6041|       |                     }
 6042|       |                     // Store anchor with just the key text span
 6043|       |                     ctx.anchors[std::string(aname)] = {&*key_start, &*key_end, anchor_indent};
 6044|       |                     it = key_start;
 6045|       |                     // Parse as an object alternative so complex keys (e.g. flow collections) stay in mapping context.
 6046|       |                     if constexpr (counts::n_object > 0) {
 6047|       |                        process_yaml_variant_alternatives<V, is_yaml_variant_object>::template op<Opts>(value, ctx, it,
 6048|       |                                                                                                        end);
 6049|       |                     }
 6050|       |                     else {
 6051|       |                        from<YAML, V>::template op<Opts>(value, ctx, it, end);
 6052|       |                     }
 6053|       |                     return;
 6054|       |                  }
 6055|       |               }
 6056|       |
 6057|   787k|               const bool prev_allow_indentless_sequence = ctx.allow_indentless_sequence;
 6058|   787k|               ctx.allow_indentless_sequence = value_is_indentless_sequence;
 6059|   787k|               from<YAML, V>::template op<Opts>(value, ctx, it, end);
 6060|   787k|               ctx.allow_indentless_sequence = prev_allow_indentless_sequence;
 6061|   787k|               if (!bool(ctx.error)) {
  ------------------
  |  Branch (6061:20): [True: 777k, False: 9.58k]
  ------------------
 6062|   777k|                  ctx.anchors[std::string(aname)] = {anchor_start, &*it, anchor_indent};
 6063|   777k|               }
 6064|   787k|               return;
 6065|   787k|            }
 6066|   575k|            case '*': {
  ------------------
  |  Branch (6066:13): [True: 575k, False: 3.84M]
  ------------------
 6067|       |               // In block context, "*alias : value" starts a mapping with an alias key.
 6068|       |               if constexpr (!yaml::check_flow_context(Opts)) {
 6069|       |                  if (yaml::alias_token_is_mapping_key(it, end)) {
 6070|       |                     if constexpr (counts::n_object > 0) {
 6071|       |                        process_yaml_variant_alternatives<V, is_yaml_variant_object>::template op<Opts>(value, ctx, it,
 6072|       |                                                                                                        end);
 6073|       |                        return;
 6074|       |                     }
 6075|       |                     else {
 6076|       |                        ctx.error = error_code::syntax_error;
 6077|       |                        return;
 6078|       |                     }
 6079|       |                  }
 6080|       |               }
 6081|       |
 6082|       |               // Alias value: look up anchor and replay
 6083|   575k|               yaml::handle_alias<Opts>(value, ctx, it, end);
 6084|   575k|               return;
 6085|   787k|            }
 6086|   200k|            case '!': {
  ------------------
  |  Branch (6086:13): [True: 200k, False: 4.22M]
  ------------------
 6087|       |               // Tag - parse it and dispatch based on tag type
 6088|   200k|               const auto tag = yaml::parse_yaml_tag(it, end, ctx);
 6089|   200k|               if (tag == yaml::yaml_tag::unknown) {
  ------------------
  |  Branch (6089:20): [True: 29, False: 200k]
  ------------------
 6090|     29|                  ctx.error = error_code::syntax_error;
 6091|     29|                  return;
 6092|     29|               }
 6093|   200k|               yaml::skip_inline_ws(it, end);
 6094|   200k|               if (it != end && *it == '#') {
  ------------------
  |  Branch (6094:20): [True: 199k, False: 885]
  |  Branch (6094:33): [True: 7.59k, False: 192k]
  ------------------
 6095|  7.59k|                  yaml::skip_comment(it, end);
 6096|  7.59k|               }
 6097|   200k|               if (it != end && (*it == '\n' || *it == '\r')) {
  ------------------
  |  Branch (6097:20): [True: 199k, False: 1.26k]
  |  Branch (6097:34): [True: 30.4k, False: 168k]
  |  Branch (6097:49): [True: 20.3k, False: 148k]
  ------------------
 6098|  50.8k|                  auto content = it;
 6099|  50.8k|                  yaml::skip_newline(content, end);
 6100|  50.8k|                  yaml::skip_to_content(content, end);
 6101|       |
 6102|  50.8k|                  bool consume_following_content = false;
 6103|  50.8k|                  auto content_token = content;
 6104|  50.8k|                  if (content != end) {
  ------------------
  |  Branch (6104:23): [True: 49.5k, False: 1.28k]
  ------------------
 6105|  49.5k|                     auto indent_probe = content;
 6106|  49.5k|                     const int32_t content_indent = yaml::measure_indent<false>(indent_probe, end, ctx);
 6107|  49.5k|                     if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (6107:26): [True: 2, False: 49.5k]
  ------------------
 6108|      2|                        return;
 6109|  49.5k|                     content_token = indent_probe;
 6110|       |
 6111|       |                     // A tag at the end of a sequence/map entry has an empty value
 6112|       |                     // unless the next non-empty content is nested under the current node.
 6113|  49.5k|                     bool tagged_indentless_sequence = false;
 6114|  49.5k|                     if (tag == yaml::yaml_tag::seq && indent_probe != end && *indent_probe == '-') {
  ------------------
  |  Branch (6114:26): [True: 7.85k, False: 41.6k]
  |  Branch (6114:56): [True: 7.85k, False: 0]
  |  Branch (6114:79): [True: 6.84k, False: 1.01k]
  ------------------
 6115|  6.84k|                        const auto after_dash = indent_probe + 1;
 6116|  6.84k|                        if (after_dash == end ||
  ------------------
  |  Branch (6116:29): [True: 320, False: 6.52k]
  ------------------
 6117|  6.52k|                            yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*after_dash)]) {
  ------------------
  |  Branch (6117:29): [True: 2.96k, False: 3.55k]
  ------------------
 6118|  3.28k|                           tagged_indentless_sequence =
 6119|  3.28k|                              (content_indent == ctx.current_indent()) ||
  ------------------
  |  Branch (6119:31): [True: 363, False: 2.92k]
  ------------------
 6120|  2.92k|                              (ctx.current_indent() > 0 && (content_indent + 1) == ctx.current_indent());
  ------------------
  |  Branch (6120:32): [True: 433, False: 2.49k]
  |  Branch (6120:60): [True: 314, False: 119]
  ------------------
 6121|  3.28k|                        }
 6122|  6.84k|                     }
 6123|       |
 6124|  49.5k|                     consume_following_content = (ctx.current_indent() < 0) ||
  ------------------
  |  Branch (6124:50): [True: 28.1k, False: 21.4k]
  ------------------
 6125|  21.4k|                                                 (content_indent > ctx.current_indent()) || tagged_indentless_sequence;
  ------------------
  |  Branch (6125:50): [True: 4.82k, False: 16.5k]
  |  Branch (6125:93): [True: 677, False: 15.9k]
  ------------------
 6126|  49.5k|                  }
 6127|       |
 6128|  50.8k|                  if (consume_following_content) {
  ------------------
  |  Branch (6128:23): [True: 33.6k, False: 17.1k]
  ------------------
 6129|  33.6k|                     it = content_token;
 6130|  33.6k|                  }
 6131|  17.1k|                  else {
 6132|  17.1k|                     if (tag == yaml::yaml_tag::str) {
  ------------------
  |  Branch (6132:26): [True: 912, False: 16.2k]
  ------------------
 6133|    912|                        if constexpr (counts::n_str > 0) {
 6134|    912|                           constexpr auto first_idx = yaml_variant_first_index_v<V, is_yaml_variant_str>;
 6135|    912|                           using StrType = std::variant_alternative_t<first_idx, V>;
 6136|    912|                           value = StrType{};
 6137|    912|                           return;
 6138|    912|                        }
 6139|    912|                     }
 6140|  17.1k|                     if (tag == yaml::yaml_tag::null_tag) {
  ------------------
  |  Branch (6140:26): [True: 338, False: 16.8k]
  ------------------
 6141|    338|                        if constexpr (counts::n_null > 0) {
 6142|    338|                           constexpr auto first_idx = yaml_variant_first_index_v<V, is_yaml_variant_null>;
 6143|    338|                           using NullType = std::variant_alternative_t<first_idx, V>;
 6144|    338|                           if (!std::holds_alternative<NullType>(value)) value = NullType{};
  ------------------
  |  Branch (6144:32): [True: 0, False: 338]
  ------------------
 6145|    338|                           return;
 6146|    338|                        }
 6147|    338|                     }
 6148|  17.1k|                     if (tag == yaml::yaml_tag::none) {
  ------------------
  |  Branch (6148:26): [True: 14.2k, False: 2.97k]
  ------------------
 6149|  14.2k|                        if constexpr (counts::n_null > 0) {
 6150|  14.2k|                           constexpr auto first_idx = yaml_variant_first_index_v<V, is_yaml_variant_null>;
 6151|  14.2k|                           using NullType = std::variant_alternative_t<first_idx, V>;
 6152|  14.2k|                           if (!std::holds_alternative<NullType>(value)) value = NullType{};
  ------------------
  |  Branch (6152:32): [True: 0, False: 14.2k]
  ------------------
 6153|  14.2k|                           return;
 6154|  14.2k|                        }
 6155|  14.2k|                     }
 6156|  17.1k|                  }
 6157|  50.8k|               }
 6158|       |               if constexpr (!yaml::check_flow_context(Opts)) {
 6159|       |                  // In block context, a comma immediately after a tag token is malformed
 6160|       |                  // (e.g., "!!str, value"). Flow context has legitimate ", ] }" usage.
 6161|       |                  if (it != end && *it == ',') {
 6162|       |                     ctx.error = error_code::syntax_error;
 6163|       |                     return;
 6164|       |                  }
 6165|       |                  if constexpr (counts::n_object > 0) {
 6166|       |                     // Tagged keys like "!!str key: value" must parse as mappings.
 6167|       |                     const bool starts_block_sequence_entry =
 6168|       |                        (it != end && *it == '-') &&
 6169|       |                        ((it + 1) == end || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*(it + 1))]);
 6170|       |                     if (!starts_block_sequence_entry && yaml::line_could_be_block_mapping(it, end)) {
 6171|       |                        // Re-dispatch from the post-tag token so '&key key: val' is
 6172|       |                        // handled by the anchor-aware key path, not as a map-level anchor.
 6173|       |                        from<YAML, V>::template op<Opts>(value, ctx, it, end);
 6174|       |                        return;
 6175|       |                     }
 6176|       |                  }
 6177|       |               }
 6178|   200k|               if (it == end) {
  ------------------
  |  Branch (6178:20): [True: 1.26k, False: 199k]
  ------------------
 6179|  1.26k|                  if (tag == yaml::yaml_tag::str) {
  ------------------
  |  Branch (6179:23): [True: 274, False: 987]
  ------------------
 6180|    274|                     if constexpr (counts::n_str > 0) {
 6181|    274|                        constexpr auto first_idx = yaml_variant_first_index_v<V, is_yaml_variant_str>;
 6182|    274|                        using StrType = std::variant_alternative_t<first_idx, V>;
 6183|    274|                        value = StrType{};
 6184|    274|                        return;
 6185|    274|                     }
 6186|    274|                  }
 6187|  1.26k|                  if (tag == yaml::yaml_tag::none) {
  ------------------
  |  Branch (6187:23): [True: 986, False: 275]
  ------------------
 6188|    986|                     if constexpr (counts::n_null > 0) {
 6189|    986|                        constexpr auto first_idx = yaml_variant_first_index_v<V, is_yaml_variant_null>;
 6190|    986|                        using NullType = std::variant_alternative_t<first_idx, V>;
 6191|    986|                        if (!std::holds_alternative<NullType>(value)) value = NullType{};
  ------------------
  |  Branch (6191:29): [True: 0, False: 986]
  ------------------
 6192|    986|                        return;
 6193|    986|                     }
 6194|    986|                  }
 6195|      0|                  ctx.error = error_code::unexpected_end;
 6196|  1.26k|                  return;
 6197|  1.26k|               }
 6198|   199k|               switch (tag) {
 6199|  1.12k|               case yaml::yaml_tag::str:
  ------------------
  |  Branch (6199:16): [True: 1.12k, False: 198k]
  ------------------
 6200|  1.12k|                  process_yaml_variant_alternatives<V, is_yaml_variant_str>::template op<Opts>(value, ctx, it, end);
 6201|  1.12k|                  return;
 6202|  9.55k|               case yaml::yaml_tag::int_tag:
  ------------------
  |  Branch (6202:16): [True: 9.55k, False: 189k]
  ------------------
 6203|  9.69k|               case yaml::yaml_tag::float_tag:
  ------------------
  |  Branch (6203:16): [True: 140, False: 199k]
  ------------------
 6204|  9.69k|                  if constexpr (counts::n_num > 0) {
 6205|  9.69k|                     process_yaml_variant_alternatives<V, is_yaml_variant_num>::template op<Opts>(value, ctx, it, end);
 6206|  9.69k|                     return;
 6207|       |                  }
 6208|       |                  else { // else used to fix MSVC unreachable code warning
 6209|       |                     ctx.error = error_code::syntax_error;
 6210|       |                     return;
 6211|       |                  }
 6212|  26.4k|               case yaml::yaml_tag::bool_tag:
  ------------------
  |  Branch (6212:16): [True: 16.7k, False: 182k]
  ------------------
 6213|  26.4k|                  if constexpr (counts::n_bool > 0) {
 6214|  26.4k|                     process_yaml_variant_alternatives<V, is_yaml_variant_bool>::template op<Opts>(value, ctx, it, end);
 6215|  26.4k|                     return;
 6216|       |                  }
 6217|       |                  else { // else used to fix MSVC unreachable code warning
 6218|       |                     ctx.error = error_code::syntax_error;
 6219|       |                     return;
 6220|       |                  }
 6221|  26.8k|               case yaml::yaml_tag::null_tag:
  ------------------
  |  Branch (6221:16): [True: 493, False: 198k]
  ------------------
 6222|  26.8k|                  if constexpr (counts::n_null > 0) {
 6223|  26.8k|                     constexpr auto first_idx = yaml_variant_first_index_v<V, is_yaml_variant_null>;
 6224|  26.8k|                     using NullType = std::variant_alternative_t<first_idx, V>;
 6225|  26.8k|                     if (!std::holds_alternative<NullType>(value)) value = NullType{};
  ------------------
  |  Branch (6225:26): [True: 0, False: 26.8k]
  ------------------
 6226|  26.8k|                     from<YAML, NullType>::template op<Opts>(std::get<NullType>(value), ctx, it, end);
 6227|  26.8k|                     return;
 6228|       |                  }
 6229|       |                  else { // else used to fix MSVC unreachable code warning
 6230|       |                     ctx.error = error_code::syntax_error;
 6231|       |                     return;
 6232|       |                  }
 6233|  55.0k|               case yaml::yaml_tag::map:
  ------------------
  |  Branch (6233:16): [True: 28.1k, False: 171k]
  ------------------
 6234|  55.0k|                  if constexpr (counts::n_object > 0) {
 6235|  55.0k|                     process_yaml_variant_alternatives<V, is_yaml_variant_object>::template op<Opts>(value, ctx, it,
 6236|  55.0k|                                                                                                     end);
 6237|  55.0k|                     return;
 6238|       |                  }
 6239|       |                  else { // else used to fix MSVC unreachable code warning
 6240|       |                     ctx.error = error_code::syntax_error;
 6241|       |                     return;
 6242|       |                  }
 6243|  82.1k|               case yaml::yaml_tag::seq:
  ------------------
  |  Branch (6243:16): [True: 27.1k, False: 172k]
  ------------------
 6244|  82.1k|                  if constexpr (counts::n_array > 0) {
 6245|  82.1k|                     const bool prev_allow_indentless_sequence = ctx.allow_indentless_sequence;
 6246|       |                     if constexpr (!yaml::check_flow_context(Opts)) {
 6247|       |                        if (it != end && *it == '-') {
 6248|       |                           ctx.allow_indentless_sequence = true;
 6249|       |                        }
 6250|       |                     }
 6251|  82.1k|                     process_yaml_variant_alternatives<V, is_yaml_variant_array>::template op<Opts>(value, ctx, it,
 6252|  82.1k|                                                                                                    end);
 6253|  82.1k|                     ctx.allow_indentless_sequence = prev_allow_indentless_sequence;
 6254|  82.1k|                     return;
 6255|       |                  }
 6256|       |                  else { // else used to fix MSVC unreachable code warning
 6257|       |                     ctx.error = error_code::syntax_error;
 6258|       |                     return;
 6259|       |                  }
 6260|   182k|               default: {
  ------------------
  |  Branch (6260:16): [True: 100k, False: 98.7k]
  ------------------
 6261|       |                  // Explicit unknown/non-core tags disable implicit scalar resolution.
 6262|       |                  // Preserve collection kinds, otherwise treat as string content.
 6263|   182k|                  if (it != end && *it == '*') {
  ------------------
  |  Branch (6263:23): [True: 100k, False: 82.1k]
  |  Branch (6263:36): [True: 32.6k, False: 67.8k]
  ------------------
 6264|  32.6k|                     yaml::handle_alias<Opts>(value, ctx, it, end);
 6265|  32.6k|                     return;
 6266|  32.6k|                  }
 6267|       |
 6268|   149k|                  if constexpr (counts::n_array > 0) {
 6269|   149k|                     if (it != end && *it == '[') {
  ------------------
  |  Branch (6269:26): [True: 67.8k, False: 82.1k]
  |  Branch (6269:39): [True: 2.91k, False: 64.8k]
  ------------------
 6270|  2.91k|                        process_yaml_variant_alternatives<V, is_yaml_variant_array>::template op<Opts>(value, ctx, it,
 6271|  2.91k|                                                                                                       end);
 6272|  2.91k|                        return;
 6273|  2.91k|                     }
 6274|   149k|                  }
 6275|   149k|                  if constexpr (counts::n_object > 0) {
 6276|   149k|                     if (it != end && *it == '{') {
  ------------------
  |  Branch (6276:26): [True: 64.8k, False: 85.0k]
  |  Branch (6276:39): [True: 11.2k, False: 53.6k]
  ------------------
 6277|  11.2k|                        process_yaml_variant_alternatives<V, is_yaml_variant_object>::template op<Opts>(value, ctx, it,
 6278|  11.2k|                                                                                                        end);
 6279|  11.2k|                        return;
 6280|  11.2k|                     }
 6281|   149k|                  }
 6282|       |
 6283|       |                  if constexpr (!yaml::check_flow_context(Opts)) {
 6284|       |                     if constexpr (counts::n_array > 0) {
 6285|       |                        const bool starts_block_sequence_entry =
 6286|       |                           (it != end && *it == '-') &&
 6287|       |                           ((it + 1) == end || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*(it + 1))]);
 6288|       |                        if (starts_block_sequence_entry) {
 6289|       |                           process_yaml_variant_alternatives<V, is_yaml_variant_array>::template op<Opts>(value, ctx,
 6290|       |                                                                                                          it, end);
 6291|       |                           return;
 6292|       |                        }
 6293|       |                     }
 6294|       |                     if constexpr (counts::n_object > 0) {
 6295|       |                        const bool starts_explicit_mapping_indicator =
 6296|       |                           (it != end && (*it == '?' || *it == ':')) &&
 6297|       |                           ((it + 1) == end || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*(it + 1))]);
 6298|       |                        if (starts_explicit_mapping_indicator) {
 6299|       |                           process_yaml_variant_alternatives<V, is_yaml_variant_object>::template op<Opts>(value, ctx,
 6300|       |                                                                                                           it, end);
 6301|       |                           return;
 6302|       |                        }
 6303|       |                        if (yaml::line_could_be_block_mapping(it, end)) {
 6304|       |                           process_yaml_variant_alternatives<V, is_yaml_variant_object>::template op<Opts>(value, ctx,
 6305|       |                                                                                                           it, end);
 6306|       |                           return;
 6307|       |                        }
 6308|       |                     }
 6309|       |                  }
 6310|       |
 6311|   149k|                  if constexpr (counts::n_str > 0) {
 6312|   149k|                     process_yaml_variant_alternatives<V, is_yaml_variant_str>::template op<Opts>(value, ctx, it, end);
 6313|   149k|                     return;
 6314|   149k|                  }
 6315|       |
 6316|       |                  // Fall back if no string alternative exists.
 6317|      0|                  from<YAML, V>::template op<Opts>(value, ctx, it, end);
 6318|   149k|                  return;
 6319|   182k|               }
 6320|   199k|               }
 6321|      0|               return;
 6322|   199k|            }
 6323|   790k|            case '{':
  ------------------
  |  Branch (6323:13): [True: 790k, False: 3.63M]
  ------------------
 6324|       |               if constexpr (!yaml::check_flow_context(Opts)) {
 6325|       |                  // In block context, "{...}: value" can be a complex mapping key.
 6326|       |                  if (ctx.current_indent() < 0 && yaml::line_could_be_block_mapping(it, end)) {
 6327|       |                     process_yaml_variant_alternatives<V, is_yaml_variant_object>::template op<Opts>(value, ctx, it,
 6328|       |                                                                                                     end);
 6329|       |                     return;
 6330|       |                  }
 6331|       |               }
 6332|       |               // Flow mapping - object type
 6333|   790k|               process_yaml_variant_alternatives<V, is_yaml_variant_object>::template op<Opts>(value, ctx, it, end);
 6334|   790k|               return;
 6335|  52.4k|            case '[':
  ------------------
  |  Branch (6335:13): [True: 52.4k, False: 4.37M]
  ------------------
 6336|       |               if constexpr (!yaml::check_flow_context(Opts)) {
 6337|       |                  // In block context, "[...]: value" can be a complex mapping key.
 6338|       |                  if (ctx.current_indent() < 0 && yaml::line_could_be_block_mapping(it, end)) {
 6339|       |                     process_yaml_variant_alternatives<V, is_yaml_variant_object>::template op<Opts>(value, ctx, it,
 6340|       |                                                                                                     end);
 6341|       |                     return;
 6342|       |                  }
 6343|       |               }
 6344|       |               // Flow sequence - array type
 6345|  52.4k|               process_yaml_variant_alternatives<V, is_yaml_variant_array>::template op<Opts>(value, ctx, it, end);
 6346|  52.4k|               return;
 6347|   175k|            case '?':
  ------------------
  |  Branch (6347:13): [True: 175k, False: 4.24M]
  ------------------
 6348|       |               // Explicit mapping key indicator ("? key")
 6349|   175k|               if ((end - it >= 2) && it[1] == '\t') {
  ------------------
  |  Branch (6349:20): [True: 173k, False: 1.90k]
  |  Branch (6349:39): [True: 2, False: 173k]
  ------------------
 6350|      2|                  ctx.error = error_code::syntax_error;
 6351|      2|                  return;
 6352|      2|               }
 6353|   175k|               if ((end - it >= 2) && (it[1] == ' ' || it[1] == '\n' || it[1] == '\r')) {
  ------------------
  |  Branch (6353:20): [True: 173k, False: 1.90k]
  |  Branch (6353:40): [True: 56.4k, False: 117k]
  |  Branch (6353:56): [True: 74.9k, False: 42.3k]
  |  Branch (6353:73): [True: 16.5k, False: 25.8k]
  ------------------
 6354|   147k|                  if constexpr (counts::n_object > 0) {
 6355|   147k|                     process_yaml_variant_alternatives<V, is_yaml_variant_object>::template op<Opts>(value, ctx, it,
 6356|   147k|                                                                                                     end);
 6357|   147k|                     return;
 6358|   147k|                  }
 6359|   147k|               }
 6360|      0|               parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6361|   175k|               return;
 6362|    113|            case '%':
  ------------------
  |  Branch (6362:13): [True: 113, False: 4.42M]
  ------------------
 6363|       |               // Reserved directive indicator is not a plain scalar start.
 6364|    113|               ctx.error = error_code::syntax_error;
 6365|    113|               return;
 6366|  5.95k|            case '"':
  ------------------
  |  Branch (6366:13): [True: 5.95k, False: 4.41M]
  ------------------
 6367|  12.0k|            case '\'':
  ------------------
  |  Branch (6367:13): [True: 6.05k, False: 4.41M]
  ------------------
 6368|       |               // Could be a quoted string OR a quoted key in a block mapping
 6369|       |               // Try block mapping first (e.g., "key": value), then fall back to string
 6370|  12.0k|               parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6371|  12.0k|               return;
 6372|  33.6k|            case 't':
  ------------------
  |  Branch (6372:13): [True: 33.6k, False: 4.38M]
  ------------------
 6373|  39.4k|            case 'T':
  ------------------
  |  Branch (6373:13): [True: 5.76k, False: 4.41M]
  ------------------
 6374|       |               // Could be "true", "True", "TRUE", or a key/string starting with t/T
 6375|  39.4k|               if constexpr (counts::n_bool > 0) {
 6376|  39.4k|                  if ((end - it >= 4) && ((it[1] == 'r' && it[2] == 'u' && it[3] == 'e') ||
  ------------------
  |  Branch (6376:23): [True: 38.9k, False: 507]
  |  Branch (6376:44): [True: 27.3k, False: 11.5k]
  |  Branch (6376:60): [True: 21.0k, False: 6.30k]
  |  Branch (6376:76): [True: 18.2k, False: 2.83k]
  ------------------
 6377|  20.7k|                                          (it[1] == 'R' && it[2] == 'U' && it[3] == 'E'))) {
  ------------------
  |  Branch (6377:44): [True: 5.91k, False: 14.8k]
  |  Branch (6377:60): [True: 2.21k, False: 3.69k]
  |  Branch (6377:76): [True: 1.04k, False: 1.17k]
  ------------------
 6378|       |                     // Check what follows the word "true"
 6379|  19.2k|                     const auto after_true = it + 4;
 6380|  19.2k|                     const bool at_word_boundary = is_word_boundary(after_true);
 6381|       |
 6382|  19.2k|                     if (at_word_boundary) {
  ------------------
  |  Branch (6382:26): [True: 11.9k, False: 7.30k]
  ------------------
 6383|  11.9k|                        if (has_indented_block_continuation(after_true)) {
  ------------------
  |  Branch (6383:29): [True: 0, False: 11.9k]
  ------------------
 6384|      0|                           parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6385|      0|                           return;
 6386|      0|                        }
 6387|       |                        // Check if this is a key (followed by ": ") rather than a boolean value
 6388|       |                        // "true: value" should parse as {true: value}, not as the boolean true
 6389|  11.9k|                        if ((end - it > 4) && it[4] == ':' &&
  ------------------
  |  Branch (6389:29): [True: 9.81k, False: 2.14k]
  |  Branch (6389:47): [True: 7.42k, False: 2.38k]
  ------------------
 6390|  7.42k|                            (end - it == 5 || it[5] == ' ' || it[5] == '\t' || it[5] == '\n' || it[5] == '\r')) {
  ------------------
  |  Branch (6390:30): [True: 2.41k, False: 5.01k]
  |  Branch (6390:47): [True: 3.38k, False: 1.63k]
  |  Branch (6390:63): [True: 670, False: 963]
  |  Branch (6390:80): [True: 373, False: 590]
  |  Branch (6390:97): [True: 590, False: 0]
  ------------------
 6391|       |                           // This is "true:" followed by space/tab/newline/end - treat as key
 6392|  7.42k|                           parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6393|  7.42k|                           return;
 6394|  7.42k|                        }
 6395|  4.53k|                        process_yaml_variant_alternatives<V, is_yaml_variant_bool>::template op<Opts>(value, ctx, it,
 6396|  4.53k|                                                                                                      end);
 6397|  4.53k|                        return;
 6398|  11.9k|                     }
 6399|       |                     // "true" is followed by more characters (e.g., "True\b") - treat as string
 6400|  19.2k|                  }
 6401|  39.4k|               }
 6402|  27.4k|               parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6403|  39.4k|               return;
 6404|  60.8k|            case 'f':
  ------------------
  |  Branch (6404:13): [True: 60.8k, False: 4.36M]
  ------------------
 6405|  75.5k|            case 'F':
  ------------------
  |  Branch (6405:13): [True: 14.6k, False: 4.40M]
  ------------------
 6406|       |               // Could be "false", "False", "FALSE", or a key/string starting with f/F
 6407|  75.5k|               if constexpr (counts::n_bool > 0) {
 6408|  75.5k|                  if ((end - it >= 5) && ((it[1] == 'a' && it[2] == 'l' && it[3] == 's' && it[4] == 'e') ||
  ------------------
  |  Branch (6408:23): [True: 74.3k, False: 1.14k]
  |  Branch (6408:44): [True: 49.1k, False: 25.2k]
  |  Branch (6408:60): [True: 40.7k, False: 8.31k]
  |  Branch (6408:76): [True: 39.4k, False: 1.31k]
  |  Branch (6408:92): [True: 18.1k, False: 21.3k]
  ------------------
 6409|  56.2k|                                          (it[1] == 'A' && it[2] == 'L' && it[3] == 'S' && it[4] == 'E'))) {
  ------------------
  |  Branch (6409:44): [True: 7.09k, False: 49.1k]
  |  Branch (6409:60): [True: 5.31k, False: 1.77k]
  |  Branch (6409:76): [True: 4.68k, False: 634]
  |  Branch (6409:92): [True: 3.17k, False: 1.51k]
  ------------------
 6410|       |                     // Check what follows the word "false"
 6411|  21.3k|                     const auto after_false = it + 5;
 6412|  21.3k|                     const bool at_word_boundary = is_word_boundary(after_false);
 6413|       |
 6414|  21.3k|                     if (at_word_boundary) {
  ------------------
  |  Branch (6414:26): [True: 19.6k, False: 1.71k]
  ------------------
 6415|  19.6k|                        if (has_indented_block_continuation(after_false)) {
  ------------------
  |  Branch (6415:29): [True: 0, False: 19.6k]
  ------------------
 6416|      0|                           parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6417|      0|                           return;
 6418|      0|                        }
 6419|       |                        // Check if this is a key (followed by ": ") rather than a boolean value
 6420|       |                        // "false: value" should parse as {false: value}, not as the boolean false
 6421|  19.6k|                        if ((end - it > 5) && it[5] == ':' &&
  ------------------
  |  Branch (6421:29): [True: 17.1k, False: 2.49k]
  |  Branch (6421:47): [True: 12.1k, False: 4.97k]
  ------------------
 6422|  12.1k|                            (end - it == 6 || it[6] == ' ' || it[6] == '\t' || it[6] == '\n' || it[6] == '\r')) {
  ------------------
  |  Branch (6422:30): [True: 410, False: 11.7k]
  |  Branch (6422:47): [True: 587, False: 11.1k]
  |  Branch (6422:63): [True: 287, False: 10.8k]
  |  Branch (6422:80): [True: 1.63k, False: 9.21k]
  |  Branch (6422:97): [True: 9.21k, False: 0]
  ------------------
 6423|       |                           // This is "false:" followed by space/tab/newline/end - treat as key
 6424|  12.1k|                           parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6425|  12.1k|                           return;
 6426|  12.1k|                        }
 6427|  7.47k|                        process_yaml_variant_alternatives<V, is_yaml_variant_bool>::template op<Opts>(value, ctx, it,
 6428|  7.47k|                                                                                                      end);
 6429|  7.47k|                        return;
 6430|  19.6k|                     }
 6431|       |                     // "false" is followed by more characters (e.g., "False\b") - treat as string
 6432|  21.3k|                  }
 6433|  75.5k|               }
 6434|  55.9k|               parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6435|  75.5k|               return;
 6436|  46.9k|            case 'n':
  ------------------
  |  Branch (6436:13): [True: 46.9k, False: 4.37M]
  ------------------
 6437|  58.1k|            case 'N':
  ------------------
  |  Branch (6437:13): [True: 11.1k, False: 4.41M]
  ------------------
 6438|       |               // Could be "null", "Null", "NULL", or a key/string starting with n/N
 6439|  58.1k|               if constexpr (counts::n_null > 0) {
 6440|  58.1k|                  if ((end - it >= 4) && ((it[1] == 'u' && it[2] == 'l' && it[3] == 'l') ||
  ------------------
  |  Branch (6440:23): [True: 56.8k, False: 1.23k]
  |  Branch (6440:44): [True: 38.9k, False: 17.8k]
  |  Branch (6440:60): [True: 31.6k, False: 7.36k]
  |  Branch (6440:76): [True: 27.5k, False: 4.02k]
  ------------------
 6441|  29.2k|                                          (it[1] == 'U' && it[2] == 'L' && it[3] == 'L'))) {
  ------------------
  |  Branch (6441:44): [True: 1.31k, False: 27.9k]
  |  Branch (6441:60): [True: 948, False: 362]
  |  Branch (6441:76): [True: 631, False: 317]
  ------------------
 6442|       |                     // Check what follows the word "null"
 6443|  28.2k|                     const auto after_null = it + 4;
 6444|  28.2k|                     const bool at_word_boundary = is_word_boundary(after_null);
 6445|       |
 6446|  28.2k|                     if (at_word_boundary) {
  ------------------
  |  Branch (6446:26): [True: 23.1k, False: 5.08k]
  ------------------
 6447|  23.1k|                        if (has_indented_block_continuation(after_null)) {
  ------------------
  |  Branch (6447:29): [True: 0, False: 23.1k]
  ------------------
 6448|      0|                           parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6449|      0|                           return;
 6450|      0|                        }
 6451|       |                        // Check if this is a key (followed by ": ") rather than a null value
 6452|       |                        // "null: value" should parse as {null: value}, not as the null type
 6453|  23.1k|                        if ((end - it > 4) && it[4] == ':' &&
  ------------------
  |  Branch (6453:29): [True: 22.8k, False: 340]
  |  Branch (6453:47): [True: 12.4k, False: 10.3k]
  ------------------
 6454|  12.4k|                            (end - it == 5 || it[5] == ' ' || it[5] == '\t' || it[5] == '\n' || it[5] == '\r')) {
  ------------------
  |  Branch (6454:30): [True: 397, False: 12.0k]
  |  Branch (6454:47): [True: 644, False: 11.4k]
  |  Branch (6454:63): [True: 10.6k, False: 804]
  |  Branch (6454:80): [True: 373, False: 431]
  |  Branch (6454:97): [True: 431, False: 0]
  ------------------
 6455|       |                           // This is "null:" followed by space/tab/newline/end - treat as key
 6456|  12.4k|                           parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6457|  12.4k|                           return;
 6458|  12.4k|                        }
 6459|  10.6k|                        constexpr auto first_idx = yaml_variant_first_index_v<V, is_yaml_variant_null>;
 6460|  10.6k|                        using NullType = std::variant_alternative_t<first_idx, V>;
 6461|  10.6k|                        if (!std::holds_alternative<NullType>(value)) value = NullType{};
  ------------------
  |  Branch (6461:29): [True: 0, False: 10.6k]
  ------------------
 6462|  10.6k|                        from<YAML, NullType>::template op<Opts>(std::get<NullType>(value), ctx, it, end);
 6463|  10.6k|                        return;
 6464|  23.1k|                     }
 6465|       |                     // "null" is followed by more characters (e.g., "Null\b") - treat as string
 6466|  28.2k|                  }
 6467|  58.1k|               }
 6468|  34.9k|               parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6469|  58.1k|               return;
 6470|  1.36k|            case '~':
  ------------------
  |  Branch (6470:13): [True: 1.36k, False: 4.42M]
  ------------------
 6471|       |               // Null indicator
 6472|  1.36k|               if constexpr (counts::n_null > 0) {
 6473|  1.36k|                  constexpr auto first_idx = yaml_variant_first_index_v<V, is_yaml_variant_null>;
 6474|  1.36k|                  using NullType = std::variant_alternative_t<first_idx, V>;
 6475|  1.36k|                  if (!std::holds_alternative<NullType>(value)) value = NullType{};
  ------------------
  |  Branch (6475:23): [True: 0, False: 1.36k]
  ------------------
 6476|  1.36k|                  from<YAML, NullType>::template op<Opts>(std::get<NullType>(value), ctx, it, end);
 6477|  1.36k|                  return;
 6478|  1.36k|               }
 6479|      0|               break; // Fall through to try other types
 6480|   431k|            case '-':
  ------------------
  |  Branch (6480:13): [True: 431k, False: 3.99M]
  ------------------
 6481|       |               // Could be negative number or block sequence indicator
 6482|   431k|               if (((it + 1) == end) || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(it[1])]) {
  ------------------
  |  Branch (6482:20): [True: 4.81k, False: 426k]
  |  Branch (6482:41): [True: 319k, False: 107k]
  ------------------
 6483|       |                  // Block sequence indicator "- "
 6484|   324k|                  if constexpr (counts::n_array > 0) {
 6485|   324k|                     process_yaml_variant_alternatives<V, is_yaml_variant_array>::template op<Opts>(value, ctx, it,
 6486|   324k|                                                                                                    end);
 6487|   324k|                     return;
 6488|   324k|                  }
 6489|   324k|               }
 6490|   431k|               if constexpr (counts::n_num > 0) {
 6491|   431k|                  if ((end - it >= 2) && (std::isdigit(static_cast<unsigned char>(it[1])) || it[1] == '.')) {
  ------------------
  |  Branch (6491:23): [True: 107k, False: 324k]
  |  Branch (6491:43): [True: 1.93k, False: 105k]
  |  Branch (6491:94): [True: 48.5k, False: 56.5k]
  ------------------
 6492|  50.4k|                     process_yaml_variant_alternatives<V, is_yaml_variant_num>::template op<Opts>(value, ctx, it, end);
 6493|  50.4k|                     return;
 6494|  50.4k|                  }
 6495|   431k|               }
 6496|   380k|               parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6497|   431k|               return;
 6498|  25.7k|            case '+':
  ------------------
  |  Branch (6498:13): [True: 25.7k, False: 4.39M]
  ------------------
 6499|  44.8k|            case '.':
  ------------------
  |  Branch (6499:13): [True: 19.1k, False: 4.40M]
  ------------------
 6500|       |               // Could be a number (.5, +5, .inf, etc.) or a string (.c, .cpp, +name, etc.)
 6501|       |               // Try parsing as number speculatively, fall back to string on failure
 6502|  44.8k|               if constexpr (counts::n_num > 0) {
 6503|  44.8k|                  auto start_it = it;
 6504|  44.8k|                  auto temp_ctx = ctx.make_speculative();
 6505|  44.8k|                  process_yaml_variant_alternatives<V, is_yaml_variant_num>::template op<Opts>(value, temp_ctx, it,
 6506|  44.8k|                                                                                               end);
 6507|  44.8k|                  ctx.alias_expansion_budget = temp_ctx.alias_expansion_budget; // charged even if rejected
 6508|  44.8k|                  ctx.key_expansion_budget = temp_ctx.key_expansion_budget;
 6509|  44.8k|                  if (!bool(temp_ctx.error)) {
  ------------------
  |  Branch (6509:23): [True: 5.27k, False: 39.5k]
  ------------------
 6510|  5.27k|                     ctx.anchors = std::move(temp_ctx.anchors);
 6511|  5.27k|                     return; // Successfully parsed as number
 6512|  5.27k|                  }
 6513|  39.5k|                  it = start_it; // Restore and fall through to string
 6514|  39.5k|               }
 6515|      0|               parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6516|  44.8k|               return;
 6517|  1.15M|            default:
  ------------------
  |  Branch (6517:13): [True: 1.15M, False: 3.26M]
  ------------------
 6518|       |               // Check for digit (0-9) - numeric or block mapping key starting with digit
 6519|  1.15M|               if (c >= '0' && c <= '9') {
  ------------------
  |  Branch (6519:20): [True: 839k, False: 320k]
  |  Branch (6519:32): [True: 653k, False: 185k]
  ------------------
 6520|       |                  // Try block mapping first (e.g., "123key: value")
 6521|   653k|                  if (try_parse_block_mapping_into_variant<V, Opts>(value, ctx, it, end)) {
  ------------------
  |  Branch (6521:23): [True: 5.92k, False: 647k]
  ------------------
 6522|  5.92k|                     return;
 6523|  5.92k|                  }
 6524|       |                  // Try numeric value speculatively - values like "12:30" look numeric but aren't
 6525|   647k|                  if constexpr (counts::n_num > 0) {
 6526|   647k|                     auto start_it = it;
 6527|   647k|                     auto temp_ctx = ctx.make_speculative();
 6528|   647k|                     process_yaml_variant_alternatives<V, is_yaml_variant_num>::template op<Opts>(value, temp_ctx, it,
 6529|   647k|                                                                                                  end);
 6530|   647k|                     ctx.alias_expansion_budget = temp_ctx.alias_expansion_budget; // charged even if rejected
 6531|   647k|                     ctx.key_expansion_budget = temp_ctx.key_expansion_budget;
 6532|   647k|                     if (!bool(temp_ctx.error)) {
  ------------------
  |  Branch (6532:26): [True: 579k, False: 67.8k]
  ------------------
 6533|   579k|                        ctx.anchors = std::move(temp_ctx.anchors);
 6534|   579k|                        return; // Successfully parsed as number
 6535|   579k|                     }
 6536|  67.8k|                     it = start_it; // Restore and fall through to string
 6537|  67.8k|                  }
 6538|       |                  // Fall through to string
 6539|      0|                  process_yaml_variant_alternatives<V, is_yaml_variant_str>::template op<Opts>(value, ctx, it, end);
 6540|   647k|                  return;
 6541|   653k|               }
 6542|       |               // Plain scalar - try block mapping, then string
 6543|   506k|               parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6544|   506k|               return;
 6545|  4.42M|            }
 6546|  4.42M|         }
 6547|       |
 6548|       |         // For non-auto-deducible variants or fallback, try each type until one succeeds
 6549|      0|         constexpr auto N = std::variant_size_v<std::remove_cvref_t<T>>;
 6550|       |
 6551|       |         // This fold discards each alternative's error and reports only that nothing fit, which
 6552|       |         // misdiagnoses a document that exhausted an expansion budget as merely the wrong shape.
 6553|       |         // Kept aside and used only if no alternative parsed, so a later one that does parse
 6554|       |         // (possible under a latched budget if it materializes no key text) is unaffected.
 6555|  4.42M|         error_code expansion_error{};
 6556|  4.42M|         std::string_view expansion_message{};
 6557|       |
 6558|  4.42M|         auto try_parse = [&]<size_t I>() -> bool {
 6559|  4.42M|            using V = std::variant_alternative_t<I, std::remove_cvref_t<T>>;
 6560|  4.42M|            auto start = it;
 6561|       |
 6562|  4.42M|            V v{};
 6563|  4.42M|            auto temp_ctx = ctx.make_speculative();
 6564|  4.42M|            from<YAML, V>::template op<Opts>(v, temp_ctx, it, end);
 6565|  4.42M|            ctx.alias_expansion_budget = temp_ctx.alias_expansion_budget; // charged even if rejected
 6566|  4.42M|            ctx.key_expansion_budget = temp_ctx.key_expansion_budget;
 6567|       |
 6568|  4.42M|            if (!bool(temp_ctx.error)) {
 6569|  4.42M|               value = std::move(v);
 6570|  4.42M|               ctx.anchors = std::move(temp_ctx.anchors);
 6571|  4.42M|               return true;
 6572|  4.42M|            }
 6573|       |
 6574|  4.42M|            if (temp_ctx.error == error_code::exceeded_max_expansion && expansion_error == error_code::none) {
 6575|  4.42M|               expansion_error = temp_ctx.error;
 6576|  4.42M|               expansion_message = temp_ctx.custom_error_message;
 6577|  4.42M|            }
 6578|  4.42M|            it = start;
 6579|  4.42M|            return false;
 6580|  4.42M|         };
 6581|       |
 6582|  4.42M|         bool parsed = false;
 6583|  4.42M|         [&]<size_t... Is>(std::index_sequence<Is...>) {
 6584|  4.42M|            ((parsed = parsed || try_parse.template operator()<Is>()), ...);
 6585|  4.42M|         }(std::make_index_sequence<N>{});
 6586|       |
 6587|  4.42M|         if (!parsed) {
  ------------------
  |  Branch (6587:14): [True: 0, False: 4.42M]
  ------------------
 6588|      0|            if (expansion_error != error_code::none) {
  ------------------
  |  Branch (6588:17): [True: 0, False: 0]
  ------------------
 6589|      0|               ctx.error = expansion_error;
 6590|      0|               ctx.custom_error_message = expansion_message;
 6591|      0|            }
 6592|      0|            else {
 6593|      0|               ctx.error = error_code::no_matching_variant_type;
 6594|      0|            }
 6595|      0|         }
 6596|  4.42M|      }
_ZN3glz4yaml12handle_aliasITnDaXtlNS0_9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj33EEERNSt3__17variantIJDndNS3_12basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEEbNS3_6vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS8_ISF_EEEENSE_ISF_EEEEENS0_12yaml_contextEPKcSN_EEbOT0_RT1_RT2_T3_:
  300|   608k|      {
  301|   608k|         if (it == end || *it != '*') return false;
  ------------------
  |  Branch (301:14): [True: 0, False: 608k]
  |  Branch (301:27): [True: 0, False: 608k]
  ------------------
  302|       |
  303|   608k|         ++it; // skip '*'
  304|   608k|         auto name = parse_anchor_name(it, end);
  305|   608k|         if (name.empty()) {
  ------------------
  |  Branch (305:14): [True: 85, False: 608k]
  ------------------
  306|     85|            ctx.error = error_code::syntax_error;
  307|     85|            return true;
  308|     85|         }
  309|       |
  310|   608k|         auto anchor_it = ctx.anchors.find(name);
  311|   608k|         if (anchor_it == ctx.anchors.end()) {
  ------------------
  |  Branch (311:14): [True: 1.96k, False: 606k]
  ------------------
  312|  1.96k|            ctx.error = error_code::syntax_error; // undefined alias
  313|  1.96k|            return true;
  314|  1.96k|         }
  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|   606k|         const auto span = anchor_it->second;
  319|       |
  320|       |         // Empty anchor span (anchor on null/empty node) — leave value as default
  321|   606k|         if (span.begin == span.end) {
  ------------------
  |  Branch (321:14): [True: 4.56k, False: 601k]
  ------------------
  322|  4.56k|            return true;
  323|  4.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|   601k|         if (ctx.alias_span_is_replaying(span.begin, span.end)) [[unlikely]] {
  ------------------
  |  Branch (328:14): [True: 15, False: 601k]
  ------------------
  329|     15|            ctx.error = error_code::syntax_error; // cyclic alias
  330|     15|            return true;
  331|     15|         }
  332|       |
  333|       |         // Replaying an anchor re-enters the reader directly, bypassing the variant reader's
  334|       |         // depth guard, so this is the only depth accounting a chain of aliases into a
  335|       |         // non-variant target gets. The cycle check above stops the unbounded case; this bounds
  336|       |         // a legitimate but deeply chained one.
  337|   601k|         depth_guard guard{ctx, yaml::max_yaml_recursive_depth};
  338|   601k|         if (!guard) [[unlikely]]
  ------------------
  |  Branch (338:14): [True: 1, False: 601k]
  ------------------
  339|      1|            return true;
  340|       |
  341|   601k|         if (!ctx.charge_alias_expansion(static_cast<size_t>(span.end - span.begin))) [[unlikely]] {
  ------------------
  |  Branch (341:14): [True: 10, False: 601k]
  ------------------
  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|   601k|         auto replay_it = span.begin;
  348|   601k|         auto replay_end = span.end;
  349|       |
  350|       |         // Save indent context and set up for replay
  351|   601k|         auto saved_indent_stack = std::move(ctx.indent_stack);
  352|   601k|         ctx.indent_stack.clear();
  353|   601k|         if (span.base_indent > 0) {
  ------------------
  |  Branch (353:14): [True: 21.1k, False: 580k]
  ------------------
  354|  21.1k|            ctx.push_indent(span.base_indent - 1);
  355|  21.1k|         }
  356|       |
  357|   601k|         ctx.active_alias_spans.emplace_back(span.begin, span.end);
  358|       |
  359|   601k|         using V = std::remove_cvref_t<T>;
  360|   601k|         from<YAML, V>::template op<Opts>(std::forward<T>(value), ctx, replay_it, replay_end);
  361|       |
  362|   601k|         ctx.active_alias_spans.pop_back();
  363|       |
  364|       |         // Restore indent context
  365|   601k|         ctx.indent_stack = std::move(saved_indent_stack);
  366|   601k|         return true;
  367|   601k|      }
_ZN3glz33process_yaml_variant_alternativesINSt3__17variantIJDndNS1_12basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEbNS1_6vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS6_ISD_EEEENSC_ISD_EEEEENS_19is_yaml_variant_strEE2opITnDaXtlNS_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj33EEERSH_TkNS_10is_contextERNSL_12yaml_contextERPKcSR_EEvOT0_OT1_OT2_T3_:
 5205|   706k|      {
 5206|   706k|         constexpr auto category_count = yaml_variant_count_v<Variant, Trait>;
 5207|       |
 5208|       |         if constexpr (category_count == 0) {
 5209|       |            ctx.error = error_code::no_matching_variant_type;
 5210|       |         }
 5211|   706k|         else if constexpr (category_count == 1) {
 5212|       |            // Only one type in this category, use it directly
 5213|   706k|            constexpr auto first_idx = yaml_variant_first_index_v<Variant, Trait>;
 5214|   706k|            using V = std::variant_alternative_t<first_idx, Variant>;
 5215|   706k|            if (!std::holds_alternative<V>(value)) value = V{};
  ------------------
  |  Branch (5215:17): [True: 706k, False: 0]
  ------------------
 5216|   706k|            from<YAML, V>::template op<Opts>(std::get<V>(value), ctx, it, end);
 5217|       |         }
 5218|       |         else {
 5219|       |            // Multiple types in this category, try each one
 5220|       |            constexpr auto N = std::variant_size_v<Variant>;
 5221|       |            bool found_match{};
 5222|       |            size_t match_idx = 0;
 5223|       |            // Only the last alternative propagates its error, so an alternative that exhausted an
 5224|       |            // expansion budget would otherwise be reported as no_matching_variant_type -- a wrong
 5225|       |            // diagnosis for a document that is hostile rather than merely the wrong shape. Held
 5226|       |            // aside and used only if nothing matched, so an alternative that does succeed later
 5227|       |            // (one that materializes no key text can still parse under a latched budget) is
 5228|       |            // unaffected.
 5229|       |            error_code expansion_error{};
 5230|       |            std::string_view expansion_message{};
 5231|       |
 5232|       |            for_each<N>([&]<size_t I>() {
 5233|       |               if (found_match) {
 5234|       |                  return;
 5235|       |               }
 5236|       |               using V = std::variant_alternative_t<I, Variant>;
 5237|       |               if constexpr (Trait<V>::value) {
 5238|       |                  auto copy_it = it;
 5239|       |                  if (!std::holds_alternative<V>(value)) {
 5240|       |                     value = V{};
 5241|       |                  }
 5242|       |
 5243|       |                  auto temp_ctx = ctx.make_speculative();
 5244|       |                  from<YAML, V>::template op<Opts>(std::get<V>(value), temp_ctx, it, end);
 5245|       |
 5246|       |                  // Charged whether or not the alternative fit: a rejected probe still replayed
 5247|       |                  // whatever aliases it reached, and an attempt that is never billed is an
 5248|       |                  // attempt that can be repeated for free.
 5249|       |                  ctx.alias_expansion_budget = temp_ctx.alias_expansion_budget;
 5250|       |                  ctx.key_expansion_budget = temp_ctx.key_expansion_budget;
 5251|       |
 5252|       |                  if (!bool(temp_ctx.error)) {
 5253|       |                     found_match = true;
 5254|       |                     ctx.anchors = std::move(temp_ctx.anchors);
 5255|       |                  }
 5256|       |                  else {
 5257|       |                     it = copy_it;
 5258|       |                     if (temp_ctx.error == error_code::exceeded_max_expansion && expansion_error == error_code::none) {
 5259|       |                        expansion_error = temp_ctx.error;
 5260|       |                        expansion_message = temp_ctx.custom_error_message;
 5261|       |                     }
 5262|       |                     if (match_idx + 1 < category_count) {
 5263|       |                        // Not the last type, continue trying
 5264|       |                     }
 5265|       |                     else {
 5266|       |                        // Last type failed, propagate error
 5267|       |                        ctx.error = temp_ctx.error;
 5268|       |                        ctx.custom_error_message = temp_ctx.custom_error_message;
 5269|       |                     }
 5270|       |                  }
 5271|       |                  ++match_idx;
 5272|       |               }
 5273|       |            });
 5274|       |
 5275|       |            if (!found_match && !bool(ctx.error)) {
 5276|       |               if (expansion_error != error_code::none) {
 5277|       |                  ctx.error = expansion_error;
 5278|       |                  ctx.custom_error_message = expansion_message;
 5279|       |               }
 5280|       |               else {
 5281|       |                  ctx.error = error_code::no_matching_variant_type;
 5282|       |               }
 5283|       |            }
 5284|       |         }
 5285|   706k|      }
_ZN3glz4fromILj450ENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEE2opITnDaXtlNS_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj33EEERPKcRS7_TkNS_10is_contextERNSA_12yaml_contextESD_EEvOT1_OT2_OT0_T3_:
 1892|   736k|      {
 1893|   736k|         if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (1893:14): [True: 2.98k, False: 733k]
  ------------------
 1894|  2.98k|            return;
 1895|       |
 1896|   733k|         yaml::node_preamble_state preamble{};
 1897|   733k|         if (yaml::parse_node_preamble<Opts, yaml::node_property_policy{true, false, false, true}>(
  ------------------
  |  Branch (1897:14): [True: 30.8k, False: 702k]
  ------------------
 1898|   733k|                value, ctx, it, end, preamble, [](yaml::yaml_tag tag) { return yaml::tag_valid_for_string(tag); }))
 1899|  30.8k|            return;
 1900|       |
 1901|   702k|         std::string str;
 1902|   702k|         const auto style = yaml::detect_scalar_style(*it);
 1903|       |
 1904|   702k|         switch (style) {
  ------------------
  |  Branch (1904:18): [True: 702k, False: 0]
  ------------------
 1905|  4.55k|         case yaml::scalar_style::double_quoted:
  ------------------
  |  Branch (1905:10): [True: 4.55k, False: 698k]
  ------------------
 1906|  4.55k|            yaml::parse_double_quoted_string(str, ctx, it, end);
 1907|  4.55k|            break;
 1908|  6.24k|         case yaml::scalar_style::single_quoted:
  ------------------
  |  Branch (1908:10): [True: 6.24k, False: 696k]
  ------------------
 1909|  6.24k|            yaml::parse_single_quoted_string(str, ctx, it, end);
 1910|  6.24k|            break;
 1911|  1.66k|         case yaml::scalar_style::literal_block:
  ------------------
  |  Branch (1911:10): [True: 1.66k, False: 701k]
  ------------------
 1912|  5.72k|         case yaml::scalar_style::folded_block:
  ------------------
  |  Branch (1912:10): [True: 4.05k, False: 698k]
  ------------------
 1913|       |            // For same-line mapping/sequence values, parsing context is typically pushed
 1914|       |            // one column past the key/item indicator; block scalar indentation is relative
 1915|       |            // to the parent line indent.
 1916|  5.72k|            yaml::parse_block_scalar(str, ctx, it, end,
 1917|  5.72k|                                     ctx.current_indent() > 0 ? (ctx.current_indent() - 1) : ctx.current_indent());
  ------------------
  |  Branch (1917:38): [True: 1.09k, False: 4.62k]
  ------------------
 1918|  5.72k|            break;
 1919|   686k|         case yaml::scalar_style::plain:
  ------------------
  |  Branch (1919:10): [True: 686k, False: 16.5k]
  ------------------
 1920|       |            // In block context with known indent, use multiline parsing to support
 1921|       |            // plain scalars that span multiple lines (folding behavior)
 1922|       |            if constexpr (!yaml::check_flow_context(Opts)) {
 1923|       |               if (ctx.current_indent() >= 0) {
 1924|       |                  yaml::parse_plain_scalar_multiline(str, ctx, it, end, ctx.current_indent());
 1925|       |               }
 1926|       |               else {
 1927|       |                  // Top-level plain scalars may continue on same-indent or indented lines.
 1928|       |                  yaml::parse_plain_scalar_multiline(str, ctx, it, end, int32_t(0));
 1929|       |               }
 1930|       |            }
 1931|   686k|            else {
 1932|   686k|               yaml::parse_plain_scalar(str, ctx, it, end, true);
 1933|   686k|            }
 1934|   686k|            break;
 1935|   702k|         }
 1936|       |
 1937|   702k|         if (!bool(ctx.error)) {
  ------------------
  |  Branch (1937:14): [True: 702k, False: 236]
  ------------------
 1938|   702k|            value = std::move(str);
 1939|   702k|            yaml::finalize_node_anchor(preamble.node_props, ctx, it);
 1940|   702k|         }
 1941|   702k|      }
_ZN3glz4yaml19parse_node_preambleITnDaXtlNS0_9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj33EEEXtlNS0_20node_property_policyELb1ELb0ELb0ELb1EEELb0ERNSt3__112basic_stringIcNS4_11char_traitsIcEENS4_9allocatorIcEEEENS0_12yaml_contextEPKcSE_ZNS_4fromILj450ESA_E2opITnDaXtlS2_Lj450ELb1ELb0ELb1ELh2ELb0ELj33EEERSE_SB_TkNS_10is_contextERSC_SE_EEvOT1_OT2_OT0_T3_EUlNS0_8yaml_tagEE_EEbSN_RSQ_RT4_T5_RNS0_19node_preamble_stateEOT6_:
  465|   733k|      {
  466|   733k|         skip_inline_ws(it, end);
  467|       |
  468|   733k|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (468:14): [True: 1, False: 733k]
  ------------------
  469|      1|            if constexpr (!AllowEmptyInput) {
  470|      1|               ctx.error = error_code::unexpected_end;
  471|      1|            }
  472|      1|            return true;
  473|      1|         }
  474|       |
  475|   733k|         preamble.tag = parse_yaml_tag(it, end, ctx);
  476|   733k|         if (preamble.tag == yaml_tag::unknown) [[unlikely]] {
  ------------------
  |  Branch (476:14): [True: 18, False: 733k]
  ------------------
  477|     18|            ctx.error = error_code::syntax_error;
  478|     18|            return true;
  479|     18|         }
  480|   733k|         if (!tag_validator(preamble.tag)) [[unlikely]] {
  ------------------
  |  Branch (480:14): [True: 3, False: 733k]
  ------------------
  481|      3|            ctx.error = error_code::syntax_error;
  482|      3|            return true;
  483|      3|         }
  484|       |
  485|   733k|         skip_inline_ws(it, end);
  486|       |
  487|   733k|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (487:14): [True: 5, False: 733k]
  ------------------
  488|      5|            if constexpr (!AllowEmptyInput) {
  489|      5|               ctx.error = error_code::unexpected_end;
  490|      5|            }
  491|      5|            return true;
  492|      5|         }
  493|       |
  494|   733k|         if (parse_node_properties<Opts, PropertyPolicy>(std::forward<T>(value), ctx, it, end, preamble.node_props)) {
  ------------------
  |  Branch (494:14): [True: 30.8k, False: 702k]
  ------------------
  495|  30.8k|            return true;
  496|  30.8k|         }
  497|       |
  498|   702k|         return false;
  499|   733k|      }
_ZZN3glz4fromILj450ENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEE2opITnDaXtlNS_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj33EEERPKcRS7_TkNS_10is_contextERNSA_12yaml_contextESD_EEvOT1_OT2_OT0_T3_ENKUlNSA_8yaml_tagEE_clESP_:
 1898|   733k|                value, ctx, it, end, preamble, [](yaml::yaml_tag tag) { return yaml::tag_valid_for_string(tag); }))
_ZN3glz4yaml21parse_node_propertiesITnDaXtlNS0_9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj33EEEXtlNS0_20node_property_policyELb1ELb0ELb0ELb1EEERNSt3__112basic_stringIcNS4_11char_traitsIcEENS4_9allocatorIcEEEENS0_12yaml_contextEPKcSE_EEbOT1_RT2_RT3_T4_RNS0_19node_property_stateE:
  408|   733k|      {
  409|   733k|         state.has_anchor = false;
  410|   733k|         state.anchor_name.clear();
  411|   733k|         state.anchor_start = nullptr;
  412|   733k|         state.anchor_indent = ctx.current_indent();
  413|       |
  414|   733k|         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|   733k|            else {
  421|   733k|               if (handle_alias<Opts>(std::forward<T>(value), ctx, it, end)) return true;
  ------------------
  |  Branch (421:20): [True: 30.8k, False: 702k]
  ------------------
  422|   733k|            }
  423|   733k|         }
  424|       |
  425|   733k|         if (it != end && *it == '&') {
  ------------------
  |  Branch (425:14): [True: 702k, False: 30.8k]
  |  Branch (425:27): [True: 8.47k, False: 694k]
  ------------------
  426|  8.47k|            ++it;
  427|  8.47k|            auto name = parse_anchor_name(it, end);
  428|  8.47k|            if (name.empty()) {
  ------------------
  |  Branch (428:17): [True: 5, False: 8.46k]
  ------------------
  429|      5|               ctx.error = error_code::syntax_error;
  430|      5|               return true;
  431|      5|            }
  432|  8.46k|            skip_inline_ws(it, end);
  433|  8.46k|            if (it == end) {
  ------------------
  |  Branch (433:17): [True: 13, False: 8.45k]
  ------------------
  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|  8.45k|            if constexpr (Policy.disallow_anchor_on_alias) {
  440|  8.45k|               if (*it == '*') {
  ------------------
  |  Branch (440:20): [True: 10, False: 8.44k]
  ------------------
  441|     10|                  ctx.error = error_code::syntax_error;
  442|     10|                  return true;
  443|     10|               }
  444|  8.45k|            }
  445|  8.44k|            state.has_anchor = true;
  446|  8.45k|            state.anchor_name = std::string(name);
  447|  8.45k|            state.anchor_start = &*it;
  448|  8.45k|         }
  449|       |
  450|   733k|         return false;
  451|   733k|      }
_ZN3glz4yaml12handle_aliasITnDaXtlNS0_9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj33EEERNSt3__112basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEENS0_12yaml_contextEPKcSD_EEbOT0_RT1_RT2_T3_:
  300|   733k|      {
  301|   733k|         if (it == end || *it != '*') return false;
  ------------------
  |  Branch (301:14): [True: 0, False: 733k]
  |  Branch (301:27): [True: 702k, False: 30.8k]
  ------------------
  302|       |
  303|  30.8k|         ++it; // skip '*'
  304|  30.8k|         auto name = parse_anchor_name(it, end);
  305|  30.8k|         if (name.empty()) {
  ------------------
  |  Branch (305:14): [True: 4, False: 30.8k]
  ------------------
  306|      4|            ctx.error = error_code::syntax_error;
  307|      4|            return true;
  308|      4|         }
  309|       |
  310|  30.8k|         auto anchor_it = ctx.anchors.find(name);
  311|  30.8k|         if (anchor_it == ctx.anchors.end()) {
  ------------------
  |  Branch (311:14): [True: 31, False: 30.7k]
  ------------------
  312|     31|            ctx.error = error_code::syntax_error; // undefined alias
  313|     31|            return true;
  314|     31|         }
  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|  30.7k|         const auto span = anchor_it->second;
  319|       |
  320|       |         // Empty anchor span (anchor on null/empty node) — leave value as default
  321|  30.7k|         if (span.begin == span.end) {
  ------------------
  |  Branch (321:14): [True: 774, False: 30.0k]
  ------------------
  322|    774|            return true;
  323|    774|         }
  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|  30.0k|         if (ctx.alias_span_is_replaying(span.begin, span.end)) [[unlikely]] {
  ------------------
  |  Branch (328:14): [True: 2, False: 30.0k]
  ------------------
  329|      2|            ctx.error = error_code::syntax_error; // cyclic alias
  330|      2|            return true;
  331|      2|         }
  332|       |
  333|       |         // Replaying an anchor re-enters the reader directly, bypassing the variant reader's
  334|       |         // depth guard, so this is the only depth accounting a chain of aliases into a
  335|       |         // non-variant target gets. The cycle check above stops the unbounded case; this bounds
  336|       |         // a legitimate but deeply chained one.
  337|  30.0k|         depth_guard guard{ctx, yaml::max_yaml_recursive_depth};
  338|  30.0k|         if (!guard) [[unlikely]]
  ------------------
  |  Branch (338:14): [True: 1, False: 30.0k]
  ------------------
  339|      1|            return true;
  340|       |
  341|  30.0k|         if (!ctx.charge_alias_expansion(static_cast<size_t>(span.end - span.begin))) [[unlikely]] {
  ------------------
  |  Branch (341:14): [True: 1, False: 29.9k]
  ------------------
  342|      1|            ctx.error = error_code::exceeded_max_expansion;
  343|      1|            ctx.custom_error_message = "alias expansion";
  344|      1|            return true;
  345|      1|         }
  346|       |
  347|  29.9k|         auto replay_it = span.begin;
  348|  29.9k|         auto replay_end = span.end;
  349|       |
  350|       |         // Save indent context and set up for replay
  351|  29.9k|         auto saved_indent_stack = std::move(ctx.indent_stack);
  352|  29.9k|         ctx.indent_stack.clear();
  353|  29.9k|         if (span.base_indent > 0) {
  ------------------
  |  Branch (353:14): [True: 902, False: 29.0k]
  ------------------
  354|    902|            ctx.push_indent(span.base_indent - 1);
  355|    902|         }
  356|       |
  357|  29.9k|         ctx.active_alias_spans.emplace_back(span.begin, span.end);
  358|       |
  359|  29.9k|         using V = std::remove_cvref_t<T>;
  360|  29.9k|         from<YAML, V>::template op<Opts>(std::forward<T>(value), ctx, replay_it, replay_end);
  361|       |
  362|  29.9k|         ctx.active_alias_spans.pop_back();
  363|       |
  364|       |         // Restore indent context
  365|  29.9k|         ctx.indent_stack = std::move(saved_indent_stack);
  366|  29.9k|         return true;
  367|  30.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_optsELj450ELb1ELb0ELb1ELh2ELb0ELj33EEERSH_TkNS_10is_contextERNSL_12yaml_contextERPKcSR_EEvOT0_OT1_OT2_T3_:
 5205|   752k|      {
 5206|   752k|         constexpr auto category_count = yaml_variant_count_v<Variant, Trait>;
 5207|       |
 5208|       |         if constexpr (category_count == 0) {
 5209|       |            ctx.error = error_code::no_matching_variant_type;
 5210|       |         }
 5211|   752k|         else if constexpr (category_count == 1) {
 5212|       |            // Only one type in this category, use it directly
 5213|   752k|            constexpr auto first_idx = yaml_variant_first_index_v<Variant, Trait>;
 5214|   752k|            using V = std::variant_alternative_t<first_idx, Variant>;
 5215|   752k|            if (!std::holds_alternative<V>(value)) value = V{};
  ------------------
  |  Branch (5215:17): [True: 752k, False: 0]
  ------------------
 5216|   752k|            from<YAML, V>::template op<Opts>(std::get<V>(value), ctx, it, end);
 5217|       |         }
 5218|       |         else {
 5219|       |            // Multiple types in this category, try each one
 5220|       |            constexpr auto N = std::variant_size_v<Variant>;
 5221|       |            bool found_match{};
 5222|       |            size_t match_idx = 0;
 5223|       |            // Only the last alternative propagates its error, so an alternative that exhausted an
 5224|       |            // expansion budget would otherwise be reported as no_matching_variant_type -- a wrong
 5225|       |            // diagnosis for a document that is hostile rather than merely the wrong shape. Held
 5226|       |            // aside and used only if nothing matched, so an alternative that does succeed later
 5227|       |            // (one that materializes no key text can still parse under a latched budget) is
 5228|       |            // unaffected.
 5229|       |            error_code expansion_error{};
 5230|       |            std::string_view expansion_message{};
 5231|       |
 5232|       |            for_each<N>([&]<size_t I>() {
 5233|       |               if (found_match) {
 5234|       |                  return;
 5235|       |               }
 5236|       |               using V = std::variant_alternative_t<I, Variant>;
 5237|       |               if constexpr (Trait<V>::value) {
 5238|       |                  auto copy_it = it;
 5239|       |                  if (!std::holds_alternative<V>(value)) {
 5240|       |                     value = V{};
 5241|       |                  }
 5242|       |
 5243|       |                  auto temp_ctx = ctx.make_speculative();
 5244|       |                  from<YAML, V>::template op<Opts>(std::get<V>(value), temp_ctx, it, end);
 5245|       |
 5246|       |                  // Charged whether or not the alternative fit: a rejected probe still replayed
 5247|       |                  // whatever aliases it reached, and an attempt that is never billed is an
 5248|       |                  // attempt that can be repeated for free.
 5249|       |                  ctx.alias_expansion_budget = temp_ctx.alias_expansion_budget;
 5250|       |                  ctx.key_expansion_budget = temp_ctx.key_expansion_budget;
 5251|       |
 5252|       |                  if (!bool(temp_ctx.error)) {
 5253|       |                     found_match = true;
 5254|       |                     ctx.anchors = std::move(temp_ctx.anchors);
 5255|       |                  }
 5256|       |                  else {
 5257|       |                     it = copy_it;
 5258|       |                     if (temp_ctx.error == error_code::exceeded_max_expansion && expansion_error == error_code::none) {
 5259|       |                        expansion_error = temp_ctx.error;
 5260|       |                        expansion_message = temp_ctx.custom_error_message;
 5261|       |                     }
 5262|       |                     if (match_idx + 1 < category_count) {
 5263|       |                        // Not the last type, continue trying
 5264|       |                     }
 5265|       |                     else {
 5266|       |                        // Last type failed, propagate error
 5267|       |                        ctx.error = temp_ctx.error;
 5268|       |                        ctx.custom_error_message = temp_ctx.custom_error_message;
 5269|       |                     }
 5270|       |                  }
 5271|       |                  ++match_idx;
 5272|       |               }
 5273|       |            });
 5274|       |
 5275|       |            if (!found_match && !bool(ctx.error)) {
 5276|       |               if (expansion_error != error_code::none) {
 5277|       |                  ctx.error = expansion_error;
 5278|       |                  ctx.custom_error_message = expansion_message;
 5279|       |               }
 5280|       |               else {
 5281|       |                  ctx.error = error_code::no_matching_variant_type;
 5282|       |               }
 5283|       |            }
 5284|       |         }
 5285|   752k|      }
_ZN3glz4fromILj450EdE2opITnDaXtlNS_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj33EEERPKcRdTkNS_10is_contextERNS3_12yaml_contextES6_EEvOT1_OT2_OT0_T3_:
 2047|   756k|      {
 2048|   756k|         if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2048:14): [True: 0, False: 756k]
  ------------------
 2049|      0|            return;
 2050|       |
 2051|   756k|         yaml::node_preamble_state preamble{};
 2052|   756k|         if (yaml::parse_node_preamble<Opts>(value, ctx, it, end, preamble, [](yaml::yaml_tag tag) {
  ------------------
  |  Branch (2052:14): [True: 6.07k, False: 750k]
  ------------------
 2053|   756k|                if constexpr (std::floating_point<std::remove_cvref_t<T>>) {
 2054|   756k|                   return yaml::tag_valid_for_float(tag);
 2055|   756k|                }
 2056|   756k|                else {
 2057|   756k|                   return yaml::tag_valid_for_int(tag);
 2058|   756k|                }
 2059|   756k|             }))
 2060|  6.07k|            return;
 2061|       |
 2062|   750k|         auto finalize = [&] { yaml::finalize_node_anchor(preamble.node_props, ctx, it); };
 2063|       |
 2064|       |         // Check for special float values
 2065|   750k|         if constexpr (std::floating_point<std::remove_cvref_t<T>>) {
 2066|   750k|            auto start = it;
 2067|       |
 2068|       |            // Check for .inf, .nan, -.inf, etc.
 2069|   750k|            if (*it == '.') {
  ------------------
  |  Branch (2069:17): [True: 21.5k, False: 729k]
  ------------------
 2070|  21.5k|               ++it;
 2071|  21.5k|               if (it + 3 <= end && (std::string_view(it, 3) == "inf" || std::string_view(it, 3) == "Inf" ||
  ------------------
  |  Branch (2071:20): [True: 20.5k, False: 965]
  |  Branch (2071:38): [True: 1.24k, False: 19.3k]
  |  Branch (2071:74): [True: 1.80k, False: 17.4k]
  ------------------
 2072|  17.4k|                                     std::string_view(it, 3) == "INF")) {
  ------------------
  |  Branch (2072:38): [True: 1.80k, False: 15.6k]
  ------------------
 2073|  4.85k|                  value = std::numeric_limits<std::remove_cvref_t<T>>::infinity();
 2074|  4.85k|                  it += 3;
 2075|  4.85k|                  finalize();
 2076|  4.85k|                  return;
 2077|  4.85k|               }
 2078|  16.6k|               if (it + 3 <= end && (std::string_view(it, 3) == "nan" || std::string_view(it, 3) == "NaN" ||
  ------------------
  |  Branch (2078:20): [True: 15.6k, False: 965]
  |  Branch (2078:38): [True: 300, False: 15.3k]
  |  Branch (2078:74): [True: 596, False: 14.7k]
  ------------------
 2079|  14.7k|                                     std::string_view(it, 3) == "NAN")) {
  ------------------
  |  Branch (2079:38): [True: 1.16k, False: 13.6k]
  ------------------
 2080|  2.05k|                  value = std::numeric_limits<std::remove_cvref_t<T>>::quiet_NaN();
 2081|  2.05k|                  it += 3;
 2082|  2.05k|                  finalize();
 2083|  2.05k|                  return;
 2084|  2.05k|               }
 2085|  14.5k|               it = start;
 2086|  14.5k|            }
 2087|       |
 2088|   743k|            if (*it == '-' || *it == '+') {
  ------------------
  |  Branch (2088:17): [True: 51.0k, False: 692k]
  |  Branch (2088:31): [True: 25.7k, False: 667k]
  ------------------
 2089|  76.8k|               const char sign = *it;
 2090|  76.8k|               ++it;
 2091|  76.8k|               if (it != end && *it == '.') {
  ------------------
  |  Branch (2091:20): [True: 76.4k, False: 392]
  |  Branch (2091:33): [True: 51.1k, False: 25.2k]
  ------------------
 2092|  51.1k|                  ++it;
 2093|  51.1k|                  if (it + 3 <= end && (std::string_view(it, 3) == "inf" || std::string_view(it, 3) == "Inf" ||
  ------------------
  |  Branch (2093:23): [True: 50.7k, False: 383]
  |  Branch (2093:41): [True: 41.4k, False: 9.32k]
  |  Branch (2093:77): [True: 861, False: 8.45k]
  ------------------
 2094|  49.1k|                                        std::string_view(it, 3) == "INF")) {
  ------------------
  |  Branch (2094:41): [True: 6.86k, False: 1.59k]
  ------------------
 2095|  49.1k|                     if (sign == '-') {
  ------------------
  |  Branch (2095:26): [True: 48.7k, False: 439]
  ------------------
 2096|  48.7k|                        value = -std::numeric_limits<std::remove_cvref_t<T>>::infinity();
 2097|  48.7k|                     }
 2098|    439|                     else {
 2099|    439|                        value = std::numeric_limits<std::remove_cvref_t<T>>::infinity();
 2100|    439|                     }
 2101|  49.1k|                     it += 3;
 2102|  49.1k|                     finalize();
 2103|  49.1k|                     return;
 2104|  49.1k|                  }
 2105|  51.1k|               }
 2106|  27.6k|               it = start;
 2107|  27.6k|            }
 2108|   743k|         }
 2109|       |
 2110|       |         // Parse as plain scalar and convert
 2111|   694k|         auto start = it;
 2112|       |
 2113|       |         // Find end of number - use same rules as plain scalar for colons
 2114|  21.9M|         while (it != end) {
  ------------------
  |  Branch (2114:17): [True: 21.8M, False: 65.4k]
  ------------------
 2115|  21.8M|            const char c = *it;
 2116|  21.8M|            if (c == ' ' || c == '\t' || c == '\n' || c == '\r' || c == ',' || c == ']' || c == '}' || c == '#') {
  ------------------
  |  Branch (2116:17): [True: 38.1k, False: 21.8M]
  |  Branch (2116:29): [True: 49.2k, False: 21.7M]
  |  Branch (2116:42): [True: 5.13k, False: 21.7M]
  |  Branch (2116:55): [True: 44.9k, False: 21.7M]
  |  Branch (2116:68): [True: 525k, False: 21.1M]
  |  Branch (2116:80): [True: 1.85k, False: 21.1M]
  |  Branch (2116:92): [True: 2.42k, False: 21.1M]
  |  Branch (2116:104): [True: 14.1k, False: 21.1M]
  ------------------
 2117|   681k|               break;
 2118|   681k|            }
 2119|       |            // Colon only ends number if followed by space/tab/newline/end (YAML mapping indicator)
 2120|  21.1M|            if (c == ':') {
  ------------------
  |  Branch (2120:17): [True: 23.1k, False: 21.1M]
  ------------------
 2121|  23.1k|               if ((it + 1) == end || *(it + 1) == ' ' || *(it + 1) == '\t' || *(it + 1) == '\n' || *(it + 1) == '\r') {
  ------------------
  |  Branch (2121:20): [True: 300, False: 22.8k]
  |  Branch (2121:39): [True: 1.62k, False: 21.1k]
  |  Branch (2121:59): [True: 375, False: 20.8k]
  |  Branch (2121:80): [True: 1.22k, False: 19.5k]
  |  Branch (2121:101): [True: 549, False: 19.0k]
  ------------------
 2122|  4.07k|                  break;
 2123|  4.07k|               }
 2124|  23.1k|            }
 2125|  21.1M|            ++it;
 2126|  21.1M|         }
 2127|       |
 2128|   750k|         const std::string_view num_str(&*start, static_cast<size_t>(it - start));
 2129|       |
 2130|   750k|         if (num_str.empty()) {
  ------------------
  |  Branch (2130:14): [True: 666, False: 750k]
  ------------------
 2131|    666|            ctx.error = error_code::parse_number_failure;
 2132|    666|            return;
 2133|    666|         }
 2134|       |
 2135|       |         // Handle hex, octal, binary
 2136|       |         if constexpr (std::integral<std::remove_cvref_t<T>>) {
 2137|       |            if (num_str.size() > 2 && num_str[0] == '0') {
 2138|       |               int base = 10;
 2139|       |               size_t offset = 0;
 2140|       |
 2141|       |               if (num_str[1] == 'x' || num_str[1] == 'X') {
 2142|       |                  base = 16;
 2143|       |                  offset = 2;
 2144|       |               }
 2145|       |               else if (num_str[1] == 'o' || num_str[1] == 'O') {
 2146|       |                  base = 8;
 2147|       |                  offset = 2;
 2148|       |               }
 2149|       |               else if (num_str[1] == 'b' || num_str[1] == 'B') {
 2150|       |                  base = 2;
 2151|       |                  offset = 2;
 2152|       |               }
 2153|       |
 2154|       |               if (base != 10) {
 2155|       |                  const auto digits = num_str.substr(offset);
 2156|       |                  const bool has_underscores = (digits.find('_') != std::string_view::npos);
 2157|       |
 2158|       |                  std::string clean_storage;
 2159|       |                  std::string_view clean_view;
 2160|       |
 2161|       |                  if (has_underscores) {
 2162|       |                     clean_storage.reserve(digits.size());
 2163|       |                     for (char c : digits) {
 2164|       |                        if (c != '_') {
 2165|       |                           clean_storage.push_back(c);
 2166|       |                        }
 2167|       |                     }
 2168|       |                     clean_view = clean_storage;
 2169|       |                  }
 2170|       |                  else {
 2171|       |                     clean_view = digits;
 2172|       |                  }
 2173|       |
 2174|       |                  auto [ptr, ec] =
 2175|       |                     std::from_chars(clean_view.data(), clean_view.data() + clean_view.size(), value, base);
 2176|       |                  if (ec != std::errc{}) {
 2177|       |                     ctx.error = error_code::parse_number_failure;
 2178|       |                  }
 2179|       |                  finalize();
 2180|       |                  return;
 2181|       |               }
 2182|       |            }
 2183|       |         }
 2184|   750k|         else if constexpr (std::floating_point<std::remove_cvref_t<T>>) {
 2185|   750k|            bool negative = false;
 2186|   750k|            std::string_view digits = num_str;
 2187|       |
 2188|   750k|            if (!digits.empty() && (digits.front() == '+' || digits.front() == '-')) {
  ------------------
  |  Branch (2188:17): [True: 694k, False: 56.1k]
  |  Branch (2188:37): [True: 25.2k, False: 668k]
  |  Branch (2188:62): [True: 2.34k, False: 666k]
  ------------------
 2189|  27.6k|               negative = (digits.front() == '-');
 2190|  27.6k|               digits.remove_prefix(1);
 2191|  27.6k|            }
 2192|       |
 2193|   750k|            if (digits.size() > 2 && digits[0] == '0') {
  ------------------
  |  Branch (2193:17): [True: 190k, False: 559k]
  |  Branch (2193:38): [True: 56.7k, False: 133k]
  ------------------
 2194|  56.7k|               int base = 10;
 2195|  56.7k|               size_t offset = 0;
 2196|       |
 2197|  56.7k|               if (digits[1] == 'x' || digits[1] == 'X') {
  ------------------
  |  Branch (2197:20): [True: 3.19k, False: 53.5k]
  |  Branch (2197:40): [True: 302, False: 53.2k]
  ------------------
 2198|  3.50k|                  base = 16;
 2199|  3.50k|                  offset = 2;
 2200|  3.50k|               }
 2201|  53.2k|               else if (digits[1] == 'o' || digits[1] == 'O') {
  ------------------
  |  Branch (2201:25): [True: 1.31k, False: 51.9k]
  |  Branch (2201:45): [True: 1.05k, False: 50.9k]
  ------------------
 2202|  2.36k|                  base = 8;
 2203|  2.36k|                  offset = 2;
 2204|  2.36k|               }
 2205|  50.9k|               else if (digits[1] == 'b' || digits[1] == 'B') {
  ------------------
  |  Branch (2205:25): [True: 453, False: 50.4k]
  |  Branch (2205:45): [True: 254, False: 50.1k]
  ------------------
 2206|    707|                  base = 2;
 2207|    707|                  offset = 2;
 2208|    707|               }
 2209|       |
 2210|  56.7k|               if (base != 10) {
  ------------------
  |  Branch (2210:20): [True: 6.57k, False: 50.1k]
  ------------------
 2211|  6.57k|                  auto raw_digits = digits.substr(offset);
 2212|  6.57k|                  const bool has_underscores = (raw_digits.find('_') != std::string_view::npos);
 2213|       |
 2214|  6.57k|                  std::string clean_storage;
 2215|  6.57k|                  std::string_view clean_view;
 2216|  6.57k|                  if (has_underscores) {
  ------------------
  |  Branch (2216:23): [True: 2.02k, False: 4.55k]
  ------------------
 2217|  2.02k|                     clean_storage.reserve(raw_digits.size());
 2218|  2.02M|                     for (char c : raw_digits) {
  ------------------
  |  Branch (2218:34): [True: 2.02M, False: 2.02k]
  ------------------
 2219|  2.02M|                        if (c != '_') {
  ------------------
  |  Branch (2219:29): [True: 2.02M, False: 4.26k]
  ------------------
 2220|  2.02M|                           clean_storage.push_back(c);
 2221|  2.02M|                        }
 2222|  2.02M|                     }
 2223|  2.02k|                     clean_view = clean_storage;
 2224|  2.02k|                  }
 2225|  4.55k|                  else {
 2226|  4.55k|                     clean_view = raw_digits;
 2227|  4.55k|                  }
 2228|       |
 2229|  6.57k|                  uint64_t parsed_int{};
 2230|  6.57k|                  auto [ptr, ec] =
 2231|  6.57k|                     std::from_chars(clean_view.data(), clean_view.data() + clean_view.size(), parsed_int, base);
 2232|  6.57k|                  if (ec != std::errc{} || ptr != (clean_view.data() + clean_view.size())) {
  ------------------
  |  Branch (2232:23): [True: 2.22k, False: 4.35k]
  |  Branch (2232:44): [True: 2.69k, False: 1.65k]
  ------------------
 2233|  4.92k|                     ctx.error = error_code::parse_number_failure;
 2234|  4.92k|                     finalize();
 2235|  4.92k|                     return;
 2236|  4.92k|                  }
 2237|       |
 2238|  1.65k|                  const auto as_float = static_cast<std::remove_cvref_t<T>>(parsed_int);
 2239|  1.65k|                  value = negative ? -as_float : as_float;
  ------------------
  |  Branch (2239:27): [True: 384, False: 1.27k]
  ------------------
 2240|  1.65k|                  finalize();
 2241|  1.65k|                  return;
 2242|  6.57k|               }
 2243|  56.7k|            }
 2244|   750k|         }
 2245|       |
 2246|       |         // Standard number parsing - only allocate if underscores present
 2247|   743k|         const bool has_underscores = (num_str.find('_') != std::string_view::npos);
 2248|       |
 2249|   750k|         std::string clean_storage;
 2250|   750k|         std::string_view clean_view;
 2251|       |
 2252|   750k|         if (has_underscores) {
  ------------------
  |  Branch (2252:14): [True: 2.46k, False: 747k]
  ------------------
 2253|  2.46k|            clean_storage.reserve(num_str.size());
 2254|  9.51M|            for (char c : num_str) {
  ------------------
  |  Branch (2254:25): [True: 9.51M, False: 2.46k]
  ------------------
 2255|  9.51M|               if (c != '_') {
  ------------------
  |  Branch (2255:20): [True: 9.50M, False: 8.43k]
  ------------------
 2256|  9.50M|                  clean_storage.push_back(c);
 2257|  9.50M|               }
 2258|  9.51M|            }
 2259|  2.46k|            clean_view = clean_storage;
 2260|  2.46k|         }
 2261|   747k|         else {
 2262|   747k|            clean_view = num_str;
 2263|   747k|         }
 2264|       |
 2265|       |         // YAML allows leading '+' for positive numbers, but C++ from_chars doesn't
 2266|       |         // Strip leading '+' if present
 2267|   750k|         auto parse_view = clean_view;
 2268|   750k|         if (!parse_view.empty() && parse_view.front() == '+') {
  ------------------
  |  Branch (2268:14): [True: 687k, False: 62.7k]
  |  Branch (2268:37): [True: 25.2k, False: 662k]
  ------------------
 2269|  25.2k|            parse_view.remove_prefix(1);
 2270|  25.2k|            if (parse_view.empty()) {
  ------------------
  |  Branch (2270:17): [True: 6.31k, False: 18.9k]
  ------------------
 2271|  6.31k|               ctx.error = error_code::parse_number_failure;
 2272|  6.31k|               return;
 2273|  6.31k|            }
 2274|  25.2k|         }
 2275|       |
 2276|   743k|         if constexpr (std::floating_point<std::remove_cvref_t<T>>) {
 2277|   743k|            auto result = glz::fast_float::from_chars(parse_view.data(), parse_view.data() + parse_view.size(), value);
 2278|       |            // Check both for errors and that all input was consumed (e.g., "12:30" is not a valid number)
 2279|   743k|            if (result.ec != std::errc{} || result.ptr != parse_view.data() + parse_view.size()) {
  ------------------
  |  Branch (2279:17): [True: 94.0k, False: 649k]
  |  Branch (2279:45): [True: 62.8k, False: 586k]
  ------------------
 2280|  94.1k|               ctx.error = error_code::parse_number_failure;
 2281|  94.1k|            }
 2282|       |         }
 2283|       |         else {
 2284|       |            auto [ptr, ec] = std::from_chars(parse_view.data(), parse_view.data() + parse_view.size(), value);
 2285|       |            // Check both for errors and that all input was consumed
 2286|       |            if (ec != std::errc{} || ptr != parse_view.data() + parse_view.size()) {
 2287|       |               ctx.error = error_code::parse_number_failure;
 2288|       |            }
 2289|       |         }
 2290|       |
 2291|   743k|         finalize();
 2292|   743k|      }
_ZN3glz4yaml19parse_node_preambleITnDaXtlNS0_9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj33EEEXtlNS0_20node_property_policyELb1EEELb0ERdNS0_12yaml_contextEPKcS7_ZNS_4fromILj450EdE2opITnDaXtlS2_Lj450ELb1ELb0ELb1ELh2ELb0ELj33EEERS7_S4_TkNS_10is_contextERS5_S7_EEvOT1_OT2_OT0_T3_EUlNS0_8yaml_tagEE_EEbSG_RSJ_RT4_T5_RNS0_19node_preamble_stateEOT6_:
  465|   756k|      {
  466|   756k|         skip_inline_ws(it, end);
  467|       |
  468|   756k|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (468:14): [True: 232, False: 756k]
  ------------------
  469|    232|            if constexpr (!AllowEmptyInput) {
  470|    232|               ctx.error = error_code::unexpected_end;
  471|    232|            }
  472|    232|            return true;
  473|    232|         }
  474|       |
  475|   756k|         preamble.tag = parse_yaml_tag(it, end, ctx);
  476|   756k|         if (preamble.tag == yaml_tag::unknown) [[unlikely]] {
  ------------------
  |  Branch (476:14): [True: 131, False: 756k]
  ------------------
  477|    131|            ctx.error = error_code::syntax_error;
  478|    131|            return true;
  479|    131|         }
  480|   756k|         if (!tag_validator(preamble.tag)) [[unlikely]] {
  ------------------
  |  Branch (480:14): [True: 133, False: 756k]
  ------------------
  481|    133|            ctx.error = error_code::syntax_error;
  482|    133|            return true;
  483|    133|         }
  484|       |
  485|   756k|         skip_inline_ws(it, end);
  486|       |
  487|   756k|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (487:14): [True: 89, False: 756k]
  ------------------
  488|     89|            if constexpr (!AllowEmptyInput) {
  489|     89|               ctx.error = error_code::unexpected_end;
  490|     89|            }
  491|     89|            return true;
  492|     89|         }
  493|       |
  494|   756k|         if (parse_node_properties<Opts, PropertyPolicy>(std::forward<T>(value), ctx, it, end, preamble.node_props)) {
  ------------------
  |  Branch (494:14): [True: 5.49k, False: 750k]
  ------------------
  495|  5.49k|            return true;
  496|  5.49k|         }
  497|       |
  498|   750k|         return false;
  499|   756k|      }
_ZZN3glz4fromILj450EdE2opITnDaXtlNS_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj33EEERPKcRdTkNS_10is_contextERNS3_12yaml_contextES6_EEvOT1_OT2_OT0_T3_ENKUlNS3_8yaml_tagEE_clESI_:
 2052|   756k|         if (yaml::parse_node_preamble<Opts>(value, ctx, it, end, preamble, [](yaml::yaml_tag tag) {
 2053|   756k|                if constexpr (std::floating_point<std::remove_cvref_t<T>>) {
 2054|   756k|                   return yaml::tag_valid_for_float(tag);
 2055|       |                }
 2056|       |                else {
 2057|       |                   return yaml::tag_valid_for_int(tag);
 2058|       |                }
 2059|   756k|             }))
_ZN3glz4yaml21parse_node_propertiesITnDaXtlNS0_9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj33EEEXtlNS0_20node_property_policyELb1EEERdNS0_12yaml_contextEPKcS7_EEbOT1_RT2_RT3_T4_RNS0_19node_property_stateE:
  408|   756k|      {
  409|   756k|         state.has_anchor = false;
  410|   756k|         state.anchor_name.clear();
  411|   756k|         state.anchor_start = nullptr;
  412|   756k|         state.anchor_indent = ctx.current_indent();
  413|       |
  414|   756k|         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|   756k|            else {
  421|   756k|               if (handle_alias<Opts>(std::forward<T>(value), ctx, it, end)) return true;
  ------------------
  |  Branch (421:20): [True: 5.15k, False: 751k]
  ------------------
  422|   756k|            }
  423|   756k|         }
  424|       |
  425|   756k|         if (it != end && *it == '&') {
  ------------------
  |  Branch (425:14): [True: 751k, False: 5.15k]
  |  Branch (425:27): [True: 6.21k, False: 744k]
  ------------------
  426|  6.21k|            ++it;
  427|  6.21k|            auto name = parse_anchor_name(it, end);
  428|  6.21k|            if (name.empty()) {
  ------------------
  |  Branch (428:17): [True: 184, False: 6.03k]
  ------------------
  429|    184|               ctx.error = error_code::syntax_error;
  430|    184|               return true;
  431|    184|            }
  432|  6.03k|            skip_inline_ws(it, end);
  433|  6.03k|            if (it == end) {
  ------------------
  |  Branch (433:17): [True: 155, False: 5.87k]
  ------------------
  434|    155|               if constexpr (!Policy.allow_empty_after_anchor) {
  435|    155|                  ctx.error = error_code::unexpected_end;
  436|    155|               }
  437|    155|               return true;
  438|    155|            }
  439|       |            if constexpr (Policy.disallow_anchor_on_alias) {
  440|       |               if (*it == '*') {
  441|       |                  ctx.error = error_code::syntax_error;
  442|       |                  return true;
  443|       |               }
  444|       |            }
  445|  5.87k|            state.has_anchor = true;
  446|  5.87k|            state.anchor_name = std::string(name);
  447|  5.87k|            state.anchor_start = &*it;
  448|  5.87k|         }
  449|       |
  450|   755k|         return false;
  451|   756k|      }
_ZN3glz4yaml12handle_aliasITnDaXtlNS0_9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj33EEERdNS0_12yaml_contextEPKcS6_EEbOT0_RT1_RT2_T3_:
  300|   756k|      {
  301|   756k|         if (it == end || *it != '*') return false;
  ------------------
  |  Branch (301:14): [True: 0, False: 756k]
  |  Branch (301:27): [True: 751k, False: 5.15k]
  ------------------
  302|       |
  303|  5.15k|         ++it; // skip '*'
  304|  5.15k|         auto name = parse_anchor_name(it, end);
  305|  5.15k|         if (name.empty()) {
  ------------------
  |  Branch (305:14): [True: 128, False: 5.02k]
  ------------------
  306|    128|            ctx.error = error_code::syntax_error;
  307|    128|            return true;
  308|    128|         }
  309|       |
  310|  5.02k|         auto anchor_it = ctx.anchors.find(name);
  311|  5.02k|         if (anchor_it == ctx.anchors.end()) {
  ------------------
  |  Branch (311:14): [True: 431, False: 4.59k]
  ------------------
  312|    431|            ctx.error = error_code::syntax_error; // undefined alias
  313|    431|            return true;
  314|    431|         }
  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.59k|         const auto span = anchor_it->second;
  319|       |
  320|       |         // Empty anchor span (anchor on null/empty node) — leave value as default
  321|  4.59k|         if (span.begin == span.end) {
  ------------------
  |  Branch (321:14): [True: 600, False: 3.99k]
  ------------------
  322|    600|            return true;
  323|    600|         }
  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.99k|         if (ctx.alias_span_is_replaying(span.begin, span.end)) [[unlikely]] {
  ------------------
  |  Branch (328:14): [True: 4, False: 3.99k]
  ------------------
  329|      4|            ctx.error = error_code::syntax_error; // cyclic alias
  330|      4|            return true;
  331|      4|         }
  332|       |
  333|       |         // Replaying an anchor re-enters the reader directly, bypassing the variant reader's
  334|       |         // depth guard, so this is the only depth accounting a chain of aliases into a
  335|       |         // non-variant target gets. The cycle check above stops the unbounded case; this bounds
  336|       |         // a legitimate but deeply chained one.
  337|  3.99k|         depth_guard guard{ctx, yaml::max_yaml_recursive_depth};
  338|  3.99k|         if (!guard) [[unlikely]]
  ------------------
  |  Branch (338:14): [True: 1, False: 3.98k]
  ------------------
  339|      1|            return true;
  340|       |
  341|  3.98k|         if (!ctx.charge_alias_expansion(static_cast<size_t>(span.end - span.begin))) [[unlikely]] {
  ------------------
  |  Branch (341:14): [True: 0, False: 3.98k]
  ------------------
  342|      0|            ctx.error = error_code::exceeded_max_expansion;
  343|      0|            ctx.custom_error_message = "alias expansion";
  344|      0|            return true;
  345|      0|         }
  346|       |
  347|  3.98k|         auto replay_it = span.begin;
  348|  3.98k|         auto replay_end = span.end;
  349|       |
  350|       |         // Save indent context and set up for replay
  351|  3.98k|         auto saved_indent_stack = std::move(ctx.indent_stack);
  352|  3.98k|         ctx.indent_stack.clear();
  353|  3.98k|         if (span.base_indent > 0) {
  ------------------
  |  Branch (353:14): [True: 2.41k, False: 1.57k]
  ------------------
  354|  2.41k|            ctx.push_indent(span.base_indent - 1);
  355|  2.41k|         }
  356|       |
  357|  3.98k|         ctx.active_alias_spans.emplace_back(span.begin, span.end);
  358|       |
  359|  3.98k|         using V = std::remove_cvref_t<T>;
  360|  3.98k|         from<YAML, V>::template op<Opts>(std::forward<T>(value), ctx, replay_it, replay_end);
  361|       |
  362|  3.98k|         ctx.active_alias_spans.pop_back();
  363|       |
  364|       |         // Restore indent context
  365|  3.98k|         ctx.indent_stack = std::move(saved_indent_stack);
  366|  3.98k|         return true;
  367|  3.98k|      }
_ZZN3glz4fromILj450EdE2opITnDaXtlNS_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj33EEERPKcRdTkNS_10is_contextERNS3_12yaml_contextES6_EEvOT1_OT2_OT0_T3_ENKUlvE_clEv:
 2062|   743k|         auto finalize = [&] { yaml::finalize_node_anchor(preamble.node_props, ctx, it); };
_ZN3glz33process_yaml_variant_alternativesINSt3__17variantIJDndNS1_12basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEbNS1_6vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS6_ISD_EEEENSC_ISD_EEEEENS_20is_yaml_variant_boolEE2opITnDaXtlNS_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj33EEERSH_TkNS_10is_contextERNSL_12yaml_contextERPKcSR_EEvOT0_OT1_OT2_T3_:
 5205|  28.7k|      {
 5206|  28.7k|         constexpr auto category_count = yaml_variant_count_v<Variant, Trait>;
 5207|       |
 5208|       |         if constexpr (category_count == 0) {
 5209|       |            ctx.error = error_code::no_matching_variant_type;
 5210|       |         }
 5211|  28.7k|         else if constexpr (category_count == 1) {
 5212|       |            // Only one type in this category, use it directly
 5213|  28.7k|            constexpr auto first_idx = yaml_variant_first_index_v<Variant, Trait>;
 5214|  28.7k|            using V = std::variant_alternative_t<first_idx, Variant>;
 5215|  28.7k|            if (!std::holds_alternative<V>(value)) value = V{};
  ------------------
  |  Branch (5215:17): [True: 28.7k, False: 0]
  ------------------
 5216|  28.7k|            from<YAML, V>::template op<Opts>(std::get<V>(value), ctx, it, end);
 5217|       |         }
 5218|       |         else {
 5219|       |            // Multiple types in this category, try each one
 5220|       |            constexpr auto N = std::variant_size_v<Variant>;
 5221|       |            bool found_match{};
 5222|       |            size_t match_idx = 0;
 5223|       |            // Only the last alternative propagates its error, so an alternative that exhausted an
 5224|       |            // expansion budget would otherwise be reported as no_matching_variant_type -- a wrong
 5225|       |            // diagnosis for a document that is hostile rather than merely the wrong shape. Held
 5226|       |            // aside and used only if nothing matched, so an alternative that does succeed later
 5227|       |            // (one that materializes no key text can still parse under a latched budget) is
 5228|       |            // unaffected.
 5229|       |            error_code expansion_error{};
 5230|       |            std::string_view expansion_message{};
 5231|       |
 5232|       |            for_each<N>([&]<size_t I>() {
 5233|       |               if (found_match) {
 5234|       |                  return;
 5235|       |               }
 5236|       |               using V = std::variant_alternative_t<I, Variant>;
 5237|       |               if constexpr (Trait<V>::value) {
 5238|       |                  auto copy_it = it;
 5239|       |                  if (!std::holds_alternative<V>(value)) {
 5240|       |                     value = V{};
 5241|       |                  }
 5242|       |
 5243|       |                  auto temp_ctx = ctx.make_speculative();
 5244|       |                  from<YAML, V>::template op<Opts>(std::get<V>(value), temp_ctx, it, end);
 5245|       |
 5246|       |                  // Charged whether or not the alternative fit: a rejected probe still replayed
 5247|       |                  // whatever aliases it reached, and an attempt that is never billed is an
 5248|       |                  // attempt that can be repeated for free.
 5249|       |                  ctx.alias_expansion_budget = temp_ctx.alias_expansion_budget;
 5250|       |                  ctx.key_expansion_budget = temp_ctx.key_expansion_budget;
 5251|       |
 5252|       |                  if (!bool(temp_ctx.error)) {
 5253|       |                     found_match = true;
 5254|       |                     ctx.anchors = std::move(temp_ctx.anchors);
 5255|       |                  }
 5256|       |                  else {
 5257|       |                     it = copy_it;
 5258|       |                     if (temp_ctx.error == error_code::exceeded_max_expansion && expansion_error == error_code::none) {
 5259|       |                        expansion_error = temp_ctx.error;
 5260|       |                        expansion_message = temp_ctx.custom_error_message;
 5261|       |                     }
 5262|       |                     if (match_idx + 1 < category_count) {
 5263|       |                        // Not the last type, continue trying
 5264|       |                     }
 5265|       |                     else {
 5266|       |                        // Last type failed, propagate error
 5267|       |                        ctx.error = temp_ctx.error;
 5268|       |                        ctx.custom_error_message = temp_ctx.custom_error_message;
 5269|       |                     }
 5270|       |                  }
 5271|       |                  ++match_idx;
 5272|       |               }
 5273|       |            });
 5274|       |
 5275|       |            if (!found_match && !bool(ctx.error)) {
 5276|       |               if (expansion_error != error_code::none) {
 5277|       |                  ctx.error = expansion_error;
 5278|       |                  ctx.custom_error_message = expansion_message;
 5279|       |               }
 5280|       |               else {
 5281|       |                  ctx.error = error_code::no_matching_variant_type;
 5282|       |               }
 5283|       |            }
 5284|       |         }
 5285|  28.7k|      }
_ZN3glz4fromILj450EbE2opITnDaXtlNS_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj33EEERPKcRbTkNS_10is_contextERNS3_12yaml_contextES6_EEvOT1_OT2_OT0_T3_:
 2012|  38.2k|      {
 2013|  38.2k|         if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2013:14): [True: 0, False: 38.2k]
  ------------------
 2014|      0|            return;
 2015|       |
 2016|  38.2k|         yaml::node_preamble_state preamble{};
 2017|  38.2k|         if (yaml::parse_node_preamble<Opts>(value, ctx, it, end, preamble,
  ------------------
  |  Branch (2017:14): [True: 10.2k, False: 28.0k]
  ------------------
 2018|  38.2k|                                             [](yaml::yaml_tag tag) { return yaml::tag_valid_for_bool(tag); }))
 2019|  10.2k|            return;
 2020|       |
 2021|       |         // Parse as plain scalar first
 2022|  28.0k|         std::string str;
 2023|  28.0k|         yaml::parse_plain_scalar(str, ctx, it, end, yaml::check_flow_context(Opts));
 2024|       |
 2025|  28.0k|         if (str == "true" || str == "True" || str == "TRUE" || str == "yes" || str == "Yes" || str == "YES" ||
  ------------------
  |  Branch (2025:14): [True: 3.01k, False: 25.0k]
  |  Branch (2025:31): [True: 753, False: 24.2k]
  |  Branch (2025:48): [True: 756, False: 23.5k]
  |  Branch (2025:65): [True: 401, False: 23.1k]
  |  Branch (2025:81): [True: 2.25k, False: 20.8k]
  |  Branch (2025:97): [True: 1.10k, False: 19.7k]
  ------------------
 2026|  19.7k|             str == "on" || str == "On" || str == "ON") {
  ------------------
  |  Branch (2026:14): [True: 1.05k, False: 18.7k]
  |  Branch (2026:29): [True: 302, False: 18.4k]
  |  Branch (2026:44): [True: 445, False: 17.9k]
  ------------------
 2027|  10.0k|            value = true;
 2028|  10.0k|         }
 2029|  17.9k|         else if (str == "false" || str == "False" || str == "FALSE" || str == "no" || str == "No" || str == "NO" ||
  ------------------
  |  Branch (2029:19): [True: 11.6k, False: 6.26k]
  |  Branch (2029:37): [True: 341, False: 5.92k]
  |  Branch (2029:55): [True: 3.10k, False: 2.81k]
  |  Branch (2029:73): [True: 428, False: 2.39k]
  |  Branch (2029:88): [True: 461, False: 1.93k]
  |  Branch (2029:103): [True: 659, False: 1.27k]
  ------------------
 2030|  17.7k|                  str == "off" || str == "Off" || str == "OFF") {
  ------------------
  |  Branch (2030:19): [True: 452, False: 819]
  |  Branch (2030:35): [True: 362, False: 457]
  |  Branch (2030:51): [True: 293, False: 164]
  ------------------
 2031|  17.7k|            value = false;
 2032|  17.7k|         }
 2033|    164|         else {
 2034|    164|            ctx.error = error_code::expected_true_or_false;
 2035|    164|         }
 2036|       |
 2037|  28.0k|         yaml::finalize_node_anchor(preamble.node_props, ctx, it);
 2038|  28.0k|      }
_ZN3glz4yaml19parse_node_preambleITnDaXtlNS0_9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj33EEEXtlNS0_20node_property_policyELb1EEELb0ERbNS0_12yaml_contextEPKcS7_ZNS_4fromILj450EbE2opITnDaXtlS2_Lj450ELb1ELb0ELb1ELh2ELb0ELj33EEERS7_S4_TkNS_10is_contextERS5_S7_EEvOT1_OT2_OT0_T3_EUlNS0_8yaml_tagEE_EEbSG_RSJ_RT4_T5_RNS0_19node_preamble_stateEOT6_:
  465|  38.2k|      {
  466|  38.2k|         skip_inline_ws(it, end);
  467|       |
  468|  38.2k|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (468:14): [True: 1, False: 38.2k]
  ------------------
  469|      1|            if constexpr (!AllowEmptyInput) {
  470|      1|               ctx.error = error_code::unexpected_end;
  471|      1|            }
  472|      1|            return true;
  473|      1|         }
  474|       |
  475|  38.2k|         preamble.tag = parse_yaml_tag(it, end, ctx);
  476|  38.2k|         if (preamble.tag == yaml_tag::unknown) [[unlikely]] {
  ------------------
  |  Branch (476:14): [True: 2, False: 38.2k]
  ------------------
  477|      2|            ctx.error = error_code::syntax_error;
  478|      2|            return true;
  479|      2|         }
  480|  38.2k|         if (!tag_validator(preamble.tag)) [[unlikely]] {
  ------------------
  |  Branch (480:14): [True: 1, False: 38.2k]
  ------------------
  481|      1|            ctx.error = error_code::syntax_error;
  482|      1|            return true;
  483|      1|         }
  484|       |
  485|  38.2k|         skip_inline_ws(it, end);
  486|       |
  487|  38.2k|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (487:14): [True: 2, False: 38.2k]
  ------------------
  488|      2|            if constexpr (!AllowEmptyInput) {
  489|      2|               ctx.error = error_code::unexpected_end;
  490|      2|            }
  491|      2|            return true;
  492|      2|         }
  493|       |
  494|  38.2k|         if (parse_node_properties<Opts, PropertyPolicy>(std::forward<T>(value), ctx, it, end, preamble.node_props)) {
  ------------------
  |  Branch (494:14): [True: 10.2k, False: 28.0k]
  ------------------
  495|  10.2k|            return true;
  496|  10.2k|         }
  497|       |
  498|  28.0k|         return false;
  499|  38.2k|      }
_ZZN3glz4fromILj450EbE2opITnDaXtlNS_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj33EEERPKcRbTkNS_10is_contextERNS3_12yaml_contextES6_EEvOT1_OT2_OT0_T3_ENKUlNS3_8yaml_tagEE_clESI_:
 2018|  38.2k|                                             [](yaml::yaml_tag tag) { return yaml::tag_valid_for_bool(tag); }))
_ZN3glz4yaml21parse_node_propertiesITnDaXtlNS0_9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj33EEEXtlNS0_20node_property_policyELb1EEERbNS0_12yaml_contextEPKcS7_EEbOT1_RT2_RT3_T4_RNS0_19node_property_stateE:
  408|  38.2k|      {
  409|  38.2k|         state.has_anchor = false;
  410|  38.2k|         state.anchor_name.clear();
  411|  38.2k|         state.anchor_start = nullptr;
  412|  38.2k|         state.anchor_indent = ctx.current_indent();
  413|       |
  414|  38.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|  38.2k|            else {
  421|  38.2k|               if (handle_alias<Opts>(std::forward<T>(value), ctx, it, end)) return true;
  ------------------
  |  Branch (421:20): [True: 10.2k, False: 28.0k]
  ------------------
  422|  38.2k|            }
  423|  38.2k|         }
  424|       |
  425|  38.2k|         if (it != end && *it == '&') {
  ------------------
  |  Branch (425:14): [True: 28.0k, False: 10.2k]
  |  Branch (425:27): [True: 7.86k, False: 20.2k]
  ------------------
  426|  7.86k|            ++it;
  427|  7.86k|            auto name = parse_anchor_name(it, end);
  428|  7.86k|            if (name.empty()) {
  ------------------
  |  Branch (428:17): [True: 2, False: 7.85k]
  ------------------
  429|      2|               ctx.error = error_code::syntax_error;
  430|      2|               return true;
  431|      2|            }
  432|  7.85k|            skip_inline_ws(it, end);
  433|  7.85k|            if (it == end) {
  ------------------
  |  Branch (433:17): [True: 11, False: 7.84k]
  ------------------
  434|     11|               if constexpr (!Policy.allow_empty_after_anchor) {
  435|     11|                  ctx.error = error_code::unexpected_end;
  436|     11|               }
  437|     11|               return true;
  438|     11|            }
  439|       |            if constexpr (Policy.disallow_anchor_on_alias) {
  440|       |               if (*it == '*') {
  441|       |                  ctx.error = error_code::syntax_error;
  442|       |                  return true;
  443|       |               }
  444|       |            }
  445|  7.84k|            state.has_anchor = true;
  446|  7.84k|            state.anchor_name = std::string(name);
  447|  7.84k|            state.anchor_start = &*it;
  448|  7.84k|         }
  449|       |
  450|  38.2k|         return false;
  451|  38.2k|      }
_ZN3glz4yaml12handle_aliasITnDaXtlNS0_9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj33EEERbNS0_12yaml_contextEPKcS6_EEbOT0_RT1_RT2_T3_:
  300|  38.2k|      {
  301|  38.2k|         if (it == end || *it != '*') return false;
  ------------------
  |  Branch (301:14): [True: 0, False: 38.2k]
  |  Branch (301:27): [True: 28.0k, 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: 5, False: 10.2k]
  ------------------
  306|      5|            ctx.error = error_code::syntax_error;
  307|      5|            return true;
  308|      5|         }
  309|       |
  310|  10.2k|         auto anchor_it = ctx.anchors.find(name);
  311|  10.2k|         if (anchor_it == ctx.anchors.end()) {
  ------------------
  |  Branch (311:14): [True: 32, False: 10.1k]
  ------------------
  312|     32|            ctx.error = error_code::syntax_error; // undefined alias
  313|     32|            return true;
  314|     32|         }
  315|       |
  316|       |         // Copied rather than referenced: the replay below can replace ctx.anchors wholesale
  317|       |         // (a speculative parse hands its own map back), which would dangle a reference here.
  318|  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: 600, False: 9.57k]
  ------------------
  322|    600|            return true;
  323|    600|         }
  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.57k|         if (ctx.alias_span_is_replaying(span.begin, span.end)) [[unlikely]] {
  ------------------
  |  Branch (328:14): [True: 4, False: 9.57k]
  ------------------
  329|      4|            ctx.error = error_code::syntax_error; // cyclic alias
  330|      4|            return true;
  331|      4|         }
  332|       |
  333|       |         // Replaying an anchor re-enters the reader directly, bypassing the variant reader's
  334|       |         // depth guard, so this is the only depth accounting a chain of aliases into a
  335|       |         // non-variant target gets. The cycle check above stops the unbounded case; this bounds
  336|       |         // a legitimate but deeply chained one.
  337|  9.57k|         depth_guard guard{ctx, yaml::max_yaml_recursive_depth};
  338|  9.57k|         if (!guard) [[unlikely]]
  ------------------
  |  Branch (338:14): [True: 0, False: 9.57k]
  ------------------
  339|      0|            return true;
  340|       |
  341|  9.57k|         if (!ctx.charge_alias_expansion(static_cast<size_t>(span.end - span.begin))) [[unlikely]] {
  ------------------
  |  Branch (341:14): [True: 0, False: 9.57k]
  ------------------
  342|      0|            ctx.error = error_code::exceeded_max_expansion;
  343|      0|            ctx.custom_error_message = "alias expansion";
  344|      0|            return true;
  345|      0|         }
  346|       |
  347|  9.57k|         auto replay_it = span.begin;
  348|  9.57k|         auto replay_end = span.end;
  349|       |
  350|       |         // Save indent context and set up for replay
  351|  9.57k|         auto saved_indent_stack = std::move(ctx.indent_stack);
  352|  9.57k|         ctx.indent_stack.clear();
  353|  9.57k|         if (span.base_indent > 0) {
  ------------------
  |  Branch (353:14): [True: 330, False: 9.24k]
  ------------------
  354|    330|            ctx.push_indent(span.base_indent - 1);
  355|    330|         }
  356|       |
  357|  9.57k|         ctx.active_alias_spans.emplace_back(span.begin, span.end);
  358|       |
  359|  9.57k|         using V = std::remove_cvref_t<T>;
  360|  9.57k|         from<YAML, V>::template op<Opts>(std::forward<T>(value), ctx, replay_it, replay_end);
  361|       |
  362|  9.57k|         ctx.active_alias_spans.pop_back();
  363|       |
  364|       |         // Restore indent context
  365|  9.57k|         ctx.indent_stack = std::move(saved_indent_stack);
  366|  9.57k|         return true;
  367|  9.57k|      }
_ZN3glz4fromILj450EDnE2opITnDaXtlNS_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj33EEERPKcRDnTkNS_10is_contextERNS3_12yaml_contextES6_EEvOT1_OT2_OT0_T3_:
 2398|  12.5k|      {
 2399|  12.5k|         if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2399:14): [True: 0, False: 12.5k]
  ------------------
 2400|      0|            return;
 2401|       |
 2402|  12.5k|         yaml::skip_inline_ws(it, end);
 2403|       |
 2404|  12.5k|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (2404:14): [True: 1, False: 12.5k]
  ------------------
 2405|      1|            ctx.error = error_code::unexpected_end;
 2406|      1|            return;
 2407|      1|         }
 2408|       |
 2409|       |         // Check for null values: null, Null, NULL, ~
 2410|  12.5k|         if (*it == '~') {
  ------------------
  |  Branch (2410:14): [True: 1.36k, False: 11.1k]
  ------------------
 2411|  1.36k|            ++it;
 2412|  1.36k|            return;
 2413|  1.36k|         }
 2414|       |
 2415|       |         // Parse as plain scalar and check if it's a null keyword
 2416|  11.1k|         auto start = it;
 2417|   100k|         while (it != end && !yaml::plain_scalar_end_table[static_cast<uint8_t>(*it)]) {
  ------------------
  |  Branch (2417:17): [True: 100k, False: 353]
  |  Branch (2417:30): [True: 89.3k, False: 10.7k]
  ------------------
 2418|  89.3k|            ++it;
 2419|  89.3k|         }
 2420|       |
 2421|  11.1k|         std::string_view str{start, static_cast<size_t>(it - start)};
 2422|  11.1k|         if (!yaml::is_yaml_null(str)) {
  ------------------
  |  Branch (2422:14): [True: 45, False: 11.1k]
  ------------------
 2423|     45|            ctx.error = error_code::syntax_error;
 2424|     45|         }
 2425|  11.1k|      }
_ZN3glz33process_yaml_variant_alternativesINSt3__17variantIJDndNS1_12basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEbNS1_6vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS6_ISD_EEEENSC_ISD_EEEEENS_22is_yaml_variant_objectEE2opITnDaXtlNS_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj33EEERSH_TkNS_10is_contextERNSL_12yaml_contextERPKcSR_EEvOT0_OT1_OT2_T3_:
 5205|  1.19M|      {
 5206|  1.19M|         constexpr auto category_count = yaml_variant_count_v<Variant, Trait>;
 5207|       |
 5208|       |         if constexpr (category_count == 0) {
 5209|       |            ctx.error = error_code::no_matching_variant_type;
 5210|       |         }
 5211|  1.19M|         else if constexpr (category_count == 1) {
 5212|       |            // Only one type in this category, use it directly
 5213|  1.19M|            constexpr auto first_idx = yaml_variant_first_index_v<Variant, Trait>;
 5214|  1.19M|            using V = std::variant_alternative_t<first_idx, Variant>;
 5215|  1.19M|            if (!std::holds_alternative<V>(value)) value = V{};
  ------------------
  |  Branch (5215:17): [True: 1.19M, False: 0]
  ------------------
 5216|  1.19M|            from<YAML, V>::template op<Opts>(std::get<V>(value), ctx, it, end);
 5217|       |         }
 5218|       |         else {
 5219|       |            // Multiple types in this category, try each one
 5220|       |            constexpr auto N = std::variant_size_v<Variant>;
 5221|       |            bool found_match{};
 5222|       |            size_t match_idx = 0;
 5223|       |            // Only the last alternative propagates its error, so an alternative that exhausted an
 5224|       |            // expansion budget would otherwise be reported as no_matching_variant_type -- a wrong
 5225|       |            // diagnosis for a document that is hostile rather than merely the wrong shape. Held
 5226|       |            // aside and used only if nothing matched, so an alternative that does succeed later
 5227|       |            // (one that materializes no key text can still parse under a latched budget) is
 5228|       |            // unaffected.
 5229|       |            error_code expansion_error{};
 5230|       |            std::string_view expansion_message{};
 5231|       |
 5232|       |            for_each<N>([&]<size_t I>() {
 5233|       |               if (found_match) {
 5234|       |                  return;
 5235|       |               }
 5236|       |               using V = std::variant_alternative_t<I, Variant>;
 5237|       |               if constexpr (Trait<V>::value) {
 5238|       |                  auto copy_it = it;
 5239|       |                  if (!std::holds_alternative<V>(value)) {
 5240|       |                     value = V{};
 5241|       |                  }
 5242|       |
 5243|       |                  auto temp_ctx = ctx.make_speculative();
 5244|       |                  from<YAML, V>::template op<Opts>(std::get<V>(value), temp_ctx, it, end);
 5245|       |
 5246|       |                  // Charged whether or not the alternative fit: a rejected probe still replayed
 5247|       |                  // whatever aliases it reached, and an attempt that is never billed is an
 5248|       |                  // attempt that can be repeated for free.
 5249|       |                  ctx.alias_expansion_budget = temp_ctx.alias_expansion_budget;
 5250|       |                  ctx.key_expansion_budget = temp_ctx.key_expansion_budget;
 5251|       |
 5252|       |                  if (!bool(temp_ctx.error)) {
 5253|       |                     found_match = true;
 5254|       |                     ctx.anchors = std::move(temp_ctx.anchors);
 5255|       |                  }
 5256|       |                  else {
 5257|       |                     it = copy_it;
 5258|       |                     if (temp_ctx.error == error_code::exceeded_max_expansion && expansion_error == error_code::none) {
 5259|       |                        expansion_error = temp_ctx.error;
 5260|       |                        expansion_message = temp_ctx.custom_error_message;
 5261|       |                     }
 5262|       |                     if (match_idx + 1 < category_count) {
 5263|       |                        // Not the last type, continue trying
 5264|       |                     }
 5265|       |                     else {
 5266|       |                        // Last type failed, propagate error
 5267|       |                        ctx.error = temp_ctx.error;
 5268|       |                        ctx.custom_error_message = temp_ctx.custom_error_message;
 5269|       |                     }
 5270|       |                  }
 5271|       |                  ++match_idx;
 5272|       |               }
 5273|       |            });
 5274|       |
 5275|       |            if (!found_match && !bool(ctx.error)) {
 5276|       |               if (expansion_error != error_code::none) {
 5277|       |                  ctx.error = expansion_error;
 5278|       |                  ctx.custom_error_message = expansion_message;
 5279|       |               }
 5280|       |               else {
 5281|       |                  ctx.error = error_code::no_matching_variant_type;
 5282|       |               }
 5283|       |            }
 5284|       |         }
 5285|  1.19M|      }
_ZN3glz4fromILj450ENS_17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES1_EEEEE2opITnDaXtlNS_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj33EEERPKcRS5_TkNS_10is_contextERNS8_12yaml_contextESB_EEvOT1_OT2_OT0_T3_:
 4515|  1.21M|      {
 4516|  1.21M|         if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4516:14): [True: 0, False: 1.21M]
  ------------------
 4517|      0|            return;
 4518|       |
 4519|  1.21M|         yaml::node_preamble_state preamble{};
 4520|  1.21M|         if (yaml::parse_node_preamble<Opts, yaml::node_property_policy{true, true, false, false}>(
  ------------------
  |  Branch (4520:14): [True: 21.7k, False: 1.19M]
  ------------------
 4521|  1.21M|                value, ctx, it, end, preamble, [](yaml::yaml_tag tag) { return yaml::tag_valid_for_map(tag); }))
 4522|  21.7k|            return;
 4523|       |
 4524|  1.19M|         using key_t = typename std::remove_cvref_t<T>::key_type;
 4525|  1.19M|         using val_t = typename std::remove_cvref_t<T>::mapped_type;
 4526|       |
 4527|       |         // Reading a YAML mapping MERGES into the target: an entry overwrites the
 4528|       |         // value of a key that existed before the read and adds new keys, while
 4529|       |         // pre-existing keys the document does not mention are preserved (like a
 4530|       |         // struct/object read, and like json/read.hpp's per-key value[key]).
 4531|       |         // Within a single document a repeated key keeps its FIRST value -- YAML
 4532|       |         // mappings disallow duplicate keys and the conformance suite expects
 4533|       |         // first-wins, which falls out of emplace into an empty map. Any
 4534|       |         // pre-existing entry the document leaves untouched is restored on scope
 4535|       |         // exit (including error paths). When the target starts empty (the common
 4536|       |         // case) this is a no-op with negligible cost.
 4537|  1.19M|         std::remove_cvref_t<T> preexisting_entries;
 4538|  1.19M|         if (!value.empty()) {
  ------------------
  |  Branch (4538:14): [True: 0, False: 1.19M]
  ------------------
 4539|      0|            preexisting_entries = std::move(value);
 4540|      0|            value.clear();
 4541|      0|         }
 4542|  1.19M|         struct merge_restore_guard
 4543|  1.19M|         {
 4544|  1.19M|            std::remove_cvref_t<T>& target;
 4545|  1.19M|            std::remove_cvref_t<T>& saved;
 4546|  1.19M|            ~merge_restore_guard()
 4547|  1.19M|            {
 4548|       |               // emplace is a no-op for keys the document already wrote, so only
 4549|       |               // untouched pre-existing entries are put back.
 4550|  1.19M|               for (auto& entry : saved) {
 4551|  1.19M|                  target.emplace(entry.first, std::move(entry.second));
 4552|  1.19M|               }
 4553|  1.19M|            }
 4554|  1.19M|         } merge_restore{value, preexisting_entries};
 4555|       |
 4556|  1.19M|         const bool treat_as_block_mapping =
 4557|  1.19M|            !yaml::check_flow_context(Opts) && *it == '{' && yaml::inline_value_has_plain_mapping_indicator(it, end);
  ------------------
  |  Branch (4557:13): [Folded, False: 1.19M]
  |  Branch (4557:48): [True: 0, False: 0]
  |  Branch (4557:62): [True: 0, False: 0]
  ------------------
 4558|       |
 4559|  1.19M|         if (*it == '{' && !treat_as_block_mapping) {
  ------------------
  |  Branch (4559:14): [True: 819k, False: 374k]
  |  Branch (4559:28): [True: 0, Folded]
  ------------------
 4560|       |            // Flow mapping
 4561|   819k|            ++it;
 4562|       |            // Skip whitespace and newlines after opening brace
 4563|   819k|            yaml::skip_ws_and_newlines(it, end);
 4564|       |
 4565|   819k|            if (it != end && *it == '}') {
  ------------------
  |  Branch (4565:17): [True: 819k, False: 662]
  |  Branch (4565:30): [True: 14.4k, False: 804k]
  ------------------
 4566|  14.4k|               ++it;
 4567|  14.4k|               yaml::validate_flow_node_adjacent_tail(ctx, it, end);
 4568|  14.4k|               if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4568:20): [True: 12, False: 14.4k]
  ------------------
 4569|     12|                  return;
 4570|  14.4k|               yaml::finalize_node_anchor(preamble.node_props, ctx, it);
 4571|  14.4k|               return;
 4572|  14.4k|            }
 4573|       |
 4574|  4.12M|            while (it != end) {
  ------------------
  |  Branch (4574:20): [True: 4.12M, False: 1.93k]
  ------------------
 4575|       |               // Skip whitespace and newlines at start of each iteration
 4576|  4.12M|               yaml::skip_ws_and_newlines(it, end);
 4577|       |
 4578|  4.12M|               if (it != end && *it == '}') {
  ------------------
  |  Branch (4578:20): [True: 4.12M, False: 0]
  |  Branch (4578:33): [True: 29.0k, False: 4.09M]
  ------------------
 4579|  29.0k|                  ++it;
 4580|  29.0k|                  yaml::validate_flow_node_adjacent_tail(ctx, it, end);
 4581|  29.0k|                  if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4581:23): [True: 31, False: 29.0k]
  ------------------
 4582|     31|                     return;
 4583|  29.0k|                  break;
 4584|  29.0k|               }
 4585|       |
 4586|  4.09M|               bool explicit_flow_key = false;
 4587|  4.09M|               auto explicit_probe = it;
 4588|  4.09M|               yaml::skip_inline_ws(explicit_probe, end);
 4589|  4.09M|               if (explicit_probe != end && *explicit_probe == '?') {
  ------------------
  |  Branch (4589:20): [True: 4.09M, False: 0]
  |  Branch (4589:45): [True: 72.2k, False: 4.01M]
  ------------------
 4590|  72.2k|                  const auto after_q = explicit_probe + 1;
 4591|  72.2k|                  if (after_q == end || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*after_q)] ||
  ------------------
  |  Branch (4591:23): [True: 1, False: 72.2k]
  |  Branch (4591:41): [True: 41.6k, False: 30.6k]
  ------------------
 4592|  48.4k|                      *after_q == ',' || *after_q == '}') {
  ------------------
  |  Branch (4592:23): [True: 6.10k, False: 24.5k]
  |  Branch (4592:42): [True: 680, False: 23.8k]
  ------------------
 4593|  48.4k|                     explicit_flow_key = true;
 4594|  48.4k|                     it = explicit_probe + 1;
 4595|  48.4k|                     yaml::skip_flow_ws_and_newlines(ctx, it, end);
 4596|  48.4k|                     if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4596:26): [True: 6, False: 48.4k]
  ------------------
 4597|      6|                        return;
 4598|  48.4k|                  }
 4599|  72.2k|               }
 4600|       |               // Parse key
 4601|  4.09M|               key_t key{};
 4602|  4.09M|               if constexpr (std::same_as<std::remove_cvref_t<key_t>, std::string>) {
 4603|  4.09M|                  if (explicit_flow_key && it != end && (*it == ':' || *it == ',' || *it == '}')) {
  ------------------
  |  Branch (4603:23): [True: 48.4k, False: 4.04M]
  |  Branch (4603:44): [True: 48.3k, False: 2]
  |  Branch (4603:58): [True: 1.30k, False: 47.0k]
  |  Branch (4603:72): [True: 7.95k, False: 39.1k]
  |  Branch (4603:86): [True: 1.02k, False: 38.1k]
  ------------------
 4604|  10.2k|                     key.clear();
 4605|  10.2k|                  }
 4606|  4.08M|                  else {
 4607|  4.08M|                     auto key_probe = it;
 4608|  4.08M|                     yaml::skip_inline_ws(key_probe, end);
 4609|       |
 4610|       |                     // Use full node parsing only for structurally complex flow keys.
 4611|       |                     // Plain/quoted/alias keys stay on parse_yaml_key() for compatibility.
 4612|  4.08M|                     bool parse_complex_flow_key = false;
 4613|  4.08M|                     if (key_probe != end) {
  ------------------
  |  Branch (4613:26): [True: 4.08M, False: 2]
  ------------------
 4614|  4.08M|                        if (*key_probe == '[' || *key_probe == '{') {
  ------------------
  |  Branch (4614:29): [True: 8.35k, False: 4.07M]
  |  Branch (4614:50): [True: 19.1k, False: 4.05M]
  ------------------
 4615|  27.4k|                           parse_complex_flow_key = true;
 4616|  27.4k|                        }
 4617|  4.05M|                        else if (*key_probe == '&') {
  ------------------
  |  Branch (4617:34): [True: 766k, False: 3.28M]
  ------------------
 4618|   766k|                           ++key_probe;
 4619|   766k|                           yaml::parse_anchor_name(key_probe, end);
 4620|   766k|                           yaml::skip_inline_ws(key_probe, end);
 4621|   766k|                           if (key_probe != end && (*key_probe == '[' || *key_probe == '{')) {
  ------------------
  |  Branch (4621:32): [True: 766k, False: 50]
  |  Branch (4621:53): [True: 5.01k, False: 761k]
  |  Branch (4621:74): [True: 166k, False: 595k]
  ------------------
 4622|   171k|                              parse_complex_flow_key = true;
 4623|   171k|                           }
 4624|   766k|                        }
 4625|  4.08M|                     }
 4626|       |
 4627|  4.08M|                     if (parse_complex_flow_key) {
  ------------------
  |  Branch (4627:26): [True: 198k, False: 3.88M]
  ------------------
 4628|   198k|                        glz::generic key_node{};
 4629|   198k|                        from<YAML, glz::generic>::template op<yaml::flow_context_on<Opts>()>(key_node, ctx, it, end);
 4630|   198k|                        if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4630:29): [True: 9.48k, False: 189k]
  ------------------
 4631|  9.48k|                           return;
 4632|   189k|                        if (!yaml::materialize_key(key, key_node, ctx)) [[unlikely]]
  ------------------
  |  Branch (4632:29): [True: 36, False: 189k]
  ------------------
 4633|     36|                           return;
 4634|   189k|                     }
 4635|  3.88M|                     else {
 4636|  3.88M|                        if (!yaml::parse_yaml_key(key, ctx, it, end, true)) {
  ------------------
  |  Branch (4636:29): [True: 5.35k, False: 3.87M]
  ------------------
 4637|  5.35k|                           return;
 4638|  5.35k|                        }
 4639|  3.88M|                     }
 4640|  4.08M|                  }
 4641|       |               }
 4642|       |               else {
 4643|       |                  if (explicit_flow_key && it != end && (*it == ':' || *it == ',' || *it == '}')) {
 4644|       |                     ctx.error = error_code::syntax_error;
 4645|       |                     return;
 4646|       |                  }
 4647|       |                  from<YAML, key_t>::template op<yaml::flow_context_on<Opts>()>(key, ctx, it, end);
 4648|       |                  if (bool(ctx.error)) [[unlikely]]
 4649|       |                     return;
 4650|       |               }
 4651|       |
 4652|       |               // Separation between flow key and ':' may include comments/newlines.
 4653|       |               // In flow context, newlines are allowed between key and ':'.
 4654|  4.07M|               yaml::skip_flow_ws_and_newlines(ctx, it, end);
 4655|  4.09M|               if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4655:20): [True: 20, False: 4.09M]
  ------------------
 4656|     20|                  return;
 4657|       |
 4658|  4.09M|               auto parse_implicit_null = [&](val_t& val) -> bool {
 4659|  4.09M|                  if constexpr (nullable_like<std::remove_cvref_t<val_t>>) {
 4660|  4.09M|                     val = {};
 4661|  4.09M|                     return true;
 4662|  4.09M|                  }
 4663|  4.09M|                  else if constexpr (std::same_as<std::remove_cvref_t<val_t>, glz::generic>) {
 4664|  4.09M|                     val = glz::generic{};
 4665|  4.09M|                     return true;
 4666|  4.09M|                  }
 4667|  4.09M|                  else {
 4668|  4.09M|                     static constexpr std::string_view null_value{"null"};
 4669|  4.09M|                     auto null_it = null_value.data();
 4670|  4.09M|                     from<YAML, val_t>::template op<yaml::flow_context_on<Opts>()>(
 4671|  4.09M|                        val, ctx, null_it, null_value.data() + null_value.size());
 4672|  4.09M|                     return !bool(ctx.error);
 4673|  4.09M|                  }
 4674|  4.09M|               };
 4675|       |
 4676|  4.09M|               if (it != end && (*it == ',' || *it == '}')) {
  ------------------
  |  Branch (4676:20): [True: 4.07M, False: 16.2k]
  |  Branch (4676:34): [True: 2.36M, False: 1.71M]
  |  Branch (4676:48): [True: 140k, False: 1.57M]
  ------------------
 4677|  2.50M|                  val_t val{};
 4678|  2.50M|                  if (!parse_implicit_null(val)) [[unlikely]]
  ------------------
  |  Branch (4678:23): [True: 0, False: 2.50M]
  ------------------
 4679|      0|                     return;
 4680|       |
 4681|  2.50M|                  value.emplace(std::move(key), std::move(val));
 4682|       |
 4683|  2.50M|                  if (*it == '}') {
  ------------------
  |  Branch (4683:23): [True: 140k, False: 2.36M]
  ------------------
 4684|   140k|                     ++it;
 4685|   140k|                     yaml::validate_flow_node_adjacent_tail(ctx, it, end);
 4686|   140k|                     if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4686:26): [True: 154, False: 140k]
  ------------------
 4687|    154|                        return;
 4688|   140k|                     break;
 4689|   140k|                  }
 4690|       |
 4691|  2.36M|                  ++it; // skip comma
 4692|  2.36M|                  yaml::skip_ws_and_newlines(it, end);
 4693|  2.36M|                  continue;
 4694|  2.50M|               }
 4695|       |
 4696|  1.58M|               if (it == end || *it != ':') {
  ------------------
  |  Branch (4696:20): [True: 16.2k, False: 1.57M]
  |  Branch (4696:33): [True: 937, False: 1.57M]
  ------------------
 4697|  2.32k|                  ctx.error = error_code::syntax_error;
 4698|  2.32k|                  return;
 4699|  2.32k|               }
 4700|  1.58M|               ++it;
 4701|       |
 4702|  1.58M|               yaml::skip_flow_ws_and_newlines(ctx, it, end);
 4703|  1.58M|               if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4703:20): [True: 18, False: 1.58M]
  ------------------
 4704|     18|                  return;
 4705|       |
 4706|       |               // Omitted value after an explicit ':' maps to an implicit null.
 4707|  1.58M|               if (it != end && (*it == ',' || *it == '}')) {
  ------------------
  |  Branch (4707:20): [True: 1.57M, False: 14.8k]
  |  Branch (4707:34): [True: 166k, False: 1.40M]
  |  Branch (4707:48): [True: 12.9k, False: 1.39M]
  ------------------
 4708|   179k|                  val_t val{};
 4709|   179k|                  if (!parse_implicit_null(val)) [[unlikely]]
  ------------------
  |  Branch (4709:23): [True: 0, False: 179k]
  ------------------
 4710|      0|                     return;
 4711|       |
 4712|   179k|                  value.emplace(std::move(key), std::move(val));
 4713|       |
 4714|   179k|                  if (*it == '}') {
  ------------------
  |  Branch (4714:23): [True: 12.9k, False: 166k]
  ------------------
 4715|  12.9k|                     ++it;
 4716|  12.9k|                     yaml::validate_flow_node_adjacent_tail(ctx, it, end);
 4717|  12.9k|                     if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4717:26): [True: 9, False: 12.9k]
  ------------------
 4718|      9|                        return;
 4719|  12.9k|                     break;
 4720|  12.9k|                  }
 4721|       |
 4722|   166k|                  ++it; // skip comma
 4723|   166k|                  yaml::skip_ws_and_newlines(it, end);
 4724|   166k|                  continue;
 4725|   179k|               }
 4726|       |
 4727|       |               // Parse value
 4728|  1.40M|               val_t val{};
 4729|  1.40M|               from<YAML, val_t>::template op<yaml::flow_context_on<Opts>()>(val, ctx, it, end);
 4730|  1.40M|               if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4730:20): [True: 3.23k, False: 1.40M]
  ------------------
 4731|  3.23k|                  return;
 4732|       |
 4733|  1.40M|               value.emplace(std::move(key), std::move(val));
 4734|       |
 4735|  1.40M|               yaml::skip_inline_ws(it, end);
 4736|       |
 4737|  1.40M|               if (it != end && *it == '}') {
  ------------------
  |  Branch (4737:20): [True: 1.38M, False: 15.1k]
  |  Branch (4737:33): [True: 569k, False: 819k]
  ------------------
 4738|   569k|                  ++it;
 4739|   569k|                  yaml::validate_flow_node_adjacent_tail(ctx, it, end);
 4740|   569k|                  if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4740:23): [True: 163, False: 568k]
  ------------------
 4741|    163|                     return;
 4742|   568k|                  break;
 4743|   569k|               }
 4744|   834k|               else if (it != end && *it == ',') {
  ------------------
  |  Branch (4744:25): [True: 819k, False: 15.1k]
  |  Branch (4744:38): [True: 737k, False: 82.2k]
  ------------------
 4745|   737k|                  ++it;
 4746|       |                  // Skip whitespace and newlines after comma
 4747|   737k|                  yaml::skip_ws_and_newlines(it, end);
 4748|   737k|               }
 4749|  97.3k|               else if (it != end && (*it == '\n' || *it == '\r')) {
  ------------------
  |  Branch (4749:25): [True: 82.2k, False: 15.1k]
  |  Branch (4749:39): [True: 38.2k, False: 43.9k]
  |  Branch (4749:54): [True: 43.6k, False: 331]
  ------------------
 4750|       |                  // Newlines may precede either the closing brace or the
 4751|       |                  // separator comma for the next entry.
 4752|  81.8k|                  yaml::skip_ws_and_newlines(it, end);
 4753|  81.8k|                  if (it != end && *it == '}') {
  ------------------
  |  Branch (4753:23): [True: 81.8k, False: 2]
  |  Branch (4753:36): [True: 30.2k, False: 51.5k]
  ------------------
 4754|  30.2k|                     ++it;
 4755|  30.2k|                     yaml::validate_flow_node_adjacent_tail(ctx, it, end);
 4756|  30.2k|                     if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4756:26): [True: 17, False: 30.2k]
  ------------------
 4757|     17|                        return;
 4758|  30.2k|                     break;
 4759|  30.2k|                  }
 4760|  51.5k|                  if (it != end && *it == ',') {
  ------------------
  |  Branch (4760:23): [True: 51.5k, False: 2]
  |  Branch (4760:36): [True: 51.4k, False: 100]
  ------------------
 4761|  51.4k|                     ++it;
 4762|  51.4k|                     yaml::skip_ws_and_newlines(it, end);
 4763|  51.4k|                     continue;
 4764|  51.4k|                  }
 4765|    102|                  ctx.error = error_code::syntax_error;
 4766|    102|                  return;
 4767|  51.5k|               }
 4768|  15.5k|               else {
 4769|  15.5k|                  ctx.error = error_code::syntax_error;
 4770|  15.5k|                  return;
 4771|  15.5k|               }
 4772|  1.40M|            }
 4773|   805k|         }
 4774|   374k|         else {
 4775|       |            // Block mapping - use shared loop with map-specific callback
 4776|   374k|            yaml::parse_block_mapping_loop<Opts>(
 4777|   374k|               ctx, it, end, int32_t(-1), [&](auto& ctx, auto& it, auto end, int32_t line_indent) -> bool {
 4778|   374k|                  auto parse_map_value = [&](val_t& val) -> bool {
 4779|   374k|                     if (it != end && !yaml::line_end_or_comment_table[static_cast<uint8_t>(*it)]) {
 4780|   374k|                        bool line_starts_with_explicit_value_indicator = false;
 4781|       |
 4782|       |                        // Inline mapping values in block context cannot start with a
 4783|       |                        // plain "key: value" pair on the same line (e.g. "a: b: c").
 4784|       |                        // Such constructs are malformed unless wrapped in flow
 4785|       |                        // delimiters ({...} / [...]) or quoted.
 4786|   374k|                        if constexpr (std::is_pointer_v<std::decay_t<decltype(it)>>) {
 4787|   374k|                           if (ctx.stream_begin) {
 4788|   374k|                              auto is_line_content_start = [&](auto pos) {
 4789|   374k|                                 return !ctx.line_prefix_before(pos).has_content;
 4790|   374k|                              };
 4791|       |
 4792|   374k|                              auto line_has_explicit_value_indicator = [&](auto pos) {
 4793|   374k|                                 const char* line = ctx.line_begin_of(pos);
 4794|   374k|                                 while (line != end && (*line == ' ' || *line == '\t')) ++line;
 4795|   374k|                                 return line != end && *line == ':';
 4796|   374k|                              };
 4797|       |
 4798|   374k|                              if (!is_line_content_start(it) &&
 4799|   374k|                                  yaml::inline_value_has_plain_mapping_indicator(it, end) &&
 4800|   374k|                                  !line_has_explicit_value_indicator(it)) {
 4801|   374k|                                 ctx.error = error_code::syntax_error;
 4802|   374k|                                 return false;
 4803|   374k|                              }
 4804|   374k|                              line_starts_with_explicit_value_indicator = line_has_explicit_value_indicator(it);
 4805|   374k|                           }
 4806|   374k|                        }
 4807|       |
 4808|   374k|                        if (*it == '-' &&
 4809|   374k|                            ((it + 1) == end || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*(it + 1))]) &&
 4810|   374k|                            !line_starts_with_explicit_value_indicator) {
 4811|       |                           // "key: - item" is not valid block sequence syntax.
 4812|   374k|                           ctx.error = error_code::syntax_error;
 4813|   374k|                           return false;
 4814|   374k|                        }
 4815|       |
 4816|   374k|                        if (!ctx.push_indent(line_indent + 1)) [[unlikely]]
 4817|   374k|                           return false;
 4818|   374k|                        from<YAML, val_t>::template op<Opts>(val, ctx, it, end);
 4819|   374k|                        ctx.pop_indent();
 4820|   374k|                     }
 4821|   374k|                     else {
 4822|   374k|                        int32_t nested_indent = yaml::detect_nested_value_indent(ctx, it, end, line_indent);
 4823|   374k|                        if (nested_indent >= 0) {
 4824|   374k|                           yaml::skip_to_content(it, end);
 4825|   374k|                           if (it != end && *it == ':' && (it + 1) != end && *(it + 1) == '\t') {
 4826|   374k|                              ctx.error = error_code::syntax_error;
 4827|   374k|                              return false;
 4828|   374k|                           }
 4829|       |                           // A struct value reads the pushed indent as its own key column;
 4830|       |                           // every other value type reads it as the enclosing baseline.
 4831|   374k|                           const int32_t value_indent =
 4832|   374k|                              yaml::receives_block_mapping_column<val_t>() ? nested_indent : nested_indent - 1;
 4833|   374k|                           if (!ctx.push_indent(value_indent)) [[unlikely]]
 4834|   374k|                              return false;
 4835|   374k|                           from<YAML, val_t>::template op<Opts>(val, ctx, it, end);
 4836|   374k|                           ctx.pop_indent();
 4837|   374k|                        }
 4838|   374k|                     }
 4839|   374k|                     return !bool(ctx.error);
 4840|   374k|                  };
 4841|       |
 4842|       |                  // Explicit key entry form:
 4843|       |                  // ? key
 4844|       |                  // : value
 4845|   374k|                  if (*it == '?' && ((it + 1) != end) && *(it + 1) == '\t') {
 4846|   374k|                     ctx.error = error_code::syntax_error;
 4847|   374k|                     return false;
 4848|   374k|                  }
 4849|   374k|                  if (*it == '?' && ((it + 1) == end || *(it + 1) == ' ' || *(it + 1) == '\n' || *(it + 1) == '\r')) {
 4850|   374k|                     ++it; // skip '?'
 4851|   374k|                     yaml::skip_inline_ws(it, end);
 4852|       |
 4853|   374k|                     const int32_t explicit_value_indicator_indent =
 4854|   374k|                        (ctx.current_indent() < 0) ? 0 : (ctx.current_indent() + 1);
 4855|       |
 4856|   374k|                     key_t key{};
 4857|   374k|                     if constexpr (std::same_as<std::remove_cvref_t<key_t>, std::string>) {
 4858|   374k|                        auto to_string_key = [&](glz::generic& key_node) {
 4859|   374k|                           return yaml::materialize_key(key, key_node, ctx);
 4860|   374k|                        };
 4861|       |
 4862|   374k|                        auto key_it = it;
 4863|   374k|                        yaml::skip_inline_ws(key_it, end);
 4864|       |
 4865|   374k|                        auto content = key_it;
 4866|   374k|                        yaml::skip_to_content(content, end);
 4867|   374k|                        bool handled_anchor_only_empty_key = false;
 4868|       |
 4869|       |                        // Anchor on an empty explicit key node:
 4870|       |                        //   ? &a
 4871|       |                        //   : value
 4872|   374k|                        if (content != end && *content == '&') {
 4873|   374k|                           auto anchor_probe = content + 1;
 4874|   374k|                           auto anchor_name = yaml::parse_anchor_name(anchor_probe, end);
 4875|   374k|                           if (!anchor_name.empty()) {
 4876|   374k|                              auto after_anchor = anchor_probe;
 4877|   374k|                              yaml::skip_inline_ws(after_anchor, end);
 4878|       |
 4879|   374k|                              auto value_indicator = after_anchor;
 4880|   374k|                              if (value_indicator != end && *value_indicator == ':') {
 4881|   374k|                                 key.clear();
 4882|   374k|                                 ctx.anchors[std::string(anchor_name)] = {content, content, ctx.current_indent()};
 4883|   374k|                                 it = value_indicator;
 4884|   374k|                                 handled_anchor_only_empty_key = true;
 4885|   374k|                              }
 4886|   374k|                              else {
 4887|   374k|                                 if (value_indicator != end && *value_indicator == '#') {
 4888|   374k|                                    yaml::skip_comment(value_indicator, end);
 4889|   374k|                                 }
 4890|   374k|                                 if (value_indicator != end && (*value_indicator == '\n' || *value_indicator == '\r')) {
 4891|   374k|                                    yaml::skip_newline(value_indicator, end);
 4892|   374k|                                    auto value_line = value_indicator;
 4893|   374k|                                    int32_t value_indent = yaml::measure_indent(value_line, end, ctx);
 4894|   374k|                                    if (bool(ctx.error)) [[unlikely]]
 4895|   374k|                                       return false;
 4896|   374k|                                    if (value_line != end && *value_line == ':' &&
 4897|   374k|                                        value_indent == explicit_value_indicator_indent) {
 4898|   374k|                                       key.clear();
 4899|   374k|                                       ctx.anchors[std::string(anchor_name)] = {content, content, ctx.current_indent()};
 4900|   374k|                                       it = value_line;
 4901|   374k|                                       handled_anchor_only_empty_key = true;
 4902|   374k|                                    }
 4903|   374k|                                    else if (value_line != end && *value_line == ':') {
 4904|       |                                       // In explicit-key form ("? &a"), a following ':'
 4905|       |                                       // starts the outer value indicator only at the same
 4906|       |                                       // indentation. A deeper-indented ': value' is malformed.
 4907|   374k|                                       ctx.error = error_code::syntax_error;
 4908|   374k|                                       return false;
 4909|   374k|                                    }
 4910|   374k|                                 }
 4911|   374k|                              }
 4912|   374k|                           }
 4913|   374k|                        }
 4914|       |
 4915|   374k|                        const bool key_content_spans_lines = [&] {
 4916|   374k|                           auto scan = key_it;
 4917|   374k|                           while (scan != content && scan != end) {
 4918|   374k|                              if (*scan == '\n' || *scan == '\r') return true;
 4919|   374k|                              ++scan;
 4920|   374k|                           }
 4921|   374k|                           return false;
 4922|   374k|                        }();
 4923|       |
 4924|   374k|                        if (handled_anchor_only_empty_key) {
 4925|       |                           // 'it' already points to the explicit value indicator ':'
 4926|   374k|                        }
 4927|   374k|                        else if (content == end || (*content == ':' && key_content_spans_lines)) {
 4928|   374k|                           key.clear();
 4929|   374k|                           it = content;
 4930|   374k|                        }
 4931|   374k|                        else {
 4932|       |                           // Explicit mapping keys ('? key-node') are full YAML nodes.
 4933|       |                           // Parse the key node structurally (not via plain-key scanning)
 4934|       |                           // so inputs like '? []: x' and '? JSON: like' are interpreted
 4935|       |                           // as complex keys, not split into implicit key/value pairs.
 4936|   374k|                           auto key_node_it = content;
 4937|   374k|                           auto key_node_end = end;
 4938|   374k|                           if constexpr (std::is_pointer_v<std::decay_t<It>>) {
 4939|       |                              // In explicit-key form, a following standalone ':'
 4940|       |                              // line (same or lower indentation) belongs to the
 4941|       |                              // outer mapping value, not the key node itself.
 4942|   374k|                              auto scan = content;
 4943|   374k|                              while (scan != end) {
 4944|   374k|                                 while (scan != end && *scan != '\n' && *scan != '\r') {
 4945|   374k|                                    ++scan;
 4946|   374k|                                 }
 4947|   374k|                                 if (scan == end) {
 4948|   374k|                                    break;
 4949|   374k|                                 }
 4950|       |
 4951|   374k|                                 yaml::skip_newline(scan, end);
 4952|   374k|                                 auto line_start = scan;
 4953|       |
 4954|   374k|                                 int32_t indicator_indent = 0;
 4955|   374k|                                 while (scan != end && *scan == ' ') {
 4956|   374k|                                    ++indicator_indent;
 4957|   374k|                                    ++scan;
 4958|   374k|                                 }
 4959|       |
 4960|   374k|                                 if (scan != end && *scan == ':') {
 4961|   374k|                                    const auto after_colon = scan + 1;
 4962|   374k|                                    if ((after_colon == end ||
 4963|   374k|                                         yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*after_colon)]) &&
 4964|   374k|                                        indicator_indent <= line_indent) {
 4965|   374k|                                       key_node_end = line_start;
 4966|   374k|                                       break;
 4967|   374k|                                    }
 4968|   374k|                                 }
 4969|   374k|                              }
 4970|   374k|                           }
 4971|       |
 4972|   374k|                           glz::generic key_node{};
 4973|   374k|                           const bool prev_explicit_mapping_key_context = ctx.explicit_mapping_key_context;
 4974|   374k|                           ctx.explicit_mapping_key_context = true;
 4975|   374k|                           from<YAML, glz::generic>::template op<Opts>(key_node, ctx, key_node_it, key_node_end);
 4976|   374k|                           ctx.explicit_mapping_key_context = prev_explicit_mapping_key_context;
 4977|   374k|                           if (bool(ctx.error)) [[unlikely]]
 4978|   374k|                              return false;
 4979|   374k|                           it = key_node_it;
 4980|   374k|                           if (!to_string_key(key_node)) [[unlikely]]
 4981|   374k|                              return false;
 4982|   374k|                        }
 4983|   374k|                     }
 4984|   374k|                     else {
 4985|   374k|                        if (it != end && !yaml::line_end_or_comment_table[static_cast<uint8_t>(*it)]) {
 4986|   374k|                           from<YAML, key_t>::template op<Opts>(key, ctx, it, end);
 4987|   374k|                           if (bool(ctx.error)) [[unlikely]]
 4988|   374k|                              return false;
 4989|   374k|                        }
 4990|   374k|                     }
 4991|       |
 4992|   374k|                     yaml::skip_inline_ws(it, end);
 4993|   374k|                     yaml::skip_comment(it, end);
 4994|       |
 4995|       |                     // Value indicator may appear on the next line at the same indent.
 4996|   374k|                     if (it != end && (*it == '\n' || *it == '\r')) {
 4997|   374k|                        auto probe = it;
 4998|   374k|                        bool found_value_indicator = false;
 4999|       |
 5000|   374k|                        while (probe != end && (*probe == '\n' || *probe == '\r')) {
 5001|   374k|                           yaml::skip_newline(probe, end);
 5002|       |
 5003|   374k|                           auto value_line = probe;
 5004|   374k|                           int32_t value_indent = yaml::measure_indent(value_line, end, ctx);
 5005|   374k|                           if (bool(ctx.error)) [[unlikely]]
 5006|   374k|                              return false;
 5007|       |
 5008|   374k|                           if (value_line == end || *value_line == '\n' || *value_line == '\r') {
 5009|   374k|                              probe = value_line;
 5010|   374k|                              continue; // blank line
 5011|   374k|                           }
 5012|   374k|                           if (*value_line == '#') {
 5013|   374k|                              yaml::skip_comment(value_line, end);
 5014|   374k|                              probe = value_line;
 5015|   374k|                              continue; // comment-only line
 5016|   374k|                           }
 5017|   374k|                           if (*value_line == ':' && value_indent == explicit_value_indicator_indent) {
 5018|   374k|                              it = value_line;
 5019|   374k|                              found_value_indicator = true;
 5020|   374k|                           }
 5021|   374k|                           break;
 5022|   374k|                        }
 5023|       |
 5024|   374k|                        if (found_value_indicator) {
 5025|   374k|                           yaml::skip_inline_ws(it, end);
 5026|   374k|                        }
 5027|   374k|                     }
 5028|       |
 5029|   374k|                     val_t val{};
 5030|   374k|                     if (it != end && *it == ':') {
 5031|   374k|                        ++it;
 5032|   374k|                        if (it != end && *it == '\t') {
 5033|   374k|                           ctx.error = error_code::syntax_error;
 5034|   374k|                           return false;
 5035|   374k|                        }
 5036|   374k|                        if (it != end && (*it == '\n' || *it == '\r')) {
 5037|   374k|                           auto probe = it;
 5038|   374k|                           yaml::skip_newline(probe, end);
 5039|   374k|                           while (probe != end && *probe == ' ') ++probe;
 5040|   374k|                           if (probe != end && *probe == ':' && ((probe + 1) != end) && *(probe + 1) == '\t') {
 5041|   374k|                              ctx.error = error_code::syntax_error;
 5042|   374k|                              return false;
 5043|   374k|                           }
 5044|   374k|                        }
 5045|   374k|                        yaml::skip_inline_ws(it, end);
 5046|   374k|                        if (!parse_map_value(val)) [[unlikely]]
 5047|   374k|                           return false;
 5048|   374k|                     }
 5049|       |
 5050|   374k|                     value.emplace(std::move(key), std::move(val));
 5051|   374k|                     return true;
 5052|   374k|                  }
 5053|       |
 5054|   374k|                  key_t key{};
 5055|   374k|                  if constexpr (std::same_as<std::remove_cvref_t<key_t>, std::string>) {
 5056|   374k|                     auto key_probe = it;
 5057|   374k|                     yaml::skip_inline_ws(key_probe, end);
 5058|   374k|                     const bool complex_flow_key = (key_probe != end && (*key_probe == '[' || *key_probe == '{'));
 5059|   374k|                     if (complex_flow_key) {
 5060|   374k|                        glz::generic key_node{};
 5061|   374k|                        from<YAML, glz::generic>::template op<yaml::flow_context_on<Opts>()>(key_node, ctx, it, end);
 5062|   374k|                        if (bool(ctx.error)) [[unlikely]]
 5063|   374k|                           return false;
 5064|   374k|                        if (!yaml::materialize_key(key, key_node, ctx)) [[unlikely]]
 5065|   374k|                           return false;
 5066|   374k|                     }
 5067|   374k|                     else {
 5068|   374k|                        if (!yaml::parse_yaml_key(key, ctx, it, end, false)) {
 5069|   374k|                           return false;
 5070|   374k|                        }
 5071|   374k|                     }
 5072|   374k|                  }
 5073|   374k|                  else {
 5074|   374k|                     from<YAML, key_t>::template op<Opts>(key, ctx, it, end);
 5075|   374k|                     if (bool(ctx.error)) [[unlikely]]
 5076|   374k|                        return false;
 5077|   374k|                  }
 5078|       |
 5079|   374k|                  yaml::skip_inline_ws(it, end);
 5080|       |
 5081|   374k|                  if (it == end || *it != ':') {
 5082|   374k|                     ctx.error = error_code::syntax_error;
 5083|   374k|                     return false;
 5084|   374k|                  }
 5085|   374k|                  ++it;
 5086|   374k|                  yaml::skip_inline_ws(it, end);
 5087|       |
 5088|   374k|                  val_t val{};
 5089|   374k|                  if (!parse_map_value(val)) [[unlikely]]
 5090|   374k|                     return false;
 5091|       |
 5092|   374k|                  value.emplace(std::move(key), std::move(val));
 5093|   374k|                  return true;
 5094|   374k|               });
 5095|   374k|         }
 5096|       |
 5097|  1.15M|         yaml::finalize_node_anchor(preamble.node_props, ctx, it);
 5098|  1.15M|      }
_ZN3glz4yaml19parse_node_preambleITnDaXtlNS0_9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj33EEEXtlNS0_20node_property_policyELb1ELb1EEELb0ERNS_17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES4_EEEENS0_12yaml_contextEPKcSC_ZNS_4fromILj450ES8_E2opITnDaXtlS2_Lj450ELb1ELb0ELb1ELh2ELb0ELj33EEERSC_S9_TkNS_10is_contextERSA_SC_EEvOT1_OT2_OT0_T3_EUlNS0_8yaml_tagEE_EEbSL_RSO_RT4_T5_RNS0_19node_preamble_stateEOT6_:
  465|  1.21M|      {
  466|  1.21M|         skip_inline_ws(it, end);
  467|       |
  468|  1.21M|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (468:14): [True: 1, False: 1.21M]
  ------------------
  469|      1|            if constexpr (!AllowEmptyInput) {
  470|      1|               ctx.error = error_code::unexpected_end;
  471|      1|            }
  472|      1|            return true;
  473|      1|         }
  474|       |
  475|  1.21M|         preamble.tag = parse_yaml_tag(it, end, ctx);
  476|  1.21M|         if (preamble.tag == yaml_tag::unknown) [[unlikely]] {
  ------------------
  |  Branch (476:14): [True: 2, False: 1.21M]
  ------------------
  477|      2|            ctx.error = error_code::syntax_error;
  478|      2|            return true;
  479|      2|         }
  480|  1.21M|         if (!tag_validator(preamble.tag)) [[unlikely]] {
  ------------------
  |  Branch (480:14): [True: 2, False: 1.21M]
  ------------------
  481|      2|            ctx.error = error_code::syntax_error;
  482|      2|            return true;
  483|      2|         }
  484|       |
  485|  1.21M|         skip_inline_ws(it, end);
  486|       |
  487|  1.21M|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (487:14): [True: 3, False: 1.21M]
  ------------------
  488|      3|            if constexpr (!AllowEmptyInput) {
  489|      3|               ctx.error = error_code::unexpected_end;
  490|      3|            }
  491|      3|            return true;
  492|      3|         }
  493|       |
  494|  1.21M|         if (parse_node_properties<Opts, PropertyPolicy>(std::forward<T>(value), ctx, it, end, preamble.node_props)) {
  ------------------
  |  Branch (494:14): [True: 21.7k, False: 1.19M]
  ------------------
  495|  21.7k|            return true;
  496|  21.7k|         }
  497|       |
  498|  1.19M|         return false;
  499|  1.21M|      }
_ZZN3glz4fromILj450ENS_17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES1_EEEEE2opITnDaXtlNS_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj33EEERPKcRS5_TkNS_10is_contextERNS8_12yaml_contextESB_EEvOT1_OT2_OT0_T3_ENKUlNS8_8yaml_tagEE_clESN_:
 4521|  1.21M|                value, ctx, it, end, preamble, [](yaml::yaml_tag tag) { return yaml::tag_valid_for_map(tag); }))
_ZN3glz4yaml21parse_node_propertiesITnDaXtlNS0_9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj33EEEXtlNS0_20node_property_policyELb1ELb1EEERNS_17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES4_EEEENS0_12yaml_contextEPKcSC_EEbOT1_RT2_RT3_T4_RNS0_19node_property_stateE:
  408|  1.21M|      {
  409|  1.21M|         state.has_anchor = false;
  410|  1.21M|         state.anchor_name.clear();
  411|  1.21M|         state.anchor_start = nullptr;
  412|  1.21M|         state.anchor_indent = ctx.current_indent();
  413|       |
  414|  1.21M|         if constexpr (Policy.allow_alias) {
  415|  1.21M|            if constexpr (Policy.alias_can_be_mapping_key) {
  416|  1.21M|               if (!alias_token_is_mapping_key(it, end)) {
  ------------------
  |  Branch (416:20): [True: 1.21M, False: 400]
  ------------------
  417|  1.21M|                  if (handle_alias<Opts>(std::forward<T>(value), ctx, it, end)) return true;
  ------------------
  |  Branch (417:23): [True: 21.7k, False: 1.19M]
  ------------------
  418|  1.21M|               }
  419|       |            }
  420|       |            else {
  421|       |               if (handle_alias<Opts>(std::forward<T>(value), ctx, it, end)) return true;
  422|       |            }
  423|  1.21M|         }
  424|       |
  425|  1.21M|         if (it != end && *it == '&') {
  ------------------
  |  Branch (425:14): [True: 1.19M, False: 21.7k]
  |  Branch (425:27): [True: 4.97k, False: 1.18M]
  ------------------
  426|  4.97k|            ++it;
  427|  4.97k|            auto name = parse_anchor_name(it, end);
  428|  4.97k|            if (name.empty()) {
  ------------------
  |  Branch (428:17): [True: 3, False: 4.97k]
  ------------------
  429|      3|               ctx.error = error_code::syntax_error;
  430|      3|               return true;
  431|      3|            }
  432|  4.97k|            skip_inline_ws(it, end);
  433|  4.97k|            if (it == end) {
  ------------------
  |  Branch (433:17): [True: 5, False: 4.97k]
  ------------------
  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|  4.97k|            state.has_anchor = true;
  446|  4.97k|            state.anchor_name = std::string(name);
  447|  4.97k|            state.anchor_start = &*it;
  448|  4.97k|         }
  449|       |
  450|  1.21M|         return false;
  451|  1.21M|      }
_ZN3glz4yaml12handle_aliasITnDaXtlNS0_9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj33EEERNS_17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES3_EEEENS0_12yaml_contextEPKcSB_EEbOT0_RT1_RT2_T3_:
  300|  1.21M|      {
  301|  1.21M|         if (it == end || *it != '*') return false;
  ------------------
  |  Branch (301:14): [True: 0, False: 1.21M]
  |  Branch (301:27): [True: 1.19M, False: 21.7k]
  ------------------
  302|       |
  303|  21.7k|         ++it; // skip '*'
  304|  21.7k|         auto name = parse_anchor_name(it, end);
  305|  21.7k|         if (name.empty()) {
  ------------------
  |  Branch (305:14): [True: 10, False: 21.7k]
  ------------------
  306|     10|            ctx.error = error_code::syntax_error;
  307|     10|            return true;
  308|     10|         }
  309|       |
  310|  21.7k|         auto anchor_it = ctx.anchors.find(name);
  311|  21.7k|         if (anchor_it == ctx.anchors.end()) {
  ------------------
  |  Branch (311:14): [True: 44, False: 21.7k]
  ------------------
  312|     44|            ctx.error = error_code::syntax_error; // undefined alias
  313|     44|            return true;
  314|     44|         }
  315|       |
  316|       |         // Copied rather than referenced: the replay below can replace ctx.anchors wholesale
  317|       |         // (a speculative parse hands its own map back), which would dangle a reference here.
  318|  21.7k|         const auto span = anchor_it->second;
  319|       |
  320|       |         // Empty anchor span (anchor on null/empty node) — leave value as default
  321|  21.7k|         if (span.begin == span.end) {
  ------------------
  |  Branch (321:14): [True: 466, False: 21.2k]
  ------------------
  322|    466|            return true;
  323|    466|         }
  324|       |
  325|       |         // An anchor is invisible to itself while it expands. A span that aliases the name it
  326|       |         // defines -- reachable because a mapping key's anchor is registered over the key text
  327|       |         // before that text is parsed -- would otherwise replay itself forever.
  328|  21.2k|         if (ctx.alias_span_is_replaying(span.begin, span.end)) [[unlikely]] {
  ------------------
  |  Branch (328:14): [True: 5, False: 21.2k]
  ------------------
  329|      5|            ctx.error = error_code::syntax_error; // cyclic alias
  330|      5|            return true;
  331|      5|         }
  332|       |
  333|       |         // Replaying an anchor re-enters the reader directly, bypassing the variant reader's
  334|       |         // depth guard, so this is the only depth accounting a chain of aliases into a
  335|       |         // non-variant target gets. The cycle check above stops the unbounded case; this bounds
  336|       |         // a legitimate but deeply chained one.
  337|  21.2k|         depth_guard guard{ctx, yaml::max_yaml_recursive_depth};
  338|  21.2k|         if (!guard) [[unlikely]]
  ------------------
  |  Branch (338:14): [True: 2, False: 21.2k]
  ------------------
  339|      2|            return true;
  340|       |
  341|  21.2k|         if (!ctx.charge_alias_expansion(static_cast<size_t>(span.end - span.begin))) [[unlikely]] {
  ------------------
  |  Branch (341:14): [True: 1, False: 21.2k]
  ------------------
  342|      1|            ctx.error = error_code::exceeded_max_expansion;
  343|      1|            ctx.custom_error_message = "alias expansion";
  344|      1|            return true;
  345|      1|         }
  346|       |
  347|  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: 931, False: 20.3k]
  ------------------
  354|    931|            ctx.push_indent(span.base_indent - 1);
  355|    931|         }
  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|      }
_ZZN3glz4fromILj450ENS_17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES1_EEEEE2opITnDaXtlNS_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj33EEERPKcRS5_TkNS_10is_contextERNS8_12yaml_contextESB_EEvOT1_OT2_OT0_T3_ENKUlRS4_E_clESN_:
 4658|  2.68M|               auto parse_implicit_null = [&](val_t& val) -> bool {
 4659|       |                  if constexpr (nullable_like<std::remove_cvref_t<val_t>>) {
 4660|       |                     val = {};
 4661|       |                     return true;
 4662|       |                  }
 4663|  2.68M|                  else if constexpr (std::same_as<std::remove_cvref_t<val_t>, glz::generic>) {
 4664|  2.68M|                     val = glz::generic{};
 4665|  2.68M|                     return true;
 4666|       |                  }
 4667|       |                  else {
 4668|       |                     static constexpr std::string_view null_value{"null"};
 4669|       |                     auto null_it = null_value.data();
 4670|       |                     from<YAML, val_t>::template op<yaml::flow_context_on<Opts>()>(
 4671|       |                        val, ctx, null_it, null_value.data() + null_value.size());
 4672|       |                     return !bool(ctx.error);
 4673|       |                  }
 4674|  2.68M|               };
_ZN3glz4yaml24parse_block_mapping_loopITnDaXtlNS0_9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj33EEENS0_12yaml_contextEPKcS5_ZNS_4fromILj450ENS_17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES7_EEEEE2opITnDaXtlS2_Lj450ELb1ELb0ELb1ELh2ELb0ELj33EEERS5_RSB_TkNS_10is_contextERS3_S5_EEvOT1_OT2_OT0_T3_EUlRT_RSL_SH_iE_EEvSQ_RSH_SJ_iOSN_:
 3633|   374k|      {
 3634|       |         // A tagged-variant custom alternative hands its body (at the variant's own column) to a
 3635|       |         // discover-mode reader. Honor the known indent it published so continuation/dedent are
 3636|       |         // judged against the outer parent, not the body itself. One-shot: reset on observation.
 3637|   374k|         if (ctx.forced_block_mapping_indent >= 0) {
  ------------------
  |  Branch (3637:14): [True: 0, False: 374k]
  ------------------
 3638|      0|            if (mapping_indent < 0) {
  ------------------
  |  Branch (3638:17): [True: 0, False: 0]
  ------------------
 3639|      0|               mapping_indent = ctx.forced_block_mapping_indent;
 3640|      0|            }
 3641|      0|            ctx.forced_block_mapping_indent = -1;
 3642|      0|         }
 3643|   374k|         const int32_t parent_indent = ctx.current_indent();
 3644|   374k|         const bool discover_indent = (mapping_indent < 0);
 3645|   374k|         bool first_key = !discover_indent;
 3646|   374k|         bool discovered_first_key_mid_line = false;
 3647|   374k|         int32_t discovered_first_key_visual_indent = 0;
 3648|       |
 3649|   854k|         while (it != end) {
  ------------------
  |  Branch (3649:17): [True: 531k, False: 322k]
  ------------------
 3650|   531k|            auto line_start = it;
 3651|   531k|            int32_t line_indent = first_key ? mapping_indent : 0;
  ------------------
  |  Branch (3651:35): [True: 0, False: 531k]
  ------------------
 3652|       |
 3653|       |            // Skip blank lines and comments, measure indent
 3654|   728k|            while (it != end) {
  ------------------
  |  Branch (3654:20): [True: 723k, False: 4.95k]
  ------------------
 3655|   723k|               if (*it == '#') {
  ------------------
  |  Branch (3655:20): [True: 56.6k, False: 666k]
  ------------------
 3656|  56.6k|                  skip_comment(it, end);
 3657|  56.6k|                  skip_newline(it, end);
 3658|  56.6k|                  first_key = false;
 3659|  56.6k|                  line_indent = 0;
 3660|  56.6k|               }
 3661|   666k|               else if (*it == '\n' || *it == '\r') {
  ------------------
  |  Branch (3661:25): [True: 16.6k, False: 649k]
  |  Branch (3661:40): [True: 72.1k, False: 577k]
  ------------------
 3662|  88.8k|                  skip_newline(it, end);
 3663|  88.8k|                  first_key = false;
 3664|  88.8k|                  line_indent = 0;
 3665|  88.8k|               }
 3666|   577k|               else if (*it == ' ') {
  ------------------
  |  Branch (3666:25): [True: 109k, False: 468k]
  ------------------
 3667|   109k|                  line_start = it;
 3668|   109k|                  line_indent = 0;
 3669|   270k|                  while (it != end && *it == ' ') {
  ------------------
  |  Branch (3669:26): [True: 269k, False: 1.07k]
  |  Branch (3669:39): [True: 161k, False: 108k]
  ------------------
 3670|   161k|                     ++line_indent;
 3671|   161k|                     ++it;
 3672|   161k|                  }
 3673|       |
 3674|   109k|                  bool saw_tab = false;
 3675|   125k|                  while (it != end && (*it == ' ' || *it == '\t')) {
  ------------------
  |  Branch (3675:26): [True: 124k, False: 1.13k]
  |  Branch (3675:40): [True: 928, False: 123k]
  |  Branch (3675:54): [True: 14.9k, False: 108k]
  ------------------
 3676|  15.8k|                     saw_tab = saw_tab || (*it == '\t');
  ------------------
  |  Branch (3676:32): [True: 14.9k, False: 906]
  |  Branch (3676:43): [True: 906, False: 0]
  ------------------
 3677|  15.8k|                     ++it;
 3678|  15.8k|                  }
 3679|       |
 3680|   109k|                  if (it == end || *it == '\n' || *it == '\r' || *it == '#') {
  ------------------
  |  Branch (3680:23): [True: 1.13k, False: 108k]
  |  Branch (3680:36): [True: 4.66k, False: 103k]
  |  Branch (3680:51): [True: 1.44k, False: 102k]
  |  Branch (3680:66): [True: 40.0k, False: 61.9k]
  ------------------
 3681|  47.3k|                     first_key = false;
 3682|  47.3k|                     line_indent = 0;
 3683|  47.3k|                     continue; // Blank or comment line
 3684|  47.3k|                  }
 3685|       |
 3686|  61.9k|                  if (saw_tab) {
  ------------------
  |  Branch (3686:23): [True: 26, False: 61.9k]
  ------------------
 3687|     26|                     ctx.error = error_code::syntax_error;
 3688|     26|                     return;
 3689|     26|                  }
 3690|       |
 3691|       |                  // Early dedent check
 3692|  61.9k|                  if (mapping_indent >= 0 && line_indent < mapping_indent) {
  ------------------
  |  Branch (3692:23): [True: 59.5k, False: 2.43k]
  |  Branch (3692:46): [True: 374, False: 59.1k]
  ------------------
 3693|    374|                     it = line_start;
 3694|    374|                     return;
 3695|    374|                  }
 3696|       |
 3697|  61.5k|                  first_key = false;
 3698|  61.5k|                  break; // Found content
 3699|  61.9k|               }
 3700|   468k|               else if (*it == '\t') {
  ------------------
  |  Branch (3700:25): [True: 3.29k, False: 465k]
  ------------------
 3701|  3.29k|                  line_start = it;
 3702|  14.6k|                  while (it != end && (*it == ' ' || *it == '\t')) ++it;
  ------------------
  |  Branch (3702:26): [True: 13.3k, False: 1.36k]
  |  Branch (3702:40): [True: 4.14k, False: 9.17k]
  |  Branch (3702:54): [True: 7.25k, False: 1.92k]
  ------------------
 3703|  3.29k|                  if (it == end || *it == '\n' || *it == '\r' || *it == '#') {
  ------------------
  |  Branch (3703:23): [True: 1.36k, False: 1.92k]
  |  Branch (3703:36): [True: 467, False: 1.45k]
  |  Branch (3703:51): [True: 710, False: 748]
  |  Branch (3703:66): [True: 720, False: 28]
  ------------------
 3704|  3.26k|                     first_key = false;
 3705|  3.26k|                     line_indent = 0;
 3706|  3.26k|                     continue; // Blank or comment-only line with tab indentation
 3707|  3.26k|                  }
 3708|     28|                  ctx.error = error_code::syntax_error;
 3709|     28|                  return;
 3710|  3.29k|               }
 3711|   465k|               else {
 3712|   465k|                  line_start = it;
 3713|   465k|                  break; // Content at column 0
 3714|   465k|               }
 3715|   723k|            }
 3716|       |
 3717|   531k|            if (it == end) break;
  ------------------
  |  Branch (3717:17): [True: 4.95k, False: 526k]
  ------------------
 3718|       |
 3719|       |            // Document boundaries terminate the current mapping in both discovered
 3720|       |            // and fixed-indent modes.
 3721|   526k|            if (at_document_end(it, end) || at_document_start(it, end)) break;
  ------------------
  |  Branch (3721:17): [True: 1.29k, False: 525k]
  |  Branch (3721:45): [True: 1.71k, False: 523k]
  ------------------
 3722|       |
 3723|       |            // Dedent checks (skip on first key for struct case)
 3724|       |            // Must check BEFORE establishing mapping_indent so the first discovered key
 3725|       |            // isn't rejected by the parent_indent check (mapping_indent is still -1).
 3726|   523k|            if (!first_key) {
  ------------------
  |  Branch (3726:17): [True: 523k, False: 0]
  ------------------
 3727|       |               // Parent indent check for nested maps (only after mapping_indent established)
 3728|   523k|               if (discover_indent && mapping_indent >= 0 && parent_indent >= 0 && line_indent <= parent_indent) {
  ------------------
  |  Branch (3728:20): [True: 523k, False: 0]
  |  Branch (3728:39): [True: 149k, False: 374k]
  |  Branch (3728:62): [True: 44.5k, False: 104k]
  |  Branch (3728:84): [True: 33.0k, False: 11.5k]
  ------------------
 3729|  33.0k|                  it = line_start;
 3730|  33.0k|                  return;
 3731|  33.0k|               }
 3732|   490k|               if (mapping_indent >= 0 && line_indent < mapping_indent) {
  ------------------
  |  Branch (3732:20): [True: 116k, False: 374k]
  |  Branch (3732:43): [True: 407, False: 115k]
  ------------------
 3733|    407|                  it = line_start;
 3734|    407|                  return;
 3735|    407|               }
 3736|   490k|            }
 3737|       |
 3738|       |            // Establish mapping indent from first key (map case)
 3739|   490k|            bool established_mapping_indent_this_line = false;
 3740|   490k|            if (mapping_indent < 0) {
  ------------------
  |  Branch (3740:17): [True: 374k, False: 115k]
  ------------------
 3741|   374k|               mapping_indent = line_indent;
 3742|   374k|               established_mapping_indent_this_line = true;
 3743|   374k|               discovered_first_key_visual_indent = line_indent;
 3744|   374k|               if constexpr (std::is_pointer_v<std::decay_t<It>>) {
 3745|   374k|                  if (ctx.stream_begin && line_start > ctx.stream_begin) {
  ------------------
  |  Branch (3745:23): [True: 374k, False: 0]
  |  Branch (3745:43): [True: 374k, False: 0]
  ------------------
 3746|   374k|                     const auto prefix = ctx.line_prefix_before(line_start);
 3747|   374k|                     if (prefix.has_tab) {
  ------------------
  |  Branch (3747:26): [True: 214, False: 374k]
  ------------------
 3748|    214|                        ctx.error = error_code::syntax_error;
 3749|    214|                        return;
 3750|    214|                     }
 3751|       |
 3752|   374k|                     discovered_first_key_mid_line = prefix.has_content;
 3753|   374k|                     if (mapping_indent == 0 && prefix.column > 0) {
  ------------------
  |  Branch (3753:26): [True: 371k, False: 2.43k]
  |  Branch (3753:49): [True: 274k, False: 96.9k]
  ------------------
 3754|   274k|                        discovered_first_key_visual_indent = prefix.column;
 3755|   274k|                     }
 3756|   374k|                  }
 3757|   374k|               }
 3758|   374k|            }
 3759|       |
 3760|       |            // In discovered-indent block mappings, sibling keys must stay at the same
 3761|       |            // indent level, except when the first key started mid-line (e.g. "--- k: v").
 3762|   490k|            if (discover_indent && mapping_indent >= 0 && !established_mapping_indent_this_line &&
  ------------------
  |  Branch (3762:17): [True: 489k, False: 214]
  |  Branch (3762:36): [True: 489k, False: 0]
  |  Branch (3762:59): [True: 115k, False: 374k]
  ------------------
 3763|   115k|                !discovered_first_key_mid_line) {
  ------------------
  |  Branch (3763:17): [True: 27.1k, False: 88.4k]
  ------------------
 3764|  27.1k|               if (mapping_indent == 0 && discovered_first_key_visual_indent > 0) {
  ------------------
  |  Branch (3764:20): [True: 26.8k, False: 262]
  |  Branch (3764:43): [True: 9.37k, False: 17.5k]
  ------------------
 3765|  9.37k|                  if (line_indent > discovered_first_key_visual_indent) {
  ------------------
  |  Branch (3765:23): [True: 9, False: 9.36k]
  ------------------
 3766|      9|                     ctx.error = error_code::syntax_error;
 3767|      9|                     return;
 3768|      9|                  }
 3769|  9.36k|                  if (line_indent < discovered_first_key_visual_indent) {
  ------------------
  |  Branch (3769:23): [True: 1.55k, False: 7.81k]
  ------------------
 3770|  1.55k|                     it = line_start;
 3771|  1.55k|                     return;
 3772|  1.55k|                  }
 3773|  9.36k|               }
 3774|  17.7k|               else if (line_indent > mapping_indent &&
  ------------------
  |  Branch (3774:25): [True: 549, False: 17.2k]
  ------------------
 3775|    549|                        (parent_indent < 0 || mapping_indent > 0 ||
  ------------------
  |  Branch (3775:26): [True: 37, False: 512]
  |  Branch (3775:47): [True: 1, False: 511]
  ------------------
 3776|    511|                         (parent_indent >= 0 && mapping_indent == 0 && line_indent > (parent_indent + 1)))) {
  ------------------
  |  Branch (3776:27): [True: 511, False: 0]
  |  Branch (3776:49): [True: 511, False: 0]
  |  Branch (3776:72): [True: 3, False: 508]
  ------------------
 3777|     41|                  ctx.error = error_code::syntax_error;
 3778|     41|                  return;
 3779|     41|               }
 3780|  27.1k|            }
 3781|       |
 3782|       |            // Sequence indicator check (struct case only - map parser lets key parsing
 3783|       |            // handle '- ' which produces appropriate errors for misindented items)
 3784|   488k|            if (!discover_indent && *it == '-' &&
  ------------------
  |  Branch (3784:17): [True: 0, False: 488k]
  |  Branch (3784:37): [True: 0, False: 0]
  ------------------
 3785|      0|                ((it + 1) == end || *(it + 1) == ' ' || *(it + 1) == '\t' || *(it + 1) == '\n')) {
  ------------------
  |  Branch (3785:18): [True: 0, False: 0]
  |  Branch (3785:37): [True: 0, False: 0]
  |  Branch (3785:57): [True: 0, False: 0]
  |  Branch (3785:78): [True: 0, False: 0]
  ------------------
 3786|      0|               it = line_start;
 3787|      0|               return;
 3788|      0|            }
 3789|       |
 3790|       |            // Skip indented comment lines
 3791|   488k|            if (*it == '#') {
  ------------------
  |  Branch (3791:17): [True: 0, False: 488k]
  ------------------
 3792|      0|               skip_comment(it, end);
 3793|      0|               first_key = false;
 3794|      0|               continue;
 3795|      0|            }
 3796|       |
 3797|       |            // Skip blank/empty lines after indent
 3798|   488k|            if (*it == '\n' || *it == '\r') {
  ------------------
  |  Branch (3798:17): [True: 214, False: 488k]
  |  Branch (3798:32): [True: 0, False: 488k]
  ------------------
 3799|      0|               first_key = false;
 3800|      0|               continue;
 3801|      0|            }
 3802|       |
 3803|       |            // While parsing an explicit mapping key node ('? key-node'),
 3804|       |            // a subsequent standalone ':' at the same indentation starts
 3805|       |            // the outer value indicator and must terminate this key-node map.
 3806|       |            // Keep same-line ': x' on the first key-node line valid.
 3807|   488k|            if (ctx.explicit_mapping_key_context && !established_mapping_indent_this_line && *it == ':') {
  ------------------
  |  Branch (3807:17): [True: 127k, False: 361k]
  |  Branch (3807:53): [True: 22.0k, False: 104k]
  |  Branch (3807:94): [True: 6.10k, False: 15.9k]
  ------------------
 3808|  6.10k|               const auto after_colon = it + 1;
 3809|  6.10k|               const int32_t explicit_value_indicator_indent = (parent_indent < 0) ? 0 : (parent_indent + 1);
  ------------------
  |  Branch (3809:64): [True: 5.05k, False: 1.04k]
  ------------------
 3810|  6.10k|               if ((after_colon == end || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*after_colon)]) &&
  ------------------
  |  Branch (3810:21): [True: 316, False: 5.79k]
  |  Branch (3810:43): [True: 2.19k, False: 3.59k]
  ------------------
 3811|  2.51k|                   line_indent == explicit_value_indicator_indent) {
  ------------------
  |  Branch (3811:20): [True: 566, False: 1.94k]
  ------------------
 3812|    566|                  it = line_start;
 3813|    566|                  return;
 3814|    566|               }
 3815|  6.10k|            }
 3816|       |
 3817|       |            // Process this mapping entry (key + colon + value)
 3818|   487k|            int32_t effective_line_indent = line_indent;
 3819|   487k|            if (discover_indent && established_mapping_indent_this_line &&
  ------------------
  |  Branch (3819:17): [True: 487k, False: 214]
  |  Branch (3819:36): [True: 374k, False: 113k]
  ------------------
 3820|   374k|                discovered_first_key_visual_indent > effective_line_indent &&
  ------------------
  |  Branch (3820:17): [True: 274k, False: 99.4k]
  ------------------
 3821|   274k|                !(discovered_first_key_mid_line && parent_indent < 0)) {
  ------------------
  |  Branch (3821:19): [True: 234k, False: 40.4k]
  |  Branch (3821:52): [True: 133k, False: 100k]
  ------------------
 3822|       |               // The first discovered key has no indentation of its own left to measure: it may
 3823|       |               // begin mid-line (a sequence entry's "- key: value"), or the caller may have already
 3824|       |               // consumed the line's indentation before handing the mapping over. Pass its visual
 3825|       |               // column so the entry judges its value against the key's real indent -- otherwise a
 3826|       |               // key with an empty value takes the following sibling line for nested content
 3827|       |               // (issue #2827) and same-line block scalars compute the wrong indentation.
 3828|       |               // The exception is a ROOT mapping whose first key begins mid-line, which means node
 3829|       |               // properties sit ahead of it (`!!str &a1 "foo":`): those belong to the document node
 3830|       |               // rather than to the key's column, so the measured indent stands. Conformance tests
 3831|       |               // 7FWL and HMQ5 pin that case.
 3832|   141k|               effective_line_indent = discovered_first_key_visual_indent;
 3833|   141k|            }
 3834|       |
 3835|   487k|            if (!process_entry(ctx, it, end, effective_line_indent)) {
  ------------------
  |  Branch (3835:17): [True: 7.57k, False: 480k]
  ------------------
 3836|  7.57k|               return;
 3837|  7.57k|            }
 3838|   480k|            first_key = false;
 3839|       |
 3840|   480k|            if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (3840:17): [True: 0, False: 480k]
  ------------------
 3841|      0|               return;
 3842|       |
 3843|   480k|            if constexpr (yaml::check_flow_context(Opts)) {
 3844|       |               // In flow context, an implicit "key: value" pair used as a sequence entry
 3845|       |               // ends at ',', ']', or '}'. Let the enclosing flow parser consume it.
 3846|   480k|               auto flow_end = it;
 3847|   480k|               skip_flow_ws_and_newlines(ctx, flow_end, end);
 3848|   480k|               if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (3848:20): [True: 60, False: 480k]
  ------------------
 3849|     60|                  return;
 3850|   480k|               if (flow_end != end && (*flow_end == ',' || *flow_end == ']' || *flow_end == '}')) {
  ------------------
  |  Branch (3850:20): [True: 388k, False: 92.1k]
  |  Branch (3850:40): [True: 175k, False: 212k]
  |  Branch (3850:60): [True: 7.14k, False: 205k]
  |  Branch (3850:80): [True: 52.1k, False: 152k]
  ------------------
 3851|   235k|                  it = flow_end;
 3852|   235k|                  return;
 3853|   235k|               }
 3854|   480k|            }
 3855|       |
 3856|       |            // Trailing whitespace handling (peek-ahead pattern).
 3857|       |            // After parsing, iterator may be at leading indent of next line.
 3858|       |            // Don't consume it - let the outer loop handle indent measurement.
 3859|   480k|            if (it != end) {
  ------------------
  |  Branch (3859:17): [True: 169k, False: 311k]
  ------------------
 3860|   169k|               if (*it == ' ' || *it == '\t') {
  ------------------
  |  Branch (3860:20): [True: 53.8k, False: 115k]
  |  Branch (3860:34): [True: 648, False: 114k]
  ------------------
 3861|  54.4k|                  auto peek = it;
 3862|  54.4k|                  skip_inline_ws(peek, end);
 3863|  54.4k|                  if (peek != end && *peek != '\n' && *peek != '\r' && *peek != '#') {
  ------------------
  |  Branch (3863:23): [True: 51.2k, False: 3.15k]
  |  Branch (3863:38): [True: 49.5k, False: 1.71k]
  |  Branch (3863:55): [True: 48.3k, False: 1.23k]
  |  Branch (3863:72): [True: 47.4k, False: 868]
  ------------------
 3864|  47.4k|                     continue; // At leading indent of new line
 3865|  47.4k|                  }
 3866|  54.4k|               }
 3867|   121k|               skip_inline_ws(it, end);
 3868|   121k|               if (it != end && *it == '#') {
  ------------------
  |  Branch (3868:20): [True: 118k, False: 3.15k]
  |  Branch (3868:33): [True: 9.14k, False: 109k]
  ------------------
 3869|  9.14k|                  if constexpr (std::is_pointer_v<std::decay_t<It>>) {
 3870|  9.14k|                     if (it > line_start) {
  ------------------
  |  Branch (3870:26): [True: 9.14k, False: 0]
  ------------------
 3871|  9.14k|                        const char prev = *(it - 1);
 3872|  9.14k|                        if (prev != ' ' && prev != '\t' && prev != '\n' && prev != '\r') {
  ------------------
  |  Branch (3872:29): [True: 2.20k, False: 6.93k]
  |  Branch (3872:44): [True: 1.50k, False: 699]
  |  Branch (3872:60): [True: 488, False: 1.02k]
  |  Branch (3872:76): [True: 7, False: 481]
  ------------------
 3873|      7|                           ctx.error = error_code::syntax_error;
 3874|      7|                           return;
 3875|      7|                        }
 3876|  9.14k|                     }
 3877|  9.14k|                  }
 3878|  9.14k|               }
 3879|  9.14k|               skip_comment(it, end);
 3880|   121k|               if (it != end && (*it == '\n' || *it == '\r')) {
  ------------------
  |  Branch (3880:20): [True: 118k, False: 3.20k]
  |  Branch (3880:34): [True: 35.4k, False: 83.0k]
  |  Branch (3880:49): [True: 33.4k, False: 49.6k]
  ------------------
 3881|  68.8k|                  skip_newline(it, end);
 3882|  68.8k|               }
 3883|  52.8k|               else if (it != end) {
  ------------------
  |  Branch (3883:25): [True: 49.6k, False: 3.20k]
  ------------------
 3884|       |                  // The entry stopped part way along its line with something other than
 3885|       |                  // whitespace or a comment after it -- a ':' its value could not take as a
 3886|       |                  // separator, say. The next pass measures indent as though this were the start
 3887|       |                  // of a line, so what is left of the real one is lost; reject it instead.
 3888|  49.6k|                  if constexpr (requires { ctx.line_prefix_before(it); }) {
 3889|  49.6k|                     if (ctx.line_prefix_before(it).has_content) {
  ------------------
  |  Branch (3889:26): [True: 325, False: 49.3k]
  ------------------
 3890|    325|                        ctx.error = error_code::syntax_error;
 3891|    325|                        return;
 3892|    325|                     }
 3893|  49.6k|                  }
 3894|  49.6k|               }
 3895|   121k|            }
 3896|   480k|         }
 3897|   374k|      }
_ZZN3glz4fromILj450ENS_17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES1_EEEEE2opITnDaXtlNS_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj33EEERPKcRS5_TkNS_10is_contextERNS8_12yaml_contextESB_EEvOT1_OT2_OT0_T3_ENKUlRT_RSK_SG_iE_clISE_SB_SB_EEbSO_SP_SG_i:
 4777|   487k|               ctx, it, end, int32_t(-1), [&](auto& ctx, auto& it, auto end, int32_t line_indent) -> bool {
 4778|   487k|                  auto parse_map_value = [&](val_t& val) -> bool {
 4779|   487k|                     if (it != end && !yaml::line_end_or_comment_table[static_cast<uint8_t>(*it)]) {
 4780|   487k|                        bool line_starts_with_explicit_value_indicator = false;
 4781|       |
 4782|       |                        // Inline mapping values in block context cannot start with a
 4783|       |                        // plain "key: value" pair on the same line (e.g. "a: b: c").
 4784|       |                        // Such constructs are malformed unless wrapped in flow
 4785|       |                        // delimiters ({...} / [...]) or quoted.
 4786|   487k|                        if constexpr (std::is_pointer_v<std::decay_t<decltype(it)>>) {
 4787|   487k|                           if (ctx.stream_begin) {
 4788|   487k|                              auto is_line_content_start = [&](auto pos) {
 4789|   487k|                                 return !ctx.line_prefix_before(pos).has_content;
 4790|   487k|                              };
 4791|       |
 4792|   487k|                              auto line_has_explicit_value_indicator = [&](auto pos) {
 4793|   487k|                                 const char* line = ctx.line_begin_of(pos);
 4794|   487k|                                 while (line != end && (*line == ' ' || *line == '\t')) ++line;
 4795|   487k|                                 return line != end && *line == ':';
 4796|   487k|                              };
 4797|       |
 4798|   487k|                              if (!is_line_content_start(it) &&
 4799|   487k|                                  yaml::inline_value_has_plain_mapping_indicator(it, end) &&
 4800|   487k|                                  !line_has_explicit_value_indicator(it)) {
 4801|   487k|                                 ctx.error = error_code::syntax_error;
 4802|   487k|                                 return false;
 4803|   487k|                              }
 4804|   487k|                              line_starts_with_explicit_value_indicator = line_has_explicit_value_indicator(it);
 4805|   487k|                           }
 4806|   487k|                        }
 4807|       |
 4808|   487k|                        if (*it == '-' &&
 4809|   487k|                            ((it + 1) == end || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*(it + 1))]) &&
 4810|   487k|                            !line_starts_with_explicit_value_indicator) {
 4811|       |                           // "key: - item" is not valid block sequence syntax.
 4812|   487k|                           ctx.error = error_code::syntax_error;
 4813|   487k|                           return false;
 4814|   487k|                        }
 4815|       |
 4816|   487k|                        if (!ctx.push_indent(line_indent + 1)) [[unlikely]]
 4817|   487k|                           return false;
 4818|   487k|                        from<YAML, val_t>::template op<Opts>(val, ctx, it, end);
 4819|   487k|                        ctx.pop_indent();
 4820|   487k|                     }
 4821|   487k|                     else {
 4822|   487k|                        int32_t nested_indent = yaml::detect_nested_value_indent(ctx, it, end, line_indent);
 4823|   487k|                        if (nested_indent >= 0) {
 4824|   487k|                           yaml::skip_to_content(it, end);
 4825|   487k|                           if (it != end && *it == ':' && (it + 1) != end && *(it + 1) == '\t') {
 4826|   487k|                              ctx.error = error_code::syntax_error;
 4827|   487k|                              return false;
 4828|   487k|                           }
 4829|       |                           // A struct value reads the pushed indent as its own key column;
 4830|       |                           // every other value type reads it as the enclosing baseline.
 4831|   487k|                           const int32_t value_indent =
 4832|   487k|                              yaml::receives_block_mapping_column<val_t>() ? nested_indent : nested_indent - 1;
 4833|   487k|                           if (!ctx.push_indent(value_indent)) [[unlikely]]
 4834|   487k|                              return false;
 4835|   487k|                           from<YAML, val_t>::template op<Opts>(val, ctx, it, end);
 4836|   487k|                           ctx.pop_indent();
 4837|   487k|                        }
 4838|   487k|                     }
 4839|   487k|                     return !bool(ctx.error);
 4840|   487k|                  };
 4841|       |
 4842|       |                  // Explicit key entry form:
 4843|       |                  // ? key
 4844|       |                  // : value
 4845|   487k|                  if (*it == '?' && ((it + 1) != end) && *(it + 1) == '\t') {
  ------------------
  |  Branch (4845:23): [True: 192k, False: 295k]
  |  Branch (4845:37): [True: 191k, False: 565]
  |  Branch (4845:58): [True: 1, False: 191k]
  ------------------
 4846|      1|                     ctx.error = error_code::syntax_error;
 4847|      1|                     return false;
 4848|      1|                  }
 4849|   487k|                  if (*it == '?' && ((it + 1) == end || *(it + 1) == ' ' || *(it + 1) == '\n' || *(it + 1) == '\r')) {
  ------------------
  |  Branch (4849:23): [True: 192k, False: 295k]
  |  Branch (4849:38): [True: 565, False: 191k]
  |  Branch (4849:57): [True: 80.6k, False: 110k]
  |  Branch (4849:77): [True: 82.1k, False: 28.7k]
  |  Branch (4849:98): [True: 21.9k, False: 6.77k]
  ------------------
 4850|   185k|                     ++it; // skip '?'
 4851|   185k|                     yaml::skip_inline_ws(it, end);
 4852|       |
 4853|   185k|                     const int32_t explicit_value_indicator_indent =
 4854|   185k|                        (ctx.current_indent() < 0) ? 0 : (ctx.current_indent() + 1);
  ------------------
  |  Branch (4854:25): [True: 110k, False: 74.7k]
  ------------------
 4855|       |
 4856|   185k|                     key_t key{};
 4857|   185k|                     if constexpr (std::same_as<std::remove_cvref_t<key_t>, std::string>) {
 4858|   185k|                        auto to_string_key = [&](glz::generic& key_node) {
 4859|   185k|                           return yaml::materialize_key(key, key_node, ctx);
 4860|   185k|                        };
 4861|       |
 4862|   185k|                        auto key_it = it;
 4863|   185k|                        yaml::skip_inline_ws(key_it, end);
 4864|       |
 4865|   185k|                        auto content = key_it;
 4866|   185k|                        yaml::skip_to_content(content, end);
 4867|   185k|                        bool handled_anchor_only_empty_key = false;
 4868|       |
 4869|       |                        // Anchor on an empty explicit key node:
 4870|       |                        //   ? &a
 4871|       |                        //   : value
 4872|   185k|                        if (content != end && *content == '&') {
  ------------------
  |  Branch (4872:29): [True: 182k, False: 2.97k]
  |  Branch (4872:47): [True: 55.8k, False: 126k]
  ------------------
 4873|  55.8k|                           auto anchor_probe = content + 1;
 4874|  55.8k|                           auto anchor_name = yaml::parse_anchor_name(anchor_probe, end);
 4875|  55.8k|                           if (!anchor_name.empty()) {
  ------------------
  |  Branch (4875:32): [True: 55.8k, False: 8]
  ------------------
 4876|  55.8k|                              auto after_anchor = anchor_probe;
 4877|  55.8k|                              yaml::skip_inline_ws(after_anchor, end);
 4878|       |
 4879|  55.8k|                              auto value_indicator = after_anchor;
 4880|  55.8k|                              if (value_indicator != end && *value_indicator == ':') {
  ------------------
  |  Branch (4880:35): [True: 53.7k, False: 2.05k]
  |  Branch (4880:61): [True: 3.93k, False: 49.8k]
  ------------------
 4881|  3.93k|                                 key.clear();
 4882|  3.93k|                                 ctx.anchors[std::string(anchor_name)] = {content, content, ctx.current_indent()};
 4883|  3.93k|                                 it = value_indicator;
 4884|  3.93k|                                 handled_anchor_only_empty_key = true;
 4885|  3.93k|                              }
 4886|  51.9k|                              else {
 4887|  51.9k|                                 if (value_indicator != end && *value_indicator == '#') {
  ------------------
  |  Branch (4887:38): [True: 49.8k, False: 2.05k]
  |  Branch (4887:64): [True: 1.74k, False: 48.1k]
  ------------------
 4888|  1.74k|                                    yaml::skip_comment(value_indicator, end);
 4889|  1.74k|                                 }
 4890|  51.9k|                                 if (value_indicator != end && (*value_indicator == '\n' || *value_indicator == '\r')) {
  ------------------
  |  Branch (4890:38): [True: 49.8k, False: 2.06k]
  |  Branch (4890:65): [True: 16.0k, False: 33.7k]
  |  Branch (4890:93): [True: 10.6k, False: 23.1k]
  ------------------
 4891|  26.7k|                                    yaml::skip_newline(value_indicator, end);
 4892|  26.7k|                                    auto value_line = value_indicator;
 4893|  26.7k|                                    int32_t value_indent = yaml::measure_indent(value_line, end, ctx);
 4894|  26.7k|                                    if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4894:41): [True: 1, False: 26.7k]
  ------------------
 4895|      1|                                       return false;
 4896|  26.7k|                                    if (value_line != end && *value_line == ':' &&
  ------------------
  |  Branch (4896:41): [True: 26.0k, False: 676]
  |  Branch (4896:62): [True: 4.40k, False: 21.6k]
  ------------------
 4897|  4.40k|                                        value_indent == explicit_value_indicator_indent) {
  ------------------
  |  Branch (4897:41): [True: 4.40k, False: 5]
  ------------------
 4898|  4.40k|                                       key.clear();
 4899|  4.40k|                                       ctx.anchors[std::string(anchor_name)] = {content, content, ctx.current_indent()};
 4900|  4.40k|                                       it = value_line;
 4901|  4.40k|                                       handled_anchor_only_empty_key = true;
 4902|  4.40k|                                    }
 4903|  22.3k|                                    else if (value_line != end && *value_line == ':') {
  ------------------
  |  Branch (4903:46): [True: 21.6k, False: 676]
  |  Branch (4903:67): [True: 5, False: 21.6k]
  ------------------
 4904|       |                                       // In explicit-key form ("? &a"), a following ':'
 4905|       |                                       // starts the outer value indicator only at the same
 4906|       |                                       // indentation. A deeper-indented ': value' is malformed.
 4907|      5|                                       ctx.error = error_code::syntax_error;
 4908|      5|                                       return false;
 4909|      5|                                    }
 4910|  26.7k|                                 }
 4911|  51.9k|                              }
 4912|  55.8k|                           }
 4913|  55.8k|                        }
 4914|       |
 4915|   185k|                        const bool key_content_spans_lines = [&] {
 4916|   185k|                           auto scan = key_it;
 4917|   185k|                           while (scan != content && scan != end) {
 4918|   185k|                              if (*scan == '\n' || *scan == '\r') return true;
 4919|   185k|                              ++scan;
 4920|   185k|                           }
 4921|   185k|                           return false;
 4922|   185k|                        }();
 4923|       |
 4924|   185k|                        if (handled_anchor_only_empty_key) {
  ------------------
  |  Branch (4924:29): [True: 8.34k, False: 176k]
  ------------------
 4925|       |                           // 'it' already points to the explicit value indicator ':'
 4926|  8.34k|                        }
 4927|   176k|                        else if (content == end || (*content == ':' && key_content_spans_lines)) {
  ------------------
  |  Branch (4927:34): [True: 2.97k, False: 173k]
  |  Branch (4927:53): [True: 3.68k, False: 170k]
  |  Branch (4927:72): [True: 1.57k, False: 2.10k]
  ------------------
 4928|  4.54k|                           key.clear();
 4929|  4.54k|                           it = content;
 4930|  4.54k|                        }
 4931|   172k|                        else {
 4932|       |                           // Explicit mapping keys ('? key-node') are full YAML nodes.
 4933|       |                           // Parse the key node structurally (not via plain-key scanning)
 4934|       |                           // so inputs like '? []: x' and '? JSON: like' are interpreted
 4935|       |                           // as complex keys, not split into implicit key/value pairs.
 4936|   172k|                           auto key_node_it = content;
 4937|   172k|                           auto key_node_end = end;
 4938|   172k|                           if constexpr (std::is_pointer_v<std::decay_t<It>>) {
 4939|       |                              // In explicit-key form, a following standalone ':'
 4940|       |                              // line (same or lower indentation) belongs to the
 4941|       |                              // outer mapping value, not the key node itself.
 4942|   172k|                              auto scan = content;
 4943|  2.63M|                              while (scan != end) {
  ------------------
  |  Branch (4943:38): [True: 2.60M, False: 28.6k]
  ------------------
 4944|   109M|                                 while (scan != end && *scan != '\n' && *scan != '\r') {
  ------------------
  |  Branch (4944:41): [True: 109M, False: 110k]
  |  Branch (4944:56): [True: 107M, False: 1.57M]
  |  Branch (4944:73): [True: 106M, False: 920k]
  ------------------
 4945|   106M|                                    ++scan;
 4946|   106M|                                 }
 4947|  2.60M|                                 if (scan == end) {
  ------------------
  |  Branch (4947:38): [True: 110k, False: 2.49M]
  ------------------
 4948|   110k|                                    break;
 4949|   110k|                                 }
 4950|       |
 4951|  2.49M|                                 yaml::skip_newline(scan, end);
 4952|  2.49M|                                 auto line_start = scan;
 4953|       |
 4954|  2.49M|                                 int32_t indicator_indent = 0;
 4955|  3.27M|                                 while (scan != end && *scan == ' ') {
  ------------------
  |  Branch (4955:41): [True: 3.24M, False: 28.6k]
  |  Branch (4955:56): [True: 777k, False: 2.46M]
  ------------------
 4956|   777k|                                    ++indicator_indent;
 4957|   777k|                                    ++scan;
 4958|   777k|                                 }
 4959|       |
 4960|  2.49M|                                 if (scan != end && *scan == ':') {
  ------------------
  |  Branch (4960:38): [True: 2.46M, False: 28.6k]
  |  Branch (4960:53): [True: 88.0k, False: 2.38M]
  ------------------
 4961|  88.0k|                                    const auto after_colon = scan + 1;
 4962|  88.0k|                                    if ((after_colon == end ||
  ------------------
  |  Branch (4962:42): [True: 1.18k, False: 86.8k]
  ------------------
 4963|  86.8k|                                         yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*after_colon)]) &&
  ------------------
  |  Branch (4963:42): [True: 55.9k, False: 30.8k]
  ------------------
 4964|  57.1k|                                        indicator_indent <= line_indent) {
  ------------------
  |  Branch (4964:41): [True: 32.8k, False: 24.2k]
  ------------------
 4965|  32.8k|                                       key_node_end = line_start;
 4966|  32.8k|                                       break;
 4967|  32.8k|                                    }
 4968|  88.0k|                                 }
 4969|  2.49M|                              }
 4970|   172k|                           }
 4971|       |
 4972|   172k|                           glz::generic key_node{};
 4973|   172k|                           const bool prev_explicit_mapping_key_context = ctx.explicit_mapping_key_context;
 4974|   172k|                           ctx.explicit_mapping_key_context = true;
 4975|   172k|                           from<YAML, glz::generic>::template op<Opts>(key_node, ctx, key_node_it, key_node_end);
 4976|   172k|                           ctx.explicit_mapping_key_context = prev_explicit_mapping_key_context;
 4977|   172k|                           if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4977:32): [True: 1.33k, False: 171k]
  ------------------
 4978|  1.33k|                              return false;
 4979|   171k|                           it = key_node_it;
 4980|   171k|                           if (!to_string_key(key_node)) [[unlikely]]
  ------------------
  |  Branch (4980:32): [True: 9, False: 170k]
  ------------------
 4981|      9|                              return false;
 4982|   171k|                        }
 4983|       |                     }
 4984|       |                     else {
 4985|       |                        if (it != end && !yaml::line_end_or_comment_table[static_cast<uint8_t>(*it)]) {
 4986|       |                           from<YAML, key_t>::template op<Opts>(key, ctx, it, end);
 4987|       |                           if (bool(ctx.error)) [[unlikely]]
 4988|       |                              return false;
 4989|       |                        }
 4990|       |                     }
 4991|       |
 4992|   183k|                     yaml::skip_inline_ws(it, end);
 4993|   185k|                     yaml::skip_comment(it, end);
 4994|       |
 4995|       |                     // Value indicator may appear on the next line at the same indent.
 4996|   185k|                     if (it != end && (*it == '\n' || *it == '\r')) {
  ------------------
  |  Branch (4996:26): [True: 154k, False: 30.9k]
  |  Branch (4996:40): [True: 12.5k, False: 141k]
  |  Branch (4996:55): [True: 20.9k, False: 120k]
  ------------------
 4997|  33.5k|                        auto probe = it;
 4998|  33.5k|                        bool found_value_indicator = false;
 4999|       |
 5000|  63.1k|                        while (probe != end && (*probe == '\n' || *probe == '\r')) {
  ------------------
  |  Branch (5000:32): [True: 55.0k, False: 8.15k]
  |  Branch (5000:49): [True: 21.6k, False: 33.4k]
  |  Branch (5000:67): [True: 33.4k, False: 0]
  ------------------
 5001|  55.0k|                           yaml::skip_newline(probe, end);
 5002|       |
 5003|  55.0k|                           auto value_line = probe;
 5004|  55.0k|                           int32_t value_indent = yaml::measure_indent(value_line, end, ctx);
 5005|  55.0k|                           if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (5005:32): [True: 2, False: 54.9k]
  ------------------
 5006|      2|                              return false;
 5007|       |
 5008|  54.9k|                           if (value_line == end || *value_line == '\n' || *value_line == '\r') {
  ------------------
  |  Branch (5008:32): [True: 7.63k, False: 47.3k]
  |  Branch (5008:53): [True: 5.29k, False: 42.0k]
  |  Branch (5008:76): [True: 9.89k, False: 32.1k]
  ------------------
 5009|  22.8k|                              probe = value_line;
 5010|  22.8k|                              continue; // blank line
 5011|  22.8k|                           }
 5012|  32.1k|                           if (*value_line == '#') {
  ------------------
  |  Branch (5012:32): [True: 6.80k, False: 25.3k]
  ------------------
 5013|  6.80k|                              yaml::skip_comment(value_line, end);
 5014|  6.80k|                              probe = value_line;
 5015|  6.80k|                              continue; // comment-only line
 5016|  6.80k|                           }
 5017|  25.3k|                           if (*value_line == ':' && value_indent == explicit_value_indicator_indent) {
  ------------------
  |  Branch (5017:32): [True: 7.64k, False: 17.7k]
  |  Branch (5017:54): [True: 2.98k, False: 4.66k]
  ------------------
 5018|  2.98k|                              it = value_line;
 5019|  2.98k|                              found_value_indicator = true;
 5020|  2.98k|                           }
 5021|  25.3k|                           break;
 5022|  32.1k|                        }
 5023|       |
 5024|  33.5k|                        if (found_value_indicator) {
  ------------------
  |  Branch (5024:29): [True: 2.98k, False: 30.5k]
  ------------------
 5025|  2.98k|                           yaml::skip_inline_ws(it, end);
 5026|  2.98k|                        }
 5027|  33.5k|                     }
 5028|       |
 5029|   185k|                     val_t val{};
 5030|   185k|                     if (it != end && *it == ':') {
  ------------------
  |  Branch (5030:26): [True: 154k, False: 30.9k]
  |  Branch (5030:39): [True: 51.2k, False: 103k]
  ------------------
 5031|  51.2k|                        ++it;
 5032|  51.2k|                        if (it != end && *it == '\t') {
  ------------------
  |  Branch (5032:29): [True: 49.7k, False: 1.52k]
  |  Branch (5032:42): [True: 13, False: 49.7k]
  ------------------
 5033|     13|                           ctx.error = error_code::syntax_error;
 5034|     13|                           return false;
 5035|     13|                        }
 5036|  51.2k|                        if (it != end && (*it == '\n' || *it == '\r')) {
  ------------------
  |  Branch (5036:29): [True: 49.7k, False: 1.52k]
  |  Branch (5036:43): [True: 4.94k, False: 44.7k]
  |  Branch (5036:58): [True: 6.16k, False: 38.6k]
  ------------------
 5037|  11.1k|                           auto probe = it;
 5038|  11.1k|                           yaml::skip_newline(probe, end);
 5039|  20.8k|                           while (probe != end && *probe == ' ') ++probe;
  ------------------
  |  Branch (5039:35): [True: 19.5k, False: 1.22k]
  |  Branch (5039:51): [True: 9.70k, False: 9.89k]
  ------------------
 5040|  11.1k|                           if (probe != end && *probe == ':' && ((probe + 1) != end) && *(probe + 1) == '\t') {
  ------------------
  |  Branch (5040:32): [True: 9.89k, False: 1.22k]
  |  Branch (5040:48): [True: 3.17k, False: 6.71k]
  |  Branch (5040:65): [True: 3.10k, False: 70]
  |  Branch (5040:89): [True: 2, False: 3.10k]
  ------------------
 5041|      2|                              ctx.error = error_code::syntax_error;
 5042|      2|                              return false;
 5043|      2|                           }
 5044|  11.1k|                        }
 5045|  51.2k|                        yaml::skip_inline_ws(it, end);
 5046|  51.2k|                        if (!parse_map_value(val)) [[unlikely]]
  ------------------
  |  Branch (5046:29): [True: 249, False: 50.9k]
  ------------------
 5047|    249|                           return false;
 5048|  51.2k|                     }
 5049|       |
 5050|   184k|                     value.emplace(std::move(key), std::move(val));
 5051|   184k|                     return true;
 5052|   185k|                  }
 5053|       |
 5054|   302k|                  key_t key{};
 5055|   302k|                  if constexpr (std::same_as<std::remove_cvref_t<key_t>, std::string>) {
 5056|   302k|                     auto key_probe = it;
 5057|   302k|                     yaml::skip_inline_ws(key_probe, end);
 5058|   302k|                     const bool complex_flow_key = (key_probe != end && (*key_probe == '[' || *key_probe == '{'));
  ------------------
  |  Branch (5058:53): [True: 302k, False: 0]
  |  Branch (5058:74): [True: 804, False: 301k]
  |  Branch (5058:95): [True: 848, False: 300k]
  ------------------
 5059|   302k|                     if (complex_flow_key) {
  ------------------
  |  Branch (5059:26): [True: 1.65k, False: 300k]
  ------------------
 5060|  1.65k|                        glz::generic key_node{};
 5061|  1.65k|                        from<YAML, glz::generic>::template op<yaml::flow_context_on<Opts>()>(key_node, ctx, it, end);
 5062|  1.65k|                        if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (5062:29): [True: 547, False: 1.10k]
  ------------------
 5063|    547|                           return false;
 5064|  1.10k|                        if (!yaml::materialize_key(key, key_node, ctx)) [[unlikely]]
  ------------------
  |  Branch (5064:29): [True: 0, False: 1.10k]
  ------------------
 5065|      0|                           return false;
 5066|  1.10k|                     }
 5067|   300k|                     else {
 5068|   300k|                        if (!yaml::parse_yaml_key(key, ctx, it, end, false)) {
  ------------------
  |  Branch (5068:29): [True: 150, False: 300k]
  ------------------
 5069|    150|                           return false;
 5070|    150|                        }
 5071|   300k|                     }
 5072|       |                  }
 5073|       |                  else {
 5074|       |                     from<YAML, key_t>::template op<Opts>(key, ctx, it, end);
 5075|       |                     if (bool(ctx.error)) [[unlikely]]
 5076|       |                        return false;
 5077|       |                  }
 5078|       |
 5079|   301k|                  yaml::skip_inline_ws(it, end);
 5080|       |
 5081|   302k|                  if (it == end || *it != ':') {
  ------------------
  |  Branch (5081:23): [True: 1.11k, False: 301k]
  |  Branch (5081:36): [True: 211, False: 301k]
  ------------------
 5082|    627|                     ctx.error = error_code::syntax_error;
 5083|    627|                     return false;
 5084|    627|                  }
 5085|   301k|                  ++it;
 5086|   301k|                  yaml::skip_inline_ws(it, end);
 5087|       |
 5088|   301k|                  val_t val{};
 5089|   301k|                  if (!parse_map_value(val)) [[unlikely]]
  ------------------
  |  Branch (5089:23): [True: 4.63k, False: 297k]
  ------------------
 5090|  4.63k|                     return false;
 5091|       |
 5092|   297k|                  value.emplace(std::move(key), std::move(val));
 5093|   297k|                  return true;
 5094|   301k|               });
_ZZZN3glz4fromILj450ENS_17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES1_EEEEE2opITnDaXtlNS_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj33EEERPKcRS5_TkNS_10is_contextERNS8_12yaml_contextESB_EEvOT1_OT2_OT0_T3_ENKUlRT_RSK_SG_iE_clISE_SB_SB_EEbSO_SP_SG_iENKUlvE_clEv:
 4915|   185k|                        const bool key_content_spans_lines = [&] {
 4916|   185k|                           auto scan = key_it;
 4917|   205k|                           while (scan != content && scan != end) {
  ------------------
  |  Branch (4917:35): [True: 131k, False: 73.8k]
  |  Branch (4917:54): [True: 131k, False: 0]
  ------------------
 4918|   131k|                              if (*scan == '\n' || *scan == '\r') return true;
  ------------------
  |  Branch (4918:35): [True: 83.8k, False: 47.3k]
  |  Branch (4918:52): [True: 27.5k, False: 19.8k]
  ------------------
 4919|  19.8k|                              ++scan;
 4920|  19.8k|                           }
 4921|  73.8k|                           return false;
 4922|   185k|                        }();
_ZZZN3glz4fromILj450ENS_17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES1_EEEEE2opITnDaXtlNS_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj33EEERPKcRS5_TkNS_10is_contextERNS8_12yaml_contextESB_EEvOT1_OT2_OT0_T3_ENKUlRT_RSK_SG_iE_clISE_SB_SB_EEbSO_SP_SG_iENKUlRS4_E0_clESS_:
 4858|   171k|                        auto to_string_key = [&](glz::generic& key_node) {
 4859|   171k|                           return yaml::materialize_key(key, key_node, ctx);
 4860|   171k|                        };
_ZZZN3glz4fromILj450ENS_17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES1_EEEEE2opITnDaXtlNS_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj33EEERPKcRS5_TkNS_10is_contextERNS8_12yaml_contextESB_EEvOT1_OT2_OT0_T3_ENKUlRT_RSK_SG_iE_clISE_SB_SB_EEbSO_SP_SG_iENKUlRS4_E_clESS_:
 4778|   352k|                  auto parse_map_value = [&](val_t& val) -> bool {
 4779|   352k|                     if (it != end && !yaml::line_end_or_comment_table[static_cast<uint8_t>(*it)]) {
  ------------------
  |  Branch (4779:26): [True: 341k, False: 10.4k]
  |  Branch (4779:39): [True: 244k, False: 97.5k]
  ------------------
 4780|   244k|                        bool line_starts_with_explicit_value_indicator = false;
 4781|       |
 4782|       |                        // Inline mapping values in block context cannot start with a
 4783|       |                        // plain "key: value" pair on the same line (e.g. "a: b: c").
 4784|       |                        // Such constructs are malformed unless wrapped in flow
 4785|       |                        // delimiters ({...} / [...]) or quoted.
 4786|   244k|                        if constexpr (std::is_pointer_v<std::decay_t<decltype(it)>>) {
 4787|   244k|                           if (ctx.stream_begin) {
  ------------------
  |  Branch (4787:32): [True: 244k, False: 0]
  ------------------
 4788|   244k|                              auto is_line_content_start = [&](auto pos) {
 4789|   244k|                                 return !ctx.line_prefix_before(pos).has_content;
 4790|   244k|                              };
 4791|       |
 4792|   244k|                              auto line_has_explicit_value_indicator = [&](auto pos) {
 4793|   244k|                                 const char* line = ctx.line_begin_of(pos);
 4794|   244k|                                 while (line != end && (*line == ' ' || *line == '\t')) ++line;
 4795|   244k|                                 return line != end && *line == ':';
 4796|   244k|                              };
 4797|       |
 4798|   244k|                              if (!is_line_content_start(it) &&
  ------------------
  |  Branch (4798:35): [True: 244k, False: 0]
  ------------------
 4799|   244k|                                  yaml::inline_value_has_plain_mapping_indicator(it, end) &&
  ------------------
  |  Branch (4799:35): [True: 31.0k, False: 213k]
  ------------------
 4800|  31.0k|                                  !line_has_explicit_value_indicator(it)) {
  ------------------
  |  Branch (4800:35): [True: 124, False: 30.9k]
  ------------------
 4801|    124|                                 ctx.error = error_code::syntax_error;
 4802|    124|                                 return false;
 4803|    124|                              }
 4804|   244k|                              line_starts_with_explicit_value_indicator = line_has_explicit_value_indicator(it);
 4805|   244k|                           }
 4806|   244k|                        }
 4807|       |
 4808|   244k|                        if (*it == '-' &&
  ------------------
  |  Branch (4808:29): [True: 3.53k, False: 240k]
  ------------------
 4809|  3.53k|                            ((it + 1) == end || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*(it + 1))]) &&
  ------------------
  |  Branch (4809:30): [True: 358, False: 3.18k]
  |  Branch (4809:49): [True: 1.86k, False: 1.31k]
  ------------------
 4810|  2.22k|                            !line_starts_with_explicit_value_indicator) {
  ------------------
  |  Branch (4810:29): [True: 6, False: 2.22k]
  ------------------
 4811|       |                           // "key: - item" is not valid block sequence syntax.
 4812|      6|                           ctx.error = error_code::syntax_error;
 4813|      6|                           return false;
 4814|      6|                        }
 4815|       |
 4816|   244k|                        if (!ctx.push_indent(line_indent + 1)) [[unlikely]]
  ------------------
  |  Branch (4816:29): [True: 0, False: 244k]
  ------------------
 4817|      0|                           return false;
 4818|   244k|                        from<YAML, val_t>::template op<Opts>(val, ctx, it, end);
 4819|   244k|                        ctx.pop_indent();
 4820|   244k|                     }
 4821|   108k|                     else {
 4822|   108k|                        int32_t nested_indent = yaml::detect_nested_value_indent(ctx, it, end, line_indent);
 4823|   108k|                        if (nested_indent >= 0) {
  ------------------
  |  Branch (4823:29): [True: 43.2k, False: 64.7k]
  ------------------
 4824|  43.2k|                           yaml::skip_to_content(it, end);
 4825|  43.2k|                           if (it != end && *it == ':' && (it + 1) != end && *(it + 1) == '\t') {
  ------------------
  |  Branch (4825:32): [True: 43.2k, False: 0]
  |  Branch (4825:45): [True: 0, False: 43.2k]
  |  Branch (4825:59): [True: 0, False: 0]
  |  Branch (4825:78): [True: 0, False: 0]
  ------------------
 4826|      0|                              ctx.error = error_code::syntax_error;
 4827|      0|                              return false;
 4828|      0|                           }
 4829|       |                           // A struct value reads the pushed indent as its own key column;
 4830|       |                           // every other value type reads it as the enclosing baseline.
 4831|  43.2k|                           const int32_t value_indent =
 4832|  43.2k|                              yaml::receives_block_mapping_column<val_t>() ? nested_indent : nested_indent - 1;
  ------------------
  |  Branch (4832:31): [Folded, False: 43.2k]
  ------------------
 4833|  43.2k|                           if (!ctx.push_indent(value_indent)) [[unlikely]]
  ------------------
  |  Branch (4833:32): [True: 0, False: 43.2k]
  ------------------
 4834|      0|                              return false;
 4835|  43.2k|                           from<YAML, val_t>::template op<Opts>(val, ctx, it, end);
 4836|  43.2k|                           ctx.pop_indent();
 4837|  43.2k|                        }
 4838|   108k|                     }
 4839|   352k|                     return !bool(ctx.error);
 4840|   352k|                  };
_ZZZZN3glz4fromILj450ENS_17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES1_EEEEE2opITnDaXtlNS_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj33EEERPKcRS5_TkNS_10is_contextERNS8_12yaml_contextESB_EEvOT1_OT2_OT0_T3_ENKUlRT_RSK_SG_iE_clISE_SB_SB_EEbSO_SP_SG_iENKUlRS4_E_clESS_ENKUlSN_E_clISB_EEDaSN_:
 4788|   244k|                              auto is_line_content_start = [&](auto pos) {
 4789|   244k|                                 return !ctx.line_prefix_before(pos).has_content;
 4790|   244k|                              };
_ZZZZN3glz4fromILj450ENS_17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES1_EEEEE2opITnDaXtlNS_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj33EEERPKcRS5_TkNS_10is_contextERNS8_12yaml_contextESB_EEvOT1_OT2_OT0_T3_ENKUlRT_RSK_SG_iE_clISE_SB_SB_EEbSO_SP_SG_iENKUlRS4_E_clESS_ENKUlSN_E0_clISB_EEDaSN_:
 4792|   275k|                              auto line_has_explicit_value_indicator = [&](auto pos) {
 4793|   275k|                                 const char* line = ctx.line_begin_of(pos);
 4794|   454k|                                 while (line != end && (*line == ' ' || *line == '\t')) ++line;
  ------------------
  |  Branch (4794:41): [True: 454k, False: 0]
  |  Branch (4794:57): [True: 178k, False: 276k]
  |  Branch (4794:73): [True: 1.12k, False: 275k]
  ------------------
 4795|   275k|                                 return line != end && *line == ':';
  ------------------
  |  Branch (4795:41): [True: 275k, False: 0]
  |  Branch (4795:56): [True: 125k, False: 149k]
  ------------------
 4796|   275k|                              };
_ZZN3glz4fromILj450ENS_17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES1_EEEEE2opITnDaXtlNS_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj33EEERPKcRS5_TkNS_10is_contextERNS8_12yaml_contextESB_EEvOT1_OT2_OT0_T3_EN19merge_restore_guardD2Ev:
 4547|  1.19M|            {
 4548|       |               // emplace is a no-op for keys the document already wrote, so only
 4549|       |               // untouched pre-existing entries are put back.
 4550|  1.19M|               for (auto& entry : saved) {
  ------------------
  |  Branch (4550:33): [True: 0, False: 1.19M]
  ------------------
 4551|      0|                  target.emplace(entry.first, std::move(entry.second));
 4552|      0|               }
 4553|  1.19M|            }
_ZN3glz33process_yaml_variant_alternativesINSt3__17variantIJDndNS1_12basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEbNS1_6vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS6_ISD_EEEENSC_ISD_EEEEENS_21is_yaml_variant_arrayEE2opITnDaXtlNS_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj33EEERSH_TkNS_10is_contextERNSL_12yaml_contextERPKcSR_EEvOT0_OT1_OT2_T3_:
 5205|   406k|      {
 5206|   406k|         constexpr auto category_count = yaml_variant_count_v<Variant, Trait>;
 5207|       |
 5208|       |         if constexpr (category_count == 0) {
 5209|       |            ctx.error = error_code::no_matching_variant_type;
 5210|       |         }
 5211|   406k|         else if constexpr (category_count == 1) {
 5212|       |            // Only one type in this category, use it directly
 5213|   406k|            constexpr auto first_idx = yaml_variant_first_index_v<Variant, Trait>;
 5214|   406k|            using V = std::variant_alternative_t<first_idx, Variant>;
 5215|   406k|            if (!std::holds_alternative<V>(value)) value = V{};
  ------------------
  |  Branch (5215:17): [True: 406k, False: 0]
  ------------------
 5216|   406k|            from<YAML, V>::template op<Opts>(std::get<V>(value), ctx, it, end);
 5217|       |         }
 5218|       |         else {
 5219|       |            // Multiple types in this category, try each one
 5220|       |            constexpr auto N = std::variant_size_v<Variant>;
 5221|       |            bool found_match{};
 5222|       |            size_t match_idx = 0;
 5223|       |            // Only the last alternative propagates its error, so an alternative that exhausted an
 5224|       |            // expansion budget would otherwise be reported as no_matching_variant_type -- a wrong
 5225|       |            // diagnosis for a document that is hostile rather than merely the wrong shape. Held
 5226|       |            // aside and used only if nothing matched, so an alternative that does succeed later
 5227|       |            // (one that materializes no key text can still parse under a latched budget) is
 5228|       |            // unaffected.
 5229|       |            error_code expansion_error{};
 5230|       |            std::string_view expansion_message{};
 5231|       |
 5232|       |            for_each<N>([&]<size_t I>() {
 5233|       |               if (found_match) {
 5234|       |                  return;
 5235|       |               }
 5236|       |               using V = std::variant_alternative_t<I, Variant>;
 5237|       |               if constexpr (Trait<V>::value) {
 5238|       |                  auto copy_it = it;
 5239|       |                  if (!std::holds_alternative<V>(value)) {
 5240|       |                     value = V{};
 5241|       |                  }
 5242|       |
 5243|       |                  auto temp_ctx = ctx.make_speculative();
 5244|       |                  from<YAML, V>::template op<Opts>(std::get<V>(value), temp_ctx, it, end);
 5245|       |
 5246|       |                  // Charged whether or not the alternative fit: a rejected probe still replayed
 5247|       |                  // whatever aliases it reached, and an attempt that is never billed is an
 5248|       |                  // attempt that can be repeated for free.
 5249|       |                  ctx.alias_expansion_budget = temp_ctx.alias_expansion_budget;
 5250|       |                  ctx.key_expansion_budget = temp_ctx.key_expansion_budget;
 5251|       |
 5252|       |                  if (!bool(temp_ctx.error)) {
 5253|       |                     found_match = true;
 5254|       |                     ctx.anchors = std::move(temp_ctx.anchors);
 5255|       |                  }
 5256|       |                  else {
 5257|       |                     it = copy_it;
 5258|       |                     if (temp_ctx.error == error_code::exceeded_max_expansion && expansion_error == error_code::none) {
 5259|       |                        expansion_error = temp_ctx.error;
 5260|       |                        expansion_message = temp_ctx.custom_error_message;
 5261|       |                     }
 5262|       |                     if (match_idx + 1 < category_count) {
 5263|       |                        // Not the last type, continue trying
 5264|       |                     }
 5265|       |                     else {
 5266|       |                        // Last type failed, propagate error
 5267|       |                        ctx.error = temp_ctx.error;
 5268|       |                        ctx.custom_error_message = temp_ctx.custom_error_message;
 5269|       |                     }
 5270|       |                  }
 5271|       |                  ++match_idx;
 5272|       |               }
 5273|       |            });
 5274|       |
 5275|       |            if (!found_match && !bool(ctx.error)) {
 5276|       |               if (expansion_error != error_code::none) {
 5277|       |                  ctx.error = expansion_error;
 5278|       |                  ctx.custom_error_message = expansion_message;
 5279|       |               }
 5280|       |               else {
 5281|       |                  ctx.error = error_code::no_matching_variant_type;
 5282|       |               }
 5283|       |            }
 5284|       |         }
 5285|   406k|      }
_ZN3glz4fromILj450ENSt3__16vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS1_9allocatorIS6_EEEEE2opITnDaXtlNS_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj33EEERPKcRS9_TkNS_10is_contextERNSC_12yaml_contextESF_EEvOT1_OT2_OT0_T3_:
 4098|   421k|      {
 4099|   421k|         if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4099:14): [True: 0, False: 421k]
  ------------------
 4100|      0|            return;
 4101|       |
 4102|       |         // Peek ahead to check for tag (don't consume indentation for block sequences)
 4103|   421k|         auto peek = it;
 4104|   421k|         yaml::node_preamble_state preamble{};
 4105|   421k|         if (yaml::parse_node_preamble<Opts>(value, ctx, peek, end, preamble,
  ------------------
  |  Branch (4105:14): [True: 16.0k, False: 405k]
  ------------------
 4106|   421k|                                             [](yaml::yaml_tag tag) { return yaml::tag_valid_for_seq(tag); })) {
 4107|  16.0k|            it = peek;
 4108|  16.0k|            return;
 4109|  16.0k|         }
 4110|       |
 4111|   405k|         if (*peek == '[') {
  ------------------
  |  Branch (4111:14): [True: 56.2k, False: 349k]
  ------------------
 4112|       |            // Flow sequence - consume whitespace and parse
 4113|  56.2k|            it = peek;
 4114|  56.2k|            yaml::parse_flow_sequence<Opts>(value, ctx, it, end);
 4115|  56.2k|         }
 4116|   349k|         else if (*peek == '-') {
  ------------------
  |  Branch (4116:19): [True: 349k, False: 87]
  ------------------
 4117|       |            // Block sequence - don't consume leading whitespace, let parse_block_sequence handle it
 4118|       |            // But if there was a tag, we need to advance past it
 4119|   349k|            if (preamble.tag != yaml::yaml_tag::none || preamble.node_props.has_anchor) {
  ------------------
  |  Branch (4119:17): [True: 2.62k, False: 346k]
  |  Branch (4119:57): [True: 2.53k, False: 343k]
  ------------------
 4120|  5.15k|               it = peek;
 4121|  5.15k|            }
 4122|   349k|            int32_t seq_indent = ctx.current_indent();
 4123|   349k|            if (*it == '-' && ctx.current_indent() >= 0) {
  ------------------
  |  Branch (4123:17): [True: 348k, False: 443]
  |  Branch (4123:31): [True: 63.0k, False: 285k]
  ------------------
 4124|  63.0k|               seq_indent = ctx.allow_indentless_sequence ? (ctx.current_indent() > 0 ? (ctx.current_indent() - 1) : 0)
  ------------------
  |  Branch (4124:29): [True: 9.29k, False: 53.7k]
  |  Branch (4124:62): [True: 6.60k, False: 2.68k]
  ------------------
 4125|  63.0k|                                                          : (ctx.current_indent() + 1);
 4126|  63.0k|            }
 4127|   349k|            yaml::parse_block_sequence<Opts>(value, ctx, it, end, seq_indent);
 4128|   349k|         }
 4129|     87|         else {
 4130|     87|            ctx.error = error_code::syntax_error;
 4131|     87|         }
 4132|       |
 4133|   405k|         yaml::finalize_node_anchor(preamble.node_props, ctx, it);
 4134|   405k|      }
_ZN3glz4yaml19parse_node_preambleITnDaXtlNS0_9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj33EEEXtlNS0_20node_property_policyELb1EEELb0ERNSt3__16vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS4_9allocatorIS9_EEEENS0_12yaml_contextEPKcSG_ZNS_4fromILj450ESC_E2opITnDaXtlS2_Lj450ELb1ELb0ELb1ELh2ELb0ELj33EEERSG_SD_TkNS_10is_contextERSE_SG_EEvOT1_OT2_OT0_T3_EUlNS0_8yaml_tagEE_EEbSP_RSS_RT4_T5_RNS0_19node_preamble_stateEOT6_:
  465|   421k|      {
  466|   421k|         skip_inline_ws(it, end);
  467|       |
  468|   421k|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (468:14): [True: 2, False: 421k]
  ------------------
  469|      2|            if constexpr (!AllowEmptyInput) {
  470|      2|               ctx.error = error_code::unexpected_end;
  471|      2|            }
  472|      2|            return true;
  473|      2|         }
  474|       |
  475|   421k|         preamble.tag = parse_yaml_tag(it, end, ctx);
  476|   421k|         if (preamble.tag == yaml_tag::unknown) [[unlikely]] {
  ------------------
  |  Branch (476:14): [True: 1, False: 421k]
  ------------------
  477|      1|            ctx.error = error_code::syntax_error;
  478|      1|            return true;
  479|      1|         }
  480|   421k|         if (!tag_validator(preamble.tag)) [[unlikely]] {
  ------------------
  |  Branch (480:14): [True: 2, False: 421k]
  ------------------
  481|      2|            ctx.error = error_code::syntax_error;
  482|      2|            return true;
  483|      2|         }
  484|       |
  485|   421k|         skip_inline_ws(it, end);
  486|       |
  487|   421k|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (487:14): [True: 2, False: 421k]
  ------------------
  488|      2|            if constexpr (!AllowEmptyInput) {
  489|      2|               ctx.error = error_code::unexpected_end;
  490|      2|            }
  491|      2|            return true;
  492|      2|         }
  493|       |
  494|   421k|         if (parse_node_properties<Opts, PropertyPolicy>(std::forward<T>(value), ctx, it, end, preamble.node_props)) {
  ------------------
  |  Branch (494:14): [True: 16.0k, False: 405k]
  ------------------
  495|  16.0k|            return true;
  496|  16.0k|         }
  497|       |
  498|   405k|         return false;
  499|   421k|      }
_ZZN3glz4fromILj450ENSt3__16vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS1_9allocatorIS6_EEEEE2opITnDaXtlNS_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj33EEERPKcRS9_TkNS_10is_contextERNSC_12yaml_contextESF_EEvOT1_OT2_OT0_T3_ENKUlNSC_8yaml_tagEE_clESR_:
 4106|   421k|                                             [](yaml::yaml_tag tag) { return yaml::tag_valid_for_seq(tag); })) {
_ZN3glz4yaml21parse_node_propertiesITnDaXtlNS0_9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj33EEEXtlNS0_20node_property_policyELb1EEERNSt3__16vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS4_9allocatorIS9_EEEENS0_12yaml_contextEPKcSG_EEbOT1_RT2_RT3_T4_RNS0_19node_property_stateE:
  408|   421k|      {
  409|   421k|         state.has_anchor = false;
  410|   421k|         state.anchor_name.clear();
  411|   421k|         state.anchor_start = nullptr;
  412|   421k|         state.anchor_indent = ctx.current_indent();
  413|       |
  414|   421k|         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|   421k|            else {
  421|   421k|               if (handle_alias<Opts>(std::forward<T>(value), ctx, it, end)) return true;
  ------------------
  |  Branch (421:20): [True: 16.0k, False: 405k]
  ------------------
  422|   421k|            }
  423|   421k|         }
  424|       |
  425|   421k|         if (it != end && *it == '&') {
  ------------------
  |  Branch (425:14): [True: 405k, False: 16.0k]
  |  Branch (425:27): [True: 3.21k, False: 402k]
  ------------------
  426|  3.21k|            ++it;
  427|  3.21k|            auto name = parse_anchor_name(it, end);
  428|  3.21k|            if (name.empty()) {
  ------------------
  |  Branch (428:17): [True: 5, False: 3.21k]
  ------------------
  429|      5|               ctx.error = error_code::syntax_error;
  430|      5|               return true;
  431|      5|            }
  432|  3.21k|            skip_inline_ws(it, end);
  433|  3.21k|            if (it == end) {
  ------------------
  |  Branch (433:17): [True: 17, False: 3.19k]
  ------------------
  434|     17|               if constexpr (!Policy.allow_empty_after_anchor) {
  435|     17|                  ctx.error = error_code::unexpected_end;
  436|     17|               }
  437|     17|               return true;
  438|     17|            }
  439|       |            if constexpr (Policy.disallow_anchor_on_alias) {
  440|       |               if (*it == '*') {
  441|       |                  ctx.error = error_code::syntax_error;
  442|       |                  return true;
  443|       |               }
  444|       |            }
  445|  3.19k|            state.has_anchor = true;
  446|  3.19k|            state.anchor_name = std::string(name);
  447|  3.19k|            state.anchor_start = &*it;
  448|  3.19k|         }
  449|       |
  450|   421k|         return false;
  451|   421k|      }
_ZN3glz4yaml12handle_aliasITnDaXtlNS0_9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj33EEERNSt3__16vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS3_9allocatorIS8_EEEENS0_12yaml_contextEPKcSF_EEbOT0_RT1_RT2_T3_:
  300|   421k|      {
  301|   421k|         if (it == end || *it != '*') return false;
  ------------------
  |  Branch (301:14): [True: 0, False: 421k]
  |  Branch (301:27): [True: 405k, False: 16.0k]
  ------------------
  302|       |
  303|  16.0k|         ++it; // skip '*'
  304|  16.0k|         auto name = parse_anchor_name(it, end);
  305|  16.0k|         if (name.empty()) {
  ------------------
  |  Branch (305:14): [True: 2, False: 16.0k]
  ------------------
  306|      2|            ctx.error = error_code::syntax_error;
  307|      2|            return true;
  308|      2|         }
  309|       |
  310|  16.0k|         auto anchor_it = ctx.anchors.find(name);
  311|  16.0k|         if (anchor_it == ctx.anchors.end()) {
  ------------------
  |  Branch (311:14): [True: 32, False: 15.9k]
  ------------------
  312|     32|            ctx.error = error_code::syntax_error; // undefined alias
  313|     32|            return true;
  314|     32|         }
  315|       |
  316|       |         // Copied rather than referenced: the replay below can replace ctx.anchors wholesale
  317|       |         // (a speculative parse hands its own map back), which would dangle a reference here.
  318|  15.9k|         const auto span = anchor_it->second;
  319|       |
  320|       |         // Empty anchor span (anchor on null/empty node) — leave value as default
  321|  15.9k|         if (span.begin == span.end) {
  ------------------
  |  Branch (321:14): [True: 1.06k, False: 14.9k]
  ------------------
  322|  1.06k|            return true;
  323|  1.06k|         }
  324|       |
  325|       |         // An anchor is invisible to itself while it expands. A span that aliases the name it
  326|       |         // defines -- reachable because a mapping key's anchor is registered over the key text
  327|       |         // before that text is parsed -- would otherwise replay itself forever.
  328|  14.9k|         if (ctx.alias_span_is_replaying(span.begin, span.end)) [[unlikely]] {
  ------------------
  |  Branch (328:14): [True: 4, False: 14.9k]
  ------------------
  329|      4|            ctx.error = error_code::syntax_error; // cyclic alias
  330|      4|            return true;
  331|      4|         }
  332|       |
  333|       |         // Replaying an anchor re-enters the reader directly, bypassing the variant reader's
  334|       |         // depth guard, so this is the only depth accounting a chain of aliases into a
  335|       |         // non-variant target gets. The cycle check above stops the unbounded case; this bounds
  336|       |         // a legitimate but deeply chained one.
  337|  14.9k|         depth_guard guard{ctx, yaml::max_yaml_recursive_depth};
  338|  14.9k|         if (!guard) [[unlikely]]
  ------------------
  |  Branch (338:14): [True: 1, False: 14.9k]
  ------------------
  339|      1|            return true;
  340|       |
  341|  14.9k|         if (!ctx.charge_alias_expansion(static_cast<size_t>(span.end - span.begin))) [[unlikely]] {
  ------------------
  |  Branch (341:14): [True: 1, False: 14.9k]
  ------------------
  342|      1|            ctx.error = error_code::exceeded_max_expansion;
  343|      1|            ctx.custom_error_message = "alias expansion";
  344|      1|            return true;
  345|      1|         }
  346|       |
  347|  14.9k|         auto replay_it = span.begin;
  348|  14.9k|         auto replay_end = span.end;
  349|       |
  350|       |         // Save indent context and set up for replay
  351|  14.9k|         auto saved_indent_stack = std::move(ctx.indent_stack);
  352|  14.9k|         ctx.indent_stack.clear();
  353|  14.9k|         if (span.base_indent > 0) {
  ------------------
  |  Branch (353:14): [True: 1.62k, False: 13.2k]
  ------------------
  354|  1.62k|            ctx.push_indent(span.base_indent - 1);
  355|  1.62k|         }
  356|       |
  357|  14.9k|         ctx.active_alias_spans.emplace_back(span.begin, span.end);
  358|       |
  359|  14.9k|         using V = std::remove_cvref_t<T>;
  360|  14.9k|         from<YAML, V>::template op<Opts>(std::forward<T>(value), ctx, replay_it, replay_end);
  361|       |
  362|  14.9k|         ctx.active_alias_spans.pop_back();
  363|       |
  364|       |         // Restore indent context
  365|  14.9k|         ctx.indent_stack = std::move(saved_indent_stack);
  366|  14.9k|         return true;
  367|  14.9k|      }
_ZN3glz4yaml19parse_flow_sequenceITnDaXtlNS0_9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj33EEERNSt3__16vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS3_9allocatorIS8_EEEENS0_12yaml_contextEPKcSF_EEvOT0_RT1_RT2_T3_:
 2596|  56.2k|      {
 2597|  56.2k|         using V = std::remove_cvref_t<T>;
 2598|  56.2k|         using value_type = typename V::value_type;
 2599|       |
 2600|  56.2k|         struct sequence_container_adapter
 2601|  56.2k|         {
 2602|  56.2k|            size_t index = 0;
 2603|       |
 2604|  56.2k|            inline bool fixed_capacity_reached(const V& container) const noexcept
 2605|  56.2k|            {
 2606|  56.2k|               if constexpr (!resizable<V>) {
 2607|  56.2k|                  return index >= container.size();
 2608|  56.2k|               }
 2609|  56.2k|               else {
 2610|  56.2k|                  (void)container;
 2611|  56.2k|                  return false;
 2612|  56.2k|               }
 2613|  56.2k|            }
 2614|       |
 2615|  56.2k|            inline void commit_fixed_slot() noexcept { ++index; }
 2616|       |
 2617|  56.2k|            inline void append(V& container, value_type&& element) noexcept
 2618|  56.2k|            {
 2619|  56.2k|               if constexpr (emplace_backable<V>) {
 2620|  56.2k|                  container.emplace_back(std::move(element));
 2621|  56.2k|               }
 2622|  56.2k|               else if constexpr (emplaceable<V>) {
 2623|  56.2k|                  container.emplace(std::move(element));
 2624|  56.2k|               }
 2625|  56.2k|            }
 2626|  56.2k|         };
 2627|       |
 2628|  56.2k|         if (it == end || *it != '[') [[unlikely]] {
  ------------------
  |  Branch (2628:14): [True: 0, False: 56.2k]
  |  Branch (2628:27): [True: 0, False: 56.2k]
  ------------------
 2629|      0|            ctx.error = error_code::syntax_error;
 2630|      0|            return;
 2631|      0|         }
 2632|       |
 2633|       |         // Overwrite (do not append to) any pre-existing contents. Must happen
 2634|       |         // before the empty-array early return below so that `[]` also clears.
 2635|  56.2k|         clear_sequence_before_read<Opts>(value);
 2636|       |
 2637|  56.2k|         ++it; // Skip '['
 2638|       |         // Skip whitespace and newlines after opening bracket (YAML allows multi-line flow sequences)
 2639|  56.2k|         skip_flow_ws_and_newlines(ctx, it, end);
 2640|  56.2k|         if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2640:14): [True: 8, False: 56.2k]
  ------------------
 2641|      8|            return;
 2642|       |
 2643|       |         // Handle empty array
 2644|  56.2k|         if (it != end && *it == ']') {
  ------------------
  |  Branch (2644:14): [True: 55.8k, False: 409]
  |  Branch (2644:27): [True: 10.1k, False: 45.6k]
  ------------------
 2645|  10.1k|            ++it;
 2646|  10.1k|            validate_flow_node_adjacent_tail(ctx, it, end);
 2647|  10.1k|            if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2647:17): [True: 6, False: 10.1k]
  ------------------
 2648|      6|               return;
 2649|       |            if constexpr (!yaml::check_flow_context(Opts)) {
 2650|       |               if (ctx.current_indent() < 0) {
 2651|       |                  validate_root_flow_tail_after_close(ctx, it, end);
 2652|       |               }
 2653|       |            }
 2654|  10.1k|            return;
 2655|  10.1k|         }
 2656|       |
 2657|  46.0k|         bool just_saw_comma = false;
 2658|  46.0k|         sequence_container_adapter adapter{};
 2659|       |
 2660|  46.0k|         if constexpr (emplace_backable<V> || emplaceable<V>) {
 2661|       |            // Dynamic containers append items (vector-like and set-like)
 2662|  84.6k|            while (it != end) {
  ------------------
  |  Branch (2662:20): [True: 83.8k, False: 780]
  ------------------
 2663|  83.8k|               skip_flow_ws_and_newlines(ctx, it, end);
 2664|  83.8k|               if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2664:20): [True: 0, False: 83.8k]
  ------------------
 2665|      0|                  return;
 2666|       |
 2667|  83.8k|               if (it == end) [[unlikely]] {
  ------------------
  |  Branch (2667:20): [True: 0, False: 83.8k]
  ------------------
 2668|      0|                  ctx.error = error_code::unexpected_end;
 2669|      0|                  return;
 2670|      0|               }
 2671|       |
 2672|  83.8k|               if (*it == ']') {
  ------------------
  |  Branch (2672:20): [True: 6.16k, False: 77.6k]
  ------------------
 2673|  6.16k|                  if (just_saw_comma) {
  ------------------
  |  Branch (2673:23): [True: 6.16k, False: 0]
  ------------------
 2674|  6.16k|                     ++it;
 2675|  6.16k|                     validate_flow_node_adjacent_tail(ctx, it, end);
 2676|  6.16k|                     if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2676:26): [True: 7, False: 6.15k]
  ------------------
 2677|      7|                        return;
 2678|       |                     if constexpr (!yaml::check_flow_context(Opts)) {
 2679|       |                        if (ctx.current_indent() < 0) {
 2680|       |                           validate_root_flow_tail_after_close(ctx, it, end);
 2681|       |                        }
 2682|       |                     }
 2683|  6.15k|                     return;
 2684|  6.16k|                  }
 2685|      0|                  ctx.error = error_code::syntax_error;
 2686|      0|                  return;
 2687|  6.16k|               }
 2688|       |
 2689|  77.6k|               if (*it == ',' || *it == '#') {
  ------------------
  |  Branch (2689:20): [True: 174, False: 77.4k]
  |  Branch (2689:34): [True: 9, False: 77.4k]
  ------------------
 2690|    183|                  ctx.error = error_code::syntax_error;
 2691|    183|                  return;
 2692|    183|               }
 2693|  77.4k|               just_saw_comma = false;
 2694|       |
 2695|  77.4k|               value_type element{};
 2696|  77.4k|               from<YAML, value_type>::template op<flow_context_on<Opts>()>(element, ctx, it, end);
 2697|       |
 2698|  77.4k|               if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2698:20): [True: 9.55k, False: 67.9k]
  ------------------
 2699|  9.55k|                  return;
 2700|       |
 2701|  67.9k|               bool saw_line_break_before_separator = false;
 2702|  67.9k|               skip_flow_ws_and_newlines(ctx, it, end, &saw_line_break_before_separator);
 2703|  67.9k|               if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2703:20): [True: 15, False: 67.9k]
  ------------------
 2704|     15|                  return;
 2705|       |
 2706|  67.9k|               if (it != end && *it == ':') {
  ------------------
  |  Branch (2706:20): [True: 67.0k, False: 858]
  |  Branch (2706:33): [True: 10.4k, False: 56.6k]
  ------------------
 2707|       |                  // In flow sequences, implicit key-value pairs must be on a single line.
 2708|  10.4k|                  if (saw_line_break_before_separator) {
  ------------------
  |  Branch (2708:23): [True: 27, False: 10.3k]
  ------------------
 2709|     27|                     ctx.error = error_code::syntax_error;
 2710|     27|                     return;
 2711|     27|                  }
 2712|  10.3k|                  if constexpr (std::same_as<std::remove_cvref_t<value_type>, glz::generic>) {
 2713|  10.3k|                     glz::generic key_node = std::move(element);
 2714|  10.3k|                     ++it;
 2715|  10.3k|                     skip_inline_ws(it, end);
 2716|       |
 2717|  10.3k|                     glz::generic mapped{};
 2718|  10.3k|                     from<YAML, glz::generic>::template op<flow_context_on<Opts>()>(mapped, ctx, it, end);
 2719|  10.3k|                     if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2719:26): [True: 546, False: 9.83k]
  ------------------
 2720|    546|                        return;
 2721|       |
 2722|  9.83k|                     std::string key;
 2723|  9.83k|                     if (!yaml::materialize_key(key, key_node, ctx)) [[unlikely]]
  ------------------
  |  Branch (2723:26): [True: 9, False: 9.82k]
  ------------------
 2724|      9|                        return;
 2725|       |
 2726|  9.82k|                     glz::generic pair{};
 2727|  9.82k|                     pair[key] = std::move(mapped);
 2728|  9.82k|                     element = std::move(pair);
 2729|       |
 2730|  9.82k|                     skip_flow_ws_and_newlines(ctx, it, end);
 2731|  9.82k|                     if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2731:26): [True: 3, False: 9.81k]
  ------------------
 2732|      3|                        return;
 2733|       |                  }
 2734|       |                  else {
 2735|       |                     ctx.error = error_code::syntax_error;
 2736|       |                     return;
 2737|       |                  }
 2738|  10.3k|               }
 2739|       |
 2740|  67.8k|               adapter.append(value, std::move(element));
 2741|       |
 2742|  67.8k|               if (it == end) [[unlikely]] {
  ------------------
  |  Branch (2742:20): [True: 927, False: 66.9k]
  ------------------
 2743|    927|                  ctx.error = error_code::unexpected_end;
 2744|    927|                  return;
 2745|    927|               }
 2746|       |
 2747|  66.9k|               if (*it == ']') {
  ------------------
  |  Branch (2747:20): [True: 27.2k, False: 39.7k]
  ------------------
 2748|  27.2k|                  ++it;
 2749|  27.2k|                  validate_flow_node_adjacent_tail(ctx, it, end);
 2750|  27.2k|                  if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2750:23): [True: 44, False: 27.1k]
  ------------------
 2751|     44|                     return;
 2752|       |                  if constexpr (!yaml::check_flow_context(Opts)) {
 2753|       |                     if (ctx.current_indent() < 0) {
 2754|       |                        validate_root_flow_tail_after_close(ctx, it, end);
 2755|       |                     }
 2756|       |                  }
 2757|  27.1k|                  return;
 2758|  27.2k|               }
 2759|  39.7k|               else if (*it == ',') {
  ------------------
  |  Branch (2759:25): [True: 38.5k, False: 1.22k]
  ------------------
 2760|  38.5k|                  ++it;
 2761|  38.5k|                  just_saw_comma = true;
 2762|  38.5k|                  skip_flow_ws_and_newlines(ctx, it, end);
 2763|  38.5k|                  if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2763:23): [True: 15, False: 38.5k]
  ------------------
 2764|     15|                     return;
 2765|  38.5k|               }
 2766|  1.22k|               else {
 2767|  1.22k|                  ctx.error = error_code::syntax_error;
 2768|  1.22k|                  return;
 2769|  1.22k|               }
 2770|  66.9k|            }
 2771|       |         }
 2772|       |         else if constexpr (!resizable<V>) {
 2773|       |            // Fixed-size containers (std::array)
 2774|       |            while (it != end && !adapter.fixed_capacity_reached(value)) {
 2775|       |               skip_flow_ws_and_newlines(ctx, it, end);
 2776|       |               if (bool(ctx.error)) [[unlikely]]
 2777|       |                  return;
 2778|       |
 2779|       |               if (it == end) [[unlikely]] {
 2780|       |                  ctx.error = error_code::unexpected_end;
 2781|       |                  return;
 2782|       |               }
 2783|       |
 2784|       |               if (*it == ']') {
 2785|       |                  if (just_saw_comma) {
 2786|       |                     ++it;
 2787|       |                     validate_flow_node_adjacent_tail(ctx, it, end);
 2788|       |                     if (bool(ctx.error)) [[unlikely]]
 2789|       |                        return;
 2790|       |                     if constexpr (!yaml::check_flow_context(Opts)) {
 2791|       |                        if (ctx.current_indent() < 0) {
 2792|       |                           validate_root_flow_tail_after_close(ctx, it, end);
 2793|       |                        }
 2794|       |                     }
 2795|       |                     return;
 2796|       |                  }
 2797|       |                  ctx.error = error_code::syntax_error;
 2798|       |                  return;
 2799|       |               }
 2800|       |
 2801|       |               if (*it == ',' || *it == '#') {
 2802|       |                  ctx.error = error_code::syntax_error;
 2803|       |                  return;
 2804|       |               }
 2805|       |               just_saw_comma = false;
 2806|       |
 2807|       |               from<YAML, value_type>::template op<flow_context_on<Opts>()>(value[adapter.index], ctx, it, end);
 2808|       |
 2809|       |               if (bool(ctx.error)) [[unlikely]]
 2810|       |                  return;
 2811|       |
 2812|       |               adapter.commit_fixed_slot();
 2813|       |               skip_flow_ws_and_newlines(ctx, it, end);
 2814|       |               if (bool(ctx.error)) [[unlikely]]
 2815|       |                  return;
 2816|       |
 2817|       |               if (it == end) [[unlikely]] {
 2818|       |                  ctx.error = error_code::unexpected_end;
 2819|       |                  return;
 2820|       |               }
 2821|       |
 2822|       |               if (*it == ']') {
 2823|       |                  ++it;
 2824|       |                  validate_flow_node_adjacent_tail(ctx, it, end);
 2825|       |                  if (bool(ctx.error)) [[unlikely]]
 2826|       |                     return;
 2827|       |                  if constexpr (!yaml::check_flow_context(Opts)) {
 2828|       |                     if (ctx.current_indent() < 0) {
 2829|       |                        validate_root_flow_tail_after_close(ctx, it, end);
 2830|       |                     }
 2831|       |                  }
 2832|       |                  return;
 2833|       |               }
 2834|       |               else if (*it == ',') {
 2835|       |                  ++it;
 2836|       |                  just_saw_comma = true;
 2837|       |                  skip_flow_ws_and_newlines(ctx, it, end);
 2838|       |                  if (bool(ctx.error)) [[unlikely]]
 2839|       |                     return;
 2840|       |               }
 2841|       |               else {
 2842|       |                  ctx.error = error_code::syntax_error;
 2843|       |                  return;
 2844|       |               }
 2845|       |            }
 2846|       |
 2847|       |            // If we exited because the fixed-size container is full but haven't seen ']',
 2848|       |            // skip to the closing bracket to consume overflow elements.
 2849|       |            int bracket_depth = 1;
 2850|       |            while (it != end && bracket_depth > 0) {
 2851|       |               if (*it == '[') {
 2852|       |                  ++bracket_depth;
 2853|       |               }
 2854|       |               else if (*it == ']') {
 2855|       |                  --bracket_depth;
 2856|       |               }
 2857|       |               ++it;
 2858|       |            }
 2859|       |         }
 2860|       |         else {
 2861|       |            ctx.error = error_code::syntax_error;
 2862|       |            return;
 2863|       |         }
 2864|  46.0k|      }
_ZN3glz4yaml26clear_sequence_before_readITnDaXtlNS0_9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj33EEENSt3__16vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS3_9allocatorIS8_EEEEEEvRT0_:
 2580|   405k|      {
 2581|   405k|         if constexpr (emplace_backable<V> && requires { value.clear(); }) {
 2582|       |            // vector-like: honor the append_arrays option, matching json/read.hpp
 2583|   405k|            if constexpr (!check_append_arrays(Opts)) {
 2584|   405k|               value.clear();
 2585|   405k|            }
 2586|       |         }
 2587|       |         else if constexpr (emplaceable<V> && requires { value.clear(); }) {
 2588|       |            // set-like: json/read.hpp clears unconditionally; append_arrays does not apply
 2589|       |            value.clear();
 2590|       |         }
 2591|   405k|      }
_ZZN3glz4yaml19parse_flow_sequenceITnDaXtlNS0_9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj33EEERNSt3__16vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS3_9allocatorIS8_EEEENS0_12yaml_contextEPKcSF_EEvOT0_RT1_RT2_T3_EN26sequence_container_adapter6appendESC_OS8_:
 2618|  67.3k|            {
 2619|  67.3k|               if constexpr (emplace_backable<V>) {
 2620|  67.3k|                  container.emplace_back(std::move(element));
 2621|       |               }
 2622|       |               else if constexpr (emplaceable<V>) {
 2623|       |                  container.emplace(std::move(element));
 2624|       |               }
 2625|  67.3k|            }
_ZN3glz4yaml20parse_block_sequenceITnDaXtlNS0_9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj33EEERNSt3__16vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS3_9allocatorIS8_EEEENS0_12yaml_contextEPKcSF_EEvOT0_RT1_RT2_T3_i:
 3081|   349k|      {
 3082|   349k|         using V = std::remove_cvref_t<T>;
 3083|   349k|         using value_type = typename V::value_type;
 3084|       |
 3085|   349k|         struct sequence_container_adapter
 3086|   349k|         {
 3087|   349k|            size_t index = 0;
 3088|       |
 3089|   349k|            inline bool fixed_capacity_reached(const V& container) const noexcept
 3090|   349k|            {
 3091|   349k|               if constexpr (!resizable<V>) {
 3092|   349k|                  return index >= container.size();
 3093|   349k|               }
 3094|   349k|               else {
 3095|   349k|                  (void)container;
 3096|   349k|                  return false;
 3097|   349k|               }
 3098|   349k|            }
 3099|       |
 3100|   349k|            inline void commit_fixed_slot() noexcept { ++index; }
 3101|       |
 3102|   349k|            inline void append(V& container, value_type&& element) noexcept
 3103|   349k|            {
 3104|   349k|               if constexpr (emplace_backable<V>) {
 3105|   349k|                  container.emplace_back(std::move(element));
 3106|   349k|               }
 3107|   349k|               else if constexpr (emplaceable<V>) {
 3108|   349k|                  container.emplace(std::move(element));
 3109|   349k|               }
 3110|   349k|            }
 3111|   349k|         };
 3112|       |
 3113|       |         // Overwrite (do not append to) any pre-existing contents. A block
 3114|       |         // sequence is only entered once a '-' item is confirmed, so clearing
 3115|       |         // up front correctly (re)assigns the container to the parsed sequence.
 3116|   349k|         clear_sequence_before_read<Opts>(value);
 3117|       |
 3118|   349k|         sequence_container_adapter adapter{};
 3119|       |
 3120|       |         // Track if this is the first item (for handling whitespace-consumed case)
 3121|   349k|         bool first_item = true;
 3122|   349k|         bool has_pending_item_anchor = false;
 3123|   349k|         std::string pending_item_anchor_name{};
 3124|   349k|         int32_t pending_item_anchor_indent = sequence_indent;
 3125|       |
 3126|   850k|         while (it != end) {
  ------------------
  |  Branch (3126:17): [True: 712k, False: 137k]
  ------------------
 3127|       |            // For fixed-size arrays (e.g. std::array), stop when we've filled all elements.
 3128|       |            // Exclude emplaceable types (e.g. std::set) which are not resizable but grow dynamically.
 3129|       |            if constexpr (!resizable<V> && !emplaceable<V>) {
 3130|       |               if (adapter.fixed_capacity_reached(value)) {
 3131|       |                  return;
 3132|       |               }
 3133|       |            }
 3134|       |
 3135|       |            // Skip blank lines and comments, track indent
 3136|   712k|            int32_t line_indent = 0;
 3137|   712k|            int32_t dash_col = -1; // actual column of the '-' on the line
 3138|   712k|            auto line_start = it;
 3139|       |
 3140|  1.23M|            while (it != end) {
  ------------------
  |  Branch (3140:20): [True: 1.23M, False: 8.02k]
  ------------------
 3141|  1.23M|               if (*it == '#') {
  ------------------
  |  Branch (3141:20): [True: 104k, False: 1.12M]
  ------------------
 3142|   104k|                  skip_comment(it, end);
 3143|   104k|                  skip_newline(it, end);
 3144|   104k|                  line_start = it;
 3145|   104k|                  line_indent = 0;
 3146|   104k|               }
 3147|  1.12M|               else if (*it == '\n' || *it == '\r') {
  ------------------
  |  Branch (3147:25): [True: 130k, False: 994k]
  |  Branch (3147:40): [True: 133k, False: 860k]
  ------------------
 3148|   264k|                  skip_newline(it, end);
 3149|   264k|                  line_start = it;
 3150|   264k|                  line_indent = 0;
 3151|   264k|               }
 3152|   860k|               else if (*it == ' ') {
  ------------------
  |  Branch (3152:25): [True: 214k, False: 645k]
  ------------------
 3153|   214k|                  line_start = it;
 3154|   214k|                  line_indent = 0;
 3155|   581k|                  while (it != end && *it == ' ') {
  ------------------
  |  Branch (3155:26): [True: 579k, False: 1.36k]
  |  Branch (3155:39): [True: 366k, False: 213k]
  ------------------
 3156|   366k|                     ++line_indent;
 3157|   366k|                     ++it;
 3158|   366k|                  }
 3159|       |
 3160|   214k|                  bool saw_tab = false;
 3161|   222k|                  while (it != end && (*it == ' ' || *it == '\t')) {
  ------------------
  |  Branch (3161:26): [True: 220k, False: 1.80k]
  |  Branch (3161:40): [True: 3.85k, False: 216k]
  |  Branch (3161:54): [True: 3.35k, False: 213k]
  ------------------
 3162|  7.20k|                     saw_tab = saw_tab || (*it == '\t');
  ------------------
  |  Branch (3162:32): [True: 5.68k, False: 1.52k]
  |  Branch (3162:43): [True: 1.52k, False: 0]
  ------------------
 3163|  7.20k|                     ++it;
 3164|  7.20k|                  }
 3165|       |
 3166|   214k|                  if (it == end || *it == '\n' || *it == '\r' || *it == '#') {
  ------------------
  |  Branch (3166:23): [True: 1.80k, False: 213k]
  |  Branch (3166:36): [True: 2.60k, False: 210k]
  |  Branch (3166:51): [True: 41.8k, False: 168k]
  |  Branch (3166:66): [True: 101k, False: 67.2k]
  ------------------
 3167|       |                     // Blank or comment line - continue to next line
 3168|   147k|                     if (it != end && *it == '#') {
  ------------------
  |  Branch (3168:26): [True: 145k, False: 1.80k]
  |  Branch (3168:39): [True: 101k, False: 44.4k]
  ------------------
 3169|   101k|                        skip_comment(it, end);
 3170|   101k|                     }
 3171|   147k|                     line_indent = 0;
 3172|   147k|                     continue;
 3173|   147k|                  }
 3174|       |
 3175|  67.2k|                  if (saw_tab) {
  ------------------
  |  Branch (3175:23): [True: 13, False: 67.2k]
  ------------------
 3176|     13|                     ctx.error = error_code::syntax_error;
 3177|     13|                     return;
 3178|     13|                  }
 3179|  67.2k|                  break; // Found content
 3180|  67.2k|               }
 3181|   645k|               else if (*it == '\t') {
  ------------------
  |  Branch (3181:25): [True: 9.00k, False: 636k]
  ------------------
 3182|  9.00k|                  line_start = it;
 3183|  19.8k|                  while (it != end && (*it == ' ' || *it == '\t')) ++it;
  ------------------
  |  Branch (3183:26): [True: 19.1k, False: 684]
  |  Branch (3183:40): [True: 998, False: 18.1k]
  |  Branch (3183:54): [True: 9.82k, False: 8.32k]
  ------------------
 3184|  9.00k|                  if (it == end || *it == '\n' || *it == '\r' || *it == '#') {
  ------------------
  |  Branch (3184:23): [True: 684, False: 8.32k]
  |  Branch (3184:36): [True: 342, False: 7.98k]
  |  Branch (3184:51): [True: 4.36k, False: 3.62k]
  |  Branch (3184:66): [True: 3.60k, False: 16]
  ------------------
 3185|  8.99k|                     if (it != end && *it == '#') {
  ------------------
  |  Branch (3185:26): [True: 8.30k, False: 684]
  |  Branch (3185:39): [True: 3.60k, False: 4.70k]
  ------------------
 3186|  3.60k|                        skip_comment(it, end);
 3187|  3.60k|                     }
 3188|  8.99k|                     line_indent = 0;
 3189|  8.99k|                     continue;
 3190|  8.99k|                  }
 3191|     16|                  ctx.error = error_code::syntax_error;
 3192|     16|                  return;
 3193|  9.00k|               }
 3194|   636k|               else {
 3195|       |                  // At content (no leading space on this line)
 3196|       |                  // If first item and at '-', whitespace was consumed by caller;
 3197|       |                  // treat as having correct indentation
 3198|   636k|                  if (first_item && *it == '-') {
  ------------------
  |  Branch (3198:23): [True: 349k, False: 287k]
  |  Branch (3198:37): [True: 348k, False: 441]
  ------------------
 3199|   348k|                     line_indent = sequence_indent;
 3200|   348k|                     if constexpr (std::is_pointer_v<std::decay_t<It>>) {
 3201|   348k|                        if (ctx.stream_begin && it > ctx.stream_begin) {
  ------------------
  |  Branch (3201:29): [True: 348k, False: 0]
  |  Branch (3201:49): [True: 348k, False: 0]
  ------------------
 3202|   348k|                           auto probe = it;
 3203|   348k|                           int32_t leading_ws = 0;
 3204|   348k|                           bool saw_tab = false;
 3205|   638k|                           while (probe > ctx.stream_begin && (*(probe - 1) == ' ' || *(probe - 1) == '\t')) {
  ------------------
  |  Branch (3205:35): [True: 638k, False: 0]
  |  Branch (3205:64): [True: 283k, False: 354k]
  |  Branch (3205:87): [True: 5.84k, False: 348k]
  ------------------
 3206|   289k|                              --probe;
 3207|   289k|                              ++leading_ws;
 3208|   289k|                              saw_tab = saw_tab || (*probe == '\t');
  ------------------
  |  Branch (3208:41): [True: 2.83k, False: 286k]
  |  Branch (3208:52): [True: 3.23k, False: 283k]
  ------------------
 3209|   289k|                           }
 3210|   348k|                           if (probe == ctx.stream_begin || *(probe - 1) == '\n' || *(probe - 1) == '\r') {
  ------------------
  |  Branch (3210:32): [True: 0, False: 348k]
  |  Branch (3210:61): [True: 11.4k, False: 337k]
  |  Branch (3210:85): [True: 83.0k, False: 254k]
  ------------------
 3211|  94.5k|                              if (saw_tab) {
  ------------------
  |  Branch (3211:35): [True: 1, False: 94.5k]
  ------------------
 3212|      1|                                 ctx.error = error_code::syntax_error;
 3213|      1|                                 return;
 3214|      1|                              }
 3215|  94.5k|                              line_indent = (std::max)(line_indent, leading_ws);
 3216|  94.5k|                           }
 3217|   348k|                        }
 3218|   348k|                     }
 3219|   348k|                  }
 3220|   348k|                  break;
 3221|   636k|               }
 3222|  1.23M|            }
 3223|       |
 3224|   712k|            if (it == end) break;
  ------------------
  |  Branch (3224:17): [True: 8.02k, False: 704k]
  ------------------
 3225|       |
 3226|       |            // Check for document end marker
 3227|   704k|            if (at_document_end(it, end)) break;
  ------------------
  |  Branch (3227:17): [True: 2.49k, False: 701k]
  ------------------
 3228|       |
 3229|       |            // Check for dedent
 3230|   701k|            if (line_indent < sequence_indent) {
  ------------------
  |  Branch (3230:17): [True: 18.9k, False: 682k]
  ------------------
 3231|  18.9k|               it = line_start;
 3232|  18.9k|               return;
 3233|  18.9k|            }
 3234|       |
 3235|   682k|            if (*it == '&') {
  ------------------
  |  Branch (3235:17): [True: 17.7k, False: 664k]
  ------------------
 3236|       |               // Standalone anchor lines before "- item" are only supported for
 3237|       |               // indentless mapping values. At top-level block sequences these are
 3238|       |               // malformed in yaml-test-suite cases.
 3239|  17.7k|               if (!ctx.allow_indentless_sequence) {
  ------------------
  |  Branch (3239:20): [True: 3, False: 17.7k]
  ------------------
 3240|      3|                  ctx.error = error_code::syntax_error;
 3241|      3|                  return;
 3242|      3|               }
 3243|       |
 3244|  17.7k|               ++it;
 3245|  17.7k|               auto pending_name = parse_anchor_name(it, end);
 3246|  17.7k|               if (pending_name.empty()) {
  ------------------
  |  Branch (3246:20): [True: 7, False: 17.7k]
  ------------------
 3247|      7|                  ctx.error = error_code::syntax_error;
 3248|      7|                  return;
 3249|      7|               }
 3250|  17.7k|               skip_inline_ws(it, end);
 3251|  17.7k|               if (it != end && *it == '#') {
  ------------------
  |  Branch (3251:20): [True: 17.7k, False: 33]
  |  Branch (3251:33): [True: 8.47k, False: 9.25k]
  ------------------
 3252|  8.47k|                  skip_comment(it, end);
 3253|  8.47k|               }
 3254|       |
 3255|  17.7k|               has_pending_item_anchor = true;
 3256|  17.7k|               pending_item_anchor_name = std::string(pending_name);
 3257|  17.7k|               pending_item_anchor_indent = line_indent;
 3258|       |
 3259|  17.7k|               if (it == end || (*it != '\n' && *it != '\r')) {
  ------------------
  |  Branch (3259:20): [True: 44, False: 17.7k]
  |  Branch (3259:34): [True: 12.3k, False: 5.35k]
  |  Branch (3259:49): [True: 45, False: 12.3k]
  ------------------
 3260|     89|                  ctx.error = error_code::syntax_error;
 3261|     89|                  return;
 3262|     89|               }
 3263|       |
 3264|  17.6k|               skip_newline(it, end);
 3265|  17.6k|               continue;
 3266|  17.7k|            }
 3267|       |
 3268|       |            // Expect dash for sequence item
 3269|   664k|            if (*it != '-') {
  ------------------
  |  Branch (3269:17): [True: 169k, False: 495k]
  ------------------
 3270|   169k|               it = line_start;
 3271|   169k|               return;
 3272|   169k|            }
 3273|       |
 3274|       |            // Compute the actual column of this sequence dash.
 3275|       |            // This is needed by plain-scalar multiline folding to distinguish
 3276|       |            // sibling "- item" entries from deeper "- " continuation content.
 3277|   495k|            dash_col = line_indent;
 3278|   495k|            if constexpr (std::is_pointer_v<std::decay_t<It>>) {
 3279|   495k|               if (ctx.stream_begin) {
  ------------------
  |  Branch (3279:20): [True: 495k, False: 1]
  ------------------
 3280|   495k|                  dash_col = ctx.line_prefix_before(&*it).column;
 3281|   495k|               }
 3282|   495k|            }
 3283|       |
 3284|   495k|            ++it; // Skip '-'
 3285|       |
 3286|       |            // Check for valid sequence item indicator (- followed by space or newline)
 3287|   495k|            if (it != end && !yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*it)]) {
  ------------------
  |  Branch (3287:17): [True: 490k, False: 5.15k]
  |  Branch (3287:30): [True: 11.8k, False: 478k]
  ------------------
 3288|       |               // Not a sequence item (could be a number like -5)
 3289|  11.8k|               it = line_start;
 3290|  11.8k|               return;
 3291|  11.8k|            }
 3292|       |
 3293|   483k|            bool saw_tab_after_dash = false;
 3294|  2.19M|            while (it != end && (*it == ' ' || *it == '\t')) {
  ------------------
  |  Branch (3294:20): [True: 2.19M, False: 6.30k]
  |  Branch (3294:34): [True: 1.56M, False: 626k]
  |  Branch (3294:48): [True: 149k, False: 477k]
  ------------------
 3295|  1.71M|               saw_tab_after_dash = saw_tab_after_dash || (*it == '\t');
  ------------------
  |  Branch (3295:37): [True: 1.19M, False: 523k]
  |  Branch (3295:59): [True: 115k, False: 407k]
  ------------------
 3296|  1.71M|               ++it;
 3297|  1.71M|            }
 3298|       |            // A tab-separated nested "- " marker is not valid block indentation.
 3299|   483k|            if (saw_tab_after_dash && it != end && *it == '-') {
  ------------------
  |  Branch (3299:17): [True: 115k, False: 367k]
  |  Branch (3299:39): [True: 115k, False: 371]
  |  Branch (3299:52): [True: 13.1k, False: 102k]
  ------------------
 3300|  13.1k|               const auto after_dash = it + 1;
 3301|  13.1k|               if (after_dash == end || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*after_dash)]) {
  ------------------
  |  Branch (3301:20): [True: 1, False: 13.1k]
  |  Branch (3301:41): [True: 2, False: 13.1k]
  ------------------
 3302|      3|                  ctx.error = error_code::syntax_error;
 3303|      3|                  return;
 3304|      3|               }
 3305|  13.1k|            }
 3306|       |
 3307|       |            // Get reference to element to parse into
 3308|   483k|            auto parse_element = [&](auto& element) {
 3309|   483k|               const char* element_start = (it != end) ? &*it : nullptr;
 3310|       |
 3311|       |               // Check what follows
 3312|   483k|               if (it != end && !yaml::line_end_or_comment_table[static_cast<uint8_t>(*it)]) {
 3313|       |                  // Content on same line as dash - set indent to one less than content column
 3314|       |                  // This allows nested block mappings to continue parsing keys at the content indent
 3315|       |                  // For "- key: val", if dash is at column 0, content is at column 2
 3316|       |                  // We set parent indent to 1 so keys at column 2 pass the "indent > parent" check
 3317|   483k|                  if (!ctx.push_indent(line_indent + 1)) [[unlikely]]
 3318|   483k|                     return;
 3319|   483k|                  const bool prev_sequence_item_value_context = ctx.sequence_item_value_context;
 3320|   483k|                  const int32_t prev_sequence_dash_indent = ctx.sequence_dash_indent;
 3321|   483k|                  ctx.sequence_item_value_context = true;
 3322|   483k|                  ctx.sequence_dash_indent = dash_col;
 3323|   483k|                  from<YAML, value_type>::template op<Opts>(element, ctx, it, end);
 3324|   483k|                  ctx.sequence_dash_indent = prev_sequence_dash_indent;
 3325|   483k|                  ctx.sequence_item_value_context = prev_sequence_item_value_context;
 3326|   483k|                  ctx.pop_indent();
 3327|   483k|               }
 3328|   483k|               else {
 3329|       |                  // Value on next line - nested block
 3330|   483k|                  skip_ws_and_comment(it, end);
 3331|   483k|                  skip_newline(it, end);
 3332|       |
 3333|       |                  // Get indent of nested content
 3334|   483k|                  auto nested_start = it;
 3335|   483k|                  int32_t nested_indent = measure_indent(it, end, ctx);
 3336|   483k|                  if (bool(ctx.error)) [[unlikely]]
 3337|   483k|                     return;
 3338|   483k|                  it = nested_start;
 3339|       |
 3340|       |                  // Content is nested only if indented more than the current line.
 3341|       |                  // When line_indent is negative (root level), use 0 as the baseline.
 3342|       |                  // This prevents content at column 0 from being treated as nested.
 3343|   483k|                  const int32_t effective_line_indent = (line_indent < 0) ? 0 : line_indent;
 3344|   483k|                  if (nested_indent > effective_line_indent) {
 3345|       |                     // Save and set indent for nested parsing.
 3346|       |                     // A struct element reads the pushed indent as its own key column; every
 3347|       |                     // other element type reads it as the enclosing baseline, so it gets one
 3348|       |                     // less than the content indent and its content passes "indent > parent".
 3349|   483k|                     const int32_t element_indent =
 3350|   483k|                        receives_block_mapping_column<value_type>() ? nested_indent : nested_indent - 1;
 3351|   483k|                     if (!ctx.push_indent(element_indent)) [[unlikely]]
 3352|   483k|                        return;
 3353|   483k|                     const bool prev_sequence_item_value_context = ctx.sequence_item_value_context;
 3354|   483k|                     const int32_t prev_sequence_dash_indent = ctx.sequence_dash_indent;
 3355|   483k|                     ctx.sequence_item_value_context = true;
 3356|   483k|                     ctx.sequence_dash_indent = dash_col;
 3357|   483k|                     from<YAML, value_type>::template op<Opts>(element, ctx, it, end);
 3358|   483k|                     ctx.sequence_dash_indent = prev_sequence_dash_indent;
 3359|   483k|                     ctx.sequence_item_value_context = prev_sequence_item_value_context;
 3360|   483k|                     ctx.pop_indent();
 3361|   483k|                  }
 3362|       |                  // else: empty element (default constructed)
 3363|   483k|               }
 3364|       |
 3365|   483k|               if (has_pending_item_anchor && !bool(ctx.error)) {
 3366|   483k|                  const char* element_end = (it != end) ? &*it : element_start;
 3367|   483k|                  ctx.anchors[std::move(pending_item_anchor_name)] = {element_start, element_end,
 3368|   483k|                                                                      pending_item_anchor_indent};
 3369|   483k|                  has_pending_item_anchor = false;
 3370|   483k|               }
 3371|   483k|            };
 3372|       |
 3373|   483k|            if constexpr (emplace_backable<V>) {
 3374|   483k|               auto& element = value.emplace_back();
 3375|   483k|               parse_element(element);
 3376|       |            }
 3377|       |            else if constexpr (emplaceable<V>) {
 3378|       |               value_type element{};
 3379|       |               parse_element(element);
 3380|       |               if (!bool(ctx.error)) {
 3381|       |                  adapter.append(value, std::move(element));
 3382|       |               }
 3383|       |            }
 3384|       |            else if constexpr (!resizable<V>) {
 3385|       |               parse_element(value[adapter.index]);
 3386|       |               adapter.commit_fixed_slot();
 3387|       |            }
 3388|       |            else {
 3389|       |               ctx.error = error_code::syntax_error;
 3390|       |               return;
 3391|       |            }
 3392|       |
 3393|   483k|            first_item = false;
 3394|       |
 3395|   483k|            if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (3395:17): [True: 266, False: 483k]
  ------------------
 3396|    266|               return;
 3397|       |
 3398|       |            // Note: after parsing nested block content, iterator may already be
 3399|       |            // at the start of the next line. The outer loop will handle it.
 3400|   483k|         }
 3401|   349k|      }
_ZZN3glz4yaml20parse_block_sequenceITnDaXtlNS0_9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj33EEERNSt3__16vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS3_9allocatorIS8_EEEENS0_12yaml_contextEPKcSF_EEvOT0_RT1_RT2_T3_iENKUlRT_E_clIS8_EEDaSO_:
 3308|   483k|            auto parse_element = [&](auto& element) {
 3309|   483k|               const char* element_start = (it != end) ? &*it : nullptr;
  ------------------
  |  Branch (3309:44): [True: 477k, False: 6.30k]
  ------------------
 3310|       |
 3311|       |               // Check what follows
 3312|   483k|               if (it != end && !yaml::line_end_or_comment_table[static_cast<uint8_t>(*it)]) {
  ------------------
  |  Branch (3312:20): [True: 477k, False: 6.30k]
  |  Branch (3312:33): [True: 245k, False: 232k]
  ------------------
 3313|       |                  // Content on same line as dash - set indent to one less than content column
 3314|       |                  // This allows nested block mappings to continue parsing keys at the content indent
 3315|       |                  // For "- key: val", if dash is at column 0, content is at column 2
 3316|       |                  // We set parent indent to 1 so keys at column 2 pass the "indent > parent" check
 3317|   245k|                  if (!ctx.push_indent(line_indent + 1)) [[unlikely]]
  ------------------
  |  Branch (3317:23): [True: 0, False: 245k]
  ------------------
 3318|      0|                     return;
 3319|   245k|                  const bool prev_sequence_item_value_context = ctx.sequence_item_value_context;
 3320|   245k|                  const int32_t prev_sequence_dash_indent = ctx.sequence_dash_indent;
 3321|   245k|                  ctx.sequence_item_value_context = true;
 3322|   245k|                  ctx.sequence_dash_indent = dash_col;
 3323|   245k|                  from<YAML, value_type>::template op<Opts>(element, ctx, it, end);
 3324|   245k|                  ctx.sequence_dash_indent = prev_sequence_dash_indent;
 3325|   245k|                  ctx.sequence_item_value_context = prev_sequence_item_value_context;
 3326|   245k|                  ctx.pop_indent();
 3327|   245k|               }
 3328|   238k|               else {
 3329|       |                  // Value on next line - nested block
 3330|   238k|                  skip_ws_and_comment(it, end);
 3331|   238k|                  skip_newline(it, end);
 3332|       |
 3333|       |                  // Get indent of nested content
 3334|   238k|                  auto nested_start = it;
 3335|   238k|                  int32_t nested_indent = measure_indent(it, end, ctx);
 3336|   238k|                  if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (3336:23): [True: 2, False: 238k]
  ------------------
 3337|      2|                     return;
 3338|   238k|                  it = nested_start;
 3339|       |
 3340|       |                  // Content is nested only if indented more than the current line.
 3341|       |                  // When line_indent is negative (root level), use 0 as the baseline.
 3342|       |                  // This prevents content at column 0 from being treated as nested.
 3343|   238k|                  const int32_t effective_line_indent = (line_indent < 0) ? 0 : line_indent;
  ------------------
  |  Branch (3343:57): [True: 54.5k, False: 183k]
  ------------------
 3344|   238k|                  if (nested_indent > effective_line_indent) {
  ------------------
  |  Branch (3344:23): [True: 72.8k, False: 165k]
  ------------------
 3345|       |                     // Save and set indent for nested parsing.
 3346|       |                     // A struct element reads the pushed indent as its own key column; every
 3347|       |                     // other element type reads it as the enclosing baseline, so it gets one
 3348|       |                     // less than the content indent and its content passes "indent > parent".
 3349|  72.8k|                     const int32_t element_indent =
 3350|  72.8k|                        receives_block_mapping_column<value_type>() ? nested_indent : nested_indent - 1;
  ------------------
  |  Branch (3350:25): [Folded, False: 72.8k]
  ------------------
 3351|  72.8k|                     if (!ctx.push_indent(element_indent)) [[unlikely]]
  ------------------
  |  Branch (3351:26): [True: 0, False: 72.8k]
  ------------------
 3352|      0|                        return;
 3353|  72.8k|                     const bool prev_sequence_item_value_context = ctx.sequence_item_value_context;
 3354|  72.8k|                     const int32_t prev_sequence_dash_indent = ctx.sequence_dash_indent;
 3355|  72.8k|                     ctx.sequence_item_value_context = true;
 3356|  72.8k|                     ctx.sequence_dash_indent = dash_col;
 3357|  72.8k|                     from<YAML, value_type>::template op<Opts>(element, ctx, it, end);
 3358|  72.8k|                     ctx.sequence_dash_indent = prev_sequence_dash_indent;
 3359|  72.8k|                     ctx.sequence_item_value_context = prev_sequence_item_value_context;
 3360|  72.8k|                     ctx.pop_indent();
 3361|  72.8k|                  }
 3362|       |                  // else: empty element (default constructed)
 3363|   238k|               }
 3364|       |
 3365|   483k|               if (has_pending_item_anchor && !bool(ctx.error)) {
  ------------------
  |  Branch (3365:20): [True: 5.15k, False: 478k]
  |  Branch (3365:47): [True: 5.11k, False: 40]
  ------------------
 3366|  5.11k|                  const char* element_end = (it != end) ? &*it : element_start;
  ------------------
  |  Branch (3366:45): [True: 4.70k, False: 410]
  ------------------
 3367|  5.11k|                  ctx.anchors[std::move(pending_item_anchor_name)] = {element_start, element_end,
 3368|  5.11k|                                                                      pending_item_anchor_indent};
 3369|  5.11k|                  has_pending_item_anchor = false;
 3370|  5.11k|               }
 3371|   483k|            };
_ZN3glz29parse_block_mapping_or_stringINSt3__17variantIJDndNS1_12basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEbNS1_6vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS6_ISD_EEEENSC_ISD_EEEEETnDaXtlNS_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj33EEERSH_RNSI_12yaml_contextERPKcSO_EEvOT1_OT2_OT3_T4_:
 5423|   792k|   {
 5424|   792k|      if constexpr (yaml::check_flow_context(Opts)) {
 5425|       |         // In flow context, only treat plain content as an implicit "key: value"
 5426|       |         // when a mapping separator appears before the next top-level flow delimiter.
 5427|   792k|         auto could_be_implicit_flow_pair = [&](auto pos) {
 5428|       |            // Bounded by the longest implicit key the spec allows: unbounded, this probe runs
 5429|       |            // once per entry per nesting level over the whole remaining flow collection.
 5430|   792k|            const auto stop = yaml::implicit_key_scan_end(pos, end);
 5431|   792k|            int depth = 0;
 5432|   792k|            while (pos != stop) {
 5433|   792k|               const char c = *pos;
 5434|   792k|               if (c == '"' || c == '\'') {
 5435|   792k|                  const char quote = c;
 5436|   792k|                  ++pos;
 5437|   792k|                  while (pos != stop && *pos != quote) {
 5438|   792k|                     if (*pos == '\\' && quote == '"') {
 5439|   792k|                        ++pos;
 5440|   792k|                        if (pos != stop) ++pos;
 5441|   792k|                     }
 5442|   792k|                     else {
 5443|   792k|                        ++pos;
 5444|   792k|                     }
 5445|   792k|                  }
 5446|   792k|                  if (pos != stop) ++pos;
 5447|   792k|                  continue;
 5448|   792k|               }
 5449|   792k|               if (c == '[' || c == '{') {
 5450|   792k|                  ++depth;
 5451|   792k|                  ++pos;
 5452|   792k|                  continue;
 5453|   792k|               }
 5454|   792k|               if (c == ']' || c == '}') {
 5455|   792k|                  if (depth == 0) return false;
 5456|   792k|                  --depth;
 5457|   792k|                  ++pos;
 5458|   792k|                  continue;
 5459|   792k|               }
 5460|   792k|               if (c == ',' && depth == 0) return false;
 5461|   792k|               if (c == ':' && depth == 0) {
 5462|   792k|                  auto next = pos + 1;
 5463|   792k|                  return next == end || *next == ' ' || *next == '\t' || *next == '\n' || *next == '\r';
 5464|   792k|               }
 5465|   792k|               ++pos;
 5466|   792k|            }
 5467|   792k|            return false;
 5468|   792k|         };
 5469|       |
 5470|   792k|         if (could_be_implicit_flow_pair(it) || line_could_be_flow_mapping(it, end)) {
  ------------------
  |  Branch (5470:14): [True: 211k, False: 581k]
  |  Branch (5470:49): [True: 19.1k, False: 562k]
  ------------------
 5471|   230k|            if (try_parse_block_mapping_into_variant<Variant, Opts>(value, ctx, it, end)) {
  ------------------
  |  Branch (5471:17): [True: 205k, False: 25.0k]
  ------------------
 5472|   205k|               return;
 5473|   205k|            }
 5474|  25.0k|            if (bool(ctx.error)) {
  ------------------
  |  Branch (5474:17): [True: 3.21k, False: 21.8k]
  ------------------
 5475|  3.21k|               return;
 5476|  3.21k|            }
 5477|  25.0k|         }
 5478|       |
 5479|   584k|         process_yaml_variant_alternatives<Variant, is_yaml_variant_str>::template op<Opts>(value, ctx, it, end);
 5480|   584k|         return;
 5481|   792k|      }
 5482|       |
 5483|   792k|      if (try_parse_block_mapping_into_variant<Variant, Opts>(value, ctx, it, end)) {
  ------------------
  |  Branch (5483:11): [True: 0, False: 792k]
  ------------------
 5484|      0|         return;
 5485|      0|      }
 5486|       |      // If an error was set (e.g., malformed flow collection in value), don't try to parse as string
 5487|   792k|      if (bool(ctx.error)) {
  ------------------
  |  Branch (5487:11): [True: 0, False: 792k]
  ------------------
 5488|      0|         return;
 5489|      0|      }
 5490|   792k|      process_yaml_variant_alternatives<Variant, is_yaml_variant_str>::template op<Opts>(value, ctx, it, end);
 5491|   792k|   }
_ZZN3glz29parse_block_mapping_or_stringINSt3__17variantIJDndNS1_12basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEbNS1_6vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS6_ISD_EEEENSC_ISD_EEEEETnDaXtlNS_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj33EEERSH_RNSI_12yaml_contextERPKcSO_EEvOT1_OT2_OT3_T4_ENKUlT_E_clISO_EEDaSX_:
 5427|   792k|         auto could_be_implicit_flow_pair = [&](auto pos) {
 5428|       |            // Bounded by the longest implicit key the spec allows: unbounded, this probe runs
 5429|       |            // once per entry per nesting level over the whole remaining flow collection.
 5430|   792k|            const auto stop = yaml::implicit_key_scan_end(pos, end);
 5431|   792k|            int depth = 0;
 5432|  33.4M|            while (pos != stop) {
  ------------------
  |  Branch (5432:20): [True: 33.2M, False: 228k]
  ------------------
 5433|  33.2M|               const char c = *pos;
 5434|  33.2M|               if (c == '"' || c == '\'') {
  ------------------
  |  Branch (5434:20): [True: 204k, False: 33.0M]
  |  Branch (5434:32): [True: 131k, False: 32.8M]
  ------------------
 5435|   335k|                  const char quote = c;
 5436|   335k|                  ++pos;
 5437|  25.7M|                  while (pos != stop && *pos != quote) {
  ------------------
  |  Branch (5437:26): [True: 25.6M, False: 83.0k]
  |  Branch (5437:41): [True: 25.4M, False: 252k]
  ------------------
 5438|  25.4M|                     if (*pos == '\\' && quote == '"') {
  ------------------
  |  Branch (5438:26): [True: 148k, False: 25.2M]
  |  Branch (5438:42): [True: 103k, False: 44.1k]
  ------------------
 5439|   103k|                        ++pos;
 5440|   103k|                        if (pos != stop) ++pos;
  ------------------
  |  Branch (5440:29): [True: 99.9k, False: 3.91k]
  ------------------
 5441|   103k|                     }
 5442|  25.3M|                     else {
 5443|  25.3M|                        ++pos;
 5444|  25.3M|                     }
 5445|  25.4M|                  }
 5446|   335k|                  if (pos != stop) ++pos;
  ------------------
  |  Branch (5446:23): [True: 252k, False: 83.0k]
  ------------------
 5447|   335k|                  continue;
 5448|   335k|               }
 5449|  32.8M|               if (c == '[' || c == '{') {
  ------------------
  |  Branch (5449:20): [True: 1.28M, False: 31.6M]
  |  Branch (5449:32): [True: 333k, False: 31.2M]
  ------------------
 5450|  1.61M|                  ++depth;
 5451|  1.61M|                  ++pos;
 5452|  1.61M|                  continue;
 5453|  1.61M|               }
 5454|  31.2M|               if (c == ']' || c == '}') {
  ------------------
  |  Branch (5454:20): [True: 49.6k, False: 31.2M]
  |  Branch (5454:32): [True: 115k, False: 31.1M]
  ------------------
 5455|   164k|                  if (depth == 0) return false;
  ------------------
  |  Branch (5455:23): [True: 69.0k, False: 95.7k]
  ------------------
 5456|  95.7k|                  --depth;
 5457|  95.7k|                  ++pos;
 5458|  95.7k|                  continue;
 5459|   164k|               }
 5460|  31.1M|               if (c == ',' && depth == 0) return false;
  ------------------
  |  Branch (5460:20): [True: 1.38M, False: 29.7M]
  |  Branch (5460:32): [True: 219k, False: 1.16M]
  ------------------
 5461|  30.8M|               if (c == ':' && depth == 0) {
  ------------------
  |  Branch (5461:20): [True: 743k, False: 30.1M]
  |  Branch (5461:32): [True: 275k, False: 468k]
  ------------------
 5462|   275k|                  auto next = pos + 1;
 5463|   275k|                  return next == end || *next == ' ' || *next == '\t' || *next == '\n' || *next == '\r';
  ------------------
  |  Branch (5463:26): [True: 7.74k, False: 267k]
  |  Branch (5463:41): [True: 130k, False: 136k]
  |  Branch (5463:57): [True: 20.5k, False: 115k]
  |  Branch (5463:74): [True: 19.5k, False: 96.2k]
  |  Branch (5463:91): [True: 32.2k, False: 64.0k]
  ------------------
 5464|   275k|               }
 5465|  30.6M|               ++pos;
 5466|  30.6M|            }
 5467|   228k|            return false;
 5468|   792k|         };
_ZZN3glz4fromILj450ENSt3__17variantIJDndNS1_12basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEbNS1_6vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS6_ISD_EEEENSC_ISD_EEEEEE2opITnDaXtlNS_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj33EEERPKcRSH_TkNS_10is_contextERNSK_12yaml_contextESN_EEvOT1_OT2_OT0_T3_ENKUlT_E0_clISN_EEDaSZ_:
 5848|  68.8k|            auto is_word_boundary = [&](const auto ptr) {
 5849|  68.8k|               if (ptr == end) {
  ------------------
  |  Branch (5849:20): [True: 4.98k, False: 63.8k]
  ------------------
 5850|  4.98k|                  return true;
 5851|  4.98k|               }
 5852|  63.8k|               if (*ptr == ':') {
  ------------------
  |  Branch (5852:20): [True: 40.0k, False: 23.7k]
  ------------------
 5853|  40.0k|                  auto next = ptr + 1;
 5854|  40.0k|                  return (next == end) || *next == ' ' || *next == '\t' || *next == '\n' || *next == '\r';
  ------------------
  |  Branch (5854:26): [True: 3.22k, False: 36.8k]
  |  Branch (5854:43): [True: 4.61k, False: 32.2k]
  |  Branch (5854:59): [True: 11.6k, False: 20.6k]
  |  Branch (5854:76): [True: 2.37k, False: 18.2k]
  |  Branch (5854:93): [True: 10.2k, False: 8.02k]
  ------------------
 5855|  40.0k|               }
 5856|  23.7k|               return is_plain_scalar_boundary(*ptr);
 5857|  63.8k|            };
_ZZN3glz4fromILj450ENSt3__17variantIJDndNS1_12basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEbNS1_6vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS6_ISD_EEEENSC_ISD_EEEEEE2opITnDaXtlNS_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj33EEERPKcRSH_TkNS_10is_contextERNSK_12yaml_contextESN_EEvOT1_OT2_OT0_T3_ENKUlcE_clEc:
 5774|  23.7k|            auto is_plain_scalar_boundary = [](const char ch) {
 5775|  23.7k|               switch (ch) {
 5776|    511|               case ' ':
  ------------------
  |  Branch (5776:16): [True: 511, False: 23.2k]
  ------------------
 5777|  1.17k|               case '\t':
  ------------------
  |  Branch (5777:16): [True: 660, False: 23.0k]
  ------------------
 5778|  6.80k|               case '\n':
  ------------------
  |  Branch (5778:16): [True: 5.62k, False: 18.1k]
  ------------------
 5779|  7.67k|               case '\r':
  ------------------
  |  Branch (5779:16): [True: 878, False: 22.8k]
  ------------------
 5780|  13.2k|               case ',':
  ------------------
  |  Branch (5780:16): [True: 5.53k, False: 18.2k]
  ------------------
 5781|  13.7k|               case ']':
  ------------------
  |  Branch (5781:16): [True: 521, False: 23.2k]
  ------------------
 5782|  17.6k|               case '}':
  ------------------
  |  Branch (5782:16): [True: 3.94k, False: 19.8k]
  ------------------
 5783|  17.6k|                  return true;
 5784|  6.07k|               default:
  ------------------
  |  Branch (5784:16): [True: 6.07k, False: 17.6k]
  ------------------
 5785|  6.07k|                  return false;
 5786|  23.7k|               }
 5787|  23.7k|            };
_ZZN3glz4fromILj450ENSt3__17variantIJDndNS1_12basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEbNS1_6vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS6_ISD_EEEENSC_ISD_EEEEEE2opITnDaXtlNS_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj33EEERPKcRSH_TkNS_10is_contextERNSK_12yaml_contextESN_EEvOT1_OT2_OT0_T3_ENKUlT_E_clISN_EEDaSZ_:
 5789|  54.7k|            auto has_indented_block_continuation = [&](auto word_end) {
 5790|  54.7k|               if constexpr (yaml::check_flow_context(Opts)) {
 5791|  54.7k|                  return false;
 5792|  54.7k|               }
 5793|  54.7k|               if (ctx.current_indent() < 0) {
  ------------------
  |  Branch (5793:20): [True: 0, False: 54.7k]
  ------------------
 5794|      0|                  return false;
 5795|      0|               }
 5796|  54.7k|               if (word_end == end || (*word_end != '\n' && *word_end != '\r')) {
  ------------------
  |  Branch (5796:20): [True: 54.7k, False: 0]
  |  Branch (5796:40): [True: 0, False: 0]
  |  Branch (5796:61): [True: 0, False: 0]
  ------------------
 5797|      0|                  return false;
 5798|      0|               }
 5799|       |
 5800|  54.7k|               auto look = word_end;
 5801|  54.7k|               yaml::skip_newline(look, end);
 5802|  54.7k|               while (look != end) {
  ------------------
  |  Branch (5802:23): [True: 0, False: 54.7k]
  ------------------
 5803|      0|                  int32_t line_indent = 0;
 5804|      0|                  while (look != end && *look == ' ') {
  ------------------
  |  Branch (5804:26): [True: 0, False: 0]
  |  Branch (5804:41): [True: 0, False: 0]
  ------------------
 5805|      0|                     ++line_indent;
 5806|      0|                     ++look;
 5807|      0|                  }
 5808|      0|                  if (look != end && *look == '\t') {
  ------------------
  |  Branch (5808:23): [True: 0, False: 0]
  |  Branch (5808:38): [True: 0, False: 0]
  ------------------
 5809|      0|                     return false;
 5810|      0|                  }
 5811|      0|                  if (look == end || *look == '\n' || *look == '\r') {
  ------------------
  |  Branch (5811:23): [True: 0, False: 0]
  |  Branch (5811:38): [True: 0, False: 0]
  |  Branch (5811:55): [True: 0, False: 0]
  ------------------
 5812|      0|                     if (look != end) {
  ------------------
  |  Branch (5812:26): [True: 0, False: 0]
  ------------------
 5813|      0|                        yaml::skip_newline(look, end);
 5814|      0|                        continue;
 5815|      0|                     }
 5816|      0|                     return false;
 5817|      0|                  }
 5818|      0|                  if (*look == '#') {
  ------------------
  |  Branch (5818:23): [True: 0, False: 0]
  ------------------
 5819|      0|                     yaml::skip_comment(look, end);
 5820|      0|                     if (look != end && (*look == '\n' || *look == '\r')) {
  ------------------
  |  Branch (5820:26): [True: 0, False: 0]
  |  Branch (5820:42): [True: 0, False: 0]
  |  Branch (5820:59): [True: 0, False: 0]
  ------------------
 5821|      0|                        yaml::skip_newline(look, end);
 5822|      0|                        continue;
 5823|      0|                     }
 5824|      0|                     return false;
 5825|      0|                  }
 5826|       |
 5827|       |                  // If the next non-empty line is an implicit mapping entry,
 5828|       |                  // don't treat it as scalar continuation for auto-deduced
 5829|       |                  // booleans/nulls.
 5830|      0|                  {
 5831|      0|                     auto scan = look;
 5832|      0|                     while (scan != end && *scan != '\n' && *scan != '\r') {
  ------------------
  |  Branch (5832:29): [True: 0, False: 0]
  |  Branch (5832:44): [True: 0, False: 0]
  |  Branch (5832:61): [True: 0, False: 0]
  ------------------
 5833|      0|                        if (*scan == ':') {
  ------------------
  |  Branch (5833:29): [True: 0, False: 0]
  ------------------
 5834|      0|                           auto after_colon = scan + 1;
 5835|      0|                           if (after_colon == end || *after_colon == ' ' || *after_colon == '\t' ||
  ------------------
  |  Branch (5835:32): [True: 0, False: 0]
  |  Branch (5835:54): [True: 0, False: 0]
  |  Branch (5835:77): [True: 0, False: 0]
  ------------------
 5836|      0|                               *after_colon == '\n' || *after_colon == '\r') {
  ------------------
  |  Branch (5836:32): [True: 0, False: 0]
  |  Branch (5836:56): [True: 0, False: 0]
  ------------------
 5837|      0|                              return false;
 5838|      0|                           }
 5839|      0|                        }
 5840|      0|                        ++scan;
 5841|      0|                     }
 5842|      0|                  }
 5843|       |
 5844|      0|                  return line_indent > ctx.current_indent();
 5845|      0|               }
 5846|  54.7k|               return false;
 5847|  54.7k|            };
_ZN3glz36try_parse_block_mapping_into_variantINSt3__17variantIJDndNS1_12basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEbNS1_6vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS6_ISD_EEEENSC_ISD_EEEEETnDaXtlNS_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj33EEERSH_RNSI_12yaml_contextERPKcSO_EEbOT1_OT2_OT3_T4_:
 5377|   883k|   {
 5378|   883k|      using counts = yaml_variant_type_count<Variant>;
 5379|       |      if constexpr (counts::n_object == 0) {
 5380|       |         return false;
 5381|       |      }
 5382|   883k|      else {
 5383|       |         // Quick check: if no viable mapping separator in the current span,
 5384|       |         // avoid expensive speculative parse.
 5385|   883k|         const bool could_be_mapping = [&] {
 5386|   883k|            if constexpr (yaml::check_flow_context(Opts)) {
 5387|   883k|               return line_could_be_flow_mapping(it, end);
 5388|   883k|            }
 5389|   883k|            else {
 5390|   883k|               return yaml::line_could_be_block_mapping(it, end);
 5391|   883k|            }
 5392|   883k|         }();
 5393|   883k|         if (!could_be_mapping) {
  ------------------
  |  Branch (5393:14): [True: 666k, False: 217k]
  ------------------
 5394|   666k|            return false;
 5395|   666k|         }
 5396|       |         // Full parse attempt - use a temporary context that inherits indent from parent
 5397|   217k|         auto temp_ctx = ctx.make_speculative();
 5398|   217k|         process_yaml_variant_alternatives<Variant, is_yaml_variant_object>::template op<Opts>(value, temp_ctx, it,
 5399|   217k|                                                                                               end);
 5400|   217k|         ctx.alias_expansion_budget = temp_ctx.alias_expansion_budget; // charged even if rejected
 5401|   217k|         ctx.key_expansion_budget = temp_ctx.key_expansion_budget;
 5402|   217k|         if (!bool(temp_ctx.error)) {
  ------------------
  |  Branch (5402:14): [True: 211k, False: 6.26k]
  ------------------
 5403|   211k|            ctx.anchors = std::move(temp_ctx.anchors);
 5404|   211k|            return true;
 5405|   211k|         }
 5406|       |         // The line matched "key: value" pattern but parsing failed.
 5407|       |         // This indicates malformed content (e.g., unclosed flow collection),
 5408|       |         // so propagate the error rather than silently falling back to string.
 5409|  6.26k|         ctx.error = temp_ctx.error;
 5410|  6.26k|         ctx.custom_error_message = temp_ctx.custom_error_message;
 5411|  6.26k|         return false;
 5412|   217k|      }
 5413|   883k|   }
_ZZN3glz36try_parse_block_mapping_into_variantINSt3__17variantIJDndNS1_12basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEbNS1_6vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS6_ISD_EEEENSC_ISD_EEEEETnDaXtlNS_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj33EEERSH_RNSI_12yaml_contextERPKcSO_EEbOT1_OT2_OT3_T4_ENKUlvE_clEv:
 5385|   883k|         const bool could_be_mapping = [&] {
 5386|   883k|            if constexpr (yaml::check_flow_context(Opts)) {
 5387|   883k|               return line_could_be_flow_mapping(it, end);
 5388|       |            }
 5389|       |            else {
 5390|       |               return yaml::line_could_be_block_mapping(it, end);
 5391|       |            }
 5392|   883k|         }();
_ZZN3glz4fromILj450ENS_17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES1_EEEEE2opITnDaXtlNS_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj32EEERPKcRS5_TkNS_10is_contextERNS8_12yaml_contextESB_EEvOT1_OT2_OT0_T3_ENKUlRS4_E_clESN_:
 4658|   159k|               auto parse_implicit_null = [&](val_t& val) -> bool {
 4659|       |                  if constexpr (nullable_like<std::remove_cvref_t<val_t>>) {
 4660|       |                     val = {};
 4661|       |                     return true;
 4662|       |                  }
 4663|   159k|                  else if constexpr (std::same_as<std::remove_cvref_t<val_t>, glz::generic>) {
 4664|   159k|                     val = glz::generic{};
 4665|   159k|                     return true;
 4666|       |                  }
 4667|       |                  else {
 4668|       |                     static constexpr std::string_view null_value{"null"};
 4669|       |                     auto null_it = null_value.data();
 4670|       |                     from<YAML, val_t>::template op<yaml::flow_context_on<Opts>()>(
 4671|       |                        val, ctx, null_it, null_value.data() + null_value.size());
 4672|       |                     return !bool(ctx.error);
 4673|       |                  }
 4674|   159k|               };
_ZN3glz4yaml24parse_block_mapping_loopITnDaXtlNS0_9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj32EEENS0_12yaml_contextEPKcS5_ZNS_4fromILj450ENS_17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES7_EEEEE2opITnDaXtlS2_Lj450ELb1ELb0ELb1ELh2ELb0ELj32EEERS5_RSB_TkNS_10is_contextERS3_S5_EEvOT1_OT2_OT0_T3_EUlRT_RSL_SH_iE_EEvSQ_RSH_SJ_iOSN_:
 3633|   388k|      {
 3634|       |         // A tagged-variant custom alternative hands its body (at the variant's own column) to a
 3635|       |         // discover-mode reader. Honor the known indent it published so continuation/dedent are
 3636|       |         // judged against the outer parent, not the body itself. One-shot: reset on observation.
 3637|   388k|         if (ctx.forced_block_mapping_indent >= 0) {
  ------------------
  |  Branch (3637:14): [True: 0, False: 388k]
  ------------------
 3638|      0|            if (mapping_indent < 0) {
  ------------------
  |  Branch (3638:17): [True: 0, False: 0]
  ------------------
 3639|      0|               mapping_indent = ctx.forced_block_mapping_indent;
 3640|      0|            }
 3641|      0|            ctx.forced_block_mapping_indent = -1;
 3642|      0|         }
 3643|   388k|         const int32_t parent_indent = ctx.current_indent();
 3644|   388k|         const bool discover_indent = (mapping_indent < 0);
 3645|   388k|         bool first_key = !discover_indent;
 3646|   388k|         bool discovered_first_key_mid_line = false;
 3647|   388k|         int32_t discovered_first_key_visual_indent = 0;
 3648|       |
 3649|  1.00M|         while (it != end) {
  ------------------
  |  Branch (3649:17): [True: 807k, False: 198k]
  ------------------
 3650|   807k|            auto line_start = it;
 3651|   807k|            int32_t line_indent = first_key ? mapping_indent : 0;
  ------------------
  |  Branch (3651:35): [True: 0, False: 807k]
  ------------------
 3652|       |
 3653|       |            // Skip blank lines and comments, measure indent
 3654|   892k|            while (it != end) {
  ------------------
  |  Branch (3654:20): [True: 883k, False: 9.00k]
  ------------------
 3655|   883k|               if (*it == '#') {
  ------------------
  |  Branch (3655:20): [True: 14.7k, False: 868k]
  ------------------
 3656|  14.7k|                  skip_comment(it, end);
 3657|  14.7k|                  skip_newline(it, end);
 3658|  14.7k|                  first_key = false;
 3659|  14.7k|                  line_indent = 0;
 3660|  14.7k|               }
 3661|   868k|               else if (*it == '\n' || *it == '\r') {
  ------------------
  |  Branch (3661:25): [True: 13.6k, False: 855k]
  |  Branch (3661:40): [True: 45.8k, False: 809k]
  ------------------
 3662|  59.5k|                  skip_newline(it, end);
 3663|  59.5k|                  first_key = false;
 3664|  59.5k|                  line_indent = 0;
 3665|  59.5k|               }
 3666|   809k|               else if (*it == ' ') {
  ------------------
  |  Branch (3666:25): [True: 335k, False: 473k]
  ------------------
 3667|   335k|                  line_start = it;
 3668|   335k|                  line_indent = 0;
 3669|   869k|                  while (it != end && *it == ' ') {
  ------------------
  |  Branch (3669:26): [True: 867k, False: 1.35k]
  |  Branch (3669:39): [True: 533k, False: 334k]
  ------------------
 3670|   533k|                     ++line_indent;
 3671|   533k|                     ++it;
 3672|   533k|                  }
 3673|       |
 3674|   335k|                  bool saw_tab = false;
 3675|   338k|                  while (it != end && (*it == ' ' || *it == '\t')) {
  ------------------
  |  Branch (3675:26): [True: 336k, False: 1.36k]
  |  Branch (3675:40): [True: 982, False: 335k]
  |  Branch (3675:54): [True: 1.53k, False: 334k]
  ------------------
 3676|  2.51k|                     saw_tab = saw_tab || (*it == '\t');
  ------------------
  |  Branch (3676:32): [True: 1.60k, False: 909]
  |  Branch (3676:43): [True: 909, False: 0]
  ------------------
 3677|  2.51k|                     ++it;
 3678|  2.51k|                  }
 3679|       |
 3680|   335k|                  if (it == end || *it == '\n' || *it == '\r' || *it == '#') {
  ------------------
  |  Branch (3680:23): [True: 1.36k, False: 334k]
  |  Branch (3680:36): [True: 2.69k, False: 331k]
  |  Branch (3680:51): [True: 1.96k, False: 329k]
  |  Branch (3680:66): [True: 3.47k, False: 326k]
  ------------------
 3681|  9.49k|                     first_key = false;
 3682|  9.49k|                     line_indent = 0;
 3683|  9.49k|                     continue; // Blank or comment line
 3684|  9.49k|                  }
 3685|       |
 3686|   326k|                  if (saw_tab) {
  ------------------
  |  Branch (3686:23): [True: 57, False: 326k]
  ------------------
 3687|     57|                     ctx.error = error_code::syntax_error;
 3688|     57|                     return;
 3689|     57|                  }
 3690|       |
 3691|       |                  // Early dedent check
 3692|   326k|                  if (mapping_indent >= 0 && line_indent < mapping_indent) {
  ------------------
  |  Branch (3692:23): [True: 322k, False: 3.41k]
  |  Branch (3692:46): [True: 329, False: 322k]
  ------------------
 3693|    329|                     it = line_start;
 3694|    329|                     return;
 3695|    329|                  }
 3696|       |
 3697|   325k|                  first_key = false;
 3698|   325k|                  break; // Found content
 3699|   326k|               }
 3700|   473k|               else if (*it == '\t') {
  ------------------
  |  Branch (3700:25): [True: 1.56k, False: 471k]
  ------------------
 3701|  1.56k|                  line_start = it;
 3702|  6.27k|                  while (it != end && (*it == ' ' || *it == '\t')) ++it;
  ------------------
  |  Branch (3702:26): [True: 6.13k, False: 141]
  |  Branch (3702:40): [True: 1.12k, False: 5.01k]
  |  Branch (3702:54): [True: 3.59k, False: 1.42k]
  ------------------
 3703|  1.56k|                  if (it == end || *it == '\n' || *it == '\r' || *it == '#') {
  ------------------
  |  Branch (3703:23): [True: 141, False: 1.42k]
  |  Branch (3703:36): [True: 286, False: 1.13k]
  |  Branch (3703:51): [True: 567, False: 567]
  |  Branch (3703:66): [True: 478, False: 89]
  ------------------
 3704|  1.47k|                     first_key = false;
 3705|  1.47k|                     line_indent = 0;
 3706|  1.47k|                     continue; // Blank or comment-only line with tab indentation
 3707|  1.47k|                  }
 3708|     89|                  ctx.error = error_code::syntax_error;
 3709|     89|                  return;
 3710|  1.56k|               }
 3711|   471k|               else {
 3712|   471k|                  line_start = it;
 3713|   471k|                  break; // Content at column 0
 3714|   471k|               }
 3715|   883k|            }
 3716|       |
 3717|   806k|            if (it == end) break;
  ------------------
  |  Branch (3717:17): [True: 9.00k, False: 797k]
  ------------------
 3718|       |
 3719|       |            // Document boundaries terminate the current mapping in both discovered
 3720|       |            // and fixed-indent modes.
 3721|   797k|            if (at_document_end(it, end) || at_document_start(it, end)) break;
  ------------------
  |  Branch (3721:17): [True: 2.64k, False: 795k]
  |  Branch (3721:45): [True: 648, False: 794k]
  ------------------
 3722|       |
 3723|       |            // Dedent checks (skip on first key for struct case)
 3724|       |            // Must check BEFORE establishing mapping_indent so the first discovered key
 3725|       |            // isn't rejected by the parent_indent check (mapping_indent is still -1).
 3726|   794k|            if (!first_key) {
  ------------------
  |  Branch (3726:17): [True: 794k, False: 0]
  ------------------
 3727|       |               // Parent indent check for nested maps (only after mapping_indent established)
 3728|   794k|               if (discover_indent && mapping_indent >= 0 && parent_indent >= 0 && line_indent <= parent_indent) {
  ------------------
  |  Branch (3728:20): [True: 794k, False: 0]
  |  Branch (3728:39): [True: 407k, False: 387k]
  |  Branch (3728:62): [True: 212k, False: 194k]
  |  Branch (3728:84): [True: 152k, False: 60.0k]
  ------------------
 3729|   152k|                  it = line_start;
 3730|   152k|                  return;
 3731|   152k|               }
 3732|   642k|               if (mapping_indent >= 0 && line_indent < mapping_indent) {
  ------------------
  |  Branch (3732:20): [True: 254k, False: 387k]
  |  Branch (3732:43): [True: 30, False: 254k]
  ------------------
 3733|     30|                  it = line_start;
 3734|     30|                  return;
 3735|     30|               }
 3736|   642k|            }
 3737|       |
 3738|       |            // Establish mapping indent from first key (map case)
 3739|   641k|            bool established_mapping_indent_this_line = false;
 3740|   641k|            if (mapping_indent < 0) {
  ------------------
  |  Branch (3740:17): [True: 387k, False: 254k]
  ------------------
 3741|   387k|               mapping_indent = line_indent;
 3742|   387k|               established_mapping_indent_this_line = true;
 3743|   387k|               discovered_first_key_visual_indent = line_indent;
 3744|   387k|               if constexpr (std::is_pointer_v<std::decay_t<It>>) {
 3745|   387k|                  if (ctx.stream_begin && line_start > ctx.stream_begin) {
  ------------------
  |  Branch (3745:23): [True: 387k, False: 0]
  |  Branch (3745:43): [True: 383k, False: 3.57k]
  ------------------
 3746|   383k|                     const auto prefix = ctx.line_prefix_before(line_start);
 3747|   383k|                     if (prefix.has_tab) {
  ------------------
  |  Branch (3747:26): [True: 130, False: 383k]
  ------------------
 3748|    130|                        ctx.error = error_code::syntax_error;
 3749|    130|                        return;
 3750|    130|                     }
 3751|       |
 3752|   383k|                     discovered_first_key_mid_line = prefix.has_content;
 3753|   383k|                     if (mapping_indent == 0 && prefix.column > 0) {
  ------------------
  |  Branch (3753:26): [True: 380k, False: 3.41k]
  |  Branch (3753:49): [True: 308k, False: 71.4k]
  ------------------
 3754|   308k|                        discovered_first_key_visual_indent = prefix.column;
 3755|   308k|                     }
 3756|   383k|                  }
 3757|   387k|               }
 3758|   387k|            }
 3759|       |
 3760|       |            // In discovered-indent block mappings, sibling keys must stay at the same
 3761|       |            // indent level, except when the first key started mid-line (e.g. "--- k: v").
 3762|   641k|            if (discover_indent && mapping_indent >= 0 && !established_mapping_indent_this_line &&
  ------------------
  |  Branch (3762:17): [True: 641k, False: 130]
  |  Branch (3762:36): [True: 641k, False: 0]
  |  Branch (3762:59): [True: 254k, False: 387k]
  ------------------
 3763|   254k|                !discovered_first_key_mid_line) {
  ------------------
  |  Branch (3763:17): [True: 58.4k, False: 196k]
  ------------------
 3764|  58.4k|               if (mapping_indent == 0 && discovered_first_key_visual_indent > 0) {
  ------------------
  |  Branch (3764:20): [True: 58.1k, False: 321]
  |  Branch (3764:43): [True: 38.9k, False: 19.2k]
  ------------------
 3765|  38.9k|                  if (line_indent > discovered_first_key_visual_indent) {
  ------------------
  |  Branch (3765:23): [True: 51, False: 38.8k]
  ------------------
 3766|     51|                     ctx.error = error_code::syntax_error;
 3767|     51|                     return;
 3768|     51|                  }
 3769|  38.8k|                  if (line_indent < discovered_first_key_visual_indent) {
  ------------------
  |  Branch (3769:23): [True: 1.04k, False: 37.8k]
  ------------------
 3770|  1.04k|                     it = line_start;
 3771|  1.04k|                     return;
 3772|  1.04k|                  }
 3773|  38.8k|               }
 3774|  19.5k|               else if (line_indent > mapping_indent &&
  ------------------
  |  Branch (3774:25): [True: 1.16k, False: 18.4k]
  ------------------
 3775|  1.16k|                        (parent_indent < 0 || mapping_indent > 0 ||
  ------------------
  |  Branch (3775:26): [True: 192, False: 971]
  |  Branch (3775:47): [True: 2, False: 969]
  ------------------
 3776|    969|                         (parent_indent >= 0 && mapping_indent == 0 && line_indent > (parent_indent + 1)))) {
  ------------------
  |  Branch (3776:27): [True: 969, False: 0]
  |  Branch (3776:49): [True: 969, False: 0]
  |  Branch (3776:72): [True: 5, False: 964]
  ------------------
 3777|    199|                  ctx.error = error_code::syntax_error;
 3778|    199|                  return;
 3779|    199|               }
 3780|  58.4k|            }
 3781|       |
 3782|       |            // Sequence indicator check (struct case only - map parser lets key parsing
 3783|       |            // handle '- ' which produces appropriate errors for misindented items)
 3784|   640k|            if (!discover_indent && *it == '-' &&
  ------------------
  |  Branch (3784:17): [True: 0, False: 640k]
  |  Branch (3784:37): [True: 0, False: 0]
  ------------------
 3785|      0|                ((it + 1) == end || *(it + 1) == ' ' || *(it + 1) == '\t' || *(it + 1) == '\n')) {
  ------------------
  |  Branch (3785:18): [True: 0, False: 0]
  |  Branch (3785:37): [True: 0, False: 0]
  |  Branch (3785:57): [True: 0, False: 0]
  |  Branch (3785:78): [True: 0, False: 0]
  ------------------
 3786|      0|               it = line_start;
 3787|      0|               return;
 3788|      0|            }
 3789|       |
 3790|       |            // Skip indented comment lines
 3791|   640k|            if (*it == '#') {
  ------------------
  |  Branch (3791:17): [True: 0, False: 640k]
  ------------------
 3792|      0|               skip_comment(it, end);
 3793|      0|               first_key = false;
 3794|      0|               continue;
 3795|      0|            }
 3796|       |
 3797|       |            // Skip blank/empty lines after indent
 3798|   640k|            if (*it == '\n' || *it == '\r') {
  ------------------
  |  Branch (3798:17): [True: 130, False: 640k]
  |  Branch (3798:32): [True: 0, False: 640k]
  ------------------
 3799|      0|               first_key = false;
 3800|      0|               continue;
 3801|      0|            }
 3802|       |
 3803|       |            // While parsing an explicit mapping key node ('? key-node'),
 3804|       |            // a subsequent standalone ':' at the same indentation starts
 3805|       |            // the outer value indicator and must terminate this key-node map.
 3806|       |            // Keep same-line ': x' on the first key-node line valid.
 3807|   640k|            if (ctx.explicit_mapping_key_context && !established_mapping_indent_this_line && *it == ':') {
  ------------------
  |  Branch (3807:17): [True: 281k, False: 359k]
  |  Branch (3807:53): [True: 87.6k, False: 193k]
  |  Branch (3807:94): [True: 22.2k, False: 65.3k]
  ------------------
 3808|  22.2k|               const auto after_colon = it + 1;
 3809|  22.2k|               const int32_t explicit_value_indicator_indent = (parent_indent < 0) ? 0 : (parent_indent + 1);
  ------------------
  |  Branch (3809:64): [True: 18.6k, False: 3.56k]
  ------------------
 3810|  22.2k|               if ((after_colon == end || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*after_colon)]) &&
  ------------------
  |  Branch (3810:21): [True: 14, False: 22.2k]
  |  Branch (3810:43): [True: 17.5k, False: 4.73k]
  ------------------
 3811|  17.5k|                   line_indent == explicit_value_indicator_indent) {
  ------------------
  |  Branch (3811:20): [True: 371, False: 17.1k]
  ------------------
 3812|    371|                  it = line_start;
 3813|    371|                  return;
 3814|    371|               }
 3815|  22.2k|            }
 3816|       |
 3817|       |            // Process this mapping entry (key + colon + value)
 3818|   640k|            int32_t effective_line_indent = line_indent;
 3819|   640k|            if (discover_indent && established_mapping_indent_this_line &&
  ------------------
  |  Branch (3819:17): [True: 640k, False: 130]
  |  Branch (3819:36): [True: 387k, False: 252k]
  ------------------
 3820|   387k|                discovered_first_key_visual_indent > effective_line_indent &&
  ------------------
  |  Branch (3820:17): [True: 308k, False: 78.4k]
  ------------------
 3821|   308k|                !(discovered_first_key_mid_line && parent_indent < 0)) {
  ------------------
  |  Branch (3821:19): [True: 281k, False: 26.8k]
  |  Branch (3821:52): [True: 15.3k, False: 266k]
  ------------------
 3822|       |               // The first discovered key has no indentation of its own left to measure: it may
 3823|       |               // begin mid-line (a sequence entry's "- key: value"), or the caller may have already
 3824|       |               // consumed the line's indentation before handing the mapping over. Pass its visual
 3825|       |               // column so the entry judges its value against the key's real indent -- otherwise a
 3826|       |               // key with an empty value takes the following sibling line for nested content
 3827|       |               // (issue #2827) and same-line block scalars compute the wrong indentation.
 3828|       |               // The exception is a ROOT mapping whose first key begins mid-line, which means node
 3829|       |               // properties sit ahead of it (`!!str &a1 "foo":`): those belong to the document node
 3830|       |               // rather than to the key's column, so the measured indent stands. Conformance tests
 3831|       |               // 7FWL and HMQ5 pin that case.
 3832|   293k|               effective_line_indent = discovered_first_key_visual_indent;
 3833|   293k|            }
 3834|       |
 3835|   640k|            if (!process_entry(ctx, it, end, effective_line_indent)) {
  ------------------
  |  Branch (3835:17): [True: 22.2k, False: 618k]
  ------------------
 3836|  22.2k|               return;
 3837|  22.2k|            }
 3838|   618k|            first_key = false;
 3839|       |
 3840|   618k|            if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (3840:17): [True: 0, False: 618k]
  ------------------
 3841|      0|               return;
 3842|       |
 3843|       |            if constexpr (yaml::check_flow_context(Opts)) {
 3844|       |               // In flow context, an implicit "key: value" pair used as a sequence entry
 3845|       |               // ends at ',', ']', or '}'. Let the enclosing flow parser consume it.
 3846|       |               auto flow_end = it;
 3847|       |               skip_flow_ws_and_newlines(ctx, flow_end, end);
 3848|       |               if (bool(ctx.error)) [[unlikely]]
 3849|       |                  return;
 3850|       |               if (flow_end != end && (*flow_end == ',' || *flow_end == ']' || *flow_end == '}')) {
 3851|       |                  it = flow_end;
 3852|       |                  return;
 3853|       |               }
 3854|       |            }
 3855|       |
 3856|       |            // Trailing whitespace handling (peek-ahead pattern).
 3857|       |            // After parsing, iterator may be at leading indent of next line.
 3858|       |            // Don't consume it - let the outer loop handle indent measurement.
 3859|   618k|            if (it != end) {
  ------------------
  |  Branch (3859:17): [True: 469k, False: 148k]
  ------------------
 3860|   469k|               if (*it == ' ' || *it == '\t') {
  ------------------
  |  Branch (3860:20): [True: 279k, False: 190k]
  |  Branch (3860:34): [True: 4.37k, False: 186k]
  ------------------
 3861|   283k|                  auto peek = it;
 3862|   283k|                  skip_inline_ws(peek, end);
 3863|   283k|                  if (peek != end && *peek != '\n' && *peek != '\r' && *peek != '#') {
  ------------------
  |  Branch (3863:23): [True: 282k, False: 613]
  |  Branch (3863:38): [True: 281k, False: 1.81k]
  |  Branch (3863:55): [True: 279k, False: 1.36k]
  |  Branch (3863:72): [True: 275k, False: 4.56k]
  ------------------
 3864|   275k|                     continue; // At leading indent of new line
 3865|   275k|                  }
 3866|   283k|               }
 3867|   194k|               skip_inline_ws(it, end);
 3868|   194k|               if (it != end && *it == '#') {
  ------------------
  |  Branch (3868:20): [True: 194k, False: 613]
  |  Branch (3868:33): [True: 16.2k, False: 177k]
  ------------------
 3869|  16.2k|                  if constexpr (std::is_pointer_v<std::decay_t<It>>) {
 3870|  16.2k|                     if (it > line_start) {
  ------------------
  |  Branch (3870:26): [True: 16.2k, False: 0]
  ------------------
 3871|  16.2k|                        const char prev = *(it - 1);
 3872|  16.2k|                        if (prev != ' ' && prev != '\t' && prev != '\n' && prev != '\r') {
  ------------------
  |  Branch (3872:29): [True: 5.81k, False: 10.4k]
  |  Branch (3872:44): [True: 1.60k, False: 4.20k]
  |  Branch (3872:60): [True: 849, False: 759]
  |  Branch (3872:76): [True: 19, False: 830]
  ------------------
 3873|     19|                           ctx.error = error_code::syntax_error;
 3874|     19|                           return;
 3875|     19|                        }
 3876|  16.2k|                     }
 3877|  16.2k|                  }
 3878|  16.2k|               }
 3879|  16.2k|               skip_comment(it, end);
 3880|   194k|               if (it != end && (*it == '\n' || *it == '\r')) {
  ------------------
  |  Branch (3880:20): [True: 193k, False: 1.15k]
  |  Branch (3880:34): [True: 67.5k, False: 125k]
  |  Branch (3880:49): [True: 74.9k, False: 50.9k]
  ------------------
 3881|   142k|                  skip_newline(it, end);
 3882|   142k|               }
 3883|  52.1k|               else if (it != end) {
  ------------------
  |  Branch (3883:25): [True: 50.9k, False: 1.15k]
  ------------------
 3884|       |                  // The entry stopped part way along its line with something other than
 3885|       |                  // whitespace or a comment after it -- a ':' its value could not take as a
 3886|       |                  // separator, say. The next pass measures indent as though this were the start
 3887|       |                  // of a line, so what is left of the real one is lost; reject it instead.
 3888|  50.9k|                  if constexpr (requires { ctx.line_prefix_before(it); }) {
 3889|  50.9k|                     if (ctx.line_prefix_before(it).has_content) {
  ------------------
  |  Branch (3889:26): [True: 541, False: 50.4k]
  ------------------
 3890|    541|                        ctx.error = error_code::syntax_error;
 3891|    541|                        return;
 3892|    541|                     }
 3893|  50.9k|                  }
 3894|  50.9k|               }
 3895|   194k|            }
 3896|   618k|         }
 3897|   388k|      }
_ZZN3glz4fromILj450ENS_17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES1_EEEEE2opITnDaXtlNS_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj32EEERPKcRS5_TkNS_10is_contextERNS8_12yaml_contextESB_EEvOT1_OT2_OT0_T3_ENKUlRT_RSK_SG_iE_clISE_SB_SB_EEbSO_SP_SG_i:
 4777|   640k|               ctx, it, end, int32_t(-1), [&](auto& ctx, auto& it, auto end, int32_t line_indent) -> bool {
 4778|   640k|                  auto parse_map_value = [&](val_t& val) -> bool {
 4779|   640k|                     if (it != end && !yaml::line_end_or_comment_table[static_cast<uint8_t>(*it)]) {
 4780|   640k|                        bool line_starts_with_explicit_value_indicator = false;
 4781|       |
 4782|       |                        // Inline mapping values in block context cannot start with a
 4783|       |                        // plain "key: value" pair on the same line (e.g. "a: b: c").
 4784|       |                        // Such constructs are malformed unless wrapped in flow
 4785|       |                        // delimiters ({...} / [...]) or quoted.
 4786|   640k|                        if constexpr (std::is_pointer_v<std::decay_t<decltype(it)>>) {
 4787|   640k|                           if (ctx.stream_begin) {
 4788|   640k|                              auto is_line_content_start = [&](auto pos) {
 4789|   640k|                                 return !ctx.line_prefix_before(pos).has_content;
 4790|   640k|                              };
 4791|       |
 4792|   640k|                              auto line_has_explicit_value_indicator = [&](auto pos) {
 4793|   640k|                                 const char* line = ctx.line_begin_of(pos);
 4794|   640k|                                 while (line != end && (*line == ' ' || *line == '\t')) ++line;
 4795|   640k|                                 return line != end && *line == ':';
 4796|   640k|                              };
 4797|       |
 4798|   640k|                              if (!is_line_content_start(it) &&
 4799|   640k|                                  yaml::inline_value_has_plain_mapping_indicator(it, end) &&
 4800|   640k|                                  !line_has_explicit_value_indicator(it)) {
 4801|   640k|                                 ctx.error = error_code::syntax_error;
 4802|   640k|                                 return false;
 4803|   640k|                              }
 4804|   640k|                              line_starts_with_explicit_value_indicator = line_has_explicit_value_indicator(it);
 4805|   640k|                           }
 4806|   640k|                        }
 4807|       |
 4808|   640k|                        if (*it == '-' &&
 4809|   640k|                            ((it + 1) == end || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*(it + 1))]) &&
 4810|   640k|                            !line_starts_with_explicit_value_indicator) {
 4811|       |                           // "key: - item" is not valid block sequence syntax.
 4812|   640k|                           ctx.error = error_code::syntax_error;
 4813|   640k|                           return false;
 4814|   640k|                        }
 4815|       |
 4816|   640k|                        if (!ctx.push_indent(line_indent + 1)) [[unlikely]]
 4817|   640k|                           return false;
 4818|   640k|                        from<YAML, val_t>::template op<Opts>(val, ctx, it, end);
 4819|   640k|                        ctx.pop_indent();
 4820|   640k|                     }
 4821|   640k|                     else {
 4822|   640k|                        int32_t nested_indent = yaml::detect_nested_value_indent(ctx, it, end, line_indent);
 4823|   640k|                        if (nested_indent >= 0) {
 4824|   640k|                           yaml::skip_to_content(it, end);
 4825|   640k|                           if (it != end && *it == ':' && (it + 1) != end && *(it + 1) == '\t') {
 4826|   640k|                              ctx.error = error_code::syntax_error;
 4827|   640k|                              return false;
 4828|   640k|                           }
 4829|       |                           // A struct value reads the pushed indent as its own key column;
 4830|       |                           // every other value type reads it as the enclosing baseline.
 4831|   640k|                           const int32_t value_indent =
 4832|   640k|                              yaml::receives_block_mapping_column<val_t>() ? nested_indent : nested_indent - 1;
 4833|   640k|                           if (!ctx.push_indent(value_indent)) [[unlikely]]
 4834|   640k|                              return false;
 4835|   640k|                           from<YAML, val_t>::template op<Opts>(val, ctx, it, end);
 4836|   640k|                           ctx.pop_indent();
 4837|   640k|                        }
 4838|   640k|                     }
 4839|   640k|                     return !bool(ctx.error);
 4840|   640k|                  };
 4841|       |
 4842|       |                  // Explicit key entry form:
 4843|       |                  // ? key
 4844|       |                  // : value
 4845|   640k|                  if (*it == '?' && ((it + 1) != end) && *(it + 1) == '\t') {
  ------------------
  |  Branch (4845:23): [True: 182k, False: 457k]
  |  Branch (4845:37): [True: 181k, False: 275]
  |  Branch (4845:58): [True: 6, False: 181k]
  ------------------
 4846|      6|                     ctx.error = error_code::syntax_error;
 4847|      6|                     return false;
 4848|      6|                  }
 4849|   640k|                  if (*it == '?' && ((it + 1) == end || *(it + 1) == ' ' || *(it + 1) == '\n' || *(it + 1) == '\r')) {
  ------------------
  |  Branch (4849:23): [True: 182k, False: 457k]
  |  Branch (4849:38): [True: 275, False: 181k]
  |  Branch (4849:57): [True: 63.4k, False: 118k]
  |  Branch (4849:77): [True: 107k, False: 10.9k]
  |  Branch (4849:98): [True: 5.45k, False: 5.49k]
  ------------------
 4850|   176k|                     ++it; // skip '?'
 4851|   176k|                     yaml::skip_inline_ws(it, end);
 4852|       |
 4853|   176k|                     const int32_t explicit_value_indicator_indent =
 4854|   176k|                        (ctx.current_indent() < 0) ? 0 : (ctx.current_indent() + 1);
  ------------------
  |  Branch (4854:25): [True: 47.8k, False: 128k]
  ------------------
 4855|       |
 4856|   176k|                     key_t key{};
 4857|   176k|                     if constexpr (std::same_as<std::remove_cvref_t<key_t>, std::string>) {
 4858|   176k|                        auto to_string_key = [&](glz::generic& key_node) {
 4859|   176k|                           return yaml::materialize_key(key, key_node, ctx);
 4860|   176k|                        };
 4861|       |
 4862|   176k|                        auto key_it = it;
 4863|   176k|                        yaml::skip_inline_ws(key_it, end);
 4864|       |
 4865|   176k|                        auto content = key_it;
 4866|   176k|                        yaml::skip_to_content(content, end);
 4867|   176k|                        bool handled_anchor_only_empty_key = false;
 4868|       |
 4869|       |                        // Anchor on an empty explicit key node:
 4870|       |                        //   ? &a
 4871|       |                        //   : value
 4872|   176k|                        if (content != end && *content == '&') {
  ------------------
  |  Branch (4872:29): [True: 175k, False: 1.58k]
  |  Branch (4872:47): [True: 50.8k, False: 124k]
  ------------------
 4873|  50.8k|                           auto anchor_probe = content + 1;
 4874|  50.8k|                           auto anchor_name = yaml::parse_anchor_name(anchor_probe, end);
 4875|  50.8k|                           if (!anchor_name.empty()) {
  ------------------
  |  Branch (4875:32): [True: 50.8k, False: 11]
  ------------------
 4876|  50.8k|                              auto after_anchor = anchor_probe;
 4877|  50.8k|                              yaml::skip_inline_ws(after_anchor, end);
 4878|       |
 4879|  50.8k|                              auto value_indicator = after_anchor;
 4880|  50.8k|                              if (value_indicator != end && *value_indicator == ':') {
  ------------------
  |  Branch (4880:35): [True: 48.9k, False: 1.86k]
  |  Branch (4880:61): [True: 2.57k, False: 46.3k]
  ------------------
 4881|  2.57k|                                 key.clear();
 4882|  2.57k|                                 ctx.anchors[std::string(anchor_name)] = {content, content, ctx.current_indent()};
 4883|  2.57k|                                 it = value_indicator;
 4884|  2.57k|                                 handled_anchor_only_empty_key = true;
 4885|  2.57k|                              }
 4886|  48.2k|                              else {
 4887|  48.2k|                                 if (value_indicator != end && *value_indicator == '#') {
  ------------------
  |  Branch (4887:38): [True: 46.3k, False: 1.86k]
  |  Branch (4887:64): [True: 1.52k, False: 44.8k]
  ------------------
 4888|  1.52k|                                    yaml::skip_comment(value_indicator, end);
 4889|  1.52k|                                 }
 4890|  48.2k|                                 if (value_indicator != end && (*value_indicator == '\n' || *value_indicator == '\r')) {
  ------------------
  |  Branch (4890:38): [True: 46.3k, False: 1.88k]
  |  Branch (4890:65): [True: 4.37k, False: 41.9k]
  |  Branch (4890:93): [True: 7.64k, False: 34.3k]
  ------------------
 4891|  12.0k|                                    yaml::skip_newline(value_indicator, end);
 4892|  12.0k|                                    auto value_line = value_indicator;
 4893|  12.0k|                                    int32_t value_indent = yaml::measure_indent(value_line, end, ctx);
 4894|  12.0k|                                    if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4894:41): [True: 3, False: 12.0k]
  ------------------
 4895|      3|                                       return false;
 4896|  12.0k|                                    if (value_line != end && *value_line == ':' &&
  ------------------
  |  Branch (4896:41): [True: 10.4k, False: 1.60k]
  |  Branch (4896:62): [True: 1.10k, False: 9.31k]
  ------------------
 4897|  1.10k|                                        value_indent == explicit_value_indicator_indent) {
  ------------------
  |  Branch (4897:41): [True: 1.08k, False: 16]
  ------------------
 4898|  1.08k|                                       key.clear();
 4899|  1.08k|                                       ctx.anchors[std::string(anchor_name)] = {content, content, ctx.current_indent()};
 4900|  1.08k|                                       it = value_line;
 4901|  1.08k|                                       handled_anchor_only_empty_key = true;
 4902|  1.08k|                                    }
 4903|  10.9k|                                    else if (value_line != end && *value_line == ':') {
  ------------------
  |  Branch (4903:46): [True: 9.32k, False: 1.60k]
  |  Branch (4903:67): [True: 16, False: 9.31k]
  ------------------
 4904|       |                                       // In explicit-key form ("? &a"), a following ':'
 4905|       |                                       // starts the outer value indicator only at the same
 4906|       |                                       // indentation. A deeper-indented ': value' is malformed.
 4907|     16|                                       ctx.error = error_code::syntax_error;
 4908|     16|                                       return false;
 4909|     16|                                    }
 4910|  12.0k|                                 }
 4911|  48.2k|                              }
 4912|  50.8k|                           }
 4913|  50.8k|                        }
 4914|       |
 4915|   176k|                        const bool key_content_spans_lines = [&] {
 4916|   176k|                           auto scan = key_it;
 4917|   176k|                           while (scan != content && scan != end) {
 4918|   176k|                              if (*scan == '\n' || *scan == '\r') return true;
 4919|   176k|                              ++scan;
 4920|   176k|                           }
 4921|   176k|                           return false;
 4922|   176k|                        }();
 4923|       |
 4924|   176k|                        if (handled_anchor_only_empty_key) {
  ------------------
  |  Branch (4924:29): [True: 3.66k, False: 173k]
  ------------------
 4925|       |                           // 'it' already points to the explicit value indicator ':'
 4926|  3.66k|                        }
 4927|   173k|                        else if (content == end || (*content == ':' && key_content_spans_lines)) {
  ------------------
  |  Branch (4927:34): [True: 1.58k, False: 171k]
  |  Branch (4927:53): [True: 4.75k, False: 166k]
  |  Branch (4927:72): [True: 2.52k, False: 2.23k]
  ------------------
 4928|  4.10k|                           key.clear();
 4929|  4.10k|                           it = content;
 4930|  4.10k|                        }
 4931|   168k|                        else {
 4932|       |                           // Explicit mapping keys ('? key-node') are full YAML nodes.
 4933|       |                           // Parse the key node structurally (not via plain-key scanning)
 4934|       |                           // so inputs like '? []: x' and '? JSON: like' are interpreted
 4935|       |                           // as complex keys, not split into implicit key/value pairs.
 4936|   168k|                           auto key_node_it = content;
 4937|   168k|                           auto key_node_end = end;
 4938|   168k|                           if constexpr (std::is_pointer_v<std::decay_t<It>>) {
 4939|       |                              // In explicit-key form, a following standalone ':'
 4940|       |                              // line (same or lower indentation) belongs to the
 4941|       |                              // outer mapping value, not the key node itself.
 4942|   168k|                              auto scan = content;
 4943|  3.28M|                              while (scan != end) {
  ------------------
  |  Branch (4943:38): [True: 3.19M, False: 89.5k]
  ------------------
 4944|   237M|                                 while (scan != end && *scan != '\n' && *scan != '\r') {
  ------------------
  |  Branch (4944:41): [True: 237M, False: 34.4k]
  |  Branch (4944:56): [True: 235M, False: 1.77M]
  |  Branch (4944:73): [True: 234M, False: 1.38M]
  ------------------
 4945|   234M|                                    ++scan;
 4946|   234M|                                 }
 4947|  3.19M|                                 if (scan == end) {
  ------------------
  |  Branch (4947:38): [True: 34.4k, False: 3.16M]
  ------------------
 4948|  34.4k|                                    break;
 4949|  34.4k|                                 }
 4950|       |
 4951|  3.16M|                                 yaml::skip_newline(scan, end);
 4952|  3.16M|                                 auto line_start = scan;
 4953|       |
 4954|  3.16M|                                 int32_t indicator_indent = 0;
 4955|  4.29M|                                 while (scan != end && *scan == ' ') {
  ------------------
  |  Branch (4955:41): [True: 4.20M, False: 89.5k]
  |  Branch (4955:56): [True: 1.13M, False: 3.07M]
  ------------------
 4956|  1.13M|                                    ++indicator_indent;
 4957|  1.13M|                                    ++scan;
 4958|  1.13M|                                 }
 4959|       |
 4960|  3.16M|                                 if (scan != end && *scan == ':') {
  ------------------
  |  Branch (4960:38): [True: 3.07M, False: 89.5k]
  |  Branch (4960:53): [True: 524k, False: 2.54M]
  ------------------
 4961|   524k|                                    const auto after_colon = scan + 1;
 4962|   524k|                                    if ((after_colon == end ||
  ------------------
  |  Branch (4962:42): [True: 98, False: 524k]
  ------------------
 4963|   524k|                                         yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*after_colon)]) &&
  ------------------
  |  Branch (4963:42): [True: 355k, False: 169k]
  ------------------
 4964|   355k|                                        indicator_indent <= line_indent) {
  ------------------
  |  Branch (4964:41): [True: 44.8k, False: 310k]
  ------------------
 4965|  44.8k|                                       key_node_end = line_start;
 4966|  44.8k|                                       break;
 4967|  44.8k|                                    }
 4968|   524k|                                 }
 4969|  3.16M|                              }
 4970|   168k|                           }
 4971|       |
 4972|   168k|                           glz::generic key_node{};
 4973|   168k|                           const bool prev_explicit_mapping_key_context = ctx.explicit_mapping_key_context;
 4974|   168k|                           ctx.explicit_mapping_key_context = true;
 4975|   168k|                           from<YAML, glz::generic>::template op<Opts>(key_node, ctx, key_node_it, key_node_end);
 4976|   168k|                           ctx.explicit_mapping_key_context = prev_explicit_mapping_key_context;
 4977|   168k|                           if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4977:32): [True: 3.90k, False: 165k]
  ------------------
 4978|  3.90k|                              return false;
 4979|   165k|                           it = key_node_it;
 4980|   165k|                           if (!to_string_key(key_node)) [[unlikely]]
  ------------------
  |  Branch (4980:32): [True: 48, False: 164k]
  ------------------
 4981|     48|                              return false;
 4982|   165k|                        }
 4983|       |                     }
 4984|       |                     else {
 4985|       |                        if (it != end && !yaml::line_end_or_comment_table[static_cast<uint8_t>(*it)]) {
 4986|       |                           from<YAML, key_t>::template op<Opts>(key, ctx, it, end);
 4987|       |                           if (bool(ctx.error)) [[unlikely]]
 4988|       |                              return false;
 4989|       |                        }
 4990|       |                     }
 4991|       |
 4992|   172k|                     yaml::skip_inline_ws(it, end);
 4993|   176k|                     yaml::skip_comment(it, end);
 4994|       |
 4995|       |                     // Value indicator may appear on the next line at the same indent.
 4996|   176k|                     if (it != end && (*it == '\n' || *it == '\r')) {
  ------------------
  |  Branch (4996:26): [True: 123k, False: 53.0k]
  |  Branch (4996:40): [True: 15.4k, False: 108k]
  |  Branch (4996:55): [True: 43.3k, False: 64.8k]
  ------------------
 4997|  58.7k|                        auto probe = it;
 4998|  58.7k|                        bool found_value_indicator = false;
 4999|       |
 5000|   127k|                        while (probe != end && (*probe == '\n' || *probe == '\r')) {
  ------------------
  |  Branch (5000:32): [True: 88.9k, False: 38.7k]
  |  Branch (5000:49): [True: 20.3k, False: 68.6k]
  |  Branch (5000:67): [True: 68.6k, False: 0]
  ------------------
 5001|  88.9k|                           yaml::skip_newline(probe, end);
 5002|       |
 5003|  88.9k|                           auto value_line = probe;
 5004|  88.9k|                           int32_t value_indent = yaml::measure_indent(value_line, end, ctx);
 5005|  88.9k|                           if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (5005:32): [True: 7, False: 88.9k]
  ------------------
 5006|      7|                              return false;
 5007|       |
 5008|  88.9k|                           if (value_line == end || *value_line == '\n' || *value_line == '\r') {
  ------------------
  |  Branch (5008:32): [True: 38.6k, False: 50.2k]
  |  Branch (5008:53): [True: 2.42k, False: 47.8k]
  |  Branch (5008:76): [True: 24.4k, False: 23.3k]
  ------------------
 5009|  65.5k|                              probe = value_line;
 5010|  65.5k|                              continue; // blank line
 5011|  65.5k|                           }
 5012|  23.3k|                           if (*value_line == '#') {
  ------------------
  |  Branch (5012:32): [True: 3.32k, False: 20.0k]
  ------------------
 5013|  3.32k|                              yaml::skip_comment(value_line, end);
 5014|  3.32k|                              probe = value_line;
 5015|  3.32k|                              continue; // comment-only line
 5016|  3.32k|                           }
 5017|  20.0k|                           if (*value_line == ':' && value_indent == explicit_value_indicator_indent) {
  ------------------
  |  Branch (5017:32): [True: 5.63k, False: 14.4k]
  |  Branch (5017:54): [True: 1.12k, False: 4.51k]
  ------------------
 5018|  1.12k|                              it = value_line;
 5019|  1.12k|                              found_value_indicator = true;
 5020|  1.12k|                           }
 5021|  20.0k|                           break;
 5022|  23.3k|                        }
 5023|       |
 5024|  58.7k|                        if (found_value_indicator) {
  ------------------
  |  Branch (5024:29): [True: 1.12k, False: 57.6k]
  ------------------
 5025|  1.12k|                           yaml::skip_inline_ws(it, end);
 5026|  1.12k|                        }
 5027|  58.7k|                     }
 5028|       |
 5029|   176k|                     val_t val{};
 5030|   176k|                     if (it != end && *it == ':') {
  ------------------
  |  Branch (5030:26): [True: 123k, False: 53.0k]
  |  Branch (5030:39): [True: 56.6k, False: 66.9k]
  ------------------
 5031|  56.6k|                        ++it;
 5032|  56.6k|                        if (it != end && *it == '\t') {
  ------------------
  |  Branch (5032:29): [True: 55.8k, False: 845]
  |  Branch (5032:42): [True: 5, False: 55.8k]
  ------------------
 5033|      5|                           ctx.error = error_code::syntax_error;
 5034|      5|                           return false;
 5035|      5|                        }
 5036|  56.6k|                        if (it != end && (*it == '\n' || *it == '\r')) {
  ------------------
  |  Branch (5036:29): [True: 55.8k, False: 845]
  |  Branch (5036:43): [True: 1.26k, False: 54.5k]
  |  Branch (5036:58): [True: 6.47k, False: 48.0k]
  ------------------
 5037|  7.74k|                           auto probe = it;
 5038|  7.74k|                           yaml::skip_newline(probe, end);
 5039|  15.7k|                           while (probe != end && *probe == ' ') ++probe;
  ------------------
  |  Branch (5039:35): [True: 14.0k, False: 1.73k]
  |  Branch (5039:51): [True: 8.01k, False: 6.00k]
  ------------------
 5040|  7.74k|                           if (probe != end && *probe == ':' && ((probe + 1) != end) && *(probe + 1) == '\t') {
  ------------------
  |  Branch (5040:32): [True: 6.00k, False: 1.73k]
  |  Branch (5040:48): [True: 1.40k, False: 4.59k]
  |  Branch (5040:65): [True: 1.40k, False: 0]
  |  Branch (5040:89): [True: 2, False: 1.40k]
  ------------------
 5041|      2|                              ctx.error = error_code::syntax_error;
 5042|      2|                              return false;
 5043|      2|                           }
 5044|  7.74k|                        }
 5045|  56.6k|                        yaml::skip_inline_ws(it, end);
 5046|  56.6k|                        if (!parse_map_value(val)) [[unlikely]]
  ------------------
  |  Branch (5046:29): [True: 417, False: 56.2k]
  ------------------
 5047|    417|                           return false;
 5048|  56.6k|                     }
 5049|       |
 5050|   176k|                     value.emplace(std::move(key), std::move(val));
 5051|   176k|                     return true;
 5052|   176k|                  }
 5053|       |
 5054|   463k|                  key_t key{};
 5055|   463k|                  if constexpr (std::same_as<std::remove_cvref_t<key_t>, std::string>) {
 5056|   463k|                     auto key_probe = it;
 5057|   463k|                     yaml::skip_inline_ws(key_probe, end);
 5058|   463k|                     const bool complex_flow_key = (key_probe != end && (*key_probe == '[' || *key_probe == '{'));
  ------------------
  |  Branch (5058:53): [True: 463k, False: 0]
  |  Branch (5058:74): [True: 1.48k, False: 461k]
  |  Branch (5058:95): [True: 2.71k, False: 459k]
  ------------------
 5059|   463k|                     if (complex_flow_key) {
  ------------------
  |  Branch (5059:26): [True: 4.20k, False: 459k]
  ------------------
 5060|  4.20k|                        glz::generic key_node{};
 5061|  4.20k|                        from<YAML, glz::generic>::template op<yaml::flow_context_on<Opts>()>(key_node, ctx, it, end);
 5062|  4.20k|                        if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (5062:29): [True: 465, False: 3.74k]
  ------------------
 5063|    465|                           return false;
 5064|  3.74k|                        if (!yaml::materialize_key(key, key_node, ctx)) [[unlikely]]
  ------------------
  |  Branch (5064:29): [True: 1, False: 3.74k]
  ------------------
 5065|      1|                           return false;
 5066|  3.74k|                     }
 5067|   459k|                     else {
 5068|   459k|                        if (!yaml::parse_yaml_key(key, ctx, it, end, false)) {
  ------------------
  |  Branch (5068:29): [True: 1.91k, False: 457k]
  ------------------
 5069|  1.91k|                           return false;
 5070|  1.91k|                        }
 5071|   459k|                     }
 5072|       |                  }
 5073|       |                  else {
 5074|       |                     from<YAML, key_t>::template op<Opts>(key, ctx, it, end);
 5075|       |                     if (bool(ctx.error)) [[unlikely]]
 5076|       |                        return false;
 5077|       |                  }
 5078|       |
 5079|   461k|                  yaml::skip_inline_ws(it, end);
 5080|       |
 5081|   463k|                  if (it == end || *it != ':') {
  ------------------
  |  Branch (5081:23): [True: 3.54k, False: 459k]
  |  Branch (5081:36): [True: 1.04k, False: 458k]
  ------------------
 5082|  2.21k|                     ctx.error = error_code::syntax_error;
 5083|  2.21k|                     return false;
 5084|  2.21k|                  }
 5085|   461k|                  ++it;
 5086|   461k|                  yaml::skip_inline_ws(it, end);
 5087|       |
 5088|   461k|                  val_t val{};
 5089|   461k|                  if (!parse_map_value(val)) [[unlikely]]
  ------------------
  |  Branch (5089:23): [True: 13.2k, False: 448k]
  ------------------
 5090|  13.2k|                     return false;
 5091|       |
 5092|   448k|                  value.emplace(std::move(key), std::move(val));
 5093|   448k|                  return true;
 5094|   461k|               });
_ZZZN3glz4fromILj450ENS_17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES1_EEEEE2opITnDaXtlNS_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj32EEERPKcRS5_TkNS_10is_contextERNS8_12yaml_contextESB_EEvOT1_OT2_OT0_T3_ENKUlRT_RSK_SG_iE_clISE_SB_SB_EEbSO_SP_SG_iENKUlvE_clEv:
 4915|   176k|                        const bool key_content_spans_lines = [&] {
 4916|   176k|                           auto scan = key_it;
 4917|   190k|                           while (scan != content && scan != end) {
  ------------------
  |  Branch (4917:35): [True: 129k, False: 60.7k]
  |  Branch (4917:54): [True: 129k, False: 0]
  ------------------
 4918|   129k|                              if (*scan == '\n' || *scan == '\r') return true;
  ------------------
  |  Branch (4918:35): [True: 108k, False: 21.3k]
  |  Branch (4918:52): [True: 7.52k, False: 13.7k]
  ------------------
 4919|  13.7k|                              ++scan;
 4920|  13.7k|                           }
 4921|  60.7k|                           return false;
 4922|   176k|                        }();
_ZZZN3glz4fromILj450ENS_17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES1_EEEEE2opITnDaXtlNS_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj32EEERPKcRS5_TkNS_10is_contextERNS8_12yaml_contextESB_EEvOT1_OT2_OT0_T3_ENKUlRT_RSK_SG_iE_clISE_SB_SB_EEbSO_SP_SG_iENKUlRS4_E0_clESS_:
 4858|   165k|                        auto to_string_key = [&](glz::generic& key_node) {
 4859|   165k|                           return yaml::materialize_key(key, key_node, ctx);
 4860|   165k|                        };
_ZZZN3glz4fromILj450ENS_17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES1_EEEEE2opITnDaXtlNS_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj32EEERPKcRS5_TkNS_10is_contextERNS8_12yaml_contextESB_EEvOT1_OT2_OT0_T3_ENKUlRT_RSK_SG_iE_clISE_SB_SB_EEbSO_SP_SG_iENKUlRS4_E_clESS_:
 4778|   515k|                  auto parse_map_value = [&](val_t& val) -> bool {
 4779|   515k|                     if (it != end && !yaml::line_end_or_comment_table[static_cast<uint8_t>(*it)]) {
  ------------------
  |  Branch (4779:26): [True: 509k, False: 5.51k]
  |  Branch (4779:39): [True: 394k, False: 115k]
  ------------------
 4780|   394k|                        bool line_starts_with_explicit_value_indicator = false;
 4781|       |
 4782|       |                        // Inline mapping values in block context cannot start with a
 4783|       |                        // plain "key: value" pair on the same line (e.g. "a: b: c").
 4784|       |                        // Such constructs are malformed unless wrapped in flow
 4785|       |                        // delimiters ({...} / [...]) or quoted.
 4786|   394k|                        if constexpr (std::is_pointer_v<std::decay_t<decltype(it)>>) {
 4787|   394k|                           if (ctx.stream_begin) {
  ------------------
  |  Branch (4787:32): [True: 394k, False: 0]
  ------------------
 4788|   394k|                              auto is_line_content_start = [&](auto pos) {
 4789|   394k|                                 return !ctx.line_prefix_before(pos).has_content;
 4790|   394k|                              };
 4791|       |
 4792|   394k|                              auto line_has_explicit_value_indicator = [&](auto pos) {
 4793|   394k|                                 const char* line = ctx.line_begin_of(pos);
 4794|   394k|                                 while (line != end && (*line == ' ' || *line == '\t')) ++line;
 4795|   394k|                                 return line != end && *line == ':';
 4796|   394k|                              };
 4797|       |
 4798|   394k|                              if (!is_line_content_start(it) &&
  ------------------
  |  Branch (4798:35): [True: 394k, False: 0]
  ------------------
 4799|   394k|                                  yaml::inline_value_has_plain_mapping_indicator(it, end) &&
  ------------------
  |  Branch (4799:35): [True: 39.0k, False: 355k]
  ------------------
 4800|  39.0k|                                  !line_has_explicit_value_indicator(it)) {
  ------------------
  |  Branch (4800:35): [True: 258, False: 38.7k]
  ------------------
 4801|    258|                                 ctx.error = error_code::syntax_error;
 4802|    258|                                 return false;
 4803|    258|                              }
 4804|   394k|                              line_starts_with_explicit_value_indicator = line_has_explicit_value_indicator(it);
 4805|   394k|                           }
 4806|   394k|                        }
 4807|       |
 4808|   394k|                        if (*it == '-' &&
  ------------------
  |  Branch (4808:29): [True: 2.51k, False: 392k]
  ------------------
 4809|  2.51k|                            ((it + 1) == end || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*(it + 1))]) &&
  ------------------
  |  Branch (4809:30): [True: 1, False: 2.51k]
  |  Branch (4809:49): [True: 391, False: 2.11k]
  ------------------
 4810|    392|                            !line_starts_with_explicit_value_indicator) {
  ------------------
  |  Branch (4810:29): [True: 7, False: 385]
  ------------------
 4811|       |                           // "key: - item" is not valid block sequence syntax.
 4812|      7|                           ctx.error = error_code::syntax_error;
 4813|      7|                           return false;
 4814|      7|                        }
 4815|       |
 4816|   394k|                        if (!ctx.push_indent(line_indent + 1)) [[unlikely]]
  ------------------
  |  Branch (4816:29): [True: 0, False: 394k]
  ------------------
 4817|      0|                           return false;
 4818|   394k|                        from<YAML, val_t>::template op<Opts>(val, ctx, it, end);
 4819|   394k|                        ctx.pop_indent();
 4820|   394k|                     }
 4821|   120k|                     else {
 4822|   120k|                        int32_t nested_indent = yaml::detect_nested_value_indent(ctx, it, end, line_indent);
 4823|   120k|                        if (nested_indent >= 0) {
  ------------------
  |  Branch (4823:29): [True: 20.9k, False: 99.7k]
  ------------------
 4824|  20.9k|                           yaml::skip_to_content(it, end);
 4825|  20.9k|                           if (it != end && *it == ':' && (it + 1) != end && *(it + 1) == '\t') {
  ------------------
  |  Branch (4825:32): [True: 20.9k, False: 0]
  |  Branch (4825:45): [True: 0, False: 20.9k]
  |  Branch (4825:59): [True: 0, False: 0]
  |  Branch (4825:78): [True: 0, False: 0]
  ------------------
 4826|      0|                              ctx.error = error_code::syntax_error;
 4827|      0|                              return false;
 4828|      0|                           }
 4829|       |                           // A struct value reads the pushed indent as its own key column;
 4830|       |                           // every other value type reads it as the enclosing baseline.
 4831|  20.9k|                           const int32_t value_indent =
 4832|  20.9k|                              yaml::receives_block_mapping_column<val_t>() ? nested_indent : nested_indent - 1;
  ------------------
  |  Branch (4832:31): [Folded, False: 20.9k]
  ------------------
 4833|  20.9k|                           if (!ctx.push_indent(value_indent)) [[unlikely]]
  ------------------
  |  Branch (4833:32): [True: 0, False: 20.9k]
  ------------------
 4834|      0|                              return false;
 4835|  20.9k|                           from<YAML, val_t>::template op<Opts>(val, ctx, it, end);
 4836|  20.9k|                           ctx.pop_indent();
 4837|  20.9k|                        }
 4838|   120k|                     }
 4839|   515k|                     return !bool(ctx.error);
 4840|   515k|                  };
_ZZZZN3glz4fromILj450ENS_17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES1_EEEEE2opITnDaXtlNS_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj32EEERPKcRS5_TkNS_10is_contextERNS8_12yaml_contextESB_EEvOT1_OT2_OT0_T3_ENKUlRT_RSK_SG_iE_clISE_SB_SB_EEbSO_SP_SG_iENKUlRS4_E_clESS_ENKUlSN_E_clISB_EEDaSN_:
 4788|   394k|                              auto is_line_content_start = [&](auto pos) {
 4789|   394k|                                 return !ctx.line_prefix_before(pos).has_content;
 4790|   394k|                              };
_ZZZZN3glz4fromILj450ENS_17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES1_EEEEE2opITnDaXtlNS_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj32EEERPKcRS5_TkNS_10is_contextERNS8_12yaml_contextESB_EEvOT1_OT2_OT0_T3_ENKUlRT_RSK_SG_iE_clISE_SB_SB_EEbSO_SP_SG_iENKUlRS4_E_clESS_ENKUlSN_E0_clISB_EEDaSN_:
 4792|   433k|                              auto line_has_explicit_value_indicator = [&](auto pos) {
 4793|   433k|                                 const char* line = ctx.line_begin_of(pos);
 4794|   923k|                                 while (line != end && (*line == ' ' || *line == '\t')) ++line;
  ------------------
  |  Branch (4794:41): [True: 923k, False: 0]
  |  Branch (4794:57): [True: 486k, False: 437k]
  |  Branch (4794:73): [True: 3.65k, False: 433k]
  ------------------
 4795|   433k|                                 return line != end && *line == ':';
  ------------------
  |  Branch (4795:41): [True: 433k, False: 0]
  |  Branch (4795:56): [True: 258k, False: 174k]
  ------------------
 4796|   433k|                              };
_ZZN3glz4fromILj450ENS_17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES1_EEEEE2opITnDaXtlNS_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj32EEERPKcRS5_TkNS_10is_contextERNS8_12yaml_contextESB_EEvOT1_OT2_OT0_T3_EN19merge_restore_guardD2Ev:
 4547|   419k|            {
 4548|       |               // emplace is a no-op for keys the document already wrote, so only
 4549|       |               // untouched pre-existing entries are put back.
 4550|   419k|               for (auto& entry : saved) {
  ------------------
  |  Branch (4550:33): [True: 0, False: 419k]
  ------------------
 4551|      0|                  target.emplace(entry.first, std::move(entry.second));
 4552|      0|               }
 4553|   419k|            }
_ZN3glz4yaml12handle_aliasITnDaXtlNS0_9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj32EEERNSt3__17variantIJDndNS3_12basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEEbNS3_6vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS8_ISF_EEEENSE_ISF_EEEEENS0_12yaml_contextEPKcSN_EEbOT0_RT1_RT2_T3_:
  300|  98.1k|      {
  301|  98.1k|         if (it == end || *it != '*') return false;
  ------------------
  |  Branch (301:14): [True: 0, False: 98.1k]
  |  Branch (301:27): [True: 0, False: 98.1k]
  ------------------
  302|       |
  303|  98.1k|         ++it; // skip '*'
  304|  98.1k|         auto name = parse_anchor_name(it, end);
  305|  98.1k|         if (name.empty()) {
  ------------------
  |  Branch (305:14): [True: 57, False: 98.0k]
  ------------------
  306|     57|            ctx.error = error_code::syntax_error;
  307|     57|            return true;
  308|     57|         }
  309|       |
  310|  98.0k|         auto anchor_it = ctx.anchors.find(name);
  311|  98.0k|         if (anchor_it == ctx.anchors.end()) {
  ------------------
  |  Branch (311:14): [True: 935, False: 97.1k]
  ------------------
  312|    935|            ctx.error = error_code::syntax_error; // undefined alias
  313|    935|            return true;
  314|    935|         }
  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|  97.1k|         const auto span = anchor_it->second;
  319|       |
  320|       |         // Empty anchor span (anchor on null/empty node) — leave value as default
  321|  97.1k|         if (span.begin == span.end) {
  ------------------
  |  Branch (321:14): [True: 1.26k, False: 95.8k]
  ------------------
  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|  95.8k|         if (ctx.alias_span_is_replaying(span.begin, span.end)) [[unlikely]] {
  ------------------
  |  Branch (328:14): [True: 35, False: 95.8k]
  ------------------
  329|     35|            ctx.error = error_code::syntax_error; // cyclic alias
  330|     35|            return true;
  331|     35|         }
  332|       |
  333|       |         // Replaying an anchor re-enters the reader directly, bypassing the variant reader's
  334|       |         // depth guard, so this is the only depth accounting a chain of aliases into a
  335|       |         // non-variant target gets. The cycle check above stops the unbounded case; this bounds
  336|       |         // a legitimate but deeply chained one.
  337|  95.8k|         depth_guard guard{ctx, yaml::max_yaml_recursive_depth};
  338|  95.8k|         if (!guard) [[unlikely]]
  ------------------
  |  Branch (338:14): [True: 2, False: 95.8k]
  ------------------
  339|      2|            return true;
  340|       |
  341|  95.8k|         if (!ctx.charge_alias_expansion(static_cast<size_t>(span.end - span.begin))) [[unlikely]] {
  ------------------
  |  Branch (341:14): [True: 7, False: 95.8k]
  ------------------
  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|  95.8k|         auto replay_it = span.begin;
  348|  95.8k|         auto replay_end = span.end;
  349|       |
  350|       |         // Save indent context and set up for replay
  351|  95.8k|         auto saved_indent_stack = std::move(ctx.indent_stack);
  352|  95.8k|         ctx.indent_stack.clear();
  353|  95.8k|         if (span.base_indent > 0) {
  ------------------
  |  Branch (353:14): [True: 75.2k, False: 20.5k]
  ------------------
  354|  75.2k|            ctx.push_indent(span.base_indent - 1);
  355|  75.2k|         }
  356|       |
  357|  95.8k|         ctx.active_alias_spans.emplace_back(span.begin, span.end);
  358|       |
  359|  95.8k|         using V = std::remove_cvref_t<T>;
  360|  95.8k|         from<YAML, V>::template op<Opts>(std::forward<T>(value), ctx, replay_it, replay_end);
  361|       |
  362|  95.8k|         ctx.active_alias_spans.pop_back();
  363|       |
  364|       |         // Restore indent context
  365|  95.8k|         ctx.indent_stack = std::move(saved_indent_stack);
  366|  95.8k|         return true;
  367|  95.8k|      }
_ZN3glz33process_yaml_variant_alternativesINSt3__17variantIJDndNS1_12basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEbNS1_6vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS6_ISD_EEEENSC_ISD_EEEEENS_19is_yaml_variant_strEE2opITnDaXtlNS_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj32EEERSH_TkNS_10is_contextERNSL_12yaml_contextERPKcSR_EEvOT0_OT1_OT2_T3_:
 5205|   129k|      {
 5206|   129k|         constexpr auto category_count = yaml_variant_count_v<Variant, Trait>;
 5207|       |
 5208|       |         if constexpr (category_count == 0) {
 5209|       |            ctx.error = error_code::no_matching_variant_type;
 5210|       |         }
 5211|   129k|         else if constexpr (category_count == 1) {
 5212|       |            // Only one type in this category, use it directly
 5213|   129k|            constexpr auto first_idx = yaml_variant_first_index_v<Variant, Trait>;
 5214|   129k|            using V = std::variant_alternative_t<first_idx, Variant>;
 5215|   129k|            if (!std::holds_alternative<V>(value)) value = V{};
  ------------------
  |  Branch (5215:17): [True: 129k, False: 0]
  ------------------
 5216|   129k|            from<YAML, V>::template op<Opts>(std::get<V>(value), ctx, it, end);
 5217|       |         }
 5218|       |         else {
 5219|       |            // Multiple types in this category, try each one
 5220|       |            constexpr auto N = std::variant_size_v<Variant>;
 5221|       |            bool found_match{};
 5222|       |            size_t match_idx = 0;
 5223|       |            // Only the last alternative propagates its error, so an alternative that exhausted an
 5224|       |            // expansion budget would otherwise be reported as no_matching_variant_type -- a wrong
 5225|       |            // diagnosis for a document that is hostile rather than merely the wrong shape. Held
 5226|       |            // aside and used only if nothing matched, so an alternative that does succeed later
 5227|       |            // (one that materializes no key text can still parse under a latched budget) is
 5228|       |            // unaffected.
 5229|       |            error_code expansion_error{};
 5230|       |            std::string_view expansion_message{};
 5231|       |
 5232|       |            for_each<N>([&]<size_t I>() {
 5233|       |               if (found_match) {
 5234|       |                  return;
 5235|       |               }
 5236|       |               using V = std::variant_alternative_t<I, Variant>;
 5237|       |               if constexpr (Trait<V>::value) {
 5238|       |                  auto copy_it = it;
 5239|       |                  if (!std::holds_alternative<V>(value)) {
 5240|       |                     value = V{};
 5241|       |                  }
 5242|       |
 5243|       |                  auto temp_ctx = ctx.make_speculative();
 5244|       |                  from<YAML, V>::template op<Opts>(std::get<V>(value), temp_ctx, it, end);
 5245|       |
 5246|       |                  // Charged whether or not the alternative fit: a rejected probe still replayed
 5247|       |                  // whatever aliases it reached, and an attempt that is never billed is an
 5248|       |                  // attempt that can be repeated for free.
 5249|       |                  ctx.alias_expansion_budget = temp_ctx.alias_expansion_budget;
 5250|       |                  ctx.key_expansion_budget = temp_ctx.key_expansion_budget;
 5251|       |
 5252|       |                  if (!bool(temp_ctx.error)) {
 5253|       |                     found_match = true;
 5254|       |                     ctx.anchors = std::move(temp_ctx.anchors);
 5255|       |                  }
 5256|       |                  else {
 5257|       |                     it = copy_it;
 5258|       |                     if (temp_ctx.error == error_code::exceeded_max_expansion && expansion_error == error_code::none) {
 5259|       |                        expansion_error = temp_ctx.error;
 5260|       |                        expansion_message = temp_ctx.custom_error_message;
 5261|       |                     }
 5262|       |                     if (match_idx + 1 < category_count) {
 5263|       |                        // Not the last type, continue trying
 5264|       |                     }
 5265|       |                     else {
 5266|       |                        // Last type failed, propagate error
 5267|       |                        ctx.error = temp_ctx.error;
 5268|       |                        ctx.custom_error_message = temp_ctx.custom_error_message;
 5269|       |                     }
 5270|       |                  }
 5271|       |                  ++match_idx;
 5272|       |               }
 5273|       |            });
 5274|       |
 5275|       |            if (!found_match && !bool(ctx.error)) {
 5276|       |               if (expansion_error != error_code::none) {
 5277|       |                  ctx.error = expansion_error;
 5278|       |                  ctx.custom_error_message = expansion_message;
 5279|       |               }
 5280|       |               else {
 5281|       |                  ctx.error = error_code::no_matching_variant_type;
 5282|       |               }
 5283|       |            }
 5284|       |         }
 5285|   129k|      }
_ZN3glz4fromILj450ENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEE2opITnDaXtlNS_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj32EEERPKcRS7_TkNS_10is_contextERNSA_12yaml_contextESD_EEvOT1_OT2_OT0_T3_:
 1892|   132k|      {
 1893|   132k|         if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (1893:14): [True: 5.68k, False: 127k]
  ------------------
 1894|  5.68k|            return;
 1895|       |
 1896|   127k|         yaml::node_preamble_state preamble{};
 1897|   127k|         if (yaml::parse_node_preamble<Opts, yaml::node_property_policy{true, false, false, true}>(
  ------------------
  |  Branch (1897:14): [True: 3.56k, False: 123k]
  ------------------
 1898|   127k|                value, ctx, it, end, preamble, [](yaml::yaml_tag tag) { return yaml::tag_valid_for_string(tag); }))
 1899|  3.56k|            return;
 1900|       |
 1901|   123k|         std::string str;
 1902|   123k|         const auto style = yaml::detect_scalar_style(*it);
 1903|       |
 1904|   123k|         switch (style) {
  ------------------
  |  Branch (1904:18): [True: 123k, False: 0]
  ------------------
 1905|    750|         case yaml::scalar_style::double_quoted:
  ------------------
  |  Branch (1905:10): [True: 750, False: 122k]
  ------------------
 1906|    750|            yaml::parse_double_quoted_string(str, ctx, it, end);
 1907|    750|            break;
 1908|  1.12k|         case yaml::scalar_style::single_quoted:
  ------------------
  |  Branch (1908:10): [True: 1.12k, False: 122k]
  ------------------
 1909|  1.12k|            yaml::parse_single_quoted_string(str, ctx, it, end);
 1910|  1.12k|            break;
 1911|  1.49k|         case yaml::scalar_style::literal_block:
  ------------------
  |  Branch (1911:10): [True: 1.49k, False: 122k]
  ------------------
 1912|  2.07k|         case yaml::scalar_style::folded_block:
  ------------------
  |  Branch (1912:10): [True: 582, False: 123k]
  ------------------
 1913|       |            // For same-line mapping/sequence values, parsing context is typically pushed
 1914|       |            // one column past the key/item indicator; block scalar indentation is relative
 1915|       |            // to the parent line indent.
 1916|  2.07k|            yaml::parse_block_scalar(str, ctx, it, end,
 1917|  2.07k|                                     ctx.current_indent() > 0 ? (ctx.current_indent() - 1) : ctx.current_indent());
  ------------------
  |  Branch (1917:38): [True: 395, False: 1.68k]
  ------------------
 1918|  2.07k|            break;
 1919|   119k|         case yaml::scalar_style::plain:
  ------------------
  |  Branch (1919:10): [True: 119k, False: 3.94k]
  ------------------
 1920|       |            // In block context with known indent, use multiline parsing to support
 1921|       |            // plain scalars that span multiple lines (folding behavior)
 1922|   119k|            if constexpr (!yaml::check_flow_context(Opts)) {
 1923|   119k|               if (ctx.current_indent() >= 0) {
  ------------------
  |  Branch (1923:20): [True: 100k, False: 18.7k]
  ------------------
 1924|   100k|                  yaml::parse_plain_scalar_multiline(str, ctx, it, end, ctx.current_indent());
 1925|   100k|               }
 1926|  18.7k|               else {
 1927|       |                  // Top-level plain scalars may continue on same-indent or indented lines.
 1928|  18.7k|                  yaml::parse_plain_scalar_multiline(str, ctx, it, end, int32_t(0));
 1929|  18.7k|               }
 1930|       |            }
 1931|       |            else {
 1932|       |               yaml::parse_plain_scalar(str, ctx, it, end, true);
 1933|       |            }
 1934|   119k|            break;
 1935|   123k|         }
 1936|       |
 1937|   123k|         if (!bool(ctx.error)) {
  ------------------
  |  Branch (1937:14): [True: 123k, False: 252]
  ------------------
 1938|   123k|            value = std::move(str);
 1939|   123k|            yaml::finalize_node_anchor(preamble.node_props, ctx, it);
 1940|   123k|         }
 1941|   123k|      }
_ZN3glz4yaml19parse_node_preambleITnDaXtlNS0_9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj32EEEXtlNS0_20node_property_policyELb1ELb0ELb0ELb1EEELb0ERNSt3__112basic_stringIcNS4_11char_traitsIcEENS4_9allocatorIcEEEENS0_12yaml_contextEPKcSE_ZNS_4fromILj450ESA_E2opITnDaXtlS2_Lj450ELb1ELb0ELb1ELh2ELb0ELj32EEERSE_SB_TkNS_10is_contextERSC_SE_EEvOT1_OT2_OT0_T3_EUlNS0_8yaml_tagEE_EEbSN_RSQ_RT4_T5_RNS0_19node_preamble_stateEOT6_:
  465|   127k|      {
  466|   127k|         skip_inline_ws(it, end);
  467|       |
  468|   127k|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (468:14): [True: 1, False: 127k]
  ------------------
  469|      1|            if constexpr (!AllowEmptyInput) {
  470|      1|               ctx.error = error_code::unexpected_end;
  471|      1|            }
  472|      1|            return true;
  473|      1|         }
  474|       |
  475|   127k|         preamble.tag = parse_yaml_tag(it, end, ctx);
  476|   127k|         if (preamble.tag == yaml_tag::unknown) [[unlikely]] {
  ------------------
  |  Branch (476:14): [True: 8, False: 127k]
  ------------------
  477|      8|            ctx.error = error_code::syntax_error;
  478|      8|            return true;
  479|      8|         }
  480|   127k|         if (!tag_validator(preamble.tag)) [[unlikely]] {
  ------------------
  |  Branch (480:14): [True: 6, False: 127k]
  ------------------
  481|      6|            ctx.error = error_code::syntax_error;
  482|      6|            return true;
  483|      6|         }
  484|       |
  485|   127k|         skip_inline_ws(it, end);
  486|       |
  487|   127k|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (487:14): [True: 12, False: 127k]
  ------------------
  488|     12|            if constexpr (!AllowEmptyInput) {
  489|     12|               ctx.error = error_code::unexpected_end;
  490|     12|            }
  491|     12|            return true;
  492|     12|         }
  493|       |
  494|   127k|         if (parse_node_properties<Opts, PropertyPolicy>(std::forward<T>(value), ctx, it, end, preamble.node_props)) {
  ------------------
  |  Branch (494:14): [True: 3.54k, False: 123k]
  ------------------
  495|  3.54k|            return true;
  496|  3.54k|         }
  497|       |
  498|   123k|         return false;
  499|   127k|      }
_ZZN3glz4fromILj450ENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEE2opITnDaXtlNS_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj32EEERPKcRS7_TkNS_10is_contextERNSA_12yaml_contextESD_EEvOT1_OT2_OT0_T3_ENKUlNSA_8yaml_tagEE_clESP_:
 1898|   127k|                value, ctx, it, end, preamble, [](yaml::yaml_tag tag) { return yaml::tag_valid_for_string(tag); }))
_ZN3glz4yaml21parse_node_propertiesITnDaXtlNS0_9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj32EEEXtlNS0_20node_property_policyELb1ELb0ELb0ELb1EEERNSt3__112basic_stringIcNS4_11char_traitsIcEENS4_9allocatorIcEEEENS0_12yaml_contextEPKcSE_EEbOT1_RT2_RT3_T4_RNS0_19node_property_stateE:
  408|   127k|      {
  409|   127k|         state.has_anchor = false;
  410|   127k|         state.anchor_name.clear();
  411|   127k|         state.anchor_start = nullptr;
  412|   127k|         state.anchor_indent = ctx.current_indent();
  413|       |
  414|   127k|         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|   127k|            else {
  421|   127k|               if (handle_alias<Opts>(std::forward<T>(value), ctx, it, end)) return true;
  ------------------
  |  Branch (421:20): [True: 3.51k, False: 123k]
  ------------------
  422|   127k|            }
  423|   127k|         }
  424|       |
  425|   127k|         if (it != end && *it == '&') {
  ------------------
  |  Branch (425:14): [True: 123k, False: 3.51k]
  |  Branch (425:27): [True: 4.78k, False: 118k]
  ------------------
  426|  4.78k|            ++it;
  427|  4.78k|            auto name = parse_anchor_name(it, end);
  428|  4.78k|            if (name.empty()) {
  ------------------
  |  Branch (428:17): [True: 5, False: 4.77k]
  ------------------
  429|      5|               ctx.error = error_code::syntax_error;
  430|      5|               return true;
  431|      5|            }
  432|  4.77k|            skip_inline_ws(it, end);
  433|  4.77k|            if (it == end) {
  ------------------
  |  Branch (433:17): [True: 21, False: 4.75k]
  ------------------
  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|  4.75k|            if constexpr (Policy.disallow_anchor_on_alias) {
  440|  4.75k|               if (*it == '*') {
  ------------------
  |  Branch (440:20): [True: 3, False: 4.75k]
  ------------------
  441|      3|                  ctx.error = error_code::syntax_error;
  442|      3|                  return true;
  443|      3|               }
  444|  4.75k|            }
  445|  4.75k|            state.has_anchor = true;
  446|  4.75k|            state.anchor_name = std::string(name);
  447|  4.75k|            state.anchor_start = &*it;
  448|  4.75k|         }
  449|       |
  450|   127k|         return false;
  451|   127k|      }
_ZN3glz4yaml12handle_aliasITnDaXtlNS0_9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj32EEERNSt3__112basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEENS0_12yaml_contextEPKcSD_EEbOT0_RT1_RT2_T3_:
  300|   127k|      {
  301|   127k|         if (it == end || *it != '*') return false;
  ------------------
  |  Branch (301:14): [True: 0, False: 127k]
  |  Branch (301:27): [True: 123k, False: 3.51k]
  ------------------
  302|       |
  303|  3.51k|         ++it; // skip '*'
  304|  3.51k|         auto name = parse_anchor_name(it, end);
  305|  3.51k|         if (name.empty()) {
  ------------------
  |  Branch (305:14): [True: 5, False: 3.50k]
  ------------------
  306|      5|            ctx.error = error_code::syntax_error;
  307|      5|            return true;
  308|      5|         }
  309|       |
  310|  3.50k|         auto anchor_it = ctx.anchors.find(name);
  311|  3.50k|         if (anchor_it == ctx.anchors.end()) {
  ------------------
  |  Branch (311:14): [True: 41, False: 3.46k]
  ------------------
  312|     41|            ctx.error = error_code::syntax_error; // undefined alias
  313|     41|            return true;
  314|     41|         }
  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.46k|         const auto span = anchor_it->second;
  319|       |
  320|       |         // Empty anchor span (anchor on null/empty node) — leave value as default
  321|  3.46k|         if (span.begin == span.end) {
  ------------------
  |  Branch (321:14): [True: 273, False: 3.19k]
  ------------------
  322|    273|            return true;
  323|    273|         }
  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.19k|         if (ctx.alias_span_is_replaying(span.begin, span.end)) [[unlikely]] {
  ------------------
  |  Branch (328:14): [True: 12, False: 3.18k]
  ------------------
  329|     12|            ctx.error = error_code::syntax_error; // cyclic alias
  330|     12|            return true;
  331|     12|         }
  332|       |
  333|       |         // Replaying an anchor re-enters the reader directly, bypassing the variant reader's
  334|       |         // depth guard, so this is the only depth accounting a chain of aliases into a
  335|       |         // non-variant target gets. The cycle check above stops the unbounded case; this bounds
  336|       |         // a legitimate but deeply chained one.
  337|  3.18k|         depth_guard guard{ctx, yaml::max_yaml_recursive_depth};
  338|  3.18k|         if (!guard) [[unlikely]]
  ------------------
  |  Branch (338:14): [True: 1, False: 3.18k]
  ------------------
  339|      1|            return true;
  340|       |
  341|  3.18k|         if (!ctx.charge_alias_expansion(static_cast<size_t>(span.end - span.begin))) [[unlikely]] {
  ------------------
  |  Branch (341:14): [True: 0, False: 3.18k]
  ------------------
  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.18k|         auto replay_it = span.begin;
  348|  3.18k|         auto replay_end = span.end;
  349|       |
  350|       |         // Save indent context and set up for replay
  351|  3.18k|         auto saved_indent_stack = std::move(ctx.indent_stack);
  352|  3.18k|         ctx.indent_stack.clear();
  353|  3.18k|         if (span.base_indent > 0) {
  ------------------
  |  Branch (353:14): [True: 1.77k, False: 1.40k]
  ------------------
  354|  1.77k|            ctx.push_indent(span.base_indent - 1);
  355|  1.77k|         }
  356|       |
  357|  3.18k|         ctx.active_alias_spans.emplace_back(span.begin, span.end);
  358|       |
  359|  3.18k|         using V = std::remove_cvref_t<T>;
  360|  3.18k|         from<YAML, V>::template op<Opts>(std::forward<T>(value), ctx, replay_it, replay_end);
  361|       |
  362|  3.18k|         ctx.active_alias_spans.pop_back();
  363|       |
  364|       |         // Restore indent context
  365|  3.18k|         ctx.indent_stack = std::move(saved_indent_stack);
  366|  3.18k|         return true;
  367|  3.18k|      }
_ZN3glz33process_yaml_variant_alternativesINSt3__17variantIJDndNS1_12basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEbNS1_6vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS6_ISD_EEEENSC_ISD_EEEEENS_19is_yaml_variant_numEE2opITnDaXtlNS_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj32EEERSH_TkNS_10is_contextERNSL_12yaml_contextERPKcSR_EEvOT0_OT1_OT2_T3_:
 5205|  33.4k|      {
 5206|  33.4k|         constexpr auto category_count = yaml_variant_count_v<Variant, Trait>;
 5207|       |
 5208|       |         if constexpr (category_count == 0) {
 5209|       |            ctx.error = error_code::no_matching_variant_type;
 5210|       |         }
 5211|  33.4k|         else if constexpr (category_count == 1) {
 5212|       |            // Only one type in this category, use it directly
 5213|  33.4k|            constexpr auto first_idx = yaml_variant_first_index_v<Variant, Trait>;
 5214|  33.4k|            using V = std::variant_alternative_t<first_idx, Variant>;
 5215|  33.4k|            if (!std::holds_alternative<V>(value)) value = V{};
  ------------------
  |  Branch (5215:17): [True: 33.4k, False: 0]
  ------------------
 5216|  33.4k|            from<YAML, V>::template op<Opts>(std::get<V>(value), ctx, it, end);
 5217|       |         }
 5218|       |         else {
 5219|       |            // Multiple types in this category, try each one
 5220|       |            constexpr auto N = std::variant_size_v<Variant>;
 5221|       |            bool found_match{};
 5222|       |            size_t match_idx = 0;
 5223|       |            // Only the last alternative propagates its error, so an alternative that exhausted an
 5224|       |            // expansion budget would otherwise be reported as no_matching_variant_type -- a wrong
 5225|       |            // diagnosis for a document that is hostile rather than merely the wrong shape. Held
 5226|       |            // aside and used only if nothing matched, so an alternative that does succeed later
 5227|       |            // (one that materializes no key text can still parse under a latched budget) is
 5228|       |            // unaffected.
 5229|       |            error_code expansion_error{};
 5230|       |            std::string_view expansion_message{};
 5231|       |
 5232|       |            for_each<N>([&]<size_t I>() {
 5233|       |               if (found_match) {
 5234|       |                  return;
 5235|       |               }
 5236|       |               using V = std::variant_alternative_t<I, Variant>;
 5237|       |               if constexpr (Trait<V>::value) {
 5238|       |                  auto copy_it = it;
 5239|       |                  if (!std::holds_alternative<V>(value)) {
 5240|       |                     value = V{};
 5241|       |                  }
 5242|       |
 5243|       |                  auto temp_ctx = ctx.make_speculative();
 5244|       |                  from<YAML, V>::template op<Opts>(std::get<V>(value), temp_ctx, it, end);
 5245|       |
 5246|       |                  // Charged whether or not the alternative fit: a rejected probe still replayed
 5247|       |                  // whatever aliases it reached, and an attempt that is never billed is an
 5248|       |                  // attempt that can be repeated for free.
 5249|       |                  ctx.alias_expansion_budget = temp_ctx.alias_expansion_budget;
 5250|       |                  ctx.key_expansion_budget = temp_ctx.key_expansion_budget;
 5251|       |
 5252|       |                  if (!bool(temp_ctx.error)) {
 5253|       |                     found_match = true;
 5254|       |                     ctx.anchors = std::move(temp_ctx.anchors);
 5255|       |                  }
 5256|       |                  else {
 5257|       |                     it = copy_it;
 5258|       |                     if (temp_ctx.error == error_code::exceeded_max_expansion && expansion_error == error_code::none) {
 5259|       |                        expansion_error = temp_ctx.error;
 5260|       |                        expansion_message = temp_ctx.custom_error_message;
 5261|       |                     }
 5262|       |                     if (match_idx + 1 < category_count) {
 5263|       |                        // Not the last type, continue trying
 5264|       |                     }
 5265|       |                     else {
 5266|       |                        // Last type failed, propagate error
 5267|       |                        ctx.error = temp_ctx.error;
 5268|       |                        ctx.custom_error_message = temp_ctx.custom_error_message;
 5269|       |                     }
 5270|       |                  }
 5271|       |                  ++match_idx;
 5272|       |               }
 5273|       |            });
 5274|       |
 5275|       |            if (!found_match && !bool(ctx.error)) {
 5276|       |               if (expansion_error != error_code::none) {
 5277|       |                  ctx.error = expansion_error;
 5278|       |                  ctx.custom_error_message = expansion_message;
 5279|       |               }
 5280|       |               else {
 5281|       |                  ctx.error = error_code::no_matching_variant_type;
 5282|       |               }
 5283|       |            }
 5284|       |         }
 5285|  33.4k|      }
_ZN3glz4fromILj450EdE2opITnDaXtlNS_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj32EEERPKcRdTkNS_10is_contextERNS3_12yaml_contextES6_EEvOT1_OT2_OT0_T3_:
 2047|  35.8k|      {
 2048|  35.8k|         if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2048:14): [True: 0, False: 35.8k]
  ------------------
 2049|      0|            return;
 2050|       |
 2051|  35.8k|         yaml::node_preamble_state preamble{};
 2052|  35.8k|         if (yaml::parse_node_preamble<Opts>(value, ctx, it, end, preamble, [](yaml::yaml_tag tag) {
  ------------------
  |  Branch (2052:14): [True: 4.38k, False: 31.4k]
  ------------------
 2053|  35.8k|                if constexpr (std::floating_point<std::remove_cvref_t<T>>) {
 2054|  35.8k|                   return yaml::tag_valid_for_float(tag);
 2055|  35.8k|                }
 2056|  35.8k|                else {
 2057|  35.8k|                   return yaml::tag_valid_for_int(tag);
 2058|  35.8k|                }
 2059|  35.8k|             }))
 2060|  4.38k|            return;
 2061|       |
 2062|  31.4k|         auto finalize = [&] { yaml::finalize_node_anchor(preamble.node_props, ctx, it); };
 2063|       |
 2064|       |         // Check for special float values
 2065|  31.4k|         if constexpr (std::floating_point<std::remove_cvref_t<T>>) {
 2066|  31.4k|            auto start = it;
 2067|       |
 2068|       |            // Check for .inf, .nan, -.inf, etc.
 2069|  31.4k|            if (*it == '.') {
  ------------------
  |  Branch (2069:17): [True: 7.54k, False: 23.9k]
  ------------------
 2070|  7.54k|               ++it;
 2071|  7.54k|               if (it + 3 <= end && (std::string_view(it, 3) == "inf" || std::string_view(it, 3) == "Inf" ||
  ------------------
  |  Branch (2071:20): [True: 7.16k, False: 385]
  |  Branch (2071:38): [True: 514, False: 6.65k]
  |  Branch (2071:74): [True: 153, False: 6.49k]
  ------------------
 2072|  6.49k|                                     std::string_view(it, 3) == "INF")) {
  ------------------
  |  Branch (2072:38): [True: 336, False: 6.16k]
  ------------------
 2073|  1.00k|                  value = std::numeric_limits<std::remove_cvref_t<T>>::infinity();
 2074|  1.00k|                  it += 3;
 2075|  1.00k|                  finalize();
 2076|  1.00k|                  return;
 2077|  1.00k|               }
 2078|  6.54k|               if (it + 3 <= end && (std::string_view(it, 3) == "nan" || std::string_view(it, 3) == "NaN" ||
  ------------------
  |  Branch (2078:20): [True: 6.16k, False: 385]
  |  Branch (2078:38): [True: 325, False: 5.83k]
  |  Branch (2078:74): [True: 574, False: 5.26k]
  ------------------
 2079|  5.26k|                                     std::string_view(it, 3) == "NAN")) {
  ------------------
  |  Branch (2079:38): [True: 311, False: 4.95k]
  ------------------
 2080|  1.21k|                  value = std::numeric_limits<std::remove_cvref_t<T>>::quiet_NaN();
 2081|  1.21k|                  it += 3;
 2082|  1.21k|                  finalize();
 2083|  1.21k|                  return;
 2084|  1.21k|               }
 2085|  5.33k|               it = start;
 2086|  5.33k|            }
 2087|       |
 2088|  29.2k|            if (*it == '-' || *it == '+') {
  ------------------
  |  Branch (2088:17): [True: 1.56k, False: 27.6k]
  |  Branch (2088:31): [True: 2.93k, False: 24.7k]
  ------------------
 2089|  4.50k|               const char sign = *it;
 2090|  4.50k|               ++it;
 2091|  4.50k|               if (it != end && *it == '.') {
  ------------------
  |  Branch (2091:20): [True: 4.41k, False: 89]
  |  Branch (2091:33): [True: 2.43k, False: 1.97k]
  ------------------
 2092|  2.43k|                  ++it;
 2093|  2.43k|                  if (it + 3 <= end && (std::string_view(it, 3) == "inf" || std::string_view(it, 3) == "Inf" ||
  ------------------
  |  Branch (2093:23): [True: 2.10k, False: 329]
  |  Branch (2093:41): [True: 343, False: 1.76k]
  |  Branch (2093:77): [True: 299, False: 1.46k]
  ------------------
 2094|  1.46k|                                        std::string_view(it, 3) == "INF")) {
  ------------------
  |  Branch (2094:41): [True: 319, False: 1.14k]
  ------------------
 2095|    961|                     if (sign == '-') {
  ------------------
  |  Branch (2095:26): [True: 640, False: 321]
  ------------------
 2096|    640|                        value = -std::numeric_limits<std::remove_cvref_t<T>>::infinity();
 2097|    640|                     }
 2098|    321|                     else {
 2099|    321|                        value = std::numeric_limits<std::remove_cvref_t<T>>::infinity();
 2100|    321|                     }
 2101|    961|                     it += 3;
 2102|    961|                     finalize();
 2103|    961|                     return;
 2104|    961|                  }
 2105|  2.43k|               }
 2106|  3.53k|               it = start;
 2107|  3.53k|            }
 2108|  29.2k|         }
 2109|       |
 2110|       |         // Parse as plain scalar and convert
 2111|  28.2k|         auto start = it;
 2112|       |
 2113|       |         // Find end of number - use same rules as plain scalar for colons
 2114|  11.7M|         while (it != end) {
  ------------------
  |  Branch (2114:17): [True: 11.7M, False: 8.74k]
  ------------------
 2115|  11.7M|            const char c = *it;
 2116|  11.7M|            if (c == ' ' || c == '\t' || c == '\n' || c == '\r' || c == ',' || c == ']' || c == '}' || c == '#') {
  ------------------
  |  Branch (2116:17): [True: 7.86k, False: 11.7M]
  |  Branch (2116:29): [True: 1.12k, False: 11.7M]
  |  Branch (2116:42): [True: 3.32k, False: 11.7M]
  |  Branch (2116:55): [True: 1.33k, False: 11.7M]
  |  Branch (2116:68): [True: 1.18k, False: 11.7M]
  |  Branch (2116:80): [True: 661, False: 11.7M]
  |  Branch (2116:92): [True: 972, False: 11.7M]
  |  Branch (2116:104): [True: 3.10k, False: 11.7M]
  ------------------
 2117|  19.5k|               break;
 2118|  19.5k|            }
 2119|       |            // Colon only ends number if followed by space/tab/newline/end (YAML mapping indicator)
 2120|  11.7M|            if (c == ':') {
  ------------------
  |  Branch (2120:17): [True: 16.5k, False: 11.7M]
  ------------------
 2121|  16.5k|               if ((it + 1) == end || *(it + 1) == ' ' || *(it + 1) == '\t' || *(it + 1) == '\n' || *(it + 1) == '\r') {
  ------------------
  |  Branch (2121:20): [True: 318, False: 16.1k]
  |  Branch (2121:39): [True: 1.87k, False: 14.3k]
  |  Branch (2121:59): [True: 101, False: 14.2k]
  |  Branch (2121:80): [True: 497, False: 13.7k]
  |  Branch (2121:101): [True: 377, False: 13.3k]
  ------------------
 2122|  3.16k|                  break;
 2123|  3.16k|               }
 2124|  16.5k|            }
 2125|  11.7M|            ++it;
 2126|  11.7M|         }
 2127|       |
 2128|  31.4k|         const std::string_view num_str(&*start, static_cast<size_t>(it - start));
 2129|       |
 2130|  31.4k|         if (num_str.empty()) {
  ------------------
  |  Branch (2130:14): [True: 1.14k, False: 30.3k]
  ------------------
 2131|  1.14k|            ctx.error = error_code::parse_number_failure;
 2132|  1.14k|            return;
 2133|  1.14k|         }
 2134|       |
 2135|       |         // Handle hex, octal, binary
 2136|       |         if constexpr (std::integral<std::remove_cvref_t<T>>) {
 2137|       |            if (num_str.size() > 2 && num_str[0] == '0') {
 2138|       |               int base = 10;
 2139|       |               size_t offset = 0;
 2140|       |
 2141|       |               if (num_str[1] == 'x' || num_str[1] == 'X') {
 2142|       |                  base = 16;
 2143|       |                  offset = 2;
 2144|       |               }
 2145|       |               else if (num_str[1] == 'o' || num_str[1] == 'O') {
 2146|       |                  base = 8;
 2147|       |                  offset = 2;
 2148|       |               }
 2149|       |               else if (num_str[1] == 'b' || num_str[1] == 'B') {
 2150|       |                  base = 2;
 2151|       |                  offset = 2;
 2152|       |               }
 2153|       |
 2154|       |               if (base != 10) {
 2155|       |                  const auto digits = num_str.substr(offset);
 2156|       |                  const bool has_underscores = (digits.find('_') != std::string_view::npos);
 2157|       |
 2158|       |                  std::string clean_storage;
 2159|       |                  std::string_view clean_view;
 2160|       |
 2161|       |                  if (has_underscores) {
 2162|       |                     clean_storage.reserve(digits.size());
 2163|       |                     for (char c : digits) {
 2164|       |                        if (c != '_') {
 2165|       |                           clean_storage.push_back(c);
 2166|       |                        }
 2167|       |                     }
 2168|       |                     clean_view = clean_storage;
 2169|       |                  }
 2170|       |                  else {
 2171|       |                     clean_view = digits;
 2172|       |                  }
 2173|       |
 2174|       |                  auto [ptr, ec] =
 2175|       |                     std::from_chars(clean_view.data(), clean_view.data() + clean_view.size(), value, base);
 2176|       |                  if (ec != std::errc{}) {
 2177|       |                     ctx.error = error_code::parse_number_failure;
 2178|       |                  }
 2179|       |                  finalize();
 2180|       |                  return;
 2181|       |               }
 2182|       |            }
 2183|       |         }
 2184|  30.3k|         else if constexpr (std::floating_point<std::remove_cvref_t<T>>) {
 2185|  30.3k|            bool negative = false;
 2186|  30.3k|            std::string_view digits = num_str;
 2187|       |
 2188|  30.3k|            if (!digits.empty() && (digits.front() == '+' || digits.front() == '-')) {
  ------------------
  |  Branch (2188:17): [True: 27.1k, False: 3.17k]
  |  Branch (2188:37): [True: 2.61k, False: 24.5k]
  |  Branch (2188:62): [True: 923, False: 23.6k]
  ------------------
 2189|  3.53k|               negative = (digits.front() == '-');
 2190|  3.53k|               digits.remove_prefix(1);
 2191|  3.53k|            }
 2192|       |
 2193|  30.3k|            if (digits.size() > 2 && digits[0] == '0') {
  ------------------
  |  Branch (2193:17): [True: 17.7k, False: 12.5k]
  |  Branch (2193:38): [True: 7.20k, False: 10.5k]
  ------------------
 2194|  7.20k|               int base = 10;
 2195|  7.20k|               size_t offset = 0;
 2196|       |
 2197|  7.20k|               if (digits[1] == 'x' || digits[1] == 'X') {
  ------------------
  |  Branch (2197:20): [True: 2.42k, False: 4.77k]
  |  Branch (2197:40): [True: 1.24k, False: 3.53k]
  ------------------
 2198|  3.66k|                  base = 16;
 2199|  3.66k|                  offset = 2;
 2200|  3.66k|               }
 2201|  3.53k|               else if (digits[1] == 'o' || digits[1] == 'O') {
  ------------------
  |  Branch (2201:25): [True: 82, False: 3.45k]
  |  Branch (2201:45): [True: 455, False: 2.99k]
  ------------------
 2202|    537|                  base = 8;
 2203|    537|                  offset = 2;
 2204|    537|               }
 2205|  2.99k|               else if (digits[1] == 'b' || digits[1] == 'B') {
  ------------------
  |  Branch (2205:25): [True: 162, False: 2.83k]
  |  Branch (2205:45): [True: 304, False: 2.52k]
  ------------------
 2206|    466|                  base = 2;
 2207|    466|                  offset = 2;
 2208|    466|               }
 2209|       |
 2210|  7.20k|               if (base != 10) {
  ------------------
  |  Branch (2210:20): [True: 4.67k, False: 2.52k]
  ------------------
 2211|  4.67k|                  auto raw_digits = digits.substr(offset);
 2212|  4.67k|                  const bool has_underscores = (raw_digits.find('_') != std::string_view::npos);
 2213|       |
 2214|  4.67k|                  std::string clean_storage;
 2215|  4.67k|                  std::string_view clean_view;
 2216|  4.67k|                  if (has_underscores) {
  ------------------
  |  Branch (2216:23): [True: 2.09k, False: 2.57k]
  ------------------
 2217|  2.09k|                     clean_storage.reserve(raw_digits.size());
 2218|  2.33M|                     for (char c : raw_digits) {
  ------------------
  |  Branch (2218:34): [True: 2.33M, False: 2.09k]
  ------------------
 2219|  2.33M|                        if (c != '_') {
  ------------------
  |  Branch (2219:29): [True: 2.32M, False: 3.58k]
  ------------------
 2220|  2.32M|                           clean_storage.push_back(c);
 2221|  2.32M|                        }
 2222|  2.33M|                     }
 2223|  2.09k|                     clean_view = clean_storage;
 2224|  2.09k|                  }
 2225|  2.57k|                  else {
 2226|  2.57k|                     clean_view = raw_digits;
 2227|  2.57k|                  }
 2228|       |
 2229|  4.67k|                  uint64_t parsed_int{};
 2230|  4.67k|                  auto [ptr, ec] =
 2231|  4.67k|                     std::from_chars(clean_view.data(), clean_view.data() + clean_view.size(), parsed_int, base);
 2232|  4.67k|                  if (ec != std::errc{} || ptr != (clean_view.data() + clean_view.size())) {
  ------------------
  |  Branch (2232:23): [True: 2.30k, False: 2.36k]
  |  Branch (2232:44): [True: 1.37k, False: 988]
  ------------------
 2233|  3.68k|                     ctx.error = error_code::parse_number_failure;
 2234|  3.68k|                     finalize();
 2235|  3.68k|                     return;
 2236|  3.68k|                  }
 2237|       |
 2238|    988|                  const auto as_float = static_cast<std::remove_cvref_t<T>>(parsed_int);
 2239|    988|                  value = negative ? -as_float : as_float;
  ------------------
  |  Branch (2239:27): [True: 526, False: 462]
  ------------------
 2240|    988|                  finalize();
 2241|    988|                  return;
 2242|  4.67k|               }
 2243|  7.20k|            }
 2244|  30.3k|         }
 2245|       |
 2246|       |         // Standard number parsing - only allocate if underscores present
 2247|  25.6k|         const bool has_underscores = (num_str.find('_') != std::string_view::npos);
 2248|       |
 2249|  30.3k|         std::string clean_storage;
 2250|  30.3k|         std::string_view clean_view;
 2251|       |
 2252|  30.3k|         if (has_underscores) {
  ------------------
  |  Branch (2252:14): [True: 1.59k, False: 28.7k]
  ------------------
 2253|  1.59k|            clean_storage.reserve(num_str.size());
 2254|  1.76M|            for (char c : num_str) {
  ------------------
  |  Branch (2254:25): [True: 1.76M, False: 1.59k]
  ------------------
 2255|  1.76M|               if (c != '_') {
  ------------------
  |  Branch (2255:20): [True: 1.76M, False: 2.92k]
  ------------------
 2256|  1.76M|                  clean_storage.push_back(c);
 2257|  1.76M|               }
 2258|  1.76M|            }
 2259|  1.59k|            clean_view = clean_storage;
 2260|  1.59k|         }
 2261|  28.7k|         else {
 2262|  28.7k|            clean_view = num_str;
 2263|  28.7k|         }
 2264|       |
 2265|       |         // YAML allows leading '+' for positive numbers, but C++ from_chars doesn't
 2266|       |         // Strip leading '+' if present
 2267|  30.3k|         auto parse_view = clean_view;
 2268|  30.3k|         if (!parse_view.empty() && parse_view.front() == '+') {
  ------------------
  |  Branch (2268:14): [True: 22.4k, False: 7.91k]
  |  Branch (2268:37): [True: 2.60k, False: 19.8k]
  ------------------
 2269|  2.60k|            parse_view.remove_prefix(1);
 2270|  2.60k|            if (parse_view.empty()) {
  ------------------
  |  Branch (2270:17): [True: 510, False: 2.09k]
  ------------------
 2271|    510|               ctx.error = error_code::parse_number_failure;
 2272|    510|               return;
 2273|    510|            }
 2274|  2.60k|         }
 2275|       |
 2276|  29.8k|         if constexpr (std::floating_point<std::remove_cvref_t<T>>) {
 2277|  29.8k|            auto result = glz::fast_float::from_chars(parse_view.data(), parse_view.data() + parse_view.size(), value);
 2278|       |            // Check both for errors and that all input was consumed (e.g., "12:30" is not a valid number)
 2279|  29.8k|            if (result.ec != std::errc{} || result.ptr != parse_view.data() + parse_view.size()) {
  ------------------
  |  Branch (2279:17): [True: 15.1k, False: 14.6k]
  |  Branch (2279:45): [True: 8.84k, False: 5.83k]
  ------------------
 2280|  16.1k|               ctx.error = error_code::parse_number_failure;
 2281|  16.1k|            }
 2282|       |         }
 2283|       |         else {
 2284|       |            auto [ptr, ec] = std::from_chars(parse_view.data(), parse_view.data() + parse_view.size(), value);
 2285|       |            // Check both for errors and that all input was consumed
 2286|       |            if (ec != std::errc{} || ptr != parse_view.data() + parse_view.size()) {
 2287|       |               ctx.error = error_code::parse_number_failure;
 2288|       |            }
 2289|       |         }
 2290|       |
 2291|  29.8k|         finalize();
 2292|  29.8k|      }
_ZN3glz4yaml19parse_node_preambleITnDaXtlNS0_9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj32EEEXtlNS0_20node_property_policyELb1EEELb0ERdNS0_12yaml_contextEPKcS7_ZNS_4fromILj450EdE2opITnDaXtlS2_Lj450ELb1ELb0ELb1ELh2ELb0ELj32EEERS7_S4_TkNS_10is_contextERS5_S7_EEvOT1_OT2_OT0_T3_EUlNS0_8yaml_tagEE_EEbSG_RSJ_RT4_T5_RNS0_19node_preamble_stateEOT6_:
  465|  35.8k|      {
  466|  35.8k|         skip_inline_ws(it, end);
  467|       |
  468|  35.8k|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (468:14): [True: 156, False: 35.7k]
  ------------------
  469|    156|            if constexpr (!AllowEmptyInput) {
  470|    156|               ctx.error = error_code::unexpected_end;
  471|    156|            }
  472|    156|            return true;
  473|    156|         }
  474|       |
  475|  35.7k|         preamble.tag = parse_yaml_tag(it, end, ctx);
  476|  35.7k|         if (preamble.tag == yaml_tag::unknown) [[unlikely]] {
  ------------------
  |  Branch (476:14): [True: 277, False: 35.4k]
  ------------------
  477|    277|            ctx.error = error_code::syntax_error;
  478|    277|            return true;
  479|    277|         }
  480|  35.4k|         if (!tag_validator(preamble.tag)) [[unlikely]] {
  ------------------
  |  Branch (480:14): [True: 75, False: 35.3k]
  ------------------
  481|     75|            ctx.error = error_code::syntax_error;
  482|     75|            return true;
  483|     75|         }
  484|       |
  485|  35.3k|         skip_inline_ws(it, end);
  486|       |
  487|  35.3k|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (487:14): [True: 114, False: 35.2k]
  ------------------
  488|    114|            if constexpr (!AllowEmptyInput) {
  489|    114|               ctx.error = error_code::unexpected_end;
  490|    114|            }
  491|    114|            return true;
  492|    114|         }
  493|       |
  494|  35.2k|         if (parse_node_properties<Opts, PropertyPolicy>(std::forward<T>(value), ctx, it, end, preamble.node_props)) {
  ------------------
  |  Branch (494:14): [True: 3.76k, False: 31.4k]
  ------------------
  495|  3.76k|            return true;
  496|  3.76k|         }
  497|       |
  498|  31.4k|         return false;
  499|  35.2k|      }
_ZZN3glz4fromILj450EdE2opITnDaXtlNS_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj32EEERPKcRdTkNS_10is_contextERNS3_12yaml_contextES6_EEvOT1_OT2_OT0_T3_ENKUlNS3_8yaml_tagEE_clESI_:
 2052|  35.4k|         if (yaml::parse_node_preamble<Opts>(value, ctx, it, end, preamble, [](yaml::yaml_tag tag) {
 2053|  35.4k|                if constexpr (std::floating_point<std::remove_cvref_t<T>>) {
 2054|  35.4k|                   return yaml::tag_valid_for_float(tag);
 2055|       |                }
 2056|       |                else {
 2057|       |                   return yaml::tag_valid_for_int(tag);
 2058|       |                }
 2059|  35.4k|             }))
_ZN3glz4yaml21parse_node_propertiesITnDaXtlNS0_9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj32EEEXtlNS0_20node_property_policyELb1EEERdNS0_12yaml_contextEPKcS7_EEbOT1_RT2_RT3_T4_RNS0_19node_property_stateE:
  408|  35.2k|      {
  409|  35.2k|         state.has_anchor = false;
  410|  35.2k|         state.anchor_name.clear();
  411|  35.2k|         state.anchor_start = nullptr;
  412|  35.2k|         state.anchor_indent = ctx.current_indent();
  413|       |
  414|  35.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|  35.2k|            else {
  421|  35.2k|               if (handle_alias<Opts>(std::forward<T>(value), ctx, it, end)) return true;
  ------------------
  |  Branch (421:20): [True: 3.38k, False: 31.8k]
  ------------------
  422|  35.2k|            }
  423|  35.2k|         }
  424|       |
  425|  35.2k|         if (it != end && *it == '&') {
  ------------------
  |  Branch (425:14): [True: 31.8k, False: 3.38k]
  |  Branch (425:27): [True: 2.87k, False: 28.9k]
  ------------------
  426|  2.87k|            ++it;
  427|  2.87k|            auto name = parse_anchor_name(it, end);
  428|  2.87k|            if (name.empty()) {
  ------------------
  |  Branch (428:17): [True: 194, False: 2.68k]
  ------------------
  429|    194|               ctx.error = error_code::syntax_error;
  430|    194|               return true;
  431|    194|            }
  432|  2.68k|            skip_inline_ws(it, end);
  433|  2.68k|            if (it == end) {
  ------------------
  |  Branch (433:17): [True: 186, False: 2.49k]
  ------------------
  434|    186|               if constexpr (!Policy.allow_empty_after_anchor) {
  435|    186|                  ctx.error = error_code::unexpected_end;
  436|    186|               }
  437|    186|               return true;
  438|    186|            }
  439|       |            if constexpr (Policy.disallow_anchor_on_alias) {
  440|       |               if (*it == '*') {
  441|       |                  ctx.error = error_code::syntax_error;
  442|       |                  return true;
  443|       |               }
  444|       |            }
  445|  2.49k|            state.has_anchor = true;
  446|  2.49k|            state.anchor_name = std::string(name);
  447|  2.49k|            state.anchor_start = &*it;
  448|  2.49k|         }
  449|       |
  450|  34.8k|         return false;
  451|  35.2k|      }
_ZN3glz4yaml12handle_aliasITnDaXtlNS0_9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj32EEERdNS0_12yaml_contextEPKcS6_EEbOT0_RT1_RT2_T3_:
  300|  35.2k|      {
  301|  35.2k|         if (it == end || *it != '*') return false;
  ------------------
  |  Branch (301:14): [True: 0, False: 35.2k]
  |  Branch (301:27): [True: 31.8k, False: 3.38k]
  ------------------
  302|       |
  303|  3.38k|         ++it; // skip '*'
  304|  3.38k|         auto name = parse_anchor_name(it, end);
  305|  3.38k|         if (name.empty()) {
  ------------------
  |  Branch (305:14): [True: 206, False: 3.17k]
  ------------------
  306|    206|            ctx.error = error_code::syntax_error;
  307|    206|            return true;
  308|    206|         }
  309|       |
  310|  3.17k|         auto anchor_it = ctx.anchors.find(name);
  311|  3.17k|         if (anchor_it == ctx.anchors.end()) {
  ------------------
  |  Branch (311:14): [True: 606, False: 2.56k]
  ------------------
  312|    606|            ctx.error = error_code::syntax_error; // undefined alias
  313|    606|            return true;
  314|    606|         }
  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.56k|         const auto span = anchor_it->second;
  319|       |
  320|       |         // Empty anchor span (anchor on null/empty node) — leave value as default
  321|  2.56k|         if (span.begin == span.end) {
  ------------------
  |  Branch (321:14): [True: 73, False: 2.49k]
  ------------------
  322|     73|            return true;
  323|     73|         }
  324|       |
  325|       |         // An anchor is invisible to itself while it expands. A span that aliases the name it
  326|       |         // defines -- reachable because a mapping key's anchor is registered over the key text
  327|       |         // before that text is parsed -- would otherwise replay itself forever.
  328|  2.49k|         if (ctx.alias_span_is_replaying(span.begin, span.end)) [[unlikely]] {
  ------------------
  |  Branch (328:14): [True: 86, False: 2.41k]
  ------------------
  329|     86|            ctx.error = error_code::syntax_error; // cyclic alias
  330|     86|            return true;
  331|     86|         }
  332|       |
  333|       |         // Replaying an anchor re-enters the reader directly, bypassing the variant reader's
  334|       |         // depth guard, so this is the only depth accounting a chain of aliases into a
  335|       |         // non-variant target gets. The cycle check above stops the unbounded case; this bounds
  336|       |         // a legitimate but deeply chained one.
  337|  2.41k|         depth_guard guard{ctx, yaml::max_yaml_recursive_depth};
  338|  2.41k|         if (!guard) [[unlikely]]
  ------------------
  |  Branch (338:14): [True: 1, False: 2.40k]
  ------------------
  339|      1|            return true;
  340|       |
  341|  2.40k|         if (!ctx.charge_alias_expansion(static_cast<size_t>(span.end - span.begin))) [[unlikely]] {
  ------------------
  |  Branch (341:14): [True: 0, False: 2.40k]
  ------------------
  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.40k|         auto replay_it = span.begin;
  348|  2.40k|         auto replay_end = span.end;
  349|       |
  350|       |         // Save indent context and set up for replay
  351|  2.40k|         auto saved_indent_stack = std::move(ctx.indent_stack);
  352|  2.40k|         ctx.indent_stack.clear();
  353|  2.40k|         if (span.base_indent > 0) {
  ------------------
  |  Branch (353:14): [True: 2.19k, False: 210]
  ------------------
  354|  2.19k|            ctx.push_indent(span.base_indent - 1);
  355|  2.19k|         }
  356|       |
  357|  2.40k|         ctx.active_alias_spans.emplace_back(span.begin, span.end);
  358|       |
  359|  2.40k|         using V = std::remove_cvref_t<T>;
  360|  2.40k|         from<YAML, V>::template op<Opts>(std::forward<T>(value), ctx, replay_it, replay_end);
  361|       |
  362|  2.40k|         ctx.active_alias_spans.pop_back();
  363|       |
  364|       |         // Restore indent context
  365|  2.40k|         ctx.indent_stack = std::move(saved_indent_stack);
  366|  2.40k|         return true;
  367|  2.40k|      }
_ZZN3glz4fromILj450EdE2opITnDaXtlNS_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj32EEERPKcRdTkNS_10is_contextERNS3_12yaml_contextES6_EEvOT1_OT2_OT0_T3_ENKUlvE_clEv:
 2062|  29.8k|         auto finalize = [&] { yaml::finalize_node_anchor(preamble.node_props, ctx, it); };
_ZN3glz33process_yaml_variant_alternativesINSt3__17variantIJDndNS1_12basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEbNS1_6vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS6_ISD_EEEENSC_ISD_EEEEENS_20is_yaml_variant_boolEE2opITnDaXtlNS_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj32EEERSH_TkNS_10is_contextERNSL_12yaml_contextERPKcSR_EEvOT0_OT1_OT2_T3_:
 5205|  10.8k|      {
 5206|  10.8k|         constexpr auto category_count = yaml_variant_count_v<Variant, Trait>;
 5207|       |
 5208|       |         if constexpr (category_count == 0) {
 5209|       |            ctx.error = error_code::no_matching_variant_type;
 5210|       |         }
 5211|  10.8k|         else if constexpr (category_count == 1) {
 5212|       |            // Only one type in this category, use it directly
 5213|  10.8k|            constexpr auto first_idx = yaml_variant_first_index_v<Variant, Trait>;
 5214|  10.8k|            using V = std::variant_alternative_t<first_idx, Variant>;
 5215|  10.8k|            if (!std::holds_alternative<V>(value)) value = V{};
  ------------------
  |  Branch (5215:17): [True: 10.8k, False: 0]
  ------------------
 5216|  10.8k|            from<YAML, V>::template op<Opts>(std::get<V>(value), ctx, it, end);
 5217|       |         }
 5218|       |         else {
 5219|       |            // Multiple types in this category, try each one
 5220|       |            constexpr auto N = std::variant_size_v<Variant>;
 5221|       |            bool found_match{};
 5222|       |            size_t match_idx = 0;
 5223|       |            // Only the last alternative propagates its error, so an alternative that exhausted an
 5224|       |            // expansion budget would otherwise be reported as no_matching_variant_type -- a wrong
 5225|       |            // diagnosis for a document that is hostile rather than merely the wrong shape. Held
 5226|       |            // aside and used only if nothing matched, so an alternative that does succeed later
 5227|       |            // (one that materializes no key text can still parse under a latched budget) is
 5228|       |            // unaffected.
 5229|       |            error_code expansion_error{};
 5230|       |            std::string_view expansion_message{};
 5231|       |
 5232|       |            for_each<N>([&]<size_t I>() {
 5233|       |               if (found_match) {
 5234|       |                  return;
 5235|       |               }
 5236|       |               using V = std::variant_alternative_t<I, Variant>;
 5237|       |               if constexpr (Trait<V>::value) {
 5238|       |                  auto copy_it = it;
 5239|       |                  if (!std::holds_alternative<V>(value)) {
 5240|       |                     value = V{};
 5241|       |                  }
 5242|       |
 5243|       |                  auto temp_ctx = ctx.make_speculative();
 5244|       |                  from<YAML, V>::template op<Opts>(std::get<V>(value), temp_ctx, it, end);
 5245|       |
 5246|       |                  // Charged whether or not the alternative fit: a rejected probe still replayed
 5247|       |                  // whatever aliases it reached, and an attempt that is never billed is an
 5248|       |                  // attempt that can be repeated for free.
 5249|       |                  ctx.alias_expansion_budget = temp_ctx.alias_expansion_budget;
 5250|       |                  ctx.key_expansion_budget = temp_ctx.key_expansion_budget;
 5251|       |
 5252|       |                  if (!bool(temp_ctx.error)) {
 5253|       |                     found_match = true;
 5254|       |                     ctx.anchors = std::move(temp_ctx.anchors);
 5255|       |                  }
 5256|       |                  else {
 5257|       |                     it = copy_it;
 5258|       |                     if (temp_ctx.error == error_code::exceeded_max_expansion && expansion_error == error_code::none) {
 5259|       |                        expansion_error = temp_ctx.error;
 5260|       |                        expansion_message = temp_ctx.custom_error_message;
 5261|       |                     }
 5262|       |                     if (match_idx + 1 < category_count) {
 5263|       |                        // Not the last type, continue trying
 5264|       |                     }
 5265|       |                     else {
 5266|       |                        // Last type failed, propagate error
 5267|       |                        ctx.error = temp_ctx.error;
 5268|       |                        ctx.custom_error_message = temp_ctx.custom_error_message;
 5269|       |                     }
 5270|       |                  }
 5271|       |                  ++match_idx;
 5272|       |               }
 5273|       |            });
 5274|       |
 5275|       |            if (!found_match && !bool(ctx.error)) {
 5276|       |               if (expansion_error != error_code::none) {
 5277|       |                  ctx.error = expansion_error;
 5278|       |                  ctx.custom_error_message = expansion_message;
 5279|       |               }
 5280|       |               else {
 5281|       |                  ctx.error = error_code::no_matching_variant_type;
 5282|       |               }
 5283|       |            }
 5284|       |         }
 5285|  10.8k|      }
_ZN3glz4fromILj450EbE2opITnDaXtlNS_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj32EEERPKcRbTkNS_10is_contextERNS3_12yaml_contextES6_EEvOT1_OT2_OT0_T3_:
 2012|  11.2k|      {
 2013|  11.2k|         if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2013:14): [True: 0, False: 11.2k]
  ------------------
 2014|      0|            return;
 2015|       |
 2016|  11.2k|         yaml::node_preamble_state preamble{};
 2017|  11.2k|         if (yaml::parse_node_preamble<Opts>(value, ctx, it, end, preamble,
  ------------------
  |  Branch (2017:14): [True: 1.04k, False: 10.1k]
  ------------------
 2018|  11.2k|                                             [](yaml::yaml_tag tag) { return yaml::tag_valid_for_bool(tag); }))
 2019|  1.04k|            return;
 2020|       |
 2021|       |         // Parse as plain scalar first
 2022|  10.1k|         std::string str;
 2023|  10.1k|         yaml::parse_plain_scalar(str, ctx, it, end, yaml::check_flow_context(Opts));
 2024|       |
 2025|  10.1k|         if (str == "true" || str == "True" || str == "TRUE" || str == "yes" || str == "Yes" || str == "YES" ||
  ------------------
  |  Branch (2025:14): [True: 1.92k, False: 8.23k]
  |  Branch (2025:31): [True: 1.87k, False: 6.36k]
  |  Branch (2025:48): [True: 327, False: 6.03k]
  |  Branch (2025:65): [True: 249, False: 5.78k]
  |  Branch (2025:81): [True: 138, False: 5.64k]
  |  Branch (2025:97): [True: 1, False: 5.64k]
  ------------------
 2026|  5.64k|             str == "on" || str == "On" || str == "ON") {
  ------------------
  |  Branch (2026:14): [True: 447, False: 5.20k]
  |  Branch (2026:29): [True: 259, False: 4.94k]
  |  Branch (2026:44): [True: 391, False: 4.55k]
  ------------------
 2027|  5.61k|            value = true;
 2028|  5.61k|         }
 2029|  4.55k|         else if (str == "false" || str == "False" || str == "FALSE" || str == "no" || str == "No" || str == "NO" ||
  ------------------
  |  Branch (2029:19): [True: 665, False: 3.88k]
  |  Branch (2029:37): [True: 160, False: 3.72k]
  |  Branch (2029:55): [True: 845, False: 2.88k]
  |  Branch (2029:73): [True: 2.07k, False: 808]
  |  Branch (2029:88): [True: 277, False: 531]
  |  Branch (2029:103): [True: 149, False: 382]
  ------------------
 2030|  4.33k|                  str == "off" || str == "Off" || str == "OFF") {
  ------------------
  |  Branch (2030:19): [True: 93, False: 289]
  |  Branch (2030:35): [True: 37, False: 252]
  |  Branch (2030:51): [True: 39, False: 213]
  ------------------
 2031|  4.33k|            value = false;
 2032|  4.33k|         }
 2033|    213|         else {
 2034|    213|            ctx.error = error_code::expected_true_or_false;
 2035|    213|         }
 2036|       |
 2037|  10.1k|         yaml::finalize_node_anchor(preamble.node_props, ctx, it);
 2038|  10.1k|      }
_ZN3glz4yaml19parse_node_preambleITnDaXtlNS0_9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj32EEEXtlNS0_20node_property_policyELb1EEELb0ERbNS0_12yaml_contextEPKcS7_ZNS_4fromILj450EbE2opITnDaXtlS2_Lj450ELb1ELb0ELb1ELh2ELb0ELj32EEERS7_S4_TkNS_10is_contextERS5_S7_EEvOT1_OT2_OT0_T3_EUlNS0_8yaml_tagEE_EEbSG_RSJ_RT4_T5_RNS0_19node_preamble_stateEOT6_:
  465|  11.2k|      {
  466|  11.2k|         skip_inline_ws(it, end);
  467|       |
  468|  11.2k|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (468:14): [True: 0, False: 11.2k]
  ------------------
  469|      0|            if constexpr (!AllowEmptyInput) {
  470|      0|               ctx.error = error_code::unexpected_end;
  471|      0|            }
  472|      0|            return true;
  473|      0|         }
  474|       |
  475|  11.2k|         preamble.tag = parse_yaml_tag(it, end, ctx);
  476|  11.2k|         if (preamble.tag == yaml_tag::unknown) [[unlikely]] {
  ------------------
  |  Branch (476:14): [True: 1, False: 11.2k]
  ------------------
  477|      1|            ctx.error = error_code::syntax_error;
  478|      1|            return true;
  479|      1|         }
  480|  11.2k|         if (!tag_validator(preamble.tag)) [[unlikely]] {
  ------------------
  |  Branch (480:14): [True: 2, False: 11.2k]
  ------------------
  481|      2|            ctx.error = error_code::syntax_error;
  482|      2|            return true;
  483|      2|         }
  484|       |
  485|  11.2k|         skip_inline_ws(it, end);
  486|       |
  487|  11.2k|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (487:14): [True: 2, False: 11.2k]
  ------------------
  488|      2|            if constexpr (!AllowEmptyInput) {
  489|      2|               ctx.error = error_code::unexpected_end;
  490|      2|            }
  491|      2|            return true;
  492|      2|         }
  493|       |
  494|  11.2k|         if (parse_node_properties<Opts, PropertyPolicy>(std::forward<T>(value), ctx, it, end, preamble.node_props)) {
  ------------------
  |  Branch (494:14): [True: 1.04k, False: 10.1k]
  ------------------
  495|  1.04k|            return true;
  496|  1.04k|         }
  497|       |
  498|  10.1k|         return false;
  499|  11.2k|      }
_ZZN3glz4fromILj450EbE2opITnDaXtlNS_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj32EEERPKcRbTkNS_10is_contextERNS3_12yaml_contextES6_EEvOT1_OT2_OT0_T3_ENKUlNS3_8yaml_tagEE_clESI_:
 2018|  11.2k|                                             [](yaml::yaml_tag tag) { return yaml::tag_valid_for_bool(tag); }))
_ZN3glz4yaml21parse_node_propertiesITnDaXtlNS0_9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj32EEEXtlNS0_20node_property_policyELb1EEERbNS0_12yaml_contextEPKcS7_EEbOT1_RT2_RT3_T4_RNS0_19node_property_stateE:
  408|  11.2k|      {
  409|  11.2k|         state.has_anchor = false;
  410|  11.2k|         state.anchor_name.clear();
  411|  11.2k|         state.anchor_start = nullptr;
  412|  11.2k|         state.anchor_indent = ctx.current_indent();
  413|       |
  414|  11.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|  11.2k|            else {
  421|  11.2k|               if (handle_alias<Opts>(std::forward<T>(value), ctx, it, end)) return true;
  ------------------
  |  Branch (421:20): [True: 1.02k, False: 10.1k]
  ------------------
  422|  11.2k|            }
  423|  11.2k|         }
  424|       |
  425|  11.2k|         if (it != end && *it == '&') {
  ------------------
  |  Branch (425:14): [True: 10.1k, False: 1.02k]
  |  Branch (425:27): [True: 2.54k, False: 7.63k]
  ------------------
  426|  2.54k|            ++it;
  427|  2.54k|            auto name = parse_anchor_name(it, end);
  428|  2.54k|            if (name.empty()) {
  ------------------
  |  Branch (428:17): [True: 4, False: 2.54k]
  ------------------
  429|      4|               ctx.error = error_code::syntax_error;
  430|      4|               return true;
  431|      4|            }
  432|  2.54k|            skip_inline_ws(it, end);
  433|  2.54k|            if (it == end) {
  ------------------
  |  Branch (433:17): [True: 10, False: 2.53k]
  ------------------
  434|     10|               if constexpr (!Policy.allow_empty_after_anchor) {
  435|     10|                  ctx.error = error_code::unexpected_end;
  436|     10|               }
  437|     10|               return true;
  438|     10|            }
  439|       |            if constexpr (Policy.disallow_anchor_on_alias) {
  440|       |               if (*it == '*') {
  441|       |                  ctx.error = error_code::syntax_error;
  442|       |                  return true;
  443|       |               }
  444|       |            }
  445|  2.53k|            state.has_anchor = true;
  446|  2.53k|            state.anchor_name = std::string(name);
  447|  2.53k|            state.anchor_start = &*it;
  448|  2.53k|         }
  449|       |
  450|  11.1k|         return false;
  451|  11.2k|      }
_ZN3glz4yaml12handle_aliasITnDaXtlNS0_9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj32EEERbNS0_12yaml_contextEPKcS6_EEbOT0_RT1_RT2_T3_:
  300|  11.2k|      {
  301|  11.2k|         if (it == end || *it != '*') return false;
  ------------------
  |  Branch (301:14): [True: 0, False: 11.2k]
  |  Branch (301:27): [True: 10.1k, False: 1.02k]
  ------------------
  302|       |
  303|  1.02k|         ++it; // skip '*'
  304|  1.02k|         auto name = parse_anchor_name(it, end);
  305|  1.02k|         if (name.empty()) {
  ------------------
  |  Branch (305:14): [True: 3, False: 1.02k]
  ------------------
  306|      3|            ctx.error = error_code::syntax_error;
  307|      3|            return true;
  308|      3|         }
  309|       |
  310|  1.02k|         auto anchor_it = ctx.anchors.find(name);
  311|  1.02k|         if (anchor_it == ctx.anchors.end()) {
  ------------------
  |  Branch (311:14): [True: 33, False: 993]
  ------------------
  312|     33|            ctx.error = error_code::syntax_error; // undefined alias
  313|     33|            return true;
  314|     33|         }
  315|       |
  316|       |         // Copied rather than referenced: the replay below can replace ctx.anchors wholesale
  317|       |         // (a speculative parse hands its own map back), which would dangle a reference here.
  318|    993|         const auto span = anchor_it->second;
  319|       |
  320|       |         // Empty anchor span (anchor on null/empty node) — leave value as default
  321|    993|         if (span.begin == span.end) {
  ------------------
  |  Branch (321:14): [True: 589, False: 404]
  ------------------
  322|    589|            return true;
  323|    589|         }
  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|    404|         if (ctx.alias_span_is_replaying(span.begin, span.end)) [[unlikely]] {
  ------------------
  |  Branch (328:14): [True: 5, False: 399]
  ------------------
  329|      5|            ctx.error = error_code::syntax_error; // cyclic alias
  330|      5|            return true;
  331|      5|         }
  332|       |
  333|       |         // Replaying an anchor re-enters the reader directly, bypassing the variant reader's
  334|       |         // depth guard, so this is the only depth accounting a chain of aliases into a
  335|       |         // non-variant target gets. The cycle check above stops the unbounded case; this bounds
  336|       |         // a legitimate but deeply chained one.
  337|    399|         depth_guard guard{ctx, yaml::max_yaml_recursive_depth};
  338|    399|         if (!guard) [[unlikely]]
  ------------------
  |  Branch (338:14): [True: 1, False: 398]
  ------------------
  339|      1|            return true;
  340|       |
  341|    398|         if (!ctx.charge_alias_expansion(static_cast<size_t>(span.end - span.begin))) [[unlikely]] {
  ------------------
  |  Branch (341:14): [True: 0, False: 398]
  ------------------
  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|    398|         auto replay_it = span.begin;
  348|    398|         auto replay_end = span.end;
  349|       |
  350|       |         // Save indent context and set up for replay
  351|    398|         auto saved_indent_stack = std::move(ctx.indent_stack);
  352|    398|         ctx.indent_stack.clear();
  353|    398|         if (span.base_indent > 0) {
  ------------------
  |  Branch (353:14): [True: 374, False: 24]
  ------------------
  354|    374|            ctx.push_indent(span.base_indent - 1);
  355|    374|         }
  356|       |
  357|    398|         ctx.active_alias_spans.emplace_back(span.begin, span.end);
  358|       |
  359|    398|         using V = std::remove_cvref_t<T>;
  360|    398|         from<YAML, V>::template op<Opts>(std::forward<T>(value), ctx, replay_it, replay_end);
  361|       |
  362|    398|         ctx.active_alias_spans.pop_back();
  363|       |
  364|       |         // Restore indent context
  365|    398|         ctx.indent_stack = std::move(saved_indent_stack);
  366|    398|         return true;
  367|    398|      }
_ZN3glz4fromILj450EDnE2opITnDaXtlNS_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj32EEERPKcRDnTkNS_10is_contextERNS3_12yaml_contextES6_EEvOT1_OT2_OT0_T3_:
 2398|  3.63k|      {
 2399|  3.63k|         if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2399:14): [True: 0, False: 3.63k]
  ------------------
 2400|      0|            return;
 2401|       |
 2402|  3.63k|         yaml::skip_inline_ws(it, end);
 2403|       |
 2404|  3.63k|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (2404:14): [True: 4, False: 3.62k]
  ------------------
 2405|      4|            ctx.error = error_code::unexpected_end;
 2406|      4|            return;
 2407|      4|         }
 2408|       |
 2409|       |         // Check for null values: null, Null, NULL, ~
 2410|  3.62k|         if (*it == '~') {
  ------------------
  |  Branch (2410:14): [True: 393, False: 3.23k]
  ------------------
 2411|    393|            ++it;
 2412|    393|            return;
 2413|    393|         }
 2414|       |
 2415|       |         // Parse as plain scalar and check if it's a null keyword
 2416|  3.23k|         auto start = it;
 2417|  15.0k|         while (it != end && !yaml::plain_scalar_end_table[static_cast<uint8_t>(*it)]) {
  ------------------
  |  Branch (2417:17): [True: 14.6k, False: 418]
  |  Branch (2417:30): [True: 11.8k, False: 2.81k]
  ------------------
 2418|  11.8k|            ++it;
 2419|  11.8k|         }
 2420|       |
 2421|  3.23k|         std::string_view str{start, static_cast<size_t>(it - start)};
 2422|  3.23k|         if (!yaml::is_yaml_null(str)) {
  ------------------
  |  Branch (2422:14): [True: 36, False: 3.20k]
  ------------------
 2423|     36|            ctx.error = error_code::syntax_error;
 2424|     36|         }
 2425|  3.23k|      }
_ZN3glz33process_yaml_variant_alternativesINSt3__17variantIJDndNS1_12basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEbNS1_6vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS6_ISD_EEEENSC_ISD_EEEEENS_21is_yaml_variant_arrayEE2opITnDaXtlNS_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj32EEERSH_TkNS_10is_contextERNSL_12yaml_contextERPKcSR_EEvOT0_OT1_OT2_T3_:
 5205|  83.0k|      {
 5206|  83.0k|         constexpr auto category_count = yaml_variant_count_v<Variant, Trait>;
 5207|       |
 5208|       |         if constexpr (category_count == 0) {
 5209|       |            ctx.error = error_code::no_matching_variant_type;
 5210|       |         }
 5211|  83.0k|         else if constexpr (category_count == 1) {
 5212|       |            // Only one type in this category, use it directly
 5213|  83.0k|            constexpr auto first_idx = yaml_variant_first_index_v<Variant, Trait>;
 5214|  83.0k|            using V = std::variant_alternative_t<first_idx, Variant>;
 5215|  83.0k|            if (!std::holds_alternative<V>(value)) value = V{};
  ------------------
  |  Branch (5215:17): [True: 83.0k, False: 0]
  ------------------
 5216|  83.0k|            from<YAML, V>::template op<Opts>(std::get<V>(value), ctx, it, end);
 5217|       |         }
 5218|       |         else {
 5219|       |            // Multiple types in this category, try each one
 5220|       |            constexpr auto N = std::variant_size_v<Variant>;
 5221|       |            bool found_match{};
 5222|       |            size_t match_idx = 0;
 5223|       |            // Only the last alternative propagates its error, so an alternative that exhausted an
 5224|       |            // expansion budget would otherwise be reported as no_matching_variant_type -- a wrong
 5225|       |            // diagnosis for a document that is hostile rather than merely the wrong shape. Held
 5226|       |            // aside and used only if nothing matched, so an alternative that does succeed later
 5227|       |            // (one that materializes no key text can still parse under a latched budget) is
 5228|       |            // unaffected.
 5229|       |            error_code expansion_error{};
 5230|       |            std::string_view expansion_message{};
 5231|       |
 5232|       |            for_each<N>([&]<size_t I>() {
 5233|       |               if (found_match) {
 5234|       |                  return;
 5235|       |               }
 5236|       |               using V = std::variant_alternative_t<I, Variant>;
 5237|       |               if constexpr (Trait<V>::value) {
 5238|       |                  auto copy_it = it;
 5239|       |                  if (!std::holds_alternative<V>(value)) {
 5240|       |                     value = V{};
 5241|       |                  }
 5242|       |
 5243|       |                  auto temp_ctx = ctx.make_speculative();
 5244|       |                  from<YAML, V>::template op<Opts>(std::get<V>(value), temp_ctx, it, end);
 5245|       |
 5246|       |                  // Charged whether or not the alternative fit: a rejected probe still replayed
 5247|       |                  // whatever aliases it reached, and an attempt that is never billed is an
 5248|       |                  // attempt that can be repeated for free.
 5249|       |                  ctx.alias_expansion_budget = temp_ctx.alias_expansion_budget;
 5250|       |                  ctx.key_expansion_budget = temp_ctx.key_expansion_budget;
 5251|       |
 5252|       |                  if (!bool(temp_ctx.error)) {
 5253|       |                     found_match = true;
 5254|       |                     ctx.anchors = std::move(temp_ctx.anchors);
 5255|       |                  }
 5256|       |                  else {
 5257|       |                     it = copy_it;
 5258|       |                     if (temp_ctx.error == error_code::exceeded_max_expansion && expansion_error == error_code::none) {
 5259|       |                        expansion_error = temp_ctx.error;
 5260|       |                        expansion_message = temp_ctx.custom_error_message;
 5261|       |                     }
 5262|       |                     if (match_idx + 1 < category_count) {
 5263|       |                        // Not the last type, continue trying
 5264|       |                     }
 5265|       |                     else {
 5266|       |                        // Last type failed, propagate error
 5267|       |                        ctx.error = temp_ctx.error;
 5268|       |                        ctx.custom_error_message = temp_ctx.custom_error_message;
 5269|       |                     }
 5270|       |                  }
 5271|       |                  ++match_idx;
 5272|       |               }
 5273|       |            });
 5274|       |
 5275|       |            if (!found_match && !bool(ctx.error)) {
 5276|       |               if (expansion_error != error_code::none) {
 5277|       |                  ctx.error = expansion_error;
 5278|       |                  ctx.custom_error_message = expansion_message;
 5279|       |               }
 5280|       |               else {
 5281|       |                  ctx.error = error_code::no_matching_variant_type;
 5282|       |               }
 5283|       |            }
 5284|       |         }
 5285|  83.0k|      }
_ZN3glz4fromILj450ENSt3__16vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS1_9allocatorIS6_EEEEE2opITnDaXtlNS_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj32EEERPKcRS9_TkNS_10is_contextERNSC_12yaml_contextESF_EEvOT1_OT2_OT0_T3_:
 4098|  86.4k|      {
 4099|  86.4k|         if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4099:14): [True: 0, False: 86.4k]
  ------------------
 4100|      0|            return;
 4101|       |
 4102|       |         // Peek ahead to check for tag (don't consume indentation for block sequences)
 4103|  86.4k|         auto peek = it;
 4104|  86.4k|         yaml::node_preamble_state preamble{};
 4105|  86.4k|         if (yaml::parse_node_preamble<Opts>(value, ctx, peek, end, preamble,
  ------------------
  |  Branch (4105:14): [True: 3.74k, False: 82.6k]
  ------------------
 4106|  86.4k|                                             [](yaml::yaml_tag tag) { return yaml::tag_valid_for_seq(tag); })) {
 4107|  3.74k|            it = peek;
 4108|  3.74k|            return;
 4109|  3.74k|         }
 4110|       |
 4111|  82.6k|         if (*peek == '[') {
  ------------------
  |  Branch (4111:14): [True: 32.0k, False: 50.6k]
  ------------------
 4112|       |            // Flow sequence - consume whitespace and parse
 4113|  32.0k|            it = peek;
 4114|  32.0k|            yaml::parse_flow_sequence<Opts>(value, ctx, it, end);
 4115|  32.0k|         }
 4116|  50.6k|         else if (*peek == '-') {
  ------------------
  |  Branch (4116:19): [True: 50.5k, False: 111]
  ------------------
 4117|       |            // Block sequence - don't consume leading whitespace, let parse_block_sequence handle it
 4118|       |            // But if there was a tag, we need to advance past it
 4119|  50.5k|            if (preamble.tag != yaml::yaml_tag::none || preamble.node_props.has_anchor) {
  ------------------
  |  Branch (4119:17): [True: 78, False: 50.4k]
  |  Branch (4119:57): [True: 2.50k, False: 47.9k]
  ------------------
 4120|  2.58k|               it = peek;
 4121|  2.58k|            }
 4122|  50.5k|            int32_t seq_indent = ctx.current_indent();
 4123|  50.5k|            if (*it == '-' && ctx.current_indent() >= 0) {
  ------------------
  |  Branch (4123:17): [True: 50.2k, False: 251]
  |  Branch (4123:31): [True: 43.6k, False: 6.58k]
  ------------------
 4124|  43.6k|               seq_indent = ctx.allow_indentless_sequence ? (ctx.current_indent() > 0 ? (ctx.current_indent() - 1) : 0)
  ------------------
  |  Branch (4124:29): [True: 28.8k, False: 14.7k]
  |  Branch (4124:62): [True: 15.8k, False: 13.0k]
  ------------------
 4125|  43.6k|                                                          : (ctx.current_indent() + 1);
 4126|  43.6k|            }
 4127|  50.5k|            yaml::parse_block_sequence<Opts>(value, ctx, it, end, seq_indent);
 4128|  50.5k|         }
 4129|    111|         else {
 4130|    111|            ctx.error = error_code::syntax_error;
 4131|    111|         }
 4132|       |
 4133|  82.6k|         yaml::finalize_node_anchor(preamble.node_props, ctx, it);
 4134|  82.6k|      }
_ZN3glz4yaml19parse_node_preambleITnDaXtlNS0_9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj32EEEXtlNS0_20node_property_policyELb1EEELb0ERNSt3__16vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS4_9allocatorIS9_EEEENS0_12yaml_contextEPKcSG_ZNS_4fromILj450ESC_E2opITnDaXtlS2_Lj450ELb1ELb0ELb1ELh2ELb0ELj32EEERSG_SD_TkNS_10is_contextERSE_SG_EEvOT1_OT2_OT0_T3_EUlNS0_8yaml_tagEE_EEbSP_RSS_RT4_T5_RNS0_19node_preamble_stateEOT6_:
  465|  86.4k|      {
  466|  86.4k|         skip_inline_ws(it, end);
  467|       |
  468|  86.4k|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (468:14): [True: 1, False: 86.4k]
  ------------------
  469|      1|            if constexpr (!AllowEmptyInput) {
  470|      1|               ctx.error = error_code::unexpected_end;
  471|      1|            }
  472|      1|            return true;
  473|      1|         }
  474|       |
  475|  86.4k|         preamble.tag = parse_yaml_tag(it, end, ctx);
  476|  86.4k|         if (preamble.tag == yaml_tag::unknown) [[unlikely]] {
  ------------------
  |  Branch (476:14): [True: 1, False: 86.4k]
  ------------------
  477|      1|            ctx.error = error_code::syntax_error;
  478|      1|            return true;
  479|      1|         }
  480|  86.4k|         if (!tag_validator(preamble.tag)) [[unlikely]] {
  ------------------
  |  Branch (480:14): [True: 1, False: 86.4k]
  ------------------
  481|      1|            ctx.error = error_code::syntax_error;
  482|      1|            return true;
  483|      1|         }
  484|       |
  485|  86.4k|         skip_inline_ws(it, end);
  486|       |
  487|  86.4k|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (487:14): [True: 4, False: 86.4k]
  ------------------
  488|      4|            if constexpr (!AllowEmptyInput) {
  489|      4|               ctx.error = error_code::unexpected_end;
  490|      4|            }
  491|      4|            return true;
  492|      4|         }
  493|       |
  494|  86.4k|         if (parse_node_properties<Opts, PropertyPolicy>(std::forward<T>(value), ctx, it, end, preamble.node_props)) {
  ------------------
  |  Branch (494:14): [True: 3.73k, False: 82.6k]
  ------------------
  495|  3.73k|            return true;
  496|  3.73k|         }
  497|       |
  498|  82.6k|         return false;
  499|  86.4k|      }
_ZZN3glz4fromILj450ENSt3__16vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS1_9allocatorIS6_EEEEE2opITnDaXtlNS_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj32EEERPKcRS9_TkNS_10is_contextERNSC_12yaml_contextESF_EEvOT1_OT2_OT0_T3_ENKUlNSC_8yaml_tagEE_clESR_:
 4106|  86.4k|                                             [](yaml::yaml_tag tag) { return yaml::tag_valid_for_seq(tag); })) {
_ZN3glz4yaml21parse_node_propertiesITnDaXtlNS0_9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj32EEEXtlNS0_20node_property_policyELb1EEERNSt3__16vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS4_9allocatorIS9_EEEENS0_12yaml_contextEPKcSG_EEbOT1_RT2_RT3_T4_RNS0_19node_property_stateE:
  408|  86.4k|      {
  409|  86.4k|         state.has_anchor = false;
  410|  86.4k|         state.anchor_name.clear();
  411|  86.4k|         state.anchor_start = nullptr;
  412|  86.4k|         state.anchor_indent = ctx.current_indent();
  413|       |
  414|  86.4k|         if constexpr (Policy.allow_alias) {
  415|       |            if constexpr (Policy.alias_can_be_mapping_key) {
  416|       |               if (!alias_token_is_mapping_key(it, end)) {
  417|       |                  if (handle_alias<Opts>(std::forward<T>(value), ctx, it, end)) return true;
  418|       |               }
  419|       |            }
  420|  86.4k|            else {
  421|  86.4k|               if (handle_alias<Opts>(std::forward<T>(value), ctx, it, end)) return true;
  ------------------
  |  Branch (421:20): [True: 3.71k, False: 82.7k]
  ------------------
  422|  86.4k|            }
  423|  86.4k|         }
  424|       |
  425|  86.4k|         if (it != end && *it == '&') {
  ------------------
  |  Branch (425:14): [True: 82.7k, False: 3.71k]
  |  Branch (425:27): [True: 2.93k, False: 79.7k]
  ------------------
  426|  2.93k|            ++it;
  427|  2.93k|            auto name = parse_anchor_name(it, end);
  428|  2.93k|            if (name.empty()) {
  ------------------
  |  Branch (428:17): [True: 4, False: 2.92k]
  ------------------
  429|      4|               ctx.error = error_code::syntax_error;
  430|      4|               return true;
  431|      4|            }
  432|  2.92k|            skip_inline_ws(it, end);
  433|  2.92k|            if (it == end) {
  ------------------
  |  Branch (433:17): [True: 14, False: 2.91k]
  ------------------
  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|  2.91k|            state.has_anchor = true;
  446|  2.91k|            state.anchor_name = std::string(name);
  447|  2.91k|            state.anchor_start = &*it;
  448|  2.91k|         }
  449|       |
  450|  86.4k|         return false;
  451|  86.4k|      }
_ZN3glz4yaml12handle_aliasITnDaXtlNS0_9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj32EEERNSt3__16vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS3_9allocatorIS8_EEEENS0_12yaml_contextEPKcSF_EEbOT0_RT1_RT2_T3_:
  300|  86.4k|      {
  301|  86.4k|         if (it == end || *it != '*') return false;
  ------------------
  |  Branch (301:14): [True: 0, False: 86.4k]
  |  Branch (301:27): [True: 82.7k, False: 3.71k]
  ------------------
  302|       |
  303|  3.71k|         ++it; // skip '*'
  304|  3.71k|         auto name = parse_anchor_name(it, end);
  305|  3.71k|         if (name.empty()) {
  ------------------
  |  Branch (305:14): [True: 4, False: 3.71k]
  ------------------
  306|      4|            ctx.error = error_code::syntax_error;
  307|      4|            return true;
  308|      4|         }
  309|       |
  310|  3.71k|         auto anchor_it = ctx.anchors.find(name);
  311|  3.71k|         if (anchor_it == ctx.anchors.end()) {
  ------------------
  |  Branch (311:14): [True: 42, False: 3.67k]
  ------------------
  312|     42|            ctx.error = error_code::syntax_error; // undefined alias
  313|     42|            return true;
  314|     42|         }
  315|       |
  316|       |         // Copied rather than referenced: the replay below can replace ctx.anchors wholesale
  317|       |         // (a speculative parse hands its own map back), which would dangle a reference here.
  318|  3.67k|         const auto span = anchor_it->second;
  319|       |
  320|       |         // Empty anchor span (anchor on null/empty node) — leave value as default
  321|  3.67k|         if (span.begin == span.end) {
  ------------------
  |  Branch (321:14): [True: 297, False: 3.37k]
  ------------------
  322|    297|            return true;
  323|    297|         }
  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.37k|         if (ctx.alias_span_is_replaying(span.begin, span.end)) [[unlikely]] {
  ------------------
  |  Branch (328:14): [True: 2, False: 3.37k]
  ------------------
  329|      2|            ctx.error = error_code::syntax_error; // cyclic alias
  330|      2|            return true;
  331|      2|         }
  332|       |
  333|       |         // Replaying an anchor re-enters the reader directly, bypassing the variant reader's
  334|       |         // depth guard, so this is the only depth accounting a chain of aliases into a
  335|       |         // non-variant target gets. The cycle check above stops the unbounded case; this bounds
  336|       |         // a legitimate but deeply chained one.
  337|  3.37k|         depth_guard guard{ctx, yaml::max_yaml_recursive_depth};
  338|  3.37k|         if (!guard) [[unlikely]]
  ------------------
  |  Branch (338:14): [True: 0, False: 3.37k]
  ------------------
  339|      0|            return true;
  340|       |
  341|  3.37k|         if (!ctx.charge_alias_expansion(static_cast<size_t>(span.end - span.begin))) [[unlikely]] {
  ------------------
  |  Branch (341:14): [True: 0, False: 3.37k]
  ------------------
  342|      0|            ctx.error = error_code::exceeded_max_expansion;
  343|      0|            ctx.custom_error_message = "alias expansion";
  344|      0|            return true;
  345|      0|         }
  346|       |
  347|  3.37k|         auto replay_it = span.begin;
  348|  3.37k|         auto replay_end = span.end;
  349|       |
  350|       |         // Save indent context and set up for replay
  351|  3.37k|         auto saved_indent_stack = std::move(ctx.indent_stack);
  352|  3.37k|         ctx.indent_stack.clear();
  353|  3.37k|         if (span.base_indent > 0) {
  ------------------
  |  Branch (353:14): [True: 2.66k, False: 710]
  ------------------
  354|  2.66k|            ctx.push_indent(span.base_indent - 1);
  355|  2.66k|         }
  356|       |
  357|  3.37k|         ctx.active_alias_spans.emplace_back(span.begin, span.end);
  358|       |
  359|  3.37k|         using V = std::remove_cvref_t<T>;
  360|  3.37k|         from<YAML, V>::template op<Opts>(std::forward<T>(value), ctx, replay_it, replay_end);
  361|       |
  362|  3.37k|         ctx.active_alias_spans.pop_back();
  363|       |
  364|       |         // Restore indent context
  365|  3.37k|         ctx.indent_stack = std::move(saved_indent_stack);
  366|  3.37k|         return true;
  367|  3.37k|      }
_ZN3glz4yaml19parse_flow_sequenceITnDaXtlNS0_9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj32EEERNSt3__16vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS3_9allocatorIS8_EEEENS0_12yaml_contextEPKcSF_EEvOT0_RT1_RT2_T3_:
 2596|  32.0k|      {
 2597|  32.0k|         using V = std::remove_cvref_t<T>;
 2598|  32.0k|         using value_type = typename V::value_type;
 2599|       |
 2600|  32.0k|         struct sequence_container_adapter
 2601|  32.0k|         {
 2602|  32.0k|            size_t index = 0;
 2603|       |
 2604|  32.0k|            inline bool fixed_capacity_reached(const V& container) const noexcept
 2605|  32.0k|            {
 2606|  32.0k|               if constexpr (!resizable<V>) {
 2607|  32.0k|                  return index >= container.size();
 2608|  32.0k|               }
 2609|  32.0k|               else {
 2610|  32.0k|                  (void)container;
 2611|  32.0k|                  return false;
 2612|  32.0k|               }
 2613|  32.0k|            }
 2614|       |
 2615|  32.0k|            inline void commit_fixed_slot() noexcept { ++index; }
 2616|       |
 2617|  32.0k|            inline void append(V& container, value_type&& element) noexcept
 2618|  32.0k|            {
 2619|  32.0k|               if constexpr (emplace_backable<V>) {
 2620|  32.0k|                  container.emplace_back(std::move(element));
 2621|  32.0k|               }
 2622|  32.0k|               else if constexpr (emplaceable<V>) {
 2623|  32.0k|                  container.emplace(std::move(element));
 2624|  32.0k|               }
 2625|  32.0k|            }
 2626|  32.0k|         };
 2627|       |
 2628|  32.0k|         if (it == end || *it != '[') [[unlikely]] {
  ------------------
  |  Branch (2628:14): [True: 0, False: 32.0k]
  |  Branch (2628:27): [True: 0, False: 32.0k]
  ------------------
 2629|      0|            ctx.error = error_code::syntax_error;
 2630|      0|            return;
 2631|      0|         }
 2632|       |
 2633|       |         // Overwrite (do not append to) any pre-existing contents. Must happen
 2634|       |         // before the empty-array early return below so that `[]` also clears.
 2635|  32.0k|         clear_sequence_before_read<Opts>(value);
 2636|       |
 2637|  32.0k|         ++it; // Skip '['
 2638|       |         // Skip whitespace and newlines after opening bracket (YAML allows multi-line flow sequences)
 2639|  32.0k|         skip_flow_ws_and_newlines(ctx, it, end);
 2640|  32.0k|         if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2640:14): [True: 21, False: 32.0k]
  ------------------
 2641|     21|            return;
 2642|       |
 2643|       |         // Handle empty array
 2644|  32.0k|         if (it != end && *it == ']') {
  ------------------
  |  Branch (2644:14): [True: 31.7k, False: 350]
  |  Branch (2644:27): [True: 4.64k, False: 27.0k]
  ------------------
 2645|  4.64k|            ++it;
 2646|  4.64k|            validate_flow_node_adjacent_tail(ctx, it, end);
 2647|  4.64k|            if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2647:17): [True: 14, False: 4.63k]
  ------------------
 2648|     14|               return;
 2649|  4.63k|            if constexpr (!yaml::check_flow_context(Opts)) {
 2650|  4.63k|               if (ctx.current_indent() < 0) {
  ------------------
  |  Branch (2650:20): [True: 370, False: 4.26k]
  ------------------
 2651|    370|                  validate_root_flow_tail_after_close(ctx, it, end);
 2652|    370|               }
 2653|  4.63k|            }
 2654|  4.63k|            return;
 2655|  4.64k|         }
 2656|       |
 2657|  27.4k|         bool just_saw_comma = false;
 2658|  27.4k|         sequence_container_adapter adapter{};
 2659|       |
 2660|  27.4k|         if constexpr (emplace_backable<V> || emplaceable<V>) {
 2661|       |            // Dynamic containers append items (vector-like and set-like)
 2662|   544k|            while (it != end) {
  ------------------
  |  Branch (2662:20): [True: 542k, False: 1.49k]
  ------------------
 2663|   542k|               skip_flow_ws_and_newlines(ctx, it, end);
 2664|   542k|               if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2664:20): [True: 0, False: 542k]
  ------------------
 2665|      0|                  return;
 2666|       |
 2667|   542k|               if (it == end) [[unlikely]] {
  ------------------
  |  Branch (2667:20): [True: 0, False: 542k]
  ------------------
 2668|      0|                  ctx.error = error_code::unexpected_end;
 2669|      0|                  return;
 2670|      0|               }
 2671|       |
 2672|   542k|               if (*it == ']') {
  ------------------
  |  Branch (2672:20): [True: 3.74k, False: 539k]
  ------------------
 2673|  3.74k|                  if (just_saw_comma) {
  ------------------
  |  Branch (2673:23): [True: 3.74k, False: 0]
  ------------------
 2674|  3.74k|                     ++it;
 2675|  3.74k|                     validate_flow_node_adjacent_tail(ctx, it, end);
 2676|  3.74k|                     if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2676:26): [True: 8, False: 3.73k]
  ------------------
 2677|      8|                        return;
 2678|  3.73k|                     if constexpr (!yaml::check_flow_context(Opts)) {
 2679|  3.73k|                        if (ctx.current_indent() < 0) {
  ------------------
  |  Branch (2679:29): [True: 483, False: 3.25k]
  ------------------
 2680|    483|                           validate_root_flow_tail_after_close(ctx, it, end);
 2681|    483|                        }
 2682|  3.73k|                     }
 2683|  3.73k|                     return;
 2684|  3.74k|                  }
 2685|      0|                  ctx.error = error_code::syntax_error;
 2686|      0|                  return;
 2687|  3.74k|               }
 2688|       |
 2689|   539k|               if (*it == ',' || *it == '#') {
  ------------------
  |  Branch (2689:20): [True: 253, False: 538k]
  |  Branch (2689:34): [True: 49, False: 538k]
  ------------------
 2690|    302|                  ctx.error = error_code::syntax_error;
 2691|    302|                  return;
 2692|    302|               }
 2693|   538k|               just_saw_comma = false;
 2694|       |
 2695|   538k|               value_type element{};
 2696|   538k|               from<YAML, value_type>::template op<flow_context_on<Opts>()>(element, ctx, it, end);
 2697|       |
 2698|   538k|               if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2698:20): [True: 14.3k, False: 524k]
  ------------------
 2699|  14.3k|                  return;
 2700|       |
 2701|   524k|               bool saw_line_break_before_separator = false;
 2702|   524k|               skip_flow_ws_and_newlines(ctx, it, end, &saw_line_break_before_separator);
 2703|   524k|               if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2703:20): [True: 13, False: 524k]
  ------------------
 2704|     13|                  return;
 2705|       |
 2706|   524k|               if (it != end && *it == ':') {
  ------------------
  |  Branch (2706:20): [True: 522k, False: 1.85k]
  |  Branch (2706:33): [True: 6.46k, False: 516k]
  ------------------
 2707|       |                  // In flow sequences, implicit key-value pairs must be on a single line.
 2708|  6.46k|                  if (saw_line_break_before_separator) {
  ------------------
  |  Branch (2708:23): [True: 39, False: 6.42k]
  ------------------
 2709|     39|                     ctx.error = error_code::syntax_error;
 2710|     39|                     return;
 2711|     39|                  }
 2712|  6.42k|                  if constexpr (std::same_as<std::remove_cvref_t<value_type>, glz::generic>) {
 2713|  6.42k|                     glz::generic key_node = std::move(element);
 2714|  6.42k|                     ++it;
 2715|  6.42k|                     skip_inline_ws(it, end);
 2716|       |
 2717|  6.42k|                     glz::generic mapped{};
 2718|  6.42k|                     from<YAML, glz::generic>::template op<flow_context_on<Opts>()>(mapped, ctx, it, end);
 2719|  6.42k|                     if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2719:26): [True: 299, False: 6.12k]
  ------------------
 2720|    299|                        return;
 2721|       |
 2722|  6.12k|                     std::string key;
 2723|  6.12k|                     if (!yaml::materialize_key(key, key_node, ctx)) [[unlikely]]
  ------------------
  |  Branch (2723:26): [True: 3, False: 6.12k]
  ------------------
 2724|      3|                        return;
 2725|       |
 2726|  6.12k|                     glz::generic pair{};
 2727|  6.12k|                     pair[key] = std::move(mapped);
 2728|  6.12k|                     element = std::move(pair);
 2729|       |
 2730|  6.12k|                     skip_flow_ws_and_newlines(ctx, it, end);
 2731|  6.12k|                     if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2731:26): [True: 4, False: 6.12k]
  ------------------
 2732|      4|                        return;
 2733|       |                  }
 2734|       |                  else {
 2735|       |                     ctx.error = error_code::syntax_error;
 2736|       |                     return;
 2737|       |                  }
 2738|  6.42k|               }
 2739|       |
 2740|   524k|               adapter.append(value, std::move(element));
 2741|       |
 2742|   524k|               if (it == end) [[unlikely]] {
  ------------------
  |  Branch (2742:20): [True: 2.01k, False: 522k]
  ------------------
 2743|  2.01k|                  ctx.error = error_code::unexpected_end;
 2744|  2.01k|                  return;
 2745|  2.01k|               }
 2746|       |
 2747|   522k|               if (*it == ']') {
  ------------------
  |  Branch (2747:20): [True: 4.07k, False: 518k]
  ------------------
 2748|  4.07k|                  ++it;
 2749|  4.07k|                  validate_flow_node_adjacent_tail(ctx, it, end);
 2750|  4.07k|                  if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2750:23): [True: 135, False: 3.94k]
  ------------------
 2751|    135|                     return;
 2752|  3.94k|                  if constexpr (!yaml::check_flow_context(Opts)) {
 2753|  3.94k|                     if (ctx.current_indent() < 0) {
  ------------------
  |  Branch (2753:26): [True: 337, False: 3.60k]
  ------------------
 2754|    337|                        validate_root_flow_tail_after_close(ctx, it, end);
 2755|    337|                     }
 2756|  3.94k|                  }
 2757|  3.94k|                  return;
 2758|  4.07k|               }
 2759|   518k|               else if (*it == ',') {
  ------------------
  |  Branch (2759:25): [True: 516k, False: 1.41k]
  ------------------
 2760|   516k|                  ++it;
 2761|   516k|                  just_saw_comma = true;
 2762|   516k|                  skip_flow_ws_and_newlines(ctx, it, end);
 2763|   516k|                  if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2763:23): [True: 7, False: 516k]
  ------------------
 2764|      7|                     return;
 2765|   516k|               }
 2766|  1.41k|               else {
 2767|  1.41k|                  ctx.error = error_code::syntax_error;
 2768|  1.41k|                  return;
 2769|  1.41k|               }
 2770|   522k|            }
 2771|       |         }
 2772|       |         else if constexpr (!resizable<V>) {
 2773|       |            // Fixed-size containers (std::array)
 2774|       |            while (it != end && !adapter.fixed_capacity_reached(value)) {
 2775|       |               skip_flow_ws_and_newlines(ctx, it, end);
 2776|       |               if (bool(ctx.error)) [[unlikely]]
 2777|       |                  return;
 2778|       |
 2779|       |               if (it == end) [[unlikely]] {
 2780|       |                  ctx.error = error_code::unexpected_end;
 2781|       |                  return;
 2782|       |               }
 2783|       |
 2784|       |               if (*it == ']') {
 2785|       |                  if (just_saw_comma) {
 2786|       |                     ++it;
 2787|       |                     validate_flow_node_adjacent_tail(ctx, it, end);
 2788|       |                     if (bool(ctx.error)) [[unlikely]]
 2789|       |                        return;
 2790|       |                     if constexpr (!yaml::check_flow_context(Opts)) {
 2791|       |                        if (ctx.current_indent() < 0) {
 2792|       |                           validate_root_flow_tail_after_close(ctx, it, end);
 2793|       |                        }
 2794|       |                     }
 2795|       |                     return;
 2796|       |                  }
 2797|       |                  ctx.error = error_code::syntax_error;
 2798|       |                  return;
 2799|       |               }
 2800|       |
 2801|       |               if (*it == ',' || *it == '#') {
 2802|       |                  ctx.error = error_code::syntax_error;
 2803|       |                  return;
 2804|       |               }
 2805|       |               just_saw_comma = false;
 2806|       |
 2807|       |               from<YAML, value_type>::template op<flow_context_on<Opts>()>(value[adapter.index], ctx, it, end);
 2808|       |
 2809|       |               if (bool(ctx.error)) [[unlikely]]
 2810|       |                  return;
 2811|       |
 2812|       |               adapter.commit_fixed_slot();
 2813|       |               skip_flow_ws_and_newlines(ctx, it, end);
 2814|       |               if (bool(ctx.error)) [[unlikely]]
 2815|       |                  return;
 2816|       |
 2817|       |               if (it == end) [[unlikely]] {
 2818|       |                  ctx.error = error_code::unexpected_end;
 2819|       |                  return;
 2820|       |               }
 2821|       |
 2822|       |               if (*it == ']') {
 2823|       |                  ++it;
 2824|       |                  validate_flow_node_adjacent_tail(ctx, it, end);
 2825|       |                  if (bool(ctx.error)) [[unlikely]]
 2826|       |                     return;
 2827|       |                  if constexpr (!yaml::check_flow_context(Opts)) {
 2828|       |                     if (ctx.current_indent() < 0) {
 2829|       |                        validate_root_flow_tail_after_close(ctx, it, end);
 2830|       |                     }
 2831|       |                  }
 2832|       |                  return;
 2833|       |               }
 2834|       |               else if (*it == ',') {
 2835|       |                  ++it;
 2836|       |                  just_saw_comma = true;
 2837|       |                  skip_flow_ws_and_newlines(ctx, it, end);
 2838|       |                  if (bool(ctx.error)) [[unlikely]]
 2839|       |                     return;
 2840|       |               }
 2841|       |               else {
 2842|       |                  ctx.error = error_code::syntax_error;
 2843|       |                  return;
 2844|       |               }
 2845|       |            }
 2846|       |
 2847|       |            // If we exited because the fixed-size container is full but haven't seen ']',
 2848|       |            // skip to the closing bracket to consume overflow elements.
 2849|       |            int bracket_depth = 1;
 2850|       |            while (it != end && bracket_depth > 0) {
 2851|       |               if (*it == '[') {
 2852|       |                  ++bracket_depth;
 2853|       |               }
 2854|       |               else if (*it == ']') {
 2855|       |                  --bracket_depth;
 2856|       |               }
 2857|       |               ++it;
 2858|       |            }
 2859|       |         }
 2860|       |         else {
 2861|       |            ctx.error = error_code::syntax_error;
 2862|       |            return;
 2863|       |         }
 2864|  27.4k|      }
_ZN3glz4yaml26clear_sequence_before_readITnDaXtlNS0_9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj32EEENSt3__16vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS3_9allocatorIS8_EEEEEEvRT0_:
 2580|  82.5k|      {
 2581|  82.5k|         if constexpr (emplace_backable<V> && requires { value.clear(); }) {
 2582|       |            // vector-like: honor the append_arrays option, matching json/read.hpp
 2583|  82.5k|            if constexpr (!check_append_arrays(Opts)) {
 2584|  82.5k|               value.clear();
 2585|  82.5k|            }
 2586|       |         }
 2587|       |         else if constexpr (emplaceable<V> && requires { value.clear(); }) {
 2588|       |            // set-like: json/read.hpp clears unconditionally; append_arrays does not apply
 2589|       |            value.clear();
 2590|       |         }
 2591|  82.5k|      }
_ZZN3glz4yaml19parse_flow_sequenceITnDaXtlNS0_9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj32EEERNSt3__16vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS3_9allocatorIS8_EEEENS0_12yaml_contextEPKcSF_EEvOT0_RT1_RT2_T3_EN26sequence_container_adapter6appendESC_OS8_:
 2618|   524k|            {
 2619|   524k|               if constexpr (emplace_backable<V>) {
 2620|   524k|                  container.emplace_back(std::move(element));
 2621|       |               }
 2622|       |               else if constexpr (emplaceable<V>) {
 2623|       |                  container.emplace(std::move(element));
 2624|       |               }
 2625|   524k|            }
_ZN3glz4yaml20parse_block_sequenceITnDaXtlNS0_9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj32EEERNSt3__16vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS3_9allocatorIS8_EEEENS0_12yaml_contextEPKcSF_EEvOT0_RT1_RT2_T3_i:
 3081|  50.5k|      {
 3082|  50.5k|         using V = std::remove_cvref_t<T>;
 3083|  50.5k|         using value_type = typename V::value_type;
 3084|       |
 3085|  50.5k|         struct sequence_container_adapter
 3086|  50.5k|         {
 3087|  50.5k|            size_t index = 0;
 3088|       |
 3089|  50.5k|            inline bool fixed_capacity_reached(const V& container) const noexcept
 3090|  50.5k|            {
 3091|  50.5k|               if constexpr (!resizable<V>) {
 3092|  50.5k|                  return index >= container.size();
 3093|  50.5k|               }
 3094|  50.5k|               else {
 3095|  50.5k|                  (void)container;
 3096|  50.5k|                  return false;
 3097|  50.5k|               }
 3098|  50.5k|            }
 3099|       |
 3100|  50.5k|            inline void commit_fixed_slot() noexcept { ++index; }
 3101|       |
 3102|  50.5k|            inline void append(V& container, value_type&& element) noexcept
 3103|  50.5k|            {
 3104|  50.5k|               if constexpr (emplace_backable<V>) {
 3105|  50.5k|                  container.emplace_back(std::move(element));
 3106|  50.5k|               }
 3107|  50.5k|               else if constexpr (emplaceable<V>) {
 3108|  50.5k|                  container.emplace(std::move(element));
 3109|  50.5k|               }
 3110|  50.5k|            }
 3111|  50.5k|         };
 3112|       |
 3113|       |         // Overwrite (do not append to) any pre-existing contents. A block
 3114|       |         // sequence is only entered once a '-' item is confirmed, so clearing
 3115|       |         // up front correctly (re)assigns the container to the parsed sequence.
 3116|  50.5k|         clear_sequence_before_read<Opts>(value);
 3117|       |
 3118|  50.5k|         sequence_container_adapter adapter{};
 3119|       |
 3120|       |         // Track if this is the first item (for handling whitespace-consumed case)
 3121|  50.5k|         bool first_item = true;
 3122|  50.5k|         bool has_pending_item_anchor = false;
 3123|  50.5k|         std::string pending_item_anchor_name{};
 3124|  50.5k|         int32_t pending_item_anchor_indent = sequence_indent;
 3125|       |
 3126|   137k|         while (it != end) {
  ------------------
  |  Branch (3126:17): [True: 107k, False: 30.1k]
  ------------------
 3127|       |            // For fixed-size arrays (e.g. std::array), stop when we've filled all elements.
 3128|       |            // Exclude emplaceable types (e.g. std::set) which are not resizable but grow dynamically.
 3129|       |            if constexpr (!resizable<V> && !emplaceable<V>) {
 3130|       |               if (adapter.fixed_capacity_reached(value)) {
 3131|       |                  return;
 3132|       |               }
 3133|       |            }
 3134|       |
 3135|       |            // Skip blank lines and comments, track indent
 3136|   107k|            int32_t line_indent = 0;
 3137|   107k|            int32_t dash_col = -1; // actual column of the '-' on the line
 3138|   107k|            auto line_start = it;
 3139|       |
 3140|   155k|            while (it != end) {
  ------------------
  |  Branch (3140:20): [True: 152k, False: 3.43k]
  ------------------
 3141|   152k|               if (*it == '#') {
  ------------------
  |  Branch (3141:20): [True: 12.6k, False: 139k]
  ------------------
 3142|  12.6k|                  skip_comment(it, end);
 3143|  12.6k|                  skip_newline(it, end);
 3144|  12.6k|                  line_start = it;
 3145|  12.6k|                  line_indent = 0;
 3146|  12.6k|               }
 3147|   139k|               else if (*it == '\n' || *it == '\r') {
  ------------------
  |  Branch (3147:25): [True: 14.6k, False: 124k]
  |  Branch (3147:40): [True: 12.7k, False: 112k]
  ------------------
 3148|  27.4k|                  skip_newline(it, end);
 3149|  27.4k|                  line_start = it;
 3150|  27.4k|                  line_indent = 0;
 3151|  27.4k|               }
 3152|   112k|               else if (*it == ' ') {
  ------------------
  |  Branch (3152:25): [True: 17.2k, False: 94.7k]
  ------------------
 3153|  17.2k|                  line_start = it;
 3154|  17.2k|                  line_indent = 0;
 3155|  41.4k|                  while (it != end && *it == ' ') {
  ------------------
  |  Branch (3155:26): [True: 41.2k, False: 266]
  |  Branch (3155:39): [True: 24.2k, False: 16.9k]
  ------------------
 3156|  24.2k|                     ++line_indent;
 3157|  24.2k|                     ++it;
 3158|  24.2k|                  }
 3159|       |
 3160|  17.2k|                  bool saw_tab = false;
 3161|  18.8k|                  while (it != end && (*it == ' ' || *it == '\t')) {
  ------------------
  |  Branch (3161:26): [True: 18.5k, False: 284]
  |  Branch (3161:40): [True: 757, False: 17.8k]
  |  Branch (3161:54): [True: 869, False: 16.9k]
  ------------------
 3162|  1.62k|                     saw_tab = saw_tab || (*it == '\t');
  ------------------
  |  Branch (3162:32): [True: 1.16k, False: 464]
  |  Branch (3162:43): [True: 464, False: 0]
  ------------------
 3163|  1.62k|                     ++it;
 3164|  1.62k|                  }
 3165|       |
 3166|  17.2k|                  if (it == end || *it == '\n' || *it == '\r' || *it == '#') {
  ------------------
  |  Branch (3166:23): [True: 284, False: 16.9k]
  |  Branch (3166:36): [True: 352, False: 16.6k]
  |  Branch (3166:51): [True: 641, False: 15.9k]
  |  Branch (3166:66): [True: 4.87k, False: 11.1k]
  ------------------
 3167|       |                     // Blank or comment line - continue to next line
 3168|  6.14k|                     if (it != end && *it == '#') {
  ------------------
  |  Branch (3168:26): [True: 5.86k, False: 284]
  |  Branch (3168:39): [True: 4.87k, False: 993]
  ------------------
 3169|  4.87k|                        skip_comment(it, end);
 3170|  4.87k|                     }
 3171|  6.14k|                     line_indent = 0;
 3172|  6.14k|                     continue;
 3173|  6.14k|                  }
 3174|       |
 3175|  11.1k|                  if (saw_tab) {
  ------------------
  |  Branch (3175:23): [True: 15, False: 11.0k]
  ------------------
 3176|     15|                     ctx.error = error_code::syntax_error;
 3177|     15|                     return;
 3178|     15|                  }
 3179|  11.0k|                  break; // Found content
 3180|  11.1k|               }
 3181|  94.7k|               else if (*it == '\t') {
  ------------------
  |  Branch (3181:25): [True: 1.64k, False: 93.1k]
  ------------------
 3182|  1.64k|                  line_start = it;
 3183|  6.16k|                  while (it != end && (*it == ' ' || *it == '\t')) ++it;
  ------------------
  |  Branch (3183:26): [True: 6.00k, False: 153]
  |  Branch (3183:40): [True: 658, False: 5.34k]
  |  Branch (3183:54): [True: 3.85k, False: 1.49k]
  ------------------
 3184|  1.64k|                  if (it == end || *it == '\n' || *it == '\r' || *it == '#') {
  ------------------
  |  Branch (3184:23): [True: 153, False: 1.49k]
  |  Branch (3184:36): [True: 312, False: 1.18k]
  |  Branch (3184:51): [True: 413, False: 768]
  |  Branch (3184:66): [True: 744, False: 24]
  ------------------
 3185|  1.62k|                     if (it != end && *it == '#') {
  ------------------
  |  Branch (3185:26): [True: 1.46k, False: 153]
  |  Branch (3185:39): [True: 744, False: 725]
  ------------------
 3186|    744|                        skip_comment(it, end);
 3187|    744|                     }
 3188|  1.62k|                     line_indent = 0;
 3189|  1.62k|                     continue;
 3190|  1.62k|                  }
 3191|     24|                  ctx.error = error_code::syntax_error;
 3192|     24|                  return;
 3193|  1.64k|               }
 3194|  93.1k|               else {
 3195|       |                  // At content (no leading space on this line)
 3196|       |                  // If first item and at '-', whitespace was consumed by caller;
 3197|       |                  // treat as having correct indentation
 3198|  93.1k|                  if (first_item && *it == '-') {
  ------------------
  |  Branch (3198:23): [True: 50.5k, False: 42.6k]
  |  Branch (3198:37): [True: 50.2k, False: 251]
  ------------------
 3199|  50.2k|                     line_indent = sequence_indent;
 3200|  50.2k|                     if constexpr (std::is_pointer_v<std::decay_t<It>>) {
 3201|  50.2k|                        if (ctx.stream_begin && it > ctx.stream_begin) {
  ------------------
  |  Branch (3201:29): [True: 50.2k, False: 0]
  |  Branch (3201:49): [True: 49.8k, False: 410]
  ------------------
 3202|  49.8k|                           auto probe = it;
 3203|  49.8k|                           int32_t leading_ws = 0;
 3204|  49.8k|                           bool saw_tab = false;
 3205|   108k|                           while (probe > ctx.stream_begin && (*(probe - 1) == ' ' || *(probe - 1) == '\t')) {
  ------------------
  |  Branch (3205:35): [True: 108k, False: 61]
  |  Branch (3205:64): [True: 48.2k, False: 60.4k]
  |  Branch (3205:87): [True: 10.7k, False: 49.7k]
  ------------------
 3206|  58.9k|                              --probe;
 3207|  58.9k|                              ++leading_ws;
 3208|  58.9k|                              saw_tab = saw_tab || (*probe == '\t');
  ------------------
  |  Branch (3208:41): [True: 10.2k, False: 48.7k]
  |  Branch (3208:52): [True: 1.07k, False: 47.6k]
  ------------------
 3209|  58.9k|                           }
 3210|  49.8k|                           if (probe == ctx.stream_begin || *(probe - 1) == '\n' || *(probe - 1) == '\r') {
  ------------------
  |  Branch (3210:32): [True: 61, False: 49.7k]
  |  Branch (3210:61): [True: 15.2k, False: 34.5k]
  |  Branch (3210:85): [True: 6.15k, False: 28.3k]
  ------------------
 3211|  21.4k|                              if (saw_tab) {
  ------------------
  |  Branch (3211:35): [True: 12, False: 21.4k]
  ------------------
 3212|     12|                                 ctx.error = error_code::syntax_error;
 3213|     12|                                 return;
 3214|     12|                              }
 3215|  21.4k|                              line_indent = (std::max)(line_indent, leading_ws);
 3216|  21.4k|                           }
 3217|  49.8k|                        }
 3218|  50.2k|                     }
 3219|  50.2k|                  }
 3220|  50.2k|                  break;
 3221|  93.1k|               }
 3222|   152k|            }
 3223|       |
 3224|   107k|            if (it == end) break;
  ------------------
  |  Branch (3224:17): [True: 3.43k, False: 104k]
  ------------------
 3225|       |
 3226|       |            // Check for document end marker
 3227|   104k|            if (at_document_end(it, end)) break;
  ------------------
  |  Branch (3227:17): [True: 1.75k, False: 102k]
  ------------------
 3228|       |
 3229|       |            // Check for dedent
 3230|   102k|            if (line_indent < sequence_indent) {
  ------------------
  |  Branch (3230:17): [True: 7.34k, False: 95.1k]
  ------------------
 3231|  7.34k|               it = line_start;
 3232|  7.34k|               return;
 3233|  7.34k|            }
 3234|       |
 3235|  95.1k|            if (*it == '&') {
  ------------------
  |  Branch (3235:17): [True: 13.0k, False: 82.0k]
  ------------------
 3236|       |               // Standalone anchor lines before "- item" are only supported for
 3237|       |               // indentless mapping values. At top-level block sequences these are
 3238|       |               // malformed in yaml-test-suite cases.
 3239|  13.0k|               if (!ctx.allow_indentless_sequence) {
  ------------------
  |  Branch (3239:20): [True: 13, False: 13.0k]
  ------------------
 3240|     13|                  ctx.error = error_code::syntax_error;
 3241|     13|                  return;
 3242|     13|               }
 3243|       |
 3244|  13.0k|               ++it;
 3245|  13.0k|               auto pending_name = parse_anchor_name(it, end);
 3246|  13.0k|               if (pending_name.empty()) {
  ------------------
  |  Branch (3246:20): [True: 5, False: 13.0k]
  ------------------
 3247|      5|                  ctx.error = error_code::syntax_error;
 3248|      5|                  return;
 3249|      5|               }
 3250|  13.0k|               skip_inline_ws(it, end);
 3251|  13.0k|               if (it != end && *it == '#') {
  ------------------
  |  Branch (3251:20): [True: 13.0k, False: 28]
  |  Branch (3251:33): [True: 7.38k, False: 5.66k]
  ------------------
 3252|  7.38k|                  skip_comment(it, end);
 3253|  7.38k|               }
 3254|       |
 3255|  13.0k|               has_pending_item_anchor = true;
 3256|  13.0k|               pending_item_anchor_name = std::string(pending_name);
 3257|  13.0k|               pending_item_anchor_indent = line_indent;
 3258|       |
 3259|  13.0k|               if (it == end || (*it != '\n' && *it != '\r')) {
  ------------------
  |  Branch (3259:20): [True: 43, False: 13.0k]
  |  Branch (3259:34): [True: 4.96k, False: 8.07k]
  |  Branch (3259:49): [True: 27, False: 4.93k]
  ------------------
 3260|     70|                  ctx.error = error_code::syntax_error;
 3261|     70|                  return;
 3262|     70|               }
 3263|       |
 3264|  13.0k|               skip_newline(it, end);
 3265|  13.0k|               continue;
 3266|  13.0k|            }
 3267|       |
 3268|       |            // Expect dash for sequence item
 3269|  82.0k|            if (*it != '-') {
  ------------------
  |  Branch (3269:17): [True: 5.86k, False: 76.1k]
  ------------------
 3270|  5.86k|               it = line_start;
 3271|  5.86k|               return;
 3272|  5.86k|            }
 3273|       |
 3274|       |            // Compute the actual column of this sequence dash.
 3275|       |            // This is needed by plain-scalar multiline folding to distinguish
 3276|       |            // sibling "- item" entries from deeper "- " continuation content.
 3277|  76.1k|            dash_col = line_indent;
 3278|  76.1k|            if constexpr (std::is_pointer_v<std::decay_t<It>>) {
 3279|  76.1k|               if (ctx.stream_begin) {
  ------------------
  |  Branch (3279:20): [True: 76.1k, False: 12]
  ------------------
 3280|  76.1k|                  dash_col = ctx.line_prefix_before(&*it).column;
 3281|  76.1k|               }
 3282|  76.1k|            }
 3283|       |
 3284|  76.1k|            ++it; // Skip '-'
 3285|       |
 3286|       |            // Check for valid sequence item indicator (- followed by space or newline)
 3287|  76.1k|            if (it != end && !yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*it)]) {
  ------------------
  |  Branch (3287:17): [True: 72.2k, False: 3.86k]
  |  Branch (3287:30): [True: 1.37k, False: 70.9k]
  ------------------
 3288|       |               // Not a sequence item (could be a number like -5)
 3289|  1.37k|               it = line_start;
 3290|  1.37k|               return;
 3291|  1.37k|            }
 3292|       |
 3293|  74.7k|            bool saw_tab_after_dash = false;
 3294|   136k|            while (it != end && (*it == ' ' || *it == '\t')) {
  ------------------
  |  Branch (3294:20): [True: 132k, False: 4.05k]
  |  Branch (3294:34): [True: 57.0k, False: 75.2k]
  |  Branch (3294:48): [True: 4.57k, False: 70.7k]
  ------------------
 3295|  61.5k|               saw_tab_after_dash = saw_tab_after_dash || (*it == '\t');
  ------------------
  |  Branch (3295:37): [True: 801, False: 60.7k]
  |  Branch (3295:59): [True: 3.87k, False: 56.9k]
  ------------------
 3296|  61.5k|               ++it;
 3297|  61.5k|            }
 3298|       |            // A tab-separated nested "- " marker is not valid block indentation.
 3299|  74.7k|            if (saw_tab_after_dash && it != end && *it == '-') {
  ------------------
  |  Branch (3299:17): [True: 3.87k, False: 70.8k]
  |  Branch (3299:39): [True: 3.80k, False: 70]
  |  Branch (3299:52): [True: 1.34k, False: 2.46k]
  ------------------
 3300|  1.34k|               const auto after_dash = it + 1;
 3301|  1.34k|               if (after_dash == end || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*after_dash)]) {
  ------------------
  |  Branch (3301:20): [True: 1, False: 1.34k]
  |  Branch (3301:41): [True: 2, False: 1.33k]
  ------------------
 3302|      3|                  ctx.error = error_code::syntax_error;
 3303|      3|                  return;
 3304|      3|               }
 3305|  1.34k|            }
 3306|       |
 3307|       |            // Get reference to element to parse into
 3308|  74.7k|            auto parse_element = [&](auto& element) {
 3309|  74.7k|               const char* element_start = (it != end) ? &*it : nullptr;
 3310|       |
 3311|       |               // Check what follows
 3312|  74.7k|               if (it != end && !yaml::line_end_or_comment_table[static_cast<uint8_t>(*it)]) {
 3313|       |                  // Content on same line as dash - set indent to one less than content column
 3314|       |                  // This allows nested block mappings to continue parsing keys at the content indent
 3315|       |                  // For "- key: val", if dash is at column 0, content is at column 2
 3316|       |                  // We set parent indent to 1 so keys at column 2 pass the "indent > parent" check
 3317|  74.7k|                  if (!ctx.push_indent(line_indent + 1)) [[unlikely]]
 3318|  74.7k|                     return;
 3319|  74.7k|                  const bool prev_sequence_item_value_context = ctx.sequence_item_value_context;
 3320|  74.7k|                  const int32_t prev_sequence_dash_indent = ctx.sequence_dash_indent;
 3321|  74.7k|                  ctx.sequence_item_value_context = true;
 3322|  74.7k|                  ctx.sequence_dash_indent = dash_col;
 3323|  74.7k|                  from<YAML, value_type>::template op<Opts>(element, ctx, it, end);
 3324|  74.7k|                  ctx.sequence_dash_indent = prev_sequence_dash_indent;
 3325|  74.7k|                  ctx.sequence_item_value_context = prev_sequence_item_value_context;
 3326|  74.7k|                  ctx.pop_indent();
 3327|  74.7k|               }
 3328|  74.7k|               else {
 3329|       |                  // Value on next line - nested block
 3330|  74.7k|                  skip_ws_and_comment(it, end);
 3331|  74.7k|                  skip_newline(it, end);
 3332|       |
 3333|       |                  // Get indent of nested content
 3334|  74.7k|                  auto nested_start = it;
 3335|  74.7k|                  int32_t nested_indent = measure_indent(it, end, ctx);
 3336|  74.7k|                  if (bool(ctx.error)) [[unlikely]]
 3337|  74.7k|                     return;
 3338|  74.7k|                  it = nested_start;
 3339|       |
 3340|       |                  // Content is nested only if indented more than the current line.
 3341|       |                  // When line_indent is negative (root level), use 0 as the baseline.
 3342|       |                  // This prevents content at column 0 from being treated as nested.
 3343|  74.7k|                  const int32_t effective_line_indent = (line_indent < 0) ? 0 : line_indent;
 3344|  74.7k|                  if (nested_indent > effective_line_indent) {
 3345|       |                     // Save and set indent for nested parsing.
 3346|       |                     // A struct element reads the pushed indent as its own key column; every
 3347|       |                     // other element type reads it as the enclosing baseline, so it gets one
 3348|       |                     // less than the content indent and its content passes "indent > parent".
 3349|  74.7k|                     const int32_t element_indent =
 3350|  74.7k|                        receives_block_mapping_column<value_type>() ? nested_indent : nested_indent - 1;
 3351|  74.7k|                     if (!ctx.push_indent(element_indent)) [[unlikely]]
 3352|  74.7k|                        return;
 3353|  74.7k|                     const bool prev_sequence_item_value_context = ctx.sequence_item_value_context;
 3354|  74.7k|                     const int32_t prev_sequence_dash_indent = ctx.sequence_dash_indent;
 3355|  74.7k|                     ctx.sequence_item_value_context = true;
 3356|  74.7k|                     ctx.sequence_dash_indent = dash_col;
 3357|  74.7k|                     from<YAML, value_type>::template op<Opts>(element, ctx, it, end);
 3358|  74.7k|                     ctx.sequence_dash_indent = prev_sequence_dash_indent;
 3359|  74.7k|                     ctx.sequence_item_value_context = prev_sequence_item_value_context;
 3360|  74.7k|                     ctx.pop_indent();
 3361|  74.7k|                  }
 3362|       |                  // else: empty element (default constructed)
 3363|  74.7k|               }
 3364|       |
 3365|  74.7k|               if (has_pending_item_anchor && !bool(ctx.error)) {
 3366|  74.7k|                  const char* element_end = (it != end) ? &*it : element_start;
 3367|  74.7k|                  ctx.anchors[std::move(pending_item_anchor_name)] = {element_start, element_end,
 3368|  74.7k|                                                                      pending_item_anchor_indent};
 3369|  74.7k|                  has_pending_item_anchor = false;
 3370|  74.7k|               }
 3371|  74.7k|            };
 3372|       |
 3373|  74.7k|            if constexpr (emplace_backable<V>) {
 3374|  74.7k|               auto& element = value.emplace_back();
 3375|  74.7k|               parse_element(element);
 3376|       |            }
 3377|       |            else if constexpr (emplaceable<V>) {
 3378|       |               value_type element{};
 3379|       |               parse_element(element);
 3380|       |               if (!bool(ctx.error)) {
 3381|       |                  adapter.append(value, std::move(element));
 3382|       |               }
 3383|       |            }
 3384|       |            else if constexpr (!resizable<V>) {
 3385|       |               parse_element(value[adapter.index]);
 3386|       |               adapter.commit_fixed_slot();
 3387|       |            }
 3388|       |            else {
 3389|       |               ctx.error = error_code::syntax_error;
 3390|       |               return;
 3391|       |            }
 3392|       |
 3393|  74.7k|            first_item = false;
 3394|       |
 3395|  74.7k|            if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (3395:17): [True: 444, False: 74.3k]
  ------------------
 3396|    444|               return;
 3397|       |
 3398|       |            // Note: after parsing nested block content, iterator may already be
 3399|       |            // at the start of the next line. The outer loop will handle it.
 3400|  74.7k|         }
 3401|  50.5k|      }
_ZZN3glz4yaml20parse_block_sequenceITnDaXtlNS0_9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj32EEERNSt3__16vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS3_9allocatorIS8_EEEENS0_12yaml_contextEPKcSF_EEvOT0_RT1_RT2_T3_iENKUlRT_E_clIS8_EEDaSO_:
 3308|  74.7k|            auto parse_element = [&](auto& element) {
 3309|  74.7k|               const char* element_start = (it != end) ? &*it : nullptr;
  ------------------
  |  Branch (3309:44): [True: 70.7k, False: 4.04k]
  ------------------
 3310|       |
 3311|       |               // Check what follows
 3312|  74.7k|               if (it != end && !yaml::line_end_or_comment_table[static_cast<uint8_t>(*it)]) {
  ------------------
  |  Branch (3312:20): [True: 70.7k, False: 4.04k]
  |  Branch (3312:33): [True: 37.1k, False: 33.5k]
  ------------------
 3313|       |                  // Content on same line as dash - set indent to one less than content column
 3314|       |                  // This allows nested block mappings to continue parsing keys at the content indent
 3315|       |                  // For "- key: val", if dash is at column 0, content is at column 2
 3316|       |                  // We set parent indent to 1 so keys at column 2 pass the "indent > parent" check
 3317|  37.1k|                  if (!ctx.push_indent(line_indent + 1)) [[unlikely]]
  ------------------
  |  Branch (3317:23): [True: 0, False: 37.1k]
  ------------------
 3318|      0|                     return;
 3319|  37.1k|                  const bool prev_sequence_item_value_context = ctx.sequence_item_value_context;
 3320|  37.1k|                  const int32_t prev_sequence_dash_indent = ctx.sequence_dash_indent;
 3321|  37.1k|                  ctx.sequence_item_value_context = true;
 3322|  37.1k|                  ctx.sequence_dash_indent = dash_col;
 3323|  37.1k|                  from<YAML, value_type>::template op<Opts>(element, ctx, it, end);
 3324|  37.1k|                  ctx.sequence_dash_indent = prev_sequence_dash_indent;
 3325|  37.1k|                  ctx.sequence_item_value_context = prev_sequence_item_value_context;
 3326|  37.1k|                  ctx.pop_indent();
 3327|  37.1k|               }
 3328|  37.6k|               else {
 3329|       |                  // Value on next line - nested block
 3330|  37.6k|                  skip_ws_and_comment(it, end);
 3331|  37.6k|                  skip_newline(it, end);
 3332|       |
 3333|       |                  // Get indent of nested content
 3334|  37.6k|                  auto nested_start = it;
 3335|  37.6k|                  int32_t nested_indent = measure_indent(it, end, ctx);
 3336|  37.6k|                  if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (3336:23): [True: 5, False: 37.6k]
  ------------------
 3337|      5|                     return;
 3338|  37.6k|                  it = nested_start;
 3339|       |
 3340|       |                  // Content is nested only if indented more than the current line.
 3341|       |                  // When line_indent is negative (root level), use 0 as the baseline.
 3342|       |                  // This prevents content at column 0 from being treated as nested.
 3343|  37.6k|                  const int32_t effective_line_indent = (line_indent < 0) ? 0 : line_indent;
  ------------------
  |  Branch (3343:57): [True: 1.59k, False: 36.0k]
  ------------------
 3344|  37.6k|                  if (nested_indent > effective_line_indent) {
  ------------------
  |  Branch (3344:23): [True: 14.7k, False: 22.8k]
  ------------------
 3345|       |                     // Save and set indent for nested parsing.
 3346|       |                     // A struct element reads the pushed indent as its own key column; every
 3347|       |                     // other element type reads it as the enclosing baseline, so it gets one
 3348|       |                     // less than the content indent and its content passes "indent > parent".
 3349|  14.7k|                     const int32_t element_indent =
 3350|  14.7k|                        receives_block_mapping_column<value_type>() ? nested_indent : nested_indent - 1;
  ------------------
  |  Branch (3350:25): [Folded, False: 14.7k]
  ------------------
 3351|  14.7k|                     if (!ctx.push_indent(element_indent)) [[unlikely]]
  ------------------
  |  Branch (3351:26): [True: 0, False: 14.7k]
  ------------------
 3352|      0|                        return;
 3353|  14.7k|                     const bool prev_sequence_item_value_context = ctx.sequence_item_value_context;
 3354|  14.7k|                     const int32_t prev_sequence_dash_indent = ctx.sequence_dash_indent;
 3355|  14.7k|                     ctx.sequence_item_value_context = true;
 3356|  14.7k|                     ctx.sequence_dash_indent = dash_col;
 3357|  14.7k|                     from<YAML, value_type>::template op<Opts>(element, ctx, it, end);
 3358|  14.7k|                     ctx.sequence_dash_indent = prev_sequence_dash_indent;
 3359|  14.7k|                     ctx.sequence_item_value_context = prev_sequence_item_value_context;
 3360|  14.7k|                     ctx.pop_indent();
 3361|  14.7k|                  }
 3362|       |                  // else: empty element (default constructed)
 3363|  37.6k|               }
 3364|       |
 3365|  74.7k|               if (has_pending_item_anchor && !bool(ctx.error)) {
  ------------------
  |  Branch (3365:20): [True: 7.89k, False: 66.8k]
  |  Branch (3365:47): [True: 7.85k, False: 38]
  ------------------
 3366|  7.85k|                  const char* element_end = (it != end) ? &*it : element_start;
  ------------------
  |  Branch (3366:45): [True: 7.00k, False: 852]
  ------------------
 3367|  7.85k|                  ctx.anchors[std::move(pending_item_anchor_name)] = {element_start, element_end,
 3368|  7.85k|                                                                      pending_item_anchor_indent};
 3369|  7.85k|                  has_pending_item_anchor = false;
 3370|  7.85k|               }
 3371|  74.7k|            };
_ZN3glz29parse_block_mapping_or_stringINSt3__17variantIJDndNS1_12basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEbNS1_6vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS6_ISD_EEEENSC_ISD_EEEEETnDaXtlNS_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj32EEERSH_RNSI_12yaml_contextERPKcSO_EEvOT1_OT2_OT3_T4_:
 5423|   271k|   {
 5424|       |      if constexpr (yaml::check_flow_context(Opts)) {
 5425|       |         // In flow context, only treat plain content as an implicit "key: value"
 5426|       |         // when a mapping separator appears before the next top-level flow delimiter.
 5427|       |         auto could_be_implicit_flow_pair = [&](auto pos) {
 5428|       |            // Bounded by the longest implicit key the spec allows: unbounded, this probe runs
 5429|       |            // once per entry per nesting level over the whole remaining flow collection.
 5430|       |            const auto stop = yaml::implicit_key_scan_end(pos, end);
 5431|       |            int depth = 0;
 5432|       |            while (pos != stop) {
 5433|       |               const char c = *pos;
 5434|       |               if (c == '"' || c == '\'') {
 5435|       |                  const char quote = c;
 5436|       |                  ++pos;
 5437|       |                  while (pos != stop && *pos != quote) {
 5438|       |                     if (*pos == '\\' && quote == '"') {
 5439|       |                        ++pos;
 5440|       |                        if (pos != stop) ++pos;
 5441|       |                     }
 5442|       |                     else {
 5443|       |                        ++pos;
 5444|       |                     }
 5445|       |                  }
 5446|       |                  if (pos != stop) ++pos;
 5447|       |                  continue;
 5448|       |               }
 5449|       |               if (c == '[' || c == '{') {
 5450|       |                  ++depth;
 5451|       |                  ++pos;
 5452|       |                  continue;
 5453|       |               }
 5454|       |               if (c == ']' || c == '}') {
 5455|       |                  if (depth == 0) return false;
 5456|       |                  --depth;
 5457|       |                  ++pos;
 5458|       |                  continue;
 5459|       |               }
 5460|       |               if (c == ',' && depth == 0) return false;
 5461|       |               if (c == ':' && depth == 0) {
 5462|       |                  auto next = pos + 1;
 5463|       |                  return next == end || *next == ' ' || *next == '\t' || *next == '\n' || *next == '\r';
 5464|       |               }
 5465|       |               ++pos;
 5466|       |            }
 5467|       |            return false;
 5468|       |         };
 5469|       |
 5470|       |         if (could_be_implicit_flow_pair(it) || line_could_be_flow_mapping(it, end)) {
 5471|       |            if (try_parse_block_mapping_into_variant<Variant, Opts>(value, ctx, it, end)) {
 5472|       |               return;
 5473|       |            }
 5474|       |            if (bool(ctx.error)) {
 5475|       |               return;
 5476|       |            }
 5477|       |         }
 5478|       |
 5479|       |         process_yaml_variant_alternatives<Variant, is_yaml_variant_str>::template op<Opts>(value, ctx, it, end);
 5480|       |         return;
 5481|       |      }
 5482|       |
 5483|   271k|      if (try_parse_block_mapping_into_variant<Variant, Opts>(value, ctx, it, end)) {
  ------------------
  |  Branch (5483:11): [True: 160k, False: 111k]
  ------------------
 5484|   160k|         return;
 5485|   160k|      }
 5486|       |      // If an error was set (e.g., malformed flow collection in value), don't try to parse as string
 5487|   111k|      if (bool(ctx.error)) {
  ------------------
  |  Branch (5487:11): [True: 6.39k, False: 105k]
  ------------------
 5488|  6.39k|         return;
 5489|  6.39k|      }
 5490|   105k|      process_yaml_variant_alternatives<Variant, is_yaml_variant_str>::template op<Opts>(value, ctx, it, end);
 5491|   105k|   }
_ZZN3glz4fromILj450ENSt3__17variantIJDndNS1_12basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEbNS1_6vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS6_ISD_EEEENSC_ISD_EEEEEE2opITnDaXtlNS_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj32EEERPKcRSH_TkNS_10is_contextERNSK_12yaml_contextESN_EEvOT1_OT2_OT0_T3_ENKUlT_E0_clISN_EEDaSZ_:
 5848|  34.2k|            auto is_word_boundary = [&](const auto ptr) {
 5849|  34.2k|               if (ptr == end) {
  ------------------
  |  Branch (5849:20): [True: 1.01k, False: 33.2k]
  ------------------
 5850|  1.01k|                  return true;
 5851|  1.01k|               }
 5852|  33.2k|               if (*ptr == ':') {
  ------------------
  |  Branch (5852:20): [True: 23.2k, False: 10.0k]
  ------------------
 5853|  23.2k|                  auto next = ptr + 1;
 5854|  23.2k|                  return (next == end) || *next == ' ' || *next == '\t' || *next == '\n' || *next == '\r';
  ------------------
  |  Branch (5854:26): [True: 1.35k, False: 21.8k]
  |  Branch (5854:43): [True: 18.5k, False: 3.33k]
  |  Branch (5854:59): [True: 1.59k, False: 1.74k]
  |  Branch (5854:76): [True: 667, False: 1.07k]
  |  Branch (5854:93): [True: 573, False: 503]
  ------------------
 5855|  23.2k|               }
 5856|  10.0k|               return is_plain_scalar_boundary(*ptr);
 5857|  33.2k|            };
_ZZN3glz4fromILj450ENSt3__17variantIJDndNS1_12basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEbNS1_6vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS6_ISD_EEEENSC_ISD_EEEEEE2opITnDaXtlNS_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj32EEERPKcRSH_TkNS_10is_contextERNSK_12yaml_contextESN_EEvOT1_OT2_OT0_T3_ENKUlcE_clEc:
 5774|  10.0k|            auto is_plain_scalar_boundary = [](const char ch) {
 5775|  10.0k|               switch (ch) {
 5776|    351|               case ' ':
  ------------------
  |  Branch (5776:16): [True: 351, False: 9.67k]
  ------------------
 5777|    723|               case '\t':
  ------------------
  |  Branch (5777:16): [True: 372, False: 9.65k]
  ------------------
 5778|  4.65k|               case '\n':
  ------------------
  |  Branch (5778:16): [True: 3.93k, False: 6.08k]
  ------------------
 5779|  7.11k|               case '\r':
  ------------------
  |  Branch (5779:16): [True: 2.45k, False: 7.56k]
  ------------------
 5780|  7.46k|               case ',':
  ------------------
  |  Branch (5780:16): [True: 354, False: 9.66k]
  ------------------
 5781|  8.10k|               case ']':
  ------------------
  |  Branch (5781:16): [True: 638, False: 9.38k]
  ------------------
 5782|  8.66k|               case '}':
  ------------------
  |  Branch (5782:16): [True: 560, False: 9.46k]
  ------------------
 5783|  8.66k|                  return true;
 5784|  1.35k|               default:
  ------------------
  |  Branch (5784:16): [True: 1.35k, False: 8.66k]
  ------------------
 5785|  1.35k|                  return false;
 5786|  10.0k|               }
 5787|  10.0k|            };
_ZZN3glz4fromILj450ENSt3__17variantIJDndNS1_12basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEbNS1_6vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS6_ISD_EEEENSC_ISD_EEEEEE2opITnDaXtlNS_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj32EEERPKcRSH_TkNS_10is_contextERNSK_12yaml_contextESN_EEvOT1_OT2_OT0_T3_ENKUlT_E_clISN_EEDaSZ_:
 5789|  32.4k|            auto has_indented_block_continuation = [&](auto word_end) {
 5790|       |               if constexpr (yaml::check_flow_context(Opts)) {
 5791|       |                  return false;
 5792|       |               }
 5793|  32.4k|               if (ctx.current_indent() < 0) {
  ------------------
  |  Branch (5793:20): [True: 1.77k, False: 30.6k]
  ------------------
 5794|  1.77k|                  return false;
 5795|  1.77k|               }
 5796|  30.6k|               if (word_end == end || (*word_end != '\n' && *word_end != '\r')) {
  ------------------
  |  Branch (5796:20): [True: 668, False: 29.9k]
  |  Branch (5796:40): [True: 26.0k, False: 3.93k]
  |  Branch (5796:61): [True: 23.6k, False: 2.45k]
  ------------------
 5797|  24.2k|                  return false;
 5798|  24.2k|               }
 5799|       |
 5800|  6.38k|               auto look = word_end;
 5801|  6.38k|               yaml::skip_newline(look, end);
 5802|  19.0k|               while (look != end) {
  ------------------
  |  Branch (5802:23): [True: 18.3k, False: 757]
  ------------------
 5803|  18.3k|                  int32_t line_indent = 0;
 5804|  32.6k|                  while (look != end && *look == ' ') {
  ------------------
  |  Branch (5804:26): [True: 32.3k, False: 274]
  |  Branch (5804:41): [True: 14.2k, False: 18.0k]
  ------------------
 5805|  14.2k|                     ++line_indent;
 5806|  14.2k|                     ++look;
 5807|  14.2k|                  }
 5808|  18.3k|                  if (look != end && *look == '\t') {
  ------------------
  |  Branch (5808:23): [True: 18.0k, False: 274]
  |  Branch (5808:38): [True: 396, False: 17.6k]
  ------------------
 5809|    396|                     return false;
 5810|    396|                  }
 5811|  17.9k|                  if (look == end || *look == '\n' || *look == '\r') {
  ------------------
  |  Branch (5811:23): [True: 274, False: 17.6k]
  |  Branch (5811:38): [True: 2.85k, False: 14.8k]
  |  Branch (5811:55): [True: 6.29k, False: 8.50k]
  ------------------
 5812|  9.42k|                     if (look != end) {
  ------------------
  |  Branch (5812:26): [True: 9.15k, False: 274]
  ------------------
 5813|  9.15k|                        yaml::skip_newline(look, end);
 5814|  9.15k|                        continue;
 5815|  9.15k|                     }
 5816|    274|                     return false;
 5817|  9.42k|                  }
 5818|  8.50k|                  if (*look == '#') {
  ------------------
  |  Branch (5818:23): [True: 3.61k, False: 4.89k]
  ------------------
 5819|  3.61k|                     yaml::skip_comment(look, end);
 5820|  3.61k|                     if (look != end && (*look == '\n' || *look == '\r')) {
  ------------------
  |  Branch (5820:26): [True: 3.55k, False: 59]
  |  Branch (5820:42): [True: 2.73k, False: 812]
  |  Branch (5820:59): [True: 812, False: 0]
  ------------------
 5821|  3.55k|                        yaml::skip_newline(look, end);
 5822|  3.55k|                        continue;
 5823|  3.55k|                     }
 5824|     59|                     return false;
 5825|  3.61k|                  }
 5826|       |
 5827|       |                  // If the next non-empty line is an implicit mapping entry,
 5828|       |                  // don't treat it as scalar continuation for auto-deduced
 5829|       |                  // booleans/nulls.
 5830|  4.89k|                  {
 5831|  4.89k|                     auto scan = look;
 5832|   414k|                     while (scan != end && *scan != '\n' && *scan != '\r') {
  ------------------
  |  Branch (5832:29): [True: 413k, False: 218]
  |  Branch (5832:44): [True: 413k, False: 773]
  |  Branch (5832:61): [True: 412k, False: 300]
  ------------------
 5833|   412k|                        if (*scan == ':') {
  ------------------
  |  Branch (5833:29): [True: 32.3k, False: 380k]
  ------------------
 5834|  32.3k|                           auto after_colon = scan + 1;
 5835|  32.3k|                           if (after_colon == end || *after_colon == ' ' || *after_colon == '\t' ||
  ------------------
  |  Branch (5835:32): [True: 115, False: 32.2k]
  |  Branch (5835:54): [True: 1.50k, False: 30.7k]
  |  Branch (5835:77): [True: 1.41k, False: 29.3k]
  ------------------
 5836|  29.3k|                               *after_colon == '\n' || *after_colon == '\r') {
  ------------------
  |  Branch (5836:32): [True: 192, False: 29.1k]
  |  Branch (5836:56): [True: 376, False: 28.7k]
  ------------------
 5837|  3.60k|                              return false;
 5838|  3.60k|                           }
 5839|  32.3k|                        }
 5840|   409k|                        ++scan;
 5841|   409k|                     }
 5842|  4.89k|                  }
 5843|       |
 5844|  1.29k|                  return line_indent > ctx.current_indent();
 5845|  4.89k|               }
 5846|    757|               return false;
 5847|  6.38k|            };
_ZN3glz36try_parse_block_mapping_into_variantINSt3__17variantIJDndNS1_12basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEbNS1_6vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS6_ISD_EEEENSC_ISD_EEEEETnDaXtlNS_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj32EEERSH_RNSI_12yaml_contextERPKcSO_EEbOT1_OT2_OT3_T4_:
 5377|   320k|   {
 5378|   320k|      using counts = yaml_variant_type_count<Variant>;
 5379|       |      if constexpr (counts::n_object == 0) {
 5380|       |         return false;
 5381|       |      }
 5382|   320k|      else {
 5383|       |         // Quick check: if no viable mapping separator in the current span,
 5384|       |         // avoid expensive speculative parse.
 5385|   320k|         const bool could_be_mapping = [&] {
 5386|   320k|            if constexpr (yaml::check_flow_context(Opts)) {
 5387|   320k|               return line_could_be_flow_mapping(it, end);
 5388|   320k|            }
 5389|   320k|            else {
 5390|   320k|               return yaml::line_could_be_block_mapping(it, end);
 5391|   320k|            }
 5392|   320k|         }();
 5393|   320k|         if (!could_be_mapping) {
  ------------------
  |  Branch (5393:14): [True: 118k, False: 202k]
  ------------------
 5394|   118k|            return false;
 5395|   118k|         }
 5396|       |         // Full parse attempt - use a temporary context that inherits indent from parent
 5397|   202k|         auto temp_ctx = ctx.make_speculative();
 5398|   202k|         process_yaml_variant_alternatives<Variant, is_yaml_variant_object>::template op<Opts>(value, temp_ctx, it,
 5399|   202k|                                                                                               end);
 5400|   202k|         ctx.alias_expansion_budget = temp_ctx.alias_expansion_budget; // charged even if rejected
 5401|   202k|         ctx.key_expansion_budget = temp_ctx.key_expansion_budget;
 5402|   202k|         if (!bool(temp_ctx.error)) {
  ------------------
  |  Branch (5402:14): [True: 190k, False: 12.1k]
  ------------------
 5403|   190k|            ctx.anchors = std::move(temp_ctx.anchors);
 5404|   190k|            return true;
 5405|   190k|         }
 5406|       |         // The line matched "key: value" pattern but parsing failed.
 5407|       |         // This indicates malformed content (e.g., unclosed flow collection),
 5408|       |         // so propagate the error rather than silently falling back to string.
 5409|  12.1k|         ctx.error = temp_ctx.error;
 5410|  12.1k|         ctx.custom_error_message = temp_ctx.custom_error_message;
 5411|  12.1k|         return false;
 5412|   202k|      }
 5413|   320k|   }
_ZZN3glz36try_parse_block_mapping_into_variantINSt3__17variantIJDndNS1_12basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEbNS1_6vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS6_ISD_EEEENSC_ISD_EEEEETnDaXtlNS_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj32EEERSH_RNSI_12yaml_contextERPKcSO_EEbOT1_OT2_OT3_T4_ENKUlvE_clEv:
 5385|   320k|         const bool could_be_mapping = [&] {
 5386|       |            if constexpr (yaml::check_flow_context(Opts)) {
 5387|       |               return line_could_be_flow_mapping(it, end);
 5388|       |            }
 5389|   320k|            else {
 5390|   320k|               return yaml::line_could_be_block_mapping(it, end);
 5391|   320k|            }
 5392|   320k|         }();
_ZZN3glz5parseILj450EE2opITnDaXtlNS_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj32EEERNS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEETkNS_10is_contextERNS3_12yaml_contextERPKcSD_EEvOT0_OT1_OT2_T3_ENKUlT_E_clISD_EEDaSM_:
  145|    600|               auto is_document_start = [&](auto pos) {
  146|    600|                  if (end - pos >= 3 && pos[0] == '-' && pos[1] == '-' && pos[2] == '-') {
  ------------------
  |  Branch (146:23): [True: 350, False: 250]
  |  Branch (146:41): [True: 133, False: 217]
  |  Branch (146:58): [True: 113, False: 20]
  |  Branch (146:75): [True: 105, False: 8]
  ------------------
  147|    105|                     auto after = pos + 3;
  148|    105|                     return after == end || *after == ' ' || *after == '\t' || *after == '\n' || *after == '\r' ||
  ------------------
  |  Branch (148:29): [True: 0, False: 105]
  |  Branch (148:45): [True: 28, False: 77]
  |  Branch (148:62): [True: 45, False: 32]
  |  Branch (148:80): [True: 15, False: 17]
  |  Branch (148:98): [True: 11, False: 6]
  ------------------
  149|      6|                            *after == '#';
  ------------------
  |  Branch (149:29): [True: 1, False: 5]
  ------------------
  150|    105|                  }
  151|    495|                  return false;
  152|    600|               };

