// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/zoo.c
// Function: do_member_header
static int do_member_header(deark *c, lctx *d, struct de_arch_member_data *md)
{
	struct zoo_member_data *mdz = (struct zoo_member_data*)md->userdata;
	de_ucstring *shortname = NULL;
	de_ucstring *longname = NULL;
	int retval = 0;
	i64 pos;
	i64 hdr_endpos;
	i64 lvar; // length of "variable part" of type-2 header
	i64 lnamu; // length of long filename
	i64 ldiru; // length of directory name
	UI sig;
	UI attribs_type;
	char descrbuf[80];

	pos = md->member_hdr_pos;
	sig = (UI)de_getu32le_p(&pos);
	if(sig != ZOO_SIGNATURE) {
		de_err(c, "Malformed Zoo file, bad magic number at %"I64_FMT, md->member_hdr_pos);
		goto done;
	}

	mdz->type   = de_getbyte_p(&pos);
	mdz->has_ext_header = (u8)(mdz->type == 2);
	mdz->method = de_getbyte_p(&pos);
	mdz->next_member_hdr_pos = de_getu32le_p(&pos);

	de_dbg(c, "member header format version (\"type\"): %d", (int)mdz->type);
	if(mdz->next_member_hdr_pos) {
		de_dbg(c, "compression method: %d (%s)", (int)mdz->method, get_cmpr_meth_name(mdz->method));
	}

	de_snprintf(descrbuf, sizeof(descrbuf), (mdz->next_member_hdr_pos?"":
		" (none - This is the trailer record)"));
	de_dbg(c, "next entry pos: %"I64_FMT"%s", mdz->next_member_hdr_pos, descrbuf);

	if(mdz->next_member_hdr_pos==0) {
		do_member_eof(c, d, md);
		retval = 1;
		goto done;
	}

	md->cmpr_pos = de_getu32le_p(&pos);
	de_dbg(c, "pos of file data: %"I64_FMT, md->cmpr_pos);

	mdz->datdos = (UI)de_getu16le_p(&pos);
	mdz->timdos = (UI)de_getu16le_p(&pos);
	de_dbg2(c, "dos date,time: %u,%u", mdz->datdos, mdz->timdos);
	if(!mdz->has_ext_header) {
		mdz->timzon = 127;
		finish_modtime_decoding(c, d, md);
	}

	md->crc_reported = (u32)de_getu16le_p(&pos);
	de_dbg(c, "file data crc (reported): 0x%04x", (UI)md->crc_reported);

	de_arch_read_field_orig_len_p(md, &pos);
	de_arch_read_field_cmpr_len_p(md, &pos);

	// Note: The version number fields are sometimes erroneously documented as
	// "version made by" and "version needed". But (according to Zoo 2.10),
	// there is no "version made by" field.
	mdz->majver = de_getbyte_p(&pos);
	mdz->minver = de_getbyte_p(&pos);
	de_dbg(c, "version needed to extract: %d.%d", (int)mdz->majver, (int)mdz->minver);

	mdz->is_deleted = de_getbyte_p(&pos);
	de_dbg(c, "is deleted: %d", (int)mdz->is_deleted);
	pos++; // "file structure" (?)
	mdz->comment_pos = de_getu32le_p(&pos);
	mdz->comment_len = de_getu16le_p(&pos);
	de_dbg(c, "comment pos: %"I64_FMT", len=%d", mdz->comment_pos, (int)mdz->comment_len);
	do_comment(c, d, mdz->comment_pos, mdz->comment_len, "comment", 0,
		(d->extract_comments_to_files) && (!mdz->is_deleted || d->undelete));

	// In "type 2" header format, the shortname field is a fixed 13 bytes, and is
	// followed by other fields.
	// In "type 1" header format, the shortname field is (allegedly) the last field
	// in the header, and it's supposed to be NUL-terminated, so it's hard to be
	// *sure* what size it is.
	// Zoo 1.21 seems to leave room for 14 bytes, instead of the 13 that would be
	// expected. And it seemingly allows up to 14-byte filenames with no NUL -- but
	// this could well be a bug. Or perhaps the 13-byte filename field is followed
	// by a 1-byte field of unknown purpose.
	shortname = ucstring_create(c);
	dbuf_read_to_ucstring(c->infile, pos, 13, shortname, DE_CONVFLAG_STOP_AT_NUL,
		d->da->input_encoding);
	de_dbg(c, "short name: \"%s\"", ucstring_getpsz(shortname));
	if(ucstring_isempty(shortname)) {
		ucstring_append_sz(shortname, "_", DE_ENCODING_LATIN1);
	}
	pos += 13;

	if(!mdz->has_ext_header) {
		goto done_with_header;
	}

	// If has_ext_header, there are at least 3 more header fields:
	//  2-byte length-of-variable-part
	//  1-byte timezone
	//  2-byte CRC of dir entry

	lvar   = de_getu16le_p(&pos);
	de_dbg(c, "length of variable part: %d", (int)lvar);

	mdz->timzon = de_getbyte_p(&pos);

	// Note: The timezone field is definitely a signed byte that is the
	// number of 15-minute units from UTC, but it is unknown to me whether
	// a positive number means west, or east. Under either interpretation,
	// I have multiple sample files with highly implausible timezones. The
	// interpretation used here is based on the preponderance of evidence.
	if(mdz->timzon==127) {
		de_strlcpy(descrbuf, "unknown", sizeof(descrbuf));
	}
	else if(mdz->timzon>127) {
		de_snprintf(descrbuf, sizeof(descrbuf), "%.2f hours east of UTC",
			((double)mdz->timzon - 256.0)/-4.0);
	}
	else {
		de_snprintf(descrbuf, sizeof(descrbuf), "%.2f hours west of UTC",
			((double)mdz->timzon)/4.0);
	}
	de_dbg(c, "time zone: %d (%s)", (int)mdz->timzon, descrbuf);
	finish_modtime_decoding(c, d, md);

	mdz->crc_hdr_reported = (u32)de_getu16le_p(&pos);
	de_dbg(c, "entry crc (reported): 0x%04x", (UI)mdz->crc_hdr_reported);
	calc_hdr_crc(c, d, md, lvar);
	de_dbg(c, "entry crc (calculated): 0x%04x", (UI)mdz->crc_hdr_calculated);
	if(mdz->crc_hdr_calculated != mdz->crc_hdr_reported) {
		de_warn(c, "Header CRC check failed");
	}

	// The "variable part" of the extended header begins here.
	hdr_endpos = pos + lvar;

	if(hdr_endpos-pos < 1) goto done_with_header;
	lnamu = (i64)de_getbyte_p(&pos);
	de_dbg2(c, "long name len: %d", (int)lnamu);

	if(hdr_endpos-pos < 1) goto done_with_header;
	ldiru = (i64)de_getbyte_p(&pos);
	de_dbg2(c, "dir name len: %d", (int)ldiru);

	if(hdr_endpos-pos < lnamu) goto done_with_header;
	if(lnamu>0) {
		longname = ucstring_create(c);
		dbuf_read_to_ucstring(c->infile, pos, lnamu, longname,
			DE_CONVFLAG_STOP_AT_NUL, d->da->input_encoding);
		de_dbg(c, "long name: \"%s\"", ucstring_getpsz(longname));
	}
	pos += lnamu;

	if(hdr_endpos-pos < ldiru) goto done_with_header;
	if(ldiru>0) {
		md->tmpfn_path = ucstring_create(c);
		dbuf_read_to_ucstring(c->infile, pos, ldiru, md->tmpfn_path,
			DE_CONVFLAG_STOP_AT_NUL, d->da->input_encoding);
		de_dbg(c, "dir name: \"%s\"", ucstring_getpsz(md->tmpfn_path));
	}
	pos += ldiru;

	if(hdr_endpos-pos < 2) goto done_with_header;
	mdz->system = (UI)de_getu16le_p(&pos);
	de_dbg(c, "system id: %u", mdz->system);

	if(hdr_endpos-pos < 3) goto done_with_header;
	mdz->attribs = (u32)dbuf_getint_ext(c->infile, pos, 3, 1, 0);
	pos += 3;
	de_dbg(c, "attribs: 0x%06x", (UI)mdz->attribs);
	de_dbg_indent(c, 1);
	attribs_type = (mdz->attribs >> 22);
	de_dbg(c, "attribs type: %u", attribs_type);
	if(attribs_type == 1) {
		de_dbg(c, "perms: octal(%o)", (UI)(mdz->attribs & 0x1ff));
		if((mdz->attribs & 0111) != 0) {
			md->fi->mode_flags |= DE_MODEFLAG_EXE;
		}
		else {
			md->fi->mode_flags |= DE_MODEFLAG_NONEXE;
		}
	}
	de_dbg_indent(c, -1);

	if(hdr_endpos-pos < 1) goto done_with_header;
	mdz->vflag = de_getbyte_p(&pos);
	de_dbg(c, "versioning settings (\"vflag\"): 0x%02x", (UI)mdz->vflag);

	if(hdr_endpos-pos < 2) goto done_with_header;
	mdz->ver = (UI)de_getu16le_p(&pos);
	de_dbg(c, "file version number: %u", mdz->ver);

done_with_header:
	// Note: Typically, there is a 5-byte "file leader" ("@)#(\0") here, between
	// the member header and the member data, so pos is not
	// expected to equal mdz->posdat.

	// Figure out the best filename to use

	if(ucstring_isnonempty(md->tmpfn_path)) {
		ucstring_append_ucstring(md->filename, md->tmpfn_path);
		ucstring_append_sz(md->filename, "/", DE_ENCODING_LATIN1);
	}
	if(ucstring_isnonempty(longname)) {
		ucstring_append_ucstring(md->filename, longname);
	}
	else {
		ucstring_append_ucstring(md->filename, shortname);
	}

	if(mdz->is_deleted) {
		ucstring_printf(md->filename, DE_ENCODING_LATIN1, ".deleted%02d",
			d->num_deleted_files_found);
	}

	retval = 1;

done:
	if(ucstring_isempty(md->filename)) {
		ucstring_append_sz(md->filename, "_", DE_ENCODING_LATIN1);
	}

	ucstring_destroy(shortname);
	ucstring_destroy(longname);
	return retval;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x120, %rsp            # imm = 0x120
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x18(%rbp), %rax
movq 0x88(%rax), %rax
movq %rax, -0x20(%rbp)
movq $0x0, -0x28(%rbp)
movq $0x0, -0x30(%rbp)
movl $0x0, -0x34(%rbp)
movq -0x18(%rbp), %rax
movq 0x18(%rax), %rax
movq %rax, -0x40(%rbp)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
leaq -0x40(%rbp), %rsi
callq 0x165580
movl %eax, -0x64(%rbp)
cmpl $0xfdc4a7dc, -0x64(%rbp) # imm = 0xFDC4A7DC
je 0x14f535
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rax
movq 0x18(%rax), %rdx
leaq 0x8135d(%rip), %rsi     # 0x1d0886
movb $0x0, %al
callq 0x15bfb0
jmp 0x14ff80
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
leaq -0x40(%rbp), %rsi
callq 0x165170
movb %al, %cl
movq -0x20(%rbp), %rax
movb %cl, (%rax)
movq -0x20(%rbp), %rax
movzbl (%rax), %eax
cmpl $0x2, %eax
sete %al
andb $0x1, %al
movzbl %al, %eax
movb %al, %cl
movq -0x20(%rbp), %rax
movb %cl, 0x2(%rax)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
leaq -0x40(%rbp), %rsi
callq 0x165170
movb %al, %cl
movq -0x20(%rbp), %rax
movb %cl, 0x1(%rax)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
leaq -0x40(%rbp), %rsi
callq 0x165580
movq %rax, %rcx
movq -0x20(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x8(%rbp), %rdi
movq -0x20(%rbp), %rax
movzbl (%rax), %edx
leaq 0x81301(%rip), %rsi     # 0x1d08b2
movb $0x0, %al
callq 0x15b0d0
movq -0x20(%rbp), %rax
cmpq $0x0, 0x8(%rax)
je 0x14f607
movq -0x8(%rbp), %rax
movq %rax, -0xd0(%rbp)
movq -0x20(%rbp), %rax
movzbl 0x1(%rax), %eax
movl %eax, -0xc4(%rbp)
movq -0x20(%rbp), %rax
movzbl 0x1(%rax), %edi
callq 0x1500b0
movq -0xd0(%rbp), %rdi
movl -0xc4(%rbp), %edx
movq %rax, %rcx
leaq 0x807d2(%rip), %rsi     # 0x1cfdd2
movb $0x0, %al
callq 0x15b0d0
leaq -0xc0(%rbp), %rdi
movq -0x20(%rbp), %rax
movq 0x8(%rax), %rcx
leaq 0x812bf(%rip), %rdx     # 0x1d08dc
leaq 0x815ac(%rip), %rax     # 0x1d0bd0
cmpq $0x0, %rcx
cmovneq %rax, %rdx
movl $0x50, %esi
movb $0x0, %al
callq 0x15a980
movq -0x8(%rbp), %rdi
movq -0x20(%rbp), %rax
movq 0x8(%rax), %rdx
leaq -0xc0(%rbp), %rcx
leaq 0x812af(%rip), %rsi     # 0x1d0901
movb $0x0, %al
callq 0x15b0d0
movq -0x20(%rbp), %rax
cmpq $0x0, 0x8(%rax)
jne 0x14f681
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
callq 0x150130
movl $0x1, -0x34(%rbp)
jmp 0x14ff80
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
leaq -0x40(%rbp), %rsi
callq 0x165580
movq %rax, %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x40(%rax)
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rax
movq 0x40(%rax), %rdx
leaq 0x81267(%rip), %rsi     # 0x1d0917
movb $0x0, %al
callq 0x15b0d0
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
leaq -0x40(%rbp), %rsi
callq 0x1652c0
movl %eax, %ecx
movq -0x20(%rbp), %rax
movl %ecx, 0x20(%rax)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
leaq -0x40(%rbp), %rsi
callq 0x1652c0
movl %eax, %ecx
movq -0x20(%rbp), %rax
movl %ecx, 0x24(%rax)
movq -0x8(%rbp), %rdi
movq -0x20(%rbp), %rax
movl 0x20(%rax), %edx
movq -0x20(%rbp), %rax
movl 0x24(%rax), %ecx
leaq 0x81229(%rip), %rsi     # 0x1d092d
movb $0x0, %al
callq 0x15b350
movq -0x20(%rbp), %rax
cmpb $0x0, 0x2(%rax)
jne 0x14f72e
movq -0x20(%rbp), %rax
movb $0x7f, 0x37(%rax)
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
callq 0x150230
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
leaq -0x40(%rbp), %rsi
callq 0x1652c0
movl %eax, %ecx
movq -0x18(%rbp), %rax
movl %ecx, 0x48(%rax)
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rax
movl 0x48(%rax), %edx
leaq 0x811e8(%rip), %rsi     # 0x1d0942
movb $0x0, %al
callq 0x15b0d0
movq -0x18(%rbp), %rdi
leaq -0x40(%rbp), %rsi
callq 0x17c350
movq -0x18(%rbp), %rdi
leaq -0x40(%rbp), %rsi
callq 0x17c400
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
leaq -0x40(%rbp), %rsi
callq 0x165170
movb %al, %cl
movq -0x20(%rbp), %rax
movb %cl, 0x34(%rax)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
leaq -0x40(%rbp), %rsi
callq 0x165170
movb %al, %cl
movq -0x20(%rbp), %rax
movb %cl, 0x35(%rax)
movq -0x8(%rbp), %rdi
movq -0x20(%rbp), %rax
movzbl 0x34(%rax), %edx
movq -0x20(%rbp), %rax
movzbl 0x35(%rax), %ecx
leaq 0x81199(%rip), %rsi     # 0x1d0963
movb $0x0, %al
callq 0x15b0d0
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
leaq -0x40(%rbp), %rsi
callq 0x165170
movb %al, %cl
movq -0x20(%rbp), %rax
movb %cl, 0x36(%rax)
movq -0x8(%rbp), %rdi
movq -0x20(%rbp), %rax
movzbl 0x36(%rax), %edx
leaq 0x81186(%rip), %rsi     # 0x1d0984
movb $0x0, %al
callq 0x15b0d0
movq -0x40(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x40(%rbp)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
leaq -0x40(%rbp), %rsi
callq 0x165580
movq %rax, %rcx
movq -0x20(%rbp), %rax
movq %rcx, 0x10(%rax)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
leaq -0x40(%rbp), %rsi
callq 0x1652c0
movq %rax, %rcx
movq -0x20(%rbp), %rax
movq %rcx, 0x18(%rax)
movq -0x8(%rbp), %rdi
movq -0x20(%rbp), %rax
movq 0x10(%rax), %rdx
movq -0x20(%rbp), %rax
movq 0x18(%rax), %rax
movl %eax, %ecx
leaq 0x80f6f(%rip), %rsi     # 0x1d07d5
movb $0x0, %al
callq 0x15b0d0
movq -0x8(%rbp), %rax
movq %rax, -0xf8(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0xf0(%rbp)
movq -0x20(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0xe8(%rbp)
movq -0x20(%rbp), %rax
movq 0x18(%rax), %rax
movq %rax, -0xe0(%rbp)
movq -0x10(%rbp), %rcx
xorl %eax, %eax
cmpl $0x0, 0x8(%rcx)
movb %al, -0xd1(%rbp)
je 0x14f8e2
movq -0x20(%rbp), %rcx
movb $0x1, %al
cmpb $0x0, 0x36(%rcx)
movb %al, -0xf9(%rbp)
je 0x14f8d6
movq -0x10(%rbp), %rax
cmpl $0x0, 0xc(%rax)
setne %al
movb %al, -0xf9(%rbp)
movb -0xf9(%rbp), %al
movb %al, -0xd1(%rbp)
movq -0xe0(%rbp), %rcx
movq -0xe8(%rbp), %rdx
movq -0xf0(%rbp), %rsi
movq -0xf8(%rbp), %rdi
movb -0xd1(%rbp), %al
andb $0x1, %al
movzbl %al, %eax
leaq 0x80a35(%rip), %r8      # 0x1d0345
xorl %r9d, %r9d
movl %eax, (%rsp)
callq 0x14f270
movq -0x8(%rbp), %rdi
callq 0x1711d0
movq %rax, -0x28(%rbp)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x40(%rbp), %rsi
movq -0x28(%rbp), %rcx
movq -0x10(%rbp), %rax
movq (%rax), %rax
movl 0x18(%rax), %r9d
movl $0xd, %edx
movl $0x1, %r8d
callq 0x1669f0
movq -0x8(%rbp), %rax
movq %rax, -0x108(%rbp)
movq -0x28(%rbp), %rdi
callq 0x172500
movq -0x108(%rbp), %rdi
movq %rax, %rdx
leaq 0x8101b(%rip), %rsi     # 0x1d0993
movb $0x0, %al
callq 0x15b0d0
movq -0x28(%rbp), %rdi
callq 0x1717b0
cmpl $0x0, %eax
je 0x14f9a2
movq -0x28(%rbp), %rdi
leaq 0x6706e(%rip), %rsi     # 0x1b6a06
movl $0x5, %edx
callq 0x1715e0
movq -0x40(%rbp), %rax
addq $0xd, %rax
movq %rax, -0x40(%rbp)
movq -0x20(%rbp), %rax
cmpb $0x0, 0x2(%rax)
jne 0x14f9bd
jmp 0x14fedb
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
leaq -0x40(%rbp), %rsi
callq 0x1652c0
movq %rax, -0x50(%rbp)
movq -0x8(%rbp), %rdi
movq -0x50(%rbp), %rax
movl %eax, %edx
leaq 0x80fc1(%rip), %rsi     # 0x1d09a4
movb $0x0, %al
callq 0x15b0d0
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
leaq -0x40(%rbp), %rsi
callq 0x165170
movb %al, %cl
movq -0x20(%rbp), %rax
movb %cl, 0x37(%rax)
movq -0x20(%rbp), %rax
movzbl 0x37(%rax), %eax
cmpl $0x7f, %eax
jne 0x14fa2e
leaq -0xc0(%rbp), %rdi
leaq 0x4eb3d(%rip), %rsi     # 0x19e55c
movl $0x50, %edx
callq 0x15aa30
jmp 0x14faaf
movq -0x20(%rbp), %rax
movzbl 0x37(%rax), %eax
cmpl $0x7f, %eax
jle 0x14fa7b
leaq -0xc0(%rbp), %rdi
movq -0x20(%rbp), %rax
movzbl 0x37(%rax), %eax
cvtsi2sd %eax, %xmm0
movsd 0x51752(%rip), %xmm1    # 0x1a11a8
subsd %xmm1, %xmm0
movsd 0x80b9e(%rip), %xmm1    # 0x1d0600
divsd %xmm1, %xmm0
movl $0x50, %esi
leaq 0x80f4e(%rip), %rdx     # 0x1d09c0
movb $0x1, %al
callq 0x15a980
jmp 0x14faad
leaq -0xc0(%rbp), %rdi
movq -0x20(%rbp), %rax
movzbl 0x37(%rax), %eax
cvtsi2sd %eax, %xmm0
movsd 0x80b62(%rip), %xmm1    # 0x1d05f8
divsd %xmm1, %xmm0
movl $0x50, %esi
leaq 0x80f31(%rip), %rdx     # 0x1d09d7
movb $0x1, %al
callq 0x15a980
jmp 0x14faaf
movq -0x8(%rbp), %rdi
movq -0x20(%rbp), %rax
movzbl 0x37(%rax), %edx
leaq -0xc0(%rbp), %rcx
leaq 0x80f25(%rip), %rsi     # 0x1d09ee
movb $0x0, %al
callq 0x15b0d0
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
callq 0x150230
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
leaq -0x40(%rbp), %rsi
callq 0x1652c0
movl %eax, %ecx
movq -0x20(%rbp), %rax
movl %ecx, 0x2c(%rax)
movq -0x8(%rbp), %rdi
movq -0x20(%rbp), %rax
movl 0x2c(%rax), %edx
leaq 0x80ef4(%rip), %rsi     # 0x1d0a01
movb $0x0, %al
callq 0x15b0d0
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
movq -0x50(%rbp), %rcx
callq 0x150370
movq -0x8(%rbp), %rdi
movq -0x20(%rbp), %rax
movl 0x30(%rax), %edx
leaq 0x80ee3(%rip), %rsi     # 0x1d0a1e
movb $0x0, %al
callq 0x15b0d0
movq -0x20(%rbp), %rax
movl 0x30(%rax), %eax
movq -0x20(%rbp), %rcx
cmpl 0x2c(%rcx), %eax
je 0x14fb64
movq -0x8(%rbp), %rdi
leaq 0x54563(%rip), %rsi     # 0x1a40c0
movb $0x0, %al
callq 0x15bc10
movq -0x40(%rbp), %rax
addq -0x50(%rbp), %rax
movq %rax, -0x48(%rbp)
movq -0x48(%rbp), %rax
subq -0x40(%rbp), %rax
cmpq $0x1, %rax
jge 0x14fb83
jmp 0x14fedb
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
leaq -0x40(%rbp), %rsi
callq 0x165170
movzbl %al, %eax
movq %rax, -0x58(%rbp)
movq -0x8(%rbp), %rdi
movq -0x58(%rbp), %rax
movl %eax, %edx
leaq 0x80e91(%rip), %rsi     # 0x1d0a3d
movb $0x0, %al
callq 0x15b350
movq -0x48(%rbp), %rax
subq -0x40(%rbp), %rax
cmpq $0x1, %rax
jge 0x14fbc6
jmp 0x14fedb
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
leaq -0x40(%rbp), %rsi
callq 0x165170
movzbl %al, %eax
movq %rax, -0x60(%rbp)
movq -0x8(%rbp), %rdi
movq -0x60(%rbp), %rax
movl %eax, %edx
leaq 0x80e60(%rip), %rsi     # 0x1d0a4f
movb $0x0, %al
callq 0x15b350
movq -0x48(%rbp), %rax
subq -0x40(%rbp), %rax
cmpq -0x58(%rbp), %rax
jge 0x14fc09
jmp 0x14fedb
cmpq $0x0, -0x58(%rbp)
jle 0x14fc73
movq -0x8(%rbp), %rdi
callq 0x1711d0
movq %rax, -0x30(%rbp)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x40(%rbp), %rsi
movq -0x58(%rbp), %rdx
movq -0x30(%rbp), %rcx
movq -0x10(%rbp), %rax
movq (%rax), %rax
movl 0x18(%rax), %r9d
movl $0x1, %r8d
callq 0x1669f0
movq -0x8(%rbp), %rax
movq %rax, -0x110(%rbp)
movq -0x30(%rbp), %rdi
callq 0x172500
movq -0x110(%rbp), %rdi
movq %rax, %rdx
leaq 0x80df4(%rip), %rsi     # 0x1d0a60
movb $0x0, %al
callq 0x15b0d0
movq -0x58(%rbp), %rax
addq -0x40(%rbp), %rax
movq %rax, -0x40(%rbp)
movq -0x48(%rbp), %rax
subq -0x40(%rbp), %rax
cmpq -0x60(%rbp), %rax
jge 0x14fc92
jmp 0x14fedb
cmpq $0x0, -0x60(%rbp)
jle 0x14fd0b
movq -0x8(%rbp), %rdi
callq 0x1711d0
movq %rax, %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x70(%rax)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x40(%rbp), %rsi
movq -0x60(%rbp), %rdx
movq -0x18(%rbp), %rax
movq 0x70(%rax), %rcx
movq -0x10(%rbp), %rax
movq (%rax), %rax
movl 0x18(%rax), %r9d
movl $0x1, %r8d
callq 0x1669f0
movq -0x8(%rbp), %rax
movq %rax, -0x118(%rbp)
movq -0x18(%rbp), %rax
movq 0x70(%rax), %rdi
callq 0x172500
movq -0x118(%rbp), %rdi
movq %rax, %rdx
leaq 0x5a988(%rip), %rsi     # 0x1aa68c
movb $0x0, %al
callq 0x15b0d0
movq -0x60(%rbp), %rax
addq -0x40(%rbp), %rax
movq %rax, -0x40(%rbp)
movq -0x48(%rbp), %rax
subq -0x40(%rbp), %rax
cmpq $0x2, %rax
jge 0x14fd2a
jmp 0x14fedb
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
leaq -0x40(%rbp), %rsi
callq 0x1652c0
movl %eax, %ecx
movq -0x20(%rbp), %rax
movl %ecx, 0x38(%rax)
movq -0x8(%rbp), %rdi
movq -0x20(%rbp), %rax
movl 0x38(%rax), %edx
leaq 0x80d1a(%rip), %rsi     # 0x1d0a70
movb $0x0, %al
callq 0x15b0d0
movq -0x48(%rbp), %rax
subq -0x40(%rbp), %rax
cmpq $0x3, %rax
jge 0x14fd70
jmp 0x14fedb
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x40(%rbp), %rsi
movl $0x3, %edx
movl $0x1, %ecx
xorl %r8d, %r8d
callq 0x165a80
movl %eax, %ecx
movq -0x20(%rbp), %rax
movl %ecx, 0x3c(%rax)
movq -0x40(%rbp), %rax
addq $0x3, %rax
movq %rax, -0x40(%rbp)
movq -0x8(%rbp), %rdi
movq -0x20(%rbp), %rax
movl 0x3c(%rax), %edx
leaq 0x80cc9(%rip), %rsi     # 0x1d0a7e
movb $0x0, %al
callq 0x15b0d0
movq -0x8(%rbp), %rdi
movl $0x1, %esi
callq 0x15b560
movq -0x20(%rbp), %rax
movl 0x3c(%rax), %eax
shrl $0x16, %eax
movl %eax, -0x68(%rbp)
movq -0x8(%rbp), %rdi
movl -0x68(%rbp), %edx
leaq 0x80ca9(%rip), %rsi     # 0x1d0a8e
movb $0x0, %al
callq 0x15b0d0
cmpl $0x1, -0x68(%rbp)
jne 0x14fe46
movq -0x8(%rbp), %rdi
movq -0x20(%rbp), %rax
movl 0x3c(%rax), %edx
andl $0x1ff, %edx            # imm = 0x1FF
leaq 0x80c95(%rip), %rsi     # 0x1d0a9f
movb $0x0, %al
callq 0x15b0d0
movq -0x20(%rbp), %rax
movl 0x3c(%rax), %eax
andl $0x49, %eax
cmpl $0x0, %eax
je 0x14fe33
movq -0x18(%rbp), %rax
movq 0x50(%rax), %rax
movl 0x14(%rax), %ecx
orl $0x2, %ecx
movl %ecx, 0x14(%rax)
jmp 0x14fe44
movq -0x18(%rbp), %rax
movq 0x50(%rax), %rax
movl 0x14(%rax), %ecx
orl $0x1, %ecx
movl %ecx, 0x14(%rax)
jmp 0x14fe46
movq -0x8(%rbp), %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0x15b560
movq -0x48(%rbp), %rax
subq -0x40(%rbp), %rax
cmpq $0x1, %rax
jge 0x14fe64
jmp 0x14fedb
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
leaq -0x40(%rbp), %rsi
callq 0x165170
movb %al, %cl
movq -0x20(%rbp), %rax
movb %cl, 0x40(%rax)
movq -0x8(%rbp), %rdi
movq -0x20(%rbp), %rax
movzbl 0x40(%rax), %edx
leaq 0x80c1f(%rip), %rsi     # 0x1d0ab0
movb $0x0, %al
callq 0x15b0d0
movq -0x48(%rbp), %rax
subq -0x40(%rbp), %rax
cmpq $0x2, %rax
jge 0x14fea8
jmp 0x14fedb
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
leaq -0x40(%rbp), %rsi
callq 0x1652c0
movl %eax, %ecx
movq -0x20(%rbp), %rax
movl %ecx, 0x44(%rax)
movq -0x8(%rbp), %rdi
movq -0x20(%rbp), %rax
movl 0x44(%rax), %edx
leaq 0x80c02(%rip), %rsi     # 0x1d0ad6
movb $0x0, %al
callq 0x15b0d0
movq -0x18(%rbp), %rax
movq 0x70(%rax), %rdi
callq 0x1717f0
cmpl $0x0, %eax
je 0x14ff1b
movq -0x18(%rbp), %rax
movq 0x58(%rax), %rdi
movq -0x18(%rbp), %rax
movq 0x70(%rax), %rsi
callq 0x171460
movq -0x18(%rbp), %rax
movq 0x58(%rax), %rdi
leaq 0x4e22d(%rip), %rsi     # 0x19e13e
movl $0x5, %edx
callq 0x1715e0
movq -0x30(%rbp), %rdi
callq 0x1717f0
cmpl $0x0, %eax
je 0x14ff3c
movq -0x18(%rbp), %rax
movq 0x58(%rax), %rdi
movq -0x30(%rbp), %rsi
callq 0x171460
jmp 0x14ff4d
movq -0x18(%rbp), %rax
movq 0x58(%rax), %rdi
movq -0x28(%rbp), %rsi
callq 0x171460
movq -0x20(%rbp), %rax
cmpb $0x0, 0x36(%rax)
je 0x14ff79
movq -0x18(%rbp), %rax
movq 0x58(%rax), %rdi
movq -0x10(%rbp), %rax
movl 0x3c(%rax), %ecx
movl $0x5, %esi
leaq 0x80b7c(%rip), %rdx     # 0x1d0aee
movb $0x0, %al
callq 0x171660
movl $0x1, -0x34(%rbp)
movq -0x18(%rbp), %rax
movq 0x58(%rax), %rdi
callq 0x1717b0
cmpl $0x0, %eax
je 0x14ffab
movq -0x18(%rbp), %rax
movq 0x58(%rax), %rdi
leaq 0x66a65(%rip), %rsi     # 0x1b6a06
movl $0x5, %edx
callq 0x1715e0
movq -0x28(%rbp), %rdi
callq 0x171750
movq -0x30(%rbp), %rdi
callq 0x171750
movl -0x34(%rbp), %eax
addq $0x120, %rsp            # imm = 0x120
popq %rbp
retq
nopl (%rax)