// File: /workspace/github_c_makefile_star2_O2/jsummers[P]deark/modules/gif.c
// Function: de_run_gif
static void de_run_gif(deark *c, de_module_params *mparams)
{
	lctx *d = NULL;
	i64 pos;
	i64 bytesused = 0;
	u8 block_type;
	const char *blk_name;

	d = de_malloc(c, sizeof(lctx));
	d->compose = 1;
	d->fi = de_finfo_create(c);

	if(de_get_ext_option(c, "gif:raw")) {
		d->compose = 0;
		// TODO: It would be more consistent to extract an *image* of each
		// plain text extension, but we don't support that, so extract them
		// as text files instead.
		d->dump_plaintext_ext = 1;
	}
	if(de_get_ext_option(c, "gif:dumpplaintext")) {
		d->dump_plaintext_ext = 1;
	}
	if(de_get_ext_option(c, "gif:dumpscreen")) {
		// This lets the user see what the screen looks like after the last
		// "graphic rendering block" has been disposed of.
		d->dump_screen = 1;
	}

	pos = 0;
	if(!do_read_header(c, d, pos)) goto done;
	pos += 6;
	if(!do_read_screen_descriptor(c, d, pos)) goto done;
	pos += 7;
	if(!do_read_global_color_table(c, d, pos, &bytesused)) goto done;
	pos += bytesused;

	// If we're fully rendering the frames, create a "screen" image to
	// track the current state of the animation.
	if(d->compose) {
		if(!de_good_image_dimensions(c, d->screen_w, d->screen_h)) {
			// Try to continue. There could be other interesting things in the file.
			d->bad_screen_flag = 1;
			d->screen_w = 1;
			d->screen_h = 1;
		}
		d->screen_img = de_bitmap_create(c, d->screen_w, d->screen_h, 4);
	}

	while(1) {
		if(pos >= c->infile->len) {
			on_unexpected_eof(c, d);
			goto done;
		}
		block_type = de_getbyte(pos);

		switch(block_type) {
		case 0x2c: blk_name="image"; break;
		case 0x3b: blk_name="trailer"; break;
		case 0x21: blk_name="extension"; break;
		default: blk_name="?"; break;
		}

		de_dbg(c, "block type 0x%02x (%s) at %"I64_FMT, (UI)block_type, blk_name, pos);
		pos++;

		switch(block_type) {
		case 0x3b:
			goto found_trailer;
		case 0x21:
			if(!do_read_extension(c, d, pos, &bytesused)) goto done;
			pos += bytesused;
			break;
		case 0x2c:
			if(!do_image(c, d, pos, &bytesused)) goto done;
			pos += bytesused;
			break;
		default:
			de_err(c, "Unknown block type: 0x%02x", (unsigned int)block_type);
			goto done;
		}
	}

found_trailer:
	do_after_trailer(c, d, pos);

done:
	if(d) {
		if(d->screen_img) {
			if(d->dump_screen) {
				de_finfo_set_name_from_sz(c, d->fi, "screen", 0, DE_ENCODING_LATIN1);
				de_bitmap_write_to_file_finfo(d->screen_img, d->fi, DE_CREATEFLAG_OPT_IMAGE);
				de_finfo_set_name_from_sz(c, d->fi, NULL, 0, DE_ENCODING_LATIN1);
			}
			de_bitmap_destroy(d->screen_img);
		}
		discard_current_gce_data(c, d);
		de_finfo_destroy(c, d->fi);
		de_free(c, d);
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xe8, %rsp
movq %rdi, %rbx
movl $0x450, %esi            # imm = 0x450
callq 0xdecaf
movq %rax, %r14
movl $0x1, (%rax)
movq %rbx, %rdi
callq 0xdfd1a
movq %rax, 0x448(%r14)
leaq 0xc43ea(%rip), %rsi     # 0x112a5a
movq %rbx, %rdi
callq 0xdfa87
testq %rax, %rax
je 0x4e689
andl $0x0, (%r14)
movl $0x1, 0xc(%r14)
leaq 0xc43d2(%rip), %rsi     # 0x112a62
movq %rbx, %rdi
callq 0xdfa87
testq %rax, %rax
je 0x4e6a5
movl $0x1, 0xc(%r14)
leaq 0xc43c8(%rip), %rsi     # 0x112a74
movq %rbx, %rdi
callq 0xdfa87
testq %rax, %rax
je 0x4e6c1
movl $0x1, 0x8(%r14)
leaq 0xddd26(%rip), %rsi     # 0x12c3ee
movq %rbx, %rdi
xorl %edx, %edx
xorl %eax, %eax
callq 0xde896
movq %r14, %r15
pushq $0x1
popq %rbp
movq %rbx, %rdi
movl %ebp, %esi
callq 0xdeba7
movq %rbx, %rdi
callq 0xeac74
movq %rax, %r14
movq 0x18(%rbx), %rdi
pushq $0x3
popq %rdx
movq %rdx, %rsi
movq %rax, %rcx
xorl %r8d, %r8d
movl %ebp, %r9d
callq 0xe4c9a
movq %r14, %rdi
callq 0xeb7e4
leaq 0xd5a24(%rip), %rsi     # 0x12413a
movq %rbx, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0xde896
pushq $-0x1
popq %rsi
movq %rbx, %rdi
callq 0xdeba7
movq %r14, %rdi
callq 0xeaf3c
leaq 0xc437f(%rip), %rsi     # 0x112abc
pushq $0x6
popq %rdx
movq %rbx, %rdi
xorl %eax, %eax
callq 0xde896
movq %rbx, %rdi
movl %ebp, %esi
callq 0xdeba7
movq 0x18(%rbx), %rdi
pushq $0x6
popq %rsi
callq 0xe3fa3
movq %rax, 0x18(%r15)
movq 0x18(%rbx), %rdi
pushq $0x8
popq %rsi
callq 0xe3fa3
movq %rax, 0x20(%r15)
movl 0x18(%r15), %edx
leaq 0xb5795(%rip), %rsi     # 0x103f14
movq %rbx, %rdi
movl %eax, %ecx
xorl %eax, %eax
callq 0xde896
movq 0x18(%rbx), %rdi
pushq $0xa
popq %rsi
callq 0xe3eb4
movzbl %al, %r14d
leaq 0xc4332(%rip), %rsi     # 0x112ad4
movq %rbx, %rdi
movl %r14d, %edx
xorl %eax, %eax
callq 0xde896
movq %rbx, %rdi
movl %ebp, %esi
movq %r15, %r12
callq 0xdeba7
movl %r14d, %eax
shrb $0x7, %al
movzbl %al, %edx
movl %edx, 0x28(%r15)
leaq 0xc431a(%rip), %rsi     # 0x112aea
movq %rbx, %rdi
xorl %eax, %eax
callq 0xde896
movl %r14d, %edx
shrl $0x4, %edx
andl $0x7, %edx
leal 0x1(%rdx), %ecx
testl %edx, %edx
leaq 0xe9471(%rip), %rax     # 0x137c60
leaq 0xb950a(%rip), %r8      # 0x107d00
cmoveq %rax, %r8
leaq 0xc4305(%rip), %rsi     # 0x112b06
movq %rbx, %rdi
xorl %eax, %eax
callq 0xde896
cmpl $0x0, 0x28(%r15)
je 0x4e85c
movl %r14d, %edx
shrl $0x3, %edx
andl $0x1, %edx
leaq 0xc4304(%rip), %rsi     # 0x112b26
movq %rbx, %rdi
xorl %eax, %eax
callq 0xde896
cmpl $0x0, 0x28(%r12)
je 0x4e85c
andl $0x7, %r14d
leal 0x1(%r14), %edi
callq 0xdfba1
movq %rax, 0x30(%r12)
leaq 0xc42f7(%rip), %rsi     # 0x112b44
movq %rbx, %rdi
movl %r14d, %edx
movl %eax, %ecx
xorl %eax, %eax
callq 0xde896
pushq $-0x1
popq %rsi
movq %rbx, %rdi
callq 0xdeba7
movq 0x18(%rbx), %rdi
pushq $0xb
popq %rsi
callq 0xe3eb4
movzbl %al, %edx
leaq 0xc42ef(%rip), %rsi     # 0x112b6c
movq %rbx, %rdi
xorl %eax, %eax
callq 0xde896
movq 0x18(%rbx), %rdi
pushq $0xc
popq %rsi
callq 0xe3eb4
movzbl %al, %ebp
leaq 0xc42ea(%rip), %rsi     # 0x112b87
movq %rbx, %rdi
movl %ebp, %edx
xorl %eax, %eax
callq 0xde896
testb %bpl, %bpl
je 0x4e8e6
cmpl $0x31, %ebp
je 0x4e8e6
movq 0x448(%r15), %rax
movl $0x1, 0x78(%rax)
movabsq $0x4050000000000000, %rcx # imm = 0x4050000000000000
cvtsi2sd %ebp, %xmm0
movq %rcx, 0x80(%rax)
addsd 0xc4132(%rip), %xmm0    # 0x112a10
movsd %xmm0, 0x88(%rax)
pushq $-0x1
popq %rsi
movq %rbx, %rdi
callq 0xdeba7
movq %r15, %rbp
cmpl $0x0, 0x28(%r15)
je 0x4e949
leaq 0xc429b(%rip), %rsi     # 0x112b9d
pushq $0xd
popq %rdx
movq %rbx, %rdi
xorl %eax, %eax
callq 0xde896
pushq $0x1
popq %rsi
movq %rbx, %rdi
callq 0xdeba7
movq 0x30(%rbp), %rdx
movq %rbp, %rcx
addq $0x38, %rcx
pushq $0xd
popq %rsi
movq %rbx, %rdi
callq 0x4fd6b
pushq $-0x1
popq %rsi
movq %rbx, %rdi
callq 0xdeba7
movq 0x30(%rbp), %rax
leaq (%rax,%rax,2), %r13
addq $0xd, %r13
jmp 0x4e94d
pushq $0xd
popq %r13
cmpl $0x0, (%rbp)
je 0x4e998
movq 0x18(%rbp), %rsi
movq 0x20(%rbp), %rdx
movq %rbx, %rdi
callq 0xe6be1
testl %eax, %eax
je 0x4e971
movq 0x18(%rbp), %rsi
movq 0x20(%rbp), %rdx
jmp 0x4e986
pushq $0x1
popq %rdx
movl $0x1, 0x4(%rbp)
movq %rdx, 0x18(%rbp)
movq %rdx, 0x20(%rbp)
movq %rdx, %rsi
pushq $0x4
popq %rcx
movq %rbx, %rdi
callq 0xe7437
movq %rax, 0x438(%rbp)
pushq $-0x1
popq %r12
movq %rbp, 0x18(%rsp)
movq 0x18(%rbx), %rdi
cmpq 0x18(%rdi), %r13
jge 0x4fae0
movq %r13, %rsi
callq 0xe3eb4
movzbl %al, %ebp
cmpb $0x21, %bpl
je 0x4ec92
cmpl $0x2c, %ebp
jne 0x4faf0
movq %rbx, %rdi
leaq 0xc40ac(%rip), %rsi     # 0x112a83
movl %ebp, %edx
leaq 0xc9414(%rip), %rcx     # 0x117df4
movq %r13, %r8
xorl %eax, %eax
callq 0xde896
leaq 0x1(%r13), %r14
movq %rbx, %rdi
pushq $0x1
popq %r12
movl %r12d, %esi
callq 0xdeba7
movl $0x458, %esi            # imm = 0x458
movq %rbx, %rdi
callq 0xdecaf
movq %rax, %r15
movq %rbx, %rdi
leaq 0x54(%rsp), %rsi
callq 0xdebae
movq %r14, 0x28(%rsp)
andl $0x0, 0x38(%r15)
andq $0x0, 0x40(%r15)
movq %rbx, %rdi
leaq 0xc452a(%rip), %rsi     # 0x112f5d
movl %r14d, %edx
xorl %eax, %eax
callq 0xde896
movq %rbx, %rdi
movl %r12d, %esi
callq 0xdeba7
movq 0x18(%rbx), %rdi
movq %r14, 0x48(%rsp)
movq %r14, %rsi
callq 0xe3fa3
movq %rax, 0x8(%r15)
movq 0x18(%rbx), %rdi
leaq 0x3(%r13), %rsi
callq 0xe3fa3
movq %rax, 0x10(%r15)
movl 0x8(%r15), %edx
movq %rbx, %rdi
leaq 0xc44f8(%rip), %rsi     # 0x112f74
movl %eax, %ecx
xorl %eax, %eax
callq 0xde896
movq 0x18(%rbx), %rdi
leaq 0x5(%r13), %rsi
callq 0xe3fa3
movq %rax, 0x18(%r15)
movq 0x18(%rbx), %rdi
leaq 0x7(%r13), %rsi
callq 0xe3fa3
movq %rax, 0x20(%r15)
movl 0x18(%r15), %edx
movq %rbx, %rdi
leaq 0xc44d7(%rip), %rsi     # 0x112f8c
movl %eax, %ecx
xorl %eax, %eax
callq 0xde896
movq 0x18(%rbx), %rdi
leaq 0x9(%r13), %rsi
callq 0xe3eb4
movzbl %al, %r14d
movq %rbx, %rdi
leaq 0xc3ffb(%rip), %rsi     # 0x112ad4
movl %r14d, %edx
xorl %eax, %eax
callq 0xde896
movq %rbx, %rdi
movl %r12d, %esi
callq 0xdeba7
movl %r14d, %eax
shrb $0x7, %al
movzbl %al, %edx
movl %edx, 0x34(%r15)
movq %rbx, %rdi
leaq 0xc44a0(%rip), %rsi     # 0x112fa5
xorl %eax, %eax
callq 0xde896
movl %r14d, %edx
shrl $0x6, %edx
andl $0x1, %edx
movl %edx, 0x30(%r15)
movq %rbx, %rdi
leaq 0xc30f1(%rip), %rsi     # 0x111c14
xorl %eax, %eax
callq 0xde896
cmpl $0x0, 0x34(%r15)
je 0x4eb79
movl %r14d, %edx
shrl $0x3, %edx
andl $0x1, %edx
movq %rbx, %rdi
leaq 0xc447c(%rip), %rsi     # 0x112fc0
xorl %eax, %eax
callq 0xde896
cmpl $0x0, 0x34(%r15)
je 0x4eb79
andl $0x7, %r14d
leal 0x1(%r14), %edi
callq 0xdfba1
movq %rax, 0x48(%r15)
movq %rbx, %rdi
leaq 0xc4470(%rip), %rsi     # 0x112fdd
movl %r14d, %edx
movl %eax, %ecx
xorl %eax, %eax
callq 0xde896
movq %rbx, %rdi
pushq $-0x1
popq %r14
movl %r14d, %esi
callq 0xdeba7
movq %rbx, %rdi
movl %r14d, %esi
callq 0xdeba7
addq $0xa, %r13
movq %r13, 0x28(%rsp)
cmpl $0x0, 0x34(%r15)
movq 0x18(%rsp), %r12
pushq $0x2
popq %rbp
je 0x4ebf8
movq %rbx, %rdi
leaq 0xc4328(%rip), %rsi     # 0x112edd
movl %r13d, %edx
xorl %eax, %eax
callq 0xde896
movq %rbx, %rdi
pushq $0x1
popq %rsi
callq 0xdeba7
movq 0x48(%r15), %rdx
movq %r15, %rcx
addq $0x58, %rcx
movq %rbx, %rdi
movq %r13, %rsi
callq 0x4fd6b
movq %rbx, %rdi
movl %r14d, %esi
callq 0xdeba7
imulq $0x3, 0x48(%r15), %rax
addq %rax, %r13
movq %r13, 0x28(%rsp)
movq 0x18(%rbx), %rax
cmpq %r13, 0x18(%rax)
jle 0x4eee8
movq %rbx, %rdi
leaq 0xc42e5(%rip), %rsi     # 0x112ef5
movl %r13d, %edx
xorl %eax, %eax
callq 0xde896
movq %rbx, %rdi
pushq $0x1
popq %rsi
callq 0xdeba7
movq 0x18(%rbx), %rdi
leaq 0x1(%r13), %rax
movq %rax, 0x28(%rsp)
movq %r13, %rsi
callq 0xe3eb4
movzbl %al, %edx
movq %rbx, %rdi
leaq 0xc42bf(%rip), %rsi     # 0x112f06
movl %edx, 0x24(%rsp)
xorl %eax, %eax
callq 0xde896
movq 0x18(%r15), %rdx
movq 0x20(%r15), %rcx
testq %rdx, %rdx
sete %al
testq %rcx, %rcx
sete %sil
orb %al, %sil
movq %rbx, %rdi
cmpb $0x1, %sil
jne 0x4ef01
leaq 0xc429e(%rip), %rsi     # 0x112f1c
xorl %eax, %eax
callq 0xdf05a
leaq 0x88(%rsp), %r13
jmp 0x4ef18
movq %rbx, %rdi
leaq 0xc3de7(%rip), %rsi     # 0x112a83
movl %ebp, %edx
leaq 0xc39a5(%rip), %rcx     # 0x11264a
movq %r13, %r8
xorl %eax, %eax
callq 0xde896
leaq 0x1(%r13), %r14
andq $0x0, 0x58(%rsp)
movq %rbx, %rdi
pushq $0x1
popq %rsi
callq 0xdeba7
movq 0x18(%rbx), %rdi
movq %r14, %rsi
callq 0xe3eb4
movzbl %al, %edx
leaq 0x2(%r13), %r15
cmpb $0x1, %dl
movq %r14, 0x48(%rsp)
je 0x4f409
cmpl $0xce, %edx
movq 0x18(%rsp), %rbp
movq %rbx, %rdi
leaq 0xc3ee2(%rip), %rsi     # 0x112bdc
je 0x4f10d
cmpl $0xf9, %edx
je 0x4f252
cmpl $0xfe, %edx
je 0x4f190
cmpl $0xff, %edx
jne 0x4f3e8
leaq 0xd16a7(%rip), %rcx     # 0x1203d2
movl %r14d, %r8d
xorl %eax, %eax
callq 0xde896
movq %rbx, %rdi
pushq $0x1
popq %rsi
callq 0xdeba7
movq 0x18(%rbx), %rdi
movq %r15, %rsi
callq 0xe3eb4
cmpb $0xb, %al
jb 0x4f835
movzbl %al, %r14d
leaq 0x3(%r13), %rdx
movq 0x18(%rbx), %rdi
leaq 0x88(%rsp), %r12
movq %r12, %rsi
pushq $0xb
popq %rbp
movq %rbp, %rcx
callq 0xe3cb7
addq %r14, %r13
addq $0x3, %r13
movq %rbx, %rdi
callq 0xeac74
movq %rax, %r14
movq %rax, %rdi
movq %r12, %rsi
movq %rbp, %rdx
xorl %ecx, %ecx
pushq $0x1
popq %r8
callq 0xeb4a9
movq %r14, %rdi
callq 0xeb7e4
movq %rbx, %rdi
leaq 0xc3fcf(%rip), %rsi     # 0x112d7d
movq %rax, %rdx
xorl %eax, %eax
callq 0xde896
movq %r14, %rdi
movq %rbp, %r14
callq 0xeaf3c
movq %r12, %rdi
leaq 0xc3fbd(%rip), %rsi     # 0x112d8a
movq %rbp, %rdx
callq 0x18230
testl %eax, %eax
je 0x4f64b
movq %r12, %rdi
leaq 0xc3faf(%rip), %rsi     # 0x112d96
movq %r14, %rdx
callq 0x18230
testl %eax, %eax
je 0x4f64b
movq %r12, %rdi
leaq 0xc3fa1(%rip), %rsi     # 0x112da2
movq %r14, %rdx
callq 0x18230
testl %eax, %eax
movq 0x18(%rsp), %rbp
je 0x4f876
movq %r12, %rdi
leaq 0xc3f8e(%rip), %rsi     # 0x112dae
movq %r14, %rdx
callq 0x18230
testl %eax, %eax
je 0x4f8c1
movq %r12, %rdi
leaq 0xc3f80(%rip), %rsi     # 0x112dba
movq %r14, %rdx
callq 0x18230
testl %eax, %eax
je 0x4f900
movq %r12, %rdi
leaq 0xc3f72(%rip), %rsi     # 0x112dc6
movq %r14, %rdx
callq 0x18230
testl %eax, %eax
je 0x4f96b
movq %r12, %rdi
leaq 0xc3f64(%rip), %rsi     # 0x112dd2
movq %r14, %rdx
callq 0x18230
testl %eax, %eax
je 0x4f9cd
movq %r12, %rdi
leaq 0xc3f56(%rip), %rsi     # 0x112dde
movq %r14, %rdx
callq 0x18230
testl %eax, %eax
je 0x4fa58
movq %rbx, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0xe59cd
movq %rax, %r14
movl $0x100, %r9d            # imm = 0x100
movq %rbx, %rdi
movq %rbp, %rsi
movq %rax, %rdx
movq %r13, %rcx
pushq $0x1
popq %r8
callq 0x5042e
movq 0x18(%r14), %rcx
movl $0x1, (%rsp)
movl $0x100, %r8d            # imm = 0x100
movq %rbx, %rdi
movq %r14, %rsi
xorl %edx, %edx
xorl %r9d, %r9d
callq 0xded3a
jmp 0x4f8ef
movq %rbx, %rdi
movq %r12, %rsi
callq 0x4fd2d
xorl %r13d, %r13d
xorl %r12d, %r12d
xorl %r14d, %r14d
jmp 0x4f506
movq %rdx, %rsi
movq %rcx, %rdx
callq 0xe6be1
testl %eax, %eax
leaq 0x88(%rsp), %r13
jne 0x4ef20
movl $0x1, 0x38(%r15)
movq 0x440(%r12), %rax
testq %rax, %rax
je 0x4ef36
cmpb $0x0, 0x1(%rax)
pushq $0x4
popq %rcx
jne 0x4ef39
pushq $0x3
popq %rcx
cmpl $0x0, 0x38(%r15)
je 0x4ef4e
movq %rbx, %rdi
pushq $0x1
popq %rdx
movq %rdx, %rsi
pushq $0x1
popq %rcx
jmp 0x4ef59
movq 0x18(%r15), %rsi
movq 0x20(%r15), %rdx
movq %rbx, %rdi
callq 0xe7437
movq %rax, (%r15)
cmpl $0x0, 0x30(%r15)
je 0x4efe0
cmpl $0x0, 0x38(%r15)
movq 0x20(%r15), %r12
jne 0x4efe4
movq %rbx, %rdi
movq %r12, %rsi
movq %rbp, %rdx
callq 0xdf66f
movq %rax, 0x50(%r15)
movq 0x20(%r15), %r12
pushq $0x1
popq %rcx
xorl %edx, %edx
pushq $0x8
popq %r8
leaq 0xc3a8f(%rip), %r9      # 0x112a28
pushq $0x4
popq %r10
leal -0x1(%rcx), %esi
cmpl $0x4, %esi
ja 0x4efc5
movslq (%r9,%rsi,4), %rsi
addq %r9, %rsi
jmpq *%rsi
xorl %esi, %esi
movq %r8, %rdi
jmp 0x4efd7
movq %r10, %rsi
movq %r8, %rdi
jmp 0x4efd7
movq %rbp, %rsi
movq %r10, %rdi
jmp 0x4efd7
pushq $0x1
popq %rsi
movq %rbp, %rdi
jmp 0x4efd7
movw %si, (%rax,%rdx,2)
incq %rdx
addq %rdi, %rsi
cmpq %r12, %rsi
jl 0x4efcd
incl %ecx
jmp 0x4ef9d
movq 0x20(%r15), %r12
imulq 0x18(%r15), %r12
movq %rbx, %rdi
xorl %esi, %esi
leaq 0x30(%rsp), %rbp
movq %rbp, %rdx
movq %r13, %rcx
callq 0xee7ee
leaq 0x78(%rsp), %rax
xorpd %xmm0, %xmm0
movupd %xmm0, (%rax)
movq %rbx, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0xe6277
movq %rax, %r14
movq %rax, %rdi
callq 0xe589c
movq %rbx, 0x58(%rsp)
movq %r13, %r8
movq 0x18(%rsp), %r13
movq %r13, 0x60(%rsp)
movq %r15, 0x68(%rsp)
leaq 0x58(%rsp), %rax
movq %rax, 0xa8(%r14)
leaq 0x1478(%rip), %rax      # 0x504c4
movq %rax, 0xb0(%r14)
movl $0x2, 0x74(%rsp)
movl 0x24(%rsp), %eax
movl %eax, 0x7c(%rsp)
movq %r14, 0x30(%rsp)
movb $0x1, 0x38(%rsp)
movq %r12, 0x40(%rsp)
movq %rbx, %rdi
leaq 0xa73eb(%rip), %rsi     # 0xf6467
leaq 0x74(%rsp), %rdx
movq %rbp, %rcx
callq 0xee930
movq %rax, 0x40(%r15)
movq 0x18(%rbx), %rdx
movq %rbx, %rdi
movq %r13, %rsi
leaq 0x14e6(%rip), %rcx      # 0x50584
movq %r15, %r8
leaq 0x28(%rsp), %r9
callq 0x4fdc7
movq 0x28(%rsp), %r13
subq 0x48(%rsp), %r13
cmpl $0x0, 0x38(%r15)
je 0x4f0c5
pushq $0x1
popq %r12
jmp 0x4f50d
movq 0x40(%r15), %rdi
callq 0xee9d1
movq %r14, %rdi
callq 0xe58e8
cmpl $0x0, 0x88(%rsp)
je 0x4f4e5
movq %rbx, %rdi
leaq 0x88(%rsp), %rsi
callq 0xee7bc
movq %rbx, %rdi
leaq 0xb80c3(%rip), %rsi     # 0x1071c1
movq %rax, %rdx
xorl %eax, %eax
callq 0xdf2a5
jmp 0x4f502
leaq 0xc3abd(%rip), %rcx     # 0x112bd1
movl %r14d, %r8d
xorl %eax, %eax
callq 0xde896
movq %rbx, %rdi
pushq $0x1
popq %rsi
callq 0xdeba7
movq %r15, 0x30(%rsp)
andq $0x0, 0x90(%rsp)
movq %rbx, %rdi
callq 0xeac74
movq %rax, 0x88(%rsp)
movq 0x18(%rbx), %rdx
movq %rbx, %rdi
movq %rbp, %rsi
leaq 0x1279(%rip), %rcx      # 0x503d1
leaq 0x88(%rsp), %r8
leaq 0x30(%rsp), %r9
callq 0x4fdc7
movq 0x88(%rsp), %rdi
callq 0xeb877
movq %rbx, %rdi
leaq 0xc3d2e(%rip), %rsi     # 0x112eaf
movq %rax, %rdx
xorl %eax, %eax
callq 0xde896
jmp 0x4f240
leaq 0xe822b(%rip), %rcx     # 0x1373c2
movl %r14d, %r8d
xorl %eax, %eax
callq 0xde896
movq %rbx, %rdi
pushq $0x1
popq %rsi
callq 0xdeba7
movq %r15, 0x30(%rsp)
andq $0x0, 0x90(%rsp)
movq %rbx, %rdi
callq 0xeac74
movq %rax, 0x88(%rsp)
cmpl $0x1, 0x90(%rbx)
jle 0x4f1ef
movq %rbx, %rdi
leaq 0xbc266(%rip), %rsi     # 0x10b443
xorl %edx, %edx
pushq $0x1
popq %rcx
callq 0xe4e62
movq %rax, 0x90(%rsp)
movq 0x18(%rbx), %rdx
movq %rbx, %rdi
movq %rbp, %rsi
leaq 0x11d1(%rip), %rcx      # 0x503d1
leaq 0x88(%rsp), %r8
leaq 0x30(%rsp), %r9
callq 0x4fdc7
movq 0x88(%rsp), %rdi
callq 0xeb877
movq %rbx, %rdi
leaq 0xb85cc(%rip), %rsi     # 0x1077f5
movq %rax, %rdx
xorl %eax, %eax
callq 0xde896
movq 0x90(%rsp), %rdi
callq 0xe5591
movq 0x88(%rsp), %rdi
callq 0xeaf3c
jmp 0x4f835
leaq 0xc3968(%rip), %rcx     # 0x112bc1
movl %r14d, %r8d
xorl %eax, %eax
callq 0xde896
movq %rbx, %rdi
pushq $0x1
popq %rsi
callq 0xdeba7
movq %rbx, %rdi
movq %rbp, %rsi
callq 0x4fd4c
movq 0x18(%rbx), %rdi
movq %r15, %rsi
callq 0xe3eb4
cmpb $0x4, %al
je 0x4f2aa
movl %eax, %r14d
movzbl %al, %edx
movq %rbx, %rdi
leaq 0xc3a0d(%rip), %rsi     # 0x112ca6
xorl %eax, %eax
callq 0xdf05a
cmpb $0x4, %r14b
jb 0x4f835
movq %rbx, %rdi
pushq $0x3
popq %rsi
callq 0xdecaf
movq %rax, 0x440(%rbp)
movq 0x18(%rbx), %rdi
leaq 0x3(%r13), %rsi
callq 0xe3eb4
movzbl %al, %r14d
movq %rbx, %rdi
leaq 0xc37fd(%rip), %rsi     # 0x112ad4
movl %r14d, %edx
xorl %eax, %eax
callq 0xde896
movq %rbx, %rdi
pushq $0x1
popq %rsi
callq 0xdeba7
movl %r14d, %eax
andb $0x1, %al
movq 0x440(%rbp), %rcx
movb %al, 0x1(%rcx)
movzbl %al, %edx
movq %rbx, %rdi
leaq 0xb55b7(%rip), %rsi     # 0x1048bf
xorl %eax, %eax
callq 0xde896
movl %r14d, %eax
shrb %al
andb $0x1, %al
movzbl %al, %edx
movq %rbx, %rdi
leaq 0xc39bd(%rip), %rsi     # 0x112ce0
xorl %eax, %eax
callq 0xde896
shrb $0x2, %r14b
andb $0x7, %r14b
movq 0x440(%rbp), %rax
movb %r14b, (%rax)
movzbl %r14b, %edx
leaq 0xcfb9a(%rip), %rcx     # 0x11eee1
cmpb $0x3, %r14b
ja 0x4f35b
leaq 0xc36e8(%rip), %rax     # 0x112a3c
movslq (%rax,%rdx,4), %rcx
addq %rax, %rcx
movq %rbx, %rdi
leaq 0xc39c8(%rip), %rsi     # 0x112d2d
xorl %eax, %eax
callq 0xde896
movq %rbx, %rdi
movl %r12d, %esi
callq 0xdeba7
movq 0x18(%rbx), %rdi
leaq 0x4(%r13), %rsi
callq 0xe3fa3
cvtsi2sd %rax, %xmm0
divsd 0xc3687(%rip), %xmm0    # 0x112a18
movq %rbx, %rdi
leaq 0xc39ab(%rip), %rsi     # 0x112d46
movl %eax, %edx
movb $0x1, %al
callq 0xde896
movq 0x440(%rbp), %rax
cmpb $0x0, 0x1(%rax)
je 0x4f835
movq 0x18(%rbx), %rdi
addq $0x6, %r13
movq %r13, %rsi
callq 0xe3eb4
movq 0x440(%rbp), %rcx
movb %al, 0x2(%rcx)
movzbl %al, %edx
movq %rbx, %rdi
leaq 0xc3985(%rip), %rsi     # 0x112d61
xorl %eax, %eax
callq 0xde896
jmp 0x4f835
leaq 0xcfaf2(%rip), %rcx     # 0x11eee1
movl %r14d, %r8d
xorl %eax, %eax
callq 0xde896
movq %rbx, %rdi
pushq $0x1
popq %rsi
callq 0xdeba7
jmp 0x4f835
movq %rbx, %rdi
leaq 0xc37c9(%rip), %rsi     # 0x112bdc
leaq 0xc379c(%rip), %rcx     # 0x112bb6
movl %r14d, %r8d
xorl %eax, %eax
callq 0xde896
movq %rbx, %rdi
pushq $0x1
popq %rsi
callq 0xdeba7
movq %r15, 0x88(%rsp)
movq %rbx, %rdi
pushq $0x70
popq %rsi
callq 0xdecaf
movq %rax, %r14
movb $0x0, 0x58(%rax)
xorl %eax, %eax
movq 0x18(%rsp), %rbp
cmpl $0x0, (%rbp)
setne %al
movl %eax, 0x4(%r14)
movq 0x18(%rbx), %rdx
movq %rbx, %rdi
movq %rbp, %rsi
leaq 0xa34(%rip), %rcx       # 0x4fea0
movq %r14, %r8
leaq 0x88(%rsp), %r9
callq 0x4fdc7
cmpl $0x0, (%r14)
je 0x4f80d
cmpl $0x0, (%rbp)
je 0x4f80d
movq 0x438(%rbp), %rdi
movq 0x448(%rbp), %rsi
pushq $0x2
popq %rdx
callq 0xe70ab
movzbl 0x58(%r14), %eax
cmpl $0x3, %eax
je 0x4f7dc
cmpl $0x2, %eax
jne 0x4f80d
movq 0x438(%rbp), %rdi
movq 0x8(%r14), %rsi
movq 0x10(%r14), %rdx
movq 0x18(%r14), %rcx
movq 0x20(%r14), %r8
andl $0x0, (%rsp)
xorl %r9d, %r9d
callq 0xe8292
jmp 0x4f80d
movq 0x28(%r15), %rcx
cmpq %r12, %rcx
jge 0x4f502
movq %rbx, %rdi
leaq 0xc3a41(%rip), %rsi     # 0x112f39
movq %r12, %rdx
xorl %eax, %eax
callq 0xdf05a
pushq $0x1
popq %r12
cmpl $0x0, 0x38(%r15)
je 0x4f519
movq (%r15), %rdi
callq 0xe7084
andq $0x0, (%r15)
movq 0x40(%r15), %rdi
testq %rdi, %rdi
je 0x4f52c
callq 0xee9dd
andq $0x0, 0x40(%r15)
movq %r14, %rdi
callq 0xe5591
movl 0x54(%rsp), %esi
movq %rbx, %rdi
callq 0xdebb7
testl %r12d, %r12d
je 0x4fbad
movq 0x18(%rsp), %rbp
cmpl $0x0, 0x4(%rbp)
je 0x4f5a3
movq %rbx, %rdi
leaq 0xc3962(%rip), %rsi     # 0x112ec0
xorl %eax, %eax
callq 0xdf05a
xorl %r14d, %r14d
pushq $-0x1
popq %r12
movq %r14, %rdi
callq 0xe7084
movq (%r15), %rdi
callq 0xe7084
movq 0x50(%r15), %rsi
movq %rbx, %rdi
callq 0xded32
movq %rbx, %rdi
movq %r15, %rsi
callq 0xded32
movq %rbx, %rdi
movq %rbp, %rsi
callq 0x4fd4c
jmp 0x4f85b
movq (%r15), %rdi
testq %rdi, %rdi
je 0x4f554
cmpl $0x0, (%rbp)
pushq $-0x1
popq %r12
je 0x4f623
movq 0x440(%rbp), %rax
testq %rax, %rax
je 0x4f639
movzbl (%rax), %eax
cmpl $0x3, %eax
jne 0x4f709
movq 0x18(%r15), %rsi
movq 0x20(%r15), %rdx
movq %rbx, %rdi
pushq $0x4
popq %rcx
callq 0xe7437
movq %rax, %r14
movq 0x18(%rsp), %rax
movq 0x438(%rax), %rdi
movq 0x8(%r15), %rdx
movq 0x10(%r15), %rcx
movq 0x18(%r15), %r8
movq 0x20(%r15), %r9
xorpd %xmm0, %xmm0
movupd %xmm0, (%rsp)
andl $0x0, 0x10(%rsp)
movq %r14, %rsi
callq 0xe8314
movq (%r15), %rdi
movb $0x1, %bpl
pushq $0x3
popq %rax
jmp 0x4f70e
movq 0x448(%rbp), %rsi
xorl %edx, %edx
callq 0xe70ab
xorl %r14d, %r14d
jmp 0x4f56c
xorl %ebp, %ebp
movl $0x0, 0x24(%rsp)
xorl %r14d, %r14d
jmp 0x4f712
movq 0x18(%rbx), %rdi
movq %r13, %rsi
callq 0xe3eb4
testb %al, %al
pushq $-0x1
popq %r12
movq 0x18(%rsp), %rbp
je 0x4f835
movl %eax, %r14d
leaq 0x1(%r13), %rsi
movq 0x18(%rbx), %rdi
callq 0xe3eb4
movzbl %al, %edx
cmpb $0x2, %dl
leaq 0xcf85c(%rip), %rcx     # 0x11eee1
leaq 0xc3766(%rip), %rax     # 0x112df2
cmoveq %rax, %rcx
cmpb $0x1, %dl
setne %r12b
leaq 0xc374c(%rip), %rax     # 0x112dea
cmoveq %rax, %rcx
movq %rbx, %rdi
leaq 0xc3750(%rip), %rsi     # 0x112dfc
xorl %eax, %eax
callq 0xde896
cmpb $0x3, %r14b
setb %al
orb %r12b, %al
pushq $-0x1
popq %r12
movq 0x18(%rsp), %rbp
jne 0x4f835
addq $0x2, %r13
movq 0x18(%rbx), %rdi
movq %r13, %rsi
callq 0xe3fa3
testq %rax, %rax
leaq 0xe857a(%rip), %rcx     # 0x137c60
leaq 0xc3741(%rip), %rdx     # 0x112e2e
cmoveq %rdx, %rcx
movq %rbx, %rdi
leaq 0xc3722(%rip), %rsi     # 0x112e1d
movl %eax, %edx
xorl %eax, %eax
callq 0xde896
jmp 0x4f835
xorl %ebp, %ebp
xorl %r14d, %r14d
movl %eax, 0x24(%rsp)
movq 0x18(%rsp), %r12
movq 0x438(%r12), %rsi
movq 0x8(%rsi), %r8
movq 0x10(%rsi), %r9
movupd 0x8(%r15), %xmm0
movupd %xmm0, (%rsp)
movl $0x2, 0x10(%rsp)
xorl %edx, %edx
xorl %ecx, %ecx
callq 0xe8314
movq 0x438(%r12), %rdi
movq 0x448(%r12), %rsi
pushq $0x2
popq %rdx
callq 0xe70ab
cmpl $0x2, 0x24(%rsp)
jne 0x4f78e
movq 0x438(%r12), %rdi
movq 0x8(%r15), %rsi
movq 0x10(%r15), %rdx
movq 0x18(%r15), %rcx
movq 0x20(%r15), %r8
andl $0x0, (%rsp)
xorl %r9d, %r9d
callq 0xe8292
movq %r12, %rbp
jmp 0x4f568
testq %r14, %r14
sete %al
xorb $0x1, %bpl
orb %al, %bpl
jne 0x4f7d2
movq 0x18(%rsp), %rbp
movq 0x438(%rbp), %rsi
movq 0x18(%r15), %r8
movq 0x20(%r15), %r9
movupd 0x8(%r15), %xmm0
movupd %xmm0, (%rsp)
andl $0x0, 0x10(%rsp)
movq %r14, %rdi
xorl %edx, %edx
xorl %ecx, %ecx
callq 0xe8314
jmp 0x4f568
movq 0x18(%rsp), %rbp
jmp 0x4f568
movq 0x60(%r14), %rdi
testq %rdi, %rdi
je 0x4f80d
movq 0x438(%rbp), %rsi
movq 0x8(%rdi), %r8
movq 0x10(%rdi), %r9
movupd 0x8(%r14), %xmm0
movupd %xmm0, (%rsp)
andl $0x0, 0x10(%rsp)
xorl %edx, %edx
xorl %ecx, %ecx
callq 0xe8314
movq %rbx, %rdi
movq %rbp, %rsi
callq 0x4fd4c
movq 0x68(%r14), %rdi
callq 0xe5591
movq 0x60(%r14), %rdi
callq 0xe7084
movq %rbx, %rdi
movq %r14, %rsi
callq 0xded32
movq %rbx, %rdi
movl %r12d, %esi
callq 0xdeba7
movq %rbx, %rdi
movq %rbp, %rsi
movq %r15, %rdx
leaq 0x58(%rsp), %rcx
callq 0x4fd87
movq 0x58(%rsp), %r13
incq %r13
movq %rbx, %rdi
movl %r12d, %esi
callq 0xdeba7
movq 0x48(%rsp), %rax
addq %r13, %rax
movq %rax, %r13
jmp 0x4e9a1
movq %rbx, %rdi
movq %rbp, %rsi
movq %r13, %rdx
leaq 0x30(%rsp), %rcx
callq 0x4fd87
movq 0x30(%rsp), %rdx
cmpq $0x103, %rdx            # imm = 0x103
pushq $-0x1
popq %r12
jl 0x4f835
addq $-0x102, %rdx           # imm = 0xFEFE
movq 0x18(%rbx), %rdi
movq %r13, %rsi
leaq 0xdaf4e(%rip), %rcx     # 0x12a7fe
xorl %r8d, %r8d
pushq $0x1
popq %r9
callq 0xe4e0b
jmp 0x4f835
movq %rbx, %rdi
leaq 0xb9242(%rip), %rsi     # 0x108b0d
xorl %edx, %edx
pushq $0x1
popq %rcx
callq 0xe4e62
movq %rax, %r14
movq %rbx, %rdi
movq %rbp, %rsi
movq %rax, %rdx
movq %r13, %rcx
xorl %r8d, %r8d
xorl %r9d, %r9d
callq 0x5042e
movq %r14, %rdi
callq 0xe5591
pushq $-0x1
popq %r12
jmp 0x4f835
movq %r13, 0x30(%rsp)
movq 0x18(%rbx), %rdi
leaq 0x30(%rsp), %rsi
callq 0xe3f2a
testb %al, %al
je 0x4fa49
movzbl %al, %r12d
movq %rbx, %rdi
callq 0xeac74
movq %rax, %r14
movq 0x18(%rbx), %rdi
movq 0x30(%rsp), %rsi
movq %r12, %rdx
movq 0x18(%rsp), %rbp
movq %rax, %rcx
xorl %r8d, %r8d
pushq $0x1
popq %r9
callq 0xe4c9a
movq %r14, %rdi
callq 0xeb877
movq %rbx, %rdi
leaq 0xc34de(%rip), %rsi     # 0x112e3a
movq %rax, %rdx
xorl %eax, %eax
callq 0xde896
jmp 0x4fa4c
movq %rbx, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0xe59cd
movq %rax, %r14
movl $0x400000, %r9d         # imm = 0x400000
movq %rbx, %rdi
movq %rbp, %rsi
movq %rax, %rdx
movq %r13, %rcx
pushq $0x1
popq %r12
movl %r12d, %r8d
callq 0x5042e
movq %rbx, %rdi
leaq 0xc34b9(%rip), %rsi     # 0x112e5b
movq %r13, %rdx
xorl %eax, %eax
callq 0xde896
movq %rbx, %rdi
movl %r12d, %esi
callq 0xdeba7
movq 0x18(%r14), %rcx
movq %rbx, %rdi
movq %r14, %rsi
xorl %edx, %edx
xorl %r8d, %r8d
callq 0xec5fa
jmp 0x4fa2d
movq %rbx, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0xe59cd
movq %rax, %r14
movl $0x400000, %r9d         # imm = 0x400000
movq %rbx, %rdi
movq %rbp, %rsi
movq %rax, %rdx
movq %r13, %rcx
pushq $0x1
popq %r12
movl %r12d, %r8d
callq 0x5042e
movq %rbx, %rdi
leaq 0xc346d(%rip), %rsi     # 0x112e71
movq %r13, %rdx
xorl %eax, %eax
callq 0xde896
movq %rbx, %rdi
movl %r12d, %esi
callq 0xdeba7
movq 0x18(%r14), %rcx
movq %rbx, %rdi
movq %r14, %rsi
xorl %edx, %edx
xorl %r8d, %r8d
callq 0xec1bf
movq %rbx, %rdi
pushq $-0x1
popq %r12
movl %r12d, %esi
callq 0xdeba7
movq %r14, %rdi
callq 0xe5591
jmp 0x4f835
xorl %r14d, %r14d
pushq $-0x1
popq %r12
movq %r14, %rdi
jmp 0x4f248
movq %r13, 0x30(%rsp)
movq 0x18(%rbx), %rdi
leaq 0x30(%rsp), %r13
movq %r13, %rsi
callq 0xe3f2a
cmpb $0x2, %al
jb 0x4f8f7
movl %eax, %r14d
movq 0x18(%rbx), %rdi
movq %r13, %rsi
callq 0xe3f2a
movzbl %al, %r12d
movq 0x18(%rbx), %rdi
movq %r13, %rsi
callq 0xe3f2a
movzbl %al, %ecx
movq %rbx, %rdi
leaq 0xc33e4(%rip), %rsi     # 0x112e86
movl %r12d, %edx
movq 0x18(%rsp), %rbp
xorl %eax, %eax
callq 0xde896
cmpb $0x6, %r14b
jb 0x4f8f7
movq 0x18(%rbx), %rdi
movq %r13, %rsi
callq 0xe40bf
movq %rbx, %rdi
leaq 0xc33ca(%rip), %rsi     # 0x112e9b
movq %rax, %rdx
xorl %eax, %eax
callq 0xde896
jmp 0x4f8f7
movq %rbx, %rdi
movq %rbp, %rsi
callq 0x4fd2d
jmp 0x4fbeb
leaq 0xc2f8c(%rip), %rsi     # 0x112a83
cmpl $0x3b, %ebp
jne 0x4fb82
leaq 0xee7f6(%rip), %rcx     # 0x13e2fd
movq %rbx, %rdi
movl %ebp, %edx
movq %r13, %r8
xorl %eax, %eax
callq 0xde896
leaq 0x1(%r13), %r14
movq 0x18(%rbx), %rdi
movq 0x18(%rdi), %r15
subq %r14, %r15
jle 0x4fbeb
movq %r14, %rsi
callq 0xe3eb4
movl %eax, %ebp
cmpb $0x1a, %al
je 0x4fb41
movzbl %bpl, %eax
testl %eax, %eax
jne 0x4fb69
addq $0x2, %r13
pushq $0x1
popq %r12
cmpq %r15, %r12
jge 0x4fbeb
movq 0x18(%rbx), %rdi
movq %r13, %rsi
callq 0xe3eb4
incq %r12
incq %r13
cmpb %bpl, %al
je 0x4fb49
leaq 0xc34c7(%rip), %rsi     # 0x113037
movq %rbx, %rdi
movq %r15, %rdx
movq %r14, %rcx
xorl %eax, %eax
callq 0xdf37f
jmp 0x4fbeb
leaq 0xcf358(%rip), %rcx     # 0x11eee1
movq %rbx, %rdi
movl %ebp, %edx
movq %r13, %r8
xorl %eax, %eax
callq 0xde896
leaq 0xc2f02(%rip), %rsi     # 0x112aa1
movq %rbx, %rdi
movl %ebp, %edx
xorl %eax, %eax
callq 0xdf2a5
jmp 0x4fbeb
xorl %edi, %edi
callq 0xe7084
movq (%r15), %rdi
callq 0xe7084
movq 0x50(%r15), %rsi
movq %rbx, %rdi
callq 0xded32
movq %rbx, %rdi
movq %r15, %rsi
callq 0xded32
movq %rbx, %rdi
movq 0x18(%rsp), %rsi
callq 0x4fd4c
pushq $-0x1
popq %rsi
movq %rbx, %rdi
callq 0xdeba7
movq 0x18(%rsp), %r14
movq 0x438(%r14), %rdi
testq %rdi, %rdi
je 0x4fc59
cmpl $0x0, 0x8(%r14)
je 0x4fc54
movq 0x448(%r14), %rsi
leaq 0xd34b4(%rip), %rdx     # 0x1230c5
pushq $0x5
popq %rbp
movq %rbx, %rdi
xorl %ecx, %ecx
movl %ebp, %r8d
callq 0xdffbd
movq 0x438(%r14), %rdi
movq 0x448(%r14), %rsi
pushq $0x2
popq %rdx
callq 0xe70ab
movq 0x448(%r14), %rsi
movq %rbx, %rdi
xorl %edx, %edx
xorl %ecx, %ecx
movl %ebp, %r8d
callq 0xdffbd
movq 0x438(%r14), %rdi
callq 0xe7084
movq %rbx, %rdi
movq %r14, %rsi
callq 0x4fd4c
movq 0x448(%r14), %rsi
movq %rbx, %rdi
callq 0xdfd24
movq %rbx, %rdi
movq %r14, %rsi
callq 0xded32
addq $0xe8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq