// File: /workspace/github_c_makefile_star2_O2/jonof[P]jftekwar/src/tektag.c
// Function: movefloordoor
void
movefloordoor(int d)
{
     int  j,s,tics;
     struct floordoor *dptr;

     tics=TICSPERFRAME<<2;
     dptr=floordoorptr[d];
     switch (dptr->state) {
     case DOOROPENING:
          if (dptr->dist1 > 0) {
               s=tics;
               dptr->dist1-=s;
               if (dptr->dist1 < 0) {
                    s+=dptr->dist1;
                    dptr->dist1=0;
               }
               switch (dptr->dir) {
               case 0:
                    j=dptr->wall1;
                    dragpoint(j,wallptr[j]->x,wallptr[j]->y-s);
                    j=wallptr[j]->point2;
                    dragpoint(j,wallptr[j]->x,wallptr[j]->y-s);
                    break;
               case 1:
                    j=dptr->wall1;
                    dragpoint(j,wallptr[j]->x+s,wallptr[j]->y);
                    j=wallptr[j]->point2;
                    dragpoint(j,wallptr[j]->x+s,wallptr[j]->y);
                    break;
               case 2:
                    j=dptr->wall1;
                    dragpoint(j,wallptr[j]->x,wallptr[j]->y+s);
                    j=wallptr[j]->point2;
                    dragpoint(j,wallptr[j]->x,wallptr[j]->y+s);
                    break;
               case 3:
                    j=dptr->wall1;
                    dragpoint(j,wallptr[j]->x-s,wallptr[j]->y);
                    j=wallptr[j]->point2;
                    dragpoint(j,wallptr[j]->x-s,wallptr[j]->y);
                    break;
               }
          }
          if (dptr->dist2 > 0) {
               s=tics;
               dptr->dist2-=s;
               if (dptr->dist2 < 0) {
                    s+=dptr->dist2;
                    dptr->dist2=0;
               }
               switch (dptr->dir) {
               case 0:
                    j=dptr->wall2;
                    dragpoint(j,wallptr[j]->x,wallptr[j]->y+s);
                    j=wallptr[j]->point2;
                    dragpoint(j,wallptr[j]->x,wallptr[j]->y+s);
                    break;
               case 1:
                    j=dptr->wall2;
                    dragpoint(j,wallptr[j]->x-s,wallptr[j]->y);
                    j=wallptr[j]->point2;
                    dragpoint(j,wallptr[j]->x-s,wallptr[j]->y);
                    break;
               case 2:
                    j=dptr->wall2;
                    dragpoint(j,wallptr[j]->x,wallptr[j]->y-s);
                    j=wallptr[j]->point2;
                    dragpoint(j,wallptr[j]->x,wallptr[j]->y-s);
                    break;
               case 3:
                    j=dptr->wall2;
                    dragpoint(j,wallptr[j]->x+s,wallptr[j]->y);
                    j=wallptr[j]->point2;
                    dragpoint(j,wallptr[j]->x+s,wallptr[j]->y);
                    break;
               }
          }
          if (dptr->dist1 <= 0 && dptr->dist2 <= 0) {
               dptr->state=DOOROPENED;
          }
          break;
     case DOORCLOSING:
     case DOOROPENED:
     case DOORCLOSED:
          break;
     }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movslq %edi, %rax
leaq 0x2e65b7(%rip), %rcx    # 0x30fc30
movq (%rcx,%rax,8), %r14
cmpl $0x1, (%r14)
jne 0x298d6
movl 0x10(%r14), %ebp
pushq $0xc
popq %rbx
testl %ebp, %ebp
jle 0x297a4
xorl %eax, %eax
movl %ebp, %ecx
subl $0xc, %ecx
cmovbl %eax, %ecx
cmovael %ebx, %ebp
movl %ecx, 0x10(%r14)
movl 0x18(%r14), %eax
cmpq $0x3, %rax
ja 0x297a4
leaq 0x5937c(%rip), %rcx     # 0x82a38
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movslq 0x8(%r14), %r15
leaq 0x1cdb60(%rip), %r12    # 0x1f7230
movq (%r12,%r15,8), %rax
movl (%rax), %esi
movl 0x4(%rax), %edx
subl %ebp, %edx
movswl %r15w, %edi
callq 0x45ffc
movq (%r12,%r15,8), %rax
movswl 0x8(%rax), %eax
movslq %eax, %rdi
movq (%r12,%rdi,8), %rax
movl (%rax), %esi
movl 0x4(%rax), %edx
subl %ebp, %edx
jmp 0x29768
movslq 0x8(%r14), %r15
leaq 0x1cdb29(%rip), %r12    # 0x1f7230
movq (%r12,%r15,8), %rax
movl (%rax), %esi
movl 0x4(%rax), %edx
addl %ebp, %edx
movswl %r15w, %edi
callq 0x45ffc
movq (%r12,%r15,8), %rax
movswl 0x8(%rax), %eax
movslq %eax, %rdi
movq (%r12,%rdi,8), %rax
movl (%rax), %esi
addl 0x4(%rax), %ebp
movl %ebp, %edx
jmp 0x2979f
movslq 0x8(%r14), %r15
leaq 0x1cdaf2(%rip), %r12    # 0x1f7230
movq (%r12,%r15,8), %rax
movl (%rax), %esi
movl 0x4(%rax), %edx
subl %ebp, %esi
movswl %r15w, %edi
callq 0x45ffc
movq (%r12,%r15,8), %rax
movswl 0x8(%rax), %eax
movslq %eax, %rdi
movq (%r12,%rdi,8), %rax
movl (%rax), %esi
movl 0x4(%rax), %edx
subl %ebp, %esi
jmp 0x2979f
movslq 0x8(%r14), %r15
leaq 0x1cdabb(%rip), %r12    # 0x1f7230
movq (%r12,%r15,8), %rax
movl (%rax), %esi
addl %ebp, %esi
movl 0x4(%rax), %edx
movswl %r15w, %edi
callq 0x45ffc
movq (%r12,%r15,8), %rax
movswl 0x8(%rax), %eax
movslq %eax, %rdi
movq (%r12,%rdi,8), %rax
addl (%rax), %ebp
movl 0x4(%rax), %edx
movl %ebp, %esi
callq 0x45ffc
movl 0x14(%r14), %eax
testl %eax, %eax
jle 0x298c1
xorl %ecx, %ecx
movl %eax, %edx
subl $0xc, %edx
cmovbl %ecx, %edx
cmovbl %eax, %ebx
movl %edx, 0x14(%r14)
movl 0x18(%r14), %eax
cmpq $0x3, %rax
ja 0x298c1
leaq 0x59272(%rip), %rcx     # 0x82a48
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movslq 0xc(%r14), %r15
leaq 0x1cda46(%rip), %r12    # 0x1f7230
movq (%r12,%r15,8), %rax
movl (%rax), %esi
movl 0x4(%rax), %edx
addl %ebx, %edx
movswl %r15w, %edi
callq 0x45ffc
movq (%r12,%r15,8), %rax
movswl 0x8(%rax), %eax
movslq %eax, %rdi
movq (%r12,%rdi,8), %rax
movl (%rax), %esi
addl 0x4(%rax), %ebx
movl %ebx, %edx
jmp 0x298bc
movslq 0xc(%r14), %r15
leaq 0x1cda0c(%rip), %r12    # 0x1f7230
movq (%r12,%r15,8), %rax
movl (%rax), %esi
movl 0x4(%rax), %edx
subl %ebx, %edx
movswl %r15w, %edi
callq 0x45ffc
movq (%r12,%r15,8), %rax
movswl 0x8(%rax), %eax
movslq %eax, %rdi
movq (%r12,%rdi,8), %rax
movl (%rax), %esi
movl 0x4(%rax), %edx
subl %ebx, %edx
jmp 0x298bc
movslq 0xc(%r14), %r15
leaq 0x1cd9d5(%rip), %r12    # 0x1f7230
movq (%r12,%r15,8), %rax
movl (%rax), %esi
addl %ebx, %esi
movl 0x4(%rax), %edx
movswl %r15w, %edi
callq 0x45ffc
movq (%r12,%r15,8), %rax
movswl 0x8(%rax), %eax
movslq %eax, %rdi
movq (%r12,%rdi,8), %rax
addl (%rax), %ebx
movl 0x4(%rax), %edx
movl %ebx, %esi
jmp 0x298bc
movslq 0xc(%r14), %r15
leaq 0x1cd99e(%rip), %r12    # 0x1f7230
movq (%r12,%r15,8), %rax
movl (%rax), %esi
movl 0x4(%rax), %edx
subl %ebx, %esi
movswl %r15w, %edi
callq 0x45ffc
movq (%r12,%r15,8), %rax
movswl 0x8(%rax), %eax
movslq %eax, %rdi
movq (%r12,%rdi,8), %rax
movl (%rax), %esi
movl 0x4(%rax), %edx
subl %ebx, %esi
callq 0x45ffc
cmpl $0x0, 0x10(%r14)
jg 0x298d6
cmpl $0x0, 0x14(%r14)
jg 0x298d6
movl $0x2, (%r14)
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq