// File: /workspace/github_c_makefile_star2_O2/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 %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %rbx
leaq 0x14(%rsp), %rsi
callq 0xdebae
movq 0x18(%r14), %rdx
leaq 0xc12d7(%rip), %rsi     # 0x12e86d
xorl %ebp, %ebp
movq %rbx, %rdi
xorl %eax, %eax
callq 0xde896
pushq $0x1
popq %rsi
movq %rbx, %rdi
callq 0xdeba7
movq 0x18(%r14), %r12
movq %r12, 0x8(%rsp)
movq 0x18(%rbx), %rdi
leaq 0xab9c7(%rip), %rdx     # 0x118f88
pushq $0x2
popq %rcx
movq %r12, %rsi
callq 0xe4d48
testl %eax, %eax
jne 0x6d6f0
addq $0x4, %r12
leaq 0x8(%rsp), %r13
movq %r12, (%r13)
movq %r14, %rdi
movq %r13, %rsi
callq 0xf17ab
movq 0x18(%rbx), %rdi
movq %r13, %rsi
callq 0xe3fc4
leaq 0xc6855(%rip), %rsi     # 0x133e54
movq %rbx, %rdi
movl %eax, %edx
xorl %eax, %eax
callq 0xde896
cmpl $0x2, 0x58(%r15)
jl 0x6d637
movq 0x18(%rbx), %rdi
leaq 0x8(%rsp), %rsi
callq 0xe40bf
movl %eax, 0x48(%r14)
leaq 0xc97ea(%rip), %rsi     # 0x136e15
movq %rbx, %rdi
movl %eax, %edx
xorl %eax, %eax
callq 0xde896
leaq 0x8(%rsp), %r12
movq %r14, %rdi
movq %r12, %rsi
callq 0xf1849
movq 0x50(%r14), %rsi
addq $0x18, %rsi
leaq 0x9da90(%rip), %rdx     # 0x10b0e6
pushq $0x4
popq %rcx
movq %r15, %rdi
movq %r12, %r8
callq 0xf1866
movq %r14, %rdi
movq %r12, %rsi
callq 0xf1766
movq 0x18(%rbx), %rdi
movq (%r12), %rsi
movq 0x58(%r14), %rcx
movl 0x18(%r15), %r9d
pushq $0xc
popq %rdx
pushq $0x1
popq %rbp
movl %ebp, %r8d
callq 0xe4c9a
movq 0x58(%r14), %rdi
callq 0xeb877
leaq 0xc13c1(%rip), %rsi     # 0x12ea5e
movq %rbx, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0xde896
movq (%r12), %rdx
addq $0xd, %rdx
movq %rdx, (%r12)
movq %rdx, 0x40(%r14)
leaq 0xab5b5(%rip), %rsi     # 0x118c76
movq %rbx, %rdi
xorl %eax, %eax
callq 0xde896
leaq 0x3b(%rip), %rax        # 0x6d70d
movq %rax, 0xa8(%r14)
cmpl $0x2, 0x58(%r15)
jl 0x6d6e8
movb $0x1, 0xa1(%r14)
movq %r14, %rdi
callq 0xf1a85
movl 0x14(%rsp), %esi
movq %rbx, %rdi
callq 0xdebb7
movl %ebp, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq