LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O3/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, 0xcb63(%rip)      # 0x102d0
je 0x37d3
movl 0x15daf(%rip), %eax     # 0x19524
leal 0x1(%rax), %ecx
movl %ecx, 0x15da6(%rip)     # 0x19524
testl %eax, %eax
jg 0x3787
callq 0x2d13
movq 0xcb4a(%rip), %rax      # 0x102d8
leaq 0xcb43(%rip), %rbx      # 0x102d8
cmpq %rbx, %rax
je 0x37b6
movq (%rax), %r14
cmpl $0x7fffffff, 0x7c(%rax) # imm = 0x7FFFFFFF
je 0x37ae
movl 0x78(%rax), %edi
callq 0x37ec
movq %r14, %rax
cmpq %rbx, %r14
jne 0x379a
movl 0x15d68(%rip), %eax     # 0x19524
leal -0x1(%rax), %ecx
movl %ecx, 0x15d5f(%rip)     # 0x19524
xorl %ebx, %ebx
cmpl $0x1, %eax
jg 0x37e2
callq 0x2d2c
jmp 0x37e2
movl $0x2, 0xcaf7(%rip)      # 0x102d4
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/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, 0xcada(%rip)      # 0x102d0
je 0x3859
movl %edi, %ebx
movl 0x15d24(%rip), %eax     # 0x19524
leal 0x1(%rax), %ecx
movl %ecx, 0x15d1b(%rip)     # 0x19524
testl %eax, %eax
jg 0x3812
callq 0x2d13
movl %ebx, %edi
callq 0x36b0
testq %rax, %rax
je 0x3865
movl 0xa0(%rax), %ebx
movq %rax, %rdi
callq 0x3896
movl 0x15cf2(%rip), %eax     # 0x19524
leal -0x1(%rax), %ecx
movl %ecx, 0x15ce9(%rip)     # 0x19524
cmpl $0x1, %eax
jg 0x3845
callq 0x2d2c
movq 0xcb34(%rip), %rax      # 0x10380
xorl %ebp, %ebp
testq %rax, %rax
je 0x388d
movl %ebx, %edi
callq *%rax
jmp 0x388d
movl $0x2, 0xca71(%rip)      # 0x102d4
jmp 0x3888
movl 0x15cb9(%rip), %eax     # 0x19524
leal -0x1(%rax), %ecx
movl %ecx, 0x15cb0(%rip)     # 0x19524
cmpl $0x1, %eax
jg 0x387e
callq 0x2d2c
movl $0x6, 0xca4c(%rip)      # 0x102d4
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/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 0x15c84(%rip), %ecx     # 0x19524
leal 0x1(%rcx), %eax
movl %eax, 0x15c7b(%rip)     # 0x19524
testl %ecx, %ecx
jg 0x38b8
callq 0x2d13
movl 0x15c6c(%rip), %eax     # 0x19524
movq (%rbx), %rcx
movq 0x8(%rbx), %rdx
movq %rcx, (%rdx)
movq %rdx, 0x8(%rcx)
movq %rbx, 0x8(%rbx)
leaq 0xcab7(%rip), %rcx      # 0x10388
movq %rcx, (%rbx)
movq 0xcab5(%rip), %rcx      # 0x10390
movq %rcx, 0x8(%rbx)
movq %rbx, (%rcx)
movq %rbx, 0xcaa7(%rip)      # 0x10390
leal -0x1(%rax), %ecx
movl %ecx, 0x15c32(%rip)     # 0x19524
cmpl $0x1, %eax
jg 0x38fc
callq 0x2d2c
cmpl $0x4, 0x10(%rbx)
jne 0x390b
movq %rbx, %rdi
popq %rbx
jmp 0x6a22
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/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, 0xc9b9(%rip)      # 0x102d0
je 0x3961
movl %esi, %ebx
movl %edi, %ebp
movl 0x15c01(%rip), %eax     # 0x19524
leal 0x1(%rax), %ecx
movl %ecx, 0x15bf8(%rip)     # 0x19524
testl %eax, %eax
jg 0x3935
callq 0x2d13
movl %ebp, %edi
callq 0x36b0
testq %rax, %rax
je 0x396d
movl %ebx, 0x74(%rax)
movl 0x15bda(%rip), %eax     # 0x19524
leal -0x1(%rax), %ecx
movl %ecx, 0x15bd1(%rip)     # 0x19524
xorl %ebx, %ebx
cmpl $0x1, %eax
jg 0x3995
callq 0x2d2c
jmp 0x3995
movl $0x2, 0xc969(%rip)      # 0x102d4
jmp 0x3990
movl 0x15bb1(%rip), %eax     # 0x19524
leal -0x1(%rax), %ecx
movl %ecx, 0x15ba8(%rip)     # 0x19524
cmpl $0x1, %eax
jg 0x3986
callq 0x2d2c
movl $0x6, 0xc944(%rip)      # 0x102d4
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/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, 0xc92a(%rip)      # 0x102d0
je 0x39f7
movl 0x15b76(%rip), %eax     # 0x19524
leal 0x1(%rax), %ecx
movl %ecx, 0x15b6d(%rip)     # 0x19524
testl %eax, %eax
jg 0x39c0
callq 0x2d13
movq 0xc911(%rip), %rax      # 0x102d8
leaq 0xc90a(%rip), %rcx      # 0x102d8
xorl %ebx, %ebx
cmpq %rcx, %rax
je 0x39dc
incl %ebx
movq (%rax), %rax
jmp 0x39d0
movl 0x15b42(%rip), %eax     # 0x19524
leal -0x1(%rax), %ecx
movl %ecx, 0x15b39(%rip)     # 0x19524
cmpl $0x1, %eax
jg 0x3a03
callq 0x2d2c
jmp 0x3a03
movl $0x2, 0xc8d3(%rip)      # 0x102d4
xorl %ebx, %ebx
movl %ebx, %eax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/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 0x15b11(%rip), %eax     # 0x19524
leal 0x1(%rax), %ecx
movl %ecx, 0x15b08(%rip)     # 0x19524
testl %eax, %eax
jg 0x3a25
callq 0x2d13
leaq 0xc95c(%rip), %r14      # 0x10388
movq 0xc955(%rip), %rax      # 0x10388
cmpq %r14, %rax
jne 0x3a76
movq 0xc951(%rip), %rax      # 0x10390
cmpq %r14, %rax
jne 0x3a76
movq 0xc88d(%rip), %rax      # 0x102d8
leaq 0xc886(%rip), %rcx      # 0x102d8
movq (%rax), %rdx
cmpq %rcx, %rdx
je 0x3a69
movl 0x7c(%rdx), %esi
cmpl 0x7c(%rax), %esi
cmovlq %rdx, %rax
movq (%rdx), %rdx
jmp 0x3a55
cmpl %ebx, 0x7c(%rax)
jg 0x3a76
movl 0x78(%rax), %edi
callq 0x37ec
movq 0xc90b(%rip), %rax      # 0x10388
cmpq %r14, %rax
je 0x3a8a
movl 0x15a9c(%rip), %eax     # 0x19524
jmp 0x3a9c
movq 0xc8ff(%rip), %rcx      # 0x10390
movl 0x15a8d(%rip), %eax     # 0x19524
cmpq %r14, %rcx
je 0x3b10
movq 0xc8e5(%rip), %rbx      # 0x10388
movq (%rbx), %rcx
movq 0x8(%rbx), %rdx
movq %rcx, (%rdx)
movq %rdx, 0x8(%rcx)
movq %rbx, (%rbx)
movq %rbx, 0x8(%rbx)
leal -0x1(%rax), %ecx
movl %ecx, 0x15a63(%rip)     # 0x19524
cmpl $0x1, %eax
jg 0x3acb
callq 0x2d2c
xorl %ebp, %ebp
movl 0xc741(%rip), %edi      # 0x10214
testl %edi, %edi
cmovlel %ebp, %edi
incl %edi
movl %edi, 0xc734(%rip)      # 0x10214
cmpl $0x0, 0xc7e9(%rip)      # 0x102d0
je 0x3afb
callq 0x36b0
testq %rax, %rax
jne 0x3acd
movl 0xc71b(%rip), %edi      # 0x10214
jmp 0x3b05
movl $0x2, 0xc7cf(%rip)      # 0x102d4
movl %edi, 0x78(%rbx)
movq %rbx, %rax
popq %rbx
popq %r14
popq %rbp
retq
leal -0x1(%rax), %ecx
movl %ecx, 0x15a0b(%rip)     # 0x19524
cmpl $0x1, %eax
jg 0x3b23
callq 0x2d2c
xorl %ebx, %ebx
jmp 0x3b08
// File: /workspace/github_c_makefile_star2_O3/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 0xc853(%rip), %rax      # 0x10388
movq 0xc84c(%rip), %rcx      # 0x10388
movl $0x1, %ebx
cmpq %rax, %rcx
jne 0x3bbc
movq 0xc843(%rip), %rcx      # 0x10390
cmpq %rax, %rcx
jne 0x3bbc
movl %edi, %ebp
movl 0x159ca(%rip), %eax     # 0x19524
leal 0x1(%rax), %ecx
movl %ecx, 0x159c1(%rip)     # 0x19524
testl %eax, %eax
jg 0x3b6c
callq 0x2d13
movq 0xc765(%rip), %r14      # 0x102d8
leaq 0xc75e(%rip), %r15      # 0x102d8
movq 0xc757(%rip), %rax      # 0x102d8
cmpq %r15, %rax
je 0x3b96
movl 0x7c(%rax), %ecx
cmpl 0x7c(%r14), %ecx
cmovlq %rax, %r14
movq (%rax), %rax
jmp 0x3b81
movl 0x15988(%rip), %eax     # 0x19524
leal -0x1(%rax), %ecx
movl %ecx, 0x1597f(%rip)     # 0x19524
cmpl $0x1, %eax
jg 0x3baf
callq 0x2d2c
cmpq %r15, %r14
je 0x3bba
cmpl %ebp, 0x7c(%r14)
jle 0x3bbc
xorl %ebx, %ebx
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/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, 0xc700(%rip)      # 0x102d0
je 0x3c10
pushq %rbp
pushq %r14
pushq %rbx
movl %esi, %ebp
callq 0x36b0
testq %rax, %rax
je 0x3c21
movq %rax, %rbx
movl 0x64(%rax), %r14d
movl %ebp, %edi
callq 0x6520
movl %eax, 0x4c(%rbx)
imull %r14d, %eax
xorl %ecx, %ecx
xorl %edx, %edx
divl 0x158ff(%rip)           # 0x19500
movl %eax, 0x68(%rbx)
movl %eax, %edx
shll $0x8, %edx
subl %eax, %edx
movl %edx, 0x50(%rbx)
jmp 0x3c30
movl $0x2, 0xc6ba(%rip)      # 0x102d4
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
jmp 0x3c34
movl $0x6, 0xc6a9(%rip)      # 0x102d4
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
popq %rbx
popq %r14
popq %rbp
movl %ecx, %eax
retq
// File: /workspace/github_c_makefile_star2_O3/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, 0xc68e(%rip)      # 0x102d0
je 0x3c7f
movl %esi, %ebp
callq 0x36b0
testq %rax, %rax
je 0x3c8b
movq %rax, %r14
movl %ebp, 0x64(%rax)
xorl %ebx, %ebx
xorl %edi, %edi
callq 0x6520
movl %eax, 0x4c(%r14)
imull %ebp, %eax
xorl %edx, %edx
divl 0x15892(%rip)           # 0x19500
movl %eax, 0x68(%r14)
movl %eax, %ecx
shll $0x8, %ecx
subl %eax, %ecx
movl %ecx, 0x50(%r14)
jmp 0x3c9a
movl $0x2, 0xc64b(%rip)      # 0x102d4
jmp 0x3c95
movl $0x6, 0xc63f(%rip)      # 0x102d4
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
movl %ebx, %eax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/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, 0xc3c8(%rip)      # 0x1021c
cmovel %esi, %edx
cmovel %esi, %ecx
movl 0xc3ac(%rip), %esi      # 0x1020c
incl %esi
xorl %r8d, %r8d
cmpl %r8d, 0x145d4(%rip)     # 0x18440
movl %ecx, %eax
cmovel %edx, %eax
cmovnel %edx, %ecx
movl $0xff, %edx
cmpl %edx, %eax
cmovgel %edx, %eax
testl %eax, %eax
cmovlel %r8d, %eax
imull %esi, %eax
cmpl %edx, %ecx
cmovgel %edx, %ecx
testl %ecx, %ecx
cmovlel %r8d, %ecx
imull %esi, %ecx
sarl $0x8, %ecx
movslq %ecx, %rcx
shlq $0x9, %rcx
leaq 0xc58a(%rip), %rdx      # 0x10430
addq %rdx, %rcx
sarl $0x8, %eax
cltq
shlq $0x9, %rax
addq %rdx, %rax
movq %rax, 0x90(%rdi)
movq %rcx, 0x98(%rdi)
jmp 0x3cfd
// File: /workspace/github_c_makefile_star2_O3/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 0x2d13
movl %ebx, %edi
callq 0x36b0
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 0x2d2c
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 0x2d2c
movl $0x6, 0xc37d(%rip)      # 0x102d4
movl $0xfffffffe, %ebx       # imm = 0xFFFFFFFE
movl %ebx, %eax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/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 0x36b0
testq %rax, %rax
je 0x3fa1
movq %rax, %rdi
movl %r14d, %esi
movl %ebp, %edx
movl %ebx, %ecx
callq 0x3e4d
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_O3/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 0x2cfa
movl 0x150b1(%rip), %eax     # 0x19524
leal 0x1(%rax), %ecx
movl %ecx, 0x150a8(%rip)     # 0x19524
testl %eax, %eax
jg 0x4485
callq 0x2d13
movq 0xbe4c(%rip), %rbx      # 0x102d8
leaq 0xbe45(%rip), %r14      # 0x102d8
cmpq %r14, %rbx
je 0x44bf
movq (%rbx), %r15
movq %rbx, %rdi
callq 0x3896
movq 0xbed6(%rip), %rax      # 0x10380
testq %rax, %rax
je 0x44b7
movl 0xa0(%rbx), %edi
callq *%rax
movq %r15, %rbx
cmpq %r14, %r15
jne 0x4498
movl 0x1505f(%rip), %eax     # 0x19524
leal -0x1(%rax), %ecx
movl %ecx, 0x15056(%rip)     # 0x19524
cmpl $0x1, %eax
jle 0x44d9
popq %rbx
popq %r14
popq %r15
retq
popq %rbx
popq %r14
popq %r15
jmp 0x2d2c
// File: /workspace/github_c_makefile_star2_O3/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, 0xbdd5(%rip)      # 0x102d0
je 0x45e1
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 0x3a07
testq %rax, %rax
je 0x45f1
movq %rax, %r15
movl 0x48(%rsp), %eax
movl $0x2, 0x10(%r15)
movw $0x108, 0x14(%r15)      # imm = 0x108
leaq 0xc0(%rip), %rcx        # 0x460f
movq %rcx, 0x18(%r15)
xorps %xmm0, %xmm0
movups %xmm0, 0x28(%r15)
movq %rbx, 0x80(%r15)
xorl %ecx, %ecx
movl %ecx, 0x40(%r15)
movl %ecx, 0x6c(%r15)
movq $0x0, 0x58(%r15)
movl %ecx, 0x60(%r15)
movl %ecx, 0x48(%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 0x6520
movl %eax, 0x4c(%r15)
imull %r12d, %eax
xorl %edx, %edx
divl 0x14f4d(%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 0x3e4d
movq %r15, %rdi
callq 0x360b
movl 0x78(%r15), %eax
jmp 0x4600
movl $0x2, 0xbce9(%rip)      # 0x102d4
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
retq
movl $0x4, 0xbcd9(%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_O3/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 0x464c
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 0x4644
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 0x4697
movl $0x1, %eax
cmpq $0x0, (%r14)
jne 0x4644
xorl %eax, %eax
jmp 0x4644
// File: /workspace/github_c_makefile_star2_O3/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, 0xbbf3(%rip)      # 0x102d0
je 0x47ba
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 0x3a07
testq %rax, %rax
je 0x47ca
movq %rax, %rbx
movl 0x60(%rsp), %eax
xorl %ecx, %ecx
movl %ecx, 0x10(%rbx)
movw $0x108, 0x14(%rbx)      # imm = 0x108
leaq 0xbb(%rip), %rdx        # 0x47e8
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 0x6520
movl %eax, 0x4c(%rbx)
imull %ebp, %eax
xorl %edx, %edx
divl 0x14d74(%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 0x3e4d
movq %rbx, %rdi
callq 0x360b
movl 0x78(%rbx), %eax
jmp 0x47d9
movl $0x2, 0xbb10(%rip)      # 0x102d4
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
retq
movl $0x4, 0xbb00(%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_O3/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:
movl 0x48(%rdi), %eax
testl %eax, %eax
je 0x47fb
movq 0x28(%rdi), %rcx
movl 0x6c(%rdi), %edx
subl 0x60(%rdi), %edx
jmp 0x4809
movq 0x30(%rdi), %rcx
testq %rcx, %rcx
je 0x4854
movl 0x44(%rdi), %eax
xorl %edx, %edx
movq %rcx, 0x58(%rdi)
movl %edx, 0x6c(%rdi)
movl $0x8000, %edx           # imm = 0x8000
cmpl %edx, %eax
cmovbl %eax, %edx
movsbl 0x15(%rdi), %esi
movsbl 0x14(%rdi), %r8d
imull %esi, %r8d
leal 0x7(%r8), %esi
testw %r8w, %r8w
cmovnsl %r8d, %esi
movswl %si, %esi
sarl $0x3, %esi
imull %edx, %esi
addq %rcx, %rsi
movq %rsi, 0x28(%rdi)
subl %edx, %eax
movl %eax, 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_O3/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, 0xb7ca(%rip)      # 0x102d0
je 0x4b96
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
cmovael %ecx, %edx
negl %r11d
movl 0xb6c7(%rip), %ecx      # 0x1020c
incl %ecx
imull %edx, %ecx
sarl $0x8, %ecx
andl $0x1f, %r8d
movslq %ecx, %rcx
shll $0x7, %r8d
leaq 0x138f1(%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 0x4890
addq $0x28, %rsp
popq %rbx
popq %r14
retq
movl $0x2, 0xb734(%rip)      # 0x102d4
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
retq
// File: /workspace/github_c_makefile_star2_O3/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, 0xb723(%rip)      # 0x102d0
je 0x4c4d
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
cmovael %edx, %ecx
negl %r14d
movl 0xb618(%rip), %edx      # 0x1020c
incl %edx
imull %ecx, %edx
sarl $0x8, %edx
andl $0x1f, %r9d
movslq %edx, %rcx
shll $0x7, %r9d
leaq 0x13842(%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 0x46d6
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
movl $0x2, 0xb67d(%rip)      # 0x102d4
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
retq
// File: /workspace/github_c_makefile_star2_O3/jonof[P]jfaudiolib/src/multivoc.c
// Function: MV_GetNextWAVBlock
static playbackstatus MV_GetNextWAVBlock
   (
   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:
movl 0x48(%rdi), %eax
testl %eax, %eax
je 0x4c70
movq 0x28(%rdi), %rcx
movl 0x6c(%rdi), %edx
subl 0x60(%rdi), %edx
jmp 0x4c7e
movq 0x30(%rdi), %rcx
testq %rcx, %rcx
je 0x4cc9
movl 0x44(%rdi), %eax
xorl %edx, %edx
movq %rcx, 0x58(%rdi)
movl %edx, 0x6c(%rdi)
movl $0x8000, %edx           # imm = 0x8000
cmpl %edx, %eax
cmovbl %eax, %edx
movsbl 0x15(%rdi), %esi
movsbl 0x14(%rdi), %r8d
imull %esi, %r8d
leal 0x7(%r8), %esi
testw %r8w, %r8w
cmovnsl %r8d, %esi
movswl %si, %esi
sarl $0x3, %esi
imull %edx, %esi
addq %rcx, %rsi
movq %rsi, 0x28(%rdi)
subl %edx, %eax
movl %eax, 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_O3/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, 0xb5f6(%rip)      # 0x102d0
je 0x4d6a
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
cmovael %ecx, %edx
negl %r11d
movl 0xb4f3(%rip), %ecx      # 0x1020c
incl %ecx
imull %edx, %ecx
sarl $0x8, %ecx
andl $0x1f, %r8d
movslq %ecx, %rcx
shll $0x7, %r8d
leaq 0x1371d(%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 0x4dac
addq $0x28, %rsp
popq %rbx
popq %r14
retq
movl $0x2, 0xb560(%rip)      # 0x102d4
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
retq
// File: /workspace/github_c_makefile_star2_O3/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, 0xaf7a(%rip)     # 0x10218
movl 0xaf67(%rip), %r9d      # 0x1020c
jne 0x52ed
movslq %edi, %rax
movl %r8d, %ecx
shll $0xf, %ecx
negl %ecx
shll $0x8, %r8d
shlq $0x9, %rax
leaq 0xb16f(%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 0x52cb
jmp 0x5323
movslq %esi, %rsi
movl %r8d, %ecx
shll $0x7, %ecx
negl %ecx
shlq $0x9, %rsi
xorl %edi, %edi
leaq 0xb12b(%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 0x5305
retq
// File: /workspace/github_c_makefile_star2_O3/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, 0xaee8(%rip)      # 0x10228
movq 0x141c9(%rip), %rcx     # 0x19510
movb $0x0, (%rcx,%rax)
movq 0x141be(%rip), %rcx     # 0x19510
movb $-0x1, 0x180(%rcx,%rax)
incq %rax
cmpq $0x80, %rax
jne 0x5340
xorl %eax, %eax
movq 0x141a2(%rip), %rcx     # 0x19510
movb %al, 0x80(%rcx,%rax)
incq %rax
cmpq $0x100, %rax            # imm = 0x100
jne 0x5367
cmpl $0x0, 0xae85(%rip)      # 0x1020c
js 0x53a3
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
incl %ebp
movl %ebp, %edi
movl %ebp, %esi
movl %ebx, %edx
callq 0x5276
cmpl 0xae6b(%rip), %ebp      # 0x1020c
jl 0x538e
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/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 0x13cf6(%rip), %rax     # 0x19518
movq (%rax), %r8
testl %ecx, %ecx
je 0x586d
leaq 0x12c08(%rip), %r9      # 0x18438
leaq 0x13cd9(%rip), %r10     # 0x19510
leaq 0xa9d2(%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 0x583e
leaq 0x13cac(%rip), %rcx     # 0x19520
movl %edi, (%rcx)
movq %r8, (%rax)
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/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 0x13c8a(%rip), %rax     # 0x19518
movq (%rax), %r8
testl %ecx, %ecx
je 0x5913
leaq 0x12b9c(%rip), %r9      # 0x18438
leaq 0x12b8d(%rip), %r10     # 0x18430
leaq 0x13bc2(%rip), %r11     # 0x1946c
leaq 0x13c5f(%rip), %rbx     # 0x19510
leaq 0xa958(%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 0x58b8
leaq 0x13c06(%rip), %rax     # 0x19520
movl %edi, (%rax)
leaq 0x13bf5(%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_O3/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 0x13bde(%rip), %rax     # 0x19518
movq (%rax), %r8
testl %ecx, %ecx
je 0x59a7
leaq 0x12af0(%rip), %r9      # 0x18438
movq (%r9), %r9
leaq 0xa8be(%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 0x5968
jmp 0x59aa
movq %r8, %r11
leaq 0x13b6f(%rip), %rcx     # 0x19520
movl %edi, (%rcx)
movq %r11, (%rax)
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/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 0x13b4e(%rip), %rax     # 0x19518
movq (%rax), %r8
testl %ecx, %ecx
je 0x5a86
leaq 0x12a5c(%rip), %r9      # 0x18438
movq (%r9), %r9
leaq 0x12a4a(%rip), %r10     # 0x18430
movq (%r10), %r10
leaq 0x13a7c(%rip), %r11     # 0x1946c
movl (%r11), %r11d
movl %r11d, %ebx
shrl $0x1f, %ebx
addl %r11d, %ebx
sarl %ebx
movslq %ebx, %r11
leaq 0xa808(%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 0x5a1e
jmp 0x5a89
movq %r8, %r15
leaq 0x13a90(%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_O3/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 0x13a70(%rip), %rax     # 0x19518
movq (%rax), %r8
testl %ecx, %ecx
je 0x5b44
leaq 0x1297e(%rip), %r9      # 0x18438
movq (%r9), %r9
leaq 0xa74c(%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 0x5b24
movl $0x7fff, %ebx           # imm = 0x7FFF
cmpl $0xffff8001, %ebx       # imm = 0xFFFF8001
jge 0x5b31
movl $0xffff8000, %ebx       # imm = 0xFFFF8000
addl %esi, %edi
leaq (%r8,%r10), %r11
movw %bx, (%r8)
movq %r11, %r8
decl %ecx
jne 0x5ada
jmp 0x5b47
movq %r8, %r11
leaq 0x139d2(%rip), %rcx     # 0x19520
movl %edi, (%rcx)
movq %r11, (%rax)
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/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 0x139b9(%rip), %rax     # 0x19518
movq (%rax), %r8
testl %ecx, %ecx
je 0x5bb0
leaq 0x128cb(%rip), %r9      # 0x18438
leaq 0x1399c(%rip), %r10     # 0x19510
leaq 0xa695(%rip), %r11      # 0x10210
movl %edi, %ebx
shrl $0x10, %ebx
movsbq 0x1(%rdx,%rbx,2), %rbx
addl %esi, %edi
movq (%r9), %r14
movswq 0x100(%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 0x5b7b
leaq 0x13969(%rip), %rcx     # 0x19520
movl %edi, (%rcx)
movq %r8, (%rax)
popq %rbx
popq %r14
retq