// File: 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
subq $0x130, %rsp            # imm = 0x130
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0xc0(%rbp)
movl $0x0, -0x14(%rbp)
movb $0x1, %al
cmpl $0x1, -0x14(%rbp)
movb %al, -0xc1(%rbp)
jl 0x1ac0e
movl -0x14(%rbp), %eax
cmpl -0x18(%rbp), %eax
setg %al
movb %al, -0xc1(%rbp)
movb -0xc1(%rbp), %al
testb $0x1, %al
jne 0x1ac1d
jmp 0x1afbf
movl $0x1, -0x18(%rbp)
movl $0x0, -0x1c(%rbp)
movl $0x0, -0x20(%rbp)
movl $0x0, -0x24(%rbp)
movl $0x0, -0x28(%rbp)
movq 0xe381(%rip), %rdi      # 0x28fc8
movq 0xe362(%rip), %rsi      # 0x28fb0
callq 0x3240
movq -0xc0(%rbp), %rax
movq 0xc0(%rax), %rax
cmpq $0x0, 0x48(%rax)
je 0x1ad1b
movl -0x18(%rbp), %eax
movl %eax, -0x1c(%rbp)
movl -0x18(%rbp), %esi
movq 0xe34c(%rip), %rdi      # 0x28fc8
callq 0x33b0
movq %rax, %rdi
leaq 0x4d20(%rip), %rsi      # 0x1f9ab
callq 0x3210
movq %rax, %rcx
movq -0xc0(%rbp), %rax
movq %rcx, -0xe0(%rbp)
movq 0xc0(%rax), %rax
movq 0x48(%rax), %rsi
leaq -0x48(%rbp), %rdi
movq %rdi, -0xd8(%rbp)
callq 0x1d000
movq -0xe0(%rbp), %rdi
movq -0xd8(%rbp), %rsi
callq 0x31e0
movq %rax, -0xd0(%rbp)
jmp 0x1acd8
movq -0xd0(%rbp), %rdi
movq 0xe2ca(%rip), %rsi      # 0x28fb0
callq 0x3240
jmp 0x1aced
leaq -0x48(%rbp), %rdi
callq 0x3448
movl -0x18(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x18(%rbp)
jmp 0x1ad1b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
leaq -0x48(%rbp), %rdi
callq 0x3448
jmp 0x1b073
movq -0xc0(%rbp), %rax
movq 0xc0(%rax), %rax
cmpq $0x0, 0x60(%rax)
je 0x1ade3
movl -0x18(%rbp), %eax
movl %eax, -0x28(%rbp)
movl -0x18(%rbp), %esi
movq 0xe284(%rip), %rdi      # 0x28fc8
callq 0x33b0
movq %rax, %rdi
leaq 0x4c58(%rip), %rsi      # 0x1f9ab
callq 0x3210
movq %rax, %rcx
movq -0xc0(%rbp), %rax
movq %rcx, -0xf8(%rbp)
movq 0xc0(%rax), %rax
movq 0x60(%rax), %rsi
leaq -0x78(%rbp), %rdi
movq %rdi, -0xf0(%rbp)
callq 0x1d000
movq -0xf8(%rbp), %rdi
movq -0xf0(%rbp), %rsi
callq 0x31e0
movq %rax, -0xe8(%rbp)
jmp 0x1ada0
movq -0xe8(%rbp), %rdi
movq 0xe202(%rip), %rsi      # 0x28fb0
callq 0x3240
jmp 0x1adb5
leaq -0x78(%rbp), %rdi
callq 0x3448
movl -0x18(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x18(%rbp)
jmp 0x1ade3
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
leaq -0x78(%rbp), %rdi
callq 0x3448
jmp 0x1b073
movq -0xc0(%rbp), %rax
movq 0xc0(%rax), %rax
cmpq $0x0, 0x50(%rax)
je 0x1aeb4
movl -0x18(%rbp), %eax
movl %eax, -0x20(%rbp)
movl -0x18(%rbp), %esi
movq 0xe1bc(%rip), %rdi      # 0x28fc8
callq 0x33b0
movq %rax, %rdi
leaq 0x4b90(%rip), %rsi      # 0x1f9ab
callq 0x3210
movq %rax, %rcx
movq -0xc0(%rbp), %rax
movq %rcx, -0x110(%rbp)
movq 0xc0(%rax), %rax
movq 0x50(%rax), %rsi
leaq -0x98(%rbp), %rdi
movq %rdi, -0x108(%rbp)
callq 0x1d000
movq -0x110(%rbp), %rdi
movq -0x108(%rbp), %rsi
callq 0x31e0
movq %rax, -0x100(%rbp)
jmp 0x1ae6b
movq -0x100(%rbp), %rdi
movq 0xe137(%rip), %rsi      # 0x28fb0
callq 0x3240
jmp 0x1ae80
leaq -0x98(%rbp), %rdi
callq 0x3448
movl -0x18(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x18(%rbp)
jmp 0x1aeb4
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
leaq -0x98(%rbp), %rdi
callq 0x3448
jmp 0x1b073
movq -0xc0(%rbp), %rax
movq 0xc0(%rax), %rax
cmpq $0x0, 0x58(%rax)
je 0x1af85
movl -0x18(%rbp), %eax
movl %eax, -0x24(%rbp)
movl -0x18(%rbp), %esi
movq 0xe0eb(%rip), %rdi      # 0x28fc8
callq 0x33b0
movq %rax, %rdi
leaq 0x4abf(%rip), %rsi      # 0x1f9ab
callq 0x3210
movq %rax, %rcx
movq -0xc0(%rbp), %rax
movq %rcx, -0x128(%rbp)
movq 0xc0(%rax), %rax
movq 0x58(%rax), %rsi
leaq -0xb8(%rbp), %rdi
movq %rdi, -0x120(%rbp)
callq 0x1d000
movq -0x128(%rbp), %rdi
movq -0x120(%rbp), %rsi
callq 0x31e0
movq %rax, -0x118(%rbp)
jmp 0x1af3c
movq -0x118(%rbp), %rdi
movq 0xe066(%rip), %rsi      # 0x28fb0
callq 0x3240
jmp 0x1af51
leaq -0xb8(%rbp), %rdi
callq 0x3448
movl -0x18(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x18(%rbp)
jmp 0x1af85
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
leaq -0xb8(%rbp), %rdi
callq 0x3448
jmp 0x1b073
movl -0x18(%rbp), %esi
movq 0xe039(%rip), %rdi      # 0x28fc8
callq 0x33b0
movq %rax, %rdi
leaq 0x4a13(%rip), %rsi      # 0x1f9b1
callq 0x3210
movq %rax, %rdi
movq 0xe003(%rip), %rsi      # 0x28fb0
callq 0x3240
callq 0x175c0
movl %eax, -0x14(%rbp)
jmp 0x1abf1
movl -0x14(%rbp), %eax
cmpl -0x1c(%rbp), %eax
jne 0x1afe6
movq -0xc0(%rbp), %rax
movq 0xc0(%rax), %rcx
movq 0x48(%rcx), %rcx
movq %rcx, 0xc0(%rax)
movb $0x1, -0x1(%rbp)
jmp 0x1b065
movl -0x14(%rbp), %eax
cmpl -0x20(%rbp), %eax
jne 0x1b00d
movq -0xc0(%rbp), %rax
movq 0xc0(%rax), %rcx
movq 0x50(%rcx), %rcx
movq %rcx, 0xc0(%rax)
movb $0x1, -0x1(%rbp)
jmp 0x1b065
movl -0x14(%rbp), %eax
cmpl -0x24(%rbp), %eax
jne 0x1b034
movq -0xc0(%rbp), %rax
movq 0xc0(%rax), %rcx
movq 0x58(%rcx), %rcx
movq %rcx, 0xc0(%rax)
movb $0x1, -0x1(%rbp)
jmp 0x1b065
movl -0x14(%rbp), %eax
cmpl -0x28(%rbp), %eax
jne 0x1b05b
movq -0xc0(%rbp), %rax
movq 0xc0(%rax), %rcx
movq 0x60(%rcx), %rcx
movq %rcx, 0xc0(%rax)
movb $0x1, -0x1(%rbp)
jmp 0x1b065
jmp 0x1b05d
jmp 0x1b05f
jmp 0x1b061
movb $0x0, -0x1(%rbp)
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0x130, %rsp            # imm = 0x130
popq %rbp
retq
movq -0x50(%rbp), %rdi
callq 0x33c0
nopl (%rax)