// File: /workspace/github_c_makefile_star2_O2/jonof[P]jftekwar/src/tekchng.c
// Function: tekchangefallz
void
tekchangefallz(short snum,int loz,int hiz)
{
     int  died=0;

     posz[snum]+=hvel[snum];

     fallz[snum]+=hvel[snum];
     if (posz[snum] > loz-(KENSPLAYERHEIGHT<<8)) {
          if (fallz[snum] < 0) {
               fallz[snum]=0;
          }
          if (posz[snum] > loz-(4<<8)) {
               posz[snum]=loz-(4<<8);
               hvel[snum]=0;
          }
          switch (fallz[snum]>>15) {
          case 0:
          case 1:
               break;
          case 2:
               tekchangestun(snum,-200);
               break;
          case 3:
               tekchangestun(snum,-400);
               died=changehealth(snum,-200);
               break;
          case 4:
               tekchangestun(snum,-800);
               died=changehealth(snum,-400);
               break;
          case 5:
               tekchangestun(snum,-1000);
               died=changehealth(snum,-1000);
               break;
          default:
               died=changehealth(snum,-9999);
               break;
          }
          fallz[snum]=0;
     }
     if (died && goreflag) {
          tekexplodebody(playersprite[snum]);
     }

     if (posz[snum] < hiz+(4<<8)) {
          posz[snum]=hiz+(4<<8);
          hvel[snum]=0;
     }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %edx, %ebx
movslq %edi, %r14
leaq 0xd1be5(%rip), %r15     # 0xdb7a0
movl (%r15,%r14,4), %eax
leaq 0xd098a(%rip), %r12     # 0xda550
movl (%r12,%r14,4), %ecx
addl %eax, %ecx
leaq 0xd083d(%rip), %r13     # 0xda410
addl (%r13,%r14,4), %eax
movl %ecx, (%r12,%r14,4)
movl %eax, (%r13,%r14,4)
leal -0x2200(%rsi), %edx
cmpl %edx, %ecx
jle 0x9cb9
testl %eax, %eax
jns 0x9bfb
andl $0x0, (%r13,%r14,4)
xorl %eax, %eax
addl $0xfffffc00, %esi       # imm = 0xFFFFFC00
cmpl %esi, %ecx
jle 0x9c0e
movl %esi, (%r12,%r14,4)
andl $0x0, (%r15,%r14,4)
shrl $0xf, %eax
cmpw $0x5, %ax
ja 0x9c6b
xorl %ebp, %ebp
movzwl %ax, %eax
leaq 0x7716d(%rip), %rcx     # 0x80d90
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movswl %di, %edi
movl $0xffffff38, %esi       # imm = 0xFFFFFF38
callq 0x9b14
jmp 0x9c92
movswl %di, %ebp
movl %ebp, %edi
movl $0xfffffe70, %esi       # imm = 0xFFFFFE70
callq 0x9b14
movl %ebp, %edi
movl $0xffffff38, %esi       # imm = 0xFFFFFF38
jmp 0x9c8b
movswl %di, %ebp
movl %ebp, %edi
movl $0xfffffc18, %esi       # imm = 0xFFFFFC18
callq 0x9b14
movl %ebp, %edi
movl $0xfffffc18, %esi       # imm = 0xFFFFFC18
jmp 0x9c8b
movswl %di, %edi
movl $0xffffd8f1, %esi       # imm = 0xFFFFD8F1
jmp 0x9c8b
movswl %di, %ebp
movl %ebp, %edi
movl $0xfffffce0, %esi       # imm = 0xFFFFFCE0
callq 0x9b14
movl %ebp, %edi
movl $0xfffffe70, %esi       # imm = 0xFFFFFE70
callq 0x99a8
movl %eax, %ebp
andl $0x0, (%r13,%r14,4)
testl %ebp, %ebp
je 0x9cb9
leaq 0x11b6bd(%rip), %rax    # 0x125360
cmpl $0x0, (%rax)
je 0x9cb9
leaq 0xd1aa1(%rip), %rax     # 0xdb750
movswl (%rax,%r14,2), %edi
callq 0xf8a2
addl $0x400, %ebx            # imm = 0x400
cmpl %ebx, (%r12,%r14,4)
jge 0x9cce
movl %ebx, (%r12,%r14,4)
andl $0x0, (%r15,%r14,4)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nopl (%rax)