// File: FreeSlave[P]vhlt/hlrad/qrad.cpp
// Function: RadWorld()
static void     RadWorld()
{
    unsigned        i;
#ifdef ZHLT_TEXLIGHT
    unsigned        j;
#endif

    MakeBackplanes();
    MakeParents(0, -1);
    MakeTnodes(&g_dmodels[0]);
#ifdef HLRAD_OPAQUE_NODE
	CreateOpaqueNodes();
	LoadOpaqueEntities();
#endif

    // turn each face into a single patch
    MakePatches();
#ifdef HLRAD_DEBUG_DRAWPOINTS
	if (g_drawpatch)
	{
		char name[_MAX_PATH+20];
		sprintf (name, "%s_patch.pts", g_Mapname);
		Log ("Writing '%s' ...\n", name);
		FILE *f;
		f = fopen(name, "w");
		if (f)
		{
			const int pos_count = 15;
			const vec3_t pos[pos_count] = {{0,0,0},{1,0,0},{0,1,0},{-1,0,0},{0,-1,0},{1,0,0},{0,0,1},{-1,0,0},{0,0,-1},{0,-1,0},{0,0,1},{0,1,0},{0,0,-1},{1,0,0},{0,0,0}};
			int j, k;
			patch_t *patch;
			vec3_t v;
			for (j = 0, patch = g_patches; j < g_num_patches; j++, patch++)
			{
				if (patch->flags == ePatchFlagOutside)
					continue;
				VectorCopy (patch->origin, v);
				for (k = 0; k < pos_count; ++k)
					fprintf (f, "%g %g %g\n", v[0]+pos[k][0], v[1]+pos[k][1], v[2]+pos[k][2]);
			}
			fclose(f);
			Log ("OK.\n");
		}
		else
			Log ("Error.\n");
	}
#endif
    CheckMaxPatches();                                     // Check here for exceeding max patches, to prevent a lot of work from occuring before an error occurs
    SortPatches();                                         // Makes the runs in the Transfer Compression really good
    PairEdges();
#ifdef HLRAD_DEBUG_DRAWPOINTS
	if (g_drawedge)
	{
		char name[_MAX_PATH+20];
		sprintf (name, "%s_edge.pts", g_Mapname);
		Log ("Writing '%s' ...\n", name);
		FILE *f;
		f = fopen(name, "w");
		if (f)
		{
			const int pos_count = 15;
			const vec3_t pos[pos_count] = {{0,0,0},{1,0,0},{0,1,0},{-1,0,0},{0,-1,0},{1,0,0},{0,0,1},{-1,0,0},{0,0,-1},{0,-1,0},{0,0,1},{0,1,0},{0,0,-1},{1,0,0},{0,0,0}};
			int j, k;
			edgeshare_t *es;
			vec3_t v;
			for (j = 0, es = g_edgeshare; j < MAX_MAP_EDGES; j++, es++)
			{
#ifdef HLRAD_GetPhongNormal_VL
				if (es->smooth)
#else
				if (es->coplanar || !VectorCompare (es->interface_normal, vec3_origin))
#endif
				{
					int v0 = g_dedges[j].v[0], v1 = g_dedges[j].v[1];
					VectorAdd (g_dvertexes[v0].point, g_dvertexes[v1].point, v);
					VectorScale (v, 0.5, v);
					VectorAdd (v, es->interface_normal, v);
					VectorAdd (v, g_face_offset[es->faces[0] - g_dfaces], v);
					for (k = 0; k < pos_count; ++k)
						fprintf (f, "%g %g %g\n", v[0]+pos[k][0], v[1]+pos[k][1], v[2]+pos[k][2]);
				}
			}
			fclose(f);
			Log ("OK.\n");
		}
		else
			Log ("Error.\n");
	}
#endif

#ifdef HLRAD_SOFTSKY
	BuildDiffuseNormals ();
#endif
    // create directlights out of g_patches and lights
    CreateDirectLights();

    Log("\n");
	
#ifdef HLRAD_GROWSAMPLE
	// generate a position map for each face
	NamedRunThreadsOnIndividual(g_numfaces, g_estimate, FindFacePositions);

#endif
    // build initial facelights
    NamedRunThreadsOnIndividual(g_numfaces, g_estimate, BuildFacelights);

#ifdef HLRAD_GROWSAMPLE
	FreePositionMaps ();

#endif
    // free up the direct lights now that we have facelights
    DeleteDirectLights();

    if (g_numbounce > 0)
    {
        // build transfer lists
        MakeScalesStub();

#ifdef HLRAD_MORE_PATCHES
		// these arrays are only used in CollectLight, GatherLight and BounceLight
	#ifdef ZHLT_TEXLIGHT
		emitlight = (vec3_t (*)[MAXLIGHTMAPS])AllocBlock ((g_num_patches + 1) * sizeof (vec3_t [MAXLIGHTMAPS]));
		addlight = (vec3_t (*)[MAXLIGHTMAPS])AllocBlock ((g_num_patches + 1) * sizeof (vec3_t [MAXLIGHTMAPS]));
	#ifdef ZHLT_XASH
		emitlight_direction = (vec3_t (*)[MAXLIGHTMAPS])AllocBlock ((g_num_patches + 1) * sizeof (vec3_t [MAXLIGHTMAPS]));
		addlight_direction = (vec3_t (*)[MAXLIGHTMAPS])AllocBlock ((g_num_patches + 1) * sizeof (vec3_t [MAXLIGHTMAPS]));
	#endif
	#ifdef HLRAD_AUTOCORING
		newstyles = (unsigned char (*)[MAXLIGHTMAPS])AllocBlock ((g_num_patches + 1) * sizeof (unsigned char [MAXLIGHTMAPS]));
	#endif
	#else
		emitlight = (vec3_t *)AllocBlock ((g_num_patches + 1) * sizeof (vec3_t));
		addlight = (vec3_t *)AllocBlock ((g_num_patches + 1) * sizeof (vec3_t));
	#endif
#endif
        // spread light around
        BounceLight();

#ifndef HLRAD_AUTOCORING
        for (i = 0; i < g_num_patches; i++)
        {
#ifdef ZHLT_TEXLIGHT// AJM
            for (j = 0; j < MAXLIGHTMAPS && g_patches[i].totalstyle[j] != 255; j++)
			{
	            VectorSubtract(g_patches[i].totallight[j], g_patches[i].directlight[j], g_patches[i].totallight[j]);
			}
#else
            VectorSubtract(g_patches[i].totallight, g_patches[i].directlight, g_patches[i].totallight);
#endif
        }
#endif
#ifdef HLRAD_MORE_PATCHES
	#ifdef ZHLT_TEXLIGHT
		FreeBlock (emitlight);
		emitlight = NULL;
		FreeBlock (addlight);
		addlight = NULL;
	#ifdef ZHLT_XASH
		FreeBlock (emitlight_direction);
		emitlight_direction = NULL;
		FreeBlock (addlight_direction);
		addlight_direction = NULL;
	#endif
	#ifdef HLRAD_AUTOCORING
		FreeBlock (newstyles);
		newstyles = NULL;
	#endif
	#else
		FreeBlock (emitlight);
		emitlight = NULL;
		FreeBlock (addlight);
		addlight = NULL;
	#endif
#endif
    }
#ifndef HLRAD_AUTOCORING
#ifdef HLRAD_GatherPatchLight
	if (g_numbounce <= 0)
	{
        for (i = 0; i < g_num_patches; i++)
        {
#ifdef ZHLT_TEXLIGHT// AJM
            for (j = 0; j < MAXLIGHTMAPS && g_patches[i].totalstyle[j] != 255; j++)
			{
	            VectorSubtract(g_patches[i].totallight[j], g_patches[i].directlight[j], g_patches[i].totallight[j]);
			}
#else
            VectorSubtract(g_patches[i].totallight, g_patches[i].directlight, g_patches[i].totallight);
#endif
        }
	}
#endif
#endif

    FreeTransfers();
#ifdef HLRAD_OPAQUE_STYLE_BOUNCE
	FreeStyleArrays ();
#endif
	
#ifdef HLRAD_LOCALTRIANGULATION
	NamedRunThreadsOnIndividual (g_numfaces, g_estimate, CreateTriangulations);

#endif
    // blend bounced light into direct light and save
    PrecompLightmapOffsets();

#ifdef ZHLT_XASH
#ifdef HLRAD_WHOME
	g_directionscale = FindDirectionScale (VectorAvg (g_colour_qgamma));
#else
	g_directionscale = FindDirectionScale (g_qgamma);
#endif
#endif
#ifdef HLRAD_GROWSAMPLE

	ScaleDirectLights ();

#ifndef HLRAD_GatherPatchLight
    if (g_numbounce)
#endif
	{

		CreateFacelightDependencyList ();

		NamedRunThreadsOnIndividual (g_numfaces, g_estimate, AddPatchLights);

		FreeFacelightDependencyList ();
	}

#endif
#ifdef HLRAD_LOCALTRIANGULATION
	FreeTriangulations ();

#endif
    NamedRunThreadsOnIndividual(g_numfaces, g_estimate, FinalLightFace);
#ifdef HLRAD_AUTOCORING
	if (g_maxdiscardedlight > 0.01)
	{
		Verbose ("Maximum brightness loss (too many light styles on a face) = %f @(%f, %f, %f)\n", g_maxdiscardedlight, g_maxdiscardedpos[0], g_maxdiscardedpos[1], g_maxdiscardedpos[2]);
	}
#endif
#ifdef HLRAD_MDL_LIGHT_HACK
	MdlLightHack ();
#endif
#ifdef HLRAD_REDUCELIGHTMAP
	ReduceLightmap();
	if (g_lightdatasize == 0)
	{
		g_lightdatasize = 1;
		g_dlightdata[0] = 0;
	#ifdef ZHLT_XASH
		g_dlitdatasize = 1;
		g_ddlitdata[0] = 0;
	#endif
	}
#endif
#ifdef ZHLT_EMBEDLIGHTMAP
	ExtendLightmapBuffer (); // expand the size of lightdata array (for a few KB) to ensure that game engine reads within its valid range
#endif
}

