// File: /workspace/github_cpp_makefile_star2_O1/sagardoshi[P]NegotiationsEncounter/src/GameMaster.cpp
// Function: GameMaster::loadScript(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
void GameMaster::loadScript(string filename) {
    if (doSkip) return; // Skip all text until encounter

    string filepath = "txt/" + filename + ".txt";
    string line = "", output = "";

	ifstream in(filepath);

	while (getline(in, line)) {
        if (line == "***") {
            cout << output << endl;
            checkpoint();
            if (uInput == "quit") return; // For every new entry, check for quit
            output = "";

            // Handle "skip" typed within a script file
            if (doSkip) {
                in.close();
                return;
            }
        } else if (isAsteriskEntry(line)) {
            handleSpecificInput(line, output);
            if (uInput == "quit") return; // For every new entry, check for quit
        } else output += "\n" + line;
    }

    in.close();

    cout << output << endl << endl;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x2c8, %rsp            # imm = 0x2C8
cmpb $0x0, 0x6c(%rdi)
jne 0x57ce
movq %rsi, %rdx
movq %rdi, %rbx
leaq 0xa02f(%rip), %rsi      # 0xf3f7
leaq 0xc0(%rsp), %r14
movq %r14, %rdi
callq 0x6696
leaq 0x9eb8(%rip), %rsi      # 0xf297
movq %r14, %rdi
callq 0x23d0
leaq 0x50(%rsp), %rsi
movq %rsi, -0x10(%rsi)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x540e
movq %rdx, 0x40(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x50(%rsp)
jmp 0x5414
movups (%rcx), %xmm0
movups %xmm0, (%rsi)
movq 0x8(%rax), %rdx
movq %rdx, 0x48(%rsp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
leaq 0xd0(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x544d
movq 0xd0(%rsp), %rsi
incq %rsi
callq 0x2210
leaq 0x30(%rsp), %rax
movq %rax, -0x10(%rax)
leaq 0x9f5b(%rip), %rdx      # 0xf3b8
leaq 0x20(%rsp), %rdi
movq %rdx, %rsi
callq 0x290e
leaq 0x10(%rsp), %rax
movq %rax, -0x10(%rax)
leaq 0x9f3e(%rip), %rdx      # 0xf3b8
movq %rsp, %rdi
movq %rdx, %rsi
callq 0x290e
leaq 0xc0(%rsp), %r14
leaq 0x40(%rsp), %rsi
movq %r14, %rdi
movl $0x8, %edx
callq 0x2340
leaq 0xb0(%rsp), %rbp
leaq 0x70(%rbx), %r15
leaq 0x20(%rsp), %r12
movq 0xc0(%rsp), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x21f0
movsbl %al, %edx
movq %r14, %rdi
movq %r12, %rsi
callq 0x23b0
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
testb $0x5, 0x20(%rax,%rcx)
jne 0x56e9
movq %r12, %rdi
leaq 0x9f09(%rip), %rsi      # 0xf3fc
callq 0x20c0
testl %eax, %eax
je 0x5606
movq %rbp, 0xa0(%rsp)
movq 0x20(%rsp), %rsi
movq 0x28(%rsp), %rdx
addq %rsi, %rdx
leaq 0xa0(%rsp), %rdi
callq 0x687c
movq 0xa8(%rsp), %rcx
cmpq $0x7, %rcx
jb 0x5574
movq 0xa0(%rsp), %rax
cmpb $0x2a, (%rax)
jne 0x5574
cmpb $0x2a, -0x1(%rax,%rcx)
jne 0x5574
addq %rax, %rcx
addq $-0x2, %rcx
xorl %esi, %esi
movq %rsi, %rdx
cmpq $0x2, %rsi
je 0x556a
cmpb $0x2a, 0x1(%rax,%rdx)
jne 0x556a
cmpb $0x2a, (%rcx)
leaq -0x1(%rcx), %rcx
leaq 0x1(%rdx), %rsi
je 0x554d
cmpq $0x2, %rdx
setae %r13b
jmp 0x5577
xorl %r13d, %r13d
movq 0xa0(%rsp), %rdi
cmpq %rbp, %rdi
je 0x5594
movq 0xb0(%rsp), %rsi
incq %rsi
callq 0x2210
testb %r13b, %r13b
je 0x568c
leaq 0x70(%rsp), %rax
movq %rax, 0x60(%rsp)
movq 0x20(%rsp), %rsi
movq 0x28(%rsp), %rdx
addq %rsi, %rdx
leaq 0x60(%rsp), %rdi
callq 0x687c
movq %rbx, %rdi
leaq 0x60(%rsp), %rsi
movq %rsp, %rdx
callq 0x5018
movq 0x60(%rsp), %rdi
leaq 0x70(%rsp), %rax
cmpq %rax, %rdi
je 0x55ea
movq 0x70(%rsp), %rsi
incq %rsi
callq 0x2210
movq %r15, %rdi
leaq 0x9d9c(%rip), %rsi      # 0xf390
callq 0x20c0
testl %eax, %eax
jne 0x54b0
jmp 0x576e
movq (%rsp), %rsi
movq 0x8(%rsp), %rdx
movq 0xf9ba(%rip), %rdi      # 0x14fd0
callq 0x2260
movq %rax, %r13
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r13, %rdi
movl $0xa, %esi
callq 0x21f0
movsbl %al, %esi
movq %r13, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x2170
movq %rbx, %rdi
callq 0x4daa
movq %r15, %rdi
leaq 0x9d39(%rip), %rsi      # 0xf390
callq 0x20c0
testl %eax, %eax
je 0x576e
movq 0x8(%rsp), %rdx
movq %rsp, %rdi
xorl %esi, %esi
leaq 0x9d43(%rip), %rcx      # 0xf3b8
xorl %r8d, %r8d
callq 0x2320
cmpb $0x1, 0x6c(%rbx)
jne 0x54b0
jmp 0x5761
leaq 0x80(%rsp), %rdi
leaq 0x9d1c(%rip), %rsi      # 0xf3b7
movq %r12, %rdx
callq 0x6696
movq 0x80(%rsp), %rsi
movq 0x88(%rsp), %rdx
movq %rsp, %rdi
callq 0x20d0
movq 0x80(%rsp), %rdi
leaq 0x90(%rsp), %rax
cmpq %rax, %rdi
je 0x54b0
movq 0x90(%rsp), %rsi
incq %rsi
callq 0x2210
jmp 0x54b0
leaq 0xc0(%rsp), %rdi
callq 0x2090
movq (%rsp), %rsi
movq 0x8(%rsp), %rdx
movq 0xf8ca(%rip), %rdi      # 0x14fd0
callq 0x2260
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x21f0
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x2170
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x21f0
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x2170
jmp 0x576e
leaq 0xc0(%rsp), %rdi
callq 0x2090
leaq 0xc0(%rsp), %rdi
callq 0x20a0
movq (%rsp), %rdi
leaq 0x10(%rsp), %rax
cmpq %rax, %rdi
je 0x5796
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x2210
movq 0x20(%rsp), %rdi
leaq 0x30(%rsp), %rax
cmpq %rax, %rdi
je 0x57b2
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x2210
movq 0x40(%rsp), %rdi
leaq 0x50(%rsp), %rax
cmpq %rax, %rdi
je 0x57ce
movq 0x50(%rsp), %rsi
incq %rsi
callq 0x2210
addq $0x2c8, %rsp            # imm = 0x2C8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
jmp 0x5874
movq %rax, %rbx
jmp 0x588f
movq %rax, %rbx
jmp 0x58ab
movq %rax, %rbx
leaq 0xd0(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x58c7
movq 0xd0(%rsp), %rsi
jmp 0x58bf
jmp 0x5864
movq %rax, %rbx
movq 0x60(%rsp), %rdi
leaq 0x70(%rsp), %rax
cmpq %rax, %rdi
je 0x5867
movq 0x70(%rsp), %rsi
jmp 0x5858
movq %rax, %rbx
movq 0x80(%rsp), %rdi
leaq 0x90(%rsp), %rax
cmpq %rax, %rdi
je 0x5867
movq 0x90(%rsp), %rsi
incq %rsi
callq 0x2210
jmp 0x5867
jmp 0x5864
movq %rax, %rbx
leaq 0xc0(%rsp), %rdi
callq 0x20a0
movq (%rsp), %rdi
leaq 0x10(%rsp), %rax
cmpq %rax, %rdi
je 0x588f
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x2210
movq 0x20(%rsp), %rdi
leaq 0x30(%rsp), %rax
cmpq %rax, %rdi
je 0x58ab
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x2210
movq 0x40(%rsp), %rdi
leaq 0x50(%rsp), %rax
cmpq %rax, %rdi
je 0x58c7
movq 0x50(%rsp), %rsi
incq %rsi
callq 0x2210
movq %rbx, %rdi
callq 0x2390
nop