// File: /workspace/github_cpp_makefile_star2_O3/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 $0x78, %rsp
movl %esi, 0x3c(%rsp)
movq %rdi, %r14
movl $0x0, 0x8(%rsp)
leaq 0xc70d(%rip), %rsi      # 0xbd179
leaq 0x10(%rsp), %rbx
movq %rbx, %rdi
movl $0x2, %edx
callq 0xaf246
leaq 0x50(%rsp), %rbp
movq %rbp, %rdi
movq %r14, %rsi
movq %rbx, %rdx
callq 0x11170
leaq 0x10(%rsp), %rdi
callq 0xaf2ce
leaq 0x70(%rsp), %rbx
movq (%rbx), %r13
testb $0x3, %r13b
movq %r14, 0x40(%rsp)
je 0xb0ad7
movq 0x58(%rsp), %rax
testq %rax, %rax
sete %r12b
testb $0x3, %r13b
je 0xb0afa
testq %rax, %rax
je 0xb0d38
movb $0x1, %al
movl %eax, 0xc(%rsp)
xorl %r12d, %r12d
xorl %r15d, %r15d
jmp 0xb0af6
movq %rbx, %rdi
callq 0x11050
movq %rax, %r15
movq 0x70(%rsp), %r13
xorl %r12d, %r12d
testb $0x3, %r13b
je 0xb0afd
movb $0x1, %al
movl %eax, 0xc(%rsp)
xorl %eax, %eax
jmp 0xb0b2b
xorl %r15d, %r15d
movq %rbx, %rdi
callq 0x11220
movq 0x70(%rsp), %r13
testb $0x3, %r13b
je 0xb0b1a
testb %r12b, %r12b
jne 0xb0b23
jmp 0xb0d38
cmpq %rax, %r15
je 0xb0d38
movl $0x0, 0xc(%rsp)
movq %rax, 0x48(%rsp)
testb $0x3, %r13b
movq %rbp, %rbx
cmoveq %r15, %rbx
leaq 0x6d8e6(%rip), %rdi     # 0x11e428
leaq 0x8(%rsp), %rsi
callq 0xb274c
movq %rax, %r14
testb $0x3, %r13b
movq %rbp, %r13
cmoveq %r15, %r13
movq (%rbx), %rsi
movq 0x8(%r13), %rdx
addq %rsi, %rdx
leaq 0x20(%rsp), %rax
movq %rax, 0x10(%rsp)
leaq 0x10(%rsp), %rbp
movq %rbp, %rdi
callq 0x27370
movq %r14, %rdi
movq %rbp, %rsi
callq 0x9b13a
movq %rax, %r14
leaq 0x6d898(%rip), %rdi     # 0x11e428
leaq 0x8(%rsp), %rsi
callq 0xb274c
movq 0x10(%rsp), %rdi
leaq 0x20(%rsp), %rax
cmpq %rax, %rdi
je 0xb0bb6
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x11360
testq %r14, %r14
jne 0xb0c8d
cmpb $0x0, 0x3c(%rsp)
je 0xb0d57
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
movq %rax, 0x10(%rsp)
movl $0x0, 0x18(%rsp)
movb $0x1, 0x1c(%rsp)
movq 0x6d830(%rip), %rsi     # 0x11e418
cmpq 0x6d831(%rip), %rsi     # 0x11e420
je 0xb0c0d
movups 0x10(%rsp), %xmm0
movups %xmm0, (%rsi)
movq 0x6d818(%rip), %rbp     # 0x11e418
addq $0x10, %rbp
movq %rbp, 0x6d80d(%rip)     # 0x11e418
jmp 0xb0c23
leaq 0x6d7fc(%rip), %rdi     # 0x11e410
movq %rbp, %rdx
callq 0xb2318
movq 0x6d7f5(%rip), %rbp     # 0x11e418
subq 0x6d7e6(%rip), %rbp     # 0x11e410
leaq 0x6d7f7(%rip), %rdi     # 0x11e428
leaq 0x8(%rsp), %rsi
callq 0xb274c
movq %rax, %r14
movq (%rbx), %rsi
movq 0x8(%r13), %rdx
addq %rsi, %rdx
leaq 0x20(%rsp), %rax
movq %rax, 0x10(%rsp)
leaq 0x10(%rsp), %rdi
callq 0x27370
movq %r14, %rdi
leaq 0x10(%rsp), %rsi
callq 0xadd86
shrq $0x4, %rbp
decl %ebp
movl %ebp, (%rax)
movq 0x10(%rsp), %rdi
leaq 0x20(%rsp), %rax
cmpq %rax, %rdi
je 0xb0c8d
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x11360
leaq 0x6d794(%rip), %rdi     # 0x11e428
leaq 0x8(%rsp), %rsi
callq 0xb274c
movq %rax, %r14
movq (%rbx), %rsi
movq 0x8(%r13), %rdx
addq %rsi, %rdx
leaq 0x20(%rsp), %rax
movq %rax, 0x10(%rsp)
leaq 0x10(%rsp), %rbx
movq %rbx, %rdi
callq 0x27370
movq %r14, %rdi
movq %rbx, %rsi
callq 0xadd86
leaq 0x50(%rsp), %rbp
movl (%rax), %eax
movl %eax, 0x8(%rsp)
movq 0x10(%rsp), %rdi
leaq 0x20(%rsp), %rax
cmpq %rax, %rdi
je 0xb0cf4
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x11360
movq 0x70(%rsp), %r13
leaq 0x30(%r15), %rax
testb $0x3, %r13b
movzbl %r12b, %r12d
movl $0x1, %ecx
cmovnel %ecx, %r12d
cmoveq %rax, %r15
xorl %edx, %edx
movq 0x48(%rsp), %rax
cmpq %rax, %r15
setne %dl
xorl %ecx, %ecx
cmpb 0xc(%rsp), %r12b
setne %cl
testb $0x3, %r13b
cmovel %edx, %ecx
testb %cl, %cl
jne 0xb0b30
leaq 0x50(%rsp), %rdi
callq 0xaf2ce
movl 0x8(%rsp), %ebx
movl %ebx, %eax
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x6c292(%rip), %rdi     # 0x11cff0
leaq 0x1f468(%rip), %rsi     # 0xd01cd
movl $0x15, %edx
callq 0x113c0
movq 0x6c27a(%rip), %rdi     # 0x11cff0
movq 0x40(%rsp), %rsi
callq 0xb203f
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x11340
movsbl %al, %esi
movq %rbx, %rdi
callq 0x11040
movq %rax, %rdi
callq 0x11260
movl 0x8(%rsp), %ebx
leaq 0x50(%rsp), %rdi
callq 0xaf2ce
jmp 0xb0d46
jmp 0xb0df7
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
jmp 0xb0dff
jmp 0xb0df7
jmp 0xb0df7
jmp 0xb0dd2
jmp 0xb0df7
jmp 0xb0dd2
jmp 0xb0dd2
movq %rax, %rbx
movq 0x10(%rsp), %rdi
leaq 0x20(%rsp), %rax
cmpq %rax, %rdi
je 0xb0dfa
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x11360
jmp 0xb0dfa
jmp 0xb0df7
jmp 0xb0df7
movq %rax, %rbx
leaq 0x50(%rsp), %rdi
callq 0xaf2ce
movq %rbx, %rdi
callq 0x11580