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

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

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

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

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

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

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

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

_ZN4YAML6detail8node_refC2Ev:
   28|  2.76M|  node_ref() : m_pData(std::make_shared<node_data>()) {}
_ZNK4YAML6detail8node_ref10is_definedEv:
   32|  8.54M|  bool is_defined() const { return m_pData->is_defined(); }
_ZNK4YAML6detail8node_ref4typeEv:
   34|  5.35M|  NodeType::value type() const { return m_pData->type(); }
_ZNK4YAML6detail8node_ref6scalarEv:
   35|  3.80M|  const std::string& scalar() const { return m_pData->scalar(); }
_ZN4YAML6detail8node_ref12mark_definedEv:
   39|  2.76M|  void mark_defined() { m_pData->mark_defined(); }
_ZN4YAML6detail8node_ref8set_markERKNS_4MarkE:
   42|  2.76M|  void set_mark(const Mark& mark) { m_pData->set_mark(mark); }
_ZN4YAML6detail8node_ref8set_typeENS_8NodeType5valueE:
   43|   146k|  void set_type(NodeType::value type) { m_pData->set_type(type); }
_ZN4YAML6detail8node_ref7set_tagERKNSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEE:
   44|   397k|  void set_tag(const std::string& tag) { m_pData->set_tag(tag); }
_ZN4YAML6detail8node_ref8set_nullEv:
   45|  2.36M|  void set_null() { m_pData->set_null(); }
_ZN4YAML6detail8node_ref10set_scalarERKNSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEE:
   46|   251k|  void set_scalar(const std::string& scalar) { m_pData->set_scalar(scalar); }
_ZN4YAML6detail8node_ref9set_styleENS_12EmitterStyle5valueE:
   47|   146k|  void set_style(EmitterStyle::value style) { m_pData->set_style(style); }
_ZN4YAML6detail8node_ref9push_backERNS0_4nodeENSt3__110shared_ptrINS0_13memory_holderEEE:
   63|  1.19M|  void push_back(node& node, shared_memory_holder pMemory) {
   64|  1.19M|    m_pData->push_back(node, pMemory);
   65|  1.19M|  }
_ZN4YAML6detail8node_ref6insertERNS0_4nodeES3_NSt3__110shared_ptrINS0_13memory_holderEEE:
   66|   474k|  void insert(node& key, node& value, shared_memory_holder pMemory) {
   67|   474k|    m_pData->insert(key, value, pMemory);
   68|   474k|  }

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

_ZN4YAML9ExceptionD2Ev:
   24|  3.76k|    #define YAML_CPP_NOEXCEPT noexcept

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

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

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

_ZN4YAML3Exp8ParseHexERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERKNS_4MarkE:
   13|  1.78k|unsigned ParseHex(const std::string& str, const Mark& mark) {
   14|  1.78k|  unsigned value = 0;
   15|  9.31k|  for (char ch : str) {
  ------------------
  |  Branch (15:16): [True: 9.31k, False: 1.70k]
  ------------------
   16|  9.31k|    int digit = 0;
   17|  9.31k|    if ('a' <= ch && ch <= 'f')
  ------------------
  |  Branch (17:9): [True: 856, False: 8.45k]
  |  Branch (17:22): [True: 852, False: 4]
  ------------------
   18|    852|      digit = ch - 'a' + 10;
   19|  8.46k|    else if ('A' <= ch && ch <= 'F')
  ------------------
  |  Branch (19:14): [True: 2.63k, False: 5.82k]
  |  Branch (19:27): [True: 2.62k, False: 7]
  ------------------
   20|  2.62k|      digit = ch - 'A' + 10;
   21|  5.83k|    else if ('0' <= ch && ch <= '9')
  ------------------
  |  Branch (21:14): [True: 5.76k, False: 68]
  |  Branch (21:27): [True: 5.75k, False: 9]
  ------------------
   22|  5.75k|      digit = ch - '0';
   23|     77|    else
   24|     77|      throw ParserException(mark, ErrorMsg::INVALID_HEX);
   25|       |
   26|  9.23k|    value = (value << 4) + digit;
   27|  9.23k|  }
   28|       |
   29|  1.70k|  return value;
   30|  1.78k|}
_ZN4YAML3Exp3StrEj:
   32|  4.56k|std::string Str(unsigned ch) { return std::string(1, static_cast<char>(ch)); }
_ZN4YAML3Exp6EscapeERNS_6StreamEi:
   38|  1.78k|std::string Escape(Stream& in, int codeLength) {
   39|       |  // grab string
   40|  1.78k|  std::string str;
   41|  11.4k|  for (int i = 0; i < codeLength; i++)
  ------------------
  |  Branch (41:19): [True: 9.61k, False: 1.78k]
  ------------------
   42|  9.61k|    str += in.get();
   43|       |
   44|       |  // get the value
   45|  1.78k|  unsigned value = ParseHex(str, in.mark());
   46|       |
   47|       |  // legal unicode?
   48|  1.78k|  if ((value >= 0xD800 && value <= 0xDFFF) || value > 0x10FFFF) {
  ------------------
  |  Branch (48:8): [True: 746, False: 1.03k]
  |  Branch (48:27): [True: 12, False: 734]
  |  Branch (48:47): [True: 41, False: 1.65k]
  ------------------
   49|     53|    std::stringstream msg;
   50|     53|    msg << ErrorMsg::INVALID_UNICODE << value;
   51|     53|    throw ParserException(in.mark(), msg.str());
   52|     53|  }
   53|       |
   54|       |  // now break it up into chars
   55|  1.73k|  if (value <= 0x7F)
  ------------------
  |  Branch (55:7): [True: 236, False: 1.49k]
  ------------------
   56|    236|    return Str(value);
   57|       |
   58|  1.49k|  if (value <= 0x7FF)
  ------------------
  |  Branch (58:7): [True: 343, False: 1.15k]
  ------------------
   59|    343|    return Str(0xC0 + (value >> 6)) + Str(0x80 + (value & 0x3F));
   60|       |
   61|  1.15k|  if (value <= 0xFFFF)
  ------------------
  |  Branch (61:7): [True: 658, False: 495]
  ------------------
   62|    658|    return Str(0xE0 + (value >> 12)) + Str(0x80 + ((value >> 6) & 0x3F)) +
   63|    658|           Str(0x80 + (value & 0x3F));
   64|       |
   65|    495|  return Str(0xF0 + (value >> 18)) + Str(0x80 + ((value >> 12) & 0x3F)) +
   66|    495|         Str(0x80 + ((value >> 6) & 0x3F)) + Str(0x80 + (value & 0x3F));
   67|  1.15k|}
_ZN4YAML3Exp6EscapeERNS_6StreamE:
   74|  40.6k|std::string Escape(Stream& in) {
   75|       |  // eat slash
   76|  40.6k|  char escape = in.get();
   77|       |
   78|       |  // switch on escape character
   79|  40.6k|  char ch = in.get();
   80|       |
   81|       |  // first do single quote, since it's easier
   82|  40.6k|  if (escape == '\'' && ch == '\'')
  ------------------
  |  Branch (82:7): [True: 724, False: 39.9k]
  |  Branch (82:25): [True: 724, False: 0]
  ------------------
   83|    724|    return "\'";
   84|       |
   85|       |  // now do the slash (we're not gonna check if it's a slash - you better pass
   86|       |  // one!)
   87|  39.9k|  switch (ch) {
  ------------------
  |  Branch (87:11): [True: 39.6k, False: 240]
  ------------------
   88|    775|    case '0':
  ------------------
  |  Branch (88:5): [True: 775, False: 39.1k]
  ------------------
   89|    775|      return std::string(1, '\x00');
   90|    200|    case 'a':
  ------------------
  |  Branch (90:5): [True: 200, False: 39.7k]
  ------------------
   91|    200|      return "\x07";
   92|  1.05k|    case 'b':
  ------------------
  |  Branch (92:5): [True: 1.05k, False: 38.8k]
  ------------------
   93|  1.05k|      return "\x08";
   94|    780|    case 't':
  ------------------
  |  Branch (94:5): [True: 780, False: 39.1k]
  ------------------
   95|  5.34k|    case '\t':
  ------------------
  |  Branch (95:5): [True: 4.56k, False: 35.3k]
  ------------------
   96|  5.34k|      return "\x09";
   97|  7.40k|    case 'n':
  ------------------
  |  Branch (97:5): [True: 7.40k, False: 32.5k]
  ------------------
   98|  7.40k|      return "\x0A";
   99|    323|    case 'v':
  ------------------
  |  Branch (99:5): [True: 323, False: 39.5k]
  ------------------
  100|    323|      return "\x0B";
  101|    458|    case 'f':
  ------------------
  |  Branch (101:5): [True: 458, False: 39.4k]
  ------------------
  102|    458|      return "\x0C";
  103|    212|    case 'r':
  ------------------
  |  Branch (103:5): [True: 212, False: 39.7k]
  ------------------
  104|    212|      return "\x0D";
  105|    555|    case 'e':
  ------------------
  |  Branch (105:5): [True: 555, False: 39.3k]
  ------------------
  106|    555|      return "\x1B";
  107|    440|    case ' ':
  ------------------
  |  Branch (107:5): [True: 440, False: 39.4k]
  ------------------
  108|    440|      return R"( )";
  109|  5.93k|    case '\"':
  ------------------
  |  Branch (109:5): [True: 5.93k, False: 33.9k]
  ------------------
  110|  5.93k|      return "\"";
  111|    352|    case '\'':
  ------------------
  |  Branch (111:5): [True: 352, False: 39.5k]
  ------------------
  112|    352|      return "\'";
  113|    340|    case '\\':
  ------------------
  |  Branch (113:5): [True: 340, False: 39.5k]
  ------------------
  114|    340|      return "\\";
  115|  2.27k|    case '/':
  ------------------
  |  Branch (115:5): [True: 2.27k, False: 37.6k]
  ------------------
  116|  2.27k|      return "/";
  117|    414|    case 'N':
  ------------------
  |  Branch (117:5): [True: 414, False: 39.5k]
  ------------------
  118|    414|      return "\xC2\x85";      // NEL (U+0085)
  119|    216|    case '_':
  ------------------
  |  Branch (119:5): [True: 216, False: 39.7k]
  ------------------
  120|    216|      return "\xC2\xA0";      // NBSP (U+00A0)
  121|  9.66k|    case 'L':
  ------------------
  |  Branch (121:5): [True: 9.66k, False: 30.2k]
  ------------------
  122|  9.66k|      return "\xE2\x80\xA8";  // LS (U+2028)
  123|  1.92k|    case 'P':
  ------------------
  |  Branch (123:5): [True: 1.92k, False: 37.9k]
  ------------------
  124|  1.92k|      return "\xE2\x80\xA9";  // PS (U+2029)
  125|    486|    case 'x':
  ------------------
  |  Branch (125:5): [True: 486, False: 39.4k]
  ------------------
  126|    486|      return Escape(in, 2);
  127|    437|    case 'u':
  ------------------
  |  Branch (127:5): [True: 437, False: 39.4k]
  ------------------
  128|    437|      return Escape(in, 4);
  129|    862|    case 'U':
  ------------------
  |  Branch (129:5): [True: 862, False: 39.0k]
  ------------------
  130|    862|      return Escape(in, 8);
  131|  39.9k|  }
  132|       |
  133|    240|  std::stringstream msg;
  134|    240|  throw ParserException(in.mark(), std::string(ErrorMsg::INVALID_ESCAPE) + ch);
  135|  39.9k|}

_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|  37.3M|inline const RegEx& BlankOrBreak() {
   44|  37.3M|  static const RegEx e = Blank() | Break();
   45|  37.3M|  return e;
   46|  37.3M|}
_ZN4YAML3Exp5BlankEv:
   35|  27.9M|inline const RegEx& Blank() {
   36|  27.9M|  static const RegEx e = Space() | Tab();
   37|  27.9M|  return e;
   38|  27.9M|}
_ZN4YAML3Exp5SpaceEv:
   27|      1|inline const RegEx& Space() {
   28|      1|  static const RegEx e = RegEx(' ');
   29|      1|  return e;
   30|      1|}
_ZN4YAML3Exp6DocEndEv:
   88|  2.13M|inline const RegEx& DocEnd() {
   89|  2.13M|  static const RegEx e = RegEx("...") + (BlankOrBreak() | RegEx());
   90|  2.13M|  return e;
   91|  2.13M|}
_ZN4YAML3Exp10BlockEntryEv:
   96|  11.1M|inline const RegEx& BlockEntry() {
   97|  11.1M|  static const RegEx e = RegEx('-') + (BlankOrBreak() | RegEx());
   98|  11.1M|  return e;
   99|  11.1M|}
_ZN4YAML3Exp3KeyEv:
  100|  8.35M|inline const RegEx& Key() {
  101|  8.35M|  static const RegEx e = RegEx('?') + BlankOrBreak();
  102|  8.35M|  return e;
  103|  8.35M|}
_ZN4YAML3Exp9KeyInFlowEv:
  104|   986k|inline const RegEx& KeyInFlow() {
  105|   986k|  static const RegEx e = RegEx('?') + BlankOrBreak();
  106|   986k|  return e;
  107|   986k|}
_ZN4YAML3Exp11PlainScalarEv:
  153|  1.09M|inline const RegEx& PlainScalar() {
  154|  1.09M|  static const RegEx e =
  155|  1.09M|      !(BlankOrBreak() | RegEx(",[]{}#&*!|>\'\"%@`", REGEX_OR) |
  156|  1.09M|        (RegEx("-?:", REGEX_OR) + (BlankOrBreak() | RegEx())));
  157|  1.09M|  return e;
  158|  1.09M|}
_ZN4YAML3Exp17PlainScalarInFlowEv:
  159|   916k|inline const RegEx& PlainScalarInFlow() {
  160|   916k|  static const RegEx e =
  161|   916k|      !(BlankOrBreak() | RegEx("?,[]{}#&*!|>\'\"%@`", REGEX_OR) |
  162|   916k|        (RegEx("-:", REGEX_OR) + (Blank() | RegEx())));
  163|   916k|  return e;
  164|   916k|}
_ZN4YAML3Exp3TabEv:
   31|  80.8k|inline const RegEx& Tab() {
   32|  80.8k|  static const RegEx e = RegEx('\t');
   33|  80.8k|  return e;
   34|  80.8k|}
_ZN4YAML3Exp7CommentEv:
  124|  67.8M|inline const RegEx Comment() {
  125|  67.8M|  static const RegEx e = RegEx('#');
  126|  67.8M|  return e;
  127|  67.8M|}
_ZN4YAML3Exp5BreakEv:
   39|   199M|inline const RegEx& Break() {
   40|   199M|  static const RegEx e = RegEx('\n') | RegEx("\r\n") | RegEx('\r');
   41|   199M|  return e;
   42|   199M|}
_ZN4YAML3Exp5ValueEv:
  108|  8.35M|inline const RegEx& Value() {
  109|  8.35M|  static const RegEx e = RegEx(':') + (BlankOrBreak() | RegEx());
  110|  8.35M|  return e;
  111|  8.35M|}
_ZN4YAML3Exp15ValueInJSONFlowEv:
  116|  10.4k|inline const RegEx& ValueInJSONFlow() {
  117|  10.4k|  static const RegEx e = RegEx(':');
  118|  10.4k|  return e;
  119|  10.4k|}
_ZN4YAML3Exp11ValueInFlowEv:
  112|   958k|inline const RegEx& ValueInFlow() {
  113|   958k|  static const RegEx e = RegEx(':') + (BlankOrBreak() | RegEx(",]}", REGEX_OR));
  114|   958k|  return e;
  115|   958k|}
_ZN4YAML3Exp5EmptyEv:
   23|  5.45k|inline const RegEx& Empty() {
   24|  5.45k|  static const RegEx e;
   25|  5.45k|  return e;
   26|  5.45k|}
_ZN4YAML3Exp5DigitEv:
   47|    473|inline const RegEx& Digit() {
   48|    473|  static const RegEx e = RegEx('0', '9');
   49|    473|  return e;
   50|    473|}
_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|  8.97M|inline const RegEx& Word() {
   60|  8.97M|  static const RegEx e = AlphaNumeric() | RegEx('-');
   61|  8.97M|  return e;
   62|  8.97M|}
_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.68M|inline const RegEx& DocIndicator() {
   93|  4.68M|  static const RegEx e = DocStart() | DocEnd();
   94|  4.68M|  return e;
   95|  4.68M|}
_ZN4YAML3Exp6AnchorEv:
  128|  27.1M|inline const RegEx& Anchor() {
  129|  27.1M|  static const RegEx e = !(RegEx("[]{},", REGEX_OR) | BlankOrBreak());
  130|  27.1M|  return e;
  131|  27.1M|}
_ZN4YAML3Exp9AnchorEndEv:
  132|  9.09k|inline const RegEx& AnchorEnd() {
  133|  9.09k|  static const RegEx e = RegEx("?:,]}%@`", REGEX_OR) | BlankOrBreak();
  134|  9.09k|  return e;
  135|  9.09k|}
_ZN4YAML3Exp3URIEv:
  136|  9.43k|inline const RegEx& URI() {
  137|  9.43k|  static const RegEx e = Word() | RegEx("#;/?:@&=+$,_.!~*'()[]", REGEX_OR) |
  138|  9.43k|                         (RegEx('%') + Hex() + Hex());
  139|  9.43k|  return e;
  140|  9.43k|}
_ZN4YAML3Exp3TagEv:
  141|  2.19M|inline const RegEx& Tag() {
  142|  2.19M|  static const RegEx e = Word() | RegEx("#;/?:@&=+$_.~*'()", REGEX_OR) |
  143|  2.19M|                         (RegEx('%') + Hex() + Hex());
  144|  2.19M|  return e;
  145|  2.19M|}
_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|   916k|inline const RegEx& ScanScalarEndInFlow() {
  177|   916k|  static const RegEx e = (EndScalarInFlow() | (BlankOrBreak() + Comment()));
  178|   916k|  return e;
  179|   916k|}
_ZN4YAML3Exp13ScanScalarEndEv:
  181|  1.09M|inline const RegEx& ScanScalarEnd() {
  182|  1.09M|  static const RegEx e = EndScalar() | (BlankOrBreak() + Comment());
  183|  1.09M|  return e;
  184|  1.09M|}
_ZN4YAML3Exp14EscSingleQuoteEv:
  185|  1.80k|inline const RegEx& EscSingleQuote() {
  186|  1.80k|  static const RegEx e = RegEx("\'\'");
  187|  1.80k|  return e;
  188|  1.80k|}
_ZN4YAML3Exp8EscBreakEv:
  189|  12.9M|inline const RegEx& EscBreak() {
  190|  12.9M|  static const RegEx e = RegEx('\\') + Break();
  191|  12.9M|  return e;
  192|  12.9M|}
_ZN4YAML3Exp14ChompIndicatorEv:
  194|      3|inline const RegEx& ChompIndicator() {
  195|      3|  static const RegEx e = RegEx("+-", REGEX_OR);
  196|      3|  return e;
  197|      3|}
_ZN4YAML3Exp5ChompEv:
  198|  5.49k|inline const RegEx& Chomp() {
  199|  5.49k|  static const RegEx e = (ChompIndicator() + Digit()) |
  200|  5.49k|                         (Digit() + ChompIndicator()) | ChompIndicator() |
  201|  5.49k|                         Digit();
  202|  5.49k|  return e;
  203|  5.49k|}

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

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

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

_ZN4YAML12IsNullStringEPKcm:
   13|   273k|bool IsNullString(const char* str, std::size_t size) {
   14|   273k|  return size == 0 || same(str, size, "~") || same(str, size, "null") ||
  ------------------
  |  Branch (14:10): [True: 0, False: 273k]
  |  Branch (14:23): [True: 25.6k, False: 247k]
  |  Branch (14:47): [True: 195, False: 247k]
  ------------------
   15|   247k|         same(str, size, "Null") || same(str, size, "NULL");
  ------------------
  |  Branch (15:10): [True: 204, False: 247k]
  |  Branch (15:37): [True: 22, False: 247k]
  ------------------
   16|   273k|}
null.cpp:_ZN4YAMLL4sameILm2EEEbPKcmRAT__S1_:
    8|   273k|static bool same(const char* str, std::size_t size, const char (&literal)[N]) {
    9|   273k|  constexpr int literalSize = N - 1; // minus null terminator
   10|   273k|  return size == literalSize && std::strncmp(str, literal, literalSize) == 0;
  ------------------
  |  Branch (10:10): [True: 253k, False: 19.4k]
  |  Branch (10:33): [True: 25.6k, False: 228k]
  ------------------
   11|   273k|}
null.cpp:_ZN4YAMLL4sameILm5EEEbPKcmRAT__S1_:
    8|   741k|static bool same(const char* str, std::size_t size, const char (&literal)[N]) {
    9|   741k|  constexpr int literalSize = N - 1; // minus null terminator
   10|   741k|  return size == literalSize && std::strncmp(str, literal, literalSize) == 0;
  ------------------
  |  Branch (10:10): [True: 12.4k, False: 729k]
  |  Branch (10:33): [True: 421, False: 12.0k]
  ------------------
   11|   741k|}

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

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

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

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

_ZNK4YAML5RegEx7MatchesERKNS_6StreamE:
   26|   484M|inline bool RegEx::Matches(const Stream& in) const { return Match(in) >= 0; }
_ZNK4YAML5RegEx5MatchERKNS_6StreamE:
   49|   529M|inline int RegEx::Match(const Stream& in) const {
   50|   529M|  StreamCharSource source(in);
   51|   529M|  return Match(source);
   52|   529M|}
_ZNK4YAML5RegEx5MatchINS_16StreamCharSourceEEEiRKT_:
   72|  1.09G|inline int RegEx::Match(const Source& source) const {
   73|  1.09G|  return IsValidSource(source) ? MatchUnchecked(source) : -1;
  ------------------
  |  Branch (73:10): [True: 1.09G, False: 0]
  ------------------
   74|  1.09G|}
_ZNK4YAML5RegEx13IsValidSourceINS_16StreamCharSourceEEEbRKT_:
   55|  1.09G|inline bool RegEx::IsValidSource(const Source& source) const {
   56|  1.09G|  return source;
   57|  1.09G|}
_ZNK4YAML5RegEx14MatchUncheckedINS_16StreamCharSourceEEEiRKT_:
   77|  3.53G|inline int RegEx::MatchUnchecked(const Source& source) const {
   78|  3.53G|  switch (m_op) {
  ------------------
  |  Branch (78:11): [True: 3.53G, False: 0]
  ------------------
   79|  13.9M|    case REGEX_EMPTY:
  ------------------
  |  Branch (79:5): [True: 13.9M, False: 3.51G]
  ------------------
   80|  13.9M|      return MatchOpEmpty(source);
   81|  1.79G|    case REGEX_MATCH:
  ------------------
  |  Branch (81:5): [True: 1.79G, False: 1.73G]
  ------------------
   82|  1.79G|      return MatchOpMatch(source);
   83|  23.3M|    case REGEX_RANGE:
  ------------------
  |  Branch (83:5): [True: 23.3M, False: 3.50G]
  ------------------
   84|  23.3M|      return MatchOpRange(source);
   85|  1.15G|    case REGEX_OR:
  ------------------
  |  Branch (85:5): [True: 1.15G, False: 2.37G]
  ------------------
   86|  1.15G|      return MatchOpOr(source);
   87|  17.8M|    case REGEX_AND:
  ------------------
  |  Branch (87:5): [True: 17.8M, False: 3.51G]
  ------------------
   88|  17.8M|      return MatchOpAnd(source);
   89|  29.1M|    case REGEX_NOT:
  ------------------
  |  Branch (89:5): [True: 29.1M, False: 3.50G]
  ------------------
   90|  29.1M|      return MatchOpNot(source);
   91|   496M|    case REGEX_SEQ:
  ------------------
  |  Branch (91:5): [True: 496M, False: 3.03G]
  ------------------
   92|   496M|      return MatchOpSeq(source);
   93|  3.53G|  }
   94|       |
   95|      0|  return -1;
   96|  3.53G|}
_ZNK4YAML5RegEx12MatchOpEmptyINS_16StreamCharSourceEEEiRKT_:
  106|  13.9M|inline int RegEx::MatchOpEmpty(const Source& source) const {
  107|  13.9M|  return source[0] == Stream::eof() ? 0 : -1;
  ------------------
  |  Branch (107:10): [True: 1.54M, False: 12.4M]
  ------------------
  108|  13.9M|}
_ZNK4YAML5RegEx12MatchOpMatchINS_16StreamCharSourceEEEiRKT_:
  119|  1.79G|inline int RegEx::MatchOpMatch(const Source& source) const {
  120|  1.79G|  if (source[0] != m_a)
  ------------------
  |  Branch (120:7): [True: 1.65G, False: 138M]
  ------------------
  121|  1.65G|    return -1;
  122|   138M|  return 1;
  123|  1.79G|}
_ZNK4YAML5RegEx12MatchOpRangeINS_16StreamCharSourceEEEiRKT_:
  127|  23.3M|inline int RegEx::MatchOpRange(const Source& source) const {
  128|  23.3M|  if (m_a > source[0] || m_z < source[0])
  ------------------
  |  Branch (128:7): [True: 18.1M, False: 5.22M]
  |  Branch (128:26): [True: 58.6k, False: 5.17M]
  ------------------
  129|  18.2M|    return -1;
  130|  5.17M|  return 1;
  131|  23.3M|}
_ZNK4YAML5RegEx9MatchOpOrINS_16StreamCharSourceEEEiRKT_:
  135|  1.15G|inline int RegEx::MatchOpOr(const Source& source) const {
  136|  2.38G|  for (const RegEx& param : m_params) {
  ------------------
  |  Branch (136:27): [True: 2.38G, False: 991M]
  ------------------
  137|  2.38G|    int n = param.MatchUnchecked(source);
  138|  2.38G|    if (n >= 0)
  ------------------
  |  Branch (138:9): [True: 164M, False: 2.22G]
  ------------------
  139|   164M|      return n;
  140|  2.38G|  }
  141|   991M|  return -1;
  142|  1.15G|}
_ZNK4YAML5RegEx10MatchOpAndINS_16StreamCharSourceEEEiRKT_:
  149|  17.8M|inline int RegEx::MatchOpAnd(const Source& source) const {
  150|  17.8M|  int first = -1;
  151|  17.8M|  for (std::size_t i = 0; i < m_params.size(); i++) {
  ------------------
  |  Branch (151:27): [True: 17.8M, False: 3.33k]
  ------------------
  152|  17.8M|    int n = m_params[i].MatchUnchecked(source);
  153|  17.8M|    if (n == -1)
  ------------------
  |  Branch (153:9): [True: 17.8M, False: 7.38k]
  ------------------
  154|  17.8M|      return -1;
  155|  7.38k|    if (i == 0)
  ------------------
  |  Branch (155:9): [True: 4.05k, False: 3.33k]
  ------------------
  156|  4.05k|      first = n;
  157|  7.38k|  }
  158|  3.33k|  return first;
  159|  17.8M|}
_ZNK4YAML5RegEx10MatchOpNotINS_16StreamCharSourceEEEiRKT_:
  163|  29.1M|inline int RegEx::MatchOpNot(const Source& source) const {
  164|  29.1M|  if (m_params.empty())
  ------------------
  |  Branch (164:7): [True: 0, False: 29.1M]
  ------------------
  165|      0|    return -1;
  166|  29.1M|  if (m_params[0].MatchUnchecked(source) >= 0)
  ------------------
  |  Branch (166:7): [True: 9.86k, False: 29.1M]
  ------------------
  167|  9.86k|    return -1;
  168|  29.1M|  return 1;
  169|  29.1M|}
_ZNK4YAML5RegEx10MatchOpSeqINS_16StreamCharSourceEEEiRKT_:
  173|   496M|inline int RegEx::MatchOpSeq(const Source& source) const {
  174|   496M|  int offset = 0;
  175|   568M|  for (const RegEx& param : m_params) {
  ------------------
  |  Branch (175:27): [True: 568M, False: 9.56M]
  ------------------
  176|   568M|    int n = param.Match(source + offset);  // note Match, not
  177|       |                                           // MatchUnchecked because we
  178|       |                                           // need to check validity after
  179|       |                                           // the offset
  180|   568M|    if (n == -1)
  ------------------
  |  Branch (180:9): [True: 487M, False: 81.3M]
  ------------------
  181|   487M|      return -1;
  182|  81.3M|    offset += n;
  183|  81.3M|  }
  184|       |
  185|  9.56M|  return offset;
  186|   496M|}
_ZNK4YAML5RegEx7MatchesEc:
   16|    468|inline bool RegEx::Matches(char ch) const {
   17|    468|  std::string str;
   18|    468|  str += ch;
   19|    468|  return Matches(str);
   20|    468|}
_ZNK4YAML5RegEx7MatchesERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
   22|    468|inline bool RegEx::Matches(const std::string& str) const {
   23|    468|  return Match(str) >= 0;
   24|    468|}
_ZNK4YAML5RegEx5MatchERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
   44|    468|inline int RegEx::Match(const std::string& str) const {
   45|    468|  StringCharSource source(str.c_str(), str.size());
   46|    468|  return Match(source);
   47|    468|}
_ZNK4YAML5RegEx13IsValidSourceINS_16StringCharSourceEEEbRKT_:
   61|    468|    const StringCharSource& source) const {
   62|    468|  switch (m_op) {
   63|      0|    case REGEX_MATCH:
  ------------------
  |  Branch (63:5): [True: 0, False: 468]
  ------------------
   64|    468|    case REGEX_RANGE:
  ------------------
  |  Branch (64:5): [True: 468, False: 0]
  ------------------
   65|    468|      return source;
   66|      0|    default:
  ------------------
  |  Branch (66:5): [True: 0, False: 468]
  ------------------
   67|      0|      return true;
   68|    468|  }
   69|    468|}
