// File: /workspace/github_cpp_makefile_star2_O1/tsoding[P]cxx-invert-file-tree/generator.cpp
// Function: generate_tree(std::filesystem::__cxx11::path const&, unsigned long)
void generate_tree(const fs::path &root, size_t depth = 0)
{
    if (depth < DEPTH_CAPACITY) {
        int n = rand_int_range(3, 5);

        for (int i = 0; i < n; ++i) {
            const auto child_path = root / (random_fruit() + "-" + std::to_string(i));

            if (rand() % 2) {
                std::cout << "Created Folder: " << child_path << std::endl;
                fs::create_directory(child_path);
                generate_tree(child_path, depth + 1);
            } else {
                std::cout << "Created File: " << child_path << std::endl;
                std::ofstream fout(child_path);

                int words_count = rand_int_range(20, 30);
                while (words_count-- > 0) {
                    fout << random_fruit() << std::endl;
                }
            }
        }
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x2d8, %rsp            # imm = 0x2D8
movq %rdi, 0x88(%rsp)
movq %rsi, 0x70(%rsp)
cmpq $0x4, %rsi
ja 0x36ff
callq 0x2070
cltq
imulq $0x55555556, %rax, %rcx # imm = 0x55555556
movq %rcx, %rdx
shrq $0x3f, %rdx
shrq $0x20, %rcx
addl %edx, %ecx
leal (%rcx,%rcx,2), %ecx
leaq 0x18(%rsp), %r14
incq 0x70(%rsp)
movq 0x3ca2(%rip), %rdx      # 0x6fc0
movq (%rdx), %rsi
movq %rsi, 0x80(%rsp)
movq 0x18(%rdx), %rdx
movq %rdx, 0x78(%rsp)
negl %ecx
addl %ecx, %eax
addl $0x2, %eax
movl %eax, 0x6c(%rsp)
xorl %ebp, %ebp
leaq 0xd8(%rsp), %r15
leaq 0x8(%rsp), %rbx
leaq 0x90(%rsp), %r12
movq %r12, %rdi
callq 0x3e90
movq %r12, %rdi
leaq 0x1cbf(%rip), %rsi      # 0x5025
callq 0x2290
leaq 0x58(%rsp), %rsi
movq %rsi, 0x48(%rsp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x3393
movq %rdx, 0x48(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x58(%rsp)
jmp 0x3399
movups (%rcx), %xmm0
movups %xmm0, (%rsi)
movq 0x8(%rax), %rdx
movq %rdx, 0x50(%rsp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
leaq 0x38(%rsp), %rax
movq %rax, 0x28(%rsp)
movl $0x1, %esi
leaq 0x28(%rsp), %rdi
movl $0x2d, %edx
callq 0x2200
movq 0x28(%rsp), %rdi
movl $0x1, %esi
movl %ebp, %edx
callq 0x3c12
movq 0x48(%rsp), %rcx
movl $0xf, %esi
leaq 0x58(%rsp), %rax
cmpq %rax, %rcx
je 0x33f9
movq 0x58(%rsp), %rsi
movq 0x50(%rsp), %r8
movq 0x30(%rsp), %rdx
leaq (%rdx,%r8), %rax
cmpq %rsi, %rax
jbe 0x3427
movl $0xf, %esi
leaq 0x38(%rsp), %rdi
cmpq %rdi, 0x28(%rsp)
je 0x3422
movq 0x38(%rsp), %rsi
cmpq %rsi, %rax
jbe 0x3438
movq 0x28(%rsp), %rsi
leaq 0x48(%rsp), %rdi
callq 0x2090
jmp 0x3446
leaq 0x28(%rsp), %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x21e0
movq %r14, 0x8(%rsp)
movq (%rax), %rdx
leaq 0x10(%rax), %rcx
cmpq %rcx, %rdx
je 0x3466
movq %rdx, 0x8(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x18(%rsp)
jmp 0x346d
movups (%rcx), %xmm0
movups %xmm0, (%r14)
movq %rax, %rdx
addq $0x8, %rdx
movq 0x8(%rax), %rsi
movq %rsi, 0x10(%rsp)
movq %rcx, (%rax)
movq $0x0, (%rdx)
movb $0x0, (%rcx)
movq %r15, %rdi
movq %rbx, %rsi
movl $0x2, %edx
callq 0x3940
leaq 0xb0(%rsp), %rdi
movq 0x88(%rsp), %rsi
movq %r15, %rdx
callq 0x3908
movq %r15, %rdi
callq 0x39e4
movq 0x8(%rsp), %rdi
cmpq %r14, %rdi
je 0x34d1
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x21c0
movq 0x28(%rsp), %rdi
leaq 0x38(%rsp), %rax
cmpq %rax, %rdi
je 0x34ed
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x21c0
movq 0x48(%rsp), %rdi
leaq 0x58(%rsp), %rax
cmpq %rax, %rdi
je 0x3509
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x21c0
movq 0x90(%rsp), %rdi
leaq 0xa0(%rsp), %rax
cmpq %rax, %rdi
je 0x352e
movq 0xa0(%rsp), %rsi
incq %rsi
callq 0x21c0
callq 0x2070
testb $0x1, %al
jne 0x366e
movl $0xe, %edx
movq 0x3a89(%rip), %rdi      # 0x6fd0
leaq 0x1aea(%rip), %rsi      # 0x5038
callq 0x21f0
movq 0x3a76(%rip), %rdi      # 0x6fd0
leaq 0xb0(%rsp), %rsi
callq 0x3a1c
movq %rax, %r13
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r13, %rdi
movl $0xa, %esi
callq 0x21a0
movsbl %al, %esi
movq %r13, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x2110
movq 0xb0(%rsp), %rsi
movq %r15, %rdi
movl $0x10, %edx
callq 0x21d0
callq 0x2070
cltq
imulq $0x2e8ba2e9, %rax, %rcx # imm = 0x2E8BA2E9
movq %rcx, %rdx
shrq $0x3f, %rdx
sarq $0x21, %rcx
addl %edx, %ecx
leal (%rcx,%rcx,4), %edx
leal (%rcx,%rdx,2), %ecx
negl %ecx
leal (%rax,%rcx), %r12d
addl $0x14, %r12d
movq %rbx, %rdi
callq 0x3e90
movq 0x8(%rsp), %rsi
movq 0x10(%rsp), %rdx
movq %r15, %rdi
callq 0x21f0
movq %rax, %r13
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r13, %rdi
movl $0xa, %esi
callq 0x21a0
movsbl %al, %esi
movq %r13, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x2110
movq 0x8(%rsp), %rdi
cmpq %r14, %rdi
je 0x362c
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x21c0
decl %r12d
jg 0x35d1
movq 0x80(%rsp), %rax
movq %rax, 0xd8(%rsp)
movq -0x18(%rax), %rax
movq 0x78(%rsp), %rcx
movq %rcx, 0xd8(%rsp,%rax)
leaq 0xe0(%rsp), %rdi
callq 0x2160
leaq 0x1d0(%rsp), %rdi
callq 0x20a0
jmp 0x36e3
movl $0x10, %edx
movq 0x3956(%rip), %rdi      # 0x6fd0
leaq 0x19a6(%rip), %rsi      # 0x5027
callq 0x21f0
movq 0x3943(%rip), %rdi      # 0x6fd0
leaq 0xb0(%rsp), %rsi
callq 0x3a1c
movq %rax, %r13
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r13, %rdi
movl $0xa, %esi
callq 0x21a0
movsbl %al, %esi
movq %r13, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x2110
leaq 0xb0(%rsp), %rdi
callq 0x20d0
leaq 0xb0(%rsp), %rdi
movq 0x70(%rsp), %rsi
callq 0x32c7
leaq 0xb0(%rsp), %rdi
callq 0x39e4
leal 0x1(%rbp), %eax
cmpl 0x6c(%rsp), %ebp
movl %eax, %ebp
jne 0x334c
addq $0x2d8, %rsp            # imm = 0x2D8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x37b0
movq %rax, %rbx
jmp 0x3789
movq %rax, %rbx
jmp 0x376d
movq %rax, %rbx
jmp 0x3751
movq %rax, %rbx
jmp 0x373a
movq %rax, %rbx
leaq 0xd8(%rsp), %rdi
callq 0x39e4
movq 0x8(%rsp), %rdi
cmpq %r14, %rdi
je 0x3751
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x21c0
movq 0x28(%rsp), %rdi
leaq 0x38(%rsp), %rax
cmpq %rax, %rdi
je 0x376d
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x21c0
movq 0x48(%rsp), %rdi
leaq 0x58(%rsp), %rax
cmpq %rax, %rdi
je 0x3789
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x21c0
movq 0x90(%rsp), %rdi
leaq 0xa0(%rsp), %rax
cmpq %rax, %rdi
je 0x37ee
movq 0xa0(%rsp), %rsi
incq %rsi
callq 0x21c0
jmp 0x37ee
movq %rax, %rbx
jmp 0x37e1
movq %rax, %rbx
jmp 0x37d4
movq %rax, %rbx
movq 0x8(%rsp), %rdi
cmpq %r14, %rdi
je 0x37d4
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x21c0
leaq 0xd8(%rsp), %rdi
callq 0x2230
leaq 0xb0(%rsp), %rdi
callq 0x39e4
movq %rbx, %rdi
callq 0x2270