// File: /workspace/github_c_makefile_star2_O0/QwazyWabbitWOS[P]lmctf60/g_spawn.c
// Function: G_FindTeams
void G_FindTeams (void)
{
	edict_t	*e, *e2, *chain;
	int		i, j;
	int		c, c2;

	c = 0;
	c2 = 0;
	for (i=1, e=g_edicts+i ; i < globals.num_edicts ; i++,e++)
	{
		if (!e->inuse)
			continue;
		if (!e->team)
			continue;
		if (e->flags & FL_TEAMSLAVE)
			continue;
		chain = e;
		e->teammaster = e;
		c++;
		c2++;
		for (j=i+1, e2=e+1 ; j < globals.num_edicts ; j++,e2++)
		{
			if (!e2->inuse)
				continue;
			if (!e2->team)
				continue;
			if (e2->flags & FL_TEAMSLAVE)
				continue;
			if (!strcmp(e->team, e2->team))
			{
				c2++;
				chain->teamchain = e2;
				e2->teammaster = e;
				chain = e2;
				e2->flags |= FL_TEAMSLAVE;
			}
		}
	}

	gi.dprintf ("%i teams with %i entities\n", c, c2);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movl $0x0, -0x24(%rbp)
movl $0x0, -0x28(%rbp)
movl $0x1, -0x1c(%rbp)
movq 0x36de4(%rip), %rax     # 0x82558
movq (%rax), %rax
movslq -0x1c(%rbp), %rcx
imulq $0x4a8, %rcx, %rcx      # imm = 0x4A8
addq %rcx, %rax
movq %rax, -0x8(%rbp)
movl -0x1c(%rbp), %eax
movq 0x37375(%rip), %rcx     # 0x82b08
cmpl 0x8c(%rcx), %eax
jge 0x4b906
movq -0x8(%rbp), %rax
cmpl $0x0, 0x60(%rax)
jne 0x4b7ae
jmp 0x4b8ea
movq -0x8(%rbp), %rax
cmpq $0x0, 0x168(%rax)
jne 0x4b7c1
jmp 0x4b8ea
movq -0x8(%rbp), %rax
movl 0x11c(%rax), %eax
andl $0x400, %eax            # imm = 0x400
cmpl $0x0, %eax
je 0x4b7da
jmp 0x4b8ea
movq -0x8(%rbp), %rax
movq %rax, -0x18(%rbp)
movq -0x8(%rbp), %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x2d0(%rax)
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
movl -0x28(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x28(%rbp)
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x20(%rbp)
movq -0x8(%rbp), %rax
addq $0x4a8, %rax            # imm = 0x4A8
movq %rax, -0x10(%rbp)
movl -0x20(%rbp), %eax
movq 0x372e4(%rip), %rcx     # 0x82b08
cmpl 0x8c(%rcx), %eax
jge 0x4b8e8
movq -0x10(%rbp), %rax
cmpl $0x0, 0x60(%rax)
jne 0x4b83f
jmp 0x4b8cc
movq -0x10(%rbp), %rax
cmpq $0x0, 0x168(%rax)
jne 0x4b84f
jmp 0x4b8cc
movq -0x10(%rbp), %rax
movl 0x11c(%rax), %eax
andl $0x400, %eax            # imm = 0x400
cmpl $0x0, %eax
je 0x4b865
jmp 0x4b8cc
movq -0x8(%rbp), %rax
movq 0x168(%rax), %rdi
movq -0x10(%rbp), %rax
movq 0x168(%rax), %rsi
callq 0x18bf0
cmpl $0x0, %eax
jne 0x4b8ca
movl -0x28(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x28(%rbp)
movq -0x10(%rbp), %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x2c8(%rax)
movq -0x8(%rbp), %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x2d0(%rax)
movq -0x10(%rbp), %rax
movq %rax, -0x18(%rbp)
movq -0x10(%rbp), %rax
movl 0x11c(%rax), %ecx
orl $0x400, %ecx            # imm = 0x400
movl %ecx, 0x11c(%rax)
jmp 0x4b8cc
movl -0x20(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x20(%rbp)
movq -0x10(%rbp), %rax
addq $0x4a8, %rax            # imm = 0x4A8
movq %rax, -0x10(%rbp)
jmp 0x4b81a
jmp 0x4b8ea
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
movq -0x8(%rbp), %rax
addq $0x4a8, %rax            # imm = 0x4A8
movq %rax, -0x8(%rbp)
jmp 0x4b789
movq 0x36cf3(%rip), %rax     # 0x82600
movq 0x8(%rax), %rcx
movl -0x24(%rbp), %esi
movl -0x28(%rbp), %edx
leaq 0x29b51(%rip), %rdi     # 0x7546f
movb $0x0, %al
callq *%rcx
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax,%rax)