// File: 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
movq %rsp, %rbp
subq $0x180, %rsp            # imm = 0x180
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x168(%rbp)
leaq -0x29(%rbp), %rdi
movq %rdi, -0x160(%rbp)
callq 0x3520
movq -0x160(%rbp), %rdx
leaq 0x16319(%rip), %rsi     # 0x1c351
leaq -0x28(%rbp), %rdi
callq 0x3b80
jmp 0x6043
leaq -0x29(%rbp), %rdi
callq 0x3350
leaq -0x61(%rbp), %rdi
movq %rdi, -0x170(%rbp)
callq 0x3520
movq -0x170(%rbp), %rdx
leaq 0x162ec(%rip), %rsi     # 0x1c356
leaq -0x60(%rbp), %rdi
callq 0x3b80
jmp 0x6075
leaq -0x61(%rbp), %rdi
callq 0x3350
leaq 0x162d5(%rip), %rsi     # 0x1c35a
leaq -0xa8(%rbp), %rdi
leaq -0x28(%rbp), %rdx
callq 0x8970
jmp 0x6097
leaq 0x162db(%rip), %rdx     # 0x1c379
leaq -0x88(%rbp), %rdi
leaq -0xa8(%rbp), %rsi
callq 0x8440
jmp 0x60b3
leaq -0xa8(%rbp), %rdi
callq 0x3200
leaq 0x162b6(%rip), %rsi     # 0x1c37c
leaq -0xe8(%rbp), %rdi
leaq -0x60(%rbp), %rdx
callq 0x8970
jmp 0x60d8
leaq 0x162af(%rip), %rdx     # 0x1c38e
leaq -0xc8(%rbp), %rdi
leaq -0xe8(%rbp), %rsi
callq 0x8440
jmp 0x60f4
leaq -0x88(%rbp), %rdi
leaq -0xc8(%rbp), %rsi
callq 0x33e0
jmp 0x6109
leaq -0xc8(%rbp), %rdi
callq 0x3200
leaq -0xe8(%rbp), %rdi
callq 0x3200
movq -0x168(%rbp), %rdi
callq 0x5670
jmp 0x612f
movq -0x168(%rbp), %rdi
callq 0x5c10
movl %eax, -0x174(%rbp)
jmp 0x6143
movl -0x174(%rbp), %eax
movl %eax, -0xec(%rbp)
cmpl $0x0, -0xec(%rbp)
jle 0x6388
leaq -0x110(%rbp), %rdi
leaq -0x88(%rbp), %rsi
callq 0x3170
jmp 0x6171
leaq -0x130(%rbp), %rdi
leaq -0x28(%rbp), %rsi
callq 0x3170
jmp 0x6183
leaq -0x150(%rbp), %rdi
leaq -0x60(%rbp), %rsi
callq 0x3170
jmp 0x6195
movq -0x168(%rbp), %rdi
leaq -0x110(%rbp), %rsi
leaq -0x130(%rbp), %rdx
leaq -0x150(%rbp), %rcx
callq 0x6430
jmp 0x61b8
leaq -0x150(%rbp), %rdi
callq 0x3200
leaq -0x130(%rbp), %rdi
callq 0x3200
leaq -0x110(%rbp), %rdi
callq 0x3200
movq -0x168(%rbp), %rdi
addq $0x70, %rdi
leaq 0x161b2(%rip), %rsi     # 0x1c3a0
callq 0x8a80
movb %al, -0x175(%rbp)
jmp 0x61fb
movb -0x175(%rbp), %al
testb $0x1, %al
jne 0x620a
jmp 0x6314
movl $0x1, -0x154(%rbp)
jmp 0x63e0
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
leaq -0x29(%rbp), %rdi
callq 0x3350
jmp 0x6425
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
leaq -0x61(%rbp), %rdi
callq 0x3350
jmp 0x641c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
jmp 0x6413
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
leaq -0xa8(%rbp), %rdi
callq 0x3200
jmp 0x6413
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
jmp 0x6407
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
jmp 0x62b2
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
leaq -0xc8(%rbp), %rdi
callq 0x3200
leaq -0xe8(%rbp), %rdi
callq 0x3200
jmp 0x6407
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
jmp 0x6303
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
jmp 0x62f7
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
leaq -0x150(%rbp), %rdi
callq 0x3200
leaq -0x130(%rbp), %rdi
callq 0x3200
leaq -0x110(%rbp), %rdi
callq 0x3200
jmp 0x6407
movq -0x168(%rbp), %rdi
addq $0x70, %rdi
leaq -0x28(%rbp), %rsi
callq 0x8ab0
testb $0x1, %al
jne 0x632e
jmp 0x6347
movq -0x168(%rbp), %rdi
movl -0xec(%rbp), %eax
movl %eax, 0x68(%rdi)
callq 0x5d30
jmp 0x6345
jmp 0x6371
movq -0x168(%rbp), %rdi
addq $0x70, %rdi
leaq -0x60(%rbp), %rsi
callq 0x8ab0
testb $0x1, %al
jne 0x6361
jmp 0x636f
movq -0x168(%rbp), %rax
movl $0x0, 0x68(%rax)
jmp 0x6371
movq 0x20c48(%rip), %rdi     # 0x26fc0
movq 0x20c29(%rip), %rsi     # 0x26fa8
callq 0x3330
jmp 0x6386
jmp 0x63d6
movq -0x168(%rbp), %rdi
movl $0x0, 0x68(%rdi)
callq 0x6870
jmp 0x639d
movq -0x168(%rbp), %rdi
addq $0x70, %rdi
leaq 0x15ff1(%rip), %rsi     # 0x1c3a0
callq 0x8a80
movb %al, -0x176(%rbp)
jmp 0x63bc
movb -0x176(%rbp), %al
testb $0x1, %al
jne 0x63c8
jmp 0x63d4
movl $0x1, -0x154(%rbp)
jmp 0x63e0
jmp 0x63d6
movl $0x0, -0x154(%rbp)
leaq -0x88(%rbp), %rdi
callq 0x3200
leaq -0x60(%rbp), %rdi
callq 0x3200
leaq -0x28(%rbp), %rdi
callq 0x3200
addq $0x180, %rsp            # imm = 0x180
popq %rbp
retq
leaq -0x88(%rbp), %rdi
callq 0x3200
leaq -0x60(%rbp), %rdi
callq 0x3200
leaq -0x28(%rbp), %rdi
callq 0x3200
movq -0x38(%rbp), %rdi
callq 0x3510
nop