LLVMFuzzerTestOneInput:
    6|  7.17k|extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {
    7|  7.17k|    auto fdp = FuzzedDataProvider(data, size);
    8|       |
    9|  7.17k|    try {
   10|  7.17k|        auto nodes = YAML::LoadAll(fdp.ConsumeRemainingBytesAsString());
   11|  7.17k|    } catch (...) {
   12|  3.99k|    }
   13|       |
   14|  7.17k|    return 0;
   15|  7.17k|}

_ZN4YAML10DepthGuardILi500EEC2ERiRKNS_4MarkERKNSt3__112basic_stringIcNS6_11char_traitsIcEENS6_9allocatorIcEEEE:
   60|  1.72M|  DepthGuard(int & depth_, const Mark& mark_, const std::string& msg_) : m_depth(depth_) {
   61|  1.72M|    ++m_depth;
   62|  1.72M|    if ( max_depth <= m_depth ) {
  ------------------
  |  Branch (62:10): [True: 181, False: 1.72M]
  ------------------
   63|    181|        throw DeepRecursion{m_depth, mark_, msg_};
   64|    181|    }
   65|  1.72M|  }
_ZN4YAML10DepthGuardILi500EED2Ev:
   72|  1.72M|  ~DepthGuard() {
   73|  1.72M|    --m_depth;
   74|  1.72M|  }

_ZN4YAML12EventHandler8OnAnchorERKNS_4MarkERKNSt3__112basic_stringIcNS4_11char_traitsIcEENS4_9allocatorIcEEEE:
   48|  8.13k|                        const std::string& /*anchor_name*/) {
   49|       |    // empty default implementation for compatibility
   50|  8.13k|  }
_ZN4YAML12EventHandlerD2Ev:
   29|   359k|  virtual ~EventHandler() = default;

_ZN4YAML9ExceptionC2ERKNS_4MarkERKNSt3__112basic_stringIcNS4_11char_traitsIcEENS4_9allocatorIcEEEE:
  172|  3.99k|      : std::runtime_error(build_what(mark_, msg_)), mark(mark_), msg(msg_) {}
_ZN4YAML9Exception10build_whatERKNS_4MarkERKNSt3__112basic_stringIcNS4_11char_traitsIcEENS4_9allocatorIcEEEE:
  182|  3.99k|                                      const std::string& msg) {
  183|  3.99k|    if (mark.is_null()) {
  ------------------
  |  Branch (183:9): [True: 0, False: 3.99k]
  ------------------
  184|      0|      return msg;
  185|      0|    }
  186|       |
  187|  3.99k|    std::stringstream output;
  188|  3.99k|    output << "yaml-cpp: error at line " << mark.line + 1 << ", column "
  189|  3.99k|           << mark.column + 1 << ": " << msg;
  190|  3.99k|    return output.str();
  191|  3.99k|  }
_ZN4YAML15ParserExceptionC2ERKNS_4MarkERKNSt3__112basic_stringIcNS4_11char_traitsIcEENS4_9allocatorIcEEEE:
  197|  3.94k|      : Exception(mark_, msg_) {}
_ZN4YAML23RepresentationExceptionC2ERKNS_4MarkERKNSt3__112basic_stringIcNS4_11char_traitsIcEENS4_9allocatorIcEEEE:
  205|     42|      : Exception(mark_, msg_) {}
_ZN4YAML15NonUniqueMapKeyC2INS_6detail4nodeEEERKNS_4MarkERKT_:
  329|     42|      : RepresentationException(mark_, ErrorMsg::NON_UNIQUE_MAP_KEY) {}

_ZN4YAML4MarkC2Ev:
   23|  1.09M|  Mark() : pos(0), line(0), column(0) {}
_ZN4YAML4Mark9null_markEv:
   25|  3.88M|  static const Mark null_mark() { return Mark(-1, -1, -1); }
_ZNK4YAML4Mark7is_nullEv:
   27|  3.99k|  bool is_null() const { return pos == -1 && line == -1 && column == -1; }
  ------------------
  |  Branch (27:33): [True: 0, False: 3.99k]
  |  Branch (27:46): [True: 0, False: 0]
  |  Branch (27:60): [True: 0, False: 0]
  ------------------
_ZN4YAML4MarkC2Eiii:
   34|  3.88M|      : pos(pos_), line(line_), column(column_) {}

_ZN4YAML6detail6memoryC2Ev:
   34|   359k|  memory() : m_nodes{} {}
_ZN4YAML6detail13memory_holderC2Ev:
   46|   359k|  memory_holder() : m_pMemory(std::make_shared<memory>()) {}
_ZN4YAML6detail13memory_holder11create_nodeEv:
   48|  3.88M|  node& create_node() { return m_pMemory->create_node(); }

_ZN4YAML6detail4nodeC2Ev:
   36|  3.88M|  node() : m_pRef(std::make_shared<node_ref>()), m_dependencies{}, m_index{} {}
_ZNK4YAML6detail4node10is_definedEv:
   43|  13.4M|  bool is_defined() const { return m_pRef->is_defined(); }
_ZNK4YAML6detail4node4typeEv:
   45|  9.20M|  NodeType::value type() const { return m_pRef->type(); }
_ZNK4YAML6detail4node6scalarEv:
   47|  10.0M|  const std::string& scalar() const { return m_pRef->scalar(); }
_ZN4YAML6detail4node12mark_definedEv:
   55|  7.72M|  void mark_defined() {
   56|  7.72M|    if (is_defined())
  ------------------
  |  Branch (56:9): [True: 3.84M, False: 3.88M]
  ------------------
   57|  3.84M|      return;
   58|       |
   59|  3.88M|    m_pRef->mark_defined();
   60|  3.88M|    for (node* dependency : m_dependencies)
  ------------------
  |  Branch (60:27): [True: 0, False: 3.88M]
  ------------------
   61|      0|      dependency->mark_defined();
   62|  3.88M|    m_dependencies.clear();
   63|  3.88M|  }
_ZN4YAML6detail4node14add_dependencyERS1_:
   65|  3.37M|  void add_dependency(node& rhs) {
   66|  3.37M|    if (is_defined())
  ------------------
  |  Branch (66:9): [True: 3.37M, False: 0]
  ------------------
   67|  3.37M|      rhs.mark_defined();
   68|      0|    else
   69|      0|      m_dependencies.insert(&rhs);
   70|  3.37M|  }
_ZN4YAML6detail4node8set_markERKNS_4MarkE:
   83|  3.88M|  void set_mark(const Mark& mark) { m_pRef->set_mark(mark); }
_ZN4YAML6detail4node8set_typeENS_8NodeType5valueE:
   85|   213k|  void set_type(NodeType::value type) {
   86|   213k|    if (type != NodeType::Undefined)
  ------------------
  |  Branch (86:9): [True: 213k, False: 0]
  ------------------
   87|   213k|      mark_defined();
   88|   213k|    m_pRef->set_type(type);
   89|   213k|  }
_ZN4YAML6detail4node8set_nullEv:
   90|  3.63M|  void set_null() {
   91|  3.63M|    mark_defined();
   92|  3.63M|    m_pRef->set_null();
   93|  3.63M|  }
_ZN4YAML6detail4node10set_scalarERKNSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEE:
   94|  34.2k|  void set_scalar(const std::string& scalar) {
   95|  34.2k|    mark_defined();
   96|  34.2k|    m_pRef->set_scalar(scalar);
   97|  34.2k|  }
_ZN4YAML6detail4node7set_tagERKNSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEE:
   98|   248k|  void set_tag(const std::string& tag) {
   99|   248k|    mark_defined();
  100|   248k|    m_pRef->set_tag(tag);
  101|   248k|  }
_ZN4YAML6detail4node9set_styleENS_12EmitterStyle5valueE:
  104|   213k|  void set_style(EmitterStyle::value style) {
  105|   213k|    mark_defined();
  106|   213k|    m_pRef->set_style(style);
  107|   213k|  }
_ZN4YAML6detail4node9push_backERS1_NSt3__110shared_ptrINS0_13memory_holderEEE:
  123|  1.07M|  void push_back(node& input, shared_memory_holder pMemory) {
  124|  1.07M|    m_pRef->push_back(input, pMemory);
  125|  1.07M|    input.add_dependency(*this);
  126|  1.07M|    m_index = m_amount.fetch_add(1);
  127|  1.07M|  }
_ZN4YAML6detail4node6insertERS1_S2_NSt3__110shared_ptrINS0_13memory_holderEEE:
  128|  1.15M|  void insert(node& key, node& value, shared_memory_holder pMemory) {
  129|  1.15M|    m_pRef->insert(key, value, pMemory);
  130|  1.15M|    key.add_dependency(*this);
  131|  1.15M|    value.add_dependency(*this);
  132|  1.15M|  }

_ZNK4YAML6detail9node_data10is_definedEv:
   53|  13.4M|  bool is_defined() const { return m_isDefined; }
_ZNK4YAML6detail9node_data4typeEv:
   55|  9.20M|  NodeType::value type() const {
   56|  9.20M|    return m_isDefined ? m_type : NodeType::Undefined;
  ------------------
  |  Branch (56:12): [True: 9.20M, False: 0]
  ------------------
   57|  9.20M|  }
_ZNK4YAML6detail9node_data6scalarEv:
   58|  10.0M|  const std::string& scalar() const { return m_scalar; }

_ZN4YAML6detail8node_refC2Ev:
   28|  3.88M|  node_ref() : m_pData(std::make_shared<node_data>()) {}
_ZNK4YAML6detail8node_ref10is_definedEv:
   32|  13.4M|  bool is_defined() const { return m_pData->is_defined(); }
_ZNK4YAML6detail8node_ref4typeEv:
   34|  9.20M|  NodeType::value type() const { return m_pData->type(); }
_ZNK4YAML6detail8node_ref6scalarEv:
   35|  10.0M|  const std::string& scalar() const { return m_pData->scalar(); }
_ZN4YAML6detail8node_ref12mark_definedEv:
   39|  3.88M|  void mark_defined() { m_pData->mark_defined(); }
_ZN4YAML6detail8node_ref8set_markERKNS_4MarkE:
   42|  3.88M|  void set_mark(const Mark& mark) { m_pData->set_mark(mark); }
_ZN4YAML6detail8node_ref8set_typeENS_8NodeType5valueE:
   43|   213k|  void set_type(NodeType::value type) { m_pData->set_type(type); }
_ZN4YAML6detail8node_ref7set_tagERKNSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEE:
   44|   248k|  void set_tag(const std::string& tag) { m_pData->set_tag(tag); }
_ZN4YAML6detail8node_ref8set_nullEv:
   45|  3.63M|  void set_null() { m_pData->set_null(); }
_ZN4YAML6detail8node_ref10set_scalarERKNSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEE:
   46|  34.2k|  void set_scalar(const std::string& scalar) { m_pData->set_scalar(scalar); }
_ZN4YAML6detail8node_ref9set_styleENS_12EmitterStyle5valueE:
   47|   213k|  void set_style(EmitterStyle::value style) { m_pData->set_style(style); }
_ZN4YAML6detail8node_ref9push_backERNS0_4nodeENSt3__110shared_ptrINS0_13memory_holderEEE:
   63|  1.07M|  void push_back(node& node, shared_memory_holder pMemory) {
   64|  1.07M|    m_pData->push_back(node, pMemory);
   65|  1.07M|  }
_ZN4YAML6detail8node_ref6insertERNS0_4nodeES3_NSt3__110shared_ptrINS0_13memory_holderEEE:
   66|  1.15M|  void insert(node& key, node& value, shared_memory_holder pMemory) {
   67|  1.15M|    m_pData->insert(key, value, pMemory);
   68|  1.15M|  }

_ZN4YAML4NodeD2Ev:
   65|  1.38M|inline Node::~Node() = default;
_ZN4YAML4NodeC2ERKS0_:
   54|  1.03M|inline Node::Node(const Node&) = default;
_ZN4YAML4NodeC2ERNS_6detail4nodeENSt3__110shared_ptrINS1_13memory_holderEEE:
   63|   352k|    : m_isValid(true), m_invalidKey{}, m_pMemory(pMemory), m_pNode(&node) {}

_ZN4YAML9ExceptionD2Ev:
   24|  3.99k|    #define YAML_CPP_NOEXCEPT noexcept

_ZN4YAML15CollectionStackC2Ev:
   20|   355k|  CollectionStack() : collectionStack{} {}
_ZNK4YAML15CollectionStack20GetCurCollectionTypeEv:
   21|  45.5k|  CollectionType::value GetCurCollectionType() const {
   22|  45.5k|    if (collectionStack.empty())
  ------------------
  |  Branch (22:9): [True: 0, False: 45.5k]
  ------------------
   23|      0|      return CollectionType::NoCollection;
   24|  45.5k|    return collectionStack.top();
   25|  45.5k|  }
_ZN4YAML15CollectionStack18PushCollectionTypeENS_14CollectionType5valueE:
   27|   213k|  void PushCollectionType(CollectionType::value type) {
   28|   213k|    collectionStack.push(type);
   29|   213k|  }
_ZN4YAML15CollectionStack17PopCollectionTypeENS_14CollectionType5valueE:
   30|  62.5k|  void PopCollectionType(CollectionType::value type) {
   31|       |    assert(type == GetCurCollectionType());
   32|  62.5k|    (void)type;
   33|  62.5k|    collectionStack.pop();
   34|  62.5k|  }

_ZN4YAML13DeepRecursionC2EiRKNS_4MarkERKNSt3__112basic_stringIcNS4_11char_traitsIcEENS4_9allocatorIcEEEE:
    7|    181|    : ParserException(mark_, msg_), m_depth(depth) {}

_ZN4YAML10DirectivesC2Ev:
    4|  11.8k|Directives::Directives() : version{true, 1, 2}, tags{} {}
_ZNK4YAML10Directives18TranslateTagHandleERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
    7|  6.16k|    const std::string& handle) const {
    8|  6.16k|  auto it = tags.find(handle);
    9|  6.16k|  if (it == tags.end()) {
  ------------------
  |  Branch (9:7): [True: 4.74k, False: 1.41k]
  ------------------
   10|  4.74k|    if (handle == "!!")
  ------------------
  |  Branch (10:9): [True: 1.37k, False: 3.37k]
  ------------------
   11|  1.37k|      return "tag:yaml.org,2002:";
   12|  3.37k|    return handle;
   13|  4.74k|  }
   14|       |
   15|  1.41k|  return it->second;
   16|  6.16k|}

_ZN4YAML3Exp8ParseHexERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERKNS_4MarkE:
   13|  1.73k|unsigned ParseHex(const std::string& str, const Mark& mark) {
   14|  1.73k|  unsigned value = 0;
   15|  7.85k|  for (char ch : str) {
  ------------------
  |  Branch (15:16): [True: 7.85k, False: 1.65k]
  ------------------
   16|  7.85k|    int digit = 0;
   17|  7.85k|    if ('a' <= ch && ch <= 'f')
  ------------------
  |  Branch (17:9): [True: 1.41k, False: 6.43k]
  |  Branch (17:22): [True: 1.40k, False: 4]
  ------------------
   18|  1.40k|      digit = ch - 'a' + 10;
   19|  6.44k|    else if ('A' <= ch && ch <= 'F')
  ------------------
  |  Branch (19:14): [True: 2.53k, False: 3.90k]
  |  Branch (19:27): [True: 2.52k, False: 8]
  ------------------
   20|  2.52k|      digit = ch - 'A' + 10;
   21|  3.91k|    else if ('0' <= ch && ch <= '9')
  ------------------
  |  Branch (21:14): [True: 3.84k, False: 73]
  |  Branch (21:27): [True: 3.83k, False: 9]
  ------------------
   22|  3.83k|      digit = ch - '0';
   23|     82|    else
   24|     82|      throw ParserException(mark, ErrorMsg::INVALID_HEX);
   25|       |
   26|  7.76k|    value = (value << 4) + digit;
   27|  7.76k|  }
   28|       |
   29|  1.65k|  return value;
   30|  1.73k|}
_ZN4YAML3Exp3StrEj:
   32|  4.36k|std::string Str(unsigned ch) { return std::string(1, static_cast<char>(ch)); }
_ZN4YAML3Exp6EscapeERNS_6StreamEi:
   38|  1.73k|std::string Escape(Stream& in, int codeLength) {
   39|       |  // grab string
   40|  1.73k|  std::string str;
   41|  9.95k|  for (int i = 0; i < codeLength; i++)
  ------------------
  |  Branch (41:19): [True: 8.21k, False: 1.73k]
  ------------------
   42|  8.21k|    str += in.get();
   43|       |
   44|       |  // get the value
   45|  1.73k|  unsigned value = ParseHex(str, in.mark());
   46|       |
   47|       |  // legal unicode?
   48|  1.73k|  if ((value >= 0xD800 && value <= 0xDFFF) || value > 0x10FFFF) {
  ------------------
  |  Branch (48:8): [True: 772, False: 967]
  |  Branch (48:27): [True: 13, False: 759]
  |  Branch (48:47): [True: 42, False: 1.60k]
  ------------------
   49|     55|    std::stringstream msg;
   50|     55|    msg << ErrorMsg::INVALID_UNICODE << value;
   51|     55|    throw ParserException(in.mark(), msg.str());
   52|     55|  }
   53|       |
   54|       |  // now break it up into chars
   55|  1.68k|  if (value <= 0x7F)
  ------------------
  |  Branch (55:7): [True: 248, False: 1.43k]
  ------------------
   56|    248|    return Str(value);
   57|       |
   58|  1.43k|  if (value <= 0x7FF)
  ------------------
  |  Branch (58:7): [True: 260, False: 1.17k]
  ------------------
   59|    260|    return Str(0xC0 + (value >> 6)) + Str(0x80 + (value & 0x3F));
   60|       |
   61|  1.17k|  if (value <= 0xFFFF)
  ------------------
  |  Branch (61:7): [True: 779, False: 397]
  ------------------
   62|    779|    return Str(0xE0 + (value >> 12)) + Str(0x80 + ((value >> 6) & 0x3F)) +
   63|    779|           Str(0x80 + (value & 0x3F));
   64|       |
   65|    397|  return Str(0xF0 + (value >> 18)) + Str(0x80 + ((value >> 12) & 0x3F)) +
   66|    397|         Str(0x80 + ((value >> 6) & 0x3F)) + Str(0x80 + (value & 0x3F));
   67|  1.17k|}
_ZN4YAML3Exp6EscapeERNS_6StreamE:
   74|  35.9k|std::string Escape(Stream& in) {
   75|       |  // eat slash
   76|  35.9k|  char escape = in.get();
   77|       |
   78|       |  // switch on escape character
   79|  35.9k|  char ch = in.get();
   80|       |
   81|       |  // first do single quote, since it's easier
   82|  35.9k|  if (escape == '\'' && ch == '\'')
  ------------------
  |  Branch (82:7): [True: 1.40k, False: 34.5k]
  |  Branch (82:25): [True: 1.40k, False: 0]
  ------------------
   83|  1.40k|    return "\'";
   84|       |
   85|       |  // now do the slash (we're not gonna check if it's a slash - you better pass
   86|       |  // one!)
   87|  34.5k|  switch (ch) {
  ------------------
  |  Branch (87:11): [True: 34.2k, False: 226]
  ------------------
   88|    581|    case '0':
  ------------------
  |  Branch (88:5): [True: 581, False: 33.9k]
  ------------------
   89|    581|      return std::string(1, '\x00');
   90|    197|    case 'a':
  ------------------
  |  Branch (90:5): [True: 197, False: 34.3k]
  ------------------
   91|    197|      return "\x07";
   92|    786|    case 'b':
  ------------------
  |  Branch (92:5): [True: 786, False: 33.7k]
  ------------------
   93|    786|      return "\x08";
   94|    493|    case 't':
  ------------------
  |  Branch (94:5): [True: 493, False: 34.0k]
  ------------------
   95|  4.47k|    case '\t':
  ------------------
  |  Branch (95:5): [True: 3.97k, False: 30.5k]
  ------------------
   96|  4.47k|      return "\x09";
   97|  6.05k|    case 'n':
  ------------------
  |  Branch (97:5): [True: 6.05k, False: 28.4k]
  ------------------
   98|  6.05k|      return "\x0A";
   99|    278|    case 'v':
  ------------------
  |  Branch (99:5): [True: 278, False: 34.2k]
  ------------------
  100|    278|      return "\x0B";
  101|    201|    case 'f':
  ------------------
  |  Branch (101:5): [True: 201, False: 34.3k]
  ------------------
  102|    201|      return "\x0C";
  103|    194|    case 'r':
  ------------------
  |  Branch (103:5): [True: 194, False: 34.3k]
  ------------------
  104|    194|      return "\x0D";
  105|    292|    case 'e':
  ------------------
  |  Branch (105:5): [True: 292, False: 34.2k]
  ------------------
  106|    292|      return "\x1B";
  107|    486|    case ' ':
  ------------------
  |  Branch (107:5): [True: 486, False: 34.0k]
  ------------------
  108|    486|      return R"( )";
  109|  4.60k|    case '\"':
  ------------------
  |  Branch (109:5): [True: 4.60k, False: 29.9k]
  ------------------
  110|  4.60k|      return "\"";
  111|    365|    case '\'':
  ------------------
  |  Branch (111:5): [True: 365, False: 34.1k]
  ------------------
  112|    365|      return "\'";
  113|    289|    case '\\':
  ------------------
  |  Branch (113:5): [True: 289, False: 34.2k]
  ------------------
  114|    289|      return "\\";
  115|    837|    case '/':
  ------------------
  |  Branch (115:5): [True: 837, False: 33.6k]
  ------------------
  116|    837|      return "/";
  117|    324|    case 'N':
  ------------------
  |  Branch (117:5): [True: 324, False: 34.1k]
  ------------------
  118|    324|      return "\xC2\x85";      // NEL (U+0085)
  119|    355|    case '_':
  ------------------
  |  Branch (119:5): [True: 355, False: 34.1k]
  ------------------
  120|    355|      return "\xC2\xA0";      // NBSP (U+00A0)
  121|  9.35k|    case 'L':
  ------------------
  |  Branch (121:5): [True: 9.35k, False: 25.1k]
  ------------------
  122|  9.35k|      return "\xE2\x80\xA8";  // LS (U+2028)
  123|  2.87k|    case 'P':
  ------------------
  |  Branch (123:5): [True: 2.87k, False: 31.6k]
  ------------------
  124|  2.87k|      return "\xE2\x80\xA9";  // PS (U+2029)
  125|    484|    case 'x':
  ------------------
  |  Branch (125:5): [True: 484, False: 34.0k]
  ------------------
  126|    484|      return Escape(in, 2);
  127|    698|    case 'u':
  ------------------
  |  Branch (127:5): [True: 698, False: 33.8k]
  ------------------
  128|    698|      return Escape(in, 4);
  129|    557|    case 'U':
  ------------------
  |  Branch (129:5): [True: 557, False: 33.9k]
  ------------------
  130|    557|      return Escape(in, 8);
  131|  34.5k|  }
  132|       |
  133|    226|  std::stringstream msg;
  134|    226|  throw ParserException(in.mark(), std::string(ErrorMsg::INVALID_ESCAPE) + ch);
  135|  34.5k|}

_ZN4YAML3Exp8DocStartEv:
   84|  2.48M|inline const RegEx& DocStart() {
   85|  2.48M|  static const RegEx e = RegEx("---") + (BlankOrBreak() | RegEx());
   86|  2.48M|  return e;
   87|  2.48M|}
_ZN4YAML3Exp12BlankOrBreakEv:
   43|  35.6M|inline const RegEx& BlankOrBreak() {
   44|  35.6M|  static const RegEx e = Blank() | Break();
   45|  35.6M|  return e;
   46|  35.6M|}
_ZN4YAML3Exp5BlankEv:
   35|  26.5M|inline const RegEx& Blank() {
   36|  26.5M|  static const RegEx e = Space() | Tab();
   37|  26.5M|  return e;
   38|  26.5M|}
_ZN4YAML3Exp5SpaceEv:
   27|      1|inline const RegEx& Space() {
   28|      1|  static const RegEx e = RegEx(' ');
   29|      1|  return e;
   30|      1|}
_ZN4YAML3Exp6DocEndEv:
   88|  2.46M|inline const RegEx& DocEnd() {
   89|  2.46M|  static const RegEx e = RegEx("...") + (BlankOrBreak() | RegEx());
   90|  2.46M|  return e;
   91|  2.46M|}
_ZN4YAML3Exp10BlockEntryEv:
   96|  12.1M|inline const RegEx& BlockEntry() {
   97|  12.1M|  static const RegEx e = RegEx('-') + (BlankOrBreak() | RegEx());
   98|  12.1M|  return e;
   99|  12.1M|}
_ZN4YAML3Exp3KeyEv:
  100|  9.16M|inline const RegEx& Key() {
  101|  9.16M|  static const RegEx e = RegEx('?') + BlankOrBreak();
  102|  9.16M|  return e;
  103|  9.16M|}
_ZN4YAML3Exp9KeyInFlowEv:
  104|   888k|inline const RegEx& KeyInFlow() {
  105|   888k|  static const RegEx e = RegEx('?') + BlankOrBreak();
  106|   888k|  return e;
  107|   888k|}
_ZN4YAML3Exp11PlainScalarEv:
  153|  1.06M|inline const RegEx& PlainScalar() {
  154|  1.06M|  static const RegEx e =
  155|  1.06M|      !(BlankOrBreak() | RegEx(",[]{}#&*!|>\'\"%@`", REGEX_OR) |
  156|  1.06M|        (RegEx("-?:", REGEX_OR) + (BlankOrBreak() | RegEx())));
  157|  1.06M|  return e;
  158|  1.06M|}
_ZN4YAML3Exp17PlainScalarInFlowEv:
  159|   841k|inline const RegEx& PlainScalarInFlow() {
  160|   841k|  static const RegEx e =
  161|   841k|      !(BlankOrBreak() | RegEx("?,[]{}#&*!|>\'\"%@`", REGEX_OR) |
  162|   841k|        (RegEx("-:", REGEX_OR) + (Blank() | RegEx())));
  163|   841k|  return e;
  164|   841k|}
_ZN4YAML3Exp3TabEv:
   31|  63.8k|inline const RegEx& Tab() {
   32|  63.8k|  static const RegEx e = RegEx('\t');
   33|  63.8k|  return e;
   34|  63.8k|}
_ZN4YAML3Exp7CommentEv:
  124|  75.7M|inline const RegEx Comment() {
  125|  75.7M|  static const RegEx e = RegEx('#');
  126|  75.7M|  return e;
  127|  75.7M|}
_ZN4YAML3Exp5BreakEv:
   39|   216M|inline const RegEx& Break() {
   40|   216M|  static const RegEx e = RegEx('\n') | RegEx("\r\n") | RegEx('\r');
   41|   216M|  return e;
   42|   216M|}
_ZN4YAML3Exp5ValueEv:
  108|  9.15M|inline const RegEx& Value() {
  109|  9.15M|  static const RegEx e = RegEx(':') + (BlankOrBreak() | RegEx());
  110|  9.15M|  return e;
  111|  9.15M|}
_ZN4YAML3Exp15ValueInJSONFlowEv:
  116|  6.85k|inline const RegEx& ValueInJSONFlow() {
  117|  6.85k|  static const RegEx e = RegEx(':');
  118|  6.85k|  return e;
  119|  6.85k|}
_ZN4YAML3Exp11ValueInFlowEv:
  112|   868k|inline const RegEx& ValueInFlow() {
  113|   868k|  static const RegEx e = RegEx(':') + (BlankOrBreak() | RegEx(",]}", REGEX_OR));
  114|   868k|  return e;
  115|   868k|}
_ZN4YAML3Exp5EmptyEv:
   23|  4.23k|inline const RegEx& Empty() {
   24|  4.23k|  static const RegEx e;
   25|  4.23k|  return e;
   26|  4.23k|}
_ZN4YAML3Exp5DigitEv:
   47|    440|inline const RegEx& Digit() {
   48|    440|  static const RegEx e = RegEx('0', '9');
   49|    440|  return e;
   50|    440|}
_ZN4YAML3Exp5AlphaEv:
   51|      1|inline const RegEx& Alpha() {
   52|      1|  static const RegEx e = RegEx('a', 'z') | RegEx('A', 'Z');
   53|      1|  return e;
   54|      1|}
_ZN4YAML3Exp12AlphaNumericEv:
   55|      1|inline const RegEx& AlphaNumeric() {
   56|      1|  static const RegEx e = Alpha() | Digit();
   57|      1|  return e;
   58|      1|}
_ZN4YAML3Exp4WordEv:
   59|  7.74M|inline const RegEx& Word() {
   60|  7.74M|  static const RegEx e = AlphaNumeric() | RegEx('-');
   61|  7.74M|  return e;
   62|  7.74M|}
_ZN4YAML3Exp3HexEv:
   63|      4|inline const RegEx& Hex() {
   64|      4|  static const RegEx e = Digit() | RegEx('A', 'F') | RegEx('a', 'f');
   65|      4|  return e;
   66|      4|}
_ZN4YAML3Exp12DocIndicatorEv:
   92|  4.65M|inline const RegEx& DocIndicator() {
   93|  4.65M|  static const RegEx e = DocStart() | DocEnd();
   94|  4.65M|  return e;
   95|  4.65M|}
_ZN4YAML3Exp6AnchorEv:
  128|  31.9M|inline const RegEx& Anchor() {
  129|  31.9M|  static const RegEx e = !(RegEx("[]{},", REGEX_OR) | BlankOrBreak());
  130|  31.9M|  return e;
  131|  31.9M|}
_ZN4YAML3Exp9AnchorEndEv:
  132|  10.7k|inline const RegEx& AnchorEnd() {
  133|  10.7k|  static const RegEx e = RegEx("?:,]}%@`", REGEX_OR) | BlankOrBreak();
  134|  10.7k|  return e;
  135|  10.7k|}
_ZN4YAML3Exp3URIEv:
  136|  9.29k|inline const RegEx& URI() {
  137|  9.29k|  static const RegEx e = Word() | RegEx("#;/?:@&=+$,_.!~*'()[]", REGEX_OR) |
  138|  9.29k|                         (RegEx('%') + Hex() + Hex());
  139|  9.29k|  return e;
  140|  9.29k|}
_ZN4YAML3Exp3TagEv:
  141|  3.20M|inline const RegEx& Tag() {
  142|  3.20M|  static const RegEx e = Word() | RegEx("#;/?:@&=+$_.~*'()", REGEX_OR) |
  143|  3.20M|                         (RegEx('%') + Hex() + Hex());
  144|  3.20M|  return e;
  145|  3.20M|}
_ZN4YAML3Exp9EndScalarEv:
  165|      1|inline const RegEx& EndScalar() {
  166|      1|  static const RegEx e = RegEx(':') + (BlankOrBreak() | RegEx());
  167|      1|  return e;
  168|      1|}
_ZN4YAML3Exp15EndScalarInFlowEv:
  169|      1|inline const RegEx& EndScalarInFlow() {
  170|      1|  static const RegEx e =
  171|      1|      (RegEx(':') + (BlankOrBreak() | RegEx() | RegEx(",]}", REGEX_OR))) |
  172|      1|      RegEx(",?[]{}", REGEX_OR);
  173|      1|  return e;
  174|      1|}
_ZN4YAML3Exp19ScanScalarEndInFlowEv:
  176|   840k|inline const RegEx& ScanScalarEndInFlow() {
  177|   840k|  static const RegEx e = (EndScalarInFlow() | (BlankOrBreak() + Comment()));
  178|   840k|  return e;
  179|   840k|}
_ZN4YAML3Exp13ScanScalarEndEv:
  181|  1.06M|inline const RegEx& ScanScalarEnd() {
  182|  1.06M|  static const RegEx e = EndScalar() | (BlankOrBreak() + Comment());
  183|  1.06M|  return e;
  184|  1.06M|}
_ZN4YAML3Exp14EscSingleQuoteEv:
  185|  6.75k|inline const RegEx& EscSingleQuote() {
  186|  6.75k|  static const RegEx e = RegEx("\'\'");
  187|  6.75k|  return e;
  188|  6.75k|}
_ZN4YAML3Exp8EscBreakEv:
  189|  9.99M|inline const RegEx& EscBreak() {
  190|  9.99M|  static const RegEx e = RegEx('\\') + Break();
  191|  9.99M|  return e;
  192|  9.99M|}
_ZN4YAML3Exp14ChompIndicatorEv:
  194|      3|inline const RegEx& ChompIndicator() {
  195|      3|  static const RegEx e = RegEx("+-", REGEX_OR);
  196|      3|  return e;
  197|      3|}
_ZN4YAML3Exp5ChompEv:
  198|  4.29k|inline const RegEx& Chomp() {
  199|  4.29k|  static const RegEx e = (ChompIndicator() + Digit()) |
  200|  4.29k|                         (Digit() + ChompIndicator()) | ChompIndicator() |
  201|  4.29k|                         Digit();
  202|  4.29k|  return e;
  203|  4.29k|}

_ZN4YAML6detail6memory11create_nodeEv:
   20|  3.88M|node& memory::create_node() {
   21|  3.88M|  shared_node pNode(std::make_shared<node>());
   22|  3.88M|  m_nodes.insert(pNode);
   23|  3.88M|  return *pNode;
   24|  3.88M|}

_ZN4YAML6detail9node_dataC2Ev:
   24|  3.88M|    : m_isDefined(false),
   25|  3.88M|      m_mark(Mark::null_mark()),
   26|  3.88M|      m_type(NodeType::Null),
   27|  3.88M|      m_tag{},
   28|  3.88M|      m_style(EmitterStyle::Default),
   29|  3.88M|      m_scalar{},
   30|  3.88M|      m_sequence{},
   31|  3.88M|      m_seqSize(0),
   32|  3.88M|      m_map{},
   33|  3.88M|      m_undefinedPairs{} {}
_ZN4YAML6detail9node_data12mark_definedEv:
   35|  3.88M|void node_data::mark_defined() {
   36|  3.88M|  if (m_type == NodeType::Undefined)
  ------------------
  |  Branch (36:7): [True: 0, False: 3.88M]
  ------------------
   37|      0|    m_type = NodeType::Null;
   38|  3.88M|  m_isDefined = true;
   39|  3.88M|}
_ZN4YAML6detail9node_data8set_markERKNS_4MarkE:
   41|  3.88M|void node_data::set_mark(const Mark& mark) { m_mark = mark; }
_ZN4YAML6detail9node_data8set_typeENS_8NodeType5valueE:
   43|   213k|void node_data::set_type(NodeType::value type) {
   44|   213k|  if (type == NodeType::Undefined) {
  ------------------
  |  Branch (44:7): [True: 0, False: 213k]
  ------------------
   45|      0|    m_type = type;
   46|      0|    m_isDefined = false;
   47|      0|    return;
   48|      0|  }
   49|       |
   50|   213k|  m_isDefined = true;
   51|   213k|  if (type == m_type)
  ------------------
  |  Branch (51:7): [True: 0, False: 213k]
  ------------------
   52|      0|    return;
   53|       |
   54|   213k|  m_type = type;
   55|       |
   56|   213k|  switch (m_type) {
  ------------------
  |  Branch (56:11): [True: 213k, False: 0]
  ------------------
   57|      0|    case NodeType::Null:
  ------------------
  |  Branch (57:5): [True: 0, False: 213k]
  ------------------
   58|      0|      break;
   59|      0|    case NodeType::Scalar:
  ------------------
  |  Branch (59:5): [True: 0, False: 213k]
  ------------------
   60|      0|      m_scalar.clear();
   61|      0|      break;
   62|  50.1k|    case NodeType::Sequence:
  ------------------
  |  Branch (62:5): [True: 50.1k, False: 163k]
  ------------------
   63|  50.1k|      reset_sequence();
   64|  50.1k|      break;
   65|   163k|    case NodeType::Map:
  ------------------
  |  Branch (65:5): [True: 163k, False: 50.1k]
  ------------------
   66|   163k|      reset_map();
   67|   163k|      break;
   68|      0|    case NodeType::Undefined:
  ------------------
  |  Branch (68:5): [True: 0, False: 213k]
  ------------------
   69|       |      assert(false);
   70|      0|      break;
   71|   213k|  }
   72|   213k|}
_ZN4YAML6detail9node_data7set_tagERKNSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEE:
   74|   248k|void node_data::set_tag(const std::string& tag) { m_tag = tag; }
_ZN4YAML6detail9node_data9set_styleENS_12EmitterStyle5valueE:
   76|   213k|void node_data::set_style(EmitterStyle::value style) { m_style = style; }
_ZN4YAML6detail9node_data8set_nullEv:
   78|  3.63M|void node_data::set_null() {
   79|  3.63M|  m_isDefined = true;
   80|  3.63M|  m_type = NodeType::Null;
   81|  3.63M|}
_ZN4YAML6detail9node_data10set_scalarERKNSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEE:
   83|  34.2k|void node_data::set_scalar(const std::string& scalar) {
   84|  34.2k|  m_isDefined = true;
   85|  34.2k|  m_type = NodeType::Scalar;
   86|  34.2k|  m_scalar = scalar;
   87|  34.2k|}
_ZN4YAML6detail9node_data9push_backERNS0_4nodeERKNSt3__110shared_ptrINS0_13memory_holderEEE:
  180|  1.07M|                          const shared_memory_holder& /* pMemory */) {
  181|  1.07M|  if (m_type == NodeType::Undefined || m_type == NodeType::Null) {
  ------------------
  |  Branch (181:7): [True: 0, False: 1.07M]
  |  Branch (181:40): [True: 0, False: 1.07M]
  ------------------
  182|      0|    m_type = NodeType::Sequence;
  183|      0|    reset_sequence();
  184|      0|  }
  185|       |
  186|  1.07M|  if (m_type != NodeType::Sequence)
  ------------------
  |  Branch (186:7): [True: 0, False: 1.07M]
  ------------------
  187|      0|    throw BadPushback();
  188|       |
  189|  1.07M|  m_sequence.push_back(&node);
  190|  1.07M|}
_ZN4YAML6detail9node_data6insertERNS0_4nodeES3_RKNSt3__110shared_ptrINS0_13memory_holderEEE:
  193|  1.15M|                       const shared_memory_holder& pMemory) {
  194|  1.15M|  switch (m_type) {
  ------------------
  |  Branch (194:11): [True: 1.15M, False: 0]
  ------------------
  195|  1.15M|    case NodeType::Map:
  ------------------
  |  Branch (195:5): [True: 1.15M, False: 0]
  ------------------
  196|  1.15M|      break;
  197|      0|    case NodeType::Undefined:
  ------------------
  |  Branch (197:5): [True: 0, False: 1.15M]
  ------------------
  198|      0|    case NodeType::Null:
  ------------------
  |  Branch (198:5): [True: 0, False: 1.15M]
  ------------------
  199|      0|    case NodeType::Sequence:
  ------------------
  |  Branch (199:5): [True: 0, False: 1.15M]
  ------------------
  200|      0|      convert_to_map(pMemory);
  201|      0|      break;
  202|      0|    case NodeType::Scalar:
  ------------------
  |  Branch (202:5): [True: 0, False: 1.15M]
  ------------------
  203|      0|      throw BadSubscript(m_mark, key);
  204|  1.15M|  }
  205|       |
  206|  1.15M|  insert_map_pair(key, value);
  207|  1.15M|}
_ZN4YAML6detail9node_data14reset_sequenceEv:
  272|  50.1k|void node_data::reset_sequence() {
  273|  50.1k|  m_sequence.clear();
  274|  50.1k|  m_seqSize = 0;
  275|  50.1k|}
_ZN4YAML6detail9node_data9reset_mapEv:
  277|   163k|void node_data::reset_map() {
  278|   163k|  m_map.clear();
  279|   163k|  m_undefinedPairs.clear();
  280|   163k|}
_ZN4YAML6detail9node_data15insert_map_pairERNS0_4nodeES3_b:
  282|  1.15M|void node_data::insert_map_pair(node& key, node& value, bool force) {
  283|  1.15M|  if (!force && !key.scalar().empty())
  ------------------
  |  Branch (283:7): [True: 1.15M, False: 0]
  |  Branch (283:17): [True: 16.3k, False: 1.13M]
  ------------------
  284|  16.3k|    for (const auto& mapEntry : m_map)
  ------------------
  |  Branch (284:31): [True: 4.45M, False: 16.3k]
  ------------------
  285|  4.45M|      if (mapEntry.first->scalar() == key.scalar())
  ------------------
  |  Branch (285:11): [True: 42, False: 4.45M]
  ------------------
  286|     42|        throw NonUniqueMapKey(m_mark, key);
  287|       |
  288|  1.15M|  m_map.emplace_back(&key, &value);
  289|       |
  290|  1.15M|  if (!key.is_defined() || !value.is_defined())
  ------------------
  |  Branch (290:7): [True: 0, False: 1.15M]
  |  Branch (290:28): [True: 0, False: 1.15M]
  ------------------
  291|      0|    m_undefinedPairs.emplace_back(&key, &value);
  292|  1.15M|}

_ZN4YAML11NodeBuilderC2Ev:
   13|   359k|    : m_pMemory(std::make_shared<detail::memory_holder>()),
   14|   359k|      m_pRoot(nullptr),
   15|   359k|      m_stack{},
   16|   359k|      m_anchors{},
   17|   359k|      m_keys{},
   18|   359k|      m_mapDepth(0) {
   19|   359k|  m_anchors.push_back(nullptr);  // since the anchors start at 1
   20|   359k|}
_ZN4YAML11NodeBuilderD2Ev:
   22|   359k|NodeBuilder::~NodeBuilder() = default;
_ZN4YAML11NodeBuilder4RootEv:
   24|   352k|Node NodeBuilder::Root() {
   25|   352k|  if (!m_pRoot)
  ------------------
  |  Branch (25:7): [True: 0, False: 352k]
  ------------------
   26|      0|    return Node();
   27|       |
   28|   352k|  return Node(*m_pRoot, m_pMemory);
   29|   352k|}
_ZN4YAML11NodeBuilder15OnDocumentStartERKNS_4MarkE:
   31|   355k|void NodeBuilder::OnDocumentStart(const Mark&) {}
_ZN4YAML11NodeBuilder13OnDocumentEndEv:
   33|   352k|void NodeBuilder::OnDocumentEnd() {}
_ZN4YAML11NodeBuilder6OnNullERKNS_4MarkEm:
   35|  3.63M|void NodeBuilder::OnNull(const Mark& mark, anchor_t anchor) {
   36|  3.63M|  detail::node& node = Push(mark, anchor);
   37|  3.63M|  node.set_null();
   38|  3.63M|  Pop();
   39|  3.63M|}
_ZN4YAML11NodeBuilder7OnAliasERKNS_4MarkEm:
   41|  1.10k|void NodeBuilder::OnAlias(const Mark& /* mark */, anchor_t anchor) {
   42|  1.10k|  detail::node& node = *m_anchors[anchor];
   43|  1.10k|  Push(node);
   44|  1.10k|  Pop();
   45|  1.10k|}
_ZN4YAML11NodeBuilder8OnScalarERKNS_4MarkERKNSt3__112basic_stringIcNS4_11char_traitsIcEENS4_9allocatorIcEEEEmSC_:
   48|  34.2k|                           anchor_t anchor, const std::string& value) {
   49|  34.2k|  detail::node& node = Push(mark, anchor);
   50|  34.2k|  node.set_scalar(value);
   51|  34.2k|  node.set_tag(tag);
   52|  34.2k|  Pop();
   53|  34.2k|}
_ZN4YAML11NodeBuilder15OnSequenceStartERKNS_4MarkERKNSt3__112basic_stringIcNS4_11char_traitsIcEENS4_9allocatorIcEEEEmNS_12EmitterStyle5valueE:
   56|  50.1k|                                  anchor_t anchor, EmitterStyle::value style) {
   57|  50.1k|  detail::node& node = Push(mark, anchor);
   58|  50.1k|  node.set_tag(tag);
   59|  50.1k|  node.set_type(NodeType::Sequence);
   60|  50.1k|  node.set_style(style);
   61|  50.1k|}
_ZN4YAML11NodeBuilder13OnSequenceEndEv:
   63|  5.76k|void NodeBuilder::OnSequenceEnd() { Pop(); }
_ZN4YAML11NodeBuilder10OnMapStartERKNS_4MarkERKNSt3__112basic_stringIcNS4_11char_traitsIcEENS4_9allocatorIcEEEEmNS_12EmitterStyle5valueE:
   66|   163k|                             anchor_t anchor, EmitterStyle::value style) {
   67|   163k|  detail::node& node = Push(mark, anchor);
   68|   163k|  node.set_type(NodeType::Map);
   69|   163k|  node.set_tag(tag);
   70|   163k|  node.set_style(style);
   71|   163k|  m_mapDepth++;
   72|   163k|}
_ZN4YAML11NodeBuilder8OnMapEndEv:
   74|  56.7k|void NodeBuilder::OnMapEnd() {
   75|       |  assert(m_mapDepth > 0);
   76|  56.7k|  m_mapDepth--;
   77|  56.7k|  Pop();
   78|  56.7k|}
_ZN4YAML11NodeBuilder4PushERKNS_4MarkEm:
   80|  3.88M|detail::node& NodeBuilder::Push(const Mark& mark, anchor_t anchor) {
   81|  3.88M|  detail::node& node = m_pMemory->create_node();
   82|  3.88M|  node.set_mark(mark);
   83|  3.88M|  RegisterAnchor(anchor, node);
   84|  3.88M|  Push(node);
   85|  3.88M|  return node;
   86|  3.88M|}
_ZN4YAML11NodeBuilder4PushERNS_6detail4nodeE:
   88|  3.88M|void NodeBuilder::Push(detail::node& node) {
   89|  3.88M|  const bool needsKey =
   90|  3.88M|      (!m_stack.empty() && m_stack.back()->type() == NodeType::Map &&
  ------------------
  |  Branch (90:8): [True: 3.52M, False: 355k]
  |  Branch (90:28): [True: 2.40M, False: 1.12M]
  ------------------
   91|  2.40M|       m_keys.size() < m_mapDepth);
  ------------------
  |  Branch (91:8): [True: 1.25M, False: 1.15M]
  ------------------
   92|       |
   93|  3.88M|  m_stack.push_back(&node);
   94|  3.88M|  if (needsKey)
  ------------------
  |  Branch (94:7): [True: 1.25M, False: 2.62M]
  ------------------
   95|  1.25M|    m_keys.emplace_back(&node, false);
   96|  3.88M|}
_ZN4YAML11NodeBuilder3PopEv:
   98|  3.73M|void NodeBuilder::Pop() {
   99|  3.73M|  assert(!m_stack.empty());
  100|  3.73M|  if (m_stack.size() == 1) {
  ------------------
  |  Branch (100:7): [True: 352k, False: 3.37M]
  ------------------
  101|   352k|    m_pRoot = m_stack[0];
  102|   352k|    m_stack.pop_back();
  103|   352k|    return;
  104|   352k|  }
  105|       |
  106|  3.37M|  detail::node& node = *m_stack.back();
  107|  3.37M|  m_stack.pop_back();
  108|       |
  109|  3.37M|  detail::node& collection = *m_stack.back();
  110|       |
  111|  3.37M|  if (collection.type() == NodeType::Sequence) {
  ------------------
  |  Branch (111:7): [True: 1.07M, False: 2.30M]
  ------------------
  112|  1.07M|    collection.push_back(node, m_pMemory);
  113|  2.30M|  } else if (collection.type() == NodeType::Map) {
  ------------------
  |  Branch (113:14): [True: 2.30M, False: 0]
  ------------------
  114|  2.30M|    assert(!m_keys.empty());
  115|  2.30M|    PushedKey& key = m_keys.back();
  116|  2.30M|    if (key.second) {
  ------------------
  |  Branch (116:9): [True: 1.15M, False: 1.15M]
  ------------------
  117|  1.15M|      collection.insert(*key.first, node, m_pMemory);
  118|  1.15M|      m_keys.pop_back();
  119|  1.15M|    } else {
  120|  1.15M|      key.second = true;
  121|  1.15M|    }
  122|  2.30M|  } else {
  123|       |    assert(false);
  124|      0|    m_stack.clear();
  125|      0|  }
  126|  3.37M|}
_ZN4YAML11NodeBuilder14RegisterAnchorEmRNS_6detail4nodeE:
  128|  3.88M|void NodeBuilder::RegisterAnchor(anchor_t anchor, detail::node& node) {
  129|  3.88M|  if (anchor) {
  ------------------
  |  Branch (129:7): [True: 8.13k, False: 3.87M]
  ------------------
  130|       |    assert(anchor == m_anchors.size());
  131|  8.13k|    m_anchors.push_back(&node);
  132|  8.13k|  }
  133|  3.88M|}

_ZN4YAML12IsNullStringEPKcm:
   13|  57.4k|bool IsNullString(const char* str, std::size_t size) {
   14|  57.4k|  return size == 0 || same(str, size, "~") || same(str, size, "null") ||
  ------------------
  |  Branch (14:10): [True: 0, False: 57.4k]
  |  Branch (14:23): [True: 28.5k, False: 28.9k]
  |  Branch (14:47): [True: 275, False: 28.6k]
  ------------------
   15|  28.6k|         same(str, size, "Null") || same(str, size, "NULL");
  ------------------
  |  Branch (15:10): [True: 199, False: 28.4k]
  |  Branch (15:37): [True: 45, False: 28.3k]
  ------------------
   16|  57.4k|}
null.cpp:_ZN4YAMLL4sameILm2EEEbPKcmRAT__S1_:
    8|  57.4k|static bool same(const char* str, std::size_t size, const char (&literal)[N]) {
    9|  57.4k|  constexpr int literalSize = N - 1; // minus null terminator
   10|  57.4k|  return size == literalSize && std::strncmp(str, literal, literalSize) == 0;
  ------------------
  |  Branch (10:10): [True: 45.6k, False: 11.7k]
  |  Branch (10:33): [True: 28.5k, False: 17.1k]
  ------------------
   11|  57.4k|}
null.cpp:_ZN4YAMLL4sameILm5EEEbPKcmRAT__S1_:
    8|  85.9k|static bool same(const char* str, std::size_t size, const char (&literal)[N]) {
    9|  85.9k|  constexpr int literalSize = N - 1; // minus null terminator
   10|  85.9k|  return size == literalSize && std::strncmp(str, literal, literalSize) == 0;
  ------------------
  |  Branch (10:10): [True: 6.26k, False: 79.7k]
  |  Branch (10:33): [True: 519, False: 5.74k]
  ------------------
   11|  85.9k|}

_ZN4YAML7LoadAllERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEE:
   40|  7.17k|std::vector<Node> LoadAll(const std::string& input) {
   41|  7.17k|  std::stringstream stream(input);
   42|  7.17k|  return LoadAll(stream);
   43|  7.17k|}
_ZN4YAML7LoadAllERNSt3__113basic_istreamIcNS0_11char_traitsIcEEEE:
   50|  7.17k|std::vector<Node> LoadAll(std::istream& input) {
   51|  7.17k|  std::vector<Node> docs;
   52|       |
   53|  7.17k|  Parser parser(input);
   54|   363k|  while (true) {
  ------------------
  |  Branch (54:10): [True: 359k, Folded]
  ------------------
   55|   359k|    NodeBuilder builder;
   56|   359k|    if (!parser.HandleNextDocument(builder)) {
  ------------------
  |  Branch (56:9): [True: 3.18k, False: 356k]
  ------------------
   57|  3.18k|      break;
   58|  3.18k|    }
   59|   356k|    docs.push_back(builder.Root());
   60|   356k|  }
   61|       |
   62|  7.17k|  return docs;
   63|  7.17k|}

_ZN4YAML6ParserC2Ev:
   14|  7.17k|Parser::Parser() : m_pScanner{}, m_pDirectives{} {}
_ZN4YAML6ParserC2ERNSt3__113basic_istreamIcNS1_11char_traitsIcEEEE:
   16|  7.17k|Parser::Parser(std::istream& in) : Parser() { Load(in); }
_ZN4YAML6ParserD2Ev:
   18|  7.17k|Parser::~Parser() = default;
_ZN4YAML6Parser4LoadERNSt3__113basic_istreamIcNS1_11char_traitsIcEEEE:
   22|  7.17k|void Parser::Load(std::istream& in) {
   23|  7.17k|  m_pScanner.reset(new Scanner(in));
   24|  7.17k|  m_pDirectives.reset(new Directives);
   25|  7.17k|}
_ZN4YAML6Parser18HandleNextDocumentERNS_12EventHandlerE:
   27|   359k|bool Parser::HandleNextDocument(EventHandler& eventHandler) {
   28|   359k|  if (!m_pScanner)
  ------------------
  |  Branch (28:7): [True: 0, False: 359k]
  ------------------
   29|      0|    return false;
   30|       |
   31|   359k|  ParseDirectives();
   32|   359k|  if (m_pScanner->empty()) {
  ------------------
  |  Branch (32:7): [True: 3.18k, False: 356k]
  ------------------
   33|  3.18k|    return false;
   34|  3.18k|  }
   35|       |
   36|   356k|  auto oldPos = m_pScanner->peek().mark.pos;
   37|       |
   38|   356k|  SingleDocParser sdp(*m_pScanner, *m_pDirectives);
   39|   356k|  sdp.HandleDocument(eventHandler);
   40|       |
   41|       |  // checks if progress was made
   42|       |  // 1. if scanner has no more tokens, progress was made
   43|   356k|  if (m_pScanner->empty()) {
  ------------------
  |  Branch (43:7): [True: 2.36k, False: 353k]
  ------------------
   44|  2.36k|    return true;
   45|  2.36k|  }
   46|       |
   47|       |  // 2. if token position has changed, progress was made
   48|   353k|  auto newPos = m_pScanner->peek().mark.pos;
   49|   353k|  if (newPos != oldPos) {
  ------------------
  |  Branch (49:7): [True: 349k, False: 3.99k]
  ------------------
   50|   349k|    return true;
   51|   349k|  }
   52|       |  // No progress was made, no further processing
   53|  3.99k|  return false;
   54|   353k|}
_ZN4YAML6Parser15ParseDirectivesEv:
   56|   359k|void Parser::ParseDirectives() {
   57|   359k|  bool readDirective = false;
   58|       |
   59|   371k|  while (!m_pScanner->empty()) {
  ------------------
  |  Branch (59:10): [True: 367k, False: 4.09k]
  ------------------
   60|   367k|    Token& token = m_pScanner->peek();
   61|   367k|    if (token.type != Token::DIRECTIVE) {
  ------------------
  |  Branch (61:9): [True: 355k, False: 11.9k]
  ------------------
   62|   355k|      break;
   63|   355k|    }
   64|       |
   65|       |    // we keep the directives from the last document if none are specified;
   66|       |    // but if any directives are specific, then we reset them
   67|  11.9k|    if (!readDirective) {
  ------------------
  |  Branch (67:9): [True: 4.65k, False: 7.25k]
  ------------------
   68|  4.65k|      m_pDirectives.reset(new Directives);
   69|  4.65k|    }
   70|       |
   71|  11.9k|    readDirective = true;
   72|  11.9k|    HandleDirective(token);
   73|  11.9k|    m_pScanner->pop();
   74|  11.9k|  }
   75|   359k|}
_ZN4YAML6Parser15HandleDirectiveERKNS_5TokenE:
   77|  11.9k|void Parser::HandleDirective(const Token& token) {
   78|  11.9k|  if (token.value == "YAML") {
  ------------------
  |  Branch (78:7): [True: 1.33k, False: 10.5k]
  ------------------
   79|  1.33k|    HandleYamlDirective(token);
   80|  10.5k|  } else if (token.value == "TAG") {
  ------------------
  |  Branch (80:14): [True: 6.19k, False: 4.38k]
  ------------------
   81|  6.19k|    HandleTagDirective(token);
   82|  6.19k|  }
   83|  11.9k|}
_ZN4YAML6Parser19HandleYamlDirectiveERKNS_5TokenE:
   85|  1.33k|void Parser::HandleYamlDirective(const Token& token) {
   86|  1.33k|  if (token.params.size() != 1) {
  ------------------
  |  Branch (86:7): [True: 28, False: 1.30k]
  ------------------
   87|     28|    throw ParserException(token.mark, ErrorMsg::YAML_DIRECTIVE_ARGS);
   88|     28|  }
   89|       |
   90|  1.30k|  if (!m_pDirectives->version.isDefault) {
  ------------------
  |  Branch (90:7): [True: 1, False: 1.30k]
  ------------------
   91|      1|    throw ParserException(token.mark, ErrorMsg::REPEATED_YAML_DIRECTIVE);
   92|      1|  }
   93|       |
   94|  1.30k|  std::stringstream str(token.params[0]);
   95|  1.30k|  str.imbue(std::locale::classic());
   96|  1.30k|  str >> m_pDirectives->version.major;
   97|  1.30k|  str.get();
   98|  1.30k|  str >> m_pDirectives->version.minor;
   99|  1.30k|  if (!str || str.peek() != EOF) {
  ------------------
  |  Branch (99:7): [True: 17, False: 1.28k]
  |  Branch (99:15): [True: 11, False: 1.27k]
  ------------------
  100|     28|    throw ParserException(
  101|     28|        token.mark, std::string(ErrorMsg::YAML_VERSION) + token.params[0]);
  102|     28|  }
  103|       |
  104|  1.27k|  if (m_pDirectives->version.major > 1) {
  ------------------
  |  Branch (104:7): [True: 13, False: 1.26k]
  ------------------
  105|     13|    throw ParserException(token.mark, ErrorMsg::YAML_MAJOR_VERSION);
  106|     13|  }
  107|       |
  108|  1.26k|  m_pDirectives->version.isDefault = false;
  109|       |  // TODO: warning on major == 1, minor > 2?
  110|  1.26k|}
_ZN4YAML6Parser18HandleTagDirectiveERKNS_5TokenE:
  112|  6.19k|void Parser::HandleTagDirective(const Token& token) {
  113|  6.19k|  if (token.params.size() != 2)
  ------------------
  |  Branch (113:7): [True: 24, False: 6.17k]
  ------------------
  114|     24|    throw ParserException(token.mark, ErrorMsg::TAG_DIRECTIVE_ARGS);
  115|       |
  116|  6.17k|  const std::string& handle = token.params[0];
  117|  6.17k|  const std::string& prefix = token.params[1];
  118|  6.17k|  if (m_pDirectives->tags.find(handle) != m_pDirectives->tags.end()) {
  ------------------
  |  Branch (118:7): [True: 11, False: 6.16k]
  ------------------
  119|     11|    throw ParserException(token.mark, ErrorMsg::REPEATED_TAG_DIRECTIVE);
  120|     11|  }
  121|       |
  122|  6.16k|  m_pDirectives->tags[handle] = prefix;
  123|  6.16k|}

_ZN4YAML10ptr_vectorINS_7Scanner12IndentMarkerEEC2Ev:
   21|  7.17k|  ptr_vector() : m_data{} {}
_ZN4YAML10ptr_vectorINS_7Scanner12IndentMarkerEE9push_backEONSt3__110unique_ptrIS2_NS4_14default_deleteIS2_EEEE:
   32|  10.1M|  void push_back(std::unique_ptr<T>&& t) { m_data.push_back(std::move(t)); }
_ZN4YAML10ptr_vectorINS_7Scanner12IndentMarkerEE4backEv:
   36|  10.1M|  T& back() { return *(m_data.back().get()); }

_ZN4YAML5RegExC2ENS_8REGEX_OPE:
    6|  13.5k|RegEx::RegEx(REGEX_OP op) : m_op(op), m_a(0), m_z(0), m_params{} {}
_ZN4YAML5RegExC2Ev:
    7|      9|RegEx::RegEx() : RegEx(REGEX_EMPTY) {}
_ZN4YAML5RegExC2Ec:
    9|  11.8k|RegEx::RegEx(char ch) : m_op(REGEX_MATCH), m_a(ch), m_z(0), m_params{} {}
_ZN4YAML5RegExC2Ecc:
   11|      5|RegEx::RegEx(char a, char z) : m_op(REGEX_RANGE), m_a(a), m_z(z), m_params{} {}
_ZN4YAML5RegExC2ERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEENS_8REGEX_OPE:
   14|     16|    : m_op(op), m_a(0), m_z(0), m_params(str.begin(), str.end()) {}
_ZN4YAMLntERKNS_5RegExE:
   17|  6.75k|RegEx operator!(const RegEx& ex) {
   18|  6.75k|  RegEx ret(REGEX_NOT);
   19|  6.75k|  ret.m_params.push_back(ex);
   20|  6.75k|  return ret;
   21|  6.75k|}
_ZN4YAMLorERKNS_5RegExES2_:
   23|     36|RegEx operator|(const RegEx& ex1, const RegEx& ex2) {
   24|     36|  RegEx ret(REGEX_OR);
   25|     36|  ret.m_params.push_back(ex1);
   26|     36|  ret.m_params.push_back(ex2);
   27|     36|  return ret;
   28|     36|}
_ZN4YAMLanERKNS_5RegExES2_:
   30|  6.75k|RegEx operator&(const RegEx& ex1, const RegEx& ex2) {
   31|  6.75k|  RegEx ret(REGEX_AND);
   32|  6.75k|  ret.m_params.push_back(ex1);
   33|  6.75k|  ret.m_params.push_back(ex2);
   34|  6.75k|  return ret;
   35|  6.75k|}
_ZN4YAMLplERKNS_5RegExES2_:
   37|     20|RegEx operator+(const RegEx& ex1, const RegEx& ex2) {
   38|     20|  RegEx ret(REGEX_SEQ);
   39|     20|  ret.m_params.push_back(ex1);
   40|     20|  ret.m_params.push_back(ex2);
   41|     20|  return ret;
   42|     20|}

_ZN4YAML5RegExD2Ev:
   37|  75.8M|  ~RegEx() = default;

_ZNK4YAML5RegEx7MatchesERKNS_6StreamE:
   26|   520M|inline bool RegEx::Matches(const Stream& in) const { return Match(in) >= 0; }
_ZNK4YAML5RegEx5MatchERKNS_6StreamE:
   49|   565M|inline int RegEx::Match(const Stream& in) const {
   50|   565M|  StreamCharSource source(in);
   51|   565M|  return Match(source);
   52|   565M|}
_ZNK4YAML5RegEx5MatchINS_16StreamCharSourceEEEiRKT_:
   72|  1.17G|inline int RegEx::Match(const Source& source) const {
   73|  1.17G|  return IsValidSource(source) ? MatchUnchecked(source) : -1;
  ------------------
  |  Branch (73:10): [True: 1.17G, False: 0]
  ------------------
   74|  1.17G|}
_ZNK4YAML5RegEx13IsValidSourceINS_16StreamCharSourceEEEbRKT_:
   55|  1.17G|inline bool RegEx::IsValidSource(const Source& source) const {
   56|  1.17G|  return source;
   57|  1.17G|}
_ZNK4YAML5RegEx14MatchUncheckedINS_16StreamCharSourceEEEiRKT_:
   77|  3.84G|inline int RegEx::MatchUnchecked(const Source& source) const {
   78|  3.84G|  switch (m_op) {
  ------------------
  |  Branch (78:11): [True: 3.84G, False: 0]
  ------------------
   79|  15.6M|    case REGEX_EMPTY:
  ------------------
  |  Branch (79:5): [True: 15.6M, False: 3.82G]
  ------------------
   80|  15.6M|      return MatchOpEmpty(source);
   81|  1.94G|    case REGEX_MATCH:
  ------------------
  |  Branch (81:5): [True: 1.94G, False: 1.89G]
  ------------------
   82|  1.94G|      return MatchOpMatch(source);
   83|  23.7M|    case REGEX_RANGE:
  ------------------
  |  Branch (83:5): [True: 23.7M, False: 3.81G]
  ------------------
   84|  23.7M|      return MatchOpRange(source);
   85|  1.26G|    case REGEX_OR:
  ------------------
  |  Branch (85:5): [True: 1.26G, False: 2.58G]
  ------------------
   86|  1.26G|      return MatchOpOr(source);
   87|  18.5M|    case REGEX_AND:
  ------------------
  |  Branch (87:5): [True: 18.5M, False: 3.82G]
  ------------------
   88|  18.5M|      return MatchOpAnd(source);
   89|  33.9M|    case REGEX_NOT:
  ------------------
  |  Branch (89:5): [True: 33.9M, False: 3.80G]
  ------------------
   90|  33.9M|      return MatchOpNot(source);
   91|   545M|    case REGEX_SEQ:
  ------------------
  |  Branch (91:5): [True: 545M, False: 3.29G]
  ------------------
   92|   545M|      return MatchOpSeq(source);
   93|  3.84G|  }
   94|       |
   95|      0|  return -1;
   96|  3.84G|}
_ZNK4YAML5RegEx12MatchOpEmptyINS_16StreamCharSourceEEEiRKT_:
  106|  15.6M|inline int RegEx::MatchOpEmpty(const Source& source) const {
  107|  15.6M|  return source[0] == Stream::eof() ? 0 : -1;
  ------------------
  |  Branch (107:10): [True: 1.08M, False: 14.5M]
  ------------------
  108|  15.6M|}
_ZNK4YAML5RegEx12MatchOpMatchINS_16StreamCharSourceEEEiRKT_:
  119|  1.94G|inline int RegEx::MatchOpMatch(const Source& source) const {
  120|  1.94G|  if (source[0] != m_a)
  ------------------
  |  Branch (120:7): [True: 1.80G, False: 134M]
  ------------------
  121|  1.80G|    return -1;
  122|   134M|  return 1;
  123|  1.94G|}
_ZNK4YAML5RegEx12MatchOpRangeINS_16StreamCharSourceEEEiRKT_:
  127|  23.7M|inline int RegEx::MatchOpRange(const Source& source) const {
  128|  23.7M|  if (m_a > source[0] || m_z < source[0])
  ------------------
  |  Branch (128:7): [True: 18.9M, False: 4.74M]
  |  Branch (128:26): [True: 54.5k, False: 4.68M]
  ------------------
  129|  19.0M|    return -1;
  130|  4.68M|  return 1;
  131|  23.7M|}
_ZNK4YAML5RegEx9MatchOpOrINS_16StreamCharSourceEEEiRKT_:
  135|  1.26G|inline int RegEx::MatchOpOr(const Source& source) const {
  136|  2.61G|  for (const RegEx& param : m_params) {
  ------------------
  |  Branch (136:27): [True: 2.61G, False: 1.09G]
  ------------------
  137|  2.61G|    int n = param.MatchUnchecked(source);
  138|  2.61G|    if (n >= 0)
  ------------------
  |  Branch (138:9): [True: 163M, False: 2.44G]
  ------------------
  139|   163M|      return n;
  140|  2.61G|  }
  141|  1.09G|  return -1;
  142|  1.26G|}
_ZNK4YAML5RegEx10MatchOpAndINS_16StreamCharSourceEEEiRKT_:
  149|  18.5M|inline int RegEx::MatchOpAnd(const Source& source) const {
  150|  18.5M|  int first = -1;
  151|  18.5M|  for (std::size_t i = 0; i < m_params.size(); i++) {
  ------------------
  |  Branch (151:27): [True: 18.5M, False: 13.1k]
  ------------------
  152|  18.5M|    int n = m_params[i].MatchUnchecked(source);
  153|  18.5M|    if (n == -1)
  ------------------
  |  Branch (153:9): [True: 18.5M, False: 27.7k]
  ------------------
  154|  18.5M|      return -1;
  155|  27.7k|    if (i == 0)
  ------------------
  |  Branch (155:9): [True: 14.5k, False: 13.1k]
  ------------------
  156|  14.5k|      first = n;
  157|  27.7k|  }
  158|  13.1k|  return first;
  159|  18.5M|}
_ZNK4YAML5RegEx10MatchOpNotINS_16StreamCharSourceEEEiRKT_:
  163|  33.9M|inline int RegEx::MatchOpNot(const Source& source) const {
  164|  33.9M|  if (m_params.empty())
  ------------------
  |  Branch (164:7): [True: 0, False: 33.9M]
  ------------------
  165|      0|    return -1;
  166|  33.9M|  if (m_params[0].MatchUnchecked(source) >= 0)
  ------------------
  |  Branch (166:7): [True: 12.1k, False: 33.8M]
  ------------------
  167|  12.1k|    return -1;
  168|  33.8M|  return 1;
  169|  33.9M|}
_ZNK4YAML5RegEx10MatchOpSeqINS_16StreamCharSourceEEEiRKT_:
  173|   545M|inline int RegEx::MatchOpSeq(const Source& source) const {
  174|   545M|  int offset = 0;
  175|   611M|  for (const RegEx& param : m_params) {
  ------------------
  |  Branch (175:27): [True: 611M, False: 9.09M]
  ------------------
  176|   611M|    int n = param.Match(source + offset);  // note Match, not
  177|       |                                           // MatchUnchecked because we
  178|       |                                           // need to check validity after
  179|       |                                           // the offset
  180|   611M|    if (n == -1)
  ------------------
  |  Branch (180:9): [True: 536M, False: 75.5M]
  ------------------
  181|   536M|      return -1;
  182|  75.5M|    offset += n;
  183|  75.5M|  }
  184|       |
  185|  9.09M|  return offset;
  186|   545M|}
_ZNK4YAML5RegEx7MatchesEc:
   16|    435|inline bool RegEx::Matches(char ch) const {
   17|    435|  std::string str;
   18|    435|  str += ch;
   19|    435|  return Matches(str);
   20|    435|}
_ZNK4YAML5RegEx7MatchesERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
   22|    435|inline bool RegEx::Matches(const std::string& str) const {
   23|    435|  return Match(str) >= 0;
   24|    435|}
_ZNK4YAML5RegEx5MatchERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
   44|    435|inline int RegEx::Match(const std::string& str) const {
   45|    435|  StringCharSource source(str.c_str(), str.size());
   46|    435|  return Match(source);
   47|    435|}
_ZNK4YAML5RegEx13IsValidSourceINS_16StringCharSourceEEEbRKT_:
   61|    435|    const StringCharSource& source) const {
   62|    435|  switch (m_op) {
   63|      0|    case REGEX_MATCH:
  ------------------
  |  Branch (63:5): [True: 0, False: 435]
  ------------------
   64|    435|    case REGEX_RANGE:
  ------------------
  |  Branch (64:5): [True: 435, False: 0]
  ------------------
   65|    435|      return source;
   66|      0|    default:
  ------------------
  |  Branch (66:5): [True: 0, False: 435]
  ------------------
   67|      0|      return true;
   68|    435|  }
   69|    435|}
_ZNK4YAML5RegEx5MatchINS_16StringCharSourceEEEiRKT_:
   72|    435|inline int RegEx::Match(const Source& source) const {
   73|    435|  return IsValidSource(source) ? MatchUnchecked(source) : -1;
  ------------------
  |  Branch (73:10): [True: 435, False: 0]
  ------------------
   74|    435|}
_ZNK4YAML5RegEx14MatchUncheckedINS_16StringCharSourceEEEiRKT_:
   77|    435|inline int RegEx::MatchUnchecked(const Source& source) const {
   78|    435|  switch (m_op) {
  ------------------
  |  Branch (78:11): [True: 435, False: 0]
  ------------------
   79|      0|    case REGEX_EMPTY:
  ------------------
  |  Branch (79:5): [True: 0, False: 435]
  ------------------
   80|      0|      return MatchOpEmpty(source);
   81|      0|    case REGEX_MATCH:
  ------------------
  |  Branch (81:5): [True: 0, False: 435]
  ------------------
   82|      0|      return MatchOpMatch(source);
   83|    435|    case REGEX_RANGE:
  ------------------
  |  Branch (83:5): [True: 435, False: 0]
  ------------------
   84|    435|      return MatchOpRange(source);
   85|      0|    case REGEX_OR:
  ------------------
  |  Branch (85:5): [True: 0, False: 435]
  ------------------
   86|      0|      return MatchOpOr(source);
   87|      0|    case REGEX_AND:
  ------------------
  |  Branch (87:5): [True: 0, False: 435]
  ------------------
   88|      0|      return MatchOpAnd(source);
   89|      0|    case REGEX_NOT:
  ------------------
  |  Branch (89:5): [True: 0, False: 435]
  ------------------
   90|      0|      return MatchOpNot(source);
   91|      0|    case REGEX_SEQ:
  ------------------
  |  Branch (91:5): [True: 0, False: 435]
  ------------------
   92|      0|      return MatchOpSeq(source);
   93|    435|  }
   94|       |
   95|      0|  return -1;
   96|    435|}
_ZNK4YAML5RegEx12MatchOpRangeINS_16StringCharSourceEEEiRKT_:
  127|    435|inline int RegEx::MatchOpRange(const Source& source) const {
  128|    435|  if (m_a > source[0] || m_z < source[0])
  ------------------
  |  Branch (128:7): [True: 0, False: 435]
  |  Branch (128:26): [True: 0, False: 435]
  ------------------
  129|      0|    return -1;
  130|    435|  return 1;
  131|    435|}

_ZN4YAML7ScannerC2ERNSt3__113basic_istreamIcNS1_11char_traitsIcEEEE:
   24|  7.17k|    : INPUT(in),
   25|  7.17k|      m_tokens{},
   26|  7.17k|      m_startedStream(false),
   27|  7.17k|      m_endedStream(false),
   28|  7.17k|      m_simpleKeyAllowed(false),
   29|  7.17k|      m_scalarValueAllowed(false),
   30|  7.17k|      m_canBeJSONFlow(false),
   31|  7.17k|      m_simpleKeys{},
   32|  7.17k|      m_indents{},
   33|  7.17k|      m_indentRefs{},
   34|  7.17k|      m_flows{} {}
_ZN4YAML7ScannerD2Ev:
   36|  7.17k|Scanner::~Scanner() = default;
_ZN4YAML7Scanner5emptyEv:
   38|  12.5M|bool Scanner::empty() {
   39|  12.5M|  EnsureTokensInQueue();
   40|  12.5M|  return m_tokens.empty();
   41|  12.5M|}
_ZN4YAML7Scanner3popEv:
   43|  3.03M|void Scanner::pop() {
   44|  3.03M|  EnsureTokensInQueue();
   45|  3.03M|  if (!m_tokens.empty())
  ------------------
  |  Branch (45:7): [True: 3.03M, False: 0]
  ------------------
   46|  3.03M|    m_tokens.pop();
   47|  3.03M|}
_ZN4YAML7Scanner4peekEv:
   49|  16.9M|Token& Scanner::peek() {
   50|  16.9M|  EnsureTokensInQueue();
   51|  16.9M|  assert(!m_tokens.empty());  // should we be asserting here? I mean, we really
   52|       |                              // just be checking
   53|       |                              // if it's empty before peeking.
   54|       |
   55|       |#if 0
   56|       |		static Token *pLast = 0;
   57|       |		if(pLast != &m_tokens.front())
   58|       |			std::cerr << "peek: " << m_tokens.front() << "\n";
   59|       |		pLast = &m_tokens.front();
   60|       |#endif
   61|       |
   62|  16.9M|  return m_tokens.front();
   63|  16.9M|}
_ZNK4YAML7Scanner4markEv:
   65|  1.72M|Mark Scanner::mark() const { return INPUT.mark(); }
_ZN4YAML7Scanner19EnsureTokensInQueueEv:
   67|  32.5M|void Scanner::EnsureTokensInQueue() {
   68|  98.5M|  while (true) {
  ------------------
  |  Branch (68:10): [True: 98.5M, Folded]
  ------------------
   69|  98.5M|    if (!m_tokens.empty()) {
  ------------------
  |  Branch (69:9): [True: 98.1M, False: 394k]
  ------------------
   70|  98.1M|      Token& token = m_tokens.front();
   71|       |
   72|       |      // if this guy's valid, then we're done
   73|  98.1M|      if (token.status == Token::VALID) {
  ------------------
  |  Branch (73:11): [True: 31.7M, False: 66.3M]
  ------------------
   74|  31.7M|        return;
   75|  31.7M|      }
   76|       |
   77|       |      // here's where we clean up the impossible tokens
   78|  66.3M|      if (token.status == Token::INVALID) {
  ------------------
  |  Branch (78:11): [True: 31.3k, False: 66.3M]
  ------------------
   79|  31.3k|        m_tokens.pop();
   80|  31.3k|        continue;
   81|  31.3k|      }
   82|       |
   83|       |      // note: what's left are the unverified tokens
   84|  66.3M|    }
   85|       |
   86|       |    // no token? maybe we've actually finished
   87|  66.7M|    if (m_endedStream) {
  ------------------
  |  Branch (87:9): [True: 808k, False: 65.9M]
  ------------------
   88|   808k|      return;
   89|   808k|    }
   90|       |
   91|       |    // no? then scan...
   92|  65.9M|    ScanNextToken();
   93|  65.9M|  }
   94|  32.5M|}
_ZN4YAML7Scanner13ScanNextTokenEv:
   96|  65.9M|void Scanner::ScanNextToken() {
   97|  65.9M|  if (m_endedStream) {
  ------------------
  |  Branch (97:7): [True: 0, False: 65.9M]
  ------------------
   98|      0|    return;
   99|      0|  }
  100|       |
  101|  65.9M|  if (!m_startedStream) {
  ------------------
  |  Branch (101:7): [True: 7.17k, False: 65.9M]
  ------------------
  102|  7.17k|    return StartStream();
  103|  7.17k|  }
  104|       |
  105|       |  // get rid of whitespace, etc. (in between tokens it should be irrelevant)
  106|  65.9M|  ScanToNextToken();
  107|       |
  108|       |  // maybe need to end some blocks
  109|  65.9M|  PopIndentToHere();
  110|       |
  111|       |  // *****
  112|       |  // And now branch based on the next few characters!
  113|       |  // *****
  114|       |
  115|       |  // end of stream
  116|  65.9M|  if (!INPUT) {
  ------------------
  |  Branch (116:7): [True: 6.03k, False: 65.9M]
  ------------------
  117|  6.03k|    return EndStream();
  118|  6.03k|  }
  119|       |
  120|  65.9M|  if (INPUT.column() == 0 && INPUT.peek() == Keys::Directive) {
  ------------------
  |  Branch (120:7): [True: 2.50M, False: 63.4M]
  |  Branch (120:30): [True: 13.0k, False: 2.48M]
  ------------------
  121|  13.0k|    return ScanDirective();
  122|  13.0k|  }
  123|       |
  124|       |  // document token
  125|  65.8M|  if (INPUT.column() == 0 && Exp::DocStart().Matches(INPUT)) {
  ------------------
  |  Branch (125:7): [True: 2.48M, False: 63.4M]
  |  Branch (125:30): [True: 27.5k, False: 2.46M]
  ------------------
  126|  27.5k|    return ScanDocStart();
  127|  27.5k|  }
  128|       |
  129|  65.8M|  if (INPUT.column() == 0 && Exp::DocEnd().Matches(INPUT)) {
  ------------------
  |  Branch (129:7): [True: 2.46M, False: 63.4M]
  |  Branch (129:30): [True: 346k, False: 2.11M]
  ------------------
  130|   346k|    return ScanDocEnd();
  131|   346k|  }
  132|       |
  133|       |  // flow start/end/entry
  134|  65.5M|  if (INPUT.peek() == Keys::FlowSeqStart ||
  ------------------
  |  Branch (134:7): [True: 33.3M, False: 32.1M]
  ------------------
  135|  50.8M|      INPUT.peek() == Keys::FlowMapStart) {
  ------------------
  |  Branch (135:7): [True: 17.5M, False: 14.6M]
  ------------------
  136|  50.8M|    return ScanFlowStart();
  137|  50.8M|  }
  138|       |
  139|  14.6M|  if (INPUT.peek() == Keys::FlowSeqEnd || INPUT.peek() == Keys::FlowMapEnd) {
  ------------------
  |  Branch (139:7): [True: 24.8k, False: 14.6M]
  |  Branch (139:43): [True: 617k, False: 14.0M]
  ------------------
  140|   642k|    return ScanFlowEnd();
  141|   642k|  }
  142|       |
  143|  14.0M|  if (INPUT.peek() == Keys::FlowEntry) {
  ------------------
  |  Branch (143:7): [True: 2.85M, False: 11.1M]
  ------------------
  144|       |    // values starting with `,` are not allowed.
  145|       |    // eg: reject `,foo`
  146|  2.85M|    if (INPUT.column() == 0) {
  ------------------
  |  Branch (146:9): [True: 2, False: 2.85M]
  ------------------
  147|      2|      throw ParserException(INPUT.mark(), ErrorMsg::UNEXPECTED_FLOW);
  148|      2|    }
  149|       |    // if we already parsed a quoted scalar value and we are not in a flow,
  150|       |    // then `,` is not a valid character.
  151|       |    // eg: reject `"foo",`
  152|  2.85M|    if (!m_scalarValueAllowed) {
  ------------------
  |  Branch (152:9): [True: 1, False: 2.85M]
  ------------------
  153|      1|      throw ParserException(INPUT.mark(), ErrorMsg::UNEXPECTED_SCALAR);
  154|      1|    }
  155|  2.85M|    return ScanFlowEntry();
  156|  2.85M|  }
  157|       |
  158|       |  // block/map stuff
  159|  11.1M|  if (Exp::BlockEntry().Matches(INPUT)) {
  ------------------
  |  Branch (159:7): [True: 1.11M, False: 10.0M]
  ------------------
  160|  1.11M|    return ScanBlockEntry();
  161|  1.11M|  }
  162|       |
  163|  10.0M|  if ((InBlockContext() ? Exp::Key() : Exp::KeyInFlow()).Matches(INPUT)) {
  ------------------
  |  Branch (163:7): [True: 24.6k, False: 10.0M]
  |  Branch (163:8): [True: 9.16M, False: 888k]
  ------------------
  164|  24.6k|    return ScanKey();
  165|  24.6k|  }
  166|       |
  167|  10.0M|  if (GetValueRegex().Matches(INPUT)) {
  ------------------
  |  Branch (167:7): [True: 7.00M, False: 3.02M]
  ------------------
  168|  7.00M|    return ScanValue();
  169|  7.00M|  }
  170|       |
  171|       |  // alias/anchor
  172|  3.02M|  if (INPUT.peek() == Keys::Alias || INPUT.peek() == Keys::Anchor) {
  ------------------
  |  Branch (172:7): [True: 2.12k, False: 3.01M]
  |  Branch (172:38): [True: 9.27k, False: 3.00M]
  ------------------
  173|  11.3k|    return ScanAnchorOrAlias();
  174|  11.3k|  }
  175|       |
  176|       |  // tag
  177|  3.00M|  if (INPUT.peek() == Keys::Tag) {
  ------------------
  |  Branch (177:7): [True: 1.08M, False: 1.92M]
  ------------------
  178|  1.08M|    return ScanTag();
  179|  1.08M|  }
  180|       |
  181|       |  // special scalars
  182|  1.92M|  if (InBlockContext() && (INPUT.peek() == Keys::LiteralScalar ||
  ------------------
  |  Branch (182:7): [True: 1.07M, False: 846k]
  |  Branch (182:28): [True: 634, False: 1.07M]
  ------------------
  183|  1.07M|                           INPUT.peek() == Keys::FoldedScalar)) {
  ------------------
  |  Branch (183:28): [True: 3.65k, False: 1.07M]
  ------------------
  184|       |    // if we begin parsing a literal scalar with an unverified potential
  185|       |    // simple key pushed, that may be a tag to the literal scalar, and
  186|       |    // should be removed to avoid wrong indentation limit
  187|       |    // eg:
  188|       |    // - !!str |
  189|       |    //  literal
  190|       |    //  scalar
  191|  4.29k|    if (!m_simpleKeys.empty() &&
  ------------------
  |  Branch (191:9): [True: 865, False: 3.42k]
  ------------------
  192|    865|      m_simpleKeys.top().pKey->status == Token::UNVERIFIED) {
  ------------------
  |  Branch (192:7): [True: 865, False: 0]
  ------------------
  193|       |      // if the top of the indents does not match the unverified simple key,
  194|       |      // just invalidate the simple key and do not pop indent to avoid crash.
  195|       |      // eg: an unverified key crossing lines, like issue #1475.
  196|    865|      if (m_simpleKeys.top().pIndent && !m_indents.empty() &&
  ------------------
  |  Branch (196:11): [True: 660, False: 205]
  |  Branch (196:41): [True: 660, False: 0]
  ------------------
  197|    660|          m_indents.top() == m_simpleKeys.top().pIndent) {
  ------------------
  |  Branch (197:11): [True: 466, False: 194]
  ------------------
  198|    466|        PopIndent();
  199|    466|      } else {
  200|    399|        InvalidateSimpleKey();
  201|    399|      }
  202|    865|    }
  203|  4.29k|    return ScanBlockScalar();
  204|  4.29k|  }
  205|       |
  206|       |  // if we already parsed a quoted scalar value in this line,
  207|       |  // another scalar value is an error.
  208|       |  // eg: reject `"foo" "bar"`
  209|  1.91M|  if (!m_scalarValueAllowed) {
  ------------------
  |  Branch (209:7): [True: 23, False: 1.91M]
  ------------------
  210|     23|    throw ParserException(INPUT.mark(), ErrorMsg::UNEXPECTED_SCALAR);
  211|     23|  }
  212|       |
  213|  1.91M|  if (INPUT.peek() == '\'' || INPUT.peek() == '\"') {
  ------------------
  |  Branch (213:7): [True: 6.75k, False: 1.91M]
  |  Branch (213:31): [True: 5.00k, False: 1.90M]
  ------------------
  214|  11.7k|    return ScanQuotedScalar();
  215|  11.7k|  }
  216|       |
  217|       |  // plain scalars
  218|  1.90M|  if ((InBlockContext() ? Exp::PlainScalar() : Exp::PlainScalarInFlow())
  ------------------
  |  Branch (218:7): [True: 1.90M, False: 44]
  |  Branch (218:8): [True: 1.06M, False: 841k]
  ------------------
  219|  1.90M|          .Matches(INPUT)) {
  220|  1.90M|    return ScanPlainScalar();
  221|  1.90M|  }
  222|       |
  223|       |  // don't know what it is!
  224|     44|  throw ParserException(INPUT.mark(), ErrorMsg::UNKNOWN_TOKEN);
  225|  1.90M|}
_ZN4YAML7Scanner15ScanToNextTokenEv:
  227|  65.9M|void Scanner::ScanToNextToken() {
  228|  74.4M|  while (true) {
  ------------------
  |  Branch (228:10): [True: 74.4M, Folded]
  ------------------
  229|       |    // first eat whitespace
  230|  74.5M|    while (INPUT && IsWhitespaceToBeEaten(INPUT.peek())) {
  ------------------
  |  Branch (230:12): [True: 74.5M, False: 5.95k]
  |  Branch (230:21): [True: 85.3k, False: 74.4M]
  ------------------
  231|  85.3k|      if (InBlockContext() && Exp::Tab().Matches(INPUT)) {
  ------------------
  |  Branch (231:11): [True: 63.8k, False: 21.4k]
  |  Branch (231:31): [True: 1.77k, False: 62.1k]
  ------------------
  232|  1.77k|        m_simpleKeyAllowed = false;
  233|  1.77k|      }
  234|  85.3k|      INPUT.eat(1);
  235|  85.3k|    }
  236|       |
  237|       |    // then eat a comment
  238|  74.4M|    if (Exp::Comment().Matches(INPUT)) {
  ------------------
  |  Branch (238:9): [True: 2.04k, False: 74.4M]
  ------------------
  239|       |      // eat until line break
  240|  7.57M|      while (INPUT && !Exp::Break().Matches(INPUT)) {
  ------------------
  |  Branch (240:14): [True: 7.57M, False: 74]
  |  Branch (240:23): [True: 7.56M, False: 1.97k]
  ------------------
  241|  7.56M|        INPUT.eat(1);
  242|  7.56M|      }
  243|  2.04k|    }
  244|       |
  245|       |    // if it's NOT a line break, then we're done!
  246|  74.4M|    if (!Exp::Break().Matches(INPUT)) {
  ------------------
  |  Branch (246:9): [True: 65.9M, False: 8.57M]
  ------------------
  247|  65.9M|      break;
  248|  65.9M|    }
  249|       |
  250|       |    // otherwise, let's eat the line break and keep going
  251|  8.57M|    int n = Exp::Break().Match(INPUT);
  252|  8.57M|    INPUT.eat(n);
  253|       |
  254|       |    // oh yeah, and let's get rid of that simple key
  255|  8.57M|    InvalidateSimpleKey();
  256|       |
  257|       |    // new line - we accept a scalar value now
  258|  8.57M|    m_scalarValueAllowed = true;
  259|       |
  260|       |    // new line - we may be able to accept a simple key now
  261|  8.57M|    if (InBlockContext()) {
  ------------------
  |  Branch (261:9): [True: 8.56M, False: 11.0k]
  ------------------
  262|  8.56M|      m_simpleKeyAllowed = true;
  263|  8.56M|    }
  264|  8.57M|  }
  265|  65.9M|}
_ZNK4YAML7Scanner13GetValueRegexEv:
  270|  10.0M|const RegEx& Scanner::GetValueRegex() const {
  271|  10.0M|  if (InBlockContext()) {
  ------------------
  |  Branch (271:7): [True: 9.15M, False: 874k]
  ------------------
  272|  9.15M|    return Exp::Value();
  273|  9.15M|  }
  274|       |
  275|   874k|  return m_canBeJSONFlow ? Exp::ValueInJSONFlow() : Exp::ValueInFlow();
  ------------------
  |  Branch (275:10): [True: 6.85k, False: 868k]
  ------------------
  276|  10.0M|}
_ZN4YAML7Scanner11StartStreamEv:
  278|  7.17k|void Scanner::StartStream() {
  279|  7.17k|  m_startedStream = true;
  280|  7.17k|  m_simpleKeyAllowed = true;
  281|  7.17k|  m_scalarValueAllowed = true;
  282|  7.17k|  std::unique_ptr<IndentMarker> pIndent(
  283|  7.17k|      new IndentMarker(-1, IndentMarker::NONE));
  284|  7.17k|  m_indentRefs.push_back(std::move(pIndent));
  285|  7.17k|  m_indents.push(&m_indentRefs.back());
  286|  7.17k|}
_ZN4YAML7Scanner9EndStreamEv:
  288|  6.03k|void Scanner::EndStream() {
  289|       |  // force newline
  290|  6.03k|  if (INPUT.column() > 0) {
  ------------------
  |  Branch (290:7): [True: 5.56k, False: 468]
  ------------------
  291|  5.56k|    INPUT.ResetColumn();
  292|  5.56k|  }
  293|       |
  294|  6.03k|  PopAllIndents();
  295|  6.03k|  PopAllSimpleKeys();
  296|       |
  297|  6.03k|  m_simpleKeyAllowed = false;
  298|  6.03k|  m_scalarValueAllowed = false;
  299|  6.03k|  m_endedStream = true;
  300|  6.03k|}
_ZN4YAML7Scanner9PushTokenENS_5Token4TYPEE:
  302|  10.1M|Token* Scanner::PushToken(Token::TYPE type) {
  303|  10.1M|  m_tokens.push(Token(type, INPUT.mark()));
  304|  10.1M|  return &m_tokens.back();
  305|  10.1M|}
_ZN4YAML7Scanner16GetStartTokenForENS0_12IndentMarker11INDENT_TYPEE:
  307|  10.1M|Token::TYPE Scanner::GetStartTokenFor(IndentMarker::INDENT_TYPE type) {
  308|  10.1M|  switch (type) {
  ------------------
  |  Branch (308:11): [True: 10.1M, False: 0]
  ------------------
  309|  1.11M|    case IndentMarker::SEQ:
  ------------------
  |  Branch (309:5): [True: 1.11M, False: 9.07M]
  ------------------
  310|  1.11M|      return Token::BLOCK_SEQ_START;
  311|  9.07M|    case IndentMarker::MAP:
  ------------------
  |  Branch (311:5): [True: 9.07M, False: 1.11M]
  ------------------
  312|  9.07M|      return Token::BLOCK_MAP_START;
  313|      0|    case IndentMarker::NONE:
  ------------------
  |  Branch (313:5): [True: 0, False: 10.1M]
  ------------------
  314|      0|      assert(false);
  315|      0|      break;
  316|  10.1M|  }
  317|  10.1M|  assert(false);
  318|      0|  throw std::runtime_error("yaml-cpp: internal error, invalid indent type");
  319|  10.1M|}
_ZN4YAML7Scanner12PushIndentToEiNS0_12IndentMarker11INDENT_TYPEE:
  322|  10.2M|                                             IndentMarker::INDENT_TYPE type) {
  323|       |  // are we in flow?
  324|  10.2M|  if (InFlowContext()) {
  ------------------
  |  Branch (324:7): [True: 0, False: 10.2M]
  ------------------
  325|      0|    return nullptr;
  326|      0|  }
  327|       |
  328|  10.2M|  std::unique_ptr<IndentMarker> pIndent(new IndentMarker(column, type));
  329|  10.2M|  IndentMarker& indent = *pIndent;
  330|  10.2M|  const IndentMarker& lastIndent = *m_indents.top();
  331|       |
  332|       |  // is this actually an indentation?
  333|  10.2M|  if (indent.column < lastIndent.column) {
  ------------------
  |  Branch (333:7): [True: 0, False: 10.2M]
  ------------------
  334|      0|    return nullptr;
  335|      0|  }
  336|  10.2M|  if (indent.column == lastIndent.column &&
  ------------------
  |  Branch (336:7): [True: 42.9k, False: 10.1M]
  ------------------
  337|  42.9k|      !(indent.type == IndentMarker::SEQ &&
  ------------------
  |  Branch (337:9): [True: 6.65k, False: 36.3k]
  ------------------
  338|  39.7k|        lastIndent.type == IndentMarker::MAP)) {
  ------------------
  |  Branch (338:9): [True: 3.20k, False: 3.45k]
  ------------------
  339|  39.7k|    return nullptr;
  340|  39.7k|  }
  341|       |
  342|       |  // push a start token
  343|  10.1M|  indent.pStartToken = PushToken(GetStartTokenFor(type));
  344|       |
  345|       |  // and then the indent
  346|  10.1M|  m_indents.push(&indent);
  347|  10.1M|  m_indentRefs.push_back(std::move(pIndent));
  348|  10.1M|  return &m_indentRefs.back();
  349|  10.2M|}
_ZN4YAML7Scanner15PopIndentToHereEv:
  351|  65.9M|void Scanner::PopIndentToHere() {
  352|       |  // are we in flow?
  353|  65.9M|  if (InFlowContext()) {
  ------------------
  |  Branch (353:7): [True: 55.2M, False: 10.6M]
  ------------------
  354|  55.2M|    return;
  355|  55.2M|  }
  356|       |
  357|       |  // now pop away
  358|  12.8M|  while (!m_indents.empty()) {
  ------------------
  |  Branch (358:10): [True: 12.8M, False: 0]
  ------------------
  359|  12.8M|    const IndentMarker& indent = *m_indents.top();
  360|  12.8M|    if (indent.column < INPUT.column()) {
  ------------------
  |  Branch (360:9): [True: 9.55M, False: 3.25M]
  ------------------
  361|  9.55M|      break;
  362|  9.55M|    }
  363|  3.25M|    if (indent.column == INPUT.column() &&
  ------------------
  |  Branch (363:9): [True: 2.10M, False: 1.14M]
  ------------------
  364|  2.10M|        !(indent.type == IndentMarker::SEQ &&
  ------------------
  |  Branch (364:11): [True: 1.01M, False: 1.09M]
  ------------------
  365|  1.09M|          !Exp::BlockEntry().Matches(INPUT))) {
  ------------------
  |  Branch (365:11): [True: 1.00M, False: 3.45k]
  ------------------
  366|  1.09M|      break;
  367|  1.09M|    }
  368|       |
  369|  2.15M|    PopIndent();
  370|  2.15M|  }
  371|       |
  372|  11.7M|  while (!m_indents.empty() &&
  ------------------
  |  Branch (372:10): [True: 11.7M, False: 0]
  ------------------
  373|  11.7M|         m_indents.top()->status == IndentMarker::INVALID) {
  ------------------
  |  Branch (373:10): [True: 1.06M, False: 10.6M]
  ------------------
  374|  1.06M|    PopIndent();
  375|  1.06M|  }
  376|  10.6M|}
_ZN4YAML7Scanner13PopAllIndentsEv:
  378|   392k|void Scanner::PopAllIndents() {
  379|       |  // are we in flow?
  380|   392k|  if (InFlowContext()) {
  ------------------
  |  Branch (380:7): [True: 26.6k, False: 366k]
  ------------------
  381|  26.6k|    return;
  382|  26.6k|  }
  383|       |
  384|       |  // now pop away
  385|  4.29M|  while (!m_indents.empty()) {
  ------------------
  |  Branch (385:10): [True: 4.29M, False: 0]
  ------------------
  386|  4.29M|    const IndentMarker& indent = *m_indents.top();
  387|  4.29M|    if (indent.type == IndentMarker::NONE) {
  ------------------
  |  Branch (387:9): [True: 366k, False: 3.92M]
  ------------------
  388|   366k|      break;
  389|   366k|    }
  390|       |
  391|  3.92M|    PopIndent();
  392|  3.92M|  }
  393|   366k|}
_ZN4YAML7Scanner9PopIndentEv:
  395|  7.15M|void Scanner::PopIndent() {
  396|  7.15M|  if (m_indents.empty()) {
  ------------------
  |  Branch (396:7): [True: 0, False: 7.15M]
  ------------------
  397|      0|    ThrowParserException(ErrorMsg::INDENT_STACK_UNDERFLOW);
  398|      0|  }
  399|  7.15M|  const IndentMarker& indent = *m_indents.top();
  400|  7.15M|  m_indents.pop();
  401|       |
  402|  7.15M|  if (indent.status != IndentMarker::VALID) {
  ------------------
  |  Branch (402:7): [True: 2.08M, False: 5.06M]
  ------------------
  403|  2.08M|    InvalidateSimpleKey();
  404|  2.08M|    return;
  405|  2.08M|  }
  406|       |
  407|  5.06M|  if (indent.type == IndentMarker::SEQ) {
  ------------------
  |  Branch (407:7): [True: 1.10M, False: 3.95M]
  ------------------
  408|  1.10M|    m_tokens.push(Token(Token::BLOCK_SEQ_END, INPUT.mark()));
  409|  3.95M|  } else if (indent.type == IndentMarker::MAP) {
  ------------------
  |  Branch (409:14): [True: 3.95M, False: 0]
  ------------------
  410|  3.95M|    m_tokens.push(Token(Token::BLOCK_MAP_END, INPUT.mark()));
  411|  3.95M|  }
  412|  5.06M|}
_ZNK4YAML7Scanner12GetTopIndentEv:
  414|  1.07M|int Scanner::GetTopIndent() const {
  415|  1.07M|  if (m_indents.empty()) {
  ------------------
  |  Branch (415:7): [True: 0, False: 1.07M]
  ------------------
  416|      0|    return 0;
  417|      0|  }
  418|  1.07M|  return m_indents.top()->column;
  419|  1.07M|}
scanner.cpp:_ZN4YAML12_GLOBAL__N_121IsWhitespaceToBeEatenEc:
   20|  74.5M|bool IsWhitespaceToBeEaten(char ch) { return (ch == ' ') || (ch == '\t'); }
  ------------------
  |  Branch (20:46): [True: 65.7k, False: 74.5M]
  |  Branch (20:61): [True: 19.5k, False: 74.4M]
  ------------------

_ZN4YAML7Scanner12IndentMarkerC2EiNS1_11INDENT_TYPEE:
   50|  10.2M|        : column(column_), type(type_), status(VALID), pStartToken(nullptr) {}
_ZNK4YAML7Scanner13InFlowContextEv:
   87|  84.9M|  bool InFlowContext() const { return !m_flows.empty(); }
_ZNK4YAML7Scanner14InBlockContextEv:
   88|   100M|  bool InBlockContext() const { return m_flows.empty(); }
_ZNK4YAML7Scanner12GetFlowLevelEv:
   89|   110M|  std::size_t GetFlowLevel() const { return m_flows.size(); }

