// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/cfb.c
// Function: do_process_dir_entry
static void do_process_dir_entry(deark *c, lctx *d, i64 dir_entry_idx)
{
	struct dir_entry_info *dei = NULL;
	char clsid_string[50];
	char buf[80];

	if(!d->dir_entry) return; // error
	dei = &d->dir_entry[dir_entry_idx];

	de_dbg(c, "type: 0x%02x (%s)", (unsigned int)dei->entry_type, dei->entry_type_name);
	if(dei->entry_type==OBJTYPE_EMPTY) goto done;

	de_dbg2(c, "name len: %d bytes", (int)dei->name_len_raw);
	de_dbg(c, "name: \"%s\"", ucstring_getpsz(dei->fname_srd->str));
	de_dbg(c, "node color: %u", (unsigned int)dei->node_color);

	if(dei->entry_type==OBJTYPE_STORAGE || dei->entry_type==OBJTYPE_STREAM) {
		de_dbg(c, "sibling StreamIDs: %d, %d", (int)dei->sibling_id[0], (int)dei->sibling_id[1]);
	}

	if(dei->entry_type==OBJTYPE_STORAGE || dei->entry_type==OBJTYPE_ROOT_STORAGE) {
		de_dbg(c, "child StreamID: %d", (int)dei->child_id);
	}

	if(dei->entry_type==OBJTYPE_STORAGE || dei->entry_type==OBJTYPE_STREAM) {
		de_dbg(c, "parent: %d", (int)dei->parent_id);
	}

	if(dei->entry_type==OBJTYPE_STORAGE || dei->entry_type==OBJTYPE_ROOT_STORAGE) {
		buf[0] = '\0';
		if(dei->entry_type==OBJTYPE_ROOT_STORAGE) {
			identify_clsid(c, d, dei->clsid, buf, sizeof(buf));
		}

		fmtutil_render_uuid(c, dei->clsid, clsid_string, sizeof(clsid_string));
		de_dbg(c, "%sclsid: {%s}%s", (dei->entry_type==OBJTYPE_ROOT_STORAGE)?"root ":"",
			clsid_string, buf);
	}

	dbg_timestamp(c, &dei->mod_time, "mod time");

	de_dbg(c, "stream size: %"I64_FMT, dei->stream_size);

	if(dei->is_mini_stream) {
		de_dbg(c, "first MiniSecID: %d", (int)dei->minisec_id);
	}
	else {
		describe_sec_id(c, d, dei->normal_sec_id, buf, sizeof(buf));
		de_dbg(c, "first SecID: %d (%s)", (int)dei->normal_sec_id, buf);
	}

	if(dei->entry_type==OBJTYPE_ROOT_STORAGE) {
		read_mini_sector_stream(c, d, dei->normal_sec_id, dei->stream_size);
	}
	else if(dei->is_thumbsdb_catalog && d->decode_streams) {
		// TODO: Move this to do_process_stream()?
		read_thumbsdb_catalog(c, d, dei);
	}
	else if(dei->entry_type==OBJTYPE_STREAM) {
		do_process_stream(c, d, dei);
	}

done:
	;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xc0, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq $0x0, -0x20(%rbp)
movq -0x10(%rbp), %rax
cmpq $0x0, 0x98(%rax)
jne 0x52c72
jmp 0x52f91
movq -0x10(%rbp), %rax
movq 0x98(%rax), %rax
imulq $0x88, -0x18(%rbp), %rcx
addq %rcx, %rax
movq %rax, -0x20(%rbp)
movq -0x8(%rbp), %rdi
movq -0x20(%rbp), %rax
movzbl 0x4(%rax), %edx
movq -0x20(%rbp), %rax
movq 0x50(%rax), %rcx
leaq 0x1633e9(%rip), %rsi    # 0x1b6090
movb $0x0, %al
callq 0x15b0d0
movq -0x20(%rbp), %rax
movzbl 0x4(%rax), %eax
cmpl $0x0, %eax
jne 0x52cc0
jmp 0x52f91
movq -0x8(%rbp), %rdi
movq -0x20(%rbp), %rax
movq 0x58(%rax), %rax
movl %eax, %edx
leaq 0x152d29(%rip), %rsi    # 0x1a59fe
movb $0x0, %al
callq 0x15b350
movq -0x8(%rbp), %rax
movq %rax, -0xb8(%rbp)
movq -0x20(%rbp), %rax
movq 0x28(%rax), %rax
movq 0x18(%rax), %rdi
callq 0x172500
movq -0xb8(%rbp), %rdi
movq %rax, %rdx
leaq 0x15b4c7(%rip), %rsi    # 0x1ae1d0
movb $0x0, %al
callq 0x15b0d0
movq -0x8(%rbp), %rdi
movq -0x20(%rbp), %rax
movzbl 0x60(%rax), %edx
leaq 0x152cee(%rip), %rsi    # 0x1a5a11
movb $0x0, %al
callq 0x15b0d0
movq -0x20(%rbp), %rax
movzbl 0x4(%rax), %eax
cmpl $0x1, %eax
je 0x52d44
movq -0x20(%rbp), %rax
movzbl 0x4(%rax), %eax
cmpl $0x2, %eax
jne 0x52d64
movq -0x8(%rbp), %rdi
movq -0x20(%rbp), %rax
movl 0x68(%rax), %edx
movq -0x20(%rbp), %rax
movl 0x6c(%rax), %ecx
leaq 0x152cc3(%rip), %rsi    # 0x1a5a20
movb $0x0, %al
callq 0x15b0d0
movq -0x20(%rbp), %rax
movzbl 0x4(%rax), %eax
cmpl $0x1, %eax
je 0x52d7e
movq -0x20(%rbp), %rax
movzbl 0x4(%rax), %eax
cmpl $0x5, %eax
jne 0x52d97
movq -0x8(%rbp), %rdi
movq -0x20(%rbp), %rax
movl 0x64(%rax), %edx
leaq 0x152caa(%rip), %rsi    # 0x1a5a3a
movb $0x0, %al
callq 0x15b0d0
movq -0x20(%rbp), %rax
movzbl 0x4(%rax), %eax
cmpl $0x1, %eax
je 0x52db1
movq -0x20(%rbp), %rax
movzbl 0x4(%rax), %eax
cmpl $0x2, %eax
jne 0x52dca
movq -0x8(%rbp), %rdi
movq -0x20(%rbp), %rax
movl 0x70(%rax), %edx
leaq 0x152c8a(%rip), %rsi    # 0x1a5a4d
movb $0x0, %al
callq 0x15b0d0
movq -0x20(%rbp), %rax
movzbl 0x4(%rax), %eax
cmpl $0x1, %eax
je 0x52de8
movq -0x20(%rbp), %rax
movzbl 0x4(%rax), %eax
cmpl $0x5, %eax
jne 0x52e72
movb $0x0, -0xb0(%rbp)
movq -0x20(%rbp), %rax
movzbl 0x4(%rax), %eax
cmpl $0x5, %eax
jne 0x52e1e
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x20(%rbp), %rdx
addq $0x30, %rdx
leaq -0xb0(%rbp), %rcx
movl $0x50, %r8d
callq 0x53780
movq -0x8(%rbp), %rdi
movq -0x20(%rbp), %rsi
addq $0x30, %rsi
leaq -0x60(%rbp), %rdx
movl $0x32, %ecx
callq 0x173ee0
movq -0x8(%rbp), %rdi
movq -0x20(%rbp), %rax
movzbl 0x4(%rax), %ecx
leaq 0x17dd85(%rip), %rdx    # 0x1d0bd0
leaq 0x152c16(%rip), %rax    # 0x1a5a68
cmpl $0x5, %ecx
cmoveq %rax, %rdx
leaq -0x60(%rbp), %rcx
leaq -0xb0(%rbp), %r8
leaq 0x152bed(%rip), %rsi    # 0x1a5a58
movb $0x0, %al
callq 0x15b0d0
movq -0x8(%rbp), %rdi
movq -0x20(%rbp), %rsi
addq $0x40, %rsi
leaq 0x166ced(%rip), %rdx    # 0x1b9b72
callq 0x53890
movq -0x8(%rbp), %rdi
movq -0x20(%rbp), %rax
movq 0x10(%rax), %rdx
leaq 0x152bd1(%rip), %rsi    # 0x1a5a6e
movb $0x0, %al
callq 0x15b0d0
movq -0x20(%rbp), %rax
cmpl $0x0, 0x8(%rax)
je 0x52ecc
movq -0x8(%rbp), %rdi
movq -0x20(%rbp), %rax
movq 0x20(%rax), %rax
movl %eax, %edx
leaq 0x152bbc(%rip), %rsi    # 0x1a5a7f
movb $0x0, %al
callq 0x15b0d0
jmp 0x52f11
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x20(%rbp), %rax
movq 0x18(%rax), %rdx
leaq -0xb0(%rbp), %rcx
movl $0x50, %r8d
callq 0x52250
movq -0x8(%rbp), %rdi
movq -0x20(%rbp), %rax
movq 0x18(%rax), %rax
movl %eax, %edx
leaq -0xb0(%rbp), %rcx
leaq 0x152b89(%rip), %rsi    # 0x1a5a93
movb $0x0, %al
callq 0x15b0d0
movq -0x20(%rbp), %rax
movzbl 0x4(%rax), %eax
cmpl $0x5, %eax
jne 0x52f3d
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x20(%rbp), %rax
movq 0x18(%rax), %rdx
movq -0x20(%rbp), %rax
movq 0x10(%rax), %rcx
callq 0x538f0
jmp 0x52f8f
movq -0x20(%rbp), %rax
movzbl 0x80(%rax), %eax
cmpl $0x0, %eax
je 0x52f6d
movq -0x10(%rbp), %rax
movzbl 0xd(%rax), %eax
cmpl $0x0, %eax
je 0x52f6d
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x20(%rbp), %rdx
callq 0x53980
jmp 0x52f8d
movq -0x20(%rbp), %rax
movzbl 0x4(%rax), %eax
cmpl $0x2, %eax
jne 0x52f8b
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x20(%rbp), %rdx
callq 0x53d80
jmp 0x52f8d
jmp 0x52f8f
jmp 0x52f91
addq $0xc0, %rsp
popq %rbp
retq
nopw (%rax,%rax)