// File: /workspace/github_cpp_makefile_star2_O3/FreeSlave[P]vhlt/hlcsg/brush.cpp
// Function: CreateHullBrush(brush_s const*)
hullbrush_t *CreateHullBrush (const brush_t *b)
{
	const int MAXSIZE = 256;

	hullbrush_t *hb;
	int numplanes;
	plane_t planes[MAXSIZE];
	Winding *w[MAXSIZE];
	int numedges;
	hullbrushedge_t edges[MAXSIZE];
	int numvertexes;
	hullbrushvertex_t vertexes[MAXSIZE];
	int i;
	int j;
	int k;
	int e;
	int e2;
	vec3_t origin;
	bool failed = false;

	// planes

	numplanes = 0;
	GetVectorForKey (&g_entities[b->entitynum], "origin", origin);

	for (i = 0; i < b->numsides; i++)
	{
		side_t *s;
		vec3_t p[3];
		vec3_t v1;
		vec3_t v2;
		vec3_t normal;
		planetypes axial;

		s = &g_brushsides[b->firstside + i];
		for (j = 0; j < 3; j++)
		{
			VectorSubtract (s->planepts[j], origin, p[j]);
			for (k = 0; k < 3; k++)
			{
				if (fabs (p[j][k] - floor (p[j][k] + 0.5)) <= ON_EPSILON && p[j][k] != floor (p[j][k] + 0.5))
				{
					Warning ("Entity %i, Brush %i: vertex (%4.8f %4.8f %4.8f) of an info_hullshape entity is slightly off-grid.",
#ifdef HLCSG_COUNT_NEW
							b->originalentitynum, b->originalbrushnum,
#else
							b->entitynum, b->brushnum,
#endif
							p[j][0], p[j][1], p[j][2]);
				}
			}
		}
		VectorSubtract (p[0], p[1], v1);
		VectorSubtract (p[2], p[1], v2);
		CrossProduct (v1, v2, normal);
		if (!VectorNormalize (normal))
		{
			failed = true;
			continue;
		}
		for (k = 0; k < 3; k++)
		{
			if (fabs (normal[k]) < NORMAL_EPSILON)
			{
				normal[k] = 0.0;
				VectorNormalize (normal);
			}
		}
		axial = PlaneTypeForNormal (normal);
		if (axial <= last_axial)
		{
			int sign = normal[axial] > 0? 1: -1;
			VectorClear (normal);
			normal[axial] = sign;
		}

		if (numplanes >= MAXSIZE)
		{
			failed = true;
			continue;
		}
		VectorCopy (normal, planes[numplanes].normal);
		planes[numplanes].dist = DotProduct (p[1], normal);
		numplanes++;
	}

	// windings

	for (i = 0; i < numplanes; i++)
	{
		w[i] = new Winding (planes[i].normal, planes[i].dist);
		for (j = 0; j < numplanes; j++)
		{
			if (j == i)
			{
				continue;
			}
			vec3_t normal;
			vec_t dist;
			VectorSubtract (vec3_origin, planes[j].normal, normal);
			dist = -planes[j].dist;
			if (!w[i]->Chop (normal, dist))
			{
				failed = true;
				break;
			}
		}
	}

	// edges
	numedges = 0;
	for (i = 0; i < numplanes; i++)
	{
		for (e = 0; e < w[i]->m_NumPoints; e++)
		{
			hullbrushedge_t *edge;
			int found;
			if (numedges >= MAXSIZE)
			{
				failed = true;
				continue;
			}
			edge = &edges[numedges];
			VectorCopy (w[i]->m_Points[(e + 1) % w[i]->m_NumPoints], edge->vertexes[0]);
			VectorCopy (w[i]->m_Points[e], edge->vertexes[1]);
			VectorCopy (edge->vertexes[0], edge->point);
			VectorSubtract (edge->vertexes[1], edge->vertexes[0], edge->delta);
			if (VectorLength (edge->delta) < 1 - ON_EPSILON)
			{
				failed = true;
				continue;
			}
			VectorCopy (planes[i].normal, edge->normals[0]);
			found = 0;
			for (k = 0; k < numplanes; k++)
			{
				for (e2 = 0; e2 < w[k]->m_NumPoints; e2++)
				{
					if (VectorCompare (w[k]->m_Points[(e2 + 1) % w[k]->m_NumPoints], edge->vertexes[1]) &&
						VectorCompare (w[k]->m_Points[e2], edge->vertexes[0]))
					{
						found++;
						VectorCopy (planes[k].normal, edge->normals[1]);
						j = k;
					}
				}
			}
			if (found != 1)
			{
				failed = true;
				continue;
			}
			if (fabs (DotProduct (edge->vertexes[0], edge->normals[0]) - planes[i].dist) > NORMAL_EPSILON
				|| fabs (DotProduct (edge->vertexes[1], edge->normals[0]) - planes[i].dist) > NORMAL_EPSILON
				|| fabs (DotProduct (edge->vertexes[0], edge->normals[1]) - planes[j].dist) > NORMAL_EPSILON
				|| fabs (DotProduct (edge->vertexes[1], edge->normals[1]) - planes[j].dist) > NORMAL_EPSILON)
			{
				failed = true;
				continue;
			}
			if (j > i)
			{
				numedges++;
			}
		}
	}

	// vertexes
	numvertexes = 0;
	for (i = 0; i < numplanes; i++)
	{
		for (e = 0; e < w[i]->m_NumPoints; e++)
		{
			vec3_t v;
			VectorCopy (w[i]->m_Points[e], v);
			for (j = 0; j < numvertexes; j++)
			{
				if (VectorCompare (vertexes[j].point, v))
				{
					break;
				}
			}
			if (j < numvertexes)
			{
				continue;
			}
			if (numvertexes > MAXSIZE)
			{
				failed = true;
				continue;
			}

			VectorCopy (v, vertexes[numvertexes].point);
			numvertexes++;

			for (k = 0; k < numplanes; k++)
			{
				if (fabs (DotProduct (v, planes[k].normal) - planes[k].dist) < ON_EPSILON)
				{
					if (fabs (DotProduct (v, planes[k].normal) - planes[k].dist) > NORMAL_EPSILON)
					{
						failed = true;
					}
				}
			}
		}
	}

	// copy to hull brush

	if (!failed)
	{
		hb = (hullbrush_t *)malloc (sizeof (hullbrush_t));
		hlassume (hb != NULL, assume_NoMemory);

		hb->numfaces = numplanes;
		hb->faces = (hullbrushface_t *)malloc (hb->numfaces * sizeof (hullbrushface_t));
		hlassume (hb->faces != NULL, assume_NoMemory);
		for (i = 0; i < numplanes; i++)
		{
			hullbrushface_t *f = &hb->faces[i];
			VectorCopy (planes[i].normal, f->normal);
			VectorCopy (w[i]->m_Points[0], f->point);
			f->numvertexes = w[i]->m_NumPoints;
			f->vertexes = (vec3_t *)malloc (f->numvertexes * sizeof (vec3_t));
			hlassume (f->vertexes != NULL, assume_NoMemory);
			for (k = 0; k < w[i]->m_NumPoints; k++)
			{
				VectorCopy (w[i]->m_Points[k], f->vertexes[k]);
			}
		}

		hb->numedges = numedges;
		hb->edges = (hullbrushedge_t *)malloc (hb->numedges * sizeof (hullbrushedge_t));
		hlassume (hb->edges != NULL, assume_NoMemory);
		memcpy (hb->edges, edges, hb->numedges * sizeof (hullbrushedge_t));

		hb->numvertexes = numvertexes;
		hb->vertexes = (hullbrushvertex_t *)malloc (hb->numvertexes * sizeof (hullbrushvertex_t));
		hlassume (hb->vertexes != NULL, assume_NoMemory);
		memcpy (hb->vertexes, vertexes, hb->numvertexes * sizeof (hullbrushvertex_t));

		Developer (DEVELOPER_LEVEL_MESSAGE, "info_hullshape @ (%.0f,%.0f,%.0f): %d faces, %d edges, %d vertexes.\n", origin[0], origin[1], origin[2], hb->numfaces, hb->numedges, hb->numvertexes);
	}
	else
	{
		hb = NULL;
		Error ("Entity %i, Brush %i: invalid brush. This brush cannot be used for info_hullshape.",
#ifdef HLCSG_COUNT_NEW
				b->originalentitynum, b->originalbrushnum
#else
				b->entitynum, b->brushnum
#endif
				);
	}

	for (i = 0; i < numplanes; i++)
	{
		delete w[i];
	}

	return hb;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xf108, %rsp           # imm = 0xF108
movq %rdi, %rbx
movslq 0x8(%rdi), %rax
leaq (%rax,%rax,4), %rdi
shlq $0x3, %rdi
addq 0x175cb(%rip), %rdi     # 0x27fd8
leaq 0x11109(%rip), %rsi     # 0x21b1d
leaq 0x90(%rsp), %rdx
callq 0x82a6
cmpl $0x0, 0x14(%rbx)
jle 0x11583
xorl %r12d, %r12d
leaq 0xef46(%rip), %r15      # 0x1f97b
xorl %ecx, %ecx
xorl %r11d, %r11d
movq %rbx, 0x18(%rsp)
movq %r11, 0x60(%rsp)
movq %r12, %r14
movslq 0x10(%rbx), %rax
movl %ecx, %r13d
movslq %ecx, %rcx
addq %rax, %rcx
imulq $0xd0, %rcx, %rax
movq %rax, 0x38(%rsp)
leaq 0xb0(%rsp), %r12
xorl %ebx, %ebx
leaq (,%rbx,8), %rax
leaq (%rax,%rax,2), %rax
leaq 0x3abcb63(%rip), %rcx   # 0x3acd5e0
movq 0x38(%rsp), %rdx
addq %rdx, %rcx
movupd 0x88(%rcx,%rax), %xmm0
subpd 0x90(%rsp), %xmm0
movupd %xmm0, 0xb0(%rsp,%rax)
movsd 0x98(%rcx,%rax), %xmm1
subsd 0xa0(%rsp), %xmm1
movsd %xmm1, 0x8(%rsp)
movsd %xmm1, 0xc0(%rsp,%rax)
movapd %xmm0, 0x50(%rsp)
unpckhpd %xmm0, %xmm0            # xmm0 = xmm0[1,1]
movapd %xmm0, 0x80(%rsp)
xorl %ebp, %ebp
movsd (%r12,%rbp,8), %xmm0
movsd %xmm0, 0x40(%rsp)
addsd 0xe796(%rip), %xmm0     # 0x1f280
callq 0x4550
movsd 0x40(%rsp), %xmm3
movapd %xmm3, %xmm1
subsd %xmm0, %xmm1
andpd 0xe7eb(%rip), %xmm1     # 0x1f2f0
movsd 0xe9eb(%rip), %xmm2     # 0x1f4f8
ucomisd %xmm1, %xmm2
jb 0x10b44
ucomisd %xmm0, %xmm3
jne 0x10b1b
jnp 0x10b44
movq 0x18(%rsp), %rax
movl (%rax), %esi
movl 0x4(%rax), %edx
movq %r15, %rdi
movapd 0x50(%rsp), %xmm0
movapd 0x80(%rsp), %xmm1
movsd 0x8(%rsp), %xmm2
movb $0x3, %al
callq 0xa4d6
incq %rbp
cmpq $0x3, %rbp
jne 0x10ad6
incq %rbx
addq $0x18, %r12
cmpq $0x3, %rbx
jne 0x10a6a
movsd 0xb8(%rsp), %xmm3
movsd 0xc8(%rsp), %xmm0
movapd 0xe0(%rsp), %xmm5
movupd 0xe8(%rsp), %xmm4
movsd 0xf0(%rsp), %xmm6
movapd 0xd0(%rsp), %xmm1
subsd %xmm1, %xmm3
movhpd 0xb0(%rsp), %xmm5       # xmm5 = xmm5[0],mem[0]
movapd %xmm0, %xmm2
unpcklpd %xmm0, %xmm2            # xmm2 = xmm2[0],xmm0[0]
subpd %xmm2, %xmm5
movhpd 0xc0(%rsp), %xmm4       # xmm4 = xmm4[0],mem[0]
subpd %xmm1, %xmm4
movapd %xmm4, %xmm7
unpckhpd %xmm4, %xmm7            # xmm7 = xmm7[1],xmm4[1]
mulsd %xmm4, %xmm7
shufpd $0x1, %xmm4, %xmm4      # xmm4 = xmm4[1,0]
movapd %xmm1, %xmm2
unpckhpd %xmm1, %xmm2            # xmm2 = xmm2[1],xmm1[1]
subsd %xmm2, %xmm6
movapd %xmm5, %xmm8
shufpd $0x1, %xmm3, %xmm8      # xmm8 = xmm8[1],xmm3[0]
mulsd %xmm6, %xmm3
subsd %xmm7, %xmm3
unpcklpd %xmm5, %xmm6            # xmm6 = xmm6[0],xmm5[0]
mulpd %xmm8, %xmm6
mulpd %xmm5, %xmm4
subpd %xmm6, %xmm4
movapd %xmm4, %xmm5
mulsd %xmm4, %xmm5
movapd %xmm3, %xmm6
mulsd %xmm3, %xmm6
addsd %xmm5, %xmm6
movapd %xmm4, %xmm5
unpckhpd %xmm4, %xmm5            # xmm5 = xmm5[1],xmm4[1]
mulsd %xmm5, %xmm5
addsd %xmm6, %xmm5
sqrtsd %xmm5, %xmm5
movsd 0xb4ec(%rip), %xmm8     # 0x1c118
ucomisd %xmm5, %xmm8
jbe 0x10c43
movb $0x1, %r11b
movq %r14, %r12
movq 0x18(%rsp), %rbx
jmp 0x10e41
divsd %xmm5, %xmm3
unpcklpd %xmm5, %xmm5            # xmm5 = xmm5[0,0]
divpd %xmm5, %xmm4
movupd %xmm4, 0x28(%rsp)
movsd %xmm3, 0x20(%rsp)
xorl %eax, %eax
movq %r14, %r12
movq 0x18(%rsp), %rbx
movapd 0xe683(%rip), %xmm7     # 0x1f2f0
movsd 0x20(%rsp,%rax,8), %xmm5
andpd %xmm7, %xmm5
ucomisd %xmm5, %xmm8
jbe 0x10d07
movq $0x0, 0x20(%rsp,%rax,8)
movsd 0x20(%rsp), %xmm4
movupd 0x28(%rsp), %xmm5
movapd %xmm5, %xmm3
mulsd %xmm5, %xmm3
movapd %xmm4, %xmm6
mulsd %xmm4, %xmm6
addsd %xmm3, %xmm6
movapd %xmm5, %xmm3
unpckhpd %xmm5, %xmm3            # xmm3 = xmm3[1],xmm5[1]
mulsd %xmm3, %xmm3
addsd %xmm6, %xmm3
xorps %xmm6, %xmm6
sqrtsd %xmm3, %xmm6
xorl %ecx, %ecx
ucomisd %xmm6, %xmm8
seta %dl
xorpd %xmm3, %xmm3
ja 0x10cda
divsd %xmm6, %xmm4
movapd %xmm4, %xmm3
unpcklpd %xmm6, %xmm6            # xmm6 = xmm6[0,0]
divpd %xmm6, %xmm5
movb %dl, %cl
movd %ecx, %xmm4
pshufd $0x0, %xmm4, %xmm4      # xmm4 = xmm4[0,0,0,0]
pslld $0x1f, %xmm4
psrad $0x1f, %xmm4
pandn %xmm5, %xmm4
movdqu %xmm4, 0x28(%rsp)
movsd %xmm3, 0x20(%rsp)
incq %rax
cmpq $0x3, %rax
jne 0x10c6d
movapd 0xe5d4(%rip), %xmm6     # 0x1f2f0
andpd %xmm6, %xmm3
movapd %xmm4, %xmm5
andpd %xmm6, %xmm5
unpckhpd %xmm4, %xmm4            # xmm4 = xmm4[1,1]
andpd %xmm6, %xmm4
ucomisd 0xe7c8(%rip), %xmm3     # 0x1f500
movq 0x60(%rsp), %r11
jbe 0x10d60
movsd 0xe7a9(%rip), %xmm6     # 0x1f4f0
ucomisd %xmm5, %xmm6
jbe 0x10d60
movsd 0xe79b(%rip), %xmm6     # 0x1f4f0
ucomisd %xmm4, %xmm6
leaq 0x20(%rsp), %rax
ja 0x10db6
movsd 0xe788(%rip), %xmm6     # 0x1f4f0
ucomisd %xmm3, %xmm6
jbe 0x10d8b
ucomisd 0xe78a(%rip), %xmm5     # 0x1f500
jbe 0x10d8b
movsd 0xe770(%rip), %xmm6     # 0x1f4f0
ucomisd %xmm4, %xmm6
leaq 0x28(%rsp), %rax
ja 0x10db6
movsd 0xe75d(%rip), %xmm6     # 0x1f4f0
ucomisd %xmm3, %xmm6
jbe 0x10dea
ucomisd 0xe75f(%rip), %xmm4     # 0x1f500
jbe 0x10dea
movsd 0xe745(%rip), %xmm3     # 0x1f4f0
ucomisd %xmm5, %xmm3
leaq 0x30(%rsp), %rax
jbe 0x10dea
movsd (%rax), %xmm3
xorl %ecx, %ecx
ucomisd 0xe774(%rip), %xmm3     # 0x1f538
seta %cl
leaq 0xe6c2(%rip), %rdx      # 0x1f490
movsd (%rdx,%rcx,8), %xmm3
xorpd %xmm4, %xmm4
movapd %xmm4, 0x20(%rsp)
movq $0x0, 0x30(%rsp)
movsd %xmm3, (%rax)
cmpl $0xff, %r12d
jle 0x10df8
movb $0x1, %r11b
jmp 0x10e41
movslq %r12d, %rax
shlq $0x6, %rax
movapd 0x20(%rsp), %xmm3
movapd %xmm3, 0x900(%rsp,%rax)
movsd 0x30(%rsp), %xmm4
movsd %xmm4, 0x910(%rsp,%rax)
mulsd %xmm3, %xmm0
unpckhpd %xmm3, %xmm3            # xmm3 = xmm3[1,1]
mulsd %xmm3, %xmm1
addsd %xmm0, %xmm1
mulsd %xmm4, %xmm2
addsd %xmm1, %xmm2
movsd %xmm2, 0x930(%rsp,%rax)
incl %r12d
movl %r13d, %ecx
incl %ecx
cmpl 0x14(%rbx), %ecx
jl 0x10a3f
testl %r12d, %r12d
setg %al
jle 0x11550
movl %eax, 0x4(%rsp)
movq %r12, 0x10(%rsp)
movl %r12d, %ecx
leaq 0xcf92(%rip), %rax      # 0x1de00
movaps (%rax), %xmm0
movaps %xmm0, 0x40(%rsp)
movsd 0x10(%rax), %xmm0
movsd %xmm0, 0x8(%rsp)
xorl %ebx, %ebx
leaq 0x900(%rsp), %rbp
movq %rcx, 0x50(%rsp)
movq %r11, %r14
movl $0x20, %edi
callq 0x4300
movq %rax, %r12
movq %rbx, %rax
shlq $0x6, %rax
leaq (%rsp,%rax), %rsi
addq $0x900, %rsi            # imm = 0x900
movsd 0x30(%rsi), %xmm0
movq %r12, %rdi
callq 0xc786
movq %r12, 0x100(%rsp,%rbx,8)
movq %rbp, %r15
xorl %edx, %edx
movapd 0xe41b(%rip), %xmm12    # 0x1f2f0
movq %r14, %r11
movq 0x50(%rsp), %rcx
cmpq %rdx, %rbx
je 0x10f4c
movapd 0x40(%rsp), %xmm0
subpd (%r15), %xmm0
movsd 0x8(%rsp), %xmm1
subsd 0x10(%r15), %xmm1
movapd %xmm0, 0xb0(%rsp)
movsd %xmm1, 0xc0(%rsp)
movsd 0x30(%r15), %xmm0
xorpd 0xe3c7(%rip), %xmm0     # 0x1f2e0
movq %r12, %rdi
movq %rdx, %r13
leaq 0xb0(%rsp), %rsi
movsd 0xe5c9(%rip), %xmm1     # 0x1f4f8
callq 0xd058
movq %r13, %rdx
movq 0x50(%rsp), %rcx
movq %r14, %r11
movapd 0xe3a8(%rip), %xmm12    # 0x1f2f0
testb %al, %al
je 0x10f5c
incq %rdx
addq $0x40, %r15
cmpq %rdx, %rcx
jne 0x10edd
movl %ecx, %edx
jmp 0x10f5f
movb $0x1, %r11b
incq %rbx
cmpq %rcx, %rbx
jne 0x10e90
movq 0x10(%rsp), %r12
testl %r12d, %r12d
jle 0x11550
movq %rdx, 0x40(%rsp)
xorl %ecx, %ecx
movsd 0xe5c8(%rip), %xmm1     # 0x1f550
movsd 0xe590(%rip), %xmm0     # 0x1f520
xorl %eax, %eax
xorl %r10d, %r10d
movsd 0xb17a(%rip), %xmm13    # 0x1c118
movq 0x100(%rsp,%rax,8), %rbx
movl 0x8(%rbx), %r14d
testq %r14, %r14
movq %rax, 0x68(%rsp)
je 0x1139c
shlq $0x6, %rax
addq %rsp, %rax
addq $0x900, %rax            # imm = 0x900
movq %rax, 0x38(%rsp)
xorl %esi, %esi
movq %rbx, 0x78(%rsp)
movq %r14, 0x70(%rsp)
cmpl $0x100, %r10d           # imm = 0x100
jl 0x10fed
incq %rsi
movb $0x1, %r11b
movq %rsi, %r15
jmp 0x11390
movslq %r10d, %rax
leaq (%rax,%rax,8), %rdx
shlq $0x4, %rdx
movq 0x10(%rbx), %rdi
leaq 0x1(%rsi), %r15
cmpq %r14, %r15
movl %r15d, %r8d
movl $0x0, %r9d
cmovneq %r8, %r9
leaq (%r9,%r9,2), %r8
movsd 0x10(%rdi,%r8,8), %xmm4
movsd %xmm4, 0x6158(%rsp,%rdx)
leaq (%rsi,%rsi,2), %rsi
movsd 0x10(%rdi,%rsi,8), %xmm2
movsd %xmm2, 0x6170(%rsp,%rdx)
movsd %xmm4, 0x6140(%rsp,%rdx)
movupd (%rdi,%r8,8), %xmm5
movupd %xmm5, 0x6148(%rsp,%rdx)
movupd (%rdi,%rsi,8), %xmm3
movapd %xmm3, 0x6160(%rsp,%rdx)
movapd %xmm5, 0x6130(%rsp,%rdx)
movapd %xmm3, %xmm6
subpd %xmm5, %xmm6
movupd %xmm6, 0x6178(%rsp,%rdx)
movapd %xmm2, %xmm7
subsd %xmm4, %xmm7
movsd %xmm7, 0x6188(%rsp,%rdx)
movapd %xmm6, %xmm8
mulpd %xmm6, %xmm8
unpckhpd %xmm8, %xmm8            # xmm8 = xmm8[1,1]
mulsd %xmm6, %xmm6
addsd %xmm8, %xmm6
mulsd %xmm7, %xmm7
addsd %xmm6, %xmm7
xorps %xmm6, %xmm6
sqrtsd %xmm7, %xmm6
ucomisd %xmm6, %xmm1
jbe 0x110bd
movb $0x1, %r11b
jmp 0x11390
movq %r15, 0x80(%rsp)
movl %r10d, 0x8(%rsp)
movq %r11, 0x60(%rsp)
leaq (%rsp,%rdx), %r11
addq $0x6100, %r11           # imm = 0x6100
movq 0x38(%rsp), %rdx
movapd (%rdx), %xmm7
movapd %xmm7, (%r11)
movsd 0x10(%rdx), %xmm6
movsd %xmm6, 0x10(%r11)
shlq $0x4, %rax
leaq (%rax,%rax,8), %r15
leaq 0x6168(%rsp), %rax
addq %r15, %rax
leaq 0x6150(%rsp), %rdx
addq %rdx, %r15
xorl %ebx, %ebx
xorl %edx, %edx
movq 0x100(%rsp,%rbx,8), %rdi
movl 0x8(%rdi), %esi
testl %esi, %esi
je 0x1121c
movq 0x10(%rdi), %rdi
movq %rbx, %r8
shlq $0x6, %r8
leaq (%rsp,%r8), %r9
addq $0x900, %r9             # imm = 0x900
leaq 0x8(%rdi), %r12
xorl %r8d, %r8d
movl %r8d, %r10d
leal 0x1(%r10), %r8d
cmpl %esi, %r8d
movl %r8d, %r14d
cmovel %ecx, %r14d
leaq (%r14,%r14,2), %r14
movsd (%rdi,%r14,8), %xmm8
subsd %xmm3, %xmm8
andpd %xmm12, %xmm8
ucomisd %xmm0, %xmm8
ja 0x11213
movslq %r10d, %r10
leaq (%r10,%r10,2), %r13
leaq (%r12,%r13,8), %r10
leaq (%r12,%r14,8), %r14
xorl %ebp, %ebp
cmpq $0x2, %rbp
je 0x111b0
movsd (%r14,%rbp,8), %xmm8
subsd (%rax,%rbp,8), %xmm8
andpd %xmm12, %xmm8
incq %rbp
ucomisd %xmm0, %xmm8
jbe 0x11186
decq %rbp
cmpq $0x2, %rbp
jb 0x11213
movsd (%rdi,%r13,8), %xmm8
subsd %xmm5, %xmm8
andpd %xmm12, %xmm8
ucomisd %xmm0, %xmm8
ja 0x11213
xorl %r13d, %r13d
cmpq $0x2, %r13
je 0x111f4
movsd (%r10,%r13,8), %xmm8
subsd (%r15,%r13,8), %xmm8
andpd %xmm12, %xmm8
incq %r13
ucomisd %xmm0, %xmm8
jbe 0x111ca
decq %r13
cmpq $0x2, %r13
jb 0x11213
incl %edx
movaps (%r9), %xmm8
movups %xmm8, 0x18(%r11)
movsd 0x10(%r9), %xmm8
movsd %xmm8, 0x28(%r11)
movl %ebx, %r10d
movq %r10, 0x40(%rsp)
cmpl %esi, %r8d
jne 0x11145
incq %rbx
cmpq 0x50(%rsp), %rbx
jne 0x11115
cmpl $0x1, %edx
jne 0x11371
movapd %xmm7, %xmm10
unpckhpd %xmm7, %xmm10           # xmm10 = xmm10[1],xmm7[1]
movapd %xmm5, %xmm9
unpckhpd %xmm5, %xmm9            # xmm9 = xmm9[1],xmm5[1]
movapd %xmm9, %xmm8
mulsd %xmm10, %xmm8
movapd %xmm5, %xmm11
mulsd %xmm7, %xmm11
addsd %xmm8, %xmm11
movapd %xmm4, %xmm8
mulsd %xmm6, %xmm8
addsd %xmm11, %xmm8
movq 0x38(%rsp), %rax
movsd 0x30(%rax), %xmm11
subsd %xmm11, %xmm8
andpd %xmm12, %xmm8
ucomisd %xmm13, %xmm8
movq 0x10(%rsp), %r12
movl 0x8(%rsp), %r10d
movq 0x78(%rsp), %rbx
movq 0x70(%rsp), %r14
movq 0x80(%rsp), %r15
ja 0x110b5
movapd %xmm3, %xmm8
unpckhpd %xmm3, %xmm8            # xmm8 = xmm8[1],xmm3[1]
mulsd %xmm8, %xmm10
mulsd %xmm3, %xmm7
addsd %xmm10, %xmm7
mulsd %xmm2, %xmm6
addsd %xmm7, %xmm6
subsd %xmm11, %xmm6
andpd %xmm12, %xmm6
ucomisd %xmm13, %xmm6
ja 0x110b5
movsd 0x18(%r11), %xmm6
movsd 0x20(%r11), %xmm7
mulsd %xmm7, %xmm9
mulsd %xmm6, %xmm5
addsd %xmm9, %xmm5
movsd 0x28(%r11), %xmm9
mulsd %xmm9, %xmm4
addsd %xmm5, %xmm4
movslq 0x40(%rsp), %rax
movq %rax, %rdx
shlq $0x6, %rdx
movsd 0x930(%rsp,%rdx), %xmm5
subsd %xmm5, %xmm4
andpd %xmm12, %xmm4
ucomisd %xmm13, %xmm4
ja 0x110b5
mulsd %xmm7, %xmm8
mulsd %xmm6, %xmm3
addsd %xmm8, %xmm3
mulsd %xmm9, %xmm2
addsd %xmm3, %xmm2
subsd %xmm5, %xmm2
andpd %xmm12, %xmm2
ucomisd %xmm13, %xmm2
ja 0x110b5
xorl %edx, %edx
cmpq %rax, 0x68(%rsp)
setl %dl
addl %edx, %r10d
movq 0x60(%rsp), %r11
jmp 0x11390
movb $0x1, %r11b
movq 0x10(%rsp), %r12
movl 0x8(%rsp), %r10d
movq 0x78(%rsp), %rbx
movq 0x70(%rsp), %r14
movq 0x80(%rsp), %r15
movq %r15, %rsi
cmpq %r14, %r15
jne 0x10fd6
movq 0x68(%rsp), %rax
incq %rax
movq 0x50(%rsp), %rdx
cmpq %rdx, %rax
jne 0x10f9e
testl %r12d, %r12d
jle 0x1158f
movl %r10d, %ebp
leaq 0x4908(%rsp), %rax
movq %rdx, %rcx
shlq $0x6, %rcx
xorl %edx, %edx
movsd 0xad41(%rip), %xmm1     # 0x1c118
movsd 0xe119(%rip), %xmm2     # 0x1f4f8
xorl %ebx, %ebx
movq 0x100(%rsp,%rdx,8), %rdi
movl 0x8(%rdi), %esi
testq %rsi, %rsi
je 0x1153d
movq 0x10(%rdi), %rdi
xorl %r8d, %r8d
leaq (%r8,%r8,2), %r9
movupd (%rdi,%r9,8), %xmm3
movapd %xmm3, 0xb0(%rsp)
movsd 0x10(%rdi,%r9,8), %xmm4
movsd %xmm4, 0xc0(%rsp)
testl %ebx, %ebx
jle 0x114a0
movq %r11, %r13
movl %ebx, %r9d
movq %rax, %r10
xorl %r11d, %r11d
leaq (%r11,%r11,2), %r14
movsd 0x4900(%rsp,%r14,8), %xmm5
subsd %xmm3, %xmm5
andpd %xmm12, %xmm5
ucomisd %xmm0, %xmm5
ja 0x11481
xorl %r15d, %r15d
movq %r15, %r14
cmpq $0x2, %r15
je 0x11477
movsd (%r10,%r14,8), %xmm5
subsd 0xb8(%rsp,%r14,8), %xmm5
andpd %xmm12, %xmm5
leaq 0x1(%r14), %r15
ucomisd %xmm0, %xmm5
jbe 0x1144f
cmpq $0x1, %r14
ja 0x1152e
incq %r11
addq $0x18, %r10
cmpq %r9, %r11
jne 0x1142f
cmpl $0x100, %ebx            # imm = 0x100
movq %r13, %r11
jle 0x114a0
movb $0x1, %r11b
jmp 0x11531
movslq %ebx, %r9
leaq (%r9,%r9,2), %r9
movupd %xmm3, 0x4900(%rsp,%r9,8)
movsd %xmm4, 0x4910(%rsp,%r9,8)
incl %ebx
movapd %xmm3, %xmm5
unpckhpd %xmm3, %xmm5            # xmm5 = xmm5[1],xmm3[1]
xorl %r9d, %r9d
movsd 0x908(%rsp,%r9), %xmm6
mulsd %xmm5, %xmm6
movsd 0x900(%rsp,%r9), %xmm7
mulsd %xmm3, %xmm7
addsd %xmm6, %xmm7
movsd 0x910(%rsp,%r9), %xmm6
mulsd %xmm4, %xmm6
addsd %xmm7, %xmm6
subsd 0x930(%rsp,%r9), %xmm6
andpd %xmm12, %xmm6
movapd %xmm1, %xmm7
cmpltpd %xmm6, %xmm7
cmpltpd %xmm2, %xmm6
andpd %xmm7, %xmm6
movd %xmm6, %r10d
orb %r10b, %r11b
addq $0x40, %r9
cmpq %r9, %rcx
jne 0x114c8
jmp 0x11531
movq %r13, %r11
incq %r8
cmpq %rsi, %r8
jne 0x113fc
incq %rdx
cmpq 0x50(%rsp), %rdx
jne 0x113e1
movl %ebp, %r10d
jmp 0x11599
xorl %ebx, %ebx
movl $0x0, %ebp
movl $0x0, %r10d
testb $0x1, %r11b
je 0x115d1
movq 0x18(%rsp), %rax
movl (%rax), %esi
movl 0x4(%rax), %edx
leaq 0xe4ae(%rip), %rdi      # 0x1fa22
xorl %r14d, %r14d
xorl %eax, %eax
callq 0xa164
jmp 0x1182b
xorl %ebx, %ebx
xorl %r12d, %r12d
xorl %ebp, %ebp
xorl %r10d, %r10d
jmp 0x115d1
movl $0x0, 0x4(%rsp)
xorl %ebx, %ebx
testb $0x1, %r11b
je 0x115cd
movq 0x18(%rsp), %rax
movl (%rax), %esi
movl 0x4(%rax), %edx
leaq 0xe472(%rip), %rdi      # 0x1fa22
xorl %r14d, %r14d
xorl %eax, %eax
callq 0xa164
cmpb $0x0, 0x4(%rsp)
movq %r12, %rbx
jne 0x11805
jmp 0x1182b
movl 0x4(%rsp), %ebp
movl %r10d, 0x8(%rsp)
movl $0x30, %edi
callq 0x4420
movq %rax, %r14
xorl %edi, %edi
testq %rax, %rax
setne %dil
movl $0x1, %esi
callq 0xa91d
movl %r12d, (%r14)
movq %r12, 0x10(%rsp)
movslq %r12d, %rdi
shlq $0x6, %rdi
callq 0x4420
movq %rax, %r15
movq %r14, 0x40(%rsp)
movq %rax, 0x8(%r14)
xorl %edi, %edi
testq %rax, %rax
setne %dil
movl $0x1, %esi
callq 0xa91d
movl %ebp, 0x4(%rsp)
testb %bpl, %bpl
je 0x1172b
movl 0x10(%rsp), %r12d
xorl %r13d, %r13d
movq %r13, %rbp
shlq $0x6, %rbp
movaps 0x900(%rsp,%rbp), %xmm0
movups %xmm0, (%r15,%rbp)
movsd 0x910(%rsp,%rbp), %xmm0
movsd %xmm0, 0x10(%r15,%rbp)
movq 0x100(%rsp,%r13,8), %r14
movq 0x10(%r14), %rax
movsd (%rax), %xmm0
movsd %xmm0, 0x18(%r15,%rbp)
movq 0x10(%r14), %rax
movsd 0x8(%rax), %xmm0
movsd %xmm0, 0x20(%r15,%rbp)
movq 0x10(%r14), %rax
movsd 0x10(%rax), %xmm0
movsd %xmm0, 0x28(%r15,%rbp)
movslq 0x8(%r14), %rax
movl %eax, 0x30(%r15,%rbp)
shlq $0x3, %rax
leaq (%rax,%rax,2), %rdi
callq 0x4420
movq %rax, 0x38(%r15,%rbp)
xorl %edi, %edi
testq %rax, %rax
setne %dil
movl $0x1, %esi
callq 0xa91d
cmpl $0x0, 0x8(%r14)
je 0x1171f
addq %r15, %rbp
xorl %eax, %eax
xorl %ecx, %ecx
movq 0x10(%r14), %rdx
movsd (%rdx,%rax), %xmm0
movq 0x38(%rbp), %rdx
movsd %xmm0, (%rdx,%rax)
movq 0x10(%r14), %rdx
movsd 0x8(%rdx,%rax), %xmm0
movq 0x38(%rbp), %rdx
movsd %xmm0, 0x8(%rdx,%rax)
movq 0x10(%r14), %rdx
movsd 0x10(%rdx,%rax), %xmm0
movq 0x38(%rbp), %rdx
movsd %xmm0, 0x10(%rdx,%rax)
incq %rcx
movl 0x8(%r14), %edx
addq $0x18, %rax
cmpq %rdx, %rcx
jb 0x116d5
incq %r13
cmpq %r12, %r13
jne 0x1163e
movl 0x8(%rsp), %eax
movq 0x40(%rsp), %r14
movl %eax, 0x10(%r14)
movslq %eax, %r15
movq %r15, %rax
shlq $0x4, %rax
leaq (%rax,%rax,8), %r12
movq %r12, %rdi
callq 0x4420
movq %rax, %r13
movq %rax, 0x18(%r14)
xorl %edi, %edi
testq %rax, %rax
setne %dil
movl $0x1, %esi
callq 0xa91d
leaq 0x6100(%rsp), %rsi
movq %r13, %rdi
movq %r12, %rdx
callq 0x4260
movl %ebx, 0x20(%r14)
movslq %ebx, %r12
leaq (,%r12,8), %rax
leaq (%rax,%rax,2), %r13
movq %r13, %rdi
callq 0x4420
movq %rax, %rbp
movq %rax, 0x28(%r14)
xorl %edi, %edi
testq %rax, %rax
setne %dil
movl $0x1, %esi
callq 0xa91d
leaq 0x4900(%rsp), %rsi
movq %rbp, %rdi
movq %r13, %rdx
callq 0x4260
movsd 0x90(%rsp), %xmm0
movsd 0x98(%rsp), %xmm1
movsd 0xa0(%rsp), %xmm2
leaq 0xe1f8(%rip), %rsi      # 0x1f9dd
movl $0x3, %edi
movq 0x10(%rsp), %rbx
movl %ebx, %edx
movl %r15d, %ecx
movl %r12d, %r8d
movb $0x3, %al
callq 0xa676
cmpb $0x0, 0x4(%rsp)
je 0x1182b
movq %r14, %r15
movl %ebx, %ebx
xorl %r14d, %r14d
movq 0x100(%rsp,%r14,8), %rdi
testq %rdi, %rdi
je 0x11820
movq (%rdi), %rax
callq *0x8(%rax)
incq %r14
cmpq %r14, %rbx
jne 0x1180d
movq %r15, %r14
movq %r14, %rax
addq $0xf108, %rsp           # imm = 0xF108
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movl $0x20, %esi
movq %r12, %rdi
callq 0x4310
movq %rbx, %rdi
callq 0x4560