_ZNK4YAML5RegEx5MatchINS_16StringCharSourceEEEiRKT_:
   72|    468|inline int RegEx::Match(const Source& source) const {
   73|    468|  return IsValidSource(source) ? MatchUnchecked(source) : -1;
  ------------------
  |  Branch (73:10): [True: 468, False: 0]
  ------------------
   74|    468|}
_ZNK4YAML5RegEx14MatchUncheckedINS_16StringCharSourceEEEiRKT_:
   77|    468|inline int RegEx::MatchUnchecked(const Source& source) const {
   78|    468|  switch (m_op) {
  ------------------
  |  Branch (78:11): [True: 468, False: 0]
  ------------------
   79|      0|    case REGEX_EMPTY:
  ------------------
  |  Branch (79:5): [True: 0, False: 468]
  ------------------
   80|      0|      return MatchOpEmpty(source);
   81|      0|    case REGEX_MATCH:
  ------------------
  |  Branch (81:5): [True: 0, False: 468]
  ------------------
   82|      0|      return MatchOpMatch(source);
   83|    468|    case REGEX_RANGE:
  ------------------
  |  Branch (83:5): [True: 468, False: 0]
  ------------------
   84|    468|      return MatchOpRange(source);
   85|      0|    case REGEX_OR:
  ------------------
  |  Branch (85:5): [True: 0, False: 468]
  ------------------
   86|      0|      return MatchOpOr(source);
   87|      0|    case REGEX_AND:
  ------------------
  |  Branch (87:5): [True: 0, False: 468]
  ------------------
   88|      0|      return MatchOpAnd(source);
   89|      0|    case REGEX_NOT:
  ------------------
  |  Branch (89:5): [True: 0, False: 468]
  ------------------
   90|      0|      return MatchOpNot(source);
   91|      0|    case REGEX_SEQ:
  ------------------
  |  Branch (91:5): [True: 0, False: 468]
  ------------------
   92|      0|      return MatchOpSeq(source);
   93|    468|  }
   94|       |
   95|      0|  return -1;
   96|    468|}
_ZNK4YAML5RegEx12MatchOpRangeINS_16StringCharSourceEEEiRKT_:
  127|    468|inline int RegEx::MatchOpRange(const Source& source) const {
  128|    468|  if (m_a > source[0] || m_z < source[0])
  ------------------
  |  Branch (128:7): [True: 0, False: 468]
  |  Branch (128:26): [True: 0, False: 468]
  ------------------
  129|      0|    return -1;
  130|    468|  return 1;
  131|    468|}

_ZN4YAML7ScannerC2ERNSt3__113basic_istreamIcNS1_11char_traitsIcEEEE:
   24|  6.72k|    : INPUT(in),
   25|  6.72k|      m_tokens{},
   26|  6.72k|      m_startedStream(false),
   27|  6.72k|      m_endedStream(false),
   28|  6.72k|      m_simpleKeyAllowed(false),
   29|  6.72k|      m_scalarValueAllowed(false),
   30|  6.72k|      m_canBeJSONFlow(false),
   31|  6.72k|      m_simpleKeys{},
   32|  6.72k|      m_indents{},
   33|  6.72k|      m_indentRefs{},
   34|  6.72k|      m_flows{} {}
_ZN4YAML7ScannerD2Ev:
   36|  6.72k|Scanner::~Scanner() = default;
_ZN4YAML7Scanner5emptyEv:
   38|  12.1M|bool Scanner::empty() {
   39|  12.1M|  EnsureTokensInQueue();
   40|  12.1M|  return m_tokens.empty();
   41|  12.1M|}
_ZN4YAML7Scanner3popEv:
   43|  2.74M|void Scanner::pop() {
   44|  2.74M|  EnsureTokensInQueue();
   45|  2.74M|  if (!m_tokens.empty())
  ------------------
  |  Branch (45:7): [True: 2.74M, False: 0]
  ------------------
   46|  2.74M|    m_tokens.pop();
   47|  2.74M|}
_ZN4YAML7Scanner4peekEv:
   49|  17.3M|Token& Scanner::peek() {
   50|  17.3M|  EnsureTokensInQueue();
   51|  17.3M|  assert(!m_tokens.empty());  // should we be asserting here? I mean, we really
   52|       |                              // just be checking
   53|       |                              // if it's empty before peeking.
   54|       |
   55|       |#if 0
   56|       |		static Token *pLast = 0;
   57|       |		if(pLast != &m_tokens.front())
   58|       |			std::cerr << "peek: " << m_tokens.front() << "\n";
   59|       |		pLast = &m_tokens.front();
   60|       |#endif
   61|       |
   62|  17.3M|  return m_tokens.front();
   63|  17.3M|}
_ZNK4YAML7Scanner4markEv:
   65|  1.90M|Mark Scanner::mark() const { return INPUT.mark(); }
_ZN4YAML7Scanner19EnsureTokensInQueueEv:
   67|  32.1M|void Scanner::EnsureTokensInQueue() {
   68|  90.9M|  while (true) {
  ------------------
  |  Branch (68:10): [True: 90.9M, Folded]
  ------------------
   69|  90.9M|    if (!m_tokens.empty()) {
  ------------------
  |  Branch (69:9): [True: 90.1M, False: 766k]
  ------------------
   70|  90.1M|      Token& token = m_tokens.front();
   71|       |
   72|       |      // if this guy's valid, then we're done
   73|  90.1M|      if (token.status == Token::VALID) {
  ------------------
  |  Branch (73:11): [True: 31.5M, False: 58.6M]
  ------------------
   74|  31.5M|        return;
   75|  31.5M|      }
   76|       |
   77|       |      // here's where we clean up the impossible tokens
   78|  58.6M|      if (token.status == Token::INVALID) {
  ------------------
  |  Branch (78:11): [True: 39.8k, False: 58.6M]
  ------------------
   79|  39.8k|        m_tokens.pop();
   80|  39.8k|        continue;
   81|  39.8k|      }
   82|       |
   83|       |      // note: what's left are the unverified tokens
   84|  58.6M|    }
   85|       |
   86|       |    // no token? maybe we've actually finished
   87|  59.3M|    if (m_endedStream) {
  ------------------
  |  Branch (87:9): [True: 658k, False: 58.7M]
  ------------------
   88|   658k|      return;
   89|   658k|    }
   90|       |
   91|       |    // no? then scan...
   92|  58.7M|    ScanNextToken();
   93|  58.7M|  }
   94|  32.1M|}
_ZN4YAML7Scanner13ScanNextTokenEv:
   96|  58.7M|void Scanner::ScanNextToken() {
   97|  58.7M|  if (m_endedStream) {
  ------------------
  |  Branch (97:7): [True: 0, False: 58.7M]
  ------------------
   98|      0|    return;
   99|      0|  }
  100|       |
  101|  58.7M|  if (!m_startedStream) {
  ------------------
  |  Branch (101:7): [True: 6.72k, False: 58.7M]
  ------------------
  102|  6.72k|    return StartStream();
  103|  6.72k|  }
  104|       |
  105|       |  // get rid of whitespace, etc. (in between tokens it should be irrelevant)
  106|  58.7M|  ScanToNextToken();
  107|       |
  108|       |  // maybe need to end some blocks
  109|  58.7M|  PopIndentToHere();
  110|       |
  111|       |  // *****
  112|       |  // And now branch based on the next few characters!
  113|       |  // *****
  114|       |
  115|       |  // end of stream
  116|  58.7M|  if (!INPUT) {
  ------------------
  |  Branch (116:7): [True: 5.61k, False: 58.7M]
  ------------------
  117|  5.61k|    return EndStream();
  118|  5.61k|  }
  119|       |
  120|  58.7M|  if (INPUT.column() == 0 && INPUT.peek() == Keys::Directive) {
  ------------------
  |  Branch (120:7): [True: 2.38M, False: 56.3M]
  |  Branch (120:30): [True: 11.2k, False: 2.37M]
  ------------------
  121|  11.2k|    return ScanDirective();
  122|  11.2k|  }
  123|       |
  124|       |  // document token
  125|  58.6M|  if (INPUT.column() == 0 && Exp::DocStart().Matches(INPUT)) {
  ------------------
  |  Branch (125:7): [True: 2.37M, False: 56.3M]
  |  Branch (125:30): [True: 244k, False: 2.13M]
  ------------------
  126|   244k|    return ScanDocStart();
  127|   244k|  }
  128|       |
  129|  58.4M|  if (INPUT.column() == 0 && Exp::DocEnd().Matches(INPUT)) {
  ------------------
  |  Branch (129:7): [True: 2.13M, False: 56.3M]
  |  Branch (129:30): [True: 285k, False: 1.84M]
  ------------------
  130|   285k|    return ScanDocEnd();
  131|   285k|  }
  132|       |
  133|       |  // flow start/end/entry
  134|  58.1M|  if (INPUT.peek() == Keys::FlowSeqStart ||
  ------------------
  |  Branch (134:7): [True: 28.8M, False: 29.2M]
  ------------------
  135|  44.3M|      INPUT.peek() == Keys::FlowMapStart) {
  ------------------
  |  Branch (135:7): [True: 15.4M, False: 13.8M]
  ------------------
  136|  44.3M|    return ScanFlowStart();
  137|  44.3M|  }
  138|       |
  139|  13.8M|  if (INPUT.peek() == Keys::FlowSeqEnd || INPUT.peek() == Keys::FlowMapEnd) {
  ------------------
  |  Branch (139:7): [True: 28.6k, False: 13.7M]
  |  Branch (139:43): [True: 1.06M, False: 12.7M]
  ------------------
  140|  1.09M|    return ScanFlowEnd();
  141|  1.09M|  }
  142|       |
  143|  12.7M|  if (INPUT.peek() == Keys::FlowEntry) {
  ------------------
  |  Branch (143:7): [True: 2.36M, False: 10.3M]
  ------------------
  144|       |    // values starting with `,` are not allowed.
  145|       |    // eg: reject `,foo`
  146|  2.36M|    if (INPUT.column() == 0) {
  ------------------
  |  Branch (146:9): [True: 6, False: 2.36M]
  ------------------
  147|      6|      throw ParserException(INPUT.mark(), ErrorMsg::UNEXPECTED_FLOW);
  148|      6|    }
  149|       |    // if we already parsed a quoted scalar value and we are not in a flow,
  150|       |    // then `,` is not a valid character.
  151|       |    // eg: reject `"foo",`
  152|  2.36M|    if (!m_scalarValueAllowed) {
  ------------------
  |  Branch (152:9): [True: 1, False: 2.36M]
  ------------------
  153|      1|      throw ParserException(INPUT.mark(), ErrorMsg::UNEXPECTED_SCALAR);
  154|      1|    }
  155|  2.36M|    return ScanFlowEntry();
  156|  2.36M|  }
  157|       |
  158|       |  // block/map stuff
  159|  10.3M|  if (Exp::BlockEntry().Matches(INPUT)) {
  ------------------
  |  Branch (159:7): [True: 1.02M, False: 9.34M]
  ------------------
  160|  1.02M|    return ScanBlockEntry();
  161|  1.02M|  }
  162|       |
  163|  9.34M|  if ((InBlockContext() ? Exp::Key() : Exp::KeyInFlow()).Matches(INPUT)) {
  ------------------
  |  Branch (163:7): [True: 22.1k, False: 9.32M]
  |  Branch (163:8): [True: 8.35M, False: 986k]
  ------------------
  164|  22.1k|    return ScanKey();
  165|  22.1k|  }
  166|       |
  167|  9.32M|  if (GetValueRegex().Matches(INPUT)) {
  ------------------
  |  Branch (167:7): [True: 6.37M, False: 2.94M]
  ------------------
  168|  6.37M|    return ScanValue();
  169|  6.37M|  }
  170|       |
  171|       |  // alias/anchor
  172|  2.94M|  if (INPUT.peek() == Keys::Alias || INPUT.peek() == Keys::Anchor) {
  ------------------
  |  Branch (172:7): [True: 1.52k, False: 2.94M]
  |  Branch (172:38): [True: 8.29k, False: 2.93M]
  ------------------
  173|  9.81k|    return ScanAnchorOrAlias();
  174|  9.81k|  }
  175|       |
  176|       |  // tag
  177|  2.93M|  if (INPUT.peek() == Keys::Tag) {
  ------------------
  |  Branch (177:7): [True: 908k, False: 2.02M]
  ------------------
  178|   908k|    return ScanTag();
  179|   908k|  }
  180|       |
  181|       |  // special scalars
  182|  2.02M|  if (InBlockContext() && (INPUT.peek() == Keys::LiteralScalar ||
  ------------------
  |  Branch (182:7): [True: 1.10M, False: 923k]
  |  Branch (182:28): [True: 677, False: 1.10M]
  ------------------
  183|  1.10M|                           INPUT.peek() == Keys::FoldedScalar)) {
  ------------------
  |  Branch (183:28): [True: 4.81k, False: 1.10M]
  ------------------
  184|       |    // if we begin parsing a literal scalar with an unverified potential
  185|       |    // simple key pushed, that may be a tag to the literal scalar, and
  186|       |    // should be removed to avoid wrong indentation limit
  187|       |    // eg:
  188|       |    // - !!str |
  189|       |    //  literal
  190|       |    //  scalar
  191|  5.49k|    if (!m_simpleKeys.empty() &&
  ------------------
  |  Branch (191:9): [True: 794, False: 4.69k]
  ------------------
  192|    794|      m_simpleKeys.top().pKey->status == Token::UNVERIFIED) {
  ------------------
  |  Branch (192:7): [True: 794, False: 0]
  ------------------
  193|       |      // if the top of the indents does not match the unverified simple key,
  194|       |      // just invalidate the simple key and do not pop indent to avoid crash.
  195|       |      // eg: an unverified key crossing lines, like issue #1475.
  196|    794|      if (m_simpleKeys.top().pIndent && !m_indents.empty() &&
  ------------------
  |  Branch (196:11): [True: 575, False: 219]
  |  Branch (196:41): [True: 575, False: 0]
  ------------------
  197|    575|          m_indents.top() == m_simpleKeys.top().pIndent) {
  ------------------
  |  Branch (197:11): [True: 381, False: 194]
  ------------------
  198|    381|        PopIndent();
  199|    413|      } else {
  200|    413|        InvalidateSimpleKey();
  201|    413|      }
  202|    794|    }
  203|  5.49k|    return ScanBlockScalar();
  204|  5.49k|  }
  205|       |
  206|       |  // if we already parsed a quoted scalar value in this line,
  207|       |  // another scalar value is an error.
  208|       |  // eg: reject `"foo" "bar"`
  209|  2.02M|  if (!m_scalarValueAllowed) {
  ------------------
  |  Branch (209:7): [True: 32, False: 2.02M]
  ------------------
  210|     32|    throw ParserException(INPUT.mark(), ErrorMsg::UNEXPECTED_SCALAR);
  211|     32|  }
  212|       |
  213|  2.02M|  if (INPUT.peek() == '\'' || INPUT.peek() == '\"') {
  ------------------
  |  Branch (213:7): [True: 1.80k, False: 2.02M]
  |  Branch (213:31): [True: 6.80k, False: 2.01M]
  ------------------
  214|  8.61k|    return ScanQuotedScalar();
  215|  8.61k|  }
  216|       |
  217|       |  // plain scalars
  218|  2.01M|  if ((InBlockContext() ? Exp::PlainScalar() : Exp::PlainScalarInFlow())
  ------------------
  |  Branch (218:7): [True: 2.01M, False: 44]
  |  Branch (218:8): [True: 1.09M, False: 916k]
  ------------------
  219|  2.01M|          .Matches(INPUT)) {
  220|  2.01M|    return ScanPlainScalar();
  221|  2.01M|  }
  222|       |
  223|       |  // don't know what it is!
  224|     44|  throw ParserException(INPUT.mark(), ErrorMsg::UNKNOWN_TOKEN);
  225|  2.01M|}
