// File: /workspace/github_cpp_makefile_star2_O1/dnegovan[P]Intruder-On-Donnar-V/Game.cpp
// Function: Game::move()
bool Game::move()
{
    int input = 0;
    int menuNum;
    int up, down, left, right;

    while (input < 1 || input > menuNum)
    {
        menuNum = 1;

        //need to store menu number for each direction then use in switch case
        up = 0, down = 0, left = 0, right = 0;

        std::cout << std::endl;
        //list option that are available
        if (currentSpace->up)  //false if nullptr
        {
            up = menuNum;
            std::cout << menuNum << ". To "
                      << currentSpace->up->getRoomName() << std::endl;
            menuNum++;
        }
        if (currentSpace->right)
        {
            right = menuNum;
            std::cout << menuNum << ". To "
                      << currentSpace->right->getRoomName() << std::endl;
            menuNum++;
        }
        if (currentSpace->down)
        {
            down = menuNum;
            std::cout << menuNum << ". To "
                      << currentSpace->down->getRoomName() << std::endl;
            menuNum++;
        }
        if (currentSpace->left)
        {
            left = menuNum;
            std::cout << menuNum << ". To "
                      << currentSpace->left->getRoomName() << std::endl;
            menuNum++;
        }

        std::cout << menuNum << ". Cancel" << std::endl;

        input = getInteger();
    }

    if (input == up)
    {
            currentSpace = currentSpace->up;
            return true;
    }
    else if (input == down)
    {
            currentSpace = currentSpace->down;
            return true;
    }
    else if (input == left)
    {
            currentSpace = currentSpace->left;
            return true;
    }
    else if (input == right)
    {
            currentSpace = currentSpace->right;
            return true;
    }
    //if we get here they must have hit cancel
    return false;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rdi, %rbx
leaq -0x38(%rbp), %r13
movq 0x99e3(%rip), %r14      # 0x1bfc8
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x31d0
movsbl %al, %esi
movq %r14, %rdi
callq 0x3030
movq %rax, %rdi
callq 0x3140
movq 0xc0(%rbx), %rax
cmpq $0x0, 0x48(%rax)
movl $0x1, %r15d
movl $0x0, %r12d
je 0x126ba
movq 0x9997(%rip), %rdi      # 0x1bfc8
movl $0x1, %esi
callq 0x3310
movq %rax, %r14
movl $0x5, %edx
movq %rax, %rdi
leaq 0x435e(%rip), %rsi      # 0x169ab
callq 0x3210
movq 0xc0(%rbx), %rax
movq 0x48(%rax), %rsi
leaq -0x48(%rbp), %rdi
callq 0x142a8
movq -0x48(%rbp), %rsi
movq -0x40(%rbp), %rdx
movq %r14, %rdi
callq 0x3210
movq %rax, %r14
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x31d0
movsbl %al, %esi
movq %r14, %rdi
callq 0x3030
movq %rax, %rdi
callq 0x3140
movq -0x48(%rbp), %rdi
cmpq %r13, %rdi
je 0x126ae
callq 0x31c0
movl $0x1, %r12d
movl $0x2, %r15d
movq 0xc0(%rbx), %rax
cmpq $0x0, 0x60(%rax)
movl %r12d, -0x4c(%rbp)
je 0x12758
movq 0x98f1(%rip), %rdi      # 0x1bfc8
movl %r15d, %esi
callq 0x3310
movq %rax, %r14
movl $0x5, %edx
movq %rax, %rdi
leaq 0x42ba(%rip), %rsi      # 0x169ab
callq 0x3210
movq 0xc0(%rbx), %rax
movq 0x60(%rax), %rsi
leaq -0x48(%rbp), %rdi
callq 0x142a8
movq -0x48(%rbp), %rsi
movq -0x40(%rbp), %rdx
movq %r14, %rdi
callq 0x3210
movq %rax, %r14
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x31d0
movsbl %al, %esi
movq %r14, %rdi
callq 0x3030
movq %rax, %rdi
callq 0x3140
movq -0x48(%rbp), %rdi
cmpq %r13, %rdi
je 0x12752
callq 0x31c0
leal 0x1(%r15), %r12d
jmp 0x1275e
movl %r15d, %r12d
xorl %r15d, %r15d
movq 0xc0(%rbx), %rax
cmpq $0x0, 0x50(%rax)
movq %r15, -0x58(%rbp)
je 0x127fd
movq 0x984d(%rip), %rdi      # 0x1bfc8
movl %r12d, %esi
callq 0x3310
movq %rax, %r14
movl $0x5, %edx
movq %rax, %rdi
leaq 0x4216(%rip), %rsi      # 0x169ab
callq 0x3210
movq 0xc0(%rbx), %rax
movq 0x50(%rax), %rsi
leaq -0x48(%rbp), %rdi
callq 0x142a8
movq -0x48(%rbp), %rsi
movq -0x40(%rbp), %rdx
movq %r14, %rdi
callq 0x3210
movq %rax, %r14
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x31d0
movsbl %al, %esi
movq %r14, %rdi
callq 0x3030
movq %rax, %rdi
callq 0x3140
movq -0x48(%rbp), %rdi
cmpq %r13, %rdi
je 0x127f6
callq 0x31c0
leal 0x1(%r12), %r15d
jmp 0x12803
movl %r12d, %r15d
xorl %r12d, %r12d
movq 0xc0(%rbx), %rax
cmpq $0x0, 0x58(%rax)
je 0x1289d
movq 0x97ac(%rip), %rdi      # 0x1bfc8
movl %r15d, %esi
callq 0x3310
movq %rax, %r14
movl $0x5, %edx
movq %rax, %rdi
leaq 0x4175(%rip), %rsi      # 0x169ab
callq 0x3210
movq 0xc0(%rbx), %rax
movq 0x58(%rax), %rsi
leaq -0x48(%rbp), %rdi
callq 0x142a8
movq -0x48(%rbp), %rsi
movq -0x40(%rbp), %rdx
movq %r14, %rdi
callq 0x3210
movq %rax, %r14
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x31d0
movsbl %al, %esi
movq %r14, %rdi
callq 0x3030
movq %rax, %rdi
callq 0x3140
movq -0x48(%rbp), %rdi
cmpq %r13, %rdi
je 0x12897
callq 0x31c0
leal 0x1(%r15), %r14d
jmp 0x128a3
movl %r15d, %r14d
xorl %r15d, %r15d
movq 0x971e(%rip), %rdi      # 0x1bfc8
movl %r14d, %esi
callq 0x3310
movq %rax, %r13
movl $0x8, %edx
movq %rax, %rdi
leaq 0x40ed(%rip), %rsi      # 0x169b1
callq 0x3210
movq (%r13), %rax
movq -0x18(%rax), %rdi
addq %r13, %rdi
movl $0xa, %esi
callq 0x31d0
movsbl %al, %esi
movq %r13, %rdi
callq 0x3030
movq %rax, %rdi
callq 0x3140
callq 0xf8fa
testl %eax, %eax
leaq -0x38(%rbp), %r13
jle 0x125de
cmpl %r14d, %eax
jg 0x125de
movl $0x48, %ecx
cmpl -0x4c(%rbp), %eax
je 0x12933
movl $0x50, %ecx
cmpl %r12d, %eax
je 0x12933
movl $0x58, %ecx
cmpl %r15d, %eax
je 0x12933
movl $0x60, %ecx
cmpl -0x58(%rbp), %eax
jne 0x12956
movq 0xc0(%rbx), %rax
movq (%rax,%rcx), %rax
movq %rax, 0xc0(%rbx)
movb $0x1, %al
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
xorl %eax, %eax
jmp 0x12947
jmp 0x12960
jmp 0x12960
jmp 0x12960
movq %rax, %rbx
movq -0x48(%rbp), %rdi
cmpq %r13, %rdi
je 0x12971
callq 0x31c0
movq %rbx, %rdi
callq 0x3320
nop