// File: /workspace/github_cpp_makefile_star2_O2/mindbeast[P]rnes/bin/save.pb.cc
// Function: Rnes::PpuState::_InternalSerialize(unsigned char*, google::protobuf::io::EpsCopyOutputStream*) const
::PROTOBUF_NAMESPACE_ID::uint8* PpuState::_InternalSerialize(
    ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
  // @@protoc_insertion_point(serialize_to_array_start:Rnes.PpuState)
  ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
  (void) cached_has_bits;

  cached_has_bits = _has_bits_[0];
  // optional uint64 cycle = 1;
  if (cached_has_bits & 0x00000001u) {
    target = stream->EnsureSpace(target);
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteUInt64ToArray(1, this->_internal_cycle(), target);
  }

  // optional uint64 frame = 2;
  if (cached_has_bits & 0x00000002u) {
    target = stream->EnsureSpace(target);
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteUInt64ToArray(2, this->_internal_frame(), target);
  }

  // repeated uint32 regs = 3;
  for (int i = 0, n = this->_internal_regs_size(); i < n; i++) {
    target = stream->EnsureSpace(target);
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteUInt32ToArray(3, this->_internal_regs(i), target);
  }

  // repeated .Rnes.PpuState.SpriteState spriteRam = 4;
  for (unsigned int i = 0,
      n = static_cast<unsigned int>(this->_internal_spriteram_size()); i < n; i++) {
    target = stream->EnsureSpace(target);
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
      InternalWriteMessage(4, this->_internal_spriteram(i), target, stream);
  }

  // optional uint32 vramToggle = 5;
  if (cached_has_bits & 0x00000004u) {
    target = stream->EnsureSpace(target);
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteUInt32ToArray(5, this->_internal_vramtoggle(), target);
  }

  // optional uint32 vramFineXScroll = 6;
  if (cached_has_bits & 0x00000008u) {
    target = stream->EnsureSpace(target);
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteUInt32ToArray(6, this->_internal_vramfinexscroll(), target);
  }

  // optional uint32 vramCurrentAddr = 7;
  if (cached_has_bits & 0x00000010u) {
    target = stream->EnsureSpace(target);
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteUInt32ToArray(7, this->_internal_vramcurrentaddr(), target);
  }

  // optional uint32 vramTempAddr = 8;
  if (cached_has_bits & 0x00000020u) {
    target = stream->EnsureSpace(target);
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteUInt32ToArray(8, this->_internal_vramtempaddr(), target);
  }

  // optional uint32 vramMachineAddr = 9;
  if (cached_has_bits & 0x00000040u) {
    target = stream->EnsureSpace(target);
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteUInt32ToArray(9, this->_internal_vrammachineaddr(), target);
  }

  // optional uint32 vramReadLatch = 10;
  if (cached_has_bits & 0x00000080u) {
    target = stream->EnsureSpace(target);
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteUInt32ToArray(10, this->_internal_vramreadlatch(), target);
  }

  // optional uint32 scrollingMachineState = 11;
  if (cached_has_bits & 0x00000100u) {
    target = stream->EnsureSpace(target);
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteUInt32ToArray(11, this->_internal_scrollingmachinestate(), target);
  }

  // optional uint32 xScrollOrigin = 12;
  if (cached_has_bits & 0x00000200u) {
    target = stream->EnsureSpace(target);
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteUInt32ToArray(12, this->_internal_xscrollorigin(), target);
  }

  // optional uint32 yScrollOrigin = 13;
  if (cached_has_bits & 0x00000400u) {
    target = stream->EnsureSpace(target);
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteUInt32ToArray(13, this->_internal_yscrollorigin(), target);
  }

  if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray(
        _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream);
  }
  // @@protoc_insertion_point(serialize_to_array_end:Rnes.PpuState)
  return target;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdx, %r14
movq %rdi, %r13
movl 0x10(%rdi), %ebx
testb $0x1, %bl
je 0x214e0
movq %r14, %rdi
callq 0x2682a
movq 0x40(%r13), %rdi
movb $0x8, (%rax)
leaq 0x1(%rax), %rsi
callq 0x28eae
movq %rax, %rsi
testb $0x2, %bl
movl %ebx, -0x2c(%rbp)
je 0x21503
movq %r14, %rdi
callq 0x2682a
movq 0x48(%r13), %rdi
movb $0x10, (%rax)
leaq 0x1(%rax), %rsi
callq 0x28eae
movq %rax, %rsi
movl 0x18(%r13), %ebx
xorl %r15d, %r15d
testl %ebx, %ebx
cmovlel %r15d, %ebx
cmpl %r15d, %ebx
je 0x21545
movq %r14, %rdi
callq 0x2682a
movq %rax, %r12
movq %r13, %rdi
movl %r15d, %esi
callq 0x14230
movb $0x18, (%r12)
incq %r12
movl %eax, %edi
movq %r12, %rsi
callq 0x28e5c
movq %rax, %rsi
incl %r15d
jmp 0x21510
movl 0x30(%r13), %eax
movl %eax, -0x30(%rbp)
leaq 0x28(%r13), %rax
movq %rax, -0x38(%rbp)
xorl %r12d, %r12d
cmpl %r12d, -0x30(%rbp)
je 0x215ac
movq %r14, %rdi
callq 0x2682a
movq %r13, %rbx
movq %rax, %r13
movq -0x38(%rbp), %rdi
movl %r12d, %esi
callq 0x14242
movq %r14, %r15
movq %rax, %r14
movb $0x22, (%r13)
incq %r13
movl 0x14(%rax), %edi
movq %r13, %rsi
movq %rbx, %r13
callq 0x28e5c
movq %r14, %rdi
movq %r15, %r14
movq %rax, %rsi
movq %r15, %rdx
callq 0x20c0c
movq %rax, %rsi
incl %r12d
jmp 0x21557
movl -0x2c(%rbp), %ebx
testb $0x4, %bl
je 0x215cf
movq %r14, %rdi
callq 0x2682a
movl 0x50(%r13), %edi
movb $0x28, (%rax)
leaq 0x1(%rax), %rsi
callq 0x28e5c
movq %rax, %rsi
testb $0x8, %bl
je 0x215ef
movq %r14, %rdi
callq 0x2682a
movl 0x54(%r13), %edi
movb $0x30, (%rax)
leaq 0x1(%rax), %rsi
callq 0x28e5c
movq %rax, %rsi
testb $0x10, %bl
je 0x2160f
movq %r14, %rdi
callq 0x2682a
movl 0x58(%r13), %edi
movb $0x38, (%rax)
leaq 0x1(%rax), %rsi
callq 0x28e5c
movq %rax, %rsi
testb $0x20, %bl
je 0x2162f
movq %r14, %rdi
callq 0x2682a
movl 0x5c(%r13), %edi
movb $0x40, (%rax)
leaq 0x1(%rax), %rsi
callq 0x28e5c
movq %rax, %rsi
testb $0x40, %bl
je 0x2164f
movq %r14, %rdi
callq 0x2682a
movl 0x60(%r13), %edi
movb $0x48, (%rax)
leaq 0x1(%rax), %rsi
callq 0x28e5c
movq %rax, %rsi
testb %bl, %bl
jns 0x2166e
movq %r14, %rdi
callq 0x2682a
movl 0x64(%r13), %edi
movb $0x50, (%rax)
leaq 0x1(%rax), %rsi
callq 0x28e5c
movq %rax, %rsi
btl $0x8, %ebx
jae 0x2168f
movq %r14, %rdi
callq 0x2682a
movl 0x68(%r13), %edi
movb $0x58, (%rax)
leaq 0x1(%rax), %rsi
callq 0x28e5c
movq %rax, %rsi
btl $0x9, %ebx
jae 0x216b0
movq %r14, %rdi
callq 0x2682a
movl 0x6c(%r13), %edi
movb $0x60, (%rax)
leaq 0x1(%rax), %rsi
callq 0x28e5c
movq %rax, %rsi
btl $0xa, %ebx
jae 0x216d1
movq %r14, %rdi
callq 0x2682a
movl 0x70(%r13), %edi
movb $0x68, (%rax)
leaq 0x1(%rax), %rsi
callq 0x28e5c
movq %rax, %rsi
movq 0x8(%r13), %rdi
testb $0x1, %dil
jne 0x216ed
movq %rsi, %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
andq $-0x2, %rdi
addq $0x8, %rdi
movq %r14, %rdx
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0xb260
nop