// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/os2pack.c
// Function: do_os2pack1_ea
static void do_os2pack1_ea(deark *c, de_arch_lctx *d, struct de_arch_member_data *md,
	i64 ea_pos, i64 ea_len)
{
	int saved_indent_level;
	dbuf *attr_data = NULL;
	de_module_params *mparams = NULL;
	struct de_dfilter_in_params dcmpri;
	struct de_dfilter_out_params dcmpro;
	struct de_dfilter_results dres;

	de_dbg_indent_save(c, &saved_indent_level);
	de_dbg(c, "ext. attr. at %"I64_FMT, ea_pos);
	de_dbg_indent(c, 1);
	attr_data = dbuf_create_membuf(c, 0, 0);
	dbuf_set_length_limit(attr_data, 1024*1024);

	de_dfilter_init_objects(c, &dcmpri, &dcmpro, &dres);
	dcmpri.f = c->infile;
	dcmpri.pos = ea_pos;
	dcmpri.len = ea_len;
	dcmpro.f = attr_data;
	fmtutil_ibmlzw_codectype1(c, &dcmpri, &dcmpro, &dres, NULL);
	dbuf_flush(attr_data);
	if(dres.errcode) {
		de_warn(c, "Failed to decompress ext. attr. data");
		goto done;
	}
	de_dbg(c, "decompressed len: %"I64_FMT, attr_data->len);

	mparams = de_malloc(c, sizeof(de_module_params));
	mparams->in_params.codes = "R";
	if(ucstring_isnonempty(md->filename)) {
		mparams->in_params.str1 = md->filename;
		mparams->in_params.flags |= 0x8;
	}
	de_run_module_by_id_on_slice(c, "ea_data", mparams, attr_data, 0, attr_data->len);

done:
	dbuf_close(attr_data);
	de_free(c, mparams);
	de_dbg_indent_restore(c, saved_indent_level);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xe0, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq %r8, -0x28(%rbp)
movq $0x0, -0x38(%rbp)
movq $0x0, -0x40(%rbp)
movq -0x8(%rbp), %rdi
leaq -0x2c(%rbp), %rsi
callq 0x15b580
movq -0x8(%rbp), %rdi
movq -0x20(%rbp), %rdx
leaq 0xd3b91(%rip), %rsi     # 0x1bd8ec
movb $0x0, %al
callq 0x15b0d0
movq -0x8(%rbp), %rdi
movl $0x1, %esi
callq 0x15b560
movq -0x8(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
xorl %edx, %edx
callq 0x168020
movq %rax, -0x38(%rbp)
movq -0x38(%rbp), %rdi
movl $0x100000, %esi         # imm = 0x100000
callq 0x168120
movq -0x8(%rbp), %rdi
leaq -0x60(%rbp), %rsi
leaq -0x78(%rbp), %rdx
leaq -0xd8(%rbp), %rcx
callq 0x1773f0
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rax
movq %rax, -0x60(%rbp)
movq -0x20(%rbp), %rax
movq %rax, -0x58(%rbp)
movq -0x28(%rbp), %rax
movq %rax, -0x50(%rbp)
movq -0x38(%rbp), %rax
movq %rax, -0x78(%rbp)
movq -0x8(%rbp), %rdi
leaq -0x60(%rbp), %rsi
leaq -0x78(%rbp), %rdx
leaq -0xd8(%rbp), %rcx
xorl %eax, %eax
movl %eax, %r8d
callq 0x184720
movq -0x38(%rbp), %rdi
callq 0x167c30
cmpl $0x0, -0xd8(%rbp)
je 0xe9e13
movq -0x8(%rbp), %rdi
leaq 0xd3af7(%rip), %rsi     # 0x1bd8fe
movb $0x0, %al
callq 0x15bc10
jmp 0xe9ea1
movq -0x8(%rbp), %rdi
movq -0x38(%rbp), %rax
movq 0x18(%rax), %rdx
leaq 0xbfb81(%rip), %rsi     # 0x1a99a7
movb $0x0, %al
callq 0x15b0d0
movq -0x8(%rbp), %rdi
movl $0x70, %esi
callq 0x15b780
movq %rax, -0x40(%rbp)
movq -0x40(%rbp), %rax
leaq 0xedd29(%rip), %rcx     # 0x1d7b73
movq %rcx, (%rax)
movq -0x18(%rbp), %rax
movq 0x58(%rax), %rdi
callq 0x1717f0
cmpl $0x0, %eax
je 0xe9e7c
movq -0x18(%rbp), %rax
movq 0x58(%rax), %rcx
movq -0x40(%rbp), %rax
movq %rcx, 0x30(%rax)
movq -0x40(%rbp), %rax
movl 0x8(%rax), %ecx
orl $0x8, %ecx
movl %ecx, 0x8(%rax)
movq -0x8(%rbp), %rdi
movq -0x40(%rbp), %rdx
movq -0x38(%rbp), %rcx
movq -0x38(%rbp), %rax
movq 0x18(%rax), %r9
leaq 0xc4563(%rip), %rsi     # 0x1ae3fa
xorl %eax, %eax
movl %eax, %r8d
callq 0x15c9f0
movq -0x38(%rbp), %rdi
callq 0x1676a0
movq -0x8(%rbp), %rdi
movq -0x40(%rbp), %rsi
callq 0x15b820
movq -0x8(%rbp), %rdi
movl -0x2c(%rbp), %esi
callq 0x15b5a0
addq $0xe0, %rsp
popq %rbp
retq
nopl (%rax)