// File: /workspace/github_c_makefile_star2_O3/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, 0x88(%rsp)
movq %r8, %rbp
movl %ecx, %r13d
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %rbx
movq %r8, 0x10(%rsp)
callq 0xf6410
movq %rax, %r12
movl %r13d, 0x18(%rsp)
testl %r13d, %r13d
movq %rbp, 0x28(%rsp)
je 0xdd4ca
leaq 0x66211(%rip), %rsi     # 0x1436a5
movq %rbp, %rdx
xorl %ebp, %ebp
movq %rbx, %rdi
xorl %eax, %eax
callq 0xe8617
cmpb $0x0, 0x148(%r14)
je 0xddeb7
movq %r15, 0x20(%rsp)
leaq 0xf8(%r14), %r13
movl $0x2e, %r15d
movq 0x28(%rsp), %rbp
jmp 0xdd508
movq 0x20(%r14), %rax
cmpq 0x8(%r15), %rax
je 0xdd4e2
cmpl $0x0, 0xb0(%r15)
je 0xddf51
movq %r15, 0x20(%rsp)
leaq 0x170(%r14), %r13
leaq 0x662b8(%rip), %rsi     # 0x1437ad
movq %rbx, %rdi
movq %rbp, %rdx
xorl %eax, %eax
callq 0xe8617
movl $0x1e, %r15d
movq %rbx, %rdi
movl $0x1, %esi
callq 0xe8a15
cmpb $0x0, 0x50(%r13)
je 0xdd531
leaq 0x4(%rbp), %rax
movq %rax, 0x10(%rsp)
cmpl $0x0, 0x18(%rsp)
jne 0xdd54a
jmp 0xdd5c9
movq 0x18(%rbx), %rdi
leaq 0x10(%rsp), %rsi
callq 0xeed31
cmpl $0x0, 0x18(%rsp)
je 0xddb80
movq 0x18(%rbx), %rdi
leaq 0x10(%rsp), %rsi
callq 0xeebeb
movl %eax, (%r14)
movl %eax, %edx
shrl $0x8, %edx
movl $0xff, %ecx
andl %ecx, %edx
movl %edx, 0x4(%r14)
movl %eax, %esi
andl %ecx, %esi
movl %esi, 0x8(%r14)
cmpl $0x13, %edx
ja 0xdd587
movl %edx, %ecx
leaq 0xb096f(%rip), %rsi     # 0x18def0
movq (%rsi,%rcx,8), %rcx
jmp 0xdd59c
cmpl $0x1e, %edx
leaq 0x664ad(%rip), %rsi     # 0x143a3e
leaq 0x4ebb9(%rip), %rcx     # 0x12c151
cmoveq %rsi, %rcx
movzbl %al, %esi
imull $0xcd, %esi, %r8d
shrl $0xb, %r8d
leal (%r8,%r8), %esi
leal (%rsi,%rsi,4), %esi
subb %sil, %al
movzbl %al, %r9d
leaq 0x6622a(%rip), %rsi     # 0x1437e9
movq %rbx, %rdi
xorl %eax, %eax
callq 0xe8617
movq 0x18(%rbx), %rdi
leaq 0x10(%rsp), %rsi
callq 0xeebeb
movl %eax, (%r13)
movl %eax, %edx
shrl $0x8, %edx
movl $0xff, %ecx
andl %ecx, %edx
movl %edx, 0x4(%r13)
movl %eax, %esi
andl %ecx, %esi
movl %esi, 0x8(%r13)
cmpl $0x13, %edx
movq %r14, 0x30(%rsp)
movq %r15, 0x80(%rsp)
ja 0xdd614
movl %edx, %ecx
leaq 0xb08e2(%rip), %rsi     # 0x18def0
movq (%rsi,%rcx,8), %rcx
jmp 0xdd629
cmpl $0x1e, %edx
leaq 0x66420(%rip), %rsi     # 0x143a3e
leaq 0x4eb2c(%rip), %rcx     # 0x12c151
cmoveq %rsi, %rcx
movzbl %al, %esi
imull $0xcd, %esi, %r8d
shrl $0xb, %r8d
leal (%r8,%r8), %esi
leal (%rsi,%rsi,4), %esi
subb %sil, %al
movzbl %al, %r9d
leaq 0x661cf(%rip), %rsi     # 0x14381b
xorl %r15d, %r15d
movq %rbx, %rdi
xorl %eax, %eax
callq 0xe8617
movq 0x18(%rbx), %rdi
leaq 0x10(%rsp), %r14
movq %r14, %rsi
callq 0xeebeb
movl %eax, 0x30(%r13)
movq 0x18(%rbx), %rdi
movq %r14, %rsi
callq 0xeebeb
movl %eax, 0x20(%r13)
leaq 0xb090b(%rip), %rcx     # 0x18df90
xorl %edx, %edx
cmpl %eax, (%rdx,%rcx)
je 0xdd69b
addq $0x18, %rdx
cmpq $0x210, %rdx            # imm = 0x210
jne 0xdd687
jmp 0xdd6a1
addq %rdx, %rcx
movq %rcx, %r15
movq %r15, 0x28(%r13)
movl 0x30(%r13), %eax
movl %eax, 0x1c(%rsp)
movq %r12, %rdi
callq 0xf6423
movl 0x30(%r13), %r14d
testb $0x1, %r14b
je 0xdd6d1
leaq 0x64c01(%rip), %rsi     # 0x1422c7
movq %r12, %rdi
callq 0xf7105
decl %r14d
movl 0x20(%r13), %eax
cmpl $0x6, %eax
jne 0xdd73c
leal -0x2(%r14), %r15d
testb $0x2, %r14b
cmovel %r14d, %r15d
leaq 0x66417(%rip), %rax     # 0x143b04
leaq 0x4ea7c(%rip), %rdx     # 0x12c170
cmoveq %rax, %rdx
leaq 0x66408(%rip), %rsi     # 0x143b07
movq %r12, %rdi
xorl %eax, %eax
callq 0xf7132
leal -0x4(%r15), %r14d
testb $0x4, %r15b
cmovel %r15d, %r14d
leaq 0x63e0b(%rip), %rax     # 0x141527
leaq 0x55d1e(%rip), %rdx     # 0x133441
cmoveq %rax, %rdx
leaq 0x663ef(%rip), %rsi     # 0x143b1d
movq %r12, %rdi
xorl %eax, %eax
callq 0xf7132
movl 0x20(%r13), %eax
movq 0x30(%rsp), %r15
andl $-0x2, %eax
cmpl $0x8, %eax
jne 0xdd772
movl %r14d, %eax
andl $0x6, %eax
leaq 0x67366(%rip), %rcx     # 0x144abc
movslq (%rcx,%rax,2), %rdx
addq %rcx, %rdx
leaq 0x663d1(%rip), %rsi     # 0x143b35
movq %r12, %rdi
xorl %eax, %eax
callq 0xf7132
andl $-0x7, %r14d
testb $0x8, %r14b
je 0xdd78b
leaq 0x663c3(%rip), %rsi     # 0x143b42
movq %r12, %rdi
callq 0xf7105
addl $-0x8, %r14d
btl $0xb, %r14d
jae 0xdd7a8
leaq 0x46b60(%rip), %rsi     # 0x1242f9
movq %r12, %rdi
callq 0xf7105
addl $0xfffff800, %r14d      # imm = 0xFFFFF800
testl %r14d, %r14d
je 0xdd7c1
leaq 0x488f1(%rip), %rsi     # 0x1260a5
movq %r12, %rdi
movl %r14d, %edx
xorl %eax, %eax
callq 0xf7132
movl 0x30(%r13), %ebp
movq %r12, %rdi
callq 0xf705c
leaq 0x67b8a(%rip), %rsi     # 0x14535e
movq %rbx, %rdi
movl %ebp, %edx
movq %rax, %rcx
xorl %eax, %eax
callq 0xe8617
movl 0x20(%r13), %edx
movq 0x28(%r13), %rax
testq %rax, %rax
movq %r12, 0x38(%rsp)
je 0xdd7fb
movq 0x8(%rax), %rcx
jmp 0xdd802
leaq 0x4e94f(%rip), %rcx     # 0x12c151
leaq 0x6604e(%rip), %rsi     # 0x143857
movq %rbx, %rdi
xorl %eax, %eax
callq 0xe8617
movq 0x18(%rbx), %rdi
leaq 0x10(%rsp), %r14
movq %r14, %rsi
callq 0xeebeb
movq %rax, %r12
movq 0x18(%rbx), %rdi
movq %r14, %rsi
callq 0xeebeb
leaq 0x90(%rsp), %r14
movq %r14, %rdi
movq %rax, %rsi
movq %r12, %rdx
callq 0xea92a
movb $0x2, 0x1(%r14)
leaq 0xa0(%rsp), %r12
movl $0x40, %ecx
movq %rbx, %rdi
movq %r14, %rsi
movq %r12, %rdx
xorl %r8d, %r8d
callq 0xeb0d6
leaq 0x4131c(%rip), %rsi     # 0x11eb8f
movq %rbx, %rdi
movq %r12, %rdx
xorl %eax, %eax
callq 0xe8617
cmpb $0x0, (%r14)
je 0xdd8a2
cmpl $0xa, 0x58(%r15)
jg 0xdd8a2
movups 0x90(%rsp), %xmm0
movups %xmm0, 0x48(%r15)
movl $0xa, 0x58(%r15)
shrl $0xb, 0x1c(%rsp)
movq 0x18(%rbx), %rdi
leaq 0x10(%rsp), %r14
movq %r14, %rsi
callq 0xeed83
movl %eax, 0x34(%r13)
leaq 0x669a2(%rip), %rsi     # 0x144265
movq %rbx, %rdi
movl %eax, %edx
xorl %eax, %eax
callq 0xe8617
movq 0x18(%rbx), %rdi
movq %r14, %rsi
callq 0xeed83
movq %rax, 0x10(%r13)
movq 0x20(%rsp), %rbp
movl 0xac(%rbp), %edi
leaq 0xa0(%rsp), %r12
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
movq %rax, %rsi
movq %r12, %rcx
callq 0xde7b5
leaq 0x65f65(%rip), %rsi     # 0x14386e
movq %rbx, %rdi
movq %r12, %rdx
xorl %eax, %eax
callq 0xe8617
movq 0x18(%rbx), %rdi
movq %r14, %rsi
callq 0xeed83
movq %rax, 0x18(%r13)
movl 0xac(%rbp), %edi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
movq %rax, %rsi
movq %r12, %rcx
callq 0xde7b5
leaq 0x65f29(%rip), %rsi     # 0x14386c
movq %rbx, %rdi
movq %r12, %rdx
xorl %eax, %eax
callq 0xe8617
cmpb $0x0, 0x50(%r13)
je 0xdd985
movq 0x10(%rsp), %rax
leaq 0x4(%rax), %rcx
movq %rcx, 0x10(%rsp)
cmpl $0x0, 0x18(%rsp)
movq 0x38(%rsp), %r12
movq 0x28(%rsp), %rbp
je 0xddb7a
addq $0x6, %rax
movq %rax, 0x10(%rsp)
jmp 0xdd9d1
movq 0x18(%rbx), %rdi
leaq 0x10(%rsp), %r14
movq %r14, %rsi
callq 0xeebeb
movq %rax, 0x58(%r13)
movq 0x18(%rbx), %rdi
movq %r14, %rsi
callq 0xeebeb
movq %rax, 0x60(%r13)
cmpl $0x0, 0x18(%rsp)
movq 0x38(%rsp), %r12
movq 0x28(%rsp), %rbp
je 0xddbbb
movq 0x18(%rbx), %rdi
leaq 0x10(%rsp), %rsi
callq 0xeebeb
movq %rax, 0x68(%r13)
movq 0x18(%rbx), %rdi
leaq 0x10(%rsp), %r14
movq %r14, %rsi
callq 0xeebeb
movq %rax, 0x20(%r15)
movq 0x18(%rbx), %rdi
movq %r14, %rsi
callq 0xeebeb
movl %eax, 0xc(%r15)
movq %r12, %rdi
callq 0xf6423
movl 0xc(%r15), %ebp
testb $0x1, %bpl
je 0xdda19
leaq 0x6615e(%rip), %rsi     # 0x143b6d
movq %r12, %rdi
callq 0xf7105
decl %ebp
testl %ebp, %ebp
je 0xdda30
leaq 0x48681(%rip), %rsi     # 0x1260a5
movq %r12, %rdi
movl %ebp, %edx
xorl %eax, %eax
callq 0xf7132
movl 0xc(%r15), %ebp
movq %r12, %rdi
callq 0xf705c
leaq 0x65e39(%rip), %rsi     # 0x14387c
movq %rbx, %rdi
movl %ebp, %edx
movq %rax, %rcx
xorl %eax, %eax
callq 0xe8617
movq 0x18(%rbx), %rdi
leaq 0x10(%rsp), %rsi
callq 0xeed83
movl %eax, 0x10(%r15)
leaq 0x65e37(%rip), %rsi     # 0x1438a2
movq %rbx, %rdi
movl %eax, %edx
xorl %eax, %eax
callq 0xe8617
movq %rbx, %rdi
movl $0x1, %esi
callq 0xe8a15
movzbl 0x10(%r15), %ebp
movq %r12, %rdi
callq 0xf6423
movq %rbx, %rdi
movl %ebp, %esi
movq %r12, %rdx
xorl %ecx, %ecx
callq 0xeaae1
cmpl $0x0, 0x4(%r15)
leaq 0x67604(%rip), %rax     # 0x1450b0
leaq 0x65e2e(%rip), %r14     # 0x1438e1
movq %r12, %rdi
movq %r14, %r12
cmoveq %rax, %r12
callq 0xf705c
leaq 0x65dfa(%rip), %rsi     # 0x1438c3
movq %rbx, %rdi
movq %r12, %rdx
movl %ebp, %ecx
movq %rax, %r8
xorl %eax, %eax
callq 0xe8617
movl 0x10(%r15), %ecx
cmpl $0x10000, %ecx          # imm = 0x10000
jb 0xddb15
testb $0x4, 0xc(%r15)
jne 0xddb15
shrl $0x10, %ecx
cmpl $0x3, 0x4(%r15)
leaq 0x675b3(%rip), %rax     # 0x1450b0
cmoveq %rax, %r14
leaq 0x65de9(%rip), %rsi     # 0x1438f1
movq %rbx, %rdi
movq %r14, %rdx
xorl %eax, %eax
callq 0xe8617
movq %rbx, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0xe8a15
movq 0x18(%rbx), %rdi
leaq 0x10(%rsp), %rsi
callq 0xeed83
movq %rax, 0x18(%r15)
movq 0x20(%rsp), %rcx
movl 0xac(%rcx), %edi
leaq 0xa0(%rsp), %r14
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
movq %rax, %rsi
movq %r14, %rcx
callq 0xde7b5
movl 0x20(%r15), %ecx
leaq 0x65dab(%rip), %rsi     # 0x14390d
movq %rbx, %rdi
movq %r14, %rdx
xorl %eax, %eax
callq 0xe8617
movq 0x58(%r13), %rdx
movq 0x28(%rsp), %rbp
jmp 0xddbd6
movq 0x60(%r13), %rax
jmp 0xddbc8
xorl %ecx, %ecx
movq 0x20(%rsp), %rdx
cmpb $0x0, 0xad(%rdx)
setne %cl
leal 0x504b0304(,%rcx,2), %ecx
cmpl %eax, %ecx
je 0xdd5c9
leaq 0x65c1f(%rip), %rsi     # 0x1437c6
movq %rbp, %rdx
xorl %ebp, %ebp
movq %rbx, %rdi
xorl %eax, %eax
callq 0xe9295
jmp 0xddeb7
movq $0x0, 0x68(%r13)
movq 0x10(%rsp), %rcx
movq 0x58(%r13), %rdx
addq %rdx, %rax
addq %rcx, %rax
movq %rax, 0x28(%r15)
movl 0x1c(%rsp), %r12d
andl $0x1, %r12d
leaq 0x4e9c8(%rip), %rsi     # 0x12c5ae
movq %rbx, %rdi
xorl %eax, %eax
callq 0xe8617
movl 0x60(%r13), %edx
leaq 0x65d3a(%rip), %rsi     # 0x143935
movq %rbx, %rdi
xorl %eax, %eax
callq 0xe8617
cmpl $0x0, 0x18(%rsp)
je 0xddc21
movl 0x68(%r13), %edx
leaq 0x4842c(%rip), %rsi     # 0x126043
movq %rbx, %rdi
xorl %eax, %eax
callq 0xe8617
movq 0x58(%r13), %rax
movq 0x80(%rsp), %rdx
addq %rdx, %rax
addq 0x60(%r13), %rax
addq 0x68(%r13), %rax
movq 0x88(%rsp), %rcx
movq %rax, (%rcx)
addq %rdx, %rbp
movq %rbp, 0x38(%r13)
movq 0x48(%r13), %rdi
movq 0x58(%r13), %r14
movq %r14, 0x40(%r13)
callq 0xf6423
movl $0x2, %r9d
movl %r12d, 0x1c(%rsp)
testl %r12d, %r12d
jne 0xddc73
movq 0x20(%rsp), %rax
movl (%rax), %r9d
movq 0x18(%rbx), %rdi
movq 0x48(%r13), %rcx
movq %rbp, %rsi
movq %r14, %rdx
xorl %r8d, %r8d
callq 0xefbd7
movq 0x48(%r13), %rdi
callq 0xf70f6
leaq 0x5e0b5(%rip), %rsi     # 0x13bd4e
movq %rbx, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0xe8617
movq 0x60(%r13), %r12
testq %r12, %r12
jle 0xdde3f
movq 0x58(%r13), %r14
movq %rbp, 0x28(%rsp)
addq %rbp, %r14
leaq 0x65eb1(%rip), %rsi     # 0x143b77
movq %rbx, %rdi
movq %r14, %rdx
movl %r12d, %ecx
xorl %eax, %eax
callq 0xe8617
movq %rbx, %rdi
movl $0x1, %esi
callq 0xe8a15
cmpq $0x5, %r12
jb 0xdde28
addq %r14, %r12
leaq 0x4(%r14), %rbp
leaq 0xb04c5(%rip), %r15     # 0x18e1c0
xorps %xmm0, %xmm0
movaps %xmm0, 0x60(%rsp)
movaps %xmm0, 0x40(%rsp)
movaps %xmm0, 0x50(%rsp)
movq $0x0, 0x70(%rsp)
movq 0x30(%rsp), %rax
movq %rax, 0x60(%rsp)
movq %r13, 0x68(%rsp)
movl 0x18(%rsp), %eax
movl %eax, 0x70(%rsp)
movq %rbp, 0x48(%rsp)
movq 0x18(%rbx), %rdi
movq %r14, %rsi
callq 0xeebc8
movl %eax, 0x40(%rsp)
movq 0x18(%rbx), %rdi
leaq 0x2(%r14), %rsi
callq 0xeebc8
movq %rax, 0x50(%rsp)
movl 0x40(%rsp), %edx
xorl %ecx, %ecx
movzwl (%rcx,%r15), %esi
cmpl %esi, %edx
je 0xddd79
addq $0x18, %rcx
cmpq $0x510, %rcx            # imm = 0x510
jne 0xddd5a
leaq 0xb0429(%rip), %rcx     # 0x18e1a0
jmp 0xddd7c
addq %r15, %rcx
movq %rcx, 0x58(%rsp)
movq 0x8(%rcx), %rcx
movq %rbx, %rdi
leaq 0x65e02(%rip), %rsi     # 0x143b91
movl %eax, %r8d
xorl %eax, %eax
callq 0xe8617
addq 0x50(%rsp), %rbp
cmpq %r12, %rbp
jg 0xdde28
movq %rbx, %rdi
movl $0x1, %esi
callq 0xe8a15
movq 0x58(%rsp), %rax
movq 0x10(%rax), %rax
testq %rax, %rax
je 0xdddd3
movq %rbx, %rdi
movq 0x20(%rsp), %rsi
leaq 0x40(%rsp), %rdx
callq *%rax
jmp 0xdddfe
cmpl $0x2, (%rbx)
jl 0xdddfe
movq 0x18(%rbx), %rsi
movq 0x48(%rsp), %rdx
movq 0x50(%rsp), %rcx
movl $0x1, (%rsp)
movl $0x100, %r8d            # imm = 0x100
movq %rbx, %rdi
xorl %r9d, %r9d
callq 0xe8bea
movq %rbx, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0xe8a15
movq 0x50(%rsp), %rax
leaq (%r14,%rax), %rbp
addq $0x8, %rbp
addq %rax, %r14
addq $0x4, %r14
cmpq %r12, %rbp
jl 0xddcfb
movq %rbx, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0xe8a15
movq 0x30(%rsp), %r15
movq 0x28(%rsp), %rbp
movq 0x68(%r13), %rcx
testq %rcx, %rcx
jle 0xdde77
addq 0x58(%r13), %rbp
addq 0x60(%r13), %rbp
leaq 0x3a6db(%rip), %rax     # 0x118532
movq %rax, (%rsp)
leaq 0x65ae1(%rip), %r9      # 0x143943
movq %rbx, %rdi
movq 0x20(%rsp), %rsi
movq %rbp, %rdx
movl 0x1c(%rsp), %r8d
callq 0xde5f9
movl $0x1, %ebp
cmpl $0x0, 0x18(%rsp)
movq 0x38(%rsp), %r12
je 0xddeb7
movq 0x20(%rsp), %r13
cmpl $0x0, 0xa8(%r13)
movq 0xa0(%r13), %rdx
je 0xddee0
addq 0x18(%r15), %rdx
movq %rdx, 0x18(%r15)
leaq 0x65aaa(%rip), %rsi     # 0x143957
movq %rbx, %rdi
xorl %eax, %eax
callq 0xe8617
movq %rbx, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0xe8a15
movq %r12, %rdi
callq 0xf6753
movl %ebp, %eax
addq $0xe8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
testq %rdx, %rdx
je 0xddeb7
movq 0x18(%rbx), %rdi
movq 0x18(%r15), %rsi
callq 0xeed0d
cmpl $0x504b0304, %eax       # imm = 0x504B0304
je 0xddeb7
movq 0xa0(%r13), %r14
addq 0x18(%r15), %r14
movq 0x18(%rbx), %rdi
movq %r14, %rsi
callq 0xeed0d
cmpl $0x504b0304, %eax       # imm = 0x504B0304
jne 0xddeb7
movq 0x18(%r15), %rcx
movq 0xa0(%r13), %r8
leaq 0x65a55(%rip), %rsi     # 0x14397e
movq %rbx, %rdi
movq %r14, %rdx
xorl %eax, %eax
callq 0xe8faa
movq 0xa0(%r13), %rax
addq %rax, 0x18(%r15)
movl $0x1, 0xa8(%r13)
jmp 0xddeb7
movq 0x18(%rbx), %rdi
leaq 0xe(%rbp), %rsi
callq 0xeed61
cmpl %eax, 0x12c(%r14)
jne 0xddf9b
cmpb $0x0, 0xae(%r15)
jne 0xdd4e2
movq 0x8(%r15), %rdx
movq 0x20(%r14), %rcx
leaq 0x657c6(%rip), %rsi     # 0x14374a
movq %rbx, %rdi
xorl %eax, %eax
callq 0xe8faa
movb $0x1, 0xae(%r15)
jmp 0xdd4e2
leaq 0x65787(%rip), %rsi     # 0x143729
xorl %ebp, %ebp
movq %rbx, %rdi
xorl %eax, %eax
callq 0xe9295
jmp 0xddecc