// File: lotuskip[P]yuxtapa/server/chores.cpp
// Function: (anonymous namespace)::capt_flag(std::_List_iterator<NOccEnt>, e_Team)
void capt_flag(const list<NOccEnt>::iterator fit, const e_Team t)
{
	/* A special situation in which capturing cannot be allowed: game mode is
	 * steal, and green team has secured the treasure: */
	if(gamemode == GM_STEAL && t == T_PURPLE && team_flags[t].empty())
		return;
	// Otherwise okay (various checks already made prior to calling this):
	fit->set_col(team_colour[t]);
	fit->set_misc(t);
	team_flags[t].push_back(fit);
	string msg = str_team[t] + " team captured the "
		+ long_sector_name[Game::curmap->coords_in_sector(fit->getpos())]
		+ " flag!";
	Network::construct_msg(msg, team_colour[t]);
	Network::broadcast();
	// In dominion&conquest this always changes objective status:
	if(gamemode == GM_DOM || gamemode == GM_CONQ)
		Game::send_team_upds(cur_players.end());
	Game::send_flag_upds(cur_players.end());
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xd0, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
leaq 0x3952b(%rip), %rax     # 0x91394
cmpl $0x2, (%rax)
jne 0x57e95
cmpl $0x1, -0xc(%rbp)
jne 0x57e95
movl -0xc(%rbp), %eax
leaq 0x3b1f2(%rip), %rdi     # 0x93070
imulq $0x18, %rax, %rax
addq %rax, %rdi
callq 0x3d7b0
testb $0x1, %al
jne 0x57e90
jmp 0x57e95
jmp 0x580c5
leaq -0x8(%rbp), %rdi
movq %rdi, -0xc8(%rbp)
callq 0x3cdf0
movq %rax, %rdi
movl -0xc(%rbp), %eax
leaq 0x12446(%rip), %rcx     # 0x6a2f8
movsbl (%rax,%rcx), %esi
callq 0x49ff0
movq -0xc8(%rbp), %rdi
callq 0x3cdf0
movq %rax, %rdi
movzbl -0xc(%rbp), %esi
callq 0x58430
movq -0xc8(%rbp), %rsi
movl -0xc(%rbp), %eax
leaq (%rax,%rax,2), %rcx
leaq 0x3b188(%rip), %rax     # 0x93070
leaq (%rax,%rcx,8), %rdi
callq 0x4bb60
movl -0xc(%rbp), %eax
shlq $0x5, %rax
leaq 0x3bd41(%rip), %rsi     # 0x93c40
addq %rax, %rsi
leaq 0x1468a(%rip), %rdx     # 0x6c593
leaq -0x70(%rbp), %rdi
callq 0x1b080
movq -0xc8(%rbp), %rdi
leaq 0x39eb8(%rip), %rax     # 0x91dd8
movq (%rax), %rax
movq %rax, -0xc0(%rbp)
callq 0x3cdf0
movq %rax, %rsi
leaq -0x74(%rbp), %rdi
movq %rdi, -0xb8(%rbp)
callq 0x1b190
movq -0xc0(%rbp), %rdi
movq -0xb8(%rbp), %rsi
callq 0x2c120
movl %eax, -0xac(%rbp)
jmp 0x57f5d
movl -0xac(%rbp), %eax
movl %eax, %eax
shlq $0x5, %rax
leaq 0x3bd70(%rip), %rdx     # 0x93ce0
addq %rax, %rdx
leaq -0x50(%rbp), %rdi
leaq -0x70(%rbp), %rsi
callq 0x1fb90
jmp 0x57f82
leaq 0x1461e(%rip), %rdx     # 0x6c5a7
leaq -0x30(%rbp), %rdi
leaq -0x50(%rbp), %rsi
callq 0x18a40
jmp 0x57f98
leaq -0x50(%rbp), %rdi
callq 0x5a48
leaq -0x74(%rbp), %rdi
callq 0x60460
leaq -0x70(%rbp), %rdi
callq 0x5a48
movl -0xc(%rbp), %eax
leaq 0x1233b(%rip), %rcx     # 0x6a2f8
movzbl (%rax,%rcx), %esi
leaq -0x30(%rbp), %rdi
callq 0x1ab10
jmp 0x57fcc
leaq 0x362c5(%rip), %rsi     # 0x8e298
movl $0xffff, %edi           # imm = 0xFFFF
callq 0x19160
jmp 0x57fdf
leaq 0x393ae(%rip), %rax     # 0x91394
cmpl $0x0, (%rax)
je 0x57ffb
leaq 0x393a2(%rip), %rax     # 0x91394
cmpl $0x1, (%rax)
jne 0x58088
leaq 0x3822e(%rip), %rdi     # 0x90230
callq 0x189f0
movq %rax, -0x98(%rbp)
leaq -0x90(%rbp), %rdi
leaq -0x98(%rbp), %rsi
callq 0x18a20
movq -0x90(%rbp), %rdi
callq 0x36ce0
jmp 0x5802f
jmp 0x58088
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x80(%rbp)
movl %eax, -0x84(%rbp)
jmp 0x5805a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x80(%rbp)
movl %eax, -0x84(%rbp)
leaq -0x50(%rbp), %rdi
callq 0x5a48
leaq -0x74(%rbp), %rdi
callq 0x60460
leaq -0x70(%rbp), %rdi
callq 0x5a48
jmp 0x580ce
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x80(%rbp)
movl %eax, -0x84(%rbp)
leaq -0x30(%rbp), %rdi
callq 0x5a48
jmp 0x580ce
leaq 0x381a1(%rip), %rdi     # 0x90230
callq 0x189f0
movq %rax, -0xa8(%rbp)
leaq -0xa0(%rbp), %rdi
leaq -0xa8(%rbp), %rsi
callq 0x18a20
movq -0xa0(%rbp), %rdi
callq 0x38370
jmp 0x580bc
leaq -0x30(%rbp), %rdi
callq 0x5a48
addq $0xd0, %rsp
popq %rbp
retq
movq -0x80(%rbp), %rdi
callq 0x5920
nopw (%rax,%rax)