_ZN4YAML7Scanner15ScanToNextTokenEv:
  227|  58.7M|void Scanner::ScanToNextToken() {
  228|  66.4M|  while (true) {
  ------------------
  |  Branch (228:10): [True: 66.4M, Folded]
  ------------------
  229|       |    // first eat whitespace
  230|  66.5M|    while (INPUT && IsWhitespaceToBeEaten(INPUT.peek())) {
  ------------------
  |  Branch (230:12): [True: 66.5M, False: 5.53k]
  |  Branch (230:21): [True: 116k, False: 66.4M]
  ------------------
  231|   116k|      if (InBlockContext() && Exp::Tab().Matches(INPUT)) {
  ------------------
  |  Branch (231:11): [True: 80.8k, False: 35.7k]
  |  Branch (231:31): [True: 1.53k, False: 79.3k]
  ------------------
  232|  1.53k|        m_simpleKeyAllowed = false;
  233|  1.53k|      }
  234|   116k|      INPUT.eat(1);
  235|   116k|    }
  236|       |
  237|       |    // then eat a comment
  238|  66.4M|    if (Exp::Comment().Matches(INPUT)) {
  ------------------
  |  Branch (238:9): [True: 1.74k, False: 66.4M]
  ------------------
  239|       |      // eat until line break
  240|  6.94M|      while (INPUT && !Exp::Break().Matches(INPUT)) {
  ------------------
  |  Branch (240:14): [True: 6.94M, False: 79]
  |  Branch (240:23): [True: 6.93M, False: 1.66k]
  ------------------
  241|  6.93M|        INPUT.eat(1);
  242|  6.93M|      }
  243|  1.74k|    }
  244|       |
  245|       |    // if it's NOT a line break, then we're done!
  246|  66.4M|    if (!Exp::Break().Matches(INPUT)) {
  ------------------
  |  Branch (246:9): [True: 58.7M, False: 7.75M]
  ------------------
  247|  58.7M|      break;
  248|  58.7M|    }
  249|       |
  250|       |    // otherwise, let's eat the line break and keep going
  251|  7.75M|    int n = Exp::Break().Match(INPUT);
  252|  7.75M|    INPUT.eat(n);
  253|       |
  254|       |    // oh yeah, and let's get rid of that simple key
  255|  7.75M|    InvalidateSimpleKey();
  256|       |
  257|       |    // new line - we accept a scalar value now
  258|  7.75M|    m_scalarValueAllowed = true;
  259|       |
  260|       |    // new line - we may be able to accept a simple key now
  261|  7.75M|    if (InBlockContext()) {
  ------------------
  |  Branch (261:9): [True: 7.72M, False: 32.4k]
  ------------------
  262|  7.72M|      m_simpleKeyAllowed = true;
  263|  7.72M|    }
  264|  7.75M|  }
  265|  58.7M|}
_ZNK4YAML7Scanner13GetValueRegexEv:
  270|  9.32M|const RegEx& Scanner::GetValueRegex() const {
  271|  9.32M|  if (InBlockContext()) {
  ------------------
  |  Branch (271:7): [True: 8.35M, False: 969k]
  ------------------
  272|  8.35M|    return Exp::Value();
  273|  8.35M|  }
  274|       |
  275|   969k|  return m_canBeJSONFlow ? Exp::ValueInJSONFlow() : Exp::ValueInFlow();
  ------------------
  |  Branch (275:10): [True: 10.4k, False: 958k]
  ------------------
  276|  9.32M|}
_ZN4YAML7Scanner11StartStreamEv:
  278|  6.72k|void Scanner::StartStream() {
  279|  6.72k|  m_startedStream = true;
  280|  6.72k|  m_simpleKeyAllowed = true;
  281|  6.72k|  m_scalarValueAllowed = true;
  282|  6.72k|  std::unique_ptr<IndentMarker> pIndent(
  283|  6.72k|      new IndentMarker(-1, IndentMarker::NONE));
  284|  6.72k|  m_indentRefs.push_back(std::move(pIndent));
  285|  6.72k|  m_indents.push(&m_indentRefs.back());
  286|  6.72k|}
_ZN4YAML7Scanner9EndStreamEv:
  288|  5.61k|void Scanner::EndStream() {
  289|       |  // force newline
  290|  5.61k|  if (INPUT.column() > 0) {
  ------------------
  |  Branch (290:7): [True: 5.16k, False: 455]
  ------------------
  291|  5.16k|    INPUT.ResetColumn();
  292|  5.16k|  }
  293|       |
  294|  5.61k|  PopAllIndents();
  295|  5.61k|  PopAllSimpleKeys();
  296|       |
  297|  5.61k|  m_simpleKeyAllowed = false;
  298|  5.61k|  m_scalarValueAllowed = false;
  299|  5.61k|  m_endedStream = true;
  300|  5.61k|}
_ZN4YAML7Scanner9PushTokenENS_5Token4TYPEE:
  302|  8.89M|Token* Scanner::PushToken(Token::TYPE type) {
  303|  8.89M|  m_tokens.push(Token(type, INPUT.mark()));
  304|  8.89M|  return &m_tokens.back();
  305|  8.89M|}
_ZN4YAML7Scanner16GetStartTokenForENS0_12IndentMarker11INDENT_TYPEE:
  307|  8.89M|Token::TYPE Scanner::GetStartTokenFor(IndentMarker::INDENT_TYPE type) {
  308|  8.89M|  switch (type) {
  ------------------
  |  Branch (308:11): [True: 8.89M, False: 0]
  ------------------
  309|  1.02M|    case IndentMarker::SEQ:
  ------------------
  |  Branch (309:5): [True: 1.02M, False: 7.87M]
  ------------------
  310|  1.02M|      return Token::BLOCK_SEQ_START;
  311|  7.87M|    case IndentMarker::MAP:
  ------------------
  |  Branch (311:5): [True: 7.87M, False: 1.02M]
  ------------------
  312|  7.87M|      return Token::BLOCK_MAP_START;
  313|      0|    case IndentMarker::NONE:
  ------------------
  |  Branch (313:5): [True: 0, False: 8.89M]
  ------------------
  314|      0|      assert(false);
  315|      0|      break;
  316|  8.89M|  }
  317|  8.89M|  assert(false);
  318|      0|  throw std::runtime_error("yaml-cpp: internal error, invalid indent type");
  319|  8.89M|}
_ZN4YAML7Scanner12PushIndentToEiNS0_12IndentMarker11INDENT_TYPEE:
  322|  9.11M|                                             IndentMarker::INDENT_TYPE type) {
  323|       |  // are we in flow?
  324|  9.11M|  if (InFlowContext()) {
  ------------------
  |  Branch (324:7): [True: 0, False: 9.11M]
  ------------------
  325|      0|    return nullptr;
  326|      0|  }
  327|       |
  328|  9.11M|  std::unique_ptr<IndentMarker> pIndent(new IndentMarker(column, type));
  329|  9.11M|  IndentMarker& indent = *pIndent;
  330|  9.11M|  const IndentMarker& lastIndent = *m_indents.top();
  331|       |
  332|       |  // is this actually an indentation?
  333|  9.11M|  if (indent.column < lastIndent.column) {
  ------------------
  |  Branch (333:7): [True: 0, False: 9.11M]
  ------------------
  334|      0|    return nullptr;
  335|      0|  }
  336|  9.11M|  if (indent.column == lastIndent.column &&
  ------------------
  |  Branch (336:7): [True: 305k, False: 8.80M]
  ------------------
  337|   305k|      !(indent.type == IndentMarker::SEQ &&
  ------------------
  |  Branch (337:9): [True: 87.2k, False: 217k]
  ------------------
  338|   221k|        lastIndent.type == IndentMarker::MAP)) {
  ------------------
  |  Branch (338:9): [True: 83.2k, False: 4.05k]
  ------------------
  339|   221k|    return nullptr;
  340|   221k|  }
  341|       |
  342|       |  // push a start token
  343|  8.89M|  indent.pStartToken = PushToken(GetStartTokenFor(type));
  344|       |
  345|       |  // and then the indent
  346|  8.89M|  m_indents.push(&indent);
  347|  8.89M|  m_indentRefs.push_back(std::move(pIndent));
  348|  8.89M|  return &m_indentRefs.back();
  349|  9.11M|}
_ZN4YAML7Scanner15PopIndentToHereEv:
  351|  58.7M|void Scanner::PopIndentToHere() {
  352|       |  // are we in flow?
  353|  58.7M|  if (InFlowContext()) {
  ------------------
  |  Branch (353:7): [True: 48.8M, False: 9.89M]
  ------------------
  354|  48.8M|    return;
  355|  48.8M|  }
  356|       |
  357|       |  // now pop away
  358|  12.1M|  while (!m_indents.empty()) {
  ------------------
  |  Branch (358:10): [True: 12.1M, False: 0]
  ------------------
  359|  12.1M|    const IndentMarker& indent = *m_indents.top();
  360|  12.1M|    if (indent.column < INPUT.column()) {
  ------------------
  |  Branch (360:9): [True: 8.81M, False: 3.36M]
  ------------------
  361|  8.81M|      break;
  362|  8.81M|    }
  363|  3.36M|    if (indent.column == INPUT.column() &&
  ------------------
  |  Branch (363:9): [True: 1.91M, False: 1.44M]
  ------------------
  364|  1.91M|        !(indent.type == IndentMarker::SEQ &&
  ------------------
  |  Branch (364:11): [True: 830k, False: 1.08M]
  ------------------
  365|  1.08M|          !Exp::BlockEntry().Matches(INPUT))) {
  ------------------
  |  Branch (365:11): [True: 826k, False: 4.05k]
  ------------------
  366|  1.08M|      break;
  367|  1.08M|    }
  368|       |
  369|  2.27M|    PopIndent();
  370|  2.27M|  }
  371|       |
  372|  10.7M|  while (!m_indents.empty() &&
  ------------------
  |  Branch (372:10): [True: 10.7M, False: 0]
  ------------------
  373|  10.7M|         m_indents.top()->status == IndentMarker::INVALID) {
  ------------------
  |  Branch (373:10): [True: 806k, False: 9.89M]
  ------------------
  374|   806k|    PopIndent();
  375|   806k|  }
  376|  9.89M|}
_ZN4YAML7Scanner13PopAllIndentsEv:
  378|   547k|void Scanner::PopAllIndents() {
  379|       |  // are we in flow?
  380|   547k|  if (InFlowContext()) {
  ------------------
  |  Branch (380:7): [True: 35.7k, False: 511k]
  ------------------
  381|  35.7k|    return;
  382|  35.7k|  }
  383|       |
  384|       |  // now pop away
  385|  3.38M|  while (!m_indents.empty()) {
  ------------------
  |  Branch (385:10): [True: 3.38M, False: 0]
  ------------------
  386|  3.38M|    const IndentMarker& indent = *m_indents.top();
  387|  3.38M|    if (indent.type == IndentMarker::NONE) {
  ------------------
  |  Branch (387:9): [True: 511k, False: 2.87M]
  ------------------
  388|   511k|      break;
  389|   511k|    }
  390|       |
  391|  2.87M|    PopIndent();
  392|  2.87M|  }
  393|   511k|}
_ZN4YAML7Scanner9PopIndentEv:
  395|  5.95M|void Scanner::PopIndent() {
  396|  5.95M|  if (m_indents.empty()) {
  ------------------
  |  Branch (396:7): [True: 0, False: 5.95M]
  ------------------
  397|      0|    ThrowParserException(ErrorMsg::INDENT_STACK_UNDERFLOW);
  398|      0|  }
  399|  5.95M|  const IndentMarker& indent = *m_indents.top();
  400|  5.95M|  m_indents.pop();
  401|       |
  402|  5.95M|  if (indent.status != IndentMarker::VALID) {
  ------------------
  |  Branch (402:7): [True: 1.63M, False: 4.31M]
  ------------------
  403|  1.63M|    InvalidateSimpleKey();
  404|  1.63M|    return;
  405|  1.63M|  }
  406|       |
  407|  4.31M|  if (indent.type == IndentMarker::SEQ) {
  ------------------
  |  Branch (407:7): [True: 966k, False: 3.35M]
  ------------------
  408|   966k|    m_tokens.push(Token(Token::BLOCK_SEQ_END, INPUT.mark()));
  409|  3.35M|  } else if (indent.type == IndentMarker::MAP) {
  ------------------
  |  Branch (409:14): [True: 3.35M, False: 0]
  ------------------
  410|  3.35M|    m_tokens.push(Token(Token::BLOCK_MAP_END, INPUT.mark()));
  411|  3.35M|  }
  412|  4.31M|}
_ZNK4YAML7Scanner12GetTopIndentEv:
  414|  1.10M|int Scanner::GetTopIndent() const {
  415|  1.10M|  if (m_indents.empty()) {
  ------------------
  |  Branch (415:7): [True: 0, False: 1.10M]
  ------------------
  416|      0|    return 0;
  417|      0|  }
  418|  1.10M|  return m_indents.top()->column;
  419|  1.10M|}
scanner.cpp:_ZN4YAML12_GLOBAL__N_121IsWhitespaceToBeEatenEc:
   20|  66.5M|bool IsWhitespaceToBeEaten(char ch) { return (ch == ' ') || (ch == '\t'); }
  ------------------
  |  Branch (20:46): [True: 88.6k, False: 66.4M]
  |  Branch (20:61): [True: 28.0k, False: 66.4M]
  ------------------

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

_ZN4YAML10ScanScalarERNS_6StreamERNS_16ScanScalarParamsE:
   21|  2.02M|std::string ScanScalar(Stream& INPUT, ScanScalarParams& params) {
   22|  2.02M|  bool foundNonEmptyLine = false;
   23|  2.02M|  bool pastOpeningBreak = (params.fold == FOLD_FLOW);
   24|  2.02M|  bool emptyLine = false, moreIndented = false;
   25|  2.02M|  int foldedNewlineCount = 0;
   26|  2.02M|  bool foldedNewlineStartedMoreIndented = false;
   27|  2.02M|  std::size_t lastEscapedChar = std::string::npos;
   28|  2.02M|  std::string scalar;
   29|  2.02M|  params.leadingSpaces = false;
   30|       |
   31|  2.02M|  if (!params.end) {
  ------------------
  |  Branch (31:7): [True: 5.45k, False: 2.02M]
  ------------------
   32|  5.45k|    params.end = &Exp::Empty();
   33|  5.45k|  }
   34|       |
   35|  13.7M|  while (INPUT) {
  ------------------
  |  Branch (35:10): [True: 13.7M, False: 930]
  ------------------
   36|       |    // ********************************
   37|       |    // Phase #1: scan until line ending
   38|       |
   39|  13.7M|    std::size_t lastNonWhitespaceChar = scalar.size();
   40|  13.7M|    bool escapedNewline = false;
   41|  90.9M|    while (!params.end->Matches(INPUT) && !Exp::Break().Matches(INPUT)) {
  ------------------
  |  Branch (41:12): [True: 90.0M, False: 946k]
  |  Branch (41:43): [True: 77.4M, False: 12.5M]
  ------------------
   42|  77.4M|      if (!INPUT) {
  ------------------
  |  Branch (42:11): [True: 1.86k, False: 77.4M]
  ------------------
   43|  1.86k|        break;
   44|  1.86k|      }
   45|       |
   46|       |      // document indicator?
   47|  77.4M|      if (INPUT.column() == 0 && Exp::DocIndicator().Matches(INPUT)) {
  ------------------
  |  Branch (47:11): [True: 583k, False: 76.8M]
  |  Branch (47:34): [True: 242k, False: 341k]
  ------------------
   48|   242k|        if (params.onDocIndicator == BREAK) {
  ------------------
  |  Branch (48:13): [True: 242k, False: 1]
  ------------------
   49|   242k|          break;
   50|   242k|        }
   51|      1|        if (params.onDocIndicator == THROW) {
  ------------------
  |  Branch (51:13): [True: 1, False: 0]
  ------------------
   52|      1|          throw ParserException(INPUT.mark(), ErrorMsg::DOC_IN_SCALAR);
   53|      1|        }
   54|      1|      }
   55|       |
   56|  77.1M|      foundNonEmptyLine = true;
   57|  77.1M|      pastOpeningBreak = true;
   58|       |
   59|       |      // escaped newline? (only if we're escaping on slash)
   60|  77.1M|      if (params.escape == '\\' && Exp::EscBreak().Matches(INPUT)) {
  ------------------
  |  Branch (60:11): [True: 12.9M, False: 64.1M]
  |  Branch (60:36): [True: 822, False: 12.9M]
  ------------------
   61|       |        // eat escape character and get out (but preserve trailing whitespace!)
   62|    822|        INPUT.get();
   63|    822|        lastNonWhitespaceChar = scalar.size();
   64|    822|        lastEscapedChar = scalar.size();
   65|    822|        escapedNewline = true;
   66|    822|        break;
   67|    822|      }
   68|       |
   69|       |      // escape this?
   70|  77.1M|      if (INPUT.peek() == params.escape) {
  ------------------
  |  Branch (70:11): [True: 40.6k, False: 77.1M]
  ------------------
   71|  40.6k|        scalar += Exp::Escape(INPUT);
   72|  40.6k|        lastNonWhitespaceChar = scalar.size();
   73|  40.6k|        lastEscapedChar = scalar.size();
   74|  40.6k|        continue;
   75|  40.6k|      }
   76|       |
   77|       |      // otherwise, just add the damn character
   78|  77.1M|      char ch = INPUT.get();
   79|  77.1M|      scalar += ch;
   80|  77.1M|      if (ch != ' ' && ch != '\t') {
  ------------------
  |  Branch (80:11): [True: 77.0M, False: 67.3k]
  |  Branch (80:24): [True: 75.4M, False: 1.61M]
  ------------------
   81|  75.4M|        lastNonWhitespaceChar = scalar.size();
   82|  75.4M|      }
   83|  77.1M|    }
   84|       |
   85|       |    // eof? if we're looking to eat something, then we throw
   86|  13.7M|    if (!INPUT) {
  ------------------
  |  Branch (86:9): [True: 1.93k, False: 13.7M]
  ------------------
   87|  1.93k|      if (params.eatEnd) {
  ------------------
  |  Branch (87:11): [True: 212, False: 1.72k]
  ------------------
   88|    212|        throw ParserException(INPUT.mark(), ErrorMsg::EOF_IN_SCALAR);
   89|    212|      }
   90|  1.72k|      break;
   91|  1.93k|    }
   92|       |
   93|       |    // doc indicator?
   94|  13.7M|    if (params.onDocIndicator == BREAK && INPUT.column() == 0 &&
  ------------------
  |  Branch (94:9): [True: 8.09M, False: 5.68M]
  |  Branch (94:43): [True: 4.09M, False: 4.00M]
  ------------------
   95|  4.09M|        Exp::DocIndicator().Matches(INPUT)) {
  ------------------
  |  Branch (95:9): [True: 242k, False: 3.85M]
  ------------------
   96|   242k|      break;
   97|   242k|    }
   98|       |
   99|       |    // are we done via character match?
  100|  13.5M|    int n = params.end->Match(INPUT);
  101|  13.5M|    if (n >= 0) {
  ------------------
  |  Branch (101:9): [True: 945k, False: 12.5M]
  ------------------
  102|   945k|      if (params.eatEnd) {
  ------------------
  |  Branch (102:11): [True: 8.19k, False: 937k]
  ------------------
  103|  8.19k|        INPUT.eat(n);
  104|  8.19k|      }
  105|   945k|      break;
  106|   945k|    }
  107|       |
  108|       |    // do we remove trailing whitespace?
  109|  12.5M|    if (params.fold == FOLD_FLOW)
  ------------------
  |  Branch (109:9): [True: 7.67M, False: 4.92M]
  ------------------
  110|  7.67M|      scalar.erase(lastNonWhitespaceChar);
  111|       |
  112|       |    // ********************************
  113|       |    // Phase #2: eat line ending
  114|  12.5M|    n = Exp::Break().Match(INPUT);
  115|  12.5M|    INPUT.eat(n);
  116|       |
  117|       |    // ********************************
  118|       |    // Phase #3: scan initial spaces
  119|       |
  120|       |    // first the required indentation
  121|  12.5M|    while (INPUT.peek() == ' ' &&
  ------------------
  |  Branch (121:12): [True: 12.0k, False: 12.5M]
  ------------------
  122|  12.0k|           (INPUT.column() < params.indent ||
  ------------------
  |  Branch (122:13): [True: 586, False: 11.4k]
  ------------------
  123|  11.4k|            (params.detectIndent && !foundNonEmptyLine)) &&
  ------------------
  |  Branch (123:14): [True: 6.80k, False: 4.65k]
  |  Branch (123:37): [True: 334, False: 6.46k]
  ------------------
  124|    920|           !params.end->Matches(INPUT)) {
  ------------------
  |  Branch (124:12): [True: 721, False: 199]
  ------------------
  125|    721|      INPUT.eat(1);
  126|    721|    }
  127|       |
  128|       |    // update indent if we're auto-detecting
  129|  12.5M|    if (params.detectIndent && !foundNonEmptyLine) {
  ------------------
  |  Branch (129:9): [True: 4.91M, False: 7.67M]
  |  Branch (129:32): [True: 3.23M, False: 1.68M]
  ------------------
  130|  3.23M|      params.indent = std::max(params.indent, INPUT.column());
  131|  3.23M|    }
  132|       |
  133|       |    // and then the rest of the whitespace
  134|  12.6M|    while (Exp::Blank().Matches(INPUT)) {
  ------------------
  |  Branch (134:12): [True: 15.7k, False: 12.5M]
  ------------------
  135|       |      // we check for tabs that masquerade as indentation
  136|  15.7k|      if (INPUT.peek() == '\t' && INPUT.column() < params.indent &&
  ------------------
  |  Branch (136:11): [True: 4.18k, False: 11.5k]
  |  Branch (136:35): [True: 3, False: 4.18k]
  ------------------
  137|      3|          params.onTabInIndentation == THROW) {
  ------------------
  |  Branch (137:11): [True: 3, False: 0]
  ------------------
  138|      3|        throw ParserException(INPUT.mark(), ErrorMsg::TAB_IN_INDENTATION);
  139|      3|      }
  140|       |
  141|  15.7k|      if (!params.eatLeadingWhitespace) {
  ------------------
  |  Branch (141:11): [True: 9.46k, False: 6.24k]
  ------------------
  142|  9.46k|        break;
  143|  9.46k|      }
  144|       |
  145|  6.24k|      if (params.end->Matches(INPUT)) {
  ------------------
  |  Branch (145:11): [True: 235, False: 6.01k]
  ------------------
  146|    235|        break;
  147|    235|      }
  148|       |
  149|  6.01k|      INPUT.eat(1);
  150|  6.01k|    }
  151|       |
  152|       |    // was this an empty line?
  153|  12.5M|    bool nextEmptyLine = Exp::Break().Matches(INPUT);
  154|  12.5M|    bool nextMoreIndented = Exp::Blank().Matches(INPUT);
  155|  12.5M|    if (params.fold == FOLD_BLOCK && foldedNewlineCount == 0 && nextEmptyLine)
  ------------------
  |  Branch (155:9): [True: 4.90M, False: 7.68M]
  |  Branch (155:38): [True: 579k, False: 4.33M]
  |  Branch (155:65): [True: 15.3k, False: 563k]
  ------------------
  156|  15.3k|      foldedNewlineStartedMoreIndented = moreIndented;
  157|       |
  158|       |    // for block scalars, we always start with a newline, so we should ignore it
  159|       |    // (not fold or keep)
  160|  12.5M|    if (pastOpeningBreak) {
  ------------------
  |  Branch (160:9): [True: 12.5M, False: 5.71k]
  ------------------
  161|  12.5M|      switch (params.fold) {
  ------------------
  |  Branch (161:15): [True: 12.5M, False: 0]
  ------------------
  162|  9.07k|        case DONT_FOLD:
  ------------------
  |  Branch (162:9): [True: 9.07k, False: 12.5M]
  ------------------
  163|  9.07k|          scalar += "\n";
  164|  9.07k|          break;
  165|  4.90M|        case FOLD_BLOCK:
  ------------------
  |  Branch (165:9): [True: 4.90M, False: 7.68M]
  ------------------
  166|  4.90M|          if (!emptyLine && !nextEmptyLine && !moreIndented &&
  ------------------
  |  Branch (166:15): [True: 573k, False: 4.33M]
  |  Branch (166:29): [True: 559k, False: 14.1k]
  |  Branch (166:47): [True: 552k, False: 7.26k]
  ------------------
  167|   552k|              !nextMoreIndented && INPUT.column() >= params.indent) {
  ------------------
  |  Branch (167:15): [True: 544k, False: 7.37k]
  |  Branch (167:36): [True: 544k, False: 392]
  ------------------
  168|   544k|            scalar += " ";
  169|  4.36M|          } else if (nextEmptyLine) {
  ------------------
  |  Branch (169:22): [True: 4.33M, False: 29.8k]
  ------------------
  170|  4.33M|            foldedNewlineCount++;
  171|  4.33M|          } else {
  172|  29.8k|            scalar += "\n";
  173|  29.8k|          }
  174|       |
  175|  4.90M|          if (!nextEmptyLine && foldedNewlineCount > 0) {
  ------------------
  |  Branch (175:15): [True: 574k, False: 4.33M]
  |  Branch (175:33): [True: 14.6k, False: 559k]
  ------------------
  176|  14.6k|            scalar += std::string(foldedNewlineCount - 1, '\n');
  177|  14.6k|            if (foldedNewlineStartedMoreIndented ||
  ------------------
  |  Branch (177:17): [True: 2.03k, False: 12.6k]
  ------------------
  178|  12.6k|                nextMoreIndented || !foundNonEmptyLine) {
  ------------------
  |  Branch (178:17): [True: 752, False: 11.8k]
  |  Branch (178:37): [True: 544, False: 11.3k]
  ------------------
  179|  3.33k|              scalar += "\n";
  180|  3.33k|            }
  181|  14.6k|            foldedNewlineCount = 0;
  182|  14.6k|          }
  183|  4.90M|          break;
  184|  7.67M|        case FOLD_FLOW:
  ------------------
  |  Branch (184:9): [True: 7.67M, False: 4.91M]
  ------------------
  185|  7.67M|          if (nextEmptyLine) {
  ------------------
  |  Branch (185:15): [True: 6.09M, False: 1.58M]
  ------------------
  186|  6.09M|            scalar += "\n";
  187|  6.09M|          } else if (!emptyLine && !escapedNewline) {
  ------------------
  |  Branch (187:22): [True: 1.57M, False: 13.8k]
  |  Branch (187:36): [True: 1.57M, False: 818]
  ------------------
  188|  1.57M|            scalar += " ";
  189|  1.57M|          }
  190|  7.67M|          break;
  191|  12.5M|      }
  192|  12.5M|    }
  193|       |
  194|  12.5M|    emptyLine = nextEmptyLine;
  195|  12.5M|    moreIndented = nextMoreIndented;
  196|  12.5M|    pastOpeningBreak = true;
  197|       |
  198|       |    // are we done via indentation?
  199|  12.5M|    if (!emptyLine && INPUT.column() < params.indent) {
  ------------------
  |  Branch (199:9): [True: 2.16M, False: 10.4M]
  |  Branch (199:23): [True: 838k, False: 1.32M]
  ------------------
  200|   838k|      params.leadingSpaces = true;
  201|   838k|      break;
  202|   838k|    }
  203|  12.5M|  }
  204|       |
  205|       |  // post-processing
  206|  2.02M|  if (params.trimTrailingSpaces) {
  ------------------
  |  Branch (206:7): [True: 2.01M, False: 14.1k]
  ------------------
  207|  2.01M|    std::size_t pos = scalar.find_last_not_of(" \t");
  208|  2.01M|    if (lastEscapedChar != std::string::npos) {
  ------------------
  |  Branch (208:9): [True: 15.6k, False: 1.99M]
  ------------------
  209|  15.6k|      if (pos < lastEscapedChar || pos == std::string::npos) {
  ------------------
  |  Branch (209:11): [True: 9.26k, False: 6.36k]
  |  Branch (209:36): [True: 624, False: 5.73k]
  ------------------
  210|  9.89k|        pos = lastEscapedChar;
  211|  9.89k|      }
  212|  15.6k|    }
  213|  2.01M|    if (pos < scalar.size()) {
  ------------------
  |  Branch (213:9): [True: 2.00M, False: 9.67k]
  ------------------
  214|  2.00M|      scalar.erase(pos + 1);
  215|  2.00M|    }
  216|  2.01M|  }
  217|       |
  218|  2.02M|  switch (params.chomp) {
  219|  12.9k|    case CLIP: {
  ------------------
  |  Branch (219:5): [True: 12.9k, False: 2.01M]
  ------------------
  220|  12.9k|      std::size_t pos = scalar.find_last_not_of('\n');
  221|  12.9k|      if (lastEscapedChar != std::string::npos) {
  ------------------
  |  Branch (221:11): [True: 3.92k, False: 8.98k]
  ------------------
  222|  3.92k|        if (pos < lastEscapedChar || pos == std::string::npos) {
  ------------------
  |  Branch (222:13): [True: 2.27k, False: 1.65k]
  |  Branch (222:38): [True: 220, False: 1.43k]
  ------------------
  223|  2.49k|          pos = lastEscapedChar;
  224|  2.49k|        }
  225|  3.92k|      }
  226|  12.9k|      if (pos == std::string::npos) {
  ------------------
  |  Branch (226:11): [True: 5.49k, False: 7.41k]
  ------------------
  227|  5.49k|        scalar.erase();
  228|  7.41k|      } else if (pos + 1 < scalar.size()) {
  ------------------
  |  Branch (228:18): [True: 511, False: 6.90k]
  ------------------
  229|    511|        scalar.erase(pos + 2);
  230|    511|      }
  231|  12.9k|    } break;
  232|  2.01M|    case STRIP: {
  ------------------
  |  Branch (232:5): [True: 2.01M, False: 13.8k]
  ------------------
  233|  2.01M|      std::size_t pos = scalar.find_last_not_of('\n');
  234|  2.01M|      if (lastEscapedChar != std::string::npos) {
  ------------------
  |  Branch (234:11): [True: 15.6k, False: 1.99M]
  ------------------
  235|  15.6k|        if (pos < lastEscapedChar || pos == std::string::npos) {
  ------------------
  |  Branch (235:13): [True: 9.36k, False: 6.26k]
  |  Branch (235:38): [True: 341, False: 5.92k]
  ------------------
  236|  9.70k|          pos = lastEscapedChar;
  237|  9.70k|        }
  238|  15.6k|      }
  239|  2.01M|      if (pos == std::string::npos) {
  ------------------
  |  Branch (239:11): [True: 332, False: 2.01M]
  ------------------
  240|    332|        scalar.erase();
  241|  2.01M|      } else if (pos < scalar.size()) {
  ------------------
  |  Branch (241:18): [True: 2.00M, False: 9.67k]
  ------------------
  242|  2.00M|        scalar.erase(pos + 1);
  243|  2.00M|      }
  244|  2.01M|    } break;
  245|    561|    default:
  ------------------
  |  Branch (245:5): [True: 561, False: 2.02M]
  ------------------
  246|    561|      break;
  247|  2.02M|  }
  248|       |
  249|  2.02M|  return scalar;
  250|  2.02M|}

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

