// File: /workspace/github_cpp_makefile_star2_O1/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 0xb2b7a
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 0x9b36e
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 0xb2b48
movl 0x2c(%rsp), %eax
movl %eax, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x18(%rsp)
jmp 0xb2b55
leaq 0x10(%rsp), %rdi
movq %r13, %rdx
callq 0xae90c
movq 0x30(%rsp), %rdi
cmpq %rbx, %rdi
je 0xb2b6c
movq 0x40(%rsp), %rsi
incq %rsi
callq 0x11360
incl %r12d
cmpl 0xc(%rsp), %r12d
jl 0xb2ab2
movq 0x90(%rsp), %rax
movq (%rax), %rsi
movq 0x8(%rax), %rdx
addq %rsi, %rdx
leaq 0x30(%rsp), %rdi
movq %rbx, (%rdi)
callq 0x27dc8
leaq 0x6c858(%rip), %rdi     # 0x11f3f8
leaq 0x30(%rsp), %rsi
callq 0xb3fa8
movq 0x30(%rsp), %rdi
cmpq %rbx, %rdi
je 0xb2bc1
movq 0x40(%rsp), %rsi
incq %rsi
callq 0x11360
leaq 0xc0(%rsp), %rdi
callq 0x11560
cmpl $0x0, 0xc(%rsp)
jle 0xb2c6a
movq %rax, %rbx
movq 0x6c81d(%rip), %r15     # 0x11f400
subq 0x6c80e(%rip), %r15     # 0x11f3f8
shrq $0x5, %r15
decl %r15d
xorl %r12d, %r12d
leaq 0x98(%rsp), %r14
xorl %r13d, %r13d
movq 0x10(%rsp), %rax
movl (%rax,%r13,4), %ebp
movq 0x70(%rsp), %rsi
addq %r12, %rsi
movq %r14, %rdi
movl $0x2, %edx
callq 0xb0080
movq %r14, %rdi
movl $0x1, %esi
callq 0xb191c
cltq
movq 0x6c7dd(%rip), %rcx     # 0x11f410
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 0xb0188
movq 0x10(%rsp), %rax
addl (%rax,%r13,4), %ebx
incq %r13
movslq 0xc(%rsp), %rax
addq $0x20, %r12
cmpq %rax, %r13
jl 0xb2bff
leaq 0xc0(%rsp), %rdi
callq 0x110a0
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
leaq 0x60(%rsp), %rbx
je 0xb2c93
movq 0x20(%rsp), %rsi
subq %rdi, %rsi
callq 0x11360
leaq 0x70(%rsp), %rdi
callq 0x3740c
movq 0x50(%rsp), %rdi
cmpq %rbx, %rdi
je 0xb2cb4
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 0xb2cea
jmp 0xb2cea
jmp 0xb2d01
jmp 0xb2cea
movq %rax, %r14
jmp 0xb2d58
movq %rax, %r14
leaq 0x60(%rsp), %rbx
jmp 0xb2d41
movq %rax, %r14
jmp 0xb2d1b
movq %rax, %r14
leaq 0x98(%rsp), %rdi
callq 0xb0188
jmp 0xb2d1b
movq %rax, %r14
movq 0x30(%rsp), %rdi
cmpq %rbx, %rdi
je 0xb2d1b
movq 0x40(%rsp), %rsi
incq %rsi
callq 0x11360
leaq 0x60(%rsp), %rbx
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0xb2d37
movq 0x20(%rsp), %rsi
subq %rdi, %rsi
callq 0x11360
leaq 0x70(%rsp), %rdi
callq 0x3740c
movq 0x50(%rsp), %rdi
cmpq %rbx, %rdi
je 0xb2d58
movq 0x60(%rsp), %rsi
incq %rsi
callq 0x11360
leaq 0xc0(%rsp), %rdi
callq 0x110d0
movq %r14, %rdi
callq 0x11580
nop