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

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

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

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

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

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

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

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

_ZN4YAML6detail8node_refC2Ev:
   28|  2.86M|  node_ref() : m_pData(std::make_shared<node_data>()) {}
_ZNK4YAML6detail8node_ref10is_definedEv:
   32|  8.66M|  bool is_defined() const { return m_pData->is_defined(); }
_ZNK4YAML6detail8node_ref4typeEv:
   34|  5.32M|  NodeType::value type() const { return m_pData->type(); }
_ZNK4YAML6detail8node_ref6scalarEv:
   35|  1.53M|  const std::string& scalar() const { return m_pData->scalar(); }
_ZN4YAML6detail8node_ref12mark_definedEv:
   39|  2.86M|  void mark_defined() { m_pData->mark_defined(); }
_ZN4YAML6detail8node_ref8set_markERKNS_4MarkE:
   42|  2.86M|  void set_mark(const Mark& mark) { m_pData->set_mark(mark); }
_ZN4YAML6detail8node_ref8set_typeENS_8NodeType5valueE:
   43|   166k|  void set_type(NodeType::value type) { m_pData->set_type(type); }
_ZN4YAML6detail8node_ref7set_tagERKNSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEE:
   44|   432k|  void set_tag(const std::string& tag) { m_pData->set_tag(tag); }
_ZN4YAML6detail8node_ref8set_nullEv:
   45|  2.43M|  void set_null() { m_pData->set_null(); }
_ZN4YAML6detail8node_ref10set_scalarERKNSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEE:
   46|   266k|  void set_scalar(const std::string& scalar) { m_pData->set_scalar(scalar); }
_ZN4YAML6detail8node_ref9set_styleENS_12EmitterStyle5valueE:
   47|   166k|  void set_style(EmitterStyle::value style) { m_pData->set_style(style); }
_ZN4YAML6detail8node_ref9push_backERNS0_4nodeENSt3__110shared_ptrINS0_13memory_holderEEE:
   63|  1.48M|  void push_back(node& node, shared_memory_holder pMemory) {
   64|  1.48M|    m_pData->push_back(node, pMemory);
   65|  1.48M|  }
_ZN4YAML6detail8node_ref6insertERNS0_4nodeES3_NSt3__110shared_ptrINS0_13memory_holderEEE:
   66|   369k|  void insert(node& key, node& value, shared_memory_holder pMemory) {
   67|   369k|    m_pData->insert(key, value, pMemory);
   68|   369k|  }

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

_ZN4YAML9ExceptionD2Ev:
   24|  3.70k|    #define YAML_CPP_NOEXCEPT noexcept

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

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

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

_ZN4YAML3Exp8ParseHexERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERKNS_4MarkE:
   13|  1.62k|unsigned ParseHex(const std::string& str, const Mark& mark) {
   14|  1.62k|  unsigned value = 0;
   15|  7.24k|  for (char ch : str) {
  ------------------
  |  Branch (15:16): [True: 7.24k, False: 1.53k]
  ------------------
   16|  7.24k|    int digit = 0;
   17|  7.24k|    if ('a' <= ch && ch <= 'f')
  ------------------
  |  Branch (17:9): [True: 1.12k, False: 6.12k]
  |  Branch (17:22): [True: 1.11k, False: 5]
  ------------------
   18|  1.11k|      digit = ch - 'a' + 10;
   19|  6.12k|    else if ('A' <= ch && ch <= 'F')
  ------------------
  |  Branch (19:14): [True: 1.96k, False: 4.16k]
  |  Branch (19:27): [True: 1.95k, False: 10]
  ------------------
   20|  1.95k|      digit = ch - 'A' + 10;
   21|  4.17k|    else if ('0' <= ch && ch <= '9')
  ------------------
  |  Branch (21:14): [True: 4.10k, False: 72]
  |  Branch (21:27): [True: 4.09k, False: 13]
  ------------------
   22|  4.09k|      digit = ch - '0';
   23|     85|    else
   24|     85|      throw ParserException(mark, ErrorMsg::INVALID_HEX);
   25|       |
   26|  7.15k|    value = (value << 4) + digit;
   27|  7.15k|  }
   28|       |
   29|  1.53k|  return value;
   30|  1.62k|}
_ZN4YAML3Exp3StrEj:
   32|  3.95k|std::string Str(unsigned ch) { return std::string(1, static_cast<char>(ch)); }
