// File: FreeSlave[P]vhlt/hlbsp/brink.cpp
// Function: SplitTreeLeaf(int&, btreeleaf_s*, plane_t const*, int, double, btreeleaf_s*&, btreeleaf_s*&, bclipnode_s*, bclipnode_s*)
void SplitTreeLeaf (int &numobjects, btreeleaf_t *tl, const dplane_t *plane, int planenum, vec_t epsilon, btreeleaf_t *&front, btreeleaf_t *&back, bclipnode_t *c0, bclipnode_t *c1)
{
	btreeface_l::iterator fi;
	btreeedge_l::iterator ei;
	bool restart = false;

	// clear all the flags
	for (fi = tl->faces->begin (); fi != tl->faces->end (); fi++)
	{
		btreeface_t *tf = fi->f;
		tf->tmp_tested = false;
		for (ei = tf->edges->begin (); ei != tf->edges->end (); ei++)
		{
			btreeedge_t *te = ei->e;
			te->tmp_tested = false;
			for (int side = 0; side < 2; side++)
			{
				btreepoint_t *tp = GetPointFromEdge (te, side);
				tp->tmp_tested = false;
			}
		}
	}

	// split each point
	for (fi = tl->faces->begin (); fi != tl->faces->end (); fi++)
	{
		btreeface_t *tf = fi->f;
		for (ei = tf->edges->begin (); ei != tf->edges->end (); ei++)
		{
			btreeedge_t *te = ei->e;
			for (int side = 0; side < 2; side++)
			{
				btreepoint_t *tp = GetPointFromEdge (te, side);
				if (tp->tmp_tested)
				{
					continue;
				}
				tp->tmp_tested = true;
				vec_t dist = DotProduct (tp->v, plane->normal) - plane->dist;
				tp->tmp_dist = dist;
				if (dist > epsilon)
				{
					tp->tmp_side = SIDE_FRONT;
				}
				else if (dist < -epsilon)
				{
					tp->tmp_side = SIDE_BACK;
				}
				else
				{
					tp->tmp_side = SIDE_ON;
				}
#ifdef HLBSP_BRINKHACK_BUGFIX
#if 0
				// let's mess up something and see whether the code is fragile or robust
				static int randcounter = 0;
				if (randcounter++ % 8 == 0) tp->tmp_side = randcounter % 3;
#endif
#endif
			}
		}
	}

	// split each edge
	for (fi = tl->faces->begin (); fi != tl->faces->end (); fi++)
	{
		btreeface_t *tf = fi->f;
		for (ei = tf->edges->begin (); ei != tf->edges->end (); restart? restart = false, ei = tf->edges->begin (): ei++)
		{
			btreeedge_t *te = ei->e;
			if (te->tmp_tested) // splitted
			{
				continue;
			}
			te->tmp_tested = true;
			te->tmp_side = SIDE_ON;
			for (int side = 0; side < 2; side++)
			{
				btreepoint_t *tp = GetPointFromEdge (te, side);
				if (te->tmp_side == SIDE_ON)
				{
					te->tmp_side = tp->tmp_side;
				}
				else if (tp->tmp_side != SIDE_ON && tp->tmp_side != te->tmp_side)
				{
					te->tmp_side = SIDE_CROSS;
				}
			}
#ifdef HLBSP_BRINKNOTUSEDBYLEAF_FIX
			// The plane does not necessarily split the leaf into two, because of epsilon problem etc., and this will cause "Error: CollectBrinks_r: not leaf" on some maps.
			// In addition, by the time of this step (split edges), the plane has not splitted the leaf yet, so splitting the brink leafs now will break the integrety of the entire geometry. (We want the four steps to be as independent on each other as possible, that is, the entire geometry remains valid after each step.)
#else
			if (!te->infinite)
			{
				if (te->tmp_side == SIDE_ON)
				{
					// since the plane splits the leaf into two, it must also split the brink into two
					BrinkSplitClipnode (te->brink, plane, planenum, tl->clipnode, c0, c1);
				}
				else if (te->tmp_side == SIDE_FRONT)
				{
					BrinkReplaceClipnode (te->brink, tl->clipnode, c0);
				}
				else if (te->tmp_side == SIDE_BACK)
				{
					BrinkReplaceClipnode (te->brink, tl->clipnode, c1);
				}
			}
#endif
			if (te->tmp_side == SIDE_CROSS)
			{
				btreepoint_t *tp0 = GetPointFromEdge (te, false);
				btreepoint_t *tp1 = GetPointFromEdge (te, true);
				btreepoint_t *tpmid = AllocTreepoint (numobjects, te->infinite);
				tpmid->tmp_tested = true;
				tpmid->tmp_dist = 0;
				tpmid->tmp_side = SIDE_ON;
				vec_t frac = tp0->tmp_dist / (tp0->tmp_dist - tp1->tmp_dist);
				for (int k = 0; k < 3; k++)
				{
					tpmid->v[k] = tp0->v[k] + frac * (tp1->v[k] - tp0->v[k]);
				}
				btreeedge_t *te0 = AllocTreeedge (numobjects, te->infinite);
				SetEdgePoints (te0, tp0, tpmid);
				te0->tmp_tested = true;
				te0->tmp_side = tp0->tmp_side;
				if (!te0->infinite)
				{
					te0->brink = CopyBrink (te->brink);
					VectorCopy (tpmid->v, te0->brink->start);
					VectorCopy (tp0->v, te0->brink->stop);
#ifndef HLBSP_BRINKNOTUSEDBYLEAF_FIX
					BrinkReplaceClipnode (te0->brink, tl->clipnode, (tp0->tmp_side == SIDE_BACK? c1: c0));
#endif
				}
				btreeedge_t *te1 = AllocTreeedge (numobjects, te->infinite);
				SetEdgePoints (te1, tpmid, tp1);
				te1->tmp_tested = true;
				te1->tmp_side = tp1->tmp_side;
				if (!te1->infinite)
				{
					te1->brink = CopyBrink (te->brink);
					VectorCopy (tp1->v, te1->brink->start);
					VectorCopy (tpmid->v, te1->brink->stop);
#ifndef HLBSP_BRINKNOTUSEDBYLEAF_FIX
					BrinkReplaceClipnode (te1->brink, tl->clipnode, (tp1->tmp_side == SIDE_BACK? c1: c0));
#endif
				}
				btreeface_l::iterator fj;
				while ((fj = te->faces->begin ()) != te->faces->end ())
				{
					AttachEdgeToFace (fj->f, te0, fj->side);
					AttachEdgeToFace (fj->f, te1, fj->side);
					RemoveEdgeFromFace (fj->f, te, fj->side);
				}
				DeleteEdge (numobjects, te);
				restart = true;
			}
		}
	}

	// split each face
	for (fi = tl->faces->begin (); fi != tl->faces->end (); restart? restart = false, fi = tl->faces->begin (): fi++)
	{
		btreeface_t *tf = fi->f;
		if (tf->tmp_tested)
		{
			continue;
		}
		tf->tmp_tested = true;
		tf->tmp_side = SIDE_ON;
		for (ei = tf->edges->begin (); ei != tf->edges->end (); ei++)
		{
			if (tf->tmp_side == SIDE_ON)
			{
				tf->tmp_side = ei->e->tmp_side;
			}
			else if (ei->e->tmp_side != SIDE_ON && ei->e->tmp_side != tf->tmp_side)
			{
				tf->tmp_side = SIDE_CROSS;
			}
		}
		if (tf->tmp_side == SIDE_CROSS)
		{
			btreeface_t *frontface, *backface;
			frontface = AllocTreeface (numobjects, tf->infinite);
			if (!tf->infinite)
			{
				frontface->plane = tf->plane;
				frontface->planenum = tf->planenum;
				frontface->planeside = tf->planeside;
			}
			SetFaceLeafs (frontface, GetLeafFromFace (tf, false), GetLeafFromFace (tf, true));
			frontface->tmp_tested = true;
			frontface->tmp_side = SIDE_FRONT;
			backface = AllocTreeface (numobjects, tf->infinite);
			if (!tf->infinite)
			{
				backface->plane = tf->plane;
				backface->planenum = tf->planenum;
				backface->planeside = tf->planeside;
			}
			SetFaceLeafs (backface, GetLeafFromFace (tf, false), GetLeafFromFace (tf, true));
			backface->tmp_tested = true;
			backface->tmp_side = SIDE_BACK;

			std::map< btreepoint_t *, int > vertexes;
			std::map< btreepoint_t *, int >::iterator vertex, vertex2;
			for (ei = tf->edges->begin (); ei != tf->edges->end (); ei++)
			{
				if (ei->e->tmp_side != SIDE_BACK)
				{
					AttachEdgeToFace (frontface, ei->e, ei->side);
				}
				else
				{
					AttachEdgeToFace (backface, ei->e, ei->side);

					btreeedge_t *e = ei->e;
					for (int side = 0; side < 2; side++)
					{
						btreepoint_t *p = GetPointFromEdge (e, side);
						vertexes[p] += ((bool)side == ei->side? 1: -1); // the default value is 0 if vertexes[p] does not exist
						vertex = vertexes.find (p);
						if (vertex->second == 0)
						{
							vertexes.erase (vertex);
						}
					}
				}
			}
			if (vertexes.size () != 2)
			{
				Developer (DEVELOPER_LEVEL_WARNING, "SplitTreeLeaf: got invalid edge from split\n");
			}

			while (1)
			{
				for (vertex = vertexes.begin (); vertex != vertexes.end (); vertex++)
				{
					if (vertex->second > 0)
					{
						break;
					}
				}
				for (vertex2 = vertexes.begin (); vertex2 != vertexes.end (); vertex2++)
				{
					if (vertex2->second < 0)
					{
						break;
					}
				}
				if (vertex == vertexes.end () && vertex2 == vertexes.end ())
				{
					break;
				}
				if (vertex == vertexes.end () || vertex2 == vertexes.end ())
				{
					PrintOnce ("SplitTreeLeaf: internal error: couldn't link edges");
					hlassume (false, assume_first);
				}
				if (vertex->second != 1 || vertex2->second != -1)
				{
					Developer (DEVELOPER_LEVEL_WARNING, "SplitTreeLeaf: got deformed edge from split\n");
				}
				if (vertex->first->tmp_side != SIDE_ON || vertex2->first->tmp_side != SIDE_ON)
				{
					PrintOnce ("SplitTreeLeaf: internal error: tmp_side != SIDE_ON");
					hlassume (false, assume_first);
				}

				btreeedge_t *te;
				te = AllocTreeedge (numobjects, tf->infinite);
				SetEdgePoints (te, vertex->first, vertex2->first);
				if (!te->infinite)
				{
					te->brink = CreateBrink (vertex2->first->v, vertex->first->v);
					if (GetLeafFromFace (tf, tf->planeside)->infinite || GetLeafFromFace (tf, !tf->planeside)->infinite)
					{
						PrintOnce ("SplitTreeLeaf: internal error: an infinite object contains a finite object");
						hlassume (false, assume_first);
					}
					BrinkSplitClipnode (te->brink, tf->plane, tf->planenum, NULL, GetLeafFromFace (tf, tf->planeside)->clipnode, GetLeafFromFace (tf, !tf->planeside)->clipnode);
#ifndef HLBSP_BRINKNOTUSEDBYLEAF_FIX
					BrinkSplitClipnode (te->brink, plane, planenum, tl->clipnode, c0, c1);
#endif
				}
				te->tmp_tested = true;
				te->tmp_side = SIDE_ON;
				AttachEdgeToFace (frontface, te, false);
				AttachEdgeToFace (backface, te, true);

				vertex->second--;
				vertex2->second++;
			}

			for (int side = 0; side < 2; side++)
			{
				RemoveFaceFromLeaf (GetLeafFromFace (tf, side), tf, side);
			}
			DeleteFace (numobjects, tf);
			restart = true;
		}
	}

	// split the leaf
	{
		if (tl->infinite)
		{
			PrintOnce ("SplitTreeLeaf: internal error: splitting the infinite leaf");
			hlassume (false, assume_first);
		}
		front = AllocTreeleaf (numobjects, tl->infinite);
		back = AllocTreeleaf (numobjects, tl->infinite);
		front->clipnode = c0;
		back->clipnode = c1;

		int tmp_side = SIDE_ON;
		for (fi = tl->faces->begin (); fi != tl->faces->end (); fi++)
		{
			if (tmp_side == SIDE_ON)
			{
				tmp_side = fi->f->tmp_side;
			}
			else if (fi->f->tmp_side != SIDE_ON && fi->f->tmp_side != tmp_side)
			{
				tmp_side = SIDE_CROSS;
			}
		}
		
		std::map< btreeedge_t *, int > edges;
		std::map< btreeedge_t *, int >::iterator edge;

		while ((fi = tl->faces->begin ()) != tl->faces->end ())
		{
			btreeface_t *tf = fi->f;
			int side = fi->side;
			RemoveFaceFromLeaf (tl, tf, side); // because we can only store 2 leafs for a face
			
			// fi is unusable now
			if (tf->tmp_side == SIDE_FRONT || tf->tmp_side == SIDE_ON && tmp_side != SIDE_BACK)
			{
				AttachFaceToLeaf (front, tf, side);
			}
			else if (tf->tmp_side == SIDE_BACK || tf->tmp_side == SIDE_ON && tmp_side == SIDE_BACK)
			{
				AttachFaceToLeaf (back, tf, side);

				if (tmp_side == SIDE_CROSS)
				{
					for (ei = tf->edges->begin (); ei != tf->edges->end (); ei++)
					{
						edges[ei->e] += (ei->side == (bool)side? 1: -1);
						edge = edges.find (ei->e);
						if (edge->second == 0)
						{
							edges.erase (edge);
						}
					}
				}
			}
		}

		if (tmp_side == SIDE_CROSS)
		{
			btreeface_t *tf;
			tf = AllocTreeface (numobjects, tl->infinite);
			if (!tf->infinite)
			{
				tf->plane = plane;
				tf->planenum = planenum;
				tf->planeside = false;
			}
			tf->tmp_tested = true;
			tf->tmp_side = SIDE_ON;
			SetFaceLeafs (tf, front, back);
			for (edge = edges.begin (); edge != edges.end (); edge++)
			{
				if (edge->first->tmp_side != SIDE_ON)
				{
					PrintOnce ("SplitTreeLeaf: internal error");
					hlassume (false, assume_first);
				}
				while (edge->second > 0)
				{
					AttachEdgeToFace (tf, edge->first, false);
					edge->second--;
				}
				while (edge->second < 0)
				{
					AttachEdgeToFace (tf, edge->first, true);
					edge->second++;
				}
			}
		}

#ifndef HLBSP_BRINKHACK_BUGFIX
		DeleteLeaf (numobjects, tl);
#endif
#ifdef HLBSP_BRINKNOTUSEDBYLEAF_FIX
		btreeleaf_t *(frontback[2]) = {front, back};
		for (int side = 0; side < 2; side++)
		{
			for (fi = frontback[side]->faces->begin (); fi != frontback[side]->faces->end (); fi++)
			{
				for (ei = fi->f->edges->begin (); ei != fi->f->edges->end (); ei++)
				{
					ei->e->tmp_onleaf[0] = ei->e->tmp_onleaf[1] = false;
					ei->e->tmp_tested = false;
				}
			}
		}
		for (int side = 0; side < 2; side++)
		{
			for (fi = frontback[side]->faces->begin (); fi != frontback[side]->faces->end (); fi++)
			{
				for (ei = fi->f->edges->begin (); ei != fi->f->edges->end (); ei++)
				{
					ei->e->tmp_onleaf[side] = true;
				}
			}
		}
		for (int side = 0; side < 2; side++)
		{
			for (fi = frontback[side]->faces->begin (); fi != frontback[side]->faces->end (); fi++)
			{
				for (ei = fi->f->edges->begin (); ei != fi->f->edges->end (); ei++)
				{
					if (ei->e->tmp_tested)
					{
						continue;
					}
					ei->e->tmp_tested = true;
					if (!ei->e->infinite)
					{
						if (ei->e->tmp_onleaf[0] && ei->e->tmp_onleaf[1])
						{
							if (ei->e->tmp_side != SIDE_ON)
							{
								PrintOnce ("SplitTreeLeaf: internal error");
								hlassume (false, assume_first);
							}
							BrinkSplitClipnode (ei->e->brink, plane, planenum, tl->clipnode, c0, c1);
						}
						else if (ei->e->tmp_onleaf[0])
						{
							if (ei->e->tmp_side == SIDE_BACK)
							{
								PrintOnce ("SplitTreeLeaf: internal error");
								hlassume (false, assume_first);
							}
							BrinkReplaceClipnode (ei->e->brink, tl->clipnode, c0);
						}
						else if (ei->e->tmp_onleaf[1])
						{
							if (ei->e->tmp_side == SIDE_FRONT)
							{
								PrintOnce ("SplitTreeLeaf: internal error");
								hlassume (false, assume_first);
							}
							BrinkReplaceClipnode (ei->e->brink, tl->clipnode, c1);
						}
					}
				}
			}
		}
#endif
#ifdef HLBSP_BRINKHACK_BUGFIX
		DeleteLeaf (numobjects, tl);
#endif
	}
}

// Assembly:
subq $0x5e8, %rsp            # imm = 0x5E8
movq 0x5f8(%rsp), %rax
movq 0x5f0(%rsp), %rax
movq %rdi, 0x5e0(%rsp)
movq %rsi, 0x5d8(%rsp)
movq %rdx, 0x5d0(%rsp)
movl %ecx, 0x5cc(%rsp)
movsd %xmm0, 0x5c0(%rsp)
movq %r8, 0x5b8(%rsp)
movq %r9, 0x5b0(%rsp)
leaq 0x5a8(%rsp), %rdi
callq 0x19ef0
leaq 0x5a0(%rsp), %rdi
callq 0x19d60
movb $0x0, 0x59f(%rsp)
movq 0x5d8(%rsp), %rax
movq (%rax), %rdi
callq 0x19f10
movq %rax, 0x590(%rsp)
movq 0x590(%rsp), %rax
movq %rax, 0x5a8(%rsp)
movq 0x5d8(%rsp), %rax
movq (%rax), %rdi
callq 0x19f60
movq %rax, 0x588(%rsp)
leaq 0x5a8(%rsp), %rdi
leaq 0x588(%rsp), %rsi
callq 0x19f40
testb $0x1, %al
jne 0x13b7f
jmp 0x13cbb
leaq 0x5a8(%rsp), %rdi
callq 0x19f90
movq (%rax), %rax
movq %rax, 0x580(%rsp)
movq 0x580(%rsp), %rax
movb $0x0, 0x3d(%rax)
movq 0x580(%rsp), %rax
movq (%rax), %rdi
callq 0x19d80
movq %rax, 0x578(%rsp)
movq 0x578(%rsp), %rax
movq %rax, 0x5a0(%rsp)
movq 0x580(%rsp), %rax
movq (%rax), %rdi
callq 0x19dd0
movq %rax, 0x570(%rsp)
leaq 0x5a0(%rsp), %rdi
leaq 0x570(%rsp), %rsi
callq 0x19db0
testb $0x1, %al
jne 0x13c01
jmp 0x13c9d
leaq 0x5a0(%rsp), %rdi
callq 0x19e00
movq (%rax), %rax
movq %rax, 0x568(%rsp)
movq 0x568(%rsp), %rax
movb $0x0, 0x38(%rax)
movl $0x0, 0x564(%rsp)
cmpl $0x2, 0x564(%rsp)
jge 0x13c7f
movq 0x568(%rsp), %rdi
cmpl $0x0, 0x564(%rsp)
setne %al
movzbl %al, %esi
andl $0x1, %esi
callq 0x131f0
movq %rax, 0x558(%rsp)
movq 0x558(%rsp), %rax
movb $0x0, 0x28(%rax)
movl 0x564(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x564(%rsp)
jmp 0x13c30
jmp 0x13c81
leaq 0x5a0(%rsp), %rdi
xorl %esi, %esi
callq 0x19e90
movq %rax, 0x550(%rsp)
jmp 0x13bcb
jmp 0x13c9f
leaq 0x5a8(%rsp), %rdi
xorl %esi, %esi
callq 0x1a020
movq %rax, 0x548(%rsp)
jmp 0x13b49
movq 0x5d8(%rsp), %rax
movq (%rax), %rdi
callq 0x19f10
movq %rax, 0x540(%rsp)
movq 0x540(%rsp), %rax
movq %rax, 0x5a8(%rsp)
movq 0x5d8(%rsp), %rax
movq (%rax), %rdi
callq 0x19f60
movq %rax, 0x538(%rsp)
leaq 0x5a8(%rsp), %rdi
leaq 0x538(%rsp), %rsi
callq 0x19f40
testb $0x1, %al
jne 0x13d19
jmp 0x13f57
leaq 0x5a8(%rsp), %rdi
callq 0x19f90
movq (%rax), %rax
movq %rax, 0x530(%rsp)
movq 0x530(%rsp), %rax
movq (%rax), %rdi
callq 0x19d80
movq %rax, 0x528(%rsp)
movq 0x528(%rsp), %rax
movq %rax, 0x5a0(%rsp)
movq 0x530(%rsp), %rax
movq (%rax), %rdi
callq 0x19dd0
movq %rax, 0x520(%rsp)
leaq 0x5a0(%rsp), %rdi
leaq 0x520(%rsp), %rsi
callq 0x19db0
testb $0x1, %al
jne 0x13d8f
jmp 0x13f39
leaq 0x5a0(%rsp), %rdi
callq 0x19e00
movq (%rax), %rax
movq %rax, 0x518(%rsp)
movl $0x0, 0x514(%rsp)
cmpl $0x2, 0x514(%rsp)
jge 0x13f1b
movq 0x518(%rsp), %rdi
cmpl $0x0, 0x514(%rsp)
setne %al
movzbl %al, %esi
andl $0x1, %esi
callq 0x131f0
movq %rax, 0x508(%rsp)
movq 0x508(%rsp), %rax
testb $0x1, 0x28(%rax)
je 0x13df9
jmp 0x13f05
movq 0x508(%rsp), %rax
movb $0x1, 0x28(%rax)
movq 0x508(%rsp), %rax
movsd (%rax), %xmm1
movq 0x5d0(%rsp), %rax
movsd (%rax), %xmm2
movq 0x508(%rsp), %rax
movsd 0x8(%rax), %xmm0
movq 0x5d0(%rsp), %rax
mulsd 0x8(%rax), %xmm0
mulsd %xmm2, %xmm1
addsd %xmm0, %xmm1
movq 0x508(%rsp), %rax
movsd 0x10(%rax), %xmm0
movq 0x5d0(%rsp), %rax
movsd 0x10(%rax), %xmm2
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movq 0x5d0(%rsp), %rax
subsd 0x30(%rax), %xmm0
movsd %xmm0, 0x500(%rsp)
movsd 0x500(%rsp), %xmm0
movq 0x508(%rsp), %rax
movsd %xmm0, 0x30(%rax)
movsd 0x500(%rsp), %xmm0
ucomisd 0x5c0(%rsp), %xmm0
jbe 0x13eb2
movq 0x508(%rsp), %rax
movl $0x0, 0x38(%rax)
jmp 0x13f03
movsd 0x500(%rsp), %xmm1
movsd 0x5c0(%rsp), %xmm0
movq %xmm0, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm0
ucomisd %xmm1, %xmm0
jbe 0x13ef2
movq 0x508(%rsp), %rax
movl $0x1, 0x38(%rax)
jmp 0x13f01
movq 0x508(%rsp), %rax
movl $0x2, 0x38(%rax)
jmp 0x13f03
jmp 0x13f05
movl 0x514(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x514(%rsp)
jmp 0x13db2
jmp 0x13f1d
leaq 0x5a0(%rsp), %rdi
xorl %esi, %esi
callq 0x19e90
movq %rax, 0x4f8(%rsp)
jmp 0x13d59
jmp 0x13f3b
leaq 0x5a8(%rsp), %rdi
xorl %esi, %esi
callq 0x1a020
movq %rax, 0x4f0(%rsp)
jmp 0x13ce3
movq 0x5d8(%rsp), %rax
movq (%rax), %rdi
callq 0x19f10
movq %rax, 0x4e8(%rsp)
movq 0x4e8(%rsp), %rax
movq %rax, 0x5a8(%rsp)
movq 0x5d8(%rsp), %rax
movq (%rax), %rdi
callq 0x19f60
movq %rax, 0x4e0(%rsp)
leaq 0x5a8(%rsp), %rdi
leaq 0x4e0(%rsp), %rsi
callq 0x19f40
testb $0x1, %al
jne 0x13fb5
jmp 0x14717
leaq 0x5a8(%rsp), %rdi
callq 0x19f90
movq (%rax), %rax
movq %rax, 0x4d8(%rsp)
movq 0x4d8(%rsp), %rax
movq (%rax), %rdi
callq 0x19d80
movq %rax, 0x4d0(%rsp)
movq 0x4d0(%rsp), %rax
movq %rax, 0x5a0(%rsp)
movq 0x4d8(%rsp), %rax
movq (%rax), %rdi
callq 0x19dd0
movq %rax, 0x4c8(%rsp)
leaq 0x5a0(%rsp), %rdi
leaq 0x4c8(%rsp), %rsi
callq 0x19db0
testb $0x1, %al
jne 0x1402b
jmp 0x146f9
leaq 0x5a0(%rsp), %rdi
callq 0x19e00
movq (%rax), %rax
movq %rax, 0x4c0(%rsp)
movq 0x4c0(%rsp), %rax
testb $0x1, 0x38(%rax)
je 0x14056
jmp 0x14691
movq 0x4c0(%rsp), %rax
movb $0x1, 0x38(%rax)
movq 0x4c0(%rsp), %rax
movl $0x2, 0x3c(%rax)
movl $0x0, 0x4bc(%rsp)
cmpl $0x2, 0x4bc(%rsp)
jge 0x14125
movq 0x4c0(%rsp), %rdi
cmpl $0x0, 0x4bc(%rsp)
setne %al
movzbl %al, %esi
andl $0x1, %esi
callq 0x131f0
movq %rax, 0x4b0(%rsp)
movq 0x4c0(%rsp), %rax
cmpl $0x2, 0x3c(%rax)
jne 0x140d6
movq 0x4b0(%rsp), %rax
movl 0x38(%rax), %ecx
movq 0x4c0(%rsp), %rax
movl %ecx, 0x3c(%rax)
jmp 0x1410d
movq 0x4b0(%rsp), %rax
cmpl $0x2, 0x38(%rax)
je 0x1410b
movq 0x4b0(%rsp), %rax
movl 0x38(%rax), %eax
movq 0x4c0(%rsp), %rcx
cmpl 0x3c(%rcx), %eax
je 0x1410b
movq 0x4c0(%rsp), %rax
movl $0xfffffffe, 0x3c(%rax) # imm = 0xFFFFFFFE
jmp 0x1410d
jmp 0x1410f
movl 0x4bc(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x4bc(%rsp)
jmp 0x1407c
movq 0x4c0(%rsp), %rax
cmpl $-0x2, 0x3c(%rax)
jne 0x1468f
movq 0x4c0(%rsp), %rdi
xorl %esi, %esi
callq 0x131f0
movq %rax, 0x4a8(%rsp)
movq 0x4c0(%rsp), %rdi
movl $0x1, %esi
callq 0x131f0
movq %rax, 0x4a0(%rsp)
movq 0x5e0(%rsp), %rdi
movq 0x4c0(%rsp), %rax
movb 0x20(%rax), %al
andb $0x1, %al
movzbl %al, %esi
callq 0x12680
movq %rax, 0x498(%rsp)
movq 0x498(%rsp), %rax
movb $0x1, 0x28(%rax)
movq 0x498(%rsp), %rax
xorps %xmm0, %xmm0
movsd %xmm0, 0x30(%rax)
movq 0x498(%rsp), %rax
movl $0x2, 0x38(%rax)
movq 0x4a8(%rsp), %rax
movsd 0x30(%rax), %xmm0
movq 0x4a8(%rsp), %rax
movsd 0x30(%rax), %xmm1
movq 0x4a0(%rsp), %rax
subsd 0x30(%rax), %xmm1
divsd %xmm1, %xmm0
movsd %xmm0, 0x490(%rsp)
movl $0x0, 0x48c(%rsp)
cmpl $0x3, 0x48c(%rsp)
jge 0x1427c
movq 0x4a8(%rsp), %rax
movslq 0x48c(%rsp), %rcx
movsd (%rax,%rcx,8), %xmm1
movsd 0x490(%rsp), %xmm0
movq 0x4a0(%rsp), %rax
movslq 0x48c(%rsp), %rcx
movsd (%rax,%rcx,8), %xmm2
movq 0x4a8(%rsp), %rax
movslq 0x48c(%rsp), %rcx
subsd (%rax,%rcx,8), %xmm2
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movq 0x498(%rsp), %rax
movslq 0x48c(%rsp), %rcx
movsd %xmm0, (%rax,%rcx,8)
movl 0x48c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x48c(%rsp)
jmp 0x141f7
movq 0x5e0(%rsp), %rdi
movq 0x4c0(%rsp), %rax
movb 0x20(%rax), %al
andb $0x1, %al
movzbl %al, %esi
callq 0x12720
movq %rax, 0x480(%rsp)
movq 0x480(%rsp), %rdi
movq 0x4a8(%rsp), %rsi
movq 0x498(%rsp), %rdx
callq 0x128a0
movq 0x480(%rsp), %rax
movb $0x1, 0x38(%rax)
movq 0x4a8(%rsp), %rax
movl 0x38(%rax), %ecx
movq 0x480(%rsp), %rax
movl %ecx, 0x3c(%rax)
movq 0x480(%rsp), %rax
testb $0x1, 0x20(%rax)
jne 0x143c3
movq 0x4c0(%rsp), %rax
movq 0x30(%rax), %rdi
callq 0x11f00
movq %rax, %rcx
movq 0x480(%rsp), %rax
movq %rcx, 0x30(%rax)
movq 0x498(%rsp), %rax
movsd (%rax), %xmm0
movq 0x480(%rsp), %rax
movq 0x30(%rax), %rax
movsd %xmm0, (%rax)
movq 0x498(%rsp), %rax
movsd 0x8(%rax), %xmm0
movq 0x480(%rsp), %rax
movq 0x30(%rax), %rax
movsd %xmm0, 0x8(%rax)
movq 0x498(%rsp), %rax
movsd 0x10(%rax), %xmm0
movq 0x480(%rsp), %rax
movq 0x30(%rax), %rax
movsd %xmm0, 0x10(%rax)
movq 0x4a8(%rsp), %rax
movsd (%rax), %xmm0
movq 0x480(%rsp), %rax
movq 0x30(%rax), %rax
movsd %xmm0, 0x18(%rax)
movq 0x4a8(%rsp), %rax
movsd 0x8(%rax), %xmm0
movq 0x480(%rsp), %rax
movq 0x30(%rax), %rax
movsd %xmm0, 0x20(%rax)
movq 0x4a8(%rsp), %rax
movsd 0x10(%rax), %xmm0
movq 0x480(%rsp), %rax
movq 0x30(%rax), %rax
movsd %xmm0, 0x28(%rax)
movq 0x5e0(%rsp), %rdi
movq 0x4c0(%rsp), %rax
movb 0x20(%rax), %al
andb $0x1, %al
movzbl %al, %esi
callq 0x12720
movq %rax, 0x478(%rsp)
movq 0x478(%rsp), %rdi
movq 0x498(%rsp), %rsi
movq 0x4a0(%rsp), %rdx
callq 0x128a0
movq 0x478(%rsp), %rax
movb $0x1, 0x38(%rax)
movq 0x4a0(%rsp), %rax
movl 0x38(%rax), %ecx
movq 0x478(%rsp), %rax
movl %ecx, 0x3c(%rax)
movq 0x478(%rsp), %rax
testb $0x1, 0x20(%rax)
jne 0x1450a
movq 0x4c0(%rsp), %rax
movq 0x30(%rax), %rdi
callq 0x11f00
movq %rax, %rcx
movq 0x478(%rsp), %rax
movq %rcx, 0x30(%rax)
movq 0x4a0(%rsp), %rax
movsd (%rax), %xmm0
movq 0x478(%rsp), %rax
movq 0x30(%rax), %rax
movsd %xmm0, (%rax)
movq 0x4a0(%rsp), %rax
movsd 0x8(%rax), %xmm0
movq 0x478(%rsp), %rax
movq 0x30(%rax), %rax
movsd %xmm0, 0x8(%rax)
movq 0x4a0(%rsp), %rax
movsd 0x10(%rax), %xmm0
movq 0x478(%rsp), %rax
movq 0x30(%rax), %rax
movsd %xmm0, 0x10(%rax)
movq 0x498(%rsp), %rax
movsd (%rax), %xmm0
movq 0x478(%rsp), %rax
movq 0x30(%rax), %rax
movsd %xmm0, 0x18(%rax)
movq 0x498(%rsp), %rax
movsd 0x8(%rax), %xmm0
movq 0x478(%rsp), %rax
movq 0x30(%rax), %rax
movsd %xmm0, 0x20(%rax)
movq 0x498(%rsp), %rax
movsd 0x10(%rax), %xmm0
movq 0x478(%rsp), %rax
movq 0x30(%rax), %rax
movsd %xmm0, 0x28(%rax)
leaq 0x470(%rsp), %rdi
callq 0x19ef0
movq 0x4c0(%rsp), %rax
movq 0x28(%rax), %rdi
callq 0x19f10
movq %rax, 0x468(%rsp)
movq 0x468(%rsp), %rax
movq %rax, 0x470(%rsp)
movq 0x4c0(%rsp), %rax
movq 0x28(%rax), %rdi
callq 0x19f60
movq %rax, 0x460(%rsp)
leaq 0x470(%rsp), %rdi
leaq 0x460(%rsp), %rsi
callq 0x19f40
testb $0x1, %al
jne 0x14577
jmp 0x14672
leaq 0x470(%rsp), %rdi
callq 0x19f90
movq (%rax), %rax
movq %rax, 0x138(%rsp)
movq 0x480(%rsp), %rax
movq %rax, 0x140(%rsp)
leaq 0x470(%rsp), %rdi
callq 0x19f90
movq 0x138(%rsp), %rdi
movq 0x140(%rsp), %rsi
movb 0x8(%rax), %al
andb $0x1, %al
movzbl %al, %edx
callq 0x129a0
leaq 0x470(%rsp), %rdi
callq 0x19f90
movq (%rax), %rax
movq %rax, 0x148(%rsp)
movq 0x478(%rsp), %rax
movq %rax, 0x150(%rsp)
leaq 0x470(%rsp), %rdi
callq 0x19f90
movq 0x148(%rsp), %rdi
movq 0x150(%rsp), %rsi
movb 0x8(%rax), %al
andb $0x1, %al
movzbl %al, %edx
callq 0x129a0
leaq 0x470(%rsp), %rdi
callq 0x19f90
movq (%rax), %rax
movq %rax, 0x158(%rsp)
movq 0x4c0(%rsp), %rax
movq %rax, 0x160(%rsp)
leaq 0x470(%rsp), %rdi
callq 0x19f90
movq 0x158(%rsp), %rdi
movq 0x160(%rsp), %rsi
movb 0x8(%rax), %al
andb $0x1, %al
movzbl %al, %edx
callq 0x13570
jmp 0x14517
movq 0x5e0(%rsp), %rdi
movq 0x4c0(%rsp), %rsi
callq 0x135d0
movb $0x1, 0x59f(%rsp)
jmp 0x14691
testb $0x1, 0x59f(%rsp)
je 0x146dd
movb $0x0, 0x59f(%rsp)
movq 0x4d8(%rsp), %rax
movq (%rax), %rdi
callq 0x19d80
movq %rax, 0x450(%rsp)
movq 0x450(%rsp), %rax
movq %rax, 0x5a0(%rsp)
movq 0x5a0(%rsp), %rax
movq %rax, 0x458(%rsp)
jmp 0x146f4
leaq 0x5a0(%rsp), %rdi
xorl %esi, %esi
callq 0x19e90
movq %rax, 0x448(%rsp)
jmp 0x13ff5
jmp 0x146fb
leaq 0x5a8(%rsp), %rdi
xorl %esi, %esi
callq 0x1a020
movq %rax, 0x440(%rsp)
jmp 0x13f7f
movq 0x5d8(%rsp), %rax
movq (%rax), %rdi
callq 0x19f10
movq %rax, 0x438(%rsp)
movq 0x438(%rsp), %rax
movq %rax, 0x5a8(%rsp)
movq 0x5d8(%rsp), %rax
movq (%rax), %rdi
callq 0x19f60
movq %rax, 0x430(%rsp)
leaq 0x5a8(%rsp), %rdi
leaq 0x430(%rsp), %rsi
callq 0x19f40
testb $0x1, %al
jne 0x14775
jmp 0x15405
leaq 0x5a8(%rsp), %rdi
callq 0x19f90
movq (%rax), %rax
movq %rax, 0x428(%rsp)
movq 0x428(%rsp), %rax
testb $0x1, 0x3d(%rax)
je 0x147a0
jmp 0x1539d
movq 0x428(%rsp), %rax
movb $0x1, 0x3d(%rax)
movq 0x428(%rsp), %rax
movl $0x2, 0x40(%rax)
movq 0x428(%rsp), %rax
movq (%rax), %rdi
callq 0x19d80
movq %rax, 0x420(%rsp)
movq 0x420(%rsp), %rax
movq %rax, 0x5a0(%rsp)
movq 0x428(%rsp), %rax
movq (%rax), %rdi
callq 0x19dd0
movq %rax, 0x418(%rsp)
leaq 0x5a0(%rsp), %rdi
leaq 0x418(%rsp), %rsi
callq 0x19db0
testb $0x1, %al
jne 0x14819
jmp 0x148ac
movq 0x428(%rsp), %rax
cmpl $0x2, 0x40(%rax)
jne 0x14847
leaq 0x5a0(%rsp), %rdi
callq 0x19e00
movq (%rax), %rax
movl 0x3c(%rax), %ecx
movq 0x428(%rsp), %rax
movl %ecx, 0x40(%rax)
jmp 0x1488e
leaq 0x5a0(%rsp), %rdi
callq 0x19e00
movq (%rax), %rax
cmpl $0x2, 0x3c(%rax)
je 0x1488c
leaq 0x5a0(%rsp), %rdi
callq 0x19e00
movq (%rax), %rax
movl 0x3c(%rax), %eax
movq 0x428(%rsp), %rcx
cmpl 0x40(%rcx), %eax
je 0x1488c
movq 0x428(%rsp), %rax
movl $0xfffffffe, 0x40(%rax) # imm = 0xFFFFFFFE
jmp 0x1488e
jmp 0x14890
leaq 0x5a0(%rsp), %rdi
xorl %esi, %esi
callq 0x19e90
movq %rax, 0x410(%rsp)
jmp 0x147e3
movq 0x428(%rsp), %rax
cmpl $-0x2, 0x40(%rax)
jne 0x1539b
movq 0x5e0(%rsp), %rdi
movq 0x428(%rsp), %rax
movb 0x8(%rax), %al
andb $0x1, %al
movzbl %al, %esi
callq 0x128e0
movq %rax, 0x408(%rsp)
movq 0x428(%rsp), %rax
testb $0x1, 0x8(%rax)
jne 0x14938
movq 0x428(%rsp), %rax
movq 0x30(%rax), %rcx
movq 0x408(%rsp), %rax
movq %rcx, 0x30(%rax)
movq 0x428(%rsp), %rax
movl 0x38(%rax), %ecx
movq 0x408(%rsp), %rax
movl %ecx, 0x38(%rax)
movq 0x428(%rsp), %rax
movb 0x3c(%rax), %cl
movq 0x408(%rsp), %rax
andb $0x1, %cl
movb %cl, 0x3c(%rax)
movq 0x408(%rsp), %rax
movq %rax, 0x128(%rsp)
movq 0x428(%rsp), %rdi
xorl %esi, %esi
callq 0x136e0
movq %rax, 0x130(%rsp)
movq 0x428(%rsp), %rdi
movl $0x1, %esi
callq 0x136e0
movq 0x128(%rsp), %rdi
movq 0x130(%rsp), %rsi
movq %rax, %rdx
callq 0x12b00
movq 0x408(%rsp), %rax
movb $0x1, 0x3d(%rax)
movq 0x408(%rsp), %rax
movl $0x0, 0x40(%rax)
movq 0x5e0(%rsp), %rdi
movq 0x428(%rsp), %rax
movb 0x8(%rax), %al
andb $0x1, %al
movzbl %al, %esi
callq 0x128e0
movq %rax, 0x400(%rsp)
movq 0x428(%rsp), %rax
testb $0x1, 0x8(%rax)
jne 0x14a1e
movq 0x428(%rsp), %rax
movq 0x30(%rax), %rcx
movq 0x400(%rsp), %rax
movq %rcx, 0x30(%rax)
movq 0x428(%rsp), %rax
movl 0x38(%rax), %ecx
movq 0x400(%rsp), %rax
movl %ecx, 0x38(%rax)
movq 0x428(%rsp), %rax
movb 0x3c(%rax), %cl
movq 0x400(%rsp), %rax
andb $0x1, %cl
movb %cl, 0x3c(%rax)
movq 0x400(%rsp), %rax
movq %rax, 0x118(%rsp)
movq 0x428(%rsp), %rdi
xorl %esi, %esi
callq 0x136e0
movq %rax, 0x120(%rsp)
movq 0x428(%rsp), %rdi
movl $0x1, %esi
callq 0x136e0
movq 0x118(%rsp), %rdi
movq 0x120(%rsp), %rsi
movq %rax, %rdx
callq 0x12b00
movq 0x400(%rsp), %rax
movb $0x1, 0x3d(%rax)
movq 0x400(%rsp), %rax
movl $0x1, 0x40(%rax)
leaq 0x3d0(%rsp), %rdi
callq 0x1a080
leaq 0x3c8(%rsp), %rdi
callq 0x1a090
leaq 0x3c0(%rsp), %rdi
callq 0x1a090
movq 0x428(%rsp), %rax
movq (%rax), %rdi
callq 0x19d80
movq %rax, 0x3b8(%rsp)
movq 0x3b8(%rsp), %rax
movq %rax, 0x5a0(%rsp)
movq 0x428(%rsp), %rax
movq (%rax), %rdi
callq 0x19dd0
movq %rax, 0x3b0(%rsp)
leaq 0x5a0(%rsp), %rdi
leaq 0x3b0(%rsp), %rsi
callq 0x19db0
testb $0x1, %al
jne 0x14b0f
jmp 0x14db7
leaq 0x5a0(%rsp), %rdi
callq 0x19e00
movq (%rax), %rax
cmpl $0x1, 0x3c(%rax)
je 0x14baf
movq 0x408(%rsp), %rax
movq %rax, 0x108(%rsp)
leaq 0x5a0(%rsp), %rdi
movq %rdi, 0x100(%rsp)
callq 0x19e00
movq 0x100(%rsp), %rdi
movq (%rax), %rax
movq %rax, 0x110(%rsp)
callq 0x19e00
movq 0x108(%rsp), %rdi
movq 0x110(%rsp), %rsi
movzbl 0x8(%rax), %edx
andl $0x1, %edx
callq 0x129a0
jmp 0x14b84
jmp 0x14d99
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x3a8(%rsp)
movl %eax, 0x3a4(%rsp)
leaq 0x3d0(%rsp), %rdi
callq 0x1a330
jmp 0x1613e
movq 0x400(%rsp), %rax
movq %rax, 0xf0(%rsp)
leaq 0x5a0(%rsp), %rdi
movq %rdi, 0xe8(%rsp)
callq 0x19e00
movq 0xe8(%rsp), %rdi
movq (%rax), %rax
movq %rax, 0xf8(%rsp)
callq 0x19e00
movq 0xf0(%rsp), %rdi
movq 0xf8(%rsp), %rsi
movzbl 0x8(%rax), %edx
andl $0x1, %edx
callq 0x129a0
jmp 0x14c0a
leaq 0x5a0(%rsp), %rdi
callq 0x19e00
movq (%rax), %rax
movq %rax, 0x398(%rsp)
movl $0x0, 0x394(%rsp)
cmpl $0x2, 0x394(%rsp)
jge 0x14d97
movq 0x398(%rsp), %rdi
movl 0x394(%rsp), %eax
testl %eax, %eax
setne %al
movzbl %al, %esi
callq 0x131f0
movq %rax, 0xe0(%rsp)
jmp 0x14c61
movq 0xe0(%rsp), %rax
movq %rax, 0x388(%rsp)
movl 0x394(%rsp), %eax
testl %eax, %eax
setne %al
movzbl %al, %eax
movl %eax, 0xd0(%rsp)
leaq 0x5a0(%rsp), %rdi
callq 0x19e00
movq %rax, %rcx
movl 0xd0(%rsp), %eax
movzbl 0x8(%rcx), %ecx
andl $0x1, %ecx
subl %ecx, %eax
sete %al
movzbl %al, %ecx
movl %ecx, %eax
leal -0x1(%rax,%rax), %eax
movl %eax, 0xd4(%rsp)
leaq 0x3d0(%rsp), %rdi
leaq 0x388(%rsp), %rsi
callq 0x1a0b0
movq %rax, 0xd8(%rsp)
jmp 0x14cd9
movq 0xd8(%rsp), %rax
movl 0xd4(%rsp), %edx
movl (%rax), %ecx
addl %edx, %ecx
movl %ecx, (%rax)
leaq 0x3d0(%rsp), %rdi
leaq 0x388(%rsp), %rsi
callq 0x1a1b0
movq %rax, 0xc8(%rsp)
jmp 0x14d0d
movq 0xc8(%rsp), %rax
movq %rax, 0x380(%rsp)
movq 0x380(%rsp), %rax
movq %rax, 0x3c8(%rsp)
leaq 0x3c8(%rsp), %rdi
callq 0x1a1e0
cmpl $0x0, 0x8(%rax)
jne 0x14d7f
movq 0x3c8(%rsp), %rax
movq %rax, 0x378(%rsp)
movq 0x378(%rsp), %rsi
leaq 0x3d0(%rsp), %rdi
callq 0x1a200
movq %rax, 0xc0(%rsp)
jmp 0x14d6f
movq 0xc0(%rsp), %rax
movq %rax, 0x370(%rsp)
jmp 0x14d81
movl 0x394(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x394(%rsp)
jmp 0x14c2d
jmp 0x14d99
jmp 0x14d9b
leaq 0x5a0(%rsp), %rdi
xorl %esi, %esi
callq 0x19e90
movq %rax, 0x368(%rsp)
jmp 0x14ad9
leaq 0x3d0(%rsp), %rdi
callq 0x1a240
cmpq $0x2, %rax
je 0x14de1
leaq 0x24ce6(%rip), %rsi     # 0x39ab7
xorl %eax, %eax
movl $0x2, %edi
callq 0xbb80
jmp 0x14ddf
jmp 0x14de1
jmp 0x14de3
jmp 0x14de5
leaq 0x3d0(%rsp), %rdi
callq 0x1a250
movq %rax, 0x360(%rsp)
movq 0x360(%rsp), %rax
movq %rax, 0x3c8(%rsp)
leaq 0x3d0(%rsp), %rdi
callq 0x1a2a0
movq %rax, 0x358(%rsp)
leaq 0x3c8(%rsp), %rdi
leaq 0x358(%rsp), %rsi
callq 0x1a280
testb $0x1, %al
jne 0x14e3a
jmp 0x14e6a
leaq 0x3c8(%rsp), %rdi
callq 0x1a1e0
cmpl $0x0, 0x8(%rax)
jle 0x14e4f
jmp 0x14e6a
jmp 0x14e51
leaq 0x3c8(%rsp), %rdi
xorl %esi, %esi
callq 0x1a2d0
movq %rax, 0x350(%rsp)
jmp 0x14e0a
leaq 0x3d0(%rsp), %rdi
callq 0x1a250
movq %rax, 0x348(%rsp)
movq 0x348(%rsp), %rax
movq %rax, 0x3c0(%rsp)
leaq 0x3d0(%rsp), %rdi
callq 0x1a2a0
movq %rax, 0x340(%rsp)
leaq 0x3c0(%rsp), %rdi
leaq 0x340(%rsp), %rsi
callq 0x1a280
testb $0x1, %al
jne 0x14ebf
jmp 0x14eef
leaq 0x3c0(%rsp), %rdi
callq 0x1a1e0
cmpl $0x0, 0x8(%rax)
jge 0x14ed4
jmp 0x14eef
jmp 0x14ed6
leaq 0x3c0(%rsp), %rdi
xorl %esi, %esi
callq 0x1a2d0
movq %rax, 0x338(%rsp)
jmp 0x14e8f
leaq 0x3d0(%rsp), %rdi
callq 0x1a2a0
movq %rax, 0x330(%rsp)
leaq 0x3c8(%rsp), %rdi
leaq 0x330(%rsp), %rsi
callq 0x1a310
movb %al, %cl
xorl %eax, %eax
testb $0x1, %cl
movb %al, 0xbf(%rsp)
jne 0x14f2b
jmp 0x14f5c
leaq 0x3d0(%rsp), %rdi
callq 0x1a2a0
movq %rax, 0x328(%rsp)
leaq 0x3c0(%rsp), %rdi
leaq 0x328(%rsp), %rsi
callq 0x1a310
movb %al, 0xbf(%rsp)
movb 0xbf(%rsp), %al
testb $0x1, %al
jne 0x14f69
jmp 0x14f6e
jmp 0x152ff
leaq 0x3d0(%rsp), %rdi
callq 0x1a2a0
movq %rax, 0x320(%rsp)
leaq 0x3c8(%rsp), %rdi
leaq 0x320(%rsp), %rsi
callq 0x1a310
movb %al, %cl
movb $0x1, %al
testb $0x1, %cl
movb %al, 0xbe(%rsp)
jne 0x14fd9
leaq 0x3d0(%rsp), %rdi
callq 0x1a2a0
movq %rax, 0x318(%rsp)
leaq 0x3c0(%rsp), %rdi
leaq 0x318(%rsp), %rsi
callq 0x1a310
movb %al, 0xbe(%rsp)
movb 0xbe(%rsp), %al
testb $0x1, %al
jne 0x14fe6
jmp 0x15003
leaq 0x24af6(%rip), %rdi     # 0x39ae3
xorl %eax, %eax
callq 0xb840
jmp 0x14ff6
xorl %esi, %esi
movl %esi, %edi
callq 0xbe90
jmp 0x15001
jmp 0x15003
leaq 0x3c8(%rsp), %rdi
callq 0x1a1e0
cmpl $0x1, 0x8(%rax)
jne 0x15029
leaq 0x3c0(%rsp), %rdi
callq 0x1a1e0
cmpl $-0x1, 0x8(%rax)
je 0x15040
leaq 0x24ae6(%rip), %rsi     # 0x39b16
xorl %eax, %eax
movl $0x2, %edi
callq 0xbb80
jmp 0x1503e
jmp 0x15040
leaq 0x3c8(%rsp), %rdi
callq 0x1a1e0
movq (%rax), %rax
cmpl $0x2, 0x38(%rax)
jne 0x1506c
leaq 0x3c0(%rsp), %rdi
callq 0x1a1e0
movq (%rax), %rax
cmpl $0x2, 0x38(%rax)
je 0x15089
leaq 0x24ad0(%rip), %rdi     # 0x39b43
xorl %eax, %eax
callq 0xb840
jmp 0x1507c
xorl %esi, %esi
movl %esi, %edi
callq 0xbe90
jmp 0x15087
jmp 0x15089
movq 0x5e0(%rsp), %rdi
movq 0x428(%rsp), %rax
movzbl 0x8(%rax), %esi
andl $0x1, %esi
callq 0x12720
movq %rax, 0xb0(%rsp)
jmp 0x150af
movq 0xb0(%rsp), %rax
movq %rax, 0x310(%rsp)
movq 0x310(%rsp), %rax
movq %rax, 0xa0(%rsp)
leaq 0x3c8(%rsp), %rdi
callq 0x1a1e0
movq (%rax), %rax
movq %rax, 0xa8(%rsp)
leaq 0x3c0(%rsp), %rdi
callq 0x1a1e0
movq 0xa0(%rsp), %rdi
movq 0xa8(%rsp), %rsi
movq (%rax), %rdx
callq 0x128a0
jmp 0x1510e
movq 0x310(%rsp), %rax
testb $0x1, 0x20(%rax)
jne 0x1527e
leaq 0x3c0(%rsp), %rdi
callq 0x1a1e0
movq (%rax), %rax
movq %rax, 0x90(%rsp)
leaq 0x3c8(%rsp), %rdi
callq 0x1a1e0
movq 0x90(%rsp), %rdi
movq (%rax), %rsi
callq 0x120a0
movq %rax, 0x98(%rsp)
jmp 0x1515f
movq 0x98(%rsp), %rcx
movq 0x310(%rsp), %rax
movq %rcx, 0x30(%rax)
movq 0x428(%rsp), %rdi
movzbl 0x3c(%rdi), %esi
andl $0x1, %esi
callq 0x136e0
movq %rax, 0x88(%rsp)
jmp 0x15191
movq 0x88(%rsp), %rax
testb $0x1, 0x8(%rax)
jne 0x151cf
movq 0x428(%rsp), %rdi
movb 0x3c(%rdi), %al
notb %al
movzbl %al, %esi
andl $0x1, %esi
callq 0x136e0
movq %rax, 0x80(%rsp)
jmp 0x151c1
movq 0x80(%rsp), %rax
testb $0x1, 0x8(%rax)
je 0x151ec
leaq 0x249a0(%rip), %rdi     # 0x39b76
xorl %eax, %eax
callq 0xb840
jmp 0x151df
xorl %esi, %esi
movl %esi, %edi
callq 0xbe90
jmp 0x151ea
jmp 0x151ec
movq 0x310(%rsp), %rax
movq 0x30(%rax), %rax
movq %rax, 0x60(%rsp)
movq 0x428(%rsp), %rdi
movq 0x30(%rdi), %rax
movq %rax, 0x68(%rsp)
movl 0x38(%rdi), %eax
movl %eax, 0x74(%rsp)
movzbl 0x3c(%rdi), %esi
andl $0x1, %esi
callq 0x136e0
movq %rax, 0x78(%rsp)
jmp 0x15228
movq 0x78(%rsp), %rax
movq 0x10(%rax), %rax
movq %rax, 0x50(%rsp)
movq 0x428(%rsp), %rdi
movb 0x3c(%rdi), %al
notb %al
movzbl %al, %esi
andl $0x1, %esi
callq 0x136e0
movq %rax, 0x58(%rsp)
jmp 0x15255
movq 0x50(%rsp), %r8
movl 0x74(%rsp), %edx
movq 0x68(%rsp), %rsi
movq 0x60(%rsp), %rdi
movq 0x58(%rsp), %rax
movq 0x10(%rax), %r9
xorl %eax, %eax
movl %eax, %ecx
callq 0x12360
jmp 0x1527c
jmp 0x1527e
movq 0x310(%rsp), %rax
movb $0x1, 0x38(%rax)
movq 0x310(%rsp), %rax
movl $0x2, 0x3c(%rax)
movq 0x408(%rsp), %rdi
movq 0x310(%rsp), %rsi
xorl %edx, %edx
callq 0x129a0
jmp 0x152b2
movq 0x400(%rsp), %rdi
movq 0x310(%rsp), %rsi
movl $0x1, %edx
callq 0x129a0
jmp 0x152ce
leaq 0x3c8(%rsp), %rdi
callq 0x1a1e0
movl 0x8(%rax), %ecx
addl $-0x1, %ecx
movl %ecx, 0x8(%rax)
leaq 0x3c0(%rsp), %rdi
callq 0x1a1e0
movl 0x8(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x8(%rax)
jmp 0x14de3
movl $0x0, 0x30c(%rsp)
cmpl $0x2, 0x30c(%rsp)
jge 0x1536f
movq 0x428(%rsp), %rdi
movl 0x30c(%rsp), %eax
testl %eax, %eax
setne %al
movzbl %al, %esi
callq 0x136e0
movq %rax, 0x48(%rsp)
jmp 0x15337
movq 0x48(%rsp), %rdi
movq 0x428(%rsp), %rsi
movl 0x30c(%rsp), %eax
testl %eax, %eax
setne %al
movzbl %al, %edx
callq 0x13750
jmp 0x1535a
jmp 0x1535c
movl 0x30c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x30c(%rsp)
jmp 0x1530a
movq 0x5e0(%rsp), %rdi
movq 0x428(%rsp), %rsi
callq 0x137f0
jmp 0x15386
movb $0x1, 0x59f(%rsp)
leaq 0x3d0(%rsp), %rdi
callq 0x1a330
jmp 0x1539d
testb $0x1, 0x59f(%rsp)
je 0x153e9
movb $0x0, 0x59f(%rsp)
movq 0x5d8(%rsp), %rax
movq (%rax), %rdi
callq 0x19f10
movq %rax, 0x2f8(%rsp)
movq 0x2f8(%rsp), %rax
movq %rax, 0x5a8(%rsp)
movq 0x5a8(%rsp), %rax
movq %rax, 0x300(%rsp)
jmp 0x15400
leaq 0x5a8(%rsp), %rdi
xorl %esi, %esi
callq 0x1a020
movq %rax, 0x2f0(%rsp)
jmp 0x1473f
movq 0x5d8(%rsp), %rax
testb $0x1, 0x8(%rax)
je 0x1542a
leaq 0x247a7(%rip), %rdi     # 0x39bc1
movb $0x0, %al
callq 0xb840
xorl %esi, %esi
movl %esi, %edi
callq 0xbe90
movq 0x5e0(%rsp), %rdi
movq 0x5d8(%rsp), %rax
movb 0x8(%rax), %al
andb $0x1, %al
movzbl %al, %esi
callq 0x12b40
movq %rax, %rcx
movq 0x5b8(%rsp), %rax
movq %rcx, (%rax)
movq 0x5e0(%rsp), %rdi
movq 0x5d8(%rsp), %rax
movb 0x8(%rax), %al
andb $0x1, %al
movzbl %al, %esi
callq 0x12b40
movq %rax, %rcx
movq 0x5b0(%rsp), %rax
movq %rcx, (%rax)
movq 0x5f0(%rsp), %rcx
movq 0x5b8(%rsp), %rax
movq (%rax), %rax
movq %rcx, 0x10(%rax)
movq 0x5f8(%rsp), %rcx
movq 0x5b0(%rsp), %rax
movq (%rax), %rax
movq %rcx, 0x10(%rax)
movl $0x2, 0x2ec(%rsp)
movq 0x5d8(%rsp), %rax
movq (%rax), %rdi
callq 0x19f10
movq %rax, 0x2e0(%rsp)
movq 0x2e0(%rsp), %rax
movq %rax, 0x5a8(%rsp)
movq 0x5d8(%rsp), %rax
movq (%rax), %rdi
callq 0x19f60
movq %rax, 0x2d8(%rsp)
leaq 0x5a8(%rsp), %rdi
leaq 0x2d8(%rsp), %rsi
callq 0x19f40
testb $0x1, %al
jne 0x15517
jmp 0x1559a
cmpl $0x2, 0x2ec(%rsp)
jne 0x1553d
leaq 0x5a8(%rsp), %rdi
callq 0x19f90
movq (%rax), %rax
movl 0x40(%rax), %eax
movl %eax, 0x2ec(%rsp)
jmp 0x1557c
leaq 0x5a8(%rsp), %rdi
callq 0x19f90
movq (%rax), %rax
cmpl $0x2, 0x40(%rax)
je 0x1557a
leaq 0x5a8(%rsp), %rdi
callq 0x19f90
movq (%rax), %rax
movl 0x40(%rax), %eax
cmpl 0x2ec(%rsp), %eax
je 0x1557a
movl $0xfffffffe, 0x2ec(%rsp) # imm = 0xFFFFFFFE
jmp 0x1557c
jmp 0x1557e
leaq 0x5a8(%rsp), %rdi
xorl %esi, %esi
callq 0x1a020
movq %rax, 0x2d0(%rsp)
jmp 0x154e1
leaq 0x2a0(%rsp), %rdi
callq 0x1a340
leaq 0x298(%rsp), %rdi
callq 0x1a350
movq 0x5d8(%rsp), %rax
movq (%rax), %rdi
callq 0x19f10
movq %rax, 0x290(%rsp)
movq 0x290(%rsp), %rax
movq %rax, 0x5a8(%rsp)
movq 0x5d8(%rsp), %rax
movq (%rax), %rdi
callq 0x19f60
movq %rax, 0x288(%rsp)
leaq 0x5a8(%rsp), %rdi
leaq 0x288(%rsp), %rsi
callq 0x19f40
testb $0x1, %al
jne 0x15612
jmp 0x158ba
leaq 0x5a8(%rsp), %rdi
movq %rdi, 0x40(%rsp)
callq 0x19f90
movq 0x40(%rsp), %rdi
movq (%rax), %rax
movq %rax, 0x280(%rsp)
callq 0x19f90
movzbl 0x8(%rax), %eax
andl $0x1, %eax
movl %eax, 0x27c(%rsp)
movq 0x5d8(%rsp), %rdi
movq 0x280(%rsp), %rsi
movl 0x27c(%rsp), %eax
testl %eax, %eax
setne %al
movzbl %al, %edx
callq 0x13750
jmp 0x1566d
movq 0x280(%rsp), %rax
cmpl $0x0, 0x40(%rax)
je 0x15693
movq 0x280(%rsp), %rax
cmpl $0x2, 0x40(%rax)
jne 0x156df
cmpl $0x1, 0x2ec(%rsp)
je 0x156df
movq 0x5b8(%rsp), %rax
movq (%rax), %rdi
movq 0x280(%rsp), %rsi
movl 0x27c(%rsp), %edx
callq 0x12a40
jmp 0x156b4
jmp 0x158b5
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x3a8(%rsp)
movl %eax, 0x3a4(%rsp)
leaq 0x2a0(%rsp), %rdi
callq 0x1a5c0
jmp 0x1613e
movq 0x280(%rsp), %rax
cmpl $0x1, 0x40(%rax)
je 0x1570d
movq 0x280(%rsp), %rax
cmpl $0x2, 0x40(%rax)
jne 0x158b3
cmpl $0x1, 0x2ec(%rsp)
jne 0x158b3
movq 0x5b0(%rsp), %rax
movq (%rax), %rdi
movq 0x280(%rsp), %rsi
movl 0x27c(%rsp), %edx
callq 0x12a40
jmp 0x1572e
cmpl $-0x2, 0x2ec(%rsp)
jne 0x158b1
movq 0x280(%rsp), %rax
movq (%rax), %rdi
callq 0x19d80
movq %rax, 0x270(%rsp)
movq 0x270(%rsp), %rax
movq %rax, 0x5a0(%rsp)
movq 0x280(%rsp), %rax
movq (%rax), %rdi
callq 0x19dd0
movq %rax, 0x268(%rsp)
leaq 0x5a0(%rsp), %rdi
leaq 0x268(%rsp), %rsi
callq 0x19db0
testb $0x1, %al
jne 0x1579a
jmp 0x158af
leaq 0x5a0(%rsp), %rdi
movq %rdi, 0x28(%rsp)
callq 0x19e00
movq 0x28(%rsp), %rdi
movzbl 0x8(%rax), %eax
andl $0x1, %eax
movl 0x27c(%rsp), %ecx
testl %ecx, %ecx
setne %cl
movzbl %cl, %ecx
subl %ecx, %eax
sete %al
movzbl %al, %ecx
movl %ecx, %eax
leal -0x1(%rax,%rax), %eax
movl %eax, 0x34(%rsp)
callq 0x19e00
movq %rax, %rsi
leaq 0x2a0(%rsp), %rdi
callq 0x1a370
movq %rax, 0x38(%rsp)
jmp 0x157f5
movq 0x38(%rsp), %rax
movl 0x34(%rsp), %edx
movl (%rax), %ecx
addl %edx, %ecx
movl %ecx, (%rax)
leaq 0x5a0(%rsp), %rdi
callq 0x19e00
movq %rax, %rsi
leaq 0x2a0(%rsp), %rdi
callq 0x1a470
movq %rax, 0x20(%rsp)
jmp 0x15828
movq 0x20(%rsp), %rax
movq %rax, 0x260(%rsp)
movq 0x260(%rsp), %rax
movq %rax, 0x298(%rsp)
leaq 0x298(%rsp), %rdi
callq 0x1a4a0
cmpl $0x0, 0x8(%rax)
jne 0x15891
movq 0x298(%rsp), %rax
movq %rax, 0x258(%rsp)
movq 0x258(%rsp), %rsi
leaq 0x2a0(%rsp), %rdi
callq 0x1a4c0
movq %rax, 0x18(%rsp)
jmp 0x15884
movq 0x18(%rsp), %rax
movq %rax, 0x250(%rsp)
jmp 0x15893
leaq 0x5a0(%rsp), %rdi
xorl %esi, %esi
callq 0x19e90
movq %rax, 0x248(%rsp)
jmp 0x15764
jmp 0x158b1
jmp 0x158b3
jmp 0x158b5
jmp 0x155b4
cmpl $-0x2, 0x2ec(%rsp)
jne 0x15ad4
movq 0x5e0(%rsp), %rdi
movq 0x5d8(%rsp), %rax
movzbl 0x8(%rax), %esi
andl $0x1, %esi
callq 0x128e0
movq %rax, 0x10(%rsp)
jmp 0x158eb
movq 0x10(%rsp), %rax
movq %rax, 0x240(%rsp)
movq 0x240(%rsp), %rax
testb $0x1, 0x8(%rax)
jne 0x15938
movq 0x5d0(%rsp), %rcx
movq 0x240(%rsp), %rax
movq %rcx, 0x30(%rax)
movl 0x5cc(%rsp), %ecx
movq 0x240(%rsp), %rax
movl %ecx, 0x38(%rax)
movq 0x240(%rsp), %rax
movb $0x0, 0x3c(%rax)
movq 0x240(%rsp), %rax
movb $0x1, 0x3d(%rax)
movq 0x240(%rsp), %rax
movl $0x2, 0x40(%rax)
movq 0x240(%rsp), %rdi
movq 0x5b8(%rsp), %rax
movq (%rax), %rsi
movq 0x5b0(%rsp), %rax
movq (%rax), %rdx
callq 0x12b00
jmp 0x15978
leaq 0x2a0(%rsp), %rdi
callq 0x1a500
movq %rax, 0x238(%rsp)
movq 0x238(%rsp), %rax
movq %rax, 0x298(%rsp)
leaq 0x2a0(%rsp), %rdi
callq 0x1a550
movq %rax, 0x230(%rsp)
leaq 0x298(%rsp), %rdi
leaq 0x230(%rsp), %rsi
callq 0x1a530
testb $0x1, %al
jne 0x159d0
jmp 0x15ad2
leaq 0x298(%rsp), %rdi
callq 0x1a4a0
movq (%rax), %rax
cmpl $0x2, 0x3c(%rax)
je 0x15a03
leaq 0x2420f(%rip), %rdi     # 0x39bfc
xorl %eax, %eax
callq 0xb840
jmp 0x159f6
xorl %esi, %esi
movl %esi, %edi
callq 0xbe90
jmp 0x15a01
jmp 0x15a03
jmp 0x15a05
leaq 0x298(%rsp), %rdi
callq 0x1a4a0
cmpl $0x0, 0x8(%rax)
jle 0x15a5b
movq 0x240(%rsp), %rax
movq %rax, 0x8(%rsp)
leaq 0x298(%rsp), %rdi
callq 0x1a4a0
movq 0x8(%rsp), %rdi
movq (%rax), %rsi
xorl %edx, %edx
callq 0x129a0
jmp 0x15a43
leaq 0x298(%rsp), %rdi
callq 0x1a4a0
movl 0x8(%rax), %ecx
addl $-0x1, %ecx
movl %ecx, 0x8(%rax)
jmp 0x15a05
jmp 0x15a5d
leaq 0x298(%rsp), %rdi
callq 0x1a4a0
cmpl $0x0, 0x8(%rax)
jge 0x15ab4
movq 0x240(%rsp), %rax
movq %rax, (%rsp)
leaq 0x298(%rsp), %rdi
callq 0x1a4a0
movq (%rsp), %rdi
movq (%rax), %rsi
movl $0x1, %edx
callq 0x129a0
jmp 0x15a9c
leaq 0x298(%rsp), %rdi
callq 0x1a4a0
movl 0x8(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x8(%rax)
jmp 0x15a5d
jmp 0x15ab6
leaq 0x298(%rsp), %rdi
xorl %esi, %esi
callq 0x1a580
movq %rax, 0x228(%rsp)
jmp 0x1599d
jmp 0x15ad4
movq 0x5b8(%rsp), %rax
movq (%rax), %rax
movq %rax, 0x210(%rsp)
movq 0x5b0(%rsp), %rax
movq (%rax), %rax
movq %rax, 0x218(%rsp)
movl $0x0, 0x20c(%rsp)
cmpl $0x2, 0x20c(%rsp)
jge 0x15c7a
movslq 0x20c(%rsp), %rax
movq 0x210(%rsp,%rax,8), %rax
movq (%rax), %rdi
callq 0x19f10
movq %rax, 0x200(%rsp)
movq 0x200(%rsp), %rax
movq %rax, 0x5a8(%rsp)
movslq 0x20c(%rsp), %rax
movq 0x210(%rsp,%rax,8), %rax
movq (%rax), %rdi
callq 0x19f60
movq %rax, 0x1f8(%rsp)
leaq 0x5a8(%rsp), %rdi
leaq 0x1f8(%rsp), %rsi
callq 0x19f40
testb $0x1, %al
jne 0x15b81
jmp 0x15c62
leaq 0x5a8(%rsp), %rdi
callq 0x19f90
movq (%rax), %rax
movq (%rax), %rdi
callq 0x19d80
movq %rax, 0x1f0(%rsp)
movq 0x1f0(%rsp), %rax
movq %rax, 0x5a0(%rsp)
leaq 0x5a8(%rsp), %rdi
callq 0x19f90
movq (%rax), %rax
movq (%rax), %rdi
callq 0x19dd0
movq %rax, 0x1e8(%rsp)
leaq 0x5a0(%rsp), %rdi
leaq 0x1e8(%rsp), %rsi
callq 0x19db0
testb $0x1, %al
jne 0x15bec
jmp 0x15c44
leaq 0x5a0(%rsp), %rdi
callq 0x19e00
movq (%rax), %rax
movb $0x0, 0x41(%rax)
leaq 0x5a0(%rsp), %rdi
callq 0x19e00
movq (%rax), %rax
movb $0x0, 0x40(%rax)
leaq 0x5a0(%rsp), %rdi
callq 0x19e00
movq (%rax), %rax
movb $0x0, 0x38(%rax)
leaq 0x5a0(%rsp), %rdi
xorl %esi, %esi
callq 0x19e90
movq %rax, 0x1e0(%rsp)
jmp 0x15bb1
jmp 0x15c46
leaq 0x5a8(%rsp), %rdi
xorl %esi, %esi
callq 0x1a020
movq %rax, 0x1d8(%rsp)
jmp 0x15b43
jmp 0x15c64
movl 0x20c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x20c(%rsp)
jmp 0x15b05
movl $0x0, 0x1d4(%rsp)
cmpl $0x2, 0x1d4(%rsp)
jge 0x15dd8
movslq 0x1d4(%rsp), %rax
movq 0x210(%rsp,%rax,8), %rax
movq (%rax), %rdi
callq 0x19f10
movq %rax, 0x1c8(%rsp)
movq 0x1c8(%rsp), %rax
movq %rax, 0x5a8(%rsp)
movslq 0x1d4(%rsp), %rax
movq 0x210(%rsp,%rax,8), %rax
movq (%rax), %rdi
callq 0x19f60
movq %rax, 0x1c0(%rsp)
leaq 0x5a8(%rsp), %rdi
leaq 0x1c0(%rsp), %rsi
callq 0x19f40
testb $0x1, %al
jne 0x15d01
jmp 0x15dc0
leaq 0x5a8(%rsp), %rdi
callq 0x19f90
movq (%rax), %rax
movq (%rax), %rdi
callq 0x19d80
movq %rax, 0x1b8(%rsp)
movq 0x1b8(%rsp), %rax
movq %rax, 0x5a0(%rsp)
leaq 0x5a8(%rsp), %rdi
callq 0x19f90
movq (%rax), %rax
movq (%rax), %rdi
callq 0x19dd0
movq %rax, 0x1b0(%rsp)
leaq 0x5a0(%rsp), %rdi
leaq 0x1b0(%rsp), %rsi
callq 0x19db0
testb $0x1, %al
jne 0x15d6c
jmp 0x15da2
leaq 0x5a0(%rsp), %rdi
callq 0x19e00
movq (%rax), %rax
movslq 0x1d4(%rsp), %rcx
movb $0x1, 0x40(%rax,%rcx)
leaq 0x5a0(%rsp), %rdi
xorl %esi, %esi
callq 0x19e90
movq %rax, 0x1a8(%rsp)
jmp 0x15d31
jmp 0x15da4
leaq 0x5a8(%rsp), %rdi
xorl %esi, %esi
callq 0x1a020
movq %rax, 0x1a0(%rsp)
jmp 0x15cc3
jmp 0x15dc2
movl 0x1d4(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x1d4(%rsp)
jmp 0x15c85
movl $0x0, 0x19c(%rsp)
cmpl $0x2, 0x19c(%rsp)
jge 0x16112
movslq 0x19c(%rsp), %rax
movq 0x210(%rsp,%rax,8), %rax
movq (%rax), %rdi
callq 0x19f10
movq %rax, 0x190(%rsp)
movq 0x190(%rsp), %rax
movq %rax, 0x5a8(%rsp)
movslq 0x19c(%rsp), %rax
movq 0x210(%rsp,%rax,8), %rax
movq (%rax), %rdi
callq 0x19f60
movq %rax, 0x188(%rsp)
leaq 0x5a8(%rsp), %rdi
leaq 0x188(%rsp), %rsi
callq 0x19f40
testb $0x1, %al
jne 0x15e5f
jmp 0x160fa
leaq 0x5a8(%rsp), %rdi
callq 0x19f90
movq (%rax), %rax
movq (%rax), %rdi
callq 0x19d80
movq %rax, 0x180(%rsp)
movq 0x180(%rsp), %rax
movq %rax, 0x5a0(%rsp)
leaq 0x5a8(%rsp), %rdi
callq 0x19f90
movq (%rax), %rax
movq (%rax), %rdi
callq 0x19dd0
movq %rax, 0x178(%rsp)
leaq 0x5a0(%rsp), %rdi
leaq 0x178(%rsp), %rsi
callq 0x19db0
testb $0x1, %al
jne 0x15ecd
jmp 0x160dc
leaq 0x5a0(%rsp), %rdi
callq 0x19e00
movq (%rax), %rax
testb $0x1, 0x38(%rax)
je 0x15ee8
jmp 0x160c0
leaq 0x5a0(%rsp), %rdi
callq 0x19e00
movq (%rax), %rax
movb $0x1, 0x38(%rax)
leaq 0x5a0(%rsp), %rdi
callq 0x19e00
movq (%rax), %rax
testb $0x1, 0x20(%rax)
jne 0x160be
leaq 0x5a0(%rsp), %rdi
callq 0x19e00
movq (%rax), %rax
testb $0x1, 0x40(%rax)
je 0x15fc4
leaq 0x5a0(%rsp), %rdi
callq 0x19e00
movq (%rax), %rax
testb $0x1, 0x41(%rax)
je 0x15fc4
leaq 0x5a0(%rsp), %rdi
callq 0x19e00
movq (%rax), %rax
cmpl $0x2, 0x3c(%rax)
je 0x15f79
leaq 0x23c99(%rip), %rdi     # 0x39bfc
xorl %eax, %eax
callq 0xb840
jmp 0x15f6c
xorl %esi, %esi
movl %esi, %edi
callq 0xbe90
jmp 0x15f77
jmp 0x15f79
leaq 0x5a0(%rsp), %rdi
callq 0x19e00
movq (%rax), %rax
movq 0x30(%rax), %rdi
movq 0x5d0(%rsp), %rsi
movl 0x5cc(%rsp), %edx
movq 0x5d8(%rsp), %rax
movq 0x10(%rax), %rcx
movq 0x5f0(%rsp), %r8
movq 0x5f8(%rsp), %r9
callq 0x12360
jmp 0x15fbf
jmp 0x160bc
leaq 0x5a0(%rsp), %rdi
callq 0x19e00
movq (%rax), %rax
testb $0x1, 0x40(%rax)
je 0x1603e
leaq 0x5a0(%rsp), %rdi
callq 0x19e00
movq (%rax), %rax
cmpl $0x1, 0x3c(%rax)
jne 0x1600d
leaq 0x23c05(%rip), %rdi     # 0x39bfc
xorl %eax, %eax
callq 0xb840
jmp 0x16000
xorl %esi, %esi
movl %esi, %edi
callq 0xbe90
jmp 0x1600b
jmp 0x1600d
leaq 0x5a0(%rsp), %rdi
callq 0x19e00
movq (%rax), %rax
movq 0x30(%rax), %rdi
movq 0x5d8(%rsp), %rax
movq 0x10(%rax), %rsi
movq 0x5f0(%rsp), %rdx
callq 0x12580
jmp 0x1603c
jmp 0x160ba
leaq 0x5a0(%rsp), %rdi
callq 0x19e00
movq (%rax), %rax
testb $0x1, 0x41(%rax)
je 0x160b8
leaq 0x5a0(%rsp), %rdi
callq 0x19e00
movq (%rax), %rax
cmpl $0x0, 0x3c(%rax)
jne 0x16087
leaq 0x23b8b(%rip), %rdi     # 0x39bfc
xorl %eax, %eax
callq 0xb840
jmp 0x1607a
xorl %esi, %esi
movl %esi, %edi
callq 0xbe90
jmp 0x16085
jmp 0x16087
leaq 0x5a0(%rsp), %rdi
callq 0x19e00
movq (%rax), %rax
movq 0x30(%rax), %rdi
movq 0x5d8(%rsp), %rax
movq 0x10(%rax), %rsi
movq 0x5f8(%rsp), %rdx
callq 0x12580
jmp 0x160b6
jmp 0x160b8
jmp 0x160ba
jmp 0x160bc
jmp 0x160be
jmp 0x160c0
leaq 0x5a0(%rsp), %rdi
xorl %esi, %esi
callq 0x19e90
movq %rax, 0x170(%rsp)
jmp 0x15e8f
jmp 0x160de
leaq 0x5a8(%rsp), %rdi
xorl %esi, %esi
callq 0x1a020
movq %rax, 0x168(%rsp)
jmp 0x15e21
jmp 0x160fc
movl 0x19c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x19c(%rsp)
jmp 0x15de3
movq 0x5e0(%rsp), %rdi
movq 0x5d8(%rsp), %rsi
callq 0x13990
jmp 0x16129
leaq 0x2a0(%rsp), %rdi
callq 0x1a5c0
addq $0x5e8, %rsp            # imm = 0x5E8
retq
movq 0x3a8(%rsp), %rdi
callq 0x4520
nopl (%rax,%rax)