// File: /workspace/github_c_makefile_star2_O2/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 0xdecaf
movq %rax, %r13
movq %rbx, (%rax)
movq 0x18(%rbx), %rax
movq 0x18(%rax), %rax
movq %rax, 0x80(%r13)
andl $0x0, 0xc(%r13)
leaq 0x713cd(%rip), %rsi     # 0x12d980
movq %rbx, %rdi
callq 0xdfa87
pushq $0x1
popq %rbp
testq %rax, %rax
je 0xbc5ef
cmpb $0x70, (%rax)
jne 0xbc5d8
cmpb $0x63, 0x1(%rax)
jne 0xbc5d8
cmpb $0x0, 0x2(%rax)
je 0xbc6ba
leaq 0x713a9(%rip), %rsi     # 0x12d988
movq %rax, %rdi
callq 0x181a0
testl %eax, %eax
je 0xbc6f7
movl 0xc(%r13), %ecx
testl %ecx, %ecx
jne 0xbc60d
movq 0x18(%rbx), %rdi
xorl %esi, %esi
callq 0xe3f46
movl %ebp, %ecx
testq %rax, %rax
je 0xbc632
movl %ecx, 0xc(%r13)
cmpl $0x2, %ecx
jne 0xbc6ff
leaq 0x71371(%rip), %rsi     # 0x12d98e
movq %rbx, %rdi
callq 0xe07f7
movl $0x1, 0x10(%r13)
jmp 0xbc70e
movq 0x18(%rbx), %rdi
pushq $0x22
popq %r15
movq %r15, %rsi
callq 0xe3fa3
movq %rax, %r14
movq 0x18(%rbx), %rdi
movq %r15, %rsi
callq 0xe3f46
pushq $0x2
popq %r12
cmpq %rax, %r14
jne 0xbc6c7
pushq $0x2
popq %r15
cmpq $0x12, %r15
ja 0xbc6eb
movq 0x18(%rbx), %rdi
movq %r15, %rsi
callq 0xe3fa3
testq %rax, %rax
je 0xbc6b4
movq %rax, %r14
cmpq $0xffff, %rax           # imm = 0xFFFF
je 0xbc6b4
movq 0x18(%rbx), %rdi
movq %r15, %rsi
callq 0xe3f46
movq 0x18(%rbx), %rcx
movq 0x18(%rcx), %rcx
cmpq %rcx, %r14
jg 0xbd4c7
cmpq %rcx, %rax
jg 0xbc6e3
testb $0x1, %r14b
jne 0xbd4c7
testb $0x1, %al
jne 0xbc6e3
addq $0x2, %r15
jmp 0xbc65e
movl $0x2, 0xc(%r13)
jmp 0xbc616
movq 0x18(%rbx), %rcx
movq 0x18(%rcx), %rdx
movl %ebp, %ecx
cmpq %rdx, %rax
je 0xbc609
cmpq %rdx, %r14
jne 0xbc65a
movl %r12d, %ecx
jmp 0xbc609
movl 0xc(%r13), %ecx
testl %ecx, %ecx
jne 0xbc60d
movl $0x1, 0xc(%r13)
leaq 0x71294(%rip), %rsi     # 0x12d99a
movq %rbx, %rdi
callq 0xe07f7
movq %rbx, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0xe08d2
movl %eax, 0x8(%r13)
testl %eax, %eax
jne 0xbc731
cmpl $0x1, 0xc(%r13)
pushq $0x12
popq %rax
cmovel %eax, %ebp
movl %ebp, 0x8(%r13)
movw $0x101, 0x14(%r13)      # imm = 0x101
leaq 0x6fcaf(%rip), %rsi     # 0x12c3ee
movq %rbx, %rdi
xorl %edx, %edx
xorl %eax, %eax
callq 0xde896
pushq $0x1
popq %rsi
movq %rbx, %rdi
callq 0xdeba7
movq %r13, %rdi
xorl %esi, %esi
callq 0xbd515
movq %rax, 0x18(%r13)
leaq 0x6b9ae(%rip), %rsi     # 0x128119
movq %rbx, %rdi
movl %eax, %edx
xorl %eax, %eax
callq 0xde896
pushq $0x2
popq %rsi
movq %r13, %rdi
callq 0xbd515
movq %rax, 0x20(%r13)
pushq $0x6
popq %rsi
movq %r13, %rdi
callq 0xbd515
movq %rax, 0x38(%r13)
pushq $0x8
popq %rsi
movq %r13, %rdi
callq 0xbd515
movq %rax, 0x48(%r13)
pushq $0xe
popq %rsi
movq %r13, %rdi
callq 0xbd515
movq %rax, 0x58(%r13)
pushq $0x10
popq %rsi
movq %r13, %rdi
callq 0xbd515
movq %rax, 0x60(%r13)
pushq $0x14
popq %rsi
movq %r13, %rdi
callq 0xbd515
movq %rax, 0x28(%r13)
pushq $0x16
popq %rsi
movq %r13, %rdi
callq 0xbd515
movq %rax, 0x30(%r13)
pushq $0x1a
popq %rsi
movq %r13, %rdi
callq 0xbd515
movq %rax, 0x40(%r13)
pushq $0x1c
popq %rsi
movq %r13, %rdi
callq 0xbd515
movq %rax, 0x50(%r13)
pushq $0x22
popq %rsi
movq %r13, %rdi
callq 0xbd515
movq %rax, 0x68(%r13)
movl 0x20(%r13), %ecx
movl 0x28(%r13), %edx
leaq 0x7118d(%rip), %rsi     # 0x12d9a9
movq %rbx, %rdi
xorl %eax, %eax
callq 0xde896
movl 0x30(%r13), %edx
leaq 0x71189(%rip), %rsi     # 0x12d9ba
movq %rbx, %rdi
xorl %eax, %eax
callq 0xde896
movl 0x38(%r13), %ecx
movl 0x40(%r13), %edx
leaq 0x71185(%rip), %rsi     # 0x12d9cf
movq %rbx, %rdi
xorl %eax, %eax
callq 0xde896
movl 0x48(%r13), %ecx
movl 0x50(%r13), %edx
leaq 0x7117e(%rip), %rsi     # 0x12d9e1
movq %rbx, %rdi
xorl %eax, %eax
callq 0xde896
movl 0x58(%r13), %edx
leaq 0x7117a(%rip), %rsi     # 0x12d9f2
movq %rbx, %rdi
xorl %eax, %eax
callq 0xde896
movl 0x60(%r13), %edx
leaq 0x71176(%rip), %rsi     # 0x12da03
movq %rbx, %rdi
xorl %eax, %eax
callq 0xde896
testb $0x4, 0x18(%r13)
movq 0x68(%r13), %rdx
jne 0xbc8d1
leaq 0x51e60(%rip), %rsi     # 0x10e709
movq %rbx, %rdi
xorl %eax, %eax
callq 0xde896
movq 0x68(%r13), %rdi
movq %rdi, 0x78(%r13)
movq 0x18(%rbx), %rax
movq 0x18(%rax), %rsi
callq 0xdfb45
movq %rax, 0x80(%r13)
jmp 0xbc8e2
leaq 0x71144(%rip), %rsi     # 0x12da1c
movq %rbx, %rdi
xorl %eax, %eax
callq 0xde896
pushq $-0x1
popq %rsi
movq %rbx, %rdi
callq 0xdeba7
movq 0x18(%r13), %rax
testb $0x4, %al
jne 0xbc915
cmpq $0x2, %rax
jb 0xbc9c7
leaq 0x71132(%rip), %rsi     # 0x12da38
movq %rbx, %rdi
xorl %eax, %eax
callq 0xdf2a5
jmp 0xbd4ad
movq 0x68(%r13), %r15
leaq 0x7113e(%rip), %rsi     # 0x12da5e
movq %rbx, %rdi
movq %r15, %rdx
xorl %eax, %eax
callq 0xde896
pushq $0x1
popq %rsi
movq %rbx, %rdi
callq 0xdeba7
movq 0x68(%r13), %rdx
leaq 0x71132(%rip), %r8      # 0x12da75
pushq $0x8
popq %rcx
movq %rbx, %rdi
movq %r13, %rsi
callq 0xbd527
testl %eax, %eax
je 0xbc9bc
movq %r13, %rdi
movq %r15, %rsi
callq 0xbd5bd
movq %rax, 0x78(%r13)
leaq 0x51d9e(%rip), %rsi     # 0x10e709
movq %rbx, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0xde896
movq 0x78(%r13), %rdi
movq 0x18(%rbx), %rax
movq 0x18(%rax), %rsi
callq 0xdfb45
movq %rax, 0x80(%r13)
addq $0x4, %r15
movq %r13, %rdi
movq %r15, %rsi
callq 0xbd5cf
movq %rax, 0x70(%r13)
testq %rax, %rax
je 0xbc9bc
leaq 0x710d6(%rip), %rsi     # 0x12da85
movq %rbx, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0xde896
pushq $-0x1
popq %rsi
movq %rbx, %rdi
callq 0xdeba7
cmpq $0x0, 0x28(%r13)
movq %r13, 0x8(%rsp)
jle 0xbcb7c
movq 0x20(%r13), %rdx
leaq 0x710eb(%rip), %rsi     # 0x12dacd
movq %rbx, %rdi
xorl %eax, %eax
callq 0xde896
movq 0x20(%r13), %rdx
imulq $0x18, 0x28(%r13), %rcx
leaq 0x710e0(%rip), %r8      # 0x12dadc
movq %rbx, %rdi
movq %r13, %rsi
callq 0xbd527
testl %eax, %eax
je 0xbcb7c
cmpb $0x0, 0x14(%r13)
je 0xbcb7c
pushq $0xc
popq %rbp
pushq $0x1
popq %rsi
xorl %r12d, %r12d
movq %rbx, %rdi
callq 0xdeba7
cmpq 0x28(%r13), %r12
jge 0xbcb71
movq 0x20(%r13), %r15
leaq (%r15,%rbp), %rax
addq $0xc, %rax
cmpq 0x80(%r13), %rax
jg 0xbcb71
leaq (%r15,%rbp), %r14
addq $-0xc, %r14
movq %rbx, %rdi
leaq 0x71089(%rip), %rsi     # 0x12dae9
movl %r12d, %edx
movl %r14d, %ecx
xorl %eax, %eax
callq 0xde896
movq %rbx, %rdi
pushq $0x1
popq %rsi
callq 0xdeba7
movq %r13, %rdi
movq %r14, %rsi
callq 0xbd5e6
movq %rax, %r14
leaq (%r15,%rbp), %rsi
addq $-0xa, %rsi
movq %r13, %rdi
callq 0xbd5e6
movq %rax, %r13
leaq (%r15,%rbp), %rsi
addq $-0x8, %rsi
movq 0x8(%rsp), %rdi
callq 0xbd5e6
movq %rbx, %rdi
leaq 0x71045(%rip), %rsi     # 0x12dafa
movl %r14d, %edx
movl %r13d, %ecx
movq 0x8(%rsp), %r13
movl %eax, %r8d
xorl %eax, %eax
callq 0xde896
leaq (%r15,%rbp), %rsi
addq $-0x6, %rsi
movq %r13, %rdi
callq 0xbd515
leal -0x14(%rax), %ecx
leaq 0x623fd(%rip), %r8      # 0x11eee1
cmpb $0xd, %cl
ja 0xbcafa
movzbl %cl, %ecx
leaq 0x7148d(%rip), %rdx     # 0x12df80
movslq (%rdx,%rcx,4), %r8
addq %rdx, %r8
movzbl %al, %ecx
movq %rbx, %rdi
leaq 0x71025(%rip), %rsi     # 0x12db2c
movl %eax, %edx
xorl %eax, %eax
callq 0xde896
leaq (%r15,%rbp), %rsi
movq %r13, %rdi
callq 0xbd5bd
movq %rbx, %rdi
leaq 0x7101c(%rip), %rsi     # 0x12db42
movl %eax, %edx
movl %eax, %ecx
xorl %eax, %eax
callq 0xde896
leaq (%r15,%rbp), %rsi
addq $0x8, %rsi
movq %r13, %rdi
callq 0xbd515
movq %rax, %r14
leaq (%r15,%rbp), %rsi
addq $0xa, %rsi
movq %r13, %rdi
callq 0xbd515
movq %rbx, %rdi
movq %r14, %rsi
movq %rax, %rdx
callq 0xdf038
addq $0x18, %rbp
incq %r12
pushq $-0x1
popq %rsi
jmp 0xbca23
pushq $-0x1
popq %rsi
movq %rbx, %rdi
callq 0xdeba7
cmpq $0x0, 0x50(%r13)
jle 0xbcd77
movq 0x48(%r13), %rdx
leaq 0x71072(%rip), %rsi     # 0x12dc04
movq %rbx, %rdi
xorl %eax, %eax
callq 0xde896
movq 0x48(%r13), %rdx
imulq $0xe, 0x50(%r13), %rcx
leaq 0x71067(%rip), %r8      # 0x12dc13
movq %rbx, %rdi
movq %r13, %rsi
callq 0xbd527
testl %eax, %eax
je 0xbcd77
pushq $0x1
popq %rsi
pushq $0xc
popq %r12
xorl %r14d, %r14d
movq %rbx, 0x38(%rsp)
movq %rbx, %rdi
callq 0xdeba7
movq 0x8(%rsp), %r13
cmpq 0x50(%r13), %r14
jge 0xbcd6c
movq 0x48(%r13), %rbp
leaq (%r12,%rbp), %rax
addq $0x2, %rax
cmpq 0x80(%r13), %rax
jg 0xbcd6c
movq %r14, 0x18(%rsp)
leaq (%r12,%rbp), %rax
movq %rax, 0x28(%rsp)
leaq (%r12,%rbp), %r14
addq $-0xc, %r14
movq %rbx, %rdi
leaq 0x71002(%rip), %rsi     # 0x12dc20
movq %r14, %rdx
xorl %eax, %eax
callq 0xde896
movq %rbx, %rdi
pushq $0x1
popq %rsi
callq 0xdeba7
movq %r13, %rdi
movq %r14, %rsi
callq 0xbd5bd
movq %rax, 0x20(%rsp)
movq %rbx, %rdi
leaq 0x70fe1(%rip), %rsi     # 0x12dc2e
movq %rax, %rdx
xorl %eax, %eax
callq 0xde896
leaq (%r12,%rbp), %rsi
addq $-0x8, %rsi
movq %r13, %rdi
callq 0xbd515
movq %rax, %r15
leaq (,%rax,8), %r14
movq %rbx, %rdi
leaq 0x70fc2(%rip), %rsi     # 0x12dc3e
movl %r15d, %edx
xorl %eax, %eax
callq 0xde896
movq %r12, 0x10(%rsp)
leaq (%r12,%rbp), %rsi
addq $-0x6, %rsi
movq %r13, %rdi
callq 0xbd515
movq %rax, %rbp
movq %rbx, %rdi
movq %r14, 0x30(%rsp)
movq %r14, %rsi
movq %rax, %rdx
callq 0xdf038
movq %r13, %rdi
movq 0x28(%rsp), %rsi
callq 0xbd515
movq %rbx, %rdi
leaq 0x70f89(%rip), %rsi     # 0x12dc51
movl %eax, %edx
xorl %eax, %eax
callq 0xde896
movq %rbp, %rcx
imulq %r15, %rcx
movq %rbx, %rdi
movq %r13, %rsi
movq 0x20(%rsp), %r13
movq %r13, %rdx
leaq 0x4dbd7(%rip), %r8      # 0x10a8c4
callq 0xbd527
testl %eax, %eax
je 0xbcd43
movq %rbx, %rdi
movq 0x30(%rsp), %r14
movq %r14, %rsi
movq %rbp, %rdx
callq 0xe6be1
testl %eax, %eax
je 0xbcd43
movq %rbx, %rdi
movq %r14, %rsi
movq %rbp, %rdx
pushq $0x1
popq %rcx
callq 0xe7437
movq %rax, %r14
movq 0x8(%rsp), %rdi
movq %rax, %rsi
movq %r13, %rdx
movq %r15, %rcx
callq 0xbd5fb
movq %r14, %rdi
xorl %esi, %esi
pushq $0x8
popq %rdx
callq 0xe70b7
jmp 0xbcd46
xorl %r14d, %r14d
movq 0x10(%rsp), %r12
movq %r14, %rdi
callq 0xe7084
addq $0xe, %r12
movq 0x18(%rsp), %r14
incq %r14
pushq $-0x1
popq %rsi
movq 0x38(%rsp), %rbx
jmp 0xbcbce
pushq $-0x1
popq %rsi
movq %rbx, %rdi
callq 0xdeba7
cmpq $0x0, 0x40(%r13)
jle 0xbceef
movq 0x38(%r13), %rdx
leaq 0x70edd(%rip), %rsi     # 0x12dc6a
movq %rbx, %rdi
xorl %eax, %eax
callq 0xde896
movq 0x38(%r13), %rdx
imulq $0x22, 0x40(%r13), %rcx
leaq 0x70ed3(%rip), %r8      # 0x12dc7a
movq %rbx, %rdi
movq %r13, %rsi
callq 0xbd527
testl %eax, %eax
je 0xbceef
pushq $0x1
popq %rsi
movq %rbx, %rdi
callq 0xdeba7
xorl %ebp, %ebp
xorl %ecx, %ecx
movq 0x8(%rsp), %r13
cmpq 0x40(%r13), %rcx
jge 0xbcee4
movq 0x38(%r13), %r12
leaq (%r12,%rbp), %rax
addq $0x22, %rax
cmpq 0x80(%r13), %rax
jg 0xbcee4
movq %rcx, 0x18(%rsp)
leaq (%r12,%rbp), %r14
movq %rbx, %rdi
leaq 0x50(%rsp), %rsi
callq 0xdebae
movq %rbx, %rdi
pushq $0x28
popq %rsi
callq 0xdecaf
movq %rax, %r15
movq %rbx, %rdi
leaq 0x70e69(%rip), %rsi     # 0x12dc88
movq %r14, %rdx
xorl %eax, %eax
callq 0xde896
movq %rbx, %rdi
pushq $0x1
popq %rsi
callq 0xdeba7
movq %rbx, %rdi
movq %r13, %rsi
movq %r14, %rdx
movq %r15, %rcx
callq 0xbd6c4
testl %eax, %eax
je 0xbcebc
movq %r13, %rdi
movq %r14, %rsi
callq 0xbd5bd
movq %rax, %r14
leaq (%r12,%rbp), %rsi
addq $0x4, %rsi
movq %r13, %rdi
callq 0xbd5bd
movq %rax, %r12
movq %rbx, %rdi
leaq 0x70e23(%rip), %rsi     # 0x12dc97
movq %rax, %rdx
xorl %eax, %eax
callq 0xde896
movq %rbx, %rdi
leaq 0x707d1(%rip), %rsi     # 0x12d659
movq %r14, %rdx
xorl %eax, %eax
callq 0xde896
movq (%r15), %rax
addq $0xf, %rax
cqto
pushq $0x10
popq %rcx
idivq %rcx
addq %rax, %rax
movq %rax, 0x10(%r15)
movq %rbx, %rdi
movq %r13, %rsi
movq %r15, %rdx
movq %r12, %rcx
movq %r14, %r8
callq 0xbd74d
movq %rbx, %rdi
movq %r15, %rsi
callq 0xbd887
movl 0x50(%rsp), %esi
movq %rbx, %rdi
callq 0xdebb7
addq $0x22, %rbp
movq 0x18(%rsp), %rcx
incq %rcx
jmp 0xbcdce
pushq $-0x1
popq %rsi
movq %rbx, %rdi
callq 0xdeba7
testb $0x4, 0x18(%r13)
je 0xbd4ad
leaq 0x40(%rsp), %rsi
movq %rbx, %rdi
callq 0xdebae
movq 0x70(%r13), %rdx
leaq 0x70db1(%rip), %r8      # 0x12dcc3
pushq $0x1
popq %rcx
movq %rbx, %rdi
movq %r13, %rsi
callq 0xbd527
testl %eax, %eax
je 0xbd4a1
movq 0x70(%r13), %r15
leaq 0x70d9e(%rip), %rsi     # 0x12dcd1
movq %rbx, %rdi
movq %r15, %rdx
xorl %eax, %eax
callq 0xde896
pushq $0x1
popq %rbp
movq %rbx, %rdi
movl %ebp, %esi
callq 0xdeba7
leaq 0x50(%rsp), %rsi
movq %rbx, %rdi
callq 0xdebae
leaq 0x70d8a(%rip), %rsi     # 0x12dceb
movq %rbx, %rdi
movq %r15, %rdx
xorl %eax, %eax
callq 0xde896
movq %rbx, %rdi
movl %ebp, %esi
callq 0xdeba7
pushq $0x4
popq %rax
xorl %r14d, %r14d
movq %r15, %r12
addq %rax, %r15
addq $-0x4, %r15
movq 0x80(%r13), %rbp
cmpq %rbp, %r15
jge 0xbcfd9
movq %rax, 0x10(%rsp)
movq %r13, %rdi
movq %r15, %rsi
callq 0xbd5cf
movq %rax, %r13
movq %rbx, %rdi
leaq 0x70d58(%rip), %rsi     # 0x12dd09
movl %r14d, %edx
movq %rax, %rcx
xorl %eax, %eax
callq 0xdea83
testq %r13, %r13
js 0xbcfe4
incq %r14
movq 0x10(%rsp), %rax
addq $0x4, %rax
movq 0x8(%rsp), %r13
movq %r12, %r15
jmp 0xbcf7e
movq $0x0, 0x10(%rsp)
jmp 0xbd004
movq 0x8(%rsp), %r13
movq %r14, 0x88(%r13)
leaq 0x70d20(%rip), %rsi     # 0x12dd17
movq %rbx, %rdi
movl %r14d, %edx
xorl %eax, %eax
callq 0xde896
movl 0x50(%rsp), %esi
movq %rbx, %rdi
callq 0xdebb7
cmpq %rbp, %r15
jge 0xbd4a1
movq %r12, %r15
addq 0x10(%rsp), %r15
pushq $0x1
popq %r12
xorl %r14d, %r14d
cmpq 0x88(%r13), %r14
jge 0xbd4a1
cmpq 0x80(%r13), %r15
jge 0xbd4a1
movq %rbx, %rdi
leaq 0x44(%rsp), %rsi
callq 0xdebae
movq %rbx, %rdi
leaq 0x70cd5(%rip), %rsi     # 0x12dd2e
movq %r14, 0x60(%rsp)
movl %r14d, %edx
movq %r15, %rcx
xorl %eax, %eax
callq 0xde896
movq %rbx, %rdi
movl %r12d, %esi
callq 0xdeba7
movq %rbx, %rdi
pushq $0x28
popq %rsi
callq 0xdecaf
movq %rax, %rbp
movq %rbx, %rdi
movq %r13, %rsi
movq %r15, %rdx
movq %rax, %rcx
callq 0xbd6c4
movb $0x1, %r14b
testl %eax, %eax
je 0xbd46e
leaq 0x22(%r15), %rsi
movq %r13, %rdi
callq 0xbd5bd
movq %rbx, %rdi
leaq 0x70c8c(%rip), %rsi     # 0x12dd42
movq %rax, 0x30(%rsp)
movl %eax, %edx
xorl %eax, %eax
callq 0xde896
leaq 0x26(%r15), %r8
movq (%rbp), %rax
addq $0xf, %rax
cqto
pushq $0x10
popq %rcx
idivq %rcx
addq %rax, %rax
movq %rax, 0x10(%rbp)
movq %rbx, %rdi
leaq 0x70c82(%rip), %rsi     # 0x12dd6b
movq %r8, 0x28(%rsp)
movq %r8, %rdx
xorl %eax, %eax
callq 0xde9f1
movq 0x8(%rbp), %rax
imulq 0x10(%rbp), %rax
movq %r15, 0x20(%rsp)
addq %rax, %r15
addq $0x26, %r15
movq %rax, 0x18(%rsp)
leaq (%r15,%rax), %r13
movq %rbx, %rdi
leaq 0x70c70(%rip), %rsi     # 0x12dd90
movq %r13, %rdx
xorl %eax, %eax
callq 0xde9f1
movq 0x20(%rbp), %rdi
testq %rdi, %rdi
jne 0xbd142
movq %rbx, %rdi
callq 0xeac74
movq %rax, %rdi
movq %rax, 0x20(%rbp)
callq 0xeac85
movq 0x18(%rbx), %rdi
movq 0x20(%rbp), %rcx
movq 0x8(%rsp), %rax
movl 0x8(%rax), %r9d
movq %r13, %rsi
pushq $0xc
popq %rdx
movl %r12d, %r8d
callq 0xe4c9a
movq 0x20(%rbp), %rdi
callq 0xeb877
movq %rbx, %rdi
leaq 0x70c36(%rip), %rsi     # 0x12ddaf
movq %rax, %rdx
xorl %eax, %eax
callq 0xde896
movq (%rbp), %rsi
movq 0x8(%rbp), %rdx
movq %rbx, %rdi
callq 0xe6be1
testl %eax, %eax
je 0xbd469
addq $0xc, %r13
movq %rbx, %rdi
leaq 0x70c16(%rip), %rsi     # 0x12ddbf
movq 0x28(%rsp), %r14
movq %r14, %rdx
xorl %eax, %eax
callq 0xde896
movq %rbx, %rdi
movl %r12d, %esi
callq 0xdeba7
movq %rbx, %rdi
leaq 0x70aca(%rip), %rsi     # 0x12dc97
movq %r14, %rdx
xorl %eax, %eax
callq 0xde896
movq %rbx, %rdi
leaq 0x70478(%rip), %rsi     # 0x12d659
movq %r15, %rdx
xorl %eax, %eax
callq 0xde896
movq %rbx, %rdi
movq 0x8(%rsp), %rsi
movq %rbp, %rdx
movq %r14, %rcx
movq %r15, %r8
callq 0xbd74d
movq %rbx, %rdi
pushq $-0x1
popq %rsi
callq 0xdeba7
movq 0x30(%rsp), %rax
testq %rax, %rax
movq %rax, %rcx
movl $0x0, %eax
cmovleq %rax, %rcx
movq %rcx, 0x38(%rsp)
xorl %ecx, %ecx
movq 0x20(%rsp), %r15
movq %rbp, 0x48(%rsp)
cmpq %rcx, 0x38(%rsp)
setne %r14b
je 0xbd46e
movq 0x18(%rbx), %rax
cmpq 0x18(%rax), %r13
jge 0xbd46e
movq %rcx, 0x28(%rsp)
leal 0x1(%rcx), %edx
movq %rbx, %rdi
leaq 0x70b79(%rip), %rsi     # 0x12ddd9
movq 0x30(%rsp), %rcx
movq %r13, %r8
xorl %eax, %eax
callq 0xde896
movq %rbx, %rdi
movl %r12d, %esi
callq 0xdeba7
movq 0x8(%rsp), %r14
movq %r14, %rdi
movq %r13, %rsi
callq 0xbd515
movq %rax, 0x18(%rbp)
movq %rbx, %rdi
leaq 0x70f27(%rip), %rsi     # 0x12e1bf
movl %eax, %edx
xorl %eax, %eax
callq 0xde896
leaq 0xa(%r13), %rsi
movq %r14, %rdi
callq 0xbd5bd
movq %rax, 0x10(%rsp)
movq %rbx, %rdi
leaq 0x70b3a(%rip), %rsi     # 0x12ddf6
movl %eax, %edx
xorl %eax, %eax
callq 0xde896
leaq 0x12(%r13), %rsi
movq %r14, %rdi
callq 0xbd5bd
movq %rbx, %rdi
leaq 0x70b2d(%rip), %rsi     # 0x12de08
movl %eax, %edx
xorl %eax, %eax
callq 0xde896
leaq 0x16(%r13), %r14
movq 0x18(%rbp), %r15
imulq 0x18(%rsp), %r15
movq %rbx, %rdi
leaq 0x70b1e(%rip), %rsi     # 0x12de1a
movq %r14, %rdx
xorl %eax, %eax
callq 0xde896
movq %rbx, %rdi
movl %r12d, %esi
callq 0xdeba7
movq %rbx, %rdi
leaq 0x7097c(%rip), %rsi     # 0x12dc97
movq %r14, %rdx
xorl %eax, %eax
callq 0xde896
addq %r15, %r13
addq $0x16, %r13
movq %rbx, %rdi
leaq 0x70323(%rip), %rsi     # 0x12d659
movq %r13, %rdx
xorl %eax, %eax
callq 0xde896
movl 0x18(%rbp), %ecx
leaq 0x50(%rsp), %r12
movq %r12, %rdi
pushq $0x10
popq %rsi
leaq 0x6bcc7(%rip), %rdx     # 0x12901c
xorl %eax, %eax
callq 0xde40c
andl $0x0, (%rsp)
movq %rbx, %rdi
movq 0x8(%rsp), %rsi
movq %rbp, %rdx
movq %r14, %rcx
movq %r13, %r8
movq %r12, %r9
callq 0xbd938
addq 0x18(%rsp), %r13
movq %rbx, %rdi
pushq $-0x1
popq %r14
movl %r14d, %esi
callq 0xdeba7
cmpq $0x0, 0x10(%rsp)
je 0xbd438
movq %rbx, %rdi
leaq 0x70a79(%rip), %rsi     # 0x12de1c
movq %r13, %rdx
xorl %eax, %eax
callq 0xde896
movq %rbx, %rdi
pushq $0x1
popq %rsi
callq 0xdeba7
movq %rbx, %rdi
leaq 0x708d5(%rip), %rsi     # 0x12dc97
movq %r13, %rdx
xorl %eax, %eax
callq 0xde896
addq %r13, %r15
movq %rbx, %rdi
leaq 0x70280(%rip), %rsi     # 0x12d659
movq %r15, %rdx
xorl %eax, %eax
callq 0xde896
movq 0x48(%rsp), %rbp
movl 0x18(%rbp), %ecx
movq %r12, %rdi
pushq $0x10
popq %rsi
leaq 0x70a3a(%rip), %rdx     # 0x12de32
xorl %eax, %eax
callq 0xde40c
movl $0x1, (%rsp)
movq %rbx, %rdi
movq 0x8(%rsp), %rsi
movq %rbp, %rdx
movq %r13, %rcx
movq %r15, %r8
movq %r12, %r9
callq 0xbd938
addq 0x18(%rsp), %r15
movq %rbx, %rdi
movl %r14d, %esi
callq 0xdeba7
movq %r15, %r13
pushq $0x1
popq %r12
jmp 0xbd441
pushq $0x1
popq %r12
movq 0x48(%rsp), %rbp
movq %r13, %rax
movq 0x20(%rsp), %r15
subq %r15, %rax
movq %rax, 0x10(%rsp)
movq %rbx, %rdi
movl %r14d, %esi
callq 0xdeba7
movq 0x28(%rsp), %rcx
incq %rcx
jmp 0xbd231
movq 0x20(%rsp), %r15
movq %rbx, %rdi
movq %rbp, %rsi
callq 0xbd887
movl 0x44(%rsp), %esi
movq %rbx, %rdi
callq 0xdebb7
testb %r14b, %r14b
movq 0x8(%rsp), %r13
movq 0x60(%rsp), %r14
jne 0xbd4a1
addq 0x10(%rsp), %r15
incq %r14
jmp 0xbd028
movl 0x40(%rsp), %esi
movq %rbx, %rdi
callq 0xdebb7
movq %rbx, %rdi
movq %r13, %rsi
callq 0xded32
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl %ebp, %ecx
jmp 0xbc609