// File: /workspace/github_cpp_makefile_star2_O1/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 0xad7c(%rip), %rsi      # 0xf341
leaq 0xad79(%rip), %rdx      # 0xf345
leaq 0x68(%rsp), %rdi
callq 0x290e
leaq 0x58(%rsp), %rax
movq %rax, -0x10(%rax)
leaq 0xad60(%rip), %rsi      # 0xf346
leaq 0xad5c(%rip), %rdx      # 0xf349
leaq 0x48(%rsp), %rdi
callq 0x290e
leaq 0xad4c(%rip), %rsi      # 0xf34a
leaq 0x8(%rsp), %rdi
leaq 0x68(%rsp), %rdx
callq 0x6696
leaq 0xad55(%rip), %rsi      # 0xf369
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 0x4645
movq %rdx, 0x28(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x38(%rsp)
jmp 0x464b
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 0x467e
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x2210
leaq 0xace7(%rip), %rsi      # 0xf36c
leaq 0xe8(%rsp), %rdi
leaq 0x48(%rsp), %rdx
callq 0x6696
leaq 0xace0(%rip), %rsi      # 0xf37e
leaq 0xe8(%rsp), %rdi
callq 0x23d0
movq %r14, 0x8(%rsp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x46ce
movq %rdx, 0x8(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x18(%rsp)
jmp 0x46d5
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 0x4718
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x2210
leaq 0xf8(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x4739
movq 0xf8(%rsp), %rsi
incq %rsi
callq 0x2210
movq %rbx, %rdi
callq 0x3c2a
movq %rbx, %rdi
callq 0x4192
movl %eax, %ebp
testl %eax, %eax
jle 0x48a4
leaq 0xd8(%rsp), %r14
movq %r14, -0x10(%r14)
movq 0x28(%rsp), %rsi
movq 0x30(%rsp), %rdx
addq %rsi, %rdx
leaq 0xc8(%rsp), %rdi
callq 0x687c
leaq 0xb8(%rsp), %r15
movq %r15, -0x10(%r15)
movq 0x68(%rsp), %rsi
movq 0x70(%rsp), %rdx
addq %rsi, %rdx
leaq 0xa8(%rsp), %rdi
callq 0x687c
leaq 0x98(%rsp), %r13
movq %r13, -0x10(%r13)
movq 0x48(%rsp), %rsi
movq 0x50(%rsp), %rdx
addq %rsi, %rdx
leaq 0x88(%rsp), %rdi
callq 0x687c
leaq 0xc8(%rsp), %rsi
leaq 0xa8(%rsp), %rdx
leaq 0x88(%rsp), %rcx
movq %rbx, %rdi
callq 0x4a84
movq 0x88(%rsp), %rdi
cmpq %r13, %rdi
je 0x4802
movq 0x98(%rsp), %rsi
incq %rsi
callq 0x2210
movq 0xa8(%rsp), %rdi
cmpq %r15, %rdi
je 0x481f
movq 0xb8(%rsp), %rsi
incq %rsi
callq 0x2210
movq 0xc8(%rsp), %rdi
cmpq %r14, %rdi
je 0x483c
movq 0xd8(%rsp), %rsi
incq %rsi
callq 0x2210
leaq 0x70(%rbx), %r14
leaq 0xab49(%rip), %rsi      # 0xf390
movq %r14, %rdi
callq 0x20c0
testl %eax, %eax
je 0x4902
movq 0x78(%rbx), %r15
cmpq 0x70(%rsp), %r15
jne 0x487b
testq %r15, %r15
je 0x48c8
movq 0x68(%rsp), %rsi
movq (%r14), %rdi
movq %r15, %rdx
callq 0x2220
testl %eax, %eax
je 0x48c8
cmpq 0x50(%rsp), %r15
jne 0x48d3
testq %r15, %r15
je 0x489b
movq 0x48(%rsp), %rsi
movq (%r14), %rdi
movq %r15, %rdx
callq 0x2220
testl %eax, %eax
jne 0x48d3
movl $0x0, 0x68(%rbx)
jmp 0x48d3
movl $0x0, 0x68(%rbx)
movq %rbx, %rdi
callq 0x4daa
addq $0x70, %rbx
leaq 0xaad2(%rip), %rsi      # 0xf390
movq %rbx, %rdi
callq 0x20c0
jmp 0x4902
movl %ebp, 0x68(%rbx)
movq %rbx, %rdi
callq 0x42e2
movq 0x106f6(%rip), %rdi     # 0x14fd0
movq (%rdi), %rax
addq -0x18(%rax), %rdi
movl $0xa, %esi
callq 0x21f0
movsbl %al, %esi
movq 0x106db(%rip), %rdi     # 0x14fd0
callq 0x2030
movq %rax, %rdi
callq 0x2170
movq 0x28(%rsp), %rdi
leaq 0x38(%rsp), %rax
cmpq %rax, %rdi
je 0x491e
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x2210
movq 0x48(%rsp), %rdi
leaq 0x58(%rsp), %rax
cmpq %rax, %rdi
je 0x493a
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x2210
movq 0x68(%rsp), %rdi
cmpq %r12, %rdi
je 0x4951
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 0x4988
movq 0x98(%rsp), %rsi
incq %rsi
callq 0x2210
jmp 0x4988
movq %rax, %rbx
movq 0xa8(%rsp), %rdi
cmpq %r15, %rdi
je 0x49aa
movq 0xb8(%rsp), %rsi
incq %rsi
callq 0x2210
jmp 0x49aa
movq %rax, %rbx
movq 0xc8(%rsp), %rdi
cmpq %r14, %rdi
je 0x4a2c
movq 0xd8(%rsp), %rsi
jmp 0x49fb
jmp 0x4a29
movq %rax, %rbx
movq 0x8(%rsp), %rdi
cmpq %r14, %rdi
je 0x49e2
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x2210
jmp 0x49e2
movq %rax, %rbx
leaq 0xf8(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x4a2c
movq 0xf8(%rsp), %rsi
incq %rsi
callq 0x2210
jmp 0x4a2c
jmp 0x4a29
movq %rax, %rbx
leaq 0x18(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x4a48
movq 0x18(%rsp), %rsi
jmp 0x4a40
movq %rax, %rbx
jmp 0x4a48
movq %rax, %rbx
jmp 0x4a64
movq %rax, %rbx
movq 0x28(%rsp), %rdi
leaq 0x38(%rsp), %rax
cmpq %rax, %rdi
je 0x4a48
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x2210
movq 0x48(%rsp), %rdi
leaq 0x58(%rsp), %rax
cmpq %rax, %rdi
je 0x4a64
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x2210
movq 0x68(%rsp), %rdi
cmpq %r12, %rdi
je 0x4a7b
movq 0x78(%rsp), %rsi
incq %rsi
callq 0x2210
movq %rbx, %rdi
callq 0x2390
nop