// File: /workspace/github_c_makefile_star2_O3/jonof[P]jftekwar/src/tekstat.c
// Function: checkblastarea
void
checkblastarea(int spr)
{
     int      sect,i,j,nexti,xydist,zdist;

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

     sect=sprptr[spr]->sectnum;

     for( j=connecthead ; j >= 0 ; j=connectpoint2[j] ) {
	     xydist=klabs(sprptr[spr]->x-posx[j])+klabs(sprptr[spr]->y-posy[j]);
          zdist=klabs(sprptr[spr]->z-posz[j]);
          if( (xydist < 512) && (zdist < 10240) ) {
               changehealth(j, -5000);
          }
          else if( (xydist < 2048) && (zdist < 20480) ) {
               changehealth(j, -800);
          }
          else if( (xydist < 4096) && (zdist < 40960) ) {
               changehealth(j, -200);
          }
     }

    if( option[4] == 0 ) {
	for( i=headspritesect[sect]; i>=0; i=nexti ) {
		nexti = nextspritesect[i];
          if( (i != spr) && (!isaplayersprite(i)) ) {
               switch( sprptr[i]->statnum ) {
               case PLAYER:
               case BOMBPROJECTILESTAT:
               case BOMBPROJECTILESTAT2:
               case RUNTHRU:
               case INACTIVE:
               case DEATH:
                    break;
               default:
		          xydist=klabs(sprptr[spr]->x-sprptr[i]->x)+klabs(sprptr[spr]->y-sprptr[i]->y);
                    zdist=klabs(sprptr[spr]->z - sprptr[i]->z);
                    if( (xydist < 2560) && (zdist < 16384) ) {
                         damagesprite(i, -500);
                    }
                    break;
               }
          }
     }
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movl %edi, %ebx
callq 0x1eb81
testl %eax, %eax
je 0x2750d
leaq 0x694a7(%rip), %rdi     # 0x909ad
xorl %eax, %eax
callq 0x2eb88
movl %ebx, 0xc(%rsp)
movslq %ebx, %r15
leaq 0x109d15(%rip), %rax    # 0x131230
movq (%rax,%r15,8), %rax
movswq 0x18(%rax), %rax
movq %rax, 0x10(%rsp)
leaq 0x77e600(%rip), %rax    # 0x7a5b30
movl (%rax), %eax
testl %eax, %eax
js 0x275e2
leaq 0xbcf8f(%rip), %r13     # 0xe44d0
leaq 0xbcfc8(%rip), %rbp     # 0xe4510
leaq 0xbd001(%rip), %r14     # 0xe4550
leaq 0x77e5ea(%rip), %rbx    # 0x7a5b40
leaq 0x109cd3(%rip), %rcx    # 0x131230
movq (%rcx,%r15,8), %rcx
movl %eax, %r12d
movl (%rcx), %eax
subl (%r13,%r12,4), %eax
movl %eax, %edx
negl %edx
cmovsl %eax, %edx
movl 0x4(%rcx), %esi
subl (%rbp,%r12,4), %esi
movl %esi, %eax
negl %eax
cmovsl %esi, %eax
addl %edx, %eax
movl 0x8(%rcx), %edx
subl (%r14,%r12,4), %edx
movl %edx, %ecx
negl %ecx
cmovsl %edx, %ecx
cmpl $0x1ff, %eax            # imm = 0x1FF
ja 0x275a4
movw $0xec78, %dx            # imm = 0xEC78
cmpl $0x2800, %ecx           # imm = 0x2800
jb 0x275ca
cmpl $0x7ff, %eax            # imm = 0x7FF
ja 0x275b7
movw $0xfce0, %dx            # imm = 0xFCE0
cmpl $0x5000, %ecx           # imm = 0x5000
jb 0x275ca
cmpl $0xfff, %eax            # imm = 0xFFF
ja 0x275d6
movw $0xff38, %dx            # imm = 0xFF38
cmpl $0x9fff, %ecx           # imm = 0x9FFF
ja 0x275d6
movswl %dx, %esi
movswl %r12w, %edi
callq 0xa5e8
movl (%rbx,%r12,4), %eax
testl %eax, %eax
jns 0x27556
leaq 0xaa38f(%rip), %rax     # 0xd1978
cmpb $0x0, 0x4(%rax)
movl 0xc(%rsp), %ebx
je 0x27602
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x535d87(%rip), %rax    # 0x55d390
movq 0x10(%rsp), %rcx
movzwl (%rax,%rcx,2), %ebp
testw %bp, %bp
js 0x275f3
leaq 0x53fd82(%rip), %r13    # 0x5673a0
movzwl %bp, %r14d
movzwl (%r13,%r14,2), %ebp
cmpl %ebx, %r14d
je 0x27639
movl %r14d, %edi
callq 0x1eb81
testl %eax, %eax
je 0x27640
testw %bp, %bp
jns 0x2761e
jmp 0x275f3
leaq 0x109be9(%rip), %rax    # 0x131230
movq (%rax,%r14,8), %rax
movzwl 0x1a(%rax), %ecx
cmpl $0x196, %ecx            # imm = 0x196
jg 0x2766b
cmpl $0x8, %ecx
je 0x27639
cmpl $0x64, %ecx
je 0x27639
cmpl $0x12d, %ecx            # imm = 0x12D
je 0x27639
jmp 0x27683
cmpl $0x197, %ecx            # imm = 0x197
je 0x27639
cmpl $0x2ca, %ecx            # imm = 0x2CA
je 0x27639
cmpl $0x2cc, %ecx            # imm = 0x2CC
je 0x27639
leaq 0x109ba6(%rip), %rcx    # 0x131230
movq (%rcx,%r15,8), %rcx
movq (%rcx), %xmm0
movq (%rax), %xmm1
psubd %xmm1, %xmm0
movdqa %xmm0, %xmm1
psrad $0x1f, %xmm1
pxor %xmm1, %xmm0
psubd %xmm1, %xmm0
pshufd $0x55, %xmm0, %xmm1     # xmm1 = xmm0[1,1,1,1]
paddd %xmm0, %xmm1
movd %xmm1, %edx
movl 0x8(%rcx), %ecx
subl 0x8(%rax), %ecx
movl %ecx, %eax
negl %eax
cmovsl %ecx, %eax
cmpl $0x9ff, %edx            # imm = 0x9FF
ja 0x27639
cmpl $0x3fff, %eax           # imm = 0x3FFF
ja 0x27639
movl %r14d, %edi
movl $0xfffffe0c, %esi       # imm = 0xFFFFFE0C
callq 0x21ba2
jmp 0x27639