// File: /workspace/github_cpp_makefile_star2_O3/malcolmyeh[P]CC3K/enemy.cc
// Function: Enemy::withinRange(Posn)
bool Enemy::withinRange(Posn player)
{
    Posn epos = this->getPosition();
    std::string directions[8] = {"ea", "we", "no", "so", "ne", "nw", "se", "sw"};
    for (int i = 0; i < 8; ++i)
    {
        if (epos.getNew(directions[i]) == player)
        {
            return true;
        }
    }
    return false;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x148, %rsp            # imm = 0x148
movq %rsi, -0x68(%rbp)
movq (%rdi), %rax
callq *0x38(%rax)
movq %rax, -0x60(%rbp)
leaq -0x160(%rbp), %rax
movq %rax, -0x10(%rax)
leaq 0x11bb5(%rip), %rsi     # 0x1d1cd
leaq 0x11bb0(%rip), %rdx     # 0x1d1cf
leaq -0x170(%rbp), %rbx
movq %rbx, %rdi
callq 0x501a
leaq -0x150(%rbp), %r14
leaq -0x140(%rbp), %rax
movq %rax, -0x10(%rax)
leaq 0x11b89(%rip), %rsi     # 0x1d1d0
leaq 0x11b84(%rip), %rdx     # 0x1d1d2
movq %r14, %rdi
callq 0x501a
leaq -0x130(%rbp), %r14
leaq -0x120(%rbp), %rax
movq %rax, -0x10(%rax)
leaq 0x11b64(%rip), %rsi     # 0x1d1d3
leaq 0x11b5f(%rip), %rdx     # 0x1d1d5
movq %r14, %rdi
callq 0x501a
leaq -0x110(%rbp), %r14
leaq -0x100(%rbp), %rax
movq %rax, -0x10(%rax)
leaq 0x11b3f(%rip), %rsi     # 0x1d1d6
leaq 0x11b3a(%rip), %rdx     # 0x1d1d8
movq %r14, %rdi
callq 0x501a
leaq -0xf0(%rbp), %r14
leaq -0xe0(%rbp), %rax
movq %rax, -0x10(%rax)
leaq 0x11b1a(%rip), %rsi     # 0x1d1d9
leaq 0x11b15(%rip), %rdx     # 0x1d1db
movq %r14, %rdi
callq 0x501a
leaq -0xd0(%rbp), %r14
leaq -0xc0(%rbp), %rax
movq %rax, -0x10(%rax)
leaq 0x11af5(%rip), %rsi     # 0x1d1dc
leaq 0x11af0(%rip), %rdx     # 0x1d1de
movq %r14, %rdi
callq 0x501a
leaq -0xb0(%rbp), %r14
leaq -0xa0(%rbp), %rax
movq %rax, -0x10(%rax)
leaq 0x11ad0(%rip), %rsi     # 0x1d1df
leaq 0x11acb(%rip), %rdx     # 0x1d1e1
movq %r14, %rdi
callq 0x501a
leaq -0x90(%rbp), %r14
leaq -0x80(%rbp), %r12
movq %r12, -0x10(%r12)
leaq 0x11aad(%rip), %rsi     # 0x1d1e2
leaq 0x11aa8(%rip), %rdx     # 0x1d1e4
movq %r14, %rdi
callq 0x501a
movb $0x1, -0x29(%rbp)
leaq -0x168(%rbp), %r13
xorl %r14d, %r14d
leaq -0x50(%rbp), %r15
leaq -0x40(%rbp), %rax
movq %rax, -0x50(%rbp)
movq -0x8(%r13), %rsi
movq (%r13), %rdx
addq %rsi, %rdx
movq %r15, %rdi
callq 0xa4be
leaq -0x60(%rbp), %rdi
movq %r15, %rbx
movq %r15, %rsi
callq 0x50b8
movq %rax, -0x58(%rbp)
leaq -0x58(%rbp), %rdi
leaq -0x68(%rbp), %rsi
callq 0x51ba
movl %eax, %r15d
movq -0x50(%rbp), %rdi
leaq -0x40(%rbp), %rax
cmpq %rax, %rdi
je 0xb7ad
movq -0x40(%rbp), %rsi
incq %rsi
callq 0x4170
testb %r15b, %r15b
jne 0xb7ce
movq %rbx, %r15
cmpq $0x7, %r14
leaq 0x1(%r14), %rax
setb -0x29(%rbp)
addq $0x20, %r13
movq %rax, %r14
cmpq $0x8, %rax
jne 0xb756
movq $-0x100, %r14
movq -0x10(%r12), %rdi
cmpq %rdi, %r12
je 0xb7eb
movq (%r12), %rsi
incq %rsi
callq 0x4170
addq $-0x20, %r12
addq $0x20, %r14
jne 0xb7d5
movb -0x29(%rbp), %al
andb $0x1, %al
addq $0x148, %rsp            # imm = 0x148
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0xb818
jmp 0xb818
jmp 0xb818
jmp 0xb818
jmp 0xb818
jmp 0xb818
movq %rax, %r15
addq $-0x10, %r14
movq -0x10(%r14), %rdi
cmpq %rdi, %r14
je 0xb833
movq (%r14), %rsi
incq %rsi
callq 0x4170
leaq -0x20(%r14), %rax
addq $-0x10, %r14
cmpq %rbx, %r14
movq %rax, %r14
jne 0xb81f
jmp 0xb891
movq %rax, %r15
jmp 0xb866
movq %rax, %r15
movq -0x50(%rbp), %rdi
leaq -0x40(%rbp), %rax
cmpq %rax, %rdi
je 0xb866
movq -0x40(%rbp), %rsi
incq %rsi
callq 0x4170
xorl %ebx, %ebx
movq -0x90(%rbp,%rbx), %rdi
leaq (%r12,%rbx), %rax
cmpq %rdi, %rax
je 0xb884
movq (%rax), %rsi
incq %rsi
callq 0x4170
addq $-0x20, %rbx
cmpq $-0x100, %rbx
jne 0xb868
movq %r15, %rdi
callq 0x4250
nop