// File: /workspace/github_c_makefile_star2_O3/jonof[P]jftekwar/src/tekgame.c
// Function: domovethings
void
domovethings()
{
     short          i, j, startwall, endwall;
     walltype       *wal;

     for( i=connecthead; i>=0; i=connectpoint2[i] ) {
        if (dbgflag) {
            debugout(i);
        }
          syncvel[i] = baksyncvel[movefifoplc][i];
          syncsvel[i] = baksyncsvel[movefifoplc][i];
          syncangvel[i] = baksyncangvel[movefifoplc][i];
          syncbits[i] = baksyncbits[movefifoplc][i];
     }
     movefifoplc = ((movefifoplc+1)&(MOVEFIFOSIZ-1));
#if 0
     syncval[syncvalend] = getsyncstat();
     syncvalend = ((syncvalend+1)&(MOVEFIFOSIZ-1));
#endif
     for( i=connecthead; i>=0; i=connectpoint2[i] ) {
          oposx[i] = posx[i];
          oposy[i] = posy[i];
          oposz[i] = posz[i];
          ohoriz[i] = horiz[i];
          ozoom[i] = zoom[i];
          oang[i] = ang[i];
     }

     for( i=1; i<=8; i++ ) {
          if( i != 2 ) {
               for( j=headspritestat[i]; j>=0; j=nextspritestat[j] ) {
                    copybuf(&sprite[j].x,&osprite[j].x,3);
               }
          }
     }

     for( i=connecthead; i>=0; i=connectpoint2[i] ) {
          ocursectnum[i] = cursectnum[i];
     }

     if( (numplayers <= 2) && (recstat == 1) ) {
          j = 0;
          for( i=connecthead; i>=0; i=connectpoint2[i] ) {
               recsyncvel[reccnt][j] = syncvel[i];
               recsyncsvel[reccnt][j] = syncsvel[i];
               recsyncangvel[reccnt][j] = syncangvel[i];
               recsyncbits[reccnt][j] = syncbits[i];
               j++;
          }
          reccnt++;
          if( reccnt > 16383 ) {
               reccnt = 16383;
          }
     }

     lockclock += TICSPERFRAME;

     for( i=connecthead; i>=0; i=connectpoint2[i] ) {
          processinput(i);
          checktouchsprite(i,cursectnum[i]);
          startwall = sector[cursectnum[i]].wallptr;
          endwall = startwall + sector[cursectnum[i]].wallnum;
          for( j=startwall,wal=&wall[j]; j<endwall; j++,wal++ ) {
               if( wal->nextsector >= 0 ) {
                    checktouchsprite(i,wal->nextsector);
               }
          }
     }

     doanimations();

     tagcode();
     statuslistcode();

     checkmasterslaveswitch();
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
leaq 0x798888(%rip), %rax    # 0x7a5b30
movl (%rax), %r14d
testw %r14w, %r14w
js 0xd37d
movl 0xd7329(%rip), %eax     # 0xe45e4
leaq 0xdb99e(%rip), %rbx     # 0xe8c60
leaq 0xd8317(%rip), %r15     # 0xe55e0
leaq 0xdd990(%rip), %r12     # 0xeac60
leaq 0xd71b9(%rip), %r13     # 0xe4490
leaq 0x798862(%rip), %rbp    # 0x7a5b40
testl %eax, %eax
je 0xd2f3
movswl %r14w, %edi
callq 0xaa18
movl 0xd72f3(%rip), %eax     # 0xe45e4
jmp 0xd2f5
xorl %eax, %eax
movslq 0xd7190(%rip), %rcx     # 0xe448c
andl $0x7fff, %r14d          # imm = 0x7FFF
movq %rcx, %rdx
shlq $0x4, %rdx
leaq 0xd894f(%rip), %rsi     # 0xe5c60
addq %rsi, %rdx
movb (%r14,%rdx), %dl
leaq 0xd8221(%rip), %rsi     # 0xe5540
movb %dl, (%r14,%rsi)
movq %rcx, %rdx
shlq $0x5, %rdx
leaq 0xd992f(%rip), %rsi     # 0xe6c60
addq %rdx, %rsi
movl %r14d, %edi
addl %edi, %edi
movzwl (%rdi,%rsi), %esi
leaq 0xd823c(%rip), %r8      # 0xe5580
movw %si, (%rdi,%r8)
leaq (%rbx,%rdx), %rsi
movzwl (%rdi,%rsi), %esi
movw %si, (%rdi,%r15)
addq %r12, %rdx
movzwl (%rdi,%rdx), %edx
movw %dx, (%rdi,%r13)
movl (%rbp,%r14,4), %r14d
testw %r14w, %r14w
jns 0xd2de
leaq 0x7987b8(%rip), %rax    # 0x7a5b30
movl (%rax), %r14d
jmp 0xd383
movl 0xd7109(%rip), %ecx     # 0xe448c
incl %ecx
movzbl %cl, %eax
movl %eax, 0xd70fe(%rip)     # 0xe448c
testw %r14w, %r14w
js 0xd446
leaq 0xd85f1(%rip), %rcx     # 0xe5990
leaq 0xd716a(%rip), %rdx     # 0xe4510
leaq 0xd8623(%rip), %rsi     # 0xe59d0
leaq 0xd719c(%rip), %rdi     # 0xe4550
leaq 0xd8655(%rip), %r8      # 0xe5a10
leaq 0xd849e(%rip), %r9      # 0xe5860
leaq 0xd8687(%rip), %r10     # 0xe5a50
leaq 0xd8500(%rip), %r11     # 0xe58d0
leaq 0xd86b9(%rip), %rbx     # 0xe5a90
leaq 0xd70d2(%rip), %r15     # 0xe44b0
leaq 0xd86eb(%rip), %r12     # 0xe5ad0
leaq 0x798754(%rip), %r13    # 0x7a5b40
andl $0x7fff, %r14d          # imm = 0x7FFF
leal (,%r14,4), %ebp
addl %r14d, %r14d
movzwl (%r14,%r15), %eax
movw %ax, (%r14,%r12)
leaq 0xd70c1(%rip), %rax     # 0xe44d0
movl (%rbp,%rax), %eax
movl %eax, (%rbp,%rcx)
movl (%rbp,%rdx), %eax
movl %eax, (%rbp,%rsi)
movl (%rbp,%rdi), %eax
movl %eax, (%rbp,%r8)
movl (%rbp,%r9), %eax
movl %eax, (%rbp,%r10)
movl (%rbp,%r11), %eax
movl %eax, (%rbp,%rbx)
movl (%r13,%rbp), %r14d
testw %r14w, %r14w
jns 0xd3ec
movl $0x1, %ebx
leaq 0x561f4e(%rip), %r14    # 0x56f3a0
leaq 0x4206d7(%rip), %r15    # 0x42db30
leaq 0xdf800(%rip), %r12     # 0xecc60
leaq 0x56a749(%rip), %r13    # 0x577bb0
cmpq $0x2, %rbx
jne 0xd478
incq %rbx
cmpq $0x9, %rbx
jne 0xd467
jmp 0xd4ad
movzwl (%r14,%rbx,2), %eax
testw %ax, %ax
js 0xd46d
movzwl %ax, %ebp
imulq $0x2c, %rbp, %rdi
addq %r15, %rdi
leaq (,%rbp,2), %rax
addq %rbp, %rax
leaq (%r12,%rax,4), %rsi
movl $0x3, %edx
callq 0x6110e
movzwl (%r13,%rbp,2), %eax
jmp 0xd47d
leaq 0x79867c(%rip), %rax    # 0x7a5b30
movl (%rax), %r14d
testw %r14w, %r14w
js 0xd5c0
leaq 0xd8258(%rip), %rcx     # 0xe5720
leaq 0xd82b1(%rip), %rdx     # 0xe5780
leaq 0x79866a(%rip), %rax    # 0x7a5b40
movl %r14d, %esi
andl $0x7fff, %esi           # imm = 0x7FFF
leal (%rsi,%rsi), %edi
movzwl (%rdi,%rcx), %r8d
movw %r8w, (%rdi,%rdx)
movl (%rax,%rsi,4), %esi
testw %si, %si
jns 0xd4d9
leaq 0x798631(%rip), %rcx    # 0x7a5b2c
cmpl $0x2, (%rcx)
jg 0xd5f5
cmpl $0x1, 0xc45f9(%rip)     # 0xd1b04
jne 0xd5f5
movl 0xd7fd9(%rip), %ecx     # 0xe54f0
testw %r14w, %r14w
js 0xd5e3
movl %ecx, 0x4(%rsp)
movslq %ecx, %r15
xorl %edx, %edx
leaq 0xd800f(%rip), %rsi     # 0xe5540
leaq 0xe5728(%rip), %rdi     # 0xf2c60
leaq (%rdi,%r15,2), %rdi
leaq 0xd803d(%rip), %r8      # 0xe5580
leaq 0xed716(%rip), %r9      # 0xfac60
leaq (%r9,%r15,4), %r9
leaq 0xd808b(%rip), %r10     # 0xe55e0
leaq 0xfd704(%rip), %r11     # 0x10ac60
leaq (%r11,%r15,4), %r11
leaq 0xd6f29(%rip), %rbx     # 0xe4490
leaq 0x10d6f2(%rip), %r12    # 0x11ac60
leaq (%r12,%r15,4), %r15
movl %r14d, %r12d
andl $0x7fff, %r12d          # imm = 0x7FFF
movb (%r12,%rsi), %bpl
movswq %dx, %r13
movb %bpl, (%r13,%rdi)
movl %r12d, %ebp
addl %ebp, %ebp
movzwl (%rbp,%r8), %ecx
movw %cx, (%r9,%r13,2)
movzwl (%rbp,%r10), %ecx
movw %cx, (%r11,%r13,2)
movzwl (%rbp,%rbx), %ecx
movw %cx, (%r15,%r13,2)
incl %edx
movl (%rax,%r12,4), %r12d
testw %r12w, %r12w
jns 0xd575
movl 0x4(%rsp), %ecx
jmp 0xd5e3
leaq 0x798565(%rip), %rax    # 0x7a5b2c
cmpl $0x2, (%rax)
jg 0xd695
cmpl $0x1, 0xc452d(%rip)     # 0xd1b04
jne 0xd695
movl 0xd7f0d(%rip), %ecx     # 0xe54f0
movl $0x3ffe, %eax           # imm = 0x3FFE
cmpl %eax, %ecx
cmovll %ecx, %eax
incl %eax
movl %eax, 0xd7efb(%rip)     # 0xe54f0
addl $0x3, 0xd6e8c(%rip)     # 0xe4488
testw %r14w, %r14w
js 0xd69c
leaq 0xd8113(%rip), %r15     # 0xe5720
leaq 0x3e72cc(%rip), %r12    # 0x3f48e0
movswl %r14w, %ebx
movl %ebx, %edi
callq 0xc24f
andl $0x7fff, %r14d          # imm = 0x7FFF
movswl (%r15,%r14,2), %esi
movl %ebx, %edi
callq 0x1dd99
movswq (%r15,%r14,2), %rax
leaq (%rax,%rax,4), %rcx
movl (%r12,%rcx,8), %eax
movzwl 0x2(%r12,%rcx,8), %r13d
leal (%rax,%r13), %ecx
cmpw %cx, %ax
jge 0xd682
movswq %ax, %rax
shlq $0x5, %rax
leaq 0x35c273(%rip), %rcx    # 0x3698d0
leaq (%rcx,%rax), %rbp
addq $0xc, %rbp
movzwl (%rbp), %eax
testw %ax, %ax
js 0xd678
movswl %ax, %esi
movl %ebx, %edi
callq 0x1dd99
addq $0x20, %rbp
decw %r13w
jne 0xd665
leaq 0x7984b7(%rip), %rax    # 0x7a5b40
movl (%rax,%r14,4), %r14d
testw %r14w, %r14w
jns 0xd614
jmp 0xd69c
addl $0x3, 0xd6dec(%rip)     # 0xe4488
callq 0xe61c
xorl %eax, %eax
callq 0x28215
xorl %eax, %eax
callq 0x23028
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0xe788