// File: /workspace/github_c_makefile_star2_O2/jonof[P]jftekwar/src/tekgame.c
// Function: waitforeverybody
void
waitforeverybody()
{
     int i, j, oldtotalclock;

     if (numplayers < 2) return;

     if (myconnectindex == connecthead)
     {
          for(j=1;j<=2;j++)
          {
               for(i=connectpoint2[connecthead];i>=0;i=connectpoint2[i])
                    playerreadyflag[i] = 0;
               oldtotalclock = totalclock-8;
               do
               {
                    getpackets();
                    if (totalclock >= oldtotalclock+8)
                    {
                         oldtotalclock = totalclock;
                         tempbuf[0] = 5;
                         tempbuf[1] = j;
                         for(i=connectpoint2[connecthead];i>=0;i=connectpoint2[i])
                              if (playerreadyflag[i] != j) sendpacket(i,tempbuf,2);
                    }
                    for(i=connectpoint2[connecthead];i>=0;i=connectpoint2[i])
                         if (playerreadyflag[i] != j) break;
               } while (i >= 0);
          }
     }
     else
     {
          playerreadyflag[connecthead] = 0;
          while (playerreadyflag[connecthead] != 2)
          {
               getpackets();
               if (playerreadyflag[connecthead] == 1)
               {
                    playerreadyflag[connecthead] = 0;
                    sendpacket(connecthead,tempbuf,2);
               }
          }
     }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
leaq 0x78d9a0(%rip), %rax    # 0x79bb2c
cmpl $0x2, (%rax)
jge 0xe1a0
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x78d97d(%rip), %rax    # 0x79bb24
movl (%rax), %eax
leaq 0x78d980(%rip), %rcx    # 0x79bb30
movslq (%rcx), %rcx
cmpl %ecx, %eax
jne 0xe28a
pushq $0x1
popq %r12
leaq 0x78d97a(%rip), %r13    # 0x79bb40
leaq 0x1152d3(%rip), %r15    # 0x1234a0
leaq 0x545194(%rip), %rbx    # 0x553368
pushq $0x2
popq %rbp
cmpl $0x3, %r12d
je 0xe191
cltq
movslq (%r13,%rax,4), %rax
testq %rax, %rax
js 0xe1f0
movb $0x0, (%rax,%r15)
jmp 0xe1df
movl (%rbx), %r14d
addl $-0x8, %r14d
callq 0xde98
movl (%rbx), %ebx
leal 0x8(%r14), %ecx
leaq 0x78d927(%rip), %rax    # 0x79bb30
movl (%rax), %eax
cmpl %ecx, %ebx
jge 0xe214
movl %r14d, %ebx
jmp 0xe255
movslq %eax, %r14
movb $0x5, 0xcc3d2(%rip)     # 0xda5f0
movb %r12b, 0xcc3cc(%rip)    # 0xda5f1
movslq (%r13,%r14,4), %r14
testq %r14, %r14
js 0xe24c
movsbl (%r14,%r15), %eax
cmpl %eax, %r12d
je 0xe225
movl %r14d, %edi
leaq 0xcc3ad(%rip), %rsi     # 0xda5f0
movl %ebp, %edx
callq 0x54ffd
jmp 0xe225
leaq 0x78d8dd(%rip), %rax    # 0x79bb30
movl (%rax), %eax
movslq %eax, %rcx
movslq (%r13,%rcx,4), %rcx
testq %rcx, %rcx
js 0xe27b
movsbl (%rcx,%r15), %edx
cmpl %edx, %r12d
je 0xe258
movl %ebx, %r14d
leaq 0x5450f2(%rip), %rbx    # 0x553368
jmp 0xe1f7
incl %r12d
leaq 0x5450e3(%rip), %rbx    # 0x553368
jmp 0xe1d7
leaq 0x11520f(%rip), %r14    # 0x1234a0
movb $0x0, (%rcx,%r14)
xorl %eax, %eax
leaq 0xcc351(%rip), %rbx     # 0xda5f0
pushq $0x2
popq %rbp
cmpb $0x2, %al
je 0xe191
callq 0xde98
leaq 0x78d87a(%rip), %rax    # 0x79bb30
movslq (%rax), %rdi
movb (%rdi,%r14), %al
cmpb $0x1, %al
jne 0xe2a2
movb $0x0, (%rdi,%r14)
movq %rbx, %rsi
movl %ebp, %edx
callq 0x54ffd
leaq 0x78d859(%rip), %rax    # 0x79bb30
movslq (%rax), %rax
movb (%rax,%r14), %al
jmp 0xe2a2