// File: /workspace/github_c_makefile_star2_O0/jonof[P]jftekwar/src/tekstat.c
// Function: enemynewsector
void
enemynewsector(int i)
{
	int	ext=sprptr[i]->extra;

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

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

     if( ensfirsttime == 1 ) {
          ensfirsttime=0;
          return;
     }

     switch( sectptr[sprptr[i]->sectnum]->lotag ) {
     case 4:
          playsound(S_SPLASH,sprptr[i]->x,sprptr[i]->y,0,ST_UPDATE);
          break;
     default:
          break;
     }
     switch( sectptr[sprptr[i]->sectnum]->hitag ) {
     case 1010:
     case 1011:
     case 1012:
     case 1013:
     case 1014:
     case 1015:
     case 1016:
     case 1017:
     case 1018:
     case 1019:
          if( isahologram(i) ) {
               jsdeletesprite(i);
               return;
          }
          if( tekexplodebody(i) ) {
               missionaccomplished(i);
          }
          playsound(S_BUSHIT, sprptr[i]->x,sprptr[i]->y, 0, ST_UPDATE);
          if( validext(ext) ) {
         	     switch( sprXTptr[ext]->basepic ) {
			case ERWALKPIC:
                 playsound(S_MANDIE1+RMOD4("STAT2615")+RMOD3("STAT2615"),sprptr[i]->x,sprptr[i]->y,0,ST_UPDATE);
          		break;
			case SARAHWALKPIC:
                 playsound(S_GIRLDIE1+RMOD4("STAT2618")+RMOD3("STAT2618"),sprptr[i]->x,sprptr[i]->y,0,ST_UPDATE);
          	     break;
			case SAMWALKPIC:
                 playsound(S_MANDIE1+RMOD4("STAT2621")+RMOD3("STAT2621"),sprptr[i]->x,sprptr[i]->y,0,ST_UPDATE);
          	     break;
         		}
    		}
          jsdeletesprite(i);
          break;
     default:
          operatesector(sprptr[i]->sectnum);  // JEFF TEST
          break;
     }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movl %edi, -0x4(%rbp)
movslq -0x4(%rbp), %rcx
leaq 0x1482ba(%rip), %rax    # 0x17a1e0
movq (%rax,%rcx,8), %rax
movswl 0x2a(%rax), %eax
movl %eax, -0x8(%rbp)
leaq 0xe7fe0(%rip), %rax     # 0x119f18
movzbl 0x4(%rax), %eax
cmpl $0x0, %eax
je 0x31f46
jmp 0x322c3
movl -0x4(%rbp), %edi
callq 0x2aec0
cmpl $0x0, %eax
je 0x31f61
leaq 0xa869a(%rip), %rdi     # 0xda5f4
movb $0x0, %al
callq 0x44240
movsbl 0xe8f0a(%rip), %eax     # 0x11ae72
cmpl $0x1, %eax
jne 0x31f79
movb $0x0, 0xe8efe(%rip)     # 0x11ae72
jmp 0x322c3
movslq -0x4(%rbp), %rcx
leaq 0x14825c(%rip), %rax    # 0x17a1e0
movq (%rax,%rcx,8), %rax
movswq 0x18(%rax), %rcx
leaq 0x21024c(%rip), %rax    # 0x2421e0
movq (%rax,%rcx,8), %rax
movw 0x22(%rax), %ax
subw $0x4, %ax
jne 0x31fdb
jmp 0x31fa4
movslq -0x4(%rbp), %rcx
leaq 0x148231(%rip), %rax    # 0x17a1e0
movq (%rax,%rcx,8), %rax
movl (%rax), %esi
movslq -0x4(%rbp), %rcx
leaq 0x148220(%rip), %rax    # 0x17a1e0
movq (%rax,%rcx,8), %rax
movl 0x4(%rax), %edx
movl $0xb, %edi
xorl %ecx, %ecx
movl $0x2, %r8d
callq 0x26af0
jmp 0x31fdd
jmp 0x31fdd
movslq -0x4(%rbp), %rcx
leaq 0x1481f8(%rip), %rax    # 0x17a1e0
movq (%rax,%rcx,8), %rax
movswq 0x18(%rax), %rcx
leaq 0x2101e8(%rip), %rax    # 0x2421e0
movq (%rax,%rcx,8), %rax
movswl 0x24(%rax), %eax
addl $0xfffffc0e, %eax       # imm = 0xFFFFFC0E
subl $0x9, %eax
ja 0x322ab
jmp 0x32010
movl -0x4(%rbp), %edi
callq 0x2ed00
cmpl $0x0, %eax
je 0x3202d
movl -0x4(%rbp), %eax
movswl %ax, %edi
callq 0x2ae00
jmp 0x322c3
movl -0x4(%rbp), %edi
callq 0x14490
cmpl $0x0, %eax
je 0x32042
movl -0x4(%rbp), %edi
callq 0x21bb0
movslq -0x4(%rbp), %rcx
leaq 0x148193(%rip), %rax    # 0x17a1e0
movq (%rax,%rcx,8), %rax
movl (%rax), %esi
movslq -0x4(%rbp), %rcx
leaq 0x148182(%rip), %rax    # 0x17a1e0
movq (%rax,%rcx,8), %rax
movl 0x4(%rax), %edx
movl $0x6b, %edi
xorl %ecx, %ecx
movl $0x2, %r8d
callq 0x26af0
movl -0x8(%rbp), %edi
callq 0x2ae90
cmpl $0x0, %eax
je 0x3229e
movslq -0x8(%rbp), %rcx
leaq 0x1f014d(%rip), %rax    # 0x2221e0
movq (%rax,%rcx,8), %rax
movzwl 0xa(%rax), %eax
movl %eax, -0xc(%rbp)
subl $0x709, %eax            # imm = 0x709
je 0x32167
jmp 0x320ab
movl -0xc(%rbp), %eax
subl $0x79e, %eax            # imm = 0x79E
je 0x320ca
jmp 0x320b7
movl -0xc(%rbp), %eax
subl $0x7d3, %eax            # imm = 0x7D3
je 0x32204
jmp 0x3229c
leaq 0xa853d(%rip), %rdi     # 0xda60e
callq 0x41510
sarl $0x3, %eax
andl $0xf, %eax
cltq
andq $0x3, %rax
addq $0x81, %rax
movq %rax, -0x18(%rbp)
leaq 0xa851b(%rip), %rdi     # 0xda60e
callq 0x41510
cmpl $0x8000, %eax           # imm = 0x8000
setg %al
andb $0x1, %al
movzbl %al, %eax
cltq
movq %rax, -0x20(%rbp)
leaq 0xa84fc(%rip), %rdi     # 0xda60e
callq 0x41510
movq -0x20(%rbp), %rcx
movl %eax, %edx
movq -0x18(%rbp), %rax
sarl %edx
movslq %edx, %rdx
andq $0x1, %rdx
addq %rdx, %rcx
addq %rcx, %rax
movl %eax, %edi
movslq -0x4(%rbp), %rcx
leaq 0x1480a3(%rip), %rax    # 0x17a1e0
movq (%rax,%rcx,8), %rax
movl (%rax), %esi
movslq -0x4(%rbp), %rcx
leaq 0x148092(%rip), %rax    # 0x17a1e0
movq (%rax,%rcx,8), %rax
movl 0x4(%rax), %edx
xorl %ecx, %ecx
movl $0x2, %r8d
callq 0x26af0
jmp 0x3229c
leaq 0xa84a9(%rip), %rdi     # 0xda617
callq 0x41510
sarl $0x3, %eax
andl $0xf, %eax
cltq
andq $0x3, %rax
addq $0x8b, %rax
movq %rax, -0x28(%rbp)
leaq 0xa8487(%rip), %rdi     # 0xda617
callq 0x41510
cmpl $0x8000, %eax           # imm = 0x8000
setg %al
andb $0x1, %al
movzbl %al, %eax
cltq
movq %rax, -0x30(%rbp)
leaq 0xa8468(%rip), %rdi     # 0xda617
callq 0x41510
movq -0x30(%rbp), %rcx
movl %eax, %edx
movq -0x28(%rbp), %rax
sarl %edx
movslq %edx, %rdx
andq $0x1, %rdx
addq %rdx, %rcx
addq %rcx, %rax
movl %eax, %edi
movslq -0x4(%rbp), %rcx
leaq 0x148006(%rip), %rax    # 0x17a1e0
movq (%rax,%rcx,8), %rax
movl (%rax), %esi
movslq -0x4(%rbp), %rcx
leaq 0x147ff5(%rip), %rax    # 0x17a1e0
movq (%rax,%rcx,8), %rax
movl 0x4(%rax), %edx
xorl %ecx, %ecx
movl $0x2, %r8d
callq 0x26af0
jmp 0x3229c
leaq 0xa8415(%rip), %rdi     # 0xda620
callq 0x41510
sarl $0x3, %eax
andl $0xf, %eax
cltq
andq $0x3, %rax
addq $0x81, %rax
movq %rax, -0x38(%rbp)
leaq 0xa83f3(%rip), %rdi     # 0xda620
callq 0x41510
cmpl $0x8000, %eax           # imm = 0x8000
setg %al
andb $0x1, %al
movzbl %al, %eax
cltq
movq %rax, -0x40(%rbp)
leaq 0xa83d4(%rip), %rdi     # 0xda620
callq 0x41510
movq -0x40(%rbp), %rcx
movl %eax, %edx
movq -0x38(%rbp), %rax
sarl %edx
movslq %edx, %rdx
andq $0x1, %rdx
addq %rdx, %rcx
addq %rcx, %rax
movl %eax, %edi
movslq -0x4(%rbp), %rcx
leaq 0x147f69(%rip), %rax    # 0x17a1e0
movq (%rax,%rcx,8), %rax
movl (%rax), %esi
movslq -0x4(%rbp), %rcx
leaq 0x147f58(%rip), %rax    # 0x17a1e0
movq (%rax,%rcx,8), %rax
movl 0x4(%rax), %edx
xorl %ecx, %ecx
movl $0x2, %r8d
callq 0x26af0
jmp 0x3229e
movl -0x4(%rbp), %eax
movswl %ax, %edi
callq 0x2ae00
jmp 0x322c3
movslq -0x4(%rbp), %rcx
leaq 0x147f2a(%rip), %rax    # 0x17a1e0
movq (%rax,%rcx,8), %rax
movswl 0x18(%rax), %edi
callq 0x39e20
addq $0x40, %rsp
popq %rbp
retq
nopl (%rax)