// File: /workspace/github_c_makefile_star2_O1/jsummers[P]deark/modules/zip.c
// Function: do_process_member
static int do_process_member(deark *c, lctx *d, struct member_data *md)
{
	int retval = 0;

	// If for some reason we have a central-dir filename but not a local-dir
	// filename, use the central-dir filename.
	if(ucstring_isempty(md->local_dir_entry_data.fname) &&
		ucstring_isnonempty(md->central_dir_entry_data.fname))
	{
		ucstring_append_ucstring(md->local_dir_entry_data.fname,
			md->central_dir_entry_data.fname);
	}

	// Set the final file size and crc fields.
	if(md->local_dir_entry_data.bit_flags & 0x0008) {
		if(d->using_scanmode) {
			de_err(c, "File is incompatible with scan mode");
			goto done;
		}

		// Indicates that certain fields are not present in the local file header,
		// and are instead in a "data descriptor" after the file data.
		// Let's hope they are also in the central file header.
		md->cmpr_size = md->central_dir_entry_data.cmpr_size;
		md->uncmpr_size = md->central_dir_entry_data.uncmpr_size;
		md->crc_reported = md->central_dir_entry_data.crc_reported;
	}
	else {
		md->cmpr_size = md->local_dir_entry_data.cmpr_size;
		md->uncmpr_size = md->local_dir_entry_data.uncmpr_size;
		md->crc_reported = md->local_dir_entry_data.crc_reported;
	}

	process_ext_attr(c, d, md);

	// In some cases, detect directories by checking whether the filename ends
	// with a slash.
	if(!md->is_dir && md->uncmpr_size==0 &&
		(d->using_scanmode || (md->ver_made_by_lo<20)))
	{
		if(ucstring_lastchar(md->local_dir_entry_data.fname) == '/') {
			de_dbg(c, "[assuming this is a subdirectory]");
			md->is_dir = 1;
		}
	}

	do_extract_file(c, d, md);
	retval = 1;

done:
	return retval;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xa8, %rsp
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %rbx
movq 0x1b8(%rdx), %rdi
callq 0xf6bea
testl %eax, %eax
je 0xde9b8
movq 0x140(%r14), %rdi
callq 0xf6c00
testl %eax, %eax
je 0xde9b8
movq 0x140(%r14), %rsi
movq 0x1b8(%r14), %rdi
callq 0xf6969
testb $0x8, 0x1a0(%r14)
jne 0xde9d3
movl $0x1a4, %eax            # imm = 0x1A4
movl $0x188, %ecx            # imm = 0x188
movl $0x180, %edx            # imm = 0x180
jmp 0xdea04
cmpl $0x0, 0xb0(%r15)
je 0xde9f5
leaq 0x654f9(%rip), %rsi     # 0x143edd
xorl %ebp, %ebp
movq %rbx, %rdi
xorl %eax, %eax
callq 0xe9df7
jmp 0xdebf9
movl $0x12c, %eax            # imm = 0x12C
movl $0x110, %ecx            # imm = 0x110
movl $0x108, %edx            # imm = 0x108
movq (%r14,%rdx), %rdx
movq %rdx, 0x1e8(%r14)
movq (%r14,%rcx), %rcx
movq %rcx, 0x1f0(%r14)
movl (%r14,%rax), %eax
movl %eax, 0x1f8(%r14)
movl 0xb0(%r15), %eax
testl %eax, %eax
je 0xdeafa
cmpl $0x0, 0x38(%r14)
jne 0xdea49
cmpq $0x0, 0x1f0(%r14)
je 0xdeb5b
leaq 0xc(%rsp), %rsi
movq %rbx, %rdi
callq 0xe958c
movq 0x28(%r14), %rdx
movq 0x1e8(%r14), %rcx
leaq 0x58c8b(%rip), %rsi     # 0x1376f3
movq %rbx, %rdi
xorl %eax, %eax
callq 0xe9226
movq %rbx, %rdi
movl $0x1, %esi
callq 0xe9585
testb $0x1, 0x1a0(%r14)
jne 0xdead2
movq 0x198(%r14), %rax
testq %rax, %rax
je 0xdeb36
cmpq $0x0, 0x10(%rax)
je 0xdeb36
movq 0x1e8(%r14), %rax
addq 0x28(%r14), %rax
movq 0x18(%rbx), %rcx
cmpq 0x18(%rcx), %rax
jle 0xdec0d
movq 0x1b8(%r14), %rdi
callq 0xf7557
leaq 0x3604d(%rip), %rsi     # 0x114b1d
jmp 0xdeae5
movq 0x1b8(%r14), %rdi
callq 0xf7557
leaq 0x6543e(%rip), %rsi     # 0x143f23
xorl %r12d, %r12d
movq %rbx, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0xe9df7
jmp 0xdebd2
cmpl $0x3, 0x4(%r14)
jne 0xded8a
movl 0x10(%r14), %ecx
movl %ecx, %edx
shrl $0x10, %edx
andl $0xf000, %edx           # imm = 0xF000
cmpl $0x4000, %edx           # imm = 0x4000
je 0xded63
cmpl $0xa000, %edx           # imm = 0xA000
jne 0xded70
movl $0x40, %edx
jmp 0xded68
movq 0x1b8(%r14), %rdi
callq 0xf7557
movl 0x190(%r14), %ecx
movq 0x198(%r14), %rdx
testq %rdx, %rdx
je 0xdebb4
movq 0x8(%rdx), %r8
jmp 0xdebbb
testl %eax, %eax
jne 0xdeb6a
cmpl $0x13, 0x8(%r14)
ja 0xdea49
movq 0x1b8(%r14), %rax
testq %rax, %rax
je 0xdea49
movq 0x10(%rax), %rcx
testq %rcx, %rcx
jle 0xdea49
movq 0x8(%rax), %rax
cmpl $0x2f, -0x4(%rax,%rcx,4)
jne 0xdea49
leaq 0x65364(%rip), %rsi     # 0x143f01
movq %rbx, %rdi
xorl %eax, %eax
callq 0xe9226
movl $0x1, 0x38(%r14)
jmp 0xdea49
leaq 0x4d2ae(%rip), %r8      # 0x12be69
leaq 0x65031(%rip), %rsi     # 0x143bf3
xorl %r12d, %r12d
movq %rbx, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0xe9df7
xorl %r13d, %r13d
movq %r13, %rdi
callq 0xf0b13
movq %rbx, %rdi
movq %r12, %rsi
callq 0xea9b3
movl 0xc(%rsp), %esi
movq %rbx, %rdi
callq 0xe9595
movl $0x1, %ebp
movl %ebp, %eax
addq $0xa8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
cmpl $0x0, 0x40(%r14)
je 0xdec34
movq 0x1b8(%r14), %rdi
callq 0xf7557
leaq 0x6531c(%rip), %rsi     # 0x143f43
movq %rbx, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0xe9b27
movq %rbx, %rdi
callq 0xea9a9
movq %rax, %r12
movb $0x1, 0xc(%rax)
movq 0x1b8(%r14), %rdi
callq 0xf6c00
testl %eax, %eax
je 0xdeca6
cmpb $0x0, 0xc0(%r14)
je 0xdec7d
movq 0x1b8(%r14), %rdx
leaq 0xc8(%r14), %rcx
movl 0x38(%r14), %r8d
movq %rbx, %rdi
movq %r12, %rsi
xorl %r9d, %r9d
callq 0xf9907
xorl %eax, %eax
cmpl $0x0, 0x38(%r14)
setne %al
leal 0x1(,%rax,2), %ecx
movq 0x1b8(%r14), %rdx
movq %rbx, %rdi
movq %r12, %rsi
callq 0xea9e4
movb $0x1, 0x8(%r12)
cmpb $0x0, 0x1ff(%r14)
je 0xdecc9
cmpb $0x0, 0x1fc(%r14)
je 0xdecc9
cmpb $0x0, 0x1fd(%r14)
jne 0xdecc9
movb $0x0, 0x78(%r14)
cmpb $0x0, 0x200(%r14)
je 0xdecec
cmpb $0x0, 0x1fc(%r14)
je 0xdecec
cmpb $0x0, 0x1fe(%r14)
jne 0xdecec
movb $0x0, 0x60(%r14)
leaq 0x48(%r14), %rax
movl $0x18, %ecx
cmpb $0x0, (%rax)
je 0xded02
movups (%rax), %xmm0
movups %xmm0, (%r12,%rcx)
addq $0x10, %rcx
addq $0x18, %rax
cmpq $0x68, %rcx
jne 0xdecf5
cmpb $0x0, 0xc0(%r14)
je 0xded4d
movb $0x1, 0x10(%r12)
movl 0xd4(%r14), %eax
movl %eax, 0xa0(%r12)
movl 0xcc(%r14), %eax
movl %eax, 0xa4(%r12)
movl 0xd0(%r14), %eax
movl %eax, 0xa8(%r12)
cmpl $0x0, 0x38(%r14)
je 0xdede3
movb $0x1, 0x9(%r12)
jmp 0xdee0e
movl $0x38, %edx
movl $0x1, (%r14,%rdx)
testl $0x490000, %ecx         # imm = 0x490000
je 0xded82
movl $0x1, 0x34(%r14)
jmp 0xded8a
movl $0x1, 0x30(%r14)
movl 0x10(%r14), %ecx
testb $0x10, %cl
jne 0xded9f
testb $0x8, %cl
je 0xdeda7
movb $0x1, 0x3c(%r14)
jmp 0xdeda7
movl $0x1, 0x38(%r14)
cmpl $0x0, 0x38(%r14)
je 0xdedc0
cmpq $0x0, 0x1f0(%r14)
je 0xdedc0
movl $0x0, 0x38(%r14)
cmpb $0x0, 0x3c(%r14)
je 0xdea34
cmpq $0x0, 0x1f0(%r14)
je 0xdea34
movb $0x0, 0x3c(%r14)
jmp 0xdea34
cmpb $0x0, 0x3c(%r14)
je 0xdedf2
movb $0x1, 0xa(%r12)
jmp 0xdee0e
cmpl $0x0, 0x34(%r14)
je 0xdee01
orb $0x2, 0x14(%r12)
jmp 0xdee0e
cmpl $0x0, 0x30(%r14)
je 0xdee0e
orb $0x1, 0x14(%r12)
movq %rbx, %rdi
xorl %esi, %esi
movq %r12, %rdx
xorl %ecx, %ecx
callq 0xf037a
movq %rax, %r13
movq %rax, %rdi
callq 0xf0e3f
cmpl $0x0, 0x38(%r14)
jne 0xdebd5
leaq 0x88(%rsp), %rbp
leaq 0x10(%rsp), %rdx
leaq 0x28(%rsp), %rcx
movq %rbx, %rdi
movq %rbp, %rsi
callq 0xfa6e0
movq 0x18(%rbx), %rax
movq %rax, (%rbp)
movq 0x28(%r14), %rax
movq %rax, 0x8(%rbp)
movq 0x1e8(%r14), %rax
movq %rax, 0x10(%rbp)
leaq 0x10(%rsp), %rcx
movq %r13, (%rcx)
movq 0x1f0(%r14), %rax
movq %rax, 0x10(%rcx)
movb $0x1, 0x8(%rcx)
movq 0xb8(%r15), %rdx
leaq 0x12bc1(%rip), %rsi     # 0xf1a51
movq %r13, %rdi
callq 0xf1a12
movq 0xb8(%r15), %rdi
callq 0xebdc3
movl 0x190(%r14), %r9d
movl 0x1a0(%r14), %eax
movq %rbx, %rdi
movq %r15, %rsi
movq %rbp, %rdx
leaq 0x10(%rsp), %rcx
leaq 0x28(%rsp), %r8
pushq %rax
pushq 0x198(%r14)
callq 0xe06ec
addq $0x10, %rsp
leaq 0x28(%rsp), %rax
cmpl $0x0, (%rax)
je 0xdef18
movq 0x1b8(%r14), %rdi
callq 0xf7557
movq %rax, %r14
leaq 0x28(%rsp), %rsi
movq %rbx, %rdi
callq 0xfa6a8
leaq 0x69ee7(%rip), %rsi     # 0x148dea
movq %rbx, %rdi
movq %r14, %rdx
movq %rax, %rcx
xorl %eax, %eax
callq 0xe9df7
jmp 0xdebd5
movq 0xb8(%r15), %rdi
callq 0xebe2a
movl %eax, %ebp
leaq 0x39325(%rip), %rsi     # 0x118252
movq %rbx, %rdi
movl %eax, %edx
xorl %eax, %eax
callq 0xe9226
cmpl 0x1f8(%r14), %ebp
je 0xdebd5
movq 0x1b8(%r14), %rdi
callq 0xf7557
movl 0x1f8(%r14), %ecx
leaq 0x65020(%rip), %rsi     # 0x143f80
movq %rbx, %rdi
movq %rax, %rdx
movl %ebp, %r8d
xorl %eax, %eax
callq 0xe9df7
cmpb $0x0, 0x2c(%rsp)
je 0xdebd5
movq 0x30(%rsp), %rdx
movq 0x98(%rsp), %rcx
cmpq %rcx, %rdx
jge 0xdebd5
leaq 0x6501a(%rip), %rsi     # 0x143fb2
movq %rbx, %rdi
xorl %eax, %eax
callq 0xe9ef5
jmp 0xdebd5