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

_ZN4YAML10DepthGuardILi500EEC2ERiRKNS_4MarkERKNSt3__112basic_stringIcNS6_11char_traitsIcEENS6_9allocatorIcEEEE:
   51|  2.24M|  DepthGuard(int & depth_, const Mark& mark_, const std::string& msg_) : m_depth(depth_) {
   52|  2.24M|    ++m_depth;
   53|  2.24M|    if ( max_depth <= m_depth ) {
  ------------------
  |  Branch (53:10): [True: 116, False: 2.24M]
  ------------------
   54|    116|        throw DeepRecursion{m_depth, mark_, msg_};
   55|    116|    }
   56|  2.24M|  }
_ZN4YAML10DepthGuardILi500EED2Ev:
   63|  2.24M|  ~DepthGuard() {
   64|  2.24M|    --m_depth;
   65|  2.24M|  }

_ZN4YAML12EventHandler8OnAnchorERKNS_4MarkERKNSt3__112basic_stringIcNS4_11char_traitsIcEENS4_9allocatorIcEEEE:
   39|   489k|                        const std::string& /*anchor_name*/) {
   40|       |    // empty default implementation for compatibility
   41|   489k|  }
_ZN4YAML12EventHandlerD2Ev:
   20|   323k|  virtual ~EventHandler() = default;

_ZN4YAML9ExceptionC2ERKNS_4MarkERKNSt3__112basic_stringIcNS4_11char_traitsIcEENS4_9allocatorIcEEEE:
  160|  3.64k|      : std::runtime_error(build_what(mark_, msg_)), mark(mark_), msg(msg_) {}
_ZN4YAML9Exception10build_whatERKNS_4MarkERKNSt3__112basic_stringIcNS4_11char_traitsIcEENS4_9allocatorIcEEEE:
  170|  3.64k|                                      const std::string& msg) {
  171|  3.64k|    if (mark.is_null()) {
  ------------------
  |  Branch (171:9): [True: 0, False: 3.64k]
  ------------------
  172|      0|      return msg;
  173|      0|    }
  174|       |
  175|  3.64k|    std::stringstream output;
  176|  3.64k|    output << "yaml-cpp: error at line " << mark.line + 1 << ", column "
  177|  3.64k|           << mark.column + 1 << ": " << msg;
  178|  3.64k|    return output.str();
  179|  3.64k|  }
_ZN4YAML15ParserExceptionC2ERKNS_4MarkERKNSt3__112basic_stringIcNS4_11char_traitsIcEENS4_9allocatorIcEEEE:
  185|  3.60k|      : Exception(mark_, msg_) {}
_ZN4YAML23RepresentationExceptionC2ERKNS_4MarkERKNSt3__112basic_stringIcNS4_11char_traitsIcEENS4_9allocatorIcEEEE:
  193|     45|      : Exception(mark_, msg_) {}
_ZN4YAML15NonUniqueMapKeyC2INS_6detail4nodeEEERKNS_4MarkERKT_:
  310|     45|      : RepresentationException(mark_, ErrorMsg::NON_UNIQUE_MAP_KEY) {}

_ZN4YAML4MarkC2Ev:
   14|  1.06M|  Mark() : pos(0), line(0), column(0) {}
_ZN4YAML4Mark9null_markEv:
   16|  3.10M|  static const Mark null_mark() { return Mark(-1, -1, -1); }
_ZNK4YAML4Mark7is_nullEv:
   18|  3.64k|  bool is_null() const { return pos == -1 && line == -1 && column == -1; }
  ------------------
  |  Branch (18:33): [True: 0, False: 3.64k]
  |  Branch (18:46): [True: 0, False: 0]
  |  Branch (18:60): [True: 0, False: 0]
  ------------------
_ZN4YAML4MarkC2Eiii:
   25|  3.10M|      : pos(pos_), line(line_), column(column_) {}

_ZN4YAML6detail6memoryC2Ev:
   25|   323k|  memory() : m_nodes{} {}
_ZN4YAML6detail13memory_holderC2Ev:
   37|   323k|  memory_holder() : m_pMemory(std::make_shared<memory>()) {}
_ZN4YAML6detail13memory_holder11create_nodeEv:
   39|  3.10M|  node& create_node() { return m_pMemory->create_node(); }

_ZN4YAML6detail4nodeC2Ev:
   27|  3.10M|  node() : m_pRef(std::make_shared<node_ref>()), m_dependencies{}, m_index{} {}
_ZNK4YAML6detail4node10is_definedEv:
   34|  9.90M|  bool is_defined() const { return m_pRef->is_defined(); }
_ZNK4YAML6detail4node4typeEv:
   36|  6.42M|  NodeType::value type() const { return m_pRef->type(); }
_ZNK4YAML6detail4node6scalarEv:
   38|  3.83M|  const std::string& scalar() const { return m_pRef->scalar(); }
_ZN4YAML6detail4node12mark_definedEv:
   46|  6.27M|  void mark_defined() {
   47|  6.27M|    if (is_defined())
  ------------------
  |  Branch (47:9): [True: 3.16M, False: 3.10M]
  ------------------
   48|  3.16M|      return;
   49|       |
   50|  3.10M|    m_pRef->mark_defined();
   51|  3.10M|    for (node* dependency : m_dependencies)
  ------------------
  |  Branch (51:27): [True: 0, False: 3.10M]
  ------------------
   52|      0|      dependency->mark_defined();
   53|  3.10M|    m_dependencies.clear();
   54|  3.10M|  }
_ZN4YAML6detail4node14add_dependencyERS1_:
   56|  2.68M|  void add_dependency(node& rhs) {
   57|  2.68M|    if (is_defined())
  ------------------
  |  Branch (57:9): [True: 2.68M, False: 0]
  ------------------
   58|  2.68M|      rhs.mark_defined();
   59|      0|    else
   60|      0|      m_dependencies.insert(&rhs);
   61|  2.68M|  }
_ZN4YAML6detail4node8set_markERKNS_4MarkE:
   74|  3.10M|  void set_mark(const Mark& mark) { m_pRef->set_mark(mark); }
_ZN4YAML6detail4node8set_typeENS_8NodeType5valueE:
   76|   140k|  void set_type(NodeType::value type) {
   77|   140k|    if (type != NodeType::Undefined)
  ------------------
  |  Branch (77:9): [True: 140k, False: 0]
  ------------------
   78|   140k|      mark_defined();
   79|   140k|    m_pRef->set_type(type);
   80|   140k|  }
_ZN4YAML6detail4node8set_nullEv:
   81|  2.76M|  void set_null() {
   82|  2.76M|    mark_defined();
   83|  2.76M|    m_pRef->set_null();
   84|  2.76M|  }
_ZN4YAML6detail4node10set_scalarERKNSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEE:
   85|   200k|  void set_scalar(const std::string& scalar) {
   86|   200k|    mark_defined();
   87|   200k|    m_pRef->set_scalar(scalar);
   88|   200k|  }
_ZN4YAML6detail4node7set_tagERKNSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEE:
   89|   340k|  void set_tag(const std::string& tag) {
   90|   340k|    mark_defined();
   91|   340k|    m_pRef->set_tag(tag);
   92|   340k|  }
_ZN4YAML6detail4node9set_styleENS_12EmitterStyle5valueE:
   95|   140k|  void set_style(EmitterStyle::value style) {
   96|   140k|    mark_defined();
   97|   140k|    m_pRef->set_style(style);
   98|   140k|  }
_ZN4YAML6detail4node9push_backERS1_NSt3__110shared_ptrINS0_13memory_holderEEE:
  114|  1.74M|  void push_back(node& input, shared_memory_holder pMemory) {
  115|  1.74M|    m_pRef->push_back(input, pMemory);
  116|  1.74M|    input.add_dependency(*this);
  117|  1.74M|    m_index = m_amount.fetch_add(1);
  118|  1.74M|  }
_ZN4YAML6detail4node6insertERS1_S2_NSt3__110shared_ptrINS0_13memory_holderEEE:
  119|   472k|  void insert(node& key, node& value, shared_memory_holder pMemory) {
  120|   472k|    m_pRef->insert(key, value, pMemory);
  121|   472k|    key.add_dependency(*this);
  122|   472k|    value.add_dependency(*this);
  123|   472k|  }

_ZNK4YAML6detail9node_data10is_definedEv:
   44|  9.90M|  bool is_defined() const { return m_isDefined; }
_ZNK4YAML6detail9node_data4typeEv:
   46|  6.42M|  NodeType::value type() const {
   47|  6.42M|    return m_isDefined ? m_type : NodeType::Undefined;
  ------------------
  |  Branch (47:12): [True: 6.42M, False: 0]
  ------------------
   48|  6.42M|  }
_ZNK4YAML6detail9node_data6scalarEv:
   49|  3.83M|  const std::string& scalar() const { return m_scalar; }

_ZN4YAML6detail8node_refC2Ev:
   19|  3.10M|  node_ref() : m_pData(std::make_shared<node_data>()) {}
_ZNK4YAML6detail8node_ref10is_definedEv:
   23|  9.90M|  bool is_defined() const { return m_pData->is_defined(); }
_ZNK4YAML6detail8node_ref4typeEv:
   25|  6.42M|  NodeType::value type() const { return m_pData->type(); }
_ZNK4YAML6detail8node_ref6scalarEv:
   26|  3.83M|  const std::string& scalar() const { return m_pData->scalar(); }
_ZN4YAML6detail8node_ref12mark_definedEv:
   30|  3.10M|  void mark_defined() { m_pData->mark_defined(); }
_ZN4YAML6detail8node_ref8set_markERKNS_4MarkE:
   33|  3.10M|  void set_mark(const Mark& mark) { m_pData->set_mark(mark); }
_ZN4YAML6detail8node_ref8set_typeENS_8NodeType5valueE:
   34|   140k|  void set_type(NodeType::value type) { m_pData->set_type(type); }
_ZN4YAML6detail8node_ref7set_tagERKNSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEE:
   35|   340k|  void set_tag(const std::string& tag) { m_pData->set_tag(tag); }
_ZN4YAML6detail8node_ref8set_nullEv:
   36|  2.76M|  void set_null() { m_pData->set_null(); }
_ZN4YAML6detail8node_ref10set_scalarERKNSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEE:
   37|   200k|  void set_scalar(const std::string& scalar) { m_pData->set_scalar(scalar); }
_ZN4YAML6detail8node_ref9set_styleENS_12EmitterStyle5valueE:
   38|   140k|  void set_style(EmitterStyle::value style) { m_pData->set_style(style); }
_ZN4YAML6detail8node_ref9push_backERNS0_4nodeENSt3__110shared_ptrINS0_13memory_holderEEE:
   54|  1.74M|  void push_back(node& node, shared_memory_holder pMemory) {
   55|  1.74M|    m_pData->push_back(node, pMemory);
   56|  1.74M|  }
_ZN4YAML6detail8node_ref6insertERNS0_4nodeES3_NSt3__110shared_ptrINS0_13memory_holderEEE:
   57|   472k|  void insert(node& key, node& value, shared_memory_holder pMemory) {
   58|   472k|    m_pData->insert(key, value, pMemory);
   59|   472k|  }

_ZN4YAML4NodeD2Ev:
   56|  1.13M|inline Node::~Node() = default;
_ZN4YAML4NodeC2ERKS0_:
   45|   815k|inline Node::Node(const Node&) = default;
_ZN4YAML4NodeC2ERNS_6detail4nodeENSt3__110shared_ptrINS1_13memory_holderEEE:
   54|   316k|    : m_isValid(true), m_invalidKey{}, m_pMemory(pMemory), m_pNode(&node) {}

_ZN4YAML9ExceptionD2Ev:
   15|  3.64k|    #define YAML_CPP_NOEXCEPT noexcept

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

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

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

_ZN4YAML3Exp8ParseHexERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERKNS_4MarkE:
   13|  1.71k|unsigned ParseHex(const std::string& str, const Mark& mark) {
   14|  1.71k|  unsigned value = 0;
   15|  7.44k|  for (char ch : str) {
  ------------------
  |  Branch (15:16): [True: 7.44k, False: 1.63k]
  ------------------
   16|  7.44k|    int digit = 0;
   17|  7.44k|    if ('a' <= ch && ch <= 'f')
  ------------------
  |  Branch (17:9): [True: 850, False: 6.59k]
  |  Branch (17:22): [True: 845, False: 5]
  ------------------
   18|    845|      digit = ch - 'a' + 10;
   19|  6.60k|    else if ('A' <= ch && ch <= 'F')
  ------------------
  |  Branch (19:14): [True: 2.20k, False: 4.39k]
  |  Branch (19:27): [True: 2.19k, False: 11]
  ------------------
   20|  2.19k|      digit = ch - 'A' + 10;
   21|  4.41k|    else if ('0' <= ch && ch <= '9')
  ------------------
  |  Branch (21:14): [True: 4.34k, False: 69]
  |  Branch (21:27): [True: 4.32k, False: 16]
  ------------------
   22|  4.32k|      digit = ch - '0';
   23|     85|    else
   24|     85|      throw ParserException(mark, ErrorMsg::INVALID_HEX);
   25|       |
   26|  7.36k|    value = (value << 4) + digit;
   27|  7.36k|  }
   28|       |
   29|  1.63k|  return value;
   30|  1.71k|}
_ZN4YAML3Exp3StrEj:
   32|  4.09k|std::string Str(unsigned ch) { return std::string(1, static_cast<char>(ch)); }
_ZN4YAML3Exp6EscapeERNS_6StreamEi:
   38|  1.71k|std::string Escape(Stream& in, int codeLength) {
   39|       |  // grab string
   40|  1.71k|  std::string str;
   41|  9.50k|  for (int i = 0; i < codeLength; i++)
  ------------------
  |  Branch (41:19): [True: 7.78k, False: 1.71k]
  ------------------
   42|  7.78k|    str += in.get();
   43|       |
   44|       |  // get the value
   45|  1.71k|  unsigned value = ParseHex(str, in.mark());
   46|       |
   47|       |  // legal unicode?
   48|  1.71k|  if ((value >= 0xD800 && value <= 0xDFFF) || value > 0x10FFFF) {
  ------------------
  |  Branch (48:8): [True: 634, False: 1.08k]
  |  Branch (48:27): [True: 11, False: 623]
  |  Branch (48:47): [True: 35, False: 1.58k]
  ------------------
   49|     46|    std::stringstream msg;
   50|     46|    msg << ErrorMsg::INVALID_UNICODE << value;
   51|     46|    throw ParserException(in.mark(), msg.str());
   52|     46|  }
   53|       |
   54|       |  // now break it up into chars
   55|  1.67k|  if (value <= 0x7F)
  ------------------
  |  Branch (55:7): [True: 322, False: 1.34k]
  ------------------
   56|    322|    return Str(value);
   57|       |
   58|  1.34k|  if (value <= 0x7FF)
  ------------------
  |  Branch (58:7): [True: 343, False: 1.00k]
  ------------------
   59|    343|    return Str(0xC0 + (value >> 6)) + Str(0x80 + (value & 0x3F));
   60|       |
   61|  1.00k|  if (value <= 0xFFFF)
  ------------------
  |  Branch (61:7): [True: 594, False: 411]
  ------------------
   62|    594|    return Str(0xE0 + (value >> 12)) + Str(0x80 + ((value >> 6) & 0x3F)) +
   63|    594|           Str(0x80 + (value & 0x3F));
   64|       |
   65|    411|  return Str(0xF0 + (value >> 18)) + Str(0x80 + ((value >> 12) & 0x3F)) +
   66|    411|         Str(0x80 + ((value >> 6) & 0x3F)) + Str(0x80 + (value & 0x3F));
   67|  1.00k|}
_ZN4YAML3Exp6EscapeERNS_6StreamE:
   74|  43.2k|std::string Escape(Stream& in) {
   75|       |  // eat slash
   76|  43.2k|  char escape = in.get();
   77|       |
   78|       |  // switch on escape character
   79|  43.2k|  char ch = in.get();
   80|       |
   81|       |  // first do single quote, since it's easier
   82|  43.2k|  if (escape == '\'' && ch == '\'')
  ------------------
  |  Branch (82:7): [True: 791, False: 42.4k]
  |  Branch (82:25): [True: 791, False: 0]
  ------------------
   83|    791|    return "\'";
   84|       |
   85|       |  // now do the slash (we're not gonna check if it's a slash - you better pass
   86|       |  // one!)
   87|  42.4k|  switch (ch) {
  ------------------
  |  Branch (87:11): [True: 42.2k, False: 231]
  ------------------
   88|    881|    case '0':
  ------------------
  |  Branch (88:5): [True: 881, False: 41.5k]
  ------------------
   89|    881|      return std::string(1, '\x00');
   90|    207|    case 'a':
  ------------------
  |  Branch (90:5): [True: 207, False: 42.2k]
  ------------------
   91|    207|      return "\x07";
   92|    930|    case 'b':
  ------------------
  |  Branch (92:5): [True: 930, False: 41.5k]
  ------------------
   93|    930|      return "\x08";
   94|  1.08k|    case 't':
  ------------------
  |  Branch (94:5): [True: 1.08k, False: 41.3k]
  ------------------
   95|  5.84k|    case '\t':
  ------------------
  |  Branch (95:5): [True: 4.75k, False: 37.7k]
  ------------------
   96|  5.84k|      return "\x09";
   97|  10.4k|    case 'n':
  ------------------
  |  Branch (97:5): [True: 10.4k, False: 31.9k]
  ------------------
   98|  10.4k|      return "\x0A";
   99|    412|    case 'v':
  ------------------
  |  Branch (99:5): [True: 412, False: 42.0k]
  ------------------
  100|    412|      return "\x0B";
  101|    341|    case 'f':
  ------------------
  |  Branch (101:5): [True: 341, False: 42.1k]
  ------------------
  102|    341|      return "\x0C";
  103|    202|    case 'r':
  ------------------
  |  Branch (103:5): [True: 202, False: 42.2k]
  ------------------
  104|    202|      return "\x0D";
  105|    663|    case 'e':
  ------------------
  |  Branch (105:5): [True: 663, False: 41.8k]
  ------------------
  106|    663|      return "\x1B";
  107|    465|    case ' ':
  ------------------
  |  Branch (107:5): [True: 465, False: 41.9k]
  ------------------
  108|    465|      return R"( )";
  109|  6.09k|    case '\"':
  ------------------
  |  Branch (109:5): [True: 6.09k, False: 36.3k]
  ------------------
  110|  6.09k|      return "\"";
  111|    325|    case '\'':
  ------------------
  |  Branch (111:5): [True: 325, False: 42.1k]
  ------------------
  112|    325|      return "\'";
  113|    678|    case '\\':
  ------------------
  |  Branch (113:5): [True: 678, False: 41.7k]
  ------------------
  114|    678|      return "\\";
  115|    202|    case '/':
  ------------------
  |  Branch (115:5): [True: 202, False: 42.2k]
  ------------------
  116|    202|      return "/";
  117|    544|    case 'N':
  ------------------
  |  Branch (117:5): [True: 544, False: 41.9k]
  ------------------
  118|    544|      return "\xC2\x85";      // NEL (U+0085)
  119|    226|    case '_':
  ------------------
  |  Branch (119:5): [True: 226, False: 42.2k]
  ------------------
  120|    226|      return "\xC2\xA0";      // NBSP (U+00A0)
  121|  9.90k|    case 'L':
  ------------------
  |  Branch (121:5): [True: 9.90k, False: 32.5k]
  ------------------
  122|  9.90k|      return "\xE2\x80\xA8";  // LS (U+2028)
  123|  2.13k|    case 'P':
  ------------------
  |  Branch (123:5): [True: 2.13k, False: 40.3k]
  ------------------
  124|  2.13k|      return "\xE2\x80\xA9";  // PS (U+2029)
  125|    634|    case 'x':
  ------------------
  |  Branch (125:5): [True: 634, False: 41.8k]
  ------------------
  126|    634|      return Escape(in, 2);
  127|    534|    case 'u':
  ------------------
  |  Branch (127:5): [True: 534, False: 41.9k]
  ------------------
  128|    534|      return Escape(in, 4);
  129|    548|    case 'U':
  ------------------
  |  Branch (129:5): [True: 548, False: 41.9k]
  ------------------
  130|    548|      return Escape(in, 8);
  131|  42.4k|  }
  132|       |
  133|    231|  std::stringstream msg;
  134|    231|  throw ParserException(in.mark(), std::string(ErrorMsg::INVALID_ESCAPE) + ch);
  135|  42.4k|}

