// File: lotuskip[P]yuxtapa/server/game.cpp
// Function: Game::send_flag_upds(std::_List_const_iterator<Player>)
void Game::send_flag_upds(const list<Player>::const_iterator to)
{
	unsigned char flagbuf[MAX_D+1] = { MAX_PREDEF_CPAIR, MAX_PREDEF_CPAIR,
		MAX_PREDEF_CPAIR, MAX_PREDEF_CPAIR, MAX_PREDEF_CPAIR, MAX_PREDEF_CPAIR,
		MAX_PREDEF_CPAIR, MAX_PREDEF_CPAIR, MAX_PREDEF_CPAIR };
	char ch, bp;
	for(list<NOccEnt>::const_iterator it = noccents[NOE_FLAG].begin();
		it != noccents[NOE_FLAG].end(); ++it)
	{
		ch = Game::curmap->coords_in_sector(it->getpos());
		if(it->get_m() == T_NO_TEAM) // neutral flag
			flagbuf[ch] = C_NEUT_FLAG;
		else
		{
			bp = it->get_m();
			flagbuf[ch] = C_GREEN_PC
				+ bp // +1 if purple
				+ NUM_NORM_COLS*(it == *(--(team_flags[bp].end()))); // make lit if spawn flag
		}
	}

	Network::send_buffer.clear();
	Network::send_buffer.add((unsigned char)MID_FLAG_UPD);
	for(ch = 0; ch <= MAX_D; ++ch)
		Network::send_buffer.add(flagbuf[ch]);

	if(to == cur_players.end()) // send to all
		Network::broadcast();
	else // only send to 'to'
		Network::send_to_player(*to);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x90, %rsp
movq %rdi, -0x8(%rbp)
movq 0x2bc3c(%rip), %rax     # 0x63fc2
movq %rax, -0x11(%rbp)
movb 0x2bc3a(%rip), %al      # 0x63fca
movb %al, -0x9(%rbp)
leaq 0x5ab96(%rip), %rdi     # 0x92f30
addq $0x78, %rdi
callq 0x3c950
movq %rax, -0x28(%rbp)
leaq -0x20(%rbp), %rdi
leaq -0x28(%rbp), %rsi
callq 0x3c980
leaq 0x5ab75(%rip), %rdi     # 0x92f30
addq $0x78, %rdi
callq 0x3c9d0
movq %rax, -0x38(%rbp)
leaq -0x30(%rbp), %rdi
leaq -0x38(%rbp), %rsi
callq 0x3c980
leaq -0x20(%rbp), %rdi
leaq -0x30(%rbp), %rsi
callq 0x3c9a0
testb $0x1, %al
jne 0x383eb
jmp 0x3850d
movq 0x599e6(%rip), %rax     # 0x91dd8
movq %rax, -0x88(%rbp)
leaq -0x20(%rbp), %rdi
callq 0x3ca00
movq %rax, %rsi
leaq -0x3c(%rbp), %rdi
movq %rdi, -0x80(%rbp)
callq 0x1b190
movq -0x88(%rbp), %rdi
movq -0x80(%rbp), %rsi
callq 0x2c120
movl %eax, -0x74(%rbp)
jmp 0x38427
movl -0x74(%rbp), %eax
movb %al, -0x12(%rbp)
leaq -0x3c(%rbp), %rdi
callq 0x60460
leaq -0x20(%rbp), %rdi
callq 0x3ca00
movq %rax, %rdi
callq 0x3d8b0
movzbl %al, %eax
cmpl $0x3, %eax
jne 0x38478
movsbq -0x12(%rbp), %rax
movb $0x27, -0x11(%rbp,%rax)
jmp 0x384fd
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
leaq -0x3c(%rbp), %rdi
callq 0x60460
jmp 0x385bb
leaq -0x20(%rbp), %rdi
callq 0x3ca00
movq %rax, %rdi
callq 0x3d8b0
movb %al, -0x13(%rbp)
movsbl -0x13(%rbp), %eax
addl $0x1e, %eax
movl %eax, -0x8c(%rbp)
movsbq -0x13(%rbp), %rax
leaq 0x5abcb(%rip), %rdi     # 0x93070
imulq $0x18, %rax, %rax
addq %rax, %rdi
callq 0x3d900
movq %rax, -0x60(%rbp)
leaq -0x60(%rbp), %rdi
callq 0x3d930
movq %rax, %rdi
callq 0x3d950
movq %rax, %rsi
leaq -0x58(%rbp), %rdi
callq 0x3c980
leaq -0x20(%rbp), %rdi
leaq -0x58(%rbp), %rsi
callq 0x3d8d0
movb %al, %cl
movl -0x8c(%rbp), %eax
andb $0x1, %cl
movzbl %cl, %ecx
imull $0x14, %ecx, %ecx
addl %ecx, %eax
movb %al, %cl
movsbq -0x12(%rbp), %rax
movb %cl, -0x11(%rbp,%rax)
jmp 0x384ff
leaq -0x20(%rbp), %rdi
callq 0x3ca30
jmp 0x383b4
leaq 0x55d84(%rip), %rdi     # 0x8e298
callq 0x5f370
leaq 0x55d78(%rip), %rdi     # 0x8e298
movl $0xf, %esi
callq 0x5f390
movb $0x0, -0x12(%rbp)
movsbl -0x12(%rbp), %eax
cmpl $0x8, %eax
jg 0x38557
movsbq -0x12(%rbp), %rax
leaq 0x55d55(%rip), %rdi     # 0x8e298
movzbl -0x11(%rbp,%rax), %esi
callq 0x5f390
movb -0x12(%rbp), %al
addb $0x1, %al
movb %al, -0x12(%rbp)
jmp 0x3852e
leaq 0x57cd2(%rip), %rdi     # 0x90230
callq 0x189f0
movq %rax, -0x70(%rbp)
leaq -0x68(%rbp), %rdi
leaq -0x70(%rbp), %rsi
callq 0x18a20
leaq -0x8(%rbp), %rdi
leaq -0x68(%rbp), %rsi
callq 0x3d5a0
testb $0x1, %al
jne 0x38587
jmp 0x3859a
movl $0xffff, %edi           # imm = 0xFFFF
leaq 0x55d05(%rip), %rsi     # 0x8e298
callq 0x19160
jmp 0x385b2
leaq -0x8(%rbp), %rdi
callq 0x3d790
movq %rax, %rdi
leaq 0x55ceb(%rip), %rsi     # 0x8e298
callq 0x1af60
addq $0x90, %rsp
popq %rbp
retq
movq -0x48(%rbp), %rdi
callq 0x5920
nopw %cs:(%rax,%rax)