// File: /workspace/github_c_makefile_star2_O0/jonof[P]jftekwar/src/tekstat.c
// Function: playergunshot
void
playergunshot(int snum)
{
     int       j,nextj,ext;
     int      dist;

     if( !validplayer(snum) ) {
          crashgame("plgunsht: bad plrnum");
     }

	j=headspritestat[STROLL];
    	while( j != -1 ) {
		nextj = nextspritestat[j];

          ext=sprptr[j]->extra;
          if( !validext(ext) ) {
               noextcrashgame(j,103);
          }
     	dist = abs(sprptr[j]->x-posx[snum])+abs(sprptr[j]->y-posy[snum]);
 		if( dist < HEARGUNSHOTDIST ) {
               sprXTptr[ext]->aimask|=AI_JUSTSHOTAT;
          }

		j = nextj;
	}

	j=headspritestat[STANDING];
    	while( j != -1 ) {
		nextj = nextspritestat[j];

          ext=sprptr[j]->extra;
          if( !validext(ext) ) {
               noextcrashgame(j,105);
          }
     	dist = abs(sprptr[j]->x-posx[snum])+abs(sprptr[j]->y-posy[snum]);
 		if( dist < HEARGUNSHOTDIST ) {
               sprXTptr[ext]->aimask|=AI_JUSTSHOTAT;
          }

		j = nextj;
	}

	j=headspritestat[GUARD];
    	while( j != -1 ) {
		nextj = nextspritestat[j];

          ext=sprptr[j]->extra;
          if( !validext(ext) ) {
               noextcrashgame(j,106);
          }
     	dist = abs(sprptr[j]->x-posx[snum])+abs(sprptr[j]->y-posy[snum]);
 		if( dist < HEARGUNSHOTDIST ) {
               sprXTptr[ext]->aimask|=AI_JUSTSHOTAT;
          }

		j = nextj;
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movl %edi, -0x4(%rbp)
movl -0x4(%rbp), %edi
callq 0x11c50
cmpl $0x0, %eax
jne 0x30e16
leaq 0xa9751(%rip), %rdi     # 0xda560
movb $0x0, %al
callq 0x44240
leaq 0x587533(%rip), %rax    # 0x5b8350
movswl 0x1a2(%rax), %eax
movl %eax, -0x8(%rbp)
cmpl $-0x1, -0x8(%rbp)
je 0x30ef3
movslq -0x8(%rbp), %rcx
leaq 0x58fd24(%rip), %rax    # 0x5c0b60
movswl (%rax,%rcx,2), %eax
movl %eax, -0xc(%rbp)
movslq -0x8(%rbp), %rcx
leaq 0x149392(%rip), %rax    # 0x17a1e0
movq (%rax,%rcx,8), %rax
movswl 0x2a(%rax), %eax
movl %eax, -0x10(%rbp)
movl -0x10(%rbp), %edi
callq 0x2ae90
cmpl $0x0, %eax
jne 0x30e73
movl -0x8(%rbp), %edi
movl $0x67, %esi
callq 0x2b180
movslq -0x8(%rbp), %rcx
leaq 0x149362(%rip), %rax    # 0x17a1e0
movq (%rax,%rcx,8), %rax
movl (%rax), %eax
movslq -0x4(%rbp), %rdx
leaq 0xfc9c1(%rip), %rcx     # 0x12d850
subl (%rcx,%rdx,4), %eax
movl %eax, %ecx
negl %ecx
cmovnsl %ecx, %eax
movslq -0x8(%rbp), %rdx
leaq 0x14933c(%rip), %rcx    # 0x17a1e0
movq (%rcx,%rdx,8), %rcx
movl 0x4(%rcx), %ecx
movslq -0x4(%rbp), %rsi
leaq 0xfc9da(%rip), %rdx     # 0x12d890
subl (%rdx,%rsi,4), %ecx
movl %ecx, %edx
negl %edx
cmovnsl %edx, %ecx
addl %ecx, %eax
movl %eax, -0x14(%rbp)
cmpl $0x2800, -0x14(%rbp)    # imm = 0x2800
jge 0x30ee8
movslq -0x10(%rbp), %rcx
leaq 0x1f1307(%rip), %rax    # 0x2221e0
movq (%rax,%rcx,8), %rax
movzwl 0x6(%rax), %ecx
orl $0x4, %ecx
movw %cx, 0x6(%rax)
movl -0xc(%rbp), %eax
movl %eax, -0x8(%rbp)
jmp 0x30e27
leaq 0x587456(%rip), %rax    # 0x5b8350
movswl 0x192(%rax), %eax
movl %eax, -0x8(%rbp)
cmpl $-0x1, -0x8(%rbp)
je 0x30fd0
movslq -0x8(%rbp), %rcx
leaq 0x58fc47(%rip), %rax    # 0x5c0b60
movswl (%rax,%rcx,2), %eax
movl %eax, -0xc(%rbp)
movslq -0x8(%rbp), %rcx
leaq 0x1492b5(%rip), %rax    # 0x17a1e0
movq (%rax,%rcx,8), %rax
movswl 0x2a(%rax), %eax
movl %eax, -0x10(%rbp)
movl -0x10(%rbp), %edi
callq 0x2ae90
cmpl $0x0, %eax
jne 0x30f50
movl -0x8(%rbp), %edi
movl $0x69, %esi
callq 0x2b180
movslq -0x8(%rbp), %rcx
leaq 0x149285(%rip), %rax    # 0x17a1e0
movq (%rax,%rcx,8), %rax
movl (%rax), %eax
movslq -0x4(%rbp), %rdx
leaq 0xfc8e4(%rip), %rcx     # 0x12d850
subl (%rcx,%rdx,4), %eax
movl %eax, %ecx
negl %ecx
cmovnsl %ecx, %eax
movslq -0x8(%rbp), %rdx
leaq 0x14925f(%rip), %rcx    # 0x17a1e0
movq (%rcx,%rdx,8), %rcx
movl 0x4(%rcx), %ecx
movslq -0x4(%rbp), %rsi
leaq 0xfc8fd(%rip), %rdx     # 0x12d890
subl (%rdx,%rsi,4), %ecx
movl %ecx, %edx
negl %edx
cmovnsl %edx, %ecx
addl %ecx, %eax
movl %eax, -0x14(%rbp)
cmpl $0x2800, -0x14(%rbp)    # imm = 0x2800
jge 0x30fc5
movslq -0x10(%rbp), %rcx
leaq 0x1f122a(%rip), %rax    # 0x2221e0
movq (%rax,%rcx,8), %rax
movzwl 0x6(%rax), %ecx
orl $0x4, %ecx
movw %cx, 0x6(%rax)
movl -0xc(%rbp), %eax
movl %eax, -0x8(%rbp)
jmp 0x30f04
leaq 0x587379(%rip), %rax    # 0x5b8350
movswl 0x196(%rax), %eax
movl %eax, -0x8(%rbp)
cmpl $-0x1, -0x8(%rbp)
je 0x310ad
movslq -0x8(%rbp), %rcx
leaq 0x58fb6a(%rip), %rax    # 0x5c0b60
movswl (%rax,%rcx,2), %eax
movl %eax, -0xc(%rbp)
movslq -0x8(%rbp), %rcx
leaq 0x1491d8(%rip), %rax    # 0x17a1e0
movq (%rax,%rcx,8), %rax
movswl 0x2a(%rax), %eax
movl %eax, -0x10(%rbp)
movl -0x10(%rbp), %edi
callq 0x2ae90
cmpl $0x0, %eax
jne 0x3102d
movl -0x8(%rbp), %edi
movl $0x6a, %esi
callq 0x2b180
movslq -0x8(%rbp), %rcx
leaq 0x1491a8(%rip), %rax    # 0x17a1e0
movq (%rax,%rcx,8), %rax
movl (%rax), %eax
movslq -0x4(%rbp), %rdx
leaq 0xfc807(%rip), %rcx     # 0x12d850
subl (%rcx,%rdx,4), %eax
movl %eax, %ecx
negl %ecx
cmovnsl %ecx, %eax
movslq -0x8(%rbp), %rdx
leaq 0x149182(%rip), %rcx    # 0x17a1e0
movq (%rcx,%rdx,8), %rcx
movl 0x4(%rcx), %ecx
movslq -0x4(%rbp), %rsi
leaq 0xfc820(%rip), %rdx     # 0x12d890
subl (%rdx,%rsi,4), %ecx
movl %ecx, %edx
negl %edx
cmovnsl %edx, %ecx
addl %ecx, %eax
movl %eax, -0x14(%rbp)
cmpl $0x2800, -0x14(%rbp)    # imm = 0x2800
jge 0x310a2
movslq -0x10(%rbp), %rcx
leaq 0x1f114d(%rip), %rax    # 0x2221e0
movq (%rax,%rcx,8), %rax
movzwl 0x6(%rax), %ecx
orl $0x4, %ecx
movw %cx, 0x6(%rax)
movl -0xc(%rbp), %eax
movl %eax, -0x8(%rbp)
jmp 0x30fe1
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)