// File: /workspace/github_c_makefile_star2_O1/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 0xe958c
cmpq $0x0, 0x28(%r14)
je 0x28833
leaq 0xec405(%rip), %rsi     # 0x114b07
movq %rbx, %rdi
movq %r15, %rdx
xorl %eax, %eax
callq 0xe9226
movq %rbx, %rdi
movl $0x1, %esi
callq 0xe9585
leaq 0x28(%rsp), %r13
leaq 0x10(%rsp), %rbp
leaq 0x48(%rsp), %rcx
movq %rbx, %rdi
movq %r13, %rsi
movq %rbp, %rdx
callq 0xfa6e0
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 0x28793
movq 0xa8(%r14), %rax
movq 0x18(%rax), %rdi
callq 0xf7557
leaq 0xec39c(%rip), %rsi     # 0x114b1d
movq %rbx, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0xe9df7
jmp 0x28833
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 0xf0ea4
cmpl $0x0, (%r13)
je 0x28805
movq 0xa8(%r14), %rax
movq 0x18(%rax), %rdi
callq 0xf7557
movq %rax, %r14
leaq 0x48(%rsp), %rsi
movq %rbx, %rdi
callq 0xfa6a8
leaq 0xec34e(%rip), %rsi     # 0x114b3e
movq %rbx, %rdi
movq %r14, %rdx
movq %r15, %rcx
movq %rax, %r8
xorl %eax, %eax
callq 0xe9df7
jmp 0x28833
movq 0x8(%r14), %rax
movq 0x48(%rax), %rdi
callq 0xebe2a
movl %eax, 0x44(%r14)
leaq 0xeca16(%rip), %rsi     # 0x115233
movq %rbx, %rdi
movl %eax, %edx
xorl %eax, %eax
callq 0xe9226
movl 0x44(%r14), %eax
cmpl 0x40(%r14), %eax
jne 0x28851
movl 0xc(%rsp), %esi
movq %rbx, %rdi
callq 0xe9595
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 0xf7557
leaq 0xec304(%rip), %rsi     # 0x114b6c
jmp 0x28781
nopl (%rax)