// File: FreeSlave[P]vhlt/hlrad/qradutil.cpp
// Function: FindFacePositions(int)
void FindFacePositions (int facenum)
	// this function must be called after g_face_offset and g_face_centroids and g_edgeshare have been calculated
{
	dface_t *f;
	positionmap_t *map;
	texinfo_t *ti;
	vec3_t v;
	const vec3_t v_up = {0, 0, 1};
	vec_t density;
	vec_t texmins[2], texmaxs[2];
	int imins[2], imaxs[2];
	int is, it;
	int x;
	int k;

	f = &g_dfaces[facenum];
	map = &g_face_positions[facenum];
	map->valid = true;
	map->facenum = facenum;
	map->facewinding = NULL;
	map->facewindingwithoffset = NULL;
	map->texwinding = NULL;
	map->grid = NULL;
	
	ti = &g_texinfo[f->texinfo];
	if (ti->flags & TEX_SPECIAL)
	{
		map->valid = false;
		return;
	}

	VectorCopy (g_face_offset[facenum], map->face_offset);
	VectorCopy (g_face_centroids[facenum], map->face_centroid);
	TranslateWorldToTex (facenum, map->worldtotex);
	if (!InvertMatrix (map->worldtotex, map->textoworld))
	{
		map->valid = false;
		return;
	}
	
	map->facewinding = new Winding (*f);
	map->faceplane = *getPlaneFromFace (f);
	map->facewindingwithoffset = new Winding (map->facewinding->m_NumPoints);
	for (x = 0; x < map->facewinding->m_NumPoints; x++)
	{
		VectorAdd (map->facewinding->m_Points[x], map->face_offset, map->facewindingwithoffset->m_Points[x]);
	}
	map->faceplanewithoffset = map->faceplane;
	map->faceplanewithoffset.dist = map->faceplane.dist + DotProduct (map->face_offset, map->faceplane.normal);

	map->texwinding = new Winding (map->facewinding->m_NumPoints);
	for (x = 0; x < map->facewinding->m_NumPoints; x++)
	{
		ApplyMatrix (map->worldtotex, map->facewinding->m_Points[x], map->texwinding->m_Points[x]);
		map->texwinding->m_Points[x][2] = 0.0;
	}
	map->texwinding->RemoveColinearPoints ();
	VectorCopy (v_up, map->texplane.normal);
	if (CalcMatrixSign (map->worldtotex) < 0.0)
	{
		map->texplane.normal[2] *= -1;
	}
	map->texplane.dist = 0.0;
	if (map->texwinding->m_NumPoints == 0)
	{
		delete map->facewinding;
		map->facewinding = NULL;
		delete map->facewindingwithoffset;
		map->facewindingwithoffset = NULL;
		delete map->texwinding;
		map->texwinding = NULL;
		map->valid = false;
		return;
	}
	VectorSubtract (map->face_centroid, map->face_offset, v);
	ApplyMatrix (map->worldtotex, v, map->texcentroid);
	map->texcentroid[2] = 0.0;

	for (x = 0; x < map->texwinding->m_NumPoints; x++)
	{
		for (k = 0; k < 2; k++)
		{
			if (x == 0 || map->texwinding->m_Points[x][k] < texmins[k])
				texmins[k] = map->texwinding->m_Points[x][k];
			if (x == 0 || map->texwinding->m_Points[x][k] > texmaxs[k])
				texmaxs[k] = map->texwinding->m_Points[x][k];
		}
	}
	density = 3.0;
#ifdef HLRAD_FASTMODE
	if (g_fastmode)
	{
		density = 1.0;
	}
#endif
	map->step[0] = (vec_t)TEXTURE_STEP / density;
	map->step[1] = (vec_t)TEXTURE_STEP / density;
	map->step[2] = 1.0;
	for (k = 0; k < 2; k++)
	{
		imins[k] = (int)floor (texmins[k] / map->step[k] + 0.5 - ON_EPSILON);
		imaxs[k] = (int)ceil (texmaxs[k] / map->step[k] - 0.5 + ON_EPSILON);
	}
	map->start[0] = (imins[0] - 0.5) * map->step[0];
	map->start[1] = (imins[1] - 0.5) * map->step[1];
	map->start[2] = 0.0;
	map->w = imaxs[0] - imins[0] + 1;
	map->h = imaxs[1] - imins[1] + 1;
	if (map->w <= 0 || map->h <= 0 || (double)map->w * (double)map->h > 99999999)
	{
		delete map->facewinding;
		map->facewinding = NULL;
		delete map->facewindingwithoffset;
		map->facewindingwithoffset = NULL;
		delete map->texwinding;
		map->texwinding = NULL;
		map->valid = false;
		return;
	}

	map->grid = (position_t *)malloc (map->w * map->h * sizeof (position_t));
	hlassume (map->grid != NULL, assume_NoMemory);

	for (it = 0; it < map->h; it++)
	{
		for (is = 0; is < map->w; is++)
		{
			CalcSinglePosition (map, is, it);
		}
	}

	return;
}

