LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O1/jonof[P]jfaudiolib/src/multivoc.c
// Function: MV_GetVoice
static VoiceNode *MV_GetVoice
   (
   int handle
   )

   {
   VoiceNode *voice;
   int        flags;

   flags = DisableInterrupts();

   for( voice = VoiceList.next; voice != &VoiceList; voice = voice->next )
      {
      if ( handle == voice->handle )
         {
         break;
         }
      }

   RestoreInterrupts( flags );

   if ( voice == &VoiceList )
      {
      MV_SetErrorCode( MV_VoiceNotFound );
      voice = 0;
      }

   return( voice );
   }

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movl %edi, %ebp
movl 0x15e63(%rip), %eax     # 0x19524
leal 0x1(%rax), %ecx
movl %ecx, 0x15e5a(%rip)     # 0x19524
testl %eax, %eax
jg 0x36d3
callq 0x2d0b
movq 0xcbfe(%rip), %rbx      # 0x102d8
leaq 0xcbf7(%rip), %rax      # 0x102d8
cmpq %rax, %rbx
sete %r14b
je 0x36f4
cmpl %ebp, 0x78(%rbx)
je 0x36f4
movq (%rbx), %rbx
jmp 0x36e1
movl 0x15e2a(%rip), %eax     # 0x19524
leal -0x1(%rax), %ecx
movl %ecx, 0x15e21(%rip)     # 0x19524
cmpl $0x1, %eax
jg 0x370d
callq 0x2d24
testb %r14b, %r14b
je 0x371e
movl $0x6, 0xcbb8(%rip)      # 0x102d4
xorl %ebx, %ebx
movq %rbx, %rax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/jonof[P]jfaudiolib/src/multivoc.c
// Function: MV_KillAllVoices
int MV_KillAllVoices
   (
   void
   )

   {
   VoiceNode * voice, * next;
   int        flags;

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

   flags = DisableInterrupts();

   // Remove all the voices from the list
   for( voice = VoiceList.next; voice != &VoiceList; voice = next )
      {
      next = voice->next;
      if (voice->priority < MV_MUSIC_PRIORITY)
         {
         MV_Kill( voice->handle );
         }
      }

   RestoreInterrupts(flags);

   return( MV_Ok );
   }

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
cmpl $0x0, 0xcb72(%rip)      # 0x102d0
je 0x37c4
movl 0x15dbe(%rip), %eax     # 0x19524
leal 0x1(%rax), %ecx
movl %ecx, 0x15db5(%rip)     # 0x19524
testl %eax, %eax
jg 0x3778
callq 0x2d0b
movq 0xcb59(%rip), %rax      # 0x102d8
leaq 0xcb52(%rip), %rbx      # 0x102d8
cmpq %rbx, %rax
je 0x37a7
movq (%rax), %r14
cmpl $0x7fffffff, 0x7c(%rax) # imm = 0x7FFFFFFF
je 0x379f
movl 0x78(%rax), %edi
callq 0x37dd
movq %r14, %rax
cmpq %rbx, %r14
jne 0x378b
movl 0x15d77(%rip), %eax     # 0x19524
leal -0x1(%rax), %ecx
movl %ecx, 0x15d6e(%rip)     # 0x19524
xorl %ebx, %ebx
cmpl $0x1, %eax
jg 0x37d3
callq 0x2d24
jmp 0x37d3
movl $0x2, 0xcb06(%rip)      # 0x102d4
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/jonof[P]jfaudiolib/src/multivoc.c
// Function: MV_Kill
int MV_Kill
   (
   int handle
   )

   {
   VoiceNode *voice;
   int        flags;
   unsigned int callbackval;

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

   flags = DisableInterrupts();

   voice = MV_GetVoice( handle );
   if ( voice == NULL )
      {
      RestoreInterrupts( flags );
      MV_SetErrorCode( MV_VoiceNotFound );
      return( MV_Error );
      }

   callbackval = voice->callbackval;

   MV_StopVoice( voice );

   RestoreInterrupts( flags );

   if ( MV_CallBackFunc )
      {
      MV_CallBackFunc( callbackval );
      }

   return( MV_Ok );
   }

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
cmpl $0x0, 0xcae9(%rip)      # 0x102d0
je 0x384a
movl %edi, %ebx
movl 0x15d33(%rip), %eax     # 0x19524
leal 0x1(%rax), %ecx
movl %ecx, 0x15d2a(%rip)     # 0x19524
testl %eax, %eax
jg 0x3803
callq 0x2d0b
movl %ebx, %edi
callq 0x36b5
testq %rax, %rax
je 0x3856
movl 0xa0(%rax), %ebx
movq %rax, %rdi
callq 0x3887
movl 0x15d01(%rip), %eax     # 0x19524
leal -0x1(%rax), %ecx
movl %ecx, 0x15cf8(%rip)     # 0x19524
cmpl $0x1, %eax
jg 0x3836
callq 0x2d24
movq 0xcb43(%rip), %rax      # 0x10380
xorl %ebp, %ebp
testq %rax, %rax
je 0x387e
movl %ebx, %edi
callq *%rax
jmp 0x387e
movl $0x2, 0xca80(%rip)      # 0x102d4
jmp 0x3879
movl 0x15cc8(%rip), %eax     # 0x19524
leal -0x1(%rax), %ecx
movl %ecx, 0x15cbf(%rip)     # 0x19524
cmpl $0x1, %eax
jg 0x386f
callq 0x2d24
movl $0x6, 0xca5b(%rip)      # 0x102d4
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/jonof[P]jfaudiolib/src/multivoc.c
// Function: MV_StopVoice
static void MV_StopVoice
   (
   VoiceNode *voice
   )

   {
   int flags;

   flags = DisableInterrupts();

   // move the voice from the play list to the free list
   LL_Remove( voice, next, prev );
   LL_Add( (VoiceNode*) &VoicePool, voice, next, prev );

   RestoreInterrupts( flags );

   #ifdef HAVE_VORBIS
   if (voice->wavetype == Vorbis)
      {
      MV_ReleaseVorbisVoice(voice);
      }
   #endif
   }

// Assembly:
pushq %rbx
movq %rdi, %rbx
movl 0x15c93(%rip), %eax     # 0x19524
leal 0x1(%rax), %ecx
movl %ecx, 0x15c8a(%rip)     # 0x19524
testl %eax, %eax
jg 0x38a3
callq 0x2d0b
movq (%rbx), %rax
movq 0x8(%rbx), %rcx
movq %rax, (%rcx)
movq (%rbx), %rax
movq %rcx, 0x8(%rax)
movq %rbx, 0x8(%rbx)
leaq 0xcac9(%rip), %rax      # 0x10388
movq %rax, (%rbx)
movq 0xcac7(%rip), %rax      # 0x10390
movq %rax, 0x8(%rbx)
movq 0xcabc(%rip), %rax      # 0x10390
movq %rbx, (%rax)
movq %rbx, 0xcab2(%rip)      # 0x10390
movl 0x15c40(%rip), %eax     # 0x19524
leal -0x1(%rax), %ecx
movl %ecx, 0x15c37(%rip)     # 0x19524
cmpl $0x1, %eax
jg 0x38f7
callq 0x2d24
cmpl $0x4, 0x10(%rbx)
jne 0x3906
movq %rbx, %rdi
popq %rbx
jmp 0x69a4
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/jonof[P]jfaudiolib/src/multivoc.c
// Function: MV_PauseVoice
int MV_PauseVoice
(
 int handle,
 int pauseon
 )

