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

  cached_has_bits = _has_bits_[0];
  // optional uint32 bankSelectReg = 1;
  if (cached_has_bits & 0x00000002u) {
    target = stream->EnsureSpace(target);
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteUInt32ToArray(1, this->_internal_bankselectreg(), target);
  }

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

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

  // optional bytes bankRegister = 4;
  if (cached_has_bits & 0x00000001u) {
    target = stream->WriteBytesMaybeAliased(
        4, this->_internal_bankregister(), target);
  }

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

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

  // optional bool irqEnabled = 7;
  if (cached_has_bits & 0x00000040u) {
    target = stream->EnsureSpace(target);
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBoolToArray(7, this->_internal_irqenabled(), target);
  }

  // optional bool irqPending = 8;
  if (cached_has_bits & 0x00000080u) {
    target = stream->EnsureSpace(target);
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBoolToArray(8, this->_internal_irqpending(), 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.MmcState.Mmc3State)
  return target;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdx, %rbx
movq %rsi, %rax
movq %rdi, %r14
movl 0x10(%rdi), %r15d
testb $0x2, %r15b
je 0x2b7ea
cmpq %rax, (%rbx)
jbe 0x2b9fb
movl 0x20(%r14), %edx
movb $0x8, (%rax)
cmpl $0x7f, %edx
ja 0x2b7ab
movb %dl, 0x1(%rax)
addq $0x2, %rax
jmp 0x2b7ea
movl %edx, %ecx
orb $-0x80, %cl
movb %cl, 0x1(%rax)
movl %edx, %ecx
shrl $0x7, %ecx
cmpl $0x3fff, %edx           # imm = 0x3FFF
ja 0x2b7c9
movb %cl, 0x2(%rax)
addq $0x3, %rax
jmp 0x2b7ea
addq $0x3, %rax
movl %ecx, %edx
movl %edx, %esi
orb $-0x80, %sil
movb %sil, -0x1(%rax)
shrl $0x7, %ecx
incq %rax
cmpl $0x3fff, %edx           # imm = 0x3FFF
ja 0x2b7cd
movb %cl, -0x1(%rax)
testb $0x4, %r15b
je 0x2b84d
cmpq %rax, (%rbx)
jbe 0x2ba0b
movl 0x24(%r14), %edx
movb $0x10, (%rax)
cmpl $0x7f, %edx
ja 0x2b80e
movb %dl, 0x1(%rax)
addq $0x2, %rax
jmp 0x2b84d
movl %edx, %ecx
orb $-0x80, %cl
movb %cl, 0x1(%rax)
movl %edx, %ecx
shrl $0x7, %ecx
cmpl $0x3fff, %edx           # imm = 0x3FFF
ja 0x2b82c
movb %cl, 0x2(%rax)
addq $0x3, %rax
jmp 0x2b84d
addq $0x3, %rax
movl %ecx, %edx
movl %edx, %esi
orb $-0x80, %sil
movb %sil, -0x1(%rax)
shrl $0x7, %ecx
incq %rax
cmpl $0x3fff, %edx           # imm = 0x3FFF
ja 0x2b830
movb %cl, -0x1(%rax)
testb $0x8, %r15b
je 0x2b8b0
cmpq %rax, (%rbx)
jbe 0x2ba1b
movl 0x28(%r14), %edx
movb $0x18, (%rax)
cmpl $0x7f, %edx
ja 0x2b871
movb %dl, 0x1(%rax)
addq $0x2, %rax
jmp 0x2b8b0
movl %edx, %ecx
orb $-0x80, %cl
movb %cl, 0x1(%rax)
movl %edx, %ecx
shrl $0x7, %ecx
cmpl $0x3fff, %edx           # imm = 0x3FFF
ja 0x2b88f
movb %cl, 0x2(%rax)
addq $0x3, %rax
jmp 0x2b8b0
addq $0x3, %rax
movl %ecx, %edx
movl %edx, %esi
orb $-0x80, %sil
movb %sil, -0x1(%rax)
shrl $0x7, %ecx
incq %rax
cmpl $0x3fff, %edx           # imm = 0x3FFF
ja 0x2b893
movb %cl, -0x1(%rax)
testb $0x1, %r15b
je 0x2b8ca
movq 0x18(%r14), %rdx
movq %rbx, %rdi
movl $0x4, %esi
movq %rax, %rcx
callq 0x31864
testb $0x10, %r15b
je 0x2b92d
cmpq %rax, (%rbx)
jbe 0x2ba2b
movl 0x2c(%r14), %edx
movb $0x28, (%rax)
cmpl $0x7f, %edx
ja 0x2b8ee
movb %dl, 0x1(%rax)
addq $0x2, %rax
jmp 0x2b92d
movl %edx, %ecx
orb $-0x80, %cl
movb %cl, 0x1(%rax)
movl %edx, %ecx
shrl $0x7, %ecx
cmpl $0x3fff, %edx           # imm = 0x3FFF
ja 0x2b90c
movb %cl, 0x2(%rax)
addq $0x3, %rax
jmp 0x2b92d
addq $0x3, %rax
movl %ecx, %edx
movl %edx, %esi
orb $-0x80, %sil
movb %sil, -0x1(%rax)
shrl $0x7, %ecx
incq %rax
cmpl $0x3fff, %edx           # imm = 0x3FFF
ja 0x2b910
movb %cl, -0x1(%rax)
testb $0x20, %r15b
je 0x2b990
cmpq %rax, (%rbx)
jbe 0x2ba3b
movl 0x30(%r14), %edx
movb $0x30, (%rax)
cmpl $0x7f, %edx
ja 0x2b951
movb %dl, 0x1(%rax)
addq $0x2, %rax
jmp 0x2b990
movl %edx, %ecx
orb $-0x80, %cl
movb %cl, 0x1(%rax)
movl %edx, %ecx
shrl $0x7, %ecx
cmpl $0x3fff, %edx           # imm = 0x3FFF
ja 0x2b96f
movb %cl, 0x2(%rax)
addq $0x3, %rax
jmp 0x2b990
addq $0x3, %rax
movl %ecx, %edx
movl %edx, %esi
orb $-0x80, %sil
movb %sil, -0x1(%rax)
shrl $0x7, %ecx
incq %rax
cmpl $0x3fff, %edx           # imm = 0x3FFF
ja 0x2b973
movb %cl, -0x1(%rax)
testb $0x40, %r15b
je 0x2b9ad
cmpq %rax, (%rbx)
jbe 0x2ba4b
movb 0x34(%r14), %cl
movb $0x38, (%rax)
movb %cl, 0x1(%rax)
addq $0x2, %rax
testb %r15b, %r15b
jns 0x2b9c9
cmpq %rax, (%rbx)
jbe 0x2ba5b
movb 0x35(%r14), %cl
movb $0x40, (%rax)
movb %cl, 0x1(%rax)
addq $0x2, %rax
movq 0x8(%r14), %rdi
testb $0x1, %dil
jne 0x2b9de
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
andq $-0x2, %rdi
addq $0x8, %rdi
movq %rax, %rsi
movq %rbx, %rdx
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0xa230
movq %rbx, %rdi
movq %rax, %rsi
callq 0xa750
jmp 0x2b796
movq %rbx, %rdi
movq %rax, %rsi
callq 0xa750
jmp 0x2b7f9
movq %rbx, %rdi
movq %rax, %rsi
callq 0xa750
jmp 0x2b85c
movq %rbx, %rdi
movq %rax, %rsi
callq 0xa750
jmp 0x2b8d9
movq %rbx, %rdi
movq %rax, %rsi
callq 0xa750
jmp 0x2b93c
movq %rbx, %rdi
movq %rax, %rsi
callq 0xa750
jmp 0x2b99f
movq %rbx, %rdi
movq %rax, %rsi
callq 0xa750
jmp 0x2b9bb
nop