// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x30, %rsp
movl %edi, -0x4(%rbp)
movl -0x4(%rbp), %edi
callq 0x2aec0
cmpl $0x0, %eax
je 0x39186
leaq 0xa15ae(%rip), %rdi     # 0xda72d
movb $0x0, %al
callq 0x44240
movslq -0x4(%rbp), %rcx
leaq 0x14104f(%rip), %rax    # 0x17a1e0
movq (%rax,%rcx,8), %rax
movswl 0x18(%rax), %eax
movl %eax, -0x8(%rbp)
leaq 0x76bdad(%rip), %rax    # 0x7a4f50
movl (%rax), %eax
movl %eax, -0x10(%rbp)
cmpl $0x0, -0x10(%rbp)
jl 0x392b6
movslq -0x4(%rbp), %rcx
leaq 0x141023(%rip), %rax    # 0x17a1e0
movq (%rax,%rcx,8), %rax
movl (%rax), %edi
movslq -0x10(%rbp), %rcx
leaq 0xf4682(%rip), %rax     # 0x12d850
subl (%rax,%rcx,4), %edi
callq 0x39440
movl %eax, -0x20(%rbp)
movslq -0x4(%rbp), %rcx
leaq 0x140ffc(%rip), %rax    # 0x17a1e0
movq (%rax,%rcx,8), %rax
movl 0x4(%rax), %edi
movslq -0x10(%rbp), %rcx
leaq 0xf469a(%rip), %rax     # 0x12d890
subl (%rax,%rcx,4), %edi
callq 0x39440
movl %eax, %ecx
movl -0x20(%rbp), %eax
addl %ecx, %eax
movl %eax, -0x18(%rbp)
movslq -0x4(%rbp), %rcx
leaq 0x140fcd(%rip), %rax    # 0x17a1e0
movq (%rax,%rcx,8), %rax
movl 0x8(%rax), %edi
movslq -0x10(%rbp), %rcx
leaq 0xf46ab(%rip), %rax     # 0x12d8d0
subl (%rax,%rcx,4), %edi
callq 0x39440
movl %eax, -0x1c(%rbp)
cmpl $0x200, -0x18(%rbp)     # imm = 0x200
jge 0x39254
cmpl $0x2800, -0x1c(%rbp)    # imm = 0x2800
jge 0x39254
movl -0x10(%rbp), %eax
movl $0xffffec78, %esi       # imm = 0xFFFFEC78
movswl %ax, %edi
callq 0x9d40
jmp 0x3929e
cmpl $0x800, -0x18(%rbp)     # imm = 0x800
jge 0x39278
cmpl $0x5000, -0x1c(%rbp)    # imm = 0x5000
jge 0x39278
movl -0x10(%rbp), %eax
movl $0xfffffce0, %esi       # imm = 0xFFFFFCE0
movswl %ax, %edi
callq 0x9d40
jmp 0x3929c
cmpl $0x1000, -0x18(%rbp)    # imm = 0x1000
jge 0x3929a
cmpl $0xa000, -0x1c(%rbp)    # imm = 0xA000
jge 0x3929a
movl -0x10(%rbp), %eax
movl $0xffffff38, %esi       # imm = 0xFFFFFF38
movswl %ax, %edi
callq 0x9d40
jmp 0x3929c
jmp 0x3929e
jmp 0x392a0
movslq -0x10(%rbp), %rcx
leaq 0x76bcb5(%rip), %rax    # 0x7a4f60
movl (%rax,%rcx,4), %eax
movl %eax, -0x10(%rbp)
jmp 0x391a8
leaq 0xe0c5b(%rip), %rax     # 0x119f18
movzbl 0x4(%rax), %eax
cmpl $0x0, %eax
jne 0x3942c
movslq -0x8(%rbp), %rcx
leaq 0x56d06b(%rip), %rax    # 0x5a6340
movswl (%rax,%rcx,2), %eax
movl %eax, -0xc(%rbp)
cmpl $0x0, -0xc(%rbp)
jl 0x3942a
movslq -0xc(%rbp), %rcx
leaq 0x57705f(%rip), %rax    # 0x5b0350
movswl (%rax,%rcx,2), %eax
movl %eax, -0x14(%rbp)
movl -0xc(%rbp), %eax
cmpl -0x4(%rbp), %eax
je 0x3941d
movl -0xc(%rbp), %edi
callq 0x2aec0
cmpl $0x0, %eax
jne 0x3941d
movslq -0xc(%rbp), %rcx
leaq 0x140ec0(%rip), %rax    # 0x17a1e0
movq (%rax,%rcx,8), %rax
movswl 0x1a(%rax), %eax
movl %eax, -0x24(%rbp)
subl $0x8, %eax
je 0x3936c
jmp 0x39332
movl -0x24(%rbp), %eax
subl $0x64, %eax
je 0x3936c
jmp 0x3933c
movl -0x24(%rbp), %eax
subl $0x12d, %eax            # imm = 0x12D
je 0x3936c
jmp 0x39348
movl -0x24(%rbp), %eax
subl $0x197, %eax            # imm = 0x197
je 0x3936c
jmp 0x39354
movl -0x24(%rbp), %eax
subl $0x2ca, %eax            # imm = 0x2CA
je 0x3936c
jmp 0x39360
movl -0x24(%rbp), %eax
subl $0x2cc, %eax            # imm = 0x2CC
jne 0x39371
jmp 0x3936c
jmp 0x3941b
movslq -0x4(%rbp), %rcx
leaq 0x140e64(%rip), %rax    # 0x17a1e0
movq (%rax,%rcx,8), %rax
movl (%rax), %edi
movslq -0xc(%rbp), %rcx
leaq 0x140e53(%rip), %rax    # 0x17a1e0
movq (%rax,%rcx,8), %rax
subl (%rax), %edi
callq 0x39440
movl %eax, -0x28(%rbp)
movslq -0x4(%rbp), %rcx
leaq 0x140e3a(%rip), %rax    # 0x17a1e0
movq (%rax,%rcx,8), %rax
movl 0x4(%rax), %edi
movslq -0xc(%rbp), %rcx
leaq 0x140e28(%rip), %rax    # 0x17a1e0
movq (%rax,%rcx,8), %rax
subl 0x4(%rax), %edi
callq 0x39440
movl %eax, %ecx
movl -0x28(%rbp), %eax
addl %ecx, %eax
movl %eax, -0x18(%rbp)
movslq -0x4(%rbp), %rcx
leaq 0x140e07(%rip), %rax    # 0x17a1e0
movq (%rax,%rcx,8), %rax
movl 0x8(%rax), %edi
movslq -0xc(%rbp), %rcx
leaq 0x140df5(%rip), %rax    # 0x17a1e0
movq (%rax,%rcx,8), %rax
subl 0x8(%rax), %edi
callq 0x39440
movl %eax, -0x1c(%rbp)
cmpl $0xa00, -0x18(%rbp)     # imm = 0xA00
jge 0x39419
cmpl $0x4000, -0x1c(%rbp)    # imm = 0x4000
jge 0x39419
movl -0xc(%rbp), %edi
movl $0xfffffe0c, %esi       # imm = 0xFFFFFE0C
callq 0x30230
jmp 0x3941b
jmp 0x3941d
jmp 0x3941f
movl -0x14(%rbp), %eax
movl %eax, -0xc(%rbp)
jmp 0x392dc
jmp 0x3942c
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)