// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/packit.c
// Function: packit_do_member
static void packit_do_member(deark *c, struct packit_ctx *d,
	struct packit_md *pmd)
{
	int saved_indent_level;
	i64 pos = pmd->marker_pos+3;
	struct packit_advfudata u;

	de_dbg_indent_save(c, &saved_indent_level);
	de_dbg(c, "member file at %"I64_FMT, pmd->marker_pos);
	de_dbg_indent(c, 1);

	pmd->encoding_type = de_getbyte_p(&pos);
	de_dbg(c, "encoding type: 0x%02x", (UI)pmd->encoding_type);

	if(pmd->encoding_type=='g') { // not compressed or encrypted
		pmd->inf = c->infile;
		pmd->hdr_pos_in_inf = pmd->marker_pos+4;
		packit_read_member_header(c, d, pmd);
		if(d->fatalerrflag) goto done;
		pmd->total_encoded_size = 4 + 94 + pmd->dfork_len + pmd->rfork_len + 2;
		packit_scan_member_data(c, d, pmd);
		if(d->fatalerrflag) goto done;
	}
	else if(pmd->encoding_type=='4') {
		pmd->is_compressed = 1;
		packit_do_huffman_cmpr_member(c, d, pmd);
		if(d->fatalerrflag) goto done;
	}
	else {
		de_err(c, "Unsupported encoding type");
		d->fatalerrflag = 1;
		goto done;
	}

	de_zeromem(&u, sizeof(struct packit_advfudata));
	u.d = d;
	u.pmd = pmd;
	pmd->advf->userdata = (void*)&u;
	ucstring_append_ucstring(pmd->advf->filename, pmd->fname->str);
	pmd->advf->original_filename_flag = 1;
	de_advfile_set_orig_filename(pmd->advf, pmd->fname->sz, pmd->fname->sz_strlen);
	pmd->advf->writefork_cbfn = packit_advfile_cbfn;
	de_advfile_run(pmd->advf);

done:
	de_dbg_indent_restore(c, saved_indent_level);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x18(%rbp), %rax
movq (%rax), %rax
addq $0x3, %rax
movq %rax, -0x28(%rbp)
movq -0x8(%rbp), %rdi
leaq -0x1c(%rbp), %rsi
callq 0x15b580
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rax
movq (%rax), %rdx
leaq 0x9ff43(%rip), %rsi     # 0x1b19e5
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 0x165170
movb %al, %cl
movq -0x18(%rbp), %rax
movb %cl, 0x21(%rax)
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rax
movzbl 0x21(%rax), %edx
leaq 0xb2161(%rip), %rsi     # 0x1c3c45
movb $0x0, %al
callq 0x15b0d0
movq -0x18(%rbp), %rax
movzbl 0x21(%rax), %eax
cmpl $0x67, %eax
jne 0x111b85
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x18(%rax)
movq -0x18(%rbp), %rax
movq (%rax), %rcx
addq $0x4, %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x10(%rax)
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
callq 0x111c90
movq -0x10(%rbp), %rax
cmpb $0x0, (%rax)
je 0x111b3e
jmp 0x111c79
movq -0x18(%rbp), %rax
movq 0xd0(%rax), %rcx
addq $0x62, %rcx
movq -0x18(%rbp), %rax
addq 0xe0(%rax), %rcx
addq $0x2, %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
callq 0x1121b0
movq -0x10(%rbp), %rax
cmpb $0x0, (%rax)
je 0x111b83
jmp 0x111c79
jmp 0x111bdb
movq -0x18(%rbp), %rax
movzbl 0x21(%rax), %eax
cmpl $0x34, %eax
jne 0x111bbb
movq -0x18(%rbp), %rax
movb $0x1, 0x20(%rax)
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
callq 0x1122e0
movq -0x10(%rbp), %rax
cmpb $0x0, (%rax)
je 0x111bb9
jmp 0x111c79
jmp 0x111bd9
movq -0x8(%rbp), %rdi
leaq 0xb2095(%rip), %rsi     # 0x1c3c5b
movb $0x0, %al
callq 0x15bfb0
movq -0x10(%rbp), %rax
movb $0x1, (%rax)
jmp 0x111c79
jmp 0x111bdb
leaq -0x38(%rbp), %rdi
xorl %esi, %esi
movl $0x10, %edx
callq 0x19140
movq -0x10(%rbp), %rax
movq %rax, -0x38(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0x30(%rbp)
movq -0x18(%rbp), %rax
movq 0x38(%rax), %rax
leaq -0x38(%rbp), %rcx
movq %rcx, 0x8(%rax)
movq -0x18(%rbp), %rax
movq 0x38(%rax), %rax
movq 0x68(%rax), %rdi
movq -0x18(%rbp), %rax
movq 0x40(%rax), %rax
movq 0x18(%rax), %rsi
callq 0x171460
movq -0x18(%rbp), %rax
movq 0x38(%rax), %rax
movb $0x1, 0x79(%rax)
movq -0x18(%rbp), %rax
movq 0x38(%rax), %rdi
movq -0x18(%rbp), %rax
movq 0x40(%rax), %rax
movq 0x8(%rax), %rsi
movq -0x18(%rbp), %rax
movq 0x40(%rax), %rax
movq 0x10(%rax), %rdx
callq 0x17ab20
movq -0x18(%rbp), %rax
movq 0x38(%rax), %rax
leaq 0x9c8(%rip), %rcx       # 0x112630
movq %rcx, 0x60(%rax)
movq -0x18(%rbp), %rax
movq 0x38(%rax), %rdi
callq 0x17ac20
movq -0x8(%rbp), %rdi
movl -0x1c(%rbp), %esi
callq 0x15b5a0
addq $0x40, %rsp
popq %rbp
retq
nopl (%rax,%rax)