// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/modules/hfs.c
// Function: do_leaf_node_record_extract_item
static void do_leaf_node_record_extract_item(deark *c, lctx *d, struct nodedata *nd,
	struct recorddata *rd)
{
	struct de_advfile *advf = NULL;
	i64 oldlen;

	advf = de_advfile_create(c);
	advf->original_filename_flag = 1;

	// TODO: This is not very efficient. Maybe we should at least cache the
	// previous file's path, since it's usually the same.
	get_full_path_from_dirid(c, d, rd->ParID, advf->filename, 0);

	de_dbg(c, "path: \"%s\"", ucstring_getpsz_d(advf->filename));
	oldlen = advf->filename->len;
	if(rd->name_srd && ucstring_isnonempty(rd->name_srd->str)) {
		ucstring_append_ucstring(advf->filename, rd->name_srd->str);
	}
	else {
		ucstring_append_sz(advf->filename, "_", DE_ENCODING_LATIN1);
	}

	squash_slashes(advf->filename, oldlen);

	advf->snflags = DE_SNFLAG_FULLPATH;

	if(rd->cdrType==CDRTYPE_DIR) {
		do_extract_dir(c, d, nd, rd, advf);
	}
	else if(rd->cdrType==CDRTYPE_FILE) {
		do_extract_file(c, d, nd, rd, advf);
	}

	de_advfile_destroy(advf);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x78, %rsp
movq %rdx, %r15
movq %rsi, %rbp
movq %rdi, %r14
callq 0xfc498
movq %rax, %rbx
movb $0x1, 0x79(%rax)
movl 0x14(%r15), %edx
movq 0x68(%rax), %rcx
movq %r14, %rdi
movq %rbp, %rsi
xorl %r8d, %r8d
callq 0x567a5
movq 0x68(%rbx), %rdi
callq 0xf70f6
leaq 0xedff1(%rip), %rsi     # 0x144329
movq %r14, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0xe8617
movq 0x68(%rbx), %rdi
movq 0x10(%rdi), %r12
movq 0x18(%r15), %rax
testq %rax, %rax
je 0x56376
movq 0x18(%rax), %rdi
callq 0xf67a3
movq 0x68(%rbx), %rdi
testl %eax, %eax
je 0x56376
movq 0x18(%r15), %rax
movq 0x18(%rax), %rsi
callq 0xf6509
jmp 0x56387
leaq 0xd8607(%rip), %rsi     # 0x12e984
movl $0x5, %edx
callq 0xf65e3
movq 0x68(%rbx), %rcx
movq 0x10(%rcx), %rax
cmpq %r12, %rax
jle 0x563af
movq 0x8(%rcx), %rcx
cmpl $0x2f, (%rcx,%r12,4)
jne 0x563a7
movl $0x5f, (%rcx,%r12,4)
incq %r12
cmpq %r12, %rax
jne 0x56398
movl $0x1, 0x70(%rbx)
movl 0x10(%r15), %eax
cmpl $0x2, %eax
je 0x563fd
cmpl $0x1, %eax
jne 0x5678e
movq 0x8(%r15), %rsi
addq $0xa, %rsi
movq 0x20(%rbx), %rdx
movq %r14, %rdi
callq 0x56874
movq 0x20(%rbx), %rax
movb $0x1, %cl
movb %cl, 0x9(%rax)
movb %cl, 0x10(%rbx)
movq $0x0, 0x18(%rbx)
movq %rbx, %rdi
callq 0xfc5b7
jmp 0x5678e
movq 0x8(%r15), %r12
movl $0x20, %esi
movq %r14, %rdi
callq 0xe8b2b
movq %rax, %r13
movq %rbp, 0x8(%rsp)
movq %rbp, (%rax)
movq %r15, 0x8(%rax)
movl $0x50, %esi
movq %r14, %rdi
callq 0xe8b2b
movq %rax, 0x10(%r13)
movl $0x50, %esi
movq %r14, %rdi
callq 0xe8b2b
movq %rax, 0x18(%r13)
movb $0x1, %cl
movb %cl, (%rax)
addq $0x2, %r12
leaq 0x10(%rsp), %rsi
movq %r12, (%rsi)
movq 0x18(%r14), %rdi
movq %rsi, %r12
callq 0xeeb4b
movzbl %al, %edx
leaq 0xca9d2(%rip), %rsi     # 0x120e37
movq %r14, %rdi
xorl %eax, %eax
callq 0xe8617
movq 0x18(%r14), %rdi
movq %r12, %rsi
callq 0xeeb4b
movzbl %al, %edx
leaq 0xca9bf(%rip), %rsi     # 0x120e44
movq %r14, %rdi
xorl %eax, %eax
callq 0xe8617
movq (%r12), %r12
movq 0x18(%r14), %rdi
leaq 0x48(%rsp), %rdx
movq %r12, %rsi
movl $0x4, %ecx
xorl %r8d, %r8d
callq 0xf1762
leaq 0x58(%rsp), %rbp
leaq 0xbe483(%rip), %rsi     # 0x11493b
movq %r14, %rdi
movq %rbp, %rdx
xorl %eax, %eax
callq 0xe8617
movl -0x10(%rbp), %eax
movl %eax, 0x90(%rbx)
movb $0x1, %al
movb %al, 0x7b(%rbx)
leaq 0x4(%r12), %rsi
movq 0x18(%r14), %rdi
leaq 0x18(%rsp), %rdx
movl $0x4, %ecx
xorl %r8d, %r8d
callq 0xf1762
leaq 0x28(%rsp), %rbp
leaq 0xdddf1(%rip), %rsi     # 0x1342eb
movq %r14, %rdi
movq %rbp, %rdx
xorl %eax, %eax
callq 0xe8617
movl -0x10(%rbp), %eax
movl %eax, 0x94(%rbx)
movb $0x1, %al
movb %al, 0x7c(%rbx)
movb $0x1, %bpl
addq $0x8, %r12
movq 0x18(%r14), %rdi
movq %r12, %rsi
callq 0xeeb67
movq %rax, %r12
leaq 0xbe418(%rip), %rsi     # 0x11494a
movq %r14, %rdi
movl %r12d, %edx
xorl %eax, %eax
callq 0xe8617
movw %r12w, 0x7e(%rbx)
movb %bpl, 0x7d(%rbx)
leaq 0x10(%rsp), %rsi
addq $0x14, (%rsi)
movq 0x18(%r14), %rdi
movq %rsi, %r12
callq 0xeeb91
movq 0x10(%r13), %rcx
movq %rax, 0x8(%rcx)
leaq 0xca8e3(%rip), %rsi     # 0x120e4f
movq %r14, %rdi
movl %eax, %edx
xorl %eax, %eax
callq 0xe8617
movq 0x18(%r14), %rdi
movq %r12, %rsi
callq 0xeed31
movq 0x10(%r13), %rcx
movq %rax, 0x10(%rcx)
leaq 0xca8da(%rip), %rsi     # 0x120e6d
movq %r14, %rdi
movl %eax, %edx
xorl %eax, %eax
callq 0xe8617
movq 0x18(%r14), %rdi
movq %r12, %rsi
callq 0xeed31
movq 0x10(%r13), %rcx
movq %rax, 0x18(%rcx)
leaq 0xca8cd(%rip), %rsi     # 0x120e87
movq %r14, %rdi
movl %eax, %edx
xorl %eax, %eax
callq 0xe8617
movq 0x18(%r14), %rdi
movq %r12, %rsi
callq 0xeeb91
movq 0x18(%r13), %rcx
movq %rax, 0x8(%rcx)
leaq 0xca8c1(%rip), %rsi     # 0x120ea2
movq %r14, %rdi
movl %eax, %edx
xorl %eax, %eax
callq 0xe8617
movq 0x18(%r14), %rdi
movq %r12, %rsi
callq 0xeed31
movq 0x18(%r13), %rcx
movq %rax, 0x10(%rcx)
leaq 0xca8b8(%rip), %rsi     # 0x120ec0
movq %r14, %rdi
movl %eax, %edx
xorl %eax, %eax
callq 0xe8617
movq 0x18(%r14), %rdi
movq %r12, %rsi
callq 0xeed31
movq 0x18(%r13), %rcx
movq %rax, 0x18(%rcx)
leaq 0xca8ab(%rip), %rsi     # 0x120eda
movq %r14, %rdi
movl %eax, %edx
xorl %eax, %eax
callq 0xe8617
movq (%r12), %rsi
movq 0x20(%rbx), %rdx
movq %r14, %rdi
callq 0x56874
addq $0x1c, (%r12)
movq 0x18(%r14), %rdi
movq %r12, %rsi
callq 0xeeb91
leaq 0xca892(%rip), %rsi     # 0x120ef5
movq %r14, %rdi
movl %eax, %edx
xorl %eax, %eax
callq 0xe8617
movq (%r12), %rsi
movq 0x10(%r13), %rdx
addq $0x20, %rdx
leaq 0xca882(%rip), %rcx     # 0x120f04
movq %r14, %rdi
callq 0x559d5
movq (%r12), %rsi
addq $0xc, %rsi
movq %rsi, (%r12)
movq 0x18(%r13), %rdx
addq $0x20, %rdx
leaq 0xca869(%rip), %rcx     # 0x120f0e
movq %r14, %rdi
callq 0x559d5
addq $0xc, (%r12)
movq 0x18(%r13), %rcx
movq 0x10(%rcx), %rax
testq %rax, %rax
setg 0x1(%rcx)
movq 0x10(%r13), %rcx
cmpq $0x0, 0x10(%rcx)
jle 0x566fd
movb $0x1, 0x1(%rcx)
movq 0x8(%rsp), %r12
movq 0x20(%r12), %rsi
movq %r14, %rdi
movq %r15, %rdx
callq 0x568d7
movq 0x10(%r13), %rax
cmpb $0x0, 0x2(%rax)
jne 0x5670b
movq 0x10(%rax), %rax
movq %rax, 0x18(%rbx)
movb $0x1, 0x10(%rbx)
jmp 0x5670b
testq %rax, %rax
setle 0x1(%rcx)
movq 0x8(%rsp), %r12
jle 0x566d5
movq 0x18(%r13), %rcx
cmpb $0x0, 0x1(%rcx)
je 0x5673b
movq 0x20(%r12), %rsi
movq %r14, %rdi
movq %r15, %rdx
callq 0x568d7
movq 0x18(%r13), %rax
cmpb $0x0, 0x2(%rax)
jne 0x5673b
movq 0x10(%rax), %rax
movq %rax, 0x40(%rbx)
movb $0x1, 0x38(%rbx)
movq %r13, 0x8(%rbx)
leaq 0x1ec(%rip), %rax       # 0x56932
movq %rax, 0x60(%rbx)
movq 0x18(%r15), %rax
testq %rax, %rax
je 0x56763
movq 0x8(%rax), %rsi
movq 0x10(%rax), %rdx
movq %rbx, %rdi
callq 0xfc530
movq %rbx, %rdi
callq 0xfc5b7
movq 0x10(%r13), %rsi
movq %r14, %rdi
callq 0xe8be2
movq 0x18(%r13), %rsi
movq %r14, %rdi
callq 0xe8be2
movq %r14, %rdi
movq %r13, %rsi
callq 0xe8be2
movq %rbx, %rdi
callq 0xfc4de
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq