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

  cached_has_bits = _has_bits_[0];
  // optional bytes patternTableMemory = 1;
  if (cached_has_bits & 0x00000001u) {
    target = stream->WriteBytesMaybeAliased(
        1, this->_internal_patterntablememory(), target);
  }

  // optional bytes nameTableMemory = 2;
  if (cached_has_bits & 0x00000002u) {
    target = stream->WriteBytesMaybeAliased(
        2, this->_internal_nametablememory(), target);
  }

  // optional bytes paletteMemory = 3;
  if (cached_has_bits & 0x00000004u) {
    target = stream->WriteBytesMaybeAliased(
        3, this->_internal_palettememory(), 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.VideoMemoryState)
  return target;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x90, %rsp
movq %rdi, -0x50(%rbp)
movq %rsi, -0x58(%rbp)
movq %rdx, -0x60(%rbp)
movq -0x50(%rbp), %rax
movq %rax, -0x70(%rbp)
movl $0x0, -0x64(%rbp)
addq $0x10, %rax
movq %rax, -0x40(%rbp)
movl $0x0, -0x44(%rbp)
movq -0x40(%rbp), %rax
movslq -0x44(%rbp), %rcx
movl (%rax,%rcx,4), %eax
movl %eax, -0x64(%rbp)
movl -0x64(%rbp), %eax
andl $0x1, %eax
cmpl $0x0, %eax
je 0x597f8
movq -0x70(%rbp), %rdi
movq -0x60(%rbp), %rax
movq %rax, -0x78(%rbp)
callq 0x45900
movq -0x78(%rbp), %rdi
movq %rax, %rdx
movq -0x58(%rbp), %rcx
movl $0x1, %esi
callq 0x61e00
movq %rax, -0x58(%rbp)
movl -0x64(%rbp), %eax
andl $0x2, %eax
cmpl $0x0, %eax
je 0x5982d
movq -0x70(%rbp), %rdi
movq -0x60(%rbp), %rax
movq %rax, -0x80(%rbp)
callq 0x45920
movq -0x80(%rbp), %rdi
movq %rax, %rdx
movq -0x58(%rbp), %rcx
movl $0x2, %esi
callq 0x61e00
movq %rax, -0x58(%rbp)
movl -0x64(%rbp), %eax
andl $0x4, %eax
cmpl $0x0, %eax
je 0x59868
movq -0x70(%rbp), %rdi
movq -0x60(%rbp), %rax
movq %rax, -0x88(%rbp)
callq 0x45940
movq -0x88(%rbp), %rdi
movq %rax, %rdx
movq -0x58(%rbp), %rcx
movl $0x3, %esi
callq 0x61e00
movq %rax, -0x58(%rbp)
movq -0x70(%rbp), %rax
addq $0x8, %rax
movq %rax, -0x38(%rbp)
movq -0x38(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq (%rax), %rax
andq $0x1, %rax
cmpl $0x1, %eax
jne 0x598fc
movq -0x70(%rbp), %rax
addq $0x8, %rax
movq %rax, -0x28(%rbp)
movq 0x386e1(%rip), %rax     # 0x91f80
movq %rax, -0x30(%rbp)
movq -0x28(%rbp), %rax
movq %rax, -0x90(%rbp)
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rax
movq (%rax), %rax
andq $0x1, %rax
cmpl $0x1, %eax
jne 0x598e0
movq -0x90(%rbp), %rdi
callq 0x66310
addq $0x8, %rax
movq %rax, -0x20(%rbp)
jmp 0x598e7
callq *-0x30(%rbp)
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rdi
movq -0x58(%rbp), %rsi
movq -0x60(%rbp), %rdx
callq 0xe3b0
movq %rax, -0x58(%rbp)
movq -0x58(%rbp), %rax
addq $0x90, %rsp
popq %rbp
retq
nopl (%rax)