// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x20, %rsp
movw %di, %ax
movw %ax, -0x2(%rbp)
movl %esi, -0x8(%rbp)
movl %edx, -0xc(%rbp)
movl $0x0, -0x10(%rbp)
movswq -0x2(%rbp), %rcx
leaq 0x124608(%rip), %rax    # 0x12e760
movl (%rax,%rcx,4), %edx
movswq -0x2(%rbp), %rcx
leaq 0x123769(%rip), %rax    # 0x12d8d0
addl (%rax,%rcx,4), %edx
leaq 0x12375f(%rip), %rax    # 0x12d8d0
movl %edx, (%rax,%rcx,4)
movswq -0x2(%rbp), %rcx
leaq 0x1245e0(%rip), %rax    # 0x12e760
movl (%rax,%rcx,4), %edx
movswq -0x2(%rbp), %rcx
leaq 0x123601(%rip), %rax    # 0x12d790
addl (%rax,%rcx,4), %edx
leaq 0x1235f7(%rip), %rax    # 0x12d790
movl %edx, (%rax,%rcx,4)
movswq -0x2(%rbp), %rcx
leaq 0x123728(%rip), %rax    # 0x12d8d0
movl (%rax,%rcx,4), %eax
movl -0x8(%rbp), %ecx
subl $0x2200, %ecx           # imm = 0x2200
cmpl %ecx, %eax
jle 0xa2f9
movswq -0x2(%rbp), %rcx
leaq 0x1235c8(%rip), %rax    # 0x12d790
cmpl $0x0, (%rax,%rcx,4)
jge 0xa1e1
movswq -0x2(%rbp), %rcx
leaq 0x1235b6(%rip), %rax    # 0x12d790
movl $0x0, (%rax,%rcx,4)
movswq -0x2(%rbp), %rcx
leaq 0x1236e3(%rip), %rax    # 0x12d8d0
movl (%rax,%rcx,4), %eax
movl -0x8(%rbp), %ecx
subl $0x400, %ecx            # imm = 0x400
cmpl %ecx, %eax
jle 0xa228
movl -0x8(%rbp), %edx
subl $0x400, %edx            # imm = 0x400
movswq -0x2(%rbp), %rcx
leaq 0x1236be(%rip), %rax    # 0x12d8d0
movl %edx, (%rax,%rcx,4)
movswq -0x2(%rbp), %rcx
leaq 0x12453f(%rip), %rax    # 0x12e760
movl $0x0, (%rax,%rcx,4)
movswq -0x2(%rbp), %rcx
leaq 0x12355c(%rip), %rax    # 0x12d790
movl (%rax,%rcx,4), %eax
sarl $0xf, %eax
movl %eax, %ecx
movq %rcx, -0x18(%rbp)
subl $0x5, %eax
ja 0xa2d5
movq -0x18(%rbp), %rax
leaq 0xceb3c(%rip), %rcx     # 0xd8d90
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
jmp 0xa2e6
movl $0xffffff38, %esi       # imm = 0xFFFFFF38
movswl -0x2(%rbp), %edi
callq 0xa010
jmp 0xa2e6
movl $0xfffffe70, %esi       # imm = 0xFFFFFE70
movswl -0x2(%rbp), %edi
callq 0xa010
movl $0xffffff38, %esi       # imm = 0xFFFFFF38
movswl -0x2(%rbp), %edi
callq 0x9d40
movl %eax, -0x10(%rbp)
jmp 0xa2e6
movl $0xfffffce0, %esi       # imm = 0xFFFFFCE0
movswl -0x2(%rbp), %edi
callq 0xa010
movl $0xfffffe70, %esi       # imm = 0xFFFFFE70
movswl -0x2(%rbp), %edi
callq 0x9d40
movl %eax, -0x10(%rbp)
jmp 0xa2e6
movl $0xfffffc18, %esi       # imm = 0xFFFFFC18
movswl -0x2(%rbp), %edi
callq 0xa010
movl $0xfffffc18, %esi       # imm = 0xFFFFFC18
movswl -0x2(%rbp), %edi
callq 0x9d40
movl %eax, -0x10(%rbp)
jmp 0xa2e6
movl $0xffffd8f1, %esi       # imm = 0xFFFFD8F1
movswl -0x2(%rbp), %edi
callq 0x9d40
movl %eax, -0x10(%rbp)
movswq -0x2(%rbp), %rcx
leaq 0x12349e(%rip), %rax    # 0x12d790
movl $0x0, (%rax,%rcx,4)
cmpl $0x0, -0x10(%rbp)
je 0xa320
leaq 0x16e01a(%rip), %rax    # 0x178320
cmpl $0x0, (%rax)
je 0xa320
movswq -0x2(%rbp), %rcx
leaq 0x1243f9(%rip), %rax    # 0x12e710
movswl (%rax,%rcx,2), %edi
callq 0x14490
movswq -0x2(%rbp), %rcx
leaq 0x1235a4(%rip), %rax    # 0x12d8d0
movl (%rax,%rcx,4), %eax
movl -0xc(%rbp), %ecx
addl $0x400, %ecx            # imm = 0x400
cmpl %ecx, %eax
jge 0xa367
movl -0xc(%rbp), %edx
addl $0x400, %edx            # imm = 0x400
movswq -0x2(%rbp), %rcx
leaq 0x12357f(%rip), %rax    # 0x12d8d0
movl %edx, (%rax,%rcx,4)
movswq -0x2(%rbp), %rcx
leaq 0x124400(%rip), %rax    # 0x12e760
movl $0x0, (%rax,%rcx,4)
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax)