// File: /workspace/github_c_makefile_star2_O2/jonof[P]jftekwar/jfbuild/src/polymost.c
// Function: polymost_drawsprite
void polymost_drawsprite (int snum)
{
	double px[6], py[6];
	float f, c, s, fx, fy, sx0, sy0, sx1, xp0, yp0, xp1, yp1, oxp0, oyp0, ryp0, ryp1, ft[4];
	float x0, y0, x1, y1, sc0, sf0, sc1, sf1, px2[6], py2[6], xv, yv, t0, t1;
	int i, j, spritenum, xoff=0, yoff=0, method, npoints;
	spritetype *tspr;

#ifdef DEBUGGINGAIDS
	polymostcallcounts.drawsprite++;
#endif

	tspr = tspriteptr[snum];
	if (tspr->owner < 0 || tspr->picnum < 0) return;

	globalpicnum      = tspr->picnum;
	globalshade       = tspr->shade;
	globalpal         = tspr->pal;
	globalorientation = tspr->cstat;
	spritenum         = tspr->owner;

	if ((globalorientation&48) != 48) {	// only non-voxel sprites should do this
		if (picanm[globalpicnum]&192) globalpicnum += animateoffs(globalpicnum,spritenum+32768);

		xoff = (int)((signed char)((picanm[globalpicnum]>>8)&255))+((int)tspr->xoffset);
		yoff = (int)((signed char)((picanm[globalpicnum]>>16)&255))+((int)tspr->yoffset);
	}

	method = METH_MASKED;
	if (tspr->cstat&2) { if (!(tspr->cstat&512)) method = METH_TRANS; else method = METH_INTRANS; }
	method |= METH_CLAMPED | METH_LAYERS;

#if USE_OPENGL
	gfogpalnum = sector[tspr->sectnum].floorpal;
	gfogdensity = gvisibility*((float)((unsigned char)(sector[tspr->sectnum].visibility+16)) / 255.f);

	while (rendmode == 3 && !(spriteext[tspr->owner].flags&SPREXT_NOTMD)) {
		if (usemodels && tile2model[tspr->picnum].modelid >= 0 && tile2model[tspr->picnum].framenum >= 0) {
			if (mddraw(tspr, 0)) {
				if (automapping == 1) show2dsprite[spritenum>>3] |= pow2char[spritenum&7];
				return;
			}
			break;	// else, render as flat sprite
		}
		if (usevoxels && (tspr->cstat&48)!=48 && tiletovox[tspr->picnum] >= 0 && voxmodels[ tiletovox[tspr->picnum] ]) {
			if (voxdraw(voxmodels[ tiletovox[tspr->picnum] ], tspr, 0)) {
				if (automapping == 1) show2dsprite[spritenum>>3] |= pow2char[spritenum&7];
				return;
			}
			break;	// else, render as flat sprite
		}
		if ((tspr->cstat&48)==48 && voxmodels[ tspr->picnum ]) {
			voxdraw(voxmodels[ tspr->picnum ], tspr, 0);
			if (automapping == 1) show2dsprite[spritenum>>3] |= pow2char[spritenum&7];
			return;
		}
		break;
	}
#endif

	switch((globalorientation>>4)&3)
	{
		case 0: //Face sprite

				//Project 3D to 2D
			sx0 = (float)(tspr->x-globalposx);
			sy0 = (float)(tspr->y-globalposy);
			xp0 = sy0*gcosang  - sx0*gsinang;
			yp0 = sx0*gcosang2 + sy0*gsinang2;
			if (yp0 <= SCISDIST) return;
			ryp0 = 1/yp0;
			sx0 = ghalfx*xp0*ryp0 + ghalfx;
			sy0 = ((float)(tspr->z-globalposz))*gyxscale*ryp0 + ghoriz;

			f = ryp0*(float)xdimen/160.0;
			fx = ((float)tspr->xrepeat)*f;
			fy = ((float)tspr->yrepeat)*f*((float)yxaspect/65536.0);
			sx0 -= fx*(float)xoff; if (tilesizx[globalpicnum]&1) sx0 += fx*.5;
			sy0 -= fy*(float)yoff;
			fx *= ((float)tilesizx[globalpicnum]);
			fy *= ((float)tilesizy[globalpicnum]);

			px[0] = px[3] = sx0-fx*.5; px[1] = px[2] = sx0+fx*.5;
			if (!(globalorientation&128)) { py[0] = py[1] = sy0-fy; py[2] = py[3] = sy0; }
											 else { py[0] = py[1] = sy0-fy*.5; py[2] = py[3] = sy0+fy*.5; }

			gdx = gdy = guy = gvx = 0; gdo = ryp0*gviewxrange;
			if (!(globalorientation&4))
				  { gux = (float)tilesizx[globalpicnum]*gdo/(px[1]-px[0]+.002); guo = -gux*(px[0]-.001); }
			else { gux = (float)tilesizx[globalpicnum]*gdo/(px[0]-px[1]-.002); guo = -gux*(px[1]+.001); }
			if (!(globalorientation&8))
				  { gvy = (float)tilesizy[globalpicnum]*gdo/(py[3]-py[0]+.002); gvo = -gvy*(py[0]-.001); }
			else { gvy = (float)tilesizy[globalpicnum]*gdo/(py[0]-py[3]-.002); gvo = -gvy*(py[3]+.001); }

			//Clip sprites to ceilings/floors when no parallaxing and not sloped
			if (!(sector[tspr->sectnum].ceilingstat&3))
			{
				sy0 = ((float)(sector[tspr->sectnum].ceilingz-globalposz))*gyxscale*ryp0 + ghoriz;
				if (py[0] < sy0) py[0] = py[1] = sy0;
			}
			if (!(sector[tspr->sectnum].floorstat&3))
			{
				sy0 = ((float)(sector[tspr->sectnum].floorz-globalposz))*gyxscale*ryp0 + ghoriz;
				if (py[2] > sy0) py[2] = py[3] = sy0;
			}

			drawpoly(px,py,4,method);
			break;
		case 1: //Wall sprite

				//Project 3D to 2D
			if (globalorientation&4) xoff = -xoff;
			if (globalorientation&8) yoff = -yoff;

			xv = (float)tspr->xrepeat * (float)sintable[(tspr->ang     )&2047] / 65536.0;
			yv = (float)tspr->xrepeat * (float)sintable[(tspr->ang+1536)&2047] / 65536.0;
			f = (float)(tilesizx[globalpicnum]>>1) + (float)xoff;
			x0 = (float)(tspr->x-globalposx) - xv*f; x1 = xv*(float)tilesizx[globalpicnum] + x0;
			y0 = (float)(tspr->y-globalposy) - yv*f; y1 = yv*(float)tilesizx[globalpicnum] + y0;

			yp0 = x0*gcosang2 + y0*gsinang2;
			yp1 = x1*gcosang2 + y1*gsinang2;
			if ((yp0 <= SCISDIST) && (yp1 <= SCISDIST)) return;
			xp0 = y0*gcosang - x0*gsinang;
			xp1 = y1*gcosang - x1*gsinang;

				//Clip to close parallel-screen plane
			oxp0 = xp0; oyp0 = yp0;
			if (yp0 < SCISDIST) { t0 = (SCISDIST-yp0)/(yp1-yp0); xp0 = (xp1-xp0)*t0+xp0; yp0 = SCISDIST; }
								else { t0 = 0.f; }
			if (yp1 < SCISDIST) { t1 = (SCISDIST-oyp0)/(yp1-oyp0); xp1 = (xp1-oxp0)*t1+oxp0; yp1 = SCISDIST; }
								else { t1 = 1.f; }

			f = ((float)tspr->yrepeat) * (float)tilesizy[globalpicnum] * 4;

			ryp0 = 1.0/yp0;
			ryp1 = 1.0/yp1;
			sx0 = ghalfx*xp0*ryp0 + ghalfx;
			sx1 = ghalfx*xp1*ryp1 + ghalfx;
			ryp0 *= gyxscale;
			ryp1 *= gyxscale;

			tspr->z -= ((yoff*tspr->yrepeat)<<2);
			if (globalorientation&128)
			{
				tspr->z += ((tilesizy[globalpicnum]*tspr->yrepeat)<<1);
				if (tilesizy[globalpicnum]&1) tspr->z += (tspr->yrepeat<<1); //Odd yspans
			}

			sc0 = ((float)(tspr->z-globalposz-f))*ryp0 + ghoriz;
			sc1 = ((float)(tspr->z-globalposz-f))*ryp1 + ghoriz;
			sf0 = ((float)(tspr->z-globalposz))*ryp0 + ghoriz;
			sf1 = ((float)(tspr->z-globalposz))*ryp1 + ghoriz;

			gdx = (ryp0-ryp1)*gxyaspect / (sx0-sx1);
			gdy = 0;
			gdo = ryp0*gxyaspect - gdx*sx0;

				//Original equations:
				//(gux*sx0 + guo)/(gdx*sx1 + gdo) = tilesizx[globalpicnum]*t0
				//(gux*sx1 + guo)/(gdx*sx1 + gdo) = tilesizx[globalpicnum]*t1
				//
				// gvx*sx0 + gvy*sc0 + gvo = 0
				// gvy*sx1 + gvy*sc1 + gvo = 0
				//(gvx*sx0 + gvy*sf0 + gvo)/(gdx*sx0 + gdo) = tilesizy[globalpicnum]
				//(gvx*sx1 + gvy*sf1 + gvo)/(gdx*sx1 + gdo) = tilesizy[globalpicnum]

				//gux*sx0 + guo = t0*tilesizx[globalpicnum]*yp0
				//gux*sx1 + guo = t1*tilesizx[globalpicnum]*yp1
			if (globalorientation&4) { t0 = 1.f-t0; t1 = 1.f-t1; }
			gux = (t0*ryp0 - t1*ryp1)*gxyaspect*(float)tilesizx[globalpicnum] / (sx0-sx1);
			guy = 0;
			guo = t0*ryp0*gxyaspect*(float)tilesizx[globalpicnum] - gux*sx0;

				//gvx*sx0 + gvy*sc0 + gvo = 0
				//gvx*sx1 + gvy*sc1 + gvo = 0
				//gvx*sx0 + gvy*sf0 + gvo = tilesizy[globalpicnum]*(gdx*sx0 + gdo)
			f = ((float)tilesizy[globalpicnum])*(gdx*sx0 + gdo) / ((sx0-sx1)*(sc0-sf0));
			if (!(globalorientation&8))
			{
				gvx = (sc0-sc1)*f;
				gvy = (sx1-sx0)*f;
				gvo = -gvx*sx0 - gvy*sc0;
			}
			else
			{
				gvx = (sf1-sf0)*f;
				gvy = (sx0-sx1)*f;
				gvo = -gvx*sx0 - gvy*sf0;
			}

			//Clip sprites to ceilings/floors when no parallaxing
			if (!(sector[tspr->sectnum].ceilingstat&1))
			{
				f = ((float)tspr->yrepeat) * (float)tilesizy[globalpicnum] * 4;
				if (sector[tspr->sectnum].ceilingz > tspr->z-f)
				{
					sc0 = ((float)(sector[tspr->sectnum].ceilingz-globalposz))*ryp0 + ghoriz;
					sc1 = ((float)(sector[tspr->sectnum].ceilingz-globalposz))*ryp1 + ghoriz;
				}
			}
			if (!(sector[tspr->sectnum].floorstat&1))
			{
				if (sector[tspr->sectnum].floorz < tspr->z)
				{
					sf0 = ((float)(sector[tspr->sectnum].floorz-globalposz))*ryp0 + ghoriz;
					sf1 = ((float)(sector[tspr->sectnum].floorz-globalposz))*ryp1 + ghoriz;
				}
			}

			if (sx0 > sx1)
			{
				if (globalorientation&64) return; //1-sided sprite
				f = sx0; sx0 = sx1; sx1 = f;
				f = sc0; sc0 = sc1; sc1 = f;
				f = sf0; sf0 = sf1; sf1 = f;
			}

			px[0] = sx0; py[0] = sc0;
			px[1] = sx1; py[1] = sc1;
			px[2] = sx1; py[2] = sf1;
			px[3] = sx0; py[3] = sf0;
			drawpoly(px,py,4,method);
			break;
		case 2: //Floor sprite

			if ((globalorientation&64) != 0)
				if ((globalposz > tspr->z) == (!(globalorientation&8)))
					return;
			if ((globalorientation&4) > 0) xoff = -xoff;
			if ((globalorientation&8) > 0) yoff = -yoff;

			i = (tspr->ang&2047);
			c = sintable[(i+512)&2047]/65536.0;
			s = sintable[i]/65536.0;
			x0 = ((tilesizx[globalpicnum]>>1)-xoff)*tspr->xrepeat;
			y0 = ((tilesizy[globalpicnum]>>1)-yoff)*tspr->yrepeat;
			x1 = ((tilesizx[globalpicnum]>>1)+xoff)*tspr->xrepeat;
			y1 = ((tilesizy[globalpicnum]>>1)+yoff)*tspr->yrepeat;

				//Project 3D to 2D
			for(j=0;j<4;j++)
			{
				sx0 = (float)(tspr->x-globalposx);
				sy0 = (float)(tspr->y-globalposy);
				if ((j+0)&2) { sy0 -= s*y0; sx0 -= c*y0; } else { sy0 += s*y1; sx0 += c*y1; }
				if ((j+1)&2) { sx0 -= s*x0; sy0 += c*x0; } else { sx0 += s*x1; sy0 -= c*x1; }
				px[j] = sy0*gcosang  - sx0*gsinang;
				py[j] = sx0*gcosang2 + sy0*gsinang2;
			}

			if (tspr->z < globalposz) //if floor sprite is above you, reverse order of points
			{
				f = px[0]; px[0] = px[1]; px[1] = f;
				f = py[0]; py[0] = py[1]; py[1] = f;
				f = px[2]; px[2] = px[3]; px[3] = f;
				f = py[2]; py[2] = py[3]; py[3] = f;
			}

				//Clip to SCISDIST plane
			npoints = 0;
			for(i=0;i<4;i++)
			{
				j = ((i+1)&3);
				if (py[i] >= SCISDIST) { px2[npoints] = px[i]; py2[npoints] = py[i]; npoints++; }
				if ((py[i] >= SCISDIST) != (py[j] >= SCISDIST))
				{
					f = (SCISDIST-py[i])/(py[j]-py[i]);
					px2[npoints] = (px[j]-px[i])*f + px[i];
					py2[npoints] = (py[j]-py[i])*f + py[i]; npoints++;
				}
			}
			if (npoints < 3) return;

				//Project rotated 3D points to screen
			f = ((float)(tspr->z-globalposz))*gyxscale;
			for(j=0;j<npoints;j++)
			{
				ryp0 = 1/py2[j];
				px[j] = ghalfx*px2[j]*ryp0 + ghalfx;
				py[j] = f*ryp0 + ghoriz;
			}

				//gd? Copied from floor rendering code
			gdx = 0;
			gdy = gxyaspect / (double)(tspr->z-globalposz);
			gdo = -ghoriz*gdy;
				//copied&modified from relative alignment
			xv = (float)tspr->x + s*x1 + c*y1; fx = (double)-(x0+x1)*s;
			yv = (float)tspr->y + s*y1 - c*x1; fy = (double)+(x0+x1)*c;
			f = 1.0/sqrt(fx*fx+fy*fy); fx *= f; fy *= f;
			ft[2] = singlobalang*fy + cosglobalang*fx;
			ft[3] = singlobalang*fx - cosglobalang*fy;
			ft[0] = ((double)(globalposy-yv))*fy + ((double)(globalposx-xv))*fx;
			ft[1] = ((double)(globalposx-xv))*fy - ((double)(globalposy-yv))*fx;
			gux = (double)ft[3]*((double)viewingrange)/(-65536.0*262144.0);
			gvx = (double)ft[2]*((double)viewingrange)/(-65536.0*262144.0);
			guy = (double)ft[0]*gdy; gvy = (double)ft[1]*gdy;
			guo = (double)ft[0]*gdo; gvo = (double)ft[1]*gdo;
			guo += (double)(ft[2]/262144.0-gux)*ghalfx;
			gvo -= (double)(ft[3]/262144.0+gvx)*ghalfx;
			f = 4.0/(float)tspr->xrepeat; gux *= f; guy *= f; guo *= f;
			f =-4.0/(float)tspr->yrepeat; gvx *= f; gvy *= f; gvo *= f;
			if (globalorientation&4)
			{
				gux = ((float)tilesizx[globalpicnum])*gdx - gux;
				guy = ((float)tilesizx[globalpicnum])*gdy - guy;
				guo = ((float)tilesizx[globalpicnum])*gdo - guo;
			}

			drawpoly(px,py,npoints,method);
			break;

		case 3: //Voxel sprite
		    break;
	}
	if (automapping == 1) show2dsprite[spritenum>>3] |= pow2char[spritenum&7];
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xa8, %rsp
movslq %edi, %rax
leaq 0x3a0372(%rip), %rcx    # 0x3f07d0
movq (%rcx,%rax,8), %r14
movswl 0x1e(%r14), %ebp
testl %ebp, %ebp
js 0x516f4
movswq 0xe(%r14), %rax
testq %rax, %rax
js 0x516f4
leaq 0x3b8b8c(%rip), %r10    # 0x409010
movw %ax, (%r10)
movsbl 0x10(%r14), %ecx
leaq 0x3bd398(%rip), %rdx    # 0x40d82c
movl %ecx, (%rdx)
movzbl 0x11(%r14), %ecx
leaq 0x3b8b62(%rip), %rdx    # 0x409004
movl %ecx, (%rdx)
movzwl 0xc(%r14), %ecx
movswl %cx, %edx
leaq 0x3b8b4d(%rip), %r8     # 0x409000
movl %edx, (%r8)
movl %edx, %esi
notl %esi
xorl %r13d, %r13d
testb $0x30, %sil
jne 0x504cb
xorl %r12d, %r12d
xorl %r15d, %r15d
jmp 0x5052d
leaq 0x1e358e(%rip), %rbx    # 0x233a60
testb $-0x40, (%rbx,%rax,4)
je 0x50507
movl %ebp, %ecx
orl $0x8000, %ecx           # imm = 0x8000
movswl %ax, %edi
movswl %cx, %esi
movq %r10, %r15
movq %r8, %r12
callq 0x2163b
movq %r12, %r8
movq %r15, %r10
addw (%r15), %ax
movw %ax, (%r15)
movzwl 0xc(%r14), %ecx
movzwl %cx, %edx
movswq %ax, %rax
movl (%rbx,%rax,4), %eax
movl %eax, %esi
shrl $0x8, %esi
movsbl %sil, %esi
movsbl 0x16(%r14), %r12d
addl %esi, %r12d
shrl $0x10, %eax
movsbl %al, %eax
movsbl 0x17(%r14), %r15d
addl %eax, %r15d
btl $0x9, %edx
adcl $0xe, %r13d
testb $0x2, %dl
pushq $0xd
popq %rbx
cmovnel %r13d, %ebx
movswq 0x18(%r14), %rax
imulq $0x28, %rax, %rax
leaq 0x1ec511(%rip), %r11    # 0x23ca60
movb 0x20(%r11,%rax), %dl
addb $0x10, %dl
movzbl %dl, %edx
cvtsi2ss %edx, %xmm0
movzbl 0x1d(%r11,%rax), %eax
divss 0x1edb4(%rip), %xmm0    # 0x6f320
cvtss2sd %xmm0, %xmm0
mulsd 0x5a7658(%rip), %xmm0   # 0x5f7bd0
cvtsd2ss %xmm0, %xmm0
movl %eax, 0x5a33f6(%rip)    # 0x5f3978
movss %xmm0, 0x5a33f2(%rip)   # 0x5f397c
cmpl $0x3, 0x5a33bf(%rip)    # 0x5f3950
jne 0x50683
movswq 0x1e(%r14), %rax
imulq $0xc, %rax, %rax
leaq 0x2d5709(%rip), %rdx    # 0x325cb0
testb $0x1, 0x8(%rdx,%rax)
jne 0x50683
cmpl $0x0, 0x4df57(%rip)     # 0x9e510
je 0x505f0
movswq 0xe(%r14), %rax
imulq $0xc, %rax, %rdx
leaq 0x5f1a75(%rip), %rax    # 0x642040
cmpl $0x0, (%rax,%rdx)
js 0x505f0
addq %rdx, %rax
cmpl $0x0, 0x8(%rax)
js 0x505f0
movq %r14, %rdi
xorl %esi, %esi
movq %r10, %r13
movl %ebp, 0x60(%rsp)
movq %r8, %rbp
callq 0x59070
jmp 0x5063e
leaq 0x4d189(%rip), %rax     # 0x9d780
andl $0x30, %ecx
cmpl $0x0, (%rax)
je 0x50659
cmpw $0x30, %cx
je 0x50659
movswq 0xe(%r14), %rax
leaq 0x3344bf(%rip), %rcx    # 0x384ad0
movslq (%rcx,%rax,4), %rax
testq %rax, %rax
js 0x50683
leaq 0x60ca3f(%rip), %rcx    # 0x65d060
movq (%rcx,%rax,8), %rdi
testq %rdi, %rdi
je 0x50683
movq %r14, %rsi
xorl %edx, %edx
movq %r10, %r13
movl %ebp, 0x60(%rsp)
movq %r8, %rbp
callq 0x58376
movq %rbp, %r8
movl 0x60(%rsp), %ebp
leaq 0x1ec414(%rip), %r11    # 0x23ca60
movq %r13, %r10
testl %eax, %eax
jne 0x516c9
jmp 0x50683
cmpw $0x30, %cx
jne 0x50683
movswq 0xe(%r14), %rax
leaq 0x60c9f5(%rip), %rcx    # 0x65d060
movq (%rcx,%rax,8), %rdi
testq %rdi, %rdi
je 0x50683
movq %r14, %rsi
xorl %edx, %edx
callq 0x58376
jmp 0x516c9
movl (%r8), %eax
movl %eax, %ecx
shrl $0x4, %ecx
andl $0x3, %ecx
leaq 0x1f02b(%rip), %rdx     # 0x6f6c0
movslq (%rdx,%rcx,4), %rcx
addq %rdx, %rcx
jmpq *%rcx
leaq 0x1e33ab(%rip), %rcx    # 0x233a50
movl (%r14), %edx
subl (%rcx), %edx
cvtsi2ss %edx, %xmm1
movl 0x4(%r14), %ecx
leaq 0x1e339b(%rip), %rdx    # 0x233a54
subl (%rdx), %ecx
cvtsi2ss %ecx, %xmm0
cvtss2sd %xmm0, %xmm0
cvtss2sd %xmm1, %xmm1
movsd 0x5a32e9(%rip), %xmm2   # 0x5f39b8
mulsd %xmm0, %xmm2
movsd 0x5a32cd(%rip), %xmm3   # 0x5f39a8
mulsd %xmm1, %xmm3
addsd %xmm2, %xmm3
cvtsd2ss %xmm3, %xmm2
movss 0x1b8e5(%rip), %xmm5    # 0x6bfd4
ucomiss %xmm2, %xmm5
jae 0x516f4
mulsd 0x5a32c0(%rip), %xmm1   # 0x5f39c0
mulsd 0x5a32a8(%rip), %xmm0   # 0x5f39b0
subsd %xmm1, %xmm0
cvtsd2ss %xmm0, %xmm0
divss %xmm2, %xmm5
movsd 0x5a3414(%rip), %xmm1   # 0x5f3b30
cvtss2sd %xmm0, %xmm2
mulsd %xmm1, %xmm2
cvtss2sd %xmm5, %xmm0
mulsd %xmm0, %xmm2
addsd %xmm1, %xmm2
cvtsd2ss %xmm2, %xmm4
movl 0x8(%r14), %edx
leaq 0x214321(%rip), %rcx    # 0x264a60
movl (%rcx), %ecx
subl %ecx, %edx
cvtsi2ss %edx, %xmm1
cvtss2sd %xmm1, %xmm3
movsd 0x5a7465(%rip), %xmm1   # 0x5f7bb8
mulsd %xmm1, %xmm3
movsd 0x5a33d9(%rip), %xmm2   # 0x5f3b38
mulsd %xmm0, %xmm3
addsd %xmm2, %xmm3
cvtsd2ss %xmm3, %xmm3
leaq 0x4d0be(%rip), %rdx     # 0x9d830
cvtsi2ssl (%rdx), %xmm6
mulss %xmm5, %xmm6
movzbl 0x14(%r14), %edx
cvtsi2ss %edx, %xmm5
divss 0x1ebb5(%rip), %xmm6    # 0x6f340
mulss %xmm6, %xmm5
movzbl 0x15(%r14), %edx
cvtsi2ss %edx, %xmm7
mulss %xmm6, %xmm7
leaq 0x3b0845(%rip), %rdx    # 0x400fe8
cvtsi2ssl (%rdx), %xmm6
cvtss2sd %xmm7, %xmm7
cvtss2sd %xmm6, %xmm6
mulsd 0x19809(%rip), %xmm6    # 0x69fc0
mulsd %xmm7, %xmm6
cvtsi2ss %r12d, %xmm7
cvtsd2ss %xmm6, %xmm6
mulss %xmm5, %xmm7
subss %xmm7, %xmm4
movswq (%r10), %rdx
leaq 0x3b8849(%rip), %rsi    # 0x409020
movzwl (%rsi,%rdx,2), %esi
testb $0x1, %sil
je 0x507f9
cvtss2sd %xmm5, %xmm7
mulsd 0x1ed73(%rip), %xmm7    # 0x6f560
cvtss2sd %xmm4, %xmm4
addsd %xmm4, %xmm7
cvtsd2ss %xmm7, %xmm4
cvtsi2ss %r15d, %xmm7
mulss %xmm6, %xmm7
subss %xmm7, %xmm3
movswl %si, %esi
cvtsi2ss %esi, %xmm8
leaq 0x3a9fcb(%rip), %rdi    # 0x3fa7e0
movswl (%rdi,%rdx,2), %edx
cvtsi2ss %edx, %xmm7
mulss %xmm8, %xmm5
mulss %xmm6, %xmm7
cvtss2sd %xmm4, %xmm4
cvtss2sd %xmm5, %xmm6
movaps 0x1c56b(%rip), %xmm5    # 0x6cda0
xorps %xmm6, %xmm5
movlhps %xmm6, %xmm5            # xmm5 = xmm5[0],xmm6[0]
movlhps %xmm4, %xmm4            # xmm4 = xmm4[0,0]
mulpd 0x1eb5a(%rip), %xmm5    # 0x6f3a0
addpd %xmm4, %xmm5
movapd %xmm5, %xmm4
shufpd $0x1, %xmm5, %xmm4      # xmm4 = xmm4[1],xmm5[0]
movapd %xmm4, 0x40(%rsp)
movapd %xmm5, 0x30(%rsp)
testb %al, %al
js 0x514c3
movaps %xmm3, %xmm4
subss %xmm7, %xmm4
unpcklps %xmm3, %xmm4            # xmm4 = xmm4[0],xmm3[0],xmm4[1],xmm3[1]
cvtps2pd %xmm4, %xmm4
jmp 0x514e7
movl %r12d, %edi
negl %edi
testb $0x4, %al
cmovel %r12d, %edi
movl %r15d, %ecx
negl %ecx
testb $0x8, %al
cmovnel %r15d, %ecx
movzbl 0x14(%r14), %edx
cvtsi2ss %edx, %xmm2
movzwl 0x1c(%r14), %edx
movl $0x7ff, %esi            # imm = 0x7FF
movl %edx, %r8d
andl %esi, %r8d
leaq 0x3774a1(%rip), %r9     # 0x3c7d50
movswl (%r9,%r8,2), %r8d
cvtsi2ss %r8d, %xmm0
mulss %xmm2, %xmm0
addl $0x600, %edx            # imm = 0x600
andl %esi, %edx
movswl (%r9,%rdx,2), %edx
cvtsi2ss %edx, %xmm1
movss 0x1ea5e(%rip), %xmm3    # 0x6f334
movswq (%r10), %rdx
leaq 0x3b873f(%rip), %rsi    # 0x409020
movswl (%rsi,%rdx,2), %r8d
cvtsi2ss %r8d, %xmm4
sarl %r8d
cvtsi2ss %r8d, %xmm5
mulss %xmm3, %xmm0
cvtsi2ss %edi, %xmm6
mulss %xmm2, %xmm1
mulss %xmm3, %xmm1
addss %xmm5, %xmm6
leaq 0x1e3142(%rip), %rdi    # 0x233a50
movl (%r14), %r8d
movl 0x4(%r14), %r9d
subl (%rdi), %r8d
cvtsi2ss %r8d, %xmm2
movaps %xmm0, %xmm3
mulss %xmm6, %xmm3
leaq 0x1e3129(%rip), %rdi    # 0x233a54
subl (%rdi), %r9d
subss %xmm3, %xmm2
cvtsi2ss %r9d, %xmm3
mulss %xmm4, %xmm0
addss %xmm2, %xmm0
mulss %xmm1, %xmm6
subss %xmm6, %xmm3
mulss %xmm4, %xmm1
cvtss2sd %xmm2, %xmm4
movsd 0x5a3051(%rip), %xmm6   # 0x5f39a8
cvtss2sd %xmm3, %xmm5
movsd 0x5a3054(%rip), %xmm8   # 0x5f39b8
movapd %xmm8, %xmm2
mulsd %xmm5, %xmm2
movaps %xmm4, %xmm7
mulsd %xmm6, %xmm7
addsd %xmm2, %xmm7
cvtsd2ss %xmm7, %xmm2
addss %xmm3, %xmm1
cvtss2sd %xmm0, %xmm7
cvtss2sd %xmm1, %xmm1
mulsd %xmm1, %xmm8
mulsd %xmm7, %xmm6
addsd %xmm8, %xmm6
cvtsd2ss %xmm6, %xmm0
movss 0x1b632(%rip), %xmm3    # 0x6bfd4
ucomiss %xmm2, %xmm3
jb 0x509b0
ucomiss %xmm0, %xmm3
jae 0x516f4
movsd 0x5a2ff7(%rip), %xmm8   # 0x5f39b0
movsd 0x5a2ffe(%rip), %xmm9   # 0x5f39c0
mulsd %xmm9, %xmm4
mulsd %xmm8, %xmm5
subsd %xmm4, %xmm5
cvtsd2ss %xmm5, %xmm6
mulsd %xmm9, %xmm7
mulsd %xmm8, %xmm1
subsd %xmm7, %xmm1
cvtsd2ss %xmm1, %xmm1
cvtss2sd %xmm2, %xmm7
xorps %xmm5, %xmm5
ucomiss %xmm2, %xmm3
movaps %xmm0, %xmm9
subss %xmm2, %xmm9
movaps %xmm7, %xmm4
movaps %xmm6, %xmm2
jbe 0x50a2d
movsd 0x1a0f7(%rip), %xmm4    # 0x6ab00
movapd %xmm4, %xmm2
subsd %xmm7, %xmm2
cvtss2sd %xmm9, %xmm5
divsd %xmm5, %xmm2
cvtsd2ss %xmm2, %xmm5
movaps %xmm1, %xmm2
subss %xmm6, %xmm2
mulss %xmm5, %xmm2
addss %xmm6, %xmm2
ucomiss %xmm0, %xmm3
jbe 0x51136
movsd 0x1a0c1(%rip), %xmm8    # 0x6ab00
movapd %xmm8, %xmm0
subsd %xmm7, %xmm0
cvtss2sd %xmm9, %xmm3
divsd %xmm3, %xmm0
cvtsd2ss %xmm0, %xmm3
subss %xmm6, %xmm1
mulss %xmm3, %xmm1
addss %xmm6, %xmm1
jmp 0x5113b
movq %r8, %r13
testb $0x40, %al
jne 0x50a74
movl %eax, %ecx
andl $0x8, %ecx
jmp 0x50a96
leaq 0x213fe5(%rip), %rcx    # 0x264a60
movl (%rcx), %ecx
cmpl 0x8(%r14), %ecx
setg %dl
movl %eax, %ecx
andl $0x8, %ecx
sete %sil
cmpb %dl, %sil
je 0x516f4
movl %r12d, %edi
negl %edi
testb $0x4, %al
cmovel %r12d, %edi
movl %r15d, %r8d
negl %r8d
testl %ecx, %ecx
cmovel %r15d, %r8d
movzwl 0x1c(%r14), %edx
movq %r10, %rax
movswq (%r10), %rcx
leaq 0x3b8560(%rip), %rsi    # 0x409020
movswl (%rsi,%rcx,2), %r10d
sarl %r10d
movl %r10d, %r9d
subl %edi, %r9d
movzbl 0x14(%r14), %esi
imull %esi, %r9d
cvtsi2ss %r9d, %xmm0
movl $0x7ff, %r11d           # imm = 0x7FF
movl %edx, %r9d
leaq 0x3a9cf4(%rip), %r15    # 0x3fa7e0
movswl (%r15,%rcx,2), %r15d
sarl %r15d
movl %r15d, %r12d
subl %r8d, %r12d
movzbl 0x15(%r14), %ecx
imull %ecx, %r12d
cvtsi2ss %r12d, %xmm11
andl %r11d, %r9d
addl $0x200, %edx            # imm = 0x200
addl %edi, %r10d
imull %esi, %r10d
cvtsi2ss %r10d, %xmm2
addl %r8d, %r15d
imull %ecx, %r15d
cvtsi2ss %r15d, %xmm8
andl %r11d, %edx
leaq 0x37721d(%rip), %r10    # 0x3c7d50
leaq 0x1e2f16(%rip), %rdi    # 0x233a50
movl (%rdi), %edi
leaq 0x1e2f11(%rip), %r8     # 0x233a54
movl (%r8), %r8d
movsd 0x5a2e62(%rip), %xmm5   # 0x5f39b0
movsd 0x5a2e6a(%rip), %xmm6   # 0x5f39c0
xorpd 0x1c242(%rip), %xmm6    # 0x6cda0
movsd 0x5a2e42(%rip), %xmm7   # 0x5f39a8
pxor %xmm1, %xmm1
pinsrw $0x1, (%r10,%rdx,2), %xmm1
pinsrw $0x3, (%r10,%r9,2), %xmm1
movsd 0x5a2e38(%rip), %xmm3   # 0x5f39b8
psrad $0x10, %xmm1
cvtdq2pd %xmm1, %xmm1
mulpd 0x1e91f(%rip), %xmm1    # 0x6f4b0
cvtpd2ps %xmm1, %xmm4
movq (%r14), %xmm1
movd %r8d, %xmm9
movd %edi, %xmm10
punpckldq %xmm9, %xmm10   # xmm10 = xmm10[0],xmm9[0],xmm10[1],xmm9[1]
psubd %xmm10, %xmm1
cvtdq2ps %xmm1, %xmm9
movapd 0x1d916(%rip), %xmm1    # 0x6e4d0
xorpd %xmm4, %xmm1
shufps $0x0, %xmm11, %xmm11    # xmm11 = xmm11[0,0,0,0]
mulps %xmm4, %xmm11
movaps %xmm8, 0x60(%rsp)
movaps %xmm8, %xmm10
shufps $0x0, %xmm8, %xmm10     # xmm10 = xmm10[0,0],xmm8[0,0]
mulps %xmm4, %xmm10
addps %xmm9, %xmm10
subps %xmm11, %xmm9
movaps %xmm0, %xmm13
shufps $0x0, %xmm0, %xmm13     # xmm13 = xmm13[0,0],xmm0[0,0]
movapd %xmm1, %xmm12
shufps $0x10, %xmm4, %xmm12    # xmm12 = xmm12[0,0],xmm4[1,0]
shufps $0xe2, %xmm4, %xmm12    # xmm12 = xmm12[2,0],xmm4[2,3]
movaps %xmm2, %xmm11
shufps $0x0, %xmm2, %xmm11     # xmm11 = xmm11[0,0],xmm2[0,0]
mulps %xmm12, %xmm11
movaps %xmm4, %xmm12
shufps $0x10, %xmm1, %xmm12    # xmm12 = xmm12[0,0],xmm1[1,0]
shufps $0xe2, %xmm1, %xmm12    # xmm12 = xmm12[2,0],xmm1[2,3]
mulps %xmm13, %xmm12
xorl %edx, %edx
cmpq $0x4, %rdx
je 0x50cb6
xorl %r9d, %r9d
cmpq $0x2, %rdx
setb %r9b
movd %r9d, %xmm13
pshufd $0x50, %xmm13, %xmm13   # xmm13 = xmm13[0,0,1,1]
pslld $0x1f, %xmm13
psrad $0x1f, %xmm13
movaps %xmm10, %xmm14
andps %xmm13, %xmm14
andnps %xmm9, %xmm13
orps %xmm14, %xmm13
leaq 0x1(%rdx), %r9
testb $0x2, %r9b
je 0x50c67
addps %xmm12, %xmm13
jmp 0x50c6b
addps %xmm11, %xmm13
cvtss2sd %xmm13, %xmm14
shufps $0x55, %xmm13, %xmm13   # xmm13 = xmm13[1,1,1,1]
cvtss2sd %xmm13, %xmm13
movaps %xmm14, %xmm15
mulsd %xmm6, %xmm15
movapd %xmm3, %xmm8
mulsd %xmm13, %xmm8
mulsd %xmm5, %xmm13
addsd %xmm15, %xmm13
movsd %xmm13, 0x30(%rsp,%rdx,8)
mulsd %xmm7, %xmm14
addsd %xmm8, %xmm14
movsd %xmm14, (%rsp,%rdx,8)
movq %r9, %rdx
jmp 0x50c1b
movl 0x8(%r14), %r9d
leaq 0x213d9f(%rip), %rdx    # 0x264a60
subl (%rdx), %r9d
jge 0x50d34
cvtsd2ss 0x30(%rsp), %xmm3
movsd 0x38(%rsp), %xmm5
movsd 0x48(%rsp), %xmm6
movsd %xmm5, 0x30(%rsp)
cvtss2sd %xmm3, %xmm3
movsd %xmm3, 0x38(%rsp)
cvtsd2ss (%rsp), %xmm3
movsd 0x8(%rsp), %xmm5
movsd 0x18(%rsp), %xmm7
movsd %xmm5, (%rsp)
cvtss2sd %xmm3, %xmm3
movsd %xmm3, 0x8(%rsp)
cvtsd2ss 0x40(%rsp), %xmm3
movsd %xmm6, 0x40(%rsp)
cvtss2sd %xmm3, %xmm3
cvtsd2ss 0x10(%rsp), %xmm5
movsd %xmm3, 0x48(%rsp)
movsd %xmm7, 0x10(%rsp)
cvtss2sd %xmm5, %xmm3
movsd %xmm3, 0x18(%rsp)
xorl %edx, %edx
pushq $0x1
popq %r10
movsd 0x19dbd(%rip), %xmm8    # 0x6ab00
cmpq $0x5, %r10
je 0x50dfc
movsd -0x8(%rsp,%r10,8), %xmm5
ucomisd %xmm8, %xmm5
jb 0x50d7a
cvtsd2ss 0x28(%rsp,%r10,8), %xmm3
movslq %edx, %rdx
movss %xmm3, 0x90(%rsp,%rdx,4)
cvtsd2ss %xmm5, %xmm3
movss %xmm3, 0x70(%rsp,%rdx,4)
incl %edx
movl %r10d, %r11d
andl $0x3, %r11d
ucomisd %xmm8, %xmm5
setae %r15b
movsd (%rsp,%r11,8), %xmm6
ucomisd %xmm8, %xmm6
sbbb $0x0, %r15b
jne 0x50df4
movapd %xmm8, %xmm3
subsd %xmm5, %xmm3
subsd %xmm5, %xmm6
divsd %xmm6, %xmm3
cvtsd2ss %xmm3, %xmm3
movsd 0x30(%rsp,%r11,8), %xmm7
movsd 0x28(%rsp,%r10,8), %xmm9
subsd %xmm9, %xmm7
cvtss2sd %xmm3, %xmm3
mulsd %xmm3, %xmm7
addsd %xmm9, %xmm7
cvtsd2ss %xmm7, %xmm7
movslq %edx, %rdx
movss %xmm7, 0x90(%rsp,%rdx,4)
mulsd %xmm3, %xmm6
addsd %xmm5, %xmm6
cvtsd2ss %xmm6, %xmm3
movss %xmm3, 0x70(%rsp,%rdx,4)
incl %edx
incq %r10
jmp 0x50d43
cmpl $0x3, %edx
jl 0x516f4
cvtsi2ss %r9d, %xmm3
cvtss2sd %xmm3, %xmm3
mulsd 0x5a6da2(%rip), %xmm3   # 0x5f7bb8
cvtsd2ss %xmm3, %xmm6
movsd 0x5a2d0e(%rip), %xmm7   # 0x5f3b30
movsd 0x5a2d0e(%rip), %xmm5   # 0x5f3b38
movl %edx, %r10d
xorl %r11d, %r11d
movss 0x1b19b(%rip), %xmm9    # 0x6bfd4
cmpq %r11, %r10
je 0x50e85
movaps %xmm9, %xmm3
divss 0x70(%rsp,%r11,4), %xmm3
cvtss2sd 0x90(%rsp,%r11,4), %xmm10
mulsd %xmm7, %xmm10
cvtss2sd %xmm3, %xmm11
mulsd %xmm10, %xmm11
addsd %xmm7, %xmm11
movsd %xmm11, 0x30(%rsp,%r11,8)
mulss %xmm6, %xmm3
cvtss2sd %xmm3, %xmm3
addsd %xmm5, %xmm3
movsd %xmm3, (%rsp,%r11,8)
incq %r11
jmp 0x50e39
andq $0x0, 0x5a2cc3(%rip)    # 0x5f3b50
movsd 0x5a6d2b(%rip), %xmm6   # 0x5f7bc0
cvtsi2sd %r9d, %xmm3
divsd %xmm3, %xmm6
movsd %xmm6, 0x5a2cb2(%rip)   # 0x5f3b58
xorpd 0x1bef2(%rip), %xmm5    # 0x6cda0
mulsd %xmm6, %xmm5
movsd %xmm5, 0x5a2ca6(%rip)   # 0x5f3b60
cvtsi2ssl (%r14), %xmm3
movaps %xmm4, %xmm11
shufps $0x55, %xmm4, %xmm11    # xmm11 = xmm11[1,1],xmm4[1,1]
movaps %xmm11, %xmm10
mulss %xmm2, %xmm10
addss %xmm3, %xmm10
movaps %xmm4, %xmm9
movaps 0x60(%rsp), %xmm12
mulss %xmm12, %xmm9
addss %xmm10, %xmm9
addss %xmm2, %xmm0
movaps 0x1d5da(%rip), %xmm10   # 0x6e4d0
cvtsi2ssl 0x4(%r14), %xmm3
xorps %xmm0, %xmm10
mulss %xmm11, %xmm10
mulss %xmm12, %xmm11
addss %xmm3, %xmm11
mulss %xmm2, %xmm1
mulss %xmm4, %xmm0
movaps %xmm0, %xmm2
mulss %xmm0, %xmm2
movaps %xmm10, %xmm3
mulss %xmm10, %xmm3
addss %xmm2, %xmm3
cvtss2sd %xmm3, %xmm2
sqrtsd %xmm2, %xmm2
divsd %xmm2, %xmm8
cvtsd2ss %xmm8, %xmm2
addss %xmm11, %xmm1
mulss %xmm2, %xmm10
mulss %xmm2, %xmm0
leaq 0x217b26(%rip), %r9     # 0x268a78
cvtsi2ssl (%r9), %xmm3
leaq 0x217b12(%rip), %r9     # 0x268a70
cvtsi2ssl (%r9), %xmm4
movaps %xmm3, %xmm2
mulss %xmm10, %xmm3
cvtss2sd %xmm10, %xmm8
mulss %xmm4, %xmm10
mulss %xmm0, %xmm2
addss %xmm10, %xmm2
mulss %xmm0, %xmm4
subss %xmm4, %xmm3
cvtsi2ss %r8d, %xmm4
subss %xmm1, %xmm4
cvtss2sd %xmm4, %xmm1
cvtsi2ss %edi, %xmm4
cvtss2sd %xmm0, %xmm0
subss %xmm9, %xmm4
cvtss2sd %xmm4, %xmm4
movaps %xmm8, %xmm9
mulsd %xmm4, %xmm9
mulsd %xmm1, %xmm8
mulsd %xmm0, %xmm1
addsd %xmm9, %xmm1
cvtsd2ss %xmm1, %xmm10
mulsd %xmm0, %xmm4
subsd %xmm8, %xmm4
cvtsd2ss %xmm4, %xmm4
cvtss2sd %xmm3, %xmm9
leaq 0x377d77(%rip), %rdi    # 0x3c8d50
cvtsi2sdl (%rdi), %xmm3
movaps %xmm9, %xmm1
mulsd %xmm3, %xmm1
movsd 0x1e65a(%rip), %xmm8    # 0x6f648
mulsd %xmm8, %xmm1
cvtss2sd %xmm2, %xmm0
mulsd %xmm0, %xmm3
mulsd %xmm8, %xmm3
cvtss2sd %xmm10, %xmm10
movapd %xmm6, %xmm2
mulsd %xmm10, %xmm2
cvtss2sd %xmm4, %xmm4
movapd %xmm6, %xmm8
mulsd %xmm4, %xmm8
mulsd %xmm5, %xmm10
mulsd %xmm5, %xmm4
movsd 0x1e572(%rip), %xmm11   # 0x6f5a0
mulsd %xmm11, %xmm0
subsd %xmm1, %xmm0
mulsd %xmm7, %xmm0
addsd %xmm10, %xmm0
mulsd %xmm11, %xmm9
addsd %xmm3, %xmm9
mulsd %xmm7, %xmm9
movzbl %sil, %esi
cvtsi2sd %esi, %xmm7
movsd 0x1e5f0(%rip), %xmm10   # 0x6f650
divsd %xmm7, %xmm10
cvtsd2ss %xmm10, %xmm7
subsd %xmm9, %xmm4
cvtss2sd %xmm7, %xmm7
mulsd %xmm7, %xmm1
movsd %xmm1, 0x5a2ae9(%rip)   # 0x5f3b68
mulsd %xmm7, %xmm2
movsd %xmm2, 0x5a2ae5(%rip)   # 0x5f3b70
mulsd %xmm7, %xmm0
movsd %xmm0, 0x5a2ae1(%rip)   # 0x5f3b78
movzbl %cl, %ecx
cvtsi2sd %ecx, %xmm7
movsd 0x1e5b1(%rip), %xmm9    # 0x6f658
divsd %xmm7, %xmm9
cvtsd2ss %xmm9, %xmm7
cvtss2sd %xmm7, %xmm7
mulsd %xmm7, %xmm3
movsd %xmm3, 0x5a2abf(%rip)   # 0x5f3b80
mulsd %xmm7, %xmm8
movsd %xmm8, 0x5a2ab9(%rip)   # 0x5f3b88
mulsd %xmm7, %xmm4
movsd %xmm4, 0x5a2ab5(%rip)   # 0x5f3b90
testb $0x4, (%r13)
je 0x516ba
movswq (%rax), %rcx
leaq 0x3b7f2f(%rip), %rax    # 0x409020
movswl (%rax,%rcx,2), %eax
cvtsi2sd %eax, %xmm3
movsd 0x5a2a4f(%rip), %xmm4   # 0x5f3b50
mulsd %xmm3, %xmm4
subsd %xmm1, %xmm4
movsd %xmm4, 0x5a2a57(%rip)   # 0x5f3b68
mulsd %xmm3, %xmm6
subsd %xmm2, %xmm6
movsd %xmm6, 0x5a2a4f(%rip)   # 0x5f3b70
mulsd %xmm3, %xmm5
subsd %xmm0, %xmm5
movsd %xmm5, 0x5a2a47(%rip)   # 0x5f3b78
jmp 0x516ba
cvtss2sd %xmm0, %xmm8
movlhps %xmm4, %xmm8            # xmm8 = xmm8[0],xmm4[0]
movzbl 0x15(%r14), %edi
cvtsi2ss %edi, %xmm0
leaq 0x3a9691(%rip), %r9     # 0x3fa7e0
movswl (%r9,%rdx,2), %r8d
cvtsi2ss %r8d, %xmm6
mulss %xmm0, %xmm6
movapd 0x1e2bb(%rip), %xmm4    # 0x6f420
divpd %xmm8, %xmm4
movsd 0x5a29be(%rip), %xmm7   # 0x5f3b30
cvtss2sd %xmm2, %xmm8
mulsd %xmm7, %xmm8
cvtss2sd %xmm1, %xmm1
mulsd %xmm7, %xmm1
cvtpd2ps %xmm4, %xmm2
cvtps2pd %xmm2, %xmm2
mulsd %xmm2, %xmm1
movsd 0x5a6a21(%rip), %xmm4   # 0x5f7bb8
unpcklpd %xmm4, %xmm4            # xmm4 = xmm4[0,0]
mulpd %xmm2, %xmm4
unpckhpd %xmm2, %xmm2            # xmm2 = xmm2[1,1]
mulsd %xmm8, %xmm2
addsd %xmm7, %xmm2
imull %edi, %ecx
shll $0x2, %ecx
addl 0x8(%r14), %ecx
addsd %xmm7, %xmm1
movl %ecx, 0x8(%r14)
movzwl (%r9,%rdx,2), %r8d
testb %al, %al
jns 0x511ee
movswl %r8w, %r8d
addl %edi, %edi
imull %edi, %r8d
addl %r8d, %ecx
movl %ecx, 0x8(%r14)
movzwl (%r9,%rdx,2), %r8d
testb $0x1, %r8b
je 0x511ee
addl %edi, %ecx
movl %ecx, 0x8(%r14)
movzwl (%r9,%rdx,2), %r8d
mulss 0x1e142(%rip), %xmm6    # 0x6f338
cvtsd2ss %xmm2, %xmm2
cvtsd2ss %xmm1, %xmm1
cvtpd2ps %xmm4, %xmm4
leaq 0x213857(%rip), %rdi    # 0x264a60
movl (%rdi), %edi
movl %ecx, %r9d
subl %edi, %r9d
andq $0x0, 0x5a293f(%rip)    # 0x5f3b58
testb $0x4, %al
je 0x51239
movss 0x1adaf(%rip), %xmm7    # 0x6bfd4
movaps %xmm7, %xmm8
subss %xmm5, %xmm8
subss %xmm3, %xmm7
movaps %xmm8, %xmm5
movaps %xmm7, %xmm3
cvtsi2ss %r9d, %xmm9
movaps %xmm9, %xmm7
subss %xmm6, %xmm7
movapd %xmm4, %xmm12
shufps $0x55, %xmm4, %xmm12    # xmm12 = xmm12[1,1],xmm4[1,1]
movaps %xmm12, %xmm6
subss %xmm4, %xmm6
cvtss2sd %xmm6, %xmm11
movsd 0x5a695b(%rip), %xmm6   # 0x5f7bc0
mulsd %xmm6, %xmm11
movaps %xmm2, %xmm8
subss %xmm1, %xmm8
cvtss2sd %xmm8, %xmm14
divsd %xmm14, %xmm11
cvtss2sd %xmm12, %xmm10
mulss %xmm4, %xmm3
mulss %xmm5, %xmm12
cvtss2sd %xmm12, %xmm13
subss %xmm3, %xmm12
cvtss2sd %xmm12, %xmm12
mulsd %xmm6, %xmm12
movswl (%rsi,%rdx,2), %edx
cvtsi2sd %edx, %xmm3
mulsd %xmm3, %xmm12
divsd %xmm14, %xmm12
andq $0x0, 0x5a28b7(%rip)    # 0x5f3b70
shufps $0x0, %xmm7, %xmm7      # xmm7 = xmm7[0,0,0,0]
mulps %xmm4, %xmm7
cvtps2pd %xmm7, %xmm5
mulsd %xmm6, %xmm10
mulsd %xmm6, %xmm13
movsd 0x5a2863(%rip), %xmm7   # 0x5f3b38
unpcklpd %xmm7, %xmm7            # xmm7 = xmm7[0,0]
addpd %xmm7, %xmm5
cvtpd2ps %xmm5, %xmm5
mulsd %xmm3, %xmm13
cvtss2sd %xmm2, %xmm3
movsd %xmm12, 0x5a2875(%rip)  # 0x5f3b68
mulsd %xmm3, %xmm12
subsd %xmm12, %xmm13
movapd %xmm5, %xmm12
shufps $0x0, %xmm9, %xmm9      # xmm9 = xmm9[0,0,0,0]
mulps %xmm4, %xmm9
cvtps2pd %xmm9, %xmm6
shufps $0x55, %xmm5, %xmm12    # xmm12 = xmm12[1,1],xmm5[1,1]
addpd %xmm7, %xmm6
cvtpd2ps %xmm6, %xmm6
movsd %xmm13, 0x5a2853(%rip)  # 0x5f3b78
movapd %xmm6, %xmm9
shufps $0x55, %xmm6, %xmm9     # xmm9 = xmm9[1,1],xmm6[1,1]
movsd %xmm11, 0x5a2818(%rip)  # 0x5f3b50
mulsd %xmm3, %xmm11
subsd %xmm11, %xmm10
movsd %xmm10, 0x5a2815(%rip)  # 0x5f3b60
movswl %r8w, %edx
addsd %xmm11, %xmm10
cvtsi2sd %edx, %xmm11
mulsd %xmm11, %xmm10
movaps %xmm12, %xmm11
subss %xmm9, %xmm11
mulss %xmm8, %xmm11
cvtss2sd %xmm11, %xmm11
divsd %xmm11, %xmm10
cvtsd2ss %xmm10, %xmm10
testb $0x8, %al
je 0x5138e
movaps %xmm6, %xmm11
subss %xmm9, %xmm11
movaps %xmm9, %xmm12
jmp 0x513a0
movaps %xmm12, %xmm11
subss %xmm5, %xmm11
movaps %xmm1, %xmm8
subss %xmm2, %xmm8
mulss %xmm10, %xmm11
cvtss2sd %xmm11, %xmm9
mulss %xmm10, %xmm8
cvtss2sd %xmm8, %xmm8
movaps 0x1b9e4(%rip), %xmm10   # 0x6cda0
xorps %xmm9, %xmm10
cvtss2sd %xmm12, %xmm11
mulsd %xmm8, %xmm11
mulsd %xmm3, %xmm10
subsd %xmm11, %xmm10
movsd %xmm9, 0x5a27a3(%rip)   # 0x5f3b80
movsd %xmm8, 0x5a27a2(%rip)   # 0x5f3b88
movsd %xmm10, 0x5a27a1(%rip)  # 0x5f3b90
movswq 0x18(%r14), %rsi
imulq $0x28, %rsi, %r8
leaq (%r11,%r8), %rsi
testb $0x1, 0xc(%r11,%r8)
jne 0x51446
cvtsi2ss %edx, %xmm8
mulss %xmm0, %xmm8
mulss 0x1df25(%rip), %xmm8    # 0x6f33c
movl 0x4(%rsi), %edx
cvtsi2ss %edx, %xmm0
cvtsi2ss %ecx, %xmm9
addss %xmm8, %xmm9
ucomiss %xmm9, %xmm0
jbe 0x51446
subl %edi, %edx
cvtsi2ss %edx, %xmm0
shufps $0x0, %xmm0, %xmm0      # xmm0 = xmm0[0,0,0,0]
mulps %xmm4, %xmm0
cvtps2pd %xmm0, %xmm0
addpd %xmm7, %xmm0
cvtpd2ps %xmm0, %xmm5
testb $0x1, 0xe(%rsi)
jne 0x5146b
movl 0x8(%rsi), %edx
cmpl %ecx, %edx
jge 0x5146b
subl %edi, %edx
cvtsi2ss %edx, %xmm0
shufps $0x0, %xmm0, %xmm0      # xmm0 = xmm0[0,0,0,0]
mulps %xmm4, %xmm0
cvtps2pd %xmm0, %xmm0
addpd %xmm0, %xmm7
cvtpd2ps %xmm7, %xmm6
ucomiss %xmm1, %xmm2
jbe 0x51481
testb $0x40, %al
jne 0x516f4
movaps %xmm3, %xmm0
cvtss2sd %xmm1, %xmm3
jmp 0x5148d
cvtss2sd %xmm1, %xmm0
shufps $0xe1, %xmm5, %xmm5     # xmm5 = xmm5[1,0,2,3]
shufps $0xe1, %xmm6, %xmm6     # xmm6 = xmm6[1,0,2,3]
movsd %xmm3, 0x30(%rsp)
cvtps2pd %xmm5, %xmm1
movsd %xmm0, 0x38(%rsp)
movapd %xmm1, (%rsp)
movsd %xmm0, 0x40(%rsp)
cvtps2pd %xmm6, %xmm0
movsd %xmm3, 0x48(%rsp)
shufpd $0x1, %xmm0, %xmm0      # xmm0 = xmm0[1,0]
movapd %xmm0, 0x10(%rsp)
pushq $0x4
popq %rdx
jmp 0x516ba
cvtss2sd %xmm3, %xmm3
cvtss2sd %xmm7, %xmm6
movaps 0x1b8ce(%rip), %xmm4    # 0x6cda0
xorps %xmm6, %xmm4
movlhps %xmm6, %xmm4            # xmm4 = xmm4[0],xmm6[0]
movlhps %xmm3, %xmm3            # xmm3 = xmm3[0,0]
mulpd 0x1debd(%rip), %xmm4    # 0x6f3a0
addpd %xmm3, %xmm4
movlpd %xmm4, (%rsp)
andq $0x0, 0x5a268c(%rip)    # 0x5f3b80
movapd %xmm4, %xmm3
andq $0x0, 0x5a2670(%rip)    # 0x5f3b70
unpckhpd %xmm4, %xmm3            # xmm3 = xmm3[1],xmm4[1]
andq $0x0, 0x5a264c(%rip)    # 0x5f3b58
movhpd %xmm4, 0x18(%rsp)
andq $0x0, 0x5a2636(%rip)    # 0x5f3b50
movupd %xmm4, 0x8(%rsp)
movsd 0x5a66a0(%rip), %xmm6   # 0x5f7bc8
mulsd %xmm0, %xmm6
movsd %xmm6, 0x5a262c(%rip)   # 0x5f3b60
cvtsi2sd %esi, %xmm7
mulsd %xmm6, %xmm7
movapd %xmm5, %xmm8
unpckhpd %xmm5, %xmm8            # xmm8 = xmm8[1],xmm5[1]
testb $0x4, %al
jne 0x5157a
subsd %xmm5, %xmm8
addsd 0x1e110(%rip), %xmm8    # 0x6f668
divsd %xmm8, %xmm7
movapd 0x1b83a(%rip), %xmm8    # 0x6cda0
xorpd %xmm7, %xmm8
addsd 0x1e0fd(%rip), %xmm5    # 0x6f670
mulsd %xmm8, %xmm5
jmp 0x515aa
subsd %xmm8, %xmm5
addsd 0x1e0d9(%rip), %xmm5    # 0x6f660
divsd %xmm5, %xmm7
movapd 0x1b80d(%rip), %xmm5    # 0x6cda0
xorpd %xmm7, %xmm5
addsd 0x1e010(%rip), %xmm8    # 0x6f5b0
mulsd %xmm5, %xmm8
movapd %xmm8, %xmm5
movsd %xmm7, 0x5a25b6(%rip)   # 0x5f3b68
movsd %xmm5, 0x5a25be(%rip)   # 0x5f3b78
movswl %dx, %edx
cvtsi2sd %edx, %xmm5
mulsd %xmm5, %xmm6
testb $0x8, %al
jne 0x515f7
movapd %xmm3, %xmm5
subsd %xmm4, %xmm5
addsd 0x1e08f(%rip), %xmm5    # 0x6f668
divsd %xmm5, %xmm6
movapd 0x1b7bb(%rip), %xmm7    # 0x6cda0
xorpd %xmm6, %xmm7
movsd 0x1e07f(%rip), %xmm5    # 0x6f670
addsd %xmm4, %xmm5
jmp 0x51623
movapd %xmm4, %xmm5
subsd %xmm3, %xmm5
addsd 0x1e059(%rip), %xmm5    # 0x6f660
divsd %xmm5, %xmm6
movapd 0x1b78d(%rip), %xmm7    # 0x6cda0
xorpd %xmm6, %xmm7
movsd 0x1df91(%rip), %xmm5    # 0x6f5b0
addsd %xmm3, %xmm5
mulsd %xmm7, %xmm5
movsd %xmm6, 0x5a2559(%rip)   # 0x5f3b88
movsd %xmm5, 0x5a2559(%rip)   # 0x5f3b90
movswq 0x18(%r14), %rax
imulq $0x28, %rax, %rdx
leaq (%r11,%rdx), %rax
testb $0x3, 0xc(%r11,%rdx)
jne 0x5167e
movl 0x4(%rax), %edx
subl %ecx, %edx
cvtsi2ss %edx, %xmm5
cvtss2sd %xmm5, %xmm5
mulsd %xmm1, %xmm5
mulsd %xmm0, %xmm5
addsd %xmm2, %xmm5
cvtsd2ss %xmm5, %xmm5
cvtss2sd %xmm5, %xmm5
ucomisd %xmm4, %xmm5
jbe 0x5167e
movsd %xmm5, 0x8(%rsp)
movsd %xmm5, (%rsp)
pushq $0x4
popq %rdx
testb $0x3, 0xe(%rax)
jne 0x516ba
movl 0x8(%rax), %eax
subl %ecx, %eax
cvtsi2ss %eax, %xmm4
cvtss2sd %xmm4, %xmm4
mulsd %xmm4, %xmm1
mulsd %xmm0, %xmm1
addsd %xmm2, %xmm1
cvtsd2ss %xmm1, %xmm0
cvtss2sd %xmm0, %xmm0
ucomisd %xmm0, %xmm3
jbe 0x516ba
movsd %xmm0, 0x18(%rsp)
movsd %xmm0, 0x10(%rsp)
leaq 0x30(%rsp), %rdi
movq %rsp, %rsi
movl %ebx, %ecx
callq 0x47666
leaq 0x353e10(%rip), %rax    # 0x3a54e0
cmpb $0x1, (%rax)
jne 0x516f4
movzwl %bp, %eax
movl %eax, %ecx
andl $0x7, %ecx
leaq 0x4c0bc(%rip), %rdx     # 0x9d7a0
movb (%rdx,%rcx), %cl
shrl $0x3, %eax
leaq 0x352def(%rip), %rdx    # 0x3a44e0
orb %cl, (%rdx,%rax)
addq $0xa8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq