LLVMFuzzerTestOneInput:
   18|  3.31k|extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {
   19|  3.31k|  Json::CharReaderBuilder builder;
   20|       |
   21|  3.31k|  if (size < sizeof(uint32_t)) {
  ------------------
  |  Branch (21:7): [True: 2, False: 3.31k]
  ------------------
   22|      2|    return 0;
   23|      2|  }
   24|       |
   25|  3.31k|  const uint32_t hash_settings = static_cast<uint32_t>(data[0]) |
   26|  3.31k|                                 (static_cast<uint32_t>(data[1]) << 8) |
   27|  3.31k|                                 (static_cast<uint32_t>(data[2]) << 16) |
   28|  3.31k|                                 (static_cast<uint32_t>(data[3]) << 24);
   29|  3.31k|  data += sizeof(uint32_t);
   30|  3.31k|  size -= sizeof(uint32_t);
   31|       |
   32|  3.31k|  builder.settings_["failIfExtra"] = hash_settings & (1 << 0);
   33|  3.31k|  builder.settings_["allowComments_"] = hash_settings & (1 << 1);
   34|  3.31k|  builder.settings_["strictRoot_"] = hash_settings & (1 << 2);
   35|  3.31k|  builder.settings_["allowDroppedNullPlaceholders_"] = hash_settings & (1 << 3);
   36|  3.31k|  builder.settings_["allowNumericKeys_"] = hash_settings & (1 << 4);
   37|  3.31k|  builder.settings_["allowSingleQuotes_"] = hash_settings & (1 << 5);
   38|  3.31k|  builder.settings_["failIfExtra_"] = hash_settings & (1 << 6);
   39|  3.31k|  builder.settings_["rejectDupKeys_"] = hash_settings & (1 << 7);
   40|  3.31k|  builder.settings_["allowSpecialFloats_"] = hash_settings & (1 << 8);
   41|  3.31k|  builder.settings_["collectComments"] = hash_settings & (1 << 9);
   42|  3.31k|  builder.settings_["allowTrailingCommas_"] = hash_settings & (1 << 10);
   43|       |
   44|  3.31k|  std::unique_ptr<Json::CharReader> reader(builder.newCharReader());
   45|       |
   46|  3.31k|  Json::Value root;
   47|  3.31k|  const auto data_str = reinterpret_cast<const char*>(data);
   48|  3.31k|  try {
   49|  3.31k|    reader->parse(data_str, data_str + size, &root, nullptr);
   50|  3.31k|  } catch (Json::Exception const&) {
   51|     28|  }
   52|       |  // Whether it succeeded or not doesn't matter.
   53|  3.31k|  return 0;
   54|  3.31k|}

_ZN4Json10CharReader7FactoryD2Ev:
  269|  3.31k|    virtual ~Factory() = default;
_ZN4Json10CharReaderD2Ev:
  247|  3.31k|  virtual ~CharReader() = default;

_ZN4Json5Value7setTypeENS_9ValueTypeE:
  612|  5.02M|  void setType(ValueType v) {
  613|  5.02M|    bits_.value_type_ = static_cast<unsigned char>(v);
  614|  5.02M|  }
_ZNK4Json5Value11isAllocatedEv:
  615|    817|  bool isAllocated() const { return bits_.allocated_; }
_ZN4Json5Value14setIsAllocatedEb:
  616|  5.02M|  void setIsAllocated(bool v) { bits_.allocated_ = v; }
_ZN4Json5Value8CommentsC2Ev:
  653|  7.48M|    Comments() = default;

_ZN4Json11OurFeatures3allEv:
  882|  3.31k|OurFeatures OurFeatures::all() { return {}; }
_ZN4Json9OurReader15containsNewLineEPKcS2_:
 1004|   119k|                                OurReader::Location end) {
 1005|   119k|  return std::any_of(begin, end, [](char b) { return b == '\n' || b == '\r'; });
 1006|   119k|}
_ZN4Json9OurReaderC2ERKNS_11OurFeaturesE:
 1008|  3.31k|OurReader::OurReader(OurFeatures const& features) : features_(features) {}
_ZN4Json9OurReader5parseEPKcS2_RNS_5ValueEb:
 1011|  3.31k|                      bool collectComments) {
 1012|  3.31k|  if (!features_.allowComments_) {
  ------------------
  |  Branch (1012:7): [True: 0, False: 3.31k]
  ------------------
 1013|      0|    collectComments = false;
 1014|      0|  }
 1015|       |
 1016|  3.31k|  begin_ = beginDoc;
 1017|  3.31k|  end_ = endDoc;
 1018|  3.31k|  collectComments_ = collectComments;
 1019|  3.31k|  current_ = begin_;
 1020|  3.31k|  lastValueEnd_ = nullptr;
 1021|  3.31k|  lastValue_ = nullptr;
 1022|  3.31k|  commentsBefore_.clear();
 1023|  3.31k|  errors_.clear();
 1024|  3.31k|  while (!nodes_.empty())
  ------------------
  |  Branch (1024:10): [True: 0, False: 3.31k]
  ------------------
 1025|      0|    nodes_.pop();
 1026|  3.31k|  nodes_.push(&root);
 1027|       |
 1028|       |  // skip byte order mark if it exists at the beginning of the UTF-8 text.
 1029|  3.31k|  skipBom(features_.skipBom_);
 1030|  3.31k|  bool successful = readValue();
 1031|  3.31k|  nodes_.pop();
 1032|  3.31k|  Token token;
 1033|  3.31k|  skipCommentTokens(token);
 1034|  3.31k|  if (features_.failIfExtra_ && (token.type_ != tokenEndOfStream)) {
  ------------------
  |  Branch (1034:7): [True: 1.48k, False: 1.83k]
  |  Branch (1034:33): [True: 162, False: 1.32k]
  ------------------
 1035|    162|    addError("Extra non-whitespace after JSON value.", token);
 1036|    162|    return false;
 1037|    162|  }
 1038|  3.15k|  if (collectComments_ && !commentsBefore_.empty())
  ------------------
  |  Branch (1038:7): [True: 1.85k, False: 1.30k]
  |  Branch (1038:27): [True: 126, False: 1.72k]
  ------------------
 1039|    126|    root.setComment(commentsBefore_, commentAfter);
 1040|  3.15k|  if (features_.strictRoot_) {
  ------------------
  |  Branch (1040:7): [True: 0, False: 3.15k]
  ------------------
 1041|      0|    if (!root.isArray() && !root.isObject()) {
  ------------------
  |  Branch (1041:9): [True: 0, False: 0]
  |  Branch (1041:28): [True: 0, False: 0]
  ------------------
 1042|       |      // Set error location to start of doc, ideally should be first token found
 1043|       |      // in doc
 1044|      0|      token.type_ = tokenError;
 1045|      0|      token.start_ = beginDoc;
 1046|      0|      token.end_ = endDoc;
 1047|      0|      addError(
 1048|      0|          "A valid JSON document must be either an array or an object value.",
 1049|      0|          token);
 1050|      0|      return false;
 1051|      0|    }
 1052|      0|  }
 1053|  3.15k|  return successful;
 1054|  3.15k|}
_ZN4Json9OurReader9readValueEv:
 1056|  1.22M|bool OurReader::readValue() {
 1057|       |  //  To preserve the old behaviour we cast size_t to int.
 1058|  1.22M|  if (nodes_.size() > features_.stackLimit_)
  ------------------
  |  Branch (1058:7): [True: 28, False: 1.22M]
  ------------------
 1059|     28|    throwRuntimeError("Exceeded stackLimit in readValue().");
 1060|  1.22M|  Token token;
 1061|  1.22M|  skipCommentTokens(token);
 1062|  1.22M|  bool successful = true;
 1063|       |
 1064|  1.22M|  if (collectComments_ && !commentsBefore_.empty()) {
  ------------------
  |  Branch (1064:7): [True: 1.17M, False: 49.5k]
  |  Branch (1064:27): [True: 1.69k, False: 1.17M]
  ------------------
 1065|  1.69k|    currentValue().setComment(commentsBefore_, commentBefore);
 1066|  1.69k|    commentsBefore_.clear();
 1067|  1.69k|  }
 1068|       |
 1069|  1.22M|  switch (token.type_) {
 1070|  10.0k|  case tokenObjectBegin:
  ------------------
  |  Branch (1070:3): [True: 10.0k, False: 1.21M]
  ------------------
 1071|  10.0k|    successful = readObject(token);
 1072|  10.0k|    currentValue().setOffsetLimit(current_ - begin_);
 1073|  10.0k|    break;
 1074|  64.7k|  case tokenArrayBegin:
  ------------------
  |  Branch (1074:3): [True: 64.7k, False: 1.15M]
  ------------------
 1075|  64.7k|    successful = readArray(token);
 1076|  64.7k|    currentValue().setOffsetLimit(current_ - begin_);
 1077|  64.7k|    break;
 1078|  1.14M|  case tokenNumber:
  ------------------
  |  Branch (1078:3): [True: 1.14M, False: 79.0k]
  ------------------
 1079|  1.14M|    successful = decodeNumber(token);
 1080|  1.14M|    break;
 1081|    984|  case tokenString:
  ------------------
  |  Branch (1081:3): [True: 984, False: 1.22M]
  ------------------
 1082|    984|    successful = decodeString(token);
 1083|    984|    break;
 1084|  1.34k|  case tokenTrue: {
  ------------------
  |  Branch (1084:3): [True: 1.34k, False: 1.22M]
  ------------------
 1085|  1.34k|    Value v(true);
 1086|  1.34k|    currentValue().swapPayload(v);
 1087|  1.34k|    currentValue().setOffsetStart(token.start_ - begin_);
 1088|  1.34k|    currentValue().setOffsetLimit(token.end_ - begin_);
 1089|  1.34k|  } break;
 1090|    202|  case tokenFalse: {
  ------------------
  |  Branch (1090:3): [True: 202, False: 1.22M]
  ------------------
 1091|    202|    Value v(false);
 1092|    202|    currentValue().swapPayload(v);
 1093|    202|    currentValue().setOffsetStart(token.start_ - begin_);
 1094|    202|    currentValue().setOffsetLimit(token.end_ - begin_);
 1095|    202|  } break;
 1096|    203|  case tokenNull: {
  ------------------
  |  Branch (1096:3): [True: 203, False: 1.22M]
  ------------------
 1097|    203|    Value v;
 1098|    203|    currentValue().swapPayload(v);
 1099|    203|    currentValue().setOffsetStart(token.start_ - begin_);
 1100|    203|    currentValue().setOffsetLimit(token.end_ - begin_);
 1101|    203|  } break;
 1102|      0|  case tokenNaN: {
  ------------------
  |  Branch (1102:3): [True: 0, False: 1.22M]
  ------------------
 1103|      0|    Value v(std::numeric_limits<double>::quiet_NaN());
 1104|      0|    currentValue().swapPayload(v);
 1105|      0|    currentValue().setOffsetStart(token.start_ - begin_);
 1106|      0|    currentValue().setOffsetLimit(token.end_ - begin_);
 1107|      0|  } break;
 1108|      0|  case tokenPosInf: {
  ------------------
  |  Branch (1108:3): [True: 0, False: 1.22M]
  ------------------
 1109|      0|    Value v(std::numeric_limits<double>::infinity());
 1110|      0|    currentValue().swapPayload(v);
 1111|      0|    currentValue().setOffsetStart(token.start_ - begin_);
 1112|      0|    currentValue().setOffsetLimit(token.end_ - begin_);
 1113|      0|  } break;
 1114|      0|  case tokenNegInf: {
  ------------------
  |  Branch (1114:3): [True: 0, False: 1.22M]
  ------------------
 1115|      0|    Value v(-std::numeric_limits<double>::infinity());
 1116|      0|    currentValue().swapPayload(v);
 1117|      0|    currentValue().setOffsetStart(token.start_ - begin_);
 1118|      0|    currentValue().setOffsetLimit(token.end_ - begin_);
 1119|      0|  } break;
 1120|      9|  case tokenArraySeparator:
  ------------------
  |  Branch (1120:3): [True: 9, False: 1.22M]
  ------------------
 1121|     18|  case tokenObjectEnd:
  ------------------
  |  Branch (1121:3): [True: 9, False: 1.22M]
  ------------------
 1122|     22|  case tokenArrayEnd:
  ------------------
  |  Branch (1122:3): [True: 4, False: 1.22M]
  ------------------
 1123|     22|    if (features_.allowDroppedNullPlaceholders_) {
  ------------------
  |  Branch (1123:9): [True: 0, False: 22]
  ------------------
 1124|       |      // "Un-read" the current token and mark the current value as a null
 1125|       |      // token.
 1126|      0|      current_--;
 1127|      0|      Value v;
 1128|      0|      currentValue().swapPayload(v);
 1129|      0|      currentValue().setOffsetStart(current_ - begin_ - 1);
 1130|      0|      currentValue().setOffsetLimit(current_ - begin_);
 1131|      0|      break;
 1132|      0|    } // else, fall through ...
 1133|  1.43k|  default:
  ------------------
  |  Branch (1133:3): [True: 1.41k, False: 1.22M]
  ------------------
 1134|  1.43k|    currentValue().setOffsetStart(token.start_ - begin_);
 1135|  1.43k|    currentValue().setOffsetLimit(token.end_ - begin_);
 1136|  1.43k|    return addError("Syntax error: value, object or array expected.", token);
 1137|  1.22M|  }
 1138|       |
 1139|  1.19M|  if (collectComments_) {
  ------------------
  |  Branch (1139:7): [True: 1.15M, False: 36.9k]
  ------------------
 1140|  1.15M|    lastValueEnd_ = current_;
 1141|  1.15M|    lastValueHasAComment_ = false;
 1142|  1.15M|    lastValue_ = &currentValue();
 1143|  1.15M|  }
 1144|       |
 1145|  1.19M|  return successful;
 1146|  1.22M|}
_ZN4Json9OurReader17skipCommentTokensERNS0_5TokenE:
 1148|  1.22M|void OurReader::skipCommentTokens(Token& token) {
 1149|  1.22M|  if (features_.allowComments_) {
  ------------------
  |  Branch (1149:7): [True: 1.22M, False: 0]
  ------------------
 1150|  1.23M|    do {
 1151|  1.23M|      readToken(token);
 1152|  1.23M|    } while (token.type_ == tokenComment);
  ------------------
  |  Branch (1152:14): [True: 3.83k, False: 1.22M]
  ------------------
 1153|  1.22M|  } else {
 1154|      0|    readToken(token);
 1155|      0|  }
 1156|  1.22M|}
_ZN4Json9OurReader9readTokenERNS0_5TokenE:
 1158|  3.81M|bool OurReader::readToken(Token& token) {
 1159|  3.81M|  skipSpaces();
 1160|  3.81M|  token.start_ = current_;
 1161|  3.81M|  Char c = getNextChar();
 1162|  3.81M|  bool ok = true;
 1163|  3.81M|  switch (c) {
 1164|  11.0k|  case '{':
  ------------------
  |  Branch (1164:3): [True: 11.0k, False: 3.79M]
  ------------------
 1165|  11.0k|    token.type_ = tokenObjectBegin;
 1166|  11.0k|    break;
 1167|  1.46k|  case '}':
  ------------------
  |  Branch (1167:3): [True: 1.46k, False: 3.80M]
  ------------------
 1168|  1.46k|    token.type_ = tokenObjectEnd;
 1169|  1.46k|    break;
 1170|  67.0k|  case '[':
  ------------------
  |  Branch (1170:3): [True: 67.0k, False: 3.74M]
  ------------------
 1171|  67.0k|    token.type_ = tokenArrayBegin;
 1172|  67.0k|    break;
 1173|  1.21k|  case ']':
  ------------------
  |  Branch (1173:3): [True: 1.21k, False: 3.80M]
  ------------------
 1174|  1.21k|    token.type_ = tokenArrayEnd;
 1175|  1.21k|    break;
 1176|  31.1k|  case '"':
  ------------------
  |  Branch (1176:3): [True: 31.1k, False: 3.77M]
  ------------------
 1177|  31.1k|    token.type_ = tokenString;
 1178|  31.1k|    ok = readString();
 1179|  31.1k|    break;
 1180|  2.08k|  case '\'':
  ------------------
  |  Branch (1180:3): [True: 2.08k, False: 3.80M]
  ------------------
 1181|  2.08k|    if (features_.allowSingleQuotes_) {
  ------------------
  |  Branch (1181:9): [True: 0, False: 2.08k]
  ------------------
 1182|      0|      token.type_ = tokenString;
 1183|      0|      ok = readStringSingleQuote();
 1184|  2.08k|    } else {
 1185|       |      // If we don't allow single quotes, this is a failure case.
 1186|  2.08k|      ok = false;
 1187|  2.08k|    }
 1188|  2.08k|    break;
 1189|   136k|  case '/':
  ------------------
  |  Branch (1189:3): [True: 136k, False: 3.67M]
  ------------------
 1190|   136k|    token.type_ = tokenComment;
 1191|   136k|    ok = readComment();
 1192|   136k|    break;
 1193|  82.0k|  case '0':
  ------------------
  |  Branch (1193:3): [True: 82.0k, False: 3.72M]
  ------------------
 1194|  90.5k|  case '1':
  ------------------
  |  Branch (1194:3): [True: 8.52k, False: 3.80M]
  ------------------
 1195|  94.1k|  case '2':
  ------------------
  |  Branch (1195:3): [True: 3.58k, False: 3.80M]
  ------------------
 1196|   148k|  case '3':
  ------------------
  |  Branch (1196:3): [True: 53.9k, False: 3.75M]
  ------------------
 1197|  1.56M|  case '4':
  ------------------
  |  Branch (1197:3): [True: 1.41M, False: 2.39M]
  ------------------
 1198|  1.56M|  case '5':
  ------------------
  |  Branch (1198:3): [True: 2.95k, False: 3.80M]
  ------------------
 1199|  1.56M|  case '6':
  ------------------
  |  Branch (1199:3): [True: 4.21k, False: 3.80M]
  ------------------
 1200|  1.57M|  case '7':
  ------------------
  |  Branch (1200:3): [True: 7.21k, False: 3.80M]
  ------------------
 1201|  1.58M|  case '8':
  ------------------
  |  Branch (1201:3): [True: 9.68k, False: 3.80M]
  ------------------
 1202|  1.58M|  case '9':
  ------------------
  |  Branch (1202:3): [True: 1.00k, False: 3.80M]
  ------------------
 1203|  1.58M|    token.type_ = tokenNumber;
 1204|  1.58M|    readNumber(false);
 1205|  1.58M|    break;
 1206|  19.1k|  case '-':
  ------------------
  |  Branch (1206:3): [True: 19.1k, False: 3.79M]
  ------------------
 1207|  19.1k|    if (readNumber(true)) {
  ------------------
  |  Branch (1207:9): [True: 18.9k, False: 194]
  ------------------
 1208|  18.9k|      token.type_ = tokenNumber;
 1209|  18.9k|    } else {
 1210|    194|      token.type_ = tokenNegInf;
 1211|    194|      ok = features_.allowSpecialFloats_ && match("nfinity", 7);
  ------------------
  |  Branch (1211:12): [True: 0, False: 194]
  |  Branch (1211:45): [True: 0, False: 0]
  ------------------
 1212|    194|    }
 1213|  19.1k|    break;
 1214|  1.36k|  case '+':
  ------------------
  |  Branch (1214:3): [True: 1.36k, False: 3.80M]
  ------------------
 1215|  1.36k|    if (readNumber(true)) {
  ------------------
  |  Branch (1215:9): [True: 1.17k, False: 194]
  ------------------
 1216|  1.17k|      token.type_ = tokenNumber;
 1217|  1.17k|    } else {
 1218|    194|      token.type_ = tokenPosInf;
 1219|    194|      ok = features_.allowSpecialFloats_ && match("nfinity", 7);
  ------------------
  |  Branch (1219:12): [True: 0, False: 194]
  |  Branch (1219:45): [True: 0, False: 0]
  ------------------
 1220|    194|    }
 1221|  1.36k|    break;
 1222|  3.88k|  case 't':
  ------------------
  |  Branch (1222:3): [True: 3.88k, False: 3.80M]
  ------------------
 1223|  3.88k|    token.type_ = tokenTrue;
 1224|  3.88k|    ok = match("rue", 3);
 1225|  3.88k|    break;
 1226|  13.9k|  case 'f':
  ------------------
  |  Branch (1226:3): [True: 13.9k, False: 3.79M]
  ------------------
 1227|  13.9k|    token.type_ = tokenFalse;
 1228|  13.9k|    ok = match("alse", 4);
 1229|  13.9k|    break;
 1230|  3.72k|  case 'n':
  ------------------
  |  Branch (1230:3): [True: 3.72k, False: 3.80M]
  ------------------
 1231|  3.72k|    token.type_ = tokenNull;
 1232|  3.72k|    ok = match("ull", 3);
 1233|  3.72k|    break;
 1234|    318|  case 'N':
  ------------------
  |  Branch (1234:3): [True: 318, False: 3.81M]
  ------------------
 1235|    318|    if (features_.allowSpecialFloats_) {
  ------------------
  |  Branch (1235:9): [True: 0, False: 318]
  ------------------
 1236|      0|      token.type_ = tokenNaN;
 1237|      0|      ok = match("aN", 2);
 1238|    318|    } else {
 1239|    318|      ok = false;
 1240|    318|    }
 1241|    318|    break;
 1242|    198|  case 'I':
  ------------------
  |  Branch (1242:3): [True: 198, False: 3.81M]
  ------------------
 1243|    198|    if (features_.allowSpecialFloats_) {
  ------------------
  |  Branch (1243:9): [True: 0, False: 198]
  ------------------
 1244|      0|      token.type_ = tokenPosInf;
 1245|      0|      ok = match("nfinity", 7);
 1246|    198|    } else {
 1247|    198|      ok = false;
 1248|    198|    }
 1249|    198|    break;
 1250|  1.61M|  case ',':
  ------------------
  |  Branch (1250:3): [True: 1.61M, False: 2.19M]
  ------------------
 1251|  1.61M|    token.type_ = tokenArraySeparator;
 1252|  1.61M|    break;
 1253|  30.3k|  case ':':
  ------------------
  |  Branch (1253:3): [True: 30.3k, False: 3.78M]
  ------------------
 1254|  30.3k|    token.type_ = tokenMemberSeparator;
 1255|  30.3k|    break;
 1256|  48.9k|  case 0:
  ------------------
  |  Branch (1256:3): [True: 48.9k, False: 3.76M]
  ------------------
 1257|  48.9k|    token.type_ = tokenEndOfStream;
 1258|  48.9k|    break;
 1259|   240k|  default:
  ------------------
  |  Branch (1259:3): [True: 240k, False: 3.56M]
  ------------------
 1260|   240k|    ok = false;
 1261|   240k|    break;
 1262|  3.81M|  }
 1263|  3.81M|  if (!ok)
  ------------------
  |  Branch (1263:7): [True: 264k, False: 3.54M]
  ------------------
 1264|   264k|    token.type_ = tokenError;
 1265|  3.81M|  token.end_ = current_;
 1266|  3.81M|  return ok;
 1267|  3.81M|}
_ZN4Json9OurReader10skipSpacesEv:
 1269|  5.00M|void OurReader::skipSpaces() {
 1270|  5.00M|  while (current_ != end_) {
  ------------------
  |  Branch (1270:10): [True: 4.95M, False: 48.9k]
  ------------------
 1271|  4.95M|    Char c = *current_;
 1272|  4.95M|    if (c == ' ' || c == '\t' || c == '\r' || c == '\n')
  ------------------
  |  Branch (1272:9): [True: 580, False: 4.95M]
  |  Branch (1272:21): [True: 433, False: 4.95M]
  |  Branch (1272:34): [True: 350, False: 4.95M]
  |  Branch (1272:47): [True: 297, False: 4.95M]
  ------------------
 1273|  1.66k|      ++current_;
 1274|  4.95M|    else
 1275|  4.95M|      break;
 1276|  4.95M|  }
 1277|  5.00M|}
_ZN4Json9OurReader7skipBomEb:
 1279|  3.31k|void OurReader::skipBom(bool skipBom) {
 1280|       |  // The default behavior is to skip BOM.
 1281|  3.31k|  if (skipBom) {
  ------------------
  |  Branch (1281:7): [True: 3.31k, False: 0]
  ------------------
 1282|  3.31k|    if ((end_ - begin_) >= 3 && strncmp(begin_, "\xEF\xBB\xBF", 3) == 0) {
  ------------------
  |  Branch (1282:9): [True: 3.11k, False: 204]
  |  Branch (1282:33): [True: 1, False: 3.11k]
  ------------------
 1283|      1|      begin_ += 3;
 1284|      1|      current_ = begin_;
 1285|      1|    }
 1286|  3.31k|  }
 1287|  3.31k|}
_ZN4Json9OurReader5matchEPKci:
 1289|  21.5k|bool OurReader::match(const Char* pattern, int patternLength) {
 1290|  21.5k|  if (end_ - current_ < patternLength)
  ------------------
  |  Branch (1290:7): [True: 82, False: 21.4k]
  ------------------
 1291|     82|    return false;
 1292|  21.4k|  int index = patternLength;
 1293|  76.5k|  while (index--)
  ------------------
  |  Branch (1293:10): [True: 63.9k, False: 12.5k]
  ------------------
 1294|  63.9k|    if (current_[index] != pattern[index])
  ------------------
  |  Branch (1294:9): [True: 8.89k, False: 55.0k]
  ------------------
 1295|  8.89k|      return false;
 1296|  12.5k|  current_ += patternLength;
 1297|  12.5k|  return true;
 1298|  21.4k|}
_ZN4Json9OurReader11readCommentEv:
 1300|   136k|bool OurReader::readComment() {
 1301|   136k|  const Location commentBegin = current_ - 1;
 1302|   136k|  const Char c = getNextChar();
 1303|   136k|  bool successful = false;
 1304|   136k|  bool cStyleWithEmbeddedNewline = false;
 1305|       |
 1306|   136k|  const bool isCStyleComment = (c == '*');
 1307|   136k|  const bool isCppStyleComment = (c == '/');
 1308|   136k|  if (isCStyleComment) {
  ------------------
  |  Branch (1308:7): [True: 65.8k, False: 70.9k]
  ------------------
 1309|  65.8k|    successful = readCStyleComment(&cStyleWithEmbeddedNewline);
 1310|  70.9k|  } else if (isCppStyleComment) {
  ------------------
  |  Branch (1310:14): [True: 58.9k, False: 12.0k]
  ------------------
 1311|  58.9k|    successful = readCppStyleComment();
 1312|  58.9k|  }
 1313|       |
 1314|   136k|  if (!successful)
  ------------------
  |  Branch (1314:7): [True: 12.0k, False: 124k]
  ------------------
 1315|  12.0k|    return false;
 1316|       |
 1317|   124k|  if (collectComments_) {
  ------------------
  |  Branch (1317:7): [True: 123k, False: 761]
  ------------------
 1318|   123k|    CommentPlacement placement = commentBefore;
 1319|       |
 1320|   123k|    if (!lastValueHasAComment_) {
  ------------------
  |  Branch (1320:9): [True: 123k, False: 824]
  ------------------
 1321|   123k|      if (lastValueEnd_ && !containsNewLine(lastValueEnd_, commentBegin)) {
  ------------------
  |  Branch (1321:11): [True: 119k, False: 3.75k]
  |  Branch (1321:28): [True: 1.48k, False: 117k]
  ------------------
 1322|  1.48k|        if (isCppStyleComment || !cStyleWithEmbeddedNewline) {
  ------------------
  |  Branch (1322:13): [True: 879, False: 606]
  |  Branch (1322:34): [True: 411, False: 195]
  ------------------
 1323|  1.29k|          placement = commentAfterOnSameLine;
 1324|  1.29k|          lastValueHasAComment_ = true;
 1325|  1.29k|        }
 1326|  1.48k|      }
 1327|   123k|    }
 1328|       |
 1329|   123k|    addComment(commentBegin, current_, placement);
 1330|   123k|  }
 1331|   124k|  return true;
 1332|   136k|}
_ZN4Json9OurReader12normalizeEOLEPKcS2_:
 1335|   123k|                               OurReader::Location end) {
 1336|   123k|  String normalized;
 1337|   123k|  normalized.reserve(static_cast<size_t>(end - begin));
 1338|   123k|  OurReader::Location current = begin;
 1339|  4.89M|  while (current != end) {
  ------------------
  |  Branch (1339:10): [True: 4.77M, False: 123k]
  ------------------
 1340|  4.77M|    char c = *current++;
 1341|  4.77M|    if (c == '\r') {
  ------------------
  |  Branch (1341:9): [True: 55.8k, False: 4.71M]
  ------------------
 1342|  55.8k|      if (current != end && *current == '\n')
  ------------------
  |  Branch (1342:11): [True: 652, False: 55.1k]
  |  Branch (1342:29): [True: 385, False: 267]
  ------------------
 1343|       |        // convert dos EOL
 1344|    385|        ++current;
 1345|       |      // convert Mac EOL
 1346|  55.8k|      normalized += '\n';
 1347|  4.71M|    } else {
 1348|  4.71M|      normalized += c;
 1349|  4.71M|    }
 1350|  4.77M|  }
 1351|   123k|  return normalized;
 1352|   123k|}
_ZN4Json9OurReader10addCommentEPKcS2_NS_16CommentPlacementE:
 1355|   123k|                           CommentPlacement placement) {
 1356|   123k|  assert(collectComments_);
 1357|   123k|  const String& normalized = normalizeEOL(begin, end);
 1358|   123k|  if (placement == commentAfterOnSameLine) {
  ------------------
  |  Branch (1358:7): [True: 1.29k, False: 122k]
  ------------------
 1359|  1.29k|    assert(lastValue_ != nullptr);
 1360|  1.29k|    lastValue_->setComment(normalized, placement);
 1361|   122k|  } else {
 1362|   122k|    commentsBefore_ += normalized;
 1363|   122k|  }
 1364|   123k|}
_ZN4Json9OurReader17readCStyleCommentEPb:
 1366|  65.8k|bool OurReader::readCStyleComment(bool* containsNewLineResult) {
 1367|  65.8k|  *containsNewLineResult = false;
 1368|       |
 1369|   498k|  while ((current_ + 1) < end_) {
  ------------------
  |  Branch (1369:10): [True: 498k, False: 122]
  ------------------
 1370|   498k|    Char c = getNextChar();
 1371|   498k|    if (c == '*' && *current_ == '/')
  ------------------
  |  Branch (1371:9): [True: 96.5k, False: 402k]
  |  Branch (1371:21): [True: 65.7k, False: 30.7k]
  ------------------
 1372|  65.7k|      break;
 1373|   432k|    if (c == '\n')
  ------------------
  |  Branch (1373:9): [True: 2.44k, False: 430k]
  ------------------
 1374|  2.44k|      *containsNewLineResult = true;
 1375|   432k|  }
 1376|       |
 1377|  65.8k|  return getNextChar() == '/';
 1378|  65.8k|}
_ZN4Json9OurReader19readCppStyleCommentEv:
 1380|  58.9k|bool OurReader::readCppStyleComment() {
 1381|  3.97M|  while (current_ != end_) {
  ------------------
  |  Branch (1381:10): [True: 3.97M, False: 233]
  ------------------
 1382|  3.97M|    Char c = getNextChar();
 1383|  3.97M|    if (c == '\n')
  ------------------
  |  Branch (1383:9): [True: 3.22k, False: 3.96M]
  ------------------
 1384|  3.22k|      break;
 1385|  3.96M|    if (c == '\r') {
  ------------------
  |  Branch (1385:9): [True: 55.4k, False: 3.91M]
  ------------------
 1386|       |      // Consume DOS EOL. It will be normalized in addComment.
 1387|  55.4k|      if (current_ != end_ && *current_ == '\n')
  ------------------
  |  Branch (1387:11): [True: 55.4k, False: 16]
  |  Branch (1387:31): [True: 194, False: 55.2k]
  ------------------
 1388|    194|        getNextChar();
 1389|       |      // Break on Moc OS 9 EOL.
 1390|  55.4k|      break;
 1391|  55.4k|    }
 1392|  3.96M|  }
 1393|  58.9k|  return true;
 1394|  58.9k|}
_ZN4Json9OurReader10readNumberEb:
 1396|  1.60M|bool OurReader::readNumber(bool checkInf) {
 1397|  1.60M|  Location p = current_;
 1398|  1.60M|  if (checkInf && p != end_ && *p == 'I') {
  ------------------
  |  Branch (1398:7): [True: 20.5k, False: 1.58M]
  |  Branch (1398:19): [True: 20.4k, False: 65]
  |  Branch (1398:32): [True: 388, False: 20.1k]
  ------------------
 1399|    388|    current_ = ++p;
 1400|    388|    return false;
 1401|    388|  }
 1402|  1.60M|  char c = '0'; // stopgap for already consumed character
 1403|       |  // integral part
 1404|  4.08M|  while (c >= '0' && c <= '9')
  ------------------
  |  Branch (1404:10): [True: 2.48M, False: 1.60M]
  |  Branch (1404:22): [True: 2.48M, False: 5.28k]
  ------------------
 1405|  2.48M|    c = (current_ = p) < end_ ? *p++ : '\0';
  ------------------
  |  Branch (1405:9): [True: 2.48M, False: 528]
  ------------------
 1406|       |  // fractional part
 1407|  1.60M|  if (c == '.') {
  ------------------
  |  Branch (1407:7): [True: 3.22k, False: 1.60M]
  ------------------
 1408|  3.22k|    c = (current_ = p) < end_ ? *p++ : '\0';
  ------------------
  |  Branch (1408:9): [True: 3.21k, False: 9]
  ------------------
 1409|  8.00M|    while (c >= '0' && c <= '9')
  ------------------
  |  Branch (1409:12): [True: 8.00M, False: 1.70k]
  |  Branch (1409:24): [True: 8.00M, False: 1.51k]
  ------------------
 1410|  8.00M|      c = (current_ = p) < end_ ? *p++ : '\0';
  ------------------
  |  Branch (1410:11): [True: 8.00M, False: 28]
  ------------------
 1411|  3.22k|  }
 1412|       |  // exponential part
 1413|  1.60M|  if (c == 'e' || c == 'E') {
  ------------------
  |  Branch (1413:7): [True: 3.55k, False: 1.60M]
  |  Branch (1413:19): [True: 1.25k, False: 1.60M]
  ------------------
 1414|  4.80k|    c = (current_ = p) < end_ ? *p++ : '\0';
  ------------------
  |  Branch (1414:9): [True: 4.69k, False: 113]
  ------------------
 1415|  4.80k|    if (c == '+' || c == '-')
  ------------------
  |  Branch (1415:9): [True: 2.02k, False: 2.78k]
  |  Branch (1415:21): [True: 624, False: 2.15k]
  ------------------
 1416|  2.64k|      c = (current_ = p) < end_ ? *p++ : '\0';
  ------------------
  |  Branch (1416:11): [True: 2.59k, False: 47]
  ------------------
 1417|  11.7k|    while (c >= '0' && c <= '9')
  ------------------
  |  Branch (1417:12): [True: 7.88k, False: 3.89k]
  |  Branch (1417:24): [True: 6.97k, False: 910]
  ------------------
 1418|  6.97k|      c = (current_ = p) < end_ ? *p++ : '\0';
  ------------------
  |  Branch (1418:11): [True: 6.93k, False: 38]
  ------------------
 1419|  4.80k|  }
 1420|  1.60M|  return true;
 1421|  1.60M|}
_ZN4Json9OurReader10readStringEv:
 1422|  31.1k|bool OurReader::readString() {
 1423|  31.1k|  Char c = 0;
 1424|  8.69M|  while (current_ != end_) {
  ------------------
  |  Branch (1424:10): [True: 8.69M, False: 54]
  ------------------
 1425|  8.69M|    c = getNextChar();
 1426|  8.69M|    if (c == '\\')
  ------------------
  |  Branch (1426:9): [True: 6.79k, False: 8.68M]
  ------------------
 1427|  6.79k|      getNextChar();
 1428|  8.68M|    else if (c == '"')
  ------------------
  |  Branch (1428:14): [True: 31.1k, False: 8.65M]
  ------------------
 1429|  31.1k|      break;
 1430|  8.69M|  }
 1431|  31.1k|  return c == '"';
 1432|  31.1k|}
_ZN4Json9OurReader10readObjectERNS0_5TokenE:
 1446|  10.0k|bool OurReader::readObject(Token& token) {
 1447|  10.0k|  Token tokenName;
 1448|  10.0k|  String name;
 1449|  10.0k|  Value init(objectValue);
 1450|  10.0k|  currentValue().swapPayload(init);
 1451|  10.0k|  currentValue().setOffsetStart(token.start_ - begin_);
 1452|  31.8k|  while (readToken(tokenName)) {
  ------------------
  |  Branch (1452:10): [True: 28.2k, False: 3.54k]
  ------------------
 1453|  28.2k|    bool initialTokenOk = true;
 1454|  28.7k|    while (tokenName.type_ == tokenComment && initialTokenOk)
  ------------------
  |  Branch (1454:12): [True: 510, False: 28.2k]
  |  Branch (1454:47): [True: 510, False: 0]
  ------------------
 1455|    510|      initialTokenOk = readToken(tokenName);
 1456|  28.2k|    if (!initialTokenOk)
  ------------------
  |  Branch (1456:9): [True: 1, False: 28.2k]
  ------------------
 1457|      1|      break;
 1458|  28.2k|    if (tokenName.type_ == tokenObjectEnd &&
  ------------------
  |  Branch (1458:9): [True: 927, False: 27.3k]
  ------------------
 1459|  28.2k|        (name.empty() ||
  ------------------
  |  Branch (1459:10): [True: 521, False: 406]
  ------------------
 1460|    927|         features_.allowTrailingCommas_)) // empty object or trailing comma
  ------------------
  |  Branch (1460:10): [True: 406, False: 0]
  ------------------
 1461|    927|      return true;
 1462|  27.3k|    name.clear();
 1463|  27.3k|    if (tokenName.type_ == tokenString) {
  ------------------
  |  Branch (1463:9): [True: 27.1k, False: 152]
  ------------------
 1464|  27.1k|      if (!decodeString(tokenName, name))
  ------------------
  |  Branch (1464:11): [True: 1, False: 27.1k]
  ------------------
 1465|      1|        return recoverFromError(tokenObjectEnd);
 1466|  27.1k|    } else if (tokenName.type_ == tokenNumber && features_.allowNumericKeys_) {
  ------------------
  |  Branch (1466:16): [True: 34, False: 118]
  |  Branch (1466:50): [True: 0, False: 34]
  ------------------
 1467|      0|      Value numberName;
 1468|      0|      if (!decodeNumber(tokenName, numberName))
  ------------------
  |  Branch (1468:11): [True: 0, False: 0]
  ------------------
 1469|      0|        return recoverFromError(tokenObjectEnd);
 1470|      0|      name = numberName.asString();
 1471|    152|    } else {
 1472|    152|      break;
 1473|    152|    }
 1474|  27.1k|    if (name.length() >= (1U << 30))
  ------------------
  |  Branch (1474:9): [True: 0, False: 27.1k]
  ------------------
 1475|      0|      throwRuntimeError("keylength >= 2^30");
 1476|  27.1k|    if (features_.rejectDupKeys_ && currentValue().isMember(name)) {
  ------------------
  |  Branch (1476:9): [True: 0, False: 27.1k]
  |  Branch (1476:37): [True: 0, False: 0]
  ------------------
 1477|      0|      String msg = "Duplicate key: '" + name + "'";
 1478|      0|      return addErrorAndRecover(msg, tokenName, tokenObjectEnd);
 1479|      0|    }
 1480|       |
 1481|  27.1k|    Token colon;
 1482|  27.1k|    if (!readToken(colon) || colon.type_ != tokenMemberSeparator) {
  ------------------
  |  Branch (1482:9): [True: 2, False: 27.1k]
  |  Branch (1482:30): [True: 47, False: 27.1k]
  ------------------
 1483|     49|      return addErrorAndRecover("Missing ':' after object member name", colon,
 1484|     49|                                tokenObjectEnd);
 1485|     49|    }
 1486|  27.1k|    Value& value = currentValue()[name];
 1487|  27.1k|    nodes_.push(&value);
 1488|  27.1k|    bool ok = readValue();
 1489|  27.1k|    nodes_.pop();
 1490|  27.1k|    if (!ok) // error already set
  ------------------
  |  Branch (1490:9): [True: 5.09k, False: 22.0k]
  ------------------
 1491|  5.09k|      return recoverFromError(tokenObjectEnd);
 1492|       |
 1493|  22.0k|    Token comma;
 1494|  22.0k|    if (!readToken(comma) ||
  ------------------
  |  Branch (1494:9): [True: 3.51k, False: 18.5k]
  ------------------
 1495|  22.0k|        (comma.type_ != tokenObjectEnd && comma.type_ != tokenArraySeparator &&
  ------------------
  |  Branch (1495:10): [True: 18.3k, False: 194]
  |  Branch (1495:43): [True: 418, False: 17.9k]
  ------------------
 1496|  18.5k|         comma.type_ != tokenComment)) {
  ------------------
  |  Branch (1496:10): [True: 6, False: 412]
  ------------------
 1497|     10|      return addErrorAndRecover("Missing ',' or '}' in object declaration",
 1498|     10|                                comma, tokenObjectEnd);
 1499|     10|    }
 1500|  22.0k|    bool finalizeTokenOk = true;
 1501|  22.7k|    while (comma.type_ == tokenComment && finalizeTokenOk)
  ------------------
  |  Branch (1501:12): [True: 686, False: 22.0k]
  |  Branch (1501:43): [True: 686, False: 0]
  ------------------
 1502|    686|      finalizeTokenOk = readToken(comma);
 1503|  22.0k|    if (comma.type_ == tokenObjectEnd)
  ------------------
  |  Branch (1503:9): [True: 276, False: 21.7k]
  ------------------
 1504|    276|      return true;
 1505|  22.0k|  }
 1506|  3.69k|  return addErrorAndRecover("Missing '}' or object member name", tokenName,
 1507|  3.69k|                            tokenObjectEnd);
 1508|  10.0k|}
