// File: /workspace/github_c_makefile_star2_O2/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 0x78f658(%rip), %rbx    # 0x79bb30
leaq 0xcf781(%rip), %r15     # 0xdbc60
leaq 0xcf05a(%rip), %r14     # 0xdb540
leaq 0xd0773(%rip), %r12     # 0xdcc60
leaq 0xd276c(%rip), %r13     # 0xdec60
leaq 0xd4765(%rip), %rbp     # 0xe0c60
movl (%rbx), %ebx
testw %bx, %bx
js 0xc580
cmpl $0x0, 0xce0db(%rip)     # 0xda5e4
je 0xc513
movswl %bx, %edi
callq 0x9ce0
movslq 0xcdf72(%rip), %rax     # 0xda48c
andl $0x7fff, %ebx           # imm = 0x7FFF
movq %rax, %rcx
shlq $0x4, %rcx
addq %r15, %rcx
movb (%rbx,%rcx), %cl
movb %cl, (%rbx,%r14)
shlq $0x5, %rax
leaq (%r12,%rax), %rcx
leal (%rbx,%rbx), %edx
movzwl (%rdx,%rcx), %ecx
leaq 0xcf039(%rip), %rsi     # 0xdb580
movw %cx, (%rdx,%rsi)
leaq (%r13,%rax), %rcx
movzwl (%rdx,%rcx), %ecx
leaq 0xcf085(%rip), %rsi     # 0xdb5e0
movw %cx, (%rdx,%rsi)
addq %rbp, %rax
movzwl (%rdx,%rax), %eax
leaq 0xcdf23(%rip), %rcx     # 0xda490
movw %ax, (%rdx,%rcx)
shll $0x2, %ebx
addq 0xbaa65(%rip), %rbx     # 0xc6fe0
jmp 0xc4fb
movl 0xcdf06(%rip), %eax     # 0xda48c
incl %eax
movzbl %al, %eax
movl %eax, 0xcdefb(%rip)     # 0xda48c
leaq 0x78f598(%rip), %r14    # 0x79bb30
leaq 0xcdf31(%rip), %rax     # 0xda4d0
leaq 0xcf3ea(%rip), %rcx     # 0xdb990
leaq 0xcdf63(%rip), %rdx     # 0xda510
leaq 0xcf41c(%rip), %rsi     # 0xdb9d0
leaq 0xcdf95(%rip), %rdi     # 0xda550
leaq 0xcf44e(%rip), %r8      # 0xdba10
leaq 0xcf297(%rip), %r9      # 0xdb860
leaq 0xcf480(%rip), %r10     # 0xdba50
leaq 0xcf2f9(%rip), %r11     # 0xdb8d0
leaq 0xcf4b2(%rip), %rbx     # 0xdba90
leaq 0xcdecb(%rip), %r15     # 0xda4b0
leaq 0xcf4e4(%rip), %r12     # 0xdbad0
movl (%r14), %r13d
testw %r13w, %r13w
js 0xc644
andl $0x7fff, %r13d          # imm = 0x7FFF
leal (,%r13,4), %r14d
addl %r13d, %r13d
movzwl (%r13,%r15), %ebp
movw %bp, (%r13,%r12)
movl (%r14,%rax), %ebp
movl %ebp, (%r14,%rcx)
movl (%r14,%rdx), %ebp
movl %ebp, (%r14,%rsi)
movl (%r14,%rdi), %ebp
movl %ebp, (%r14,%r8)
movl (%r14,%r9), %ebp
movl %ebp, (%r14,%r10)
movl (%r14,%r11), %ebp
movl %ebp, (%r14,%rbx)
addq 0xba99e(%rip), %r14     # 0xc6fe0
jmp 0xc5ec
pushq $0x1
popq %r15
leaq 0x4174e1(%rip), %r13    # 0x423b30
leaq 0xd660a(%rip), %rbp     # 0xe2c60
pushq $0x3
popq %rbx
leaq 0x561550(%rip), %r14    # 0x56dbb0
cmpq $0x2, %r15
je 0xc69e
cmpq $0x9, %r15
je 0xc6a3
leaq (%r15,%r15), %r12
addq 0xba8d1(%rip), %r12     # 0xc6f48
movswq (%r12), %r12
testq %r12, %r12
js 0xc69e
imulq $0x2c, %r12, %rdi
addq %r13, %rdi
imulq $0xc, %r12, %rsi
addq %rbp, %rsi
movl %ebx, %edx
callq 0x56a36
addq %r12, %r12
addq %r14, %r12
jmp 0xc677
incq %r15
jmp 0xc660
leaq 0x78f486(%rip), %rax    # 0x79bb30
leaq 0xcf06f(%rip), %r15     # 0xdb720
leaq 0xcf0c8(%rip), %rcx     # 0xdb780
leaq 0x78f481(%rip), %r14    # 0x79bb40
movl (%rax), %eax
testw %ax, %ax
js 0xc6df
andl $0x7fff, %eax           # imm = 0x7FFF
leal (%rax,%rax), %edx
movzwl (%rdx,%r15), %esi
movw %si, (%rdx,%rcx)
shll $0x2, %eax
addq %r14, %rax
jmp 0xc6bf
leaq 0x78f446(%rip), %rax    # 0x79bb2c
cmpl $0x2, (%rax)
jg 0xc7ab
cmpl $0x1, 0xbb40e(%rip)     # 0xc7b04
jne 0xc7ab
movslq 0xceded(%rip), %rax     # 0xdb4f0
leaq 0x78f426(%rip), %rcx    # 0x79bb30
xorl %edx, %edx
leaq 0xdc54d(%rip), %rsi     # 0xe8c60
leaq (%rsi,%rax,2), %rsi
leaq 0xe4542(%rip), %rdi     # 0xf0c60
leaq (%rdi,%rax,4), %rdi
leaq 0xf4537(%rip), %r8      # 0x100c60
leaq (%r8,%rax,4), %r8
leaq 0x10452c(%rip), %r9     # 0x110c60
leaq (%r9,%rax,4), %r9
movl (%rcx), %ecx
testw %cx, %cx
js 0xc799
andl $0x7fff, %ecx           # imm = 0x7FFF
leaq 0xcedf4(%rip), %r10     # 0xdb540
movb (%rcx,%r10), %r10b
movswq %dx, %r11
movb %r10b, (%r11,%rsi)
leal (%rcx,%rcx), %r10d
leaq 0xcee1d(%rip), %rbx     # 0xdb580
movzwl (%r10,%rbx), %ebx
movw %bx, (%rdi,%r11,2)
leaq 0xcee6c(%rip), %rbx     # 0xdb5e0
movzwl (%r10,%rbx), %ebx
movw %bx, (%r8,%r11,2)
leaq 0xcdd0b(%rip), %rbx     # 0xda490
movzwl (%r10,%rbx), %r10d
movw %r10w, (%r9,%r11,2)
incl %edx
shll $0x2, %ecx
addq %r14, %rcx
jmp 0xc738
movl $0x3ffe, %ecx           # imm = 0x3FFE
cmpl %ecx, %eax
cmovll %eax, %ecx
incl %ecx
movl %ecx, 0xced45(%rip)     # 0xdb4f0
addl $0x3, 0xcdcd6(%rip)     # 0xda488
leaq 0x78f377(%rip), %r12    # 0x79bb30
movl (%r12), %r12d
testw %r12w, %r12w
js 0xc854
movswl %r12w, %ebx
movl %ebx, %edi
callq 0xb4bd
andl $0x7fff, %r12d          # imm = 0x7FFF
movl %r12d, %r14d
movswl (%r15,%r14,2), %esi
movl %ebx, %edi
callq 0x1c243
movq %r15, %r13
movswq (%r15,%r14,2), %rax
imulq $0x28, %rax, %rax
leaq 0x3de0e5(%rip), %rcx    # 0x3ea8e0
movswq (%rcx,%rax), %r14
movzwl 0x2(%rcx,%rax), %ebp
addw %r14w, %bp
movq %r14, %rax
shlq $0x5, %rax
leaq 0x3530b9(%rip), %rcx    # 0x35f8d0
leaq (%rcx,%rax), %r15
addq $0xc, %r15
cmpw %bp, %r14w
jge 0xc841
movzwl (%r15), %eax
testw %ax, %ax
js 0xc838
movswl %ax, %esi
movl %ebx, %edi
callq 0x1c243
incl %r14d
addq $0x20, %r15
jmp 0xc81f
shll $0x2, %r12d
addq 0xba794(%rip), %r12     # 0xc6fe0
movq %r13, %r15
jmp 0xc7b9
callq 0xd717
xorl %eax, %eax
callq 0x2592c
xorl %eax, %eax
callq 0x20f57
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0xd877