// Generated by the protocol buffer compiler.  DO NOT EDIT!
// source: userinput.proto

#include "userinput.pb.h"

#include <algorithm>

#include <google/protobuf/io/coded_stream.h>
#include <google/protobuf/extension_set.h>
#include <google/protobuf/wire_format_lite.h>
#include <google/protobuf/io/zero_copy_stream_impl_lite.h>
// @@protoc_insertion_point(includes)
#include <google/protobuf/port_def.inc>

PROTOBUF_PRAGMA_INIT_SEG

namespace _pb = ::PROTOBUF_NAMESPACE_ID;
namespace _pbi = _pb::internal;

namespace ClientBuffers {
PROTOBUF_CONSTEXPR UserMessage::UserMessage(
    ::_pbi::ConstantInitialized): _impl_{
    /*decltype(_impl_.instruction_)*/{}
  , /*decltype(_impl_._cached_size_)*/{}} {}
struct UserMessageDefaultTypeInternal {
  PROTOBUF_CONSTEXPR UserMessageDefaultTypeInternal()
      : _instance(::_pbi::ConstantInitialized{}) {}
  ~UserMessageDefaultTypeInternal() {}
  union {
    UserMessage _instance;
  };
};
PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 UserMessageDefaultTypeInternal _UserMessage_default_instance_;
PROTOBUF_CONSTEXPR Instruction::Instruction(
    ::_pbi::ConstantInitialized): _impl_{
    /*decltype(_impl_._extensions_)*/{}
  , /*decltype(_impl_._cached_size_)*/{}} {}
struct InstructionDefaultTypeInternal {
  PROTOBUF_CONSTEXPR InstructionDefaultTypeInternal()
      : _instance(::_pbi::ConstantInitialized{}) {}
  ~InstructionDefaultTypeInternal() {}
  union {
    Instruction _instance;
  };
};
PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 InstructionDefaultTypeInternal _Instruction_default_instance_;
PROTOBUF_CONSTEXPR Keystroke::Keystroke(
    ::_pbi::ConstantInitialized): _impl_{
    /*decltype(_impl_._has_bits_)*/{}
  , /*decltype(_impl_._cached_size_)*/{}
  , /*decltype(_impl_.keys_)*/{&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}}} {}
struct KeystrokeDefaultTypeInternal {
  PROTOBUF_CONSTEXPR KeystrokeDefaultTypeInternal()
      : _instance(::_pbi::ConstantInitialized{}) {}
  ~KeystrokeDefaultTypeInternal() {}
  union {
    Keystroke _instance;
  };
};
PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 KeystrokeDefaultTypeInternal _Keystroke_default_instance_;
PROTOBUF_CONSTEXPR ResizeMessage::ResizeMessage(
    ::_pbi::ConstantInitialized): _impl_{
    /*decltype(_impl_._has_bits_)*/{}
  , /*decltype(_impl_._cached_size_)*/{}
  , /*decltype(_impl_.width_)*/0
  , /*decltype(_impl_.height_)*/0} {}
struct ResizeMessageDefaultTypeInternal {
  PROTOBUF_CONSTEXPR ResizeMessageDefaultTypeInternal()
      : _instance(::_pbi::ConstantInitialized{}) {}
  ~ResizeMessageDefaultTypeInternal() {}
  union {
    ResizeMessage _instance;
  };
};
PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 ResizeMessageDefaultTypeInternal _ResizeMessage_default_instance_;
}  // namespace ClientBuffers
namespace ClientBuffers {

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

class UserMessage::_Internal {
 public:
};

UserMessage::UserMessage(::PROTOBUF_NAMESPACE_ID::Arena* arena,
                         bool is_message_owned)
  : ::PROTOBUF_NAMESPACE_ID::MessageLite(arena, is_message_owned) {
  SharedCtor(arena, is_message_owned);
  // @@protoc_insertion_point(arena_constructor:ClientBuffers.UserMessage)
}
UserMessage::UserMessage(const UserMessage& from)
  : ::PROTOBUF_NAMESPACE_ID::MessageLite() {
  UserMessage* const _this = this; (void)_this;
  new (&_impl_) Impl_{
      decltype(_impl_.instruction_){from._impl_.instruction_}
    , /*decltype(_impl_._cached_size_)*/{}};

  _internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
  // @@protoc_insertion_point(copy_constructor:ClientBuffers.UserMessage)
}

inline void UserMessage::SharedCtor(
    ::_pb::Arena* arena, bool is_message_owned) {
  (void)arena;
  (void)is_message_owned;
  new (&_impl_) Impl_{
      decltype(_impl_.instruction_){arena}
    , /*decltype(_impl_._cached_size_)*/{}
  };
}

UserMessage::~UserMessage() {
  // @@protoc_insertion_point(destructor:ClientBuffers.UserMessage)
  if (auto *arena = _internal_metadata_.DeleteReturnArena<std::string>()) {
  (void)arena;
    return;
  }
  SharedDtor();
}

inline void UserMessage::SharedDtor() {
  GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
  _impl_.instruction_.~RepeatedPtrField();
}

void UserMessage::SetCachedSize(int size) const {
  _impl_._cached_size_.Set(size);
}

void UserMessage::Clear() {
// @@protoc_insertion_point(message_clear_start:ClientBuffers.UserMessage)
  uint32_t cached_has_bits = 0;
  // Prevent compiler warnings about cached_has_bits being unused
  (void) cached_has_bits;

  _impl_.instruction_.Clear();
  _internal_metadata_.Clear<std::string>();
}

const char* UserMessage::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) {
#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
  while (!ctx->Done(&ptr)) {
    uint32_t tag;
    ptr = ::_pbi::ReadTag(ptr, &tag);
    switch (tag >> 3) {
      // repeated .ClientBuffers.Instruction instruction = 1;
      case 1:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 10)) {
          ptr -= 1;
          do {
            ptr += 1;
            ptr = ctx->ParseMessage(_internal_add_instruction(), ptr);
            CHK_(ptr);
            if (!ctx->DataAvailable(ptr)) break;
          } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<10>(ptr));
        } else
          goto handle_unusual;
        continue;
      default:
        goto handle_unusual;
    }  // switch
  handle_unusual:
    if ((tag == 0) || ((tag & 7) == 4)) {
      CHK_(ptr);
      ctx->SetLastTag(tag);
      goto message_done;
    }
    ptr = UnknownFieldParse(
        tag,
        _internal_metadata_.mutable_unknown_fields<std::string>(),
        ptr, ctx);
    CHK_(ptr != nullptr);
  }  // while
message_done:
  return ptr;
failure:
  ptr = nullptr;
  goto message_done;
#undef CHK_
}

uint8_t* UserMessage::_InternalSerialize(
    uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
  // @@protoc_insertion_point(serialize_to_array_start:ClientBuffers.UserMessage)
  uint32_t cached_has_bits = 0;
  (void) cached_has_bits;

  // repeated .ClientBuffers.Instruction instruction = 1;
  for (unsigned i = 0,
      n = static_cast<unsigned>(this->_internal_instruction_size()); i < n; i++) {
    const auto& repfield = this->_internal_instruction(i);
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
        InternalWriteMessage(1, repfield, repfield.GetCachedSize(), target, stream);
  }

  if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
    target = stream->WriteRaw(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).data(),
        static_cast<int>(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size()), target);
  }
  // @@protoc_insertion_point(serialize_to_array_end:ClientBuffers.UserMessage)
  return target;
}

size_t UserMessage::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:ClientBuffers.UserMessage)
  size_t total_size = 0;

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

  // repeated .ClientBuffers.Instruction instruction = 1;
  total_size += 1UL * this->_internal_instruction_size();
  for (const auto& msg : this->_impl_.instruction_) {
    total_size +=
      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(msg);
  }

  if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
    total_size += _internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size();
  }
  int cached_size = ::_pbi::ToCachedSize(total_size);
  SetCachedSize(cached_size);
  return total_size;
}

void UserMessage::CheckTypeAndMergeFrom(
    const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) {
  MergeFrom(*::_pbi::DownCast<const UserMessage*>(
      &from));
}

void UserMessage::MergeFrom(const UserMessage& from) {
  UserMessage* const _this = this;
  // @@protoc_insertion_point(class_specific_merge_from_start:ClientBuffers.UserMessage)
  GOOGLE_DCHECK_NE(&from, _this);
  uint32_t cached_has_bits = 0;
  (void) cached_has_bits;

  _this->_impl_.instruction_.MergeFrom(from._impl_.instruction_);
  _this->_internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
}

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

