// File: 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
subq $0xe0, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0xa0(%rbp)
leaq -0x30(%rbp), %rdi
callq 0x3300
movl -0xc(%rbp), %eax
movl %eax, -0x98(%rbp)
subl $0x1, %eax
je 0x19750
jmp 0x19736
movl -0x98(%rbp), %eax
subl $0x2, %eax
je 0x19771
jmp 0x19743
movl -0x98(%rbp), %eax
subl $0x3, %eax
je 0x19773
jmp 0x1977f
movq -0xa0(%rbp), %rdi
callq 0x19a50
jmp 0x1975e
jmp 0x1977f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
jmp 0x19a3e
jmp 0x1977f
movl $0x1, -0x40(%rbp)
jmp 0x19a2c
movq -0xa0(%rbp), %rdi
callq 0x19d40
jmp 0x1978d
movl $0x0, -0x44(%rbp)
cmpl $0x1, -0x44(%rbp)
je 0x197c7
movq 0xf827(%rip), %rdi      # 0x28fc8
leaq 0x6026(%rip), %rsi      # 0x1f7ce
callq 0x3210
jmp 0x197af
callq 0x175c0
movl %eax, -0xa4(%rbp)
jmp 0x197bc
movl -0xa4(%rbp), %eax
movl %eax, -0x44(%rbp)
jmp 0x19794
movq 0xf7fa(%rip), %rdi      # 0x28fc8
movq 0xf7db(%rip), %rsi      # 0x28fb0
callq 0x3240
movq %rax, -0xb0(%rbp)
jmp 0x197e3
movq -0xb0(%rbp), %rdi
movq 0xf7bf(%rip), %rsi      # 0x28fb0
callq 0x3240
jmp 0x197f8
leaq -0x69(%rbp), %rdi
movq %rdi, -0xb8(%rbp)
callq 0x33d0
movq -0xb8(%rbp), %rdx
leaq 0x5fcf(%rip), %rsi      # 0x1f7e5
leaq -0x68(%rbp), %rdi
callq 0x32f0
jmp 0x19821
leaq -0x91(%rbp), %rdi
movq %rdi, -0xc0(%rbp)
callq 0x33d0
movq -0xc0(%rbp), %rdx
leaq 0x5891(%rip), %rsi      # 0x1f0d3
leaq -0x90(%rbp), %rdi
callq 0x32f0
jmp 0x19850
leaq -0x68(%rbp), %rdi
leaq -0x90(%rbp), %rsi
xorps %xmm0, %xmm0
callq 0x18550
jmp 0x19865
leaq -0x90(%rbp), %rdi
callq 0x3448
leaq -0x91(%rbp), %rdi
callq 0x3250
leaq -0x68(%rbp), %rdi
callq 0x3448
leaq -0x69(%rbp), %rdi
callq 0x3250
movq 0xf732(%rip), %rdi      # 0x28fc8
leaq 0x5f52(%rip), %rsi      # 0x1f7ef
callq 0x3210
movq %rax, -0xc8(%rbp)
jmp 0x198ab
movq -0xc8(%rbp), %rdi
leaq 0x5f73(%rip), %rsi      # 0x1f82c
callq 0x3210
movq %rax, -0xd0(%rbp)
jmp 0x198c7
movq -0xd0(%rbp), %rdi
leaq 0x5f92(%rip), %rsi      # 0x1f867
callq 0x3210
movq %rax, -0xd8(%rbp)
jmp 0x198e3
movq -0xd8(%rbp), %rdi
leaq 0x5f82(%rip), %rsi      # 0x1f873
callq 0x3210
jmp 0x198f8
movq 0xf6d9(%rip), %rdi      # 0x28fd8
leaq -0x30(%rbp), %rsi
callq 0x3050
jmp 0x1990a
movq -0xa0(%rbp), %rdi
callq 0x19ea0
jmp 0x19918
jmp 0x1991a
movq -0xa0(%rbp), %rax
cmpl $0x0, 0x30(%rax)
jne 0x19a17
movq -0xa0(%rbp), %rsi
movq 0xc0(%rsi), %rdi
movq (%rdi), %rax
movq 0x10(%rax), %rax
callq *%rax
movb %al, -0xd9(%rbp)
jmp 0x1994a
movb -0xd9(%rbp), %al
testb $0x1, %al
jne 0x19959
jmp 0x19a12
movq -0xa0(%rbp), %rdi
callq 0x19ea0
jmp 0x19967
movq -0xa0(%rbp), %rdi
callq 0x1abd0
movb %al, -0xda(%rbp)
jmp 0x1997b
movb -0xda(%rbp), %al
testb $0x1, %al
jne 0x1998a
jmp 0x19a10
movq -0xa0(%rbp), %rdi
callq 0x1b080
movb %al, -0xdb(%rbp)
jmp 0x1999e
movb -0xdb(%rbp), %al
testb $0x1, %al
jne 0x199aa
jmp 0x19a0e
movq -0xa0(%rbp), %rdi
callq 0x19ea0
jmp 0x199b8
jmp 0x19a0e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
jmp 0x19a03
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
jmp 0x199ee
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
leaq -0x90(%rbp), %rdi
callq 0x3448
leaq -0x91(%rbp), %rdi
callq 0x3250
leaq -0x68(%rbp), %rdi
callq 0x3448
leaq -0x69(%rbp), %rdi
callq 0x3250
jmp 0x19a3e
jmp 0x19a10
jmp 0x19a12
jmp 0x1991a
movq -0xa0(%rbp), %rdi
callq 0x1b570
jmp 0x19a25
movl $0x0, -0x40(%rbp)
leaq -0x30(%rbp), %rdi
callq 0x3448
addq $0xe0, %rsp
popq %rbp
retq
leaq -0x30(%rbp), %rdi
callq 0x3448
movq -0x38(%rbp), %rdi
callq 0x33c0