// File: 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
subq $0x240, %rsp            # imm = 0x240
movq %rdi, -0x210(%rbp)
movq %rsi, -0x218(%rbp)
movq %rdx, -0x220(%rbp)
movq -0x210(%rbp), %rax
movq %rax, -0x230(%rbp)
movl $0x0, -0x224(%rbp)
addq $0x10, %rax
movq %rax, -0x200(%rbp)
movl $0x0, -0x204(%rbp)
movq -0x200(%rbp), %rax
movslq -0x204(%rbp), %rcx
movl (%rax,%rcx,4), %eax
movl %eax, -0x224(%rbp)
movl -0x224(%rbp), %eax
andl $0x2, %eax
cmpl $0x0, %eax
je 0x54947
movq -0x220(%rbp), %rdi
movq -0x218(%rbp), %rsi
callq 0x5f2c0
movq -0x230(%rbp), %rdi
movq %rax, -0x218(%rbp)
callq 0x44760
movl %eax, %ecx
movq -0x218(%rbp), %rax
movl $0x1, -0x1ac(%rbp)
movl %ecx, -0x1b0(%rbp)
movq %rax, -0x1b8(%rbp)
movl -0x1ac(%rbp), %ecx
movq -0x1b8(%rbp), %rax
movl %ecx, -0x134(%rbp)
movl $0x0, -0x138(%rbp)
movq %rax, -0x140(%rbp)
movl -0x134(%rbp), %edi
movl -0x138(%rbp), %esi
callq 0x65ca0
movl %eax, %ecx
movq -0x140(%rbp), %rax
movl %ecx, -0x54(%rbp)
movq %rax, -0x60(%rbp)
movl -0x54(%rbp), %edi
movq -0x60(%rbp), %rsi
callq 0x65cc0
movq %rax, -0x1b8(%rbp)
movl -0x1b0(%rbp), %ecx
movq -0x1b8(%rbp), %rax
movl %ecx, -0xe4(%rbp)
movq %rax, -0xf0(%rbp)
movl -0xe4(%rbp), %edi
movq -0xf0(%rbp), %rsi
callq 0x65cc0
movq %rax, -0x218(%rbp)
movl -0x224(%rbp), %eax
andl $0x4, %eax
cmpl $0x0, %eax
je 0x54a2a
movq -0x220(%rbp), %rdi
movq -0x218(%rbp), %rsi
callq 0x5f2c0
movq -0x230(%rbp), %rdi
movq %rax, -0x218(%rbp)
callq 0x44780
movl %eax, %ecx
movq -0x218(%rbp), %rax
movl $0x2, -0x1bc(%rbp)
movl %ecx, -0x1c0(%rbp)
movq %rax, -0x1c8(%rbp)
movl -0x1bc(%rbp), %ecx
movq -0x1c8(%rbp), %rax
movl %ecx, -0x124(%rbp)
movl $0x0, -0x128(%rbp)
movq %rax, -0x130(%rbp)
movl -0x124(%rbp), %edi
movl -0x128(%rbp), %esi
callq 0x65ca0
movl %eax, %ecx
movq -0x130(%rbp), %rax
movl %ecx, -0x64(%rbp)
movq %rax, -0x70(%rbp)
movl -0x64(%rbp), %edi
movq -0x70(%rbp), %rsi
callq 0x65cc0
movq %rax, -0x1c8(%rbp)
movl -0x1c0(%rbp), %ecx
movq -0x1c8(%rbp), %rax
movl %ecx, -0xd4(%rbp)
movq %rax, -0xe0(%rbp)
movl -0xd4(%rbp), %edi
movq -0xe0(%rbp), %rsi
callq 0x65cc0
movq %rax, -0x218(%rbp)
movl -0x224(%rbp), %eax
andl $0x8, %eax
cmpl $0x0, %eax
je 0x54b0d
movq -0x220(%rbp), %rdi
movq -0x218(%rbp), %rsi
callq 0x5f2c0
movq -0x230(%rbp), %rdi
movq %rax, -0x218(%rbp)
callq 0x447a0
movl %eax, %ecx
movq -0x218(%rbp), %rax
movl $0x3, -0x1cc(%rbp)
movl %ecx, -0x1d0(%rbp)
movq %rax, -0x1d8(%rbp)
movl -0x1cc(%rbp), %ecx
movq -0x1d8(%rbp), %rax
movl %ecx, -0x114(%rbp)
movl $0x0, -0x118(%rbp)
movq %rax, -0x120(%rbp)
movl -0x114(%rbp), %edi
movl -0x118(%rbp), %esi
callq 0x65ca0
movl %eax, %ecx
movq -0x120(%rbp), %rax
movl %ecx, -0x74(%rbp)
movq %rax, -0x80(%rbp)
movl -0x74(%rbp), %edi
movq -0x80(%rbp), %rsi
callq 0x65cc0
movq %rax, -0x1d8(%rbp)
movl -0x1d0(%rbp), %ecx
movq -0x1d8(%rbp), %rax
movl %ecx, -0xc4(%rbp)
movq %rax, -0xd0(%rbp)
movl -0xc4(%rbp), %edi
movq -0xd0(%rbp), %rsi
callq 0x65cc0
movq %rax, -0x218(%rbp)
movl -0x224(%rbp), %eax
andl $0x1, %eax
cmpl $0x0, %eax
je 0x54b57
movq -0x230(%rbp), %rdi
movq -0x220(%rbp), %rax
movq %rax, -0x238(%rbp)
callq 0x447c0
movq -0x238(%rbp), %rdi
movq %rax, %rdx
movq -0x218(%rbp), %rcx
movl $0x4, %esi
callq 0x61e00
movq %rax, -0x218(%rbp)
movl -0x224(%rbp), %eax
andl $0x10, %eax
cmpl $0x0, %eax
je 0x54c46
movq -0x220(%rbp), %rdi
movq -0x218(%rbp), %rsi
callq 0x5f2c0
movq -0x230(%rbp), %rdi
movq %rax, -0x218(%rbp)
callq 0x44800
movl %eax, %ecx
movq -0x218(%rbp), %rax
movl $0x5, -0x1dc(%rbp)
movl %ecx, -0x1e0(%rbp)
movq %rax, -0x1e8(%rbp)
movl -0x1dc(%rbp), %ecx
movq -0x1e8(%rbp), %rax
movl %ecx, -0x104(%rbp)
movl $0x0, -0x108(%rbp)
movq %rax, -0x110(%rbp)
movl -0x104(%rbp), %edi
movl -0x108(%rbp), %esi
callq 0x65ca0
movl %eax, %ecx
movq -0x110(%rbp), %rax
movl %ecx, -0x84(%rbp)
movq %rax, -0x90(%rbp)
movl -0x84(%rbp), %edi
movq -0x90(%rbp), %rsi
callq 0x65cc0
movq %rax, -0x1e8(%rbp)
movl -0x1e0(%rbp), %ecx
movq -0x1e8(%rbp), %rax
movl %ecx, -0xb4(%rbp)
movq %rax, -0xc0(%rbp)
movl -0xb4(%rbp), %edi
movq -0xc0(%rbp), %rsi
callq 0x65cc0
movq %rax, -0x218(%rbp)
movl -0x224(%rbp), %eax
andl $0x20, %eax
cmpl $0x0, %eax
je 0x54d35
movq -0x220(%rbp), %rdi
movq -0x218(%rbp), %rsi
callq 0x5f2c0
movq -0x230(%rbp), %rdi
movq %rax, -0x218(%rbp)
callq 0x44820
movl %eax, %ecx
movq -0x218(%rbp), %rax
movl $0x6, -0x1ec(%rbp)
movl %ecx, -0x1f0(%rbp)
movq %rax, -0x1f8(%rbp)
movl -0x1ec(%rbp), %ecx
movq -0x1f8(%rbp), %rax
movl %ecx, -0xf4(%rbp)
movl $0x0, -0xf8(%rbp)
movq %rax, -0x100(%rbp)
movl -0xf4(%rbp), %edi
movl -0xf8(%rbp), %esi
callq 0x65ca0
movl %eax, %ecx
movq -0x100(%rbp), %rax
movl %ecx, -0x94(%rbp)
movq %rax, -0xa0(%rbp)
movl -0x94(%rbp), %edi
movq -0xa0(%rbp), %rsi
callq 0x65cc0
movq %rax, -0x1f8(%rbp)
movl -0x1f0(%rbp), %ecx
movq -0x1f8(%rbp), %rax
movl %ecx, -0xa4(%rbp)
movq %rax, -0xb0(%rbp)
movl -0xa4(%rbp), %edi
movq -0xb0(%rbp), %rsi
callq 0x65cc0
movq %rax, -0x218(%rbp)
movl -0x224(%rbp), %eax
andl $0x40, %eax
cmpl $0x0, %eax
je 0x54e1f
movq -0x220(%rbp), %rdi
movq -0x218(%rbp), %rsi
callq 0x5f2c0
movq -0x230(%rbp), %rdi
movq %rax, -0x218(%rbp)
callq 0x44840
movb %al, %cl
movq -0x218(%rbp), %rax
movl $0x7, -0x164(%rbp)
andb $0x1, %cl
movb %cl, -0x165(%rbp)
movq %rax, -0x170(%rbp)
movl -0x164(%rbp), %ecx
movq -0x170(%rbp), %rax
movl %ecx, -0x154(%rbp)
movl $0x0, -0x158(%rbp)
movq %rax, -0x160(%rbp)
movl -0x154(%rbp), %edi
movl -0x158(%rbp), %esi
callq 0x65ca0
movl %eax, %ecx
movq -0x160(%rbp), %rax
movl %ecx, -0x34(%rbp)
movq %rax, -0x40(%rbp)
movl -0x34(%rbp), %edi
movq -0x40(%rbp), %rsi
callq 0x65cc0
movq %rax, -0x170(%rbp)
movb -0x165(%rbp), %cl
movq -0x170(%rbp), %rax
andb $0x1, %cl
movb %cl, -0x11(%rbp)
movq %rax, -0x20(%rbp)
movb -0x11(%rbp), %cl
xorl %edi, %edi
movl $0x1, %eax
testb $0x1, %cl
cmovnel %eax, %edi
movq -0x20(%rbp), %rsi
callq 0x65cc0
movq %rax, -0x218(%rbp)
movl -0x224(%rbp), %eax
andl $0x80, %eax
cmpl $0x0, %eax
je 0x54f0b
movq -0x220(%rbp), %rdi
movq -0x218(%rbp), %rsi
callq 0x5f2c0
movq -0x230(%rbp), %rdi
movq %rax, -0x218(%rbp)
callq 0x44860
movb %al, %cl
movq -0x218(%rbp), %rax
movl $0x8, -0x174(%rbp)
andb $0x1, %cl
movb %cl, -0x175(%rbp)
movq %rax, -0x180(%rbp)
movl -0x174(%rbp), %ecx
movq -0x180(%rbp), %rax
movl %ecx, -0x144(%rbp)
movl $0x0, -0x148(%rbp)
movq %rax, -0x150(%rbp)
movl -0x144(%rbp), %edi
movl -0x148(%rbp), %esi
callq 0x65ca0
movl %eax, %ecx
movq -0x150(%rbp), %rax
movl %ecx, -0x44(%rbp)
movq %rax, -0x50(%rbp)
movl -0x44(%rbp), %edi
movq -0x50(%rbp), %rsi
callq 0x65cc0
movq %rax, -0x180(%rbp)
movb -0x175(%rbp), %cl
movq -0x180(%rbp), %rax
andb $0x1, %cl
movb %cl, -0x1(%rbp)
movq %rax, -0x10(%rbp)
movb -0x1(%rbp), %cl
xorl %edi, %edi
movl $0x1, %eax
testb $0x1, %cl
cmovnel %eax, %edi
movq -0x10(%rbp), %rsi
callq 0x65cc0
movq %rax, -0x218(%rbp)
movq -0x230(%rbp), %rax
addq $0x8, %rax
movq %rax, -0x1a8(%rbp)
movq -0x1a8(%rbp), %rax
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rax
movq (%rax), %rax
andq $0x1, %rax
cmpl $0x1, %eax
jne 0x54fd3
movq -0x230(%rbp), %rax
addq $0x8, %rax
movq %rax, -0x198(%rbp)
movq 0x3d02b(%rip), %rax     # 0x91f80
movq %rax, -0x1a0(%rbp)
movq -0x198(%rbp), %rax
movq %rax, -0x240(%rbp)
movq %rax, -0x188(%rbp)
movq -0x188(%rbp), %rax
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rax
movq (%rax), %rax
andq $0x1, %rax
cmpl $0x1, %eax
jne 0x54fa5
movq -0x240(%rbp), %rdi
callq 0x66310
addq $0x8, %rax
movq %rax, -0x190(%rbp)
jmp 0x54fb2
callq *-0x1a0(%rbp)
movq %rax, -0x190(%rbp)
movq -0x190(%rbp), %rdi
movq -0x218(%rbp), %rsi
movq -0x220(%rbp), %rdx
callq 0xe3b0
movq %rax, -0x218(%rbp)
movq -0x218(%rbp), %rax
addq $0x240, %rsp            # imm = 0x240
popq %rbp
retq
nopw %cs:(%rax,%rax)