bool UserMessage::IsInitialized() const {
  if (!::PROTOBUF_NAMESPACE_ID::internal::AllAreInitialized(_impl_.instruction_))
    return false;
  return true;
}

void UserMessage::InternalSwap(UserMessage* other) {
  using std::swap;
  _internal_metadata_.InternalSwap(&other->_internal_metadata_);
  _impl_.instruction_.InternalSwap(&other->_impl_.instruction_);
}

std::string UserMessage::GetTypeName() const {
  return "ClientBuffers.UserMessage";
}


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

class Instruction::_Internal {
 public:
};

Instruction::Instruction(::PROTOBUF_NAMESPACE_ID::Arena* arena,
                         bool is_message_owned)
  : ::PROTOBUF_NAMESPACE_ID::MessageLite(arena, is_message_owned) {
  SharedCtor(arena, is_message_owned);
  // @@protoc_insertion_point(arena_constructor:ClientBuffers.Instruction)
}
Instruction::Instruction(const Instruction& from)
  : ::PROTOBUF_NAMESPACE_ID::MessageLite() {
  Instruction* const _this = this; (void)_this;
  new (&_impl_) Impl_{
      /*decltype(_impl_._extensions_)*/{}
    , /*decltype(_impl_._cached_size_)*/{}};

  _internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
  _impl_._extensions_.MergeFrom(internal_default_instance(), from._impl_._extensions_);
  // @@protoc_insertion_point(copy_constructor:ClientBuffers.Instruction)
}

inline void Instruction::SharedCtor(
    ::_pb::Arena* arena, bool is_message_owned) {
  (void)arena;
  (void)is_message_owned;
  new (&_impl_) Impl_{
      /*decltype(_impl_._extensions_)*/{::_pbi::ArenaInitialized(), arena}
    , /*decltype(_impl_._cached_size_)*/{}
  };
}

Instruction::~Instruction() {
  // @@protoc_insertion_point(destructor:ClientBuffers.Instruction)
  if (auto *arena = _internal_metadata_.DeleteReturnArena<std::string>()) {
  (void)arena;
    return;
  }
  SharedDtor();
}

inline void Instruction::SharedDtor() {
  GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
  _impl_._extensions_.~ExtensionSet();
}

void Instruction::SetCachedSize(int size) const {
  _impl_._cached_size_.Set(size);
}

void Instruction::Clear() {
// @@protoc_insertion_point(message_clear_start:ClientBuffers.Instruction)
  uint32_t cached_has_bits = 0;
  // Prevent compiler warnings about cached_has_bits being unused
  (void) cached_has_bits;

  _impl_._extensions_.Clear();
  _internal_metadata_.Clear<std::string>();
}

const char* Instruction::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) {
#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
  while (!ctx->Done(&ptr)) {
    uint32_t tag;
    ptr = ::_pbi::ReadTag(ptr, &tag);
    if ((tag == 0) || ((tag & 7) == 4)) {
      CHK_(ptr);
      ctx->SetLastTag(tag);
      goto message_done;
    }
    if ((16u <= tag)) {
      ptr = _impl_._extensions_.ParseField(tag, ptr, internal_default_instance(), &_internal_metadata_, ctx);
      CHK_(ptr != nullptr);
      continue;
    }
    ptr = UnknownFieldParse(
        tag,
        _internal_metadata_.mutable_unknown_fields<std::string>(),
        ptr, ctx);
    CHK_(ptr != nullptr);
  }  // while
message_done:
  return ptr;
failure:
  ptr = nullptr;
  goto message_done;
#undef CHK_
}

uint8_t* Instruction::_InternalSerialize(
    uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
  // @@protoc_insertion_point(serialize_to_array_start:ClientBuffers.Instruction)
  uint32_t cached_has_bits = 0;
  (void) cached_has_bits;

  // Extension range [2, 536870912)
  target = _impl_._extensions_._InternalSerialize(
  internal_default_instance(), 2, 536870912, target, stream);

  if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
    target = stream->WriteRaw(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).data(),
        static_cast<int>(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size()), target);
  }
  // @@protoc_insertion_point(serialize_to_array_end:ClientBuffers.Instruction)
  return target;
}

size_t Instruction::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:ClientBuffers.Instruction)
  size_t total_size = 0;

  total_size += _impl_._extensions_.ByteSize();

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

  if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
    total_size += _internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size();
  }
  int cached_size = ::_pbi::ToCachedSize(total_size);
  SetCachedSize(cached_size);
  return total_size;
}

void Instruction::CheckTypeAndMergeFrom(
    const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) {
  MergeFrom(*::_pbi::DownCast<const Instruction*>(
      &from));
}

void Instruction::MergeFrom(const Instruction& from) {
  Instruction* const _this = this;
  // @@protoc_insertion_point(class_specific_merge_from_start:ClientBuffers.Instruction)
  GOOGLE_DCHECK_NE(&from, _this);
  uint32_t cached_has_bits = 0;
  (void) cached_has_bits;

  _this->_impl_._extensions_.MergeFrom(internal_default_instance(), from._impl_._extensions_);
  _this->_internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
}

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

bool Instruction::IsInitialized() const {
  if (!_impl_._extensions_.IsInitialized()) {
    return false;
  }

  return true;
}

void Instruction::InternalSwap(Instruction* other) {
  using std::swap;
  _impl_._extensions_.InternalSwap(&other->_impl_._extensions_);
  _internal_metadata_.InternalSwap(&other->_internal_metadata_);
}

std::string Instruction::GetTypeName() const {
  return "ClientBuffers.Instruction";
}


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

class Keystroke::_Internal {
 public:
  using HasBits = decltype(std::declval<Keystroke>()._impl_._has_bits_);
  static void set_has_keys(HasBits* has_bits) {
    (*has_bits)[0] |= 1u;
  }
};

Keystroke::Keystroke(::PROTOBUF_NAMESPACE_ID::Arena* arena,
                         bool is_message_owned)
  : ::PROTOBUF_NAMESPACE_ID::MessageLite(arena, is_message_owned) {
  SharedCtor(arena, is_message_owned);
  // @@protoc_insertion_point(arena_constructor:ClientBuffers.Keystroke)
}
Keystroke::Keystroke(const Keystroke& from)
  : ::PROTOBUF_NAMESPACE_ID::MessageLite() {
  Keystroke* const _this = this; (void)_this;
  new (&_impl_) Impl_{
      decltype(_impl_._has_bits_){from._impl_._has_bits_}
    , /*decltype(_impl_._cached_size_)*/{}
    , decltype(_impl_.keys_){}};

  _internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
  _impl_.keys_.InitDefault();
  #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
    _impl_.keys_.Set("", GetArenaForAllocation());
  #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
  if (from._internal_has_keys()) {
    _this->_impl_.keys_.Set(from._internal_keys(), 
      _this->GetArenaForAllocation());
  }
  // @@protoc_insertion_point(copy_constructor:ClientBuffers.Keystroke)
}

inline void Keystroke::SharedCtor(
    ::_pb::Arena* arena, bool is_message_owned) {
  (void)arena;
  (void)is_message_owned;
  new (&_impl_) Impl_{
      decltype(_impl_._has_bits_){}
    , /*decltype(_impl_._cached_size_)*/{}
    , decltype(_impl_.keys_){}
  };
  _impl_.keys_.InitDefault();
  #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
    _impl_.keys_.Set("", GetArenaForAllocation());
  #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
}

Keystroke::~Keystroke() {
  // @@protoc_insertion_point(destructor:ClientBuffers.Keystroke)
  if (auto *arena = _internal_metadata_.DeleteReturnArena<std::string>()) {
  (void)arena;
    return;
  }
  SharedDtor();
}

inline void Keystroke::SharedDtor() {
  GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
  _impl_.keys_.Destroy();
}

void Keystroke::SetCachedSize(int size) const {
  _impl_._cached_size_.Set(size);
}

void Keystroke::Clear() {
// @@protoc_insertion_point(message_clear_start:ClientBuffers.Keystroke)
  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 (cached_has_bits & 0x00000001u) {
    _impl_.keys_.ClearNonDefaultToEmpty();
  }
  _impl_._has_bits_.Clear();
  _internal_metadata_.Clear<std::string>();
}

const char* Keystroke::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) {
#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
  _Internal::HasBits has_bits{};
  while (!ctx->Done(&ptr)) {
    uint32_t tag;
    ptr = ::_pbi::ReadTag(ptr, &tag);
    switch (tag >> 3) {
      // optional bytes keys = 4;
      case 4:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 34)) {
          auto str = _internal_mutable_keys();
          ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx);
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      default:
        goto handle_unusual;
    }  // switch
  handle_unusual:
    if ((tag == 0) || ((tag & 7) == 4)) {
      CHK_(ptr);
      ctx->SetLastTag(tag);
      goto message_done;
    }
    ptr = UnknownFieldParse(
        tag,
        _internal_metadata_.mutable_unknown_fields<std::string>(),
        ptr, ctx);
    CHK_(ptr != nullptr);
  }  // while
message_done:
  _impl_._has_bits_.Or(has_bits);
  return ptr;
failure:
  ptr = nullptr;
  goto message_done;
#undef CHK_
}

uint8_t* Keystroke::_InternalSerialize(
    uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
  // @@protoc_insertion_point(serialize_to_array_start:ClientBuffers.Keystroke)
  uint32_t cached_has_bits = 0;
  (void) cached_has_bits;

  cached_has_bits = _impl_._has_bits_[0];
  // optional bytes keys = 4;
  if (cached_has_bits & 0x00000001u) {
    target = stream->WriteBytesMaybeAliased(
        4, this->_internal_keys(), target);
  }

  if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
    target = stream->WriteRaw(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).data(),
        static_cast<int>(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size()), target);
  }
  // @@protoc_insertion_point(serialize_to_array_end:ClientBuffers.Keystroke)
  return target;
}

size_t Keystroke::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:ClientBuffers.Keystroke)
  size_t total_size = 0;

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

  // optional bytes keys = 4;
  cached_has_bits = _impl_._has_bits_[0];
  if (cached_has_bits & 0x00000001u) {
    total_size += 1 +
      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::BytesSize(
        this->_internal_keys());
  }

  if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
    total_size += _internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size();
  }
  int cached_size = ::_pbi::ToCachedSize(total_size);
  SetCachedSize(cached_size);
  return total_size;
}

void Keystroke::CheckTypeAndMergeFrom(
    const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) {
  MergeFrom(*::_pbi::DownCast<const Keystroke*>(
      &from));
}

void Keystroke::MergeFrom(const Keystroke& from) {
  Keystroke* const _this = this;
  // @@protoc_insertion_point(class_specific_merge_from_start:ClientBuffers.Keystroke)
  GOOGLE_DCHECK_NE(&from, _this);
  uint32_t cached_has_bits = 0;
  (void) cached_has_bits;

  if (from._internal_has_keys()) {
    _this->_internal_set_keys(from._internal_keys());
  }
  _this->_internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
}

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

bool Keystroke::IsInitialized() const {
  return true;
}

void Keystroke::InternalSwap(Keystroke* other) {
  using std::swap;
  auto* lhs_arena = GetArenaForAllocation();
  auto* rhs_arena = other->GetArenaForAllocation();
  _internal_metadata_.InternalSwap(&other->_internal_metadata_);
  swap(_impl_._has_bits_[0], other->_impl_._has_bits_[0]);
  ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap(
      &_impl_.keys_, lhs_arena,
      &other->_impl_.keys_, rhs_arena
  );
}

std::string Keystroke::GetTypeName() const {
  return "ClientBuffers.Keystroke";
}


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

class ResizeMessage::_Internal {
 public:
  using HasBits = decltype(std::declval<ResizeMessage>()._impl_._has_bits_);
  static void set_has_width(HasBits* has_bits) {
    (*has_bits)[0] |= 1u;
  }
  static void set_has_height(HasBits* has_bits) {
    (*has_bits)[0] |= 2u;
  }
};

ResizeMessage::ResizeMessage(::PROTOBUF_NAMESPACE_ID::Arena* arena,
                         bool is_message_owned)
  : ::PROTOBUF_NAMESPACE_ID::MessageLite(arena, is_message_owned) {
  SharedCtor(arena, is_message_owned);
  // @@protoc_insertion_point(arena_constructor:ClientBuffers.ResizeMessage)
}
ResizeMessage::ResizeMessage(const ResizeMessage& from)
  : ::PROTOBUF_NAMESPACE_ID::MessageLite() {
  ResizeMessage* const _this = this; (void)_this;
  new (&_impl_) Impl_{
      decltype(_impl_._has_bits_){from._impl_._has_bits_}
    , /*decltype(_impl_._cached_size_)*/{}
    , decltype(_impl_.width_){}
    , decltype(_impl_.height_){}};

  _internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
  ::memcpy(&_impl_.width_, &from._impl_.width_,
    static_cast<size_t>(reinterpret_cast<char*>(&_impl_.height_) -
    reinterpret_cast<char*>(&_impl_.width_)) + sizeof(_impl_.height_));
  // @@protoc_insertion_point(copy_constructor:ClientBuffers.ResizeMessage)
}

inline void ResizeMessage::SharedCtor(
    ::_pb::Arena* arena, bool is_message_owned) {
  (void)arena;
  (void)is_message_owned;
  new (&_impl_) Impl_{
      decltype(_impl_._has_bits_){}
    , /*decltype(_impl_._cached_size_)*/{}
    , decltype(_impl_.width_){0}
    , decltype(_impl_.height_){0}
  };
}

ResizeMessage::~ResizeMessage() {
  // @@protoc_insertion_point(destructor:ClientBuffers.ResizeMessage)
  if (auto *arena = _internal_metadata_.DeleteReturnArena<std::string>()) {
  (void)arena;
    return;
  }
  SharedDtor();
}

inline void ResizeMessage::SharedDtor() {
  GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
}

void ResizeMessage::SetCachedSize(int size) const {
  _impl_._cached_size_.Set(size);
}

void ResizeMessage::Clear() {
// @@protoc_insertion_point(message_clear_start:ClientBuffers.ResizeMessage)
  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 (cached_has_bits & 0x00000003u) {
    ::memset(&_impl_.width_, 0, static_cast<size_t>(
        reinterpret_cast<char*>(&_impl_.height_) -
        reinterpret_cast<char*>(&_impl_.width_)) + sizeof(_impl_.height_));
  }
  _impl_._has_bits_.Clear();
  _internal_metadata_.Clear<std::string>();
}

const char* ResizeMessage::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) {
#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
  _Internal::HasBits has_bits{};
  while (!ctx->Done(&ptr)) {
    uint32_t tag;
    ptr = ::_pbi::ReadTag(ptr, &tag);
    switch (tag >> 3) {
      // optional int32 width = 5;
      case 5:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 40)) {
          _Internal::set_has_width(&has_bits);
          _impl_.width_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      // optional int32 height = 6;
      case 6:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 48)) {
          _Internal::set_has_height(&has_bits);
          _impl_.height_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      default:
        goto handle_unusual;
    }  // switch
  handle_unusual:
    if ((tag == 0) || ((tag & 7) == 4)) {
      CHK_(ptr);
      ctx->SetLastTag(tag);
      goto message_done;
    }
    ptr = UnknownFieldParse(
        tag,
        _internal_metadata_.mutable_unknown_fields<std::string>(),
        ptr, ctx);
    CHK_(ptr != nullptr);
  }  // while
message_done:
  _impl_._has_bits_.Or(has_bits);
  return ptr;
failure:
  ptr = nullptr;
  goto message_done;
#undef CHK_
}

uint8_t* ResizeMessage::_InternalSerialize(
    uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
  // @@protoc_insertion_point(serialize_to_array_start:ClientBuffers.ResizeMessage)
  uint32_t cached_has_bits = 0;
  (void) cached_has_bits;

  cached_has_bits = _impl_._has_bits_[0];
  // optional int32 width = 5;
  if (cached_has_bits & 0x00000001u) {
    target = stream->EnsureSpace(target);
    target = ::_pbi::WireFormatLite::WriteInt32ToArray(5, this->_internal_width(), target);
  }

  // optional int32 height = 6;
  if (cached_has_bits & 0x00000002u) {
    target = stream->EnsureSpace(target);
    target = ::_pbi::WireFormatLite::WriteInt32ToArray(6, this->_internal_height(), target);
  }

  if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
    target = stream->WriteRaw(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).data(),
        static_cast<int>(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size()), target);
  }
  // @@protoc_insertion_point(serialize_to_array_end:ClientBuffers.ResizeMessage)
  return target;
}

size_t ResizeMessage::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:ClientBuffers.ResizeMessage)
  size_t total_size = 0;

  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 (cached_has_bits & 0x00000003u) {
    // optional int32 width = 5;
    if (cached_has_bits & 0x00000001u) {
      total_size += ::_pbi::WireFormatLite::Int32SizePlusOne(this->_internal_width());
    }

    // optional int32 height = 6;
    if (cached_has_bits & 0x00000002u) {
      total_size += ::_pbi::WireFormatLite::Int32SizePlusOne(this->_internal_height());
    }

  }
  if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
    total_size += _internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size();
  }
  int cached_size = ::_pbi::ToCachedSize(total_size);
  SetCachedSize(cached_size);
  return total_size;
}

void ResizeMessage::CheckTypeAndMergeFrom(
    const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) {
  MergeFrom(*::_pbi::DownCast<const ResizeMessage*>(
      &from));
}

void ResizeMessage::MergeFrom(const ResizeMessage& from) {
  ResizeMessage* const _this = this;
  // @@protoc_insertion_point(class_specific_merge_from_start:ClientBuffers.ResizeMessage)
  GOOGLE_DCHECK_NE(&from, _this);
  uint32_t cached_has_bits = 0;
  (void) cached_has_bits;

  cached_has_bits = from._impl_._has_bits_[0];
  if (cached_has_bits & 0x00000003u) {
    if (cached_has_bits & 0x00000001u) {
      _this->_impl_.width_ = from._impl_.width_;
    }
    if (cached_has_bits & 0x00000002u) {
      _this->_impl_.height_ = from._impl_.height_;
    }
    _this->_impl_._has_bits_[0] |= cached_has_bits;
  }
  _this->_internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
}

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

bool ResizeMessage::IsInitialized() const {
  return true;
}

void ResizeMessage::InternalSwap(ResizeMessage* other) {
  using std::swap;
  _internal_metadata_.InternalSwap(&other->_internal_metadata_);
  swap(_impl_._has_bits_[0], other->_impl_._has_bits_[0]);
  ::PROTOBUF_NAMESPACE_ID::internal::memswap<
      PROTOBUF_FIELD_OFFSET(ResizeMessage, _impl_.height_)
      + sizeof(ResizeMessage::_impl_.height_)
      - PROTOBUF_FIELD_OFFSET(ResizeMessage, _impl_.width_)>(
          reinterpret_cast<char*>(&_impl_.width_),
          reinterpret_cast<char*>(&other->_impl_.width_));
}

std::string ResizeMessage::GetTypeName() const {
  return "ClientBuffers.ResizeMessage";
}

PROTOBUF_ATTRIBUTE_INIT_PRIORITY2 ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier< ::ClientBuffers::Instruction,
    ::PROTOBUF_NAMESPACE_ID::internal::MessageTypeTraits< ::ClientBuffers::Keystroke >, 11, false>
  keystroke(kKeystrokeFieldNumber, ::ClientBuffers::Keystroke::default_instance(), nullptr);
PROTOBUF_ATTRIBUTE_INIT_PRIORITY2 ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier< ::ClientBuffers::Instruction,
    ::PROTOBUF_NAMESPACE_ID::internal::MessageTypeTraits< ::ClientBuffers::ResizeMessage >, 11, false>
  resize(kResizeFieldNumber, ::ClientBuffers::ResizeMessage::default_instance(), nullptr);

// @@protoc_insertion_point(namespace_scope)
}  // namespace ClientBuffers
PROTOBUF_NAMESPACE_OPEN
template<> PROTOBUF_NOINLINE ::ClientBuffers::UserMessage*
Arena::CreateMaybeMessage< ::ClientBuffers::UserMessage >(Arena* arena) {
  return Arena::CreateMessageInternal< ::ClientBuffers::UserMessage >(arena);
}
template<> PROTOBUF_NOINLINE ::ClientBuffers::Instruction*
Arena::CreateMaybeMessage< ::ClientBuffers::Instruction >(Arena* arena) {
  return Arena::CreateMessageInternal< ::ClientBuffers::Instruction >(arena);
}
template<> PROTOBUF_NOINLINE ::ClientBuffers::Keystroke*
Arena::CreateMaybeMessage< ::ClientBuffers::Keystroke >(Arena* arena) {
  return Arena::CreateMessageInternal< ::ClientBuffers::Keystroke >(arena);
}
template<> PROTOBUF_NOINLINE ::ClientBuffers::ResizeMessage*
Arena::CreateMaybeMessage< ::ClientBuffers::ResizeMessage >(Arena* arena) {
  return Arena::CreateMessageInternal< ::ClientBuffers::ResizeMessage >(arena);
}
PROTOBUF_NAMESPACE_CLOSE

// @@protoc_insertion_point(global_scope)
#include <google/protobuf/port_undef.inc>
