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

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

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

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

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

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

_ZN4YAML6detail4nodeC2Ev:
   27|  3.30M|  node() : m_pRef(std::make_shared<node_ref>()), m_dependencies{}, m_index{} {}
_ZNK4YAML6detail4node10is_definedEv:
   34|  10.7M|  bool is_defined() const { return m_pRef->is_defined(); }
_ZNK4YAML6detail4node4typeEv:
   36|  6.77M|  NodeType::value type() const { return m_pRef->type(); }
_ZNK4YAML6detail4node6scalarEv:
   38|  3.25M|  const std::string& scalar() const { return m_pRef->scalar(); }
_ZN4YAML6detail4node12mark_definedEv:
   46|  6.77M|  void mark_defined() {
   47|  6.77M|    if (is_defined())
  ------------------
  |  Branch (47:9): [True: 3.47M, False: 3.30M]
  ------------------
   48|  3.47M|      return;
   49|       |
   50|  3.30M|    m_pRef->mark_defined();
   51|  3.30M|    for (node* dependency : m_dependencies)
  ------------------
  |  Branch (51:27): [True: 0, False: 3.30M]
  ------------------
   52|      0|      dependency->mark_defined();
   53|  3.30M|    m_dependencies.clear();
   54|  3.30M|  }
_ZN4YAML6detail4node14add_dependencyERS1_:
   56|  2.69M|  void add_dependency(node& rhs) {
   57|  2.69M|    if (is_defined())
  ------------------
  |  Branch (57:9): [True: 2.69M, False: 0]
  ------------------
   58|  2.69M|      rhs.mark_defined();
   59|      0|    else
   60|      0|      m_dependencies.insert(&rhs);
   61|  2.69M|  }
_ZN4YAML6detail4node8set_markERKNS_4MarkE:
   74|  3.30M|  void set_mark(const Mark& mark) { m_pRef->set_mark(mark); }
_ZN4YAML6detail4node8set_typeENS_8NodeType5valueE:
   76|   173k|  void set_type(NodeType::value type) {
   77|   173k|    if (type != NodeType::Undefined)
  ------------------
  |  Branch (77:9): [True: 173k, False: 0]
  ------------------
   78|   173k|      mark_defined();
   79|   173k|    m_pRef->set_type(type);
   80|   173k|  }
_ZN4YAML6detail4node8set_nullEv:
   81|  2.70M|  void set_null() {
   82|  2.70M|    mark_defined();
   83|  2.70M|    m_pRef->set_null();
   84|  2.70M|  }
_ZN4YAML6detail4node10set_scalarERKNSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEE:
   85|   426k|  void set_scalar(const std::string& scalar) {
   86|   426k|    mark_defined();
   87|   426k|    m_pRef->set_scalar(scalar);
   88|   426k|  }
_ZN4YAML6detail4node7set_tagERKNSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEE:
   89|   600k|  void set_tag(const std::string& tag) {
   90|   600k|    mark_defined();
   91|   600k|    m_pRef->set_tag(tag);
   92|   600k|  }
_ZN4YAML6detail4node9set_styleENS_12EmitterStyle5valueE:
   95|   173k|  void set_style(EmitterStyle::value style) {
   96|   173k|    mark_defined();
   97|   173k|    m_pRef->set_style(style);
   98|   173k|  }
_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|   625k|  void insert(node& key, node& value, shared_memory_holder pMemory) {
  120|   625k|    m_pRef->insert(key, value, pMemory);
  121|   625k|    key.add_dependency(*this);
  122|   625k|    value.add_dependency(*this);
  123|   625k|  }

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

_ZN4YAML6detail8node_refC2Ev:
   19|  3.30M|  node_ref() : m_pData(std::make_shared<node_data>()) {}
_ZNK4YAML6detail8node_ref10is_definedEv:
   23|  10.7M|  bool is_defined() const { return m_pData->is_defined(); }
_ZNK4YAML6detail8node_ref4typeEv:
   25|  6.77M|  NodeType::value type() const { return m_pData->type(); }
_ZNK4YAML6detail8node_ref6scalarEv:
   26|  3.25M|  const std::string& scalar() const { return m_pData->scalar(); }
_ZN4YAML6detail8node_ref12mark_definedEv:
   30|  3.30M|  void mark_defined() { m_pData->mark_defined(); }
_ZN4YAML6detail8node_ref8set_markERKNS_4MarkE:
   33|  3.30M|  void set_mark(const Mark& mark) { m_pData->set_mark(mark); }
_ZN4YAML6detail8node_ref8set_typeENS_8NodeType5valueE:
   34|   173k|  void set_type(NodeType::value type) { m_pData->set_type(type); }
_ZN4YAML6detail8node_ref7set_tagERKNSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEE:
   35|   600k|  void set_tag(const std::string& tag) { m_pData->set_tag(tag); }
_ZN4YAML6detail8node_ref8set_nullEv:
   36|  2.70M|  void set_null() { m_pData->set_null(); }
_ZN4YAML6detail8node_ref10set_scalarERKNSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEE:
   37|   426k|  void set_scalar(const std::string& scalar) { m_pData->set_scalar(scalar); }
_ZN4YAML6detail8node_ref9set_styleENS_12EmitterStyle5valueE:
   38|   173k|  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|   625k|  void insert(node& key, node& value, shared_memory_holder pMemory) {
   58|   625k|    m_pData->insert(key, value, pMemory);
   59|   625k|  }

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

_ZN4YAML9ExceptionD2Ev:
   15|  3.73k|    #define YAML_CPP_NOEXCEPT noexcept

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

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

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

_ZN4YAML3Exp8ParseHexERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERKNS_4MarkE:
   13|  1.74k|unsigned ParseHex(const std::string& str, const Mark& mark) {
   14|  1.74k|  unsigned value = 0;
   15|  7.73k|  for (char ch : str) {
  ------------------
  |  Branch (15:16): [True: 7.73k, False: 1.66k]
  ------------------
   16|  7.73k|    int digit = 0;
   17|  7.73k|    if ('a' <= ch && ch <= 'f')
  ------------------
  |  Branch (17:9): [True: 2.00k, False: 5.73k]
  |  Branch (17:22): [True: 2.00k, False: 4]
  ------------------
   18|  2.00k|      digit = ch - 'a' + 10;
   19|  5.73k|    else if ('A' <= ch && ch <= 'F')
  ------------------
  |  Branch (19:14): [True: 1.50k, False: 4.23k]
  |  Branch (19:27): [True: 1.49k, False: 11]
  ------------------
   20|  1.49k|      digit = ch - 'A' + 10;
   21|  4.24k|    else if ('0' <= ch && ch <= '9')
  ------------------
  |  Branch (21:14): [True: 4.17k, False: 64]
  |  Branch (21:27): [True: 4.16k, False: 15]
  ------------------
   22|  4.16k|      digit = ch - '0';
   23|     79|    else
   24|     79|      throw ParserException(mark, ErrorMsg::INVALID_HEX);
   25|       |
   26|  7.65k|    value = (value << 4) + digit;
   27|  7.65k|  }
   28|       |
   29|  1.66k|  return value;
   30|  1.74k|}
_ZN4YAML3Exp3StrEj:
   32|  4.34k|std::string Str(unsigned ch) { return std::string(1, static_cast<char>(ch)); }
_ZN4YAML3Exp6EscapeERNS_6StreamEi:
   38|  1.74k|std::string Escape(Stream& in, int codeLength) {
   39|       |  // grab string
   40|  1.74k|  std::string str;
   41|  9.78k|  for (int i = 0; i < codeLength; i++)
  ------------------
  |  Branch (41:19): [True: 8.03k, False: 1.74k]
  ------------------
   42|  8.03k|    str += in.get();
   43|       |
   44|       |  // get the value
   45|  1.74k|  unsigned value = ParseHex(str, in.mark());
   46|       |
   47|       |  // legal unicode?
   48|  1.74k|  if ((value >= 0xD800 && value <= 0xDFFF) || value > 0x10FFFF) {
  ------------------
  |  Branch (48:8): [True: 761, False: 984]
  |  Branch (48:27): [True: 12, False: 749]
  |  Branch (48:47): [True: 36, False: 1.61k]
  ------------------
   49|     48|    std::stringstream msg;
   50|     48|    msg << ErrorMsg::INVALID_UNICODE << value;
   51|     48|    throw ParserException(in.mark(), msg.str());
   52|     48|  }
   53|       |
   54|       |  // now break it up into chars
   55|  1.69k|  if (value <= 0x7F)
  ------------------
  |  Branch (55:7): [True: 238, False: 1.45k]
  ------------------
   56|    238|    return Str(value);
   57|       |
   58|  1.45k|  if (value <= 0x7FF)
  ------------------
  |  Branch (58:7): [True: 341, False: 1.11k]
  ------------------
   59|    341|    return Str(0xC0 + (value >> 6)) + Str(0x80 + (value & 0x3F));
   60|       |
   61|  1.11k|  if (value <= 0xFFFF)
  ------------------
  |  Branch (61:7): [True: 730, False: 388]
  ------------------
   62|    730|    return Str(0xE0 + (value >> 12)) + Str(0x80 + ((value >> 6) & 0x3F)) +
   63|    730|           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.11k|}
_ZN4YAML3Exp6EscapeERNS_6StreamE:
   74|  39.6k|std::string Escape(Stream& in) {
   75|       |  // eat slash
   76|  39.6k|  char escape = in.get();
   77|       |
   78|       |  // switch on escape character
   79|  39.6k|  char ch = in.get();
   80|       |
   81|       |  // first do single quote, since it's easier
   82|  39.6k|  if (escape == '\'' && ch == '\'')
  ------------------
  |  Branch (82:7): [True: 566, False: 39.1k]
  |  Branch (82:25): [True: 566, False: 0]
  ------------------
   83|    566|    return "\'";
   84|       |
   85|       |  // now do the slash (we're not gonna check if it's a slash - you better pass
   86|       |  // one!)
   87|  39.1k|  switch (ch) {
  ------------------
  |  Branch (87:11): [True: 38.8k, False: 246]
  ------------------
   88|    974|    case '0':
  ------------------
  |  Branch (88:5): [True: 974, False: 38.1k]
  ------------------
   89|    974|      return std::string(1, '\x00');
   90|    202|    case 'a':
  ------------------
  |  Branch (90:5): [True: 202, False: 38.9k]
  ------------------
   91|    202|      return "\x07";
   92|    667|    case 'b':
  ------------------
  |  Branch (92:5): [True: 667, False: 38.4k]
  ------------------
   93|    667|      return "\x08";
   94|    658|    case 't':
  ------------------
  |  Branch (94:5): [True: 658, False: 38.4k]
  ------------------
   95|  5.06k|    case '\t':
  ------------------
  |  Branch (95:5): [True: 4.40k, False: 34.7k]
  ------------------
   96|  5.06k|      return "\x09";
   97|  8.68k|    case 'n':
  ------------------
  |  Branch (97:5): [True: 8.68k, False: 30.4k]
  ------------------
   98|  8.68k|      return "\x0A";
   99|    378|    case 'v':
  ------------------
  |  Branch (99:5): [True: 378, False: 38.7k]
  ------------------
  100|    378|      return "\x0B";
  101|    232|    case 'f':
  ------------------
  |  Branch (101:5): [True: 232, False: 38.8k]
  ------------------
  102|    232|      return "\x0C";
  103|    197|    case 'r':
  ------------------
  |  Branch (103:5): [True: 197, False: 38.9k]
  ------------------
  104|    197|      return "\x0D";
  105|    499|    case 'e':
  ------------------
  |  Branch (105:5): [True: 499, False: 38.6k]
  ------------------
  106|    499|      return "\x1B";
  107|    807|    case ' ':
  ------------------
  |  Branch (107:5): [True: 807, False: 38.3k]
  ------------------
  108|    807|      return R"( )";
  109|  4.76k|    case '\"':
  ------------------
  |  Branch (109:5): [True: 4.76k, False: 34.3k]
  ------------------
  110|  4.76k|      return "\"";
  111|    336|    case '\'':
  ------------------
  |  Branch (111:5): [True: 336, False: 38.7k]
  ------------------
  112|    336|      return "\'";
  113|    771|    case '\\':
  ------------------
  |  Branch (113:5): [True: 771, False: 38.3k]
  ------------------
  114|    771|      return "\\";
  115|    343|    case '/':
  ------------------
  |  Branch (115:5): [True: 343, False: 38.7k]
  ------------------
  116|    343|      return "/";
  117|    659|    case 'N':
  ------------------
  |  Branch (117:5): [True: 659, False: 38.4k]
  ------------------
  118|    659|      return "\xC2\x85";      // NEL (U+0085)
  119|    445|    case '_':
  ------------------
  |  Branch (119:5): [True: 445, False: 38.6k]
  ------------------
  120|    445|      return "\xC2\xA0";      // NBSP (U+00A0)
  121|  8.98k|    case 'L':
  ------------------
  |  Branch (121:5): [True: 8.98k, False: 30.1k]
  ------------------
  122|  8.98k|      return "\xE2\x80\xA8";  // LS (U+2028)
  123|  3.11k|    case 'P':
  ------------------
  |  Branch (123:5): [True: 3.11k, False: 36.0k]
  ------------------
  124|  3.11k|      return "\xE2\x80\xA9";  // PS (U+2029)
  125|    546|    case 'x':
  ------------------
  |  Branch (125:5): [True: 546, False: 38.5k]
  ------------------
  126|    546|      return Escape(in, 2);
  127|    662|    case 'u':
  ------------------
  |  Branch (127:5): [True: 662, False: 38.4k]
  ------------------
  128|    662|      return Escape(in, 4);
  129|    537|    case 'U':
  ------------------
  |  Branch (129:5): [True: 537, False: 38.5k]
  ------------------
  130|    537|      return Escape(in, 8);
  131|  39.1k|  }
  132|       |
  133|    246|  std::stringstream msg;
  134|    246|  throw ParserException(in.mark(), std::string(ErrorMsg::INVALID_ESCAPE) + ch);
  135|  39.1k|}

_ZN4YAML3Exp8DocStartEv:
   84|  2.81M|inline const RegEx& DocStart() {
   85|  2.81M|  static const RegEx e = RegEx("---") + (BlankOrBreak() | RegEx());
   86|  2.81M|  return e;
   87|  2.81M|}
_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|  43.3M|inline const RegEx& Blank() {
   36|  43.3M|  static const RegEx e = Space() | Tab();
   37|  43.3M|  return e;
   38|  43.3M|}
_ZN4YAML3Exp5SpaceEv:
   27|      1|inline const RegEx& Space() {
   28|      1|  static const RegEx e = RegEx(' ');
   29|      1|  return e;
   30|      1|}
_ZN4YAML3Exp6DocEndEv:
   88|  2.38M|inline const RegEx& DocEnd() {
   89|  2.38M|  static const RegEx e = RegEx("...") + (BlankOrBreak() | RegEx());
   90|  2.38M|  return e;
   91|  2.38M|}
_ZN4YAML3Exp10BlockEntryEv:
   96|  13.7M|inline const RegEx& BlockEntry() {
   97|  13.7M|  static const RegEx e = RegEx('-') + (BlankOrBreak() | RegEx());
   98|  13.7M|  return e;
   99|  13.7M|}
_ZN4YAML3Exp3KeyEv:
  100|  9.29M|inline const RegEx& Key() {
  101|  9.29M|  static const RegEx e = RegEx('?') + BlankOrBreak();
  102|  9.29M|  return e;
  103|  9.29M|}
_ZN4YAML3Exp9KeyInFlowEv:
  104|  1.81M|inline const RegEx& KeyInFlow() {
  105|  1.81M|  static const RegEx e = RegEx('?') + BlankOrBreak();
  106|  1.81M|  return e;
  107|  1.81M|}
_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.35M|inline const RegEx& PlainScalarInFlow() {
  160|  1.35M|  static const RegEx e =
  161|  1.35M|      !(BlankOrBreak() | RegEx("?,[]{}#&*!|>\'\"%@`", REGEX_OR) |
  162|  1.35M|        (RegEx("-:", REGEX_OR) + (Blank() | RegEx())));
  163|  1.35M|  return e;
  164|  1.35M|}
_ZN4YAML3Exp3TabEv:
   31|   179k|inline const RegEx& Tab() {
   32|   179k|  static const RegEx e = RegEx('\t');
   33|   179k|  return e;
   34|   179k|}
_ZN4YAML3Exp7CommentEv:
  124|  66.3M|inline const RegEx Comment() {
  125|  66.3M|  static const RegEx e = RegEx('#');
  126|  66.3M|  return e;
  127|  66.3M|}
_ZN4YAML3Exp5BreakEv:
   39|   211M|inline const RegEx& Break() {
   40|   211M|  static const RegEx e = RegEx('\n') | RegEx("\r\n") | RegEx('\r');
   41|   211M|  return e;
   42|   211M|}
_ZN4YAML3Exp5ValueEv:
  108|  9.28M|inline const RegEx& Value() {
  109|  9.28M|  static const RegEx e = RegEx(':') + (BlankOrBreak() | RegEx());
  110|  9.28M|  return e;
  111|  9.28M|}
_ZN4YAML3Exp15ValueInJSONFlowEv:
  116|  7.75k|inline const RegEx& ValueInJSONFlow() {
  117|  7.75k|  static const RegEx e = RegEx(':');
  118|  7.75k|  return e;
  119|  7.75k|}
_ZN4YAML3Exp11ValueInFlowEv:
  112|  1.78M|inline const RegEx& ValueInFlow() {
  113|  1.78M|  static const RegEx e = RegEx(':') + (BlankOrBreak() | RegEx(",]}", REGEX_OR));
  114|  1.78M|  return e;
  115|  1.78M|}
_ZN4YAML3Exp5EmptyEv:
   23|  3.45k|inline const RegEx& Empty() {
   24|  3.45k|  static const RegEx e;
   25|  3.45k|  return e;
   26|  3.45k|}
_ZN4YAML3Exp5DigitEv:
   47|    508|inline const RegEx& Digit() {
   48|    508|  static const RegEx e = RegEx('0', '9');
   49|    508|  return e;
   50|    508|}
_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.20M|inline const RegEx& Word() {
   60|  8.20M|  static const RegEx e = AlphaNumeric() | RegEx('-');
   61|  8.20M|  return e;
   62|  8.20M|}
_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|  6.02M|inline const RegEx& DocIndicator() {
   93|  6.02M|  static const RegEx e = DocStart() | DocEnd();
   94|  6.02M|  return e;
   95|  6.02M|}
_ZN4YAML3Exp6AnchorEv:
  128|  34.7M|inline const RegEx& Anchor() {
  129|  34.7M|  static const RegEx e = !(RegEx("[]{},", REGEX_OR) | BlankOrBreak());
  130|  34.7M|  return e;
  131|  34.7M|}
_ZN4YAML3Exp9AnchorEndEv:
  132|   391k|inline const RegEx& AnchorEnd() {
  133|   391k|  static const RegEx e = RegEx("?:,]}%@`", REGEX_OR) | BlankOrBreak();
  134|   391k|  return e;
  135|   391k|}
_ZN4YAML3Exp3URIEv:
  136|  9.75k|inline const RegEx& URI() {
  137|  9.75k|  static const RegEx e = Word() | RegEx("#;/?:@&=+$,_.!~*'()[]", REGEX_OR) |
  138|  9.75k|                         (RegEx('%') + Hex() + Hex());
  139|  9.75k|  return e;
  140|  9.75k|}
_ZN4YAML3Exp3TagEv:
  141|  3.45M|inline const RegEx& Tag() {
  142|  3.45M|  static const RegEx e = Word() | RegEx("#;/?:@&=+$_.~*'()", REGEX_OR) |
  143|  3.45M|                         (RegEx('%') + Hex() + Hex());
  144|  3.45M|  return e;
  145|  3.45M|}
_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.35M|inline const RegEx& ScanScalarEndInFlow() {
  177|  1.35M|  static const RegEx e = (EndScalarInFlow() | (BlankOrBreak() + Comment()));
  178|  1.35M|  return e;
  179|  1.35M|}
_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|  1.96k|inline const RegEx& EscSingleQuote() {
  186|  1.96k|  static const RegEx e = RegEx("\'\'");
  187|  1.96k|  return e;
  188|  1.96k|}
_ZN4YAML3Exp8EscBreakEv:
  189|  11.6M|inline const RegEx& EscBreak() {
  190|  11.6M|  static const RegEx e = RegEx('\\') + Break();
  191|  11.6M|  return e;
  192|  11.6M|}
_ZN4YAML3Exp14ChompIndicatorEv:
  194|      3|inline const RegEx& ChompIndicator() {
  195|      3|  static const RegEx e = RegEx("+-", REGEX_OR);
  196|      3|  return e;
  197|      3|}
_ZN4YAML3Exp5ChompEv:
  198|  3.49k|inline const RegEx& Chomp() {
  199|  3.49k|  static const RegEx e = (ChompIndicator() + Digit()) |
  200|  3.49k|                         (Digit() + ChompIndicator()) | ChompIndicator() |
  201|  3.49k|                         Digit();
  202|  3.49k|  return e;
  203|  3.49k|}

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

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

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

_ZN4YAML12IsNullStringEPKcm:
   13|   434k|bool IsNullString(const char* str, std::size_t size) {
   14|   434k|  return size == 0 || same(str, size, "~") || same(str, size, "null") ||
  ------------------
  |  Branch (14:10): [True: 0, False: 434k]
  |  Branch (14:23): [True: 11.1k, False: 423k]
  |  Branch (14:47): [True: 539, False: 422k]
  ------------------
   15|   422k|         same(str, size, "Null") || same(str, size, "NULL");
  ------------------
  |  Branch (15:10): [True: 893, False: 422k]
  |  Branch (15:37): [True: 25, False: 422k]
  ------------------
   16|   434k|}
null.cpp:_ZN4YAMLL4sameILm2EEEbPKcmRAT__S1_:
    8|   434k|static bool same(const char* str, std::size_t size, const char (&literal)[N]) {
    9|   434k|  constexpr int literalSize = N - 1; // minus null terminator
   10|   434k|  return size == literalSize && std::strncmp(str, literal, literalSize) == 0;
  ------------------
  |  Branch (10:10): [True: 403k, False: 30.8k]
  |  Branch (10:33): [True: 11.1k, False: 392k]
  ------------------
   11|   434k|}
null.cpp:_ZN4YAMLL4sameILm5EEEbPKcmRAT__S1_:
    8|  1.26M|static bool same(const char* str, std::size_t size, const char (&literal)[N]) {
    9|  1.26M|  constexpr int literalSize = N - 1; // minus null terminator
   10|  1.26M|  return size == literalSize && std::strncmp(str, literal, literalSize) == 0;
  ------------------
  |  Branch (10:10): [True: 17.7k, False: 1.25M]
  |  Branch (10:33): [True: 1.45k, False: 16.2k]
  ------------------
   11|  1.26M|}

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

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

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

_ZN4YAML5RegExC2ENS_8REGEX_OPE:
    6|  3.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|  7.00k|RegEx::RegEx(char ch) : m_op(REGEX_MATCH), m_a(ch), m_z(0), m_params{} {}
_ZN4YAML5RegExC2Ecc:
   11|      5|RegEx::RegEx(char a, char z) : m_op(REGEX_RANGE), m_a(a), m_z(z), m_params{} {}
_ZN4YAML5RegExC2ERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEENS_8REGEX_OPE:
   14|     16|    : m_op(op), m_a(0), m_z(0), m_params(str.begin(), str.end()) {}
_ZN4YAMLntERKNS_5RegExE:
   17|  1.96k|RegEx operator!(const RegEx& ex) {
   18|  1.96k|  RegEx ret(REGEX_NOT);
   19|  1.96k|  ret.m_params.push_back(ex);
   20|  1.96k|  return ret;
   21|  1.96k|}
_ZN4YAMLorERKNS_5RegExES2_:
   23|     36|RegEx operator|(const RegEx& ex1, const RegEx& ex2) {
   24|     36|  RegEx ret(REGEX_OR);
   25|     36|  ret.m_params.push_back(ex1);
   26|     36|  ret.m_params.push_back(ex2);
   27|     36|  return ret;
   28|     36|}
_ZN4YAMLanERKNS_5RegExES2_:
   30|  1.96k|RegEx operator&(const RegEx& ex1, const RegEx& ex2) {
   31|  1.96k|  RegEx ret(REGEX_AND);
   32|  1.96k|  ret.m_params.push_back(ex1);
   33|  1.96k|  ret.m_params.push_back(ex2);
   34|  1.96k|  return ret;
   35|  1.96k|}
_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|  66.3M|  ~RegEx() = default;

_ZNK4YAML5RegEx7MatchesERKNS_6StreamE:
   26|   509M|inline bool RegEx::Matches(const Stream& in) const { return Match(in) >= 0; }
_ZNK4YAML5RegEx5MatchERKNS_6StreamE:
   49|   571M|inline int RegEx::Match(const Stream& in) const {
   50|   571M|  StreamCharSource source(in);
   51|   571M|  return Match(source);
   52|   571M|}
_ZNK4YAML5RegEx5MatchINS_16StreamCharSourceEEEiRKT_:
   72|  1.20G|inline int RegEx::Match(const Source& source) const {
   73|  1.20G|  return IsValidSource(source) ? MatchUnchecked(source) : -1;
  ------------------
  |  Branch (73:10): [True: 1.20G, False: 0]
  ------------------
   74|  1.20G|}
_ZNK4YAML5RegEx13IsValidSourceINS_16StreamCharSourceEEEbRKT_:
   55|  1.20G|inline bool RegEx::IsValidSource(const Source& source) const {
   56|  1.20G|  return source;
   57|  1.20G|}
_ZNK4YAML5RegEx14MatchUncheckedINS_16StreamCharSourceEEEiRKT_:
   77|  3.79G|inline int RegEx::MatchUnchecked(const Source& source) const {
   78|  3.79G|  switch (m_op) {
  ------------------
  |  Branch (78:11): [True: 3.79G, False: 0]
  ------------------
   79|  24.5M|    case REGEX_EMPTY:
  ------------------
  |  Branch (79:5): [True: 24.5M, False: 3.76G]
  ------------------
   80|  24.5M|      return MatchOpEmpty(source);
   81|  1.94G|    case REGEX_MATCH:
  ------------------
  |  Branch (81:5): [True: 1.94G, False: 1.84G]
  ------------------
   82|  1.94G|      return MatchOpMatch(source);
   83|  24.8M|    case REGEX_RANGE:
  ------------------
  |  Branch (83:5): [True: 24.8M, False: 3.76G]
  ------------------
   84|  24.8M|      return MatchOpRange(source);
   85|  1.21G|    case REGEX_OR:
  ------------------
  |  Branch (85:5): [True: 1.21G, False: 2.57G]
  ------------------
   86|  1.21G|      return MatchOpOr(source);
   87|  18.0M|    case REGEX_AND:
  ------------------
  |  Branch (87:5): [True: 18.0M, False: 3.77G]
  ------------------
   88|  18.0M|      return MatchOpAnd(source);
   89|  37.6M|    case REGEX_NOT:
  ------------------
  |  Branch (89:5): [True: 37.6M, False: 3.75G]
  ------------------
   90|  37.6M|      return MatchOpNot(source);
   91|   518M|    case REGEX_SEQ:
  ------------------
  |  Branch (91:5): [True: 518M, False: 3.27G]
  ------------------
   92|   518M|      return MatchOpSeq(source);
   93|  3.79G|  }
   94|       |
   95|      0|  return -1;
   96|  3.79G|}
_ZNK4YAML5RegEx12MatchOpEmptyINS_16StreamCharSourceEEEiRKT_:
  106|  24.5M|inline int RegEx::MatchOpEmpty(const Source& source) const {
  107|  24.5M|  return source[0] == Stream::eof() ? 0 : -1;
  ------------------
  |  Branch (107:10): [True: 2.30M, False: 22.2M]
  ------------------
  108|  24.5M|}
_ZNK4YAML5RegEx12MatchOpMatchINS_16StreamCharSourceEEEiRKT_:
  119|  1.94G|inline int RegEx::MatchOpMatch(const Source& source) const {
  120|  1.94G|  if (source[0] != m_a)
  ------------------
  |  Branch (120:7): [True: 1.74G, False: 202M]
  ------------------
  121|  1.74G|    return -1;
  122|   202M|  return 1;
  123|  1.94G|}
_ZNK4YAML5RegEx12MatchOpRangeINS_16StreamCharSourceEEEiRKT_:
  127|  24.8M|inline int RegEx::MatchOpRange(const Source& source) const {
  128|  24.8M|  if (m_a > source[0] || m_z < source[0])
  ------------------
  |  Branch (128:7): [True: 19.6M, False: 5.24M]
  |  Branch (128:26): [True: 55.6k, False: 5.19M]
  ------------------
  129|  19.6M|    return -1;
  130|  5.19M|  return 1;
  131|  24.8M|}
_ZNK4YAML5RegEx9MatchOpOrINS_16StreamCharSourceEEEiRKT_:
  135|  1.21G|inline int RegEx::MatchOpOr(const Source& source) const {
  136|  2.53G|  for (const RegEx& param : m_params) {
  ------------------
  |  Branch (136:27): [True: 2.53G, False: 1.00G]
  ------------------
  137|  2.53G|    int n = param.MatchUnchecked(source);
  138|  2.53G|    if (n >= 0)
  ------------------
  |  Branch (138:9): [True: 207M, False: 2.32G]
  ------------------
  139|   207M|      return n;
  140|  2.53G|  }
  141|  1.00G|  return -1;
  142|  1.21G|}
_ZNK4YAML5RegEx10MatchOpAndINS_16StreamCharSourceEEEiRKT_:
  149|  18.0M|inline int RegEx::MatchOpAnd(const Source& source) const {
  150|  18.0M|  int first = -1;
  151|  18.0M|  for (std::size_t i = 0; i < m_params.size(); i++) {
  ------------------
  |  Branch (151:27): [True: 18.0M, False: 3.66k]
  ------------------
  152|  18.0M|    int n = m_params[i].MatchUnchecked(source);
  153|  18.0M|    if (n == -1)
  ------------------
  |  Branch (153:9): [True: 18.0M, False: 7.89k]
  ------------------
  154|  18.0M|      return -1;
  155|  7.89k|    if (i == 0)
  ------------------
  |  Branch (155:9): [True: 4.23k, False: 3.66k]
  ------------------
  156|  4.23k|      first = n;
  157|  7.89k|  }
  158|  3.66k|  return first;
  159|  18.0M|}
_ZNK4YAML5RegEx10MatchOpNotINS_16StreamCharSourceEEEiRKT_:
  163|  37.6M|inline int RegEx::MatchOpNot(const Source& source) const {
  164|  37.6M|  if (m_params.empty())
  ------------------
  |  Branch (164:7): [True: 0, False: 37.6M]
  ------------------
  165|      0|    return -1;
  166|  37.6M|  if (m_params[0].MatchUnchecked(source) >= 0)
  ------------------
  |  Branch (166:7): [True: 391k, False: 37.2M]
  ------------------
  167|   391k|    return -1;
  168|  37.2M|  return 1;
  169|  37.6M|}
_ZNK4YAML5RegEx10MatchOpSeqINS_16StreamCharSourceEEEiRKT_:
  173|   518M|inline int RegEx::MatchOpSeq(const Source& source) const {
  174|   518M|  int offset = 0;
  175|   628M|  for (const RegEx& param : m_params) {
  ------------------
  |  Branch (175:27): [True: 628M, False: 11.0M]
  ------------------
  176|   628M|    int n = param.Match(source + offset);  // note Match, not
  177|       |                                           // MatchUnchecked because we
  178|       |                                           // need to check validity after
  179|       |                                           // the offset
  180|   628M|    if (n == -1)
  ------------------
  |  Branch (180:9): [True: 507M, False: 120M]
  ------------------
  181|   507M|      return -1;
  182|   120M|    offset += n;
  183|   120M|  }
  184|       |
  185|  11.0M|  return offset;
  186|   518M|}
_ZNK4YAML5RegEx7MatchesEc:
   16|    503|inline bool RegEx::Matches(char ch) const {
   17|    503|  std::string str;
   18|    503|  str += ch;
   19|    503|  return Matches(str);
   20|    503|}
_ZNK4YAML5RegEx7MatchesERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
   22|    503|inline bool RegEx::Matches(const std::string& str) const {
   23|    503|  return Match(str) >= 0;
   24|    503|}
_ZNK4YAML5RegEx5MatchERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
   44|    503|inline int RegEx::Match(const std::string& str) const {
   45|    503|  StringCharSource source(str.c_str(), str.size());
   46|    503|  return Match(source);
   47|    503|}
_ZNK4YAML5RegEx13IsValidSourceINS_16StringCharSourceEEEbRKT_:
   61|    503|    const StringCharSource& source) const {
   62|    503|  switch (m_op) {
   63|      0|    case REGEX_MATCH:
  ------------------
  |  Branch (63:5): [True: 0, False: 503]
  ------------------
   64|    503|    case REGEX_RANGE:
  ------------------
  |  Branch (64:5): [True: 503, False: 0]
  ------------------
   65|    503|      return source;
   66|      0|    default:
  ------------------
  |  Branch (66:5): [True: 0, False: 503]
  ------------------
   67|      0|      return true;
   68|    503|  }
   69|    503|}
_ZNK4YAML5RegEx5MatchINS_16StringCharSourceEEEiRKT_:
   72|    503|inline int RegEx::Match(const Source& source) const {
   73|    503|  return IsValidSource(source) ? MatchUnchecked(source) : -1;
  ------------------
  |  Branch (73:10): [True: 503, False: 0]
  ------------------
   74|    503|}
_ZNK4YAML5RegEx14MatchUncheckedINS_16StringCharSourceEEEiRKT_:
   77|    503|inline int RegEx::MatchUnchecked(const Source& source) const {
   78|    503|  switch (m_op) {
  ------------------
  |  Branch (78:11): [True: 503, False: 0]
  ------------------
   79|      0|    case REGEX_EMPTY:
  ------------------
  |  Branch (79:5): [True: 0, False: 503]
  ------------------
   80|      0|      return MatchOpEmpty(source);
   81|      0|    case REGEX_MATCH:
  ------------------
  |  Branch (81:5): [True: 0, False: 503]
  ------------------
   82|      0|      return MatchOpMatch(source);
   83|    503|    case REGEX_RANGE:
  ------------------
  |  Branch (83:5): [True: 503, False: 0]
  ------------------
   84|    503|      return MatchOpRange(source);
   85|      0|    case REGEX_OR:
  ------------------
  |  Branch (85:5): [True: 0, False: 503]
  ------------------
   86|      0|      return MatchOpOr(source);
   87|      0|    case REGEX_AND:
  ------------------
  |  Branch (87:5): [True: 0, False: 503]
  ------------------
   88|      0|      return MatchOpAnd(source);
   89|      0|    case REGEX_NOT:
  ------------------
  |  Branch (89:5): [True: 0, False: 503]
  ------------------
   90|      0|      return MatchOpNot(source);
   91|      0|    case REGEX_SEQ:
  ------------------
  |  Branch (91:5): [True: 0, False: 503]
  ------------------
   92|      0|      return MatchOpSeq(source);
   93|    503|  }
   94|       |
   95|      0|  return -1;
   96|    503|}
