// File: /workspace/github_cpp_makefile_star2_O2/lotuskip[P]yuxtapa/server/chores.cpp
// Function: (anonymous namespace)::fireball_trigger(Coords const&, std::_List_iterator<Player>, bool)
void fireball_trigger(const Coords &pos, const list<Player>::iterator triggerer,
	const bool intentional)
{
	Coords c;
	list<PCEnt>::iterator pc_it;
	char ch;
	string msg;
	for(c.x = min(pos.x+2, Game::curmap->get_size()-2); c.x >= max(1, pos.x-2); --(c.x))
	{
		for(c.y = min(pos.y+2, Game::curmap->get_size()-2); c.y >= max(1, pos.y-2); --(c.y))
		{
			add_sound(c, S_BOOM);
			if((c == pos /* occupied-flag might not be set for the triggerer yet;
				we check this point unnecessarily when triggering with an arrow. */
				|| (Game::curmap->get_tile(c).flags & TF_OCCUPIED))
				&& (pc_it = any_pc_at(c)) != PCs.end())
			{
				// damage is (3-radius)d6:
				for(ch = 3 - pos.dist_walk(c); ch > 0; --ch)
					pc_it->get_owner()->cl_props.hp -= 1 + random()%6;
				if(pc_it->get_owner()->cl_props.hp <= 0) // died
				{
					if(pc_it->get_owner() == triggerer)
						player_death(triggerer, " fried to a trap.", false);
					else
					{
						msg = " was taken to the flames by ";
						if(pc_it->get_owner()->team == triggerer->team)
						{
							msg += teammate_str;
							if(intentional)
								triggerer->stats_i->tks++;
						}
						else
							record_kill(pc_it->get_owner(), WTK_FIREB);
						msg += triggerer->nick + '.';
						player_death(pc_it->get_owner(), msg, false);
					}
				}
				else // survived
				{
					pc_it->get_owner()->needs_state_upd = true;
					// light torch if any:
					if(!pc_it->torch_is_lit() && pc_it->get_owner()->torch_left)
						pc_it->toggle_torch();
				}
			}
		}
	}
	fball_centers.push_back(pos);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x68, %rsp
movl %edx, -0x44(%rbp)
movq %rsi, %r14
movq %rdi, %rbx
leaq -0x2c(%rbp), %r12
movq %r12, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x24d90
leaq -0x60(%rbp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
movb $0x0, (%rax)
movq %rbx, -0x38(%rbp)
movswl (%rbx), %eax
movl %eax, %edx
addl $0x2, %edx
leaq 0x204f1(%rip), %rcx     # 0x41c58
movq (%rcx), %rcx
movswl (%rcx), %ecx
addl $-0x2, %ecx
cmpl %edx, %ecx
cmovgel %edx, %ecx
movq %r14, -0x40(%rbp)
leaq 0x98(%r14), %rdx
movq %rdx, -0x50(%rbp)
pushq $0x6
popq %r14
movw %cx, -0x2c(%rbp)
cmpw $0x4, %ax
pushq $0x3
popq %rdx
cmovgel %eax, %edx
movswl %cx, %eax
movzwl %dx, %ecx
addl $-0x2, %ecx
cmpl %eax, %ecx
jg 0x219a5
movq -0x38(%rbp), %rax
movswl 0x2(%rax), %eax
movl %eax, %edx
addl $0x2, %edx
leaq 0x2049d(%rip), %rcx     # 0x41c58
movq (%rcx), %rcx
movswl (%rcx), %ecx
addl $-0x2, %ecx
cmpl %edx, %ecx
cmovgel %edx, %ecx
movw %cx, -0x2a(%rbp)
cmpw $0x4, %ax
pushq $0x3
popq %rdx
cmovgel %eax, %edx
movswl %cx, %eax
movzwl %dx, %ecx
addl $-0x2, %ecx
cmpl %eax, %ecx
jg 0x21993
movq %r12, %rdi
pushq $0x2
popq %rsi
callq 0x1b202
movq %r12, %rdi
movq -0x38(%rbp), %rsi
callq 0x24f42
testb %al, %al
jne 0x2182d
leaq 0x2044e(%rip), %rax     # 0x41c58
movq (%rax), %rax
movswq -0x2a(%rbp), %rcx
movq 0x8(%rax), %rax
imulq $0x18, %rcx, %rcx
movswq -0x2c(%rbp), %rdx
movq (%rax,%rcx), %rax
testb $0x40, (%rax,%rdx,4)
je 0x21980
movq %r12, %rdi
callq 0x1b9db
movq %rax, %r13
cmpq 0x1b769(%rip), %rax     # 0x3cfa8
je 0x21980
movq -0x38(%rbp), %rdi
movq %r12, %rsi
callq 0x24dd8
movb $0x3, %r15b
subb %al, %r15b
testb %r15b, %r15b
jle 0x21877
callq 0x41e0
cqto
idivq %r14
movq 0x20(%r13), %rax
notb %dl
addb %dl, 0x153(%rax)
decb %r15b
jmp 0x21857
movq 0x20(%r13), %rax
cmpb $0x0, 0x153(%rax)
jle 0x218b5
movb $0x1, 0x15d(%rax)
cmpb $0x0, 0x30(%r13)
jne 0x21980
cmpw $0x0, 0x170(%rax)
je 0x21980
addq $0x10, %r13
movq %r13, %rdi
callq 0x1cb8c
jmp 0x21980
cmpq -0x40(%rbp), %rax
je 0x2190b
leaq -0x70(%rbp), %rdi
leaq 0xde2b(%rip), %rsi      # 0x2f6f1
callq 0x4780
movq 0x20(%r13), %rdi
movl 0xbc(%rdi), %eax
movq -0x40(%rbp), %rcx
cmpl 0xbc(%rcx), %eax
jne 0x2193d
leaq -0x70(%rbp), %rdi
leaq 0x2265c(%rip), %rsi     # 0x43f48
callq 0x4790
cmpb $0x0, -0x44(%rbp)
je 0x21945
movq -0x40(%rbp), %rax
movq 0x90(%rax), %rax
incq 0xa0(%rax)
jmp 0x21945
leaq -0x90(%rbp), %r13
movq %r13, %rdi
leaq 0xddc3(%rip), %rsi      # 0x2f6df
leaq -0x2d(%rbp), %rdx
callq 0xb292
movq -0x40(%rbp), %rdi
movq %r13, %rsi
xorl %edx, %edx
callq 0x1f393
movq %r13, %rdi
callq 0x47e8
jmp 0x21980
pushq $0x5
popq %rsi
callq 0x1f544
leaq -0x90(%rbp), %rbx
movq %rbx, %rdi
movq -0x50(%rbp), %rsi
pushq $0x2e
popq %rdx
callq 0xe0b7
leaq -0x70(%rbp), %r15
movq %r15, %rdi
movq %rbx, %rsi
callq 0x4790
movq %rbx, %rdi
callq 0x47e8
movq 0x20(%r13), %rdi
movq %r15, %rsi
xorl %edx, %edx
callq 0x1f393
movzwl -0x2a(%rbp), %ecx
decl %ecx
movq -0x38(%rbp), %rax
movzwl 0x2(%rax), %eax
jmp 0x217c9
movzwl -0x2c(%rbp), %ecx
decl %ecx
movq -0x38(%rbp), %rax
movzwl (%rax), %eax
jmp 0x21788
leaq 0x21604(%rip), %rdi     # 0x42fb0
movq -0x38(%rbp), %rsi
callq 0x21b54
leaq -0x70(%rbp), %rdi
callq 0x47e8
leaq -0x2c(%rbp), %rdi
callq 0x24d9e
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x219f1
jmp 0x219dc
jmp 0x219f1
movq %rax, %rbx
leaq -0x90(%rbp), %rdi
callq 0x47e8
jmp 0x219f4
jmp 0x219f1
jmp 0x219f1
movq %rax, %rbx
leaq -0x70(%rbp), %rdi
callq 0x47e8
leaq -0x2c(%rbp), %rdi
callq 0x24d9e
movq %rbx, %rdi
callq 0x4710