// File: /workspace/github_cpp_makefile_star2_O3/sagardoshi[P]NegotiationsEncounter/src/GameMaster.cpp
// Function: GameMaster::loadPlayerSavedInventory()
void GameMaster::loadPlayerSavedInventory() {
    string line = "";
    string invItem = "";
    int invItemAmount = 0;
    int dividerPos = 0;
    int fromDividerToEnd = 0;

    ifstream in(INV_FILEPATH);
    while(getline(in, line)) {
        dividerPos = line.find(DIVIDER);
        fromDividerToEnd = line.length() - dividerPos;

        invItem = line.substr(0, dividerPos);
        invItemAmount = stoi(line.substr(dividerPos + 1, fromDividerToEnd));

        player->inventory[invItem] = invItemAmount;
    }
    in.close();
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x278, %rsp            # imm = 0x278
movq %rdi, %rbp
leaq 0x18(%rsp), %r15
movq %r15, -0x10(%r15)
leaq 0xb0c0(%rip), %r14      # 0xf3fc
leaq 0x8(%rsp), %rdi
movq %r14, %rsi
movq %r14, %rdx
callq 0x290e
leaq 0x58(%rsp), %rax
movq %rax, -0x10(%rax)
leaq 0x48(%rsp), %rdi
movq %r14, %rsi
movq %r14, %rdx
callq 0x290e
leaq 0x28(%rbp), %rsi
leaq 0x70(%rsp), %rbx
movq %rbx, %rdi
movl $0x8, %edx
callq 0x2340
leaq 0x38(%rsp), %r13
leaq 0x28(%rsp), %r15
movq 0x70(%rsp), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x21f0
movsbl %al, %edx
movq %rbx, %rdi
leaq 0x8(%rsp), %rsi
callq 0x23b0
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
testb $0x5, 0x20(%rax,%rcx)
jne 0x44dd
movq 0x48(%rbp), %rsi
movq 0x50(%rbp), %rcx
leaq 0x8(%rsp), %rbx
movq %rbx, %rdi
xorl %edx, %edx
callq 0x2380
movq %rax, %r14
movq 0x10(%rsp), %r12
movslq %r14d, %rcx
movq %r15, %rdi
movq %rbx, %rsi
xorl %edx, %edx
callq 0x2230
leaq 0x48(%rsp), %rdi
movq %r15, %rsi
callq 0x2280
movq 0x28(%rsp), %rdi
cmpq %r13, %rdi
je 0x4410
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x2210
movq %rbp, %rbx
movq %r13, %r15
subq %r14, %r12
shlq $0x20, %r14
movabsq $0x100000000, %rax      # imm = 0x100000000
addq %rax, %r14
sarq $0x20, %r14
movslq %r12d, %rcx
leaq 0x28(%rsp), %rdi
leaq 0x8(%rsp), %rsi
movq %r14, %rdx
callq 0x2230
movq 0x28(%rsp), %r13
callq 0x2050
movq %rax, %rbp
movl (%rax), %r12d
movl $0x0, (%rax)
movq %r13, %rdi
leaq 0x68(%rsp), %rsi
movl $0xa, %edx
callq 0x22b0
cmpq %r13, 0x68(%rsp)
je 0x453b
movq %rax, %r14
movslq %r14d, %rax
cmpq %r14, %rax
jne 0x4547
movl (%rbp), %eax
cmpl $0x22, %eax
je 0x4547
testl %eax, %eax
jne 0x4499
movl %r12d, (%rbp)
movq 0x28(%rsp), %rdi
movq %r15, %r13
cmpq %r15, %rdi
je 0x44b3
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x2210
movq %rbx, %rbp
movq 0x90(%rbx), %rdi
addq $0x38, %rdi
leaq 0x48(%rsp), %rsi
callq 0x67d6
leaq 0x70(%rsp), %rbx
leaq 0x28(%rsp), %r15
movl %r14d, (%rax)
jmp 0x4385
leaq 0x70(%rsp), %rdi
callq 0x2090
leaq 0x70(%rsp), %rdi
callq 0x20a0
movq 0x48(%rsp), %rdi
leaq 0x58(%rsp), %rax
cmpq %rax, %rdi
leaq 0x18(%rsp), %rbx
je 0x4512
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x2210
movq 0x8(%rsp), %rdi
cmpq %rbx, %rdi
je 0x4529
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x2210
addq $0x278, %rsp            # imm = 0x278
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0xaf64(%rip), %rdi      # 0xf4a6
callq 0x2160
leaq 0xaf58(%rip), %rdi      # 0xf4a6
callq 0x22d0
jmp 0x4589
movq %rax, %rbx
jmp 0x4596
movq %rax, %rbx
jmp 0x45b7
jmp 0x4589
jmp 0x4589
movq %rax, %rbx
cmpl $0x0, (%rbp)
jne 0x4570
movl %r12d, (%rbp)
movq 0x28(%rsp), %rdi
cmpq %r15, %rdi
je 0x458c
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x2210
jmp 0x458c
movq %rax, %rbx
leaq 0x70(%rsp), %rdi
callq 0x20a0
leaq 0x18(%rsp), %r15
leaq 0x58(%rsp), %rax
movq 0x48(%rsp), %rdi
cmpq %rax, %rdi
je 0x45b7
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x2210
movq 0x8(%rsp), %rdi
cmpq %r15, %rdi
je 0x45ce
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x2210
movq %rbx, %rdi
callq 0x2390