// File: /workspace/github_c_makefile_star2_O0/jonof[P]jftekwar/src/tekstat.c
// Function: fleescream
void
fleescream(short sn, short ext)
{
    #ifdef PLRSPRDEBUG
     if( isaplayersprite(sn) ) {
          crashgame("messing w plrsprite at 9");
     }
    #endif

     if( !validext(ext) ) {
          return;
     }

     if( (sprXTptr[ext]->aimask&AI_DIDFLEESCREAM) && (krand_intercept("STAT1417")&1) )
          return;

     switch( sprXTptr[ext]->basepic ) {
     case ERWALKPIC:
          playsound(S_MALE_OHMYGOD+(krand_intercept("STAT1424")&5),sprptr[sn]->x,sprptr[sn]->y,0,ST_UNIQUE);
          if(krand_intercept("STAT1425")&1) {
               sprXTptr[ext]->aimask|=AI_DIDFLEESCREAM;
          }
          break;
     case SARAHWALKPIC:
     case SAMWALKPIC:
          switch( RMOD4("STAT1478") ) {
		case 0:
          case 2:
               playsound(S_FEM_RUNHEGOTGUN+(krand_intercept("STAT1434")&11),sprptr[sn]->x,sprptr[sn]->y,0,ST_UNIQUE);
               break;
          default:
              playsound(S_SCREAM1+RMOD3("STAT1484"),sprptr[sn]->x,sprptr[sn]->y,0,ST_UNIQUE);
               break;
          }
          if(krand_intercept("STAT1440")&1) {
               sprXTptr[ext]->aimask|=AI_DIDFLEESCREAM;
          }
          break;
     }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movw %si, %ax
movw %di, %cx
movw %cx, -0x2(%rbp)
movw %ax, -0x4(%rbp)
movswl -0x2(%rbp), %edi
callq 0x2aec0
cmpl $0x0, %eax
je 0x2fdf2
leaq 0xaa657(%rip), %rdi     # 0xda442
movb $0x0, %al
callq 0x44240
movswl -0x4(%rbp), %edi
callq 0x2ae90
cmpl $0x0, %eax
jne 0x2fe05
jmp 0x30007
movswq -0x4(%rbp), %rcx
leaq 0x1f23cf(%rip), %rax    # 0x2221e0
movq (%rax,%rcx,8), %rax
movzwl 0x6(%rax), %eax
andl $0x100, %eax            # imm = 0x100
cmpl $0x0, %eax
je 0x2fe3c
leaq 0xaa631(%rip), %rdi     # 0xda45b
callq 0x41510
andl $0x1, %eax
cmpl $0x0, %eax
je 0x2fe3c
jmp 0x30007
movswq -0x4(%rbp), %rcx
leaq 0x1f2398(%rip), %rax    # 0x2221e0
movq (%rax,%rcx,8), %rax
movzwl 0xa(%rax), %eax
movl %eax, -0x8(%rbp)
subl $0x709, %eax            # imm = 0x709
je 0x2feff
jmp 0x2fe60
movl -0x8(%rbp), %eax
subl $0x79e, %eax            # imm = 0x79E
je 0x2fe7f
jmp 0x2fe6c
movl -0x8(%rbp), %eax
subl $0x7d3, %eax            # imm = 0x7D3
je 0x2feff
jmp 0x30007
leaq 0xaa5de(%rip), %rdi     # 0xda464
callq 0x41510
movl %eax, %edi
andl $0x5, %edi
addl $0xa3, %edi
movswq -0x2(%rbp), %rcx
leaq 0x14a33e(%rip), %rax    # 0x17a1e0
movq (%rax,%rcx,8), %rax
movl (%rax), %esi
movswq -0x2(%rbp), %rcx
leaq 0x14a32c(%rip), %rax    # 0x17a1e0
movq (%rax,%rcx,8), %rax
movl 0x4(%rax), %edx
xorl %ecx, %ecx
movl $0x8, %r8d
callq 0x26af0
leaq 0xaa59e(%rip), %rdi     # 0xda46d
callq 0x41510
andl $0x1, %eax
cmpl $0x0, %eax
je 0x2fefa
movswq -0x4(%rbp), %rcx
leaq 0x1f22f8(%rip), %rax    # 0x2221e0
movq (%rax,%rcx,8), %rax
movzwl 0x6(%rax), %ecx
orl $0x100, %ecx            # imm = 0x100
movw %cx, 0x6(%rax)
jmp 0x30007
leaq 0xaa570(%rip), %rdi     # 0xda476
callq 0x41510
btl $0x3, %eax
jae 0x2ff13
jmp 0x2ff5e
leaq 0xaa565(%rip), %rdi     # 0xda47f
callq 0x41510
movl %eax, %edi
andl $0xb, %edi
addl $0xaf, %edi
movswq -0x2(%rbp), %rcx
leaq 0x14a2aa(%rip), %rax    # 0x17a1e0
movq (%rax,%rcx,8), %rax
movl (%rax), %esi
movswq -0x2(%rbp), %rcx
leaq 0x14a298(%rip), %rax    # 0x17a1e0
movq (%rax,%rcx,8), %rax
movl 0x4(%rax), %edx
xorl %ecx, %ecx
movl $0x8, %r8d
callq 0x26af0
jmp 0x2ffd3
leaq 0xaa523(%rip), %rdi     # 0xda488
callq 0x41510
cmpl $0x8000, %eax           # imm = 0x8000
setg %al
andb $0x1, %al
movzbl %al, %eax
cltq
movq %rax, -0x10(%rbp)
leaq 0xaa504(%rip), %rdi     # 0xda488
callq 0x41510
movl %eax, %ecx
movq -0x10(%rbp), %rax
sarl %ecx
movslq %ecx, %rcx
andq $0x1, %rcx
addq %rcx, %rax
addq $0x7d, %rax
movl %eax, %edi
movswq -0x2(%rbp), %rcx
leaq 0x14a233(%rip), %rax    # 0x17a1e0
movq (%rax,%rcx,8), %rax
movl (%rax), %esi
movswq -0x2(%rbp), %rcx
leaq 0x14a221(%rip), %rax    # 0x17a1e0
movq (%rax,%rcx,8), %rax
movl 0x4(%rax), %edx
xorl %ecx, %ecx
movl $0x8, %r8d
callq 0x26af0
leaq 0xaa4b7(%rip), %rdi     # 0xda491
callq 0x41510
andl $0x1, %eax
cmpl $0x0, %eax
je 0x30005
movswq -0x4(%rbp), %rcx
leaq 0x1f21ed(%rip), %rax    # 0x2221e0
movq (%rax,%rcx,8), %rax
movzwl 0x6(%rax), %ecx
orl $0x100, %ecx            # imm = 0x100
movw %cx, 0x6(%rax)
jmp 0x30007
addq $0x10, %rsp
popq %rbp
retq
nopl (%rax)