// File: /workspace/github_c_makefile_star2_O1/jsummers[P]deark/modules/zip.c
// Function: do_file_header
static int do_file_header(deark *c, lctx *d, struct member_data *md,
	int is_central, i64 pos1, i64 *p_entry_size)
{
	i64 pos;
	int utf8_flag;
	int retval = 0;
	i64 fixed_header_size;
	i64 mod_time_raw, mod_date_raw;
	struct dir_entry_data *dd; // Points to either md->central or md->local
	de_ucstring *descr = NULL;
	struct de_timestamp dos_timestamp;
	char tmpsz[64];

	pos = pos1;
	descr = ucstring_create(c);
	if(is_central) {
		dd = &md->central_dir_entry_data;
		fixed_header_size = 46;
		de_dbg(c, "central dir entry at %"I64_FMT, pos);
		if(!dd->have_read_sig_and_hdrsize) {
			goto done; // internal error
		}
	}
	else {
		dd = &md->local_dir_entry_data;
		fixed_header_size = 30;
		if((md->seg_number_start!=d->eocd.this_seg_num) && !d->using_scanmode) {
			u32 peek_crc;

			// This is a hack -- we could compare more fields -- but I think
			// it's good enough.
			peek_crc = (u32)de_getu32le(pos1+14);
			if(peek_crc != md->central_dir_entry_data.crc_reported) {
				de_err(c, "Member file not in this ZIP file");
				return 0;
			}
			if(!d->seg_id_mismatch_warned) {
				de_warn(c, "Segment ID mismatch (found file on segment %"I64_FMT" that "
					"should be on segment %"I64_FMT"). Trying to continue.",
					d->eocd.this_seg_num, md->seg_number_start);
				d->seg_id_mismatch_warned = 1;
			}
		}
		de_dbg(c, "local file header at %"I64_FMT, pos);
	}
	de_dbg_indent(c, 1);

	if(dd->have_read_sig_and_hdrsize) { // Currently always true for central dir entries
		pos += 4;
	}
	else {
		u32 sig;

		sig = (u32)de_getu32be_p(&pos);
		if(!is_central && sig!=(d->is_resof?CODE_PK36:CODE_PK34)) {
			de_err(c, "Local file header not found at %"I64_FMT, pos1);
			goto done;
		}
	}

	if(is_central) {
		md->ver_made_by = (UI)de_getu16le_p(&pos);
		md->ver_made_by_hi = (UI)((md->ver_made_by&0xff00)>>8);
		md->ver_made_by_lo = (UI)(md->ver_made_by&0x00ff);
		de_dbg(c, "version made by: platform=%u (%s), ZIP spec=%u.%u",
			md->ver_made_by_hi, get_platform_name(md->ver_made_by_hi),
			(UI)(md->ver_made_by_lo/10), (UI)(md->ver_made_by_lo%10));
	}

	dd->ver_needed = (UI)de_getu16le_p(&pos);
	dd->ver_needed_hi = (UI)((dd->ver_needed&0xff00)>>8);
	dd->ver_needed_lo = (UI)(dd->ver_needed&0x00ff);
	de_dbg(c, "version needed to extract: platform=%u (%s), ZIP spec=%u.%u",
		dd->ver_needed_hi, get_platform_name(dd->ver_needed_hi),
		(UI)(dd->ver_needed_lo/10), (UI)(dd->ver_needed_lo%10));

	dd->bit_flags = (UI)de_getu16le_p(&pos);
	dd->cmpr_meth = (int)de_getu16le_p(&pos);
	dd->cmi = get_cmpr_meth_info(dd->cmpr_meth);

	utf8_flag = (dd->bit_flags & 0x800)?1:0;
	ucstring_empty(descr);
	describe_general_purpose_bit_flags(c, dd, descr);
	de_dbg(c, "flags: 0x%04x (%s)", dd->bit_flags, ucstring_getpsz(descr));

	de_dbg(c, "cmpr method: %d (%s)", dd->cmpr_meth,
		(dd->cmi ? dd->cmi->name : "?"));

	mod_time_raw = de_getu16le_p(&pos);
	mod_date_raw = de_getu16le_p(&pos);
	de_dos_datetime_to_timestamp(&dos_timestamp, mod_date_raw, mod_time_raw);
	dos_timestamp.tzcode = DE_TZCODE_LOCAL;
	de_dbg_timestamp_to_string(c, &dos_timestamp, tmpsz, sizeof(tmpsz), 0);
	de_dbg(c, "mod time: %s", tmpsz);
	apply_timestamp(c, d, md, DE_TIMESTAMPIDX_MODIFY, &dos_timestamp, 10);

	dd->crc_reported = (u32)de_getu32le_p(&pos);
	de_dbg(c, "crc (reported): 0x%08x", (UI)dd->crc_reported);

	dd->cmpr_size = de_getu32le_p(&pos);
	de_dbg(c, "cmpr size: %s", format_u32_with_zip64_override(d, dd->cmpr_size,
		tmpsz, sizeof(tmpsz)));
	dd->uncmpr_size = de_getu32le_p(&pos);
	de_dbg(c, "uncmpr size: %s", format_u32_with_zip64_override(d, dd->uncmpr_size,
		tmpsz, sizeof(tmpsz)));

	if(dd->have_read_sig_and_hdrsize) {
		pos += 4;
		if(is_central) pos += 2;
	}
	else {
		dd->fn_len = de_getu16le_p(&pos);
		dd->extra_len = de_getu16le_p(&pos);
		if(is_central) {
			dd->comment_len = de_getu16le_p(&pos);
		}
		else {
			dd->comment_len = 0;
		}
	}

	if(!is_central) {
		md->file_data_pos = pos + dd->fn_len + dd->extra_len;
	}

	if(is_central) {
		md->seg_number_start = de_getu16le_p(&pos);

		md->attr_i = (UI)de_getu16le_p(&pos);
		ucstring_empty(descr);
		describe_internal_attr(c, md, descr);
		de_dbg(c, "internal file attributes: 0x%04x (%s)", md->attr_i,
			ucstring_getpsz(descr));

		md->attr_e = (UI)de_getu32le_p(&pos);
		de_dbg(c, "external file attributes: 0x%08x", md->attr_e);
		de_dbg_indent(c, 1);

		{
			// The low byte is, AFAIK, *almost* universally used for MS-DOS-style
			// attributes.
			UI dos_attrs = (md->attr_e & 0xff);
			ucstring_empty(descr);
			de_describe_dos_attribs(c, dos_attrs, descr, 0);
			de_dbg(c, "%sMS-DOS attribs: 0x%02x (%s)",
				(md->ver_made_by_hi==0)?"":"(hypothetical) ",
				dos_attrs, ucstring_getpsz(descr));
		}

		if(((md->attr_e>>16) != 0) &&
			!(md->attr_i & 0x0004))
		{
			// A number of platforms put Unix-style file attributes here, so
			// decode them as such whenever they are nonzero.
			// [But the AV feature (spec 2.0+?) uses these bits for something
			// else, and sets attr_i bit 0x0004.]
			de_dbg(c, "%sUnix attribs: octal(%06o)",
				(md->ver_made_by_hi==3)?"":"(hypothetical) ",
				(UI)(md->attr_e>>16));
		}

		de_dbg_indent(c, -1);

		md->offset_of_local_header = de_getu32le_p(&pos);
		de_dbg(c, "offset of local header: %s, segment: %d",
			format_u32_with_zip64_override(d, md->offset_of_local_header, tmpsz, sizeof(tmpsz)),
			(int)md->seg_number_start);
	}

	de_dbg(c, "filename len: %d", (int)dd->fn_len);
	de_dbg(c, "extra len: %d", (int)dd->extra_len);
	if(is_central) {
		de_dbg(c, "comment len: %d", (int)dd->comment_len);
	}

	*p_entry_size = fixed_header_size + dd->fn_len + dd->extra_len + dd->comment_len;

	dd->main_fname_pos = pos1+fixed_header_size;
	dd->main_fname_len = dd->fn_len;
	do_read_filename(c, d, md, dd, pos1+fixed_header_size, dd->fn_len, utf8_flag);

	if(dd->extra_len>0) {
		do_extra_data(c, d, md, dd, pos1+fixed_header_size+dd->fn_len, dd->extra_len, is_central);
	}

	if(dd->comment_len>0) {
		do_comment(c, d, pos1+fixed_header_size+dd->fn_len+dd->extra_len, dd->comment_len, utf8_flag,
			"member file comment", "fcomment.txt");
	}

	if(is_central) {
		if(d->used_offset_correction) {
			md->offset_of_local_header += d->offset_correction;
			de_dbg(c, "assuming local header is really at %"I64_FMT, md->offset_of_local_header);
		}
		else if(d->offset_correction!=0) {
			u32 sig1, sig2;
			i64 alt_pos;

			sig1 = (u32)de_getu32be(md->offset_of_local_header);
			if(sig1!=CODE_PK34) {
				alt_pos = md->offset_of_local_header + d->offset_correction;
				sig2 = (u32)de_getu32be(alt_pos);
				if(sig2==CODE_PK34) {
					de_warn(c, "Local file header found at %"I64_FMT" instead of %"I64_FMT". "
						"Assuming offsets are wrong by %"I64_FMT" bytes.",
						alt_pos, md->offset_of_local_header, d->offset_correction);
					md->offset_of_local_header += d->offset_correction;
					d->used_offset_correction = 1;
				}
			}
		}
	}

	retval = 1;

done:
	de_dbg_indent(c, -1);
	ucstring_destroy(descr);
	return retval;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xe8, %rsp
movq %r9, %r12
movl %ecx, %r14d
movq %rdx, %rbp
movq %rsi, %r15
movq %rdi, %rbx
movq %r8, 0x18(%rsp)
movq %r8, 0x8(%rsp)
callq 0xf6870
movq %rax, %r13
movl %r14d, 0x10(%rsp)
testl %r14d, %r14d
movq %rbp, 0x30(%rsp)
je 0xdde63
movq 0x8(%rsp), %rdx
leaq 0x65392(%rip), %rsi     # 0x1431c5
xorl %r14d, %r14d
movq %rbx, %rdi
xorl %eax, %eax
callq 0xe9226
cmpb $0x0, 0x148(%rbp)
je 0xde8d0
movq %r12, 0x48(%rsp)
leaq 0xf8(%rbp), %r12
movl $0x2e, %eax
jmp 0xddf12
movq %r12, 0x48(%rsp)
movq 0x20(%rbp), %rax
cmpq 0x8(%r15), %rax
je 0xddef0
cmpl $0x0, 0xb0(%r15)
jne 0xddef0
movq 0x18(%rbx), %rdi
movq 0x18(%rsp), %rax
leaq 0xe(%rax), %rsi
callq 0xef37e
movq %rax, %r12
movl 0x12c(%rbp), %ebp
cmpl %r12d, %ebp
jne 0xddece
cmpb $0x0, 0xae(%r15)
jne 0xddedf
movq 0x8(%r15), %rdx
movq 0x30(%rsp), %rax
movq 0x20(%rax), %rcx
leaq 0x653b0(%rip), %rsi     # 0x14326a
movq %rbx, %rdi
xorl %eax, %eax
callq 0xe9b27
movb $0x1, 0xae(%r15)
jmp 0xddedf
leaq 0x65374(%rip), %rsi     # 0x143249
movq %rbx, %rdi
xorl %eax, %eax
callq 0xe9df7
xorl %r14d, %r14d
cmpl %r12d, %ebp
movq 0x30(%rsp), %rbp
jne 0xde8e5
leaq 0x170(%rbp), %r12
movq 0x8(%rsp), %rdx
leaq 0x653ca(%rip), %rsi     # 0x1432cd
movq %rbx, %rdi
xorl %eax, %eax
callq 0xe9226
movl $0x1e, %eax
movq %rax, 0x40(%rsp)
movq %rbx, %rdi
movl $0x1, %esi
callq 0xe9585
cmpb $0x0, 0x50(%r12)
je 0xddf3e
addq $0x4, 0x8(%rsp)
cmpl $0x0, 0x10(%rsp)
jne 0xddf57
jmp 0xddfcf
movq 0x18(%rbx), %rdi
leaq 0x8(%rsp), %rsi
callq 0xef34e
cmpl $0x0, 0x10(%rsp)
je 0xde3ca
movq 0x18(%rbx), %rdi
leaq 0x8(%rsp), %rsi
callq 0xef1ed
movl %eax, (%rbp)
movl %eax, %edx
shrl $0x8, %edx
movl $0xff, %ecx
andl %ecx, %edx
movl %edx, 0x4(%rbp)
andl %ecx, %eax
movl %eax, 0x8(%rbp)
cmpl $0x13, %edx
ja 0xddf90
movl %edx, %ecx
leaq 0xaff66(%rip), %rsi     # 0x18def0
movq (%rsi,%rcx,8), %rcx
jmp 0xddfa5
cmpl $0x1e, %edx
leaq 0x655c4(%rip), %rsi     # 0x14355e
leaq 0x4dec8(%rip), %rcx     # 0x12be69
cmoveq %rsi, %rcx
movl %eax, %esi
imulq $0x1999999a, %rsi, %r8  # imm = 0x1999999A
shrq $0x20, %r8
leal (%r8,%r8), %esi
leal (%rsi,%rsi,4), %esi
subl %esi, %eax
leaq 0x65347(%rip), %rsi     # 0x143309
movq %rbx, %rdi
movl %eax, %r9d
xorl %eax, %eax
callq 0xe9226
movq 0x18(%rbx), %rdi
leaq 0x8(%rsp), %rsi
callq 0xef1ed
movl %eax, (%r12)
movl %eax, %edx
shrl $0x8, %edx
movl $0xff, %ecx
andl %ecx, %edx
movl %edx, 0x4(%r12)
andl %ecx, %eax
movl %eax, 0x8(%r12)
cmpl $0x13, %edx
movq %r15, 0x20(%rsp)
ja 0xde012
movl %edx, %ecx
leaq 0xafee4(%rip), %rsi     # 0x18def0
movq (%rsi,%rcx,8), %rcx
jmp 0xde027
cmpl $0x1e, %edx
leaq 0x65542(%rip), %rsi     # 0x14355e
leaq 0x4de46(%rip), %rcx     # 0x12be69
cmoveq %rsi, %rcx
movl %eax, %esi
imulq $0x1999999a, %rsi, %r8  # imm = 0x1999999A
shrq $0x20, %r8
leal (%r8,%r8), %esi
leal (%rsi,%rsi,4), %esi
subl %esi, %eax
leaq 0x652f7(%rip), %rsi     # 0x14333b
xorl %r15d, %r15d
movq %rbx, %rdi
movl %eax, %r9d
xorl %eax, %eax
callq 0xe9226
movq 0x18(%rbx), %rdi
leaq 0x8(%rsp), %r14
movq %r14, %rsi
callq 0xef1ed
movl %eax, 0x30(%r12)
movq 0x18(%rbx), %rdi
movq %r14, %rsi
callq 0xef1ed
movl %eax, 0x20(%r12)
leaq 0xaff0e(%rip), %rcx     # 0x18df90
xorl %edx, %edx
cmpl %eax, (%rdx,%rcx)
je 0xde098
addq $0x18, %rdx
cmpq $0x210, %rdx            # imm = 0x210
jne 0xde084
jmp 0xde09e
addq %rdx, %rcx
movq %rcx, %r15
movq %r15, 0x28(%r12)
movl 0x30(%r12), %eax
movl %eax, 0x14(%rsp)
movq %r13, %rdi
callq 0xf6883
movl 0x30(%r12), %r14d
testb $0x1, %r14b
je 0xde0d1
leaq 0x63d21(%rip), %rsi     # 0x141de7
movq %r13, %rdi
callq 0xf7566
decl %r14d
cmpl $0x6, 0x20(%r12)
jne 0xde137
leal -0x2(%r14), %r15d
testb $0x2, %r14b
cmovel %r14d, %r15d
leaq 0x65538(%rip), %rax     # 0x143624
leaq 0x4dd95(%rip), %rdx     # 0x12be88
cmoveq %rax, %rdx
leaq 0x65529(%rip), %rsi     # 0x143627
movq %r13, %rdi
xorl %eax, %eax
callq 0xf7593
leal -0x4(%r15), %r14d
testb $0x4, %r15b
cmovel %r15d, %r14d
leaq 0x62f2c(%rip), %rax     # 0x141047
leaq 0x54f27(%rip), %rdx     # 0x133049
cmoveq %rax, %rdx
leaq 0x65510(%rip), %rsi     # 0x14363d
movq %r13, %rdi
xorl %eax, %eax
callq 0xf7593
movq 0x20(%rsp), %r15
movl 0x20(%r12), %eax
andl $-0x2, %eax
cmpl $0x8, %eax
jne 0xde172
movl %r14d, %eax
andl $0x6, %eax
leaq 0x66486(%rip), %rcx     # 0x1445dc
movslq (%rcx,%rax,2), %rdx
addq %rcx, %rdx
leaq 0x654f1(%rip), %rsi     # 0x143655
movq %r13, %rdi
xorl %eax, %eax
callq 0xf7593
andl $-0x7, %r14d
testb $0x8, %r14b
je 0xde18b
leaq 0x654e3(%rip), %rsi     # 0x143662
movq %r13, %rdi
callq 0xf7566
addl $-0x8, %r14d
btl $0xb, %r14d
jae 0xde1a8
leaq 0x45f40(%rip), %rsi     # 0x1240d9
movq %r13, %rdi
callq 0xf7566
addl $0xfffff800, %r14d      # imm = 0xFFFFF800
testl %r14d, %r14d
je 0xde1c1
leaq 0x47cc1(%rip), %rsi     # 0x125e75
movq %r13, %rdi
movl %r14d, %edx
xorl %eax, %eax
callq 0xf7593
movl 0x30(%r12), %r14d
movq %r13, %rdi
callq 0xf74bd
leaq 0x66ca9(%rip), %rsi     # 0x144e7e
movq %rbx, %rdi
movl %r14d, %edx
movq %rax, %rcx
xorl %eax, %eax
callq 0xe9226
movl 0x20(%r12), %edx
movq 0x28(%r12), %rax
testq %rax, %rax
movq %r12, 0x38(%rsp)
je 0xde1ff
movq 0x8(%rax), %rcx
jmp 0xde206
leaq 0x4dc63(%rip), %rcx     # 0x12be69
movq %r13, 0x28(%rsp)
leaq 0x65165(%rip), %rsi     # 0x143377
movq %rbx, %rdi
xorl %eax, %eax
callq 0xe9226
movq 0x18(%rbx), %rdi
leaq 0x8(%rsp), %r14
movq %r14, %rsi
callq 0xef1ed
movq %rax, %r12
movq 0x18(%rbx), %rdi
movq %r14, %rsi
callq 0xef1ed
leaq 0x90(%rsp), %r14
movq %r14, %rdi
movq %rax, %rsi
movq %r12, %rdx
callq 0xeae33
movb $0x2, 0x1(%r14)
leaq 0xa0(%rsp), %r12
movl $0x40, %ecx
movq %rbx, %rdi
movq %r14, %rsi
movq %r12, %rdx
xorl %r8d, %r8d
callq 0xeb687
leaq 0x4080b(%rip), %rsi     # 0x11ea87
movq %rbx, %rdi
movq %r12, %rdx
xorl %eax, %eax
callq 0xe9226
cmpb $0x0, (%r14)
je 0xde2a8
cmpl $0xa, 0x58(%rbp)
jg 0xde2a8
movups 0x90(%rsp), %xmm0
movups %xmm0, 0x48(%rbp)
movl $0xa, 0x58(%rbp)
shrl $0xb, 0x14(%rsp)
movq 0x18(%rbx), %rdi
leaq 0x8(%rsp), %r14
movq %r14, %rsi
callq 0xef3a0
movq 0x38(%rsp), %r12
movl %eax, 0x34(%r12)
leaq 0x65ab6(%rip), %rsi     # 0x143d85
movq %rbx, %rdi
movl %eax, %edx
xorl %eax, %eax
callq 0xe9226
movq 0x18(%rbx), %rdi
movq %r14, %rsi
callq 0xef3a0
movq %rax, 0x10(%r12)
leaq 0xa0(%rsp), %r13
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
movq %r15, %rdi
movq %rax, %rsi
movq %r13, %rcx
callq 0xdf1a1
leaq 0x65080(%rip), %rsi     # 0x14338e
movq %rbx, %rdi
movq %r13, %rdx
xorl %eax, %eax
callq 0xe9226
movq 0x18(%rbx), %rdi
movq %r14, %rsi
callq 0xef3a0
movq %rax, 0x18(%r12)
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
movq %r15, %rdi
movq %rax, %rsi
movq %r13, %rcx
callq 0xdf1a1
leaq 0x65046(%rip), %rsi     # 0x14338c
movq %rbx, %rdi
movq %r13, %rdx
xorl %eax, %eax
callq 0xe9226
cmpb $0x0, 0x50(%r12)
je 0xde387
movq 0x8(%rsp), %rax
leaq 0x4(%rax), %rcx
movq %rcx, 0x8(%rsp)
cmpl $0x0, 0x10(%rsp)
movq 0x28(%rsp), %r13
je 0xde5c7
addq $0x6, %rax
movq %rax, 0x8(%rsp)
jmp 0xde412
movq 0x18(%rbx), %rdi
leaq 0x8(%rsp), %r14
movq %r14, %rsi
callq 0xef1ed
movq %rax, 0x58(%r12)
movq 0x18(%rbx), %rdi
movq %r14, %rsi
callq 0xef1ed
movq %rax, 0x60(%r12)
cmpl $0x0, 0x10(%rsp)
je 0xde404
movq 0x18(%rbx), %rdi
leaq 0x8(%rsp), %rsi
callq 0xef1ed
movq %rax, 0x68(%r12)
jmp 0xde40d
xorl %ecx, %ecx
cmpb $0x0, 0xad(%r15)
setne %cl
leal 0x504b0304(,%rcx,2), %ecx
cmpl %eax, %ecx
je 0xddf32
leaq 0x64ef9(%rip), %rsi     # 0x1432e6
xorl %r14d, %r14d
movq %rbx, %rdi
movq 0x18(%rsp), %rdx
xorl %eax, %eax
callq 0xe9df7
jmp 0xde8d0
movq $0x0, 0x68(%r12)
movq 0x28(%rsp), %r13
cmpl $0x0, 0x10(%rsp)
je 0xde5c7
movq 0x18(%rbx), %rdi
leaq 0x8(%rsp), %r14
movq %r14, %rsi
callq 0xef1ed
movq %rax, 0x20(%rbp)
movq 0x18(%rbx), %rdi
movq %r14, %rsi
callq 0xef1ed
movl %eax, 0xc(%rbp)
movq %r13, %rdi
callq 0xf6883
movl 0xc(%rbp), %r14d
testb $0x1, %r14b
je 0xde465
leaq 0x65233(%rip), %rsi     # 0x14368d
movq %r13, %rdi
callq 0xf7566
decl %r14d
testl %r14d, %r14d
je 0xde47e
leaq 0x47a04(%rip), %rsi     # 0x125e75
movq %r13, %rdi
movl %r14d, %edx
xorl %eax, %eax
callq 0xf7593
movl 0xc(%rbp), %r14d
movq %r13, %rdi
callq 0xf74bd
leaq 0x64f0b(%rip), %rsi     # 0x14339c
movq %rbx, %rdi
movl %r14d, %edx
movq %rax, %rcx
xorl %eax, %eax
callq 0xe9226
movq 0x18(%rbx), %rdi
leaq 0x8(%rsp), %rsi
callq 0xef3a0
movl %eax, 0x10(%rbp)
leaq 0x64f09(%rip), %rsi     # 0x1433c2
movq %rbx, %rdi
movl %eax, %edx
xorl %eax, %eax
callq 0xe9226
movq %rbx, %rdi
movl $0x1, %esi
callq 0xe9585
movzbl 0x10(%rbp), %r12d
movq %r13, %rdi
callq 0xf6883
movq %rbx, %rdi
movl %r12d, %esi
movq %r13, %rdx
xorl %ecx, %ecx
callq 0xeb03c
cmpl $0x0, 0x4(%rbp)
leaq 0x666d6(%rip), %rax     # 0x144bd0
leaq 0x64f00(%rip), %r14     # 0x143401
movq %r13, %rdi
movq %r14, %r13
cmoveq %rax, %r13
movq %rdi, %r15
callq 0xf74bd
leaq 0x64ec9(%rip), %rsi     # 0x1433e3
movq %rbx, %rdi
movq %r13, %rdx
movl %r12d, %ecx
movq %rax, %r8
xorl %eax, %eax
callq 0xe9226
movl 0x10(%rbp), %ecx
cmpl $0x10000, %ecx          # imm = 0x10000
jb 0xde564
testb $0x4, 0xc(%rbp)
jne 0xde564
shrl $0x10, %ecx
cmpl $0x3, 0x4(%rbp)
leaq 0x66684(%rip), %rax     # 0x144bd0
cmoveq %rax, %r14
leaq 0x64eba(%rip), %rsi     # 0x143411
movq %rbx, %rdi
movq %r14, %rdx
xorl %eax, %eax
callq 0xe9226
movq %rbx, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0xe9585
movq 0x18(%rbx), %rdi
leaq 0x8(%rsp), %rsi
callq 0xef3a0
movq %rax, 0x18(%rbp)
leaq 0xa0(%rsp), %r14
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
movq 0x20(%rsp), %r12
movq %r12, %rdi
movq %rax, %rsi
movq %r14, %rcx
callq 0xdf1a1
movl 0x20(%rbp), %ecx
leaq 0x64e80(%rip), %rsi     # 0x14342d
movq %rbx, %rdi
movq %r14, %rdx
xorl %eax, %eax
callq 0xe9226
movq %r15, %r13
movq %r12, %r15
movq 0x38(%rsp), %r12
jmp 0xde5da
movq 0x58(%r12), %rax
addq 0x8(%rsp), %rax
addq 0x60(%r12), %rax
movq %rax, 0x28(%rbp)
andl $0x1, 0x14(%rsp)
movl 0x58(%r12), %edx
leaq 0x4dcdb(%rip), %rsi     # 0x12c2c6
movq %rbx, %rdi
xorl %eax, %eax
callq 0xe9226
movl 0x60(%r12), %edx
leaq 0x64e54(%rip), %rsi     # 0x143455
movq %rbx, %rdi
xorl %eax, %eax
callq 0xe9226
cmpl $0x0, 0x10(%rsp)
je 0xde628
movl 0x68(%r12), %edx
leaq 0x477f5(%rip), %rsi     # 0x125e13
movq %rbx, %rdi
xorl %eax, %eax
callq 0xe9226
movq 0x58(%r12), %rax
movq 0x40(%rsp), %rdx
addq %rdx, %rax
addq 0x60(%r12), %rax
addq 0x68(%r12), %rax
movq 0x48(%rsp), %rcx
movq %rax, (%rcx)
movq 0x18(%rsp), %rax
addq %rdx, %rax
movq %rax, 0x18(%rsp)
movq %rax, 0x38(%r12)
movq 0x48(%r12), %rdi
movq 0x58(%r12), %r14
movq %r14, 0x40(%r12)
callq 0xf6883
movl $0x2, %r9d
cmpl $0x0, 0x14(%rsp)
jne 0xde67d
movl (%r15), %r9d
movq 0x18(%rbx), %rdi
movq 0x48(%r12), %rcx
movq 0x18(%rsp), %rsi
movq %r14, %rdx
xorl %r8d, %r8d
callq 0xf01b0
movq 0x48(%r12), %rdi
callq 0xf7557
leaq 0x5d32d(%rip), %rsi     # 0x13b9d4
movq %rbx, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0xe9226
movq %r12, %rax
movq 0x60(%r12), %r12
testq %r12, %r12
jle 0xde861
movq 0x58(%rax), %r14
addq 0x18(%rsp), %r14
leaq 0x64fc2(%rip), %rsi     # 0x143697
movq %rbx, %rdi
movq %r14, %rdx
movl %r12d, %ecx
xorl %eax, %eax
callq 0xe9226
movq %rbx, %rdi
movl $0x1, %esi
callq 0xe9585
addq %r14, %r12
leaq 0xafac4(%rip), %r15     # 0x18e1c0
leaq 0x4(%r14), %r13
cmpq %r12, %r13
jge 0xde792
xorps %xmm0, %xmm0
movaps %xmm0, 0x70(%rsp)
movaps %xmm0, 0x50(%rsp)
movaps %xmm0, 0x60(%rsp)
movq $0x0, 0x80(%rsp)
movq 0x30(%rsp), %rax
movq %rax, 0x70(%rsp)
movq 0x38(%rsp), %rax
movq %rax, 0x78(%rsp)
movl 0x10(%rsp), %eax
movl %eax, 0x80(%rsp)
movq %r13, 0x58(%rsp)
movq 0x18(%rbx), %rdi
movq %r14, %rsi
callq 0xef1ca
movl %eax, 0x50(%rsp)
movq 0x18(%rbx), %rdi
leaq 0x2(%r14), %rsi
callq 0xef1ca
movq %rax, 0x60(%rsp)
movl 0x50(%rsp), %edx
xorl %ecx, %ecx
movzwl (%rcx,%r15), %esi
cmpl %esi, %edx
je 0xde799
addq $0x18, %rcx
cmpq $0x510, %rcx            # imm = 0x510
jne 0xde773
leaq 0xafa10(%rip), %rcx     # 0x18e1a0
jmp 0xde79c
xorl %ebp, %ebp
jmp 0xde837
addq %r15, %rcx
movq %rcx, 0x68(%rsp)
movq 0x8(%rcx), %rcx
xorl %ebp, %ebp
movq %rbx, %rdi
leaq 0x64f00(%rip), %rsi     # 0x1436b1
movl %eax, %r8d
xorl %eax, %eax
callq 0xe9226
movq 0x60(%rsp), %rax
addq %r13, %rax
cmpq %r12, %rax
jg 0xde837
movq %rbx, %rdi
movl $0x1, %esi
callq 0xe9585
movq 0x68(%rsp), %rax
movq 0x10(%rax), %rax
testq %rax, %rax
je 0xde7f4
movq %rbx, %rdi
movq 0x20(%rsp), %rsi
leaq 0x50(%rsp), %rdx
callq *%rax
jmp 0xde81f
cmpl $0x2, (%rbx)
jl 0xde81f
movq 0x18(%rbx), %rsi
movq 0x58(%rsp), %rdx
movq 0x60(%rsp), %rcx
movl $0x1, (%rsp)
movl $0x100, %r8d            # imm = 0x100
movq %rbx, %rdi
xorl %r9d, %r9d
callq 0xe975a
movq %rbx, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0xe9585
addq 0x60(%rsp), %r13
movb $0x1, %bpl
movq %r13, %r14
testb %bpl, %bpl
jne 0xde6fc
movq %rbx, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0xe9585
movq 0x28(%rsp), %r13
movq 0x30(%rsp), %rbp
movq 0x20(%rsp), %r15
movq 0x38(%rsp), %rax
movq 0x68(%rax), %rcx
testq %rcx, %rcx
jle 0xde899
movq 0x18(%rsp), %rdx
addq 0x58(%rax), %rdx
addq 0x60(%rax), %rdx
leaq 0x39b7c(%rip), %rax     # 0x1183fa
movq %rax, (%rsp)
leaq 0x64bda(%rip), %r9      # 0x143463
movq %rbx, %rdi
movq %r15, %rsi
movl 0x14(%rsp), %r8d
callq 0xdefe1
movl $0x1, %r14d
cmpl $0x0, 0x10(%rsp)
je 0xde8d0
cmpl $0x0, 0xa8(%r15)
movq 0xa0(%r15), %rdx
je 0xde8fa
addq 0x18(%rbp), %rdx
movq %rdx, 0x18(%rbp)
leaq 0x64bb1(%rip), %rsi     # 0x143477
movq %rbx, %rdi
xorl %eax, %eax
callq 0xe9226
movq %rbx, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0xe9585
movq %r13, %rdi
callq 0xf6bb0
movl %r14d, %eax
addq $0xe8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
testq %rdx, %rdx
je 0xde8d0
movq 0x18(%rbx), %rdi
movq 0x18(%rbp), %rsi
callq 0xef32a
cmpl $0x504b0304, %eax       # imm = 0x504B0304
je 0xde8d0
movq 0xa0(%r15), %r12
addq 0x18(%rbp), %r12
movq 0x18(%rbx), %rdi
movq %r12, %rsi
callq 0xef32a
cmpl $0x504b0304, %eax       # imm = 0x504B0304
jne 0xde8d0
movq 0x18(%rbp), %rcx
movq 0xa0(%r15), %r8
leaq 0x64b5b(%rip), %rsi     # 0x14349e
movq %rbx, %rdi
movq %r12, %rdx
xorl %eax, %eax
callq 0xe9b27
movq 0xa0(%r15), %rax
addq %rax, 0x18(%rbp)
movl $0x1, 0xa8(%r15)
jmp 0xde8d0