_ZN4YAML3Exp8DocStartEv:
   84|  2.37M|inline const RegEx& DocStart() {
   85|  2.37M|  static const RegEx e = RegEx("---") + (BlankOrBreak() | RegEx());
   86|  2.37M|  return e;
   87|  2.37M|}
_ZN4YAML3Exp12BlankOrBreakEv:
   43|  36.6M|inline const RegEx& BlankOrBreak() {
   44|  36.6M|  static const RegEx e = Blank() | Break();
   45|  36.6M|  return e;
   46|  36.6M|}
_ZN4YAML3Exp5BlankEv:
   35|  39.6M|inline const RegEx& Blank() {
   36|  39.6M|  static const RegEx e = Space() | Tab();
   37|  39.6M|  return e;
   38|  39.6M|}
_ZN4YAML3Exp5SpaceEv:
   27|      1|inline const RegEx& Space() {
   28|      1|  static const RegEx e = RegEx(' ');
   29|      1|  return e;
   30|      1|}
_ZN4YAML3Exp6DocEndEv:
   88|  2.17M|inline const RegEx& DocEnd() {
   89|  2.17M|  static const RegEx e = RegEx("...") + (BlankOrBreak() | RegEx());
   90|  2.17M|  return e;
   91|  2.17M|}
_ZN4YAML3Exp10BlockEntryEv:
   96|  13.3M|inline const RegEx& BlockEntry() {
   97|  13.3M|  static const RegEx e = RegEx('-') + (BlankOrBreak() | RegEx());
   98|  13.3M|  return e;
   99|  13.3M|}
_ZN4YAML3Exp3KeyEv:
  100|  9.27M|inline const RegEx& Key() {
  101|  9.27M|  static const RegEx e = RegEx('?') + BlankOrBreak();
  102|  9.27M|  return e;
  103|  9.27M|}
_ZN4YAML3Exp9KeyInFlowEv:
  104|  1.86M|inline const RegEx& KeyInFlow() {
  105|  1.86M|  static const RegEx e = RegEx('?') + BlankOrBreak();
  106|  1.86M|  return e;
  107|  1.86M|}
_ZN4YAML3Exp11PlainScalarEv:
  153|  1.16M|inline const RegEx& PlainScalar() {
  154|  1.16M|  static const RegEx e =
  155|  1.16M|      !(BlankOrBreak() | RegEx(",[]{}#&*!|>\'\"%@`", REGEX_OR) |
  156|  1.16M|        (RegEx("-?:", REGEX_OR) + (BlankOrBreak() | RegEx())));
  157|  1.16M|  return e;
  158|  1.16M|}
_ZN4YAML3Exp17PlainScalarInFlowEv:
  159|  1.31M|inline const RegEx& PlainScalarInFlow() {
  160|  1.31M|  static const RegEx e =
  161|  1.31M|      !(BlankOrBreak() | RegEx("?,[]{}#&*!|>\'\"%@`", REGEX_OR) |
  162|  1.31M|        (RegEx("-:", REGEX_OR) + (Blank() | RegEx())));
  163|  1.31M|  return e;
  164|  1.31M|}
_ZN4YAML3Exp3TabEv:
   31|   100k|inline const RegEx& Tab() {
   32|   100k|  static const RegEx e = RegEx('\t');
   33|   100k|  return e;
   34|   100k|}
_ZN4YAML3Exp7CommentEv:
  124|  70.9M|inline const RegEx Comment() {
  125|  70.9M|  static const RegEx e = RegEx('#');
  126|  70.9M|  return e;
  127|  70.9M|}
_ZN4YAML3Exp5BreakEv:
   39|   214M|inline const RegEx& Break() {
   40|   214M|  static const RegEx e = RegEx('\n') | RegEx("\r\n") | RegEx('\r');
   41|   214M|  return e;
   42|   214M|}
_ZN4YAML3Exp5ValueEv:
  108|  9.26M|inline const RegEx& Value() {
  109|  9.26M|  static const RegEx e = RegEx(':') + (BlankOrBreak() | RegEx());
  110|  9.26M|  return e;
  111|  9.26M|}
_ZN4YAML3Exp15ValueInJSONFlowEv:
  116|  10.1k|inline const RegEx& ValueInJSONFlow() {
  117|  10.1k|  static const RegEx e = RegEx(':');
  118|  10.1k|  return e;
  119|  10.1k|}
_ZN4YAML3Exp11ValueInFlowEv:
  112|  1.83M|inline const RegEx& ValueInFlow() {
  113|  1.83M|  static const RegEx e = RegEx(':') + (BlankOrBreak() | RegEx(",]}", REGEX_OR));
  114|  1.83M|  return e;
  115|  1.83M|}
_ZN4YAML3Exp5EmptyEv:
   23|  3.20k|inline const RegEx& Empty() {
   24|  3.20k|  static const RegEx e;
   25|  3.20k|  return e;
   26|  3.20k|}
_ZN4YAML3Exp5DigitEv:
   47|    489|inline const RegEx& Digit() {
   48|    489|  static const RegEx e = RegEx('0', '9');
   49|    489|  return e;
   50|    489|}
_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|  9.00M|inline const RegEx& Word() {
   60|  9.00M|  static const RegEx e = AlphaNumeric() | RegEx('-');
   61|  9.00M|  return e;
   62|  9.00M|}
_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|  33.8M|inline const RegEx& Anchor() {
  129|  33.8M|  static const RegEx e = !(RegEx("[]{},", REGEX_OR) | BlankOrBreak());
  130|  33.8M|  return e;
  131|  33.8M|}
_ZN4YAML3Exp9AnchorEndEv:
  132|   498k|inline const RegEx& AnchorEnd() {
  133|   498k|  static const RegEx e = RegEx("?:,]}%@`", REGEX_OR) | BlankOrBreak();
  134|   498k|  return e;
  135|   498k|}
_ZN4YAML3Exp3URIEv:
  136|  9.05k|inline const RegEx& URI() {
  137|  9.05k|  static const RegEx e = Word() | RegEx("#;/?:@&=+$,_.!~*'()[]", REGEX_OR) |
  138|  9.05k|                         (RegEx('%') + Hex() + Hex());
  139|  9.05k|  return e;
  140|  9.05k|}
_ZN4YAML3Exp3TagEv:
  141|  3.42M|inline const RegEx& Tag() {
  142|  3.42M|  static const RegEx e = Word() | RegEx("#;/?:@&=+$_.~*'()", REGEX_OR) |
  143|  3.42M|                         (RegEx('%') + Hex() + Hex());
  144|  3.42M|  return e;
  145|  3.42M|}
_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|  1.31M|inline const RegEx& ScanScalarEndInFlow() {
  177|  1.31M|  static const RegEx e = (EndScalarInFlow() | (BlankOrBreak() + Comment()));
  178|  1.31M|  return e;
  179|  1.31M|}
_ZN4YAML3Exp13ScanScalarEndEv:
  181|  1.16M|inline const RegEx& ScanScalarEnd() {
  182|  1.16M|  static const RegEx e = EndScalar() | (BlankOrBreak() + Comment());
  183|  1.16M|  return e;
  184|  1.16M|}
_ZN4YAML3Exp14EscSingleQuoteEv:
  185|  1.72k|inline const RegEx& EscSingleQuote() {
  186|  1.72k|  static const RegEx e = RegEx("\'\'");
  187|  1.72k|  return e;
  188|  1.72k|}
_ZN4YAML3Exp8EscBreakEv:
  189|  10.6M|inline const RegEx& EscBreak() {
  190|  10.6M|  static const RegEx e = RegEx('\\') + Break();
  191|  10.6M|  return e;
  192|  10.6M|}
_ZN4YAML3Exp14ChompIndicatorEv:
  194|      3|inline const RegEx& ChompIndicator() {
  195|      3|  static const RegEx e = RegEx("+-", REGEX_OR);
  196|      3|  return e;
  197|      3|}
_ZN4YAML3Exp5ChompEv:
  198|  3.24k|inline const RegEx& Chomp() {
  199|  3.24k|  static const RegEx e = (ChompIndicator() + Digit()) |
  200|  3.24k|                         (Digit() + ChompIndicator()) | ChompIndicator() |
  201|  3.24k|                         Digit();
  202|  3.24k|  return e;
  203|  3.24k|}

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

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

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

_ZN4YAML12IsNullStringEPKcm:
   13|   210k|bool IsNullString(const char* str, std::size_t size) {
   14|   210k|  return size == 0 || same(str, size, "~") || same(str, size, "null") ||
  ------------------
  |  Branch (14:10): [True: 0, False: 210k]
  |  Branch (14:23): [True: 14.6k, False: 195k]
  |  Branch (14:47): [True: 328, False: 195k]
  ------------------
   15|   195k|         same(str, size, "Null") || same(str, size, "NULL");
  ------------------
  |  Branch (15:10): [True: 408, False: 194k]
  |  Branch (15:37): [True: 27, False: 194k]
  ------------------
   16|   210k|}
null.cpp:_ZN4YAMLL4sameILm2EEEbPKcmRAT__S1_:
    8|   210k|static bool same(const char* str, std::size_t size, const char (&literal)[N]) {
    9|   210k|  constexpr int literalSize = N - 1; // minus null terminator
   10|   210k|  return size == literalSize && std::strncmp(str, literal, literalSize) == 0;
  ------------------
  |  Branch (10:10): [True: 188k, False: 21.4k]
  |  Branch (10:33): [True: 14.6k, False: 174k]
  ------------------
   11|   210k|}
null.cpp:_ZN4YAMLL4sameILm5EEEbPKcmRAT__S1_:
    8|   586k|static bool same(const char* str, std::size_t size, const char (&literal)[N]) {
    9|   586k|  constexpr int literalSize = N - 1; // minus null terminator
   10|   586k|  return size == literalSize && std::strncmp(str, literal, literalSize) == 0;
  ------------------
  |  Branch (10:10): [True: 12.4k, False: 573k]
  |  Branch (10:33): [True: 763, False: 11.6k]
  ------------------
   11|   586k|}

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

_ZN4YAML6ParserC2Ev:
   14|  6.40k|Parser::Parser() : m_pScanner{}, m_pDirectives{} {}
_ZN4YAML6ParserC2ERNSt3__113basic_istreamIcNS1_11char_traitsIcEEEE:
   16|  6.40k|Parser::Parser(std::istream& in) : Parser() { Load(in); }
_ZN4YAML6ParserD2Ev:
   18|  6.40k|Parser::~Parser() = default;
_ZN4YAML6Parser4LoadERNSt3__113basic_istreamIcNS1_11char_traitsIcEEEE:
   22|  6.40k|void Parser::Load(std::istream& in) {
   23|  6.40k|  m_pScanner.reset(new Scanner(in));
   24|  6.40k|  m_pDirectives.reset(new Directives);
   25|  6.40k|}
_ZN4YAML6Parser18HandleNextDocumentERNS_12EventHandlerE:
   27|   323k|bool Parser::HandleNextDocument(EventHandler& eventHandler) {
   28|   323k|  if (!m_pScanner)
  ------------------
  |  Branch (28:7): [True: 0, False: 323k]
  ------------------
   29|      0|    return false;
   30|       |
   31|   323k|  ParseDirectives();
   32|   323k|  if (m_pScanner->empty()) {
  ------------------
  |  Branch (32:7): [True: 2.75k, False: 320k]
  ------------------
   33|  2.75k|    return false;
   34|  2.75k|  }
   35|       |
   36|   320k|  auto oldPos = m_pScanner->peek().mark.pos;
   37|       |
   38|   320k|  SingleDocParser sdp(*m_pScanner, *m_pDirectives);
   39|   320k|  sdp.HandleDocument(eventHandler);
   40|       |
   41|       |  // checks if progress was made
   42|       |  // 1. if scanner has no more tokens, progress was made
   43|   320k|  if (m_pScanner->empty()) {
  ------------------
  |  Branch (43:7): [True: 2.02k, False: 318k]
  ------------------
   44|  2.02k|    return true;
   45|  2.02k|  }
   46|       |
   47|       |  // 2. if token position has changed, progress was made
   48|   318k|  auto newPos = m_pScanner->peek().mark.pos;
   49|   318k|  if (newPos != oldPos) {
  ------------------
  |  Branch (49:7): [True: 314k, False: 3.64k]
  ------------------
   50|   314k|    return true;
   51|   314k|  }
   52|       |  // No progress was made, no further processing
   53|  3.64k|  return false;
   54|   318k|}
_ZN4YAML6Parser15ParseDirectivesEv:
   56|   323k|void Parser::ParseDirectives() {
   57|   323k|  bool readDirective = false;
   58|       |
   59|   334k|  while (!m_pScanner->empty()) {
  ------------------
  |  Branch (59:10): [True: 330k, False: 3.60k]
  ------------------
   60|   330k|    Token& token = m_pScanner->peek();
   61|   330k|    if (token.type != Token::DIRECTIVE) {
  ------------------
  |  Branch (61:9): [True: 319k, False: 10.8k]
  ------------------
   62|   319k|      break;
   63|   319k|    }
   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|  10.8k|    if (!readDirective) {
  ------------------
  |  Branch (67:9): [True: 4.03k, False: 6.81k]
  ------------------
   68|  4.03k|      m_pDirectives.reset(new Directives);
   69|  4.03k|    }
   70|       |
   71|  10.8k|    readDirective = true;
   72|  10.8k|    HandleDirective(token);
   73|  10.8k|    m_pScanner->pop();
   74|  10.8k|  }
   75|   323k|}
_ZN4YAML6Parser15HandleDirectiveERKNS_5TokenE:
   77|  10.8k|void Parser::HandleDirective(const Token& token) {
   78|  10.8k|  if (token.value == "YAML") {
  ------------------
  |  Branch (78:7): [True: 1.66k, False: 9.18k]
  ------------------
   79|  1.66k|    HandleYamlDirective(token);
   80|  9.18k|  } else if (token.value == "TAG") {
  ------------------
  |  Branch (80:14): [True: 5.54k, False: 3.63k]
  ------------------
   81|  5.54k|    HandleTagDirective(token);
   82|  5.54k|  }
   83|  10.8k|}
_ZN4YAML6Parser19HandleYamlDirectiveERKNS_5TokenE:
   85|  1.66k|void Parser::HandleYamlDirective(const Token& token) {
   86|  1.66k|  if (token.params.size() != 1) {
  ------------------
  |  Branch (86:7): [True: 27, False: 1.63k]
  ------------------
   87|     27|    throw ParserException(token.mark, ErrorMsg::YAML_DIRECTIVE_ARGS);
   88|     27|  }
   89|       |
   90|  1.63k|  if (!m_pDirectives->version.isDefault) {
  ------------------
  |  Branch (90:7): [True: 1, False: 1.63k]
  ------------------
   91|      1|    throw ParserException(token.mark, ErrorMsg::REPEATED_YAML_DIRECTIVE);
   92|      1|  }
   93|       |
   94|  1.63k|  std::stringstream str(token.params[0]);
   95|  1.63k|  str.imbue(std::locale::classic());
   96|  1.63k|  str >> m_pDirectives->version.major;
   97|  1.63k|  str.get();
   98|  1.63k|  str >> m_pDirectives->version.minor;
   99|  1.63k|  if (!str || str.peek() != EOF) {
  ------------------
  |  Branch (99:7): [True: 14, False: 1.62k]
  |  Branch (99:15): [True: 10, False: 1.61k]
  ------------------
  100|     24|    throw ParserException(
  101|     24|        token.mark, std::string(ErrorMsg::YAML_VERSION) + token.params[0]);
  102|     24|  }
  103|       |
  104|  1.61k|  if (m_pDirectives->version.major > 1) {
  ------------------
  |  Branch (104:7): [True: 18, False: 1.59k]
  ------------------
  105|     18|    throw ParserException(token.mark, ErrorMsg::YAML_MAJOR_VERSION);
  106|     18|  }
  107|       |
  108|  1.59k|  m_pDirectives->version.isDefault = false;
  109|       |  // TODO: warning on major == 1, minor > 2?
  110|  1.59k|}
_ZN4YAML6Parser18HandleTagDirectiveERKNS_5TokenE:
  112|  5.54k|void Parser::HandleTagDirective(const Token& token) {
  113|  5.54k|  if (token.params.size() != 2)
  ------------------
  |  Branch (113:7): [True: 24, False: 5.52k]
  ------------------
  114|     24|    throw ParserException(token.mark, ErrorMsg::TAG_DIRECTIVE_ARGS);
  115|       |
  116|  5.52k|  const std::string& handle = token.params[0];
  117|  5.52k|  const std::string& prefix = token.params[1];
  118|  5.52k|  if (m_pDirectives->tags.find(handle) != m_pDirectives->tags.end()) {
  ------------------
  |  Branch (118:7): [True: 6, False: 5.51k]
  ------------------
  119|      6|    throw ParserException(token.mark, ErrorMsg::REPEATED_TAG_DIRECTIVE);
  120|      6|  }
  121|       |
  122|  5.51k|  m_pDirectives->tags[handle] = prefix;
  123|  5.51k|}

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

_ZN4YAML5RegExC2ENS_8REGEX_OPE:
    6|  3.51k|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|  7.81k|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|  1.72k|RegEx operator!(const RegEx& ex) {
   18|  1.72k|  RegEx ret(REGEX_NOT);
   19|  1.72k|  ret.m_params.push_back(ex);
   20|  1.72k|  return ret;
   21|  1.72k|}
_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|  1.72k|RegEx operator&(const RegEx& ex1, const RegEx& ex2) {
   31|  1.72k|  RegEx ret(REGEX_AND);
   32|  1.72k|  ret.m_params.push_back(ex1);
   33|  1.72k|  ret.m_params.push_back(ex2);
   34|  1.72k|  return ret;
   35|  1.72k|}
_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|  70.9M|  ~RegEx() = default;

_ZNK4YAML5RegEx7MatchesERKNS_6StreamE:
   26|   521M|inline bool RegEx::Matches(const Stream& in) const { return Match(in) >= 0; }
_ZNK4YAML5RegEx5MatchERKNS_6StreamE:
   49|   580M|inline int RegEx::Match(const Stream& in) const {
   50|   580M|  StreamCharSource source(in);
   51|   580M|  return Match(source);
   52|   580M|}
_ZNK4YAML5RegEx5MatchINS_16StreamCharSourceEEEiRKT_:
   72|  1.20G|inline int RegEx::Match(const Source& source) const {
   73|  1.20G|  return IsValidSource(source) ? MatchUnchecked(source) : -1;
  ------------------
  |  Branch (73:10): [True: 1.20G, False: 0]
  ------------------
   74|  1.20G|}
_ZNK4YAML5RegEx13IsValidSourceINS_16StreamCharSourceEEEbRKT_:
   55|  1.20G|inline bool RegEx::IsValidSource(const Source& source) const {
   56|  1.20G|  return source;
   57|  1.20G|}
_ZNK4YAML5RegEx14MatchUncheckedINS_16StreamCharSourceEEEiRKT_:
   77|  3.86G|inline int RegEx::MatchUnchecked(const Source& source) const {
   78|  3.86G|  switch (m_op) {
  ------------------
  |  Branch (78:11): [True: 3.86G, False: 0]
  ------------------
   79|  22.6M|    case REGEX_EMPTY:
  ------------------
  |  Branch (79:5): [True: 22.6M, False: 3.84G]
  ------------------
   80|  22.6M|      return MatchOpEmpty(source);
   81|  1.97G|    case REGEX_MATCH:
  ------------------
  |  Branch (81:5): [True: 1.97G, False: 1.88G]
  ------------------
   82|  1.97G|      return MatchOpMatch(source);
   83|  26.6M|    case REGEX_RANGE:
  ------------------
  |  Branch (83:5): [True: 26.6M, False: 3.83G]
  ------------------
   84|  26.6M|      return MatchOpRange(source);
   85|  1.25G|    case REGEX_OR:
  ------------------
  |  Branch (85:5): [True: 1.25G, False: 2.61G]
  ------------------
   86|  1.25G|      return MatchOpOr(source);
   87|  18.0M|    case REGEX_AND:
  ------------------
  |  Branch (87:5): [True: 18.0M, False: 3.84G]
  ------------------
   88|  18.0M|      return MatchOpAnd(source);
   89|  36.3M|    case REGEX_NOT:
  ------------------
  |  Branch (89:5): [True: 36.3M, False: 3.82G]
  ------------------
   90|  36.3M|      return MatchOpNot(source);
   91|   528M|    case REGEX_SEQ:
  ------------------
  |  Branch (91:5): [True: 528M, False: 3.33G]
  ------------------
   92|   528M|      return MatchOpSeq(source);
   93|  3.86G|  }
   94|       |
   95|      0|  return -1;
   96|  3.86G|}
_ZNK4YAML5RegEx12MatchOpEmptyINS_16StreamCharSourceEEEiRKT_:
  106|  22.6M|inline int RegEx::MatchOpEmpty(const Source& source) const {
  107|  22.6M|  return source[0] == Stream::eof() ? 0 : -1;
  ------------------
  |  Branch (107:10): [True: 1.54M, False: 21.0M]
  ------------------
  108|  22.6M|}
_ZNK4YAML5RegEx12MatchOpMatchINS_16StreamCharSourceEEEiRKT_:
  119|  1.97G|inline int RegEx::MatchOpMatch(const Source& source) const {
  120|  1.97G|  if (source[0] != m_a)
  ------------------
  |  Branch (120:7): [True: 1.79G, False: 186M]
  ------------------
  121|  1.79G|    return -1;
  122|   186M|  return 1;
  123|  1.97G|}
_ZNK4YAML5RegEx12MatchOpRangeINS_16StreamCharSourceEEEiRKT_:
  127|  26.6M|inline int RegEx::MatchOpRange(const Source& source) const {
  128|  26.6M|  if (m_a > source[0] || m_z < source[0])
  ------------------
  |  Branch (128:7): [True: 21.0M, False: 5.50M]
  |  Branch (128:26): [True: 60.2k, False: 5.44M]
  ------------------
  129|  21.1M|    return -1;
  130|  5.44M|  return 1;
  131|  26.6M|}
_ZNK4YAML5RegEx9MatchOpOrINS_16StreamCharSourceEEEiRKT_:
  135|  1.25G|inline int RegEx::MatchOpOr(const Source& source) const {
  136|  2.60G|  for (const RegEx& param : m_params) {
  ------------------
  |  Branch (136:27): [True: 2.60G, False: 1.05G]
  ------------------
  137|  2.60G|    int n = param.MatchUnchecked(source);
  138|  2.60G|    if (n >= 0)
  ------------------
  |  Branch (138:9): [True: 199M, False: 2.40G]
  ------------------
  139|   199M|      return n;
  140|  2.60G|  }
  141|  1.05G|  return -1;
  142|  1.25G|}
_ZNK4YAML5RegEx10MatchOpAndINS_16StreamCharSourceEEEiRKT_:
  149|  18.0M|inline int RegEx::MatchOpAnd(const Source& source) const {
  150|  18.0M|  int first = -1;
  151|  18.0M|  for (std::size_t i = 0; i < m_params.size(); i++) {
  ------------------
  |  Branch (151:27): [True: 18.0M, False: 3.18k]
  ------------------
  152|  18.0M|    int n = m_params[i].MatchUnchecked(source);
  153|  18.0M|    if (n == -1)
  ------------------
  |  Branch (153:9): [True: 18.0M, False: 7.15k]
  ------------------
  154|  18.0M|      return -1;
  155|  7.15k|    if (i == 0)
  ------------------
  |  Branch (155:9): [True: 3.97k, False: 3.18k]
  ------------------
  156|  3.97k|      first = n;
  157|  7.15k|  }
  158|  3.18k|  return first;
  159|  18.0M|}
_ZNK4YAML5RegEx10MatchOpNotINS_16StreamCharSourceEEEiRKT_:
  163|  36.3M|inline int RegEx::MatchOpNot(const Source& source) const {
  164|  36.3M|  if (m_params.empty())
  ------------------
  |  Branch (164:7): [True: 0, False: 36.3M]
  ------------------
  165|      0|    return -1;
  166|  36.3M|  if (m_params[0].MatchUnchecked(source) >= 0)
  ------------------
  |  Branch (166:7): [True: 499k, False: 35.8M]
  ------------------
  167|   499k|    return -1;
  168|  35.8M|  return 1;
  169|  36.3M|}
_ZNK4YAML5RegEx10MatchOpSeqINS_16StreamCharSourceEEEiRKT_:
  173|   528M|inline int RegEx::MatchOpSeq(const Source& source) const {
  174|   528M|  int offset = 0;
  175|   624M|  for (const RegEx& param : m_params) {
  ------------------
  |  Branch (175:27): [True: 624M, False: 9.95M]
  ------------------
  176|   624M|    int n = param.Match(source + offset);  // note Match, not
  177|       |                                           // MatchUnchecked because we
  178|       |                                           // need to check validity after
  179|       |                                           // the offset
  180|   624M|    if (n == -1)
  ------------------
  |  Branch (180:9): [True: 518M, False: 106M]
  ------------------
  181|   518M|      return -1;
  182|   106M|    offset += n;
  183|   106M|  }
  184|       |
  185|  9.95M|  return offset;
  186|   528M|}
_ZNK4YAML5RegEx7MatchesEc:
   16|    484|inline bool RegEx::Matches(char ch) const {
   17|    484|  std::string str;
   18|    484|  str += ch;
   19|    484|  return Matches(str);
   20|    484|}
_ZNK4YAML5RegEx7MatchesERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
   22|    484|inline bool RegEx::Matches(const std::string& str) const {
   23|    484|  return Match(str) >= 0;
   24|    484|}
_ZNK4YAML5RegEx5MatchERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
   44|    484|inline int RegEx::Match(const std::string& str) const {
   45|    484|  StringCharSource source(str.c_str(), str.size());
   46|    484|  return Match(source);
   47|    484|}
_ZNK4YAML5RegEx13IsValidSourceINS_16StringCharSourceEEEbRKT_:
   61|    484|    const StringCharSource& source) const {
   62|    484|  switch (m_op) {
   63|      0|    case REGEX_MATCH:
  ------------------
  |  Branch (63:5): [True: 0, False: 484]
  ------------------
   64|    484|    case REGEX_RANGE:
  ------------------
  |  Branch (64:5): [True: 484, False: 0]
  ------------------
   65|    484|      return source;
   66|      0|    default:
  ------------------
  |  Branch (66:5): [True: 0, False: 484]
  ------------------
   67|      0|      return true;
   68|    484|  }
   69|    484|}
_ZNK4YAML5RegEx5MatchINS_16StringCharSourceEEEiRKT_:
   72|    484|inline int RegEx::Match(const Source& source) const {
   73|    484|  return IsValidSource(source) ? MatchUnchecked(source) : -1;
  ------------------
  |  Branch (73:10): [True: 484, False: 0]
  ------------------
   74|    484|}
_ZNK4YAML5RegEx14MatchUncheckedINS_16StringCharSourceEEEiRKT_:
   77|    484|inline int RegEx::MatchUnchecked(const Source& source) const {
   78|    484|  switch (m_op) {
  ------------------
  |  Branch (78:11): [True: 484, False: 0]
  ------------------
   79|      0|    case REGEX_EMPTY:
  ------------------
  |  Branch (79:5): [True: 0, False: 484]
  ------------------
   80|      0|      return MatchOpEmpty(source);
   81|      0|    case REGEX_MATCH:
  ------------------
  |  Branch (81:5): [True: 0, False: 484]
  ------------------
   82|      0|      return MatchOpMatch(source);
   83|    484|    case REGEX_RANGE:
  ------------------
  |  Branch (83:5): [True: 484, False: 0]
  ------------------
   84|    484|      return MatchOpRange(source);
   85|      0|    case REGEX_OR:
  ------------------
  |  Branch (85:5): [True: 0, False: 484]
  ------------------
   86|      0|      return MatchOpOr(source);
   87|      0|    case REGEX_AND:
  ------------------
  |  Branch (87:5): [True: 0, False: 484]
  ------------------
   88|      0|      return MatchOpAnd(source);
   89|      0|    case REGEX_NOT:
  ------------------
  |  Branch (89:5): [True: 0, False: 484]
  ------------------
   90|      0|      return MatchOpNot(source);
   91|      0|    case REGEX_SEQ:
  ------------------
  |  Branch (91:5): [True: 0, False: 484]
  ------------------
   92|      0|      return MatchOpSeq(source);
   93|    484|  }
   94|       |
   95|      0|  return -1;
   96|    484|}
_ZNK4YAML5RegEx12MatchOpRangeINS_16StringCharSourceEEEiRKT_:
  127|    484|inline int RegEx::MatchOpRange(const Source& source) const {
  128|    484|  if (m_a > source[0] || m_z < source[0])
  ------------------
  |  Branch (128:7): [True: 0, False: 484]
  |  Branch (128:26): [True: 0, False: 484]
  ------------------
  129|      0|    return -1;
  130|    484|  return 1;
  131|    484|}

_ZN4YAML7ScannerC2ERNSt3__113basic_istreamIcNS1_11char_traitsIcEEEE:
   11|  6.40k|    : INPUT(in),
   12|  6.40k|      m_tokens{},
   13|  6.40k|      m_startedStream(false),
   14|  6.40k|      m_endedStream(false),
   15|  6.40k|      m_simpleKeyAllowed(false),
   16|  6.40k|      m_scalarValueAllowed(false),
   17|  6.40k|      m_canBeJSONFlow(false),
   18|  6.40k|      m_simpleKeys{},
   19|  6.40k|      m_indents{},
   20|  6.40k|      m_indentRefs{},
   21|  6.40k|      m_flows{} {}
_ZN4YAML7ScannerD2Ev:
   23|  6.40k|Scanner::~Scanner() = default;
_ZN4YAML7Scanner5emptyEv:
   25|  13.7M|bool Scanner::empty() {
   26|  13.7M|  EnsureTokensInQueue();
   27|  13.7M|  return m_tokens.empty();
   28|  13.7M|}
_ZN4YAML7Scanner3popEv:
   30|  3.49M|void Scanner::pop() {
   31|  3.49M|  EnsureTokensInQueue();
   32|  3.49M|  if (!m_tokens.empty())
  ------------------
  |  Branch (32:7): [True: 3.49M, False: 0]
  ------------------
   33|  3.49M|    m_tokens.pop();
   34|  3.49M|}
_ZN4YAML7Scanner4peekEv:
   36|  19.7M|Token& Scanner::peek() {
   37|  19.7M|  EnsureTokensInQueue();
   38|  19.7M|  assert(!m_tokens.empty());  // should we be asserting here? I mean, we really
   39|       |                              // just be checking
   40|       |                              // if it's empty before peeking.
   41|       |
   42|       |#if 0
   43|       |		static Token *pLast = 0;
   44|       |		if(pLast != &m_tokens.front())
   45|       |			std::cerr << "peek: " << m_tokens.front() << "\n";
   46|       |		pLast = &m_tokens.front();
   47|       |#endif
   48|       |
   49|  19.7M|  return m_tokens.front();
   50|  19.7M|}
_ZNK4YAML7Scanner4markEv:
   52|  2.24M|Mark Scanner::mark() const { return INPUT.mark(); }
_ZN4YAML7Scanner19EnsureTokensInQueueEv:
   54|  37.0M|void Scanner::EnsureTokensInQueue() {
   55|  98.3M|  while (true) {
  ------------------
  |  Branch (55:10): [True: 98.3M, Folded]
  ------------------
   56|  98.3M|    if (!m_tokens.empty()) {
  ------------------
  |  Branch (56:9): [True: 97.4M, False: 869k]
  ------------------
   57|  97.4M|      Token& token = m_tokens.front();
   58|       |
   59|       |      // if this guy's valid, then we're done
   60|  97.4M|      if (token.status == Token::VALID) {
  ------------------
  |  Branch (60:11): [True: 36.4M, False: 60.9M]
  ------------------
   61|  36.4M|        return;
   62|  36.4M|      }
   63|       |
   64|       |      // here's where we clean up the impossible tokens
   65|  60.9M|      if (token.status == Token::INVALID) {
  ------------------
  |  Branch (65:11): [True: 527k, False: 60.4M]
  ------------------
   66|   527k|        m_tokens.pop();
   67|   527k|        continue;
   68|   527k|      }
   69|       |
   70|       |      // note: what's left are the unverified tokens
   71|  60.9M|    }
   72|       |
   73|       |    // no token? maybe we've actually finished
   74|  61.3M|    if (m_endedStream) {
  ------------------
  |  Branch (74:9): [True: 592k, False: 60.7M]
  ------------------
   75|   592k|      return;
   76|   592k|    }
   77|       |
   78|       |    // no? then scan...
   79|  60.7M|    ScanNextToken();
   80|  60.7M|  }
   81|  37.0M|}
_ZN4YAML7Scanner13ScanNextTokenEv:
   83|  60.7M|void Scanner::ScanNextToken() {
   84|  60.7M|  if (m_endedStream) {
  ------------------
  |  Branch (84:7): [True: 0, False: 60.7M]
  ------------------
   85|      0|    return;
   86|      0|  }
   87|       |
   88|  60.7M|  if (!m_startedStream) {
  ------------------
  |  Branch (88:7): [True: 6.40k, False: 60.7M]
  ------------------
   89|  6.40k|    return StartStream();
   90|  6.40k|  }
   91|       |
   92|       |  // get rid of whitespace, etc. (in between tokens it should be irrelevant)
   93|  60.7M|  ScanToNextToken();
   94|       |
   95|       |  // maybe need to end some blocks
   96|  60.7M|  PopIndentToHere();
   97|       |
   98|       |  // *****
   99|       |  // And now branch based on the next few characters!
  100|       |  // *****
  101|       |
  102|       |  // end of stream
  103|  60.7M|  if (!INPUT) {
  ------------------
  |  Branch (103:7): [True: 5.29k, False: 60.7M]
  ------------------
  104|  5.29k|    return EndStream();
  105|  5.29k|  }
  106|       |
  107|  60.7M|  if (INPUT.column() == 0 && INPUT.peek() == Keys::Directive) {
  ------------------
  |  Branch (107:7): [True: 2.39M, False: 58.3M]
  |  Branch (107:30): [True: 11.7k, False: 2.37M]
  ------------------
  108|  11.7k|    return ScanDirective();
  109|  11.7k|  }
  110|       |
  111|       |  // document token
  112|  60.7M|  if (INPUT.column() == 0 && Exp::DocStart().Matches(INPUT)) {
  ------------------
  |  Branch (112:7): [True: 2.37M, False: 58.3M]
  |  Branch (112:30): [True: 200k, False: 2.17M]
  ------------------
  113|   200k|    return ScanDocStart();
  114|   200k|  }
  115|       |
  116|  60.5M|  if (INPUT.column() == 0 && Exp::DocEnd().Matches(INPUT)) {
  ------------------
  |  Branch (116:7): [True: 2.17M, False: 58.3M]
  |  Branch (116:30): [True: 162k, False: 2.01M]
  ------------------
  117|   162k|    return ScanDocEnd();
  118|   162k|  }
  119|       |
  120|       |  // flow start/end/entry
  121|  60.3M|  if (INPUT.peek() == Keys::FlowSeqStart ||
  ------------------
  |  Branch (121:7): [True: 30.7M, False: 29.6M]
  ------------------
  122|  43.4M|      INPUT.peek() == Keys::FlowMapStart) {
  ------------------
  |  Branch (122:7): [True: 12.7M, False: 16.9M]
  ------------------
  123|  43.4M|    return ScanFlowStart();
  124|  43.4M|  }
  125|       |
  126|  16.9M|  if (INPUT.peek() == Keys::FlowSeqEnd || INPUT.peek() == Keys::FlowMapEnd) {
  ------------------
  |  Branch (126:7): [True: 23.7k, False: 16.8M]
  |  Branch (126:43): [True: 1.24M, False: 15.6M]
  ------------------
  127|  1.26M|    return ScanFlowEnd();
  128|  1.26M|  }
  129|       |
  130|  15.6M|  if (INPUT.peek() == Keys::FlowEntry) {
  ------------------
  |  Branch (130:7): [True: 3.27M, False: 12.3M]
  ------------------
  131|       |    // values starting with `,` are not allowed.
  132|       |    // eg: reject `,foo`
  133|  3.27M|    if (INPUT.column() == 0) {
  ------------------
  |  Branch (133:9): [True: 7, False: 3.27M]
  ------------------
  134|      7|      throw ParserException(INPUT.mark(), ErrorMsg::UNEXPECTED_FLOW);
  135|      7|    }
  136|       |    // if we already parsed a quoted scalar value and we are not in a flow,
  137|       |    // then `,` is not a valid character.
  138|       |    // eg: reject `"foo",`
  139|  3.27M|    if (!m_scalarValueAllowed) {
  ------------------
  |  Branch (139:9): [True: 3, False: 3.27M]
  ------------------
  140|      3|      throw ParserException(INPUT.mark(), ErrorMsg::UNEXPECTED_SCALAR);
  141|      3|    }
  142|  3.27M|    return ScanFlowEntry();
  143|  3.27M|  }
  144|       |
  145|       |  // block/map stuff
  146|  12.3M|  if (Exp::BlockEntry().Matches(INPUT)) {
  ------------------
  |  Branch (146:7): [True: 1.22M, False: 11.1M]
  ------------------
  147|  1.22M|    return ScanBlockEntry();
  148|  1.22M|  }
  149|       |
  150|  11.1M|  if ((InBlockContext() ? Exp::Key() : Exp::KeyInFlow()).Matches(INPUT)) {
  ------------------
  |  Branch (150:7): [True: 29.5k, False: 11.1M]
  |  Branch (150:8): [True: 9.27M, False: 1.86M]
  ------------------
  151|  29.5k|    return ScanKey();
  152|  29.5k|  }
  153|       |
  154|  11.1M|  if (GetValueRegex().Matches(INPUT)) {
  ------------------
  |  Branch (154:7): [True: 7.05M, False: 4.05M]
  ------------------
  155|  7.05M|    return ScanValue();
  156|  7.05M|  }
  157|       |
  158|       |  // alias/anchor
  159|  4.05M|  if (INPUT.peek() == Keys::Alias || INPUT.peek() == Keys::Anchor) {
  ------------------
  |  Branch (159:7): [True: 4.49k, False: 4.04M]
  |  Branch (159:38): [True: 494k, False: 3.55M]
  ------------------
  160|   499k|    return ScanAnchorOrAlias();
  161|   499k|  }
  162|       |
  163|       |  // tag
  164|  3.55M|  if (INPUT.peek() == Keys::Tag) {
  ------------------
  |  Branch (164:7): [True: 1.05M, False: 2.49M]
  ------------------
  165|  1.05M|    return ScanTag();
  166|  1.05M|  }
  167|       |
  168|       |  // special scalars
  169|  2.49M|  if (InBlockContext() && (INPUT.peek() == Keys::LiteralScalar ||
  ------------------
  |  Branch (169:7): [True: 1.17M, False: 1.32M]
  |  Branch (169:28): [True: 635, False: 1.17M]
  ------------------
  170|  1.17M|                           INPUT.peek() == Keys::FoldedScalar)) {
  ------------------
  |  Branch (170:28): [True: 2.61k, False: 1.17M]
  ------------------
  171|  3.24k|    return ScanBlockScalar();
  172|  3.24k|  }
  173|       |
  174|       |  // if we already parsed a quoted scalar value in this line,
  175|       |  // another scalar value is an error.
  176|       |  // eg: reject `"foo" "bar"`
  177|  2.49M|  if (!m_scalarValueAllowed) {
  ------------------
  |  Branch (177:7): [True: 35, False: 2.49M]
  ------------------
  178|     35|    throw ParserException(INPUT.mark(), ErrorMsg::UNEXPECTED_SCALAR);
  179|     35|  }
  180|       |
  181|  2.49M|  if (INPUT.peek() == '\'' || INPUT.peek() == '\"') {
  ------------------
  |  Branch (181:7): [True: 1.72k, False: 2.49M]
  |  Branch (181:31): [True: 5.96k, False: 2.48M]
  ------------------
  182|  7.68k|    return ScanQuotedScalar();
  183|  7.68k|  }
  184|       |
  185|       |  // plain scalars
  186|  2.48M|  if ((InBlockContext() ? Exp::PlainScalar() : Exp::PlainScalarInFlow())
  ------------------
  |  Branch (186:7): [True: 2.48M, False: 42]
  |  Branch (186:8): [True: 1.16M, False: 1.31M]
  ------------------
  187|  2.48M|          .Matches(INPUT)) {
  188|  2.48M|    return ScanPlainScalar();
  189|  2.48M|  }
  190|       |
  191|       |  // don't know what it is!
  192|     42|  throw ParserException(INPUT.mark(), ErrorMsg::UNKNOWN_TOKEN);
  193|  2.48M|}