{
   VoiceNode *voice;
   int        flags;

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

   flags = DisableInterrupts();

   voice = MV_GetVoice( handle );
   if ( voice == NULL )
   {
      RestoreInterrupts( flags );
      MV_SetErrorCode( MV_VoiceNotFound );
      return( MV_Error );
   }

   voice->Paused = pauseon;

   RestoreInterrupts( flags );

   return( MV_Ok );
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
cmpl $0x0, 0xc9be(%rip)      # 0x102d0
je 0x395c
movl %esi, %ebx
movl %edi, %ebp
movl 0x15c06(%rip), %eax     # 0x19524
leal 0x1(%rax), %ecx
movl %ecx, 0x15bfd(%rip)     # 0x19524
testl %eax, %eax
jg 0x3930
callq 0x2d0b
movl %ebp, %edi
callq 0x36b5
testq %rax, %rax
je 0x3968
movl %ebx, 0x74(%rax)
movl 0x15bdf(%rip), %eax     # 0x19524
leal -0x1(%rax), %ecx
movl %ecx, 0x15bd6(%rip)     # 0x19524
xorl %ebx, %ebx
cmpl $0x1, %eax
jg 0x3990
callq 0x2d24
jmp 0x3990
movl $0x2, 0xc96e(%rip)      # 0x102d4
jmp 0x398b
movl 0x15bb6(%rip), %eax     # 0x19524
leal -0x1(%rax), %ecx
movl %ecx, 0x15bad(%rip)     # 0x19524
cmpl $0x1, %eax
jg 0x3981
callq 0x2d24
movl $0x6, 0xc949(%rip)      # 0x102d4
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/jonof[P]jfaudiolib/src/multivoc.c
// Function: MV_VoicesPlaying
int MV_VoicesPlaying
   (
   void
   )

   {
   VoiceNode   *voice;
   int         NumVoices = 0;
   int         flags;

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

   flags = DisableInterrupts();

   for( voice = VoiceList.next; voice != &VoiceList; voice = voice->next )
      {
      NumVoices++;
      }

   RestoreInterrupts( flags );

   return( NumVoices );
   }

// Assembly:
pushq %rbx
cmpl $0x0, 0xc92f(%rip)      # 0x102d0
je 0x39f2
movl 0x15b7b(%rip), %eax     # 0x19524
leal 0x1(%rax), %ecx
movl %ecx, 0x15b72(%rip)     # 0x19524
testl %eax, %eax
jg 0x39bb
callq 0x2d0b
movq 0xc916(%rip), %rax      # 0x102d8
leaq 0xc90f(%rip), %rcx      # 0x102d8
xorl %ebx, %ebx
cmpq %rcx, %rax
je 0x39d7
incl %ebx
movq (%rax), %rax
jmp 0x39cb
movl 0x15b47(%rip), %eax     # 0x19524
leal -0x1(%rax), %ecx
movl %ecx, 0x15b3e(%rip)     # 0x19524
cmpl $0x1, %eax
jg 0x39fe
callq 0x2d24
jmp 0x39fe
movl $0x2, 0xc8d8(%rip)      # 0x102d4
xorl %ebx, %ebx
movl %ebx, %eax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/jonof[P]jfaudiolib/src/multivoc.c
// Function: MV_AllocVoice
VoiceNode *MV_AllocVoice
   (
   int priority
   )

   {
   VoiceNode   *voice;
   VoiceNode   *node;
   int          flags;

//return( NULL );
   if ( MV_Recording )
      {
      return( NULL );
      }

   flags = DisableInterrupts();

   // Check if we have any free voices
   if ( LL_Empty( &VoicePool, next, prev ) )
      {
      // check if we have a higher priority than a voice that is playing.
      voice = VoiceList.next;
      for( node = voice->next; node != &VoiceList; node = node->next )
         {
         if ( node->priority < voice->priority )
            {
            voice = node;
            }
         }

      if ( priority >= voice->priority )
         {
         MV_Kill( voice->handle );
         }
      }

   // Check if any voices are in the voice pool
   if ( LL_Empty( &VoicePool, next, prev ) )
      {
      // No free voices
      RestoreInterrupts( flags );
      return( NULL );
      }

   voice = VoicePool.next;
   LL_Remove( voice, next, prev );
   RestoreInterrupts( flags );

   // Find a free voice handle
   do
      {
      MV_VoiceHandle++;
      if ( MV_VoiceHandle < MV_MinVoiceHandle )
         {
         MV_VoiceHandle = MV_MinVoiceHandle;
         }
      }
   while( MV_VoicePlaying( MV_VoiceHandle ) );

   voice->handle = MV_VoiceHandle;

   return( voice );
   }

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movl %edi, %ebx
movl 0x15b16(%rip), %eax     # 0x19524
leal 0x1(%rax), %ecx
movl %ecx, 0x15b0d(%rip)     # 0x19524
testl %eax, %eax
jg 0x3a20
callq 0x2d0b
leaq 0xc961(%rip), %r14      # 0x10388
movq 0xc95a(%rip), %rax      # 0x10388
cmpq %r14, %rax
jne 0x3a71
movq 0xc956(%rip), %rax      # 0x10390
cmpq %r14, %rax
jne 0x3a71
movq 0xc892(%rip), %rax      # 0x102d8
leaq 0xc88b(%rip), %rcx      # 0x102d8
movq (%rax), %rdx
cmpq %rcx, %rdx
je 0x3a64
movl 0x7c(%rdx), %esi
cmpl 0x7c(%rax), %esi
cmovlq %rdx, %rax
movq (%rdx), %rdx
jmp 0x3a50
cmpl %ebx, 0x7c(%rax)
jg 0x3a71
movl 0x78(%rax), %edi
callq 0x37dd
movq 0xc910(%rip), %rax      # 0x10388
cmpq %r14, %rax
jne 0x3a89
movq 0xc90c(%rip), %rax      # 0x10390
cmpq %r14, %rax
je 0x3b06
movq 0xc8f8(%rip), %rbx      # 0x10388
movq (%rbx), %rax
movq 0x8(%rbx), %rcx
movq %rax, (%rcx)
movq (%rbx), %rax
movq %rcx, 0x8(%rax)
movq %rbx, (%rbx)
movq %rbx, 0x8(%rbx)
movl 0x15a76(%rip), %eax     # 0x19524
leal -0x1(%rax), %ecx
movl %ecx, 0x15a6d(%rip)     # 0x19524
cmpl $0x1, %eax
jg 0x3ac1
callq 0x2d24
xorl %ebp, %ebp
movl 0xc74b(%rip), %edi      # 0x10214
testl %edi, %edi
cmovlel %ebp, %edi
incl %edi
movl %edi, 0xc73e(%rip)      # 0x10214
cmpl $0x0, 0xc7f3(%rip)      # 0x102d0
je 0x3aeb
callq 0x36b5
testq %rax, %rax
jne 0x3ac3
jmp 0x3af5
movl $0x2, 0xc7df(%rip)      # 0x102d4
movl 0xc719(%rip), %eax      # 0x10214
movl %eax, 0x78(%rbx)
movq %rbx, %rax
popq %rbx
popq %r14
popq %rbp
retq
movl 0x15a18(%rip), %eax     # 0x19524
leal -0x1(%rax), %ecx
movl %ecx, 0x15a0f(%rip)     # 0x19524
cmpl $0x1, %eax
jg 0x3b1f
callq 0x2d24
xorl %ebx, %ebx
jmp 0x3afe
// File: /workspace/github_c_makefile_star2_O1/jonof[P]jfaudiolib/src/multivoc.c
// Function: MV_VoiceAvailable
int MV_VoiceAvailable
   (
   int priority
   )

   {
   VoiceNode   *voice;
   VoiceNode   *node;
   int          flags;

   // Check if we have any free voices
   if ( !LL_Empty( &VoicePool, next, prev ) )
      {
      return( TRUE );
      }

   flags = DisableInterrupts();

   // check if we have a higher priority than a voice that is playing.
   voice = VoiceList.next;
   for( node = VoiceList.next; node != &VoiceList; node = node->next )
      {
      if ( node->priority < voice->priority )
         {
         voice = node;
         }
      }

   RestoreInterrupts( flags );

   if ( ( voice != &VoiceList ) && ( priority >= voice->priority ) )
      {
      return( TRUE );
      }

   return( FALSE );
   }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
leaq 0xc857(%rip), %rax      # 0x10388
movq 0xc850(%rip), %rcx      # 0x10388
movl $0x1, %ebx
cmpq %rax, %rcx
jne 0x3bb8
movq 0xc847(%rip), %rcx      # 0x10390
cmpq %rax, %rcx
jne 0x3bb8
movl %edi, %ebp
movl 0x159ce(%rip), %eax     # 0x19524
leal 0x1(%rax), %ecx
movl %ecx, 0x159c5(%rip)     # 0x19524
testl %eax, %eax
jg 0x3b68
callq 0x2d0b
movq 0xc769(%rip), %r14      # 0x102d8
leaq 0xc762(%rip), %r15      # 0x102d8
movq 0xc75b(%rip), %rax      # 0x102d8
cmpq %r15, %rax
je 0x3b92
movl 0x7c(%rax), %ecx
cmpl 0x7c(%r14), %ecx
cmovlq %rax, %r14
movq (%rax), %rax
jmp 0x3b7d
movl 0x1598c(%rip), %eax     # 0x19524
leal -0x1(%rax), %ecx
movl %ecx, 0x15983(%rip)     # 0x19524
cmpl $0x1, %eax
jg 0x3bab
callq 0x2d24
cmpq %r15, %r14
je 0x3bb6
cmpl %ebp, 0x7c(%r14)
jle 0x3bb8
xorl %ebx, %ebx
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/jonof[P]jfaudiolib/src/multivoc.c
// Function: MV_SetPitch
int MV_SetPitch
   (
   int handle,
   int pitchoffset
   )

   {
   VoiceNode *voice;

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

   voice = MV_GetVoice( handle );
   if ( voice == NULL )
      {
      MV_SetErrorCode( MV_VoiceNotFound );
      return( MV_Error );
      }

   MV_SetVoicePitch( voice, voice->SamplingRate, pitchoffset );

   return( MV_Ok );
   }

// Assembly:
cmpl $0x0, 0xc704(%rip)      # 0x102d0
je 0x3c0c
pushq %rbp
pushq %r14
pushq %rbx
movl %esi, %ebp
callq 0x36b5
testq %rax, %rax
je 0x3c1d
movq %rax, %rbx
movl 0x64(%rax), %r14d
movl %ebp, %edi
callq 0x649c
movl %eax, 0x4c(%rbx)
imull %r14d, %eax
xorl %ecx, %ecx
xorl %edx, %edx
divl 0x15903(%rip)           # 0x19500
movl %eax, 0x68(%rbx)
movl %eax, %edx
shll $0x8, %edx
subl %eax, %edx
movl %edx, 0x50(%rbx)
jmp 0x3c2c
movl $0x2, 0xc6be(%rip)      # 0x102d4
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
jmp 0x3c30
movl $0x6, 0xc6ad(%rip)      # 0x102d4
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
popq %rbx
popq %r14
popq %rbp
movl %ecx, %eax
retq
// File: /workspace/github_c_makefile_star2_O1/jonof[P]jfaudiolib/src/multivoc.c
// Function: MV_SetFrequency
int MV_SetFrequency
   (
   int handle,
   int frequency
   )

   {
   VoiceNode *voice;

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

   voice = MV_GetVoice( handle );
   if ( voice == NULL )
      {
      MV_SetErrorCode( MV_VoiceNotFound );
      return( MV_Error );
      }

   MV_SetVoicePitch( voice, frequency, 0 );

   return( MV_Ok );
   }

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
cmpl $0x0, 0xc692(%rip)      # 0x102d0
je 0x3c7b
movl %esi, %ebp
callq 0x36b5
testq %rax, %rax
je 0x3c87
movq %rax, %r14
movl %ebp, 0x64(%rax)
xorl %ebx, %ebx
xorl %edi, %edi
callq 0x649c
movl %eax, 0x4c(%r14)
imull %ebp, %eax
xorl %edx, %edx
divl 0x15896(%rip)           # 0x19500
movl %eax, 0x68(%r14)
movl %eax, %ecx
shll $0x8, %ecx
subl %eax, %ecx
movl %ecx, 0x50(%r14)
jmp 0x3c96
movl $0x2, 0xc64f(%rip)      # 0x102d4
jmp 0x3c91
movl $0x6, 0xc643(%rip)      # 0x102d4
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
movl %ebx, %eax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/jonof[P]jfaudiolib/src/multivoc.c
// Function: MV_SetVoiceVolume
void MV_SetVoiceVolume
   (
   VoiceNode *voice,
   int vol,
   int left,
   int right
   )

   {
   if ( MV_Channels == 1 )
      {
      left  = vol;
      right = vol;
      }

   if ( MV_SwapLeftRight )
      {
      // SBPro uses reversed panning
      voice->LeftVolume  = MV_GetVolumeTable( right );
      voice->RightVolume = MV_GetVolumeTable( left );
      }
   else
      {
      voice->LeftVolume  = MV_GetVolumeTable( left );
      voice->RightVolume = MV_GetVolumeTable( right );
      }

   MV_SetVoiceMixMode( voice );
   }

// Assembly:
cmpl $0x1, 0xc3cd(%rip)      # 0x1021c
cmovel %esi, %edx
cmovel %esi, %ecx
movl 0xc3b1(%rip), %eax      # 0x1020c
incl %eax
xorl %esi, %esi
cmpl %esi, 0x145db(%rip)     # 0x18440
movl %ecx, %r8d
cmovel %edx, %r8d
cmovnel %edx, %ecx
movl $0xff, %edx
cmpl %edx, %r8d
cmovgel %edx, %r8d
testl %r8d, %r8d
cmovlel %esi, %r8d
imull %eax, %r8d
sarl $0x8, %r8d
movslq %r8d, %r8
shlq $0x9, %r8
leaq 0xc598(%rip), %r9       # 0x10430
addq %r9, %r8
cmpl %edx, %ecx
cmovgel %edx, %ecx
testl %ecx, %ecx
cmovlel %esi, %ecx
movq %r8, 0x90(%rdi)
imull %eax, %ecx
sarl $0x8, %ecx
movslq %ecx, %rax
shlq $0x9, %rax
addq %r9, %rax
movq %rax, 0x98(%rdi)
jmp 0x3cf8
// File: /workspace/github_c_makefile_star2_O1/jonof[P]jfaudiolib/src/multivoc.c
// Function: MV_EndLooping
int MV_EndLooping
   (
   int handle
   )

   {
   VoiceNode *voice;
   int        flags;

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

   flags = DisableInterrupts();

   voice = MV_GetVoice( handle );
   if ( voice == NULL )
      {
      RestoreInterrupts( flags );
      MV_SetErrorCode( MV_VoiceNotFound );
      return( MV_Warning );
      }

   voice->LoopCount = 0;
   voice->LoopStart = NULL;
   voice->LoopEnd   = NULL;

   RestoreInterrupts( flags );

   return( MV_Ok );
   }

// Assembly:
pushq %rbx
cmpl $0x0, 0xc400(%rip)      # 0x102d0
je 0x3f23
movl %edi, %ebx
movl 0x1564a(%rip), %eax     # 0x19524
leal 0x1(%rax), %ecx
movl %ecx, 0x15641(%rip)     # 0x19524
testl %eax, %eax
jg 0x3eec
callq 0x2d0b
movl %ebx, %edi
callq 0x36b5
testq %rax, %rax
je 0x3f34
xorps %xmm0, %xmm0
movups %xmm0, 0x30(%rax)
movl $0x0, 0x40(%rax)
movl 0x15618(%rip), %eax     # 0x19524
leal -0x1(%rax), %ecx
movl %ecx, 0x1560f(%rip)     # 0x19524
xorl %ebx, %ebx
cmpl $0x1, %eax
jg 0x3f5c
callq 0x2d24
jmp 0x3f5c
movl $0x2, 0xc3a7(%rip)      # 0x102d4
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
jmp 0x3f5c
movl 0x155ea(%rip), %eax     # 0x19524
leal -0x1(%rax), %ecx
movl %ecx, 0x155e1(%rip)     # 0x19524
cmpl $0x1, %eax
jg 0x3f4d
callq 0x2d24
movl $0x6, 0xc37d(%rip)      # 0x102d4
movl $0xfffffffe, %ebx       # imm = 0xFFFFFFFE
movl %ebx, %eax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/jonof[P]jfaudiolib/src/multivoc.c
// Function: MV_SetPan
int MV_SetPan
   (
   int handle,
   int vol,
   int left,
   int right
   )

   {
   VoiceNode *voice;

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

   voice = MV_GetVoice( handle );
   if ( voice == NULL )
      {
      MV_SetErrorCode( MV_VoiceNotFound );
      return( MV_Warning );
      }

   MV_SetVoiceVolume( voice, vol, left, right );

   return( MV_Ok );
   }

// Assembly:
cmpl $0x0, 0xc369(%rip)      # 0x102d0
je 0x3f91
pushq %rbp
pushq %r14
pushq %rbx
movl %ecx, %ebx
movl %edx, %ebp
movl %esi, %r14d
callq 0x36b5
testq %rax, %rax
je 0x3fa1
movq %rax, %rdi
movl %r14d, %esi
movl %ebp, %edx
movl %ebx, %ecx
callq 0x3e48
xorl %eax, %eax
jmp 0x3fb0
movl $0x2, 0xc339(%rip)      # 0x102d4
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
retq
movl $0x6, 0xc329(%rip)      # 0x102d4
movl $0xfffffffe, %eax       # imm = 0xFFFFFFFE
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/jonof[P]jfaudiolib/src/multivoc.c
// Function: MV_StopPlayback
void MV_StopPlayback
   (
   void
   )

   {
   VoiceNode   *voice;
   VoiceNode   *next;
   int          flags;

   // Stop sound playback
   SoundDriver_PCM_StopPlayback();

   // Make sure all callbacks are done.
   flags = DisableInterrupts();

   for( voice = VoiceList.next; voice != &VoiceList; voice = next )
      {
      next = voice->next;

      MV_StopVoice( voice );

      if ( MV_CallBackFunc )
         {
         MV_CallBackFunc( voice->callbackval );
         }
      }

   RestoreInterrupts( flags );
   }

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
callq 0x2cf2
movl 0x1509b(%rip), %eax     # 0x19524
leal 0x1(%rax), %ecx
movl %ecx, 0x15092(%rip)     # 0x19524
testl %eax, %eax
jg 0x449b
callq 0x2d0b
movq 0xbe36(%rip), %rbx      # 0x102d8
leaq 0xbe2f(%rip), %r14      # 0x102d8
cmpq %r14, %rbx
je 0x44d5
movq (%rbx), %r15
movq %rbx, %rdi
callq 0x3887
movq 0xbec0(%rip), %rax      # 0x10380
testq %rax, %rax
je 0x44cd
movl 0xa0(%rbx), %edi
callq *%rax
movq %r15, %rbx
cmpq %r14, %r15
jne 0x44ae
movl 0x15049(%rip), %eax     # 0x19524
leal -0x1(%rax), %ecx
movl %ecx, 0x15040(%rip)     # 0x19524
cmpl $0x1, %eax
jle 0x44ef
popq %rbx
popq %r14
popq %r15
retq
popq %rbx
popq %r14
popq %r15
jmp 0x2d24
// File: /workspace/github_c_makefile_star2_O1/jonof[P]jfaudiolib/src/multivoc.c
// Function: MV_StartDemandFeedPlayback
int MV_StartDemandFeedPlayback
   (
   void ( *function )( char **ptr, unsigned int *length ),
   int 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    = DemandFeed;
   voice->bits        = 8;
   voice->channels    = 1;
   voice->GetSound    = MV_GetNextDemandFeedBlock;
   voice->NextBlock   = NULL;
   voice->DemandFeed  = function;
   voice->LoopStart   = NULL;
   voice->LoopCount   = 0;
   voice->BlockLength = 0;
   voice->position    = 0;
   voice->sound       = NULL;
   voice->length      = 0;
   voice->BlockLength = 0;
   voice->Playing     = TRUE;
   voice->Paused      = FALSE;
   voice->next        = NULL;
   voice->prev        = NULL;
   voice->priority    = priority;
   voice->callbackval = callbackval;

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

   return( voice->handle );
   }

// Assembly:
cmpl $0x0, 0xbdbf(%rip)      # 0x102d0
je 0x45f7
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %r8d, %ebp
movl %ecx, %r14d
movl %edx, %r13d
movl %esi, %r12d
movq %rdi, %rbx
movl %r9d, 0x4(%rsp)
movl 0x40(%rsp), %edi
callq 0x3a02
testq %rax, %rax
je 0x4607
movq %rax, %r15
movl 0x48(%rsp), %eax
movl $0x2, 0x10(%r15)
movw $0x108, 0x14(%r15)      # imm = 0x108
leaq 0xc0(%rip), %rcx        # 0x4625
movq %rcx, 0x18(%r15)
xorps %xmm0, %xmm0
movups %xmm0, 0x28(%r15)
movq %rbx, 0x80(%r15)
xorl %ecx, %ecx
movl %ecx, 0x40(%r15)
movl %ecx, 0x48(%r15)
movl %ecx, 0x6c(%r15)
movq $0x0, 0x58(%r15)
movl %ecx, 0x60(%r15)
movq $0x1, 0x70(%r15)
movups %xmm0, (%r15)
movl 0x40(%rsp), %ecx
movl %ecx, 0x7c(%r15)
movl %eax, 0xa0(%r15)
movl %r12d, 0x64(%r15)
movl %r13d, %edi
callq 0x649c
movl %eax, 0x4c(%r15)
imull %r12d, %eax
xorl %edx, %edx
divl 0x14f37(%rip)           # 0x19500
movl %eax, 0x68(%r15)
movl %eax, %ecx
shll $0x8, %ecx
subl %eax, %ecx
movl %ecx, 0x50(%r15)
movq %r15, %rdi
movl %r14d, %esi
movl %ebp, %edx
movl 0x4(%rsp), %ecx
callq 0x3e48
movq %r15, %rdi
callq 0x3619
movl 0x78(%r15), %eax
jmp 0x4616
movl $0x2, 0xbcd3(%rip)      # 0x102d4
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
retq
movl $0x4, 0xbcc3(%rip)      # 0x102d4
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/jonof[P]jfaudiolib/src/multivoc.c
// Function: MV_GetNextDemandFeedBlock
static playbackstatus MV_GetNextDemandFeedBlock
   (
   VoiceNode *voice
   )

   {
   if ( voice->BlockLength > 0 )
      {
      voice->position    -= voice->length;
      voice->sound       += voice->length >> 16;
      voice->length       = min( voice->BlockLength, 0x8000 );
      voice->BlockLength -= voice->length;
      voice->length     <<= 16;

      return( KeepPlaying );
      }

   if ( voice->DemandFeed == NULL )
      {
      return( NoMoreData );
      }

   voice->position     = 0;
   ( voice->DemandFeed )( &voice->sound, &voice->BlockLength );
   voice->length       = min( voice->BlockLength, 0x8000 );
   voice->BlockLength -= voice->length;
   voice->length     <<= 16;

   if ( ( voice->length > 0 ) && ( voice->sound != NULL ) )
      {
      return( KeepPlaying );
      }
   return( NoMoreData );
   }

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movl 0x48(%rdi), %eax
testl %eax, %eax
je 0x4662
movl 0x60(%rbx), %ecx
subl %ecx, 0x6c(%rbx)
shrl $0x10, %ecx
addq %rcx, 0x58(%rbx)
movl $0x8000, %ecx           # imm = 0x8000
cmpl %ecx, %eax
cmovbl %eax, %ecx
subl %ecx, %eax
movl %eax, 0x48(%rbx)
shll $0x10, %ecx
movl %ecx, 0x60(%rbx)
movl $0x1, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
movq 0x80(%rbx), %rcx
xorl %eax, %eax
testq %rcx, %rcx
je 0x465a
leaq 0x48(%rbx), %rsi
movl $0x0, 0x6c(%rbx)
leaq 0x58(%rbx), %r14
movq %r14, %rdi
callq *%rcx
movl 0x48(%rbx), %eax
movl $0x8000, %ecx           # imm = 0x8000
cmpl %ecx, %eax
cmovbl %eax, %ecx
movl %eax, %edx
subl %ecx, %edx
movl %edx, 0x48(%rbx)
shll $0x10, %ecx
movl %ecx, 0x60(%rbx)
testl %eax, %eax
je 0x46ad
movl $0x1, %eax
cmpq $0x0, (%r14)
jne 0x465a
xorl %eax, %eax
jmp 0x465a
// File: /workspace/github_c_makefile_star2_O1/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:
cmpl $0x0, 0xbbdd(%rip)      # 0x102d0
je 0x47d0
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %r8d, %ebp
movq %rcx, %r14
movq %rdx, %r12
movl %esi, %r13d
movq %rdi, %r15
movl %r9d, 0x4(%rsp)
movl 0x58(%rsp), %edi
callq 0x3a02
testq %rax, %rax
je 0x47e0
movq %rax, %rbx
movl 0x60(%rsp), %eax
xorl %ecx, %ecx
movl %ecx, 0x10(%rbx)
movw $0x108, 0x14(%rbx)      # imm = 0x108
leaq 0xbb(%rip), %rdx        # 0x47fe
movq %rdx, 0x18(%rbx)
movl %ecx, 0x74(%rbx)
movq %r15, 0x28(%rbx)
movabsq $0x100000000, %rdx      # imm = 0x100000000
movq %rdx, 0x6c(%rbx)
movl %r13d, 0x48(%rbx)
movl %ecx, 0x60(%rbx)
xorps %xmm0, %xmm0
movups %xmm0, (%rbx)
movl 0x58(%rsp), %ecx
movl %ecx, 0x7c(%rbx)
movl %eax, 0xa0(%rbx)
movq %r12, 0x30(%rbx)
movq %r14, 0x38(%rbx)
subl %r12d, %r14d
incl %r14d
movl %r14d, 0x44(%rbx)
movl %ebp, 0x64(%rbx)
movl 0x4(%rsp), %edi
callq 0x649c
movl %eax, 0x4c(%rbx)
imull %ebp, %eax
xorl %edx, %edx
divl 0x14d5e(%rip)           # 0x19500
movl %eax, 0x68(%rbx)
movl %eax, %ecx
shll $0x8, %ecx
subl %eax, %ecx
movl %ecx, 0x50(%rbx)
movq %rbx, %rdi
movl 0x40(%rsp), %esi
movl 0x48(%rsp), %edx
movl 0x50(%rsp), %ecx
callq 0x3e48
movq %rbx, %rdi
callq 0x3619
movl 0x78(%rbx), %eax
jmp 0x47ef
movl $0x2, 0xbafa(%rip)      # 0x102d4
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
retq
movl $0x4, 0xbaea(%rip)      # 0x102d4
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/jonof[P]jfaudiolib/src/multivoc.c
// Function: MV_GetNextRawBlock
static playbackstatus MV_GetNextRawBlock
   (
   VoiceNode *voice
   )

   {
   if ( voice->BlockLength <= 0 )
      {
      if ( voice->LoopStart == NULL )
         {
         voice->Playing = FALSE;
         return( NoMoreData );
         }

      voice->BlockLength = voice->LoopSize;
      voice->NextBlock   = voice->LoopStart;
      voice->length = 0;
      voice->position = 0;
      }

   voice->sound        = voice->NextBlock;
   voice->position    -= voice->length;
   voice->length       = min( voice->BlockLength, 0x8000 );
   voice->NextBlock   += voice->length * (voice->channels * voice->bits / 8);
   voice->BlockLength -= voice->length;
   voice->length     <<= 16;

   return( KeepPlaying );
   }

// Assembly:
cmpl $0x0, 0x48(%rdi)
jne 0x481f
movq 0x30(%rdi), %rax
testq %rax, %rax
je 0x4870
movl 0x44(%rdi), %ecx
movl %ecx, 0x48(%rdi)
movq %rax, 0x28(%rdi)
xorl %eax, %eax
movl %eax, 0x60(%rdi)
movl %eax, 0x6c(%rdi)
movq 0x28(%rdi), %rax
movq %rax, 0x58(%rdi)
movl 0x60(%rdi), %ecx
subl %ecx, 0x6c(%rdi)
movl 0x48(%rdi), %ecx
movl $0x8000, %edx           # imm = 0x8000
cmpl %edx, %ecx
cmovbl %ecx, %edx
movsbl 0x15(%rdi), %esi
movsbl 0x14(%rdi), %r8d
imull %esi, %r8d
leal 0x7(%r8), %esi
testl %r8d, %r8d
cmovnsl %r8d, %esi
sarl $0x3, %esi
imull %edx, %esi
addq %rax, %rsi
movq %rsi, 0x28(%rdi)
subl %edx, %ecx
movl %ecx, 0x48(%rdi)
shll $0x10, %edx
movl %edx, 0x60(%rdi)
movl $0x1, %eax
retq
movl $0x0, 0x70(%rdi)
xorl %eax, %eax
retq
// File: /workspace/github_c_makefile_star2_O1/jonof[P]jfaudiolib/src/multivoc.c
// Function: MV_PlayWAV3D
int MV_PlayWAV3D
   (
   char *ptr,
   unsigned int length,
   int  pitchoffset,
   int  angle,
   int  distance,
   int  priority,
   unsigned int callbackval
   )

   {
   int left;
   int right;
   int mid;
   int volume;
   int status;

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

   if ( distance < 0 )
      {
      distance  = -distance;
      angle    += MV_NumPanPositions / 2;
      }

   volume = MIX_VOLUME( distance );

   // Ensure angle is within 0 - 31
   angle &= MV_MaxPanPosition;

   left  = MV_PanTable[ angle ][ volume ].left;
   right = MV_PanTable[ angle ][ volume ].right;
   mid   = max( 0, 255 - distance );

   status = MV_PlayWAV( ptr, length, pitchoffset, mid, left, right, priority,
      callbackval );

   return( status );
   }

// Assembly:
cmpl $0x0, 0xb7ae(%rip)      # 0x102d0
je 0x4bb2
pushq %r14
pushq %rbx
pushq %rax
movl %r9d, %eax
movl %edx, %esi
movl 0x20(%rsp), %r10d
movl %r8d, %edx
negl %edx
cmovsl %r8d, %edx
shrl $0x1b, %r8d
andl $-0x10, %r8d
addl %ecx, %r8d
movl $0xff, %ecx
movl %edx, %r11d
subl %ecx, %r11d
cmovgel %ecx, %edx
negl %r11d
movl 0xb6ab(%rip), %ecx      # 0x1020c
incl %ecx
imull %edx, %ecx
sarl $0x8, %ecx
andl $0x1f, %r8d
movslq %ecx, %rcx
shll $0x7, %r8d
leaq 0x138d5(%rip), %rdx     # 0x18450
addq %r8, %rdx
movzbl (%rdx,%rcx,2), %ebx
movzbl 0x1(%rdx,%rcx,2), %r14d
xorl %r9d, %r9d
testl %r11d, %r11d
cmovgl %r11d, %r9d
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
movl %esi, %r8d
pushq %r10
pushq %rax
pushq %r14
pushq %rbx
callq 0x48ac
addq $0x28, %rsp
popq %rbx
popq %r14
retq
movl $0x2, 0xb718(%rip)      # 0x102d4
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
retq
// File: /workspace/github_c_makefile_star2_O1/jonof[P]jfaudiolib/src/multivoc.c
// Function: MV_PlayRaw3D
int MV_PlayRaw3D
   (
   char *ptr,
   unsigned int length,
   unsigned rate,
   int  pitchoffset,
   int  angle,
   int  distance,
   int  priority,
   unsigned int callbackval
   )

   {
   int left;
   int right;
   int mid;
   int volume;
   int status;

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

   if ( distance < 0 )
      {
      distance  = -distance;
      angle    += MV_NumPanPositions / 2;
      }

   volume = MIX_VOLUME( distance );

   // Ensure angle is within 0 - 31
   angle &= MV_MaxPanPosition;

   left  = MV_PanTable[ angle ][ volume ].left;
   right = MV_PanTable[ angle ][ volume ].right;
   mid   = max( 0, 255 - distance );

   status = MV_PlayRaw( ptr, length, rate, pitchoffset, mid, left, right,
      priority, callbackval );

   return( status );
   }

// Assembly:
cmpl $0x0, 0xb707(%rip)      # 0x102d0
je 0x4c69
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movl %ecx, %eax
movl %edx, %r10d
movl 0x38(%rsp), %ebx
movl 0x30(%rsp), %r11d
movl %r9d, %ecx
negl %ecx
cmovsl %r9d, %ecx
shrl $0x1b, %r9d
andl $-0x10, %r9d
addl %r8d, %r9d
movl $0xff, %edx
movl %ecx, %r14d
subl %edx, %r14d
cmovgel %edx, %ecx
negl %r14d
movl 0xb5fc(%rip), %edx      # 0x1020c
incl %edx
imull %ecx, %edx
sarl $0x8, %edx
andl $0x1f, %r9d
movslq %edx, %rcx
shll $0x7, %r9d
leaq 0x13826(%rip), %rdx     # 0x18450
addq %r9, %rdx
movzbl (%rdx,%rcx,2), %r15d
movzbl 0x1(%rdx,%rcx,2), %r12d
xorl %ecx, %ecx
testl %r14d, %r14d
cmovlel %ecx, %r14d
subq $0x8, %rsp
xorl %edx, %edx
xorl %ecx, %ecx
movl %r10d, %r8d
movl %eax, %r9d
pushq %rbx
pushq %r11
pushq %r12
pushq %r15
pushq %r14
callq 0x46ec
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
movl $0x2, 0xb661(%rip)      # 0x102d4
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
retq
// File: /workspace/github_c_makefile_star2_O1/jonof[P]jfaudiolib/src/multivoc.c
// Function: MV_PlayVOC3D
int MV_PlayVOC3D
   (
   char *ptr,
   unsigned int ptrlength,
   int  pitchoffset,
   int  angle,
   int  distance,
   int  priority,
   unsigned int callbackval
   )

   {
   int left;
   int right;
   int mid;
   int volume;
   int status;

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

   if ( distance < 0 )
      {
      distance  = -distance;
      angle    += MV_NumPanPositions / 2;
      }

   volume = MIX_VOLUME( distance );

   // Ensure angle is within 0 - 31
   angle &= MV_MaxPanPosition;

   left  = MV_PanTable[ angle ][ volume ].left;
   right = MV_PanTable[ angle ][ volume ].right;
   mid   = max( 0, 255 - distance );

   status = MV_PlayVOC( ptr, ptrlength, pitchoffset, mid, left, right, priority,
      callbackval );

   return( status );
   }

// Assembly:
cmpl $0x0, 0xb5d4(%rip)      # 0x102d0
je 0x4d8c
pushq %r14
pushq %rbx
pushq %rax
movl %r9d, %eax
movl %edx, %esi
movl 0x20(%rsp), %r10d
movl %r8d, %edx
negl %edx
cmovsl %r8d, %edx
shrl $0x1b, %r8d
andl $-0x10, %r8d
addl %ecx, %r8d
movl $0xff, %ecx
movl %edx, %r11d
subl %ecx, %r11d
cmovgel %ecx, %edx
negl %r11d
movl 0xb4d1(%rip), %ecx      # 0x1020c
incl %ecx
imull %edx, %ecx
sarl $0x8, %ecx
andl $0x1f, %r8d
movslq %ecx, %rcx
shll $0x7, %r8d
leaq 0x136fb(%rip), %rdx     # 0x18450
addq %r8, %rdx
movzbl (%rdx,%rcx,2), %ebx
movzbl 0x1(%rdx,%rcx,2), %r14d
xorl %r9d, %r9d
testl %r11d, %r11d
cmovgl %r11d, %r9d
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
movl %esi, %r8d
pushq %r10
pushq %rax
pushq %r14
pushq %rbx
callq 0x4dce
addq $0x28, %rsp
popq %rbx
popq %r14
retq
movl $0x2, 0xb53e(%rip)      # 0x102d4
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
retq
// File: /workspace/github_c_makefile_star2_O1/jonof[P]jfaudiolib/src/multivoc.c
// Function: MV_CreateVolumeTable
void MV_CreateVolumeTable
   (
   int index,
   int volume,
   int MaxVolume
   )

   {
   int val;
   int level;
   int i;

   level = ( volume * MaxVolume ) / MV_MaxTotalVolume;
   if ( MV_Bits == 16 )
      {
      for( i = 0; i < 65536; i += 256 )
         {
         val   = i - 0x8000;
         val  *= level;
         val  /= MV_MaxVolume;
         MV_VolumeTable[ index ][ i / 256 ] = val;
         }
      }
   else
      {
      for( i = 0; i < 256; i++ )
         {
         val   = i - 0x80;
         val  *= level;
         val  /= MV_MaxVolume;
         MV_VolumeTable[ volume ][ i ] = val;
         }
      }
   }

// Assembly:
imull %esi, %edx
movslq %edx, %r8
imulq $-0x7f7f7f7f, %r8, %rax # imm = 0x80808081
shrq $0x20, %rax
addl %eax, %r8d
movl %r8d, %eax
shrl $0x1f, %eax
sarl $0x7, %r8d
addl %eax, %r8d
cmpl $0x10, 0xaf47(%rip)     # 0x10218
movl 0xaf34(%rip), %r9d      # 0x1020c
jne 0x5320
movslq %edi, %rax
movl %r8d, %ecx
shll $0xf, %ecx
negl %ecx
shll $0x8, %r8d
shlq $0x9, %rax
leaq 0xb13c(%rip), %rsi      # 0x10430
addq %rax, %rsi
movq $-0x100, %rdi
movl %ecx, %eax
cltd
idivl %r9d
movw %ax, (%rsi)
addl %r8d, %ecx
addq $0x100, %rdi            # imm = 0x100
addq $0x2, %rsi
cmpq $0xff00, %rdi           # imm = 0xFF00
jb 0x52fe
jmp 0x5356
movslq %esi, %rsi
movl %r8d, %ecx
shll $0x7, %ecx
negl %ecx
shlq $0x9, %rsi
xorl %edi, %edi
leaq 0xb0f8(%rip), %r10      # 0x10430
movl %ecx, %eax
cltd
idivl %r9d
leaq (%rsi,%rdi,2), %rdx
movw %ax, (%r10,%rdx)
incq %rdi
addl %r8d, %ecx
cmpq $0x100, %rdi            # imm = 0x100
jne 0x5338
retq
// File: /workspace/github_c_makefile_star2_O1/jonof[P]jfaudiolib/src/multivoc.c
// Function: MV_SetVolume
void MV_SetVolume
   (
   int volume
   )

   {
   volume = max( 0, volume );
   volume = min( volume, MV_MaxTotalVolume );

   MV_TotalVolume = volume;

   // Calculate volume table
   MV_CalcVolume( volume );
   }

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movl %edi, %ebx
xorl %eax, %eax
testl %edi, %edi
cmovlel %eax, %ebx
movl $0xff, %ecx
cmpl %ecx, %ebx
cmovgel %ecx, %ebx
movl %ebx, 0xaeb5(%rip)      # 0x10228
movq 0x14196(%rip), %rcx     # 0x19510
movb $0x0, (%rcx,%rax)
movq 0x1418b(%rip), %rcx     # 0x19510
movb $-0x1, 0x180(%rcx,%rax)
incq %rax
cmpq $0x80, %rax
jne 0x5373
xorl %eax, %eax
movq 0x1416f(%rip), %rcx     # 0x19510
movb %al, 0x80(%rcx,%rax)
incq %rax
cmpq $0x100, %rax            # imm = 0x100
jne 0x539a
cmpl $0x0, 0xae52(%rip)      # 0x1020c
js 0x53d6
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
incl %ebp
movl %ebp, %edi
movl %ebp, %esi
movl %ebx, %edx
callq 0x52a9
cmpl 0xae38(%rip), %ebp      # 0x1020c
jl 0x53c1
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/jonof[P]jfaudiolib/src/mix.c
// Function: MV_Mix8BitMono
void MV_Mix8BitMono( unsigned int position, unsigned int rate,
                    char *start, unsigned int length )
{
    unsigned char *source = (unsigned char *) start;
    unsigned char *dest = (unsigned char *) MV_MixDestination;
    int sample0;
    
    while (length--) {
        sample0 = source[position >> 16];
        position += rate;
        
        sample0 = MV_LeftVolume[sample0] + *dest;
        sample0 = MV_HarshClipTable[sample0 + 128];
        
        *dest = sample0 & 255;
        
        dest += MV_SampleSize;
    }
    
    MV_MixPosition = position;
    MV_MixDestination = (char *) dest;
}

// Assembly:
pushq %r14
pushq %rbx
leaq 0x13d87(%rip), %rax     # 0x19518
movq (%rax), %r8
testl %ecx, %ecx
je 0x57dc
leaq 0x12c99(%rip), %r9      # 0x18438
leaq 0x13d6a(%rip), %r10     # 0x19510
leaq 0xaa63(%rip), %r11      # 0x10210
movl %edi, %ebx
shrl $0x10, %ebx
movzbl (%rdx,%rbx), %ebx
addl %esi, %edi
movq (%r9), %r14
movswq (%r14,%rbx,2), %rbx
movzbl (%r8), %r14d
addq (%r10), %rbx
movb 0x80(%r14,%rbx), %bl
movb %bl, (%r8)
movslq (%r11), %rbx
addq %rbx, %r8
decl %ecx
jne 0x57ad
leaq 0x13d3d(%rip), %rcx     # 0x19520
movl %edi, (%rcx)
movq %r8, (%rax)
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/jonof[P]jfaudiolib/src/mix.c
// Function: MV_Mix8BitStereo
void MV_Mix8BitStereo( unsigned int position, unsigned int rate,
                      char *start, unsigned int length )
{
    unsigned char *source = (unsigned char *) start;
    unsigned char *dest = (unsigned char *) MV_MixDestination;
    int sample0, sample1;
    
    while (length--) {
        sample0 = source[position >> 16];
        sample1 = sample0;
        position += rate;
        
        sample0 = MV_LeftVolume[sample0] + *dest;
        sample1 = MV_RightVolume[sample1] + *(dest + MV_RightChannelOffset);
        sample0 = MV_HarshClipTable[sample0 + 128];
        sample1 = MV_HarshClipTable[sample1 + 128];
        
        *dest = sample0 & 255;
        *(dest + MV_RightChannelOffset) = sample1 & 255;
        
        dest += MV_SampleSize;
    }
    
    MV_MixPosition = position;
    MV_MixDestination = (char *) dest;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
leaq 0x13d1b(%rip), %rax     # 0x19518
movq (%rax), %r8
testl %ecx, %ecx
je 0x5882
leaq 0x12c2d(%rip), %r9      # 0x18438
leaq 0x12c1e(%rip), %r10     # 0x18430
leaq 0x13c53(%rip), %r11     # 0x1946c
leaq 0x13cf0(%rip), %rbx     # 0x19510
leaq 0xa9e9(%rip), %r14      # 0x10210
movl %edi, %r15d
shrl $0x10, %r15d
movzbl (%rdx,%r15), %r15d
addl %esi, %edi
movq (%r9), %r12
addl %r15d, %r15d
movswq (%r12,%r15), %r12
movzbl (%r8), %r13d
movq (%r10), %rbp
movswq (%rbp,%r15), %r15
movslq (%r11), %rbp
movzbl (%r8,%rbp), %ebp
movq (%rbx), %rax
addq %rax, %r12
movb 0x80(%r13,%r12), %r12b
addq %rax, %r15
movb 0x80(%rbp,%r15), %al
movb %r12b, (%r8)
movslq (%r11), %r15
movb %al, (%r8,%r15)
movslq (%r14), %rax
addq %rax, %r8
decl %ecx
jne 0x5827
leaq 0x13c97(%rip), %rax     # 0x19520
movl %edi, (%rax)
leaq 0x13c86(%rip), %rax     # 0x19518
movq %r8, (%rax)
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/jonof[P]jfaudiolib/src/mix.c
// Function: MV_Mix16BitMono
void MV_Mix16BitMono( unsigned int position, unsigned int rate,
                     char *start, unsigned int length )
{
    unsigned char *source = (unsigned char *) start;
    short *dest = (short *) MV_MixDestination;
    int sample0;
    
    while (length--) {
        sample0 = source[position >> 16];
        position += rate;
        
        sample0 = MV_LeftVolume[sample0] + *dest;
        if (sample0 < -32768) sample0 = -32768;
        else if (sample0 > 32767) sample0 = 32767;
        
        *dest = (short) sample0;
        
        dest += MV_SampleSize / 2;
    }
    
    MV_MixPosition = position;
    MV_MixDestination = (char *) dest;
}

// Assembly:
pushq %rbp
pushq %rbx
leaq 0x13c6f(%rip), %rax     # 0x19518
movq (%rax), %r8
testl %ecx, %ecx
je 0x5916
leaq 0x12b81(%rip), %r9      # 0x18438
movq (%r9), %r9
leaq 0xa94f(%rip), %r10      # 0x10210
movl (%r10), %r10d
movl %r10d, %r11d
shrl $0x1f, %r11d
addl %r10d, %r11d
sarl %r11d
movslq %r11d, %r10
addq %r10, %r10
movl %edi, %r11d
shrl $0x10, %r11d
movzbl (%rdx,%r11), %r11d
movzwl (%r9,%r11,2), %ebx
movzwl (%r8), %r11d
leal (%rbx,%r11), %ebp
movswl %bp, %ebp
sarl $0xf, %ebp
xorl $0xffff8000, %ebp       # imm = 0xFFFF8000
addw %r11w, %bx
cmovol %ebp, %ebx
addl %esi, %edi
leaq (%r8,%r10), %r11
movw %bx, (%r8)
movq %r11, %r8
decl %ecx
jne 0x58d7
jmp 0x5919
movq %r8, %r11
leaq 0x13c00(%rip), %rcx     # 0x19520
movl %edi, (%rcx)
movq %r11, (%rax)
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/jonof[P]jfaudiolib/src/mix.c
// Function: MV_Mix16BitStereo
void MV_Mix16BitStereo( unsigned int position, unsigned int rate,
                       char *start, unsigned int length )
{
    unsigned char *source = (unsigned char *) start;
    short *dest = (short *) MV_MixDestination;
    int sample0, sample1;
    
    while (length--) {
        sample0 = source[position >> 16];
        sample1 = sample0;
        position += rate;
        
        sample0 = MV_LeftVolume[sample0] + *dest;
        sample1 = MV_RightVolume[sample1] + *(dest + MV_RightChannelOffset / 2);
        if (sample0 < -32768) sample0 = -32768;
        else if (sample0 > 32767) sample0 = 32767;
        if (sample1 < -32768) sample1 = -32768;
        else if (sample1 > 32767) sample1 = 32767;
        
        *dest = (short) sample0;
        *(dest + MV_RightChannelOffset/2) = (short) sample1;
        
        dest += MV_SampleSize / 2;
    }
    
    MV_MixPosition = position;
    MV_MixDestination = (char *) dest;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
leaq 0x13bdf(%rip), %rax     # 0x19518
movq (%rax), %r8
testl %ecx, %ecx
je 0x59f5
leaq 0x12aed(%rip), %r9      # 0x18438
movq (%r9), %r9
leaq 0x12adb(%rip), %r10     # 0x18430
movq (%r10), %r10
leaq 0x13b0d(%rip), %r11     # 0x1946c
movl (%r11), %r11d
movl %r11d, %ebx
shrl $0x1f, %ebx
addl %r11d, %ebx
sarl %ebx
movslq %ebx, %r11
leaq 0xa899(%rip), %rbx      # 0x10210
movl (%rbx), %ebx
movl %ebx, %ebp
shrl $0x1f, %ebp
addl %ebx, %ebp
sarl %ebp
movslq %ebp, %rbx
addq %rbx, %rbx
movl $0xffff8000, %ebp       # imm = 0xFFFF8000
movl %edi, %r14d
shrl $0x10, %r14d
movzbl (%rdx,%r14), %r15d
addl %r15d, %r15d
movzwl (%r10,%r15), %r14d
movzwl (%r8,%r11,2), %r12d
leal (%r14,%r12), %r13d
movswl %r13w, %r13d
sarl $0xf, %r13d
xorl %ebp, %r13d
addw %r12w, %r14w
movzwl (%r9,%r15), %r12d
movzwl (%r8), %r15d
cmovol %r13d, %r14d
leal (%r12,%r15), %r13d
movswl %r13w, %r13d
sarl $0xf, %r13d
xorl %ebp, %r13d
addw %r15w, %r12w
cmovol %r13d, %r12d
addl %esi, %edi
leaq (%r8,%rbx), %r15
movw %r12w, (%r8)
movw %r14w, (%r8,%r11,2)
movq %r15, %r8
decl %ecx
jne 0x598d
jmp 0x59f8
movq %r8, %r15
leaq 0x13b21(%rip), %rcx     # 0x19520
movl %edi, (%rcx)
movq %r15, (%rax)
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/jonof[P]jfaudiolib/src/mix.c
// Function: MV_Mix16BitMono16
void MV_Mix16BitMono16( unsigned int position, unsigned int rate,
                       char *start, unsigned int length )
{
    unsigned short *source = (unsigned short *) start;
    short *dest = (short *) MV_MixDestination;
    int sample0l, sample0h, sample0;
    
    while (length--) {
        sample0 = source[position >> 16];
#ifdef BIGENDIAN
        sample0l = sample0 >> 8;
        sample0h = (sample0 & 255) ^ 128;
#else
        sample0l = sample0 & 255;
        sample0h = (sample0 >> 8) ^ 128;
#endif
        position += rate;
        
        sample0l = MV_LeftVolume[sample0l] >> 8;
        sample0h = MV_LeftVolume[sample0h];
        sample0 = sample0l + sample0h + 128 + *dest;
        if (sample0 < -32768) sample0 = -32768;
        else if (sample0 > 32767) sample0 = 32767;
        
        *dest = (short) sample0;
        
        dest += MV_SampleSize / 2;
    }
    
    MV_MixPosition = position;
    MV_MixDestination = (char *) dest;
}

// Assembly:
pushq %rbx
leaq 0x13b01(%rip), %rax     # 0x19518
movq (%rax), %r8
testl %ecx, %ecx
je 0x5ab3
leaq 0x12a0f(%rip), %r9      # 0x18438
movq (%r9), %r9
leaq 0xa7dd(%rip), %r10      # 0x10210
movl (%r10), %r10d
movl %r10d, %r11d
shrl $0x1f, %r11d
addl %r10d, %r11d
sarl %r11d
movslq %r11d, %r10
addq %r10, %r10
movl %edi, %r11d
shrl $0x10, %r11d
movzwl (%rdx,%r11,2), %r11d
movzbl %r11b, %ebx
movsbl 0x1(%r9,%rbx,2), %ebx
shrl $0x7, %r11d
andl $-0x2, %r11d
xorl $0x100, %r11d           # imm = 0x100
movswl (%r9,%r11), %r11d
addl %ebx, %r11d
movswl (%r8), %ebx
addl %r11d, %ebx
addl $0x80, %ebx
movl $0x7fff, %r11d          # imm = 0x7FFF
cmpl %r11d, %ebx
jl 0x5a93
movl $0x7fff, %ebx           # imm = 0x7FFF
cmpl $0xffff8001, %ebx       # imm = 0xFFFF8001
jge 0x5aa0
movl $0xffff8000, %ebx       # imm = 0xFFFF8000
addl %esi, %edi
leaq (%r8,%r10), %r11
movw %bx, (%r8)
movq %r11, %r8
decl %ecx
jne 0x5a49
jmp 0x5ab6
movq %r8, %r11
leaq 0x13a63(%rip), %rcx     # 0x19520
movl %edi, (%rcx)
movq %r11, (%rax)
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/jonof[P]jfaudiolib/src/mix.c
// Function: MV_Mix8BitMono16
void MV_Mix8BitMono16( unsigned int position, unsigned int rate,
                      char *start, unsigned int length )
{
    signed char *source = (signed char *) start + 1;
    unsigned char *dest = (unsigned char *) MV_MixDestination;
    int sample0;
    
    while (length--) {
        sample0 = source[(position >> 16) << 1];
        position += rate;
        
        sample0 = MV_LeftVolume[sample0 + 128] + *dest;
        sample0 = MV_HarshClipTable[sample0 + 128];
        
        *dest = sample0 & 255;
        
        dest += MV_SampleSize;
    }
    
    MV_MixPosition = position;
    MV_MixDestination = (char *) dest;
}

// Assembly:
pushq %r14
pushq %rbx
leaq 0x13a4a(%rip), %rax     # 0x19518
movq (%rax), %r8
testl %ecx, %ecx
je 0x5b1d
leaq 0x1295c(%rip), %r9      # 0x18438
leaq 0x13a2d(%rip), %r10     # 0x19510
leaq 0xa726(%rip), %r11      # 0x10210
movl %edi, %ebx
shrl $0x10, %ebx
movsbl 0x1(%rdx,%rbx,2), %ebx
addl %esi, %edi
movq (%r9), %r14
subl $-0x80, %ebx
movswq (%r14,%rbx,2), %rbx
movzbl (%r8), %r14d
addq (%r10), %rbx
movb 0x80(%r14,%rbx), %bl
movb %bl, (%r8)
movslq (%r11), %rbx
addq %rbx, %r8
decl %ecx
jne 0x5aea
leaq 0x139fc(%rip), %rcx     # 0x19520
movl %edi, (%rcx)
movq %r8, (%rax)
popq %rbx
popq %r14
retq