// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/misc3.c
// Function: do_pcxgxlib_member
static void do_pcxgxlib_member(deark *c,  de_arch_lctx *d, struct de_arch_member_data *md)
{
	int saved_indent_level;
	i64 pos = md->member_hdr_pos;

	de_dbg_indent_save(c, &saved_indent_level);

	de_dbg(c, "member file at %"I64_FMT, md->member_hdr_pos);
	de_dbg_indent(c, 1);

	if(d->fmtcode==FMT_PCXLIB) {
		pos++; // already read
	}
	if(d->fmtcode==FMT_GXLIB) {
		md->cmpr_meth = de_getbyte_p(&pos);
	}

	read_pcxgxlib_filename(c, d, md, pos);
	de_dbg(c, "filename: \"%s\"", ucstring_getpsz_d(md->filename));
	pos += 13;

	if(d->fmtcode==FMT_GXLIB) {
		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_dttm_p(d, &md->fi->timestamp[DE_TIMESTAMPIDX_MODIFY], "mod",
		DE_ARCH_TSTYPE_DOS_DT, &pos);

	if(d->fmtcode==FMT_PCXLIB) {
		md->cmpr_meth = (UI)de_getu16le_p(&pos);
	}

	de_dbg(c, "packing type: %u", (UI)md->cmpr_meth);
	if(md->cmpr_meth==0) {
		md->orig_len = md->cmpr_len;
		md->orig_len_known = 1;
	}
	else {
		de_err(c, "Unsupported compression: %u", (UI)md->cmpr_meth);
		goto done;
	}

	if(d->fmtcode==FMT_PCXLIB) {
		pos += 40; // note
		pos += 20; // unused
	}

	if(d->fmtcode==FMT_PCXLIB) {
		md->cmpr_pos = pos;
	}

	if(!de_arch_good_cmpr_data_pos(md)) {
		d->fatalerrflag = 1;
		goto done;
	}

	if(d->fmtcode==FMT_GXLIB) {
		md->member_total_size = pos - md->member_hdr_pos;
	}
	else {
		md->member_total_size = md->cmpr_pos + md->cmpr_len - md->member_hdr_pos;
	}

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

done:
	de_dbg_indent_restore(c, saved_indent_level);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x18(%rbp), %rax
movq 0x18(%rax), %rax
movq %rax, -0x28(%rbp)
movq -0x8(%rbp), %rdi
leaq -0x1c(%rbp), %rsi
callq 0x15b580
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rax
movq 0x18(%rax), %rdx
leaq 0x10f5e5(%rip), %rsi    # 0x1b19e5
movb $0x0, %al
callq 0x15b0d0
movq -0x8(%rbp), %rdi
movl $0x1, %esi
callq 0x15b560
movq -0x10(%rbp), %rax
cmpl $0x0, 0x54(%rax)
jne 0xa242b
movq -0x28(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x28(%rbp)
movq -0x10(%rbp), %rax
cmpl $0x1, 0x54(%rax)
jne 0xa2453
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
leaq -0x28(%rbp), %rsi
callq 0x165170
movzbl %al, %ecx
movq -0x18(%rbp), %rax
movl %ecx, 0x90(%rax)
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
movq -0x28(%rbp), %rcx
callq 0xa2660
movq -0x8(%rbp), %rax
movq %rax, -0x30(%rbp)
movq -0x18(%rbp), %rax
movq 0x58(%rax), %rdi
callq 0x172650
movq -0x30(%rbp), %rdi
movq %rax, %rdx
leaq 0x1250f8(%rip), %rsi    # 0x1c7583
movb $0x0, %al
callq 0x15b0d0
movq -0x28(%rbp), %rax
addq $0xd, %rax
movq %rax, -0x28(%rbp)
movq -0x10(%rbp), %rax
cmpl $0x1, 0x54(%rax)
jne 0xa24de
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 0x10f395(%rip), %rsi    # 0x1b186c
movb $0x0, %al
callq 0x15b0d0
movq -0x18(%rbp), %rdi
leaq -0x28(%rbp), %rsi
callq 0x17c400
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rax
movq 0x50(%rax), %rsi
addq $0x18, %rsi
leaq 0x1019f1(%rip), %rdx    # 0x1a3ef3
movl $0x3, %ecx
leaq -0x28(%rbp), %r8
callq 0x17c580
movq -0x10(%rbp), %rax
cmpl $0x0, 0x54(%rax)
jne 0xa2537
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
leaq -0x28(%rbp), %rsi
callq 0x1652c0
movl %eax, %ecx
movq -0x18(%rbp), %rax
movl %ecx, 0x90(%rax)
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rax
movl 0x90(%rax), %edx
leaq 0x10f4ac(%rip), %rsi    # 0x1b19f8
movb $0x0, %al
callq 0x15b0d0
movq -0x18(%rbp), %rax
cmpl $0x0, 0x90(%rax)
jne 0xa257a
movq -0x18(%rbp), %rax
movq 0x30(%rax), %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x38(%rax)
movq -0x18(%rbp), %rax
movb $0x1, 0x4c(%rax)
jmp 0xa259b
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rax
movl 0x90(%rax), %edx
leaq 0xfd1f3(%rip), %rsi     # 0x19f782
movb $0x0, %al
callq 0x15bfb0
jmp 0xa2649
movq -0x10(%rbp), %rax
cmpl $0x0, 0x54(%rax)
jne 0xa25bd
movq -0x28(%rbp), %rax
addq $0x28, %rax
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rax
addq $0x14, %rax
movq %rax, -0x28(%rbp)
movq -0x10(%rbp), %rax
cmpl $0x0, 0x54(%rax)
jne 0xa25d3
movq -0x28(%rbp), %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x40(%rax)
movq -0x18(%rbp), %rdi
callq 0x17c7f0
cmpl $0x0, %eax
jne 0xa25ee
movq -0x10(%rbp), %rax
movl $0x1, 0x38(%rax)
jmp 0xa2649
movq -0x10(%rbp), %rax
cmpl $0x1, 0x54(%rax)
jne 0xa260e
movq -0x28(%rbp), %rcx
movq -0x18(%rbp), %rax
subq 0x18(%rax), %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x28(%rax)
jmp 0xa262e
movq -0x18(%rbp), %rax
movq 0x40(%rax), %rcx
movq -0x18(%rbp), %rax
addq 0x30(%rax), %rcx
movq -0x18(%rbp), %rax
subq 0x18(%rax), %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x28(%rax)
movq -0x18(%rbp), %rax
leaq 0x107(%rip), %rcx       # 0xa2740
movq %rcx, 0xa8(%rax)
movq -0x18(%rbp), %rdi
callq 0x17c920
movq -0x8(%rbp), %rdi
movl -0x1c(%rbp), %esi
callq 0x15b5a0
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax,%rax)