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

  // repeated uint32 reg = 1;
  for (int i = 0, n = this->_internal_reg_size(); i < n; i++) {
    target = stream->EnsureSpace(target);
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteUInt32ToArray(1, this->_internal_reg(i), target);
  }

  cached_has_bits = _has_bits_[0];
  // optional uint32 sampleRate = 2;
  if (cached_has_bits & 0x00000010u) {
    target = stream->EnsureSpace(target);
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteUInt32ToArray(2, this->_internal_samplerate(), target);
  }

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

  // optional uint32 fiveFrameCount = 4;
  if (cached_has_bits & 0x00000040u) {
    target = stream->EnsureSpace(target);
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteUInt32ToArray(4, this->_internal_fiveframecount(), target);
  }

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

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

  // optional uint32 halfTimerDivider = 7;
  if (cached_has_bits & 0x00000200u) {
    target = stream->EnsureSpace(target);
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteUInt32ToArray(7, this->_internal_halftimerdivider(), target);
  }

  // optional uint32 samplerDivider = 8;
  if (cached_has_bits & 0x00000400u) {
    target = stream->EnsureSpace(target);
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteUInt32ToArray(8, this->_internal_samplerdivider(), target);
  }

  // optional float clksPerSample = 9;
  if (cached_has_bits & 0x00000800u) {
    target = stream->EnsureSpace(target);
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteFloatToArray(9, this->_internal_clkspersample(), target);
  }

  // optional float currentSampleClk = 10;
  if (cached_has_bits & 0x00001000u) {
    target = stream->EnsureSpace(target);
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteFloatToArray(10, this->_internal_currentsampleclk(), target);
  }

  // optional uint32 nextSampleCountdown = 11;
  if (cached_has_bits & 0x00002000u) {
    target = stream->EnsureSpace(target);
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteUInt32ToArray(11, this->_internal_nextsamplecountdown(), target);
  }

  // optional .Rnes.PulseState pulseA = 20;
  if (cached_has_bits & 0x00000001u) {
    target = stream->EnsureSpace(target);
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
      InternalWriteMessage(
        20, _Internal::pulsea(this), target, stream);
  }

  // optional .Rnes.PulseState pulseB = 21;
  if (cached_has_bits & 0x00000002u) {
    target = stream->EnsureSpace(target);
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
      InternalWriteMessage(
        21, _Internal::pulseb(this), target, stream);
  }

  // optional .Rnes.TriangleState triangle = 22;
  if (cached_has_bits & 0x00000004u) {
    target = stream->EnsureSpace(target);
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
      InternalWriteMessage(
        22, _Internal::triangle(this), target, stream);
  }

  // optional .Rnes.NoiseState noise = 23;
  if (cached_has_bits & 0x00000008u) {
    target = stream->EnsureSpace(target);
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
      InternalWriteMessage(
        23, _Internal::noise(this), target, stream);
  }

  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.ApuState)
  return target;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %rbx
movq %rsi, %r15
movl 0x18(%rdi), %r14d
testl %r14d, %r14d
movq %rdi, -0x30(%rbp)
jle 0x2889f
leaq 0x18(%rdi), %r12
xorl %r13d, %r13d
cmpq %r15, (%rbx)
jbe 0x2888f
movq %r12, %rdi
movl %r13d, %esi
callq 0xb720
movl (%rax), %ecx
movb $0x8, (%r15)
cmpl $0x7f, %ecx
ja 0x28845
movb %cl, 0x1(%r15)
addq $0x2, %r15
jmp 0x28885
movl %ecx, %eax
orb $-0x80, %al
movb %al, 0x1(%r15)
movl %ecx, %eax
shrl $0x7, %eax
cmpl $0x3fff, %ecx           # imm = 0x3FFF
ja 0x28864
movb %al, 0x2(%r15)
addq $0x3, %r15
jmp 0x28885
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 0x28868
movb %al, -0x1(%r15)
incl %r13d
cmpl %r14d, %r13d
jne 0x28820
jmp 0x2889f
movq %rbx, %rdi
movq %r15, %rsi
callq 0xb750
movq %rax, %r15
jmp 0x28825
movq -0x30(%rbp), %r14
movl 0x10(%r14), %r12d
testb $0x10, %r12b
je 0x2890d
cmpq %r15, (%rbx)
jbe 0x28e3b
movl 0x48(%r14), %ecx
movb $0x10, (%r15)
cmpl $0x7f, %ecx
ja 0x288cd
movb %cl, 0x1(%r15)
addq $0x2, %r15
jmp 0x2890d
movl %ecx, %eax
orb $-0x80, %al
movb %al, 0x1(%r15)
movl %ecx, %eax
shrl $0x7, %eax
cmpl $0x3fff, %ecx           # imm = 0x3FFF
ja 0x288ec
movb %al, 0x2(%r15)
addq $0x3, %r15
jmp 0x2890d
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 0x288f0
movb %al, -0x1(%r15)
testb $0x20, %r12b
je 0x28973
cmpq %r15, (%rbx)
jbe 0x28e4e
movl 0x4c(%r14), %ecx
movb $0x18, (%r15)
cmpl $0x7f, %ecx
ja 0x28933
movb %cl, 0x1(%r15)
addq $0x2, %r15
jmp 0x28973
movl %ecx, %eax
orb $-0x80, %al
movb %al, 0x1(%r15)
movl %ecx, %eax
shrl $0x7, %eax
cmpl $0x3fff, %ecx           # imm = 0x3FFF
ja 0x28952
movb %al, 0x2(%r15)
addq $0x3, %r15
jmp 0x28973
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 0x28956
movb %al, -0x1(%r15)
testb $0x40, %r12b
je 0x289d9
cmpq %r15, (%rbx)
jbe 0x28e61
movl 0x50(%r14), %ecx
movb $0x20, (%r15)
cmpl $0x7f, %ecx
ja 0x28999
movb %cl, 0x1(%r15)
addq $0x2, %r15
jmp 0x289d9
movl %ecx, %eax
orb $-0x80, %al
movb %al, 0x1(%r15)
movl %ecx, %eax
shrl $0x7, %eax
cmpl $0x3fff, %ecx           # imm = 0x3FFF
ja 0x289b8
movb %al, 0x2(%r15)
addq $0x3, %r15
jmp 0x289d9
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 0x289bc
movb %al, -0x1(%r15)
testb %r12b, %r12b
jns 0x28a3e
cmpq %r15, (%rbx)
jbe 0x28e74
movl 0x54(%r14), %ecx
movb $0x28, (%r15)
cmpl $0x7f, %ecx
ja 0x289fe
movb %cl, 0x1(%r15)
addq $0x2, %r15
jmp 0x28a3e
movl %ecx, %eax
orb $-0x80, %al
movb %al, 0x1(%r15)
movl %ecx, %eax
shrl $0x7, %eax
cmpl $0x3fff, %ecx           # imm = 0x3FFF
ja 0x28a1d
movb %al, 0x2(%r15)
addq $0x3, %r15
jmp 0x28a3e
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 0x28a21
movb %al, -0x1(%r15)
btl $0x8, %r12d
jae 0x28aa5
cmpq %r15, (%rbx)
jbe 0x28e87
movl 0x58(%r14), %ecx
movb $0x30, (%r15)
cmpl $0x7f, %ecx
ja 0x28a65
movb %cl, 0x1(%r15)
addq $0x2, %r15
jmp 0x28aa5
movl %ecx, %eax
orb $-0x80, %al
movb %al, 0x1(%r15)
movl %ecx, %eax
shrl $0x7, %eax
cmpl $0x3fff, %ecx           # imm = 0x3FFF
ja 0x28a84
movb %al, 0x2(%r15)
addq $0x3, %r15
jmp 0x28aa5
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 0x28a88
movb %al, -0x1(%r15)
btl $0x9, %r12d
jae 0x28b0c
cmpq %r15, (%rbx)
jbe 0x28e9a
movl 0x5c(%r14), %ecx
movb $0x38, (%r15)
cmpl $0x7f, %ecx
ja 0x28acc
movb %cl, 0x1(%r15)
addq $0x2, %r15
jmp 0x28b0c
movl %ecx, %eax
orb $-0x80, %al
movb %al, 0x1(%r15)
movl %ecx, %eax
shrl $0x7, %eax
cmpl $0x3fff, %ecx           # imm = 0x3FFF
ja 0x28aeb
movb %al, 0x2(%r15)
addq $0x3, %r15
jmp 0x28b0c
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 0x28aef
movb %al, -0x1(%r15)
btl $0xa, %r12d
jae 0x28b73
cmpq %r15, (%rbx)
jbe 0x28ead
movl 0x60(%r14), %ecx
movb $0x40, (%r15)
cmpl $0x7f, %ecx
ja 0x28b33
movb %cl, 0x1(%r15)
addq $0x2, %r15
jmp 0x28b73
movl %ecx, %eax
orb $-0x80, %al
movb %al, 0x1(%r15)
movl %ecx, %eax
shrl $0x7, %eax
cmpl $0x3fff, %ecx           # imm = 0x3FFF
ja 0x28b52
movb %al, 0x2(%r15)
addq $0x3, %r15
jmp 0x28b73
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 0x28b56
movb %al, -0x1(%r15)
btl $0xb, %r12d
jae 0x28b93
cmpq %r15, (%rbx)
jbe 0x28ec0
movl 0x64(%r14), %eax
movb $0x4d, (%r15)
movl %eax, 0x1(%r15)
addq $0x5, %r15
btl $0xc, %r12d
jae 0x28bb3
cmpq %r15, (%rbx)
jbe 0x28ed3
movl 0x68(%r14), %eax
movb $0x55, (%r15)
movl %eax, 0x1(%r15)
addq $0x5, %r15
btl $0xd, %r12d
jae 0x28c1a
cmpq %r15, (%rbx)
jbe 0x28ee6
movl 0x6c(%r14), %ecx
movb $0x58, (%r15)
cmpl $0x7f, %ecx
ja 0x28bda
movb %cl, 0x1(%r15)
addq $0x2, %r15
jmp 0x28c1a
movl %ecx, %eax
orb $-0x80, %al
movb %al, 0x1(%r15)
movl %ecx, %eax
shrl $0x7, %eax
cmpl $0x3fff, %ecx           # imm = 0x3FFF
ja 0x28bf9
movb %al, 0x2(%r15)
addq $0x3, %r15
jmp 0x28c1a
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 0x28bfd
movb %al, -0x1(%r15)
testb $0x1, %r12b
je 0x28c93
cmpq %r15, (%rbx)
jbe 0x28ef9
movq 0x28(%r14), %rdi
movw $0x1a2, (%r15)          # imm = 0x1A2
movl 0x14(%rdi), %ecx
cmpl $0x7f, %ecx
ja 0x28c45
movb %cl, 0x2(%r15)
addq $0x3, %r15
jmp 0x28c85
movl %ecx, %eax
orb $-0x80, %al
movb %al, 0x2(%r15)
movl %ecx, %eax
shrl $0x7, %eax
cmpl $0x3fff, %ecx           # imm = 0x3FFF
ja 0x28c64
movb %al, 0x3(%r15)
addq $0x4, %r15
jmp 0x28c85
addq $0x4, %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 0x28c68
movb %al, -0x1(%r15)
movq %r15, %rsi
movq %rbx, %rdx
callq 0x25c3a
movq %rax, %r15
testb $0x2, %r12b
je 0x28d0c
cmpq %r15, (%rbx)
jbe 0x28f0c
movq 0x30(%r14), %rdi
movw $0x1aa, (%r15)          # imm = 0x1AA
movl 0x14(%rdi), %ecx
cmpl $0x7f, %ecx
ja 0x28cbe
movb %cl, 0x2(%r15)
addq $0x3, %r15
jmp 0x28cfe
movl %ecx, %eax
orb $-0x80, %al
movb %al, 0x2(%r15)
movl %ecx, %eax
shrl $0x7, %eax
cmpl $0x3fff, %ecx           # imm = 0x3FFF
ja 0x28cdd
movb %al, 0x3(%r15)
addq $0x4, %r15
jmp 0x28cfe
addq $0x4, %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 0x28ce1
movb %al, -0x1(%r15)
movq %r15, %rsi
movq %rbx, %rdx
callq 0x25c3a
movq %rax, %r15
testb $0x4, %r12b
je 0x28d85
cmpq %r15, (%rbx)
jbe 0x28f1f
movq 0x38(%r14), %rdi
movw $0x1b2, (%r15)          # imm = 0x1B2
movl 0x14(%rdi), %ecx
cmpl $0x7f, %ecx
ja 0x28d37
movb %cl, 0x2(%r15)
addq $0x3, %r15
jmp 0x28d77
movl %ecx, %eax
orb $-0x80, %al
movb %al, 0x2(%r15)
movl %ecx, %eax
shrl $0x7, %eax
cmpl $0x3fff, %ecx           # imm = 0x3FFF
ja 0x28d56
movb %al, 0x3(%r15)
addq $0x4, %r15
jmp 0x28d77
addq $0x4, %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 0x28d5a
movb %al, -0x1(%r15)
movq %r15, %rsi
movq %rbx, %rdx
callq 0x26900
movq %rax, %r15
testb $0x8, %r12b
je 0x28dfe
cmpq %r15, (%rbx)
jbe 0x28f32
movq 0x40(%r14), %rdi
movw $0x1ba, (%r15)          # imm = 0x1BA
movl 0x14(%rdi), %ecx
cmpl $0x7f, %ecx
ja 0x28db0
movb %cl, 0x2(%r15)
addq $0x3, %r15
jmp 0x28df0
movl %ecx, %eax
orb $-0x80, %al
movb %al, 0x2(%r15)
movl %ecx, %eax
shrl $0x7, %eax
cmpl $0x3fff, %ecx           # imm = 0x3FFF
ja 0x28dcf
movb %al, 0x3(%r15)
addq $0x4, %r15
jmp 0x28df0
addq $0x4, %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 0x28dd3
movb %al, -0x1(%r15)
movq %r15, %rsi
movq %rbx, %rdx
callq 0x27450
movq %rax, %r15
movq 0x8(%r14), %rdi
testb $0x1, %dil
jne 0x28e1a
movq %r15, %rax
addq $0x8, %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 $0x8, %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 0x288b6
movq %rbx, %rdi
movq %r15, %rsi
callq 0xb750
movq %rax, %r15
jmp 0x2891c
movq %rbx, %rdi
movq %r15, %rsi
callq 0xb750
movq %rax, %r15
jmp 0x28982
movq %rbx, %rdi
movq %r15, %rsi
callq 0xb750
movq %rax, %r15
jmp 0x289e7
movq %rbx, %rdi
movq %r15, %rsi
callq 0xb750
movq %rax, %r15
jmp 0x28a4e
movq %rbx, %rdi
movq %r15, %rsi
callq 0xb750
movq %rax, %r15
jmp 0x28ab5
movq %rbx, %rdi
movq %r15, %rsi
callq 0xb750
movq %rax, %r15
jmp 0x28b1c
movq %rbx, %rdi
movq %r15, %rsi
callq 0xb750
movq %rax, %r15
jmp 0x28b83
movq %rbx, %rdi
movq %r15, %rsi
callq 0xb750
movq %rax, %r15
jmp 0x28ba3
movq %rbx, %rdi
movq %r15, %rsi
callq 0xb750
movq %rax, %r15
jmp 0x28bc3
movq %rbx, %rdi
movq %r15, %rsi
callq 0xb750
movq %rax, %r15
jmp 0x28c29
movq %rbx, %rdi
movq %r15, %rsi
callq 0xb750
movq %rax, %r15
jmp 0x28ca2
movq %rbx, %rdi
movq %r15, %rsi
callq 0xb750
movq %rax, %r15
jmp 0x28d1b
movq %rbx, %rdi
movq %r15, %rsi
callq 0xb750
movq %rax, %r15
jmp 0x28d94
nop