// File: /workspace/github_c_makefile_star2_O1/jsummers[P]deark/modules/misc3.c
// Function: do_qip_member
static int do_qip_member(deark *c, de_arch_lctx *d, struct de_arch_member_data *md)
{
	int saved_indent_level;
	i64 pos;
	UI index;
	int retval = 0;

	de_dbg_indent_save(c, &saved_indent_level);
	de_dbg(c, "member at %"I64_FMT, md->member_hdr_pos);
	de_dbg_indent(c, 1);
	pos = md->member_hdr_pos;
	if(dbuf_memcmp(c->infile, pos, "QD", 2)) goto done;
	pos += 2;
	retval = 1;
	pos += 2; // ?
	de_arch_read_field_cmpr_len_p(md, &pos);
	index = (UI)de_getu16le_p(&pos); // ?
	de_dbg(c, "index: %u", index);

	if(d->fmtver>=2) {
		md->crc_reported = (u32)de_getu32le_p(&pos);
		de_dbg(c, "crc (reported): 0x%08x", (UI)md->crc_reported);
	}

	de_arch_read_field_dos_attr_p(md, &pos); // ?

	de_arch_read_field_dttm_p(d, &md->fi->timestamp[DE_TIMESTAMPIDX_MODIFY], "mod",
		DE_ARCH_TSTYPE_DOS_TD, &pos);
	de_arch_read_field_orig_len_p(md, &pos);
	dbuf_read_to_ucstring(c->infile, pos, 12, md->filename, DE_CONVFLAG_STOP_AT_NUL,
		d->input_encoding);
	de_dbg(c, "filename: \"%s\"", ucstring_getpsz_d(md->filename));
	pos += 12;
	pos += 1; // Maybe to allow the name to always be NUL terminated?

	md->cmpr_pos = pos;
	de_dbg(c, "cmpr data at %"I64_FMT, md->cmpr_pos);
	md->dfn = dclimplode_decompressor_fn;
	if(d->fmtver>=2) {
		md->validate_crc = 1;
	}

	de_arch_extract_member_file(md);

done:
	de_dbg_indent_restore(c, saved_indent_level);
	return retval;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x10, %rsp
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %rbx
leaq 0xc(%rsp), %rsi
callq 0xe958c
movq 0x18(%r14), %rdx
leaq 0xca0c1(%rip), %rsi     # 0x13b7e3
xorl %ebp, %ebp
movq %rbx, %rdi
xorl %eax, %eax
callq 0xe9226
movq %rbx, %rdi
movl $0x1, %esi
callq 0xe9585
movq 0x18(%r14), %rsi
movq %rsi, (%rsp)
movq 0x18(%rbx), %rdi
leaq 0xb480a(%rip), %rdx     # 0x125f58
movl $0x2, %ecx
callq 0xf025e
testl %eax, %eax
jne 0x7187c
movq %rsp, %r12
addq $0x4, (%r12)
movq %r14, %rdi
movq %r12, %rsi
callq 0xfdbe0
movq 0x18(%rbx), %rdi
movq %r12, %rsi
callq 0xef1ed
leaq 0xcf63e(%rip), %rsi     # 0x140dc4
movq %rbx, %rdi
movl %eax, %edx
xorl %eax, %eax
callq 0xe9226
cmpl $0x2, 0x58(%r15)
jl 0x717bc
movq 0x18(%rbx), %rdi
movq %rsp, %rsi
callq 0xef3a0
movl %eax, 0x48(%r14)
leaq 0xd25d5(%rip), %rsi     # 0x143d85
movq %rbx, %rdi
movl %eax, %edx
xorl %eax, %eax
callq 0xe9226
movq %rsp, %r12
movq %r14, %rdi
movq %r12, %rsi
callq 0xfdc7e
movq 0x50(%r14), %rsi
addq $0x18, %rsi
leaq 0xa68c5(%rip), %rdx     # 0x11809e
movq %r15, %rdi
movl $0x4, %ecx
movq %r12, %r8
callq 0xfdc9b
movq %r14, %rdi
movq %r12, %rsi
callq 0xfdb9b
movq 0x18(%rbx), %rdi
movq (%r12), %rsi
movq 0x58(%r14), %rcx
movl 0x18(%r15), %r9d
movl $0x1, %ebp
movl $0xc, %edx
movl $0x1, %r8d
callq 0xf01b0
movq 0x58(%r14), %rdi
callq 0xf7557
leaq 0xca1ab(%rip), %rsi     # 0x13b9d4
movq %rbx, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0xe9226
movq (%r12), %rdx
addq $0xd, %rdx
movq %rdx, (%r12)
movq %rdx, 0x40(%r14)
leaq 0xb43f9(%rip), %rsi     # 0x125c46
movq %rbx, %rdi
xorl %eax, %eax
callq 0xe9226
leaq 0x39(%rip), %rax        # 0x71897
movq %rax, 0xa8(%r14)
cmpl $0x2, 0x58(%r15)
jl 0x71874
movb $0x1, 0xa1(%r14)
movq %r14, %rdi
callq 0xfdec1
movl 0xc(%rsp), %esi
movq %rbx, %rdi
callq 0xe9595
movl %ebp, %eax
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq