// File: /workspace/github_cpp_makefile_star2_O2/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 %rdi, %r14
movl 0x18(%rdi), %r13d
xorl %r15d, %r15d
testl %r13d, %r13d
cmovlel %r15d, %r13d
cmpl %r15d, %r13d
je 0x201fb
movq %rbx, %rdi
callq 0x2682a
movq %rax, %r12
movq %r14, %rdi
movl %r15d, %esi
callq 0x15220
movb $0x8, (%r12)
incq %r12
movl %eax, %edi
movq %r12, %rsi
callq 0x28e5c
movq %rax, %rsi
incl %r15d
jmp 0x201c6
movl 0x10(%r14), %r12d
testb $0x10, %r12b
je 0x20220
movq %rbx, %rdi
callq 0x2682a
movl 0x48(%r14), %edi
movb $0x10, (%rax)
leaq 0x1(%rax), %rsi
callq 0x28e5c
movq %rax, %rsi
testb $0x20, %r12b
je 0x20241
movq %rbx, %rdi
callq 0x2682a
movl 0x4c(%r14), %edi
movb $0x18, (%rax)
leaq 0x1(%rax), %rsi
callq 0x28e5c
movq %rax, %rsi
testb $0x40, %r12b
je 0x20262
movq %rbx, %rdi
callq 0x2682a
movl 0x50(%r14), %edi
movb $0x20, (%rax)
leaq 0x1(%rax), %rsi
callq 0x28e5c
movq %rax, %rsi
testb %r12b, %r12b
jns 0x20282
movq %rbx, %rdi
callq 0x2682a
movl 0x54(%r14), %edi
movb $0x28, (%rax)
leaq 0x1(%rax), %rsi
callq 0x28e5c
movq %rax, %rsi
btl $0x8, %r12d
jae 0x202a4
movq %rbx, %rdi
callq 0x2682a
movl 0x58(%r14), %edi
movb $0x30, (%rax)
leaq 0x1(%rax), %rsi
callq 0x28e5c
movq %rax, %rsi
btl $0x9, %r12d
jae 0x202c6
movq %rbx, %rdi
callq 0x2682a
movl 0x5c(%r14), %edi
movb $0x38, (%rax)
leaq 0x1(%rax), %rsi
callq 0x28e5c
movq %rax, %rsi
btl $0xa, %r12d
jae 0x202e8
movq %rbx, %rdi
callq 0x2682a
movl 0x60(%r14), %edi
movb $0x40, (%rax)
leaq 0x1(%rax), %rsi
callq 0x28e5c
movq %rax, %rsi
btl $0xb, %r12d
jae 0x20308
movq %rbx, %rdi
callq 0x2682a
movq %rax, %rsi
movl 0x64(%r14), %eax
movb $0x4d, (%rsi)
movl %eax, 0x1(%rsi)
addq $0x5, %rsi
btl $0xc, %r12d
jae 0x20328
movq %rbx, %rdi
callq 0x2682a
movq %rax, %rsi
movl 0x68(%r14), %eax
movb $0x55, (%rsi)
movl %eax, 0x1(%rsi)
addq $0x5, %rsi
btl $0xd, %r12d
jae 0x2034a
movq %rbx, %rdi
callq 0x2682a
movl 0x6c(%r14), %edi
movb $0x58, (%rax)
leaq 0x1(%rax), %rsi
callq 0x28e5c
movq %rax, %rsi
testb $0x1, %r12b
je 0x2037f
movq %rbx, %rdi
callq 0x2682a
movq 0x28(%r14), %r15
movw $0x1a2, (%rax)          # imm = 0x1A2
leaq 0x2(%rax), %rsi
movl 0x14(%r15), %edi
callq 0x28e5c
movq %r15, %rdi
movq %rax, %rsi
movq %rbx, %rdx
callq 0x1e674
movq %rax, %rsi
testb $0x2, %r12b
je 0x203b4
movq %rbx, %rdi
callq 0x2682a
movq 0x30(%r14), %r15
movw $0x1aa, (%rax)          # imm = 0x1AA
leaq 0x2(%rax), %rsi
movl 0x14(%r15), %edi
callq 0x28e5c
movq %r15, %rdi
movq %rax, %rsi
movq %rbx, %rdx
callq 0x1e674
movq %rax, %rsi
testb $0x4, %r12b
je 0x203e9
movq %rbx, %rdi
callq 0x2682a
movq 0x38(%r14), %r15
movw $0x1b2, (%rax)          # imm = 0x1B2
leaq 0x2(%rax), %rsi
movl 0x14(%r15), %edi
callq 0x28e5c
movq %r15, %rdi
movq %rax, %rsi
movq %rbx, %rdx
callq 0x1ee94
movq %rax, %rsi
testb $0x8, %r12b
je 0x2041e
movq %rbx, %rdi
callq 0x2682a
movq 0x40(%r14), %r15
movw $0x1ba, (%rax)          # imm = 0x1BA
leaq 0x2(%rax), %rsi
movl 0x14(%r15), %edi
callq 0x28e5c
movq %r15, %rdi
movq %rax, %rsi
movq %rbx, %rdx
callq 0x1f5c0
movq %rax, %rsi
movq 0x8(%r14), %rdi
testb $0x1, %dil
jne 0x2043a
movq %rsi, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
andq $-0x2, %rdi
addq $0x8, %rdi
movq %rbx, %rdx
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0xb260