_ZNK4YAML5RegEx12MatchOpRangeINS_16StringCharSourceEEEiRKT_:
  127|    503|inline int RegEx::MatchOpRange(const Source& source) const {
  128|    503|  if (m_a > source[0] || m_z < source[0])
  ------------------
  |  Branch (128:7): [True: 0, False: 503]
  |  Branch (128:26): [True: 0, False: 503]
  ------------------
  129|      0|    return -1;
  130|    503|  return 1;
  131|    503|}

_ZN4YAML7ScannerC2ERNSt3__113basic_istreamIcNS1_11char_traitsIcEEEE:
   11|  6.57k|    : INPUT(in),
   12|  6.57k|      m_tokens{},
   13|  6.57k|      m_startedStream(false),
   14|  6.57k|      m_endedStream(false),
   15|  6.57k|      m_simpleKeyAllowed(false),
   16|  6.57k|      m_scalarValueAllowed(false),
   17|  6.57k|      m_canBeJSONFlow(false),
   18|  6.57k|      m_simpleKeys{},
   19|  6.57k|      m_indents{},
   20|  6.57k|      m_indentRefs{},
   21|  6.57k|      m_flows{} {}
_ZN4YAML7ScannerD2Ev:
   23|  6.57k|Scanner::~Scanner() = default;
_ZN4YAML7Scanner5emptyEv:
   25|  14.0M|bool Scanner::empty() {
   26|  14.0M|  EnsureTokensInQueue();
   27|  14.0M|  return m_tokens.empty();
   28|  14.0M|}
_ZN4YAML7Scanner3popEv:
   30|  3.69M|void Scanner::pop() {
   31|  3.69M|  EnsureTokensInQueue();
   32|  3.69M|  if (!m_tokens.empty())
  ------------------
  |  Branch (32:7): [True: 3.69M, False: 0]
  ------------------
   33|  3.69M|    m_tokens.pop();
   34|  3.69M|}
_ZN4YAML7Scanner4peekEv:
   36|  20.2M|Token& Scanner::peek() {
   37|  20.2M|  EnsureTokensInQueue();
   38|  20.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|  20.2M|  return m_tokens.front();
   50|  20.2M|}
_ZNK4YAML7Scanner4markEv:
   52|  2.12M|Mark Scanner::mark() const { return INPUT.mark(); }
_ZN4YAML7Scanner19EnsureTokensInQueueEv:
   54|  38.0M|void Scanner::EnsureTokensInQueue() {
   55|  95.2M|  while (true) {
  ------------------
  |  Branch (55:10): [True: 95.2M, Folded]
  ------------------
   56|  95.2M|    if (!m_tokens.empty()) {
  ------------------
  |  Branch (56:9): [True: 93.6M, False: 1.56M]
  ------------------
   57|  93.6M|      Token& token = m_tokens.front();
   58|       |
   59|       |      // if this guy's valid, then we're done
   60|  93.6M|      if (token.status == Token::VALID) {
  ------------------
  |  Branch (60:11): [True: 37.3M, False: 56.2M]
  ------------------
   61|  37.3M|        return;
   62|  37.3M|      }
   63|       |
   64|       |      // here's where we clean up the impossible tokens
   65|  56.2M|      if (token.status == Token::INVALID) {
  ------------------
  |  Branch (65:11): [True: 422k, False: 55.8M]
  ------------------
   66|   422k|        m_tokens.pop();
   67|   422k|        continue;
   68|   422k|      }
   69|       |
   70|       |      // note: what's left are the unverified tokens
   71|  56.2M|    }
   72|       |
   73|       |    // no token? maybe we've actually finished
   74|  57.4M|    if (m_endedStream) {
  ------------------
  |  Branch (74:9): [True: 652k, False: 56.7M]
  ------------------
   75|   652k|      return;
   76|   652k|    }
   77|       |
   78|       |    // no? then scan...
   79|  56.7M|    ScanNextToken();
   80|  56.7M|  }
   81|  38.0M|}
_ZN4YAML7Scanner13ScanNextTokenEv:
   83|  56.7M|void Scanner::ScanNextToken() {
   84|  56.7M|  if (m_endedStream) {
  ------------------
  |  Branch (84:7): [True: 0, False: 56.7M]
  ------------------
   85|      0|    return;
   86|      0|  }
   87|       |
   88|  56.7M|  if (!m_startedStream) {
  ------------------
  |  Branch (88:7): [True: 6.57k, False: 56.7M]
  ------------------
   89|  6.57k|    return StartStream();
   90|  6.57k|  }
   91|       |
   92|       |  // get rid of whitespace, etc. (in between tokens it should be irrelevant)
   93|  56.7M|  ScanToNextToken();
   94|       |
   95|       |  // maybe need to end some blocks
   96|  56.7M|  PopIndentToHere();
   97|       |
   98|       |  // *****
   99|       |  // And now branch based on the next few characters!
  100|       |  // *****
  101|       |
  102|       |  // end of stream
  103|  56.7M|  if (!INPUT) {
  ------------------
  |  Branch (103:7): [True: 5.46k, False: 56.7M]
  ------------------
  104|  5.46k|    return EndStream();
  105|  5.46k|  }
  106|       |
  107|  56.7M|  if (INPUT.column() == 0 && INPUT.peek() == Keys::Directive) {
  ------------------
  |  Branch (107:7): [True: 2.82M, False: 53.9M]
  |  Branch (107:30): [True: 12.4k, False: 2.81M]
  ------------------
  108|  12.4k|    return ScanDirective();
  109|  12.4k|  }
  110|       |
  111|       |  // document token
  112|  56.7M|  if (INPUT.column() == 0 && Exp::DocStart().Matches(INPUT)) {
  ------------------
  |  Branch (112:7): [True: 2.81M, False: 53.9M]
  |  Branch (112:30): [True: 428k, False: 2.38M]
  ------------------
  113|   428k|    return ScanDocStart();
  114|   428k|  }
  115|       |
  116|  56.3M|  if (INPUT.column() == 0 && Exp::DocEnd().Matches(INPUT)) {
  ------------------
  |  Branch (116:7): [True: 2.38M, False: 53.9M]
  |  Branch (116:30): [True: 96.7k, False: 2.28M]
  ------------------
  117|  96.7k|    return ScanDocEnd();
  118|  96.7k|  }
  119|       |
  120|       |  // flow start/end/entry
  121|  56.2M|  if (INPUT.peek() == Keys::FlowSeqStart ||
  ------------------
  |  Branch (121:7): [True: 31.0M, False: 25.1M]
  ------------------
  122|  39.5M|      INPUT.peek() == Keys::FlowMapStart) {
  ------------------
  |  Branch (122:7): [True: 8.47M, False: 16.7M]
  ------------------
  123|  39.5M|    return ScanFlowStart();
  124|  39.5M|  }
  125|       |
  126|  16.7M|  if (INPUT.peek() == Keys::FlowSeqEnd || INPUT.peek() == Keys::FlowMapEnd) {
  ------------------
  |  Branch (126:7): [True: 21.0k, False: 16.6M]
  |  Branch (126:43): [True: 826k, False: 15.8M]
  ------------------
  127|   847k|    return ScanFlowEnd();
  128|   847k|  }
  129|       |
  130|  15.8M|  if (INPUT.peek() == Keys::FlowEntry) {
  ------------------
  |  Branch (130:7): [True: 3.21M, False: 12.6M]
  ------------------
  131|       |    // values starting with `,` are not allowed.
  132|       |    // eg: reject `,foo`
  133|  3.21M|    if (INPUT.column() == 0) {
  ------------------
  |  Branch (133:9): [True: 7, False: 3.21M]
  ------------------
  134|      7|      throw ParserException(INPUT.mark(), ErrorMsg::UNEXPECTED_FLOW);
  135|      7|    }
  136|       |    // if we already parsed a quoted scalar value and we are not in a flow,
  137|       |    // then `,` is not a valid character.
  138|       |    // eg: reject `"foo",`
  139|  3.21M|    if (!m_scalarValueAllowed) {
  ------------------
  |  Branch (139:9): [True: 1, False: 3.21M]
  ------------------
  140|      1|      throw ParserException(INPUT.mark(), ErrorMsg::UNEXPECTED_SCALAR);
  141|      1|    }
  142|  3.21M|    return ScanFlowEntry();
  143|  3.21M|  }
  144|       |
  145|       |  // block/map stuff
  146|  12.6M|  if (Exp::BlockEntry().Matches(INPUT)) {
  ------------------
  |  Branch (146:7): [True: 1.54M, False: 11.1M]
  ------------------
  147|  1.54M|    return ScanBlockEntry();
  148|  1.54M|  }
  149|       |
  150|  11.1M|  if ((InBlockContext() ? Exp::Key() : Exp::KeyInFlow()).Matches(INPUT)) {
  ------------------
  |  Branch (150:7): [True: 25.6k, False: 11.0M]
  |  Branch (150:8): [True: 9.29M, False: 1.81M]
  ------------------
  151|  25.6k|    return ScanKey();
  152|  25.6k|  }
  153|       |
  154|  11.0M|  if (GetValueRegex().Matches(INPUT)) {
  ------------------
  |  Branch (154:7): [True: 6.59M, False: 4.48M]
  ------------------
  155|  6.59M|    return ScanValue();
  156|  6.59M|  }
  157|       |
  158|       |  // alias/anchor
  159|  4.48M|  if (INPUT.peek() == Keys::Alias || INPUT.peek() == Keys::Anchor) {
  ------------------
  |  Branch (159:7): [True: 2.06k, False: 4.48M]
  |  Branch (159:38): [True: 389k, False: 4.09M]
  ------------------
  160|   391k|    return ScanAnchorOrAlias();
  161|   391k|  }
  162|       |
  163|       |  // tag
  164|  4.09M|  if (INPUT.peek() == Keys::Tag) {
  ------------------
  |  Branch (164:7): [True: 1.20M, False: 2.89M]
  ------------------
  165|  1.20M|    return ScanTag();
  166|  1.20M|  }
  167|       |
  168|       |  // special scalars
  169|  2.89M|  if (InBlockContext() && (INPUT.peek() == Keys::LiteralScalar ||
  ------------------
  |  Branch (169:7): [True: 1.53M, False: 1.36M]
  |  Branch (169:28): [True: 1.15k, False: 1.53M]
  ------------------
  170|  1.53M|                           INPUT.peek() == Keys::FoldedScalar)) {
  ------------------
  |  Branch (170:28): [True: 2.34k, False: 1.52M]
  ------------------
  171|  3.49k|    return ScanBlockScalar();
  172|  3.49k|  }
  173|       |
  174|       |  // if we already parsed a quoted scalar value in this line,
  175|       |  // another scalar value is an error.
  176|       |  // eg: reject `"foo" "bar"`
  177|  2.89M|  if (!m_scalarValueAllowed) {
  ------------------
  |  Branch (177:7): [True: 36, False: 2.89M]
  ------------------
  178|     36|    throw ParserException(INPUT.mark(), ErrorMsg::UNEXPECTED_SCALAR);
  179|     36|  }
  180|       |
  181|  2.89M|  if (INPUT.peek() == '\'' || INPUT.peek() == '\"') {
  ------------------
  |  Branch (181:7): [True: 1.96k, False: 2.88M]
  |  Branch (181:31): [True: 4.91k, False: 2.88M]
  ------------------
  182|  6.87k|    return ScanQuotedScalar();
  183|  6.87k|  }
  184|       |
  185|       |  // plain scalars
  186|  2.88M|  if ((InBlockContext() ? Exp::PlainScalar() : Exp::PlainScalarInFlow())
  ------------------
  |  Branch (186:7): [True: 2.88M, False: 51]
  |  Branch (186:8): [True: 1.52M, False: 1.35M]
  ------------------
  187|  2.88M|          .Matches(INPUT)) {
  188|  2.88M|    return ScanPlainScalar();
  189|  2.88M|  }
  190|       |
  191|       |  // don't know what it is!
  192|     51|  throw ParserException(INPUT.mark(), ErrorMsg::UNKNOWN_TOKEN);
  193|  2.88M|}
_ZN4YAML7Scanner15ScanToNextTokenEv:
  195|  56.7M|void Scanner::ScanToNextToken() {
  196|  65.1M|  while (true) {
  ------------------
  |  Branch (196:10): [True: 65.1M, Folded]
  ------------------
  197|       |    // first eat whitespace
  198|  65.3M|    while (INPUT && IsWhitespaceToBeEaten(INPUT.peek())) {
  ------------------
  |  Branch (198:12): [True: 65.3M, False: 5.39k]
  |  Branch (198:21): [True: 238k, False: 65.1M]
  ------------------
  199|   238k|      if (InBlockContext() && Exp::Tab().Matches(INPUT)) {
  ------------------
  |  Branch (199:11): [True: 179k, False: 59.0k]
  |  Branch (199:31): [True: 1.40k, False: 178k]
  ------------------
  200|  1.40k|        m_simpleKeyAllowed = false;
  201|  1.40k|      }
  202|   238k|      INPUT.eat(1);
  203|   238k|    }
  204|       |
  205|       |    // then eat a comment
  206|  65.1M|    if (Exp::Comment().Matches(INPUT)) {
  ------------------
  |  Branch (206:9): [True: 1.56k, False: 65.1M]
  ------------------
  207|       |      // eat until line break
  208|  5.37M|      while (INPUT && !Exp::Break().Matches(INPUT)) {
  ------------------
  |  Branch (208:14): [True: 5.37M, False: 79]
  |  Branch (208:23): [True: 5.37M, False: 1.48k]
  ------------------
  209|  5.37M|        INPUT.eat(1);
  210|  5.37M|      }
  211|  1.56k|    }
  212|       |
  213|       |    // if it's NOT a line break, then we're done!
  214|  65.1M|    if (!Exp::Break().Matches(INPUT)) {
  ------------------
  |  Branch (214:9): [True: 56.7M, False: 8.34M]
  ------------------
  215|  56.7M|      break;
  216|  56.7M|    }
  217|       |
  218|       |    // otherwise, let's eat the line break and keep going
  219|  8.34M|    int n = Exp::Break().Match(INPUT);
  220|  8.34M|    INPUT.eat(n);
  221|       |
  222|       |    // oh yeah, and let's get rid of that simple key
  223|  8.34M|    InvalidateSimpleKey();
  224|       |
  225|       |    // new line - we accept a scalar value now
  226|  8.34M|    m_scalarValueAllowed = true;
  227|       |
  228|       |    // new line - we may be able to accept a simple key now
  229|  8.34M|    if (InBlockContext()) {
  ------------------
  |  Branch (229:9): [True: 8.30M, False: 35.8k]
  ------------------
  230|  8.30M|      m_simpleKeyAllowed = true;
  231|  8.30M|    }
  232|  8.34M|  }
  233|  56.7M|}
_ZN4YAML7Scanner21IsWhitespaceToBeEatenEc:
  247|  65.3M|bool Scanner::IsWhitespaceToBeEaten(char ch) {
  248|  65.3M|  if (ch == ' ') {
  ------------------
  |  Branch (248:7): [True: 212k, False: 65.1M]
  ------------------
  249|   212k|    return true;
  250|   212k|  }
  251|       |
  252|  65.1M|  if (ch == '\t') {
  ------------------
  |  Branch (252:7): [True: 26.6k, False: 65.1M]
  ------------------
  253|  26.6k|    return true;
  254|  26.6k|  }
  255|       |
  256|  65.1M|  return false;
  257|  65.1M|}
_ZNK4YAML7Scanner13GetValueRegexEv:
  259|  11.0M|const RegEx& Scanner::GetValueRegex() const {
  260|  11.0M|  if (InBlockContext()) {
  ------------------
  |  Branch (260:7): [True: 9.28M, False: 1.79M]
  ------------------
  261|  9.28M|    return Exp::Value();
  262|  9.28M|  }
  263|       |
  264|  1.79M|  return m_canBeJSONFlow ? Exp::ValueInJSONFlow() : Exp::ValueInFlow();
  ------------------
  |  Branch (264:10): [True: 7.75k, False: 1.78M]
  ------------------
  265|  11.0M|}
_ZN4YAML7Scanner11StartStreamEv:
  267|  6.57k|void Scanner::StartStream() {
  268|  6.57k|  m_startedStream = true;
  269|  6.57k|  m_simpleKeyAllowed = true;
  270|  6.57k|  m_scalarValueAllowed = true;
  271|  6.57k|  std::unique_ptr<IndentMarker> pIndent(
  272|  6.57k|      new IndentMarker(-1, IndentMarker::NONE));
  273|  6.57k|  m_indentRefs.push_back(std::move(pIndent));
  274|  6.57k|  m_indents.push(&m_indentRefs.back());
  275|  6.57k|}
