LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O1/jonof[P]jftekwar/src/tekmsc.c
// Function: tekgamestarted
void
tekgamestarted(void)
{
     hcpos=-tilesizx[HCDEVICE];
     wppos=-tilesizx[WPDEVICE];
     rvpos=-tilesizx[RVDEVICE];
     seconds=minutes=hours=0;
     show2dsprite[playersprite[myconnectindex]>>3]|=
          (1<<(playersprite[myconnectindex]&7));
     songmastervolume(musicv<<3);
     soundmastervolume(soundv<<11);
}

// Assembly:
pushq %rax
leaq 0x78de8d(%rip), %rax    # 0x7a2b04
movslq (%rax), %rax
leaq 0xcdacf(%rip), %rcx     # 0xe2750
movswl (%rcx,%rax,2), %eax
movl %eax, %ecx
andb $0x7, %cl
movl $0x1, %edx
shll %cl, %edx
shrl $0x3, %eax
movswq %ax, %rax
leaq 0x5446a1(%rip), %rcx    # 0x559340
orb %dl, (%rcx,%rax)
leaq 0x5a91d7(%rip), %rax    # 0x5bde80
xorl %ecx, %ecx
xorl %edx, %edx
subw 0xc38(%rax), %dx
movw %dx, 0x1190b1(%rip)     # 0x12dd6c
xorl %edx, %edx
subw 0xc2e(%rax), %dx
movw %dx, 0x1190a3(%rip)     # 0x12dd6e
movzwl 0xc24(%rax), %eax
xorl %edx, %edx
subw %ax, %dx
movw %dx, 0x119092(%rip)     # 0x12dd70
movl %ecx, 0x117820(%rip)    # 0x12c504
movl %ecx, 0x117816(%rip)    # 0x12c500
movl %ecx, 0x11780c(%rip)    # 0x12c4fc
movl 0xba902(%rip), %edi     # 0xcf5f8
shll $0x3, %edi
callq 0x1c5a0
movl 0xba8f8(%rip), %edi     # 0xcf5fc
shll $0xb, %edi
popq %rax
jmp 0x1c5a1
// File: /workspace/github_c_makefile_star2_O1/jonof[P]jftekwar/src/tekmsc.c
// Function: netstats
void
netstats()
{
    #ifdef NETNAMES
     int       i;

     if( option[4] != 0 ) {
          for( i=connecthead ; i >= 0 ; i=connectpoint2[i] ) {
              #if 0
               if( score[i] > score[newnetleader] ) {
                    if( score[newnetleader] < NETWINSCORE ) {
                         newnetleader=i;
                    }
               }
              #endif
               if( (toggles[TOGGLE_SCORE]) && (screensize >= xdim) ) {
                    sprintf(tektempbuf,"%2d %10s %6d",i,netnames[i],score[i]);
                    printext(12,(windowy1+32)+(i<<3),tektempbuf,ALPHABET,255);
               }
          }
         #if 0
          if( newnetleader != oldnetleader ) {
               oldnetleader=newnetleader;
          }
          else if( (totalclock-netclock) > 7200 ) {
               netclock=totalclock;
               sprintf(tektempbuf,"%2d %s LEADS",newnetleader,netnames[newnetleader],score[newnetleader]);
               showmessage(tektempbuf);
          }
         #endif
     }
    #endif
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
leaq 0xb8c9f(%rip), %rax     # 0xce978
cmpb $0x0, 0x4(%rax)
setne %al
leaq 0x78ce29(%rip), %rcx    # 0x7a2b10
movl (%rcx), %ebx
testl %ebx, %ebx
setns %cl
andb %al, %cl
cmpb $0x1, %cl
jne 0x15da3
leaq 0xb8d60(%rip), %r13     # 0xcea60
leaq 0x78ce19(%rip), %r9     # 0x7a2b20
leaq 0xcce94(%rip), %r15     # 0xe2ba2
leaq 0x5a0137(%rip), %r14    # 0x5b5e4c
cmpl $0x0, 0x8(%r13)
movl %ebx, %ebp
je 0x15d97
movswl (%r15), %eax
cmpl %eax, (%r14)
jg 0x15d97
leaq (,%rbp,4), %rax
addq %rbp, %rax
leaq (,%rax,2), %rcx
addq %rbp, %rcx
addq 0xb81f4(%rip), %rcx     # 0xcdf38
leaq 0x114935(%rip), %rax    # 0x12a680
movl (%rax,%rbp,4), %r8d
leaq 0x11810a(%rip), %rdi    # 0x12de60
movq %r9, %r12
leaq 0x76c0d(%rip), %rsi     # 0x8c96d
movl %ebx, %edx
xorl %eax, %eax
callq 0x8f20
leaq 0x56bc70(%rip), %rax    # 0x5819e0
movl (%rax), %eax
leal (%rax,%rbx,8), %esi
addl $0x20, %esi
movl $0xc, %edi
leaq 0x1180dc(%rip), %rdx    # 0x12de60
movl $0x15c, %ecx            # imm = 0x15C
movl $0xff, %r8d
callq 0xa13f
movq %r12, %r9
movl (%r9,%rbp,4), %ebx
testl %ebx, %ebx
jns 0x15d15
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]jftekwar/src/tekmsc.c
// Function: tektime
void
tektime(void)
{
     fortieth++;
     if( fortieth == 40 ) {
          fortieth=0;
          seconds++;
     }
     if( seconds == 60 ) {
          minutes++;
          seconds=0;
     }
     if( minutes == 60 ) {
          hours++;
          minutes=0;
     }
     if( hours > 99 ) {
          hours=0;
     }
     if( messageon ) {
          messageon++;
          if( messageon == 160 ) {
               messageon=0;
          }
     }
}

// Assembly:
movl 0x11709b(%rip), %eax    # 0x12df8c
incl %eax
movl %eax, 0x117093(%rip)    # 0x12df8c
cmpl $0x28, %eax
jne 0x16f0e
movl $0x0, 0x117084(%rip)    # 0x12df8c
incl 0x1155ee(%rip)          # 0x12c4fc
cmpl $0x3c, 0x1155e7(%rip)   # 0x12c4fc
jne 0x16f27
incl 0x1155e3(%rip)          # 0x12c500
movl $0x0, 0x1155d5(%rip)    # 0x12c4fc
cmpl $0x3c, 0x1155d2(%rip)   # 0x12c500
jne 0x16f40
incl 0x1155ce(%rip)          # 0x12c504
movl $0x0, 0x1155c0(%rip)    # 0x12c500
cmpl $0x64, 0x1155bd(%rip)   # 0x12c504
jl 0x16f53
movl $0x0, 0x1155b1(%rip)    # 0x12c504
movl 0x1155af(%rip), %eax    # 0x12c508
testl %eax, %eax
je 0x16f6f
incl %eax
xorl %ecx, %ecx
cmpl $0xa0, %eax
cmovnel %eax, %ecx
movl %ecx, 0x115599(%rip)    # 0x12c508
retq
// File: /workspace/github_c_makefile_star2_O1/jonof[P]jftekwar/src/tekmsc.c
// Function: newgame
void
newgame(char *mapname)
{
     int  i;

     if( option[4] != 0 ) {
          return;
     }

     ready2send=0;

     stopallsounds();
     if (strcmp(boardfilename,mapname) != 0) {
          strcpy(boardfilename,mapname);
     }
     initpaletteshifts();
     prepareboard(boardfilename);
     precache();
     for (i=connecthead ; i >= 0 ; i=connectpoint2[i]) {
          initplayersprite((short)i);
     }

     ready2send=1;
}

