// File: /workspace/github_cpp_makefile_star2_O3/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 0x113b0
movq (%r14), %rsi
movq %rbx, %rdi
movl $0x8, %edx
callq 0x11200
movq %r14, 0x90(%rsp)
leaq 0x60(%rsp), %rax
movq %rax, -0x10(%rax)
movq $0x0, -0x8(%rax)
movb $0x0, (%rax)
leaq 0xc0(%rsp), %rbx
leaq 0xc(%rsp), %rsi
movq %rbx, %rdi
callq 0x111f0
movq 0xc0(%rsp), %rax
addq -0x18(%rax), %rbx
movq %rbx, %rdi
movl $0xa, %esi
callq 0x11340
movsbl %al, %edx
leaq 0xc0(%rsp), %r14
leaq 0x50(%rsp), %rsi
movq %r14, %rdi
callq 0x115b0
xorps %xmm0, %xmm0
movaps %xmm0, 0x70(%rsp)
xorl %r12d, %r12d
movq %r12, 0x80(%rsp)
movq %r12, 0x20(%rsp)
movaps %xmm0, 0x10(%rsp)
cmpl $0x0, 0xc(%rsp)
leaq 0x40(%rsp), %rbx
jle 0xb1c50
leaq 0x30(%rsp), %r15
leaq 0x2c(%rsp), %r13
leaq 0x50(%rsp), %rbp
movq %rbx, 0x30(%rsp)
movq $0x0, 0x38(%rsp)
movb $0x0, 0x40(%rsp)
movq 0xc0(%rsp), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x11340
movsbl %al, %edx
movq %r14, %rdi
movq %r15, %rsi
callq 0x115b0
leaq 0x70(%rsp), %rdi
movq %r15, %rsi
callq 0x9a724
movq %r14, %rdi
movq %r13, %rsi
callq 0x111f0
movq 0xc0(%rsp), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x11340
movsbl %al, %edx
movq %r14, %rdi
movq %rbp, %rsi
callq 0x115b0
movq 0x18(%rsp), %rsi
cmpq 0x20(%rsp), %rsi
je 0xb1c1e
movl 0x2c(%rsp), %eax
movl %eax, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x18(%rsp)
jmp 0xb1c2b
leaq 0x10(%rsp), %rdi
movq %r13, %rdx
callq 0xada9a
movq 0x30(%rsp), %rdi
cmpq %rbx, %rdi
je 0xb1c42
movq 0x40(%rsp), %rsi
incq %rsi
callq 0x11360
incl %r12d
cmpl 0xc(%rsp), %r12d
jl 0xb1b88
movq 0x90(%rsp), %rax
movq (%rax), %rsi
movq 0x8(%rax), %rdx
addq %rsi, %rdx
leaq 0x30(%rsp), %rdi
movq %rbx, (%rdi)
callq 0x27370
leaq 0x6c782(%rip), %rdi     # 0x11e3f8
leaq 0x30(%rsp), %rsi
callq 0xb3074
movq 0x30(%rsp), %rdi
cmpq %rbx, %rdi
je 0xb1c97
movq 0x40(%rsp), %rsi
incq %rsi
callq 0x11360
leaq 0xc0(%rsp), %rdi
callq 0x11560
cmpl $0x0, 0xc(%rsp)
jle 0xb1d40
movq %rax, %rbx
movq 0x6c747(%rip), %r15     # 0x11e400
subq 0x6c738(%rip), %r15     # 0x11e3f8
shrq $0x5, %r15
decl %r15d
movq 0x10(%rsp), %rax
xorl %r12d, %r12d
leaq 0x98(%rsp), %r14
xorl %r13d, %r13d
movl (%rax,%r13,4), %ebp
movq 0x70(%rsp), %rsi
addq %r12, %rsi
movq %r14, %rdi
movl $0x2, %edx
callq 0xaf1c6
movq %r14, %rdi
movl $0x1, %esi
callq 0xb0a48
cltq
movq 0x6c707(%rip), %rcx     # 0x11e410
shlq $0x4, %rax
movl %r15d, (%rcx,%rax)
movl %ebx, 0x4(%rcx,%rax)
movl %ebp, 0x8(%rcx,%rax)
movb $0x0, 0xc(%rcx,%rax)
movq %r14, %rdi
callq 0xaf2ce
movq 0x10(%rsp), %rax
addl (%rax,%r13,4), %ebx
incq %r13
movslq 0xc(%rsp), %rcx
addq $0x20, %r12
cmpq %rcx, %r13
jl 0xb1cda
leaq 0xc0(%rsp), %rdi
callq 0x110a0
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
leaq 0x60(%rsp), %rbx
je 0xb1d69
movq 0x20(%rsp), %rsi
subq %rdi, %rsi
callq 0x11360
leaq 0x70(%rsp), %rdi
callq 0x367d6
movq 0x50(%rsp), %rdi
cmpq %rbx, %rdi
je 0xb1d8a
movq 0x60(%rsp), %rsi
incq %rsi
callq 0x11360
leaq 0xc0(%rsp), %rdi
callq 0x110d0
addq $0x2c8, %rsp            # imm = 0x2C8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0xb1dc0
jmp 0xb1dc0
jmp 0xb1dd7
jmp 0xb1dc0
movq %rax, %r14
jmp 0xb1e2e
movq %rax, %r14
leaq 0x60(%rsp), %rbx
jmp 0xb1e17
movq %rax, %r14
jmp 0xb1df1
movq %rax, %r14
leaq 0x98(%rsp), %rdi
callq 0xaf2ce
jmp 0xb1df1
movq %rax, %r14
movq 0x30(%rsp), %rdi
cmpq %rbx, %rdi
je 0xb1df1
movq 0x40(%rsp), %rsi
incq %rsi
callq 0x11360
leaq 0x60(%rsp), %rbx
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0xb1e0d
movq 0x20(%rsp), %rsi
subq %rdi, %rsi
callq 0x11360
leaq 0x70(%rsp), %rdi
callq 0x367d6
movq 0x50(%rsp), %rdi
cmpq %rbx, %rdi
je 0xb1e2e
movq 0x60(%rsp), %rsi
incq %rsi
callq 0x11360
leaq 0xc0(%rsp), %rdi
callq 0x110d0
movq %r14, %rdi
callq 0x11580
nop