_ZN4YAML7Scanner9EndStreamEv:
  277|  5.46k|void Scanner::EndStream() {
  278|       |  // force newline
  279|  5.46k|  if (INPUT.column() > 0) {
  ------------------
  |  Branch (279:7): [True: 5.01k, False: 453]
  ------------------
  280|  5.01k|    INPUT.ResetColumn();
  281|  5.01k|  }
  282|       |
  283|  5.46k|  PopAllIndents();
  284|  5.46k|  PopAllSimpleKeys();
  285|       |
  286|  5.46k|  m_simpleKeyAllowed = false;
  287|  5.46k|  m_scalarValueAllowed = false;
  288|  5.46k|  m_endedStream = true;
  289|  5.46k|}
_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.53M|    case IndentMarker::SEQ:
  ------------------
  |  Branch (298:5): [True: 1.53M, False: 8.74M]
  ------------------
  299|  1.53M|      return Token::BLOCK_SEQ_START;
  300|  8.74M|    case IndentMarker::MAP:
  ------------------
  |  Branch (300:5): [True: 8.74M, False: 1.53M]
  ------------------
  301|  8.74M|      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: 125k, False: 10.2M]
  ------------------
  326|   125k|      !(indent.type == IndentMarker::SEQ &&
  ------------------
  |  Branch (326:9): [True: 32.1k, False: 93.7k]
  ------------------
  327|  99.3k|        lastIndent.type == IndentMarker::MAP)) {
  ------------------
  |  Branch (327:9): [True: 26.5k, False: 5.63k]
  ------------------
  328|  99.3k|    return nullptr;
  329|  99.3k|  }
  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|  56.7M|void Scanner::PopIndentToHere() {
  341|       |  // are we in flow?
  342|  56.7M|  if (InFlowContext()) {
  ------------------
  |  Branch (342:7): [True: 45.4M, False: 11.3M]
  ------------------
  343|  45.4M|    return;
  344|  45.4M|  }
  345|       |
  346|       |  // now pop away
  347|  14.8M|  while (!m_indents.empty()) {
  ------------------
  |  Branch (347:10): [True: 14.8M, False: 0]
  ------------------
  348|  14.8M|    const IndentMarker& indent = *m_indents.top();
  349|  14.8M|    if (indent.column < INPUT.column()) {
  ------------------
  |  Branch (349:9): [True: 10.1M, False: 4.77M]
  ------------------
  350|  10.1M|      break;
  351|  10.1M|    }
  352|  4.77M|    if (indent.column == INPUT.column() &&
  ------------------
  |  Branch (352:9): [True: 2.28M, False: 2.48M]
  ------------------
  353|  2.28M|        !(indent.type == IndentMarker::SEQ &&
  ------------------
  |  Branch (353:11): [True: 1.06M, False: 1.21M]
  ------------------
  354|  1.22M|          !Exp::BlockEntry().Matches(INPUT))) {
  ------------------
  |  Branch (354:11): [True: 1.06M, False: 5.63k]
  ------------------
  355|  1.22M|      break;
  356|  1.22M|    }
  357|       |
  358|  3.55M|    PopIndent();
  359|  3.55M|  }
  360|       |
  361|  12.5M|  while (!m_indents.empty() &&
  ------------------
  |  Branch (361:10): [True: 12.5M, False: 0]
  ------------------
  362|  12.5M|         m_indents.top()->status == IndentMarker::INVALID) {
  ------------------
  |  Branch (362:10): [True: 1.15M, False: 11.3M]
  ------------------
  363|  1.15M|    PopIndent();
  364|  1.15M|  }
  365|  11.3M|}
_ZN4YAML7Scanner13PopAllIndentsEv:
  367|   543k|void Scanner::PopAllIndents() {
  368|       |  // are we in flow?
  369|   543k|  if (InFlowContext()) {
  ------------------
  |  Branch (369:7): [True: 40.3k, False: 502k]
  ------------------
  370|  40.3k|    return;
  371|  40.3k|  }
  372|       |
  373|       |  // now pop away
  374|  2.41M|  while (!m_indents.empty()) {
  ------------------
  |  Branch (374:10): [True: 2.41M, False: 0]
  ------------------
  375|  2.41M|    const IndentMarker& indent = *m_indents.top();
  376|  2.41M|    if (indent.type == IndentMarker::NONE) {
  ------------------
  |  Branch (376:9): [True: 502k, False: 1.91M]
  ------------------
  377|   502k|      break;
  378|   502k|    }
  379|       |
  380|  1.91M|    PopIndent();
  381|  1.91M|  }
  382|   502k|}
_ZN4YAML7Scanner9PopIndentEv:
  384|  6.62M|void Scanner::PopIndent() {
  385|  6.62M|  const IndentMarker& indent = *m_indents.top();
  386|  6.62M|  m_indents.pop();
  387|       |
  388|  6.62M|  if (indent.status != IndentMarker::VALID) {
  ------------------
  |  Branch (388:7): [True: 2.23M, False: 4.39M]
  ------------------
  389|  2.23M|    InvalidateSimpleKey();
  390|  2.23M|    return;
  391|  2.23M|  }
  392|       |
  393|  4.39M|  if (indent.type == IndentMarker::SEQ) {
  ------------------
  |  Branch (393:7): [True: 1.53M, False: 2.85M]
  ------------------
  394|  1.53M|    m_tokens.push(Token(Token::BLOCK_SEQ_END, INPUT.mark()));
  395|  2.85M|  } else if (indent.type == IndentMarker::MAP) {
  ------------------
  |  Branch (395:14): [True: 2.85M, False: 0]
  ------------------
  396|  2.85M|    m_tokens.push(Token(Token::BLOCK_MAP_END, INPUT.mark()));
  397|  2.85M|  }
  398|  4.39M|}
_ZNK4YAML7Scanner12GetTopIndentEv:
  400|  1.53M|int Scanner::GetTopIndent() const {
  401|  1.53M|  if (m_indents.empty()) {
  ------------------
  |  Branch (401:7): [True: 0, False: 1.53M]
  ------------------
  402|      0|    return 0;
  403|      0|  }
  404|  1.53M|  return m_indents.top()->column;
  405|  1.53M|}

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

_ZN4YAML10ScanScalarERNS_6StreamERNS_16ScanScalarParamsE:
   21|  2.89M|std::string ScanScalar(Stream& INPUT, ScanScalarParams& params) {
   22|  2.89M|  bool foundNonEmptyLine = false;
   23|  2.89M|  bool pastOpeningBreak = (params.fold == FOLD_FLOW);
   24|  2.89M|  bool emptyLine = false, moreIndented = false;
   25|  2.89M|  int foldedNewlineCount = 0;
   26|  2.89M|  bool foldedNewlineStartedMoreIndented = false;
   27|  2.89M|  std::size_t lastEscapedChar = std::string::npos;
   28|  2.89M|  std::string scalar;
   29|  2.89M|  params.leadingSpaces = false;
   30|       |
   31|  2.89M|  if (!params.end) {
  ------------------
  |  Branch (31:7): [True: 3.45k, False: 2.89M]
  ------------------
   32|  3.45k|    params.end = &Exp::Empty();
   33|  3.45k|  }
   34|       |
   35|  22.3M|  while (INPUT) {
  ------------------
  |  Branch (35:10): [True: 22.3M, False: 913]
  ------------------
   36|       |    // ********************************
   37|       |    // Phase #1: scan until line ending
   38|       |
   39|  22.3M|    std::size_t lastNonWhitespaceChar = scalar.size();
   40|  22.3M|    bool escapedNewline = false;
   41|  90.5M|    while (!params.end->Matches(INPUT) && !Exp::Break().Matches(INPUT)) {
  ------------------
  |  Branch (41:12): [True: 89.1M, False: 1.39M]
  |  Branch (41:43): [True: 68.6M, False: 20.4M]
  ------------------
   42|  68.6M|      if (!INPUT) {
  ------------------
  |  Branch (42:11): [True: 1.74k, False: 68.6M]
  ------------------
   43|  1.74k|        break;
   44|  1.74k|      }
   45|       |
   46|       |      // document indicator?
   47|  68.6M|      if (INPUT.column() == 0 && Exp::DocIndicator().Matches(INPUT)) {
  ------------------
  |  Branch (47:11): [True: 560k, False: 68.0M]
  |  Branch (47:34): [True: 420k, False: 140k]
  ------------------
   48|   420k|        if (params.onDocIndicator == BREAK) {
  ------------------
  |  Branch (48:13): [True: 420k, False: 2]
  ------------------
   49|   420k|          break;
   50|   420k|        }
   51|      2|        if (params.onDocIndicator == THROW) {
  ------------------
  |  Branch (51:13): [True: 2, False: 0]
  ------------------
   52|      2|          throw ParserException(INPUT.mark(), ErrorMsg::DOC_IN_SCALAR);
   53|      2|        }
   54|      2|      }
   55|       |
   56|  68.2M|      foundNonEmptyLine = true;
   57|  68.2M|      pastOpeningBreak = true;
   58|       |
   59|       |      // escaped newline? (only if we're escaping on slash)
   60|  68.2M|      if (params.escape == '\\' && Exp::EscBreak().Matches(INPUT)) {
  ------------------
  |  Branch (60:11): [True: 11.6M, False: 56.5M]
  |  Branch (60:36): [True: 620, False: 11.6M]
  ------------------
   61|       |        // eat escape character and get out (but preserve trailing whitespace!)
   62|    620|        INPUT.get();
   63|    620|        lastNonWhitespaceChar = scalar.size();
   64|    620|        lastEscapedChar = scalar.size();
   65|    620|        escapedNewline = true;
   66|    620|        break;
   67|    620|      }
   68|       |
   69|       |      // escape this?
   70|  68.2M|      if (INPUT.peek() == params.escape) {
  ------------------
  |  Branch (70:11): [True: 39.6k, False: 68.1M]
  ------------------
   71|  39.6k|        scalar += Exp::Escape(INPUT);
   72|  39.6k|        lastNonWhitespaceChar = scalar.size();
   73|  39.6k|        lastEscapedChar = scalar.size();
   74|  39.6k|        continue;
   75|  39.6k|      }
   76|       |
   77|       |      // otherwise, just add the damn character
   78|  68.1M|      char ch = INPUT.get();
   79|  68.1M|      scalar += ch;
   80|  68.1M|      if (ch != ' ' && ch != '\t') {
  ------------------
  |  Branch (80:11): [True: 68.1M, False: 73.1k]
  |  Branch (80:24): [True: 66.5M, False: 1.54M]
  ------------------
   81|  66.5M|        lastNonWhitespaceChar = scalar.size();
   82|  66.5M|      }
   83|  68.1M|    }
   84|       |
   85|       |    // eof? if we're looking to eat something, then we throw
   86|  22.3M|    if (!INPUT) {
  ------------------
  |  Branch (86:9): [True: 1.81k, False: 22.3M]
  ------------------
   87|  1.81k|      if (params.eatEnd) {
  ------------------
  |  Branch (87:11): [True: 203, False: 1.61k]
  ------------------
   88|    203|        throw ParserException(INPUT.mark(), ErrorMsg::EOF_IN_SCALAR);
   89|    203|      }
   90|  1.61k|      break;
   91|  1.81k|    }
   92|       |
   93|       |    // doc indicator?
   94|  22.3M|    if (params.onDocIndicator == BREAK && INPUT.column() == 0 &&
  ------------------
  |  Branch (94:9): [True: 11.3M, False: 10.9M]
  |  Branch (94:43): [True: 5.46M, False: 5.90M]
  ------------------
   95|  5.46M|        Exp::DocIndicator().Matches(INPUT)) {
  ------------------
  |  Branch (95:9): [True: 420k, False: 5.04M]
  ------------------
   96|   420k|      break;
   97|   420k|    }
   98|       |
   99|       |    // are we done via character match?
  100|  21.8M|    int n = params.end->Match(INPUT);
  101|  21.8M|    if (n >= 0) {
  ------------------
  |  Branch (101:9): [True: 1.39M, False: 20.4M]
  ------------------
  102|  1.39M|      if (params.eatEnd) {
  ------------------
  |  Branch (102:11): [True: 6.45k, False: 1.38M]
  ------------------
  103|  6.45k|        INPUT.eat(n);
  104|  6.45k|      }
  105|  1.39M|      break;
  106|  1.39M|    }
  107|       |
  108|       |    // do we remove trailing whitespace?
  109|  20.4M|    if (params.fold == FOLD_FLOW)
  ------------------
  |  Branch (109:9): [True: 9.75M, False: 10.7M]
  ------------------
  110|  9.75M|      scalar.erase(lastNonWhitespaceChar);
  111|       |
  112|       |    // ********************************
  113|       |    // Phase #2: eat line ending
  114|  20.4M|    n = Exp::Break().Match(INPUT);
  115|  20.4M|    INPUT.eat(n);
  116|       |
  117|       |    // ********************************
  118|       |    // Phase #3: scan initial spaces
  119|       |
  120|       |    // first the required indentation
  121|  20.4M|    while (INPUT.peek() == ' ' &&
  ------------------
  |  Branch (121:12): [True: 14.8k, False: 20.4M]
  ------------------
  122|  14.8k|           (INPUT.column() < params.indent ||
  ------------------
  |  Branch (122:13): [True: 754, False: 14.1k]
  ------------------
  123|  14.1k|            (params.detectIndent && !foundNonEmptyLine)) &&
  ------------------
  |  Branch (123:14): [True: 1.50k, False: 12.6k]
  |  Branch (123:37): [True: 278, False: 1.23k]
  ------------------
  124|  1.03k|           !params.end->Matches(INPUT)) {
  ------------------
  |  Branch (124:12): [True: 838, False: 194]
  ------------------
  125|    838|      INPUT.eat(1);
  126|    838|    }
  127|       |
  128|       |    // update indent if we're auto-detecting
  129|  20.4M|    if (params.detectIndent && !foundNonEmptyLine) {
  ------------------
  |  Branch (129:9): [True: 10.7M, False: 9.75M]
  |  Branch (129:32): [True: 8.44M, False: 2.28M]
  ------------------
  130|  8.44M|      params.indent = std::max(params.indent, INPUT.column());
  131|  8.44M|    }
  132|       |
  133|       |    // and then the rest of the whitespace
  134|  20.5M|    while (Exp::Blank().Matches(INPUT)) {
  ------------------
  |  Branch (134:12): [True: 17.5k, False: 20.4M]
  ------------------
  135|       |      // we check for tabs that masquerade as indentation
  136|  17.5k|      if (INPUT.peek() == '\t' && INPUT.column() < params.indent &&
  ------------------
  |  Branch (136:11): [True: 3.28k, False: 14.2k]
  |  Branch (136:35): [True: 3, False: 3.27k]
  ------------------
  137|      3|          params.onTabInIndentation == THROW) {
  ------------------
  |  Branch (137:11): [True: 3, False: 0]
  ------------------
  138|      3|        throw ParserException(INPUT.mark(), ErrorMsg::TAB_IN_INDENTATION);
  139|      3|      }
  140|       |
  141|  17.5k|      if (!params.eatLeadingWhitespace) {
  ------------------
  |  Branch (141:11): [True: 1.80k, False: 15.7k]
  ------------------
  142|  1.80k|        break;
  143|  1.80k|      }
  144|       |
  145|  15.7k|      if (params.end->Matches(INPUT)) {
  ------------------
  |  Branch (145:11): [True: 223, False: 15.5k]
  ------------------
  146|    223|        break;
  147|    223|      }
  148|       |
  149|  15.5k|      INPUT.eat(1);
  150|  15.5k|    }
  151|       |
  152|       |    // was this an empty line?
  153|  20.4M|    bool nextEmptyLine = Exp::Break().Matches(INPUT);
  154|  20.4M|    bool nextMoreIndented = Exp::Blank().Matches(INPUT);
  155|  20.4M|    if (params.fold == FOLD_BLOCK && foldedNewlineCount == 0 && nextEmptyLine)
  ------------------
  |  Branch (155:9): [True: 10.7M, False: 9.75M]
  |  Branch (155:38): [True: 107k, False: 10.6M]
  |  Branch (155:65): [True: 4.14k, False: 103k]
  ------------------
  156|  4.14k|      foldedNewlineStartedMoreIndented = moreIndented;
  157|       |
  158|       |    // for block scalars, we always start with a newline, so we should ignore it
  159|       |    // (not fold or keep)
  160|  20.4M|    if (pastOpeningBreak) {
  ------------------
  |  Branch (160:9): [True: 20.4M, False: 3.73k]
  ------------------
  161|  20.4M|      switch (params.fold) {
  ------------------
  |  Branch (161:15): [True: 20.4M, False: 0]
  ------------------
  162|  7.04k|        case DONT_FOLD:
  ------------------
  |  Branch (162:9): [True: 7.04k, False: 20.4M]
  ------------------
  163|  7.04k|          scalar += "\n";
  164|  7.04k|          break;
  165|  10.7M|        case FOLD_BLOCK:
  ------------------
  |  Branch (165:9): [True: 10.7M, False: 9.75M]
  ------------------
  166|  10.7M|          if (!emptyLine && !nextEmptyLine && !moreIndented &&
  ------------------
  |  Branch (166:15): [True: 105k, False: 10.6M]
  |  Branch (166:29): [True: 101k, False: 3.12k]
  |  Branch (166:47): [True: 100k, False: 1.09k]
  ------------------
  167|   100k|              !nextMoreIndented && INPUT.column() >= params.indent) {
  ------------------
  |  Branch (167:15): [True: 100k, False: 544]
  |  Branch (167:36): [True: 99.7k, False: 574]
  ------------------
  168|  99.7k|            scalar += " ";
  169|  10.6M|          } else if (nextEmptyLine) {
  ------------------
  |  Branch (169:22): [True: 10.6M, False: 5.93k]
  ------------------
  170|  10.6M|            foldedNewlineCount++;
  171|  10.6M|          } else {
  172|  5.93k|            scalar += "\n";
  173|  5.93k|          }
  174|       |
  175|  10.7M|          if (!nextEmptyLine && foldedNewlineCount > 0) {
  ------------------
  |  Branch (175:15): [True: 105k, False: 10.6M]
  |  Branch (175:33): [True: 3.54k, False: 102k]
  ------------------
  176|  3.54k|            scalar += std::string(foldedNewlineCount - 1, '\n');
  177|  3.54k|            if (foldedNewlineStartedMoreIndented ||
  ------------------
  |  Branch (177:17): [True: 439, False: 3.10k]
  ------------------
  178|  3.10k|                nextMoreIndented | !foundNonEmptyLine) {
  ------------------
  |  Branch (178:17): [True: 626, False: 2.48k]
  ------------------
  179|  1.06k|              scalar += "\n";
  180|  1.06k|            }
  181|  3.54k|            foldedNewlineCount = 0;
  182|  3.54k|          }
  183|  10.7M|          break;
  184|  9.75M|        case FOLD_FLOW:
  ------------------
  |  Branch (184:9): [True: 9.75M, False: 10.7M]
  ------------------
  185|  9.75M|          if (nextEmptyLine) {
  ------------------
  |  Branch (185:15): [True: 7.75M, False: 1.99M]
  ------------------
  186|  7.75M|            scalar += "\n";
  187|  7.75M|          } else if (!emptyLine && !escapedNewline) {
  ------------------
  |  Branch (187:22): [True: 1.98M, False: 13.6k]
  |  Branch (187:36): [True: 1.98M, False: 614]
  ------------------
  188|  1.98M|            scalar += " ";
  189|  1.98M|          }
  190|  9.75M|          break;
  191|  20.4M|      }
  192|  20.4M|    }
  193|       |
  194|  20.4M|    emptyLine = nextEmptyLine;
  195|  20.4M|    moreIndented = nextMoreIndented;
  196|  20.4M|    pastOpeningBreak = true;
  197|       |
  198|       |    // are we done via indentation?
  199|  20.4M|    if (!emptyLine && INPUT.column() < params.indent) {
  ------------------
  |  Branch (199:9): [True: 2.10M, False: 18.3M]
  |  Branch (199:23): [True: 1.07M, False: 1.03M]
  ------------------
  200|  1.07M|      params.leadingSpaces = true;
  201|  1.07M|      break;
  202|  1.07M|    }
  203|  20.4M|  }
  204|       |
  205|       |  // post-processing
  206|  2.89M|  if (params.trimTrailingSpaces) {
  ------------------
  |  Branch (206:7): [True: 2.88M, False: 10.4k]
  ------------------
  207|  2.88M|    std::size_t pos = scalar.find_last_not_of(" \t");
  208|  2.88M|    if (lastEscapedChar != std::string::npos) {
  ------------------
  |  Branch (208:9): [True: 14.2k, False: 2.86M]
  ------------------
  209|  14.2k|      if (pos < lastEscapedChar || pos == std::string::npos) {
  ------------------
  |  Branch (209:11): [True: 8.64k, False: 5.64k]
  |  Branch (209:36): [True: 520, False: 5.12k]
  ------------------
  210|  9.16k|        pos = lastEscapedChar;
  211|  9.16k|      }
  212|  14.2k|    }
  213|  2.88M|    if (pos < scalar.size()) {
  ------------------
  |  Branch (213:9): [True: 2.87M, False: 8.74k]
  ------------------
  214|  2.87M|      scalar.erase(pos + 1);
  215|  2.87M|    }
  216|  2.88M|  }
  217|       |
  218|  2.89M|  switch (params.chomp) {
  219|  9.30k|    case CLIP: {
  ------------------
  |  Branch (219:5): [True: 9.30k, False: 2.88M]
  ------------------
  220|  9.30k|      std::size_t pos = scalar.find_last_not_of('\n');
  221|  9.30k|      if (lastEscapedChar != std::string::npos) {
  ------------------
  |  Branch (221:11): [True: 2.07k, False: 7.22k]
  ------------------
  222|  2.07k|        if (pos < lastEscapedChar || pos == std::string::npos) {
  ------------------
  |  Branch (222:13): [True: 1.29k, False: 785]
  |  Branch (222:38): [True: 217, False: 568]
  ------------------
  223|  1.51k|          pos = lastEscapedChar;
  224|  1.51k|        }
  225|  2.07k|      }
  226|  9.30k|      if (pos == std::string::npos) {
  ------------------
  |  Branch (226:11): [True: 4.30k, False: 4.99k]
  ------------------
  227|  4.30k|        scalar.erase();
  228|  4.99k|      } else if (pos + 1 < scalar.size()) {
  ------------------
  |  Branch (228:18): [True: 848, False: 4.15k]
  ------------------
  229|    848|        scalar.erase(pos + 2);
  230|    848|      }
  231|  9.30k|    } break;
  232|  2.88M|    case STRIP: {
  ------------------
  |  Branch (232:5): [True: 2.88M, False: 9.93k]
  ------------------
  233|  2.88M|      std::size_t pos = scalar.find_last_not_of('\n');
  234|  2.88M|      if (lastEscapedChar != std::string::npos) {
  ------------------
  |  Branch (234:11): [True: 14.2k, False: 2.86M]
  ------------------
  235|  14.2k|        if (pos < lastEscapedChar || pos == std::string::npos) {
  ------------------
  |  Branch (235:13): [True: 8.54k, False: 5.74k]
  |  Branch (235:38): [True: 216, False: 5.52k]
  ------------------
  236|  8.76k|          pos = lastEscapedChar;
  237|  8.76k|        }
  238|  14.2k|      }
  239|  2.88M|      if (pos == std::string::npos) {
  ------------------
  |  Branch (239:11): [True: 489, False: 2.88M]
  ------------------
  240|    489|        scalar.erase();
  241|  2.88M|      } else if (pos < scalar.size()) {
  ------------------
  |  Branch (241:18): [True: 2.87M, False: 8.74k]
  ------------------
  242|  2.87M|        scalar.erase(pos + 1);
  243|  2.87M|      }
  244|  2.88M|    } break;
  245|    263|    default:
  ------------------
  |  Branch (245:5): [True: 263, False: 2.89M]
  ------------------
  246|    263|      break;
  247|  2.89M|  }
  248|       |
  249|  2.89M|  return scalar;
  250|  2.89M|}

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

_ZN4YAML15ScanVerbatimTagERNS_6StreamE:
    9|    650|const std::string ScanVerbatimTag(Stream& INPUT) {
   10|    650|  std::string tag;
   11|       |
   12|       |  // eat the start character
   13|    650|  INPUT.get();
   14|       |
   15|  10.3k|  while (INPUT) {
  ------------------
  |  Branch (15:10): [True: 10.3k, False: 19]
  ------------------
   16|  10.3k|    if (INPUT.peek() == Keys::VerbatimTagEnd) {
  ------------------
  |  Branch (16:9): [True: 624, False: 9.75k]
  ------------------
   17|       |      // eat the end character
   18|    624|      INPUT.get();
   19|    624|      return tag;
   20|    624|    }
   21|       |
   22|  9.75k|    int n = Exp::URI().Match(INPUT);
   23|  9.75k|    if (n <= 0)
  ------------------
  |  Branch (23:9): [True: 7, False: 9.74k]
  ------------------
   24|      7|      break;
   25|       |
   26|  9.74k|    tag += INPUT.get(n);
   27|  9.74k|  }
   28|       |
   29|     26|  throw ParserException(INPUT.mark(), ErrorMsg::END_OF_VERBATIM_TAG);
   30|    650|}
_ZN4YAML13ScanTagHandleERNS_6StreamERb:
   32|  1.20M|const std::string ScanTagHandle(Stream& INPUT, bool& canBeHandle) {
   33|  1.20M|  std::string tag;
   34|  1.20M|  canBeHandle = true;
   35|  1.20M|  Mark firstNonWordChar;
   36|       |
   37|  9.85M|  while (INPUT) {
  ------------------
  |  Branch (37:10): [True: 9.85M, False: 322]
  ------------------
   38|  9.85M|    if (INPUT.peek() == Keys::Tag) {
  ------------------
  |  Branch (38:9): [True: 2.82k, False: 9.85M]
  ------------------
   39|  2.82k|      if (!canBeHandle)
  ------------------
  |  Branch (39:11): [True: 3, False: 2.81k]
  ------------------
   40|      3|        throw ParserException(firstNonWordChar, ErrorMsg::CHAR_IN_TAG_HANDLE);
   41|  2.81k|      break;
   42|  2.82k|    }
   43|       |
   44|  9.85M|    int n = 0;
   45|  9.85M|    if (canBeHandle) {
  ------------------
  |  Branch (45:9): [True: 8.20M, False: 1.64M]
  ------------------
   46|  8.20M|      n = Exp::Word().Match(INPUT);
   47|  8.20M|      if (n <= 0) {
  ------------------
  |  Branch (47:11): [True: 1.19M, False: 7.00M]
  ------------------
   48|  1.19M|        canBeHandle = false;
   49|  1.19M|        firstNonWordChar = INPUT.mark();
   50|  1.19M|      }
   51|  8.20M|    }
   52|       |
   53|  9.85M|    if (!canBeHandle)
  ------------------
  |  Branch (53:9): [True: 2.84M, False: 7.00M]
  ------------------
   54|  2.84M|      n = Exp::Tag().Match(INPUT);
   55|       |
   56|  9.85M|    if (n <= 0)
  ------------------
  |  Branch (56:9): [True: 1.19M, False: 8.65M]
  ------------------
   57|  1.19M|      break;
   58|       |
   59|  8.65M|    tag += INPUT.get(n);
   60|  8.65M|  }
   61|       |
   62|  1.20M|  return tag;
   63|  1.20M|}
_ZN4YAML13ScanTagSuffixERNS_6StreamE:
   65|  2.81k|const std::string ScanTagSuffix(Stream& INPUT) {
   66|  2.81k|  std::string tag;
   67|       |
   68|   611k|  while (INPUT) {
  ------------------
  |  Branch (68:10): [True: 611k, False: 107]
  ------------------
   69|   611k|    int n = Exp::Tag().Match(INPUT);
   70|   611k|    if (n <= 0)
  ------------------
  |  Branch (70:9): [True: 2.71k, False: 608k]
  ------------------
   71|  2.71k|      break;
   72|       |
   73|   608k|    tag += INPUT.get(n);
   74|   608k|  }
   75|       |
   76|  2.81k|  if (tag.empty())
  ------------------
  |  Branch (76:7): [True: 10, False: 2.80k]
  ------------------
   77|     10|    throw ParserException(INPUT.mark(), ErrorMsg::TAG_WITH_NO_SUFFIX);
   78|       |
   79|  2.80k|  return tag;
   80|  2.81k|}

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

_ZN4YAML7Scanner9SimpleKeyC2ERKNS_4MarkEm:
    8|  43.3M|    : mark(mark_),
    9|  43.3M|      flowLevel(flowLevel_),
   10|  43.3M|      pIndent(nullptr),
   11|  43.3M|      pMapStart(nullptr),
   12|  43.3M|      pKey(nullptr) {}
_ZN4YAML7Scanner9SimpleKey8ValidateEv:
   14|  1.25M|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.25M|  if (pIndent)
  ------------------
  |  Branch (18:7): [True: 57.4k, False: 1.19M]
  ------------------
   19|  57.4k|    pIndent->status = IndentMarker::VALID;
   20|  1.25M|  if (pMapStart)
  ------------------
  |  Branch (20:7): [True: 57.4k, False: 1.19M]
  ------------------
   21|  57.4k|    pMapStart->status = Token::VALID;
   22|  1.25M|  if (pKey)
  ------------------
  |  Branch (22:7): [True: 1.25M, False: 0]
  ------------------
   23|  1.25M|    pKey->status = Token::VALID;
   24|  1.25M|}
_ZN4YAML7Scanner9SimpleKey10InvalidateEv:
   26|  3.42M|void Scanner::SimpleKey::Invalidate() {
   27|  3.42M|  if (pIndent)
  ------------------
  |  Branch (27:7): [True: 2.23M, False: 1.19M]
  ------------------
   28|  2.23M|    pIndent->status = IndentMarker::INVALID;
   29|  3.42M|  if (pMapStart)
  ------------------
  |  Branch (29:7): [True: 2.23M, False: 1.19M]
  ------------------
   30|  2.23M|    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|  44.0M|bool Scanner::CanInsertPotentialSimpleKey() const {
   37|  44.0M|  if (!m_simpleKeyAllowed)
  ------------------
  |  Branch (37:7): [True: 637k, False: 43.3M]
  ------------------
   38|   637k|    return false;
   39|       |
   40|  43.3M|  return !ExistsActiveSimpleKey();
   41|  44.0M|}
_ZNK4YAML7Scanner21ExistsActiveSimpleKeyEv:
   47|  43.3M|bool Scanner::ExistsActiveSimpleKey() const {
   48|  43.3M|  if (m_simpleKeys.empty())
  ------------------
  |  Branch (48:7): [True: 2.33M, False: 41.0M]
  ------------------
   49|  2.33M|    return false;
   50|       |
   51|  41.0M|  const SimpleKey& key = m_simpleKeys.top();
   52|  41.0M|  return key.flowLevel == GetFlowLevel();
   53|  43.3M|}
_ZN4YAML7Scanner24InsertPotentialSimpleKeyEv:
   58|  44.0M|void Scanner::InsertPotentialSimpleKey() {
   59|  44.0M|  if (!CanInsertPotentialSimpleKey())
  ------------------
  |  Branch (59:7): [True: 641k, False: 43.3M]
  ------------------
   60|   641k|    return;
   61|       |
   62|  43.3M|  SimpleKey key(INPUT.mark(), GetFlowLevel());
   63|       |
   64|       |  // first add a map start, if necessary
   65|  43.3M|  if (InBlockContext()) {
  ------------------
  |  Branch (65:7): [True: 2.32M, False: 41.0M]
  ------------------
   66|  2.32M|    key.pIndent = PushIndentTo(INPUT.column(), IndentMarker::MAP);
   67|  2.32M|    if (key.pIndent) {
  ------------------
  |  Branch (67:9): [True: 2.29M, False: 30.5k]
  ------------------
   68|  2.29M|      key.pIndent->status = IndentMarker::UNKNOWN;
   69|  2.29M|      key.pMapStart = key.pIndent->pStartToken;
   70|  2.29M|      key.pMapStart->status = Token::UNVERIFIED;
   71|  2.29M|    }
   72|  2.32M|  }
   73|       |
   74|       |  // then add the (now unverified) key
   75|  43.3M|  m_tokens.push(Token(Token::KEY, INPUT.mark()));
   76|  43.3M|  key.pKey = &m_tokens.back();
   77|  43.3M|  key.pKey->status = Token::UNVERIFIED;
   78|       |
   79|  43.3M|  m_simpleKeys.push(key);
   80|  43.3M|}
_ZN4YAML7Scanner19InvalidateSimpleKeyEv:
   84|  12.0M|void Scanner::InvalidateSimpleKey() {
   85|  12.0M|  if (m_simpleKeys.empty())
  ------------------
  |  Branch (85:7): [True: 8.38M, False: 3.69M]
  ------------------
   86|  8.38M|    return;
   87|       |
   88|       |  // grab top key
   89|  3.69M|  SimpleKey& key = m_simpleKeys.top();
   90|  3.69M|  if (key.flowLevel != GetFlowLevel())
  ------------------
  |  Branch (90:7): [True: 1.00M, False: 2.68M]
  ------------------
   91|  1.00M|    return;
   92|       |
   93|  2.68M|  key.Invalidate();
   94|  2.68M|  m_simpleKeys.pop();
   95|  2.68M|}
_ZN4YAML7Scanner15VerifySimpleKeyEv:
  100|  9.13M|bool Scanner::VerifySimpleKey() {
  101|  9.13M|  if (m_simpleKeys.empty())
  ------------------
  |  Branch (101:7): [True: 7.03M, False: 2.09M]
  ------------------
  102|  7.03M|    return false;
  103|       |
  104|       |  // grab top key
  105|  2.09M|  SimpleKey key = m_simpleKeys.top();
  106|       |
  107|       |  // only validate if we're in the correct flow level
  108|  2.09M|  if (key.flowLevel != GetFlowLevel())
  ------------------
  |  Branch (108:7): [True: 103k, False: 1.99M]
  ------------------
  109|   103k|    return false;
  110|       |
  111|  1.99M|  m_simpleKeys.pop();
  112|       |
  113|  1.99M|  bool isValid = true;
  114|       |
  115|       |  // needs to be less than 1024 characters and inline
  116|  1.99M|  if (INPUT.line() != key.mark.line || INPUT.pos() - key.mark.pos > 1024)
  ------------------
  |  Branch (116:7): [True: 37.4k, False: 1.95M]
  |  Branch (116:40): [True: 702k, False: 1.25M]
  ------------------
  117|   740k|    isValid = false;
  118|       |
  119|       |  // invalidate key
  120|  1.99M|  if (isValid)
  ------------------
  |  Branch (120:7): [True: 1.25M, False: 740k]
  ------------------
  121|  1.25M|    key.Validate();
  122|   740k|  else
  123|   740k|    key.Invalidate();
  124|       |
  125|  1.99M|  return isValid;
  126|  2.09M|}
_ZN4YAML7Scanner16PopAllSimpleKeysEv:
  128|   543k|void Scanner::PopAllSimpleKeys() {
  129|  33.6M|  while (!m_simpleKeys.empty())
  ------------------
  |  Branch (129:10): [True: 33.1M, False: 543k]
  ------------------
  130|  33.1M|    m_simpleKeys.pop();
  131|   543k|}

_ZN4YAML15SingleDocParserC2ERNS_7ScannerERKNS_10DirectivesE:
   18|   483k|    : m_scanner(scanner),
   19|   483k|      m_directives(directives),
   20|   483k|      m_pCollectionStack(new CollectionStack),
   21|   483k|      m_anchors{},
   22|   483k|      m_curAnchor(0) {}
_ZN4YAML15SingleDocParserD2Ev:
   24|   483k|SingleDocParser::~SingleDocParser() = default;
_ZN4YAML15SingleDocParser14HandleDocumentERNS_12EventHandlerE:
   29|   483k|void SingleDocParser::HandleDocument(EventHandler& eventHandler) {
   30|   483k|  assert(!m_scanner.empty());  // guaranteed that there are tokens
   31|   483k|  assert(!m_curAnchor);
   32|       |
   33|   483k|  eventHandler.OnDocumentStart(m_scanner.peek().mark);
   34|       |
   35|       |  // eat doc start
   36|   483k|  if (m_scanner.peek().type == Token::DOC_START)
  ------------------
  |  Branch (36:7): [True: 396k, False: 86.4k]
  ------------------
   37|   396k|    m_scanner.pop();
   38|       |
   39|       |  // recurse!
   40|   483k|  HandleNode(eventHandler);
   41|       |
   42|   483k|  eventHandler.OnDocumentEnd();
   43|       |
   44|       |  // check if any tokens left after the text
   45|   483k|  if (!m_scanner.empty() && m_scanner.peek().type != Token::DOC_END
  ------------------
  |  Branch (45:7): [True: 478k, False: 4.57k]
  |  Branch (45:29): [True: 397k, False: 81.5k]
  ------------------
   46|   397k|      && m_scanner.peek().type != Token::DOC_START)
  ------------------
  |  Branch (46:10): [True: 382, False: 396k]
  ------------------
   47|    382|    throw ParserException(m_scanner.mark(), ErrorMsg::UNEXPECTED_TOKEN_AFTER_DOC);
   48|       |
   49|       |  // and finally eat any doc ends we see
   50|   482k|  if (!m_scanner.empty() && m_scanner.peek().type == Token::DOC_END)
  ------------------
  |  Branch (50:7): [True: 478k, False: 4.57k]
  |  Branch (50:29): [True: 81.5k, False: 396k]
  ------------------
   51|  81.5k|    m_scanner.pop();
   52|   482k|}
_ZN4YAML15SingleDocParser10HandleNodeERNS_12EventHandlerE:
   54|  2.12M|void SingleDocParser::HandleNode(EventHandler& eventHandler) {
   55|  2.12M|  DepthGuard<500> depthguard(depth, m_scanner.mark(), ErrorMsg::BAD_FILE);
   56|       |
   57|       |  // an empty node *is* a possibility
   58|  2.12M|  if (m_scanner.empty()) {
  ------------------
  |  Branch (58:7): [True: 71, False: 2.12M]
  ------------------
   59|     71|    eventHandler.OnNull(m_scanner.mark(), NullAnchor);
   60|     71|    return;
   61|     71|  }
   62|       |
   63|       |  // save location
   64|  2.12M|  Mark mark = m_scanner.peek().mark;
   65|       |
   66|       |  // special case: a value node by itself must be a map, with no header
   67|  2.12M|  if (m_scanner.peek().type == Token::VALUE) {
  ------------------
  |  Branch (67:7): [True: 3.35k, False: 2.12M]
  ------------------
   68|  3.35k|    eventHandler.OnMapStart(mark, "?", NullAnchor, EmitterStyle::Default);
   69|  3.35k|    HandleMap(eventHandler);
   70|  3.35k|    eventHandler.OnMapEnd();
   71|  3.35k|    return;
   72|  3.35k|  }
   73|       |
   74|       |  // special case: an alias node
   75|  2.12M|  if (m_scanner.peek().type == Token::ALIAS) {
  ------------------
  |  Branch (75:7): [True: 1.50k, False: 2.12M]
  ------------------
   76|  1.50k|    eventHandler.OnAlias(mark, LookupAnchor(mark, m_scanner.peek().value));
   77|  1.50k|    m_scanner.pop();
   78|  1.50k|    return;
   79|  1.50k|  }
   80|       |
   81|  2.12M|  std::string tag;
   82|  2.12M|  std::string anchor_name;
   83|  2.12M|  anchor_t anchor;
   84|  2.12M|  ParseProperties(tag, anchor, anchor_name);
   85|       |
   86|  2.12M|  if (!anchor_name.empty())
  ------------------
  |  Branch (86:7): [True: 387k, False: 1.73M]
  ------------------
   87|   387k|    eventHandler.OnAnchor(mark, anchor_name);
   88|       |
   89|       |  // after parsing properties, an empty node is again a possibility
   90|  2.12M|  if (m_scanner.empty()) {
  ------------------
  |  Branch (90:7): [True: 717, False: 2.12M]
  ------------------
   91|    717|    eventHandler.OnNull(mark, anchor);
   92|    717|    return;
   93|    717|  }
   94|       |
   95|  2.12M|  const Token& token = m_scanner.peek();
   96|       |
   97|       |  // add non-specific tags
   98|  2.12M|  if (tag.empty())
  ------------------
  |  Branch (98:7): [True: 2.11M, False: 6.97k]
  ------------------
   99|  2.11M|    tag = (token.type == Token::NON_PLAIN_SCALAR ? "!" : "?");
  ------------------
  |  Branch (99:12): [True: 1.06k, False: 2.11M]
  ------------------
  100|       |
  101|  2.12M|  if (token.type == Token::PLAIN_SCALAR
  ------------------
  |  Branch (101:7): [True: 435k, False: 1.68M]
  ------------------
  102|   435k|      && tag.compare("?") == 0 && IsNullString(token.value.data(), token.value.size())) {
  ------------------
  |  Branch (102:10): [True: 434k, False: 1.03k]
  |  Branch (102:35): [True: 12.5k, False: 422k]
  ------------------
  103|  12.5k|    eventHandler.OnNull(mark, anchor);
  104|  12.5k|    m_scanner.pop();
  105|  12.5k|    return;
  106|  12.5k|  }
  107|       |
  108|       |  // now split based on what kind of node we should be
  109|  2.10M|  switch (token.type) {
  110|   423k|    case Token::PLAIN_SCALAR:
  ------------------
  |  Branch (110:5): [True: 423k, False: 1.68M]
  ------------------
  111|   424k|    case Token::NON_PLAIN_SCALAR:
  ------------------
  |  Branch (111:5): [True: 1.12k, False: 2.10M]
  ------------------
  112|   424k|      eventHandler.OnScalar(mark, tag, anchor, token.value);
  113|   424k|      m_scanner.pop();
  114|   424k|      return;
  115|  37.6k|    case Token::FLOW_SEQ_START:
  ------------------
  |  Branch (115:5): [True: 37.6k, False: 2.07M]
  ------------------
  116|  37.6k|      eventHandler.OnSequenceStart(mark, tag, anchor, EmitterStyle::Flow);
  117|  37.6k|      HandleSequence(eventHandler);
  118|  37.6k|      eventHandler.OnSequenceEnd();
  119|  37.6k|      return;
  120|  16.7k|    case Token::BLOCK_SEQ_START:
  ------------------
  |  Branch (120:5): [True: 16.7k, False: 2.09M]
  ------------------
  121|  16.7k|      eventHandler.OnSequenceStart(mark, tag, anchor, EmitterStyle::Block);
  122|  16.7k|      HandleSequence(eventHandler);
  123|  16.7k|      eventHandler.OnSequenceEnd();
  124|  16.7k|      return;
  125|  43.4k|    case Token::FLOW_MAP_START:
  ------------------
  |  Branch (125:5): [True: 43.4k, False: 2.06M]
  ------------------
  126|  43.4k|      eventHandler.OnMapStart(mark, tag, anchor, EmitterStyle::Flow);
  127|  43.4k|      HandleMap(eventHandler);
  128|  43.4k|      eventHandler.OnMapEnd();
  129|  43.4k|      return;
  130|  35.3k|    case Token::BLOCK_MAP_START:
  ------------------
  |  Branch (130:5): [True: 35.3k, False: 2.07M]
  ------------------
  131|  35.3k|      eventHandler.OnMapStart(mark, tag, anchor, EmitterStyle::Block);
  132|  35.3k|      HandleMap(eventHandler);
  133|  35.3k|      eventHandler.OnMapEnd();
  134|  35.3k|      return;
  135|  37.7k|    case Token::KEY:
  ------------------
  |  Branch (135:5): [True: 37.7k, False: 2.07M]
  ------------------
  136|       |      // compact maps can only go in a flow sequence
  137|  37.7k|      if (m_pCollectionStack->GetCurCollectionType() ==
  ------------------
  |  Branch (137:11): [True: 36.8k, False: 943]
  ------------------
  138|  37.7k|          CollectionType::FlowSeq) {
  139|  36.8k|        eventHandler.OnMapStart(mark, tag, anchor, EmitterStyle::Flow);
  140|  36.8k|        HandleMap(eventHandler);
  141|  36.8k|        eventHandler.OnMapEnd();
  142|  36.8k|        return;
  143|  36.8k|      }
  144|    943|      break;
  145|  1.51M|    default:
  ------------------
  |  Branch (145:5): [True: 1.51M, False: 595k]
  ------------------
  146|  1.51M|      break;
  147|  2.10M|  }
  148|       |
  149|  1.51M|  if (tag == "?")
  ------------------
  |  Branch (149:7): [True: 1.51M, False: 2.48k]
  ------------------
  150|  1.51M|    eventHandler.OnNull(mark, anchor);
  151|  2.48k|  else
  152|  2.48k|    eventHandler.OnScalar(mark, tag, anchor, "");
  153|  1.51M|}
_ZN4YAML15SingleDocParser14HandleSequenceERNS_12EventHandlerE:
  155|  54.4k|void SingleDocParser::HandleSequence(EventHandler& eventHandler) {
  156|       |  // split based on start token
  157|  54.4k|  switch (m_scanner.peek().type) {
  158|  16.7k|    case Token::BLOCK_SEQ_START:
  ------------------
  |  Branch (158:5): [True: 16.7k, False: 37.6k]
  ------------------
  159|  16.7k|      HandleBlockSequence(eventHandler);
  160|  16.7k|      break;
  161|  37.6k|    case Token::FLOW_SEQ_START:
  ------------------
  |  Branch (161:5): [True: 37.6k, False: 16.7k]
  ------------------
  162|  37.6k|      HandleFlowSequence(eventHandler);
  163|  37.6k|      break;
  164|      0|    default:
  ------------------
  |  Branch (164:5): [True: 0, False: 54.4k]
  ------------------
  165|      0|      break;
  166|  54.4k|  }
  167|  54.4k|}
_ZN4YAML15SingleDocParser19HandleBlockSequenceERNS_12EventHandlerE:
  169|  16.7k|void SingleDocParser::HandleBlockSequence(EventHandler& eventHandler) {
  170|       |  // eat start token
  171|  16.7k|  m_scanner.pop();
  172|  16.7k|  m_pCollectionStack->PushCollectionType(CollectionType::BlockSeq);
  173|       |
  174|  34.8k|  while (true) {
  ------------------
  |  Branch (174:10): [True: 32.6k, Folded]
  ------------------
  175|  32.6k|    if (m_scanner.empty())
  ------------------
  |  Branch (175:9): [True: 0, False: 32.6k]
  ------------------
  176|      0|      throw ParserException(m_scanner.mark(), ErrorMsg::END_OF_SEQ);
  177|       |
  178|  32.6k|    Token token = m_scanner.peek();
  179|  32.6k|    if (token.type != Token::BLOCK_ENTRY && token.type != Token::BLOCK_SEQ_END)
  ------------------
  |  Branch (179:9): [True: 14.6k, False: 18.0k]
  |  Branch (179:45): [True: 11, False: 14.6k]
  ------------------
  180|     11|      throw ParserException(token.mark, ErrorMsg::END_OF_SEQ);
  181|       |
  182|  32.6k|    m_scanner.pop();
  183|  32.6k|    if (token.type == Token::BLOCK_SEQ_END)
  ------------------
  |  Branch (183:9): [True: 14.6k, False: 18.0k]
  ------------------
  184|  14.6k|      break;
  185|       |
  186|       |    // check for null
  187|  18.0k|    if (!m_scanner.empty()) {
  ------------------
  |  Branch (187:9): [True: 17.9k, False: 40]
  ------------------
  188|  17.9k|      const Token& nextToken = m_scanner.peek();
  189|  17.9k|      if (nextToken.type == Token::BLOCK_ENTRY ||
  ------------------
  |  Branch (189:11): [True: 795, False: 17.1k]
  ------------------
  190|  17.1k|          nextToken.type == Token::BLOCK_SEQ_END) {
  ------------------
  |  Branch (190:11): [True: 4.16k, False: 13.0k]
  ------------------
  191|  4.95k|        eventHandler.OnNull(nextToken.mark, NullAnchor);
  192|  4.95k|        continue;
  193|  4.95k|      }
  194|  17.9k|    }
  195|       |
  196|  13.0k|    HandleNode(eventHandler);
  197|  13.0k|  }
  198|       |
  199|  16.7k|  m_pCollectionStack->PopCollectionType(CollectionType::BlockSeq);
  200|  16.7k|}
_ZN4YAML15SingleDocParser18HandleFlowSequenceERNS_12EventHandlerE:
  202|  37.6k|void SingleDocParser::HandleFlowSequence(EventHandler& eventHandler) {
  203|       |  // eat start token
  204|  37.6k|  m_scanner.pop();
  205|  37.6k|  m_pCollectionStack->PushCollectionType(CollectionType::FlowSeq);
  206|       |
  207|  1.50M|  while (true) {
  ------------------
  |  Branch (207:10): [True: 1.46M, Folded]
  ------------------
  208|  1.46M|    if (m_scanner.empty())
  ------------------
  |  Branch (208:9): [True: 185, False: 1.46M]
  ------------------
  209|    185|      throw ParserException(m_scanner.mark(), ErrorMsg::END_OF_SEQ_FLOW);
  210|       |
  211|       |    // first check for end
  212|  1.46M|    if (m_scanner.peek().type == Token::FLOW_SEQ_END) {
  ------------------
  |  Branch (212:9): [True: 919, False: 1.46M]
  ------------------
  213|    919|      m_scanner.pop();
  214|    919|      break;
  215|    919|    }
  216|       |
  217|       |    // then read the node
  218|  1.46M|    HandleNode(eventHandler);
  219|       |
  220|  1.46M|    if (m_scanner.empty())
  ------------------
  |  Branch (220:9): [True: 633, False: 1.46M]
  ------------------
  221|    633|      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.46M|    Token& token = m_scanner.peek();
  226|  1.46M|    if (token.type == Token::FLOW_ENTRY)
  ------------------
  |  Branch (226:9): [True: 1.43M, False: 36.7k]
  ------------------
  227|  1.43M|      m_scanner.pop();
  228|  36.7k|    else if (token.type != Token::FLOW_SEQ_END)
  ------------------
  |  Branch (228:14): [True: 197, False: 36.5k]
  ------------------
  229|    197|      throw ParserException(token.mark, ErrorMsg::END_OF_SEQ_FLOW);
  230|  1.46M|  }
  231|       |
  232|  36.6k|  m_pCollectionStack->PopCollectionType(CollectionType::FlowSeq);
  233|  36.6k|}
_ZN4YAML15SingleDocParser9HandleMapERNS_12EventHandlerE:
  235|   118k|void SingleDocParser::HandleMap(EventHandler& eventHandler) {
  236|       |  // split based on start token
  237|   118k|  switch (m_scanner.peek().type) {
  238|  35.3k|    case Token::BLOCK_MAP_START:
  ------------------
  |  Branch (238:5): [True: 35.3k, False: 83.5k]
  ------------------
  239|  35.3k|      HandleBlockMap(eventHandler);
  240|  35.3k|      break;
  241|  43.4k|    case Token::FLOW_MAP_START:
  ------------------
  |  Branch (241:5): [True: 43.4k, False: 75.4k]
  ------------------
  242|  43.4k|      HandleFlowMap(eventHandler);
  243|  43.4k|      break;
  244|  36.8k|    case Token::KEY:
  ------------------
  |  Branch (244:5): [True: 36.8k, False: 82.0k]
  ------------------
  245|  36.8k|      HandleCompactMap(eventHandler);
  246|  36.8k|      break;
  247|  3.35k|    case Token::VALUE:
  ------------------
  |  Branch (247:5): [True: 3.35k, False: 115k]
  ------------------
  248|  3.35k|      HandleCompactMapWithNoKey(eventHandler);
  249|  3.35k|      break;
  250|      0|    default:
  ------------------
  |  Branch (250:5): [True: 0, False: 118k]
  ------------------
  251|      0|      break;
  252|   118k|  }
  253|   118k|}
_ZN4YAML15SingleDocParser14HandleBlockMapERNS_12EventHandlerE:
  255|  35.3k|void SingleDocParser::HandleBlockMap(EventHandler& eventHandler) {
  256|       |  // eat start token
  257|  35.3k|  m_scanner.pop();
  258|  35.3k|  m_pCollectionStack->PushCollectionType(CollectionType::BlockMap);
  259|       |
  260|  76.2k|  while (true) {
  ------------------
  |  Branch (260:10): [True: 72.4k, Folded]
  ------------------
  261|  72.4k|    if (m_scanner.empty())
  ------------------
  |  Branch (261:9): [True: 0, False: 72.4k]
  ------------------
  262|      0|      throw ParserException(m_scanner.mark(), ErrorMsg::END_OF_MAP);
  263|       |
  264|  72.4k|    Token token = m_scanner.peek();
  265|  72.4k|    if (token.type != Token::KEY && token.type != Token::VALUE &&
  ------------------
  |  Branch (265:9): [True: 51.9k, False: 20.4k]
  |  Branch (265:37): [True: 31.4k, False: 20.5k]
  ------------------
  266|  31.4k|        token.type != Token::BLOCK_MAP_END)
  ------------------
  |  Branch (266:9): [True: 99, False: 31.3k]
  ------------------
  267|     99|      throw ParserException(token.mark, ErrorMsg::END_OF_MAP);
  268|       |
  269|  72.3k|    if (token.type == Token::BLOCK_MAP_END) {
  ------------------
  |  Branch (269:9): [True: 31.3k, False: 40.9k]
  ------------------
  270|  31.3k|      m_scanner.pop();
  271|  31.3k|      break;
  272|  31.3k|    }
  273|       |
  274|       |    // grab key (if non-null)
  275|  40.9k|    if (token.type == Token::KEY) {
  ------------------
  |  Branch (275:9): [True: 20.4k, False: 20.5k]
  ------------------
  276|  20.4k|      m_scanner.pop();
  277|  20.4k|      HandleNode(eventHandler);
  278|  20.5k|    } else {
  279|  20.5k|      eventHandler.OnNull(token.mark, NullAnchor);
  280|  20.5k|    }
  281|       |
  282|       |    // now grab value (optional)
  283|  40.9k|    if (!m_scanner.empty() && m_scanner.peek().type == Token::VALUE) {
  ------------------
  |  Branch (283:9): [True: 38.4k, False: 2.53k]
  |  Branch (283:31): [True: 30.2k, False: 8.13k]
  ------------------
  284|  30.2k|      m_scanner.pop();
  285|  30.2k|      HandleNode(eventHandler);
  286|  30.2k|    } else {
  287|  10.6k|      eventHandler.OnNull(token.mark, NullAnchor);
  288|  10.6k|    }
  289|  40.9k|  }
  290|       |
  291|  35.2k|  m_pCollectionStack->PopCollectionType(CollectionType::BlockMap);
  292|  35.2k|}
_ZN4YAML15SingleDocParser13HandleFlowMapERNS_12EventHandlerE:
  294|  43.4k|void SingleDocParser::HandleFlowMap(EventHandler& eventHandler) {
  295|       |  // eat start token
  296|  43.4k|  m_scanner.pop();
  297|  43.4k|  m_pCollectionStack->PushCollectionType(CollectionType::FlowMap);
  298|       |
  299|   668k|  while (true) {
  ------------------
  |  Branch (299:10): [True: 627k, Folded]
  ------------------
  300|   627k|    if (m_scanner.empty())
  ------------------
  |  Branch (300:9): [True: 157, False: 627k]
  ------------------
  301|    157|      throw ParserException(m_scanner.mark(), ErrorMsg::END_OF_MAP_FLOW);
  302|       |
  303|   627k|    Token& token = m_scanner.peek();
  304|   627k|    const Mark mark = token.mark;
  305|       |    // first check for end
  306|   627k|    if (token.type == Token::FLOW_MAP_END) {
  ------------------
  |  Branch (306:9): [True: 1.21k, False: 625k]
  ------------------
  307|  1.21k|      m_scanner.pop();
  308|  1.21k|      break;
  309|  1.21k|    }
  310|       |
  311|       |    // grab key (if non-null)
  312|   625k|    if (token.type == Token::KEY) {
  ------------------
  |  Branch (312:9): [True: 57.4k, False: 568k]
  ------------------
  313|  57.4k|      m_scanner.pop();
  314|  57.4k|      HandleNode(eventHandler);
  315|   568k|    } else {
  316|   568k|      eventHandler.OnNull(mark, NullAnchor);
  317|   568k|    }
  318|       |
  319|       |    // now grab value (optional)
  320|   625k|    if (!m_scanner.empty() && m_scanner.peek().type == Token::VALUE) {
  ------------------
  |  Branch (320:9): [True: 583k, False: 41.8k]
  |  Branch (320:31): [True: 15.5k, False: 568k]
  ------------------
  321|  15.5k|      m_scanner.pop();
  322|  15.5k|      HandleNode(eventHandler);
  323|   610k|    } else {
  324|   610k|      eventHandler.OnNull(mark, NullAnchor);
  325|   610k|    }
  326|       |
  327|   625k|    if (m_scanner.empty())
  ------------------
  |  Branch (327:9): [True: 255, False: 625k]
  ------------------
  328|    255|      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|   625k|    Token& nextToken = m_scanner.peek();
  333|   625k|    if (nextToken.type == Token::FLOW_ENTRY)
  ------------------
  |  Branch (333:9): [True: 582k, False: 42.7k]
  ------------------
  334|   582k|      m_scanner.pop();
  335|  42.7k|    else if (nextToken.type != Token::FLOW_MAP_END)
  ------------------
  |  Branch (335:14): [True: 187, False: 42.5k]
  ------------------
  336|    187|      throw ParserException(nextToken.mark, ErrorMsg::END_OF_MAP_FLOW);
  337|   625k|  }
  338|       |
  339|  42.8k|  m_pCollectionStack->PopCollectionType(CollectionType::FlowMap);
  340|  42.8k|}
_ZN4YAML15SingleDocParser16HandleCompactMapERNS_12EventHandlerE:
  343|  36.8k|void SingleDocParser::HandleCompactMap(EventHandler& eventHandler) {
  344|  36.8k|  m_pCollectionStack->PushCollectionType(CollectionType::CompactMap);
  345|       |
  346|       |  // grab key
  347|  36.8k|  Mark mark = m_scanner.peek().mark;
  348|  36.8k|  m_scanner.pop();
  349|  36.8k|  HandleNode(eventHandler);
  350|       |
  351|       |  // now grab value (optional)
  352|  36.8k|  if (!m_scanner.empty() && m_scanner.peek().type == Token::VALUE) {
  ------------------
  |  Branch (352:7): [True: 796, False: 36.0k]
  |  Branch (352:29): [True: 390, False: 406]
  ------------------
  353|    390|    m_scanner.pop();
  354|    390|    HandleNode(eventHandler);
  355|  36.4k|  } else {
  356|  36.4k|    eventHandler.OnNull(mark, NullAnchor);
  357|  36.4k|  }
  358|       |
  359|  36.8k|  m_pCollectionStack->PopCollectionType(CollectionType::CompactMap);
  360|  36.8k|}
_ZN4YAML15SingleDocParser25HandleCompactMapWithNoKeyERNS_12EventHandlerE:
  363|  3.35k|void SingleDocParser::HandleCompactMapWithNoKey(EventHandler& eventHandler) {
  364|  3.35k|  m_pCollectionStack->PushCollectionType(CollectionType::CompactMap);
  365|       |
  366|       |  // null key
  367|  3.35k|  eventHandler.OnNull(m_scanner.peek().mark, NullAnchor);
  368|       |
  369|       |  // grab value
  370|  3.35k|  m_scanner.pop();
  371|  3.35k|  HandleNode(eventHandler);
  372|       |
  373|  3.35k|  m_pCollectionStack->PopCollectionType(CollectionType::CompactMap);
  374|  3.35k|}
_ZN4YAML15SingleDocParser15ParsePropertiesERNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERmS8_:
  379|  2.12M|                                      std::string& anchor_name) {
  380|  2.12M|  tag.clear();
  381|  2.12M|  anchor_name.clear();
  382|  2.12M|  anchor = NullAnchor;
  383|       |
  384|  2.51M|  while (true) {
  ------------------
  |  Branch (384:10): [True: 2.51M, Folded]
  ------------------
  385|  2.51M|    if (m_scanner.empty())
  ------------------
  |  Branch (385:9): [True: 717, False: 2.51M]
  ------------------
  386|    717|      return;
  387|       |
  388|  2.51M|    switch (m_scanner.peek().type) {
  389|  7.34k|      case Token::TAG:
  ------------------
  |  Branch (389:7): [True: 7.34k, False: 2.50M]
  ------------------
  390|  7.34k|        ParseTag(tag);
  391|  7.34k|        break;
  392|   387k|      case Token::ANCHOR:
  ------------------
  |  Branch (392:7): [True: 387k, False: 2.12M]
  ------------------
  393|   387k|        ParseAnchor(anchor, anchor_name);
  394|   387k|        break;
  395|  2.12M|      default:
  ------------------
  |  Branch (395:7): [True: 2.12M, False: 395k]
  ------------------
  396|  2.12M|        return;
  397|  2.51M|    }
  398|  2.51M|  }
  399|  2.12M|}
_ZN4YAML15SingleDocParser8ParseTagERNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
  401|  7.34k|void SingleDocParser::ParseTag(std::string& tag) {
  402|  7.34k|  Token& token = m_scanner.peek();
  403|  7.34k|  if (!tag.empty())
  ------------------
  |  Branch (403:7): [True: 62, False: 7.28k]
  ------------------
  404|     62|    throw ParserException(token.mark, ErrorMsg::MULTIPLE_TAGS);
  405|       |
  406|  7.28k|  Tag tagInfo(token);
  407|  7.28k|  tag = tagInfo.Translate(m_directives);
  408|  7.28k|  m_scanner.pop();
  409|  7.28k|}
_ZN4YAML15SingleDocParser11ParseAnchorERmRNSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEE:
  411|   387k|void SingleDocParser::ParseAnchor(anchor_t& anchor, std::string& anchor_name) {
  412|   387k|  Token& token = m_scanner.peek();
  413|   387k|  if (anchor)
  ------------------
  |  Branch (413:7): [True: 17, False: 387k]
  ------------------
  414|     17|    throw ParserException(token.mark, ErrorMsg::MULTIPLE_ANCHORS);
  415|       |
  416|   387k|  anchor_name = token.value;
  417|   387k|  anchor = RegisterAnchor(token.value);
  418|   387k|  m_scanner.pop();
  419|   387k|}
_ZN4YAML15SingleDocParser14RegisterAnchorERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
  421|   387k|anchor_t SingleDocParser::RegisterAnchor(const std::string& name) {
  422|   387k|  if (name.empty())
  ------------------
  |  Branch (422:7): [True: 0, False: 387k]
  ------------------
  423|      0|    return NullAnchor;
  424|       |
  425|   387k|  return m_anchors[name] = ++m_curAnchor;
  426|   387k|}
_ZNK4YAML15SingleDocParser12LookupAnchorERKNS_4MarkERKNSt3__112basic_stringIcNS4_11char_traitsIcEENS4_9allocatorIcEEEE:
  429|  1.50k|                                       const std::string& name) const {
  430|  1.50k|  auto it = m_anchors.find(name);
  431|  1.50k|  if (it == m_anchors.end()) {
  ------------------
  |  Branch (431:7): [True: 333, False: 1.16k]
  ------------------
  432|    333|    std::stringstream ss;
  433|    333|    ss << ErrorMsg::UNKNOWN_ANCHOR << name;
  434|    333|    throw ParserException(mark, ss.str());
  435|    333|  }
  436|       |
  437|  1.16k|  return it->second;
  438|  1.50k|}

_ZN4YAML6StreamC2ERNSt3__113basic_istreamIcNS1_11char_traitsIcEEEE:
  186|  6.57k|    : m_input(input),
  187|  6.57k|      m_mark{},
  188|  6.57k|      m_charSet{},
  189|  6.57k|      m_readahead{},
  190|  6.57k|      m_pPrefetched(new unsigned char[YAML_PREFETCH_SIZE]),
  ------------------
  |  |    6|  6.57k|#define YAML_PREFETCH_SIZE 2048
  ------------------
  191|  6.57k|      m_nPrefetchedAvailable(0),
  192|  6.57k|      m_nPrefetchedUsed(0) {
  193|  6.57k|  using char_traits = std::istream::traits_type;
  194|       |
  195|  6.57k|  if (!input)
  ------------------
  |  Branch (195:7): [True: 0, False: 6.57k]
  ------------------
  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.57k|  char_traits::int_type intro[4]{};
  201|  6.57k|  int nIntroUsed = 0;
  202|  6.57k|  UtfIntroState state = uis_start;
  203|  20.7k|  for (; !s_introFinalState[state];) {
  ------------------
  |  Branch (203:10): [True: 14.1k, False: 6.57k]
  ------------------
  204|  14.1k|    std::istream::int_type ch = input.get();
  205|  14.1k|    intro[nIntroUsed++] = ch;
  206|  14.1k|    UtfIntroCharType charType = IntroCharTypeOf(ch);
  207|  14.1k|    UtfIntroState newState = s_introTransitions[state][charType];
  208|  14.1k|    int nUngets = s_introUngetCount[state][charType];
  209|  14.1k|    if (nUngets > 0) {
  ------------------
  |  Branch (209:9): [True: 6.55k, False: 7.57k]
  ------------------
  210|  6.55k|      input.clear();
  211|  20.6k|      for (; nUngets > 0; --nUngets) {
  ------------------
  |  Branch (211:14): [True: 14.0k, False: 6.55k]
  ------------------
  212|  14.0k|        if (char_traits::eof() != intro[--nIntroUsed])
  ------------------
  |  Branch (212:13): [True: 13.9k, False: 87]
  ------------------
  213|  13.9k|          input.putback(char_traits::to_char_type(intro[nIntroUsed]));
  214|  14.0k|      }
  215|  6.55k|    }
  216|  14.1k|    state = newState;
  217|  14.1k|  }
  218|       |
  219|  6.57k|  switch (state) {
  220|  5.23k|    case uis_utf8:
  ------------------
  |  Branch (220:5): [True: 5.23k, False: 1.33k]
  ------------------
  221|  5.23k|      m_charSet = utf8;
  222|  5.23k|      break;
  223|    726|    case uis_utf16le:
  ------------------
  |  Branch (223:5): [True: 726, False: 5.84k]
  ------------------
  224|    726|      m_charSet = utf16le;
  225|    726|      break;
  226|    473|    case uis_utf16be:
  ------------------
  |  Branch (226:5): [True: 473, False: 6.10k]
  ------------------
  227|    473|      m_charSet = utf16be;
  228|    473|      break;
  229|     73|    case uis_utf32le:
  ------------------
  |  Branch (229:5): [True: 73, False: 6.50k]
  ------------------
  230|     73|      m_charSet = utf32le;
  231|     73|      break;
  232|     67|    case uis_utf32be:
  ------------------
  |  Branch (232:5): [True: 67, False: 6.50k]
  ------------------
  233|     67|      m_charSet = utf32be;
  234|     67|      break;
  235|      0|    default:
  ------------------
  |  Branch (235:5): [True: 0, False: 6.57k]
  ------------------
  236|      0|      m_charSet = utf8;
  237|      0|      break;
  238|  6.57k|  }
  239|       |
  240|  6.57k|  ReadAheadTo(0);
  241|  6.57k|}
_ZN4YAML6StreamD2Ev:
  243|  6.57k|Stream::~Stream() { delete[] m_pPrefetched; }
_ZNK4YAML6Stream4peekEv:
  245|   552M|char Stream::peek() const {
  246|   552M|  if (m_readahead.empty()) {
  ------------------
  |  Branch (246:7): [True: 0, False: 552M]
  ------------------
  247|      0|    return Stream::eof();
  248|      0|  }
  249|       |
  250|   552M|  return m_readahead[0];
  251|   552M|}
_ZNK4YAML6StreamcvbEv:
  253|   319M|Stream::operator bool() const {
  254|   319M|  return m_input.good() ||
  ------------------
  |  Branch (254:10): [True: 304M, False: 15.5M]
  ------------------
  255|  15.5M|         (!m_readahead.empty() && m_readahead[0] != Stream::eof());
  ------------------
  |  Branch (255:11): [True: 15.5M, False: 0]
  |  Branch (255:35): [True: 15.5M, False: 18.6k]
  ------------------
  256|   319M|}
_ZN4YAML6Stream3getEv:
  260|   232M|char Stream::get() {
  261|   232M|  char ch = peek();
  262|   232M|  AdvanceCurrent();
  263|   232M|  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|   232M|  if (!m_lineEndingSymbol) {
  ------------------
  |  Branch (269:7): [True: 121M, False: 110M]
  ------------------
  270|   121M|    if (ch == '\n') { // line ending is '\n'
  ------------------
  |  Branch (270:9): [True: 1.71k, False: 121M]
  ------------------
  271|  1.71k|      m_lineEndingSymbol = '\n';
  272|   121M|    } else if (ch == '\r') {
  ------------------
  |  Branch (272:16): [True: 1.03k, False: 121M]
  ------------------
  273|  1.03k|      auto ch2 = peek();
  274|  1.03k|      if (ch2 == '\n') { // line ending is '\r\n'
  ------------------
  |  Branch (274:11): [True: 15, False: 1.01k]
  ------------------
  275|     15|        m_lineEndingSymbol = '\n';
  276|  1.01k|      } else { // line ending is '\r'
  277|  1.01k|        m_lineEndingSymbol = '\r';
  278|  1.01k|      }
  279|  1.03k|    }
  280|   121M|  }
  281|       |
  282|   232M|  if (ch == m_lineEndingSymbol) {
  ------------------
  |  Branch (282:7): [True: 12.5M, False: 219M]
  ------------------
  283|  12.5M|    m_mark.column = 0;
  284|  12.5M|    m_mark.line++;
  285|  12.5M|  }
  286|       |
  287|   232M|  return ch;
  288|   232M|}
_ZN4YAML6Stream3getEi:
  292|  9.27M|std::string Stream::get(int n) {
  293|  9.27M|  std::string ret;
  294|  9.27M|  if (n > 0) {
  ------------------
  |  Branch (294:7): [True: 9.27M, False: 0]
  ------------------
  295|  9.27M|    ret.reserve(static_cast<std::string::size_type>(n));
  296|  18.5M|    for (int i = 0; i < n; i++)
  ------------------
  |  Branch (296:21): [True: 9.27M, False: 9.27M]
  ------------------
  297|  9.27M|      ret += get();
  298|  9.27M|  }
  299|  9.27M|  return ret;
  300|  9.27M|}
_ZN4YAML6Stream3eatEi:
  304|  48.6M|void Stream::eat(int n) {
  305|  98.2M|  for (int i = 0; i < n; i++)
  ------------------
  |  Branch (305:19): [True: 49.6M, False: 48.6M]
  ------------------
  306|  49.6M|    get();
  307|  48.6M|}
_ZN4YAML6Stream14AdvanceCurrentEv:
  309|   232M|void Stream::AdvanceCurrent() {
  310|   232M|  if (!m_readahead.empty()) {
  ------------------
  |  Branch (310:7): [True: 232M, False: 0]
  ------------------
  311|   232M|    m_readahead.pop_front();
  312|   232M|    m_mark.pos++;
  313|   232M|  }
  314|       |
  315|   232M|  ReadAheadTo(0);
  316|   232M|}
_ZNK4YAML6Stream12_ReadAheadToEm:
  318|   148M|bool Stream::_ReadAheadTo(size_t i) const {
  319|   297M|  while (m_input.good() && (m_readahead.size() <= i)) {
  ------------------
  |  Branch (319:10): [True: 297M, False: 6.71k]
  |  Branch (319:28): [True: 148M, False: 148M]
  ------------------
  320|   148M|    switch (m_charSet) {
  ------------------
  |  Branch (320:13): [True: 148M, False: 0]
  ------------------
  321|   129M|      case utf8:
  ------------------
  |  Branch (321:7): [True: 129M, False: 18.6M]
  ------------------
  322|   129M|        StreamInUtf8();
  323|   129M|        break;
  324|  9.48M|      case utf16le:
  ------------------
  |  Branch (324:7): [True: 9.48M, False: 139M]
  ------------------
  325|  9.48M|        StreamInUtf16();
  326|  9.48M|        break;
  327|  7.11M|      case utf16be:
  ------------------
  |  Branch (327:7): [True: 7.11M, False: 141M]
  ------------------
  328|  7.11M|        StreamInUtf16();
  329|  7.11M|        break;
  330|   741k|      case utf32le:
  ------------------
  |  Branch (330:7): [True: 741k, False: 147M]
  ------------------
  331|   741k|        StreamInUtf32();
  332|   741k|        break;
  333|  1.35M|      case utf32be:
  ------------------
  |  Branch (333:7): [True: 1.35M, False: 147M]
  ------------------
  334|  1.35M|        StreamInUtf32();
  335|  1.35M|        break;
  336|   148M|    }
  337|   148M|  }
  338|       |
  339|       |  // signal end of stream
  340|   148M|  if (!m_input.good())
  ------------------
  |  Branch (340:7): [True: 6.71k, False: 148M]
  ------------------
  341|  6.71k|    m_readahead.push_back(Stream::eof());
  342|       |
  343|   148M|  return m_readahead.size() > i;
  344|   148M|}
_ZNK4YAML6Stream12StreamInUtf8Ev:
  346|   129M|void Stream::StreamInUtf8() const {
  347|   129M|  unsigned char b = GetNextByte();
  348|   129M|  if (m_input.good()) {
  ------------------
  |  Branch (348:7): [True: 129M, False: 4.98k]
  ------------------
  349|   129M|    m_readahead.push_back(static_cast<char>(b));
  350|   129M|  }
  351|   129M|}
_ZNK4YAML6Stream13StreamInUtf16Ev:
  353|  16.5M|void Stream::StreamInUtf16() const {
  354|  16.5M|  unsigned long ch = 0;
  355|  16.5M|  unsigned char bytes[2];
  356|  16.5M|  int nBigEnd = (m_charSet == utf16be) ? 0 : 1;
  ------------------
  |  Branch (356:17): [True: 7.11M, False: 9.48M]
  ------------------
  357|       |
  358|  16.5M|  bytes[0] = GetNextByte();
  359|  16.5M|  bytes[1] = GetNextByte();
  360|  16.5M|  if (!m_input.good()) {
  ------------------
  |  Branch (360:7): [True: 806, False: 16.5M]
  ------------------
  361|    806|    return;
  362|    806|  }
  363|  16.5M|  ch = (static_cast<unsigned long>(bytes[nBigEnd]) << 8) |
  364|  16.5M|       static_cast<unsigned long>(bytes[1 ^ nBigEnd]);
  365|       |
  366|  16.5M|  if (ch >= 0xDC00 && ch < 0xE000) {
  ------------------
  |  Branch (366:7): [True: 176k, False: 16.4M]
  |  Branch (366:23): [True: 10.1k, False: 165k]
  ------------------
  367|       |    // Trailing (low) surrogate...ugh, wrong order
  368|  10.1k|    QueueUnicodeCodepoint(m_readahead, CP_REPLACEMENT_CHARACTER);
  ------------------
  |  |   12|  10.1k|#define CP_REPLACEMENT_CHARACTER (0xFFFD)
  ------------------
  369|  10.1k|    return;
  370|  10.1k|  }
  371|       |
  372|  16.5M|  if (ch >= 0xD800 && ch < 0xDC00) {
  ------------------
  |  Branch (372:7): [True: 186k, False: 16.4M]
  |  Branch (372:23): [True: 20.5k, False: 165k]
  ------------------
  373|       |    // ch is a leading (high) surrogate
  374|       |
  375|       |    // Four byte UTF-8 code point
  376|       |
  377|       |    // Read the trailing (low) surrogate
  378|  18.6M|    for (;;) {
  379|  18.6M|      bytes[0] = GetNextByte();
  380|  18.6M|      bytes[1] = GetNextByte();
  381|  18.6M|      if (!m_input.good()) {
  ------------------
  |  Branch (381:11): [True: 317, False: 18.6M]
  ------------------
  382|    317|        QueueUnicodeCodepoint(m_readahead, CP_REPLACEMENT_CHARACTER);
  ------------------
  |  |   12|    317|#define CP_REPLACEMENT_CHARACTER (0xFFFD)
  ------------------
  383|    317|        return;
  384|    317|      }
  385|  18.6M|      unsigned long chLow = (static_cast<unsigned long>(bytes[nBigEnd]) << 8) |
  386|  18.6M|                            static_cast<unsigned long>(bytes[1 ^ nBigEnd]);
  387|  18.6M|      if (chLow < 0xDC00 || chLow >= 0xE000) {
  ------------------
  |  Branch (387:11): [True: 18.6M, False: 4.16k]
  |  Branch (387:29): [True: 2.49k, False: 1.66k]
  ------------------
  388|       |        // Trouble...not a low surrogate.  Dump a REPLACEMENT CHARACTER into the
  389|       |        // stream.
  390|  18.6M|        QueueUnicodeCodepoint(m_readahead, CP_REPLACEMENT_CHARACTER);
  ------------------
  |  |   12|  18.6M|#define CP_REPLACEMENT_CHARACTER (0xFFFD)
  ------------------
  391|       |
  392|       |        // Deal with the next UTF-16 unit
  393|  18.6M|        if (chLow < 0xD800 || chLow >= 0xE000) {
  ------------------
  |  Branch (393:13): [True: 16.1k, False: 18.6M]
  |  Branch (393:31): [True: 2.49k, False: 18.6M]
  ------------------
  394|       |          // Easiest case: queue the codepoint and return
  395|  18.6k|          QueueUnicodeCodepoint(m_readahead, ch);
  396|  18.6k|          return;
  397|  18.6k|        }
  398|       |        // Start the loop over with the new high surrogate
  399|  18.6M|        ch = chLow;
  400|  18.6M|        continue;
  401|  18.6M|      }
  402|       |
  403|       |      // Select the payload bits from the high surrogate
  404|  1.66k|      ch &= 0x3FF;
  405|  1.66k|      ch <<= 10;
  406|       |
  407|       |      // Include bits from low surrogate
  408|  1.66k|      ch |= (chLow & 0x3FF);
  409|       |
  410|       |      // Add the surrogacy offset
  411|  1.66k|      ch += 0x10000;
  412|  1.66k|      break;
  413|  18.6M|    }
  414|  20.5k|  }
  415|       |
  416|  16.5M|  QueueUnicodeCodepoint(m_readahead, ch);
  417|  16.5M|}
_ZNK4YAML6Stream11GetNextByteEv:
  423|   208M|unsigned char Stream::GetNextByte() const {
  424|   208M|  if (m_nPrefetchedUsed >= m_nPrefetchedAvailable) {
  ------------------
  |  Branch (424:7): [True: 114k, False: 208M]
  ------------------
  425|   114k|    std::streambuf* pBuf = m_input.rdbuf();
  426|   114k|    m_nPrefetchedAvailable = static_cast<std::size_t>(
  427|   114k|        pBuf->sgetn(ReadBuffer(m_pPrefetched), YAML_PREFETCH_SIZE));
  ------------------
  |  |    6|   114k|#define YAML_PREFETCH_SIZE 2048
  ------------------
  428|   114k|    m_nPrefetchedUsed = 0;
  429|   114k|    if (!m_nPrefetchedAvailable) {
  ------------------
  |  Branch (429:9): [True: 7.34k, False: 107k]
  ------------------
  430|  7.34k|      m_input.setstate(std::ios_base::eofbit);
  431|  7.34k|    }
  432|       |
  433|   114k|    if (0 == m_nPrefetchedAvailable) {
  ------------------
  |  Branch (433:9): [True: 7.34k, False: 107k]
  ------------------
  434|  7.34k|      return 0;
  435|  7.34k|    }
  436|   114k|  }
  437|       |
  438|   208M|  return m_pPrefetched[m_nPrefetchedUsed++];
  439|   208M|}
_ZNK4YAML6Stream13StreamInUtf32Ev:
  441|  2.09M|void Stream::StreamInUtf32() const {
  442|  2.09M|  static int indexes[2][4] = {{3, 2, 1, 0}, {0, 1, 2, 3}};
  443|       |
  444|  2.09M|  unsigned long ch = 0;
  445|  2.09M|  unsigned char bytes[4];
  446|  2.09M|  int* pIndexes = (m_charSet == utf32be) ? indexes[1] : indexes[0];
  ------------------
  |  Branch (446:19): [True: 1.35M, False: 741k]
  ------------------
  447|       |
  448|  2.09M|  bytes[0] = GetNextByte();
  449|  2.09M|  bytes[1] = GetNextByte();
  450|  2.09M|  bytes[2] = GetNextByte();
  451|  2.09M|  bytes[3] = GetNextByte();
  452|  2.09M|  if (!m_input.good()) {
  ------------------
  |  Branch (452:7): [True: 134, False: 2.09M]
  ------------------
  453|    134|    return;
  454|    134|  }
  455|       |
  456|  10.4M|  for (int i = 0; i < 4; ++i) {
  ------------------
  |  Branch (456:19): [True: 8.38M, False: 2.09M]
  ------------------
  457|  8.38M|    ch <<= 8;
  458|  8.38M|    ch |= bytes[pIndexes[i]];
  459|  8.38M|  }
  460|       |
  461|  2.09M|  QueueUnicodeCodepoint(m_readahead, ch);
  462|  2.09M|}
_ZN4YAML15IntroCharTypeOfEi:
  125|  14.1k|inline UtfIntroCharType IntroCharTypeOf(std::istream::int_type ch) {
  126|  14.1k|  if (std::istream::traits_type::eof() == ch) {
  ------------------
  |  Branch (126:7): [True: 87, False: 14.0k]
  ------------------
  127|     87|    return uictOther;
  128|     87|  }
  129|       |
  130|  14.0k|  switch (ch) {
  ------------------
  |  Branch (130:11): [True: 2.24k, False: 11.7k]
  ------------------
  131|  1.86k|    case 0:
  ------------------
  |  Branch (131:5): [True: 1.86k, False: 12.1k]
  ------------------
  132|  1.86k|      return uict00;
  133|     13|    case 0xBB:
  ------------------
  |  Branch (133:5): [True: 13, False: 14.0k]
  ------------------
  134|     13|      return uictBB;
  135|      8|    case 0xBF:
  ------------------
  |  Branch (135:5): [True: 8, False: 14.0k]
  ------------------
  136|      8|      return uictBF;
  137|    112|    case 0xEF:
  ------------------
  |  Branch (137:5): [True: 112, False: 13.9k]
  ------------------
  138|    112|      return uictEF;
  139|     54|    case 0xFE:
  ------------------
  |  Branch (139:5): [True: 54, False: 13.9k]
  ------------------
  140|     54|      return uictFE;
  141|    188|    case 0xFF:
  ------------------
  |  Branch (141:5): [True: 188, False: 13.8k]
  ------------------
  142|    188|      return uictFF;
  143|  14.0k|  }
  144|       |
  145|  11.7k|  if ((ch > 0) && (ch < 0xFF)) {
  ------------------
  |  Branch (145:7): [True: 11.7k, False: 0]
  |  Branch (145:19): [True: 11.7k, False: 0]
  ------------------
  146|  11.7k|    return uictAscii;
  147|  11.7k|  }
  148|       |
  149|      0|  return uictOther;
  150|  11.7k|}
_ZN4YAML21QueueUnicodeCodepointERNSt3__15dequeIcNS0_9allocatorIcEEEEm:
  161|  37.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|  37.3M|  if (static_cast<unsigned long>(Stream::eof()) == ch) {
  ------------------
  |  Branch (164:7): [True: 1.15k, False: 37.3M]
  ------------------
  165|  1.15k|    ch = CP_REPLACEMENT_CHARACTER;
  ------------------
  |  |   12|  1.15k|#define CP_REPLACEMENT_CHARACTER (0xFFFD)
  ------------------
  166|  1.15k|  }
  167|       |
  168|  37.3M|  if (ch < 0x80) {
  ------------------
  |  Branch (168:7): [True: 902k, False: 36.4M]
  ------------------
  169|   902k|    q.push_back(Utf8Adjust(ch, 0, 0));
  170|  36.4M|  } else if (ch < 0x800) {
  ------------------
  |  Branch (170:14): [True: 824k, False: 35.6M]
  ------------------
  171|   824k|    q.push_back(Utf8Adjust(ch, 2, 6));
  172|   824k|    q.push_back(Utf8Adjust(ch, 1, 0));
  173|  35.6M|  } else if (ch < 0x10000) {
  ------------------
  |  Branch (173:14): [True: 33.5M, False: 2.09M]
  ------------------
  174|  33.5M|    q.push_back(Utf8Adjust(ch, 3, 12));
  175|  33.5M|    q.push_back(Utf8Adjust(ch, 1, 6));
  176|  33.5M|    q.push_back(Utf8Adjust(ch, 1, 0));
  177|  33.5M|  } else {
  178|  2.09M|    q.push_back(Utf8Adjust(ch, 4, 18));
  179|  2.09M|    q.push_back(Utf8Adjust(ch, 1, 12));
  180|  2.09M|    q.push_back(Utf8Adjust(ch, 1, 6));
  181|  2.09M|    q.push_back(Utf8Adjust(ch, 1, 0));
  182|  2.09M|  }
  183|  37.3M|}
_ZN4YAML10Utf8AdjustEmhh:
  153|   111M|                       unsigned char rshift) {
  154|   111M|  const unsigned char header =
  155|   111M|      static_cast<unsigned char>(((1 << lead_bits) - 1) << (8 - lead_bits));
  156|   111M|  const unsigned char mask = (0xFF >> (lead_bits + 1));
  157|   111M|  return static_cast<char>(
  158|   111M|      static_cast<unsigned char>(header | ((ch >> rshift) & mask)));
  159|   111M|}
_ZN4YAML10ReadBufferEPh:
  419|   114k|inline char* ReadBuffer(unsigned char* pBuffer) {
  420|   114k|  return reinterpret_cast<char*>(pBuffer);
  421|   114k|}

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

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

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

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

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

