LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O1/jonof[P]jfaudiolib/src/mix.c
// Function: MV_Mix8BitStereo16
void MV_Mix8BitStereo16( 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, sample1;
    
    while (length--) {
        sample0 = source[(position >> 16) << 1];
        sample1 = sample0;
        position += rate;
        
        sample0 = MV_LeftVolume[sample0 + 128] + *dest;
        sample1 = MV_RightVolume[sample1 + 128] + *(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 0x139da(%rip), %rax     # 0x19518
movq (%rax), %r8
testl %ecx, %ecx
je 0x5bc9
leaq 0x128e8(%rip), %r9      # 0x18438
leaq 0x128d9(%rip), %r10     # 0x18430
leaq 0x1390e(%rip), %r11     # 0x1946c
leaq 0x139ab(%rip), %rbx     # 0x19510
leaq 0xa6a4(%rip), %r14      # 0x10210
movl %edi, %r15d
shrl $0x10, %r15d
movsbl 0x1(%rdx,%r15,2), %r15d
addl %esi, %edi
movq (%r9), %r12
subl $-0x80, %r15d
movswq (%r12,%r15,2), %r12
movzbl (%r8), %r13d
movq (%r10), %rbp
movswq (%rbp,%r15,2), %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 0x5b6c
leaq 0x13950(%rip), %rax     # 0x19520
movl %edi, (%rax)
leaq 0x1393f(%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_8BitReverbFast
void MV_8BitReverbFast( signed char *src, signed char *dest, unsigned int count, int shift )
{
    unsigned char sample0, c;
    
    c = 128 - (128 >> shift);
    
    do {
        sample0 = *((unsigned char *) src) >> shift;
        *dest = sample0 + c + ((sample0 ^ 128) >> 7);
        
        src++;
        dest++;
    } while (count-- > 0);
}

// Assembly:
movl $0x80, %eax
shrl %cl, %eax
incl %edx
xorl %r8d, %r8d
movzbl (%rdi,%r8), %r9d
shrl %cl, %r9d
movl %r9d, %r10d
subl %eax, %r10d
xorl $0x80, %r10d
shrl $0x7, %r9d
xorl $0x1, %r9d
addl %r10d, %r9d
movb %r9b, (%rsi,%r8)
incq %r8
cmpl %r8d, %edx
jne 0x5d97
retq
// File: /workspace/github_c_makefile_star2_O1/jonof[P]jfaudiolib/src/mixst.c
// Function: MV_Mix8BitMono8Stereo
void MV_Mix8BitMono8Stereo( 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) << 1];
        sample1 = source[((position >> 16) << 1) + 1];
        position += rate;
        
        sample0 = (MV_LeftVolume[sample0] + MV_LeftVolume[sample1]) / 2 + *dest;
        sample0 = MV_HarshClipTable[sample0 + 128];
        
        *dest = sample0 & 255;
        
        dest += MV_SampleSize;
    }
    
    MV_MixPosition = position;
    MV_MixDestination = (char *) dest;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
leaq 0x13747(%rip), %rax     # 0x19518
movq (%rax), %r8
testl %ecx, %ecx
je 0x5e42
leaq 0x12659(%rip), %r9      # 0x18438
leaq 0x1372a(%rip), %r10     # 0x19510
leaq 0xa423(%rip), %r11      # 0x10210
movl %edi, %ebx
shrl $0xf, %ebx
movl %ebx, %r14d
andl $-0x2, %r14d
movzbl (%rdx,%r14), %r14d
orq $0x1, %rbx
movzbl (%rdx,%rbx), %ebx
addl %esi, %edi
movq (%r9), %r15
movswl (%r15,%r14,2), %ebp
movswl (%r15,%rbx,2), %ebx
addl %ebp, %ebx
movl %ebx, %ebp
shrl $0x1f, %ebp
addl %ebx, %ebp
sarl %ebp
movzbl (%r8), %ebx
movslq %ebp, %r14
addq %rbx, %r14
movq (%r10), %rbx
movb 0x80(%rbx,%r14), %bl
movb %bl, (%r8)
movslq (%r11), %rbx
addq %rbx, %r8
decl %ecx
jne 0x5ded
leaq 0x136d7(%rip), %rcx     # 0x19520
movl %edi, (%rcx)
movq %r8, (%rax)
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/jonof[P]jfaudiolib/src/mixst.c
// Function: MV_Mix8BitStereo8Stereo
void MV_Mix8BitStereo8Stereo( 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) << 1];
        sample1 = source[((position >> 16) << 1) + 1];
        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 0x136b2(%rip), %rax     # 0x19518
movq (%rax), %r8
testl %ecx, %ecx
je 0x5efd
leaq 0x125c0(%rip), %r9      # 0x18438
leaq 0x125b1(%rip), %r10     # 0x18430
leaq 0x135e6(%rip), %r11     # 0x1946c
leaq 0x13683(%rip), %rbx     # 0x19510
leaq 0xa37c(%rip), %r14      # 0x10210
movl %edi, %r15d
shrl $0xf, %r15d
movl %r15d, %r12d
andl $-0x2, %r12d
movzbl (%rdx,%r12), %r12d
orq $0x1, %r15
movzbl (%rdx,%r15), %r15d
addl %esi, %edi
movq (%r9), %r13
movswq (%r13,%r12,2), %r12
movzbl (%r8), %r13d
movq (%r10), %rbp
movswq (%rbp,%r15,2), %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 0x5e94
leaq 0x1361c(%rip), %rax     # 0x19520
movl %edi, (%rax)
leaq 0x1360b(%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/mixst.c
// Function: MV_Mix16BitMono8Stereo
void MV_Mix16BitMono8Stereo( 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) << 1];
        sample1 = source[((position >> 16) << 1) + 1];
        position += rate;
        
        sample0 = (MV_LeftVolume[sample0] + MV_LeftVolume[sample1]) / 2 + *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 0x135f4(%rip), %rax     # 0x19518
movq (%rax), %r8
testl %ecx, %ecx
je 0x5fb6
leaq 0x12502(%rip), %r9      # 0x18438
movq (%r9), %r9
leaq 0xa2d0(%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 $0xf, %r11d
movl %r11d, %ebx
andl $-0x2, %ebx
movzbl (%rdx,%rbx), %ebx
orq $0x1, %r11
movzbl (%rdx,%r11), %r11d
movswl (%r9,%rbx,2), %ebx
movswl (%r9,%r11,2), %r11d
addl %ebx, %r11d
movl %r11d, %ebx
shrl $0x1f, %ebx
addl %r11d, %ebx
shrl %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 0x5f56
jmp 0x5fb9
movq %r8, %r11
leaq 0x13560(%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/mixst.c
// Function: MV_Mix16BitStereo8Stereo
void MV_Mix16BitStereo8Stereo( 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) << 1];
        sample1 = source[((position >> 16) << 1) + 1];
        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 0x1353f(%rip), %rax     # 0x19518
movq (%rax), %r8
testl %ecx, %ecx
je 0x60a2
leaq 0x1244d(%rip), %r9      # 0x18438
movq (%r9), %r9
leaq 0x1243b(%rip), %r10     # 0x18430
movq (%r10), %r10
leaq 0x1346d(%rip), %r11     # 0x1946c
movl (%r11), %r11d
movl %r11d, %ebx
shrl $0x1f, %ebx
addl %r11d, %ebx
sarl %ebx
movslq %ebx, %r11
leaq 0xa1f9(%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, %r15d
shrl $0xf, %r15d
movq %r15, %r14
orq $0x1, %r14
movzbl (%rdx,%r14), %r14d
movzwl (%r10,%r14,2), %r14d
movzwl (%r8,%r11,2), %r12d
leal (%r14,%r12), %r13d
movswl %r13w, %r13d
sarl $0xf, %r13d
xorl %ebp, %r13d
addw %r12w, %r14w
cmovol %r13d, %r14d
andl $-0x2, %r15d
movzbl (%rdx,%r15), %r15d
movzwl (%r9,%r15,2), %r12d
movzwl (%r8), %r15d
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 0x602d
jmp 0x60a5
movq %r8, %r15
leaq 0x13474(%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/mixst.c
// Function: MV_Mix16BitMono16Stereo
void MV_Mix16BitMono16Stereo( 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;
    int sample1l, sample1h, sample1;
    
    while (length--) {
        sample0 = source[(position >> 16) << 1];
        sample1 = source[((position >> 16) << 1) + 1];
#ifdef BIGENDIAN
        sample0l = sample0 >> 8;
        sample0h = (sample0 & 255) ^ 128;
        sample1l = sample1 >> 8;
        sample1h = (sample1 & 255) ^ 128;
#else
        sample0l = sample0 & 255;
        sample0h = (sample0 >> 8) ^ 128;
        sample1l = sample1 & 255;
        sample1h = (sample1 >> 8) ^ 128;
#endif
        position += rate;
        
        sample0l = MV_LeftVolume[sample0l] >> 8;
        sample0h = MV_LeftVolume[sample0h];
        sample0 = sample0l + sample0h + 128;
        sample1l = MV_LeftVolume[sample1l] >> 8;
        sample1h = MV_LeftVolume[sample1h];
        sample1 = sample1l + sample1h + 128;
        
        sample0 = (sample0 + sample1) / 2 + *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 %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
leaq 0x1344b(%rip), %rax     # 0x19518
movq (%rax), %r8
testl %ecx, %ecx
je 0x61bd
leaq 0x12359(%rip), %r9      # 0x18438
movq (%r9), %r9
leaq 0xa127(%rip), %r10      # 0x10210
movl (%r10), %r10d
movl %r10d, %r11d
shrl $0x1f, %r11d
addl %r10d, %r11d
sarl %r11d
movslq %r11d, %r10
addq %r10, %r10
movl $0xff, %r11d
movl $0x100, %ebx            # imm = 0x100
movl %edi, %r14d
shrl $0xe, %r14d
movl %r14d, %r15d
andl $-0x4, %r15d
movzwl (%rdx,%r15), %r15d
orl $0x2, %r14d
andl $-0x2, %r14d
movzwl (%rdx,%r14), %r14d
movl %r15d, %r12d
andl %r11d, %r12d
movl %r14d, %r13d
andl %r11d, %r13d
movsbl 0x1(%r9,%r12,2), %ebp
shrl $0x7, %r15d
andl $-0x2, %r15d
xorl %ebx, %r15d
movswl (%r9,%r15), %r15d
addl %ebp, %r15d
movsbl 0x1(%r9,%r13,2), %ebp
shrl $0x7, %r14d
andl $-0x2, %r14d
xorl %ebx, %r14d
movswl (%r9,%r14), %r14d
addl %r15d, %r14d
addl %ebp, %r14d
movl %r14d, %r15d
addl %ebx, %r15d
shrl $0x1f, %r15d
addl %r15d, %r14d
addl $0x100, %r14d           # imm = 0x100
sarl %r14d
movswl (%r8), %ebp
addl %r14d, %ebp
movl $0x7fff, %r14d          # imm = 0x7FFF
cmpl %r14d, %ebp
jl 0x6199
movl $0x7fff, %ebp           # imm = 0x7FFF
cmpl $0xffff8001, %ebp       # imm = 0xFFFF8001
jge 0x61a6
movl $0xffff8000, %ebp       # imm = 0xFFFF8000
addl %esi, %edi
leaq (%r8,%r10), %r14
movw %bp, (%r8)
movq %r14, %r8
decl %ecx
jne 0x610a
jmp 0x61c0
movq %r8, %r14
leaq 0x13359(%rip), %rcx     # 0x19520
movl %edi, (%rcx)
movq %r14, (%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/mixst.c
// Function: MV_Mix8BitMono16Stereo
void MV_Mix8BitMono16Stereo( 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, sample1;
    
    while (length--) {
        sample0 = source[(position >> 16) << 2];
        sample1 = source[((position >> 16) << 2) + 2];
        position += rate;
        
        sample0 = MV_LeftVolume[sample0 + 128];
        sample1 = MV_LeftVolume[sample1 + 128];
        sample0 = (sample0 + sample1) / 2 + *dest;
        sample0 = MV_HarshClipTable[sample0 + 128];
        
        *dest = sample0 & 255;
        
        dest += MV_SampleSize;
    }
    
    MV_MixPosition = position;
    MV_MixDestination = (char *) dest;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
leaq 0x13332(%rip), %rax     # 0x19518
movq (%rax), %r8
testl %ecx, %ecx
je 0x6260
leaq 0x12244(%rip), %r9      # 0x18438
movl $0x80, %r10d
leaq 0x1330f(%rip), %r11     # 0x19510
leaq 0xa008(%rip), %rbx      # 0x10210
movl %edi, %r14d
shrl $0x10, %r14d
movsbl 0x1(%rdx,%r14,4), %r15d
movsbl 0x3(%rdx,%r14,4), %r14d
addl %esi, %edi
movq (%r9), %r12
addl %r10d, %r15d
movswl (%r12,%r15,2), %ebp
addl %r10d, %r14d
movswl (%r12,%r14,2), %r14d
addl %ebp, %r14d
movl %r14d, %ebp
shrl $0x1f, %ebp
addl %r14d, %ebp
sarl %ebp
movzbl (%r8), %r14d
movslq %ebp, %r15
addq %r14, %r15
movq (%r11), %r14
movb 0x80(%r14,%r15), %bpl
movb %bpl, (%r8)
movslq (%rbx), %r14
addq %r14, %r8
decl %ecx
jne 0x6208
leaq 0x132b9(%rip), %rcx     # 0x19520
movl %edi, (%rcx)
movq %r8, (%rax)
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/jonof[P]jfaudiolib/src/mixst.c
// Function: MV_Mix8BitStereo16Stereo
void MV_Mix8BitStereo16Stereo( 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, sample1;
    
    while (length--) {
        sample0 = source[(position >> 16) << 2];
        sample1 = source[((position >> 16) << 2) + 2];
        position += rate;
        
        sample0 = MV_LeftVolume[sample0 + 128] + *dest;
        sample1 = MV_RightVolume[sample1 + 128] + *(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 0x13292(%rip), %rax     # 0x19518
movq (%rax), %r8
testl %ecx, %ecx
je 0x6320
leaq 0x121a0(%rip), %r9      # 0x18438
movl $0x80, %r10d
leaq 0x1218b(%rip), %r11     # 0x18430
leaq 0x131c0(%rip), %rbx     # 0x1946c
leaq 0x1325d(%rip), %r14     # 0x19510
leaq 0x9f56(%rip), %r15      # 0x10210
movl %edi, %r12d
shrl $0x10, %r12d
movsbl 0x1(%rdx,%r12,4), %r13d
movq (%r9), %rbp
addl %r10d, %r13d
movswq (%rbp,%r13,2), %r13
movzbl (%r8), %ebp
movq (%r14), %rax
addq %rax, %r13
movb 0x80(%rbp,%r13), %bpl
movsbl 0x3(%rdx,%r12,4), %r12d
movq (%r11), %r13
addl %r10d, %r12d
movswq (%r13,%r12,2), %r12
addq %rax, %r12
movslq (%rbx), %rax
movzbl (%r8,%rax), %eax
movb 0x80(%rax,%r12), %al
movb %bpl, (%r8)
movslq (%rbx), %r12
movb %al, (%r8,%r12)
movslq (%r15), %rax
addq %rax, %r8
addl %esi, %edi
decl %ecx
jne 0x62ba
leaq 0x131f9(%rip), %rax     # 0x19520
movl %edi, (%rax)
leaq 0x131e8(%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/vorbis.c
// Function: MV_PlayVorbis3D
int MV_PlayVorbis3D
(
 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_PlayVorbis( ptr, ptrlength, pitchoffset, mid, left, right, priority,
                           callbackval );
   
   return( status );
}

// Assembly:
movl %edx, %r10d
leaq 0x9d9e(%rip), %rdx      # 0x102d0
cmpl $0x0, (%rdx)
je 0x65bb
pushq %r14
pushq %rbx
pushq %rax
movl %r9d, %eax
movl 0x20(%rsp), %r11d
movl %r8d, %edx
negl %edx
cmovsl %r8d, %edx
shrl $0x1b, %r8d
andl $-0x10, %r8d
addl %ecx, %r8d
movl $0xff, %ecx
movl %edx, %ebx
subl %ecx, %ebx
cmovgel %ecx, %edx
negl %ebx
leaq 0x9c9c(%rip), %rcx      # 0x1020c
movl (%rcx), %ecx
incl %ecx
imull %edx, %ecx
sarl $0x8, %ecx
andl $0x1f, %r8d
movslq %ecx, %rcx
shll $0x7, %r8d
addq 0x9a3c(%rip), %r8       # 0xffc8
movzbl (%r8,%rcx,2), %r14d
movzbl 0x1(%r8,%rcx,2), %ecx
xorl %r9d, %r9d
testl %ebx, %ebx
cmovgl %ebx, %r9d
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
movl %r10d, %r8d
pushq %r11
pushq %rax
pushq %rcx
pushq %r14
callq 0x65fa
addq $0x28, %rsp
popq %rbx
popq %r14
retq
leaq 0x9d12(%rip), %rax      # 0x102d4
movl $0x2, (%rax)
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
retq
// File: /workspace/github_c_makefile_star2_O1/jonof[P]jfaudiolib/src/vorbis.c
// Function: MV_ReleaseVorbisVoice
void MV_ReleaseVorbisVoice( VoiceNode * voice )
{
   vorbis_data * vd = (vorbis_data *) voice->extra;
   
   if (voice->wavetype != Vorbis) {
      return;
   }
   
   ov_clear(&vd->vf);
   free(vd);
   
   voice->extra = 0;
}

// Assembly:
cmpl $0x4, 0x10(%rdi)
jne 0x69db
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x88(%rdi), %r14
leaq 0x18(%r14), %rdi
callq 0x2100
movq %r14, %rdi
callq 0x2260
movq $0x0, 0x88(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/jonof[P]jfaudiolib/src/vorbis.c
// Function: read_vorbis
static size_t read_vorbis(void * ptr, size_t size, size_t nmemb, void * datasource)
{
   vorbis_data * vorb = (vorbis_data *) datasource;
   size_t nread = 0;
   size_t bytes, woffset = 0;

   errno = 0;

   if (vorb->length == vorb->pos) {
      return 0;
   }
   
   for (; nmemb > 0; nmemb--, nread++) {
      bytes = vorb->length - vorb->pos;
      if (size < bytes) {
         bytes = size;
      }

      memcpy((char *)ptr + woffset, vorb->ptr + vorb->pos, bytes);
      vorb->pos += bytes;
      woffset += bytes;

      if (vorb->length == vorb->pos) {
         nread++;
         break;
      }
   }
   
   return nread;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rcx, %r14
movq %rdx, %rbx
movq %rsi, %r15
movq %rdi, (%rsp)
callq 0x2040
movl $0x0, (%rax)
movq 0x8(%r14), %rax
cmpq 0x10(%r14), %rax
sete %al
testq %rbx, %rbx
sete %cl
orb %al, %cl
je 0x6a18
xorl %ebx, %ebx
jmp 0x6a73
movq $-0x1, %rbp
xorl %r12d, %r12d
movq 0x8(%r14), %r13
movq 0x10(%r14), %rsi
subq %rsi, %r13
cmpq %r15, %r13
cmovaeq %r15, %r13
movq (%rsp), %rax
leaq (%rax,%r12), %rdi
addq (%r14), %rsi
movq %r13, %rdx
callq 0x2170
movq 0x10(%r14), %rax
addq %r13, %rax
movq %rax, 0x10(%r14)
cmpq %rax, 0x8(%r14)
je 0x6a6d
addq %r13, %r12
leaq (%rbx,%rbp), %rax
decq %rax
decq %rbp
cmpq $-0x1, %rax
jne 0x6a22
jmp 0x6a73
negq %rbp
movq %rbp, %rbx
movq %rbx, %rax
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/music.c
// Function: MUSIC_Init
int MUSIC_Init
   (
   int SoundCard,
   const char *params
   )

   {
   int i;
   int status;
   int mincard, maxcard, card;

   for( i = 0; i < 128; i++ )
      {
      MIDI_PatchMap[ i ] = i;
      }

   if (SoundCard == ASS_AutoDetect)
      {
      mincard = ASS_NoSound + 1;
      maxcard = ASS_NumSoundCards - 1;
      }
   else if (SoundCard < 0 || SoundCard >= ASS_NumSoundCards)
      {
      MUSIC_ErrorCode = MUSIC_InvalidCard;
      return MUSIC_Error;
      }
   else
      {
      mincard = SoundCard;
      maxcard = SoundCard;
      }

   for (card = mincard; card <= maxcard; card++)
      {
      if (!SoundDriver_IsMIDISupported(card))
         {
         continue;
         }
      else if (SoundCard == ASS_AutoDetect)
         {
         ASS_Message("MUSIC_Init: trying %s\n", SoundDriver_GetName(card));
         }

      ASS_MIDISoundDriver = card;
      status = SoundDriver_MIDI_Init(&MUSIC_MidiFunctions, params);
      if (status == MUSIC_Ok)
         {
         MIDI_SetMidiFuncs( &MUSIC_MidiFunctions );
         return MUSIC_Ok;
         }
      }

   if (SoundCard == ASS_AutoDetect)
      {
      // A failure to autodetect falls back to no sound.
      ASS_MIDISoundDriver = ASS_NoSound;
      MIDI_SetMidiFuncs( &MUSIC_MidiFunctions );
      return MUSIC_Ok;
      }

   MUSIC_ErrorCode = MUSIC_DriverError;
   return MUSIC_Error;
   }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r14
movl %edi, %ebx
xorl %eax, %eax
leaq 0x12b96(%rip), %rcx     # 0x196c0
movb %al, (%rcx,%rax)
incq %rax
cmpq $0x80, %rax
jne 0x6b2a
cmpl $-0x2, %ebx
jne 0x6b4a
movl $0x6, %r13d
movl $0x1, %ebp
jmp 0x6b63
movl %ebx, %ebp
movl %ebx, %r13d
cmpl $0x7, %ebx
jb 0x6b63
movl $0x2, 0x129ca(%rip)     # 0x19528
jmp 0x6be6
cmpl %r13d, %ebp
ja 0x6bba
incl %r13d
leaq 0x9696(%rip), %r15      # 0x10208
leaq 0x129b7(%rip), %r12     # 0x19530
movl %ebp, %edi
callq 0x2b66
testl %eax, %eax
je 0x6bb3
cmpl $-0x2, %ebx
jne 0x6ba1
movl %ebp, %edi
callq 0x2b77
leaq 0x4170(%rip), %rdi      # 0xad07
movq %rax, %rsi
xorl %eax, %eax
callq 0x8aa8
movl %ebp, (%r15)
movq %r12, %rdi
movq %r14, %rsi
callq 0x2dec
testl %eax, %eax
je 0x6bcc
incl %ebp
cmpl %ebp, %r13d
jne 0x6b79
cmpl $-0x2, %ebx
jne 0x6bdc
leaq 0x9642(%rip), %rax      # 0x10208
movl $0x0, (%rax)
leaq 0x1295d(%rip), %rdi     # 0x19530
callq 0x7198
xorl %eax, %eax
jmp 0x6beb
movl $0x1, 0x12942(%rip)     # 0x19528
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/midi.c
// Function: MIDI_AllNotesOff
int MIDI_AllNotesOff
   (
   void
   )

   {
   int channel;

   SoundDriver_MIDI_Lock();

   for( channel = 0; channel < NUM_MIDI_CHANNELS; channel++ )
      {
      _MIDI_SendControlChange( channel, MIDI_HOLD1, 0 );
      _MIDI_SendControlChange( channel, MIDI_SOSTENUTO, 0 );   // TURRICAN's recommendation
      _MIDI_SendControlChange( channel, MIDI_ALL_NOTES_OFF, 0 );
      _MIDI_SendControlChange( channel, MIDI_ALL_SOUNDS_OFF, 0 );
      }

   SoundDriver_MIDI_Unlock();

   return( MIDI_Ok );
   }

// Assembly:
pushq %rbx
callq 0x2e78
xorl %ebx, %ebx
movl %ebx, %edi
movl $0x40, %esi
xorl %edx, %edx
callq 0x6d3d
movl %ebx, %edi
movl $0x42, %esi
xorl %edx, %edx
callq 0x6d3d
movl %ebx, %edi
movl $0x7b, %esi
xorl %edx, %edx
callq 0x6d3d
movl %ebx, %edi
movl $0x78, %esi
xorl %edx, %edx
callq 0x6d3d
incl %ebx
cmpl $0x10, %ebx
jne 0x6cf5
callq 0x2e94
xorl %eax, %eax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/jonof[P]jfaudiolib/src/midi.c
// Function: MIDI_SendControlChange
static int _MIDI_SendControlChange
   (
   int channel,
   int c1,
   int c2
   )

   {
   int status;

   if ( _MIDI_RerouteFunctions[ channel ] != NULL )
      {
      status = _MIDI_RerouteFunctions[ channel ]( 0xB0 + channel,
         c1, c2 );
      if ( status == MIDI_DONT_PLAY )
         {
         return( MIDI_Ok );
         }
      }

   if ( _MIDI_Funcs == NULL )
      {
      return( MIDI_Error );
      }

   if ( _MIDI_Funcs->ControlChange == NULL )
      {
      return( MIDI_Error );
      }

   _MIDI_Funcs->ControlChange( channel, c1, c2 );

   return( MIDI_Ok );
   }

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movl %edx, %ebx
movl %esi, %ebp
movl %edi, %r14d
movslq %edi, %rax
leaq 0x1284e(%rip), %rcx     # 0x195a0
movq (%rcx,%rax,8), %rax
testq %rax, %rax
je 0x6d6c
leal 0xb0(%r14), %edi
movl %ebp, %esi
movl %ebx, %edx
callq *%rax
testl %eax, %eax
je 0x6d8e
movq 0x128f5(%rip), %rax     # 0x19668
testq %rax, %rax
je 0x6d8e
movq 0x18(%rax), %rax
testq %rax, %rax
je 0x6d8e
movl %r14d, %edi
movl %ebp, %esi
movl %ebx, %edx
popq %rbx
popq %r14
popq %rbp
jmpq *%rax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/jonof[P]jfaudiolib/src/midi.c
// Function: MIDI_SetUserChannelVolume
void MIDI_SetUserChannelVolume
   (
   int channel,
   int volume
   )

   {
   // Convert channel from 1-16 to 0-15
   channel--;

   volume = max( 0, volume );
   volume = min( volume, 256 );

   if ( ( channel >= 0 ) && ( channel < NUM_MIDI_CHANNELS ) )
      {
      _MIDI_UserChannelVolume[ channel ] = volume;

      SoundDriver_MIDI_Lock();
      _MIDI_SetChannelVolume( channel, _MIDI_ChannelVolume[ channel ] );
      SoundDriver_MIDI_Unlock();
      }
   }

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movl %edi, %ebx
decl %ebx
cmpl $0xf, %ebx
ja 0x6de2
xorl %eax, %eax
testl %esi, %esi
cmovgl %esi, %eax
movl $0x100, %ecx            # imm = 0x100
cmpl %ecx, %eax
cmovgel %ecx, %eax
movl %ebx, %r14d
leaq 0x94a5(%rip), %rcx      # 0x10260
movl %eax, (%rcx,%r14,4)
callq 0x2e78
leaq 0x12855(%rip), %rax     # 0x19620
movl (%rax,%r14,4), %esi
movl %ebx, %edi
callq 0x6dea
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x2e94
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/jonof[P]jfaudiolib/src/midi.c
// Function: MIDI_SetChannelVolume
static void _MIDI_SetChannelVolume
   (
   int channel,
   int volume
   )

   {
   int status;
   int remotevolume;

   _MIDI_ChannelVolume[ channel ] = volume;

   if ( _MIDI_RerouteFunctions[ channel ] != NULL )
      {
      remotevolume = volume * _MIDI_TotalVolume;
      remotevolume *= _MIDI_UserChannelVolume[ channel ];
      remotevolume /= MIDI_MaxVolume;
      remotevolume >>= 8;

      status = _MIDI_RerouteFunctions[ channel ]( 0xB0 + channel,
         MIDI_VOLUME, remotevolume );
      if ( status == MIDI_DONT_PLAY )
         {
         return;
         }
      }

   if ( _MIDI_Funcs == NULL )
      {
      return;
      }

   if ( _MIDI_Funcs->ControlChange == NULL )
      {
      return;
      }

   // For user volume
   volume *= _MIDI_UserChannelVolume[ channel ];

   if ( _MIDI_Funcs->SetVolume == NULL )
      {
      volume *= _MIDI_TotalVolume;
      volume /= MIDI_MaxVolume;
      }

   // For user volume
   volume >>= 8;

   _MIDI_Funcs->ControlChange( channel, MIDI_VOLUME, volume );
   }

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movl %esi, %ebx
movl %edi, %ebp
movslq %edi, %r14
leaq 0x12824(%rip), %rax     # 0x19620
movl %esi, (%rax,%r14,4)
leaq 0x12799(%rip), %rax     # 0x195a0
movq (%rax,%r14,8), %rax
testq %rax, %rax
je 0x6e54
movl 0x948a(%rip), %ecx      # 0x102a0
imull %ebx, %ecx
leaq 0x9440(%rip), %rdx      # 0x10260
imull (%rdx,%r14,4), %ecx
movslq %ecx, %rdx
imulq $-0x7f7f7f7f, %rdx, %rcx # imm = 0x80808081
shrq $0x20, %rcx
addl %ecx, %edx
movl %edx, %ecx
shrl $0x1f, %ecx
sarl $0x7, %edx
addl %ecx, %edx
sarl $0x8, %edx
leal 0xb0(%r14), %edi
movl $0x7, %esi
callq *%rax
testl %eax, %eax
je 0x6eaf
movq 0x1280d(%rip), %rcx     # 0x19668
testq %rcx, %rcx
je 0x6eaf
movq 0x18(%rcx), %rax
testq %rax, %rax
je 0x6eaf
leaq 0x93f0(%rip), %rdx      # 0x10260
imull (%rdx,%r14,4), %ebx
cmpq $0x0, 0x48(%rcx)
jne 0x6e9d
imull 0x941d(%rip), %ebx      # 0x102a0
movslq %ebx, %rbx
imulq $-0x7f7f7f7f, %rbx, %rcx # imm = 0x80808081
shrq $0x20, %rcx
addl %ecx, %ebx
movl %ebx, %ecx
shrl $0x1f, %ecx
sarl $0x7, %ebx
addl %ecx, %ebx
sarl $0x8, %ebx
movl %ebp, %edi
movl $0x7, %esi
movl %ebx, %edx
popq %rbx
popq %r14
popq %rbp
jmpq *%rax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/jonof[P]jfaudiolib/src/midi.c
// Function: MIDI_ResetUserChannelVolume
void MIDI_ResetUserChannelVolume
   (
   void
   )

   {
   int channel;

   for( channel = 0; channel < NUM_MIDI_CHANNELS; channel++ )
      {
      _MIDI_UserChannelVolume[ channel ] = 256;
      }

   SoundDriver_MIDI_Lock();
   _MIDI_SendChannelVolumes();
   SoundDriver_MIDI_Unlock();
   }

// Assembly:
xorl %eax, %eax
leaq 0x93a3(%rip), %rcx      # 0x10260
movl $0x100, (%rax,%rcx)     # imm = 0x100
addq $0x4, %rax
cmpq $0x40, %rax
jne 0x6ebd
pushq %r14
pushq %rbx
pushq %rax
callq 0x2e78
leaq 0x12742(%rip), %r14     # 0x19620
xorl %ebx, %ebx
movl (%r14), %esi
movl %ebx, %edi
callq 0x6dea
incq %rbx
addq $0x4, %r14
cmpq $0x10, %rbx
jne 0x6ee0
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x2e94
// File: /workspace/github_c_makefile_star2_O1/jonof[P]jfaudiolib/src/midi.c
// Function: MIDI_Reset
int MIDI_Reset
   (
   void
   )

   {
   int channel;

   MIDI_AllNotesOff();

   ASS_Sleep(50);
   
   SoundDriver_MIDI_Lock();

   for( channel = 0; channel < NUM_MIDI_CHANNELS; channel++ )
      {
      _MIDI_SendControlChange( channel, MIDI_RESET_ALL_CONTROLLERS, 0 );
      _MIDI_SendControlChange( channel, MIDI_RPN_MSB, MIDI_PITCHBEND_MSB );
      _MIDI_SendControlChange( channel, MIDI_RPN_LSB, MIDI_PITCHBEND_LSB );
      _MIDI_SendControlChange( channel, MIDI_DATAENTRY_MSB, 2 ); /* Pitch Bend Sensitivity MSB */
      _MIDI_SendControlChange( channel, MIDI_DATAENTRY_LSB, 0 ); /* Pitch Bend Sensitivity LSB */
      _MIDI_ChannelVolume[ channel ] = GENMIDI_DefaultVolume;
      _MIDI_SendControlChange( channel, MIDI_PAN, 64 );  // begin TURRICAN's recommendation
      _MIDI_SendControlChange( channel, MIDI_REVERB, 40 );
      _MIDI_SendControlChange( channel, MIDI_CHORUS, 0 );
      _MIDI_SendControlChange( channel, MIDI_BANK_SELECT_MSB, 0 );
      _MIDI_SendControlChange( channel, MIDI_BANK_SELECT_LSB, 0 );
      _MIDI_SendProgramChange( channel, 0 ); // end TURRICAN's recommendation
      }

   _MIDI_SendGSReset();
   _MIDI_SendChannelVolumes();

   SoundDriver_MIDI_Unlock();

   Reset = TRUE;

   return( MIDI_Ok );
   }

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
callq 0x6ced
movl $0x32, %edi
callq 0x8a5c
callq 0x2e78
leaq 0x126fd(%rip), %r14     # 0x19620
leaq 0x12676(%rip), %r15     # 0x195a0
xorl %ebx, %ebx
movl %ebx, %edi
movl $0x79, %esi
xorl %edx, %edx
callq 0x6d3d
movl %ebx, %edi
movl $0x64, %esi
xorl %edx, %edx
callq 0x6d3d
movl %ebx, %edi
movl $0x65, %esi
xorl %edx, %edx
callq 0x6d3d
movl %ebx, %edi
movl $0x6, %esi
movl $0x2, %edx
callq 0x6d3d
movl %ebx, %edi
movl $0x26, %esi
xorl %edx, %edx
callq 0x6d3d
movl $0x64, (%r14)
movl %ebx, %edi
movl $0xa, %esi
movl $0x40, %edx
callq 0x6d3d
movl %ebx, %edi
movl $0x5b, %esi
movl $0x28, %edx
callq 0x6d3d
movl %ebx, %edi
movl $0x5d, %esi
xorl %edx, %edx
callq 0x6d3d
movl %ebx, %edi
xorl %esi, %esi
xorl %edx, %edx
callq 0x6d3d
movl %ebx, %edi
movl $0x20, %esi
xorl %edx, %edx
callq 0x6d3d
movq (%r15), %rax
testq %rax, %rax
je 0x6fdf
movl %ebx, %edi
orl $0xc0, %edi
xorl %esi, %esi
xorl %edx, %edx
callq *%rax
testl %eax, %eax
je 0x6ffa
movq 0x12682(%rip), %rax     # 0x19668
testq %rax, %rax
je 0x6ffa
movq 0x20(%rax), %rax
testq %rax, %rax
je 0x6ffa
movl %ebx, %edi
xorl %esi, %esi
callq *%rax
incq %rbx
addq $0x4, %r14
addq $0x8, %r15
cmpq $0x10, %rbx
jne 0x6f2c
movq 0x12652(%rip), %rax     # 0x19668
movq 0x58(%rax), %rax
testq %rax, %rax
je 0x7037
leaq 0x3dda(%rip), %rdi      # 0xae00
movl $0xb, %esi
callq *%rax
movl $0x32, %edi
callq 0x8a5c
leaq 0x125e2(%rip), %r14     # 0x19620
xorl %ebx, %ebx
movl (%r14), %esi
movl %ebx, %edi
callq 0x6dea
incq %rbx
addq $0x4, %r14
cmpq $0x10, %rbx
jne 0x7040
callq 0x2e94
movb $0x1, 0x125fd(%rip)     # 0x19660
xorl %eax, %eax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/jonof[P]jfaudiolib/src/midi.c
// Function: MIDI_SetVolume
int MIDI_SetVolume
   (
   int volume
   )

   {
   int i;

   if ( _MIDI_Funcs == NULL )
      {
      return( MIDI_NullMidiModule );
      }

   volume = min( MIDI_MaxVolume, volume );
   volume = max( 0, volume );

   _MIDI_TotalVolume = volume;

   SoundDriver_MIDI_Lock();

   if ( _MIDI_Funcs->SetVolume )
      {
      _MIDI_Funcs->SetVolume( volume );

      for( i = 0; i < NUM_MIDI_CHANNELS; i++ )
         {
         if ( _MIDI_RerouteFunctions[ i ] != NULL )
            {
            _MIDI_SetChannelVolume( i, _MIDI_ChannelVolume[ i ] );
            }
         }
      }
   else
      {
      _MIDI_SendChannelVolumes();
      }

   SoundDriver_MIDI_Unlock();

   return( MIDI_Ok );
   }

// Assembly:
cmpq $0x0, 0x125f5(%rip)     # 0x19668
je 0x70dd
pushq %r15
pushq %r14
pushq %rbx
movl $0xff, %eax
cmpl %eax, %edi
cmovll %edi, %eax
xorl %ebx, %ebx
testl %eax, %eax
cmovgl %eax, %ebx
movl %ebx, 0x920f(%rip)      # 0x102a0
callq 0x2e78
movq 0x125cb(%rip), %rax     # 0x19668
movq 0x48(%rax), %rax
testq %rax, %rax
je 0x70e3
movl %ebx, %edi
callq *%rax
leaq 0x1256f(%rip), %r14     # 0x19620
leaq 0x124e8(%rip), %r15     # 0x195a0
xorl %ebx, %ebx
cmpq $0x0, (%r15)
je 0x70ca
movl (%r14), %esi
movl %ebx, %edi
callq 0x6dea
incq %rbx
addq $0x4, %r14
addq $0x8, %r15
cmpq $0x10, %rbx
jne 0x70ba
jmp 0x7103
movl $0x1, %eax
retq
leaq 0x12536(%rip), %r14     # 0x19620
xorl %ebx, %ebx
movl (%r14), %esi
movl %ebx, %edi
callq 0x6dea
incq %rbx
addq $0x4, %r14
cmpq $0x10, %rbx
jne 0x70ec
callq 0x2e94
xorl %eax, %eax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/jonof[P]jfaudiolib/src/midi.c
// Function: MIDI_ResetTracks
static void _MIDI_ResetTracks
   (
   void
   )

   {
   int    i;
   track *ptr;

   _MIDI_Tick = 0;
   _MIDI_Beat = 1;
   _MIDI_Measure = 1;
   _MIDI_Time = 0;
   _MIDI_BeatsPerMeasure = 4;
   _MIDI_TicksPerBeat = _MIDI_Division;
   _MIDI_TimeBase = 4;

   _MIDI_PositionInTicks = 0;
   _MIDI_ActiveTracks    = 0;
   _MIDI_Context         = 0;

   ptr = _MIDI_TrackPtr;
   for( i = 0; i < _MIDI_NumTracks; i++ )
      {
      ptr->pos                    = ptr->start;
      ptr->delay                  = _MIDI_ReadDelta( ptr );
      ptr->active                 = ptr->EMIDI_IncludeTrack;
      ptr->RunningStatus          = 0;
      ptr->currentcontext         = 0;
      ptr->context[ 0 ].loopstart = ptr->start;
      ptr->context[ 0 ].loopcount = 0;

      if ( ptr->active )
         {
         _MIDI_ActiveTracks++;
         }

      ptr++;
      }
   }

// Assembly:
xorl %eax, %eax
movl %eax, 0x12498(%rip)     # 0x196b0
movl $0x1, %ecx
movl %ecx, 0x9081(%rip)      # 0x102a4
movl %ecx, 0x907f(%rip)      # 0x102a8
movl %eax, 0x1247d(%rip)     # 0x196ac
movl $0x4, %ecx
movl %ecx, 0x12506(%rip)     # 0x19740
movl 0x1245c(%rip), %edx     # 0x1969c
movl %edx, 0x124fe(%rip)     # 0x19744
movl %ecx, 0x124fc(%rip)     # 0x19748
movl %eax, 0x12452(%rip)     # 0x196a4
movl %eax, 0x12450(%rip)     # 0x196a8
movl %eax, 0x12412(%rip)     # 0x19670
movl 0x12424(%rip), %ecx     # 0x19688
testl %ecx, %ecx
jle 0x72f1
movq 0x1240d(%rip), %rdx     # 0x19680
xorl %esi, %esi
movq (%rdx), %rdi
movq %rdi, 0x8(%rdx)
movzbl (%rdi), %r8d
leaq 0x1(%rdi), %r9
movq %r9, 0x8(%rdx)
testb %r8b, %r8b
jns 0x72b4
andl $0x7f, %r8d
leaq 0x2(%rdi), %r9
movzbl -0x1(%r9), %r10d
movq %r9, 0x8(%rdx)
shll $0x7, %r8d
movl %r10d, %r11d
andl $0x7f, %r11d
orl %r11d, %r8d
incq %r9
testb %r10b, %r10b
js 0x7295
movl %r8d, 0x10(%rdx)
movsbl 0x170(%rdx), %r8d
movw %r8w, 0x14(%rdx)
movl $0x0, 0x16(%rdx)
movq %rdi, 0x28(%rdx)
movw $0x0, 0x30(%rdx)
testw %r8w, %r8w
je 0x72e4
incl %esi
movl %esi, 0x123c4(%rip)     # 0x196a8
addq $0x178, %rdx            # imm = 0x178
incl %eax
cmpl %ecx, %eax
jne 0x7275
retq
// File: /workspace/github_c_makefile_star2_O1/jonof[P]jfaudiolib/src/midi.c
// Function: MIDI_SetTempo
void MIDI_SetTempo
   (
   int tempo
   )

   {
   int tickspersecond;

   MIDI_Tempo = tempo;
   SoundDriver_MIDI_SetTempo(tempo, _MIDI_Division);

   tickspersecond = ( tempo * _MIDI_Division ) / 60;
   _MIDI_FPSecondsPerTick = ( 1 << TIME_PRECISION ) / tickspersecond;
   }

// Assembly:
pushq %rbx
movl %edi, %ebx
movl %edi, 0x8687(%rip)      # 0x10250
movl 0x11acd(%rip), %esi     # 0x1969c
callq 0x2e5c
imull 0x11ac1(%rip), %ebx     # 0x1969c
movslq %ebx, %rcx
imulq $-0x77777777, %rcx, %rax # imm = 0x88888889
shrq $0x20, %rax
addl %eax, %ecx
movl %ecx, %eax
shrl $0x1f, %eax
sarl $0x5, %ecx
addl %eax, %ecx
movl $0x10000, %eax          # imm = 0x10000
xorl %edx, %edx
idivl %ecx
movl %eax, 0x11a9c(%rip)     # 0x196a0
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/jonof[P]jfaudiolib/src/midi.c
// Function: MIDI_SetSongPosition
void MIDI_SetSongPosition
   (
   int measure,
   int beat,
   int tick
   )

   {
   unsigned int pos;

   if ( !_MIDI_SongLoaded )
      {
      return;
      }

   MIDI_PauseSong();

   pos = RELATIVE_BEAT( measure, beat, tick );

   if ( pos < RELATIVE_BEAT( _MIDI_Measure, _MIDI_Beat, _MIDI_Tick ) )
      {
      SoundDriver_MIDI_Lock();
      _MIDI_ResetTracks();
      SoundDriver_MIDI_Unlock();

      MIDI_Reset();
      }

   SoundDriver_MIDI_Lock();
   while( RELATIVE_BEAT( _MIDI_Measure, _MIDI_Beat, _MIDI_Tick ) < pos )
      {
      if ( _MIDI_ProcessNextTick() )
         {
         break;
         }
      if ( _MIDI_ActiveTracks == 0 )
         {
         _MIDI_ResetTracks();
         if ( !_MIDI_Loop )
            {
            SoundDriver_MIDI_Unlock();
            return;
            }
         break;
         }
      }
   SoundDriver_MIDI_Unlock();

   MIDI_SetVolume( _MIDI_TotalVolume );
   MIDI_ContinueSong();
   }

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
cmpb $0x1, 0x1138b(%rip)     # 0x19678
jne 0x83a6
movl %edx, %r14d
movl %esi, %ebp
movl %edi, %ebx
movb $0x0, 0x1137b(%rip)     # 0x1967c
callq 0x6ced
shll $0x9, %ebp
shll $0x10, %ebx
addl %r14d, %ebx
addl %ebp, %ebx
movl 0x7f8d(%rip), %eax      # 0x102a4
shll $0x9, %eax
addl 0x11390(%rip), %eax     # 0x196b0
movl 0x7f82(%rip), %ecx      # 0x102a8
shll $0x10, %ecx
addl %eax, %ecx
cmpl %ecx, %ebx
jae 0x8343
callq 0x2e78
callq 0x7210
callq 0x2e94
callq 0x6f03
callq 0x2e78
movl 0x7f56(%rip), %eax      # 0x102a4
shll $0x9, %eax
addl 0x11359(%rip), %eax     # 0x196b0
movl 0x7f4b(%rip), %ecx      # 0x102a8
shll $0x10, %ecx
addl %eax, %ecx
cmpl %ebx, %ecx
jae 0x8386
callq 0x7f96
testl %eax, %eax
jne 0x8386
cmpl $0x0, 0x11332(%rip)     # 0x196a8
jne 0x8348
callq 0x7210
cmpl $0x0, 0x112f0(%rip)     # 0x19674
je 0x83ab
callq 0x2e94
movl 0x7f0f(%rip), %edi      # 0x102a0
callq 0x706b
cmpb $0x1, 0x112db(%rip)     # 0x19678
jne 0x83a6
movb $0x1, 0x112d6(%rip)     # 0x1967c
popq %rbx
popq %r14
popq %rbp
retq
popq %rbx
popq %r14
popq %rbp
jmp 0x2e94
// File: /workspace/github_c_makefile_star2_O1/jonof[P]jfaudiolib/src/midi.c
// Function: MIDI_GetSongPosition
void MIDI_GetSongPosition
   (
   songposition *pos
   )

   {
   unsigned int mil;
   unsigned int sec;

   mil = ( _MIDI_Time & ( ( 1 << TIME_PRECISION ) - 1 ) ) * 1000;
   sec = _MIDI_Time >> TIME_PRECISION;
   pos->milliseconds = ( mil >> TIME_PRECISION ) + ( sec * 1000 );
   pos->tickposition = _MIDI_PositionInTicks;
   pos->measure      = _MIDI_Measure;
   pos->beat         = _MIDI_Beat;
   pos->tick         = _MIDI_Tick;
   }

// Assembly:
movl 0x112f2(%rip), %eax     # 0x196ac
movzwl %ax, %ecx
imull $0x3e8, %ecx, %ecx      # imm = 0x3E8
shrl $0x10, %eax
shrl $0x10, %ecx
imull $0x3e8, %eax, %eax      # imm = 0x3E8
addl %ecx, %eax
movl %eax, 0x4(%rdi)
movl 0x112ca(%rip), %eax     # 0x196a4
movl %eax, (%rdi)
movl 0x7ec6(%rip), %eax      # 0x102a8
movl %eax, 0x8(%rdi)
movl 0x7eb9(%rip), %eax      # 0x102a4
movl %eax, 0xc(%rdi)
movl 0x112bc(%rip), %eax     # 0x196b0
movl %eax, 0x10(%rdi)
retq
// File: /workspace/github_c_makefile_star2_O1/jonof[P]jfaudiolib/src/midi.c
// Function: MIDI_SysEx
static void _MIDI_SysEx
   (
   track *Track
   )

   {
   int length;

   length = _MIDI_ReadDelta( Track );
   
   if (_MIDI_Funcs->SysEx && _MIDI_SongLoaded)
      {
      unsigned char *msg;
      
      msg = (unsigned char *)alloca(length + 1);
      
      msg[0] = MIDI_SYSEX;
      memcpy(&msg[1], Track->pos, length);

      // only send a sysex if it's not a GS reset
      if (memcmp(msg, _GSResetSysex, sizeof(_GSResetSysex)))
         {
         _MIDI_Funcs->SysEx(msg, length + 1);
         }
      }

   Track->pos += length;
   }

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdi, %rbx
movq 0x8(%rdi), %rax
movzbl (%rax), %r14d
leaq 0x1(%rax), %rcx
movq %rcx, 0x8(%rdi)
testb %r14b, %r14b
jns 0x8486
andl $0x7f, %r14d
addq $0x2, %rax
movzbl -0x1(%rax), %ecx
movq %rax, 0x8(%rbx)
shll $0x7, %r14d
movl %ecx, %edx
andl $0x7f, %edx
orl %edx, %r14d
incq %rax
testb %cl, %cl
js 0x846b
movq 0x111db(%rip), %rax     # 0x19668
cmpq $0x0, 0x58(%rax)
movslq %r14d, %r15
je 0x8508
testb $0x1, 0x111da(%rip)     # 0x19678
je 0x8508
movq %rsp, %r12
movq %r12, -0x30(%rbp)
leaq 0x10(%r15), %r13
andq $-0x10, %r13
subq %r13, %r12
movq %r12, %rsp
movb $-0x10, (%r12)
leaq 0x1(%r12), %rdi
movq 0x8(%rbx), %rsi
movq %r15, %rdx
movq %rax, -0x38(%rbp)
callq 0x2170
movabsq $0x7f004012421041f0, %rax # imm = 0x7F004012421041F0
xorq (%r12), %rax
negq %r13
movabsq $-0x8beff80ffbfedbe, %rcx # imm = 0xF741007F00401242
movq -0x30(%rbp), %rdx
xorq 0x3(%rdx,%r13), %rcx
orq %rax, %rcx
movq -0x38(%rbp), %rax
je 0x8508
incl %r14d
movq %r12, %rdi
movl %r14d, %esi
callq *0x58(%rax)
addq %r15, 0x8(%rbx)
leaq -0x28(%rbp), %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/midi.c
// Function: MIDI_MetaEvent
static void _MIDI_MetaEvent
   (
   track *Track
   )

   {
   int   command;
   int   length;
   int   denominator;
   int   tempo;

   GET_NEXT_EVENT( Track, command );
   GET_NEXT_EVENT( Track, length );

   switch( command )
      {
      case MIDI_END_OF_TRACK :
         Track->active = FALSE;

         _MIDI_ActiveTracks--;
         break;

      case MIDI_TEMPO_CHANGE :
         tempo = 60000000L / _MIDI_ReadNumber( Track->pos, 3 );
         if (_MIDI_SongLoaded)
            {
            MIDI_SetTempo( tempo );
            }
         break;

      case MIDI_TIME_SIGNATURE :
         if ( ( _MIDI_Tick > 0 ) || ( _MIDI_Beat > 1 ) )
            {
            _MIDI_Measure++;
            }

         _MIDI_Tick = 0;
         _MIDI_Beat = 1;

         _MIDI_BeatsPerMeasure = (int)*Track->pos;
         denominator = (int)*( Track->pos + 1 );
         _MIDI_TimeBase = 1;
         while( denominator > 0 )
            {
            _MIDI_TimeBase += _MIDI_TimeBase;
            denominator--;
            }
         _MIDI_TicksPerBeat = ( _MIDI_Division * 4 ) / _MIDI_TimeBase;
         break;
      }

   Track->pos += length;
   }

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
movq 0x8(%rdi), %rcx
movzbl (%rcx), %edx
leaq 0x1(%rcx), %rsi
leaq 0x2(%rcx), %rax
movq %rsi, 0x8(%rdi)
movzbl 0x1(%rcx), %r15d
movq %rax, 0x8(%rdi)
cmpl $0x2f, %edx
je 0x8644
cmpl $0x58, %edx
je 0x85d6
cmpl $0x51, %edx
jne 0x8650
xorl %edx, %edx
xorl %ecx, %ecx
shll $0x8, %ecx
movzbl (%rax,%rdx), %esi
movslq %ecx, %rcx
orq %rsi, %rcx
incq %rdx
cmpq $0x3, %rdx
jne 0x855e
cmpb $0x1, 0x110fd(%rip)     # 0x19678
jne 0x8650
movl $0x3938700, %eax        # imm = 0x3938700
xorl %edx, %edx
idivq %rcx
movq %rax, %r14
movl %r14d, 0x7cbb(%rip)     # 0x10250
movl 0x11101(%rip), %esi     # 0x1969c
movl %r14d, %edi
callq 0x2e5c
imull 0x110f1(%rip), %r14d    # 0x1969c
movslq %r14d, %rcx
imulq $-0x77777777, %rcx, %rax # imm = 0x88888889
shrq $0x20, %rax
addl %eax, %ecx
movl %ecx, %eax
shrl $0x1f, %eax
sarl $0x5, %ecx
addl %eax, %ecx
movl $0x10000, %eax          # imm = 0x10000
xorl %edx, %edx
idivl %ecx
movl %eax, 0x110cc(%rip)     # 0x196a0
jmp 0x8650
cmpl $0x0, 0x110d3(%rip)     # 0x196b0
jg 0x85e8
cmpl $0x2, 0x7cbe(%rip)      # 0x102a4
jl 0x85ee
incl 0x7cba(%rip)            # 0x102a8
movl $0x0, 0x110b8(%rip)     # 0x196b0
movl $0x1, %eax
movl %eax, 0x7ca1(%rip)      # 0x102a4
movzbl 0x2(%rcx), %edx
movl %edx, 0x11133(%rip)     # 0x19740
movzbl 0x3(%rcx), %ecx
movl %eax, 0x11131(%rip)     # 0x19748
testl %ecx, %ecx
je 0x862c
incl %ecx
addl %eax, %eax
decl %ecx
cmpl $0x1, %ecx
jg 0x861d
movl %eax, 0x1111c(%rip)     # 0x19748
movl 0x1106a(%rip), %eax     # 0x1969c
shll $0x2, %eax
cltd
idivl 0x1110c(%rip)           # 0x19748
movl %eax, 0x11102(%rip)     # 0x19744
jmp 0x8650
movw $0x0, 0x14(%rbx)
decl 0x11058(%rip)           # 0x196a8
addq %r15, 0x8(%rbx)
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/jonof[P]jfaudiolib/src/midi.c
// Function: MIDI_AdvanceTick
static void _MIDI_AdvanceTick
   (
   void
   )

   {
   _MIDI_PositionInTicks++;
   _MIDI_Time += _MIDI_FPSecondsPerTick;

   _MIDI_Tick++;
   while( _MIDI_Tick > _MIDI_TicksPerBeat )
      {
      _MIDI_Tick -= _MIDI_TicksPerBeat;
      _MIDI_Beat++;
      }
   while( _MIDI_Beat > _MIDI_BeatsPerMeasure )
      {
      _MIDI_Beat -= _MIDI_BeatsPerMeasure;
      _MIDI_Measure++;
      }
   }

// Assembly:
incl 0x10cfe(%rip)           # 0x196a4
movl 0x10cf4(%rip), %eax     # 0x196a0
addl %eax, 0x10cfa(%rip)     # 0x196ac
movl 0x10cf8(%rip), %edx     # 0x196b0
leal 0x1(%rdx), %eax
movl %eax, 0x10cef(%rip)     # 0x196b0
movl 0x10d7d(%rip), %ecx     # 0x19744
cmpl %ecx, %edx
jl 0x89e5
movl 0x78d3(%rip), %edx      # 0x102a4
subl %ecx, %eax
incl %edx
cmpl %ecx, %eax
jg 0x89d1
movl %eax, 0x10cd1(%rip)     # 0x196b0
movl %edx, 0x78bf(%rip)      # 0x102a4
movl 0x10d55(%rip), %ecx     # 0x19740
movl 0x78b3(%rip), %eax      # 0x102a4
cmpl %ecx, %eax
jle 0x8a0f
movl 0x78ad(%rip), %edx      # 0x102a8
subl %ecx, %eax
incl %edx
cmpl %ecx, %eax
jg 0x89fb
movl %eax, 0x789b(%rip)      # 0x102a4
movl %edx, 0x7899(%rip)      # 0x102a8
retq