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

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

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

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

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

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

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

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

_ZN4YAML6detail8node_refC2Ev:
   19|  4.39M|  node_ref() : m_pData(std::make_shared<node_data>()) {}
_ZNK4YAML6detail8node_ref10is_definedEv:
   23|  15.0M|  bool is_defined() const { return m_pData->is_defined(); }
_ZNK4YAML6detail8node_ref4typeEv:
   25|  10.0M|  NodeType::value type() const { return m_pData->type(); }
_ZNK4YAML6detail8node_ref6scalarEv:
   26|  8.80M|  const std::string& scalar() const { return m_pData->scalar(); }
_ZN4YAML6detail8node_ref12mark_definedEv:
   30|  4.39M|  void mark_defined() { m_pData->mark_defined(); }
_ZN4YAML6detail8node_ref8set_markERKNS_4MarkE:
   33|  4.39M|  void set_mark(const Mark& mark) { m_pData->set_mark(mark); }
_ZN4YAML6detail8node_ref8set_typeENS_8NodeType5valueE:
   34|   161k|  void set_type(NodeType::value type) { m_pData->set_type(type); }
_ZN4YAML6detail8node_ref7set_tagERKNSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEE:
   35|   573k|  void set_tag(const std::string& tag) { m_pData->set_tag(tag); }
_ZN4YAML6detail8node_ref8set_nullEv:
   36|  3.81M|  void set_null() { m_pData->set_null(); }
_ZN4YAML6detail8node_ref10set_scalarERKNSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEE:
   37|   412k|  void set_scalar(const std::string& scalar) { m_pData->set_scalar(scalar); }
_ZN4YAML6detail8node_ref9set_styleENS_12EmitterStyle5valueE:
   38|   161k|  void set_style(EmitterStyle::value style) { m_pData->set_style(style); }
_ZN4YAML6detail8node_ref9push_backERNS0_4nodeENSt3__110shared_ptrINS0_13memory_holderEEE:
   54|  1.44M|  void push_back(node& node, shared_memory_holder pMemory) {
   55|  1.44M|    m_pData->push_back(node, pMemory);
   56|  1.44M|  }
_ZN4YAML6detail8node_ref6insertERNS0_4nodeES3_NSt3__110shared_ptrINS0_13memory_holderEEE:
   57|  1.17M|  void insert(node& key, node& value, shared_memory_holder pMemory) {
   58|  1.17M|    m_pData->insert(key, value, pMemory);
   59|  1.17M|  }

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

_ZN4YAML9ExceptionD2Ev:
   15|  3.76k|    #define YAML_CPP_NOEXCEPT noexcept

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

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

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

_ZN4YAML3Exp8ParseHexERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERKNS_4MarkE:
   13|  1.72k|unsigned ParseHex(const std::string& str, const Mark& mark) {
   14|  1.72k|  unsigned value = 0;
   15|  7.85k|  for (char ch : str) {
  ------------------
  |  Branch (15:16): [True: 7.85k, False: 1.64k]
  ------------------
   16|  7.85k|    int digit = 0;
   17|  7.85k|    if ('a' <= ch && ch <= 'f')
  ------------------
  |  Branch (17:9): [True: 2.34k, False: 5.50k]
  |  Branch (17:22): [True: 2.34k, False: 6]
  ------------------
   18|  2.34k|      digit = ch - 'a' + 10;
   19|  5.50k|    else if ('A' <= ch && ch <= 'F')
  ------------------
  |  Branch (19:14): [True: 1.38k, False: 4.12k]
  |  Branch (19:27): [True: 1.36k, False: 15]
  ------------------
   20|  1.36k|      digit = ch - 'A' + 10;
   21|  4.14k|    else if ('0' <= ch && ch <= '9')
  ------------------
  |  Branch (21:14): [True: 4.07k, False: 67]
  |  Branch (21:27): [True: 4.05k, False: 18]
  ------------------
   22|  4.05k|      digit = ch - '0';
   23|     85|    else
   24|     85|      throw ParserException(mark, ErrorMsg::INVALID_HEX);
   25|       |
   26|  7.76k|    value = (value << 4) + digit;
   27|  7.76k|  }
   28|       |
   29|  1.64k|  return value;
   30|  1.72k|}
_ZN4YAML3Exp3StrEj:
   32|  4.30k|std::string Str(unsigned ch) { return std::string(1, static_cast<char>(ch)); }
_ZN4YAML3Exp6EscapeERNS_6StreamEi:
   38|  1.72k|std::string Escape(Stream& in, int codeLength) {
   39|       |  // grab string
   40|  1.72k|  std::string str;
   41|  9.91k|  for (int i = 0; i < codeLength; i++)
  ------------------
  |  Branch (41:19): [True: 8.18k, False: 1.72k]
  ------------------
   42|  8.18k|    str += in.get();
   43|       |
   44|       |  // get the value
   45|  1.72k|  unsigned value = ParseHex(str, in.mark());
   46|       |
   47|       |  // legal unicode?
   48|  1.72k|  if ((value >= 0xD800 && value <= 0xDFFF) || value > 0x10FFFF) {
  ------------------
  |  Branch (48:8): [True: 787, False: 941]
  |  Branch (48:27): [True: 13, False: 774]
  |  Branch (48:47): [True: 43, False: 1.58k]
  ------------------
   49|     56|    std::stringstream msg;
   50|     56|    msg << ErrorMsg::INVALID_UNICODE << value;
   51|     56|    throw ParserException(in.mark(), msg.str());
   52|     56|  }
   53|       |
   54|       |  // now break it up into chars
   55|  1.67k|  if (value <= 0x7F)
  ------------------
  |  Branch (55:7): [True: 230, False: 1.44k]
  ------------------
   56|    230|    return Str(value);
   57|       |
   58|  1.44k|  if (value <= 0x7FF)
  ------------------
  |  Branch (58:7): [True: 296, False: 1.14k]
  ------------------
   59|    296|    return Str(0xC0 + (value >> 6)) + Str(0x80 + (value & 0x3F));
   60|       |
   61|  1.14k|  if (value <= 0xFFFF)
  ------------------
  |  Branch (61:7): [True: 758, False: 388]
  ------------------
   62|    758|    return Str(0xE0 + (value >> 12)) + Str(0x80 + ((value >> 6) & 0x3F)) +
   63|    758|           Str(0x80 + (value & 0x3F));
   64|       |
   65|    388|  return Str(0xF0 + (value >> 18)) + Str(0x80 + ((value >> 12) & 0x3F)) +
   66|    388|         Str(0x80 + ((value >> 6) & 0x3F)) + Str(0x80 + (value & 0x3F));
   67|  1.14k|}
_ZN4YAML3Exp6EscapeERNS_6StreamE:
   74|  29.7k|std::string Escape(Stream& in) {
   75|       |  // eat slash
   76|  29.7k|  char escape = in.get();
   77|       |
   78|       |  // switch on escape character
   79|  29.7k|  char ch = in.get();
   80|       |
   81|       |  // first do single quote, since it's easier
   82|  29.7k|  if (escape == '\'' && ch == '\'')
  ------------------
  |  Branch (82:7): [True: 898, False: 28.8k]
  |  Branch (82:25): [True: 898, False: 0]
  ------------------
   83|    898|    return "\'";
   84|       |
   85|       |  // now do the slash (we're not gonna check if it's a slash - you better pass
   86|       |  // one!)
   87|  28.8k|  switch (ch) {
  ------------------
  |  Branch (87:11): [True: 28.6k, False: 236]
  ------------------
   88|    946|    case '0':
  ------------------
  |  Branch (88:5): [True: 946, False: 27.9k]
  ------------------
   89|    946|      return std::string(1, '\x00');
   90|    201|    case 'a':
  ------------------
  |  Branch (90:5): [True: 201, False: 28.6k]
  ------------------
   91|    201|      return "\x07";
   92|    715|    case 'b':
  ------------------
  |  Branch (92:5): [True: 715, False: 28.1k]
  ------------------
   93|    715|      return "\x08";
   94|    439|    case 't':
  ------------------
  |  Branch (94:5): [True: 439, False: 28.4k]
  ------------------
   95|  4.76k|    case '\t':
  ------------------
  |  Branch (95:5): [True: 4.32k, False: 24.5k]
  ------------------
   96|  4.76k|      return "\x09";
   97|  5.61k|    case 'n':
  ------------------
  |  Branch (97:5): [True: 5.61k, False: 23.2k]
  ------------------
   98|  5.61k|      return "\x0A";
   99|    404|    case 'v':
  ------------------
  |  Branch (99:5): [True: 404, False: 28.4k]
  ------------------
  100|    404|      return "\x0B";
  101|    219|    case 'f':
  ------------------
  |  Branch (101:5): [True: 219, False: 28.6k]
  ------------------
  102|    219|      return "\x0C";
  103|    208|    case 'r':
  ------------------
  |  Branch (103:5): [True: 208, False: 28.6k]
  ------------------
  104|    208|      return "\x0D";
  105|    566|    case 'e':
  ------------------
  |  Branch (105:5): [True: 566, False: 28.2k]
  ------------------
  106|    566|      return "\x1B";
  107|    482|    case ' ':
  ------------------
  |  Branch (107:5): [True: 482, False: 28.3k]
  ------------------
  108|    482|      return R"( )";
  109|  3.08k|    case '\"':
  ------------------
  |  Branch (109:5): [True: 3.08k, False: 25.7k]
  ------------------
  110|  3.08k|      return "\"";
  111|    315|    case '\'':
  ------------------
  |  Branch (111:5): [True: 315, False: 28.5k]
  ------------------
  112|    315|      return "\'";
  113|    489|    case '\\':
  ------------------
  |  Branch (113:5): [True: 489, False: 28.3k]
  ------------------
  114|    489|      return "\\";
  115|    198|    case '/':
  ------------------
  |  Branch (115:5): [True: 198, False: 28.6k]
  ------------------
  116|    198|      return "/";
  117|    476|    case 'N':
  ------------------
  |  Branch (117:5): [True: 476, False: 28.3k]
  ------------------
  118|    476|      return "\xC2\x85";      // NEL (U+0085)
  119|    580|    case '_':
  ------------------
  |  Branch (119:5): [True: 580, False: 28.2k]
  ------------------
  120|    580|      return "\xC2\xA0";      // NBSP (U+00A0)
  121|  4.92k|    case 'L':
  ------------------
  |  Branch (121:5): [True: 4.92k, False: 23.9k]
  ------------------
  122|  4.92k|      return "\xE2\x80\xA8";  // LS (U+2028)
  123|  2.69k|    case 'P':
  ------------------
  |  Branch (123:5): [True: 2.69k, False: 26.1k]
  ------------------
  124|  2.69k|      return "\xE2\x80\xA9";  // PS (U+2029)
  125|    468|    case 'x':
  ------------------
  |  Branch (125:5): [True: 468, False: 28.3k]
  ------------------
  126|    468|      return Escape(in, 2);
  127|    707|    case 'u':
  ------------------
  |  Branch (127:5): [True: 707, False: 28.1k]
  ------------------
  128|    707|      return Escape(in, 4);
  129|    553|    case 'U':
  ------------------
  |  Branch (129:5): [True: 553, False: 28.2k]
  ------------------
  130|    553|      return Escape(in, 8);
  131|  28.8k|  }
  132|       |
  133|    236|  std::stringstream msg;
  134|    236|  throw ParserException(in.mark(), std::string(ErrorMsg::INVALID_ESCAPE) + ch);
  135|  28.8k|}

_ZN4YAML3Exp8DocStartEv:
   84|  2.85M|inline const RegEx& DocStart() {
   85|  2.85M|  static const RegEx e = RegEx("---") + (BlankOrBreak() | RegEx());
   86|  2.85M|  return e;
   87|  2.85M|}
_ZN4YAML3Exp12BlankOrBreakEv:
   43|  29.8M|inline const RegEx& BlankOrBreak() {
   44|  29.8M|  static const RegEx e = Blank() | Break();
   45|  29.8M|  return e;
   46|  29.8M|}
_ZN4YAML3Exp5BlankEv:
   35|  32.5M|inline const RegEx& Blank() {
   36|  32.5M|  static const RegEx e = Space() | Tab();
   37|  32.5M|  return e;
   38|  32.5M|}
_ZN4YAML3Exp5SpaceEv:
   27|      1|inline const RegEx& Space() {
   28|      1|  static const RegEx e = RegEx(' ');
   29|      1|  return e;
   30|      1|}
_ZN4YAML3Exp6DocEndEv:
   88|  2.44M|inline const RegEx& DocEnd() {
   89|  2.44M|  static const RegEx e = RegEx("...") + (BlankOrBreak() | RegEx());
   90|  2.44M|  return e;
   91|  2.44M|}
_ZN4YAML3Exp10BlockEntryEv:
   96|  14.1M|inline const RegEx& BlockEntry() {
   97|  14.1M|  static const RegEx e = RegEx('-') + (BlankOrBreak() | RegEx());
   98|  14.1M|  return e;
   99|  14.1M|}
_ZN4YAML3Exp3KeyEv:
  100|  9.33M|inline const RegEx& Key() {
  101|  9.33M|  static const RegEx e = RegEx('?') + BlankOrBreak();
  102|  9.33M|  return e;
  103|  9.33M|}
_ZN4YAML3Exp9KeyInFlowEv:
  104|  2.31M|inline const RegEx& KeyInFlow() {
  105|  2.31M|  static const RegEx e = RegEx('?') + BlankOrBreak();
  106|  2.31M|  return e;
  107|  2.31M|}
_ZN4YAML3Exp11PlainScalarEv:
  153|  1.52M|inline const RegEx& PlainScalar() {
  154|  1.52M|  static const RegEx e =
  155|  1.52M|      !(BlankOrBreak() | RegEx(",[]{}#&*!|>\'\"%@`", REGEX_OR) |
  156|  1.52M|        (RegEx("-?:", REGEX_OR) + (BlankOrBreak() | RegEx())));
  157|  1.52M|  return e;
  158|  1.52M|}
_ZN4YAML3Exp17PlainScalarInFlowEv:
  159|  1.66M|inline const RegEx& PlainScalarInFlow() {
  160|  1.66M|  static const RegEx e =
  161|  1.66M|      !(BlankOrBreak() | RegEx("?,[]{}#&*!|>\'\"%@`", REGEX_OR) |
  162|  1.66M|        (RegEx("-:", REGEX_OR) + (Blank() | RegEx())));
  163|  1.66M|  return e;
  164|  1.66M|}
_ZN4YAML3Exp3TabEv:
   31|   145k|inline const RegEx& Tab() {
   32|   145k|  static const RegEx e = RegEx('\t');
   33|   145k|  return e;
   34|   145k|}
_ZN4YAML3Exp7CommentEv:
  124|  63.9M|inline const RegEx Comment() {
  125|  63.9M|  static const RegEx e = RegEx('#');
  126|  63.9M|  return e;
  127|  63.9M|}
_ZN4YAML3Exp5BreakEv:
   39|   196M|inline const RegEx& Break() {
   40|   196M|  static const RegEx e = RegEx('\n') | RegEx("\r\n") | RegEx('\r');
   41|   196M|  return e;
   42|   196M|}
_ZN4YAML3Exp5ValueEv:
  108|  9.31M|inline const RegEx& Value() {
  109|  9.31M|  static const RegEx e = RegEx(':') + (BlankOrBreak() | RegEx());
  110|  9.31M|  return e;
  111|  9.31M|}
_ZN4YAML3Exp15ValueInJSONFlowEv:
  116|  6.36k|inline const RegEx& ValueInJSONFlow() {
  117|  6.36k|  static const RegEx e = RegEx(':');
  118|  6.36k|  return e;
  119|  6.36k|}
_ZN4YAML3Exp11ValueInFlowEv:
  112|  2.30M|inline const RegEx& ValueInFlow() {
  113|  2.30M|  static const RegEx e = RegEx(':') + (BlankOrBreak() | RegEx(",]}", REGEX_OR));
  114|  2.30M|  return e;
  115|  2.30M|}
_ZN4YAML3Exp5EmptyEv:
   23|  3.49k|inline const RegEx& Empty() {
   24|  3.49k|  static const RegEx e;
   25|  3.49k|  return e;
   26|  3.49k|}
_ZN4YAML3Exp5DigitEv:
   47|    543|inline const RegEx& Digit() {
   48|    543|  static const RegEx e = RegEx('0', '9');
   49|    543|  return e;
   50|    543|}
_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.83M|inline const RegEx& Word() {
   60|  8.83M|  static const RegEx e = AlphaNumeric() | RegEx('-');
   61|  8.83M|  return e;
   62|  8.83M|}
_ZN4YAML3Exp3HexEv:
   63|      4|inline const RegEx& Hex() {
   64|      4|  static const RegEx e = Digit() | RegEx('A', 'F') | RegEx('a', 'f');
   65|      4|  return e;
   66|      4|}
_ZN4YAML3Exp12DocIndicatorEv:
   92|  5.39M|inline const RegEx& DocIndicator() {
   93|  5.39M|  static const RegEx e = DocStart() | DocEnd();
   94|  5.39M|  return e;
   95|  5.39M|}
_ZN4YAML3Exp6AnchorEv:
  128|  34.5M|inline const RegEx& Anchor() {
  129|  34.5M|  static const RegEx e = !(RegEx("[]{},", REGEX_OR) | BlankOrBreak());
  130|  34.5M|  return e;
  131|  34.5M|}
_ZN4YAML3Exp9AnchorEndEv:
  132|   600k|inline const RegEx& AnchorEnd() {
  133|   600k|  static const RegEx e = RegEx("?:,]}%@`", REGEX_OR) | BlankOrBreak();
  134|   600k|  return e;
  135|   600k|}
_ZN4YAML3Exp3URIEv:
  136|  9.54k|inline const RegEx& URI() {
  137|  9.54k|  static const RegEx e = Word() | RegEx("#;/?:@&=+$,_.!~*'()[]", REGEX_OR) |
  138|  9.54k|                         (RegEx('%') + Hex() + Hex());
  139|  9.54k|  return e;
  140|  9.54k|}
_ZN4YAML3Exp3TagEv:
  141|  3.09M|inline const RegEx& Tag() {
  142|  3.09M|  static const RegEx e = Word() | RegEx("#;/?:@&=+$_.~*'()", REGEX_OR) |
  143|  3.09M|                         (RegEx('%') + Hex() + Hex());
  144|  3.09M|  return e;
  145|  3.09M|}
_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.66M|inline const RegEx& ScanScalarEndInFlow() {
  177|  1.66M|  static const RegEx e = (EndScalarInFlow() | (BlankOrBreak() + Comment()));
  178|  1.66M|  return e;
  179|  1.66M|}
_ZN4YAML3Exp13ScanScalarEndEv:
  181|  1.52M|inline const RegEx& ScanScalarEnd() {
  182|  1.52M|  static const RegEx e = EndScalar() | (BlankOrBreak() + Comment());
  183|  1.52M|  return e;
  184|  1.52M|}
_ZN4YAML3Exp14EscSingleQuoteEv:
  185|  2.46k|inline const RegEx& EscSingleQuote() {
  186|  2.46k|  static const RegEx e = RegEx("\'\'");
  187|  2.46k|  return e;
  188|  2.46k|}
_ZN4YAML3Exp8EscBreakEv:
  189|  7.68M|inline const RegEx& EscBreak() {
  190|  7.68M|  static const RegEx e = RegEx('\\') + Break();
  191|  7.68M|  return e;
  192|  7.68M|}
_ZN4YAML3Exp14ChompIndicatorEv:
  194|      3|inline const RegEx& ChompIndicator() {
  195|      3|  static const RegEx e = RegEx("+-", REGEX_OR);
  196|      3|  return e;
  197|      3|}
_ZN4YAML3Exp5ChompEv:
  198|  3.54k|inline const RegEx& Chomp() {
  199|  3.54k|  static const RegEx e = (ChompIndicator() + Digit()) |
  200|  3.54k|                         (Digit() + ChompIndicator()) | ChompIndicator() |
  201|  3.54k|                         Digit();
  202|  3.54k|  return e;
  203|  3.54k|}

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

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

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

_ZN4YAML12IsNullStringEPKcm:
   13|   413k|bool IsNullString(const char* str, std::size_t size) {
   14|   413k|  return size == 0 || same(str, size, "~") || same(str, size, "null") ||
  ------------------
  |  Branch (14:10): [True: 0, False: 413k]
  |  Branch (14:23): [True: 5.60k, False: 407k]
  |  Branch (14:47): [True: 208, False: 407k]
  ------------------
   15|   407k|         same(str, size, "Null") || same(str, size, "NULL");
  ------------------
  |  Branch (15:10): [True: 516, False: 407k]
  |  Branch (15:37): [True: 27, False: 407k]
  ------------------
   16|   413k|}
null.cpp:_ZN4YAMLL4sameILm2EEEbPKcmRAT__S1_:
    8|   413k|static bool same(const char* str, std::size_t size, const char (&literal)[N]) {
    9|   413k|  constexpr int literalSize = N - 1; // minus null terminator
   10|   413k|  return size == literalSize && std::strncmp(str, literal, literalSize) == 0;
  ------------------
  |  Branch (10:10): [True: 392k, False: 20.8k]
  |  Branch (10:33): [True: 5.60k, False: 387k]
  ------------------
   11|   413k|}
null.cpp:_ZN4YAMLL4sameILm5EEEbPKcmRAT__S1_:
    8|  1.22M|static bool same(const char* str, std::size_t size, const char (&literal)[N]) {
    9|  1.22M|  constexpr int literalSize = N - 1; // minus null terminator
   10|  1.22M|  return size == literalSize && std::strncmp(str, literal, literalSize) == 0;
  ------------------
  |  Branch (10:10): [True: 11.6k, False: 1.21M]
  |  Branch (10:33): [True: 751, False: 10.8k]
  ------------------
   11|  1.22M|}

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

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

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

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

_ZNK4YAML5RegEx7MatchesERKNS_6StreamE:
   26|   482M|inline bool RegEx::Matches(const Stream& in) const { return Match(in) >= 0; }
_ZNK4YAML5RegEx5MatchERKNS_6StreamE:
   49|   534M|inline int RegEx::Match(const Stream& in) const {
   50|   534M|  StreamCharSource source(in);
   51|   534M|  return Match(source);
   52|   534M|}
_ZNK4YAML5RegEx5MatchINS_16StreamCharSourceEEEiRKT_:
   72|  1.11G|inline int RegEx::Match(const Source& source) const {
   73|  1.11G|  return IsValidSource(source) ? MatchUnchecked(source) : -1;
  ------------------
  |  Branch (73:10): [True: 1.11G, False: 0]
  ------------------
   74|  1.11G|}
_ZNK4YAML5RegEx13IsValidSourceINS_16StreamCharSourceEEEbRKT_:
   55|  1.11G|inline bool RegEx::IsValidSource(const Source& source) const {
   56|  1.11G|  return source;
   57|  1.11G|}
_ZNK4YAML5RegEx14MatchUncheckedINS_16StreamCharSourceEEEiRKT_:
   77|  3.66G|inline int RegEx::MatchUnchecked(const Source& source) const {
   78|  3.66G|  switch (m_op) {
  ------------------
  |  Branch (78:11): [True: 3.66G, False: 0]
  ------------------
   79|  19.9M|    case REGEX_EMPTY:
  ------------------
  |  Branch (79:5): [True: 19.9M, False: 3.64G]
  ------------------
   80|  19.9M|      return MatchOpEmpty(source);
   81|  1.87G|    case REGEX_MATCH:
  ------------------
  |  Branch (81:5): [True: 1.87G, False: 1.78G]
  ------------------
   82|  1.87G|      return MatchOpMatch(source);
   83|  24.6M|    case REGEX_RANGE:
  ------------------
  |  Branch (83:5): [True: 24.6M, False: 3.63G]
  ------------------
   84|  24.6M|      return MatchOpRange(source);
   85|  1.18G|    case REGEX_OR:
  ------------------
  |  Branch (85:5): [True: 1.18G, False: 2.47G]
  ------------------
   86|  1.18G|      return MatchOpOr(source);
   87|  18.8M|    case REGEX_AND:
  ------------------
  |  Branch (87:5): [True: 18.8M, False: 3.64G]
  ------------------
   88|  18.8M|      return MatchOpAnd(source);
   89|  37.7M|    case REGEX_NOT:
  ------------------
  |  Branch (89:5): [True: 37.7M, False: 3.62G]
  ------------------
   90|  37.7M|      return MatchOpNot(source);
   91|   501M|    case REGEX_SEQ:
  ------------------
  |  Branch (91:5): [True: 501M, False: 3.15G]
  ------------------
   92|   501M|      return MatchOpSeq(source);
   93|  3.66G|  }
   94|       |
   95|      0|  return -1;
   96|  3.66G|}
_ZNK4YAML5RegEx12MatchOpEmptyINS_16StreamCharSourceEEEiRKT_:
  106|  19.9M|inline int RegEx::MatchOpEmpty(const Source& source) const {
  107|  19.9M|  return source[0] == Stream::eof() ? 0 : -1;
  ------------------
  |  Branch (107:10): [True: 2.30M, False: 17.6M]
  ------------------
  108|  19.9M|}
_ZNK4YAML5RegEx12MatchOpMatchINS_16StreamCharSourceEEEiRKT_:
  119|  1.87G|inline int RegEx::MatchOpMatch(const Source& source) const {
  120|  1.87G|  if (source[0] != m_a)
  ------------------
  |  Branch (120:7): [True: 1.71G, False: 159M]
  ------------------
  121|  1.71G|    return -1;
  122|   159M|  return 1;
  123|  1.87G|}
_ZNK4YAML5RegEx12MatchOpRangeINS_16StreamCharSourceEEEiRKT_:
  127|  24.6M|inline int RegEx::MatchOpRange(const Source& source) const {
  128|  24.6M|  if (m_a > source[0] || m_z < source[0])
  ------------------
  |  Branch (128:7): [True: 18.9M, False: 5.72M]
  |  Branch (128:26): [True: 34.5k, False: 5.69M]
  ------------------
  129|  19.0M|    return -1;
  130|  5.69M|  return 1;
  131|  24.6M|}
_ZNK4YAML5RegEx9MatchOpOrINS_16StreamCharSourceEEEiRKT_:
  135|  1.18G|inline int RegEx::MatchOpOr(const Source& source) const {
  136|  2.48G|  for (const RegEx& param : m_params) {
  ------------------
  |  Branch (136:27): [True: 2.48G, False: 1.00G]
  ------------------
  137|  2.48G|    int n = param.MatchUnchecked(source);
  138|  2.48G|    if (n >= 0)
  ------------------
  |  Branch (138:9): [True: 182M, False: 2.30G]
  ------------------
  139|   182M|      return n;
  140|  2.48G|  }
  141|  1.00G|  return -1;
  142|  1.18G|}
_ZNK4YAML5RegEx10MatchOpAndINS_16StreamCharSourceEEEiRKT_:
  149|  18.8M|inline int RegEx::MatchOpAnd(const Source& source) const {
  150|  18.8M|  int first = -1;
  151|  18.8M|  for (std::size_t i = 0; i < m_params.size(); i++) {
  ------------------
  |  Branch (151:27): [True: 18.8M, False: 4.66k]
  ------------------
  152|  18.8M|    int n = m_params[i].MatchUnchecked(source);
  153|  18.8M|    if (n == -1)
  ------------------
  |  Branch (153:9): [True: 18.7M, False: 10.2k]
  ------------------
  154|  18.7M|      return -1;
  155|  10.2k|    if (i == 0)
  ------------------
  |  Branch (155:9): [True: 5.56k, False: 4.66k]
  ------------------
  156|  5.56k|      first = n;
  157|  10.2k|  }
  158|  4.66k|  return first;
  159|  18.8M|}
_ZNK4YAML5RegEx10MatchOpNotINS_16StreamCharSourceEEEiRKT_:
  163|  37.7M|inline int RegEx::MatchOpNot(const Source& source) const {
  164|  37.7M|  if (m_params.empty())
  ------------------
  |  Branch (164:7): [True: 0, False: 37.7M]
  ------------------
  165|      0|    return -1;
  166|  37.7M|  if (m_params[0].MatchUnchecked(source) >= 0)
  ------------------
  |  Branch (166:7): [True: 601k, False: 37.1M]
  ------------------
  167|   601k|    return -1;
  168|  37.1M|  return 1;
  169|  37.7M|}
_ZNK4YAML5RegEx10MatchOpSeqINS_16StreamCharSourceEEEiRKT_:
  173|   501M|inline int RegEx::MatchOpSeq(const Source& source) const {
  174|   501M|  int offset = 0;
  175|   582M|  for (const RegEx& param : m_params) {
  ------------------
  |  Branch (175:27): [True: 582M, False: 10.9M]
  ------------------
  176|   582M|    int n = param.Match(source + offset);  // note Match, not
  177|       |                                           // MatchUnchecked because we
  178|       |                                           // need to check validity after
  179|       |                                           // the offset
  180|   582M|    if (n == -1)
  ------------------
  |  Branch (180:9): [True: 490M, False: 92.4M]
  ------------------
  181|   490M|      return -1;
  182|  92.4M|    offset += n;
  183|  92.4M|  }
  184|       |
  185|  10.9M|  return offset;
  186|   501M|}
_ZNK4YAML5RegEx7MatchesEc:
   16|    538|inline bool RegEx::Matches(char ch) const {
   17|    538|  std::string str;
   18|    538|  str += ch;
   19|    538|  return Matches(str);
   20|    538|}
_ZNK4YAML5RegEx7MatchesERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
   22|    538|inline bool RegEx::Matches(const std::string& str) const {
   23|    538|  return Match(str) >= 0;
   24|    538|}
_ZNK4YAML5RegEx5MatchERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
   44|    538|inline int RegEx::Match(const std::string& str) const {
   45|    538|  StringCharSource source(str.c_str(), str.size());
   46|    538|  return Match(source);
   47|    538|}
_ZNK4YAML5RegEx13IsValidSourceINS_16StringCharSourceEEEbRKT_:
   61|    538|    const StringCharSource& source) const {
   62|    538|  switch (m_op) {
   63|      0|    case REGEX_MATCH:
  ------------------
  |  Branch (63:5): [True: 0, False: 538]
  ------------------
   64|    538|    case REGEX_RANGE:
  ------------------
  |  Branch (64:5): [True: 538, False: 0]
  ------------------
   65|    538|      return source;
   66|      0|    default:
  ------------------
  |  Branch (66:5): [True: 0, False: 538]
  ------------------
   67|      0|      return true;
   68|    538|  }
   69|    538|}
_ZNK4YAML5RegEx5MatchINS_16StringCharSourceEEEiRKT_:
   72|    538|inline int RegEx::Match(const Source& source) const {
   73|    538|  return IsValidSource(source) ? MatchUnchecked(source) : -1;
  ------------------
  |  Branch (73:10): [True: 538, False: 0]
  ------------------
   74|    538|}
_ZNK4YAML5RegEx14MatchUncheckedINS_16StringCharSourceEEEiRKT_:
   77|    538|inline int RegEx::MatchUnchecked(const Source& source) const {
   78|    538|  switch (m_op) {
  ------------------
  |  Branch (78:11): [True: 538, False: 0]
  ------------------
   79|      0|    case REGEX_EMPTY:
  ------------------
  |  Branch (79:5): [True: 0, False: 538]
  ------------------
   80|      0|      return MatchOpEmpty(source);
   81|      0|    case REGEX_MATCH:
  ------------------
  |  Branch (81:5): [True: 0, False: 538]
  ------------------
   82|      0|      return MatchOpMatch(source);
   83|    538|    case REGEX_RANGE:
  ------------------
  |  Branch (83:5): [True: 538, False: 0]
  ------------------
   84|    538|      return MatchOpRange(source);
   85|      0|    case REGEX_OR:
  ------------------
  |  Branch (85:5): [True: 0, False: 538]
  ------------------
   86|      0|      return MatchOpOr(source);
   87|      0|    case REGEX_AND:
  ------------------
  |  Branch (87:5): [True: 0, False: 538]
  ------------------
   88|      0|      return MatchOpAnd(source);
   89|      0|    case REGEX_NOT:
  ------------------
  |  Branch (89:5): [True: 0, False: 538]
  ------------------
   90|      0|      return MatchOpNot(source);
   91|      0|    case REGEX_SEQ:
  ------------------
  |  Branch (91:5): [True: 0, False: 538]
  ------------------
   92|      0|      return MatchOpSeq(source);
   93|    538|  }
   94|       |
   95|      0|  return -1;
   96|    538|}
_ZNK4YAML5RegEx12MatchOpRangeINS_16StringCharSourceEEEiRKT_:
  127|    538|inline int RegEx::MatchOpRange(const Source& source) const {
  128|    538|  if (m_a > source[0] || m_z < source[0])
  ------------------
  |  Branch (128:7): [True: 0, False: 538]
  |  Branch (128:26): [True: 0, False: 538]
  ------------------
  129|      0|    return -1;
  130|    538|  return 1;
  131|    538|}

_ZN4YAML7ScannerC2ERNSt3__113basic_istreamIcNS1_11char_traitsIcEEEE:
   11|  6.66k|    : INPUT(in),
   12|  6.66k|      m_tokens{},
   13|  6.66k|      m_startedStream(false),
   14|  6.66k|      m_endedStream(false),
   15|  6.66k|      m_simpleKeyAllowed(false),
   16|  6.66k|      m_scalarValueAllowed(false),
   17|  6.66k|      m_canBeJSONFlow(false),
   18|  6.66k|      m_simpleKeys{},
   19|  6.66k|      m_indents{},
   20|  6.66k|      m_indentRefs{},
   21|  6.66k|      m_flows{} {}
_ZN4YAML7ScannerD2Ev:
   23|  6.66k|Scanner::~Scanner() = default;
_ZN4YAML7Scanner5emptyEv:
   25|  15.9M|bool Scanner::empty() {
   26|  15.9M|  EnsureTokensInQueue();
   27|  15.9M|  return m_tokens.empty();
   28|  15.9M|}
_ZN4YAML7Scanner3popEv:
   30|  4.40M|void Scanner::pop() {
   31|  4.40M|  EnsureTokensInQueue();
   32|  4.40M|  if (!m_tokens.empty())
  ------------------
  |  Branch (32:7): [True: 4.40M, False: 0]
  ------------------
   33|  4.40M|    m_tokens.pop();
   34|  4.40M|}
_ZN4YAML7Scanner4peekEv:
   36|  22.2M|Token& Scanner::peek() {
   37|  22.2M|  EnsureTokensInQueue();
   38|  22.2M|  assert(!m_tokens.empty());  // should we be asserting here? I mean, we really
   39|       |                              // just be checking
   40|       |                              // if it's empty before peeking.
   41|       |
   42|       |#if 0
   43|       |		static Token *pLast = 0;
   44|       |		if(pLast != &m_tokens.front())
   45|       |			std::cerr << "peek: " << m_tokens.front() << "\n";
   46|       |		pLast = &m_tokens.front();
   47|       |#endif
   48|       |
   49|  22.2M|  return m_tokens.front();
   50|  22.2M|}
_ZNK4YAML7Scanner4markEv:
   52|  2.12M|Mark Scanner::mark() const { return INPUT.mark(); }
_ZN4YAML7Scanner19EnsureTokensInQueueEv:
   54|  42.6M|void Scanner::EnsureTokensInQueue() {
   55|  97.7M|  while (true) {
  ------------------
  |  Branch (55:10): [True: 97.7M, Folded]
  ------------------
   56|  97.7M|    if (!m_tokens.empty()) {
  ------------------
  |  Branch (56:9): [True: 95.6M, False: 2.03M]
  ------------------
   57|  95.6M|      Token& token = m_tokens.front();
   58|       |
   59|       |      // if this guy's valid, then we're done
   60|  95.6M|      if (token.status == Token::VALID) {
  ------------------
  |  Branch (60:11): [True: 41.9M, False: 53.6M]
  ------------------
   61|  41.9M|        return;
   62|  41.9M|      }
   63|       |
   64|       |      // here's where we clean up the impossible tokens
   65|  53.6M|      if (token.status == Token::INVALID) {
  ------------------
  |  Branch (65:11): [True: 642k, False: 53.0M]
  ------------------
   66|   642k|        m_tokens.pop();
   67|   642k|        continue;
   68|   642k|      }
   69|       |
   70|       |      // note: what's left are the unverified tokens
   71|  53.6M|    }
   72|       |
   73|       |    // no token? maybe we've actually finished
   74|  55.0M|    if (m_endedStream) {
  ------------------
  |  Branch (74:9): [True: 612k, False: 54.4M]
  ------------------
   75|   612k|      return;
   76|   612k|    }
   77|       |
   78|       |    // no? then scan...
   79|  54.4M|    ScanNextToken();
   80|  54.4M|  }
   81|  42.6M|}
_ZN4YAML7Scanner13ScanNextTokenEv:
   83|  54.4M|void Scanner::ScanNextToken() {
   84|  54.4M|  if (m_endedStream) {
  ------------------
  |  Branch (84:7): [True: 0, False: 54.4M]
  ------------------
   85|      0|    return;
   86|      0|  }
   87|       |
   88|  54.4M|  if (!m_startedStream) {
  ------------------
  |  Branch (88:7): [True: 6.66k, False: 54.4M]
  ------------------
   89|  6.66k|    return StartStream();
   90|  6.66k|  }
   91|       |
   92|       |  // get rid of whitespace, etc. (in between tokens it should be irrelevant)
   93|  54.4M|  ScanToNextToken();
   94|       |
   95|       |  // maybe need to end some blocks
   96|  54.4M|  PopIndentToHere();
   97|       |
   98|       |  // *****
   99|       |  // And now branch based on the next few characters!
  100|       |  // *****
  101|       |
  102|       |  // end of stream
  103|  54.4M|  if (!INPUT) {
  ------------------
  |  Branch (103:7): [True: 5.52k, False: 54.4M]
  ------------------
  104|  5.52k|    return EndStream();
  105|  5.52k|  }
  106|       |
  107|  54.4M|  if (INPUT.column() == 0 && INPUT.peek() == Keys::Directive) {
  ------------------
  |  Branch (107:7): [True: 2.86M, False: 51.5M]
  |  Branch (107:30): [True: 12.8k, False: 2.85M]
  ------------------
  108|  12.8k|    return ScanDirective();
  109|  12.8k|  }
  110|       |
  111|       |  // document token
  112|  54.4M|  if (INPUT.column() == 0 && Exp::DocStart().Matches(INPUT)) {
  ------------------
  |  Branch (112:7): [True: 2.85M, False: 51.5M]
  |  Branch (112:30): [True: 413k, False: 2.44M]
  ------------------
  113|   413k|    return ScanDocStart();
  114|   413k|  }
  115|       |
  116|  54.0M|  if (INPUT.column() == 0 && Exp::DocEnd().Matches(INPUT)) {
  ------------------
  |  Branch (116:7): [True: 2.44M, False: 51.5M]
  |  Branch (116:30): [True: 128k, False: 2.31M]
  ------------------
  117|   128k|    return ScanDocEnd();
  118|   128k|  }
  119|       |
  120|       |  // flow start/end/entry
  121|  53.8M|  if (INPUT.peek() == Keys::FlowSeqStart ||
  ------------------
  |  Branch (121:7): [True: 29.2M, False: 24.6M]
  ------------------
  122|  35.7M|      INPUT.peek() == Keys::FlowMapStart) {
  ------------------
  |  Branch (122:7): [True: 6.56M, False: 18.1M]
  ------------------
  123|  35.7M|    return ScanFlowStart();
  124|  35.7M|  }
  125|       |
  126|  18.1M|  if (INPUT.peek() == Keys::FlowSeqEnd || INPUT.peek() == Keys::FlowMapEnd) {
  ------------------
  |  Branch (126:7): [True: 19.8k, False: 18.1M]
  |  Branch (126:43): [True: 654k, False: 17.4M]
  ------------------
  127|   674k|    return ScanFlowEnd();
  128|   674k|  }
  129|       |
  130|  17.4M|  if (INPUT.peek() == Keys::FlowEntry) {
  ------------------
  |  Branch (130:7): [True: 4.35M, False: 13.0M]
  ------------------
  131|       |    // values starting with `,` are not allowed.
  132|       |    // eg: reject `,foo`
  133|  4.35M|    if (INPUT.column() == 0) {
  ------------------
  |  Branch (133:9): [True: 7, False: 4.35M]
  ------------------
  134|      7|      throw ParserException(INPUT.mark(), ErrorMsg::UNEXPECTED_FLOW);
  135|      7|    }
  136|       |    // if we already parsed a quoted scalar value and we are not in a flow,
  137|       |    // then `,` is not a valid character.
  138|       |    // eg: reject `"foo",`
  139|  4.35M|    if (!m_scalarValueAllowed) {
  ------------------
  |  Branch (139:9): [True: 1, False: 4.35M]
  ------------------
  140|      1|      throw ParserException(INPUT.mark(), ErrorMsg::UNEXPECTED_SCALAR);
  141|      1|    }
  142|  4.35M|    return ScanFlowEntry();
  143|  4.35M|  }
  144|       |
  145|       |  // block/map stuff
  146|  13.0M|  if (Exp::BlockEntry().Matches(INPUT)) {
  ------------------
  |  Branch (146:7): [True: 1.44M, False: 11.6M]
  ------------------
  147|  1.44M|    return ScanBlockEntry();
  148|  1.44M|  }
  149|       |
  150|  11.6M|  if ((InBlockContext() ? Exp::Key() : Exp::KeyInFlow()).Matches(INPUT)) {
  ------------------
  |  Branch (150:7): [True: 21.5k, False: 11.6M]
  |  Branch (150:8): [True: 9.33M, False: 2.31M]
  ------------------
  151|  21.5k|    return ScanKey();
  152|  21.5k|  }
  153|       |
  154|  11.6M|  if (GetValueRegex().Matches(INPUT)) {
  ------------------
  |  Branch (154:7): [True: 6.63M, False: 4.99M]
  ------------------
  155|  6.63M|    return ScanValue();
  156|  6.63M|  }
  157|       |
  158|       |  // alias/anchor
  159|  4.99M|  if (INPUT.peek() == Keys::Alias || INPUT.peek() == Keys::Anchor) {
  ------------------
  |  Branch (159:7): [True: 1.89k, False: 4.99M]
  |  Branch (159:38): [True: 599k, False: 4.39M]
  ------------------
  160|   601k|    return ScanAnchorOrAlias();
  161|   601k|  }
  162|       |
  163|       |  // tag
  164|  4.39M|  if (INPUT.peek() == Keys::Tag) {
  ------------------
  |  Branch (164:7): [True: 1.20M, False: 3.19M]
  ------------------
  165|  1.20M|    return ScanTag();
  166|  1.20M|  }
  167|       |
  168|       |  // special scalars
  169|  3.19M|  if (InBlockContext() && (INPUT.peek() == Keys::LiteralScalar ||
  ------------------
  |  Branch (169:7): [True: 1.52M, False: 1.66M]
  |  Branch (169:28): [True: 1.13k, False: 1.52M]
  ------------------
  170|  1.52M|                           INPUT.peek() == Keys::FoldedScalar)) {
  ------------------
  |  Branch (170:28): [True: 2.40k, False: 1.52M]
  ------------------
  171|  3.54k|    return ScanBlockScalar();
  172|  3.54k|  }
  173|       |
  174|       |  // if we already parsed a quoted scalar value in this line,
  175|       |  // another scalar value is an error.
  176|       |  // eg: reject `"foo" "bar"`
  177|  3.19M|  if (!m_scalarValueAllowed) {
  ------------------
  |  Branch (177:7): [True: 35, False: 3.19M]
  ------------------
  178|     35|    throw ParserException(INPUT.mark(), ErrorMsg::UNEXPECTED_SCALAR);
  179|     35|  }
  180|       |
  181|  3.19M|  if (INPUT.peek() == '\'' || INPUT.peek() == '\"') {
  ------------------
  |  Branch (181:7): [True: 2.46k, False: 3.18M]
  |  Branch (181:31): [True: 4.00k, False: 3.18M]
  ------------------
  182|  6.46k|    return ScanQuotedScalar();
  183|  6.46k|  }
  184|       |
  185|       |  // plain scalars
  186|  3.18M|  if ((InBlockContext() ? Exp::PlainScalar() : Exp::PlainScalarInFlow())
  ------------------
  |  Branch (186:7): [True: 3.18M, False: 61]
  |  Branch (186:8): [True: 1.52M, False: 1.66M]
  ------------------
  187|  3.18M|          .Matches(INPUT)) {
  188|  3.18M|    return ScanPlainScalar();
  189|  3.18M|  }
  190|       |
  191|       |  // don't know what it is!
  192|     61|  throw ParserException(INPUT.mark(), ErrorMsg::UNKNOWN_TOKEN);
  193|  3.18M|}
