// File: /workspace/github_cpp_makefile_star2_O1/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 $0x88, %rsp
movl %esi, 0x3c(%rsp)
movq %rdi, %r14
movl $0x0, 0x4(%rsp)
leaq 0xc866(%rip), %rsi      # 0xbe1a9
leaq 0x8(%rsp), %rbx
movq %rbx, %rdi
movl $0x2, %edx
callq 0xb0100
leaq 0x60(%rsp), %rdi
movq %r14, 0x48(%rsp)
movq %r14, %rsi
movq %rbx, %rdx
callq 0x11170
leaq 0x8(%rsp), %rdi
callq 0xb0188
leaq 0x80(%rsp), %rbx
testb $0x3, (%rbx)
je 0xb1990
cmpq $0x0, 0x68(%rsp)
sete %bpl
xorl %r13d, %r13d
jmp 0xb199d
movq %rbx, %rdi
callq 0x11050
movq %rax, %r13
xorl %ebp, %ebp
testb $0x3, 0x80(%rsp)
je 0xb19ad
movb $0x1, %dl
xorl %eax, %eax
jmp 0xb19b7
movq %rbx, %rdi
callq 0x11220
xorl %edx, %edx
xorl %ecx, %ecx
cmpq %rax, %r13
setne %cl
xorl %esi, %esi
movl %edx, 0x40(%rsp)
cmpb %dl, %bpl
setne %sil
testb $0x3, 0x80(%rsp)
cmovel %ecx, %esi
cmpb $0x1, %sil
movl %esi, 0x34(%rsp)
jne 0xb1c76
movq %rax, 0x50(%rsp)
leaq 0x8(%rsp), %r14
movl %ebp, 0x44(%rsp)
movq 0x80(%rsp), %rbx
testb $0x3, %bl
leaq 0x60(%rsp), %rbp
movq %rbp, %r12
cmoveq %r13, %r12
leaq 0x6da17(%rip), %rdi     # 0x11f428
leaq 0x4(%rsp), %rsi
callq 0xb3698
movq %rax, %r15
testb $0x3, %bl
movq %rbp, %rbx
cmoveq %r13, %rbx
movq (%r12), %rsi
movq 0x8(%rbx), %rdx
addq %rsi, %rdx
leaq 0x18(%rsp), %rax
movq %rax, 0x8(%rsp)
movq %r14, %rbp
movq %r14, %rdi
callq 0x27dc8
movq %r13, 0x58(%rsp)
movq %r15, %rdi
movq %rbp, %rsi
callq 0x9bd66
movl 0x44(%rsp), %ebp
movq %rax, %r15
leaq 0x6d9c2(%rip), %rdi     # 0x11f428
leaq 0x4(%rsp), %rsi
callq 0xb3698
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0xb1a8c
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x11360
testq %r15, %r15
je 0xb1b4c
leaq 0x6d98c(%rip), %rdi     # 0x11f428
leaq 0x4(%rsp), %rsi
callq 0xb3698
movq %rax, %r15
movq (%r12), %rsi
movq 0x8(%rbx), %rdx
addq %rsi, %rdx
leaq 0x18(%rsp), %rax
movq %rax, 0x8(%rsp)
movq %r14, %rdi
callq 0x27dc8
movq %r15, %rdi
movq %r14, %rsi
callq 0xaec02
movl (%rax), %eax
movl %eax, 0x4(%rsp)
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0xb1af3
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x11360
movb $0x1, %al
testb %al, %al
je 0xb1c76
movb 0x80(%rsp), %al
movq 0x58(%rsp), %rdx
leaq 0x30(%rdx), %rcx
testb $0x3, %al
movzbl %bpl, %ebp
movl $0x1, %esi
cmovnel %esi, %ebp
cmoveq %rcx, %rdx
xorl %ecx, %ecx
movq %rdx, %r13
cmpq 0x50(%rsp), %rdx
setne %cl
xorl %edx, %edx
cmpb 0x40(%rsp), %bpl
setne %dl
testb $0x3, %al
cmovel %ecx, %edx
movl %edx, 0x34(%rsp)
testb %dl, %dl
jne 0xb19ef
jmp 0xb1c76
cmpb $0x0, 0x3c(%rsp)
je 0xb1b8c
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
movq %rax, 0x8(%rsp)
movl $0x0, 0x10(%rsp)
movb $0x1, 0x14(%rsp)
movq 0x6d8a7(%rip), %rsi     # 0x11f418
cmpq 0x6d8a8(%rip), %rsi     # 0x11f420
je 0xb1bee
movups 0x8(%rsp), %xmm0
movups %xmm0, (%rsi)
addq $0x10, 0x6d88e(%rip)    # 0x11f418
jmp 0xb1bfd
movl $0x15, %edx
movq 0x6c458(%rip), %rdi     # 0x11dff0
leaq 0x1f65e(%rip), %rsi     # 0xd11fd
callq 0x113c0
movq 0x6c445(%rip), %rdi     # 0x11dff0
movq 0x48(%rsp), %rsi
callq 0xb2f69
movq %rax, %r15
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r15, %rdi
movl $0xa, %esi
callq 0x11340
movsbl %al, %esi
movq %r15, %rdi
callq 0x11040
movq %rax, %rdi
callq 0x11260
movl 0x4(%rsp), %eax
movl %eax, 0x38(%rsp)
xorl %eax, %eax
jmp 0xb1af5
leaq 0x6d81b(%rip), %rdi     # 0x11f410
movq %r14, %rdx
callq 0xb322e
movq 0x6d814(%rip), %r15     # 0x11f418
subq 0x6d805(%rip), %r15     # 0x11f410
leaq 0x6d816(%rip), %rdi     # 0x11f428
leaq 0x4(%rsp), %rsi
callq 0xb3698
movq %rax, %r13
movq (%r12), %rsi
movq 0x8(%rbx), %rdx
addq %rsi, %rdx
leaq 0x18(%rsp), %rax
movq %rax, 0x8(%rsp)
movq %r14, %rdi
callq 0x27dc8
movq %r13, %rdi
movq %r14, %rsi
callq 0xaec02
shrq $0x4, %r15
decl %r15d
movl %r15d, (%rax)
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0xb1a95
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x11360
jmp 0xb1a95
leaq 0x60(%rsp), %rdi
callq 0xb0188
testb $0x1, 0x34(%rsp)
movl 0x38(%rsp), %eax
jne 0xb1c8f
movl 0x4(%rsp), %eax
addq $0x88, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0xb1cdc
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
jmp 0xb1ce4
jmp 0xb1cb9
jmp 0xb1cdc
jmp 0xb1cb9
jmp 0xb1cdc
jmp 0xb1cb9
jmp 0xb1cdc
movq %rax, %rbx
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0xb1cdf
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x11360
jmp 0xb1cdf
jmp 0xb1cdc
movq %rax, %rbx
leaq 0x60(%rsp), %rdi
callq 0xb0188
movq %rbx, %rdi
callq 0x11580
nop