LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O0/jonof[P]jftekwar/src/tekmsc.c
// Function: teksavemoreoptions
void
teksavemoreoptions(void)
{
     moreoptions[8]=difficulty;
     moreoptions[9]=soundv;
     moreoptions[10]=musicv;
     moreoptions[11]=mousesensitivity;
     moreoptions[12]=headbobon;

     gamestuff[0]=-1;
     gamestuff[1]=-1;
     gamestuff[2]=( int)screensize;
     gamestuff[3]=brightness;
     gamestuff[4]=biasthreshhold;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movl 0x15a67e(%rip), %ecx    # 0x179fc8
leaq 0xfa64f(%rip), %rax     # 0x119fa0
movl %ecx, 0x20(%rax)
movl 0xfb242(%rip), %ecx     # 0x11ab9c
leaq 0xfa63f(%rip), %rax     # 0x119fa0
movl %ecx, 0x24(%rax)
movl 0xfb22e(%rip), %ecx     # 0x11ab98
leaq 0xfa62f(%rip), %rax     # 0x119fa0
movl %ecx, 0x28(%rax)
movl 0x15a646(%rip), %ecx    # 0x179fc0
leaq 0xfa61f(%rip), %rax     # 0x119fa0
movl %ecx, 0x2c(%rax)
leaq 0xfb4f5(%rip), %rax     # 0x11ae80
movl (%rax), %ecx
leaq 0xfa60c(%rip), %rax     # 0x119fa0
movl %ecx, 0x30(%rax)
leaq 0xfa6a2(%rip), %rax     # 0x11a040
movl $0xffffffff, (%rax)     # imm = 0xFFFFFFFF
leaq 0xfa695(%rip), %rax     # 0x11a040
movl $0xffffffff, 0x4(%rax)  # imm = 0xFFFFFFFF
leaq 0x10f1a9(%rip), %rax    # 0x12eb62
movswl (%rax), %ecx
leaq 0xfa67d(%rip), %rax     # 0x11a040
movl %ecx, 0x8(%rax)
leaq 0x10de15(%rip), %rax    # 0x12d7e2
movswl (%rax), %ecx
leaq 0xfa669(%rip), %rax     # 0x11a040
movl %ecx, 0xc(%rax)
leaq 0xfa521(%rip), %rax     # 0x119f02
movswl (%rax), %ecx
leaq 0xfa655(%rip), %rax     # 0x11a040
movl %ecx, 0x10(%rax)
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O0/jonof[P]jftekwar/src/tekmsc.c
// Function: teksavemissioninfo
void
teksavemissioninfo(int fil)
{
     write(fil,symbols,sizeof(symbols));
     write(fil,symbolsdeposited,sizeof(symbolsdeposited));
     write(fil,&difficulty,sizeof(difficulty));
     write(fil,&currentmapno,sizeof(currentmapno));
    #if 0
     write(fil,&warpretang,sizeof(warpretang));
     write(fil,&warpretsect,sizeof(warpretsect));
     write(fil,&warpretx,sizeof(warpretx));
     write(fil,&warprety,sizeof(warprety));
     write(fil,&warpretz,sizeof(warpretz));
    #endif
     write(fil,&mission,sizeof(mission));
     write(fil,&numlives,sizeof(numlives));
     write(fil,&mission_accomplished,sizeof(mission_accomplished));
     write(fil,&civillianskilled,sizeof(civillianskilled));
     write(fil,&generalplay,sizeof(generalplay));
     write(fil,&singlemapmode,sizeof(singlemapmode));
     write(fil,&allsymsdeposited,sizeof(allsymsdeposited));
     write(fil,&killedsonny,sizeof(killedsonny));
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movl %edi, -0x4(%rbp)
movl -0x4(%rbp), %edi
leaq 0x15904d(%rip), %rsi    # 0x179d32
movl $0xe, %edx
callq 0x8e40
movl -0x4(%rbp), %edi
leaq 0x159235(%rip), %rsi    # 0x179f2e
movl $0xe, %edx
callq 0x8e40
movl -0x4(%rbp), %edi
leaq 0x1592bb(%rip), %rsi    # 0x179fc8
movl $0x4, %edx
callq 0x8e40
movl -0x4(%rbp), %edi
leaq 0x1577ab(%rip), %rsi    # 0x1784cc
movl $0x4, %edx
callq 0x8e40
movl -0x4(%rbp), %edi
leaq 0x15779b(%rip), %rsi    # 0x1784d0
movl $0x4, %edx
callq 0x8e40
movl -0x4(%rbp), %edi
leaq 0x15778b(%rip), %rsi    # 0x1784d4
movl $0x1, %edx
callq 0x8e40
movl -0x4(%rbp), %edi
leaq 0x157778(%rip), %rsi    # 0x1784d5
movl $0x1, %edx
callq 0x8e40
movl -0x4(%rbp), %edi
leaq 0x157767(%rip), %rsi    # 0x1784d8
movl $0x4, %edx
callq 0x8e40
movl -0x4(%rbp), %edi
leaq 0x15924f(%rip), %rsi    # 0x179fd4
movl $0x1, %edx
callq 0x8e40
movl -0x4(%rbp), %edi
leaq 0x159234(%rip), %rsi    # 0x179fcd
movl $0x1, %edx
callq 0x8e40
movl -0x4(%rbp), %edi
leaq 0x157737(%rip), %rsi    # 0x1784e4
movl $0x4, %edx
callq 0x8e40
movl -0x4(%rbp), %edi
leaq 0x157727(%rip), %rsi    # 0x1784e8
movl $0x4, %edx
callq 0x8e40
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jonof[P]jftekwar/src/tekmsc.c
// Function: tekloadmissioninfo
void
tekloadmissioninfo(int fil)
{
     musicfade();

     read(fil,symbols,sizeof(symbols));
     read(fil,symbolsdeposited,sizeof(symbolsdeposited));
     read(fil,&difficulty,sizeof(difficulty));
     read(fil,&currentmapno,sizeof(currentmapno));
    #if 0
     read(fil,&warpretang,sizeof(warpretang));
     read(fil,&warpretsect,sizeof(warpretsect));
     read(fil,&warpretx,sizeof(warpretx));
     read(fil,&warprety,sizeof(warprety));
     read(fil,&warpretz,sizeof(warpretz));
    #endif
     read(fil,&mission,sizeof(mission));
     read(fil,&numlives,sizeof(numlives));
     read(fil,&mission_accomplished,sizeof(mission_accomplished));
     read(fil,&civillianskilled,sizeof(civillianskilled));
     read(fil,&generalplay,sizeof(generalplay));
     read(fil,&singlemapmode,sizeof(singlemapmode));
     read(fil,&allsymsdeposited,sizeof(allsymsdeposited));
     read(fil,&killedsonny,sizeof(killedsonny));

     if( generalplay == 1 ) {
          startmusic(rand()%7);
     }
     else {
          startmusic(mission);
     }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movl %edi, -0x4(%rbp)
movb $0x0, %al
callq 0x280d0
movl -0x4(%rbp), %edi
leaq 0x158f36(%rip), %rsi    # 0x179d32
movl $0xe, %edx
callq 0x8a70
movl -0x4(%rbp), %edi
leaq 0x15911e(%rip), %rsi    # 0x179f2e
movl $0xe, %edx
callq 0x8a70
movl -0x4(%rbp), %edi
leaq 0x1591a4(%rip), %rsi    # 0x179fc8
movl $0x4, %edx
callq 0x8a70
movl -0x4(%rbp), %edi
leaq 0x157694(%rip), %rsi    # 0x1784cc
movl $0x4, %edx
callq 0x8a70
movl -0x4(%rbp), %edi
leaq 0x157684(%rip), %rsi    # 0x1784d0
movl $0x4, %edx
callq 0x8a70
movl -0x4(%rbp), %edi
leaq 0x157674(%rip), %rsi    # 0x1784d4
movl $0x1, %edx
callq 0x8a70
movl -0x4(%rbp), %edi
leaq 0x157661(%rip), %rsi    # 0x1784d5
movl $0x1, %edx
callq 0x8a70
movl -0x4(%rbp), %edi
leaq 0x157650(%rip), %rsi    # 0x1784d8
movl $0x4, %edx
callq 0x8a70
movl -0x4(%rbp), %edi
leaq 0x159138(%rip), %rsi    # 0x179fd4
movl $0x1, %edx
callq 0x8a70
movl -0x4(%rbp), %edi
leaq 0x15911d(%rip), %rsi    # 0x179fcd
movl $0x1, %edx
callq 0x8a70
movl -0x4(%rbp), %edi
leaq 0x157620(%rip), %rsi    # 0x1784e4
movl $0x4, %edx
callq 0x8a70
movl -0x4(%rbp), %edi
leaq 0x157610(%rip), %rsi    # 0x1784e8
movl $0x4, %edx
callq 0x8a70
movsbl 0x1590eb(%rip), %eax    # 0x179fd4
cmpl $0x1, %eax
jne 0x20f04
callq 0x8da0
movl $0x7, %ecx
cltd
idivl %ecx
movl %edx, %edi
callq 0x281b0
jmp 0x20f0f
movl 0x1575c6(%rip), %edi    # 0x1784d0
callq 0x281b0
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jonof[P]jftekwar/src/tekmsc.c
// Function: teknetmenu
void
teknetmenu()
{
     initpaletteshifts();

     //memcpy(palette1, palette, 768);
     //memset(palette, 0, 768);

     clearview(0);
     strcpy(boardfilename,"NET1.MAP");
     prepareboard(boardfilename);
     precache();

     clearview(0);
     //memcpy(palette, palette1, 768);
     fadein(0,255,16);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
callq 0x19830
xorl %edi, %edi
callq 0x72830
leaq 0x10d899(%rip), %rdi    # 0x12e7d0
leaq 0xb89ba(%rip), %rsi     # 0xd98f8
callq 0x8550
leaq 0x10d886(%rip), %rdi    # 0x12e7d0
callq 0x22220
movb $0x0, %al
callq 0x9680
xorl %edi, %edi
callq 0x72830
xorl %edi, %edi
movl $0xff, %esi
movl $0x10, %edx
callq 0x197c0
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O0/jonof[P]jftekwar/src/tekmsc.c
// Function: copyrightscreen
void
copyrightscreen()
{
     clearview(0);
     smkopenmenu("smkgm.smk");
     smkmenuframe(81);
     fadein(0,255,10);
     while( (keystatus[1]   == 0) &&
            (keystatus[28]  == 0) &&
            (keystatus[57]  == 0) &&
            (keystatus[38]  == 0) &&
            (keystatus[203] == 0) &&
            (keystatus[205] == 0) &&
            (keystatus[200] == 0) &&
            (keystatus[31]  == 0) &&
            (keystatus[35]  == 0) &&
            (keystatus[208] == 0)  ) {
         smkshowmenu();
         if (handleevents() && quitevent) {
             break;
         }
     };
     smkclosemenu();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
xorl %edi, %edi
callq 0x72830
leaq 0xb8d21(%rip), %rdi     # 0xd9ca7
callq 0x26170
movl $0x51, %edi
callq 0x262b0
xorl %edi, %edi
movl $0xff, %esi
movl $0xa, %edx
callq 0x197c0
leaq 0x357123(%rip), %rax    # 0x3780d0
movsbl 0x1(%rax), %ecx
xorl %eax, %eax
cmpl $0x0, %ecx
movb %al, -0x1(%rbp)
jne 0x21093
leaq 0x35710a(%rip), %rax    # 0x3780d0
movsbl 0x1c(%rax), %ecx
xorl %eax, %eax
cmpl $0x0, %ecx
movb %al, -0x1(%rbp)
jne 0x21093
leaq 0x3570f1(%rip), %rax    # 0x3780d0
movsbl 0x39(%rax), %ecx
xorl %eax, %eax
cmpl $0x0, %ecx
movb %al, -0x1(%rbp)
jne 0x21093
leaq 0x3570d8(%rip), %rax    # 0x3780d0
movsbl 0x26(%rax), %ecx
xorl %eax, %eax
cmpl $0x0, %ecx
movb %al, -0x1(%rbp)
jne 0x21093
leaq 0x3570bf(%rip), %rax    # 0x3780d0
movsbl 0xcb(%rax), %ecx
xorl %eax, %eax
cmpl $0x0, %ecx
movb %al, -0x1(%rbp)
jne 0x21093
leaq 0x3570a7(%rip), %rax    # 0x3780d0
movsbl 0xcd(%rax), %ecx
xorl %eax, %eax
cmpl $0x0, %ecx
movb %al, -0x1(%rbp)
jne 0x21093
leaq 0x35708f(%rip), %rax    # 0x3780d0
movsbl 0xc8(%rax), %ecx
xorl %eax, %eax
cmpl $0x0, %ecx
movb %al, -0x1(%rbp)
jne 0x21093
leaq 0x357077(%rip), %rax    # 0x3780d0
movsbl 0x1f(%rax), %ecx
xorl %eax, %eax
cmpl $0x0, %ecx
movb %al, -0x1(%rbp)
jne 0x21093
leaq 0x357062(%rip), %rax    # 0x3780d0
movsbl 0x23(%rax), %ecx
xorl %eax, %eax
cmpl $0x0, %ecx
movb %al, -0x1(%rbp)
jne 0x21093
leaq 0x35704d(%rip), %rax    # 0x3780d0
movsbl 0xd0(%rax), %eax
cmpl $0x0, %eax
sete %al
movb %al, -0x1(%rbp)
movb -0x1(%rbp), %al
testb $0x1, %al
jne 0x2109c
jmp 0x210c3
movb $0x0, %al
callq 0x263a0
callq 0xc3d90
cmpl $0x0, %eax
je 0x210be
leaq 0x356e2c(%rip), %rax    # 0x377ee0
movsbl (%rax), %eax
cmpl $0x0, %eax
je 0x210be
jmp 0x210c3
jmp 0x20fa6
movb $0x0, %al
callq 0x26450
addq $0x10, %rsp
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O0/jonof[P]jftekwar/src/tekmsc.c
// Function: depositsymbol
void
depositsymbol(int snum)
{
     int       i,findpic;
     int       sym=sector[cursectnum[snum]].hitag;

     switch( sym ) {
     case 0: findpic=3600; break;
     case 1: findpic=3604; break;
     case 2: findpic=3608; break;
     case 3: findpic=3612; break;
     case 4: findpic=3592; break;
     case 5: findpic=3596; break;
     case 6: findpic=3616; break;
     }

     if( symbols[sym] ) {
          for( i=0; i<MAXSPRITES; i++ ) {
               if( sprptr[i]->picnum == findpic ) {
                    sprptr[i]->picnum=findpic+1;
                    symbolsdeposited[sym]=1;
                    break;
               }
          }
     }

     if( symbolsdeposited[0] &&
         symbolsdeposited[1] &&
         symbolsdeposited[2] &&
         symbolsdeposited[3] &&
         symbolsdeposited[4] &&
         symbolsdeposited[5] &&
         symbolsdeposited[6] ) {
         allsymsdeposited=1;
         gameover=1;
     }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movl %edi, -0x4(%rbp)
movslq -0x4(%rbp), %rcx
leaq 0x10c92e(%rip), %rax    # 0x12e6e0
movswq (%rax,%rcx,2), %rax
leaq (%rax,%rax,4), %rcx
leaq 0x41bace(%rip), %rax    # 0x43d890
movswl 0x24(%rax,%rcx,8), %eax
movl %eax, -0x10(%rbp)
movl -0x10(%rbp), %eax
movq %rax, -0x18(%rbp)
subq $0x6, %rax
ja 0x21e28
movq -0x18(%rbp), %rax
leaq 0xb7966(%rip), %rcx     # 0xd9748
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movl $0xe10, -0xc(%rbp)      # imm = 0xE10
jmp 0x21e28
movl $0xe14, -0xc(%rbp)      # imm = 0xE14
jmp 0x21e28
movl $0xe18, -0xc(%rbp)      # imm = 0xE18
jmp 0x21e28
movl $0xe1c, -0xc(%rbp)      # imm = 0xE1C
jmp 0x21e28
movl $0xe08, -0xc(%rbp)      # imm = 0xE08
jmp 0x21e28
movl $0xe0c, -0xc(%rbp)      # imm = 0xE0C
jmp 0x21e28
movl $0xe20, -0xc(%rbp)      # imm = 0xE20
movslq -0x10(%rbp), %rcx
leaq 0x157eff(%rip), %rax    # 0x179d32
cmpw $0x0, (%rax,%rcx,2)
je 0x21ea0
movl $0x0, -0x8(%rbp)
cmpl $0x4000, -0x8(%rbp)     # imm = 0x4000
jge 0x21e9e
movslq -0x8(%rbp), %rcx
leaq 0x15838b(%rip), %rax    # 0x17a1e0
movq (%rax,%rcx,8), %rax
movswl 0xe(%rax), %eax
cmpl -0xc(%rbp), %eax
jne 0x21e91
movl -0xc(%rbp), %eax
addl $0x1, %eax
movw %ax, %cx
movslq -0x8(%rbp), %rdx
leaq 0x15836a(%rip), %rax    # 0x17a1e0
movq (%rax,%rdx,8), %rax
movw %cx, 0xe(%rax)
movslq -0x10(%rbp), %rcx
leaq 0x1580a5(%rip), %rax    # 0x179f2e
movw $0x1, (%rax,%rcx,2)
jmp 0x21e9e
jmp 0x21e93
movl -0x8(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x8(%rbp)
jmp 0x21e41
jmp 0x21ea0
movswl 0x158087(%rip), %eax    # 0x179f2e
cmpl $0x0, %eax
je 0x21f05
movswl 0x15807d(%rip), %eax    # 0x179f30
cmpl $0x0, %eax
je 0x21f05
movswl 0x158073(%rip), %eax    # 0x179f32
cmpl $0x0, %eax
je 0x21f05
movswl 0x158069(%rip), %eax    # 0x179f34
cmpl $0x0, %eax
je 0x21f05
movswl 0x15805f(%rip), %eax    # 0x179f36
cmpl $0x0, %eax
je 0x21f05
movswl 0x158055(%rip), %eax    # 0x179f38
cmpl $0x0, %eax
je 0x21f05
movswl 0x15804b(%rip), %eax    # 0x179f3a
cmpl $0x0, %eax
je 0x21f05
movl $0x1, 0x1565e6(%rip)    # 0x1784e4
movb $0x1, 0x1565b4(%rip)    # 0x1784b9
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jonof[P]jftekwar/src/tekmsc.c
// Function: missionfailed
int
missionfailed()
{
     if( option[4] != 0 ) {
          return(0);
     }

     numlives++;

     switch( difficulty ) {
     case 0:
     case 1:
          if( numlives < 6 )
               return(0);
          break;
     case 2:
          if( numlives < 4 )
               return(0);
          break;
     default:
          if( numlives < 2 )
               return(0);
          break;
     }

     mission_accomplished=0;
     gameover=1;
     return(1);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
leaq 0xf7ffd(%rip), %rax     # 0x119f18
movzbl 0x4(%rax), %eax
cmpl $0x0, %eax
je 0x21f30
movl $0x0, -0x4(%rbp)
jmp 0x21fb2
movb 0x15659e(%rip), %al     # 0x1784d4
incb %al
movb %al, 0x156596(%rip)     # 0x1784d4
movl 0x158084(%rip), %eax    # 0x179fc8
movl %eax, -0x8(%rbp)
subl $0x2, %eax
jb 0x21f58
jmp 0x21f4e
movl -0x8(%rbp), %eax
subl $0x2, %eax
je 0x21f6f
jmp 0x21f86
movsbl 0x156575(%rip), %eax    # 0x1784d4
cmpl $0x6, %eax
jge 0x21f6d
movl $0x0, -0x4(%rbp)
jmp 0x21fb2
jmp 0x21f9d
movsbl 0x15655e(%rip), %eax    # 0x1784d4
cmpl $0x4, %eax
jge 0x21f84
movl $0x0, -0x4(%rbp)
jmp 0x21fb2
jmp 0x21f9d
movsbl 0x156547(%rip), %eax    # 0x1784d4
cmpl $0x2, %eax
jge 0x21f9b
movl $0x0, -0x4(%rbp)
jmp 0x21fb2
jmp 0x21f9d
movb $0x0, 0x156531(%rip)    # 0x1784d5
movb $0x1, 0x15650e(%rip)    # 0x1784b9
movl $0x1, -0x4(%rbp)
movl -0x4(%rbp), %eax
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jonof[P]jftekwar/src/tekprep.c
// Function: netstartspot
void
netstartspot(int *x, int *y,short *sectnum)
{
     int       rv;

     rv=( int)((krand_intercept("PREP 564"))&15L);
     if (rv >= startspotcnt) {
          rv=0;
     }
     *x=startspot[rv].x;
     *y=startspot[rv].y;
     *sectnum=startspot[rv].sectnum;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
leaq 0xb50fd(%rip), %rdi     # 0xd9dc8
callq 0x41510
cltq
andq $0xf, %rax
movl %eax, -0x1c(%rbp)
movl -0x1c(%rbp), %eax
cmpl 0x1553ee(%rip), %eax    # 0x17a0d0
jl 0x24ceb
movl $0x0, -0x1c(%rbp)
movslq -0x1c(%rbp), %rcx
leaq 0x1553ea(%rip), %rax    # 0x17a0e0
shlq $0x4, %rcx
addq %rcx, %rax
movl (%rax), %ecx
movq -0x8(%rbp), %rax
movl %ecx, (%rax)
movslq -0x1c(%rbp), %rcx
leaq 0x1553d0(%rip), %rax    # 0x17a0e0
shlq $0x4, %rcx
addq %rcx, %rax
movl 0x4(%rax), %ecx
movq -0x10(%rbp), %rax
movl %ecx, (%rax)
movslq -0x1c(%rbp), %rcx
leaq 0x1553b5(%rip), %rax    # 0x17a0e0
shlq $0x4, %rcx
addq %rcx, %rax
movw 0xc(%rax), %cx
movq -0x18(%rbp), %rax
movw %cx, (%rax)
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jonof[P]jftekwar/src/tekprep.c
// Function: initptrlists
int
initptrlists()
{
     int       i;

     for( i=0; i < MAXSPRITES; i++ ) {
          sprptr[i]=&sprite[i];
          sprXTptr[i]=&spriteXT[i];
     }
     for( i=0; i < MAXSECTORS; i++ ) {
          sectptr[i]=&sector[i];
     }
     for( i=0; i < MAXWALLS; i++ ) {
          wallptr[i]=&wall[i];
     }

     return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movl $0x0, -0x4(%rbp)
cmpl $0x4000, -0x4(%rbp)     # imm = 0x4000
jge 0x252f1
movslq -0x4(%rbp), %rax
leaq 0x451831(%rip), %rdx    # 0x476ae0
imulq $0x2c, %rax, %rax
addq %rax, %rdx
movslq -0x4(%rbp), %rcx
leaq 0x154f1f(%rip), %rax    # 0x17a1e0
movq %rdx, (%rax,%rcx,8)
movslq -0x4(%rbp), %rax
leaq 0x174f10(%rip), %rdx    # 0x19a1e0
imulq $0x22, %rax, %rax
addq %rax, %rdx
movslq -0x4(%rbp), %rcx
leaq 0x1fcefe(%rip), %rax    # 0x2221e0
movq %rdx, (%rax,%rcx,8)
movl -0x4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x4(%rbp)
jmp 0x2529b
movl $0x0, -0x4(%rbp)
cmpl $0x1000, -0x4(%rbp)     # imm = 0x1000
jge 0x2532d
movslq -0x4(%rbp), %rax
leaq 0x418584(%rip), %rdx    # 0x43d890
imulq $0x28, %rax, %rax
addq %rax, %rdx
movslq -0x4(%rbp), %rcx
leaq 0x21cec2(%rip), %rax    # 0x2421e0
movq %rdx, (%rax,%rcx,8)
movl -0x4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x4(%rbp)
jmp 0x252f8
movl $0x0, -0x4(%rbp)
cmpl $0x4000, -0x4(%rbp)     # imm = 0x4000
jge 0x25369
movslq -0x4(%rbp), %rax
leaq 0x38d538(%rip), %rdx    # 0x3b2880
shlq $0x5, %rax
addq %rax, %rdx
movslq -0x4(%rbp), %rcx
leaq 0x224e86(%rip), %rax    # 0x24a1e0
movq %rdx, (%rax,%rcx,8)
movl -0x4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x4(%rbp)
jmp 0x25334
xorl %eax, %eax
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/jonof[P]jftekwar/src/teksmk.c
// Function: smkopenmenu
void
smkopenmenu(char *name)
{
     unsigned long smkx, smky;
     int fh, flen;

     fh = kopen4load(name, 0);
     if (fh < 0) {
          debugprintf("smkopenmenu(\"%s\") failed\n", name);
          return;
     }

     flen = kfilelength(fh);
     smkmenubuf = (unsigned char *)malloc(flen);

     if (smkmenubuf == NULL) {
          kclose(fh);
          debugprintf("smkopenmenu(\"%s\") malloc of %d bytes failed\n", name, flen);
          return;
     }

     kread(fh, smkmenubuf, flen);
     kclose(fh);

     smkmenu = smk_open_memory(smkmenubuf, flen);
     if (!smkmenu) {
          free(smkmenubuf);
          smkmenubuf = NULL;
          debugprintf("smk_open_memory() returned null\n");
          return;
     }

     // Smacker frames are decoded linewise, but BUILD expects its
     // tiles columnwise, so we will treat the tile as though it's
     // rotated 90 degrees and flipped horizontally.

     smk_enable_all(smkmenu, SMK_VIDEO_TRACK);
     smk_info_video(smkmenu, &smkx, &smky, NULL);
     tilesizx[SMKPICNUM0] = smky;
     tilesizy[SMKPICNUM0] = smkx;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rdi
xorl %esi, %esi
callq 0x4d470
movl %eax, -0x1c(%rbp)
cmpl $0x0, -0x1c(%rbp)
jge 0x261a7
movq -0x8(%rbp), %rsi
leaq 0xb3db9(%rip), %rdi     # 0xd9f54
movb $0x0, %al
callq 0xc23f0
jmp 0x262a3
movl -0x1c(%rbp), %edi
callq 0x4dce0
movl %eax, -0x20(%rbp)
movslq -0x20(%rbp), %rdi
callq 0x8ca0
movq %rax, 0x24c04e(%rip)    # 0x272210
cmpq $0x0, 0x24c046(%rip)    # 0x272210
jne 0x261ee
movl -0x1c(%rbp), %edi
callq 0x4def0
movq -0x8(%rbp), %rsi
movl -0x20(%rbp), %edx
leaq 0xb3d8c(%rip), %rdi     # 0xd9f6e
movb $0x0, %al
callq 0xc23f0
jmp 0x262a3
movl -0x1c(%rbp), %edi
movq 0x24c018(%rip), %rsi    # 0x272210
movl -0x20(%rbp), %edx
callq 0x4d840
movl -0x1c(%rbp), %edi
callq 0x4def0
movq 0x24c001(%rip), %rdi    # 0x272210
movslq -0x20(%rbp), %rsi
callq 0x44a80
movq %rax, 0x24bff9(%rip)    # 0x272218
cmpq $0x0, 0x24bff1(%rip)    # 0x272218
jne 0x26250
movq 0x24bfe0(%rip), %rdi    # 0x272210
callq 0x8260
movq $0x0, 0x24bfd0(%rip) # 0x272210
leaq 0xb3c2f(%rip), %rdi     # 0xd9e76
movb $0x0, %al
callq 0xc23f0
jmp 0x262a3
movq 0x24bfc1(%rip), %rdi    # 0x272218
movl $0x80, %esi
callq 0x46b20
movq 0x24bfb0(%rip), %rdi    # 0x272218
leaq -0x10(%rbp), %rsi
leaq -0x18(%rbp), %rdx
xorl %eax, %eax
movl %eax, %ecx
callq 0x46890
movq -0x18(%rbp), %rax
movw %ax, %cx
leaq 0x5e1dc9(%rip), %rax    # 0x608050
movw %cx, 0x47fa(%rax)
movq -0x10(%rbp), %rax
movw %ax, %cx
leaq 0x5d3574(%rip), %rax    # 0x5f9810
movw %cx, 0x47fa(%rax)
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/jonof[P]jftekwar/src/teksmk.c
// Function: smkmenuframe
void
smkmenuframe(int fn)
{
     unsigned char spal[768];
     const unsigned char *palptr;
     int i;

     if (!smkmenu) {
          return;
     }

     // Render the first decodeframe as the menu background.
     smk_first(smkmenu);

     // Next, render the particular decodeframe requested.
     smk_render_frame(smkmenu, fn-1);

     // Convert the palette to the VGA (0-63) range BUILD uses.
     for (palptr = smk_get_palette(smkmenu), i=256*3-1; i>=0; i--)
          spal[i] = palptr[i] >> 2;

     waloff[SMKPICNUM0] = (intptr_t)smk_get_video(smkmenu);
#if USE_POLYMOST && USE_OPENGL
     invalidatetile(SMKPICNUM0, 0, -1);
#endif

     setbrightness(-1, spal, 2|4);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x320, %rsp            # imm = 0x320
movl %edi, -0x4(%rbp)
cmpq $0x0, 0x24bf52(%rip)    # 0x272218
jne 0x262cd
jmp 0x2638e
movq 0x24bf44(%rip), %rdi    # 0x272218
callq 0x46e00
movq 0x24bf38(%rip), %rdi    # 0x272218
movl -0x4(%rbp), %eax
subl $0x1, %eax
movslq %eax, %rsi
callq 0x47580
movq 0x24bf23(%rip), %rdi    # 0x272218
callq 0x46ca0
movq %rax, -0x318(%rbp)
movl $0x2ff, -0x31c(%rbp)    # imm = 0x2FF
cmpl $0x0, -0x31c(%rbp)
jl 0x2634a
movq -0x318(%rbp), %rax
movslq -0x31c(%rbp), %rcx
movzbl (%rax,%rcx), %eax
sarl $0x2, %eax
movb %al, %cl
movslq -0x31c(%rbp), %rax
movb %cl, -0x310(%rbp,%rax)
movl -0x31c(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x31c(%rbp)
jmp 0x2630b
movq 0x24bec7(%rip), %rdi    # 0x272218
callq 0x46cf0
movq %rax, %rcx
leaq 0x56cdb0(%rip), %rax    # 0x593110
movq %rcx, 0x11fe8(%rax)
movl $0x23fd, %edi           # imm = 0x23FD
xorl %esi, %esi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x72fc0
leaq -0x310(%rbp), %rsi
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
movl $0x6, %edx
callq 0x67360
addq $0x320, %rsp            # imm = 0x320
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jonof[P]jftekwar/src/teksmk.c
// Function: smkshowmenu
void
smkshowmenu()
{
     if (!smkmenu) {
          return;
     }

     clearallviews(0);
     rotatesprite(160<<16, 100<<16, divscale16(200, tilesizx[SMKPICNUM0]),
                 512, SMKPICNUM0, 0, 0, 2+4, 0, 0, xdim-1, ydim-1);
     nextpage();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
cmpq $0x0, 0x24be68(%rip)    # 0x272218
jne 0x263b7
jmp 0x2643c
xorl %edi, %edi
callq 0x67660
leaq 0x5e1c8b(%rip), %rax    # 0x608050
movswl 0x47fa(%rax), %esi
movl $0xc8, %edi
callq 0x26150
movl %eax, %edx
leaq 0x5d9c3d(%rip), %rax    # 0x60001c
movl (%rax), %r10d
subl $0x1, %r10d
leaq 0x5d9c33(%rip), %rax    # 0x600020
movl (%rax), %eax
subl $0x1, %eax
movl $0xa00000, %edi         # imm = 0xA00000
movl $0x640000, %esi         # imm = 0x640000
movl $0x200, %ecx            # imm = 0x200
movl $0x23fd, %r8d           # imm = 0x23FD
xorl %r9d, %r9d
movl $0x0, (%rsp)
movl $0x6, 0x8(%rsp)
movl $0x0, 0x10(%rsp)
movl $0x0, 0x18(%rsp)
movl %r10d, 0x20(%rsp)
movl %eax, 0x28(%rsp)
callq 0x718a0
callq 0x67810
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jonof[P]jftekwar/src/teksmk.c
// Function: smkclosemenu
void
smkclosemenu()
{
     if (smkmenu) smk_close(smkmenu);
     if (smkmenubuf) free(smkmenubuf);

     waloff[SMKPICNUM0] = 0;
     smkmenu = NULL;
     smkmenubuf = NULL;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
cmpq $0x0, 0x24bdbc(%rip)    # 0x272218
je 0x2646a
movq 0x24bdb3(%rip), %rdi    # 0x272218
callq 0x463d0
cmpq $0x0, 0x24bd9e(%rip)    # 0x272210
je 0x26480
movq 0x24bd95(%rip), %rdi    # 0x272210
callq 0x8260
leaq 0x56cc89(%rip), %rax    # 0x593110
movq $0x0, 0x11fe8(%rax)
movq $0x0, 0x24bd7b(%rip) # 0x272218
movq $0x0, 0x24bd68(%rip) # 0x272210
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jonof[P]jftekwar/src/teksnd.c
// Function: initsb
void
initsb(char digistat,char musistat,int mixrate,
    char numspeakers,char bytespersample,char intspersec,char quality)
{
     int err, channels = numspeakers, bitspersample = 4<<bytespersample;
     void *initdata = NULL;

     (void)digistat; (void)musistat; (void)intspersec; (void)quality;

     #ifdef _WIN32
     initdata = (void *) win_gethwnd();
     #endif

     err = FX_Init(ASS_AutoDetect, 16, &channels, &bitspersample, &mixrate, initdata);
     if (err != FX_Ok) {
          buildprintf("FX_Init error: %s\n", FX_ErrorString(err));
     } else {
          fxstarted = 1;

          FX_SetCallBack(soundcallback);
          setupdigi();
     }

     err = MUSIC_Init(ASS_AutoDetect, NULL);
     if (err != MUSIC_Ok) {
          buildprintf("MUSIC_Init error: %s\n", MUSIC_ErrorString(err));
     } else {
          musicstarted = 1;

          setupmidi();
     }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movl %r8d, -0x30(%rbp)
movl %ecx, %eax
movl -0x30(%rbp), %ecx
movl %eax, -0x2c(%rbp)
movl %edx, %eax
movl -0x2c(%rbp), %edx
movl %eax, -0x28(%rbp)
movl %esi, %eax
movl -0x28(%rbp), %esi
movl %eax, -0x24(%rbp)
movl %edi, %r8d
movl -0x24(%rbp), %edi
movb %r9b, %al
movb 0x10(%rbp), %r9b
movb %r8b, -0x1(%rbp)
movb %dil, -0x2(%rbp)
movl %esi, -0x8(%rbp)
movb %dl, -0x9(%rbp)
movb %cl, -0xa(%rbp)
movb %al, -0xb(%rbp)
movsbl -0x9(%rbp), %eax
movl %eax, -0x14(%rbp)
movsbl -0xa(%rbp), %ecx
movl $0x4, %eax
shll %cl, %eax
movl %eax, -0x18(%rbp)
movq $0x0, -0x20(%rbp)
movq -0x20(%rbp), %r9
movl $0xfffffffe, %edi       # imm = 0xFFFFFFFE
movl $0x10, %esi
leaq -0x14(%rbp), %rdx
leaq -0x18(%rbp), %rcx
leaq -0x8(%rbp), %r8
callq 0xcc2c0
movl %eax, -0x10(%rbp)
cmpl $0x0, -0x10(%rbp)
je 0x26555
movl -0x10(%rbp), %edi
callq 0xcc220
movq %rax, %rsi
leaq 0xb3a4f(%rip), %rdi     # 0xd9f9b
movb $0x0, %al
callq 0x52630
jmp 0x26570
movl $0x1, 0x24bcc1(%rip)    # 0x272220
leaq 0x5a(%rip), %rdi        # 0x265c0
callq 0xcc4d0
callq 0x26730
movl $0xfffffffe, %edi       # imm = 0xFFFFFFFE
xorl %eax, %eax
movl %eax, %esi
callq 0xd32a0
movl %eax, -0x10(%rbp)
cmpl $0x0, -0x10(%rbp)
je 0x265a2
movl -0x10(%rbp), %edi
callq 0xd3210
movq %rax, %rsi
leaq 0xb3a15(%rip), %rdi     # 0xd9fae
movb $0x0, %al
callq 0x52630
jmp 0x265b1
movl $0x1, 0x24bc78(%rip)    # 0x272224
callq 0x26950
addq $0x30, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jonof[P]jftekwar/src/teksnd.c
// Function: soundcallback
static void
soundcallback(unsigned int i)
{
     if (i == (unsigned int)-1) return;

     sbuf[dsound[i].sndnum].users--;
     if( sbuf[dsound[i].sndnum].users < 0 )
          sbuf[dsound[i].sndnum].users=0;
     if( sbuf[dsound[i].sndnum].users == 0 ) {
          sbuf[dsound[i].sndnum].cache_lock=199;
     }
     dsound[i].handle=NULL_HANDLE;
     dsound[i].plevel=0;
     dsound[i].sndnum=-1;

     if (dsound[i].type&ST_VEHUPDATE) {
          vehiclesoundstopped(i);
     }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movl %edi, -0x4(%rbp)
cmpl $-0x1, -0x4(%rbp)
jne 0x265d6
jmp 0x26720
movl -0x4(%rbp), %eax
movl %eax, %ecx
leaq 0x24bc4e(%rip), %rax    # 0x272230
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movslq 0x4(%rax), %rcx
leaq 0x24bdbc(%rip), %rax    # 0x2723b0
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movl (%rax), %ecx
addl $-0x1, %ecx
movl %ecx, (%rax)
movl -0x4(%rbp), %eax
movl %eax, %ecx
leaq 0x24bc22(%rip), %rax    # 0x272230
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movslq 0x4(%rax), %rcx
leaq 0x24bd90(%rip), %rax    # 0x2723b0
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
cmpl $0x0, (%rax)
jge 0x26657
movl -0x4(%rbp), %eax
movl %eax, %ecx
leaq 0x24bbf8(%rip), %rax    # 0x272230
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movslq 0x4(%rax), %rcx
leaq 0x24bd66(%rip), %rax    # 0x2723b0
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movl $0x0, (%rax)
movl -0x4(%rbp), %eax
movl %eax, %ecx
leaq 0x24bbcd(%rip), %rax    # 0x272230
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movslq 0x4(%rax), %rcx
leaq 0x24bd3b(%rip), %rax    # 0x2723b0
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
cmpl $0x0, (%rax)
jne 0x266aa
movl -0x4(%rbp), %eax
movl %eax, %ecx
leaq 0x24bba3(%rip), %rax    # 0x272230
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movslq 0x4(%rax), %rcx
leaq 0x24bd11(%rip), %rax    # 0x2723b0
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movb $-0x39, 0x14(%rax)
movl -0x4(%rbp), %eax
movl %eax, %ecx
leaq 0x24bb7a(%rip), %rax    # 0x272230
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movl $0xffffffff, (%rax)     # imm = 0xFFFFFFFF
movl -0x4(%rbp), %eax
movl %eax, %ecx
leaq 0x24bb61(%rip), %rax    # 0x272230
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movl $0x0, 0x8(%rax)
movl -0x4(%rbp), %eax
movl %eax, %ecx
leaq 0x24bb47(%rip), %rax    # 0x272230
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movl $0xffffffff, 0x4(%rax)  # imm = 0xFFFFFFFF
movl -0x4(%rbp), %eax
movl %eax, %ecx
leaq 0x24bb2d(%rip), %rax    # 0x272230
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movswl 0x14(%rax), %eax
andl $0x80, %eax
cmpl $0x0, %eax
je 0x26720
movl -0x4(%rbp), %edi
callq 0x43550
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jonof[P]jftekwar/src/teksnd.c
// Function: setupmidi
static void
setupmidi(void)
{
     int       i;

     fhsongs = kopen4load("songs", 0);
     if( fhsongs < 0 ) {
          crashgame("setupmidi: cant open songs");
     }
     memset(songlist, 0, sizeof(songlist));
     klseek(fhsongs, -sizeof(songlist), SEEK_END);
     i = kread(fhsongs, songlist, sizeof(songlist));
     if( i != sizeof(songlist) ) {
          crashgame("setupmidi: bad read of songlist");
     }

     songplaying = -1;
     totalsongsperlevel=SONGSPERLEVEL*AVAILMODES;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
leaq 0xb373e(%rip), %rdi     # 0xda09d
xorl %esi, %esi
callq 0x4d470
movl %eax, 0xf4408(%rip)     # 0x11ad74
cmpl $0x0, 0xf4401(%rip)     # 0x11ad74
jge 0x26983
leaq 0xb370c(%rip), %rdi     # 0xda088
movb $0x0, %al
callq 0x44240
leaq 0x257a36(%rip), %rdi    # 0x27e3c0
xorl %esi, %esi
movl $0x1000, %edx           # imm = 0x1000
callq 0x8410
movl 0xf43d8(%rip), %edi     # 0x11ad74
movl $0xfffff000, %esi       # imm = 0xFFFFF000
movl $0x2, %edx
callq 0x4db20
movl 0xf43c3(%rip), %edi     # 0x11ad74
leaq 0x257a08(%rip), %rsi    # 0x27e3c0
movl $0x1000, %edx           # imm = 0x1000
callq 0x4d840
movl %eax, -0x4(%rbp)
movslq -0x4(%rbp), %rax
cmpq $0x1000, %rax           # imm = 0x1000
je 0x269df
leaq 0xb36cb(%rip), %rdi     # 0xda0a3
movb $0x0, %al
callq 0x44240
movl $0xffffffff, 0xf4383(%rip) # imm = 0xFFFFFFFF
movl $0x9, 0x2589cd(%rip)    # 0x27f3c0
addq $0x10, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/jonof[P]jftekwar/src/teksnd.c
// Function: uninitsb
void
uninitsb(void)
{
     int i;

     if( musicstarted )  {
          MUSIC_StopSong();
          MUSIC_Shutdown();
          musicstarted = 0;
     }

     if( fxstarted ) {
          for( i=0; i<MAXSOUNDS; i++ ) {
               if( dsound[i].handle == NULL_HANDLE )
                    continue;
               FX_StopSound(dsound[i].handle);
          }
          FX_Shutdown();
          fxstarted = 0;
     }

     if (fhsounds >= 0) {
          kclose(fhsounds);
          fhsounds = -1;
     }
     if (fhsongs >= 0) {
          kclose(fhsongs);
          fhsongs = -1;
     }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
cmpl $0x0, 0x24b815(%rip)    # 0x272224
je 0x26a25
callq 0xd3550
callq 0xd33f0
movl $0x0, 0x24b7ff(%rip)    # 0x272224
cmpl $0x0, 0x24b7f4(%rip)    # 0x272220
je 0x26a87
movl $0x0, -0x4(%rbp)
cmpl $0x10, -0x4(%rbp)
jge 0x26a78
movslq -0x4(%rbp), %rcx
leaq 0x24b7ea(%rip), %rax    # 0x272230
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
cmpl $-0x1, (%rax)
jne 0x26a54
jmp 0x26a6d
movslq -0x4(%rbp), %rcx
leaq 0x24b7d1(%rip), %rax    # 0x272230
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movl (%rax), %edi
callq 0xccc50
movl -0x4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x4(%rbp)
jmp 0x26a35
callq 0xcc420
movl $0x0, 0x24b799(%rip)    # 0x272220
cmpl $0x0, 0xf42e2(%rip)     # 0x11ad70
jl 0x26aa5
movl 0xf42da(%rip), %edi     # 0x11ad70
callq 0x4def0
movl $0xffffffff, 0xf42cb(%rip) # imm = 0xFFFFFFFF
cmpl $0x0, 0xf42c8(%rip)     # 0x11ad74
jl 0x26ac3
movl 0xf42c0(%rip), %edi     # 0x11ad74
callq 0x4def0
movl $0xffffffff, 0xf42b1(%rip) # imm = 0xFFFFFFFF
addq $0x10, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/jonof[P]jftekwar/src/teksnd.c
// Function: stopsound
void
stopsound(int i)
{
     if( !fxstarted )
          return;
     if( (i < 0) || (i >= MAXSOUNDS) ) {
          return;
     }
     if( dsound[i].handle == NULL_HANDLE )
          return;

     FX_StopSound(dsound[i].handle);
     sbuf[dsound[i].sndnum].users--;
     if( sbuf[dsound[i].sndnum].users < 0 )
              sbuf[dsound[i].sndnum].users=0;
     if( sbuf[dsound[i].sndnum].users == 0 ) {
         sbuf[dsound[i].sndnum].cache_lock=199;
     }
     dsound[i].handle=NULL_HANDLE;
     dsound[i].plevel=0;
     dsound[i].sndnum=-1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movl %edi, -0x4(%rbp)
cmpl $0x0, 0x24b1ee(%rip)    # 0x272220
jne 0x27039
jmp 0x27198
cmpl $0x0, -0x4(%rbp)
jl 0x27045
cmpl $0x10, -0x4(%rbp)
jl 0x2704a
jmp 0x27198
movslq -0x4(%rbp), %rcx
leaq 0x24b1db(%rip), %rax    # 0x272230
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
cmpl $-0x1, (%rax)
jne 0x27066
jmp 0x27198
movslq -0x4(%rbp), %rcx
leaq 0x24b1bf(%rip), %rax    # 0x272230
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movl (%rax), %edi
callq 0xccc50
movslq -0x4(%rbp), %rcx
leaq 0x24b1a6(%rip), %rax    # 0x272230
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movslq 0x4(%rax), %rcx
leaq 0x24b314(%rip), %rax    # 0x2723b0
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movl (%rax), %ecx
addl $-0x1, %ecx
movl %ecx, (%rax)
movslq -0x4(%rbp), %rcx
leaq 0x24b17b(%rip), %rax    # 0x272230
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movslq 0x4(%rax), %rcx
leaq 0x24b2e9(%rip), %rax    # 0x2723b0
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
cmpl $0x0, (%rax)
jge 0x270fd
movslq -0x4(%rbp), %rcx
leaq 0x24b152(%rip), %rax    # 0x272230
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movslq 0x4(%rax), %rcx
leaq 0x24b2c0(%rip), %rax    # 0x2723b0
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movl $0x0, (%rax)
movslq -0x4(%rbp), %rcx
leaq 0x24b128(%rip), %rax    # 0x272230
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movslq 0x4(%rax), %rcx
leaq 0x24b296(%rip), %rax    # 0x2723b0
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
cmpl $0x0, (%rax)
jne 0x2714e
movslq -0x4(%rbp), %rcx
leaq 0x24b0ff(%rip), %rax    # 0x272230
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movslq 0x4(%rax), %rcx
leaq 0x24b26d(%rip), %rax    # 0x2723b0
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movb $-0x39, 0x14(%rax)
movslq -0x4(%rbp), %rcx
leaq 0x24b0d7(%rip), %rax    # 0x272230
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movl $0xffffffff, (%rax)     # imm = 0xFFFFFFFF
movslq -0x4(%rbp), %rcx
leaq 0x24b0bf(%rip), %rax    # 0x272230
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movl $0x0, 0x8(%rax)
movslq -0x4(%rbp), %rcx
leaq 0x24b0a6(%rip), %rax    # 0x272230
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movl $0xffffffff, 0x4(%rax)  # imm = 0xFFFFFFFF
addq $0x10, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/jonof[P]jftekwar/src/teksnd.c
// Function: stopsong
void
stopsong(int sn)
{
     if( songplaying != sn ) {
          return;
     }

     MUSIC_StopSong();
     songplaying=-1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movl %edi, -0x4(%rbp)
movl 0xf366b(%rip), %eax     # 0x11ad6c
cmpl -0x4(%rbp), %eax
je 0x27708
jmp 0x27717
callq 0xd3550
movl $0xffffffff, 0xf3655(%rip) # imm = 0xFFFFFFFF
addq $0x10, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/jonof[P]jftekwar/src/teksnd.c
// Function: playsong
int
playsong(int sn)
{
     int       rv;
     int       midilen;

     if( !musicstarted || (toggles[TOGGLE_MUSIC] == 0) ) {
          return(0);
     }
     if( (sn < 0) || (sn >= SONGSPERLEVEL) || (songplaying == sn) ) {
          return(0);
     }

     removesong(sn);
     if( songlengths[sn] == 0 )
         return(0);

     klseek(fhsongs, songoffsets[sn], SEEK_SET);
     rv=kread(fhsongs, songdata, songlengths[sn]);
     if( rv != songlengths[sn] ) {
         crashgame("playsong: bad read");
     }

     midilen = transmutehmp(songdata);
     if (midilen <= 0) {
          buildprintf("playsong: could not convert song to MIDI\n");
          return 0;
     }

     rv = MUSIC_PlaySong(songdata, midilen, 1);
     if( rv != MUSIC_Ok ) {
          buildprintf("playsong: could not play song: %s\n", MUSIC_ErrorString(MUSIC_ErrorCode));
          return 0;
     }

    #ifdef MUSICDEBUG
     showmessage("PLAYING SONG %2d", sn);
    #endif
     songplaying = sn;

     return(1);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movl %edi, -0x8(%rbp)
cmpl $0x0, 0x24aac2(%rip)    # 0x272224
je 0x27771
leaq 0xf2895(%rip), %rax     # 0x11a000
cmpl $0x0, 0x10(%rax)
jne 0x2777d
movl $0x0, -0x4(%rbp)
jmp 0x278a5
cmpl $0x0, -0x8(%rbp)
jl 0x27794
cmpl $0x3, -0x8(%rbp)
jge 0x27794
movl 0xf35dd(%rip), %eax     # 0x11ad6c
cmpl -0x8(%rbp), %eax
jne 0x277a0
movl $0x0, -0x4(%rbp)
jmp 0x278a5
movl -0x8(%rbp), %edi
callq 0x27720
movslq -0x8(%rbp), %rcx
leaq 0x24bf7d(%rip), %rax    # 0x273730
cmpl $0x0, (%rax,%rcx,4)
jne 0x277c5
movl $0x0, -0x4(%rbp)
jmp 0x278a5
movl 0xf35a9(%rip), %edi     # 0x11ad74
movslq -0x8(%rbp), %rcx
leaq 0x24bf66(%rip), %rax    # 0x27373c
movl (%rax,%rcx,4), %esi
xorl %edx, %edx
callq 0x4db20
movl 0xf358e(%rip), %edi     # 0x11ad74
movslq -0x8(%rbp), %rcx
leaq 0x24bf3f(%rip), %rax    # 0x273730
movl (%rax,%rcx,4), %edx
leaq 0x24bf55(%rip), %rsi    # 0x273750
callq 0x4d840
movl %eax, -0xc(%rbp)
movl -0xc(%rbp), %eax
movslq -0x8(%rbp), %rdx
leaq 0x24bf1f(%rip), %rcx    # 0x273730
cmpl (%rcx,%rdx,4), %eax
je 0x27824
leaq 0xb27a7(%rip), %rdi     # 0xd9fc4
movb $0x0, %al
callq 0x44240
leaq 0x24bf25(%rip), %rdi    # 0x273750
callq 0x278b0
movl %eax, -0x10(%rbp)
cmpl $0x0, -0x10(%rbp)
jg 0x27850
leaq 0xb2797(%rip), %rdi     # 0xd9fd7
movb $0x0, %al
callq 0x52630
movl $0x0, -0x4(%rbp)
jmp 0x278a5
movl -0x10(%rbp), %esi
leaq 0x24bef6(%rip), %rdi    # 0x273750
movl $0x1, %edx
callq 0xd3580
movl %eax, -0xc(%rbp)
cmpl $0x0, -0xc(%rbp)
je 0x27895
leaq 0xc72344(%rip), %rax    # 0xc99bb8
movl (%rax), %edi
callq 0xd3210
movq %rax, %rsi
leaq 0xb277c(%rip), %rdi     # 0xda001
movb $0x0, %al
callq 0x52630
movl $0x0, -0x4(%rbp)
jmp 0x278a5
movl -0x8(%rbp), %eax
movl %eax, 0xf34ce(%rip)     # 0x11ad6c
movl $0x1, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x10, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/jonof[P]jftekwar/src/teksnd.c
// Function: menusong
void
menusong(int insubway)
{
     int i,index;

     if( !musicstarted )
          return;

     for( i=0; i<SONGSPERLEVEL; i++ ) {
          removesong(i);
     }

     if(insubway)
          index=(NUMLEVELS*(AVAILMODES*SONGSPERLEVEL)+3);
     else
          index=NUMLEVELS*(AVAILMODES*SONGSPERLEVEL);

     index+=2;

     songoffsets[BASESONG] = songlist[index*3]*4096;
     songlengths[BASESONG] = songlist[(index*3)+1];
     if( songlengths[BASESONG] >= MAXBASESONGLENGTH ) {
          crashgame("prepsongs: basesong exceeded max length");
     }

     playsong(BASESONG);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movl %edi, -0x4(%rbp)
cmpl $0x0, 0x24a122(%rip)    # 0x272224
jne 0x28109
jmp 0x2819d
movl $0x0, -0x8(%rbp)
cmpl $0x3, -0x8(%rbp)
jge 0x28129
movl -0x8(%rbp), %edi
callq 0x27720
movl -0x8(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x8(%rbp)
jmp 0x28110
cmpl $0x0, -0x4(%rbp)
je 0x28138
movl $0x42, -0xc(%rbp)
jmp 0x2813f
movl $0x3f, -0xc(%rbp)
movl -0xc(%rbp), %eax
addl $0x2, %eax
movl %eax, -0xc(%rbp)
imull $0x3, -0xc(%rbp), %eax
movslq %eax, %rcx
leaq 0x25626a(%rip), %rax    # 0x27e3c0
movl (%rax,%rcx,4), %eax
shll $0xc, %eax
movl %eax, 0x24b5da(%rip)    # 0x27373c
imull $0x3, -0xc(%rbp), %eax
addl $0x1, %eax
movslq %eax, %rcx
leaq 0x25624d(%rip), %rax    # 0x27e3c0
movl (%rax,%rcx,4), %eax
movl %eax, 0x24b5b4(%rip)    # 0x273730
cmpl $0xac68, 0x24b5aa(%rip) # imm = 0xAC68
jl 0x28196
leaq 0xb1e95(%rip), %rdi     # 0xda024
movb $0x0, %al
callq 0x44240
xorl %edi, %edi
callq 0x27750
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jonof[P]jftekwar/src/teksnd.c
// Function: startmusic
void
startmusic(int level)
{
     int       i,index;

     if( !musicstarted ) {
          return;
     }

     if( level > 6 ) {
          return;
     }

     for( i=0; i<SONGSPERLEVEL; i++ ) {
          removesong(i);
     }

     index=totalsongsperlevel*(level);

     index+=SONGSPERLEVEL;    // Skip FM.
     index+=SONGSPERLEVEL;    // Skip AWE32.

     for( i=0; i<SONGSPERLEVEL; i++ ) {
          songoffsets[i]=songlist[(index*3)+(i*3)]*4096;
          songlengths[i]=songlist[((index*3)+(i*3))+1];
          if( songlengths[i] >= MAXBASESONGLENGTH ) {
               crashgame("prepsongs: basesong exceeded max length");
          }
     }

     playsong(BASESONG);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movl %edi, -0x4(%rbp)
cmpl $0x0, 0x24a062(%rip)    # 0x272224
jne 0x281c9
jmp 0x282ad
cmpl $0x6, -0x4(%rbp)
jle 0x281d4
jmp 0x282ad
movl $0x0, -0x8(%rbp)
cmpl $0x3, -0x8(%rbp)
jge 0x281f4
movl -0x8(%rbp), %edi
callq 0x27720
movl -0x8(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x8(%rbp)
jmp 0x281db
movl 0x2571c6(%rip), %eax    # 0x27f3c0
imull -0x4(%rbp), %eax
movl %eax, -0xc(%rbp)
movl -0xc(%rbp), %eax
addl $0x3, %eax
movl %eax, -0xc(%rbp)
movl -0xc(%rbp), %eax
addl $0x3, %eax
movl %eax, -0xc(%rbp)
movl $0x0, -0x8(%rbp)
cmpl $0x3, -0x8(%rbp)
jge 0x282a6
imull $0x3, -0xc(%rbp), %eax
imull $0x3, -0x8(%rbp), %ecx
addl %ecx, %eax
movslq %eax, %rcx
leaq 0x256188(%rip), %rax    # 0x27e3c0
movl (%rax,%rcx,4), %edx
shll $0xc, %edx
movslq -0x8(%rbp), %rcx
leaq 0x24b4f3(%rip), %rax    # 0x27373c
movl %edx, (%rax,%rcx,4)
imull $0x3, -0xc(%rbp), %eax
imull $0x3, -0x8(%rbp), %ecx
addl %ecx, %eax
addl $0x1, %eax
movslq %eax, %rcx
leaq 0x25615d(%rip), %rax    # 0x27e3c0
movl (%rax,%rcx,4), %edx
movslq -0x8(%rbp), %rcx
leaq 0x24b4bf(%rip), %rax    # 0x273730
movl %edx, (%rax,%rcx,4)
movslq -0x8(%rbp), %rcx
leaq 0x24b4b1(%rip), %rax    # 0x273730
cmpl $0xac68, (%rax,%rcx,4)  # imm = 0xAC68
jl 0x28296
leaq 0xb1d95(%rip), %rdi     # 0xda024
movb $0x0, %al
callq 0x44240
jmp 0x28298
movl -0x8(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x8(%rbp)
jmp 0x2821a
xorl %edi, %edi
callq 0x27750
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jonof[P]jftekwar/src/tekspr.c
// Function: dropit
void
dropit(int x, int y, int z, short sect, int pic)
{
     int       j,ang;

     j=jsinsertsprite(sect, DROPSIES);
     if( j != -1 ) {
          ang=dropangles[dropanglecnt];
          fillsprite(j,x,y,z,0,
                     0,0,12,
                     16,16,0,0,pic,ang,
                     sintable[(ang+2560)&2047]>>6,sintable[(ang+2048)&2047]>>6,
                     30L,0,sect,DROPSIES,0,0,0);
     }
     dropanglecnt++;
     if( dropanglecnt >= MAXDROPANGLES ) {
          dropanglecnt=0;
     }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movw %cx, %ax
movl %edi, -0x4(%rbp)
movl %esi, -0x8(%rbp)
movl %edx, -0xc(%rbp)
movw %ax, -0xe(%rbp)
movl %r8d, -0x14(%rbp)
movl $0x196, %esi            # imm = 0x196
movswl -0xe(%rbp), %edi
callq 0x2abd0
cwtl
movl %eax, -0x18(%rbp)
cmpl $-0x1, -0x18(%rbp)
je 0x2a784
movzbl 0x254d85(%rip), %eax    # 0x27f3c4
movl %eax, %ecx
leaq 0xf0730(%rip), %rax     # 0x11ad78
movswl (%rax,%rcx,2), %eax
movl %eax, -0x1c(%rbp)
movslq -0x18(%rbp), %rcx
leaq 0x44c486(%rip), %rax    # 0x476ae0
imulq $0x2c, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0x28(%rbp)
movl -0x4(%rbp), %ecx
movq -0x28(%rbp), %rax
movl %ecx, (%rax)
movl -0x8(%rbp), %ecx
movq -0x28(%rbp), %rax
movl %ecx, 0x4(%rax)
movl -0xc(%rbp), %ecx
movq -0x28(%rbp), %rax
movl %ecx, 0x8(%rax)
movq -0x28(%rbp), %rax
movw $0x0, 0xc(%rax)
movq -0x28(%rbp), %rax
movb $0x0, 0x10(%rax)
movq -0x28(%rbp), %rax
movb $0x0, 0x11(%rax)
movq -0x28(%rbp), %rax
movb $0xc, 0x12(%rax)
movq -0x28(%rbp), %rax
movb $0x10, 0x14(%rax)
movq -0x28(%rbp), %rax
movb $0x10, 0x15(%rax)
movq -0x28(%rbp), %rax
movb $0x0, 0x16(%rax)
movq -0x28(%rbp), %rax
movb $0x0, 0x17(%rax)
movl -0x14(%rbp), %eax
movw %ax, %cx
movq -0x28(%rbp), %rax
movw %cx, 0xe(%rax)
movl -0x1c(%rbp), %eax
movw %ax, %cx
movq -0x28(%rbp), %rax
movw %cx, 0x1c(%rax)
movl -0x1c(%rbp), %eax
addl $0xa00, %eax            # imm = 0xA00
andl $0x7ff, %eax            # imm = 0x7FF
movslq %eax, %rcx
leaq 0x59e489(%rip), %rax    # 0x5c8b80
movswl (%rax,%rcx,2), %eax
sarl $0x6, %eax
movw %ax, %cx
movq -0x28(%rbp), %rax
movw %cx, 0x20(%rax)
movl -0x1c(%rbp), %eax
addl $0x800, %eax            # imm = 0x800
andl $0x7ff, %eax            # imm = 0x7FF
movslq %eax, %rcx
leaq 0x59e460(%rip), %rax    # 0x5c8b80
movswl (%rax,%rcx,2), %eax
sarl $0x6, %eax
movw %ax, %cx
movq -0x28(%rbp), %rax
movw %cx, 0x22(%rax)
movq -0x28(%rbp), %rax
movw $0x1e, 0x24(%rax)
movq -0x28(%rbp), %rax
movw $0x0, 0x1e(%rax)
movq -0x28(%rbp), %rax
movw $0x0, 0x26(%rax)
movq -0x28(%rbp), %rax
movw $0x0, 0x28(%rax)
movq -0x28(%rbp), %rax
movw $0xffff, 0x2a(%rax)     # imm = 0xFFFF
movq -0x28(%rbp), %rdi
movslq -0x18(%rbp), %rax
leaq 0x10b4ad(%rip), %rsi    # 0x135c20
imulq $0xc, %rax, %rax
addq %rax, %rsi
movl $0x3, %edx
callq 0x8c070
movb 0x254c3a(%rip), %al     # 0x27f3c4
addb $0x1, %al
movb %al, 0x254c32(%rip)     # 0x27f3c4
movzbl 0x254c2b(%rip), %eax    # 0x27f3c4
cmpl $0x6, %eax
jl 0x2a7a5
movb $0x0, 0x254c1f(%rip)    # 0x27f3c4
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jonof[P]jftekwar/src/tekstat.c
// Function: jsdeletesprite
short
jsdeletesprite(short spritenum)
{
     int       ext;

     ext=sprptr[spritenum]->extra;

     if( validext(ext) ) {
          memset(sprXTptr[ext], 0, sizeof(struct spriteextension));
          sprXTptr[ext]->lock=0x00;
     }

     deletesprite(spritenum);
     sprite[spritenum].extra=-1;

     return(0);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movw %di, %ax
movw %ax, -0x2(%rbp)
movswq -0x2(%rbp), %rcx
leaq 0x14f3c5(%rip), %rax    # 0x17a1e0
movq (%rax,%rcx,8), %rax
movswl 0x2a(%rax), %eax
movl %eax, -0x8(%rbp)
movl -0x8(%rbp), %edi
callq 0x2ae90
cmpl $0x0, %eax
je 0x2ae61
movslq -0x8(%rbp), %rcx
leaq 0x1f73a2(%rip), %rax    # 0x2221e0
movq (%rax,%rcx,8), %rdi
xorl %esi, %esi
movl $0x22, %edx
callq 0x8410
movslq -0x8(%rbp), %rcx
leaq 0x1f7387(%rip), %rax    # 0x2221e0
movq (%rax,%rcx,8), %rax
movb $0x0, 0x1e(%rax)
movswl -0x2(%rbp), %edi
callq 0x6a190
movswq -0x2(%rbp), %rcx
leaq 0x44bc6a(%rip), %rax    # 0x476ae0
imulq $0x2c, %rcx, %rcx
addq %rcx, %rax
movw $0xffff, 0x2a(%rax)     # imm = 0xFFFF
xorl %eax, %eax
addq $0x10, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jonof[P]jftekwar/src/tekstat.c
// Function: isaplayersprite
int
isaplayersprite(int sprnum)
{
     int       j;

     for( j=connecthead ; j >= 0 ; j=connectpoint2[j] ) {
          if( playersprite[j] == sprnum ) {
               return(1);
          }
     }
     if( sprptr[sprnum]->statnum == 8 ) {
          crashgame("isplrspr: non plr has statnm 8");
     }
     return(0);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movl %edi, -0x8(%rbp)
leaq 0x77a07e(%rip), %rax    # 0x7a4f50
movl (%rax), %eax
movl %eax, -0xc(%rbp)
cmpl $0x0, -0xc(%rbp)
jl 0x2af0f
movslq -0xc(%rbp), %rcx
leaq 0x103828(%rip), %rax    # 0x12e710
movswl (%rax,%rcx,2), %eax
cmpl -0x8(%rbp), %eax
jne 0x2aefa
movl $0x1, -0x4(%rbp)
jmp 0x2af3c
jmp 0x2aefc
movslq -0xc(%rbp), %rcx
leaq 0x77a059(%rip), %rax    # 0x7a4f60
movl (%rax,%rcx,4), %eax
movl %eax, -0xc(%rbp)
jmp 0x2aed7
movslq -0x8(%rbp), %rcx
leaq 0x14f2c6(%rip), %rax    # 0x17a1e0
movq (%rax,%rcx,8), %rax
movswl 0x1a(%rax), %eax
cmpl $0x8, %eax
jne 0x2af35
leaq 0xaf2ee(%rip), %rdi     # 0xda21c
movb $0x0, %al
callq 0x44240
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)