// File: /workspace/github_c_makefile_star2_O1/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 $0x148, %rsp            # imm = 0x148
movzwl 0xc(%rsi), %eax
movl %eax, %ecx
andl $0x30, %ecx
xorl %r15d, %r15d
cmpw $0x20, %cx
je 0x61a22
movl %edx, %r12d
movq %rsi, %rbx
movq %rdi, %r14
movss 0x8(%rdi), %xmm1
movss 0x10(%rdi), %xmm2
movzbl 0x14(%rsi), %ecx
cvtsi2sd %ecx, %xmm0
movaps %xmm1, 0xc0(%rsp)
mulss %xmm1, %xmm2
mulsd 0x1875a(%rip), %xmm0    # 0x79440
movsd 0x1866a(%rip), %xmm4    # 0x79358
mulsd %xmm4, %xmm0
cvtss2sd 0xc(%rdi), %xmm5
mulsd %xmm5, %xmm0
cvtsd2ss %xmm0, %xmm6
xorps %xmm1, %xmm1
mulss %xmm6, %xmm1
movss 0x192b6(%rip), %xmm3    # 0x79fc4
movzbl 0x15(%rsi), %ecx
xorps %xmm0, %xmm0
cvtsi2sd %ecx, %xmm0
mulsd %xmm4, %xmm0
mulsd %xmm5, %xmm0
cvtsd2ss %xmm0, %xmm0
movaps %xmm6, 0x60(%rsp)
mulss %xmm6, %xmm3
xorps %xmm4, %xmm4
cvtsi2ssl 0x8(%rsi), %xmm4
movss %xmm0, 0x90(%rsp)
mulss %xmm0, %xmm2
leaq 0x3ae2b6(%rip), %rdx    # 0x40f000
testb $-0x80, (%rdx)
je 0x60d6f
movswq 0xe(%rbx), %rdx
leaq 0x39fa85(%rip), %rsi    # 0x4007e0
movswl (%rsi,%rdx,2), %edx
imull %edx, %ecx
addl %ecx, %ecx
xorps %xmm0, %xmm0
cvtsi2ss %ecx, %xmm0
addss %xmm0, %xmm4
leaq 0x42aba(%rip), %rcx     # 0xa3830
xorps %xmm0, %xmm0
cvtsi2ssl (%rcx), %xmm0
leaq 0x36dfcc(%rip), %rcx    # 0x3ced50
xorps %xmm5, %xmm5
cvtsi2ssl (%rcx), %xmm5
mulss %xmm0, %xmm5
movss 0x19230(%rip), %xmm9    # 0x79fc8
divss %xmm5, %xmm9
cvtss2sd %xmm0, %xmm0
leaq 0x59ce18(%rip), %rcx    # 0x5fdbc0
mulsd (%rcx), %xmm0
movsd 0x185dc(%rip), %xmm5    # 0x79390
divsd %xmm0, %xmm5
cvtsd2ss %xmm5, %xmm8
leaq 0x1d8c8c(%rip), %rcx    # 0x239a50
movl (%rbx), %edx
subl (%rcx), %edx
movl 0x4(%rbx), %ecx
xorps %xmm0, %xmm0
cvtsi2ss %edx, %xmm0
xorps %xmm5, %xmm5
cvtss2sd %xmm0, %xmm5
movsd 0x1513f(%rip), %xmm6    # 0x75f20
mulsd %xmm6, %xmm5
cvtss2sd %xmm3, %xmm3
addsd %xmm5, %xmm3
xorps %xmm5, %xmm5
cvtss2sd %xmm9, %xmm5
mulsd %xmm3, %xmm5
movsd %xmm5, 0x70(%rsp)
movaps %xmm9, %xmm5
leaq 0x1d8c4a(%rip), %rdx    # 0x239a54
subl (%rdx), %ecx
xorps 0x1765d(%rip), %xmm5    # 0x78470
cvtsi2ss %ecx, %xmm7
xorps %xmm3, %xmm3
cvtss2sd %xmm7, %xmm3
mulsd %xmm6, %xmm3
cvtss2sd %xmm1, %xmm1
subsd %xmm3, %xmm1
leaq 0x209c2f(%rip), %rcx    # 0x26aa60
xorps %xmm3, %xmm3
cvtsi2ssl (%rcx), %xmm3
movaps %xmm5, 0xa0(%rsp)
cvtss2sd %xmm5, %xmm5
mulsd %xmm1, %xmm5
movsd %xmm5, 0x8(%rsp)
subss %xmm3, %xmm4
xorps %xmm3, %xmm3
cvtss2sd %xmm4, %xmm3
movsd 0x1917f(%rip), %xmm1    # 0x79fe0
mulsd %xmm1, %xmm3
cvtss2sd %xmm2, %xmm2
subsd %xmm3, %xmm2
movss %xmm8, 0x88(%rsp)
xorps %xmm3, %xmm3
cvtss2sd %xmm8, %xmm3
mulsd %xmm2, %xmm3
movsd %xmm3, 0xe8(%rsp)
mulss %xmm9, %xmm0
movss 0x19133(%rip), %xmm2    # 0x79fcc
mulss %xmm2, %xmm0
movaps %xmm9, 0xb0(%rsp)
mulss %xmm9, %xmm7
mulss %xmm2, %xmm7
leaq 0x598af2(%rip), %rcx    # 0x5f99a8
movsd (%rcx), %xmm3
movsd %xmm3, 0xe0(%rsp)
leaq 0x598c76(%rip), %rcx    # 0x5f9b40
movsd (%rcx), %xmm4
movzwl 0x1c(%rbx), %ecx
movswq 0x1e(%rbx), %rdx
leaq (%rdx,%rdx,2), %rdx
leaq 0x2cadce(%rip), %rsi    # 0x32bcb0
movzwl 0x6(%rsi,%rdx,4), %edx
leal (%rdx,%rcx), %esi
movl $0x7ff, %edi            # imm = 0x7FF
andl %edi, %esi
xorl $0x400, %esi            # imm = 0x400
leaq 0x36ce52(%rip), %r8     # 0x3cdd50
movswl (%r8,%rsi,2), %esi
xorps %xmm2, %xmm2
cvtsi2sd %esi, %xmm2
mulsd %xmm1, %xmm2
xorps %xmm6, %xmm6
cvtsd2ss %xmm2, %xmm6
addl %edx, %ecx
addl $0x200, %ecx            # imm = 0x200
andl %edi, %ecx
movswl (%r8,%rcx,2), %ecx
xorps %xmm2, %xmm2
cvtsi2sd %ecx, %xmm2
mulsd %xmm1, %xmm2
cvtsd2ss %xmm2, %xmm9
movss 0x15057(%rip), %xmm10   # 0x75f94
movss %xmm10, 0x58(%rsp)
subss %xmm6, %xmm10
movaps %xmm0, %xmm11
mulss %xmm10, %xmm11
mulss %xmm7, %xmm10
mulss %xmm9, %xmm7
addss %xmm7, %xmm11
movapd %xmm3, %xmm1
movapd %xmm4, %xmm3
movsd %xmm4, 0xd8(%rsp)
mulsd %xmm4, %xmm1
cvtsd2ss %xmm1, %xmm1
mulss %xmm9, %xmm0
subss %xmm0, %xmm10
xorps %xmm2, %xmm2
cvtss2sd %xmm1, %xmm2
leaq 0x598bb6(%rip), %rcx    # 0x5f9b48
leaq 0x598a27(%rip), %rdx    # 0x5f99c0
movsd (%rdx), %xmm14
leaq 0x598b83(%rip), %rdx    # 0x5f9b28
movsd (%rdx), %xmm15
movapd %xmm15, %xmm0
mulsd %xmm14, %xmm0
movsd (%rcx), %xmm13
movaps %xmm2, %xmm1
mulsd %xmm13, %xmm1
subsd %xmm0, %xmm1
leaq 0x5989ec(%rip), %rcx    # 0x5f99b8
movsd (%rcx), %xmm0
mulsd %xmm0, %xmm3
cvtsd2ss %xmm3, %xmm3
cvtss2sd %xmm3, %xmm3
leaq 0x5989cd(%rip), %rcx    # 0x5f99b0
movsd (%rcx), %xmm4
movapd %xmm15, %xmm7
mulsd %xmm4, %xmm7
movaps %xmm3, %xmm8
mulsd %xmm13, %xmm8
addsd %xmm7, %xmm8
cvtsd2ss %xmm1, %xmm5
xorps %xmm1, %xmm1
cvtsd2ss %xmm8, %xmm1
movaps %xmm9, %xmm7
mulss %xmm1, %xmm7
movaps %xmm6, %xmm8
mulss %xmm5, %xmm8
addss %xmm7, %xmm8
movaps %xmm9, %xmm12
mulss %xmm5, %xmm12
movaps %xmm6, %xmm7
mulss %xmm1, %xmm7
subss %xmm12, %xmm7
mulss %xmm10, %xmm1
mulss %xmm11, %xmm5
addss %xmm1, %xmm5
movss %xmm5, 0x9c(%rsp)
mulsd %xmm13, %xmm14
mulsd %xmm15, %xmm2
addsd %xmm14, %xmm2
movapd %xmm13, %xmm1
mulsd %xmm4, %xmm13
mulsd %xmm15, %xmm3
subsd %xmm13, %xmm3
xorps %xmm13, %xmm13
cvtsd2ss %xmm2, %xmm13
cvtsd2ss %xmm3, %xmm3
movaps %xmm9, %xmm2
mulss %xmm3, %xmm2
movaps %xmm6, %xmm14
mulss %xmm13, %xmm14
addss %xmm2, %xmm14
movaps %xmm9, %xmm4
mulss %xmm13, %xmm4
movaps %xmm6, %xmm2
mulss %xmm3, %xmm2
subss %xmm4, %xmm2
mulss %xmm10, %xmm3
mulss %xmm11, %xmm13
addss %xmm3, %xmm13
leaq 0x598a64(%rip), %rcx    # 0x5f9b20
movsd (%rcx), %xmm3
mulsd %xmm3, %xmm1
mulsd %xmm3, %xmm15
movsd 0xe0(%rsp), %xmm4
mulsd %xmm3, %xmm4
cvtsd2ss %xmm4, %xmm4
mulsd %xmm3, %xmm0
xorps %xmm3, %xmm3
cvtsd2ss %xmm0, %xmm3
movaps %xmm9, %xmm12
mulss %xmm3, %xmm12
movaps %xmm6, %xmm0
mulss %xmm4, %xmm0
addss %xmm12, %xmm0
xorps %xmm12, %xmm12
cvtsd2ss 0xd8(%rsp), %xmm12
xorps %xmm5, %xmm5
cvtsd2ss %xmm1, %xmm5
movss %xmm8, 0x10(%rsp)
movss %xmm5, 0x20(%rsp)
movss %xmm7, 0x30(%rsp)
movss %xmm14, 0x14(%rsp)
cvtsd2ss %xmm15, %xmm15
movss %xmm15, 0x24(%rsp)
movss %xmm2, 0x34(%rsp)
movss %xmm0, 0x18(%rsp)
movaps %xmm12, %xmm1
xorps 0x17324(%rip), %xmm1    # 0x78470
movss %xmm1, 0x28(%rsp)
mulss %xmm4, %xmm9
mulss %xmm3, %xmm6
subss %xmm9, %xmm6
mulss %xmm3, %xmm10
mulss %xmm4, %xmm11
addss %xmm10, %xmm11
xorps %xmm4, %xmm4
cvtsd2ss 0x70(%rsp), %xmm4
xorps %xmm1, %xmm1
cvtsd2ss 0x8(%rsp), %xmm1
xorps %xmm3, %xmm3
cvtsd2ss 0xe8(%rsp), %xmm3
mulss %xmm3, %xmm15
mulss %xmm3, %xmm12
mulss %xmm5, %xmm3
mulss %xmm4, %xmm14
mulss %xmm4, %xmm0
mulss %xmm8, %xmm4
addss %xmm3, %xmm4
movss %xmm6, 0x38(%rsp)
mulss %xmm1, %xmm2
mulss %xmm1, %xmm6
mulss %xmm7, %xmm1
addss %xmm4, %xmm1
addss 0x9c(%rsp), %xmm1
addss %xmm15, %xmm14
addss %xmm14, %xmm2
addss %xmm13, %xmm2
movss %xmm1, 0x40(%rsp)
movss %xmm2, 0x44(%rsp)
subss %xmm12, %xmm0
addss %xmm0, %xmm6
leaq 0x5989a9(%rip), %r15    # 0x5f9ba0
xorps %xmm0, %xmm0
ucomisd (%r15), %xmm0
addss %xmm11, %xmm6
movss %xmm6, 0x48(%rsp)
movaps 0x1725f(%rip), %xmm3    # 0x78470
movaps 0x60(%rsp), %xmm2
xorps %xmm2, %xmm3
jbe 0x61248
movaps 0x1724e(%rip), %xmm0    # 0x78470
xorps %xmm0, %xmm8
movss %xmm8, 0x10(%rsp)
xorps %xmm0, %xmm5
movss %xmm5, 0x20(%rsp)
xorps %xmm0, %xmm7
movss %xmm7, 0x30(%rsp)
xorps %xmm0, %xmm1
movss %xmm1, 0x40(%rsp)
movaps 0xc0(%rsp), %xmm0
mulss %xmm0, %xmm2
mulss %xmm0, %xmm3
btl $0xa, %eax
jae 0x61297
leaq 0x5984db(%rip), %r13    # 0x5f9740
movl $0x201, %edi            # imm = 0x201
movaps %xmm2, 0x60(%rsp)
movaps %xmm3, 0x70(%rsp)
callq *0x98(%r13)
movsd 0x18d65(%rip), %xmm1    # 0x79fe8
xorps %xmm0, %xmm0
callq *0xa8(%r13)
movaps 0x70(%rsp), %xmm3
movaps 0x60(%rsp), %xmm2
mulss 0xb0(%rsp), %xmm3
movaps %xmm3, 0x70(%rsp)
mulss 0xa0(%rsp), %xmm2
movaps %xmm2, 0x60(%rsp)
movsd (%r15), %xmm0
xorl %r15d, %r15d
xorps %xmm1, %xmm1
ucomisd %xmm1, %xmm0
leaq 0x598477(%rip), %rbp    # 0x5f9740
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 0x3b253e(%rip), %rax    # 0x41382c
movl 0x4(%r14), %ecx
addl (%rax), %ecx
leaq 0x3b252d(%rip), %rax    # 0x413828
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 0x3adce0(%rip), %r13    # 0x40f004
movslq (%r13), %rax
leaq 0x5e6901(%rip), %rcx    # 0x647c30
movzbl (%rcx,%rax,4), %edx
xorps %xmm0, %xmm0
cvtsi2sd %edx, %xmm0
movsd 0x14c16(%rip), %xmm3    # 0x75f58
divsd %xmm3, %xmm0
cvtss2sd %xmm1, %xmm4
mulsd %xmm4, %xmm0
movzbl 0x1(%rcx,%rax,4), %edx
xorps %xmm1, %xmm1
cvtsi2sd %edx, %xmm1
divsd %xmm3, %xmm1
mulsd %xmm4, %xmm1
movzbl 0x2(%rcx,%rax,4), %eax
xorps %xmm2, %xmm2
cvtsi2sd %eax, %xmm2
divsd %xmm3, %xmm2
mulsd %xmm4, %xmm2
movzwl 0xc(%rbx), %eax
testb $0x2, %al
je 0x61399
xorl %ecx, %ecx
btl $0x9, %eax
setae %cl
leaq 0x18c62(%rip), %rdx     # 0x79ff0
movss (%rdx,%rcx,4), %xmm3
movss %xmm3, 0x58(%rsp)
cvtsd2ss %xmm0, %xmm0
movss %xmm0, 0xb0(%rsp)
xorps %xmm0, %xmm0
cvtsd2ss %xmm1, %xmm0
movss %xmm0, 0xa0(%rsp)
xorps %xmm0, %xmm0
cvtsd2ss %xmm2, %xmm0
movss %xmm0, 0x8(%rsp)
xorl %ecx, %ecx
testb $0x2, %al
sete %cl
movl $0xbe2, %edi            # imm = 0xBE2
callq *0x40(%rbp,%rcx,8)
movss 0x18bf5(%rip), %xmm2    # 0x79fd0
movaps 0x60(%rsp), %xmm10
mulss %xmm2, %xmm10
movss 0x10(%rsp), %xmm1
mulss %xmm10, %xmm1
movss %xmm1, 0x10(%rsp)
movss 0x14(%rsp), %xmm0
mulss %xmm10, %xmm0
movss %xmm0, 0x14(%rsp)
mulss 0x18(%rsp), %xmm10
movss %xmm10, 0x18(%rsp)
movaps 0x70(%rsp), %xmm11
mulss %xmm2, %xmm11
movss 0x30(%rsp), %xmm6
mulss %xmm11, %xmm6
movaps 0xc0(%rsp), %xmm9
xorps 0x17033(%rip), %xmm9    # 0x78470
mulss 0x90(%rsp), %xmm9
mulss 0x88(%rsp), %xmm9
mulss %xmm2, %xmm9
movss 0x20(%rsp), %xmm7
mulss %xmm9, %xmm7
movss %xmm6, 0x20(%rsp)
movss 0x34(%rsp), %xmm2
mulss %xmm11, %xmm2
movss 0x24(%rsp), %xmm3
movss %xmm2, 0x24(%rsp)
mulss 0x38(%rsp), %xmm11
mulss %xmm9, %xmm3
mulss 0x28(%rsp), %xmm9
movss %xmm11, 0x28(%rsp)
movss %xmm7, 0x30(%rsp)
movss %xmm3, 0x34(%rsp)
movss %xmm9, 0x38(%rsp)
movss 0x64(%r14), %xmm4
movss 0x68(%r14), %xmm5
mulss %xmm5, %xmm6
mulss %xmm4, %xmm1
addss %xmm6, %xmm1
cvtss2sd 0x6c(%r14), %xmm8
xorps %xmm6, %xmm6
cvtsi2sdl 0x60(%r14), %xmm6
cvtss2sd %xmm1, %xmm1
mulsd 0x17e1a(%rip), %xmm6    # 0x792f8
addsd %xmm8, %xmm6
cvtss2sd %xmm7, %xmm7
mulsd %xmm6, %xmm7
xorps %xmm8, %xmm8
cvtss2sd 0x40(%rsp), %xmm8
addsd %xmm1, %xmm7
subsd %xmm7, %xmm8
xorps %xmm1, %xmm1
cvtsd2ss %xmm8, %xmm1
movss %xmm1, 0x40(%rsp)
mulss %xmm5, %xmm2
mulss %xmm4, %xmm0
addss %xmm2, %xmm0
cvtss2sd %xmm0, %xmm0
xorps %xmm1, %xmm1
cvtss2sd %xmm3, %xmm1
mulsd %xmm6, %xmm1
addsd %xmm0, %xmm1
xorps %xmm0, %xmm0
cvtss2sd 0x44(%rsp), %xmm0
subsd %xmm1, %xmm0
cvtsd2ss %xmm0, %xmm0
movss %xmm0, 0x44(%rsp)
mulss %xmm5, %xmm11
mulss %xmm4, %xmm10
addss %xmm11, %xmm10
xorps %xmm0, %xmm0
cvtss2sd %xmm10, %xmm0
xorps %xmm1, %xmm1
cvtss2sd %xmm9, %xmm1
mulsd %xmm6, %xmm1
addsd %xmm0, %xmm1
xorps %xmm0, %xmm0
cvtss2sd 0x48(%rsp), %xmm0
subsd %xmm1, %xmm0
cvtsd2ss %xmm0, %xmm0
movss %xmm0, 0x48(%rsp)
movl %r15d, 0x3c(%rsp)
movl %r15d, 0x2c(%rsp)
movl %r15d, 0x1c(%rsp)
movl $0x3f800000, 0x4c(%rsp) # imm = 0x3F800000
movq 0x18(%r14), %rax
movslq (%r13), %r8
cmpl %r15d, (%rax,%r8,4)
jne 0x615c6
movq 0x48(%r14), %rdi
movl 0x50(%r14), %esi
movl 0x54(%r14), %edx
movl 0x70(%r14), %ecx
callq 0x5f272
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, 0xf0(%rsp)
movabsq $0x3ea3d70a00000000, %rax # imm = 0x3EA3D70A00000000
movq %rax, 0xf4(%rsp)
movss 0xb0(%rsp), %xmm0
movss %xmm0, 0xfc(%rsp)
movss 0xa0(%rsp), %xmm0
movss %xmm0, 0x100(%rsp)
movss 0x8(%rsp), %xmm0
movss %xmm0, 0x104(%rsp)
movss 0x58(%rsp), %xmm0
movss %xmm0, 0x108(%rsp)
leaq 0x598345(%rip), %rax    # 0x5f9978
movslq (%rax), %rax
leaq 0x3d3f73(%rip), %rcx    # 0x4355b0
movzbl (%rcx,%rax,4), %edx
xorps %xmm0, %xmm0
cvtsi2ss %edx, %xmm0
movss 0x17c6c(%rip), %xmm1    # 0x792bc
divss %xmm1, %xmm0
movss %xmm0, 0x10c(%rsp)
movzbl 0x1(%rcx,%rax,4), %edx
xorps %xmm0, %xmm0
cvtsi2ss %edx, %xmm0
divss %xmm1, %xmm0
movzbl 0x2(%rcx,%rax,4), %eax
xorps %xmm2, %xmm2
cvtsi2ss %eax, %xmm2
movss %xmm0, 0x110(%rsp)
divss %xmm1, %xmm2
movss %xmm2, 0x114(%rsp)
movl $0x3f800000, 0x118(%rsp) # imm = 0x3F800000
leaq 0x5982db(%rip), %rax    # 0x5f997c
movss (%rax), %xmm0
movss %xmm0, 0x11c(%rsp)
testb $0x1, %r12b
jne 0x616bd
leaq 0x5983a5(%rip), %rax    # 0x5f9a60
jmp 0x616c4
leaq 0x5983dc(%rip), %rax    # 0x5f9aa0
movq %rax, 0x128(%rsp)
leaq 0x10(%rsp), %rax
movq %rax, 0x120(%rsp)
cmpl $0x0, 0x74(%r14)
je 0x616eb
cmpl $0x0, 0x78(%r14)
jne 0x619b4
movq %rbx, 0x70(%rsp)
xorps %xmm0, %xmm0
cvtsi2ssl 0x50(%r14), %xmm0
movss %xmm0, 0x8(%rsp)
xorps %xmm0, %xmm0
cvtsi2ssl 0x54(%r14), %xmm0
movss %xmm0, 0xa0(%rsp)
leaq 0x74(%r14), %rax
movq %rax, 0x58(%rsp)
movabsq $0x3b80000000000000, %rax # imm = 0x3B80000000000000
movq %rax, (%rsp)
movq %r14, 0x60(%rsp)
movslq 0x28(%r14), %r13
leaq (%r13,%r13), %rax
leaq (%rax,%rax,2), %rax
movq %rax, 0x88(%rsp)
leaq (%rax,%rax), %rdi
movq %rdi, 0xb0(%rsp)
callq 0x69a0
movq %rax, %r15
movq %r13, %rax
shlq $0x4, %rax
leaq (%rax,%rax,4), %rdi
movq %rdi, 0x90(%rsp)
callq 0x69a0
movq %rax, 0xc0(%rsp)
testq %r13, %r13
jle 0x6190c
movss 0x1480d(%rip), %xmm0    # 0x75f94
movaps %xmm0, %xmm1
divss 0x8(%rsp), %xmm1
divss 0xa0(%rsp), %xmm0
movq 0x60(%rsp), %rax
movq 0x20(%rax), %rax
xorl %ecx, %ecx
movq %rax, %rdx
movq 0xc0(%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), %r12d
movzwl 0x16(%rax,%r11,8), %r10d
addl %r12d, %r10d
movzwl 0x4(%rax,%r11,8), %r12d
movzwl 0x18(%rax,%r11,8), %r11d
addl %r12d, %r11d
movw %di, (%r15,%rcx,2)
movl %edi, %r12d
orl $0x1, %r12d
movw %r12w, 0x2(%r15,%rcx,2)
movl %edi, %r12d
orl $0x2, %r12d
movw %r12w, 0x4(%r15,%rcx,2)
movw %di, 0x6(%r15,%rcx,2)
movw %r12w, 0x8(%r15,%rcx,2)
movl %edi, %r12d
orl $0x3, %r12d
movw %r12w, 0xa(%r15,%rcx,2)
movl $0x8, %r12d
movzwl -0x2(%rdx,%r12), %ebp
xorps %xmm2, %xmm2
cvtsi2ss %ebp, %xmm2
mulss %xmm1, %xmm2
movss %xmm2, -0x4(%rsi,%r12,2)
movzwl (%rdx,%r12), %ebp
xorps %xmm2, %xmm2
cvtsi2ss %ebp, %xmm2
mulss %xmm0, %xmm2
movss %xmm2, (%rsi,%r12,2)
movzwl -0x8(%rdx,%r12), %ebp
xorps %xmm2, %xmm2
cvtsi2ss %ebp, %xmm2
addl %ebp, %ebp
xorl %ebx, %ebx
xorl %r14d, %r14d
cmpl %ebp, %r9d
seta %bl
subss (%rsp,%rbx,4), %xmm2
setb %r14b
addss (%rsp,%r14,4), %xmm2
movss %xmm2, -0x10(%rsi,%r12,2)
movzwl -0x6(%rdx,%r12), %ebx
xorps %xmm2, %xmm2
cvtsi2ss %ebx, %xmm2
addl %ebx, %ebx
xorl %r14d, %r14d
xorl %ebp, %ebp
cmpl %ebx, %r10d
seta %r14b
subss (%rsp,%r14,4), %xmm2
setb %bpl
addss (%rsp,%rbp,4), %xmm2
movss %xmm2, -0xc(%rsi,%r12,2)
movzwl -0x4(%rdx,%r12), %ebx
xorps %xmm2, %xmm2
cvtsi2ss %ebx, %xmm2
addl %ebx, %ebx
xorl %r14d, %r14d
xorl %ebp, %ebp
cmpl %ebx, %r11d
seta %r14b
subss (%rsp,%r14,4), %xmm2
setb %bpl
addss (%rsp,%rbp,4), %xmm2
movss %xmm2, -0x8(%rsi,%r12,2)
addq $0xa, %r12
cmpq $0x30, %r12
jne 0x61822
addq $0x6, %rcx
addq $0x4, %rdi
incq %r8
addq $0x50, %rsi
addq $0x28, %rdx
cmpq %r13, %r8
jne 0x617b4
movq 0x60(%rsp), %r14
leaq 0x78(%r14), %rsi
movl $0x1, %edi
leaq 0x597e1f(%rip), %rbp    # 0x5f9740
callq *0x118(%rbp)
movl 0x78(%r14), %esi
movl $0x8893, %edi           # imm = 0x8893
callq *0xf8(%rbp)
movl $0x8893, %edi           # imm = 0x8893
movq 0xb0(%rsp), %rsi
movq %r15, %rdx
movl $0x88e4, %ecx           # imm = 0x88E4
callq *0x100(%rbp)
movq 0x88(%rsp), %rax
movl %eax, 0x7c(%r14)
movl $0x1, %edi
movq 0x58(%rsp), %rsi
callq *0x118(%rbp)
movl 0x74(%r14), %esi
movl $0x8892, %edi           # imm = 0x8892
callq *0xf8(%rbp)
movl $0x8892, %edi           # imm = 0x8892
movq 0x90(%rsp), %rsi
movq 0xc0(%rsp), %rbx
movq %rbx, %rdx
movl $0x88e4, %ecx           # imm = 0x88E4
callq *0x100(%rbp)
movq %r15, %rdi
callq 0x61c0
movq %rbx, %rdi
callq 0x61c0
movq 0x70(%rsp), %rbx
movl 0x7c(%r14), %eax
leaq 0xf0(%rsp), %rsi
movl %eax, 0x44(%rsi)
movl 0x78(%r14), %eax
movl %eax, 0x40(%rsi)
movl 0x74(%r14), %eax
movl %eax, 0x48(%rsi)
movl $0x0, 0x4c(%rsi)
movq $0x0, 0x50(%rsi)
movl $0x4, %edi
callq 0x4e5ea
movl $0xb44, %edi            # imm = 0xB44
callq *0x48(%rbp)
movl $0x901, %edi            # imm = 0x901
callq *0x28(%rbp)
movl $0x1, %r15d
testb $0x4, 0xd(%rbx)
je 0x61a22
movl $0x203, %edi            # imm = 0x203
callq *0x98(%rbp)
movsd 0x1792f(%rip), %xmm1    # 0x79348
xorps %xmm0, %xmm0
callq *0xa8(%rbp)
movl %r15d, %eax
addq $0x148, %rsp            # imm = 0x148
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq