// File: /workspace/github_c_makefile_star2_O3/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 %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movslq %edi, %rax
leaq 0x2ec8e8(%rip), %rcx    # 0x319c30
movq (%rcx,%rax,8), %r14
cmpl $0x1, (%r14)
jne 0x2d5ac
movl 0x10(%r14), %eax
testl %eax, %eax
jle 0x2d475
xorl %ecx, %ecx
movl %eax, %edx
subl $0xc, %edx
cmovbl %ecx, %edx
movl $0xc, %ebx
cmovbl %eax, %ebx
movl %edx, 0x10(%r14)
movl 0x18(%r14), %eax
cmpq $0x3, %rax
ja 0x2d475
leaq 0x637e3(%rip), %rcx     # 0x90b70
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movslq 0x8(%r14), %r15
leaq 0x1d3e8f(%rip), %r12    # 0x201230
movq (%r12,%r15,8), %rax
movl (%rax), %esi
movl 0x4(%rax), %edx
subl %ebx, %edx
movswl %r15w, %edi
callq 0x4ab97
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 0x2d439
movslq 0x8(%r14), %r15
leaq 0x1d3e58(%rip), %r12    # 0x201230
movq (%r12,%r15,8), %rax
movl (%rax), %esi
movl 0x4(%rax), %edx
addl %ebx, %edx
movswl %r15w, %edi
callq 0x4ab97
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 0x2d470
movslq 0x8(%r14), %r15
leaq 0x1d3e21(%rip), %r12    # 0x201230
movq (%r12,%r15,8), %rax
movl (%rax), %esi
movl 0x4(%rax), %edx
subl %ebx, %esi
movswl %r15w, %edi
callq 0x4ab97
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
jmp 0x2d470
movslq 0x8(%r14), %r15
leaq 0x1d3dea(%rip), %r12    # 0x201230
movq (%r12,%r15,8), %rax
movl (%rax), %esi
addl %ebx, %esi
movl 0x4(%rax), %edx
movswl %r15w, %edi
callq 0x4ab97
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
callq 0x4ab97
movl 0x14(%r14), %eax
testl %eax, %eax
jle 0x2d597
xorl %ecx, %ecx
movl %eax, %edx
subl $0xc, %edx
cmovbl %ecx, %edx
movl $0xc, %ebx
cmovbl %eax, %ebx
movl %edx, 0x14(%r14)
movl 0x18(%r14), %eax
cmpq $0x3, %rax
ja 0x2d597
leaq 0x636d4(%rip), %rcx     # 0x90b80
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movslq 0xc(%r14), %r15
leaq 0x1d3d70(%rip), %r12    # 0x201230
movq (%r12,%r15,8), %rax
movl (%rax), %esi
movl 0x4(%rax), %edx
addl %ebx, %edx
movswl %r15w, %edi
callq 0x4ab97
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 0x2d592
movslq 0xc(%r14), %r15
leaq 0x1d3d36(%rip), %r12    # 0x201230
movq (%r12,%r15,8), %rax
movl (%rax), %esi
movl 0x4(%rax), %edx
subl %ebx, %edx
movswl %r15w, %edi
callq 0x4ab97
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 0x2d592
movslq 0xc(%r14), %r15
leaq 0x1d3cff(%rip), %r12    # 0x201230
movq (%r12,%r15,8), %rax
movl (%rax), %esi
addl %ebx, %esi
movl 0x4(%rax), %edx
movswl %r15w, %edi
callq 0x4ab97
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 0x2d592
movslq 0xc(%r14), %r15
leaq 0x1d3cc8(%rip), %r12    # 0x201230
movq (%r12,%r15,8), %rax
movl (%rax), %esi
movl 0x4(%rax), %edx
subl %ebx, %esi
movswl %r15w, %edi
callq 0x4ab97
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 0x4ab97
cmpl $0x0, 0x10(%r14)
jg 0x2d5ac
cmpl $0x0, 0x14(%r14)
jg 0x2d5ac
movl $0x2, (%r14)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq