// File: FalconUA[P]vfs/vfs/directory.cpp
// Function: virt::fs::copy_content(virt::fs::directory*, virt::fs::directory*)
void virt::fs::copy_content(virt::fs::directory* source, virt::fs::directory* destination){
	
	for (std::map<std::string, virt::fs::file*>::iterator it = source->files.begin(); 
			it != source->files.end(); it++)
		destination->add_file(it->second->get_name(), it->second->content, true);

	for (std::map<std::string, virt::fs::directory*>::iterator it = source->subdir.begin();
			it != source->subdir.end(); it++){
		if (it->first == "" || it->first == "." || it->first == "..")
			continue;

		destination->add_subdir(it->second->get_name(), false);
		virt::fs::copy_content(it->second, destination->subdir[it->second->name]);
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xe0, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rdi
addq $0x58, %rdi
callq 0x4cc0
movq %rax, -0x18(%rbp)
movq -0x8(%rbp), %rdi
addq $0x58, %rdi
callq 0x4d20
movq %rax, -0x20(%rbp)
leaq -0x18(%rbp), %rdi
leaq -0x20(%rbp), %rsi
callq 0x4cf0
testb $0x1, %al
jne 0x432b
jmp 0x43e4
movq -0x10(%rbp), %rax
movq %rax, -0xc0(%rbp)
leaq -0x18(%rbp), %rdi
movq %rdi, -0xb8(%rbp)
callq 0x51e0
movq 0x20(%rax), %rsi
leaq -0x40(%rbp), %rdi
callq 0xa550
movq -0xb8(%rbp), %rdi
callq 0x51e0
movq 0x20(%rax), %rsi
addq $0x28, %rsi
leaq -0x60(%rbp), %rdi
callq 0x30f0
jmp 0x4372
movq -0xc0(%rbp), %rdi
leaq -0x40(%rbp), %rsi
leaq -0x60(%rbp), %rdx
movl $0x1, %ecx
callq 0x4560
jmp 0x438d
leaq -0x60(%rbp), %rdi
callq 0x3160
leaq -0x40(%rbp), %rdi
callq 0x3160
leaq -0x18(%rbp), %rdi
xorl %esi, %esi
callq 0x4da0
movq %rax, -0x78(%rbp)
jmp 0x4304
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
jmp 0x43d6
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
leaq -0x60(%rbp), %rdi
callq 0x3160
leaq -0x40(%rbp), %rdi
callq 0x3160
jmp 0x4554
movq -0x8(%rbp), %rdi
addq $0x28, %rdi
callq 0x4b90
movq %rax, -0x80(%rbp)
movq -0x8(%rbp), %rdi
addq $0x28, %rdi
callq 0x4bf0
movq %rax, -0x88(%rbp)
leaq -0x80(%rbp), %rdi
leaq -0x88(%rbp), %rsi
callq 0x4bc0
testb $0x1, %al
jne 0x4422
jmp 0x454b
leaq -0x80(%rbp), %rdi
callq 0x5230
movq %rax, %rdi
leaq 0xf998(%rip), %rsi      # 0x13dcd
callq 0x5200
testb $0x1, %al
jne 0x4478
leaq -0x80(%rbp), %rdi
callq 0x5230
movq %rax, %rdi
leaq 0xebb4(%rip), %rsi      # 0x13005
callq 0x5200
testb $0x1, %al
jne 0x4478
leaq -0x80(%rbp), %rdi
callq 0x5230
movq %rax, %rdi
leaq 0xeb97(%rip), %rsi      # 0x13004
callq 0x5200
testb $0x1, %al
jne 0x4478
jmp 0x447d
jmp 0x451a
movq -0x10(%rbp), %rax
movq %rax, -0xd0(%rbp)
leaq -0x80(%rbp), %rdi
callq 0x5230
movq 0x20(%rax), %rsi
leaq -0xa8(%rbp), %rdi
movq %rdi, -0xc8(%rbp)
callq 0x3f80
movq -0xd0(%rbp), %rdi
movq -0xc8(%rbp), %rsi
xorl %edx, %edx
callq 0x4030
jmp 0x44bf
leaq -0xa8(%rbp), %rdi
callq 0x3160
leaq -0x80(%rbp), %rdi
callq 0x5230
movq 0x20(%rax), %rax
movq %rax, -0xd8(%rbp)
movq -0x10(%rbp), %rax
addq $0x28, %rax
movq %rax, -0xe0(%rbp)
leaq -0x80(%rbp), %rdi
callq 0x5230
movq -0xe0(%rbp), %rdi
movq 0x20(%rax), %rsi
addq $0x8, %rsi
callq 0x50d0
movq -0xd8(%rbp), %rdi
movq (%rax), %rsi
callq 0x42e0
leaq -0x80(%rbp), %rdi
xorl %esi, %esi
callq 0x4c80
movq %rax, -0xb0(%rbp)
jmp 0x43f5
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
leaq -0xa8(%rbp), %rdi
callq 0x3160
jmp 0x4554
addq $0xe0, %rsp
popq %rbp
retq
movq -0x68(%rbp), %rdi
callq 0x33f0
nopl (%rax)