// File: /workspace/github_cpp_makefile_star2_O1/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 0x2aa28
cmpq %r15, (%rbx)
jbe 0x2afcb
movq 0x40(%r12), %rcx
movb $0x8, (%r15)
cmpq $0x7f, %rcx
ja 0x2a9e2
movb %cl, 0x1(%r15)
addq $0x2, %r15
jmp 0x2aa28
movl %ecx, %eax
orb $-0x80, %al
movb %al, 0x1(%r15)
movq %rcx, %rax
shrq $0x7, %rax
cmpq $0x3fff, %rcx           # imm = 0x3FFF
ja 0x2aa04
movb %al, 0x2(%r15)
addq $0x3, %r15
jmp 0x2aa28
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 0x2aa08
movb %al, -0x1(%r15)
testb $0x2, %r14b
je 0x2aa96
cmpq %r15, (%rbx)
jbe 0x2afde
movq 0x48(%r12), %rcx
movb $0x10, (%r15)
cmpq $0x7f, %rcx
ja 0x2aa50
movb %cl, 0x1(%r15)
addq $0x2, %r15
jmp 0x2aa96
movl %ecx, %eax
orb $-0x80, %al
movb %al, 0x1(%r15)
movq %rcx, %rax
shrq $0x7, %rax
cmpq $0x3fff, %rcx           # imm = 0x3FFF
ja 0x2aa72
movb %al, 0x2(%r15)
addq $0x3, %r15
jmp 0x2aa96
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 0x2aa76
movb %al, -0x1(%r15)
movl %r14d, -0x34(%rbp)
movl 0x18(%r12), %r14d
testl %r14d, %r14d
movq %r12, -0x30(%rbp)
jle 0x2ab32
addq $0x18, %r12
xorl %r13d, %r13d
cmpq %r15, (%rbx)
jbe 0x2ab22
movq %r12, %rdi
movl %r13d, %esi
callq 0xb720
movl (%rax), %ecx
movb $0x18, (%r15)
cmpl $0x7f, %ecx
ja 0x2aad8
movb %cl, 0x1(%r15)
addq $0x2, %r15
jmp 0x2ab18
movl %ecx, %eax
orb $-0x80, %al
movb %al, 0x1(%r15)
movl %ecx, %eax
shrl $0x7, %eax
cmpl $0x3fff, %ecx           # imm = 0x3FFF
ja 0x2aaf7
movb %al, 0x2(%r15)
addq $0x3, %r15
jmp 0x2ab18
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 0x2aafb
movb %al, -0x1(%r15)
incl %r13d
cmpl %r14d, %r13d
jne 0x2aab3
jmp 0x2ab32
movq %rbx, %rdi
movq %r15, %rsi
callq 0xb750
movq %rax, %r15
jmp 0x2aab8
movq -0x30(%rbp), %rax
movl 0x30(%rax), %r14d
testl %r14d, %r14d
je 0x2abe8
leaq 0x28(%rax), %r12
xorl %r13d, %r13d
cmpq %r15, (%rbx)
jbe 0x2abd5
movq %r12, %rdi
movl %r13d, %esi
callq 0x19d26
movb $0x22, (%r15)
movl 0x14(%rax), %edx
cmpl $0x7f, %edx
ja 0x2ab74
movb %dl, 0x1(%r15)
addq $0x2, %r15
jmp 0x2abb6
movl %edx, %ecx
orb $-0x80, %cl
movb %cl, 0x1(%r15)
movl %edx, %ecx
shrl $0x7, %ecx
cmpl $0x3fff, %edx           # imm = 0x3FFF
ja 0x2ab94
movb %cl, 0x2(%r15)
addq $0x3, %r15
jmp 0x2abb6
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 0x2ab98
movb %cl, -0x1(%r15)
movq %rax, %rdi
movq %r15, %rsi
movq %rbx, %rdx
callq 0x29a1e
movq %rax, %r15
incl %r13d
cmpl %r14d, %r13d
jne 0x2ab4a
jmp 0x2abe8
movq %rbx, %rdi
movq %r15, %rsi
callq 0xb750
movq %rax, %r15
jmp 0x2ab53
movl -0x34(%rbp), %r12d
testb $0x4, %r12b
jne 0x2abf8
movq -0x30(%rbp), %r14
jmp 0x2ac5c
cmpq %r15, (%rbx)
movq -0x30(%rbp), %r14
jbe 0x2aff1
movl 0x50(%r14), %ecx
movb $0x28, (%r15)
cmpl $0x7f, %ecx
ja 0x2ac1c
movb %cl, 0x1(%r15)
addq $0x2, %r15
jmp 0x2ac5c
movl %ecx, %eax
orb $-0x80, %al
movb %al, 0x1(%r15)
movl %ecx, %eax
shrl $0x7, %eax
cmpl $0x3fff, %ecx           # imm = 0x3FFF
ja 0x2ac3b
movb %al, 0x2(%r15)
addq $0x3, %r15
jmp 0x2ac5c
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 0x2ac3f
movb %al, -0x1(%r15)
testb $0x8, %r12b
je 0x2acc2
cmpq %r15, (%rbx)
jbe 0x2b004
movl 0x54(%r14), %ecx
movb $0x30, (%r15)
cmpl $0x7f, %ecx
ja 0x2ac82
movb %cl, 0x1(%r15)
addq $0x2, %r15
jmp 0x2acc2
movl %ecx, %eax
orb $-0x80, %al
movb %al, 0x1(%r15)
movl %ecx, %eax
shrl $0x7, %eax
cmpl $0x3fff, %ecx           # imm = 0x3FFF
ja 0x2aca1
movb %al, 0x2(%r15)
addq $0x3, %r15
jmp 0x2acc2
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 0x2aca5
movb %al, -0x1(%r15)
testb $0x10, %r12b
je 0x2ad28
cmpq %r15, (%rbx)
jbe 0x2b017
movl 0x58(%r14), %ecx
movb $0x38, (%r15)
cmpl $0x7f, %ecx
ja 0x2ace8
movb %cl, 0x1(%r15)
addq $0x2, %r15
jmp 0x2ad28
movl %ecx, %eax
orb $-0x80, %al
movb %al, 0x1(%r15)
movl %ecx, %eax
shrl $0x7, %eax
cmpl $0x3fff, %ecx           # imm = 0x3FFF
ja 0x2ad07
movb %al, 0x2(%r15)
addq $0x3, %r15
jmp 0x2ad28
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 0x2ad0b
movb %al, -0x1(%r15)
testb $0x20, %r12b
je 0x2ad8e
cmpq %r15, (%rbx)
jbe 0x2b02a
movl 0x5c(%r14), %ecx
movb $0x40, (%r15)
cmpl $0x7f, %ecx
ja 0x2ad4e
movb %cl, 0x1(%r15)
addq $0x2, %r15
jmp 0x2ad8e
movl %ecx, %eax
orb $-0x80, %al
movb %al, 0x1(%r15)
movl %ecx, %eax
shrl $0x7, %eax
cmpl $0x3fff, %ecx           # imm = 0x3FFF
ja 0x2ad6d
movb %al, 0x2(%r15)
addq $0x3, %r15
jmp 0x2ad8e
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 0x2ad71
movb %al, -0x1(%r15)
testb $0x40, %r12b
je 0x2adf4
cmpq %r15, (%rbx)
jbe 0x2b03d
movl 0x60(%r14), %ecx
movb $0x48, (%r15)
cmpl $0x7f, %ecx
ja 0x2adb4
movb %cl, 0x1(%r15)
addq $0x2, %r15
jmp 0x2adf4
movl %ecx, %eax
orb $-0x80, %al
movb %al, 0x1(%r15)
movl %ecx, %eax
shrl $0x7, %eax
cmpl $0x3fff, %ecx           # imm = 0x3FFF
ja 0x2add3
movb %al, 0x2(%r15)
addq $0x3, %r15
jmp 0x2adf4
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 0x2add7
movb %al, -0x1(%r15)
testb %r12b, %r12b
jns 0x2ae59
cmpq %r15, (%rbx)
jbe 0x2b050
movl 0x64(%r14), %ecx
movb $0x50, (%r15)
cmpl $0x7f, %ecx
ja 0x2ae19
movb %cl, 0x1(%r15)
addq $0x2, %r15
jmp 0x2ae59
movl %ecx, %eax
orb $-0x80, %al
movb %al, 0x1(%r15)
movl %ecx, %eax
shrl $0x7, %eax
cmpl $0x3fff, %ecx           # imm = 0x3FFF
ja 0x2ae38
movb %al, 0x2(%r15)
addq $0x3, %r15
jmp 0x2ae59
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 0x2ae3c
movb %al, -0x1(%r15)
btl $0x8, %r12d
jae 0x2aec0
cmpq %r15, (%rbx)
jbe 0x2b063
movl 0x68(%r14), %ecx
movb $0x58, (%r15)
cmpl $0x7f, %ecx
ja 0x2ae80
movb %cl, 0x1(%r15)
addq $0x2, %r15
jmp 0x2aec0
movl %ecx, %eax
orb $-0x80, %al
movb %al, 0x1(%r15)
movl %ecx, %eax
shrl $0x7, %eax
cmpl $0x3fff, %ecx           # imm = 0x3FFF
ja 0x2ae9f
movb %al, 0x2(%r15)
addq $0x3, %r15
jmp 0x2aec0
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 0x2aea3
movb %al, -0x1(%r15)
btl $0x9, %r12d
jae 0x2af27
cmpq %r15, (%rbx)
jbe 0x2b076
movl 0x6c(%r14), %ecx
movb $0x60, (%r15)
cmpl $0x7f, %ecx
ja 0x2aee7
movb %cl, 0x1(%r15)
addq $0x2, %r15
jmp 0x2af27
movl %ecx, %eax
orb $-0x80, %al
movb %al, 0x1(%r15)
movl %ecx, %eax
shrl $0x7, %eax
cmpl $0x3fff, %ecx           # imm = 0x3FFF
ja 0x2af06
movb %al, 0x2(%r15)
addq $0x3, %r15
jmp 0x2af27
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 0x2af0a
movb %al, -0x1(%r15)
btl $0xa, %r12d
jae 0x2af8e
cmpq %r15, (%rbx)
jbe 0x2b089
movl 0x70(%r14), %ecx
movb $0x68, (%r15)
cmpl $0x7f, %ecx
ja 0x2af4e
movb %cl, 0x1(%r15)
addq $0x2, %r15
jmp 0x2af8e
movl %ecx, %eax
orb $-0x80, %al
movb %al, 0x1(%r15)
movl %ecx, %eax
shrl $0x7, %eax
cmpl $0x3fff, %ecx           # imm = 0x3FFF
ja 0x2af6d
movb %al, 0x2(%r15)
addq $0x3, %r15
jmp 0x2af8e
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 0x2af71
movb %al, -0x1(%r15)
movq 0x8(%r14), %rdi
testb $0x1, %dil
jne 0x2afaa
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 0xb230
movq %rbx, %rdi
movq %r15, %rsi
callq 0xb750
movq %rax, %r15
jmp 0x2a9c9
movq %rbx, %rdi
movq %r15, %rsi
callq 0xb750
movq %rax, %r15
jmp 0x2aa37
movq %rbx, %rdi
movq %r15, %rsi
callq 0xb750
movq %rax, %r15
jmp 0x2ac05
movq %rbx, %rdi
movq %r15, %rsi
callq 0xb750
movq %rax, %r15
jmp 0x2ac6b
movq %rbx, %rdi
movq %r15, %rsi
callq 0xb750
movq %rax, %r15
jmp 0x2acd1
movq %rbx, %rdi
movq %r15, %rsi
callq 0xb750
movq %rax, %r15
jmp 0x2ad37
movq %rbx, %rdi
movq %r15, %rsi
callq 0xb750
movq %rax, %r15
jmp 0x2ad9d
movq %rbx, %rdi
movq %r15, %rsi
callq 0xb750
movq %rax, %r15
jmp 0x2ae02
movq %rbx, %rdi
movq %r15, %rsi
callq 0xb750
movq %rax, %r15
jmp 0x2ae69
movq %rbx, %rdi
movq %r15, %rsi
callq 0xb750
movq %rax, %r15
jmp 0x2aed0
movq %rbx, %rdi
movq %r15, %rsi
callq 0xb750
movq %rax, %r15
jmp 0x2af37