_ZN4YAML10ScanScalarERNS_6StreamERNS_16ScanScalarParamsE:
   21|  1.92M|std::string ScanScalar(Stream& INPUT, ScanScalarParams& params) {
   22|  1.92M|  bool foundNonEmptyLine = false;
   23|  1.92M|  bool pastOpeningBreak = (params.fold == FOLD_FLOW);
   24|  1.92M|  bool emptyLine = false, moreIndented = false;
   25|  1.92M|  int foldedNewlineCount = 0;
   26|  1.92M|  bool foldedNewlineStartedMoreIndented = false;
   27|  1.92M|  std::size_t lastEscapedChar = std::string::npos;
   28|  1.92M|  std::string scalar;
   29|  1.92M|  params.leadingSpaces = false;
   30|       |
   31|  1.92M|  if (!params.end) {
  ------------------
  |  Branch (31:7): [True: 4.23k, False: 1.91M]
  ------------------
   32|  4.23k|    params.end = &Exp::Empty();
   33|  4.23k|  }
   34|       |
   35|  12.8M|  while (INPUT) {
  ------------------
  |  Branch (35:10): [True: 12.8M, False: 1.03k]
  ------------------
   36|       |    // ********************************
   37|       |    // Phase #1: scan until line ending
   38|       |
   39|  12.8M|    std::size_t lastNonWhitespaceChar = scalar.size();
   40|  12.8M|    bool escapedNewline = false;
   41|   100M|    while (!params.end->Matches(INPUT) && !Exp::Break().Matches(INPUT)) {
  ------------------
  |  Branch (41:12): [True: 99.7M, False: 874k]
  |  Branch (41:43): [True: 87.7M, False: 11.9M]
  ------------------
   42|  87.7M|      if (!INPUT) {
  ------------------
  |  Branch (42:11): [True: 1.97k, False: 87.7M]
  ------------------
   43|  1.97k|        break;
   44|  1.97k|      }
   45|       |
   46|       |      // document indicator?
   47|  87.7M|      if (INPUT.column() == 0 && Exp::DocIndicator().Matches(INPUT)) {
  ------------------
  |  Branch (47:11): [True: 123k, False: 87.6M]
  |  Branch (47:34): [True: 24.5k, False: 99.2k]
  ------------------
   48|  24.5k|        if (params.onDocIndicator == BREAK) {
  ------------------
  |  Branch (48:13): [True: 24.5k, False: 1]
  ------------------
   49|  24.5k|          break;
   50|  24.5k|        }
   51|      1|        if (params.onDocIndicator == THROW) {
  ------------------
  |  Branch (51:13): [True: 1, False: 0]
  ------------------
   52|      1|          throw ParserException(INPUT.mark(), ErrorMsg::DOC_IN_SCALAR);
   53|      1|        }
   54|      1|      }
   55|       |
   56|  87.7M|      foundNonEmptyLine = true;
   57|  87.7M|      pastOpeningBreak = true;
   58|       |
   59|       |      // escaped newline? (only if we're escaping on slash)
   60|  87.7M|      if (params.escape == '\\' && Exp::EscBreak().Matches(INPUT)) {
  ------------------
  |  Branch (60:11): [True: 9.99M, False: 77.7M]
  |  Branch (60:36): [True: 791, False: 9.99M]
  ------------------
   61|       |        // eat escape character and get out (but preserve trailing whitespace!)
   62|    791|        INPUT.get();
   63|    791|        lastNonWhitespaceChar = scalar.size();
   64|    791|        lastEscapedChar = scalar.size();
   65|    791|        escapedNewline = true;
   66|    791|        break;
   67|    791|      }
   68|       |
   69|       |      // escape this?
   70|  87.7M|      if (INPUT.peek() == params.escape) {
  ------------------
  |  Branch (70:11): [True: 35.9k, False: 87.7M]
  ------------------
   71|  35.9k|        scalar += Exp::Escape(INPUT);
   72|  35.9k|        lastNonWhitespaceChar = scalar.size();
   73|  35.9k|        lastEscapedChar = scalar.size();
   74|  35.9k|        continue;
   75|  35.9k|      }
   76|       |
   77|       |      // otherwise, just add the damn character
   78|  87.7M|      char ch = INPUT.get();
   79|  87.7M|      scalar += ch;
   80|  87.7M|      if (ch != ' ' && ch != '\t') {
  ------------------
  |  Branch (80:11): [True: 87.6M, False: 35.0k]
  |  Branch (80:24): [True: 86.3M, False: 1.37M]
  ------------------
   81|  86.3M|        lastNonWhitespaceChar = scalar.size();
   82|  86.3M|      }
   83|  87.7M|    }
   84|       |
   85|       |    // eof? if we're looking to eat something, then we throw
   86|  12.8M|    if (!INPUT) {
  ------------------
  |  Branch (86:9): [True: 2.07k, False: 12.8M]
  ------------------
   87|  2.07k|      if (params.eatEnd) {
  ------------------
  |  Branch (87:11): [True: 217, False: 1.85k]
  ------------------
   88|    217|        throw ParserException(INPUT.mark(), ErrorMsg::EOF_IN_SCALAR);
   89|    217|      }
   90|  1.85k|      break;
   91|  2.07k|    }
   92|       |
   93|       |    // doc indicator?
   94|  12.8M|    if (params.onDocIndicator == BREAK && INPUT.column() == 0 &&
  ------------------
  |  Branch (94:9): [True: 7.04M, False: 5.83M]
  |  Branch (94:43): [True: 4.53M, False: 2.51M]
  ------------------
   95|  4.53M|        Exp::DocIndicator().Matches(INPUT)) {
  ------------------
  |  Branch (95:9): [True: 24.5k, False: 4.50M]
  ------------------
   96|  24.5k|      break;
   97|  24.5k|    }
   98|       |
   99|       |    // are we done via character match?
  100|  12.8M|    int n = params.end->Match(INPUT);
  101|  12.8M|    if (n >= 0) {
  ------------------
  |  Branch (101:9): [True: 874k, False: 11.9M]
  ------------------
  102|   874k|      if (params.eatEnd) {
  ------------------
  |  Branch (102:11): [True: 11.2k, False: 862k]
  ------------------
  103|  11.2k|        INPUT.eat(n);
  104|  11.2k|      }
  105|   874k|      break;
  106|   874k|    }
  107|       |
  108|       |    // do we remove trailing whitespace?
  109|  11.9M|    if (params.fold == FOLD_FLOW)
  ------------------
  |  Branch (109:9): [True: 7.25M, False: 4.72M]
  ------------------
  110|  7.25M|      scalar.erase(lastNonWhitespaceChar);
  111|       |
  112|       |    // ********************************
  113|       |    // Phase #2: eat line ending
  114|  11.9M|    n = Exp::Break().Match(INPUT);
  115|  11.9M|    INPUT.eat(n);
  116|       |
  117|       |    // ********************************
  118|       |    // Phase #3: scan initial spaces
  119|       |
  120|       |    // first the required indentation
  121|  11.9M|    while (INPUT.peek() == ' ' &&
  ------------------
  |  Branch (121:12): [True: 64.2k, False: 11.9M]
  ------------------
  122|  64.2k|           (INPUT.column() < params.indent ||
  ------------------
  |  Branch (122:13): [True: 451, False: 63.7k]
  ------------------
  123|  63.7k|            (params.detectIndent && !foundNonEmptyLine)) &&
  ------------------
  |  Branch (123:14): [True: 1.63k, False: 62.1k]
  |  Branch (123:37): [True: 683, False: 950]
  ------------------
  124|  1.13k|           !params.end->Matches(INPUT)) {
  ------------------
  |  Branch (124:12): [True: 940, False: 194]
  ------------------
  125|    940|      INPUT.eat(1);
  126|    940|    }
  127|       |
  128|       |    // update indent if we're auto-detecting
  129|  11.9M|    if (params.detectIndent && !foundNonEmptyLine) {
  ------------------
  |  Branch (129:9): [True: 4.72M, False: 7.25M]
  |  Branch (129:32): [True: 3.79M, False: 933k]
  ------------------
  130|  3.79M|      params.indent = std::max(params.indent, INPUT.column());
  131|  3.79M|    }
  132|       |
  133|       |    // and then the rest of the whitespace
  134|  12.0M|    while (Exp::Blank().Matches(INPUT)) {
  ------------------
  |  Branch (134:12): [True: 66.1k, False: 11.9M]
  ------------------
  135|       |      // we check for tabs that masquerade as indentation
  136|  66.1k|      if (INPUT.peek() == '\t' && INPUT.column() < params.indent &&
  ------------------
  |  Branch (136:11): [True: 2.37k, False: 63.7k]
  |  Branch (136:35): [True: 3, False: 2.37k]
  ------------------
  137|      3|          params.onTabInIndentation == THROW) {
  ------------------
  |  Branch (137:11): [True: 3, False: 0]
  ------------------
  138|      3|        throw ParserException(INPUT.mark(), ErrorMsg::TAB_IN_INDENTATION);
  139|      3|      }
  140|       |
  141|  66.1k|      if (!params.eatLeadingWhitespace) {
  ------------------
  |  Branch (141:11): [True: 2.07k, False: 64.0k]
  ------------------
  142|  2.07k|        break;
  143|  2.07k|      }
  144|       |
  145|  64.0k|      if (params.end->Matches(INPUT)) {
  ------------------
  |  Branch (145:11): [True: 235, False: 63.8k]
  ------------------
  146|    235|        break;
  147|    235|      }
  148|       |
  149|  63.8k|      INPUT.eat(1);
  150|  63.8k|    }
  151|       |
  152|       |    // was this an empty line?
  153|  11.9M|    bool nextEmptyLine = Exp::Break().Matches(INPUT);
  154|  11.9M|    bool nextMoreIndented = Exp::Blank().Matches(INPUT);
  155|  11.9M|    if (params.fold == FOLD_BLOCK && foldedNewlineCount == 0 && nextEmptyLine)
  ------------------
  |  Branch (155:9): [True: 4.72M, False: 7.25M]
  |  Branch (155:38): [True: 188k, False: 4.53M]
  |  Branch (155:65): [True: 5.21k, False: 183k]
  ------------------
  156|  5.21k|      foldedNewlineStartedMoreIndented = moreIndented;
  157|       |
  158|       |    // for block scalars, we always start with a newline, so we should ignore it
  159|       |    // (not fold or keep)
  160|  11.9M|    if (pastOpeningBreak) {
  ------------------
  |  Branch (160:9): [True: 11.9M, False: 4.47k]
  ------------------
  161|  11.9M|      switch (params.fold) {
  ------------------
  |  Branch (161:15): [True: 11.9M, False: 0]
  ------------------
  162|    472|        case DONT_FOLD:
  ------------------
  |  Branch (162:9): [True: 472, False: 11.9M]
  ------------------
  163|    472|          scalar += "\n";
  164|    472|          break;
  165|  4.71M|        case FOLD_BLOCK:
  ------------------
  |  Branch (165:9): [True: 4.71M, False: 7.25M]
  ------------------
  166|  4.71M|          if (!emptyLine && !nextEmptyLine && !moreIndented &&
  ------------------
  |  Branch (166:15): [True: 184k, False: 4.53M]
  |  Branch (166:29): [True: 180k, False: 3.95k]
  |  Branch (166:47): [True: 179k, False: 1.40k]
  ------------------
  167|   179k|              !nextMoreIndented && INPUT.column() >= params.indent) {
  ------------------
  |  Branch (167:15): [True: 178k, False: 332]
  |  Branch (167:36): [True: 178k, False: 386]
  ------------------
  168|   178k|            scalar += " ";
  169|  4.54M|          } else if (nextEmptyLine) {
  ------------------
  |  Branch (169:22): [True: 4.53M, False: 6.76k]
  ------------------
  170|  4.53M|            foldedNewlineCount++;
  171|  4.53M|          } else {
  172|  6.76k|            scalar += "\n";
  173|  6.76k|          }
  174|       |
  175|  4.71M|          if (!nextEmptyLine && foldedNewlineCount > 0) {
  ------------------
  |  Branch (175:15): [True: 185k, False: 4.53M]
  |  Branch (175:33): [True: 4.51k, False: 180k]
  ------------------
  176|  4.51k|            scalar += std::string(foldedNewlineCount - 1, '\n');
  177|  4.51k|            if (foldedNewlineStartedMoreIndented ||
  ------------------
  |  Branch (177:17): [True: 629, False: 3.88k]
  ------------------
  178|  3.88k|                nextMoreIndented || !foundNonEmptyLine) {
  ------------------
  |  Branch (178:17): [True: 387, False: 3.50k]
  |  Branch (178:37): [True: 556, False: 2.94k]
  ------------------
  179|  1.57k|              scalar += "\n";
  180|  1.57k|            }
  181|  4.51k|            foldedNewlineCount = 0;
  182|  4.51k|          }
  183|  4.71M|          break;
  184|  7.25M|        case FOLD_FLOW:
  ------------------
  |  Branch (184:9): [True: 7.25M, False: 4.71M]
  ------------------
  185|  7.25M|          if (nextEmptyLine) {
  ------------------
  |  Branch (185:15): [True: 5.99M, False: 1.25M]
  ------------------
  186|  5.99M|            scalar += "\n";
  187|  5.99M|          } else if (!emptyLine && !escapedNewline) {
  ------------------
  |  Branch (187:22): [True: 1.23M, False: 24.4k]
  |  Branch (187:36): [True: 1.23M, False: 787]
  ------------------
  188|  1.23M|            scalar += " ";
  189|  1.23M|          }
  190|  7.25M|          break;
  191|  11.9M|      }
  192|  11.9M|    }
  193|       |
  194|  11.9M|    emptyLine = nextEmptyLine;
  195|  11.9M|    moreIndented = nextMoreIndented;
  196|  11.9M|    pastOpeningBreak = true;
  197|       |
  198|       |    // are we done via indentation?
  199|  11.9M|    if (!emptyLine && INPUT.column() < params.indent) {
  ------------------
  |  Branch (199:9): [True: 1.44M, False: 10.5M]
  |  Branch (199:23): [True: 1.02M, False: 425k]
  ------------------
  200|  1.02M|      params.leadingSpaces = true;
  201|  1.02M|      break;
  202|  1.02M|    }
  203|  11.9M|  }
  204|       |
  205|       |  // post-processing
  206|  1.92M|  if (params.trimTrailingSpaces) {
  ------------------
  |  Branch (206:7): [True: 1.90M, False: 16.0k]
  ------------------
  207|  1.90M|    std::size_t pos = scalar.find_last_not_of(" \t");
  208|  1.90M|    if (lastEscapedChar != std::string::npos) {
  ------------------
  |  Branch (208:9): [True: 12.4k, False: 1.89M]
  ------------------
  209|  12.4k|      if (pos < lastEscapedChar || pos == std::string::npos) {
  ------------------
  |  Branch (209:11): [True: 7.83k, False: 4.65k]
  |  Branch (209:36): [True: 509, False: 4.14k]
  ------------------
  210|  8.33k|        pos = lastEscapedChar;
  211|  8.33k|      }
  212|  12.4k|    }
  213|  1.90M|    if (pos < scalar.size()) {
  ------------------
  |  Branch (213:9): [True: 1.89M, False: 8.13k]
  ------------------
  214|  1.89M|      scalar.erase(pos + 1);
  215|  1.89M|    }
  216|  1.90M|  }
  217|       |
  218|  1.92M|  switch (params.chomp) {
  219|  14.9k|    case CLIP: {
  ------------------
  |  Branch (219:5): [True: 14.9k, False: 1.90M]
  ------------------
  220|  14.9k|      std::size_t pos = scalar.find_last_not_of('\n');
  221|  14.9k|      if (lastEscapedChar != std::string::npos) {
  ------------------
  |  Branch (221:11): [True: 2.98k, False: 11.9k]
  ------------------
  222|  2.98k|        if (pos < lastEscapedChar || pos == std::string::npos) {
  ------------------
  |  Branch (222:13): [True: 1.51k, False: 1.46k]
  |  Branch (222:38): [True: 220, False: 1.24k]
  ------------------
  223|  1.73k|          pos = lastEscapedChar;
  224|  1.73k|        }
  225|  2.98k|      }
  226|  14.9k|      if (pos == std::string::npos) {
  ------------------
  |  Branch (226:11): [True: 9.26k, False: 5.70k]
  ------------------
  227|  9.26k|        scalar.erase();
  228|  9.26k|      } else if (pos + 1 < scalar.size()) {
  ------------------
  |  Branch (228:18): [True: 516, False: 5.19k]
  ------------------
  229|    516|        scalar.erase(pos + 2);
  230|    516|      }
  231|  14.9k|    } break;
  232|  1.90M|    case STRIP: {
  ------------------
  |  Branch (232:5): [True: 1.90M, False: 15.8k]
  ------------------
  233|  1.90M|      std::size_t pos = scalar.find_last_not_of('\n');
  234|  1.90M|      if (lastEscapedChar != std::string::npos) {
  ------------------
  |  Branch (234:11): [True: 12.4k, False: 1.89M]
  ------------------
  235|  12.4k|        if (pos < lastEscapedChar || pos == std::string::npos) {
  ------------------
  |  Branch (235:13): [True: 7.82k, False: 4.66k]
  |  Branch (235:38): [True: 340, False: 4.32k]
  ------------------
  236|  8.16k|          pos = lastEscapedChar;
  237|  8.16k|        }
  238|  12.4k|      }
  239|  1.90M|      if (pos == std::string::npos) {
  ------------------
  |  Branch (239:11): [True: 225, False: 1.90M]
  ------------------
  240|    225|        scalar.erase();
  241|  1.90M|      } else if (pos < scalar.size()) {
  ------------------
  |  Branch (241:18): [True: 1.89M, False: 8.13k]
  ------------------
  242|  1.89M|        scalar.erase(pos + 1);
  243|  1.89M|      }
  244|  1.90M|    } break;
  245|    525|    default:
  ------------------
  |  Branch (245:5): [True: 525, False: 1.92M]
  ------------------
  246|    525|      break;
  247|  1.92M|  }
  248|       |
  249|  1.92M|  return scalar;
  250|  1.92M|}

_ZN4YAML16ScanScalarParamsC2Ev:
   22|  1.92M|      : end(nullptr),
   23|  1.92M|        eatEnd(false),
   24|  1.92M|        indent(0),
   25|  1.92M|        detectIndent(false),
   26|  1.92M|        eatLeadingWhitespace(0),
   27|  1.92M|        escape(0),
   28|  1.92M|        fold(DONT_FOLD),
   29|  1.92M|        trimTrailingSpaces(0),
   30|  1.92M|        chomp(CLIP),
   31|  1.92M|        onDocIndicator(NONE),
   32|  1.92M|        onTabInIndentation(NONE),
   33|  1.92M|        leadingSpaces(false) {}

_ZN4YAML15ScanVerbatimTagERNS_6StreamE:
    9|    670|std::string ScanVerbatimTag(Stream& INPUT) {
   10|    670|  std::string tag;
   11|       |
   12|       |  // eat the start character
   13|    670|  INPUT.get();
   14|       |
   15|  9.94k|  while (INPUT) {
  ------------------
  |  Branch (15:10): [True: 9.92k, False: 21]
  ------------------
   16|  9.92k|    if (INPUT.peek() == Keys::VerbatimTagEnd) {
  ------------------
  |  Branch (16:9): [True: 635, False: 9.29k]
  ------------------
   17|       |      // eat the end character
   18|    635|      INPUT.get();
   19|    635|      return tag;
   20|    635|    }
   21|       |
   22|  9.29k|    int n = Exp::URI().Match(INPUT);
   23|  9.29k|    if (n <= 0)
  ------------------
  |  Branch (23:9): [True: 14, False: 9.27k]
  ------------------
   24|     14|      break;
   25|       |
   26|  9.27k|    tag += INPUT.get(n);
   27|  9.27k|  }
   28|       |
   29|     35|  throw ParserException(INPUT.mark(), ErrorMsg::END_OF_VERBATIM_TAG);
   30|    670|}
_ZN4YAML13ScanTagHandleERNS_6StreamERb:
   32|  1.08M|std::string ScanTagHandle(Stream& INPUT, bool& canBeHandle) {
   33|  1.08M|  std::string tag;
   34|  1.08M|  canBeHandle = true;
   35|  1.08M|  Mark firstNonWordChar;
   36|       |
   37|  8.39M|  while (INPUT) {
  ------------------
  |  Branch (37:10): [True: 8.39M, False: 346]
  ------------------
   38|  8.39M|    if (INPUT.peek() == Keys::Tag) {
  ------------------
  |  Branch (38:9): [True: 3.39k, False: 8.39M]
  ------------------
   39|  3.39k|      if (!canBeHandle)
  ------------------
  |  Branch (39:11): [True: 3, False: 3.38k]
  ------------------
   40|      3|        throw ParserException(firstNonWordChar, ErrorMsg::CHAR_IN_TAG_HANDLE);
   41|  3.38k|      break;
   42|  3.39k|    }
   43|       |
   44|  8.39M|    int n = 0;
   45|  8.39M|    if (canBeHandle) {
  ------------------
  |  Branch (45:9): [True: 7.74M, False: 643k]
  ------------------
   46|  7.74M|      n = Exp::Word().Match(INPUT);
   47|  7.74M|      if (n <= 0) {
  ------------------
  |  Branch (47:11): [True: 1.08M, False: 6.66M]
  ------------------
   48|  1.08M|        canBeHandle = false;
   49|  1.08M|        firstNonWordChar = INPUT.mark();
   50|  1.08M|      }
   51|  7.74M|    }
   52|       |
   53|  8.39M|    if (!canBeHandle)
  ------------------
  |  Branch (53:9): [True: 1.72M, False: 6.66M]
  ------------------
   54|  1.72M|      n = Exp::Tag().Match(INPUT);
   55|       |
   56|  8.39M|    if (n <= 0)
  ------------------
  |  Branch (56:9): [True: 1.08M, False: 7.30M]
  ------------------
   57|  1.08M|      break;
   58|       |
   59|  7.30M|    tag += INPUT.get(n);
   60|  7.30M|  }
   61|       |
   62|  1.08M|  return tag;
   63|  1.08M|}
_ZN4YAML13ScanTagSuffixERNS_6StreamE:
   65|  3.38k|std::string ScanTagSuffix(Stream& INPUT) {
   66|  3.38k|  std::string tag;
   67|       |
   68|  1.48M|  while (INPUT) {
  ------------------
  |  Branch (68:10): [True: 1.48M, False: 135]
  ------------------
   69|  1.48M|    int n = Exp::Tag().Match(INPUT);
   70|  1.48M|    if (n <= 0)
  ------------------
  |  Branch (70:9): [True: 3.25k, False: 1.47M]
  ------------------
   71|  3.25k|      break;
   72|       |
   73|  1.47M|    tag += INPUT.get(n);
   74|  1.47M|  }
   75|       |
   76|  3.38k|  if (tag.empty())
  ------------------
  |  Branch (76:7): [True: 17, False: 3.37k]
  ------------------
   77|     17|    throw ParserException(INPUT.mark(), ErrorMsg::TAG_WITH_NO_SUFFIX);
   78|       |
   79|  3.37k|  return tag;
   80|  3.38k|}

_ZN4YAML7Scanner13ScanDirectiveEv:
   20|  13.0k|void Scanner::ScanDirective() {
   21|  13.0k|  std::string name;
   22|  13.0k|  std::vector<std::string> params;
   23|       |
   24|       |  // pop indents and simple keys
   25|  13.0k|  PopAllIndents();
   26|  13.0k|  PopAllSimpleKeys();
   27|       |
   28|  13.0k|  m_simpleKeyAllowed = false;
   29|  13.0k|  m_canBeJSONFlow = false;
   30|       |
   31|       |  // store pos and eat indicator
   32|  13.0k|  Token token(Token::DIRECTIVE, INPUT.mark());
   33|  13.0k|  INPUT.eat(1);
   34|       |
   35|       |  // read name
   36|  9.82M|  while (INPUT && !Exp::BlankOrBreak().Matches(INPUT))
  ------------------
  |  Branch (36:10): [True: 9.82M, False: 240]
  |  Branch (36:19): [True: 9.80M, False: 12.8k]
  ------------------
   37|  9.80M|    token.value += INPUT.get();
   38|       |
   39|       |  // read parameters
   40|  1.25M|  while (true) {
  ------------------
  |  Branch (40:10): [True: 1.25M, Folded]
  ------------------
   41|       |    // first get rid of whitespace
   42|  2.51M|    while (Exp::Blank().Matches(INPUT))
  ------------------
  |  Branch (42:12): [True: 1.26M, False: 1.25M]
  ------------------
   43|  1.26M|      INPUT.eat(1);
   44|       |
   45|       |    // break on newline or comment
   46|  1.25M|    if (!INPUT || Exp::Break().Matches(INPUT) || Exp::Comment().Matches(INPUT))
  ------------------
  |  Branch (46:9): [True: 806, False: 1.25M]
  |  Branch (46:9): [True: 13.0k, False: 1.24M]
  |  Branch (46:19): [True: 12.0k, False: 1.24M]
  |  Branch (46:50): [True: 197, False: 1.24M]
  ------------------
   47|  13.0k|      break;
   48|       |
   49|       |    // now read parameter
   50|  1.24M|    std::string param;
   51|  25.8M|    while (INPUT && !Exp::BlankOrBreak().Matches(INPUT))
  ------------------
  |  Branch (51:12): [True: 25.8M, False: 525]
  |  Branch (51:21): [True: 24.6M, False: 1.24M]
  ------------------
   52|  24.6M|      param += INPUT.get();
   53|       |
   54|  1.24M|    token.params.push_back(param);
   55|  1.24M|  }
   56|       |
   57|  13.0k|  m_tokens.push(token);
   58|  13.0k|}
_ZN4YAML7Scanner12ScanDocStartEv:
   61|  27.5k|void Scanner::ScanDocStart() {
   62|  27.5k|  PopAllIndents();
   63|  27.5k|  PopAllSimpleKeys();
   64|  27.5k|  m_simpleKeyAllowed = false;
   65|  27.5k|  m_canBeJSONFlow = false;
   66|       |
   67|       |  // eat
   68|  27.5k|  Mark mark = INPUT.mark();
   69|  27.5k|  INPUT.eat(3);
   70|  27.5k|  m_tokens.push(Token(Token::DOC_START, mark));
   71|  27.5k|}
_ZN4YAML7Scanner10ScanDocEndEv:
   74|   346k|void Scanner::ScanDocEnd() {
   75|   346k|  PopAllIndents();
   76|   346k|  PopAllSimpleKeys();
   77|   346k|  m_simpleKeyAllowed = false;
   78|   346k|  m_canBeJSONFlow = false;
   79|       |
   80|       |  // eat
   81|   346k|  Mark mark = INPUT.mark();
   82|   346k|  INPUT.eat(3);
   83|   346k|  m_tokens.push(Token(Token::DOC_END, mark));
   84|   346k|}
_ZN4YAML7Scanner13ScanFlowStartEv:
   87|  50.8M|void Scanner::ScanFlowStart() {
   88|       |  // flows can be simple keys
   89|  50.8M|  InsertPotentialSimpleKey();
   90|  50.8M|  m_simpleKeyAllowed = true;
   91|  50.8M|  m_canBeJSONFlow = false;
   92|       |
   93|       |  // eat
   94|  50.8M|  Mark mark = INPUT.mark();
   95|  50.8M|  char ch = INPUT.get();
   96|  50.8M|  FLOW_MARKER flowType = (ch == Keys::FlowSeqStart ? FLOW_SEQ : FLOW_MAP);
  ------------------
  |  Branch (96:27): [True: 33.3M, False: 17.5M]
  ------------------
   97|  50.8M|  m_flows.push(flowType);
   98|  50.8M|  Token::TYPE type =
   99|  50.8M|      (flowType == FLOW_SEQ ? Token::FLOW_SEQ_START : Token::FLOW_MAP_START);
  ------------------
  |  Branch (99:8): [True: 33.3M, False: 17.5M]
  ------------------
  100|  50.8M|  m_tokens.push(Token(type, mark));
  101|  50.8M|}
_ZN4YAML7Scanner11ScanFlowEndEv:
  104|   642k|void Scanner::ScanFlowEnd() {
  105|   642k|  if (InBlockContext())
  ------------------
  |  Branch (105:7): [True: 26, False: 642k]
  ------------------
  106|     26|    throw ParserException(INPUT.mark(), ErrorMsg::FLOW_END);
  107|       |
  108|       |  // we might have a solo entry in the flow context
  109|   642k|  if (InFlowContext()) {
  ------------------
  |  Branch (109:7): [True: 642k, False: 0]
  ------------------
  110|   642k|    if (m_flows.top() == FLOW_MAP && VerifySimpleKey())
  ------------------
  |  Branch (110:9): [True: 617k, False: 24.8k]
  |  Branch (110:38): [True: 37.7k, False: 579k]
  ------------------
  111|  37.7k|      m_tokens.push(Token(Token::VALUE, INPUT.mark()));
  112|   604k|    else if (m_flows.top() == FLOW_SEQ)
  ------------------
  |  Branch (112:14): [True: 24.8k, False: 579k]
  ------------------
  113|  24.8k|      InvalidateSimpleKey();
  114|   642k|  }
  115|       |
  116|   642k|  m_simpleKeyAllowed = false;
  117|   642k|  m_canBeJSONFlow = true;
  118|       |
  119|       |  // eat
  120|   642k|  Mark mark = INPUT.mark();
  121|   642k|  char ch = INPUT.get();
  122|       |
  123|       |  // check that it matches the start
  124|   642k|  FLOW_MARKER flowType = (ch == Keys::FlowSeqEnd ? FLOW_SEQ : FLOW_MAP);
  ------------------
  |  Branch (124:27): [True: 24.8k, False: 617k]
  ------------------
  125|   642k|  if (m_flows.top() != flowType)
  ------------------
  |  Branch (125:7): [True: 9, False: 642k]
  ------------------
  126|      9|    throw ParserException(mark, ErrorMsg::FLOW_END);
  127|   642k|  m_flows.pop();
  128|       |
  129|   642k|  Token::TYPE type = (flowType ? Token::FLOW_SEQ_END : Token::FLOW_MAP_END);
  ------------------
  |  Branch (129:23): [True: 24.8k, False: 617k]
  ------------------
  130|   642k|  m_tokens.push(Token(type, mark));
  131|   642k|}
_ZN4YAML7Scanner13ScanFlowEntryEv:
  134|  2.85M|void Scanner::ScanFlowEntry() {
  135|       |  // we might have a solo entry in the flow context
  136|  2.85M|  if (InFlowContext()) {
  ------------------
  |  Branch (136:7): [True: 2.85M, False: 846]
  ------------------
  137|  2.85M|    if (m_flows.top() == FLOW_MAP && VerifySimpleKey())
  ------------------
  |  Branch (137:9): [True: 1.76M, False: 1.09M]
  |  Branch (137:38): [True: 705k, False: 1.05M]
  ------------------
  138|   705k|      m_tokens.push(Token(Token::VALUE, INPUT.mark()));
  139|  2.14M|    else if (m_flows.top() == FLOW_SEQ)
  ------------------
  |  Branch (139:14): [True: 1.09M, False: 1.05M]
  ------------------
  140|  1.09M|      InvalidateSimpleKey();
  141|  2.85M|  }
  142|       |
  143|  2.85M|  m_simpleKeyAllowed = true;
  144|  2.85M|  m_canBeJSONFlow = false;
  145|       |
  146|       |  // eat
  147|  2.85M|  Mark mark = INPUT.mark();
  148|  2.85M|  INPUT.eat(1);
  149|  2.85M|  m_tokens.push(Token(Token::FLOW_ENTRY, mark));
  150|  2.85M|}
_ZN4YAML7Scanner14ScanBlockEntryEv:
  153|  1.11M|void Scanner::ScanBlockEntry() {
  154|       |  // we better be in the block context!
  155|  1.11M|  if (InFlowContext())
  ------------------
  |  Branch (155:7): [True: 19, False: 1.11M]
  ------------------
  156|     19|    throw ParserException(INPUT.mark(), ErrorMsg::BLOCK_ENTRY);
  157|       |
  158|       |  // can we put it here?
  159|  1.11M|  if (!m_simpleKeyAllowed)
  ------------------
  |  Branch (159:7): [True: 6, False: 1.11M]
  ------------------
  160|      6|    throw ParserException(INPUT.mark(), ErrorMsg::BLOCK_ENTRY);
  161|       |
  162|  1.11M|  PushIndentTo(INPUT.column(), IndentMarker::SEQ);
  163|  1.11M|  m_simpleKeyAllowed = true;
  164|  1.11M|  m_canBeJSONFlow = false;
  165|       |
  166|       |  // eat
  167|  1.11M|  Mark mark = INPUT.mark();
  168|  1.11M|  INPUT.eat(1);
  169|  1.11M|  m_tokens.push(Token(Token::BLOCK_ENTRY, mark));
  170|  1.11M|}
_ZN4YAML7Scanner7ScanKeyEv:
  173|  24.6k|void Scanner::ScanKey() {
  174|       |  // handle keys differently in the block context (and manage indents)
  175|  24.6k|  if (InBlockContext()) {
  ------------------
  |  Branch (175:7): [True: 10.7k, False: 13.9k]
  ------------------
  176|  10.7k|    if (!m_simpleKeyAllowed)
  ------------------
  |  Branch (176:9): [True: 1, False: 10.7k]
  ------------------
  177|      1|      throw ParserException(INPUT.mark(), ErrorMsg::MAP_KEY);
  178|       |
  179|  10.7k|    PushIndentTo(INPUT.column(), IndentMarker::MAP);
  180|  10.7k|  }
  181|       |
  182|       |  // can only put a simple key here if we're in block context
  183|  24.6k|  m_simpleKeyAllowed = InBlockContext();
  184|       |
  185|       |  // eat
  186|  24.6k|  Mark mark = INPUT.mark();
  187|  24.6k|  INPUT.eat(1);
  188|  24.6k|  m_tokens.push(Token(Token::KEY, mark));
  189|  24.6k|}
_ZN4YAML7Scanner9ScanValueEv:
  192|  7.00M|void Scanner::ScanValue() {
  193|       |  // and check that simple key
  194|  7.00M|  bool isSimpleKey = VerifySimpleKey();
  195|  7.00M|  m_canBeJSONFlow = false;
  196|       |
  197|  7.00M|  if (isSimpleKey) {
  ------------------
  |  Branch (197:7): [True: 41.9k, False: 6.96M]
  ------------------
  198|       |    // can't follow a simple key with another simple key (dunno why, though - it
  199|       |    // seems fine)
  200|  41.9k|    m_simpleKeyAllowed = false;
  201|  6.96M|  } else {
  202|       |    // handle values differently in the block context (and manage indents)
  203|  6.96M|    if (InBlockContext()) {
  ------------------
  |  Branch (203:9): [True: 6.96M, False: 2.41k]
  ------------------
  204|  6.96M|      if (!m_simpleKeyAllowed)
  ------------------
  |  Branch (204:11): [True: 89, False: 6.96M]
  ------------------
  205|     89|        throw ParserException(INPUT.mark(), ErrorMsg::MAP_VALUE);
  206|       |
  207|  6.96M|      PushIndentTo(INPUT.column(), IndentMarker::MAP);
  208|  6.96M|    }
  209|       |
  210|       |    // can only put a simple key here if we're in block context
  211|  6.96M|    m_simpleKeyAllowed = InBlockContext();
  212|  6.96M|  }
  213|       |
  214|       |  // we are parsing a `key: value` pair; scalars are always allowed
  215|  7.00M|  m_scalarValueAllowed = true;
  216|       |
  217|       |  // eat
  218|  7.00M|  Mark mark = INPUT.mark();
  219|  7.00M|  INPUT.eat(1);
  220|  7.00M|  m_tokens.push(Token(Token::VALUE, mark));
  221|  7.00M|}
_ZN4YAML7Scanner17ScanAnchorOrAliasEv:
  224|  11.3k|void Scanner::ScanAnchorOrAlias() {
  225|  11.3k|  bool alias;
  226|  11.3k|  std::string name;
  227|       |
  228|       |  // insert a potential simple key
  229|  11.3k|  InsertPotentialSimpleKey();
  230|  11.3k|  m_simpleKeyAllowed = false;
  231|  11.3k|  m_canBeJSONFlow = false;
  232|       |
  233|       |  // eat the indicator
  234|  11.3k|  Mark mark = INPUT.mark();
  235|  11.3k|  char indicator = INPUT.get();
  236|  11.3k|  alias = (indicator == Keys::Alias);
  237|       |
  238|       |  // now eat the content
  239|  31.9M|  while (INPUT && Exp::Anchor().Matches(INPUT))
  ------------------
  |  Branch (239:10): [True: 31.9M, False: 688]
  |  Branch (239:19): [True: 31.9M, False: 10.7k]
  ------------------
  240|  31.9M|    name += INPUT.get();
  241|       |
  242|       |  // we need to have read SOMETHING!
  243|  11.3k|  if (name.empty())
  ------------------
  |  Branch (243:7): [True: 31, False: 11.3k]
  ------------------
  244|     31|    throw ParserException(INPUT.mark(), alias ? ErrorMsg::ALIAS_NOT_FOUND
  ------------------
  |  Branch (244:41): [True: 18, False: 13]
  ------------------
  245|     31|                                              : ErrorMsg::ANCHOR_NOT_FOUND);
  246|       |
  247|       |  // and needs to end correctly
  248|  11.3k|  if (INPUT && !Exp::AnchorEnd().Matches(INPUT))
  ------------------
  |  Branch (248:7): [True: 10.7k, False: 663]
  |  Branch (248:16): [True: 4, False: 10.7k]
  ------------------
  249|      4|    throw ParserException(INPUT.mark(), alias ? ErrorMsg::CHAR_IN_ALIAS
  ------------------
  |  Branch (249:41): [True: 2, False: 2]
  ------------------
  250|      4|                                              : ErrorMsg::CHAR_IN_ANCHOR);
  251|       |
  252|       |  // and we're done
  253|  11.3k|  Token token(alias ? Token::ALIAS : Token::ANCHOR, mark);
  ------------------
  |  Branch (253:15): [True: 2.10k, False: 9.25k]
  ------------------
  254|  11.3k|  token.value = name;
  255|  11.3k|  m_tokens.push(token);
  256|  11.3k|}
_ZN4YAML7Scanner7ScanTagEv:
  259|  1.08M|void Scanner::ScanTag() {
  260|       |  // insert a potential simple key
  261|  1.08M|  InsertPotentialSimpleKey();
  262|  1.08M|  m_simpleKeyAllowed = false;
  263|  1.08M|  m_canBeJSONFlow = false;
  264|       |
  265|  1.08M|  Token token(Token::TAG, INPUT.mark());
  266|       |
  267|       |  // eat the indicator
  268|  1.08M|  INPUT.get();
  269|       |
  270|  1.08M|  if (INPUT && INPUT.peek() == Keys::VerbatimTagStart) {
  ------------------
  |  Branch (270:7): [True: 1.08M, False: 202]
  |  Branch (270:16): [True: 670, False: 1.08M]
  ------------------
  271|    670|    std::string tag = ScanVerbatimTag(INPUT);
  272|       |
  273|    670|    token.value = tag;
  274|    670|    token.data = Tag::VERBATIM;
  275|  1.08M|  } else {
  276|  1.08M|    bool canBeHandle;
  277|  1.08M|    token.value = ScanTagHandle(INPUT, canBeHandle);
  278|  1.08M|    if (!canBeHandle && token.value.empty())
  ------------------
  |  Branch (278:9): [True: 1.08M, False: 3.63k]
  |  Branch (278:25): [True: 1.07M, False: 8.37k]
  ------------------
  279|  1.07M|      token.data = Tag::NON_SPECIFIC;
  280|  12.0k|    else if (token.value.empty())
  ------------------
  |  Branch (280:14): [True: 2.83k, False: 9.17k]
  ------------------
  281|  2.83k|      token.data = Tag::SECONDARY_HANDLE;
  282|  9.17k|    else
  283|  9.17k|      token.data = Tag::PRIMARY_HANDLE;
  284|       |
  285|       |    // is there a suffix?
  286|  1.08M|    if (canBeHandle && INPUT.peek() == Keys::Tag) {
  ------------------
  |  Branch (286:9): [True: 3.63k, False: 1.08M]
  |  Branch (286:24): [True: 3.38k, False: 244]
  ------------------
  287|       |      // eat the indicator
  288|  3.38k|      INPUT.get();
  289|  3.38k|      token.params.push_back(ScanTagSuffix(INPUT));
  290|  3.38k|      token.data = Tag::NAMED_HANDLE;
  291|  3.38k|    }
  292|  1.08M|  }
  293|       |
  294|  1.08M|  m_tokens.push(token);
  295|  1.08M|}
_ZN4YAML7Scanner15ScanPlainScalarEv:
  298|  1.90M|void Scanner::ScanPlainScalar() {
  299|  1.90M|  std::string scalar;
  300|       |
  301|       |  // set up the scanning parameters
  302|  1.90M|  ScanScalarParams params;
  303|  1.90M|  params.end =
  304|  1.90M|      (InFlowContext() ? &Exp::ScanScalarEndInFlow() : &Exp::ScanScalarEnd());
  ------------------
  |  Branch (304:8): [True: 840k, False: 1.06M]
  ------------------
  305|  1.90M|  params.eatEnd = false;
  306|  1.90M|  params.indent = (InFlowContext() ? 0 : GetTopIndent() + 1);
  ------------------
  |  Branch (306:20): [True: 840k, False: 1.06M]
  ------------------
  307|  1.90M|  params.fold = FOLD_FLOW;
  308|  1.90M|  params.eatLeadingWhitespace = true;
  309|  1.90M|  params.trimTrailingSpaces = true;
  310|  1.90M|  params.chomp = STRIP;
  311|  1.90M|  params.onDocIndicator = BREAK;
  312|  1.90M|  params.onTabInIndentation = THROW;
  313|       |
  314|       |  // insert a potential simple key
  315|  1.90M|  InsertPotentialSimpleKey();
  316|       |
  317|  1.90M|  Mark mark = INPUT.mark();
  318|  1.90M|  scalar = ScanScalar(INPUT, params);
  319|       |
  320|       |  // can have a simple key only if we ended the scalar by starting a new line
  321|  1.90M|  m_simpleKeyAllowed = params.leadingSpaces;
  322|  1.90M|  m_canBeJSONFlow = false;
  323|       |
  324|       |  // finally, check and see if we ended on an illegal character
  325|       |  // if(Exp::IllegalCharInScalar.Matches(INPUT))
  326|       |  //	throw ParserException(INPUT.mark(), ErrorMsg::CHAR_IN_SCALAR);
  327|       |
  328|  1.90M|  Token token(Token::PLAIN_SCALAR, mark);
  329|  1.90M|  token.value = scalar;
  330|  1.90M|  m_tokens.push(token);
  331|  1.90M|}
_ZN4YAML7Scanner16ScanQuotedScalarEv:
  334|  11.7k|void Scanner::ScanQuotedScalar() {
  335|  11.7k|  std::string scalar;
  336|       |
  337|       |  // peek at single or double quote (don't eat because we need to preserve (for
  338|       |  // the time being) the input position)
  339|  11.7k|  char quote = INPUT.peek();
  340|  11.7k|  bool single = (quote == '\'');
  341|       |
  342|       |  // setup the scanning parameters
  343|  11.7k|  ScanScalarParams params;
  344|  11.7k|  RegEx end = (single ? RegEx(quote) & !Exp::EscSingleQuote() : RegEx(quote));
  ------------------
  |  Branch (344:16): [True: 6.75k, False: 5.00k]
  ------------------
  345|  11.7k|  params.end = &end;
  346|  11.7k|  params.eatEnd = true;
  347|  11.7k|  params.escape = (single ? '\'' : '\\');
  ------------------
  |  Branch (347:20): [True: 6.75k, False: 5.00k]
  ------------------
  348|  11.7k|  params.indent = 0;
  349|  11.7k|  params.fold = FOLD_FLOW;
  350|  11.7k|  params.eatLeadingWhitespace = true;
  351|  11.7k|  params.trimTrailingSpaces = false;
  352|  11.7k|  params.chomp = CLIP;
  353|  11.7k|  params.onDocIndicator = THROW;
  354|       |
  355|       |  // insert a potential simple key
  356|  11.7k|  InsertPotentialSimpleKey();
  357|       |
  358|  11.7k|  Mark mark = INPUT.mark();
  359|       |
  360|       |  // now eat that opening quote
  361|  11.7k|  INPUT.get();
  362|       |
  363|       |  // and scan
  364|  11.7k|  scalar = ScanScalar(INPUT, params);
  365|  11.7k|  m_simpleKeyAllowed = false;
  366|       |  // we just scanned a quoted scalar;
  367|       |  // we can only have another scalar in this line
  368|       |  // if we are in a flow, eg: `[ "foo", "bar" ]` is ok, but `"foo", "bar"` isn't.
  369|  11.7k|  m_scalarValueAllowed = InFlowContext();
  370|  11.7k|  m_canBeJSONFlow = true;
  371|       |
  372|  11.7k|  Token token(Token::NON_PLAIN_SCALAR, mark);
  373|  11.7k|  token.value = scalar;
  374|  11.7k|  m_tokens.push(token);
  375|  11.7k|}
_ZN4YAML7Scanner15ScanBlockScalarEv:
  382|  4.29k|void Scanner::ScanBlockScalar() {
  383|  4.29k|  std::string scalar;
  384|       |
  385|  4.29k|  ScanScalarParams params;
  386|  4.29k|  params.indent = 1;
  387|  4.29k|  params.detectIndent = true;
  388|       |
  389|       |  // eat block indicator ('|' or '>')
  390|  4.29k|  Mark mark = INPUT.mark();
  391|  4.29k|  char indicator = INPUT.get();
  392|  4.29k|  params.fold = (indicator == Keys::FoldedScalar ? FOLD_BLOCK : DONT_FOLD);
  ------------------
  |  Branch (392:18): [True: 3.65k, False: 634]
  ------------------
  393|       |
  394|       |  // eat chomping/indentation indicators
  395|  4.29k|  params.chomp = CLIP;
  396|  4.29k|  int n = Exp::Chomp().Match(INPUT);
  397|  5.48k|  for (int i = 0; i < n; i++) {
  ------------------
  |  Branch (397:19): [True: 1.19k, False: 4.28k]
  ------------------
  398|  1.19k|    char ch = INPUT.get();
  399|  1.19k|    if (ch == '+')
  ------------------
  |  Branch (399:9): [True: 527, False: 664]
  ------------------
  400|    527|      params.chomp = KEEP;
  401|    664|    else if (ch == '-')
  ------------------
  |  Branch (401:14): [True: 229, False: 435]
  ------------------
  402|    229|      params.chomp = STRIP;
  403|    435|    else if (Exp::Digit().Matches(ch)) {
  ------------------
  |  Branch (403:14): [True: 435, False: 0]
  ------------------
  404|    435|      if (ch == '0')
  ------------------
  |  Branch (404:11): [True: 3, False: 432]
  ------------------
  405|      3|        throw ParserException(INPUT.mark(), ErrorMsg::ZERO_INDENT_IN_BLOCK);
  406|       |
  407|    432|      params.indent = ch - '0';
  408|    432|      params.detectIndent = false;
  409|    432|    }
  410|  1.19k|  }
  411|       |
  412|       |  // now eat whitespace
  413|  4.67k|  while (Exp::Blank().Matches(INPUT))
  ------------------
  |  Branch (413:10): [True: 385, False: 4.28k]
  ------------------
  414|    385|    INPUT.eat(1);
  415|       |
  416|       |  // and comments to the end of the line
  417|  4.28k|  if (Exp::Comment().Matches(INPUT))
  ------------------
  |  Branch (417:7): [True: 236, False: 4.05k]
  ------------------
  418|  1.19M|    while (INPUT && !Exp::Break().Matches(INPUT))
  ------------------
  |  Branch (418:12): [True: 1.19M, False: 10]
  |  Branch (418:21): [True: 1.19M, False: 226]
  ------------------
  419|  1.19M|      INPUT.eat(1);
  420|       |
  421|       |  // if it's not a line break, then we ran into a bad character inline
  422|  4.28k|  if (INPUT && !Exp::Break().Matches(INPUT))
  ------------------
  |  Branch (422:7): [True: 4.16k, False: 123]
  |  Branch (422:16): [True: 53, False: 4.11k]
  ------------------
  423|     53|    throw ParserException(INPUT.mark(), ErrorMsg::CHAR_IN_BLOCK);
  424|       |
  425|       |  // set the initial indentation
  426|  4.23k|  if (GetTopIndent() >= 0)
  ------------------
  |  Branch (426:7): [True: 1.73k, False: 2.50k]
  ------------------
  427|  1.73k|    params.indent += GetTopIndent();
  428|       |
  429|  4.23k|  params.eatLeadingWhitespace = false;
  430|  4.23k|  params.trimTrailingSpaces = false;
  431|  4.23k|  params.onTabInIndentation = THROW;
  432|       |
  433|  4.23k|  scalar = ScanScalar(INPUT, params);
  434|       |
  435|       |  // simple keys always ok after block scalars (since we're gonna start a new
  436|       |  // line anyways)
  437|  4.23k|  m_simpleKeyAllowed = true;
  438|  4.23k|  m_canBeJSONFlow = false;
  439|       |
  440|  4.23k|  Token token(Token::NON_PLAIN_SCALAR, mark);
  441|  4.23k|  token.value = scalar;
  442|  4.23k|  m_tokens.push(token);
  443|  4.23k|}

_ZN4YAML7Scanner9SimpleKeyC2ERKNS_4MarkEm:
    8|  53.7M|    : mark(mark_),
    9|  53.7M|      flowLevel(flowLevel_),
   10|  53.7M|      pIndent(nullptr),
   11|  53.7M|      pMapStart(nullptr),
   12|  53.7M|      pKey(nullptr) {}
_ZN4YAML7Scanner9SimpleKey8ValidateEv:
   14|   785k|void Scanner::SimpleKey::Validate() {
   15|       |  // Note: pIndent will *not* be garbage here;
   16|       |  //       we "garbage collect" them so we can
   17|       |  //       always refer to them
   18|   785k|  if (pIndent)
  ------------------
  |  Branch (18:7): [True: 40.2k, False: 745k]
  ------------------
   19|  40.2k|    pIndent->status = IndentMarker::VALID;
   20|   785k|  if (pMapStart)
  ------------------
  |  Branch (20:7): [True: 40.2k, False: 745k]
  ------------------
   21|  40.2k|    pMapStart->status = Token::VALID;
   22|   785k|  if (pKey)
  ------------------
  |  Branch (22:7): [True: 785k, False: 0]
  ------------------
   23|   785k|    pKey->status = Token::VALID;
   24|   785k|}
_ZN4YAML7Scanner9SimpleKey10InvalidateEv:
   26|  2.70M|void Scanner::SimpleKey::Invalidate() {
   27|  2.70M|  if (pIndent)
  ------------------
  |  Branch (27:7): [True: 2.08M, False: 619k]
  ------------------
   28|  2.08M|    pIndent->status = IndentMarker::INVALID;
   29|  2.70M|  if (pMapStart)
  ------------------
  |  Branch (29:7): [True: 2.08M, False: 619k]
  ------------------
   30|  2.08M|    pMapStart->status = Token::INVALID;
   31|  2.70M|  if (pKey)
  ------------------
  |  Branch (31:7): [True: 2.70M, False: 0]
  ------------------
   32|  2.70M|    pKey->status = Token::INVALID;
   33|  2.70M|}
_ZNK4YAML7Scanner27CanInsertPotentialSimpleKeyEv:
   36|  53.8M|bool Scanner::CanInsertPotentialSimpleKey() const {
   37|  53.8M|  if (!m_simpleKeyAllowed)
  ------------------
  |  Branch (37:7): [True: 156k, False: 53.7M]
  ------------------
   38|   156k|    return false;
   39|       |
   40|  53.7M|  return !ExistsActiveSimpleKey();
   41|  53.8M|}
_ZNK4YAML7Scanner21ExistsActiveSimpleKeyEv:
   47|  53.7M|bool Scanner::ExistsActiveSimpleKey() const {
   48|  53.7M|  if (m_simpleKeys.empty())
  ------------------
  |  Branch (48:7): [True: 2.14M, False: 51.5M]
  ------------------
   49|  2.14M|    return false;
   50|       |
   51|  51.5M|  const SimpleKey& key = m_simpleKeys.top();
   52|  51.5M|  return key.flowLevel == GetFlowLevel();
   53|  53.7M|}
_ZN4YAML7Scanner24InsertPotentialSimpleKeyEv:
   58|  53.8M|void Scanner::InsertPotentialSimpleKey() {
   59|  53.8M|  if (!CanInsertPotentialSimpleKey())
  ------------------
  |  Branch (59:7): [True: 161k, False: 53.7M]
  ------------------
   60|   161k|    return;
   61|       |
   62|  53.7M|  SimpleKey key(INPUT.mark(), GetFlowLevel());
   63|       |
   64|       |  // first add a map start, if necessary
   65|  53.7M|  if (InBlockContext()) {
  ------------------
  |  Branch (65:7): [True: 2.13M, False: 51.5M]
  ------------------
   66|  2.13M|    key.pIndent = PushIndentTo(INPUT.column(), IndentMarker::MAP);
   67|  2.13M|    if (key.pIndent) {
  ------------------
  |  Branch (67:9): [True: 2.12M, False: 6.41k]
  ------------------
   68|  2.12M|      key.pIndent->status = IndentMarker::UNKNOWN;
   69|  2.12M|      key.pMapStart = key.pIndent->pStartToken;
   70|  2.12M|      key.pMapStart->status = Token::UNVERIFIED;
   71|  2.12M|    }
   72|  2.13M|  }
   73|       |
   74|       |  // then add the (now unverified) key
   75|  53.7M|  m_tokens.push(Token(Token::KEY, INPUT.mark()));
   76|  53.7M|  key.pKey = &m_tokens.back();
   77|  53.7M|  key.pKey->status = Token::UNVERIFIED;
   78|       |
   79|  53.7M|  m_simpleKeys.push(key);
   80|  53.7M|}
_ZN4YAML7Scanner19InvalidateSimpleKeyEv:
   84|  11.7M|void Scanner::InvalidateSimpleKey() {
   85|  11.7M|  if (m_simpleKeys.empty())
  ------------------
  |  Branch (85:7): [True: 8.56M, False: 3.20M]
  ------------------
   86|  8.56M|    return;
   87|       |
   88|       |  // grab top key
   89|  3.20M|  SimpleKey& key = m_simpleKeys.top();
   90|  3.20M|  if (key.flowLevel != GetFlowLevel())
  ------------------
  |  Branch (90:7): [True: 1.07M, False: 2.13M]
  ------------------
   91|  1.07M|    return;
   92|       |
   93|  2.13M|  key.Invalidate();
   94|  2.13M|  m_simpleKeys.pop();
   95|  2.13M|}
_ZN4YAML7Scanner15VerifySimpleKeyEv:
  100|  9.38M|bool Scanner::VerifySimpleKey() {
  101|  9.38M|  if (m_simpleKeys.empty())
  ------------------
  |  Branch (101:7): [True: 6.97M, False: 2.40M]
  ------------------
  102|  6.97M|    return false;
  103|       |
  104|       |  // grab top key
  105|  2.40M|  SimpleKey key = m_simpleKeys.top();
  106|       |
  107|       |  // only validate if we're in the correct flow level
  108|  2.40M|  if (key.flowLevel != GetFlowLevel())
  ------------------
  |  Branch (108:7): [True: 1.05M, False: 1.35M]
  ------------------
  109|  1.05M|    return false;
  110|       |
  111|  1.35M|  m_simpleKeys.pop();
  112|       |
  113|  1.35M|  bool isValid = true;
  114|       |
  115|       |  // needs to be less than 1024 characters and inline
  116|  1.35M|  if (INPUT.line() != key.mark.line || INPUT.pos() - key.mark.pos > 1024)
  ------------------
  |  Branch (116:7): [True: 818, False: 1.35M]
  |  Branch (116:40): [True: 571k, False: 785k]
  ------------------
  117|   572k|    isValid = false;
  118|       |
  119|       |  // invalidate key
  120|  1.35M|  if (isValid)
  ------------------
  |  Branch (120:7): [True: 785k, False: 572k]
  ------------------
  121|   785k|    key.Validate();
  122|   572k|  else
  123|   572k|    key.Invalidate();
  124|       |
  125|  1.35M|  return isValid;
  126|  2.40M|}
_ZN4YAML7Scanner16PopAllSimpleKeysEv:
  128|   392k|void Scanner::PopAllSimpleKeys() {
  129|  44.7M|  while (!m_simpleKeys.empty())
  ------------------
  |  Branch (129:10): [True: 44.3M, False: 392k]
  ------------------
  130|  44.3M|    m_simpleKeys.pop();
  131|   392k|}

_ZN4YAML15SingleDocParserC2ERNS_7ScannerERKNS_10DirectivesE:
   18|   355k|    : m_scanner(scanner),
   19|   355k|      m_directives(directives),
   20|   355k|      m_pCollectionStack(new CollectionStack),
   21|   355k|      m_anchors{},
   22|   355k|      m_curAnchor(0) {}
_ZN4YAML15SingleDocParserD2Ev:
   24|   355k|SingleDocParser::~SingleDocParser() = default;
_ZN4YAML15SingleDocParser14HandleDocumentERNS_12EventHandlerE:
   29|   355k|void SingleDocParser::HandleDocument(EventHandler& eventHandler) {
   30|   355k|  assert(!m_scanner.empty());  // guaranteed that there are tokens
   31|   355k|  assert(!m_curAnchor);
   32|       |
   33|   355k|  eventHandler.OnDocumentStart(m_scanner.peek().mark);
   34|       |
   35|       |  // eat doc start
   36|   355k|  if (m_scanner.peek().type == Token::DOC_START)
  ------------------
  |  Branch (36:7): [True: 9.11k, False: 346k]
  ------------------
   37|  9.11k|    m_scanner.pop();
   38|       |
   39|       |  // recurse!
   40|   355k|  HandleNode(eventHandler);
   41|       |
   42|   355k|  eventHandler.OnDocumentEnd();
   43|       |
   44|       |  // check if any tokens left after the text
   45|   355k|  if (!m_scanner.empty() && m_scanner.peek().type != Token::DOC_END
  ------------------
  |  Branch (45:7): [True: 350k, False: 5.03k]
  |  Branch (45:29): [True: 9.47k, False: 340k]
  ------------------
   46|  9.47k|      && m_scanner.peek().type != Token::DOC_START)
  ------------------
  |  Branch (46:10): [True: 389, False: 9.08k]
  ------------------
   47|    389|    throw ParserException(m_scanner.mark(), ErrorMsg::UNEXPECTED_TOKEN_AFTER_DOC);
   48|       |
   49|       |  // and finally eat any doc ends we see
   50|   354k|  if (!m_scanner.empty() && m_scanner.peek().type == Token::DOC_END)
  ------------------
  |  Branch (50:7): [True: 349k, False: 5.03k]
  |  Branch (50:29): [True: 340k, False: 9.08k]
  ------------------
   51|   340k|    m_scanner.pop();
   52|   354k|}
_ZN4YAML15SingleDocParser10HandleNodeERNS_12EventHandlerE:
   54|  1.72M|void SingleDocParser::HandleNode(EventHandler& eventHandler) {
   55|  1.72M|  DepthGuard<500> depthguard(depth, m_scanner.mark(), ErrorMsg::BAD_FILE);
   56|       |
   57|       |  // an empty node *is* a possibility
   58|  1.72M|  if (m_scanner.empty()) {
  ------------------
  |  Branch (58:7): [True: 79, False: 1.72M]
  ------------------
   59|     79|    eventHandler.OnNull(m_scanner.mark(), NullAnchor);
   60|     79|    return;
   61|     79|  }
   62|       |
   63|       |  // save location
   64|  1.72M|  Mark mark = m_scanner.peek().mark;
   65|       |
   66|       |  // special case: a value node by itself must be a map, with no header
   67|  1.72M|  if (m_scanner.peek().type == Token::VALUE) {
  ------------------
  |  Branch (67:7): [True: 23.6k, False: 1.69M]
  ------------------
   68|  23.6k|    eventHandler.OnMapStart(mark, "?", NullAnchor, EmitterStyle::Default);
   69|  23.6k|    HandleMap(eventHandler);
   70|  23.6k|    eventHandler.OnMapEnd();
   71|  23.6k|    return;
   72|  23.6k|  }
   73|       |
   74|       |  // special case: an alias node
   75|  1.69M|  if (m_scanner.peek().type == Token::ALIAS) {
  ------------------
  |  Branch (75:7): [True: 1.41k, False: 1.69M]
  ------------------
   76|  1.41k|    eventHandler.OnAlias(mark, LookupAnchor(mark, m_scanner.peek().value));
   77|  1.41k|    m_scanner.pop();
   78|  1.41k|    return;
   79|  1.41k|  }
   80|       |
   81|  1.69M|  std::string tag;
   82|  1.69M|  std::string anchor_name;
   83|  1.69M|  anchor_t anchor;
   84|  1.69M|  ParseProperties(tag, anchor, anchor_name);
   85|       |
   86|  1.69M|  if (!anchor_name.empty())
  ------------------
  |  Branch (86:7): [True: 8.13k, False: 1.68M]
  ------------------
   87|  8.13k|    eventHandler.OnAnchor(mark, anchor_name);
   88|       |
   89|       |  // after parsing properties, an empty node is again a possibility
   90|  1.69M|  if (m_scanner.empty()) {
  ------------------
  |  Branch (90:7): [True: 745, False: 1.69M]
  ------------------
   91|    745|    eventHandler.OnNull(mark, anchor);
   92|    745|    return;
   93|    745|  }
   94|       |
   95|  1.69M|  const Token& token = m_scanner.peek();
   96|       |
   97|       |  // add non-specific tags
   98|  1.69M|  if (tag.empty())
  ------------------
  |  Branch (98:7): [True: 1.68M, False: 8.15k]
  ------------------
   99|  1.68M|    tag = (token.type == Token::NON_PLAIN_SCALAR ? "!" : "?");
  ------------------
  |  Branch (99:12): [True: 1.52k, False: 1.68M]
  ------------------
  100|       |
  101|  1.69M|  if (token.type == Token::PLAIN_SCALAR
  ------------------
  |  Branch (101:7): [True: 58.3k, False: 1.63M]
  ------------------
  102|  58.3k|      && tag == "?" && IsNullString(token.value.data(), token.value.size())) {
  ------------------
  |  Branch (102:10): [True: 57.4k, False: 898]
  |  Branch (102:24): [True: 29.0k, False: 28.3k]
  ------------------
  103|  29.0k|    eventHandler.OnNull(mark, anchor);
  104|  29.0k|    m_scanner.pop();
  105|  29.0k|    return;
  106|  29.0k|  }
  107|       |
  108|       |  // now split based on what kind of node we should be
  109|  1.66M|  switch (token.type) {
  110|  29.2k|    case Token::PLAIN_SCALAR:
  ------------------
  |  Branch (110:5): [True: 29.2k, False: 1.63M]
  ------------------
  111|  30.8k|    case Token::NON_PLAIN_SCALAR:
  ------------------
  |  Branch (111:5): [True: 1.54k, False: 1.66M]
  ------------------
  112|  30.8k|      eventHandler.OnScalar(mark, tag, anchor, token.value);
  113|  30.8k|      m_scanner.pop();
  114|  30.8k|      return;
  115|  44.0k|    case Token::FLOW_SEQ_START:
  ------------------
  |  Branch (115:5): [True: 44.0k, False: 1.62M]
  ------------------
  116|  44.0k|      eventHandler.OnSequenceStart(mark, tag, anchor, EmitterStyle::Flow);
  117|  44.0k|      HandleSequence(eventHandler);
  118|  44.0k|      eventHandler.OnSequenceEnd();
  119|  44.0k|      return;
  120|  6.09k|    case Token::BLOCK_SEQ_START:
  ------------------
  |  Branch (120:5): [True: 6.09k, False: 1.66M]
  ------------------
  121|  6.09k|      eventHandler.OnSequenceStart(mark, tag, anchor, EmitterStyle::Block);
  122|  6.09k|      HandleSequence(eventHandler);
  123|  6.09k|      eventHandler.OnSequenceEnd();
  124|  6.09k|      return;
  125|  64.1k|    case Token::FLOW_MAP_START:
  ------------------
  |  Branch (125:5): [True: 64.1k, False: 1.60M]
  ------------------
  126|  64.1k|      eventHandler.OnMapStart(mark, tag, anchor, EmitterStyle::Flow);
  127|  64.1k|      HandleMap(eventHandler);
  128|  64.1k|      eventHandler.OnMapEnd();
  129|  64.1k|      return;
  130|  32.9k|    case Token::BLOCK_MAP_START:
  ------------------
  |  Branch (130:5): [True: 32.9k, False: 1.63M]
  ------------------
  131|  32.9k|      eventHandler.OnMapStart(mark, tag, anchor, EmitterStyle::Block);
  132|  32.9k|      HandleMap(eventHandler);
  133|  32.9k|      eventHandler.OnMapEnd();
  134|  32.9k|      return;
  135|  45.5k|    case Token::KEY:
  ------------------
  |  Branch (135:5): [True: 45.5k, False: 1.62M]
  ------------------
  136|       |      // compact maps can only go in a flow sequence
  137|  45.5k|      if (m_pCollectionStack->GetCurCollectionType() ==
  ------------------
  |  Branch (137:11): [True: 42.9k, False: 2.61k]
  ------------------
  138|  45.5k|          CollectionType::FlowSeq) {
  139|  42.9k|        eventHandler.OnMapStart(mark, tag, anchor, EmitterStyle::Flow);
  140|  42.9k|        HandleMap(eventHandler);
  141|  42.9k|        eventHandler.OnMapEnd();
  142|  42.9k|        return;
  143|  42.9k|      }
  144|  2.61k|      break;
  145|  1.44M|    default:
  ------------------
  |  Branch (145:5): [True: 1.44M, False: 223k]
  ------------------
  146|  1.44M|      break;
  147|  1.66M|  }
  148|       |
  149|  1.44M|  if (tag == "?")
  ------------------
  |  Branch (149:7): [True: 1.44M, False: 3.42k]
  ------------------
  150|  1.44M|    eventHandler.OnNull(mark, anchor);
  151|  3.42k|  else
  152|  3.42k|    eventHandler.OnScalar(mark, tag, anchor, "");
  153|  1.44M|}
_ZN4YAML15SingleDocParser14HandleSequenceERNS_12EventHandlerE:
  155|  50.1k|void SingleDocParser::HandleSequence(EventHandler& eventHandler) {
  156|       |  // split based on start token
  157|  50.1k|  switch (m_scanner.peek().type) {
  158|  6.09k|    case Token::BLOCK_SEQ_START:
  ------------------
  |  Branch (158:5): [True: 6.09k, False: 44.0k]
  ------------------
  159|  6.09k|      HandleBlockSequence(eventHandler);
  160|  6.09k|      break;
  161|  44.0k|    case Token::FLOW_SEQ_START:
  ------------------
  |  Branch (161:5): [True: 44.0k, False: 6.09k]
  ------------------
  162|  44.0k|      HandleFlowSequence(eventHandler);
  163|  44.0k|      break;
  164|      0|    default:
  ------------------
  |  Branch (164:5): [True: 0, False: 50.1k]
  ------------------
  165|      0|      break;
  166|  50.1k|  }
  167|  50.1k|}
_ZN4YAML15SingleDocParser19HandleBlockSequenceERNS_12EventHandlerE:
  169|  6.09k|void SingleDocParser::HandleBlockSequence(EventHandler& eventHandler) {
  170|       |  // eat start token
  171|  6.09k|  m_scanner.pop();
  172|  6.09k|  m_pCollectionStack->PushCollectionType(CollectionType::BlockSeq);
  173|       |
  174|  13.1k|  while (true) {
  ------------------
  |  Branch (174:10): [True: 11.7k, Folded]
  ------------------
  175|  11.7k|    if (m_scanner.empty())
  ------------------
  |  Branch (175:9): [True: 0, False: 11.7k]
  ------------------
  176|      0|      throw ParserException(m_scanner.mark(), ErrorMsg::END_OF_SEQ);
  177|       |
  178|  11.7k|    Token token = m_scanner.peek();
  179|  11.7k|    if (token.type != Token::BLOCK_ENTRY && token.type != Token::BLOCK_SEQ_END)
  ------------------
  |  Branch (179:9): [True: 4.71k, False: 7.07k]
  |  Branch (179:45): [True: 10, False: 4.70k]
  ------------------
  180|     10|      throw ParserException(token.mark, ErrorMsg::END_OF_SEQ);
  181|       |
  182|  11.7k|    m_scanner.pop();
  183|  11.7k|    if (token.type == Token::BLOCK_SEQ_END)
  ------------------
  |  Branch (183:9): [True: 4.70k, False: 7.07k]
  ------------------
  184|  4.70k|      break;
  185|       |
  186|       |    // check for null
  187|  7.07k|    if (!m_scanner.empty()) {
  ------------------
  |  Branch (187:9): [True: 7.04k, False: 33]
  ------------------
  188|  7.04k|      const Token& nextToken = m_scanner.peek();
  189|  7.04k|      if (nextToken.type == Token::BLOCK_ENTRY ||
  ------------------
  |  Branch (189:11): [True: 787, False: 6.25k]
  ------------------
  190|  6.25k|          nextToken.type == Token::BLOCK_SEQ_END) {
  ------------------
  |  Branch (190:11): [True: 1.86k, False: 4.39k]
  ------------------
  191|  2.64k|        eventHandler.OnNull(nextToken.mark, NullAnchor);
  192|  2.64k|        continue;
  193|  2.64k|      }
  194|  7.04k|    }
  195|       |
  196|  4.42k|    HandleNode(eventHandler);
  197|  4.42k|  }
  198|       |
  199|  6.08k|  m_pCollectionStack->PopCollectionType(CollectionType::BlockSeq);
  200|  6.08k|}
_ZN4YAML15SingleDocParser18HandleFlowSequenceERNS_12EventHandlerE:
  202|  44.0k|void SingleDocParser::HandleFlowSequence(EventHandler& eventHandler) {
  203|       |  // eat start token
  204|  44.0k|  m_scanner.pop();
  205|  44.0k|  m_pCollectionStack->PushCollectionType(CollectionType::FlowSeq);
  206|       |
  207|  1.15M|  while (true) {
  ------------------
  |  Branch (207:10): [True: 1.11M, Folded]
  ------------------
  208|  1.11M|    if (m_scanner.empty())
  ------------------
  |  Branch (208:9): [True: 192, False: 1.11M]
  ------------------
  209|    192|      throw ParserException(m_scanner.mark(), ErrorMsg::END_OF_SEQ_FLOW);
  210|       |
  211|       |    // first check for end
  212|  1.11M|    if (m_scanner.peek().type == Token::FLOW_SEQ_END) {
  ------------------
  |  Branch (212:9): [True: 1.06k, False: 1.11M]
  ------------------
  213|  1.06k|      m_scanner.pop();
  214|  1.06k|      break;
  215|  1.06k|    }
  216|       |
  217|       |    // then read the node
  218|  1.11M|    HandleNode(eventHandler);
  219|       |
  220|  1.11M|    if (m_scanner.empty())
  ------------------
  |  Branch (220:9): [True: 745, False: 1.11M]
  ------------------
  221|    745|      throw ParserException(m_scanner.mark(), ErrorMsg::END_OF_SEQ_FLOW);
  222|       |
  223|       |    // now eat the separator (or could be a sequence end, which we ignore - but
  224|       |    // if it's neither, then it's a bad node)
  225|  1.11M|    Token& token = m_scanner.peek();
  226|  1.11M|    if (token.type == Token::FLOW_ENTRY)
  ------------------
  |  Branch (226:9): [True: 1.06M, False: 42.9k]
  ------------------
  227|  1.06M|      m_scanner.pop();
  228|  42.9k|    else if (token.type != Token::FLOW_SEQ_END)
  ------------------
  |  Branch (228:14): [True: 232, False: 42.7k]
  ------------------
  229|    232|      throw ParserException(token.mark, ErrorMsg::END_OF_SEQ_FLOW);
  230|  1.11M|  }
  231|       |
  232|  42.9k|  m_pCollectionStack->PopCollectionType(CollectionType::FlowSeq);
  233|  42.9k|}
_ZN4YAML15SingleDocParser9HandleMapERNS_12EventHandlerE:
  235|   163k|void SingleDocParser::HandleMap(EventHandler& eventHandler) {
  236|       |  // split based on start token
  237|   163k|  switch (m_scanner.peek().type) {
  238|  32.9k|    case Token::BLOCK_MAP_START:
  ------------------
  |  Branch (238:5): [True: 32.9k, False: 130k]
  ------------------
  239|  32.9k|      HandleBlockMap(eventHandler);
  240|  32.9k|      break;
  241|  64.1k|    case Token::FLOW_MAP_START:
  ------------------
  |  Branch (241:5): [True: 64.1k, False: 99.5k]
  ------------------
  242|  64.1k|      HandleFlowMap(eventHandler);
  243|  64.1k|      break;
  244|  42.9k|    case Token::KEY:
  ------------------
  |  Branch (244:5): [True: 42.9k, False: 120k]
  ------------------
  245|  42.9k|      HandleCompactMap(eventHandler);
  246|  42.9k|      break;
  247|  23.6k|    case Token::VALUE:
  ------------------
  |  Branch (247:5): [True: 23.6k, False: 140k]
  ------------------
  248|  23.6k|      HandleCompactMapWithNoKey(eventHandler);
  249|  23.6k|      break;
  250|      0|    default:
  ------------------
  |  Branch (250:5): [True: 0, False: 163k]
  ------------------
  251|      0|      break;
  252|   163k|  }
  253|   163k|}
_ZN4YAML15SingleDocParser14HandleBlockMapERNS_12EventHandlerE:
  255|  32.9k|void SingleDocParser::HandleBlockMap(EventHandler& eventHandler) {
  256|       |  // eat start token
  257|  32.9k|  m_scanner.pop();
  258|  32.9k|  m_pCollectionStack->PushCollectionType(CollectionType::BlockMap);
  259|       |
  260|  73.4k|  while (true) {
  ------------------
  |  Branch (260:10): [True: 70.2k, Folded]
  ------------------
  261|  70.2k|    if (m_scanner.empty())
  ------------------
  |  Branch (261:9): [True: 0, False: 70.2k]
  ------------------
  262|      0|      throw ParserException(m_scanner.mark(), ErrorMsg::END_OF_MAP);
  263|       |
  264|  70.2k|    Token token = m_scanner.peek();
  265|  70.2k|    if (token.type != Token::KEY && token.type != Token::VALUE &&
  ------------------
  |  Branch (265:9): [True: 44.1k, False: 26.0k]
  |  Branch (265:37): [True: 29.6k, False: 14.4k]
  ------------------
  266|  29.6k|        token.type != Token::BLOCK_MAP_END)
  ------------------
  |  Branch (266:9): [True: 91, False: 29.5k]
  ------------------
  267|     91|      throw ParserException(token.mark, ErrorMsg::END_OF_MAP);
  268|       |
  269|  70.1k|    if (token.type == Token::BLOCK_MAP_END) {
  ------------------
  |  Branch (269:9): [True: 29.5k, False: 40.5k]
  ------------------
  270|  29.5k|      m_scanner.pop();
  271|  29.5k|      break;
  272|  29.5k|    }
  273|       |
  274|       |    // grab key (if non-null)
  275|  40.5k|    if (token.type == Token::KEY) {
  ------------------
  |  Branch (275:9): [True: 26.0k, False: 14.4k]
  ------------------
  276|  26.0k|      m_scanner.pop();
  277|  26.0k|      HandleNode(eventHandler);
  278|  26.0k|    } else {
  279|  14.4k|      eventHandler.OnNull(token.mark, NullAnchor);
  280|  14.4k|    }
  281|       |
  282|       |    // now grab value (optional)
  283|  40.5k|    if (!m_scanner.empty() && m_scanner.peek().type == Token::VALUE) {
  ------------------
  |  Branch (283:9): [True: 37.8k, False: 2.74k]
  |  Branch (283:31): [True: 26.5k, False: 11.2k]
  ------------------
  284|  26.5k|      m_scanner.pop();
  285|  26.5k|      HandleNode(eventHandler);
  286|  26.5k|    } else {
  287|  14.0k|      eventHandler.OnNull(token.mark, NullAnchor);
  288|  14.0k|    }
  289|  40.5k|  }
  290|       |
  291|  32.8k|  m_pCollectionStack->PopCollectionType(CollectionType::BlockMap);
  292|  32.8k|}
_ZN4YAML15SingleDocParser13HandleFlowMapERNS_12EventHandlerE:
  294|  64.1k|void SingleDocParser::HandleFlowMap(EventHandler& eventHandler) {
  295|       |  // eat start token
  296|  64.1k|  m_scanner.pop();
  297|  64.1k|  m_pCollectionStack->PushCollectionType(CollectionType::FlowMap);
  298|       |
  299|  1.21M|  while (true) {
  ------------------
  |  Branch (299:10): [True: 1.15M, Folded]
  ------------------
  300|  1.15M|    if (m_scanner.empty())
  ------------------
  |  Branch (300:9): [True: 168, False: 1.15M]
  ------------------
  301|    168|      throw ParserException(m_scanner.mark(), ErrorMsg::END_OF_MAP_FLOW);
  302|       |
  303|  1.15M|    Token& token = m_scanner.peek();
  304|  1.15M|    const Mark mark = token.mark;
  305|       |    // first check for end
  306|  1.15M|    if (token.type == Token::FLOW_MAP_END) {
  ------------------
  |  Branch (306:9): [True: 2.20k, False: 1.14M]
  ------------------
  307|  2.20k|      m_scanner.pop();
  308|  2.20k|      break;
  309|  2.20k|    }
  310|       |
  311|       |    // grab key (if non-null)
  312|  1.14M|    if (token.type == Token::KEY) {
  ------------------
  |  Branch (312:9): [True: 95.9k, False: 1.05M]
  ------------------
  313|  95.9k|      m_scanner.pop();
  314|  95.9k|      HandleNode(eventHandler);
  315|  1.05M|    } else {
  316|  1.05M|      eventHandler.OnNull(mark, NullAnchor);
  317|  1.05M|    }
  318|       |
  319|       |    // now grab value (optional)
  320|  1.14M|    if (!m_scanner.empty() && m_scanner.peek().type == Token::VALUE) {
  ------------------
  |  Branch (320:9): [True: 1.08M, False: 61.5k]
  |  Branch (320:31): [True: 34.2k, False: 1.05M]
  ------------------
  321|  34.2k|      m_scanner.pop();
  322|  34.2k|      HandleNode(eventHandler);
  323|  1.11M|    } else {
  324|  1.11M|      eventHandler.OnNull(mark, NullAnchor);
  325|  1.11M|    }
  326|       |
  327|  1.14M|    if (m_scanner.empty())
  ------------------
  |  Branch (327:9): [True: 332, False: 1.14M]
  ------------------
  328|    332|      throw ParserException(m_scanner.mark(), ErrorMsg::END_OF_MAP_FLOW);
  329|       |
  330|       |    // now eat the separator (or could be a map end, which we ignore - but if
  331|       |    // it's neither, then it's a bad node)
  332|  1.14M|    Token& nextToken = m_scanner.peek();
  333|  1.14M|    if (nextToken.type == Token::FLOW_ENTRY)
  ------------------
  |  Branch (333:9): [True: 1.08M, False: 63.2k]
  ------------------
  334|  1.08M|      m_scanner.pop();
  335|  63.2k|    else if (nextToken.type != Token::FLOW_MAP_END)
  ------------------
  |  Branch (335:14): [True: 175, False: 63.0k]
  ------------------
  336|    175|      throw ParserException(nextToken.mark, ErrorMsg::END_OF_MAP_FLOW);
  337|  1.14M|  }
  338|       |
  339|  63.4k|  m_pCollectionStack->PopCollectionType(CollectionType::FlowMap);
  340|  63.4k|}
_ZN4YAML15SingleDocParser16HandleCompactMapERNS_12EventHandlerE:
  343|  42.9k|void SingleDocParser::HandleCompactMap(EventHandler& eventHandler) {
  344|  42.9k|  m_pCollectionStack->PushCollectionType(CollectionType::CompactMap);
  345|       |
  346|       |  // grab key
  347|  42.9k|  Mark mark = m_scanner.peek().mark;
  348|  42.9k|  m_scanner.pop();
  349|  42.9k|  HandleNode(eventHandler);
  350|       |
  351|       |  // now grab value (optional)
  352|  42.9k|  if (!m_scanner.empty() && m_scanner.peek().type == Token::VALUE) {
  ------------------
  |  Branch (352:7): [True: 835, False: 42.0k]
  |  Branch (352:29): [True: 433, False: 402]
  ------------------
  353|    433|    m_scanner.pop();
  354|    433|    HandleNode(eventHandler);
  355|  42.5k|  } else {
  356|  42.5k|    eventHandler.OnNull(mark, NullAnchor);
  357|  42.5k|  }
  358|       |
  359|  42.9k|  m_pCollectionStack->PopCollectionType(CollectionType::CompactMap);
  360|  42.9k|}
_ZN4YAML15SingleDocParser25HandleCompactMapWithNoKeyERNS_12EventHandlerE:
  363|  23.6k|void SingleDocParser::HandleCompactMapWithNoKey(EventHandler& eventHandler) {
  364|  23.6k|  m_pCollectionStack->PushCollectionType(CollectionType::CompactMap);
  365|       |
  366|       |  // null key
  367|  23.6k|  eventHandler.OnNull(m_scanner.peek().mark, NullAnchor);
  368|       |
  369|       |  // grab value
  370|  23.6k|  m_scanner.pop();
  371|  23.6k|  HandleNode(eventHandler);
  372|       |
  373|  23.6k|  m_pCollectionStack->PopCollectionType(CollectionType::CompactMap);
  374|  23.6k|}
_ZN4YAML15SingleDocParser15ParsePropertiesERNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERmS8_:
  379|  1.69M|                                      std::string& anchor_name) {
  380|  1.69M|  tag.clear();
  381|  1.69M|  anchor_name.clear();
  382|  1.69M|  anchor = NullAnchor;
  383|       |
  384|  1.71M|  while (true) {
  ------------------
  |  Branch (384:10): [True: 1.71M, Folded]
  ------------------
  385|  1.71M|    if (m_scanner.empty())
  ------------------
  |  Branch (385:9): [True: 745, False: 1.71M]
  ------------------
  386|    745|      return;
  387|       |
  388|  1.71M|    switch (m_scanner.peek().type) {
  389|  8.55k|      case Token::TAG:
  ------------------
  |  Branch (389:7): [True: 8.55k, False: 1.70M]
  ------------------
  390|  8.55k|        ParseTag(tag);
  391|  8.55k|        break;
  392|  8.14k|      case Token::ANCHOR:
  ------------------
  |  Branch (392:7): [True: 8.14k, False: 1.70M]
  ------------------
  393|  8.14k|        ParseAnchor(anchor, anchor_name);
  394|  8.14k|        break;
  395|  1.69M|      default:
  ------------------
  |  Branch (395:7): [True: 1.69M, False: 16.7k]
  ------------------
  396|  1.69M|        return;
  397|  1.71M|    }
  398|  1.71M|  }
  399|  1.69M|}
_ZN4YAML15SingleDocParser8ParseTagERNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
  401|  8.55k|void SingleDocParser::ParseTag(std::string& tag) {
  402|  8.55k|  Token& token = m_scanner.peek();
  403|  8.55k|  if (!tag.empty())
  ------------------
  |  Branch (403:7): [True: 62, False: 8.49k]
  ------------------
  404|     62|    throw ParserException(token.mark, ErrorMsg::MULTIPLE_TAGS);
  405|       |
  406|  8.49k|  Tag tagInfo(token);
  407|  8.49k|  tag = tagInfo.Translate(m_directives);
  408|  8.49k|  m_scanner.pop();
  409|  8.49k|}
_ZN4YAML15SingleDocParser11ParseAnchorERmRNSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEE:
  411|  8.14k|void SingleDocParser::ParseAnchor(anchor_t& anchor, std::string& anchor_name) {
  412|  8.14k|  Token& token = m_scanner.peek();
  413|  8.14k|  if (anchor)
  ------------------
  |  Branch (413:7): [True: 5, False: 8.14k]
  ------------------
  414|      5|    throw ParserException(token.mark, ErrorMsg::MULTIPLE_ANCHORS);
  415|       |
  416|  8.14k|  anchor_name = token.value;
  417|  8.14k|  anchor = RegisterAnchor(token.value);
  418|  8.14k|  m_scanner.pop();
  419|  8.14k|}
_ZN4YAML15SingleDocParser14RegisterAnchorERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
  421|  8.14k|anchor_t SingleDocParser::RegisterAnchor(const std::string& name) {
  422|  8.14k|  if (name.empty())
  ------------------
  |  Branch (422:7): [True: 0, False: 8.14k]
  ------------------
  423|      0|    return NullAnchor;
  424|       |
  425|  8.14k|  return m_anchors[name] = ++m_curAnchor;
  426|  8.14k|}
_ZNK4YAML15SingleDocParser12LookupAnchorERKNS_4MarkERKNSt3__112basic_stringIcNS4_11char_traitsIcEENS4_9allocatorIcEEEE:
  429|  1.41k|                                       const std::string& name) const {
  430|  1.41k|  auto it = m_anchors.find(name);
  431|  1.41k|  if (it == m_anchors.end()) {
  ------------------
  |  Branch (431:7): [True: 311, False: 1.10k]
  ------------------
  432|    311|    std::stringstream ss;
  433|    311|    ss << ErrorMsg::UNKNOWN_ANCHOR << name;
  434|    311|    throw ParserException(mark, ss.str());
  435|    311|  }
  436|       |
  437|  1.10k|  return it->second;
  438|  1.41k|}

_ZN4YAML6StreamC2ERNSt3__113basic_istreamIcNS1_11char_traitsIcEEEE:
  187|  7.17k|    : m_input(input),
  188|  7.17k|      m_mark{},
  189|  7.17k|      m_charSet{},
  190|  7.17k|      m_readahead{},
  191|  7.17k|      m_pPrefetched(new unsigned char[YAML_PREFETCH_SIZE]),
  ------------------
  |  |    7|  7.17k|#define YAML_PREFETCH_SIZE 2048
  ------------------
  192|  7.17k|      m_nPrefetchedAvailable(0),
  193|  7.17k|      m_nPrefetchedUsed(0) {
  194|  7.17k|  using char_traits = std::istream::traits_type;
  195|       |
  196|  7.17k|  if (input.fail())
  ------------------
  |  Branch (196:7): [True: 0, False: 7.17k]
  ------------------
  197|      0|    throw BadStream();
  198|       |
  199|       |  // Determine (or guess) the character-set by reading the BOM, if any.  See
  200|       |  // the YAML specification for the determination algorithm.
  201|  7.17k|  char_traits::int_type intro[4]{};
  202|  7.17k|  int nIntroUsed = 0;
  203|  7.17k|  UtfIntroState state = uis_start;
  204|  22.4k|  for (; !s_introFinalState[state];) {
  ------------------
  |  Branch (204:10): [True: 15.3k, False: 7.17k]
  ------------------
  205|  15.3k|    std::istream::int_type ch = input.get();
  206|  15.3k|    if (input.bad() || (input.fail() && !input.eof()))
  ------------------
  |  Branch (206:9): [True: 0, False: 15.3k]
  |  Branch (206:25): [True: 100, False: 15.2k]
  |  Branch (206:41): [True: 0, False: 100]
  ------------------
  207|      0|      throw BadStream();
  208|  15.3k|    intro[nIntroUsed++] = ch;
  209|  15.3k|    UtfIntroCharType charType = IntroCharTypeOf(ch);
  210|  15.3k|    UtfIntroState newState = s_introTransitions[state][charType];
  211|  15.3k|    int nUngets = s_introUngetCount[state][charType];
  212|  15.3k|    if (nUngets > 0) {
  ------------------
  |  Branch (212:9): [True: 7.16k, False: 8.15k]
  ------------------
  213|  7.16k|      input.clear();
  214|  22.4k|      for (; nUngets > 0; --nUngets) {
  ------------------
  |  Branch (214:14): [True: 15.2k, False: 7.16k]
  ------------------
  215|  15.2k|        if (char_traits::eof() != intro[--nIntroUsed])
  ------------------
  |  Branch (215:13): [True: 15.1k, False: 100]
  ------------------
  216|  15.1k|          input.putback(char_traits::to_char_type(intro[nIntroUsed]));
  217|  15.2k|      }
  218|  7.16k|    }
  219|  15.3k|    state = newState;
  220|  15.3k|  }
  221|       |
  222|  7.17k|  switch (state) {
  223|  5.72k|    case uis_utf8:
  ------------------
  |  Branch (223:5): [True: 5.72k, False: 1.45k]
  ------------------
  224|  5.72k|      m_charSet = utf8;
  225|  5.72k|      break;
  226|    809|    case uis_utf16le:
  ------------------
  |  Branch (226:5): [True: 809, False: 6.37k]
  ------------------
  227|    809|      m_charSet = utf16le;
  228|    809|      break;
  229|    570|    case uis_utf16be:
  ------------------
  |  Branch (229:5): [True: 570, False: 6.60k]
  ------------------
  230|    570|      m_charSet = utf16be;
  231|    570|      break;
  232|     34|    case uis_utf32le:
  ------------------
  |  Branch (232:5): [True: 34, False: 7.14k]
  ------------------
  233|     34|      m_charSet = utf32le;
  234|     34|      break;
  235|     39|    case uis_utf32be:
  ------------------
  |  Branch (235:5): [True: 39, False: 7.14k]
  ------------------
  236|     39|      m_charSet = utf32be;
  237|     39|      break;
  238|      0|    default:
  ------------------
  |  Branch (238:5): [True: 0, False: 7.17k]
  ------------------
  239|      0|      m_charSet = utf8;
  240|      0|      break;
  241|  7.17k|  }
  242|       |
  243|  7.17k|  ReadAheadTo(0);
  244|  7.17k|}
