// File: venGaza[P]starwars/src/Game.cpp
// Function: Game::advance(Map&)
void Game::advance(Map& map) {
    cout << setw(9) << map.currentRoom() << " | Health: " << playerHealth << endl  //Header
    << "---------------------------------" << endl;
    
    map.getLocation()->printChoices();
    
    string choice = map.getLocation()->getChoice();
    doAction(choice, map);          //If not execute player choice
    
    //Update player health after turn
    playerHealth--;
    if (playerHealth == 0) {
        cout << "The combined effects of the blast and adventure have taken its toll... the galaxy starts to slip into darkness as you lose consciousness." << endl << endl;
        gameOver = true;
    }
    pause();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xe0, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0xa8(%rbp)
movl $0x9, %edi
callq 0x88a0
movl %eax, -0x14(%rbp)
movl -0x14(%rbp), %esi
movq 0x900b(%rip), %rdi      # 0x10fd0
callq 0x3220
movq %rax, -0xa0(%rbp)
movq -0x10(%rbp), %rsi
leaq -0x38(%rbp), %rdi
movq %rdi, -0x98(%rbp)
callq 0x5870
movq -0xa0(%rbp), %rdi
movq -0x98(%rbp), %rsi
callq 0x3180
movq %rax, -0x90(%rbp)
jmp 0x8001
movq -0x90(%rbp), %rdi
leaq 0x3dfe(%rip), %rsi      # 0xbe0d
callq 0x31a0
movq %rax, -0xb0(%rbp)
jmp 0x801d
movq -0xb0(%rbp), %rdi
movq -0xa8(%rbp), %rax
movl 0x24(%rax), %esi
callq 0x32e0
movq %rax, -0xb8(%rbp)
jmp 0x803c
movq -0xb8(%rbp), %rdi
movq 0x8f76(%rip), %rsi      # 0x10fc0
callq 0x31d0
movq %rax, -0xc0(%rbp)
jmp 0x8058
movq -0xc0(%rbp), %rdi
leaq 0x3c68(%rip), %rsi      # 0xbcce
callq 0x31a0
movq %rax, -0xc8(%rbp)
jmp 0x8074
movq -0xc8(%rbp), %rdi
movq 0x8f3e(%rip), %rsi      # 0x10fc0
callq 0x31d0
jmp 0x8089
leaq -0x38(%rbp), %rdi
callq 0x3110
movq -0x10(%rbp), %rdi
callq 0x58a0
movq %rax, %rdi
movq (%rdi), %rax
movq 0x10(%rax), %rax
callq *%rax
movq -0x10(%rbp), %rdi
callq 0x58a0
movq %rax, %rsi
movq (%rsi), %rax
movq 0x18(%rax), %rax
leaq -0x68(%rbp), %rdi
movq %rdi, -0xd0(%rbp)
callq *%rax
movq -0xd0(%rbp), %rsi
leaq -0x88(%rbp), %rdi
callq 0x30b0
jmp 0x80dc
movq -0xa8(%rbp), %rdi
movq -0x10(%rbp), %rdx
leaq -0x88(%rbp), %rsi
callq 0x8370
jmp 0x80f5
leaq -0x88(%rbp), %rdi
callq 0x3110
movq -0xa8(%rbp), %rax
movl 0x24(%rax), %ecx
addl $-0x1, %ecx
movl %ecx, 0x24(%rax)
cmpl $0x0, 0x24(%rax)
jne 0x81b4
movq 0x8eae(%rip), %rdi      # 0x10fd0
leaq 0x3cf0(%rip), %rsi      # 0xbe19
callq 0x31a0
movq %rax, -0xd8(%rbp)
jmp 0x8137
movq -0xd8(%rbp), %rdi
movq 0x8e7b(%rip), %rsi      # 0x10fc0
callq 0x31d0
movq %rax, -0xe0(%rbp)
jmp 0x8153
movq -0xe0(%rbp), %rdi
movq 0x8e5f(%rip), %rsi      # 0x10fc0
callq 0x31d0
jmp 0x8168
movq -0xa8(%rbp), %rax
movb $0x1, 0x22(%rax)
jmp 0x81b4
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x38(%rbp), %rdi
callq 0x3110
jmp 0x81dd
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x81d4
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x88(%rbp), %rdi
callq 0x3110
jmp 0x81d4
movq -0xa8(%rbp), %rdi
callq 0x82f0
jmp 0x81c2
leaq -0x68(%rbp), %rdi
callq 0x3110
addq $0xe0, %rsp
popq %rbp
retq
leaq -0x68(%rbp), %rdi
callq 0x3110
movq -0x40(%rbp), %rdi
callq 0x32f0
nopw %cs:(%rax,%rax)