// File: /workspace/github_cpp_makefile_star2_O1/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x68, %rsp
movq %rdi, %rbx
leaq 0x1c873(%rip), %r15     # 0x44224
leaq 0x1e548(%rip), %rax     # 0x45f00
cmpl $0x1, %esi
jne 0x279d1
cmpl $0x2, (%r15)
jne 0x279d1
leaq 0x18(%rax), %rcx
cmpq %rcx, 0x18(%rax)
je 0x27ba1
movl %esi, %r12d
leaq 0xd7bd(%rip), %rcx      # 0x35198
movb (%r12,%rcx), %r13b
movb %r13b, 0x1d(%rbx)
movb %sil, 0x1f(%rbx)
leaq (%r12,%r12,2), %rcx
leaq (%rax,%rcx,8), %r14
movl $0x18, %edi
callq 0x43e0
movq %rbx, 0x10(%rax)
movq %rax, %rdi
movq %r14, %rsi
callq 0x4060
incq 0x10(%r14)
shlq $0x5, %r12
leaq 0x1f0b9(%rip), %rax     # 0x46ad0
leaq -0x40(%rbp), %rcx
movq %rcx, -0x10(%rcx)
movq (%r12,%rax), %rsi
movq 0x8(%r12,%rax), %rdx
addq %rsi, %rdx
leaq -0x50(%rbp), %r14
movq %r14, %rdi
callq 0xfa82
leaq 0xdbec(%rip), %rsi      # 0x3562a
movq %r14, %rdi
callq 0x47c0
leaq 0x1d21b(%rip), %rax     # 0x44c68
movq (%rax), %rdi
movl 0x18(%rbx), %eax
leaq -0x2c(%rbp), %rsi
movl %eax, (%rsi)
callq 0x17406
movl %eax, %eax
shlq $0x5, %rax
leaq 0x1f105(%rip), %rcx     # 0x46b70
movq (%rax,%rcx), %rsi
movq 0x8(%rax,%rcx), %rdx
leaq -0x50(%rbp), %rdi
callq 0x4130
leaq -0x80(%rbp), %rbx
movq %rbx, -0x10(%rbx)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x27aa4
movq %rdx, -0x90(%rbp)
movq (%rcx), %rdx
movq %rdx, -0x80(%rbp)
jmp 0x27aaa
movups (%rcx), %xmm0
movups %xmm0, (%rbx)
movq 0x8(%rax), %rdx
leaq -0x90(%rbp), %rdi
movq %rdx, 0x8(%rdi)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
leaq 0xdb6f(%rip), %rsi      # 0x3563e
callq 0x47c0
leaq -0x60(%rbp), %r14
movq %r14, -0x10(%r14)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x27af8
movq %rdx, -0x70(%rbp)
movq (%rcx), %rdx
movq %rdx, -0x60(%rbp)
jmp 0x27aff
movups (%rcx), %xmm0
movups %xmm0, (%r14)
movq 0x8(%rax), %rdx
movq %rdx, -0x68(%rbp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq -0x90(%rbp), %rdi
cmpq %rbx, %rdi
je 0x27b2e
movq -0x80(%rbp), %rsi
incq %rsi
callq 0x43f0
leaq -0x2c(%rbp), %rdi
callq 0x2bbf6
movq -0x50(%rbp), %rdi
leaq -0x40(%rbp), %rax
cmpq %rax, %rdi
je 0x27b50
movq -0x40(%rbp), %rsi
incq %rsi
callq 0x43f0
movzbl %r13b, %esi
leaq -0x70(%rbp), %rdi
callq 0xf4ed
leaq 0x195c4(%rip), %rsi     # 0x41128
movl $0xffff, %edi           # imm = 0xFFFF
callq 0xe383
cmpl $0x1, (%r15)
ja 0x27b80
leaq 0x1b545(%rip), %rdi     # 0x430c0
callq 0x19f7b
leaq 0x1b539(%rip), %rdi     # 0x430c0
callq 0x1b30b
movq -0x70(%rbp), %rdi
cmpq %r14, %rdi
je 0x27ba1
movq -0x60(%rbp), %rsi
incq %rsi
callq 0x43f0
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x27bd6
jmp 0x27bd6
movq %rax, %r15
movq -0x90(%rbp), %rdi
cmpq %rbx, %rdi
je 0x27beb
movq -0x80(%rbp), %rsi
incq %rsi
callq 0x43f0
jmp 0x27beb
movq %rax, %r15
jmp 0x27bf4
movq %rax, %r15
movq -0x70(%rbp), %rdi
cmpq %r14, %rdi
je 0x27c0d
movq -0x60(%rbp), %rsi
jmp 0x27c05
movq %rax, %r15
leaq -0x2c(%rbp), %rdi
callq 0x2bbf6
movq -0x50(%rbp), %rdi
leaq -0x40(%rbp), %rax
cmpq %rax, %rdi
je 0x27c0d
movq -0x40(%rbp), %rsi
incq %rsi
callq 0x43f0
movq %r15, %rdi
callq 0x4750