_ZN4YAML7Scanner15ScanToNextTokenEv:
  195|  54.4M|void Scanner::ScanToNextToken() {
  196|  62.7M|  while (true) {
  ------------------
  |  Branch (196:10): [True: 62.7M, Folded]
  ------------------
  197|       |    // first eat whitespace
  198|  62.9M|    while (INPUT && IsWhitespaceToBeEaten(INPUT.peek())) {
  ------------------
  |  Branch (198:12): [True: 62.9M, False: 5.42k]
  |  Branch (198:21): [True: 225k, False: 62.7M]
  ------------------
  199|   225k|      if (InBlockContext() && Exp::Tab().Matches(INPUT)) {
  ------------------
  |  Branch (199:11): [True: 145k, False: 80.0k]
  |  Branch (199:31): [True: 2.07k, False: 143k]
  ------------------
  200|  2.07k|        m_simpleKeyAllowed = false;
  201|  2.07k|      }
  202|   225k|      INPUT.eat(1);
  203|   225k|    }
  204|       |
  205|       |    // then eat a comment
  206|  62.7M|    if (Exp::Comment().Matches(INPUT)) {
  ------------------
  |  Branch (206:9): [True: 1.49k, False: 62.7M]
  ------------------
  207|       |      // eat until line break
  208|  4.24M|      while (INPUT && !Exp::Break().Matches(INPUT)) {
  ------------------
  |  Branch (208:14): [True: 4.24M, False: 100]
  |  Branch (208:23): [True: 4.24M, False: 1.39k]
  ------------------
  209|  4.24M|        INPUT.eat(1);
  210|  4.24M|      }
  211|  1.49k|    }
  212|       |
  213|       |    // if it's NOT a line break, then we're done!
  214|  62.7M|    if (!Exp::Break().Matches(INPUT)) {
  ------------------
  |  Branch (214:9): [True: 54.4M, False: 8.30M]
  ------------------
  215|  54.4M|      break;
  216|  54.4M|    }
  217|       |
  218|       |    // otherwise, let's eat the line break and keep going
  219|  8.30M|    int n = Exp::Break().Match(INPUT);
  220|  8.30M|    INPUT.eat(n);
  221|       |
  222|       |    // oh yeah, and let's get rid of that simple key
  223|  8.30M|    InvalidateSimpleKey();
  224|       |
  225|       |    // new line - we accept a scalar value now
  226|  8.30M|    m_scalarValueAllowed = true;
  227|       |
  228|       |    // new line - we may be able to accept a simple key now
  229|  8.30M|    if (InBlockContext()) {
  ------------------
  |  Branch (229:9): [True: 8.27M, False: 35.1k]
  ------------------
  230|  8.27M|      m_simpleKeyAllowed = true;
  231|  8.27M|    }
  232|  8.30M|  }
  233|  54.4M|}
_ZN4YAML7Scanner21IsWhitespaceToBeEatenEc:
  247|  62.9M|bool Scanner::IsWhitespaceToBeEaten(char ch) {
  248|  62.9M|  if (ch == ' ') {
  ------------------
  |  Branch (248:7): [True: 208k, False: 62.7M]
  ------------------
  249|   208k|    return true;
  250|   208k|  }
  251|       |
  252|  62.7M|  if (ch == '\t') {
  ------------------
  |  Branch (252:7): [True: 16.2k, False: 62.7M]
  ------------------
  253|  16.2k|    return true;
  254|  16.2k|  }
  255|       |
  256|  62.7M|  return false;
  257|  62.7M|}
_ZNK4YAML7Scanner13GetValueRegexEv:
  259|  11.6M|const RegEx& Scanner::GetValueRegex() const {
  260|  11.6M|  if (InBlockContext()) {
  ------------------
  |  Branch (260:7): [True: 9.31M, False: 2.30M]
  ------------------
  261|  9.31M|    return Exp::Value();
  262|  9.31M|  }
  263|       |
  264|  2.30M|  return m_canBeJSONFlow ? Exp::ValueInJSONFlow() : Exp::ValueInFlow();
  ------------------
  |  Branch (264:10): [True: 6.36k, False: 2.30M]
  ------------------
  265|  11.6M|}
_ZN4YAML7Scanner11StartStreamEv:
  267|  6.66k|void Scanner::StartStream() {
  268|  6.66k|  m_startedStream = true;
  269|  6.66k|  m_simpleKeyAllowed = true;
  270|  6.66k|  m_scalarValueAllowed = true;
  271|  6.66k|  std::unique_ptr<IndentMarker> pIndent(
  272|  6.66k|      new IndentMarker(-1, IndentMarker::NONE));
  273|  6.66k|  m_indentRefs.push_back(std::move(pIndent));
  274|  6.66k|  m_indents.push(&m_indentRefs.back());
  275|  6.66k|}
_ZN4YAML7Scanner9EndStreamEv:
  277|  5.52k|void Scanner::EndStream() {
  278|       |  // force newline
  279|  5.52k|  if (INPUT.column() > 0) {
  ------------------
  |  Branch (279:7): [True: 5.08k, False: 443]
  ------------------
  280|  5.08k|    INPUT.ResetColumn();
  281|  5.08k|  }
  282|       |
  283|  5.52k|  PopAllIndents();
  284|  5.52k|  PopAllSimpleKeys();
  285|       |
  286|  5.52k|  m_simpleKeyAllowed = false;
  287|  5.52k|  m_scalarValueAllowed = false;
  288|  5.52k|  m_endedStream = true;
  289|  5.52k|}
_ZN4YAML7Scanner9PushTokenENS_5Token4TYPEE:
  291|  10.2M|Token* Scanner::PushToken(Token::TYPE type) {
  292|  10.2M|  m_tokens.push(Token(type, INPUT.mark()));
  293|  10.2M|  return &m_tokens.back();
  294|  10.2M|}
_ZNK4YAML7Scanner16GetStartTokenForENS0_12IndentMarker11INDENT_TYPEE:
  296|  10.2M|Token::TYPE Scanner::GetStartTokenFor(IndentMarker::INDENT_TYPE type) const {
  297|  10.2M|  switch (type) {
  ------------------
  |  Branch (297:11): [True: 10.2M, False: 0]
  ------------------
  298|  1.44M|    case IndentMarker::SEQ:
  ------------------
  |  Branch (298:5): [True: 1.44M, False: 8.81M]
  ------------------
  299|  1.44M|      return Token::BLOCK_SEQ_START;
  300|  8.81M|    case IndentMarker::MAP:
  ------------------
  |  Branch (300:5): [True: 8.81M, False: 1.44M]
  ------------------
  301|  8.81M|      return Token::BLOCK_MAP_START;
  302|      0|    case IndentMarker::NONE:
  ------------------
  |  Branch (302:5): [True: 0, False: 10.2M]
  ------------------
  303|      0|      assert(false);
  304|      0|      break;
  305|  10.2M|  }
  306|  10.2M|  assert(false);
  307|      0|  throw std::runtime_error("yaml-cpp: internal error, invalid indent type");
  308|  10.2M|}
_ZN4YAML7Scanner12PushIndentToEiNS0_12IndentMarker11INDENT_TYPEE:
  311|  10.3M|                                             IndentMarker::INDENT_TYPE type) {
  312|       |  // are we in flow?
  313|  10.3M|  if (InFlowContext()) {
  ------------------
  |  Branch (313:7): [True: 0, False: 10.3M]
  ------------------
  314|      0|    return nullptr;
  315|      0|  }
  316|       |
  317|  10.3M|  std::unique_ptr<IndentMarker> pIndent(new IndentMarker(column, type));
  318|  10.3M|  IndentMarker& indent = *pIndent;
  319|  10.3M|  const IndentMarker& lastIndent = *m_indents.top();
  320|       |
  321|       |  // is this actually an indentation?
  322|  10.3M|  if (indent.column < lastIndent.column) {
  ------------------
  |  Branch (322:7): [True: 0, False: 10.3M]
  ------------------
  323|      0|    return nullptr;
  324|      0|  }
  325|  10.3M|  if (indent.column == lastIndent.column &&
  ------------------
  |  Branch (325:7): [True: 100k, False: 10.2M]
  ------------------
  326|   100k|      !(indent.type == IndentMarker::SEQ &&
  ------------------
  |  Branch (326:9): [True: 17.7k, False: 82.7k]
  ------------------
  327|  87.9k|        lastIndent.type == IndentMarker::MAP)) {
  ------------------
  |  Branch (327:9): [True: 12.5k, False: 5.21k]
  ------------------
  328|  87.9k|    return nullptr;
  329|  87.9k|  }
  330|       |
  331|       |  // push a start token
  332|  10.2M|  indent.pStartToken = PushToken(GetStartTokenFor(type));
  333|       |
  334|       |  // and then the indent
  335|  10.2M|  m_indents.push(&indent);
  336|  10.2M|  m_indentRefs.push_back(std::move(pIndent));
  337|  10.2M|  return &m_indentRefs.back();
  338|  10.3M|}
_ZN4YAML7Scanner15PopIndentToHereEv:
  340|  54.4M|void Scanner::PopIndentToHere() {
  341|       |  // are we in flow?
  342|  54.4M|  if (InFlowContext()) {
  ------------------
  |  Branch (342:7): [True: 43.1M, False: 11.2M]
  ------------------
  343|  43.1M|    return;
  344|  43.1M|  }
  345|       |
  346|       |  // now pop away
  347|  14.5M|  while (!m_indents.empty()) {
  ------------------
  |  Branch (347:10): [True: 14.5M, False: 0]
  ------------------
  348|  14.5M|    const IndentMarker& indent = *m_indents.top();
  349|  14.5M|    if (indent.column < INPUT.column()) {
  ------------------
  |  Branch (349:9): [True: 10.0M, False: 4.45M]
  ------------------
  350|  10.0M|      break;
  351|  10.0M|    }
  352|  4.45M|    if (indent.column == INPUT.column() &&
  ------------------
  |  Branch (352:9): [True: 2.31M, False: 2.14M]
  ------------------
  353|  2.31M|        !(indent.type == IndentMarker::SEQ &&
  ------------------
  |  Branch (353:11): [True: 1.08M, False: 1.22M]
  ------------------
  354|  1.22M|          !Exp::BlockEntry().Matches(INPUT))) {
  ------------------
  |  Branch (354:11): [True: 1.08M, False: 5.21k]
  ------------------
  355|  1.22M|      break;
  356|  1.22M|    }
  357|       |
  358|  3.23M|    PopIndent();
  359|  3.23M|  }
  360|       |
  361|  12.4M|  while (!m_indents.empty() &&
  ------------------
  |  Branch (361:10): [True: 12.4M, False: 0]
  ------------------
  362|  12.4M|         m_indents.top()->status == IndentMarker::INVALID) {
  ------------------
  |  Branch (362:10): [True: 1.17M, False: 11.2M]
  ------------------
  363|  1.17M|    PopIndent();
  364|  1.17M|  }
  365|  11.2M|}
_ZN4YAML7Scanner13PopAllIndentsEv:
  367|   560k|void Scanner::PopAllIndents() {
  368|       |  // are we in flow?
  369|   560k|  if (InFlowContext()) {
  ------------------
  |  Branch (369:7): [True: 55.7k, False: 504k]
  ------------------
  370|  55.7k|    return;
  371|  55.7k|  }
  372|       |
  373|       |  // now pop away
  374|  2.19M|  while (!m_indents.empty()) {
  ------------------
  |  Branch (374:10): [True: 2.19M, False: 0]
  ------------------
  375|  2.19M|    const IndentMarker& indent = *m_indents.top();
  376|  2.19M|    if (indent.type == IndentMarker::NONE) {
  ------------------
  |  Branch (376:9): [True: 504k, False: 1.68M]
  ------------------
  377|   504k|      break;
  378|   504k|    }
  379|       |
  380|  1.68M|    PopIndent();
  381|  1.68M|  }
  382|   504k|}
_ZN4YAML7Scanner9PopIndentEv:
  384|  6.09M|void Scanner::PopIndent() {
  385|  6.09M|  const IndentMarker& indent = *m_indents.top();
  386|  6.09M|  m_indents.pop();
  387|       |
  388|  6.09M|  if (indent.status != IndentMarker::VALID) {
  ------------------
  |  Branch (388:7): [True: 2.27M, False: 3.82M]
  ------------------
  389|  2.27M|    InvalidateSimpleKey();
  390|  2.27M|    return;
  391|  2.27M|  }
  392|       |
  393|  3.82M|  if (indent.type == IndentMarker::SEQ) {
  ------------------
  |  Branch (393:7): [True: 1.44M, False: 2.38M]
  ------------------
  394|  1.44M|    m_tokens.push(Token(Token::BLOCK_SEQ_END, INPUT.mark()));
  395|  2.38M|  } else if (indent.type == IndentMarker::MAP) {
  ------------------
  |  Branch (395:14): [True: 2.38M, False: 0]
  ------------------
  396|  2.38M|    m_tokens.push(Token(Token::BLOCK_MAP_END, INPUT.mark()));
  397|  2.38M|  }
  398|  3.82M|}
_ZNK4YAML7Scanner12GetTopIndentEv:
  400|  1.52M|int Scanner::GetTopIndent() const {
  401|  1.52M|  if (m_indents.empty()) {
  ------------------
  |  Branch (401:7): [True: 0, False: 1.52M]
  ------------------
  402|      0|    return 0;
  403|      0|  }
  404|  1.52M|  return m_indents.top()->column;
  405|  1.52M|}

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

