// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/fat.c
// Function: do_extract_file
static void do_extract_file(deark *c, lctx *d, struct member_data *md)
{
	dbuf *outf = NULL;
	de_finfo *fi = NULL;
	de_ucstring *fullfn = NULL;

	if(!md->is_subdir) {
		if(md->filesize > d->num_data_region_clusters * d->bytes_per_cluster) {
			de_err(c, "%s: Bad file size", ucstring_getpsz_d(md->short_fn));
			goto done;
		}
	}

	fi = de_finfo_create(c);
	fullfn = ucstring_create(c);
	de_strarray_make_path(d->curpath, fullfn, DE_MPFLAG_NOTRAILINGSLASH);
	de_finfo_set_name_from_ucstring(c, fi, fullfn, DE_SNFLAG_FULLPATH);
	fi->original_filename_flag = 1;
	if(md->is_subdir) {
		fi->is_directory = 1;
	}
	else if(md->is_volume_label) {
		fi->is_volume_label = 1;
	}
	if(md->mod_time.is_valid) {
		fi->timestamp[DE_TIMESTAMPIDX_MODIFY] = md->mod_time;
	}

	outf = dbuf_create_output_file(c, NULL, fi, 0);

	if(!extract_file_lowlevel(c, d, md, outf)) {
		de_err(c, "%s: File extraction failed", ucstring_getpsz_d(md->short_fn));
		goto done;
	}

done:
	dbuf_close(outf);
	ucstring_destroy(fullfn);
	de_finfo_destroy(c, fi);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq $0x0, -0x20(%rbp)
movq $0x0, -0x28(%rbp)
movq $0x0, -0x30(%rbp)
movq -0x18(%rbp), %rax
cmpb $0x0, 0xb(%rax)
jne 0x84f35
movq -0x18(%rbp), %rax
movq 0x28(%rax), %rax
movq -0x10(%rbp), %rcx
movq 0x48(%rcx), %rcx
movq -0x10(%rbp), %rdx
imulq 0x28(%rdx), %rcx
cmpq %rcx, %rax
jle 0x84f33
movq -0x8(%rbp), %rax
movq %rax, -0x38(%rbp)
movq -0x18(%rbp), %rax
movq 0x38(%rax), %rdi
callq 0x172650
movq -0x38(%rbp), %rdi
movq %rax, %rdx
leaq 0x1294db(%rip), %rsi    # 0x1ae402
movb $0x0, %al
callq 0x15bfb0
jmp 0x8502f
jmp 0x84f35
movq -0x8(%rbp), %rdi
callq 0x15d230
movq %rax, -0x28(%rbp)
movq -0x8(%rbp), %rdi
callq 0x1711d0
movq %rax, -0x30(%rbp)
movq -0x10(%rbp), %rax
movq 0x80(%rax), %rdi
movq -0x30(%rbp), %rsi
movl $0x1, %edx
callq 0x1729c0
movq -0x8(%rbp), %rdi
movq -0x28(%rbp), %rsi
movq -0x30(%rbp), %rdx
movl $0x1, %ecx
callq 0x15d2c0
movq -0x28(%rbp), %rax
movb $0x1, 0x8(%rax)
movq -0x18(%rbp), %rax
cmpb $0x0, 0xb(%rax)
je 0x84f9a
movq -0x28(%rbp), %rax
movb $0x1, 0x9(%rax)
jmp 0x84fae
movq -0x18(%rbp), %rax
cmpb $0x0, 0xc(%rax)
je 0x84fac
movq -0x28(%rbp), %rax
movb $0x1, 0xa(%rax)
jmp 0x84fae
movq -0x18(%rbp), %rax
cmpb $0x0, 0x48(%rax)
je 0x84fd0
movq -0x28(%rbp), %rax
movq -0x18(%rbp), %rcx
movq 0x48(%rcx), %rdx
movq %rdx, 0x18(%rax)
movq 0x50(%rcx), %rcx
movq %rcx, 0x20(%rax)
movq -0x8(%rbp), %rdi
movq -0x28(%rbp), %rdx
xorl %eax, %eax
movl %eax, %esi
xorl %ecx, %ecx
callq 0x166c60
movq %rax, -0x20(%rbp)
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
movq -0x20(%rbp), %rcx
callq 0x85270
cmpl $0x0, %eax
jne 0x8502d
movq -0x8(%rbp), %rax
movq %rax, -0x40(%rbp)
movq -0x18(%rbp), %rax
movq 0x38(%rax), %rdi
callq 0x172650
movq -0x40(%rbp), %rdi
movq %rax, %rdx
leaq 0x1293f0(%rip), %rsi    # 0x1ae414
movb $0x0, %al
callq 0x15bfb0
jmp 0x8502f
jmp 0x8502f
movq -0x20(%rbp), %rdi
callq 0x1676a0
movq -0x30(%rbp), %rdi
callq 0x171750
movq -0x8(%rbp), %rdi
movq -0x28(%rbp), %rsi
callq 0x15d260
addq $0x40, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)