// File: /workspace/github_c_makefile_star2_O1/jsummers[P]deark/modules/rsc.c
// Function: de_run_rsc
static void de_run_rsc(deark *c, de_module_params *mparams)
{
	lctx *d = NULL;
	const char *tmps;

	d = de_malloc(c, sizeof(lctx));
	d->c = c;
	d->avail_file_size = c->infile->len; // Starting value. Will be adjusted later.

	d->fmt = RSCFMT_UNKNOWN;
	tmps = de_get_ext_option(c, "rsc:fmt");
	if(tmps) {
		if(!de_strcmp(tmps, "pc")) {
			d->fmt = RSCFMT_PC;
		}
		else if(!de_strcmp(tmps, "atari")) {
			d->fmt = RSCFMT_ATARI;
		}
	}

	if(d->fmt==RSCFMT_UNKNOWN) {
		detect_rsc_format(c, d);
	}

	if(d->fmt==RSCFMT_UNKNOWN) {
		d->fmt = RSCFMT_ATARI;
	}

	if(d->fmt==RSCFMT_PC) {
		de_declare_fmt(c, "GEM RSC, PC");
		d->is_le = 1;
	}
	else {
		de_declare_fmt(c, "GEM RSC, Atari");
	}

	d->input_encoding = de_get_input_encoding(c, NULL, DE_ENCODING_UNKNOWN);
	if(d->input_encoding==DE_ENCODING_UNKNOWN) {
		if(d->fmt==RSCFMT_ATARI) {
			d->input_encoding = DE_ENCODING_ATARIST;
		}
		else {
			// TODO?: This should probably be the "GEM character set", but we don't
			// support that.
			d->input_encoding = DE_ENCODING_ASCII;
		}
	}

	d->decode_objects = 1;
	// TODO: For Atari format, maybe we can disallow unaligned offsets.
	d->allow_unaligned_offsets = 1;

	de_dbg(c, "header at %d", 0);
	de_dbg_indent(c, 1);
	d->version = gem_getu16(d, 0);
	de_dbg(c, "version: 0x%04x", (int)d->version);

	d->object_offs = gem_getu16(d, 2);
	d->iconblk_offs = gem_getu16(d, 6);
	d->bitblk_offs = gem_getu16(d, 8);
	d->imagedata_offs = gem_getu16(d, 14);
	d->imagepointertable_offs = gem_getu16(d, 16);
	d->object_num = gem_getu16(d, 20);
	d->objecttree_num = gem_getu16(d, 22);
	d->iconblk_num = gem_getu16(d, 26);
	d->bitblk_num = gem_getu16(d, 28);
	d->rssize = gem_getu16(d, 34);

	de_dbg(c, "OBJECT: %d at %d", (int)d->object_num, (int)d->object_offs);
	de_dbg(c, "num object trees: %d", (int)d->objecttree_num);
	de_dbg(c, "ICONBLK: %d at %d", (int)d->iconblk_num, (int)d->iconblk_offs);
	de_dbg(c, "BITBLK: %d at %d", (int)d->bitblk_num, (int)d->bitblk_offs);
	de_dbg(c, "imagedata: at %d", (int)d->imagedata_offs);
	de_dbg(c, "imagepointertable: at %d", (int)d->imagepointertable_offs);
	if(d->version & 0x0004) {
		de_dbg(c, "extension array offset: %"I64_FMT, d->rssize);
	}
	else {
		de_dbg(c, "reported file size: %"I64_FMT, d->rssize);
		d->reported_file_size = d->rssize;
		d->avail_file_size = de_min_int(d->reported_file_size, c->infile->len);
	}
	de_dbg_indent(c, -1);

	if(d->version & 0x0004) {
		do_extension_array(c, d);
	}
	else if(d->version==0 || d->version==1) {
		;
	}
	else {
		de_err(c, "Unknown or unsupported version of RSC");
		goto done;
	}

	do_OBJECTs(c, d);
	do_BITBLKs(c, d);
	do_ICONBLKs(c, d);
	if(d->version & 0x0004) {
		do_cicon(c, d);
	}

done:
	de_free(c, d);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x68, %rsp
movq %rdi, %rbx
movl $0x4d8, %esi            # imm = 0x4D8
callq 0xe969b
movq %rax, %r14
movq %rbx, (%rax)
movq 0x18(%rbx), %rax
movq 0x18(%rax), %rax
movq %rax, 0x80(%r14)
movl $0x0, 0xc(%r14)
leaq 0x75b12(%rip), %rsi     # 0x13a8d8
movq %rbx, %rdi
callq 0xea6cb
testq %rax, %rax
je 0xc4e0c
movq %rax, %r15
leaq 0x765d8(%rip), %rsi     # 0x13b3b5
movq %rax, %rdi
callq 0x181a0
testl %eax, %eax
je 0xc4e03
leaq 0x75af0(%rip), %rsi     # 0x13a8e0
movq %r15, %rdi
callq 0x181a0
testl %eax, %eax
jne 0xc4e0c
movl $0x1, %eax
jmp 0xc4e08
movl $0x2, %eax
movl %eax, 0xc(%r14)
cmpl $0x0, 0xc(%r14)
jne 0xc4e30
movq 0x18(%rbx), %rdi
xorl %esi, %esi
callq 0xef169
testq %rax, %rax
je 0xc593a
movl $0x1, %ecx
movl %ecx, 0xc(%r14)
cmpl $0x0, 0xc(%r14)
jne 0xc4e3f
movl $0x1, 0xc(%r14)
cmpl $0x2, 0xc(%r14)
jne 0xc4e5f
leaq 0x75a99(%rip), %rsi     # 0x13a8e6
movq %rbx, %rdi
callq 0xeb6d6
movl $0x1, 0x10(%r14)
jmp 0xc4e6e
leaq 0x75a8c(%rip), %rsi     # 0x13a8f2
movq %rbx, %rdi
callq 0xeb6d6
movq %rbx, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0xeb7d1
movl %eax, 0x8(%r14)
testl %eax, %eax
jne 0xc4e98
cmpl $0x1, 0xc(%r14)
movl $0x12, %eax
movl $0x1, %ecx
cmovel %eax, %ecx
movl %ecx, 0x8(%r14)
movw $0x101, 0x14(%r14)      # imm = 0x101
leaq 0x744b8(%rip), %rsi     # 0x13935e
movq %rbx, %rdi
xorl %edx, %edx
xorl %eax, %eax
callq 0xe9226
movq %rbx, %rdi
movl $0x1, %esi
callq 0xe9585
movq (%r14), %rax
movq 0x18(%rax), %rdi
movl 0x10(%r14), %edx
xorl %esi, %esi
callq 0xef570
movq %rax, 0x18(%r14)
leaq 0x70191(%rip), %rsi     # 0x13506d
movq %rbx, %rdi
movl %eax, %edx
xorl %eax, %eax
callq 0xe9226
movq (%r14), %rax
movq 0x18(%rax), %rdi
movl 0x10(%r14), %edx
movl $0x2, %esi
callq 0xef570
movq %rax, 0x20(%r14)
movq (%r14), %rax
movq 0x18(%rax), %rdi
movl 0x10(%r14), %edx
movl $0x6, %esi
callq 0xef570
movq %rax, 0x38(%r14)
movq (%r14), %rax
movq 0x18(%rax), %rdi
movl 0x10(%r14), %edx
movl $0x8, %esi
callq 0xef570
movq %rax, 0x48(%r14)
movq (%r14), %rax
movq 0x18(%rax), %rdi
movl 0x10(%r14), %edx
movl $0xe, %esi
callq 0xef570
movq %rax, 0x58(%r14)
movq (%r14), %rax
movq 0x18(%rax), %rdi
movl 0x10(%r14), %edx
movl $0x10, %esi
callq 0xef570
movq %rax, 0x60(%r14)
movq (%r14), %rax
movq 0x18(%rax), %rdi
movl 0x10(%r14), %edx
movl $0x14, %esi
callq 0xef570
movq %rax, 0x28(%r14)
movq (%r14), %rax
movq 0x18(%rax), %rdi
movl 0x10(%r14), %edx
movl $0x16, %esi
callq 0xef570
movq %rax, 0x30(%r14)
movq (%r14), %rax
movq 0x18(%rax), %rdi
movl 0x10(%r14), %edx
movl $0x1a, %esi
callq 0xef570
movq %rax, 0x40(%r14)
movq (%r14), %rax
movq 0x18(%rax), %rdi
movl 0x10(%r14), %edx
movl $0x1c, %esi
callq 0xef570
movq %rax, 0x50(%r14)
movq (%r14), %rax
movq 0x18(%rax), %rdi
movl 0x10(%r14), %edx
movl $0x22, %esi
callq 0xef570
movq %rax, 0x68(%r14)
movl 0x20(%r14), %ecx
movl 0x28(%r14), %edx
leaq 0x75910(%rip), %rsi     # 0x13a901
movq %rbx, %rdi
xorl %eax, %eax
callq 0xe9226
movl 0x30(%r14), %edx
leaq 0x7590c(%rip), %rsi     # 0x13a912
movq %rbx, %rdi
xorl %eax, %eax
callq 0xe9226
movl 0x38(%r14), %ecx
movl 0x40(%r14), %edx
leaq 0x75908(%rip), %rsi     # 0x13a927
movq %rbx, %rdi
xorl %eax, %eax
callq 0xe9226
movl 0x48(%r14), %ecx
movl 0x50(%r14), %edx
leaq 0x75901(%rip), %rsi     # 0x13a939
movq %rbx, %rdi
xorl %eax, %eax
callq 0xe9226
movl 0x58(%r14), %edx
leaq 0x758fd(%rip), %rsi     # 0x13a94a
movq %rbx, %rdi
xorl %eax, %eax
callq 0xe9226
movl 0x60(%r14), %edx
leaq 0x758f9(%rip), %rsi     # 0x13a95b
movq %rbx, %rdi
xorl %eax, %eax
callq 0xe9226
testb $0x4, 0x18(%r14)
movq 0x68(%r14), %rdx
jne 0xc50a6
leaq 0x56653(%rip), %rsi     # 0x11b6d1
movq %rbx, %rdi
xorl %eax, %eax
callq 0xe9226
movq 0x68(%r14), %rdi
movq %rdi, 0x78(%r14)
movq 0x18(%rbx), %rax
movq 0x18(%rax), %rsi
callq 0xea792
movq %rax, 0x80(%r14)
jmp 0xc50b7
leaq 0x758c7(%rip), %rsi     # 0x13a974
movq %rbx, %rdi
xorl %eax, %eax
callq 0xe9226
movq %rbx, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0xe9585
movq 0x18(%r14), %rax
testb $0x4, %al
jne 0xc50ec
cmpq $0x2, %rax
jb 0xc51c8
leaq 0x758b3(%rip), %rsi     # 0x13a990
movq %rbx, %rdi
xorl %eax, %eax
callq 0xe9df7
jmp 0xc5f10
movq 0x68(%r14), %r15
leaq 0x758bf(%rip), %rsi     # 0x13a9b6
movq %rbx, %rdi
movq %r15, %rdx
xorl %eax, %eax
callq 0xe9226
movq %rbx, %rdi
movl $0x1, %esi
callq 0xe9585
movq 0x68(%r14), %rdx
leaq 0x758b1(%rip), %r8      # 0x13a9cd
movl $0x8, %ecx
movq %rbx, %rdi
movq %r14, %rsi
callq 0xc5f71
testl %eax, %eax
je 0xc51bb
movq (%r14), %rax
movq 0x18(%rax), %rdi
movl 0x10(%r14), %edx
movq %r15, %rsi
callq 0xef614
movq %rax, 0x78(%r14)
leaq 0x5657f(%rip), %rsi     # 0x11b6d1
movq %rbx, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0xe9226
movq 0x78(%r14), %rdi
movq 0x18(%rbx), %rax
movq 0x18(%rax), %rsi
callq 0xea792
movq %rax, 0x80(%r14)
addq $0x4, %r15
movq (%r14), %rax
movq 0x18(%rax), %rdi
movl 0x10(%r14), %edx
movq %r15, %rsi
callq 0xef614
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
cmpq %rcx, %rax
movq $-0x1, %rdx
cmovneq %rax, %rdx
movq %rdx, 0x70(%r14)
testq %rdx, %rdx
je 0xc51bb
leaq 0x7582c(%rip), %rsi     # 0x13a9dd
movq %rbx, %rdi
xorl %eax, %eax
callq 0xe9226
movq %rbx, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0xe9585
cmpq $0x0, 0x28(%r14)
movq %rbx, 0x10(%rsp)
movq %r14, 0x28(%rsp)
jle 0xc5411
movq 0x20(%r14), %rdx
leaq 0x7583d(%rip), %rsi     # 0x13aa25
movq %rbx, %rdi
xorl %eax, %eax
callq 0xe9226
movq 0x20(%r14), %rdx
movq 0x28(%r14), %rax
shlq $0x3, %rax
leaq (%rax,%rax,2), %rcx
leaq 0x7582b(%rip), %r8      # 0x13aa34
movq %rbx, %rdi
movq %r14, %rsi
callq 0xc5f71
testl %eax, %eax
je 0xc5411
cmpb $0x0, 0x14(%r14)
je 0xc5411
movq %rbx, %rdi
movl $0x1, %esi
callq 0xe9585
cmpq $0x0, 0x28(%r14)
jle 0xc53ff
movl $0xc, %ebp
xorl %r13d, %r13d
movq 0x20(%r14), %rbx
leaq (%rbx,%rbp), %rax
addq $0xc, %rax
cmpq 0x80(%r14), %rax
jg 0xc53ff
leaq (%rbx,%rbp), %r12
addq $-0xc, %r12
movq 0x10(%rsp), %r15
movq %r15, %rdi
leaq 0x757ca(%rip), %rsi     # 0x13aa41
movq %r13, 0x18(%rsp)
movl %r13d, %edx
movl %r12d, %ecx
xorl %eax, %eax
callq 0xe9226
movq %r15, %rdi
movl $0x1, %esi
callq 0xe9585
movq (%r14), %rax
movq 0x18(%rax), %rdi
movl 0x10(%r14), %edx
movq %r12, %rsi
callq 0xef570
movq %rax, %r12
leaq (%rbx,%rbp), %rsi
addq $-0xa, %rsi
movq (%r14), %rax
movq 0x18(%rax), %rdi
movl 0x10(%r14), %edx
callq 0xef570
movq %rax, %r13
leaq (%rbx,%rbp), %rsi
addq $-0x8, %rsi
movq (%r14), %rax
movq 0x18(%rax), %rdi
movl 0x10(%r14), %edx
callq 0xef570
movl $0xffff, %ecx           # imm = 0xFFFF
cmpq %rcx, %r12
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
cmovel %edx, %r12d
cmpq %rcx, %r13
cmovel %edx, %r13d
cmpq %rcx, %rax
cmovel %edx, %eax
movq %r15, %rdi
leaq 0x7574b(%rip), %rsi     # 0x13aa52
movl %r12d, %edx
movl %r13d, %ecx
movl %eax, %r8d
xorl %eax, %eax
callq 0xe9226
leaq (%rbx,%rbp), %rsi
addq $-0x6, %rsi
movq (%r14), %rax
movq 0x18(%rax), %rdi
movl 0x10(%r14), %edx
callq 0xef570
leal -0x14(%rax), %ecx
leaq 0x66b30(%rip), %r8      # 0x12be69
cmpb $0xd, %cl
ja 0xc534f
movzbl %cl, %ecx
leaq 0x75b88(%rip), %rdx     # 0x13aed0
movslq (%rdx,%rcx,4), %r8
addq %rdx, %r8
movq 0x18(%rsp), %r13
incq %r13
movzbl %al, %ecx
movq 0x10(%rsp), %r14
movq %r14, %rdi
leaq 0x7571b(%rip), %rsi     # 0x13aa84
movl %eax, %edx
xorl %eax, %eax
callq 0xe9226
leaq (%rbx,%rbp), %rsi
movq 0x28(%rsp), %r15
movq (%r15), %rax
movq 0x18(%rax), %rdi
movl 0x10(%r15), %edx
callq 0xef614
movq %r14, %rdi
leaq 0x75705(%rip), %rsi     # 0x13aa9a
movl %eax, %edx
movl %eax, %ecx
xorl %eax, %eax
callq 0xe9226
leaq (%rbx,%rbp), %rsi
addq $0x8, %rsi
movq (%r15), %rax
movq 0x18(%rax), %rdi
movl 0x10(%r15), %edx
callq 0xef570
movq %rax, %r12
leaq (%rbx,%rbp), %rsi
addq $0xa, %rsi
movq (%r15), %rax
movq 0x18(%rax), %rdi
movl 0x10(%r15), %edx
callq 0xef570
movq %r14, %rdi
movq %r12, %rsi
movq %rax, %rdx
callq 0xe9b05
movq %r14, %rdi
movq %r15, %r14
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0xe9585
addq $0x18, %rbp
cmpq 0x28(%r15), %r13
jl 0xc5247
movq 0x10(%rsp), %rbx
movq %rbx, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0xe9585
cmpq $0x0, 0x50(%r14)
jle 0xc5649
movq 0x48(%r14), %rdx
leaq 0x75735(%rip), %rsi     # 0x13ab5c
movq %rbx, %rdi
xorl %eax, %eax
callq 0xe9226
movq 0x48(%r14), %rdx
movq 0x50(%r14), %rcx
leaq (%rcx,%rcx), %rax
shlq $0x4, %rcx
subq %rax, %rcx
leaq 0x75720(%rip), %r8      # 0x13ab6b
movq %rbx, %rdi
movq %r14, %rsi
callq 0xc5f71
testl %eax, %eax
je 0xc5649
movq %rbx, %rdi
movl $0x1, %esi
callq 0xe9585
cmpq $0x0, 0x50(%r14)
jle 0xc5637
movl $0xc, %ebx
xorl %r13d, %r13d
movq 0x10(%rsp), %r12
movq 0x48(%r14), %rbp
leaq (%rbx,%rbp), %rax
addq $0x2, %rax
cmpq 0x80(%r14), %rax
jg 0xc5637
movq %r13, 0x20(%rsp)
leaq (%rbx,%rbp), %rax
movq %rax, 0x38(%rsp)
leaq (%rbx,%rbp), %r15
addq $-0xc, %r15
movq %r12, %rdi
leaq 0x756bc(%rip), %rsi     # 0x13ab78
movq %r15, %rdx
xorl %eax, %eax
callq 0xe9226
movq %r12, %rdi
movl $0x1, %esi
callq 0xe9585
movq (%r14), %rax
movq 0x18(%rax), %rdi
movl 0x10(%r14), %edx
movq %r15, %rsi
callq 0xef614
movq %rax, 0x18(%rsp)
movq %r12, %rdi
leaq 0x75691(%rip), %rsi     # 0x13ab86
movq %rax, %rdx
xorl %eax, %eax
callq 0xe9226
leaq (%rbx,%rbp), %rsi
addq $-0x8, %rsi
movq (%r14), %rax
movq 0x18(%rax), %rdi
movl 0x10(%r14), %edx
callq 0xef570
movq %rax, %r13
leaq (,%rax,8), %r15
movq %r12, %rdi
leaq 0x7566a(%rip), %rsi     # 0x13ab96
movl %r13d, %edx
xorl %eax, %eax
callq 0xe9226
leaq (%rbx,%rbp), %rsi
addq $-0x6, %rsi
movq (%r14), %rax
movq 0x18(%rax), %rdi
movl 0x10(%r14), %edx
callq 0xef570
movq %rax, %rbp
movq %r12, %rdi
movq %r15, 0x40(%rsp)
movq %r15, %rsi
movq %rax, %rdx
callq 0xe9b05
movq (%r14), %rax
movq 0x18(%rax), %rdi
movl 0x10(%r14), %edx
movq 0x38(%rsp), %rsi
callq 0xef570
movq %r12, %rdi
leaq 0x75626(%rip), %rsi     # 0x13aba9
movl %eax, %edx
xorl %eax, %eax
callq 0xe9226
movq %rbp, %rcx
imulq %r13, %rcx
movq %r12, %rdi
movq %r14, %rsi
movq 0x18(%rsp), %rdx
leaq 0x522d7(%rip), %r8      # 0x11787c
callq 0xc5f71
testl %eax, %eax
je 0xc5604
movq %r12, %rdi
movq 0x40(%rsp), %r14
movq %r14, %rsi
movq %rbp, %rdx
callq 0xf241d
testl %eax, %eax
je 0xc5604
movq %r12, %rdi
movq %r14, %rsi
movq %rbp, %rdx
movl $0x1, %ecx
callq 0xf2cab
movq %rax, %r15
movq 0x28(%rsp), %r14
movq %r14, %rdi
movq %rax, %rsi
movq 0x18(%rsp), %rdx
movq %r13, %rcx
callq 0xc6007
movq %r15, %rdi
xorl %esi, %esi
movl $0x8, %edx
callq 0xf2923
jmp 0xc560c
xorl %r15d, %r15d
movq 0x28(%rsp), %r14
movq 0x20(%rsp), %r13
incq %r13
movq %r15, %rdi
callq 0xf28d4
movq %r12, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0xe9585
addq $0xe, %rbx
cmpq 0x50(%r14), %r13
jl 0xc5483
movq 0x10(%rsp), %rbx
movq %rbx, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0xe9585
cmpq $0x0, 0x40(%r14)
jle 0xc580b
movq 0x38(%r14), %rdx
leaq 0x75563(%rip), %rsi     # 0x13abc2
movq %rbx, %rdi
xorl %eax, %eax
callq 0xe9226
movq 0x38(%r14), %rdx
movq 0x40(%r14), %rax
movq %rax, %rcx
shlq $0x5, %rcx
leaq (%rcx,%rax,2), %rcx
leaq 0x7554f(%rip), %r8      # 0x13abd2
movq %rbx, %rdi
movq %r14, %rsi
callq 0xc5f71
testl %eax, %eax
je 0xc580b
movq %rbx, %rdi
movl $0x1, %esi
callq 0xe9585
cmpq $0x0, 0x40(%r14)
jle 0xc57f9
xorl %ebx, %ebx
xorl %r12d, %r12d
movq 0x38(%r14), %r15
leaq (%rbx,%r15), %rax
addq $0x22, %rax
cmpq 0x80(%r14), %rax
jg 0xc57f9
leaq (%rbx,%r15), %rbp
movq %r14, %r13
movq 0x10(%rsp), %r14
movq %r14, %rdi
leaq 0x50(%rsp), %rsi
callq 0xe958c
movl $0x28, %esi
movq %r14, %rdi
callq 0xe969b
movq %r12, 0x20(%rsp)
movq %rax, %r12
movq %r14, %rdi
leaq 0x754dc(%rip), %rsi     # 0x13abe0
movq %rbp, %rdx
xorl %eax, %eax
callq 0xe9226
movq %r14, %rdi
movl $0x1, %esi
callq 0xe9585
movq %r14, %rdi
movq %r13, %rsi
movq %rbp, %rdx
movq %r12, 0x18(%rsp)
movq %r12, %rcx
callq 0xc60fd
testl %eax, %eax
je 0xc57c7
movq (%r13), %rax
movq 0x18(%rax), %rdi
movl 0x10(%r13), %edx
movq %rbp, %rsi
callq 0xef614
movq %rax, %rbp
leaq (%rbx,%r15), %rsi
addq $0x4, %rsi
movq (%r13), %rax
movq 0x18(%rax), %rdi
movl 0x10(%r13), %edx
callq 0xef614
movq %rax, %r15
movq %r14, %rdi
leaq 0x75479(%rip), %rsi     # 0x13abef
movq %rax, %rdx
xorl %eax, %eax
callq 0xe9226
movq %r14, %rdi
leaq 0x74e3f(%rip), %rsi     # 0x13a5c9
movq %rbp, %rdx
xorl %eax, %eax
callq 0xe9226
movq 0x18(%rsp), %rdx
movq (%rdx), %rax
leaq 0xf(%rax), %rcx
addq $0x1e, %rax
testq %rcx, %rcx
cmovnsq %rcx, %rax
sarq $0x4, %rax
addq %rax, %rax
movq %rax, 0x10(%rdx)
movq %r14, %rdi
movq %r13, %rsi
movq %r15, %rcx
movq %rbp, %r8
callq 0xc619a
movq 0x20(%rsp), %r12
incq %r12
movq %r14, %rdi
movq 0x18(%rsp), %rsi
callq 0xc62dc
movl 0x50(%rsp), %esi
movq %r14, %rdi
callq 0xe9595
addq $0x22, %rbx
cmpq 0x40(%r13), %r12
movq %r13, %r14
jl 0xc56b3
movq 0x10(%rsp), %rbx
movq %rbx, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0xe9585
testb $0x4, 0x18(%r14)
je 0xc5f10
leaq 0x48(%rsp), %rsi
movq %rbx, %rdi
callq 0xe958c
movq 0x70(%r14), %rdx
leaq 0x753ed(%rip), %r8      # 0x13ac1b
movl $0x1, %ecx
movq %rbx, %rdi
movq %r14, %rsi
callq 0xc5f71
testl %eax, %eax
je 0xc5f04
movq 0x70(%r14), %r13
leaq 0x753d8(%rip), %rsi     # 0x13ac29
xorl %ebp, %ebp
movq %rbx, %rdi
movq %r13, %rdx
xorl %eax, %eax
callq 0xe9226
movq %rbx, %rdi
movl $0x1, %esi
callq 0xe9585
leaq 0x50(%rsp), %rsi
movq %rbx, %rdi
callq 0xe958c
leaq 0x753c2(%rip), %rsi     # 0x13ac43
movq %rbx, %rdi
movq %r13, %rdx
xorl %eax, %eax
callq 0xe9226
movq %rbx, %rdi
movl $0x1, %esi
callq 0xe9585
movb $0x1, %r15b
cmpq %r13, 0x80(%r14)
jle 0xc5a19
movl $0x4, %ebp
leaq 0x753aa(%rip), %rbx     # 0x13ac61
xorl %r15d, %r15d
leaq -0x4(,%rbp), %rsi
addq %r13, %rsi
movq (%r14), %rax
movq 0x18(%rax), %rdi
movl 0x10(%r14), %edx
callq 0xef614
movq %r13, %r12
movq %rax, %r13
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
cmpq %rax, %r13
movq $-0x1, %rax
cmoveq %rax, %r13
movq 0x10(%rsp), %rdi
movq %rbx, %rsi
movl %r15d, %edx
movq %r13, %rcx
xorl %eax, %eax
callq 0xe9461
testq %r13, %r13
js 0xc59f3
incq %r15
leaq (%r12,%rbp), %rax
addq $0x4, %rax
addq $0x4, %rbp
addq $-0x4, %rax
cmpq 0x80(%r14), %rax
movq %r12, %r13
jl 0xc58ba
xorl %ebp, %ebp
movq 0x10(%rsp), %rbx
movb $0x1, %r15b
jmp 0xc5a19
movq 0x18(%rbx), %rdi
movl $0x22, %esi
callq 0xef1ca
movq %rax, %r15
movq 0x18(%rbx), %rdi
movl $0x22, %esi
callq 0xef169
cmpq %rax, %r15
jne 0xc59cf
movl $0x2, %r15d
movq 0x18(%rbx), %rdi
movq %r15, %rsi
callq 0xef1ca
testq %rax, %rax
je 0xc59bd
movq %rax, %r12
cmpq $0xffff, %rax           # imm = 0xFFFF
je 0xc59bd
movq 0x18(%rbx), %rdi
movq %r15, %rsi
callq 0xef169
movq 0x18(%rbx), %rcx
movq 0x18(%rcx), %rdx
cmpq %rdx, %r12
jg 0xc4e27
movl $0x2, %ecx
cmpq %rdx, %rax
jg 0xc4e2c
testb $0x1, %r12b
jne 0xc4e27
testb $0x1, %al
jne 0xc4e2c
leaq 0x2(%r15), %rax
cmpq $0x11, %r15
movq %rax, %r15
jb 0xc5964
jmp 0xc4e30
movq 0x18(%rbx), %rcx
movq 0x18(%rcx), %rdx
cmpq %rdx, %rax
je 0xc4e27
movl $0x2, %ecx
cmpq %rdx, %r15
je 0xc4e2c
jmp 0xc595e
movq %r15, 0x88(%r14)
leaq 0x7526e(%rip), %rsi     # 0x13ac6f
movq 0x10(%rsp), %rbx
movq %rbx, %rdi
movl %r15d, %edx
xorl %r15d, %r15d
xorl %eax, %eax
callq 0xe9226
movq %r12, %r13
movl 0x50(%rsp), %esi
movq %rbx, %rdi
callq 0xe9595
testb %r15b, %r15b
jne 0xc5f04
cmpq $0x0, 0x88(%r14)
jle 0xc5f04
addq %rbp, %r13
xorl %r15d, %r15d
cmpq 0x80(%r14), %r13
jge 0xc5f04
movq %rbx, %rdi
leaq 0x4c(%rsp), %rsi
callq 0xe958c
movq %rbx, %rdi
leaq 0x75220(%rip), %rsi     # 0x13ac86
movq %r15, 0x60(%rsp)
movl %r15d, %edx
movq %r13, %rcx
xorl %eax, %eax
callq 0xe9226
movq %rbx, %rdi
movl $0x1, %esi
callq 0xe9585
movl $0x28, %esi
movq %rbx, %rdi
callq 0xe969b
movq %rbx, %r12
movq %rax, %rbx
movq %r12, %rdi
movq %r14, %rsi
movq %r13, %rdx
movq %rax, %rcx
callq 0xc60fd
testl %eax, %eax
movq %rbx, 0x18(%rsp)
je 0xc5ebc
leaq 0x22(%r13), %rsi
movq (%r14), %rax
movq 0x18(%rax), %rdi
movl 0x10(%r14), %edx
callq 0xef614
movq %r12, %rdi
leaq 0x751c6(%rip), %rsi     # 0x13ac9a
movq %rax, 0x20(%rsp)
movl %eax, %edx
xorl %eax, %eax
callq 0xe9226
movq (%rbx), %rax
leaq 0xf(%rax), %rcx
addq $0x1e, %rax
testq %rcx, %rcx
cmovnsq %rcx, %rax
movq %r13, %r15
leaq 0x26(%r13), %rdx
sarq $0x4, %rax
addq %rax, %rax
movq %rax, 0x10(%rbx)
movq %r12, %rdi
leaq 0x751b3(%rip), %rsi     # 0x13acc3
movq %rdx, %r13
xorl %eax, %eax
callq 0xe93cf
movq 0x8(%rbx), %rax
imulq 0x10(%rbx), %rax
movq %r15, 0x30(%rsp)
leaq (%rax,%r15), %rcx
addq $0x26, %rcx
movq %rax, 0x10(%rsp)
movq %rcx, 0x38(%rsp)
leaq (%rcx,%rax), %r15
movq %r12, %rdi
leaq 0x751a0(%rip), %rsi     # 0x13ace8
movq %r15, %rdx
xorl %eax, %eax
callq 0xe93cf
cmpq $0x0, 0x20(%rbx)
jne 0xc5b65
movq %r12, %rdi
callq 0xf6870
movq %rax, 0x20(%rbx)
movq 0x20(%rbx), %rdi
callq 0xf6883
movq 0x18(%r12), %rdi
movq 0x20(%rbx), %rcx
movl 0x8(%r14), %r9d
movl $0xc, %edx
movq %r15, %rsi
movl $0x1, %r8d
callq 0xf01b0
movq 0x20(%rbx), %rdi
callq 0xf7557
movq %r12, %rdi
leaq 0x75166(%rip), %rsi     # 0x13ad07
movq %rax, %rdx
xorl %eax, %eax
callq 0xe9226
movq (%rbx), %rsi
movq 0x8(%rbx), %rdx
movq %r12, %rdi
callq 0xf241d
testl %eax, %eax
je 0xc5eb7
movq %r12, %rdi
leaq 0x7514b(%rip), %rsi     # 0x13ad17
movq %r13, %rdx
movq %r13, 0x28(%rsp)
xorl %eax, %eax
callq 0xe9226
movq %r12, %rdi
movl $0x1, %esi
callq 0xe9585
movq %r12, %rdi
leaq 0x74ffd(%rip), %rsi     # 0x13abef
movq %r13, %rdx
xorl %eax, %eax
callq 0xe9226
movq %r12, %rdi
leaq 0x749c3(%rip), %rsi     # 0x13a5c9
movq 0x38(%rsp), %r13
movq %r13, %rdx
xorl %eax, %eax
callq 0xe9226
movq %r12, %rdi
movq %r14, %rsi
movq %rbx, %rdx
movq 0x28(%rsp), %rcx
movq %r13, %r8
callq 0xc619a
movq %r12, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0xe9585
cmpq $0x0, 0x20(%rsp)
movq %r12, %rbx
jle 0xc5efa
addq $0xc, %r15
movq 0x18(%rbx), %rax
cmpq 0x18(%rax), %r15
movq 0x30(%rsp), %r13
movb $0x1, %r12b
jge 0xc5ec2
xorl %edx, %edx
incq %rdx
movq %rbx, %rdi
leaq 0x750c1(%rip), %rsi     # 0x13ad31
movq %rdx, 0x38(%rsp)
movq 0x20(%rsp), %rcx
movq %r15, %r8
xorl %eax, %eax
callq 0xe9226
movq %rbx, %rdi
movl $0x1, %esi
callq 0xe9585
movq (%r14), %rax
movq 0x18(%rax), %rdi
movl 0x10(%r14), %edx
movq %r15, %rsi
callq 0xef570
movq 0x18(%rsp), %rbp
movq %rax, 0x18(%rbp)
movq %rbx, %rdi
leaq 0x75440(%rip), %rsi     # 0x13b0f7
movl %eax, %edx
xorl %eax, %eax
callq 0xe9226
leaq 0xa(%r15), %rsi
movq (%r14), %rax
movq 0x18(%rax), %rdi
movl 0x10(%r14), %edx
callq 0xef614
movq %rax, 0x28(%rsp)
movq %rbx, %rdi
leaq 0x7506b(%rip), %rsi     # 0x13ad4e
movl %eax, %edx
xorl %eax, %eax
callq 0xe9226
leaq 0x12(%r15), %rsi
movq (%r14), %rax
movq 0x18(%rax), %rdi
movl 0x10(%r14), %edx
callq 0xef614
movq %rbx, %rdi
leaq 0x75056(%rip), %rsi     # 0x13ad60
movl %eax, %edx
xorl %eax, %eax
callq 0xe9226
leaq 0x16(%r15), %r12
movq 0x18(%rbp), %r13
imulq 0x10(%rsp), %r13
movq %rbx, %rdi
leaq 0x75047(%rip), %rsi     # 0x13ad72
movq %r12, %rdx
movq %r12, 0x40(%rsp)
xorl %eax, %eax
callq 0xe9226
movq %rbx, %rdi
movl $0x1, %esi
callq 0xe9585
movq %rbx, %rdi
leaq 0x74e9e(%rip), %rsi     # 0x13abef
movq %r12, %rdx
xorl %eax, %eax
callq 0xe9226
addq %r13, %r15
addq $0x16, %r15
movq %rbx, %rdi
leaq 0x7485d(%rip), %rsi     # 0x13a5c9
movq %r15, %rdx
xorl %eax, %eax
callq 0xe9226
movq %rbp, %r12
movl 0x18(%rbp), %ecx
movl $0x10, %esi
leaq 0x50(%rsp), %rbp
movq %rbp, %rdi
leaq 0x70149(%rip), %rdx     # 0x135ed9
xorl %eax, %eax
callq 0xe8d67
movl $0x0, (%rsp)
movq %rbx, %rdi
movq %r14, %rsi
movq %r12, %rdx
movq 0x40(%rsp), %rcx
movq %rbp, %r12
movq %r15, %r8
movq %rbp, %r9
callq 0xc6391
addq 0x10(%rsp), %r15
movq %rbx, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0xe9585
cmpq $0x0, 0x28(%rsp)
je 0xc5e7c
movq %rbx, %rdi
leaq 0x74f92(%rip), %rsi     # 0x13ad74
movq %r15, %rdx
xorl %eax, %eax
callq 0xe9226
movq %rbx, %rdi
movl $0x1, %esi
callq 0xe9585
movq %rbx, %rdi
leaq 0x74dec(%rip), %rsi     # 0x13abef
movq %r15, %rdx
xorl %eax, %eax
callq 0xe9226
addq %r15, %r13
movq %rbx, %rdi
leaq 0x747af(%rip), %rsi     # 0x13a5c9
movq %r13, %rdx
xorl %eax, %eax
callq 0xe9226
movq %r15, %rbp
movq 0x18(%rsp), %r15
movl 0x18(%r15), %ecx
movl $0x10, %esi
movq %r12, %rdi
leaq 0x74f4b(%rip), %rdx     # 0x13ad8a
xorl %eax, %eax
callq 0xe8d67
movl $0x1, (%rsp)
movq %rbx, %rdi
movq %r14, %rsi
movq %r15, %rdx
movq %rbp, %rcx
movq %r12, %r9
movq 0x10(%rsp), %r12
movq %r13, %r8
callq 0xc6391
addq %r12, %r13
movq %rbx, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0xe9585
movq %r13, %r15
movq 0x30(%rsp), %r13
movq %rbx, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0xe9585
movq 0x38(%rsp), %rdx
cmpq %rdx, 0x20(%rsp)
setne %r12b
je 0xc5eaf
movq 0x18(%rbx), %rax
cmpq 0x18(%rax), %r15
jl 0xc5c63
movb $0x1, %r12b
subq %r13, %r15
movq %r15, %rbp
jmp 0xc5ec2
movq 0x30(%rsp), %r13
movq %r12, %rbx
movb $0x1, %r12b
movq %rbx, %rdi
movq 0x18(%rsp), %rsi
callq 0xc62dc
movl 0x4c(%rsp), %esi
movq %rbx, %rdi
callq 0xe9595
testb %r12b, %r12b
movq 0x60(%rsp), %r15
jne 0xc5f04
addq %rbp, %r13
incq %r15
cmpq 0x88(%r14), %r15
jl 0xc5a42
jmp 0xc5f04
xorl %r12d, %r12d
movq 0x30(%rsp), %r13
jmp 0xc5ec2
movl 0x48(%rsp), %esi
movq %rbx, %rdi
callq 0xe9595
movq %rbx, %rdi
movq %r14, %rsi
callq 0xe9752
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq