// File: /workspace/github_cpp_makefile_star2_O3/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, %rbx
movq %rsi, %r15
movq %rdi, %r12
movl 0x10(%rdi), %r14d
testb $0x1, %r14b
je 0x29808
cmpq %r15, (%rbx)
jbe 0x29dab
movq 0x40(%r12), %rcx
movb $0x8, (%r15)
cmpq $0x7f, %rcx
ja 0x297c2
movb %cl, 0x1(%r15)
addq $0x2, %r15
jmp 0x29808
movl %ecx, %eax
orb $-0x80, %al
movb %al, 0x1(%r15)
movq %rcx, %rax
shrq $0x7, %rax
cmpq $0x3fff, %rcx           # imm = 0x3FFF
ja 0x297e4
movb %al, 0x2(%r15)
addq $0x3, %r15
jmp 0x29808
addq $0x3, %r15
movq %rax, %rcx
movl %ecx, %edx
orb $-0x80, %dl
movb %dl, -0x1(%r15)
shrq $0x7, %rax
incq %r15
cmpq $0x3fff, %rcx           # imm = 0x3FFF
ja 0x297e8
movb %al, -0x1(%r15)
testb $0x2, %r14b
je 0x29876
cmpq %r15, (%rbx)
jbe 0x29dbe
movq 0x48(%r12), %rcx
movb $0x10, (%r15)
cmpq $0x7f, %rcx
ja 0x29830
movb %cl, 0x1(%r15)
addq $0x2, %r15
jmp 0x29876
movl %ecx, %eax
orb $-0x80, %al
movb %al, 0x1(%r15)
movq %rcx, %rax
shrq $0x7, %rax
cmpq $0x3fff, %rcx           # imm = 0x3FFF
ja 0x29852
movb %al, 0x2(%r15)
addq $0x3, %r15
jmp 0x29876
addq $0x3, %r15
movq %rax, %rcx
movl %ecx, %edx
orb $-0x80, %dl
movb %dl, -0x1(%r15)
shrq $0x7, %rax
incq %r15
cmpq $0x3fff, %rcx           # imm = 0x3FFF
ja 0x29856
movb %al, -0x1(%r15)
movl %r14d, -0x34(%rbp)
movl 0x18(%r12), %r14d
testl %r14d, %r14d
movq %r12, -0x30(%rbp)
jle 0x29912
addq $0x18, %r12
xorl %r13d, %r13d
cmpq %r15, (%rbx)
jbe 0x29902
movq %r12, %rdi
movl %r13d, %esi
callq 0xa720
movl (%rax), %ecx
movb $0x18, (%r15)
cmpl $0x7f, %ecx
ja 0x298b8
movb %cl, 0x1(%r15)
addq $0x2, %r15
jmp 0x298f8
movl %ecx, %eax
orb $-0x80, %al
movb %al, 0x1(%r15)
movl %ecx, %eax
shrl $0x7, %eax
cmpl $0x3fff, %ecx           # imm = 0x3FFF
ja 0x298d7
movb %al, 0x2(%r15)
addq $0x3, %r15
jmp 0x298f8
addq $0x3, %r15
movl %eax, %ecx
movl %ecx, %edx
orb $-0x80, %dl
movb %dl, -0x1(%r15)
shrl $0x7, %eax
incq %r15
cmpl $0x3fff, %ecx           # imm = 0x3FFF
ja 0x298db
movb %al, -0x1(%r15)
incl %r13d
cmpl %r14d, %r13d
jne 0x29893
jmp 0x29912
movq %rbx, %rdi
movq %r15, %rsi
callq 0xa750
movq %rax, %r15
jmp 0x29898
movq -0x30(%rbp), %rax
movl 0x30(%rax), %r14d
testl %r14d, %r14d
je 0x299c8
leaq 0x28(%rax), %r12
xorl %r13d, %r13d
cmpq %r15, (%rbx)
jbe 0x299b5
movq %r12, %rdi
movl %r13d, %esi
callq 0x18cfc
movb $0x22, (%r15)
movl 0x14(%rax), %edx
cmpl $0x7f, %edx
ja 0x29954
movb %dl, 0x1(%r15)
addq $0x2, %r15
jmp 0x29996
movl %edx, %ecx
orb $-0x80, %cl
movb %cl, 0x1(%r15)
movl %edx, %ecx
shrl $0x7, %ecx
cmpl $0x3fff, %edx           # imm = 0x3FFF
ja 0x29974
movb %cl, 0x2(%r15)
addq $0x3, %r15
jmp 0x29996
addq $0x3, %r15
movl %ecx, %edx
movl %edx, %esi
orb $-0x80, %sil
movb %sil, -0x1(%r15)
shrl $0x7, %ecx
incq %r15
cmpl $0x3fff, %edx           # imm = 0x3FFF
ja 0x29978
movb %cl, -0x1(%r15)
movq %rax, %rdi
movq %r15, %rsi
movq %rbx, %rdx
callq 0x28920
movq %rax, %r15
incl %r13d
cmpl %r14d, %r13d
jne 0x2992a
jmp 0x299c8
movq %rbx, %rdi
movq %r15, %rsi
callq 0xa750
movq %rax, %r15
jmp 0x29933
movl -0x34(%rbp), %r12d
testb $0x4, %r12b
jne 0x299d8
movq -0x30(%rbp), %r14
jmp 0x29a3c
cmpq %r15, (%rbx)
movq -0x30(%rbp), %r14
jbe 0x29dd1
movl 0x50(%r14), %ecx
movb $0x28, (%r15)
cmpl $0x7f, %ecx
ja 0x299fc
movb %cl, 0x1(%r15)
addq $0x2, %r15
jmp 0x29a3c
movl %ecx, %eax
orb $-0x80, %al
movb %al, 0x1(%r15)
movl %ecx, %eax
shrl $0x7, %eax
cmpl $0x3fff, %ecx           # imm = 0x3FFF
ja 0x29a1b
movb %al, 0x2(%r15)
addq $0x3, %r15
jmp 0x29a3c
addq $0x3, %r15
movl %eax, %ecx
movl %ecx, %edx
orb $-0x80, %dl
movb %dl, -0x1(%r15)
shrl $0x7, %eax
incq %r15
cmpl $0x3fff, %ecx           # imm = 0x3FFF
ja 0x29a1f
movb %al, -0x1(%r15)
testb $0x8, %r12b
je 0x29aa2
cmpq %r15, (%rbx)
jbe 0x29de4
movl 0x54(%r14), %ecx
movb $0x30, (%r15)
cmpl $0x7f, %ecx
ja 0x29a62
movb %cl, 0x1(%r15)
addq $0x2, %r15
jmp 0x29aa2
movl %ecx, %eax
orb $-0x80, %al
movb %al, 0x1(%r15)
movl %ecx, %eax
shrl $0x7, %eax
cmpl $0x3fff, %ecx           # imm = 0x3FFF
ja 0x29a81
movb %al, 0x2(%r15)
addq $0x3, %r15
jmp 0x29aa2
addq $0x3, %r15
movl %eax, %ecx
movl %ecx, %edx
orb $-0x80, %dl
movb %dl, -0x1(%r15)
shrl $0x7, %eax
incq %r15
cmpl $0x3fff, %ecx           # imm = 0x3FFF
ja 0x29a85
movb %al, -0x1(%r15)
testb $0x10, %r12b
je 0x29b08
cmpq %r15, (%rbx)
jbe 0x29df7
movl 0x58(%r14), %ecx
movb $0x38, (%r15)
cmpl $0x7f, %ecx
ja 0x29ac8
movb %cl, 0x1(%r15)
addq $0x2, %r15
jmp 0x29b08
movl %ecx, %eax
orb $-0x80, %al
movb %al, 0x1(%r15)
movl %ecx, %eax
shrl $0x7, %eax
cmpl $0x3fff, %ecx           # imm = 0x3FFF
ja 0x29ae7
movb %al, 0x2(%r15)
addq $0x3, %r15
jmp 0x29b08
addq $0x3, %r15
movl %eax, %ecx
movl %ecx, %edx
orb $-0x80, %dl
movb %dl, -0x1(%r15)
shrl $0x7, %eax
incq %r15
cmpl $0x3fff, %ecx           # imm = 0x3FFF
ja 0x29aeb
movb %al, -0x1(%r15)
testb $0x20, %r12b
je 0x29b6e
cmpq %r15, (%rbx)
jbe 0x29e0a
movl 0x5c(%r14), %ecx
movb $0x40, (%r15)
cmpl $0x7f, %ecx
ja 0x29b2e
movb %cl, 0x1(%r15)
addq $0x2, %r15
jmp 0x29b6e
movl %ecx, %eax
orb $-0x80, %al
movb %al, 0x1(%r15)
movl %ecx, %eax
shrl $0x7, %eax
cmpl $0x3fff, %ecx           # imm = 0x3FFF
ja 0x29b4d
movb %al, 0x2(%r15)
addq $0x3, %r15
jmp 0x29b6e
addq $0x3, %r15
movl %eax, %ecx
movl %ecx, %edx
orb $-0x80, %dl
movb %dl, -0x1(%r15)
shrl $0x7, %eax
incq %r15
cmpl $0x3fff, %ecx           # imm = 0x3FFF
ja 0x29b51
movb %al, -0x1(%r15)
testb $0x40, %r12b
je 0x29bd4
cmpq %r15, (%rbx)
jbe 0x29e1d
movl 0x60(%r14), %ecx
movb $0x48, (%r15)
cmpl $0x7f, %ecx
ja 0x29b94
movb %cl, 0x1(%r15)
addq $0x2, %r15
jmp 0x29bd4
movl %ecx, %eax
orb $-0x80, %al
movb %al, 0x1(%r15)
movl %ecx, %eax
shrl $0x7, %eax
cmpl $0x3fff, %ecx           # imm = 0x3FFF
ja 0x29bb3
movb %al, 0x2(%r15)
addq $0x3, %r15
jmp 0x29bd4
addq $0x3, %r15
movl %eax, %ecx
movl %ecx, %edx
orb $-0x80, %dl
movb %dl, -0x1(%r15)
shrl $0x7, %eax
incq %r15
cmpl $0x3fff, %ecx           # imm = 0x3FFF
ja 0x29bb7
movb %al, -0x1(%r15)
testb %r12b, %r12b
jns 0x29c39
cmpq %r15, (%rbx)
jbe 0x29e30
movl 0x64(%r14), %ecx
movb $0x50, (%r15)
cmpl $0x7f, %ecx
ja 0x29bf9
movb %cl, 0x1(%r15)
addq $0x2, %r15
jmp 0x29c39
movl %ecx, %eax
orb $-0x80, %al
movb %al, 0x1(%r15)
movl %ecx, %eax
shrl $0x7, %eax
cmpl $0x3fff, %ecx           # imm = 0x3FFF
ja 0x29c18
movb %al, 0x2(%r15)
addq $0x3, %r15
jmp 0x29c39
addq $0x3, %r15
movl %eax, %ecx
movl %ecx, %edx
orb $-0x80, %dl
movb %dl, -0x1(%r15)
shrl $0x7, %eax
incq %r15
cmpl $0x3fff, %ecx           # imm = 0x3FFF
ja 0x29c1c
movb %al, -0x1(%r15)
btl $0x8, %r12d
jae 0x29ca0
cmpq %r15, (%rbx)
jbe 0x29e43
movl 0x68(%r14), %ecx
movb $0x58, (%r15)
cmpl $0x7f, %ecx
ja 0x29c60
movb %cl, 0x1(%r15)
addq $0x2, %r15
jmp 0x29ca0
movl %ecx, %eax
orb $-0x80, %al
movb %al, 0x1(%r15)
movl %ecx, %eax
shrl $0x7, %eax
cmpl $0x3fff, %ecx           # imm = 0x3FFF
ja 0x29c7f
movb %al, 0x2(%r15)
addq $0x3, %r15
jmp 0x29ca0
addq $0x3, %r15
movl %eax, %ecx
movl %ecx, %edx
orb $-0x80, %dl
movb %dl, -0x1(%r15)
shrl $0x7, %eax
incq %r15
cmpl $0x3fff, %ecx           # imm = 0x3FFF
ja 0x29c83
movb %al, -0x1(%r15)
btl $0x9, %r12d
jae 0x29d07
cmpq %r15, (%rbx)
jbe 0x29e56
movl 0x6c(%r14), %ecx
movb $0x60, (%r15)
cmpl $0x7f, %ecx
ja 0x29cc7
movb %cl, 0x1(%r15)
addq $0x2, %r15
jmp 0x29d07
movl %ecx, %eax
orb $-0x80, %al
movb %al, 0x1(%r15)
movl %ecx, %eax
shrl $0x7, %eax
cmpl $0x3fff, %ecx           # imm = 0x3FFF
ja 0x29ce6
movb %al, 0x2(%r15)
addq $0x3, %r15
jmp 0x29d07
addq $0x3, %r15
movl %eax, %ecx
movl %ecx, %edx
orb $-0x80, %dl
movb %dl, -0x1(%r15)
shrl $0x7, %eax
incq %r15
cmpl $0x3fff, %ecx           # imm = 0x3FFF
ja 0x29cea
movb %al, -0x1(%r15)
btl $0xa, %r12d
jae 0x29d6e
cmpq %r15, (%rbx)
jbe 0x29e69
movl 0x70(%r14), %ecx
movb $0x68, (%r15)
cmpl $0x7f, %ecx
ja 0x29d2e
movb %cl, 0x1(%r15)
addq $0x2, %r15
jmp 0x29d6e
movl %ecx, %eax
orb $-0x80, %al
movb %al, 0x1(%r15)
movl %ecx, %eax
shrl $0x7, %eax
cmpl $0x3fff, %ecx           # imm = 0x3FFF
ja 0x29d4d
movb %al, 0x2(%r15)
addq $0x3, %r15
jmp 0x29d6e
addq $0x3, %r15
movl %eax, %ecx
movl %ecx, %edx
orb $-0x80, %dl
movb %dl, -0x1(%r15)
shrl $0x7, %eax
incq %r15
cmpl $0x3fff, %ecx           # imm = 0x3FFF
ja 0x29d51
movb %al, -0x1(%r15)
movq 0x8(%r14), %rdi
testb $0x1, %dil
jne 0x29d8a
movq %r15, %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
andq $-0x2, %rdi
addq $0x8, %rdi
movq %r15, %rsi
movq %rbx, %rdx
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0xa230
movq %rbx, %rdi
movq %r15, %rsi
callq 0xa750
movq %rax, %r15
jmp 0x297a9
movq %rbx, %rdi
movq %r15, %rsi
callq 0xa750
movq %rax, %r15
jmp 0x29817
movq %rbx, %rdi
movq %r15, %rsi
callq 0xa750
movq %rax, %r15
jmp 0x299e5
movq %rbx, %rdi
movq %r15, %rsi
callq 0xa750
movq %rax, %r15
jmp 0x29a4b
movq %rbx, %rdi
movq %r15, %rsi
callq 0xa750
movq %rax, %r15
jmp 0x29ab1
movq %rbx, %rdi
movq %r15, %rsi
callq 0xa750
movq %rax, %r15
jmp 0x29b17
movq %rbx, %rdi
movq %r15, %rsi
callq 0xa750
movq %rax, %r15
jmp 0x29b7d
movq %rbx, %rdi
movq %r15, %rsi
callq 0xa750
movq %rax, %r15
jmp 0x29be2
movq %rbx, %rdi
movq %r15, %rsi
callq 0xa750
movq %rax, %r15
jmp 0x29c49
movq %rbx, %rdi
movq %r15, %rsi
callq 0xa750
movq %rax, %r15
jmp 0x29cb0
movq %rbx, %rdi
movq %r15, %rsi
callq 0xa750
movq %rax, %r15
jmp 0x29d17