_ZN4YAML10ScanScalarERNS_6StreamERNS_16ScanScalarParamsE:
   21|  3.19M|std::string ScanScalar(Stream& INPUT, ScanScalarParams& params) {
   22|  3.19M|  bool foundNonEmptyLine = false;
   23|  3.19M|  bool pastOpeningBreak = (params.fold == FOLD_FLOW);
   24|  3.19M|  bool emptyLine = false, moreIndented = false;
   25|  3.19M|  int foldedNewlineCount = 0;
   26|  3.19M|  bool foldedNewlineStartedMoreIndented = false;
   27|  3.19M|  std::size_t lastEscapedChar = std::string::npos;
   28|  3.19M|  std::string scalar;
   29|  3.19M|  params.leadingSpaces = false;
   30|       |
   31|  3.19M|  if (!params.end) {
  ------------------
  |  Branch (31:7): [True: 3.49k, False: 3.19M]
  ------------------
   32|  3.49k|    params.end = &Exp::Empty();
   33|  3.49k|  }
   34|       |
   35|  17.1M|  while (INPUT) {
  ------------------
  |  Branch (35:10): [True: 17.1M, False: 894]
  ------------------
   36|       |    // ********************************
   37|       |    // Phase #1: scan until line ending
   38|       |
   39|  17.1M|    std::size_t lastNonWhitespaceChar = scalar.size();
   40|  17.1M|    bool escapedNewline = false;
   41|  88.6M|    while (!params.end->Matches(INPUT) && !Exp::Break().Matches(INPUT)) {
  ------------------
  |  Branch (41:12): [True: 86.9M, False: 1.67M]
  |  Branch (41:43): [True: 71.8M, False: 15.0M]
  ------------------
   42|  71.8M|      if (!INPUT) {
  ------------------
  |  Branch (42:11): [True: 1.79k, False: 71.8M]
  ------------------
   43|  1.79k|        break;
   44|  1.79k|      }
   45|       |
   46|       |      // document indicator?
   47|  71.8M|      if (INPUT.column() == 0 && Exp::DocIndicator().Matches(INPUT)) {
  ------------------
  |  Branch (47:11): [True: 500k, False: 71.3M]
  |  Branch (47:34): [True: 420k, False: 80.0k]
  ------------------
   48|   420k|        if (params.onDocIndicator == BREAK) {
  ------------------
  |  Branch (48:13): [True: 420k, False: 1]
  ------------------
   49|   420k|          break;
   50|   420k|        }
   51|      1|        if (params.onDocIndicator == THROW) {
  ------------------
  |  Branch (51:13): [True: 1, False: 0]
  ------------------
   52|      1|          throw ParserException(INPUT.mark(), ErrorMsg::DOC_IN_SCALAR);
   53|      1|        }
   54|      1|      }
   55|       |
   56|  71.4M|      foundNonEmptyLine = true;
   57|  71.4M|      pastOpeningBreak = true;
   58|       |
   59|       |      // escaped newline? (only if we're escaping on slash)
   60|  71.4M|      if (params.escape == '\\' && Exp::EscBreak().Matches(INPUT)) {
  ------------------
  |  Branch (60:11): [True: 7.68M, False: 63.7M]
  |  Branch (60:36): [True: 644, False: 7.68M]
  ------------------
   61|       |        // eat escape character and get out (but preserve trailing whitespace!)
   62|    644|        INPUT.get();
   63|    644|        lastNonWhitespaceChar = scalar.size();
   64|    644|        lastEscapedChar = scalar.size();
   65|    644|        escapedNewline = true;
   66|    644|        break;
   67|    644|      }
   68|       |
   69|       |      // escape this?
   70|  71.4M|      if (INPUT.peek() == params.escape) {
  ------------------
  |  Branch (70:11): [True: 29.7k, False: 71.4M]
  ------------------
   71|  29.7k|        scalar += Exp::Escape(INPUT);
   72|  29.7k|        lastNonWhitespaceChar = scalar.size();
   73|  29.7k|        lastEscapedChar = scalar.size();
   74|  29.7k|        continue;
   75|  29.7k|      }
   76|       |
   77|       |      // otherwise, just add the damn character
   78|  71.4M|      char ch = INPUT.get();
   79|  71.4M|      scalar += ch;
   80|  71.4M|      if (ch != ' ' && ch != '\t') {
  ------------------
  |  Branch (80:11): [True: 71.3M, False: 60.7k]
  |  Branch (80:24): [True: 69.9M, False: 1.39M]
  ------------------
   81|  69.9M|        lastNonWhitespaceChar = scalar.size();
   82|  69.9M|      }
   83|  71.4M|    }
   84|       |
   85|       |    // eof? if we're looking to eat something, then we throw
   86|  17.1M|    if (!INPUT) {
  ------------------
  |  Branch (86:9): [True: 1.86k, False: 17.1M]
  ------------------
   87|  1.86k|      if (params.eatEnd) {
  ------------------
  |  Branch (87:11): [True: 199, False: 1.66k]
  ------------------
   88|    199|        throw ParserException(INPUT.mark(), ErrorMsg::EOF_IN_SCALAR);
   89|    199|      }
   90|  1.66k|      break;
   91|  1.86k|    }
   92|       |
   93|       |    // doc indicator?
   94|  17.1M|    if (params.onDocIndicator == BREAK && INPUT.column() == 0 &&
  ------------------
  |  Branch (94:9): [True: 8.76M, False: 8.40M]
  |  Branch (94:43): [True: 4.89M, False: 3.87M]
  ------------------
   95|  4.89M|        Exp::DocIndicator().Matches(INPUT)) {
  ------------------
  |  Branch (95:9): [True: 420k, False: 4.47M]
  ------------------
   96|   420k|      break;
   97|   420k|    }
   98|       |
   99|       |    // are we done via character match?
  100|  16.7M|    int n = params.end->Match(INPUT);
  101|  16.7M|    if (n >= 0) {
  ------------------
  |  Branch (101:9): [True: 1.67M, False: 15.0M]
  ------------------
  102|  1.67M|      if (params.eatEnd) {
  ------------------
  |  Branch (102:11): [True: 6.06k, False: 1.67M]
  ------------------
  103|  6.06k|        INPUT.eat(n);
  104|  6.06k|      }
  105|  1.67M|      break;
  106|  1.67M|    }
  107|       |
  108|       |    // do we remove trailing whitespace?
  109|  15.0M|    if (params.fold == FOLD_FLOW)
  ------------------
  |  Branch (109:9): [True: 6.75M, False: 8.32M]
  ------------------
  110|  6.75M|      scalar.erase(lastNonWhitespaceChar);
  111|       |
  112|       |    // ********************************
  113|       |    // Phase #2: eat line ending
  114|  15.0M|    n = Exp::Break().Match(INPUT);
  115|  15.0M|    INPUT.eat(n);
  116|       |
  117|       |    // ********************************
  118|       |    // Phase #3: scan initial spaces
  119|       |
  120|       |    // first the required indentation
  121|  15.0M|    while (INPUT.peek() == ' ' &&
  ------------------
  |  Branch (121:12): [True: 10.6k, False: 15.0M]
  ------------------
  122|  10.6k|           (INPUT.column() < params.indent ||
  ------------------
  |  Branch (122:13): [True: 654, False: 9.94k]
  ------------------
  123|  9.94k|            (params.detectIndent && !foundNonEmptyLine)) &&
  ------------------
  |  Branch (123:14): [True: 1.94k, False: 8.00k]
  |  Branch (123:37): [True: 385, False: 1.55k]
  ------------------
  124|  1.03k|           !params.end->Matches(INPUT)) {
  ------------------
  |  Branch (124:12): [True: 845, False: 194]
  ------------------
  125|    845|      INPUT.eat(1);
  126|    845|    }
  127|       |
  128|       |    // update indent if we're auto-detecting
  129|  15.0M|    if (params.detectIndent && !foundNonEmptyLine) {
  ------------------
  |  Branch (129:9): [True: 8.32M, False: 6.75M]
  |  Branch (129:32): [True: 7.49M, False: 829k]
  ------------------
  130|  7.49M|      params.indent = std::max(params.indent, INPUT.column());
  131|  7.49M|    }
  132|       |
  133|       |    // and then the rest of the whitespace
  134|  15.0M|    while (Exp::Blank().Matches(INPUT)) {
  ------------------
  |  Branch (134:12): [True: 16.5k, False: 15.0M]
  ------------------
  135|       |      // we check for tabs that masquerade as indentation
  136|  16.5k|      if (INPUT.peek() == '\t' && INPUT.column() < params.indent &&
  ------------------
  |  Branch (136:11): [True: 6.56k, False: 9.95k]
  |  Branch (136:35): [True: 2, False: 6.56k]
  ------------------
  137|      2|          params.onTabInIndentation == THROW) {
  ------------------
  |  Branch (137:11): [True: 2, False: 0]
  ------------------
  138|      2|        throw ParserException(INPUT.mark(), ErrorMsg::TAB_IN_INDENTATION);
  139|      2|      }
  140|       |
  141|  16.5k|      if (!params.eatLeadingWhitespace) {
  ------------------
  |  Branch (141:11): [True: 2.38k, False: 14.1k]
  ------------------
  142|  2.38k|        break;
  143|  2.38k|      }
  144|       |
  145|  14.1k|      if (params.end->Matches(INPUT)) {
  ------------------
  |  Branch (145:11): [True: 252, False: 13.8k]
  ------------------
  146|    252|        break;
  147|    252|      }
  148|       |
  149|  13.8k|      INPUT.eat(1);
  150|  13.8k|    }
  151|       |
  152|       |    // was this an empty line?
  153|  15.0M|    bool nextEmptyLine = Exp::Break().Matches(INPUT);
  154|  15.0M|    bool nextMoreIndented = Exp::Blank().Matches(INPUT);
  155|  15.0M|    if (params.fold == FOLD_BLOCK && foldedNewlineCount == 0 && nextEmptyLine)
  ------------------
  |  Branch (155:9): [True: 8.31M, False: 6.75M]
  |  Branch (155:38): [True: 74.8k, False: 8.24M]
  |  Branch (155:65): [True: 4.15k, False: 70.6k]
  ------------------
  156|  4.15k|      foldedNewlineStartedMoreIndented = moreIndented;
  157|       |
  158|       |    // for block scalars, we always start with a newline, so we should ignore it
  159|       |    // (not fold or keep)
  160|  15.0M|    if (pastOpeningBreak) {
  ------------------
  |  Branch (160:9): [True: 15.0M, False: 3.76k]
  ------------------
  161|  15.0M|      switch (params.fold) {
  ------------------
  |  Branch (161:15): [True: 15.0M, False: 0]
  ------------------
  162|  4.49k|        case DONT_FOLD:
  ------------------
  |  Branch (162:9): [True: 4.49k, False: 15.0M]
  ------------------
  163|  4.49k|          scalar += "\n";
  164|  4.49k|          break;
  165|  8.31M|        case FOLD_BLOCK:
  ------------------
  |  Branch (165:9): [True: 8.31M, False: 6.75M]
  ------------------
  166|  8.31M|          if (!emptyLine && !nextEmptyLine && !moreIndented &&
  ------------------
  |  Branch (166:15): [True: 71.9k, False: 8.24M]
  |  Branch (166:29): [True: 68.7k, False: 3.18k]
  |  Branch (166:47): [True: 67.1k, False: 1.64k]
  ------------------
  167|  67.1k|              !nextMoreIndented && INPUT.column() >= params.indent) {
  ------------------
  |  Branch (167:15): [True: 66.4k, False: 618]
  |  Branch (167:36): [True: 65.9k, False: 513]
  ------------------
  168|  65.9k|            scalar += " ";
  169|  8.25M|          } else if (nextEmptyLine) {
  ------------------
  |  Branch (169:22): [True: 8.24M, False: 6.51k]
  ------------------
  170|  8.24M|            foldedNewlineCount++;
  171|  8.24M|          } else {
  172|  6.51k|            scalar += "\n";
  173|  6.51k|          }
  174|       |
  175|  8.31M|          if (!nextEmptyLine && foldedNewlineCount > 0) {
  ------------------
  |  Branch (175:15): [True: 72.4k, False: 8.24M]
  |  Branch (175:33): [True: 3.59k, False: 68.8k]
  ------------------
  176|  3.59k|            scalar += std::string(foldedNewlineCount - 1, '\n');
  177|  3.59k|            if (foldedNewlineStartedMoreIndented ||
  ------------------
  |  Branch (177:17): [True: 690, False: 2.90k]
  ------------------
  178|  2.90k|                nextMoreIndented | !foundNonEmptyLine) {
  ------------------
  |  Branch (178:17): [True: 514, False: 2.39k]
  ------------------
  179|  1.20k|              scalar += "\n";
  180|  1.20k|            }
  181|  3.59k|            foldedNewlineCount = 0;
  182|  3.59k|          }
  183|  8.31M|          break;
  184|  6.75M|        case FOLD_FLOW:
  ------------------
  |  Branch (184:9): [True: 6.75M, False: 8.32M]
  ------------------
  185|  6.75M|          if (nextEmptyLine) {
  ------------------
  |  Branch (185:15): [True: 4.93M, False: 1.81M]
  ------------------
  186|  4.93M|            scalar += "\n";
  187|  4.93M|          } else if (!emptyLine && !escapedNewline) {
  ------------------
  |  Branch (187:22): [True: 1.80M, False: 12.1k]
  |  Branch (187:36): [True: 1.80M, False: 631]
  ------------------
  188|  1.80M|            scalar += " ";
  189|  1.80M|          }
  190|  6.75M|          break;
  191|  15.0M|      }
  192|  15.0M|    }
  193|       |
  194|  15.0M|    emptyLine = nextEmptyLine;
  195|  15.0M|    moreIndented = nextMoreIndented;
  196|  15.0M|    pastOpeningBreak = true;
  197|       |
  198|       |    // are we done via indentation?
  199|  15.0M|    if (!emptyLine && INPUT.column() < params.indent) {
  ------------------
  |  Branch (199:9): [True: 1.89M, False: 13.1M]
  |  Branch (199:23): [True: 1.09M, False: 800k]
  ------------------
  200|  1.09M|      params.leadingSpaces = true;
  201|  1.09M|      break;
  202|  1.09M|    }
  203|  15.0M|  }
  204|       |
  205|       |  // post-processing
  206|  3.19M|  if (params.trimTrailingSpaces) {
  ------------------
  |  Branch (206:7): [True: 3.18M, False: 10.0k]
  ------------------
  207|  3.18M|    std::size_t pos = scalar.find_last_not_of(" \t");
  208|  3.18M|    if (lastEscapedChar != std::string::npos) {
  ------------------
  |  Branch (208:9): [True: 7.95k, False: 3.17M]
  ------------------
  209|  7.95k|      if (pos < lastEscapedChar || pos == std::string::npos) {
  ------------------
  |  Branch (209:11): [True: 4.65k, False: 3.30k]
  |  Branch (209:36): [True: 374, False: 2.93k]
  ------------------
  210|  5.02k|        pos = lastEscapedChar;
  211|  5.02k|      }
  212|  7.95k|    }
  213|  3.18M|    if (pos < scalar.size()) {
  ------------------
  |  Branch (213:9): [True: 3.18M, False: 4.73k]
  ------------------
  214|  3.18M|      scalar.erase(pos + 1);
  215|  3.18M|    }
  216|  3.18M|  }
  217|       |
  218|  3.19M|  switch (params.chomp) {
  219|  9.10k|    case CLIP: {
  ------------------
  |  Branch (219:5): [True: 9.10k, False: 3.18M]
  ------------------
  220|  9.10k|      std::size_t pos = scalar.find_last_not_of('\n');
  221|  9.10k|      if (lastEscapedChar != std::string::npos) {
  ------------------
  |  Branch (221:11): [True: 2.21k, False: 6.89k]
  ------------------
  222|  2.21k|        if (pos < lastEscapedChar || pos == std::string::npos) {
  ------------------
  |  Branch (222:13): [True: 1.43k, False: 778]
  |  Branch (222:38): [True: 209, False: 569]
  ------------------
  223|  1.64k|          pos = lastEscapedChar;
  224|  1.64k|        }
  225|  2.21k|      }
  226|  9.10k|      if (pos == std::string::npos) {
  ------------------
  |  Branch (226:11): [True: 4.42k, False: 4.68k]
  ------------------
  227|  4.42k|        scalar.erase();
  228|  4.68k|      } else if (pos + 1 < scalar.size()) {
  ------------------
  |  Branch (228:18): [True: 757, False: 3.92k]
  ------------------
  229|    757|        scalar.erase(pos + 2);
  230|    757|      }
  231|  9.10k|    } break;
  232|  3.18M|    case STRIP: {
  ------------------
  |  Branch (232:5): [True: 3.18M, False: 9.76k]
  ------------------
  233|  3.18M|      std::size_t pos = scalar.find_last_not_of('\n');
  234|  3.18M|      if (lastEscapedChar != std::string::npos) {
  ------------------
  |  Branch (234:11): [True: 7.95k, False: 3.17M]
  ------------------
  235|  7.95k|        if (pos < lastEscapedChar || pos == std::string::npos) {
  ------------------
  |  Branch (235:13): [True: 4.42k, False: 3.52k]
  |  Branch (235:38): [True: 341, False: 3.18k]
  ------------------
  236|  4.77k|          pos = lastEscapedChar;
  237|  4.77k|        }
  238|  7.95k|      }
  239|  3.18M|      if (pos == std::string::npos) {
  ------------------
  |  Branch (239:11): [True: 302, False: 3.18M]
  ------------------
  240|    302|        scalar.erase();
  241|  3.18M|      } else if (pos < scalar.size()) {
  ------------------
  |  Branch (241:18): [True: 3.18M, False: 4.73k]
  ------------------
  242|  3.18M|        scalar.erase(pos + 1);
  243|  3.18M|      }
  244|  3.18M|    } break;
  245|    283|    default:
  ------------------
  |  Branch (245:5): [True: 283, False: 3.19M]
  ------------------
  246|    283|      break;
  247|  3.19M|  }
  248|       |
  249|  3.19M|  return scalar;
  250|  3.19M|}

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

_ZN4YAML15ScanVerbatimTagERNS_6StreamE:
    9|    736|const std::string ScanVerbatimTag(Stream& INPUT) {
   10|    736|  std::string tag;
   11|       |
   12|       |  // eat the start character
   13|    736|  INPUT.get();
   14|       |
   15|  10.2k|  while (INPUT) {
  ------------------
  |  Branch (15:10): [True: 10.2k, False: 18]
  ------------------
   16|  10.2k|    if (INPUT.peek() == Keys::VerbatimTagEnd) {
  ------------------
  |  Branch (16:9): [True: 709, False: 9.54k]
  ------------------
   17|       |      // eat the end character
   18|    709|      INPUT.get();
   19|    709|      return tag;
   20|    709|    }
   21|       |
   22|  9.54k|    int n = Exp::URI().Match(INPUT);
   23|  9.54k|    if (n <= 0)
  ------------------
  |  Branch (23:9): [True: 9, False: 9.53k]
  ------------------
   24|      9|      break;
   25|       |
   26|  9.53k|    tag += INPUT.get(n);
   27|  9.53k|  }
   28|       |
   29|     27|  throw ParserException(INPUT.mark(), ErrorMsg::END_OF_VERBATIM_TAG);
   30|    736|}
_ZN4YAML13ScanTagHandleERNS_6StreamERb:
   32|  1.19M|const std::string ScanTagHandle(Stream& INPUT, bool& canBeHandle) {
   33|  1.19M|  std::string tag;
   34|  1.19M|  canBeHandle = true;
   35|  1.19M|  Mark firstNonWordChar;
   36|       |
   37|  10.5M|  while (INPUT) {
  ------------------
  |  Branch (37:10): [True: 10.5M, False: 341]
  ------------------
   38|  10.5M|    if (INPUT.peek() == Keys::Tag) {
  ------------------
  |  Branch (38:9): [True: 2.79k, False: 10.5M]
  ------------------
   39|  2.79k|      if (!canBeHandle)
  ------------------
  |  Branch (39:11): [True: 5, False: 2.79k]
  ------------------
   40|      5|        throw ParserException(firstNonWordChar, ErrorMsg::CHAR_IN_TAG_HANDLE);
   41|  2.79k|      break;
   42|  2.79k|    }
   43|       |
   44|  10.5M|    int n = 0;
   45|  10.5M|    if (canBeHandle) {
  ------------------
  |  Branch (45:9): [True: 8.83M, False: 1.72M]
  ------------------
   46|  8.83M|      n = Exp::Word().Match(INPUT);
   47|  8.83M|      if (n <= 0) {
  ------------------
  |  Branch (47:11): [True: 1.19M, False: 7.64M]
  ------------------
   48|  1.19M|        canBeHandle = false;
   49|  1.19M|        firstNonWordChar = INPUT.mark();
   50|  1.19M|      }
   51|  8.83M|    }
   52|       |
   53|  10.5M|    if (!canBeHandle)
  ------------------
  |  Branch (53:9): [True: 2.91M, False: 7.64M]
  ------------------
   54|  2.91M|      n = Exp::Tag().Match(INPUT);
   55|       |
   56|  10.5M|    if (n <= 0)
  ------------------
  |  Branch (56:9): [True: 1.19M, False: 9.36M]
  ------------------
   57|  1.19M|      break;
   58|       |
   59|  9.36M|    tag += INPUT.get(n);
   60|  9.36M|  }
   61|       |
   62|  1.19M|  return tag;
   63|  1.19M|}
_ZN4YAML13ScanTagSuffixERNS_6StreamE:
   65|  2.79k|const std::string ScanTagSuffix(Stream& INPUT) {
   66|  2.79k|  std::string tag;
   67|       |
   68|   177k|  while (INPUT) {
  ------------------
  |  Branch (68:10): [True: 177k, False: 99]
  ------------------
   69|   177k|    int n = Exp::Tag().Match(INPUT);
   70|   177k|    if (n <= 0)
  ------------------
  |  Branch (70:9): [True: 2.69k, False: 175k]
  ------------------
   71|  2.69k|      break;
   72|       |
   73|   175k|    tag += INPUT.get(n);
   74|   175k|  }
   75|       |
   76|  2.79k|  if (tag.empty())
  ------------------
  |  Branch (76:7): [True: 11, False: 2.78k]
  ------------------
   77|     11|    throw ParserException(INPUT.mark(), ErrorMsg::TAG_WITH_NO_SUFFIX);
   78|       |
   79|  2.78k|  return tag;
   80|  2.79k|}

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

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

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

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

_ZNK4YAML6StreamntEv:
   34|   144M|  bool operator!() const { return !static_cast<bool>(*this); }
_ZN4YAML6Stream3eofEv:
   41|  76.0M|  static char eof() { return 0x04; }
_ZNK4YAML6Stream4markEv:
   43|   153M|  const Mark mark() const { return m_mark; }
_ZNK4YAML6Stream3posEv:
   44|  2.04M|  int pos() const { return m_mark.pos; }
_ZNK4YAML6Stream4lineEv:
   45|  2.12M|  int line() const { return m_mark.line; }
_ZNK4YAML6Stream6columnEv:
   46|   286M|  int column() const { return m_mark.column; }
_ZN4YAML6Stream11ResetColumnEv:
   47|  5.08k|  void ResetColumn() { m_mark.column = 0; }
_ZNK4YAML6Stream6CharAtEm:
   74|  1.92G|inline char Stream::CharAt(size_t i) const { return m_readahead[i]; }
_ZNK4YAML6Stream11ReadAheadToEm:
   76|  1.34G|inline bool Stream::ReadAheadTo(size_t i) const {
   77|  1.34G|  if (m_readahead.size() > i)
  ------------------
  |  Branch (77:7): [True: 1.20G, False: 141M]
  ------------------
   78|  1.20G|    return true;
   79|   141M|  return _ReadAheadTo(i);
   80|  1.34G|}

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

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

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

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

