// File: lotuskip[P]yuxtapa/server/game.cpp
// Function: Game::send_team_info(std::_List_const_iterator<Player>)
void Game::send_team_info(const std::list<Player>::const_iterator to)
{
	// We will reuse renderbuffer for sending (it is vacant space when not
	// rendering).
	char *p = &(renderbuffer[1]);
	if(to->team == T_SPEC)
		renderbuffer[0] = cur_players.size() - num_players[0] - num_players[1];
	else
		renderbuffer[0] = num_players[to->team];
	if(renderbuffer[0] > VIEWSIZE) // can't print more than this
		renderbuffer[0] = VIEWSIZE;
	int count = renderbuffer[0];
	for(list<Player>::const_iterator it = cur_players.begin();
		it != cur_players.end(); ++it)
		if(it->team == to->team)
		{
			strcpy(p, it->nick.c_str());
			p += it->nick.length(); // skip '\0'
			if(it->botpid != -1)
			{
				strcpy(p, " (B)");
				p += 5; // include '\0'
			}
			else
			{
				strcpy(p, admin_lvl_str[it->stats_i->ad_lvl].c_str());
				p += admin_lvl_str[it->stats_i->ad_lvl].length()+1;
			}
			*(p++) = it->cl; // class
			if(it->is_alive()) // sector
				*(p++) = it->sector;
			else
				*(p++) = -1; // signifies dead
			if(!(--count))
				break;
		}
	Network::send_buffer.clear();
	Network::send_buffer.add((unsigned char)MID_TEAM_INFO);
	Network::send_buffer.write_compressed(renderbuffer, p - renderbuffer);
	Network::send_to_player(*to);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x8(%rbp)
leaq 0x56abd(%rip), %rax     # 0x91df0
addq $0x1, %rax
movq %rax, -0x10(%rbp)
leaq -0x8(%rbp), %rdi
callq 0x24f40
cmpl $0x2, 0xac(%rax)
jne 0x3b375
leaq 0x54edc(%rip), %rdi     # 0x90230
callq 0x25070
movzbl 0x56031(%rip), %ecx     # 0x91391
subq %rcx, %rax
movzbl 0x56028(%rip), %ecx     # 0x91392
subq %rcx, %rax
movb %al, 0x56a7d(%rip)      # 0x91df0
jmp 0x3b396
leaq -0x8(%rbp), %rdi
callq 0x24f40
movl 0xac(%rax), %eax
movl %eax, %ecx
leaq 0x56004(%rip), %rax     # 0x91391
movb (%rax,%rcx), %al
movb %al, 0x56a5a(%rip)      # 0x91df0
movsbl 0x56a53(%rip), %eax     # 0x91df0
cmpl $0x17, %eax
jle 0x3b3a9
movb $0x17, 0x56a47(%rip)    # 0x91df0
movsbl 0x56a40(%rip), %eax     # 0x91df0
movl %eax, -0x14(%rbp)
leaq 0x54e76(%rip), %rdi     # 0x90230
callq 0x1b360
movq %rax, -0x28(%rbp)
leaq -0x20(%rbp), %rdi
leaq -0x28(%rbp), %rsi
callq 0x18a20
leaq 0x54e59(%rip), %rdi     # 0x90230
callq 0x189f0
movq %rax, -0x38(%rbp)
leaq -0x30(%rbp), %rdi
leaq -0x38(%rbp), %rsi
callq 0x18a20
leaq -0x20(%rbp), %rdi
leaq -0x30(%rbp), %rsi
callq 0x24f10
testb $0x1, %al
jne 0x3b403
jmp 0x3b5c2
leaq -0x20(%rbp), %rdi
callq 0x24f40
movl 0xac(%rax), %eax
movl %eax, -0x3c(%rbp)
leaq -0x8(%rbp), %rdi
callq 0x24f40
movq %rax, %rcx
movl -0x3c(%rbp), %eax
cmpl 0xac(%rcx), %eax
jne 0x3b5b2
movq -0x10(%rbp), %rax
movq %rax, -0x48(%rbp)
leaq -0x20(%rbp), %rdi
callq 0x24f40
movq %rax, %rdi
addq $0x88, %rdi
callq 0x5200
movq -0x48(%rbp), %rdi
movq %rax, %rsi
callq 0x54d0
leaq -0x20(%rbp), %rdi
callq 0x24f40
movq %rax, %rdi
addq $0x88, %rdi
callq 0x57e0
addq -0x10(%rbp), %rax
movq %rax, -0x10(%rbp)
leaq -0x20(%rbp), %rdi
callq 0x24f40
cmpl $-0x1, 0x164(%rax)
je 0x3b4af
movq -0x10(%rbp), %rdi
leaq 0x28ca7(%rip), %rsi     # 0x64140
callq 0x54d0
movq -0x10(%rbp), %rax
addq $0x5, %rax
movq %rax, -0x10(%rbp)
jmp 0x3b531
movq -0x10(%rbp), %rax
movq %rax, -0x50(%rbp)
leaq -0x20(%rbp), %rdi
callq 0x24f40
movq %rax, %rdi
addq $0x80, %rdi
callq 0x1b390
movl 0x130(%rax), %eax
leaq 0x55994(%rip), %rdi     # 0x90e70
shlq $0x5, %rax
addq %rax, %rdi
callq 0x5200
movq -0x50(%rbp), %rdi
movq %rax, %rsi
callq 0x54d0
leaq -0x20(%rbp), %rdi
callq 0x24f40
movq %rax, %rdi
addq $0x80, %rdi
callq 0x1b390
movl 0x130(%rax), %eax
leaq 0x55957(%rip), %rdi     # 0x90e70
shlq $0x5, %rax
addq %rax, %rdi
callq 0x57e0
addq $0x1, %rax
addq -0x10(%rbp), %rax
movq %rax, -0x10(%rbp)
leaq -0x20(%rbp), %rdi
callq 0x24f40
movl 0xb0(%rax), %eax
movb %al, %cl
movq -0x10(%rbp), %rax
movq %rax, %rdx
addq $0x1, %rdx
movq %rdx, -0x10(%rbp)
movb %cl, (%rax)
leaq -0x20(%rbp), %rdi
callq 0x24f40
movq %rax, %rdi
callq 0x21cd0
testb $0x1, %al
jne 0x3b56a
jmp 0x3b58e
leaq -0x20(%rbp), %rdi
callq 0x24f40
movl 0x15c(%rax), %eax
movb %al, %cl
movq -0x10(%rbp), %rax
movq %rax, %rdx
addq $0x1, %rdx
movq %rdx, -0x10(%rbp)
movb %cl, (%rax)
jmp 0x3b5a0
movq -0x10(%rbp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, -0x10(%rbp)
movb $-0x1, (%rax)
movl -0x14(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x14(%rbp)
cmpl $0x0, %eax
jne 0x3b5b0
jmp 0x3b5c2
jmp 0x3b5b2
jmp 0x3b5b4
leaq -0x20(%rbp), %rdi
callq 0x250a0
jmp 0x3b3d0
leaq 0x52ccf(%rip), %rdi     # 0x8e298
callq 0x5f370
leaq 0x52cc3(%rip), %rdi     # 0x8e298
movl $0x5, %esi
callq 0x5f390
movq -0x10(%rbp), %rax
leaq 0x56806(%rip), %rcx     # 0x91df0
subq %rcx, %rax
leaq 0x52ca4(%rip), %rdi     # 0x8e298
leaq 0x567f5(%rip), %rsi     # 0x91df0
movzwl %ax, %edx
callq 0x5f4e0
leaq -0x8(%rbp), %rdi
callq 0x3d790
movq %rax, %rdi
leaq 0x52c82(%rip), %rsi     # 0x8e298
callq 0x1af60
addq $0x50, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)