// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x10, %rsp
leaq 0x7934fd(%rip), %rax    # 0x7a4f4c
cmpl $0x2, (%rax)
jge 0x11a59
jmp 0x11c4a
leaq 0x7934e4(%rip), %rax    # 0x7a4f44
movl (%rax), %eax
leaq 0x7934e7(%rip), %rcx    # 0x7a4f50
cmpl (%rcx), %eax
jne 0x11bc9
movl $0x1, -0x8(%rbp)
cmpl $0x2, -0x8(%rbp)
jg 0x11bc4
leaq 0x7934c7(%rip), %rax    # 0x7a4f50
movslq (%rax), %rcx
leaq 0x7934cd(%rip), %rax    # 0x7a4f60
movl (%rax,%rcx,4), %eax
movl %eax, -0x4(%rbp)
cmpl $0x0, -0x4(%rbp)
jl 0x11ac1
movslq -0x4(%rbp), %rcx
leaq 0x1649b6(%rip), %rax    # 0x176460
movb $0x0, (%rax,%rcx)
movslq -0x4(%rbp), %rcx
leaq 0x7934a7(%rip), %rax    # 0x7a4f60
movl (%rax,%rcx,4), %eax
movl %eax, -0x4(%rbp)
jmp 0x11a99
leaq 0x594850(%rip), %rax    # 0x5a6318
movl (%rax), %eax
subl $0x8, %eax
movl %eax, -0xc(%rbp)
callq 0x11490
leaq 0x59483c(%rip), %rax    # 0x5a6318
movl (%rax), %eax
movl -0xc(%rbp), %ecx
addl $0x8, %ecx
cmpl %ecx, %eax
jl 0x11b60
leaq 0x594829(%rip), %rax    # 0x5a6318
movl (%rax), %eax
movl %eax, -0xc(%rbp)
movb $0x5, 0x11be75(%rip)    # 0x12d970
movl -0x8(%rbp), %eax
movb %al, 0x11be6d(%rip)     # 0x12d971
leaq 0x793445(%rip), %rax    # 0x7a4f50
movslq (%rax), %rcx
leaq 0x79344b(%rip), %rax    # 0x7a4f60
movl (%rax,%rcx,4), %eax
movl %eax, -0x4(%rbp)
cmpl $0x0, -0x4(%rbp)
jl 0x11b5e
movslq -0x4(%rbp), %rcx
leaq 0x164934(%rip), %rax    # 0x176460
movsbl (%rax,%rcx), %eax
cmpl -0x8(%rbp), %eax
je 0x11b49
movl -0x4(%rbp), %edi
leaq 0x11be31(%rip), %rsi    # 0x12d970
movl $0x2, %edx
callq 0x89280
jmp 0x11b4b
movslq -0x4(%rbp), %rcx
leaq 0x79340a(%rip), %rax    # 0x7a4f60
movl (%rax,%rcx,4), %eax
movl %eax, -0x4(%rbp)
jmp 0x11b1b
jmp 0x11b60
leaq 0x7933e9(%rip), %rax    # 0x7a4f50
movslq (%rax), %rcx
leaq 0x7933ef(%rip), %rax    # 0x7a4f60
movl (%rax,%rcx,4), %eax
movl %eax, -0x4(%rbp)
cmpl $0x0, -0x4(%rbp)
jl 0x11ba8
movslq -0x4(%rbp), %rcx
leaq 0x1648d8(%rip), %rax    # 0x176460
movsbl (%rax,%rcx), %eax
cmpl -0x8(%rbp), %eax
je 0x11b93
jmp 0x11ba8
jmp 0x11b95
movslq -0x4(%rbp), %rcx
leaq 0x7933c0(%rip), %rax    # 0x7a4f60
movl (%rax,%rcx,4), %eax
movl %eax, -0x4(%rbp)
jmp 0x11b77
jmp 0x11baa
cmpl $0x0, -0x4(%rbp)
jge 0x11ad0
jmp 0x11bb6
movl -0x8(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x8(%rbp)
jmp 0x11a78
jmp 0x11c4a
leaq 0x793380(%rip), %rax    # 0x7a4f50
movslq (%rax), %rcx
leaq 0x164886(%rip), %rax    # 0x176460
movb $0x0, (%rax,%rcx)
leaq 0x79336b(%rip), %rax    # 0x7a4f50
movslq (%rax), %rcx
leaq 0x164871(%rip), %rax    # 0x176460
movsbl (%rax,%rcx), %eax
cmpl $0x2, %eax
je 0x11c48
callq 0x11490
leaq 0x79334c(%rip), %rax    # 0x7a4f50
movslq (%rax), %rcx
leaq 0x164852(%rip), %rax    # 0x176460
movsbl (%rax,%rcx), %eax
cmpl $0x1, %eax
jne 0x11c46
leaq 0x793332(%rip), %rax    # 0x7a4f50
movslq (%rax), %rcx
leaq 0x164838(%rip), %rax    # 0x176460
movb $0x0, (%rax,%rcx)
leaq 0x79331d(%rip), %rax    # 0x7a4f50
movl (%rax), %edi
leaq 0x11bd34(%rip), %rsi    # 0x12d970
movl $0x2, %edx
callq 0x89280
jmp 0x11bde
jmp 0x11c4a
addq $0x10, %rsp
popq %rbp
retq