_ZN4YAML15ScanVerbatimTagERNS_6StreamE:
    9|    671|std::string ScanVerbatimTag(Stream& INPUT) {
   10|    671|  std::string tag;
   11|       |
   12|       |  // eat the start character
   13|    671|  INPUT.get();
   14|       |
   15|  10.0k|  while (INPUT) {
  ------------------
  |  Branch (15:10): [True: 10.0k, False: 18]
  ------------------
   16|  10.0k|    if (INPUT.peek() == Keys::VerbatimTagEnd) {
  ------------------
  |  Branch (16:9): [True: 637, False: 9.43k]
  ------------------
   17|       |      // eat the end character
   18|    637|      INPUT.get();
   19|    637|      return tag;
   20|    637|    }
   21|       |
   22|  9.43k|    int n = Exp::URI().Match(INPUT);
   23|  9.43k|    if (n <= 0)
  ------------------
  |  Branch (23:9): [True: 16, False: 9.41k]
  ------------------
   24|     16|      break;
   25|       |
   26|  9.41k|    tag += INPUT.get(n);
   27|  9.41k|  }
   28|       |
   29|     34|  throw ParserException(INPUT.mark(), ErrorMsg::END_OF_VERBATIM_TAG);
   30|    671|}
_ZN4YAML13ScanTagHandleERNS_6StreamERb:
   32|   907k|std::string ScanTagHandle(Stream& INPUT, bool& canBeHandle) {
   33|   907k|  std::string tag;
   34|   907k|  canBeHandle = true;
   35|   907k|  Mark firstNonWordChar;
   36|       |
   37|  9.96M|  while (INPUT) {
  ------------------
  |  Branch (37:10): [True: 9.96M, False: 320]
  ------------------
   38|  9.96M|    if (INPUT.peek() == Keys::Tag) {
  ------------------
  |  Branch (38:9): [True: 2.90k, False: 9.95M]
  ------------------
   39|  2.90k|      if (!canBeHandle)
  ------------------
  |  Branch (39:11): [True: 3, False: 2.90k]
  ------------------
   40|      3|        throw ParserException(firstNonWordChar, ErrorMsg::CHAR_IN_TAG_HANDLE);
   41|  2.90k|      break;
   42|  2.90k|    }
   43|       |
   44|  9.95M|    int n = 0;
   45|  9.95M|    if (canBeHandle) {
  ------------------
  |  Branch (45:9): [True: 8.97M, False: 982k]
  ------------------
   46|  8.97M|      n = Exp::Word().Match(INPUT);
   47|  8.97M|      if (n <= 0) {
  ------------------
  |  Branch (47:11): [True: 904k, False: 8.07M]
  ------------------
   48|   904k|        canBeHandle = false;
   49|   904k|        firstNonWordChar = INPUT.mark();
   50|   904k|      }
   51|  8.97M|    }
   52|       |
   53|  9.95M|    if (!canBeHandle)
  ------------------
  |  Branch (53:9): [True: 1.88M, False: 8.07M]
  ------------------
   54|  1.88M|      n = Exp::Tag().Match(INPUT);
   55|       |
   56|  9.95M|    if (n <= 0)
  ------------------
  |  Branch (56:9): [True: 904k, False: 9.05M]
  ------------------
   57|   904k|      break;
   58|       |
   59|  9.05M|    tag += INPUT.get(n);
   60|  9.05M|  }
   61|       |
   62|   907k|  return tag;
   63|   907k|}
_ZN4YAML13ScanTagSuffixERNS_6StreamE:
   65|  2.90k|std::string ScanTagSuffix(Stream& INPUT) {
   66|  2.90k|  std::string tag;
   67|       |
   68|   309k|  while (INPUT) {
  ------------------
  |  Branch (68:10): [True: 309k, False: 108]
  ------------------
   69|   309k|    int n = Exp::Tag().Match(INPUT);
   70|   309k|    if (n <= 0)
  ------------------
  |  Branch (70:9): [True: 2.79k, False: 306k]
  ------------------
   71|  2.79k|      break;
   72|       |
   73|   306k|    tag += INPUT.get(n);
   74|   306k|  }
   75|       |
   76|  2.90k|  if (tag.empty())
  ------------------
  |  Branch (76:7): [True: 15, False: 2.89k]
  ------------------
   77|     15|    throw ParserException(INPUT.mark(), ErrorMsg::TAG_WITH_NO_SUFFIX);
   78|       |
   79|  2.89k|  return tag;
   80|  2.90k|}

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

_ZN4YAML7Scanner9SimpleKeyC2ERKNS_4MarkEm:
    8|  46.8M|    : mark(mark_),
    9|  46.8M|      flowLevel(flowLevel_),
   10|  46.8M|      pIndent(nullptr),
   11|  46.8M|      pMapStart(nullptr),
   12|  46.8M|      pKey(nullptr) {}
_ZN4YAML7Scanner9SimpleKey8ValidateEv:
   14|   841k|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|   841k|  if (pIndent)
  ------------------
  |  Branch (18:7): [True: 41.0k, False: 800k]
  ------------------
   19|  41.0k|    pIndent->status = IndentMarker::VALID;
   20|   841k|  if (pMapStart)
  ------------------
  |  Branch (20:7): [True: 41.0k, False: 800k]
  ------------------
   21|  41.0k|    pMapStart->status = Token::VALID;
   22|   841k|  if (pKey)
  ------------------
  |  Branch (22:7): [True: 841k, False: 0]
  ------------------
   23|   841k|    pKey->status = Token::VALID;
   24|   841k|}
_ZN4YAML7Scanner9SimpleKey10InvalidateEv:
   26|  2.76M|void Scanner::SimpleKey::Invalidate() {
   27|  2.76M|  if (pIndent)
  ------------------
  |  Branch (27:7): [True: 1.63M, False: 1.12M]
  ------------------
   28|  1.63M|    pIndent->status = IndentMarker::INVALID;
   29|  2.76M|  if (pMapStart)
  ------------------
  |  Branch (29:7): [True: 1.63M, False: 1.12M]
  ------------------
   30|  1.63M|    pMapStart->status = Token::INVALID;
   31|  2.76M|  if (pKey)
  ------------------
  |  Branch (31:7): [True: 2.76M, False: 0]
  ------------------
   32|  2.76M|    pKey->status = Token::INVALID;
   33|  2.76M|}
_ZNK4YAML7Scanner27CanInsertPotentialSimpleKeyEv:
   36|  47.2M|bool Scanner::CanInsertPotentialSimpleKey() const {
   37|  47.2M|  if (!m_simpleKeyAllowed)
  ------------------
  |  Branch (37:7): [True: 417k, False: 46.8M]
  ------------------
   38|   417k|    return false;
   39|       |
   40|  46.8M|  return !ExistsActiveSimpleKey();
   41|  47.2M|}
_ZNK4YAML7Scanner21ExistsActiveSimpleKeyEv:
   47|  46.8M|bool Scanner::ExistsActiveSimpleKey() const {
   48|  46.8M|  if (m_simpleKeys.empty())
  ------------------
  |  Branch (48:7): [True: 1.78M, False: 45.0M]
  ------------------
   49|  1.78M|    return false;
   50|       |
   51|  45.0M|  const SimpleKey& key = m_simpleKeys.top();
   52|  45.0M|  return key.flowLevel == GetFlowLevel();
   53|  46.8M|}
_ZN4YAML7Scanner24InsertPotentialSimpleKeyEv:
   58|  47.2M|void Scanner::InsertPotentialSimpleKey() {
   59|  47.2M|  if (!CanInsertPotentialSimpleKey())
  ------------------
  |  Branch (59:7): [True: 420k, False: 46.8M]
  ------------------
   60|   420k|    return;
   61|       |
   62|  46.8M|  SimpleKey key(INPUT.mark(), GetFlowLevel());
   63|       |
   64|       |  // first add a map start, if necessary
   65|  46.8M|  if (InBlockContext()) {
  ------------------
  |  Branch (65:7): [True: 1.77M, False: 45.0M]
  ------------------
   66|  1.77M|    key.pIndent = PushIndentTo(INPUT.column(), IndentMarker::MAP);
   67|  1.77M|    if (key.pIndent) {
  ------------------
  |  Branch (67:9): [True: 1.68M, False: 92.4k]
  ------------------
   68|  1.68M|      key.pIndent->status = IndentMarker::UNKNOWN;
   69|  1.68M|      key.pMapStart = key.pIndent->pStartToken;
   70|  1.68M|      key.pMapStart->status = Token::UNVERIFIED;
   71|  1.68M|    }
   72|  1.77M|  }
   73|       |
   74|       |  // then add the (now unverified) key
   75|  46.8M|  m_tokens.push(Token(Token::KEY, INPUT.mark()));
   76|  46.8M|  key.pKey = &m_tokens.back();
   77|  46.8M|  key.pKey->status = Token::UNVERIFIED;
   78|       |
   79|  46.8M|  m_simpleKeys.push(key);
   80|  46.8M|}
_ZN4YAML7Scanner19InvalidateSimpleKeyEv:
   84|  10.6M|void Scanner::InvalidateSimpleKey() {
   85|  10.6M|  if (m_simpleKeys.empty())
  ------------------
  |  Branch (85:7): [True: 7.65M, False: 2.98M]
  ------------------
   86|  7.65M|    return;
   87|       |
   88|       |  // grab top key
   89|  2.98M|  SimpleKey& key = m_simpleKeys.top();
   90|  2.98M|  if (key.flowLevel != GetFlowLevel())
  ------------------
  |  Branch (90:7): [True: 1.20M, False: 1.78M]
  ------------------
   91|  1.20M|    return;
   92|       |
   93|  1.78M|  key.Invalidate();
   94|  1.78M|  m_simpleKeys.pop();
   95|  1.78M|}
_ZN4YAML7Scanner15VerifySimpleKeyEv:
  100|  8.58M|bool Scanner::VerifySimpleKey() {
  101|  8.58M|  if (m_simpleKeys.empty())
  ------------------
  |  Branch (101:7): [True: 6.45M, False: 2.12M]
  ------------------
  102|  6.45M|    return false;
  103|       |
  104|       |  // grab top key
  105|  2.12M|  SimpleKey key = m_simpleKeys.top();
  106|       |
  107|       |  // only validate if we're in the correct flow level
  108|  2.12M|  if (key.flowLevel != GetFlowLevel())
  ------------------
  |  Branch (108:7): [True: 296k, False: 1.82M]
  ------------------
  109|   296k|    return false;
  110|       |
  111|  1.82M|  m_simpleKeys.pop();
  112|       |
  113|  1.82M|  bool isValid = true;
  114|       |
  115|       |  // needs to be less than 1024 characters and inline
  116|  1.82M|  if (INPUT.line() != key.mark.line || INPUT.pos() - key.mark.pos > 1024)
  ------------------
  |  Branch (116:7): [True: 25.8k, False: 1.80M]
  |  Branch (116:40): [True: 961k, False: 841k]
  ------------------
  117|   987k|    isValid = false;
  118|       |
  119|       |  // invalidate key
  120|  1.82M|  if (isValid)
  ------------------
  |  Branch (120:7): [True: 841k, False: 987k]
  ------------------
  121|   841k|    key.Validate();
  122|   987k|  else
  123|   987k|    key.Invalidate();
  124|       |
  125|  1.82M|  return isValid;
  126|  2.12M|}
_ZN4YAML7Scanner16PopAllSimpleKeysEv:
  128|   547k|void Scanner::PopAllSimpleKeys() {
  129|  37.6M|  while (!m_simpleKeys.empty())
  ------------------
  |  Branch (129:10): [True: 37.1M, False: 547k]
  ------------------
  130|  37.1M|    m_simpleKeys.pop();
  131|   547k|}

_ZN4YAML15SingleDocParserC2ERNS_7ScannerERKNS_10DirectivesE:
   18|   502k|    : m_scanner(scanner),
   19|   502k|      m_directives(directives),
   20|   502k|      m_pCollectionStack(new CollectionStack),
   21|   502k|      m_anchors{},
   22|   502k|      m_curAnchor(0) {}
_ZN4YAML15SingleDocParserD2Ev:
   24|   502k|SingleDocParser::~SingleDocParser() = default;
_ZN4YAML15SingleDocParser14HandleDocumentERNS_12EventHandlerE:
   29|   502k|void SingleDocParser::HandleDocument(EventHandler& eventHandler) {
   30|   502k|  assert(!m_scanner.empty());  // guaranteed that there are tokens
   31|   502k|  assert(!m_curAnchor);
   32|       |
   33|   502k|  eventHandler.OnDocumentStart(m_scanner.peek().mark);
   34|       |
   35|       |  // eat doc start
   36|   502k|  if (m_scanner.peek().type == Token::DOC_START)
  ------------------
  |  Branch (36:7): [True: 222k, False: 279k]
  ------------------
   37|   222k|    m_scanner.pop();
   38|       |
   39|       |  // recurse!
   40|   502k|  HandleNode(eventHandler);
   41|       |
   42|   502k|  eventHandler.OnDocumentEnd();
   43|       |
   44|       |  // check if any tokens left after the text
   45|   502k|  if (!m_scanner.empty() && m_scanner.peek().type != Token::DOC_END
  ------------------
  |  Branch (45:7): [True: 497k, False: 4.69k]
  |  Branch (45:29): [True: 223k, False: 274k]
  ------------------
   46|   223k|      && m_scanner.peek().type != Token::DOC_START)
  ------------------
  |  Branch (46:10): [True: 369, False: 222k]
  ------------------
   47|    369|    throw ParserException(m_scanner.mark(), ErrorMsg::UNEXPECTED_TOKEN_AFTER_DOC);
   48|       |
   49|       |  // and finally eat any doc ends we see
   50|   501k|  if (!m_scanner.empty() && m_scanner.peek().type == Token::DOC_END)
  ------------------
  |  Branch (50:7): [True: 497k, False: 4.69k]
  |  Branch (50:29): [True: 274k, False: 222k]
  ------------------
   51|   274k|    m_scanner.pop();
   52|   501k|}
_ZN4YAML15SingleDocParser10HandleNodeERNS_12EventHandlerE:
   54|  1.90M|void SingleDocParser::HandleNode(EventHandler& eventHandler) {
   55|  1.90M|  DepthGuard<500> depthguard(depth, m_scanner.mark(), ErrorMsg::BAD_FILE);
   56|       |
   57|       |  // an empty node *is* a possibility
   58|  1.90M|  if (m_scanner.empty()) {
  ------------------
  |  Branch (58:7): [True: 85, False: 1.90M]
  ------------------
   59|     85|    eventHandler.OnNull(m_scanner.mark(), NullAnchor);
   60|     85|    return;
   61|     85|  }
   62|       |
   63|       |  // save location
   64|  1.90M|  Mark mark = m_scanner.peek().mark;
   65|       |
   66|       |  // special case: a value node by itself must be a map, with no header
   67|  1.90M|  if (m_scanner.peek().type == Token::VALUE) {
  ------------------
  |  Branch (67:7): [True: 3.80k, False: 1.89M]
  ------------------
   68|  3.80k|    eventHandler.OnMapStart(mark, "?", NullAnchor, EmitterStyle::Default);
   69|  3.80k|    HandleMap(eventHandler);
   70|  3.80k|    eventHandler.OnMapEnd();
   71|  3.80k|    return;
   72|  3.80k|  }
   73|       |
   74|       |  // special case: an alias node
   75|  1.89M|  if (m_scanner.peek().type == Token::ALIAS) {
  ------------------
  |  Branch (75:7): [True: 1.25k, False: 1.89M]
  ------------------
   76|  1.25k|    eventHandler.OnAlias(mark, LookupAnchor(mark, m_scanner.peek().value));
   77|  1.25k|    m_scanner.pop();
   78|  1.25k|    return;
   79|  1.25k|  }
   80|       |
   81|  1.89M|  std::string tag;
   82|  1.89M|  std::string anchor_name;
   83|  1.89M|  anchor_t anchor;
   84|  1.89M|  ParseProperties(tag, anchor, anchor_name);
   85|       |
   86|  1.89M|  if (!anchor_name.empty())
  ------------------
  |  Branch (86:7): [True: 7.93k, False: 1.89M]
  ------------------
   87|  7.93k|    eventHandler.OnAnchor(mark, anchor_name);
   88|       |
   89|       |  // after parsing properties, an empty node is again a possibility
   90|  1.89M|  if (m_scanner.empty()) {
  ------------------
  |  Branch (90:7): [True: 693, False: 1.89M]
  ------------------
   91|    693|    eventHandler.OnNull(mark, anchor);
   92|    693|    return;
   93|    693|  }
   94|       |
   95|  1.89M|  const Token& token = m_scanner.peek();
   96|       |
   97|       |  // add non-specific tags
   98|  1.89M|  if (tag.empty())
  ------------------
  |  Branch (98:7): [True: 1.89M, False: 6.10k]
  ------------------
   99|  1.89M|    tag = (token.type == Token::NON_PLAIN_SCALAR ? "!" : "?");
  ------------------
  |  Branch (99:12): [True: 1.41k, False: 1.89M]
  ------------------
  100|       |
  101|  1.89M|  if (token.type == Token::PLAIN_SCALAR
  ------------------
  |  Branch (101:7): [True: 273k, False: 1.62M]
  ------------------
  102|   273k|      && tag == "?" && IsNullString(token.value.data(), token.value.size())) {
  ------------------
  |  Branch (102:10): [True: 273k, False: 827]
  |  Branch (102:24): [True: 26.0k, False: 247k]
  ------------------
  103|  26.0k|    eventHandler.OnNull(mark, anchor);
  104|  26.0k|    m_scanner.pop();
  105|  26.0k|    return;
  106|  26.0k|  }
  107|       |
  108|       |  // now split based on what kind of node we should be
  109|  1.87M|  switch (token.type) {
  110|   247k|    case Token::PLAIN_SCALAR:
  ------------------
  |  Branch (110:5): [True: 247k, False: 1.62M]
  ------------------
  111|   249k|    case Token::NON_PLAIN_SCALAR:
  ------------------
  |  Branch (111:5): [True: 1.42k, False: 1.87M]
  ------------------
  112|   249k|      eventHandler.OnScalar(mark, tag, anchor, token.value);
  113|   249k|      m_scanner.pop();
  114|   249k|      return;
  115|  39.1k|    case Token::FLOW_SEQ_START:
  ------------------
  |  Branch (115:5): [True: 39.1k, False: 1.83M]
  ------------------
  116|  39.1k|      eventHandler.OnSequenceStart(mark, tag, anchor, EmitterStyle::Flow);
  117|  39.1k|      HandleSequence(eventHandler);
  118|  39.1k|      eventHandler.OnSequenceEnd();
  119|  39.1k|      return;
  120|  7.27k|    case Token::BLOCK_SEQ_START:
  ------------------
  |  Branch (120:5): [True: 7.27k, False: 1.86M]
  ------------------
  121|  7.27k|      eventHandler.OnSequenceStart(mark, tag, anchor, EmitterStyle::Block);
  122|  7.27k|      HandleSequence(eventHandler);
  123|  7.27k|      eventHandler.OnSequenceEnd();
  124|  7.27k|      return;
  125|  39.1k|    case Token::FLOW_MAP_START:
  ------------------
  |  Branch (125:5): [True: 39.1k, False: 1.83M]
  ------------------
  126|  39.1k|      eventHandler.OnMapStart(mark, tag, anchor, EmitterStyle::Flow);
  127|  39.1k|      HandleMap(eventHandler);
  128|  39.1k|      eventHandler.OnMapEnd();
  129|  39.1k|      return;
  130|  19.1k|    case Token::BLOCK_MAP_START:
  ------------------
  |  Branch (130:5): [True: 19.1k, False: 1.85M]
  ------------------
  131|  19.1k|      eventHandler.OnMapStart(mark, tag, anchor, EmitterStyle::Block);
  132|  19.1k|      HandleMap(eventHandler);
  133|  19.1k|      eventHandler.OnMapEnd();
  134|  19.1k|      return;
  135|  38.9k|    case Token::KEY:
  ------------------
  |  Branch (135:5): [True: 38.9k, False: 1.83M]
  ------------------
  136|       |      // compact maps can only go in a flow sequence
  137|  38.9k|      if (m_pCollectionStack->GetCurCollectionType() ==
  ------------------
  |  Branch (137:11): [True: 38.0k, False: 970]
  ------------------
  138|  38.9k|          CollectionType::FlowSeq) {
  139|  38.0k|        eventHandler.OnMapStart(mark, tag, anchor, EmitterStyle::Flow);
  140|  38.0k|        HandleMap(eventHandler);
  141|  38.0k|        eventHandler.OnMapEnd();
  142|  38.0k|        return;
  143|  38.0k|      }
  144|    970|      break;
  145|  1.47M|    default:
  ------------------
  |  Branch (145:5): [True: 1.47M, False: 393k]
  ------------------
  146|  1.47M|      break;
  147|  1.87M|  }
  148|       |
  149|  1.47M|  if (tag == "?")
  ------------------
  |  Branch (149:7): [True: 1.47M, False: 2.13k]
  ------------------
  150|  1.47M|    eventHandler.OnNull(mark, anchor);
  151|  2.13k|  else
  152|  2.13k|    eventHandler.OnScalar(mark, tag, anchor, "");
  153|  1.47M|}
_ZN4YAML15SingleDocParser14HandleSequenceERNS_12EventHandlerE:
  155|  46.4k|void SingleDocParser::HandleSequence(EventHandler& eventHandler) {
  156|       |  // split based on start token
  157|  46.4k|  switch (m_scanner.peek().type) {
  158|  7.27k|    case Token::BLOCK_SEQ_START:
  ------------------
  |  Branch (158:5): [True: 7.27k, False: 39.1k]
  ------------------
  159|  7.27k|      HandleBlockSequence(eventHandler);
  160|  7.27k|      break;
  161|  39.1k|    case Token::FLOW_SEQ_START:
  ------------------
  |  Branch (161:5): [True: 39.1k, False: 7.27k]
  ------------------
  162|  39.1k|      HandleFlowSequence(eventHandler);
  163|  39.1k|      break;
  164|      0|    default:
  ------------------
  |  Branch (164:5): [True: 0, False: 46.4k]
  ------------------
  165|      0|      break;
  166|  46.4k|  }
  167|  46.4k|}
_ZN4YAML15SingleDocParser19HandleBlockSequenceERNS_12EventHandlerE:
  169|  7.27k|void SingleDocParser::HandleBlockSequence(EventHandler& eventHandler) {
  170|       |  // eat start token
  171|  7.27k|  m_scanner.pop();
  172|  7.27k|  m_pCollectionStack->PushCollectionType(CollectionType::BlockSeq);
  173|       |
  174|  15.7k|  while (true) {
  ------------------
  |  Branch (174:10): [True: 14.3k, Folded]
  ------------------
  175|  14.3k|    if (m_scanner.empty())
  ------------------
  |  Branch (175:9): [True: 0, False: 14.3k]
  ------------------
  176|      0|      throw ParserException(m_scanner.mark(), ErrorMsg::END_OF_SEQ);
  177|       |
  178|  14.3k|    Token token = m_scanner.peek();
  179|  14.3k|    if (token.type != Token::BLOCK_ENTRY && token.type != Token::BLOCK_SEQ_END)
  ------------------
  |  Branch (179:9): [True: 5.89k, False: 8.49k]
  |  Branch (179:45): [True: 11, False: 5.88k]
  ------------------
  180|     11|      throw ParserException(token.mark, ErrorMsg::END_OF_SEQ);
  181|       |
  182|  14.3k|    m_scanner.pop();
  183|  14.3k|    if (token.type == Token::BLOCK_SEQ_END)
  ------------------
  |  Branch (183:9): [True: 5.88k, False: 8.49k]
  ------------------
  184|  5.88k|      break;
  185|       |
  186|       |    // check for null
  187|  8.49k|    if (!m_scanner.empty()) {
  ------------------
  |  Branch (187:9): [True: 8.46k, False: 28]
  ------------------
  188|  8.46k|      const Token& nextToken = m_scanner.peek();
  189|  8.46k|      if (nextToken.type == Token::BLOCK_ENTRY ||
  ------------------
  |  Branch (189:11): [True: 1.03k, False: 7.43k]
  ------------------
  190|  7.43k|          nextToken.type == Token::BLOCK_SEQ_END) {
  ------------------
  |  Branch (190:11): [True: 3.02k, False: 4.41k]
  ------------------
  191|  4.05k|        eventHandler.OnNull(nextToken.mark, NullAnchor);
  192|  4.05k|        continue;
  193|  4.05k|      }
  194|  8.46k|    }
  195|       |
  196|  4.44k|    HandleNode(eventHandler);
  197|  4.44k|  }
  198|       |
  199|  7.26k|  m_pCollectionStack->PopCollectionType(CollectionType::BlockSeq);
  200|  7.26k|}
_ZN4YAML15SingleDocParser18HandleFlowSequenceERNS_12EventHandlerE:
  202|  39.1k|void SingleDocParser::HandleFlowSequence(EventHandler& eventHandler) {
  203|       |  // eat start token
  204|  39.1k|  m_scanner.pop();
  205|  39.1k|  m_pCollectionStack->PushCollectionType(CollectionType::FlowSeq);
  206|       |
  207|  1.26M|  while (true) {
  ------------------
  |  Branch (207:10): [True: 1.22M, Folded]
  ------------------
  208|  1.22M|    if (m_scanner.empty())
  ------------------
  |  Branch (208:9): [True: 202, False: 1.22M]
  ------------------
  209|    202|      throw ParserException(m_scanner.mark(), ErrorMsg::END_OF_SEQ_FLOW);
  210|       |
  211|       |    // first check for end
  212|  1.22M|    if (m_scanner.peek().type == Token::FLOW_SEQ_END) {
  ------------------
  |  Branch (212:9): [True: 1.21k, False: 1.22M]
  ------------------
  213|  1.21k|      m_scanner.pop();
  214|  1.21k|      break;
  215|  1.21k|    }
  216|       |
  217|       |    // then read the node
  218|  1.22M|    HandleNode(eventHandler);
  219|       |
  220|  1.22M|    if (m_scanner.empty())
  ------------------
  |  Branch (220:9): [True: 650, False: 1.22M]
  ------------------
  221|    650|      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.22M|    Token& token = m_scanner.peek();
  226|  1.22M|    if (token.type == Token::FLOW_ENTRY)
  ------------------
  |  Branch (226:9): [True: 1.18M, False: 38.1k]
  ------------------
  227|  1.18M|      m_scanner.pop();
  228|  38.1k|    else if (token.type != Token::FLOW_SEQ_END)
  ------------------
  |  Branch (228:14): [True: 215, False: 37.9k]
  ------------------
  229|    215|      throw ParserException(token.mark, ErrorMsg::END_OF_SEQ_FLOW);
  230|  1.22M|  }
  231|       |
  232|  38.0k|  m_pCollectionStack->PopCollectionType(CollectionType::FlowSeq);
  233|  38.0k|}
_ZN4YAML15SingleDocParser9HandleMapERNS_12EventHandlerE:
  235|   100k|void SingleDocParser::HandleMap(EventHandler& eventHandler) {
  236|       |  // split based on start token
  237|   100k|  switch (m_scanner.peek().type) {
  238|  19.1k|    case Token::BLOCK_MAP_START:
  ------------------
  |  Branch (238:5): [True: 19.1k, False: 80.9k]
  ------------------
  239|  19.1k|      HandleBlockMap(eventHandler);
  240|  19.1k|      break;
  241|  39.1k|    case Token::FLOW_MAP_START:
  ------------------
  |  Branch (241:5): [True: 39.1k, False: 60.9k]
  ------------------
  242|  39.1k|      HandleFlowMap(eventHandler);
  243|  39.1k|      break;
  244|  38.0k|    case Token::KEY:
  ------------------
  |  Branch (244:5): [True: 38.0k, False: 62.0k]
  ------------------
  245|  38.0k|      HandleCompactMap(eventHandler);
  246|  38.0k|      break;
  247|  3.80k|    case Token::VALUE:
  ------------------
  |  Branch (247:5): [True: 3.80k, False: 96.2k]
  ------------------
  248|  3.80k|      HandleCompactMapWithNoKey(eventHandler);
  249|  3.80k|      break;
  250|      0|    default:
  ------------------
  |  Branch (250:5): [True: 0, False: 100k]
  ------------------
  251|      0|      break;
  252|   100k|  }
  253|   100k|}
_ZN4YAML15SingleDocParser14HandleBlockMapERNS_12EventHandlerE:
  255|  19.1k|void SingleDocParser::HandleBlockMap(EventHandler& eventHandler) {
  256|       |  // eat start token
  257|  19.1k|  m_scanner.pop();
  258|  19.1k|  m_pCollectionStack->PushCollectionType(CollectionType::BlockMap);
  259|       |
  260|  43.1k|  while (true) {
  ------------------
  |  Branch (260:10): [True: 40.0k, Folded]
  ------------------
  261|  40.0k|    if (m_scanner.empty())
  ------------------
  |  Branch (261:9): [True: 0, False: 40.0k]
  ------------------
  262|      0|      throw ParserException(m_scanner.mark(), ErrorMsg::END_OF_MAP);
  263|       |
  264|  40.0k|    Token token = m_scanner.peek();
  265|  40.0k|    if (token.type != Token::KEY && token.type != Token::VALUE &&
  ------------------
  |  Branch (265:9): [True: 24.9k, False: 15.0k]
  |  Branch (265:37): [True: 16.0k, False: 8.90k]
  ------------------
  266|  16.0k|        token.type != Token::BLOCK_MAP_END)
  ------------------
  |  Branch (266:9): [True: 107, False: 15.8k]
  ------------------
  267|    107|      throw ParserException(token.mark, ErrorMsg::END_OF_MAP);
  268|       |
  269|  39.8k|    if (token.type == Token::BLOCK_MAP_END) {
  ------------------
  |  Branch (269:9): [True: 15.8k, False: 24.0k]
  ------------------
  270|  15.8k|      m_scanner.pop();
  271|  15.8k|      break;
  272|  15.8k|    }
  273|       |
  274|       |    // grab key (if non-null)
  275|  24.0k|    if (token.type == Token::KEY) {
  ------------------
  |  Branch (275:9): [True: 15.0k, False: 8.92k]
  ------------------
  276|  15.0k|      m_scanner.pop();
  277|  15.0k|      HandleNode(eventHandler);
  278|  15.0k|    } else {
  279|  8.92k|      eventHandler.OnNull(token.mark, NullAnchor);
  280|  8.92k|    }
  281|       |
  282|       |    // now grab value (optional)
  283|  24.0k|    if (!m_scanner.empty() && m_scanner.peek().type == Token::VALUE) {
  ------------------
  |  Branch (283:9): [True: 21.6k, False: 2.36k]
  |  Branch (283:31): [True: 16.3k, False: 5.28k]
  ------------------
  284|  16.3k|      m_scanner.pop();
  285|  16.3k|      HandleNode(eventHandler);
  286|  16.3k|    } else {
  287|  7.64k|      eventHandler.OnNull(token.mark, NullAnchor);
  288|  7.64k|    }
  289|  24.0k|  }
  290|       |
  291|  19.0k|  m_pCollectionStack->PopCollectionType(CollectionType::BlockMap);
  292|  19.0k|}
_ZN4YAML15SingleDocParser13HandleFlowMapERNS_12EventHandlerE:
  294|  39.1k|void SingleDocParser::HandleFlowMap(EventHandler& eventHandler) {
  295|       |  // eat start token
  296|  39.1k|  m_scanner.pop();
  297|  39.1k|  m_pCollectionStack->PushCollectionType(CollectionType::FlowMap);
  298|       |
  299|   525k|  while (true) {
  ------------------
  |  Branch (299:10): [True: 488k, Folded]
  ------------------
  300|   488k|    if (m_scanner.empty())
  ------------------
  |  Branch (300:9): [True: 151, False: 487k]
  ------------------
  301|    151|      throw ParserException(m_scanner.mark(), ErrorMsg::END_OF_MAP_FLOW);
  302|       |
  303|   487k|    Token& token = m_scanner.peek();
  304|   487k|    const Mark mark = token.mark;
  305|       |    // first check for end
  306|   487k|    if (token.type == Token::FLOW_MAP_END) {
  ------------------
  |  Branch (306:9): [True: 1.16k, False: 486k]
  ------------------
  307|  1.16k|      m_scanner.pop();
  308|  1.16k|      break;
  309|  1.16k|    }
  310|       |
  311|       |    // grab key (if non-null)
  312|   486k|    if (token.type == Token::KEY) {
  ------------------
  |  Branch (312:9): [True: 68.0k, False: 418k]
  ------------------
  313|  68.0k|      m_scanner.pop();
  314|  68.0k|      HandleNode(eventHandler);
  315|   418k|    } else {
  316|   418k|      eventHandler.OnNull(mark, NullAnchor);
  317|   418k|    }
  318|       |
  319|       |    // now grab value (optional)
  320|   486k|    if (!m_scanner.empty() && m_scanner.peek().type == Token::VALUE) {
  ------------------
  |  Branch (320:9): [True: 449k, False: 37.5k]
  |  Branch (320:31): [True: 30.3k, False: 418k]
  ------------------
  321|  30.3k|      m_scanner.pop();
  322|  30.3k|      HandleNode(eventHandler);
  323|   456k|    } else {
  324|   456k|      eventHandler.OnNull(mark, NullAnchor);
  325|   456k|    }
  326|       |
  327|   486k|    if (m_scanner.empty())
  ------------------
  |  Branch (327:9): [True: 292, False: 486k]
  ------------------
  328|    292|      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|   486k|    Token& nextToken = m_scanner.peek();
  333|   486k|    if (nextToken.type == Token::FLOW_ENTRY)
  ------------------
  |  Branch (333:9): [True: 448k, False: 38.3k]
  ------------------
  334|   448k|      m_scanner.pop();
  335|  38.3k|    else if (nextToken.type != Token::FLOW_MAP_END)
  ------------------
  |  Branch (335:14): [True: 187, False: 38.1k]
  ------------------
  336|    187|      throw ParserException(nextToken.mark, ErrorMsg::END_OF_MAP_FLOW);
  337|   486k|  }
  338|       |
  339|  38.4k|  m_pCollectionStack->PopCollectionType(CollectionType::FlowMap);
  340|  38.4k|}
_ZN4YAML15SingleDocParser16HandleCompactMapERNS_12EventHandlerE:
  343|  38.0k|void SingleDocParser::HandleCompactMap(EventHandler& eventHandler) {
  344|  38.0k|  m_pCollectionStack->PushCollectionType(CollectionType::CompactMap);
  345|       |
  346|       |  // grab key
  347|  38.0k|  Mark mark = m_scanner.peek().mark;
  348|  38.0k|  m_scanner.pop();
  349|  38.0k|  HandleNode(eventHandler);
  350|       |
  351|       |  // now grab value (optional)
  352|  38.0k|  if (!m_scanner.empty() && m_scanner.peek().type == Token::VALUE) {
  ------------------
  |  Branch (352:7): [True: 756, False: 37.2k]
  |  Branch (352:29): [True: 377, False: 379]
  ------------------
  353|    377|    m_scanner.pop();
  354|    377|    HandleNode(eventHandler);
  355|  37.6k|  } else {
  356|  37.6k|    eventHandler.OnNull(mark, NullAnchor);
  357|  37.6k|  }
  358|       |
  359|  38.0k|  m_pCollectionStack->PopCollectionType(CollectionType::CompactMap);
  360|  38.0k|}
_ZN4YAML15SingleDocParser25HandleCompactMapWithNoKeyERNS_12EventHandlerE:
  363|  3.80k|void SingleDocParser::HandleCompactMapWithNoKey(EventHandler& eventHandler) {
  364|  3.80k|  m_pCollectionStack->PushCollectionType(CollectionType::CompactMap);
  365|       |
  366|       |  // null key
  367|  3.80k|  eventHandler.OnNull(m_scanner.peek().mark, NullAnchor);
  368|       |
  369|       |  // grab value
  370|  3.80k|  m_scanner.pop();
  371|  3.80k|  HandleNode(eventHandler);
  372|       |
  373|  3.80k|  m_pCollectionStack->PopCollectionType(CollectionType::CompactMap);
  374|  3.80k|}
_ZN4YAML15SingleDocParser15ParsePropertiesERNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERmS8_:
  379|  1.89M|                                      std::string& anchor_name) {
  380|  1.89M|  tag.clear();
  381|  1.89M|  anchor_name.clear();
  382|  1.89M|  anchor = NullAnchor;
  383|       |
  384|  1.91M|  while (true) {
  ------------------
  |  Branch (384:10): [True: 1.91M, Folded]
  ------------------
  385|  1.91M|    if (m_scanner.empty())
  ------------------
  |  Branch (385:9): [True: 693, False: 1.91M]
  ------------------
  386|    693|      return;
  387|       |
  388|  1.91M|    switch (m_scanner.peek().type) {
  389|  6.49k|      case Token::TAG:
  ------------------
  |  Branch (389:7): [True: 6.49k, False: 1.90M]
  ------------------
  390|  6.49k|        ParseTag(tag);
  391|  6.49k|        break;
  392|  7.93k|      case Token::ANCHOR:
  ------------------
  |  Branch (392:7): [True: 7.93k, False: 1.90M]
  ------------------
  393|  7.93k|        ParseAnchor(anchor, anchor_name);
  394|  7.93k|        break;
  395|  1.89M|      default:
  ------------------
  |  Branch (395:7): [True: 1.89M, False: 14.4k]
  ------------------
  396|  1.89M|        return;
  397|  1.91M|    }
  398|  1.91M|  }
  399|  1.89M|}
_ZN4YAML15SingleDocParser8ParseTagERNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
  401|  6.49k|void SingleDocParser::ParseTag(std::string& tag) {
  402|  6.49k|  Token& token = m_scanner.peek();
  403|  6.49k|  if (!tag.empty())
  ------------------
  |  Branch (403:7): [True: 55, False: 6.43k]
  ------------------
  404|     55|    throw ParserException(token.mark, ErrorMsg::MULTIPLE_TAGS);
  405|       |
  406|  6.43k|  Tag tagInfo(token);
  407|  6.43k|  tag = tagInfo.Translate(m_directives);
  408|  6.43k|  m_scanner.pop();
  409|  6.43k|}
_ZN4YAML15SingleDocParser11ParseAnchorERmRNSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEE:
  411|  7.93k|void SingleDocParser::ParseAnchor(anchor_t& anchor, std::string& anchor_name) {
  412|  7.93k|  Token& token = m_scanner.peek();
  413|  7.93k|  if (anchor)
  ------------------
  |  Branch (413:7): [True: 2, False: 7.93k]
  ------------------
  414|      2|    throw ParserException(token.mark, ErrorMsg::MULTIPLE_ANCHORS);
  415|       |
  416|  7.93k|  anchor_name = token.value;
  417|  7.93k|  anchor = RegisterAnchor(token.value);
  418|  7.93k|  m_scanner.pop();
  419|  7.93k|}
_ZN4YAML15SingleDocParser14RegisterAnchorERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
  421|  7.93k|anchor_t SingleDocParser::RegisterAnchor(const std::string& name) {
  422|  7.93k|  if (name.empty())
  ------------------
  |  Branch (422:7): [True: 0, False: 7.93k]
  ------------------
  423|      0|    return NullAnchor;
  424|       |
  425|  7.93k|  return m_anchors[name] = ++m_curAnchor;
  426|  7.93k|}
_ZNK4YAML15SingleDocParser12LookupAnchorERKNS_4MarkERKNSt3__112basic_stringIcNS4_11char_traitsIcEENS4_9allocatorIcEEEE:
  429|  1.25k|                                       const std::string& name) const {
  430|  1.25k|  auto it = m_anchors.find(name);
  431|  1.25k|  if (it == m_anchors.end()) {
  ------------------
  |  Branch (431:7): [True: 335, False: 920]
  ------------------
  432|    335|    std::stringstream ss;
  433|    335|    ss << ErrorMsg::UNKNOWN_ANCHOR << name;
  434|    335|    throw ParserException(mark, ss.str());
  435|    335|  }
  436|       |
  437|    920|  return it->second;
  438|  1.25k|}

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

_ZNK4YAML6StreamntEv:
   35|   151M|  bool operator!() const { return !static_cast<bool>(*this); }
_ZN4YAML6Stream3eofEv:
   42|  67.4M|  static char eof() { return 0x04; }
_ZNK4YAML6Stream4markEv:
   44|   169M|  const Mark mark() const { return m_mark; }
_ZNK4YAML6Stream3posEv:
   45|  1.80M|  int pos() const { return m_mark.pos; }
_ZNK4YAML6Stream4lineEv:
   46|  1.82M|  int line() const { return m_mark.line; }
_ZNK4YAML6Stream6columnEv:
   47|   294M|  int column() const { return m_mark.column; }
_ZN4YAML6Stream11ResetColumnEv:
   48|  5.16k|  void ResetColumn() { m_mark.column = 0; }
_ZNK4YAML6Stream6CharAtEm:
   75|  1.83G|inline char Stream::CharAt(size_t i) const { return m_readahead[i]; }
_ZNK4YAML6Stream11ReadAheadToEm:
   77|  1.33G|inline bool Stream::ReadAheadTo(size_t i) const {
   78|  1.33G|  if (m_readahead.size() > i)
  ------------------
  |  Branch (78:7): [True: 1.18G, False: 152M]
  ------------------
   79|  1.18G|    return true;
   80|   152M|  return _ReadAheadTo(i);
   81|  1.33G|}

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

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

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

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

