// File: /workspace/github_cpp_makefile_star2_O2/Heptagon196[P]Gos/GosFileSystem.cpp
// Function: Gos::FileSystem::GetFile(std::filesystem::__cxx11::path, bool)
int Gos::FileSystem::GetFile(Path path, bool init) {
    int cur = 0;
    for (auto& s : path.lexically_relative(".")) {
        if (instance.structure[cur].find(s.string()) == instance.structure[cur].end()) {
            if (!init) {
                std::cerr << "Error: no such file: " << path << std::endl;
                return cur;
            } else {
                instance.files.push_back({ -1, 0, 0, true });
                instance.structure[cur][s.string()] = instance.files.size() - 1;
            }
        }
        cur = instance.structure[cur][s.string()];
    }
    return cur;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x98, %rsp
movl %esi, 0xc(%rsp)
movq %rdi, %r14
andl $0x0, 0x8(%rsp)
leaq 0xa3f7(%rip), %rsi      # 0x97201
leaq 0x30(%rsp), %rbx
pushq $0x2
popq %rdx
movq %rbx, %rdi
callq 0x8b5a4
leaq 0x58(%rsp), %rdi
movq %r14, %rsi
movq %rbx, %rdx
callq 0x11170
leaq 0x30(%rsp), %rdi
callq 0x8b62c
leaq 0x10(%rsp), %rdi
leaq 0x58(%rsp), %rsi
callq 0x8ddf8
movq %r14, 0x28(%rsp)
leaq 0x80(%rsp), %rdi
leaq 0x58(%rsp), %rsi
callq 0x8de34
leaq 0x7a5b7(%rip), %r12     # 0x107418
leaq 0x8(%rsp), %r13
leaq 0x30(%rsp), %rbx
leaq 0x10(%rsp), %rdi
leaq 0x80(%rsp), %rsi
callq 0x8de6a
movl %eax, %r14d
testb %al, %al
je 0x8cfc7
movq 0x10(%rsp), %rbp
testb $0x3, 0x20(%rbp)
jne 0x8ce98
movq 0x18(%rsp), %rbp
movq %r12, %rdi
movq %r13, %rsi
callq 0x8e7c8
movq %rax, %r15
movq %rbx, %rdi
movq %rbp, %rsi
callq 0x8b610
movq %r15, %rdi
movq %rbx, %rsi
callq 0x7a3e8
movq %rax, %r15
movq %r12, %rdi
movq %r13, %rsi
callq 0x8e7c8
movq %rbx, %rdi
callq 0x209be
testq %r15, %r15
jne 0x8cf49
cmpb $0x0, 0xc(%rsp)
je 0x8cf9b
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
movq %rax, 0x30(%rsp)
andl $0x0, 0x38(%rsp)
movb $0x1, 0x3c(%rsp)
leaq 0x7a503(%rip), %rdi     # 0x107400
movq %rbx, %rsi
callq 0x8e2d6
movq 0x7a4fc(%rip), %r15     # 0x107408
subq 0x7a4ed(%rip), %r15     # 0x107400
movq %r12, %rdi
movq %r13, %rsi
callq 0x8e7c8
movq %rax, %r14
movq %rbx, %rdi
movq %rbp, %rsi
callq 0x8b610
movq %r14, %rdi
movq %rbx, %rsi
callq 0x8a576
shrq $0x4, %r15
decl %r15d
movl %r15d, (%rax)
movq %rbx, %rdi
callq 0x209be
movq %r12, %rdi
movq %r13, %rsi
callq 0x8e7c8
movq %rax, %r14
movq %rbx, %rdi
movq %rbp, %rsi
callq 0x8b610
movq %r14, %rdi
movq %rbx, %rsi
callq 0x8a576
movl (%rax), %eax
movl %eax, 0x8(%rsp)
movq %rbx, %rdi
callq 0x209be
movq 0x10(%rsp), %rax
testb $0x3, 0x20(%rax)
je 0x8cf90
movb $0x1, 0x20(%rsp)
jmp 0x8ce6b
addq $0x30, 0x18(%rsp)
jmp 0x8ce6b
movq 0x7904e(%rip), %rdi     # 0x105ff0
leaq 0x1dc68(%rip), %rsi     # 0xaac11
callq 0x11340
movq %rax, %rdi
movq 0x28(%rsp), %rsi
callq 0x8de9e
movq %rax, %rdi
callq 0x111b0
movl 0x8(%rsp), %ebp
leaq 0x58(%rsp), %rdi
callq 0x8b62c
testb %r14b, %r14b
jne 0x8cfda
movl 0x8(%rsp), %ebp
movl %ebp, %eax
addq $0x98, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x8d01f
jmp 0x8d01f
jmp 0x8d01f
movq %rax, %rbx
leaq 0x30(%rsp), %rdi
jmp 0x8d027
jmp 0x8d01f
jmp 0x8d01f
jmp 0x8d00a
jmp 0x8d00a
jmp 0x8d01f
jmp 0x8d00a
movq %rax, %rbx
leaq 0x30(%rsp), %rdi
callq 0x209be
jmp 0x8d022
jmp 0x8d01f
jmp 0x8d01f
jmp 0x8d01f
movq %rax, %rbx
leaq 0x58(%rsp), %rdi
callq 0x8b62c
movq %rbx, %rdi
callq 0x11570