// File: /workspace/github_cpp_makefile_star2_O3/dnegovan[P]Intruder-On-Donnar-V/Game.cpp
// Function: Game::play(int)
void Game::play(int start)
{
    std::string temp;

    switch (start)
    {
        case 1:
            printPrologue();
            break;
        case 2:
            break;
        case 3:
            return;
    }

    printTitle();
    int input = 0;

    while (input != 1)
    {
        std::cout << "\nEnter 1 to continue:\n";
        input = getInteger();
    }
    std::cout << std::endl << std::endl;

    //print intro - instructions
    printFile("intro.txt", RESET, 0);

    std::cout << "\nHint: This game is played using dynamic numbered menus, so "
              << "keep \none hand over the number keys and one hand over the "
              << "enter key.\n"
              << "\nPress enter to begin\n";
    getline(std::cin, temp);

    //initial status
    printShip();

    //gameplay loop
    while (markNelson.state == UNFINISHED)
    {
        if (currentSpace->actionMenu(markNelson))  //returns false if game over
        {
    		printShip();
    		if (move())  //only true if player decides to move
            {
                //time winds down as player moves
    			if(decrementTime())  //false if game over
                {
                    //show updated map/status
                    printShip();
                }
            }
        }
    }

    printEnding();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x60, %rsp
leaq -0x70(%rbp), %r12
movq %r12, -0x10(%r12)
movq $0x0, -0x8(%r12)
movb $0x0, (%r12)
cmpl $0x3, %esi
je 0x1149b
movq %rdi, %rbx
cmpl $0x1, %esi
jne 0x112be
callq 0x114f0
callq 0x1175c
xorl %eax, %eax
movq 0xacfc(%rip), %r14      # 0x1bfc8
leaq 0x54fb(%rip), %r15      # 0x167ce
cmpl $0x1, %eax
je 0x112ef
movl $0x16, %edx
movq %r14, %rdi
movq %r15, %rsi
callq 0x3210
callq 0xf6ef
jmp 0x112d3
movq (%r14), %rax
addq -0x18(%rax), %r14
movq %r14, %rdi
movl $0xa, %esi
callq 0x31d0
movsbl %al, %esi
movq 0xacbb(%rip), %rdi      # 0x1bfc8
callq 0x3030
movq %rax, %rdi
callq 0x3140
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
leaq -0x50(%rbp), %r14
movq %r14, -0x10(%r14)
leaq 0x5492(%rip), %rsi      # 0x167e5
leaq 0x5494(%rip), %rdx      # 0x167ee
leaq -0x60(%rbp), %rdi
callq 0xe56e
leaq -0x30(%rbp), %r15
movq %r15, -0x10(%r15)
leaq 0x4d3c(%rip), %rsi      # 0x160ae
leaq 0x4d39(%rip), %rdx      # 0x160b2
leaq -0x40(%rbp), %rdi
callq 0xe56e
leaq -0x60(%rbp), %rdi
leaq -0x40(%rbp), %rsi
xorps %xmm0, %xmm0
callq 0x106b8
movq -0x40(%rbp), %rdi
cmpq %r15, %rdi
je 0x113a0
callq 0x31c0
movq -0x60(%rbp), %rdi
cmpq %r14, %rdi
je 0x113ae
callq 0x31c0
movq 0xac13(%rip), %rdi      # 0x1bfc8
leaq 0x5433(%rip), %rsi      # 0x167ef
movl $0x3c, %edx
callq 0x3210
movq 0xabfb(%rip), %rdi      # 0x1bfc8
leaq 0x5458(%rip), %rsi      # 0x1682c
movl $0x3a, %edx
callq 0x3210
movq 0xabe3(%rip), %rdi      # 0x1bfc8
leaq 0x547b(%rip), %rsi      # 0x16867
movl $0xb, %edx
callq 0x3210
movq 0xabcb(%rip), %rdi      # 0x1bfc8
leaq 0x546f(%rip), %rsi      # 0x16873
movl $0x16, %edx
callq 0x3210
movq 0xabc3(%rip), %rdi      # 0x1bfd8
movq (%rdi), %rax
addq -0x18(%rax), %rdi
movl $0xa, %esi
callq 0x31d0
movsbl %al, %edx
movq 0xaba8(%rip), %rdi      # 0x1bfd8
leaq -0x80(%rbp), %rsi
callq 0x3350
movq %rbx, %rdi
callq 0x118c2
cmpl $0x0, 0x30(%rbx)
jne 0x11485
movq 0xc0(%rbx), %rdi
movq (%rdi), %rax
movq %rbx, %rsi
callq *0x10(%rax)
testb %al, %al
je 0x11441
movq %rbx, %rdi
callq 0x118c2
movq %rbx, %rdi
callq 0x12386
testb %al, %al
je 0x11441
movq %rbx, %rdi
callq 0x1273a
testb %al, %al
je 0x11441
movq %rbx, %rdi
callq 0x118c2
jmp 0x11441
movq %rbx, %rdi
callq 0x12bc2
movq -0x80(%rbp), %rdi
cmpq %r12, %rdi
je 0x1149b
callq 0x31c0
addq $0x60, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq -0x40(%rbp), %rdi
cmpq %r15, %rdi
je 0x114be
callq 0x31c0
jmp 0x114be
movq %rax, %rbx
movq -0x60(%rbp), %rdi
cmpq %r14, %rdi
je 0x114d9
callq 0x31c0
jmp 0x114d9
jmp 0x114d6
jmp 0x114d6
jmp 0x114d6
jmp 0x114d6
movq %rax, %rbx
movq -0x80(%rbp), %rdi
cmpq %r12, %rdi
je 0x114e7
callq 0x31c0
movq %rbx, %rdi
callq 0x3320
nop