// File: /workspace/github_cpp_makefile_star2_O3/FreeSlave[P]vhlt/hlrad/loadtextures.cpp
// Function: EmbedLightmapInTextures()
void EmbedLightmapInTextures ()
{
	if (!g_lightdatasize)
	{
		// hlrad hasn't run
		return;
	}
	if (!g_texdatasize)
	{
		// texdata hasn't been initialized
		return;
	}
	if (g_notextures)
	{
		// hlrad didn't load the wad files
		return;
	}

	int i, j, k;
	int miplevel;
	int count = 0;
	int count_bytes = 0;
	bool logged = false;

	for (i = 0; i < g_numfaces; i++)
	{
		dface_t *f = &g_dfaces[i];
		
		if (f->lightofs == -1) // some faces don't have lightmap
		{
			continue;
		}
		if (f->texinfo < 0 || f->texinfo >= g_numtexinfo)
		{
			continue;
		}
		
		entity_t *ent = g_face_entity[i];
		int originaltexinfonum = f->texinfo;
		texinfo_t *originaltexinfo = &g_texinfo[originaltexinfonum];
		char texname[16];
		if (!GetValidTextureName (originaltexinfo->miptex, texname))
		{
			continue;
		}
		radtexture_t *tex = &g_textures[originaltexinfo->miptex];

		if (ent == &g_entities[0]) // world
		{
			continue;
		}
		if (!strncmp (texname, "sky", 3)
			|| originaltexinfo->flags & TEX_SPECIAL) // skip special surfaces
		{
			continue;
		}
		if (!IntForKey (ent, "zhlt_embedlightmap"))
		{
			continue;
		}

		if (!logged)
		{
			Log ("\n");
			Log ("Embed Lightmap : ");
			Developer (DEVELOPER_LEVEL_MESSAGE, "\n");
			logged = true;
		}

		bool poweroftwo = DEFAULT_EMBEDLIGHTMAP_POWEROFTWO;
		vec_t denominator = DEFAULT_EMBEDLIGHTMAP_DENOMINATOR;
		vec_t gamma = DEFAULT_EMBEDLIGHTMAP_GAMMA;
		int resolution = DEFAULT_EMBEDLIGHTMAP_RESOLUTION;
		if (IntForKey (ent, "zhlt_embedlightmapresolution"))
		{
			resolution = IntForKey (ent, "zhlt_embedlightmapresolution");
			if (resolution <= 0 || resolution > TEXTURE_STEP || ((resolution - 1) & resolution) != 0)
			{
				Error ("resolution cannot be %d; valid values are 1, 2, 4 ... %d.", resolution, (int)TEXTURE_STEP);
			}
		}

		// calculate texture size and allocate memory for all miplevels

		int texturesize[2];
		float (*texture)[5]; // red, green, blue and alpha channel; the last one is number of samples
		byte (*texturemips[MIPLEVELS])[4]; // red, green, blue and alpha channel
		int s, t;
		int texmins[2];
		int texmaxs[2];
		int texsize[2]; // texturesize = (texsize + 1) * TEXTURE_STEP
		int side[2];

		GetFaceExtents (i, texmins, texmaxs);
		texsize[0] = texmaxs[0] - texmins[0];
		texsize[1] = texmaxs[1] - texmins[1];
		if (texsize[0] < 0 || texsize[1] < 0 || texsize[0] > MAX_SURFACE_EXTENT || texsize[1] > MAX_SURFACE_EXTENT)
		{
			Warning ("skipped a face with bad surface extents @ (%4.3f %4.3f %4.3f)", g_face_centroids[i][0], g_face_centroids[i][1], g_face_centroids[i][2]);
			continue;
		}

		for (k = 0; k < 2; k++)
		{
			texturesize[k] = (texsize[k] + 1) * TEXTURE_STEP;
			if (texturesize[k] < texsize[k] * TEXTURE_STEP + resolution * 4)
			{
				texturesize[k] = texsize[k] * TEXTURE_STEP + resolution * 4; // prevent edge bleeding
			}
			texturesize[k] = (texturesize[k] + resolution - 1) / resolution;
			texturesize[k] += 15 - (texturesize[k] + 15) % 16; // must be multiples of 16
			if (poweroftwo)
			{
				for (j = 0; j <= 30; j++)
				{
					if ((1 << j) >= texturesize[k])
					{
						texturesize[k] = (1 << j);
						break;
					}
				}
			}
			side[k] = (texturesize[k] * resolution - texsize[k] * TEXTURE_STEP) / 2;
		}
		texture = (float (*)[5])malloc (texturesize[0] * texturesize[1] * sizeof (float [5]));
		hlassume (texture != NULL, assume_NoMemory);
		for (miplevel = 0; miplevel < MIPLEVELS; miplevel++)
		{
			texturemips[miplevel] = (byte (*)[4])malloc ((texturesize[0] >> miplevel) * (texturesize[1] >> miplevel) * sizeof (byte [4]));
			hlassume (texturemips[miplevel] != NULL, assume_NoMemory);
		}

		// calculate the texture

		for (t = 0; t < texturesize[1]; t++)
		{
			for (s = 0; s < texturesize[0]; s++)
			{
				float (*dest)[5] = &texture[t * texturesize[0] + s];
				VectorFill (*dest, 0);
				(*dest)[3] = 0;
				(*dest)[4] = 0;
			}
		}
		for (t = -side[1]; t < texsize[1] * TEXTURE_STEP + side[1]; t++)
		{
			for (s = -side[0]; s < texsize[0] * TEXTURE_STEP + side[0]; s++)
			{
				double s_vec, t_vec;
				double src_s, src_t;
				int src_is, src_it;
				byte src_index;
				byte src_color[3];
				double dest_s, dest_t;
				int dest_is, dest_it;
				float (*dest)[5];
				double light_s, light_t;
				vec3_t light;

				s_vec = s + texmins[0] * TEXTURE_STEP + 0.5;
				t_vec = t + texmins[1] * TEXTURE_STEP + 0.5;

				if (resolution == 1)
				{
					dest_s = s_vec;
					dest_t = t_vec;
				}
				else // the final blurred texture is shifted by a half pixel so that lightmap samples align with the center of pixels
				{
					dest_s = s_vec / resolution + 0.5;
					dest_t = t_vec / resolution + 0.5;
				}
				dest_s = dest_s - texturesize[0] * floor (dest_s / texturesize[0]);
				dest_t = dest_t - texturesize[1] * floor (dest_t / texturesize[1]);
				dest_is = (int)floor (dest_s); // dest_is = dest_s % texturesize[0]
				dest_it = (int)floor (dest_t); // dest_it = dest_t % texturesize[1]
				dest_is = qmax (0, qmin (dest_is, texturesize[0] - 1));
				dest_it = qmax (0, qmin (dest_it, texturesize[1] - 1));
				dest = &texture[dest_it * texturesize[0] + dest_is];

				src_s = s_vec;
				src_t = t_vec;
				src_s = src_s - tex->width * floor (src_s / tex->width);
				src_t = src_t - tex->height * floor (src_t / tex->height);
				src_is = (int)floor (src_s); // src_is = src_s % tex->width
				src_it = (int)floor (src_t); // src_it = src_t % tex->height
				src_is = qmax (0, qmin (src_is, tex->width - 1));
				src_it = qmax (0, qmin (src_it, tex->height - 1));
				src_index = tex->canvas[src_it * tex->width + src_is];
				VectorCopy (tex->palette[src_index], src_color);

				// get light from the center of the destination pixel
				light_s = (s_vec + resolution * (dest_is + 0.5 - dest_s)) / TEXTURE_STEP - texmins[0];
				light_t = (t_vec + resolution * (dest_it + 0.5 - dest_t)) / TEXTURE_STEP - texmins[1];
				GetLight (f, texsize, light_s, light_t, light);

				(*dest)[4] += 1;
				if (!(texname[0] == '{' && src_index == 255))
				{
					for (k = 0; k < 3; k++)
					{
						float v = src_color[k] * pow (light[k] / denominator, gamma);
						(*dest)[k] += 255 * qmax (0, qmin (v, 255));
					}
					(*dest)[3] += 255;
				}
			}
		}
		for (t = 0; t < texturesize[1]; t++)
		{
			for (s = 0; s < texturesize[0]; s++)
			{
				float (*src)[5] = &texture[t * texturesize[0] + s];
				byte (*dest)[4] = &texturemips[0][t * texturesize[0] + s];

				if ((*src)[4] == 0) // no samples (outside face range?)
				{
					VectorFill (*dest, 0);
					(*dest)[3] = 255;
				}
				else
				{
					if ((*src)[3] / (*src)[4] <= 0.4 * 255) // transparent
					{
						VectorFill (*dest, 0);
						(*dest)[3] = 0;
					}
					else // normal
					{
						for (j = 0; j < 3; j++)
						{
							int val = (int)floor ((*src)[j] / (*src)[3] + 0.5);
							(*dest)[j] = qmax (0, qmin (val, 255));
						}
						(*dest)[3] = 255;
					}
				}
			}
		}

		for (miplevel = 1; miplevel < MIPLEVELS; miplevel++)
		{
			for (t = 0; t < (texturesize[1] >> miplevel); t++)
			{
				for (s = 0; s < (texturesize[0] >> miplevel); s++)
				{
					byte (*src[4])[4];
					byte (*dest)[4];
					double average[4];

					dest = &texturemips[miplevel][t * (texturesize[0] >> miplevel) + s];
					src[0] = &texturemips[miplevel - 1][(2 * t) * (texturesize[0] >> (miplevel - 1)) + (2 * s)];
					src[1] = &texturemips[miplevel - 1][(2 * t) * (texturesize[0] >> (miplevel - 1)) + (2 * s + 1)];
					src[2] = &texturemips[miplevel - 1][(2 * t + 1) * (texturesize[0] >> (miplevel - 1)) + (2 * s)];
					src[3] = &texturemips[miplevel - 1][(2 * t + 1) * (texturesize[0] >> (miplevel - 1)) + (2 * s + 1)];

					VectorClear (average);
					average[3] = 0;
					for (k = 0; k < 4; k++)
					{
						for (j = 0; j < 3; j++)
						{
							average[j] += (*src[k])[3] * (*src[k])[j];
						}
						average[3] += (*src[k])[3];
					}

					if (average[3] / 4 <= 0.4 * 255)
					{
						VectorClear (*dest);
						(*dest)[3] = 0;
					}
					else
					{
						for (j = 0; j < 3; j++)
						{
							int val = (int)floor (average[j] / average[3] + 0.5);
							(*dest)[j] = qmax (0, qmin (val, 255));
						}
						(*dest)[3] = 255;
					}
				}
			}
		}

		// create its palette

		byte palette[256][3];
		cq_searchnode_t *palettetree = CQ_AllocSearchTree (256);
		int paletteoffset;
		int palettenumcolors;

		{
			int palettemaxcolors;
			int numsamplepoints;
			unsigned char (*samplepoints)[3];

			if (texname[0] == '{')
			{
				paletteoffset = 0;
				palettemaxcolors = 255;
				VectorCopy (tex->palette[255], palette[255]); // the transparency color
			}
			/*else if (texname[0] == '!')
			{
				paletteoffset = 16; // because the 4th entry and the 5th entry are reserved for fog color and fog density
				for (j = 0; j < 16; j++)
				{
					VectorCopy (tex->palette[j], palette[j]);
				}
				palettemaxcolors = 256 - 16;
			}*/
			else
			{
				paletteoffset = 0;
				palettemaxcolors = 256;
			}

			samplepoints = (unsigned char (*)[3])malloc (texturesize[0] * texturesize[1] * sizeof (unsigned char [3]));
			hlassume (samplepoints != NULL, assume_NoMemory);
			numsamplepoints = 0;
			for (t = 0; t < texturesize[1]; t++)
			{
				for (s = 0; s < texturesize[0]; s++)
				{
					byte (*src)[4] = &texturemips[0][t * texturesize[0] + s];
					if ((*src)[3] > 0)
					{
						VectorCopy (*src, samplepoints[numsamplepoints]);
						numsamplepoints++;
					}
				}
			}

			CQ_CreatePalette (numsamplepoints, samplepoints, palettemaxcolors, &palette[paletteoffset], palettenumcolors, palettetree);
			for (j = palettenumcolors; j < palettemaxcolors; j++)
			{
				VectorClear (palette[paletteoffset + j]);
			}

			free (samplepoints);
		}

		// emit a texinfo

		hlassume (g_numtexinfo < MAX_MAP_TEXINFO, assume_MAX_MAP_TEXINFO);
		f->texinfo = g_numtexinfo;
		texinfo_t *info = &g_texinfo[g_numtexinfo];
		g_numtexinfo++;

		*info = g_texinfo[originaltexinfonum];
		if (resolution != 1)
		{
			// apply a scale and a shift over the original vectors
			for (k = 0; k < 2; k++)
			{
				VectorScale (info->vecs[k], 1.0 / resolution, info->vecs[k]);
				info->vecs[k][3] = info->vecs[k][3] / resolution + 0.5;
			}
		}
		info->miptex = NewTextures_GetCurrentMiptexIndex ();

		// emit a texture

		int miptexsize;
		
		miptexsize = (int)sizeof (miptex_t);
		for (miplevel = 0; miplevel < MIPLEVELS; miplevel++)
		{
			miptexsize += (texturesize[0] >> miplevel) * (texturesize[1] >> miplevel);
		}
		miptexsize += 2 + 256 * 3 + 2;
		miptex_t *miptex = (miptex_t *)malloc (miptexsize);
		hlassume (miptex != NULL, assume_NoMemory);

		memset (miptex, 0, sizeof (miptex_t));
		miptex->width = texturesize[0];
		miptex->height = texturesize[1];
		byte *p = (byte *)miptex + sizeof (miptex_t);
		for (miplevel = 0; miplevel < MIPLEVELS; miplevel++)
		{
			miptex->offsets[miplevel] = p - (byte *)miptex;
			for (int t = 0; t < (texturesize[1] >> miplevel); t++)
			{
				for (int s = 0; s < (texturesize[0] >> miplevel); s++)
				{
					byte (*src)[4] = &texturemips[miplevel][t * (texturesize[0] >> miplevel) + s];
					if ((*src)[3] > 0)
					{
						if (palettenumcolors)
						{
							unsigned char point[3];
							VectorCopy (*src, point);
							*p = paletteoffset + CQ_MapPoint (point, &palette[paletteoffset], palettenumcolors, palettetree);
						}
						else // this should never happen
						{
							*p = paletteoffset + 0;
						}
					}
					else
					{
						*p = 255;
					}
					p++;
				}
			}
		}
		*(short *)p = 256;
		p += 2;
		memcpy (p, palette, 256 * 3);
		p += 256 * 3;
		*(short *)p = 0;
		p += 2;
		if (p != (byte *)miptex + miptexsize)
		{
			Error ("EmbedLightmapInTextures: internal error");
		}

		if (texname[0] == '{')
		{
			strcpy (miptex->name, "{_rad");
		}
		/*else if (texname[0] == '!')
		{
			strcpy (miptex->name, "!_rad");
		}*/
		else
		{
			strcpy (miptex->name, "__rad");
		}
		if (originaltexinfonum < 0 || originaltexinfonum > 99999)
		{
			Error ("EmbedLightmapInTextures: internal error: texinfo out of range");
		}
		miptex->name[5] = '0' + (originaltexinfonum / 10000) % 10; // store the original texinfo
		miptex->name[6] = '0' + (originaltexinfonum / 1000) % 10;
		miptex->name[7] = '0' + (originaltexinfonum / 100) % 10;
		miptex->name[8] = '0' + (originaltexinfonum / 10) % 10;
		miptex->name[9] = '0' + (originaltexinfonum) % 10;
		char table[62];
		for (int k = 0; k < 62; k++)
		{
			table[k] = k >= 36? 'a' + (k - 36): k >= 10? 'A' + (k - 10): '0' + k; // same order as the ASCII table
		}
		miptex->name[10] = '\0';
		miptex->name[11] = '\0';
		miptex->name[12] = '\0';
		miptex->name[13] = '\0';
		miptex->name[14] = '\0';
		miptex->name[15] = '\0';
		unsigned int hash = Hash (miptexsize, miptex);
		miptex->name[10] = table[(hash / 62 / 62) % 52 + 10];
		miptex->name[11] = table[(hash / 62) % 62];
		miptex->name[12] = table[(hash) % 62];
		miptex->name[13] = table[(count / 62) % 62];
		miptex->name[14] = table[(count) % 62];
		miptex->name[15] = '\0';
		NewTextures_PushTexture (miptexsize, miptex);
		count++;
		count_bytes += miptexsize;
		Developer (DEVELOPER_LEVEL_MESSAGE, "Created texture '%s' for face (texture %s) at (%4.3f %4.3f %4.3f)\n", miptex->name, texname, g_face_centroids[i][0], g_face_centroids[i][1], g_face_centroids[i][2]);

		free (miptex);

		CQ_FreeSearchTree (palettetree);
		
		free (texture);
		for (miplevel = 0; miplevel < MIPLEVELS; miplevel++)
		{
			free (texturemips[miplevel]);
		}
	}
	NewTextures_Write (); // update texdata now

	if (logged)
	{
		Log ("added %d texinfos and textures (%d bytes)\n", count, count_bytes);
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x548, %rsp            # imm = 0x548
leaq 0x82dd02(%rip), %rax    # 0x850484
cmpl $0x0, (%rax)
je 0x2439d
leaq 0x82dd02(%rip), %r14    # 0x850494
cmpl $0x0, (%r14)
je 0x2439d
leaq 0x54d7288(%rip), %rax   # 0x54f9a2b
cmpb $0x0, (%rax)
jne 0x2439d
leaq 0x1b8dc41(%rip), %rbp   # 0x1bb03f4
movl (%rbp), %eax
testl %eax, %eax
jle 0x243af
leaq 0x1b8dc3b(%rip), %r15   # 0x1bb0400
leaq 0x118dc20(%rip), %r8    # 0x11b03ec
leaq 0x118dc1d(%rip), %r9    # 0x11b03f0
leaq 0x82dcbe(%rip), %r10    # 0x850498
xorl %r12d, %r12d
movq $0x0, 0x108(%rsp)
movl $0x0, 0x98(%rsp)
movq $0x0, 0x110(%rsp)
leaq (%r12,%r12,4), %rcx
cmpl $-0x1, 0x10(%r15,%rcx,4)
je 0x228f7
leaq (%r15,%rcx,4), %rcx
movswl 0xa(%rcx), %r11d
testl %r11d, %r11d
js 0x228f7
cmpl %r11d, (%r8)
jle 0x228f7
movq %rcx, 0x160(%rsp)
movl (%r14), %eax
testl %eax, %eax
je 0x22841
movq (%r10), %rcx
movl (%rcx), %ecx
jmp 0x22843
xorl %ecx, %ecx
movl %r11d, %edx
leaq (%rdx,%rdx,4), %rbx
movl 0x20(%r9,%rbx,8), %edx
testl %edx, %edx
setns %sil
cmpl %edx, %ecx
setg %dil
andb %sil, %dil
cmpb $0x1, %dil
jne 0x228f4
movq (%r10), %r13
movslq 0x4(%r13,%rdx,4), %rdx
testq %rdx, %rdx
js 0x228f4
leaq 0x4(%r13), %rsi
subl %edx, %eax
addq %rdx, %r13
movl %ecx, %ecx
leaq (%rsi,%rcx,4), %rcx
cmpq %rcx, %r13
setb %cl
cmpl $0x28, %eax
setl %al
orb %cl, %al
jne 0x228f4
movl %r11d, 0x9c(%rsp)
leaq 0x52d513d(%rip), %rax   # 0x52f79e0
movq %r12, 0x20(%rsp)
movq (%rax,%r12,8), %r12
movl $0x10, %edx
leaq 0xf0(%rsp), %r15
movq %r15, %rdi
movq %r13, %rsi
callq 0x88b9
movq %r15, %rdi
movq %r13, %rsi
callq 0x4430
testl %eax, %eax
je 0x2290b
leaq 0x1b8db26(%rip), %r15   # 0x1bb0400
leaq 0x118db0b(%rip), %r8    # 0x11b03ec
leaq 0x118db08(%rip), %r9    # 0x11b03f0
leaq 0x82dba9(%rip), %r10    # 0x850498
movq 0x20(%rsp), %r12
movl (%rbp), %eax
incq %r12
movslq %eax, %rcx
cmpq %rcx, %r12
jl 0x22800
jmp 0x24371
movq %r15, %rdi
callq 0x4150
cmpq $0x5, %rax
jb 0x22936
movl $0x4, %edx
leaq 0xf1(%rsp), %rdi
leaq 0x19106(%rip), %rsi     # 0x3ba33
callq 0x43e0
testl %eax, %eax
je 0x228d3
cmpq 0x24693(%rip), %r12     # 0x46fd0
je 0x228d3
movl 0xf0(%rsp), %eax
movl $0x6b73, %ecx           # imm = 0x6B73
xorl %ecx, %eax
movzbl 0xf2(%rsp), %ecx
xorl $0x79, %ecx
orw %ax, %cx
leaq 0x118da8a(%rip), %r8    # 0x11b03ec
leaq 0x118da87(%rip), %r9    # 0x11b03f0
leaq 0x82db28(%rip), %r10    # 0x850498
je 0x22a4e
leaq (%r9,%rbx,8), %rbx
testb $0x1, 0x24(%rbx)
jne 0x22a4e
movslq 0x20(%rbx), %rax
imulq $0x330, %rax, %rax      # imm = 0x330
addq 0x524f012(%rip), %rax   # 0x52719a8
movq %rax, 0x118(%rsp)
movq %r12, %rdi
leaq 0x18fa2(%rip), %rsi     # 0x3b94a
callq 0x7663
testl %eax, %eax
je 0x228d3
movq %rbx, 0x1c8(%rsp)
testb $0x1, 0x110(%rsp)
jne 0x229ff
leaq 0x162aa(%rip), %rbx     # 0x38c78
movq %rbx, %rdi
xorl %eax, %eax
callq 0x9c46
leaq 0x18f7e(%rip), %rdi     # 0x3b95d
xorl %eax, %eax
callq 0x9c46
movl $0x3, %edi
movq %rbx, %rsi
xorl %eax, %eax
callq 0xa446
movb $0x1, %al
movq %rax, 0x110(%rsp)
movq %r12, %rdi
leaq 0x18f66(%rip), %rbx     # 0x3b96f
movq %rbx, %rsi
callq 0x7663
testl %eax, %eax
je 0x22a5a
movq %r12, %rdi
movq %rbx, %rsi
callq 0x7663
movl %eax, %esi
leal -0x11(%rsi), %eax
cmpl $-0x10, %eax
movq %rsi, 0xa0(%rsp)
jb 0x22a39
leal 0x1f(%rsi), %eax
testl %esi, %eax
je 0x22a67
leaq 0x18f4c(%rip), %rdi     # 0x3b98c
movl $0x10, %edx
xorl %eax, %eax
callq 0x9f34
jmp 0x22a67
leaq 0x1b8d9ab(%rip), %r15   # 0x1bb0400
jmp 0x228ef
movl $0x1, %eax
movq %rax, 0xa0(%rsp)
leaq 0x1b8d992(%rip), %r15   # 0x1bb0400
movq 0x20(%rsp), %r12
movl %r12d, %edi
leaq 0x168(%rsp), %rsi
leaq 0x1e8(%rsp), %rdx
callq 0x5c53
movq 0x1e8(%rsp), %xmm1
movq 0x168(%rsp), %xmm0
psubd %xmm0, %xmm1
movq %xmm1, 0x120(%rsp)
pshufd $0x50, %xmm1, %xmm0     # xmm0 = xmm1[0,0,1,1]
pxor 0x145c9(%rip), %xmm0    # 0x37080
pcmpgtd 0x18a71(%rip), %xmm0    # 0x3b530
movmskpd %xmm0, %eax
testl %eax, %eax
je 0x22afc
leaq (%r12,%r12,2), %rax
leaq 0x4c20e3e(%rip), %rcx   # 0x4c43910
xorps %xmm0, %xmm0
cvtss2sd (%rcx,%rax,4), %xmm0
xorps %xmm1, %xmm1
cvtss2sd 0x4(%rcx,%rax,4), %xmm1
cvtss2sd 0x8(%rcx,%rax,4), %xmm2
leaq 0x18ed6(%rip), %rdi     # 0x3b9c6
movb $0x3, %al
callq 0xa2a6
jmp 0x24357
movq 0xa0(%rsp), %r15
leal (,%r15,4), %esi
leal -0x1(%r15), %edi
movb $0x1, %r8b
leaq 0x13c(%rsp), %r9
leaq 0x120(%rsp), %rax
leaq 0x80(%rsp), %r10
leaq 0x124(%rsp), %rbx
leaq 0x84(%rsp), %r14
movl (%rax), %r11d
shll $0x4, %r11d
leal 0x10(%r11), %ecx
leal (%r11,%rsi), %eax
cmpl %eax, %ecx
cmovgl %ecx, %eax
addl %edi, %eax
cltd
idivl %r15d
leal 0xf(%rax), %ecx
addl $0x1e, %eax
testl %ecx, %ecx
cmovnsl %ecx, %eax
andl $-0x10, %eax
movl %eax, (%r10)
xorl %ecx, %ecx
movl $0x1, %edx
shll %cl, %edx
cmpl %eax, %edx
jge 0x22b7e
incl %ecx
cmpl $0x1f, %ecx
jne 0x22b68
movl %eax, %edx
jmp 0x22b81
movl %edx, (%r10)
imull %r15d, %edx
subl %r11d, %edx
movl %edx, %eax
shrl $0x1f, %eax
addl %edx, %eax
sarl %eax
movl %eax, (%r9)
leaq 0x138(%rsp), %r9
movq %rbx, %rax
movq %r14, %r10
testb $0x1, %r8b
movl $0x0, %r8d
jne 0x22b3b
movdqa %xmm1, 0x10(%rsp)
movq 0x80(%rsp), %r13
movq %r13, %xmm0
movdqa %xmm0, 0x140(%rsp)
pshufd $0x55, %xmm0, %xmm0     # xmm0 = xmm0[1,1,1,1]
movd %xmm0, %ebx
movl %ebx, %eax
imull %r13d, %eax
cltq
movq %rax, 0x1c0(%rsp)
leaq (,%rax,4), %rax
leaq (%rax,%rax,4), %rdi
callq 0x4400
xorl %edi, %edi
movq %rax, 0x70(%rsp)
testq %rax, %rax
setne %dil
movl $0x1, %esi
callq 0xa6ed
xorl %r12d, %r12d
movl %r13d, %eax
movl %r12d, %ecx
sarl %cl, %eax
movl %ebx, %edx
sarl %cl, %edx
imull %eax, %edx
movslq %edx, %rdi
shlq $0x2, %rdi
callq 0x4400
movq %rax, 0x1f0(%rsp,%r12,8)
xorl %edi, %edi
testq %rax, %rax
setne %dil
movl $0x1, %esi
callq 0xa6ed
incq %r12
cmpq $0x4, %r12
jne 0x22c0f
movl %r13d, %eax
movl %ebx, %ecx
movq %rcx, 0x100(%rsp)
movl %ebx, 0x5c(%rsp)
testl %ebx, %ebx
movq 0x70(%rsp), %rcx
movq %rax, 0xb0(%rsp)
movdqa 0x10(%rsp), %xmm1
jle 0x22cbd
leaq (,%rax,4), %rax
leaq (%rax,%rax,4), %r12
xorl %ebx, %ebx
movq 0x100(%rsp), %r14
testl %r13d, %r13d
jle 0x22cb5
movl %ebx, %eax
leaq (%rax,%rax,4), %rax
movq 0x70(%rsp), %rcx
leaq (%rcx,%rax,4), %rdi
xorl %esi, %esi
movq %r12, %rdx
callq 0x4190
movdqa 0x10(%rsp), %xmm1
movq 0x70(%rsp), %rcx
addl %r13d, %ebx
decq %r14
jne 0x22c8c
movq %r13, 0xa8(%rsp)
movl 0x138(%rsp), %eax
pshufd $0x55, %xmm1, %xmm0     # xmm0 = xmm1[1,1,1,1]
movd %xmm0, %edx
shll $0x4, %edx
addl %eax, %edx
negl %eax
xorps %xmm0, %xmm0
cvtsi2sd %r15d, %xmm0
movapd %xmm0, 0x210(%rsp)
movl %edx, 0x134(%rsp)
movl %eax, 0x7c(%rsp)
cmpl %eax, %edx
jle 0x23376
movl 0x13c(%rsp), %eax
movd %xmm1, %edx
shll $0x4, %edx
addl %eax, %edx
movl %edx, 0xb8(%rsp)
negl %eax
movl %eax, 0x94(%rsp)
xorl %eax, %eax
cmpl $0x1, 0xa0(%rsp)
movdqa 0x140(%rsp), %xmm0
cvtdq2pd %xmm0, %xmm1
sete %al
movaps %xmm1, 0x1b0(%rsp)
xorps 0x17997(%rip), %xmm1    # 0x3a6e0
movaps %xmm1, 0x230(%rsp)
paddd 0x18817(%rip), %xmm0    # 0x3b570
movdqa %xmm0, 0x140(%rsp)
movq 0x118(%rsp), %rdx
leaq 0x20(%rdx), %rdx
movq %rdx, 0x1d0(%rsp)
movaps 0x210(%rsp), %xmm0
movlhps %xmm0, %xmm0            # xmm0 = xmm0[0,0]
movaps %xmm0, 0xc0(%rsp)
movd %eax, %xmm0
pshufd $0x44, %xmm0, %xmm0     # xmm0 = xmm0[0,1,0,1]
pshufd $0xa0, %xmm0, %xmm0     # xmm0 = xmm0[0,0,2,2]
pslld $0x1f, %xmm0
psrad $0x1f, %xmm0
movdqa %xmm0, 0x220(%rsp)
movl 0x94(%rsp), %eax
cmpl %eax, 0xb8(%rsp)
jle 0x2335f
movss 0x7c(%rsp), %xmm0
movaps %xmm0, 0x150(%rsp)
movl 0x94(%rsp), %edx
movq 0x118(%rsp), %rax
movl 0x10(%rax), %r15d
movl 0x14(%rax), %ebx
xorps %xmm0, %xmm0
cvtsi2sd %r15d, %xmm0
movsd %xmm0, 0x40(%rsp)
xorps %xmm0, %xmm0
cvtsi2sd %ebx, %xmm0
movsd %xmm0, 0x8(%rsp)
leal -0x1(%r15), %r13d
decl %ebx
movq 0x168(%rsp), %xmm0
movdqa %xmm0, 0xe0(%rsp)
pslld $0x4, %xmm0
movl %edx, (%rsp)
movd %edx, %xmm1
punpckldq 0x150(%rsp), %xmm1 # xmm1 = xmm1[0],mem[0],xmm1[1],mem[1]
paddd %xmm0, %xmm1
cvtdq2pd %xmm1, %xmm2
movq 0x18(%rax), %r12
movapd 0x18702(%rip), %xmm1    # 0x3b540
addpd %xmm1, %xmm2
movapd %xmm2, 0x60(%rsp)
movapd %xmm2, %xmm0
divpd 0xc0(%rsp), %xmm0
addpd %xmm1, %xmm0
movapd %xmm2, %xmm1
movapd 0x220(%rsp), %xmm2
andpd %xmm2, %xmm1
andnpd %xmm0, %xmm2
orpd %xmm1, %xmm2
movapd %xmm2, 0x30(%rsp)
movapd %xmm2, %xmm0
divpd 0x1b0(%rsp), %xmm0
movapd %xmm0, 0xd0(%rsp)
callq 0x4570
movapd %xmm0, 0x10(%rsp)
movapd 0xd0(%rsp), %xmm0
unpckhpd %xmm0, %xmm0            # xmm0 = xmm0[1,1]
callq 0x4570
movapd 0x10(%rsp), %xmm1
unpcklpd %xmm0, %xmm1            # xmm1 = xmm1[0],xmm0[0]
mulpd 0x230(%rsp), %xmm1
addpd 0x30(%rsp), %xmm1
movapd %xmm1, 0x10(%rsp)
movapd %xmm1, %xmm0
callq 0x4570
movapd %xmm0, 0x30(%rsp)
movapd 0x10(%rsp), %xmm0
unpckhpd %xmm0, %xmm0            # xmm0 = xmm0[1,1]
callq 0x4570
movapd 0x30(%rsp), %xmm1
unpcklpd %xmm0, %xmm1            # xmm1 = xmm1[0],xmm0[0]
cvttpd2dq %xmm1, %xmm0
movapd %xmm0, %xmm1
movdqa 0x140(%rsp), %xmm2
pcmpgtd %xmm2, %xmm1
pand %xmm1, %xmm2
pandn %xmm0, %xmm1
por %xmm2, %xmm1
movdqa %xmm1, %xmm2
pxor %xmm0, %xmm0
pcmpgtd %xmm0, %xmm2
pand %xmm1, %xmm2
movdqa %xmm2, 0x30(%rsp)
movapd 0x60(%rsp), %xmm0
divsd 0x40(%rsp), %xmm0
callq 0x4570
mulsd 0x40(%rsp), %xmm0
movapd 0x60(%rsp), %xmm1
movapd %xmm1, %xmm2
subsd %xmm0, %xmm2
movapd %xmm2, 0xd0(%rsp)
movapd %xmm1, %xmm0
unpckhpd %xmm1, %xmm0            # xmm0 = xmm0[1],xmm1[1]
movapd %xmm0, 0x40(%rsp)
divsd 0x8(%rsp), %xmm0
callq 0x4570
mulsd 0x8(%rsp), %xmm0
movapd 0x40(%rsp), %xmm1
subsd %xmm0, %xmm1
movapd %xmm1, 0x40(%rsp)
movapd 0xd0(%rsp), %xmm0
callq 0x4570
cvttsd2si %xmm0, %ebp
movapd 0x40(%rsp), %xmm0
callq 0x4570
cvttsd2si %xmm0, %eax
cmpl %ebp, %r13d
cmovll %r13d, %ebp
testl %ebp, %ebp
movl $0x0, %ecx
cmovlel %ecx, %ebp
cmpl %eax, %ebx
cmovgel %eax, %ebx
testl %ebx, %ebx
cmovlel %ecx, %ebx
imull %r15d, %ebx
addl %ebp, %ebx
movslq %ebx, %rax
movzbl (%r12,%rax), %eax
movq %rax, 0x40(%rsp)
leaq (%rax,%rax,2), %rax
movq 0x1d0(%rsp), %rdx
movb (%rdx,%rax), %cl
movb %cl, 0x2d(%rsp)
movb 0x1(%rdx,%rax), %cl
movb %cl, 0x2e(%rsp)
movb 0x2(%rdx,%rax), %al
movb %al, 0x2f(%rsp)
cvtdq2pd 0x30(%rsp), %xmm0
addpd 0x1853a(%rip), %xmm0    # 0x3b540
subpd 0x10(%rsp), %xmm0
mulpd 0xc0(%rsp), %xmm0
addpd 0x60(%rsp), %xmm0
mulpd 0x1852d(%rip), %xmm0    # 0x3b550
cvtdq2pd 0xe0(%rsp), %xmm1
subpd %xmm1, %xmm0
movapd %xmm0, 0x10(%rsp)
callq 0x4570
movapd %xmm0, 0x60(%rsp)
movapd 0x10(%rsp), %xmm0
unpckhpd %xmm0, %xmm0            # xmm0 = xmm0[1,1]
callq 0x4570
movapd 0x10(%rsp), %xmm3
movapd 0x60(%rsp), %xmm1
unpcklpd %xmm0, %xmm1            # xmm1 = xmm1[0],xmm0[0]
cvttpd2dq %xmm1, %xmm0
cvtdq2pd %xmm0, %xmm1
subpd %xmm1, %xmm3
minpd 0x184ec(%rip), %xmm3    # 0x3b560
movapd %xmm3, %xmm1
cmpltpd 0x1762f(%rip), %xmm1    # 0x3a6b0
movmskpd %xmm1, %eax
xorpd %xmm2, %xmm2
xorpd %xmm1, %xmm1
testb $0x1, %al
jne 0x23095
movapd %xmm3, %xmm1
movapd %xmm1, 0x10(%rsp)
testb $0x2, %al
movq 0xa8(%rsp), %rcx
jne 0x230af
unpckhpd %xmm3, %xmm3            # xmm3 = xmm3[1,1]
movapd %xmm3, %xmm2
movapd %xmm2, 0x60(%rsp)
movdqa 0x30(%rsp), %xmm2
pshufd $0x55, %xmm2, %xmm1     # xmm1 = xmm2[1,1,1,1]
movd %xmm1, %eax
imull %ecx, %eax
movd %xmm2, %ecx
addl %eax, %ecx
movslq %ecx, %rax
leaq (%rax,%rax,4), %r15
movd %xmm0, %r13d
pshufd $0x55, %xmm0, %xmm0     # xmm0 = xmm0[1,1,1,1]
movd %xmm0, %r12d
movq 0x160(%rsp), %r14
movq %r14, %rdi
leaq 0x120(%rsp), %rbp
movq %rbp, %rsi
movl %r13d, %edx
movl %r12d, %ecx
leaq 0x240(%rsp), %r8
callq 0x243c5
leal 0x1(%r13), %ebx
movq %r14, %rdi
movq %rbp, %rsi
movl %ebx, %edx
movl %r12d, %ecx
leaq 0x170(%rsp), %r8
callq 0x243c5
incl %r12d
movq %r14, %rdi
movq %rbp, %rsi
movl %r13d, %edx
movl %r12d, %ecx
leaq 0x128(%rsp), %r8
callq 0x243c5
movq %r14, %rdi
movq %rbp, %rsi
movl %ebx, %edx
movl %r12d, %ecx
leaq 0x88(%rsp), %r8
callq 0x243c5
movsd 0x17004(%rip), %xmm5    # 0x3a168
movapd %xmm5, %xmm1
movapd 0x60(%rsp), %xmm7
subsd %xmm7, %xmm1
cvtps2pd 0x240(%rsp), %xmm4
xorps %xmm0, %xmm0
cvtss2sd 0x248(%rsp), %xmm0
mulsd %xmm1, %xmm0
cvtsd2ss %xmm0, %xmm0
cvtss2sd %xmm0, %xmm0
xorps %xmm2, %xmm2
cvtss2sd 0x130(%rsp), %xmm2
mulsd %xmm7, %xmm2
addsd %xmm0, %xmm2
cvtsd2ss %xmm2, %xmm2
xorps %xmm0, %xmm0
cvtss2sd 0x178(%rsp), %xmm0
mulsd %xmm1, %xmm0
cvtsd2ss %xmm0, %xmm0
cvtss2sd %xmm0, %xmm0
xorps %xmm3, %xmm3
cvtss2sd 0x90(%rsp), %xmm3
mulsd %xmm7, %xmm3
addsd %xmm0, %xmm3
xorps %xmm0, %xmm0
cvtsd2ss %xmm3, %xmm0
movapd %xmm5, %xmm3
movapd 0x10(%rsp), %xmm6
subsd %xmm6, %xmm3
cvtss2sd %xmm2, %xmm2
mulsd %xmm3, %xmm2
cvtsd2ss %xmm2, %xmm2
unpcklpd %xmm1, %xmm1            # xmm1 = xmm1[0,0]
mulpd %xmm1, %xmm4
cvtpd2ps %xmm4, %xmm4
cvtps2pd %xmm4, %xmm4
cvtps2pd 0x128(%rsp), %xmm5
unpcklpd %xmm7, %xmm7            # xmm7 = xmm7[0,0]
mulpd %xmm7, %xmm5
addpd %xmm4, %xmm5
cvtpd2ps %xmm5, %xmm4
cvtps2pd 0x170(%rsp), %xmm5
mulpd %xmm1, %xmm5
cvtpd2ps %xmm5, %xmm1
cvtps2pd %xmm1, %xmm1
cvtps2pd 0x88(%rsp), %xmm5
mulpd %xmm7, %xmm5
addpd %xmm1, %xmm5
cvtpd2ps %xmm5, %xmm1
cvtps2pd %xmm4, %xmm4
unpcklpd %xmm3, %xmm3            # xmm3 = xmm3[0,0]
mulpd %xmm4, %xmm3
cvtpd2ps %xmm3, %xmm3
cvtps2pd %xmm3, %xmm3
cvtps2pd %xmm1, %xmm1
movapd %xmm6, %xmm4
unpcklpd %xmm6, %xmm4            # xmm4 = xmm4[0],xmm6[0]
mulpd %xmm1, %xmm4
addpd %xmm3, %xmm4
cvtpd2ps %xmm4, %xmm1
movlpd %xmm1, 0x1d8(%rsp)
xorps %xmm1, %xmm1
cvtss2sd %xmm2, %xmm1
cvtss2sd %xmm0, %xmm0
mulsd %xmm6, %xmm0
addsd %xmm1, %xmm0
cvtsd2ss %xmm0, %xmm0
movss %xmm0, 0x1e0(%rsp)
movq 0x70(%rsp), %rcx
movss 0x10(%rcx,%r15,4), %xmm0
addss 0x13df9(%rip), %xmm0    # 0x370a4
movss %xmm0, 0x10(%rcx,%r15,4)
cmpq $0xff, 0x40(%rsp)
jne 0x232cb
cmpb $0x7b, 0xf0(%rsp)
je 0x2334d
leaq (%rcx,%r15,4), %rbx
xorl %r15d, %r15d
movzbl 0x2d(%rsp,%r15), %eax
xorps %xmm0, %xmm0
cvtsi2ss %eax, %xmm0
movss %xmm0, 0x10(%rsp)
movss 0x1d8(%rsp,%r15,4), %xmm0
divss 0x182b1(%rip), %xmm0    # 0x3b5a8
movss 0x182ad(%rip), %xmm1    # 0x3b5ac
callq 0x4500
mulss 0x10(%rsp), %xmm0
movss 0x17736(%rip), %xmm2    # 0x3aa48
minss %xmm2, %xmm0
xorps %xmm1, %xmm1
maxss %xmm0, %xmm1
mulss %xmm2, %xmm1
addss (%rbx,%r15,4), %xmm1
movss %xmm1, (%rbx,%r15,4)
incq %r15
cmpq $0x3, %r15
jne 0x232d2
movss 0xc(%rbx), %xmm0
addss 0x17705(%rip), %xmm0    # 0x3aa48
movss %xmm0, 0xc(%rbx)
movq 0x70(%rsp), %rcx
movl (%rsp), %edx
incl %edx
cmpl 0xb8(%rsp), %edx
jl 0x22dd3
movl 0x7c(%rsp), %eax
incl %eax
movl %eax, 0x7c(%rsp)
cmpl 0x134(%rsp), %eax
jl 0x22daa
cmpl $0x0, 0x5c(%rsp)
movq 0xb0(%rsp), %rdx
jle 0x234e1
movq 0x1f0(%rsp), %rsi
leaq (,%rdx,4), %rax
movq %rax, 0xc0(%rsp)
leaq (%rax,%rax,4), %rax
movq %rax, (%rsp)
movq %rcx, 0x40(%rsp)
movq %rsi, 0x30(%rsp)
movq $0x0, 0x8(%rsp)
movq %rsi, 0x60(%rsp)
cmpl $0x0, 0xa8(%rsp)
jle 0x234a6
movq 0x8(%rsp), %rbp
imulq %rdx, %rbp
movq 0x40(%rsp), %r12
movq 0x30(%rsp), %r13
xorl %r14d, %r14d
leaq (%r14,%rbp), %r15
leaq (%r15,%r15,4), %rax
movss 0x10(%rcx,%rax,4), %xmm0
ucomiss 0x13cb6(%rip), %xmm0    # 0x370b0
jne 0x2340b
jp 0x2340b
movl $0xff000000, (%rsi,%r15,4) # imm = 0xFF000000
jmp 0x23492
leaq (%rcx,%rax,4), %rax
movss 0xc(%rax), %xmm1
movss %xmm1, 0x10(%rsp)
divss %xmm0, %xmm1
movss 0x1818a(%rip), %xmm0    # 0x3b5b0
ucomiss %xmm1, %xmm0
jae 0x2348a
xorl %ebx, %ebx
movss (%r12,%rbx,4), %xmm0
divss 0x10(%rsp), %xmm0
cvtss2sd %xmm0, %xmm0
addsd 0x16ebb(%rip), %xmm0    # 0x3a300
callq 0x4570
cvttsd2si %xmm0, %eax
movl $0xff, %ecx
cmpl %ecx, %eax
jl 0x2345c
movl $0xff, %eax
testl %eax, %eax
jg 0x23462
xorl %eax, %eax
movb %al, (%r13,%rbx)
incq %rbx
cmpq $0x3, %rbx
jne 0x2342d
movq 0x60(%rsp), %rsi
movb $-0x1, 0x3(%rsi,%r15,4)
movq 0x70(%rsp), %rcx
movq 0xb0(%rsp), %rdx
jmp 0x23492
movl $0x0, (%rsi,%r15,4)
incq %r14
addq $0x4, %r13
addq $0x14, %r12
cmpq %rdx, %r14
jne 0x233e5
movq 0x8(%rsp), %rdi
incq %rdi
movq 0x30(%rsp), %rax
addq 0xc0(%rsp), %rax
movq %rax, 0x30(%rsp)
movq 0x40(%rsp), %rax
addq (%rsp), %rax
movq %rax, 0x40(%rsp)
movq %rdi, 0x8(%rsp)
cmpq 0x100(%rsp), %rdi
jne 0x233c1
movl $0x1, %ecx
movl 0x5c(%rsp), %eax
movq %rcx, 0x150(%rsp)
sarl %cl, %eax
testl %eax, %eax
jle 0x2375c
movq 0xa8(%rsp), %rdx
movl %edx, %r8d
movq 0x150(%rsp), %rcx
sarl %cl, %r8d
decl %ecx
sarl %cl, %edx
movslq %edx, %rcx
movq %rcx, 0x140(%rsp)
movslq %r8d, %rcx
movl %eax, %eax
movq %rax, 0xd0(%rsp)
movq %rcx, 0x1b0(%rsp)
leaq (,%rcx,4), %rax
movq %rax, 0xb8(%rsp)
movq $0x0, (%rsp)
movq $0x0, 0xe0(%rsp)
movq %r8, 0xc0(%rsp)
testl %r8d, %r8d
jle 0x2372b
movq 0x150(%rsp), %rcx
movq 0x1e8(%rsp,%rcx,8), %rax
movq 0x1f0(%rsp,%rcx,8), %r9
movq 0xe0(%rsp), %rdx
movq %rdx, %r10
imulq 0x1b0(%rsp), %r10
leaq (%rdx,%rdx), %rcx
movq 0x140(%rsp), %rsi
imulq %rsi, %rcx
leaq 0x1(,%rdx,2), %rdx
imulq %rsi, %rdx
leaq (%rax,%rcx,4), %r11
leaq (%rax,%rdx,4), %r15
movq (%rsp), %rax
leaq (%r9,%rax), %rbp
xorl %ebx, %ebx
movq %r9, 0x60(%rsp)
movq %r10, 0x40(%rsp)
movq %r11, 0x30(%rsp)
movq %r15, 0x8(%rsp)
leaq (%rbx,%r10), %r14
leaq (%r11,%rbx,8), %rax
movq %rax, 0x240(%rsp)
leaq (%r11,%rbx,8), %rax
addq $0x4, %rax
movq %rax, 0x248(%rsp)
leaq (%r15,%rbx,8), %rax
movq %rax, 0x250(%rsp)
leaq 0x4(%r15,%rbx,8), %rax
movq %rax, 0x258(%rsp)
xorpd %xmm0, %xmm0
movapd %xmm0, 0x170(%rsp)
movapd %xmm0, 0x180(%rsp)
xorl %eax, %eax
movq 0x240(%rsp,%rax,8), %rdx
movzbl 0x3(%rdx), %ecx
xorl %esi, %esi
movzbl (%rdx,%rsi), %edi
imull %ecx, %edi
xorps %xmm0, %xmm0
cvtsi2sd %edi, %xmm0
addsd 0x170(%rsp,%rsi,8), %xmm0
movsd %xmm0, 0x170(%rsp,%rsi,8)
incq %rsi
cmpq $0x3, %rsi
jne 0x23638
xorps %xmm2, %xmm2
cvtsi2sd %ecx, %xmm2
addsd 0x188(%rsp), %xmm2
movsd %xmm2, 0x188(%rsp)
incq %rax
cmpq $0x4, %rax
jne 0x2362a
movapd %xmm2, %xmm0
mulsd 0x17f01(%rip), %xmm0    # 0x3b590
movsd 0x17f01(%rip), %xmm1    # 0x3b598
ucomisd %xmm0, %xmm1
jae 0x23713
xorl %r13d, %r13d
xorl %r15d, %r15d
movl $0xff, %r12d
movsd %xmm2, 0x10(%rsp)
movsd 0x170(%rsp,%r13,8), %xmm0
divsd %xmm2, %xmm0
addsd 0x16c3b(%rip), %xmm0    # 0x3a300
callq 0x4570
movsd 0x10(%rsp), %xmm2
cvttsd2si %xmm0, %eax
cmpl %r12d, %eax
cmovgel %r12d, %eax
testl %eax, %eax
cmovlel %r15d, %eax
movb %al, (%rbp,%r13)
incq %r13
cmpq $0x3, %r13
jne 0x236af
movq 0x60(%rsp), %r9
movb $-0x1, 0x3(%r9,%r14,4)
movq 0xc0(%rsp), %r8
movq 0x40(%rsp), %r10
movq 0x30(%rsp), %r11
movq 0x8(%rsp), %r15
jmp 0x2371b
movl $0x0, (%r9,%r14,4)
incq %rbx
addq $0x4, %rbp
cmpq %r8, %rbx
jne 0x235d9
movq 0xe0(%rsp), %rcx
incq %rcx
movq (%rsp), %rax
addq 0xb8(%rsp), %rax
movq %rax, (%rsp)
movq %rcx, 0xe0(%rsp)
cmpq 0xd0(%rsp), %rcx
jne 0x23562
movq 0x150(%rsp), %rcx
incq %rcx
cmpq $0x4, %rcx
movl 0x5c(%rsp), %eax
jne 0x234ea
movl $0x4fd8, %edi           # imm = 0x4FD8
callq 0x4400
xorl %edi, %edi
movq %rax, 0x10(%rsp)
testq %rax, %rax
setne %dil
movl $0x1, %esi
callq 0xa6ed
movl $0x100, %eax            # imm = 0x100
movq %rax, (%rsp)
cmpb $0x7b, 0xf0(%rsp)
jne 0x237e2
movq 0x118(%rsp), %rcx
movb 0x31d(%rcx), %al
movb %al, 0x53d(%rsp)
movb 0x31e(%rcx), %al
movb %al, 0x53e(%rsp)
movb 0x31f(%rcx), %al
movb %al, 0x53f(%rsp)
movl $0xff, %eax
movq %rax, (%rsp)
movq 0x1c0(%rsp), %rax
leaq (%rax,%rax,2), %rdi
callq 0x4400
movq %rax, %r13
xorl %edi, %edi
testq %rax, %rax
setne %dil
movl $0x1, %esi
callq 0xa6ed
cmpl $0x0, 0x5c(%rsp)
jle 0x23c11
movq 0x1f0(%rsp), %rax
addq $0x3, %rax
movq 0xb0(%rsp), %rdi
leaq (,%rdi,4), %rcx
xorl %edx, %edx
xorl %ebx, %ebx
cmpl $0x0, 0xa8(%rsp)
jle 0x2387d
xorl %esi, %esi
cmpb $0x0, (%rax,%rsi,4)
je 0x23875
movb -0x3(%rax,%rsi,4), %dil
movslq %ebx, %rbx
leaq (%rbx,%rbx,2), %r8
movb %dil, (%r13,%r8)
movb -0x2(%rax,%rsi,4), %dil
movb %dil, 0x1(%r13,%r8)
movb -0x1(%rax,%rsi,4), %dil
movb %dil, 0x2(%r13,%r8)
movq 0xb0(%rsp), %rdi
incl %ebx
incq %rsi
cmpq %rsi, %rdi
jne 0x23840
incq %rdx
addq %rcx, %rax
cmpq 0x100(%rsp), %rdx
jne 0x23834
testl %ebx, %ebx
jle 0x23c11
movl %ebx, %eax
leaq (%rax,%rax,2), %r14
movq %r14, %rdi
callq 0x4400
movq %rax, %r15
xorl %edi, %edi
testq %rax, %rax
setne %dil
movl $0x1, %ebp
movl $0x1, %esi
callq 0xa6ed
movq %r15, %rdi
movq %r13, %rsi
movq %r14, %rdx
callq 0x4240
movq (%rsp), %rax
leal -0x1(,%rax,2), %eax
movq %rax, 0x60(%rsp)
imulq $0x70, %rax, %rdi
callq 0x4400
movq %rax, %r12
xorl %edi, %edi
testq %rax, %rax
setne %dil
movl $0x1, %esi
callq 0xa6ed
movb $0x1, (%r12)
movq $0x0, 0x8(%r12)
movl %ebx, 0x20(%r12)
movq %r15, 0xd0(%rsp)
movq %r15, 0x28(%r12)
movq %r12, %rdi
callq 0x244d7
leaq 0x70(%r12), %rax
movq %rax, 0x8(%rsp)
movl $0x1, %r14d
movq %r12, 0xe0(%rsp)
movq %r14, %r15
testl %r15d, %r15d
jle 0x23c1b
xorl %eax, %eax
movq %r12, %rcx
movq %r15, %rdx
cmpb $0x1, (%rcx)
jne 0x23982
cmpb $0x1, 0x48(%rcx)
jne 0x23982
movsd 0x68(%rcx), %xmm0
testb $0x1, %al
je 0x23977
movsd 0x40(%rsp), %xmm1
addsd 0x16c97(%rip), %xmm1    # 0x3a608
ucomisd %xmm1, %xmm0
jbe 0x23982
movb $0x1, %al
movsd %xmm0, 0x40(%rsp)
movq %rcx, %rbx
addq $0x70, %rcx
decq %rdx
jne 0x2394f
movl %r15d, %r14d
testb $0x1, %al
je 0x23b94
movl %ebp, 0xc0(%rsp)
movb $0x0, (%rbx)
leaq 0x2(%r15), %rax
movq %rax, 0x30(%rsp)
movq 0x8(%rsp), %r12
xorl %ebp, %ebp
xorl %r14d, %r14d
leaq (%r15,%rbp), %rax
cmpq 0x60(%rsp), %rax
jb 0x239cc
leaq 0x180e1(%rip), %rdi     # 0x3baa6
xorl %eax, %eax
callq 0x9f34
movq %r12, 0x10(%rbx,%r14,8)
movb $0x1, (%r12)
movq %rbx, 0x8(%r12)
movl $0x0, 0x20(%r12)
movq $0x0, 0x28(%r12)
incq %rbp
addq $0x70, %r12
movl $0x1, %r14d
cmpl $0x2, %ebp
jne 0x239b3
movslq 0x50(%rbx), %rax
movl 0x54(%rbx), %ecx
movq 0x28(%rbx), %r15
movslq 0x20(%rbx), %rdx
leaq (%rdx,%rdx,2), %rdx
addq %r15, %rdx
addq $-0x3, %rdx
movq 0x30(%rsp), %r14
movl 0xc0(%rsp), %ebp
leaq (%r15,%rax), %rsi
xorl %r12d, %r12d
movzbl (%rsi,%r12), %edi
addq $0x3, %r12
cmpl %edi, %ecx
jg 0x23a2c
leaq (%r15,%r12), %rsi
addq $-0x3, %rsi
addq $0x3, %rdx
movzbl -0x3(%rdx,%rax), %edi
addq $-0x3, %rdx
cmpl %edi, %ecx
jle 0x23a45
cmpq %rdx, %rsi
jae 0x23aa3
addq %r12, %r15
movq $-0x3, %rdi
movb (%r15,%rdi), %r8b
movb %r8b, 0x173(%rsp,%rdi)
incq %rdi
jne 0x23a61
movq $-0x3, %rdi
movb 0x3(%rdx,%rdi), %r8b
movb %r8b, (%r15,%rdi)
incq %rdi
jne 0x23a79
xorl %edi, %edi
movb 0x170(%rsp,%rdi), %r8b
movb %r8b, (%rdx,%rdi)
incq %rdi
cmpq $0x3, %rdi
jne 0x23a89
movq %rsi, %r15
jmp 0x23a25
leaq (%r15,%r12), %rax
addq $-0x6, %rax
cmpq %rax, %rdx
je 0x23abe
leaq 0x17fef(%rip), %rdi     # 0x3baa6
xorl %eax, %eax
callq 0x9f34
leaq (%r15,%r12), %rax
addq $-0x3, %rax
movl %r15d, %ecx
subl 0x28(%rbx), %ecx
addl %r12d, %ecx
imull $0xaaaaaaab, %ecx, %ecx # imm = 0xAAAAAAAB
decl %ecx
movq 0x10(%rbx), %rdx
movl %ecx, 0x20(%rdx)
movq 0x10(%rbx), %rcx
movq 0x28(%rbx), %rdx
movq %rdx, 0x28(%rcx)
movl 0x20(%rbx), %ecx
leal (%rcx,%rcx,2), %ecx
addl %ecx, %edx
subl %r15d, %edx
subl %r12d, %edx
imull $0xaaaaaaab, %edx, %ecx # imm = 0xAAAAAAAB
incl %ecx
movq 0x18(%rbx), %rdx
movl %ecx, 0x20(%rdx)
movq 0x18(%rbx), %rcx
movq %rax, 0x28(%rcx)
movq 0x10(%rbx), %rax
movl 0x20(%rax), %eax
testl %eax, %eax
jle 0x23b2b
cvtsi2sd %eax, %xmm0
movsd 0x58(%rbx), %xmm1
ucomisd %xmm0, %xmm1
jne 0x23b2b
jnp 0x23b39
leaq 0x17f74(%rip), %rdi     # 0x3baa6
xorl %eax, %eax
callq 0x9f34
movq 0x18(%rbx), %rax
movl 0x20(%rax), %eax
testl %eax, %eax
movq 0xe0(%rsp), %r12
jle 0x23b60
xorps %xmm0, %xmm0
cvtsi2sd %eax, %xmm0
movsd 0x60(%rbx), %xmm1
ucomisd %xmm0, %xmm1
jne 0x23b60
jnp 0x23b6e
leaq 0x17f3f(%rip), %rdi     # 0x3baa6
xorl %eax, %eax
callq 0x9f34
movq 0x10(%rbx), %rdi
callq 0x244d7
movq 0x18(%rbx), %rdi
callq 0x244d7
incl %ebp
addq $0xe0, 0x8(%rsp)
cmpl (%rsp), %ebp
jne 0x2393b
testl %r14d, %r14d
jle 0x23c18
movl %r14d, %eax
imulq $0x70, %rax, %rax
movq 0x10(%rsp), %rcx
addq $0x18, %rcx
xorl %edx, %edx
movb (%r12,%rdx), %sil
movb %sil, -0x18(%rcx)
testb %sil, %sil
jne 0x23bfd
movq 0x50(%r12,%rdx), %rsi
movq %rsi, (%rcx)
movq 0x10(%r12,%rdx), %rsi
subq %r12, %rsi
sarq $0x4, %rsi
movabsq $0x2492492492492498, %rdi # imm = 0x2492492492492498
imulq %rdi, %rsi
movq 0x10(%rsp), %r8
addq %r8, %rsi
movq %rsi, -0x10(%rcx)
movq 0x18(%r12,%rdx), %rsi
subq %r12, %rsi
sarq $0x4, %rsi
imulq %rdi, %rsi
addq %r8, %rsi
movq %rsi, -0x8(%rcx)
addq $0x70, %rdx
addq $0x28, %rcx
cmpq %rdx, %rax
jne 0x23bab
movq %r14, 0x30(%rsp)
jmp 0x23c20
xorl %ebp, %ebp
jmp 0x23d05
movl %r14d, %r15d
movq %r15, 0x30(%rsp)
leaq 0x240(%rsp), %rbx
xorl %edx, %edx
movq %r12, %r14
cmpb $0x0, (%r14)
jne 0x23c3d
movq 0x10(%r14), %r14
cmpb $0x1, (%r14)
jne 0x23c33
movq %r14, %rax
subq %r12, %rax
sarq $0x4, %rax
movabsq $0x2492492492492498, %rcx # imm = 0x2492492492492498
imulq %rcx, %rax
movq 0x10(%rsp), %rcx
movq %rdx, %rbp
movl %edx, 0x20(%rcx,%rax)
movl $0x6, %r15d
movsd (%r14,%r15,8), %xmm0
addsd 0x1668b(%rip), %xmm0    # 0x3a300
addsd 0x1349b(%rip), %xmm0    # 0x37118
callq 0x4570
cvttsd2si %xmm0, %eax
movl $0xff, %ecx
cmpl %ecx, %eax
jl 0x23c94
movl $0xff, %eax
testl %eax, %eax
jg 0x23c9a
xorl %eax, %eax
movb %al, -0x6(%rbx,%r15)
incq %r15
cmpq $0x9, %r15
jne 0x23c67
movq %rbp, %rdx
incq %rdx
movq 0x8(%r14), %rax
testq %rax, %rax
je 0x23ccd
cmpq 0x10(%rax), %r14
movq %rax, %r14
jne 0x23cae
movq 0x18(%rax), %r14
addq $0x3, %rbx
jmp 0x23c2d
movq %rdx, %rbp
leal -0x1(,%rdx,2), %eax
cmpl 0x30(%rsp), %eax
je 0x23ceb
leaq 0x17dc2(%rip), %rdi     # 0x3baa6
xorl %eax, %eax
callq 0x9f34
movq 0xd0(%rsp), %rdi
callq 0x4370
movq %r12, %rdi
callq 0x4370
cmpl %ebp, (%rsp)
jle 0x23d2e
movslq %ebp, %rax
leaq (%rax,%rax,2), %rcx
leaq (%rsp,%rcx), %rdi
addq $0x240, %rdi            # imm = 0x240
notl %eax
movq (%rsp), %rcx
addl %eax, %ecx
leaq (%rcx,%rcx,2), %rdx
addq $0x3, %rdx
xorl %esi, %esi
callq 0x4190
movq %r13, %rdi
callq 0x4370
xorl %edi, %edi
leaq 0x118c6ad(%rip), %rbx   # 0x11b03ec
cmpl $0x7fff, (%rbx)         # imm = 0x7FFF
setl %dil
movl $0x26, %esi
callq 0xa6ed
movslq (%rbx), %rcx
movq 0x160(%rsp), %rax
movw %cx, 0xa(%rax)
leaq (%rcx,%rcx,4), %rax
leaq 0x118c683(%rip), %rdx   # 0x11b03f0
leaq (%rdx,%rax,8), %rax
incl %ecx
movl %ecx, (%rbx)
movq 0x1c8(%rsp), %rdx
movq 0x20(%rdx), %rcx
movq %rcx, 0x20(%rax)
movupd (%rdx), %xmm0
movups 0x10(%rdx), %xmm1
movups %xmm1, 0x10(%rax)
movupd %xmm0, (%rax)
movq 0xa0(%rsp), %rcx
cmpl $0x1, %ecx
movss 0x16cb0(%rip), %xmm4    # 0x3aa58
je 0x23e1d
movsd 0x163b6(%rip), %xmm0    # 0x3a168
divsd 0x210(%rsp), %xmm0
xorps %xmm1, %xmm1
cvtsi2ss %ecx, %xmm1
movapd %xmm0, %xmm2
unpcklpd %xmm0, %xmm2            # xmm2 = xmm2[0],xmm0[0]
movb $0x1, %cl
xorl %edx, %edx
shlq $0x4, %rdx
cvtps2pd (%rax,%rdx), %xmm3
mulpd %xmm2, %xmm3
cvtpd2ps %xmm3, %xmm3
movlpd %xmm3, (%rax,%rdx)
xorps %xmm3, %xmm3
cvtss2sd 0x8(%rax,%rdx), %xmm3
mulsd %xmm0, %xmm3
cvtsd2ss %xmm3, %xmm3
movss %xmm3, 0x8(%rax,%rdx)
movss 0xc(%rax,%rdx), %xmm3
divss %xmm1, %xmm3
addss %xmm4, %xmm3
movss %xmm3, 0xc(%rax,%rdx)
movl $0x1, %edx
testb $0x1, %cl
movl $0x0, %ecx
jne 0x23dce
leaq 0x82c674(%rip), %rcx    # 0x850498
movq (%rcx), %rcx
movl 0x524db97(%rip), %edx   # 0x52719c4
addl (%rcx), %edx
movl %edx, 0x20(%rax)
movl 0x80(%rsp), %ebx
movl 0x84(%rsp), %r15d
xorl %ecx, %ecx
movl $0x28, %esi
movl %ebx, %eax
sarl %cl, %eax
movl %r15d, %edx
sarl %cl, %edx
imull %eax, %edx
addl %edx, %esi
incl %ecx
cmpl $0x4, %ecx
jne 0x23e48
movq %rsi, 0x8(%rsp)
leal 0x304(%rsi), %eax
movl %eax, 0x40(%rsp)
movslq %eax, %rdi
movq %rdi, 0x30(%rsp)
callq 0x4400
movq %rax, %r14
xorl %edi, %edi
testq %rax, %rax
setne %dil
movl $0x1, %esi
callq 0xa6ed
xorpd %xmm0, %xmm0
movupd %xmm0, 0x10(%r14)
movupd %xmm0, (%r14)
movq $0x0, 0x20(%r14)
movl %ebx, 0x10(%r14)
movl %r15d, 0x14(%r14)
movq %r14, 0x60(%rsp)
leaq 0x28(%r14), %r13
xorl %r14d, %r14d
movq %rbp, %rdx
movl %r13d, %eax
movq 0x60(%rsp), %rcx
subl %ecx, %eax
movl %eax, 0x18(%rcx,%r14,4)
movl %r15d, %eax
movl %r14d, %ecx
sarl %cl, %eax
testl %eax, %eax
jle 0x2404d
xorl %r12d, %r12d
movl %ebx, %eax
movl %r14d, %ecx
sarl %cl, %eax
testl %eax, %eax
jle 0x24039
xorl %r15d, %r15d
movq 0x1f0(%rsp,%r14,8), %rcx
imull %r12d, %eax
addl %r15d, %eax
cltq
cmpb $0x0, 0x3(%rcx,%rax,4)
je 0x24008
testl %edx, %edx
je 0x2400f
movb (%rcx,%rax,4), %dl
movb %dl, 0x88(%rsp)
movb 0x1(%rcx,%rax,4), %dl
movb %dl, 0x89(%rsp)
movb 0x2(%rcx,%rax,4), %al
movb %al, 0x8a(%rsp)
jg 0x23f45
leaq 0x17bac(%rip), %rdi     # 0x3baea
xorl %eax, %eax
callq 0x9f34
movq 0x10(%rsp), %rax
cmpb $0x0, (%rax)
jne 0x23f72
movq 0x10(%rsp), %rax
movslq 0x18(%rax), %rcx
movzbl 0x88(%rsp,%rcx), %ecx
xorl %edx, %edx
cmpl %ecx, 0x1c(%rax)
setle %dl
movq 0x8(%rax,%rdx,8), %rax
cmpb $0x1, (%rax)
jne 0x23f54
movslq 0x20(%rax), %rax
movl %eax, 0x128(%rsp)
leaq (%rax,%rax,2), %rax
addq %rsp, %rax
addq $0x240, %rax            # imm = 0x240
xorl %ecx, %ecx
xorl %edx, %edx
movzbl (%rax,%rcx), %esi
movzbl 0x88(%rsp,%rcx), %edi
subl %edi, %esi
imull %esi, %esi
addl %esi, %edx
incq %rcx
cmpq $0x3, %rcx
jne 0x23f8e
movl %edx, 0x170(%rsp)
xorps %xmm0, %xmm0
cvtsi2sd %edx, %xmm0
sqrtsd %xmm0, %xmm0
addsd 0x16644(%rip), %xmm0    # 0x3a608
callq 0x4090
cvttsd2si %xmm0, %r9d
leaq 0x170(%rsp), %rdi
leaq 0x128(%rsp), %rsi
movq 0x10(%rsp), %rdx
leaq 0x240(%rsp), %rcx
leaq 0x88(%rsp), %r8
callq 0x2483e
movb 0x128(%rsp), %al
movb %al, (%r13)
movq %rbp, %rdx
jmp 0x24014
movb $-0x1, (%r13)
jmp 0x24014
movb $0x0, (%r13)
incq %r13
incl %r15d
movl 0x80(%rsp), %ebx
movl %ebx, %eax
movl %r14d, %ecx
sarl %cl, %eax
cmpl %eax, %r15d
jl 0x23ef1
movl 0x84(%rsp), %r15d
incl %r12d
movl %r15d, %eax
movl %r14d, %ecx
sarl %cl, %eax
cmpl %eax, %r12d
jl 0x23edf
incq %r14
cmpq $0x4, %r14
jne 0x23ebd
movw $0x100, (%r13)          # imm = 0x100
leaq 0x2(%r13), %rdi
movl $0x300, %edx            # imm = 0x300
leaq 0x240(%rsp), %rsi
callq 0x4240
movw $0x0, 0x302(%r13)
addq $0x304, %r13            # imm = 0x304
movq 0x60(%rsp), %rbx
movq %rbx, %rax
movq 0x30(%rsp), %r8
addq %r8, %rax
cmpq %rax, %r13
je 0x240b0
leaq 0x17960(%rip), %rdi     # 0x3ba04
xorl %eax, %eax
callq 0x9f34
movq 0x30(%rsp), %r8
cmpb $0x7b, 0xf0(%rsp)
leaq 0x82c3d5(%rip), %r14    # 0x850494
leaq 0x1b8c33a(%rip), %r15   # 0x1bb0400
movq 0x20(%rsp), %r12
movl 0x40(%rsp), %edi
leaq 0x1b8c31e(%rip), %rbp   # 0x1bb03f4
jne 0x240e4
movb $0x64, 0x4(%rbx)
movl $0x61725f7b, (%rbx)     # imm = 0x61725F7B
jmp 0x240ee
movb $0x64, 0x4(%rbx)
movl $0x61725f5f, (%rbx)     # imm = 0x61725F5F
movl 0x9c(%rsp), %r9d
movzwl %r9w, %eax
movl %eax, %ecx
movl %eax, %esi
imull $0xcccd, %eax, %edx     # imm = 0xCCCD
shrl $0x4, %eax
imull $0x347, %eax, %eax      # imm = 0x347
shrl $0x13, %eax
orb $0x30, %al
movb %al, 0x5(%rbx)
shrl $0x3, %ecx
imull $0x20c5, %ecx, %eax     # imm = 0x20C5
shrl $0x14, %eax
imull $0x67, %eax, %ecx
shrl $0x9, %ecx
andl $-0x2, %ecx
leal (%rcx,%rcx,4), %ecx
subb %cl, %al
orb $0x30, %al
movb %al, 0x6(%rbx)
shrl $0x2, %esi
imull $0x147b, %esi, %eax     # imm = 0x147B
shrl $0x11, %eax
imull $0x199a, %eax, %ecx     # imm = 0x199A
shrl $0xf, %ecx
andl $-0x2, %ecx
leal (%rcx,%rcx,4), %ecx
subl %ecx, %eax
orb $0x30, %al
movb %al, 0x7(%rbx)
shrl $0x13, %edx
imull $0x199a, %edx, %eax     # imm = 0x199A
shrl $0xf, %eax
andl $-0x2, %eax
leal (%rax,%rax,4), %eax
movl %edx, %ecx
subl %eax, %ecx
orb $0x30, %cl
movb %cl, 0x8(%rbx)
addl %edx, %edx
leal (%rdx,%rdx,4), %eax
subl %eax, %r9d
orb $0x30, %r9b
movb %r9b, 0x9(%rbx)
xorl %eax, %eax
movq 0x8(%rsp), %rdx
cmpq $0x24, %rax
jb 0x24194
leal 0x3d(%rax), %ecx
jmp 0x241a4
cmpq $0xa, %rax
jb 0x2419f
leal 0x37(%rax), %ecx
jmp 0x241a4
movl %eax, %ecx
orl $0x30, %ecx
movb %cl, 0x170(%rsp,%rax)
incq %rax
cmpq $0x3e, %rax
jne 0x24189
xorl %eax, %eax
movw $0x0, 0xe(%rbx)
movl $0x0, 0xa(%rbx)
cmpl $0xfffffcfd, %edx       # imm = 0xFFFFFCFD
jl 0x241e4
xorl %ecx, %ecx
xorl %eax, %eax
movl %eax, %edx
shll $0x5, %edx
subl %eax, %edx
movzbl (%rbx,%rcx), %eax
addl %edx, %eax
incq %rcx
cmpq %rcx, %r8
jne 0x241cf
movl %eax, %ecx
movl $0x8864298f, %edx       # imm = 0x8864298F
imulq %rdx, %rcx
shrq $0x2b, %rcx
imulq $0x4ec4ec5, %rcx, %rdx  # imm = 0x4EC4EC5
shrq $0x20, %rdx
imull $0x34, %edx, %edx
subl %edx, %ecx
leaq 0x170(%rsp), %rdx
movb 0xa(%rcx,%rdx), %cl
movb %cl, 0xa(%rbx)
movl %eax, %ecx
shrl %ecx
movl $0x84210843, %edx       # imm = 0x84210843
imulq %rdx, %rcx
shrq $0x24, %rcx
imulq $0x8421085, %rcx, %rdx  # imm = 0x8421085
shrq $0x21, %rdx
movl %edx, %esi
shll $0x6, %esi
addl %edx, %edx
subl %esi, %edx
addl %ecx, %edx
movb 0x170(%rsp,%rdx), %dl
movb %dl, 0xb(%rbx)
movl %ecx, %edx
shll $0x6, %edx
addl %ecx, %ecx
subl %edx, %ecx
addl %eax, %ecx
movb 0x170(%rsp,%rcx), %al
movb %al, 0xc(%rbx)
movq %rbx, %r13
movq 0x108(%rsp), %rbx
movslq %ebx, %rbx
imulq $-0x7bdef7bd, %rbx, %rax # imm = 0x84210843
shrq $0x20, %rax
addl %ebx, %eax
movl %eax, %ecx
shrl $0x1f, %ecx
sarl $0x5, %eax
addl %ecx, %eax
cltq
imulq $-0x7bdef7bd, %rax, %rcx # imm = 0x84210843
shrq $0x20, %rcx
addl %eax, %ecx
movl %ecx, %edx
shrl $0x1f, %edx
sarl $0x5, %ecx
addl %edx, %ecx
movl %ecx, %edx
shll $0x6, %edx
addl %ecx, %ecx
subl %edx, %ecx
addl %eax, %ecx
movslq %ecx, %rcx
movb 0x170(%rsp,%rcx), %cl
movb %cl, 0xd(%r13)
movl %eax, %ecx
shll $0x6, %ecx
addl %eax, %eax
subl %ecx, %eax
addl %ebx, %eax
cltq
movb 0x170(%rsp,%rax), %al
movb %al, 0xe(%r13)
movb $0x0, 0xf(%r13)
movq %r13, %rsi
callq 0x22539
incl %ebx
movq %rbx, 0x108(%rsp)
leaq (%r12,%r12,2), %rax
leaq 0x4c1f627(%rip), %rcx   # 0x4c43910
cvtss2sd (%rcx,%rax,4), %xmm0
cvtss2sd 0x4(%rcx,%rax,4), %xmm1
cvtss2sd 0x8(%rcx,%rax,4), %xmm2
movl $0x3, %edi
leaq 0x17732(%rip), %rsi     # 0x3ba38
movq %r13, %rdx
leaq 0xf0(%rsp), %rcx
movb $0x3, %al
callq 0xa446
movq %r13, %rdi
callq 0x4370
movq 0x10(%rsp), %rdi
callq 0x4370
movq 0x70(%rsp), %rdi
callq 0x4370
xorl %ebx, %ebx
movq 0x1f0(%rsp,%rbx,8), %rdi
callq 0x4370
incq %rbx
cmpq $0x4, %rbx
jne 0x24336
movl 0x40(%rsp), %eax
addl %eax, 0x98(%rsp)
leaq 0x118c08e(%rip), %r8    # 0x11b03ec
leaq 0x118c08b(%rip), %r9    # 0x11b03f0
leaq 0x82c12c(%rip), %r10    # 0x850498
jmp 0x228f4
callq 0x225d1
testb $0x1, 0x110(%rsp)
je 0x2439d
leaq 0x176f4(%rip), %rdi     # 0x3ba7b
movq 0x108(%rsp), %rsi
movl 0x98(%rsp), %edx
xorl %eax, %eax
callq 0x9c46
addq $0x548, %rsp            # imm = 0x548
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
addq $0x548, %rsp            # imm = 0x548
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x225d1