_ZN4YAML3Exp6EscapeERNS_6StreamEi:
   38|  1.62k|std::string Escape(Stream& in, int codeLength) {
   39|       |  // grab string
   40|  1.62k|  std::string str;
   41|  9.20k|  for (int i = 0; i < codeLength; i++)
  ------------------
  |  Branch (41:19): [True: 7.58k, False: 1.62k]
  ------------------
   42|  7.58k|    str += in.get();
   43|       |
   44|       |  // get the value
   45|  1.62k|  unsigned value = ParseHex(str, in.mark());
   46|       |
   47|       |  // legal unicode?
   48|  1.62k|  if ((value >= 0xD800 && value <= 0xDFFF) || value > 0x10FFFF) {
  ------------------
  |  Branch (48:8): [True: 627, False: 996]
  |  Branch (48:27): [True: 14, False: 613]
  |  Branch (48:47): [True: 39, False: 1.48k]
  ------------------
   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.57k|  if (value <= 0x7F)
  ------------------
  |  Branch (55:7): [True: 263, False: 1.30k]
  ------------------
   56|    263|    return Str(value);
   57|       |
   58|  1.30k|  if (value <= 0x7FF)
  ------------------
  |  Branch (58:7): [True: 283, False: 1.02k]
  ------------------
   59|    283|    return Str(0xC0 + (value >> 6)) + Str(0x80 + (value & 0x3F));
   60|       |
   61|  1.02k|  if (value <= 0xFFFF)
  ------------------
  |  Branch (61:7): [True: 630, False: 394]
  ------------------
   62|    630|    return Str(0xE0 + (value >> 12)) + Str(0x80 + ((value >> 6) & 0x3F)) +
   63|    630|           Str(0x80 + (value & 0x3F));
   64|       |
   65|    394|  return Str(0xF0 + (value >> 18)) + Str(0x80 + ((value >> 12) & 0x3F)) +
   66|    394|         Str(0x80 + ((value >> 6) & 0x3F)) + Str(0x80 + (value & 0x3F));
   67|  1.02k|}
_ZN4YAML3Exp6EscapeERNS_6StreamE:
   74|  41.3k|std::string Escape(Stream& in) {
   75|       |  // eat slash
   76|  41.3k|  char escape = in.get();
   77|       |
   78|       |  // switch on escape character
   79|  41.3k|  char ch = in.get();
   80|       |
   81|       |  // first do single quote, since it's easier
   82|  41.3k|  if (escape == '\'' && ch == '\'')
  ------------------
  |  Branch (82:7): [True: 678, False: 40.6k]
  |  Branch (82:25): [True: 678, False: 0]
  ------------------
   83|    678|    return "\'";
   84|       |
   85|       |  // now do the slash (we're not gonna check if it's a slash - you better pass
   86|       |  // one!)
   87|  40.6k|  switch (ch) {
  ------------------
  |  Branch (87:11): [True: 40.3k, False: 247]
  ------------------
   88|    592|    case '0':
  ------------------
  |  Branch (88:5): [True: 592, False: 40.0k]
  ------------------
   89|    592|      return std::string(1, '\x00');
   90|    202|    case 'a':
  ------------------
  |  Branch (90:5): [True: 202, False: 40.4k]
  ------------------
   91|    202|      return "\x07";
   92|    820|    case 'b':
  ------------------
  |  Branch (92:5): [True: 820, False: 39.8k]
  ------------------
   93|    820|      return "\x08";
   94|    724|    case 't':
  ------------------
  |  Branch (94:5): [True: 724, False: 39.9k]
  ------------------
   95|  5.28k|    case '\t':
  ------------------
  |  Branch (95:5): [True: 4.55k, False: 36.0k]
  ------------------
   96|  5.28k|      return "\x09";
   97|  8.28k|    case 'n':
  ------------------
  |  Branch (97:5): [True: 8.28k, False: 32.3k]
  ------------------
   98|  8.28k|      return "\x0A";
   99|    383|    case 'v':
  ------------------
  |  Branch (99:5): [True: 383, False: 40.2k]
  ------------------
  100|    383|      return "\x0B";
  101|    326|    case 'f':
  ------------------
  |  Branch (101:5): [True: 326, False: 40.3k]
  ------------------
  102|    326|      return "\x0C";
  103|    194|    case 'r':
  ------------------
  |  Branch (103:5): [True: 194, False: 40.4k]
  ------------------
  104|    194|      return "\x0D";
  105|    597|    case 'e':
  ------------------
  |  Branch (105:5): [True: 597, False: 40.0k]
  ------------------
  106|    597|      return "\x1B";
  107|    337|    case ' ':
  ------------------
  |  Branch (107:5): [True: 337, False: 40.2k]
  ------------------
  108|    337|      return R"( )";
  109|  6.53k|    case '\"':
  ------------------
  |  Branch (109:5): [True: 6.53k, False: 34.0k]
  ------------------
  110|  6.53k|      return "\"";
  111|    329|    case '\'':
  ------------------
  |  Branch (111:5): [True: 329, False: 40.2k]
  ------------------
  112|    329|      return "\'";
  113|    699|    case '\\':
  ------------------
  |  Branch (113:5): [True: 699, False: 39.9k]
  ------------------
  114|    699|      return "\\";
  115|    616|    case '/':
  ------------------
  |  Branch (115:5): [True: 616, False: 40.0k]
  ------------------
  116|    616|      return "/";
  117|    686|    case 'N':
  ------------------
  |  Branch (117:5): [True: 686, False: 39.9k]
  ------------------
  118|    686|      return "\xC2\x85";      // NEL (U+0085)
  119|    224|    case '_':
  ------------------
  |  Branch (119:5): [True: 224, False: 40.4k]
  ------------------
  120|    224|      return "\xC2\xA0";      // NBSP (U+00A0)
  121|  11.1k|    case 'L':
  ------------------
  |  Branch (121:5): [True: 11.1k, False: 29.4k]
  ------------------
  122|  11.1k|      return "\xE2\x80\xA8";  // LS (U+2028)
  123|  1.49k|    case 'P':
  ------------------
  |  Branch (123:5): [True: 1.49k, False: 39.1k]
  ------------------
  124|  1.49k|      return "\xE2\x80\xA9";  // PS (U+2029)
  125|    516|    case 'x':
  ------------------
  |  Branch (125:5): [True: 516, False: 40.1k]
  ------------------
  126|    516|      return Escape(in, 2);
  127|    576|    case 'u':
  ------------------
  |  Branch (127:5): [True: 576, False: 40.0k]
  ------------------
  128|    576|      return Escape(in, 4);
  129|    531|    case 'U':
  ------------------
  |  Branch (129:5): [True: 531, False: 40.0k]
  ------------------
  130|    531|      return Escape(in, 8);
  131|  40.6k|  }
  132|       |
  133|    247|  std::stringstream msg;
  134|    247|  throw ParserException(in.mark(), std::string(ErrorMsg::INVALID_ESCAPE) + ch);
  135|  40.6k|}

_ZN4YAML3Exp8DocStartEv:
   84|  1.82M|inline const RegEx& DocStart() {
   85|  1.82M|  static const RegEx e = RegEx("---") + (BlankOrBreak() | RegEx());
   86|  1.82M|  return e;
   87|  1.82M|}
_ZN4YAML3Exp12BlankOrBreakEv:
   43|  38.4M|inline const RegEx& BlankOrBreak() {
   44|  38.4M|  static const RegEx e = Blank() | Break();
   45|  38.4M|  return e;
   46|  38.4M|}
_ZN4YAML3Exp5BlankEv:
   35|  40.5M|inline const RegEx& Blank() {
   36|  40.5M|  static const RegEx e = Space() | Tab();
   37|  40.5M|  return e;
   38|  40.5M|}
_ZN4YAML3Exp5SpaceEv:
   27|      1|inline const RegEx& Space() {
   28|      1|  static const RegEx e = RegEx(' ');
   29|      1|  return e;
   30|      1|}
_ZN4YAML3Exp6DocEndEv:
   88|  1.56M|inline const RegEx& DocEnd() {
   89|  1.56M|  static const RegEx e = RegEx("...") + (BlankOrBreak() | RegEx());
   90|  1.56M|  return e;
   91|  1.56M|}
_ZN4YAML3Exp10BlockEntryEv:
   96|  10.4M|inline const RegEx& BlockEntry() {
   97|  10.4M|  static const RegEx e = RegEx('-') + (BlankOrBreak() | RegEx());
   98|  10.4M|  return e;
   99|  10.4M|}
_ZN4YAML3Exp3KeyEv:
  100|  7.23M|inline const RegEx& Key() {
  101|  7.23M|  static const RegEx e = RegEx('?') + BlankOrBreak();
  102|  7.23M|  return e;
  103|  7.23M|}
_ZN4YAML3Exp9KeyInFlowEv:
  104|  1.74M|inline const RegEx& KeyInFlow() {
  105|  1.74M|  static const RegEx e = RegEx('?') + BlankOrBreak();
  106|  1.74M|  return e;
  107|  1.74M|}
_ZN4YAML3Exp11PlainScalarEv:
  153|   872k|inline const RegEx& PlainScalar() {
  154|   872k|  static const RegEx e =
  155|   872k|      !(BlankOrBreak() | RegEx(",[]{}#&*!|>\'\"%@`", REGEX_OR) |
  156|   872k|        (RegEx("-?:", REGEX_OR) + (BlankOrBreak() | RegEx())));
  157|   872k|  return e;
  158|   872k|}
_ZN4YAML3Exp17PlainScalarInFlowEv:
  159|  1.27M|inline const RegEx& PlainScalarInFlow() {
  160|  1.27M|  static const RegEx e =
  161|  1.27M|      !(BlankOrBreak() | RegEx("?,[]{}#&*!|>\'\"%@`", REGEX_OR) |
  162|  1.27M|        (RegEx("-:", REGEX_OR) + (Blank() | RegEx())));
  163|  1.27M|  return e;
  164|  1.27M|}
_ZN4YAML3Exp3TabEv:
   31|   113k|inline const RegEx& Tab() {
   32|   113k|  static const RegEx e = RegEx('\t');
   33|   113k|  return e;
   34|   113k|}
_ZN4YAML3Exp7CommentEv:
  124|  69.0M|inline const RegEx Comment() {
  125|  69.0M|  static const RegEx e = RegEx('#');
  126|  69.0M|  return e;
  127|  69.0M|}
_ZN4YAML3Exp5BreakEv:
   39|   214M|inline const RegEx& Break() {
   40|   214M|  static const RegEx e = RegEx('\n') | RegEx("\r\n") | RegEx('\r');
   41|   214M|  return e;
   42|   214M|}
_ZN4YAML3Exp5ValueEv:
  108|  7.22M|inline const RegEx& Value() {
  109|  7.22M|  static const RegEx e = RegEx(':') + (BlankOrBreak() | RegEx());
  110|  7.22M|  return e;
  111|  7.22M|}
_ZN4YAML3Exp15ValueInJSONFlowEv:
  116|  10.2k|inline const RegEx& ValueInJSONFlow() {
  117|  10.2k|  static const RegEx e = RegEx(':');
  118|  10.2k|  return e;
  119|  10.2k|}
_ZN4YAML3Exp11ValueInFlowEv:
  112|  1.71M|inline const RegEx& ValueInFlow() {
  113|  1.71M|  static const RegEx e = RegEx(':') + (BlankOrBreak() | RegEx(",]}", REGEX_OR));
  114|  1.71M|  return e;
  115|  1.71M|}
_ZN4YAML3Exp5EmptyEv:
   23|  3.24k|inline const RegEx& Empty() {
   24|  3.24k|  static const RegEx e;
   25|  3.24k|  return e;
   26|  3.24k|}
_ZN4YAML3Exp5DigitEv:
   47|    387|inline const RegEx& Digit() {
   48|    387|  static const RegEx e = RegEx('0', '9');
   49|    387|  return e;
   50|    387|}
_ZN4YAML3Exp5AlphaEv:
   51|      1|inline const RegEx& Alpha() {
   52|      1|  static const RegEx e = RegEx('a', 'z') | RegEx('A', 'Z');
   53|      1|  return e;
   54|      1|}
_ZN4YAML3Exp12AlphaNumericEv:
   55|      1|inline const RegEx& AlphaNumeric() {
   56|      1|  static const RegEx e = Alpha() | Digit();
   57|      1|  return e;
   58|      1|}
_ZN4YAML3Exp4WordEv:
   59|  7.53M|inline const RegEx& Word() {
   60|  7.53M|  static const RegEx e = AlphaNumeric() | RegEx('-');
   61|  7.53M|  return e;
   62|  7.53M|}
_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|  5.06M|inline const RegEx& DocIndicator() {
   93|  5.06M|  static const RegEx e = DocStart() | DocEnd();
   94|  5.06M|  return e;
   95|  5.06M|}
_ZN4YAML3Exp6AnchorEv:
  128|  31.0M|inline const RegEx& Anchor() {
  129|  31.0M|  static const RegEx e = !(RegEx("[]{},", REGEX_OR) | BlankOrBreak());
  130|  31.0M|  return e;
  131|  31.0M|}
_ZN4YAML3Exp9AnchorEndEv:
  132|   421k|inline const RegEx& AnchorEnd() {
  133|   421k|  static const RegEx e = RegEx("?:,]}%@`", REGEX_OR) | BlankOrBreak();
  134|   421k|  return e;
  135|   421k|}
_ZN4YAML3Exp3URIEv:
  136|  8.99k|inline const RegEx& URI() {
  137|  8.99k|  static const RegEx e = Word() | RegEx("#;/?:@&=+$,_.!~*'()[]", REGEX_OR) |
  138|  8.99k|                         (RegEx('%') + Hex() + Hex());
  139|  8.99k|  return e;
  140|  8.99k|}
_ZN4YAML3Exp3TagEv:
  141|  1.91M|inline const RegEx& Tag() {
  142|  1.91M|  static const RegEx e = Word() | RegEx("#;/?:@&=+$_.~*'()", REGEX_OR) |
  143|  1.91M|                         (RegEx('%') + Hex() + Hex());
  144|  1.91M|  return e;
  145|  1.91M|}
_ZN4YAML3Exp9EndScalarEv:
  165|      1|inline const RegEx& EndScalar() {
  166|      1|  static const RegEx e = RegEx(':') + (BlankOrBreak() | RegEx());
  167|      1|  return e;
  168|      1|}
_ZN4YAML3Exp15EndScalarInFlowEv:
  169|      1|inline const RegEx& EndScalarInFlow() {
  170|      1|  static const RegEx e =
  171|      1|      (RegEx(':') + (BlankOrBreak() | RegEx() | RegEx(",]}", REGEX_OR))) |
  172|      1|      RegEx(",?[]{}", REGEX_OR);
  173|      1|  return e;
  174|      1|}
_ZN4YAML3Exp19ScanScalarEndInFlowEv:
  176|  1.27M|inline const RegEx& ScanScalarEndInFlow() {
  177|  1.27M|  static const RegEx e = (EndScalarInFlow() | (BlankOrBreak() + Comment()));
  178|  1.27M|  return e;
  179|  1.27M|}
_ZN4YAML3Exp13ScanScalarEndEv:
  181|   872k|inline const RegEx& ScanScalarEnd() {
  182|   872k|  static const RegEx e = EndScalar() | (BlankOrBreak() + Comment());
  183|   872k|  return e;
  184|   872k|}
_ZN4YAML3Exp14EscSingleQuoteEv:
  185|  1.87k|inline const RegEx& EscSingleQuote() {
  186|  1.87k|  static const RegEx e = RegEx("\'\'");
  187|  1.87k|  return e;
  188|  1.87k|}
_ZN4YAML3Exp8EscBreakEv:
  189|  11.2M|inline const RegEx& EscBreak() {
  190|  11.2M|  static const RegEx e = RegEx('\\') + Break();
  191|  11.2M|  return e;
  192|  11.2M|}
_ZN4YAML3Exp14ChompIndicatorEv:
  194|      3|inline const RegEx& ChompIndicator() {
  195|      3|  static const RegEx e = RegEx("+-", REGEX_OR);
  196|      3|  return e;
  197|      3|}
_ZN4YAML3Exp5ChompEv:
  198|  3.29k|inline const RegEx& Chomp() {
  199|  3.29k|  static const RegEx e = (ChompIndicator() + Digit()) |
  200|  3.29k|                         (Digit() + ChompIndicator()) | ChompIndicator() |
  201|  3.29k|                         Digit();
  202|  3.29k|  return e;
  203|  3.29k|}

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

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

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

_ZN4YAML12IsNullStringEPKcm:
   13|   291k|bool IsNullString(const char* str, std::size_t size) {
   14|   291k|  return size == 0 || same(str, size, "~") || same(str, size, "null") ||
  ------------------
  |  Branch (14:10): [True: 0, False: 291k]
  |  Branch (14:23): [True: 30.5k, False: 260k]
  |  Branch (14:47): [True: 195, False: 260k]
  ------------------
   15|   260k|         same(str, size, "Null") || same(str, size, "NULL");
  ------------------
  |  Branch (15:10): [True: 240, False: 260k]
  |  Branch (15:37): [True: 1, False: 260k]
  ------------------
   16|   291k|}
null.cpp:_ZN4YAMLL4sameILm2EEEbPKcmRAT__S1_:
    8|   291k|static bool same(const char* str, std::size_t size, const char (&literal)[N]) {
    9|   291k|  constexpr int literalSize = N - 1; // minus null terminator
   10|   291k|  return size == literalSize && std::strncmp(str, literal, literalSize) == 0;
  ------------------
  |  Branch (10:10): [True: 267k, False: 24.1k]
  |  Branch (10:33): [True: 30.5k, False: 236k]
  ------------------
   11|   291k|}
null.cpp:_ZN4YAMLL4sameILm5EEEbPKcmRAT__S1_:
    8|   782k|static bool same(const char* str, std::size_t size, const char (&literal)[N]) {
    9|   782k|  constexpr int literalSize = N - 1; // minus null terminator
   10|   782k|  return size == literalSize && std::strncmp(str, literal, literalSize) == 0;
  ------------------
  |  Branch (10:10): [True: 13.0k, False: 769k]
  |  Branch (10:33): [True: 436, False: 12.6k]
  ------------------
   11|   782k|}

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

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

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

_ZN4YAML5RegExC2ENS_8REGEX_OPE:
    6|  3.81k|RegEx::RegEx(REGEX_OP op) : m_op(op), m_a(0), m_z(0), m_params{} {}
_ZN4YAML5RegExC2Ev:
    7|      9|RegEx::RegEx() : RegEx(REGEX_EMPTY) {}
_ZN4YAML5RegExC2Ec:
    9|  7.99k|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.87k|RegEx operator!(const RegEx& ex) {
   18|  1.87k|  RegEx ret(REGEX_NOT);
   19|  1.87k|  ret.m_params.push_back(ex);
   20|  1.87k|  return ret;
   21|  1.87k|}
_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.87k|RegEx operator&(const RegEx& ex1, const RegEx& ex2) {
   31|  1.87k|  RegEx ret(REGEX_AND);
   32|  1.87k|  ret.m_params.push_back(ex1);
   33|  1.87k|  ret.m_params.push_back(ex2);
   34|  1.87k|  return ret;
   35|  1.87k|}
_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|  69.0M|  ~RegEx() = default;

_ZNK4YAML5RegEx7MatchesERKNS_6StreamE:
   26|   515M|inline bool RegEx::Matches(const Stream& in) const { return Match(in) >= 0; }
_ZNK4YAML5RegEx5MatchERKNS_6StreamE:
   49|   570M|inline int RegEx::Match(const Stream& in) const {
   50|   570M|  StreamCharSource source(in);
   51|   570M|  return Match(source);
   52|   570M|}
_ZNK4YAML5RegEx5MatchINS_16StreamCharSourceEEEiRKT_:
   72|  1.18G|inline int RegEx::Match(const Source& source) const {
   73|  1.18G|  return IsValidSource(source) ? MatchUnchecked(source) : -1;
  ------------------
  |  Branch (73:10): [True: 1.18G, False: 0]
  ------------------
   74|  1.18G|}
_ZNK4YAML5RegEx13IsValidSourceINS_16StreamCharSourceEEEbRKT_:
   55|  1.18G|inline bool RegEx::IsValidSource(const Source& source) const {
   56|  1.18G|  return source;
   57|  1.18G|}
_ZNK4YAML5RegEx14MatchUncheckedINS_16StreamCharSourceEEEiRKT_:
   77|  3.79G|inline int RegEx::MatchUnchecked(const Source& source) const {
   78|  3.79G|  switch (m_op) {
  ------------------
  |  Branch (78:11): [True: 3.79G, False: 0]
  ------------------
   79|  25.1M|    case REGEX_EMPTY:
  ------------------
  |  Branch (79:5): [True: 25.1M, False: 3.76G]
  ------------------
   80|  25.1M|      return MatchOpEmpty(source);
   81|  1.94G|    case REGEX_MATCH:
  ------------------
  |  Branch (81:5): [True: 1.94G, False: 1.84G]
  ------------------
   82|  1.94G|      return MatchOpMatch(source);
   83|  19.5M|    case REGEX_RANGE:
  ------------------
  |  Branch (83:5): [True: 19.5M, False: 3.77G]
  ------------------
   84|  19.5M|      return MatchOpRange(source);
   85|  1.22G|    case REGEX_OR:
  ------------------
  |  Branch (85:5): [True: 1.22G, False: 2.56G]
  ------------------
   86|  1.22G|      return MatchOpOr(source);
   87|  17.6M|    case REGEX_AND:
  ------------------
  |  Branch (87:5): [True: 17.6M, False: 3.77G]
  ------------------
   88|  17.6M|      return MatchOpAnd(source);
   89|  33.2M|    case REGEX_NOT:
  ------------------
  |  Branch (89:5): [True: 33.2M, False: 3.76G]
  ------------------
   90|  33.2M|      return MatchOpNot(source);
   91|   523M|    case REGEX_SEQ:
  ------------------
  |  Branch (91:5): [True: 523M, False: 3.27G]
  ------------------
   92|   523M|      return MatchOpSeq(source);
   93|  3.79G|  }
   94|       |
   95|      0|  return -1;
   96|  3.79G|}
_ZNK4YAML5RegEx12MatchOpEmptyINS_16StreamCharSourceEEEiRKT_:
  106|  25.1M|inline int RegEx::MatchOpEmpty(const Source& source) const {
  107|  25.1M|  return source[0] == Stream::eof() ? 0 : -1;
  ------------------
  |  Branch (107:10): [True: 1.36M, False: 23.7M]
  ------------------
  108|  25.1M|}
_ZNK4YAML5RegEx12MatchOpMatchINS_16StreamCharSourceEEEiRKT_:
  119|  1.94G|inline int RegEx::MatchOpMatch(const Source& source) const {
  120|  1.94G|  if (source[0] != m_a)
  ------------------
  |  Branch (120:7): [True: 1.76G, False: 179M]
  ------------------
  121|  1.76G|    return -1;
  122|   179M|  return 1;
  123|  1.94G|}
_ZNK4YAML5RegEx12MatchOpRangeINS_16StreamCharSourceEEEiRKT_:
  127|  19.5M|inline int RegEx::MatchOpRange(const Source& source) const {
  128|  19.5M|  if (m_a > source[0] || m_z < source[0])
  ------------------
  |  Branch (128:7): [True: 15.0M, False: 4.56M]
  |  Branch (128:26): [True: 69.6k, False: 4.49M]
  ------------------
  129|  15.0M|    return -1;
  130|  4.49M|  return 1;
  131|  19.5M|}
_ZNK4YAML5RegEx9MatchOpOrINS_16StreamCharSourceEEEiRKT_:
  135|  1.22G|inline int RegEx::MatchOpOr(const Source& source) const {
  136|  2.55G|  for (const RegEx& param : m_params) {
  ------------------
  |  Branch (136:27): [True: 2.55G, False: 1.05G]
  ------------------
  137|  2.55G|    int n = param.MatchUnchecked(source);
  138|  2.55G|    if (n >= 0)
  ------------------
  |  Branch (138:9): [True: 178M, False: 2.37G]
  ------------------
  139|   178M|      return n;
  140|  2.55G|  }
  141|  1.05G|  return -1;
  142|  1.22G|}
_ZNK4YAML5RegEx10MatchOpAndINS_16StreamCharSourceEEEiRKT_:
  149|  17.6M|inline int RegEx::MatchOpAnd(const Source& source) const {
  150|  17.6M|  int first = -1;
  151|  17.6M|  for (std::size_t i = 0; i < m_params.size(); i++) {
  ------------------
  |  Branch (151:27): [True: 17.6M, False: 3.44k]
  ------------------
  152|  17.6M|    int n = m_params[i].MatchUnchecked(source);
  153|  17.6M|    if (n == -1)
  ------------------
  |  Branch (153:9): [True: 17.6M, False: 7.57k]
  ------------------
  154|  17.6M|      return -1;
  155|  7.57k|    if (i == 0)
  ------------------
  |  Branch (155:9): [True: 4.12k, False: 3.44k]
  ------------------
  156|  4.12k|      first = n;
  157|  7.57k|  }
  158|  3.44k|  return first;
  159|  17.6M|}
_ZNK4YAML5RegEx10MatchOpNotINS_16StreamCharSourceEEEiRKT_:
  163|  33.2M|inline int RegEx::MatchOpNot(const Source& source) const {
  164|  33.2M|  if (m_params.empty())
  ------------------
  |  Branch (164:7): [True: 0, False: 33.2M]
  ------------------
  165|      0|    return -1;
  166|  33.2M|  if (m_params[0].MatchUnchecked(source) >= 0)
  ------------------
  |  Branch (166:7): [True: 422k, False: 32.8M]
  ------------------
  167|   422k|    return -1;
  168|  32.8M|  return 1;
  169|  33.2M|}
_ZNK4YAML5RegEx10MatchOpSeqINS_16StreamCharSourceEEEiRKT_:
  173|   523M|inline int RegEx::MatchOpSeq(const Source& source) const {
  174|   523M|  int offset = 0;
  175|   618M|  for (const RegEx& param : m_params) {
  ------------------
  |  Branch (175:27): [True: 618M, False: 8.89M]
  ------------------
  176|   618M|    int n = param.Match(source + offset);  // note Match, not
  177|       |                                           // MatchUnchecked because we
  178|       |                                           // need to check validity after
  179|       |                                           // the offset
  180|   618M|    if (n == -1)
  ------------------
  |  Branch (180:9): [True: 515M, False: 103M]
  ------------------
  181|   515M|      return -1;
  182|   103M|    offset += n;
  183|   103M|  }
  184|       |
  185|  8.89M|  return offset;
  186|   523M|}
_ZNK4YAML5RegEx7MatchesEc:
   16|    382|inline bool RegEx::Matches(char ch) const {
   17|    382|  std::string str;
   18|    382|  str += ch;
   19|    382|  return Matches(str);
   20|    382|}
_ZNK4YAML5RegEx7MatchesERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
   22|    382|inline bool RegEx::Matches(const std::string& str) const {
   23|    382|  return Match(str) >= 0;
   24|    382|}
_ZNK4YAML5RegEx5MatchERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
   44|    382|inline int RegEx::Match(const std::string& str) const {
   45|    382|  StringCharSource source(str.c_str(), str.size());
   46|    382|  return Match(source);
   47|    382|}
_ZNK4YAML5RegEx13IsValidSourceINS_16StringCharSourceEEEbRKT_:
   61|    382|    const StringCharSource& source) const {
   62|    382|  switch (m_op) {
   63|      0|    case REGEX_MATCH:
  ------------------
  |  Branch (63:5): [True: 0, False: 382]
  ------------------
   64|    382|    case REGEX_RANGE:
  ------------------
  |  Branch (64:5): [True: 382, False: 0]
  ------------------
   65|    382|      return source;
   66|      0|    default:
  ------------------
  |  Branch (66:5): [True: 0, False: 382]
  ------------------
   67|      0|      return true;
   68|    382|  }
   69|    382|}
