// File: /workspace/github_c_makefile_star2_O2/jsummers[P]deark/modules/arj.c
// Function: do_header_or_member
static int do_header_or_member(deark *c, lctx *d, i64 pos1, int expecting_archive_hdr,
	i64 *pbytes_consumed)
{
	i64 pos = pos1;
	i64 basic_hdr_size;
	i64 first_hdr_size;
	i64 first_hdr_endpos;
	i64 extra_data_len;
	i64 nbytes_avail;
	i64 n;
	i64 basic_hdr_endpos;
	i64 bytes_consumed;
	u32 basic_hdr_crc_reported;
	u32 basic_hdr_crc_calc;
	struct member_data *md = NULL;
	de_ucstring *flags_descr = NULL;
	int retval = 0;
	int saved_indent_level;
	u8 b;
	char namebuf[32];
	char tmpbuf[64];

	de_dbg_indent_save(c, &saved_indent_level);
	md = de_malloc(c, sizeof(struct member_data));

	md->hdr_id = (UI)dbuf_getu16le_p(d->inf, &pos);
	if(md->hdr_id!=0xea60) {
		de_err(c, "ARJ data not found at %"I64_FMT, pos1);
		goto done;
	}

	de_dbg(c, "block at %"I64_FMT, pos1);
	de_dbg_indent(c, 1);

	basic_hdr_size = dbuf_getu16le_p(d->inf, &pos);
	de_dbg(c, "basic header size: %"I64_FMT, basic_hdr_size);
	if(basic_hdr_size==0) {
		md->objtype = ARJ_OBJTYPE_EOA;
	}
	else {
		// Skip ahead to read some fields that can affect fields that appear
		// before them.
		md->archiver_ver_num = dbuf_getbyte(d->inf, pos1+5);
		md->file_type = dbuf_getbyte(d->inf, pos1+10);

		if(md->file_type==ARJ_FILETYPE_MAINHDR) {
			md->objtype = ARJ_OBJTYPE_MAINHDR;
		}
		else if(md->file_type==ARJ_FILETYPE_CHAPTERLABEL) {
			md->objtype = ARJ_OBJTYPE_CHAPTERLABEL;
		}
		else if(md->file_type<=4) {
			md->objtype = ARJ_OBJTYPE_MEMBERFILE;
		}
		else if(md->file_type==9 && md->archiver_ver_num==51) {
			md->objtype = ARJ_OBJTYPE_MEMBERFILE; // ARJZ with -t9 option
		}
		else {
			md->objtype = ARJ_OBJTYPE_UNKNOWN;
		}
	}
	de_dbg(c, "block type: %s", get_objtype_name(md->objtype));

	if(basic_hdr_size==0) {
		*pbytes_consumed = 4;
		retval = 2;
		goto done;
	}

	if(basic_hdr_size>ARJ_MAX_BASIC_HEADER_SIZE) {
		de_err(c, "Bad header size");
		goto done;
	}

	de_dbg(c, "basic header at %"I64_FMT, pos);
	de_dbg_indent(c, 1);

	de_dbg(c, "first header at %"I64_FMT, pos);
	de_dbg_indent(c, 1);

	basic_hdr_endpos = pos1 + 4 + basic_hdr_size;
	first_hdr_size = (i64)dbuf_getbyte_p(d->inf, &pos);
	de_dbg(c, "first header size: %"I64_FMT, first_hdr_size);
	first_hdr_endpos = pos1 + 4 + first_hdr_size;
	pos++; // md->archiver_ver_num, already read
	de_dbg(c, "archiver version: %u (%s)", (UI)md->archiver_ver_num,
		get_archiver_ver_name(md->archiver_ver_num, namebuf, sizeof(namebuf)));

	// Note:
	//  ver>=100 used by ARJ32 roughly corresponds to that number minus 91.
	//  ver=51 used by ARJZ probably corresponds to ver=6 or 7.
	md->supports_ANSIPAGE_flag = (u8)((md->archiver_ver_num>=9 && md->archiver_ver_num<=49) ||
		md->archiver_ver_num>=100);
	md->supports_chapters = (u8)((md->archiver_ver_num>=8 && md->archiver_ver_num<=49) ||
		md->archiver_ver_num>=100);
	md->has_encrver_field = md->supports_chapters;
	md->has_flags2_field = (u8)((md->archiver_ver_num>=11 && md->archiver_ver_num<=49) ||
		md->archiver_ver_num>=102);
	md->has_arch_mtime_field = (u8)(md->archiver_ver_num>=6);

	md->min_ver_to_extract = dbuf_getbyte_p(d->inf, &pos);
	de_dbg(c, "min ver to extract: %u", (UI)md->min_ver_to_extract);

	md->os = dbuf_getbyte_p(d->inf, &pos);
	de_dbg(c, "host OS: %u (%s)", (UI)md->os, get_host_os_name(md->os));

	if((md->os==ARJ_OS_UNIX || md->os==ARJ_OS_NEXT) &&
		(md->archiver_ver_num>=11 && md->archiver_ver_num<=49))
	{
		// Ref: Open Source ARJ, resource/en/readme.txt
		md->unix_timestamp_format = 1;
	}

	md->flags = dbuf_getbyte_p(d->inf, &pos);
	flags_descr = ucstring_create(c);
	get_flags_descr(md, md->flags, flags_descr);
	de_dbg(c, "flags: 0x%02x (%s)", (UI)md->flags, ucstring_getpsz_d(flags_descr));
	if(md->objtype==ARJ_OBJTYPE_MAINHDR) {
		if(md->supports_ANSIPAGE_flag && (md->flags & 0x02)) {
			d->cv->ansipage_flag = 1;
		}
		if(md->flags & 0x40) {
			d->cv->is_secured = 1;
		}
		else if((!md->supports_ANSIPAGE_flag) && (md->flags & 0x02)) {
			d->cv->is_old_secured = 1;
		}
		if(md->flags & 0x08) {
			d->cv->arjprot_flag = 1;
		}
	}
	else if(md->objtype==ARJ_OBJTYPE_MEMBERFILE) {
		if(md->flags & 0x04) { // "VOLUME"
			md->cont_on_next_vol = 1;
		}
		if(md->flags & 0x08) { // "EXTFILE"
			// Note: ARJ's -jx option can be used to create files that use this flag,
			// but aren't actually part of a multi-volume archive. But -jx is mainly
			// intended to be used in conjuction with constructing/repairing multi-
			// volume archives.
			md->cont_from_prev_vol = 1;
		}
	}

	// Now we have enough information to choose a character encoding.
	md->input_encoding = d->input_encoding;
	if(md->input_encoding==DE_ENCODING_UNKNOWN) {
		if(d->cv->ansipage_flag) {
			md->input_encoding = DE_ENCODING_WINDOWS1252;
		}
		else {
			md->input_encoding = DE_ENCODING_CP437;
		}
	}

	if(md->objtype==ARJ_OBJTYPE_MAINHDR) {
		b = dbuf_getbyte_p(d->inf, &pos);
		if(d->cv->is_secured) {
			de_dbg(c, "security version: %u", (UI)b);
		}
	}
	else {
		md->method = dbuf_getbyte_p(d->inf, &pos);
		de_dbg(c, "cmpr method: %u", (UI)md->method);
	}

	pos++; // file_type already read
	de_dbg(c, "file type: %u (%s)", (UI)md->file_type, get_file_type_name(md, md->file_type));
	if(expecting_archive_hdr && md->file_type!=ARJ_FILETYPE_MAINHDR) {
		de_err(c, "Invalid or missing archive header");
		goto done;
	}
	if(md->objtype==ARJ_OBJTYPE_UNKNOWN) {
		de_err(c, "Unknown file type: %u", (UI)md->file_type);
		// (try to continue)
	}

	md->reserved1 = dbuf_getbyte_p(d->inf, &pos);
	de_dbg(c, "reserved: 0x%02x", (UI)md->reserved1);

	if(md->objtype==ARJ_OBJTYPE_MAINHDR) {
		read_arj_datetime(c, d, md, pos, &md->tmstamp[DE_TIMESTAMPIDX_CREATE], "archive creation");
		pos += 4;
	}
	else if(md->objtype==ARJ_OBJTYPE_CHAPTERLABEL) {
		read_arj_datetime(c, d, md, pos,  &md->tmstamp[DE_TIMESTAMPIDX_CREATE], "creation");
		pos += 4;
	}
	else {
		read_arj_datetime(c, d, md, pos, &md->tmstamp[DE_TIMESTAMPIDX_MODIFY], "mod");
		pos += 4;
	}

	if(md->objtype==ARJ_OBJTYPE_MAINHDR) {
		md->cmpr_len = 0;
		if(d->cv->is_old_secured) {
			n = dbuf_getu32le_p(d->inf, &pos);
			de_dbg(c, "archive size: %"I64_FMT, n); // This is a guess
		}
		else if(md->has_arch_mtime_field) {
			read_arj_datetime(c, d, md, pos, &md->tmstamp[DE_TIMESTAMPIDX_MODIFY], "archive mod");
			pos += 4;
		}
		else {
			pos += 4;
		}
	}
	else {
		// Assume this field always exists, except for the main header and EOA.
		// We need it just to parse the file.
		md->cmpr_len = dbuf_getu32le_p(d->inf, &pos);
		de_dbg(c, "compressed size: %"I64_FMT, md->cmpr_len);
	}

	if(md->objtype==ARJ_OBJTYPE_MAINHDR && d->cv->is_old_secured) {
		// This is a guess
		de_dbg(c, "security data: %s",
			de_render_hexbytes_from_dbuf(d->inf, pos, 12, tmpbuf, sizeof(tmpbuf)));
		pos += 12;
		goto at_offset_32;
	}

	if(md->objtype==ARJ_OBJTYPE_MAINHDR) {
		n = dbuf_getu32le_p(d->inf, &pos);
		if(d->cv->is_secured) {
			de_dbg(c, "archive size: %"I64_FMT, n);
		}
	}
	else if(md->objtype==ARJ_OBJTYPE_MEMBERFILE) {
		md->orig_len = dbuf_getu32le_p(d->inf, &pos);
		de_dbg(c, "original size: %"I64_FMT, md->orig_len);
	}
	else {
		pos += 4;
	}

	if(md->objtype==ARJ_OBJTYPE_MAINHDR) {
		n = dbuf_getu32le_p(d->inf, &pos);
		if(d->cv->is_secured) {
			d->cv->security_envelope_pos = n;
			de_dbg(c, "security envelope pos: %"I64_FMT, d->cv->security_envelope_pos);
		}
		else if(d->cv->arjprot_flag) {
			d->cv->arjprot_pos = n; // This is a guess
			de_dbg(c, "ARJPROT data pos: %"I64_FMT, d->cv->arjprot_pos);
		}
	}
	else {
		md->crc_reported = (u32)dbuf_getu32le_p(d->inf, &pos);
		de_dbg(c, "crc (reported): 0x%08x", (UI)md->crc_reported);
	}

	n = dbuf_getu16le_p(d->inf, &pos);
	de_dbg(c, "filespec pos in filename: %d", (int)n);

	if(md->objtype==ARJ_OBJTYPE_MAINHDR) {
		n = dbuf_getu16le_p(d->inf, &pos);
		if(d->cv->is_secured) {
			d->cv->security_envelope_len = n;
			de_dbg(c, "security envelope len: %"I64_FMT, d->cv->security_envelope_len);
		}
	}
	else {
		de_ucstring *mode_descr;

		md->file_mode = (UI)dbuf_getu16le_p(d->inf, &pos);
		mode_descr = ucstring_create(c);
		if(md->os==ARJ_OS_DOS || md->os==ARJ_OS_OS2 || md->os==ARJ_OS_WIN95 || md->os==ARJ_OS_WIN32) {
			de_describe_dos_attribs(c, md->file_mode, mode_descr, 0);
		}
		else if(md->os==ARJ_OS_UNIX || md->os==ARJ_OS_NEXT) {
			ucstring_printf(mode_descr, DE_ENCODING_LATIN1, "octal %03o", md->file_mode);
			if((md->file_mode)&0111) {
				md->is_executable = 1;
			}
			else {
				md->is_nonexecutable = 1;
			}
		}
		else {
			ucstring_append_char(mode_descr, '?');
		}

		de_dbg(c, "access mode: 0x%02x (%s)", md->file_mode, ucstring_getpsz_d(mode_descr));
		ucstring_destroy(mode_descr);
	}

at_offset_32:

	b = dbuf_getbyte_p(d->inf, &pos); // first chapter / encryption ver / host data (byte1) / unused
	if(md->objtype==ARJ_OBJTYPE_MAINHDR) {
		if(md->has_encrver_field) {
			de_dbg(c, "encryption ver: %u", (UI)b);
			// We expect the GARBLED flag to be set in the main header when this field
			// is meaningful, but I don't think ARJ requires that.
			d->cv->encryption_ver = b;
		}
	}
	else {
		if(md->supports_chapters) {
			de_dbg(c, "first chapter: %u", (UI)b);
		}
	}

	b = dbuf_getbyte_p(d->inf, &pos); // last chapter / host data (byte2) / unused
	if(md->supports_chapters) {
		de_dbg(c, "last chapter: %u", (UI)b);
	}

	extra_data_len = first_hdr_endpos - pos;
	de_dbg(c, "extra data at %"I64_FMT", len=%"I64_FMT, pos, extra_data_len);
	if(extra_data_len>0) {
		de_dbg_indent(c, 1);

		if(md->objtype==ARJ_OBJTYPE_MAINHDR) {
			if(extra_data_len>=1) {
				b = dbuf_getbyte_p(d->inf, &pos);
				if(md->flags & 0x08) {
					de_dbg(c, "protection factor: %u", (UI)b);
				}
			}
			if(extra_data_len>=2) {
				b = dbuf_getbyte_p(d->inf, &pos);
				if(md->has_flags2_field) {
					de_dbg(c, "flags (2nd set): 0x%02x", (UI)b);
				}
			}
		}
		else if(md->objtype==ARJ_OBJTYPE_MEMBERFILE) {
			if(extra_data_len>=4) {
				md->extfile_pos = dbuf_getu32le_p(d->inf, &pos);
				de_dbg(c, "ext. file pos: %"I64_FMT, md->extfile_pos);
			}
			if(extra_data_len>=12) {
				read_arj_datetime(c, d, md, pos, &md->tmstamp[DE_TIMESTAMPIDX_ACCESS], "access");
				pos += 4;
				read_arj_datetime(c, d, md, pos, &md->tmstamp[DE_TIMESTAMPIDX_CREATE], "create");
				pos += 4;
			}
			if(extra_data_len>=16) {
				n = dbuf_getu32le_p(d->inf, &pos);
				de_dbg(c, "ext. orig size: %"I64_FMT, n);
			}
		}

		de_dbg_indent(c, -1);
	}

	de_dbg_indent(c, -1);
	pos = first_hdr_endpos; // Now at the offset of the filename field
	nbytes_avail = basic_hdr_endpos - pos;
	de_dbg(c, "filename/comment area at %"I64_FMT", len=%"I64_FMT, pos, nbytes_avail);
	de_dbg_indent(c, 1);
	md->name_srd = dbuf_read_string(d->inf, pos, nbytes_avail, 256, DE_CONVFLAG_STOP_AT_NUL,
		md->input_encoding);
	if(!(md->flags & 0x10)) {
		// "PATHSYM" flag missing, need to convert '\' to '/'
		fixup_path(md->name_srd->str);
	}
	de_dbg(c, "filename: \"%s\"", ucstring_getpsz_d(md->name_srd->str));

	if(md->name_srd->found_nul) {
		pos += md->name_srd->bytes_consumed;
		nbytes_avail = basic_hdr_endpos - pos;
		handle_comment(c, d, md, pos, nbytes_avail);
	}
	de_dbg_indent(c, -1);

	de_dbg_indent(c, -1);
	pos = basic_hdr_endpos; // Now at the offset just after the 'comment' field
	basic_hdr_crc_reported = (u32)dbuf_getu32le_p(d->inf, &pos);
	de_dbg(c, "basic hdr crc (reported): 0x%08x", (UI)basic_hdr_crc_reported);

	de_crcobj_reset(d->crco);
	de_crcobj_addslice(d->crco, d->inf, pos1+4, basic_hdr_size);
	basic_hdr_crc_calc = de_crcobj_getval(d->crco);
	de_dbg(c, "basic hdr crc (calculated): 0x%08x", (UI)basic_hdr_crc_calc);
	if(basic_hdr_crc_calc != basic_hdr_crc_reported) {
		de_warn(c, "Header CRC check failed");
	}

	if(!do_extended_headers(c, d, md, pos, &bytes_consumed)) {
		de_err(c, "Bad extended headers - can't continue");
		goto done;
	}
	pos += bytes_consumed;

	md->is_dir = (md->file_type==ARJ_FILETYPE_DIR);

	md->cmpr_pos = pos;
	if(md->objtype==ARJ_OBJTYPE_MEMBERFILE) {
		de_dbg(c, "compressed data at %"I64_FMT, md->cmpr_pos);
		de_dbg_indent(c, 1);
		extract_member_file(c, d, md);
		de_dbg_indent(c, -1);
	}
	pos += md->cmpr_len;

	*pbytes_consumed = pos - pos1;
	retval = 1;

done:
	ucstring_destroy(flags_descr);
	if(md) {
		de_destroy_stringreaderdata(c, md->name_srd);
		de_free(c, md);
	}
	de_dbg_indent_restore(c, saved_indent_level);
	return retval;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x178, %rsp            # imm = 0x178
movq %r8, %r12
movl %ecx, 0x30(%rsp)
movq %rdx, %rbx
movq %rsi, %rbp
movq %rdi, %r13
leaq 0x18(%rsp), %r14
movq %rdx, (%r14)
leaq 0x5c(%rsp), %rsi
callq 0xdebae
movl $0xa0, %esi
movq %r13, %rdi
callq 0xdecaf
movq %rax, %r15
movq (%rbp), %rdi
movq %r14, %rsi
callq 0xe3fc4
movl %eax, 0x4(%r15)
cmpl $0xea60, %eax           # imm = 0xEA60
jne 0x351d1
movq %r12, 0x40(%rsp)
leaq 0xeef7c(%rip), %rsi     # 0x1240cd
movq %r13, %rdi
movq %rbx, %rdx
xorl %eax, %eax
callq 0xde896
pushq $0x1
popq %rsi
movq %r13, %rdi
callq 0xdeba7
movq (%rbp), %rdi
leaq 0x18(%rsp), %rsi
callq 0xe3fc4
movq %rax, %r12
leaq 0xd5e02(%rip), %rsi     # 0x10af83
movq %r13, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0xde896
testq %r12, %r12
movq %rbp, 0x10(%rsp)
je 0x351e9
movq (%rbp), %rdi
leaq 0x5(%rbx), %rsi
callq 0xe3eb4
movb %al, 0xd(%r15)
movq (%rbp), %rdi
leaq 0xa(%rbx), %rsi
callq 0xe3eb4
movb %al, 0x13(%r15)
cmpb $0x2, %al
je 0x351f4
movzbl %al, %ecx
cmpl $0x5, %ecx
jne 0x351ff
leaq 0xd6130(%rip), %rdx     # 0x10b2fd
pushq $0x66
jmp 0x35210
leaq 0xd5d91(%rip), %rsi     # 0x10af69
xorl %ebp, %ebp
movq %r13, %rdi
movq %rbx, %rdx
xorl %eax, %eax
callq 0xdf2a5
jmp 0x35247
leaq 0xd611b(%rip), %rdx     # 0x10b30b
pushq $0x68
jmp 0x35210
leaq 0xd64d4(%rip), %rdx     # 0x10b6cf
pushq $0x64
jmp 0x35210
cmpb $0x5, %al
jae 0x3533e
leaq 0xd60e3(%rip), %rdx     # 0x10b2f1
pushq $0x65
popq %rcx
movl %ecx, 0x8(%r15)
leaq 0xd5d7e(%rip), %rsi     # 0x10af9a
movq %r13, %rdi
xorl %eax, %eax
callq 0xde896
testq %r12, %r12
je 0x3524e
cmpq $0xa29, %r12            # imm = 0xA29
jl 0x35264
leaq 0xd5d6e(%rip), %rsi     # 0x10afa9
xorl %ebp, %ebp
movq %r13, %rdi
xorl %eax, %eax
callq 0xdf2a5
xorl %ebx, %ebx
jmp 0x361b7
movq 0x40(%rsp), %rax
movq $0x4, (%rax)
pushq $0x2
popq %rbx
xorl %ebp, %ebp
jmp 0x361b7
leaq 0x18(%rsp), %r14
movq (%r14), %rdx
leaq 0xd5d46(%rip), %rsi     # 0x10afb9
movq %r13, %rdi
xorl %eax, %eax
callq 0xde896
movq %r15, 0x28(%rsp)
pushq $0x1
popq %r15
movq %r13, %rdi
movl %r15d, %esi
callq 0xdeba7
movq (%r14), %rdx
leaq 0xd5d32(%rip), %rsi     # 0x10afcd
movq %r13, %rdi
xorl %eax, %eax
callq 0xde896
movq %r13, %rdi
movl %r15d, %esi
movq 0x28(%rsp), %r15
callq 0xdeba7
movq 0x10(%rsp), %rax
movq (%rax), %rdi
movq %r14, %rsi
callq 0xe3f2a
movzbl %al, %edx
leaq 0xd5d12(%rip), %rsi     # 0x10afe1
movq %r13, %rdi
movq %rdx, 0x50(%rsp)
xorl %eax, %eax
callq 0xde896
incq (%r14)
movzbl 0xd(%r15), %r14d
leal -0x1(%r14), %eax
cmpb $0xa, %al
ja 0x35309
leal -0x1(%r14), %eax
leaq 0xd6443(%rip), %rdx     # 0x10b73c
movslq (%rdx,%rax,4), %rcx
addq %rdx, %rcx
leaq 0xd6096(%rip), %rdx     # 0x10b39d
jmp 0x3532a
leal -0x64(%r14), %eax
cmpb $0x2, %al
ja 0x35360
leal -0x64(%r14), %eax
leaq 0xd644c(%rip), %rdx     # 0x10b768
movslq (%rdx,%rax,4), %rcx
addq %rdx, %rcx
leaq 0xd607a(%rip), %rdx     # 0x10b3a4
leaq 0xb0(%rsp), %rdi
pushq $0x20
popq %rsi
xorl %eax, %eax
callq 0xde40c
jmp 0x35386
leaq 0xe9b9c(%rip), %rdx     # 0x11eee1
pushq $0x67
popq %rcx
cmpb $0x9, %al
jne 0x35211
cmpb $0x33, 0xd(%r15)
je 0x35207
jmp 0x35211
cmpl $0x33, %r14d
jne 0x3536f
leaq 0xd6040(%rip), %rsi     # 0x10b3ad
jmp 0x35376
leaq 0xe9b6b(%rip), %rsi     # 0x11eee1
leaq 0xb0(%rsp), %rdi
pushq $0x20
popq %rdx
callq 0xde492
leaq 0xd5c6b(%rip), %rsi     # 0x10aff8
leaq 0xb0(%rsp), %rcx
movq %r13, %rdi
movl %r14d, %edx
xorl %eax, %eax
callq 0xde896
movb 0xd(%r15), %al
leal -0x9(%rax), %ecx
cmpb $0x29, %cl
setb %cl
cmpb $0x64, %al
setae %dl
orb %dl, %cl
movb %cl, 0x15(%r15)
leal -0x8(%rax), %ecx
cmpb $0x2a, %cl
setb %cl
orb %dl, %cl
movb %cl, 0x16(%r15)
movb %cl, 0x17(%r15)
leal -0xb(%rax), %ecx
cmpb $0x27, %cl
setb %cl
cmpb $0x66, %al
setae %dl
orb %cl, %dl
movb %dl, 0x18(%r15)
cmpb $0x6, %al
setae 0x19(%r15)
movq 0x10(%rsp), %rbp
movq (%rbp), %rdi
leaq 0x18(%rsp), %r14
movq %r14, %rsi
callq 0xe3f2a
movb %al, 0xe(%r15)
movzbl %al, %edx
leaq 0xd5c06(%rip), %rsi     # 0x10b012
movq %r13, %rdi
xorl %eax, %eax
callq 0xde896
movq (%rbp), %rdi
movq %r14, %rsi
callq 0xe3f2a
movb %al, 0xf(%r15)
movzbl %al, %edx
cmpb $0xb, %dl
ja 0x35440
movl %edx, %eax
leaq 0xd633d(%rip), %rsi     # 0x10b774
movslq (%rsi,%rax,4), %rcx
addq %rsi, %rcx
jmp 0x35447
leaq 0xe9a9a(%rip), %rcx     # 0x11eee1
movq %rbx, 0x20(%rsp)
leaq 0xd5bd6(%rip), %rsi     # 0x10b029
movq %r13, %rdi
xorl %eax, %eax
callq 0xde896
movzbl 0xf(%r15), %eax
cmpl $0x8, %eax
je 0x3546c
cmpl $0x2, %eax
jne 0x3547b
movb 0xd(%r15), %al
addb $-0xb, %al
cmpb $0x26, %al
ja 0x3547b
movb $0x1, 0x10(%r15)
movq 0x10(%rsp), %rax
movq (%rax), %rdi
leaq 0x18(%rsp), %rsi
callq 0xe3f2a
movb %al, 0x11(%r15)
movq %r13, %rdi
callq 0xeac74
movq %rax, %rbp
movb 0x11(%r15), %bl
testb $0x1, %bl
je 0x354b6
leaq 0xd5f3e(%rip), %rsi     # 0x10b3ea
movq %rbp, %rdi
callq 0xeb884
decb %bl
testb $0x2, %bl
je 0x354e4
cmpl $0x64, 0x8(%r15)
jne 0x354e4
cmpb $0x0, 0x15(%r15)
leaq 0xd5f2d(%rip), %rax     # 0x10b3fb
leaq 0xd5f1d(%rip), %rsi     # 0x10b3f2
cmoveq %rax, %rsi
movq %rbp, %rdi
callq 0xeb884
addb $-0x2, %bl
testb $0x4, %bl
je 0x354fb
leaq 0xd5f17(%rip), %rsi     # 0x10b407
movq %rbp, %rdi
callq 0xeb884
addb $-0x4, %bl
testb $0x8, %bl
je 0x35522
cmpl $0x64, 0x8(%r15)
leaq 0xd5f02(%rip), %rax     # 0x10b40e
leaq 0xd5f03(%rip), %rsi     # 0x10b416
cmoveq %rax, %rsi
movq %rbp, %rdi
callq 0xeb884
addb $-0x8, %bl
testb $0x10, %bl
je 0x35539
leaq 0xd5ef0(%rip), %rsi     # 0x10b41e
movq %rbp, %rdi
callq 0xeb884
addb $-0x10, %bl
testb $0x40, %bl
je 0x35557
cmpl $0x64, 0x8(%r15)
jne 0x35557
leaq 0xd5eb3(%rip), %rsi     # 0x10b3ff
movq %rbp, %rdi
callq 0xeb884
addb $-0x40, %bl
testb %bl, %bl
jns 0x35574
cmpl $0x64, 0x8(%r15)
jne 0x35578
leaq 0xd5ebd(%rip), %rsi     # 0x10b426
movq %rbp, %rdi
callq 0xeb884
andb $0x7f, %bl
testb %bl, %bl
je 0x3558c
movzbl %bl, %edx
leaq 0x102329(%rip), %rsi    # 0x1378ab
movq %rbp, %rdi
xorl %eax, %eax
callq 0xeb8af
movzbl 0x11(%r15), %r14d
movq %rbp, %rdi
callq 0xeb877
leaq 0xebab8(%rip), %rsi     # 0x121058
movq %r13, %rdi
movl %r14d, %edx
movq %rax, %rcx
xorl %eax, %eax
callq 0xde896
movl 0x8(%r15), %ebx
cmpl $0x65, %ebx
je 0x35604
cmpl $0x64, %ebx
jne 0x35638
movb 0x11(%r15), %al
movb 0x15(%r15), %cl
testb %cl, %cl
sete %dl
testb $0x2, %al
sete %sil
orb %dl, %sil
jne 0x355e3
movq 0x10(%rsp), %rdx
movq 0x8(%rdx), %rdx
movb $0x1, 0x18(%rdx)
testb $0x40, %al
jne 0x3561a
testb %cl, %cl
setne %cl
testb $0x2, %al
sete %dl
orb %cl, %dl
jne 0x35627
movq 0x10(%rsp), %rcx
movq 0x8(%rcx), %rcx
movb $0x1, 0x1a(%rcx)
jmp 0x35627
movb 0x11(%r15), %al
testb $0x4, %al
je 0x35611
movb $0x1, 0x1a(%r15)
movq %r15, %rcx
testb $0x8, %al
jne 0x35634
jmp 0x35638
movq 0x10(%rsp), %rcx
movq 0x8(%rcx), %rcx
movb $0x1, 0x19(%rcx)
testb $0x8, %al
je 0x35638
movq 0x10(%rsp), %rax
movq 0x8(%rax), %rcx
movb $0x1, 0x1b(%rcx)
movq 0x10(%rsp), %r14
movl 0x10(%r14), %eax
movl %eax, (%r15)
testl %eax, %eax
jne 0x3565f
movq 0x8(%r14), %rax
xorl %ecx, %ecx
cmpb $0x0, 0x18(%rax)
sete %cl
leal 0x9(,%rcx,4), %eax
movl %eax, (%r15)
movq (%r14), %rdi
leaq 0x18(%rsp), %rsi
callq 0xe3f2a
cmpl $0x64, %ebx
jne 0x3568e
movq 0x8(%r14), %rcx
cmpb $0x0, 0x19(%rcx)
movq 0x20(%rsp), %rbx
movl 0x30(%rsp), %r14d
je 0x356b0
leaq 0xd59ae(%rip), %rsi     # 0x10b03a
jmp 0x356a3
movb %al, 0x12(%r15)
leaq 0xd59b6(%rip), %rsi     # 0x10b04f
movq 0x20(%rsp), %rbx
movl 0x30(%rsp), %r14d
movzbl %al, %edx
movq %r13, %rdi
xorl %eax, %eax
callq 0xde896
incq 0x18(%rsp)
movzbl 0x13(%r15), %edx
cmpl $0x5, %edx
ja 0x356d1
movl %edx, %eax
leaq 0xd60dc(%rip), %rsi     # 0x10b7a4
movslq (%rsi,%rax,4), %rcx
addq %rsi, %rcx
jmp 0x356d8
leaq 0xe9809(%rip), %rcx     # 0x11eee1
leaq 0xd5980(%rip), %rsi     # 0x10b05f
movq %r13, %rdi
xorl %eax, %eax
callq 0xde896
testl %r14d, %r14d
je 0x356f5
cmpb $0x2, 0x13(%r15)
jne 0x3575d
cmpl $0x67, 0x8(%r15)
jne 0x35712
movzbl 0x13(%r15), %edx
leaq 0xd598c(%rip), %rsi     # 0x10b094
movq %r13, %rdi
xorl %eax, %eax
callq 0xdf2a5
movq 0x10(%rsp), %rax
movq (%rax), %rdi
leaq 0x18(%rsp), %r14
movq %r14, %rsi
callq 0xe3f2a
movb %al, 0x14(%r15)
movzbl %al, %edx
leaq 0xd5975(%rip), %rsi     # 0x10b0aa
movq %r13, %rdi
xorl %eax, %eax
callq 0xde896
movl 0x8(%r15), %eax
movq (%r14), %rcx
cmpl $0x66, %eax
je 0x35775
cmpl $0x64, %eax
jne 0x35782
leaq 0x58(%r15), %r8
leaq 0xd5960(%rip), %r9      # 0x10b0bb
jmp 0x3578d
leaq 0xd590e(%rip), %rsi     # 0x10b072
xorl %ebx, %ebx
movq %r13, %rdi
xorl %eax, %eax
callq 0xdf2a5
jmp 0x361b7
leaq 0x58(%r15), %r8
leaq 0xd5943(%rip), %r9      # 0x10b0c3
jmp 0x3578d
leaq 0x48(%r15), %r8
leaq 0xd5959(%rip), %r9      # 0x10b0e6
movq %r13, %rdi
movq 0x10(%rsp), %rsi
movq %r15, %rdx
callq 0x36956
movq 0x18(%rsp), %rcx
addq $0x4, %rcx
movq %rcx, 0x18(%rsp)
cmpl $0x64, 0x8(%r15)
jne 0x357e0
andq $0x0, 0x30(%r15)
movq 0x10(%rsp), %rdx
movq 0x8(%rdx), %rax
cmpb $0x0, 0x1a(%rax)
je 0x359b5
movq (%rdx), %rdi
leaq 0x18(%rsp), %rsi
callq 0xe40bf
leaq 0xd58ee(%rip), %rsi     # 0x10b0cc
jmp 0x357fd
movq 0x10(%rsp), %rax
movq (%rax), %rdi
leaq 0x18(%rsp), %rsi
callq 0xe40bf
movq %rax, 0x30(%r15)
leaq 0xdbaca(%rip), %rsi     # 0x1112c7
movq %r13, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0xde896
movl 0x8(%r15), %eax
cmpl $0x65, %eax
movq %rbp, 0x38(%rsp)
je 0x3586f
cmpl $0x64, %eax
jne 0x358df
movq 0x10(%rsp), %r14
movq (%r14), %rdi
movq 0x8(%r14), %rax
cmpb $0x0, 0x1a(%rax)
je 0x35a1a
movq 0x18(%rsp), %rsi
pushq $0xc
popq %rdx
leaq 0x130(%rsp), %rcx
pushq $0x40
popq %r8
callq 0xdec40
leaq 0xd5893(%rip), %rsi     # 0x10b0ea
movq %r13, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0xde896
addq $0xc, 0x18(%rsp)
jmp 0x35ab9
movq 0x10(%rsp), %rax
movq (%rax), %rdi
leaq 0x18(%rsp), %rsi
callq 0xe40bf
movq %rax, 0x38(%r15)
leaq 0xd5870(%rip), %rsi     # 0x10b0fc
movq %r13, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0xde896
cmpl $0x64, 0x8(%r15)
jne 0x358e5
movq 0x10(%rsp), %rbx
movq (%rbx), %rdi
leaq 0x18(%rsp), %rsi
callq 0xe40bf
movq 0x8(%rbx), %rcx
cmpb $0x0, 0x19(%rcx)
je 0x35a3e
movq %rax, 0x20(%rcx)
leaq 0xd5844(%rip), %rsi     # 0x10b10f
movq %r13, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0xde896
movq 0x10(%rsp), %rbp
jmp 0x3590f
addq $0x4, 0x18(%rsp)
movq 0x10(%rsp), %rbp
movq (%rbp), %rdi
leaq 0x18(%rsp), %rsi
callq 0xe40bf
movl %eax, 0x24(%r15)
leaq 0x101512(%rip), %rsi    # 0x136e15
movq %r13, %rdi
movl %eax, %edx
xorl %eax, %eax
callq 0xde896
movq (%rbp), %rdi
leaq 0x18(%rsp), %r14
movq %r14, %rsi
callq 0xe3fc4
leaq 0xd5819(%rip), %rsi     # 0x10b140
movq %r13, %rdi
movl %eax, %edx
xorl %eax, %eax
callq 0xde896
movl 0x8(%r15), %ebx
movq (%rbp), %rdi
movq %r14, %rsi
callq 0xe3fc4
cmpl $0x64, %ebx
jne 0x35978
movq 0x8(%rbp), %rcx
cmpb $0x0, 0x19(%rcx)
movq 0x20(%rsp), %rbx
je 0x35ab9
movq %rax, 0x28(%rcx)
leaq 0xd57f7(%rip), %rsi     # 0x10b15d
movq %r13, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0xde896
jmp 0x35ab9
movl %eax, 0x20(%r15)
movq %r13, %rdi
callq 0xeac74
movq %rax, %r14
movzbl 0xf(%r15), %eax
cmpl $0xb, %eax
ja 0x35a78
movl $0xc21, %ecx            # imm = 0xC21
btl %eax, %ecx
jae 0x359e6
movl 0x20(%r15), %esi
movq %r13, %rdi
movq %r14, %rdx
xorl %ecx, %ecx
callq 0xe0298
jmp 0x35a8a
cmpb $0x0, 0x19(%r15)
je 0x35a6a
leaq 0x48(%r15), %r8
leaq 0xd5713(%rip), %r9      # 0x10b0de
movq %r13, %rdi
movq 0x10(%rsp), %rsi
movq %r15, %rdx
callq 0x36956
addq $0x4, 0x18(%rsp)
jmp 0x3580a
movl $0x104, %ecx            # imm = 0x104
btl %eax, %ecx
jae 0x35a78
movl 0x20(%r15), %ecx
leaq 0xd5779(%rip), %rdx     # 0x10b178
pushq $0x5
popq %rsi
movq %r14, %rdi
xorl %eax, %eax
callq 0xeae8b
testb $0x49, 0x20(%r15)
je 0x35a85
movb $0x1, 0x1d(%r15)
jmp 0x35a8a
leaq 0x18(%rsp), %rsi
callq 0xe40bf
movq 0x8(%r14), %rcx
cmpb $0x0, 0x19(%rcx)
je 0x35899
leaq 0xd5693(%rip), %rsi     # 0x10b0cc
jmp 0x3588c
cmpb $0x0, 0x1b(%rcx)
movq 0x10(%rsp), %rbp
je 0x3590f
movq %rax, 0x30(%rcx)
leaq 0xd56d2(%rip), %rsi     # 0x10b12a
movq %r13, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0xde896
jmp 0x3590f
addq $0x4, %rcx
movq %rcx, 0x18(%rsp)
jmp 0x3580a
pushq $0x3f
popq %rsi
movq %r14, %rdi
callq 0xeada5
jmp 0x35a8a
movb $0x1, 0x1e(%r15)
movq 0x20(%rsp), %rbx
movl 0x20(%r15), %ebp
movq %r14, %rdi
callq 0xeb877
leaq 0xd56e1(%rip), %rsi     # 0x10b183
movq %r13, %rdi
movl %ebp, %edx
movq %rax, %rcx
xorl %eax, %eax
callq 0xde896
movq %r14, %rdi
callq 0xeaf3c
movq 0x10(%rsp), %rax
movq (%rax), %rdi
leaq 0x18(%rsp), %rsi
callq 0xe3f2a
cmpl $0x64, 0x8(%r15)
movzbl %al, %ebp
jne 0x35afe
cmpb $0x0, 0x17(%r15)
je 0x35b18
leaq 0xd56b9(%rip), %rsi     # 0x10b19c
movq %r13, %rdi
movl %ebp, %edx
xorl %eax, %eax
callq 0xde896
movq 0x10(%rsp), %rax
movq 0x8(%rax), %rax
movb %bpl, 0x1c(%rax)
jmp 0x35b18
cmpb $0x0, 0x16(%r15)
je 0x35b18
leaq 0xd56a3(%rip), %rsi     # 0x10b1af
movq %r13, %rdi
movl %ebp, %edx
xorl %eax, %eax
callq 0xde896
movq 0x50(%rsp), %rax
leaq (%rbx,%rax), %rbp
addq $0x4, %rbp
movq 0x10(%rsp), %rax
movq (%rax), %rdi
leaq 0x18(%rsp), %rsi
callq 0xe3f2a
cmpb $0x0, 0x16(%r15)
je 0x35b52
movzbl %al, %edx
leaq 0xd5679(%rip), %rsi     # 0x10b1c1
movq %r13, %rdi
xorl %eax, %eax
callq 0xde896
movq 0x18(%rsp), %r14
leaq 0xd5674(%rip), %rsi     # 0x10b1d2
movq %rbp, %rcx
subq %r14, %rcx
movq %r13, %rdi
movq %r14, %rdx
xorl %eax, %eax
callq 0xde896
movq %rbp, %rbx
subq %r14, %rbx
jle 0x35cc8
pushq $0x1
popq %rsi
movq %r13, %rdi
callq 0xdeba7
movl 0x8(%r15), %eax
cmpl $0x65, %eax
je 0x35c07
cmpl $0x64, %eax
jne 0x35cbd
movq 0x10(%rsp), %rax
movq (%rax), %rdi
leaq 0x18(%rsp), %rsi
callq 0xe3f2a
testb $0x8, 0x11(%r15)
je 0x35bc7
movzbl %al, %edx
leaq 0xd5630(%rip), %rsi     # 0x10b1ed
movq %r13, %rdi
xorl %eax, %eax
callq 0xde896
cmpq $0x1, %rbx
je 0x35cbd
movq 0x10(%rsp), %rax
movq (%rax), %rdi
leaq 0x18(%rsp), %rsi
callq 0xe3f2a
cmpb $0x0, 0x18(%r15)
je 0x35cbd
movzbl %al, %edx
leaq 0xd560b(%rip), %rsi     # 0x10b203
movq %r13, %rdi
xorl %eax, %eax
callq 0xde896
jmp 0x35cbd
cmpq $0x4, %rbx
jb 0x35cbd
movq 0x10(%rsp), %rax
movq (%rax), %rdi
leaq 0x18(%rsp), %rsi
callq 0xe40bf
movq %rax, 0x28(%r15)
leaq 0xd55ed(%rip), %rsi     # 0x10b21b
movq %r13, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0xde896
cmpq $0xc, %rbx
jb 0x35cbd
movq 0x18(%rsp), %rcx
leaq 0x68(%r15), %r8
leaq 0xd296b(%rip), %r9      # 0x1085bc
movq %r13, %rdi
movq 0x10(%rsp), %r14
movq %r14, %rsi
movq %r15, %rdx
callq 0x36956
movq 0x18(%rsp), %rcx
addq $0x4, %rcx
movq %rcx, 0x18(%rsp)
leaq 0x58(%r15), %r8
leaq 0xd55b1(%rip), %r9      # 0x10b22e
movq %r13, %rdi
movq %r14, %rsi
movq %r15, %rdx
callq 0x36956
addq $0x4, 0x18(%rsp)
cmpq $0x10, %rbx
jb 0x35cbd
movq 0x10(%rsp), %rax
movq (%rax), %rdi
leaq 0x18(%rsp), %rsi
callq 0xe40bf
leaq 0xd5585(%rip), %rsi     # 0x10b235
movq %r13, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0xde896
pushq $-0x1
popq %rsi
movq %r13, %rdi
callq 0xdeba7
pushq $-0x1
popq %rsi
movq %r13, %rdi
callq 0xdeba7
movq %rbp, 0x18(%rsp)
movq %r12, %r14
subq 0x50(%rsp), %r14
leaq 0xd5562(%rip), %rsi     # 0x10b249
movq %r13, %rdi
movq %rbp, %rdx
movq %r14, %rcx
xorl %eax, %eax
callq 0xde896
pushq $0x1
popq %rbp
movq %r13, %rdi
movl %ebp, %esi
callq 0xdeba7
movq 0x10(%rsp), %rax
movq (%rax), %rdi
movq 0x18(%rsp), %rsi
movl (%r15), %r9d
movl $0x100, %ecx            # imm = 0x100
movq %r14, %rdx
movl %ebp, %r8d
callq 0xe495c
movq %rax, 0x98(%r15)
testb $0x10, 0x11(%r15)
movq 0x18(%rax), %rdi
movq 0x20(%rsp), %rsi
jne 0x35d63
movq 0x10(%rdi), %rax
xorl %ecx, %ecx
testq %rax, %rax
cmovleq %rcx, %rax
cmpq %rcx, %rax
je 0x35d63
movq 0x8(%rdi), %rdx
cmpl $0x5c, (%rdx,%rcx,4)
jne 0x35d5e
movl $0x2f, (%rdx,%rcx,4)
incq %rcx
jmp 0x35d48
leaq 0x4(%rsi), %rax
movq %rax, 0x30(%rsp)
leaq (%r12,%rsi), %rbx
addq $0x4, %rbx
callq 0xeb877
leaq 0xf8cde(%rip), %rsi     # 0x12ea5e
movq %r13, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0xde896
movq 0x98(%r15), %rax
cmpl $0x0, 0x34(%rax)
je 0x35e76
movq 0x18(%rsp), %r15
addq (%rax), %r15
movq %r15, 0x18(%rsp)
movq %rbx, %rbp
subq %r15, %rbp
cmpq $0x2, %rbp
jge 0x35dbf
xorl %r14d, %r14d
jmp 0x35e63
movq %r13, %rdi
callq 0xeac74
movq %rax, %r14
movq 0x10(%rsp), %rax
movq (%rax), %rdi
movq 0x28(%rsp), %rax
movzbl (%rax), %r9d
orl $0x300, %r9d            # imm = 0x300
pushq $0x1
popq %r8
movq %r15, %rsi
movq %rbp, %rdx
movq %r14, %rcx
callq 0xe4c9a
cmpq $0x0, 0x10(%r14)
jle 0x35e63
movq %r14, %rdi
callq 0xeb877
leaq 0xd19eb(%rip), %rsi     # 0x1077f5
xorl %r15d, %r15d
movq %r13, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0xde896
cmpl $0x2, 0x90(%r13)
jl 0x35e66
movq 0x28(%rsp), %rax
cmpl $0x64, 0x8(%rax)
leaq 0xd560f(%rip), %rax     # 0x10b443
leaq 0xd5607(%rip), %rsi     # 0x10b442
cmoveq %rax, %rsi
pushq $0x1
popq %rbp
movq %r13, %rdi
xorl %edx, %edx
movl %ebp, %ecx
callq 0xe4e62
movq %rax, %r15
movq %r13, %rdi
movq %r14, %rsi
movq %rax, %rdx
movl %ebp, %ecx
callq 0xeb576
jmp 0x35e66
xorl %r15d, %r15d
movq %r15, %rdi
callq 0xe5591
movq %r14, %rdi
callq 0xeaf3c
pushq $-0x1
popq %rbp
movq %r13, %rdi
movl %ebp, %esi
callq 0xdeba7
movq %r13, %rdi
movl %ebp, %esi
callq 0xdeba7
leaq 0x18(%rsp), %rsi
movq %rbx, (%rsi)
movq 0x10(%rsp), %r15
movq (%r15), %rdi
callq 0xe40bf
movq %rax, %r14
leaq 0xd53c3(%rip), %rsi     # 0x10b26f
movq %r13, %rdi
movl %r14d, %edx
xorl %eax, %eax
callq 0xde896
movq 0x20(%r15), %rdi
callq 0xe0e44
movq (%r15), %rsi
movq 0x20(%r15), %rdi
movq 0x30(%rsp), %rdx
movq %r12, %rcx
callq 0xe0f33
movq 0x20(%r15), %rdi
callq 0xe0e95
movl %eax, %ebp
leaq 0xd53a8(%rip), %rsi     # 0x10b290
movq %r13, %rdi
movl %eax, %edx
xorl %eax, %eax
callq 0xde896
cmpl %r14d, %ebp
je 0x35f0a
leaq 0xd53b3(%rip), %rsi     # 0x10b2b3
movq %r13, %rdi
xorl %eax, %eax
callq 0xdf05a
pushq $0x2
popq %rax
movl %eax, 0x4c(%rsp)
movq 0x18(%rsp), %rbp
leaq 0xd0(%rsp), %rax
movq %rbp, (%rax)
leaq 0x60(%rsp), %rsi
movq %r13, %rdi
callq 0xdebae
leaq 0xd5521(%rip), %rsi     # 0x10b456
movq %r13, %rdi
movq %rbp, %rdx
xorl %eax, %eax
callq 0xde896
pushq $0x1
popq %rbx
movq %r13, %rdi
movl %ebx, %esi
callq 0xdeba7
movq %rbp, 0x50(%rsp)
xorl %r12d, %r12d
movq (%r15), %rdi
leaq 0xd0(%rsp), %rsi
callq 0xe3fc4
movq %rax, %r14
testq %rax, %rax
je 0x3607c
movq %r13, %rdi
leaq 0xd54e9(%rip), %rsi     # 0x10b466
movl %r12d, %edx
movq %rbp, %rcx
movq %r14, %r8
xorl %eax, %eax
callq 0xde896
movq %r13, %rdi
movl %ebx, %esi
callq 0xdeba7
movq 0xd0(%rsp), %rbp
leaq (%r14,%rbp), %rax
addq $0x4, %rax
movq (%r15), %rcx
cmpq 0x18(%rcx), %rax
jg 0x36095
movl %r12d, 0x30(%rsp)
movl %ebx, %r12d
leaq (%r14,%rbp), %rbx
movq 0x20(%r15), %rdi
callq 0xe0e44
movq (%r15), %rsi
movq 0x20(%r15), %rdi
movq %rbp, %rdx
movq %r14, %rcx
callq 0xe0f33
movq 0x20(%r15), %rdi
callq 0xe0e95
movl %eax, %r15d
movq %rbx, 0xd0(%rsp)
movq 0x10(%rsp), %rax
movq (%rax), %rdi
leaq 0xd0(%rsp), %rsi
callq 0xe40bf
movq %rax, %rbx
movq %r13, %rdi
leaq 0xd5472(%rip), %rsi     # 0x10b483
movl %ebx, %edx
xorl %eax, %eax
callq 0xde896
movq %r13, %rdi
leaq 0xd547e(%rip), %rsi     # 0x10b4a2
movl %r15d, %edx
xorl %eax, %eax
callq 0xde896
cmpl %ebx, %r15d
movl %r12d, %ebx
movl 0x30(%rsp), %r12d
movq 0x10(%rsp), %r15
jne 0x36095
movq (%r15), %rsi
movl $0x1, (%rsp)
movl $0x100, %r8d            # imm = 0x100
movq %r13, %rdi
movq %rbp, %rdx
movq %r14, %rcx
xorl %r9d, %r9d
callq 0xded3a
incl %r12d
movq %r13, %rdi
pushq $-0x1
popq %rsi
callq 0xdeba7
movq 0xd0(%rsp), %rbp
jmp 0x35f57
movq 0xd0(%rsp), %rdx
leaq 0xd53c4(%rip), %rsi     # 0x10b44f
movq %r13, %rdi
xorl %eax, %eax
callq 0xde896
movq 0xd0(%rsp), %r15
movl 0x60(%rsp), %esi
movq %r13, %rdi
callq 0xdebb7
testq %r14, %r14
je 0x360d0
leaq 0xd5216(%rip), %rsi     # 0x10b2cb
xorl %ebx, %ebx
movq %r13, %rdi
xorl %eax, %eax
callq 0xdf2a5
movq 0x28(%rsp), %r15
movq 0x38(%rsp), %rbp
jmp 0x361b7
subq 0x50(%rsp), %r15
addq 0x18(%rsp), %r15
movq %r15, 0x18(%rsp)
movq 0x28(%rsp), %rbx
cmpb $0x3, 0x13(%rbx)
sete 0x1c(%rbx)
movq %r15, 0x40(%rbx)
cmpl $0x65, 0x8(%rbx)
movq 0x38(%rsp), %rbp
jne 0x3614e
leaq 0xeee3e(%rip), %rsi     # 0x124f40
xorl %r14d, %r14d
movq %r13, %rdi
movq %r15, %rdx
xorl %eax, %eax
callq 0xde896
pushq $0x1
popq %rsi
movq %r13, %rdi
callq 0xdeba7
cmpl $0x65, 0x8(%rbx)
movq %rbx, %r15
movq 0x40(%rsp), %r12
jne 0x3615d
movq 0x98(%r15), %rax
testq %rax, %rax
je 0x3615a
cmpb $0x0, 0x1c(%r15)
movq 0x20(%rsp), %rbx
je 0x3627a
xorl %ecx, %ecx
jmp 0x36282
movq 0x20(%rsp), %rbx
movq 0x40(%rsp), %r12
jmp 0x3619c
xorl %r14d, %r14d
movq 0x20(%rsp), %rbx
cmpb $0x0, 0xc(%r15)
je 0x361fe
movq %r13, %rdi
movq 0x10(%rsp), %rsi
xorl %edx, %edx
callq 0x3504a
testq %r14, %r14
je 0x3618c
movq %r13, %rdi
movq %r14, %rsi
callq 0xdfd24
pushq $-0x1
popq %rsi
movq %r13, %rdi
callq 0xdeba7
movq 0x18(%rsp), %r15
movq 0x28(%rsp), %rax
addq 0x30(%rax), %r15
movq %r15, 0x18(%rsp)
subq %rbx, %r15
movq %r15, (%r12)
movq %rax, %r15
pushq $0x1
popq %rbx
movq %rbp, %rdi
callq 0xeaf3c
testq %r15, %r15
je 0x361de
movq 0x98(%r15), %rsi
movq %r13, %rdi
callq 0xe4b94
movq %r13, %rdi
movq %r15, %rsi
callq 0xded32
movl 0x5c(%rsp), %esi
movq %r13, %rdi
callq 0xdebb7
movl %ebx, %eax
addq $0x178, %rsp            # imm = 0x178
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x10(%rsp), %rax
movq 0x28(%rax), %rax
testq %rax, %rax
je 0x3617c
cmpb $0x0, 0x1a(%r15)
jne 0x3617c
movl 0x14(%rax), %edx
cmpl $0x2, %edx
jl 0x3616d
leaq 0xd5309(%rip), %rsi     # 0x10b537
movq %r13, %rdi
xorl %eax, %eax
callq 0xde896
movq %r14, %r15
movq 0x10(%rsp), %r14
movq 0x28(%r14), %rax
movq 0x20(%rax), %rdx
leaq 0xd52fa(%rip), %rsi     # 0x10b549
movq %r13, %rdi
xorl %eax, %eax
callq 0xde896
movq 0x28(%r14), %rax
movq %r15, %r14
movq 0x18(%rax), %rdx
leaq 0xd52f3(%rip), %rsi     # 0x10b55e
movq %r13, %rdi
xorl %eax, %eax
callq 0xde896
jmp 0x3616d
cmpq $0x0, 0x38(%r15)
setne %cl
cmpb $0x9, 0x13(%r15)
jne 0x362ae
movq 0x18(%rax), %rdi
callq 0xeb877
leaq 0xd522a(%rip), %rsi     # 0x10b4c3
xorl %r14d, %r14d
movq %r13, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0xdf2a5
jmp 0x36162
testb $0x1, 0x11(%r15)
sete %dl
movl %ecx, %esi
xorb $0x1, %sil
orb %dl, %sil
jne 0x36305
movq 0x18(%rax), %rdi
callq 0xeb877
movq 0x10(%rsp), %rcx
movq 0x8(%rcx), %rcx
cmpb $0x2, 0x1c(%rcx)
leaq 0xd5220(%rip), %rdx     # 0x10b4fe
leaq 0xd5221(%rip), %rcx     # 0x10b506
cmovaeq %rdx, %rcx
leaq 0xd51ed(%rip), %rsi     # 0x10b4dd
xorl %r14d, %r14d
movq %r13, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0xdf2a5
jmp 0x36162
testb %cl, %cl
je 0x3633a
cmpb $0x5, 0x12(%r15)
jb 0x3633a
movq 0x18(%rax), %rdi
callq 0xeb877
movzbl 0x12(%r15), %ecx
leaq 0xd51e7(%rip), %rsi     # 0x10b50c
xorl %r14d, %r14d
movq %r13, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0xdf2a5
jmp 0x36162
movq 0x10(%rsp), %rcx
movq 0x28(%rcx), %rcx
movb 0x1b(%r15), %dl
testq %rcx, %rcx
je 0x36370
testb %dl, %dl
je 0x3635c
movq 0x28(%r15), %rax
movb $0x1, %bl
cmpq 0x18(%rcx), %rax
je 0x363c3
pushq $0x1
popq %rdx
movq %r13, %rdi
movq 0x10(%rsp), %rsi
callq 0x3504a
movb $0x1, %bl
jmp 0x363c3
movb $0x1, %bl
testb %dl, %dl
je 0x363c3
movq 0x10(%rsp), %rcx
movb 0x14(%rcx), %bpl
movq 0x18(%rax), %rdi
callq 0xeb877
testb %bpl, %bpl
je 0x363a8
leaq 0xd51df(%rip), %rsi     # 0x10b573
movq %r13, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0xdf2a5
movb $0x1, 0xc(%r15)
jmp 0x363be
leaq 0xd51f0(%rip), %rsi     # 0x10b59f
xorl %ebx, %ebx
movq %r13, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0xdf05a
movq 0x38(%rsp), %rbp
movq 0x10(%rsp), %rax
cmpq $0x0, 0x28(%rax)
jne 0x36414
pushq $0x1
popq %rdx
movq %r13, %rdi
movq 0x10(%rsp), %r14
movq %r14, %rsi
callq 0x3504a
pushq $0x28
popq %rsi
movq %r13, %rdi
callq 0xdecaf
movq %rax, 0x28(%r14)
movq %r13, %rdi
callq 0xeac74
movq 0x28(%r14), %rcx
movq %rax, 0x8(%rcx)
movq 0x98(%r15), %rcx
movq 0x18(%rcx), %rsi
movq %rax, %rdi
callq 0xead71
testb %bl, %bl
jne 0x36425
movq 0x10(%rsp), %rax
movq 0x28(%rax), %rax
movb $0x1, 0x10(%rax)
cmpb $0x0, 0xc(%r15)
movq 0x20(%rsp), %rbx
je 0x36439
xorl %r14d, %r14d
jmp 0x36162
movq 0x10(%rsp), %rax
movq 0x28(%rax), %rax
movdqu 0x30(%r15), %xmm0
pshufd $0x4e, %xmm0, %xmm0     # xmm0 = xmm0[2,3,0,1]
movdqu 0x18(%rax), %xmm1
paddq %xmm0, %xmm1
movdqu %xmm1, 0x18(%rax)
incl 0x14(%rax)
movq %r13, %rdi
callq 0xdfd1a
movq %rax, %r14
movq 0x98(%r15), %rax
movq 0x18(%rax), %rdx
pushq $0x1
popq %rbp
movq %r13, %rdi
movq %r14, %rsi
movl %ebp, %ecx
callq 0xdfd55
movb $0x1, 0x8(%r14)
movb 0x1c(%r15), %al
movb %al, 0x9(%r14)
cmpb $0x4, 0x13(%r15)
sete %cl
sete 0xa(%r14)
testb %al, %al
setne %al
orb %cl, %al
testb $0x1, %al
jne 0x364c3
cmpb $0x0, 0x1d(%r15)
jne 0x364bb
cmpb $0x0, 0x1e(%r15)
movl %ebp, 0x4c(%rsp)
je 0x364c3
movl 0x4c(%rsp), %eax
orl %eax, 0x14(%r14)
leaq 0x48(%r15), %rax
xorl %ecx, %ecx
cmpq $0x50, %rcx
je 0x364e1
movdqu (%rax,%rcx), %xmm0
movdqu %xmm0, 0x18(%r14,%rcx)
addq $0x10, %rcx
jmp 0x364c9
movq 0x10(%rsp), %rax
movq 0x28(%rax), %rax
cmpq $0x0, (%rax)
jne 0x36513
movq %r13, %rdi
xorl %esi, %esi
movq %r14, %rdx
xorl %ecx, %ecx
callq 0xe4e62
movq 0x10(%rsp), %rcx
movq 0x28(%rcx), %rcx
movq %rax, (%rcx)
movq %rax, %rdi
callq 0xe589c
cmpb $0x0, 0x1c(%r15)
je 0x36524
movq 0x38(%rsp), %rbp
jmp 0x36162
movq %r14, 0x30(%rsp)
leaq 0x60(%rsp), %rbx
leaq 0x98(%rsp), %r14
leaq 0xd0(%rsp), %rcx
movq %r13, %rdi
movq %rbx, %rsi
movq %r14, %rdx
callq 0xee7ee
movq 0x10(%rsp), %rbp
movq (%rbp), %rax
movq %rax, (%rbx)
movq 0x40(%r15), %rax
movq %rax, 0x8(%rbx)
movq 0x30(%r15), %rax
movq %rax, 0x10(%rbx)
movq 0x28(%rbp), %rax
movq (%rax), %rax
movq %rax, (%r14)
movb $0x1, 0x8(%r14)
movq 0x38(%r15), %rax
movq %rax, 0x10(%r14)
movq 0x20(%rbp), %rdi
callq 0xe0e44
movq 0x20(%rbp), %rdx
movq 0x28(%rbp), %rax
movq (%rax), %rdi
leaq 0xafd27(%rip), %rsi     # 0xe62c1
callq 0xe629a
cmpq $0x0, 0x38(%r15)
je 0x368a2
movb 0x12(%r15), %al
testb %al, %al
je 0x36676
cmpb $0x3, %al
ja 0x3669b
pxor %xmm0, %xmm0
leaq 0x80(%rsp), %rbx
movdqa %xmm0, (%rbx)
xorl %eax, %eax
cmpb $0x33, 0xe(%r15)
sete %al
orl $0x6, %eax
movl %eax, (%rbx)
movw $0x103, 0x4(%rbx)       # imm = 0x103
leaq 0x60(%rsp), %rsi
leaq 0x98(%rsp), %rdx
leaq 0xd0(%rsp), %r14
movq %r13, %rdi
movq %r14, %rcx
movq %rbx, %r8
callq 0xf2dac
movq 0x8(%rbx), %rdx
leaq 0xd4fc6(%rip), %rsi     # 0x10b5d7
movq %r13, %rbx
movq %r13, %rdi
xorl %eax, %eax
callq 0xdea83
cmpl $0x0, (%r14)
jne 0x3666e
cmpq $0x6801, 0x88(%rsp) # imm = 0x6801
jl 0x3666e
movq 0x28(%rsp), %rax
cmpb $0xb, 0xe(%rax)
ja 0x3666e
movq 0x28(%rsp), %rax
movq 0x98(%rax), %rax
movq 0x18(%rax), %rdi
callq 0xeb877
movq 0x88(%rsp), %rcx
leaq 0xd4f84(%rip), %rsi     # 0x10b5e5
movq %rbx, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0xdf05a
movq %rbx, %r13
jmp 0x36898
leaq 0x60(%rsp), %rsi
leaq 0x98(%rsp), %rdx
leaq 0xd0(%rsp), %rcx
movq %r13, %rdi
xorl %r8d, %r8d
callq 0xeea8f
jmp 0x368a2
cmpb $0x4, %al
movq 0x40(%rsp), %r12
jne 0x368a2
pushq $0x48
popq %rsi
movq %r15, %rbx
movq %r13, %r15
movq %r13, %rdi
callq 0xdecaf
movq %r14, 0x10(%rax)
movq 0x60(%rsp), %rcx
movq %rcx, 0x18(%rax)
movq 0x68(%rsp), %rcx
movq %rcx, 0x20(%rax)
addq 0x70(%rsp), %rcx
movq %rax, %r13
movq %rcx, 0x28(%rax)
cmpb $0x1, 0xd(%rbx)
jne 0x366e6
movb $0x1, 0xc(%r13)
movq %r13, %rbp
movq %r13, %r12
addq $0x18, %r12
movq %r15, %rdi
movl $0x4000, %esi           # imm = 0x4000
callq 0xef27c
leaq 0x31e(%rip), %rcx       # 0x36a22
movq %rcx, 0x8(%rax)
movq %rax, %rbx
movq %r13, (%rax)
cmpb $0x0, 0x30(%rbp)
jne 0x36866
cmpl $0x0, 0x8(%rbp)
jne 0x36866
movq 0x10(%rbp), %rax
cmpb $0x0, 0x8(%rax)
je 0x3673a
movq (%rbp), %rcx
cmpq 0x10(%rax), %rcx
jge 0x36866
xorl %r14d, %r14d
movq %r12, %rdi
pushq $0x1
popq %rsi
callq 0xe6a4a
testl %eax, %eax
je 0x36770
incl %r14d
cmpl $0x7, %r14d
jne 0x3673d
cmpb $0x0, 0xc(%rbp)
pushq $0x7
popq %r14
je 0x36779
movq %r12, %rdi
pushq $0x1
popq %rsi
callq 0xe6a4a
pushq $0x7
popq %r14
jmp 0x36779
testl %r14d, %r14d
je 0x3680a
movq %r12, %rdi
movl %r14d, %esi
callq 0xe6a4a
pushq $-0x1
popq %rbp
movl %r14d, %ecx
shll %cl, %ebp
notl %ebp
addl %eax, %ebp
je 0x3680a
pushq $0x9
popq %r14
movq %r12, %rdi
pushq $0x1
popq %rsi
callq 0xe6a4a
testl %eax, %eax
je 0x367c8
incl %r14d
cmpl $0xd, %r14d
jne 0x36796
cmpb $0x0, 0xc(%r13)
pushq $0xd
popq %r14
je 0x367c8
movq %r12, %rdi
pushq $0x1
popq %rsi
callq 0xe6a4a
pushq $0xd
popq %r14
movq %r12, %rdi
movl %r14d, %esi
callq 0xe6a4a
pushq $0x1
popq %rcx
movl %ecx, %edx
movl %r14d, %ecx
shll %cl, %edx
leal (%rdx,%rax), %r14d
addl $0xfffffe00, %r14d      # imm = 0xFFFFFE00
cmpl $0x3, (%r15)
jle 0x36847
movq %r15, %rdi
leal 0x1(%r14), %edx
addl $0x2, %ebp
leaq 0x107cd5(%rip), %rsi    # 0x13e4d4
movl %ebp, %ecx
xorl %eax, %eax
callq 0xde896
jmp 0x3684a
movq %r12, %rdi
pushq $0x8
popq %rsi
callq 0xe6a4a
movq %rax, %r14
cmpl $0x4, (%r15)
jl 0x36833
movq %r15, %rdi
movzbl %r14b, %edx
leaq 0x106e00(%rip), %rsi    # 0x13d62c
xorl %eax, %eax
callq 0xde896
movzbl %r14b, %esi
movq %rbx, %rdi
callq 0xef336
movq %r13, %rbp
jmp 0x3670e
addl $0x2, %ebp
notl %r14d
movq %rbx, %rdi
addl 0x10(%rbx), %r14d
movl %r14d, %esi
movl %ebp, %edx
callq 0xef363
movq %r13, %rbp
jmp 0x3670e
movb $0x1, 0xd4(%rsp)
movq 0x20(%rbp), %rax
subq 0x68(%rsp), %rax
movq %rax, 0xd8(%rsp)
movq %r15, %r13
movq %r15, %rdi
movq %rbx, %rsi
callq 0xef395
movq %r15, %rdi
movq %rbp, %rsi
callq 0xded32
movq 0x28(%rsp), %r15
movq 0x40(%rsp), %r12
movq 0x98(%rsp), %rdi
callq 0xe58e8
cmpl $0x0, 0xd0(%rsp)
je 0x368f5
movq 0x98(%r15), %rax
movq 0x18(%rax), %rdi
callq 0xeb877
movq %rax, %rbx
leaq 0xd0(%rsp), %rsi
movq %r13, %rdi
callq 0xee7bc
leaq 0xd08da(%rip), %rsi     # 0x1071bd
movq %r13, %rdi
movq %rbx, %rdx
movq %rax, %rcx
xorl %eax, %eax
callq 0xdf2a5
jmp 0x36942
movq 0x10(%rsp), %rax
movq 0x20(%rax), %rdi
callq 0xe0e95
movl %eax, %ebx
leaq 0xd498e(%rip), %rsi     # 0x10b29a
movq %r13, %rdi
movl %eax, %edx
xorl %eax, %eax
callq 0xde896
cmpl 0x24(%r15), %ebx
je 0x36942
movq 0x98(%r15), %rax
movq 0x18(%rax), %rdi
callq 0xeb877
leaq 0xd1287(%rip), %rsi     # 0x107bbc
movq %r13, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0xdf2a5
movq 0x20(%rsp), %rbx
movq 0x38(%rsp), %rbp
movq 0x30(%rsp), %r14
jmp 0x36162