_ZN4YAML7Scanner15ScanToNextTokenEv:
  195|  60.7M|void Scanner::ScanToNextToken() {
  196|  69.3M|  while (true) {
  ------------------
  |  Branch (196:10): [True: 69.3M, Folded]
  ------------------
  197|       |    // first eat whitespace
  198|  69.5M|    while (INPUT && IsWhitespaceToBeEaten(INPUT.peek())) {
  ------------------
  |  Branch (198:12): [True: 69.5M, False: 5.22k]
  |  Branch (198:21): [True: 137k, False: 69.3M]
  ------------------
  199|   137k|      if (InBlockContext() && Exp::Tab().Matches(INPUT)) {
  ------------------
  |  Branch (199:11): [True: 100k, False: 37.1k]
  |  Branch (199:31): [True: 1.43k, False: 99.0k]
  ------------------
  200|  1.43k|        m_simpleKeyAllowed = false;
  201|  1.43k|      }
  202|   137k|      INPUT.eat(1);
  203|   137k|    }
  204|       |
  205|       |    // then eat a comment
  206|  69.3M|    if (Exp::Comment().Matches(INPUT)) {
  ------------------
  |  Branch (206:9): [True: 1.74k, False: 69.3M]
  ------------------
  207|       |      // eat until line break
  208|  6.13M|      while (INPUT && !Exp::Break().Matches(INPUT)) {
  ------------------
  |  Branch (208:14): [True: 6.13M, False: 75]
  |  Branch (208:23): [True: 6.13M, False: 1.66k]
  ------------------
  209|  6.13M|        INPUT.eat(1);
  210|  6.13M|      }
  211|  1.74k|    }
  212|       |
  213|       |    // if it's NOT a line break, then we're done!
  214|  69.3M|    if (!Exp::Break().Matches(INPUT)) {
  ------------------
  |  Branch (214:9): [True: 60.7M, False: 8.66M]
  ------------------
  215|  60.7M|      break;
  216|  60.7M|    }
  217|       |
  218|       |    // otherwise, let's eat the line break and keep going
  219|  8.66M|    int n = Exp::Break().Match(INPUT);
  220|  8.66M|    INPUT.eat(n);
  221|       |
  222|       |    // oh yeah, and let's get rid of that simple key
  223|  8.66M|    InvalidateSimpleKey();
  224|       |
  225|       |    // new line - we accept a scalar value now
  226|  8.66M|    m_scalarValueAllowed = true;
  227|       |
  228|       |    // new line - we may be able to accept a simple key now
  229|  8.66M|    if (InBlockContext()) {
  ------------------
  |  Branch (229:9): [True: 8.56M, False: 92.1k]
  ------------------
  230|  8.56M|      m_simpleKeyAllowed = true;
  231|  8.56M|    }
  232|  8.66M|  }
  233|  60.7M|}
_ZN4YAML7Scanner21IsWhitespaceToBeEatenEc:
  247|  69.5M|bool Scanner::IsWhitespaceToBeEaten(char ch) {
  248|  69.5M|  if (ch == ' ') {
  ------------------
  |  Branch (248:7): [True: 111k, False: 69.4M]
  ------------------
  249|   111k|    return true;
  250|   111k|  }
  251|       |
  252|  69.4M|  if (ch == '\t') {
  ------------------
  |  Branch (252:7): [True: 26.4k, False: 69.3M]
  ------------------
  253|  26.4k|    return true;
  254|  26.4k|  }
  255|       |
  256|  69.3M|  return false;
  257|  69.4M|}
_ZNK4YAML7Scanner13GetValueRegexEv:
  259|  11.1M|const RegEx& Scanner::GetValueRegex() const {
  260|  11.1M|  if (InBlockContext()) {
  ------------------
  |  Branch (260:7): [True: 9.26M, False: 1.84M]
  ------------------
  261|  9.26M|    return Exp::Value();
  262|  9.26M|  }
  263|       |
  264|  1.84M|  return m_canBeJSONFlow ? Exp::ValueInJSONFlow() : Exp::ValueInFlow();
  ------------------
  |  Branch (264:10): [True: 10.1k, False: 1.83M]
  ------------------
  265|  11.1M|}
_ZN4YAML7Scanner11StartStreamEv:
  267|  6.40k|void Scanner::StartStream() {
  268|  6.40k|  m_startedStream = true;
  269|  6.40k|  m_simpleKeyAllowed = true;
  270|  6.40k|  m_scalarValueAllowed = true;
  271|  6.40k|  std::unique_ptr<IndentMarker> pIndent(
  272|  6.40k|      new IndentMarker(-1, IndentMarker::NONE));
  273|  6.40k|  m_indentRefs.push_back(std::move(pIndent));
  274|  6.40k|  m_indents.push(&m_indentRefs.back());
  275|  6.40k|}
_ZN4YAML7Scanner9EndStreamEv:
  277|  5.29k|void Scanner::EndStream() {
  278|       |  // force newline
  279|  5.29k|  if (INPUT.column() > 0) {
  ------------------
  |  Branch (279:7): [True: 4.87k, False: 423]
  ------------------
  280|  4.87k|    INPUT.ResetColumn();
  281|  4.87k|  }
  282|       |
  283|  5.29k|  PopAllIndents();
  284|  5.29k|  PopAllSimpleKeys();
  285|       |
  286|  5.29k|  m_simpleKeyAllowed = false;
  287|  5.29k|  m_scalarValueAllowed = false;
  288|  5.29k|  m_endedStream = true;
  289|  5.29k|}
_ZN4YAML7Scanner9PushTokenENS_5Token4TYPEE:
  291|  10.2M|Token* Scanner::PushToken(Token::TYPE type) {
  292|  10.2M|  m_tokens.push(Token(type, INPUT.mark()));
  293|  10.2M|  return &m_tokens.back();
  294|  10.2M|}
_ZNK4YAML7Scanner16GetStartTokenForENS0_12IndentMarker11INDENT_TYPEE:
  296|  10.2M|Token::TYPE Scanner::GetStartTokenFor(IndentMarker::INDENT_TYPE type) const {
  297|  10.2M|  switch (type) {
  ------------------
  |  Branch (297:11): [True: 10.2M, False: 0]
  ------------------
  298|  1.21M|    case IndentMarker::SEQ:
  ------------------
  |  Branch (298:5): [True: 1.21M, False: 8.99M]
  ------------------
  299|  1.21M|      return Token::BLOCK_SEQ_START;
  300|  8.99M|    case IndentMarker::MAP:
  ------------------
  |  Branch (300:5): [True: 8.99M, False: 1.21M]
  ------------------
  301|  8.99M|      return Token::BLOCK_MAP_START;
  302|      0|    case IndentMarker::NONE:
  ------------------
  |  Branch (302:5): [True: 0, False: 10.2M]
  ------------------
  303|      0|      assert(false);
  304|      0|      break;
  305|  10.2M|  }
  306|  10.2M|  assert(false);
  307|      0|  throw std::runtime_error("yaml-cpp: internal error, invalid indent type");
  308|  10.2M|}
_ZN4YAML7Scanner12PushIndentToEiNS0_12IndentMarker11INDENT_TYPEE:
  311|  10.2M|                                             IndentMarker::INDENT_TYPE type) {
  312|       |  // are we in flow?
  313|  10.2M|  if (InFlowContext()) {
  ------------------
  |  Branch (313:7): [True: 0, False: 10.2M]
  ------------------
  314|      0|    return nullptr;
  315|      0|  }
  316|       |
  317|  10.2M|  std::unique_ptr<IndentMarker> pIndent(new IndentMarker(column, type));
  318|  10.2M|  IndentMarker& indent = *pIndent;
  319|  10.2M|  const IndentMarker& lastIndent = *m_indents.top();
  320|       |
  321|       |  // is this actually an indentation?
  322|  10.2M|  if (indent.column < lastIndent.column) {
  ------------------
  |  Branch (322:7): [True: 0, False: 10.2M]
  ------------------
  323|      0|    return nullptr;
  324|      0|  }
  325|  10.2M|  if (indent.column == lastIndent.column &&
  ------------------
  |  Branch (325:7): [True: 116k, False: 10.1M]
  ------------------
  326|   116k|      !(indent.type == IndentMarker::SEQ &&
  ------------------
  |  Branch (326:9): [True: 43.4k, False: 73.4k]
  ------------------
  327|  78.5k|        lastIndent.type == IndentMarker::MAP)) {
  ------------------
  |  Branch (327:9): [True: 38.3k, False: 5.09k]
  ------------------
  328|  78.5k|    return nullptr;
  329|  78.5k|  }
  330|       |
  331|       |  // push a start token
  332|  10.2M|  indent.pStartToken = PushToken(GetStartTokenFor(type));
  333|       |
  334|       |  // and then the indent
  335|  10.2M|  m_indents.push(&indent);
  336|  10.2M|  m_indentRefs.push_back(std::move(pIndent));
  337|  10.2M|  return &m_indentRefs.back();
  338|  10.2M|}
_ZN4YAML7Scanner15PopIndentToHereEv:
  340|  60.7M|void Scanner::PopIndentToHere() {
  341|       |  // are we in flow?
  342|  60.7M|  if (InFlowContext()) {
  ------------------
  |  Branch (342:7): [True: 49.9M, False: 10.8M]
  ------------------
  343|  49.9M|    return;
  344|  49.9M|  }
  345|       |
  346|       |  // now pop away
  347|  13.5M|  while (!m_indents.empty()) {
  ------------------
  |  Branch (347:10): [True: 13.5M, False: 0]
  ------------------
  348|  13.5M|    const IndentMarker& indent = *m_indents.top();
  349|  13.5M|    if (indent.column < INPUT.column()) {
  ------------------
  |  Branch (349:9): [True: 9.75M, False: 3.76M]
  ------------------
  350|  9.75M|      break;
  351|  9.75M|    }
  352|  3.76M|    if (indent.column == INPUT.column() &&
  ------------------
  |  Branch (352:9): [True: 2.03M, False: 1.72M]
  ------------------
  353|  2.03M|        !(indent.type == IndentMarker::SEQ &&
  ------------------
  |  Branch (353:11): [True: 959k, False: 1.07M]
  ------------------
  354|  1.08M|          !Exp::BlockEntry().Matches(INPUT))) {
  ------------------
  |  Branch (354:11): [True: 954k, False: 5.09k]
  ------------------
  355|  1.08M|      break;
  356|  1.08M|    }
  357|       |
  358|  2.68M|    PopIndent();
  359|  2.68M|  }
  360|       |
  361|  11.8M|  while (!m_indents.empty() &&
  ------------------
  |  Branch (361:10): [True: 11.8M, False: 0]
  ------------------
  362|  11.8M|         m_indents.top()->status == IndentMarker::INVALID) {
  ------------------
  |  Branch (362:10): [True: 1.00M, False: 10.8M]
  ------------------
  363|  1.00M|    PopIndent();
  364|  1.00M|  }
  365|  10.8M|}
_ZN4YAML7Scanner13PopAllIndentsEv:
  367|   380k|void Scanner::PopAllIndents() {
  368|       |  // are we in flow?
  369|   380k|  if (InFlowContext()) {
  ------------------
  |  Branch (369:7): [True: 50.9k, False: 329k]
  ------------------
  370|  50.9k|    return;
  371|  50.9k|  }
  372|       |
  373|       |  // now pop away
  374|  3.12M|  while (!m_indents.empty()) {
  ------------------
  |  Branch (374:10): [True: 3.12M, False: 0]
  ------------------
  375|  3.12M|    const IndentMarker& indent = *m_indents.top();
  376|  3.12M|    if (indent.type == IndentMarker::NONE) {
  ------------------
  |  Branch (376:9): [True: 329k, False: 2.79M]
  ------------------
  377|   329k|      break;
  378|   329k|    }
  379|       |
  380|  2.79M|    PopIndent();
  381|  2.79M|  }
  382|   329k|}
_ZN4YAML7Scanner9PopIndentEv:
  384|  6.47M|void Scanner::PopIndent() {
  385|  6.47M|  const IndentMarker& indent = *m_indents.top();
  386|  6.47M|  m_indents.pop();
  387|       |
  388|  6.47M|  if (indent.status != IndentMarker::VALID) {
  ------------------
  |  Branch (388:7): [True: 1.96M, False: 4.51M]
  ------------------
  389|  1.96M|    InvalidateSimpleKey();
  390|  1.96M|    return;
  391|  1.96M|  }
  392|       |
  393|  4.51M|  if (indent.type == IndentMarker::SEQ) {
  ------------------
  |  Branch (393:7): [True: 1.13M, False: 3.38M]
  ------------------
  394|  1.13M|    m_tokens.push(Token(Token::BLOCK_SEQ_END, INPUT.mark()));
  395|  3.38M|  } else if (indent.type == IndentMarker::MAP) {
  ------------------
  |  Branch (395:14): [True: 3.38M, False: 0]
  ------------------
  396|  3.38M|    m_tokens.push(Token(Token::BLOCK_MAP_END, INPUT.mark()));
  397|  3.38M|  }
  398|  4.51M|}
_ZNK4YAML7Scanner12GetTopIndentEv:
  400|  1.17M|int Scanner::GetTopIndent() const {
  401|  1.17M|  if (m_indents.empty()) {
  ------------------
  |  Branch (401:7): [True: 0, False: 1.17M]
  ------------------
  402|      0|    return 0;
  403|      0|  }
  404|  1.17M|  return m_indents.top()->column;
  405|  1.17M|}

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

_ZN4YAML10ScanScalarERNS_6StreamERNS_16ScanScalarParamsE:
   21|  2.49M|std::string ScanScalar(Stream& INPUT, ScanScalarParams& params) {
   22|  2.49M|  bool foundNonEmptyLine = false;
   23|  2.49M|  bool pastOpeningBreak = (params.fold == FOLD_FLOW);
   24|  2.49M|  bool emptyLine = false, moreIndented = false;
   25|  2.49M|  int foldedNewlineCount = 0;
   26|  2.49M|  bool foldedNewlineStartedMoreIndented = false;
   27|  2.49M|  std::size_t lastEscapedChar = std::string::npos;
   28|  2.49M|  std::string scalar;
   29|  2.49M|  params.leadingSpaces = false;
   30|       |
   31|  2.49M|  if (!params.end) {
  ------------------
  |  Branch (31:7): [True: 3.20k, False: 2.49M]
  ------------------
   32|  3.20k|    params.end = &Exp::Empty();
   33|  3.20k|  }
   34|       |
   35|  19.7M|  while (INPUT) {
  ------------------
  |  Branch (35:10): [True: 19.7M, False: 869]
  ------------------
   36|       |    // ********************************
   37|       |    // Phase #1: scan until line ending
   38|       |
   39|  19.7M|    std::size_t lastNonWhitespaceChar = scalar.size();
   40|  19.7M|    bool escapedNewline = false;
   41|  93.7M|    while (!params.end->Matches(INPUT) && !Exp::Break().Matches(INPUT)) {
  ------------------
  |  Branch (41:12): [True: 92.4M, False: 1.33M]
  |  Branch (41:43): [True: 74.2M, False: 18.2M]
  ------------------
   42|  74.2M|      if (!INPUT) {
  ------------------
  |  Branch (42:11): [True: 1.68k, False: 74.1M]
  ------------------
   43|  1.68k|        break;
   44|  1.68k|      }
   45|       |
   46|       |      // document indicator?
   47|  74.1M|      if (INPUT.column() == 0 && Exp::DocIndicator().Matches(INPUT)) {
  ------------------
  |  Branch (47:11): [True: 254k, False: 73.9M]
  |  Branch (47:34): [True: 201k, False: 53.2k]
  ------------------
   48|   201k|        if (params.onDocIndicator == BREAK) {
  ------------------
  |  Branch (48:13): [True: 201k, False: 3]
  ------------------
   49|   201k|          break;
   50|   201k|        }
   51|      3|        if (params.onDocIndicator == THROW) {
  ------------------
  |  Branch (51:13): [True: 3, False: 0]
  ------------------
   52|      3|          throw ParserException(INPUT.mark(), ErrorMsg::DOC_IN_SCALAR);
   53|      3|        }
   54|      3|      }
   55|       |
   56|  73.9M|      foundNonEmptyLine = true;
   57|  73.9M|      pastOpeningBreak = true;
   58|       |
   59|       |      // escaped newline? (only if we're escaping on slash)
   60|  73.9M|      if (params.escape == '\\' && Exp::EscBreak().Matches(INPUT)) {
  ------------------
  |  Branch (60:11): [True: 10.6M, False: 63.3M]
  |  Branch (60:36): [True: 968, False: 10.6M]
  ------------------
   61|       |        // eat escape character and get out (but preserve trailing whitespace!)
   62|    968|        INPUT.get();
   63|    968|        lastNonWhitespaceChar = scalar.size();
   64|    968|        lastEscapedChar = scalar.size();
   65|    968|        escapedNewline = true;
   66|    968|        break;
   67|    968|      }
   68|       |
   69|       |      // escape this?
   70|  73.9M|      if (INPUT.peek() == params.escape) {
  ------------------
  |  Branch (70:11): [True: 43.2k, False: 73.9M]
  ------------------
   71|  43.2k|        scalar += Exp::Escape(INPUT);
   72|  43.2k|        lastNonWhitespaceChar = scalar.size();
   73|  43.2k|        lastEscapedChar = scalar.size();
   74|  43.2k|        continue;
   75|  43.2k|      }
   76|       |
   77|       |      // otherwise, just add the damn character
   78|  73.9M|      char ch = INPUT.get();
   79|  73.9M|      scalar += ch;
   80|  73.9M|      if (ch != ' ' && ch != '\t') {
  ------------------
  |  Branch (80:11): [True: 73.9M, False: 43.7k]
  |  Branch (80:24): [True: 72.2M, False: 1.62M]
  ------------------
   81|  72.2M|        lastNonWhitespaceChar = scalar.size();
   82|  72.2M|      }
   83|  73.9M|    }
   84|       |
   85|       |    // eof? if we're looking to eat something, then we throw
   86|  19.7M|    if (!INPUT) {
  ------------------
  |  Branch (86:9): [True: 1.74k, False: 19.7M]
  ------------------
   87|  1.74k|      if (params.eatEnd) {
  ------------------
  |  Branch (87:11): [True: 193, False: 1.55k]
  ------------------
   88|    193|        throw ParserException(INPUT.mark(), ErrorMsg::EOF_IN_SCALAR);
   89|    193|      }
   90|  1.55k|      break;
   91|  1.74k|    }
   92|       |
   93|       |    // doc indicator?
   94|  19.7M|    if (params.onDocIndicator == BREAK && INPUT.column() == 0 &&
  ------------------
  |  Branch (94:9): [True: 9.76M, False: 10.0M]
  |  Branch (94:43): [True: 4.39M, False: 5.36M]
  ------------------
   95|  4.39M|        Exp::DocIndicator().Matches(INPUT)) {
  ------------------
  |  Branch (95:9): [True: 201k, False: 4.19M]
  ------------------
   96|   201k|      break;
   97|   201k|    }
   98|       |
   99|       |    // are we done via character match?
  100|  19.5M|    int n = params.end->Match(INPUT);
  101|  19.5M|    if (n >= 0) {
  ------------------
  |  Branch (101:9): [True: 1.33M, False: 18.2M]
  ------------------
  102|  1.33M|      if (params.eatEnd) {
  ------------------
  |  Branch (102:11): [True: 7.28k, False: 1.32M]
  ------------------
  103|  7.28k|        INPUT.eat(n);
  104|  7.28k|      }
  105|  1.33M|      break;
  106|  1.33M|    }
  107|       |
  108|       |    // do we remove trailing whitespace?
  109|  18.2M|    if (params.fold == FOLD_FLOW)
  ------------------
  |  Branch (109:9): [True: 8.34M, False: 9.90M]
  ------------------
  110|  8.34M|      scalar.erase(lastNonWhitespaceChar);
  111|       |
  112|       |    // ********************************
  113|       |    // Phase #2: eat line ending
  114|  18.2M|    n = Exp::Break().Match(INPUT);
  115|  18.2M|    INPUT.eat(n);
  116|       |
  117|       |    // ********************************
  118|       |    // Phase #3: scan initial spaces
  119|       |
  120|       |    // first the required indentation
  121|  18.2M|    while (INPUT.peek() == ' ' &&
  ------------------
  |  Branch (121:12): [True: 8.10k, False: 18.2M]
  ------------------
  122|  8.10k|           (INPUT.column() < params.indent ||
  ------------------
  |  Branch (122:13): [True: 678, False: 7.42k]
  ------------------
  123|  7.42k|            (params.detectIndent && !foundNonEmptyLine)) &&
  ------------------
  |  Branch (123:14): [True: 1.24k, False: 6.17k]
  |  Branch (123:37): [True: 374, False: 875]
  ------------------
  124|  1.05k|           !params.end->Matches(INPUT)) {
  ------------------
  |  Branch (124:12): [True: 857, False: 195]
  ------------------
  125|    857|      INPUT.eat(1);
  126|    857|    }
  127|       |
  128|       |    // update indent if we're auto-detecting
  129|  18.2M|    if (params.detectIndent && !foundNonEmptyLine) {
  ------------------
  |  Branch (129:9): [True: 9.90M, False: 8.34M]
  |  Branch (129:32): [True: 8.84M, False: 1.05M]
  ------------------
  130|  8.84M|      params.indent = std::max(params.indent, INPUT.column());
  131|  8.84M|    }
  132|       |
  133|       |    // and then the rest of the whitespace
  134|  18.2M|    while (Exp::Blank().Matches(INPUT)) {
  ------------------
  |  Branch (134:12): [True: 9.93k, False: 18.2M]
  ------------------
  135|       |      // we check for tabs that masquerade as indentation
  136|  9.93k|      if (INPUT.peek() == '\t' && INPUT.column() < params.indent &&
  ------------------
  |  Branch (136:11): [True: 2.46k, False: 7.47k]
  |  Branch (136:35): [True: 2, False: 2.45k]
  ------------------
  137|      2|          params.onTabInIndentation == THROW) {
  ------------------
  |  Branch (137:11): [True: 2, False: 0]
  ------------------
  138|      2|        throw ParserException(INPUT.mark(), ErrorMsg::TAB_IN_INDENTATION);
  139|      2|      }
  140|       |
  141|  9.93k|      if (!params.eatLeadingWhitespace) {
  ------------------
  |  Branch (141:11): [True: 1.79k, False: 8.14k]
  ------------------
  142|  1.79k|        break;
  143|  1.79k|      }
  144|       |
  145|  8.14k|      if (params.end->Matches(INPUT)) {
  ------------------
  |  Branch (145:11): [True: 207, False: 7.93k]
  ------------------
  146|    207|        break;
  147|    207|      }
  148|       |
  149|  7.93k|      INPUT.eat(1);
  150|  7.93k|    }
  151|       |
  152|       |    // was this an empty line?
  153|  18.2M|    bool nextEmptyLine = Exp::Break().Matches(INPUT);
  154|  18.2M|    bool nextMoreIndented = Exp::Blank().Matches(INPUT);
  155|  18.2M|    if (params.fold == FOLD_BLOCK && foldedNewlineCount == 0 && nextEmptyLine)
  ------------------
  |  Branch (155:9): [True: 9.89M, False: 8.35M]
  |  Branch (155:38): [True: 41.1k, False: 9.84M]
  |  Branch (155:65): [True: 8.49k, False: 32.6k]
  ------------------
  156|  8.49k|      foldedNewlineStartedMoreIndented = moreIndented;
  157|       |
  158|       |    // for block scalars, we always start with a newline, so we should ignore it
  159|       |    // (not fold or keep)
  160|  18.2M|    if (pastOpeningBreak) {
  ------------------
  |  Branch (160:9): [True: 18.2M, False: 3.47k]
  ------------------
  161|  18.2M|      switch (params.fold) {
  ------------------
  |  Branch (161:15): [True: 18.2M, False: 0]
  ------------------
  162|  9.85k|        case DONT_FOLD:
  ------------------
  |  Branch (162:9): [True: 9.85k, False: 18.2M]
  ------------------
  163|  9.85k|          scalar += "\n";
  164|  9.85k|          break;
  165|  9.88M|        case FOLD_BLOCK:
  ------------------
  |  Branch (165:9): [True: 9.88M, False: 8.35M]
  ------------------
  166|  9.88M|          if (!emptyLine && !nextEmptyLine && !moreIndented &&
  ------------------
  |  Branch (166:15): [True: 37.9k, False: 9.85M]
  |  Branch (166:29): [True: 30.6k, False: 7.36k]
  |  Branch (166:47): [True: 29.5k, False: 1.04k]
  ------------------
  167|  29.5k|              !nextMoreIndented && INPUT.column() >= params.indent) {
  ------------------
  |  Branch (167:15): [True: 29.1k, False: 459]
  |  Branch (167:36): [True: 28.6k, False: 453]
  ------------------
  168|  28.6k|            scalar += " ";
  169|  9.85M|          } else if (nextEmptyLine) {
  ------------------
  |  Branch (169:22): [True: 9.84M, False: 9.94k]
  ------------------
  170|  9.84M|            foldedNewlineCount++;
  171|  9.84M|          } else {
  172|  9.94k|            scalar += "\n";
  173|  9.94k|          }
  174|       |
  175|  9.88M|          if (!nextEmptyLine && foldedNewlineCount > 0) {
  ------------------
  |  Branch (175:15): [True: 38.5k, False: 9.84M]
  |  Branch (175:33): [True: 7.87k, False: 30.7k]
  ------------------
  176|  7.87k|            scalar += std::string(foldedNewlineCount - 1, '\n');
  177|  7.87k|            if (foldedNewlineStartedMoreIndented ||
  ------------------
  |  Branch (177:17): [True: 699, False: 7.17k]
  ------------------
  178|  7.17k|                nextMoreIndented | !foundNonEmptyLine) {
  ------------------
  |  Branch (178:17): [True: 877, False: 6.29k]
  ------------------
  179|  1.57k|              scalar += "\n";
  180|  1.57k|            }
  181|  7.87k|            foldedNewlineCount = 0;
  182|  7.87k|          }
  183|  9.88M|          break;
  184|  8.34M|        case FOLD_FLOW:
  ------------------
  |  Branch (184:9): [True: 8.34M, False: 9.89M]
  ------------------
  185|  8.34M|          if (nextEmptyLine) {
  ------------------
  |  Branch (185:15): [True: 6.92M, False: 1.41M]
  ------------------
  186|  6.92M|            scalar += "\n";
  187|  6.92M|          } else if (!emptyLine && !escapedNewline) {
  ------------------
  |  Branch (187:22): [True: 1.40M, False: 14.6k]
  |  Branch (187:36): [True: 1.40M, False: 830]
  ------------------
  188|  1.40M|            scalar += " ";
  189|  1.40M|          }
  190|  8.34M|          break;
  191|  18.2M|      }
  192|  18.2M|    }
  193|       |
  194|  18.2M|    emptyLine = nextEmptyLine;
  195|  18.2M|    moreIndented = nextMoreIndented;
  196|  18.2M|    pastOpeningBreak = true;
  197|       |
  198|       |    // are we done via indentation?
  199|  18.2M|    if (!emptyLine && INPUT.column() < params.indent) {
  ------------------
  |  Branch (199:9): [True: 1.45M, False: 16.7M]
  |  Branch (199:23): [True: 962k, False: 495k]
  ------------------
  200|   962k|      params.leadingSpaces = true;
  201|   962k|      break;
  202|   962k|    }
  203|  18.2M|  }
  204|       |
  205|       |  // post-processing
  206|  2.49M|  if (params.trimTrailingSpaces) {
  ------------------
  |  Branch (206:7): [True: 2.48M, False: 11.0k]
  ------------------
  207|  2.48M|    std::size_t pos = scalar.find_last_not_of(" \t");
  208|  2.48M|    if (lastEscapedChar != std::string::npos) {
  ------------------
  |  Branch (208:9): [True: 16.3k, False: 2.47M]
  ------------------
  209|  16.3k|      if (pos < lastEscapedChar || pos == std::string::npos) {
  ------------------
  |  Branch (209:11): [True: 9.94k, False: 6.37k]
  |  Branch (209:36): [True: 599, False: 5.77k]
  ------------------
  210|  10.5k|        pos = lastEscapedChar;
  211|  10.5k|      }
  212|  16.3k|    }
  213|  2.48M|    if (pos < scalar.size()) {
  ------------------
  |  Branch (213:9): [True: 2.47M, False: 10.3k]
  ------------------
  214|  2.47M|      scalar.erase(pos + 1);
  215|  2.47M|    }
  216|  2.48M|  }
  217|       |
  218|  2.49M|  switch (params.chomp) {
  219|  9.97k|    case CLIP: {
  ------------------
  |  Branch (219:5): [True: 9.97k, False: 2.48M]
  ------------------
  220|  9.97k|      std::size_t pos = scalar.find_last_not_of('\n');
  221|  9.97k|      if (lastEscapedChar != std::string::npos) {
  ------------------
  |  Branch (221:11): [True: 2.81k, False: 7.15k]
  ------------------
  222|  2.81k|        if (pos < lastEscapedChar || pos == std::string::npos) {
  ------------------
  |  Branch (222:13): [True: 2.00k, False: 814]
  |  Branch (222:38): [True: 216, False: 598]
  ------------------
  223|  2.21k|          pos = lastEscapedChar;
  224|  2.21k|        }
  225|  2.81k|      }
  226|  9.97k|      if (pos == std::string::npos) {
  ------------------
  |  Branch (226:11): [True: 3.96k, False: 6.00k]
  ------------------
  227|  3.96k|        scalar.erase();
  228|  6.00k|      } else if (pos + 1 < scalar.size()) {
  ------------------
  |  Branch (228:18): [True: 836, False: 5.16k]
  ------------------
  229|    836|        scalar.erase(pos + 2);
  230|    836|      }
  231|  9.97k|    } break;
  232|  2.48M|    case STRIP: {
  ------------------
  |  Branch (232:5): [True: 2.48M, False: 10.7k]
  ------------------
  233|  2.48M|      std::size_t pos = scalar.find_last_not_of('\n');
  234|  2.48M|      if (lastEscapedChar != std::string::npos) {
  ------------------
  |  Branch (234:11): [True: 16.3k, False: 2.47M]
  ------------------
  235|  16.3k|        if (pos < lastEscapedChar || pos == std::string::npos) {
  ------------------
  |  Branch (235:13): [True: 10.1k, False: 6.14k]
  |  Branch (235:38): [True: 255, False: 5.89k]
  ------------------
  236|  10.4k|          pos = lastEscapedChar;
  237|  10.4k|        }
  238|  16.3k|      }
  239|  2.48M|      if (pos == std::string::npos) {
  ------------------
  |  Branch (239:11): [True: 263, False: 2.48M]
  ------------------
  240|    263|        scalar.erase();
  241|  2.48M|      } else if (pos < scalar.size()) {
  ------------------
  |  Branch (241:18): [True: 2.47M, False: 10.3k]
  ------------------
  242|  2.47M|        scalar.erase(pos + 1);
  243|  2.47M|      }
  244|  2.48M|    } break;
  245|    397|    default:
  ------------------
  |  Branch (245:5): [True: 397, False: 2.49M]
  ------------------
  246|    397|      break;
  247|  2.49M|  }
  248|       |
  249|  2.49M|  return scalar;
  250|  2.49M|}

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

_ZN4YAML15ScanVerbatimTagERNS_6StreamE:
    9|    640|const std::string ScanVerbatimTag(Stream& INPUT) {
   10|    640|  std::string tag;
   11|       |
   12|       |  // eat the start character
   13|    640|  INPUT.get();
   14|       |
   15|  9.68k|  while (INPUT) {
  ------------------
  |  Branch (15:10): [True: 9.66k, False: 21]
  ------------------
   16|  9.66k|    if (INPUT.peek() == Keys::VerbatimTagEnd) {
  ------------------
  |  Branch (16:9): [True: 607, False: 9.05k]
  ------------------
   17|       |      // eat the end character
   18|    607|      INPUT.get();
   19|    607|      return tag;
   20|    607|    }
   21|       |
   22|  9.05k|    int n = Exp::URI().Match(INPUT);
   23|  9.05k|    if (n <= 0)
  ------------------
  |  Branch (23:9): [True: 12, False: 9.04k]
  ------------------
   24|     12|      break;
   25|       |
   26|  9.04k|    tag += INPUT.get(n);
   27|  9.04k|  }
   28|       |
   29|     33|  throw ParserException(INPUT.mark(), ErrorMsg::END_OF_VERBATIM_TAG);
   30|    640|}
_ZN4YAML13ScanTagHandleERNS_6StreamERb:
   32|  1.05M|const std::string ScanTagHandle(Stream& INPUT, bool& canBeHandle) {
   33|  1.05M|  std::string tag;
   34|  1.05M|  canBeHandle = true;
   35|  1.05M|  Mark firstNonWordChar;
   36|       |
   37|  10.1M|  while (INPUT) {
  ------------------
  |  Branch (37:10): [True: 10.1M, False: 314]
  ------------------
   38|  10.1M|    if (INPUT.peek() == Keys::Tag) {
  ------------------
  |  Branch (38:9): [True: 2.76k, False: 10.1M]
  ------------------
   39|  2.76k|      if (!canBeHandle)
  ------------------
  |  Branch (39:11): [True: 4, False: 2.76k]
  ------------------
   40|      4|        throw ParserException(firstNonWordChar, ErrorMsg::CHAR_IN_TAG_HANDLE);
   41|  2.76k|      break;
   42|  2.76k|    }
   43|       |
   44|  10.1M|    int n = 0;
   45|  10.1M|    if (canBeHandle) {
  ------------------
  |  Branch (45:9): [True: 9.00M, False: 1.17M]
  ------------------
   46|  9.00M|      n = Exp::Word().Match(INPUT);
   47|  9.00M|      if (n <= 0) {
  ------------------
  |  Branch (47:11): [True: 1.05M, False: 7.94M]
  ------------------
   48|  1.05M|        canBeHandle = false;
   49|  1.05M|        firstNonWordChar = INPUT.mark();
   50|  1.05M|      }
   51|  9.00M|    }
   52|       |
   53|  10.1M|    if (!canBeHandle)
  ------------------
  |  Branch (53:9): [True: 2.22M, False: 7.94M]
  ------------------
   54|  2.22M|      n = Exp::Tag().Match(INPUT);
   55|       |
   56|  10.1M|    if (n <= 0)
  ------------------
  |  Branch (56:9): [True: 1.05M, False: 9.12M]
  ------------------
   57|  1.05M|      break;
   58|       |
   59|  9.12M|    tag += INPUT.get(n);
   60|  9.12M|  }
   61|       |
   62|  1.05M|  return tag;
   63|  1.05M|}
_ZN4YAML13ScanTagSuffixERNS_6StreamE:
   65|  2.76k|const std::string ScanTagSuffix(Stream& INPUT) {
   66|  2.76k|  std::string tag;
   67|       |
   68|  1.20M|  while (INPUT) {
  ------------------
  |  Branch (68:10): [True: 1.20M, False: 110]
  ------------------
   69|  1.20M|    int n = Exp::Tag().Match(INPUT);
   70|  1.20M|    if (n <= 0)
  ------------------
  |  Branch (70:9): [True: 2.65k, False: 1.19M]
  ------------------
   71|  2.65k|      break;
   72|       |
   73|  1.19M|    tag += INPUT.get(n);
   74|  1.19M|  }
   75|       |
   76|  2.76k|  if (tag.empty())
  ------------------
  |  Branch (76:7): [True: 16, False: 2.74k]
  ------------------
   77|     16|    throw ParserException(INPUT.mark(), ErrorMsg::TAG_WITH_NO_SUFFIX);
   78|       |
   79|  2.74k|  return tag;
   80|  2.76k|}

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

_ZN4YAML7Scanner9SimpleKeyC2ERKNS_4MarkEm:
    8|  47.0M|    : mark(mark_),
    9|  47.0M|      flowLevel(flowLevel_),
   10|  47.0M|      pIndent(nullptr),
   11|  47.0M|      pMapStart(nullptr),
   12|  47.0M|      pKey(nullptr) {}
_ZN4YAML7Scanner9SimpleKey8ValidateEv:
   14|  1.19M|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|  1.19M|  if (pIndent)
  ------------------
  |  Branch (18:7): [True: 40.0k, False: 1.15M]
  ------------------
   19|  40.0k|    pIndent->status = IndentMarker::VALID;
   20|  1.19M|  if (pMapStart)
  ------------------
  |  Branch (20:7): [True: 40.0k, False: 1.15M]
  ------------------
   21|  40.0k|    pMapStart->status = Token::VALID;
   22|  1.19M|  if (pKey)
  ------------------
  |  Branch (22:7): [True: 1.19M, False: 0]
  ------------------
   23|  1.19M|    pKey->status = Token::VALID;
   24|  1.19M|}
_ZN4YAML7Scanner9SimpleKey10InvalidateEv:
   26|  3.68M|void Scanner::SimpleKey::Invalidate() {
   27|  3.68M|  if (pIndent)
  ------------------
  |  Branch (27:7): [True: 1.96M, False: 1.72M]
  ------------------
   28|  1.96M|    pIndent->status = IndentMarker::INVALID;
   29|  3.68M|  if (pMapStart)
  ------------------
  |  Branch (29:7): [True: 1.96M, False: 1.72M]
  ------------------
   30|  1.96M|    pMapStart->status = Token::INVALID;
   31|  3.68M|  if (pKey)
  ------------------
  |  Branch (31:7): [True: 3.68M, False: 0]
  ------------------
   32|  3.68M|    pKey->status = Token::INVALID;
   33|  3.68M|}
_ZNK4YAML7Scanner27CanInsertPotentialSimpleKeyEv:
   36|  47.4M|bool Scanner::CanInsertPotentialSimpleKey() const {
   37|  47.4M|  if (!m_simpleKeyAllowed)
  ------------------
  |  Branch (37:7): [True: 424k, False: 47.0M]
  ------------------
   38|   424k|    return false;
   39|       |
   40|  47.0M|  return !ExistsActiveSimpleKey();
   41|  47.4M|}
_ZNK4YAML7Scanner21ExistsActiveSimpleKeyEv:
   47|  47.0M|bool Scanner::ExistsActiveSimpleKey() const {
   48|  47.0M|  if (m_simpleKeys.empty())
  ------------------
  |  Branch (48:7): [True: 2.06M, False: 45.0M]
  ------------------
   49|  2.06M|    return false;
   50|       |
   51|  45.0M|  const SimpleKey& key = m_simpleKeys.top();
   52|  45.0M|  return key.flowLevel == GetFlowLevel();
   53|  47.0M|}
_ZN4YAML7Scanner24InsertPotentialSimpleKeyEv:
   58|  47.4M|void Scanner::InsertPotentialSimpleKey() {
   59|  47.4M|  if (!CanInsertPotentialSimpleKey())
  ------------------
  |  Branch (59:7): [True: 427k, False: 47.0M]
  ------------------
   60|   427k|    return;
   61|       |
   62|  47.0M|  SimpleKey key(INPUT.mark(), GetFlowLevel());
   63|       |
   64|       |  // first add a map start, if necessary
   65|  47.0M|  if (InBlockContext()) {
  ------------------
  |  Branch (65:7): [True: 2.04M, False: 45.0M]
  ------------------
   66|  2.04M|    key.pIndent = PushIndentTo(INPUT.column(), IndentMarker::MAP);
   67|  2.04M|    if (key.pIndent) {
  ------------------
  |  Branch (67:9): [True: 2.00M, False: 40.3k]
  ------------------
   68|  2.00M|      key.pIndent->status = IndentMarker::UNKNOWN;
   69|  2.00M|      key.pMapStart = key.pIndent->pStartToken;
   70|  2.00M|      key.pMapStart->status = Token::UNVERIFIED;
   71|  2.00M|    }
   72|  2.04M|  }
   73|       |
   74|       |  // then add the (now unverified) key
   75|  47.0M|  m_tokens.push(Token(Token::KEY, INPUT.mark()));
   76|  47.0M|  key.pKey = &m_tokens.back();
   77|  47.0M|  key.pKey->status = Token::UNVERIFIED;
   78|       |
   79|  47.0M|  m_simpleKeys.push(key);
   80|  47.0M|}
_ZN4YAML7Scanner19InvalidateSimpleKeyEv:
   84|  12.4M|void Scanner::InvalidateSimpleKey() {
   85|  12.4M|  if (m_simpleKeys.empty())
  ------------------
  |  Branch (85:7): [True: 8.55M, False: 3.86M]
  ------------------
   86|  8.55M|    return;
   87|       |
   88|       |  // grab top key
   89|  3.86M|  SimpleKey& key = m_simpleKeys.top();
   90|  3.86M|  if (key.flowLevel != GetFlowLevel())
  ------------------
  |  Branch (90:7): [True: 1.32M, False: 2.53M]
  ------------------
   91|  1.32M|    return;
   92|       |
   93|  2.53M|  key.Invalidate();
   94|  2.53M|  m_simpleKeys.pop();
   95|  2.53M|}
_ZN4YAML7Scanner15VerifySimpleKeyEv:
  100|  9.80M|bool Scanner::VerifySimpleKey() {
  101|  9.80M|  if (m_simpleKeys.empty())
  ------------------
  |  Branch (101:7): [True: 7.41M, False: 2.38M]
  ------------------
  102|  7.41M|    return false;
  103|       |
  104|       |  // grab top key
  105|  2.38M|  SimpleKey key = m_simpleKeys.top();
  106|       |
  107|       |  // only validate if we're in the correct flow level
  108|  2.38M|  if (key.flowLevel != GetFlowLevel())
  ------------------
  |  Branch (108:7): [True: 49.2k, False: 2.33M]
  ------------------
  109|  49.2k|    return false;
  110|       |
  111|  2.33M|  m_simpleKeys.pop();
  112|       |
  113|  2.33M|  bool isValid = true;
  114|       |
  115|       |  // needs to be less than 1024 characters and inline
  116|  2.33M|  if (INPUT.line() != key.mark.line || INPUT.pos() - key.mark.pos > 1024)
  ------------------
  |  Branch (116:7): [True: 68.8k, False: 2.26M]
  |  Branch (116:40): [True: 1.07M, False: 1.19M]
  ------------------
  117|  1.14M|    isValid = false;
  118|       |
  119|       |  // invalidate key
  120|  2.33M|  if (isValid)
  ------------------
  |  Branch (120:7): [True: 1.19M, False: 1.14M]
  ------------------
  121|  1.19M|    key.Validate();
  122|  1.14M|  else
  123|  1.14M|    key.Invalidate();
  124|       |
  125|  2.33M|  return isValid;
  126|  2.38M|}
_ZN4YAML7Scanner16PopAllSimpleKeysEv:
  128|   380k|void Scanner::PopAllSimpleKeys() {
  129|  38.2M|  while (!m_simpleKeys.empty())
  ------------------
  |  Branch (129:10): [True: 37.8M, False: 380k]
  ------------------
  130|  37.8M|    m_simpleKeys.pop();
  131|   380k|}

_ZN4YAML15SingleDocParserC2ERNS_7ScannerERKNS_10DirectivesE:
   18|   319k|    : m_scanner(scanner),
   19|   319k|      m_directives(directives),
   20|   319k|      m_pCollectionStack(new CollectionStack),
   21|   319k|      m_anchors{},
   22|   319k|      m_curAnchor(0) {}
_ZN4YAML15SingleDocParserD2Ev:
   24|   319k|SingleDocParser::~SingleDocParser() = default;
_ZN4YAML15SingleDocParser14HandleDocumentERNS_12EventHandlerE:
   29|   319k|void SingleDocParser::HandleDocument(EventHandler& eventHandler) {
   30|   319k|  assert(!m_scanner.empty());  // guaranteed that there are tokens
   31|   319k|  assert(!m_curAnchor);
   32|       |
   33|   319k|  eventHandler.OnDocumentStart(m_scanner.peek().mark);
   34|       |
   35|       |  // eat doc start
   36|   319k|  if (m_scanner.peek().type == Token::DOC_START)
  ------------------
  |  Branch (36:7): [True: 172k, False: 147k]
  ------------------
   37|   172k|    m_scanner.pop();
   38|       |
   39|       |  // recurse!
   40|   319k|  HandleNode(eventHandler);
   41|       |
   42|   319k|  eventHandler.OnDocumentEnd();
   43|       |
   44|       |  // check if any tokens left after the text
   45|   319k|  if (!m_scanner.empty() && m_scanner.peek().type != Token::DOC_END
  ------------------
  |  Branch (45:7): [True: 315k, False: 4.43k]
  |  Branch (45:29): [True: 172k, False: 142k]
  ------------------
   46|   172k|      && m_scanner.peek().type != Token::DOC_START)
  ------------------
  |  Branch (46:10): [True: 360, False: 172k]
  ------------------
   47|    360|    throw ParserException(m_scanner.mark(), ErrorMsg::UNEXPECTED_TOKEN_AFTER_DOC);
   48|       |
   49|       |  // and finally eat any doc ends we see
   50|   319k|  if (!m_scanner.empty() && m_scanner.peek().type == Token::DOC_END)
  ------------------
  |  Branch (50:7): [True: 314k, False: 4.43k]
  |  Branch (50:29): [True: 142k, False: 172k]
  ------------------
   51|   142k|    m_scanner.pop();
   52|   319k|}
_ZN4YAML15SingleDocParser10HandleNodeERNS_12EventHandlerE:
   54|  2.24M|void SingleDocParser::HandleNode(EventHandler& eventHandler) {
   55|  2.24M|  DepthGuard<500> depthguard(depth, m_scanner.mark(), ErrorMsg::BAD_FILE);
   56|       |
   57|       |  // an empty node *is* a possibility
   58|  2.24M|  if (m_scanner.empty()) {
  ------------------
  |  Branch (58:7): [True: 78, False: 2.24M]
  ------------------
   59|     78|    eventHandler.OnNull(m_scanner.mark(), NullAnchor);
   60|     78|    return;
   61|     78|  }
   62|       |
   63|       |  // save location
   64|  2.24M|  Mark mark = m_scanner.peek().mark;
   65|       |
   66|       |  // special case: a value node by itself must be a map, with no header
   67|  2.24M|  if (m_scanner.peek().type == Token::VALUE) {
  ------------------
  |  Branch (67:7): [True: 2.69k, False: 2.24M]
  ------------------
   68|  2.69k|    eventHandler.OnMapStart(mark, "?", NullAnchor, EmitterStyle::Default);
   69|  2.69k|    HandleMap(eventHandler);
   70|  2.69k|    eventHandler.OnMapEnd();
   71|  2.69k|    return;
   72|  2.69k|  }
   73|       |
   74|       |  // special case: an alias node
   75|  2.24M|  if (m_scanner.peek().type == Token::ALIAS) {
  ------------------
  |  Branch (75:7): [True: 1.62k, False: 2.24M]
  ------------------
   76|  1.62k|    eventHandler.OnAlias(mark, LookupAnchor(mark, m_scanner.peek().value));
   77|  1.62k|    m_scanner.pop();
   78|  1.62k|    return;
   79|  1.62k|  }
   80|       |
   81|  2.24M|  std::string tag;
   82|  2.24M|  std::string anchor_name;
   83|  2.24M|  anchor_t anchor;
   84|  2.24M|  ParseProperties(tag, anchor, anchor_name);
   85|       |
   86|  2.24M|  if (!anchor_name.empty())
  ------------------
  |  Branch (86:7): [True: 489k, False: 1.75M]
  ------------------
   87|   489k|    eventHandler.OnAnchor(mark, anchor_name);
   88|       |
   89|       |  // after parsing properties, an empty node is again a possibility
   90|  2.24M|  if (m_scanner.empty()) {
  ------------------
  |  Branch (90:7): [True: 691, False: 2.24M]
  ------------------
   91|    691|    eventHandler.OnNull(mark, anchor);
   92|    691|    return;
   93|    691|  }
   94|       |
   95|  2.24M|  const Token& token = m_scanner.peek();
   96|       |
   97|       |  // add non-specific tags
   98|  2.24M|  if (tag.empty())
  ------------------
  |  Branch (98:7): [True: 2.23M, False: 7.36k]
  ------------------
   99|  2.23M|    tag = (token.type == Token::NON_PLAIN_SCALAR ? "!" : "?");
  ------------------
  |  Branch (99:12): [True: 1.28k, False: 2.23M]
  ------------------
  100|       |
  101|  2.24M|  if (token.type == Token::PLAIN_SCALAR
  ------------------
  |  Branch (101:7): [True: 211k, False: 2.02M]
  ------------------
  102|   211k|      && tag.compare("?") == 0 && IsNullString(token.value.data(), token.value.size())) {
  ------------------
  |  Branch (102:10): [True: 210k, False: 794]
  |  Branch (102:35): [True: 15.3k, False: 194k]
  ------------------
  103|  15.3k|    eventHandler.OnNull(mark, anchor);
  104|  15.3k|    m_scanner.pop();
  105|  15.3k|    return;
  106|  15.3k|  }
  107|       |
  108|       |  // now split based on what kind of node we should be
  109|  2.22M|  switch (token.type) {
  110|   195k|    case Token::PLAIN_SCALAR:
  ------------------
  |  Branch (110:5): [True: 195k, False: 2.02M]
  ------------------
  111|   197k|    case Token::NON_PLAIN_SCALAR:
  ------------------
  |  Branch (111:5): [True: 1.34k, False: 2.22M]
  ------------------
  112|   197k|      eventHandler.OnScalar(mark, tag, anchor, token.value);
  113|   197k|      m_scanner.pop();
  114|   197k|      return;
  115|  35.2k|    case Token::FLOW_SEQ_START:
  ------------------
  |  Branch (115:5): [True: 35.2k, False: 2.19M]
  ------------------
  116|  35.2k|      eventHandler.OnSequenceStart(mark, tag, anchor, EmitterStyle::Flow);
  117|  35.2k|      HandleSequence(eventHandler);
  118|  35.2k|      eventHandler.OnSequenceEnd();
  119|  35.2k|      return;
  120|  8.78k|    case Token::BLOCK_SEQ_START:
  ------------------
  |  Branch (120:5): [True: 8.78k, False: 2.21M]
  ------------------
  121|  8.78k|      eventHandler.OnSequenceStart(mark, tag, anchor, EmitterStyle::Block);
  122|  8.78k|      HandleSequence(eventHandler);
  123|  8.78k|      eventHandler.OnSequenceEnd();
  124|  8.78k|      return;
  125|  35.4k|    case Token::FLOW_MAP_START:
  ------------------
  |  Branch (125:5): [True: 35.4k, False: 2.19M]
  ------------------
  126|  35.4k|      eventHandler.OnMapStart(mark, tag, anchor, EmitterStyle::Flow);
  127|  35.4k|      HandleMap(eventHandler);
  128|  35.4k|      eventHandler.OnMapEnd();
  129|  35.4k|      return;
  130|  24.3k|    case Token::BLOCK_MAP_START:
  ------------------
  |  Branch (130:5): [True: 24.3k, False: 2.20M]
  ------------------
  131|  24.3k|      eventHandler.OnMapStart(mark, tag, anchor, EmitterStyle::Block);
  132|  24.3k|      HandleMap(eventHandler);
  133|  24.3k|      eventHandler.OnMapEnd();
  134|  24.3k|      return;
  135|  43.0k|    case Token::KEY:
  ------------------
  |  Branch (135:5): [True: 43.0k, False: 2.18M]
  ------------------
  136|       |      // compact maps can only go in a flow sequence
  137|  43.0k|      if (m_pCollectionStack->GetCurCollectionType() ==
  ------------------
  |  Branch (137:11): [True: 34.0k, False: 9.00k]
  ------------------
  138|  43.0k|          CollectionType::FlowSeq) {
  139|  34.0k|        eventHandler.OnMapStart(mark, tag, anchor, EmitterStyle::Flow);
  140|  34.0k|        HandleMap(eventHandler);
  141|  34.0k|        eventHandler.OnMapEnd();
  142|  34.0k|        return;
  143|  34.0k|      }
  144|  9.00k|      break;
  145|  1.88M|    default:
  ------------------
  |  Branch (145:5): [True: 1.88M, False: 344k]
  ------------------
  146|  1.88M|      break;
  147|  2.22M|  }
  148|       |
  149|  1.89M|  if (tag == "?")
  ------------------
  |  Branch (149:7): [True: 1.88M, False: 3.07k]
  ------------------
  150|  1.88M|    eventHandler.OnNull(mark, anchor);
  151|  3.07k|  else
  152|  3.07k|    eventHandler.OnScalar(mark, tag, anchor, "");
  153|  1.89M|}
_ZN4YAML15SingleDocParser14HandleSequenceERNS_12EventHandlerE:
  155|  44.0k|void SingleDocParser::HandleSequence(EventHandler& eventHandler) {
  156|       |  // split based on start token
  157|  44.0k|  switch (m_scanner.peek().type) {
  158|  8.78k|    case Token::BLOCK_SEQ_START:
  ------------------
  |  Branch (158:5): [True: 8.78k, False: 35.2k]
  ------------------
  159|  8.78k|      HandleBlockSequence(eventHandler);
  160|  8.78k|      break;
  161|  35.2k|    case Token::FLOW_SEQ_START:
  ------------------
  |  Branch (161:5): [True: 35.2k, False: 8.78k]
  ------------------
  162|  35.2k|      HandleFlowSequence(eventHandler);
  163|  35.2k|      break;
  164|      0|    default:
  ------------------
  |  Branch (164:5): [True: 0, False: 44.0k]
  ------------------
  165|      0|      break;
  166|  44.0k|  }
  167|  44.0k|}
_ZN4YAML15SingleDocParser19HandleBlockSequenceERNS_12EventHandlerE:
  169|  8.78k|void SingleDocParser::HandleBlockSequence(EventHandler& eventHandler) {
  170|       |  // eat start token
  171|  8.78k|  m_scanner.pop();
  172|  8.78k|  m_pCollectionStack->PushCollectionType(CollectionType::BlockSeq);
  173|       |
  174|  18.9k|  while (true) {
  ------------------
  |  Branch (174:10): [True: 16.3k, Folded]
  ------------------
  175|  16.3k|    if (m_scanner.empty())
  ------------------
  |  Branch (175:9): [True: 0, False: 16.3k]
  ------------------
  176|      0|      throw ParserException(m_scanner.mark(), ErrorMsg::END_OF_SEQ);
  177|       |
  178|  16.3k|    Token token = m_scanner.peek();
  179|  16.3k|    if (token.type != Token::BLOCK_ENTRY && token.type != Token::BLOCK_SEQ_END)
  ------------------
  |  Branch (179:9): [True: 6.16k, False: 10.1k]
  |  Branch (179:45): [True: 9, False: 6.15k]
  ------------------
  180|      9|      throw ParserException(token.mark, ErrorMsg::END_OF_SEQ);
  181|       |
  182|  16.3k|    m_scanner.pop();
  183|  16.3k|    if (token.type == Token::BLOCK_SEQ_END)
  ------------------
  |  Branch (183:9): [True: 6.15k, False: 10.1k]
  ------------------
  184|  6.15k|      break;
  185|       |
  186|       |    // check for null
  187|  10.1k|    if (!m_scanner.empty()) {
  ------------------
  |  Branch (187:9): [True: 10.1k, False: 39]
  ------------------
  188|  10.1k|      const Token& nextToken = m_scanner.peek();
  189|  10.1k|      if (nextToken.type == Token::BLOCK_ENTRY ||
  ------------------
  |  Branch (189:11): [True: 1.18k, False: 8.93k]
  ------------------
  190|  8.93k|          nextToken.type == Token::BLOCK_SEQ_END) {
  ------------------
  |  Branch (190:11): [True: 3.27k, False: 5.66k]
  ------------------
  191|  4.45k|        eventHandler.OnNull(nextToken.mark, NullAnchor);
  192|  4.45k|        continue;
  193|  4.45k|      }
  194|  10.1k|    }
  195|       |
  196|  5.70k|    HandleNode(eventHandler);
  197|  5.70k|  }
  198|       |
  199|  8.77k|  m_pCollectionStack->PopCollectionType(CollectionType::BlockSeq);
  200|  8.77k|}
