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

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

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

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

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

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

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

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

_ZN4YAML6detail8node_refC2Ev:
   28|  2.00M|  node_ref() : m_pData(std::make_shared<node_data>()) {}
_ZNK4YAML6detail8node_ref10is_definedEv:
   32|  6.33M|  bool is_defined() const { return m_pData->is_defined(); }
_ZNK4YAML6detail8node_ref4typeEv:
   34|  3.98M|  NodeType::value type() const { return m_pData->type(); }
_ZNK4YAML6detail8node_ref6scalarEv:
   35|  1.54M|  const std::string& scalar() const { return m_pData->scalar(); }
_ZN4YAML6detail8node_ref12mark_definedEv:
   39|  2.00M|  void mark_defined() { m_pData->mark_defined(); }
_ZN4YAML6detail8node_ref8set_markERKNS_4MarkE:
   42|  2.00M|  void set_mark(const Mark& mark) { m_pData->set_mark(mark); }
_ZN4YAML6detail8node_ref8set_typeENS_8NodeType5valueE:
   43|   151k|  void set_type(NodeType::value type) { m_pData->set_type(type); }
_ZN4YAML6detail8node_ref7set_tagERKNSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEE:
   44|   294k|  void set_tag(const std::string& tag) { m_pData->set_tag(tag); }
_ZN4YAML6detail8node_ref8set_nullEv:
   45|  1.71M|  void set_null() { m_pData->set_null(); }
_ZN4YAML6detail8node_ref10set_scalarERKNSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEE:
   46|   143k|  void set_scalar(const std::string& scalar) { m_pData->set_scalar(scalar); }
_ZN4YAML6detail8node_ref9set_styleENS_12EmitterStyle5valueE:
   47|   151k|  void set_style(EmitterStyle::value style) { m_pData->set_style(style); }
_ZN4YAML6detail8node_ref9push_backERNS0_4nodeENSt3__110shared_ptrINS0_13memory_holderEEE:
   63|   809k|  void push_back(node& node, shared_memory_holder pMemory) {
   64|   809k|    m_pData->push_back(node, pMemory);
   65|   809k|  }
_ZN4YAML6detail8node_ref6insertERNS0_4nodeES3_NSt3__110shared_ptrINS0_13memory_holderEEE:
   66|   376k|  void insert(node& key, node& value, shared_memory_holder pMemory) {
   67|   376k|    m_pData->insert(key, value, pMemory);
   68|   376k|  }

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

_ZN4YAML9ExceptionD2Ev:
   24|  3.47k|    #define YAML_CPP_NOEXCEPT noexcept

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

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

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

_ZN4YAML3Exp8ParseHexERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERKNS_4MarkE:
   13|  1.46k|unsigned ParseHex(const std::string& str, const Mark& mark) {
   14|  1.46k|  unsigned value = 0;
   15|  6.22k|  for (char ch : str) {
  ------------------
  |  Branch (15:16): [True: 6.22k, False: 1.38k]
  ------------------
   16|  6.22k|    int digit = 0;
   17|  6.22k|    if ('a' <= ch && ch <= 'f')
  ------------------
  |  Branch (17:9): [True: 1.05k, False: 5.16k]
  |  Branch (17:22): [True: 1.05k, False: 5]
  ------------------
   18|  1.05k|      digit = ch - 'a' + 10;
   19|  5.17k|    else if ('A' <= ch && ch <= 'F')
  ------------------
  |  Branch (19:14): [True: 1.95k, False: 3.21k]
  |  Branch (19:27): [True: 1.94k, False: 9]
  ------------------
   20|  1.94k|      digit = ch - 'A' + 10;
   21|  3.22k|    else if ('0' <= ch && ch <= '9')
  ------------------
  |  Branch (21:14): [True: 3.15k, False: 70]
  |  Branch (21:27): [True: 3.14k, False: 13]
  ------------------
   22|  3.14k|      digit = ch - '0';
   23|     83|    else
   24|     83|      throw ParserException(mark, ErrorMsg::INVALID_HEX);
   25|       |
   26|  6.14k|    value = (value << 4) + digit;
   27|  6.14k|  }
   28|       |
   29|  1.38k|  return value;
   30|  1.46k|}
_ZN4YAML3Exp3StrEj:
   32|  3.44k|std::string Str(unsigned ch) { return std::string(1, static_cast<char>(ch)); }
_ZN4YAML3Exp6EscapeERNS_6StreamEi:
   38|  1.46k|std::string Escape(Stream& in, int codeLength) {
   39|       |  // grab string
   40|  1.46k|  std::string str;
   41|  8.02k|  for (int i = 0; i < codeLength; i++)
  ------------------
  |  Branch (41:19): [True: 6.55k, False: 1.46k]
  ------------------
   42|  6.55k|    str += in.get();
   43|       |
   44|       |  // get the value
   45|  1.46k|  unsigned value = ParseHex(str, in.mark());
   46|       |
   47|       |  // legal unicode?
   48|  1.46k|  if ((value >= 0xD800 && value <= 0xDFFF) || value > 0x10FFFF) {
  ------------------
  |  Branch (48:8): [True: 492, False: 976]
  |  Branch (48:27): [True: 11, False: 481]
  |  Branch (48:47): [True: 37, False: 1.33k]
  ------------------
   49|     48|    std::stringstream msg;
   50|     48|    msg << ErrorMsg::INVALID_UNICODE << value;
   51|     48|    throw ParserException(in.mark(), msg.str());
   52|     48|  }
   53|       |
   54|       |  // now break it up into chars
   55|  1.42k|  if (value <= 0x7F)
  ------------------
  |  Branch (55:7): [True: 229, False: 1.19k]
  ------------------
   56|    229|    return Str(value);
   57|       |
   58|  1.19k|  if (value <= 0x7FF)
  ------------------
  |  Branch (58:7): [True: 297, False: 894]
  ------------------
   59|    297|    return Str(0xC0 + (value >> 6)) + Str(0x80 + (value & 0x3F));
   60|       |
   61|    894|  if (value <= 0xFFFF)
  ------------------
  |  Branch (61:7): [True: 625, False: 269]
  ------------------
   62|    625|    return Str(0xE0 + (value >> 12)) + Str(0x80 + ((value >> 6) & 0x3F)) +
   63|    625|           Str(0x80 + (value & 0x3F));
   64|       |
   65|    269|  return Str(0xF0 + (value >> 18)) + Str(0x80 + ((value >> 12) & 0x3F)) +
   66|    269|         Str(0x80 + ((value >> 6) & 0x3F)) + Str(0x80 + (value & 0x3F));
   67|    894|}
_ZN4YAML3Exp6EscapeERNS_6StreamE:
   74|  41.2k|std::string Escape(Stream& in) {
   75|       |  // eat slash
   76|  41.2k|  char escape = in.get();
   77|       |
   78|       |  // switch on escape character
   79|  41.2k|  char ch = in.get();
   80|       |
   81|       |  // first do single quote, since it's easier
   82|  41.2k|  if (escape == '\'' && ch == '\'')
  ------------------
  |  Branch (82:7): [True: 981, False: 40.2k]
  |  Branch (82:25): [True: 981, False: 0]
  ------------------
   83|    981|    return "\'";
   84|       |
   85|       |  // now do the slash (we're not gonna check if it's a slash - you better pass
   86|       |  // one!)
   87|  40.2k|  switch (ch) {
  ------------------
  |  Branch (87:11): [True: 40.0k, False: 231]
  ------------------
   88|    650|    case '0':
  ------------------
  |  Branch (88:5): [True: 650, False: 39.5k]
  ------------------
   89|    650|      return std::string(1, '\x00');
   90|    199|    case 'a':
  ------------------
  |  Branch (90:5): [True: 199, False: 40.0k]
  ------------------
   91|    199|      return "\x07";
   92|    861|    case 'b':
  ------------------
  |  Branch (92:5): [True: 861, False: 39.3k]
  ------------------
   93|    861|      return "\x08";
   94|    699|    case 't':
  ------------------
  |  Branch (94:5): [True: 699, False: 39.5k]
  ------------------
   95|  4.98k|    case '\t':
  ------------------
  |  Branch (95:5): [True: 4.28k, False: 35.9k]
  ------------------
   96|  4.98k|      return "\x09";
   97|  8.54k|    case 'n':
  ------------------
  |  Branch (97:5): [True: 8.54k, False: 31.6k]
  ------------------
   98|  8.54k|      return "\x0A";
   99|    384|    case 'v':
  ------------------
  |  Branch (99:5): [True: 384, False: 39.8k]
  ------------------
  100|    384|      return "\x0B";
  101|    409|    case 'f':
  ------------------
  |  Branch (101:5): [True: 409, False: 39.8k]
  ------------------
  102|    409|      return "\x0C";
  103|    198|    case 'r':
  ------------------
  |  Branch (103:5): [True: 198, False: 40.0k]
  ------------------
  104|    198|      return "\x0D";
  105|    624|    case 'e':
  ------------------
  |  Branch (105:5): [True: 624, False: 39.6k]
  ------------------
  106|    624|      return "\x1B";
  107|    449|    case ' ':
  ------------------
  |  Branch (107:5): [True: 449, False: 39.7k]
  ------------------
  108|    449|      return R"( )";
  109|  5.61k|    case '\"':
  ------------------
  |  Branch (109:5): [True: 5.61k, False: 34.6k]
  ------------------
  110|  5.61k|      return "\"";
  111|    328|    case '\'':
  ------------------
  |  Branch (111:5): [True: 328, False: 39.9k]
  ------------------
  112|    328|      return "\'";
  113|    519|    case '\\':
  ------------------
  |  Branch (113:5): [True: 519, False: 39.7k]
  ------------------
  114|    519|      return "\\";
  115|  2.99k|    case '/':
  ------------------
  |  Branch (115:5): [True: 2.99k, False: 37.2k]
  ------------------
  116|  2.99k|      return "/";
  117|    585|    case 'N':
  ------------------
  |  Branch (117:5): [True: 585, False: 39.6k]
  ------------------
  118|    585|      return "\xC2\x85";      // NEL (U+0085)
  119|    218|    case '_':
  ------------------
  |  Branch (119:5): [True: 218, False: 40.0k]
  ------------------
  120|    218|      return "\xC2\xA0";      // NBSP (U+00A0)
  121|  9.35k|    case 'L':
  ------------------
  |  Branch (121:5): [True: 9.35k, False: 30.8k]
  ------------------
  122|  9.35k|      return "\xE2\x80\xA8";  // LS (U+2028)
  123|  1.62k|    case 'P':
  ------------------
  |  Branch (123:5): [True: 1.62k, False: 38.6k]
  ------------------
  124|  1.62k|      return "\xE2\x80\xA9";  // PS (U+2029)
  125|    488|    case 'x':
  ------------------
  |  Branch (125:5): [True: 488, False: 39.7k]
  ------------------
  126|    488|      return Escape(in, 2);
  127|    565|    case 'u':
  ------------------
  |  Branch (127:5): [True: 565, False: 39.6k]
  ------------------
  128|    565|      return Escape(in, 4);
  129|    415|    case 'U':
  ------------------
  |  Branch (129:5): [True: 415, False: 39.8k]
  ------------------
  130|    415|      return Escape(in, 8);
  131|  40.2k|  }
  132|       |
  133|    231|  std::stringstream msg;
  134|    231|  throw ParserException(in.mark(), std::string(ErrorMsg::INVALID_ESCAPE) + ch);
  135|  40.2k|}

_ZN4YAML3Exp8DocStartEv:
   84|  2.21M|inline const RegEx& DocStart() {
   85|  2.21M|  static const RegEx e = RegEx("---") + (BlankOrBreak() | RegEx());
   86|  2.21M|  return e;
   87|  2.21M|}
_ZN4YAML3Exp12BlankOrBreakEv:
   43|  32.8M|inline const RegEx& BlankOrBreak() {
   44|  32.8M|  static const RegEx e = Blank() | Break();
   45|  32.8M|  return e;
   46|  32.8M|}
_ZN4YAML3Exp5BlankEv:
   35|  27.3M|inline const RegEx& Blank() {
   36|  27.3M|  static const RegEx e = Space() | Tab();
   37|  27.3M|  return e;
   38|  27.3M|}
_ZN4YAML3Exp5SpaceEv:
   27|      1|inline const RegEx& Space() {
   28|      1|  static const RegEx e = RegEx(' ');
   29|      1|  return e;
   30|      1|}
_ZN4YAML3Exp6DocEndEv:
   88|  2.08M|inline const RegEx& DocEnd() {
   89|  2.08M|  static const RegEx e = RegEx("...") + (BlankOrBreak() | RegEx());
   90|  2.08M|  return e;
   91|  2.08M|}
_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.41M|inline const RegEx& Key() {
  101|  7.41M|  static const RegEx e = RegEx('?') + BlankOrBreak();
  102|  7.41M|  return e;
  103|  7.41M|}
_ZN4YAML3Exp9KeyInFlowEv:
  104|  1.10M|inline const RegEx& KeyInFlow() {
  105|  1.10M|  static const RegEx e = RegEx('?') + BlankOrBreak();
  106|  1.10M|  return e;
  107|  1.10M|}
_ZN4YAML3Exp11PlainScalarEv:
  153|   992k|inline const RegEx& PlainScalar() {
  154|   992k|  static const RegEx e =
  155|   992k|      !(BlankOrBreak() | RegEx(",[]{}#&*!|>\'\"%@`", REGEX_OR) |
  156|   992k|        (RegEx("-?:", REGEX_OR) + (BlankOrBreak() | RegEx())));
  157|   992k|  return e;
  158|   992k|}
_ZN4YAML3Exp17PlainScalarInFlowEv:
  159|  1.04M|inline const RegEx& PlainScalarInFlow() {
  160|  1.04M|  static const RegEx e =
  161|  1.04M|      !(BlankOrBreak() | RegEx("?,[]{}#&*!|>\'\"%@`", REGEX_OR) |
  162|  1.04M|        (RegEx("-:", REGEX_OR) + (Blank() | RegEx())));
  163|  1.04M|  return e;
  164|  1.04M|}
_ZN4YAML3Exp3TabEv:
   31|   135k|inline const RegEx& Tab() {
   32|   135k|  static const RegEx e = RegEx('\t');
   33|   135k|  return e;
   34|   135k|}
_ZN4YAML3Exp7CommentEv:
  124|  60.8M|inline const RegEx Comment() {
  125|  60.8M|  static const RegEx e = RegEx('#');
  126|  60.8M|  return e;
  127|  60.8M|}
_ZN4YAML3Exp5BreakEv:
   39|   189M|inline const RegEx& Break() {
   40|   189M|  static const RegEx e = RegEx('\n') | RegEx("\r\n") | RegEx('\r');
   41|   189M|  return e;
   42|   189M|}
_ZN4YAML3Exp5ValueEv:
  108|  7.40M|inline const RegEx& Value() {
  109|  7.40M|  static const RegEx e = RegEx(':') + (BlankOrBreak() | RegEx());
  110|  7.40M|  return e;
  111|  7.40M|}
_ZN4YAML3Exp15ValueInJSONFlowEv:
  116|  9.42k|inline const RegEx& ValueInJSONFlow() {
  117|  9.42k|  static const RegEx e = RegEx(':');
  118|  9.42k|  return e;
  119|  9.42k|}
_ZN4YAML3Exp11ValueInFlowEv:
  112|  1.07M|inline const RegEx& ValueInFlow() {
  113|  1.07M|  static const RegEx e = RegEx(':') + (BlankOrBreak() | RegEx(",]}", REGEX_OR));
  114|  1.07M|  return e;
  115|  1.07M|}
_ZN4YAML3Exp5EmptyEv:
   23|  5.96k|inline const RegEx& Empty() {
   24|  5.96k|  static const RegEx e;
   25|  5.96k|  return e;
   26|  5.96k|}
_ZN4YAML3Exp5DigitEv:
   47|    514|inline const RegEx& Digit() {
   48|    514|  static const RegEx e = RegEx('0', '9');
   49|    514|  return e;
   50|    514|}
_ZN4YAML3Exp5AlphaEv:
   51|      1|inline const RegEx& Alpha() {
   52|      1|  static const RegEx e = RegEx('a', 'z') | RegEx('A', 'Z');
   53|      1|  return e;
   54|      1|}
_ZN4YAML3Exp12AlphaNumericEv:
   55|      1|inline const RegEx& AlphaNumeric() {
   56|      1|  static const RegEx e = Alpha() | Digit();
   57|      1|  return e;
   58|      1|}
_ZN4YAML3Exp4WordEv:
   59|  8.27M|inline const RegEx& Word() {
   60|  8.27M|  static const RegEx e = AlphaNumeric() | RegEx('-');
   61|  8.27M|  return e;
   62|  8.27M|}
_ZN4YAML3Exp3HexEv:
   63|      4|inline const RegEx& Hex() {
   64|      4|  static const RegEx e = Digit() | RegEx('A', 'F') | RegEx('a', 'f');
   65|      4|  return e;
   66|      4|}
_ZN4YAML3Exp12DocIndicatorEv:
   92|  4.94M|inline const RegEx& DocIndicator() {
   93|  4.94M|  static const RegEx e = DocStart() | DocEnd();
   94|  4.94M|  return e;
   95|  4.94M|}
_ZN4YAML3Exp6AnchorEv:
  128|  27.4M|inline const RegEx& Anchor() {
  129|  27.4M|  static const RegEx e = !(RegEx("[]{},", REGEX_OR) | BlankOrBreak());
  130|  27.4M|  return e;
  131|  27.4M|}
_ZN4YAML3Exp9AnchorEndEv:
  132|  11.2k|inline const RegEx& AnchorEnd() {
  133|  11.2k|  static const RegEx e = RegEx("?:,]}%@`", REGEX_OR) | BlankOrBreak();
  134|  11.2k|  return e;
  135|  11.2k|}
_ZN4YAML3Exp3URIEv:
  136|  8.61k|inline const RegEx& URI() {
  137|  8.61k|  static const RegEx e = Word() | RegEx("#;/?:@&=+$,_.!~*'()[]", REGEX_OR) |
  138|  8.61k|                         (RegEx('%') + Hex() + Hex());
  139|  8.61k|  return e;
  140|  8.61k|}
_ZN4YAML3Exp3TagEv:
  141|  3.75M|inline const RegEx& Tag() {
  142|  3.75M|  static const RegEx e = Word() | RegEx("#;/?:@&=+$_.~*'()", REGEX_OR) |
  143|  3.75M|                         (RegEx('%') + Hex() + Hex());
  144|  3.75M|  return e;
  145|  3.75M|}
_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.04M|inline const RegEx& ScanScalarEndInFlow() {
  177|  1.04M|  static const RegEx e = (EndScalarInFlow() | (BlankOrBreak() + Comment()));
  178|  1.04M|  return e;
  179|  1.04M|}
_ZN4YAML3Exp13ScanScalarEndEv:
  181|   991k|inline const RegEx& ScanScalarEnd() {
  182|   991k|  static const RegEx e = EndScalar() | (BlankOrBreak() + Comment());
  183|   991k|  return e;
  184|   991k|}
_ZN4YAML3Exp14EscSingleQuoteEv:
  185|  1.38k|inline const RegEx& EscSingleQuote() {
  186|  1.38k|  static const RegEx e = RegEx("\'\'");
  187|  1.38k|  return e;
  188|  1.38k|}
_ZN4YAML3Exp8EscBreakEv:
  189|  13.0M|inline const RegEx& EscBreak() {
  190|  13.0M|  static const RegEx e = RegEx('\\') + Break();
  191|  13.0M|  return e;
  192|  13.0M|}
_ZN4YAML3Exp14ChompIndicatorEv:
  194|      3|inline const RegEx& ChompIndicator() {
  195|      3|  static const RegEx e = RegEx("+-", REGEX_OR);
  196|      3|  return e;
  197|      3|}
_ZN4YAML3Exp5ChompEv:
  198|  6.01k|inline const RegEx& Chomp() {
  199|  6.01k|  static const RegEx e = (ChompIndicator() + Digit()) |
  200|  6.01k|                         (Digit() + ChompIndicator()) | ChompIndicator() |
  201|  6.01k|                         Digit();
  202|  6.01k|  return e;
  203|  6.01k|}

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

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

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

_ZN4YAML12IsNullStringEPKcm:
   13|   159k|bool IsNullString(const char* str, std::size_t size) {
   14|   159k|  return size == 0 || same(str, size, "~") || same(str, size, "null") ||
  ------------------
  |  Branch (14:10): [True: 0, False: 159k]
  |  Branch (14:23): [True: 21.4k, False: 137k]
  |  Branch (14:47): [True: 223, False: 137k]
  ------------------
   15|   137k|         same(str, size, "Null") || same(str, size, "NULL");
  ------------------
  |  Branch (15:10): [True: 198, False: 137k]
  |  Branch (15:37): [True: 10, False: 137k]
  ------------------
   16|   159k|}
null.cpp:_ZN4YAMLL4sameILm2EEEbPKcmRAT__S1_:
    8|   159k|static bool same(const char* str, std::size_t size, const char (&literal)[N]) {
    9|   159k|  constexpr int literalSize = N - 1; // minus null terminator
   10|   159k|  return size == literalSize && std::strncmp(str, literal, literalSize) == 0;
  ------------------
  |  Branch (10:10): [True: 143k, False: 16.0k]
  |  Branch (10:33): [True: 21.4k, False: 121k]
  ------------------
   11|   159k|}
null.cpp:_ZN4YAMLL4sameILm5EEEbPKcmRAT__S1_:
    8|   412k|static bool same(const char* str, std::size_t size, const char (&literal)[N]) {
    9|   412k|  constexpr int literalSize = N - 1; // minus null terminator
   10|   412k|  return size == literalSize && std::strncmp(str, literal, literalSize) == 0;
  ------------------
  |  Branch (10:10): [True: 9.51k, False: 402k]
  |  Branch (10:33): [True: 431, False: 9.08k]
  ------------------
   11|   412k|}

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

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

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

_ZN4YAML5RegExC2ENS_8REGEX_OPE:
    6|  2.83k|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|  6.81k|RegEx::RegEx(char ch) : m_op(REGEX_MATCH), m_a(ch), m_z(0), m_params{} {}
_ZN4YAML5RegExC2Ecc:
   11|      5|RegEx::RegEx(char a, char z) : m_op(REGEX_RANGE), m_a(a), m_z(z), m_params{} {}
_ZN4YAML5RegExC2ERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEENS_8REGEX_OPE:
   14|     16|    : m_op(op), m_a(0), m_z(0), m_params(str.begin(), str.end()) {}
_ZN4YAMLntERKNS_5RegExE:
   17|  1.38k|RegEx operator!(const RegEx& ex) {
   18|  1.38k|  RegEx ret(REGEX_NOT);
   19|  1.38k|  ret.m_params.push_back(ex);
   20|  1.38k|  return ret;
   21|  1.38k|}
_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.38k|RegEx operator&(const RegEx& ex1, const RegEx& ex2) {
   31|  1.38k|  RegEx ret(REGEX_AND);
   32|  1.38k|  ret.m_params.push_back(ex1);
   33|  1.38k|  ret.m_params.push_back(ex2);
   34|  1.38k|  return ret;
   35|  1.38k|}
_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|  60.8M|  ~RegEx() = default;

_ZNK4YAML5RegEx7MatchesERKNS_6StreamE:
   26|   460M|inline bool RegEx::Matches(const Stream& in) const { return Match(in) >= 0; }
_ZNK4YAML5RegEx5MatchERKNS_6StreamE:
   49|   505M|inline int RegEx::Match(const Stream& in) const {
   50|   505M|  StreamCharSource source(in);
   51|   505M|  return Match(source);
   52|   505M|}
_ZNK4YAML5RegEx5MatchINS_16StreamCharSourceEEEiRKT_:
   72|  1.05G|inline int RegEx::Match(const Source& source) const {
   73|  1.05G|  return IsValidSource(source) ? MatchUnchecked(source) : -1;
  ------------------
  |  Branch (73:10): [True: 1.05G, False: 0]
  ------------------
   74|  1.05G|}
_ZNK4YAML5RegEx13IsValidSourceINS_16StreamCharSourceEEEbRKT_:
   55|  1.05G|inline bool RegEx::IsValidSource(const Source& source) const {
   56|  1.05G|  return source;
   57|  1.05G|}
_ZNK4YAML5RegEx14MatchUncheckedINS_16StreamCharSourceEEEiRKT_:
   77|  3.43G|inline int RegEx::MatchUnchecked(const Source& source) const {
   78|  3.43G|  switch (m_op) {
  ------------------
  |  Branch (78:11): [True: 3.43G, False: 0]
  ------------------
   79|  15.6M|    case REGEX_EMPTY:
  ------------------
  |  Branch (79:5): [True: 15.6M, False: 3.41G]
  ------------------
   80|  15.6M|      return MatchOpEmpty(source);
   81|  1.74G|    case REGEX_MATCH:
  ------------------
  |  Branch (81:5): [True: 1.74G, False: 1.68G]
  ------------------
   82|  1.74G|      return MatchOpMatch(source);
   83|  24.7M|    case REGEX_RANGE:
  ------------------
  |  Branch (83:5): [True: 24.7M, False: 3.40G]
  ------------------
   84|  24.7M|      return MatchOpRange(source);
   85|  1.12G|    case REGEX_OR:
  ------------------
  |  Branch (85:5): [True: 1.12G, False: 2.31G]
  ------------------
   86|  1.12G|      return MatchOpOr(source);
   87|  15.8M|    case REGEX_AND:
  ------------------
  |  Branch (87:5): [True: 15.8M, False: 3.41G]
  ------------------
   88|  15.8M|      return MatchOpAnd(source);
   89|  29.4M|    case REGEX_NOT:
  ------------------
  |  Branch (89:5): [True: 29.4M, False: 3.40G]
  ------------------
   90|  29.4M|      return MatchOpNot(source);
   91|   482M|    case REGEX_SEQ:
  ------------------
  |  Branch (91:5): [True: 482M, False: 2.95G]
  ------------------
   92|   482M|      return MatchOpSeq(source);
   93|  3.43G|  }
   94|       |
   95|      0|  return -1;
   96|  3.43G|}
_ZNK4YAML5RegEx12MatchOpEmptyINS_16StreamCharSourceEEEiRKT_:
  106|  15.6M|inline int RegEx::MatchOpEmpty(const Source& source) const {
  107|  15.6M|  return source[0] == Stream::eof() ? 0 : -1;
  ------------------
  |  Branch (107:10): [True: 1.20M, False: 14.4M]
  ------------------
  108|  15.6M|}
_ZNK4YAML5RegEx12MatchOpMatchINS_16StreamCharSourceEEEiRKT_:
  119|  1.74G|inline int RegEx::MatchOpMatch(const Source& source) const {
  120|  1.74G|  if (source[0] != m_a)
  ------------------
  |  Branch (120:7): [True: 1.60G, False: 135M]
  ------------------
  121|  1.60G|    return -1;
  122|   135M|  return 1;
  123|  1.74G|}
_ZNK4YAML5RegEx12MatchOpRangeINS_16StreamCharSourceEEEiRKT_:
  127|  24.7M|inline int RegEx::MatchOpRange(const Source& source) const {
  128|  24.7M|  if (m_a > source[0] || m_z < source[0])
  ------------------
  |  Branch (128:7): [True: 18.8M, False: 5.87M]
  |  Branch (128:26): [True: 58.6k, False: 5.81M]
  ------------------
  129|  18.9M|    return -1;
  130|  5.81M|  return 1;
  131|  24.7M|}
_ZNK4YAML5RegEx9MatchOpOrINS_16StreamCharSourceEEEiRKT_:
  135|  1.12G|inline int RegEx::MatchOpOr(const Source& source) const {
  136|  2.32G|  for (const RegEx& param : m_params) {
  ------------------
  |  Branch (136:27): [True: 2.32G, False: 959M]
  ------------------
  137|  2.32G|    int n = param.MatchUnchecked(source);
  138|  2.32G|    if (n >= 0)
  ------------------
  |  Branch (138:9): [True: 162M, False: 2.16G]
  ------------------
  139|   162M|      return n;
  140|  2.32G|  }
  141|   959M|  return -1;
  142|  1.12G|}
_ZNK4YAML5RegEx10MatchOpAndINS_16StreamCharSourceEEEiRKT_:
  149|  15.8M|inline int RegEx::MatchOpAnd(const Source& source) const {
  150|  15.8M|  int first = -1;
  151|  15.8M|  for (std::size_t i = 0; i < m_params.size(); i++) {
  ------------------
  |  Branch (151:27): [True: 15.8M, False: 2.49k]
  ------------------
  152|  15.8M|    int n = m_params[i].MatchUnchecked(source);
  153|  15.8M|    if (n == -1)
  ------------------
  |  Branch (153:9): [True: 15.8M, False: 5.97k]
  ------------------
  154|  15.8M|      return -1;
  155|  5.97k|    if (i == 0)
  ------------------
  |  Branch (155:9): [True: 3.47k, False: 2.49k]
  ------------------
  156|  3.47k|      first = n;
  157|  5.97k|  }
  158|  2.49k|  return first;
  159|  15.8M|}
_ZNK4YAML5RegEx10MatchOpNotINS_16StreamCharSourceEEEiRKT_:
  163|  29.4M|inline int RegEx::MatchOpNot(const Source& source) const {
  164|  29.4M|  if (m_params.empty())
  ------------------
  |  Branch (164:7): [True: 0, False: 29.4M]
  ------------------
  165|      0|    return -1;
  166|  29.4M|  if (m_params[0].MatchUnchecked(source) >= 0)
  ------------------
  |  Branch (166:7): [True: 12.3k, False: 29.4M]
  ------------------
  167|  12.3k|    return -1;
  168|  29.4M|  return 1;
  169|  29.4M|}
_ZNK4YAML5RegEx10MatchOpSeqINS_16StreamCharSourceEEEiRKT_:
  173|   482M|inline int RegEx::MatchOpSeq(const Source& source) const {
  174|   482M|  int offset = 0;
  175|   553M|  for (const RegEx& param : m_params) {
  ------------------
  |  Branch (175:27): [True: 553M, False: 8.13M]
  ------------------
  176|   553M|    int n = param.Match(source + offset);  // note Match, not
  177|       |                                           // MatchUnchecked because we
  178|       |                                           // need to check validity after
  179|       |                                           // the offset
  180|   553M|    if (n == -1)
  ------------------
  |  Branch (180:9): [True: 474M, False: 79.2M]
  ------------------
  181|   474M|      return -1;
  182|  79.2M|    offset += n;
  183|  79.2M|  }
  184|       |
  185|  8.13M|  return offset;
  186|   482M|}
_ZNK4YAML5RegEx7MatchesEc:
   16|    509|inline bool RegEx::Matches(char ch) const {
   17|    509|  std::string str;
   18|    509|  str += ch;
   19|    509|  return Matches(str);
   20|    509|}
_ZNK4YAML5RegEx7MatchesERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
   22|    509|inline bool RegEx::Matches(const std::string& str) const {
   23|    509|  return Match(str) >= 0;
   24|    509|}
_ZNK4YAML5RegEx5MatchERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
   44|    509|inline int RegEx::Match(const std::string& str) const {
   45|    509|  StringCharSource source(str.c_str(), str.size());
   46|    509|  return Match(source);
   47|    509|}
_ZNK4YAML5RegEx13IsValidSourceINS_16StringCharSourceEEEbRKT_:
   61|    509|    const StringCharSource& source) const {
   62|    509|  switch (m_op) {
   63|      0|    case REGEX_MATCH:
  ------------------
  |  Branch (63:5): [True: 0, False: 509]
  ------------------
   64|    509|    case REGEX_RANGE:
  ------------------
  |  Branch (64:5): [True: 509, False: 0]
  ------------------
   65|    509|      return source;
   66|      0|    default:
  ------------------
  |  Branch (66:5): [True: 0, False: 509]
  ------------------
   67|      0|      return true;
   68|    509|  }
   69|    509|}
_ZNK4YAML5RegEx5MatchINS_16StringCharSourceEEEiRKT_:
   72|    509|inline int RegEx::Match(const Source& source) const {
   73|    509|  return IsValidSource(source) ? MatchUnchecked(source) : -1;
  ------------------
  |  Branch (73:10): [True: 509, False: 0]
  ------------------
   74|    509|}
_ZNK4YAML5RegEx14MatchUncheckedINS_16StringCharSourceEEEiRKT_:
   77|    509|inline int RegEx::MatchUnchecked(const Source& source) const {
   78|    509|  switch (m_op) {
  ------------------
  |  Branch (78:11): [True: 509, False: 0]
  ------------------
   79|      0|    case REGEX_EMPTY:
  ------------------
  |  Branch (79:5): [True: 0, False: 509]
  ------------------
   80|      0|      return MatchOpEmpty(source);
   81|      0|    case REGEX_MATCH:
  ------------------
  |  Branch (81:5): [True: 0, False: 509]
  ------------------
   82|      0|      return MatchOpMatch(source);
   83|    509|    case REGEX_RANGE:
  ------------------
  |  Branch (83:5): [True: 509, False: 0]
  ------------------
   84|    509|      return MatchOpRange(source);
   85|      0|    case REGEX_OR:
  ------------------
  |  Branch (85:5): [True: 0, False: 509]
  ------------------
   86|      0|      return MatchOpOr(source);
   87|      0|    case REGEX_AND:
  ------------------
  |  Branch (87:5): [True: 0, False: 509]
  ------------------
   88|      0|      return MatchOpAnd(source);
   89|      0|    case REGEX_NOT:
  ------------------
  |  Branch (89:5): [True: 0, False: 509]
  ------------------
   90|      0|      return MatchOpNot(source);
   91|      0|    case REGEX_SEQ:
  ------------------
  |  Branch (91:5): [True: 0, False: 509]
  ------------------
   92|      0|      return MatchOpSeq(source);
   93|    509|  }
   94|       |
   95|      0|  return -1;
   96|    509|}
_ZNK4YAML5RegEx12MatchOpRangeINS_16StringCharSourceEEEiRKT_:
  127|    509|inline int RegEx::MatchOpRange(const Source& source) const {
  128|    509|  if (m_a > source[0] || m_z < source[0])
  ------------------
  |  Branch (128:7): [True: 0, False: 509]
  |  Branch (128:26): [True: 0, False: 509]
  ------------------
  129|      0|    return -1;
  130|    509|  return 1;
  131|    509|}

_ZN4YAML7ScannerC2ERNSt3__113basic_istreamIcNS1_11char_traitsIcEEEE:
   24|  6.15k|    : INPUT(in),
   25|  6.15k|      m_tokens{},
   26|  6.15k|      m_startedStream(false),
   27|  6.15k|      m_endedStream(false),
   28|  6.15k|      m_simpleKeyAllowed(false),
   29|  6.15k|      m_scalarValueAllowed(false),
   30|  6.15k|      m_canBeJSONFlow(false),
   31|  6.15k|      m_simpleKeys{},
   32|  6.15k|      m_indents{},
   33|  6.15k|      m_indentRefs{},
   34|  6.15k|      m_flows{} {}
_ZN4YAML7ScannerD2Ev:
   36|  6.15k|Scanner::~Scanner() = default;
_ZN4YAML7Scanner5emptyEv:
   38|  8.60M|bool Scanner::empty() {
   39|  8.60M|  EnsureTokensInQueue();
   40|  8.60M|  return m_tokens.empty();
   41|  8.60M|}
_ZN4YAML7Scanner3popEv:
   43|  2.00M|void Scanner::pop() {
   44|  2.00M|  EnsureTokensInQueue();
   45|  2.00M|  if (!m_tokens.empty())
  ------------------
  |  Branch (45:7): [True: 2.00M, False: 0]
  ------------------
   46|  2.00M|    m_tokens.pop();
   47|  2.00M|}
_ZN4YAML7Scanner4peekEv:
   49|  12.2M|Token& Scanner::peek() {
   50|  12.2M|  EnsureTokensInQueue();
   51|  12.2M|  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|  12.2M|  return m_tokens.front();
   63|  12.2M|}
_ZNK4YAML7Scanner4markEv:
   65|  1.35M|Mark Scanner::mark() const { return INPUT.mark(); }
_ZN4YAML7Scanner19EnsureTokensInQueueEv:
   67|  22.9M|void Scanner::EnsureTokensInQueue() {
   68|  75.8M|  while (true) {
  ------------------
  |  Branch (68:10): [True: 75.8M, Folded]
  ------------------
   69|  75.8M|    if (!m_tokens.empty()) {
  ------------------
  |  Branch (69:9): [True: 75.1M, False: 687k]
  ------------------
   70|  75.1M|      Token& token = m_tokens.front();
   71|       |
   72|       |      // if this guy's valid, then we're done
   73|  75.1M|      if (token.status == Token::VALID) {
  ------------------
  |  Branch (73:11): [True: 22.3M, False: 52.8M]
  ------------------
   74|  22.3M|        return;
   75|  22.3M|      }
   76|       |
   77|       |      // here's where we clean up the impossible tokens
   78|  52.8M|      if (token.status == Token::INVALID) {
  ------------------
  |  Branch (78:11): [True: 33.8k, False: 52.7M]
  ------------------
   79|  33.8k|        m_tokens.pop();
   80|  33.8k|        continue;
   81|  33.8k|      }
   82|       |
   83|       |      // note: what's left are the unverified tokens
   84|  52.8M|    }
   85|       |
   86|       |    // no token? maybe we've actually finished
   87|  53.4M|    if (m_endedStream) {
  ------------------
  |  Branch (87:9): [True: 589k, False: 52.8M]
  ------------------
   88|   589k|      return;
   89|   589k|    }
   90|       |
   91|       |    // no? then scan...
   92|  52.8M|    ScanNextToken();
   93|  52.8M|  }
   94|  22.9M|}
