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

#include "transportinstruction.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 TransportBuffers {

inline constexpr Instruction::Impl_::Impl_(
    [[maybe_unused]] ::google::protobuf::internal::InternalVisibility visibility,
    ::_pbi::ConstantInitialized) noexcept
      : _cached_size_{0},
        diff_(
            &::google::protobuf::internal::fixed_address_empty_string,
            ::_pbi::ConstantInitialized()),
        chaff_(
            &::google::protobuf::internal::fixed_address_empty_string,
            ::_pbi::ConstantInitialized()),
        old_num_{::uint64_t{0u}},
        new_num_{::uint64_t{0u}},
        ack_num_{::uint64_t{0u}},
        throwaway_num_{::uint64_t{0u}},
        protocol_version_{0u} {}

template <typename>
constexpr Instruction::Instruction(::_pbi::ConstantInitialized)
#if defined(PROTOBUF_CUSTOM_VTABLE)
    : ::google::protobuf::MessageLite(Instruction_class_data_.base()),
#else   // PROTOBUF_CUSTOM_VTABLE
    : ::google::protobuf::MessageLite(),
#endif  // PROTOBUF_CUSTOM_VTABLE
      _impl_(internal_visibility(), ::_pbi::ConstantInitialized()) {
}
struct InstructionDefaultTypeInternal {
  constexpr InstructionDefaultTypeInternal() : _instance(::_pbi::ConstantInitialized{}) {}
  ~InstructionDefaultTypeInternal() {}
  union {
    Instruction _instance;
  };
};

PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT
    PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 InstructionDefaultTypeInternal _Instruction_default_instance_;
}  // namespace TransportBuffers
namespace TransportBuffers {
// ===================================================================

class Instruction::_Internal {
 public:
  using HasBits =
      decltype(::std::declval<Instruction>()._impl_._has_bits_);
  static constexpr ::int32_t kHasBitsOffset =
      8 * PROTOBUF_FIELD_OFFSET(Instruction, _impl_._has_bits_);
};

Instruction::Instruction(::google::protobuf::Arena* PROTOBUF_NULLABLE arena)
#if defined(PROTOBUF_CUSTOM_VTABLE)
    : ::google::protobuf::MessageLite(arena, Instruction_class_data_.base()) {
#else   // PROTOBUF_CUSTOM_VTABLE
    : ::google::protobuf::MessageLite(arena) {
#endif  // PROTOBUF_CUSTOM_VTABLE
  SharedCtor(arena);
  // @@protoc_insertion_point(arena_constructor:TransportBuffers.Instruction)
}
PROTOBUF_NDEBUG_INLINE Instruction::Impl_::Impl_(
    [[maybe_unused]] ::google::protobuf::internal::InternalVisibility visibility,
    [[maybe_unused]] ::google::protobuf::Arena* PROTOBUF_NULLABLE arena, const Impl_& from,
    [[maybe_unused]] const ::TransportBuffers::Instruction& from_msg)
      : _has_bits_{from._has_bits_},
        _cached_size_{0},
        diff_(arena, from.diff_),
        chaff_(arena, from.chaff_) {}

Instruction::Instruction(
    ::google::protobuf::Arena* PROTOBUF_NULLABLE arena,
    const Instruction& from)
#if defined(PROTOBUF_CUSTOM_VTABLE)
    : ::google::protobuf::MessageLite(arena, Instruction_class_data_.base()) {
#else   // PROTOBUF_CUSTOM_VTABLE
    : ::google::protobuf::MessageLite(arena) {
#endif  // PROTOBUF_CUSTOM_VTABLE
  Instruction* const _this = this;
  (void)_this;
  _internal_metadata_.MergeFrom<::std::string>(
      from._internal_metadata_);
  new (&_impl_) Impl_(internal_visibility(), arena, from._impl_, from);
  ::memcpy(reinterpret_cast<char*>(&_impl_) +
               offsetof(Impl_, old_num_),
           reinterpret_cast<const char*>(&from._impl_) +
               offsetof(Impl_, old_num_),
           offsetof(Impl_, protocol_version_) -
               offsetof(Impl_, old_num_) +
               sizeof(Impl_::protocol_version_));

  // @@protoc_insertion_point(copy_constructor:TransportBuffers.Instruction)
}
PROTOBUF_NDEBUG_INLINE Instruction::Impl_::Impl_(
    [[maybe_unused]] ::google::protobuf::internal::InternalVisibility visibility,
    [[maybe_unused]] ::google::protobuf::Arena* PROTOBUF_NULLABLE arena)
      : _cached_size_{0},
        diff_(arena),
        chaff_(arena) {}

inline void Instruction::SharedCtor(::_pb::Arena* PROTOBUF_NULLABLE arena) {
  new (&_impl_) Impl_(internal_visibility(), arena);
  ::memset(reinterpret_cast<char*>(&_impl_) +
               offsetof(Impl_, old_num_),
           0,
           offsetof(Impl_, protocol_version_) -
               offsetof(Impl_, old_num_) +
               sizeof(Impl_::protocol_version_));
}
Instruction::~Instruction() {
  // @@protoc_insertion_point(destructor:TransportBuffers.Instruction)
  SharedDtor(*this);
}
inline void Instruction::SharedDtor(MessageLite& self) {
  Instruction& this_ = static_cast<Instruction&>(self);
  if constexpr (::_pbi::DebugHardenCheckHasBitConsistency()) {
    this_.CheckHasBitConsistency();
  }
  this_._internal_metadata_.Delete<::std::string>();
  ABSL_DCHECK(this_.GetArena() == nullptr);
  this_._impl_.diff_.Destroy();
  this_._impl_.chaff_.Destroy();
  this_._impl_.~Impl_();
}

inline void* PROTOBUF_NONNULL Instruction::PlacementNew_(
    const void* PROTOBUF_NONNULL, void* PROTOBUF_NONNULL mem,
    ::google::protobuf::Arena* PROTOBUF_NULLABLE arena) {
  return ::new (mem) Instruction(arena);
}
constexpr auto Instruction::InternalNewImpl_() {
  return ::google::protobuf::internal::MessageCreator::CopyInit(sizeof(Instruction),
                                            alignof(Instruction));
}
constexpr auto Instruction::InternalGenerateClassData_() {
  return ::google::protobuf::internal::ClassDataLite<29>{
      {
          &_Instruction_default_instance_._instance,
          &_table_.header,
          nullptr,  // IsInitialized
          &Instruction::MergeImpl,
          ::google::protobuf::MessageLite::GetNewImpl<Instruction>(),
#if defined(PROTOBUF_CUSTOM_VTABLE)
          &Instruction::SharedDtor,
          ::google::protobuf::MessageLite::GetClearImpl<Instruction>(), &Instruction::ByteSizeLong,
              &Instruction::_InternalSerialize,
#endif  // PROTOBUF_CUSTOM_VTABLE
          PROTOBUF_FIELD_OFFSET(Instruction, _impl_._cached_size_),
          true,
      },
      "TransportBuffers.Instruction",
  };
}

PROTOBUF_CONSTINIT
PROTOBUF_ATTRIBUTE_INIT_PRIORITY1
const ::google::protobuf::internal::ClassDataLite<29> Instruction_class_data_ =
    Instruction::InternalGenerateClassData_();

PROTOBUF_ATTRIBUTE_WEAK const ::google::protobuf::internal::ClassData* PROTOBUF_NONNULL
Instruction::GetClassData() const {
  return Instruction_class_data_.base();
}
PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1
const ::_pbi::TcParseTable<3, 7, 0, 0, 2>
Instruction::_table_ = {
  {
    PROTOBUF_FIELD_OFFSET(Instruction, _impl_._has_bits_),
    0, // no _extensions_
    7, 56,  // max_field_number, fast_idx_mask
    offsetof(decltype(_table_), field_lookup_table),
    4294967168,  // skipmap
    offsetof(decltype(_table_), field_entries),
    7,  // num_field_entries
    0,  // num_aux_entries
    offsetof(decltype(_table_), field_names),  // no aux_entries
    Instruction_class_data_.base(),
    nullptr,  // post_loop_handler
    ::_pbi::TcParser::GenericFallbackLite,  // fallback
    #ifdef PROTOBUF_PREFETCH_PARSE_TABLE
    ::_pbi::TcParser::GetTable<::TransportBuffers::Instruction>(),  // to_prefetch
    #endif  // PROTOBUF_PREFETCH_PARSE_TABLE
  }, {{
    {::_pbi::TcParser::MiniParse, {}},
    // optional uint32 protocol_version = 1;
    {::_pbi::TcParser::FastV32S1,
     {8, 6, 0,
      PROTOBUF_FIELD_OFFSET(Instruction, _impl_.protocol_version_)}},
    // optional uint64 old_num = 2;
    {::_pbi::TcParser::FastV64S1,
     {16, 2, 0,
      PROTOBUF_FIELD_OFFSET(Instruction, _impl_.old_num_)}},
    // optional uint64 new_num = 3;
    {::_pbi::TcParser::FastV64S1,
     {24, 3, 0,
      PROTOBUF_FIELD_OFFSET(Instruction, _impl_.new_num_)}},
    // optional uint64 ack_num = 4;
    {::_pbi::TcParser::FastV64S1,
     {32, 4, 0,
      PROTOBUF_FIELD_OFFSET(Instruction, _impl_.ack_num_)}},
    // optional uint64 throwaway_num = 5;
    {::_pbi::TcParser::FastV64S1,
     {40, 5, 0,
      PROTOBUF_FIELD_OFFSET(Instruction, _impl_.throwaway_num_)}},
    // optional bytes diff = 6;
    {::_pbi::TcParser::FastBS1,
     {50, 0, 0,
      PROTOBUF_FIELD_OFFSET(Instruction, _impl_.diff_)}},
    // optional bytes chaff = 7;
    {::_pbi::TcParser::FastBS1,
     {58, 1, 0,
      PROTOBUF_FIELD_OFFSET(Instruction, _impl_.chaff_)}},
  }}, {{
    65535, 65535
  }}, {{
    // optional uint32 protocol_version = 1;
    {PROTOBUF_FIELD_OFFSET(Instruction, _impl_.protocol_version_), _Internal::kHasBitsOffset + 6, 0, (0 | ::_fl::kFcOptional | ::_fl::kUInt32)},
    // optional uint64 old_num = 2;
    {PROTOBUF_FIELD_OFFSET(Instruction, _impl_.old_num_), _Internal::kHasBitsOffset + 2, 0, (0 | ::_fl::kFcOptional | ::_fl::kUInt64)},
    // optional uint64 new_num = 3;
    {PROTOBUF_FIELD_OFFSET(Instruction, _impl_.new_num_), _Internal::kHasBitsOffset + 3, 0, (0 | ::_fl::kFcOptional | ::_fl::kUInt64)},
    // optional uint64 ack_num = 4;
    {PROTOBUF_FIELD_OFFSET(Instruction, _impl_.ack_num_), _Internal::kHasBitsOffset + 4, 0, (0 | ::_fl::kFcOptional | ::_fl::kUInt64)},
    // optional uint64 throwaway_num = 5;
    {PROTOBUF_FIELD_OFFSET(Instruction, _impl_.throwaway_num_), _Internal::kHasBitsOffset + 5, 0, (0 | ::_fl::kFcOptional | ::_fl::kUInt64)},
    // optional bytes diff = 6;
    {PROTOBUF_FIELD_OFFSET(Instruction, _impl_.diff_), _Internal::kHasBitsOffset + 0, 0, (0 | ::_fl::kFcOptional | ::_fl::kBytes | ::_fl::kRepAString)},
    // optional bytes chaff = 7;
    {PROTOBUF_FIELD_OFFSET(Instruction, _impl_.chaff_), _Internal::kHasBitsOffset + 1, 0, (0 | ::_fl::kFcOptional | ::_fl::kBytes | ::_fl::kRepAString)},
  }},
  // no aux_entries
  {{
  }},
};
PROTOBUF_NOINLINE void Instruction::Clear() {
// @@protoc_insertion_point(message_clear_start:TransportBuffers.Instruction)
  ::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, 0x00000003U)) {
    if (CheckHasBit(cached_has_bits, 0x00000001U)) {
      _impl_.diff_.ClearNonDefaultToEmpty();
    }
    if (CheckHasBit(cached_has_bits, 0x00000002U)) {
      _impl_.chaff_.ClearNonDefaultToEmpty();
    }
  }
  if (BatchCheckHasBit(cached_has_bits, 0x0000007cU)) {
    ::memset(&_impl_.old_num_, 0, static_cast<::size_t>(
        reinterpret_cast<char*>(&_impl_.protocol_version_) -
        reinterpret_cast<char*>(&_impl_.old_num_)) + sizeof(_impl_.protocol_version_));
  }
  _impl_._has_bits_.Clear();
  _internal_metadata_.Clear<::std::string>();
}

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

  cached_has_bits = this_._impl_._has_bits_[0];
  // optional uint32 protocol_version = 1;
  if (CheckHasBit(cached_has_bits, 0x00000040U)) {
    target = stream->EnsureSpace(target);
    target = ::_pbi::WireFormatLite::WriteUInt32ToArray(
        1, this_._internal_protocol_version(), target);
  }

  // optional uint64 old_num = 2;
  if (CheckHasBit(cached_has_bits, 0x00000004U)) {
    target = stream->EnsureSpace(target);
    target = ::_pbi::WireFormatLite::WriteUInt64ToArray(
        2, this_._internal_old_num(), target);
  }

  // optional uint64 new_num = 3;
  if (CheckHasBit(cached_has_bits, 0x00000008U)) {
    target = stream->EnsureSpace(target);
    target = ::_pbi::WireFormatLite::WriteUInt64ToArray(
        3, this_._internal_new_num(), target);
  }

  // optional uint64 ack_num = 4;
  if (CheckHasBit(cached_has_bits, 0x00000010U)) {
    target = stream->EnsureSpace(target);
    target = ::_pbi::WireFormatLite::WriteUInt64ToArray(
        4, this_._internal_ack_num(), target);
  }

  // optional uint64 throwaway_num = 5;
  if (CheckHasBit(cached_has_bits, 0x00000020U)) {
    target = stream->EnsureSpace(target);
    target = ::_pbi::WireFormatLite::WriteUInt64ToArray(
        5, this_._internal_throwaway_num(), target);
  }

  // optional bytes diff = 6;
  if (CheckHasBit(cached_has_bits, 0x00000001U)) {
    const ::std::string& _s = this_._internal_diff();
    target = stream->WriteBytesMaybeAliased(6, _s, target);
  }

  // optional bytes chaff = 7;
  if (CheckHasBit(cached_has_bits, 0x00000002U)) {
    const ::std::string& _s = this_._internal_chaff();
    target = stream->WriteBytesMaybeAliased(7, _s, 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:TransportBuffers.Instruction)
  return target;
}

#if defined(PROTOBUF_CUSTOM_VTABLE)
::size_t Instruction::ByteSizeLong(const MessageLite& base) {
  const Instruction& this_ = static_cast<const Instruction&>(base);
#else   // PROTOBUF_CUSTOM_VTABLE
::size_t Instruction::ByteSizeLong() const {
  const Instruction& this_ = *this;
#endif  // PROTOBUF_CUSTOM_VTABLE
  // @@protoc_insertion_point(message_byte_size_start:TransportBuffers.Instruction)
  ::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)) {
    // optional bytes diff = 6;
    if (CheckHasBit(cached_has_bits, 0x00000001U)) {
      total_size += 1 + ::google::protobuf::internal::WireFormatLite::BytesSize(
                                      this_._internal_diff());
    }
    // optional bytes chaff = 7;
    if (CheckHasBit(cached_has_bits, 0x00000002U)) {
      total_size += 1 + ::google::protobuf::internal::WireFormatLite::BytesSize(
                                      this_._internal_chaff());
    }
    // optional uint64 old_num = 2;
    if (CheckHasBit(cached_has_bits, 0x00000004U)) {
      total_size += ::_pbi::WireFormatLite::UInt64SizePlusOne(
          this_._internal_old_num());
    }
    // optional uint64 new_num = 3;
    if (CheckHasBit(cached_has_bits, 0x00000008U)) {
      total_size += ::_pbi::WireFormatLite::UInt64SizePlusOne(
          this_._internal_new_num());
    }
    // optional uint64 ack_num = 4;
    if (CheckHasBit(cached_has_bits, 0x00000010U)) {
      total_size += ::_pbi::WireFormatLite::UInt64SizePlusOne(
          this_._internal_ack_num());
    }
    // optional uint64 throwaway_num = 5;
    if (CheckHasBit(cached_has_bits, 0x00000020U)) {
      total_size += ::_pbi::WireFormatLite::UInt64SizePlusOne(
          this_._internal_throwaway_num());
    }
    // optional uint32 protocol_version = 1;
    if (CheckHasBit(cached_has_bits, 0x00000040U)) {
      total_size += ::_pbi::WireFormatLite::UInt32SizePlusOne(
          this_._internal_protocol_version());
    }
  }
  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 Instruction::MergeImpl(::google::protobuf::MessageLite& to_msg,
                            const ::google::protobuf::MessageLite& from_msg) {
   auto* const _this =
      static_cast<Instruction*>(&to_msg);
  auto& from = static_cast<const Instruction&>(from_msg);
  if constexpr (::_pbi::DebugHardenCheckHasBitConsistency()) {
    from.CheckHasBitConsistency();
  }
  // @@protoc_insertion_point(class_specific_merge_from_start:TransportBuffers.Instruction)
  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_set_diff(from._internal_diff());
    }
    if (CheckHasBit(cached_has_bits, 0x00000002U)) {
      _this->_internal_set_chaff(from._internal_chaff());
    }
    if (CheckHasBit(cached_has_bits, 0x00000004U)) {
      _this->_impl_.old_num_ = from._impl_.old_num_;
    }
    if (CheckHasBit(cached_has_bits, 0x00000008U)) {
      _this->_impl_.new_num_ = from._impl_.new_num_;
    }
    if (CheckHasBit(cached_has_bits, 0x00000010U)) {
      _this->_impl_.ack_num_ = from._impl_.ack_num_;
    }
    if (CheckHasBit(cached_has_bits, 0x00000020U)) {
      _this->_impl_.throwaway_num_ = from._impl_.throwaway_num_;
    }
    if (CheckHasBit(cached_has_bits, 0x00000040U)) {
      _this->_impl_.protocol_version_ = from._impl_.protocol_version_;
    }
  }
  _this->_impl_._has_bits_[0] |= cached_has_bits;
  _this->_internal_metadata_.MergeFrom<::std::string>(
      from._internal_metadata_);
}

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


void Instruction::InternalSwap(Instruction* PROTOBUF_RESTRICT PROTOBUF_NONNULL other) {
  using ::std::swap;
  auto* arena = GetArena();
  ABSL_DCHECK_EQ(arena, other->GetArena());
  _internal_metadata_.InternalSwap(&other->_internal_metadata_);
  swap(_impl_._has_bits_[0], other->_impl_._has_bits_[0]);
  ::_pbi::ArenaStringPtr::InternalSwap(&_impl_.diff_, &other->_impl_.diff_, arena);
  ::_pbi::ArenaStringPtr::InternalSwap(&_impl_.chaff_, &other->_impl_.chaff_, arena);
  ::google::protobuf::internal::memswap<
      PROTOBUF_FIELD_OFFSET(Instruction, _impl_.protocol_version_)
      + sizeof(Instruction::_impl_.protocol_version_)
      - PROTOBUF_FIELD_OFFSET(Instruction, _impl_.old_num_)>(
          reinterpret_cast<char*>(&_impl_.old_num_),
          reinterpret_cast<char*>(&other->_impl_.old_num_));
}

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