// File: /workspace/github_c_makefile_star2_O2/jonof[P]jftekwar/jfbuild/src/polymost.c
// Function: polymost_drawmaskwall
void polymost_drawmaskwall (int damaskwallcnt)
{
	double dpx[8], dpy[8], dpx2[8], dpy2[8];
	float fy, x0, x1, sx0, sy0, sx1, sy1, xp0, yp0, xp1, yp1, oxp0, oyp0, ryp0, ryp1;
	float r, t, t0, t1, csy[4], fsy[4];
	int i, j, n, n2, z, sectnum, z1, z2, cz[4], fz[4], method;
	sectortype *sec, *nsec;
	walltype *wal, *wal2;

#ifdef DEBUGGINGAIDS
	polymostcallcounts.drawmaskwall++;
#endif

	z = maskwall[damaskwallcnt];
	wal = &wall[thewall[z]]; wal2 = &wall[wal->point2];
	sectnum = thesector[z]; sec = &sector[sectnum];
	nsec = &sector[wal->nextsector];
	z1 = max(nsec->ceilingz,sec->ceilingz);
	z2 = min(nsec->floorz,sec->floorz);

	globalpicnum = wal->overpicnum; if ((unsigned int)globalpicnum >= MAXTILES) globalpicnum = 0;
	if (picanm[globalpicnum]&192) globalpicnum += animateoffs(globalpicnum,(short)thewall[z]+16384);
	globalshade = (int)wal->shade;
	globalpal = (int)((unsigned char)wal->pal);
	globalorientation = (int)wal->cstat;

	sx0 = (float)(wal->x-globalposx); sx1 = (float)(wal2->x-globalposx);
	sy0 = (float)(wal->y-globalposy); sy1 = (float)(wal2->y-globalposy);
	yp0 = sx0*gcosang2 + sy0*gsinang2;
	yp1 = sx1*gcosang2 + sy1*gsinang2;
	if ((yp0 < SCISDIST) && (yp1 < SCISDIST)) return;
	xp0 = sy0*gcosang - sx0*gsinang;
	xp1 = sy1*gcosang - sx1*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; }

	getzsofslope(sectnum,(int)((wal2->x-wal->x)*t0+wal->x),(int)((wal2->y-wal->y)*t0+wal->y),&cz[0],&fz[0]);
	getzsofslope(wal->nextsector,(int)((wal2->x-wal->x)*t0+wal->x),(int)((wal2->y-wal->y)*t0+wal->y),&cz[1],&fz[1]);
	getzsofslope(sectnum,(int)((wal2->x-wal->x)*t1+wal->x),(int)((wal2->y-wal->y)*t1+wal->y),&cz[2],&fz[2]);
	getzsofslope(wal->nextsector,(int)((wal2->x-wal->x)*t1+wal->x),(int)((wal2->y-wal->y)*t1+wal->y),&cz[3],&fz[3]);

	ryp0 = 1.f/yp0; ryp1 = 1.f/yp1;

		//Generate screen coordinates for front side of wall
	x0 = ghalfx*xp0*ryp0 + ghalfx;
	x1 = ghalfx*xp1*ryp1 + ghalfx;
	if (x1 <= x0) return;

	ryp0 *= gyxscale; ryp1 *= gyxscale;

	gdx = (ryp0-ryp1)*gxyaspect / (x0-x1);
	gdy = 0;
	gdo = ryp0*gxyaspect - gdx*x0;

		//gux*x0 + guo = t0*wal->xrepeat*8*yp0
		//gux*x1 + guo = t1*wal->xrepeat*8*yp1
	gux = (t0*ryp0 - t1*ryp1)*gxyaspect*(float)wal->xrepeat*8.f / (x0-x1);
	guo = t0*ryp0*gxyaspect*(float)wal->xrepeat*8.f - gux*x0;
	guo += (float)wal->xpanning*gdo;
	gux += (float)wal->xpanning*gdx;
	guy = 0;

	if (!(wal->cstat&4)) i = z1; else i = z2;
	i -= globalposz;
	t0 = ((float)i)*ryp0 + ghoriz;
	t1 = ((float)i)*ryp1 + ghoriz;
	t = ((gdx*x0 + gdo) * (float)wal->yrepeat) / ((x1-x0) * ryp0 * 2048.f);
	i = (1<<(picsiz[globalpicnum]>>4)); if (i < tilesizy[globalpicnum]) i <<= 1;
	fy = (float)wal->ypanning * ((float)i) / 256.0;
	gvx = (t0-t1)*t;
	gvy = (x1-x0)*t;
	gvo = -gvx*x0 - gvy*t0 + fy*gdo; gvx += fy*gdx; gvy += fy*gdy;

	if (wal->cstat&8) //xflip
	{
		t = (float)(wal->xrepeat*8 + wal->xpanning*2);
		gux = gdx*t - gux;
		guy = gdy*t - guy;
		guo = gdo*t - guo;
	}
	if (wal->cstat&256) { gvx = -gvx; gvy = -gvy; gvo = -gvo; } //yflip

	method = METH_MASKED;
	if (wal->cstat&128) { if (!(wal->cstat&512)) method = METH_TRANS; else method = METH_INTRANS; }
	method |= METH_POW2XSPLIT | METH_LAYERS;

#if USE_OPENGL
	gfogpalnum = sec->floorpal;
	gfogdensity = gvisibility*((float)((unsigned char)(sec->visibility+16)) / 255.f);
#endif

	for(i=0;i<2;i++)
	{
		csy[i] = ((float)(cz[i]-globalposz))*ryp0 + ghoriz;
		fsy[i] = ((float)(fz[i]-globalposz))*ryp0 + ghoriz;
		csy[i+2] = ((float)(cz[i+2]-globalposz))*ryp1 + ghoriz;
		fsy[i+2] = ((float)(fz[i+2]-globalposz))*ryp1 + ghoriz;
	}

		//Clip 2 quadrilaterals
		//               /csy3
		//             /   |
		// csy0------/----csy2
		//   |     /xxxxxxx|
		//   |   /xxxxxxxxx|
		// csy1/xxxxxxxxxxx|
		//   |xxxxxxxxxxx/fsy3
		//   |xxxxxxxxx/   |
		//   |xxxxxxx/     |
		// fsy0----/------fsy2
		//   |   /
		// fsy1/

	dpx[0] = x0; dpy[0] = csy[1];
	dpx[1] = x1; dpy[1] = csy[3];
	dpx[2] = x1; dpy[2] = fsy[3];
	dpx[3] = x0; dpy[3] = fsy[1];
	n = 4;

		//Clip to (x0,csy[0])-(x1,csy[2])
	n2 = 0; t1 = -((dpx[0]-x0)*(csy[2]-csy[0]) - (dpy[0]-csy[0])*(x1-x0));
	for(i=0;i<n;i++)
	{
		j = i+1; if (j >= n) j = 0;

		t0 = t1; t1 = -((dpx[j]-x0)*(csy[2]-csy[0]) - (dpy[j]-csy[0])*(x1-x0));
		if (t0 >= 0) { dpx2[n2] = dpx[i]; dpy2[n2] = dpy[i]; n2++; }
		if ((t0 >= 0) != (t1 >= 0))
		{
			r = t0/(t0-t1);
			dpx2[n2] = (dpx[j]-dpx[i])*r + dpx[i];
			dpy2[n2] = (dpy[j]-dpy[i])*r + dpy[i];
			n2++;
		}
	}
	if (n2 < 3) return;

		//Clip to (x1,fsy[2])-(x0,fsy[0])
	n = 0; t1 = -((dpx2[0]-x1)*(fsy[0]-fsy[2]) - (dpy2[0]-fsy[2])*(x0-x1));
	for(i=0;i<n2;i++)
	{
		j = i+1; if (j >= n2) j = 0;

		t0 = t1; t1 = -((dpx2[j]-x1)*(fsy[0]-fsy[2]) - (dpy2[j]-fsy[2])*(x0-x1));
		if (t0 >= 0) { dpx[n] = dpx2[i]; dpy[n] = dpy2[i]; n++; }
		if ((t0 >= 0) != (t1 >= 0))
		{
			r = t0/(t0-t1);
			dpx[n] = (dpx2[j]-dpx2[i])*r + dpx2[i];
			dpy[n] = (dpy2[j]-dpy2[i])*r + dpy2[i];
			n++;
		}
	}
	if (n < 3) return;

	drawpoly(dpx,dpy,n,method);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x198, %rsp            # imm = 0x198
movslq %edi, %rax
leaq 0x3af6f8(%rip), %rcx    # 0x3fefe0
movswq (%rcx,%rax,2), %rcx
leaq 0x1e215c(%rip), %rax    # 0x231a50
movswq (%rax,%rcx,2), %rax
movq %rax, %rdx
shlq $0x5, %rdx
leaq 0x162149(%rip), %rsi    # 0x1b1a50
movswq 0x8(%rsi,%rdx), %r15
shlq $0x5, %r15
addq %rsi, %r15
leaq 0x3f7555(%rip), %rdi    # 0x446e70
movswq (%rdi,%rcx,2), %rbx
imulq $0x28, %rbx, %r8
leaq 0x1ed135(%rip), %r14    # 0x23ca60
movswq 0xc(%rsi,%rdx), %rcx
imulq $0x28, %rcx, %rcx
movl 0x4(%r14,%rcx), %edi
movl 0x8(%r14,%rcx), %ecx
movl 0x4(%r14,%r8), %r9d
cmpl %r9d, %edi
cmovgl %edi, %r9d
movl %r9d, 0x50(%rsp)
movq %r8, 0x68(%rsp)
movl 0x8(%r14,%r8), %r13d
cmpl %r13d, %ecx
cmovll %ecx, %r13d
leaq (%rsi,%rdx), %r12
movzwl 0x12(%rsi,%rdx), %edx
xorl %ecx, %ecx
cmpw $0x2400, %dx            # imm = 0x2400
cmovbl %edx, %ecx
leaq 0x3b9695(%rip), %rbp    # 0x409010
movw %cx, (%rbp)
movswq %cx, %rdx
leaq 0x1e40d6(%rip), %rsi    # 0x233a60
testb $-0x40, (%rsi,%rdx,4)
je 0x4f9a4
addl $0x4000, %eax           # imm = 0x4000
movswl %ax, %esi
movswl %cx, %edi
callq 0x2163b
addw %ax, (%rbp)
movsbl 0x14(%r12), %eax
leaq 0x3bde7b(%rip), %rcx    # 0x40d82c
movl %eax, (%rcx)
movzbl 0x15(%r12), %eax
leaq 0x3b9644(%rip), %rcx    # 0x409004
movl %eax, (%rcx)
movswl 0xe(%r12), %eax
leaq 0x3b9631(%rip), %rcx    # 0x409000
movl %eax, (%rcx)
movl (%r12), %edx
movl 0x4(%r12), %eax
leaq 0x1e406f(%rip), %rdi    # 0x233a50
movl (%r15), %esi
movl 0x4(%r15), %ecx
leaq 0x1e4065(%rip), %r8     # 0x233a54
movd %edx, %xmm0
movd %esi, %xmm1
punpckldq %xmm0, %xmm1    # xmm1 = xmm1[0],xmm0[0],xmm1[1],xmm0[1]
movd (%rdi), %xmm0
pshufd $0x50, %xmm0, %xmm0     # xmm0 = xmm0[0,0,1,1]
psubd %xmm0, %xmm1
cvtdq2ps %xmm1, %xmm0
movd %eax, %xmm1
movd %ecx, %xmm2
punpckldq %xmm1, %xmm2    # xmm2 = xmm2[0],xmm1[0],xmm2[1],xmm1[1]
movd (%r8), %xmm1
pshufd $0x50, %xmm1, %xmm1     # xmm1 = xmm1[0,0,1,1]
psubd %xmm1, %xmm2
cvtps2pd %xmm0, %xmm1
cvtdq2ps %xmm2, %xmm0
cvtps2pd %xmm0, %xmm4
movsd 0x5a3f82(%rip), %xmm0   # 0x5f39b8
unpcklpd %xmm0, %xmm0            # xmm0 = xmm0[0,0]
mulpd %xmm4, %xmm0
movsd 0x5a3f62(%rip), %xmm2   # 0x5f39a8
unpcklpd %xmm2, %xmm2            # xmm2 = xmm2[0,0]
mulpd %xmm1, %xmm2
addpd %xmm0, %xmm2
cvtpd2ps %xmm2, %xmm8
movapd %xmm8, %xmm0
cmpltps 0x1fa3c(%rip), %xmm0    # 0x6f4a0
unpcklps %xmm0, %xmm0            # xmm0 = xmm0[0,0,1,1]
movmskpd %xmm0, %edi
movl %edi, %r8d
shrb %r8b
testb %dil, %r8b
jne 0x50431
movapd %xmm8, %xmm0
shufps $0x55, %xmm8, %xmm0     # xmm0 = xmm0[1,1],xmm8[1,1]
cvtss2sd %xmm0, %xmm2
movsd 0x5a3f20(%rip), %xmm5   # 0x5f39b0
movsd 0x5a3f28(%rip), %xmm6   # 0x5f39c0
movapd %xmm1, %xmm3
unpckhpd %xmm1, %xmm3            # xmm3 = xmm3[1],xmm1[1]
mulsd %xmm6, %xmm3
movapd %xmm4, %xmm7
unpckhpd %xmm4, %xmm7            # xmm7 = xmm7[1],xmm4[1]
mulsd %xmm5, %xmm7
subsd %xmm3, %xmm7
cvtsd2ss %xmm7, %xmm3
mulsd %xmm6, %xmm1
mulsd %xmm5, %xmm4
subsd %xmm1, %xmm4
cvtsd2ss %xmm4, %xmm7
testb %r8b, %r8b
je 0x4fb06
movsd 0x1b02b(%rip), %xmm1    # 0x6ab00
subsd %xmm2, %xmm1
movaps %xmm8, %xmm4
subss %xmm0, %xmm4
cvtss2sd %xmm4, %xmm4
divsd %xmm4, %xmm1
cvtsd2ss %xmm1, %xmm6
movaps %xmm7, %xmm4
subss %xmm3, %xmm4
mulss %xmm6, %xmm4
addss %xmm3, %xmm4
movss 0x1c4d0(%rip), %xmm1    # 0x6bfd4
jmp 0x4fb10
xorpd %xmm6, %xmm6
movaps %xmm0, %xmm1
movaps %xmm3, %xmm4
testb $0x1, %dil
je 0x4fb51
movsd 0x1afe2(%rip), %xmm5    # 0x6ab00
subsd %xmm2, %xmm5
subss %xmm0, %xmm8
cvtss2sd %xmm8, %xmm0
divsd %xmm0, %xmm5
cvtsd2ss %xmm5, %xmm0
subss %xmm3, %xmm7
movss %xmm0, 0x8(%rsp)
mulss %xmm0, %xmm7
addss %xmm3, %xmm7
movss 0x1c485(%rip), %xmm8    # 0x6bfd4
jmp 0x4fb5f
movss 0x1c47b(%rip), %xmm0    # 0x6bfd4
movss %xmm0, 0x8(%rsp)
subl %edx, %esi
cvtsi2ss %esi, %xmm0
unpcklps %xmm4, %xmm7            # xmm7 = xmm7[0],xmm4[0],xmm7[1],xmm4[1]
movaps %xmm7, 0x100(%rsp)
cvtsi2ss %edx, %xmm2
mulss %xmm6, %xmm0
addss %xmm2, %xmm0
cvttss2si %xmm0, %esi
subl %eax, %ecx
cvtsi2ss %ecx, %xmm0
unpcklps %xmm1, %xmm8            # xmm8 = xmm8[0],xmm1[0],xmm8[1],xmm1[1]
movaps %xmm8, 0xf0(%rsp)
cvtsi2ss %eax, %xmm1
mulss %xmm6, %xmm0
addss %xmm1, %xmm0
cvttss2si %xmm0, %edx
movswl %bx, %ebx
leaq 0x20(%rsp), %rcx
leaq 0x10(%rsp), %r8
movl %ebx, %edi
movss %xmm6, 0xc(%rsp)
callq 0x2373c
movl (%r15), %eax
movl 0x4(%r15), %ecx
movl (%r12), %edx
subl %edx, %eax
cvtsi2ss %eax, %xmm0
movl 0x4(%r12), %eax
cvtsi2ss %edx, %xmm1
movss 0xc(%rsp), %xmm2
mulss %xmm2, %xmm0
addss %xmm1, %xmm0
cvttss2si %xmm0, %esi
subl %eax, %ecx
cvtsi2ss %ecx, %xmm0
cvtsi2ss %eax, %xmm1
movswl 0xc(%r12), %edi
mulss %xmm2, %xmm0
addss %xmm1, %xmm0
cvttss2si %xmm0, %edx
leaq 0x24(%rsp), %rcx
leaq 0x14(%rsp), %r8
callq 0x2373c
movl (%r15), %eax
movl 0x4(%r15), %ecx
movl (%r12), %edx
movl 0x4(%r12), %esi
subl %edx, %eax
cvtsi2ss %eax, %xmm0
cvtsi2ss %edx, %xmm1
movss 0x8(%rsp), %xmm2
mulss %xmm2, %xmm0
movaps %xmm2, %xmm3
movss %xmm2, 0x8(%rsp)
subl %esi, %ecx
cvtsi2ss %ecx, %xmm2
addss %xmm1, %xmm0
cvtsi2ss %esi, %xmm1
cvttss2si %xmm0, %esi
mulss %xmm3, %xmm2
addss %xmm1, %xmm2
cvttss2si %xmm2, %edx
leaq 0x28(%rsp), %rcx
leaq 0x18(%rsp), %r8
movl %ebx, %edi
callq 0x2373c
movl (%r15), %eax
movl 0x4(%r15), %ecx
movl (%r12), %edx
subl %edx, %eax
cvtsi2ss %eax, %xmm0
movl 0x4(%r12), %eax
cvtsi2ss %edx, %xmm1
movss 0x8(%rsp), %xmm2
mulss %xmm2, %xmm0
addss %xmm1, %xmm0
cvttss2si %xmm0, %esi
subl %eax, %ecx
cvtsi2ss %ecx, %xmm0
cvtsi2ss %eax, %xmm1
movswl 0xc(%r12), %edi
mulss %xmm2, %xmm0
addss %xmm1, %xmm0
cvttss2si %xmm0, %edx
leaq 0x2c(%rsp), %rcx
leaq 0x1c(%rsp), %r8
callq 0x2373c
movaps 0x1f7d2(%rip), %xmm0    # 0x6f4a0
divps 0xf0(%rsp), %xmm0
cvtps2pd 0x100(%rsp), %xmm1
movsd 0x5a3e4a(%rip), %xmm2   # 0x5f3b30
unpcklpd %xmm2, %xmm2            # xmm2 = xmm2[0,0]
mulpd %xmm2, %xmm1
cvtps2pd %xmm0, %xmm0
mulpd %xmm0, %xmm1
addpd %xmm2, %xmm1
cvtpd2ps %xmm1, %xmm2
movapd %xmm2, %xmm11
shufps $0x55, %xmm2, %xmm11    # xmm11 = xmm11[1,1],xmm2[1,1]
ucomiss %xmm2, %xmm11
leaq 0x3b92fe(%rip), %r8     # 0x409010
jae 0x50431
movsd 0x5a7e98(%rip), %xmm1   # 0x5f7bb8
movapd %xmm0, %xmm3
unpckhpd %xmm0, %xmm3            # xmm3 = xmm3[1],xmm0[1]
mulsd %xmm1, %xmm3
cvtsd2ss %xmm3, %xmm3
mulsd %xmm0, %xmm1
cvtsd2ss %xmm1, %xmm4
movaps %xmm3, %xmm0
subss %xmm4, %xmm0
cvtss2sd %xmm0, %xmm7
movsd 0x5a7e75(%rip), %xmm6   # 0x5f7bc0
mulsd %xmm6, %xmm7
movaps %xmm11, %xmm0
subss %xmm2, %xmm0
cvtss2sd %xmm0, %xmm0
andq $0x0, 0x5a3df5(%rip)    # 0x5f3b58
divsd %xmm0, %xmm7
cvtss2sd %xmm3, %xmm8
cvtss2sd %xmm11, %xmm1
mulsd %xmm6, %xmm8
movapd %xmm7, %xmm13
mulsd %xmm1, %xmm13
subsd %xmm13, %xmm8
movss 0x8(%rsp), %xmm9
mulss %xmm4, %xmm9
movss 0xc(%rsp), %xmm10
mulss %xmm3, %xmm10
cvtss2sd %xmm10, %xmm5
subss %xmm9, %xmm10
cvtss2sd %xmm10, %xmm12
mulsd %xmm6, %xmm12
movzbl 0x16(%r12), %esi
cvtsi2sd %esi, %xmm9
mulsd %xmm9, %xmm12
movsd 0x1c1c6(%rip), %xmm10   # 0x6bf90
mulsd %xmm10, %xmm12
divsd %xmm0, %xmm12
mulsd %xmm6, %xmm5
mulsd %xmm9, %xmm5
movapd %xmm1, %xmm6
mulsd %xmm12, %xmm6
mulsd %xmm10, %xmm5
movzbl 0x18(%r12), %edi
cvtsi2sd %edi, %xmm9
subsd %xmm6, %xmm5
andq $0x0, 0x5a3d6e(%rip)    # 0x5f3b70
movapd %xmm9, %xmm10
mulsd %xmm8, %xmm10
movzwl 0xe(%r12), %eax
testb $0x4, %al
cmovel 0x50(%rsp), %r13d
leaq 0x214c3f(%rip), %rcx    # 0x264a60
movl (%rcx), %edx
subl %edx, %r13d
cvtsi2ss %r13d, %xmm15
addsd %xmm5, %xmm10
movaps %xmm3, %xmm5
mulss %xmm15, %xmm5
cvtss2sd %xmm5, %xmm5
movsd 0x5a3cf4(%rip), %xmm6   # 0x5f3b38
addsd %xmm6, %xmm5
cvtsd2ss %xmm5, %xmm14
mulsd %xmm7, %xmm9
mulss %xmm4, %xmm15
cvtss2sd %xmm15, %xmm5
addsd %xmm6, %xmm5
cvtsd2ss %xmm5, %xmm15
addsd %xmm8, %xmm13
movzbl 0x17(%r12), %ecx
cvtsi2sd %ecx, %xmm5
movaps %xmm2, 0x50(%rsp)
subss %xmm11, %xmm2
movaps %xmm2, %xmm11
mulss %xmm3, %xmm11
mulss 0x1f49c(%rip), %xmm11   # 0x6f32c
mulsd %xmm13, %xmm5
cvtss2sd %xmm11, %xmm11
divsd %xmm11, %xmm5
movswq (%r8), %r8
leaq 0x3bd9a6(%rip), %rcx    # 0x40d850
movzbl (%rcx,%r8), %ecx
shrl $0x4, %ecx
pushq $0x1
popq %r9
shll %cl, %r9d
cvtsd2ss %xmm5, %xmm5
leaq 0x3aa91c(%rip), %r10    # 0x3fa7e0
pushq $0x2
popq %r11
shll %cl, %r11d
movswl (%r10,%r8,2), %ecx
cmpl %ecx, %r9d
cmovgel %r9d, %r11d
movzbl 0x19(%r12), %ecx
cvtsi2ss %ecx, %xmm11
addsd %xmm12, %xmm9
cvtsi2ss %r11d, %xmm12
mulss %xmm11, %xmm12
mulss 0x1f436(%rip), %xmm12   # 0x6f330
cvtss2sd %xmm14, %xmm11
subss %xmm15, %xmm14
mulss %xmm5, %xmm14
cvtss2sd %xmm14, %xmm14
movss %xmm2, 0x8(%rsp)
mulss %xmm2, %xmm5
cvtss2sd %xmm5, %xmm15
movaps 0x1ce7c(%rip), %xmm5    # 0x6cda0
xorps %xmm14, %xmm5
mulsd %xmm15, %xmm11
mulsd %xmm1, %xmm5
subsd %xmm11, %xmm5
cvtss2sd %xmm12, %xmm12
movaps %xmm12, %xmm11
xorpd %xmm13, %xmm13
mulsd %xmm12, %xmm13
mulsd %xmm8, %xmm12
addsd %xmm5, %xmm12
movsd %xmm7, 0x5a3bf5(%rip)   # 0x5f3b50
movsd %xmm8, 0x5a3bfc(%rip)   # 0x5f3b60
movsd %xmm10, 0x5a3c0b(%rip)  # 0x5f3b78
movsd %xmm9, 0x5a3bf2(%rip)   # 0x5f3b68
movsd %xmm12, 0x5a3c11(%rip)  # 0x5f3b90
mulsd %xmm7, %xmm11
addsd %xmm14, %xmm11
movsd %xmm11, 0x5a3bee(%rip)  # 0x5f3b80
addsd %xmm15, %xmm13
movsd %xmm13, 0x5a3be8(%rip)  # 0x5f3b88
testb $0x8, %al
je 0x4ffd2
shll $0x3, %esi
leal (%rsi,%rdi,2), %ecx
cvtsi2sd %ecx, %xmm5
mulsd %xmm5, %xmm7
subsd %xmm9, %xmm7
movsd %xmm7, 0x5a3ba9(%rip)   # 0x5f3b68
mulsd %xmm5, %xmm8
subsd %xmm10, %xmm8
movsd %xmm8, 0x5a3ba6(%rip)   # 0x5f3b78
addq 0x68(%rsp), %r14
btl $0x8, %eax
jae 0x5000f
movapd 0x1cdbb(%rip), %xmm5    # 0x6cda0
xorpd %xmm5, %xmm11
movlpd %xmm11, 0x5a3b8d(%rip)  # 0x5f3b80
xorpd %xmm5, %xmm13
movlpd %xmm13, 0x5a3b87(%rip)  # 0x5f3b88
xorpd %xmm5, %xmm12
movlpd %xmm12, 0x5a3b81(%rip)  # 0x5f3b90
xorl %esi, %esi
btl $0x9, %eax
movl $0x0, %ecx
adcl $0x1a, %ecx
movb 0x20(%r14), %dil
addb $0x10, %dil
movzbl %dil, %edi
cvtsi2ss %edi, %xmm5
divss 0x1f2eb(%rip), %xmm5    # 0x6f320
movzbl 0x1d(%r14), %edi
cvtss2sd %xmm5, %xmm5
mulsd 0x5a7b8a(%rip), %xmm5   # 0x5f7bd0
movl %edi, 0x5a392c(%rip)    # 0x5f3978
cvtsd2ss %xmm5, %xmm5
movss %xmm5, 0x5a3924(%rip)   # 0x5f397c
movaps 0x50(%rsp), %xmm2
cmpq $0x8, %rsi
je 0x500f6
movl 0x20(%rsp,%rsi), %edi
subl %edx, %edi
cvtsi2ss %edi, %xmm5
movl 0x28(%rsp,%rsi), %edi
mulss %xmm3, %xmm5
cvtss2sd %xmm5, %xmm5
addsd %xmm6, %xmm5
cvtsd2ss %xmm5, %xmm5
movss %xmm5, 0x40(%rsp,%rsi)
movl 0x10(%rsp,%rsi), %r8d
subl %edx, %r8d
cvtsi2ss %r8d, %xmm5
movl 0x18(%rsp,%rsi), %r8d
mulss %xmm3, %xmm5
cvtss2sd %xmm5, %xmm5
addsd %xmm6, %xmm5
cvtsd2ss %xmm5, %xmm5
movss %xmm5, 0x30(%rsp,%rsi)
subl %edx, %edi
cvtsi2ss %edi, %xmm5
mulss %xmm4, %xmm5
cvtss2sd %xmm5, %xmm5
addsd %xmm6, %xmm5
cvtsd2ss %xmm5, %xmm5
subl %edx, %r8d
cvtsi2ss %r8d, %xmm7
movss %xmm5, 0x48(%rsp,%rsi)
mulss %xmm4, %xmm7
cvtss2sd %xmm7, %xmm5
addsd %xmm6, %xmm5
cvtsd2ss %xmm5, %xmm5
movss %xmm5, 0x38(%rsp,%rsi)
addq $0x4, %rsi
jmp 0x5005d
movsd %xmm1, 0x70(%rsp)
cvtss2sd %xmm2, %xmm2
movsd %xmm2, 0x78(%rsp)
movaps 0x40(%rsp), %xmm3
movsd %xmm2, 0x80(%rsp)
movss 0x3c(%rsp), %xmm4
shufps $0xf4, %xmm3, %xmm4     # xmm4 = xmm4[0,1],xmm3[3,3]
shufps $0xf2, %xmm3, %xmm4     # xmm4 = xmm4[2,0],xmm3[3,3]
cvtps2pd %xmm4, %xmm3
movups %xmm3, 0xb8(%rsp)
movsd %xmm1, 0x88(%rsp)
cvtss2sd 0x34(%rsp), %xmm3
movsd %xmm3, 0xc8(%rsp)
movapd %xmm1, %xmm3
subsd %xmm1, %xmm3
movss 0x48(%rsp), %xmm5
movsd 0x40(%rsp), %xmm6
cvtps2pd %xmm6, %xmm4
movapd %xmm4, %xmm7
unpckhpd %xmm4, %xmm7            # xmm7 = xmm7[1],xmm4[1]
movhpd %xmm4, 0xb0(%rsp)
subss %xmm6, %xmm5
cvtss2sd %xmm5, %xmm6
subsd %xmm4, %xmm7
cvtss2sd 0x8(%rsp), %xmm5
mulsd %xmm5, %xmm7
mulsd %xmm6, %xmm3
subsd %xmm7, %xmm3
cvtsd2ss %xmm3, %xmm8
xorps 0x1e338(%rip), %xmm8    # 0x6e4d0
xorl %edi, %edi
movaps 0x1e32f(%rip), %xmm3    # 0x6e4d0
xorpd %xmm7, %xmm7
xorl %esi, %esi
cmpq $0x4, %rdi
je 0x502ad
movaps %xmm8, %xmm9
movq %rdi, %rdx
incq %rdi
cmpq $0x3, %rdx
movl %edi, %r8d
movl $0x0, %r9d
cmovneq %r8, %r9
movsd 0x70(%rsp,%r9,8), %xmm11
movapd %xmm11, %xmm8
subsd %xmm1, %xmm8
movsd 0xb0(%rsp,%r9,8), %xmm10
movapd %xmm10, %xmm12
subsd %xmm4, %xmm12
mulsd %xmm5, %xmm12
mulsd %xmm6, %xmm8
subsd %xmm12, %xmm8
cvtsd2ss %xmm8, %xmm12
movaps %xmm12, %xmm8
xorps %xmm3, %xmm8
ucomiss %xmm7, %xmm9
jae 0x5022c
ucomiss %xmm12, %xmm7
jb 0x501a7
movsd 0x68(%rsp,%rdi,8), %xmm14
movsd 0xa8(%rsp,%rdi,8), %xmm13
jmp 0x5025c
movsd 0x70(%rsp,%rdx,8), %xmm14
movslq %esi, %rsi
movsd %xmm14, 0x150(%rsp,%rsi,8)
movsd 0xb0(%rsp,%rdx,8), %xmm13
movsd %xmm13, 0x110(%rsp,%rsi,8)
incl %esi
ucomiss %xmm12, %xmm7
jae 0x502a2
addss %xmm9, %xmm12
divss %xmm12, %xmm9
subsd %xmm14, %xmm11
cvtss2sd %xmm9, %xmm9
mulsd %xmm9, %xmm11
addsd %xmm14, %xmm11
movslq %esi, %rsi
movsd %xmm11, 0x150(%rsp,%rsi,8)
subsd %xmm13, %xmm10
mulsd %xmm9, %xmm10
addsd %xmm13, %xmm10
movsd %xmm10, 0x110(%rsp,%rsi,8)
incl %esi
incq %rdx
movq %rdx, %rdi
jmp 0x501a7
testb %al, %al
pushq $0x19
popq %rax
cmovnsl %eax, %ecx
cmpl $0x3, %esi
jl 0x50431
movsd 0x150(%rsp), %xmm5
subsd %xmm2, %xmm5
movss 0x30(%rsp), %xmm1
movss 0x38(%rsp), %xmm4
subss %xmm4, %xmm1
cvtss2sd %xmm1, %xmm1
movsd 0x110(%rsp), %xmm6
cvtss2sd %xmm4, %xmm4
subsd %xmm4, %xmm6
mulsd %xmm0, %xmm6
mulsd %xmm1, %xmm5
subsd %xmm6, %xmm5
cvtsd2ss %xmm5, %xmm6
xorps 0x1e1c9(%rip), %xmm6    # 0x6e4d0
movl %esi, %eax
negq %rax
xorl %edi, %edi
xorps %xmm5, %xmm5
xorl %r8d, %r8d
xorl %edx, %edx
incq %r8
movq %r8, %r9
movq %r9, %r8
addq %rax, %r9
cmpq $0x1, %r9
je 0x5041a
movaps %xmm6, %xmm7
cmpl %r8d, %esi
movl %r8d, %r9d
cmovleq %rdi, %r9
movsd 0x150(%rsp,%r9,8), %xmm9
movapd %xmm9, %xmm6
subsd %xmm2, %xmm6
movsd 0x110(%rsp,%r9,8), %xmm8
movapd %xmm8, %xmm10
subsd %xmm4, %xmm10
mulsd %xmm0, %xmm10
mulsd %xmm1, %xmm6
subsd %xmm10, %xmm6
cvtsd2ss %xmm6, %xmm10
movaps %xmm10, %xmm6
xorps %xmm3, %xmm6
ucomiss %xmm5, %xmm7
jae 0x5039f
leaq 0x1(%r8), %r9
ucomiss %xmm10, %xmm5
jb 0x5031c
movsd 0x140(%rsp,%r9,8), %xmm12
movsd 0x100(%rsp,%r9,8), %xmm11
jmp 0x503d3
movsd 0x148(%rsp,%r8,8), %xmm12
movslq %edx, %rdx
movsd %xmm12, 0x70(%rsp,%rdx,8)
movsd 0x108(%rsp,%r8,8), %xmm11
movsd %xmm11, 0xb0(%rsp,%rdx,8)
incl %edx
ucomiss %xmm10, %xmm5
jae 0x50316
addss %xmm7, %xmm10
divss %xmm10, %xmm7
subsd %xmm12, %xmm9
cvtss2sd %xmm7, %xmm7
mulsd %xmm7, %xmm9
addsd %xmm12, %xmm9
movslq %edx, %rdx
movsd %xmm9, 0x70(%rsp,%rdx,8)
subsd %xmm11, %xmm8
mulsd %xmm7, %xmm8
addsd %xmm11, %xmm8
movsd %xmm8, 0xb0(%rsp,%rdx,8)
incl %edx
jmp 0x50316
cmpl $0x3, %edx
jl 0x50431
leaq 0x70(%rsp), %rdi
leaq 0xb0(%rsp), %rsi
callq 0x47666
addq $0x198, %rsp            # imm = 0x198
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq