// File: /workspace/github_c_makefile_star2_O0/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;
	u32 sig;
	i64 fn_len, extra_len, comment_len;
	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);
	}
	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);

	sig = (u32)de_getu32be_p(&pos);
	if(is_central && sig!=(d->is_resof?CODE_PK14:CODE_PK12)) {
		de_err(c, "Central dir file header not found at %"I64_FMT, pos1);
		goto done;
	}
	else 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)));

	fn_len = de_getu16le_p(&pos);
	extra_len = de_getu16le_p(&pos);
	if(is_central) {
		comment_len = de_getu16le_p(&pos);
	}
	else {
		comment_len = 0;
	}

	if(!is_central) {
		md->file_data_pos = pos + fn_len + 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)fn_len);
	de_dbg(c, "extra len: %d", (int)extra_len);
	if(is_central) {
		de_dbg(c, "comment len: %d", (int)comment_len);
	}

	*p_entry_size = fixed_header_size + fn_len + extra_len + comment_len;

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

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

	if(comment_len>0) {
		do_comment(c, d, pos1+fixed_header_size+fn_len+extra_len, 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
movq %rsp, %rbp
subq $0x190, %rsp            # imm = 0x190
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movl %ecx, -0x24(%rbp)
movq %r8, -0x30(%rbp)
movq %r9, -0x38(%rbp)
movl $0x0, -0x68(%rbp)
movq $0x0, -0x90(%rbp)
movq -0x30(%rbp), %rax
movq %rax, -0x40(%rbp)
movq -0x10(%rbp), %rdi
callq 0x1711d0
movq %rax, -0x90(%rbp)
cmpl $0x0, -0x24(%rbp)
je 0x1494b6
movq -0x20(%rbp), %rax
addq $0xf8, %rax
movq %rax, -0x88(%rbp)
movq $0x2e, -0x70(%rbp)
movq -0x10(%rbp), %rdi
movq -0x40(%rbp), %rdx
leaq 0x85d05(%rip), %rsi     # 0x1cf1af
movb $0x0, %al
callq 0x15b0d0
jmp 0x149593
movq -0x20(%rbp), %rax
addq $0x148, %rax            # imm = 0x148
movq %rax, -0x88(%rbp)
movq $0x1e, -0x70(%rbp)
movq -0x20(%rbp), %rax
movq 0x20(%rax), %rax
movq -0x18(%rbp), %rcx
cmpq 0x8(%rcx), %rax
je 0x14957d
movq -0x18(%rbp), %rax
cmpl $0x0, 0xb0(%rax)
jne 0x14957d
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x30(%rbp), %rsi
addq $0xe, %rsi
callq 0x165540
movl %eax, -0xe4(%rbp)
movl -0xe4(%rbp), %eax
movq -0x20(%rbp), %rcx
cmpl 0x12c(%rcx), %eax
je 0x149541
movq -0x10(%rbp), %rdi
leaq 0x85d05(%rip), %rsi     # 0x1cf233
movb $0x0, %al
callq 0x15bfb0
movl $0x0, -0x4(%rbp)
jmp 0x149fc7
movq -0x18(%rbp), %rax
cmpb $0x0, 0xae(%rax)
jne 0x14957b
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rdx
movq -0x20(%rbp), %rax
movq 0x20(%rax), %rcx
leaq 0x85ceb(%rip), %rsi     # 0x1cf254
movb $0x0, %al
callq 0x15bc10
movq -0x18(%rbp), %rax
movb $0x1, 0xae(%rax)
jmp 0x14957d
movq -0x10(%rbp), %rdi
movq -0x40(%rbp), %rdx
leaq 0x85d2b(%rip), %rsi     # 0x1cf2b7
movb $0x0, %al
callq 0x15b0d0
movq -0x10(%rbp), %rdi
movl $0x1, %esi
callq 0x15b560
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rdi
leaq -0x40(%rbp), %rsi
callq 0x1654b0
movl %eax, -0x44(%rbp)
cmpl $0x0, -0x24(%rbp)
je 0x1495f8
movl -0x44(%rbp), %eax
movq -0x18(%rbp), %rcx
movzbl 0xad(%rcx), %esi
movl $0x504b0102, %ecx       # imm = 0x504B0102
movl $0x504b0104, %edx       # imm = 0x504B0104
cmpl $0x0, %esi
cmovnel %edx, %ecx
cmpl %ecx, %eax
je 0x1495f8
movq -0x10(%rbp), %rdi
movq -0x30(%rbp), %rdx
leaq 0x85ce4(%rip), %rsi     # 0x1cf2d0
movb $0x0, %al
callq 0x15bfb0
jmp 0x149fa7
cmpl $0x0, -0x24(%rbp)
jne 0x14963b
movl -0x44(%rbp), %eax
movq -0x18(%rbp), %rcx
movzbl 0xad(%rcx), %esi
movl $0x504b0304, %ecx       # imm = 0x504B0304
movl $0x504b0306, %edx       # imm = 0x504B0306
cmpl $0x0, %esi
cmovnel %edx, %ecx
cmpl %ecx, %eax
je 0x14963b
movq -0x10(%rbp), %rdi
movq -0x30(%rbp), %rdx
leaq 0x85cca(%rip), %rsi     # 0x1cf2f9
movb $0x0, %al
callq 0x15bfb0
jmp 0x149fa7
jmp 0x14963d
cmpl $0x0, -0x24(%rbp)
je 0x1496f1
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rdi
leaq -0x40(%rbp), %rsi
callq 0x1652c0
movl %eax, %ecx
movq -0x20(%rbp), %rax
movl %ecx, (%rax)
movq -0x20(%rbp), %rax
movl (%rax), %ecx
andl $0xff00, %ecx           # imm = 0xFF00
shrl $0x8, %ecx
movq -0x20(%rbp), %rax
movl %ecx, 0x4(%rax)
movq -0x20(%rbp), %rax
movl (%rax), %ecx
andl $0xff, %ecx
movq -0x20(%rbp), %rax
movl %ecx, 0x8(%rax)
movq -0x10(%rbp), %rax
movq %rax, -0x108(%rbp)
movq -0x20(%rbp), %rax
movl 0x4(%rax), %eax
movl %eax, -0xfc(%rbp)
movq -0x20(%rbp), %rax
movl 0x4(%rax), %edi
callq 0x14a1e0
movq -0x108(%rbp), %rdi
movq %rax, %rcx
movq -0x20(%rbp), %rax
movl 0x8(%rax), %eax
movl $0xa, %esi
xorl %edx, %edx
divl %esi
movl %eax, %r8d
movq -0x20(%rbp), %rax
movl 0x8(%rax), %eax
movl $0xa, %esi
xorl %edx, %edx
divl %esi
movl %edx, %r9d
movl -0xfc(%rbp), %edx
leaq 0x85c32(%rip), %rsi     # 0x1cf31c
movb $0x0, %al
callq 0x15b0d0
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rdi
leaq -0x40(%rbp), %rsi
callq 0x1652c0
movl %eax, %ecx
movq -0x88(%rbp), %rax
movl %ecx, (%rax)
movq -0x88(%rbp), %rax
movl (%rax), %ecx
andl $0xff00, %ecx           # imm = 0xFF00
shrl $0x8, %ecx
movq -0x88(%rbp), %rax
movl %ecx, 0x4(%rax)
movq -0x88(%rbp), %rax
movl (%rax), %ecx
andl $0xff, %ecx
movq -0x88(%rbp), %rax
movl %ecx, 0x8(%rax)
movq -0x10(%rbp), %rax
movq %rax, -0x138(%rbp)
movq -0x88(%rbp), %rax
movl 0x4(%rax), %eax
movl %eax, -0x12c(%rbp)
movq -0x88(%rbp), %rax
movl 0x4(%rax), %edi
callq 0x14a1e0
movq -0x138(%rbp), %rdi
movq %rax, %rcx
movq -0x88(%rbp), %rax
movl 0x8(%rax), %eax
movl $0xa, %esi
xorl %edx, %edx
divl %esi
movl %eax, %r8d
movq -0x88(%rbp), %rax
movl 0x8(%rax), %eax
movl $0xa, %esi
xorl %edx, %edx
divl %esi
movl %edx, %r9d
movl -0x12c(%rbp), %edx
leaq 0x85b9f(%rip), %rsi     # 0x1cf34e
movb $0x0, %al
callq 0x15b0d0
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rdi
leaq -0x40(%rbp), %rsi
callq 0x1652c0
movl %eax, %ecx
movq -0x88(%rbp), %rax
movl %ecx, 0x30(%rax)
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rdi
leaq -0x40(%rbp), %rsi
callq 0x1652c0
movl %eax, %ecx
movq -0x88(%rbp), %rax
movl %ecx, 0x20(%rax)
movq -0x88(%rbp), %rax
movl 0x20(%rax), %edi
callq 0x14a230
movq %rax, %rcx
movq -0x88(%rbp), %rax
movq %rcx, 0x28(%rax)
movq -0x88(%rbp), %rax
movl 0x30(%rax), %edx
andl $0x800, %edx            # imm = 0x800
xorl %eax, %eax
movl $0x1, %ecx
cmpl $0x0, %edx
cmovnel %ecx, %eax
movl %eax, -0x64(%rbp)
movq -0x90(%rbp), %rdi
callq 0x171210
movq -0x10(%rbp), %rdi
movq -0x88(%rbp), %rsi
movq -0x90(%rbp), %rdx
callq 0x14a290
movq -0x10(%rbp), %rax
movq %rax, -0x128(%rbp)
movq -0x88(%rbp), %rax
movl 0x30(%rax), %eax
movl %eax, -0x11c(%rbp)
movq -0x90(%rbp), %rdi
callq 0x172500
movq -0x128(%rbp), %rdi
movl -0x11c(%rbp), %edx
movq %rax, %rcx
leaq 0x875e0(%rip), %rsi     # 0x1d0e6e
movb $0x0, %al
callq 0x15b0d0
movq -0x10(%rbp), %rax
movq %rax, -0x118(%rbp)
movq -0x88(%rbp), %rax
movl 0x20(%rax), %eax
movl %eax, -0x10c(%rbp)
movq -0x88(%rbp), %rax
cmpq $0x0, 0x28(%rax)
je 0x1498d6
movq -0x88(%rbp), %rax
movq 0x28(%rax), %rax
movq 0x8(%rax), %rax
movq %rax, -0x140(%rbp)
jmp 0x1498e6
leaq 0x6e350(%rip), %rax     # 0x1b7c2d
movq %rax, -0x140(%rbp)
jmp 0x1498e6
movl -0x10c(%rbp), %edx
movq -0x118(%rbp), %rdi
movq -0x140(%rbp), %rcx
leaq 0x85a89(%rip), %rsi     # 0x1cf38a
movb $0x0, %al
callq 0x15b0d0
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rdi
leaq -0x40(%rbp), %rsi
callq 0x1652c0
movq %rax, -0x78(%rbp)
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rdi
leaq -0x40(%rbp), %rsi
callq 0x1652c0
movq %rax, -0x80(%rbp)
movq -0x80(%rbp), %rsi
movq -0x78(%rbp), %rdx
leaq -0xa0(%rbp), %rdi
callq 0x15d750
movb $0x2, -0x9f(%rbp)
movq -0x10(%rbp), %rdi
leaq -0xe0(%rbp), %rdx
leaq -0xa0(%rbp), %rsi
movl $0x40, %ecx
xorl %r8d, %r8d
callq 0x15e2d0
movq -0x10(%rbp), %rdi
leaq -0xe0(%rbp), %rdx
leaq 0x60d8d(%rip), %rsi     # 0x1aa70b
movb $0x0, %al
callq 0x15b0d0
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0x20(%rbp), %rdx
xorl %ecx, %ecx
leaq -0xa0(%rbp), %r8
movl $0xa, %r9d
callq 0x14a470
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rdi
leaq -0x40(%rbp), %rsi
callq 0x165580
movl %eax, %ecx
movq -0x88(%rbp), %rax
movl %ecx, 0x34(%rax)
movq -0x10(%rbp), %rdi
movq -0x88(%rbp), %rax
movl 0x34(%rax), %edx
leaq 0x863c1(%rip), %rsi     # 0x1cfd98
movb $0x0, %al
callq 0x15b0d0
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rdi
leaq -0x40(%rbp), %rsi
callq 0x165580
movq %rax, %rcx
movq -0x88(%rbp), %rax
movq %rcx, 0x10(%rax)
movq -0x10(%rbp), %rax
movq %rax, -0x150(%rbp)
movq -0x18(%rbp), %rdi
movq -0x88(%rbp), %rax
movq 0x10(%rax), %rsi
leaq -0xe0(%rbp), %rdx
movl $0x40, %ecx
callq 0x14a500
movq -0x150(%rbp), %rdi
movq %rax, %rdx
leaq 0x85968(%rip), %rsi     # 0x1cf3a1
movb $0x0, %al
callq 0x15b0d0
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rdi
leaq -0x40(%rbp), %rsi
callq 0x165580
movq %rax, %rcx
movq -0x88(%rbp), %rax
movq %rcx, 0x18(%rax)
movq -0x10(%rbp), %rax
movq %rax, -0x148(%rbp)
movq -0x18(%rbp), %rdi
movq -0x88(%rbp), %rax
movq 0x18(%rax), %rsi
leaq -0xe0(%rbp), %rdx
movl $0x40, %ecx
callq 0x14a500
movq -0x148(%rbp), %rdi
movq %rax, %rdx
leaq 0x85904(%rip), %rsi     # 0x1cf39f
movb $0x0, %al
callq 0x15b0d0
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rdi
leaq -0x40(%rbp), %rsi
callq 0x1652c0
movq %rax, -0x50(%rbp)
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rdi
leaq -0x40(%rbp), %rsi
callq 0x1652c0
movq %rax, -0x58(%rbp)
cmpl $0x0, -0x24(%rbp)
je 0x149ae9
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rdi
leaq -0x40(%rbp), %rsi
callq 0x1652c0
movq %rax, -0x60(%rbp)
jmp 0x149af1
movq $0x0, -0x60(%rbp)
cmpl $0x0, -0x24(%rbp)
jne 0x149b0b
movq -0x40(%rbp), %rcx
addq -0x50(%rbp), %rcx
addq -0x58(%rbp), %rcx
movq -0x20(%rbp), %rax
movq %rcx, 0x28(%rax)
cmpl $0x0, -0x24(%rbp)
je 0x149d59
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rdi
leaq -0x40(%rbp), %rsi
callq 0x1652c0
movq %rax, %rcx
movq -0x20(%rbp), %rax
movq %rcx, 0x20(%rax)
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rdi
leaq -0x40(%rbp), %rsi
callq 0x1652c0
movl %eax, %ecx
movq -0x20(%rbp), %rax
movl %ecx, 0xc(%rax)
movq -0x90(%rbp), %rdi
callq 0x171210
movq -0x10(%rbp), %rdi
movq -0x20(%rbp), %rsi
movq -0x90(%rbp), %rdx
callq 0x14a540
movq -0x10(%rbp), %rax
movq %rax, -0x178(%rbp)
movq -0x20(%rbp), %rax
movl 0xc(%rax), %eax
movl %eax, -0x16c(%rbp)
movq -0x90(%rbp), %rdi
callq 0x172500
movq -0x178(%rbp), %rdi
movl -0x16c(%rbp), %edx
movq %rax, %rcx
leaq 0x85809(%rip), %rsi     # 0x1cf3af
movb $0x0, %al
callq 0x15b0d0
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rdi
leaq -0x40(%rbp), %rsi
callq 0x165580
movl %eax, %ecx
movq -0x20(%rbp), %rax
movl %ecx, 0x10(%rax)
movq -0x10(%rbp), %rdi
movq -0x20(%rbp), %rax
movl 0x10(%rax), %edx
leaq 0x857fc(%rip), %rsi     # 0x1cf3d5
movb $0x0, %al
callq 0x15b0d0
movq -0x10(%rbp), %rdi
movl $0x1, %esi
callq 0x15b560
movq -0x20(%rbp), %rax
movl 0x10(%rax), %eax
andl $0xff, %eax
movl %eax, -0xe8(%rbp)
movq -0x90(%rbp), %rdi
callq 0x171210
movq -0x10(%rbp), %rdi
movl -0xe8(%rbp), %esi
movq -0x90(%rbp), %rdx
xorl %ecx, %ecx
callq 0x15d9f0
movq -0x10(%rbp), %rax
movq %rax, -0x168(%rbp)
movq -0x20(%rbp), %rax
movl 0x4(%rax), %edx
leaq 0x857d7(%rip), %rax     # 0x1cf414
leaq 0x86f8c(%rip), %rcx     # 0x1d0bd0
cmpl $0x0, %edx
cmoveq %rcx, %rax
movq %rax, -0x160(%rbp)
movl -0xe8(%rbp), %eax
movl %eax, -0x154(%rbp)
movq -0x90(%rbp), %rdi
callq 0x172500
movq -0x168(%rbp), %rdi
movq -0x160(%rbp), %rdx
movl -0x154(%rbp), %ecx
movq %rax, %r8
leaq 0x8576e(%rip), %rsi     # 0x1cf3f6
movb $0x0, %al
callq 0x15b0d0
movq -0x20(%rbp), %rax
movl 0x10(%rax), %eax
shrl $0x10, %eax
cmpl $0x0, %eax
je 0x149ce5
movq -0x20(%rbp), %rax
movl 0xc(%rax), %eax
andl $0x4, %eax
cmpl $0x0, %eax
jne 0x149ce5
movq -0x10(%rbp), %rdi
movq -0x20(%rbp), %rax
movl 0x4(%rax), %ecx
leaq 0x85755(%rip), %rdx     # 0x1cf414
leaq 0x86f0a(%rip), %rax     # 0x1d0bd0
cmpl $0x3, %ecx
cmoveq %rax, %rdx
movq -0x20(%rbp), %rax
movl 0x10(%rax), %ecx
shrl $0x10, %ecx
leaq 0x85746(%rip), %rsi     # 0x1cf424
movb $0x0, %al
callq 0x15b0d0
movq -0x10(%rbp), %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0x15b560
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rdi
leaq -0x40(%rbp), %rsi
callq 0x165580
movq %rax, %rcx
movq -0x20(%rbp), %rax
movq %rcx, 0x18(%rax)
movq -0x10(%rbp), %rax
movq %rax, -0x180(%rbp)
movq -0x18(%rbp), %rdi
movq -0x20(%rbp), %rax
movq 0x18(%rax), %rsi
leaq -0xe0(%rbp), %rdx
movl $0x40, %ecx
callq 0x14a500
movq -0x180(%rbp), %rdi
movq %rax, %rdx
movq -0x20(%rbp), %rax
movq 0x20(%rax), %rax
movl %eax, %ecx
leaq 0x856ee(%rip), %rsi     # 0x1cf440
movb $0x0, %al
callq 0x15b0d0
movq -0x10(%rbp), %rdi
movq -0x50(%rbp), %rax
movl %eax, %edx
leaq 0x6e320(%rip), %rsi     # 0x1b808a
movb $0x0, %al
callq 0x15b0d0
movq -0x10(%rbp), %rdi
movq -0x58(%rbp), %rax
movl %eax, %edx
leaq 0x856e6(%rip), %rsi     # 0x1cf468
movb $0x0, %al
callq 0x15b0d0
cmpl $0x0, -0x24(%rbp)
je 0x149da7
movq -0x10(%rbp), %rdi
movq -0x60(%rbp), %rax
movl %eax, %edx
leaq 0x67ae0(%rip), %rsi     # 0x1b1880
movb $0x0, %al
callq 0x15b0d0
movq -0x70(%rbp), %rcx
addq -0x50(%rbp), %rcx
addq -0x58(%rbp), %rcx
addq -0x60(%rbp), %rcx
movq -0x38(%rbp), %rax
movq %rcx, (%rax)
movq -0x30(%rbp), %rcx
addq -0x70(%rbp), %rcx
movq -0x88(%rbp), %rax
movq %rcx, 0x38(%rax)
movq -0x50(%rbp), %rcx
movq -0x88(%rbp), %rax
movq %rcx, 0x40(%rax)
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0x20(%rbp), %rdx
movq -0x88(%rbp), %rcx
movq -0x30(%rbp), %r8
addq -0x70(%rbp), %r8
movq -0x50(%rbp), %r9
movl -0x64(%rbp), %eax
movl %eax, (%rsp)
callq 0x14a5b0
cmpq $0x0, -0x58(%rbp)
jle 0x149e3f
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0x20(%rbp), %rdx
movq -0x88(%rbp), %rcx
movq -0x30(%rbp), %r8
addq -0x70(%rbp), %r8
addq -0x50(%rbp), %r8
movq -0x58(%rbp), %r9
movl -0x24(%rbp), %eax
movl %eax, (%rsp)
callq 0x14a660
cmpq $0x0, -0x60(%rbp)
jle 0x149e7d
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0x30(%rbp), %rdx
addq -0x70(%rbp), %rdx
addq -0x50(%rbp), %rdx
addq -0x58(%rbp), %rdx
movq -0x60(%rbp), %rcx
movl -0x64(%rbp), %r8d
leaq 0x85609(%rip), %r9      # 0x1cf476
leaq 0x5a3db(%rip), %rax     # 0x1a424f
movq %rax, (%rsp)
callq 0x14a830
cmpl $0x0, -0x24(%rbp)
je 0x149fa0
movq -0x18(%rbp), %rax
cmpl $0x0, 0xa8(%rax)
je 0x149eca
movq -0x18(%rbp), %rax
movq 0xa0(%rax), %rcx
movq -0x20(%rbp), %rax
addq 0x18(%rax), %rcx
movq %rcx, 0x18(%rax)
movq -0x10(%rbp), %rdi
movq -0x20(%rbp), %rax
movq 0x18(%rax), %rdx
leaq 0x855cc(%rip), %rsi     # 0x1cf48a
movb $0x0, %al
callq 0x15b0d0
jmp 0x149f9e
movq -0x18(%rbp), %rax
cmpq $0x0, 0xa0(%rax)
je 0x149f9c
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x20(%rbp), %rax
movq 0x18(%rax), %rsi
callq 0x165470
movl %eax, -0xec(%rbp)
cmpl $0x504b0304, -0xec(%rbp) # imm = 0x504B0304
je 0x149f9a
movq -0x20(%rbp), %rax
movq 0x18(%rax), %rax
movq -0x18(%rbp), %rcx
addq 0xa0(%rcx), %rax
movq %rax, -0xf8(%rbp)
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0xf8(%rbp), %rsi
callq 0x165470
movl %eax, -0xf0(%rbp)
cmpl $0x504b0304, -0xf0(%rbp) # imm = 0x504B0304
jne 0x149f98
movq -0x10(%rbp), %rdi
movq -0xf8(%rbp), %rdx
movq -0x20(%rbp), %rax
movq 0x18(%rax), %rcx
movq -0x18(%rbp), %rax
movq 0xa0(%rax), %r8
leaq 0x85545(%rip), %rsi     # 0x1cf4b1
movb $0x0, %al
callq 0x15bc10
movq -0x18(%rbp), %rax
movq 0xa0(%rax), %rcx
movq -0x20(%rbp), %rax
addq 0x18(%rax), %rcx
movq %rcx, 0x18(%rax)
movq -0x18(%rbp), %rax
movl $0x1, 0xa8(%rax)
jmp 0x149f9a
jmp 0x149f9c
jmp 0x149f9e
jmp 0x149fa0
movl $0x1, -0x68(%rbp)
movq -0x10(%rbp), %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0x15b560
movq -0x90(%rbp), %rdi
callq 0x171750
movl -0x68(%rbp), %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x190, %rsp            # imm = 0x190
popq %rbp
retq
nopw %cs:(%rax,%rax)