_ZN8firebase9firestore5model4impl8BasePathINS1_9FieldPathEEC2EONSt3__16vectorINS6_12basic_stringIcNS6_11char_traitsIcEENS6_9allocatorIcEEEENSB_ISD_EEEE:
  172|    133|  explicit BasePath(SegmentsT&& segments) : segments_{std::move(segments)} {
  173|    133|  }

_ZN8firebase9firestore5model9FieldPath16FromServerFormatERKNSt3__112basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEE:
  119|    229|StatusOr<FieldPath> FieldPath::FromServerFormat(const std::string& path) {
  120|    229|  return FromServerFormatView(path);
  121|    229|}
_ZN8firebase9firestore5model9FieldPath20FromServerFormatViewEN4absl12lts_2021110211string_viewE:
  123|    229|StatusOr<FieldPath> FieldPath::FromServerFormatView(absl::string_view path) {
  124|    229|  SegmentsT segments;
  125|    229|  std::string segment;
  126|    229|  segment.reserve(path.size());
  127|       |
  128|    229|  Status status;
  129|       |
  130|    229|  const auto finish_segment = [&segments, &segment, &path] {
  131|    229|    if (segment.empty()) {
  132|    229|      return Status{
  133|    229|          Error::kErrorInvalidArgument,
  134|    229|          StringFormat(
  135|    229|              "Invalid field path (%s). Paths must not be empty, begin with "
  136|    229|              "'.', end with '.', or contain '..'",
  137|    229|              path)};
  138|    229|    }
  139|       |    // Move operation will clear segment, but capacity will remain the same
  140|       |    // (not, strictly speaking, required by the standard, but true in practice).
  141|    229|    segments.push_back(std::move(segment));
  142|    229|    return Status::OK();
  143|    229|  };
  144|       |
  145|       |  // Inside backticks, dots are treated literally.
  146|    229|  bool inside_backticks = false;
  147|    229|  size_t i = 0;
  148|  12.0M|  while (i < path.size()) {
  ------------------
  |  Branch (148:10): [True: 12.0M, False: 185]
  ------------------
  149|  12.0M|    const char c = path[i];
  150|       |    // std::string (and string_view) may contain embedded nulls. For full
  151|       |    // compatibility with Objective-C behavior, finish upon encountering the
  152|       |    // first terminating null.
  153|  12.0M|    if (c == '\0') {
  ------------------
  |  Branch (153:9): [True: 28, False: 12.0M]
  ------------------
  154|     28|      break;
  155|     28|    }
  156|       |
  157|  12.0M|    switch (c) {
  158|  1.36M|      case '.':
  ------------------
  |  Branch (158:7): [True: 1.36M, False: 10.7M]
  ------------------
  159|  1.36M|        if (!inside_backticks) {
  ------------------
  |  Branch (159:13): [True: 1.03M, False: 329k]
  ------------------
  160|  1.03M|          status = finish_segment();
  161|  1.03M|        } else {
  162|   329k|          segment += c;
  163|   329k|        }
  164|  1.36M|        break;
  165|       |
  166|  2.41k|      case '`':
  ------------------
  |  Branch (166:7): [True: 2.41k, False: 12.0M]
  ------------------
  167|  2.41k|        inside_backticks = !inside_backticks;
  168|  2.41k|        break;
  169|       |
  170|   384k|      case '\\':
  ------------------
  |  Branch (170:7): [True: 384k, False: 11.7M]
  ------------------
  171|   384k|        if (i + 1 == path.size()) {
  ------------------
  |  Branch (171:13): [True: 2, False: 384k]
  ------------------
  172|      2|          status =
  173|      2|              Status{Error::kErrorInvalidArgument,
  174|      2|                     StringFormat(
  175|      2|                         "Trailing escape characters not allowed in %s", path)};
  176|   384k|        } else {
  177|   384k|          ++i;
  178|   384k|          segment += path[i];
  179|   384k|        }
  180|   384k|        break;
  181|       |
  182|  10.3M|      default:
  ------------------
  |  Branch (182:7): [True: 10.3M, False: 1.74M]
  ------------------
  183|  10.3M|        segment += c;
  184|  10.3M|        break;
  185|  12.0M|    }
  186|  12.0M|    ++i;
  187|       |
  188|  12.0M|    if (!status.ok()) return status;
  ------------------
  |  Branch (188:9): [True: 16, False: 12.0M]
  ------------------
  189|  12.0M|  }
  190|       |
  191|    213|  status = finish_segment();
  192|    213|  if (!status.ok()) return status;
  ------------------
  |  Branch (192:7): [True: 45, False: 168]
  ------------------
  193|       |
  194|    168|  if (inside_backticks) {
  ------------------
  |  Branch (194:7): [True: 35, False: 133]
  ------------------
  195|     35|    return Status{Error::kErrorInvalidArgument,
  196|     35|                  StringFormat("Unterminated ` in path %s", path)};
  197|     35|  }
  198|       |
  199|    133|  return FieldPath{std::move(segments)};
  200|    168|}