_ZN4Json9OurReader9readArrayERNS0_5TokenE:
 1510|  64.7k|bool OurReader::readArray(Token& token) {
 1511|  64.7k|  Value init(arrayValue);
 1512|  64.7k|  currentValue().swapPayload(init);
 1513|  64.7k|  currentValue().setOffsetStart(token.start_ - begin_);
 1514|  64.7k|  int index = 0;
 1515|  1.19M|  for (;;) {
 1516|  1.19M|    skipSpaces();
 1517|  1.19M|    if (current_ != end_ && *current_ == ']' &&
  ------------------
  |  Branch (1517:9): [True: 1.19M, False: 315]
  |  Branch (1517:29): [True: 602, False: 1.19M]
  ------------------
 1518|  1.19M|        (index == 0 ||
  ------------------
  |  Branch (1518:10): [True: 222, False: 380]
  ------------------
 1519|    602|         (features_.allowTrailingCommas_ &&
  ------------------
  |  Branch (1519:11): [True: 380, False: 0]
  ------------------
 1520|    380|          !features_.allowDroppedNullPlaceholders_))) // empty array or trailing
  ------------------
  |  Branch (1520:11): [True: 380, False: 0]
  ------------------
 1521|       |                                                      // comma
 1522|    602|    {
 1523|    602|      Token endArray;
 1524|    602|      readToken(endArray);
 1525|    602|      return true;
 1526|    602|    }
 1527|  1.19M|    Value& value = currentValue()[index++];
 1528|  1.19M|    nodes_.push(&value);
 1529|  1.19M|    bool ok = readValue();
 1530|  1.19M|    nodes_.pop();
 1531|  1.19M|    if (!ok) // error already set
  ------------------
  |  Branch (1531:9): [True: 38.9k, False: 1.15M]
  ------------------
 1532|  38.9k|      return recoverFromError(tokenArrayEnd);
 1533|       |
 1534|  1.15M|    Token currentToken;
 1535|       |    // Accept Comment after last item in the array.
 1536|  1.15M|    ok = readToken(currentToken);
 1537|  1.15M|    while (currentToken.type_ == tokenComment && ok) {
  ------------------
  |  Branch (1537:12): [True: 977, False: 1.15M]
  |  Branch (1537:50): [True: 977, False: 0]
  ------------------
 1538|    977|      ok = readToken(currentToken);
 1539|    977|    }
 1540|  1.15M|    bool badTokenType = (currentToken.type_ != tokenArraySeparator &&
  ------------------
  |  Branch (1540:26): [True: 759, False: 1.15M]
  ------------------
 1541|  1.15M|                         currentToken.type_ != tokenArrayEnd);
  ------------------
  |  Branch (1541:26): [True: 350, False: 409]
  ------------------
 1542|  1.15M|    if (!ok || badTokenType) {
  ------------------
  |  Branch (1542:9): [True: 24.5k, False: 1.13M]
  |  Branch (1542:16): [True: 285, False: 1.12M]
  ------------------
 1543|    350|      return addErrorAndRecover("Missing ',' or ']' in array declaration",
 1544|    350|                                currentToken, tokenArrayEnd);
 1545|    350|    }
 1546|  1.15M|    if (currentToken.type_ == tokenArrayEnd)
  ------------------
  |  Branch (1546:9): [True: 409, False: 1.15M]
  ------------------
 1547|    409|      break;
 1548|  1.15M|  }
 1549|  24.9k|  return true;
 1550|  64.7k|}
_ZN4Json9OurReader12decodeNumberERNS0_5TokenE:
 1552|  1.14M|bool OurReader::decodeNumber(Token& token) {
 1553|  1.14M|  Value decoded;
 1554|  1.14M|  if (!decodeNumber(token, decoded))
  ------------------
  |  Branch (1554:7): [True: 294, False: 1.14M]
  ------------------
 1555|    294|    return false;
 1556|  1.14M|  currentValue().swapPayload(decoded);
 1557|  1.14M|  currentValue().setOffsetStart(token.start_ - begin_);
 1558|  1.14M|  currentValue().setOffsetLimit(token.end_ - begin_);
 1559|  1.14M|  return true;
 1560|  1.14M|}
_ZN4Json9OurReader12decodeNumberERNS0_5TokenERNS_5ValueE:
 1562|  1.14M|bool OurReader::decodeNumber(Token& token, Value& decoded) {
 1563|       |  // Attempts to parse the number as an integer. If the number is
 1564|       |  // larger than the maximum supported value of an integer then
 1565|       |  // we decode the number as a double.
 1566|  1.14M|  Location current = token.start_;
 1567|  1.14M|  const bool isNegative = *current == '-';
 1568|  1.14M|  if (isNegative) {
  ------------------
  |  Branch (1568:7): [True: 15.1k, False: 1.13M]
  ------------------
 1569|  15.1k|    ++current;
 1570|  15.1k|  }
 1571|       |
 1572|       |  // We assume we can represent the largest and smallest integer types as
 1573|       |  // unsigned integers with separate sign. This is only true if they can fit
 1574|       |  // into an unsigned integer.
 1575|  1.14M|  static_assert(Value::maxLargestInt <= Value::maxLargestUInt,
 1576|  1.14M|                "Int must be smaller than UInt");
 1577|       |
 1578|       |  // We need to convert minLargestInt into a positive number. The easiest way
 1579|       |  // to do this conversion is to assume our "threshold" value of minLargestInt
 1580|       |  // divided by 10 can fit in maxLargestInt when absolute valued. This should
 1581|       |  // be a safe assumption.
 1582|  1.14M|  static_assert(Value::minLargestInt <= -Value::maxLargestInt,
 1583|  1.14M|                "The absolute value of minLargestInt must be greater than or "
 1584|  1.14M|                "equal to maxLargestInt");
 1585|  1.14M|  static_assert(Value::minLargestInt / 10 >= -Value::maxLargestInt,
 1586|  1.14M|                "The absolute value of minLargestInt must be only 1 magnitude "
 1587|  1.14M|                "larger than maxLargest Int");
 1588|       |
 1589|  1.14M|  static constexpr Value::LargestUInt positive_threshold =
 1590|  1.14M|      Value::maxLargestUInt / 10;
 1591|  1.14M|  static constexpr Value::UInt positive_last_digit = Value::maxLargestUInt % 10;
 1592|       |
 1593|       |  // For the negative values, we have to be more careful. Since typically
 1594|       |  // -Value::minLargestInt will cause an overflow, we first divide by 10 and
 1595|       |  // then take the inverse. This assumes that minLargestInt is only a single
 1596|       |  // power of 10 different in magnitude, which we check above. For the last
 1597|       |  // digit, we take the modulus before negating for the same reason.
 1598|  1.14M|  static constexpr auto negative_threshold =
 1599|  1.14M|      Value::LargestUInt(-(Value::minLargestInt / 10));
 1600|  1.14M|  static constexpr auto negative_last_digit =
 1601|  1.14M|      Value::UInt(-(Value::minLargestInt % 10));
 1602|       |
 1603|  1.14M|  const Value::LargestUInt threshold =
 1604|  1.14M|      isNegative ? negative_threshold : positive_threshold;
  ------------------
  |  Branch (1604:7): [True: 15.1k, False: 1.13M]
  ------------------
 1605|  1.14M|  const Value::UInt max_last_digit =
 1606|  1.14M|      isNegative ? negative_last_digit : positive_last_digit;
  ------------------
  |  Branch (1606:7): [True: 15.1k, False: 1.13M]
  ------------------
 1607|       |
 1608|  1.14M|  Value::LargestUInt value = 0;
 1609|  2.32M|  while (current < token.end_) {
  ------------------
  |  Branch (1609:10): [True: 1.18M, False: 1.14M]
  ------------------
 1610|  1.18M|    Char c = *current++;
 1611|  1.18M|    if (c < '0' || c > '9')
  ------------------
  |  Branch (1611:9): [True: 1.08k, False: 1.17M]
  |  Branch (1611:20): [True: 660, False: 1.17M]
  ------------------
 1612|  1.74k|      return decodeDouble(token, decoded);
 1613|       |
 1614|  1.17M|    const auto digit(static_cast<Value::UInt>(c - '0'));
 1615|  1.17M|    if (value >= threshold) {
  ------------------
  |  Branch (1615:9): [True: 2.08k, False: 1.17M]
  ------------------
 1616|       |      // We've hit or exceeded the max value divided by 10 (rounded down). If
 1617|       |      // a) we've only just touched the limit, meaning value == threshold,
 1618|       |      // b) this is the last digit, or
 1619|       |      // c) it's small enough to fit in that rounding delta, we're okay.
 1620|       |      // Otherwise treat this number as a double to avoid overflow.
 1621|  2.08k|      if (value > threshold || current != token.end_ ||
  ------------------
  |  Branch (1621:11): [True: 1.20k, False: 879]
  |  Branch (1621:32): [True: 203, False: 676]
  ------------------
 1622|  2.08k|          digit > max_last_digit) {
  ------------------
  |  Branch (1622:11): [True: 209, False: 467]
  ------------------
 1623|  1.61k|        return decodeDouble(token, decoded);
 1624|  1.61k|      }
 1625|  2.08k|    }
 1626|  1.17M|    value = value * 10 + digit;
 1627|  1.17M|  }
 1628|       |
 1629|  1.14M|  if (isNegative) {
  ------------------
  |  Branch (1629:7): [True: 14.7k, False: 1.12M]
  ------------------
 1630|       |    // We use the same magnitude assumption here, just in case.
 1631|  14.7k|    const auto last_digit = static_cast<Value::UInt>(value % 10);
 1632|  14.7k|    decoded = -Value::LargestInt(value / 10) * 10 - last_digit;
 1633|  1.12M|  } else if (value <= Value::LargestUInt(Value::maxLargestInt)) {
  ------------------
  |  Branch (1633:14): [True: 1.12M, False: 620]
  ------------------
 1634|  1.12M|    decoded = Value::LargestInt(value);
 1635|  1.12M|  } else {
 1636|    620|    decoded = value;
 1637|    620|  }
 1638|       |
 1639|  1.14M|  return true;
 1640|  1.14M|}
_ZN4Json9OurReader12decodeDoubleERNS0_5TokenERNS_5ValueE:
 1652|  3.36k|bool OurReader::decodeDouble(Token& token, Value& decoded) {
 1653|  3.36k|  double value = 0;
 1654|  3.36k|  const String buffer(token.start_, token.end_);
 1655|  3.36k|  IStringStream is(buffer);
 1656|  3.36k|  if (!(is >> value)) {
  ------------------
  |  Branch (1656:7): [True: 500, False: 2.86k]
  ------------------
 1657|    500|    if (value == std::numeric_limits<double>::max())
  ------------------
  |  Branch (1657:9): [True: 0, False: 500]
  ------------------
 1658|      0|      value = std::numeric_limits<double>::infinity();
 1659|    500|    else if (value == std::numeric_limits<double>::lowest())
  ------------------
  |  Branch (1659:14): [True: 0, False: 500]
  ------------------
 1660|      0|      value = -std::numeric_limits<double>::infinity();
 1661|    500|    else if (!std::isinf(value))
  ------------------
  |  Branch (1661:14): [True: 294, False: 206]
  ------------------
 1662|    294|      return addError(
 1663|    294|        "'" + String(token.start_, token.end_) + "' is not a number.", token);
 1664|    500|  }
 1665|  3.06k|  decoded = value;
 1666|  3.06k|  return true;
 1667|  3.36k|}
_ZN4Json9OurReader12decodeStringERNS0_5TokenE:
 1669|    984|bool OurReader::decodeString(Token& token) {
 1670|    984|  String decoded_string;
 1671|    984|  if (!decodeString(token, decoded_string))
  ------------------
  |  Branch (1671:7): [True: 167, False: 817]
  ------------------
 1672|    167|    return false;
 1673|    817|  Value decoded(decoded_string);
 1674|    817|  currentValue().swapPayload(decoded);
 1675|    817|  currentValue().setOffsetStart(token.start_ - begin_);
 1676|    817|  currentValue().setOffsetLimit(token.end_ - begin_);
 1677|    817|  return true;
 1678|    984|}
_ZN4Json9OurReader12decodeStringERNS0_5TokenERNSt3__112basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEE:
 1680|  28.1k|bool OurReader::decodeString(Token& token, String& decoded) {
 1681|  28.1k|  decoded.reserve(static_cast<size_t>(token.end_ - token.start_ - 2));
 1682|  28.1k|  Location current = token.start_ + 1; // skip '"'
 1683|  28.1k|  Location end = token.end_ - 1;       // do not include '"'
 1684|  7.84M|  while (current != end) {
  ------------------
  |  Branch (1684:10): [True: 7.81M, False: 28.0k]
  ------------------
 1685|  7.81M|    Char c = *current++;
 1686|  7.81M|    if (c == '"')
  ------------------
  |  Branch (1686:9): [True: 0, False: 7.81M]
  ------------------
 1687|      0|      break;
 1688|  7.81M|    if (c == '\\') {
  ------------------
  |  Branch (1688:9): [True: 4.67k, False: 7.80M]
  ------------------
 1689|  4.67k|      if (current == end)
  ------------------
  |  Branch (1689:11): [True: 0, False: 4.67k]
  ------------------
 1690|      0|        return addError("Empty escape sequence in string", token, current);
 1691|  4.67k|      Char escape = *current++;
 1692|  4.67k|      switch (escape) {
 1693|    255|      case '"':
  ------------------
  |  Branch (1693:7): [True: 255, False: 4.42k]
  ------------------
 1694|    255|        decoded += '"';
 1695|    255|        break;
 1696|    306|      case '/':
  ------------------
  |  Branch (1696:7): [True: 306, False: 4.37k]
  ------------------
 1697|    306|        decoded += '/';
 1698|    306|        break;
 1699|    382|      case '\\':
  ------------------
  |  Branch (1699:7): [True: 382, False: 4.29k]
  ------------------
 1700|    382|        decoded += '\\';
 1701|    382|        break;
 1702|    255|      case 'b':
  ------------------
  |  Branch (1702:7): [True: 255, False: 4.42k]
  ------------------
 1703|    255|        decoded += '\b';
 1704|    255|        break;
 1705|    475|      case 'f':
  ------------------
  |  Branch (1705:7): [True: 475, False: 4.20k]
  ------------------
 1706|    475|        decoded += '\f';
 1707|    475|        break;
 1708|    254|      case 'n':
  ------------------
  |  Branch (1708:7): [True: 254, False: 4.42k]
  ------------------
 1709|    254|        decoded += '\n';
 1710|    254|        break;
 1711|    275|      case 'r':
  ------------------
  |  Branch (1711:7): [True: 275, False: 4.40k]
  ------------------
 1712|    275|        decoded += '\r';
 1713|    275|        break;
 1714|    297|      case 't':
  ------------------
  |  Branch (1714:7): [True: 297, False: 4.38k]
  ------------------
 1715|    297|        decoded += '\t';
 1716|    297|        break;
 1717|  2.17k|      case 'u': {
  ------------------
  |  Branch (1717:7): [True: 2.17k, False: 2.50k]
  ------------------
 1718|  2.17k|        unsigned int unicode;
 1719|  2.17k|        if (!decodeUnicodeCodePoint(token, current, end, unicode))
  ------------------
  |  Branch (1719:13): [True: 164, False: 2.01k]
  ------------------
 1720|    164|          return false;
 1721|  2.01k|        decoded += codePointToUTF8(unicode);
 1722|  2.01k|      } break;
 1723|      4|      default:
  ------------------
  |  Branch (1723:7): [True: 4, False: 4.67k]
  ------------------
 1724|      4|        return addError("Bad escape sequence in string", token, current);
 1725|  4.67k|      }
 1726|  7.80M|    } else {
 1727|  7.80M|      decoded += c;
 1728|  7.80M|    }
 1729|  7.81M|  }
 1730|  28.0k|  return true;
 1731|  28.1k|}
_ZN4Json9OurReader22decodeUnicodeCodePointERNS0_5TokenERPKcS4_Rj:
 1734|  2.17k|                                       Location end, unsigned int& unicode) {
 1735|       |
 1736|  2.17k|  if (!decodeUnicodeEscapeSequence(token, current, end, unicode))
  ------------------
  |  Branch (1736:7): [True: 113, False: 2.06k]
  ------------------
 1737|    113|    return false;
 1738|  2.06k|  if (unicode >= 0xD800 && unicode <= 0xDBFF) {
  ------------------
  |  Branch (1738:7): [True: 1.30k, False: 755]
  |  Branch (1738:28): [True: 826, False: 480]
  ------------------
 1739|       |    // surrogate pairs
 1740|    826|    if (end - current < 6)
  ------------------
  |  Branch (1740:9): [True: 17, False: 809]
  ------------------
 1741|     17|      return addError(
 1742|     17|          "additional six characters expected to parse unicode surrogate pair.",
 1743|     17|          token, current);
 1744|    809|    if (*(current++) == '\\' && *(current++) == 'u') {
  ------------------
  |  Branch (1744:9): [True: 793, False: 16]
  |  Branch (1744:33): [True: 779, False: 14]
  ------------------
 1745|    779|      unsigned int surrogatePair;
 1746|    779|      if (decodeUnicodeEscapeSequence(token, current, end, surrogatePair)) {
  ------------------
  |  Branch (1746:11): [True: 775, False: 4]
  ------------------
 1747|    775|        unicode = 0x10000 + ((unicode & 0x3FF) << 10) + (surrogatePair & 0x3FF);
 1748|    775|      } else
 1749|      4|        return false;
 1750|    779|    } else
 1751|     30|      return addError("expecting another \\u token to begin the second half of "
 1752|     30|                      "a unicode surrogate pair",
 1753|     30|                      token, current);
 1754|    809|  }
 1755|  2.01k|  return true;
 1756|  2.06k|}
_ZN4Json9OurReader27decodeUnicodeEscapeSequenceERNS0_5TokenERPKcS4_Rj:
 1760|  2.95k|                                            unsigned int& ret_unicode) {
 1761|  2.95k|  if (end - current < 4)
  ------------------
  |  Branch (1761:7): [True: 10, False: 2.94k]
  ------------------
 1762|     10|    return addError(
 1763|     10|        "Bad unicode escape sequence in string: four digits expected.", token,
 1764|     10|        current);
 1765|  2.94k|  int unicode = 0;
 1766|  14.4k|  for (int index = 0; index < 4; ++index) {
  ------------------
  |  Branch (1766:23): [True: 11.6k, False: 2.83k]
  ------------------
 1767|  11.6k|    Char c = *current++;
 1768|  11.6k|    unicode *= 16;
 1769|  11.6k|    if (c >= '0' && c <= '9')
  ------------------
  |  Branch (1769:9): [True: 11.5k, False: 40]
  |  Branch (1769:21): [True: 3.09k, False: 8.48k]
  ------------------
 1770|  3.09k|      unicode += c - '0';
 1771|  8.52k|    else if (c >= 'a' && c <= 'f')
  ------------------
  |  Branch (1771:14): [True: 3.98k, False: 4.53k]
  |  Branch (1771:26): [True: 3.96k, False: 19]
  ------------------
 1772|  3.96k|      unicode += c - 'a' + 10;
 1773|  4.55k|    else if (c >= 'A' && c <= 'F')
  ------------------
  |  Branch (1773:14): [True: 4.49k, False: 57]
  |  Branch (1773:26): [True: 4.44k, False: 50]
  ------------------
 1774|  4.44k|      unicode += c - 'A' + 10;
 1775|    107|    else
 1776|    107|      return addError(
 1777|    107|          "Bad unicode escape sequence in string: hexadecimal digit expected.",
 1778|    107|          token, current);
 1779|  11.6k|  }
 1780|  2.83k|  ret_unicode = static_cast<unsigned int>(unicode);
 1781|  2.83k|  return true;
 1782|  2.94k|}
_ZN4Json9OurReader8addErrorERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERNS0_5TokenEPKc:
 1784|  2.65k|bool OurReader::addError(const String& message, Token& token, Location extra) {
 1785|  2.65k|  ErrorInfo info;
 1786|  2.65k|  info.token_ = token;
 1787|  2.65k|  info.message_ = message;
 1788|  2.65k|  info.extra_ = extra;
 1789|  2.65k|  errors_.push_back(info);
 1790|  2.65k|  return false;
 1791|  2.65k|}
_ZN4Json9OurReader16recoverFromErrorENS0_9TokenTypeE:
 1793|  44.6k|bool OurReader::recoverFromError(TokenType skipUntilToken) {
 1794|  44.6k|  size_t errorCount = errors_.size();
 1795|  44.6k|  Token skip;
 1796|  1.37M|  for (;;) {
 1797|  1.37M|    if (!readToken(skip))
  ------------------
  |  Branch (1797:9): [True: 263k, False: 1.10M]
  ------------------
 1798|   263k|      errors_.resize(errorCount); // discard errors caused by recovery
 1799|  1.37M|    if (skip.type_ == skipUntilToken || skip.type_ == tokenEndOfStream)
  ------------------
  |  Branch (1799:9): [True: 4, False: 1.37M]
  |  Branch (1799:41): [True: 44.6k, False: 1.32M]
  ------------------
 1800|  44.6k|      break;
 1801|  1.37M|  }
 1802|  44.6k|  errors_.resize(errorCount);
 1803|  44.6k|  return false;
 1804|  44.6k|}
_ZN4Json9OurReader18addErrorAndRecoverERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERNS0_5TokenENS0_9TokenTypeE:
 1807|    597|                                   TokenType skipUntilToken) {
 1808|    597|  addError(message, token);
 1809|    597|  return recoverFromError(skipUntilToken);
 1810|    597|}
_ZN4Json9OurReader12currentValueEv:
 1812|  6.02M|Value& OurReader::currentValue() { return *(nodes_.top()); }
_ZN4Json9OurReader11getNextCharEv:
 1814|  17.1M|OurReader::Char OurReader::getNextChar() {
 1815|  17.1M|  if (current_ == end_)
  ------------------
  |  Branch (1815:7): [True: 48.6k, False: 17.1M]
  ------------------
 1816|  48.6k|    return 0;
 1817|  17.1M|  return *current_++;
 1818|  17.1M|}
_ZN4Json17CharReaderBuilderC2Ev:
 1892|  3.31k|CharReaderBuilder::CharReaderBuilder() { setDefaults(&settings_); }
_ZN4Json17CharReaderBuilderD2Ev:
 1893|  3.31k|CharReaderBuilder::~CharReaderBuilder() = default;
_ZNK4Json17CharReaderBuilder13newCharReaderEv:
 1894|  3.31k|CharReader* CharReaderBuilder::newCharReader() const {
 1895|  3.31k|  bool collectComments = settings_["collectComments"].asBool();
 1896|  3.31k|  OurFeatures features = OurFeatures::all();
 1897|  3.31k|  features.allowComments_ = settings_["allowComments"].asBool();
 1898|  3.31k|  features.allowTrailingCommas_ = settings_["allowTrailingCommas"].asBool();
 1899|  3.31k|  features.strictRoot_ = settings_["strictRoot"].asBool();
 1900|  3.31k|  features.allowDroppedNullPlaceholders_ =
 1901|  3.31k|      settings_["allowDroppedNullPlaceholders"].asBool();
 1902|  3.31k|  features.allowNumericKeys_ = settings_["allowNumericKeys"].asBool();
 1903|  3.31k|  features.allowSingleQuotes_ = settings_["allowSingleQuotes"].asBool();
 1904|       |
 1905|       |  // Stack limit is always a size_t, so we get this as an unsigned int
 1906|       |  // regardless of it we have 64-bit integer support enabled.
 1907|  3.31k|  features.stackLimit_ = static_cast<size_t>(settings_["stackLimit"].asUInt());
 1908|  3.31k|  features.failIfExtra_ = settings_["failIfExtra"].asBool();
 1909|  3.31k|  features.rejectDupKeys_ = settings_["rejectDupKeys"].asBool();
 1910|  3.31k|  features.allowSpecialFloats_ = settings_["allowSpecialFloats"].asBool();
 1911|  3.31k|  features.skipBom_ = settings_["skipBom"].asBool();
 1912|  3.31k|  return new OurCharReader(collectComments, features);
 1913|  3.31k|}
_ZN4Json17CharReaderBuilder11setDefaultsEPNS_5ValueE:
 1962|  3.31k|void CharReaderBuilder::setDefaults(Json::Value* settings) {
 1963|       |  //! [CharReaderBuilderDefaults]
 1964|  3.31k|  (*settings)["collectComments"] = true;
 1965|  3.31k|  (*settings)["allowComments"] = true;
 1966|  3.31k|  (*settings)["allowTrailingCommas"] = true;
 1967|  3.31k|  (*settings)["strictRoot"] = false;
 1968|  3.31k|  (*settings)["allowDroppedNullPlaceholders"] = false;
 1969|  3.31k|  (*settings)["allowNumericKeys"] = false;
 1970|  3.31k|  (*settings)["allowSingleQuotes"] = false;
 1971|  3.31k|  (*settings)["stackLimit"] = 1000;
 1972|  3.31k|  (*settings)["failIfExtra"] = false;
 1973|  3.31k|  (*settings)["rejectDupKeys"] = false;
 1974|  3.31k|  (*settings)["allowSpecialFloats"] = false;
 1975|  3.31k|  (*settings)["skipBom"] = true;
 1976|       |  //! [CharReaderBuilderDefaults]
 1977|  3.31k|}
_ZN4Json13OurCharReaderC2EbRKNS_11OurFeaturesE:
 1881|  3.31k|      : collectComments_(collectComments), reader_(features) {}
_ZN4Json13OurCharReader5parseEPKcS2_PNS_5ValueEPNSt3__112basic_stringIcNS5_11char_traitsIcEENS5_9allocatorIcEEEE:
 1883|  3.31k|             String* errs) override {
 1884|  3.31k|    bool ok = reader_.parse(beginDoc, endDoc, *root, collectComments_);
 1885|  3.31k|    if (errs) {
  ------------------
  |  Branch (1885:9): [True: 0, False: 3.31k]
  ------------------
 1886|      0|      *errs = reader_.getFormattedErrorMessages();
 1887|      0|    }
 1888|  3.31k|    return ok;
 1889|  3.31k|  }
json_reader.cpp:_ZZN4Json9OurReader15containsNewLineEPKcS2_ENK3$_1clEc:
 1005|  21.8G|  return std::any_of(begin, end, [](char b) { return b == '\n' || b == '\r'; });
  ------------------
  |  Branch (1005:54): [True: 64.0k, False: 21.8G]
  |  Branch (1005:67): [True: 53.8k, False: 21.8G]
  ------------------

json_reader.cpp:_ZN4JsonL15codePointToUTF8Ej:
   39|  2.01k|static inline String codePointToUTF8(unsigned int cp) {
   40|  2.01k|  String result;
   41|       |
   42|       |  // based on description from http://en.wikipedia.org/wiki/UTF-8
   43|       |
   44|  2.01k|  if (cp <= 0x7f) {
  ------------------
  |  Branch (44:7): [True: 334, False: 1.67k]
  ------------------
   45|    334|    result.resize(1);
   46|    334|    result[0] = static_cast<char>(cp);
   47|  1.67k|  } else if (cp <= 0x7FF) {
  ------------------
  |  Branch (47:14): [True: 293, False: 1.38k]
  ------------------
   48|    293|    result.resize(2);
   49|    293|    result[1] = static_cast<char>(0x80 | (0x3f & cp));
   50|    293|    result[0] = static_cast<char>(0xC0 | (0x1f & (cp >> 6)));
   51|  1.38k|  } else if (cp <= 0xFFFF) {
  ------------------
  |  Branch (51:14): [True: 608, False: 775]
  ------------------
   52|    608|    result.resize(3);
   53|    608|    result[2] = static_cast<char>(0x80 | (0x3f & cp));
   54|    608|    result[1] = static_cast<char>(0x80 | (0x3f & (cp >> 6)));
   55|    608|    result[0] = static_cast<char>(0xE0 | (0xf & (cp >> 12)));
   56|    775|  } else if (cp <= 0x10FFFF) {
  ------------------
  |  Branch (56:14): [True: 775, False: 0]
  ------------------
   57|    775|    result.resize(4);
   58|    775|    result[3] = static_cast<char>(0x80 | (0x3f & cp));
   59|    775|    result[2] = static_cast<char>(0x80 | (0x3f & (cp >> 6)));
   60|    775|    result[1] = static_cast<char>(0x80 | (0x3f & (cp >> 12)));
   61|    775|    result[0] = static_cast<char>(0xF0 | (0x7 & (cp >> 18)));
   62|    775|  }
   63|       |
   64|  2.01k|  return result;
   65|  2.01k|}

_ZN4Json5Value13nullSingletonEv:
   70|  1.28M|Value const& Value::nullSingleton() {
   71|  1.28M|  static Value const nullStatic;
   72|  1.28M|  return nullStatic;
   73|  1.28M|}
_ZN4Json9ExceptionC2ENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
  203|     28|Exception::Exception(String msg) : msg_(std::move(msg)) {}
_ZN4Json9ExceptionD2Ev:
  204|     28|Exception::~Exception() noexcept = default;
_ZN4Json12RuntimeErrorC2ERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
  206|     28|RuntimeError::RuntimeError(String const& msg) : Exception(msg) {}
_ZN4Json17throwRuntimeErrorERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEE:
  208|     28|JSONCPP_NORETURN void throwRuntimeError(String const& msg) {
  209|     28|  throw RuntimeError(msg);
  210|     28|}
_ZN4Json5Value8CZStringC2Ej:
  236|  1.19M|Value::CZString::CZString(ArrayIndex index) : cstr_(nullptr), index_(index) {}
_ZN4Json5Value8CZStringC2EPKcjNS1_17DuplicationPolicyE:
  240|   143k|    : cstr_(str) {
  241|       |  // allocate != duplicate
  242|   143k|  storage_.policy_ = allocate & 0x3;
  243|   143k|  storage_.length_ = length & 0x3FFFFFFF;
  244|   143k|}
_ZN4Json5Value8CZStringC2ERKS1_:
  246|  2.57M|Value::CZString::CZString(const CZString& other) {
  247|  2.57M|  cstr_ = (other.storage_.policy_ != noDuplication && other.cstr_ != nullptr
  ------------------
  |  Branch (247:12): [True: 1.88M, False: 691k]
  |  Branch (247:55): [True: 186k, False: 1.69M]
  ------------------
  248|  2.57M|               ? duplicateStringValue(other.cstr_, other.storage_.length_)
  249|  2.57M|               : other.cstr_);
  250|  2.57M|  storage_.policy_ =
  251|  2.57M|      static_cast<unsigned>(
  252|  2.57M|          other.cstr_
  ------------------
  |  Branch (252:11): [True: 186k, False: 2.38M]
  ------------------
  253|  2.57M|              ? (static_cast<DuplicationPolicy>(other.storage_.policy_) ==
  ------------------
  |  Branch (253:18): [True: 0, False: 186k]
  ------------------
  254|   186k|                         noDuplication
  255|   186k|                     ? noDuplication
  256|   186k|                     : duplicate)
  257|  2.57M|              : static_cast<DuplicationPolicy>(other.storage_.policy_)) &
  258|  2.57M|      3U;
  259|  2.57M|  storage_.length_ = other.storage_.length_;
  260|  2.57M|}
_ZN4Json5Value8CZStringD2Ev:
  267|  3.91M|Value::CZString::~CZString() {
  268|  3.91M|  if (cstr_ && storage_.policy_ == duplicate) {
  ------------------
  |  Branch (268:7): [True: 329k, False: 3.58M]
  |  Branch (268:16): [True: 186k, False: 143k]
  ------------------
  269|   186k|    releaseStringValue(const_cast<char*>(cstr_),
  270|   186k|                       storage_.length_ + 1U); // +1 for null terminating
  271|       |                                               // character for sake of
  272|       |                                               // completeness but not actually
  273|       |                                               // necessary
  274|   186k|  }
  275|  3.91M|}
_ZNK4Json5Value8CZStringltERKS1_:
  295|  33.1M|bool Value::CZString::operator<(const CZString& other) const {
  296|  33.1M|  if (!cstr_)
  ------------------
  |  Branch (296:7): [True: 32.5M, False: 663k]
  ------------------
  297|  32.5M|    return index_ < other.index_;
  298|       |  // return strcmp(cstr_, other.cstr_) < 0;
  299|       |  // Assume both are strings.
  300|   663k|  unsigned this_len = this->storage_.length_;
  301|   663k|  unsigned other_len = other.storage_.length_;
  302|   663k|  unsigned min_len = std::min<unsigned>(this_len, other_len);
  303|   663k|  JSON_ASSERT(this->cstr_ && other.cstr_);
  ------------------
  |  |   24|   663k|  do {                                                                         \
  |  |   25|  1.32M|    if (!(condition)) {                                                        \
  |  |  ------------------
  |  |  |  Branch (25:11): [True: 663k, False: 0]
  |  |  |  Branch (25:11): [True: 663k, False: 0]
  |  |  ------------------
  |  |   26|      0|      Json::throwLogicError("assert json failed");                             \
  |  |   27|      0|    }                                                                          \
  |  |   28|   663k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (28:12): [Folded - Ignored]
  |  |  ------------------
  ------------------
  304|   663k|  int comp = memcmp(this->cstr_, other.cstr_, min_len);
  305|   663k|  if (comp < 0)
  ------------------
  |  Branch (305:7): [True: 342k, False: 321k]
  ------------------
  306|   342k|    return true;
  307|   321k|  if (comp > 0)
  ------------------
  |  Branch (307:7): [True: 158k, False: 162k]
  ------------------
  308|   158k|    return false;
  309|   162k|  return (this_len < other_len);
  310|   321k|}
_ZNK4Json5Value8CZStringeqERKS1_:
  312|  82.8k|bool Value::CZString::operator==(const CZString& other) const {
  313|  82.8k|  if (!cstr_)
  ------------------
  |  Branch (313:7): [True: 0, False: 82.8k]
  ------------------
  314|      0|    return index_ == other.index_;
  315|       |  // return strcmp(cstr_, other.cstr_) == 0;
  316|       |  // Assume both are strings.
  317|  82.8k|  unsigned this_len = this->storage_.length_;
  318|  82.8k|  unsigned other_len = other.storage_.length_;
  319|  82.8k|  if (this_len != other_len)
  ------------------
  |  Branch (319:7): [True: 50.2k, False: 32.5k]
  ------------------
  320|  50.2k|    return false;
  321|  32.5k|  JSON_ASSERT(this->cstr_ && other.cstr_);
  ------------------
  |  |   24|  32.5k|  do {                                                                         \
  |  |   25|  65.1k|    if (!(condition)) {                                                        \
  |  |  ------------------
  |  |  |  Branch (25:11): [True: 32.5k, False: 0]
  |  |  |  Branch (25:11): [True: 32.5k, False: 0]
  |  |  ------------------
  |  |   26|      0|      Json::throwLogicError("assert json failed");                             \
  |  |   27|      0|    }                                                                          \
  |  |   28|  32.5k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (28:12): [Folded - Ignored]
  |  |  ------------------
  ------------------
  322|  32.5k|  int comp = memcmp(this->cstr_, other.cstr_, this_len);
  323|  32.5k|  return comp == 0;
  324|  82.8k|}
_ZN4Json5ValueC2ENS_9ValueTypeE:
  347|  1.23M|Value::Value(ValueType type) {
  348|  1.23M|  static char const emptyString[] = "";
  349|  1.23M|  initBasic(type);
  350|  1.23M|  switch (type) {
  351|  1.15M|  case nullValue:
  ------------------
  |  Branch (351:3): [True: 1.15M, False: 78.1k]
  ------------------
  352|  1.15M|    break;
  353|      0|  case intValue:
  ------------------
  |  Branch (353:3): [True: 0, False: 1.23M]
  ------------------
  354|      0|  case uintValue:
  ------------------
  |  Branch (354:3): [True: 0, False: 1.23M]
  ------------------
  355|      0|    value_.int_ = 0;
  356|      0|    break;
  357|      0|  case realValue:
  ------------------
  |  Branch (357:3): [True: 0, False: 1.23M]
  ------------------
  358|      0|    value_.real_ = 0.0;
  359|      0|    break;
  360|      0|  case stringValue:
  ------------------
  |  Branch (360:3): [True: 0, False: 1.23M]
  ------------------
  361|       |    // allocated_ == false, so this is safe.
  362|      0|    value_.string_ = const_cast<char*>(static_cast<char const*>(emptyString));
  363|      0|    break;
  364|  64.7k|  case arrayValue:
  ------------------
  |  Branch (364:3): [True: 64.7k, False: 1.16M]
  ------------------
  365|  78.1k|  case objectValue:
  ------------------
  |  Branch (365:3): [True: 13.3k, False: 1.21M]
  ------------------
  366|  78.1k|    value_.map_ = new ObjectValues();
  367|  78.1k|    break;
  368|      0|  case booleanValue:
  ------------------
  |  Branch (368:3): [True: 0, False: 1.23M]
  ------------------
  369|      0|    value_.bool_ = false;
  370|      0|    break;
  371|      0|  default:
  ------------------
  |  Branch (371:3): [True: 0, False: 1.23M]
  ------------------
  372|      0|    JSON_ASSERT_UNREACHABLE;
  ------------------
  |  |   48|      0|#define JSON_ASSERT_UNREACHABLE assert(false)
  ------------------
  373|  1.23M|  }
  374|  1.23M|}
_ZN4Json5ValueC2Ei:
  376|  3.31k|Value::Value(Int value) {
  377|  3.31k|  initBasic(intValue);
  378|  3.31k|  value_.int_ = value;
  379|  3.31k|}
_ZN4Json5ValueC2Ej:
  381|  36.4k|Value::Value(UInt value) {
  382|  36.4k|  initBasic(uintValue);
  383|  36.4k|  value_.uint_ = value;
  384|  36.4k|}
_ZN4Json5ValueC2El:
  386|  1.14M|Value::Value(Int64 value) {
  387|  1.14M|  initBasic(intValue);
  388|  1.14M|  value_.int_ = value;
  389|  1.14M|}
_ZN4Json5ValueC2Em:
  390|    620|Value::Value(UInt64 value) {
  391|    620|  initBasic(uintValue);
  392|    620|  value_.uint_ = value;
  393|    620|}
_ZN4Json5ValueC2Ed:
  396|  3.06k|Value::Value(double value) {
  397|  3.06k|  initBasic(realValue);
  398|  3.06k|  value_.real_ = value;
  399|  3.06k|}
_ZN4Json5ValueC2ERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
  415|    817|Value::Value(const String& value) {
  416|    817|  initBasic(stringValue, true);
  417|    817|  value_.string_ = duplicateAndPrefixStringValue(
  418|    817|      value.data(), static_cast<unsigned>(value.length()));
  419|    817|}
_ZN4Json5ValueC2Eb:
  426|  38.0k|Value::Value(bool value) {
  427|  38.0k|  initBasic(booleanValue);
  428|  38.0k|  value_.bool_ = value;
  429|  38.0k|}
_ZN4Json5ValueC2ERKS0_:
  431|  2.57M|Value::Value(const Value& other) {
  432|  2.57M|  dupPayload(other);
  433|  2.57M|  dupMeta(other);
  434|  2.57M|}
_ZN4Json5ValueD2Ev:
  441|  5.02M|Value::~Value() {
  442|  5.02M|  releasePayload();
  443|  5.02M|  value_.uint_ = 0;
  444|  5.02M|}
_ZN4Json5ValueaSEOS0_:
  451|  1.22M|Value& Value::operator=(Value&& other) noexcept {
  452|  1.22M|  other.swap(*this);
  453|  1.22M|  return *this;
  454|  1.22M|}
_ZN4Json5Value11swapPayloadERS0_:
  456|  2.44M|void Value::swapPayload(Value& other) {
  457|  2.44M|  std::swap(bits_, other.bits_);
  458|  2.44M|  std::swap(value_, other.value_);
  459|  2.44M|}
_ZN4Json5Value4swapERS0_:
  466|  1.22M|void Value::swap(Value& other) {
  467|  1.22M|  swapPayload(other);
  468|  1.22M|  std::swap(comments_, other.comments_);
  469|  1.22M|  std::swap(start_, other.start_);
  470|  1.22M|  std::swap(limit_, other.limit_);
  471|  1.22M|}
_ZNK4Json5Value4typeEv:
  478|  14.2M|ValueType Value::type() const {
  479|  14.2M|  return static_cast<ValueType>(bits_.value_type_);
  480|  14.2M|}
_ZNK4Json5Value6asUIntEv:
  676|  3.31k|Value::UInt Value::asUInt() const {
  677|  3.31k|  switch (type()) {
  678|  3.31k|  case intValue:
  ------------------
  |  Branch (678:3): [True: 3.31k, False: 0]
  ------------------
  679|  3.31k|    JSON_ASSERT_MESSAGE(isUInt(), "LargestInt out of UInt range");
  ------------------
  |  |   55|  3.31k|  do {                                                                         \
  |  |   56|  3.31k|    if (!(condition)) {                                                        \
  |  |  ------------------
  |  |  |  Branch (56:9): [True: 0, False: 3.31k]
  |  |  ------------------
  |  |   57|      0|      JSON_FAIL_MESSAGE(message);                                              \
  |  |  ------------------
  |  |  |  |   31|      0|  do {                                                                         \
  |  |  |  |   32|      0|    OStringStream oss;                                                         \
  |  |  |  |   33|      0|    oss << message;                                                            \
  |  |  |  |   34|      0|    Json::throwLogicError(oss.str());                                          \
  |  |  |  |   35|      0|    abort();                                                                   \
  |  |  |  |   36|      0|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (36:12): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   58|      0|    }                                                                          \
  |  |   59|  3.31k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (59:12): [Folded - Ignored]
  |  |  ------------------
  ------------------
  680|  3.31k|    return UInt(value_.int_);
  681|      0|  case uintValue:
  ------------------
  |  Branch (681:3): [True: 0, False: 3.31k]
  ------------------
  682|      0|    JSON_ASSERT_MESSAGE(isUInt(), "LargestUInt out of UInt range");
  ------------------
  |  |   55|      0|  do {                                                                         \
  |  |   56|      0|    if (!(condition)) {                                                        \
  |  |  ------------------
  |  |  |  Branch (56:9): [True: 0, False: 0]
  |  |  ------------------
  |  |   57|      0|      JSON_FAIL_MESSAGE(message);                                              \
  |  |  ------------------
  |  |  |  |   31|      0|  do {                                                                         \
  |  |  |  |   32|      0|    OStringStream oss;                                                         \
  |  |  |  |   33|      0|    oss << message;                                                            \
  |  |  |  |   34|      0|    Json::throwLogicError(oss.str());                                          \
  |  |  |  |   35|      0|    abort();                                                                   \
  |  |  |  |   36|      0|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (36:12): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   58|      0|    }                                                                          \
  |  |   59|      0|  } while (0)
  |  |  ------------------
  |  |  |  Branch (59:12): [Folded - Ignored]
  |  |  ------------------
  ------------------
  683|      0|    return UInt(value_.uint_);
  684|      0|  case realValue:
  ------------------
  |  Branch (684:3): [True: 0, False: 3.31k]
  ------------------
  685|      0|    JSON_ASSERT_MESSAGE(InRange(value_.real_, 0, maxUInt),
  ------------------
  |  |   55|      0|  do {                                                                         \
  |  |   56|      0|    if (!(condition)) {                                                        \
  |  |  ------------------
  |  |  |  Branch (56:9): [True: 0, False: 0]
  |  |  ------------------
  |  |   57|      0|      JSON_FAIL_MESSAGE(message);                                              \
  |  |  ------------------
  |  |  |  |   31|      0|  do {                                                                         \
  |  |  |  |   32|      0|    OStringStream oss;                                                         \
  |  |  |  |   33|      0|    oss << message;                                                            \
  |  |  |  |   34|      0|    Json::throwLogicError(oss.str());                                          \
  |  |  |  |   35|      0|    abort();                                                                   \
  |  |  |  |   36|      0|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (36:12): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   58|      0|    }                                                                          \
  |  |   59|      0|  } while (0)
  |  |  ------------------
  |  |  |  Branch (59:12): [Folded - Ignored]
  |  |  ------------------
  ------------------
  686|      0|                        "double out of UInt range");
  687|      0|    return UInt(value_.real_);
  688|      0|  case nullValue:
  ------------------
  |  Branch (688:3): [True: 0, False: 3.31k]
  ------------------
  689|      0|    return 0;
  690|      0|  case booleanValue:
  ------------------
  |  Branch (690:3): [True: 0, False: 3.31k]
  ------------------
  691|      0|    return value_.bool_ ? 1 : 0;
  ------------------
  |  Branch (691:12): [True: 0, False: 0]
  ------------------
  692|      0|  default:
  ------------------
  |  Branch (692:3): [True: 0, False: 3.31k]
  ------------------
  693|      0|    break;
  694|  3.31k|  }
  695|      0|  JSON_FAIL_MESSAGE("Value is not convertible to UInt.");
  ------------------
  |  |   31|      0|  do {                                                                         \
  |  |   32|      0|    OStringStream oss;                                                         \
  |  |   33|      0|    oss << message;                                                            \
  |  |   34|      0|    Json::throwLogicError(oss.str());                                          \
  |  |   35|      0|    abort();                                                                   \
  |  |   36|      0|  } while (0)
  |  |  ------------------
  |  |  |  Branch (36:12): [Folded - Ignored]
  |  |  ------------------
  ------------------
  696|      0|}
_ZNK4Json5Value6asBoolEv:
  804|  36.4k|bool Value::asBool() const {
  805|  36.4k|  switch (type()) {
  806|  29.8k|  case booleanValue:
  ------------------
  |  Branch (806:3): [True: 29.8k, False: 6.63k]
  ------------------
  807|  29.8k|    return value_.bool_;
  808|      0|  case nullValue:
  ------------------
  |  Branch (808:3): [True: 0, False: 36.4k]
  ------------------
  809|      0|    return false;
  810|      0|  case intValue:
  ------------------
  |  Branch (810:3): [True: 0, False: 36.4k]
  ------------------
  811|      0|    return value_.int_ != 0;
  812|  6.63k|  case uintValue:
  ------------------
  |  Branch (812:3): [True: 6.63k, False: 29.8k]
  ------------------
  813|  6.63k|    return value_.uint_ != 0;
  814|      0|  case realValue: {
  ------------------
  |  Branch (814:3): [True: 0, False: 36.4k]
  ------------------
  815|       |    // According to JavaScript language zero or NaN is regarded as false
  816|      0|    const auto value_classification = std::fpclassify(value_.real_);
  817|      0|    return value_classification != FP_ZERO && value_classification != FP_NAN;
  ------------------
  |  Branch (817:12): [True: 0, False: 0]
  |  Branch (817:47): [True: 0, False: 0]
  ------------------
  818|      0|  }
  819|      0|  default:
  ------------------
  |  Branch (819:3): [True: 0, False: 36.4k]
  ------------------
  820|      0|    break;
  821|  36.4k|  }
  822|      0|  JSON_FAIL_MESSAGE("Value is not convertible to bool.");
  ------------------
  |  |   31|      0|  do {                                                                         \
  |  |   32|      0|    OStringStream oss;                                                         \
  |  |   33|      0|    oss << message;                                                            \
  |  |   34|      0|    Json::throwLogicError(oss.str());                                          \
  |  |   35|      0|    abort();                                                                   \
  |  |   36|      0|  } while (0)
  |  |  ------------------
  |  |  |  Branch (36:12): [Folded - Ignored]
  |  |  ------------------
  ------------------
  823|      0|}
_ZN4Json5ValueixEj:
  925|  1.19M|Value& Value::operator[](ArrayIndex index) {
  926|  1.19M|  JSON_ASSERT_MESSAGE(
  ------------------
  |  |   55|  1.19M|  do {                                                                         \
  |  |   56|  2.38M|    if (!(condition)) {                                                        \
  |  |  ------------------
  |  |  |  Branch (56:11): [True: 0, False: 1.19M]
  |  |  |  Branch (56:11): [True: 1.19M, False: 0]
  |  |  ------------------
  |  |   57|      0|      JSON_FAIL_MESSAGE(message);                                              \
  |  |  ------------------
  |  |  |  |   31|      0|  do {                                                                         \
  |  |  |  |   32|      0|    OStringStream oss;                                                         \
  |  |  |  |   33|      0|    oss << message;                                                            \
  |  |  |  |   34|      0|    Json::throwLogicError(oss.str());                                          \
  |  |  |  |   35|      0|    abort();                                                                   \
  |  |  |  |   36|      0|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (36:12): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   58|      0|    }                                                                          \
  |  |   59|  1.19M|  } while (0)
  |  |  ------------------
  |  |  |  Branch (59:12): [Folded - Ignored]
  |  |  ------------------
  ------------------
  927|  1.19M|      type() == nullValue || type() == arrayValue,
  928|  1.19M|      "in Json::Value::operator[](ArrayIndex): requires arrayValue");
  929|  1.19M|  if (type() == nullValue)
  ------------------
  |  Branch (929:7): [True: 0, False: 1.19M]
  ------------------
  930|      0|    *this = Value(arrayValue);
  931|  1.19M|  CZString key(index);
  932|  1.19M|  auto it = value_.map_->lower_bound(key);
  933|  1.19M|  if (it != value_.map_->end() && (*it).first == key)
  ------------------
  |  Branch (933:7): [True: 0, False: 1.19M]
  |  Branch (933:7): [True: 0, False: 1.19M]
  |  Branch (933:35): [True: 0, False: 0]
  ------------------
  934|      0|    return (*it).second;
  935|       |
  936|  1.19M|  ObjectValues::value_type defaultValue(key, nullSingleton());
  937|  1.19M|  it = value_.map_->insert(it, defaultValue);
  938|  1.19M|  return (*it).second;
  939|  1.19M|}
_ZN4Json5ValueixEi:
  941|  1.19M|Value& Value::operator[](int index) {
  942|  1.19M|  JSON_ASSERT_MESSAGE(
  ------------------
  |  |   55|  1.19M|  do {                                                                         \
  |  |   56|  1.19M|    if (!(condition)) {                                                        \
  |  |  ------------------
  |  |  |  Branch (56:9): [True: 0, False: 1.19M]
  |  |  ------------------
  |  |   57|      0|      JSON_FAIL_MESSAGE(message);                                              \
  |  |  ------------------
  |  |  |  |   31|      0|  do {                                                                         \
  |  |  |  |   32|      0|    OStringStream oss;                                                         \
  |  |  |  |   33|      0|    oss << message;                                                            \
  |  |  |  |   34|      0|    Json::throwLogicError(oss.str());                                          \
  |  |  |  |   35|      0|    abort();                                                                   \
  |  |  |  |   36|      0|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (36:12): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   58|      0|    }                                                                          \
  |  |   59|  1.19M|  } while (0)
  |  |  ------------------
  |  |  |  Branch (59:12): [Folded - Ignored]
  |  |  ------------------
  ------------------
  943|  1.19M|      index >= 0,
  944|  1.19M|      "in Json::Value::operator[](int index): index cannot be negative");
  945|  1.19M|  return (*this)[ArrayIndex(index)];
  946|  1.19M|}
_ZN4Json5Value9initBasicENS_9ValueTypeEb:
  968|  2.45M|void Value::initBasic(ValueType type, bool allocated) {
  969|  2.45M|  setType(type);
  970|  2.45M|  setIsAllocated(allocated);
  971|  2.45M|  comments_ = Comments{};
  972|  2.45M|  start_ = 0;
  973|  2.45M|  limit_ = 0;
  974|  2.45M|}
_ZN4Json5Value10dupPayloadERKS0_:
  976|  2.57M|void Value::dupPayload(const Value& other) {
  977|  2.57M|  setType(other.type());
  978|  2.57M|  setIsAllocated(false);
  979|  2.57M|  switch (type()) {
  980|  2.57M|  case nullValue:
  ------------------
  |  Branch (980:3): [True: 2.57M, False: 0]
  ------------------
  981|  2.57M|  case intValue:
  ------------------
  |  Branch (981:3): [True: 0, False: 2.57M]
  ------------------
  982|  2.57M|  case uintValue:
  ------------------
  |  Branch (982:3): [True: 0, False: 2.57M]
  ------------------
  983|  2.57M|  case realValue:
  ------------------
  |  Branch (983:3): [True: 0, False: 2.57M]
  ------------------
  984|  2.57M|  case booleanValue:
  ------------------
  |  Branch (984:3): [True: 0, False: 2.57M]
  ------------------
  985|  2.57M|    value_ = other.value_;
  986|  2.57M|    break;
  987|      0|  case stringValue:
  ------------------
  |  Branch (987:3): [True: 0, False: 2.57M]
  ------------------
  988|      0|    if (other.value_.string_ && other.isAllocated()) {
  ------------------
  |  Branch (988:9): [True: 0, False: 0]
  |  Branch (988:33): [True: 0, False: 0]
  ------------------
  989|      0|      unsigned len;
  990|      0|      char const* str;
  991|      0|      decodePrefixedString(other.isAllocated(), other.value_.string_, &len,
  992|      0|                           &str);
  993|      0|      value_.string_ = duplicateAndPrefixStringValue(str, len);
  994|      0|      setIsAllocated(true);
  995|      0|    } else {
  996|      0|      value_.string_ = other.value_.string_;
  997|      0|    }
  998|      0|    break;
  999|      0|  case arrayValue:
  ------------------
  |  Branch (999:3): [True: 0, False: 2.57M]
  ------------------
 1000|      0|  case objectValue:
  ------------------
  |  Branch (1000:3): [True: 0, False: 2.57M]
  ------------------
 1001|      0|    value_.map_ = new ObjectValues(*other.value_.map_);
 1002|      0|    break;
 1003|      0|  default:
  ------------------
  |  Branch (1003:3): [True: 0, False: 2.57M]
  ------------------
 1004|      0|    JSON_ASSERT_UNREACHABLE;
  ------------------
  |  |   48|      0|#define JSON_ASSERT_UNREACHABLE assert(false)
  ------------------
 1005|  2.57M|  }
 1006|  2.57M|}
_ZN4Json5Value14releasePayloadEv:
 1008|  5.02M|void Value::releasePayload() {
 1009|  5.02M|  switch (type()) {
 1010|  3.72M|  case nullValue:
  ------------------
  |  Branch (1010:3): [True: 3.72M, False: 1.30M]
  ------------------
 1011|  4.87M|  case intValue:
  ------------------
  |  Branch (1011:3): [True: 1.14M, False: 3.88M]
  ------------------
 1012|  4.90M|  case uintValue:
  ------------------
  |  Branch (1012:3): [True: 37.1k, False: 4.99M]
  ------------------
 1013|  4.91M|  case realValue:
  ------------------
  |  Branch (1013:3): [True: 3.06k, False: 5.02M]
  ------------------
 1014|  4.94M|  case booleanValue:
  ------------------
  |  Branch (1014:3): [True: 38.0k, False: 4.98M]
  ------------------
 1015|  4.94M|    break;
 1016|    817|  case stringValue:
  ------------------
  |  Branch (1016:3): [True: 817, False: 5.02M]
  ------------------
 1017|    817|    if (isAllocated())
  ------------------
  |  Branch (1017:9): [True: 817, False: 0]
  ------------------
 1018|    817|      releasePrefixedStringValue(value_.string_);
 1019|    817|    break;
 1020|  64.7k|  case arrayValue:
  ------------------
  |  Branch (1020:3): [True: 64.7k, False: 4.96M]
  ------------------
 1021|  78.1k|  case objectValue:
  ------------------
  |  Branch (1021:3): [True: 13.3k, False: 5.01M]
  ------------------
 1022|  78.1k|    delete value_.map_;
 1023|  78.1k|    break;
 1024|      0|  default:
  ------------------
  |  Branch (1024:3): [True: 0, False: 5.02M]
  ------------------
 1025|      0|    JSON_ASSERT_UNREACHABLE;
  ------------------
  |  |   48|      0|#define JSON_ASSERT_UNREACHABLE assert(false)
  ------------------
 1026|  5.02M|  }
 1027|  5.02M|}
_ZN4Json5Value7dupMetaERKS0_:
 1029|  2.57M|void Value::dupMeta(const Value& other) {
 1030|  2.57M|  comments_ = other.comments_;
 1031|  2.57M|  start_ = other.start_;
 1032|  2.57M|  limit_ = other.limit_;
 1033|  2.57M|}
_ZN4Json5Value16resolveReferenceEPKcS2_:
 1057|   103k|Value& Value::resolveReference(char const* key, char const* end) {
 1058|   103k|  JSON_ASSERT_MESSAGE(
  ------------------
  |  |   55|   103k|  do {                                                                         \
  |  |   56|   203k|    if (!(condition)) {                                                        \
  |  |  ------------------
  |  |  |  Branch (56:11): [True: 3.31k, False: 100k]
  |  |  |  Branch (56:11): [True: 100k, False: 0]
  |  |  ------------------
  |  |   57|      0|      JSON_FAIL_MESSAGE(message);                                              \
  |  |  ------------------
  |  |  |  |   31|      0|  do {                                                                         \
  |  |  |  |   32|      0|    OStringStream oss;                                                         \
  |  |  |  |   33|      0|    oss << message;                                                            \
  |  |  |  |   34|      0|    Json::throwLogicError(oss.str());                                          \
  |  |  |  |   35|      0|    abort();                                                                   \
  |  |  |  |   36|      0|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (36:12): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   58|      0|    }                                                                          \
  |  |   59|   103k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (59:12): [Folded - Ignored]
  |  |  ------------------
  ------------------
 1059|   103k|      type() == nullValue || type() == objectValue,
 1060|   103k|      "in Json::Value::resolveReference(key, end): requires objectValue");
 1061|   103k|  if (type() == nullValue)
  ------------------
  |  Branch (1061:7): [True: 3.31k, False: 100k]
  ------------------
 1062|  3.31k|    *this = Value(objectValue);
 1063|   103k|  CZString actualKey(key, static_cast<unsigned>(end - key),
 1064|   103k|                     CZString::duplicateOnCopy);
 1065|   103k|  auto it = value_.map_->lower_bound(actualKey);
 1066|   103k|  if (it != value_.map_->end() && (*it).first == actualKey)
  ------------------
  |  Branch (1066:7): [True: 82.8k, False: 20.6k]
  |  Branch (1066:7): [True: 10.1k, False: 93.3k]
  |  Branch (1066:35): [True: 10.1k, False: 72.7k]
  ------------------
 1067|  10.1k|    return (*it).second;
 1068|       |
 1069|  93.3k|  ObjectValues::value_type defaultValue(actualKey, nullSingleton());
 1070|  93.3k|  it = value_.map_->insert(it, defaultValue);
 1071|  93.3k|  Value& value = (*it).second;
 1072|  93.3k|  return value;
 1073|   103k|}
_ZNK4Json5Value4findEPKcS2_:
 1082|  39.8k|Value const* Value::find(char const* begin, char const* end) const {
 1083|  39.8k|  JSON_ASSERT_MESSAGE(type() == nullValue || type() == objectValue,
  ------------------
  |  |   55|  39.8k|  do {                                                                         \
  |  |   56|  79.6k|    if (!(condition)) {                                                        \
  |  |  ------------------
  |  |  |  Branch (56:11): [True: 0, False: 39.8k]
  |  |  |  Branch (56:11): [True: 39.8k, False: 0]
  |  |  ------------------
  |  |   57|      0|      JSON_FAIL_MESSAGE(message);                                              \
  |  |  ------------------
  |  |  |  |   31|      0|  do {                                                                         \
  |  |  |  |   32|      0|    OStringStream oss;                                                         \
  |  |  |  |   33|      0|    oss << message;                                                            \
  |  |  |  |   34|      0|    Json::throwLogicError(oss.str());                                          \
  |  |  |  |   35|      0|    abort();                                                                   \
  |  |  |  |   36|      0|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (36:12): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   58|      0|    }                                                                          \
  |  |   59|  39.8k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (59:12): [Folded - Ignored]
  |  |  ------------------
  ------------------
 1084|  39.8k|                      "in Json::Value::find(begin, end): requires "
 1085|  39.8k|                      "objectValue or nullValue");
 1086|  39.8k|  if (type() == nullValue)
  ------------------
  |  Branch (1086:7): [True: 0, False: 39.8k]
  ------------------
 1087|      0|    return nullptr;
 1088|  39.8k|  CZString actualKey(begin, static_cast<unsigned>(end - begin),
 1089|  39.8k|                     CZString::noDuplication);
 1090|  39.8k|  ObjectValues::const_iterator it = value_.map_->find(actualKey);
 1091|  39.8k|  if (it == value_.map_->end())
  ------------------
  |  Branch (1091:7): [True: 0, False: 39.8k]
  ------------------
 1092|      0|    return nullptr;
 1093|  39.8k|  return &(*it).second;
 1094|  39.8k|}
_ZNK4Json5ValueixEPKc:
 1101|  39.8k|const Value& Value::operator[](const char* key) const {
 1102|  39.8k|  Value const* found = find(key, key + strlen(key));
 1103|  39.8k|  if (!found)
  ------------------
  |  Branch (1103:7): [True: 0, False: 39.8k]
  ------------------
 1104|      0|    return nullSingleton();
 1105|  39.8k|  return *found;
 1106|  39.8k|}
_ZN4Json5ValueixEPKc:
 1114|  76.3k|Value& Value::operator[](const char* key) {
 1115|  76.3k|  return resolveReference(key, key + strlen(key));
 1116|  76.3k|}
_ZN4Json5ValueixERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
 1118|  27.1k|Value& Value::operator[](const String& key) {
 1119|  27.1k|  return resolveReference(key.data(), key.data() + key.length());
 1120|  27.1k|}
_ZNK4Json5Value6isUIntEv:
 1277|  3.31k|bool Value::isUInt() const {
 1278|  3.31k|  switch (type()) {
 1279|  3.31k|  case intValue:
  ------------------
  |  Branch (1279:3): [True: 3.31k, False: 0]
  ------------------
 1280|  3.31k|#if defined(JSON_HAS_INT64)
 1281|  3.31k|    return value_.int_ >= 0 && LargestUInt(value_.int_) <= LargestUInt(maxUInt);
  ------------------
  |  Branch (1281:12): [True: 3.31k, False: 0]
  |  Branch (1281:32): [True: 3.31k, False: 0]
  ------------------
 1282|       |#else
 1283|       |    return value_.int_ >= 0;
 1284|       |#endif
 1285|      0|  case uintValue:
  ------------------
  |  Branch (1285:3): [True: 0, False: 3.31k]
  ------------------
 1286|      0|#if defined(JSON_HAS_INT64)
 1287|      0|    return value_.uint_ <= maxUInt;
 1288|       |#else
 1289|       |    return true;
 1290|       |#endif
 1291|      0|  case realValue:
  ------------------
  |  Branch (1291:3): [True: 0, False: 3.31k]
  ------------------
 1292|      0|    return value_.real_ >= 0 && value_.real_ <= maxUInt &&
  ------------------
  |  Branch (1292:12): [True: 0, False: 0]
  |  Branch (1292:33): [True: 0, False: 0]
  ------------------
 1293|      0|           IsIntegral(value_.real_);
  ------------------
  |  Branch (1293:12): [True: 0, False: 0]
  ------------------
 1294|      0|  default:
  ------------------
  |  Branch (1294:3): [True: 0, False: 3.31k]
  ------------------
 1295|      0|    break;
 1296|  3.31k|  }
 1297|      0|  return false;
 1298|  3.31k|}
_ZN4Json5Value8CommentsC2EOS1_:
 1378|  1.22M|    : ptr_{std::move(that.ptr_)} {}
_ZN4Json5Value8CommentsaSERKS1_:
 1380|  2.57M|Value::Comments& Value::Comments::operator=(const Comments& that) {
 1381|  2.57M|  ptr_ = cloneUnique(that.ptr_);
 1382|  2.57M|  return *this;
 1383|  2.57M|}
_ZN4Json5Value8CommentsaSEOS1_:
 1385|  4.90M|Value::Comments& Value::Comments::operator=(Comments&& that) noexcept {
 1386|  4.90M|  ptr_ = std::move(that.ptr_);
 1387|  4.90M|  return *this;
 1388|  4.90M|}
_ZN4Json5Value8Comments3setENS_16CommentPlacementENSt3__112basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEE:
 1400|  3.10k|void Value::Comments::set(CommentPlacement slot, String comment) {
 1401|  3.10k|  if (slot >= CommentPlacement::numberOfCommentPlacement)
  ------------------
  |  Branch (1401:7): [True: 0, False: 3.10k]
  ------------------
 1402|      0|    return;
 1403|  3.10k|  if (!ptr_)
  ------------------
  |  Branch (1403:7): [True: 2.51k, False: 592]
  ------------------
 1404|  2.51k|    ptr_ = std::unique_ptr<Array>(new Array());
 1405|  3.10k|  (*ptr_)[slot] = std::move(comment);
 1406|  3.10k|}
_ZN4Json5Value10setCommentENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEENS_16CommentPlacementE:
 1408|  3.10k|void Value::setComment(String comment, CommentPlacement placement) {
 1409|  3.10k|  if (!comment.empty() && (comment.back() == '\n')) {
  ------------------
  |  Branch (1409:7): [True: 3.10k, False: 0]
  |  Branch (1409:27): [True: 1.88k, False: 1.22k]
  ------------------
 1410|       |    // Always discard trailing newline, to aid indentation.
 1411|  1.88k|    comment.pop_back();
 1412|  1.88k|  }
 1413|  3.10k|  JSON_ASSERT(!comment.empty());
  ------------------
  |  |   24|  3.10k|  do {                                                                         \
  |  |   25|  3.10k|    if (!(condition)) {                                                        \
  |  |  ------------------
  |  |  |  Branch (25:9): [True: 0, False: 3.10k]
  |  |  ------------------
  |  |   26|      0|      Json::throwLogicError("assert json failed");                             \
  |  |   27|      0|    }                                                                          \
  |  |   28|  3.10k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (28:12): [Folded - Ignored]
  |  |  ------------------
  ------------------
 1414|  3.10k|  JSON_ASSERT_MESSAGE(
  ------------------
  |  |   55|  3.10k|  do {                                                                         \
  |  |   56|  6.21k|    if (!(condition)) {                                                        \
  |  |  ------------------
  |  |  |  Branch (56:11): [True: 0, False: 3.10k]
  |  |  |  Branch (56:11): [True: 3.10k, False: 0]
  |  |  ------------------
  |  |   57|      0|      JSON_FAIL_MESSAGE(message);                                              \
  |  |  ------------------
  |  |  |  |   31|      0|  do {                                                                         \
  |  |  |  |   32|      0|    OStringStream oss;                                                         \
  |  |  |  |   33|      0|    oss << message;                                                            \
  |  |  |  |   34|      0|    Json::throwLogicError(oss.str());                                          \
  |  |  |  |   35|      0|    abort();                                                                   \
  |  |  |  |   36|      0|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (36:12): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   58|      0|    }                                                                          \
  |  |   59|  3.10k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (59:12): [Folded - Ignored]
  |  |  ------------------
  ------------------
 1415|  3.10k|      comment[0] == '\0' || comment[0] == '/',
 1416|  3.10k|      "in Json::Value::setComment(): Comments must start with /");
 1417|  3.10k|  comments_.set(placement, std::move(comment));
 1418|  3.10k|}
_ZN4Json5Value14setOffsetStartEl:
 1428|  1.22M|void Value::setOffsetStart(ptrdiff_t start) { start_ = start; }
_ZN4Json5Value14setOffsetLimitEl:
 1430|  1.19M|void Value::setOffsetLimit(ptrdiff_t limit) { limit_ = limit; }
json_value.cpp:_ZN4JsonL20duplicateStringValueEPKcm:
  115|   186k|static inline char* duplicateStringValue(const char* value, size_t length) {
  116|       |  // Avoid an integer overflow in the call to malloc below by limiting length
  117|       |  // to a sane value.
  118|   186k|  if (length >= static_cast<size_t>(Value::maxInt))
  ------------------
  |  Branch (118:7): [True: 0, False: 186k]
  ------------------
  119|      0|    length = Value::maxInt - 1;
  120|       |
  121|   186k|  auto newString = static_cast<char*>(malloc(length + 1));
  122|   186k|  if (newString == nullptr) {
  ------------------
  |  Branch (122:7): [True: 0, False: 186k]
  ------------------
  123|      0|    throwRuntimeError("in Json::Value::duplicateStringValue(): "
  124|      0|                      "Failed to allocate string value buffer");
  125|      0|  }
  126|   186k|  memcpy(newString, value, length);
  127|   186k|  newString[length] = 0;
  128|   186k|  return newString;
  129|   186k|}
json_value.cpp:_ZN4JsonL18releaseStringValueEPcj:
  183|   186k|static inline void releaseStringValue(char* value, unsigned) { free(value); }
json_value.cpp:_ZN4JsonL29duplicateAndPrefixStringValueEPKcj:
  134|    817|                                                  unsigned int length) {
  135|       |  // Avoid an integer overflow in the call to malloc below by limiting length
  136|       |  // to a sane value.
  137|    817|  JSON_ASSERT_MESSAGE(length <= static_cast<unsigned>(Value::maxInt) -
  ------------------
  |  |   55|    817|  do {                                                                         \
  |  |   56|    817|    if (!(condition)) {                                                        \
  |  |  ------------------
  |  |  |  Branch (56:9): [True: 0, False: 817]
  |  |  ------------------
  |  |   57|      0|      JSON_FAIL_MESSAGE(message);                                              \
  |  |  ------------------
  |  |  |  |   31|      0|  do {                                                                         \
  |  |  |  |   32|      0|    OStringStream oss;                                                         \
  |  |  |  |   33|      0|    oss << message;                                                            \
  |  |  |  |   34|      0|    Json::throwLogicError(oss.str());                                          \
  |  |  |  |   35|      0|    abort();                                                                   \
  |  |  |  |   36|      0|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (36:12): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   58|      0|    }                                                                          \
  |  |   59|    817|  } while (0)
  |  |  ------------------
  |  |  |  Branch (59:12): [Folded - Ignored]
  |  |  ------------------
  ------------------
  138|    817|                                    sizeof(unsigned) - 1U,
  139|    817|                      "in Json::Value::duplicateAndPrefixStringValue(): "
  140|    817|                      "length too big for prefixing");
  141|    817|  size_t actualLength = sizeof(length) + length + 1;
  142|    817|  auto newString = static_cast<char*>(malloc(actualLength));
  143|    817|  if (newString == nullptr) {
  ------------------
  |  Branch (143:7): [True: 0, False: 817]
  ------------------
  144|      0|    throwRuntimeError("in Json::Value::duplicateAndPrefixStringValue(): "
  145|      0|                      "Failed to allocate string value buffer");
  146|      0|  }
  147|    817|  *reinterpret_cast<unsigned*>(newString) = length;
  148|    817|  memcpy(newString + sizeof(unsigned), value, length);
  149|    817|  newString[actualLength - 1U] =
  150|    817|      0; // to avoid buffer over-run accidents by users later
  151|    817|  return newString;
  152|    817|}
json_value.cpp:_ZN4JsonL26releasePrefixedStringValueEPc:
  182|    817|static inline void releasePrefixedStringValue(char* value) { free(value); }
json_value.cpp:_ZN4JsonL11cloneUniqueINSt3__15arrayINS1_12basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEELm3EEEEENS1_10unique_ptrIT_NS1_14default_deleteISB_EEEERKSE_:
   52|  2.57M|static std::unique_ptr<T> cloneUnique(const std::unique_ptr<T>& p) {
   53|  2.57M|  std::unique_ptr<T> r;
   54|  2.57M|  if (p) {
  ------------------
  |  Branch (54:7): [True: 0, False: 2.57M]
  ------------------
   55|      0|    r = std::unique_ptr<T>(new T(*p));
   56|      0|  }
   57|  2.57M|  return r;
   58|  2.57M|}

