// File: lotuskip[P]yuxtapa/server/game.cpp
// Function: Game::send_times(std::_List_const_iterator<Player>)
void Game::send_times(const list<Player>::const_iterator to)
{
	// A convenient place as any to do a periodic check on what bots have
	// finished (or crashed or been killed or ...):
	num_bots();

	Network::send_buffer.clear();
	// mid and maptime are the same for all clients:
	Network::send_buffer.add((unsigned char)MID_TIME_UPD);
	Network::send_buffer.add((unsigned short)(
		(map_over_turn - curturn)*int_settings[IS_TURNMS]/1000));
	// but the spawn time is team-specific!
	unsigned char sts[3] = {
		// green spawn time:
		(unsigned char)((spawn_cycle - ((curturn + spawn_cycle/2) % spawn_cycle))
			*int_settings[IS_TURNMS]/1000),
		// purple spawn time:
		(unsigned char)((spawn_cycle - (curturn % spawn_cycle))*int_settings[IS_TURNMS]/1000),
		0 }; // specs don't spawn

	if(to == cur_players.end()) // need to send to all
	{
		for(list<Player>::const_iterator i = cur_players.begin();
			i != cur_players.end(); ++i)
		{
			Network::send_buffer.set_amount(3); // reset to overwrite
			Network::send_buffer.add(sts[i->team]);
			Network::send_to_player(*i);
		}
	}
	else
	{
		Network::send_buffer.add(sts[to->team]);
		Network::send_to_player(*to);
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x8(%rbp)
callq 0x23f40
leaq 0x56120(%rip), %rdi     # 0x8e298
callq 0x5f370
leaq 0x56114(%rip), %rdi     # 0x8e298
movl $0xe, %esi
callq 0x5f390
movzwl 0x553ff(%rip), %eax     # 0x8d594
movzwl 0x59c34(%rip), %ecx     # 0x91dd0
subl %ecx, %eax
leaq 0x5786b(%rip), %rcx     # 0x8fa10
imull 0x14(%rcx), %eax
movl $0x3e8, %ecx            # imm = 0x3E8
xorl %edx, %edx
divl %ecx
leaq 0x560df(%rip), %rdi     # 0x8e298
movzwl %ax, %esi
callq 0x5f3d0
movzbl 0x59c1c(%rip), %eax     # 0x91de4
movl %eax, -0x48(%rbp)
movzwl 0x59bfe(%rip), %eax     # 0x91dd0
movl %eax, -0x4c(%rbp)
movzbl 0x59c08(%rip), %eax     # 0x91de4
movl $0x2, %ecx
cltd
idivl %ecx
movl %eax, %ecx
movl -0x4c(%rbp), %eax
addl %ecx, %eax
movzbl 0x59bf2(%rip), %ecx     # 0x91de4
cltd
idivl %ecx
movl -0x48(%rbp), %eax
subl %edx, %eax
leaq 0x5780f(%rip), %rcx     # 0x8fa10
imull 0x14(%rcx), %eax
movl $0x3e8, %ecx            # imm = 0x3E8
xorl %edx, %edx
divl %ecx
movb %al, -0xb(%rbp)
movzbl 0x59bcc(%rip), %eax     # 0x91de4
movl %eax, -0x44(%rbp)
movzwl 0x59bae(%rip), %eax     # 0x91dd0
movzbl 0x59bbb(%rip), %ecx     # 0x91de4
cltd
idivl %ecx
movl -0x44(%rbp), %eax
subl %edx, %eax
leaq 0x577d8(%rip), %rcx     # 0x8fa10
imull 0x14(%rcx), %eax
movl $0x3e8, %ecx            # imm = 0x3E8
xorl %edx, %edx
divl %ecx
movb %al, -0xa(%rbp)
movb $0x0, -0x9(%rbp)
leaq 0x57fdd(%rip), %rdi     # 0x90230
callq 0x189f0
movq %rax, -0x20(%rbp)
leaq -0x18(%rbp), %rdi
leaq -0x20(%rbp), %rsi
callq 0x18a20
leaq -0x8(%rbp), %rdi
leaq -0x18(%rbp), %rsi
callq 0x3d5a0
testb $0x1, %al
jne 0x3827f
jmp 0x38325
leaq 0x57faa(%rip), %rdi     # 0x90230
callq 0x1b360
movq %rax, -0x30(%rbp)
leaq -0x28(%rbp), %rdi
leaq -0x30(%rbp), %rsi
callq 0x18a20
leaq 0x57f8d(%rip), %rdi     # 0x90230
callq 0x189f0
movq %rax, -0x40(%rbp)
leaq -0x38(%rbp), %rdi
leaq -0x40(%rbp), %rsi
callq 0x18a20
leaq -0x28(%rbp), %rdi
leaq -0x38(%rbp), %rsi
callq 0x24f10
testb $0x1, %al
jne 0x382cc
jmp 0x38323
leaq 0x55fc5(%rip), %rdi     # 0x8e298
movl $0x3, %esi
callq 0x5f740
leaq -0x28(%rbp), %rdi
callq 0x24f40
movl 0xac(%rax), %eax
leaq 0x55fa5(%rip), %rdi     # 0x8e298
movzbl -0xb(%rbp,%rax), %esi
callq 0x5f390
leaq -0x28(%rbp), %rdi
callq 0x3d790
movq %rax, %rdi
leaq 0x55f88(%rip), %rsi     # 0x8e298
callq 0x1af60
leaq -0x28(%rbp), %rdi
callq 0x250a0
jmp 0x3829c
jmp 0x3835d
leaq -0x8(%rbp), %rdi
callq 0x24f40
movl 0xac(%rax), %eax
leaq 0x55f5d(%rip), %rdi     # 0x8e298
movzbl -0xb(%rbp,%rax), %esi
callq 0x5f390
leaq -0x8(%rbp), %rdi
callq 0x3d790
movq %rax, %rdi
leaq 0x55f40(%rip), %rsi     # 0x8e298
callq 0x1af60
addq $0x50, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)