// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/cfb.c
// Function: do_mark_dir_entries_recursively
static void do_mark_dir_entries_recursively(deark *c, lctx *d, i32 parent_id,
	i32 dir_entry_idx, int level)
{
	struct dir_entry_info *dei;
	int k;

	if(dir_entry_idx<0 || (i64)dir_entry_idx>=d->num_dir_entries) return;

	dei = &d->dir_entry[dir_entry_idx];

	if(dei->entry_type!=OBJTYPE_STORAGE && dei->entry_type!=OBJTYPE_STREAM) return;

	dei->parent_id = parent_id;

	if(dei->entry_type==OBJTYPE_STORAGE && dei->fname_srd && dei->fname_srd->str && !dei->path) {
		// Set the full pathname
		dei->path = ucstring_create(c);
		if(parent_id>0 && d->dir_entry[parent_id].path) {
			ucstring_append_ucstring(dei->path, d->dir_entry[parent_id].path);
			ucstring_append_sz(dei->path, "/", DE_ENCODING_LATIN1);
		}
		ucstring_append_ucstring(dei->path, dei->fname_srd->str);
	}

	if(level>50) return;
	for(k=0; k<2; k++) {
		do_mark_dir_entries_recursively(c, d, parent_id, dei->sibling_id[k], level+1);
	}

	if(dei->entry_type==OBJTYPE_STORAGE) {
		// This is a "subdirectory" entry, so examine its children (starting with the
		// one that we know about).
		do_mark_dir_entries_recursively(c, d, dir_entry_idx, dei->child_id, level+1);
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
movl %ecx, -0x18(%rbp)
movl %r8d, -0x1c(%rbp)
cmpl $0x0, -0x18(%rbp)
jl 0x535de
movslq -0x18(%rbp), %rax
movq -0x10(%rbp), %rcx
cmpq 0x70(%rcx), %rax
jl 0x535e3
jmp 0x53771
movq -0x10(%rbp), %rax
movq 0x98(%rax), %rax
movslq -0x18(%rbp), %rcx
imulq $0x88, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rax
movzbl 0x4(%rax), %eax
cmpl $0x1, %eax
je 0x5361f
movq -0x28(%rbp), %rax
movzbl 0x4(%rax), %eax
cmpl $0x2, %eax
je 0x5361f
jmp 0x53771
movl -0x14(%rbp), %ecx
movq -0x28(%rbp), %rax
movl %ecx, 0x70(%rax)
movq -0x28(%rbp), %rax
movzbl 0x4(%rax), %eax
cmpl $0x1, %eax
jne 0x53701
movq -0x28(%rbp), %rax
cmpq $0x0, 0x28(%rax)
je 0x53701
movq -0x28(%rbp), %rax
movq 0x28(%rax), %rax
cmpq $0x0, 0x18(%rax)
je 0x53701
movq -0x28(%rbp), %rax
cmpq $0x0, 0x78(%rax)
jne 0x53701
movq -0x8(%rbp), %rdi
callq 0x1711d0
movq %rax, %rcx
movq -0x28(%rbp), %rax
movq %rcx, 0x78(%rax)
cmpl $0x0, -0x14(%rbp)
jle 0x536e8
movq -0x10(%rbp), %rax
movq 0x98(%rax), %rax
movslq -0x14(%rbp), %rcx
imulq $0x88, %rcx, %rcx
addq %rcx, %rax
cmpq $0x0, 0x78(%rax)
je 0x536e8
movq -0x28(%rbp), %rax
movq 0x78(%rax), %rdi
movq -0x10(%rbp), %rax
movq 0x98(%rax), %rax
movslq -0x14(%rbp), %rcx
imulq $0x88, %rcx, %rcx
addq %rcx, %rax
movq 0x78(%rax), %rsi
callq 0x171460
movq -0x28(%rbp), %rax
movq 0x78(%rax), %rdi
leaq 0x14aa60(%rip), %rsi    # 0x19e13e
movl $0x5, %edx
callq 0x1715e0
movq -0x28(%rbp), %rax
movq 0x78(%rax), %rdi
movq -0x28(%rbp), %rax
movq 0x28(%rax), %rax
movq 0x18(%rax), %rsi
callq 0x171460
cmpl $0x32, -0x1c(%rbp)
jle 0x53709
jmp 0x53771
movl $0x0, -0x2c(%rbp)
cmpl $0x2, -0x2c(%rbp)
jge 0x53745
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movl -0x14(%rbp), %edx
movq -0x28(%rbp), %rax
movslq -0x2c(%rbp), %rcx
movl 0x68(%rax,%rcx,4), %ecx
movl -0x1c(%rbp), %r8d
addl $0x1, %r8d
callq 0x535b0
movl -0x2c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x2c(%rbp)
jmp 0x53710
movq -0x28(%rbp), %rax
movzbl 0x4(%rax), %eax
cmpl $0x1, %eax
jne 0x53771
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movl -0x18(%rbp), %edx
movq -0x28(%rbp), %rax
movl 0x64(%rax), %ecx
movl -0x1c(%rbp), %r8d
addl $0x1, %r8d
callq 0x535b0
addq $0x30, %rsp
popq %rbp
retq
nopw (%rax,%rax)