// File: /workspace/github_cpp_makefile_star2_O1/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 0x116c1
movq %rdi, %rbx
cmpl $0x1, %esi
jne 0x114f2
callq 0x11724
callq 0x11990
xorl %eax, %eax
movq 0xaac8(%rip), %r14      # 0x1bfc8
leaq 0x52c7(%rip), %r15      # 0x167ce
cmpl $0x1, %eax
je 0x11523
movl $0x16, %edx
movq %r14, %rdi
movq %r15, %rsi
callq 0x3210
callq 0xf8fa
jmp 0x11507
movq (%r14), %rax
addq -0x18(%rax), %r14
movq %r14, %rdi
movl $0xa, %esi
callq 0x31d0
movsbl %al, %esi
movq 0xaa87(%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 0x525e(%rip), %rsi      # 0x167e5
leaq 0x5260(%rip), %rdx      # 0x167ee
leaq -0x60(%rbp), %rdi
callq 0xe724
leaq -0x30(%rbp), %r15
movq %r15, -0x10(%r15)
leaq 0x4b08(%rip), %rsi      # 0x160ae
leaq 0x4b05(%rip), %rdx      # 0x160b2
leaq -0x40(%rbp), %rdi
callq 0xe724
leaq -0x60(%rbp), %rdi
leaq -0x40(%rbp), %rsi
xorps %xmm0, %xmm0
callq 0x108e7
movq -0x40(%rbp), %rdi
cmpq %r15, %rdi
je 0x115d4
callq 0x31c0
movq -0x60(%rbp), %rdi
cmpq %r14, %rdi
je 0x115e2
callq 0x31c0
movq 0xa9df(%rip), %rdi      # 0x1bfc8
leaq 0x51ff(%rip), %rsi      # 0x167ef
movl $0x3c, %edx
callq 0x3210
movq 0xa9c7(%rip), %rdi      # 0x1bfc8
leaq 0x5224(%rip), %rsi      # 0x1682c
movl $0x3a, %edx
callq 0x3210
movq 0xa9af(%rip), %rdi      # 0x1bfc8
leaq 0x5247(%rip), %rsi      # 0x16867
movl $0xb, %edx
callq 0x3210
movq 0xa997(%rip), %rdi      # 0x1bfc8
leaq 0x523b(%rip), %rsi      # 0x16873
movl $0x16, %edx
callq 0x3210
movq 0xa98f(%rip), %rdi      # 0x1bfd8
movq (%rdi), %rax
addq -0x18(%rax), %rdi
movl $0xa, %esi
callq 0x31d0
movsbl %al, %edx
movq 0xa974(%rip), %rdi      # 0x1bfd8
leaq -0x80(%rbp), %rsi
callq 0x3350
movq %rbx, %rdi
callq 0x11af6
cmpl $0x0, 0x30(%rbx)
jne 0x116b9
movq 0xc0(%rbx), %rdi
movq (%rdi), %rax
movq %rbx, %rsi
callq *0x10(%rax)
testb %al, %al
je 0x11675
movq %rbx, %rdi
callq 0x11af6
movq %rbx, %rdi
callq 0x125c6
testb %al, %al
je 0x11675
movq %rbx, %rdi
callq 0x1297a
testb %al, %al
je 0x11675
movq %rbx, %rdi
callq 0x11af6
jmp 0x11675
movq %rbx, %rdi
callq 0x12e02
movq -0x80(%rbp), %rdi
cmpq %r12, %rdi
je 0x116cf
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 0x116f2
callq 0x31c0
jmp 0x116f2
movq %rax, %rbx
movq -0x60(%rbp), %rdi
cmpq %r14, %rdi
je 0x1170d
callq 0x31c0
jmp 0x1170d
jmp 0x1170a
jmp 0x1170a
jmp 0x1170a
jmp 0x1170a
movq %rax, %rbx
movq -0x80(%rbp), %rdi
cmpq %r12, %rdi
je 0x1171b
callq 0x31c0
movq %rbx, %rdi
callq 0x3320
nop