// File: /workspace/github_cpp_makefile_star2_O1/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 0xb0b2(%rip), %r14      # 0xf3b8
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 0x44a7
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 0x43da
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 0x4505
movq %rax, %r14
movslq %r14d, %rax
cmpq %r14, %rax
jne 0x4511
movl (%rbp), %eax
cmpl $0x22, %eax
je 0x4511
testl %eax, %eax
jne 0x4463
movl %r12d, (%rbp)
movq 0x28(%rsp), %rdi
movq %r15, %r13
cmpq %r15, %rdi
je 0x447d
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x2210
movq %rbx, %rbp
movq 0x90(%rbx), %rdi
addq $0x38, %rdi
leaq 0x48(%rsp), %rsi
callq 0x661a
leaq 0x70(%rsp), %rbx
leaq 0x28(%rsp), %r15
movl %r14d, (%rax)
jmp 0x434f
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 0x44dc
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x2210
movq 0x8(%rsp), %rdi
cmpq %rbx, %rdi
je 0x44f3
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 0xaf56(%rip), %rdi      # 0xf462
callq 0x2160
leaq 0xaf4a(%rip), %rdi      # 0xf462
callq 0x22d0
jmp 0x4553
movq %rax, %rbx
jmp 0x4560
movq %rax, %rbx
jmp 0x4581
jmp 0x4553
jmp 0x4553
movq %rax, %rbx
cmpl $0x0, (%rbp)
jne 0x453a
movl %r12d, (%rbp)
movq 0x28(%rsp), %rdi
cmpq %r15, %rdi
je 0x4556
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x2210
jmp 0x4556
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 0x4581
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x2210
movq 0x8(%rsp), %rdi
cmpq %r15, %rdi
je 0x4598
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x2210
movq %rbx, %rdi
callq 0x2390