// File: /workspace/github_c_makefile_star2_O0/joncampbell123[P]swfhax/c4_swf2svg.c
// Function: do_dump_shape
static void do_dump_shape(swf_reader *swf,swf_DefineShape *nfo,unsigned int tag_code,FILE *fp) {
#define MAX_VERTICES 65536
	swf_FILLSTYLEARRAY_entry *fstable=NULL;
	swf_LINESTYLEARRAY_entry *lstable=NULL;
	swf_vertex *vertices=NULL,*cv,*nv,*ev,vstate;
	size_t fstable_base=0,lstable_base=0;
	size_t fstable_len=0,lstable_len=0;
	swf_FILLSTYLEARRAY_read fsnfo;
	swf_LINESTYLEARRAY_read lsnfo;
	swf_SHAPE_reading r;
	int vertex_alloc=0;
	int pos_x,pos_y;
	unsigned int i;

	vertices = (swf_vertex*)malloc(sizeof(swf_vertex) * MAX_VERTICES);
	if (vertices == NULL) goto end;
	vertex_alloc = 0;

	memset(&vstate,0,sizeof(vstate));
	vstate.same_as = -1;

	if (swf_reader_read_FILLSTYLEARRAY_header(swf,&fsnfo,tag_code)) goto end;
	fstable_len = fsnfo.FillStyleCount;
	if (fsnfo.FillStyleCount != 0) {
		fstable = (swf_FILLSTYLEARRAY_entry*)malloc(sizeof(swf_FILLSTYLEARRAY_entry) * fsnfo.FillStyleCount);
		assert(fstable != NULL);
		for (i=0;i < fsnfo.FillStyleCount;i++) {
			if (swf_reader_read_FILLSTYLE(swf,&fsnfo)) goto end;
			fstable[i].FillStyleType = fsnfo.FillStyleType;
			fstable[i].fsinfo = fsnfo.fsinfo;
		}
	}

	if (swf_reader_read_LINESTYLEARRAY_header(swf,&lsnfo,tag_code)) goto end;
	lstable_len = lsnfo.LineStyleCount;
	if (lsnfo.LineStyleCount != 0) {
		lstable = (swf_LINESTYLEARRAY_entry*)malloc(sizeof(swf_LINESTYLEARRAY_entry) * lsnfo.LineStyleCount);
		assert(lstable != NULL);

		if (tag_code == swftag_DefineShape4) {
			for (i=0;i < lsnfo.LineStyleCount;i++) {
				if (swf_reader_read_LINESTYLE2(swf,&lsnfo)) goto end;
				lstable[i].Width = lsnfo.Width;
				lstable[i].Color = lsnfo.Color;
				/* ^TODO: Also Flash 8 additional fields... */
			}
		}
		else {
			for (i=0;i < lsnfo.LineStyleCount;i++) {
				if (swf_reader_read_LINESTYLE(swf,&lsnfo)) goto end;
				lstable[i].Width = lsnfo.Width;
				lstable[i].Color = lsnfo.Color;
			}
		}
	}

	fprintf(fp,"<?xml version=\"1.0\" standalone=\"no\"?>\n");
	fprintf(fp,"<!DOCTYPE svg PUBLIC \"-//W3C//DTD SVG 1.1//EN\" \"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd\">\n");
	fprintf(fp,"<svg width=\"%upx\" height=\"%upx\" viewBox=\"0 0 %u %u\" xmlns=\"http://www.w3.org/2000/svg\" version=\"1.1\">\n",
		(nfo->ShapeBounds.Xmax - nfo->ShapeBounds.Xmin) / SWF_TWIPS_PER_PIXEL,
		(nfo->ShapeBounds.Ymax - nfo->ShapeBounds.Ymin) / SWF_TWIPS_PER_PIXEL,
		nfo->ShapeBounds.Xmax - nfo->ShapeBounds.Xmin,
		nfo->ShapeBounds.Ymax - nfo->ShapeBounds.Ymin);
#if 0
	fprintf(fp,"  <rect x=\"0\" y=\"0\" width=\"%u\" height=\"%u\" fill=\"none\" stroke=\"blue\" stroke-width=\"20\" /><!-- DEBUG BORDERLINE -->\n",
		nfo->ShapeBounds.Xmax - nfo->ShapeBounds.Xmin,
		nfo->ShapeBounds.Ymax - nfo->ShapeBounds.Ymin);
#endif

	pos_x = pos_y = 0;
	if (swf_reader_read_SHAPE_beginning(swf,&r) == 0) {
		while (swf_reader_read_SHAPE_record(swf,&r) == 0) {
			if (r.ShapeRecord_type == swf_shrec_EndShapeRecord) {
				if (vertex_alloc >= MAX_VERTICES) {
					fprintf(stderr,"Uh oh! Too many vertices!\n");
					break;
				}

				cv = vertices + (vertex_alloc++);
				vstate.type = swf_shrec_EndShapeRecord;
				vstate.x = pos_x;
				vstate.y = pos_y;
				*cv = vstate;
				break;
			}

			if (r.ShapeRecord_type == swf_shrec_StraightEdgeRecord ||
				r.ShapeRecord_type == swf_shrec_CurvedEdgeRecord) {
			}

			if (r.ShapeRecord_type == swf_shrec_StraightEdgeRecord) {
				if (vertex_alloc >= MAX_VERTICES) {
					fprintf(stderr,"Uh oh! Too many vertices!\n");
					break;
				}

				cv = vertices + (vertex_alloc++);
				vstate.type = r.ShapeRecord_type;
				vstate.x = pos_x;
				vstate.y = pos_y;
				*cv = vstate;

				pos_x += r.shrec.edge.StraightEdgeRecord.DeltaX;
				pos_y += r.shrec.edge.StraightEdgeRecord.DeltaY;
			}
			else if (r.ShapeRecord_type == swf_shrec_CurvedEdgeRecord) {
				if (vertex_alloc >= MAX_VERTICES) {
					fprintf(stderr,"Uh oh! Too many vertices!\n");
					break;
				}

				cv = vertices + (vertex_alloc++);
				vstate.type = r.ShapeRecord_type;
				vstate.x = pos_x;
				vstate.y = pos_y;

				pos_x += r.shrec.edge.CurvedEdgeRecord.ControlDeltaX;
				pos_y += r.shrec.edge.CurvedEdgeRecord.ControlDeltaY;

				vstate.cx = pos_x;
				vstate.cy = pos_y;

				pos_x += r.shrec.edge.CurvedEdgeRecord.AnchorDeltaX;
				pos_y += r.shrec.edge.CurvedEdgeRecord.AnchorDeltaY;

				*cv = vstate;
			}
			else if (r.ShapeRecord_type == swf_shrec_StyleChangeRecord) {
				if (r.shrec.style.StyleChangeRecord.StateNewStyles) {
					void *np;

#if 0
					fprintf(stderr,"NewStyles in ShapeID %u\n",nfo->ShapeId);
#endif

					if (swf_reader_read_FILLSTYLEARRAY_header(swf,&fsnfo,tag_code)) goto end;
					if (fsnfo.FillStyleCount != 0) {
						fstable_base = fstable_len;
						np = (void*)realloc((void*)fstable,(fstable_len + fsnfo.FillStyleCount) * sizeof(swf_FILLSTYLEARRAY_entry));
						assert(np != NULL);
						fstable = (swf_FILLSTYLEARRAY_entry*)np;
						for (i=0;i < fsnfo.FillStyleCount;i++) {
							if (swf_reader_read_FILLSTYLE(swf,&fsnfo)) goto end;
							fstable[i+fstable_len].FillStyleType = fsnfo.FillStyleType;
							fstable[i+fstable_len].fsinfo = fsnfo.fsinfo;
						}
						fstable_len += fsnfo.FillStyleCount;
					}

					if (swf_reader_read_LINESTYLEARRAY_header(swf,&lsnfo,tag_code)) goto end;
					if (lsnfo.LineStyleCount != 0) {
						lstable_base = lstable_len;
						np = (void*)realloc((void*)lstable,(lstable_len + lsnfo.LineStyleCount) * sizeof(swf_LINESTYLEARRAY_entry));
						assert(np != NULL);
						lstable = (swf_LINESTYLEARRAY_entry*)np;
						if (tag_code == swftag_DefineShape4) {
							for (i=0;i < lsnfo.LineStyleCount;i++) {
								if (swf_reader_read_LINESTYLE2(swf,&lsnfo)) goto end;
								lstable[i+lstable_len].Width = lsnfo.Width;
								lstable[i+lstable_len].Color = lsnfo.Color;
								/* ^TODO: Also Flash 8 additional fields... */
							}
						}
						else {
							for (i=0;i < lsnfo.LineStyleCount;i++) {
								if (swf_reader_read_LINESTYLE(swf,&lsnfo)) goto end;
								lstable[i+lstable_len].Width = lsnfo.Width;
								lstable[i+lstable_len].Color = lsnfo.Color;
							}
						}

						lstable_len += lsnfo.LineStyleCount;
					}

					if (swf_reader_read_SHAPE_beginning(swf,&r)) goto end;
				}
				if (r.shrec.style.StyleChangeRecord.StateLineStyle)
					vstate.LineStyle = r.shrec.style.StyleChangeRecord.LineStyle + lstable_base;
				if (r.shrec.style.StyleChangeRecord.StateFillStyle1)
					vstate.FillStyle[1] = r.shrec.style.StyleChangeRecord.FillStyle1 + fstable_base;
				if (r.shrec.style.StyleChangeRecord.StateFillStyle0)
					vstate.FillStyle[0] = r.shrec.style.StyleChangeRecord.FillStyle0 + fstable_base;
				if (r.shrec.style.StyleChangeRecord.StateMoveTo) {
					if (vertex_alloc >= MAX_VERTICES) {
						fprintf(stderr,"Uh oh! Too many vertices!\n");
						break;
					}

					cv = vertices + (vertex_alloc++);
					vstate.type = swf_shrec_EndShapeRecord;
					vstate.x = pos_x;
					vstate.y = pos_y;
					*cv = vstate;

					pos_x = r.shrec.style.StyleChangeRecord.MoveDeltaX;
					pos_y = r.shrec.style.StyleChangeRecord.MoveDeltaY;
				}
			}
		}
	}

	/* first pass: filled regions, look for duplicated vertices */
	fprintf(fp,"<!-- fill -->\n");
	for (i=0;i < (unsigned int)vertex_alloc;) {
		unsigned int scan;

		cv = vertices + i;
#if 0
		fprintf(fp,"<!-- vertex %u fs0/1=%u/%u %.3f,%.3f type=%u -->\n",i,cv->FillStyle[0],cv->FillStyle[1],
			(double)cv->x / SWF_TWIPS_PER_PIXEL,
			(double)cv->y / SWF_TWIPS_PER_PIXEL,
			cv->type);
#endif
		if (cv->same_as != -1) {
			/* this vertex has already been done */
		}
		else {
			unsigned int mrk = i;

			scan = i+1;
			while (1) {
				if ((size_t)scan >= (size_t)vertex_alloc) scan = 0;
				if (scan == i) break;
				nv = vertices + scan;
				if (nv->same_as != -1) {
				}
				else if (cv->x == nv->x && cv->y == nv->y) {
					nv->same_as = mrk;
					mrk = scan;
					fprintf(fp,"<!-- vertex %u, same place as %u -->\n",
						(unsigned int)scan,(unsigned int)nv->same_as);
				}
				scan++;
			}
		}

		i++; /* next vertex */
	}

	/* first pass: filled regions, trace out regions including implicit closure */
	for (i=0;i < (unsigned int)vertex_alloc;) {
		swf_FILLSTYLEARRAY_entry *fs;
		unsigned int start,end = 0;
		double sum = 0;
		int side;

		start = i;
		fprintf(fp,"<!-- begin scan at vertex %u -->\n",start);
		cv = vertices + (i++);
		nv = vertices + i;
		if (cv->type == swf_shrec_EndShapeRecord) continue;

		/* check: clockwise, or counter-clockwise? */
		while (1) {
			if (cv != (vertices + start) && cv->same_as != -1) {
				end = (unsigned int)(cv - vertices); /* NTS: C++ pointer math, memory addr difference divided by sizeof() */
				break; /* we hit the end vertex */
			}
			if (nv == NULL) break;
			sum += (nv->x - cv->x) * (nv->y + cv->y);

			if ((++i) >= (unsigned int)vertex_alloc) {
				cv = nv;
				nv = NULL;
			}
			else {
				cv = nv;
				nv = vertices + i;
			}
		}
		if (end <= start) continue;

		ev = vertices + end;
		cv = vertices + start;
		side = (sum > 0) ? 0 : 1;

		/* if it's "closed" implicitly then we need to continue scanning */
		/* NTS: "cv" is only set correctly to the ending vertex if end is set */
		fprintf(fp,"<!-- closed region vertex %u to %u sum=%.3f (side=%u) fs0/1=%u/%u -->\n",start,end,sum,side,cv->FillStyle[0],cv->FillStyle[1]);

		if (cv->FillStyle[side] > fstable_len) fprintf(stderr,"WARNING: linestyle out of range\n");
		if (cv->FillStyle[side] == 0) continue;
		fs = fstable + cv->FillStyle[side] - 1;

		if ((unsigned int)ev->same_as != start)
			fprintf(fp,"<!-- ...but region is closed implicitly, need more tracing from %u to %u -->\n",(unsigned int)ev->same_as,start);

		fprintf(fp,"  <path stroke=\"none\" fill=\"");
		if (fs->FillStyleType == swf_fillstyle_solid) {
			fprintf(fp,"rgba(%u,%u,%u,%u)",
					fs->fsinfo.solid.Color.Red,
					fs->fsinfo.solid.Color.Green,
					fs->fsinfo.solid.Color.Blue,
					fs->fsinfo.solid.Color.Alpha);
		}
		else {
			fprintf(fp,"none");
		}
		fprintf(fp,"\" d=\"");
		for (i=start;(i+1) <= end;i++) {
			cv = vertices + i;
			if (side) cv->fillclose1=1;
			else cv->fillclose0=1;
			nv = cv + 1;

			if (i == start)
				fprintf(fp,"M %d %d ",
					cv->x - nfo->ShapeBounds.Xmin,cv->y - nfo->ShapeBounds.Ymin);

			if (cv->type == swf_shrec_StraightEdgeRecord) {
				fprintf(fp,"L %d %d ",nv->x - nfo->ShapeBounds.Xmin,nv->y - nfo->ShapeBounds.Ymin);
			}
			else if (cv->type == swf_shrec_CurvedEdgeRecord) {
				fprintf(fp,"Q %d %d ",cv->cx - nfo->ShapeBounds.Xmin,cv->cy - nfo->ShapeBounds.Ymin);
				fprintf(fp,"%d %d ",nv->x - nfo->ShapeBounds.Xmin,nv->y - nfo->ShapeBounds.Ymin);
			}
		}

		/* if closed implicitly, then search for nearby vertices and edges that have NOT yet
		 * been used to fill a region */
		if ((unsigned int)ev->same_as != start && ev->same_as != -1) {
			cv = vertices + ev->same_as;
			/* TODO */
		}

		fprintf(fp,"\" />\n");

		i = end;
	}

	/* second pass: outlines */
	fprintf(fp,"<!-- outline -->\n");
	for (i=0;(i+1) < (unsigned int)vertex_alloc;) {
		swf_LINESTYLEARRAY_entry *ls;

		cv = vertices + (i++);
		nv = vertices + i;

		if (cv->LineStyle > lstable_len) fprintf(stderr,"WARNING: linestyle out of range\n");
		if (cv->LineStyle == 0 || cv->LineStyle > lstable_len) continue;
		if (cv->type == swf_shrec_EndShapeRecord) continue;
		ls = lstable + cv->LineStyle - 1;
		assert(lstable != NULL);

		fprintf(fp,"<!-- linestyle %u -->\n",cv->LineStyle);
		fprintf(fp,"  <path fill=\"none\" stroke=\"rgba(%u,%u,%u,%u)\" stroke-width=\"%u\" d=\"",
			ls->Color.Red,ls->Color.Green,
			ls->Color.Blue,ls->Color.Alpha,
			ls->Width);
		fprintf(fp,"M %d %d ",cv->x - nfo->ShapeBounds.Xmin,cv->y - nfo->ShapeBounds.Ymin);

		do {
			if (cv->type == swf_shrec_StraightEdgeRecord)
				fprintf(fp,"L %d %d ",nv->x - nfo->ShapeBounds.Xmin,nv->y - nfo->ShapeBounds.Ymin);
			else
				fprintf(fp,"Q %d %d %d %d ",cv->cx - nfo->ShapeBounds.Xmin,cv->cy - nfo->ShapeBounds.Ymin,
					nv->x - nfo->ShapeBounds.Xmin,nv->y - nfo->ShapeBounds.Ymin);

			cv = nv;
			if (cv->type == swf_shrec_EndShapeRecord) break;
			if (i >= MAX_VERTICES) break;
			nv = vertices + (i+1);
			if (cv->LineStyle != nv->LineStyle) break;
			i++;
		} while (1);

		fprintf(fp,"\" />\n");
	}

	fprintf(fp,"</svg>\n");

end:	if (lstable) free(lstable);
	if (fstable) free(fstable);
	if (vertices) free(vertices);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x230, %rsp            # imm = 0x230
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
movq %rcx, -0x20(%rbp)
movq $0x0, -0x28(%rbp)
movq $0x0, -0x30(%rbp)
movq $0x0, -0x38(%rbp)
movq $0x0, -0x88(%rbp)
movq $0x0, -0x90(%rbp)
movq $0x0, -0x98(%rbp)
movq $0x0, -0xa0(%rbp)
movl $0x0, -0x1dc(%rbp)
movl $0x300000, %edi         # imm = 0x300000
callq 0x1120
movq %rax, -0x38(%rbp)
cmpq $0x0, -0x38(%rbp)
jne 0x2782
jmp 0x3aab
movl $0x0, -0x1dc(%rbp)
leaq -0x80(%rbp), %rdi
xorl %esi, %esi
movl $0x30, %edx
callq 0x1090
movq $-0x1, -0x60(%rbp)
movq -0x8(%rbp), %rdi
movl -0x14(%rbp), %edx
leaq -0x120(%rbp), %rsi
callq 0x6280
cmpl $0x0, %eax
je 0x27c1
jmp 0x3aab
movzwl -0x11e(%rbp), %eax
movq %rax, -0x98(%rbp)
movzwl -0x11e(%rbp), %eax
cmpl $0x0, %eax
je 0x28a6
movzwl -0x11e(%rbp), %eax
imulq $0x74, %rax, %rdi
callq 0x1120
movq %rax, -0x28(%rbp)
cmpq $0x0, -0x28(%rbp)
je 0x27fc
jmp 0x281b
leaq 0x6e98(%rip), %rdi      # 0x969b
leaq 0x6be8(%rip), %rsi      # 0x93f2
movl $0x177, %edx            # imm = 0x177
leaq 0x6e95(%rip), %rcx      # 0x96ab
callq 0x1080
movl $0x0, -0x1e8(%rbp)
movl -0x1e8(%rbp), %eax
movzwl -0x11e(%rbp), %ecx
cmpl %ecx, %eax
jae 0x28a4
movq -0x8(%rbp), %rdi
leaq -0x120(%rbp), %rsi
callq 0x65a0
cmpl $0x0, %eax
je 0x2850
jmp 0x3aab
movb -0x11c(%rbp), %cl
movq -0x28(%rbp), %rax
movl -0x1e8(%rbp), %edx
imulq $0x74, %rdx, %rdx
addq %rdx, %rax
movb %cl, (%rax)
movq -0x28(%rbp), %rdi
movl -0x1e8(%rbp), %eax
imulq $0x74, %rax, %rax
addq %rax, %rdi
addq $0x4, %rdi
leaq -0x120(%rbp), %rsi
addq $0x10, %rsi
movl $0x70, %edx
callq 0x10e0
movl -0x1e8(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1e8(%rbp)
jmp 0x2825
jmp 0x28a6
movq -0x8(%rbp), %rdi
movl -0x14(%rbp), %edx
leaq -0x1b0(%rbp), %rsi
callq 0x6820
cmpl $0x0, %eax
je 0x28c3
jmp 0x3aab
movzwl -0x1ae(%rbp), %eax
movq %rax, -0xa0(%rbp)
movzwl -0x1ae(%rbp), %eax
cmpl $0x0, %eax
je 0x2a1f
movzwl -0x1ae(%rbp), %eax
imulq $0x6, %rax, %rdi
callq 0x1120
movq %rax, -0x30(%rbp)
cmpq $0x0, -0x30(%rbp)
je 0x28fe
jmp 0x291d
leaq 0x6df0(%rip), %rdi      # 0x96f5
leaq 0x6ae6(%rip), %rsi      # 0x93f2
movl $0x183, %edx            # imm = 0x183
leaq 0x6d93(%rip), %rcx      # 0x96ab
callq 0x1080
cmpl $0x53, -0x14(%rbp)
jne 0x29a0
movl $0x0, -0x1e8(%rbp)
movl -0x1e8(%rbp), %eax
movzwl -0x1ae(%rbp), %ecx
cmpl %ecx, %eax
jae 0x299e
movq -0x8(%rbp), %rdi
leaq -0x1b0(%rbp), %rsi
callq 0x6370
cmpl $0x0, %eax
je 0x2958
jmp 0x3aab
movw -0x1ac(%rbp), %cx
movq -0x30(%rbp), %rax
movl -0x1e8(%rbp), %edx
imulq $0x6, %rdx, %rdx
addq %rdx, %rax
movw %cx, (%rax)
movq -0x30(%rbp), %rax
movl -0x1e8(%rbp), %ecx
imulq $0x6, %rcx, %rcx
addq %rcx, %rax
movl -0x1aa(%rbp), %ecx
movl %ecx, 0x2(%rax)
movl -0x1e8(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1e8(%rbp)
jmp 0x292d
jmp 0x2a1d
movl $0x0, -0x1e8(%rbp)
movl -0x1e8(%rbp), %eax
movzwl -0x1ae(%rbp), %ecx
cmpl %ecx, %eax
jae 0x2a1b
movq -0x8(%rbp), %rdi
leaq -0x1b0(%rbp), %rsi
callq 0x6310
cmpl $0x0, %eax
je 0x29d5
jmp 0x3aab
movw -0x1ac(%rbp), %cx
movq -0x30(%rbp), %rax
movl -0x1e8(%rbp), %edx
imulq $0x6, %rdx, %rdx
addq %rdx, %rax
movw %cx, (%rax)
movq -0x30(%rbp), %rax
movl -0x1e8(%rbp), %ecx
imulq $0x6, %rcx, %rcx
addq %rcx, %rax
movl -0x1aa(%rbp), %ecx
movl %ecx, 0x2(%rax)
movl -0x1e8(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1e8(%rbp)
jmp 0x29aa
jmp 0x2a1d
jmp 0x2a1f
movq -0x20(%rbp), %rdi
leaq 0x65da(%rip), %rsi      # 0x9004
movb $0x0, %al
callq 0x10d0
movq -0x20(%rbp), %rdi
leaq 0x65ef(%rip), %rsi      # 0x902b
movb $0x0, %al
callq 0x10d0
movq -0x20(%rbp), %rdi
movq -0x10(%rbp), %rax
movl 0xc(%rax), %eax
movq -0x10(%rbp), %rcx
subl 0x8(%rcx), %eax
movl $0x14, %ecx
cltd
idivl %ecx
movl %eax, -0x224(%rbp)
movq -0x10(%rbp), %rax
movl 0x14(%rax), %eax
movq -0x10(%rbp), %rcx
subl 0x10(%rcx), %eax
movl $0x14, %ecx
cltd
idivl %ecx
movl -0x224(%rbp), %edx
movl %eax, %ecx
movq -0x10(%rbp), %rax
movl 0xc(%rax), %r8d
movq -0x10(%rbp), %rax
subl 0x8(%rax), %r8d
movq -0x10(%rbp), %rax
movl 0x14(%rax), %r9d
movq -0x10(%rbp), %rax
subl 0x10(%rax), %r9d
leaq 0x65e7(%rip), %rsi      # 0x908f
movb $0x0, %al
callq 0x10d0
movl $0x0, -0x1e4(%rbp)
movl $0x0, -0x1e0(%rbp)
movq -0x8(%rbp), %rdi
leaq -0x1d8(%rbp), %rsi
callq 0x59c0
cmpl $0x0, %eax
jne 0x31b1
jmp 0x2ade
movq -0x8(%rbp), %rdi
leaq -0x1d8(%rbp), %rsi
callq 0x5a40
cmpl $0x0, %eax
jne 0x31af
movzbl -0x1c8(%rbp), %eax
cmpl $0x0, %eax
jne 0x2b7c
cmpl $0x10000, -0x1dc(%rbp)  # imm = 0x10000
jl 0x2b2c
movq 0xa4e2(%rip), %rax      # 0xcff8
movq (%rax), %rdi
leaq 0x6be5(%rip), %rsi      # 0x9705
movb $0x0, %al
callq 0x10d0
jmp 0x31af
movq -0x38(%rbp), %rax
movl -0x1dc(%rbp), %ecx
movl %ecx, %edx
addl $0x1, %edx
movl %edx, -0x1dc(%rbp)
movslq %ecx, %rcx
imulq $0x30, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0x40(%rbp)
movb $0x0, -0x80(%rbp)
movl -0x1e0(%rbp), %eax
movl %eax, -0x7c(%rbp)
movl -0x1e4(%rbp), %eax
movl %eax, -0x78(%rbp)
movq -0x40(%rbp), %rdi
leaq -0x80(%rbp), %rsi
movl $0x30, %edx
callq 0x10e0
jmp 0x31af
movzbl -0x1c8(%rbp), %eax
cmpl $0x2, %eax
je 0x2b94
movzbl -0x1c8(%rbp), %eax
cmpl $0x3, %eax
jne 0x2b96
jmp 0x2b96
movzbl -0x1c8(%rbp), %eax
cmpl $0x2, %eax
jne 0x2c48
cmpl $0x10000, -0x1dc(%rbp)  # imm = 0x10000
jl 0x2bcf
movq 0xa43f(%rip), %rax      # 0xcff8
movq (%rax), %rdi
leaq 0x6b42(%rip), %rsi      # 0x9705
movb $0x0, %al
callq 0x10d0
jmp 0x31af
movq -0x38(%rbp), %rax
movl -0x1dc(%rbp), %ecx
movl %ecx, %edx
addl $0x1, %edx
movl %edx, -0x1dc(%rbp)
movslq %ecx, %rcx
imulq $0x30, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0x40(%rbp)
movb -0x1c8(%rbp), %al
movb %al, -0x80(%rbp)
movl -0x1e0(%rbp), %eax
movl %eax, -0x7c(%rbp)
movl -0x1e4(%rbp), %eax
movl %eax, -0x78(%rbp)
movq -0x40(%rbp), %rdi
leaq -0x80(%rbp), %rsi
movl $0x30, %edx
callq 0x10e0
movl -0x1c0(%rbp), %eax
addl -0x1e0(%rbp), %eax
movl %eax, -0x1e0(%rbp)
movl -0x1bc(%rbp), %eax
addl -0x1e4(%rbp), %eax
movl %eax, -0x1e4(%rbp)
jmp 0x31aa
movzbl -0x1c8(%rbp), %eax
cmpl $0x3, %eax
jne 0x2d30
cmpl $0x10000, -0x1dc(%rbp)  # imm = 0x10000
jl 0x2c81
movq 0xa38d(%rip), %rax      # 0xcff8
movq (%rax), %rdi
leaq 0x6a90(%rip), %rsi      # 0x9705
movb $0x0, %al
callq 0x10d0
jmp 0x31af
movq -0x38(%rbp), %rax
movl -0x1dc(%rbp), %ecx
movl %ecx, %edx
addl $0x1, %edx
movl %edx, -0x1dc(%rbp)
movslq %ecx, %rcx
imulq $0x30, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0x40(%rbp)
movb -0x1c8(%rbp), %al
movb %al, -0x80(%rbp)
movl -0x1e0(%rbp), %eax
movl %eax, -0x7c(%rbp)
movl -0x1e4(%rbp), %eax
movl %eax, -0x78(%rbp)
movl -0x1c0(%rbp), %eax
addl -0x1e0(%rbp), %eax
movl %eax, -0x1e0(%rbp)
movl -0x1bc(%rbp), %eax
addl -0x1e4(%rbp), %eax
movl %eax, -0x1e4(%rbp)
movl -0x1e0(%rbp), %eax
movl %eax, -0x74(%rbp)
movl -0x1e4(%rbp), %eax
movl %eax, -0x70(%rbp)
movl -0x1b8(%rbp), %eax
addl -0x1e0(%rbp), %eax
movl %eax, -0x1e0(%rbp)
movl -0x1b4(%rbp), %eax
addl -0x1e4(%rbp), %eax
movl %eax, -0x1e4(%rbp)
movq -0x40(%rbp), %rdi
leaq -0x80(%rbp), %rsi
movl $0x30, %edx
callq 0x10e0
jmp 0x31a8
movzbl -0x1c8(%rbp), %eax
cmpl $0x1, %eax
jne 0x31a6
movw -0x1c4(%rbp), %ax
andw $0x1, %ax
movzwl %ax, %eax
cmpl $0x0, %eax
je 0x3086
movq -0x8(%rbp), %rdi
movl -0x14(%rbp), %edx
leaq -0x120(%rbp), %rsi
callq 0x6280
cmpl $0x0, %eax
je 0x2d74
jmp 0x3aab
movzwl -0x11e(%rbp), %eax
cmpl $0x0, %eax
je 0x2e9c
movq -0x98(%rbp), %rax
movq %rax, -0x88(%rbp)
movq -0x28(%rbp), %rdi
movq -0x98(%rbp), %rax
movzwl -0x11e(%rbp), %ecx
addq %rcx, %rax
imulq $0x74, %rax, %rsi
callq 0x1130
movq %rax, -0x1f0(%rbp)
cmpq $0x0, -0x1f0(%rbp)
je 0x2dc3
jmp 0x2de2
leaq 0x6956(%rip), %rdi      # 0x9720
leaq 0x6621(%rip), %rsi      # 0x93f2
movl $0x1e9, %edx            # imm = 0x1E9
leaq 0x68ce(%rip), %rcx      # 0x96ab
callq 0x1080
movq -0x1f0(%rbp), %rax
movq %rax, -0x28(%rbp)
movl $0x0, -0x1e8(%rbp)
movl -0x1e8(%rbp), %eax
movzwl -0x11e(%rbp), %ecx
cmpl %ecx, %eax
jae 0x2e87
movq -0x8(%rbp), %rdi
leaq -0x120(%rbp), %rsi
callq 0x65a0
cmpl $0x0, %eax
je 0x2e22
jmp 0x3aab
movb -0x11c(%rbp), %cl
movq -0x28(%rbp), %rax
movl -0x1e8(%rbp), %edx
addq -0x98(%rbp), %rdx
imulq $0x74, %rdx, %rdx
addq %rdx, %rax
movb %cl, (%rax)
movq -0x28(%rbp), %rdi
movl -0x1e8(%rbp), %eax
addq -0x98(%rbp), %rax
imulq $0x74, %rax, %rax
addq %rax, %rdi
addq $0x4, %rdi
leaq -0x120(%rbp), %rsi
addq $0x10, %rsi
movl $0x70, %edx
callq 0x10e0
movl -0x1e8(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1e8(%rbp)
jmp 0x2df7
movzwl -0x11e(%rbp), %eax
addq -0x98(%rbp), %rax
movq %rax, -0x98(%rbp)
movq -0x8(%rbp), %rdi
movl -0x14(%rbp), %edx
leaq -0x1b0(%rbp), %rsi
callq 0x6820
cmpl $0x0, %eax
je 0x2eb9
jmp 0x3aab
movzwl -0x1ae(%rbp), %eax
cmpl $0x0, %eax
je 0x306a
movq -0xa0(%rbp), %rax
movq %rax, -0x90(%rbp)
movq -0x30(%rbp), %rdi
movq -0xa0(%rbp), %rax
movzwl -0x1ae(%rbp), %ecx
addq %rcx, %rax
imulq $0x6, %rax, %rsi
callq 0x1130
movq %rax, -0x1f0(%rbp)
cmpq $0x0, -0x1f0(%rbp)
je 0x2f08
jmp 0x2f27
leaq 0x6811(%rip), %rdi      # 0x9720
leaq 0x64dc(%rip), %rsi      # 0x93f2
movl $0x1f7, %edx            # imm = 0x1F7
leaq 0x6789(%rip), %rcx      # 0x96ab
callq 0x1080
movq -0x1f0(%rbp), %rax
movq %rax, -0x30(%rbp)
cmpl $0x53, -0x14(%rbp)
jne 0x2fca
movl $0x0, -0x1e8(%rbp)
movl -0x1e8(%rbp), %eax
movzwl -0x1ae(%rbp), %ecx
cmpl %ecx, %eax
jae 0x2fc5
movq -0x8(%rbp), %rdi
leaq -0x1b0(%rbp), %rsi
callq 0x6370
cmpl $0x0, %eax
je 0x2f71
jmp 0x3aab
movw -0x1ac(%rbp), %cx
movq -0x30(%rbp), %rax
movl -0x1e8(%rbp), %edx
addq -0xa0(%rbp), %rdx
imulq $0x6, %rdx, %rdx
addq %rdx, %rax
movw %cx, (%rax)
movq -0x30(%rbp), %rax
movl -0x1e8(%rbp), %ecx
addq -0xa0(%rbp), %rcx
imulq $0x6, %rcx, %rcx
addq %rcx, %rax
movl -0x1aa(%rbp), %ecx
movl %ecx, 0x2(%rax)
movl -0x1e8(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1e8(%rbp)
jmp 0x2f46
jmp 0x3055
movl $0x0, -0x1e8(%rbp)
movl -0x1e8(%rbp), %eax
movzwl -0x1ae(%rbp), %ecx
cmpl %ecx, %eax
jae 0x3053
movq -0x8(%rbp), %rdi
leaq -0x1b0(%rbp), %rsi
callq 0x6310
cmpl $0x0, %eax
je 0x2fff
jmp 0x3aab
movw -0x1ac(%rbp), %cx
movq -0x30(%rbp), %rax
movl -0x1e8(%rbp), %edx
addq -0xa0(%rbp), %rdx
imulq $0x6, %rdx, %rdx
addq %rdx, %rax
movw %cx, (%rax)
movq -0x30(%rbp), %rax
movl -0x1e8(%rbp), %ecx
addq -0xa0(%rbp), %rcx
imulq $0x6, %rcx, %rcx
addq %rcx, %rax
movl -0x1aa(%rbp), %ecx
movl %ecx, 0x2(%rax)
movl -0x1e8(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1e8(%rbp)
jmp 0x2fd4
jmp 0x3055
movzwl -0x1ae(%rbp), %eax
addq -0xa0(%rbp), %rax
movq %rax, -0xa0(%rbp)
movq -0x8(%rbp), %rdi
leaq -0x1d8(%rbp), %rsi
callq 0x59c0
cmpl $0x0, %eax
je 0x3084
jmp 0x3aab
jmp 0x3086
movw -0x1c4(%rbp), %ax
shrw %ax
andw $0x1, %ax
movzwl %ax, %eax
cmpl $0x0, %eax
je 0x30ae
movzwl -0x1b4(%rbp), %eax
addq -0x90(%rbp), %rax
movw %ax, -0x6c(%rbp)
movw -0x1c4(%rbp), %ax
shrw $0x2, %ax
andw $0x1, %ax
movzwl %ax, %eax
cmpl $0x0, %eax
je 0x30d7
movzwl -0x1b6(%rbp), %eax
addq -0x88(%rbp), %rax
movw %ax, -0x68(%rbp)
movw -0x1c4(%rbp), %ax
shrw $0x3, %ax
andw $0x1, %ax
movzwl %ax, %eax
cmpl $0x0, %eax
je 0x3100
movzwl -0x1b8(%rbp), %eax
addq -0x88(%rbp), %rax
movw %ax, -0x6a(%rbp)
movw -0x1c4(%rbp), %ax
shrw $0x4, %ax
andw $0x1, %ax
movzwl %ax, %eax
cmpl $0x0, %eax
je 0x31a4
cmpl $0x10000, -0x1dc(%rbp)  # imm = 0x10000
jl 0x3141
movq 0x9eca(%rip), %rax      # 0xcff8
movq (%rax), %rdi
leaq 0x65cd(%rip), %rsi      # 0x9705
movb $0x0, %al
callq 0x10d0
jmp 0x31af
movq -0x38(%rbp), %rax
movl -0x1dc(%rbp), %ecx
movl %ecx, %edx
addl $0x1, %edx
movl %edx, -0x1dc(%rbp)
movslq %ecx, %rcx
imulq $0x30, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0x40(%rbp)
movb $0x0, -0x80(%rbp)
movl -0x1e0(%rbp), %eax
movl %eax, -0x7c(%rbp)
movl -0x1e4(%rbp), %eax
movl %eax, -0x78(%rbp)
movq -0x40(%rbp), %rdi
leaq -0x80(%rbp), %rsi
movl $0x30, %edx
callq 0x10e0
movl -0x1c0(%rbp), %eax
movl %eax, -0x1e0(%rbp)
movl -0x1bc(%rbp), %eax
movl %eax, -0x1e4(%rbp)
jmp 0x31a6
jmp 0x31a8
jmp 0x31aa
jmp 0x2ade
jmp 0x31b1
movq -0x20(%rbp), %rdi
leaq 0x656f(%rip), %rsi      # 0x972b
movb $0x0, %al
callq 0x10d0
movl $0x0, -0x1e8(%rbp)
movl -0x1e8(%rbp), %eax
cmpl -0x1dc(%rbp), %eax
jae 0x32fa
movq -0x38(%rbp), %rax
movl -0x1e8(%rbp), %ecx
imulq $0x30, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0x40(%rbp)
movq -0x40(%rbp), %rax
cmpq $-0x1, 0x20(%rax)
je 0x3204
jmp 0x32e6
movl -0x1e8(%rbp), %eax
movl %eax, -0x1f8(%rbp)
movl -0x1e8(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1f4(%rbp)
movl -0x1f4(%rbp), %eax
movslq -0x1dc(%rbp), %rcx
cmpq %rcx, %rax
jb 0x323b
movl $0x0, -0x1f4(%rbp)
movl -0x1f4(%rbp), %eax
cmpl -0x1e8(%rbp), %eax
jne 0x324e
jmp 0x32e4
movq -0x38(%rbp), %rax
movl -0x1f4(%rbp), %ecx
imulq $0x30, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0x48(%rbp)
movq -0x48(%rbp), %rax
cmpq $-0x1, 0x20(%rax)
je 0x3270
jmp 0x32d0
movq -0x40(%rbp), %rax
movl 0x4(%rax), %eax
movq -0x48(%rbp), %rcx
cmpl 0x4(%rcx), %eax
jne 0x32ce
movq -0x40(%rbp), %rax
movl 0x8(%rax), %eax
movq -0x48(%rbp), %rcx
cmpl 0x8(%rcx), %eax
jne 0x32ce
movl -0x1f8(%rbp), %eax
movl %eax, %ecx
movq -0x48(%rbp), %rax
movq %rcx, 0x20(%rax)
movl -0x1f4(%rbp), %eax
movl %eax, -0x1f8(%rbp)
movq -0x20(%rbp), %rdi
movl -0x1f4(%rbp), %edx
movq -0x48(%rbp), %rax
movq 0x20(%rax), %rax
movl %eax, %ecx
leaq 0x6473(%rip), %rsi      # 0x973a
movb $0x0, %al
callq 0x10d0
jmp 0x32d0
movl -0x1f4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1f4(%rbp)
jmp 0x321f
jmp 0x32e6
movl -0x1e8(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1e8(%rbp)
jmp 0x31cd
movl $0x0, -0x1e8(%rbp)
movl -0x1e8(%rbp), %eax
cmpl -0x1dc(%rbp), %eax
jae 0x37e6
movl $0x0, -0x208(%rbp)
xorps %xmm0, %xmm0
movsd %xmm0, -0x210(%rbp)
movl -0x1e8(%rbp), %eax
movl %eax, -0x204(%rbp)
movq -0x20(%rbp), %rdi
movl -0x204(%rbp), %edx
leaq 0x6418(%rip), %rsi      # 0x9760
movb $0x0, %al
callq 0x10d0
movq -0x38(%rbp), %rax
movl -0x1e8(%rbp), %ecx
movl %ecx, %edx
addl $0x1, %edx
movl %edx, -0x1e8(%rbp)
movl %ecx, %ecx
imulq $0x30, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0x40(%rbp)
movq -0x38(%rbp), %rax
movl -0x1e8(%rbp), %ecx
imulq $0x30, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0x48(%rbp)
movq -0x40(%rbp), %rax
movzbl (%rax), %eax
cmpl $0x0, %eax
jne 0x3397
jmp 0x3304
jmp 0x3399
movq -0x40(%rbp), %rax
movq -0x38(%rbp), %rcx
movl -0x204(%rbp), %edx
imulq $0x30, %rdx, %rdx
addq %rdx, %rcx
cmpq %rcx, %rax
je 0x33de
movq -0x40(%rbp), %rax
cmpq $-0x1, 0x20(%rax)
je 0x33de
movq -0x40(%rbp), %rax
movq -0x38(%rbp), %rcx
subq %rcx, %rax
movl $0x30, %ecx
cqto
idivq %rcx
movl %eax, -0x208(%rbp)
jmp 0x3465
cmpq $0x0, -0x48(%rbp)
jne 0x33e7
jmp 0x3465
movq -0x48(%rbp), %rax
movl 0x4(%rax), %eax
movq -0x40(%rbp), %rcx
subl 0x4(%rcx), %eax
movq -0x48(%rbp), %rcx
movl 0x8(%rcx), %ecx
movq -0x40(%rbp), %rdx
addl 0x8(%rdx), %ecx
imull %ecx, %eax
cvtsi2sd %eax, %xmm0
addsd -0x210(%rbp), %xmm0
movsd %xmm0, -0x210(%rbp)
movl -0x1e8(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1e8(%rbp)
cmpl -0x1dc(%rbp), %eax
jb 0x3443
movq -0x48(%rbp), %rax
movq %rax, -0x40(%rbp)
movq $0x0, -0x48(%rbp)
jmp 0x3460
movq -0x48(%rbp), %rax
movq %rax, -0x40(%rbp)
movq -0x38(%rbp), %rax
movl -0x1e8(%rbp), %ecx
imulq $0x30, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0x48(%rbp)
jmp 0x3399
movl -0x208(%rbp), %eax
cmpl -0x204(%rbp), %eax
ja 0x3478
jmp 0x3304
movq -0x38(%rbp), %rax
movl -0x208(%rbp), %ecx
imulq $0x30, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0x50(%rbp)
movq -0x38(%rbp), %rax
movl -0x204(%rbp), %ecx
imulq $0x30, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0x40(%rbp)
movsd -0x210(%rbp), %xmm0
xorps %xmm1, %xmm1
movl $0x1, %eax
xorl %ecx, %ecx
ucomisd %xmm1, %xmm0
cmoval %ecx, %eax
movl %eax, -0x214(%rbp)
movq -0x20(%rbp), %rdi
movl -0x204(%rbp), %edx
movl -0x208(%rbp), %ecx
movsd -0x210(%rbp), %xmm0
movl -0x214(%rbp), %r8d
movq -0x40(%rbp), %rax
movzwl 0x16(%rax), %r9d
movq -0x40(%rbp), %rax
movzwl 0x18(%rax), %eax
leaq 0x628a(%rip), %rsi      # 0x9782
movl %eax, (%rsp)
movb $0x1, %al
callq 0x10d0
movq -0x40(%rbp), %rax
movslq -0x214(%rbp), %rcx
movzwl 0x16(%rax,%rcx,2), %eax
cmpq -0x98(%rbp), %rax
jbe 0x3533
movq 0x9ad6(%rip), %rax      # 0xcff8
movq (%rax), %rdi
leaq 0x629d(%rip), %rsi      # 0x97c9
movb $0x0, %al
callq 0x10d0
movq -0x40(%rbp), %rax
movslq -0x214(%rbp), %rcx
movzwl 0x16(%rax,%rcx,2), %eax
cmpl $0x0, %eax
jne 0x354d
jmp 0x3304
movq -0x28(%rbp), %rax
movq -0x40(%rbp), %rcx
movslq -0x214(%rbp), %rdx
movzwl 0x16(%rcx,%rdx,2), %ecx
movslq %ecx, %rcx
imulq $0x74, %rcx, %rcx
addq %rcx, %rax
addq $-0x74, %rax
movq %rax, -0x200(%rbp)
movq -0x50(%rbp), %rax
movq 0x20(%rax), %rax
cmpl -0x204(%rbp), %eax
je 0x35a8
movq -0x20(%rbp), %rdi
movq -0x50(%rbp), %rax
movq 0x20(%rax), %rax
movl %eax, %edx
movl -0x204(%rbp), %ecx
leaq 0x6249(%rip), %rsi      # 0x97ea
movb $0x0, %al
callq 0x10d0
movq -0x20(%rbp), %rdi
leaq 0x6285(%rip), %rsi      # 0x9838
movb $0x0, %al
callq 0x10d0
movq -0x200(%rbp), %rax
movzbl (%rax), %eax
cmpl $0x0, %eax
jne 0x360b
movq -0x20(%rbp), %rdi
movq -0x200(%rbp), %rax
movzbl 0x4(%rax), %edx
movq -0x200(%rbp), %rax
movzbl 0x5(%rax), %ecx
movq -0x200(%rbp), %rax
movzbl 0x6(%rax), %r8d
movq -0x200(%rbp), %rax
movzbl 0x7(%rax), %r9d
leaq 0x6253(%rip), %rsi      # 0x9855
movb $0x0, %al
callq 0x10d0
jmp 0x361d
movq -0x20(%rbp), %rdi
leaq 0x6251(%rip), %rsi      # 0x9867
movb $0x0, %al
callq 0x10d0
movq -0x20(%rbp), %rdi
leaq 0x5b7e(%rip), %rsi      # 0x91a6
movb $0x0, %al
callq 0x10d0
movl -0x204(%rbp), %eax
movl %eax, -0x1e8(%rbp)
movl -0x1e8(%rbp), %eax
addl $0x1, %eax
cmpl -0x208(%rbp), %eax
ja 0x3794
movq -0x38(%rbp), %rax
movl -0x1e8(%rbp), %ecx
imulq $0x30, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0x40(%rbp)
cmpl $0x0, -0x214(%rbp)
je 0x3680
movq -0x40(%rbp), %rax
movb 0x28(%rax), %cl
andb $-0x3, %cl
orb $0x2, %cl
movb %cl, 0x28(%rax)
jmp 0x3690
movq -0x40(%rbp), %rax
movb 0x28(%rax), %cl
andb $-0x2, %cl
orb $0x1, %cl
movb %cl, 0x28(%rax)
movq -0x40(%rbp), %rax
addq $0x30, %rax
movq %rax, -0x48(%rbp)
movl -0x1e8(%rbp), %eax
cmpl -0x204(%rbp), %eax
jne 0x36d8
movq -0x20(%rbp), %rdi
movq -0x40(%rbp), %rax
movl 0x4(%rax), %edx
movq -0x10(%rbp), %rax
subl 0x8(%rax), %edx
movq -0x40(%rbp), %rax
movl 0x8(%rax), %ecx
movq -0x10(%rbp), %rax
subl 0x10(%rax), %ecx
leaq 0x5aed(%rip), %rsi      # 0x91be
movb $0x0, %al
callq 0x10d0
movq -0x40(%rbp), %rax
movzbl (%rax), %eax
cmpl $0x2, %eax
jne 0x3714
movq -0x20(%rbp), %rdi
movq -0x48(%rbp), %rax
movl 0x4(%rax), %edx
movq -0x10(%rbp), %rax
subl 0x8(%rax), %edx
movq -0x48(%rbp), %rax
movl 0x8(%rax), %ecx
movq -0x10(%rbp), %rax
subl 0x10(%rax), %ecx
leaq 0x5aa1(%rip), %rsi      # 0x91ac
movb $0x0, %al
callq 0x10d0
jmp 0x377e
movq -0x40(%rbp), %rax
movzbl (%rax), %eax
cmpl $0x3, %eax
jne 0x377c
movq -0x20(%rbp), %rdi
movq -0x40(%rbp), %rax
movl 0xc(%rax), %edx
movq -0x10(%rbp), %rax
subl 0x8(%rax), %edx
movq -0x40(%rbp), %rax
movl 0x10(%rax), %ecx
movq -0x10(%rbp), %rax
subl 0x10(%rax), %ecx
leaq 0x5a6e(%rip), %rsi      # 0x91b5
movb $0x0, %al
callq 0x10d0
movq -0x20(%rbp), %rdi
movq -0x48(%rbp), %rax
movl 0x4(%rax), %edx
movq -0x10(%rbp), %rax
subl 0x8(%rax), %edx
movq -0x48(%rbp), %rax
movl 0x8(%rax), %ecx
movq -0x10(%rbp), %rax
subl 0x10(%rax), %ecx
leaq 0x5a39(%rip), %rsi      # 0x91ae
movb $0x0, %al
callq 0x10d0
jmp 0x377e
jmp 0x3780
movl -0x1e8(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1e8(%rbp)
jmp 0x363b
movq -0x50(%rbp), %rax
movq 0x20(%rax), %rax
cmpl -0x204(%rbp), %eax
je 0x37c3
movq -0x50(%rbp), %rax
cmpq $-0x1, 0x20(%rax)
je 0x37c3
movq -0x38(%rbp), %rax
movq -0x50(%rbp), %rcx
imulq $0x30, 0x20(%rcx), %rcx
addq %rcx, %rax
movq %rax, -0x40(%rbp)
movq -0x20(%rbp), %rdi
leaq 0x5ebf(%rip), %rsi      # 0x968d
movb $0x0, %al
callq 0x10d0
movl -0x208(%rbp), %eax
movl %eax, -0x1e8(%rbp)
jmp 0x3304
movq -0x20(%rbp), %rdi
leaq 0x607b(%rip), %rsi      # 0x986c
movb $0x0, %al
callq 0x10d0
movl $0x0, -0x1e8(%rbp)
movl -0x1e8(%rbp), %eax
addl $0x1, %eax
cmpl -0x1dc(%rbp), %eax
jae 0x3a99
movq -0x38(%rbp), %rax
movl -0x1e8(%rbp), %ecx
movl %ecx, %edx
addl $0x1, %edx
movl %edx, -0x1e8(%rbp)
movl %ecx, %ecx
imulq $0x30, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0x40(%rbp)
movq -0x38(%rbp), %rax
movl -0x1e8(%rbp), %ecx
imulq $0x30, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0x48(%rbp)
movq -0x40(%rbp), %rax
movzwl 0x14(%rax), %eax
cmpq -0xa0(%rbp), %rax
jbe 0x3877
movq 0x9792(%rip), %rax      # 0xcff8
movq (%rax), %rdi
leaq 0x5f59(%rip), %rsi      # 0x97c9
movb $0x0, %al
callq 0x10d0
movq -0x40(%rbp), %rax
movzwl 0x14(%rax), %eax
cmpl $0x0, %eax
je 0x3895
movq -0x40(%rbp), %rax
movzwl 0x14(%rax), %eax
cmpq -0xa0(%rbp), %rax
jbe 0x389a
jmp 0x3802
movq -0x40(%rbp), %rax
movzbl (%rax), %eax
cmpl $0x0, %eax
jne 0x38ab
jmp 0x3802
movq -0x30(%rbp), %rax
movq -0x40(%rbp), %rcx
movzwl 0x14(%rcx), %ecx
movslq %ecx, %rcx
imulq $0x6, %rcx, %rcx
addq %rcx, %rax
addq $-0x6, %rax
movq %rax, -0x220(%rbp)
cmpq $0x0, -0x30(%rbp)
je 0x38d5
jmp 0x38f4
leaq 0x5e19(%rip), %rdi      # 0x96f5
leaq 0x5b0f(%rip), %rsi      # 0x93f2
movl $0x2b4, %edx            # imm = 0x2B4
leaq 0x5dbc(%rip), %rcx      # 0x96ab
callq 0x1080
movq -0x20(%rbp), %rdi
movq -0x40(%rbp), %rax
movzwl 0x14(%rax), %edx
leaq 0x5f77(%rip), %rsi      # 0x987e
movb $0x0, %al
callq 0x10d0
movq -0x20(%rbp), %rdi
movq -0x220(%rbp), %rax
movzbl 0x2(%rax), %edx
movq -0x220(%rbp), %rax
movzbl 0x3(%rax), %ecx
movq -0x220(%rbp), %rax
movzbl 0x4(%rax), %r8d
movq -0x220(%rbp), %rax
movzbl 0x5(%rax), %r9d
movq -0x220(%rbp), %rax
movzwl (%rax), %eax
leaq 0x5f44(%rip), %rsi      # 0x9895
movl %eax, (%rsp)
movb $0x0, %al
callq 0x10d0
movq -0x20(%rbp), %rdi
movq -0x40(%rbp), %rax
movl 0x4(%rax), %edx
movq -0x10(%rbp), %rax
subl 0x8(%rax), %edx
movq -0x40(%rbp), %rax
movl 0x8(%rax), %ecx
movq -0x10(%rbp), %rax
subl 0x10(%rax), %ecx
leaq 0x583c(%rip), %rsi      # 0x91be
movb $0x0, %al
callq 0x10d0
movq -0x40(%rbp), %rax
movzbl (%rax), %eax
cmpl $0x2, %eax
jne 0x39c5
movq -0x20(%rbp), %rdi
movq -0x48(%rbp), %rax
movl 0x4(%rax), %edx
movq -0x10(%rbp), %rax
subl 0x8(%rax), %edx
movq -0x48(%rbp), %rax
movl 0x8(%rax), %ecx
movq -0x10(%rbp), %rax
subl 0x10(%rax), %ecx
leaq 0x57f0(%rip), %rsi      # 0x91ac
movb $0x0, %al
callq 0x10d0
jmp 0x3a13
movq -0x20(%rbp), %rdi
movq -0x40(%rbp), %rax
movl 0xc(%rax), %edx
movq -0x10(%rbp), %rax
subl 0x8(%rax), %edx
movq -0x40(%rbp), %rax
movl 0x10(%rax), %ecx
movq -0x10(%rbp), %rax
subl 0x10(%rax), %ecx
movq -0x48(%rbp), %rax
movl 0x4(%rax), %r8d
movq -0x10(%rbp), %rax
subl 0x8(%rax), %r8d
movq -0x48(%rbp), %rax
movl 0x8(%rax), %r9d
movq -0x10(%rbp), %rax
subl 0x10(%rax), %r9d
leaq 0x5ece(%rip), %rsi      # 0x98da
movb $0x0, %al
callq 0x10d0
movq -0x48(%rbp), %rax
movq %rax, -0x40(%rbp)
movq -0x40(%rbp), %rax
movzbl (%rax), %eax
cmpl $0x0, %eax
jne 0x3a29
jmp 0x3a82
cmpl $0x10000, -0x1e8(%rbp)  # imm = 0x10000
jb 0x3a37
jmp 0x3a82
movq -0x38(%rbp), %rax
movl -0x1e8(%rbp), %ecx
addl $0x1, %ecx
movl %ecx, %ecx
imulq $0x30, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0x48(%rbp)
movq -0x40(%rbp), %rax
movzwl 0x14(%rax), %eax
movq -0x48(%rbp), %rcx
movzwl 0x14(%rcx), %ecx
cmpl %ecx, %eax
je 0x3a67
jmp 0x3a82
movl -0x1e8(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1e8(%rbp)
movb $0x1, %al
testb $0x1, %al
jne 0x3989
jmp 0x3a82
movq -0x20(%rbp), %rdi
leaq 0x5c00(%rip), %rsi      # 0x968d
movb $0x0, %al
callq 0x10d0
jmp 0x3802
movq -0x20(%rbp), %rdi
leaq 0x5723(%rip), %rsi      # 0x91c7
movb $0x0, %al
callq 0x10d0
cmpq $0x0, -0x30(%rbp)
je 0x3abb
movq -0x30(%rbp), %rdi
callq 0x1030
cmpq $0x0, -0x28(%rbp)
je 0x3acb
movq -0x28(%rbp), %rdi
callq 0x1030
cmpq $0x0, -0x38(%rbp)
je 0x3adb
movq -0x38(%rbp), %rdi
callq 0x1030
addq $0x230, %rsp            # imm = 0x230
popq %rbp
retq
nopw %cs:(%rax,%rax)
nop