_ZN4YAML7Scanner13ScanNextTokenEv:
   96|  52.8M|void Scanner::ScanNextToken() {
   97|  52.8M|  if (m_endedStream) {
  ------------------
  |  Branch (97:7): [True: 0, False: 52.8M]
  ------------------
   98|      0|    return;
   99|      0|  }
  100|       |
  101|  52.8M|  if (!m_startedStream) {
  ------------------
  |  Branch (101:7): [True: 6.15k, False: 52.8M]
  ------------------
  102|  6.15k|    return StartStream();
  103|  6.15k|  }
  104|       |
  105|       |  // get rid of whitespace, etc. (in between tokens it should be irrelevant)
  106|  52.8M|  ScanToNextToken();
  107|       |
  108|       |  // maybe need to end some blocks
  109|  52.8M|  PopIndentToHere();
  110|       |
  111|       |  // *****
  112|       |  // And now branch based on the next few characters!
  113|       |  // *****
  114|       |
  115|       |  // end of stream
  116|  52.8M|  if (!INPUT) {
  ------------------
  |  Branch (116:7): [True: 5.04k, False: 52.8M]
  ------------------
  117|  5.04k|    return EndStream();
  118|  5.04k|  }
  119|       |
  120|  52.8M|  if (INPUT.column() == 0 && INPUT.peek() == Keys::Directive) {
  ------------------
  |  Branch (120:7): [True: 2.22M, False: 50.6M]
  |  Branch (120:30): [True: 12.2k, False: 2.21M]
  ------------------
  121|  12.2k|    return ScanDirective();
  122|  12.2k|  }
  123|       |
  124|       |  // document token
  125|  52.8M|  if (INPUT.column() == 0 && Exp::DocStart().Matches(INPUT)) {
  ------------------
  |  Branch (125:7): [True: 2.21M, False: 50.6M]
  |  Branch (125:30): [True: 130k, False: 2.08M]
  ------------------
  126|   130k|    return ScanDocStart();
  127|   130k|  }
  128|       |
  129|  52.7M|  if (INPUT.column() == 0 && Exp::DocEnd().Matches(INPUT)) {
  ------------------
  |  Branch (129:7): [True: 2.08M, False: 50.6M]
  |  Branch (129:30): [True: 241k, False: 1.84M]
  ------------------
  130|   241k|    return ScanDocEnd();
  131|   241k|  }
  132|       |
  133|       |  // flow start/end/entry
  134|  52.4M|  if (INPUT.peek() == Keys::FlowSeqStart ||
  ------------------
  |  Branch (134:7): [True: 24.2M, False: 28.2M]
  ------------------
  135|  39.8M|      INPUT.peek() == Keys::FlowMapStart) {
  ------------------
  |  Branch (135:7): [True: 15.5M, False: 12.6M]
  ------------------
  136|  39.8M|    return ScanFlowStart();
  137|  39.8M|  }
  138|       |
  139|  12.6M|  if (INPUT.peek() == Keys::FlowSeqEnd || INPUT.peek() == Keys::FlowMapEnd) {
  ------------------
  |  Branch (139:7): [True: 17.9k, False: 12.5M]
  |  Branch (139:43): [True: 919k, False: 11.6M]
  ------------------
  140|   937k|    return ScanFlowEnd();
  141|   937k|  }
  142|       |
  143|  11.6M|  if (INPUT.peek() == Keys::FlowEntry) {
  ------------------
  |  Branch (143:7): [True: 2.00M, False: 9.66M]
  ------------------
  144|       |    // values starting with `,` are not allowed.
  145|       |    // eg: reject `,foo`
  146|  2.00M|    if (INPUT.column() == 0) {
  ------------------
  |  Branch (146:9): [True: 13, False: 2.00M]
  ------------------
  147|     13|      throw ParserException(INPUT.mark(), ErrorMsg::UNEXPECTED_FLOW);
  148|     13|    }
  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.00M|    if (!m_scalarValueAllowed) {
  ------------------
  |  Branch (152:9): [True: 4, False: 2.00M]
  ------------------
  153|      4|      throw ParserException(INPUT.mark(), ErrorMsg::UNEXPECTED_SCALAR);
  154|      4|    }
  155|  2.00M|    return ScanFlowEntry();
  156|  2.00M|  }
  157|       |
  158|       |  // block/map stuff
  159|  9.66M|  if (Exp::BlockEntry().Matches(INPUT)) {
  ------------------
  |  Branch (159:7): [True: 1.14M, False: 8.52M]
  ------------------
  160|  1.14M|    return ScanBlockEntry();
  161|  1.14M|  }
  162|       |
  163|  8.52M|  if ((InBlockContext() ? Exp::Key() : Exp::KeyInFlow()).Matches(INPUT)) {
  ------------------
  |  Branch (163:7): [True: 27.0k, False: 8.49M]
  |  Branch (163:8): [True: 7.41M, False: 1.10M]
  ------------------
  164|  27.0k|    return ScanKey();
  165|  27.0k|  }
  166|       |
  167|  8.49M|  if (GetValueRegex().Matches(INPUT)) {
  ------------------
  |  Branch (167:7): [True: 5.51M, False: 2.97M]
  ------------------
  168|  5.51M|    return ScanValue();
  169|  5.51M|  }
  170|       |
  171|       |  // alias/anchor
  172|  2.97M|  if (INPUT.peek() == Keys::Alias || INPUT.peek() == Keys::Anchor) {
  ------------------
  |  Branch (172:7): [True: 1.41k, False: 2.97M]
  |  Branch (172:38): [True: 10.5k, False: 2.96M]
  ------------------
  173|  11.9k|    return ScanAnchorOrAlias();
  174|  11.9k|  }
  175|       |
  176|       |  // tag
  177|  2.96M|  if (INPUT.peek() == Keys::Tag) {
  ------------------
  |  Branch (177:7): [True: 915k, False: 2.05M]
  ------------------
  178|   915k|    return ScanTag();
  179|   915k|  }
  180|       |
  181|       |  // special scalars
  182|  2.05M|  if (InBlockContext() && (INPUT.peek() == Keys::LiteralScalar ||
  ------------------
  |  Branch (182:7): [True: 998k, False: 1.05M]
  |  Branch (182:28): [True: 742, False: 998k]
  ------------------
  183|   998k|                           INPUT.peek() == Keys::FoldedScalar)) {
  ------------------
  |  Branch (183:28): [True: 5.27k, False: 992k]
  ------------------
  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|  6.01k|    if (!m_simpleKeys.empty() &&
  ------------------
  |  Branch (191:9): [True: 898, False: 5.11k]
  ------------------
  192|    898|      m_simpleKeys.top().pKey->status == Token::UNVERIFIED) {
  ------------------
  |  Branch (192:7): [True: 898, 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|    898|      if (m_simpleKeys.top().pIndent && !m_indents.empty() &&
  ------------------
  |  Branch (196:11): [True: 687, False: 211]
  |  Branch (196:41): [True: 687, False: 0]
  ------------------
  197|    687|          m_indents.top() == m_simpleKeys.top().pIndent) {
  ------------------
  |  Branch (197:11): [True: 471, False: 216]
  ------------------
  198|    471|        PopIndent();
  199|    471|      } else {
  200|    427|        InvalidateSimpleKey();
  201|    427|      }
  202|    898|    }
  203|  6.01k|    return ScanBlockScalar();
  204|  6.01k|  }
  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.04M|  if (!m_scalarValueAllowed) {
  ------------------
  |  Branch (209:7): [True: 37, False: 2.04M]
  ------------------
  210|     37|    throw ParserException(INPUT.mark(), ErrorMsg::UNEXPECTED_SCALAR);
  211|     37|  }
  212|       |
  213|  2.04M|  if (INPUT.peek() == '\'' || INPUT.peek() == '\"') {
  ------------------
  |  Branch (213:7): [True: 1.38k, False: 2.04M]
  |  Branch (213:31): [True: 5.29k, False: 2.03M]
  ------------------
  214|  6.68k|    return ScanQuotedScalar();
  215|  6.68k|  }
  216|       |
  217|       |  // plain scalars
  218|  2.03M|  if ((InBlockContext() ? Exp::PlainScalar() : Exp::PlainScalarInFlow())
  ------------------
  |  Branch (218:7): [True: 2.03M, False: 51]
  |  Branch (218:8): [True: 992k, False: 1.04M]
  ------------------
  219|  2.03M|          .Matches(INPUT)) {
  220|  2.03M|    return ScanPlainScalar();
  221|  2.03M|  }
  222|       |
  223|       |  // don't know what it is!
  224|     51|  throw ParserException(INPUT.mark(), ErrorMsg::UNKNOWN_TOKEN);
  225|  2.03M|}
_ZN4YAML7Scanner15ScanToNextTokenEv:
  227|  52.8M|void Scanner::ScanToNextToken() {
  228|  59.8M|  while (true) {
  ------------------
  |  Branch (228:10): [True: 59.8M, Folded]
  ------------------
  229|       |    // first eat whitespace
  230|  60.0M|    while (INPUT && IsWhitespaceToBeEaten(INPUT.peek())) {
  ------------------
  |  Branch (230:12): [True: 60.0M, False: 4.98k]
  |  Branch (230:21): [True: 170k, False: 59.8M]
  ------------------
  231|   170k|      if (InBlockContext() && Exp::Tab().Matches(INPUT)) {
  ------------------
  |  Branch (231:11): [True: 135k, False: 34.4k]
  |  Branch (231:31): [True: 2.01k, False: 133k]
  ------------------
  232|  2.01k|        m_simpleKeyAllowed = false;
  233|  2.01k|      }
  234|   170k|      INPUT.eat(1);
  235|   170k|    }
  236|       |
  237|       |    // then eat a comment
  238|  59.8M|    if (Exp::Comment().Matches(INPUT)) {
  ------------------
  |  Branch (238:9): [True: 1.81k, False: 59.8M]
  ------------------
  239|       |      // eat until line break
  240|  5.22M|      while (INPUT && !Exp::Break().Matches(INPUT)) {
  ------------------
  |  Branch (240:14): [True: 5.22M, False: 68]
  |  Branch (240:23): [True: 5.22M, False: 1.74k]
  ------------------
  241|  5.22M|        INPUT.eat(1);
  242|  5.22M|      }
  243|  1.81k|    }
  244|       |
  245|       |    // if it's NOT a line break, then we're done!
  246|  59.8M|    if (!Exp::Break().Matches(INPUT)) {
  ------------------
  |  Branch (246:9): [True: 52.8M, False: 6.98M]
  ------------------
  247|  52.8M|      break;
  248|  52.8M|    }
  249|       |
  250|       |    // otherwise, let's eat the line break and keep going
  251|  6.98M|    int n = Exp::Break().Match(INPUT);
  252|  6.98M|    INPUT.eat(n);
  253|       |
  254|       |    // oh yeah, and let's get rid of that simple key
  255|  6.98M|    InvalidateSimpleKey();
  256|       |
  257|       |    // new line - we accept a scalar value now
  258|  6.98M|    m_scalarValueAllowed = true;
  259|       |
  260|       |    // new line - we may be able to accept a simple key now
  261|  6.98M|    if (InBlockContext()) {
  ------------------
  |  Branch (261:9): [True: 6.95M, False: 29.0k]
  ------------------
  262|  6.95M|      m_simpleKeyAllowed = true;
  263|  6.95M|    }
  264|  6.98M|  }
  265|  52.8M|}
_ZNK4YAML7Scanner13GetValueRegexEv:
  270|  8.49M|const RegEx& Scanner::GetValueRegex() const {
  271|  8.49M|  if (InBlockContext()) {
  ------------------
  |  Branch (271:7): [True: 7.40M, False: 1.08M]
  ------------------
  272|  7.40M|    return Exp::Value();
  273|  7.40M|  }
  274|       |
  275|  1.08M|  return m_canBeJSONFlow ? Exp::ValueInJSONFlow() : Exp::ValueInFlow();
  ------------------
  |  Branch (275:10): [True: 9.42k, False: 1.07M]
  ------------------
  276|  8.49M|}
_ZN4YAML7Scanner11StartStreamEv:
  278|  6.15k|void Scanner::StartStream() {
  279|  6.15k|  m_startedStream = true;
  280|  6.15k|  m_simpleKeyAllowed = true;
  281|  6.15k|  m_scalarValueAllowed = true;
  282|  6.15k|  std::unique_ptr<IndentMarker> pIndent(
  283|  6.15k|      new IndentMarker(-1, IndentMarker::NONE));
  284|  6.15k|  m_indentRefs.push_back(std::move(pIndent));
  285|  6.15k|  m_indents.push(&m_indentRefs.back());
  286|  6.15k|}
_ZN4YAML7Scanner9EndStreamEv:
  288|  5.04k|void Scanner::EndStream() {
  289|       |  // force newline
  290|  5.04k|  if (INPUT.column() > 0) {
  ------------------
  |  Branch (290:7): [True: 4.67k, False: 374]
  ------------------
  291|  4.67k|    INPUT.ResetColumn();
  292|  4.67k|  }
  293|       |
  294|  5.04k|  PopAllIndents();
  295|  5.04k|  PopAllSimpleKeys();
  296|       |
  297|  5.04k|  m_simpleKeyAllowed = false;
  298|  5.04k|  m_scalarValueAllowed = false;
  299|  5.04k|  m_endedStream = true;
  300|  5.04k|}
_ZN4YAML7Scanner9PushTokenENS_5Token4TYPEE:
  302|  8.20M|Token* Scanner::PushToken(Token::TYPE type) {
  303|  8.20M|  m_tokens.push(Token(type, INPUT.mark()));
  304|  8.20M|  return &m_tokens.back();
  305|  8.20M|}
_ZN4YAML7Scanner16GetStartTokenForENS0_12IndentMarker11INDENT_TYPEE:
  307|  8.20M|Token::TYPE Scanner::GetStartTokenFor(IndentMarker::INDENT_TYPE type) {
  308|  8.20M|  switch (type) {
  ------------------
  |  Branch (308:11): [True: 8.20M, False: 0]
  ------------------
  309|  1.14M|    case IndentMarker::SEQ:
  ------------------
  |  Branch (309:5): [True: 1.14M, False: 7.06M]
  ------------------
  310|  1.14M|      return Token::BLOCK_SEQ_START;
  311|  7.06M|    case IndentMarker::MAP:
  ------------------
  |  Branch (311:5): [True: 7.06M, False: 1.14M]
  ------------------
  312|  7.06M|      return Token::BLOCK_MAP_START;
  313|      0|    case IndentMarker::NONE:
  ------------------
  |  Branch (313:5): [True: 0, False: 8.20M]
  ------------------
  314|      0|      assert(false);
  315|      0|      break;
  316|  8.20M|  }
  317|  8.20M|  assert(false);
  318|      0|  throw std::runtime_error("yaml-cpp: internal error, invalid indent type");
  319|  8.20M|}
_ZN4YAML7Scanner12PushIndentToEiNS0_12IndentMarker11INDENT_TYPEE:
  322|  8.38M|                                             IndentMarker::INDENT_TYPE type) {
  323|       |  // are we in flow?
  324|  8.38M|  if (InFlowContext()) {
  ------------------
  |  Branch (324:7): [True: 0, False: 8.38M]
  ------------------
  325|      0|    return nullptr;
  326|      0|  }
  327|       |
  328|  8.38M|  std::unique_ptr<IndentMarker> pIndent(new IndentMarker(column, type));
  329|  8.38M|  IndentMarker& indent = *pIndent;
  330|  8.38M|  const IndentMarker& lastIndent = *m_indents.top();
  331|       |
  332|       |  // is this actually an indentation?
  333|  8.38M|  if (indent.column < lastIndent.column) {
  ------------------
  |  Branch (333:7): [True: 0, False: 8.38M]
  ------------------
  334|      0|    return nullptr;
  335|      0|  }
  336|  8.38M|  if (indent.column == lastIndent.column &&
  ------------------
  |  Branch (336:7): [True: 186k, False: 8.19M]
  ------------------
  337|   186k|      !(indent.type == IndentMarker::SEQ &&
  ------------------
  |  Branch (337:9): [True: 11.3k, False: 175k]
  ------------------
  338|   179k|        lastIndent.type == IndentMarker::MAP)) {
  ------------------
  |  Branch (338:9): [True: 7.60k, False: 3.79k]
  ------------------
  339|   179k|    return nullptr;
  340|   179k|  }
  341|       |
  342|       |  // push a start token
  343|  8.20M|  indent.pStartToken = PushToken(GetStartTokenFor(type));
  344|       |
  345|       |  // and then the indent
  346|  8.20M|  m_indents.push(&indent);
  347|  8.20M|  m_indentRefs.push_back(std::move(pIndent));
  348|  8.20M|  return &m_indentRefs.back();
  349|  8.38M|}
_ZN4YAML7Scanner15PopIndentToHereEv:
  351|  52.8M|void Scanner::PopIndentToHere() {
  352|       |  // are we in flow?
  353|  52.8M|  if (InFlowContext()) {
  ------------------
  |  Branch (353:7): [True: 43.9M, False: 8.91M]
  ------------------
  354|  43.9M|    return;
  355|  43.9M|  }
  356|       |
  357|       |  // now pop away
  358|  11.1M|  while (!m_indents.empty()) {
  ------------------
  |  Branch (358:10): [True: 11.1M, False: 0]
  ------------------
  359|  11.1M|    const IndentMarker& indent = *m_indents.top();
  360|  11.1M|    if (indent.column < INPUT.column()) {
  ------------------
  |  Branch (360:9): [True: 7.88M, False: 3.28M]
  ------------------
  361|  7.88M|      break;
  362|  7.88M|    }
  363|  3.28M|    if (indent.column == INPUT.column() &&
  ------------------
  |  Branch (363:9): [True: 1.83M, False: 1.45M]
  ------------------
  364|  1.83M|        !(indent.type == IndentMarker::SEQ &&
  ------------------
  |  Branch (364:11): [True: 811k, False: 1.02M]
  ------------------
  365|  1.02M|          !Exp::BlockEntry().Matches(INPUT))) {
  ------------------
  |  Branch (365:11): [True: 807k, False: 3.79k]
  ------------------
  366|  1.02M|      break;
  367|  1.02M|    }
  368|       |
  369|  2.26M|    PopIndent();
  370|  2.26M|  }
  371|       |
  372|  9.80M|  while (!m_indents.empty() &&
  ------------------
  |  Branch (372:10): [True: 9.80M, False: 0]
  ------------------
  373|  9.80M|         m_indents.top()->status == IndentMarker::INVALID) {
  ------------------
  |  Branch (373:10): [True: 890k, False: 8.91M]
  ------------------
  374|   890k|    PopIndent();
  375|   890k|  }
  376|  8.91M|}
_ZN4YAML7Scanner13PopAllIndentsEv:
  378|   389k|void Scanner::PopAllIndents() {
  379|       |  // are we in flow?
  380|   389k|  if (InFlowContext()) {
  ------------------
  |  Branch (380:7): [True: 39.4k, False: 350k]
  ------------------
  381|  39.4k|    return;
  382|  39.4k|  }
  383|       |
  384|       |  // now pop away
  385|  2.90M|  while (!m_indents.empty()) {
  ------------------
  |  Branch (385:10): [True: 2.90M, False: 0]
  ------------------
  386|  2.90M|    const IndentMarker& indent = *m_indents.top();
  387|  2.90M|    if (indent.type == IndentMarker::NONE) {
  ------------------
  |  Branch (387:9): [True: 350k, False: 2.55M]
  ------------------
  388|   350k|      break;
  389|   350k|    }
  390|       |
  391|  2.55M|    PopIndent();
  392|  2.55M|  }
  393|   350k|}
_ZN4YAML7Scanner9PopIndentEv:
  395|  5.70M|void Scanner::PopIndent() {
  396|  5.70M|  if (m_indents.empty()) {
  ------------------
  |  Branch (396:7): [True: 0, False: 5.70M]
  ------------------
  397|      0|    ThrowParserException(ErrorMsg::INDENT_STACK_UNDERFLOW);
  398|      0|  }
  399|  5.70M|  const IndentMarker& indent = *m_indents.top();
  400|  5.70M|  m_indents.pop();
  401|       |
  402|  5.70M|  if (indent.status != IndentMarker::VALID) {
  ------------------
  |  Branch (402:7): [True: 1.70M, False: 4.00M]
  ------------------
  403|  1.70M|    InvalidateSimpleKey();
  404|  1.70M|    return;
  405|  1.70M|  }
  406|       |
  407|  4.00M|  if (indent.type == IndentMarker::SEQ) {
  ------------------
  |  Branch (407:7): [True: 992k, False: 3.00M]
  ------------------
  408|   992k|    m_tokens.push(Token(Token::BLOCK_SEQ_END, INPUT.mark()));
  409|  3.00M|  } else if (indent.type == IndentMarker::MAP) {
  ------------------
  |  Branch (409:14): [True: 3.00M, False: 0]
  ------------------
  410|  3.00M|    m_tokens.push(Token(Token::BLOCK_MAP_END, INPUT.mark()));
  411|  3.00M|  }
  412|  4.00M|}
_ZNK4YAML7Scanner12GetTopIndentEv:
  414|  1.00M|int Scanner::GetTopIndent() const {
  415|  1.00M|  if (m_indents.empty()) {
  ------------------
  |  Branch (415:7): [True: 0, False: 1.00M]
  ------------------
  416|      0|    return 0;
  417|      0|  }
  418|  1.00M|  return m_indents.top()->column;
  419|  1.00M|}
scanner.cpp:_ZN4YAML12_GLOBAL__N_121IsWhitespaceToBeEatenEc:
   20|  60.0M|bool IsWhitespaceToBeEaten(char ch) { return (ch == ' ') || (ch == '\t'); }
  ------------------
  |  Branch (20:46): [True: 146k, False: 59.8M]
  |  Branch (20:61): [True: 24.2k, False: 59.8M]
  ------------------

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

_ZN4YAML10ScanScalarERNS_6StreamERNS_16ScanScalarParamsE:
   21|  2.05M|std::string ScanScalar(Stream& INPUT, ScanScalarParams& params) {
   22|  2.05M|  bool foundNonEmptyLine = false;
   23|  2.05M|  bool pastOpeningBreak = (params.fold == FOLD_FLOW);
   24|  2.05M|  bool emptyLine = false, moreIndented = false;
   25|  2.05M|  int foldedNewlineCount = 0;
   26|  2.05M|  bool foldedNewlineStartedMoreIndented = false;
   27|  2.05M|  std::size_t lastEscapedChar = std::string::npos;
   28|  2.05M|  std::string scalar;
   29|  2.05M|  params.leadingSpaces = false;
   30|       |
   31|  2.05M|  if (!params.end) {
  ------------------
  |  Branch (31:7): [True: 5.96k, False: 2.04M]
  ------------------
   32|  5.96k|    params.end = &Exp::Empty();
   33|  5.96k|  }
   34|       |
   35|  13.9M|  while (INPUT) {
  ------------------
  |  Branch (35:10): [True: 13.9M, False: 862]
  ------------------
   36|       |    // ********************************
   37|       |    // Phase #1: scan until line ending
   38|       |
   39|  13.9M|    std::size_t lastNonWhitespaceChar = scalar.size();
   40|  13.9M|    bool escapedNewline = false;
   41|  90.2M|    while (!params.end->Matches(INPUT) && !Exp::Break().Matches(INPUT)) {
  ------------------
  |  Branch (41:12): [True: 89.1M, False: 1.08M]
  |  Branch (41:43): [True: 76.4M, False: 12.7M]
  ------------------
   42|  76.4M|      if (!INPUT) {
  ------------------
  |  Branch (42:11): [True: 1.66k, False: 76.4M]
  ------------------
   43|  1.66k|        break;
   44|  1.66k|      }
   45|       |
   46|       |      // document indicator?
   47|  76.4M|      if (INPUT.column() == 0 && Exp::DocIndicator().Matches(INPUT)) {
  ------------------
  |  Branch (47:11): [True: 223k, False: 76.2M]
  |  Branch (47:34): [True: 137k, False: 85.9k]
  ------------------
   48|   137k|        if (params.onDocIndicator == BREAK) {
  ------------------
  |  Branch (48:13): [True: 137k, False: 2]
  ------------------
   49|   137k|          break;
   50|   137k|        }
   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.3M|      foundNonEmptyLine = true;
   57|  76.3M|      pastOpeningBreak = true;
   58|       |
   59|       |      // escaped newline? (only if we're escaping on slash)
   60|  76.3M|      if (params.escape == '\\' && Exp::EscBreak().Matches(INPUT)) {
  ------------------
  |  Branch (60:11): [True: 13.0M, False: 63.2M]
  |  Branch (60:36): [True: 890, False: 13.0M]
  ------------------
   61|       |        // eat escape character and get out (but preserve trailing whitespace!)
   62|    890|        INPUT.get();
   63|    890|        lastNonWhitespaceChar = scalar.size();
   64|    890|        lastEscapedChar = scalar.size();
   65|    890|        escapedNewline = true;
   66|    890|        break;
   67|    890|      }
   68|       |
   69|       |      // escape this?
   70|  76.3M|      if (INPUT.peek() == params.escape) {
  ------------------
  |  Branch (70:11): [True: 41.2k, False: 76.2M]
  ------------------
   71|  41.2k|        scalar += Exp::Escape(INPUT);
   72|  41.2k|        lastNonWhitespaceChar = scalar.size();
   73|  41.2k|        lastEscapedChar = scalar.size();
   74|  41.2k|        continue;
   75|  41.2k|      }
   76|       |
   77|       |      // otherwise, just add the damn character
   78|  76.2M|      char ch = INPUT.get();
   79|  76.2M|      scalar += ch;
   80|  76.2M|      if (ch != ' ' && ch != '\t') {
  ------------------
  |  Branch (80:11): [True: 76.2M, False: 54.0k]
  |  Branch (80:24): [True: 74.7M, False: 1.47M]
  ------------------
   81|  74.7M|        lastNonWhitespaceChar = scalar.size();
   82|  74.7M|      }
   83|  76.2M|    }
   84|       |
   85|       |    // eof? if we're looking to eat something, then we throw
   86|  13.9M|    if (!INPUT) {
  ------------------
  |  Branch (86:9): [True: 1.74k, False: 13.9M]
  ------------------
   87|  1.74k|      if (params.eatEnd) {
  ------------------
  |  Branch (87:11): [True: 196, False: 1.54k]
  ------------------
   88|    196|        throw ParserException(INPUT.mark(), ErrorMsg::EOF_IN_SCALAR);
   89|    196|      }
   90|  1.54k|      break;
   91|  1.74k|    }
   92|       |
   93|       |    // doc indicator?
   94|  13.9M|    if (params.onDocIndicator == BREAK && INPUT.column() == 0 &&
  ------------------
  |  Branch (94:9): [True: 8.18M, False: 5.75M]
  |  Branch (94:43): [True: 4.72M, False: 3.46M]
  ------------------
   95|  4.72M|        Exp::DocIndicator().Matches(INPUT)) {
  ------------------
  |  Branch (95:9): [True: 137k, False: 4.58M]
  ------------------
   96|   137k|      break;
   97|   137k|    }
   98|       |
   99|       |    // are we done via character match?
  100|  13.8M|    int n = params.end->Match(INPUT);
  101|  13.8M|    if (n >= 0) {
  ------------------
  |  Branch (101:9): [True: 1.08M, False: 12.7M]
  ------------------
  102|  1.08M|      if (params.eatEnd) {
  ------------------
  |  Branch (102:11): [True: 6.28k, False: 1.08M]
  ------------------
  103|  6.28k|        INPUT.eat(n);
  104|  6.28k|      }
  105|  1.08M|      break;
  106|  1.08M|    }
  107|       |
  108|       |    // do we remove trailing whitespace?
  109|  12.7M|    if (params.fold == FOLD_FLOW)
  ------------------
  |  Branch (109:9): [True: 7.00M, False: 5.71M]
  ------------------
  110|  7.00M|      scalar.erase(lastNonWhitespaceChar);
  111|       |
  112|       |    // ********************************
  113|       |    // Phase #2: eat line ending
  114|  12.7M|    n = Exp::Break().Match(INPUT);
  115|  12.7M|    INPUT.eat(n);
  116|       |
  117|       |    // ********************************
  118|       |    // Phase #3: scan initial spaces
  119|       |
  120|       |    // first the required indentation
  121|  12.7M|    while (INPUT.peek() == ' ' &&
  ------------------
  |  Branch (121:12): [True: 11.5k, False: 12.7M]
  ------------------
  122|  11.5k|           (INPUT.column() < params.indent ||
  ------------------
  |  Branch (122:13): [True: 792, False: 10.7k]
  ------------------
  123|  10.7k|            (params.detectIndent && !foundNonEmptyLine)) &&
  ------------------
  |  Branch (123:14): [True: 2.95k, False: 7.80k]
  |  Branch (123:37): [True: 226, False: 2.73k]
  ------------------
  124|  1.01k|           !params.end->Matches(INPUT)) {
  ------------------
  |  Branch (124:12): [True: 654, False: 364]
  ------------------
  125|    654|      INPUT.eat(1);
  126|    654|    }
  127|       |
  128|       |    // update indent if we're auto-detecting
  129|  12.7M|    if (params.detectIndent && !foundNonEmptyLine) {
  ------------------
  |  Branch (129:9): [True: 5.70M, False: 7.00M]
  |  Branch (129:32): [True: 4.45M, False: 1.25M]
  ------------------
  130|  4.45M|      params.indent = std::max(params.indent, INPUT.column());
  131|  4.45M|    }
  132|       |
  133|       |    // and then the rest of the whitespace
  134|  12.7M|    while (Exp::Blank().Matches(INPUT)) {
  ------------------
  |  Branch (134:12): [True: 12.6k, False: 12.7M]
  ------------------
  135|       |      // we check for tabs that masquerade as indentation
  136|  12.6k|      if (INPUT.peek() == '\t' && INPUT.column() < params.indent &&
  ------------------
  |  Branch (136:11): [True: 1.58k, False: 11.0k]
  |  Branch (136:35): [True: 3, False: 1.57k]
  ------------------
  137|      3|          params.onTabInIndentation == THROW) {
  ------------------
  |  Branch (137:11): [True: 3, False: 0]
  ------------------
  138|      3|        throw ParserException(INPUT.mark(), ErrorMsg::TAB_IN_INDENTATION);
  139|      3|      }
  140|       |
  141|  12.6k|      if (!params.eatLeadingWhitespace) {
  ------------------
  |  Branch (141:11): [True: 3.50k, False: 9.13k]
  ------------------
  142|  3.50k|        break;
  143|  3.50k|      }
  144|       |
  145|  9.13k|      if (params.end->Matches(INPUT)) {
  ------------------
  |  Branch (145:11): [True: 376, False: 8.76k]
  ------------------
  146|    376|        break;
  147|    376|      }
  148|       |
  149|  8.76k|      INPUT.eat(1);
  150|  8.76k|    }
  151|       |
  152|       |    // was this an empty line?
  153|  12.7M|    bool nextEmptyLine = Exp::Break().Matches(INPUT);
  154|  12.7M|    bool nextMoreIndented = Exp::Blank().Matches(INPUT);
  155|  12.7M|    if (params.fold == FOLD_BLOCK && foldedNewlineCount == 0 && nextEmptyLine)
  ------------------
  |  Branch (155:9): [True: 5.70M, False: 7.00M]
  |  Branch (155:38): [True: 792k, False: 4.91M]
  |  Branch (155:65): [True: 9.43k, False: 782k]
  ------------------
  156|  9.43k|      foldedNewlineStartedMoreIndented = moreIndented;
  157|       |
  158|       |    // for block scalars, we always start with a newline, so we should ignore it
  159|       |    // (not fold or keep)
  160|  12.7M|    if (pastOpeningBreak) {
  ------------------
  |  Branch (160:9): [True: 12.7M, False: 6.22k]
  ------------------
  161|  12.7M|      switch (params.fold) {
  ------------------
  |  Branch (161:15): [True: 12.7M, False: 0]
  ------------------
  162|    734|        case DONT_FOLD:
  ------------------
  |  Branch (162:9): [True: 734, False: 12.7M]
  ------------------
  163|    734|          scalar += "\n";
  164|    734|          break;
  165|  5.70M|        case FOLD_BLOCK:
  ------------------
  |  Branch (165:9): [True: 5.70M, False: 7.00M]
  ------------------
  166|  5.70M|          if (!emptyLine && !nextEmptyLine && !moreIndented &&
  ------------------
  |  Branch (166:15): [True: 786k, False: 4.91M]
  |  Branch (166:29): [True: 778k, False: 8.05k]
  |  Branch (166:47): [True: 775k, False: 2.96k]
  ------------------
  167|   775k|              !nextMoreIndented && INPUT.column() >= params.indent) {
  ------------------
  |  Branch (167:15): [True: 773k, False: 1.43k]
  |  Branch (167:36): [True: 773k, False: 425]
  ------------------
  168|   773k|            scalar += " ";
  169|  4.93M|          } else if (nextEmptyLine) {
  ------------------
  |  Branch (169:22): [True: 4.91M, False: 13.6k]
  ------------------
  170|  4.91M|            foldedNewlineCount++;
  171|  4.91M|          } else {
  172|  13.6k|            scalar += "\n";
  173|  13.6k|          }
  174|       |
  175|  5.70M|          if (!nextEmptyLine && foldedNewlineCount > 0) {
  ------------------
  |  Branch (175:15): [True: 786k, False: 4.91M]
  |  Branch (175:33): [True: 8.65k, False: 778k]
  ------------------
  176|  8.65k|            scalar += std::string(foldedNewlineCount - 1, '\n');
  177|  8.65k|            if (foldedNewlineStartedMoreIndented ||
  ------------------
  |  Branch (177:17): [True: 488, False: 8.16k]
  ------------------
  178|  8.16k|                nextMoreIndented || !foundNonEmptyLine) {
  ------------------
  |  Branch (178:17): [True: 1.32k, False: 6.84k]
  |  Branch (178:37): [True: 595, False: 6.25k]
  ------------------
  179|  2.40k|              scalar += "\n";
  180|  2.40k|            }
  181|  8.65k|            foldedNewlineCount = 0;
  182|  8.65k|          }
  183|  5.70M|          break;
  184|  7.00M|        case FOLD_FLOW:
  ------------------
  |  Branch (184:9): [True: 7.00M, False: 5.70M]
  ------------------
  185|  7.00M|          if (nextEmptyLine) {
  ------------------
  |  Branch (185:15): [True: 5.71M, False: 1.28M]
  ------------------
  186|  5.71M|            scalar += "\n";
  187|  5.71M|          } else if (!emptyLine && !escapedNewline) {
  ------------------
  |  Branch (187:22): [True: 1.26M, False: 17.0k]
  |  Branch (187:36): [True: 1.26M, False: 757]
  ------------------
  188|  1.26M|            scalar += " ";
  189|  1.26M|          }
  190|  7.00M|          break;
  191|  12.7M|      }
  192|  12.7M|    }
  193|       |
  194|  12.7M|    emptyLine = nextEmptyLine;
  195|  12.7M|    moreIndented = nextMoreIndented;
  196|  12.7M|    pastOpeningBreak = true;
  197|       |
  198|       |    // are we done via indentation?
  199|  12.7M|    if (!emptyLine && INPUT.column() < params.indent) {
  ------------------
  |  Branch (199:9): [True: 2.07M, False: 10.6M]
  |  Branch (199:23): [True: 821k, False: 1.25M]
  ------------------
  200|   821k|      params.leadingSpaces = true;
  201|   821k|      break;
  202|   821k|    }
  203|  12.7M|  }
  204|       |
  205|       |  // post-processing
  206|  2.05M|  if (params.trimTrailingSpaces) {
  ------------------
  |  Branch (206:7): [True: 2.03M, False: 12.7k]
  ------------------
  207|  2.03M|    std::size_t pos = scalar.find_last_not_of(" \t");
  208|  2.03M|    if (lastEscapedChar != std::string::npos) {
  ------------------
  |  Branch (208:9): [True: 16.0k, False: 2.02M]
  ------------------
  209|  16.0k|      if (pos < lastEscapedChar || pos == std::string::npos) {
  ------------------
  |  Branch (209:11): [True: 9.16k, False: 6.87k]
  |  Branch (209:36): [True: 636, False: 6.24k]
  ------------------
  210|  9.79k|        pos = lastEscapedChar;
  211|  9.79k|      }
  212|  16.0k|    }
  213|  2.03M|    if (pos < scalar.size()) {
  ------------------
  |  Branch (213:9): [True: 2.02M, False: 9.59k]
  ------------------
  214|  2.02M|      scalar.erase(pos + 1);
  215|  2.02M|    }
  216|  2.03M|  }
  217|       |
  218|  2.05M|  switch (params.chomp) {
  219|  11.6k|    case CLIP: {
  ------------------
  |  Branch (219:5): [True: 11.6k, False: 2.03M]
  ------------------
  220|  11.6k|      std::size_t pos = scalar.find_last_not_of('\n');
  221|  11.6k|      if (lastEscapedChar != std::string::npos) {
  ------------------
  |  Branch (221:11): [True: 3.65k, False: 7.95k]
  ------------------
  222|  3.65k|        if (pos < lastEscapedChar || pos == std::string::npos) {
  ------------------
  |  Branch (222:13): [True: 1.79k, False: 1.85k]
  |  Branch (222:38): [True: 217, False: 1.64k]
  ------------------
  223|  2.01k|          pos = lastEscapedChar;
  224|  2.01k|        }
  225|  3.65k|      }
  226|  11.6k|      if (pos == std::string::npos) {
  ------------------
  |  Branch (226:11): [True: 4.22k, False: 7.38k]
  ------------------
  227|  4.22k|        scalar.erase();
  228|  7.38k|      } else if (pos + 1 < scalar.size()) {
  ------------------
  |  Branch (228:18): [True: 743, False: 6.64k]
  ------------------
  229|    743|        scalar.erase(pos + 2);
  230|    743|      }
  231|  11.6k|    } break;
  232|  2.03M|    case STRIP: {
  ------------------
  |  Branch (232:5): [True: 2.03M, False: 12.2k]
  ------------------
  233|  2.03M|      std::size_t pos = scalar.find_last_not_of('\n');
  234|  2.03M|      if (lastEscapedChar != std::string::npos) {
  ------------------
  |  Branch (234:11): [True: 16.0k, False: 2.02M]
  ------------------
  235|  16.0k|        if (pos < lastEscapedChar || pos == std::string::npos) {
  ------------------
  |  Branch (235:13): [True: 9.29k, False: 6.74k]
  |  Branch (235:38): [True: 325, False: 6.41k]
  ------------------
  236|  9.62k|          pos = lastEscapedChar;
  237|  9.62k|        }
  238|  16.0k|      }
  239|  2.03M|      if (pos == std::string::npos) {
  ------------------
  |  Branch (239:11): [True: 465, False: 2.03M]
  ------------------
  240|    465|        scalar.erase();
  241|  2.03M|      } else if (pos < scalar.size()) {
  ------------------
  |  Branch (241:18): [True: 2.02M, False: 9.59k]
  ------------------
  242|  2.02M|        scalar.erase(pos + 1);
  243|  2.02M|      }
  244|  2.03M|    } break;
  245|    299|    default:
  ------------------
  |  Branch (245:5): [True: 299, False: 2.05M]
  ------------------
  246|    299|      break;
  247|  2.05M|  }
  248|       |
  249|  2.04M|  return scalar;
  250|  2.05M|}

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

_ZN4YAML15ScanVerbatimTagERNS_6StreamE:
    9|    633|std::string ScanVerbatimTag(Stream& INPUT) {
   10|    633|  std::string tag;
   11|       |
   12|       |  // eat the start character
   13|    633|  INPUT.get();
   14|       |
   15|  9.24k|  while (INPUT) {
  ------------------
  |  Branch (15:10): [True: 9.22k, False: 19]
  ------------------
   16|  9.22k|    if (INPUT.peek() == Keys::VerbatimTagEnd) {
  ------------------
  |  Branch (16:9): [True: 606, False: 8.61k]
  ------------------
   17|       |      // eat the end character
   18|    606|      INPUT.get();
   19|    606|      return tag;
   20|    606|    }
   21|       |
   22|  8.61k|    int n = Exp::URI().Match(INPUT);
   23|  8.61k|    if (n <= 0)
  ------------------
  |  Branch (23:9): [True: 8, False: 8.60k]
  ------------------
   24|      8|      break;
   25|       |
   26|  8.60k|    tag += INPUT.get(n);
   27|  8.60k|  }
   28|       |
   29|     27|  throw ParserException(INPUT.mark(), ErrorMsg::END_OF_VERBATIM_TAG);
   30|    633|}
_ZN4YAML13ScanTagHandleERNS_6StreamERb:
   32|   914k|std::string ScanTagHandle(Stream& INPUT, bool& canBeHandle) {
   33|   914k|  std::string tag;
   34|   914k|  canBeHandle = true;
   35|   914k|  Mark firstNonWordChar;
   36|       |
   37|  9.97M|  while (INPUT) {
  ------------------
  |  Branch (37:10): [True: 9.97M, False: 289]
  ------------------
   38|  9.97M|    if (INPUT.peek() == Keys::Tag) {
  ------------------
  |  Branch (38:9): [True: 2.13k, False: 9.97M]
  ------------------
   39|  2.13k|      if (!canBeHandle)
  ------------------
  |  Branch (39:11): [True: 4, False: 2.12k]
  ------------------
   40|      4|        throw ParserException(firstNonWordChar, ErrorMsg::CHAR_IN_TAG_HANDLE);
   41|  2.12k|      break;
   42|  2.13k|    }
   43|       |
   44|  9.97M|    int n = 0;
   45|  9.97M|    if (canBeHandle) {
  ------------------
  |  Branch (45:9): [True: 8.27M, False: 1.69M]
  ------------------
   46|  8.27M|      n = Exp::Word().Match(INPUT);
   47|  8.27M|      if (n <= 0) {
  ------------------
  |  Branch (47:11): [True: 912k, False: 7.36M]
  ------------------
   48|   912k|        canBeHandle = false;
   49|   912k|        firstNonWordChar = INPUT.mark();
   50|   912k|      }
   51|  8.27M|    }
   52|       |
   53|  9.97M|    if (!canBeHandle)
  ------------------
  |  Branch (53:9): [True: 2.61M, False: 7.36M]
  ------------------
   54|  2.61M|      n = Exp::Tag().Match(INPUT);
   55|       |
   56|  9.97M|    if (n <= 0)
  ------------------
  |  Branch (56:9): [True: 912k, False: 9.06M]
  ------------------
   57|   912k|      break;
   58|       |
   59|  9.06M|    tag += INPUT.get(n);
   60|  9.06M|  }
   61|       |
   62|   914k|  return tag;
   63|   914k|}
_ZN4YAML13ScanTagSuffixERNS_6StreamE:
   65|  2.12k|std::string ScanTagSuffix(Stream& INPUT) {
   66|  2.12k|  std::string tag;
   67|       |
   68|  1.14M|  while (INPUT) {
  ------------------
  |  Branch (68:10): [True: 1.14M, False: 96]
  ------------------
   69|  1.14M|    int n = Exp::Tag().Match(INPUT);
   70|  1.14M|    if (n <= 0)
  ------------------
  |  Branch (70:9): [True: 2.03k, False: 1.14M]
  ------------------
   71|  2.03k|      break;
   72|       |
   73|  1.14M|    tag += INPUT.get(n);
   74|  1.14M|  }
   75|       |
   76|  2.12k|  if (tag.empty())
  ------------------
  |  Branch (76:7): [True: 16, False: 2.11k]
  ------------------
   77|     16|    throw ParserException(INPUT.mark(), ErrorMsg::TAG_WITH_NO_SUFFIX);
   78|       |
   79|  2.11k|  return tag;
   80|  2.12k|}

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

_ZN4YAML7Scanner9SimpleKeyC2ERKNS_4MarkEm:
    8|  42.5M|    : mark(mark_),
    9|  42.5M|      flowLevel(flowLevel_),
   10|  42.5M|      pIndent(nullptr),
   11|  42.5M|      pMapStart(nullptr),
   12|  42.5M|      pKey(nullptr) {}
_ZN4YAML7Scanner9SimpleKey8ValidateEv:
   14|   968k|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|   968k|  if (pIndent)
  ------------------
  |  Branch (18:7): [True: 54.0k, False: 914k]
  ------------------
   19|  54.0k|    pIndent->status = IndentMarker::VALID;
   20|   968k|  if (pMapStart)
  ------------------
  |  Branch (20:7): [True: 54.0k, False: 914k]
  ------------------
   21|  54.0k|    pMapStart->status = Token::VALID;
   22|   968k|  if (pKey)
  ------------------
  |  Branch (22:7): [True: 968k, False: 0]
  ------------------
   23|   968k|    pKey->status = Token::VALID;
   24|   968k|}
_ZN4YAML7Scanner9SimpleKey10InvalidateEv:
   26|  2.59M|void Scanner::SimpleKey::Invalidate() {
   27|  2.59M|  if (pIndent)
  ------------------
  |  Branch (27:7): [True: 1.70M, False: 895k]
  ------------------
   28|  1.70M|    pIndent->status = IndentMarker::INVALID;
   29|  2.59M|  if (pMapStart)
  ------------------
  |  Branch (29:7): [True: 1.70M, False: 895k]
  ------------------
   30|  1.70M|    pMapStart->status = Token::INVALID;
   31|  2.59M|  if (pKey)
  ------------------
  |  Branch (31:7): [True: 2.59M, False: 0]
  ------------------
   32|  2.59M|    pKey->status = Token::INVALID;
   33|  2.59M|}
_ZNK4YAML7Scanner27CanInsertPotentialSimpleKeyEv:
   36|  42.8M|bool Scanner::CanInsertPotentialSimpleKey() const {
   37|  42.8M|  if (!m_simpleKeyAllowed)
  ------------------
  |  Branch (37:7): [True: 340k, False: 42.5M]
  ------------------
   38|   340k|    return false;
   39|       |
   40|  42.5M|  return !ExistsActiveSimpleKey();
   41|  42.8M|}
_ZNK4YAML7Scanner21ExistsActiveSimpleKeyEv:
   47|  42.5M|bool Scanner::ExistsActiveSimpleKey() const {
   48|  42.5M|  if (m_simpleKeys.empty())
  ------------------
  |  Branch (48:7): [True: 1.78M, False: 40.7M]
  ------------------
   49|  1.78M|    return false;
   50|       |
   51|  40.7M|  const SimpleKey& key = m_simpleKeys.top();
   52|  40.7M|  return key.flowLevel == GetFlowLevel();
   53|  42.5M|}
_ZN4YAML7Scanner24InsertPotentialSimpleKeyEv:
   58|  42.8M|void Scanner::InsertPotentialSimpleKey() {
   59|  42.8M|  if (!CanInsertPotentialSimpleKey())
  ------------------
  |  Branch (59:7): [True: 343k, False: 42.5M]
  ------------------
   60|   343k|    return;
   61|       |
   62|  42.5M|  SimpleKey key(INPUT.mark(), GetFlowLevel());
   63|       |
   64|       |  // first add a map start, if necessary
   65|  42.5M|  if (InBlockContext()) {
  ------------------
  |  Branch (65:7): [True: 1.77M, False: 40.7M]
  ------------------
   66|  1.77M|    key.pIndent = PushIndentTo(INPUT.column(), IndentMarker::MAP);
   67|  1.77M|    if (key.pIndent) {
  ------------------
  |  Branch (67:9): [True: 1.76M, False: 15.7k]
  ------------------
   68|  1.76M|      key.pIndent->status = IndentMarker::UNKNOWN;
   69|  1.76M|      key.pMapStart = key.pIndent->pStartToken;
   70|  1.76M|      key.pMapStart->status = Token::UNVERIFIED;
   71|  1.76M|    }
   72|  1.77M|  }
   73|       |
   74|       |  // then add the (now unverified) key
   75|  42.5M|  m_tokens.push(Token(Token::KEY, INPUT.mark()));
   76|  42.5M|  key.pKey = &m_tokens.back();
   77|  42.5M|  key.pKey->status = Token::UNVERIFIED;
   78|       |
   79|  42.5M|  m_simpleKeys.push(key);
   80|  42.5M|}
_ZN4YAML7Scanner19InvalidateSimpleKeyEv:
   84|  9.54M|void Scanner::InvalidateSimpleKey() {
   85|  9.54M|  if (m_simpleKeys.empty())
  ------------------
  |  Branch (85:7): [True: 6.97M, False: 2.57M]
  ------------------
   86|  6.97M|    return;
   87|       |
   88|       |  // grab top key
   89|  2.57M|  SimpleKey& key = m_simpleKeys.top();
   90|  2.57M|  if (key.flowLevel != GetFlowLevel())
  ------------------
  |  Branch (90:7): [True: 822k, False: 1.75M]
  ------------------
   91|   822k|    return;
   92|       |
   93|  1.75M|  key.Invalidate();
   94|  1.75M|  m_simpleKeys.pop();
   95|  1.75M|}
_ZN4YAML7Scanner15VerifySimpleKeyEv:
  100|  7.60M|bool Scanner::VerifySimpleKey() {
  101|  7.60M|  if (m_simpleKeys.empty())
  ------------------
  |  Branch (101:7): [True: 5.74M, False: 1.85M]
  ------------------
  102|  5.74M|    return false;
  103|       |
  104|       |  // grab top key
  105|  1.85M|  SimpleKey key = m_simpleKeys.top();
  106|       |
  107|       |  // only validate if we're in the correct flow level
  108|  1.85M|  if (key.flowLevel != GetFlowLevel())
  ------------------
  |  Branch (108:7): [True: 39.2k, False: 1.81M]
  ------------------
  109|  39.2k|    return false;
  110|       |
  111|  1.81M|  m_simpleKeys.pop();
  112|       |
  113|  1.81M|  bool isValid = true;
  114|       |
  115|       |  // needs to be less than 1024 characters and inline
  116|  1.81M|  if (INPUT.line() != key.mark.line || INPUT.pos() - key.mark.pos > 1024)
  ------------------
  |  Branch (116:7): [True: 15.3k, False: 1.80M]
  |  Branch (116:40): [True: 833k, False: 968k]
  ------------------
  117|   848k|    isValid = false;
  118|       |
  119|       |  // invalidate key
  120|  1.81M|  if (isValid)
  ------------------
  |  Branch (120:7): [True: 968k, False: 848k]
  ------------------
  121|   968k|    key.Validate();
  122|   848k|  else
  123|   848k|    key.Invalidate();
  124|       |
  125|  1.81M|  return isValid;
  126|  1.85M|}
_ZN4YAML7Scanner16PopAllSimpleKeysEv:
  128|   389k|void Scanner::PopAllSimpleKeys() {
  129|  35.9M|  while (!m_simpleKeys.empty())
  ------------------
  |  Branch (129:10): [True: 35.5M, False: 389k]
  ------------------
  130|  35.5M|    m_simpleKeys.pop();
  131|   389k|}

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

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

_ZNK4YAML6StreamntEv:
   35|   144M|  bool operator!() const { return !static_cast<bool>(*this); }
_ZN4YAML6Stream3eofEv:
   42|  67.8M|  static char eof() { return 0x04; }
_ZNK4YAML6Stream4markEv:
   44|   153M|  const Mark mark() const { return m_mark; }
_ZNK4YAML6Stream3posEv:
   45|  1.80M|  int pos() const { return m_mark.pos; }
_ZNK4YAML6Stream4lineEv:
   46|  1.81M|  int line() const { return m_mark.line; }
_ZNK4YAML6Stream6columnEv:
   47|   275M|  int column() const { return m_mark.column; }
_ZN4YAML6Stream11ResetColumnEv:
   48|  4.67k|  void ResetColumn() { m_mark.column = 0; }
_ZNK4YAML6Stream6CharAtEm:
   75|  1.79G|inline char Stream::CharAt(size_t i) const { return m_readahead[i]; }
_ZNK4YAML6Stream11ReadAheadToEm:
   77|  1.28G|inline bool Stream::ReadAheadTo(size_t i) const {
   78|  1.28G|  if (m_readahead.size() > i)
  ------------------
  |  Branch (78:7): [True: 1.14G, False: 140M]
  ------------------
   79|  1.14G|    return true;
   80|   140M|  return _ReadAheadTo(i);
   81|  1.28G|}

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

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

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

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