_ZNK4YAML5RegEx5MatchINS_16StringCharSourceEEEiRKT_:
   72|    382|inline int RegEx::Match(const Source& source) const {
   73|    382|  return IsValidSource(source) ? MatchUnchecked(source) : -1;
  ------------------
  |  Branch (73:10): [True: 382, False: 0]
  ------------------
   74|    382|}
_ZNK4YAML5RegEx14MatchUncheckedINS_16StringCharSourceEEEiRKT_:
   77|    382|inline int RegEx::MatchUnchecked(const Source& source) const {
   78|    382|  switch (m_op) {
  ------------------
  |  Branch (78:11): [True: 382, False: 0]
  ------------------
   79|      0|    case REGEX_EMPTY:
  ------------------
  |  Branch (79:5): [True: 0, False: 382]
  ------------------
   80|      0|      return MatchOpEmpty(source);
   81|      0|    case REGEX_MATCH:
  ------------------
  |  Branch (81:5): [True: 0, False: 382]
  ------------------
   82|      0|      return MatchOpMatch(source);
   83|    382|    case REGEX_RANGE:
  ------------------
  |  Branch (83:5): [True: 382, False: 0]
  ------------------
   84|    382|      return MatchOpRange(source);
   85|      0|    case REGEX_OR:
  ------------------
  |  Branch (85:5): [True: 0, False: 382]
  ------------------
   86|      0|      return MatchOpOr(source);
   87|      0|    case REGEX_AND:
  ------------------
  |  Branch (87:5): [True: 0, False: 382]
  ------------------
   88|      0|      return MatchOpAnd(source);
   89|      0|    case REGEX_NOT:
  ------------------
  |  Branch (89:5): [True: 0, False: 382]
  ------------------
   90|      0|      return MatchOpNot(source);
   91|      0|    case REGEX_SEQ:
  ------------------
  |  Branch (91:5): [True: 0, False: 382]
  ------------------
   92|      0|      return MatchOpSeq(source);
   93|    382|  }
   94|       |
   95|      0|  return -1;
   96|    382|}
_ZNK4YAML5RegEx12MatchOpRangeINS_16StringCharSourceEEEiRKT_:
  127|    382|inline int RegEx::MatchOpRange(const Source& source) const {
  128|    382|  if (m_a > source[0] || m_z < source[0])
  ------------------
  |  Branch (128:7): [True: 0, False: 382]
  |  Branch (128:26): [True: 0, False: 382]
  ------------------
  129|      0|    return -1;
  130|    382|  return 1;
  131|    382|}

_ZN4YAML7ScannerC2ERNSt3__113basic_istreamIcNS1_11char_traitsIcEEEE:
   24|  6.67k|    : INPUT(in),
   25|  6.67k|      m_tokens{},
   26|  6.67k|      m_startedStream(false),
   27|  6.67k|      m_endedStream(false),
   28|  6.67k|      m_simpleKeyAllowed(false),
   29|  6.67k|      m_scalarValueAllowed(false),
   30|  6.67k|      m_canBeJSONFlow(false),
   31|  6.67k|      m_simpleKeys{},
   32|  6.67k|      m_indents{},
   33|  6.67k|      m_indentRefs{},
   34|  6.67k|      m_flows{} {}
_ZN4YAML7ScannerD2Ev:
   36|  6.67k|Scanner::~Scanner() = default;
_ZN4YAML7Scanner5emptyEv:
   38|  13.9M|bool Scanner::empty() {
   39|  13.9M|  EnsureTokensInQueue();
   40|  13.9M|  return m_tokens.empty();
   41|  13.9M|}
_ZN4YAML7Scanner3popEv:
   43|  3.42M|void Scanner::pop() {
   44|  3.42M|  EnsureTokensInQueue();
   45|  3.42M|  if (!m_tokens.empty())
  ------------------
  |  Branch (45:7): [True: 3.42M, False: 0]
  ------------------
   46|  3.42M|    m_tokens.pop();
   47|  3.42M|}
_ZN4YAML7Scanner4peekEv:
   49|  20.3M|Token& Scanner::peek() {
   50|  20.3M|  EnsureTokensInQueue();
   51|  20.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|  20.3M|  return m_tokens.front();
   63|  20.3M|}
_ZNK4YAML7Scanner4markEv:
   65|  2.25M|Mark Scanner::mark() const { return INPUT.mark(); }
_ZN4YAML7Scanner19EnsureTokensInQueueEv:
   67|  37.6M|void Scanner::EnsureTokensInQueue() {
   68|  98.8M|  while (true) {
  ------------------
  |  Branch (68:10): [True: 98.8M, Folded]
  ------------------
   69|  98.8M|    if (!m_tokens.empty()) {
  ------------------
  |  Branch (69:9): [True: 97.9M, False: 830k]
  ------------------
   70|  97.9M|      Token& token = m_tokens.front();
   71|       |
   72|       |      // if this guy's valid, then we're done
   73|  97.9M|      if (token.status == Token::VALID) {
  ------------------
  |  Branch (73:11): [True: 36.9M, False: 61.0M]
  ------------------
   74|  36.9M|        return;
   75|  36.9M|      }
   76|       |
   77|       |      // here's where we clean up the impossible tokens
   78|  61.0M|      if (token.status == Token::INVALID) {
  ------------------
  |  Branch (78:11): [True: 441k, False: 60.5M]
  ------------------
   79|   441k|        m_tokens.pop();
   80|   441k|        continue;
   81|   441k|      }
   82|       |
   83|       |      // note: what's left are the unverified tokens
   84|  61.0M|    }
   85|       |
   86|       |    // no token? maybe we've actually finished
   87|  61.3M|    if (m_endedStream) {
  ------------------
  |  Branch (87:9): [True: 689k, False: 60.7M]
  ------------------
   88|   689k|      return;
   89|   689k|    }
   90|       |
   91|       |    // no? then scan...
   92|  60.7M|    ScanNextToken();
   93|  60.7M|  }
   94|  37.6M|}