_ZN4YAML6StreamD2Ev:
  246|  7.17k|Stream::~Stream() = default;
_ZNK4YAML6Stream4peekEv:
  248|   600M|char Stream::peek() const {
  249|   600M|  if (m_readahead.empty()) {
  ------------------
  |  Branch (249:7): [True: 0, False: 600M]
  ------------------
  250|      0|    return Stream::eof();
  251|      0|  }
  252|       |
  253|   600M|  return m_readahead[0];
  254|   600M|}
_ZNK4YAML6StreamcvbEv:
  256|   342M|Stream::operator bool() const {
  257|   342M|  return m_input.good() ||
  ------------------
  |  Branch (257:10): [True: 323M, False: 19.6M]
  ------------------
  258|  19.6M|         (!m_readahead.empty() && m_readahead[0] != Stream::eof());
  ------------------
  |  Branch (258:11): [True: 19.6M, False: 0]
  |  Branch (258:35): [True: 19.6M, False: 20.5k]
  ------------------
  259|   342M|}
_ZN4YAML6Stream3getEv:
  263|   258M|char Stream::get() {
  264|   258M|  char ch = peek();
  265|   258M|  AdvanceCurrent();
  266|   258M|  m_mark.column++;
  267|       |
  268|       |  // if line ending symbol is unknown, set it to the first
  269|       |  // encountered line ending.
  270|       |  // if line ending '\r' set ending symbol to '\r'
  271|       |  // other wise set it to '\n'
  272|   258M|  if (!m_lineEndingSymbol) {
  ------------------
  |  Branch (272:7): [True: 148M, False: 110M]
  ------------------
  273|   148M|    if (ch == '\n') { // line ending is '\n'
  ------------------
  |  Branch (273:9): [True: 1.91k, False: 148M]
  ------------------
  274|  1.91k|      m_lineEndingSymbol = '\n';
  275|   148M|    } else if (ch == '\r') {
  ------------------
  |  Branch (275:16): [True: 992, False: 148M]
  ------------------
  276|    992|      auto ch2 = peek();
  277|    992|      if (ch2 == '\n') { // line ending is '\r\n'
  ------------------
  |  Branch (277:11): [True: 21, False: 971]
  ------------------
  278|     21|        m_lineEndingSymbol = '\n';
  279|    971|      } else { // line ending is '\r'
  280|    971|        m_lineEndingSymbol = '\r';
  281|    971|      }
  282|    992|    }
  283|   148M|  }
  284|       |
  285|   258M|  if (ch == m_lineEndingSymbol) {
  ------------------
  |  Branch (285:7): [True: 12.1M, False: 246M]
  ------------------
  286|  12.1M|    m_mark.column = 0;
  287|  12.1M|    m_mark.line++;
  288|  12.1M|  }
  289|       |
  290|   258M|  return ch;
  291|   258M|}
_ZN4YAML6Stream3getEi:
  295|  8.79M|std::string Stream::get(int n) {
  296|  8.79M|  std::string ret;
  297|  8.79M|  if (n > 0) {
  ------------------
  |  Branch (297:7): [True: 8.79M, False: 0]
  ------------------
  298|  8.79M|    ret.reserve(static_cast<std::string::size_type>(n));
  299|  17.5M|    for (int i = 0; i < n; i++)
  ------------------
  |  Branch (299:21): [True: 8.79M, False: 8.79M]
  ------------------
  300|  8.79M|      ret += get();
  301|  8.79M|  }
  302|  8.79M|  return ret;
  303|  8.79M|}
_ZN4YAML6Stream3eatEi:
  307|  42.1M|void Stream::eat(int n) {
  308|  85.0M|  for (int i = 0; i < n; i++)
  ------------------
  |  Branch (308:19): [True: 42.8M, False: 42.1M]
  ------------------
  309|  42.8M|    get();
  310|  42.1M|}
_ZN4YAML6Stream14AdvanceCurrentEv:
  312|   258M|void Stream::AdvanceCurrent() {
  313|   258M|  if (!m_readahead.empty()) {
  ------------------
  |  Branch (313:7): [True: 258M, False: 0]
  ------------------
  314|   258M|    m_readahead.pop_front();
  315|   258M|    m_mark.pos++;
  316|   258M|  }
  317|       |
  318|   258M|  ReadAheadTo(0);
  319|   258M|}
_ZNK4YAML6Stream12_ReadAheadToEm:
  321|   158M|bool Stream::_ReadAheadTo(size_t i) const {
  322|   316M|  while (m_input.good() && (m_readahead.size() <= i)) {
  ------------------
  |  Branch (322:10): [True: 316M, False: 7.49k]
  |  Branch (322:28): [True: 158M, False: 158M]
  ------------------
  323|   158M|    switch (m_charSet) {
  ------------------
  |  Branch (323:13): [True: 158M, False: 0]
  ------------------
  324|   137M|      case utf8:
  ------------------
  |  Branch (324:7): [True: 137M, False: 20.4M]
  ------------------
  325|   137M|        StreamInUtf8();
  326|   137M|        break;
  327|  9.34M|      case utf16le:
  ------------------
  |  Branch (327:7): [True: 9.34M, False: 148M]
  ------------------
  328|  9.34M|        StreamInUtf16();
  329|  9.34M|        break;
  330|  8.90M|      case utf16be:
  ------------------
  |  Branch (330:7): [True: 8.90M, False: 149M]
  ------------------
  331|  8.90M|        StreamInUtf16();
  332|  8.90M|        break;
  333|   983k|      case utf32le:
  ------------------
  |  Branch (333:7): [True: 983k, False: 157M]
  ------------------
  334|   983k|        StreamInUtf32();
  335|   983k|        break;
  336|  1.21M|      case utf32be:
  ------------------
  |  Branch (336:7): [True: 1.21M, False: 156M]
  ------------------
  337|  1.21M|        StreamInUtf32();
  338|  1.21M|        break;
  339|   158M|    }
  340|   158M|  }
  341|       |
  342|       |  // signal end of stream
  343|   158M|  if (!m_input.good())
  ------------------
  |  Branch (343:7): [True: 7.49k, False: 158M]
  ------------------
  344|  7.49k|    m_readahead.push_back(Stream::eof());
  345|       |
  346|   158M|  return m_readahead.size() > i;
  347|   158M|}
_ZNK4YAML6Stream12StreamInUtf8Ev:
  349|   137M|void Stream::StreamInUtf8() const {
  350|   137M|  unsigned char b = GetNextByte();
  351|   137M|  if (m_input.good()) {
  ------------------
  |  Branch (351:7): [True: 137M, False: 5.52k]
  ------------------
  352|   137M|    m_readahead.push_back(static_cast<char>(b));
  353|   137M|  }
  354|   137M|}
_ZNK4YAML6Stream13StreamInUtf16Ev:
  356|  18.2M|void Stream::StreamInUtf16() const {
  357|  18.2M|  unsigned long ch = 0;
  358|  18.2M|  unsigned char bytes[2];
  359|  18.2M|  int nBigEnd = (m_charSet == utf16be) ? 0 : 1;
  ------------------
  |  Branch (359:17): [True: 8.90M, False: 9.34M]
  ------------------
  360|       |
  361|  18.2M|  bytes[0] = GetNextByte();
  362|  18.2M|  bytes[1] = GetNextByte();
  363|  18.2M|  if (!m_input.good()) {
  ------------------
  |  Branch (363:7): [True: 1.02k, False: 18.2M]
  ------------------
  364|  1.02k|    return;
  365|  1.02k|  }
  366|  18.2M|  ch = (static_cast<unsigned long>(bytes[nBigEnd]) << 8) |
  367|  18.2M|       static_cast<unsigned long>(bytes[1 ^ nBigEnd]);
  368|       |
  369|  18.2M|  if (ch >= 0xDC00 && ch < 0xE000) {
  ------------------
  |  Branch (369:7): [True: 160k, False: 18.0M]
  |  Branch (369:23): [True: 7.26k, False: 153k]
  ------------------
  370|       |    // Trailing (low) surrogate...ugh, wrong order
  371|  7.26k|    QueueUnicodeCodepoint(m_readahead, CP_REPLACEMENT_CHARACTER);
  ------------------
  |  |   13|  7.26k|#define CP_REPLACEMENT_CHARACTER (0xFFFD)
  ------------------
  372|  7.26k|    return;
  373|  7.26k|  }
  374|       |
  375|  18.2M|  if (ch >= 0xD800 && ch < 0xDC00) {
  ------------------
  |  Branch (375:7): [True: 185k, False: 18.0M]
  |  Branch (375:23): [True: 32.2k, False: 153k]
  ------------------
  376|       |    // ch is a leading (high) surrogate
  377|       |
  378|       |    // Four byte UTF-8 code point
  379|       |
  380|       |    // Read the trailing (low) surrogate
  381|  23.0M|    for (;;) {
  382|  23.0M|      bytes[0] = GetNextByte();
  383|  23.0M|      bytes[1] = GetNextByte();
  384|  23.0M|      if (!m_input.good()) {
  ------------------
  |  Branch (384:11): [True: 298, False: 23.0M]
  ------------------
  385|    298|        QueueUnicodeCodepoint(m_readahead, CP_REPLACEMENT_CHARACTER);
  ------------------
  |  |   13|    298|#define CP_REPLACEMENT_CHARACTER (0xFFFD)
  ------------------
  386|    298|        return;
  387|    298|      }
  388|  23.0M|      unsigned long chLow = (static_cast<unsigned long>(bytes[nBigEnd]) << 8) |
  389|  23.0M|                            static_cast<unsigned long>(bytes[1 ^ nBigEnd]);
  390|  23.0M|      if (chLow < 0xDC00 || chLow >= 0xE000) {
  ------------------
  |  Branch (390:11): [True: 23.0M, False: 14.8k]
  |  Branch (390:29): [True: 2.95k, False: 11.8k]
  ------------------
  391|       |        // Trouble...not a low surrogate.  Dump a REPLACEMENT CHARACTER into the
  392|       |        // stream.
  393|  23.0M|        QueueUnicodeCodepoint(m_readahead, CP_REPLACEMENT_CHARACTER);
  ------------------
  |  |   13|  23.0M|#define CP_REPLACEMENT_CHARACTER (0xFFFD)
  ------------------
  394|       |
  395|       |        // Deal with the next UTF-16 unit
  396|  23.0M|        if (chLow < 0xD800 || chLow >= 0xE000) {
  ------------------
  |  Branch (396:13): [True: 17.1k, False: 23.0M]
  |  Branch (396:31): [True: 2.95k, False: 23.0M]
  ------------------
  397|       |          // Easiest case: queue the codepoint and return
  398|  20.0k|          QueueUnicodeCodepoint(m_readahead, ch);
  399|  20.0k|          return;
  400|  20.0k|        }
  401|       |        // Start the loop over with the new high surrogate
  402|  23.0M|        ch = chLow;
  403|  23.0M|        continue;
  404|  23.0M|      }
  405|       |
  406|       |      // Select the payload bits from the high surrogate
  407|  11.8k|      ch &= 0x3FF;
  408|  11.8k|      ch <<= 10;
  409|       |
  410|       |      // Include bits from low surrogate
  411|  11.8k|      ch |= (chLow & 0x3FF);
  412|       |
  413|       |      // Add the surrogacy offset
  414|  11.8k|      ch += 0x10000;
  415|  11.8k|      break;
  416|  23.0M|    }
  417|  32.2k|  }
  418|       |
  419|  18.2M|  QueueUnicodeCodepoint(m_readahead, ch);
  420|  18.2M|}
_ZNK4YAML6Stream11GetNextByteEv:
  426|   229M|unsigned char Stream::GetNextByte() const {
  427|   229M|  if (m_nPrefetchedUsed >= m_nPrefetchedAvailable) {
  ------------------
  |  Branch (427:7): [True: 126k, False: 228M]
  ------------------
  428|   126k|    std::streambuf* pBuf = m_input.rdbuf();
  429|   126k|    try {
  430|   126k|      m_nPrefetchedAvailable = static_cast<std::size_t>(
  431|   126k|          pBuf->sgetn(ReadBuffer(m_pPrefetched.get()), YAML_PREFETCH_SIZE));
  ------------------
  |  |    7|   126k|#define YAML_PREFETCH_SIZE 2048
  ------------------
  432|   126k|    } catch (const std::ios_base::failure&) {
  433|      0|      throw BadStream();
  434|      0|    }
  435|   126k|    m_nPrefetchedUsed = 0;
  436|   126k|    if (m_input.fail()) {
  ------------------
  |  Branch (436:9): [True: 0, False: 126k]
  ------------------
  437|      0|      throw BadStream();
  438|      0|    }
  439|   126k|    if (!m_nPrefetchedAvailable) {
  ------------------
  |  Branch (439:9): [True: 8.21k, False: 118k]
  ------------------
  440|  8.21k|      m_input.setstate(std::ios_base::eofbit);
  441|  8.21k|    }
  442|       |
  443|   126k|    if (0 == m_nPrefetchedAvailable) {
  ------------------
  |  Branch (443:9): [True: 8.21k, False: 118k]
  ------------------
  444|  8.21k|      return 0;
  445|  8.21k|    }
  446|   126k|  }
  447|       |
  448|   229M|  return m_pPrefetched[m_nPrefetchedUsed++];
  449|   229M|}
_ZNK4YAML6Stream13StreamInUtf32Ev:
  451|  2.19M|void Stream::StreamInUtf32() const {
  452|  2.19M|  static int indexes[2][4] = {{3, 2, 1, 0}, {0, 1, 2, 3}};
  453|       |
  454|  2.19M|  unsigned long ch = 0;
  455|  2.19M|  unsigned char bytes[4];
  456|  2.19M|  int* pIndexes = (m_charSet == utf32be) ? indexes[1] : indexes[0];
  ------------------
  |  Branch (456:19): [True: 1.21M, False: 983k]
  ------------------
  457|       |
  458|  2.19M|  bytes[0] = GetNextByte();
  459|  2.19M|  bytes[1] = GetNextByte();
  460|  2.19M|  bytes[2] = GetNextByte();
  461|  2.19M|  bytes[3] = GetNextByte();
  462|  2.19M|  if (!m_input.good()) {
  ------------------
  |  Branch (462:7): [True: 70, False: 2.19M]
  ------------------
  463|     70|    return;
  464|     70|  }
  465|       |
  466|  10.9M|  for (int i = 0; i < 4; ++i) {
  ------------------
  |  Branch (466:19): [True: 8.79M, False: 2.19M]
  ------------------
  467|  8.79M|    ch <<= 8;
  468|  8.79M|    ch |= bytes[pIndexes[i]];
  469|  8.79M|  }
  470|       |
  471|  2.19M|  QueueUnicodeCodepoint(m_readahead, ch);
  472|  2.19M|}
_ZN4YAML15IntroCharTypeOfEi:
  126|  15.3k|inline UtfIntroCharType IntroCharTypeOf(std::istream::int_type ch) {
  127|  15.3k|  if (std::istream::traits_type::eof() == ch) {
  ------------------
  |  Branch (127:7): [True: 100, False: 15.2k]
  ------------------
  128|    100|    return uictOther;
  129|    100|  }
  130|       |
  131|  15.2k|  switch (ch) {
  ------------------
  |  Branch (131:11): [True: 2.41k, False: 12.8k]
  ------------------
  132|  1.93k|    case 0:
  ------------------
  |  Branch (132:5): [True: 1.93k, False: 13.2k]
  ------------------
  133|  1.93k|      return uict00;
  134|     15|    case 0xBB:
  ------------------
  |  Branch (134:5): [True: 15, False: 15.1k]
  ------------------
  135|     15|      return uictBB;
  136|     14|    case 0xBF:
  ------------------
  |  Branch (136:5): [True: 14, False: 15.2k]
  ------------------
  137|     14|      return uictBF;
  138|    136|    case 0xEF:
  ------------------
  |  Branch (138:5): [True: 136, False: 15.0k]
  ------------------
  139|    136|      return uictEF;
  140|     60|    case 0xFE:
  ------------------
  |  Branch (140:5): [True: 60, False: 15.1k]
  ------------------
  141|     60|      return uictFE;
  142|    251|    case 0xFF:
  ------------------
  |  Branch (142:5): [True: 251, False: 14.9k]
  ------------------
  143|    251|      return uictFF;
  144|  15.2k|  }
  145|       |
  146|  12.8k|  if ((ch > 0) && (ch < 0xFF)) {
  ------------------
  |  Branch (146:7): [True: 12.8k, False: 0]
  |  Branch (146:19): [True: 12.8k, False: 0]
  ------------------
  147|  12.8k|    return uictAscii;
  148|  12.8k|  }
  149|       |
  150|      0|  return uictOther;
  151|  12.8k|}
_ZN4YAML21QueueUnicodeCodepointERNSt3__15dequeIcNS0_9allocatorIcEEEEm:
  162|  43.4M|inline void QueueUnicodeCodepoint(std::deque<char>& q, unsigned long ch) {
  163|       |  // We are not allowed to queue the Stream::eof() codepoint, so
  164|       |  // replace it with CP_REPLACEMENT_CHARACTER
  165|  43.4M|  if (static_cast<unsigned long>(Stream::eof()) == ch) {
  ------------------
  |  Branch (165:7): [True: 1.12k, False: 43.4M]
  ------------------
  166|  1.12k|    ch = CP_REPLACEMENT_CHARACTER;
  ------------------
  |  |   13|  1.12k|#define CP_REPLACEMENT_CHARACTER (0xFFFD)
  ------------------
  167|  1.12k|  }
  168|       |
  169|  43.4M|  if (ch < 0x80) {
  ------------------
  |  Branch (169:7): [True: 855k, False: 42.6M]
  ------------------
  170|   855k|    q.push_back(Utf8Adjust(ch, 0, 0));
  171|  42.6M|  } else if (ch < 0x800) {
  ------------------
  |  Branch (171:14): [True: 755k, False: 41.8M]
  ------------------
  172|   755k|    q.push_back(Utf8Adjust(ch, 2, 6));
  173|   755k|    q.push_back(Utf8Adjust(ch, 1, 0));
  174|  41.8M|  } else if (ch < 0x10000) {
  ------------------
  |  Branch (174:14): [True: 39.6M, False: 2.20M]
  ------------------
  175|  39.6M|    q.push_back(Utf8Adjust(ch, 3, 12));
  176|  39.6M|    q.push_back(Utf8Adjust(ch, 1, 6));
  177|  39.6M|    q.push_back(Utf8Adjust(ch, 1, 0));
  178|  39.6M|  } else {
  179|  2.20M|    q.push_back(Utf8Adjust(ch, 4, 18));
  180|  2.20M|    q.push_back(Utf8Adjust(ch, 1, 12));
  181|  2.20M|    q.push_back(Utf8Adjust(ch, 1, 6));
  182|  2.20M|    q.push_back(Utf8Adjust(ch, 1, 0));
  183|  2.20M|  }
  184|  43.4M|}
_ZN4YAML10Utf8AdjustEmhh:
  154|   130M|                       unsigned char rshift) {
  155|   130M|  const unsigned char header =
  156|   130M|      static_cast<unsigned char>(((1 << lead_bits) - 1) << (8 - lead_bits));
  157|   130M|  const unsigned char mask = (0xFF >> (lead_bits + 1));
  158|   130M|  return static_cast<char>(
  159|   130M|      static_cast<unsigned char>(header | ((ch >> rshift) & mask)));
  160|   130M|}
_ZN4YAML10ReadBufferEPh:
  422|   126k|inline char* ReadBuffer(unsigned char* pBuffer) {
  423|   126k|  return reinterpret_cast<char*>(pBuffer);
  424|   126k|}

_ZNK4YAML6StreamntEv:
   35|   167M|  bool operator!() const { return !static_cast<bool>(*this); }
_ZN4YAML6Stream3eofEv:
   42|  78.7M|  static char eof() { return 0x04; }
_ZNK4YAML6Stream4markEv:
   44|   192M|  const Mark mark() const { return m_mark; }
_ZNK4YAML6Stream3posEv:
   45|  1.35M|  int pos() const { return m_mark.pos; }
_ZNK4YAML6Stream4lineEv:
   46|  1.35M|  int line() const { return m_mark.line; }
_ZNK4YAML6Stream6columnEv:
   47|   327M|  int column() const { return m_mark.column; }
_ZN4YAML6Stream11ResetColumnEv:
   48|  5.56k|  void ResetColumn() { m_mark.column = 0; }
_ZNK4YAML6Stream6CharAtEm:
   75|  1.98G|inline char Stream::CharAt(size_t i) const { return m_readahead[i]; }
_ZNK4YAML6Stream11ReadAheadToEm:
   77|  1.43G|inline bool Stream::ReadAheadTo(size_t i) const {
   78|  1.43G|  if (m_readahead.size() > i)
  ------------------
  |  Branch (78:7): [True: 1.27G, False: 158M]
  ------------------
   79|  1.27G|    return true;
   80|   158M|  return _ReadAheadTo(i);
   81|  1.43G|}

_ZN4YAML16StreamCharSourceC2ERKNS_6StreamE:
   18|   565M|  StreamCharSource(const Stream& stream) : m_offset(0), m_stream(stream) {}
_ZNK4YAML16StreamCharSourcecvbEv:
   36|  1.17G|inline StreamCharSource::operator bool() const {
   37|  1.17G|  return m_stream.ReadAheadTo(m_offset);
   38|  1.17G|}
_ZNK4YAML16StreamCharSourceixEm:
   26|  1.98G|  char operator[](std::size_t i) const { return m_stream.CharAt(m_offset + i); }
_ZNK4YAML16StreamCharSourceplEi:
   40|   611M|inline const StreamCharSource StreamCharSource::operator+(int i) const {
   41|   611M|  StreamCharSource source(*this);
   42|   611M|  if (static_cast<int>(source.m_offset) + i >= 0)
  ------------------
  |  Branch (42:7): [True: 611M, False: 0]
  ------------------
   43|   611M|    source.m_offset += static_cast<std::size_t>(i);
   44|      0|  else
   45|      0|    source.m_offset = 0;
   46|   611M|  return source;
   47|   611M|}

_ZN4YAML16StringCharSourceC2EPKcm:
   16|    435|      : m_str(str), m_size(size), m_offset(0) {}
_ZNK4YAML16StringCharSourcecvbEv:
   18|    435|  operator bool() const { return m_offset < m_size; }
_ZNK4YAML16StringCharSourceixEm:
   19|    870|  char operator[](std::size_t i) const { return m_str[m_offset + i]; }

_ZN4YAML3TagC2ERKNS_5TokenE:
   10|  8.49k|    : type(static_cast<TYPE>(token.data)), handle{}, value{} {
   11|  8.49k|  switch (type) {
   12|    417|    case VERBATIM:
  ------------------
  |  Branch (12:5): [True: 417, False: 8.08k]
  ------------------
   13|    417|      value = token.value;
   14|    417|      break;
   15|  4.09k|    case PRIMARY_HANDLE:
  ------------------
  |  Branch (15:5): [True: 4.09k, False: 4.40k]
  ------------------
   16|  4.09k|      value = token.value;
   17|  4.09k|      break;
   18|    172|    case SECONDARY_HANDLE:
  ------------------
  |  Branch (18:5): [True: 172, False: 8.32k]
  ------------------
   19|    172|      value = token.value;
   20|    172|      break;
   21|  1.90k|    case NAMED_HANDLE:
  ------------------
  |  Branch (21:5): [True: 1.90k, False: 6.59k]
  ------------------
   22|  1.90k|      handle = token.value;
   23|  1.90k|      value = token.params[0];
   24|  1.90k|      break;
   25|  1.91k|    case NON_SPECIFIC:
  ------------------
  |  Branch (25:5): [True: 1.91k, False: 6.58k]
  ------------------
   26|  1.91k|      break;
   27|      0|    default:
  ------------------
  |  Branch (27:5): [True: 0, False: 8.49k]
  ------------------
   28|       |      assert(false);
   29|  8.49k|  }
   30|  8.49k|}
_ZNK4YAML3Tag9TranslateERKNS_10DirectivesE:
   32|  8.49k|std::string Tag::Translate(const Directives& directives) const {
   33|  8.49k|  switch (type) {
   34|    417|    case VERBATIM:
  ------------------
  |  Branch (34:5): [True: 417, False: 8.08k]
  ------------------
   35|    417|      return value;
   36|  4.09k|    case PRIMARY_HANDLE:
  ------------------
  |  Branch (36:5): [True: 4.09k, False: 4.40k]
  ------------------
   37|  4.09k|      return directives.TranslateTagHandle("!") + value;
   38|    172|    case SECONDARY_HANDLE:
  ------------------
  |  Branch (38:5): [True: 172, False: 8.32k]
  ------------------
   39|    172|      return directives.TranslateTagHandle("!!") + value;
   40|  1.90k|    case NAMED_HANDLE:
  ------------------
  |  Branch (40:5): [True: 1.90k, False: 6.59k]
  ------------------
   41|  1.90k|      return directives.TranslateTagHandle("!" + handle + "!") + value;
   42|  1.91k|    case NON_SPECIFIC:
  ------------------
  |  Branch (42:5): [True: 1.91k, False: 6.58k]
  ------------------
   43|       |      // TODO:
   44|  1.91k|      return "!";
   45|      0|    default:
  ------------------
  |  Branch (45:5): [True: 0, False: 8.49k]
  ------------------
   46|      0|      assert(false);
   47|  8.49k|  }
   48|      0|  throw std::runtime_error("yaml-cpp: internal error, bad tag type");
   49|  8.49k|}

_ZN4YAML5TokenC2ENS0_4TYPEERKNS_4MarkE:
   53|   135M|      : status(VALID), type(type_), mark(mark_), value{}, params{}, data(0) {}

