// File: /workspace/github_cpp_makefile_star2_O3/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 0x2b798
leaq -0x70(%rbp), %rax
movq %rax, -0x10(%rax)
movq $0x0, -0x8(%rax)
movb $0x0, (%rax)
movswl (%rbx), %eax
leal 0x2(%rax), %edx
leaq 0x1d883(%rip), %rcx     # 0x44c68
movq (%rcx), %rcx
movswl (%rcx), %ecx
addl $-0x2, %ecx
cmpl %edx, %ecx
cmovgel %edx, %ecx
movw %cx, (%r12)
movswl %cx, %edx
cmpw $0x4, %ax
movl $0x3, %r15d
movl %eax, %esi
cmovll %r15d, %esi
addl $-0x2, %esi
cmpl %edx, %esi
jg 0x276f3
movzwl 0x2(%rbx), %edx
movabsq $0x2aaaaaaaaaaaaaab, %r14 # imm = 0x2AAAAAAAAAAAAAAB
movswl %dx, %esi
leal 0x2(%rsi), %edi
leaq 0x1d837(%rip), %r8      # 0x44c68
movq (%r8), %r8
movswl (%r8), %r8d
addl $-0x2, %r8d
cmpl %edi, %r8d
cmovgel %edi, %r8d
movw %r8w, -0x2a(%rbp)
cmpw $0x4, %si
movl $0x3, %edi
cmovgel %esi, %edi
movswl %r8w, %esi
movzwl %di, %edi
addl $-0x2, %edi
cmpl %esi, %edi
jg 0x276d0
leaq -0x2c(%rbp), %rdi
movl $0x2, %esi
callq 0x209ed
leaq -0x2c(%rbp), %rdi
movq %rbx, %rsi
callq 0x2b962
testb %al, %al
jne 0x274ae
leaq 0x1d7dd(%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 0x276a2
leaq -0x2c(%rbp), %rdi
callq 0x2122a
movq %rax, %r13
cmpq 0x18ae7(%rip), %rax     # 0x3ffa8
je 0x276a2
movq %rbx, %rdi
leaq -0x2c(%rbp), %rsi
callq 0x2b7e4
movb $0x3, %cl
subb %al, %cl
testb %cl, %cl
jle 0x27519
movb $0x4, %r15b
subb %al, %r15b
callq 0x41d0
movq %rax, %rcx
imulq %r14
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 0x153(%rax), %cl
movb %cl, 0x153(%rax)
decb %r15b
cmpb $0x1, %r15b
ja 0x274e1
jmp 0x27523
movq 0x20(%r13), %rax
movb 0x153(%rax), %cl
testb %cl, %cl
movl $0x3, %r15d
jle 0x2755e
movb $0x1, 0x15d(%rax)
cmpb $0x0, 0x30(%r13)
jne 0x276a2
cmpw $0x0, 0x170(%rax)
je 0x276a2
addq $0x10, %r13
movq %r13, %rdi
callq 0x21eca
jmp 0x276a2
cmpq -0x38(%rbp), %rax
je 0x275cb
movq -0x78(%rbp), %rdx
movl $0x1c, %r8d
leaq -0x80(%rbp), %rdi
xorl %esi, %esi
leaq 0xe11d(%rip), %rcx      # 0x35698
callq 0x4630
movq 0x20(%r13), %rdi
movl 0xbc(%rdi), %eax
movq -0x38(%rbp), %rcx
cmpl 0xbc(%rcx), %eax
jne 0x2761d
movq 0x1f9b7(%rip), %rsi     # 0x46f58
movq 0x1f9b8(%rip), %rdx     # 0x46f60
leaq -0x80(%rbp), %rdi
callq 0x4130
cmpb $0x0, -0x5c(%rbp)
je 0x27627
movq -0x38(%rbp), %rax
movq 0x90(%rax), %rax
incq 0xa0(%rax)
jmp 0x27627
leaq -0x48(%rbp), %rax
movq %rax, -0x58(%rbp)
leaq -0x58(%rbp), %r12
movq %r12, %rdi
leaq 0xe0a5(%rip), %rsi      # 0x35686
leaq 0xe0af(%rip), %rdx      # 0x35697
callq 0xe01c
movq -0x38(%rbp), %rdi
movq %r12, %rsi
xorl %edx, %edx
callq 0x249ec
movq -0x58(%rbp), %rdi
leaq -0x48(%rbp), %rax
cmpq %rax, %rdi
je 0x276a2
movq -0x48(%rbp), %rsi
incq %rsi
callq 0x43f0
jmp 0x276a2
movl $0x5, %esi
callq 0x24c07
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 0xf988
movq -0x50(%rbp), %rsi
movl $0x1, %ecx
movq %r12, %rdi
xorl %edx, %edx
movl $0x2e, %r8d
callq 0x47a0
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 0x27693
movq -0x48(%rbp), %rsi
incq %rsi
callq 0x43f0
movq 0x20(%r13), %rdi
leaq -0x80(%rbp), %rsi
xorl %edx, %edx
callq 0x249ec
movzwl -0x2a(%rbp), %eax
decl %eax
movw %ax, -0x2a(%rbp)
movzwl 0x2(%rbx), %edx
cmpw $0x4, %dx
movl %edx, %ecx
cmovll %r15d, %ecx
cwtl
movzwl %cx, %ecx
addl $-0x2, %ecx
cmpl %eax, %ecx
jle 0x27466
movzwl -0x2c(%rbp), %ecx
movzwl (%rbx), %eax
decl %ecx
movw %cx, -0x2c(%rbp)
cmpw $0x4, %ax
movl $0x3, %esi
cmovgel %eax, %esi
movswl %cx, %edi
movzwl %si, %esi
addl $-0x2, %esi
cmpl %edi, %esi
jle 0x27424
movl $0x18, %edi
callq 0x43e0
movl (%rbx), %ecx
movl %ecx, 0x10(%rax)
leaq 0x1e8b7(%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 0x27731
movq -0x70(%rbp), %rsi
incq %rsi
callq 0x43f0
leaq -0x2c(%rbp), %rdi
callq 0x2b7a6
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x27773
jmp 0x27751
jmp 0x27773
jmp 0x27751
movq %rax, %rbx
movq -0x58(%rbp), %rdi
leaq -0x48(%rbp), %rax
cmpq %rax, %rdi
je 0x27776
movq -0x48(%rbp), %rsi
incq %rsi
callq 0x43f0
jmp 0x27776
jmp 0x27773
jmp 0x27773
movq %rax, %rbx
movq -0x80(%rbp), %rdi
leaq -0x70(%rbp), %rax
cmpq %rax, %rdi
je 0x2778f
movq -0x70(%rbp), %rsi
incq %rsi
callq 0x43f0
leaq -0x2c(%rbp), %rdi
callq 0x2b7a6
movq %rbx, %rdi
callq 0x4740