// File: /workspace/github_cpp_makefile_star2_O1/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 $0x58, %rsp
movl %edx, -0x5c(%rbp)
movq %rsi, -0x38(%rbp)
movq %rdi, %rbx
leaq -0x2c(%rbp), %r12
movq %r12, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x2bbe8
leaq -0x70(%rbp), %rax
movq %rax, -0x10(%rax)
movq $0x0, -0x8(%rax)
movb $0x0, (%rax)
movswl (%rbx), %eax
addl $0x2, %eax
leaq 0x1d67d(%rip), %rcx     # 0x44c68
movq (%rcx), %rcx
movswl (%rcx), %ecx
addl $-0x2, %ecx
cmpl %eax, %ecx
cmovgel %eax, %ecx
movw %cx, (%r12)
movzwl (%rbx), %eax
cmpw $0x4, %ax
movl $0x3, %r14d
cmovll %r14d, %eax
movswl %cx, %ecx
movzwl %ax, %eax
addl $-0x2, %eax
cmpl %ecx, %eax
jg 0x278e9
movabsq $0x2aaaaaaaaaaaaaab, %r15 # imm = 0x2AAAAAAAAAAAAAAB
movswl 0x2(%rbx), %eax
addl $0x2, %eax
leaq 0x1d630(%rip), %rcx     # 0x44c68
movq (%rcx), %rcx
movswl (%rcx), %ecx
addl $-0x2, %ecx
cmpl %eax, %ecx
cmovgel %eax, %ecx
movw %cx, -0x2a(%rbp)
movzwl 0x2(%rbx), %eax
cmpw $0x4, %ax
cmovll %r14d, %eax
movswl %cx, %ecx
movzwl %ax, %eax
addl $-0x2, %eax
cmpl %ecx, %eax
jg 0x278c5
leaq -0x2c(%rbp), %rdi
movl $0x2, %esi
callq 0x20b4f
leaq -0x2c(%rbp), %rdi
movq %rbx, %rsi
callq 0x2bddc
testb %al, %al
jne 0x276af
leaq 0x1d5dc(%rip), %rax     # 0x44c68
movq (%rax), %rax
movswq -0x2a(%rbp), %rcx
movq 0x8(%rax), %rax
leaq (%rcx,%rcx,2), %rcx
movswq -0x2c(%rbp), %rdx
movq (%rax,%rcx,8), %rax
testb $0x40, (%rax,%rdx,4)
je 0x278a0
leaq -0x2c(%rbp), %rdi
callq 0x21415
movq %rax, %r13
cmpq 0x188ee(%rip), %rax     # 0x3ffb0
je 0x278a0
movq %rbx, %rdi
leaq -0x2c(%rbp), %rsi
callq 0x2bc42
movb $0x3, %cl
subb %al, %cl
testb %cl, %cl
jle 0x27712
movb $0x4, %r14b
subb %al, %r14b
callq 0x41d0
movq %rax, %rcx
imulq %r15
movq %rdx, %rax
shrq $0x3f, %rax
addl %edx, %eax
addl %eax, %eax
leal (%rax,%rax,2), %eax
subl %eax, %ecx
movq 0x20(%r13), %rax
notb %cl
addb %cl, 0x153(%rax)
decb %r14b
cmpb $0x1, %r14b
jg 0x276e2
movq 0x20(%r13), %rax
cmpb $0x0, 0x153(%rax)
jle 0x27756
movb $0x1, 0x15d(%rax)
cmpb $0x0, 0x30(%r13)
movl $0x3, %r14d
jne 0x278a0
cmpw $0x0, 0x170(%rax)
je 0x278a0
addq $0x10, %r13
movq %r13, %rdi
callq 0x2213a
jmp 0x278a0
cmpq -0x38(%rbp), %rax
movl $0x3, %r14d
je 0x277c9
movq -0x78(%rbp), %rdx
movl $0x1c, %r8d
leaq -0x80(%rbp), %rdi
xorl %esi, %esi
leaq 0xdf2f(%rip), %rcx      # 0x356a8
callq 0x4640
movq 0x20(%r13), %rdi
movl 0xbc(%rdi), %eax
movq -0x38(%rbp), %rcx
cmpl 0xbc(%rcx), %eax
jne 0x2781b
movq 0x1f7b9(%rip), %rsi     # 0x46f58
movq 0x1f7ba(%rip), %rdx     # 0x46f60
leaq -0x80(%rbp), %rdi
callq 0x4130
cmpb $0x0, -0x5c(%rbp)
je 0x27825
movq -0x38(%rbp), %rax
movq 0x90(%rax), %rax
incq 0xa0(%rax)
jmp 0x27825
leaq -0x48(%rbp), %rax
movq %rax, -0x58(%rbp)
leaq -0x58(%rbp), %r12
movq %r12, %rdi
leaq 0xdeb7(%rip), %rsi      # 0x35696
leaq 0xdec1(%rip), %rdx      # 0x356a7
callq 0xdfec
movq -0x38(%rbp), %rdi
movq %r12, %rsi
xorl %edx, %edx
callq 0x24c43
movq -0x58(%rbp), %rdi
leaq -0x48(%rbp), %rax
cmpq %rax, %rdi
je 0x278a0
movq -0x48(%rbp), %rsi
incq %rsi
callq 0x43f0
jmp 0x278a0
movl $0x5, %esi
callq 0x24e7d
leaq -0x48(%rbp), %rax
movq %rax, -0x58(%rbp)
movq -0x38(%rbp), %rax
movq 0x98(%rax), %rsi
movq 0xa0(%rax), %rdx
addq %rsi, %rdx
leaq -0x58(%rbp), %r12
movq %r12, %rdi
callq 0xfa82
movq -0x50(%rbp), %rsi
movl $0x1, %ecx
movq %r12, %rdi
xorl %edx, %edx
movl $0x2e, %r8d
callq 0x47b0
movq -0x58(%rbp), %rsi
movq -0x50(%rbp), %rdx
leaq -0x80(%rbp), %rdi
callq 0x4130
movq -0x58(%rbp), %rdi
leaq -0x48(%rbp), %rax
cmpq %rax, %rdi
je 0x27891
movq -0x48(%rbp), %rsi
incq %rsi
callq 0x43f0
movq 0x20(%r13), %rdi
leaq -0x80(%rbp), %rsi
xorl %edx, %edx
callq 0x24c43
movzwl -0x2a(%rbp), %eax
decl %eax
movw %ax, -0x2a(%rbp)
movzwl 0x2(%rbx), %ecx
cmpw $0x4, %cx
cmovll %r14d, %ecx
cwtl
movzwl %cx, %ecx
addl $-0x2, %ecx
cmpl %eax, %ecx
jle 0x27667
movzwl -0x2c(%rbp), %eax
decl %eax
movw %ax, -0x2c(%rbp)
movzwl (%rbx), %ecx
cmpw $0x4, %cx
cmovll %r14d, %ecx
cwtl
movzwl %cx, %ecx
addl $-0x2, %ecx
cmpl %eax, %ecx
jle 0x2762a
movl $0x18, %edi
callq 0x43e0
movl (%rbx), %ecx
movl %ecx, 0x10(%rax)
leaq 0x1e6c1(%rip), %rbx     # 0x45fc0
movq %rax, %rdi
movq %rbx, %rsi
callq 0x4060
incq 0x10(%rbx)
movq -0x80(%rbp), %rdi
leaq -0x70(%rbp), %rax
cmpq %rax, %rdi
je 0x27927
movq -0x70(%rbp), %rsi
incq %rsi
callq 0x43f0
leaq -0x2c(%rbp), %rdi
callq 0x2bbf6
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x27969
jmp 0x27947
jmp 0x27969
jmp 0x27947
movq %rax, %rbx
movq -0x58(%rbp), %rdi
leaq -0x48(%rbp), %rax
cmpq %rax, %rdi
je 0x2796c
movq -0x48(%rbp), %rsi
incq %rsi
callq 0x43f0
jmp 0x2796c
jmp 0x27969
jmp 0x27969
movq %rax, %rbx
movq -0x80(%rbp), %rdi
leaq -0x70(%rbp), %rax
cmpq %rax, %rdi
je 0x27985
movq -0x70(%rbp), %rsi
incq %rsi
callq 0x43f0
leaq -0x2c(%rbp), %rdi
callq 0x2bbf6
movq %rbx, %rdi
callq 0x4750