_ZN4YAML7Scanner13ScanNextTokenEv:
   96|  60.7M|void Scanner::ScanNextToken() {
   97|  60.7M|  if (m_endedStream) {
  ------------------
  |  Branch (97:7): [True: 0, False: 60.7M]
  ------------------
   98|      0|    return;
   99|      0|  }
  100|       |
  101|  60.7M|  if (!m_startedStream) {
  ------------------
  |  Branch (101:7): [True: 6.67k, False: 60.6M]
  ------------------
  102|  6.67k|    return StartStream();
  103|  6.67k|  }
  104|       |
  105|       |  // get rid of whitespace, etc. (in between tokens it should be irrelevant)
  106|  60.6M|  ScanToNextToken();
  107|       |
  108|       |  // maybe need to end some blocks
  109|  60.6M|  PopIndentToHere();
  110|       |
  111|       |  // *****
  112|       |  // And now branch based on the next few characters!
  113|       |  // *****
  114|       |
  115|       |  // end of stream
  116|  60.6M|  if (!INPUT) {
  ------------------
  |  Branch (116:7): [True: 5.51k, False: 60.6M]
  ------------------
  117|  5.51k|    return EndStream();
  118|  5.51k|  }
  119|       |
  120|  60.6M|  if (INPUT.column() == 0 && INPUT.peek() == Keys::Directive) {
  ------------------
  |  Branch (120:7): [True: 1.83M, False: 58.8M]
  |  Branch (120:30): [True: 11.1k, False: 1.82M]
  ------------------
  121|  11.1k|    return ScanDirective();
  122|  11.1k|  }
  123|       |
  124|       |  // document token
  125|  60.6M|  if (INPUT.column() == 0 && Exp::DocStart().Matches(INPUT)) {
  ------------------
  |  Branch (125:7): [True: 1.82M, False: 58.8M]
  |  Branch (125:30): [True: 257k, False: 1.56M]
  ------------------
  126|   257k|    return ScanDocStart();
  127|   257k|  }
  128|       |
  129|  60.4M|  if (INPUT.column() == 0 && Exp::DocEnd().Matches(INPUT)) {
  ------------------
  |  Branch (129:7): [True: 1.56M, False: 58.8M]
  |  Branch (129:30): [True: 301k, False: 1.26M]
  ------------------
  130|   301k|    return ScanDocEnd();
  131|   301k|  }
  132|       |
  133|       |  // flow start/end/entry
  134|  60.1M|  if (INPUT.peek() == Keys::FlowSeqStart ||
  ------------------
  |  Branch (134:7): [True: 32.5M, False: 27.5M]
  ------------------
  135|  46.1M|      INPUT.peek() == Keys::FlowMapStart) {
  ------------------
  |  Branch (135:7): [True: 13.5M, False: 13.9M]
  ------------------
  136|  46.1M|    return ScanFlowStart();
  137|  46.1M|  }
  138|       |
  139|  13.9M|  if (INPUT.peek() == Keys::FlowSeqEnd || INPUT.peek() == Keys::FlowMapEnd) {
  ------------------
  |  Branch (139:7): [True: 20.7k, False: 13.9M]
  |  Branch (139:43): [True: 1.22M, False: 12.7M]
  ------------------
  140|  1.25M|    return ScanFlowEnd();
  141|  1.25M|  }
  142|       |
  143|  12.7M|  if (INPUT.peek() == Keys::FlowEntry) {
  ------------------
  |  Branch (143:7): [True: 2.89M, False: 9.85M]
  ------------------
  144|       |    // values starting with `,` are not allowed.
  145|       |    // eg: reject `,foo`
  146|  2.89M|    if (INPUT.column() == 0) {
  ------------------
  |  Branch (146:9): [True: 6, False: 2.89M]
  ------------------
  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.89M|    if (!m_scalarValueAllowed) {
  ------------------
  |  Branch (152:9): [True: 2, False: 2.89M]
  ------------------
  153|      2|      throw ParserException(INPUT.mark(), ErrorMsg::UNEXPECTED_SCALAR);
  154|      2|    }
  155|  2.89M|    return ScanFlowEntry();
  156|  2.89M|  }
  157|       |
  158|       |  // block/map stuff
  159|  9.85M|  if (Exp::BlockEntry().Matches(INPUT)) {
  ------------------
  |  Branch (159:7): [True: 865k, False: 8.98M]
  ------------------
  160|   865k|    return ScanBlockEntry();
  161|   865k|  }
  162|       |
  163|  8.98M|  if ((InBlockContext() ? Exp::Key() : Exp::KeyInFlow()).Matches(INPUT)) {
  ------------------
  |  Branch (163:7): [True: 38.6k, False: 8.94M]
  |  Branch (163:8): [True: 7.23M, False: 1.74M]
  ------------------
  164|  38.6k|    return ScanKey();
  165|  38.6k|  }
  166|       |
  167|  8.94M|  if (GetValueRegex().Matches(INPUT)) {
  ------------------
  |  Branch (167:7): [True: 5.69M, False: 3.25M]
  ------------------
  168|  5.69M|    return ScanValue();
  169|  5.69M|  }
  170|       |
  171|       |  // alias/anchor
  172|  3.25M|  if (INPUT.peek() == Keys::Alias || INPUT.peek() == Keys::Anchor) {
  ------------------
  |  Branch (172:7): [True: 6.07k, False: 3.25M]
  |  Branch (172:38): [True: 416k, False: 2.83M]
  ------------------
  173|   422k|    return ScanAnchorOrAlias();
  174|   422k|  }
  175|       |
  176|       |  // tag
  177|  2.83M|  if (INPUT.peek() == Keys::Tag) {
  ------------------
  |  Branch (177:7): [True: 678k, False: 2.15M]
  ------------------
  178|   678k|    return ScanTag();
  179|   678k|  }
  180|       |
  181|       |  // special scalars
  182|  2.15M|  if (InBlockContext() && (INPUT.peek() == Keys::LiteralScalar ||
  ------------------
  |  Branch (182:7): [True: 877k, False: 1.27M]
  |  Branch (182:28): [True: 497, False: 876k]
  ------------------
  183|   876k|                           INPUT.peek() == Keys::FoldedScalar)) {
  ------------------
  |  Branch (183:28): [True: 2.80k, False: 874k]
  ------------------
  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|  3.29k|    if (!m_simpleKeys.empty() &&
  ------------------
  |  Branch (191:9): [True: 441, False: 2.85k]
  ------------------
  192|    441|      m_simpleKeys.top().pKey->status == Token::UNVERIFIED) {
  ------------------
  |  Branch (192:7): [True: 441, 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|    441|      if (m_simpleKeys.top().pIndent && !m_indents.empty() &&
  ------------------
  |  Branch (196:11): [True: 351, False: 90]
  |  Branch (196:41): [True: 351, False: 0]
  ------------------
  197|    351|          m_indents.top() == m_simpleKeys.top().pIndent) {
  ------------------
  |  Branch (197:11): [True: 351, False: 0]
  ------------------
  198|    351|        PopIndent();
  199|    351|      } else {
  200|     90|        InvalidateSimpleKey();
  201|     90|      }
  202|    441|    }
  203|  3.29k|    return ScanBlockScalar();
  204|  3.29k|  }
  205|       |
  206|       |  // if we already parsed a quoted scalar value in this line,
  207|       |  // another scalar value is an error.
  208|       |  // eg: reject `"foo" "bar"`
  209|  2.15M|  if (!m_scalarValueAllowed) {
  ------------------
  |  Branch (209:7): [True: 43, False: 2.15M]
  ------------------
  210|     43|    throw ParserException(INPUT.mark(), ErrorMsg::UNEXPECTED_SCALAR);
  211|     43|  }
  212|       |
  213|  2.15M|  if (INPUT.peek() == '\'' || INPUT.peek() == '\"') {
  ------------------
  |  Branch (213:7): [True: 1.87k, False: 2.15M]
  |  Branch (213:31): [True: 5.99k, False: 2.14M]
  ------------------
  214|  7.86k|    return ScanQuotedScalar();
  215|  7.86k|  }
  216|       |
  217|       |  // plain scalars
  218|  2.14M|  if ((InBlockContext() ? Exp::PlainScalar() : Exp::PlainScalarInFlow())
  ------------------
  |  Branch (218:7): [True: 2.14M, False: 41]
  |  Branch (218:8): [True: 872k, False: 1.27M]
  ------------------
  219|  2.14M|          .Matches(INPUT)) {
  220|  2.14M|    return ScanPlainScalar();
  221|  2.14M|  }
  222|       |
  223|       |  // don't know what it is!
  224|     41|  throw ParserException(INPUT.mark(), ErrorMsg::UNKNOWN_TOKEN);
  225|  2.14M|}
_ZN4YAML7Scanner15ScanToNextTokenEv:
  227|  60.6M|void Scanner::ScanToNextToken() {
  228|  67.6M|  while (true) {
  ------------------
  |  Branch (228:10): [True: 67.6M, Folded]
  ------------------
  229|       |    // first eat whitespace
  230|  67.7M|    while (INPUT && IsWhitespaceToBeEaten(INPUT.peek())) {
  ------------------
  |  Branch (230:12): [True: 67.7M, False: 5.44k]
  |  Branch (230:21): [True: 153k, False: 67.6M]
  ------------------
  231|   153k|      if (InBlockContext() && Exp::Tab().Matches(INPUT)) {
  ------------------
  |  Branch (231:11): [True: 113k, False: 39.3k]
  |  Branch (231:31): [True: 1.09k, False: 112k]
  ------------------
  232|  1.09k|        m_simpleKeyAllowed = false;
  233|  1.09k|      }
  234|   153k|      INPUT.eat(1);
  235|   153k|    }
  236|       |
  237|       |    // then eat a comment
  238|  67.6M|    if (Exp::Comment().Matches(INPUT)) {
  ------------------
  |  Branch (238:9): [True: 1.81k, False: 67.6M]
  ------------------
  239|       |      // eat until line break
  240|  5.54M|      while (INPUT && !Exp::Break().Matches(INPUT)) {
  ------------------
  |  Branch (240:14): [True: 5.54M, False: 73]
  |  Branch (240:23): [True: 5.53M, False: 1.74k]
  ------------------
  241|  5.53M|        INPUT.eat(1);
  242|  5.53M|      }
  243|  1.81k|    }
  244|       |
  245|       |    // if it's NOT a line break, then we're done!
  246|  67.6M|    if (!Exp::Break().Matches(INPUT)) {
  ------------------
  |  Branch (246:9): [True: 60.6M, False: 6.93M]
  ------------------
  247|  60.6M|      break;
  248|  60.6M|    }
  249|       |
  250|       |    // otherwise, let's eat the line break and keep going
  251|  6.93M|    int n = Exp::Break().Match(INPUT);
  252|  6.93M|    INPUT.eat(n);
  253|       |
  254|       |    // oh yeah, and let's get rid of that simple key
  255|  6.93M|    InvalidateSimpleKey();
  256|       |
  257|       |    // new line - we accept a scalar value now
  258|  6.93M|    m_scalarValueAllowed = true;
  259|       |
  260|       |    // new line - we may be able to accept a simple key now
  261|  6.93M|    if (InBlockContext()) {
  ------------------
  |  Branch (261:9): [True: 6.90M, False: 29.4k]
  ------------------
  262|  6.90M|      m_simpleKeyAllowed = true;
  263|  6.90M|    }
  264|  6.93M|  }
  265|  60.6M|}
_ZNK4YAML7Scanner13GetValueRegexEv:
  270|  8.94M|const RegEx& Scanner::GetValueRegex() const {
  271|  8.94M|  if (InBlockContext()) {
  ------------------
  |  Branch (271:7): [True: 7.22M, False: 1.72M]
  ------------------
  272|  7.22M|    return Exp::Value();
  273|  7.22M|  }
  274|       |
  275|  1.72M|  return m_canBeJSONFlow ? Exp::ValueInJSONFlow() : Exp::ValueInFlow();
  ------------------
  |  Branch (275:10): [True: 10.2k, False: 1.71M]
  ------------------
  276|  8.94M|}
_ZN4YAML7Scanner11StartStreamEv:
  278|  6.67k|void Scanner::StartStream() {
  279|  6.67k|  m_startedStream = true;
  280|  6.67k|  m_simpleKeyAllowed = true;
  281|  6.67k|  m_scalarValueAllowed = true;
  282|  6.67k|  std::unique_ptr<IndentMarker> pIndent(
  283|  6.67k|      new IndentMarker(-1, IndentMarker::NONE));
  284|  6.67k|  m_indentRefs.push_back(std::move(pIndent));
  285|  6.67k|  m_indents.push(&m_indentRefs.back());
  286|  6.67k|}
_ZN4YAML7Scanner9EndStreamEv:
  288|  5.51k|void Scanner::EndStream() {
  289|       |  // force newline
  290|  5.51k|  if (INPUT.column() > 0) {
  ------------------
  |  Branch (290:7): [True: 5.08k, False: 425]
  ------------------
  291|  5.08k|    INPUT.ResetColumn();
  292|  5.08k|  }
  293|       |
  294|  5.51k|  PopAllIndents();
  295|  5.51k|  PopAllSimpleKeys();
  296|       |
  297|  5.51k|  m_simpleKeyAllowed = false;
  298|  5.51k|  m_scalarValueAllowed = false;
  299|  5.51k|  m_endedStream = true;
  300|  5.51k|}
_ZN4YAML7Scanner9PushTokenENS_5Token4TYPEE:
  302|  7.77M|Token* Scanner::PushToken(Token::TYPE type) {
  303|  7.77M|  m_tokens.push(Token(type, INPUT.mark()));
  304|  7.77M|  return &m_tokens.back();
  305|  7.77M|}
_ZN4YAML7Scanner16GetStartTokenForENS0_12IndentMarker11INDENT_TYPEE:
  307|  7.77M|Token::TYPE Scanner::GetStartTokenFor(IndentMarker::INDENT_TYPE type) {
  308|  7.77M|  switch (type) {
  ------------------
  |  Branch (308:11): [True: 7.77M, False: 0]
  ------------------
  309|   860k|    case IndentMarker::SEQ:
  ------------------
  |  Branch (309:5): [True: 860k, False: 6.90M]
  ------------------
  310|   860k|      return Token::BLOCK_SEQ_START;
  311|  6.90M|    case IndentMarker::MAP:
  ------------------
  |  Branch (311:5): [True: 6.90M, False: 860k]
  ------------------
  312|  6.90M|      return Token::BLOCK_MAP_START;
  313|      0|    case IndentMarker::NONE:
  ------------------
  |  Branch (313:5): [True: 0, False: 7.77M]
  ------------------
  314|      0|      assert(false);
  315|      0|      break;
  316|  7.77M|  }
  317|  7.77M|  assert(false);
  318|      0|  throw std::runtime_error("yaml-cpp: internal error, invalid indent type");
  319|  7.77M|}
_ZN4YAML7Scanner12PushIndentToEiNS0_12IndentMarker11INDENT_TYPEE:
  322|  7.82M|                                             IndentMarker::INDENT_TYPE type) {
  323|       |  // are we in flow?
  324|  7.82M|  if (InFlowContext()) {
  ------------------
  |  Branch (324:7): [True: 0, False: 7.82M]
  ------------------
  325|      0|    return nullptr;
  326|      0|  }
  327|       |
  328|  7.82M|  std::unique_ptr<IndentMarker> pIndent(new IndentMarker(column, type));
  329|  7.82M|  IndentMarker& indent = *pIndent;
  330|  7.82M|  const IndentMarker& lastIndent = *m_indents.top();
  331|       |
  332|       |  // is this actually an indentation?
  333|  7.82M|  if (indent.column < lastIndent.column) {
  ------------------
  |  Branch (333:7): [True: 0, False: 7.82M]
  ------------------
  334|      0|    return nullptr;
  335|      0|  }
  336|  7.82M|  if (indent.column == lastIndent.column &&
  ------------------
  |  Branch (336:7): [True: 55.8k, False: 7.76M]
  ------------------
  337|  55.8k|      !(indent.type == IndentMarker::SEQ &&
  ------------------
  |  Branch (337:9): [True: 9.65k, False: 46.2k]
  ------------------
  338|  50.6k|        lastIndent.type == IndentMarker::MAP)) {
  ------------------
  |  Branch (338:9): [True: 5.25k, False: 4.39k]
  ------------------
  339|  50.6k|    return nullptr;
  340|  50.6k|  }
  341|       |
  342|       |  // push a start token
  343|  7.77M|  indent.pStartToken = PushToken(GetStartTokenFor(type));
  344|       |
  345|       |  // and then the indent
  346|  7.77M|  m_indents.push(&indent);
  347|  7.77M|  m_indentRefs.push_back(std::move(pIndent));
  348|  7.77M|  return &m_indentRefs.back();
  349|  7.82M|}
_ZN4YAML7Scanner15PopIndentToHereEv:
  351|  60.6M|void Scanner::PopIndentToHere() {
  352|       |  // are we in flow?
  353|  60.6M|  if (InFlowContext()) {
  ------------------
  |  Branch (353:7): [True: 52.0M, False: 8.63M]
  ------------------
  354|  52.0M|    return;
  355|  52.0M|  }
  356|       |
  357|       |  // now pop away
  358|  10.2M|  while (!m_indents.empty()) {
  ------------------
  |  Branch (358:10): [True: 10.2M, False: 0]
  ------------------
  359|  10.2M|    const IndentMarker& indent = *m_indents.top();
  360|  10.2M|    if (indent.column < INPUT.column()) {
  ------------------
  |  Branch (360:9): [True: 7.96M, False: 2.29M]
  ------------------
  361|  7.96M|      break;
  362|  7.96M|    }
  363|  2.29M|    if (indent.column == INPUT.column() &&
  ------------------
  |  Branch (363:9): [True: 1.25M, False: 1.03M]
  ------------------
  364|  1.25M|        !(indent.type == IndentMarker::SEQ &&
  ------------------
  |  Branch (364:11): [True: 591k, False: 664k]
  ------------------
  365|   668k|          !Exp::BlockEntry().Matches(INPUT))) {
  ------------------
  |  Branch (365:11): [True: 586k, False: 4.39k]
  ------------------
  366|   668k|      break;
  367|   668k|    }
  368|       |
  369|  1.62M|    PopIndent();
  370|  1.62M|  }
  371|       |
  372|  9.28M|  while (!m_indents.empty() &&
  ------------------
  |  Branch (372:10): [True: 9.28M, False: 0]
  ------------------
  373|  9.28M|         m_indents.top()->status == IndentMarker::INVALID) {
  ------------------
  |  Branch (373:10): [True: 653k, False: 8.63M]
  ------------------
  374|   653k|    PopIndent();
  375|   653k|  }
  376|  8.63M|}
_ZN4YAML7Scanner13PopAllIndentsEv:
  378|   575k|void Scanner::PopAllIndents() {
  379|       |  // are we in flow?
  380|   575k|  if (InFlowContext()) {
  ------------------
  |  Branch (380:7): [True: 47.0k, False: 528k]
  ------------------
  381|  47.0k|    return;
  382|  47.0k|  }
  383|       |
  384|       |  // now pop away
  385|  3.17M|  while (!m_indents.empty()) {
  ------------------
  |  Branch (385:10): [True: 3.17M, False: 0]
  ------------------
  386|  3.17M|    const IndentMarker& indent = *m_indents.top();
  387|  3.17M|    if (indent.type == IndentMarker::NONE) {
  ------------------
  |  Branch (387:9): [True: 528k, False: 2.64M]
  ------------------
  388|   528k|      break;
  389|   528k|    }
  390|       |
  391|  2.64M|    PopIndent();
  392|  2.64M|  }
  393|   528k|}
_ZN4YAML7Scanner9PopIndentEv:
  395|  4.92M|void Scanner::PopIndent() {
  396|  4.92M|  if (m_indents.empty()) {
  ------------------
  |  Branch (396:7): [True: 0, False: 4.92M]
  ------------------
  397|      0|    ThrowParserException(ErrorMsg::INDENT_STACK_UNDERFLOW);
  398|      0|  }
  399|  4.92M|  const IndentMarker& indent = *m_indents.top();
  400|  4.92M|  m_indents.pop();
  401|       |
  402|  4.92M|  if (indent.status != IndentMarker::VALID) {
  ------------------
  |  Branch (402:7): [True: 1.24M, False: 3.67M]
  ------------------
  403|  1.24M|    InvalidateSimpleKey();
  404|  1.24M|    return;
  405|  1.24M|  }
  406|       |
  407|  3.67M|  if (indent.type == IndentMarker::SEQ) {
  ------------------
  |  Branch (407:7): [True: 802k, False: 2.87M]
  ------------------
  408|   802k|    m_tokens.push(Token(Token::BLOCK_SEQ_END, INPUT.mark()));
  409|  2.87M|  } else if (indent.type == IndentMarker::MAP) {
  ------------------
  |  Branch (409:14): [True: 2.87M, False: 0]
  ------------------
  410|  2.87M|    m_tokens.push(Token(Token::BLOCK_MAP_END, INPUT.mark()));
  411|  2.87M|  }
  412|  3.67M|}
_ZNK4YAML7Scanner12GetTopIndentEv:
  414|   877k|int Scanner::GetTopIndent() const {
  415|   877k|  if (m_indents.empty()) {
  ------------------
  |  Branch (415:7): [True: 0, False: 877k]
  ------------------
  416|      0|    return 0;
  417|      0|  }
  418|   877k|  return m_indents.top()->column;
  419|   877k|}
scanner.cpp:_ZN4YAML12_GLOBAL__N_121IsWhitespaceToBeEatenEc:
   20|  67.7M|bool IsWhitespaceToBeEaten(char ch) { return (ch == ' ') || (ch == '\t'); }
  ------------------
  |  Branch (20:46): [True: 123k, False: 67.6M]
  |  Branch (20:61): [True: 29.2k, False: 67.6M]
  ------------------

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

_ZN4YAML10ScanScalarERNS_6StreamERNS_16ScanScalarParamsE:
   21|  2.15M|std::string ScanScalar(Stream& INPUT, ScanScalarParams& params) {
   22|  2.15M|  bool foundNonEmptyLine = false;
   23|  2.15M|  bool pastOpeningBreak = (params.fold == FOLD_FLOW);
   24|  2.15M|  bool emptyLine = false, moreIndented = false;
   25|  2.15M|  int foldedNewlineCount = 0;
   26|  2.15M|  bool foldedNewlineStartedMoreIndented = false;
   27|  2.15M|  std::size_t lastEscapedChar = std::string::npos;
   28|  2.15M|  std::string scalar;
   29|  2.15M|  params.leadingSpaces = false;
   30|       |
   31|  2.15M|  if (!params.end) {
  ------------------
  |  Branch (31:7): [True: 3.24k, False: 2.15M]
  ------------------
   32|  3.24k|    params.end = &Exp::Empty();
   33|  3.24k|  }
   34|       |
   35|  20.3M|  while (INPUT) {
  ------------------
  |  Branch (35:10): [True: 20.3M, False: 910]
  ------------------
   36|       |    // ********************************
   37|       |    // Phase #1: scan until line ending
   38|       |
   39|  20.3M|    std::size_t lastNonWhitespaceChar = scalar.size();
   40|  20.3M|    bool escapedNewline = false;
   41|  96.5M|    while (!params.end->Matches(INPUT) && !Exp::Break().Matches(INPUT)) {
  ------------------
  |  Branch (41:12): [True: 95.2M, False: 1.29M]
  |  Branch (41:43): [True: 76.4M, False: 18.8M]
  ------------------
   42|  76.4M|      if (!INPUT) {
  ------------------
  |  Branch (42:11): [True: 1.82k, False: 76.4M]
  ------------------
   43|  1.82k|        break;
   44|  1.82k|      }
   45|       |
   46|       |      // document indicator?
   47|  76.4M|      if (INPUT.column() == 0 && Exp::DocIndicator().Matches(INPUT)) {
  ------------------
  |  Branch (47:11): [True: 420k, False: 76.0M]
  |  Branch (47:34): [True: 264k, False: 156k]
  ------------------
   48|   264k|        if (params.onDocIndicator == BREAK) {
  ------------------
  |  Branch (48:13): [True: 264k, False: 2]
  ------------------
   49|   264k|          break;
   50|   264k|        }
   51|      2|        if (params.onDocIndicator == THROW) {
  ------------------
  |  Branch (51:13): [True: 2, False: 0]
  ------------------
   52|      2|          throw ParserException(INPUT.mark(), ErrorMsg::DOC_IN_SCALAR);
   53|      2|        }
   54|      2|      }
   55|       |
   56|  76.1M|      foundNonEmptyLine = true;
   57|  76.1M|      pastOpeningBreak = true;
   58|       |
   59|       |      // escaped newline? (only if we're escaping on slash)
   60|  76.1M|      if (params.escape == '\\' && Exp::EscBreak().Matches(INPUT)) {
  ------------------
  |  Branch (60:11): [True: 11.2M, False: 64.9M]
  |  Branch (60:36): [True: 801, False: 11.1M]
  ------------------
   61|       |        // eat escape character and get out (but preserve trailing whitespace!)
   62|    801|        INPUT.get();
   63|    801|        lastNonWhitespaceChar = scalar.size();
   64|    801|        lastEscapedChar = scalar.size();
   65|    801|        escapedNewline = true;
   66|    801|        break;
   67|    801|      }
   68|       |
   69|       |      // escape this?
   70|  76.1M|      if (INPUT.peek() == params.escape) {
  ------------------
  |  Branch (70:11): [True: 41.3k, False: 76.1M]
  ------------------
   71|  41.3k|        scalar += Exp::Escape(INPUT);
   72|  41.3k|        lastNonWhitespaceChar = scalar.size();
   73|  41.3k|        lastEscapedChar = scalar.size();
   74|  41.3k|        continue;
   75|  41.3k|      }
   76|       |
   77|       |      // otherwise, just add the damn character
   78|  76.1M|      char ch = INPUT.get();
   79|  76.1M|      scalar += ch;
   80|  76.1M|      if (ch != ' ' && ch != '\t') {
  ------------------
  |  Branch (80:11): [True: 76.0M, False: 59.3k]
  |  Branch (80:24): [True: 74.5M, False: 1.52M]
  ------------------
   81|  74.5M|        lastNonWhitespaceChar = scalar.size();
   82|  74.5M|      }
   83|  76.1M|    }
   84|       |
   85|       |    // eof? if we're looking to eat something, then we throw
   86|  20.3M|    if (!INPUT) {
  ------------------
  |  Branch (86:9): [True: 1.88k, False: 20.3M]
  ------------------
   87|  1.88k|      if (params.eatEnd) {
  ------------------
  |  Branch (87:11): [True: 204, False: 1.68k]
  ------------------
   88|    204|        throw ParserException(INPUT.mark(), ErrorMsg::EOF_IN_SCALAR);
   89|    204|      }
   90|  1.68k|      break;
   91|  1.88k|    }
   92|       |
   93|       |    // doc indicator?
   94|  20.3M|    if (params.onDocIndicator == BREAK && INPUT.column() == 0 &&
  ------------------
  |  Branch (94:9): [True: 8.90M, False: 11.4M]
  |  Branch (94:43): [True: 4.64M, False: 4.25M]
  ------------------
   95|  4.64M|        Exp::DocIndicator().Matches(INPUT)) {
  ------------------
  |  Branch (95:9): [True: 264k, False: 4.38M]
  ------------------
   96|   264k|      break;
   97|   264k|    }
   98|       |
   99|       |    // are we done via character match?
  100|  20.1M|    int n = params.end->Match(INPUT);
  101|  20.1M|    if (n >= 0) {
  ------------------
  |  Branch (101:9): [True: 1.29M, False: 18.8M]
  ------------------
  102|  1.29M|      if (params.eatEnd) {
  ------------------
  |  Branch (102:11): [True: 7.46k, False: 1.28M]
  ------------------
  103|  7.46k|        INPUT.eat(n);
  104|  7.46k|      }
  105|  1.29M|      break;
  106|  1.29M|    }
  107|       |
  108|       |    // do we remove trailing whitespace?
  109|  18.8M|    if (params.fold == FOLD_FLOW)
  ------------------
  |  Branch (109:9): [True: 7.39M, False: 11.4M]
  ------------------
  110|  7.39M|      scalar.erase(lastNonWhitespaceChar);
  111|       |
  112|       |    // ********************************
  113|       |    // Phase #2: eat line ending
  114|  18.8M|    n = Exp::Break().Match(INPUT);
  115|  18.8M|    INPUT.eat(n);
  116|       |
  117|       |    // ********************************
  118|       |    // Phase #3: scan initial spaces
  119|       |
  120|       |    // first the required indentation
  121|  18.8M|    while (INPUT.peek() == ' ' &&
  ------------------
  |  Branch (121:12): [True: 9.09k, False: 18.8M]
  ------------------
  122|  9.09k|           (INPUT.column() < params.indent ||
  ------------------
  |  Branch (122:13): [True: 626, False: 8.47k]
  ------------------
  123|  8.47k|            (params.detectIndent && !foundNonEmptyLine)) &&
  ------------------
  |  Branch (123:14): [True: 1.33k, False: 7.13k]
  |  Branch (123:37): [True: 443, False: 891]
  ------------------
  124|  1.06k|           !params.end->Matches(INPUT)) {
  ------------------
  |  Branch (124:12): [True: 875, False: 194]
  ------------------
  125|    875|      INPUT.eat(1);
  126|    875|    }
  127|       |
  128|       |    // update indent if we're auto-detecting
  129|  18.8M|    if (params.detectIndent && !foundNonEmptyLine) {
  ------------------
  |  Branch (129:9): [True: 11.4M, False: 7.40M]
  |  Branch (129:32): [True: 10.0M, False: 1.35M]
  ------------------
  130|  10.0M|      params.indent = std::max(params.indent, INPUT.column());
  131|  10.0M|    }
  132|       |
  133|       |    // and then the rest of the whitespace
  134|  18.8M|    while (Exp::Blank().Matches(INPUT)) {
  ------------------
  |  Branch (134:12): [True: 10.5k, False: 18.8M]
  ------------------
  135|       |      // we check for tabs that masquerade as indentation
  136|  10.5k|      if (INPUT.peek() == '\t' && INPUT.column() < params.indent &&
  ------------------
  |  Branch (136:11): [True: 2.12k, False: 8.42k]
  |  Branch (136:35): [True: 2, False: 2.12k]
  ------------------
  137|      2|          params.onTabInIndentation == THROW) {
  ------------------
  |  Branch (137:11): [True: 2, False: 0]
  ------------------
  138|      2|        throw ParserException(INPUT.mark(), ErrorMsg::TAB_IN_INDENTATION);
  139|      2|      }
  140|       |
  141|  10.5k|      if (!params.eatLeadingWhitespace) {
  ------------------
  |  Branch (141:11): [True: 1.78k, False: 8.76k]
  ------------------
  142|  1.78k|        break;
  143|  1.78k|      }
  144|       |
  145|  8.76k|      if (params.end->Matches(INPUT)) {
  ------------------
  |  Branch (145:11): [True: 206, False: 8.55k]
  ------------------
  146|    206|        break;
  147|    206|      }
  148|       |
  149|  8.55k|      INPUT.eat(1);
  150|  8.55k|    }
  151|       |
  152|       |    // was this an empty line?
  153|  18.8M|    bool nextEmptyLine = Exp::Break().Matches(INPUT);
  154|  18.8M|    bool nextMoreIndented = Exp::Blank().Matches(INPUT);
  155|  18.8M|    if (params.fold == FOLD_BLOCK && foldedNewlineCount == 0 && nextEmptyLine)
  ------------------
  |  Branch (155:9): [True: 11.4M, False: 7.39M]
  |  Branch (155:38): [True: 124k, False: 11.3M]
  |  Branch (155:65): [True: 3.50k, False: 121k]
  ------------------
  156|  3.50k|      foldedNewlineStartedMoreIndented = moreIndented;
  157|       |
  158|       |    // for block scalars, we always start with a newline, so we should ignore it
  159|       |    // (not fold or keep)
  160|  18.8M|    if (pastOpeningBreak) {
  ------------------
  |  Branch (160:9): [True: 18.8M, False: 3.55k]
  ------------------
  161|  18.8M|      switch (params.fold) {
  ------------------
  |  Branch (161:15): [True: 18.8M, False: 0]
  ------------------
  162|  1.00k|        case DONT_FOLD:
  ------------------
  |  Branch (162:9): [True: 1.00k, False: 18.8M]
  ------------------
  163|  1.00k|          scalar += "\n";
  164|  1.00k|          break;
  165|  11.4M|        case FOLD_BLOCK:
  ------------------
  |  Branch (165:9): [True: 11.4M, False: 7.39M]
  ------------------
  166|  11.4M|          if (!emptyLine && !nextEmptyLine && !moreIndented &&
  ------------------
  |  Branch (166:15): [True: 121k, False: 11.3M]
  |  Branch (166:29): [True: 118k, False: 2.63k]
  |  Branch (166:47): [True: 117k, False: 1.42k]
  ------------------
  167|   117k|              !nextMoreIndented && INPUT.column() >= params.indent) {
  ------------------
  |  Branch (167:15): [True: 116k, False: 447]
  |  Branch (167:36): [True: 116k, False: 408]
  ------------------
  168|   116k|            scalar += " ";
  169|  11.3M|          } else if (nextEmptyLine) {
  ------------------
  |  Branch (169:22): [True: 11.3M, False: 5.42k]
  ------------------
  170|  11.3M|            foldedNewlineCount++;
  171|  11.3M|          } else {
  172|  5.42k|            scalar += "\n";
  173|  5.42k|          }
  174|       |
  175|  11.4M|          if (!nextEmptyLine && foldedNewlineCount > 0) {
  ------------------
  |  Branch (175:15): [True: 121k, False: 11.3M]
  |  Branch (175:33): [True: 2.99k, False: 118k]
  ------------------
  176|  2.99k|            scalar += std::string(foldedNewlineCount - 1, '\n');
  177|  2.99k|            if (foldedNewlineStartedMoreIndented ||
  ------------------
  |  Branch (177:17): [True: 259, False: 2.73k]
  ------------------
  178|  2.73k|                nextMoreIndented || !foundNonEmptyLine) {
  ------------------
  |  Branch (178:17): [True: 262, False: 2.47k]
  |  Branch (178:37): [True: 363, False: 2.11k]
  ------------------
  179|    884|              scalar += "\n";
  180|    884|            }
  181|  2.99k|            foldedNewlineCount = 0;
  182|  2.99k|          }
  183|  11.4M|          break;
  184|  7.39M|        case FOLD_FLOW:
  ------------------
  |  Branch (184:9): [True: 7.39M, False: 11.4M]
  ------------------
  185|  7.39M|          if (nextEmptyLine) {
  ------------------
  |  Branch (185:15): [True: 6.19M, False: 1.20M]
  ------------------
  186|  6.19M|            scalar += "\n";
  187|  6.19M|          } else if (!emptyLine && !escapedNewline) {
  ------------------
  |  Branch (187:22): [True: 1.18M, False: 12.8k]
  |  Branch (187:36): [True: 1.18M, False: 656]
  ------------------
  188|  1.18M|            scalar += " ";
  189|  1.18M|          }
  190|  7.39M|          break;
  191|  18.8M|      }
  192|  18.8M|    }
  193|       |
  194|  18.8M|    emptyLine = nextEmptyLine;
  195|  18.8M|    moreIndented = nextMoreIndented;
  196|  18.8M|    pastOpeningBreak = true;
  197|       |
  198|       |    // are we done via indentation?
  199|  18.8M|    if (!emptyLine && INPUT.column() < params.indent) {
  ------------------
  |  Branch (199:9): [True: 1.32M, False: 17.4M]
  |  Branch (199:23): [True: 595k, False: 730k]
  ------------------
  200|   595k|      params.leadingSpaces = true;
  201|   595k|      break;
  202|   595k|    }
  203|  18.8M|  }
  204|       |
  205|       |  // post-processing
  206|  2.15M|  if (params.trimTrailingSpaces) {
  ------------------
  |  Branch (206:7): [True: 2.14M, False: 11.2k]
  ------------------
  207|  2.14M|    std::size_t pos = scalar.find_last_not_of(" \t");
  208|  2.14M|    if (lastEscapedChar != std::string::npos) {
  ------------------
  |  Branch (208:9): [True: 17.9k, False: 2.12M]
  ------------------
  209|  17.9k|      if (pos < lastEscapedChar || pos == std::string::npos) {
  ------------------
  |  Branch (209:11): [True: 11.1k, False: 6.76k]
  |  Branch (209:36): [True: 526, False: 6.24k]
  ------------------
  210|  11.7k|        pos = lastEscapedChar;
  211|  11.7k|      }
  212|  17.9k|    }
  213|  2.14M|    if (pos < scalar.size()) {
  ------------------
  |  Branch (213:9): [True: 2.13M, False: 11.5k]
  ------------------
  214|  2.13M|      scalar.erase(pos + 1);
  215|  2.13M|    }
  216|  2.14M|  }
  217|       |
  218|  2.15M|  switch (params.chomp) {
  219|  9.87k|    case CLIP: {
  ------------------
  |  Branch (219:5): [True: 9.87k, False: 2.14M]
  ------------------
  220|  9.87k|      std::size_t pos = scalar.find_last_not_of('\n');
  221|  9.87k|      if (lastEscapedChar != std::string::npos) {
  ------------------
  |  Branch (221:11): [True: 2.66k, False: 7.21k]
  ------------------
  222|  2.66k|        if (pos < lastEscapedChar || pos == std::string::npos) {
  ------------------
  |  Branch (222:13): [True: 1.73k, False: 932]
  |  Branch (222:38): [True: 221, False: 711]
  ------------------
  223|  1.95k|          pos = lastEscapedChar;
  224|  1.95k|        }
  225|  2.66k|      }
  226|  9.87k|      if (pos == std::string::npos) {
  ------------------
  |  Branch (226:11): [True: 3.94k, False: 5.93k]
  ------------------
  227|  3.94k|        scalar.erase();
  228|  5.93k|      } else if (pos + 1 < scalar.size()) {
  ------------------
  |  Branch (228:18): [True: 478, False: 5.45k]
  ------------------
  229|    478|        scalar.erase(pos + 2);
  230|    478|      }
  231|  9.87k|    } break;
  232|  2.14M|    case STRIP: {
  ------------------
  |  Branch (232:5): [True: 2.14M, False: 10.7k]
  ------------------
  233|  2.14M|      std::size_t pos = scalar.find_last_not_of('\n');
  234|  2.14M|      if (lastEscapedChar != std::string::npos) {
  ------------------
  |  Branch (234:11): [True: 17.9k, False: 2.12M]
  ------------------
  235|  17.9k|        if (pos < lastEscapedChar || pos == std::string::npos) {
  ------------------
  |  Branch (235:13): [True: 11.3k, False: 6.62k]
  |  Branch (235:38): [True: 217, False: 6.40k]
  ------------------
  236|  11.5k|          pos = lastEscapedChar;
  237|  11.5k|        }
  238|  17.9k|      }
  239|  2.14M|      if (pos == std::string::npos) {
  ------------------
  |  Branch (239:11): [True: 490, False: 2.14M]
  ------------------
  240|    490|        scalar.erase();
  241|  2.14M|      } else if (pos < scalar.size()) {
  ------------------
  |  Branch (241:18): [True: 2.13M, False: 11.5k]
  ------------------
  242|  2.13M|        scalar.erase(pos + 1);
  243|  2.13M|      }
  244|  2.14M|    } break;
  245|    474|    default:
  ------------------
  |  Branch (245:5): [True: 474, False: 2.15M]
  ------------------
  246|    474|      break;
  247|  2.15M|  }
  248|       |
  249|  2.15M|  return scalar;
  250|  2.15M|}

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

_ZN4YAML15ScanVerbatimTagERNS_6StreamE:
    9|    643|std::string ScanVerbatimTag(Stream& INPUT) {
   10|    643|  std::string tag;
   11|       |
   12|       |  // eat the start character
   13|    643|  INPUT.get();
   14|       |
   15|  9.63k|  while (INPUT) {
  ------------------
  |  Branch (15:10): [True: 9.60k, False: 22]
  ------------------
   16|  9.60k|    if (INPUT.peek() == Keys::VerbatimTagEnd) {
  ------------------
  |  Branch (16:9): [True: 616, False: 8.99k]
  ------------------
   17|       |      // eat the end character
   18|    616|      INPUT.get();
   19|    616|      return tag;
   20|    616|    }
   21|       |
   22|  8.99k|    int n = Exp::URI().Match(INPUT);
   23|  8.99k|    if (n <= 0)
  ------------------
  |  Branch (23:9): [True: 5, False: 8.98k]
  ------------------
   24|      5|      break;
   25|       |
   26|  8.98k|    tag += INPUT.get(n);
   27|  8.98k|  }
   28|       |
   29|     27|  throw ParserException(INPUT.mark(), ErrorMsg::END_OF_VERBATIM_TAG);
   30|    643|}
_ZN4YAML13ScanTagHandleERNS_6StreamERb:
   32|   678k|std::string ScanTagHandle(Stream& INPUT, bool& canBeHandle) {
   33|   678k|  std::string tag;
   34|   678k|  canBeHandle = true;
   35|   678k|  Mark firstNonWordChar;
   36|       |
   37|  8.71M|  while (INPUT) {
  ------------------
  |  Branch (37:10): [True: 8.71M, False: 317]
  ------------------
   38|  8.71M|    if (INPUT.peek() == Keys::Tag) {
  ------------------
  |  Branch (38:9): [True: 2.63k, False: 8.71M]
  ------------------
   39|  2.63k|      if (!canBeHandle)
  ------------------
  |  Branch (39:11): [True: 4, False: 2.62k]
  ------------------
   40|      4|        throw ParserException(firstNonWordChar, ErrorMsg::CHAR_IN_TAG_HANDLE);
   41|  2.62k|      break;
   42|  2.63k|    }
   43|       |
   44|  8.71M|    int n = 0;
   45|  8.71M|    if (canBeHandle) {
  ------------------
  |  Branch (45:9): [True: 7.53M, False: 1.17M]
  ------------------
   46|  7.53M|      n = Exp::Word().Match(INPUT);
   47|  7.53M|      if (n <= 0) {
  ------------------
  |  Branch (47:11): [True: 675k, False: 6.86M]
  ------------------
   48|   675k|        canBeHandle = false;
   49|   675k|        firstNonWordChar = INPUT.mark();
   50|   675k|      }
   51|  7.53M|    }
   52|       |
   53|  8.71M|    if (!canBeHandle)
  ------------------
  |  Branch (53:9): [True: 1.84M, False: 6.86M]
  ------------------
   54|  1.84M|      n = Exp::Tag().Match(INPUT);
   55|       |
   56|  8.71M|    if (n <= 0)
  ------------------
  |  Branch (56:9): [True: 675k, False: 8.03M]
  ------------------
   57|   675k|      break;
   58|       |
   59|  8.03M|    tag += INPUT.get(n);
   60|  8.03M|  }
   61|       |
   62|   678k|  return tag;
   63|   678k|}
_ZN4YAML13ScanTagSuffixERNS_6StreamE:
   65|  2.62k|std::string ScanTagSuffix(Stream& INPUT) {
   66|  2.62k|  std::string tag;
   67|       |
   68|  69.8k|  while (INPUT) {
  ------------------
  |  Branch (68:10): [True: 69.7k, False: 97]
  ------------------
   69|  69.7k|    int n = Exp::Tag().Match(INPUT);
   70|  69.7k|    if (n <= 0)
  ------------------
  |  Branch (70:9): [True: 2.53k, False: 67.2k]
  ------------------
   71|  2.53k|      break;
   72|       |
   73|  67.2k|    tag += INPUT.get(n);
   74|  67.2k|  }
   75|       |
   76|  2.62k|  if (tag.empty())
  ------------------
  |  Branch (76:7): [True: 15, False: 2.61k]
  ------------------
   77|     15|    throw ParserException(INPUT.mark(), ErrorMsg::TAG_WITH_NO_SUFFIX);
   78|       |
   79|  2.61k|  return tag;
   80|  2.62k|}

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

_ZN4YAML7Scanner9SimpleKeyC2ERKNS_4MarkEm:
    8|  48.8M|    : mark(mark_),
    9|  48.8M|      flowLevel(flowLevel_),
   10|  48.8M|      pIndent(nullptr),
   11|  48.8M|      pMapStart(nullptr),
   12|  48.8M|      pKey(nullptr) {}
_ZN4YAML7Scanner9SimpleKey8ValidateEv:
   14|  1.15M|void Scanner::SimpleKey::Validate() {
   15|       |  // Note: pIndent will *not* be garbage here;
   16|       |  //       we "garbage collect" them so we can
   17|       |  //       always refer to them
   18|  1.15M|  if (pIndent)
  ------------------
  |  Branch (18:7): [True: 44.6k, False: 1.11M]
  ------------------
   19|  44.6k|    pIndent->status = IndentMarker::VALID;
   20|  1.15M|  if (pMapStart)
  ------------------
  |  Branch (20:7): [True: 44.6k, False: 1.11M]
  ------------------
   21|  44.6k|    pMapStart->status = Token::VALID;
   22|  1.15M|  if (pKey)
  ------------------
  |  Branch (22:7): [True: 1.15M, False: 0]
  ------------------
   23|  1.15M|    pKey->status = Token::VALID;
   24|  1.15M|}
_ZN4YAML7Scanner9SimpleKey10InvalidateEv:
   26|  2.83M|void Scanner::SimpleKey::Invalidate() {
   27|  2.83M|  if (pIndent)
  ------------------
  |  Branch (27:7): [True: 1.24M, False: 1.58M]
  ------------------
   28|  1.24M|    pIndent->status = IndentMarker::INVALID;
   29|  2.83M|  if (pMapStart)
  ------------------
  |  Branch (29:7): [True: 1.24M, False: 1.58M]
  ------------------
   30|  1.24M|    pMapStart->status = Token::INVALID;
   31|  2.83M|  if (pKey)
  ------------------
  |  Branch (31:7): [True: 2.83M, False: 0]
  ------------------
   32|  2.83M|    pKey->status = Token::INVALID;
   33|  2.83M|}
_ZNK4YAML7Scanner27CanInsertPotentialSimpleKeyEv:
   36|  49.3M|bool Scanner::CanInsertPotentialSimpleKey() const {
   37|  49.3M|  if (!m_simpleKeyAllowed)
  ------------------
  |  Branch (37:7): [True: 498k, False: 48.8M]
  ------------------
   38|   498k|    return false;
   39|       |
   40|  48.8M|  return !ExistsActiveSimpleKey();
   41|  49.3M|}
_ZNK4YAML7Scanner21ExistsActiveSimpleKeyEv:
   47|  48.8M|bool Scanner::ExistsActiveSimpleKey() const {
   48|  48.8M|  if (m_simpleKeys.empty())
  ------------------
  |  Branch (48:7): [True: 1.31M, False: 47.5M]
  ------------------
   49|  1.31M|    return false;
   50|       |
   51|  47.5M|  const SimpleKey& key = m_simpleKeys.top();
   52|  47.5M|  return key.flowLevel == GetFlowLevel();
   53|  48.8M|}
_ZN4YAML7Scanner24InsertPotentialSimpleKeyEv:
   58|  49.3M|void Scanner::InsertPotentialSimpleKey() {
   59|  49.3M|  if (!CanInsertPotentialSimpleKey())
  ------------------
  |  Branch (59:7): [True: 501k, False: 48.8M]
  ------------------
   60|   501k|    return;
   61|       |
   62|  48.8M|  SimpleKey key(INPUT.mark(), GetFlowLevel());
   63|       |
   64|       |  // first add a map start, if necessary
   65|  48.8M|  if (InBlockContext()) {
  ------------------
  |  Branch (65:7): [True: 1.30M, False: 47.5M]
  ------------------
   66|  1.30M|    key.pIndent = PushIndentTo(INPUT.column(), IndentMarker::MAP);
   67|  1.30M|    if (key.pIndent) {
  ------------------
  |  Branch (67:9): [True: 1.29M, False: 7.98k]
  ------------------
   68|  1.29M|      key.pIndent->status = IndentMarker::UNKNOWN;
   69|  1.29M|      key.pMapStart = key.pIndent->pStartToken;
   70|  1.29M|      key.pMapStart->status = Token::UNVERIFIED;
   71|  1.29M|    }
   72|  1.30M|  }
   73|       |
   74|       |  // then add the (now unverified) key
   75|  48.8M|  m_tokens.push(Token(Token::KEY, INPUT.mark()));
   76|  48.8M|  key.pKey = &m_tokens.back();
   77|  48.8M|  key.pKey->status = Token::UNVERIFIED;
   78|       |
   79|  48.8M|  m_simpleKeys.push(key);
   80|  48.8M|}
_ZN4YAML7Scanner19InvalidateSimpleKeyEv:
   84|  9.72M|void Scanner::InvalidateSimpleKey() {
   85|  9.72M|  if (m_simpleKeys.empty())
  ------------------
  |  Branch (85:7): [True: 6.91M, False: 2.80M]
  ------------------
   86|  6.91M|    return;
   87|       |
   88|       |  // grab top key
   89|  2.80M|  SimpleKey& key = m_simpleKeys.top();
   90|  2.80M|  if (key.flowLevel != GetFlowLevel())
  ------------------
  |  Branch (90:7): [True: 1.09M, False: 1.71M]
  ------------------
   91|  1.09M|    return;
   92|       |
   93|  1.71M|  key.Invalidate();
   94|  1.71M|  m_simpleKeys.pop();
   95|  1.71M|}
_ZN4YAML7Scanner15VerifySimpleKeyEv:
  100|  8.28M|bool Scanner::VerifySimpleKey() {
  101|  8.28M|  if (m_simpleKeys.empty())
  ------------------
  |  Branch (101:7): [True: 5.85M, False: 2.43M]
  ------------------
  102|  5.85M|    return false;
  103|       |
  104|       |  // grab top key
  105|  2.43M|  SimpleKey key = m_simpleKeys.top();
  106|       |
  107|       |  // only validate if we're in the correct flow level
  108|  2.43M|  if (key.flowLevel != GetFlowLevel())
  ------------------
  |  Branch (108:7): [True: 154k, False: 2.27M]
  ------------------
  109|   154k|    return false;
  110|       |
  111|  2.27M|  m_simpleKeys.pop();
  112|       |
  113|  2.27M|  bool isValid = true;
  114|       |
  115|       |  // needs to be less than 1024 characters and inline
  116|  2.27M|  if (INPUT.line() != key.mark.line || INPUT.pos() - key.mark.pos > 1024)
  ------------------
  |  Branch (116:7): [True: 47.9k, False: 2.23M]
  |  Branch (116:40): [True: 1.07M, False: 1.15M]
  ------------------
  117|  1.12M|    isValid = false;
  118|       |
  119|       |  // invalidate key
  120|  2.27M|  if (isValid)
  ------------------
  |  Branch (120:7): [True: 1.15M, False: 1.12M]
  ------------------
  121|  1.15M|    key.Validate();
  122|  1.12M|  else
  123|  1.12M|    key.Invalidate();
  124|       |
  125|  2.27M|  return isValid;
  126|  2.43M|}
_ZN4YAML7Scanner16PopAllSimpleKeysEv:
  128|   575k|void Scanner::PopAllSimpleKeys() {
  129|  42.1M|  while (!m_simpleKeys.empty())
  ------------------
  |  Branch (129:10): [True: 41.5M, False: 575k]
  ------------------
  130|  41.5M|    m_simpleKeys.pop();
  131|   575k|}

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

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

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

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

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

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

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

