LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O2/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 0x1aa8e
movl %edi, %eax
imulq $0x18, %rax, %rcx
leaq 0x20483a(%rip), %rdx    # 0x21f280
leaq (%rdx,%rcx), %rax
movslq 0x4(%rcx,%rdx), %rcx
imulq $0x18, %rcx, %rsi
leaq 0x2049a6(%rip), %r8     # 0x21f400
leaq (%r8,%rsi), %rcx
movl (%rsi,%r8), %r9d
leal -0x1(%r9), %edx
movl %edx, (%rsi,%r8)
testl %r9d, %r9d
jle 0x1aa75
testl %edx, %edx
jne 0x1aa7c
jmp 0x1aa78
andl $0x0, (%rcx)
movb $-0x39, 0x14(%rcx)
orq $-0x1, (%rax)
andl $0x0, 0x8(%rax)
testb $-0x80, 0x14(%rax)
jne 0x2a3d1
retq
// File: /workspace/github_c_makefile_star2_O2/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, 0x2047da(%rip)    # 0x21f274
jne 0x1aaad
callq 0x7d3d8
callq 0x7d375
movb $0x0, 0x2047c7(%rip)    # 0x21f274
cmpb $0x1, 0x2047bc(%rip)    # 0x21f270
jne 0x1aae8
xorl %ebx, %ebx
leaq 0x2047c1(%rip), %r14    # 0x21f280
cmpq $0x180, %rbx            # imm = 0x180
je 0x1aadc
movl (%rbx,%r14), %edi
cmpl $-0x1, %edi
je 0x1aad6
callq 0x79f23
addq $0x18, %rbx
jmp 0x1aabf
callq 0x79c45
movb $0x0, 0x204788(%rip)    # 0x21f270
movl 0xadce2(%rip), %edi     # 0xc87d0
testl %edi, %edi
js 0x1aafe
callq 0x30983
orl $-0x1, 0xadcd2(%rip)    # 0xc87d0
movl 0xadcd0(%rip), %edi     # 0xc87d4
testl %edi, %edi
js 0x1ab14
callq 0x30983
orl $-0x1, 0xadcc0(%rip)    # 0xc87d4
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/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 0x1add2
testb $0x1, 0x2044f4(%rip)    # 0x21f270
je 0x1add2
pushq %rbx
movl %edi, %eax
imulq $0x18, %rax, %rax
leaq 0x2044f4(%rip), %rbx    # 0x21f280
movl (%rax,%rbx), %edi
cmpl $-0x1, %edi
je 0x1add1
addq %rax, %rbx
callq 0x79f23
movslq 0x4(%rbx), %rax
imulq $0x18, %rax, %rdx
leaq 0x204655(%rip), %rsi    # 0x21f400
leaq (%rsi,%rdx), %rax
movl (%rdx,%rsi), %edi
leal -0x1(%rdi), %ecx
movl %ecx, (%rdx,%rsi)
testl %edi, %edi
jle 0x1adc2
testl %ecx, %ecx
jne 0x1adc9
jmp 0x1adc5
andl $0x0, (%rax)
movb $-0x39, 0x14(%rax)
orq $-0x1, (%rbx)
andl $0x0, 0x8(%rbx)
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/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 0x1aea4
testb $0x1, 0x204482(%rip)    # 0x21f270
je 0x1aea4
movl %edx, %ebx
movl %esi, %ebp
movl %edi, %eax
imulq $0x18, %rax, %r12
leaq 0x20447b(%rip), %rax    # 0x21f280
movl %esi, 0xc(%r12,%rax)
movl %edx, 0x10(%r12,%rax)
leaq 0xbf648(%rip), %r15     # 0xda45e
movswq (%r15), %rax
leaq 0xbf6af(%rip), %rcx     # 0xda4d0
movl (%rcx,%rax,4), %ecx
subl %esi, %ecx
leaq 0xbf6e3(%rip), %r13     # 0xda510
movl (%r13,%rax,4), %edi
subl %edx, %edi
imull %ecx, %ecx
imull %edi, %edi
addl %ecx, %edi
callq 0x43f6c
movl %eax, %r14d
movswq (%r15), %rax
leaq 0xbf661(%rip), %rcx     # 0xda4b0
movzwl (%rcx,%rax,2), %r15d
leaq 0xbf675(%rip), %rcx     # 0xda4d0
movl (%rcx,%rax,4), %edi
subl %ebp, %edi
movl (%r13,%rax,4), %esi
subl %ebx, %esi
callq 0x43e64
leaq 0x20440d(%rip), %rcx    # 0x21f280
movl (%r12,%rcx), %edi
cmpl $-0x1, %edi
je 0x1aea4
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 0x79efc
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/jonof[P]jftekwar/src/teksnd.c
// Function: updatesounds
void
updatesounds(int snum)
{
     int      dist=0L,pan=0L,dx,dy;
     int       i;

     if( (toggles[TOGGLE_SOUND] == 0) || !fxstarted )
          return;

     for( i=0; i<MAXSOUNDS; i++ ) {
          if( dsound[i].handle == NULL_HANDLE ) {
               continue;
          }
          if( (dsound[i].type&(ST_IMMEDIATE|ST_NOUPDATE|ST_VEHUPDATE)) != 0 ) {
               continue;
          }
          /*
          dist=klabs(posx[snum]-dsoundptr[i]->x)+labs(posy[snum]-dsoundptr[i]->y);
          if(dsoundptr[i]->type==ST_AMBUPDATE) {
               if( dist < AMBUPDATEDIST ) {
                    vol = (AMBUPDATEDIST<<3)-(dist<<3);
               }
               else {
                    vol=0;
               }
          }
          else {
               if(dist < 1500L)
                    vol = 0x7fff;
               else if(dist > 8500L)
                    vol = 0x1f00;
               else
                    vol = 39000L-(dist<<2);
          }
          */

          dx = klabs(posx[snum]-dsound[i].x);
          dy = klabs(posy[snum]-dsound[i].y);
          dist = ksqrt(dx*dx+dy*dy) >> 6;

          pan = 2048 + ang[snum] - getangle(posx[snum]-dsound[i].x,posy[snum]-dsound[i].y);
          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
leaq 0xacb88(%rip), %rax     # 0xc7a60
cmpl $0x0, 0xc(%rax)
je 0x1af96
testb $0x1, 0x204387(%rip)    # 0x21f270
je 0x1af96
movslq %edi, %r14
pushq $0x14
popq %r15
leaq 0x204383(%rip), %r12    # 0x21f280
leaq 0xbf60c(%rip), %r13     # 0xda510
cmpq $0x194, %r15            # imm = 0x194
je 0x1af96
cmpl $-0x1, -0x14(%r15,%r12)
je 0x1af8d
testb $-0x7b, (%r15,%r12)
jne 0x1af8d
leaq 0xbf5a9(%rip), %rbp     # 0xda4d0
movl (%rbp,%r14,4), %eax
subl -0x8(%r15,%r12), %eax
movl (%r13,%r14,4), %edi
subl -0x4(%r15,%r12), %edi
imull %eax, %eax
imull %edi, %edi
addl %eax, %edi
callq 0x43f6c
movl %eax, %ebx
movl (%rbp,%r14,4), %edi
subl -0x8(%r15,%r12), %edi
leaq 0xbf555(%rip), %rax     # 0xda4b0
movzwl (%rax,%r14,2), %ebp
movl (%r13,%r14,4), %esi
subl -0x4(%r15,%r12), %esi
callq 0x43e64
movl -0x14(%r15,%r12), %edi
cmpl $-0x1, %edi
je 0x1af8d
subl %eax, %ebp
shrl $0x6, %ebp
andl $0x1f, %ebp
sarl $0x6, %ebx
movl %ebp, %esi
movl %ebx, %edx
callq 0x79efc
addq $0x18, %r15
jmp 0x1af04
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/jonof[P]jftekwar/src/teksnd.c
// Function: stopallsounds
void
stopallsounds(void)
{
     int       i;

     if( !fxstarted )
          return;

     for( i=0; i< MAXSOUNDS; i++ ) {
          if( dsound[i].handle == NULL_HANDLE )
               continue;
          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;
     }

//clear variables that track looping sounds
     loopinsound=-1;
     baydoorloop=-1;
     ambsubloop=-1;
}

// Assembly:
cmpb $0x1, 0x2042c4(%rip)    # 0x21f270
jne 0x1b03b
pushq %r15
pushq %r14
pushq %rbx
xorl %ebx, %ebx
leaq 0x2042c0(%rip), %r14    # 0x21f280
leaq 0x204439(%rip), %r15    # 0x21f400
cmpq $0x180, %rbx            # imm = 0x180
je 0x1b018
movl (%rbx,%r14), %edi
cmpl $-0x1, %edi
je 0x1b012
callq 0x79f23
movslq 0x4(%rbx,%r14), %rax
imulq $0x18, %rax, %rdx
leaq (%r15,%rdx), %rax
movl (%rdx,%r15), %esi
leal -0x1(%rsi), %ecx
movl %ecx, (%rdx,%r15)
testl %esi, %esi
jle 0x1b000
testl %ecx, %ecx
jne 0x1b007
jmp 0x1b003
andl $0x0, (%rax)
movb $-0x39, 0x14(%rax)
orq $-0x1, (%rbx,%r14)
andl $0x0, 0x8(%rbx,%r14)
addq $0x18, %rbx
jmp 0x1afc7
leaq 0xad961(%rip), %rax     # 0xc8980
orl $-0x1, (%rax)
leaq 0xad95b(%rip), %rax     # 0xc8984
orl $-0x1, (%rax)
leaq 0xad955(%rip), %rax     # 0xc8988
orl $-0x1, (%rax)
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/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:
cmpb $0x1, 0x203d3b(%rip)    # 0x21f274
jne 0x1b552
pushq %rbp
pushq %rbx
pushq %rax
movl %edi, %ebx
xorl %ebp, %ebp
cmpl $0x3, %ebp
je 0x1b553
movl %ebp, %edi
callq 0x1b056
incl %ebp
jmp 0x1b542
retq
xorl %eax, %eax
testl %ebx, %ebx
setne %al
imull $0x24, %eax, %eax
leaq 0x20feac(%rip), %rcx    # 0x22b410
movl 0x30c(%rax,%rcx), %edx
movl 0x310(%rax,%rcx), %eax
shll $0xc, %edx
movl %edx, 0x205211(%rip)    # 0x22078c
movl %eax, 0x2051ff(%rip)    # 0x220780
cmpl $0xac68, %eax           # imm = 0xAC68
jl 0x1b596
leaq 0x66b3c(%rip), %rdi     # 0x820cb
xorl %eax, %eax
callq 0x2acb8
xorl %edi, %edi
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x1b070
// File: /workspace/github_c_makefile_star2_O2/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:
cmpl $0x6, %edi
jg 0x1b5d0
testb $0x1, 0x203cc5(%rip)    # 0x21f274
je 0x1b5d0
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %edi, %ebx
xorl %ebp, %ebp
cmpl $0x3, %ebp
je 0x1b5d1
movl %ebp, %edi
callq 0x1b056
incl %ebp
jmp 0x1b5c0
retq
imull 0x210e38(%rip), %ebx    # 0x22c410
leal (%rbx,%rbx,2), %r14d
addl $0x13, %r14d
leaq 0x20fe29(%rip), %r15    # 0x22b410
leaq 0x20519e(%rip), %r12    # 0x22078c
leaq 0x20518b(%rip), %r13    # 0x220780
leaq 0x66acf(%rip), %rbx     # 0x820cb
xorl %ebp, %ebp
cmpq $0xc, %rbp
je 0x1b63d
leal -0x1(%r14), %eax
cltq
movl (%r15,%rax,4), %eax
shll $0xc, %eax
movl %eax, (%rbp,%r12)
movslq %r14d, %rax
movl (%r15,%rax,4), %eax
movl %eax, (%rbp,%r13)
cmpl $0xac68, %eax           # imm = 0xAC68
jl 0x1b633
movq %rbx, %rdi
xorl %eax, %eax
callq 0x2acb8
addq $0x4, %rbp
addl $0x3, %r14d
jmp 0x1b5fe
xorl %edi, %edi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x1b070
nop
// File: /workspace/github_c_makefile_star2_O2/jonof[P]jftekwar/src/tekspr.c
// Function: floatmovesprite
short
floatmovesprite(short spritenum, int dx, int dy, int dz, int ceildist, int flordist, char cliptype)
{
     int daz, zoffs;
     short retval, dasectnum;
     unsigned int dcliptype;
     spritetype *spr;

     (void)dz;

    #ifdef PLRSPRDEBUG
     if( isaplayersprite(spritenum) ) {
          crashgame("messing w plrsprite at 18");
     }
    #endif

     switch (cliptype) {
          case NORMALCLIP: dcliptype = CLIPMASK0; break;
          case PROJECTILECLIP: dcliptype = CLIPMASK1; break;
          case CLIFFCLIP: dcliptype = CLIPMASK0; break;
     }

     spr = &sprite[spritenum];

     if ((spr->cstat&128) == 0)
          zoffs = -((tilesizy[spr->picnum]*spr->yrepeat)<<1);
     else
          zoffs = 0;

     dasectnum = spr->sectnum;  //Can't modify sprite sectors directly becuase of linked lists
     daz = spr->z+zoffs;  //Must do this if not using the new centered centering (of course)
     retval = clipmove(&spr->x,&spr->y,&daz,&dasectnum,dx,dy,
                                   ((int)spr->clipdist)<<2,ceildist,flordist,dcliptype);

     if ((dasectnum != spr->sectnum) && (dasectnum >= 0))
          changespritesect(spritenum,dasectnum);

     return(retval);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x10, %rsp
movl %r9d, %r10d
movl %r8d, %eax
movl %edx, %r9d
movl %esi, %r8d
cmpb $0x1, 0x40(%rsp)
movl $0x1000040, %ecx        # imm = 0x1000040
movl $0x10001, %r11d         # imm = 0x10001
cmovel %ecx, %r11d
movl %edi, %ebx
movslq %edi, %rcx
imulq $0x2c, %rcx, %rdx
leaq 0x408327(%rip), %rsi    # 0x423b30
leaq (%rsi,%rdx), %r14
xorl %ecx, %ecx
testb $-0x80, 0xc(%rsi,%rdx)
jne 0x1b832
movswq 0xe(%r14), %rcx
leaq 0x58ce3e(%rip), %rdx    # 0x5a8660
movswl (%rdx,%rcx,2), %edx
movzbl 0x15(%r14), %ecx
imull %edx, %ecx
addl %ecx, %ecx
negl %ecx
movzwl 0x18(%r14), %edx
leaq 0xa(%rsp), %r15
movw %dx, (%r15)
addl 0x8(%r14), %ecx
leaq 0xc(%rsp), %rdx
movl %ecx, (%rdx)
leaq 0x4(%r14), %rsi
movzbl 0x12(%r14), %r12d
shll $0x2, %r12d
movq %r14, %rdi
movq %r15, %rcx
pushq %r11
pushq %r10
pushq %rax
pushq %r12
callq 0x460b8
addq $0x20, %rsp
movl %eax, %ebp
movzwl (%r15), %eax
testw %ax, %ax
js 0x1b88b
cmpw 0x18(%r14), %ax
je 0x1b88b
movswl %bx, %edi
movswl %ax, %esi
callq 0x43fe1
movl %ebp, %eax
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/jonof[P]jftekwar/src/tekspr.c
// Function: flymovesprite
short
flymovesprite(short spritenum, int dx, int dy, int dz, int ceildist, int flordist, char cliptype)
{
     int           daz;
     short          retval, dasectnum, tempshort;
    unsigned int dcliptype;
     spritetype *spr;

     (void)dz;

    #ifdef PLRSPRDEBUG
     if( isaplayersprite(spritenum) ) {
          crashgame("messing w plrsprite at 20");
     }
    #endif

     switch (cliptype) {
          case NORMALCLIP: dcliptype = CLIPMASK0; break;
          case PROJECTILECLIP: dcliptype = CLIPMASK1; break;
          case CLIFFCLIP: dcliptype = CLIPMASK0; break;
     }

     spr = &sprite[spritenum];

     dasectnum = spr->sectnum;
     retval = clipmove(&spr->x,&spr->y,&spr->z,&dasectnum,dx,dy,
                                   ((int)spr->clipdist)<<2,ceildist,flordist,dcliptype);

     if ((dasectnum != spr->sectnum) && (dasectnum >= 0))
          changespritesect(spritenum,dasectnum);

     if( spr->statnum != PINBALL ) {
          tempshort = spr->cstat; spr->cstat &= ~1;
          getzrange(spr->x,spr->y,spr->z-1,spr->sectnum,
                          &globhiz,&globhihit,&globloz,&globlohit,
                          ((int)spr->clipdist)<<2,dcliptype);
          spr->cstat = tempshort;
          daz=(globloz+globhiz);
          spr->z=(daz>>1);
     }

     return(retval);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %r9d, %r10d
movl %r8d, %eax
movl %edx, %r9d
movl %esi, %r8d
cmpb $0x1, 0x40(%rsp)
movl $0x1000040, %ecx        # imm = 0x1000040
movl $0x10001, %r12d         # imm = 0x10001
cmovel %ecx, %r12d
movl %edi, %r14d
movslq %edi, %rcx
imulq $0x2c, %rcx, %r13
leaq 0x408029(%rip), %rbp    # 0x423b30
movq %rbp, %rbx
addq %r13, %rbx
leaq 0x4(%rbp,%r13), %rsi
movzwl 0x14(%rsi), %ecx
leaq 0x6(%rsp), %r15
movw %cx, (%r15)
leaq 0x8(,%r13), %rdx
addq %rbp, %rdx
movzbl 0xa(%rdx), %r11d
shll $0x2, %r11d
movq %rbx, %rdi
movq %r15, %rcx
pushq %r12
pushq %r10
pushq %rax
pushq %r11
callq 0x460b8
addq $0x20, %rsp
movzwl (%r15), %ecx
testw %cx, %cx
js 0x1bb6a
cmpw 0x18(%rbp,%r13), %cx
je 0x1bb6a
movswl %r14w, %edi
movswl %cx, %esi
movl %eax, %ebp
callq 0x43fe1
movl %ebp, %eax
cmpw $0x193, 0x1a(%rbx)      # imm = 0x193
je 0x1bbda
movzwl 0xc(%rbx), %r15d
movl %r15d, %ecx
andl $-0x2, %ecx
movw %cx, 0xc(%rbx)
movl (%rbx), %edi
movl 0x4(%rbx), %esi
movl 0x8(%rbx), %edx
decl %edx
movl %eax, %ebp
movswl 0x18(%rbx), %ecx
movzbl 0x12(%rbx), %eax
shll $0x2, %eax
leaq 0xbfbdd(%rip), %r10     # 0xdb77c
leaq 0xbfbd2(%rip), %r13     # 0xdb778
leaq 0xbfbc3(%rip), %r14     # 0xdb770
leaq 0xbfbc0(%rip), %r9      # 0xdb774
movq %r14, %r8
pushq %r12
pushq %rax
pushq %r10
pushq %r13
callq 0x4841a
movl %ebp, %eax
addq $0x20, %rsp
movw %r15w, 0xc(%rbx)
movl (%r14), %ecx
addl (%r13), %ecx
sarl %ecx
movl %ecx, 0x8(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/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
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %r8d, %ebx
movl %edx, %ebp
movl %esi, %r14d
movl %edi, %r15d
movl %ecx, %edi
movl $0x196, %esi            # imm = 0x196
callq 0x1cf0c
cmpw $-0x1, %ax
je 0x1cc12
movzbl 0x20f8ae(%rip), %esi    # 0x22c414
leaq 0xabc6b(%rip), %rdi     # 0xc87d8
movswq %ax, %rax
imulq $0x2c, %rax, %rcx
leaq 0x406fb4(%rip), %rdx    # 0x423b30
movl %r15d, (%rdx,%rcx)
movl %r14d, 0x4(%rdx,%rcx)
movl %ebp, 0x8(%rdx,%rcx)
andw $0x0, 0xc(%rdx,%rcx)
movzwl (%rdi,%rsi,2), %esi
andw $0x0, 0x10(%rdx,%rcx)
leaq (%rdx,%rcx), %rdi
movb $0xc, 0x12(%rdx,%rcx)
movl $0x1010, 0x14(%rdx,%rcx) # imm = 0x1010
movw %bx, 0xe(%rdx,%rcx)
movw %si, 0x1c(%rdx,%rcx)
leal 0x200(%rsi), %r8d
movl $0x7ff, %r9d            # imm = 0x7FF
andl %r9d, %r8d
leaq 0x559005(%rip), %r10    # 0x575bd0
movswl (%r10,%r8,2), %r8d
shrl $0x6, %r8d
movw %r8w, 0x20(%rdx,%rcx)
andl %r9d, %esi
movswl (%r10,%rsi,2), %esi
shrl $0x6, %esi
movw %si, 0x22(%rdx,%rcx)
andw $0x0, 0x1e(%rdx,%rcx)
movabsq $-0xffffffffffe2, %rsi  # imm = 0xFFFF00000000001E
movq %rsi, 0x24(%rdx,%rcx)
imulq $0xc, %rax, %rsi
addq 0xaa3ae(%rip), %rsi     # 0xc6fb8
pushq $0x3
popq %rdx
callq 0x56a36
movb 0x20f7fc(%rip), %al     # 0x22c414
incb %al
xorl %ecx, %ecx
cmpb $0x6, %al
movzbl %al, %eax
cmovael %ecx, %eax
movb %al, 0x20f7ea(%rip)     # 0x22c414
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/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 %rbx
movslq %edi, %rbx
leaq 0x10a2c7(%rip), %rax    # 0x127230
movq (%rax,%rbx,8), %rax
movzwl 0x2a(%rax), %eax
cmpq $0x3fff, %rax           # imm = 0x3FFF
ja 0x1cf9b
leaq 0x1b22b0(%rip), %rcx    # 0x1cf230
movq (%rcx,%rax,8), %rdx
xorps %xmm0, %xmm0
andw $0x0, 0x20(%rdx)
movups %xmm0, 0x10(%rdx)
movups %xmm0, (%rdx)
movq (%rcx,%rax,8), %rax
movb $0x0, 0x1e(%rax)
movswl %di, %edi
callq 0x442fc
imulq $0x2c, %rbx, %rax
leaq 0x406b82(%rip), %rcx    # 0x423b30
orw $-0x1, 0x2a(%rcx,%rax)
xorl %eax, %eax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/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 %rbx
leaq 0x77eb64(%rip), %rax    # 0x79bb30
leaq 0xbe77d(%rip), %rcx     # 0xdb750
pushq $0x1
popq %rbx
leaq 0x77eb63(%rip), %rdx    # 0x79bb40
movslq (%rax), %rax
testq %rax, %rax
js 0x1cff6
movswl (%rcx,%rax,2), %esi
cmpl %edi, %esi
je 0x1d01d
shlq $0x2, %rax
addq %rdx, %rax
jmp 0x1cfdd
movslq %edi, %rax
leaq 0x10a230(%rip), %rcx    # 0x127230
movq (%rcx,%rax,8), %rax
xorl %ebx, %ebx
cmpw $0x8, 0x1a(%rax)
jne 0x1d01d
leaq 0x653ec(%rip), %rdi     # 0x82400
xorl %ebx, %ebx
xorl %eax, %eax
callq 0x2acb8
movl %ebx, %eax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/jonof[P]jftekwar/src/tekstat.c
// Function: clearXTpics
void
clearXTpics(short spriteno)
{
     short     extno=sprptr[spriteno]->extra;

    #ifdef PLRSPRDEBUG
     if( isaplayersprite(spriteno) ) {
          crashgame("messing w plrsprite at 2");
     }
    #endif

     if( extno != -1 ) {
          sprXTptr[extno]->basepic=sprptr[spriteno]->picnum;
          sprXTptr[extno]->standpic=NO_PIC;
          sprXTptr[extno]->walkpic=NO_PIC;
          sprXTptr[extno]->runpic=NO_PIC;
          sprXTptr[extno]->attackpic=NO_PIC;
          sprXTptr[extno]->deathpic=NO_PIC;
          sprXTptr[extno]->painpic=NO_PIC;
          sprXTptr[extno]->squatpic=NO_PIC;
          sprXTptr[extno]->morphpic=NO_PIC;
          sprXTptr[extno]->specialpic=NO_PIC;
     }
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movslq %edi, %rbx
leaq 0x10a200(%rip), %r15    # 0x127230
movq (%r15,%rbx,8), %rax
movswq 0x2a(%rax), %r14
movl %ebx, %edi
callq 0x1cfc4
testl %eax, %eax
je 0x1d052
leaq 0x653d4(%rip), %rdi     # 0x8241f
xorl %eax, %eax
callq 0x2acb8
cmpw $-0x1, %r14w
je 0x1d0c1
movq (%r15,%rbx,8), %rax
movzwl 0xe(%rax), %eax
leaq 0x1b21c8(%rip), %rcx    # 0x1cf230
movq (%rcx,%r14,8), %rdx
movw %ax, 0xa(%rdx)
movq (%rcx,%r14,8), %rax
andw $0x0, 0xc(%rax)
movq (%rcx,%r14,8), %rax
andw $0x0, 0xe(%rax)
movq (%rcx,%r14,8), %rax
andw $0x0, 0x10(%rax)
movq (%rcx,%r14,8), %rax
andw $0x0, 0x12(%rax)
movq (%rcx,%r14,8), %rax
andw $0x0, 0x14(%rax)
movq (%rcx,%r14,8), %rax
andw $0x0, 0x16(%rax)
movq (%rcx,%r14,8), %rax
andw $0x0, 0x18(%rax)
movq (%rcx,%r14,8), %rax
andw $0x0, 0x1a(%rax)
movq (%rcx,%r14,8), %rax
andw $0x0, 0x1c(%rax)
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/jonof[P]jftekwar/src/tekstat.c
// Function: mapXT
int
mapXT(int sn)
{
     short    i;

    #ifdef PLRSPRDEBUG
     if( isaplayersprite(sn) ) {
          crashgame("messing w plrsprite at 0");
     }
    #endif

     for ( i=0; i<MAXSPRITES; i++ ) {
          if( sprXTptr[i]->lock == 0x00 ) {
               sprptr[sn]->extra=i;
               memset(sprXTptr[i], 0, sizeof(struct spriteextension));
               sprXTptr[i]->lock=0xFF;
               return(i);
          }
     }

     sprptr[sn]->extra=-1;
     return(-1);   // no free spot found
}

// Assembly:
pushq %rbx
movl %edi, %ebx
callq 0x1cfc4
testl %eax, %eax
je 0x1d0e1
leaq 0x6535e(%rip), %rdi     # 0x82438
xorl %eax, %eax
callq 0x2acb8
xorl %eax, %eax
leaq 0x1b2146(%rip), %rcx    # 0x1cf230
cmpq $0x4000, %rax           # imm = 0x4000
je 0x1d101
movq (%rcx,%rax,8), %rdx
cmpb $0x0, 0x1e(%rdx)
je 0x1d119
incq %rax
jmp 0x1d0ea
movslq %ebx, %rax
leaq 0x10a125(%rip), %rcx    # 0x127230
movq (%rcx,%rax,8), %rax
orw $-0x1, 0x2a(%rax)
pushq $-0x1
popq %rax
jmp 0x1d146
movslq %ebx, %rdx
leaq 0x10a10d(%rip), %rsi    # 0x127230
movq (%rsi,%rdx,8), %rdx
movw %ax, 0x2a(%rdx)
movq (%rcx,%rax,8), %rdx
xorps %xmm0, %xmm0
andw $0x0, 0x20(%rdx)
movups %xmm0, 0x10(%rdx)
movups %xmm0, (%rdx)
movq (%rcx,%rax,8), %rcx
movb $-0x1, 0x1e(%rcx)
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/jonof[P]jftekwar/src/tekstat.c
// Function: verifystatus
void
verifystatus(int i, int stat)
{
     if( i == -1 ) {
          return;
     }
     if( sprptr[i]->statnum != stat ) {
          if( nextspritestat[i] != -1 ) {
               crashgame("verifystatus fail for %d", stat);
          }
          vbad++;
     }
}

// Assembly:
cmpl $-0x1, %edi
je 0x1d1af
movslq %edi, %rax
leaq 0x10a0b4(%rip), %rcx    # 0x127230
movq (%rcx,%rax,8), %rcx
movswl 0x1a(%rcx), %ecx
cmpl %esi, %ecx
je 0x1d1af
leaq 0x550a21(%rip), %rcx    # 0x56dbb0
cmpw $-0x1, (%rcx,%rax,2)
je 0x1d1a9
pushq %rax
leaq 0x652d9(%rip), %rdi     # 0x82477
xorl %eax, %eax
callq 0x2acb8
addq $0x8, %rsp
incb 0x20f276(%rip)          # 0x22c425
retq
// File: /workspace/github_c_makefile_star2_O2/jonof[P]jftekwar/src/tekstat.c
// Function: initsprites
int
initsprites()
{
     int       i;

    #ifdef   NETDEBUG
     dbgfp2=fopen("debug.sts","wt");
    #endif

     for( i=0; i< MAXSPRITES; i++ ) {
          memset(&sprite[i], 0, sizeof(spritetype));
          sprite[i].sectnum=MAXSECTORS;
          sprite[i].statnum=MAXSTATUS;
          sprite[i].extra=-1;
     }

     // initialize blast sector flashes
     sectflash.sectnum=0;
     sectflash.ovis=0;
     sectflash.step=0;

    #ifdef  STATLISTDEBUG
     for( i=0; i < (MAXSECTORS+1); i++ ) {
          headspritesectptr[i]=&headspritesect[i];
     }
     for( i=0; i < (MAXSTATUS+1); i++ ) {
          headspritestatptr[i]=&headspritestat[i];
     }
     for( i=0; i < MAXSPRITES; i ++ ) {
          prevspritesectptr[i]=&prevspritesect[i];
          prevspritestatptr[i]=&prevspritestat[i];
          nextspritesectptr[i]=&nextspritesect[i];
          nextspritestatptr[i]=&nextspritestat[i];
     }
    #endif

     return(1);
}

// Assembly:
pushq $0x2a
popq %rax
leaq 0x406976(%rip), %rcx    # 0x423b30
xorps %xmm0, %xmm0
cmpq $0xb002a, %rax          # imm = 0xB002A
je 0x1d1e7
movups %xmm0, -0x1a(%rcx,%rax)
movups %xmm0, -0xe(%rcx,%rax)
movups %xmm0, -0x2a(%rcx,%rax)
movl $0x4001000, -0x12(%rcx,%rax) # imm = 0x4001000
orw $-0x1, (%rcx,%rax)
addq $0x2c, %rax
jmp 0x1d1bd
andw $0x0, 0x20f239(%rip)    # 0x22c428
movb $0x0, 0x20f23a(%rip)    # 0x22c430
andl $0x0, 0x20f22f(%rip)    # 0x22c42c
leaq 0x53618c(%rip), %rax    # 0x553390
xorl %ecx, %ecx
leaq 0x20f233(%rip), %rdx    # 0x22c440
cmpq $0x8008, %rcx           # imm = 0x8008
je 0x1d224
movq %rax, (%rcx,%rdx)
addq $0x8, %rcx
addq $0x2, %rax
jmp 0x1d20d
leaq 0x548175(%rip), %rax    # 0x5653a0
xorl %ecx, %ecx
leaq 0x21721c(%rip), %rdx    # 0x234450
cmpq $0x2008, %rcx           # imm = 0x2008
je 0x1d24b
movq %rax, (%rcx,%rdx)
addq $0x8, %rcx
addq $0x2, %rax
jmp 0x1d234
leaq 0x55095e(%rip), %rax    # 0x56dbb0
leaq 0x540147(%rip), %rcx    # 0x55d3a0
leaq 0x548950(%rip), %rdx    # 0x565bb0
leaq 0x538139(%rip), %rsi    # 0x5553a0
xorl %edi, %edi
leaq 0x2191f0(%rip), %r8     # 0x236460
leaq 0x2391e9(%rip), %r9     # 0x256460
leaq 0x2591e2(%rip), %r10    # 0x276460
leaq 0x2791db(%rip), %r11    # 0x296460
cmpq $0x20000, %rdi          # imm = 0x20000
je 0x1d2b4
movq %rsi, (%rdi,%r8)
movq %rdx, (%rdi,%r9)
movq %rcx, (%rdi,%r10)
movq %rax, (%rdi,%r11)
addq $0x8, %rdi
addq $0x2, %rax
addq $0x2, %rcx
addq $0x2, %rdx
addq $0x2, %rsi
jmp 0x1d285
pushq $0x1
popq %rax
retq
// File: /workspace/github_c_makefile_star2_O2/jonof[P]jftekwar/src/tekstat.c
// Function: isvisible
int
isvisible(short i, short target)
{

     if( !validplayer(target) ) {
          crashgame("isvisible: bad targetnum");
     }

	if( sintable[(sprptr[i]->ang+2560)&2047]*(posx[target]-sprptr[i]->x) + sintable[(sprptr[i]->ang+2048)&2047]*(posy[target]-sprptr[i]->y) >= 0) {
	     if( cansee(posx[target],posy[target],(posz[target])>>1,cursectnum[target],
                     sprptr[i]->x,sprptr[i]->y,sprptr[i]->z-(tilesizy[sprptr[i]->picnum]<<7),sprptr[i]->sectnum) == 1) {
          return(1);
          }
     }

     return(0);
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movl %esi, %ebx
movl %edi, %ebp
movl %esi, %edi
callq 0xe2e0
testl %eax, %eax
jne 0x1d6c4
leaq 0x64de0(%rip), %rdi     # 0x8249d
xorl %eax, %eax
callq 0x2acb8
movswq %bp, %rax
leaq 0x109b61(%rip), %rcx    # 0x127230
movq (%rcx,%rax,8), %rax
movzwl 0x1c(%rax), %edx
leal 0x200(%rdx), %ecx
movl $0x7ff, %esi            # imm = 0x7FF
andl %esi, %ecx
leaq 0x5584e5(%rip), %r10    # 0x575bd0
movswl (%r10,%rcx,2), %r11d
movswq %bx, %rcx
leaq 0xbcdd5(%rip), %rdi     # 0xda4d0
movl (%rdi,%rcx,4), %edi
movl (%rax), %r8d
movl 0x4(%rax), %r9d
movl %edi, %ebx
subl %r8d, %ebx
imull %r11d, %ebx
andl %esi, %edx
movswl (%r10,%rdx,2), %edx
leaq 0xbcdf4(%rip), %rsi     # 0xda510
movl (%rsi,%rcx,4), %esi
movl %esi, %r10d
subl %r9d, %r10d
imull %edx, %r10d
addl %ebx, %r10d
js 0x1d77a
leaq 0xbce1b(%rip), %rdx     # 0xda550
movl (%rdx,%rcx,4), %edx
sarl %edx
leaq 0xbdfdf(%rip), %r10     # 0xdb720
movswl (%r10,%rcx,2), %ecx
movl 0x8(%rax), %r10d
movswq 0xe(%rax), %r11
leaq 0x58af0a(%rip), %rbx    # 0x5a8660
movswl (%rbx,%r11,2), %r11d
shll $0x7, %r11d
subl %r11d, %r10d
movswl 0x18(%rax), %eax
pushq %rax
pushq %r10
callq 0x4452f
popq %rcx
popq %rdx
cmpl $0x1, %eax
jne 0x1d77a
pushq $0x1
popq %rax
jmp 0x1d77c
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/jonof[P]jftekwar/src/tekstat.c
// Function: getpicinfo
void
getpicinfo(short picnum)
{
     int      amask=picanm[picnum];

     picinfoptr->numframes=amask&0x0000003F;
     picinfoptr->animtype =( amask&0x000000C0 )>>6;
     picinfoptr->xcenteroffset=( amask&0x0000FF00 )>>8;
     picinfoptr->ycenteroffset=( amask&0x00FF0000 )>>16;
     picinfoptr->animspeed=( amask&0x0F000000 )>>24;
}

// Assembly:
movslq %edi, %rax
leaq 0x3c4153(%rip), %rcx    # 0x3e18e0
movl (%rcx,%rax,4), %eax
movl %eax, %ecx
andb $0x3f, %cl
movq 0xab054(%rip), %rdx     # 0xc87f0
movb %cl, (%rdx)
movl %eax, %ecx
shrb $0x6, %cl
movq 0xab046(%rip), %rdx     # 0xc87f0
movb %cl, 0x1(%rdx)
movq 0xab03c(%rip), %rcx     # 0xc87f0
movb %ah, 0x3(%rcx)
movl %eax, %ecx
shrl $0x10, %ecx
movq 0xab02d(%rip), %rdx     # 0xc87f0
movb %cl, 0x2(%rdx)
shrl $0x18, %eax
andb $0xf, %al
movq 0xab01e(%rip), %rcx     # 0xc87f0
movb %al, 0x4(%rcx)
retq
// File: /workspace/github_c_makefile_star2_O2/jonof[P]jftekwar/src/tekstat.c
// Function: wallangle
short
wallangle(int wn)
{
     int      w1x,w1y, w2x,w2y;
     short     wang;

     w1x=wallptr[wn]->x; w1y=wallptr[wn]->y;
     wn=wallptr[wn]->point2;
     w2x=wallptr[wn]->x; w2y=wallptr[wn]->y;
     wang=getangle(w2x-w1x, w2y-w1y);

 return(wang);
}

// Assembly:
pushq %rax
movslq %edi, %rax
leaq 0x1d9a4f(%rip), %rcx    # 0x1f7230
movq (%rcx,%rax,8), %rax
movswq 0x8(%rax), %rdx
movq (%rcx,%rdx,8), %rcx
movl (%rcx), %edi
movl 0x4(%rcx), %esi
subl (%rax), %edi
subl 0x4(%rax), %esi
callq 0x43e64
popq %rcx
retq
// File: /workspace/github_c_makefile_star2_O2/jonof[P]jftekwar/src/tekstat.c
// Function: wallnormal
short
wallnormal(int wn)
{
     int      w1x,w1y, w2x,w2y;
     short     wnorm;

     w1x=wallptr[wn]->x; w1y=wallptr[wn]->y;
     wn=wallptr[wn]->point2;
     w2x=wallptr[wn]->x; w2y=wallptr[wn]->y;
     wnorm=getangle(w2x-w1x, w2y-w1y);
     wnorm=(wnorm+512L)&2047;

 return(wnorm);
}

// Assembly:
pushq %rax
movslq %edi, %rax
leaq 0x1d99e5(%rip), %rcx    # 0x1f7230
movq (%rcx,%rax,8), %rax
movswq 0x8(%rax), %rdx
movq (%rcx,%rdx,8), %rcx
movl (%rcx), %edi
movl 0x4(%rcx), %esi
subl (%rax), %edi
subl 0x4(%rax), %esi
callq 0x43e64
addl $0x200, %eax            # imm = 0x200
andl $0x7ff, %eax            # imm = 0x7FF
popq %rcx
retq
// File: /workspace/github_c_makefile_star2_O2/jonof[P]jftekwar/src/tekstat.c
// Function: spritedeflect
short
spritedeflect(int sn, short angin)
{
     short     angout;

     switch ( sprptr[sn]->statnum ) {
     case INANIMATE:
     case INACTIVE:
     case AMBUSH:
          angout=(angin+1024)&2047;
          switch( (int)RMOD2("STAT697 ") ) {
          case 0:
               angout=leftof[angout];
               break;
          case 1:
          default:
               angout=rightof[angout];
               break;
          }
          break;
     default:
          angout=sprptr[sn]->ang;
          break;
     }

 return(angout);
}

// Assembly:
pushq %rbx
movl %esi, %ebx
movslq %edi, %rax
leaq 0x109987(%rip), %rcx    # 0x127230
movq (%rcx,%rax,8), %rax
movzwl 0x1a(%rax), %ecx
testl %ecx, %ecx
je 0x1d8c2
cmpl $0xca, %ecx
je 0x1d8c2
cmpl $0x64, %ecx
jne 0x1d8f7
andl $0x7ff, %ebx            # imm = 0x7FF
xorl $0x400, %ebx            # imm = 0x400
leaq 0x64bfc(%rip), %rdi     # 0x824d1
callq 0x2945b
cmpl $0x8000, %eax           # imm = 0x8000
jg 0x1d8ea
leaq 0xaaf98(%rip), %rax     # 0xc8880
jmp 0x1d8f1
leaq 0xaafbf(%rip), %rax     # 0xc88b0
leaq (%rax,%rbx,2), %rax
jmp 0x1d8fb
addq $0x1c, %rax
movzwl (%rax), %eax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/jonof[P]jftekwar/src/tekstat.c
// Function: tweakdeathdist
void
tweakdeathdist(short i)
{
	int      dax,day;

    #ifdef PLRSPRDEBUG
     if( isaplayersprite(i) ) {
          crashgame("messing w plrsprite at 1");
     }
    #endif

     sprptr[i]->clipdist<<=1;
     dax=( ((sintable[(sprptr[i]->ang+512)&2047])*sprptr[i]->xvel) <<3 );
	day=( ((sintable[sprptr[i]->ang])*sprptr[i]->yvel) <<3 );
	movesprite(( short)i,dax,day,0L,1024,1024,CLIFFCLIP);

     if( sprptr[i]->extra == -1 ) {
          sprptr[i]->lotag=SPR_LOTAG_PICKUP;
     }
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movl %edi, %ebx
callq 0x1cfc4
testl %eax, %eax
je 0x1d91d
leaq 0x64bc4(%rip), %rdi     # 0x824da
xorl %eax, %eax
callq 0x2acb8
movswq %bx, %rbx
leaq 0x109908(%rip), %r14    # 0x127230
movq (%r14,%rbx,8), %rax
shlb 0x12(%rax)
movq (%r14,%rbx,8), %rax
movswq 0x1c(%rax), %rcx
leal 0x200(%rcx), %edx
andl $0x7ff, %edx            # imm = 0x7FF
leaq 0x558285(%rip), %rdi    # 0x575bd0
movswl (%rdi,%rdx,2), %edx
movswl 0x20(%rax), %esi
imull %edx, %esi
shll $0x3, %esi
movswl (%rdi,%rcx,2), %ecx
movswl 0x22(%rax), %edx
imull %ecx, %edx
shll $0x3, %edx
movl $0x2, (%rsp)
movswl %bx, %edi
xorl %ecx, %ecx
movl $0x400, %r8d            # imm = 0x400
movl $0x400, %r9d            # imm = 0x400
callq 0x1b89a
movq (%r14,%rbx,8), %rax
cmpw $-0x1, 0x2a(%rax)
jne 0x1d995
movw $0x7d4, 0x26(%rax)      # imm = 0x7D4
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/jonof[P]jftekwar/src/tekstat.c
// Function: splash
void
splash(int i)
{
     int       j;

    #ifdef PLRSPRDEBUG
     if( isaplayersprite(i) ) {
          crashgame("messing w plrsprite at 3");
     }
    #endif

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

     j=jsinsertsprite(sprptr[i]->sectnum, RUNTHRU);
     if( j != -1 ) {
          fillsprite(j,sprptr[i]->x,sprptr[i]->y,sprptr[i]->z,
                     2,-13,0,32,64,64,0,0,BLUESPLASH,sprptr[i]->ang,
		     	 0,0,0,i+4096,sprptr[i]->sectnum,
                     RUNTHRU,0,0,-1);
          getpicinfo(BLUESPLASH);
          sprptr[j]->lotag=picinfoptr->numframes;
          if( sprptr[j]->lotag > MAXFRAMES ) {
               sprptr[j]->lotag=MAXFRAMES;
          }
          if( sprptr[j]->lotag < 0 ) {
               sprptr[j]->lotag=0;
          }
          sprptr[j]->hitag=0;
          playsound(S_SPLASH,sprptr[i]->x,sprptr[i]->y,0,ST_NOUPDATE);
     }
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movl %edi, %ebx
callq 0x1cfc4
testl %eax, %eax
je 0x1d9be
leaq 0x64b3c(%rip), %rdi     # 0x824f3
xorl %eax, %eax
callq 0x2acb8
leaq 0xa9fb3(%rip), %rax     # 0xc7978
cmpb $0x0, 0x4(%rax)
je 0x1d9d7
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
movslq %ebx, %r14
leaq 0x10984f(%rip), %r15    # 0x127230
movq (%r15,%r14,8), %rax
movswl 0x18(%rax), %edi
movl $0x197, %esi            # imm = 0x197
callq 0x1cf0c
cmpw $-0x1, %ax
je 0x1d9cb
movswq %ax, %r12
imulq $0x2c, %r12, %rax
leaq 0x406128(%rip), %rcx    # 0x423b30
leaq (%rcx,%rax), %rdi
movq (%r15,%r14,8), %rdx
movl (%rdx), %esi
movl %esi, (%rcx,%rax)
movl 0x4(%rdx), %esi
movl %esi, 0x4(%rcx,%rax)
movl 0x8(%rdx), %esi
movl %esi, 0x8(%rcx,%rax)
movl $0x1240002, 0xc(%rcx,%rax) # imm = 0x1240002
movw $0xf3, 0x10(%rcx,%rax)
movb $0x20, 0x12(%rcx,%rax)
movl $0x4040, 0x14(%rcx,%rax) # imm = 0x4040
movzwl 0x1c(%rdx), %edx
movw %dx, 0x1c(%rcx,%rax)
addl $0x1000, %ebx           # imm = 0x1000
movw %bx, 0x1e(%rcx,%rax)
andq $0x0, 0x20(%rcx,%rax)
movl $0xffff0000, 0x28(%rcx,%rax) # imm = 0xFFFF0000
imulq $0xc, %r12, %rsi
addq 0xa954c(%rip), %rsi     # 0xc6fb8
pushq $0x3
popq %rdx
callq 0x56a36
movl $0x124, %edi            # imm = 0x124
callq 0x1d783
movq 0xaad6b(%rip), %rax     # 0xc87f0
movzbl (%rax), %eax
movq (%r15,%r12,8), %rcx
movw %ax, 0x26(%rcx)
movq (%r15,%r12,8), %rax
movzwl 0x26(%rax), %ecx
cmpw $0x9, %cx
jl 0x1daac
movw $0x8, 0x26(%rax)
movq (%r15,%r12,8), %rax
movzwl 0x26(%rax), %ecx
testw %cx, %cx
jns 0x1daba
andw $0x0, 0x26(%rax)
movq (%r15,%r12,8), %rax
andw $0x0, 0x28(%rax)
movq (%r15,%r14,8), %rax
movl (%rax), %esi
movl 0x4(%rax), %edx
pushq $0xb
popq %rdi
pushq $0x4
popq %r8
xorl %ecx, %ecx
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x1ab2a
// File: /workspace/github_c_makefile_star2_O2/jonof[P]jftekwar/src/tekstat.c
// Function: pickupsprite
int
pickupsprite(short sn)
{
    #ifdef PLRSPRDEBUG
     if( isaplayersprite(sn) ) {
          crashgame("messing w plrsprite at 4");
     }
    #endif

     // can only carry one at a time of these items
     if( (pickup.picnum != 0) || (option[4] != 0) ) {
          return(0);
     }

     pickup.picnum=sprptr[sn]->picnum;
     pickup.cstat=sprptr[sn]->cstat;
     pickup.shade=sprptr[sn]->shade;
     pickup.pal=sprptr[sn]->pal;
     pickup.clipdist=sprptr[sn]->clipdist;
     pickup.xrepeat=sprptr[sn]->xrepeat;
     pickup.yrepeat=sprptr[sn]->yrepeat;
	pickup.xoffset=sprptr[sn]->xoffset;
	pickup.yoffset=sprptr[sn]->yoffset;
     // cant set lotag/hitag as TOSS needs to use them
     pickup.extra=sprptr[sn]->extra;

     jsdeletesprite(sn);

     pickupclock=lockclock;
     return(1);
}

// Assembly:
pushq %rbx
movl %edi, %ebx
callq 0x1cfc4
testl %eax, %eax
je 0x1dafb
leaq 0x64a18(%rip), %rdi     # 0x8250c
xorl %eax, %eax
callq 0x2acb8
xorl %eax, %eax
cmpw $0x0, 0x298969(%rip)    # 0x2b646e
jne 0x1db82
leaq 0xa9e6a(%rip), %rcx     # 0xc7978
cmpb $0x0, 0x4(%rcx)
jne 0x1db82
movswq %bx, %rax
leaq 0x109711(%rip), %rcx    # 0x127230
movq (%rcx,%rax,8), %rcx
movzwl 0xe(%rcx), %edx
movw %dx, 0x298940(%rip)     # 0x2b646e
movzwl 0xc(%rcx), %edx
movw %dx, 0x298933(%rip)     # 0x2b646c
movb 0x10(%rcx), %dl
movb %dl, 0x29892e(%rip)     # 0x2b6470
movb 0x11(%rcx), %dl
movb %dl, 0x298926(%rip)     # 0x2b6471
movb 0x12(%rcx), %dl
movb %dl, 0x29891e(%rip)     # 0x2b6472
movl 0x14(%rcx), %edx
movl %edx, 0x298917(%rip)    # 0x2b6474
movzwl 0x2a(%rcx), %ecx
movw %cx, 0x298922(%rip)     # 0x2b648a
movswl %ax, %edi
callq 0x1cf5e
leaq 0xbc911(%rip), %rax     # 0xda488
movl (%rax), %eax
movl %eax, 0x298959(%rip)    # 0x2b64d8
pushq $0x1
popq %rax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/jonof[P]jftekwar/src/tekstat.c
// Function: ambushyell
void
ambushyell(short sn, short ext)
{
    #ifdef PLRSPRDEBUG
     if( isaplayersprite(sn) ) {
          crashgame("messing w plrsprite at 24");
     }
    #endif

     if( !validext(ext) ) {
          return;
     }
     if( sprXTptr[ext]->aimask&AI_DIDAMBUSHYELL )
          return;

     switch( sprXTptr[ext]->basepic ) {
     case ANTWALKPIC:
     case RUBWALKPIC:
          playsound(S_MALE_COMEONYOU+(krand_intercept("STAT2603")&6),sprptr[sn]->x,sprptr[sn]->y,0,ST_IMMEDIATE);
          sprXTptr[ext]->aimask|=AI_DIDAMBUSHYELL;
          break;
     case DIWALKPIC:
          playsound(S_DIM_WANTSOMETHIS+(krand_intercept("STAT2607")&2),sprptr[sn]->x,sprptr[sn]->y,0,ST_IMMEDIATE);
          sprXTptr[ext]->aimask|=AI_DIDAMBUSHYELL;
          break;
     }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movl %esi, %ebp
movl %edi, %ebx
callq 0x1cfc4
testl %eax, %eax
je 0x1eac3
leaq 0x63d51(%rip), %rdi     # 0x8280d
xorl %eax, %eax
callq 0x2acb8
cmpw $0x3fff, %bp            # imm = 0x3FFF
ja 0x1eb51
movzwl %bp, %r14d
leaq 0x1b0757(%rip), %r15    # 0x1cf230
movq (%r15,%r14,8), %rax
testb $0x2, 0x7(%rax)
jne 0x1eb51
movzwl 0xa(%rax), %eax
movl $0x97, %r12d
pushq $0x6
popq %rbp
leaq 0x63d30(%rip), %rdi     # 0x82827
cmpl $0x163, %eax            # imm = 0x163
je 0x1eb1c
cmpl $0x6d7, %eax            # imm = 0x6D7
je 0x1eb1c
cmpl $0x75f, %eax            # imm = 0x75F
jne 0x1eb51
movl $0xca, %r12d
pushq $0x2
popq %rbp
leaq 0x63d14(%rip), %rdi     # 0x82830
callq 0x2945b
andl %eax, %ebp
addl %r12d, %ebp
movswq %bx, %rax
leaq 0x1086ff(%rip), %rcx    # 0x127230
movq (%rcx,%rax,8), %rax
movl (%rax), %esi
movl 0x4(%rax), %edx
pushq $0x1
popq %r8
movl %ebp, %edi
xorl %ecx, %ecx
callq 0x1ab2a
movq (%r15,%r14,8), %rax
orw $0x200, 0x6(%rax)       # imm = 0x200
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/jonof[P]jftekwar/src/tekstat.c
// Function: givewarning
void
givewarning(short i, short ext)
{
     int dist = 0L;

    #ifdef PLRSPRDEBUG
     if( isaplayersprite(i) ) {
          crashgame("messing w plrsprite at 25");
     }
    #endif

     if( option[4] != 0 ) {
          return;
     }
     if( !validext(ext) ) {
          return;
     }
     if( sprXTptr[ext]->aimask&AI_GAVEWARNING )
          return;

     dist=abs(posx[screenpeek]-sprptr[i]->x)+abs(posy[screenpeek]-sprptr[i]->y);
     if( dist > 5000 ) {
          return;
     }

     switch( sprXTptr[ext]->basepic ) {
     case COP1WALKPIC:
          playsound(S_GRD_WHATDOINGHERE+(krand_intercept("STAT2636")&4),sprptr[i]->x,sprptr[i]->y,0,ST_UNIQUE);
          sprXTptr[ext]->aimask|=AI_GAVEWARNING;
          break;
     }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movl %esi, %ebp
movl %edi, %ebx
callq 0x1cfc4
testl %eax, %eax
je 0x1eb7d
leaq 0x63cc3(%rip), %rdi     # 0x82839
xorl %eax, %eax
callq 0x2acb8
cmpw $0x3fff, %bp            # imm = 0x3FFF
ja 0x1ec37
leaq 0xa8de9(%rip), %rax     # 0xc7978
cmpb $0x0, 0x4(%rax)
jne 0x1ec37
movzwl %bp, %r14d
leaq 0x1b068c(%rip), %r15    # 0x1cf230
movq (%r15,%r14,8), %rax
testb $0x40, 0x6(%rax)
jne 0x1ec37
leaq 0xbb8a5(%rip), %rcx     # 0xda45e
movswq (%rcx), %rcx
leaq 0xbb90c(%rip), %rdx     # 0xda4d0
movl (%rdx,%rcx,4), %edx
movswq %bx, %rbx
leaq 0x10865e(%rip), %r12    # 0x127230
movq (%r12,%rbx,8), %rsi
subl (%rsi), %edx
movl %edx, %edi
negl %edi
cmovsl %edx, %edi
leaq 0xbb92a(%rip), %rdx     # 0xda510
movl (%rdx,%rcx,4), %ecx
subl 0x4(%rsi), %ecx
movl %ecx, %edx
negl %edx
cmovsl %ecx, %edx
addl %edi, %edx
cmpl $0x1388, %edx           # imm = 0x1388
ja 0x1ec37
cmpw $0x45b, 0xa(%rax)       # imm = 0x45B
jne 0x1ec37
leaq 0x63c47(%rip), %rdi     # 0x82853
callq 0x2945b
andl $0x4, %eax
leal 0xc5(%rax), %edi
movq (%r12,%rbx,8), %rax
movl (%rax), %esi
movl 0x4(%rax), %edx
pushq $0x8
popq %r8
xorl %ecx, %ecx
callq 0x1ab2a
movq (%r15,%r14,8), %rax
orw $0x40, 0x6(%rax)
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/jonof[P]jftekwar/src/tekstat.c
// Function: isanandroid
int
isanandroid(int i)
{
	int	ext=sprptr[i]->extra;

    #ifdef PLRSPRDEBUG
     if( isaplayersprite(i) ) {
          crashgame("messing w plrsprite at 22");
     }
    #endif

     if( validext(ext) ) {
          if( ((sprXTptr[ext]->fxmask)&FX_ANDROID) != 0 ) {
               return(1);
          }
     }

     return(0);
}

// Assembly:
pushq %rbx
movslq %edi, %rdi
leaq 0x1081d4(%rip), %rax    # 0x127230
movq (%rax,%rdi,8), %rax
movzwl 0x2a(%rax), %ebx
callq 0x1cfc4
testl %eax, %eax
je 0x1f07b
leaq 0x6374a(%rip), %rdi     # 0x827be
xorl %eax, %eax
callq 0x2acb8
cmpw $0x3fff, %bx            # imm = 0x3FFF
ja 0x1f093
leaq 0x1b01a7(%rip), %rax    # 0x1cf230
movq (%rax,%rbx,8), %rax
testb $0x4, 0x4(%rax)
jne 0x1f097
xorl %eax, %eax
jmp 0x1f09a
pushq $0x1
popq %rax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/jonof[P]jftekwar/src/tekstat.c
// Function: isahologram
int
isahologram(int i)
{
	int	ext=sprptr[i]->extra;

    #ifdef PLRSPRDEBUG
     if( isaplayersprite(i) ) {
          crashgame("messing w plrsprite at 21");
     }
    #endif

     if( validext(ext) ) {
          if( ((sprXTptr[ext]->fxmask)&FX_HOLOGRAM) != 0 ) {
               return(1);
          }
     }

     return(0);
}

// Assembly:
pushq %rbx
movslq %edi, %rdi
leaq 0x108189(%rip), %rax    # 0x127230
movq (%rax,%rdi,8), %rax
movzwl 0x2a(%rax), %ebx
callq 0x1cfc4
testl %eax, %eax
je 0x1f0c6
leaq 0x636e5(%rip), %rdi     # 0x827a4
xorl %eax, %eax
callq 0x2acb8
cmpw $0x3fff, %bx            # imm = 0x3FFF
ja 0x1f0de
leaq 0x1b015c(%rip), %rax    # 0x1cf230
movq (%rax,%rbx,8), %rax
testb $0x8, 0x4(%rax)
jne 0x1f0e2
xorl %eax, %eax
jmp 0x1f0e5
pushq $0x1
popq %rax
popq %rbx
retq