// File: Heptagon196[P]Gos/GosFileSystem.cpp
// Function: Gos::FileSystem::AddPack(std::filesystem::__cxx11::path)
void Gos::FileSystem::AddPack(Path packPos) {
    std::ifstream fin;
    fin.open(packPos);
    int cnt;
    std::string tmp;
    fin >> cnt;
    getline(fin, tmp);
    std::vector<std::string> path;
    std::vector<int> size;
    for (int i = 0; i < cnt; i++) {
        std::string line;
        int s;
        getline(fin, line);
        path.push_back(line);
        fin >> s;
        getline(fin, tmp);
        size.push_back(s);
    }
    instance.dataPacks.push_back(packPos.string());
#if defined(_MSC_VER)
    int start = (int)fin.tellg() - cnt * 2 - 1;
#else
    int start = (int)fin.tellg();
#endif
    int packID = instance.dataPacks.size() - 1;
    for (int i = 0; i < cnt; i++) {
        instance.files[GetFile(path[i], true)] = { packID, start, size[i], false };
        start += size[i];
    }
    fin.close();
}

// Assembly:
subq $0x358, %rsp            # imm = 0x358
movq %rdi, 0x38(%rsp)
movq %rdi, 0x350(%rsp)
leaq 0x148(%rsp), %rdi
movq %rdi, 0x30(%rsp)
callq 0x131f0
movq 0x30(%rsp), %rdi
movq 0x38(%rsp), %rsi
movl $0x8, %edx
callq 0x1efac0
jmp 0x1ee70c
leaq 0x118(%rsp), %rdi
callq 0x7ace0
leaq 0x148(%rsp), %rdi
leaq 0x138(%rsp), %rsi
callq 0x13680
jmp 0x1ee730
leaq 0x148(%rsp), %rdi
leaq 0x118(%rsp), %rsi
callq 0x13330
jmp 0x1ee747
leaq 0x100(%rsp), %rdi
callq 0x1b4f70
leaq 0xe8(%rsp), %rdi
callq 0x1dd1b0
movl $0x0, 0xe4(%rsp)
movl 0xe4(%rsp), %eax
cmpl 0x138(%rsp), %eax
jge 0x1ee87d
leaq 0xc0(%rsp), %rdi
movq %rdi, 0x28(%rsp)
callq 0x7ace0
movq 0x28(%rsp), %rsi
leaq 0x148(%rsp), %rdi
callq 0x13330
jmp 0x1ee7a6
leaq 0x100(%rsp), %rdi
leaq 0xc0(%rsp), %rsi
callq 0x1b4f80
jmp 0x1ee7bd
leaq 0x148(%rsp), %rdi
leaq 0xbc(%rsp), %rsi
callq 0x13680
jmp 0x1ee7d4
leaq 0x148(%rsp), %rdi
leaq 0x118(%rsp), %rsi
callq 0x13330
jmp 0x1ee7eb
leaq 0xe8(%rsp), %rdi
leaq 0xbc(%rsp), %rsi
callq 0x1dd620
jmp 0x1ee802
leaq 0xc0(%rsp), %rdi
callq 0x52f50
movl 0xe4(%rsp), %eax
addl $0x1, %eax
movl %eax, 0xe4(%rsp)
jmp 0x1ee76c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x140(%rsp)
movl %eax, 0x13c(%rsp)
jmp 0x1eead1
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x140(%rsp)
movl %eax, 0x13c(%rsp)
jmp 0x1eeac4
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x140(%rsp)
movl %eax, 0x13c(%rsp)
leaq 0xc0(%rsp), %rdi
callq 0x52f50
jmp 0x1eeaaa
movq 0x38(%rsp), %rsi
leaq 0x98(%rsp), %rdi
callq 0x1e70b0
jmp 0x1ee891
leaq 0x113bd0(%rip), %rdi    # 0x302468
leaq 0x98(%rsp), %rsi
callq 0x1efb60
jmp 0x1ee8a7
leaq 0x98(%rsp), %rdi
callq 0x52f50
leaq 0x148(%rsp), %rdi
callq 0x130f0
movq %rdx, 0x18(%rsp)
movq %rax, 0x20(%rsp)
jmp 0x1ee8cd
movq 0x18(%rsp), %rax
movq 0x20(%rsp), %rcx
movq %rcx, 0x80(%rsp)
movq %rax, 0x88(%rsp)
leaq 0x80(%rsp), %rdi
callq 0x1efb90
movq %rax, 0x10(%rsp)
jmp 0x1ee8fb
movq 0x10(%rsp), %rax
movl %eax, 0x94(%rsp)
leaq 0x113b5a(%rip), %rdi    # 0x302468
callq 0x6f4b0
subq $0x1, %rax
movl %eax, 0x7c(%rsp)
movl $0x0, 0x78(%rsp)
movl 0x78(%rsp), %eax
cmpl 0x138(%rsp), %eax
jge 0x1eea5f
movl 0x7c(%rsp), %eax
movl %eax, 0x68(%rsp)
movl 0x94(%rsp), %eax
movl %eax, 0x6c(%rsp)
movslq 0x78(%rsp), %rsi
leaq 0xe8(%rsp), %rdi
callq 0x1b5c70
movl (%rax), %eax
movl %eax, 0x70(%rsp)
movb $0x0, 0x74(%rsp)
movslq 0x78(%rsp), %rsi
leaq 0x100(%rsp), %rdi
callq 0x1dd580
movq %rax, %rsi
leaq 0x40(%rsp), %rdi
movl $0x2, %edx
callq 0x1e6eb0
jmp 0x1ee98a
leaq 0x40(%rsp), %rdi
movl $0x1, %esi
callq 0x1ed070
movl %eax, 0xc(%rsp)
jmp 0x1ee99f
movl 0xc(%rsp), %eax
movslq %eax, %rsi
leaq 0x113abb(%rip), %rdi    # 0x302468
addq $0x18, %rdi
callq 0x1ef700
movq 0x68(%rsp), %rcx
movq %rcx, (%rax)
movq 0x70(%rsp), %rcx
movq %rcx, 0x8(%rax)
leaq 0x40(%rsp), %rdi
callq 0x1e7130
movslq 0x78(%rsp), %rsi
leaq 0xe8(%rsp), %rdi
callq 0x1b5c70
movl (%rax), %eax
addl 0x94(%rsp), %eax
movl %eax, 0x94(%rsp)
movl 0x78(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x78(%rsp)
jmp 0x1ee923
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x140(%rsp)
movl %eax, 0x13c(%rsp)
jmp 0x1eeaaa
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x140(%rsp)
movl %eax, 0x13c(%rsp)
leaq 0x98(%rsp), %rdi
callq 0x52f50
jmp 0x1eeaaa
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x140(%rsp)
movl %eax, 0x13c(%rsp)
leaq 0x40(%rsp), %rdi
callq 0x1e7130
jmp 0x1eeaaa
leaq 0x148(%rsp), %rdi
callq 0x133d0
jmp 0x1eea6e
leaq 0xe8(%rsp), %rdi
callq 0x1dd280
leaq 0x100(%rsp), %rdi
callq 0x6ed80
leaq 0x118(%rsp), %rdi
callq 0x52f50
leaq 0x148(%rsp), %rdi
callq 0x13040
addq $0x358, %rsp            # imm = 0x358
retq
leaq 0xe8(%rsp), %rdi
callq 0x1dd280
leaq 0x100(%rsp), %rdi
callq 0x6ed80
leaq 0x118(%rsp), %rdi
callq 0x52f50
leaq 0x148(%rsp), %rdi
callq 0x13040
movq 0x140(%rsp), %rdi
callq 0x133f0
nopl (%rax,%rax)