// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/modules/arc.c
// Function: do_decompress_fork_arcmac
static void do_decompress_fork_arcmac(struct member_data *md,
	dbuf *outf, const char *fork_name)
{
	struct de_dfilter_in_params dcmpri;
	struct de_dfilter_out_params dcmpro;
	struct de_dfilter_results dres;
	deark *c = md->c;
	int saved_indent_level;

	de_dbg_indent_save(c, &saved_indent_level);
	if(md->orig_size==0) goto done;

	de_dbg(c, "decompressing %s fork", fork_name);
	de_dbg_indent(c, 1);

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

	if(dcmpri.pos + dcmpri.len > dcmpri.f->len) {
		de_err(c, "%s: Data goes beyond end of file", ucstring_getpsz_d(md->arcmac_fn->str));
		goto done;
	}

	md->cmi->decompressor(c, md->d, md, &dcmpri, &dcmpro, &dres);
	dbuf_flush(dcmpro.f);
	if(dres.errcode) {
		de_err(c, "Decompression failed for file %s[%s fork]: %s",
			ucstring_getpsz_d(md->arcmac_fn->str),
			fork_name, de_dfilter_get_errmsg(c, &dres));
		goto done;
	}

	md->crc_calc = de_crcobj_getval(md->d->crco);
	de_dbg(c, "crc (calculated): 0x%04x", (unsigned int)md->crc_calc);

	if(md->crc_calc!=md->crc_reported) {
		de_err(c, "%s: CRC check failed", ucstring_getpsz_d(md->arcmac_fn->str));
	}

done:
	de_dbg_indent_restore(c, saved_indent_level);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xa8, %rsp
movq %rdx, %r15
movq %rsi, %r12
movq %rdi, %r14
movq (%rdi), %rbx
leaq 0xc(%rsp), %rsi
movq %rbx, %rdi
callq 0xe8a1c
cmpq $0x0, 0x28(%r14)
je 0x287fb
leaq 0xec518(%rip), %rsi     # 0x114be2
movq %rbx, %rdi
movq %r15, %rdx
xorl %eax, %eax
callq 0xe8617
movq %rbx, %rdi
movl $0x1, %esi
callq 0xe8a15
leaq 0x28(%rsp), %r13
leaq 0x10(%rsp), %rbp
leaq 0x48(%rsp), %rcx
movq %rbx, %rdi
movq %r13, %rsi
movq %rbp, %rdx
callq 0xfa1dc
movq 0x18(%rbx), %rax
movq %rax, (%r13)
movq 0x30(%r14), %rcx
movq %rcx, 0x8(%r13)
movq 0x38(%r14), %rdx
movq %rdx, 0x10(%r13)
movq %r12, (%rbp)
movb $0x1, 0x8(%rbp)
movq 0x28(%r14), %rsi
movq %rsi, 0x10(%rbp)
addq %rcx, %rdx
cmpq 0x18(%rax), %rdx
jle 0x2875b
movq 0xa8(%r14), %rax
movq 0x18(%rax), %rdi
callq 0xf70f6
leaq 0xec4af(%rip), %rsi     # 0x114bf8
movq %rbx, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0xe9295
jmp 0x287fb
movq 0x8(%r14), %rsi
movq 0x18(%r14), %rax
leaq 0x28(%rsp), %rcx
leaq 0x10(%rsp), %r12
leaq 0x48(%rsp), %r13
movq %rbx, %rdi
movq %r14, %rdx
movq %r12, %r8
movq %r13, %r9
callq *0x10(%rax)
movq (%r12), %rdi
callq 0xf08ba
cmpl $0x0, (%r13)
je 0x287cd
movq 0xa8(%r14), %rax
movq 0x18(%rax), %rdi
callq 0xf70f6
movq %rax, %r14
leaq 0x48(%rsp), %rsi
movq %rbx, %rdi
callq 0xfa1a4
leaq 0xec461(%rip), %rsi     # 0x114c19
movq %rbx, %rdi
movq %r14, %rdx
movq %r15, %rcx
movq %rax, %r8
xorl %eax, %eax
callq 0xe9295
jmp 0x287fb
movq 0x8(%r14), %rax
movq 0x48(%rax), %rdi
callq 0xeb865
movl %eax, 0x44(%r14)
leaq 0xecafe(%rip), %rsi     # 0x1152e3
movq %rbx, %rdi
movl %eax, %edx
xorl %eax, %eax
callq 0xe8617
movl 0x44(%r14), %eax
cmpl 0x40(%r14), %eax
jne 0x28819
movl 0xc(%rsp), %esi
movq %rbx, %rdi
callq 0xe8a25
addq $0xa8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0xa8(%r14), %rax
movq 0x18(%rax), %rdi
callq 0xf70f6
leaq 0xec417(%rip), %rsi     # 0x114c47
jmp 0x28749
nopl (%rax)