// File: /workspace/github_c_makefile_star2_O3/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 0xe8a1c
movq 0x18(%r14), %rdx
leaq 0xca6ec(%rip), %rsi     # 0x13bb5d
xorl %ebp, %ebp
movq %rbx, %rdi
xorl %eax, %eax
callq 0xe8617
movq %rbx, %rdi
movl $0x1, %esi
callq 0xe8a15
movq 0x18(%r14), %r12
movq %r12, 0x8(%rsp)
movq 0x18(%rbx), %rdi
leaq 0xb4cea(%rip), %rdx     # 0x126188
movl $0x2, %ecx
movq %r12, %rsi
callq 0xefc85
testl %eax, %eax
jne 0x715d8
addq $0x4, %r12
leaq 0x8(%rsp), %r13
movq %r12, (%r13)
movq %r14, %rdi
movq %r13, %rsi
callq 0xfd57d
movq 0x18(%rbx), %rdi
movq %r13, %rsi
callq 0xeebeb
leaq 0xcfce6(%rip), %rsi     # 0x1411c4
movq %rbx, %rdi
movl %eax, %edx
xorl %eax, %eax
callq 0xe8617
cmpl $0x2, 0x58(%r15)
jl 0x71516
movq 0x18(%rbx), %rdi
leaq 0x8(%rsp), %rsi
callq 0xeed83
movl %eax, 0x48(%r14)
leaq 0xd2d5b(%rip), %rsi     # 0x144265
movq %rbx, %rdi
movl %eax, %edx
xorl %eax, %eax
callq 0xe8617
leaq 0x8(%rsp), %r12
movq %r14, %rdi
movq %r12, %rsi
callq 0xfd61b
movq 0x50(%r14), %rsi
addq $0x18, %rsi
leaq 0xa6ca1(%rip), %rdx     # 0x1181d6
movq %r15, %rdi
movl $0x4, %ecx
movq %r12, %r8
callq 0xfd638
movq %r14, %rdi
movq %r12, %rsi
callq 0xfd538
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 0xefbd7
movq 0x58(%r14), %rdi
callq 0xf70f6
leaq 0xca7c9(%rip), %rsi     # 0x13bd4e
movq %rbx, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0xe8617
movq (%r12), %rdx
addq $0xd, %rdx
movq %rdx, (%r12)
movq %rdx, 0x40(%r14)
leaq 0xb48cd(%rip), %rsi     # 0x125e76
movq %rbx, %rdi
xorl %eax, %eax
callq 0xe8617
leaq 0x3b(%rip), %rax        # 0x715f5
movq %rax, 0xa8(%r14)
cmpl $0x2, 0x58(%r15)
jl 0x715d0
movb $0x1, 0xa1(%r14)
movq %r14, %rdi
callq 0xfd85e
movl 0x14(%rsp), %esi
movq %rbx, %rdi
callq 0xe8a25
movl %ebp, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq