// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x30, %rsp
movl %edi, -0x4(%rbp)
movl $0xc, -0x10(%rbp)
movslq -0x4(%rbp), %rcx
leaq 0x3212a3(%rip), %rax    # 0x362be0
movq (%rax,%rcx,8), %rax
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rax
movl (%rax), %eax
movl %eax, -0x1c(%rbp)
testl %eax, %eax
je 0x41ea4
jmp 0x41958
movl -0x1c(%rbp), %eax
subl $0x1, %eax
je 0x41976
jmp 0x41962
movl -0x1c(%rbp), %eax
addl $-0x2, %eax
subl $0x2, %eax
jb 0x41ea4
jmp 0x41ea6
movq -0x18(%rbp), %rax
cmpl $0x0, 0x10(%rax)
jle 0x41bfd
movl -0x10(%rbp), %eax
movl %eax, -0xc(%rbp)
movl -0xc(%rbp), %edx
movq -0x18(%rbp), %rax
movl 0x10(%rax), %ecx
subl %edx, %ecx
movl %ecx, 0x10(%rax)
movq -0x18(%rbp), %rax
cmpl $0x0, 0x10(%rax)
jge 0x419bb
movq -0x18(%rbp), %rax
movl 0x10(%rax), %eax
addl -0xc(%rbp), %eax
movl %eax, -0xc(%rbp)
movq -0x18(%rbp), %rax
movl $0x0, 0x10(%rax)
movq -0x18(%rbp), %rax
movl 0x18(%rax), %eax
movq %rax, -0x28(%rbp)
subq $0x3, %rax
ja 0x41bfb
movq -0x28(%rbp), %rax
leaq 0x99025(%rip), %rcx     # 0xdaa00
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq -0x18(%rbp), %rax
movl 0x8(%rax), %eax
movl %eax, -0x8(%rbp)
movl -0x8(%rbp), %eax
movslq -0x8(%rbp), %rdx
leaq 0x2087e4(%rip), %rcx    # 0x24a1e0
movq (%rcx,%rdx,8), %rcx
movl (%rcx), %esi
movslq -0x8(%rbp), %rdx
leaq 0x2087d3(%rip), %rcx    # 0x24a1e0
movq (%rcx,%rdx,8), %rcx
movl 0x4(%rcx), %edx
subl -0xc(%rbp), %edx
movswl %ax, %edi
callq 0x6d260
movslq -0x8(%rbp), %rcx
leaq 0x2087b6(%rip), %rax    # 0x24a1e0
movq (%rax,%rcx,8), %rax
movswl 0x8(%rax), %eax
movl %eax, -0x8(%rbp)
movl -0x8(%rbp), %eax
movslq -0x8(%rbp), %rdx
leaq 0x20879d(%rip), %rcx    # 0x24a1e0
movq (%rcx,%rdx,8), %rcx
movl (%rcx), %esi
movslq -0x8(%rbp), %rdx
leaq 0x20878c(%rip), %rcx    # 0x24a1e0
movq (%rcx,%rdx,8), %rcx
movl 0x4(%rcx), %edx
subl -0xc(%rbp), %edx
movswl %ax, %edi
callq 0x6d260
jmp 0x41bfb
movq -0x18(%rbp), %rax
movl 0x8(%rax), %eax
movl %eax, -0x8(%rbp)
movl -0x8(%rbp), %eax
movslq -0x8(%rbp), %rdx
leaq 0x20875d(%rip), %rcx    # 0x24a1e0
movq (%rcx,%rdx,8), %rcx
movl (%rcx), %esi
addl -0xc(%rbp), %esi
movslq -0x8(%rbp), %rdx
leaq 0x208749(%rip), %rcx    # 0x24a1e0
movq (%rcx,%rdx,8), %rcx
movl 0x4(%rcx), %edx
movswl %ax, %edi
callq 0x6d260
movslq -0x8(%rbp), %rcx
leaq 0x20872f(%rip), %rax    # 0x24a1e0
movq (%rax,%rcx,8), %rax
movswl 0x8(%rax), %eax
movl %eax, -0x8(%rbp)
movl -0x8(%rbp), %eax
movslq -0x8(%rbp), %rdx
leaq 0x208716(%rip), %rcx    # 0x24a1e0
movq (%rcx,%rdx,8), %rcx
movl (%rcx), %esi
addl -0xc(%rbp), %esi
movslq -0x8(%rbp), %rdx
leaq 0x208702(%rip), %rcx    # 0x24a1e0
movq (%rcx,%rdx,8), %rcx
movl 0x4(%rcx), %edx
movswl %ax, %edi
callq 0x6d260
jmp 0x41bfb
movq -0x18(%rbp), %rax
movl 0x8(%rax), %eax
movl %eax, -0x8(%rbp)
movl -0x8(%rbp), %eax
movslq -0x8(%rbp), %rdx
leaq 0x2086d6(%rip), %rcx    # 0x24a1e0
movq (%rcx,%rdx,8), %rcx
movl (%rcx), %esi
movslq -0x8(%rbp), %rdx
leaq 0x2086c5(%rip), %rcx    # 0x24a1e0
movq (%rcx,%rdx,8), %rcx
movl 0x4(%rcx), %edx
addl -0xc(%rbp), %edx
movswl %ax, %edi
callq 0x6d260
movslq -0x8(%rbp), %rcx
leaq 0x2086a8(%rip), %rax    # 0x24a1e0
movq (%rax,%rcx,8), %rax
movswl 0x8(%rax), %eax
movl %eax, -0x8(%rbp)
movl -0x8(%rbp), %eax
movslq -0x8(%rbp), %rdx
leaq 0x20868f(%rip), %rcx    # 0x24a1e0
movq (%rcx,%rdx,8), %rcx
movl (%rcx), %esi
movslq -0x8(%rbp), %rdx
leaq 0x20867e(%rip), %rcx    # 0x24a1e0
movq (%rcx,%rdx,8), %rcx
movl 0x4(%rcx), %edx
addl -0xc(%rbp), %edx
movswl %ax, %edi
callq 0x6d260
jmp 0x41bfb
movq -0x18(%rbp), %rax
movl 0x8(%rax), %eax
movl %eax, -0x8(%rbp)
movl -0x8(%rbp), %eax
movslq -0x8(%rbp), %rdx
leaq 0x20864f(%rip), %rcx    # 0x24a1e0
movq (%rcx,%rdx,8), %rcx
movl (%rcx), %esi
subl -0xc(%rbp), %esi
movslq -0x8(%rbp), %rdx
leaq 0x20863b(%rip), %rcx    # 0x24a1e0
movq (%rcx,%rdx,8), %rcx
movl 0x4(%rcx), %edx
movswl %ax, %edi
callq 0x6d260
movslq -0x8(%rbp), %rcx
leaq 0x208621(%rip), %rax    # 0x24a1e0
movq (%rax,%rcx,8), %rax
movswl 0x8(%rax), %eax
movl %eax, -0x8(%rbp)
movl -0x8(%rbp), %eax
movslq -0x8(%rbp), %rdx
leaq 0x208608(%rip), %rcx    # 0x24a1e0
movq (%rcx,%rdx,8), %rcx
movl (%rcx), %esi
subl -0xc(%rbp), %esi
movslq -0x8(%rbp), %rdx
leaq 0x2085f4(%rip), %rcx    # 0x24a1e0
movq (%rcx,%rdx,8), %rcx
movl 0x4(%rcx), %edx
movswl %ax, %edi
callq 0x6d260
jmp 0x41bfd
movq -0x18(%rbp), %rax
cmpl $0x0, 0x14(%rax)
jle 0x41e84
movl -0x10(%rbp), %eax
movl %eax, -0xc(%rbp)
movl -0xc(%rbp), %edx
movq -0x18(%rbp), %rax
movl 0x14(%rax), %ecx
subl %edx, %ecx
movl %ecx, 0x14(%rax)
movq -0x18(%rbp), %rax
cmpl $0x0, 0x14(%rax)
jge 0x41c42
movq -0x18(%rbp), %rax
movl 0x14(%rax), %eax
addl -0xc(%rbp), %eax
movl %eax, -0xc(%rbp)
movq -0x18(%rbp), %rax
movl $0x0, 0x14(%rax)
movq -0x18(%rbp), %rax
movl 0x18(%rax), %eax
movq %rax, -0x30(%rbp)
subq $0x3, %rax
ja 0x41e82
movq -0x30(%rbp), %rax
leaq 0x98dae(%rip), %rcx     # 0xdaa10
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq -0x18(%rbp), %rax
movl 0xc(%rax), %eax
movl %eax, -0x8(%rbp)
movl -0x8(%rbp), %eax
movslq -0x8(%rbp), %rdx
leaq 0x20855d(%rip), %rcx    # 0x24a1e0
movq (%rcx,%rdx,8), %rcx
movl (%rcx), %esi
movslq -0x8(%rbp), %rdx
leaq 0x20854c(%rip), %rcx    # 0x24a1e0
movq (%rcx,%rdx,8), %rcx
movl 0x4(%rcx), %edx
addl -0xc(%rbp), %edx
movswl %ax, %edi
callq 0x6d260
movslq -0x8(%rbp), %rcx
leaq 0x20852f(%rip), %rax    # 0x24a1e0
movq (%rax,%rcx,8), %rax
movswl 0x8(%rax), %eax
movl %eax, -0x8(%rbp)
movl -0x8(%rbp), %eax
movslq -0x8(%rbp), %rdx
leaq 0x208516(%rip), %rcx    # 0x24a1e0
movq (%rcx,%rdx,8), %rcx
movl (%rcx), %esi
movslq -0x8(%rbp), %rdx
leaq 0x208505(%rip), %rcx    # 0x24a1e0
movq (%rcx,%rdx,8), %rcx
movl 0x4(%rcx), %edx
addl -0xc(%rbp), %edx
movswl %ax, %edi
callq 0x6d260
jmp 0x41e82
movq -0x18(%rbp), %rax
movl 0xc(%rax), %eax
movl %eax, -0x8(%rbp)
movl -0x8(%rbp), %eax
movslq -0x8(%rbp), %rdx
leaq 0x2084d6(%rip), %rcx    # 0x24a1e0
movq (%rcx,%rdx,8), %rcx
movl (%rcx), %esi
subl -0xc(%rbp), %esi
movslq -0x8(%rbp), %rdx
leaq 0x2084c2(%rip), %rcx    # 0x24a1e0
movq (%rcx,%rdx,8), %rcx
movl 0x4(%rcx), %edx
movswl %ax, %edi
callq 0x6d260
movslq -0x8(%rbp), %rcx
leaq 0x2084a8(%rip), %rax    # 0x24a1e0
movq (%rax,%rcx,8), %rax
movswl 0x8(%rax), %eax
movl %eax, -0x8(%rbp)
movl -0x8(%rbp), %eax
movslq -0x8(%rbp), %rdx
leaq 0x20848f(%rip), %rcx    # 0x24a1e0
movq (%rcx,%rdx,8), %rcx
movl (%rcx), %esi
subl -0xc(%rbp), %esi
movslq -0x8(%rbp), %rdx
leaq 0x20847b(%rip), %rcx    # 0x24a1e0
movq (%rcx,%rdx,8), %rcx
movl 0x4(%rcx), %edx
movswl %ax, %edi
callq 0x6d260
jmp 0x41e82
movq -0x18(%rbp), %rax
movl 0xc(%rax), %eax
movl %eax, -0x8(%rbp)
movl -0x8(%rbp), %eax
movslq -0x8(%rbp), %rdx
leaq 0x20844f(%rip), %rcx    # 0x24a1e0
movq (%rcx,%rdx,8), %rcx
movl (%rcx), %esi
movslq -0x8(%rbp), %rdx
leaq 0x20843e(%rip), %rcx    # 0x24a1e0
movq (%rcx,%rdx,8), %rcx
movl 0x4(%rcx), %edx
subl -0xc(%rbp), %edx
movswl %ax, %edi
callq 0x6d260
movslq -0x8(%rbp), %rcx
leaq 0x208421(%rip), %rax    # 0x24a1e0
movq (%rax,%rcx,8), %rax
movswl 0x8(%rax), %eax
movl %eax, -0x8(%rbp)
movl -0x8(%rbp), %eax
movslq -0x8(%rbp), %rdx
leaq 0x208408(%rip), %rcx    # 0x24a1e0
movq (%rcx,%rdx,8), %rcx
movl (%rcx), %esi
movslq -0x8(%rbp), %rdx
leaq 0x2083f7(%rip), %rcx    # 0x24a1e0
movq (%rcx,%rdx,8), %rcx
movl 0x4(%rcx), %edx
subl -0xc(%rbp), %edx
movswl %ax, %edi
callq 0x6d260
jmp 0x41e82
movq -0x18(%rbp), %rax
movl 0xc(%rax), %eax
movl %eax, -0x8(%rbp)
movl -0x8(%rbp), %eax
movslq -0x8(%rbp), %rdx
leaq 0x2083c8(%rip), %rcx    # 0x24a1e0
movq (%rcx,%rdx,8), %rcx
movl (%rcx), %esi
addl -0xc(%rbp), %esi
movslq -0x8(%rbp), %rdx
leaq 0x2083b4(%rip), %rcx    # 0x24a1e0
movq (%rcx,%rdx,8), %rcx
movl 0x4(%rcx), %edx
movswl %ax, %edi
callq 0x6d260
movslq -0x8(%rbp), %rcx
leaq 0x20839a(%rip), %rax    # 0x24a1e0
movq (%rax,%rcx,8), %rax
movswl 0x8(%rax), %eax
movl %eax, -0x8(%rbp)
movl -0x8(%rbp), %eax
movslq -0x8(%rbp), %rdx
leaq 0x208381(%rip), %rcx    # 0x24a1e0
movq (%rcx,%rdx,8), %rcx
movl (%rcx), %esi
addl -0xc(%rbp), %esi
movslq -0x8(%rbp), %rdx
leaq 0x20836d(%rip), %rcx    # 0x24a1e0
movq (%rcx,%rdx,8), %rcx
movl 0x4(%rcx), %edx
movswl %ax, %edi
callq 0x6d260
jmp 0x41e84
movq -0x18(%rbp), %rax
cmpl $0x0, 0x10(%rax)
jg 0x41ea2
movq -0x18(%rbp), %rax
cmpl $0x0, 0x14(%rax)
jg 0x41ea2
movq -0x18(%rbp), %rax
movl $0x2, (%rax)
jmp 0x41ea6
jmp 0x41ea6
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax)