// File: /workspace/github_cpp_makefile_star2_O1/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 $0xf128, %rsp           # imm = 0xF128
movq %rdi, %r14
movslq 0x8(%rdi), %rax
leaq (%rax,%rax,4), %rdi
shlq $0x3, %rdi
addq 0x17124(%rip), %rdi     # 0x27fd8
leaq 0x10c3d(%rip), %rsi     # 0x21af8
leaq 0xb0(%rsp), %rdx
callq 0x83c8
cmpl $0x0, 0x14(%r14)
movq %r14, 0x58(%rsp)
jle 0x11389
xorl %esi, %esi
xorl %ebp, %ebp
xorl %r11d, %r11d
movq %rsi, 0x38(%rsp)
movl %r11d, %r12d
movslq 0x10(%r14), %rax
movl %ebp, %ebx
movslq %ebp, %rcx
addq %rax, %rcx
imulq $0xd0, %rcx, %rax
movq %rax, 0x20(%rsp)
leaq 0xd0(%rsp), %rbp
xorl %r13d, %r13d
leaq 0x3abc6df(%rip), %rax   # 0x3acd5f0
movq 0x20(%rsp), %rcx
addq %rcx, %rax
leaq (,%r13,8), %rcx
leaq (%rcx,%rcx,2), %rcx
leaq 0xd0(%rsp,%rcx), %r15
movupd 0x88(%rax,%rcx), %xmm0
subpd 0xb0(%rsp), %xmm0
movupd %xmm0, (%r15)
movsd 0x98(%rax,%rcx), %xmm0
subsd 0xc0(%rsp), %xmm0
movsd %xmm0, 0x60(%rsp)
movsd %xmm0, 0x10(%r15)
xorl %r14d, %r14d
movsd (%rbp,%r14,8), %xmm0
movsd %xmm0, 0x40(%rsp)
addsd 0xe316(%rip), %xmm0     # 0x1f290
callq 0x4560
movsd 0x40(%rsp), %xmm3
movapd %xmm3, %xmm1
subsd %xmm0, %xmm1
andpd 0xe37b(%rip), %xmm1     # 0x1f310
movsd 0xe57b(%rip), %xmm2     # 0x1f518
ucomisd %xmm1, %xmm2
jb 0x10fd4
ucomisd %xmm0, %xmm3
jne 0x10fab
jnp 0x10fd4
movq 0x58(%rsp), %rax
movl (%rax), %esi
movl 0x4(%rax), %edx
movsd (%r15), %xmm0
movsd 0x8(%r15), %xmm1
leaq 0xe9c4(%rip), %rdi      # 0x1f98b
movsd 0x60(%rsp), %xmm2
movb $0x3, %al
callq 0xa612
incq %r14
cmpq $0x3, %r14
jne 0x10f65
incq %r13
addq $0x18, %rbp
cmpq $0x3, %r13
jne 0x10f0a
movsd 0xd0(%rsp), %xmm5
movsd 0xe8(%rsp), %xmm4
subsd %xmm4, %xmm5
movsd 0x108(%rsp), %xmm0
movupd 0xd8(%rsp), %xmm1
movapd 0xf0(%rsp), %xmm3
subpd %xmm3, %xmm1
movsd 0x110(%rsp), %xmm2
movhpd 0x100(%rsp), %xmm2      # xmm2 = xmm2[0],mem[0]
subsd %xmm3, %xmm0
movapd %xmm3, 0x20(%rsp)
movapd %xmm4, 0x80(%rsp)
shufpd $0x1, %xmm4, %xmm3      # xmm3 = xmm3[1],xmm4[0]
subpd %xmm3, %xmm2
movapd %xmm1, %xmm3
shufpd $0x1, %xmm5, %xmm3      # xmm3 = xmm3[1],xmm5[0]
mulsd %xmm0, %xmm5
unpcklpd %xmm2, %xmm0            # xmm0 = xmm0[0],xmm2[0]
mulpd %xmm3, %xmm0
movapd %xmm1, %xmm3
mulpd %xmm2, %xmm3
subpd %xmm0, %xmm3
movapd %xmm3, (%rsp)
unpckhpd %xmm2, %xmm2            # xmm2 = xmm2[1,1]
mulsd %xmm1, %xmm2
subsd %xmm2, %xmm5
movsd %xmm5, 0x10(%rsp)
movapd %xmm3, %xmm0
mulpd %xmm3, %xmm0
unpckhpd %xmm0, %xmm0            # xmm0 = xmm0[1,1]
movapd %xmm3, %xmm1
mulsd %xmm3, %xmm1
addsd %xmm0, %xmm1
movapd %xmm5, %xmm0
mulsd %xmm5, %xmm0
addsd %xmm1, %xmm0
ucomisd 0xe1fb(%rip), %xmm0     # 0x1f2b0
jb 0x110bd
sqrtsd %xmm0, %xmm0
jmp 0x110da
movapd %xmm5, 0x40(%rsp)
movapd %xmm3, 0x60(%rsp)
callq 0x4260
movapd 0x60(%rsp), %xmm3
movapd 0x40(%rsp), %xmm5
movsd 0xb02e(%rip), %xmm2     # 0x1c110
movl %ebx, %ebp
ucomisd %xmm0, %xmm2
ja 0x11107
movapd %xmm0, %xmm1
unpcklpd %xmm0, %xmm1            # xmm1 = xmm1[0],xmm0[0]
divpd %xmm1, %xmm3
movapd %xmm3, (%rsp)
divsd %xmm0, %xmm5
movsd %xmm5, 0x10(%rsp)
jmp 0x11119
xorpd %xmm1, %xmm1
movapd %xmm1, (%rsp)
movq $0x0, 0x10(%rsp)
movq 0x58(%rsp), %r14
movl %r12d, %r11d
ucomisd %xmm0, %xmm2
ja 0x11317
xorl %r15d, %r15d
movsd (%rsp,%r15,8), %xmm0
andpd 0xe1d4(%rip), %xmm0     # 0x1f310
ucomisd %xmm0, %xmm2
jbe 0x111e6
movq $0x0, (%rsp,%r15,8)
movapd (%rsp), %xmm3
movapd %xmm3, %xmm0
mulpd %xmm3, %xmm0
unpckhpd %xmm0, %xmm0            # xmm0 = xmm0[1,1]
movapd %xmm3, %xmm1
mulsd %xmm3, %xmm1
addsd %xmm0, %xmm1
movsd 0x10(%rsp), %xmm4
movapd %xmm4, %xmm0
mulsd %xmm4, %xmm0
addsd %xmm1, %xmm0
ucomisd 0xe12b(%rip), %xmm0     # 0x1f2b0
jb 0x1118d
sqrtsd %xmm0, %xmm0
jmp 0x111b5
movapd %xmm3, 0x40(%rsp)
movsd %xmm4, 0x60(%rsp)
callq 0x4260
movsd 0x60(%rsp), %xmm4
movapd 0x40(%rsp), %xmm3
movsd 0xaf5e(%rip), %xmm2     # 0x1c110
movl %r12d, %r11d
ucomisd %xmm0, %xmm2
jbe 0x111cf
xorpd %xmm0, %xmm0
movapd %xmm0, (%rsp)
movq $0x0, 0x10(%rsp)
jmp 0x111e6
divsd %xmm0, %xmm4
unpcklpd %xmm0, %xmm0            # xmm0 = xmm0[0,0]
divpd %xmm0, %xmm3
movapd %xmm3, (%rsp)
movsd %xmm4, 0x10(%rsp)
incq %r15
cmpq $0x3, %r15
jne 0x1112e
movsd (%rsp), %xmm0
movsd 0x8(%rsp), %xmm2
movsd 0x10(%rsp), %xmm1
movapd 0xe104(%rip), %xmm3     # 0x1f310
andpd %xmm3, %xmm0
andpd %xmm3, %xmm2
andpd %xmm3, %xmm1
ucomisd 0xe300(%rip), %xmm0     # 0x1f520
movq 0x38(%rsp), %rsi
jbe 0x11249
movsd 0xe2e1(%rip), %xmm3     # 0x1f510
ucomisd %xmm2, %xmm3
jbe 0x11249
xorl %eax, %eax
movsd 0xe2d1(%rip), %xmm3     # 0x1f510
ucomisd %xmm1, %xmm3
ja 0x112c9
movsd 0xe2bf(%rip), %xmm3     # 0x1f510
ucomisd %xmm0, %xmm3
jbe 0x11274
ucomisd 0xe2c1(%rip), %xmm2     # 0x1f520
jbe 0x11274
movl $0x1, %eax
movsd 0xe2a2(%rip), %xmm3     # 0x1f510
ucomisd %xmm1, %xmm3
ja 0x112c9
movsd 0xe294(%rip), %xmm3     # 0x1f510
ucomisd %xmm0, %xmm3
jbe 0x1129f
ucomisd 0xe296(%rip), %xmm1     # 0x1f520
jbe 0x1129f
movl $0x2, %eax
movsd 0xe277(%rip), %xmm3     # 0x1f510
ucomisd %xmm2, %xmm3
ja 0x112c9
ucomisd %xmm2, %xmm0
jb 0x112b0
movl $0x3, %eax
ucomisd %xmm1, %xmm0
jae 0x112c9
cmpnlepd %xmm2, %xmm1
cmpnlepd %xmm2, %xmm0
orpd %xmm1, %xmm0
movd %xmm0, %ecx
movl $0x4, %eax
subl %ecx, %eax
cmpl $0x2, %eax
movq 0x58(%rsp), %r14
ja 0x1130a
movl %eax, %eax
movsd (%rsp,%rax,8), %xmm0
xorl %ecx, %ecx
ucomisd 0xdfcc(%rip), %xmm0     # 0x1f2b0
seta %cl
leaq 0xe1c2(%rip), %rdx      # 0x1f4b0
movsd (%rdx,%rcx,8), %xmm0
xorpd %xmm1, %xmm1
movapd %xmm1, (%rsp)
movq $0x0, 0x10(%rsp)
movsd %xmm0, (%rsp,%rax,8)
cmpl $0xff, %esi
jle 0x11321
movb $0x1, %r11b
jmp 0x1137b
movb $0x1, %r11b
movq 0x38(%rsp), %rsi
jmp 0x1137b
movslq %esi, %rax
shlq $0x6, %rax
movapd (%rsp), %xmm0
movapd %xmm0, 0x920(%rsp,%rax)
movsd 0x10(%rsp), %xmm1
movsd %xmm1, 0x930(%rsp,%rax)
movapd 0x80(%rsp), %xmm3
mulsd %xmm0, %xmm3
unpckhpd %xmm0, %xmm0            # xmm0 = xmm0[1,1]
movapd 0x20(%rsp), %xmm2
mulsd %xmm2, %xmm0
addsd %xmm3, %xmm0
unpckhpd %xmm2, %xmm2            # xmm2 = xmm2[1,1]
mulsd %xmm1, %xmm2
addsd %xmm0, %xmm2
movsd %xmm2, 0x950(%rsp,%rax)
incl %esi
incl %ebp
cmpl 0x14(%r14), %ebp
jl 0x10edf
jmp 0x1138e
xorl %r11d, %r11d
xorl %esi, %esi
movl %esi, %ecx
movq %rsi, 0x38(%rsp)
testl %esi, %esi
movq %rcx, 0x20(%rsp)
jle 0x114a3
leaq 0xca67(%rip), %rax      # 0x1de10
movaps (%rax), %xmm0
movaps %xmm0, 0x40(%rsp)
movsd 0x10(%rax), %xmm0
movsd %xmm0, 0x60(%rsp)
xorl %r14d, %r14d
leaq 0x920(%rsp), %rbp
movl %r11d, %ebx
movl $0x20, %edi
callq 0x4310
movq %rax, %r15
movq %r14, %rax
shlq $0x6, %rax
leaq (%rsp,%rax), %rsi
addq $0x920, %rsi            # imm = 0x920
movsd 0x30(%rsi), %xmm0
movq %r15, %rdi
callq 0xc9a8
movq %r15, 0x120(%rsp,%r14,8)
movq %rbp, %r13
xorl %r12d, %r12d
movl %ebx, %r11d
movq 0x20(%rsp), %rcx
cmpq %r12, %r14
je 0x1147d
movapd 0x40(%rsp), %xmm0
subpd (%r13), %xmm0
movsd 0x60(%rsp), %xmm1
subsd 0x10(%r13), %xmm1
movapd %xmm0, 0xd0(%rsp)
movsd %xmm1, 0xe0(%rsp)
movsd 0x30(%r13), %xmm0
xorpd 0xdeb7(%rip), %xmm0     # 0x1f300
movq %r15, %rdi
leaq 0xd0(%rsp), %rsi
movsd 0xe0bc(%rip), %xmm1     # 0x1f518
movl %r11d, %ebx
callq 0xd26e
movl %ebx, %r11d
movzbl %r11b, %r11d
testb %al, %al
movl $0x1, %eax
cmovel %eax, %r11d
je 0x1148d
movq 0x20(%rsp), %rcx
incq %r12
addq $0x40, %r13
cmpq %r12, %rcx
jne 0x1140c
movl %ecx, %eax
jmp 0x11495
movq 0x20(%rsp), %rcx
movq %r12, %rax
incq %r14
cmpq %rcx, %r14
jne 0x113c7
jmp 0x114a8
movl $0x3, %eax
xorl %r10d, %r10d
cmpl $0x0, 0x38(%rsp)
jle 0x1194f
movq %rax, 0x60(%rsp)
xorl %r15d, %r15d
xorpd %xmm9, %xmm9
movsd 0xe09c(%rip), %xmm10    # 0x1f568
movapd 0xde3b(%rip), %xmm11    # 0x1f310
movsd 0xac32(%rip), %xmm12    # 0x1c110
movsd 0xe059(%rip), %xmm13    # 0x1f540
xorl %esi, %esi
xorl %edx, %edx
movq 0x120(%rsp,%rsi,8), %rdi
movl 0x8(%rdi), %ecx
testl %ecx, %ecx
je 0x1193c
movq %rsi, %rax
shlq $0x6, %rax
addq %rsp, %rax
addq $0x920, %rax            # imm = 0x920
movq %rax, 0x98(%rsp)
xorl %r8d, %r8d
movq %rdi, 0x70(%rsp)
movq %rsi, 0xa8(%rsp)
cmpl $0xff, %edx
jle 0x11536
movb $0x1, %r11b
jmp 0x1192d
movl %edx, 0x80(%rsp)
movslq %edx, %r13
leaq (,%r13,8), %r14
addq %r13, %r14
shlq $0x4, %r14
movq 0x10(%rdi), %rsi
leal 0x1(%r8), %eax
xorl %edx, %edx
divl %ecx
leaq (%rdx,%rdx,2), %rax
movsd 0x10(%rsi,%rax,8), %xmm1
movsd %xmm1, 0x6178(%rsp,%r14)
leaq (%r8,%r8,2), %rcx
movsd 0x10(%rsi,%rcx,8), %xmm0
movsd %xmm0, 0x6190(%rsp,%r14)
movsd %xmm1, 0x6160(%rsp,%r14)
movupd (%rsi,%rax,8), %xmm2
movupd %xmm2, 0x6168(%rsp,%r14)
movupd (%rsi,%rcx,8), %xmm3
movapd %xmm3, 0x6180(%rsp,%r14)
movapd %xmm2, 0x6150(%rsp,%r14)
subpd %xmm2, %xmm3
movupd %xmm3, 0x6198(%rsp,%r14)
subsd %xmm1, %xmm0
movsd %xmm0, 0x61a8(%rsp,%r14)
movapd %xmm3, %xmm1
mulpd %xmm3, %xmm1
unpckhpd %xmm1, %xmm1            # xmm1 = xmm1[1,1]
mulsd %xmm3, %xmm3
addsd %xmm1, %xmm3
mulsd %xmm0, %xmm0
addsd %xmm3, %xmm0
ucomisd %xmm9, %xmm0
jb 0x115fa
sqrtsd %xmm0, %xmm0
jmp 0x1163c
movl %r11d, %ebx
movq %r8, %r12
callq 0x4260
movq %r12, %r8
movq 0x70(%rsp), %rdi
movsd 0xdf2a(%rip), %xmm13    # 0x1f540
movsd 0xaaf1(%rip), %xmm12    # 0x1c110
movapd 0xdce8(%rip), %xmm11    # 0x1f310
movsd 0xdf37(%rip), %xmm10    # 0x1f568
xorpd %xmm9, %xmm9
xorl %r10d, %r10d
movl %ebx, %r11d
ucomisd %xmm0, %xmm10
jbe 0x1165a
movb $0x1, %r11b
movl 0x80(%rsp), %edx
movq 0xa8(%rsp), %rsi
jmp 0x1192d
movq %r8, 0xa0(%rsp)
movl %r11d, 0x7c(%rsp)
leaq (%rsp,%r14), %rax
addq $0x6120, %rax           # imm = 0x6120
movq 0x98(%rsp), %rcx
movaps (%rcx), %xmm0
movaps %xmm0, (%rax)
movsd 0x10(%rcx), %xmm0
movsd %xmm0, 0x10(%rax)
shlq $0x4, %r13
leaq (,%r13,8), %rcx
addq %r13, %rcx
leaq 0x6188(%rsp), %rdx
addq %rcx, %rdx
leaq 0x6170(%rsp), %rsi
addq %rsi, %rcx
xorl %esi, %esi
movl $0x0, 0x40(%rsp)
movq 0x120(%rsp,%rsi,8), %rdi
movl 0x8(%rdi), %r8d
testl %r8d, %r8d
je 0x117c2
movq 0x10(%rdi), %r9
movq %rsi, %rdi
shlq $0x6, %rdi
leaq (%rsp,%rdi), %r10
addq $0x920, %r10            # imm = 0x920
leaq 0x8(%r9), %r11
xorl %r14d, %r14d
movl %r14d, %ebx
leal 0x1(%rbx), %r14d
cmpl %r8d, %r14d
movl %r14d, %edi
cmovel %r15d, %edi
leaq (%rdi,%rdi,2), %r12
movsd (%r9,%r12,8), %xmm0
subsd 0x60(%rax), %xmm0
andpd %xmm11, %xmm0
ucomisd %xmm13, %xmm0
ja 0x117b9
movslq %ebx, %rdi
leaq (%rdi,%rdi,2), %rbp
leaq (%r11,%rbp,8), %r13
leaq (%r11,%r12,8), %rbx
xorl %edi, %edi
movq %rdi, %r12
cmpq $0x2, %rdi
je 0x11751
movsd (%rbx,%r12,8), %xmm0
subsd (%rdx,%r12,8), %xmm0
andpd %xmm11, %xmm0
leaq 0x1(%r12), %rdi
ucomisd %xmm13, %xmm0
jbe 0x1172b
cmpq $0x2, %r12
jb 0x117b9
movsd (%r9,%rbp,8), %xmm0
subsd 0x48(%rax), %xmm0
andpd %xmm11, %xmm0
ucomisd %xmm13, %xmm0
ja 0x117b9
xorl %edi, %edi
movq %rdi, %rbx
cmpq $0x2, %rdi
je 0x11795
movsd (%r13,%rbx,8), %xmm0
subsd (%rcx,%rbx,8), %xmm0
andpd %xmm11, %xmm0
leaq 0x1(%rbx), %rdi
ucomisd %xmm13, %xmm0
jbe 0x11770
cmpq $0x2, %rbx
jb 0x117b9
incl 0x40(%rsp)
movaps (%r10), %xmm0
movups %xmm0, 0x18(%rax)
movsd 0x10(%r10), %xmm0
movsd %xmm0, 0x28(%rax)
movl %esi, %edi
movq %rdi, 0x60(%rsp)
cmpl %r8d, %r14d
jne 0x116ea
incq %rsi
cmpq 0x20(%rsp), %rsi
jne 0x116b8
cmpl $0x1, 0x40(%rsp)
movl 0x80(%rsp), %edx
movq 0xa8(%rsp), %rsi
jne 0x1191a
movsd 0x48(%rax), %xmm0
movsd (%rax), %xmm6
movsd 0x8(%rax), %xmm3
movsd 0x50(%rax), %xmm4
movapd %xmm4, %xmm1
mulsd %xmm3, %xmm1
movapd %xmm0, %xmm2
mulsd %xmm6, %xmm2
addsd %xmm1, %xmm2
movsd 0x58(%rax), %xmm1
movsd 0x10(%rax), %xmm7
movapd %xmm1, %xmm5
mulsd %xmm7, %xmm5
addsd %xmm2, %xmm5
movq 0x98(%rsp), %rcx
movsd 0x30(%rcx), %xmm8
subsd %xmm8, %xmm5
andpd %xmm11, %xmm5
ucomisd %xmm12, %xmm5
movl $0x0, %r10d
movq 0x70(%rsp), %rdi
movq 0xa0(%rsp), %r8
ja 0x1152e
movsd 0x60(%rax), %xmm2
movsd 0x68(%rax), %xmm5
mulsd %xmm5, %xmm3
mulsd %xmm2, %xmm6
addsd %xmm3, %xmm6
movsd 0x70(%rax), %xmm3
mulsd %xmm3, %xmm7
addsd %xmm6, %xmm7
subsd %xmm8, %xmm7
andpd %xmm11, %xmm7
ucomisd %xmm12, %xmm7
ja 0x1152e
movsd 0x18(%rax), %xmm6
movsd 0x20(%rax), %xmm7
mulsd %xmm7, %xmm4
mulsd %xmm6, %xmm0
addsd %xmm4, %xmm0
movsd 0x28(%rax), %xmm4
mulsd %xmm4, %xmm1
addsd %xmm0, %xmm1
movslq 0x60(%rsp), %rax
movq %rax, %rcx
shlq $0x6, %rcx
movsd 0x950(%rsp,%rcx), %xmm0
subsd %xmm0, %xmm1
andpd %xmm11, %xmm1
ucomisd %xmm12, %xmm1
ja 0x1152e
mulsd %xmm7, %xmm5
mulsd %xmm6, %xmm2
addsd %xmm5, %xmm2
mulsd %xmm4, %xmm3
addsd %xmm2, %xmm3
subsd %xmm0, %xmm3
andpd %xmm11, %xmm3
ucomisd %xmm12, %xmm3
ja 0x1152e
xorl %ecx, %ecx
cmpq %rax, %rsi
setl %cl
addl %ecx, %edx
movl 0x7c(%rsp), %r11d
jmp 0x1192d
movb $0x1, %r11b
xorl %r10d, %r10d
movq 0x70(%rsp), %rdi
movq 0xa0(%rsp), %r8
incq %r8
movl 0x8(%rdi), %ecx
cmpq %rcx, %r8
jb 0x11526
incq %rsi
movq 0x20(%rsp), %rcx
cmpq %rcx, %rsi
jne 0x114eb
jmp 0x11951
xorl %edx, %edx
movl %edx, 0x80(%rsp)
movq 0x38(%rsp), %r15
testl %r15d, %r15d
jle 0x11b1b
leaq 0x4928(%rsp), %rax
shlq $0x6, %rcx
xorl %edx, %edx
movapd 0xd994(%rip), %xmm0     # 0x1f310
movsd 0xdbbc(%rip), %xmm1     # 0x1f540
movsd 0xa784(%rip), %xmm2     # 0x1c110
movsd 0xdb84(%rip), %xmm3     # 0x1f518
xorl %r10d, %r10d
movq 0x120(%rsp,%rdx,8), %rdi
movl 0x8(%rdi), %esi
testq %rsi, %rsi
je 0x11b0d
movq 0x10(%rdi), %rdi
xorl %r8d, %r8d
movl %r11d, %ebp
leaq (%r8,%r8,2), %r9
movupd (%rdi,%r9,8), %xmm4
movapd %xmm4, 0xd0(%rsp)
movsd 0x10(%rdi,%r9,8), %xmm5
movsd %xmm5, 0xe0(%rsp)
movl %r10d, %r12d
testl %r10d, %r10d
jle 0x11a4c
movsd 0xd0(%rsp), %xmm6
movl %r12d, %r9d
movq %rax, %r10
xorl %r11d, %r11d
leaq (%r11,%r11,2), %rbx
movsd 0x4920(%rsp,%rbx,8), %xmm7
subsd %xmm6, %xmm7
andpd %xmm0, %xmm7
ucomisd %xmm1, %xmm7
ja 0x11a40
xorl %r14d, %r14d
movq %r14, %rbx
cmpq $0x2, %r14
je 0x11a36
movsd (%r10,%rbx,8), %xmm7
subsd 0xd8(%rsp,%rbx,8), %xmm7
andpd %xmm0, %xmm7
leaq 0x1(%rbx), %r14
ucomisd %xmm1, %xmm7
jbe 0x11a10
cmpq $0x1, %rbx
ja 0x11afb
incq %r11
addq $0x18, %r10
cmpq %r9, %r11
jne 0x119f2
movl %r12d, %r10d
cmpl $0x100, %r12d           # imm = 0x100
jle 0x11a60
movb $0x1, %r11b
jmp 0x11b01
movl %ebp, %r11d
movslq %r10d, %r9
leaq (%r9,%r9,2), %r9
movupd %xmm4, 0x4920(%rsp,%r9,8)
movsd %xmm5, 0x4930(%rsp,%r9,8)
incl %r10d
movl %r10d, %ebx
movapd %xmm4, %xmm6
unpckhpd %xmm4, %xmm6            # xmm6 = xmm6[1],xmm4[1]
xorl %r9d, %r9d
movsd 0x928(%rsp,%r9), %xmm7
mulsd %xmm6, %xmm7
movsd 0x920(%rsp,%r9), %xmm8
mulsd %xmm4, %xmm8
addsd %xmm7, %xmm8
movsd 0x930(%rsp,%r9), %xmm7
mulsd %xmm5, %xmm7
addsd %xmm8, %xmm7
subsd 0x950(%rsp,%r9), %xmm7
andpd %xmm0, %xmm7
ucomisd %xmm2, %xmm7
movzbl %r11b, %r11d
movl $0x1, %r10d
ja 0x11ae5
movl %r11d, %r10d
ucomisd %xmm7, %xmm3
cmoval %r10d, %r11d
addq $0x40, %r9
cmpq %r9, %rcx
jne 0x11a8f
movl %ebx, %r10d
jmp 0x11b01
movl %ebp, %r11d
movl %r12d, %r10d
incq %r8
cmpq %rsi, %r8
jne 0x119b2
incq %rdx
cmpq 0x20(%rsp), %rdx
jne 0x11997
testb $0x1, %r11b
je 0x11b40
movq 0x58(%rsp), %rax
movl (%rax), %esi
movl 0x4(%rax), %edx
leaq 0xdf00(%rip), %rdi      # 0x1fa32
xorl %ebx, %ebx
xorl %eax, %eax
callq 0xa2a0
jmp 0x11d5d
movl %r10d, 0x40(%rsp)
movl $0x30, %edi
callq 0x4430
movq %rax, %rbx
xorl %edi, %edi
testq %rax, %rax
setne %dil
movl $0x1, %esi
callq 0xaa4d
movl %r15d, (%rbx)
movslq %r15d, %rdi
shlq $0x6, %rdi
callq 0x4430
movq %rax, %r12
movq %rax, 0x8(%rbx)
xorl %edi, %edi
testq %rax, %rax
setne %dil
movl $0x1, %esi
callq 0xaa4d
testl %r15d, %r15d
jle 0x11c8b
xorl %r14d, %r14d
movq %r14, %r15
shlq $0x6, %r15
movaps 0x920(%rsp,%r15), %xmm0
movups %xmm0, (%r12,%r15)
movsd 0x930(%rsp,%r15), %xmm0
movsd %xmm0, 0x10(%r12,%r15)
movq 0x120(%rsp,%r14,8), %r13
movq 0x10(%r13), %rax
movsd (%rax), %xmm0
movsd %xmm0, 0x18(%r12,%r15)
movq 0x10(%r13), %rax
movsd 0x8(%rax), %xmm0
movsd %xmm0, 0x20(%r12,%r15)
movq 0x10(%r13), %rax
movsd 0x10(%rax), %xmm0
movsd %xmm0, 0x28(%r12,%r15)
movslq 0x8(%r13), %rax
movl %eax, 0x30(%r12,%r15)
shlq $0x3, %rax
leaq (%rax,%rax,2), %rdi
callq 0x4430
movq %rax, 0x38(%r12,%r15)
xorl %edi, %edi
testq %rax, %rax
setne %dil
movl $0x1, %esi
callq 0xaa4d
cmpl $0x0, 0x8(%r13)
je 0x11c7d
addq %r12, %r15
xorl %eax, %eax
xorl %ecx, %ecx
movq 0x10(%r13), %rdx
movsd (%rdx,%rax), %xmm0
movq 0x38(%r15), %rdx
movsd %xmm0, (%rdx,%rax)
movq 0x10(%r13), %rdx
movsd 0x8(%rdx,%rax), %xmm0
movq 0x38(%r15), %rdx
movsd %xmm0, 0x8(%rdx,%rax)
movq 0x10(%r13), %rdx
movsd 0x10(%rdx,%rax), %xmm0
movq 0x38(%r15), %rdx
movsd %xmm0, 0x10(%rdx,%rax)
incq %rcx
movl 0x8(%r13), %edx
addq $0x18, %rax
cmpq %rdx, %rcx
jb 0x11c33
incq %r14
cmpq 0x20(%rsp), %r14
jne 0x11b9a
movl 0x80(%rsp), %eax
movl %eax, 0x10(%rbx)
movslq %eax, %rbp
movq %rbp, %rax
shlq $0x4, %rax
leaq (%rax,%rax,8), %r15
movq %r15, %rdi
callq 0x4430
movq %rax, %r12
movq %rax, 0x18(%rbx)
xorl %edi, %edi
testq %rax, %rax
setne %dil
movl $0x1, %esi
callq 0xaa4d
leaq 0x6120(%rsp), %rsi
movq %r12, %rdi
movq %r15, %rdx
callq 0x4270
movl 0x40(%rsp), %eax
movl %eax, 0x20(%rbx)
movslq %eax, %r15
leaq (,%r15,8), %rax
leaq (%rax,%rax,2), %r12
movq %r12, %rdi
callq 0x4430
movq %rax, %r13
movq %rax, 0x28(%rbx)
xorl %edi, %edi
testq %rax, %rax
setne %dil
movl $0x1, %esi
callq 0xaa4d
leaq 0x4920(%rsp), %rsi
movq %r13, %rdi
movq %r12, %rdx
callq 0x4270
movsd 0xb0(%rsp), %xmm0
movsd 0xb8(%rsp), %xmm1
movsd 0xc0(%rsp), %xmm2
movl (%rbx), %edx
leaq 0xdca6(%rip), %rsi      # 0x1f9ed
movl $0x3, %edi
movl %ebp, %ecx
movl %r15d, %r8d
movb $0x3, %al
callq 0xa7b2
movq 0x38(%rsp), %r15
testl %r15d, %r15d
movq 0x20(%rsp), %rax
jle 0x11d8a
xorl %r14d, %r14d
movq 0x120(%rsp,%r14,8), %rdi
testq %rdi, %rdi
je 0x11d82
movq (%rdi), %rax
callq *0x8(%rax)
movq 0x20(%rsp), %rax
incq %r14
cmpq %r14, %rax
jne 0x11d6a
movq %rbx, %rax
addq $0xf128, %rsp           # imm = 0xF128
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movl $0x20, %esi
movq %r15, %rdi
callq 0x4320
movq %rbx, %rdi
callq 0x4570