// File: /workspace/github_c_makefile_star2_O1/jonof[P]jftekwar/jfbuild/src/engine.c
// Function: clipmove
int clipmove (int *x, int *y, int *z, short *sectnum,
		 int xvect, int yvect,
		 int walldist, int ceildist, int flordist, unsigned int cliptype)
{
	walltype *wal, *wal2;
	spritetype *spr;
	sectortype *sec, *sec2;
	int i, j, templong1, templong2;
	int oxvect, oyvect, goalx, goaly, intx, inty, lx, ly, retval;
	int k, l, clipsectcnt, startwall, endwall, cstat, dasect;
	int x1, y1, x2, y2, cx, cy, rad, xmin, ymin, xmax, ymax, daz, daz2;
	int bsz, dax, day, xoff, yoff, xspan, yspan, cosang, sinang, tilenum;
	int xrepeat, yrepeat, gx, gy, dx, dy, dasprclipmask, dawalclipmask;
	int hitwall, cnt, clipyou;

	if (((xvect|yvect) == 0) || (*sectnum < 0)) return(0);
	retval = 0;

	oxvect = xvect;
	oyvect = yvect;

	goalx = (*x) + (xvect>>14);
	goaly = (*y) + (yvect>>14);


	clipnum = 0;

	cx = (((*x)+goalx)>>1);
	cy = (((*y)+goaly)>>1);
		//Extra walldist for sprites on sector lines
	gx = goalx-(*x); gy = goaly-(*y);
	rad = nsqrtasm(gx*gx + gy*gy) + MAXCLIPDIST+walldist + 8;
	xmin = cx-rad; ymin = cy-rad;
	xmax = cx+rad; ymax = cy+rad;

	dawalclipmask = (cliptype&65535);        //CLIPMASK0 = 0x00010001
	dasprclipmask = (cliptype>>16);          //CLIPMASK1 = 0x01000040

	clipsectorlist[0] = (*sectnum);
	clipsectcnt = 0; clipsectnum = 1;
	do
	{
		dasect = clipsectorlist[clipsectcnt++];
		sec = &sector[dasect];
		startwall = sec->wallptr; endwall = startwall + sec->wallnum;
		for(j=startwall,wal=&wall[startwall];j<endwall;j++,wal++)
		{
			wal2 = &wall[wal->point2];
			if ((wal->x < xmin) && (wal2->x < xmin)) continue;
			if ((wal->x > xmax) && (wal2->x > xmax)) continue;
			if ((wal->y < ymin) && (wal2->y < ymin)) continue;
			if ((wal->y > ymax) && (wal2->y > ymax)) continue;

			x1 = wal->x; y1 = wal->y; x2 = wal2->x; y2 = wal2->y;

			dx = x2-x1; dy = y2-y1;
			if (dx*((*y)-y1) < ((*x)-x1)*dy) continue;  //If wall's not facing you

			if (dx > 0) dax = dx*(ymin-y1); else dax = dx*(ymax-y1);
			if (dy > 0) day = dy*(xmax-x1); else day = dy*(xmin-x1);
			if (dax >= day) continue;

			clipyou = 0;
			if ((wal->nextsector < 0) || (wal->cstat&dawalclipmask)) clipyou = 1;
			else if (editstatus == 0)
			{
				if (rintersect(*x,*y,0,gx,gy,0,x1,y1,x2,y2,&dax,&day,&daz) == 0)
					dax = *x, day = *y;
				daz = getflorzofslope((short)dasect,dax,day);
				daz2 = getflorzofslope(wal->nextsector,dax,day);

				sec2 = &sector[wal->nextsector];
				if (daz2 < daz-(1<<8))
					if ((sec2->floorstat&1) == 0)
						if ((*z) >= daz2-(flordist-1)) clipyou = 1;
				if (clipyou == 0)
				{
					daz = getceilzofslope((short)dasect,dax,day);
					daz2 = getceilzofslope(wal->nextsector,dax,day);
					if (daz2 > daz+(1<<8))
						if ((sec2->ceilingstat&1) == 0)
							if ((*z) <= daz2+(ceildist-1)) clipyou = 1;
				}
			}

			if (clipyou)
			{
					//Add 2 boxes at endpoints
				bsz = walldist; if (gx < 0) bsz = -bsz;
				addclipline(x1-bsz,y1-bsz,x1-bsz,y1+bsz,(short)j+32768);
				addclipline(x2-bsz,y2-bsz,x2-bsz,y2+bsz,(short)j+32768);
				bsz = walldist; if (gy < 0) bsz = -bsz;
				addclipline(x1+bsz,y1-bsz,x1-bsz,y1-bsz,(short)j+32768);
				addclipline(x2+bsz,y2-bsz,x2-bsz,y2-bsz,(short)j+32768);

				dax = walldist; if (dy > 0) dax = -dax;
				day = walldist; if (dx < 0) day = -day;
				addclipline(x1+dax,y1+day,x2+dax,y2+day,(short)j+32768);
			}
			else
			{
				for(i=clipsectnum-1;i>=0;i--)
					if (wal->nextsector == clipsectorlist[i]) break;
				if (i < 0) clipsectorlist[clipsectnum++] = wal->nextsector;
			}
		}

		for(j=headspritesect[dasect];j>=0;j=nextspritesect[j])
		{
			spr = &sprite[j];
			cstat = spr->cstat;
			if ((cstat&dasprclipmask) == 0) continue;
			x1 = spr->x; y1 = spr->y;
			switch(cstat&48)
			{
				case 0:
					if ((x1 >= xmin) && (x1 <= xmax) && (y1 >= ymin) && (y1 <= ymax))
					{
						k = ((tilesizy[spr->picnum]*spr->yrepeat)<<2);
						if (cstat&128) daz = spr->z+(k>>1); else daz = spr->z;
						if (picanm[spr->picnum]&0x00ff0000) daz -= ((int)((signed char)((picanm[spr->picnum]>>16)&255))*spr->yrepeat<<2);
						if (((*z) < daz+ceildist) && ((*z) > daz-k-flordist))
						{
							bsz = (spr->clipdist<<2)+walldist; if (gx < 0) bsz = -bsz;
							addclipline(x1-bsz,y1-bsz,x1-bsz,y1+bsz,(short)j+49152);
							bsz = (spr->clipdist<<2)+walldist; if (gy < 0) bsz = -bsz;
							addclipline(x1+bsz,y1-bsz,x1-bsz,y1-bsz,(short)j+49152);
						}
					}
					break;
				case 16:
					k = ((tilesizy[spr->picnum]*spr->yrepeat)<<2);
					if (cstat&128) daz = spr->z+(k>>1); else daz = spr->z;
					if (picanm[spr->picnum]&0x00ff0000) daz -= ((int)((signed char)((picanm[spr->picnum]>>16)&255))*spr->yrepeat<<2);
					daz2 = daz-k;
					daz += ceildist; daz2 -= flordist;
					if (((*z) < daz) && ((*z) > daz2))
					{
							//These lines get the 2 points of the rotated sprite
							//Given: (x1, y1) starts out as the center point
						tilenum = spr->picnum;
						xoff = (int)((signed char)((picanm[tilenum]>>8)&255))+((int)spr->xoffset);
						if ((cstat&4) > 0) xoff = -xoff;
						k = spr->ang; l = spr->xrepeat;
						dax = sintable[k&2047]*l; day = sintable[(k+1536)&2047]*l;
						l = tilesizx[tilenum]; k = (l>>1)+xoff;
						x1 -= mulscale16(dax,k); x2 = x1+mulscale16(dax,l);
						y1 -= mulscale16(day,k); y2 = y1+mulscale16(day,l);
						if (clipinsideboxline(cx,cy,x1,y1,x2,y2,rad) != 0)
						{
							dax = mulscale14(sintable[(spr->ang+256+512)&2047],walldist);
							day = mulscale14(sintable[(spr->ang+256)&2047],walldist);

							if ((x1-(*x))*(y2-(*y)) >= (x2-(*x))*(y1-(*y)))   //Front
							{
								addclipline(x1+dax,y1+day,x2+day,y2-dax,(short)j+49152);
							}
							else
							{
								if ((cstat&64) != 0) continue;
								addclipline(x2-dax,y2-day,x1-day,y1+dax,(short)j+49152);
							}

								//Side blocker
							if ((x2-x1)*((*x)-x1) + (y2-y1)*((*y)-y1) < 0)
								{ addclipline(x1-day,y1+dax,x1+dax,y1+day,(short)j+49152); }
							else if ((x1-x2)*((*x)-x2) + (y1-y2)*((*y)-y2) < 0)
								{ addclipline(x2+day,y2-dax,x2-dax,y2-day,(short)j+49152); }
						}
					}
					break;
				case 32:
					daz = spr->z+ceildist;
					daz2 = spr->z-flordist;
					if (((*z) < daz) && ((*z) > daz2))
					{
						if ((cstat&64) != 0)
							if (((*z) > spr->z) == ((cstat&8)==0)) continue;

						tilenum = spr->picnum;
						xoff = (int)((signed char)((picanm[tilenum]>>8)&255))+((int)spr->xoffset);
						yoff = (int)((signed char)((picanm[tilenum]>>16)&255))+((int)spr->yoffset);
						if ((cstat&4) > 0) xoff = -xoff;
						if ((cstat&8) > 0) yoff = -yoff;

						k = spr->ang;
						cosang = sintable[(k+512)&2047]; sinang = sintable[k];
						xspan = tilesizx[tilenum]; xrepeat = spr->xrepeat;
						yspan = tilesizy[tilenum]; yrepeat = spr->yrepeat;

						dax = ((xspan>>1)+xoff)*xrepeat; day = ((yspan>>1)+yoff)*yrepeat;
						rxi[0] = x1 + dmulscale16(sinang,dax,cosang,day);
						ryi[0] = y1 + dmulscale16(sinang,day,-cosang,dax);
						l = xspan*xrepeat;
						rxi[1] = rxi[0] - mulscale16(sinang,l);
						ryi[1] = ryi[0] + mulscale16(cosang,l);
						l = yspan*yrepeat;
						k = -mulscale16(cosang,l); rxi[2] = rxi[1]+k; rxi[3] = rxi[0]+k;
						k = -mulscale16(sinang,l); ryi[2] = ryi[1]+k; ryi[3] = ryi[0]+k;

						dax = mulscale14(sintable[(spr->ang-256+512)&2047],walldist);
						day = mulscale14(sintable[(spr->ang-256)&2047],walldist);

						if ((rxi[0]-(*x))*(ryi[1]-(*y)) < (rxi[1]-(*x))*(ryi[0]-(*y)))
						{
							if (clipinsideboxline(cx,cy,rxi[1],ryi[1],rxi[0],ryi[0],rad) != 0)
								addclipline(rxi[1]-day,ryi[1]+dax,rxi[0]+dax,ryi[0]+day,(short)j+49152);
						}
						else if ((rxi[2]-(*x))*(ryi[3]-(*y)) < (rxi[3]-(*x))*(ryi[2]-(*y)))
						{
							if (clipinsideboxline(cx,cy,rxi[3],ryi[3],rxi[2],ryi[2],rad) != 0)
								addclipline(rxi[3]+day,ryi[3]-dax,rxi[2]-dax,ryi[2]-day,(short)j+49152);
						}

						if ((rxi[1]-(*x))*(ryi[2]-(*y)) < (rxi[2]-(*x))*(ryi[1]-(*y)))
						{
							if (clipinsideboxline(cx,cy,rxi[2],ryi[2],rxi[1],ryi[1],rad) != 0)
								addclipline(rxi[2]-dax,ryi[2]-day,rxi[1]-day,ryi[1]+dax,(short)j+49152);
						}
						else if ((rxi[3]-(*x))*(ryi[0]-(*y)) < (rxi[0]-(*x))*(ryi[3]-(*y)))
						{
							if (clipinsideboxline(cx,cy,rxi[0],ryi[0],rxi[3],ryi[3],rad) != 0)
								addclipline(rxi[0]+dax,ryi[0]+day,rxi[3]+day,ryi[3]-dax,(short)j+49152);
						}
					}
					break;
			}
		}
	} while (clipsectcnt < clipsectnum);


	hitwall = 0;
	cnt = clipmoveboxtracenum;
	do
	{
		intx = goalx; inty = goaly;
		if ((hitwall = raytrace(*x, *y, &intx, &inty)) >= 0)
		{
			lx = clipit[hitwall].x2-clipit[hitwall].x1;
			ly = clipit[hitwall].y2-clipit[hitwall].y1;
			templong2 = lx*lx + ly*ly;
			if (templong2 > 0)
			{
				templong1 = (goalx-intx)*lx + (goaly-inty)*ly;

				if ((klabs(templong1)>>11) < templong2)
					i = divscale20(templong1,templong2);
				else
					i = 0;
				goalx = mulscale20(lx,i)+intx;
				goaly = mulscale20(ly,i)+inty;
			}

			templong1 = dmulscale6(lx,oxvect,ly,oyvect);
			for(i=cnt+1;i<=clipmoveboxtracenum;i++)
			{
				j = hitwalls[i];
				templong2 = dmulscale6(clipit[j].x2-clipit[j].x1,oxvect,clipit[j].y2-clipit[j].y1,oyvect);
				if ((templong1^templong2) < 0)
				{
					updatesector(*x,*y,sectnum);
					return(retval);
				}
			}

			keepaway(&goalx, &goaly, hitwall);
			xvect = ((goalx-intx)<<14);
			yvect = ((goaly-inty)<<14);

			if (cnt == clipmoveboxtracenum) retval = clipobjectval[hitwall];
			hitwalls[cnt] = hitwall;
		}
		cnt--;

		*x = intx;
		*y = inty;
	} while (((xvect|yvect) != 0) && (hitwall >= 0) && (cnt > 0));

	for(j=0;j<clipsectnum;j++)
		if (inside(*x,*y,clipsectorlist[j]) == 1)
		{
			*sectnum = clipsectorlist[j];
			return(retval);
		}

	*sectnum = -1; templong1 = 0x7fffffff;
	for(j=numsectors-1;j>=0;j--)
		if (inside(*x,*y,j) == 1)
		{
			if (sector[j].ceilingstat&2)
				templong2 = (getceilzofslope((short)j,*x,*y)-(*z));
			else
				templong2 = (sector[j].ceilingz-(*z));

			if (templong2 > 0)
			{
				if (templong2 < templong1)
					{ *sectnum = j; templong1 = templong2; }
			}
			else
			{
				if (sector[j].floorstat&2)
					templong2 = ((*z)-getflorzofslope((short)j,*x,*y));
				else
					templong2 = ((*z)-sector[j].floorz);

				if (templong2 <= 0)
				{
					*sectnum = j;
					return(retval);
				}
				if (templong2 < templong1)
					{ *sectnum = j; templong1 = templong2; }
			}
		}

	return(retval);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x138, %rsp            # imm = 0x138
movq %rdx, 0xd0(%rsp)
movq %rsi, 0x88(%rsp)
movq %rdi, 0xb8(%rsp)
xorl %esi, %esi
movl %r9d, 0xa8(%rsp)
movl %r9d, %eax
movl %r8d, 0xac(%rsp)
orl %r8d, %eax
je 0x397a1
movzwl (%rcx), %eax
testw %ax, %ax
js 0x397a1
movq %rcx, 0xd8(%rsp)
movl 0x188(%rsp), %r12d
movl 0x170(%rsp), %r8d
movq 0xb8(%rsp), %rcx
movl (%rcx), %r9d
movl 0xac(%rsp), %ecx
movl %ecx, %ebx
sarl $0xe, %ebx
leal (%r9,%rbx), %ecx
movq 0x88(%rsp), %rdx
movl (%rdx), %r14d
movl 0xa8(%rsp), %edx
movl %edx, %r15d
sarl $0xe, %r15d
leal (%r14,%r15), %edx
movq %rcx, 0xc0(%rsp)
addl %ecx, %r9d
sarl %r9d
movq %rdx, 0xe0(%rsp)
addl %edx, %r14d
sarl %r14d
movl %ebx, %ecx
imull %ebx, %ecx
movl %r15d, %edx
imull %edx, %edx
addl %ecx, %edx
movl %edx, %ecx
shrl $0x18, %ecx
orl $0x1000, %ecx           # imm = 0x1000
movl %edx, %esi
shrl $0xc, %esi
cmpl $0x1000000, %edx        # imm = 0x1000000
cmovael %ecx, %esi
leaq 0x41d229(%rip), %rcx    # 0x454f00
movzwl (%rcx,%rsi,2), %ecx
shrl %cl, %edx
leaq 0x41f41c(%rip), %rsi    # 0x457100
movzwl (%rsi,%rdx,2), %edx
shrl $0x8, %ecx
shrl %cl, %edx
leal (%r8,%rdx), %ecx
addl %r8d, %edx
addl $0x408, %edx            # imm = 0x408
movl %r9d, %esi
subl %edx, %esi
movl %r14d, %ebp
movq %rdx, 0x70(%rsp)
subl %edx, %ebp
movl %ebp, %edx
movq %r9, 0xc8(%rsp)
addl %ecx, %r9d
addl $0x408, %r9d            # imm = 0x408
movq %r14, 0x78(%rsp)
addl %r14d, %ecx
addl $0x408, %ecx            # imm = 0x408
movl %ecx, 0x1c(%rsp)
movl %r9d, %r14d
shrl $0x10, %r12d
movw %ax, 0x3f8803(%rip)     # 0x430540
movl %r8d, %eax
negl %eax
movq %rbx, 0x110(%rsp)
testl %ebx, %ebx
movl %r8d, %ecx
cmovsl %eax, %ecx
movq %rcx, 0x120(%rsp)
movq %r15, 0x108(%rsp)
testl %r15d, %r15d
movl %r8d, %ecx
movl %eax, 0x100(%rsp)
cmovsl %eax, %ecx
movq %rcx, 0x118(%rsp)
movl 0x178(%rsp), %eax
decl %eax
movl %eax, 0xfc(%rsp)
movslq %r8d, %rax
movq %rax, 0x128(%rsp)
movl %esi, %r8d
movw $0x1, %ax
movl %eax, 0xb0(%rsp)
movq $0x0, (%rsp)
leaq 0x17fc9e(%rip), %r10    # 0x1b7a50
xorl %ecx, %ecx
movl %esi, 0x40(%rsp)
movl %ebp, 0x8(%rsp)
movl %r9d, 0x10(%rsp)
movl %r12d, 0x80(%rsp)
leaq 0x3f8770(%rip), %rax    # 0x430540
movq %rcx, 0xf0(%rsp)
movswq (%rax,%rcx,2), %rax
movq %rax, 0xa0(%rsp)
leaq (%rax,%rax,4), %rax
leaq 0x20ac70(%rip), %rcx    # 0x242a60
movswl 0x2(%rcx,%rax,8), %ebp
testl %ebp, %ebp
jle 0x3835f
movswl (%rcx,%rax,8), %ebx
addl %ebx, %ebp
movslq %ebx, %r15
shlq $0x5, %r15
addq %r10, %r15
movzwl 0x17fc28(%rip), %eax    # 0x1b7a3c
movw %ax, 0x90(%rsp)
movl 0xb0(%rsp), %eax
movq %rax, 0x28(%rsp)
movl %ebp, 0x50(%rsp)
movswq 0x8(%r15), %rax
shlq $0x5, %rax
addq %r10, %rax
movl (%r15), %r12d
cmpl %r8d, %r12d
jge 0x37e49
cmpl %r8d, (%rax)
jl 0x3814c
cmpl %r14d, %r12d
jle 0x37e57
cmpl %r14d, (%rax)
jg 0x3814c
movl 0x4(%r15), %r13d
cmpl %edx, %r13d
jge 0x37e69
cmpl %edx, 0x4(%rax)
jl 0x3814c
cmpl 0x1c(%rsp), %r13d
jle 0x37e7d
movl 0x1c(%rsp), %ecx
cmpl %ecx, 0x4(%rax)
jg 0x3814c
movl (%rax), %edi
movl 0x4(%rax), %esi
movl %edi, %r11d
subl %r12d, %r11d
movl %esi, %r9d
subl %r13d, %r9d
movq 0x88(%rsp), %rax
movl (%rax), %ebp
movl %ebp, %eax
subl %r13d, %eax
imull %r11d, %eax
movq 0xb8(%rsp), %rcx
movl (%rcx), %r14d
movl %r14d, %ecx
subl %r12d, %ecx
imull %r9d, %ecx
cmpl %ecx, %eax
jl 0x38143
testl %r11d, %r11d
movl 0x1c(%rsp), %eax
cmovgl %edx, %eax
subl %r13d, %eax
movl %r11d, 0x20(%rsp)
imull %r11d, %eax
movl %eax, 0x64(%rsp)
testl %r9d, %r9d
movl %r8d, %ecx
cmovgl 0x10(%rsp), %ecx
subl %r12d, %ecx
imull %r9d, %ecx
movl %ecx, 0x60(%rsp)
cmpl %ecx, %eax
jge 0x38143
movl %r9d, %r11d
cmpw $0x0, 0xc(%r15)
movq %rsi, 0x48(%rsp)
movq %rdi, 0x30(%rsp)
js 0x37f1d
movzwl 0xe(%r15), %eax
testl %eax, 0x188(%rsp)
je 0x3815f
movswl (%rsp), %eax
cmpl $0x3ff, %eax            # imm = 0x3FF
jg 0x37f7f
movl %r12d, %eax
movq 0x120(%rsp), %rdi
subl %edi, %eax
movq (%rsp), %r9
movswq %r9w, %rcx
movl %ebx, %edx
xorl $0x8000, %edx           # imm = 0x8000
leaq 0x3fcdf4(%rip), %rsi    # 0x434d40
movw %dx, (%rsi,%rcx,2)
shlq $0x4, %rcx
leaq 0x3f8de5(%rip), %rsi    # 0x430d40
movl %eax, (%rcx,%rsi)
movl %r13d, %edx
subl %edi, %edx
movl %edx, 0x4(%rcx,%rsi)
movl %eax, 0x8(%rcx,%rsi)
leal (%rdi,%r13), %eax
movq 0x30(%rsp), %rdi
movl %eax, 0xc(%rcx,%rsi)
incl %r9d
movq %r9, (%rsp)
movl 0x50(%rsp), %ebp
movswl (%rsp), %eax
cmpl $0x3ff, %eax            # imm = 0x3FF
jg 0x37fe4
movl %edi, %eax
movq 0x120(%rsp), %rdi
subl %edi, %eax
movq (%rsp), %r9
movswq %r9w, %rcx
movl %ebx, %edx
xorl $0x8000, %edx           # imm = 0x8000
leaq 0x3fcd8f(%rip), %rsi    # 0x434d40
movw %dx, (%rsi,%rcx,2)
shlq $0x4, %rcx
leaq 0x3f8d80(%rip), %rsi    # 0x430d40
movl %eax, (%rcx,%rsi)
movq 0x48(%rsp), %r14
movl %r14d, %edx
subl %edi, %edx
movl %edx, 0x4(%rcx,%rsi)
movl %eax, 0x8(%rcx,%rsi)
leal (%r14,%rdi), %eax
movl %eax, 0xc(%rcx,%rsi)
incl %r9d
movq %r9, (%rsp)
movl 0x10(%rsp), %r14d
movswl (%rsp), %eax
cmpl $0x3ff, %eax            # imm = 0x3FF
jg 0x38046
movq 0x118(%rsp), %rdi
leal (%r12,%rdi), %eax
movq (%rsp), %r9
movswq %r9w, %rcx
movl %ebx, %edx
xorl $0x8000, %edx           # imm = 0x8000
leaq 0x3fcd29(%rip), %rsi    # 0x434d40
movw %dx, (%rsi,%rcx,2)
shlq $0x4, %rcx
leaq 0x3f8d1a(%rip), %rsi    # 0x430d40
movl %eax, (%rcx,%rsi)
movl %r13d, %eax
subl %edi, %eax
movl %eax, 0x4(%rcx,%rsi)
movl %r12d, %edx
subl %edi, %edx
movl %edx, 0x8(%rcx,%rsi)
movl %eax, 0xc(%rcx,%rsi)
incl %r9d
movq %r9, (%rsp)
movswl (%rsp), %eax
cmpl $0x3ff, %eax            # imm = 0x3FF
jg 0x380b7
movq 0x118(%rsp), %rdi
movq (%rsp), %r9
movl %r11d, %r10d
movq 0x30(%rsp), %r11
leal (%r11,%rdi), %eax
movswq %r9w, %rcx
movl %ebx, %edx
xorl $0x8000, %edx           # imm = 0x8000
leaq 0x3fccc4(%rip), %rsi    # 0x434d40
movw %dx, (%rsi,%rcx,2)
shlq $0x4, %rcx
leaq 0x3f8cb5(%rip), %rsi    # 0x430d40
movl %eax, (%rcx,%rsi)
movq 0x48(%rsp), %rax
subl %edi, %eax
movl %eax, 0x4(%rcx,%rsi)
movl %r11d, %edx
movl %r10d, %r11d
leaq 0x17f9aa(%rip), %r10    # 0x1b7a50
subl %edi, %edx
movl %edx, 0x8(%rcx,%rsi)
movl %eax, 0xc(%rcx,%rsi)
incl %r9d
movq %r9, (%rsp)
movl 0x20(%rsp), %esi
testl %r11d, %r11d
movl 0x170(%rsp), %eax
movq %rax, %rcx
movl 0x100(%rsp), %edx
cmovgl %edx, %eax
testl %esi, %esi
cmovsl %edx, %ecx
movl %eax, 0x64(%rsp)
movl %ecx, 0x60(%rsp)
movswl (%rsp), %edx
cmpl $0x3ff, %edx            # imm = 0x3FF
jg 0x3813d
addl %eax, %r12d
movq (%rsp), %r9
movswq %r9w, %rdx
movl %ebx, %esi
xorl $0x8000, %esi           # imm = 0x8000
leaq 0x3fcc3b(%rip), %rdi    # 0x434d40
movw %si, (%rdi,%rdx,2)
shlq $0x4, %rdx
leaq 0x3f8c2c(%rip), %rsi    # 0x430d40
movl %r12d, (%rdx,%rsi)
addl %ecx, %r13d
movl %r13d, 0x4(%rdx,%rsi)
movq 0x30(%rsp), %rdi
addl %eax, %edi
movl %edi, 0x8(%rdx,%rsi)
movq 0x48(%rsp), %rax
addl %ecx, %eax
movl %eax, 0xc(%rdx,%rsi)
incl %r9d
movq %r9, (%rsp)
movl 0x8(%rsp), %edx
jmp 0x3814c
movl 0x10(%rsp), %r14d
movl 0x50(%rsp), %ebp
incl %ebx
addq $0x20, %r15
cmpl %ebp, %ebx
jl 0x37e2c
jmp 0x3835f
cmpw $0x0, 0x90(%rsp)
jne 0x382e1
movl %r11d, 0x58(%rsp)
subq $0x8, %rsp
movq %rdi, %r11
movl %r14d, %edi
movq %rsi, %r10
movl %ebp, %esi
xorl %edx, %edx
movq 0x118(%rsp), %rcx
movq 0x110(%rsp), %r8
xorl %r9d, %r9d
leaq 0xbc(%rsp), %rax
pushq %rax
leaq 0x70(%rsp), %rax
pushq %rax
leaq 0x7c(%rsp), %rax
pushq %rax
pushq %r10
pushq %r11
pushq %r13
pushq %r12
callq 0x3731e
addq $0x40, %rsp
testl %eax, %eax
jne 0x381ca
movl %r14d, 0x64(%rsp)
movl %ebp, 0x60(%rsp)
movl 0x64(%rsp), %esi
movl %esi, 0x3c(%rsp)
movl 0x60(%rsp), %edx
movl %edx, 0x68(%rsp)
movq 0xa0(%rsp), %rdi
callq 0x397ca
movl %eax, %ebp
movl %eax, 0xb4(%rsp)
movswq 0xc(%r15), %r14
movl %r14d, %edi
movl 0x3c(%rsp), %esi
movl 0x68(%rsp), %edx
callq 0x397ca
movq %r14, 0x98(%rsp)
leaq (%r14,%r14,4), %rcx
leaq 0x20a848(%rip), %rdx    # 0x242a60
leaq (%rdx,%rcx,8), %r9
addl $0xffffff00, %ebp       # imm = 0xFFFFFF00
cmpl %ebp, %eax
movl 0x40(%rsp), %r8d
leaq 0x17f820(%rip), %r10    # 0x1b7a50
movq 0x30(%rsp), %rdi
movl 0x58(%rsp), %r11d
jge 0x3825e
testb $0x1, 0xe(%r9)
jne 0x3825e
movl 0x180(%rsp), %ecx
subl %ecx, %eax
incl %eax
movq 0xd0(%rsp), %rcx
cmpl %eax, (%rcx)
jge 0x37f1d
movq 0xa0(%rsp), %rdi
movl 0x3c(%rsp), %r14d
movl %r14d, %esi
movq %r9, 0xe8(%rsp)
movl 0x68(%rsp), %edx
callq 0x398a4
movl %eax, %ebp
movl %eax, 0xb4(%rsp)
movswl 0x98(%rsp), %edi
movl %r14d, %esi
movl 0x68(%rsp), %edx
callq 0x398a4
movq 0xe8(%rsp), %rcx
movl 0x58(%rsp), %r11d
movq 0x30(%rsp), %rdi
leaq 0x17f79b(%rip), %r10    # 0x1b7a50
movl 0x40(%rsp), %r8d
addl $0x100, %ebp            # imm = 0x100
cmpl %ebp, %eax
jle 0x382e1
testb $0x1, 0xc(%rcx)
jne 0x382e1
addl 0xfc(%rsp), %eax
movq 0xd0(%rsp), %rcx
cmpl %eax, (%rcx)
jle 0x37f1d
movswl 0x28(%rsp), %ecx
movl %ecx, %eax
sarl $0x1f, %eax
andl %ecx, %eax
leaq 0x3f824c(%rip), %rdx    # 0x430540
leaq (%rdx,%rcx,2), %rdx
addq $-0x2, %rdx
movl 0x10(%rsp), %r14d
movl 0x50(%rsp), %ebp
testl %ecx, %ecx
jle 0x38320
movzwl 0xc(%r15), %esi
decl %ecx
leaq -0x2(%rdx), %rdi
cmpw (%rdx), %si
movq %rdi, %rdx
jne 0x38305
incl %ecx
movl %ecx, %eax
testl %eax, %eax
movl 0x8(%rsp), %edx
jg 0x3814c
movzwl 0xc(%r15), %eax
movq 0x28(%rsp), %rcx
leal 0x1(%rcx), %esi
movswq %cx, %rcx
leaq 0x3f81fc(%rip), %rdx    # 0x430540
movw %ax, (%rdx,%rcx,2)
movl 0x8(%rsp), %edx
movl %esi, 0xb0(%rsp)
movl %esi, %eax
movq %rax, 0x28(%rsp)
jmp 0x3814c
movl 0xb4(%rsp), %eax
movq %rax, 0x50(%rsp)
movl 0x64(%rsp), %ecx
movl 0x60(%rsp), %eax
movq %rax, 0x28(%rsp)
leaq 0x373191(%rip), %rax    # 0x3ab510
movq 0xa0(%rsp), %rsi
movzwl (%rax,%rsi,2), %eax
testw %ax, %ax
leaq 0x24391b(%rip), %rdi    # 0x27bcb0
movq %rcx, 0x30(%rsp)
js 0x390bd
movl 0x80(%rsp), %r12d
movzwl %ax, %r15d
imulq $0x2c, %r15, %rax
movzwl 0xc(%rax,%rdi), %r13d
testl %r13d, %r12d
je 0x39093
addq %rdi, %rax
movl (%rax), %ebx
movl 0x4(%rax), %ebp
movl %r13d, %ecx
shrl $0x4, %ecx
andl $0x3, %ecx
leaq 0x3da79(%rip), %rsi     # 0x75e50
movslq (%rsi,%rcx,4), %rcx
addq %rsi, %rcx
jmpq *%rcx
cmpl %r8d, %ebx
jl 0x3908c
cmpl %r14d, %ebx
jg 0x3908c
cmpl %edx, %ebp
jl 0x3908c
cmpl 0x1c(%rsp), %ebp
jg 0x3908c
movswq 0xe(%rax), %rsi
leaq 0x3c83d0(%rip), %rcx    # 0x4007e0
movswl (%rcx,%rsi,2), %ecx
movzbl 0x15(%rax), %edx
imull %edx, %ecx
movsbl %r13b, %edi
sarl $0x7, %edi
leal (%rcx,%rcx), %r13d
andl %edi, %r13d
addl 0x8(%rax), %r13d
leaq 0x20162c(%rip), %rdi    # 0x239a60
movl (%rdi,%rsi,4), %esi
testl $0xff0000, %esi         # imm = 0xFF0000
je 0x3844f
shrl $0x10, %esi
movsbl %sil, %esi
imull %esi, %edx
shll $0x2, %edx
subl %edx, %r13d
movq %r13, %rdi
movq 0xd0(%rsp), %rdx
movl (%rdx), %edx
movl 0x178(%rsp), %esi
addl %r13d, %esi
cmpl %esi, %edx
movq %r13, 0x50(%rsp)
jge 0x39088
movl 0x180(%rsp), %esi
leal (%rsi,%rcx,4), %ecx
movl %edi, %esi
subl %ecx, %esi
cmpl %esi, %edx
jle 0x39088
movzbl 0x12(%rax), %eax
movl 0x170(%rsp), %ecx
leal (%rcx,%rax,4), %eax
movl %eax, %ecx
negl %ecx
movswl (%rsp), %edx
cmpl $0x3ff, %edx            # imm = 0x3FF
jg 0x3850a
cmpl $0x0, 0x110(%rsp)
movl %eax, %edx
cmovsl %ecx, %edx
movl %ebx, %esi
subl %edx, %esi
movq (%rsp), %r9
movswq %r9w, %rdi
leal -0x4000(%r15), %r8d
leaq 0x3fc872(%rip), %r14    # 0x434d40
movw %r8w, (%r14,%rdi,2)
shlq $0x4, %rdi
leaq 0x3f8862(%rip), %r14    # 0x430d40
movl %esi, (%rdi,%r14)
movl %ebp, %r8d
subl %edx, %r8d
movl %r8d, 0x4(%rdi,%r14)
movl 0x40(%rsp), %r8d
movl %esi, 0x8(%rdi,%r14)
addl %ebp, %edx
movl %edx, 0xc(%rdi,%r14)
movl 0x10(%rsp), %r14d
incl %r9d
movq %r9, (%rsp)
movswl (%rsp), %edx
cmpl $0x3ff, %edx            # imm = 0x3FF
jg 0x39088
cmpl $0x0, 0x108(%rsp)
cmovsl %ecx, %eax
leal (%rax,%rbx), %ecx
movq (%rsp), %r9
movswq %r9w, %rdx
leal -0x4000(%r15), %esi
leaq 0x3fc802(%rip), %rdi    # 0x434d40
movw %si, (%rdi,%rdx,2)
shlq $0x4, %rdx
leaq 0x3f87f3(%rip), %rsi    # 0x430d40
movl %ecx, (%rdx,%rsi)
subl %eax, %ebp
movl %ebp, 0x4(%rdx,%rsi)
subl %eax, %ebx
movl %ebx, 0x8(%rdx,%rsi)
movl %ebp, 0xc(%rdx,%rsi)
jmp 0x39081
movq %r15, 0x20(%rsp)
movq %rbp, 0x48(%rsp)
movl %r12d, %ebp
movswq 0xe(%rax), %r15
leaq 0x3c8262(%rip), %rdx    # 0x4007e0
movswl (%rdx,%r15,2), %edx
movzbl 0x15(%rax), %r8d
imull %r8d, %edx
movsbl %r13b, %esi
sarl $0x7, %esi
leal (%rdx,%rdx), %edi
andl %esi, %edi
addl 0x8(%rax), %edi
leaq 0x2014be(%rip), %rsi    # 0x239a60
movl (%rsi,%r15,4), %esi
testl $0xff0000, %esi         # imm = 0xFF0000
je 0x385c9
movl %esi, %r9d
shrl $0x10, %r9d
movsbl %r9b, %r9d
imull %r9d, %r8d
movl 0x10(%rsp), %r14d
shll $0x2, %r8d
subl %r8d, %edi
movl 0x178(%rsp), %r8d
leal (%rdi,%r8), %r11d
movq 0xd0(%rsp), %r8
movl (%r8), %r8d
movq %r11, 0x50(%rsp)
cmpl %r11d, %r8d
jge 0x38b59
movl 0x180(%rsp), %r10d
leal (%r10,%rdx,4), %edx
subl %edx, %edi
cmpl %edi, %r8d
jle 0x38b64
shrl $0x8, %esi
movsbl %sil, %edx
movsbl 0x16(%rax), %esi
addl %edx, %esi
movl %esi, %edx
negl %edx
testb $0x4, %r13b
cmovel %esi, %edx
movzwl 0x1c(%rax), %r12d
movzbl 0x14(%rax), %eax
movl %r12d, %esi
movl $0x7ff, %ecx            # imm = 0x7FF
andl %ecx, %esi
leaq 0x395719(%rip), %rdi    # 0x3cdd50
movswq (%rdi,%rsi,2), %r14
imulq %rax, %r14
leal 0x600(%r12), %esi
andl %ecx, %esi
movq 0x48(%rsp), %rcx
movswq (%rdi,%rsi,2), %rbp
imulq %rax, %rbp
leaq 0x3d69c1(%rip), %rax    # 0x40f020
movswq (%rax,%r15,2), %rsi
movl %esi, %eax
sarl %eax
addl %edx, %eax
cltq
movq %rax, %rdx
imulq %r14, %rdx
shrq $0x10, %rdx
subl %edx, %ebx
movq %rsi, %rdx
imulq %r14, %rdx
shrq $0x10, %rdx
movq %rdx, 0x68(%rsp)
leal (%rbx,%rdx), %r8d
imulq %rbp, %rax
shrq $0x10, %rax
subl %eax, %ecx
imulq %rbp, %rsi
shrq $0x10, %rsi
movq %rsi, 0x90(%rsp)
leal (%rcx,%rsi), %r9d
subq $0x8, %rsp
movq 0xd0(%rsp), %rdi
movq 0x80(%rsp), %rsi
movl %ebx, %edx
movq %rcx, 0x50(%rsp)
movq %r8, 0xa8(%rsp)
movl %r9d, %r15d
pushq 0x78(%rsp)
callq 0x354ce
addq $0x10, %rsp
testl %eax, %eax
je 0x38c70
leal 0x300(%r12), %eax
movl $0x7ff, %edx            # imm = 0x7FF
andl %edx, %eax
leaq 0x395654(%rip), %rsi    # 0x3cdd50
movswq (%rsi,%rax,2), %rcx
movq 0x128(%rsp), %rax
imulq %rax, %rcx
shrq $0xe, %rcx
movq %rcx, 0x30(%rsp)
addl $0x100, %r12d           # imm = 0x100
andl %edx, %r12d
movswq (%rsi,%r12,2), %r14
imulq %rax, %r14
shrq $0xe, %r14
movq 0xb8(%rsp), %rax
movl (%rax), %edx
movq %rbx, %rbp
movl %ebx, %edi
subl %edx, %edi
movq 0x88(%rsp), %rax
movl (%rax), %esi
movl %r15d, %eax
subl %esi, %eax
imull %eax, %edi
movq 0xa0(%rsp), %r11
movl %r11d, %ecx
subl %edx, %ecx
movq 0x48(%rsp), %rbx
movl %ebx, %r8d
subl %esi, %r8d
imull %ecx, %r8d
cmpl %r8d, %edi
movq %r14, 0x28(%rsp)
movl %r15d, %r9d
jge 0x38ca3
testb $0x40, %r13b
movl 0x40(%rsp), %r8d
movl 0x80(%rsp), %r12d
leaq 0x17f2bb(%rip), %r10    # 0x1b7a50
movq 0x20(%rsp), %r15
jne 0x38f2f
movswl (%rsp), %edi
cmpl $0x3ff, %edi            # imm = 0x3FF
jg 0x38f7e
movl %r11d, %edi
movq 0x30(%rsp), %r14
subl %r14d, %edi
movswq (%rsp), %r8
movl %r9d, %r13d
leal -0x4000(%r15), %r9d
leaq 0x3fc56f(%rip), %r12    # 0x434d40
movw %r9w, (%r12,%r8,2)
movl %r13d, %r9d
shlq $0x4, %r8
leaq 0x3f855c(%rip), %r12    # 0x430d40
movl %edi, (%r8,%r12)
movl %r13d, %edi
subl 0x28(%rsp), %edi
movl %edi, 0x4(%r8,%r12)
movq %rbp, %r13
movl %ebp, %edi
subl 0x28(%rsp), %edi
movl %edi, 0x8(%r8,%r12)
leal (%rbx,%r14), %edi
movl %edi, 0xc(%r8,%r12)
movl 0x80(%rsp), %r12d
movl 0x40(%rsp), %r8d
movq (%rsp), %rdi
incl %edi
movq %rdi, (%rsp)
jmp 0x38f81
movl 0x8(%rax), %ecx
movl 0x178(%rsp), %edx
leal (%rcx,%rdx), %esi
movq 0xd0(%rsp), %rdx
movl (%rdx), %edx
movq %rsi, 0x50(%rsp)
cmpl %esi, %edx
setl %sil
movl %ecx, %edi
movl 0x180(%rsp), %r10d
subl %r10d, %edi
cmpl %edi, %edx
setg %dil
andb %sil, %dil
cmpb $0x1, %dil
jne 0x38f5a
testb $0x40, %r13b
je 0x38883
cmpl %ecx, %edx
setg %cl
testb $0x8, %r13b
sete %dl
cmpb %cl, %dl
je 0x38f5a
movswq 0xe(%rax), %rdi
leaq 0x2011d1(%rip), %rcx    # 0x239a60
movl (%rcx,%rdi,4), %ecx
movl %ecx, %edx
shrl $0x8, %edx
movsbl %dl, %edx
movsbl 0x16(%rax), %esi
addl %edx, %esi
shrl $0x10, %ecx
movsbl %cl, %ecx
movsbl 0x17(%rax), %edx
addl %ecx, %edx
movl %esi, %r10d
negl %r10d
testb $0x4, %r13b
cmovel %esi, %r10d
movl %edx, %r9d
negl %r9d
testb $0x8, %r13b
cmovel %edx, %r9d
movswq 0x1c(%rax), %rcx
movq %rcx, 0x20(%rsp)
leal 0x200(%rcx), %edx
movl $0x7ff, %esi            # imm = 0x7FF
andl %esi, %edx
leaq 0x39546a(%rip), %r12    # 0x3cdd50
movswq (%r12,%rdx,2), %rsi
movswq (%r12,%rcx,2), %rdx
leaq 0x3d6729(%rip), %r8     # 0x40f020
movswq (%r8,%rdi,2), %r8
movzbl 0x14(%rax), %r13d
leaq 0x3c7ed8(%rip), %r11    # 0x4007e0
movswq (%r11,%rdi,2), %rdi
movzbl 0x15(%rax), %eax
movl %r8d, %r11d
sarl %r11d
addl %r10d, %r11d
movslq %r11d, %r10
imulq %r13, %r10
movl %edi, %r11d
sarl %r11d
addl %r9d, %r11d
movslq %r11d, %r9
imulq %rax, %r9
movq %r10, %r11
imulq %rdx, %r11
movq %r9, %r14
imulq %rsi, %r14
addq %r11, %r14
shrq $0x10, %r14
addl %r14d, %ebx
movl %ebx, 0x3fcbf1(%rip)    # 0x435540
imulq %rdx, %r9
imulq %rsi, %r10
subq %r10, %r9
shrq $0x10, %r9
addl %r9d, %ebp
movl $0x7ff, %r9d            # imm = 0x7FF
movl %ebp, 0x3fcbf3(%rip)    # 0x435560
imulq %r8, %r13
movq %r13, %r8
imulq %rdx, %r8
shrq $0x10, %r8
movl %ebx, %r12d
subl %r8d, %r12d
movl %r12d, 0x3fcbbb(%rip)   # 0x435544
imulq %rsi, %r13
shrq $0x10, %r13
addl %ebp, %r13d
movl %r13d, 0x3fcbc9(%rip)   # 0x435564
imulq %rdi, %rax
imulq %rax, %rsi
shrq $0x10, %rsi
movl %r12d, %r8d
subl %esi, %r8d
movl %r8d, 0x3fcb94(%rip)    # 0x435548
movl %ebx, %r11d
subl %esi, %r11d
movl %r11d, 0x3fcb8b(%rip)   # 0x43554c
imulq %rdx, %rax
shrq $0x10, %rax
movl %r13d, %edi
subl %eax, %edi
movl %edi, 0x3fcb94(%rip)    # 0x435568
movl %ebp, %ecx
subl %eax, %ecx
movl %ecx, 0x3fcb8e(%rip)    # 0x43556c
movq 0x20(%rsp), %r10
leal 0x100(%r10), %eax
andl %r9d, %eax
leaq 0x39535c(%rip), %rsi    # 0x3cdd50
movswq (%rsi,%rax,2), %rax
movq 0x128(%rsp), %rdx
imulq %rdx, %rax
shrq $0xe, %rax
movq %rax, 0x30(%rsp)
leal 0x700(%r10), %eax
andl %r9d, %eax
movswq (%rsi,%rax,2), %rax
imulq %rdx, %rax
shrq $0xe, %rax
movq %rax, 0x28(%rsp)
movq 0xb8(%rsp), %rax
movl (%rax), %esi
movl %ebx, %edx
subl %esi, %edx
movq 0x88(%rsp), %rax
movl (%rax), %r9d
movl %r13d, %r14d
subl %r9d, %r14d
movl %r14d, %eax
movl %edx, 0xe8(%rsp)
imull %edx, %eax
movl %r12d, %r10d
subl %esi, %r10d
movl %ebp, %edx
subl %r9d, %edx
movl %edx, 0x104(%rsp)
movl %r10d, 0x68(%rsp)
imull %r10d, %edx
cmpl %edx, %eax
movl %ecx, 0x58(%rsp)
movl %r8d, 0x20(%rsp)
movl %edi, 0x48(%rsp)
movl %r9d, 0xa0(%rsp)
movl %esi, 0x90(%rsp)
movq %rbx, 0x130(%rsp)
jge 0x38b88
movq %r11, 0x98(%rsp)
subq $0x8, %rsp
movq 0xd0(%rsp), %rdi
movq 0x80(%rsp), %rsi
movl %r12d, 0x44(%rsp)
movl %r12d, %edx
movl %r13d, %ecx
movl %ebx, %r8d
movl %ebp, %r9d
pushq 0x78(%rsp)
callq 0x354ce
addq $0x10, %rsp
testl %eax, %eax
je 0x38d39
movswl (%rsp), %eax
cmpl $0x3ff, %eax            # imm = 0x3FF
movl 0x48(%rsp), %r9d
jg 0x38d52
movl 0x3c(%rsp), %r12d
movl %r12d, %eax
movq 0x28(%rsp), %rdi
subl %edi, %eax
movq (%rsp), %r8
movswq %r8w, %rcx
leal -0x4000(%r15), %edx
leaq 0x3fc228(%rip), %rsi    # 0x434d40
movw %dx, (%rsi,%rcx,2)
shlq $0x4, %rcx
leaq 0x3f8219(%rip), %rdx    # 0x430d40
movl %eax, (%rcx,%rdx)
movq 0x30(%rsp), %rsi
leal (%rsi,%r13), %eax
movl %eax, 0x4(%rcx,%rdx)
movq 0x130(%rsp), %rax
addl %esi, %eax
movl %eax, 0x8(%rcx,%rdx)
leal (%rbp,%rdi), %eax
movl %eax, 0xc(%rcx,%rdx)
incl %r8d
movq %r8, (%rsp)
jmp 0x38d57
movl 0x40(%rsp), %r8d
movl 0x8(%rsp), %edx
jmp 0x38b74
movl 0x40(%rsp), %r8d
movl 0x8(%rsp), %edx
leaq 0x17eedc(%rip), %r10    # 0x1b7a50
leaq 0x243135(%rip), %rdi    # 0x27bcb0
movl %ebp, %r12d
movq 0x20(%rsp), %r15
jmp 0x39093
movl %r8d, %eax
subl %esi, %eax
movl %esi, %edx
movl %ecx, %esi
subl %r9d, %esi
imull %eax, %esi
movl %r11d, %eax
subl %edx, %eax
movl %edi, %edx
subl %r9d, %edx
imull %eax, %edx
cmpl %edx, %esi
movl %edi, %r9d
jge 0x38d64
movl %r12d, 0x3c(%rsp)
subq $0x8, %rsp
movq 0xd0(%rsp), %rdi
movq 0x80(%rsp), %rsi
movq %r11, 0xa0(%rsp)
movl %r11d, %edx
pushq 0x78(%rsp)
callq 0x354ce
addq $0x10, %rsp
testl %eax, %eax
je 0x38d39
movswl (%rsp), %eax
cmpl $0x3ff, %eax            # imm = 0x3FF
movl 0x3c(%rsp), %r12d
jg 0x38d3e
movq 0x28(%rsp), %rdi
movq 0x98(%rsp), %r11
leal (%r11,%rdi), %eax
movq (%rsp), %r8
movswq %r8w, %rcx
leal -0x4000(%r15), %edx
leaq 0x3fc11d(%rip), %rsi    # 0x434d40
movw %dx, (%rsi,%rcx,2)
shlq $0x4, %rcx
leaq 0x3f810e(%rip), %rdx    # 0x430d40
movl %eax, (%rcx,%rdx)
movl 0x58(%rsp), %eax
movq 0x30(%rsp), %rsi
subl %esi, %eax
movl %eax, 0x4(%rcx,%rdx)
movl 0x20(%rsp), %r9d
movl %r9d, %eax
subl %esi, %eax
movl %eax, 0x8(%rcx,%rdx)
movl 0x48(%rsp), %esi
movl %esi, %eax
subl %edi, %eax
movl %eax, 0xc(%rcx,%rdx)
incl %r8d
movq %r8, (%rsp)
movl %r9d, %r8d
movl %esi, %r9d
jmp 0x38d64
movq %rbp, 0x28(%rsp)
movq %r14, 0x30(%rsp)
movl 0x40(%rsp), %r8d
movl 0x8(%rsp), %edx
movl 0x10(%rsp), %r14d
movl 0x80(%rsp), %r12d
leaq 0x17edb9(%rip), %r10    # 0x1b7a50
leaq 0x243012(%rip), %rdi    # 0x27bcb0
jmp 0x38b7e
movswl (%rsp), %edi
cmpl $0x3ff, %edi            # imm = 0x3FF
movq 0x20(%rsp), %r15
jg 0x38f6a
movq 0x30(%rsp), %r10
movq %rbp, %r13
leal (%r10,%rbp), %edi
movl %edi, 0x58(%rsp)
movswq (%rsp), %r8
movl %r9d, %edi
leal -0x4000(%r15), %r9d
leaq 0x3fc062(%rip), %r12    # 0x434d40
movw %r9w, (%r12,%r8,2)
movl %edi, %r9d
shlq $0x4, %r8
leaq 0x3f804f(%rip), %r12    # 0x430d40
movl 0x58(%rsp), %edi
movl %edi, (%r8,%r12)
leal (%rbx,%r14), %edi
movl %edi, 0x4(%r8,%r12)
leal (%r11,%r14), %edi
movl %edi, 0x8(%r8,%r12)
movl %r9d, %edi
subl %r10d, %edi
movl %edi, 0xc(%r8,%r12)
movq (%rsp), %rdi
incl %edi
movq %rdi, (%rsp)
movl 0x40(%rsp), %r8d
movl 0x80(%rsp), %r12d
leaq 0x17ed1c(%rip), %r10    # 0x1b7a50
jmp 0x38f81
movl 0x3c(%rsp), %r12d
movq 0x98(%rsp), %r11
movl 0x20(%rsp), %r8d
movl 0x48(%rsp), %r9d
jmp 0x38d64
movl 0x3c(%rsp), %r12d
movq 0x98(%rsp), %r11
movl 0x20(%rsp), %r8d
movl %r9d, %eax
movl 0xa0(%rsp), %edx
subl %edx, %eax
imull 0x68(%rsp), %eax
movl %r8d, %ecx
movl 0x90(%rsp), %esi
subl %esi, %ecx
imull %ecx, %r14d
cmpl %r14d, %eax
jge 0x38e53
movq (%rsp), %rbx
subq $0x8, %rsp
movq 0xd0(%rsp), %rdi
movq 0x80(%rsp), %rsi
movl %r8d, %edx
movl %r9d, %ecx
movl %r12d, %ebp
movl %r12d, %r8d
movl %r13d, %r9d
pushq 0x78(%rsp)
callq 0x354ce
addq $0x10, %rsp
testl %eax, %eax
movl 0x10(%rsp), %r14d
movl 0x80(%rsp), %r12d
je 0x38f55
movq %rbx, %rax
cwtl
cmpl $0x3ff, %eax            # imm = 0x3FF
movl 0x40(%rsp), %r8d
leaq 0x17ec64(%rip), %r10    # 0x1b7a50
jg 0x39088
movq 0x30(%rsp), %rsi
movl 0x20(%rsp), %r9d
subl %esi, %r9d
movq (%rsp), %rdi
movswq %di, %rax
leal -0x4000(%r15), %ecx
leaq 0x3fbf2b(%rip), %rdx    # 0x434d40
movw %cx, (%rdx,%rax,2)
shlq $0x4, %rax
leaq 0x3f7f1c(%rip), %rcx    # 0x430d40
movl %r9d, (%rax,%rcx)
movq 0x28(%rsp), %rdx
movl 0x48(%rsp), %r9d
subl %edx, %r9d
movl %r9d, 0x4(%rax,%rcx)
subl %edx, %ebp
movl %ebp, 0x8(%rax,%rcx)
addl %esi, %r13d
movl %r13d, 0xc(%rax,%rcx)
incl %edi
movq %rdi, (%rsp)
jmp 0x39088
movl %r11d, %eax
subl %esi, %eax
movl 0x104(%rsp), %ecx
imull %eax, %ecx
movl 0x58(%rsp), %r8d
movl %r8d, %eax
subl %edx, %eax
imull 0xe8(%rsp), %eax
cmpl %eax, %ecx
jge 0x38f3d
movq (%rsp), %r14
subq $0x8, %rsp
movq 0xd0(%rsp), %rdi
movq 0x80(%rsp), %rsi
movq 0x138(%rsp), %rbx
movl %ebx, %edx
movl %ebp, %ecx
movq %r11, %r13
movl %r8d, %r9d
movl %r11d, %r8d
pushq 0x78(%rsp)
callq 0x354ce
addq $0x10, %rsp
testl %eax, %eax
movl 0x80(%rsp), %r12d
je 0x390aa
movq %r14, %rax
cwtl
cmpl $0x3ff, %eax            # imm = 0x3FF
movl 0x40(%rsp), %r8d
leaq 0x17eb75(%rip), %r10    # 0x1b7a50
jg 0x38f2f
movq 0x30(%rsp), %rsi
addl %esi, %ebx
movq (%rsp), %rdi
movswq %di, %rax
leal -0x4000(%r15), %ecx
leaq 0x3fbe46(%rip), %rdx    # 0x434d40
movw %cx, (%rdx,%rax,2)
shlq $0x4, %rax
leaq 0x3f7e37(%rip), %rcx    # 0x430d40
movl %ebx, (%rax,%rcx)
movq 0x28(%rsp), %rdx
addl %edx, %ebp
movl %ebp, 0x4(%rax,%rcx)
addl %edx, %r13d
movl %r13d, 0x8(%rax,%rcx)
movl 0x58(%rsp), %edx
subl %esi, %edx
movl %edx, 0xc(%rax,%rcx)
incl %edi
movq %rdi, (%rsp)
movl 0x8(%rsp), %edx
movl 0x10(%rsp), %r14d
jmp 0x3908c
movl 0x40(%rsp), %r8d
movl 0x8(%rsp), %edx
movl 0x10(%rsp), %r14d
movl 0x80(%rsp), %r12d
jmp 0x38f5e
movl 0x40(%rsp), %r8d
movl 0x8(%rsp), %edx
leaq 0x17eaeb(%rip), %r10    # 0x1b7a50
jmp 0x3908c
movl 0x40(%rsp), %r8d
movl 0x80(%rsp), %r12d
leaq 0x17ead2(%rip), %r10    # 0x1b7a50
movq %rbp, %r13
movq 0x90(%rsp), %rdi
movq 0x68(%rsp), %r14
subl %r13d, %edx
imull %r14d, %edx
subl %ebx, %esi
imull %edi, %esi
addl %edx, %esi
js 0x39028
imull %r14d, %ecx
imull %edi, %eax
addl %ecx, %eax
movl 0x8(%rsp), %edx
jns 0x38f33
movswl (%rsp), %eax
cmpl $0x3ff, %eax            # imm = 0x3FF
movl 0x10(%rsp), %r14d
leaq 0x242cea(%rip), %rdi    # 0x27bcb0
jg 0x39093
movq 0x28(%rsp), %rbx
leal (%r11,%rbx), %eax
movl %r9d, %ebp
movq (%rsp), %r9
movswq %r9w, %rcx
leal -0x4000(%r15), %edx
leaq 0x3fbd52(%rip), %rsi    # 0x434d40
movw %dx, (%rsi,%rcx,2)
shlq $0x4, %rcx
leaq 0x3f7d43(%rip), %rdx    # 0x430d40
movl %eax, (%rcx,%rdx)
movl %ebp, %eax
movq 0x30(%rsp), %rsi
subl %esi, %eax
movl %eax, 0x4(%rcx,%rdx)
subl %esi, %r11d
movl %r11d, 0x8(%rcx,%rdx)
subl %ebx, %ebp
movl %ebp, 0xc(%rcx,%rdx)
movl 0x8(%rsp), %edx
incl %r9d
movq %r9, (%rsp)
jmp 0x39093
movswl (%rsp), %eax
cmpl $0x3ff, %eax            # imm = 0x3FF
movl 0x10(%rsp), %r14d
jg 0x39088
movl %ebp, %eax
movq 0x28(%rsp), %rdi
subl %edi, %eax
movq (%rsp), %r9
movswq %r9w, %rcx
leal -0x4000(%r15), %edx
leaq 0x3fbce9(%rip), %rsi    # 0x434d40
movw %dx, (%rsi,%rcx,2)
shlq $0x4, %rcx
leaq 0x3f7cda(%rip), %rdx    # 0x430d40
movl %eax, (%rcx,%rdx)
movq 0x30(%rsp), %rsi
leal (%rbx,%rsi), %eax
movl %eax, 0x4(%rcx,%rdx)
addl %esi, %ebp
movl %ebp, 0x8(%rcx,%rdx)
addl %edi, %ebx
movl %ebx, 0xc(%rcx,%rdx)
incl %r9d
movq %r9, (%rsp)
movl 0x8(%rsp), %edx
leaq 0x242c1d(%rip), %rdi    # 0x27bcb0
leaq 0x37c486(%rip), %rax    # 0x3b5520
movzwl (%rax,%r15,2), %eax
testw %ax, %ax
jns 0x383a8
jmp 0x390bd
movl 0x40(%rsp), %r8d
movl 0x8(%rsp), %edx
movl 0x10(%rsp), %r14d
jmp 0x38f5e
movq 0xf0(%rsp), %rcx
incq %rcx
movq 0x50(%rsp), %rax
movl %eax, 0xb4(%rsp)
movq 0x30(%rsp), %rax
movl %eax, 0x64(%rsp)
movq 0x28(%rsp), %rax
movl %eax, 0x60(%rsp)
movswq 0xb0(%rsp), %rax
cmpq %rax, %rcx
jl 0x37dc9
movq %rax, 0xf0(%rsp)
movslq 0x6ab51(%rip), %rax     # 0xa3c58
movq %rax, 0x78(%rsp)
movzwl (%rsp), %eax
movq %rax, 0x68(%rsp)
movslq 0xac(%rsp), %rax
movq %rax, 0x30(%rsp)
movslq 0xa8(%rsp), %rax
movq %rax, 0x48(%rsp)
movq $0x0, 0x58(%rsp)
movq 0xc0(%rsp), %rsi
movq 0xe0(%rsp), %rcx
movq 0xb8(%rsp), %rax
movl (%rax), %eax
movq 0x88(%rsp), %rdx
movl (%rdx), %r13d
cmpw $0x0, (%rsp)
movq %rax, 0x10(%rsp)
movq %rcx, 0xe0(%rsp)
jle 0x393c1
cltq
movq %rax, 0xa0(%rsp)
movslq %r13d, %rax
movq %rax, 0x90(%rsp)
movl $0xffffffff, 0x70(%rsp) # imm = 0xFFFFFFFF
movl %esi, %ebx
movl %ecx, %ebp
movq 0x68(%rsp), %r9
movq %rsi, 0xc0(%rsp)
movq %r13, 0x28(%rsp)
movq %r9, %r15
decq %r9
movq %r9, %rcx
shlq $0x4, %rcx
leaq 0x3f7b84(%rip), %rdx    # 0x430d40
movl (%rcx,%rdx), %r10d
movl 0x4(%rcx,%rdx), %r12d
movl 0x8(%rcx,%rdx), %eax
movl %eax, %r11d
subl %r10d, %r11d
movl 0xc(%rcx,%rdx), %ecx
movl %ecx, %r14d
subl %r12d, %r14d
movl %r13d, %edi
subl %r12d, %edi
imull %r11d, %edi
movl %r10d, %r8d
subl 0x10(%rsp), %r8d
movl %r14d, %edx
imull %r8d, %edx
addl %edi, %edx
testl %edx, %edx
movl %ebp, 0x50(%rsp)
movl %ebx, 0x1c(%rsp)
jle 0x3928c
movq %r15, 0x20(%rsp)
movl %ebp, %r15d
subl %r12d, %r15d
imull %r11d, %r15d
movl %ebx, %edi
subl %r10d, %edi
imull %r14d, %edi
cmpl %edi, %r15d
jg 0x39287
movl %ebx, %r15d
movq %r13, %rsi
movq 0x10(%rsp), %r13
subl %r13d, %r15d
movl %ebp, %edi
subl %esi, %edi
movl %r12d, %ebp
subl %esi, %ebp
imull %r15d, %ebp
imull %edi, %r8d
cmpl %r8d, %ebp
jle 0x3924a
movq %rsi, %r13
jmp 0x3927f
subl %esi, %ecx
imull %r15d, %ecx
subl %r13d, %eax
imull %edi, %eax
cmpl %eax, %ecx
jle 0x3927a
movl %r14d, %ecx
imull %r15d, %ecx
movl %r11d, %eax
imull %edi, %eax
subl %eax, %ecx
movq 0xc0(%rsp), %rsi
jne 0x392a3
movq 0x28(%rsp), %r13
jmp 0x39287
movq 0x28(%rsp), %r13
movq 0xc0(%rsp), %rsi
movq 0x20(%rsp), %r15
cmpq $0x1, %r15
movl 0x50(%rsp), %ebp
movl 0x1c(%rsp), %ebx
jg 0x391a8
jmp 0x393e6
movslq %r15d, %rax
movslq %ecx, %rcx
movq %rcx, 0x40(%rsp)
movslq %edi, %rcx
movl %edx, %edx
imulq %rdx, %rcx
movslq 0x50(%rsp), %rsi
movq 0x90(%rsp), %rdi
subq %rsi, %rdi
movq %rdi, 0x80(%rsp)
imulq %rdx, %rax
movslq %ebx, %rdx
movq 0xa0(%rsp), %rsi
subq %rdx, %rsi
movq %rsi, 0xc8(%rsp)
movl $0xfffffeff, %edi       # imm = 0xFFFFFEFF
movq 0x28(%rsp), %r13
incl %edi
je 0x393cf
movq 0x80(%rsp), %rdx
addq %rcx, %rdx
movq %rdx, 0x8(%rsp)
movq %r9, %rsi
movq 0xc8(%rsp), %rdx
leaq (%rax,%rdx), %r9
cqto
movq 0x40(%rsp), %rbx
idivq %rbx
movq %rax, %r8
movq 0x10(%rsp), %rax
leal (%rax,%r8), %ebp
movq %rcx, %rax
cqto
idivq %rbx
movq %rax, %rdx
leal (%rax,%r13), %ebx
movl %ebx, %r15d
subl %r12d, %r15d
imull %r11d, %r15d
movl %ebp, %r13d
subl %r10d, %r13d
imull %r14d, %r13d
movq %r9, %rax
movq %rsi, %r9
movq 0x8(%rsp), %rcx
cmpl %r13d, %r15d
movq 0x28(%rsp), %r13
jle 0x392f3
movl %r8d, %eax
negl %eax
cmovsl %r8d, %eax
movl %edx, %ecx
negl %ecx
cmovsl %edx, %ecx
addl %eax, %ecx
movq 0x10(%rsp), %rax
subl 0x1c(%rsp), %eax
movl %eax, %edx
negl %edx
cmovsl %eax, %edx
movl %r13d, %eax
subl 0x50(%rsp), %eax
movl %eax, %edi
negl %edi
cmovsl %eax, %edi
addl %edx, %edi
cmpl %edi, %ecx
movq 0xc0(%rsp), %rsi
movq 0x20(%rsp), %r15
jae 0x3928c
movl %ebp, 0x1c(%rsp)
movl %ebx, 0x50(%rsp)
movl %r9d, 0x70(%rsp)
jmp 0x3928c
movl $0xffffffff, 0x70(%rsp) # imm = 0xFFFFFFFF
movl %esi, %ebx
movl %ecx, %ebp
jmp 0x393e6
movq 0x10(%rsp), %rax
movl %eax, %ebx
movl %r13d, %ebp
movl %r9d, 0x70(%rsp)
movq 0xc0(%rsp), %rsi
movl 0x70(%rsp), %edx
testl %edx, %edx
js 0x3946c
movl %ebx, 0x1c(%rsp)
movl %edx, %edi
movq %rdi, %rax
shlq $0x4, %rax
leaq 0x3f793e(%rip), %rcx    # 0x430d40
movslq 0x8(%rax,%rcx), %r8
movslq (%rax,%rcx), %r9
subq %r9, %r8
movslq 0xc(%rax,%rcx), %rbx
movslq 0x4(%rax,%rcx), %rcx
subq %rcx, %rbx
movl %r8d, %eax
imull %r8d, %eax
movl %ebx, %edx
imull %ebx, %edx
addl %eax, %edx
movq 0xe0(%rsp), %r14
movq %rdi, 0x50(%rsp)
je 0x3949a
subl 0x1c(%rsp), %esi
imull %r8d, %esi
subl %ebp, %r14d
imull %ebx, %r14d
addl %esi, %r14d
movl %r14d, %eax
negl %eax
cmovsl %r14d, %eax
shrl $0xb, %eax
cmpl %edx, %eax
jae 0x39479
movslq %r14d, %rax
shlq $0x14, %rax
movl %edx, %edi
cqto
idivq %rdi
cltq
jmp 0x3947b
movq 0xe0(%rsp), %rcx
jmp 0x395f4
xorl %eax, %eax
movq %r8, %rsi
imulq %rax, %rsi
shrq $0x14, %rsi
addl 0x1c(%rsp), %esi
movq %rbx, %rdx
imulq %rax, %rdx
shrq $0x14, %rdx
addl %ebp, %edx
movq %rdx, %r14
movslq %r8d, %rax
imulq 0x30(%rsp), %rax
movslq %ebx, %rdx
imulq 0x48(%rsp), %rdx
addq %rax, %rdx
movslq 0x6a7a2(%rip), %rax     # 0xa3c58
movq 0x78(%rsp), %r15
cmpq %rax, %r15
jge 0x39512
leaq 0x3fc0b9(%rip), %rdi    # 0x435580
movswq 0x2(%rdi,%r15,2), %rdi
incq %r15
shlq $0x4, %rdi
leaq 0x3f7865(%rip), %r12    # 0x430d40
movslq 0x8(%rdi,%r12), %r10
movslq (%rdi,%r12), %r11
subq %r11, %r10
movslq 0xc(%rdi,%r12), %r11
movslq 0x4(%rdi,%r12), %rdi
subq %rdi, %r11
imulq 0x30(%rsp), %r10
imulq 0x48(%rsp), %r11
addq %r10, %r11
xorq %rdx, %r11
btq $0x25, %r11
jae 0x394bb
jmp 0x39787
xorl %edx, %edx
testl %ebx, %ebx
setg %dl
negl %edx
testl %ebx, %ebx
movl $0x1, %edi
cmovsl %edi, %edx
movq %rsi, %r10
movl %r8d, %esi
sarl $0x1f, %esi
testl %r8d, %r8d
cmovgl %edi, %esi
movl %r14d, %edi
subl %ecx, %edi
imull %r8d, %edi
movq %r10, %r15
subl %r9d, %r10d
imull %ebx, %r10d
cmpl %r10d, %edi
jg 0x3959e
movl %r8d, %r10d
negl %r10d
cmovsl %r8d, %r10d
movl %ebx, %r11d
negl %r11d
cmovsl %ebx, %r11d
xorl %edi, %edi
cmpl %r11d, %r10d
setbe %dil
testl %edi, %edi
movl $0x0, %r10d
cmovel %edx, %r10d
movl %esi, %r11d
cmovel %edi, %r11d
addl %r10d, %r15d
addl %r11d, %r14d
xorl $0x1, %edi
movl %r14d, %r10d
subl %ecx, %r10d
imull %r8d, %r10d
movl %r15d, %r11d
subl %r9d, %r11d
imull %ebx, %r11d
cmpl %r11d, %r10d
jle 0x39569
movq %r14, %rcx
cmpl 0x78(%rsp), %eax
jne 0x395bc
leaq 0x3fb792(%rip), %rax    # 0x434d40
movq 0x50(%rsp), %rdx
movswl (%rax,%rdx,2), %eax
movq %rax, 0x58(%rsp)
movl %r15d, %eax
movl 0x1c(%rsp), %ebx
subl %ebx, %eax
shll $0xe, %eax
movl %eax, 0xac(%rsp)
movl %ecx, %eax
subl %ebp, %eax
shll $0xe, %eax
movl %eax, 0xa8(%rsp)
leaq 0x3fbf9c(%rip), %rax    # 0x435580
movl 0x70(%rsp), %edx
movq 0x78(%rsp), %rsi
movw %dx, (%rax,%rsi,2)
movq %r15, %rsi
movq 0xb8(%rsp), %rax
movl %ebx, (%rax)
movq 0x88(%rsp), %rax
movl %ebp, (%rax)
testl %edx, %edx
js 0x39634
movl 0xac(%rsp), %eax
orl 0xa8(%rsp), %eax
je 0x39634
movq 0x78(%rsp), %rdx
leaq -0x1(%rdx), %rax
cmpq $0x1, %rdx
movq %rax, 0x78(%rsp)
jg 0x39148
cmpw $0x0, 0xb0(%rsp)
leaq 0x20941c(%rip), %r15    # 0x242a60
leaq 0x3f6ef5(%rip), %rcx    # 0x430540
jle 0x39685
movq 0xb8(%rsp), %rax
movl (%rax), %r14d
movzwl (%rcx), %ebx
movswl %bx, %edx
movl %r14d, %edi
movl %ebp, %esi
movq %rcx, %r12
callq 0x355a7
cmpl $0x1, %eax
je 0x397b5
addq $0x2, %r12
decq 0xf0(%rsp)
movq %r12, %rcx
jne 0x39658
movq 0xd8(%rsp), %rax
movw $0xffff, (%rax)         # imm = 0xFFFF
movswq 0x3958c6(%rip), %rbx    # 0x3cef60
testq %rbx, %rbx
jle 0x3979c
leaq (%rbx,%rbx,4), %rax
incq %rbx
leaq (%r15,%rax,8), %r12
addq $-0x1a, %r12
movl $0x7fffffff, (%rsp)     # imm = 0x7FFFFFFF
movq 0x88(%rsp), %rdx
movq 0xb8(%rsp), %rax
movl (%rax), %r14d
movl (%rdx), %r15d
leaq 0xfffe(%rbx), %r13
movswl %r13w, %edx
movl %r14d, %edi
movl %r15d, %esi
callq 0x355a7
cmpl $0x1, %eax
jne 0x396f9
testb $0x2, -0x2(%r12)
jne 0x39703
movl -0xa(%r12), %ebp
jmp 0x39714
movq 0x88(%rsp), %rdx
jmp 0x39774
movswl %r13w, %edi
movl %r14d, %esi
movl %r15d, %edx
callq 0x398a4
movl %eax, %ebp
movq 0xd8(%rsp), %rcx
movq 0xd0(%rsp), %rax
movq 0x88(%rsp), %rdx
subl (%rax), %ebp
jg 0x39768
testb $0x2, (%r12)
movl (%rax), %ebp
jne 0x39740
movl -0x6(%r12), %eax
jmp 0x3975f
movswl %r13w, %edi
movl %r14d, %esi
movl %r15d, %edx
callq 0x397ca
movq 0x88(%rsp), %rdx
movq 0xd8(%rsp), %rcx
movq 0x58(%rsp), %rsi
subl %eax, %ebp
jle 0x397c2
cmpl (%rsp), %ebp
jge 0x39774
movw %r13w, (%rcx)
movl %ebp, (%rsp)
decq %rbx
addq $-0x28, %r12
cmpq $0x1, %rbx
jg 0x396c1
jmp 0x3979c
movq 0x10(%rsp), %rdi
movl %r13d, %esi
movq 0xd8(%rsp), %rdx
callq 0x25f34
movq 0x58(%rsp), %rsi
movl %esi, %eax
addq $0x138, %rsp            # imm = 0x138
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0xd8(%rsp), %rax
movw %bx, (%rax)
jmp 0x3979c
addl $-0x2, %ebx
movw %bx, (%rcx)
jmp 0x397a1