// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/installshld.c
// Function: do_instarch_member
static int do_instarch_member(deark *c, de_arch_lctx *da, struct de_arch_member_data *md)
{
	int retval = 0;
	int saved_indent_level;
	i64 pos = md->member_hdr_pos;
	i64 nlen;
	de_ucstring *tmps = NULL;

	de_dbg_indent_save(c, &saved_indent_level);
	de_dbg(c, "member at %"I64_FMT, md->member_hdr_pos);

	de_dbg_indent(c, 1);

	md->cmpr_pos = de_getu32le_p(&pos);
	de_dbg(c, "cmpr. data pos: %"I64_FMT, md->cmpr_pos);
	de_arch_read_field_cmpr_len_p(md, &pos);

	de_arch_read_field_orig_len_p(md, &pos);
	pos += 8; // Unused?

	nlen = de_getu16le_p(&pos);
	dbuf_read_to_ucstring(c->infile, pos, nlen, md->filename, 0, da->input_encoding);
	de_dbg(c, "name 1: \"%s\"", ucstring_getpsz_d(md->filename));
	pos += nlen;

	// I don't know why each file seemingly has two names.
	nlen = de_getu16le_p(&pos);
	tmps = ucstring_create(c);
	dbuf_read_to_ucstring(c->infile, pos, nlen, tmps, 0, da->input_encoding);
	de_dbg(c, "name 2: \"%s\"", ucstring_getpsz_d(tmps));
	pos += nlen;

	if(!de_arch_good_cmpr_data_pos(md)) {
		goto done;
	}

	md->dfn = dclimplode_decompressor_fn;
	de_arch_extract_member_file(md);

	md->member_hdr_size = pos - md->member_hdr_pos;
	retval = 1;
done:
	ucstring_destroy(tmps);
	de_dbg_indent_restore(c, saved_indent_level);
	return retval;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movl $0x0, -0x1c(%rbp)
movq -0x18(%rbp), %rax
movq 0x18(%rax), %rax
movq %rax, -0x28(%rbp)
movq $0x0, -0x38(%rbp)
movq -0x8(%rbp), %rdi
leaq -0x20(%rbp), %rsi
callq 0x15b580
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rax
movq 0x18(%rax), %rdx
leaq 0xd7b73(%rip), %rsi     # 0x1c7392
movb $0x0, %al
callq 0x15b0d0
movq -0x8(%rbp), %rdi
movl $0x1, %esi
callq 0x15b560
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
leaq -0x28(%rbp), %rsi
callq 0x165580
movq %rax, %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x40(%rax)
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rax
movq 0x40(%rax), %rdx
leaq 0xc2009(%rip), %rsi     # 0x1b186c
movb $0x0, %al
callq 0x15b0d0
movq -0x18(%rbp), %rdi
leaq -0x28(%rbp), %rsi
callq 0x17c400
movq -0x18(%rbp), %rdi
leaq -0x28(%rbp), %rsi
callq 0x17c350
movq -0x28(%rbp), %rax
addq $0x8, %rax
movq %rax, -0x28(%rbp)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
leaq -0x28(%rbp), %rsi
callq 0x1652c0
movq %rax, -0x30(%rbp)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x28(%rbp), %rsi
movq -0x30(%rbp), %rdx
movq -0x18(%rbp), %rax
movq 0x58(%rax), %rcx
movq -0x10(%rbp), %rax
movl 0x18(%rax), %r9d
xorl %r8d, %r8d
callq 0x1669f0
movq -0x8(%rbp), %rax
movq %rax, -0x48(%rbp)
movq -0x18(%rbp), %rax
movq 0x58(%rax), %rdi
callq 0x172650
movq -0x48(%rbp), %rdi
movq %rax, %rdx
leaq 0xcea61(%rip), %rsi     # 0x1be351
movb $0x0, %al
callq 0x15b0d0
movq -0x30(%rbp), %rax
addq -0x28(%rbp), %rax
movq %rax, -0x28(%rbp)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
leaq -0x28(%rbp), %rsi
callq 0x1652c0
movq %rax, -0x30(%rbp)
movq -0x8(%rbp), %rdi
callq 0x1711d0
movq %rax, -0x38(%rbp)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x28(%rbp), %rsi
movq -0x30(%rbp), %rdx
movq -0x38(%rbp), %rcx
movq -0x10(%rbp), %rax
movl 0x18(%rax), %r9d
xorl %r8d, %r8d
callq 0x1669f0
movq -0x8(%rbp), %rax
movq %rax, -0x40(%rbp)
movq -0x38(%rbp), %rdi
callq 0x172650
movq -0x40(%rbp), %rdi
movq %rax, %rdx
leaq 0xce9f6(%rip), %rsi     # 0x1be35e
movb $0x0, %al
callq 0x15b0d0
movq -0x30(%rbp), %rax
addq -0x28(%rbp), %rax
movq %rax, -0x28(%rbp)
movq -0x18(%rbp), %rdi
callq 0x17c7f0
cmpl $0x0, %eax
jne 0xef98b
jmp 0xef9c1
movq -0x18(%rbp), %rax
leaq -0x216(%rip), %rcx      # 0xef780
movq %rcx, 0xa8(%rax)
movq -0x18(%rbp), %rdi
callq 0x17c920
movq -0x28(%rbp), %rcx
movq -0x18(%rbp), %rax
subq 0x18(%rax), %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x20(%rax)
movl $0x1, -0x1c(%rbp)
movq -0x38(%rbp), %rdi
callq 0x171750
movq -0x8(%rbp), %rdi
movl -0x20(%rbp), %esi
callq 0x15b5a0
movl -0x1c(%rbp), %eax
addq $0x50, %rsp
popq %rbp
retq
nop