// Assembly:
subq $0xd8, %rsp
movl %edi, 0xd4(%rsp)
movq 0x12f7b(%rip), %rax     # 0x71900
movq %rax, 0xa0(%rsp)
movl 0x12f75(%rip), %eax     # 0x71908
movl %eax, 0xa8(%rsp)
movslq 0xd4(%rsp), %rcx
leaq 0x1b87a67(%rip), %rax   # 0x1be6410
imulq $0x14, %rcx, %rcx
addq %rcx, %rax
movq %rax, 0xc8(%rsp)
movslq 0xd4(%rsp), %rcx
leaq 0x55d1229(%rip), %rax   # 0x562fbf0
imulq $0x110, %rcx, %rcx      # imm = 0x110
addq %rcx, %rax
movq %rax, 0xc0(%rsp)
movq 0xc0(%rsp), %rax
movb $0x1, (%rax)
movl 0xd4(%rsp), %ecx
movq 0xc0(%rsp), %rax
movl %ecx, 0x4(%rax)
movq 0xc0(%rsp), %rax
movq $0x0, 0x80(%rax)
movq 0xc0(%rsp), %rax
movq $0x0, 0xa0(%rax)
movq 0xc0(%rsp), %rax
movq $0x0, 0xc0(%rax)
movq 0xc0(%rsp), %rax
movq $0x0, 0x108(%rax)
movq 0xc8(%rsp), %rax
movswq 0xa(%rax), %rcx
leaq 0x11879aa(%rip), %rax   # 0x11e6400
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movq %rax, 0xb8(%rsp)
movq 0xb8(%rsp), %rax
movl 0x24(%rax), %eax
andl $0x1, %eax
cmpl $0x0, %eax
je 0x5ea88
movq 0xc0(%rsp), %rax
movb $0x0, (%rax)
jmp 0x5f6df
movslq 0xd4(%rsp), %rcx
leaq 0x540ef79(%rip), %rax   # 0x546da10
imulq $0xc, %rcx, %rcx
addq %rcx, %rax
movss (%rax), %xmm0
movq 0xc0(%rsp), %rax
movss %xmm0, 0x8(%rax)
movslq 0xd4(%rsp), %rcx
leaq 0x540ef52(%rip), %rax   # 0x546da10
imulq $0xc, %rcx, %rcx
addq %rcx, %rax
movss 0x4(%rax), %xmm0
movq 0xc0(%rsp), %rax
movss %xmm0, 0xc(%rax)
movslq 0xd4(%rsp), %rcx
leaq 0x540ef2a(%rip), %rax   # 0x546da10
imulq $0xc, %rcx, %rcx
addq %rcx, %rax
movss 0x8(%rax), %xmm0
movq 0xc0(%rsp), %rax
movss %xmm0, 0x10(%rax)
movslq 0xd4(%rsp), %rcx
leaq 0x4c1ae22(%rip), %rax   # 0x4c79930
imulq $0xc, %rcx, %rcx
addq %rcx, %rax
movss (%rax), %xmm0
movq 0xc0(%rsp), %rax
movss %xmm0, 0x14(%rax)
movslq 0xd4(%rsp), %rcx
leaq 0x4c1adfb(%rip), %rax   # 0x4c79930
imulq $0xc, %rcx, %rcx
addq %rcx, %rax
movss 0x4(%rax), %xmm0
movq 0xc0(%rsp), %rax
movss %xmm0, 0x18(%rax)
movslq 0xd4(%rsp), %rcx
leaq 0x4c1add3(%rip), %rax   # 0x4c79930
imulq $0xc, %rcx, %rcx
addq %rcx, %rax
movss 0x8(%rax), %xmm0
movq 0xc0(%rsp), %rax
movss %xmm0, 0x1c(%rax)
movl 0xd4(%rsp), %edi
movq 0xc0(%rsp), %rsi
addq $0x20, %rsi
callq 0x5dfe0
movq 0xc0(%rsp), %rdi
addq $0x20, %rdi
movq 0xc0(%rsp), %rsi
addq $0x50, %rsi
callq 0x5e120
testb $0x1, %al
jne 0x5ebbf
movq 0xc0(%rsp), %rax
movb $0x0, (%rax)
jmp 0x5f6df
movl $0x20, %edi
callq 0x4320
movq %rax, %rdi
movq %rdi, %rax
movq %rax, 0x50(%rsp)
movq 0xc8(%rsp), %rsi
movss 0xefac(%rip), %xmm0     # 0x6db90
callq 0xf130
jmp 0x5ebeb
movq 0x50(%rsp), %rcx
movq 0xc0(%rsp), %rax
movq %rcx, 0x80(%rax)
movq 0xc8(%rsp), %rdi
callq 0x5cfa0
movq %rax, %rcx
movq 0xc0(%rsp), %rax
movl 0x10(%rcx), %edx
movl %edx, 0x98(%rax)
movups (%rcx), %xmm0
movups %xmm0, 0x88(%rax)
movl $0x20, %edi
callq 0x4320
movq %rax, %rdi
movq %rdi, %rax
movq %rax, 0x48(%rsp)
movq 0xc0(%rsp), %rax
movq 0x80(%rax), %rax
movl 0x8(%rax), %esi
callq 0xe980
jmp 0x5ec58
movq 0x48(%rsp), %rcx
movq 0xc0(%rsp), %rax
movq %rcx, 0xa0(%rax)
movl $0x0, 0x70(%rsp)
movl 0x70(%rsp), %eax
movq 0xc0(%rsp), %rcx
movq 0x80(%rcx), %rcx
cmpl 0x8(%rcx), %eax
jae 0x5ede1
movq 0xc0(%rsp), %rax
movq 0x80(%rax), %rax
movq 0x10(%rax), %rax
movslq 0x70(%rsp), %rcx
imulq $0xc, %rcx, %rcx
addq %rcx, %rax
movss (%rax), %xmm0
movq 0xc0(%rsp), %rax
addss 0x8(%rax), %xmm0
movq 0xc0(%rsp), %rax
movq 0xa0(%rax), %rax
movq 0x10(%rax), %rax
movslq 0x70(%rsp), %rcx
imulq $0xc, %rcx, %rcx
addq %rcx, %rax
movss %xmm0, (%rax)
movq 0xc0(%rsp), %rax
movq 0x80(%rax), %rax
movq 0x10(%rax), %rax
movslq 0x70(%rsp), %rcx
imulq $0xc, %rcx, %rcx
addq %rcx, %rax
movss 0x4(%rax), %xmm0
movq 0xc0(%rsp), %rax
addss 0xc(%rax), %xmm0
movq 0xc0(%rsp), %rax
movq 0xa0(%rax), %rax
movq 0x10(%rax), %rax
movslq 0x70(%rsp), %rcx
imulq $0xc, %rcx, %rcx
addq %rcx, %rax
movss %xmm0, 0x4(%rax)
movq 0xc0(%rsp), %rax
movq 0x80(%rax), %rax
movq 0x10(%rax), %rax
movslq 0x70(%rsp), %rcx
imulq $0xc, %rcx, %rcx
addq %rcx, %rax
movss 0x8(%rax), %xmm0
movq 0xc0(%rsp), %rax
addss 0x10(%rax), %xmm0
movq 0xc0(%rsp), %rax
movq 0xa0(%rax), %rax
movq 0x10(%rax), %rax
movslq 0x70(%rsp), %rcx
imulq $0xc, %rcx, %rcx
addq %rcx, %rax
movss %xmm0, 0x8(%rax)
movl 0x70(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x70(%rsp)
jmp 0x5ec74
movq 0x50(%rsp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x60(%rsp)
movl %eax, 0x5c(%rsp)
movl $0x20, %esi
callq 0x4330
jmp 0x5f6e7
movq 0x48(%rsp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x60(%rsp)
movl %eax, 0x5c(%rsp)
movl $0x20, %esi
callq 0x4330
jmp 0x5f6e7
movq 0xc0(%rsp), %rax
movl 0x98(%rax), %ecx
movl %ecx, 0xb8(%rax)
movups 0x88(%rax), %xmm0
movups %xmm0, 0xa8(%rax)
movq 0xc0(%rsp), %rax
movq %rax, 0x38(%rsp)
movss 0x94(%rax), %xmm0
movss 0x88(%rax), %xmm3
movss 0x8(%rax), %xmm2
movss 0xc(%rax), %xmm1
movss 0x8c(%rax), %xmm4
mulss %xmm4, %xmm1
mulss %xmm3, %xmm2
addss %xmm1, %xmm2
movss 0x10(%rax), %xmm1
movss 0x90(%rax), %xmm3
mulss %xmm3, %xmm1
addss %xmm2, %xmm1
addss %xmm1, %xmm0
movss %xmm0, 0xb4(%rax)
movl $0x20, %edi
callq 0x4320
movq %rax, %rdi
movq %rdi, %rax
movq %rax, 0x40(%rsp)
movq 0xc0(%rsp), %rax
movq 0x80(%rax), %rax
movl 0x8(%rax), %esi
callq 0xe980
jmp 0x5ee8d
movq 0x40(%rsp), %rcx
movq 0xc0(%rsp), %rax
movq %rcx, 0xc0(%rax)
movl $0x0, 0x70(%rsp)
movl 0x70(%rsp), %eax
movq 0xc0(%rsp), %rcx
movq 0x80(%rcx), %rcx
cmpl 0x8(%rcx), %eax
jae 0x5ef6d
movq 0xc0(%rsp), %rdi
addq $0x20, %rdi
movq 0xc0(%rsp), %rax
movq 0x80(%rax), %rax
movq 0x10(%rax), %rsi
movslq 0x70(%rsp), %rax
imulq $0xc, %rax, %rax
addq %rax, %rsi
movq 0xc0(%rsp), %rax
movq 0xc0(%rax), %rax
movq 0x10(%rax), %rdx
movslq 0x70(%rsp), %rax
imulq $0xc, %rax, %rax
addq %rax, %rdx
callq 0x5d920
movq 0xc0(%rsp), %rax
movq 0xc0(%rax), %rax
movq 0x10(%rax), %rax
movslq 0x70(%rsp), %rcx
imulq $0xc, %rcx, %rcx
addq %rcx, %rax
xorps %xmm0, %xmm0
movss %xmm0, 0x8(%rax)
movl 0x70(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x70(%rsp)
jmp 0x5eea9
movq 0x40(%rsp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x60(%rsp)
movl %eax, 0x5c(%rsp)
movl $0x20, %esi
callq 0x4330
jmp 0x5f6e7
movq 0xc0(%rsp), %rax
movq 0xc0(%rax), %rdi
movss 0xec0c(%rip), %xmm0     # 0x6db90
callq 0xf2b0
movss 0xa0(%rsp), %xmm0
movq 0xc0(%rsp), %rax
movss %xmm0, 0xc8(%rax)
movss 0xa4(%rsp), %xmm0
movq 0xc0(%rsp), %rax
movss %xmm0, 0xcc(%rax)
movss 0xa8(%rsp), %xmm0
movq 0xc0(%rsp), %rax
movss %xmm0, 0xd0(%rax)
movq 0xc0(%rsp), %rdi
addq $0x20, %rdi
callq 0x5ded0
cvtss2sd %xmm0, %xmm1
xorps %xmm0, %xmm0
ucomisd %xmm1, %xmm0
jbe 0x5f012
movq 0xc0(%rsp), %rax
movss 0xe512(%rip), %xmm0     # 0x6d514
mulss 0xd0(%rax), %xmm0
movss %xmm0, 0xd0(%rax)
movq 0xc0(%rsp), %rax
xorps %xmm0, %xmm0
movss %xmm0, 0xd4(%rax)
movq 0xc0(%rsp), %rax
movq 0xc0(%rax), %rax
cmpl $0x0, 0x8(%rax)
jne 0x5f0f6
movq 0xc0(%rsp), %rax
movq 0x80(%rax), %rax
movq %rax, 0x30(%rsp)
cmpq $0x0, %rax
je 0x5f063
movq 0x30(%rsp), %rdi
movq (%rdi), %rax
callq *0x8(%rax)
movq 0xc0(%rsp), %rax
movq $0x0, 0x80(%rax)
movq 0xc0(%rsp), %rax
movq 0xa0(%rax), %rax
movq %rax, 0x28(%rsp)
cmpq $0x0, %rax
je 0x5f09b
movq 0x28(%rsp), %rdi
movq (%rdi), %rax
callq *0x8(%rax)
movq 0xc0(%rsp), %rax
movq $0x0, 0xa0(%rax)
movq 0xc0(%rsp), %rax
movq 0xc0(%rax), %rax
movq %rax, 0x20(%rsp)
cmpq $0x0, %rax
je 0x5f0d3
movq 0x20(%rsp), %rdi
movq (%rdi), %rax
callq *0x8(%rax)
movq 0xc0(%rsp), %rax
movq $0x0, 0xc0(%rax)
movq 0xc0(%rsp), %rax
movb $0x0, (%rax)
jmp 0x5f6df
movq 0xc0(%rsp), %rax
movss 0x14(%rax), %xmm0
movq 0xc0(%rsp), %rax
subss 0x8(%rax), %xmm0
movss %xmm0, 0xac(%rsp)
movq 0xc0(%rsp), %rax
movss 0x18(%rax), %xmm0
movq 0xc0(%rsp), %rax
subss 0xc(%rax), %xmm0
movss %xmm0, 0xb0(%rsp)
movq 0xc0(%rsp), %rax
movss 0x1c(%rax), %xmm0
movq 0xc0(%rsp), %rax
subss 0x10(%rax), %xmm0
movss %xmm0, 0xb4(%rsp)
movq 0xc0(%rsp), %rdi
addq $0x20, %rdi
leaq 0xac(%rsp), %rsi
movq 0xc0(%rsp), %rdx
addq $0xdc, %rdx
callq 0x5d920
movq 0xc0(%rsp), %rax
xorps %xmm0, %xmm0
movss %xmm0, 0xe4(%rax)
movl $0x0, 0x70(%rsp)
movl 0x70(%rsp), %eax
movq 0xc0(%rsp), %rcx
movq 0xc0(%rcx), %rcx
cmpl 0x8(%rcx), %eax
jae 0x5f2e5
movl $0x0, 0x6c(%rsp)
cmpl $0x2, 0x6c(%rsp)
jge 0x5f2d3
cmpl $0x0, 0x70(%rsp)
je 0x5f214
movq 0xc0(%rsp), %rax
movq 0xc0(%rax), %rax
movq 0x10(%rax), %rax
movslq 0x70(%rsp), %rcx
imulq $0xc, %rcx, %rcx
addq %rcx, %rax
movslq 0x6c(%rsp), %rcx
movss (%rax,%rcx,4), %xmm1
movslq 0x6c(%rsp), %rax
movss 0x94(%rsp,%rax,4), %xmm0
ucomiss %xmm1, %xmm0
jbe 0x5f24b
movq 0xc0(%rsp), %rax
movq 0xc0(%rax), %rax
movq 0x10(%rax), %rax
movslq 0x70(%rsp), %rcx
imulq $0xc, %rcx, %rcx
addq %rcx, %rax
movslq 0x6c(%rsp), %rcx
movss (%rax,%rcx,4), %xmm0
movslq 0x6c(%rsp), %rax
movss %xmm0, 0x94(%rsp,%rax,4)
cmpl $0x0, 0x70(%rsp)
je 0x5f28a
movq 0xc0(%rsp), %rax
movq 0xc0(%rax), %rax
movq 0x10(%rax), %rax
movslq 0x70(%rsp), %rcx
imulq $0xc, %rcx, %rcx
addq %rcx, %rax
movslq 0x6c(%rsp), %rcx
movss (%rax,%rcx,4), %xmm0
movslq 0x6c(%rsp), %rax
ucomiss 0x8c(%rsp,%rax,4), %xmm0
jbe 0x5f2c1
movq 0xc0(%rsp), %rax
movq 0xc0(%rax), %rax
movq 0x10(%rax), %rax
movslq 0x70(%rsp), %rcx
imulq $0xc, %rcx, %rcx
addq %rcx, %rax
movslq 0x6c(%rsp), %rcx
movss (%rax,%rcx,4), %xmm0
movslq 0x6c(%rsp), %rax
movss %xmm0, 0x8c(%rsp,%rax,4)
jmp 0x5f2c3
movl 0x6c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x6c(%rsp)
jmp 0x5f1c6
jmp 0x5f2d5
movl 0x70(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x70(%rsp)
jmp 0x5f1a2
movss 0xe8af(%rip), %xmm0     # 0x6db9c
movss %xmm0, 0x9c(%rsp)
leaq 0x524e6f3(%rip), %rax   # 0x52ad9f0
testb $0x1, (%rax)
je 0x5f313
movss 0xad42(%rip), %xmm0     # 0x6a04c
movss %xmm0, 0x9c(%rsp)
movss 0xad29(%rip), %xmm0     # 0x6a044
divss 0x9c(%rsp), %xmm0
movq 0xc0(%rsp), %rax
movss %xmm0, 0xf4(%rax)
movss 0xad08(%rip), %xmm0     # 0x6a044
divss 0x9c(%rsp), %xmm0
movq 0xc0(%rsp), %rax
movss %xmm0, 0xf8(%rax)
movq 0xc0(%rsp), %rax
movss 0xace7(%rip), %xmm0     # 0x6a04c
movss %xmm0, 0xfc(%rax)
movl $0x0, 0x6c(%rsp)
cmpl $0x2, 0x6c(%rsp)
jge 0x5f437
movslq 0x6c(%rsp), %rax
movss 0x94(%rsp,%rax,4), %xmm0
movq 0xc0(%rsp), %rax
movslq 0x6c(%rsp), %rcx
divss 0xf4(%rax,%rcx,4), %xmm0
cvtss2sd %xmm0, %xmm0
movsd 0xe140(%rip), %xmm1     # 0x6d4f0
addsd %xmm1, %xmm0
movsd 0xe424(%rip), %xmm1     # 0x6d7e0
subsd %xmm1, %xmm0
callq 0x45a0
cvttsd2si %xmm0, %ecx
movslq 0x6c(%rsp), %rax
movl %ecx, 0x84(%rsp,%rax,4)
movslq 0x6c(%rsp), %rax
movss 0x8c(%rsp,%rax,4), %xmm0
movq 0xc0(%rsp), %rax
movslq 0x6c(%rsp), %rcx
divss 0xf4(%rax,%rcx,4), %xmm0
cvtss2sd %xmm0, %xmm0
movsd 0xe0eb(%rip), %xmm1     # 0x6d4f0
subsd %xmm1, %xmm0
movsd 0xe3cf(%rip), %xmm1     # 0x6d7e0
addsd %xmm1, %xmm0
callq 0x4090
cvttsd2si %xmm0, %ecx
movslq 0x6c(%rsp), %rax
movl %ecx, 0x7c(%rsp,%rax,4)
movl 0x6c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x6c(%rsp)
jmp 0x5f375
cvtsi2sdl 0x84(%rsp), %xmm0
movsd 0xe0a8(%rip), %xmm1     # 0x6d4f0
subsd %xmm1, %xmm0
movq 0xc0(%rsp), %rax
movss 0xf4(%rax), %xmm1
cvtss2sd %xmm1, %xmm1
mulsd %xmm1, %xmm0
cvtsd2ss %xmm0, %xmm0
movq 0xc0(%rsp), %rax
movss %xmm0, 0xe8(%rax)
cvtsi2sdl 0x88(%rsp), %xmm0
movsd 0xe067(%rip), %xmm1     # 0x6d4f0
subsd %xmm1, %xmm0
movq 0xc0(%rsp), %rax
movss 0xf8(%rax), %xmm1
cvtss2sd %xmm1, %xmm1
mulsd %xmm1, %xmm0
cvtsd2ss %xmm0, %xmm0
movq 0xc0(%rsp), %rax
movss %xmm0, 0xec(%rax)
movq 0xc0(%rsp), %rax
xorps %xmm0, %xmm0
movss %xmm0, 0xf0(%rax)
movl 0x7c(%rsp), %ecx
subl 0x84(%rsp), %ecx
addl $0x1, %ecx
movq 0xc0(%rsp), %rax
movl %ecx, 0x100(%rax)
movl 0x80(%rsp), %ecx
subl 0x88(%rsp), %ecx
addl $0x1, %ecx
movq 0xc0(%rsp), %rax
movl %ecx, 0x104(%rax)
movq 0xc0(%rsp), %rax
cmpl $0x0, 0x100(%rax)
jle 0x5f55f
movq 0xc0(%rsp), %rax
cmpl $0x0, 0x104(%rax)
jle 0x5f55f
movq 0xc0(%rsp), %rax
cvtsi2sdl 0x100(%rax), %xmm0
movq 0xc0(%rsp), %rax
cvtsi2sdl 0x104(%rax), %xmm1
mulsd %xmm1, %xmm0
movsd 0x12343(%rip), %xmm1    # 0x71898
ucomisd %xmm1, %xmm0
jbe 0x5f617
movq 0xc0(%rsp), %rax
movq 0x80(%rax), %rax
movq %rax, 0x18(%rsp)
cmpq $0x0, %rax
je 0x5f584
movq 0x18(%rsp), %rdi
movq (%rdi), %rax
callq *0x8(%rax)
movq 0xc0(%rsp), %rax
movq $0x0, 0x80(%rax)
movq 0xc0(%rsp), %rax
movq 0xa0(%rax), %rax
movq %rax, 0x10(%rsp)
cmpq $0x0, %rax
je 0x5f5bc
movq 0x10(%rsp), %rdi
movq (%rdi), %rax
callq *0x8(%rax)
movq 0xc0(%rsp), %rax
movq $0x0, 0xa0(%rax)
movq 0xc0(%rsp), %rax
movq 0xc0(%rax), %rax
movq %rax, 0x8(%rsp)
cmpq $0x0, %rax
je 0x5f5f4
movq 0x8(%rsp), %rdi
movq (%rdi), %rax
callq *0x8(%rax)
movq 0xc0(%rsp), %rax
movq $0x0, 0xc0(%rax)
movq 0xc0(%rsp), %rax
movb $0x0, (%rax)
jmp 0x5f6df
movq 0xc0(%rsp), %rax
movl 0x100(%rax), %eax
movq 0xc0(%rsp), %rcx
imull 0x104(%rcx), %eax
cltq
imulq $0x18, %rax, %rdi
callq 0x4430
movq %rax, %rcx
movq 0xc0(%rsp), %rax
movq %rcx, 0x108(%rax)
movq 0xc0(%rsp), %rax
cmpq $0x0, 0x108(%rax)
setne %al
movzbl %al, %edi
andl $0x1, %edi
movl $0x1, %esi
callq 0xbf00
movl $0x0, 0x74(%rsp)
movl 0x74(%rsp), %eax
movq 0xc0(%rsp), %rcx
cmpl 0x104(%rcx), %eax
jge 0x5f6dd
movl $0x0, 0x78(%rsp)
movl 0x78(%rsp), %eax
movq 0xc0(%rsp), %rcx
cmpl 0x100(%rcx), %eax
jge 0x5f6ce
movq 0xc0(%rsp), %rdi
movl 0x78(%rsp), %esi
movl 0x74(%rsp), %edx
callq 0x5f700
movl 0x78(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x78(%rsp)
jmp 0x5f698
jmp 0x5f6d0
movl 0x74(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x74(%rsp)
jmp 0x5f67c
jmp 0x5f6df
addq $0xd8, %rsp
retq
movq 0x60(%rsp), %rdi
callq 0x45c0
nopw %cs:(%rax,%rax)