// File: /workspace/github_c_makefile_star2_O0/jonof[P]jfaudiolib/src/multivoc.c
// Function: MV_SetVoiceMixMode
void MV_SetVoiceMixMode
   (
   VoiceNode *voice
   )

   {
   //int flags;
   int test;

   //flags = DisableInterrupts();

   test = T_DEFAULT;
   if ( MV_Bits == 8 )
      {
      test |= T_8BITS;
      }

   if ( MV_Channels == 1 )
      {
      test |= T_MONO;
      }
   else
      {
      if ( IS_QUIET( voice->RightVolume ) )
         {
         test |= T_RIGHTQUIET;
         }
      else if ( IS_QUIET( voice->LeftVolume ) )
         {
         test |= T_LEFTQUIET;
         }
      }

   if ( voice->bits == 16 )
      {
      test |= T_16BITSOURCE;
      }

   if ( voice->channels == 2 )
      {
      test |= T_STEREOSOURCE;
      test &= ~(T_RIGHTQUIET | T_LEFTQUIET);
      }

   switch( test )
      {
      case T_8BITS | T_MONO | T_16BITSOURCE :
         voice->mix = MV_Mix8BitMono16;
         break;

      case T_8BITS | T_MONO :
         voice->mix = MV_Mix8BitMono;
         break;

      case T_8BITS | T_16BITSOURCE | T_LEFTQUIET :
         MV_LeftVolume = MV_RightVolume;
         voice->mix = MV_Mix8BitMono16;
         break;

      case T_8BITS | T_LEFTQUIET :
         MV_LeftVolume = MV_RightVolume;
         voice->mix = MV_Mix8BitMono;
         break;

      case T_8BITS | T_16BITSOURCE | T_RIGHTQUIET :
         voice->mix = MV_Mix8BitMono16;
         break;

      case T_8BITS | T_RIGHTQUIET :
         voice->mix = MV_Mix8BitMono;
         break;

      case T_8BITS | T_16BITSOURCE :
         voice->mix = MV_Mix8BitStereo16;
         break;

      case T_8BITS :
         voice->mix = MV_Mix8BitStereo;
         break;

      case T_MONO | T_16BITSOURCE :
         voice->mix = MV_Mix16BitMono16;
         break;

      case T_MONO :
         voice->mix = MV_Mix16BitMono;
         break;

      case T_16BITSOURCE | T_LEFTQUIET :
         MV_LeftVolume = MV_RightVolume;
         voice->mix = MV_Mix16BitMono16;
         break;

      case T_LEFTQUIET :
         MV_LeftVolume = MV_RightVolume;
         voice->mix = MV_Mix16BitMono;
         break;

      case T_16BITSOURCE | T_RIGHTQUIET :
         voice->mix = MV_Mix16BitMono16;
         break;

      case T_RIGHTQUIET :
         voice->mix = MV_Mix16BitMono;
         break;

      case T_16BITSOURCE :
         voice->mix = MV_Mix16BitStereo16;
         break;

      case T_SIXTEENBIT_STEREO :
         voice->mix = MV_Mix16BitStereo;
         break;

      case T_16BITSOURCE | T_STEREOSOURCE:
         voice->mix = MV_Mix16BitStereo16Stereo;
         break;

      case T_16BITSOURCE | T_STEREOSOURCE | T_8BITS:
         voice->mix = MV_Mix8BitStereo16Stereo;
         break;

      case T_16BITSOURCE | T_STEREOSOURCE | T_MONO:
         voice->mix = MV_Mix16BitMono16Stereo;
         break;

      case T_16BITSOURCE | T_STEREOSOURCE | T_8BITS | T_MONO:
         voice->mix = MV_Mix8BitMono16Stereo;
         break;

      case T_STEREOSOURCE:
         voice->mix = MV_Mix16BitStereo8Stereo;
         break;

      case T_STEREOSOURCE | T_8BITS:
         voice->mix = MV_Mix8BitStereo8Stereo;
         break;

      case T_STEREOSOURCE | T_MONO:
         voice->mix = MV_Mix16BitMono8Stereo;
         break;

      case T_STEREOSOURCE | T_8BITS | T_MONO:
         voice->mix = MV_Mix8BitMono8Stereo;
         break;

      default :
         voice->mix = 0;
      }

   //RestoreInterrupts( flags );
   }

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movl $0x0, -0xc(%rbp)
cmpl $0x8, 0x107ce(%rip)     # 0x15724
jne 0x4f61
movl -0xc(%rbp), %eax
orl $0x1, %eax
movl %eax, -0xc(%rbp)
cmpl $0x1, 0x107c0(%rip)     # 0x15728
jne 0x4f75
movl -0xc(%rbp), %eax
orl $0x2, %eax
movl %eax, -0xc(%rbp)
jmp 0x4fb5
movq -0x8(%rbp), %rax
leaq 0x10e80(%rip), %rcx     # 0x15e00
cmpq %rcx, 0x98(%rax)
jne 0x4f94
movl -0xc(%rbp), %eax
orl $0x20, %eax
movl %eax, -0xc(%rbp)
jmp 0x4fb3
movq -0x8(%rbp), %rax
leaq 0x10e61(%rip), %rcx     # 0x15e00
cmpq %rcx, 0x90(%rax)
jne 0x4fb1
movl -0xc(%rbp), %eax
orl $0x10, %eax
movl %eax, -0xc(%rbp)
jmp 0x4fb3
jmp 0x4fb5
movq -0x8(%rbp), %rax
movsbl 0x14(%rax), %eax
cmpl $0x10, %eax
jne 0x4fcb
movl -0xc(%rbp), %eax
orl $0x4, %eax
movl %eax, -0xc(%rbp)
movq -0x8(%rbp), %rax
movsbl 0x15(%rax), %eax
cmpl $0x2, %eax
jne 0x4fea
movl -0xc(%rbp), %eax
orl $0x8, %eax
movl %eax, -0xc(%rbp)
movl -0xc(%rbp), %eax
andl $-0x31, %eax
movl %eax, -0xc(%rbp)
movl -0xc(%rbp), %eax
movq %rax, -0x18(%rbp)
subq $0x25, %rax
ja 0x5212
movq -0x18(%rbp), %rax
leaq 0xa46a(%rip), %rcx      # 0xf470
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq -0x8(%rbp), %rax
leaq 0x3756(%rip), %rcx      # 0x8770
movq %rcx, 0x20(%rax)
jmp 0x521e
movq -0x8(%rbp), %rax
leaq 0x3162(%rip), %rcx      # 0x8190
movq %rcx, 0x20(%rax)
jmp 0x521e
movq 0x18dc2(%rip), %rax     # 0x1de00
movq %rax, 0x18dc3(%rip)     # 0x1de08
movq -0x8(%rbp), %rax
leaq 0x3720(%rip), %rcx      # 0x8770
movq %rcx, 0x20(%rax)
jmp 0x521e
movq 0x18da0(%rip), %rax     # 0x1de00
movq %rax, 0x18da1(%rip)     # 0x1de08
movq -0x8(%rbp), %rax
leaq 0x311e(%rip), %rcx      # 0x8190
movq %rcx, 0x20(%rax)
jmp 0x521e
movq -0x8(%rbp), %rax
leaq 0x36ea(%rip), %rcx      # 0x8770
movq %rcx, 0x20(%rax)
jmp 0x521e
movq -0x8(%rbp), %rax
leaq 0x30f6(%rip), %rcx      # 0x8190
movq %rcx, 0x20(%rax)
jmp 0x521e
movq -0x8(%rbp), %rax
leaq 0x37b2(%rip), %rcx      # 0x8860
movq %rcx, 0x20(%rax)
jmp 0x521e
movq -0x8(%rbp), %rax
leaq 0x31ae(%rip), %rcx      # 0x8270
movq %rcx, 0x20(%rax)
jmp 0x521e
movq -0x8(%rbp), %rax
leaq 0x356a(%rip), %rcx      # 0x8640
movq %rcx, 0x20(%rax)
jmp 0x521e
movq -0x8(%rbp), %rax
leaq 0x32d6(%rip), %rcx      # 0x83c0
movq %rcx, 0x20(%rax)
jmp 0x521e
movq 0x18d06(%rip), %rax     # 0x1de00
movq %rax, 0x18d07(%rip)     # 0x1de08
movq -0x8(%rbp), %rax
leaq 0x3534(%rip), %rcx      # 0x8640
movq %rcx, 0x20(%rax)
jmp 0x521e
movq 0x18ce4(%rip), %rax     # 0x1de00
movq %rax, 0x18ce5(%rip)     # 0x1de08
movq -0x8(%rbp), %rax
leaq 0x3292(%rip), %rcx      # 0x83c0
movq %rcx, 0x20(%rax)
jmp 0x521e
movq -0x8(%rbp), %rax
leaq 0x34fe(%rip), %rcx      # 0x8640
movq %rcx, 0x20(%rax)
jmp 0x521e
movq -0x8(%rbp), %rax
leaq 0x326a(%rip), %rcx      # 0x83c0
movq %rcx, 0x20(%rax)
jmp 0x521e
movq -0x8(%rbp), %rax
leaq 0x3856(%rip), %rcx      # 0x89c0
movq %rcx, 0x20(%rax)
jmp 0x521e
movq -0x8(%rbp), %rax
leaq 0x3332(%rip), %rcx      # 0x84b0
movq %rcx, 0x20(%rax)
jmp 0x521e
movq -0x8(%rbp), %rax
leaq 0x45de(%rip), %rcx      # 0x9770
movq %rcx, 0x20(%rax)
jmp 0x521e
movq -0x8(%rbp), %rax
leaq 0x445a(%rip), %rcx      # 0x9600
movq %rcx, 0x20(%rax)
jmp 0x521e
movq -0x8(%rbp), %rax
leaq 0x4169(%rip), %rcx      # 0x9320
movq %rcx, 0x20(%rax)
jmp 0x521e
movq -0x8(%rbp), %rax
leaq 0x4308(%rip), %rcx      # 0x94d0
movq %rcx, 0x20(%rax)
jmp 0x521e
movq -0x8(%rbp), %rax
leaq 0x3fa7(%rip), %rcx      # 0x9180
movq %rcx, 0x20(%rax)
jmp 0x521e
movq -0x8(%rbp), %rax
leaq 0x3d06(%rip), %rcx      # 0x8ef0
movq %rcx, 0x20(%rax)
jmp 0x521e
movq -0x8(%rbp), %rax
leaq 0x3e55(%rip), %rcx      # 0x9050
movq %rcx, 0x20(%rax)
jmp 0x521e
movq -0x8(%rbp), %rax
leaq 0x3bd4(%rip), %rcx      # 0x8de0
movq %rcx, 0x20(%rax)
jmp 0x521e
movq -0x8(%rbp), %rax
movq $0x0, 0x20(%rax)
popq %rbp
retq