_ZN8firebase9firestore5model4impl8BasePathINS1_9FieldPathEEC2EONSt3__16vectorINS6_12basic_stringIcNS6_11char_traitsIcEENS6_9allocatorIcEEEENSB_ISD_EEEE:
  182|    125|  explicit BasePath(SegmentsT&& segments) : segments_{std::move(segments)} {
  183|    125|  }

_ZN8firebase9firestore5model9FieldPath16FromServerFormatERKNSt3__112basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEE:
  119|    214|StatusOr<FieldPath> FieldPath::FromServerFormat(const std::string& path) {
  120|    214|  return FromServerFormatView(path);
  121|    214|}
_ZN8firebase9firestore5model9FieldPath20FromServerFormatViewEN4absl12lts_2024011611string_viewE:
  123|    214|StatusOr<FieldPath> FieldPath::FromServerFormatView(absl::string_view path) {
  124|    214|  SegmentsT segments;
  125|    214|  std::string segment;
  126|    214|  segment.reserve(path.size());
  127|       |
  128|    214|  Status status;
  129|       |
  130|    214|  const auto finish_segment = [&segments, &segment, &path] {
  131|    214|    if (segment.empty()) {
  132|    214|      return Status{
  133|    214|          Error::kErrorInvalidArgument,
  134|    214|          StringFormat(
  135|    214|              "Invalid field path (%s). Paths must not be empty, begin with "
  136|    214|              "'.', end with '.', or contain '..'",
  137|    214|              path)};
  138|    214|    }
  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|    214|    segments.push_back(std::move(segment));
  142|    214|    return Status::OK();
  143|    214|  };
  144|       |
  145|       |  // Inside backticks, dots are treated literally.
  146|    214|  bool inside_backticks = false;
  147|    214|  size_t i = 0;
  148|  15.0M|  while (i < path.size()) {
  ------------------
  |  Branch (148:10): [True: 15.0M, False: 167]
  ------------------
  149|  15.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|  15.0M|    if (c == '\0') {
  ------------------
  |  Branch (153:9): [True: 32, False: 15.0M]
  ------------------
  154|     32|      break;
  155|     32|    }
  156|       |
  157|  15.0M|    switch (c) {
  158|  1.22M|      case '.':
  ------------------
  |  Branch (158:7): [True: 1.22M, False: 13.8M]
  ------------------
  159|  1.22M|        if (!inside_backticks) {
  ------------------
  |  Branch (159:13): [True: 1.04M, False: 185k]
  ------------------
  160|  1.04M|          status = finish_segment();
  161|  1.04M|        } else {
  162|   185k|          segment += c;
  163|   185k|        }
  164|  1.22M|        break;
  165|       |
  166|  1.73k|      case '`':
  ------------------
  |  Branch (166:7): [True: 1.73k, False: 15.0M]
  ------------------
  167|  1.73k|        inside_backticks = !inside_backticks;
  168|  1.73k|        break;
  169|       |
  170|   252k|      case '\\':
  ------------------
  |  Branch (170:7): [True: 252k, False: 14.8M]
  ------------------
  171|   252k|        if (i + 1 == path.size()) {
  ------------------
  |  Branch (171:13): [True: 4, False: 252k]
  ------------------
  172|      4|          status =
  173|      4|              Status{Error::kErrorInvalidArgument,
  174|      4|                     StringFormat(
  175|      4|                         "Trailing escape characters not allowed in %s", path)};
  176|   252k|        } else {
  177|   252k|          ++i;
  178|   252k|          segment += path[i];
  179|   252k|        }
  180|   252k|        break;
  181|       |
  182|  13.5M|      default:
  ------------------
  |  Branch (182:7): [True: 13.5M, False: 1.48M]
  ------------------
  183|  13.5M|        segment += c;
  184|  13.5M|        break;
  185|  15.0M|    }
  186|  15.0M|    ++i;
  187|       |
  188|  15.0M|    if (!status.ok()) return status;
  ------------------
  |  Branch (188:9): [True: 15, False: 15.0M]
  ------------------
  189|  15.0M|  }
  190|       |
  191|    199|  status = finish_segment();
  192|    199|  if (!status.ok()) return status;
  ------------------
  |  Branch (192:7): [True: 39, False: 160]
  ------------------
  193|       |
  194|    160|  if (inside_backticks) {
  ------------------
  |  Branch (194:7): [True: 35, False: 125]
  ------------------
  195|     35|    return Status{Error::kErrorInvalidArgument,
  196|     35|                  StringFormat("Unterminated ` in path %s", path)};
  197|     35|  }
  198|       |
  199|    125|  return FieldPath{std::move(segments)};
  200|    160|}
field_path.cc:_ZZN8firebase9firestore5model9FieldPath20FromServerFormatViewEN4absl12lts_2024011611string_viewEENK3$_0clEv:
  130|  1.04M|  const auto finish_segment = [&segments, &segment, &path] {
  131|  1.04M|    if (segment.empty()) {
  ------------------
  |  Branch (131:9): [True: 50, False: 1.04M]
  ------------------
  132|     50|      return Status{
  133|     50|          Error::kErrorInvalidArgument,
  134|     50|          StringFormat(
  135|     50|              "Invalid field path (%s). Paths must not be empty, begin with "
  136|     50|              "'.', end with '.', or contain '..'",
  137|     50|              path)};
  138|     50|    }
  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.04M|    segments.push_back(std::move(segment));
  142|  1.04M|    return Status::OK();
  143|  1.04M|  };

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

_ZN8firebase9firestore4util6StatusC2ENS0_5ErrorENSt3__112basic_stringIcNS4_11char_traitsIcEENS4_9allocatorIcEEEE:
   31|     89|Status::Status(Error code, std::string msg) {
   32|     89|  HARD_ASSERT(code != Error::kErrorOk);
  ------------------
  |  |   54|     89|  do {                                                          \
  |  |   55|     89|    if (!ABSL_PREDICT_TRUE(condition)) {                        \
  |  |  ------------------
  |  |  |  |  179|     89|#define ABSL_PREDICT_TRUE(x) (__builtin_expect(false || (x), true))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (179:48): [Folded - Ignored]
  |  |  |  |  |  Branch (179:57): [True: 89, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (55:9): [True: 0, False: 89]
  |  |  ------------------
  |  |   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|     89|  } while (0)
  |  |  ------------------
  |  |  |  Branch (60:12): [Folded - Ignored]
  |  |  ------------------
  ------------------
   33|     89|  state_ = State::MakePtr(code, std::move(msg));
   34|     89|}
_ZNK8firebase9firestore4util6Status5State7DeleterclEPKS3_:
   85|  1.04M|void Status::State::Deleter::operator()(const State* ptr) const {
   86|  1.04M|  if (ptr != State::MovedFromIndicator()) {
  ------------------
  |  Branch (86:7): [True: 89, False: 1.04M]
  ------------------
   87|     89|    delete ptr;
   88|     89|  }
   89|  1.04M|}
_ZN8firebase9firestore4util6Status12SetMovedFromEv:
   91|  1.04M|void Status::SetMovedFrom() {
   92|       |  // Set pointer value to `0x1` as the pointer is no longer useful.
   93|  1.04M|  state_ = State::StatePtr{State::MovedFromIndicator()};
   94|  1.04M|}

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

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

_ZN8firebase9firestore4util17internal_statusor12StatusOrDataINS0_5model9FieldPathEED2Ev:
  130|    214|  ~StatusOrData() {
  131|    214|    if (ok()) {
  ------------------
  |  Branch (131:9): [True: 125, False: 89]
  ------------------
  132|    125|      status_.~Status();
  133|    125|      data_.~T();
  134|    125|    } else {
  135|     89|      status_.~Status();
  136|     89|    }
  137|    214|  }
_ZNK8firebase9firestore4util17internal_statusor12StatusOrDataINS0_5model9FieldPathEE2okEv:
  171|    303|  bool ok() const {
  172|    303|    return status_.ok();
  173|    303|  }
_ZN8firebase9firestore4util17internal_statusor12StatusOrDataINS0_5model9FieldPathEE10MakeStatusIJEEEvDpOT_:
  216|    125|  void MakeStatus(Args&&... args) {
  217|    125|    internal_statusor::PlacementNew<Status>(&status_,
  218|    125|                                            std::forward<Args>(args)...);
  219|    125|  }
_ZN8firebase9firestore4util17internal_statusor12PlacementNewINS1_6StatusEJEEEvPvDpOT0_:
   41|    125|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|    125|  new (p) T(std::forward<Args>(args)...);
   47|    125|}
_ZN8firebase9firestore4util17internal_statusor12StatusOrDataINS0_5model9FieldPathEEC2EONS1_6StatusE:
  108|     89|  explicit StatusOrData(Status&& status) : status_(std::move(status)) {
  109|     89|    EnsureNotOk();
  110|     89|  }
_ZN8firebase9firestore4util17internal_statusor12StatusOrDataINS0_5model9FieldPathEE11EnsureNotOkEv:
  202|     89|  void EnsureNotOk() {
  203|     89|    if (ok()) Helper::HandleInvalidStatusCtorArg(&status_);
  ------------------
  |  Branch (203:9): [True: 0, False: 89]
  ------------------
  204|     89|  }
_ZN8firebase9firestore4util17internal_statusor12StatusOrDataINS0_5model9FieldPathEEC2EOS5_:
  101|    125|  explicit StatusOrData(T&& value) : data_(std::move(value)) {
  102|    125|    MakeStatus();
  103|    125|  }

_ZN8firebase9firestore4util8internal18StringFormatPiecesEPKcSt16initializer_listIN4absl12lts_2024011611string_viewEE:
   38|     89|    const char* format, std::initializer_list<absl::string_view> pieces) {
   39|     89|  std::string result;
   40|       |
   41|     89|  const char* format_iter = format;
   42|     89|  const char* format_end = format + strlen(format);
   43|       |
   44|     89|  auto pieces_iter = pieces.begin();
   45|     89|  auto pieces_end = pieces.end();
   46|     89|  auto append_next_string_piece = [&](std::string* dest) {
   47|     89|    if (pieces_iter == pieces_end) {
   48|     89|      dest->append(kMissing);
   49|     89|    } else {
   50|       |      // Pass a piece through
   51|     89|      dest->append(pieces_iter->data(), pieces_iter->size());
   52|     89|      ++pieces_iter;
   53|     89|    }
   54|     89|  };
   55|       |
   56|     89|  auto append_next_hex_piece = [&](std::string* dest) {
   57|     89|    if (pieces_iter == pieces_end) {
   58|     89|      dest->append(kMissing);
   59|     89|    } else {
   60|     89|      std::string hex =
   61|     89|          absl::BytesToHexString(absl::string_view(pieces_iter->data()));
   62|     89|      dest->append(hex.data(), hex.size());
   63|     89|      ++pieces_iter;
   64|     89|    }
   65|     89|  };
   66|       |
   67|     89|  auto append_specifier = [&](char spec) {
   68|     89|    switch (spec) {
   69|     89|      case '%':
   70|       |        // Pass through literal %.
   71|     89|        result.push_back('%');
   72|     89|        break;
   73|       |
   74|     89|      case 's': {
   75|     89|        append_next_string_piece(&result);
   76|     89|        break;
   77|     89|      }
   78|       |
   79|     89|      case 'x': {
   80|     89|        append_next_hex_piece(&result);
   81|     89|        break;
   82|     89|      }
   83|       |
   84|     89|      default:
   85|     89|        result.append(kInvalid);
   86|     89|        break;
   87|     89|    }
   88|     89|  };
   89|       |
   90|       |  // Iterate through the format string, advancing `format_iter` as we go.
   91|    178|  while (true) {
  ------------------
  |  Branch (91:10): [Folded - Ignored]
  ------------------
   92|    178|    const char* percent_ptr = std::find(format_iter, format_end, '%');
   93|       |
   94|       |    // percent either points to the next format specifier or the end of the
   95|       |    // format string. Either is safe to append here:
   96|    178|    result.append(format_iter, percent_ptr);
   97|    178|    if (percent_ptr == format_end) {
  ------------------
  |  Branch (97:9): [True: 89, False: 89]
  ------------------
   98|       |      // No further pieces to format
   99|     89|      break;
  100|     89|    }
  101|       |
  102|       |    // Examine the specifier:
  103|     89|    const char* spec_ptr = percent_ptr + 1;
  104|     89|    if (spec_ptr == format_end) {
  ------------------
  |  Branch (104:9): [True: 0, False: 89]
  ------------------
  105|       |      // Incomplete specifier, treat as a literal "%" and be done.
  106|      0|      append_specifier('%');
  107|      0|      break;
  108|      0|    }
  109|     89|    append_specifier(*spec_ptr);
  110|       |
  111|     89|    format_iter = spec_ptr + 1;
  112|     89|  }
  113|       |
  114|     89|  return result;
  115|     89|}
