// File: /workspace/github_cpp_makefile_star2_O2/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:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x2c8, %rsp            # imm = 0x2C8
movq %rdi, %r14
leaq 0xc0(%rsp), %rbx
movq %rbx, %rdi
callq 0x113a0
pushq $0x8
popq %rdx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x8dfd2
movq %r14, 0x30(%rsp)
leaq 0x88(%rsp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
movb $0x0, (%rax)
leaq 0xc0(%rsp), %rdi
leaq 0xc(%rsp), %rsi
callq 0x111f0
leaq 0xc0(%rsp), %rdi
leaq 0x78(%rsp), %rsi
callq 0x11080
xorps %xmm0, %xmm0
leaq 0x60(%rsp), %rax
andq $0x0, 0x10(%rax)
leaq 0x40(%rsp), %r15
andq $0x0, 0x10(%r15)
movaps %xmm0, (%rax)
movaps %xmm0, (%r15)
xorl %r14d, %r14d
leaq 0xc0(%rsp), %r12
leaq 0x10(%rsp), %r13
leaq 0x3c(%rsp), %rbp
leaq 0x78(%rsp), %rbx
cmpl 0xc(%rsp), %r14d
jge 0x8daa5
leaq 0x20(%rsp), %rax
movq %rax, 0x10(%rsp)
andq $0x0, 0x18(%rsp)
movb $0x0, 0x20(%rsp)
movq %r12, %rdi
movq %r13, %rsi
callq 0x11080
leaq 0x60(%rsp), %rdi
movq %r13, %rsi
callq 0x79a38
movq %r12, %rdi
movq %rbp, %rsi
callq 0x111f0
movq %r12, %rdi
movq %rbx, %rsi
callq 0x11080
movq %r15, %rdi
movq %rbp, %rsi
callq 0x88a7e
movq %r13, %rdi
callq 0x209be
incl %r14d
jmp 0x8da43
leaq 0x10(%rsp), %rdi
movq 0x30(%rsp), %rsi
callq 0x8b610
leaq 0x7992d(%rip), %rdi     # 0x1073e8
leaq 0x10(%rsp), %rsi
callq 0x8f126
leaq 0x10(%rsp), %rdi
callq 0x209be
leaq 0xc0(%rsp), %rdi
callq 0x11550
movq %rax, %rbx
movq 0x7990a(%rip), %r12     # 0x1073f0
subq 0x798fb(%rip), %r12     # 0x1073e8
shrq $0x5, %r12
decl %r12d
xorl %r13d, %r13d
leaq 0x98(%rsp), %r14
xorl %ebp, %ebp
movslq 0xc(%rsp), %rax
cmpq %rax, %rbp
jge 0x8db6a
movq 0x40(%rsp), %rax
movl (%rax,%rbp,4), %r15d
movq 0x60(%rsp), %rsi
addq %r13, %rsi
movq %r14, %rdi
pushq $0x2
popq %rdx
callq 0x8b53c
movq %r14, %rdi
pushq $0x1
popq %rsi
callq 0x8cde6
cltq
movq 0x798c5(%rip), %rcx     # 0x107400
shlq $0x4, %rax
movl %r12d, (%rcx,%rax)
movl %ebx, 0x4(%rcx,%rax)
movl %r15d, 0x8(%rcx,%rax)
movb $0x0, 0xc(%rcx,%rax)
movq %r14, %rdi
callq 0x8b62c
movq 0x40(%rsp), %rax
addl (%rax,%rbp,4), %ebx
incq %rbp
addq $0x20, %r13
jmp 0x8db01
leaq 0xc0(%rsp), %rdi
callq 0x110a0
leaq 0x40(%rsp), %rdi
callq 0x89956
leaq 0x60(%rsp), %rdi
callq 0x2b668
leaq 0x78(%rsp), %rdi
callq 0x209be
leaq 0xc0(%rsp), %rdi
callq 0x110e0
addq $0x2c8, %rsp            # imm = 0x2C8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x8dbd8
jmp 0x8dbd8
jmp 0x8dbdd
jmp 0x8dbd8
movq %rax, %rbx
jmp 0x8dc08
movq %rax, %rbx
jmp 0x8dbfe
movq %rax, %rbx
leaq 0x98(%rsp), %rdi
callq 0x8b62c
jmp 0x8dbea
movq %rax, %rbx
jmp 0x8dbea
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x209be
leaq 0x40(%rsp), %rdi
callq 0x89956
leaq 0x60(%rsp), %rdi
callq 0x2b668
leaq 0x78(%rsp), %rdi
callq 0x209be
leaq 0xc0(%rsp), %rdi
callq 0x110e0
movq %rbx, %rdi
callq 0x11570
nop