_ZN4YAML15SingleDocParser18HandleFlowSequenceERNS_12EventHandlerE:
  202|  35.2k|void SingleDocParser::HandleFlowSequence(EventHandler& eventHandler) {
  203|       |  // eat start token
  204|  35.2k|  m_scanner.pop();
  205|  35.2k|  m_pCollectionStack->PushCollectionType(CollectionType::FlowSeq);
  206|       |
  207|  1.80M|  while (true) {
  ------------------
  |  Branch (207:10): [True: 1.76M, Folded]
  ------------------
  208|  1.76M|    if (m_scanner.empty())
  ------------------
  |  Branch (208:9): [True: 199, False: 1.76M]
  ------------------
  209|    199|      throw ParserException(m_scanner.mark(), ErrorMsg::END_OF_SEQ_FLOW);
  210|       |
  211|       |    // first check for end
  212|  1.76M|    if (m_scanner.peek().type == Token::FLOW_SEQ_END) {
  ------------------
  |  Branch (212:9): [True: 1.29k, False: 1.76M]
  ------------------
  213|  1.29k|      m_scanner.pop();
  214|  1.29k|      break;
  215|  1.29k|    }
  216|       |
  217|       |    // then read the node
  218|  1.76M|    HandleNode(eventHandler);
  219|       |
  220|  1.76M|    if (m_scanner.empty())
  ------------------
  |  Branch (220:9): [True: 584, False: 1.76M]
  ------------------
  221|    584|      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.76M|    Token& token = m_scanner.peek();
  226|  1.76M|    if (token.type == Token::FLOW_ENTRY)
  ------------------
  |  Branch (226:9): [True: 1.73M, False: 34.4k]
  ------------------
  227|  1.73M|      m_scanner.pop();
  228|  34.4k|    else if (token.type != Token::FLOW_SEQ_END)
  ------------------
  |  Branch (228:14): [True: 194, False: 34.2k]
  ------------------
  229|    194|      throw ParserException(token.mark, ErrorMsg::END_OF_SEQ_FLOW);
  230|  1.76M|  }
  231|       |
  232|  34.2k|  m_pCollectionStack->PopCollectionType(CollectionType::FlowSeq);
  233|  34.2k|}
_ZN4YAML15SingleDocParser9HandleMapERNS_12EventHandlerE:
  235|  96.5k|void SingleDocParser::HandleMap(EventHandler& eventHandler) {
  236|       |  // split based on start token
  237|  96.5k|  switch (m_scanner.peek().type) {
  238|  24.3k|    case Token::BLOCK_MAP_START:
  ------------------
  |  Branch (238:5): [True: 24.3k, False: 72.1k]
  ------------------
  239|  24.3k|      HandleBlockMap(eventHandler);
  240|  24.3k|      break;
  241|  35.4k|    case Token::FLOW_MAP_START:
  ------------------
  |  Branch (241:5): [True: 35.4k, False: 61.1k]
  ------------------
  242|  35.4k|      HandleFlowMap(eventHandler);
  243|  35.4k|      break;
  244|  34.0k|    case Token::KEY:
  ------------------
  |  Branch (244:5): [True: 34.0k, False: 62.4k]
  ------------------
  245|  34.0k|      HandleCompactMap(eventHandler);
  246|  34.0k|      break;
  247|  2.69k|    case Token::VALUE:
  ------------------
  |  Branch (247:5): [True: 2.69k, False: 93.8k]
  ------------------
  248|  2.69k|      HandleCompactMapWithNoKey(eventHandler);
  249|  2.69k|      break;
  250|      0|    default:
  ------------------
  |  Branch (250:5): [True: 0, False: 96.5k]
  ------------------
  251|      0|      break;
  252|  96.5k|  }
  253|  96.5k|}
_ZN4YAML15SingleDocParser14HandleBlockMapERNS_12EventHandlerE:
  255|  24.3k|void SingleDocParser::HandleBlockMap(EventHandler& eventHandler) {
  256|       |  // eat start token
  257|  24.3k|  m_scanner.pop();
  258|  24.3k|  m_pCollectionStack->PushCollectionType(CollectionType::BlockMap);
  259|       |
  260|  61.1k|  while (true) {
  ------------------
  |  Branch (260:10): [True: 57.9k, Folded]
  ------------------
  261|  57.9k|    if (m_scanner.empty())
  ------------------
  |  Branch (261:9): [True: 0, False: 57.9k]
  ------------------
  262|      0|      throw ParserException(m_scanner.mark(), ErrorMsg::END_OF_MAP);
  263|       |
  264|  57.9k|    Token token = m_scanner.peek();
  265|  57.9k|    if (token.type != Token::KEY && token.type != Token::VALUE &&
  ------------------
  |  Branch (265:9): [True: 37.0k, False: 20.9k]
  |  Branch (265:37): [True: 21.2k, False: 15.7k]
  ------------------
  266|  21.2k|        token.type != Token::BLOCK_MAP_END)
  ------------------
  |  Branch (266:9): [True: 94, False: 21.1k]
  ------------------
  267|     94|      throw ParserException(token.mark, ErrorMsg::END_OF_MAP);
  268|       |
  269|  57.8k|    if (token.type == Token::BLOCK_MAP_END) {
  ------------------
  |  Branch (269:9): [True: 21.1k, False: 36.7k]
  ------------------
  270|  21.1k|      m_scanner.pop();
  271|  21.1k|      break;
  272|  21.1k|    }
  273|       |
  274|       |    // grab key (if non-null)
  275|  36.7k|    if (token.type == Token::KEY) {
  ------------------
  |  Branch (275:9): [True: 20.9k, False: 15.8k]
  ------------------
  276|  20.9k|      m_scanner.pop();
  277|  20.9k|      HandleNode(eventHandler);
  278|  20.9k|    } else {
  279|  15.8k|      eventHandler.OnNull(token.mark, NullAnchor);
  280|  15.8k|    }
  281|       |
  282|       |    // now grab value (optional)
  283|  36.7k|    if (!m_scanner.empty() && m_scanner.peek().type == Token::VALUE) {
  ------------------
  |  Branch (283:9): [True: 34.3k, False: 2.42k]
  |  Branch (283:31): [True: 23.4k, False: 10.8k]
  ------------------
  284|  23.4k|      m_scanner.pop();
  285|  23.4k|      HandleNode(eventHandler);
  286|  23.4k|    } else {
  287|  13.3k|      eventHandler.OnNull(token.mark, NullAnchor);
  288|  13.3k|    }
  289|  36.7k|  }
  290|       |
  291|  24.2k|  m_pCollectionStack->PopCollectionType(CollectionType::BlockMap);
  292|  24.2k|}
_ZN4YAML15SingleDocParser13HandleFlowMapERNS_12EventHandlerE:
  294|  35.4k|void SingleDocParser::HandleFlowMap(EventHandler& eventHandler) {
  295|       |  // eat start token
  296|  35.4k|  m_scanner.pop();
  297|  35.4k|  m_pCollectionStack->PushCollectionType(CollectionType::FlowMap);
  298|       |
  299|   503k|  while (true) {
  ------------------
  |  Branch (299:10): [True: 469k, Folded]
  ------------------
  300|   469k|    if (m_scanner.empty())
  ------------------
  |  Branch (300:9): [True: 160, False: 469k]
  ------------------
  301|    160|      throw ParserException(m_scanner.mark(), ErrorMsg::END_OF_MAP_FLOW);
  302|       |
  303|   469k|    Token& token = m_scanner.peek();
  304|   469k|    const Mark mark = token.mark;
  305|       |    // first check for end
  306|   469k|    if (token.type == Token::FLOW_MAP_END) {
  ------------------
  |  Branch (306:9): [True: 944, False: 468k]
  ------------------
  307|    944|      m_scanner.pop();
  308|    944|      break;
  309|    944|    }
  310|       |
  311|       |    // grab key (if non-null)
  312|   468k|    if (token.type == Token::KEY) {
  ------------------
  |  Branch (312:9): [True: 53.4k, False: 414k]
  ------------------
  313|  53.4k|      m_scanner.pop();
  314|  53.4k|      HandleNode(eventHandler);
  315|   414k|    } else {
  316|   414k|      eventHandler.OnNull(mark, NullAnchor);
  317|   414k|    }
  318|       |
  319|       |    // now grab value (optional)
  320|   468k|    if (!m_scanner.empty() && m_scanner.peek().type == Token::VALUE) {
  ------------------
  |  Branch (320:9): [True: 434k, False: 34.0k]
  |  Branch (320:31): [True: 19.2k, False: 415k]
  ------------------
  321|  19.2k|      m_scanner.pop();
  322|  19.2k|      HandleNode(eventHandler);
  323|   449k|    } else {
  324|   449k|      eventHandler.OnNull(mark, NullAnchor);
  325|   449k|    }
  326|       |
  327|   468k|    if (m_scanner.empty())
  ------------------
  |  Branch (327:9): [True: 263, False: 468k]
  ------------------
  328|    263|      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|   468k|    Token& nextToken = m_scanner.peek();
  333|   468k|    if (nextToken.type == Token::FLOW_ENTRY)
  ------------------
  |  Branch (333:9): [True: 433k, False: 34.6k]
  ------------------
  334|   433k|      m_scanner.pop();
  335|  34.6k|    else if (nextToken.type != Token::FLOW_MAP_END)
  ------------------
  |  Branch (335:14): [True: 190, False: 34.4k]
  ------------------
  336|    190|      throw ParserException(nextToken.mark, ErrorMsg::END_OF_MAP_FLOW);
  337|   468k|  }
  338|       |
  339|  34.8k|  m_pCollectionStack->PopCollectionType(CollectionType::FlowMap);
  340|  34.8k|}
_ZN4YAML15SingleDocParser16HandleCompactMapERNS_12EventHandlerE:
  343|  34.0k|void SingleDocParser::HandleCompactMap(EventHandler& eventHandler) {
  344|  34.0k|  m_pCollectionStack->PushCollectionType(CollectionType::CompactMap);
  345|       |
  346|       |  // grab key
  347|  34.0k|  Mark mark = m_scanner.peek().mark;
  348|  34.0k|  m_scanner.pop();
  349|  34.0k|  HandleNode(eventHandler);
  350|       |
  351|       |  // now grab value (optional)
  352|  34.0k|  if (!m_scanner.empty() && m_scanner.peek().type == Token::VALUE) {
  ------------------
  |  Branch (352:7): [True: 764, False: 33.3k]
  |  Branch (352:29): [True: 402, False: 362]
  ------------------
  353|    402|    m_scanner.pop();
  354|    402|    HandleNode(eventHandler);
  355|  33.6k|  } else {
  356|  33.6k|    eventHandler.OnNull(mark, NullAnchor);
  357|  33.6k|  }
  358|       |
  359|  34.0k|  m_pCollectionStack->PopCollectionType(CollectionType::CompactMap);
  360|  34.0k|}
_ZN4YAML15SingleDocParser25HandleCompactMapWithNoKeyERNS_12EventHandlerE:
  363|  2.69k|void SingleDocParser::HandleCompactMapWithNoKey(EventHandler& eventHandler) {
  364|  2.69k|  m_pCollectionStack->PushCollectionType(CollectionType::CompactMap);
  365|       |
  366|       |  // null key
  367|  2.69k|  eventHandler.OnNull(m_scanner.peek().mark, NullAnchor);
  368|       |
  369|       |  // grab value
  370|  2.69k|  m_scanner.pop();
  371|  2.69k|  HandleNode(eventHandler);
  372|       |
  373|  2.69k|  m_pCollectionStack->PopCollectionType(CollectionType::CompactMap);
  374|  2.69k|}
_ZN4YAML15SingleDocParser15ParsePropertiesERNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERmS8_:
  379|  2.24M|                                      std::string& anchor_name) {
  380|  2.24M|  tag.clear();
  381|  2.24M|  anchor_name.clear();
  382|  2.24M|  anchor = NullAnchor;
  383|       |
  384|  2.73M|  while (true) {
  ------------------
  |  Branch (384:10): [True: 2.73M, Folded]
  ------------------
  385|  2.73M|    if (m_scanner.empty())
  ------------------
  |  Branch (385:9): [True: 691, False: 2.73M]
  ------------------
  386|    691|      return;
  387|       |
  388|  2.73M|    switch (m_scanner.peek().type) {
  389|  7.74k|      case Token::TAG:
  ------------------
  |  Branch (389:7): [True: 7.74k, False: 2.73M]
  ------------------
  390|  7.74k|        ParseTag(tag);
  391|  7.74k|        break;
  392|   489k|      case Token::ANCHOR:
  ------------------
  |  Branch (392:7): [True: 489k, False: 2.24M]
  ------------------
  393|   489k|        ParseAnchor(anchor, anchor_name);
  394|   489k|        break;
  395|  2.24M|      default:
  ------------------
  |  Branch (395:7): [True: 2.24M, False: 497k]
  ------------------
  396|  2.24M|        return;
  397|  2.73M|    }
  398|  2.73M|  }
  399|  2.24M|}
_ZN4YAML15SingleDocParser8ParseTagERNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
  401|  7.74k|void SingleDocParser::ParseTag(std::string& tag) {
  402|  7.74k|  Token& token = m_scanner.peek();
  403|  7.74k|  if (!tag.empty())
  ------------------
  |  Branch (403:7): [True: 60, False: 7.68k]
  ------------------
  404|     60|    throw ParserException(token.mark, ErrorMsg::MULTIPLE_TAGS);
  405|       |
  406|  7.68k|  Tag tagInfo(token);
  407|  7.68k|  tag = tagInfo.Translate(m_directives);
  408|  7.68k|  m_scanner.pop();
  409|  7.68k|}
_ZN4YAML15SingleDocParser11ParseAnchorERmRNSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEE:
  411|   489k|void SingleDocParser::ParseAnchor(anchor_t& anchor, std::string& anchor_name) {
  412|   489k|  Token& token = m_scanner.peek();
  413|   489k|  if (anchor)
  ------------------
  |  Branch (413:7): [True: 17, False: 489k]
  ------------------
  414|     17|    throw ParserException(token.mark, ErrorMsg::MULTIPLE_ANCHORS);
  415|       |
  416|   489k|  anchor_name = token.value;
  417|   489k|  anchor = RegisterAnchor(token.value);
  418|   489k|  m_scanner.pop();
  419|   489k|}
_ZN4YAML15SingleDocParser14RegisterAnchorERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
  421|   489k|anchor_t SingleDocParser::RegisterAnchor(const std::string& name) {
  422|   489k|  if (name.empty())
  ------------------
  |  Branch (422:7): [True: 0, False: 489k]
  ------------------
  423|      0|    return NullAnchor;
  424|       |
  425|   489k|  return m_anchors[name] = ++m_curAnchor;
  426|   489k|}
_ZNK4YAML15SingleDocParser12LookupAnchorERKNS_4MarkERKNSt3__112basic_stringIcNS4_11char_traitsIcEENS4_9allocatorIcEEEE:
  429|  1.62k|                                       const std::string& name) const {
  430|  1.62k|  auto it = m_anchors.find(name);
  431|  1.62k|  if (it == m_anchors.end()) {
  ------------------
  |  Branch (431:7): [True: 318, False: 1.30k]
  ------------------
  432|    318|    std::stringstream ss;
  433|    318|    ss << ErrorMsg::UNKNOWN_ANCHOR << name;
  434|    318|    throw ParserException(mark, ss.str());
  435|    318|  }
  436|       |
  437|  1.30k|  return it->second;
  438|  1.62k|}

_ZN4YAML6StreamC2ERNSt3__113basic_istreamIcNS1_11char_traitsIcEEEE:
  186|  6.40k|    : m_input(input),
  187|  6.40k|      m_mark{},
  188|  6.40k|      m_charSet{},
  189|  6.40k|      m_readahead{},
  190|  6.40k|      m_pPrefetched(new unsigned char[YAML_PREFETCH_SIZE]),
  ------------------
  |  |    6|  6.40k|#define YAML_PREFETCH_SIZE 2048
  ------------------
  191|  6.40k|      m_nPrefetchedAvailable(0),
  192|  6.40k|      m_nPrefetchedUsed(0) {
  193|  6.40k|  using char_traits = std::istream::traits_type;
  194|       |
  195|  6.40k|  if (!input)
  ------------------
  |  Branch (195:7): [True: 0, False: 6.40k]
  ------------------
  196|      0|    return;
  197|       |
  198|       |  // Determine (or guess) the character-set by reading the BOM, if any.  See
  199|       |  // the YAML specification for the determination algorithm.
  200|  6.40k|  char_traits::int_type intro[4]{};
  201|  6.40k|  int nIntroUsed = 0;
  202|  6.40k|  UtfIntroState state = uis_start;
  203|  20.1k|  for (; !s_introFinalState[state];) {
  ------------------
  |  Branch (203:10): [True: 13.7k, False: 6.40k]
  ------------------
  204|  13.7k|    std::istream::int_type ch = input.get();
  205|  13.7k|    intro[nIntroUsed++] = ch;
  206|  13.7k|    UtfIntroCharType charType = IntroCharTypeOf(ch);
  207|  13.7k|    UtfIntroState newState = s_introTransitions[state][charType];
  208|  13.7k|    int nUngets = s_introUngetCount[state][charType];
  209|  13.7k|    if (nUngets > 0) {
  ------------------
  |  Branch (209:9): [True: 6.38k, False: 7.37k]
  ------------------
  210|  6.38k|      input.clear();
  211|  20.0k|      for (; nUngets > 0; --nUngets) {
  ------------------
  |  Branch (211:14): [True: 13.7k, False: 6.38k]
  ------------------
  212|  13.7k|        if (char_traits::eof() != intro[--nIntroUsed])
  ------------------
  |  Branch (212:13): [True: 13.6k, False: 85]
  ------------------
  213|  13.6k|          input.putback(char_traits::to_char_type(intro[nIntroUsed]));
  214|  13.7k|      }
  215|  6.38k|    }
  216|  13.7k|    state = newState;
  217|  13.7k|  }
  218|       |
  219|  6.40k|  switch (state) {
  220|  5.08k|    case uis_utf8:
  ------------------
  |  Branch (220:5): [True: 5.08k, False: 1.32k]
  ------------------
  221|  5.08k|      m_charSet = utf8;
  222|  5.08k|      break;
  223|    729|    case uis_utf16le:
  ------------------
  |  Branch (223:5): [True: 729, False: 5.67k]
  ------------------
  224|    729|      m_charSet = utf16le;
  225|    729|      break;
  226|    460|    case uis_utf16be:
  ------------------
  |  Branch (226:5): [True: 460, False: 5.94k]
  ------------------
  227|    460|      m_charSet = utf16be;
  228|    460|      break;
  229|     68|    case uis_utf32le:
  ------------------
  |  Branch (229:5): [True: 68, False: 6.33k]
  ------------------
  230|     68|      m_charSet = utf32le;
  231|     68|      break;
  232|     64|    case uis_utf32be:
  ------------------
  |  Branch (232:5): [True: 64, False: 6.33k]
  ------------------
  233|     64|      m_charSet = utf32be;
  234|     64|      break;
  235|      0|    default:
  ------------------
  |  Branch (235:5): [True: 0, False: 6.40k]
  ------------------
  236|      0|      m_charSet = utf8;
  237|      0|      break;
  238|  6.40k|  }
  239|       |
  240|  6.40k|  ReadAheadTo(0);
  241|  6.40k|}
_ZN4YAML6StreamD2Ev:
  243|  6.40k|Stream::~Stream() { delete[] m_pPrefetched; }
_ZNK4YAML6Stream4peekEv:
  245|   580M|char Stream::peek() const {
  246|   580M|  if (m_readahead.empty()) {
  ------------------
  |  Branch (246:7): [True: 0, False: 580M]
  ------------------
  247|      0|    return Stream::eof();
  248|      0|  }
  249|       |
  250|   580M|  return m_readahead[0];
  251|   580M|}
_ZNK4YAML6StreamcvbEv:
  253|   335M|Stream::operator bool() const {
  254|   335M|  return m_input.good() ||
  ------------------
  |  Branch (254:10): [True: 319M, False: 15.4M]
  ------------------
  255|  15.4M|         (!m_readahead.empty() && m_readahead[0] != Stream::eof());
  ------------------
  |  Branch (255:11): [True: 15.4M, False: 0]
  |  Branch (255:35): [True: 15.4M, False: 18.0k]
  ------------------
  256|   335M|}
_ZN4YAML6Stream3getEv:
  260|   246M|char Stream::get() {
  261|   246M|  char ch = peek();
  262|   246M|  AdvanceCurrent();
  263|   246M|  m_mark.column++;
  264|       |
  265|       |  // if line ending symbol is unknown, set it to the first
  266|       |  // encountered line ending.
  267|       |  // if line ending '\r' set ending symbol to '\r'
  268|       |  // other wise set it to '\n'
  269|   246M|  if (!m_lineEndingSymbol) {
  ------------------
  |  Branch (269:7): [True: 130M, False: 116M]
  ------------------
  270|   130M|    if (ch == '\n') { // line ending is '\n'
  ------------------
  |  Branch (270:9): [True: 1.68k, False: 130M]
  ------------------
  271|  1.68k|      m_lineEndingSymbol = '\n';
  272|   130M|    } else if (ch == '\r') {
  ------------------
  |  Branch (272:16): [True: 983, False: 130M]
  ------------------
  273|    983|      auto ch2 = peek();
  274|    983|      if (ch2 == '\n') { // line ending is '\r\n'
  ------------------
  |  Branch (274:11): [True: 14, False: 969]
  ------------------
  275|     14|        m_lineEndingSymbol = '\n';
  276|    969|      } else { // line ending is '\r'
  277|    969|        m_lineEndingSymbol = '\r';
  278|    969|      }
  279|    983|    }
  280|   130M|  }
  281|       |
  282|   246M|  if (ch == m_lineEndingSymbol) {
  ------------------
  |  Branch (282:7): [True: 11.0M, False: 235M]
  ------------------
  283|  11.0M|    m_mark.column = 0;
  284|  11.0M|    m_mark.line++;
  285|  11.0M|  }
  286|       |
  287|   246M|  return ch;
  288|   246M|}
_ZN4YAML6Stream3getEi:
  292|  10.3M|std::string Stream::get(int n) {
  293|  10.3M|  std::string ret;
  294|  10.3M|  if (n > 0) {
  ------------------
  |  Branch (294:7): [True: 10.3M, False: 0]
  ------------------
  295|  10.3M|    ret.reserve(static_cast<std::string::size_type>(n));
  296|  20.6M|    for (int i = 0; i < n; i++)
  ------------------
  |  Branch (296:21): [True: 10.3M, False: 10.3M]
  ------------------
  297|  10.3M|      ret += get();
  298|  10.3M|  }
  299|  10.3M|  return ret;
  300|  10.3M|}
_ZN4YAML6Stream3eatEi:
  304|  46.8M|void Stream::eat(int n) {
  305|  94.3M|  for (int i = 0; i < n; i++)
  ------------------
  |  Branch (305:19): [True: 47.5M, False: 46.8M]
  ------------------
  306|  47.5M|    get();
  307|  46.8M|}
_ZN4YAML6Stream14AdvanceCurrentEv:
  309|   246M|void Stream::AdvanceCurrent() {
  310|   246M|  if (!m_readahead.empty()) {
  ------------------
  |  Branch (310:7): [True: 246M, False: 0]
  ------------------
  311|   246M|    m_readahead.pop_front();
  312|   246M|    m_mark.pos++;
  313|   246M|  }
  314|       |
  315|   246M|  ReadAheadTo(0);
  316|   246M|}
_ZNK4YAML6Stream12_ReadAheadToEm:
  318|   158M|bool Stream::_ReadAheadTo(size_t i) const {
  319|   316M|  while (m_input.good() && (m_readahead.size() <= i)) {
  ------------------
  |  Branch (319:10): [True: 316M, False: 6.53k]
  |  Branch (319:28): [True: 158M, False: 158M]
  ------------------
  320|   158M|    switch (m_charSet) {
  ------------------
  |  Branch (320:13): [True: 158M, False: 0]
  ------------------
  321|   138M|      case utf8:
  ------------------
  |  Branch (321:7): [True: 138M, False: 19.9M]
  ------------------
  322|   138M|        StreamInUtf8();
  323|   138M|        break;
  324|  9.11M|      case utf16le:
  ------------------
  |  Branch (324:7): [True: 9.11M, False: 149M]
  ------------------
  325|  9.11M|        StreamInUtf16();
  326|  9.11M|        break;
  327|  8.45M|      case utf16be:
  ------------------
  |  Branch (327:7): [True: 8.45M, False: 149M]
  ------------------
  328|  8.45M|        StreamInUtf16();
  329|  8.45M|        break;
  330|  1.03M|      case utf32le:
  ------------------
  |  Branch (330:7): [True: 1.03M, False: 157M]
  ------------------
  331|  1.03M|        StreamInUtf32();
  332|  1.03M|        break;
  333|  1.32M|      case utf32be:
  ------------------
  |  Branch (333:7): [True: 1.32M, False: 156M]
  ------------------
  334|  1.32M|        StreamInUtf32();
  335|  1.32M|        break;
  336|   158M|    }
  337|   158M|  }
  338|       |
  339|       |  // signal end of stream
  340|   158M|  if (!m_input.good())
  ------------------
  |  Branch (340:7): [True: 6.53k, False: 158M]
  ------------------
  341|  6.53k|    m_readahead.push_back(Stream::eof());
  342|       |
  343|   158M|  return m_readahead.size() > i;
  344|   158M|}
_ZNK4YAML6Stream12StreamInUtf8Ev:
  346|   138M|void Stream::StreamInUtf8() const {
  347|   138M|  unsigned char b = GetNextByte();
  348|   138M|  if (m_input.good()) {
  ------------------
  |  Branch (348:7): [True: 138M, False: 4.80k]
  ------------------
  349|   138M|    m_readahead.push_back(static_cast<char>(b));
  350|   138M|  }
  351|   138M|}
_ZNK4YAML6Stream13StreamInUtf16Ev:
  353|  17.5M|void Stream::StreamInUtf16() const {
  354|  17.5M|  unsigned long ch = 0;
  355|  17.5M|  unsigned char bytes[2];
  356|  17.5M|  int nBigEnd = (m_charSet == utf16be) ? 0 : 1;
  ------------------
  |  Branch (356:17): [True: 8.45M, False: 9.11M]
  ------------------
  357|       |
  358|  17.5M|  bytes[0] = GetNextByte();
  359|  17.5M|  bytes[1] = GetNextByte();
  360|  17.5M|  if (!m_input.good()) {
  ------------------
  |  Branch (360:7): [True: 815, False: 17.5M]
  ------------------
  361|    815|    return;
  362|    815|  }
  363|  17.5M|  ch = (static_cast<unsigned long>(bytes[nBigEnd]) << 8) |
  364|  17.5M|       static_cast<unsigned long>(bytes[1 ^ nBigEnd]);
  365|       |
  366|  17.5M|  if (ch >= 0xDC00 && ch < 0xE000) {
  ------------------
  |  Branch (366:7): [True: 175k, False: 17.3M]
  |  Branch (366:23): [True: 9.10k, False: 166k]
  ------------------
  367|       |    // Trailing (low) surrogate...ugh, wrong order
  368|  9.10k|    QueueUnicodeCodepoint(m_readahead, CP_REPLACEMENT_CHARACTER);
  ------------------
  |  |   12|  9.10k|#define CP_REPLACEMENT_CHARACTER (0xFFFD)
  ------------------
  369|  9.10k|    return;
  370|  9.10k|  }
  371|       |
  372|  17.5M|  if (ch >= 0xD800 && ch < 0xDC00) {
  ------------------
  |  Branch (372:7): [True: 186k, False: 17.3M]
  |  Branch (372:23): [True: 19.9k, False: 166k]
  ------------------
  373|       |    // ch is a leading (high) surrogate
  374|       |
  375|       |    // Four byte UTF-8 code point
  376|       |
  377|       |    // Read the trailing (low) surrogate
  378|  19.3M|    for (;;) {
  379|  19.3M|      bytes[0] = GetNextByte();
  380|  19.3M|      bytes[1] = GetNextByte();
  381|  19.3M|      if (!m_input.good()) {
  ------------------
  |  Branch (381:11): [True: 301, False: 19.3M]
  ------------------
  382|    301|        QueueUnicodeCodepoint(m_readahead, CP_REPLACEMENT_CHARACTER);
  ------------------
  |  |   12|    301|#define CP_REPLACEMENT_CHARACTER (0xFFFD)
  ------------------
  383|    301|        return;
  384|    301|      }
  385|  19.3M|      unsigned long chLow = (static_cast<unsigned long>(bytes[nBigEnd]) << 8) |
  386|  19.3M|                            static_cast<unsigned long>(bytes[1 ^ nBigEnd]);
  387|  19.3M|      if (chLow < 0xDC00 || chLow >= 0xE000) {
  ------------------
  |  Branch (387:11): [True: 19.3M, False: 3.87k]
  |  Branch (387:29): [True: 2.54k, False: 1.32k]
  ------------------
  388|       |        // Trouble...not a low surrogate.  Dump a REPLACEMENT CHARACTER into the
  389|       |        // stream.
  390|  19.3M|        QueueUnicodeCodepoint(m_readahead, CP_REPLACEMENT_CHARACTER);
  ------------------
  |  |   12|  19.3M|#define CP_REPLACEMENT_CHARACTER (0xFFFD)
  ------------------
  391|       |
  392|       |        // Deal with the next UTF-16 unit
  393|  19.3M|        if (chLow < 0xD800 || chLow >= 0xE000) {
  ------------------
  |  Branch (393:13): [True: 15.7k, False: 19.3M]
  |  Branch (393:31): [True: 2.54k, False: 19.3M]
  ------------------
  394|       |          // Easiest case: queue the codepoint and return
  395|  18.3k|          QueueUnicodeCodepoint(m_readahead, ch);
  396|  18.3k|          return;
  397|  18.3k|        }
  398|       |        // Start the loop over with the new high surrogate
  399|  19.3M|        ch = chLow;
  400|  19.3M|        continue;
  401|  19.3M|      }
  402|       |
  403|       |      // Select the payload bits from the high surrogate
  404|  1.32k|      ch &= 0x3FF;
  405|  1.32k|      ch <<= 10;
  406|       |
  407|       |      // Include bits from low surrogate
  408|  1.32k|      ch |= (chLow & 0x3FF);
  409|       |
  410|       |      // Add the surrogacy offset
  411|  1.32k|      ch += 0x10000;
  412|  1.32k|      break;
  413|  19.3M|    }
  414|  19.9k|  }
  415|       |
  416|  17.5M|  QueueUnicodeCodepoint(m_readahead, ch);
  417|  17.5M|}
_ZNK4YAML6Stream11GetNextByteEv:
  423|   221M|unsigned char Stream::GetNextByte() const {
  424|   221M|  if (m_nPrefetchedUsed >= m_nPrefetchedAvailable) {
  ------------------
  |  Branch (424:7): [True: 120k, False: 221M]
  ------------------
  425|   120k|    std::streambuf* pBuf = m_input.rdbuf();
  426|   120k|    m_nPrefetchedAvailable = static_cast<std::size_t>(
  427|   120k|        pBuf->sgetn(ReadBuffer(m_pPrefetched), YAML_PREFETCH_SIZE));
  ------------------
  |  |    6|   120k|#define YAML_PREFETCH_SIZE 2048
  ------------------
  428|   120k|    m_nPrefetchedUsed = 0;
  429|   120k|    if (!m_nPrefetchedAvailable) {
  ------------------
  |  Branch (429:9): [True: 7.14k, False: 113k]
  ------------------
  430|  7.14k|      m_input.setstate(std::ios_base::eofbit);
  431|  7.14k|    }
  432|       |
  433|   120k|    if (0 == m_nPrefetchedAvailable) {
  ------------------
  |  Branch (433:9): [True: 7.14k, False: 113k]
  ------------------
  434|  7.14k|      return 0;
  435|  7.14k|    }
  436|   120k|  }
  437|       |
  438|   221M|  return m_pPrefetched[m_nPrefetchedUsed++];
  439|   221M|}
_ZNK4YAML6Stream13StreamInUtf32Ev:
  441|  2.35M|void Stream::StreamInUtf32() const {
  442|  2.35M|  static int indexes[2][4] = {{3, 2, 1, 0}, {0, 1, 2, 3}};
  443|       |
  444|  2.35M|  unsigned long ch = 0;
  445|  2.35M|  unsigned char bytes[4];
  446|  2.35M|  int* pIndexes = (m_charSet == utf32be) ? indexes[1] : indexes[0];
  ------------------
  |  Branch (446:19): [True: 1.32M, False: 1.03M]
  ------------------
  447|       |
  448|  2.35M|  bytes[0] = GetNextByte();
  449|  2.35M|  bytes[1] = GetNextByte();
  450|  2.35M|  bytes[2] = GetNextByte();
  451|  2.35M|  bytes[3] = GetNextByte();
  452|  2.35M|  if (!m_input.good()) {
  ------------------
  |  Branch (452:7): [True: 125, False: 2.35M]
  ------------------
  453|    125|    return;
  454|    125|  }
  455|       |
  456|  11.7M|  for (int i = 0; i < 4; ++i) {
  ------------------
  |  Branch (456:19): [True: 9.41M, False: 2.35M]
  ------------------
  457|  9.41M|    ch <<= 8;
  458|  9.41M|    ch |= bytes[pIndexes[i]];
  459|  9.41M|  }
  460|       |
  461|  2.35M|  QueueUnicodeCodepoint(m_readahead, ch);
  462|  2.35M|}
_ZN4YAML15IntroCharTypeOfEi:
  125|  13.7k|inline UtfIntroCharType IntroCharTypeOf(std::istream::int_type ch) {
  126|  13.7k|  if (std::istream::traits_type::eof() == ch) {
  ------------------
  |  Branch (126:7): [True: 85, False: 13.6k]
  ------------------
  127|     85|    return uictOther;
  128|     85|  }
  129|       |
  130|  13.6k|  switch (ch) {
  ------------------
  |  Branch (130:11): [True: 2.19k, False: 11.4k]
  ------------------
  131|  1.83k|    case 0:
  ------------------
  |  Branch (131:5): [True: 1.83k, False: 11.8k]
  ------------------
  132|  1.83k|      return uict00;
  133|     11|    case 0xBB:
  ------------------
  |  Branch (133:5): [True: 11, False: 13.6k]
  ------------------
  134|     11|      return uictBB;
  135|      6|    case 0xBF:
  ------------------
  |  Branch (135:5): [True: 6, False: 13.6k]
  ------------------
  136|      6|      return uictBF;
  137|    129|    case 0xEF:
  ------------------
  |  Branch (137:5): [True: 129, False: 13.5k]
  ------------------
  138|    129|      return uictEF;
  139|     45|    case 0xFE:
  ------------------
  |  Branch (139:5): [True: 45, False: 13.6k]
  ------------------
  140|     45|      return uictFE;
  141|    169|    case 0xFF:
  ------------------
  |  Branch (141:5): [True: 169, False: 13.5k]
  ------------------
  142|    169|      return uictFF;
  143|  13.6k|  }
  144|       |
  145|  11.4k|  if ((ch > 0) && (ch < 0xFF)) {
  ------------------
  |  Branch (145:7): [True: 11.4k, False: 0]
  |  Branch (145:19): [True: 11.4k, False: 0]
  ------------------
  146|  11.4k|    return uictAscii;
  147|  11.4k|  }
  148|       |
  149|      0|  return uictOther;
  150|  11.4k|}
_ZN4YAML21QueueUnicodeCodepointERNSt3__15dequeIcNS0_9allocatorIcEEEEm:
  161|  39.2M|inline void QueueUnicodeCodepoint(std::deque<char>& q, unsigned long ch) {
  162|       |  // We are not allowed to queue the Stream::eof() codepoint, so
  163|       |  // replace it with CP_REPLACEMENT_CHARACTER
  164|  39.2M|  if (static_cast<unsigned long>(Stream::eof()) == ch) {
  ------------------
  |  Branch (164:7): [True: 970, False: 39.2M]
  ------------------
  165|    970|    ch = CP_REPLACEMENT_CHARACTER;
  ------------------
  |  |   12|    970|#define CP_REPLACEMENT_CHARACTER (0xFFFD)
  ------------------
  166|    970|  }
  167|       |
  168|  39.2M|  if (ch < 0x80) {
  ------------------
  |  Branch (168:7): [True: 914k, False: 38.3M]
  ------------------
  169|   914k|    q.push_back(Utf8Adjust(ch, 0, 0));
  170|  38.3M|  } else if (ch < 0x800) {
  ------------------
  |  Branch (170:14): [True: 809k, False: 37.5M]
  ------------------
  171|   809k|    q.push_back(Utf8Adjust(ch, 2, 6));
  172|   809k|    q.push_back(Utf8Adjust(ch, 1, 0));
  173|  37.5M|  } else if (ch < 0x10000) {
  ------------------
  |  Branch (173:14): [True: 35.1M, False: 2.35M]
  ------------------
  174|  35.1M|    q.push_back(Utf8Adjust(ch, 3, 12));
  175|  35.1M|    q.push_back(Utf8Adjust(ch, 1, 6));
  176|  35.1M|    q.push_back(Utf8Adjust(ch, 1, 0));
  177|  35.1M|  } else {
  178|  2.35M|    q.push_back(Utf8Adjust(ch, 4, 18));
  179|  2.35M|    q.push_back(Utf8Adjust(ch, 1, 12));
  180|  2.35M|    q.push_back(Utf8Adjust(ch, 1, 6));
  181|  2.35M|    q.push_back(Utf8Adjust(ch, 1, 0));
  182|  2.35M|  }
  183|  39.2M|}
_ZN4YAML10Utf8AdjustEmhh:
  153|   117M|                       unsigned char rshift) {
  154|   117M|  const unsigned char header =
  155|   117M|      static_cast<unsigned char>(((1 << lead_bits) - 1) << (8 - lead_bits));
  156|   117M|  const unsigned char mask = (0xFF >> (lead_bits + 1));
  157|   117M|  return static_cast<char>(
  158|   117M|      static_cast<unsigned char>(header | ((ch >> rshift) & mask)));
  159|   117M|}
_ZN4YAML10ReadBufferEPh:
  419|   120k|inline char* ReadBuffer(unsigned char* pBuffer) {
  420|   120k|  return reinterpret_cast<char*>(pBuffer);
  421|   120k|}

_ZNK4YAML6StreamntEv:
   34|   156M|  bool operator!() const { return !static_cast<bool>(*this); }
_ZN4YAML6Stream3eofEv:
   41|  77.3M|  static char eof() { return 0x04; }
_ZNK4YAML6Stream4markEv:
   43|   174M|  const Mark mark() const { return m_mark; }
_ZNK4YAML6Stream3posEv:
   44|  2.26M|  int pos() const { return m_mark.pos; }
_ZNK4YAML6Stream4lineEv:
   45|  2.33M|  int line() const { return m_mark.line; }
_ZNK4YAML6Stream6columnEv:
   46|   307M|  int column() const { return m_mark.column; }
_ZN4YAML6Stream11ResetColumnEv:
   47|  4.87k|  void ResetColumn() { m_mark.column = 0; }
_ZNK4YAML6Stream6CharAtEm:
   74|  2.03G|inline char Stream::CharAt(size_t i) const { return m_readahead[i]; }
_ZNK4YAML6Stream11ReadAheadToEm:
   76|  1.45G|inline bool Stream::ReadAheadTo(size_t i) const {
   77|  1.45G|  if (m_readahead.size() > i)
  ------------------
  |  Branch (77:7): [True: 1.29G, False: 158M]
  ------------------
   78|  1.29G|    return true;
   79|   158M|  return _ReadAheadTo(i);
   80|  1.45G|}

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

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

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

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

