// File: /workspace/github_cpp_makefile_star2_O2/venGaza[P]starwars/src/Game.cpp
// Function: Game::menu()
void Game::menu() {
    cout << "1. Start Adventure" << endl             //Menu Choices
         << "2. Exit" << endl << endl
         << "Please select a number: ";
    
    int menuSelection = getInteger();
    cout << endl;
    
    validate(menuSelection, 1, 2);
    
    if (menuSelection == 1) {                       //1. Add a new node to head
        getPlayerName();
        
        Map map;                                        //Generate map
        map.createMap();
        
        while (!gameOver) {
            //Determine what room player is in and advance accordingly
            if (map.getLocation()->getRoomName() == "Supreme Leader Snoke") {
                snokeLoss();
            } else if (map.getLocation()->getRoomName() == "Door") {
                doorInteraction(map);
            } else if (map.getLocation()->getRoomName() == "Command Center") {
                if (kyloWinGame) {
                    kyloWin();
                    gameOver = true;
                } else {
                    kyloLoss();
                    advance(map);
                }
            } else if (map.getLocation()->getRoomName() == "Launch Bay") {
                winMessage();
                gameOver = true;
            } else {
                advance(map);
            }
        }
    } else {                                        //2. Exit program
        exitGame = true;
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq %rdi, %rbx
movq 0x7c8c(%rip), %r14      # 0xbfd0
leaq 0x24d9(%rip), %rsi      # 0x6824
movq %r14, %rdi
callq 0x2150
movq %rax, %rdi
callq 0x20b0
leaq 0x24d5(%rip), %rsi      # 0x6837
movq %rax, %rdi
callq 0x2150
movq %rax, %rdi
callq 0x20b0
movq %rax, %rdi
callq 0x20b0
leaq 0x24be(%rip), %rsi      # 0x683f
movq %rax, %rdi
callq 0x2150
callq 0x50e8
leaq 0x4(%rsp), %r15
movl %eax, (%r15)
movq %r14, %rdi
callq 0x20b0
pushq $0x1
popq %rsi
pushq $0x2
popq %rdx
movq %r15, %rdi
callq 0x3650
cmpl $0x1, (%r15)
jne 0x4501
movq %rbx, %rdi
callq 0x4540
leaq 0x8(%rsp), %r14
movq %r14, %rdi
callq 0x31e4
movq %r14, %rdi
callq 0x3200
leaq 0x8(%rsp), %r14
leaq 0x28(%rsp), %r15
leaq 0x1ec5(%rip), %r12      # 0x62a9
leaq 0x390c(%rip), %r13      # 0x7cf7
cmpb $0x0, 0x22(%rbx)
jne 0x4507
movq %r14, %rdi
callq 0x34ea
movq %r15, %rdi
movq %rax, %rsi
callq 0x5aa6
movq %r15, %rdi
movq %r12, %rsi
callq 0x3643
movl %eax, %ebp
movq %r15, %rdi
callq 0x2090
testb %bpl, %bpl
je 0x442c
movq %rbx, %rdi
callq 0x46d4
jmp 0x43eb
movq %r14, %rdi
callq 0x34ea
movq %r15, %rdi
movq %rax, %rsi
callq 0x5aa6
movq %r15, %rdi
movq %r13, %rsi
callq 0x3643
movl %eax, %ebp
movq %r15, %rdi
callq 0x2090
testb %bpl, %bpl
je 0x4466
movq %rbx, %rdi
movq %r14, %rsi
callq 0x4702
jmp 0x43eb
movq %r14, %rdi
callq 0x34ea
movq %r15, %rdi
movq %rax, %rsi
callq 0x5aa6
movq %r15, %rdi
leaq 0x3792(%rip), %rsi      # 0x7c15
callq 0x3643
movl %eax, %ebp
movq %r15, %rdi
callq 0x2090
testb %bpl, %bpl
je 0x44a7
cmpb $0x1, 0x21(%rbx)
jne 0x44e9
movq %rbx, %rdi
callq 0x47fc
jmp 0x44e0
movq %r14, %rdi
callq 0x34ea
movq %r15, %rdi
movq %rax, %rsi
callq 0x5aa6
movq %r15, %rdi
leaq 0x3935(%rip), %rsi      # 0x7df9
callq 0x3643
movl %eax, %ebp
movq %r15, %rdi
callq 0x2090
testb %bpl, %bpl
je 0x44f1
movq %rbx, %rdi
callq 0x49c2
movb $0x1, 0x22(%rbx)
jmp 0x43eb
movq %rbx, %rdi
callq 0x483e
movq %rbx, %rdi
movq %r14, %rsi
callq 0x4880
jmp 0x43eb
movb $0x1, 0x20(%rbx)
jmp 0x4511
leaq 0x8(%rsp), %rdi
callq 0x31f0
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x452a
jmp 0x452a
jmp 0x452a
jmp 0x452a
jmp 0x452a
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x31f0
movq %rbx, %rdi
callq 0x2230
nop