// File: /workspace/github_c_makefile_star2_O0/jonof[P]jfaudiolib/src/multivoc.c
// Function: MV_PlayLoopedRaw
int MV_PlayLoopedRaw
   (
   char *ptr,
   unsigned int length,
   char *loopstart,
   char *loopend,
   unsigned rate,
   int   pitchoffset,
   int   vol,
   int   left,
   int   right,
   int   priority,
   unsigned int callbackval
   )

   {
   VoiceNode *voice;

   if ( !MV_Installed )
      {
      MV_SetErrorCode( MV_NotInstalled );
      return( MV_Error );
      }

   // Request a voice from the voice pool
   voice = MV_AllocVoice( priority );
   if ( voice == NULL )
      {
      MV_SetErrorCode( MV_NoVoices );
      return( MV_Error );
      }

   voice->wavetype    = Raw;
   voice->bits        = 8;
   voice->channels    = 1;
   voice->GetSound    = MV_GetNextRawBlock;
   voice->Playing     = TRUE;
   voice->Paused      = FALSE;
   voice->NextBlock   = ptr;
   voice->position    = 0;
   voice->BlockLength = length;
   voice->length      = 0;
   voice->next        = NULL;
   voice->prev        = NULL;
   voice->priority    = priority;
   voice->callbackval = callbackval;
   voice->LoopStart   = loopstart;
   voice->LoopEnd     = loopend;
   voice->LoopSize    = (unsigned int)( voice->LoopEnd - voice->LoopStart ) + 1;

   MV_SetVoicePitch( voice, rate, pitchoffset );
   MV_SetVoiceVolume( voice, vol, left, right );
   MV_PlayVoice( voice );

   return( voice->handle );
   }

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movl 0x30(%rbp), %eax
movl 0x28(%rbp), %eax
movl 0x20(%rbp), %eax
movl 0x18(%rbp), %eax
movl 0x10(%rbp), %eax
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
movq %rdx, -0x20(%rbp)
movq %rcx, -0x28(%rbp)
movl %r8d, -0x2c(%rbp)
movl %r9d, -0x30(%rbp)
cmpl $0x0, 0xfa1b(%rip)      # 0x15c90
jne 0x628d
movl $0x2, 0xfa13(%rip)      # 0x15c94
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x63bb
movl 0x28(%rbp), %edi
callq 0x4af0
movq %rax, -0x38(%rbp)
cmpq $0x0, -0x38(%rbp)
jne 0x62b6
movl $0x4, 0xf9ea(%rip)      # 0x15c94
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x63bb
movq -0x38(%rbp), %rax
movl $0x0, 0x10(%rax)
movq -0x38(%rbp), %rax
movb $0x8, 0x14(%rax)
movq -0x38(%rbp), %rax
movb $0x1, 0x15(%rax)
movq -0x38(%rbp), %rax
leaq 0xf4(%rip), %rcx        # 0x63d0
movq %rcx, 0x18(%rax)
movq -0x38(%rbp), %rax
movl $0x1, 0x70(%rax)
movq -0x38(%rbp), %rax
movl $0x0, 0x74(%rax)
movq -0x10(%rbp), %rcx
movq -0x38(%rbp), %rax
movq %rcx, 0x28(%rax)
movq -0x38(%rbp), %rax
movl $0x0, 0x6c(%rax)
movl -0x14(%rbp), %ecx
movq -0x38(%rbp), %rax
movl %ecx, 0x48(%rax)
movq -0x38(%rbp), %rax
movl $0x0, 0x60(%rax)
movq -0x38(%rbp), %rax
movq $0x0, (%rax)
movq -0x38(%rbp), %rax
movq $0x0, 0x8(%rax)
movl 0x28(%rbp), %ecx
movq -0x38(%rbp), %rax
movl %ecx, 0x7c(%rax)
movl 0x30(%rbp), %ecx
movq -0x38(%rbp), %rax
movl %ecx, 0xa0(%rax)
movq -0x20(%rbp), %rcx
movq -0x38(%rbp), %rax
movq %rcx, 0x30(%rax)
movq -0x28(%rbp), %rcx
movq -0x38(%rbp), %rax
movq %rcx, 0x38(%rax)
movq -0x38(%rbp), %rax
movq 0x38(%rax), %rax
movq -0x38(%rbp), %rcx
movq 0x30(%rcx), %rcx
subq %rcx, %rax
movl %eax, %ecx
addl $0x1, %ecx
movq -0x38(%rbp), %rax
movl %ecx, 0x44(%rax)
movq -0x38(%rbp), %rdi
movl -0x2c(%rbp), %esi
movl -0x30(%rbp), %edx
callq 0x4dd0
movq -0x38(%rbp), %rdi
movl 0x10(%rbp), %esi
movl 0x18(%rbp), %edx
movl 0x20(%rbp), %ecx
callq 0x5220
movq -0x38(%rbp), %rdi
callq 0x45a0
movq -0x38(%rbp), %rax
movl 0x78(%rax), %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x40, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)