// File: FalconUA[P]vfs/vfs/filesystem.cpp
// Function: virt::filesystem::dir_iterator::move_to(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
bool virt::filesystem::dir_iterator::move_to(std::string path){
	std::stringstream ss(path);
	std::string token;

	virt::filesystem::dir_iterator iterator = 
		(path[0] == '/')? (this->working_fs->root()) : (*this);
	

	while (std::getline(ss, token, '/')){
		if (token == "")
			continue;
		if (iterator.working_dir->has_child(token))
			iterator.working_dir = iterator.working_dir->child_dir(token);
		else 
			return false;
	}

	this->working_dir = iterator.working_dir;
	return true;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x280, %rsp            # imm = 0x280
movq %rsi, -0x238(%rbp)
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x240(%rbp)
movl $0x10, %edi
movl $0x8, %esi
callq 0xaaf0
movq -0x238(%rbp), %rsi
movl %eax, %edx
leaq -0x1a0(%rbp), %rdi
callq 0x33b0
leaq -0x1c0(%rbp), %rdi
callq 0x3360
movq -0x238(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x3460
movq %rax, -0x230(%rbp)
jmp 0xa7ee
movq -0x230(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x2f, %eax
jne 0xa83a
movq -0x240(%rbp), %rax
movq (%rax), %rdi
callq 0xa610
movq %rdx, -0x250(%rbp)
movq %rax, -0x248(%rbp)
jmp 0xa81c
movq -0x250(%rbp), %rax
movq -0x248(%rbp), %rcx
movq %rcx, -0x1d0(%rbp)
movq %rax, -0x1c8(%rbp)
jmp 0xa856
movq -0x240(%rbp), %rax
movq (%rax), %rcx
movq %rcx, -0x1d0(%rbp)
movq 0x8(%rax), %rax
movq %rax, -0x1c8(%rbp)
jmp 0xa858
leaq -0x1a0(%rbp), %rdi
leaq -0x1c0(%rbp), %rsi
movl $0x2f, %edx
callq 0x3420
movq %rax, -0x258(%rbp)
jmp 0xa879
movq -0x258(%rbp), %rdi
movq (%rdi), %rax
movq -0x18(%rax), %rax
addq %rax, %rdi
callq 0x3320
movb %al, -0x259(%rbp)
jmp 0xa897
movb -0x259(%rbp), %al
testb $0x1, %al
jne 0xa8a6
jmp 0xa9ef
leaq 0x9520(%rip), %rsi      # 0x13dcd
leaq -0x1c0(%rbp), %rdi
callq 0x5200
movb %al, -0x25a(%rbp)
jmp 0xa8c1
movb -0x25a(%rbp), %al
testb $0x1, %al
jne 0xa8cd
jmp 0xa8e6
jmp 0xa858
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x1d8(%rbp)
movl %eax, -0x1dc(%rbp)
jmp 0xaa35
movq -0x1c8(%rbp), %rax
movq %rax, -0x268(%rbp)
leaq -0x200(%rbp), %rdi
leaq -0x1c0(%rbp), %rsi
callq 0x30f0
jmp 0xa909
movq -0x268(%rbp), %rdi
leaq -0x200(%rbp), %rsi
callq 0x3fb0
movb %al, -0x269(%rbp)
jmp 0xa924
leaq -0x200(%rbp), %rdi
callq 0x3160
movb -0x269(%rbp), %al
testb $0x1, %al
jne 0xa93f
jmp 0xa9da
movq -0x1c8(%rbp), %rax
movq %rax, -0x278(%rbp)
leaq -0x220(%rbp), %rdi
leaq -0x1c0(%rbp), %rsi
callq 0x30f0
jmp 0xa962
movq -0x278(%rbp), %rdi
leaq -0x220(%rbp), %rsi
callq 0x4000
movq %rax, -0x280(%rbp)
jmp 0xa97e
movq -0x280(%rbp), %rax
movq %rax, -0x1c8(%rbp)
leaq -0x220(%rbp), %rdi
callq 0x3160
jmp 0xa9ea
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x1d8(%rbp)
movl %eax, -0x1dc(%rbp)
leaq -0x200(%rbp), %rdi
callq 0x3160
jmp 0xaa35
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x1d8(%rbp)
movl %eax, -0x1dc(%rbp)
leaq -0x220(%rbp), %rdi
callq 0x3160
jmp 0xaa35
movb $0x0, -0x1(%rbp)
movl $0x1, -0x224(%rbp)
jmp 0xaa0f
jmp 0xa858
movq -0x240(%rbp), %rax
movq -0x1c8(%rbp), %rcx
movq %rcx, 0x8(%rax)
movb $0x1, -0x1(%rbp)
movl $0x1, -0x224(%rbp)
leaq -0x1c0(%rbp), %rdi
callq 0x3160
leaq -0x1a0(%rbp), %rdi
callq 0x31c0
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0x280, %rsp            # imm = 0x280
popq %rbp
retq
leaq -0x1c0(%rbp), %rdi
callq 0x3160
leaq -0x1a0(%rbp), %rdi
callq 0x31c0
movq -0x1d8(%rbp), %rdi
callq 0x33f0
nopl (%rax)