field_path.cc:_ZZN8firebase9firestore5model9FieldPath20FromServerFormatViewEN4absl12lts_2021110211string_viewEENK3$_1clEv:
  130|  1.03M|  const auto finish_segment = [&segments, &segment, &path] {
  131|  1.03M|    if (segment.empty()) {
  ------------------
  |  Branch (131:9): [True: 59, False: 1.03M]
  ------------------
  132|     59|      return Status{
  133|     59|          Error::kErrorInvalidArgument,
  134|     59|          StringFormat(
  135|     59|              "Invalid field path (%s). Paths must not be empty, begin with "
  136|     59|              "'.', end with '.', or contain '..'",
  137|     59|              path)};
  138|     59|    }
  139|       |    // Move operation will clear segment, but capacity will remain the same
  140|       |    // (not, strictly speaking, required by the standard, but true in practice).
  141|  1.03M|    segments.push_back(std::move(segment));
  142|  1.03M|    return Status::OK();
  143|  1.03M|  };

_ZN8firebase9firestore5model9FieldPathC2EONSt3__16vectorINS3_12basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEENS8_ISA_EEEE:
   58|    133|  explicit FieldPath(SegmentsT&& segments) : BasePath{std::move(segments)} {
   59|    133|  }

_ZN8firebase9firestore4util6StatusC2ENS0_5ErrorENSt3__112basic_stringIcNS4_11char_traitsIcEENS4_9allocatorIcEEEE:
   31|     96|Status::Status(Error code, std::string msg) {
   32|     96|  HARD_ASSERT(code != Error::kErrorOk);
  ------------------
  |  |   54|     96|  do {                                                          \
  |  |   55|     96|    if (!ABSL_PREDICT_TRUE(condition)) {                        \
  |  |  ------------------
  |  |  |  |  178|     96|#define ABSL_PREDICT_TRUE(x) (__builtin_expect(false || (x), true))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (178:48): [Folded - Ignored]
  |  |  |  |  |  Branch (178:57): [True: 96, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (55:9): [True: 0, False: 96]
  |  |  ------------------
  |  |   56|      0|      std::string _message =                                    \
  |  |   57|      0|          firebase::firestore::util::StringFormat(__VA_ARGS__); \
  |  |   58|      0|      INVOKE_INTERNAL_FAIL(_message, #condition);               \
  |  |  ------------------
  |  |  |  |   41|      0|  firebase::firestore::util::internal::FailAssertion( \
  |  |  |  |   42|      0|      __FILE__, FIRESTORE_FUNCTION_NAME, __LINE__, __VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|      0|#define FIRESTORE_FUNCTION_NAME __PRETTY_FUNCTION__
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   59|      0|    }                                                           \
  |  |   60|     96|  } while (0)
  |  |  ------------------
  |  |  |  Branch (60:12): [Folded - Ignored]
  |  |  ------------------
  ------------------
   33|     96|  state_ = State::MakePtr(code, std::move(msg));
   34|     96|}
_ZNK8firebase9firestore4util6Status5State7DeleterclEPKS3_:
   85|  1.03M|void Status::State::Deleter::operator()(const State* ptr) const {
   86|  1.03M|  if (ptr != State::MovedFromIndicator()) {
  ------------------
  |  Branch (86:7): [True: 96, False: 1.03M]
  ------------------
   87|     96|    delete ptr;
   88|     96|  }
   89|  1.03M|}
_ZN8firebase9firestore4util6Status12SetMovedFromEv:
   91|  1.03M|void Status::SetMovedFrom() {
   92|       |  // Set pointer value to `0x1` as the pointer is no longer useful.
   93|  1.03M|  state_ = State::StatePtr{State::MovedFromIndicator()};
   94|  1.03M|}

_ZNK8firebase9firestore4util6Status2okEv:
   85|  12.0M|  bool ok() const {
   86|  12.0M|    return state_ == nullptr;
   87|  12.0M|  }
_ZN8firebase9firestore4util6Status2OKEv:
   63|  1.03M|  static Status OK() {
   64|  1.03M|    return Status();
   65|  1.03M|  }
_ZN8firebase9firestore4util6Status5State18MovedFromIndicatorEv:
  147|  2.06M|    static State* MovedFromIndicator() {
  148|  2.06M|      return reinterpret_cast<State*>(0x01);
  149|  2.06M|    }
_ZN8firebase9firestore4util6StatusaSEOS2_:
  227|  1.03M|inline Status& Status::operator=(Status&& s) noexcept {
  228|       |  // Moving into self is a no-op.
  229|  1.03M|  if (this != &s) {
  ------------------
  |  Branch (229:7): [True: 1.03M, False: 0]
  ------------------
  230|  1.03M|    state_ = std::move(s.state_);
  231|  1.03M|    s.SetMovedFrom();
  232|  1.03M|  }
  233|  1.03M|  return *this;
  234|  1.03M|}
_ZN8firebase9firestore4util6StatusC2Ev:
   49|  1.03M|  Status() = default;
_ZN8firebase9firestore4util6StatusC2EOS2_:
  223|     96|inline Status::Status(Status&& s) noexcept : state_(std::move(s.state_)) {
  224|     96|  s.SetMovedFrom();
  225|     96|}
_ZN8firebase9firestore4util6Status5State7MakePtrIJRNS0_5ErrorENSt3__112basic_stringIcNS7_11char_traitsIcEENS7_9allocatorIcEEEEEEENS7_10unique_ptrIS3_NS3_7DeleterEEEDpOT_:
  152|     96|    static StatePtr MakePtr(Args&&... args) {
  153|     96|      return StatePtr(new State(std::forward<Args>(args)...));
  154|     96|    }
_ZN8firebase9firestore4util6Status5StateC2ENS0_5ErrorEONSt3__112basic_stringIcNS5_11char_traitsIcEENS5_9allocatorIcEEEE:
  211|     96|    : code(code), msg(std::move(msg)) {
  212|     96|}

_ZN8firebase9firestore4util8StatusOrINS0_5model9FieldPathEEC2EONS1_6StatusE:
  239|     96|StatusOr<T>::StatusOr(Status&& status) : Base(std::move(status)) {
  240|     96|}
_ZN8firebase9firestore4util8StatusOrINS0_5model9FieldPathEEC2EOS4_:
  235|    133|StatusOr<T>::StatusOr(T&& value) : Base(std::move(value)) {
  236|    133|}

_ZN8firebase9firestore4util17internal_statusor12StatusOrDataINS0_5model9FieldPathEED2Ev:
  130|    229|  ~StatusOrData() {
  131|    229|    if (ok()) {
  ------------------
  |  Branch (131:9): [True: 133, False: 96]
  ------------------
  132|    133|      status_.~Status();
  133|    133|      data_.~T();
  134|    133|    } else {
  135|     96|      status_.~Status();
  136|     96|    }
  137|    229|  }
_ZNK8firebase9firestore4util17internal_statusor12StatusOrDataINS0_5model9FieldPathEE2okEv:
  171|    325|  bool ok() const {
  172|    325|    return status_.ok();
  173|    325|  }
_ZN8firebase9firestore4util17internal_statusor12StatusOrDataINS0_5model9FieldPathEE10MakeStatusIJEEEvDpOT_:
  216|    133|  void MakeStatus(Args&&... args) {
  217|    133|    internal_statusor::PlacementNew<Status>(&status_,
  218|    133|                                            std::forward<Args>(args)...);
  219|    133|  }
_ZN8firebase9firestore4util17internal_statusor12PlacementNewINS1_6StatusEJEEEvPvDpOT0_:
   41|    133|void PlacementNew(void* p, Args&&... args) {
   42|       |#if defined(__GNUC__) && !defined(__clang__)
   43|       |  // Teach gcc that 'p' cannot be null, fixing code size issues.
   44|       |  if (p == nullptr) __builtin_unreachable();
   45|       |#endif
   46|    133|  new (p) T(std::forward<Args>(args)...);
   47|    133|}
_ZN8firebase9firestore4util17internal_statusor12StatusOrDataINS0_5model9FieldPathEEC2EONS1_6StatusE:
  108|     96|  explicit StatusOrData(Status&& status) : status_(std::move(status)) {
  109|     96|    EnsureNotOk();
  110|     96|  }
_ZN8firebase9firestore4util17internal_statusor12StatusOrDataINS0_5model9FieldPathEE11EnsureNotOkEv:
  202|     96|  void EnsureNotOk() {
  203|     96|    if (ok()) Helper::HandleInvalidStatusCtorArg(&status_);
  ------------------
  |  Branch (203:9): [True: 0, False: 96]
  ------------------
  204|     96|  }
_ZN8firebase9firestore4util17internal_statusor12StatusOrDataINS0_5model9FieldPathEEC2EOS5_:
  101|    133|  explicit StatusOrData(T&& value) : data_(std::move(value)) {
  102|    133|    MakeStatus();
  103|    133|  }

_ZN8firebase9firestore4util8internal18StringFormatPiecesEPKcSt16initializer_listIN4absl12lts_2021110211string_viewEE:
   28|     96|    const char* format, std::initializer_list<absl::string_view> pieces) {
   29|     96|  std::string result;
   30|       |
   31|     96|  const char* format_iter = format;
   32|     96|  const char* format_end = format + strlen(format);
   33|       |
   34|     96|  auto pieces_iter = pieces.begin();
   35|     96|  auto pieces_end = pieces.end();
   36|     96|  auto append_next_piece = [&](std::string* dest) {
   37|     96|    if (pieces_iter == pieces_end) {
   38|     96|      dest->append(kMissing);
   39|     96|    } else {
   40|       |      // Pass a piece through
   41|     96|      dest->append(pieces_iter->data(), pieces_iter->size());
   42|     96|      ++pieces_iter;
   43|     96|    }
   44|     96|  };
   45|       |
   46|     96|  auto append_specifier = [&](char spec) {
   47|     96|    switch (spec) {
   48|     96|      case '%':
   49|       |        // Pass through literal %.
   50|     96|        result.push_back('%');
   51|     96|        break;
   52|       |
   53|     96|      case 's': {
   54|     96|        append_next_piece(&result);
   55|     96|        break;
   56|     96|      }
   57|       |
   58|     96|      default:
   59|     96|        result.append(kInvalid);
   60|     96|        break;
   61|     96|    }
   62|     96|  };
   63|       |
   64|       |  // Iterate through the format string, advancing `format_iter` as we go.
   65|    192|  while (true) {
  ------------------
  |  Branch (65:10): [Folded - Ignored]
  ------------------
   66|    192|    const char* percent_ptr = std::find(format_iter, format_end, '%');
   67|       |
   68|       |    // percent either points to the next format specifier or the end of the
   69|       |    // format string. Either is safe to append here:
   70|    192|    result.append(format_iter, percent_ptr);
   71|    192|    if (percent_ptr == format_end) {
  ------------------
  |  Branch (71:9): [True: 96, False: 96]
  ------------------
   72|       |      // No further pieces to format
   73|     96|      break;
   74|     96|    }
   75|       |
   76|       |    // Examine the specifier:
   77|     96|    const char* spec_ptr = percent_ptr + 1;
   78|     96|    if (spec_ptr == format_end) {
  ------------------
  |  Branch (78:9): [True: 0, False: 96]
  ------------------
   79|       |      // Incomplete specifier, treat as a literal "%" and be done.
   80|      0|      append_specifier('%');
   81|      0|      break;
   82|      0|    }
   83|     96|    append_specifier(*spec_ptr);
   84|       |
   85|     96|    format_iter = spec_ptr + 1;
   86|     96|  }
   87|       |
   88|     96|  return result;
   89|     96|}
string_format.cc:_ZZN8firebase9firestore4util8internal18StringFormatPiecesEPKcSt16initializer_listIN4absl12lts_2021110211string_viewEEENK3$_1clEc:
   46|     96|  auto append_specifier = [&](char spec) {
   47|     96|    switch (spec) {
   48|      0|      case '%':
  ------------------
  |  Branch (48:7): [True: 0, False: 96]
  ------------------
   49|       |        // Pass through literal %.
   50|      0|        result.push_back('%');
   51|      0|        break;
   52|       |
   53|     96|      case 's': {
  ------------------
  |  Branch (53:7): [True: 96, False: 0]
  ------------------
   54|     96|        append_next_piece(&result);
   55|     96|        break;
   56|      0|      }
   57|       |
   58|      0|      default:
  ------------------
  |  Branch (58:7): [True: 0, False: 96]
  ------------------
   59|      0|        result.append(kInvalid);
   60|      0|        break;
   61|     96|    }
   62|     96|  };
string_format.cc:_ZZN8firebase9firestore4util8internal18StringFormatPiecesEPKcSt16initializer_listIN4absl12lts_2021110211string_viewEEENK3$_0clEPNSt3__112basic_stringIcNSB_11char_traitsIcEENSB_9allocatorIcEEEE:
   36|     96|  auto append_next_piece = [&](std::string* dest) {
   37|     96|    if (pieces_iter == pieces_end) {
  ------------------
  |  Branch (37:9): [True: 0, False: 96]
  ------------------
   38|      0|      dest->append(kMissing);
   39|     96|    } else {
   40|       |      // Pass a piece through
   41|     96|      dest->append(pieces_iter->data(), pieces_iter->size());
   42|     96|      ++pieces_iter;
   43|     96|    }
   44|     96|  };

_ZN8firebase9firestore4util12StringFormatIJN4absl12lts_2021110211string_viewEEEENSt3__112basic_stringIcNS6_11char_traitsIcEENS6_9allocatorIcEEEEPKcDpRKT_:
  159|     96|std::string StringFormat(const char* format, const FA&... args) {
  160|     96|  return internal::StringFormatPieces(
  161|     96|      format, {static_cast<const FormatArg&>(args).Piece()...});
  162|     96|}
_ZN8firebase9firestore4util9FormatArgC2IRKN4absl12lts_2021110211string_viewEEEOT_:
   69|     96|      : FormatArg{std::forward<T>(value), internal::FormatChoice<0>{}} {
   70|     96|  }
_ZN8firebase9firestore4util9FormatArgC2IRKN4absl12lts_2021110211string_viewEEEOT_NS1_8internal12FormatChoiceILi5EEE:
  138|     96|      : AlphaNum{std::forward<T>(value)} {
  139|     96|  }

LLVMFuzzerTestOneInput:
   27|    229|extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {
   28|    229|  const char* str_ptr = reinterpret_cast<const char*>(data);
   29|    229|  std::string str{str_ptr, size};
   30|       |
   31|    229|  try {
   32|    229|    StatusOr<FieldPath> fp = FieldPath::FromServerFormat(str);
   33|    229|  } catch (...) {
   34|       |    // Ignore caught exceptions.
   35|      0|  }
   36|    229|  return 0;
   37|    229|}

_ZN4absl12lts_202111028AlphaNumC2ENS0_11string_viewE:
  249|     96|  AlphaNum(absl::string_view pc) : piece_(pc) {}  // NOLINT(runtime/explicit)
_ZNK4absl12lts_202111028AlphaNum5PieceEv:
  264|     96|  absl::string_view Piece() const { return piece_; }

_ZNK4absl12lts_2021110211string_view4sizeEv:
  276|  24.9M|  constexpr size_type size() const noexcept { return length_; }
_ZNK4absl12lts_2021110211string_viewixEm:
  297|  12.4M|  constexpr const_reference operator[](size_type i) const {
  298|  12.4M|    return ABSL_HARDENING_ASSERT(i < size()), ptr_[i];
  ------------------
  |  |  134|  12.4M|#define ABSL_HARDENING_ASSERT(expr) ABSL_ASSERT(expr)
  |  |  ------------------
  |  |  |  |   98|  12.4M|  (ABSL_PREDICT_TRUE((expr)) ? static_cast<void>(0) \
  |  |  |  |  ------------------
  |  |  |  |  |  |  178|  12.4M|#define ABSL_PREDICT_TRUE(x) (__builtin_expect(false || (x), true))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (178:30): [True: 12.4M, False: 0]
  |  |  |  |  |  |  |  Branch (178:48): [Folded - Ignored]
  |  |  |  |  |  |  |  Branch (178:57): [True: 12.4M, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   99|  12.4M|                             : [] { assert(false && #expr); }())  // NOLINT
  |  |  ------------------
  ------------------
  299|  12.4M|  }
_ZNK4absl12lts_2021110211string_view4dataEv:
  335|     96|  constexpr const_pointer data() const noexcept { return ptr_; }
_ZN4absl12lts_2021110211string_viewC2EPKcmNS1_18SkipCheckLengthTagE:
  603|    229|      : ptr_(data), length_(len) {}
_ZN4absl12lts_2021110211string_viewC2INSt3__19allocatorIcEEEERKNS3_12basic_stringIcNS3_11char_traitsIcEET_EE:
  196|    229|      : string_view(str.data(), str.size(), SkipCheckLengthTag{}) {}

