// File: /workspace/github_c_makefile_star2_O0/jonof[P]jftekwar/src/tekspr.c
// Function: floatmovesprite
short
floatmovesprite(short spritenum, int dx, int dy, int dz, int ceildist, int flordist, char cliptype)
{
     int daz, zoffs;
     short retval, dasectnum;
     unsigned int dcliptype;
     spritetype *spr;

     (void)dz;

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

     switch (cliptype) {
          case NORMALCLIP: dcliptype = CLIPMASK0; break;
          case PROJECTILECLIP: dcliptype = CLIPMASK1; break;
          case CLIFFCLIP: dcliptype = CLIPMASK0; break;
     }

     spr = &sprite[spritenum];

     if ((spr->cstat&128) == 0)
          zoffs = -((tilesizy[spr->picnum]*spr->yrepeat)<<1);
     else
          zoffs = 0;

     dasectnum = spr->sectnum;  //Can't modify sprite sectors directly becuase of linked lists
     daz = spr->z+zoffs;  //Must do this if not using the new centered centering (of course)
     retval = clipmove(&spr->x,&spr->y,&daz,&dasectnum,dx,dy,
                                   ((int)spr->clipdist)<<2,ceildist,flordist,dcliptype);

     if ((dasectnum != spr->sectnum) && (dasectnum >= 0))
          changespritesect(spritenum,dasectnum);

     return(retval);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
subq $0x58, %rsp
movw %di, %ax
movb 0x10(%rbp), %dil
movw %ax, -0xa(%rbp)
movl %esi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
movl %ecx, -0x18(%rbp)
movl %r8d, -0x1c(%rbp)
movl %r9d, -0x20(%rbp)
movsbl 0x10(%rbp), %eax
movl %eax, -0x3c(%rbp)
testl %eax, %eax
je 0x285b6
jmp 0x285a2
movl -0x3c(%rbp), %eax
subl $0x1, %eax
je 0x285bf
jmp 0x285ac
movl -0x3c(%rbp), %eax
subl $0x2, %eax
je 0x285c8
jmp 0x285cf
movl $0x10001, -0x30(%rbp)   # imm = 0x10001
jmp 0x285cf
movl $0x1000040, -0x30(%rbp) # imm = 0x1000040
jmp 0x285cf
movl $0x10001, -0x30(%rbp)   # imm = 0x10001
movswq -0xa(%rbp), %rcx
leaq 0x44e505(%rip), %rax    # 0x476ae0
imulq $0x2c, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0x38(%rbp)
movq -0x38(%rbp), %rax
movswl 0xc(%rax), %eax
andl $0x80, %eax
cmpl $0x0, %eax
jne 0x28622
movq -0x38(%rbp), %rax
movswq 0xe(%rax), %rcx
leaq 0x5d1208(%rip), %rax    # 0x5f9810
movswl (%rax,%rcx,2), %ecx
movq -0x38(%rbp), %rax
movzbl 0x15(%rax), %eax
imull %eax, %ecx
shll %ecx
xorl %eax, %eax
subl %ecx, %eax
movl %eax, -0x28(%rbp)
jmp 0x28629
movl $0x0, -0x28(%rbp)
movq -0x38(%rbp), %rax
movw 0x18(%rax), %ax
movw %ax, -0x2c(%rbp)
movq -0x38(%rbp), %rax
movl 0x8(%rax), %eax
addl -0x28(%rbp), %eax
movl %eax, -0x24(%rbp)
movq -0x38(%rbp), %rdi
movq -0x38(%rbp), %rsi
addq $0x4, %rsi
movl -0x10(%rbp), %r8d
movl -0x14(%rbp), %r9d
movq -0x38(%rbp), %rax
movzbl 0x12(%rax), %ebx
shll $0x2, %ebx
movl -0x1c(%rbp), %r11d
movl -0x20(%rbp), %r10d
movl -0x30(%rbp), %eax
leaq -0x24(%rbp), %rdx
leaq -0x2c(%rbp), %rcx
movl %ebx, (%rsp)
movl %r11d, 0x8(%rsp)
movl %r10d, 0x10(%rsp)
movl %eax, 0x18(%rsp)
callq 0x6d430
movw %ax, -0x2a(%rbp)
movswl -0x2c(%rbp), %eax
movq -0x38(%rbp), %rcx
movswl 0x18(%rcx), %ecx
cmpl %ecx, %eax
je 0x286b7
movswl -0x2c(%rbp), %eax
cmpl $0x0, %eax
jl 0x286b7
movw -0xa(%rbp), %ax
movswl %ax, %edi
movswl -0x2c(%rbp), %esi
callq 0x69bd0
movw -0x2a(%rbp), %ax
addq $0x58, %rsp
popq %rbx
popq %rbp
retq
nopw %cs:(%rax,%rax)