// File: /workspace/github_c_makefile_star2_O1/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 0x79584c(%rip), %rax    # 0x7a2b10
movl (%rax), %r14d
testw %r14w, %r14w
js 0xd37e
leaq 0xd8988(%rip), %rbx     # 0xe5c60
leaq 0xd5301(%rip), %r15     # 0xe25e0
leaq 0xda97a(%rip), %r12     # 0xe7c60
leaq 0xd41a3(%rip), %r13     # 0xe1490
leaq 0x79582c(%rip), %rbp    # 0x7a2b20
cmpl $0x0, 0xd42e9(%rip)     # 0xe15e4
je 0xd306
movswl %r14w, %edi
callq 0xaa38
movslq 0xd417f(%rip), %rax     # 0xe148c
andl $0x7fff, %r14d          # imm = 0x7FFF
movq %rax, %rcx
shlq $0x4, %rcx
leaq 0xd593e(%rip), %rdx     # 0xe2c60
addq %rdx, %rcx
movb (%r14,%rcx), %cl
leaq 0xd5210(%rip), %rdx     # 0xe2540
movb %cl, (%r14,%rdx)
shlq $0x5, %rax
leaq 0xd6921(%rip), %rcx     # 0xe3c60
addq %rax, %rcx
movl %r14d, %edx
addl %edx, %edx
movzwl (%rdx,%rcx), %ecx
leaq 0xd522e(%rip), %rsi     # 0xe2580
movw %cx, (%rdx,%rsi)
leaq (%rbx,%rax), %rcx
movzwl (%rdx,%rcx), %ecx
movw %cx, (%rdx,%r15)
addq %r12, %rax
movzwl (%rdx,%rax), %eax
movw %ax, (%rdx,%r13)
movl (%rbp,%r14,4), %r14d
testw %r14w, %r14w
jns 0xd2f4
movl 0xd4108(%rip), %eax     # 0xe148c
incl %eax
movzbl %al, %eax
movl %eax, 0xd40fd(%rip)     # 0xe148c
leaq 0x79577a(%rip), %rax    # 0x7a2b10
movl (%rax), %r10d
testw %r10w, %r10w
js 0xd451
leaq 0xd55e6(%rip), %rcx     # 0xe2990
leaq 0xd415f(%rip), %rdx     # 0xe1510
leaq 0xd5618(%rip), %rsi     # 0xe29d0
leaq 0xd4191(%rip), %rdi     # 0xe1550
leaq 0xd564a(%rip), %r8      # 0xe2a10
leaq 0xd5493(%rip), %r9      # 0xe2860
leaq 0xd567c(%rip), %r11     # 0xe2a50
leaq 0xd54f5(%rip), %rbx     # 0xe28d0
leaq 0xd56ae(%rip), %r14     # 0xe2a90
leaq 0xd40c7(%rip), %r15     # 0xe14b0
leaq 0xd56e0(%rip), %r12     # 0xe2ad0
leaq 0x795729(%rip), %r13    # 0x7a2b20
andl $0x7fff, %r10d          # imm = 0x7FFF
leal (,%r10,4), %ebp
addl %r10d, %r10d
movzwl (%r10,%r15), %eax
movw %ax, (%r10,%r12)
leaq 0xd40b6(%rip), %rax     # 0xe14d0
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,%r11)
movl (%rbp,%rbx), %eax
movl %eax, (%rbp,%r14)
movl (%r13,%rbp), %r10d
testw %r10w, %r10w
jns 0xd3f7
movl $0x1, %ebx
leaq 0x55ef23(%rip), %r14    # 0x56c380
leaq 0x41d6ac(%rip), %r15    # 0x42ab10
leaq 0xdc7f5(%rip), %r12     # 0xe9c60
leaq 0x56771e(%rip), %r13    # 0x574b90
cmpq $0x2, %rbx
jne 0xd483
incq %rbx
cmpq $0x9, %rbx
jne 0xd472
jmp 0xd4b8
movzwl (%r14,%rbx,2), %eax
testw %ax, %ax
js 0xd478
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 0x5da55
movzwl (%r13,%rbp,2), %eax
jmp 0xd488
leaq 0x795651(%rip), %r13    # 0x7a2b10
movl (%r13), %eax
testw %ax, %ax
js 0xd4f7
leaq 0xd5251(%rip), %rcx     # 0xe2720
leaq 0xd52aa(%rip), %rdx     # 0xe2780
leaq 0x795643(%rip), %rsi    # 0x7a2b20
andl $0x7fff, %eax           # imm = 0x7FFF
leal (%rax,%rax), %edi
movzwl (%rdi,%rcx), %r8d
movw %r8w, (%rdi,%rdx)
movl (%rsi,%rax,4), %eax
testw %ax, %ax
jns 0xd4dd
leaq 0x79560e(%rip), %rax    # 0x7a2b0c
cmpl $0x2, (%rax)
jg 0xd5d1
cmpl $0x1, 0xc15f6(%rip)     # 0xceb04
jne 0xd5d1
movl (%r13), %eax
testw %ax, %ax
js 0xd5b9
movslq 0xd4fc8(%rip), %rbx     # 0xe24f0
xorl %ecx, %ecx
leaq 0xd500f(%rip), %rdx     # 0xe2540
leaq 0xe2728(%rip), %rsi     # 0xefc60
leaq (%rsi,%rbx,2), %rsi
leaq 0xd503d(%rip), %rdi     # 0xe2580
leaq 0xea716(%rip), %r8      # 0xf7c60
leaq (%r8,%rbx,4), %r8
leaq 0xd508b(%rip), %r9      # 0xe25e0
leaq 0xfa704(%rip), %r10     # 0x107c60
leaq (%r10,%rbx,4), %r10
leaq 0xd3f29(%rip), %r11     # 0xe1490
leaq 0x10a6f2(%rip), %r14    # 0x117c60
leaq (%r14,%rbx,4), %rbx
leaq 0x7955a7(%rip), %r14    # 0x7a2b20
andl $0x7fff, %eax           # imm = 0x7FFF
movb (%rax,%rdx), %bpl
movswq %cx, %r15
movb %bpl, (%r15,%rsi)
movl %eax, %r12d
addl %r12d, %r12d
movzwl (%r12,%rdi), %ebp
movw %bp, (%r8,%r15,2)
movzwl (%r12,%r9), %ebp
movw %bp, (%r10,%r15,2)
movzwl (%r12,%r11), %ebp
movw %bp, (%rbx,%r15,2)
incl %ecx
movl (%r14,%rax,4), %eax
testw %ax, %ax
jns 0xd579
movl 0xd4f31(%rip), %eax     # 0xe24f0
movl $0x3ffe, %ecx           # imm = 0x3FFE
cmpl %ecx, %eax
cmovll %eax, %ecx
incl %ecx
movl %ecx, 0xd4f1f(%rip)     # 0xe24f0
addl $0x3, 0xd3eb0(%rip)     # 0xe1488
movl (%r13), %r14d
testw %r14w, %r14w
js 0xd673
leaq 0xd5133(%rip), %r15     # 0xe2720
leaq 0x3e42cc(%rip), %r12    # 0x3f18c0
movswl %r14w, %ebx
movl %ebx, %edi
callq 0xc283
andl $0x7fff, %r14d          # imm = 0x7FFF
movswl (%r15,%r14,2), %esi
movl %ebx, %edi
callq 0x1dc22
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 0xd662
movswq %ax, %rax
shlq $0x5, %rax
leaq 0x359273(%rip), %rcx    # 0x3668b0
leaq (%rcx,%rax), %rbp
addq $0xc, %rbp
movzwl (%rbp), %eax
testw %ax, %ax
js 0xd658
movswl %ax, %esi
movl %ebx, %edi
callq 0x1dc22
addq $0x20, %rbp
decw %r13w
jne 0xd645
leaq 0x7954b7(%rip), %rax    # 0x7a2b20
movl (%rax,%r14,4), %r14d
testw %r14w, %r14w
jns 0xd5f4
callq 0xe628
xorl %eax, %eax
callq 0x27c72
xorl %eax, %eax
callq 0x22dcc
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0xe790