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

#include "rule_set.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 omnibox {
class RuleSet::_Internal {
 public:
  using HasBits = decltype(::std::declval<RuleSet>()._impl_._has_bits_);
  static constexpr ::int32_t kHasBitsOffset =
      8 * PROTOBUF_FIELD_OFFSET(RuleSet, _impl_._has_bits_);
};

constexpr RuleSet::ParseTableT_ RuleSet::InternalGenerateParseTable_(const ::_pbi::ClassData* class_data) {
  return ParseTableT_{
    {
      PROTOBUF_FIELD_OFFSET(RuleSet, _impl_._has_bits_),
      0, // no _extensions_
      7, 56,  // max_field_number, fast_idx_mask
      offsetof(ParseTableT_, field_lookup_table),
      4294967168,  // skipmap
      offsetof(ParseTableT_, field_entries),
      7,  // num_field_entries
      3,  // 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<::omnibox::RuleSet>(),  // to_prefetch
      #endif  // PROTOBUF_PREFETCH_PARSE_TABLE
    }, {{
      {::_pbi::TcParser::MiniParse, {}},
      // repeated .omnibox.ToolMode allowed_tools = 1;
      {::_pbi::TcParser::FastV32P1,
       {10, 0, 0,
        PROTOBUF_FIELD_OFFSET(RuleSet, _impl_.allowed_tools_)}},
      // repeated .omnibox.InputType allowed_input_types = 2;
      {::_pbi::TcParser::FastV32P1,
       {18, 1, 0,
        PROTOBUF_FIELD_OFFSET(RuleSet, _impl_.allowed_input_types_)}},
      // repeated .omnibox.ToolRule tool_rules = 3;
      {::_pbi::TcParser::FastMtR1,
       {26, 2, 0,
        PROTOBUF_FIELD_OFFSET(RuleSet, _impl_.tool_rules_)}},
      // repeated .omnibox.InputTypeRule input_type_rules = 4;
      {::_pbi::TcParser::FastMtR1,
       {34, 3, 1,
        PROTOBUF_FIELD_OFFSET(RuleSet, _impl_.input_type_rules_)}},
      // repeated .omnibox.ModelMode allowed_models = 5;
      {::_pbi::TcParser::FastV32P1,
       {42, 4, 0,
        PROTOBUF_FIELD_OFFSET(RuleSet, _impl_.allowed_models_)}},
      // repeated .omnibox.ModelRule model_rules = 6;
      {::_pbi::TcParser::FastMtR1,
       {50, 5, 2,
        PROTOBUF_FIELD_OFFSET(RuleSet, _impl_.model_rules_)}},
      // optional int32 max_total_inputs = 7;
      {::_pbi::TcParser::FastV32S1,
       {56, 6, 0,
        PROTOBUF_FIELD_OFFSET(RuleSet, _impl_.max_total_inputs_)}},
    }}, {{
      65535, 65535
    }}, {{
      // repeated .omnibox.ToolMode allowed_tools = 1;
      {PROTOBUF_FIELD_OFFSET(RuleSet, _impl_.allowed_tools_), _Internal::kHasBitsOffset + 0, 0, (0 | ::_fl::kFcRepeated | ::_fl::kPackedOpenEnum)},
      // repeated .omnibox.InputType allowed_input_types = 2;
      {PROTOBUF_FIELD_OFFSET(RuleSet, _impl_.allowed_input_types_), _Internal::kHasBitsOffset + 1, 0, (0 | ::_fl::kFcRepeated | ::_fl::kPackedOpenEnum)},
      // repeated .omnibox.ToolRule tool_rules = 3;
      {PROTOBUF_FIELD_OFFSET(RuleSet, _impl_.tool_rules_), _Internal::kHasBitsOffset + 2, 0, (0 | ::_fl::kFcRepeated | ::_fl::kMessage | ::_fl::kTvTable)},
      // repeated .omnibox.InputTypeRule input_type_rules = 4;
      {PROTOBUF_FIELD_OFFSET(RuleSet, _impl_.input_type_rules_), _Internal::kHasBitsOffset + 3, 1, (0 | ::_fl::kFcRepeated | ::_fl::kMessage | ::_fl::kTvTable)},
      // repeated .omnibox.ModelMode allowed_models = 5;
      {PROTOBUF_FIELD_OFFSET(RuleSet, _impl_.allowed_models_), _Internal::kHasBitsOffset + 4, 0, (0 | ::_fl::kFcRepeated | ::_fl::kPackedOpenEnum)},
      // repeated .omnibox.ModelRule model_rules = 6;
      {PROTOBUF_FIELD_OFFSET(RuleSet, _impl_.model_rules_), _Internal::kHasBitsOffset + 5, 2, (0 | ::_fl::kFcRepeated | ::_fl::kMessage | ::_fl::kTvTable)},
      // optional int32 max_total_inputs = 7;
      {PROTOBUF_FIELD_OFFSET(RuleSet, _impl_.max_total_inputs_), _Internal::kHasBitsOffset + 6, 0, (0 | ::_fl::kFcOptional | ::_fl::kInt32)},
    }},
    {{
        #ifndef PROTOBUF_MESSAGE_GLOBALS
        {::_pbi::TcParser::GetTable<::omnibox::ToolRule>()},
        #else
        {::_pbi::FieldAuxMessageGlobals(), &::omnibox::ToolRule_globals_},
        #endif
        #ifndef PROTOBUF_MESSAGE_GLOBALS
        {::_pbi::TcParser::GetTable<::omnibox::InputTypeRule>()},
        #else
        {::_pbi::FieldAuxMessageGlobals(), &::omnibox::InputTypeRule_globals_},
        #endif
        #ifndef PROTOBUF_MESSAGE_GLOBALS
        {::_pbi::TcParser::GetTable<::omnibox::ModelRule>()},
        #else
        {::_pbi::FieldAuxMessageGlobals(), &::omnibox::ModelRule_globals_},
        #endif
    }},
    {{
    }},
  };
}


inline constexpr RuleSet::Impl_::Impl_(
    [[maybe_unused]] ::google::protobuf::internal::InternalVisibility visibility,
    ::_pbi::ConstantInitialized) noexcept
      : _cached_size_{0},
        allowed_tools_ { visibility, ::_pbi::InternalMetadataOffset::Build<
            ::omnibox::RuleSet,
            PROTOBUF_FIELD_OFFSET(::omnibox::RuleSet, _impl_.allowed_tools_)>()
         }
        ,
        _allowed_tools_cached_byte_size_{0},
        allowed_input_types_ { visibility, ::_pbi::InternalMetadataOffset::Build<
            ::omnibox::RuleSet,
            PROTOBUF_FIELD_OFFSET(::omnibox::RuleSet, _impl_.allowed_input_types_)>()
         }
        ,
        _allowed_input_types_cached_byte_size_{0},
        tool_rules_ { visibility, ::_pbi::InternalMetadataOffset::Build<
            ::omnibox::RuleSet,
            PROTOBUF_FIELD_OFFSET(::omnibox::RuleSet, _impl_.tool_rules_)>()
         }
        ,
        input_type_rules_ { visibility, ::_pbi::InternalMetadataOffset::Build<
            ::omnibox::RuleSet,
            PROTOBUF_FIELD_OFFSET(::omnibox::RuleSet, _impl_.input_type_rules_)>()
         }
        ,
        allowed_models_ { visibility, ::_pbi::InternalMetadataOffset::Build<
            ::omnibox::RuleSet,
            PROTOBUF_FIELD_OFFSET(::omnibox::RuleSet, _impl_.allowed_models_)>()
         }
        ,
        _allowed_models_cached_byte_size_{0},
        model_rules_ { visibility, ::_pbi::InternalMetadataOffset::Build<
            ::omnibox::RuleSet,
            PROTOBUF_FIELD_OFFSET(::omnibox::RuleSet, _impl_.model_rules_)>()
         }
        ,
        max_total_inputs_{0} {}

template <typename>
constexpr RuleSet::RuleSet(::_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 RuleSet::PlacementNew_(
    const void* PROTOBUF_NONNULL, void* PROTOBUF_NONNULL mem,
    ::google::protobuf::Arena* PROTOBUF_NULLABLE arena) {
  return ::new (mem) RuleSet(arena);
}
constexpr auto RuleSet::InternalNewImpl_() {
  return ::google::protobuf::internal::MessageCreator::CopyInit(sizeof(RuleSet), alignof(RuleSet));
}
constexpr auto RuleSet::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
          &RuleSet::MergeImpl,
          ::google::protobuf::MessageLite::GetNewImpl<RuleSet>(),
#if defined(PROTOBUF_CUSTOM_VTABLE)
          &RuleSet::SharedDtor,
          ::google::protobuf::MessageLite::GetClearImpl<RuleSet>(), &RuleSet::ByteSizeLong,
              &RuleSet::_InternalSerialize,
#endif  // PROTOBUF_CUSTOM_VTABLE
          PROTOBUF_FIELD_OFFSET(RuleSet, _impl_._cached_size_),
          true,
      },
      "omnibox.RuleSet",
  };
}
struct RuleSetGlobalsTypeInternal : ::_pbi::MessageGlobalsBase {
  constexpr RuleSetGlobalsTypeInternal()
      :
#ifndef PROTOBUF_MESSAGE_GLOBALS
        _default(::_pbi::ConstantInitialized{},
                 RuleSet_class_data_.base())
#else   // !PROTOBUF_MESSAGE_GLOBALS
        MessageGlobalsBase(RuleSet::InternalGenerateClassData_(
            _default, &RuleSet_globals_._table.header)),
        _default(::_pbi::ConstantInitialized{}, GetClassData()),
        _table(::_pbi::PrivateAccess::GenerateParseTable<RuleSet>(
            GetClassData()))
#endif  // PROTOBUF_MESSAGE_GLOBALS
  {
  }
  ~RuleSetGlobalsTypeInternal() {}
  union {
    alignas(::_pbi::kMaxMessageAlignment) RuleSet _default;
  };
#ifdef PROTOBUF_MESSAGE_GLOBALS
  decltype(::_pbi::PrivateAccess::GenerateParseTable<RuleSet>(
      ::std::declval<const ::_pbi::ClassData*>())) _table;
#endif
};
#ifdef PROTOBUF_MESSAGE_GLOBALS
static_assert(PROTOBUF_FIELD_OFFSET(RuleSetGlobalsTypeInternal, _default) ==
              ::_pbi::MessageGlobalsBase::OffsetToDefault());
#endif  // PROTOBUF_MESSAGE_GLOBALS

PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT
    PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 PROTOBUF_MESSAGE_GLOBALS_CONST RuleSetGlobalsTypeInternal RuleSet_globals_
        PROTOBUF_MESSAGE_GLOBALS_SECTION(.data.rel.ro);
#if defined(PROTOBUF_CUSTOM_VTABLE)
namespace {
const ::_pbi::ClassData* RuleSet_get_class_data() {
#ifdef PROTOBUF_MESSAGE_GLOBALS
  return RuleSet_globals_.GetClassData();
#else
  return RuleSet_class_data_.base();
#endif  // PROTOBUF_MESSAGE_GLOBALS
}
}  // namespace
#endif  // PROTOBUF_CUSTOM_VTABLE
}  // namespace omnibox
namespace omnibox {
// ===================================================================

void RuleSet::clear_tool_rules() {
  ::google::protobuf::internal::TSanWrite(&_impl_);
  _impl_.tool_rules_.Clear();
  ClearHasBit(_impl_._has_bits_[0], 0x00000004U);
}
void RuleSet::clear_input_type_rules() {
  ::google::protobuf::internal::TSanWrite(&_impl_);
  _impl_.input_type_rules_.Clear();
  ClearHasBit(_impl_._has_bits_[0], 0x00000008U);
}
void RuleSet::clear_model_rules() {
  ::google::protobuf::internal::TSanWrite(&_impl_);
  _impl_.model_rules_.Clear();
  ClearHasBit(_impl_._has_bits_[0], 0x00000020U);
}
RuleSet::RuleSet(::google::protobuf::Arena* PROTOBUF_NULLABLE arena)
#if defined(PROTOBUF_CUSTOM_VTABLE)
    : ::google::protobuf::MessageLite(arena, RuleSet_get_class_data()) {
#else   // PROTOBUF_CUSTOM_VTABLE
    : ::google::protobuf::MessageLite(arena) {
#endif  // PROTOBUF_CUSTOM_VTABLE
  SharedCtor(arena);
  // @@protoc_insertion_point(arena_constructor:omnibox.RuleSet)
}
PROTOBUF_NDEBUG_INLINE RuleSet::Impl_::Impl_(
    [[maybe_unused]] ::google::protobuf::internal::InternalVisibility visibility,
    [[maybe_unused]] ::google::protobuf::Arena* PROTOBUF_NULLABLE arena, const Impl_& from,
    [[maybe_unused]] const ::omnibox::RuleSet& from_msg)
      : _has_bits_{from._has_bits_},
        _cached_size_{0},
        allowed_tools_ {
          visibility, ::_pbi::InternalMetadataOffset::Build<
              ::omnibox::RuleSet,
              PROTOBUF_FIELD_OFFSET(::omnibox::RuleSet, _impl_.allowed_tools_)>()
          , from.allowed_tools_
        }
        ,
        _allowed_tools_cached_byte_size_{0},
        allowed_input_types_ {
          visibility, ::_pbi::InternalMetadataOffset::Build<
              ::omnibox::RuleSet,
              PROTOBUF_FIELD_OFFSET(::omnibox::RuleSet, _impl_.allowed_input_types_)>()
          , from.allowed_input_types_
        }
        ,
        _allowed_input_types_cached_byte_size_{0},
        tool_rules_ {
          visibility, ::_pbi::InternalMetadataOffset::Build<
              ::omnibox::RuleSet,
              PROTOBUF_FIELD_OFFSET(::omnibox::RuleSet, _impl_.tool_rules_)>()
          , from.tool_rules_
        }
        ,
        input_type_rules_ {
          visibility, ::_pbi::InternalMetadataOffset::Build<
              ::omnibox::RuleSet,
              PROTOBUF_FIELD_OFFSET(::omnibox::RuleSet, _impl_.input_type_rules_)>()
          , from.input_type_rules_
        }
        ,
        allowed_models_ {
          visibility, ::_pbi::InternalMetadataOffset::Build<
              ::omnibox::RuleSet,
              PROTOBUF_FIELD_OFFSET(::omnibox::RuleSet, _impl_.allowed_models_)>()
          , from.allowed_models_
        }
        ,
        _allowed_models_cached_byte_size_{0},
        model_rules_ {
          visibility, ::_pbi::InternalMetadataOffset::Build<
              ::omnibox::RuleSet,
              PROTOBUF_FIELD_OFFSET(::omnibox::RuleSet, _impl_.model_rules_)>()
          , from.model_rules_
        }
     {}

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

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

  // @@protoc_insertion_point(copy_constructor:omnibox.RuleSet)
}
PROTOBUF_NDEBUG_INLINE RuleSet::Impl_::Impl_(
    [[maybe_unused]] ::google::protobuf::internal::InternalVisibility visibility,
    [[maybe_unused]] ::google::protobuf::Arena* PROTOBUF_NULLABLE arena)
      : _cached_size_{0},
        allowed_tools_ { visibility, ::_pbi::InternalMetadataOffset::Build<
            ::omnibox::RuleSet,
            PROTOBUF_FIELD_OFFSET(::omnibox::RuleSet, _impl_.allowed_tools_)>()
         }
        ,
        _allowed_tools_cached_byte_size_{0},
        allowed_input_types_ { visibility, ::_pbi::InternalMetadataOffset::Build<
            ::omnibox::RuleSet,
            PROTOBUF_FIELD_OFFSET(::omnibox::RuleSet, _impl_.allowed_input_types_)>()
         }
        ,
        _allowed_input_types_cached_byte_size_{0},
        tool_rules_ { visibility, ::_pbi::InternalMetadataOffset::Build<
            ::omnibox::RuleSet,
            PROTOBUF_FIELD_OFFSET(::omnibox::RuleSet, _impl_.tool_rules_)>()
         }
        ,
        input_type_rules_ { visibility, ::_pbi::InternalMetadataOffset::Build<
            ::omnibox::RuleSet,
            PROTOBUF_FIELD_OFFSET(::omnibox::RuleSet, _impl_.input_type_rules_)>()
         }
        ,
        allowed_models_ { visibility, ::_pbi::InternalMetadataOffset::Build<
            ::omnibox::RuleSet,
            PROTOBUF_FIELD_OFFSET(::omnibox::RuleSet, _impl_.allowed_models_)>()
         }
        ,
        _allowed_models_cached_byte_size_{0},
        model_rules_ { visibility, ::_pbi::InternalMetadataOffset::Build<
            ::omnibox::RuleSet,
            PROTOBUF_FIELD_OFFSET(::omnibox::RuleSet, _impl_.model_rules_)>()
         }
     {}

inline void RuleSet::SharedCtor(::_pb::Arena* PROTOBUF_NULLABLE arena) {
  new (&_impl_) Impl_(internal_visibility(), arena);
  _impl_.max_total_inputs_ = {};
}
RuleSet::~RuleSet() {
  // @@protoc_insertion_point(destructor:omnibox.RuleSet)
  SharedDtor(*this);
}
inline void RuleSet::SharedDtor(MessageLite& self) {
  RuleSet& this_ = static_cast<RuleSet&>(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 RuleSet_class_data_ =
    RuleSet::InternalGenerateClassData_(RuleSet_globals_._default);

PROTOBUF_ATTRIBUTE_WEAK const ::google::protobuf::internal::ClassData* PROTOBUF_NONNULL
RuleSet::GetClassData() const {
  return RuleSet_class_data_.base();
}
#else
PROTOBUF_ATTRIBUTE_WEAK const ::google::protobuf::internal::ClassData* PROTOBUF_NONNULL
RuleSet::GetClassData() const {
  return RuleSet_globals_.GetClassData();
}
#endif  // !PROTOBUF_MESSAGE_GLOBALS
#ifndef PROTOBUF_MESSAGE_GLOBALS
PROTOBUF_CONSTINIT
PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 const RuleSet::ParseTableT_
    RuleSet::_table_ =
        RuleSet::InternalGenerateParseTable_(RuleSet_class_data_.base());
#endif  // !PROTOBUF_MESSAGE_GLOBALS
PROTOBUF_NOINLINE void RuleSet::Clear() {
// @@protoc_insertion_point(message_clear_start:omnibox.RuleSet)
  ::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 (BatchCheckHasBit(cached_has_bits, 0x0000003fU)) {
    if (CheckHasBit(cached_has_bits, 0x00000001U)) {
      _impl_.allowed_tools_.Clear();
    }
    if (CheckHasBit(cached_has_bits, 0x00000002U)) {
      _impl_.allowed_input_types_.Clear();
    }
    if (CheckHasBit(cached_has_bits, 0x00000004U)) {
      _impl_.tool_rules_.Clear();
    }
    if (CheckHasBit(cached_has_bits, 0x00000008U)) {
      _impl_.input_type_rules_.Clear();
    }
    if (CheckHasBit(cached_has_bits, 0x00000010U)) {
      _impl_.allowed_models_.Clear();
    }
    if (CheckHasBit(cached_has_bits, 0x00000020U)) {
      _impl_.model_rules_.Clear();
    }
  }
  _impl_.max_total_inputs_ = 0;
  _impl_._has_bits_.Clear();
  _internal_metadata_.Clear<::std::string>();
}

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

  cached_has_bits = this_._impl_._has_bits_[0];
  // repeated .omnibox.ToolMode allowed_tools = 1;
  if (CheckHasBit(cached_has_bits, 0x00000001U)) {
    {
      ::size_t byte_size = this_._impl_._allowed_tools_cached_byte_size_.Get();
      if (byte_size > 0) {
        target = stream->WriteEnumPacked(
            1, this_._internal_allowed_tools(), byte_size, target);
      }
    }
  }

  // repeated .omnibox.InputType allowed_input_types = 2;
  if (CheckHasBit(cached_has_bits, 0x00000002U)) {
    {
      ::size_t byte_size = this_._impl_._allowed_input_types_cached_byte_size_.Get();
      if (byte_size > 0) {
        target = stream->WriteEnumPacked(
            2, this_._internal_allowed_input_types(), byte_size, target);
      }
    }
  }

  // repeated .omnibox.ToolRule tool_rules = 3;
  if (CheckHasBit(cached_has_bits, 0x00000004U)) {
    for (unsigned i = 0, n = static_cast<unsigned>(
                             this_._internal_tool_rules_size());
         i < n; i++) {
      const auto& repfield = this_._internal_tool_rules().Get(i);
      target =
          ::google::protobuf::internal::WireFormatLite::InternalWriteMessage(
              3, repfield, repfield.GetCachedSize(),
              target, stream);
    }
  }

  // repeated .omnibox.InputTypeRule input_type_rules = 4;
  if (CheckHasBit(cached_has_bits, 0x00000008U)) {
    for (unsigned i = 0, n = static_cast<unsigned>(
                             this_._internal_input_type_rules_size());
         i < n; i++) {
      const auto& repfield = this_._internal_input_type_rules().Get(i);
      target =
          ::google::protobuf::internal::WireFormatLite::InternalWriteMessage(
              4, repfield, repfield.GetCachedSize(),
              target, stream);
    }
  }

  // repeated .omnibox.ModelMode allowed_models = 5;
  if (CheckHasBit(cached_has_bits, 0x00000010U)) {
    {
      ::size_t byte_size = this_._impl_._allowed_models_cached_byte_size_.Get();
      if (byte_size > 0) {
        target = stream->WriteEnumPacked(
            5, this_._internal_allowed_models(), byte_size, target);
      }
    }
  }

  // repeated .omnibox.ModelRule model_rules = 6;
  if (CheckHasBit(cached_has_bits, 0x00000020U)) {
    for (unsigned i = 0, n = static_cast<unsigned>(
                             this_._internal_model_rules_size());
         i < n; i++) {
      const auto& repfield = this_._internal_model_rules().Get(i);
      target =
          ::google::protobuf::internal::WireFormatLite::InternalWriteMessage(
              6, repfield, repfield.GetCachedSize(),
              target, stream);
    }
  }

  // optional int32 max_total_inputs = 7;
  if (CheckHasBit(cached_has_bits, 0x00000040U)) {
    target =
        ::google::protobuf::internal::WireFormatLite::WriteInt32ToArrayWithField<7>(
            stream, this_._internal_max_total_inputs(), target);
  }

  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:omnibox.RuleSet)
  return target;
}

#if defined(PROTOBUF_CUSTOM_VTABLE)
::size_t RuleSet::ByteSizeLong(const MessageLite& base) {
  const RuleSet& this_ = static_cast<const RuleSet&>(base);
#else   // PROTOBUF_CUSTOM_VTABLE
::size_t RuleSet::ByteSizeLong() const {
  const RuleSet& this_ = *this;
#endif  // PROTOBUF_CUSTOM_VTABLE
  // @@protoc_insertion_point(message_byte_size_start:omnibox.RuleSet)
  ::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];
  if (BatchCheckHasBit(cached_has_bits, 0x0000007fU)) {
    // repeated .omnibox.ToolMode allowed_tools = 1;
    if (CheckHasBit(cached_has_bits, 0x00000001U)) {
      total_size += ::_pbi::WireFormatLite::EnumSizeWithPackedTagSize(
          this_._internal_allowed_tools(), 1, this_._impl_._allowed_tools_cached_byte_size_);
    }
    // repeated .omnibox.InputType allowed_input_types = 2;
    if (CheckHasBit(cached_has_bits, 0x00000002U)) {
      total_size += ::_pbi::WireFormatLite::EnumSizeWithPackedTagSize(
          this_._internal_allowed_input_types(), 1, this_._impl_._allowed_input_types_cached_byte_size_);
    }
    // repeated .omnibox.ToolRule tool_rules = 3;
    if (CheckHasBit(cached_has_bits, 0x00000004U)) {
      total_size += 1UL * this_._internal_tool_rules_size();
      for (const auto& msg : this_._internal_tool_rules()) {
        total_size += ::google::protobuf::internal::WireFormatLite::MessageSize(msg);
      }
    }
    // repeated .omnibox.InputTypeRule input_type_rules = 4;
    if (CheckHasBit(cached_has_bits, 0x00000008U)) {
      total_size += 1UL * this_._internal_input_type_rules_size();
      for (const auto& msg : this_._internal_input_type_rules()) {
        total_size += ::google::protobuf::internal::WireFormatLite::MessageSize(msg);
      }
    }
    // repeated .omnibox.ModelMode allowed_models = 5;
    if (CheckHasBit(cached_has_bits, 0x00000010U)) {
      total_size += ::_pbi::WireFormatLite::EnumSizeWithPackedTagSize(
          this_._internal_allowed_models(), 1, this_._impl_._allowed_models_cached_byte_size_);
    }
    // repeated .omnibox.ModelRule model_rules = 6;
    if (CheckHasBit(cached_has_bits, 0x00000020U)) {
      total_size += 1UL * this_._internal_model_rules_size();
      for (const auto& msg : this_._internal_model_rules()) {
        total_size += ::google::protobuf::internal::WireFormatLite::MessageSize(msg);
      }
    }
    // optional int32 max_total_inputs = 7;
    if (CheckHasBit(cached_has_bits, 0x00000040U)) {
      total_size += ::_pbi::WireFormatLite::Int32SizePlusOne(
          this_._internal_max_total_inputs());
    }
  }
  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 RuleSet::MergeImpl(::google::protobuf::MessageLite& to_msg,
                      const ::google::protobuf::MessageLite& from_msg) {
   auto* const _this = static_cast<RuleSet*>(&to_msg);
  auto& from = static_cast<const RuleSet&>(from_msg);
  if constexpr (::_pbi::DebugHardenCheckHasBitConsistency()) {
    from.CheckHasBitConsistency();
  }
  ::google::protobuf::Arena* arena = _this->GetArena();
  // @@protoc_insertion_point(class_specific_merge_from_start:omnibox.RuleSet)
  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, 0x0000007fU)) {
    if (CheckHasBit(cached_has_bits, 0x00000001U)) {
      _this->_internal_mutable_allowed_tools()->MergeFrom(from._internal_allowed_tools());
    }
    if (CheckHasBit(cached_has_bits, 0x00000002U)) {
      _this->_internal_mutable_allowed_input_types()->MergeFrom(from._internal_allowed_input_types());
    }
    if (CheckHasBit(cached_has_bits, 0x00000004U)) {
      _this->_internal_mutable_tool_rules()->InternalMergeFromWithArena(
          ::google::protobuf::MessageLite::internal_visibility(), arena,
          from._internal_tool_rules());
    }
    if (CheckHasBit(cached_has_bits, 0x00000008U)) {
      _this->_internal_mutable_input_type_rules()->InternalMergeFromWithArena(
          ::google::protobuf::MessageLite::internal_visibility(), arena,
          from._internal_input_type_rules());
    }
    if (CheckHasBit(cached_has_bits, 0x00000010U)) {
      _this->_internal_mutable_allowed_models()->MergeFrom(from._internal_allowed_models());
    }
    if (CheckHasBit(cached_has_bits, 0x00000020U)) {
      _this->_internal_mutable_model_rules()->InternalMergeFromWithArena(
          ::google::protobuf::MessageLite::internal_visibility(), arena,
          from._internal_model_rules());
    }
    if (CheckHasBit(cached_has_bits, 0x00000040U)) {
      _this->_impl_.max_total_inputs_ = from._impl_.max_total_inputs_;
    }
  }
  _this->_impl_._has_bits_[0] |= cached_has_bits;
  _this->_internal_metadata_.MergeFrom<::std::string>(
      from._internal_metadata_);
}

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


void RuleSet::InternalSwap(RuleSet* 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_.allowed_tools_.InternalSwap(&other->_impl_.allowed_tools_);
  _impl_.allowed_input_types_.InternalSwap(&other->_impl_.allowed_input_types_);
  _impl_.tool_rules_.InternalSwap(&other->_impl_.tool_rules_);
  _impl_.input_type_rules_.InternalSwap(&other->_impl_.input_type_rules_);
  _impl_.allowed_models_.InternalSwap(&other->_impl_.allowed_models_);
  _impl_.model_rules_.InternalSwap(&other->_impl_.model_rules_);
  swap(_impl_.max_total_inputs_, other->_impl_.max_total_inputs_);
}

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