// File: 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:
subq $0x1b8, %rsp            # imm = 0x1B8
movq %rdi, 0x68(%rsp)
movb %sil, %al
movq %rdi, 0x1a8(%rsp)
andb $0x1, %al
movb %al, 0x1a7(%rsp)
movl $0x0, 0x1a0(%rsp)
leaq 0x1fabf(%rip), %rsi     # 0x20cb61
leaq 0x148(%rsp), %rdi
movq %rdi, 0x70(%rsp)
movl $0x2, %edx
callq 0x1e6fb0
movq 0x68(%rsp), %rsi
movq 0x70(%rsp), %rdx
leaq 0x170(%rsp), %rdi
callq 0x13180
jmp 0x1ed0d2
leaq 0x148(%rsp), %rdi
callq 0x1e7130
leaq 0x170(%rsp), %rax
movq %rax, 0x198(%rsp)
movq 0x198(%rsp), %rsi
leaq 0x120(%rsp), %rdi
callq 0x1ef270
jmp 0x1ed106
movq 0x198(%rsp), %rsi
leaq 0x108(%rsp), %rdi
callq 0x1ef2f0
jmp 0x1ed11d
jmp 0x1ed11f
leaq 0x120(%rsp), %rdi
leaq 0x108(%rsp), %rsi
callq 0x1ef360
movb %al, 0x67(%rsp)
jmp 0x1ed13a
movb 0x67(%rsp), %al
testb $0x1, %al
jne 0x1ed193
jmp 0x1ed144
movl $0x2, 0x104(%rsp)
jmp 0x1ed46e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x140(%rsp)
movl %eax, 0x13c(%rsp)
leaq 0x148(%rsp), %rdi
callq 0x1e7130
jmp 0x1ed4b7
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x140(%rsp)
movl %eax, 0x13c(%rsp)
jmp 0x1ed48b
leaq 0x120(%rsp), %rdi
callq 0x1ef3c0
movq %rax, 0x58(%rsp)
jmp 0x1ed1a7
movq 0x58(%rsp), %rax
movq %rax, 0xf8(%rsp)
leaq 0x1152dd(%rip), %rdi    # 0x302498
leaq 0x1a0(%rsp), %rsi
callq 0x1ef410
movq %rax, 0x50(%rsp)
jmp 0x1ed1cf
movq 0xf8(%rsp), %rsi
leaq 0xd0(%rsp), %rdi
callq 0x1e70b0
jmp 0x1ed1e6
movq 0x50(%rsp), %rdi
leaq 0xd0(%rsp), %rsi
callq 0x1b4750
movq %rax, 0x48(%rsp)
jmp 0x1ed1ff
movq 0x48(%rsp), %rax
movq %rax, 0xf0(%rsp)
leaq 0x115285(%rip), %rdi    # 0x302498
leaq 0x1a0(%rsp), %rsi
callq 0x1ef410
movq %rax, 0x40(%rsp)
jmp 0x1ed227
movq 0x40(%rsp), %rdi
callq 0x1b4780
movq %rax, 0xc8(%rsp)
leaq 0xf0(%rsp), %rdi
leaq 0xc8(%rsp), %rsi
callq 0x1b4730
movb %al, 0x3f(%rsp)
leaq 0xd0(%rsp), %rdi
callq 0x52f50
movb 0x3f(%rsp), %al
testb $0x1, %al
jne 0x1ed26c
jmp 0x1ed3df
testb $0x1, 0x1a7(%rsp)
jne 0x1ed301
movq 0x113d6f(%rip), %rdi    # 0x300ff0
leaq 0x34ee4(%rip), %rsi     # 0x22216c
callq 0x13380
movq %rax, 0x30(%rsp)
jmp 0x1ed294
movq 0x68(%rsp), %rsi
movq 0x30(%rsp), %rdi
callq 0x1ef440
movq %rax, 0x28(%rsp)
jmp 0x1ed2aa
movq 0x28(%rsp), %rdi
movq 0x113d2a(%rip), %rsi    # 0x300fe0
callq 0x135d0
jmp 0x1ed2bd
movl 0x1a0(%rsp), %eax
movl %eax, 0x1b4(%rsp)
movl $0x1, 0x104(%rsp)
jmp 0x1ed46e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x140(%rsp)
movl %eax, 0x13c(%rsp)
leaq 0xd0(%rsp), %rdi
callq 0x52f50
jmp 0x1ed48b
movl $0xffffffff, 0xb8(%rsp) # imm = 0xFFFFFFFF
movl $0x0, 0xbc(%rsp)
movl $0x0, 0xc0(%rsp)
movb $0x1, 0xc4(%rsp)
leaq 0x11514f(%rip), %rdi    # 0x302480
leaq 0xb8(%rsp), %rsi
callq 0x1ef160
jmp 0x1ed340
leaq 0x115139(%rip), %rdi    # 0x302480
callq 0x1ef560
decl %eax
movl %eax, 0x1c(%rsp)
leaq 0x11513f(%rip), %rdi    # 0x302498
leaq 0x1a0(%rsp), %rsi
callq 0x1ef410
movq %rax, 0x20(%rsp)
jmp 0x1ed36d
movq 0xf8(%rsp), %rsi
leaq 0x98(%rsp), %rdi
callq 0x1e70b0
jmp 0x1ed384
movq 0x20(%rsp), %rdi
leaq 0x98(%rsp), %rsi
callq 0x1dd760
movq %rax, 0x10(%rsp)
jmp 0x1ed39d
movq 0x10(%rsp), %rax
movl 0x1c(%rsp), %ecx
movl %ecx, (%rax)
leaq 0x98(%rsp), %rdi
callq 0x52f50
jmp 0x1ed3dd
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x140(%rsp)
movl %eax, 0x13c(%rsp)
leaq 0x98(%rsp), %rdi
callq 0x52f50
jmp 0x1ed48b
jmp 0x1ed3df
leaq 0x1150b2(%rip), %rdi    # 0x302498
leaq 0x1a0(%rsp), %rsi
callq 0x1ef410
movq %rax, 0x8(%rsp)
jmp 0x1ed3fa
movq 0xf8(%rsp), %rsi
leaq 0x78(%rsp), %rdi
callq 0x1e70b0
jmp 0x1ed40e
movq 0x8(%rsp), %rdi
leaq 0x78(%rsp), %rsi
callq 0x1dd760
movq %rax, (%rsp)
jmp 0x1ed423
movq (%rsp), %rax
movl (%rax), %eax
movl %eax, 0x1a0(%rsp)
leaq 0x78(%rsp), %rdi
callq 0x52f50
leaq 0x120(%rsp), %rdi
callq 0x1ef580
jmp 0x1ed449
jmp 0x1ed11f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x140(%rsp)
movl %eax, 0x13c(%rsp)
leaq 0x78(%rsp), %rdi
callq 0x52f50
jmp 0x1ed48b
leaq 0x170(%rsp), %rdi
callq 0x1e7130
movl 0x104(%rsp), %eax
subl $0x1, %eax
je 0x1ed4a8
jmp 0x1ed489
jmp 0x1ed49a
leaq 0x170(%rsp), %rdi
callq 0x1e7130
jmp 0x1ed4b7
movl 0x1a0(%rsp), %eax
movl %eax, 0x1b4(%rsp)
movl 0x1b4(%rsp), %eax
addq $0x1b8, %rsp            # imm = 0x1B8
retq
movq 0x140(%rsp), %rdi
callq 0x133f0
nopw %cs:(%rax,%rax)