// File: /workspace/github_cpp_makefile_star2_O3/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 0x57e3
movq %rsi, %rdx
movq %rdi, %rbx
leaq 0xa04d(%rip), %rsi      # 0xf43b
leaq 0xc0(%rsp), %r14
movq %r14, %rdi
callq 0x6852
leaq 0x9ed6(%rip), %rsi      # 0xf2db
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 0x5434
movq %rdx, 0x40(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x50(%rsp)
jmp 0x543a
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 0x5473
movq 0xd0(%rsp), %rsi
incq %rsi
callq 0x2210
leaq 0x30(%rsp), %rax
movq %rax, -0x10(%rax)
leaq 0x9f79(%rip), %rdx      # 0xf3fc
leaq 0x20(%rsp), %rdi
movq %rdx, %rsi
callq 0x290e
leaq 0x10(%rsp), %rax
movq %rax, -0x10(%rax)
leaq 0x9f5c(%rip), %rdx      # 0xf3fc
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 0x56fe
movq %r12, %rdi
leaq 0x9f27(%rip), %rsi      # 0xf440
callq 0x20c0
testl %eax, %eax
je 0x55ec
movq %rbp, 0xa0(%rsp)
movq 0x20(%rsp), %rsi
movq 0x28(%rsp), %rdx
addq %rsi, %rdx
leaq 0xa0(%rsp), %rdi
callq 0x6a38
movq 0xa0(%rsp), %rdi
movq 0xa8(%rsp), %rax
cmpq $0x7, %rax
jae 0x5672
xorl %r13d, %r13d
cmpq %rbp, %rdi
je 0x557a
movq 0xb0(%rsp), %rsi
incq %rsi
callq 0x2210
testb %r13b, %r13b
je 0x56a1
leaq 0x70(%rsp), %rax
movq %rax, 0x60(%rsp)
movq 0x20(%rsp), %rsi
movq 0x28(%rsp), %rdx
addq %rsi, %rdx
leaq 0x60(%rsp), %rdi
callq 0x6a38
movq %rbx, %rdi
leaq 0x60(%rsp), %rsi
movq %rsp, %rdx
callq 0x504e
movq 0x60(%rsp), %rdi
leaq 0x70(%rsp), %rax
cmpq %rax, %rdi
je 0x55d0
movq 0x70(%rsp), %rsi
incq %rsi
callq 0x2210
movq %r15, %rdi
leaq 0x9dfa(%rip), %rsi      # 0xf3d4
callq 0x20c0
testl %eax, %eax
jne 0x54d6
jmp 0x5783
movq (%rsp), %rsi
movq 0x8(%rsp), %rdx
movq 0xf9d4(%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 0x4de0
movq %r15, %rdi
leaq 0x9d97(%rip), %rsi      # 0xf3d4
callq 0x20c0
testl %eax, %eax
je 0x5783
movq 0x8(%rsp), %rdx
movq %rsp, %rdi
xorl %esi, %esi
leaq 0x9da1(%rip), %rcx      # 0xf3fc
xorl %r8d, %r8d
callq 0x2320
cmpb $0x1, 0x6c(%rbx)
jne 0x54d6
jmp 0x5776
addq %rdi, %rax
movl $0x3, %ecx
movq %rdi, %rdx
cmpb $0x2a, (%rdx)
jne 0x5562
cmpb $0x2a, -0x4(%rax,%rcx)
jne 0x5562
incq %rdx
decq %rcx
jne 0x567d
movb $0x1, %r13b
jmp 0x5565
leaq 0x80(%rsp), %rdi
leaq 0x9d4b(%rip), %rsi      # 0xf3fb
movq %r12, %rdx
callq 0x6852
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 0x54d6
movq 0x90(%rsp), %rsi
incq %rsi
callq 0x2210
jmp 0x54d6
leaq 0xc0(%rsp), %rdi
callq 0x2090
movq (%rsp), %rsi
movq 0x8(%rsp), %rdx
movq 0xf8b5(%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 0x5783
leaq 0xc0(%rsp), %rdi
callq 0x2090
leaq 0xc0(%rsp), %rdi
callq 0x20a0
movq (%rsp), %rdi
leaq 0x10(%rsp), %rax
cmpq %rax, %rdi
je 0x57ab
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x2210
movq 0x20(%rsp), %rdi
leaq 0x30(%rsp), %rax
cmpq %rax, %rdi
je 0x57c7
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x2210
movq 0x40(%rsp), %rdi
leaq 0x50(%rsp), %rax
cmpq %rax, %rdi
je 0x57e3
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 0x5889
movq %rax, %rbx
jmp 0x58a4
movq %rax, %rbx
jmp 0x58c0
movq %rax, %rbx
leaq 0xd0(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x58dc
movq 0xd0(%rsp), %rsi
jmp 0x58d4
jmp 0x5879
movq %rax, %rbx
movq 0x60(%rsp), %rdi
leaq 0x70(%rsp), %rax
cmpq %rax, %rdi
je 0x587c
movq 0x70(%rsp), %rsi
jmp 0x586d
movq %rax, %rbx
movq 0x80(%rsp), %rdi
leaq 0x90(%rsp), %rax
cmpq %rax, %rdi
je 0x587c
movq 0x90(%rsp), %rsi
incq %rsi
callq 0x2210
jmp 0x587c
jmp 0x5879
movq %rax, %rbx
leaq 0xc0(%rsp), %rdi
callq 0x20a0
movq (%rsp), %rdi
leaq 0x10(%rsp), %rax
cmpq %rax, %rdi
je 0x58a4
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x2210
movq 0x20(%rsp), %rdi
leaq 0x30(%rsp), %rax
cmpq %rax, %rdi
je 0x58c0
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x2210
movq 0x40(%rsp), %rdi
leaq 0x50(%rsp), %rax
cmpq %rax, %rdi
je 0x58dc
movq 0x50(%rsp), %rsi
incq %rsi
callq 0x2210
movq %rbx, %rdi
callq 0x2390