// File: 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
movq %rsp, %rbp
subq $0x110, %rsp            # imm = 0x110
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0xc8(%rbp)
movq 0x986f(%rip), %rdi      # 0x10fd0
leaq 0x402c(%rip), %rsi      # 0xb794
callq 0x31a0
movq %rax, %rdi
movq 0x9849(%rip), %rsi      # 0x10fc0
callq 0x31d0
movq %rax, %rdi
leaq 0x4021(%rip), %rsi      # 0xb7a7
callq 0x31a0
movq %rax, %rdi
movq 0x982b(%rip), %rsi      # 0x10fc0
callq 0x31d0
movq %rax, %rdi
movq 0x981c(%rip), %rsi      # 0x10fc0
callq 0x31d0
movq %rax, %rdi
leaq 0x3ffc(%rip), %rsi      # 0xb7af
callq 0x31a0
callq 0x95d0
movl %eax, -0xc(%rbp)
movq 0x9809(%rip), %rdi      # 0x10fd0
movq 0x97f2(%rip), %rsi      # 0x10fc0
callq 0x31d0
leaq -0xc(%rbp), %rdi
movl $0x1, %esi
movl $0x2, %edx
callq 0x5b40
cmpl $0x1, -0xc(%rbp)
jne 0x7acc
movq -0xc8(%rbp), %rdi
callq 0x7af0
leaq -0x30(%rbp), %rdi
movq %rdi, -0xd0(%rbp)
callq 0x5280
movq -0xd0(%rbp), %rdi
callq 0x52e0
jmp 0x781a
jmp 0x781c
movq -0xc8(%rbp), %rax
movb 0x22(%rax), %al
xorb $-0x1, %al
testb $0x1, %al
jne 0x7831
jmp 0x7ab6
leaq -0x30(%rbp), %rdi
callq 0x58a0
movq %rax, -0xd8(%rbp)
jmp 0x7843
movq -0xd8(%rbp), %rsi
leaq -0x60(%rbp), %rdi
callq 0xa840
jmp 0x7855
leaq 0x3a1b(%rip), %rsi      # 0xb277
leaq -0x60(%rbp), %rdi
callq 0x5b10
movb %al, -0xd9(%rbp)
jmp 0x786d
leaq -0x60(%rbp), %rdi
callq 0x3110
movb -0xd9(%rbp), %al
testb $0x1, %al
jne 0x7882
jmp 0x78c0
movq -0xc8(%rbp), %rdi
callq 0x7cf0
jmp 0x7890
jmp 0x7ab1
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
jmp 0x7ac1
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
leaq -0x60(%rbp), %rdi
callq 0x3110
jmp 0x7ac1
leaq -0x30(%rbp), %rdi
callq 0x58a0
movq %rax, -0xe8(%rbp)
jmp 0x78d2
movq -0xe8(%rbp), %rsi
leaq -0x80(%rbp), %rdi
callq 0xa840
jmp 0x78e4
leaq 0x536b(%rip), %rsi      # 0xcc56
leaq -0x80(%rbp), %rdi
callq 0x5b10
movb %al, -0xe9(%rbp)
jmp 0x78fc
leaq -0x80(%rbp), %rdi
callq 0x3110
movb -0xe9(%rbp), %al
testb $0x1, %al
jne 0x7911
jmp 0x7942
movq -0xc8(%rbp), %rdi
leaq -0x30(%rbp), %rsi
callq 0x7d50
jmp 0x7923
jmp 0x7aaf
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
leaq -0x80(%rbp), %rdi
callq 0x3110
jmp 0x7ac1
leaq -0x30(%rbp), %rdi
callq 0x58a0
movq %rax, -0xf8(%rbp)
jmp 0x7954
movq -0xf8(%rbp), %rsi
leaq -0xa0(%rbp), %rdi
callq 0xa840
jmp 0x7969
leaq 0x51fe(%rip), %rsi      # 0xcb6e
leaq -0xa0(%rbp), %rdi
callq 0x5b10
movb %al, -0xf9(%rbp)
jmp 0x7984
leaq -0xa0(%rbp), %rdi
callq 0x3110
movb -0xf9(%rbp), %al
testb $0x1, %al
jne 0x799c
jmp 0x7a08
movq -0xc8(%rbp), %rax
testb $0x1, 0x21(%rax)
je 0x79e1
movq -0xc8(%rbp), %rdi
callq 0x7eb0
jmp 0x79b7
movq -0xc8(%rbp), %rax
movb $0x1, 0x22(%rax)
jmp 0x7a03
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
leaq -0xa0(%rbp), %rdi
callq 0x3110
jmp 0x7ac1
movq -0xc8(%rbp), %rdi
callq 0x7f20
jmp 0x79ef
movq -0xc8(%rbp), %rdi
leaq -0x30(%rbp), %rsi
callq 0x7f90
jmp 0x7a01
jmp 0x7a03
jmp 0x7aad
leaq -0x30(%rbp), %rdi
callq 0x58a0
movq %rax, -0x108(%rbp)
jmp 0x7a1a
movq -0x108(%rbp), %rsi
leaq -0xc0(%rbp), %rdi
callq 0xa840
jmp 0x7a2f
leaq 0x5306(%rip), %rsi      # 0xcd3c
leaq -0xc0(%rbp), %rdi
callq 0x5b10
movb %al, -0x109(%rbp)
jmp 0x7a4a
leaq -0xc0(%rbp), %rdi
callq 0x3110
movb -0x109(%rbp), %al
testb $0x1, %al
jne 0x7a62
jmp 0x7a97
movq -0xc8(%rbp), %rdi
callq 0x81f0
jmp 0x7a70
movq -0xc8(%rbp), %rax
movb $0x1, 0x22(%rax)
jmp 0x7aab
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
leaq -0xc0(%rbp), %rdi
callq 0x3110
jmp 0x7ac1
movq -0xc8(%rbp), %rdi
leaq -0x30(%rbp), %rsi
callq 0x7f90
jmp 0x7aa9
jmp 0x7aab
jmp 0x7aad
jmp 0x7aaf
jmp 0x7ab1
jmp 0x781c
leaq -0x30(%rbp), %rdi
callq 0x52b0
jmp 0x7ad7
leaq -0x30(%rbp), %rdi
callq 0x52b0
jmp 0x7ae0
movq -0xc8(%rbp), %rax
movb $0x1, 0x20(%rax)
addq $0x110, %rsp            # imm = 0x110
popq %rbp
retq
movq -0x38(%rbp), %rdi
callq 0x32f0
nopl (%rax)