// File: /workspace/github_cpp_makefile_star2_O3/FakePsyho[P]halite2/MyBot.cpp
// Function: findCloseEntities(hlt::Location, double, int, unsigned int)
VC<Entity> findCloseEntities(Location loc, double radius, int mask = MASK_ALL, EntityId ship_id = -1) {
	VC<Entity> rv;
	if (mask & MASK_PLANETS) for (Planet& p : m.planets) if (loc.dist(p.location) < radius + p.radius) rv.PB(p);
	if (mask & MASK_ALLIES) for (Ship& s : m.ships[player_id]) if (s.entity_id != ship_id && loc.dist(s.location) < radius && !s.docked()) rv.PB(s);
	if (mask & MASK_ALLIES_DOCKED) for (Ship& s : m.ships[player_id]) if (s.entity_id != ship_id && loc.dist(s.location) < radius && s.docked()) rv.PB(s);
	if (mask & MASK_ENEMIES) for (auto& ps : m.ships) if (ps.X != player_id) for (Ship& s : ps.Y) if (!s.docked() && loc.dist(s.location) < radius) rv.PB(s);
	if (mask & MASK_ENEMIES_DOCKED) for (auto& ps : m.ships) if (ps.X != player_id) for (Ship& s : ps.Y) if (s.docked() && loc.dist(s.location) < radius) rv.PB(s);
	return rv;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x20, %rsp
movl %edx, %r14d
movl %esi, %ebp
movsd %xmm2, 0x18(%rsp)
movsd %xmm1, 0x10(%rsp)
movsd %xmm0, 0x8(%rsp)
movq %rdi, %rbx
xorpd %xmm0, %xmm0
movupd %xmm0, (%rdi)
movq $0x0, 0x10(%rdi)
testb $0x1, %bpl
jne 0x4066
testb $0x2, %bpl
jne 0x40ec
testb $0x4, %bpl
jne 0x419b
testb $0x8, %bpl
jne 0x424a
testb $0x10, %bpl
jne 0x42ff
movq %rbx, %rax
addq $0x20, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movq 0x19cfb(%rip), %r15     # 0x1dd68
movq 0x19cfc(%rip), %r12     # 0x1dd70
cmpq %r12, %r15
je 0x402e
movsd 0x8(%rsp), %xmm0
subsd 0x8(%r15), %xmm0
movsd 0x10(%rsp), %xmm1
subsd 0x10(%r15), %xmm1
mulsd %xmm1, %xmm1
mulsd %xmm0, %xmm0
addsd %xmm1, %xmm0
sqrtsd %xmm0, %xmm0
movsd 0x70(%r15), %xmm1
addsd 0x18(%rsp), %xmm1
ucomisd %xmm0, %xmm1
jbe 0x40e3
movq 0x8(%rbx), %rax
cmpq 0x10(%rbx), %rax
je 0x40d5
movl $0xf, %ecx
movq %rax, %rdi
movq %r15, %rsi
rep  movsq (%rsi), %es:(%rdi)
addq $0x78, %rax
movq %rax, 0x8(%rbx)
jmp 0x40e3
movq %rbx, %rdi
movq %rax, %rsi
movq %r15, %rdx
callq 0x1164e
addq $0xa0, %r15
jmp 0x4074
leaq 0x19c05(%rip), %rdi     # 0x1dcf8
leaq 0x19be2(%rip), %rsi     # 0x1dcdc
callq 0x10ee2
movq (%rax), %r15
movq 0x8(%rax), %r12
cmpq %r12, %r15
je 0x4038
cmpl %r14d, (%r15)
je 0x418f
movsd 0x8(%rsp), %xmm0
subsd 0x8(%r15), %xmm0
movsd 0x10(%rsp), %xmm1
subsd 0x10(%r15), %xmm1
mulsd %xmm1, %xmm1
mulsd %xmm0, %xmm0
addsd %xmm1, %xmm0
sqrtsd %xmm0, %xmm0
movsd 0x18(%rsp), %xmm1
ucomisd %xmm0, %xmm1
jbe 0x418f
movl 0x7c(%r15), %eax
testl %eax, %eax
je 0x415f
cmpl $0x3, %eax
jne 0x418f
cmpl $0x1, 0x80(%r15)
jne 0x418f
movq 0x8(%rbx), %rax
cmpq 0x10(%rbx), %rax
je 0x4181
movl $0xf, %ecx
movq %rax, %rdi
movq %r15, %rsi
rep  movsq (%rsi), %es:(%rdi)
addq $0x78, %rax
movq %rax, 0x8(%rbx)
jmp 0x418f
movq %rbx, %rdi
movq %rax, %rsi
movq %r15, %rdx
callq 0x1164e
addq $0x88, %r15
jmp 0x4106
leaq 0x19b56(%rip), %rdi     # 0x1dcf8
leaq 0x19b33(%rip), %rsi     # 0x1dcdc
callq 0x10ee2
movq (%rax), %r15
movq 0x8(%rax), %r12
cmpq %r12, %r15
je 0x4042
cmpl %r14d, (%r15)
je 0x423e
movsd 0x8(%rsp), %xmm0
subsd 0x8(%r15), %xmm0
movsd 0x10(%rsp), %xmm1
subsd 0x10(%r15), %xmm1
mulsd %xmm1, %xmm1
mulsd %xmm0, %xmm0
addsd %xmm1, %xmm0
sqrtsd %xmm0, %xmm0
movsd 0x18(%rsp), %xmm1
ucomisd %xmm0, %xmm1
jbe 0x423e
movl 0x7c(%r15), %eax
testl %eax, %eax
je 0x423e
cmpl $0x3, %eax
jne 0x420e
cmpl $0x1, 0x80(%r15)
je 0x423e
movq 0x8(%rbx), %rax
cmpq 0x10(%rbx), %rax
je 0x4230
movl $0xf, %ecx
movq %rax, %rdi
movq %r15, %rsi
rep  movsq (%rsi), %es:(%rdi)
addq $0x78, %rax
movq %rax, 0x8(%rbx)
jmp 0x423e
movq %rbx, %rdi
movq %rax, %rsi
movq %r15, %rdx
callq 0x1164e
addq $0x88, %r15
jmp 0x41b5
movq 0x19ab7(%rip), %r15     # 0x1dd08
testq %r15, %r15
je 0x404c
movl 0x8(%r15), %eax
cmpl 0x19a78(%rip), %eax     # 0x1dcdc
jne 0x426b
movq (%r15), %r15
jmp 0x4251
movq 0x10(%r15), %r14
movq 0x18(%r15), %r12
cmpq %r12, %r14
je 0x4266
movl 0x7c(%r14), %eax
testl %eax, %eax
je 0x428f
cmpl $0x3, %eax
jne 0x42f3
cmpl $0x1, 0x80(%r14)
jne 0x42f3
movsd 0x8(%rsp), %xmm0
subsd 0x8(%r14), %xmm0
movsd 0x10(%rsp), %xmm1
subsd 0x10(%r14), %xmm1
mulsd %xmm1, %xmm1
mulsd %xmm0, %xmm0
addsd %xmm1, %xmm0
sqrtsd %xmm0, %xmm0
movsd 0x18(%rsp), %xmm1
ucomisd %xmm0, %xmm1
jbe 0x42f3
movq 0x8(%rbx), %rax
cmpq 0x10(%rbx), %rax
je 0x42e5
movl $0xf, %ecx
movq %rax, %rdi
movq %r14, %rsi
rep  movsq (%rsi), %es:(%rdi)
addq $0x78, %rax
movq %rax, 0x8(%rbx)
jmp 0x42f3
movq %rbx, %rdi
movq %rax, %rsi
movq %r14, %rdx
callq 0x1164e
addq $0x88, %r14
jmp 0x4273
movq 0x19a02(%rip), %r15     # 0x1dd08
testq %r15, %r15
je 0x4056
movl 0x8(%r15), %eax
cmpl 0x199c3(%rip), %eax     # 0x1dcdc
jne 0x4320
movq (%r15), %r15
jmp 0x4306
movq 0x10(%r15), %r14
movq 0x18(%r15), %r12
cmpq %r12, %r14
je 0x431b
movl 0x7c(%r14), %eax
testl %eax, %eax
je 0x43a8
cmpl $0x3, %eax
jne 0x4344
cmpl $0x1, 0x80(%r14)
je 0x43a8
movsd 0x8(%rsp), %xmm0
subsd 0x8(%r14), %xmm0
movsd 0x10(%rsp), %xmm1
subsd 0x10(%r14), %xmm1
mulsd %xmm1, %xmm1
mulsd %xmm0, %xmm0
addsd %xmm1, %xmm0
sqrtsd %xmm0, %xmm0
movsd 0x18(%rsp), %xmm1
ucomisd %xmm0, %xmm1
jbe 0x43a8
movq 0x8(%rbx), %rax
cmpq 0x10(%rbx), %rax
je 0x439a
movl $0xf, %ecx
movq %rax, %rdi
movq %r14, %rsi
rep  movsq (%rsi), %es:(%rdi)
addq $0x78, %rax
movq %rax, 0x8(%rbx)
jmp 0x43a8
movq %rbx, %rdi
movq %rax, %rsi
movq %r14, %rdx
callq 0x1164e
addq $0x88, %r14
jmp 0x4328
jmp 0x43c0
jmp 0x43c0
jmp 0x43c0
jmp 0x43c0
jmp 0x43c0
jmp 0x43c0
movq %rax, %r14
movq (%rbx), %rdi
testq %rdi, %rdi
je 0x43d7
movq 0x10(%rbx), %rsi
subq %rdi, %rsi
callq 0x3240
movq %r14, %rdi
callq 0x33d0