// File: /workspace/github_cpp_makefile_star2_O2/Matan-Vinkler[P]Basic-File-System/myfs_main.cpp
// Function: recursive_print(MyFs&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
static void recursive_print(MyFs &myfs, std::string path, std::string prefix="") {
	MyFs::dir_list dlist = myfs.list_dir(path);
	for (size_t i=0; i < dlist.size(); i++) {
		MyFs::dir_list_entry &curr_entry = dlist[i];

		std::string entry_prefix = prefix;
		if (i == dlist.size()-1)
			entry_prefix += "└── ";
		else
			entry_prefix += "├── ";

		std::cout << entry_prefix << curr_entry.name << std::endl;

		if (curr_entry.is_dir) {
			std::string dir_prefix = prefix;

			if (i == dlist.size()-1)
				dir_prefix += "    ";
			else
				dir_prefix += "│   ";
			recursive_print(myfs, path + "/" + curr_entry.name, dir_prefix);
		}
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xf8, %rsp
movq %rdx, -0x30(%rbp)
movq %rdi, %rbx
leaq -0xd8(%rbp), %r14
movq %r14, %rdi
movq %rsi, -0x58(%rbp)
callq 0x2240
leaq -0x48(%rbp), %rdi
movq %rbx, -0x50(%rbp)
movq %rbx, %rsi
movq %r14, %rdx
callq 0x2fce
leaq -0xd8(%rbp), %rdi
callq 0x2368
xorl %r15d, %r15d
xorl %r14d, %r14d
movq -0x48(%rbp), %rbx
movq -0x40(%rbp), %rax
subq %rbx, %rax
cqto
pushq $0x48
popq %rcx
idivq %rcx
cmpq %rax, %r14
jae 0x3f96
leaq -0x78(%rbp), %rdi
movq -0x30(%rbp), %rsi
callq 0x2240
movq -0x40(%rbp), %rax
subq -0x48(%rbp), %rax
cqto
pushq $0x48
popq %rcx
idivq %rcx
decq %rax
leaq 0x148b(%rip), %rsi      # 0x530b
cmpq %rax, %r14
je 0x3e8c
leaq 0x148a(%rip), %rsi      # 0x5316
leaq -0x78(%rbp), %rdi
callq 0x2330
movq 0x4124(%rip), %rdi      # 0x7fc0
leaq -0x78(%rbp), %rsi
callq 0x21d0
leaq (%rbx,%r15), %r13
movq %rax, %rdi
movq %r13, %rsi
callq 0x21d0
movq %rax, %rdi
callq 0x2100
cmpb $0x1, 0x20(%rbx,%r15)
jne 0x3f81
leaq -0x118(%rbp), %rbx
movq %rbx, %rdi
movq -0x30(%rbp), %rsi
callq 0x2240
movq -0x40(%rbp), %rax
subq -0x48(%rbp), %rax
cqto
pushq $0x48
popq %rcx
idivq %rcx
decq %rax
leaq 0x142c(%rip), %rsi      # 0x5321
cmpq %rax, %r14
je 0x3f01
leaq 0x1425(%rip), %rsi      # 0x5326
movq %rbx, %rdi
callq 0x2330
leaq -0x98(%rbp), %r12
movq %r12, %rdi
movq -0x58(%rbp), %rsi
leaq 0x1371(%rip), %rdx      # 0x528f
callq 0x4133
leaq -0xb8(%rbp), %rdi
movq %r12, %rsi
movq %r13, %rdx
callq 0x402c
leaq -0xf8(%rbp), %r13
movq %r13, %rdi
movq %rbx, %rsi
callq 0x2240
movq -0x50(%rbp), %rdi
leaq -0xb8(%rbp), %r12
movq %r12, %rsi
movq %r13, %rdx
callq 0x3dea
movq %r13, %rdi
callq 0x2368
movq %r12, %rdi
callq 0x2368
leaq -0x98(%rbp), %rdi
callq 0x2368
movq %rbx, %rdi
callq 0x2368
leaq -0x78(%rbp), %rdi
callq 0x2368
incq %r14
addq $0x48, %r15
jmp 0x3e3d
leaq -0x48(%rbp), %rdi
callq 0x3064
addq $0xf8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq -0xd8(%rbp), %rdi
callq 0x2368
jmp 0x4024
jmp 0x400f
movq %rax, %rbx
leaq -0xf8(%rbp), %rdi
callq 0x2368
jmp 0x3fd8
movq %rax, %rbx
leaq -0xb8(%rbp), %rdi
callq 0x2368
jmp 0x3feb
jmp 0x3ff9
movq %rax, %rbx
leaq -0x98(%rbp), %rdi
callq 0x2368
jmp 0x3ffc
movq %rax, %rbx
leaq -0x118(%rbp), %rdi
callq 0x2368
jmp 0x4012
movq %rax, %rbx
jmp 0x401b
movq %rax, %rbx
leaq -0x78(%rbp), %rdi
callq 0x2368
leaq -0x48(%rbp), %rdi
callq 0x3064
movq %rbx, %rdi
callq 0x22e0