// Assembly:
leaq 0xb79ef(%rip), %rax     # 0xce978
cmpb $0x0, 0x4(%rax)
je 0x16f90
retq
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
leaq 0xca4b4(%rip), %r14     # 0xe1453
movb $0x0, (%r14)
xorl %eax, %eax
callq 0x1c68f
leaq 0xcb85f(%rip), %rdi     # 0xe2810
movq %rbx, %rsi
callq 0x8c40
testl %eax, %eax
je 0x16fcc
leaq 0xcb84c(%rip), %rdi     # 0xe2810
movq %rbx, %rsi
callq 0x85b0
callq 0x145ca
leaq 0xcb838(%rip), %rdi     # 0xe2810
callq 0x19a20
xorl %eax, %eax
callq 0xa1e5
leaq 0x78bb25(%rip), %rax    # 0x7a2b10
movl (%rax), %ebx
testl %ebx, %ebx
js 0x1700a
leaq 0x78bb28(%rip), %r15    # 0x7a2b20
movswl %bx, %edi
callq 0x1b0cd
movl %ebx, %eax
movl (%r15,%rax,4), %ebx
testl %ebx, %ebx
jns 0x16ff8
movb $0x1, (%r14)
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/jonof[P]jftekwar/src/tekmsc.c
// Function: accessiblemap
int
accessiblemap(int mn)
{
     int       i;

     if( (mn < 0) || (mn >= TOTALMAPS) ) {
          return(0);
     }
     if( strlen(mapnames[mn]) < 2 ) {
          return(0);
     }
     for( i=0; i<MAXMAPSPERMISSION; i++ ) {
          if( missionset[mission][i] == mn ) {
               return(1);
          }
     }
     return(0);
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
xorl %ebp, %ebp
cmpl $0x1f, %edi
ja 0x1706b
movl %edi, %ebx
movl %edi, %eax
leaq 0xb85e7(%rip), %rcx     # 0xcf610
movq (%rcx,%rax,8), %rdi
callq 0x85a0
cmpq $0x2, %rax
jb 0x1706b
movslq 0x1154d1(%rip), %rax    # 0x12c510
shlq $0x3, %rax
leaq (%rax,%rax,2), %rax
xorl %ecx, %ecx
leaq 0xb86c0(%rip), %rdx     # 0xcf710
leaq (%rax,%rcx,4), %rsi
cmpl %ebx, (%rdx,%rsi)
je 0x17066
incq %rcx
cmpq $0x6, %rcx
jne 0x17050
xorl %ebp, %ebp
jmp 0x1706b
movl $0x1, %ebp
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/jonof[P]jftekwar/src/tekmsc.c
// Function: getloadsavenames
void
getloadsavenames(void)
{
     int  fil,i;

     for (i=0 ; i < MAXLOADSAVEOPTS ; i++) {
          sprintf((char *)tempbuf,"savegam%d.tek",i+1);
          if (access((char *)tempbuf,F_OK) == 0) {
               fil=open((char *)tempbuf,O_BINARY|O_RDONLY,S_IREAD);
               read(fil,&loadsavenames[i],MAXLOADSAVESIZE);
               close(fil);
          }
          else {
               strncpy(loadsavenames[i],"-EMPTY-",MAXLOADSAVESIZE);
          }
     }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
leaq 0x116c4b(%rip), %rbx    # 0x12dfa0
movq $-0x5, %r12
leaq 0xca28d(%rip), %r14     # 0xe15f0
leaq 0x75135(%rip), %r15     # 0x8c49f
movabsq $0x2d5954504d452d, %r13 # imm = 0x2D5954504D452D
leal 0x6(%r12), %edx
movq %r14, %rdi
movq %r15, %rsi
xorl %eax, %eax
callq 0x8f20
movq %r14, %rdi
xorl %esi, %esi
callq 0x8190
testl %eax, %eax
je 0x173a0
movq %r13, (%rbx)
movl $0x0, 0x8(%rbx)
jmp 0x173c9
movq %r14, %rdi
xorl %esi, %esi
movl $0x100, %edx            # imm = 0x100
xorl %eax, %eax
callq 0x8670
movl %eax, %ebp
movl $0xc, %edx
movl %eax, %edi
movq %rbx, %rsi
callq 0x8b20
movl %ebp, %edi
callq 0x8310
addq $0xc, %rbx
incq %r12
jne 0x17374
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]jftekwar/src/tekmsc.c
// Function: showmenu
void
showmenu(void)
{
    if (xdim < 640) {
        rotatesprite(160<<16,100<<16, 65536, 0, MENUSTATION, 0, 0, 2+8, 0, 0, xdim-1, ydim-1);
        rotatesprite(160<<16,100<<16, 65536, 0, MENUGLASS, 0, 0, 1+2+8, 0, 0, xdim-1, ydim-1);
    } else {
        rotatesprite(160<<16,50<<16, divscale15(200, tilesizy[MENUPANEL4801]), 0, MENUPANEL4801, 0, 0, 2+8, 0, 0, xdim-1, ydim-1);
        rotatesprite(160<<16,150<<16, divscale15(200, tilesizy[MENUPANEL4802]), 0, MENUPANEL4802, 0, 0, 2+8, 0, 0, xdim-1, ydim-1);
    }
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
leaq 0x59e7a3(%rip), %rbx    # 0x5b5e4c
movl (%rbx), %r10d
cmpl $0x27f, %r10d           # imm = 0x27F
jg 0x17727
decl %r10d
leaq 0x59e791(%rip), %r15    # 0x5b5e50
movl (%r15), %eax
decl %eax
xorl %r14d, %r14d
movl $0xa00000, %edi         # imm = 0xA00000
movl $0x640000, %esi         # imm = 0x640000
movl $0x10000, %edx          # imm = 0x10000
xorl %ecx, %ecx
movl $0x145, %r8d            # imm = 0x145
xorl %r9d, %r9d
pushq %rax
pushq %r10
pushq %r14
pushq %r14
pushq $0xa
pushq %r14
callq 0x4bca3
addq $0x30, %rsp
movl (%rbx), %eax
decl %eax
movl (%r15), %r10d
decl %r10d
movl $0xa00000, %edi         # imm = 0xA00000
movl $0x640000, %esi         # imm = 0x640000
movl $0x10000, %edx          # imm = 0x10000
xorl %ecx, %ecx
movl $0x146, %r8d            # imm = 0x146
xorl %r9d, %r9d
pushq %r10
pushq %rax
pushq %r14
pushq %r14
pushq $0xb
jmp 0x177c8
leaq 0x597f12(%rip), %r12    # 0x5af640
movswq 0xbf2(%r12), %rcx
xorl %r14d, %r14d
movl $0x640000, %eax         # imm = 0x640000
xorl %edx, %edx
idivq %rcx
decl %r10d
leaq 0x59e702(%rip), %r13    # 0x5b5e50
movl (%r13), %r11d
decl %r11d
movl $0xa, %r15d
movl $0xa00000, %edi         # imm = 0xA00000
movl $0x320000, %esi         # imm = 0x320000
movl %eax, %edx
xorl %ecx, %ecx
movl $0x5f9, %r8d            # imm = 0x5F9
xorl %r9d, %r9d
pushq %r11
pushq %r10
pushq %r14
pushq %r14
pushq %r15
pushq %r14
callq 0x4bca3
addq $0x30, %rsp
movswq 0xbf4(%r12), %rcx
movl $0x640000, %eax         # imm = 0x640000
xorl %edx, %edx
idivq %rcx
movl (%rbx), %r10d
decl %r10d
movl (%r13), %r11d
decl %r11d
movl $0xa00000, %edi         # imm = 0xA00000
movl $0x960000, %esi         # imm = 0x960000
movl %eax, %edx
xorl %ecx, %ecx
movl $0x5fa, %r8d            # imm = 0x5FA
xorl %r9d, %r9d
pushq %r11
pushq %r10
pushq %r14
pushq %r14
pushq %r15
pushq %r14
callq 0x4bca3
addq $0x30, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/jonof[P]jftekwar/src/tekmsc.c
// Function: showhelpscreen
void
showhelpscreen(void)
{
    if (xdim < 640) {
        rotatesprite(160<<16,160<<16, 65536, 0, HELPSCREENPIC, 0, 0, 2+8, 0, 0, xdim-1, ydim-1);
    } else {
        rotatesprite(160<<16,50<<16, divscale15(200, tilesizy[HELPSCREEN4801]), 0, HELPSCREEN4801, 0, 0, 2+8, 0, 0, xdim-1, ydim-1);
        rotatesprite(160<<16,150<<16, divscale15(200, tilesizy[HELPSCREEN4802]), 0, HELPSCREEN4802, 0, 0, 2+8, 0, 0, xdim-1, ydim-1);
    }
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
leaq 0x59e65f(%rip), %r15    # 0x5b5e4c
movl (%r15), %r10d
cmpl $0x27f, %r10d           # imm = 0x27F
jg 0x17834
decl %r10d
leaq 0x59e64d(%rip), %rax    # 0x5b5e50
movl (%rax), %eax
decl %eax
xorl %r11d, %r11d
movl $0xa00000, %edi         # imm = 0xA00000
movl $0xa00000, %esi         # imm = 0xA00000
movl $0x10000, %edx          # imm = 0x10000
xorl %ecx, %ecx
movl $0x3d5, %r8d            # imm = 0x3D5
xorl %r9d, %r9d
pushq %rax
pushq %r10
pushq %r11
pushq %r11
pushq $0xa
pushq %r11
jmp 0x178d0
leaq 0x597e05(%rip), %r12    # 0x5af640
movswq 0x7ac(%r12), %rcx
xorl %ebx, %ebx
movl $0x640000, %eax         # imm = 0x640000
xorl %edx, %edx
idivq %rcx
decl %r10d
leaq 0x59e5f6(%rip), %r13    # 0x5b5e50
movl (%r13), %r11d
decl %r11d
movl $0xa, %r14d
movl $0xa00000, %edi         # imm = 0xA00000
movl $0x320000, %esi         # imm = 0x320000
movl %eax, %edx
xorl %ecx, %ecx
movl $0x3d6, %r8d            # imm = 0x3D6
xorl %r9d, %r9d
pushq %r11
pushq %r10
pushq %rbx
pushq %rbx
pushq %r14
pushq %rbx
callq 0x4bca3
addq $0x30, %rsp
movswq 0x7ae(%r12), %rcx
movl $0x640000, %eax         # imm = 0x640000
xorl %edx, %edx
idivq %rcx
movl (%r15), %r10d
decl %r10d
movl (%r13), %r11d
decl %r11d
movl $0xa00000, %edi         # imm = 0xA00000
movl $0x960000, %esi         # imm = 0x960000
movl %eax, %edx
xorl %ecx, %ecx
movl $0x3d7, %r8d            # imm = 0x3D7
xorl %r9d, %r9d
pushq %r11
pushq %r10
pushq %rbx
pushq %rbx
pushq %r14
pushq %rbx
callq 0x4bca3
addq $0x30, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/jonof[P]jftekwar/src/tekmsc.c
// Function: usage
void
usage()
{
     printf("\ntekwar [option1] [option2] .... [optionN]\n");
     printf("options:    practice\n");
     printf("            nogore\n");
     printf("            nobriefs\n");
     printf("            netname [NAME]\n");
     printf("            noenemies\n");
}

// Assembly:
pushq %rax
leaq 0x74c96(%rip), %rdi     # 0x8cce5
callq 0x8ed0
leaq 0x74cb5(%rip), %rdi     # 0x8cd10
callq 0x8ed0
leaq 0x74cbe(%rip), %rdi     # 0x8cd25
callq 0x8ed0
leaq 0x74cc5(%rip), %rdi     # 0x8cd38
callq 0x8ed0
leaq 0x74cce(%rip), %rdi     # 0x8cd4d
callq 0x8ed0
leaq 0x74cdd(%rip), %rdi     # 0x8cd68
popq %rax
jmp 0x8ed0
// File: /workspace/github_c_makefile_star2_O1/jonof[P]jftekwar/src/tekmsc.c
// Function: initmoreoptions
void
initmoreoptions()
{
     difficulty=moreoptions[8];
     soundv=moreoptions[9];
     musicv=moreoptions[10];
     mousesensitivity=moreoptions[11];
     headbobon=moreoptions[12];

     screensize=gamestuff[2];
     brightness=gamestuff[3];
     biasthreshhold=gamestuff[4];

     if( option[4] != 0 ) {
          difficulty=2;
     }
}

// Assembly:
leaq 0xb65a1(%rip), %rax     # 0xcea00
movl 0x20(%rax), %ecx
movl 0x24(%rax), %edx
movl %ecx, 0x115b99(%rip)    # 0x12e004
movl %edx, 0xb718b(%rip)     # 0xcf5fc
movl 0x28(%rax), %ecx
movl %ecx, 0xb717e(%rip)     # 0xcf5f8
movl 0x2c(%rax), %ecx
movl %ecx, 0x115b79(%rip)    # 0x12dffc
movl 0x30(%rax), %eax
leaq 0xb7453(%rip), %rcx     # 0xcf8e0
movl %eax, (%rcx)
leaq 0xb660a(%rip), %rax     # 0xceaa0
leaq 0xca705(%rip), %rcx     # 0xe2ba2
movzwl 0x8(%rax), %edx
movzwl 0xc(%rax), %esi
movw %dx, (%rcx)
leaq 0xc8fb3(%rip), %rcx     # 0xe1462
movw %si, (%rcx)
movzwl 0x10(%rax), %eax
leaq 0xb64a5(%rip), %rcx     # 0xce962
movw %ax, (%rcx)
leaq 0xb64b1(%rip), %rax     # 0xce978
cmpb $0x0, 0x4(%rax)
je 0x184d7
movl $0x2, 0x115b2d(%rip)    # 0x12e004
retq
// File: /workspace/github_c_makefile_star2_O1/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:
movl 0x115b26(%rip), %eax    # 0x12e004
leaq 0xb651b(%rip), %rcx     # 0xcea00
movl %eax, 0x20(%rcx)
movl 0xb710e(%rip), %eax     # 0xcf5fc
movl %eax, 0x24(%rcx)
movl 0xb7101(%rip), %eax     # 0xcf5f8
movl %eax, 0x28(%rcx)
movl 0x115afc(%rip), %eax    # 0x12dffc
movl %eax, 0x2c(%rcx)
leaq 0xb73d6(%rip), %rax     # 0xcf8e0
movl (%rax), %eax
movl %eax, 0x30(%rcx)
leaq 0xb658a(%rip), %rax     # 0xceaa0
movq $-0x1, (%rax)
leaq 0xca67e(%rip), %rcx     # 0xe2ba2
movswl (%rcx), %ecx
movl %ecx, 0x8(%rax)
leaq 0xc8f31(%rip), %rcx     # 0xe1462
movswl (%rcx), %ecx
movl %ecx, 0xc(%rax)
leaq 0xb6424(%rip), %rcx     # 0xce962
movswl (%rcx), %ecx
movl %ecx, 0x10(%rax)
retq
// File: /workspace/github_c_makefile_star2_O1/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 %rbx
movl %edi, %ebx
leaq 0x114c7c(%rip), %rsi    # 0x12dd72
movl $0xe, %edx
callq 0x8f10
leaq 0x114e67(%rip), %rsi    # 0x12df6e
movl $0xe, %edx
movl %ebx, %edi
callq 0x8f10
leaq 0x114eea(%rip), %rsi    # 0x12e004
movl $0x4, %edx
movl %ebx, %edi
callq 0x8f10
leaq 0x1133df(%rip), %rsi    # 0x12c50c
movl $0x4, %edx
movl %ebx, %edi
callq 0x8f10
leaq 0x1133d0(%rip), %rsi    # 0x12c510
movl $0x4, %edx
movl %ebx, %edi
callq 0x8f10
leaq 0x1133c1(%rip), %rsi    # 0x12c514
movl $0x1, %edx
movl %ebx, %edi
callq 0x8f10
leaq 0x1133af(%rip), %rsi    # 0x12c515
movl $0x1, %edx
movl %ebx, %edi
callq 0x8f10
leaq 0x11339f(%rip), %rsi    # 0x12c518
movl $0x4, %edx
movl %ebx, %edi
callq 0x8f10
leaq 0x114e84(%rip), %rsi    # 0x12e010
movl $0x1, %edx
movl %ebx, %edi
callq 0x8f10
leaq 0x114e6a(%rip), %rsi    # 0x12e009
movl $0x1, %edx
movl %ebx, %edi
callq 0x8f10
leaq 0x113372(%rip), %rsi    # 0x12c524
movl $0x4, %edx
movl %ebx, %edi
callq 0x8f10
leaq 0x113363(%rip), %rsi    # 0x12c528
movl $0x4, %edx
movl %ebx, %edi
popq %rbx
jmp 0x8f10
// File: /workspace/github_c_makefile_star2_O1/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 %rbx
movl %edi, %ebx
xorl %eax, %eax
callq 0x1cc2d
leaq 0x114b8f(%rip), %rsi    # 0x12dd72
movl $0xe, %edx
movl %ebx, %edi
callq 0x8b20
leaq 0x114d78(%rip), %rsi    # 0x12df6e
movl $0xe, %edx
movl %ebx, %edi
callq 0x8b20
leaq 0x114dfb(%rip), %rsi    # 0x12e004
movl $0x4, %edx
movl %ebx, %edi
callq 0x8b20
leaq 0x1132f0(%rip), %rsi    # 0x12c50c
movl $0x4, %edx
movl %ebx, %edi
callq 0x8b20
leaq 0x1132e1(%rip), %rsi    # 0x12c510
movl $0x4, %edx
movl %ebx, %edi
callq 0x8b20
leaq 0x1132d2(%rip), %rsi    # 0x12c514
movl $0x1, %edx
movl %ebx, %edi
callq 0x8b20
leaq 0x1132c0(%rip), %rsi    # 0x12c515
movl $0x1, %edx
movl %ebx, %edi
callq 0x8b20
leaq 0x1132b0(%rip), %rsi    # 0x12c518
movl $0x4, %edx
movl %ebx, %edi
callq 0x8b20
leaq 0x114d95(%rip), %rsi    # 0x12e010
movl $0x1, %edx
movl %ebx, %edi
callq 0x8b20
leaq 0x114d7b(%rip), %rsi    # 0x12e009
movl $0x1, %edx
movl %ebx, %edi
callq 0x8b20
leaq 0x113283(%rip), %rsi    # 0x12c524
movl $0x4, %edx
movl %ebx, %edi
callq 0x8b20
leaq 0x113274(%rip), %rsi    # 0x12c528
movl $0x4, %edx
movl %ebx, %edi
callq 0x8b20
cmpb $0x1, 0x114d49(%rip)    # 0x12e010
jne 0x192f4
callq 0x8e70
cltq
imulq $-0x6db6db6d, %rax, %rdi # imm = 0x92492493
shrq $0x20, %rdi
addl %eax, %edi
movl %edi, %ecx
shrl $0x1f, %ecx
sarl $0x2, %edi
addl %ecx, %edi
leal (,%rdi,8), %ecx
subl %ecx, %edi
addl %eax, %edi
jmp 0x192fa
movl 0x113216(%rip), %edi    # 0x12c510
popq %rbx
jmp 0x1ccc1
// File: /workspace/github_c_makefile_star2_O1/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 %rbx
callq 0x145ca
xorl %ebx, %ebx
xorl %edi, %edi
callq 0x4c5d5
leaq 0xc94fa(%rip), %rdi     # 0xe2810
movb %bl, 0x8(%rdi)
movabsq $0x50414d2e3154454e, %rax # imm = 0x50414D2E3154454E
movq %rax, (%rdi)
callq 0x19a20
xorl %eax, %eax
callq 0xa1e5
xorl %edi, %edi
callq 0x4c5d5
movb %bl, 0x1131b9(%rip)     # 0x12c4f8
leaq 0x312dba(%rip), %rdi    # 0x32c100
movl $0x100, %edx            # imm = 0x100
xorl %esi, %esi
popq %rbx
jmp 0x8440
// File: /workspace/github_c_makefile_star2_O1/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 %r14
pushq %rbx
pushq %rax
xorl %edi, %edi
callq 0x4c5d5
leaq 0x7388b(%rip), %rdi     # 0x8cbf0
callq 0x1bc30
movl $0x51, %edi
callq 0x1bd6e
movb $0x0, 0x11317d(%rip)    # 0x12c4f8
leaq 0x312d7e(%rip), %rbx    # 0x32c100
movl $0x100, %edx            # imm = 0x100
movq %rbx, %rdi
xorl %esi, %esi
callq 0x8440
leaq 0x312b78(%rip), %r14    # 0x32bf10
cmpb $0x0, 0x1(%rbx)
jne 0x193f6
cmpb $0x0, 0x1c(%rbx)
jne 0x193f6
cmpb $0x0, 0x39(%rbx)
jne 0x193f6
cmpb $0x0, 0x26(%rbx)
jne 0x193f6
cmpb $0x0, 0xcb(%rbx)
jne 0x193f6
cmpb $0x0, 0xcd(%rbx)
jne 0x193f6
cmpb $0x0, 0xc8(%rbx)
jne 0x193f6
cmpb $0x0, 0x1f(%rbx)
jne 0x193f6
cmpb $0x0, 0x23(%rbx)
jne 0x193f6
cmpb $0x0, 0xd0(%rbx)
jne 0x193f6
xorl %eax, %eax
callq 0x1be00
callq 0x803d6
testl %eax, %eax
je 0x19398
cmpb $0x0, (%r14)
je 0x19398
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x1be7a
// File: /workspace/github_c_makefile_star2_O1/jonof[P]jftekwar/src/tekmsc.c
// Function: missionaccomplished
void
missionaccomplished(int  sn)
{
     int       ext;

     if( option[4] != 0 ) {
          return;
     }

     ext=sprptr[sn]->extra;
     if( !validext(ext) ) {
          return;
     }

     if( sprXTptr[ext]->class == CLASS_CIVILLIAN ) {
          civillianskilled++;
     }
     if( sprXTptr[ext]->class != CLASS_TEKLORD ) {
          return;
     }

     switch( sprXTptr[ext]->deathpic ) {
     case WINGDEATHPIC:
          symbols[0]=1;
          mission_accomplished=1;
          gameover=1;
          break;
     case DIDEATHPIC:
          symbols[1]=1;
          mission_accomplished=1;
          gameover=1;
          break;
     case SFRODEATHPIC:
          symbols[2]=1;
          mission_accomplished=1;
          gameover=1;
          break;
     case ANTDEATHPIC:
          symbols[3]=1;
          mission_accomplished=1;
          gameover=1;
          break;
     case SGOLDEATHPIC:
          symbols[4]=1;
          mission_accomplished=1;
          gameover=1;
          break;
     case SUNGDEATHPIC:
          symbols[5]=1;
          mission_accomplished=1;
          gameover=1;
          break;
     case REDHDEATHPIC:
          symbols[6]=1;
          mission_accomplished=1;
          gameover=1;
          break;
     case SSALDEATHPIC:
          killedsonny=1;
          mission_accomplished=1;
          gameover=1;
          break;
     }
}

// Assembly:
pushq %rbx
leaq 0xb51df(%rip), %rax     # 0xce978
cmpb $0x0, 0x4(%rax)
je 0x197a1
popq %rbx
retq
movslq %edi, %rax
leaq 0x114a65(%rip), %rcx    # 0x12e210
movq (%rcx,%rax,8), %rax
movswl 0x2a(%rax), %ebx
movl %ebx, %edi
callq 0x1e9f9
testl %eax, %eax
je 0x1979f
movslq %ebx, %rax
leaq 0x1bca48(%rip), %rcx    # 0x1d6210
movq (%rcx,%rax,8), %rax
cmpb $0x2, (%rax)
jne 0x197d7
incl 0x112d41(%rip)          # 0x12c518
cmpb $0xb, (%rax)
jne 0x1979f
movzwl 0x14(%rax), %eax
cmpl $0xa65, %eax            # imm = 0xA65
jg 0x1980a
cmpl $0x874, %eax            # imm = 0x874
jg 0x1982a
cmpl $0x6ff, %eax            # imm = 0x6FF
je 0x19864
cmpl $0x78d, %eax            # imm = 0x78D
jne 0x1979f
movw $0x1, 0x11456f(%rip)    # 0x12dd74
jmp 0x1988f
cmpl $0xb5d, %eax            # imm = 0xB5D
jg 0x19847
cmpl $0xa66, %eax            # imm = 0xA66
je 0x1986f
cmpl $0xb22, %eax            # imm = 0xB22
jne 0x1979f
movw $0x1, 0x11454e(%rip)    # 0x12dd76
jmp 0x1988f
cmpl $0x875, %eax            # imm = 0x875
je 0x1987a
cmpl $0x9f6, %eax            # imm = 0x9F6
jne 0x1979f
movw $0x1, 0x11452d(%rip)    # 0x12dd72
jmp 0x1988f
cmpl $0xb5e, %eax            # imm = 0xB5E
je 0x19885
cmpl $0xba2, %eax            # imm = 0xBA2
jne 0x1979f
movw $0x1, 0x114518(%rip)    # 0x12dd7a
jmp 0x1988f
movw $0x1, 0x11450b(%rip)    # 0x12dd78
jmp 0x1988f
movw $0x1, 0x114506(%rip)    # 0x12dd7e
jmp 0x1988f
movw $0x1, 0x1144f9(%rip)    # 0x12dd7c
jmp 0x1988f
movl $0x1, 0x112c99(%rip)    # 0x12c528
movb $0x1, %al
movb %al, 0x112c7e(%rip)     # 0x12c515
movb %al, 0x112c5c(%rip)     # 0x12c4f9
jmp 0x1979f
// File: /workspace/github_c_makefile_star2_O1/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:
movslq %edi, %rax
leaq 0xc8e74(%rip), %rcx     # 0xe2720
movswq (%rcx,%rax,2), %rax
leaq (%rax,%rax,4), %rax
leaq 0x3d8004(%rip), %rcx    # 0x3f18c0
movswq 0x24(%rcx,%rax,8), %rax
leal -0x1(%rax), %edx
movl $0xe10, %ecx            # imm = 0xE10
cmpw $0x5, %dx
ja 0x198dd
movzwl %dx, %ecx
leaq 0x72eca(%rip), %rdx     # 0x8c7a4
movl (%rdx,%rcx,4), %ecx
leaq 0x11448e(%rip), %rdx    # 0x12dd72
cmpw $0x0, (%rdx,%rax,2)
je 0x19924
xorl %edx, %edx
leaq 0x11491c(%rip), %rsi    # 0x12e210
movq (%rsi,%rdx,8), %rdi
movswl 0xe(%rdi), %r8d
cmpl %r8d, %ecx
je 0x19910
incq %rdx
cmpq $0x4000, %rdx           # imm = 0x4000
jne 0x198f4
jmp 0x19924
orl $0x1, %ecx
movw %cx, 0xe(%rdi)
leaq 0x114650(%rip), %rcx    # 0x12df6e
movw $0x1, (%rcx,%rax,2)
cmpw $0x0, 0x114642(%rip)    # 0x12df6e
je 0x1997b
cmpw $0x0, 0x11463a(%rip)    # 0x12df70
je 0x1997b
cmpw $0x0, 0x114632(%rip)    # 0x12df72
je 0x1997b
cmpw $0x0, 0x11462a(%rip)    # 0x12df74
je 0x1997b
cmpw $0x0, 0x114622(%rip)    # 0x12df76
je 0x1997b
cmpw $0x0, 0x11461a(%rip)    # 0x12df78
je 0x1997b
cmpw $0x0, 0x114612(%rip)    # 0x12df7a
je 0x1997b
movl $0x1, 0x112bb0(%rip)    # 0x12c524
movb $0x1, 0x112b7e(%rip)    # 0x12c4f9
retq
// File: /workspace/github_c_makefile_star2_O1/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 %r15
pushq %r14
pushq %rbx
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
leaq 0x71e70(%rip), %rdi     # 0x8cdeb
callq 0x2be4a
andl $0xf, %eax
xorl %ecx, %ecx
cmpl 0x113175(%rip), %eax    # 0x12e100
cmovll %eax, %ecx
shll $0x4, %ecx
leaq 0x113178(%rip), %rax    # 0x12e110
movl (%rcx,%rax), %edx
movl %edx, (%r15)
movl 0x4(%rcx,%rax), %edx
movl %edx, (%r14)
movzwl 0xc(%rcx,%rax), %eax
movw %ax, (%rbx)
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/jonof[P]jftekwar/src/tekprep.c
// Function: tekrestoreplayer
void
tekrestoreplayer(short snum)
{
     setsprite(playersprite[snum],posx[snum],posy[snum],posz[snum]+(KENSPLAYERHEIGHT<<8));
     sprite[playersprite[snum]].ang = ang[snum];
     sprite[playersprite[snum]].xrepeat = 24;
     sprite[playersprite[snum]].yrepeat = 24;
     horiz[snum] = 100;
     health[snum]=MAXHEALTH;
     fireseq[snum]=0;
     restockammo(snum);
     stun[snum]=MAXSTUN;
     fallz[snum]=0;
     drawweap[snum]=0;
     invredcards[snum]=0;
     invbluecards[snum]=0;
     invaccutrak[snum]=0;
     dieframe[snum]=0;
     if( option[4] != 0 ) {
          weapons[snum]=0;
          weapons[snum]=flags32[GUN2FLAG]|flags32[GUN3FLAG];
     }
     else {
          weapons[snum]=0;
          weapons[snum]=flags32[GUN1FLAG]|flags32[GUN2FLAG]|flags32[GUN3FLAG];
     }
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movslq %edi, %rbx
leaq 0xc778f(%rip), %r14     # 0xe2750
movswl (%r14,%rbx,2), %edi
leaq 0xc6503(%rip), %rax     # 0xe14d0
movl (%rax,%rbx,4), %esi
leaq 0xc6539(%rip), %rax     # 0xe1510
movl (%rax,%rbx,4), %edx
leaq 0xc656f(%rip), %rax     # 0xe1550
movl $0x2200, %ecx           # imm = 0x2200
addl (%rax,%rbx,4), %ecx
callq 0x46b48
leaq 0xc64bb(%rip), %rax     # 0xe14b0
movzwl (%rax,%rbx,2), %eax
movswq (%r14,%rbx,2), %rcx
imulq $0x2c, %rcx, %rcx
leaq 0x40fb07(%rip), %rdx    # 0x42ab10
movw %ax, 0x1c(%rdx,%rcx)
movw $0x1818, 0x14(%rdx,%rcx) # imm = 0x1818
leaq 0xc7844(%rip), %rax     # 0xe2860
movl $0x64, (%rax,%rbx,4)
leaq 0xc6566(%rip), %rax     # 0xe1590
movl $0x3e8, %ebp            # imm = 0x3E8
movl %ebp, (%rax,%rbx,4)
leaq 0x1112a7(%rip), %rax    # 0x12c2e0
xorl %r14d, %r14d
movl %r14d, (%rax,%rbx,4)
movl %ebx, %edi
callq 0xf23a
leaq 0xc6342(%rip), %rax     # 0xe1390
movl %ebp, (%rax,%rbx,4)
leaq 0xc63b8(%rip), %rax     # 0xe1410
movl %r14d, (%rax,%rbx,4)
leaq 0x1113cd(%rip), %rax    # 0x12c430
movl %r14d, (%rax,%rbx,4)
leaq 0x112d12(%rip), %rax    # 0x12dd80
movl %r14d, (%rax,%rbx,4)
leaq 0x112d47(%rip), %rax    # 0x12ddc0
movl %r14d, (%rax,%rbx,4)
leaq 0x112d7c(%rip), %rax    # 0x12de00
movl %r14d, (%rax,%rbx,4)
leaq 0x1112e1(%rip), %rax    # 0x12c370
movw $0x0, (%rax,%rbx,2)
leaq 0xb38dc(%rip), %rax     # 0xce978
cmpb $0x0, 0x4(%rax)
leaq 0x1113d9(%rip), %rax    # 0x12c480
movl %r14d, (%rax,%rbx,4)
leaq 0xb483e(%rip), %rdx     # 0xcf8f0
je 0x1b0bc
movl 0xc(%rdx), %ecx
orl 0x8(%rdx), %ecx
jmp 0x1b0c5
movl 0x8(%rdx), %ecx
orl 0x4(%rdx), %ecx
orl 0xc(%rdx), %ecx
movl %ecx, (%rax,%rbx,4)
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/jonof[P]jftekwar/src/tekprep.c
// Function: initplayersprite
void
initplayersprite(short snum)
{
     int      i;

     if (playersprite[snum] >= 0) return;

     i=jsinsertsprite(cursectnum[snum], 8);
     if( i == -1 ) {
          crashgame("initplayersprite: jsinsertsprite on player %d failed", snum);
     }
     playersprite[snum]=i;
     sprite[i].x=posx[snum];
     sprite[i].y=posy[snum];
     sprite[i].z=posz[snum]+(KENSPLAYERHEIGHT<<8);
     sprite[i].cstat = 0x101;
     sprite[i].shade=0;
     if( option[4] == 0 ) {
          sprite[i].pal=0;
     }
     else {
          sprite[i].pal=snum+16;
     }
     sprite[i].clipdist=32;
     sprite[i].xrepeat=24;
     sprite[i].yrepeat=24;
     sprite[i].xoffset=0;
     sprite[i].yoffset=0;
     sprite[i].picnum=DOOMGUY;
     sprite[i].ang=ang[snum];
     sprite[i].xvel=0;
     sprite[i].yvel=0;
     sprite[i].zvel=0;
     sprite[i].owner=snum+4096;
     sprite[i].sectnum=cursectnum[snum];
     sprite[i].statnum=8;
     sprite[i].lotag=0;
     sprite[i].hitag=0;
     // important to set extra = -1
     sprite[i].extra=-1;

     tekrestoreplayer(snum);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movslq %edi, %r14
leaq 0xc7671(%rip), %r12     # 0xe2750
cmpw $0x0, (%r12,%r14,2)
js 0x1b0f0
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
leaq 0xc7629(%rip), %r15     # 0xe2720
movswl (%r15,%r14,2), %edi
movl $0x8, %esi
callq 0x1e94c
movl %eax, %ebp
movswl %r14w, %ebx
cmpw $-0x1, %ax
jne 0x1b122
leaq 0x71ce4(%rip), %rdi     # 0x8cdfd
movl %ebx, %esi
xorl %eax, %eax
callq 0x2d800
movw %bp, (%r12,%r14,2)
leaq 0xc63a2(%rip), %rax     # 0xe14d0
movl (%rax,%r14,4), %edx
movswq %bp, %rax
imulq $0x2c, %rax, %rax
leaq 0x40f9cf(%rip), %rcx    # 0x42ab10
movl %edx, (%rcx,%rax)
leaq 0xc63c5(%rip), %rdx     # 0xe1510
movl (%rdx,%r14,4), %edx
movl %edx, 0x4(%rcx,%rax)
leaq 0xc63f6(%rip), %rdx     # 0xe1550
movl $0x2200, %esi           # imm = 0x2200
addl (%rdx,%r14,4), %esi
movl %esi, 0x8(%rcx,%rax)
movw $0x101, 0xc(%rcx,%rax)  # imm = 0x101
movb $0x0, 0x10(%rcx,%rax)
leaq 0xb37fe(%rip), %rdx     # 0xce978
leal 0x10(%rbx), %esi
xorl %edi, %edi
cmpb $0x0, 0x4(%rdx)
movzbl %sil, %edx
cmovel %edi, %edx
movb %dl, 0x11(%rcx,%rax)
movb $0x20, 0x12(%rcx,%rax)
movl $0x1818, 0x14(%rcx,%rax) # imm = 0x1818
movw $0x3e7, 0xe(%rcx,%rax)  # imm = 0x3E7
leaq 0xc6307(%rip), %rdx     # 0xe14b0
movzwl (%rdx,%r14,2), %edx
movw %dx, 0x1c(%rcx,%rax)
movl %edi, 0x20(%rcx,%rax)
movw $0x0, 0x24(%rcx,%rax)
leal 0x1000(%rbx), %edx
movw %dx, 0x1e(%rcx,%rax)
movzwl (%r15,%r14,2), %edx
movw %dx, 0x18(%rcx,%rax)
movw $0x8, 0x1a(%rcx,%rax)
movl %edi, 0x26(%rcx,%rax)
movw $0xffff, 0x2a(%rcx,%rax) # imm = 0xFFFF
movl %ebx, %edi
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x1afb3
// File: /workspace/github_c_makefile_star2_O1/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:
leaq 0x133015(%rip), %rax    # 0x14e210
leaq 0x40f90e(%rip), %rcx    # 0x42ab10
xorl %edx, %edx
leaq 0x113005(%rip), %rsi    # 0x12e210
leaq 0x1baffe(%rip), %rdi    # 0x1d6210
movq %rcx, (%rdx,%rsi)
movq %rax, (%rdx,%rdi)
addq $0x8, %rdx
addq $0x22, %rax
addq $0x2c, %rcx
cmpq $0x20000, %rdx          # imm = 0x20000
jne 0x1b212
leaq 0x3d668a(%rip), %rax    # 0x3f18c0
xorl %ecx, %ecx
leaq 0x1dafd1(%rip), %rdx    # 0x1f6210
movq %rax, (%rcx,%rdx)
addq $0x8, %rcx
addq $0x28, %rax
cmpq $0x8000, %rcx           # imm = 0x8000
jne 0x1b23f
leaq 0x34b655(%rip), %rax    # 0x3668b0
xorl %ecx, %ecx
leaq 0x1e2fac(%rip), %rdx    # 0x1fe210
movq %rax, (%rcx,%rdx)
addq $0x8, %rcx
addq $0x20, %rax
cmpq $0x20000, %rcx          # imm = 0x20000
jne 0x1b264
xorl %eax, %eax
retq
// File: /workspace/github_c_makefile_star2_O1/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
pushq %r15
pushq %r14
pushq %rbx
subq $0x18, %rsp
movq %rdi, %rbx
xorl %esi, %esi
callq 0x32dbc
testl %eax, %eax
js 0x1bcff
movl %eax, %ebp
movl %eax, %edi
callq 0x3333e
movl %eax, %r15d
movslq %eax, %r14
movq %r14, %rdi
callq 0x8d50
movq %rax, 0x20a5d6(%rip)    # 0x226240
testq %rax, %rax
je 0x1bd1a
movl %ebp, %edi
movq %rax, %rsi
movl %r14d, %edx
callq 0x3302e
movl %ebp, %edi
callq 0x334dd
movq 0x20a5b2(%rip), %rdi    # 0x226240
movq %r14, %rsi
callq 0x2dda8
movq %rax, 0x20a5ab(%rip)    # 0x226248
testq %rax, %rax
je 0x1bd3f
movq %rax, %rdi
movl $0x80, %esi
callq 0x2f2be
movq 0x20a58e(%rip), %rdi    # 0x226248
leaq 0x10(%rsp), %rbx
leaq 0x8(%rsp), %r14
movq %rbx, %rsi
movq %r14, %rdx
xorl %ecx, %ecx
callq 0x2f17c
movzwl (%r14), %eax
leaq 0x5a21a4(%rip), %rcx    # 0x5bde80
movw %ax, 0x47fa(%rcx)
movzwl (%rbx), %eax
leaq 0x593953(%rip), %rcx    # 0x5af640
movw %ax, 0x47fa(%rcx)
addq $0x18, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
leaq 0x71281(%rip), %rdi     # 0x8cf87
movq %rbx, %rsi
xorl %eax, %eax
addq $0x18, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x7f197
movl %ebp, %edi
callq 0x334dd
leaq 0x71279(%rip), %rdi     # 0x8cfa1
movq %rbx, %rsi
movl %r15d, %edx
xorl %eax, %eax
addq $0x18, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x7f197
movq 0x20a4fa(%rip), %rdi    # 0x226240
callq 0x8270
movq $0x0, 0x20a4ea(%rip) # 0x226240
leaq 0x7114c(%rip), %rdi     # 0x8cea9
xorl %eax, %eax
addq $0x18, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x7f197
// File: /workspace/github_c_makefile_star2_O1/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 %rbx
subq $0x300, %rsp            # imm = 0x300
movl %edi, %ebx
movq 0x20a4c9(%rip), %rdi    # 0x226248
testq %rdi, %rdi
je 0x1bdf7
callq 0x2f3c2
movq 0x20a4b8(%rip), %rdi    # 0x226248
decl %ebx
movslq %ebx, %rsi
callq 0x3005e
movq 0x20a4a7(%rip), %rdi    # 0x226248
callq 0x2f340
movl $0x2ff, %ecx            # imm = 0x2FF
movb (%rax,%rcx), %dl
shrb $0x2, %dl
movb %dl, (%rsp,%rcx)
addq $-0x1, %rcx
jb 0x1bdab
movq 0x20a487(%rip), %rdi    # 0x226248
callq 0x2f35c
leaq 0x52b373(%rip), %rcx    # 0x547140
movq %rax, 0x11fe8(%rcx)
movl $0x23fd, %edi           # imm = 0x23FD
xorl %esi, %esi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x4cb39
movq %rsp, %rsi
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
movl $0x6, %edx
callq 0x44ae3
addq $0x300, %rsp            # imm = 0x300
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/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:
cmpq $0x0, 0x20a440(%rip)    # 0x226248
je 0x1be79
pushq %rbx
xorl %ebx, %ebx
xorl %edi, %edi
callq 0x44d3d
leaq 0x5a2065(%rip), %rax    # 0x5bde80
movswq 0x47fa(%rax), %rcx
movl $0xc80000, %eax         # imm = 0xC80000
xorl %edx, %edx
idivq %rcx
leaq 0x59a018(%rip), %rcx    # 0x5b5e4c
movl (%rcx), %r10d
decl %r10d
leaq 0x59a00f(%rip), %rcx    # 0x5b5e50
movl (%rcx), %r11d
decl %r11d
movl $0xa00000, %edi         # imm = 0xA00000
movl $0x640000, %esi         # imm = 0x640000
movl %eax, %edx
movl $0x200, %ecx            # imm = 0x200
movl $0x23fd, %r8d           # imm = 0x23FD
xorl %r9d, %r9d
pushq %r11
pushq %r10
pushq %rbx
pushq %rbx
pushq $0x6
pushq %rbx
callq 0x4bca3
addq $0x30, %rsp
popq %rbx
jmp 0x44e75
retq
// File: /workspace/github_c_makefile_star2_O1/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 %rax
movq 0x20a3c6(%rip), %rdi    # 0x226248
testq %rdi, %rdi
je 0x1be8c
callq 0x2eeeb
movq 0x20a3ad(%rip), %rdi    # 0x226240
testq %rdi, %rdi
je 0x1be9d
callq 0x8270
leaq 0x52b29c(%rip), %rax    # 0x547140
xorl %ecx, %ecx
movq %rcx, 0x11fe8(%rax)
movq %rcx, 0x20a394(%rip)    # 0x226248
movq %rcx, 0x20a385(%rip)    # 0x226240
popq %rax
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O1/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:
cmpl $-0x1, %edi
je 0x1c151
movl %edi, %eax
leaq (%rax,%rax,2), %rax
leaq 0x20a15b(%rip), %rcx    # 0x226260
leaq (%rcx,%rax,8), %rax
movslq 0x4(%rax), %rcx
leaq (%rcx,%rcx,2), %rcx
leaq 0x20a2c8(%rip), %rdx    # 0x2263e0
movl (%rdx,%rcx,8), %esi
cmpl $0x2, %esi
movl $0x1, %r8d
cmovgel %esi, %r8d
decl %r8d
movl %r8d, (%rdx,%rcx,8)
jne 0x1c139
leaq (%rdx,%rcx,8), %rcx
movb $-0x39, 0x14(%rcx)
movq $-0x1, (%rax)
movl $0x0, 0x8(%rax)
testb $-0x80, 0x14(%rax)
jne 0x2cec8
retq
// File: /workspace/github_c_makefile_star2_O1/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 %r14
pushq %rbx
pushq %rax
cmpb $0x1, 0x20a0f7(%rip)    # 0x226254
jne 0x1c170
callq 0x87ca9
callq 0x87c46
movb $0x0, 0x20a0e4(%rip)    # 0x226254
cmpb $0x1, 0x20a0d9(%rip)    # 0x226250
jne 0x1c1a9
xorl %ebx, %ebx
leaq 0x20a0de(%rip), %r14    # 0x226260
movl (%rbx,%r14), %edi
cmpl $-0x1, %edi
je 0x1c190
callq 0x8438a
addq $0x18, %rbx
cmpq $0x180, %rbx            # imm = 0x180
jne 0x1c182
callq 0x84089
movb $0x0, 0x20a0a7(%rip)    # 0x226250
movl 0xb3621(%rip), %edi     # 0xcf7d0
testl %edi, %edi
js 0x1c1c2
callq 0x334dd
movl $0xffffffff, 0xb360e(%rip) # imm = 0xFFFFFFFF
movl 0xb360c(%rip), %edi     # 0xcf7d4
testl %edi, %edi
js 0x1c1db
callq 0x334dd
movl $0xffffffff, 0xb35f9(%rip) # imm = 0xFFFFFFFF
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/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:
cmpl $0xf, %edi
ja 0x1c4bf
testb $0x1, 0x209ded(%rip)    # 0x226250
je 0x1c4bf
movl %edi, %eax
leaq (%rax,%rax,2), %rax
leaq 0x209dee(%rip), %rcx    # 0x226260
movl (%rcx,%rax,8), %edi
cmpl $-0x1, %edi
je 0x1c4bf
pushq %rbx
leaq (%rcx,%rax,8), %rbx
callq 0x8438a
movslq 0x4(%rbx), %rax
leaq (%rax,%rax,2), %rax
leaq 0x209f4d(%rip), %rcx    # 0x2263e0
movl (%rcx,%rax,8), %edx
cmpl $0x2, %edx
movl $0x1, %esi
cmovgel %edx, %esi
decl %esi
movl %esi, (%rcx,%rax,8)
jne 0x1c4b0
leaq (%rcx,%rax,8), %rax
movb $-0x39, 0x14(%rax)
movq $-0x1, (%rbx)
movl $0x0, 0x8(%rbx)
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/jonof[P]jftekwar/src/teksnd.c
// Function: updatevehiclesnds
void
updatevehiclesnds(int i, int sndx, int sndy)
{
     int dx, dy, dist, pan;
     if( !fxstarted ) {
          return;
     }
     if( (i < 0) || (i > MAXSOUNDS) ) {
          return;
     }

     dsound[i].x=sndx;
     dsound[i].y=sndy;

     /*
     dist=labs(posx[screenpeek]-sndx)+labs(posy[screenpeek]-sndy);
     if( dist < 1000L ) {
          vol = 0x7fff;
     }
     else if( dist > 9000L ) {
          vol = 0x0000;
     }
     else {
          vol = 36000L-(dist<<2);
     }
     if( (vol < 0) || (vol > 0x7FFF) ) {
          vol=0x7fff;
     }
     pan=((getangle(posx[screenpeek]-dsoundptr[i]->x,posy[screenpeek]-dsoundptr[i]->y)+(2047-ang[screenpeek]))&2047) >> 6;
     if( (pan < 0) || (pan > 35) )
          pan=13;
     */

     dx = klabs(posx[screenpeek]-sndx);
     dy = klabs(posy[screenpeek]-sndy);
     dist = ksqrt(dx*dx+dy*dy) >> 6;

     pan = 2048 + ang[screenpeek] - getangle(posx[screenpeek]-sndx,posy[screenpeek]-sndy);
     pan = (pan & 2047) >> 6;

     if( dsound[i].handle != NULL_HANDLE )
          FX_Pan3D(dsound[i].handle,pan,dist);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
cmpl $0x10, %edi
ja 0x1c591
testb $0x1, 0x209d75(%rip)    # 0x226250
je 0x1c591
movl %edx, %ebx
movl %esi, %ebp
movl %edi, %eax
leaq (%rax,%rax,2), %r12
leaq 0x209d6e(%rip), %rax    # 0x226260
movl %esi, 0xc(%rax,%r12,8)
movl %edx, 0x10(%rax,%r12,8)
leaq 0xc4f5b(%rip), %r15     # 0xe145e
movswq (%r15), %rax
leaq 0xc4fc2(%rip), %rcx     # 0xe14d0
movl (%rcx,%rax,4), %ecx
subl %esi, %ecx
leaq 0xc4ff6(%rip), %r13     # 0xe1510
movl (%r13,%rax,4), %edi
subl %edx, %edi
imull %ecx, %ecx
imull %edi, %edi
addl %ecx, %edi
callq 0x46ae1
movl %eax, %r14d
movswq (%r15), %rax
leaq 0xc4f74(%rip), %rcx     # 0xe14b0
movzwl (%rcx,%rax,2), %r15d
leaq 0xc4f88(%rip), %rcx     # 0xe14d0
movl (%rcx,%rax,4), %edi
subl %ebp, %edi
movl (%r13,%rax,4), %esi
subl %ebx, %esi
callq 0x469df
leaq 0x209d00(%rip), %rcx    # 0x226260
movl (%rcx,%r12,8), %edi
cmpl $-0x1, %edi
je 0x1c591
subl %eax, %r15d
shrl $0x6, %r15d
andl $0x1f, %r15d
sarl $0x6, %r14d
movl %r15d, %esi
movl %r14d, %edx
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x84361
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq