// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/zip.c
// Function: do_decompress_member
static int do_decompress_member(deark *c, lctx *d, struct member_data *md, dbuf *outf)
{
	struct dir_entry_data *ldd = &md->local_dir_entry_data;
	struct de_dfilter_in_params dcmpri;
	struct de_dfilter_out_params dcmpro;
	struct de_dfilter_results dres;
	u32 crc_calculated;
	int retval = 0;

	de_dfilter_init_objects(c, &dcmpri, &dcmpro, &dres);
	dcmpri.f = c->infile;
	dcmpri.pos = md->file_data_pos;
	dcmpri.len = md->cmpr_size;
	dcmpro.f = outf;
	dcmpro.expected_len = md->uncmpr_size;
	dcmpro.len_known = 1;

	dbuf_set_writelistener(outf, de_writelistener_for_crc, (void*)d->crco);
	de_crcobj_reset(d->crco);

	do_decompress_lowlevel(c, d, &dcmpri, &dcmpro, &dres, ldd->cmpr_meth,
		ldd->cmi, ldd->bit_flags);

	if(dres.errcode) {
		de_err(c, "%s: %s", ucstring_getpsz_d(ldd->fname),
			de_dfilter_get_errmsg(c, &dres));
		goto done;
	}

	crc_calculated = de_crcobj_getval(d->crco);
	de_dbg(c, "crc (calculated): 0x%08x", (UI)crc_calculated);

	if(crc_calculated != md->crc_reported) {
		de_err(c, "%s: CRC check failed: Expected 0x%08x, got 0x%08x",
			ucstring_getpsz_d(ldd->fname),
			(UI)md->crc_reported, (UI)crc_calculated);
		if(dres.bytes_consumed_valid && (dres.bytes_consumed < dcmpri.len)) {
			de_info(c, "Note: Only used %"I64_FMT" of %"I64_FMT" compressed bytes.",
				dres.bytes_consumed, dcmpri.len);
		}
		goto done;
	}

	retval = 1;
done:
	return retval;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xf0, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq -0x18(%rbp), %rax
addq $0x148, %rax            # imm = 0x148
movq %rax, -0x28(%rbp)
movl $0x0, -0xc8(%rbp)
movq -0x8(%rbp), %rdi
leaq -0x48(%rbp), %rsi
leaq -0x60(%rbp), %rdx
leaq -0xc0(%rbp), %rcx
callq 0x1773f0
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rax
movq %rax, -0x48(%rbp)
movq -0x18(%rbp), %rax
movq 0x28(%rax), %rax
movq %rax, -0x40(%rbp)
movq -0x18(%rbp), %rax
movq 0x198(%rax), %rax
movq %rax, -0x38(%rbp)
movq -0x20(%rbp), %rax
movq %rax, -0x60(%rbp)
movq -0x18(%rbp), %rax
movq 0x1a0(%rax), %rax
movq %rax, -0x50(%rbp)
movb $0x1, -0x58(%rbp)
movq -0x20(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0xb8(%rax), %rdx
leaq 0x1c25d(%rip), %rsi     # 0x1692d0
callq 0x169280
movq -0x10(%rbp), %rax
movq 0xb8(%rax), %rdi
callq 0x15f250
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x28(%rbp), %rax
movl 0x20(%rax), %r9d
movq -0x28(%rbp), %rax
movq 0x28(%rax), %r10
movq -0x28(%rbp), %rax
movl 0x30(%rax), %eax
leaq -0x48(%rbp), %rdx
leaq -0x60(%rbp), %rcx
leaq -0xc0(%rbp), %r8
movq %r10, (%rsp)
movl %eax, 0x8(%rsp)
callq 0x14c620
cmpl $0x0, -0xc0(%rbp)
je 0x14d11f
movq -0x8(%rbp), %rax
movq %rax, -0xd8(%rbp)
movq -0x28(%rbp), %rax
movq 0x48(%rax), %rdi
callq 0x172650
movq %rax, -0xd0(%rbp)
movq -0x8(%rbp), %rdi
leaq -0xc0(%rbp), %rsi
callq 0x177360
movq -0xd8(%rbp), %rdi
movq -0xd0(%rbp), %rdx
movq %rax, %rcx
leaq 0x87db3(%rip), %rsi     # 0x1d4ec6
movb $0x0, %al
callq 0x15bfb0
jmp 0x14d1e2
movq -0x10(%rbp), %rax
movq 0xb8(%rax), %rdi
callq 0x15f340
movl %eax, -0xc4(%rbp)
movq -0x8(%rbp), %rdi
movl -0xc4(%rbp), %edx
leaq 0x56f61(%rip), %rsi     # 0x1a40a7
movb $0x0, %al
callq 0x15b0d0
movl -0xc4(%rbp), %eax
movq -0x18(%rbp), %rcx
cmpl 0x1a8(%rcx), %eax
je 0x14d1d8
movq -0x8(%rbp), %rax
movq %rax, -0xe0(%rbp)
movq -0x28(%rbp), %rax
movq 0x48(%rax), %rdi
callq 0x172650
movq -0xe0(%rbp), %rdi
movq %rax, %rdx
movq -0x18(%rbp), %rax
movl 0x1a8(%rax), %ecx
movl -0xc4(%rbp), %r8d
leaq 0x82dfa(%rip), %rsi     # 0x1cff93
movb $0x0, %al
callq 0x15bfb0
movzbl -0xbc(%rbp), %eax
cmpl $0x0, %eax
je 0x14d1d6
movq -0xb8(%rbp), %rax
cmpq -0x38(%rbp), %rax
jge 0x14d1d6
movq -0x8(%rbp), %rdi
movq -0xb8(%rbp), %rdx
movq -0x38(%rbp), %rcx
leaq 0x82df6(%rip), %rsi     # 0x1cffc5
movb $0x0, %al
callq 0x15c0c0
jmp 0x14d1e2
movl $0x1, -0xc8(%rbp)
movl -0xc8(%rbp), %eax
addq $0xf0, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)