// File: /workspace/github_cpp_makefile_star2_O3/sagardoshi[P]NegotiationsEncounter/src/GameMaster.cpp
// Function: GameMaster::startScreen()
void GameMaster::startScreen() {
    string loadSave    = "load";
    string newGame     = "new";
    string savePrompt  = "Previous save detected. Type \"" + loadSave + "\" ";
           savePrompt += "to launch it or \"" + newGame + "\" to start fresh.";

    ///////////// First print game title /////////////
    clearScreen();


    int requestedLevel = getStartingLevel();         // Based on separate file

    ///////////// Next change behaviour if previous save detected /////////////
    if (requestedLevel > 0) {
        setUInput(savePrompt, loadSave, newGame);
        if (uInput == "quit") return; // For every new entry, check for quit

        // Previous save detected and loaded
        if (uInput == loadSave) {
            currLevel = requestedLevel;              // Change level
            loadPlayerSavedInventory();              // Adjusts player inv
        }
        // Previous save detected, but ignored
        else if (uInput == newGame) currLevel = 0;   // Start at beginning
        cout << endl;
    }
    ///////////// Or continue as normal if no save detected /////////////
    else {
        currLevel = 0;
        checkpoint();                                // Opportunity for skip
        if (uInput == "quit") return; // For every new entry, check for quit
    }

}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x108, %rsp            # imm = 0x108
movq %rdi, %rbx
leaq 0x78(%rsp), %r12
movq %r12, -0x10(%r12)
leaq 0xad8a(%rip), %rsi      # 0xf385
leaq 0xad87(%rip), %rdx      # 0xf389
leaq 0x68(%rsp), %rdi
callq 0x290e
leaq 0x58(%rsp), %rax
movq %rax, -0x10(%rax)
leaq 0xad6e(%rip), %rsi      # 0xf38a
leaq 0xad6a(%rip), %rdx      # 0xf38d
leaq 0x48(%rsp), %rdi
callq 0x290e
leaq 0xad5a(%rip), %rsi      # 0xf38e
leaq 0x8(%rsp), %rdi
leaq 0x68(%rsp), %rdx
callq 0x6852
leaq 0xad63(%rip), %rsi      # 0xf3ad
leaq 0x8(%rsp), %rdi
callq 0x23d0
leaq 0x38(%rsp), %rsi
movq %rsi, -0x10(%rsi)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x467b
movq %rdx, 0x28(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x38(%rsp)
jmp 0x4681
movups (%rcx), %xmm0
movups %xmm0, (%rsi)
movq 0x8(%rax), %rdx
movq %rdx, 0x30(%rsp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
leaq 0x18(%rsp), %r14
movq -0x10(%r14), %rdi
cmpq %r14, %rdi
je 0x46b4
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x2210
leaq 0xacf5(%rip), %rsi      # 0xf3b0
leaq 0xe8(%rsp), %rdi
leaq 0x48(%rsp), %rdx
callq 0x6852
leaq 0xacee(%rip), %rsi      # 0xf3c2
leaq 0xe8(%rsp), %rdi
callq 0x23d0
movq %r14, 0x8(%rsp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x4704
movq %rdx, 0x8(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x18(%rsp)
jmp 0x470b
movups (%rcx), %xmm0
movups %xmm0, (%r14)
movq 0x8(%rax), %rdx
movq %rdx, 0x10(%rsp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq 0x8(%rsp), %rsi
movq 0x10(%rsp), %rdx
leaq 0x28(%rsp), %rdi
callq 0x20d0
movq 0x8(%rsp), %rdi
cmpq %r14, %rdi
je 0x474e
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x2210
leaq 0xf8(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x476f
movq 0xf8(%rsp), %rsi
incq %rsi
callq 0x2210
movq %rbx, %rdi
callq 0x3c72
movq %rbx, %rdi
callq 0x41c8
movl %eax, %ebp
testl %eax, %eax
jle 0x48da
leaq 0xd8(%rsp), %r14
movq %r14, -0x10(%r14)
movq 0x28(%rsp), %rsi
movq 0x30(%rsp), %rdx
addq %rsi, %rdx
leaq 0xc8(%rsp), %rdi
callq 0x6a38
leaq 0xb8(%rsp), %r15
movq %r15, -0x10(%r15)
movq 0x68(%rsp), %rsi
movq 0x70(%rsp), %rdx
addq %rsi, %rdx
leaq 0xa8(%rsp), %rdi
callq 0x6a38
leaq 0x98(%rsp), %r13
movq %r13, -0x10(%r13)
movq 0x48(%rsp), %rsi
movq 0x50(%rsp), %rdx
addq %rsi, %rdx
leaq 0x88(%rsp), %rdi
callq 0x6a38
leaq 0xc8(%rsp), %rsi
leaq 0xa8(%rsp), %rdx
leaq 0x88(%rsp), %rcx
movq %rbx, %rdi
callq 0x4aba
movq 0x88(%rsp), %rdi
cmpq %r13, %rdi
je 0x4838
movq 0x98(%rsp), %rsi
incq %rsi
callq 0x2210
movq 0xa8(%rsp), %rdi
cmpq %r15, %rdi
je 0x4855
movq 0xb8(%rsp), %rsi
incq %rsi
callq 0x2210
movq 0xc8(%rsp), %rdi
cmpq %r14, %rdi
je 0x4872
movq 0xd8(%rsp), %rsi
incq %rsi
callq 0x2210
leaq 0x70(%rbx), %r14
leaq 0xab57(%rip), %rsi      # 0xf3d4
movq %r14, %rdi
callq 0x20c0
testl %eax, %eax
je 0x4938
movq 0x78(%rbx), %r15
cmpq 0x70(%rsp), %r15
jne 0x48b1
testq %r15, %r15
je 0x48fe
movq 0x68(%rsp), %rsi
movq (%r14), %rdi
movq %r15, %rdx
callq 0x2220
testl %eax, %eax
je 0x48fe
cmpq 0x50(%rsp), %r15
jne 0x4909
testq %r15, %r15
je 0x48d1
movq 0x48(%rsp), %rsi
movq (%r14), %rdi
movq %r15, %rdx
callq 0x2220
testl %eax, %eax
jne 0x4909
movl $0x0, 0x68(%rbx)
jmp 0x4909
movl $0x0, 0x68(%rbx)
movq %rbx, %rdi
callq 0x4de0
addq $0x70, %rbx
leaq 0xaae0(%rip), %rsi      # 0xf3d4
movq %rbx, %rdi
callq 0x20c0
jmp 0x4938
movl %ebp, 0x68(%rbx)
movq %rbx, %rdi
callq 0x4318
movq 0x106c0(%rip), %rdi     # 0x14fd0
movq (%rdi), %rax
addq -0x18(%rax), %rdi
movl $0xa, %esi
callq 0x21f0
movsbl %al, %esi
movq 0x106a5(%rip), %rdi     # 0x14fd0
callq 0x2030
movq %rax, %rdi
callq 0x2170
movq 0x28(%rsp), %rdi
leaq 0x38(%rsp), %rax
cmpq %rax, %rdi
je 0x4954
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x2210
movq 0x48(%rsp), %rdi
leaq 0x58(%rsp), %rax
cmpq %rax, %rdi
je 0x4970
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x2210
movq 0x68(%rsp), %rdi
cmpq %r12, %rdi
je 0x4987
movq 0x78(%rsp), %rsi
incq %rsi
callq 0x2210
addq $0x108, %rsp            # imm = 0x108
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq 0x88(%rsp), %rdi
cmpq %r13, %rdi
je 0x49be
movq 0x98(%rsp), %rsi
incq %rsi
callq 0x2210
jmp 0x49be
movq %rax, %rbx
movq 0xa8(%rsp), %rdi
cmpq %r15, %rdi
je 0x49e0
movq 0xb8(%rsp), %rsi
incq %rsi
callq 0x2210
jmp 0x49e0
movq %rax, %rbx
movq 0xc8(%rsp), %rdi
cmpq %r14, %rdi
je 0x4a62
movq 0xd8(%rsp), %rsi
jmp 0x4a31
jmp 0x4a5f
movq %rax, %rbx
movq 0x8(%rsp), %rdi
cmpq %r14, %rdi
je 0x4a18
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x2210
jmp 0x4a18
movq %rax, %rbx
leaq 0xf8(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x4a62
movq 0xf8(%rsp), %rsi
incq %rsi
callq 0x2210
jmp 0x4a62
jmp 0x4a5f
movq %rax, %rbx
leaq 0x18(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x4a7e
movq 0x18(%rsp), %rsi
jmp 0x4a76
movq %rax, %rbx
jmp 0x4a7e
movq %rax, %rbx
jmp 0x4a9a
movq %rax, %rbx
movq 0x28(%rsp), %rdi
leaq 0x38(%rsp), %rax
cmpq %rax, %rdi
je 0x4a7e
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x2210
movq 0x48(%rsp), %rdi
leaq 0x58(%rsp), %rax
cmpq %rax, %rdi
je 0x4a9a
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x2210
movq 0x68(%rsp), %rdi
cmpq %r12, %rdi
je 0x4ab1
movq 0x78(%rsp), %rsi
incq %rsi
callq 0x2210
movq %rbx, %rdi
callq 0x2390
nop