string_format.cc:_ZZN8firebase9firestore4util8internal18StringFormatPiecesEPKcSt16initializer_listIN4absl12lts_2024011611string_viewEEENK3$_2clEc:
   67|     89|  auto append_specifier = [&](char spec) {
   68|     89|    switch (spec) {
   69|      0|      case '%':
  ------------------
  |  Branch (69:7): [True: 0, False: 89]
  ------------------
   70|       |        // Pass through literal %.
   71|      0|        result.push_back('%');
   72|      0|        break;
   73|       |
   74|     89|      case 's': {
  ------------------
  |  Branch (74:7): [True: 89, False: 0]
  ------------------
   75|     89|        append_next_string_piece(&result);
   76|     89|        break;
   77|      0|      }
   78|       |
   79|      0|      case 'x': {
  ------------------
  |  Branch (79:7): [True: 0, False: 89]
  ------------------
   80|      0|        append_next_hex_piece(&result);
   81|      0|        break;
   82|      0|      }
   83|       |
   84|      0|      default:
  ------------------
  |  Branch (84:7): [True: 0, False: 89]
  ------------------
   85|      0|        result.append(kInvalid);
   86|      0|        break;
   87|     89|    }
   88|     89|  };
string_format.cc:_ZZN8firebase9firestore4util8internal18StringFormatPiecesEPKcSt16initializer_listIN4absl12lts_2024011611string_viewEEENK3$_0clEPNSt3__112basic_stringIcNSB_11char_traitsIcEENSB_9allocatorIcEEEE:
   46|     89|  auto append_next_string_piece = [&](std::string* dest) {
   47|     89|    if (pieces_iter == pieces_end) {
  ------------------
  |  Branch (47:9): [True: 0, False: 89]
  ------------------
   48|      0|      dest->append(kMissing);
   49|     89|    } else {
   50|       |      // Pass a piece through
   51|     89|      dest->append(pieces_iter->data(), pieces_iter->size());
   52|     89|      ++pieces_iter;
   53|     89|    }
   54|     89|  };

_ZN8firebase9firestore4util12StringFormatIJN4absl12lts_2024011611string_viewEEEENSt3__112basic_stringIcNS6_11char_traitsIcEENS6_9allocatorIcEEEEPKcDpRKT_:
  184|     89|std::string StringFormat(const char* format, const FA&... args) {
  185|     89|  return internal::StringFormatPieces(
  186|     89|      format, {static_cast<const FormatArg&>(args).Piece()...});
  187|     89|}
_ZN8firebase9firestore4util9FormatArgC2IRKN4absl12lts_2024011611string_viewEEEOT_ONS5_16strings_internal13StringifySinkE:
   77|     89|      : FormatArg{std::forward<T>(value), std::move(sink),
   78|     89|                  internal::FormatChoice<0>{}} {
   79|     89|  }
_ZN8firebase9firestore4util9FormatArgC2IRKN4absl12lts_2024011611string_viewEEEOT_ONS5_16strings_internal13StringifySinkENS1_8internal12FormatChoiceILi5EEE:
  163|     89|      : AlphaNum(std::forward<T>(value)) {
  164|     89|  }

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

_ZN4absl12lts_202401168AlphaNumC2ENS0_11string_viewE:
  356|     89|      : piece_(pc) {}
_ZNK4absl12lts_202401168AlphaNum5PieceEv:
  379|     89|  absl::string_view Piece() const { return piece_; }

_ZNK4absl12lts_2024011611string_view4sizeEv:
  273|  30.6M|  constexpr size_type size() const noexcept { return length_; }
_ZNK4absl12lts_2024011611string_viewixEm:
  294|  15.3M|  constexpr const_reference operator[](size_type i) const {
  295|  15.3M|    return ABSL_HARDENING_ASSERT(i < size()), ptr_[i];
  ------------------
  |  |  128|  15.3M|#define ABSL_HARDENING_ASSERT(expr) ABSL_ASSERT(expr)
  |  |  ------------------
  |  |  |  |   98|  15.3M|  (ABSL_PREDICT_TRUE((expr)) ? static_cast<void>(0) \
  |  |  |  |  ------------------
  |  |  |  |  |  |  179|  15.3M|#define ABSL_PREDICT_TRUE(x) (__builtin_expect(false || (x), true))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (179:30): [True: 15.3M, False: 0]
  |  |  |  |  |  |  |  Branch (179:48): [Folded - Ignored]
  |  |  |  |  |  |  |  Branch (179:57): [True: 15.3M, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   99|  15.3M|                             : [] { assert(false && #expr); }())  // NOLINT
  |  |  ------------------
  ------------------
  296|  15.3M|  }
_ZNK4absl12lts_2024011611string_view4dataEv:
  332|     89|  constexpr const_pointer data() const noexcept { return ptr_; }
_ZN4absl12lts_2024011611string_viewC2EPKcmNS1_18SkipCheckLengthTagE:
  663|    214|      : ptr_(data), length_(len) {}
_ZN4absl12lts_2024011611string_viewC2INSt3__19allocatorIcEEEERKNS3_12basic_stringIcNS3_11char_traitsIcEET_EE:
  192|    214|      : string_view(str.data(), str.size(), SkipCheckLengthTag{}) {}