// Assembly:
subq $0x2208, %rsp           # imm = 0x2208
callq 0x5ce80
xorl %edi, %edi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0x53e30
leaq 0x2b051(%rip), %rdi     # 0x7e480
callq 0x623a0
callq 0x63e40
callq 0x53ed0
callq 0x544d0
testb $0x1, 0x54dc602(%rip)   # 0x552fa4c
je 0x5366e
leaq 0x11e0(%rsp), %rdi
leaq 0x1e08e(%rip), %rsi     # 0x714ed
leaq 0x29efa(%rip), %rdx     # 0x7d360
movb $0x0, %al
callq 0x40a0
leaq 0x11e0(%rsp), %rsi
leaq 0x1af4e(%rip), %rdi     # 0x6e3ca
movb $0x0, %al
callq 0xb0d0
leaq 0x11e0(%rsp), %rdi
leaq 0x1d8f1(%rip), %rsi     # 0x70d83
callq 0x4390
movq %rax, 0x11d8(%rsp)
cmpq $0x0, 0x11d8(%rsp)
je 0x5365e
movl $0xf, 0x11d4(%rsp)
leaq 0x1120(%rsp), %rdi
leaq 0x1b7a8(%rip), %rsi     # 0x6ec70
movl $0xb4, %edx
callq 0x4280
movl $0x0, 0x111c(%rsp)
movq 0x539a51c(%rip), %rax   # 0x53eda00
movq %rax, 0x1110(%rsp)
movl 0x111c(%rsp), %eax
cmpl 0x541a50f(%rip), %eax   # 0x546da08
jae 0x53641
movq 0x1110(%rsp), %rax
cmpl $0x1, 0x5c(%rax)
jne 0x53512
jmp 0x53615
movq 0x1110(%rsp), %rax
movss 0x8(%rax), %xmm0
movss %xmm0, 0x1104(%rsp)
movq 0x1110(%rsp), %rax
movss 0xc(%rax), %xmm0
movss %xmm0, 0x1108(%rsp)
movq 0x1110(%rsp), %rax
movss 0x10(%rax), %xmm0
movss %xmm0, 0x110c(%rsp)
movl $0x0, 0x1118(%rsp)
cmpl $0xf, 0x1118(%rsp)
jge 0x53613
movq 0x11d8(%rsp), %rdi
movss 0x1104(%rsp), %xmm0
movslq 0x1118(%rsp), %rcx
leaq 0x1120(%rsp), %rax
imulq $0xc, %rcx, %rcx
addq %rcx, %rax
addss (%rax), %xmm0
cvtss2sd %xmm0, %xmm0
movss 0x1108(%rsp), %xmm1
movslq 0x1118(%rsp), %rcx
leaq 0x1120(%rsp), %rax
imulq $0xc, %rcx, %rcx
addq %rcx, %rax
addss 0x4(%rax), %xmm1
cvtss2sd %xmm1, %xmm1
movss 0x110c(%rsp), %xmm2
movslq 0x1118(%rsp), %rcx
leaq 0x1120(%rsp), %rax
imulq $0xc, %rcx, %rcx
addq %rcx, %rax
addss 0x8(%rax), %xmm2
cvtss2sd %xmm2, %xmm2
leaq 0x1ade6(%rip), %rsi     # 0x6e3dc
movb $0x3, %al
callq 0x44a0
movl 0x1118(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x1118(%rsp)
jmp 0x5355f
jmp 0x53615
movl 0x111c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x111c(%rsp)
movq 0x1110(%rsp), %rax
addq $0x138, %rax            # imm = 0x138
movq %rax, 0x1110(%rsp)
jmp 0x534ec
movq 0x11d8(%rsp), %rdi
callq 0x4310
leaq 0x1ad91(%rip), %rdi     # 0x6e3e6
movb $0x0, %al
callq 0xb0d0
jmp 0x5366c
leaq 0x1ad86(%rip), %rdi     # 0x6e3eb
movb $0x0, %al
callq 0xb0d0
jmp 0x5366e
callq 0x54d00
callq 0x54d90
callq 0x2b160
testb $0x1, 0x54dc3dc(%rip)   # 0x552fa60
je 0x53a47
leaq 0xf0(%rsp), %rdi
leaq 0x1de61(%rip), %rsi     # 0x714fa
leaq 0x29cc0(%rip), %rdx     # 0x7d360
movb $0x0, %al
callq 0x40a0
leaq 0xf0(%rsp), %rsi
leaq 0x1ad14(%rip), %rdi     # 0x6e3ca
movb $0x0, %al
callq 0xb0d0
leaq 0xf0(%rsp), %rdi
leaq 0x1d6b7(%rip), %rsi     # 0x70d83
callq 0x4390
movq %rax, 0xe8(%rsp)
cmpq $0x0, 0xe8(%rsp)
je 0x53a37
movl $0xf, 0xe4(%rsp)
leaq 0x30(%rsp), %rdi
leaq 0x1b631(%rip), %rsi     # 0x6ed30
movl $0xb4, %edx
callq 0x4280
movl $0x0, 0x2c(%rsp)
leaq 0x212e218(%rip), %rax   # 0x2181930
movq %rax, 0x20(%rsp)
cmpl $0x3e800, 0x2c(%rsp)    # imm = 0x3E800
jge 0x53a1a
movq 0x20(%rsp), %rax
testb $0x1, 0x39(%rax)
je 0x539f8
movslq 0x2c(%rsp), %rcx
leaq 0x1d12cca(%rip), %rax   # 0x1d66410
movzwl (%rax,%rcx,4), %eax
movl %eax, 0x10(%rsp)
movslq 0x2c(%rsp), %rcx
leaq 0x1d12cb6(%rip), %rax   # 0x1d66410
movzwl 0x2(%rax,%rcx,4), %eax
movl %eax, 0xc(%rsp)
movslq 0x10(%rsp), %rcx
leaq 0x1012ca1(%rip), %rax   # 0x1066410
imulq $0xc, %rcx, %rcx
addq %rcx, %rax
movss (%rax), %xmm0
movslq 0xc(%rsp), %rcx
leaq 0x1012c8a(%rip), %rax   # 0x1066410
imulq $0xc, %rcx, %rcx
addq %rcx, %rax
addss (%rax), %xmm0
movss %xmm0, 0x14(%rsp)
movslq 0x10(%rsp), %rcx
leaq 0x1012c6d(%rip), %rax   # 0x1066410
imulq $0xc, %rcx, %rcx
addq %rcx, %rax
movss 0x4(%rax), %xmm0
movslq 0xc(%rsp), %rcx
leaq 0x1012c55(%rip), %rax   # 0x1066410
imulq $0xc, %rcx, %rcx
addq %rcx, %rax
addss 0x4(%rax), %xmm0
movss %xmm0, 0x18(%rsp)
movslq 0x10(%rsp), %rcx
leaq 0x1012c37(%rip), %rax   # 0x1066410
imulq $0xc, %rcx, %rcx
addq %rcx, %rax
movss 0x8(%rax), %xmm0
movslq 0xc(%rsp), %rcx
leaq 0x1012c1f(%rip), %rax   # 0x1066410
imulq $0xc, %rcx, %rcx
addq %rcx, %rax
addss 0x8(%rax), %xmm0
movss %xmm0, 0x1c(%rsp)
movss 0x14(%rsp), %xmm0
cvtss2sd %xmm0, %xmm0
movsd 0x19cdb(%rip), %xmm1    # 0x6d4f0
mulsd %xmm1, %xmm0
cvtsd2ss %xmm0, %xmm0
movss %xmm0, 0x14(%rsp)
movss 0x18(%rsp), %xmm0
cvtss2sd %xmm0, %xmm0
movsd 0x19cbb(%rip), %xmm1    # 0x6d4f0
mulsd %xmm1, %xmm0
cvtsd2ss %xmm0, %xmm0
movss %xmm0, 0x18(%rsp)
movss 0x1c(%rsp), %xmm0
cvtss2sd %xmm0, %xmm0
movsd 0x19c9b(%rip), %xmm1    # 0x6d4f0
mulsd %xmm1, %xmm0
cvtsd2ss %xmm0, %xmm0
movss %xmm0, 0x1c(%rsp)
movss 0x14(%rsp), %xmm0
movq 0x20(%rsp), %rax
addss 0x10(%rax), %xmm0
movss %xmm0, 0x14(%rsp)
movss 0x18(%rsp), %xmm0
movq 0x20(%rsp), %rax
addss 0x14(%rax), %xmm0
movss %xmm0, 0x18(%rsp)
movss 0x1c(%rsp), %xmm0
movq 0x20(%rsp), %rax
addss 0x18(%rax), %xmm0
movss %xmm0, 0x1c(%rsp)
movss 0x14(%rsp), %xmm0
movq 0x20(%rsp), %rax
movq (%rax), %rax
leaq 0x1b92b56(%rip), %rcx   # 0x1be6410
subq %rcx, %rax
movl $0x14, %ecx
cqto
idivq %rcx
movq %rax, %rcx
leaq 0x541a13f(%rip), %rax   # 0x546da10
imulq $0xc, %rcx, %rcx
addq %rcx, %rax
addss (%rax), %xmm0
movss %xmm0, 0x14(%rsp)
movss 0x18(%rsp), %xmm0
movq 0x20(%rsp), %rax
movq (%rax), %rax
leaq 0x1b92b19(%rip), %rcx   # 0x1be6410
subq %rcx, %rax
movl $0x14, %ecx
cqto
idivq %rcx
movq %rax, %rcx
leaq 0x541a102(%rip), %rax   # 0x546da10
imulq $0xc, %rcx, %rcx
addq %rcx, %rax
addss 0x4(%rax), %xmm0
movss %xmm0, 0x18(%rsp)
movss 0x1c(%rsp), %xmm0
movq 0x20(%rsp), %rax
movq (%rax), %rax
leaq 0x1b92adb(%rip), %rcx   # 0x1be6410
subq %rcx, %rax
movl $0x14, %ecx
cqto
idivq %rcx
movq %rax, %rcx
leaq 0x541a0c4(%rip), %rax   # 0x546da10
imulq $0xc, %rcx, %rcx
addq %rcx, %rax
addss 0x8(%rax), %xmm0
movss %xmm0, 0x1c(%rsp)
movl $0x0, 0x28(%rsp)
cmpl $0xf, 0x28(%rsp)
jge 0x539f6
movq 0xe8(%rsp), %rdi
movss 0x14(%rsp), %xmm0
movslq 0x28(%rsp), %rcx
leaq 0x30(%rsp), %rax
imulq $0xc, %rcx, %rcx
addq %rcx, %rax
addss (%rax), %xmm0
cvtss2sd %xmm0, %xmm0
movss 0x18(%rsp), %xmm1
movslq 0x28(%rsp), %rcx
leaq 0x30(%rsp), %rax
imulq $0xc, %rcx, %rcx
addq %rcx, %rax
addss 0x4(%rax), %xmm1
cvtss2sd %xmm1, %xmm1
movss 0x1c(%rsp), %xmm2
movslq 0x28(%rsp), %rcx
leaq 0x30(%rsp), %rax
imulq $0xc, %rcx, %rcx
addq %rcx, %rax
addss 0x8(%rax), %xmm2
cvtss2sd %xmm2, %xmm2
leaq 0x1a9fd(%rip), %rsi     # 0x6e3dc
movb $0x3, %al
callq 0x44a0
movl 0x28(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x28(%rsp)
jmp 0x53966
jmp 0x539f8
jmp 0x539fa
movl 0x2c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x2c(%rsp)
movq 0x20(%rsp), %rax
addq $0xb0, %rax
movq %rax, 0x20(%rsp)
jmp 0x5371d
movq 0xe8(%rsp), %rdi
callq 0x4310
leaq 0x1a9b8(%rip), %rdi     # 0x6e3e6
movb $0x0, %al
callq 0xb0d0
jmp 0x53a45
leaq 0x1a9ad(%rip), %rdi     # 0x6e3eb
movb $0x0, %al
callq 0xb0d0
jmp 0x53a47
callq 0x31b30
callq 0x2e610
leaq 0x182a0(%rip), %rdi     # 0x6bcf8
movb $0x0, %al
callq 0xb0d0
leaq 0x1daa0(%rip), %rdi     # 0x71506
callq 0xb2f0
movq %rax, %rsi
leaq 0x1ac28(%rip), %rdi     # 0x6e69d
movb $0x0, %al
callq 0xb0d0
leaq 0x1b92981(%rip), %rax   # 0x1be6404
movl (%rax), %edi
movb 0x2a9a9(%rip), %al      # 0x7e434
leaq 0xaede(%rip), %rdx      # 0x5e970
andb $0x1, %al
movzbl %al, %esi
callq 0xd260
leaq 0x1da76(%rip), %rdi     # 0x71519
callq 0xb2f0
movq %rax, %rsi
leaq 0x1abeb(%rip), %rdi     # 0x6e69d
movb $0x0, %al
callq 0xb0d0
leaq 0x1b92944(%rip), %rax   # 0x1be6404
movl (%rax), %edi
movb 0x2a96c(%rip), %al      # 0x7e434
leaq -0x1b4cf(%rip), %rdx    # 0x38600
andb $0x1, %al
movzbl %al, %esi
callq 0xd260
callq 0x5ff10
callq 0x314c0
cmpl $0x0, 0x2a8ea(%rip)     # 0x7e3d4
jbe 0x53b92
callq 0x54f40
movl 0x5419f0d(%rip), %eax   # 0x546da08
addl $0x1, %eax
movl %eax, %eax
imulq $0x30, %rax, %rdi
callq 0x47a0
movq %rax, 0x551c0a8(%rip)   # 0x556fbb8
movl 0x5419ef2(%rip), %eax   # 0x546da08
addl $0x1, %eax
movl %eax, %eax
imulq $0x30, %rax, %rdi
callq 0x47a0
movq %rax, 0x551c095(%rip)   # 0x556fbc0
movl 0x5419ed7(%rip), %eax   # 0x546da08
addl $0x1, %eax
movl %eax, %eax
movl %eax, %edi
shlq $0x2, %rdi
callq 0x47a0
movq %rax, 0x551c080(%rip)   # 0x556fbc8
callq 0x54f80
movq 0x551c064(%rip), %rdi   # 0x556fbb8
callq 0x47d0
movq $0x0, 0x551c054(%rip) # 0x556fbb8
movq 0x551c055(%rip), %rdi   # 0x556fbc0
callq 0x47d0
movq $0x0, 0x551c045(%rip) # 0x556fbc0
movq 0x551c046(%rip), %rdi   # 0x556fbc8
callq 0x47d0
movq $0x0, 0x551c036(%rip) # 0x556fbc8
callq 0x55310
callq 0x667a0
leaq 0x1d987(%rip), %rdi     # 0x7152a
callq 0xb2f0
movq %rax, %rsi
leaq 0x1aaeb(%rip), %rdi     # 0x6e69d
movb $0x0, %al
callq 0xb0d0
leaq 0x1b92844(%rip), %rax   # 0x1be6404
movl (%rax), %edi
movb 0x2a86c(%rip), %al      # 0x7e434
leaq -0x3cd9f(%rip), %rdx    # 0x16e30
andb $0x1, %al
movzbl %al, %esi
callq 0xd260
callq 0x3e670
callq 0x41050
callq 0x40da0
leaq 0x1d951(%rip), %rdi     # 0x71540
callq 0xb2f0
movq %rax, %rsi
leaq 0x1aa9f(%rip), %rdi     # 0x6e69d
movb $0x0, %al
callq 0xb0d0
leaq 0x1b927f8(%rip), %rax   # 0x1be6404
movl (%rax), %edi
movb 0x2a820(%rip), %al      # 0x7e434
leaq -0x12a4b(%rip), %rdx    # 0x411d0
andb $0x1, %al
movzbl %al, %esi
callq 0xd260
callq 0x40fd0
callq 0x184c0
leaq 0x1d91a(%rip), %rdi     # 0x71550
callq 0xb2f0
movq %rax, %rsi
leaq 0x1aa58(%rip), %rdi     # 0x6e69d
movb $0x0, %al
callq 0xb0d0
leaq 0x1b927b1(%rip), %rax   # 0x1be6404
movl (%rax), %edi
movb 0x2a7d9(%rip), %al      # 0x7e434
leaq -0x12562(%rip), %rdx    # 0x41700
andb $0x1, %al
movzbl %al, %esi
callq 0xd260
movss 0x551befc(%rip), %xmm0  # 0x556fb70
cvtss2sd %xmm0, %xmm0
movsd 0x19b58(%rip), %xmm1    # 0x6d7d8
ucomisd %xmm1, %xmm0
jbe 0x53cc4
movss 0x551bee2(%rip), %xmm0  # 0x556fb70
cvtss2sd %xmm0, %xmm0
movss 0x551beda(%rip), %xmm1  # 0x556fb74
cvtss2sd %xmm1, %xmm1
movss 0x551bed2(%rip), %xmm2  # 0x556fb78
cvtss2sd %xmm2, %xmm2
movss 0x551beca(%rip), %xmm3  # 0x556fb7c
cvtss2sd %xmm3, %xmm3
leaq 0x1d8a3(%rip), %rdi     # 0x71560
movb $0x4, %al
callq 0xbb00
callq 0x40c20
callq 0x3f750
leaq 0x8327bf(%rip), %rax    # 0x886494
cmpl $0x0, (%rax)
jne 0x53cf4
leaq 0x8327b3(%rip), %rax    # 0x886494
movl $0x1, (%rax)
leaq 0x8327aa(%rip), %rax    # 0x886498
movq (%rax), %rax
movb $0x0, (%rax)
callq 0x553e0
addq $0x2208, %rsp           # imm = 0x2208
retq
nopw %cs:(%rax,%rax)