// File: /workspace/github_cpp_makefile_star2_O1/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 $0x568, %rsp            # imm = 0x568
leaq 0x82e06c(%rip), %rax    # 0x851484
cmpl $0x0, (%rax)
je 0x250ff
leaq 0x82e06c(%rip), %r14    # 0x851494
cmpl $0x0, (%r14)
je 0x250ff
leaq 0x54d75f2(%rip), %rax   # 0x54faa2b
cmpb $0x0, (%rax)
jne 0x250ff
leaq 0x1b8dfab(%rip), %rbp   # 0x1bb13f4
cmpl $0x0, (%rbp)
jle 0x250d9
leaq 0x1b8dfa6(%rip), %r12   # 0x1bb1400
leaq 0x118df8b(%rip), %r8    # 0x11b13ec
leaq 0x118df88(%rip), %r9    # 0x11b13f0
leaq 0x82e029(%rip), %r10    # 0x851498
leaq 0xa0(%rsp), %rdi
xorl %r15d, %r15d
movq $0x0, 0x110(%rsp)
movl $0x0, 0xcc(%rsp)
movq $0x0, 0x118(%rsp)
leaq (%r15,%r15,4), %rax
cmpl $-0x1, 0x10(%r12,%rax,4)
je 0x2358c
leaq (%r12,%rax,4), %rax
movswl 0xa(%rax), %r13d
testl %r13d, %r13d
js 0x2358c
cmpl %r13d, (%r8)
jle 0x2358c
movq %rax, 0x170(%rsp)
movl (%r14), %eax
testl %eax, %eax
je 0x234de
movq (%r10), %rcx
movl (%rcx), %ecx
jmp 0x234e0
xorl %ecx, %ecx
movl %r13d, %edx
leaq (%rdx,%rdx,4), %rbx
movl 0x20(%r9,%rbx,8), %edx
testl %edx, %edx
setns %sil
cmpl %edx, %ecx
setg %r11b
andb %sil, %r11b
cmpb $0x1, %r11b
jne 0x2358c
movl %r13d, 0x13c(%rsp)
movq (%r10), %r13
movslq 0x4(%r13,%rdx,4), %rdx
testq %rdx, %rdx
js 0x2358c
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 0x2358c
leaq 0x52d54a0(%rip), %rax   # 0x52f89e0
movq %r15, 0x78(%rsp)
movq (%rax,%r15,8), %r12
movl $0x10, %edx
movq %r13, %rsi
movq %rdi, %r15
callq 0x899d
movq %r15, %rdi
movq %r13, %rsi
callq 0x4440
testl %eax, %eax
je 0x235a1
leaq 0x1b8de91(%rip), %r12   # 0x1bb1400
leaq 0x118de76(%rip), %r8    # 0x11b13ec
leaq 0x118de73(%rip), %r9    # 0x11b13f0
leaq 0x82df14(%rip), %r10    # 0x851498
movq %r15, %rdi
movq 0x78(%rsp), %r15
incq %r15
movslq (%rbp), %rax
cmpq %rax, %r15
jl 0x2349d
jmp 0x250c0
movq %r15, %rdi
callq 0x4150
cmpq $0x5, %rax
jb 0x235d0
movl $0x4, %edx
leaq 0xa1(%rsp), %rdi
leaq 0x19530(%rip), %rsi     # 0x3caf3
callq 0x43f0
testl %eax, %eax
je 0x23725
cmpq 0x249f1(%rip), %r12     # 0x47fc8
leaq 0xa0(%rsp), %rdi
leaq 0x19449(%rip), %r15     # 0x3ca2f
je 0x23704
movl 0xa0(%rsp), %eax
movl $0x6b73, %ecx           # imm = 0x6B73
xorl %ecx, %eax
movzbl 0xa2(%rsp), %ecx
xorl $0x79, %ecx
orw %ax, %cx
leaq 0x118dddd(%rip), %r8    # 0x11b13ec
leaq 0x118ddda(%rip), %r9    # 0x11b13f0
leaq 0x82de7b(%rip), %r10    # 0x851498
je 0x236f8
leaq (%r9,%rbx,8), %rax
testb $0x1, 0x24(%rax)
jne 0x236f8
movq %rax, 0x1e8(%rsp)
movslq 0x20(%rax), %rax
imulq $0x330, %rax, %rax      # imm = 0x330
addq 0x524f35d(%rip), %rax   # 0x52729a8
movq %rax, 0x120(%rsp)
movq %r12, %rdi
leaq 0x193ad(%rip), %rsi     # 0x3ca0a
callq 0x76a7
testl %eax, %eax
je 0x23725
testb $0x1, 0x118(%rsp)
jne 0x236ac
leaq 0x165fd(%rip), %rbx     # 0x39c78
movq %rbx, %rdi
xorl %eax, %eax
callq 0x9d2e
leaq 0x19391(%rip), %rdi     # 0x3ca1d
xorl %eax, %eax
callq 0x9d2e
movl $0x3, %edi
movq %rbx, %rsi
xorl %eax, %eax
callq 0xa52e
movb $0x1, %al
movq %rax, 0x118(%rsp)
movq %r12, %rdi
movq %r15, %rsi
callq 0x76a7
testl %eax, %eax
je 0x2374e
movq %r12, %rdi
movq %r15, %rsi
callq 0x76a7
movl %eax, %esi
leal -0x11(%rsi), %eax
cmpl $-0x10, %eax
movq %rsi, 0xd0(%rsp)
jb 0x236e3
leal 0x1f(%rsi), %eax
testl %esi, %eax
je 0x2375b
leaq 0x19362(%rip), %rdi     # 0x3ca4c
movl $0x10, %edx
xorl %eax, %eax
callq 0xa01c
jmp 0x2375b
leaq 0x1b8dd01(%rip), %r12   # 0x1bb1400
jmp 0x23587
leaq 0x1b8dcf5(%rip), %r12   # 0x1bb1400
leaq 0x118dcda(%rip), %r8    # 0x11b13ec
leaq 0x118dcd7(%rip), %r9    # 0x11b13f0
leaq 0x82dd78(%rip), %r10    # 0x851498
jmp 0x23587
leaq 0x1b8dcd4(%rip), %r12   # 0x1bb1400
leaq 0x118dcb9(%rip), %r8    # 0x11b13ec
leaq 0x118dcb6(%rip), %r9    # 0x11b13f0
leaq 0x82dd57(%rip), %r10    # 0x851498
leaq 0xa0(%rsp), %rdi
jmp 0x23587
movl $0x1, %eax
movq %rax, 0xd0(%rsp)
leaq 0x1b8dc9e(%rip), %r12   # 0x1bb1400
movq 0x78(%rsp), %rbx
movl %ebx, %edi
leaq 0x180(%rsp), %rsi
leaq 0x208(%rsp), %rdx
callq 0x5c5a
movq 0x208(%rsp), %xmm1
movq 0x180(%rsp), %xmm0
psubd %xmm0, %xmm1
movq %xmm1, 0x178(%rsp)
pshufd $0x50, %xmm1, %xmm0     # xmm0 = xmm1[0,0,1,1]
pxor 0x148e6(%rip), %xmm0    # 0x38090
pcmpgtd 0x18dfe(%rip), %xmm0    # 0x3c5b0
movmskpd %xmm0, %eax
testl %eax, %eax
je 0x237f2
leaq (%rbx,%rbx,2), %rax
leaq 0x4c2114b(%rip), %rcx   # 0x4c44910
xorps %xmm0, %xmm0
cvtss2sd (%rcx,%rax,4), %xmm0
xorps %xmm1, %xmm1
cvtss2sd 0x4(%rcx,%rax,4), %xmm1
cvtss2sd 0x8(%rcx,%rax,4), %xmm2
leaq 0x192a3(%rip), %rdi     # 0x3ca86
movb $0x3, %al
callq 0xa38e
movq %rbx, %r15
jmp 0x2509e
movq 0xd0(%rsp), %r13
leal (,%r13,4), %esi
leal -0x1(%r13), %edi
xorl %r8d, %r8d
movl 0x178(%rsp,%r8,4), %r9d
shll $0x4, %r9d
leal 0x10(%r9), %ecx
leal (%r9,%rsi), %eax
cmpl %eax, %ecx
cmovgl %ecx, %eax
addl %edi, %eax
cltd
idivl %r13d
leal 0xf(%rax), %ecx
addl $0x1e, %eax
testl %ecx, %ecx
cmovnsl %ecx, %eax
andl $-0x10, %eax
movl %eax, 0x30(%rsp,%r8,4)
xorl %ecx, %ecx
movl $0x1, %edx
shll %cl, %edx
cmpl %eax, %edx
jge 0x23851
incl %ecx
cmpl $0x1f, %ecx
jne 0x2383d
jmp 0x23856
movl %edx, 0x30(%rsp,%r8,4)
movl 0x30(%rsp,%r8,4), %eax
imull %r13d, %eax
subl %r9d, %eax
movl %eax, %ecx
shrl $0x1f, %ecx
addl %eax, %ecx
sarl %ecx
movl %ecx, 0x188(%rsp,%r8,4)
leaq 0x1(%r8), %rax
testq %r8, %r8
movq %rax, %r8
je 0x23809
movdqa %xmm1, 0x10(%rsp)
movq 0x30(%rsp), %rbp
movq %rbp, %xmm0
movdqa %xmm0, 0x140(%rsp)
pshufd $0x55, %xmm0, %xmm0     # xmm0 = xmm0[1,1,1,1]
movd %xmm0, %ebx
movl %ebx, %eax
imull %ebp, %eax
cltq
movq %rax, 0x1e0(%rsp)
leaq (,%rax,4), %rax
leaq (%rax,%rax,4), %rdi
callq 0x4410
xorl %edi, %edi
movq %rax, 0x80(%rsp)
testq %rax, %rax
setne %dil
movl $0x1, %esi
callq 0xa7c9
xorl %r12d, %r12d
movl %ebp, %eax
movl %r12d, %ecx
sarl %cl, %eax
movl %ebx, %edx
sarl %cl, %edx
imull %eax, %edx
movslq %edx, %rdi
shlq $0x2, %rdi
callq 0x4410
movq %rax, 0x210(%rsp,%r12,8)
xorl %edi, %edi
testq %rax, %rax
setne %dil
movl $0x1, %esi
callq 0xa7c9
incq %r12
cmpq $0x4, %r12
jne 0x238df
movl %ebp, %eax
movq %rax, 0xd8(%rsp)
movl %ebx, %eax
movq %rax, 0x108(%rsp)
movl %ebx, 0x5c(%rsp)
testl %ebx, %ebx
movq 0x80(%rsp), %rcx
movdqa 0x10(%rsp), %xmm1
jle 0x2399a
movq 0xd8(%rsp), %rax
leaq (,%rax,4), %rax
leaq (%rax,%rax,4), %r12
xorl %ebx, %ebx
movq 0x108(%rsp), %r14
testl %ebp, %ebp
jle 0x23993
movl %ebx, %eax
leaq (%rax,%rax,4), %rax
movq 0x80(%rsp), %rcx
leaq (%rcx,%rax,4), %rdi
xorl %esi, %esi
movq %r12, %rdx
callq 0x4190
movdqa 0x10(%rsp), %xmm1
movq 0x80(%rsp), %rcx
addl %ebp, %ebx
decq %r14
jne 0x23965
movq %rbp, 0xe0(%rsp)
movl 0x18c(%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 %r13d, %xmm0
movapd %xmm0, 0x230(%rsp)
movl %edx, 0x138(%rsp)
movl %eax, 0x8c(%rsp)
cmpl %eax, %edx
jle 0x24067
movl 0x188(%rsp), %eax
movd %xmm1, %edx
shll $0x4, %edx
addl %eax, %edx
movl %edx, 0xe8(%rsp)
negl %eax
movl %eax, 0xc8(%rsp)
xorl %eax, %eax
cmpl $0x1, 0xd0(%rsp)
movdqa 0x140(%rsp), %xmm0
cvtdq2pd %xmm0, %xmm1
sete %al
movaps %xmm1, 0x1d0(%rsp)
xorps 0x17d07(%rip), %xmm1    # 0x3b730
movaps %xmm1, 0x250(%rsp)
paddd 0x18bf7(%rip), %xmm0    # 0x3c630
movdqa %xmm0, 0x140(%rsp)
movq 0x120(%rsp), %rdx
leaq 0x20(%rdx), %rdx
movq %rdx, 0x1f0(%rsp)
movaps 0x230(%rsp), %xmm0
movlhps %xmm0, %xmm0            # xmm0 = xmm0[0,0]
movaps %xmm0, 0x90(%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, 0x240(%rsp)
movl 0xc8(%rsp), %eax
cmpl %eax, 0xe8(%rsp)
jle 0x2404a
movss 0x8c(%rsp), %xmm0
movaps %xmm0, 0x150(%rsp)
movl 0xc8(%rsp), %edx
movq 0x120(%rsp), %rax
movl 0x10(%rax), %r14d
movl 0x14(%rax), %ebx
xorps %xmm0, %xmm0
cvtsi2sd %r14d, %xmm0
movsd %xmm0, 0x60(%rsp)
xorps %xmm0, %xmm0
cvtsi2sd %ebx, %xmm0
movsd %xmm0, 0x8(%rsp)
leal -0x1(%r14), %r13d
decl %ebx
movq 0x180(%rsp), %xmm0
movdqa %xmm0, 0xf0(%rsp)
pslld $0x4, %xmm0
movl %edx, 0x50(%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 0x18a9e(%rip), %xmm1    # 0x3c5c0
addpd %xmm1, %xmm2
movapd %xmm2, 0x20(%rsp)
movapd %xmm2, %xmm0
divpd 0x90(%rsp), %xmm0
addpd %xmm1, %xmm0
movapd %xmm2, %xmm1
movapd 0x240(%rsp), %xmm2
andpd %xmm2, %xmm1
andnpd %xmm0, %xmm2
orpd %xmm1, %xmm2
movapd %xmm2, 0x40(%rsp)
movapd %xmm2, %xmm0
divpd 0x1d0(%rsp), %xmm0
movapd %xmm0, 0x160(%rsp)
callq 0x4580
movapd %xmm0, 0x10(%rsp)
movapd 0x160(%rsp), %xmm0
unpckhpd %xmm0, %xmm0            # xmm0 = xmm0[1,1]
callq 0x4580
movapd 0x10(%rsp), %xmm1
unpcklpd %xmm0, %xmm1            # xmm1 = xmm1[0],xmm0[0]
mulpd 0x250(%rsp), %xmm1
addpd 0x40(%rsp), %xmm1
movapd %xmm1, 0x10(%rsp)
movapd %xmm1, %xmm0
callq 0x4580
movapd %xmm0, 0x40(%rsp)
movapd 0x10(%rsp), %xmm0
unpckhpd %xmm0, %xmm0            # xmm0 = xmm0[1,1]
callq 0x4580
movapd 0x40(%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, 0x40(%rsp)
movapd 0x20(%rsp), %xmm0
divsd 0x60(%rsp), %xmm0
callq 0x4580
mulsd 0x60(%rsp), %xmm0
movapd 0x20(%rsp), %xmm1
movapd %xmm1, %xmm2
subsd %xmm0, %xmm2
movapd %xmm2, 0x160(%rsp)
movapd %xmm1, %xmm0
unpckhpd %xmm1, %xmm0            # xmm0 = xmm0[1],xmm1[1]
movapd %xmm0, 0x60(%rsp)
divsd 0x8(%rsp), %xmm0
callq 0x4580
mulsd 0x8(%rsp), %xmm0
movapd 0x60(%rsp), %xmm1
subsd %xmm0, %xmm1
movapd %xmm1, 0x60(%rsp)
movapd 0x160(%rsp), %xmm0
callq 0x4580
cvttsd2si %xmm0, %ebp
movapd 0x60(%rsp), %xmm0
callq 0x4580
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 %r14d, %ebx
addl %ebp, %ebx
movslq %ebx, %rax
movzbl (%r12,%rax), %eax
movq %rax, 0x60(%rsp)
leaq (%rax,%rax,2), %rax
movq 0x1f0(%rsp), %rdx
movb (%rdx,%rax), %cl
movb %cl, 0x3d(%rsp)
movb 0x1(%rdx,%rax), %cl
movb %cl, 0x3e(%rsp)
movb 0x2(%rdx,%rax), %al
movb %al, 0x3f(%rsp)
cvtdq2pd 0x40(%rsp), %xmm0
addpd 0x188d6(%rip), %xmm0    # 0x3c5c0
subpd 0x10(%rsp), %xmm0
mulpd 0x90(%rsp), %xmm0
addpd 0x20(%rsp), %xmm0
mulpd 0x188c9(%rip), %xmm0    # 0x3c5d0
cvtdq2pd 0xf0(%rsp), %xmm1
subpd %xmm1, %xmm0
movapd %xmm0, 0x10(%rsp)
callq 0x4580
movapd %xmm0, 0x20(%rsp)
movapd 0x10(%rsp), %xmm0
unpckhpd %xmm0, %xmm0            # xmm0 = xmm0[1,1]
callq 0x4580
movapd 0x10(%rsp), %xmm3
movapd 0x20(%rsp), %xmm1
unpcklpd %xmm0, %xmm1            # xmm1 = xmm1[0],xmm0[0]
cvttpd2dq %xmm1, %xmm0
cvtdq2pd %xmm0, %xmm1
subpd %xmm1, %xmm3
minpd 0x18888(%rip), %xmm3    # 0x3c5e0
movapd %xmm3, %xmm1
cmpltpd 0x1799b(%rip), %xmm1    # 0x3b700
movmskpd %xmm1, %eax
xorpd %xmm2, %xmm2
xorpd %xmm1, %xmm1
testb $0x1, %al
jne 0x23d79
movapd %xmm3, %xmm1
movapd %xmm1, 0x10(%rsp)
testb $0x2, %al
movq 0xe0(%rsp), %rcx
jne 0x23d93
unpckhpd %xmm3, %xmm3            # xmm3 = xmm3[1,1]
movapd %xmm3, %xmm2
movapd %xmm2, 0x20(%rsp)
movdqa 0x40(%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), %r14
movd %xmm0, %r13d
pshufd $0x55, %xmm0, %xmm0     # xmm0 = xmm0[1,1,1,1]
movd %xmm0, %r12d
movq 0x170(%rsp), %rbp
movq %rbp, %rdi
leaq 0x178(%rsp), %r15
movq %r15, %rsi
movl %r13d, %edx
movl %r12d, %ecx
leaq 0x260(%rsp), %r8
callq 0x25111
leal 0x1(%r13), %ebx
movq %rbp, %rdi
movq %r15, %rsi
movl %ebx, %edx
movl %r12d, %ecx
leaq 0x190(%rsp), %r8
callq 0x25111
incl %r12d
movq %rbp, %rdi
movq %r15, %rsi
movl %r13d, %edx
movl %r12d, %ecx
leaq 0x128(%rsp), %r8
callq 0x25111
movq %rbp, %rdi
movq %r15, %rsi
movl %ebx, %edx
movl %r12d, %ecx
leaq 0xb8(%rsp), %r8
callq 0x25111
movsd 0x17320(%rip), %xmm5    # 0x3b168
movapd %xmm5, %xmm1
movapd 0x20(%rsp), %xmm7
subsd %xmm7, %xmm1
cvtps2pd 0x260(%rsp), %xmm4
xorps %xmm0, %xmm0
cvtss2sd 0x268(%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 0x198(%rsp), %xmm0
mulsd %xmm1, %xmm0
cvtsd2ss %xmm0, %xmm0
cvtss2sd %xmm0, %xmm0
xorps %xmm3, %xmm3
cvtss2sd 0xc0(%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 0x190(%rsp), %xmm5
mulpd %xmm1, %xmm5
cvtpd2ps %xmm5, %xmm1
cvtps2pd %xmm1, %xmm1
cvtps2pd 0xb8(%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, 0x1f8(%rsp)
xorps %xmm1, %xmm1
cvtss2sd %xmm2, %xmm1
cvtss2sd %xmm0, %xmm0
mulsd %xmm6, %xmm0
addsd %xmm1, %xmm0
cvtsd2ss %xmm0, %xmm0
movss %xmm0, 0x200(%rsp)
movq 0x80(%rsp), %rcx
movss 0x10(%rcx,%r14,4), %xmm0
addss 0x141a6(%rip), %xmm0    # 0x38138
movss %xmm0, 0x10(%rcx,%r14,4)
cmpq $0xff, 0x60(%rsp)
jne 0x23fb2
cmpb $0x7b, 0xa0(%rsp)
je 0x24037
leaq (%rcx,%r14,4), %rbx
xorl %r14d, %r14d
movzbl 0x3d(%rsp,%r14), %eax
xorps %xmm0, %xmm0
cvtsi2ss %eax, %xmm0
movss %xmm0, 0x10(%rsp)
movss 0x1f8(%rsp,%r14,4), %xmm0
divss 0x1868a(%rip), %xmm0    # 0x3c668
movss 0x18686(%rip), %xmm1    # 0x3c66c
callq 0x4510
mulss 0x10(%rsp), %xmm0
movss 0x17a9f(%rip), %xmm2    # 0x3ba98
minss %xmm2, %xmm0
xorps %xmm1, %xmm1
maxss %xmm0, %xmm1
mulss %xmm2, %xmm1
addss (%rbx,%r14,4), %xmm1
movss %xmm1, (%rbx,%r14,4)
incq %r14
cmpq $0x3, %r14
jne 0x23fb9
movss 0xc(%rbx), %xmm0
addss 0x17a6e(%rip), %xmm0    # 0x3ba98
movss %xmm0, 0xc(%rbx)
movq 0x80(%rsp), %rcx
movl 0x50(%rsp), %edx
incl %edx
cmpl 0xe8(%rsp), %edx
jl 0x23ab6
movl 0x8c(%rsp), %eax
incl %eax
movl %eax, 0x8c(%rsp)
cmpl 0x138(%rsp), %eax
jl 0x23a8a
cmpl $0x0, 0x5c(%rsp)
movq 0xd8(%rsp), %rdx
jle 0x241d6
movq 0x210(%rsp), %rsi
leaq (,%rdx,4), %rax
movq %rax, 0x90(%rsp)
leaq (%rax,%rax,4), %rax
movq %rax, 0x50(%rsp)
movq %rcx, 0x60(%rsp)
movq %rsi, 0x40(%rsp)
movq $0x0, 0x8(%rsp)
movq %rsi, 0x20(%rsp)
cmpl $0x0, 0xe0(%rsp)
jle 0x2419a
movq 0x8(%rsp), %r15
imulq %rdx, %r15
movq 0x60(%rsp), %rbp
movq 0x40(%rsp), %r12
xorl %r13d, %r13d
leaq (%r15,%r13), %r14
leaq (%r14,%r14,4), %rax
movss 0x10(%rcx,%rax,4), %xmm0
ucomiss 0x14058(%rip), %xmm0    # 0x38144
jne 0x240fd
jp 0x240fd
movl $0xff000000, (%rsi,%r14,4) # imm = 0xFF000000
jmp 0x24186
leaq (%rcx,%rax,4), %rax
movss 0xc(%rax), %xmm1
movss %xmm1, 0x10(%rsp)
divss %xmm0, %xmm1
movss 0x18558(%rip), %xmm0    # 0x3c670
ucomiss %xmm1, %xmm0
jae 0x2417e
xorl %ebx, %ebx
movss (%rbp,%rbx,4), %xmm0
divss 0x10(%rsp), %xmm0
cvtss2sd %xmm0, %xmm0
addsd 0x171c9(%rip), %xmm0    # 0x3b300
callq 0x4580
cvttsd2si %xmm0, %eax
movl $0xff, %ecx
cmpl %ecx, %eax
jl 0x2414e
movl $0xff, %eax
testl %eax, %eax
jg 0x24154
xorl %eax, %eax
movb %al, (%r12,%rbx)
incq %rbx
cmpq $0x3, %rbx
jne 0x2411f
movq 0x20(%rsp), %rsi
movb $-0x1, 0x3(%rsi,%r14,4)
movq 0x80(%rsp), %rcx
movq 0xd8(%rsp), %rdx
jmp 0x24186
movl $0x0, (%rsi,%r14,4)
incq %r13
addq $0x4, %r12
addq $0x14, %rbp
cmpq %rdx, %r13
jne 0x240d7
movq 0x8(%rsp), %rdi
incq %rdi
movq 0x40(%rsp), %rax
addq 0x90(%rsp), %rax
movq %rax, 0x40(%rsp)
movq 0x60(%rsp), %rax
addq 0x50(%rsp), %rax
movq %rax, 0x60(%rsp)
movq %rdi, 0x8(%rsp)
cmpq 0x108(%rsp), %rdi
jne 0x240b3
movl $0x1, %ecx
movl 0x5c(%rsp), %eax
movq %rcx, 0x150(%rsp)
sarl %cl, %eax
testl %eax, %eax
jle 0x2446a
movq 0xe0(%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, 0x160(%rsp)
movq %rcx, 0x1d0(%rsp)
leaq (,%rcx,4), %rax
movq %rax, 0xe8(%rsp)
movq $0x0, 0x50(%rsp)
movq $0x0, 0xf0(%rsp)
movq %r8, 0x90(%rsp)
testl %r8d, %r8d
jle 0x24437
movq 0x150(%rsp), %rcx
movq 0x208(%rsp,%rcx,8), %rax
movq 0x210(%rsp,%rcx,8), %r9
movq 0xf0(%rsp), %rdx
movq %rdx, %r10
imulq 0x1d0(%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), %r14
movq 0x50(%rsp), %rax
leaq (%r9,%rax), %rbp
xorl %ebx, %ebx
movq %r9, 0x20(%rsp)
movq %r10, 0x60(%rsp)
movq %r11, 0x40(%rsp)
movq %r14, 0x8(%rsp)
leaq (%rbx,%r10), %r12
leaq (%r11,%rbx,8), %rax
movq %rax, 0x260(%rsp)
leaq (%r11,%rbx,8), %rax
addq $0x4, %rax
movq %rax, 0x268(%rsp)
leaq (%r14,%rbx,8), %rax
movq %rax, 0x270(%rsp)
leaq 0x4(%r14,%rbx,8), %rax
movq %rax, 0x278(%rsp)
xorpd %xmm0, %xmm0
movapd %xmm0, 0x190(%rsp)
movapd %xmm0, 0x1a0(%rsp)
xorl %eax, %eax
movq 0x260(%rsp,%rax,8), %rcx
movzbl 0x3(%rcx), %edx
xorl %esi, %esi
movzbl (%rcx,%rsi), %edi
imull %edx, %edi
xorps %xmm0, %xmm0
cvtsi2sd %edi, %xmm0
addsd 0x190(%rsp,%rsi,8), %xmm0
movsd %xmm0, 0x190(%rsp,%rsi,8)
incq %rsi
cmpq $0x3, %rsi
jne 0x2432f
movq 0x260(%rsp,%rax,8), %rcx
movzbl 0x3(%rcx), %ecx
xorps %xmm0, %xmm0
cvtsi2sd %ecx, %xmm0
addsd 0x1a8(%rsp), %xmm0
movsd %xmm0, 0x1a8(%rsp)
incq %rax
cmpq $0x4, %rax
jne 0x24321
movsd 0x1a8(%rsp), %xmm2
movapd %xmm2, %xmm0
mulsd 0x182b5(%rip), %xmm0    # 0x3c650
movsd 0x182b5(%rip), %xmm1    # 0x3c658
ucomisd %xmm0, %xmm1
jae 0x2441f
xorl %r14d, %r14d
xorl %r13d, %r13d
movl $0xff, %r15d
movsd %xmm2, 0x10(%rsp)
movsd 0x190(%rsp,%r14,8), %xmm0
divsd %xmm2, %xmm0
addsd 0x16f2f(%rip), %xmm0    # 0x3b300
callq 0x4580
movsd 0x10(%rsp), %xmm2
cvttsd2si %xmm0, %eax
cmpl %r15d, %eax
cmovgel %r15d, %eax
testl %eax, %eax
cmovlel %r13d, %eax
movb %al, (%rbp,%r14)
incq %r14
cmpq $0x3, %r14
jne 0x243bb
movq 0x20(%rsp), %r9
movb $-0x1, 0x3(%r9,%r12,4)
movq 0x90(%rsp), %r8
movq 0x60(%rsp), %r10
movq 0x40(%rsp), %r11
movq 0x8(%rsp), %r14
jmp 0x24427
movl $0x0, (%r9,%r12,4)
incq %rbx
addq $0x4, %rbp
cmpq %r8, %rbx
jne 0x242d0
movq 0xf0(%rsp), %rcx
incq %rcx
movq 0x50(%rsp), %rax
addq 0xe8(%rsp), %rax
movq %rax, 0x50(%rsp)
movq %rcx, 0xf0(%rsp)
cmpq 0x160(%rsp), %rcx
jne 0x24258
movq 0x150(%rsp), %rcx
incq %rcx
cmpq $0x4, %rcx
movl 0x5c(%rsp), %eax
jne 0x241df
movl $0x4fd8, %edi           # imm = 0x4FD8
callq 0x4410
xorl %edi, %edi
movq %rax, 0x10(%rsp)
testq %rax, %rax
setne %dil
movl $0x1, %esi
callq 0xa7c9
movl $0x100, %r12d           # imm = 0x100
cmpb $0x7b, 0xa0(%rsp)
jne 0x244ea
movq 0x120(%rsp), %rcx
movb 0x31d(%rcx), %al
movb %al, 0x55d(%rsp)
movb 0x31e(%rcx), %al
movb %al, 0x55e(%rsp)
movb 0x31f(%rcx), %al
movb %al, 0x55f(%rsp)
movl $0xff, %r12d
movq 0x1e0(%rsp), %rax
leaq (%rax,%rax,2), %rdi
callq 0x4410
movq %rax, %r13
xorl %edi, %edi
testq %rax, %rax
setne %dil
movl $0x1, %esi
callq 0xa7c9
movq $0x0, 0x20(%rsp)
movl $0x0, %r14d
cmpl $0x0, 0x5c(%rsp)
leaq 0x1b8cec8(%rip), %rbp   # 0x1bb13f4
leaq 0x260(%rsp), %r15
movq 0xd8(%rsp), %r9
jle 0x245a9
movq 0x210(%rsp), %rax
addq $0x3, %rax
leaq (,%r9,4), %rcx
xorl %edx, %edx
xorl %r14d, %r14d
cmpl $0x0, 0xe0(%rsp)
jle 0x24599
xorl %esi, %esi
cmpb $0x0, (%rax,%rsi,4)
je 0x24591
movb -0x3(%rax,%rsi,4), %dil
movslq %r14d, %r14
leaq (%r14,%r14,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)
incl %r14d
incq %rsi
cmpq %rsi, %r9
jne 0x24563
incq %rdx
addq %rcx, %rax
cmpq 0x108(%rsp), %rdx
jne 0x24557
testl %r14d, %r14d
jle 0x24a39
movl %r14d, %eax
leaq (%rax,%rax,2), %rbp
movq %rbp, %rdi
callq 0x4410
movq %rax, %rbx
xorl %edi, %edi
testq %rax, %rax
movq %rax, 0xf0(%rsp)
setne %dil
movl $0x1, %esi
callq 0xa7c9
movq %rbx, %rdi
movq %r13, %rsi
movq %rbp, %rdx
callq 0x4250
leal -0x1(,%r12,2), %eax
movq %rax, %rbp
imulq $0x70, %rax, %rdi
callq 0x4410
movq %rax, %rbx
xorl %edi, %edi
testq %rax, %rax
setne %dil
movl $0x1, %esi
callq 0xa7c9
movb $0x1, (%rbx)
movq $0x0, 0x8(%rbx)
movl %r14d, 0x20(%rbx)
movq 0xf0(%rsp), %rax
movq %rax, 0x28(%rbx)
movq %rbx, %rdi
callq 0x2521f
movl $0x1, %r9d
movl $0x1, %edx
movq %rbx, 0x90(%rsp)
movq %r12, 0x50(%rsp)
movl %r9d, %edi
xorl %esi, %esi
testl %r9d, %r9d
jle 0x246a6
movq %rdi, %rcx
movq %rbx, %rax
cmpb $0x1, (%rax)
jne 0x2469d
cmpb $0x1, 0x48(%rax)
jne 0x2469d
testb $0x1, %sil
je 0x2468c
movsd 0x68(%rax), %xmm0
movsd 0x20(%rsp), %xmm1
addsd 0x16fd2(%rip), %xmm1    # 0x3b658
ucomisd %xmm1, %xmm0
jbe 0x2469d
movsd 0x68(%rax), %xmm0
movsd %xmm0, 0x20(%rsp)
movb $0x1, %sil
movq %rax, %r14
addq $0x70, %rax
decq %rcx
jne 0x24662
movl %esi, 0x60(%rsp)
testb $0x1, %sil
je 0x248aa
movq %rdi, 0x8(%rsp)
movl %edx, 0x40(%rsp)
movb $0x0, (%r14)
movslq %r9d, %r15
imulq $0x70, %r15, %r12
addq %rbx, %r12
xorl %ebx, %ebx
leaq (%r15,%rbx), %rax
cmpq %rbp, %rax
jl 0x246e4
leaq 0x18489(%rip), %rdi     # 0x3cb66
xorl %eax, %eax
callq 0xa01c
movq %r12, 0x10(%r14,%rbx,8)
movb $0x1, (%r12)
movq %r14, 0x8(%r12)
movl $0x0, 0x20(%r12)
movq $0x0, 0x28(%r12)
incq %rbx
addq $0x70, %r12
cmpq $0x1, %rbx
je 0x246cd
movslq 0x50(%r14), %rax
movl 0x54(%r14), %ecx
movq 0x28(%r14), %r15
movslq 0x20(%r14), %rdx
leaq (%rdx,%rdx,2), %rdx
addq %r15, %rdx
addq $-0x3, %rdx
leaq (%r15,%rax), %rsi
xorl %r12d, %r12d
movzbl (%rsi,%r12), %edi
addq $0x3, %r12
cmpl %edi, %ecx
jg 0x24734
leaq (%r15,%r12), %rsi
addq $-0x3, %rsi
addq $0x3, %rdx
movzbl -0x3(%rdx,%rax), %edi
addq $-0x3, %rdx
cmpl %edi, %ecx
jle 0x2474d
cmpq %rdx, %rsi
jae 0x247ab
addq %r12, %r15
movq $-0x3, %rdi
movb (%r15,%rdi), %r8b
movb %r8b, 0x193(%rsp,%rdi)
incq %rdi
jne 0x24769
movq $-0x3, %rdi
movb 0x3(%rdx,%rdi), %r8b
movb %r8b, (%r15,%rdi)
incq %rdi
jne 0x24781
xorl %edi, %edi
movb 0x190(%rsp,%rdi), %r8b
movb %r8b, (%rdx,%rdi)
incq %rdi
cmpq $0x3, %rdi
jne 0x24791
movq %rsi, %r15
jmp 0x2472d
leaq (%r15,%r12), %rax
addq $-0x6, %rax
cmpq %rax, %rdx
je 0x247c6
leaq 0x183a7(%rip), %rdi     # 0x3cb66
xorl %eax, %eax
callq 0xa01c
movl %r15d, %eax
subl 0x28(%r14), %eax
addl %r12d, %eax
imull $0xaaaaaaab, %eax, %eax # imm = 0xAAAAAAAB
decl %eax
movq 0x10(%r14), %rcx
movl %eax, 0x20(%rcx)
movq 0x10(%r14), %rax
movq 0x28(%r14), %rcx
movq %rcx, 0x28(%rax)
movl 0x20(%r14), %eax
leal (%rax,%rax,2), %eax
addl 0x28(%r14), %eax
leaq (%r15,%r12), %rcx
addq $-0x3, %rcx
subl %r15d, %eax
subl %r12d, %eax
imull $0xaaaaaaab, %eax, %eax # imm = 0xAAAAAAAB
incl %eax
movq 0x18(%r14), %rdx
movl %eax, 0x20(%rdx)
movq 0x18(%r14), %rax
movq %rcx, 0x28(%rax)
movq 0x10(%r14), %rax
movl 0x20(%rax), %eax
testl %eax, %eax
jle 0x24838
cvtsi2sd %eax, %xmm0
movsd 0x58(%r14), %xmm1
ucomisd %xmm0, %xmm1
jne 0x24838
jnp 0x24846
leaq 0x18327(%rip), %rdi     # 0x3cb66
xorl %eax, %eax
callq 0xa01c
movq 0x18(%r14), %rax
movl 0x20(%rax), %eax
testl %eax, %eax
leaq 0x260(%rsp), %r15
jle 0x2486e
xorps %xmm0, %xmm0
cvtsi2sd %eax, %xmm0
movsd 0x60(%r14), %xmm1
ucomisd %xmm0, %xmm1
jne 0x2486e
jnp 0x2487c
leaq 0x182f1(%rip), %rdi     # 0x3cb66
xorl %eax, %eax
callq 0xa01c
movq 0x8(%rsp), %r12
addq %rbx, %r12
movq 0x10(%r14), %rdi
callq 0x2521f
movq 0x18(%r14), %rdi
callq 0x2521f
movl %r12d, %r9d
movq 0x90(%rsp), %rbx
movl 0x40(%rsp), %edx
movq 0x50(%rsp), %r12
incl %edx
cmpl %r12d, %edx
setne %al
testb %al, 0x60(%rsp)
jne 0x24652
testl %r9d, %r9d
movabsq $0x2492492492492498, %rdi # imm = 0x2492492492492498
leaq 0x1b8cb24(%rip), %rbp   # 0x1bb13f4
jle 0x24939
movl %r9d, %eax
imulq $0x70, %rax, %rax
movq 0x10(%rsp), %rcx
addq $0x18, %rcx
xorl %edx, %edx
movb (%rbx,%rdx), %sil
movb %sil, -0x18(%rcx)
testb %sil, %sil
jne 0x2492c
movq 0x50(%rbx,%rdx), %rsi
movq %rsi, (%rcx)
movq 0x10(%rbx,%rdx), %rsi
subq %rbx, %rsi
sarq $0x4, %rsi
imulq %rdi, %rsi
movq 0x10(%rsp), %r8
addq %r8, %rsi
movq %rsi, -0x10(%rcx)
movq 0x18(%rbx,%rdx), %rsi
subq %rbx, %rsi
sarq $0x4, %rsi
imulq %rdi, %rsi
addq %r8, %rsi
movq %rsi, -0x8(%rcx)
addq $0x70, %rdx
addq $0x28, %rcx
cmpq %rdx, %rax
jne 0x248e4
movq %rbx, %r14
movq %r15, %rbx
movq $0x0, 0x20(%rsp)
movl %r9d, 0x40(%rsp)
cmpb $0x0, (%r14)
jne 0x2495d
movq 0x10(%r14), %r14
cmpb $0x1, (%r14)
jne 0x24953
movq %r14, %rax
subq 0x90(%rsp), %rax
sarq $0x4, %rax
movabsq $0x2492492492492498, %rcx # imm = 0x2492492492492498
imulq %rcx, %rax
movq 0x10(%rsp), %rcx
movq 0x20(%rsp), %rdx
movl %edx, 0x20(%rcx,%rax)
movl $0x6, %r15d
movsd (%r14,%r15,8), %xmm0
addsd 0x16964(%rip), %xmm0    # 0x3b300
addsd 0x1376c(%rip), %xmm0    # 0x38110
callq 0x4580
cvttsd2si %xmm0, %eax
movl $0xff, %ecx
cmpl %ecx, %eax
jl 0x249bb
movl $0xff, %eax
testl %eax, %eax
jg 0x249c1
xorl %eax, %eax
movb %al, -0x6(%rbx,%r15)
incq %r15
cmpq $0x9, %r15
jne 0x2498e
incq 0x20(%rsp)
leaq 0x260(%rsp), %r15
movl 0x40(%rsp), %r9d
movq 0x8(%r14), %rax
testq %rax, %rax
je 0x24a00
cmpq 0x10(%rax), %r14
movq %rax, %r14
jne 0x249e1
movq 0x18(%rax), %r14
addq $0x3, %rbx
jmp 0x2494d
movq 0x20(%rsp), %rax
leal -0x1(,%rax,2), %eax
cmpl %r9d, %eax
je 0x24a1f
leaq 0x1814e(%rip), %rdi     # 0x3cb66
xorl %eax, %eax
callq 0xa01c
movq 0xf0(%rsp), %rdi
callq 0x4380
movq 0x90(%rsp), %rdi
callq 0x4380
cmpl %r12d, 0x20(%rsp)
jge 0x24a6d
movq 0x20(%rsp), %rcx
movslq %ecx, %rax
leaq (%rax,%rax,2), %rax
leaq (%rsp,%rax), %rdi
addq $0x260, %rdi            # imm = 0x260
movl %ecx, %eax
notl %eax
addl %eax, %r12d
leaq (%r12,%r12,2), %rdx
addq $0x3, %rdx
xorl %esi, %esi
callq 0x4190
movq %r13, %rdi
callq 0x4380
xorl %edi, %edi
leaq 0x118c96e(%rip), %rbx   # 0x11b13ec
cmpl $0x7fff, (%rbx)         # imm = 0x7FFF
setl %dil
movl $0x26, %esi
callq 0xa7c9
movslq (%rbx), %rcx
movq 0x170(%rsp), %rax
movw %cx, 0xa(%rax)
leaq (%rcx,%rcx,4), %rax
leaq 0x118c944(%rip), %rdx   # 0x11b13f0
leaq (%rdx,%rax,8), %rax
incl %ecx
movl %ecx, (%rbx)
movq 0x1e8(%rsp), %rdx
movq 0x20(%rdx), %rcx
movq %rcx, 0x20(%rax)
movups (%rdx), %xmm0
movups 0x10(%rdx), %xmm1
movups %xmm1, 0x10(%rax)
movups %xmm0, (%rax)
movq 0xd0(%rsp), %rcx
cmpl $0x1, %ecx
je 0x24b7b
xorps %xmm0, %xmm0
cvtsi2ss %ecx, %xmm0
movsd 0x16676(%rip), %xmm1    # 0x3b168
divsd 0x230(%rsp), %xmm1
unpcklpd %xmm1, %xmm1            # xmm1 = xmm1[0,0]
unpcklps %xmm0, %xmm0            # xmm0 = xmm0[0,0,1,1]
movss 0x10(%rax), %xmm2
movss (%rax), %xmm3
unpcklps %xmm2, %xmm3            # xmm3 = xmm3[0],xmm2[0],xmm3[1],xmm2[1]
movss 0x4(%rax), %xmm2
movss 0x8(%rax), %xmm4
movss 0xc(%rax), %xmm5
cvtps2pd %xmm3, %xmm3
movss 0x14(%rax), %xmm6
unpcklps %xmm6, %xmm2            # xmm2 = xmm2[0],xmm6[0],xmm2[1],xmm6[1]
cvtps2pd %xmm2, %xmm2
movss 0x18(%rax), %xmm6
unpcklps %xmm6, %xmm4            # xmm4 = xmm4[0],xmm6[0],xmm4[1],xmm6[1]
cvtps2pd %xmm4, %xmm4
mulpd %xmm1, %xmm3
mulpd %xmm1, %xmm4
cvtpd2ps %xmm4, %xmm4
mulpd %xmm1, %xmm2
movss 0x1c(%rax), %xmm1
unpcklps %xmm1, %xmm5            # xmm5 = xmm5[0],xmm1[0],xmm5[1],xmm1[1]
divps %xmm0, %xmm5
addps 0x17a98(%rip), %xmm5    # 0x3c5f0
unpcklpd %xmm5, %xmm4            # xmm4 = xmm4[0],xmm5[0]
cvtpd2ps %xmm2, %xmm0
cvtpd2ps %xmm3, %xmm1
unpcklpd %xmm0, %xmm1            # xmm1 = xmm1[0],xmm0[0]
movapd %xmm1, %xmm0
shufps $0xdd, %xmm4, %xmm0     # xmm0 = xmm0[1,3],xmm4[1,3]
shufps $0x88, %xmm4, %xmm1     # xmm1 = xmm1[0,2],xmm4[0,2]
movups %xmm1, (%rax)
movups %xmm0, 0x10(%rax)
leaq 0x82c916(%rip), %rcx    # 0x851498
movq (%rcx), %rcx
movl 0x524de39(%rip), %edx   # 0x52729c4
addl (%rcx), %edx
movl %edx, 0x20(%rax)
movl 0x30(%rsp), %eax
movl 0x34(%rsp), %edx
xorl %ecx, %ecx
movl $0x28, %r8d
movl %eax, %esi
sarl %cl, %esi
movl %edx, %edi
sarl %cl, %edi
imull %esi, %edi
addl %edi, %r8d
incl %ecx
cmpl $0x4, %ecx
jne 0x24ba0
movq %r8, 0x90(%rsp)
leal 0x304(%r8), %eax
movl %eax, 0x40(%rsp)
movslq %eax, %rdi
movq %rdi, 0x8(%rsp)
callq 0x4410
movq %rax, %rbx
xorl %edi, %edi
testq %rax, %rax
setne %dil
movl $0x1, %esi
callq 0xa7c9
xorps %xmm0, %xmm0
movups %xmm0, 0x10(%rbx)
movups %xmm0, (%rbx)
movq $0x0, 0x20(%rbx)
movq 0x30(%rsp), %rax
movq %rax, 0x10(%rbx)
leaq 0x28(%rbx), %r13
xorl %r14d, %r14d
movq %rbx, 0x60(%rsp)
movl %r13d, %eax
subl %ebx, %eax
movl %eax, 0x18(%rbx,%r14,4)
movl 0x34(%rsp), %eax
movl %r14d, %ecx
sarl %cl, %eax
testl %eax, %eax
jle 0x24da7
xorl %r12d, %r12d
movl 0x30(%rsp), %eax
movl %r14d, %ecx
sarl %cl, %eax
testl %eax, %eax
jle 0x24d92
xorl %ebx, %ebx
movq 0x210(%rsp,%r14,8), %rcx
imull %r12d, %eax
addl %ebx, %eax
cltq
cmpb $0x0, 0x3(%rcx,%rax,4)
je 0x24d27
cmpl $0x0, 0x20(%rsp)
je 0x24d2e
movb (%rcx,%rax,4), %dl
movb %dl, 0xb8(%rsp)
movb 0x1(%rcx,%rax,4), %dl
movb %dl, 0xb9(%rsp)
movb 0x2(%rcx,%rax,4), %al
movb %al, 0xba(%rsp)
jg 0x24c99
leaq 0x17f18(%rip), %rdi     # 0x3cbaa
xorl %eax, %eax
callq 0xa01c
movq 0x10(%rsp), %rax
cmpb $0x0, (%rax)
jne 0x24cc6
movq 0x10(%rsp), %rax
movslq 0x18(%rax), %rcx
movzbl 0xb8(%rsp,%rcx), %ecx
xorl %edx, %edx
cmpl %ecx, 0x1c(%rax)
setle %dl
movq 0x8(%rax,%rdx,8), %rax
cmpb $0x1, (%rax)
jne 0x24ca8
movslq 0x20(%rax), %rax
movl %eax, 0x128(%rsp)
movl $0x0, 0x190(%rsp)
leaq (%rax,%rax,2), %rax
addq %rsp, %rax
addq $0x260, %rax            # imm = 0x260
xorl %ecx, %ecx
xorl %edx, %edx
movzbl (%rax,%rcx), %esi
movzbl 0xb8(%rsp,%rcx), %edi
subl %edi, %esi
imull %esi, %esi
addl %esi, %edx
incq %rcx
cmpq $0x3, %rcx
jne 0x24ced
movl %edx, 0x190(%rsp)
xorps %xmm0, %xmm0
cvtsi2sd %edx, %xmm0
ucomisd 0x165e9(%rip), %xmm0    # 0x3b308
jb 0x24d35
sqrtsd %xmm0, %xmm0
jmp 0x24d3a
movb $-0x1, (%r13)
jmp 0x24d7c
movb $0x0, (%r13)
jmp 0x24d7c
callq 0x4240
addsd 0x16916(%rip), %xmm0    # 0x3b658
callq 0x4090
cvttsd2si %xmm0, %r9d
leaq 0x190(%rsp), %rdi
leaq 0x128(%rsp), %rsi
movq 0x10(%rsp), %rdx
movq %r15, %rcx
leaq 0xb8(%rsp), %r8
callq 0x25586
movb 0x128(%rsp), %al
movb %al, (%r13)
incq %r13
incl %ebx
movl 0x30(%rsp), %eax
movl %r14d, %ecx
sarl %cl, %eax
cmpl %eax, %ebx
jl 0x24c43
incl %r12d
movl 0x34(%rsp), %eax
movl %r14d, %ecx
sarl %cl, %eax
cmpl %eax, %r12d
jl 0x24c30
incq %r14
cmpq $0x4, %r14
movq 0x60(%rsp), %rbx
jne 0x24c12
movw $0x100, (%r13)          # imm = 0x100
leaq 0x2(%r13), %rdi
movl $0x300, %edx            # imm = 0x300
movq %r15, %rsi
callq 0x4250
movw $0x0, 0x302(%r13)
addq $0x304, %r13            # imm = 0x304
movq %rbx, %rax
movq 0x8(%rsp), %r8
addq %r8, %rax
cmpq %rax, %r13
je 0x24e05
leaq 0x17ccb(%rip), %rdi     # 0x3cac4
xorl %eax, %eax
callq 0xa01c
movq 0x8(%rsp), %r8
cmpb $0x7b, 0xa0(%rsp)
leaq 0x82c680(%rip), %r14    # 0x851494
leaq 0x1b8c5e5(%rip), %r12   # 0x1bb1400
movq 0x78(%rsp), %r15
movl 0x13c(%rsp), %esi
movl 0x40(%rsp), %edi
jne 0x24e3b
movw $0x64, 0x4(%rbx)
movl $0x61725f7b, (%rbx)     # imm = 0x61725F7B
jmp 0x24e47
movw $0x64, 0x4(%rbx)
movl $0x61725f5f, (%rbx)     # imm = 0x61725F5F
movq 0x90(%rsp), %r9
movzwl %si, %eax
movl %eax, %ecx
shrl $0x4, %ecx
imull $0x347, %ecx, %ecx      # imm = 0x347
shrl $0x13, %ecx
orb $0x30, %cl
movl %eax, %edx
shrl $0x3, %edx
imull $0x20c5, %edx, %edx     # imm = 0x20C5
shrl $0x14, %edx
movd %edx, %xmm0
imull $0xcccd, %eax, %edx     # imm = 0xCCCD
shrl $0x2, %eax
imull $0x147b, %eax, %eax     # imm = 0x147B
shrl $0x11, %eax
shrl $0x13, %edx
pinsrw $0x1, %eax, %xmm0
pinsrw $0x2, %edx, %xmm0
movb %cl, 0x5(%rbx)
pinsrw $0x3, %esi, %xmm0
movdqa %xmm0, %xmm1
pmulhuw 0x17758(%rip), %xmm1    # 0x3c600
psrlw $0x3, %xmm1
pmullw 0x1775b(%rip), %xmm1    # 0x3c610
psubw %xmm1, %xmm0
packuswb %xmm0, %xmm0
por 0x1775b(%rip), %xmm0    # 0x3c620
movd %xmm0, 0x6(%rbx)
xorl %eax, %eax
cmpq $0x24, %rax
jb 0x24ed7
leal 0x3d(%rax), %ecx
jmp 0x24ee7
cmpq $0xa, %rax
jb 0x24ee2
leal 0x37(%rax), %ecx
jmp 0x24ee7
movl %eax, %ecx
orl $0x30, %ecx
movb %cl, 0x190(%rsp,%rax)
incq %rax
cmpq $0x3e, %rax
jne 0x24ecc
xorl %eax, %eax
movw $0x0, 0xe(%rbx)
movl $0x0, 0xa(%rbx)
cmpl $0xfffffcfd, %r9d       # imm = 0xFFFFFCFD
jl 0x24f28
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 0x24f13
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 0x190(%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 0x190(%rsp,%rdx), %dl
movb %dl, 0xb(%rbx)
movl %ecx, %edx
shll $0x6, %edx
addl %ecx, %ecx
subl %edx, %ecx
addl %eax, %ecx
movb 0x190(%rsp,%rcx), %al
movb %al, 0xc(%rbx)
movq %rbx, %r13
movq 0x110(%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 0x190(%rsp,%rcx), %cl
movb %cl, 0xd(%r13)
movl %eax, %ecx
shll $0x6, %ecx
addl %eax, %eax
subl %ecx, %eax
addl %ebx, %eax
cltq
movb 0x190(%rsp,%rax), %al
movb %al, 0xe(%r13)
movb $0x0, 0xf(%r13)
movq %r13, %rsi
callq 0x231d9
incl %ebx
movq %rbx, 0x110(%rsp)
leaq (%r15,%r15,2), %rax
leaq 0x4c1f8e3(%rip), %rcx   # 0x4c44910
cvtss2sd (%rcx,%rax,4), %xmm0
cvtss2sd 0x4(%rcx,%rax,4), %xmm1
cvtss2sd 0x8(%rcx,%rax,4), %xmm2
movl $0x3, %edi
leaq 0x17aae(%rip), %rsi     # 0x3caf8
movq %r13, %rdx
leaq 0xa0(%rsp), %rcx
movb $0x3, %al
callq 0xa52e
movq %r13, %rdi
callq 0x4380
movq 0x10(%rsp), %rdi
callq 0x4380
movq 0x80(%rsp), %rdi
callq 0x4380
xorl %ebx, %ebx
movq 0x210(%rsp,%rbx,8), %rdi
callq 0x4380
incq %rbx
cmpq $0x4, %rbx
jne 0x2507d
movl 0x40(%rsp), %eax
addl %eax, 0xcc(%rsp)
leaq 0x118c347(%rip), %r8    # 0x11b13ec
leaq 0x118c344(%rip), %r9    # 0x11b13f0
leaq 0x82c3e5(%rip), %r10    # 0x851498
leaq 0xa0(%rsp), %rdi
jmp 0x2358c
movl 0xcc(%rsp), %ebx
movq 0x110(%rsp), %r14
movq 0x118(%rsp), %r15
jmp 0x250e1
xorl %r15d, %r15d
xorl %ebx, %ebx
xorl %r14d, %r14d
callq 0x2326a
testb $0x1, %r15b
je 0x250ff
leaq 0x17a48(%rip), %rdi     # 0x3cb3b
movl %r14d, %esi
movl %ebx, %edx
xorl %eax, %eax
callq 0x9d2e
addq $0x568, %rsp            # imm = 0x568
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq