// File: /workspace/github_c_makefile_star2_O2/jonof[P]jftekwar/libsmacker/smacker.c
// Function: smk_open_generic
static smk smk_open_generic(const unsigned char m, union smk_read_t fp, unsigned long size, const unsigned char process_mode)
{
	/* Smacker structure we intend to work on / return */
	smk s;
	/* Temporary variables */
	long temp_l;
	unsigned long temp_u;
	/* r is used by macros above for return code */
	char r;
	unsigned char buf[4] = {'\0'};
	/* video hufftrees are stored as a large chunk (bitstream)
		these vars are used to load, then decode them */
	unsigned char * hufftree_chunk = NULL;
	unsigned long tree_size;
	/* a bitstream struct */
	struct smk_bit_t bs;

	/** **/
	/* safe malloc the structure */
	if ((s = calloc(1, sizeof(struct smk_t))) == NULL) {
		perror("libsmacker::smk_open_generic() - ERROR: failed to malloc() smk structure");
		return NULL;
	}

	/* Check for a valid signature */
	smk_read(buf, 3);

	if (buf[0] != 'S' || buf[1] != 'M' || buf[2] != 'K') {
		fprintf(stderr, "libsmacker::smk_open_generic - ERROR: invalid SMKn signature (got: %s)\n", buf);
		goto error;
	}

	/* Read .smk file version */
	smk_read(&s->video.v, 1);

	if (s->video.v != '2' && s->video.v != '4') {
		fprintf(stderr, "libsmacker::smk_open_generic - Warning: invalid SMK version %c (expected: 2 or 4)\n", s->video.v);

		/* take a guess */
		if (s->video.v < '4')
			s->video.v = '2';
		else
			s->video.v = '4';

		fprintf(stderr, "\tProcessing will continue as type %c\n", s->video.v);
	}

	/* width, height, total num frames */
	smk_read_ul(s->video.w);
	smk_read_ul(s->video.h);
	smk_read_ul(s->f);
	/* frames per second calculation */
	smk_read_ul(temp_u);
	temp_l = (int)temp_u;

	if (temp_l > 0) {
		/* millisec per frame */
		s->usf = temp_l * 1000;
	} else if (temp_l < 0) {
		/* 10 microsec per frame */
		s->usf = temp_l * -10;
	} else {
		/* defaults to 10 usf (= 100000 microseconds) */
		s->usf = 100000;
	}

	/* Video flags follow.
		Ring frame is important to libsmacker.
		Y scale / Y interlace go in the Video flags.
		The user should scale appropriately. */
	smk_read_ul(temp_u);

	if (temp_u & 0x01)
		s->ring_frame = 1;

	if (temp_u & 0x02)
		s->video.y_scale_mode = SMK_FLAG_Y_DOUBLE;

	if (temp_u & 0x04) {
		if (s->video.y_scale_mode == SMK_FLAG_Y_DOUBLE)
			fputs("libsmacker::smk_open_generic - Warning: SMK file specifies both Y-Double AND Y-Interlace.\n", stderr);

		s->video.y_scale_mode = SMK_FLAG_Y_INTERLACE;
	}

	/* Max buffer size for each audio track - used to pre-allocate buffers */
	for (temp_l = 0; temp_l < 7; temp_l ++)
		smk_read_ul(s->audio[temp_l].max_buffer);

	/* Read size of "hufftree chunk" - save for later. */
	smk_read_ul(tree_size);

	/* "unpacked" sizes of each huff tree */
	for (temp_l = 0; temp_l < 4; temp_l ++)
		smk_read_ul(s->video.tree_size[temp_l]);

	/* read audio rate data */
	for (temp_l = 0; temp_l < 7; temp_l ++) {
		smk_read_ul(temp_u);

		if (temp_u & 0x40000000) {
			/* Audio track specifies "exists" flag, malloc structure and copy components. */
			s->audio[temp_l].exists = 1;
			/* and for all audio tracks */
			smk_malloc(s->audio[temp_l].buffer, s->audio[temp_l].max_buffer);

			if (temp_u & 0x80000000)
				s->audio[temp_l].compress = 1;

			s->audio[temp_l].bitdepth = ((temp_u & 0x20000000) ? 16 : 8);
			s->audio[temp_l].channels = ((temp_u & 0x10000000) ? 2 : 1);

			if (temp_u & 0x0c000000) {
				fprintf(stderr, "libsmacker::smk_open_generic - Warning: audio track %ld is compressed with Bink (perceptual) Audio Codec: this is currently unsupported by libsmacker\n", temp_l);
				s->audio[temp_l].compress = 2;
			}

			/* Bits 25 & 24 are unused. */
			s->audio[temp_l].rate = (temp_u & 0x00FFFFFF);
		}
	}

	/* Skip over Dummy field */
	smk_read_ul(temp_u);
	/* FrameSizes and Keyframe marker are stored together. */
	smk_malloc(s->keyframe, (s->f + s->ring_frame));
	smk_malloc(s->chunk_size, (s->f + s->ring_frame) * sizeof(unsigned long));

	for (temp_u = 0; temp_u < (s->f + s->ring_frame); temp_u ++) {
		smk_read_ul(s->chunk_size[temp_u]);

		/* Set Keyframe */
		if (s->chunk_size[temp_u] & 0x01)
			s->keyframe[temp_u] = 1;

		/* Bits 1 is used, but the purpose is unknown. */
		s->chunk_size[temp_u] &= 0xFFFFFFFC;
	}

	/* That was easy... Now read FrameTypes! */
	smk_malloc(s->frame_type, (s->f + s->ring_frame));

	for (temp_u = 0; temp_u < (s->f + s->ring_frame); temp_u ++)
		smk_read(&s->frame_type[temp_u], 1);

	/* HuffmanTrees
		We know the sizes already: read and assemble into
		something actually parse-able at run-time */
	smk_malloc(hufftree_chunk, tree_size);
	smk_read(hufftree_chunk, tree_size);
	/* set up a Bitstream */
	smk_bs_init(&bs, hufftree_chunk, tree_size);

	/* create some tables */
	for (temp_u = 0; temp_u < 4; temp_u ++) {
		if (! smk_huff16_build(&s->video.tree[temp_u], &bs, s->video.tree_size[temp_u])) {
			fprintf(stderr, "libsmacker::smk_open_generic - ERROR: failed to create huff16 tree %lu\n", temp_u);
			goto error;
		}
	}

	/* clean up */
	smk_free(hufftree_chunk);
	/* Go ahead and malloc storage for the video frame */
	smk_malloc(s->video.frame, s->video.w * s->video.h);
	/* final processing: depending on ProcessMode, handle what to do with rest of file data */
	s->mode = process_mode;

	/* Handle the rest of the data.
		For MODE_MEMORY, read the chunks and store */
	if (s->mode == SMK_MODE_MEMORY) {
		smk_malloc(s->source.chunk_data, (s->f + s->ring_frame) * sizeof(unsigned char *));

		for (temp_u = 0; temp_u < (s->f + s->ring_frame); temp_u ++) {
			smk_malloc(s->source.chunk_data[temp_u], s->chunk_size[temp_u]);
			smk_read(s->source.chunk_data[temp_u], s->chunk_size[temp_u]);
		}
	} else {
		/* MODE_STREAM: don't read anything now, just precompute offsets.
			use fseek to verify that the file is "complete" */
		smk_malloc(s->source.file.chunk_offset, (s->f + s->ring_frame) * sizeof(unsigned long));

		for (temp_u = 0; temp_u < (s->f + s->ring_frame); temp_u ++) {
			s->source.file.chunk_offset[temp_u] = ftell(fp.file);

			if (fseek(fp.file, s->chunk_size[temp_u], SEEK_CUR)) {
				fprintf(stderr, "libsmacker::smk_open - ERROR: fseek to frame %lu not OK.\n", temp_u);
				perror("\tError reported was");
				goto error;
			}
		}
	}

	return s;
error:
	smk_free(hufftree_chunk);
	smk_close(s);
	return NULL;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x878, %rsp            # imm = 0x878
movl %ecx, %ebx
movq %rsi, %r14
movl %edi, %r15d
movq %rsi, 0x10(%rsp)
movq %rdx, 0x20(%rsp)
andl $0x0, 0xc(%rsp)
pushq $0x1
popq %rdi
movl $0x548, %esi            # imm = 0x548
callq 0x8cc0
testq %rax, %rax
je 0x2bbe5
movq %rax, %rbp
leaq 0xc(%rsp), %rdi
pushq $0x3
popq %rsi
testb %r15b, %r15b
je 0x2b26e
movq %r14, %rdx
callq 0x2d745
jmp 0x2b27d
leaq 0x10(%rsp), %rdx
leaq 0x20(%rsp), %rcx
callq 0x2d78e
testb %al, %al
js 0x2bbf6
cmpb $0x53, 0xc(%rsp)
jne 0x2bc18
cmpb $0x4d, 0xd(%rsp)
jne 0x2bc18
cmpb $0x4b, 0xe(%rsp)
jne 0x2bc18
leaq 0x69(%rbp), %rdi
testb %r15b, %r15b
je 0x2b2be
movq 0x10(%rsp), %rdx
pushq $0x1
popq %rsi
callq 0x2d745
jmp 0x2b2d0
pushq $0x1
popq %rsi
leaq 0x10(%rsp), %rdx
leaq 0x20(%rsp), %rcx
callq 0x2d78e
testb %al, %al
js 0x2bcc0
movzbl 0x69(%rbp), %edx
cmpl $0x32, %edx
je 0x2b2ea
cmpl $0x34, %edx
jne 0x2be70
testb %r15b, %r15b
je 0x2b366
movq 0x10(%rsp), %rdx
leaq 0xc(%rsp), %rdi
pushq $0x4
popq %rsi
callq 0x2d745
testb %al, %al
js 0x2bcec
leaq 0xc(%rsp), %rdi
movl (%rdi), %eax
movq %rax, 0x58(%rbp)
movq 0x10(%rsp), %rdx
pushq $0x4
popq %rsi
callq 0x2d745
testb %al, %al
js 0x2bd0e
leaq 0xc(%rsp), %rdi
movl (%rdi), %eax
movq %rax, 0x60(%rbp)
movq 0x10(%rsp), %rdx
pushq $0x4
popq %rsi
callq 0x2d745
testb %al, %al
js 0x2bd30
leaq 0xc(%rsp), %rdi
movl (%rdi), %eax
movq %rax, 0x10(%rbp)
movq 0x10(%rsp), %rdx
pushq $0x4
popq %rsi
callq 0x2d745
jmp 0x2b3ec
leaq 0xc(%rsp), %rdi
pushq $0x4
popq %rsi
leaq 0x10(%rsp), %rdx
leaq 0x20(%rsp), %rcx
callq 0x2d78e
testb %al, %al
js 0x2bcec
leaq 0xc(%rsp), %rdi
movl (%rdi), %eax
movq %rax, 0x58(%rbp)
pushq $0x4
popq %rsi
leaq 0x10(%rsp), %rdx
leaq 0x20(%rsp), %rcx
callq 0x2d78e
testb %al, %al
js 0x2bd0e
leaq 0xc(%rsp), %rdi
movl (%rdi), %eax
movq %rax, 0x60(%rbp)
pushq $0x4
popq %rsi
leaq 0x10(%rsp), %rdx
leaq 0x20(%rsp), %rcx
callq 0x2d78e
testb %al, %al
js 0x2bd30
leaq 0xc(%rsp), %rdi
movl (%rdi), %eax
movq %rax, 0x10(%rbp)
pushq $0x4
popq %rsi
leaq 0x10(%rsp), %rdx
leaq 0x20(%rsp), %rcx
callq 0x2d78e
testb %al, %al
js 0x2bd52
movzbl 0xf(%rsp), %eax
shll $0x18, %eax
movzbl 0xe(%rsp), %ecx
shll $0x10, %ecx
movzwl 0xc(%rsp), %edx
orl %ecx, %edx
orl %eax, %edx
movslq %edx, %rcx
testl %ecx, %ecx
jle 0x2b422
imulq $0x3e8, %rcx, %rax      # imm = 0x3E8
cvtsi2sd %rax, %xmm0
jmp 0x2b432
testl %eax, %eax
js 0x2bbdc
movsd 0x69ba6(%rip), %xmm0    # 0x94fd8
movsd %xmm0, 0x8(%rbp)
testb %r15b, %r15b
je 0x2b450
movq 0x10(%rsp), %rdx
leaq 0xc(%rsp), %rdi
pushq $0x4
popq %rsi
callq 0x2d745
jmp 0x2b467
leaq 0xc(%rsp), %rdi
pushq $0x4
popq %rsi
leaq 0x10(%rsp), %rdx
leaq 0x20(%rsp), %rcx
callq 0x2d78e
testb %al, %al
js 0x2bd74
movzbl 0xc(%rsp), %eax
testb $0x1, %al
je 0x2b47c
movb $0x1, 0x18(%rbp)
testb $0x2, %al
je 0x2b484
movb $0x2, 0x68(%rbp)
testb $0x4, %al
je 0x2b496
cmpb $0x2, 0x68(%rbp)
je 0x2bedf
movb $0x1, 0x68(%rbp)
movl %ebx, 0x44(%rsp)
movl %r15d, 0x1c(%rsp)
movl $0x408, %ebx            # imm = 0x408
leaq 0xc(%rsp), %r14
pushq $0x4
popq %r15
leaq 0x10(%rsp), %r12
leaq 0x20(%rsp), %r13
cmpq $0x558, %rbx            # imm = 0x558
je 0x2b501
cmpb $0x0, 0x1c(%rsp)
je 0x2b4d9
movq 0x10(%rsp), %rdx
movq %r14, %rdi
movq %r15, %rsi
callq 0x2d745
jmp 0x2b4ea
movq %r14, %rdi
movq %r15, %rsi
movq %r12, %rdx
movq %r13, %rcx
callq 0x2d78e
testb %al, %al
js 0x2bd96
movl 0xc(%rsp), %eax
movq %rax, (%rbp,%rbx)
addq $0x30, %rbx
jmp 0x2b4b7
cmpb $0x0, 0x1c(%rsp)
je 0x2b51c
movq 0x10(%rsp), %rdx
leaq 0xc(%rsp), %rdi
pushq $0x4
popq %rsi
callq 0x2d745
jmp 0x2b533
leaq 0xc(%rsp), %rdi
pushq $0x4
popq %rsi
leaq 0x10(%rsp), %rdx
leaq 0x20(%rsp), %rcx
callq 0x2d78e
testb %al, %al
js 0x2bdb8
leaq 0xc(%rsp), %r14
movl (%r14), %eax
movq %rax, 0x30(%rsp)
pushq $0xe
popq %rbx
pushq $0x4
popq %r15
leaq 0x10(%rsp), %r12
leaq 0x20(%rsp), %r13
cmpq $0x12, %rbx
je 0x2b59f
cmpb $0x0, 0x1c(%rsp)
je 0x2b578
movq 0x10(%rsp), %rdx
movq %r14, %rdi
movq %r15, %rsi
callq 0x2d745
jmp 0x2b589
movq %r14, %rdi
movq %r15, %rsi
movq %r12, %rdx
movq %r13, %rcx
callq 0x2d78e
testb %al, %al
js 0x2bdd7
movl 0xc(%rsp), %eax
movq %rax, (%rbp,%rbx,8)
incq %rbx
jmp 0x2b559
leaq 0x418(%rbp), %rbx
leaq 0xc(%rsp), %r14
pushq $0x4
popq %r15
xorl %r12d, %r12d
movq %rbp, 0x38(%rsp)
movl 0x1c(%rsp), %r13d
cmpq $0x7, %r12
je 0x2b6c5
testb %r13b, %r13b
je 0x2b5dd
movq 0x10(%rsp), %rdx
movq %r14, %rdi
movq %r15, %rsi
callq 0x2d745
jmp 0x2b5f2
movq %r14, %rdi
movq %r15, %rsi
leaq 0x10(%rsp), %rdx
leaq 0x20(%rsp), %rcx
callq 0x2d78e
testb %al, %al
js 0x2bdf6
movzbl 0xf(%rsp), %ebp
testb $0x40, %bpl
je 0x2b691
movq %r12, 0x28(%rsp)
movq %r14, %r15
movzbl 0xe(%rsp), %r14d
movzwl 0xc(%rsp), %r12d
movb $0x1, -0x20(%rbx)
cmpq $0x0, (%rbx)
jne 0x2c064
movq -0x10(%rbx), %r13
pushq $0x1
popq %rdi
movq %r13, %rsi
callq 0x8cc0
movq %rax, (%rbx)
testq %rax, %rax
je 0x2c01c
testb %bpl, %bpl
jns 0x2b64f
movb $0x1, -0x8(%rbx)
movl %ebp, %eax
andl $0x20, %eax
shrl $0x5, %eax
shlb $0x3, %al
addb $0x8, %al
movb %al, -0x1d(%rbx)
movl %ebp, %eax
andl $0x10, %eax
cmpq $0x1, %rax
movb $0x2, %al
sbbb $0x0, %al
movb %al, -0x1e(%rbx)
testb $0xc, %bpl
movl 0x1c(%rsp), %r13d
jne 0x2b6a2
shll $0x10, %r14d
orq %r14, %r12
movq %r12, -0x18(%rbx)
movq %r15, %r14
pushq $0x4
popq %r15
movq 0x28(%rsp), %r12
incq %r12
addq $0x30, %rbx
movq 0x38(%rsp), %rbp
jmp 0x2b5bc
movq 0x9b8ef(%rip), %rax     # 0xc6f98
movq (%rax), %rdi
leaq 0x6a4eb(%rip), %rsi     # 0x95b9e
movq 0x28(%rsp), %rdx
xorl %eax, %eax
callq 0x8290
movb $0x2, -0x8(%rbx)
jmp 0x2b67a
testb %r13b, %r13b
je 0x2b6de
movq 0x10(%rsp), %rdx
leaq 0xc(%rsp), %rdi
pushq $0x4
popq %rsi
callq 0x2d745
jmp 0x2b6f5
leaq 0xc(%rsp), %rdi
pushq $0x4
popq %rsi
leaq 0x10(%rsp), %rdx
leaq 0x20(%rsp), %rcx
callq 0x2d78e
movq 0x9b89c(%rip), %rbx     # 0xc6f98
testb %al, %al
js 0x2be15
cmpq $0x0, 0x40(%rbp)
jne 0x2c0e2
movq 0x10(%rbp), %r13
movzbl 0x18(%rbp), %r12d
leaq (%r12,%r13), %r14
pushq $0x1
popq %rdi
movq %r14, %rsi
callq 0x8cc0
movq %rax, 0x40(%rbp)
testq %rax, %rax
je 0x2c101
cmpq $0x0, 0x38(%rbp)
jne 0x2c12c
shlq $0x3, %r14
pushq $0x1
popq %rdi
movq %r14, %rsi
callq 0x8cc0
movq %rax, 0x38(%rbp)
testq %rax, %rax
je 0x2c14b
xorl %ebx, %ebx
leaq 0xc(%rsp), %r14
pushq $0x4
popq %r15
movzbl %r12b, %r12d
addq %r13, %r12
cmpq %r12, %rbx
jae 0x2b7e5
cmpb $0x0, 0x1c(%rsp)
je 0x2b78b
movq 0x10(%rsp), %rdx
movq %r14, %rdi
movq %r15, %rsi
callq 0x2d745
jmp 0x2b7a0
movq %r14, %rdi
movq %r15, %rsi
leaq 0x10(%rsp), %rdx
leaq 0x20(%rsp), %rcx
callq 0x2d78e
testb %al, %al
js 0x2be2d
movl 0xc(%rsp), %eax
movq 0x38(%rbp), %rcx
movq %rax, (%rcx,%rbx,8)
movq 0x38(%rbp), %rax
movq (%rax,%rbx,8), %rcx
testb $0x1, %cl
je 0x2b7d1
movq 0x40(%rbp), %rax
movb $0x1, (%rax,%rbx)
movq 0x38(%rbp), %rax
movq (%rax,%rbx,8), %rcx
andl $-0x4, %ecx
movq %rcx, (%rax,%rbx,8)
incq %rbx
movq 0x10(%rbp), %r13
movb 0x18(%rbp), %r12b
jmp 0x2b766
cmpq $0x0, 0x48(%rbp)
movl 0x1c(%rsp), %r13d
jne 0x2c186
pushq $0x1
popq %rdi
movq %r12, %rsi
callq 0x8cc0
movq %rax, 0x48(%rbp)
testq %rax, %rax
je 0x2c1a5
xorl %ebx, %ebx
pushq $0x1
popq %r14
leaq 0x10(%rsp), %r15
leaq 0x20(%rsp), %r12
movzbl 0x18(%rbp), %eax
addq 0x10(%rbp), %rax
cmpq %rax, %rbx
jae 0x2b87c
movq 0x48(%rbp), %rdi
addq %rbx, %rdi
testb %r13b, %r13b
je 0x2b845
movq 0x10(%rsp), %rdx
movq %r14, %rsi
callq 0x2d745
jmp 0x2b853
movq %r14, %rsi
movq %r15, %rdx
movq %r12, %rcx
callq 0x2d78e
incq %rbx
testb %al, %al
jns 0x2b81d
movq 0x9b737(%rip), %rax     # 0xc6f98
movq (%rax), %rdi
leaq 0x6a0bf(%rip), %rsi     # 0x9592a
leaq 0x69a61(%rip), %rdx     # 0x952d3
movl $0x327, %ecx            # imm = 0x327
jmp 0x2be4a
pushq $0x1
popq %rdi
movq 0x30(%rsp), %r15
movq %r15, %rsi
callq 0x8cc0
testq %rax, %rax
je 0x2c1e0
movq %rax, %r14
testb %r13b, %r13b
movq 0x9b6f6(%rip), %rbx     # 0xc6f98
je 0x2b8b6
movq 0x10(%rsp), %rdx
movq %r14, %rdi
movq %r15, %rsi
callq 0x2d745
jmp 0x2b8cb
leaq 0x10(%rsp), %rdx
leaq 0x20(%rsp), %rcx
movq %r14, %rdi
movq %r15, %rsi
callq 0x2d78e
testb %al, %al
js 0x2bebd
movq %r14, %rax
leaq 0x50(%rsp), %r14
movq %rax, (%r14)
movq %rax, 0x48(%rsp)
addq %r15, %rax
movq %rax, 0x8(%r14)
andl $0x0, 0x10(%r14)
leaq 0x90(%rbp), %rax
movq %rax, 0x30(%rsp)
movq %rbp, %rbx
addq $0xa0, %rbx
xorl %r15d, %r15d
cmpq $0x4, %r15
je 0x2bac0
movq 0x70(%rbp,%r15,8), %r12
movq %r14, %rdi
callq 0x2d7dc
testl %eax, %eax
js 0x2befa
imulq $0x18, %r15, %r13
addq 0x30(%rsp), %r13
andq $0x0, 0x8(%r13)
testl %eax, %eax
je 0x2ba13
leaq 0x470(%rsp), %rdi
movq %r14, %rsi
callq 0x2d849
testl %eax, %eax
je 0x2bf4b
leaq 0x68(%rsp), %rdi
movq %r14, %rsi
callq 0x2d849
testl %eax, %eax
je 0x2bf5e
movq %r15, 0x28(%rsp)
xorl %r15d, %r15d
cmpq $0x3, %r15
je 0x2b9aa
movq %r14, %rdi
callq 0x2d91a
testl %eax, %eax
js 0x2ba4d
movw %ax, (%rbx,%r15,2)
movq %r14, %rdi
callq 0x2d91a
testl %eax, %eax
js 0x2ba60
shll $0x8, %eax
orw %ax, (%rbx,%r15,2)
incq %r15
jmp 0x2b972
cmpl $0xc, %r12d
jb 0x2bf79
movl %r12d, %eax
andl $0x3, %eax
jne 0x2bf79
addl $-0xc, %r12d
movl %r12d, %edi
andl $-0x4, %edi
callq 0x8d50
movq %rax, (%r13)
testq %rax, %rax
movq 0x28(%rsp), %r15
je 0x2bf0d
shrl $0x2, %r12d
movq %r13, %rdi
movq %r14, %rsi
leaq 0x470(%rsp), %rdx
leaq 0x68(%rsp), %rcx
movq %r12, %r8
callq 0x2d99e
testl %eax, %eax
je 0x2bf92
cmpq %r12, 0x8(%r13)
je 0x2ba2b
jmp 0x2bfa5
pushq $0x4
popq %rdi
callq 0x8d50
movq %rax, (%r13)
testq %rax, %rax
je 0x2bf0d
andl $0x0, (%rax)
movq %r14, %rdi
callq 0x2d7dc
testl %eax, %eax
js 0x2bf25
jne 0x2bf38
incq %r15
addq $0x18, %rbx
jmp 0x2b908
movq 0x9b544(%rip), %rbx     # 0xc6f98
movq (%rbx), %rdi
leaq 0x6a842(%rip), %rsi     # 0x962a0
jmp 0x2ba71
movq 0x9b531(%rip), %rbx     # 0xc6f98
movq (%rbx), %rdi
leaq 0x6a87f(%rip), %rsi     # 0x962f0
movl %r15d, %edx
xorl %eax, %eax
callq 0x8290
movq 0x28(%rsp), %r15
movq (%rbx), %rdi
leaq 0x6a3b6(%rip), %rsi     # 0x95e40
movq %r15, %rdx
xorl %eax, %eax
callq 0x8290
movq 0x48(%rsp), %r14
movq %r14, %rdi
callq 0x8270
movq %rbp, %rdi
callq 0x2c41d
xorl %ebp, %ebp
movq %rbp, %rax
addq $0x878, %rsp            # imm = 0x878
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x48(%rsp), %rdi
callq 0x8270
cmpq $0x0, 0x3f0(%rbp)
jne 0x2c21b
movq 0x60(%rbp), %r14
imulq 0x58(%rbp), %r14
pushq $0x1
popq %rdi
movq %r14, %rsi
callq 0x8cc0
movq %rax, 0x3f0(%rbp)
testq %rax, %rax
movl 0x44(%rsp), %eax
je 0x2c23a
movb %al, (%rbp)
cmpb $0x1, %al
jne 0x2bc3a
cmpq $0x0, 0x28(%rbp)
jne 0x2c26f
movq 0x10(%rbp), %r13
movq %rbp, %rbx
movzbl 0x18(%rbp), %ebp
movq %r13, %r14
addq %rbp, %r14
shlq $0x3, %r14
pushq $0x1
popq %rdi
movq %r14, %rsi
callq 0x8cc0
movq %rax, 0x28(%rbx)
testq %rax, %rax
je 0x2c2ad
xorl %ebx, %ebx
pushq $0x1
popq %r14
leaq 0x10(%rsp), %r15
leaq 0x20(%rsp), %r12
movzbl %bpl, %eax
addq %r13, %rax
cmpq %rax, %rbx
jae 0x2bce2
movq 0x38(%rsp), %rbp
movq 0x28(%rbp), %r13
cmpq $0x0, (%r13,%rbx,8)
jne 0x2c0c3
movq 0x38(%rbp), %rax
movq (%rax,%rbx,8), %rsi
movq %r14, %rdi
callq 0x8cc0
movq %rax, (%r13,%rbx,8)
movq 0x28(%rbp), %rax
movq (%rax,%rbx,8), %rdi
testq %rdi, %rdi
je 0x2c083
movq 0x38(%rbp), %rax
movq (%rax,%rbx,8), %rsi
cmpb $0x0, 0x1c(%rsp)
je 0x2bbb9
movq 0x10(%rsp), %rdx
callq 0x2d745
jmp 0x2bbc4
movq %r15, %rdx
movq %r12, %rcx
callq 0x2d78e
testb %al, %al
js 0x2bffa
incq %rbx
movq 0x10(%rbp), %r13
movb 0x18(%rbp), %bpl
jmp 0x2bb53
imulq $-0xa, %rcx, %rax
jmp 0x2b41b
leaq 0x69cf5(%rip), %rdi     # 0x958e1
callq 0x83f0
jmp 0x2baa9
movq 0x9b39b(%rip), %rax     # 0xc6f98
movq (%rax), %rdi
leaq 0x69d23(%rip), %rsi     # 0x9592a
leaq 0x696c5(%rip), %rdx     # 0x952d3
movl $0x2b1, %ecx            # imm = 0x2B1
jmp 0x2be4a
movq 0x9b379(%rip), %rax     # 0xc6f98
movq (%rax), %rdi
leaq 0x69d5c(%rip), %rsi     # 0x95985
leaq 0xc(%rsp), %rdx
xorl %eax, %eax
callq 0x8290
jmp 0x2be51
cmpq $0x0, 0x30(%rbp)
jne 0x2c28e
movq 0x10(%rbp), %r12
movzbl 0x18(%rbp), %r13d
leaq (%r12,%r13), %r14
shlq $0x3, %r14
pushq $0x1
popq %rdi
movq %r14, %rsi
callq 0x8cc0
movq %rax, 0x30(%rbp)
testq %rax, %rax
je 0x2c2e2
movq 0x10(%rsp), %r15
xorl %r14d, %r14d
pushq $0x1
popq %rbx
movzbl %r13b, %eax
addq %r12, %rax
cmpq %rax, %r14
jae 0x2baab
movq %r15, %rdi
callq 0x8370
movq 0x30(%rbp), %rcx
movq %rax, (%rcx,%r14,8)
movq 0x38(%rbp), %rax
movq (%rax,%r14,8), %rsi
movq %r15, %rdi
movl %ebx, %edx
callq 0x9150
testl %eax, %eax
jne 0x2bfce
incq %r14
movq 0x10(%rbp), %r12
movb 0x18(%rbp), %r13b
jmp 0x2bc79
movq 0x9b2d1(%rip), %rax     # 0xc6f98
movq (%rax), %rdi
leaq 0x69c59(%rip), %rsi     # 0x9592a
leaq 0x695fb(%rip), %rdx     # 0x952d3
movl $0x2b9, %ecx            # imm = 0x2B9
jmp 0x2be4a
movq 0x38(%rsp), %rbp
jmp 0x2baab
movq 0x9b2a5(%rip), %rax     # 0xc6f98
movq (%rax), %rdi
leaq 0x69c2d(%rip), %rsi     # 0x9592a
leaq 0x695cf(%rip), %rdx     # 0x952d3
movl $0x2c8, %ecx            # imm = 0x2C8
jmp 0x2be4a
movq 0x9b283(%rip), %rax     # 0xc6f98
movq (%rax), %rdi
leaq 0x69c0b(%rip), %rsi     # 0x9592a
leaq 0x695ad(%rip), %rdx     # 0x952d3
movl $0x2c9, %ecx            # imm = 0x2C9
jmp 0x2be4a
movq 0x9b261(%rip), %rax     # 0xc6f98
movq (%rax), %rdi
leaq 0x69be9(%rip), %rsi     # 0x9592a
leaq 0x6958b(%rip), %rdx     # 0x952d3
movl $0x2ca, %ecx            # imm = 0x2CA
jmp 0x2be4a
movq 0x9b23f(%rip), %rax     # 0xc6f98
movq (%rax), %rdi
leaq 0x69bc7(%rip), %rsi     # 0x9592a
leaq 0x69569(%rip), %rdx     # 0x952d3
movl $0x2cc, %ecx            # imm = 0x2CC
jmp 0x2be4a
movq 0x9b21d(%rip), %rax     # 0xc6f98
movq (%rax), %rdi
leaq 0x69ba5(%rip), %rsi     # 0x9592a
leaq 0x69547(%rip), %rdx     # 0x952d3
movl $0x2de, %ecx            # imm = 0x2DE
jmp 0x2be4a
movq 0x9b1fb(%rip), %rax     # 0xc6f98
movq (%rax), %rdi
leaq 0x69b83(%rip), %rsi     # 0x9592a
leaq 0x69525(%rip), %rdx     # 0x952d3
movl $0x2ef, %ecx            # imm = 0x2EF
jmp 0x2be4a
movq 0x9b1d9(%rip), %rax     # 0xc6f98
movq (%rax), %rdi
leaq 0x69b61(%rip), %rsi     # 0x9592a
leaq 0x69503(%rip), %rdx     # 0x952d3
movl $0x2f2, %ecx            # imm = 0x2F2
jmp 0x2be4a
movq 0x9b1ba(%rip), %rax     # 0xc6f98
movq (%rax), %rdi
leaq 0x69b42(%rip), %rsi     # 0x9592a
leaq 0x694e4(%rip), %rdx     # 0x952d3
movl $0x2f6, %ecx            # imm = 0x2F6
jmp 0x2be4a
movq 0x9b19b(%rip), %rax     # 0xc6f98
movq (%rax), %rdi
leaq 0x69b23(%rip), %rsi     # 0x9592a
leaq 0x694c5(%rip), %rdx     # 0x952d3
movl $0x2fa, %ecx            # imm = 0x2FA
jmp 0x2be4a
movq (%rbx), %rdi
leaq 0x69b0b(%rip), %rsi     # 0x9592a
leaq 0x694ad(%rip), %rdx     # 0x952d3
movl $0x313, %ecx            # imm = 0x313
jmp 0x2be4a
movq 0x9b164(%rip), %rax     # 0xc6f98
movq (%rax), %rdi
leaq 0x69aec(%rip), %rsi     # 0x9592a
leaq 0x6948e(%rip), %rdx     # 0x952d3
movl $0x319, %ecx            # imm = 0x319
xorl %eax, %eax
callq 0x8290
leaq 0x6a030(%rip), %rdi     # 0x95e88
leaq 0x69474(%rip), %rsi     # 0x952d3
leaq 0x69c5b(%rip), %rcx     # 0x95ac1
movl $0x35b, %edx            # imm = 0x35B
callq 0x8240
movl %ebx, %r14d
movq 0x9b11e(%rip), %rbx     # 0xc6f98
movq (%rbx), %rdi
leaq 0x69b49(%rip), %rsi     # 0x959cd
xorl %eax, %eax
callq 0x8290
xorl %eax, %eax
cmpb $0x34, 0x69(%rbp)
setae %al
leal (%rax,%rax), %ecx
addb $0x32, %cl
movb %cl, 0x69(%rbp)
movq (%rbx), %rdi
movl %r14d, %ebx
leal 0x32(,%rax,2), %edx
leaq 0x69b6f(%rip), %rsi     # 0x95a20
xorl %eax, %eax
callq 0x8290
jmp 0x2b2ea
movq (%rbx), %rdi
leaq 0x69a63(%rip), %rsi     # 0x9592a
leaq 0x69405(%rip), %rdx     # 0x952d3
movl $0x32d, %ecx            # imm = 0x32D
xorl %eax, %eax
callq 0x8290
jmp 0x2ba99
movq 0x9b0b2(%rip), %rax     # 0xc6f98
movq (%rax), %rsi
leaq 0x69b56(%rip), %rdi     # 0x95a46
callq 0x8470
jmp 0x2b492
movq 0x9b097(%rip), %rbx     # 0xc6f98
movq (%rbx), %rsi
leaq 0x6a2cb(%rip), %rdi     # 0x961d6
jmp 0x2bf6f
leaq 0x6a476(%rip), %rdi     # 0x9638a
callq 0x83f0
movq 0x9b078(%rip), %rbx     # 0xc6f98
jmp 0x2ba80
movq 0x9b06c(%rip), %rbx     # 0xc6f98
movq (%rbx), %rsi
leaq 0x6a531(%rip), %rdi     # 0x96467
jmp 0x2bfb6
movq 0x9b059(%rip), %rbx     # 0xc6f98
movq (%rbx), %rsi
leaq 0x6a561(%rip), %rdi     # 0x964aa
jmp 0x2bfb6
movq 0x9b046(%rip), %rbx     # 0xc6f98
movq (%rbx), %rsi
leaq 0x6a2bf(%rip), %rdi     # 0x9621b
jmp 0x2bf6f
movq 0x9b033(%rip), %rbx     # 0xc6f98
movq (%rbx), %rsi
leaq 0x6a2ee(%rip), %rdi     # 0x9625d
callq 0x8470
jmp 0x2ba80
movq 0x9b018(%rip), %rbx     # 0xc6f98
movq (%rbx), %rdi
leaq 0x6a3b7(%rip), %rsi     # 0x96341
movl %r12d, %edx
jmp 0x2ba74
movq 0x9afff(%rip), %rbx     # 0xc6f98
movq (%rbx), %rsi
leaq 0x6a42e(%rip), %rdi     # 0x963d1
jmp 0x2bfb6
movq 0x9afec(%rip), %rbx     # 0xc6f98
movq (%rbx), %rsi
leaq 0x6a460(%rip), %rdi     # 0x96416
callq 0x8470
movq (%r13), %rdi
callq 0x8270
andq $0x0, (%r13)
jmp 0x2ba80
movq 0x9afc3(%rip), %rax     # 0xc6f98
movq (%rax), %rdi
leaq 0x6a126(%rip), %rsi     # 0x96105
movq %r14, %rdx
xorl %eax, %eax
callq 0x8290
leaq 0x69292(%rip), %rdi     # 0x95282
callq 0x83f0
jmp 0x2be51
movq 0x9af97(%rip), %rax     # 0xc6f98
movq (%rax), %rdi
leaq 0x6991f(%rip), %rsi     # 0x9592a
leaq 0x692c1(%rip), %rdx     # 0x952d3
movl $0x347, %ecx            # imm = 0x347
jmp 0x2be4a
movq 0x9af75(%rip), %rax     # 0xc6f98
movq (%rax), %rbx
callq 0x8ea0
movl (%rax), %ebp
movl %ebp, %edi
callq 0x8b70
movq %rax, (%rsp)
leaq 0x69ae2(%rip), %rsi     # 0x95b21
leaq 0x6928d(%rip), %rcx     # 0x952d3
movl $0x300, %r8d            # imm = 0x300
movq %rbx, %rdi
movq %r13, %rdx
movl %ebp, %r9d
xorl %eax, %eax
callq 0x8290
pushq $0x1
popq %rdi
callq 0x8950
leaq 0x69a36(%rip), %rdi     # 0x95aa1
leaq 0x69261(%rip), %rsi     # 0x952d3
leaq 0x69a48(%rip), %rcx     # 0x95ac1
movl $0x300, %edx            # imm = 0x300
callq 0x8240
movq 0x9af0e(%rip), %rax     # 0xc6f98
movq (%rax), %r14
movq 0x38(%rbp), %rax
movq (%rax,%rbx,8), %rbx
callq 0x8ea0
movl (%rax), %ebp
movl %ebp, %edi
callq 0x8b70
movq %rax, (%rsp)
leaq 0x69f30(%rip), %rsi     # 0x95fde
leaq 0x6921e(%rip), %rcx     # 0x952d3
movl $0x346, %r8d            # imm = 0x346
movq %r14, %rdi
movq %rbx, %rdx
jmp 0x2c052
leaq 0x69eef(%rip), %rdi     # 0x95fb9
leaq 0x69202(%rip), %rsi     # 0x952d3
leaq 0x699e9(%rip), %rcx     # 0x95ac1
movl $0x346, %edx            # imm = 0x346
callq 0x8240
leaq 0x69b4c(%rip), %rdi     # 0x95c35
leaq 0x691e3(%rip), %rsi     # 0x952d3
leaq 0x699ca(%rip), %rcx     # 0x95ac1
movl $0x315, %edx            # imm = 0x315
callq 0x8240
movq (%rbx), %rbx
callq 0x8ea0
movl (%rax), %ebp
movl %ebp, %edi
callq 0x8b70
movq %rax, (%rsp)
leaq 0x69b2c(%rip), %rsi     # 0x95c49
leaq 0x691af(%rip), %rcx     # 0x952d3
movl $0x315, %r8d            # imm = 0x315
jmp 0x2c17b
leaq 0x69b87(%rip), %rdi     # 0x95cba
leaq 0x69199(%rip), %rsi     # 0x952d3
leaq 0x69980(%rip), %rcx     # 0x95ac1
movl $0x316, %edx            # imm = 0x316
callq 0x8240
movq 0x9ae46(%rip), %rax     # 0xc6f98
movq (%rax), %rbx
callq 0x8ea0
movl (%rax), %ebp
movl %ebp, %edi
callq 0x8b70
movq %rax, (%rsp)
leaq 0x69b62(%rip), %rsi     # 0x95cd0
leaq 0x6915e(%rip), %rcx     # 0x952d3
movl $0x316, %r8d            # imm = 0x316
movq %rbx, %rdi
movq %r14, %rdx
jmp 0x2c052
leaq 0x69bb6(%rip), %rdi     # 0x95d43
leaq 0x6913f(%rip), %rsi     # 0x952d3
leaq 0x69926(%rip), %rcx     # 0x95ac1
movl $0x324, %edx            # imm = 0x324
callq 0x8240
movq 0x9adec(%rip), %rax     # 0xc6f98
movq (%rax), %rbx
callq 0x8ea0
movl (%rax), %ebp
movl %ebp, %edi
callq 0x8b70
movq %rax, (%rsp)
leaq 0x69b91(%rip), %rsi     # 0x95d59
leaq 0x69104(%rip), %rcx     # 0x952d3
movl $0x324, %r8d            # imm = 0x324
movq %rbx, %rdi
movq %r12, %rdx
jmp 0x2c052
movq 0x9adb1(%rip), %rax     # 0xc6f98
movq (%rax), %rbx
callq 0x8ea0
movl (%rax), %ebp
movl %ebp, %edi
callq 0x8b70
movq %rax, (%rsp)
leaq 0x69bc9(%rip), %rsi     # 0x95dcc
leaq 0x690c9(%rip), %rcx     # 0x952d3
movl $0x32c, %r8d            # imm = 0x32C
movq %rbx, %rdi
movq %r15, %rdx
jmp 0x2c052
leaq 0x69c75(%rip), %rdi     # 0x95e97
leaq 0x690aa(%rip), %rsi     # 0x952d3
leaq 0x69891(%rip), %rcx     # 0x95ac1
movl $0x33c, %edx            # imm = 0x33C
callq 0x8240
movq 0x9ad57(%rip), %rax     # 0xc6f98
movq (%rax), %rbx
callq 0x8ea0
movl (%rax), %ebp
movl %ebp, %edi
callq 0x8b70
movq %rax, (%rsp)
leaq 0x69c51(%rip), %rsi     # 0x95eae
leaq 0x6906f(%rip), %rcx     # 0x952d3
movl $0x33c, %r8d            # imm = 0x33C
jmp 0x2c17b
leaq 0x69cac(%rip), %rdi     # 0x95f22
leaq 0x69056(%rip), %rsi     # 0x952d3
leaq 0x6983d(%rip), %rcx     # 0x95ac1
movl $0x343, %edx            # imm = 0x343
callq 0x8240
leaq 0x69dcb(%rip), %rdi     # 0x96060
leaq 0x69037(%rip), %rsi     # 0x952d3
leaq 0x6981e(%rip), %rcx     # 0x95ac1
movl $0x34c, %edx            # imm = 0x34C
callq 0x8240
movq 0x9ace4(%rip), %rax     # 0xc6f98
movq (%rax), %rbx
callq 0x8ea0
movl (%rax), %ebp
movl %ebp, %edi
callq 0x8b70
movq %rax, (%rsp)
leaq 0x69c6f(%rip), %rsi     # 0x95f3f
leaq 0x68ffc(%rip), %rcx     # 0x952d3
movl $0x343, %r8d            # imm = 0x343
jmp 0x2c17b
movq 0x9acaf(%rip), %rax     # 0xc6f98
movq (%rax), %rbx
callq 0x8ea0
movl (%rax), %ebp
movl %ebp, %edi
callq 0x8b70
movq %rax, (%rsp)
leaq 0x69d7f(%rip), %rsi     # 0x96084
leaq 0x68fc7(%rip), %rcx     # 0x952d3
movl $0x34c, %r8d            # imm = 0x34C
jmp 0x2c17b