// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0xf0, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x8(%rbp), %rax
movq (%rax), %rax
movq %rax, -0xb8(%rbp)
movq -0xb8(%rbp), %rdi
leaq -0xbc(%rbp), %rsi
callq 0x15b580
movq -0x8(%rbp), %rax
cmpq $0x0, 0x28(%rax)
jne 0x32df8
jmp 0x33003
movq -0xb8(%rbp), %rdi
movq -0x18(%rbp), %rdx
leaq 0x16dba4(%rip), %rsi    # 0x1a09ae
movb $0x0, %al
callq 0x15b0d0
movq -0xb8(%rbp), %rdi
movl $0x1, %esi
callq 0x15b560
movq -0xb8(%rbp), %rdi
leaq -0x38(%rbp), %rsi
leaq -0x50(%rbp), %rdx
leaq -0xb0(%rbp), %rcx
callq 0x1773f0
movq -0xb8(%rbp), %rax
movq 0x18(%rax), %rax
movq %rax, -0x38(%rbp)
movq -0x8(%rbp), %rax
movq 0x30(%rax), %rax
movq %rax, -0x30(%rbp)
movq -0x8(%rbp), %rax
movq 0x38(%rax), %rax
movq %rax, -0x28(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x50(%rbp)
movb $0x1, -0x48(%rbp)
movq -0x8(%rbp), %rax
movq 0x28(%rax), %rax
movq %rax, -0x40(%rbp)
movq -0x30(%rbp), %rax
addq -0x28(%rbp), %rax
movq -0x38(%rbp), %rcx
cmpq 0x18(%rcx), %rax
jle 0x32ecd
movq -0xb8(%rbp), %rax
movq %rax, -0xc8(%rbp)
movq -0x8(%rbp), %rax
movq 0xa8(%rax), %rax
movq 0x18(%rax), %rdi
callq 0x172650
movq -0xc8(%rbp), %rdi
movq %rax, %rdx
leaq 0x16db03(%rip), %rsi    # 0x1a09c4
movb $0x0, %al
callq 0x15bfb0
jmp 0x33003
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rax
movq 0x10(%rax), %rax
movq -0xb8(%rbp), %rdi
movq -0x8(%rbp), %rcx
movq 0x8(%rcx), %rsi
movq -0x8(%rbp), %rdx
leaq -0x38(%rbp), %rcx
leaq -0x50(%rbp), %r8
leaq -0xb0(%rbp), %r9
callq *%rax
movq -0x50(%rbp), %rdi
callq 0x167c30
cmpl $0x0, -0xb0(%rbp)
je 0x32f81
movq -0xb8(%rbp), %rax
movq %rax, -0xe0(%rbp)
movq -0x8(%rbp), %rax
movq 0xa8(%rax), %rax
movq 0x18(%rax), %rdi
callq 0x172650
movq %rax, -0xd8(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0xd0(%rbp)
movq -0xb8(%rbp), %rdi
leaq -0xb0(%rbp), %rsi
callq 0x177360
movq -0xe0(%rbp), %rdi
movq -0xd8(%rbp), %rdx
movq -0xd0(%rbp), %rcx
movq %rax, %r8
leaq 0x16da70(%rip), %rsi    # 0x1a09e5
movb $0x0, %al
callq 0x15bfb0
jmp 0x33003
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
movq 0x48(%rax), %rdi
callq 0x15f340
movl %eax, %ecx
movq -0x8(%rbp), %rax
movl %ecx, 0x44(%rax)
movq -0xb8(%rbp), %rdi
movq -0x8(%rbp), %rax
movl 0x44(%rax), %edx
leaq 0x16e0d7(%rip), %rsi    # 0x1a1087
movb $0x0, %al
callq 0x15b0d0
movq -0x8(%rbp), %rax
movl 0x44(%rax), %eax
movq -0x8(%rbp), %rcx
cmpl 0x40(%rcx), %eax
je 0x33001
movq -0xb8(%rbp), %rax
movq %rax, -0xe8(%rbp)
movq -0x8(%rbp), %rax
movq 0xa8(%rax), %rax
movq 0x18(%rax), %rdi
callq 0x172650
movq -0xe8(%rbp), %rdi
movq %rax, %rdx
leaq 0x16da19(%rip), %rsi    # 0x1a0a13
movb $0x0, %al
callq 0x15bfb0
jmp 0x33003
movq -0xb8(%rbp), %rdi
movl -0xbc(%rbp), %esi
callq 0x15b5a0
addq $0xf0, %rsp
popq %rbp
retq
nop