// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/src/fmtutil-zip.c
// Function: fmtutil_decompress_zip_reduce
void fmtutil_decompress_zip_reduce(deark *c, struct de_dfilter_in_params *dcmpri,
	struct de_dfilter_out_params *dcmpro, struct de_dfilter_results *dres,
	struct de_zipreduce_params *params)
{
	int retval = 0;
	ozur_ctx *ozur = NULL;
	struct ozXX_udatatype uctx;
	static const char *modname = "unreduce";

	if(!dcmpro->len_known) goto done;

	de_zeromem(&uctx, sizeof(struct ozXX_udatatype));
	uctx.c = c;
	uctx.inf = dcmpri->f;
	uctx.inf_curpos = dcmpri->pos;
	uctx.outf = dcmpro->f;

	ozur = de_malloc(c, sizeof(ozur_ctx));
	ozur->userdata = (void*)&uctx;
	ozur->cb_read = my_ozur_read;
	ozur->cb_write = my_ozur_write;
	ozur->cb_post_follower_sets = my_ozur_post_follower_sets_hook;

	ozur->cmpr_size = dcmpri->len;
	ozur->uncmpr_size = dcmpro->expected_len;
	ozur->cmpr_factor = params->cmpr_factor;

	ozur_run(ozur);

	if(ozur->error_code) {
		de_dfilter_set_errorf(c, dres, modname, "Decompression failed (code %d)",
			ozur->error_code);
	}
	else {
		dres->bytes_consumed = ozur->cmpr_nbytes_consumed;
		dres->bytes_consumed_valid = 1;
		retval = 1;
	}

done:
	de_free(c, ozur);
	if(retval==0 && !dres->errcode) {
		de_dfilter_set_generic_error(c, dres, modname);
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq %r8, -0x28(%rbp)
movl $0x0, -0x2c(%rbp)
movq $0x0, -0x38(%rbp)
movq -0x18(%rbp), %rax
cmpb $0x0, 0x8(%rax)
jne 0x17cdea
jmp 0x17cef6
leaq -0x60(%rbp), %rdi
xorl %esi, %esi
movl $0x28, %edx
callq 0x19140
movq -0x8(%rbp), %rax
movq %rax, -0x60(%rbp)
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x58(%rbp)
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x50(%rbp)
movq -0x18(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x48(%rbp)
movq -0x8(%rbp), %rdi
movl $0x3690, %esi           # imm = 0x3690
callq 0x15b780
movq %rax, -0x38(%rbp)
movq -0x38(%rbp), %rax
leaq -0x60(%rbp), %rcx
movq %rcx, (%rax)
movq -0x38(%rbp), %rax
leaq 0xe4(%rip), %rcx        # 0x17cf30
movq %rcx, 0x20(%rax)
movq -0x38(%rbp), %rax
leaq 0x105(%rip), %rcx       # 0x17cf60
movq %rcx, 0x28(%rax)
movq -0x38(%rbp), %rax
leaq 0x126(%rip), %rcx       # 0x17cf90
movq %rcx, 0x30(%rax)
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rcx
movq -0x38(%rbp), %rax
movq %rcx, 0x10(%rax)
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rcx
movq -0x38(%rbp), %rax
movq %rcx, 0x18(%rax)
movq -0x28(%rbp), %rax
movl (%rax), %ecx
movq -0x38(%rbp), %rax
movl %ecx, 0x8(%rax)
movq -0x38(%rbp), %rdi
callq 0x17cfd0
movq -0x38(%rbp), %rax
cmpl $0x0, 0x38(%rax)
je 0x17ced5
movq -0x8(%rbp), %rdi
movq -0x20(%rbp), %rsi
movq 0xa8c9b(%rip), %rdx     # 0x225b58
movq -0x38(%rbp), %rax
movl 0x38(%rax), %r8d
leaq 0x59b0d(%rip), %rcx     # 0x1d69d9
movb $0x0, %al
callq 0x177450
jmp 0x17cef4
movq -0x38(%rbp), %rax
movq 0x48(%rax), %rcx
movq -0x20(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x20(%rbp), %rax
movb $0x1, 0x4(%rax)
movl $0x1, -0x2c(%rbp)
jmp 0x17cef6
movq -0x8(%rbp), %rdi
movq -0x38(%rbp), %rsi
callq 0x15b820
cmpl $0x0, -0x2c(%rbp)
jne 0x17cf26
movq -0x20(%rbp), %rax
cmpl $0x0, (%rax)
jne 0x17cf26
movq -0x8(%rbp), %rdi
movq -0x20(%rbp), %rsi
movq 0xa8c37(%rip), %rdx     # 0x225b58
callq 0x177560
addq $0x60, %rsp
popq %rbp
retq
nopl (%rax)