// File: /workspace/github_c_makefile_star2_O3/jonof[P]jftekwar/jfbuild/src/mdsprite.c
// Function: voxdraw
int voxdraw (voxmodel *m, spritetype *tspr, int method)
{
	point3d m0, a0;
	float f, g, k0, k1, k2, k3, k4, k5, k6, k7, mat[16], omat[16], pc[4];
	struct polymostdrawpolycall draw;

	//updateanimation((md2model *)m,tspr);
	if ((tspr->cstat&48)==32) return 0;

	m0.x = m->scale;
	m0.y = m->scale;
	m0.z = m->scale;
	a0.x = a0.y = 0; a0.z = m->zadd*m->scale;

	//if (globalorientation&8) //y-flipping
	//{
	//   m0.z = -m0.z; a0.z = -a0.z;
	//      //Add height of 1st frame (use same frame to prevent animation bounce)
	//   a0.z += m->zsiz*m->scale;
	//}
	//if (globalorientation&4) { m0.y = -m0.y; a0.y = -a0.y; } //x-flipping

	f = ((float)tspr->xrepeat)*(256.0/320.0)/64.0*m->bscale;
	m0.x *= f; a0.x *= f; f = -f;
	m0.y *= f; a0.y *= f;
	f = ((float)tspr->yrepeat)/64.0*m->bscale;
	m0.z *= f; a0.z *= f;

	k0 = tspr->z;
	if (globalorientation&128) k0 += (float)((tilesizy[tspr->picnum]*tspr->yrepeat)<<1);

	f = (65536.0*512.0)/((float)xdimen*viewingrange);
	g = 32.0/((float)xdimen*gxyaspect);
	m0.y *= f; a0.y = (((float)(tspr->x-globalposx))/  1024.0 + a0.y)*f;
	m0.x *=-f; a0.x = (((float)(tspr->y-globalposy))/ -1024.0 + a0.x)*-f;
	m0.z *= g; a0.z = (((float)(k0     -globalposz))/-16384.0 + a0.z)*g;

	k0 = ((float)(tspr->x-globalposx))*f/1024.0;
	k1 = ((float)(tspr->y-globalposy))*f/1024.0;
	f = gcosang2*gshang;
	g = gsinang2*gshang;
	k4 = (float)sintable[(tspr->ang+spriteext[tspr->owner].angoff+1024)&2047] / 16384.0;
	k5 = (float)sintable[(tspr->ang+spriteext[tspr->owner].angoff+ 512)&2047] / 16384.0;
	k2 = k0*(1-k4)+k1*k5;
	k3 = k1*(1-k4)-k0*k5;
	k6 = f*gstang - gsinang*gctang; k7 = g*gstang + gcosang*gctang;
	mat[0] = k4*k6 + k5*k7; mat[4] = gchang*gstang; mat[ 8] = k4*k7 - k5*k6; mat[12] = k2*k6 + k3*k7;
	k6 = f*gctang + gsinang*gstang; k7 = g*gctang - gcosang*gstang;
	mat[1] = k4*k6 + k5*k7; mat[5] = gchang*gctang; mat[ 9] = k4*k7 - k5*k6; mat[13] = k2*k6 + k3*k7;
	k6 =           gcosang2*gchang; k7 =           gsinang2*gchang;
	mat[2] = k4*k6 + k5*k7; mat[6] =-gshang;        mat[10] = k4*k7 - k5*k6; mat[14] = k2*k6 + k3*k7;

	mat[12] += a0.y*mat[0] + a0.z*mat[4] + a0.x*mat[ 8];
	mat[13] += a0.y*mat[1] + a0.z*mat[5] + a0.x*mat[ 9];
	mat[14] += a0.y*mat[2] + a0.z*mat[6] + a0.x*mat[10];

		//Mirrors
	if (grhalfxdown10x < 0) { mat[0] = -mat[0]; mat[4] = -mat[4]; mat[8] = -mat[8]; mat[12] = -mat[12]; }

//------------
	//bit 10 is an ugly hack in game.c\animatesprites telling MD2SPRITE
	//to use Z-buffer hacks to hide overdraw problems with the shadows
	if (tspr->cstat&1024)
	{
		glfunc.glDepthFunc(GL_LESS); //NEVER,LESS,(,L)EQUAL,GREATER,(NOT,G)EQUAL,ALWAYS
#if (USE_OPENGL == USE_GLES2)
		glfunc.glDepthRangef(0.f,0.9999f);
#else
		glfunc.glDepthRange(0.0,0.9999);
#endif
	}
	if ((grhalfxdown10x >= 0) /*^ ((globalorientation&8) != 0) ^ ((globalorientation&4) != 0)*/) glfunc.glFrontFace(GL_CW); else glfunc.glFrontFace(GL_CCW);
	glfunc.glEnable(GL_CULL_FACE);
	glfunc.glCullFace(GL_BACK);

	pc[0] = pc[1] = pc[2] = ((float)(numpalookups-min(max(globalshade+m->shadeoff,0),numpalookups)))/((float)numpalookups);
	pc[0] *= (float)hictinting[globalpal].r / 255.0;
	pc[1] *= (float)hictinting[globalpal].g / 255.0;
	pc[2] *= (float)hictinting[globalpal].b / 255.0;
	if (tspr->cstat&2) { if (!(tspr->cstat&512)) pc[3] = 0.66; else pc[3] = 0.33; } else pc[3] = 1.0;
	if (tspr->cstat&2) glfunc.glEnable(GL_BLEND); else glfunc.glDisable(GL_BLEND);
//------------

		//transform to Build coords
	memcpy(omat,mat,sizeof(omat));
	f = 1.f/64.f;
	g = m0.x*f; mat[0] *= g; mat[1] *= g; mat[2] *= g;
	g = m0.y*f; mat[4] = omat[8]*g; mat[5] = omat[9]*g; mat[6] = omat[10]*g;
	g =-m0.z*f; mat[8] = omat[4]*g; mat[9] = omat[5]*g; mat[10] = omat[6]*g;
	mat[12] -= (m->xpiv*mat[0] + m->ypiv*mat[4] + (m->zpiv+m->zsiz*.5)*mat[ 8]);
	mat[13] -= (m->xpiv*mat[1] + m->ypiv*mat[5] + (m->zpiv+m->zsiz*.5)*mat[ 9]);
	mat[14] -= (m->xpiv*mat[2] + m->ypiv*mat[6] + (m->zpiv+m->zsiz*.5)*mat[10]);
	mat[3] = mat[7] = mat[11] = 0.f; mat[15] = 1.f;

	if (!m->texid[globalpal]) {
		m->texid[globalpal] = gloadtex(m->mytex,m->mytexx,m->mytexy,m->is8bit,globalpal);
	}

	draw.texture0 = m->texid[globalpal];
	draw.texture1 = 0;
	draw.alphacut = 0.32;
	draw.colour.r = pc[0];
	draw.colour.g = pc[1];
	draw.colour.b = pc[2];
	draw.colour.a = pc[3];
	draw.fogcolour.r = (float)palookupfog[gfogpalnum].r / 63.f;
	draw.fogcolour.g = (float)palookupfog[gfogpalnum].g / 63.f;
	draw.fogcolour.b = (float)palookupfog[gfogpalnum].b / 63.f;
	draw.fogcolour.a = 1.f;
	draw.fogdensity = gfogdensity;

	if (method & 1) {
		draw.projection = &grotatespriteprojmat[0][0];
	} else {
		draw.projection = &gdrawroomsprojmat[0][0];
	}
	draw.modelview = mat;

	if (!m->vertexbuf || !m->indexbuf) {
		voxloadbufs(m);
	}
	draw.indexcount = m->indexcount;
	draw.indexbuffer = m->indexbuf;
	draw.elementbuffer = m->vertexbuf;
	draw.elementcount = 0;
	draw.elementvbo = NULL;
	polymost_drawpoly_glcall(GL_TRIANGLES, &draw);

//------------
	glfunc.glDisable(GL_CULL_FACE);
	glfunc.glFrontFace(GL_CCW);
	if (tspr->cstat&1024)
	{
		glfunc.glDepthFunc(GL_LEQUAL); //NEVER,LESS,(,L)EQUAL,GREATER,(NOT,G)EQUAL,ALWAYS
#if (USE_OPENGL == USE_GLES2)
		glfunc.glDepthRangef(0.f,0.99999f);
#else
		glfunc.glDepthRange(0.0,0.99999);
#endif
	}
	return 1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x198, %rsp            # imm = 0x198
movzwl 0xc(%rsi), %eax
movl %eax, %ecx
andl $0x30, %ecx
xorl %r15d, %r15d
cmpw $0x20, %cx
je 0x638ce
movl %edx, %r12d
movq %rsi, %rbx
movq %rdi, %r14
movss 0x8(%rdi), %xmm1
movss 0x10(%rdi), %xmm3
movzbl 0x14(%rsi), %ecx
cvtsi2sd %ecx, %xmm0
movaps %xmm1, 0x70(%rsp)
mulss %xmm1, %xmm3
mulsd 0x17d63(%rip), %xmm0    # 0x7a940
movsd 0x188ab(%rip), %xmm1    # 0x7b490
mulsd %xmm1, %xmm0
cvtss2sd 0xc(%rdi), %xmm4
mulsd %xmm4, %xmm0
cvtsd2ss %xmm0, %xmm6
xorps %xmm2, %xmm2
mulss %xmm6, %xmm2
movss 0x1883f(%rip), %xmm0    # 0x7b444
movzbl 0x15(%rsi), %ecx
cvtsi2sd %ecx, %xmm5
mulsd %xmm1, %xmm5
mulsd %xmm4, %xmm5
xorps %xmm1, %xmm1
cvtsd2ss %xmm5, %xmm1
mulss %xmm6, %xmm0
xorps %xmm4, %xmm4
cvtsi2ssl 0x8(%rsi), %xmm4
movss %xmm1, 0x38(%rsp)
mulss %xmm1, %xmm3
leaq 0x3ad3c7(%rip), %rdx    # 0x410000
testb $-0x80, (%rdx)
movaps %xmm6, 0x10(%rsp)
je 0x62c63
movswq 0xe(%rbx), %rdx
leaq 0x39eb91(%rip), %rsi    # 0x4017e0
movswl (%rsi,%rdx,2), %edx
imull %edx, %ecx
addl %ecx, %ecx
xorps %xmm1, %xmm1
cvtsi2ss %ecx, %xmm1
addss %xmm1, %xmm4
leaq 0x41bc6(%rip), %rcx     # 0xa4830
xorps %xmm1, %xmm1
cvtsi2ssl (%rcx), %xmm1
leaq 0x36d0d8(%rip), %rcx    # 0x3cfd50
xorps %xmm5, %xmm5
cvtsi2ssl (%rcx), %xmm5
mulss %xmm1, %xmm5
movss 0x187bc(%rip), %xmm8    # 0x7b448
divss %xmm5, %xmm8
cvtss2sd %xmm1, %xmm1
leaq 0x59bf24(%rip), %rcx    # 0x5febc0
mulsd (%rcx), %xmm1
movsd 0x17bf8(%rip), %xmm5    # 0x7a8a0
divsd %xmm1, %xmm5
cvtsd2ss %xmm5, %xmm7
leaq 0x1d7d99(%rip), %rcx    # 0x23aa50
movl (%rbx), %edx
subl (%rcx), %edx
movl 0x4(%rbx), %ecx
cvtsi2ss %edx, %xmm10
xorps %xmm1, %xmm1
cvtss2sd %xmm10, %xmm1
movsd 0x143e5(%rip), %xmm5    # 0x770b8
mulsd %xmm5, %xmm1
cvtss2sd %xmm0, %xmm0
addsd %xmm1, %xmm0
xorps %xmm1, %xmm1
cvtss2sd %xmm8, %xmm1
mulsd %xmm0, %xmm1
movsd %xmm1, 0x60(%rsp)
movaps %xmm8, %xmm0
leaq 0x1d7d58(%rip), %rdx    # 0x23aa54
subl (%rdx), %ecx
xorps 0x113eb(%rip), %xmm0    # 0x740f0
cvtsi2ss %ecx, %xmm9
xorps %xmm6, %xmm6
cvtss2sd %xmm9, %xmm6
mulsd %xmm5, %xmm6
xorps %xmm5, %xmm5
cvtss2sd %xmm2, %xmm5
subsd %xmm6, %xmm5
leaq 0x208d38(%rip), %rcx    # 0x26ba60
xorps %xmm6, %xmm6
cvtsi2ssl (%rcx), %xmm6
movaps %xmm0, 0x40(%rsp)
cvtss2sd %xmm0, %xmm0
mulsd %xmm5, %xmm0
movsd %xmm0, 0x20(%rsp)
subss %xmm6, %xmm4
xorps %xmm5, %xmm5
cvtss2sd %xmm4, %xmm5
movsd 0x18743(%rip), %xmm4    # 0x7b498
mulsd %xmm4, %xmm5
cvtss2sd %xmm3, %xmm3
subsd %xmm5, %xmm3
movss %xmm7, 0x30(%rsp)
xorps %xmm5, %xmm5
cvtss2sd %xmm7, %xmm5
mulsd %xmm3, %xmm5
mulss %xmm8, %xmm10
movss 0x186cd(%rip), %xmm3    # 0x7b44c
mulss %xmm3, %xmm10
movaps %xmm8, 0x50(%rsp)
mulss %xmm8, %xmm9
mulss %xmm3, %xmm9
leaq 0x597c0d(%rip), %rcx    # 0x5fa9a8
movsd (%rcx), %xmm1
leaq 0x597d9a(%rip), %rcx    # 0x5fab40
movsd (%rcx), %xmm0
movapd %xmm0, 0xc0(%rsp)
movzwl 0x1c(%rbx), %ecx
movswq 0x1e(%rbx), %rdx
leaq (%rdx,%rdx,2), %rdx
leaq 0x2c9ee9(%rip), %rsi    # 0x32ccb0
movzwl 0x6(%rsi,%rdx,4), %edx
leal (%rdx,%rcx), %esi
movl $0x7ff, %edi            # imm = 0x7FF
andl %edi, %esi
xorl $0x400, %esi            # imm = 0x400
leaq 0x36bf6d(%rip), %r8     # 0x3ced50
movswl (%r8,%rsi,2), %esi
xorps %xmm6, %xmm6
cvtsi2sd %esi, %xmm6
mulsd %xmm4, %xmm6
xorps %xmm7, %xmm7
cvtsd2ss %xmm6, %xmm7
addl %edx, %ecx
addl $0x200, %ecx            # imm = 0x200
andl %edi, %ecx
movswl (%r8,%rcx,2), %ecx
xorps %xmm6, %xmm6
cvtsi2sd %ecx, %xmm6
leaq 0x597ba1(%rip), %rcx    # 0x5fa9b8
mulsd %xmm4, %xmm6
cvtsd2ss %xmm6, %xmm8
movss 0x142ec(%rip), %xmm6    # 0x77114
movss %xmm6, 0x8(%rsp)
subss %xmm7, %xmm6
movaps %xmm10, %xmm4
mulss %xmm6, %xmm4
mulss %xmm9, %xmm6
mulss %xmm8, %xmm9
addss %xmm9, %xmm4
movsd (%rcx), %xmm9
mulss %xmm8, %xmm10
subss %xmm10, %xmm6
movapd %xmm0, %xmm10
unpcklpd %xmm0, %xmm10           # xmm10 = xmm10[0],xmm0[0]
movapd %xmm9, %xmm14
unpcklpd %xmm1, %xmm14           # xmm14 = xmm14[0],xmm1[0]
mulpd %xmm10, %xmm14
leaq 0x597cd0(%rip), %rdx    # 0x5fab48
leaq 0x597b41(%rip), %rcx    # 0x5fa9c0
movsd (%rcx), %xmm11
movapd 0x151a3(%rip), %xmm10   # 0x78030
xorpd %xmm11, %xmm10
leaq 0x597b17(%rip), %rcx    # 0x5fa9b0
movsd (%rdx), %xmm13
mulsd %xmm13, %xmm11
movsd (%rcx), %xmm15
movapd %xmm13, %xmm2
movapd %xmm13, %xmm12
mulsd %xmm15, %xmm13
unpcklpd %xmm10, %xmm15          # xmm15 = xmm15[0],xmm10[0]
leaq 0x597c65(%rip), %rcx    # 0x5fab28
movsd (%rcx), %xmm10
movapd %xmm10, %xmm0
unpcklpd %xmm10, %xmm0           # xmm0 = xmm0[0],xmm10[0]
mulpd %xmm0, %xmm15
cvtpd2ps %xmm14, %xmm0
cvtps2pd %xmm0, %xmm0
unpcklpd %xmm12, %xmm12          # xmm12 = xmm12[0,0]
mulpd %xmm0, %xmm12
addpd %xmm15, %xmm12
movaps %xmm8, %xmm15
xorps 0x111f6(%rip), %xmm15   # 0x740f0
cvtpd2ps %xmm12, %xmm14
movaps %xmm8, %xmm12
unpcklps %xmm15, %xmm12          # xmm12 = xmm12[0],xmm15[0],xmm12[1],xmm15[1]
shufps $0xe1, %xmm12, %xmm12   # xmm12 = xmm12[1,0,2,3]
movapd %xmm14, %xmm15
shufps $0xe1, %xmm14, %xmm15   # xmm15 = xmm15[1,0],xmm14[2,3]
mulps %xmm12, %xmm15
shufps $0x0, %xmm7, %xmm7      # xmm7 = xmm7[0,0,0,0]
movaps %xmm7, %xmm3
mulps %xmm14, %xmm3
addps %xmm15, %xmm3
movaps %xmm6, %xmm12
mulss %xmm14, %xmm12
shufps $0x55, %xmm14, %xmm14   # xmm14 = xmm14[1,1,1,1]
mulss %xmm4, %xmm14
addss %xmm12, %xmm14
movapd %xmm0, %xmm12
unpckhpd %xmm0, %xmm12           # xmm12 = xmm12[1],xmm0[1]
mulsd %xmm10, %xmm12
addsd %xmm11, %xmm12
mulsd %xmm10, %xmm0
subsd %xmm13, %xmm0
leaq 0x597bba(%rip), %rcx    # 0x5fab20
movsd (%rcx), %xmm11
mulsd %xmm11, %xmm1
unpcklpd %xmm1, %xmm12           # xmm12 = xmm12[0],xmm1[0]
mulsd %xmm11, %xmm2
mulsd %xmm11, %xmm10
mulsd %xmm11, %xmm9
movaps %xmm3, %xmm11
unpcklpd %xmm9, %xmm0            # xmm0 = xmm0[0],xmm9[0]
cvtpd2ps %xmm12, %xmm12
cvtpd2ps %xmm0, %xmm9
shufps $0x0, %xmm8, %xmm8      # xmm8 = xmm8[0,0,0,0]
movaps %xmm8, %xmm0
mulps %xmm9, %xmm0
movaps %xmm7, %xmm15
mulps %xmm12, %xmm15
addps %xmm0, %xmm15
xorps %xmm1, %xmm1
cvtsd2ss 0x60(%rsp), %xmm1
cvtsd2ss %xmm5, %xmm5
mulps %xmm12, %xmm8
mulps %xmm9, %xmm7
subps %xmm8, %xmm7
xorps %xmm3, %xmm3
cvtsd2ss %xmm2, %xmm3
movaps %xmm11, %xmm0
shufps $0x55, %xmm11, %xmm0    # xmm0 = xmm0[1,1],xmm11[1,1]
movaps %xmm5, %xmm2
mulss %xmm3, %xmm2
mulss %xmm1, %xmm0
addss %xmm2, %xmm0
xorps %xmm8, %xmm8
cvtsd2ss 0x20(%rsp), %xmm8
movaps %xmm8, %xmm13
mulss %xmm11, %xmm13
addss %xmm0, %xmm13
addss %xmm14, %xmm13
shufps $0x0, %xmm6, %xmm6      # xmm6 = xmm6[0,0,0,0]
mulps %xmm9, %xmm6
shufps $0x0, %xmm4, %xmm4      # xmm4 = xmm4[0,0,0,0]
mulps %xmm12, %xmm4
addps %xmm6, %xmm4
movaps 0x110d0(%rip), %xmm6    # 0x740f0
xorps %xmm12, %xmm12
cvtsd2ss 0xc0(%rsp), %xmm12
xorps %xmm9, %xmm9
cvtsd2ss %xmm10, %xmm9
xorps %xmm6, %xmm12
movaps %xmm9, %xmm0
unpcklps %xmm12, %xmm0           # xmm0 = xmm0[0],xmm12[0],xmm0[1],xmm12[1]
shufps $0x0, %xmm5, %xmm5      # xmm5 = xmm5[0,0,0,0]
mulps %xmm0, %xmm5
shufps $0x0, %xmm1, %xmm1      # xmm1 = xmm1[0,0,0,0]
mulps %xmm15, %xmm1
addps %xmm5, %xmm1
shufps $0x0, %xmm8, %xmm8      # xmm8 = xmm8[0,0,0,0]
mulps %xmm7, %xmm8
addps %xmm1, %xmm8
leaq 0x597b37(%rip), %r15    # 0x5faba0
movsd (%r15), %xmm1
xorps %xmm0, %xmm0
ucomisd %xmm1, %xmm0
addps %xmm4, %xmm8
movaps 0x11070(%rip), %xmm4    # 0x740f0
movaps 0x10(%rsp), %xmm2
xorps %xmm2, %xmm4
movaps %xmm9, 0x170(%rsp)
movss %xmm9, 0x94(%rsp)
movaps %xmm15, 0x180(%rsp)
movlps %xmm15, 0x84(%rsp)
movaps %xmm12, 0x160(%rsp)
movss %xmm12, 0x98(%rsp)
movaps %xmm7, 0x60(%rsp)
movlps %xmm7, 0xa4(%rsp)
movaps %xmm8, 0xc0(%rsp)
movlps %xmm8, 0xb4(%rsp)
jbe 0x63134
xorps %xmm6, %xmm11
pshufd $0x55, %xmm11, %xmm0    # xmm0 = xmm11[1,1,1,1]
movd %xmm0, 0x80(%rsp)
xorps %xmm6, %xmm3
movaps %xmm3, 0xe0(%rsp)
movss %xmm3, 0x90(%rsp)
movaps %xmm11, 0xf0(%rsp)
movss %xmm11, 0xa0(%rsp)
xorps %xmm6, %xmm13
movaps %xmm13, 0xd0(%rsp)
movss %xmm13, 0xb0(%rsp)
jmp 0x6314e
movaps %xmm13, 0xd0(%rsp)
movaps %xmm3, 0xe0(%rsp)
movaps %xmm11, 0xf0(%rsp)
movaps 0x70(%rsp), %xmm0
mulss %xmm0, %xmm2
mulss %xmm0, %xmm4
btl $0xa, %eax
jae 0x6319f
leaq 0x5975d8(%rip), %r13    # 0x5fa740
movl $0x201, %edi            # imm = 0x201
movaps %xmm2, 0x10(%rsp)
movaps %xmm4, 0x20(%rsp)
callq *0x98(%r13)
movsd 0x1831a(%rip), %xmm1    # 0x7b4a0
xorps %xmm0, %xmm0
callq *0xa8(%r13)
movaps 0x20(%rsp), %xmm4
movaps 0x10(%rsp), %xmm2
movsd (%r15), %xmm1
mulss 0x50(%rsp), %xmm4
movaps %xmm4, 0x20(%rsp)
mulss 0x40(%rsp), %xmm2
movaps %xmm2, 0x10(%rsp)
xorl %r15d, %r15d
xorps %xmm0, %xmm0
ucomisd %xmm0, %xmm1
leaq 0x59757a(%rip), %rbp    # 0x5fa740
movl $0x0, %edi
adcl $0x900, %edi            # imm = 0x900
callq *0x28(%rbp)
movl $0xb44, %edi            # imm = 0xB44
callq *0x40(%rbp)
movl $0x405, %edi            # imm = 0x405
callq *0x20(%rbp)
leaq 0x3b1641(%rip), %rax    # 0x41482c
movl 0x4(%r14), %ecx
addl (%rax), %ecx
leaq 0x3b1630(%rip), %rax    # 0x414828
testl %ecx, %ecx
cmovlel %r15d, %ecx
movswl (%rax), %eax
cmpl %eax, %ecx
cmovgel %eax, %ecx
xorps %xmm0, %xmm0
cvtsi2ss %eax, %xmm0
subl %ecx, %eax
xorps %xmm1, %xmm1
cvtsi2ss %eax, %xmm1
divss %xmm0, %xmm1
leaq 0x3acde3(%rip), %r13    # 0x410004
movslq (%r13), %rax
leaq 0x5e59f4(%rip), %rcx    # 0x648c20
movd (%rcx,%rax,4), %xmm0
xorps %xmm2, %xmm2
punpcklbw %xmm2, %xmm0    # xmm0 = xmm0[0],xmm2[0],xmm0[1],xmm2[1],xmm0[2],xmm2[2],xmm0[3],xmm2[3],xmm0[4],xmm2[4],xmm0[5],xmm2[5],xmm0[6],xmm2[6],xmm0[7],xmm2[7]
punpcklwd %xmm2, %xmm0    # xmm0 = xmm0[0],xmm2[0],xmm0[1],xmm2[1],xmm0[2],xmm2[2],xmm0[3],xmm2[3]
cvtdq2pd %xmm0, %xmm2
divpd 0x173f8(%rip), %xmm2    # 0x7a640
cvtss2sd %xmm1, %xmm1
movzbl 0x2(%rcx,%rax,4), %eax
xorps %xmm0, %xmm0
cvtsi2sd %eax, %xmm0
divsd 0x13e90(%rip), %xmm0    # 0x770f0
mulsd %xmm1, %xmm0
unpcklpd %xmm1, %xmm1            # xmm1 = xmm1[0,0]
mulpd %xmm2, %xmm1
movzwl 0xc(%rbx), %eax
testb $0x2, %al
je 0x6328f
xorl %ecx, %ecx
btl $0x9, %eax
setae %cl
leaq 0x18224(%rip), %rdx     # 0x7b4a8
movss (%rdx,%rcx,4), %xmm2
movss %xmm2, 0x8(%rsp)
cvtpd2ps %xmm1, %xmm1
movapd %xmm1, 0x50(%rsp)
cvtsd2ss %xmm0, %xmm0
movss %xmm0, 0x40(%rsp)
xorl %ecx, %ecx
testb $0x2, %al
sete %cl
movl $0xbe2, %edi            # imm = 0xBE2
callq *0x40(%rbp,%rcx,8)
movss 0x18195(%rip), %xmm1    # 0x7b450
movaps 0x10(%rsp), %xmm8
mulss %xmm1, %xmm8
movaps 0xf0(%rsp), %xmm10
movaps %xmm10, %xmm0
shufps $0x55, %xmm10, %xmm0    # xmm0 = xmm0[1,1],xmm10[1,1]
mulss %xmm8, %xmm0
movss %xmm0, 0x80(%rsp)
shufps $0x0, %xmm8, %xmm8      # xmm8 = xmm8[0,0,0,0]
mulps 0x180(%rsp), %xmm8
movlps %xmm8, 0x84(%rsp)
movaps 0x20(%rsp), %xmm12
mulss %xmm1, %xmm12
mulss %xmm12, %xmm10
movss %xmm10, 0x90(%rsp)
shufps $0x0, %xmm12, %xmm12    # xmm12 = xmm12[0,0,0,0]
mulps 0x60(%rsp), %xmm12
movlps %xmm12, 0x94(%rsp)
movaps 0x70(%rsp), %xmm7
xorps 0x10db9(%rip), %xmm7    # 0x740f0
mulss 0x38(%rsp), %xmm7
mulss 0x30(%rsp), %xmm7
mulss %xmm1, %xmm7
movaps %xmm7, %xmm1
mulss 0x160(%rsp), %xmm1
movss %xmm1, 0xa8(%rsp)
movss 0x64(%r14), %xmm4
cvtss2sd 0x6c(%r14), %xmm5
xorps %xmm2, %xmm2
cvtsi2sdl 0x60(%r14), %xmm2
mulsd 0x174af(%rip), %xmm2    # 0x7a828
movss 0x68(%r14), %xmm6
movaps 0xc0(%rsp), %xmm9
movaps 0xd0(%rsp), %xmm3
unpcklps %xmm9, %xmm3            # xmm3 = xmm3[0],xmm9[0],xmm3[1],xmm9[1]
cvtps2pd %xmm3, %xmm3
addsd %xmm5, %xmm2
shufps $0x0, %xmm7, %xmm7      # xmm7 = xmm7[0,0,0,0]
movaps 0xe0(%rsp), %xmm11
unpcklps 0x170(%rsp), %xmm11     # xmm11 = xmm11[0],mem[0],xmm11[1],mem[1]
mulps %xmm7, %xmm11
movss %xmm11, 0xa0(%rsp)
movaps %xmm11, %xmm5
shufps $0x55, %xmm11, %xmm5    # xmm5 = xmm5[1,1],xmm11[1,1]
movaps %xmm12, %xmm7
shufps $0x0, %xmm12, %xmm7     # xmm7 = xmm7[0,0],xmm12[0,0]
movss %xmm10, %xmm7           # xmm7 = xmm10[0],xmm7[1,2,3]
shufps $0x55, %xmm12, %xmm12   # xmm12 = xmm12[1,1,1,1]
mulss %xmm6, %xmm12
shufps $0x0, %xmm6, %xmm6      # xmm6 = xmm6[0,0,0,0]
mulps %xmm7, %xmm6
movaps %xmm8, %xmm7
shufps $0x55, %xmm8, %xmm8     # xmm8 = xmm8[1,1,1,1]
mulss %xmm4, %xmm8
shufps $0x0, %xmm4, %xmm4      # xmm4 = xmm4[0,0,0,0]
shufps $0x0, %xmm7, %xmm7      # xmm7 = xmm7[0,0,0,0]
movss %xmm0, %xmm7            # xmm7 = xmm0[0],xmm7[1,2,3]
mulps %xmm4, %xmm7
addps %xmm6, %xmm7
cvtps2pd %xmm7, %xmm0
cvtps2pd %xmm11, %xmm4
movss %xmm5, 0xa4(%rsp)
cvtss2sd %xmm1, %xmm1
mulsd %xmm2, %xmm1
unpcklpd %xmm2, %xmm2            # xmm2 = xmm2[0,0]
mulpd %xmm4, %xmm2
addpd %xmm0, %xmm2
subpd %xmm2, %xmm3
cvtpd2ps %xmm3, %xmm0
movlpd %xmm0, 0xb0(%rsp)
addss %xmm12, %xmm8
xorps %xmm0, %xmm0
cvtss2sd %xmm8, %xmm0
addsd %xmm0, %xmm1
shufps $0x55, %xmm9, %xmm9     # xmm9 = xmm9[1,1,1,1]
xorps %xmm0, %xmm0
cvtss2sd %xmm9, %xmm0
subsd %xmm1, %xmm0
cvtsd2ss %xmm0, %xmm0
movss %xmm0, 0xb8(%rsp)
movl %r15d, 0xac(%rsp)
movl %r15d, 0x9c(%rsp)
movl %r15d, 0x8c(%rsp)
movl $0x3f800000, 0xbc(%rsp) # imm = 0x3F800000
movq 0x18(%r14), %rax
movslq (%r13), %r8
movl (%rax,%r8,4), %eax
testl %eax, %eax
jne 0x634c9
movq 0x48(%r14), %rdi
movl 0x50(%r14), %esi
movl 0x54(%r14), %edx
movl 0x70(%r14), %ecx
callq 0x612cb
movq 0x18(%r14), %rcx
movslq (%r13), %rdx
movl %eax, (%rcx,%rdx,4)
movq 0x18(%r14), %rax
movslq (%r13), %rcx
movl (%rax,%rcx,4), %eax
movl %eax, 0x108(%rsp)
movabsq $0x3ea3d70a00000000, %rax # imm = 0x3EA3D70A00000000
movq %rax, 0x10c(%rsp)
movaps 0x50(%rsp), %xmm0
movlps %xmm0, 0x114(%rsp)
movss 0x40(%rsp), %xmm0
movss %xmm0, 0x11c(%rsp)
movss 0x8(%rsp), %xmm0
movss %xmm0, 0x120(%rsp)
leaq 0x597464(%rip), %rax    # 0x5fa978
movslq (%rax), %rax
leaq 0x3d3092(%rip), %rcx    # 0x4365b0
movd (%rcx,%rax,4), %xmm0
xorpd %xmm1, %xmm1
punpcklbw %xmm1, %xmm0    # xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1],xmm0[2],xmm1[2],xmm0[3],xmm1[3],xmm0[4],xmm1[4],xmm0[5],xmm1[5],xmm0[6],xmm1[6],xmm0[7],xmm1[7]
punpcklwd %xmm1, %xmm0    # xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1],xmm0[2],xmm1[2],xmm0[3],xmm1[3]
cvtdq2ps %xmm0, %xmm0
divps 0x170f7(%rip), %xmm0    # 0x7a630
movlps %xmm0, 0x124(%rsp)
movzbl 0x2(%rcx,%rax,4), %eax
xorps %xmm0, %xmm0
cvtsi2ss %eax, %xmm0
divss 0x17043(%rip), %xmm0    # 0x7a598
movss %xmm0, 0x12c(%rsp)
movl $0x3f800000, 0x130(%rsp) # imm = 0x3F800000
leaq 0x59740c(%rip), %rax    # 0x5fa97c
movss (%rax), %xmm0
movss %xmm0, 0x134(%rsp)
testb $0x1, %r12b
jne 0x6358c
leaq 0x5974d6(%rip), %rax    # 0x5faa60
jmp 0x63593
leaq 0x59750d(%rip), %rax    # 0x5faaa0
movq %rax, 0x140(%rsp)
leaq 0x80(%rsp), %rax
movq %rax, 0x138(%rsp)
movl 0x74(%r14), %eax
testl %eax, %eax
je 0x635bf
movl 0x78(%r14), %ecx
testl %ecx, %ecx
jne 0x63868
movq %rbx, 0x20(%rsp)
xorps %xmm0, %xmm0
cvtsi2ssl 0x50(%r14), %xmm0
movss %xmm0, 0x40(%rsp)
xorps %xmm0, %xmm0
cvtsi2ssl 0x54(%r14), %xmm0
movss %xmm0, 0x50(%rsp)
leaq 0x74(%r14), %rax
movq %rax, 0x8(%rsp)
movsd 0x17e6d(%rip), %xmm0    # 0x7b460
movsd %xmm0, (%rsp)
movq %r14, 0x10(%rsp)
movslq 0x28(%r14), %r13
leaq (%r13,%r13), %rax
leaq (%rax,%rax,2), %rax
movq %rax, 0x30(%rsp)
leaq (%rax,%rax), %rdi
movq %rdi, 0x60(%rsp)
callq 0x69a0
movq %rax, %r15
movq %r13, %rax
shlq $0x4, %rax
leaq (%rax,%rax,4), %rdi
movq %rdi, 0x38(%rsp)
callq 0x69a0
movq %rax, 0x70(%rsp)
testq %r13, %r13
jle 0x637c4
movss 0x13ac9(%rip), %xmm0    # 0x77114
movaps %xmm0, %xmm1
divss 0x40(%rsp), %xmm1
divss 0x50(%rsp), %xmm0
movq 0x10(%rsp), %rax
movq 0x20(%rax), %rax
xorl %ecx, %ecx
movq %rax, %rdx
movq 0x70(%rsp), %rsi
xorl %edi, %edi
xorl %r8d, %r8d
leaq (%r8,%r8,4), %r11
movzwl (%rax,%r11,8), %r10d
movzwl 0x14(%rax,%r11,8), %r9d
addl %r10d, %r9d
movzwl 0x2(%rax,%r11,8), %ebp
movzwl 0x16(%rax,%r11,8), %r10d
addl %ebp, %r10d
movzwl 0x4(%rax,%r11,8), %ebp
movzwl 0x18(%rax,%r11,8), %r11d
addl %ebp, %r11d
movw %di, (%r15,%rcx,2)
movl %edi, %ebp
orl $0x1, %ebp
movw %bp, 0x2(%r15,%rcx,2)
movl %edi, %ebp
orl $0x2, %ebp
movw %bp, 0x4(%r15,%rcx,2)
movw %di, 0x6(%r15,%rcx,2)
movw %bp, 0x8(%r15,%rcx,2)
movl %edi, %ebp
orl $0x3, %ebp
movw %bp, 0xa(%r15,%rcx,2)
movl $0x8, %ebp
movzwl -0x2(%rdx,%rbp), %r12d
xorps %xmm2, %xmm2
cvtsi2ss %r12d, %xmm2
mulss %xmm1, %xmm2
movss %xmm2, -0x4(%rsi,%rbp,2)
movzwl (%rdx,%rbp), %r12d
xorps %xmm2, %xmm2
cvtsi2ss %r12d, %xmm2
mulss %xmm0, %xmm2
movss %xmm2, (%rsi,%rbp,2)
movzwl -0x8(%rdx,%rbp), %r12d
xorps %xmm2, %xmm2
cvtsi2ss %r12d, %xmm2
addl %r12d, %r12d
xorl %ebx, %ebx
xorl %r14d, %r14d
cmpl %r12d, %r9d
seta %bl
subss (%rsp,%rbx,4), %xmm2
setb %r14b
addss (%rsp,%r14,4), %xmm2
movss %xmm2, -0x10(%rsi,%rbp,2)
movzwl -0x6(%rdx,%rbp), %ebx
xorps %xmm2, %xmm2
cvtsi2ss %ebx, %xmm2
addl %ebx, %ebx
xorl %r14d, %r14d
xorl %r12d, %r12d
cmpl %ebx, %r10d
seta %r14b
subss (%rsp,%r14,4), %xmm2
setb %r12b
addss (%rsp,%r12,4), %xmm2
movss %xmm2, -0xc(%rsi,%rbp,2)
movzwl -0x4(%rdx,%rbp), %ebx
xorps %xmm2, %xmm2
cvtsi2ss %ebx, %xmm2
addl %ebx, %ebx
xorl %r14d, %r14d
xorl %r12d, %r12d
cmpl %ebx, %r11d
seta %r14b
subss (%rsp,%r14,4), %xmm2
setb %r12b
addss (%rsp,%r12,4), %xmm2
movss %xmm2, -0x8(%rsi,%rbp,2)
addq $0xa, %rbp
cmpq $0x30, %rbp
jne 0x636d9
addq $0x6, %rcx
addq $0x4, %rdi
incq %r8
addq $0x50, %rsi
addq $0x28, %rdx
cmpq %r13, %r8
jne 0x63672
movq 0x10(%rsp), %r14
leaq 0x78(%r14), %rsi
movl $0x1, %edi
leaq 0x596f67(%rip), %rbp    # 0x5fa740
callq *0x118(%rbp)
movl 0x78(%r14), %esi
movl $0x8893, %edi           # imm = 0x8893
callq *0xf8(%rbp)
movl $0x8893, %edi           # imm = 0x8893
movq 0x60(%rsp), %rsi
movq %r15, %rdx
movl $0x88e4, %ecx           # imm = 0x88E4
callq *0x100(%rbp)
movq 0x30(%rsp), %rax
movl %eax, 0x7c(%r14)
movl $0x1, %edi
movq 0x8(%rsp), %rsi
callq *0x118(%rbp)
movl 0x74(%r14), %esi
movl $0x8892, %edi           # imm = 0x8892
callq *0xf8(%rbp)
movl $0x8892, %edi           # imm = 0x8892
movq 0x38(%rsp), %rsi
movq 0x70(%rsp), %rbx
movq %rbx, %rdx
movl $0x88e4, %ecx           # imm = 0x88E4
callq *0x100(%rbp)
movq %r15, %rdi
callq 0x61c0
movq %rbx, %rdi
callq 0x61c0
movl 0x74(%r14), %eax
movl 0x78(%r14), %ecx
movq 0x20(%rsp), %rbx
movl 0x7c(%r14), %edx
leaq 0x108(%rsp), %rsi
movl %edx, 0x44(%rsi)
movl %ecx, 0x40(%rsi)
movl %eax, 0x48(%rsi)
movl $0x0, 0x4c(%rsi)
movq $0x0, 0x50(%rsi)
movl $0x4, %edi
callq 0x50d4b
movl $0xb44, %edi            # imm = 0xB44
callq *0x48(%rbp)
movl $0x901, %edi            # imm = 0x901
callq *0x28(%rbp)
movl $0x1, %r15d
testb $0x4, 0xd(%rbx)
je 0x638ce
movl $0x203, %edi            # imm = 0x203
callq *0x98(%rbp)
movsd 0x16fb3(%rip), %xmm1    # 0x7a878
xorps %xmm0, %xmm0
callq *0xa8(%rbp)
movl %r15d, %eax
addq $0x198, %rsp            # imm = 0x198
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq