// File: /workspace/github_cpp_makefile_star2_O1/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 0x11af5(%rip), %rsi     # 0x1d1cd
leaq 0x11af0(%rip), %rdx     # 0x1d1cf
leaq -0x170(%rbp), %r14
movq %r14, %rdi
callq 0x501a
leaq -0x150(%rbp), %rbx
leaq -0x140(%rbp), %rax
movq %rax, -0x10(%rax)
leaq 0x11ac9(%rip), %rsi     # 0x1d1d0
leaq 0x11ac4(%rip), %rdx     # 0x1d1d2
movq %rbx, %rdi
callq 0x501a
leaq -0x130(%rbp), %rbx
leaq -0x120(%rbp), %rax
movq %rax, -0x10(%rax)
leaq 0x11aa4(%rip), %rsi     # 0x1d1d3
leaq 0x11a9f(%rip), %rdx     # 0x1d1d5
movq %rbx, %rdi
callq 0x501a
leaq -0x110(%rbp), %rbx
leaq -0x100(%rbp), %rax
movq %rax, -0x10(%rax)
leaq 0x11a7f(%rip), %rsi     # 0x1d1d6
leaq 0x11a7a(%rip), %rdx     # 0x1d1d8
movq %rbx, %rdi
callq 0x501a
leaq -0xf0(%rbp), %rbx
leaq -0xe0(%rbp), %rax
movq %rax, -0x10(%rax)
leaq 0x11a5a(%rip), %rsi     # 0x1d1d9
leaq 0x11a55(%rip), %rdx     # 0x1d1db
movq %rbx, %rdi
callq 0x501a
leaq -0xd0(%rbp), %rbx
leaq -0xc0(%rbp), %rax
movq %rax, -0x10(%rax)
leaq 0x11a35(%rip), %rsi     # 0x1d1dc
leaq 0x11a30(%rip), %rdx     # 0x1d1de
movq %rbx, %rdi
callq 0x501a
leaq -0xb0(%rbp), %rbx
leaq -0xa0(%rbp), %rax
movq %rax, -0x10(%rax)
leaq 0x11a10(%rip), %rsi     # 0x1d1df
leaq 0x11a0b(%rip), %rdx     # 0x1d1e1
movq %rbx, %rdi
callq 0x501a
leaq -0x90(%rbp), %rbx
leaq -0x80(%rbp), %r12
movq %r12, -0x10(%r12)
leaq 0x119ed(%rip), %rsi     # 0x1d1e2
leaq 0x119e8(%rip), %rdx     # 0x1d1e4
movq %rbx, %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 0xa582
leaq -0x60(%rbp), %rdi
movq %r15, %rbx
movq %r15, %rsi
callq 0x50b4
movq %rax, -0x58(%rbp)
leaq -0x58(%rbp), %rdi
leaq -0x68(%rbp), %rsi
callq 0x51b6
movl %eax, %r15d
movq -0x50(%rbp), %rdi
leaq -0x40(%rbp), %rax
cmpq %rax, %rdi
je 0xb86d
movq -0x40(%rbp), %rsi
incq %rsi
callq 0x4170
testb %r15b, %r15b
jne 0xb88e
movq %rbx, %r15
cmpq $0x7, %r14
leaq 0x1(%r14), %rax
setb -0x29(%rbp)
addq $0x20, %r13
movq %rax, %r14
cmpq $0x8, %rax
jne 0xb816
movq $-0x100, %r14
movq -0x10(%r12), %rdi
cmpq %rdi, %r12
je 0xb8ab
movq (%r12), %rsi
incq %rsi
callq 0x4170
addq $-0x20, %r12
addq $0x20, %r14
jne 0xb895
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 0xb8d8
jmp 0xb8d8
jmp 0xb8d8
jmp 0xb8d8
jmp 0xb8d8
jmp 0xb8d8
movq %rax, %r15
cmpq %rbx, %r14
je 0xb969
addq $-0x10, %rbx
leaq -0x170(%rbp), %r14
movq -0x10(%rbx), %rdi
cmpq %rdi, %rbx
je 0xb903
movq (%rbx), %rsi
incq %rsi
callq 0x4170
leaq -0x20(%rbx), %rax
addq $-0x10, %rbx
cmpq %r14, %rbx
movq %rax, %rbx
jne 0xb8ef
jmp 0xb969
movq %rax, %r15
movq %r14, %rbx
jmp 0xb8db
movq %rax, %r15
jmp 0xb93e
movq %rax, %r15
movq -0x50(%rbp), %rdi
leaq -0x40(%rbp), %rax
cmpq %rax, %rdi
je 0xb93e
movq -0x40(%rbp), %rsi
incq %rsi
callq 0x4170
xorl %ebx, %ebx
movq -0x90(%rbp,%rbx), %rdi
leaq (%r12,%rbx), %rax
cmpq %rdi, %rax
je 0xb95c
movq (%rax), %rsi
incq %rsi
callq 0x4170
addq $-0x20, %rbx
cmpq $-0x100, %rbx
jne 0xb940
movq %r15, %rdi
callq 0x4250
nop