// Generated by the protocol buffer compiler.  DO NOT EDIT!
// NO CHECKED-IN PROTOBUF GENCODE
// source: third_party/metrics_proto/private_metrics/private_user_metrics.proto
// Protobuf C++ Version: 7.35.1

#include "third_party/metrics_proto/private_metrics/private_user_metrics.pb.h"

#include <algorithm>
#include <type_traits>
#include "google/protobuf/io/coded_stream.h"
#include "google/protobuf/generated_message_tctable_impl.h"
#include "google/protobuf/internal_visibility.h"
#include "google/protobuf/extension_set.h"
#include "google/protobuf/generated_message_util.h"
#include "google/protobuf/wire_format_lite.h"
#include "google/protobuf/io/zero_copy_stream_impl_lite.h"
// @@protoc_insertion_point(includes)

// Must be included last.
#include "google/protobuf/port_def.inc"
PROTOBUF_PRAGMA_INIT_SEG
namespace _pb = ::google::protobuf;
namespace _pbi = ::google::protobuf::internal;
namespace _fl = ::google::protobuf::internal::field_layout;
namespace private_metrics {
class ProfileKeyedHistogramEvent::_Internal {
 public:
  using HasBits = decltype(::std::declval<ProfileKeyedHistogramEvent>()._impl_._has_bits_);
  static constexpr ::int32_t kHasBitsOffset =
      8 * PROTOBUF_FIELD_OFFSET(ProfileKeyedHistogramEvent, _impl_._has_bits_);
};

constexpr ProfileKeyedHistogramEvent::ParseTableT_ ProfileKeyedHistogramEvent::InternalGenerateParseTable_(const ::_pbi::ClassData* class_data) {
  return ParseTableT_{
    {
      PROTOBUF_FIELD_OFFSET(ProfileKeyedHistogramEvent, _impl_._has_bits_),
      0, // no _extensions_
      2, 8,  // max_field_number, fast_idx_mask
      offsetof(ParseTableT_, field_lookup_table),
      4294967292,  // skipmap
      offsetof(ParseTableT_, field_entries),
      2,  // num_field_entries
      1,  // num_aux_entries
      offsetof(ParseTableT_, aux_entries),
      class_data,
      nullptr,  // post_loop_handler
      ::_pbi::TcParser::GenericFallbackLite,  // fallback
      #ifdef PROTOBUF_PREFETCH_PARSE_TABLE
      ::_pbi::TcParser::GetTable<::private_metrics::ProfileKeyedHistogramEvent>(),  // to_prefetch
      #endif  // PROTOBUF_PREFETCH_PARSE_TABLE
    }, {{
      // repeated .metrics.HistogramEventProto histogram_events = 2;
      {::_pbi::TcParser::FastMtR1,
       {18, 0, 0,
        PROTOBUF_FIELD_OFFSET(ProfileKeyedHistogramEvent, _impl_.histogram_events_)}},
      // fixed64 profile_id = 1;
      {::_pbi::TcParser::FastF64S1,
       {9, 1, 0,
        PROTOBUF_FIELD_OFFSET(ProfileKeyedHistogramEvent, _impl_.profile_id_)}},
    }}, {{
      65535, 65535
    }}, {{
      // fixed64 profile_id = 1;
      {PROTOBUF_FIELD_OFFSET(ProfileKeyedHistogramEvent, _impl_.profile_id_), _Internal::kHasBitsOffset + 1, 0, (0 | ::_fl::kFcOptional | ::_fl::kFixed64)},
      // repeated .metrics.HistogramEventProto histogram_events = 2;
      {PROTOBUF_FIELD_OFFSET(ProfileKeyedHistogramEvent, _impl_.histogram_events_), _Internal::kHasBitsOffset + 0, 0, (0 | ::_fl::kFcRepeated | ::_fl::kMessage | ::_fl::kTvTable)},
    }},
    {{
        #ifndef PROTOBUF_MESSAGE_GLOBALS
        {::_pbi::TcParser::GetTable<::metrics::HistogramEventProto>()},
        #else
        {::_pbi::FieldAuxMessageGlobals(), &::metrics::HistogramEventProto_globals_},
        #endif
    }},
    {{
    }},
  };
}


inline constexpr ProfileKeyedHistogramEvent::Impl_::Impl_(
    [[maybe_unused]] ::google::protobuf::internal::InternalVisibility visibility,
    ::_pbi::ConstantInitialized) noexcept
      : _cached_size_{0},
        histogram_events_ { visibility, ::_pbi::InternalMetadataOffset::Build<
            ::private_metrics::ProfileKeyedHistogramEvent,
            PROTOBUF_FIELD_OFFSET(::private_metrics::ProfileKeyedHistogramEvent, _impl_.histogram_events_)>()
         }
        ,
        profile_id_{::uint64_t{0u}} {}

template <typename>
constexpr ProfileKeyedHistogramEvent::ProfileKeyedHistogramEvent(::_pbi::ConstantInitialized,
                       const ::_pbi::ClassData* PROTOBUF_NONNULL class_data)
    : ::google::protobuf::MessageLite(
#if defined(PROTOBUF_CUSTOM_VTABLE)
          class_data
#endif  // PROTOBUF_CUSTOM_VTABLE
          ),
      _impl_(internal_visibility(), ::_pbi::ConstantInitialized()) {
}
inline void* PROTOBUF_NONNULL ProfileKeyedHistogramEvent::PlacementNew_(
    const void* PROTOBUF_NONNULL, void* PROTOBUF_NONNULL mem,
    ::google::protobuf::Arena* PROTOBUF_NULLABLE arena) {
  return ::new (mem) ProfileKeyedHistogramEvent(arena);
}
constexpr auto ProfileKeyedHistogramEvent::InternalNewImpl_() {
  return ::google::protobuf::internal::MessageCreator::CopyInit(sizeof(ProfileKeyedHistogramEvent), alignof(ProfileKeyedHistogramEvent));
}
constexpr auto ProfileKeyedHistogramEvent::InternalGenerateClassData_(
    const MessageLite& prototype,
    const ::google::protobuf::internal::TcParseTableBase* tc_table) {
  return ::google::protobuf::internal::ClassDataLite{
      {
          &prototype,
#ifndef PROTOBUF_MESSAGE_GLOBALS
          &_table_.header,
#else
          tc_table,
#endif
          nullptr,  // IsInitialized
          &ProfileKeyedHistogramEvent::MergeImpl,
          ::google::protobuf::MessageLite::GetNewImpl<ProfileKeyedHistogramEvent>(),
#if defined(PROTOBUF_CUSTOM_VTABLE)
          &ProfileKeyedHistogramEvent::SharedDtor,
          ::google::protobuf::MessageLite::GetClearImpl<ProfileKeyedHistogramEvent>(), &ProfileKeyedHistogramEvent::ByteSizeLong,
              &ProfileKeyedHistogramEvent::_InternalSerialize,
#endif  // PROTOBUF_CUSTOM_VTABLE
          PROTOBUF_FIELD_OFFSET(ProfileKeyedHistogramEvent, _impl_._cached_size_),
          true,
      },
      "private_metrics.ProfileKeyedHistogramEvent",
  };
}
struct ProfileKeyedHistogramEventGlobalsTypeInternal : ::_pbi::MessageGlobalsBase {
  constexpr ProfileKeyedHistogramEventGlobalsTypeInternal()
      :
#ifndef PROTOBUF_MESSAGE_GLOBALS
        _default(::_pbi::ConstantInitialized{},
                 ProfileKeyedHistogramEvent_class_data_.base())
#else   // !PROTOBUF_MESSAGE_GLOBALS
        MessageGlobalsBase(ProfileKeyedHistogramEvent::InternalGenerateClassData_(
            _default, &ProfileKeyedHistogramEvent_globals_._table.header)),
        _default(::_pbi::ConstantInitialized{}, GetClassData()),
        _table(::_pbi::PrivateAccess::GenerateParseTable<ProfileKeyedHistogramEvent>(
            GetClassData()))
#endif  // PROTOBUF_MESSAGE_GLOBALS
  {
  }
  ~ProfileKeyedHistogramEventGlobalsTypeInternal() {}
  union {
    alignas(::_pbi::kMaxMessageAlignment) ProfileKeyedHistogramEvent _default;
  };
#ifdef PROTOBUF_MESSAGE_GLOBALS
  decltype(::_pbi::PrivateAccess::GenerateParseTable<ProfileKeyedHistogramEvent>(
      ::std::declval<const ::_pbi::ClassData*>())) _table;
#endif
};
#ifdef PROTOBUF_MESSAGE_GLOBALS
static_assert(PROTOBUF_FIELD_OFFSET(ProfileKeyedHistogramEventGlobalsTypeInternal, _default) ==
              ::_pbi::MessageGlobalsBase::OffsetToDefault());
#endif  // PROTOBUF_MESSAGE_GLOBALS

PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT
    PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 PROTOBUF_MESSAGE_GLOBALS_CONST ProfileKeyedHistogramEventGlobalsTypeInternal ProfileKeyedHistogramEvent_globals_
        PROTOBUF_MESSAGE_GLOBALS_SECTION(.data.rel.ro);
#if defined(PROTOBUF_CUSTOM_VTABLE)
namespace {
const ::_pbi::ClassData* ProfileKeyedHistogramEvent_get_class_data() {
#ifdef PROTOBUF_MESSAGE_GLOBALS
  return ProfileKeyedHistogramEvent_globals_.GetClassData();
#else
  return ProfileKeyedHistogramEvent_class_data_.base();
#endif  // PROTOBUF_MESSAGE_GLOBALS
}
}  // namespace
#endif  // PROTOBUF_CUSTOM_VTABLE
class PrivateUserMetrics::_Internal {
 public:
  using HasBits = decltype(::std::declval<PrivateUserMetrics>()._impl_._has_bits_);
  static constexpr ::int32_t kHasBitsOffset =
      8 * PROTOBUF_FIELD_OFFSET(PrivateUserMetrics, _impl_._has_bits_);
  static constexpr ::int32_t kOneofCaseOffset =
      PROTOBUF_FIELD_OFFSET(::private_metrics::PrivateUserMetrics, _impl_._oneof_case_);
};

constexpr PrivateUserMetrics::ParseTableT_ PrivateUserMetrics::InternalGenerateParseTable_(const ::_pbi::ClassData* class_data) {
  return ParseTableT_{
    {
      PROTOBUF_FIELD_OFFSET(PrivateUserMetrics, _impl_._has_bits_),
      0, // no _extensions_
      5, 56,  // max_field_number, fast_idx_mask
      offsetof(ParseTableT_, field_lookup_table),
      4294967264,  // skipmap
      offsetof(ParseTableT_, field_entries),
      5,  // num_field_entries
      4,  // num_aux_entries
      offsetof(ParseTableT_, aux_entries),
      class_data,
      nullptr,  // post_loop_handler
      ::_pbi::TcParser::GenericFallbackLite,  // fallback
      #ifdef PROTOBUF_PREFETCH_PARSE_TABLE
      ::_pbi::TcParser::GetTable<::private_metrics::PrivateUserMetrics>(),  // to_prefetch
      #endif  // PROTOBUF_PREFETCH_PARSE_TABLE
    }, {{
      {::_pbi::TcParser::MiniParse, {}},
      // fixed64 client_id = 1;
      {::_pbi::TcParser::FastF64S1,
       {9, 1, 0,
        PROTOBUF_FIELD_OFFSET(PrivateUserMetrics, _impl_.client_id_)}},
      // repeated .metrics.HistogramEventProto histogram_events = 2;
      {::_pbi::TcParser::FastMtR1,
       {18, 0, 0,
        PROTOBUF_FIELD_OFFSET(PrivateUserMetrics, _impl_.histogram_events_)}},
      {::_pbi::TcParser::MiniParse, {}},
      {::_pbi::TcParser::MiniParse, {}},
      // repeated .private_metrics.ProfileKeyedHistogramEvent profile_keyed_histogram_events = 5;
      {::_pbi::TcParser::FastMtR1,
       {42, 2, 3,
        PROTOBUF_FIELD_OFFSET(PrivateUserMetrics, _impl_.profile_keyed_histogram_events_)}},
      {::_pbi::TcParser::MiniParse, {}},
      {::_pbi::TcParser::MiniParse, {}},
    }}, {{
      65535, 65535
    }}, {{
      // fixed64 client_id = 1;
      {PROTOBUF_FIELD_OFFSET(PrivateUserMetrics, _impl_.client_id_), _Internal::kHasBitsOffset + 1, 0, (0 | ::_fl::kFcOptional | ::_fl::kFixed64)},
      // repeated .metrics.HistogramEventProto histogram_events = 2;
      {PROTOBUF_FIELD_OFFSET(PrivateUserMetrics, _impl_.histogram_events_), _Internal::kHasBitsOffset + 0, 0, (0 | ::_fl::kFcRepeated | ::_fl::kMessage | ::_fl::kTvTable)},
      // .private_metrics.RcCoarseSystemProfile rc_profile = 3;
      {PROTOBUF_FIELD_OFFSET(PrivateUserMetrics, _impl_.system_profile_.rc_profile_), _Internal::kOneofCaseOffset + 0, 1, (0 | ::_fl::kFcOneof | ::_fl::kMessage | ::_fl::kTvTable)},
      // .private_metrics.SearchSystemProfile search_profile = 4;
      {PROTOBUF_FIELD_OFFSET(PrivateUserMetrics, _impl_.system_profile_.search_profile_), _Internal::kOneofCaseOffset + 0, 2, (0 | ::_fl::kFcOneof | ::_fl::kMessage | ::_fl::kTvTable)},
      // repeated .private_metrics.ProfileKeyedHistogramEvent profile_keyed_histogram_events = 5;
      {PROTOBUF_FIELD_OFFSET(PrivateUserMetrics, _impl_.profile_keyed_histogram_events_), _Internal::kHasBitsOffset + 2, 3, (0 | ::_fl::kFcRepeated | ::_fl::kMessage | ::_fl::kTvTable)},
    }},
    {{
        #ifndef PROTOBUF_MESSAGE_GLOBALS
        {::_pbi::TcParser::GetTable<::metrics::HistogramEventProto>()},
        #else
        {::_pbi::FieldAuxMessageGlobals(), &::metrics::HistogramEventProto_globals_},
        #endif
        #ifndef PROTOBUF_MESSAGE_GLOBALS
        {::_pbi::TcParser::GetTable<::private_metrics::RcCoarseSystemProfile>()},
        #else
        {::_pbi::FieldAuxMessageGlobals(), &::private_metrics::RcCoarseSystemProfile_globals_},
        #endif
        #ifndef PROTOBUF_MESSAGE_GLOBALS
        {::_pbi::TcParser::GetTable<::private_metrics::SearchSystemProfile>()},
        #else
        {::_pbi::FieldAuxMessageGlobals(), &::private_metrics::SearchSystemProfile_globals_},
        #endif
        #ifndef PROTOBUF_MESSAGE_GLOBALS
        {::_pbi::TcParser::GetTable<::private_metrics::ProfileKeyedHistogramEvent>()},
        #else
        {::_pbi::FieldAuxMessageGlobals(), &::private_metrics::ProfileKeyedHistogramEvent_globals_},
        #endif
    }},
    {{
    }},
  };
}


inline constexpr PrivateUserMetrics::Impl_::Impl_(
    [[maybe_unused]] ::google::protobuf::internal::InternalVisibility visibility,
    ::_pbi::ConstantInitialized) noexcept
      : _cached_size_{0},
        histogram_events_ { visibility, ::_pbi::InternalMetadataOffset::Build<
            ::private_metrics::PrivateUserMetrics,
            PROTOBUF_FIELD_OFFSET(::private_metrics::PrivateUserMetrics, _impl_.histogram_events_)>()
         }
        ,
        client_id_{::uint64_t{0u}},
        profile_keyed_histogram_events_ { visibility, ::_pbi::InternalMetadataOffset::Build<
            ::private_metrics::PrivateUserMetrics,
            PROTOBUF_FIELD_OFFSET(::private_metrics::PrivateUserMetrics, _impl_.profile_keyed_histogram_events_)>()
         }
        ,
        system_profile_{},
        _oneof_case_{} {}

template <typename>
constexpr PrivateUserMetrics::PrivateUserMetrics(::_pbi::ConstantInitialized,
                       const ::_pbi::ClassData* PROTOBUF_NONNULL class_data)
    : ::google::protobuf::MessageLite(
#if defined(PROTOBUF_CUSTOM_VTABLE)
          class_data
#endif  // PROTOBUF_CUSTOM_VTABLE
          ),
      _impl_(internal_visibility(), ::_pbi::ConstantInitialized()) {
}
inline void* PROTOBUF_NONNULL PrivateUserMetrics::PlacementNew_(
    const void* PROTOBUF_NONNULL, void* PROTOBUF_NONNULL mem,
    ::google::protobuf::Arena* PROTOBUF_NULLABLE arena) {
  return ::new (mem) PrivateUserMetrics(arena);
}
constexpr auto PrivateUserMetrics::InternalNewImpl_() {
  return ::google::protobuf::internal::MessageCreator::CopyInit(sizeof(PrivateUserMetrics), alignof(PrivateUserMetrics));
}
constexpr auto PrivateUserMetrics::InternalGenerateClassData_(
    const MessageLite& prototype,
    const ::google::protobuf::internal::TcParseTableBase* tc_table) {
  return ::google::protobuf::internal::ClassDataLite{
      {
          &prototype,
#ifndef PROTOBUF_MESSAGE_GLOBALS
          &_table_.header,
#else
          tc_table,
#endif
          nullptr,  // IsInitialized
          &PrivateUserMetrics::MergeImpl,
          ::google::protobuf::MessageLite::GetNewImpl<PrivateUserMetrics>(),
#if defined(PROTOBUF_CUSTOM_VTABLE)
          &PrivateUserMetrics::SharedDtor,
          ::google::protobuf::MessageLite::GetClearImpl<PrivateUserMetrics>(), &PrivateUserMetrics::ByteSizeLong,
              &PrivateUserMetrics::_InternalSerialize,
#endif  // PROTOBUF_CUSTOM_VTABLE
          PROTOBUF_FIELD_OFFSET(PrivateUserMetrics, _impl_._cached_size_),
          true,
      },
      "private_metrics.PrivateUserMetrics",
  };
}
struct PrivateUserMetricsGlobalsTypeInternal : ::_pbi::MessageGlobalsBase {
  constexpr PrivateUserMetricsGlobalsTypeInternal()
      :
#ifndef PROTOBUF_MESSAGE_GLOBALS
        _default(::_pbi::ConstantInitialized{},
                 PrivateUserMetrics_class_data_.base())
#else   // !PROTOBUF_MESSAGE_GLOBALS
        MessageGlobalsBase(PrivateUserMetrics::InternalGenerateClassData_(
            _default, &PrivateUserMetrics_globals_._table.header)),
        _default(::_pbi::ConstantInitialized{}, GetClassData()),
        _table(::_pbi::PrivateAccess::GenerateParseTable<PrivateUserMetrics>(
            GetClassData()))
#endif  // PROTOBUF_MESSAGE_GLOBALS
  {
  }
  ~PrivateUserMetricsGlobalsTypeInternal() {}
  union {
    alignas(::_pbi::kMaxMessageAlignment) PrivateUserMetrics _default;
  };
#ifdef PROTOBUF_MESSAGE_GLOBALS
  decltype(::_pbi::PrivateAccess::GenerateParseTable<PrivateUserMetrics>(
      ::std::declval<const ::_pbi::ClassData*>())) _table;
#endif
};
#ifdef PROTOBUF_MESSAGE_GLOBALS
static_assert(PROTOBUF_FIELD_OFFSET(PrivateUserMetricsGlobalsTypeInternal, _default) ==
              ::_pbi::MessageGlobalsBase::OffsetToDefault());
#endif  // PROTOBUF_MESSAGE_GLOBALS

PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT
    PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 PROTOBUF_MESSAGE_GLOBALS_CONST PrivateUserMetricsGlobalsTypeInternal PrivateUserMetrics_globals_
        PROTOBUF_MESSAGE_GLOBALS_SECTION(.data.rel.ro);
#if defined(PROTOBUF_CUSTOM_VTABLE)
namespace {
const ::_pbi::ClassData* PrivateUserMetrics_get_class_data() {
#ifdef PROTOBUF_MESSAGE_GLOBALS
  return PrivateUserMetrics_globals_.GetClassData();
#else
  return PrivateUserMetrics_class_data_.base();
#endif  // PROTOBUF_MESSAGE_GLOBALS
}
}  // namespace
#endif  // PROTOBUF_CUSTOM_VTABLE
}  // namespace private_metrics
namespace private_metrics {
// ===================================================================

void PrivateUserMetrics::clear_histogram_events() {
  ::google::protobuf::internal::TSanWrite(&_impl_);
  _impl_.histogram_events_.Clear();
  ClearHasBit(_impl_._has_bits_[0], 0x00000001U);
}
void PrivateUserMetrics::set_allocated_rc_profile(::private_metrics::RcCoarseSystemProfile* PROTOBUF_NULLABLE rc_profile) {
  ::google::protobuf::Arena* message_arena = GetArena();
  clear_system_profile();
  if (rc_profile) {
    ::google::protobuf::Arena* submessage_arena = reinterpret_cast<::google::protobuf::MessageLite*>(rc_profile)->GetArena();
    if (message_arena != submessage_arena) {
      rc_profile = ::google::protobuf::internal::GetOwnedMessage(message_arena, rc_profile, submessage_arena);
    }
    set_has_rc_profile();
    _impl_.system_profile_.rc_profile_ = rc_profile;
  }
  // @@protoc_insertion_point(field_set_allocated:private_metrics.PrivateUserMetrics.rc_profile)
}
void PrivateUserMetrics::clear_rc_profile() {
  ::google::protobuf::internal::TSanWrite(&_impl_);
  if (system_profile_case() == kRcProfile) {
    if (GetArena() == nullptr) {
      delete _impl_.system_profile_.rc_profile_;
    } else if (::google::protobuf::internal::DebugHardenClearOneofMessageOnArena()) {
      if (_impl_.system_profile_.rc_profile_ != nullptr) {
        _impl_.system_profile_.rc_profile_->Clear();
      }
    }
    clear_has_system_profile();
  }
}
void PrivateUserMetrics::set_allocated_search_profile(::private_metrics::SearchSystemProfile* PROTOBUF_NULLABLE search_profile) {
  ::google::protobuf::Arena* message_arena = GetArena();
  clear_system_profile();
  if (search_profile) {
    ::google::protobuf::Arena* submessage_arena = reinterpret_cast<::google::protobuf::MessageLite*>(search_profile)->GetArena();
    if (message_arena != submessage_arena) {
      search_profile = ::google::protobuf::internal::GetOwnedMessage(message_arena, search_profile, submessage_arena);
    }
    set_has_search_profile();
    _impl_.system_profile_.search_profile_ = search_profile;
  }
  // @@protoc_insertion_point(field_set_allocated:private_metrics.PrivateUserMetrics.search_profile)
}
void PrivateUserMetrics::clear_search_profile() {
  ::google::protobuf::internal::TSanWrite(&_impl_);
  if (system_profile_case() == kSearchProfile) {
    if (GetArena() == nullptr) {
      delete _impl_.system_profile_.search_profile_;
    } else if (::google::protobuf::internal::DebugHardenClearOneofMessageOnArena()) {
      if (_impl_.system_profile_.search_profile_ != nullptr) {
        _impl_.system_profile_.search_profile_->Clear();
      }
    }
    clear_has_system_profile();
  }
}
PrivateUserMetrics::PrivateUserMetrics(::google::protobuf::Arena* PROTOBUF_NULLABLE arena)
#if defined(PROTOBUF_CUSTOM_VTABLE)
    : ::google::protobuf::MessageLite(arena, PrivateUserMetrics_get_class_data()) {
#else   // PROTOBUF_CUSTOM_VTABLE
    : ::google::protobuf::MessageLite(arena) {
#endif  // PROTOBUF_CUSTOM_VTABLE
  SharedCtor(arena);
  // @@protoc_insertion_point(arena_constructor:private_metrics.PrivateUserMetrics)
}
PROTOBUF_NDEBUG_INLINE PrivateUserMetrics::Impl_::Impl_(
    [[maybe_unused]] ::google::protobuf::internal::InternalVisibility visibility,
    [[maybe_unused]] ::google::protobuf::Arena* PROTOBUF_NULLABLE arena, const Impl_& from,
    [[maybe_unused]] const ::private_metrics::PrivateUserMetrics& from_msg)
      : _has_bits_{from._has_bits_},
        _cached_size_{0},
        histogram_events_ {
          visibility, ::_pbi::InternalMetadataOffset::Build<
              ::private_metrics::PrivateUserMetrics,
              PROTOBUF_FIELD_OFFSET(::private_metrics::PrivateUserMetrics, _impl_.histogram_events_)>()
          , from.histogram_events_
        }
        ,
        profile_keyed_histogram_events_ {
          visibility, ::_pbi::InternalMetadataOffset::Build<
              ::private_metrics::PrivateUserMetrics,
              PROTOBUF_FIELD_OFFSET(::private_metrics::PrivateUserMetrics, _impl_.profile_keyed_histogram_events_)>()
          , from.profile_keyed_histogram_events_
        }
        ,
        system_profile_{},
        _oneof_case_{from._oneof_case_[0]} {}

PrivateUserMetrics::PrivateUserMetrics(
    ::google::protobuf::Arena* PROTOBUF_NULLABLE arena,
    const PrivateUserMetrics& from)
#if defined(PROTOBUF_CUSTOM_VTABLE)
    : ::google::protobuf::MessageLite(arena, PrivateUserMetrics_get_class_data()) {

#else   // PROTOBUF_CUSTOM_VTABLE
    : ::google::protobuf::MessageLite(arena) {
#endif  // PROTOBUF_CUSTOM_VTABLE
  PrivateUserMetrics* const _this = this;
  (void)_this;
  _internal_metadata_.MergeFrom<::std::string>(
      from._internal_metadata_);
  new (&_impl_) Impl_(internal_visibility(), arena, from._impl_, from);
  _impl_.client_id_ = from._impl_.client_id_;
  switch (system_profile_case()) {
    case SYSTEM_PROFILE_NOT_SET:
      break;
      case kRcProfile:
        _impl_.system_profile_.rc_profile_ = ::google::protobuf::MessageLite::CopyConstruct(arena, *from._impl_.system_profile_.rc_profile_);
        break;
      case kSearchProfile:
        _impl_.system_profile_.search_profile_ = ::google::protobuf::MessageLite::CopyConstruct(arena, *from._impl_.system_profile_.search_profile_);
        break;
  }

  // @@protoc_insertion_point(copy_constructor:private_metrics.PrivateUserMetrics)
}
PROTOBUF_NDEBUG_INLINE PrivateUserMetrics::Impl_::Impl_(
    [[maybe_unused]] ::google::protobuf::internal::InternalVisibility visibility,
    [[maybe_unused]] ::google::protobuf::Arena* PROTOBUF_NULLABLE arena)
      : _cached_size_{0},
        histogram_events_ { visibility, ::_pbi::InternalMetadataOffset::Build<
            ::private_metrics::PrivateUserMetrics,
            PROTOBUF_FIELD_OFFSET(::private_metrics::PrivateUserMetrics, _impl_.histogram_events_)>()
         }
        ,
        profile_keyed_histogram_events_ { visibility, ::_pbi::InternalMetadataOffset::Build<
            ::private_metrics::PrivateUserMetrics,
            PROTOBUF_FIELD_OFFSET(::private_metrics::PrivateUserMetrics, _impl_.profile_keyed_histogram_events_)>()
         }
        ,
        system_profile_{},
        _oneof_case_{} {}

inline void PrivateUserMetrics::SharedCtor(::_pb::Arena* PROTOBUF_NULLABLE arena) {
  new (&_impl_) Impl_(internal_visibility(), arena);
  _impl_.client_id_ = {};
}
PrivateUserMetrics::~PrivateUserMetrics() {
  // @@protoc_insertion_point(destructor:private_metrics.PrivateUserMetrics)
  SharedDtor(*this);
}
inline void PrivateUserMetrics::SharedDtor(MessageLite& self) {
  PrivateUserMetrics& this_ = static_cast<PrivateUserMetrics&>(self);
  if constexpr (::_pbi::DebugHardenCheckHasBitConsistency()) {
    this_.CheckHasBitConsistency();
  }
  this_._internal_metadata_.Delete<::std::string>();
  ABSL_DCHECK(this_.GetArena() == nullptr);
  if (this_.has_system_profile()) {
    this_.clear_system_profile();
  }
  this_._impl_.~Impl_();
}

void PrivateUserMetrics::clear_system_profile() {
// @@protoc_insertion_point(one_of_clear_start:private_metrics.PrivateUserMetrics)
  ::google::protobuf::internal::TSanWrite(&_impl_);
  switch (system_profile_case()) {
    case kRcProfile: {
      if (GetArena() == nullptr) {
        delete _impl_.system_profile_.rc_profile_;
      } else if (::google::protobuf::internal::DebugHardenClearOneofMessageOnArena()) {
        if (_impl_.system_profile_.rc_profile_ != nullptr) {
          _impl_.system_profile_.rc_profile_->Clear();
        }
      }
      break;
    }
    case kSearchProfile: {
      if (GetArena() == nullptr) {
        delete _impl_.system_profile_.search_profile_;
      } else if (::google::protobuf::internal::DebugHardenClearOneofMessageOnArena()) {
        if (_impl_.system_profile_.search_profile_ != nullptr) {
          _impl_.system_profile_.search_profile_->Clear();
        }
      }
      break;
    }
    case SYSTEM_PROFILE_NOT_SET: {
      break;
    }
  }
  _impl_._oneof_case_[0] = SYSTEM_PROFILE_NOT_SET;
}


#ifndef PROTOBUF_MESSAGE_GLOBALS
PROTOBUF_CONSTINIT
PROTOBUF_ATTRIBUTE_INIT_PRIORITY1
const ::google::protobuf::internal::ClassDataLite PrivateUserMetrics_class_data_ =
    PrivateUserMetrics::InternalGenerateClassData_(PrivateUserMetrics_globals_._default);

PROTOBUF_ATTRIBUTE_WEAK const ::google::protobuf::internal::ClassData* PROTOBUF_NONNULL
PrivateUserMetrics::GetClassData() const {
  return PrivateUserMetrics_class_data_.base();
}
#else
PROTOBUF_ATTRIBUTE_WEAK const ::google::protobuf::internal::ClassData* PROTOBUF_NONNULL
PrivateUserMetrics::GetClassData() const {
  return PrivateUserMetrics_globals_.GetClassData();
}
#endif  // !PROTOBUF_MESSAGE_GLOBALS
#ifndef PROTOBUF_MESSAGE_GLOBALS
PROTOBUF_CONSTINIT
PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 const PrivateUserMetrics::ParseTableT_
    PrivateUserMetrics::_table_ =
        PrivateUserMetrics::InternalGenerateParseTable_(PrivateUserMetrics_class_data_.base());
#endif  // !PROTOBUF_MESSAGE_GLOBALS
PROTOBUF_NOINLINE void PrivateUserMetrics::Clear() {
// @@protoc_insertion_point(message_clear_start:private_metrics.PrivateUserMetrics)
  ::google::protobuf::internal::TSanWrite(&_impl_);
  ::uint32_t cached_has_bits = 0;
  // Prevent compiler warnings about cached_has_bits being unused
  (void) cached_has_bits;

  cached_has_bits = _impl_._has_bits_[0];
  if (CheckHasBit(cached_has_bits, 0x00000001U)) {
    _impl_.histogram_events_.Clear();
  }
  if (BatchCheckHasBit(cached_has_bits, 0x00000006U)) {
    _impl_.client_id_ = ::uint64_t{0u};
    if (CheckHasBit(cached_has_bits, 0x00000004U)) {
      _impl_.profile_keyed_histogram_events_.Clear();
    }
  }
  clear_system_profile();
  _impl_._has_bits_.Clear();
  _internal_metadata_.Clear<::std::string>();
}

#if defined(PROTOBUF_CUSTOM_VTABLE)
::uint8_t* PROTOBUF_NONNULL PrivateUserMetrics::_InternalSerialize(
    const ::google::protobuf::MessageLite& base, ::uint8_t* PROTOBUF_NONNULL target,
    ::google::protobuf::io::EpsCopyOutputStream* PROTOBUF_NONNULL stream) {
  const PrivateUserMetrics& this_ = static_cast<const PrivateUserMetrics&>(base);
#else   // PROTOBUF_CUSTOM_VTABLE
::uint8_t* PROTOBUF_NONNULL PrivateUserMetrics::_InternalSerialize(
    ::uint8_t* PROTOBUF_NONNULL target,
    ::google::protobuf::io::EpsCopyOutputStream* PROTOBUF_NONNULL stream) const {
  const PrivateUserMetrics& this_ = *this;
#endif  // PROTOBUF_CUSTOM_VTABLE
  if constexpr (::_pbi::DebugHardenCheckHasBitConsistency()) {
    this_.CheckHasBitConsistency();
  }
  // @@protoc_insertion_point(serialize_to_array_start:private_metrics.PrivateUserMetrics)
  ::uint32_t cached_has_bits = 0;
  (void)cached_has_bits;

  cached_has_bits = this_._impl_._has_bits_[0];
  // fixed64 client_id = 1;
  if (CheckHasBit(cached_has_bits, 0x00000002U)) {
    target = stream->EnsureSpace(target);
    target = ::_pbi::WireFormatLite::WriteFixed64ToArray(
        1, this_._internal_client_id(), target);
  }

  // repeated .metrics.HistogramEventProto histogram_events = 2;
  if (CheckHasBit(cached_has_bits, 0x00000001U)) {
    for (unsigned i = 0, n = static_cast<unsigned>(
                             this_._internal_histogram_events_size());
         i < n; i++) {
      const auto& repfield = this_._internal_histogram_events().Get(i);
      target =
          ::google::protobuf::internal::WireFormatLite::InternalWriteMessage(
              2, repfield, repfield.GetCachedSize(),
              target, stream);
    }
  }

  switch (this_.system_profile_case()) {
    case kRcProfile: {
      target = ::google::protobuf::internal::WireFormatLite::InternalWriteMessage(
          3, *this_._impl_.system_profile_.rc_profile_, this_._impl_.system_profile_.rc_profile_->GetCachedSize(), target,
          stream);
      break;
    }
    case kSearchProfile: {
      target = ::google::protobuf::internal::WireFormatLite::InternalWriteMessage(
          4, *this_._impl_.system_profile_.search_profile_, this_._impl_.system_profile_.search_profile_->GetCachedSize(), target,
          stream);
      break;
    }
    default:
      break;
  }
  // repeated .private_metrics.ProfileKeyedHistogramEvent profile_keyed_histogram_events = 5;
  if (CheckHasBit(cached_has_bits, 0x00000004U)) {
    for (unsigned i = 0, n = static_cast<unsigned>(
                             this_._internal_profile_keyed_histogram_events_size());
         i < n; i++) {
      const auto& repfield = this_._internal_profile_keyed_histogram_events().Get(i);
      target =
          ::google::protobuf::internal::WireFormatLite::InternalWriteMessage(
              5, repfield, repfield.GetCachedSize(),
              target, stream);
    }
  }

  if (ABSL_PREDICT_FALSE(this_._internal_metadata_.have_unknown_fields())) {
    target = stream->WriteRaw(
        this_._internal_metadata_.unknown_fields<::std::string>(::google::protobuf::internal::GetEmptyString).data(),
        static_cast<int>(this_._internal_metadata_.unknown_fields<::std::string>(::google::protobuf::internal::GetEmptyString).size()), target);
  }
  // @@protoc_insertion_point(serialize_to_array_end:private_metrics.PrivateUserMetrics)
  return target;
}

#if defined(PROTOBUF_CUSTOM_VTABLE)
::size_t PrivateUserMetrics::ByteSizeLong(const MessageLite& base) {
  const PrivateUserMetrics& this_ = static_cast<const PrivateUserMetrics&>(base);
#else   // PROTOBUF_CUSTOM_VTABLE
::size_t PrivateUserMetrics::ByteSizeLong() const {
  const PrivateUserMetrics& this_ = *this;
#endif  // PROTOBUF_CUSTOM_VTABLE
  // @@protoc_insertion_point(message_byte_size_start:private_metrics.PrivateUserMetrics)
  ::size_t total_size = 0;

  ::uint32_t cached_has_bits = 0;
  // Prevent compiler warnings about cached_has_bits being unused
  (void)cached_has_bits;

  ::_pbi::Prefetch5LinesFrom7Lines(&this_);
  cached_has_bits = this_._impl_._has_bits_[0];
  total_size += static_cast<bool>(0x00000002U & cached_has_bits) * 9;
  if (BatchCheckHasBit(cached_has_bits, 0x00000005U)) {
    // repeated .metrics.HistogramEventProto histogram_events = 2;
    if (CheckHasBit(cached_has_bits, 0x00000001U)) {
      total_size += 1UL * this_._internal_histogram_events_size();
      for (const auto& msg : this_._internal_histogram_events()) {
        total_size += ::google::protobuf::internal::WireFormatLite::MessageSize(msg);
      }
    }
    // repeated .private_metrics.ProfileKeyedHistogramEvent profile_keyed_histogram_events = 5;
    if (CheckHasBit(cached_has_bits, 0x00000004U)) {
      total_size += 1UL * this_._internal_profile_keyed_histogram_events_size();
      for (const auto& msg : this_._internal_profile_keyed_histogram_events()) {
        total_size += ::google::protobuf::internal::WireFormatLite::MessageSize(msg);
      }
    }
  }
  switch (this_.system_profile_case()) {
    // .private_metrics.RcCoarseSystemProfile rc_profile = 3;
    case kRcProfile: {
      total_size += 1 +
                    ::google::protobuf::internal::WireFormatLite::MessageSize(*this_._impl_.system_profile_.rc_profile_);
      break;
    }
    // .private_metrics.SearchSystemProfile search_profile = 4;
    case kSearchProfile: {
      total_size += 1 +
                    ::google::protobuf::internal::WireFormatLite::MessageSize(*this_._impl_.system_profile_.search_profile_);
      break;
    }
    case SYSTEM_PROFILE_NOT_SET: {
      break;
    }
  }
  if (ABSL_PREDICT_FALSE(this_._internal_metadata_.have_unknown_fields())) {
    total_size += this_._internal_metadata_.unknown_fields<::std::string>(::google::protobuf::internal::GetEmptyString).size();
  }
  this_._impl_._cached_size_.Set(::_pbi::ToCachedSize(total_size));
  return total_size;
}

void PrivateUserMetrics::MergeImpl(::google::protobuf::MessageLite& to_msg,
                      const ::google::protobuf::MessageLite& from_msg) {
   auto* const _this = static_cast<PrivateUserMetrics*>(&to_msg);
  auto& from = static_cast<const PrivateUserMetrics&>(from_msg);
  if constexpr (::_pbi::DebugHardenCheckHasBitConsistency()) {
    from.CheckHasBitConsistency();
  }
  ::google::protobuf::Arena* arena = _this->GetArena();
  // @@protoc_insertion_point(class_specific_merge_from_start:private_metrics.PrivateUserMetrics)
  ABSL_DCHECK_NE(&from, _this);
  ::uint32_t cached_has_bits = 0;
  (void)cached_has_bits;

  cached_has_bits = from._impl_._has_bits_[0];
  if (BatchCheckHasBit(cached_has_bits, 0x00000007U)) {
    if (CheckHasBit(cached_has_bits, 0x00000001U)) {
      _this->_internal_mutable_histogram_events()->InternalMergeFromWithArena(
          ::google::protobuf::MessageLite::internal_visibility(), arena,
          from._internal_histogram_events());
    }
    if (CheckHasBit(cached_has_bits, 0x00000002U)) {
      _this->_impl_.client_id_ = from._impl_.client_id_;
    }
    if (CheckHasBit(cached_has_bits, 0x00000004U)) {
      _this->_internal_mutable_profile_keyed_histogram_events()->InternalMergeFromWithArena(
          ::google::protobuf::MessageLite::internal_visibility(), arena,
          from._internal_profile_keyed_histogram_events());
    }
  }
  _this->_impl_._has_bits_[0] |= cached_has_bits;
  if (const uint32_t oneof_from_case =
          from._impl_._oneof_case_[0]) {
    const uint32_t oneof_to_case = _this->_impl_._oneof_case_[0];
    const bool oneof_needs_init = oneof_to_case != oneof_from_case;
    if (oneof_needs_init) {
      if (oneof_to_case != 0) {
        _this->clear_system_profile();
      }
      _this->_impl_._oneof_case_[0] = oneof_from_case;
    }

    switch (oneof_from_case) {
      case kRcProfile: {
        if (oneof_needs_init) {
          _this->_impl_.system_profile_.rc_profile_ = ::google::protobuf::MessageLite::CopyConstruct(arena, *from._impl_.system_profile_.rc_profile_);
        } else {
          _this->_impl_.system_profile_.rc_profile_->MergeFrom(*from._impl_.system_profile_.rc_profile_);
        }
        break;
      }
      case kSearchProfile: {
        if (oneof_needs_init) {
          _this->_impl_.system_profile_.search_profile_ = ::google::protobuf::MessageLite::CopyConstruct(arena, *from._impl_.system_profile_.search_profile_);
        } else {
          _this->_impl_.system_profile_.search_profile_->MergeFrom(*from._impl_.system_profile_.search_profile_);
        }
        break;
      }
      case SYSTEM_PROFILE_NOT_SET:
        break;
    }
  }
  _this->_internal_metadata_.MergeFrom<::std::string>(
      from._internal_metadata_);
}

void PrivateUserMetrics::CopyFrom(const PrivateUserMetrics& from) {
  // @@protoc_insertion_point(class_specific_copy_from_start:private_metrics.PrivateUserMetrics)
  if (&from == this) return;
  Clear();
  MergeFrom(from);
}


void PrivateUserMetrics::InternalSwap(PrivateUserMetrics* PROTOBUF_RESTRICT PROTOBUF_NONNULL other) {
  using ::std::swap;
  _internal_metadata_.InternalSwap(&other->_internal_metadata_);
  swap(_impl_._has_bits_[0], other->_impl_._has_bits_[0]);
  _impl_.histogram_events_.InternalSwap(&other->_impl_.histogram_events_);
  swap(_impl_.client_id_, other->_impl_.client_id_);
  _impl_.profile_keyed_histogram_events_.InternalSwap(&other->_impl_.profile_keyed_histogram_events_);
  swap(_impl_.system_profile_, other->_impl_.system_profile_);
  swap(_impl_._oneof_case_[0], other->_impl_._oneof_case_[0]);
}

// ===================================================================

void ProfileKeyedHistogramEvent::clear_histogram_events() {
  ::google::protobuf::internal::TSanWrite(&_impl_);
  _impl_.histogram_events_.Clear();
  ClearHasBit(_impl_._has_bits_[0], 0x00000001U);
}
ProfileKeyedHistogramEvent::ProfileKeyedHistogramEvent(::google::protobuf::Arena* PROTOBUF_NULLABLE arena)
#if defined(PROTOBUF_CUSTOM_VTABLE)
    : ::google::protobuf::MessageLite(arena, ProfileKeyedHistogramEvent_get_class_data()) {
#else   // PROTOBUF_CUSTOM_VTABLE
    : ::google::protobuf::MessageLite(arena) {
#endif  // PROTOBUF_CUSTOM_VTABLE
  SharedCtor(arena);
  // @@protoc_insertion_point(arena_constructor:private_metrics.ProfileKeyedHistogramEvent)
}
PROTOBUF_NDEBUG_INLINE ProfileKeyedHistogramEvent::Impl_::Impl_(
    [[maybe_unused]] ::google::protobuf::internal::InternalVisibility visibility,
    [[maybe_unused]] ::google::protobuf::Arena* PROTOBUF_NULLABLE arena, const Impl_& from,
    [[maybe_unused]] const ::private_metrics::ProfileKeyedHistogramEvent& from_msg)
      : _has_bits_{from._has_bits_},
        _cached_size_{0},
        histogram_events_ {
          visibility, ::_pbi::InternalMetadataOffset::Build<
              ::private_metrics::ProfileKeyedHistogramEvent,
              PROTOBUF_FIELD_OFFSET(::private_metrics::ProfileKeyedHistogramEvent, _impl_.histogram_events_)>()
          , from.histogram_events_
        }
     {}

ProfileKeyedHistogramEvent::ProfileKeyedHistogramEvent(
    ::google::protobuf::Arena* PROTOBUF_NULLABLE arena,
    const ProfileKeyedHistogramEvent& from)
#if defined(PROTOBUF_CUSTOM_VTABLE)
    : ::google::protobuf::MessageLite(arena, ProfileKeyedHistogramEvent_get_class_data()) {

#else   // PROTOBUF_CUSTOM_VTABLE
    : ::google::protobuf::MessageLite(arena) {
#endif  // PROTOBUF_CUSTOM_VTABLE
  ProfileKeyedHistogramEvent* const _this = this;
  (void)_this;
  _internal_metadata_.MergeFrom<::std::string>(
      from._internal_metadata_);
  new (&_impl_) Impl_(internal_visibility(), arena, from._impl_, from);
  _impl_.profile_id_ = from._impl_.profile_id_;

  // @@protoc_insertion_point(copy_constructor:private_metrics.ProfileKeyedHistogramEvent)
}
PROTOBUF_NDEBUG_INLINE ProfileKeyedHistogramEvent::Impl_::Impl_(
    [[maybe_unused]] ::google::protobuf::internal::InternalVisibility visibility,
    [[maybe_unused]] ::google::protobuf::Arena* PROTOBUF_NULLABLE arena)
      : _cached_size_{0},
        histogram_events_ { visibility, ::_pbi::InternalMetadataOffset::Build<
            ::private_metrics::ProfileKeyedHistogramEvent,
            PROTOBUF_FIELD_OFFSET(::private_metrics::ProfileKeyedHistogramEvent, _impl_.histogram_events_)>()
         }
     {}

inline void ProfileKeyedHistogramEvent::SharedCtor(::_pb::Arena* PROTOBUF_NULLABLE arena) {
  new (&_impl_) Impl_(internal_visibility(), arena);
  _impl_.profile_id_ = {};
}
ProfileKeyedHistogramEvent::~ProfileKeyedHistogramEvent() {
  // @@protoc_insertion_point(destructor:private_metrics.ProfileKeyedHistogramEvent)
  SharedDtor(*this);
}
inline void ProfileKeyedHistogramEvent::SharedDtor(MessageLite& self) {
  ProfileKeyedHistogramEvent& this_ = static_cast<ProfileKeyedHistogramEvent&>(self);
  if constexpr (::_pbi::DebugHardenCheckHasBitConsistency()) {
    this_.CheckHasBitConsistency();
  }
  this_._internal_metadata_.Delete<::std::string>();
  ABSL_DCHECK(this_.GetArena() == nullptr);
  this_._impl_.~Impl_();
}

#ifndef PROTOBUF_MESSAGE_GLOBALS
PROTOBUF_CONSTINIT
PROTOBUF_ATTRIBUTE_INIT_PRIORITY1
const ::google::protobuf::internal::ClassDataLite ProfileKeyedHistogramEvent_class_data_ =
    ProfileKeyedHistogramEvent::InternalGenerateClassData_(ProfileKeyedHistogramEvent_globals_._default);

PROTOBUF_ATTRIBUTE_WEAK const ::google::protobuf::internal::ClassData* PROTOBUF_NONNULL
ProfileKeyedHistogramEvent::GetClassData() const {
  return ProfileKeyedHistogramEvent_class_data_.base();
}
#else
PROTOBUF_ATTRIBUTE_WEAK const ::google::protobuf::internal::ClassData* PROTOBUF_NONNULL
ProfileKeyedHistogramEvent::GetClassData() const {
  return ProfileKeyedHistogramEvent_globals_.GetClassData();
}
#endif  // !PROTOBUF_MESSAGE_GLOBALS
#ifndef PROTOBUF_MESSAGE_GLOBALS
PROTOBUF_CONSTINIT
PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 const ProfileKeyedHistogramEvent::ParseTableT_
    ProfileKeyedHistogramEvent::_table_ =
        ProfileKeyedHistogramEvent::InternalGenerateParseTable_(ProfileKeyedHistogramEvent_class_data_.base());
#endif  // !PROTOBUF_MESSAGE_GLOBALS
PROTOBUF_NOINLINE void ProfileKeyedHistogramEvent::Clear() {
// @@protoc_insertion_point(message_clear_start:private_metrics.ProfileKeyedHistogramEvent)
  ::google::protobuf::internal::TSanWrite(&_impl_);
  ::uint32_t cached_has_bits = 0;
  // Prevent compiler warnings about cached_has_bits being unused
  (void) cached_has_bits;

  cached_has_bits = _impl_._has_bits_[0];
  if (CheckHasBit(cached_has_bits, 0x00000001U)) {
    _impl_.histogram_events_.Clear();
  }
  _impl_.profile_id_ = ::uint64_t{0u};
  _impl_._has_bits_.Clear();
  _internal_metadata_.Clear<::std::string>();
}

#if defined(PROTOBUF_CUSTOM_VTABLE)
::uint8_t* PROTOBUF_NONNULL ProfileKeyedHistogramEvent::_InternalSerialize(
    const ::google::protobuf::MessageLite& base, ::uint8_t* PROTOBUF_NONNULL target,
    ::google::protobuf::io::EpsCopyOutputStream* PROTOBUF_NONNULL stream) {
  const ProfileKeyedHistogramEvent& this_ = static_cast<const ProfileKeyedHistogramEvent&>(base);
#else   // PROTOBUF_CUSTOM_VTABLE
::uint8_t* PROTOBUF_NONNULL ProfileKeyedHistogramEvent::_InternalSerialize(
    ::uint8_t* PROTOBUF_NONNULL target,
    ::google::protobuf::io::EpsCopyOutputStream* PROTOBUF_NONNULL stream) const {
  const ProfileKeyedHistogramEvent& this_ = *this;
#endif  // PROTOBUF_CUSTOM_VTABLE
  if constexpr (::_pbi::DebugHardenCheckHasBitConsistency()) {
    this_.CheckHasBitConsistency();
  }
  // @@protoc_insertion_point(serialize_to_array_start:private_metrics.ProfileKeyedHistogramEvent)
  ::uint32_t cached_has_bits = 0;
  (void)cached_has_bits;

  cached_has_bits = this_._impl_._has_bits_[0];
  // fixed64 profile_id = 1;
  if (CheckHasBit(cached_has_bits, 0x00000002U)) {
    target = stream->EnsureSpace(target);
    target = ::_pbi::WireFormatLite::WriteFixed64ToArray(
        1, this_._internal_profile_id(), target);
  }

  // repeated .metrics.HistogramEventProto histogram_events = 2;
  if (CheckHasBit(cached_has_bits, 0x00000001U)) {
    for (unsigned i = 0, n = static_cast<unsigned>(
                             this_._internal_histogram_events_size());
         i < n; i++) {
      const auto& repfield = this_._internal_histogram_events().Get(i);
      target =
          ::google::protobuf::internal::WireFormatLite::InternalWriteMessage(
              2, repfield, repfield.GetCachedSize(),
              target, stream);
    }
  }

  if (ABSL_PREDICT_FALSE(this_._internal_metadata_.have_unknown_fields())) {
    target = stream->WriteRaw(
        this_._internal_metadata_.unknown_fields<::std::string>(::google::protobuf::internal::GetEmptyString).data(),
        static_cast<int>(this_._internal_metadata_.unknown_fields<::std::string>(::google::protobuf::internal::GetEmptyString).size()), target);
  }
  // @@protoc_insertion_point(serialize_to_array_end:private_metrics.ProfileKeyedHistogramEvent)
  return target;
}

#if defined(PROTOBUF_CUSTOM_VTABLE)
::size_t ProfileKeyedHistogramEvent::ByteSizeLong(const MessageLite& base) {
  const ProfileKeyedHistogramEvent& this_ = static_cast<const ProfileKeyedHistogramEvent&>(base);
#else   // PROTOBUF_CUSTOM_VTABLE
::size_t ProfileKeyedHistogramEvent::ByteSizeLong() const {
  const ProfileKeyedHistogramEvent& this_ = *this;
#endif  // PROTOBUF_CUSTOM_VTABLE
  // @@protoc_insertion_point(message_byte_size_start:private_metrics.ProfileKeyedHistogramEvent)
  ::size_t total_size = 0;

  ::uint32_t cached_has_bits = 0;
  // Prevent compiler warnings about cached_has_bits being unused
  (void)cached_has_bits;

  ::_pbi::Prefetch5LinesFrom7Lines(&this_);
  cached_has_bits = this_._impl_._has_bits_[0];
  total_size += static_cast<bool>(0x00000002U & cached_has_bits) * 9;
   {
    // repeated .metrics.HistogramEventProto histogram_events = 2;
    if (CheckHasBit(cached_has_bits, 0x00000001U)) {
      total_size += 1UL * this_._internal_histogram_events_size();
      for (const auto& msg : this_._internal_histogram_events()) {
        total_size += ::google::protobuf::internal::WireFormatLite::MessageSize(msg);
      }
    }
  }
  if (ABSL_PREDICT_FALSE(this_._internal_metadata_.have_unknown_fields())) {
    total_size += this_._internal_metadata_.unknown_fields<::std::string>(::google::protobuf::internal::GetEmptyString).size();
  }
  this_._impl_._cached_size_.Set(::_pbi::ToCachedSize(total_size));
  return total_size;
}

void ProfileKeyedHistogramEvent::MergeImpl(::google::protobuf::MessageLite& to_msg,
                      const ::google::protobuf::MessageLite& from_msg) {
   auto* const _this = static_cast<ProfileKeyedHistogramEvent*>(&to_msg);
  auto& from = static_cast<const ProfileKeyedHistogramEvent&>(from_msg);
  if constexpr (::_pbi::DebugHardenCheckHasBitConsistency()) {
    from.CheckHasBitConsistency();
  }
  ::google::protobuf::Arena* arena = _this->GetArena();
  // @@protoc_insertion_point(class_specific_merge_from_start:private_metrics.ProfileKeyedHistogramEvent)
  ABSL_DCHECK_NE(&from, _this);
  ::uint32_t cached_has_bits = 0;
  (void)cached_has_bits;

  cached_has_bits = from._impl_._has_bits_[0];
  if (BatchCheckHasBit(cached_has_bits, 0x00000003U)) {
    if (CheckHasBit(cached_has_bits, 0x00000001U)) {
      _this->_internal_mutable_histogram_events()->InternalMergeFromWithArena(
          ::google::protobuf::MessageLite::internal_visibility(), arena,
          from._internal_histogram_events());
    }
    if (CheckHasBit(cached_has_bits, 0x00000002U)) {
      _this->_impl_.profile_id_ = from._impl_.profile_id_;
    }
  }
  _this->_impl_._has_bits_[0] |= cached_has_bits;
  _this->_internal_metadata_.MergeFrom<::std::string>(
      from._internal_metadata_);
}

void ProfileKeyedHistogramEvent::CopyFrom(const ProfileKeyedHistogramEvent& from) {
  // @@protoc_insertion_point(class_specific_copy_from_start:private_metrics.ProfileKeyedHistogramEvent)
  if (&from == this) return;
  Clear();
  MergeFrom(from);
}


void ProfileKeyedHistogramEvent::InternalSwap(ProfileKeyedHistogramEvent* PROTOBUF_RESTRICT PROTOBUF_NONNULL other) {
  using ::std::swap;
  _internal_metadata_.InternalSwap(&other->_internal_metadata_);
  swap(_impl_._has_bits_[0], other->_impl_._has_bits_[0]);
  _impl_.histogram_events_.InternalSwap(&other->_impl_.histogram_events_);
  swap(_impl_.profile_id_, other->_impl_.profile_id_);
}

// @@protoc_insertion_point(namespace_scope)
}  // namespace private_metrics
namespace google {
namespace protobuf {
}  // namespace protobuf
}  // namespace google
// @@protoc_insertion_point(global_scope)
#include "google/protobuf/port_undef.inc"
