// File: /workspace/github_cpp_makefile_star2_O3/FreeSlave[P]vhlt/common/bspfile.cpp
// Function: UnparseEntities()
void            UnparseEntities()
{
    char*           buf;
    char*           end;
    epair_t*        ep;
    char            line[MAXTOKEN];
    int             i;

    buf = g_dentdata;
    end = buf;
    *end = 0;

#ifdef ZHLT_ENTITY_INFOSUNLIGHT
	for (i = 0; i < g_numentities; i++)
	{
		entity_t *mapent = &g_entities[i];
		if (!strcmp (ValueForKey (mapent, "classname"), "info_sunlight") ||
			!strcmp (ValueForKey (mapent, "classname"), "light_environment") )
		{
			float vec[3] = {0,0,0};
			{
				sscanf (ValueForKey (mapent, "angles"), "%f %f %f", &vec[0], &vec[1], &vec[2]);
				float pitch = FloatForKey(mapent, "pitch");
				if (pitch)
					vec[0] = pitch;

				const char *target = ValueForKey (mapent, "target");
				if (target[0])
				{
					entity_t *targetent = FindTargetEntity (target);
					if (targetent)
					{
						float origin1[3] = {0,0,0}, origin2[3] = {0,0,0}, normal[3];
						sscanf (ValueForKey (mapent, "origin"), "%f %f %f", &origin1[0], &origin1[1], &origin1[2]);
						sscanf (ValueForKey (targetent, "origin"), "%f %f %f", &origin2[0], &origin2[1], &origin2[2]);
						VectorSubtract (origin2, origin1, normal);
						anglesforvector (vec, normal);
					}
				}
			}
			char stmp[1024];
			safe_snprintf (stmp, 1024, "%g %g %g", vec[0], vec[1], vec[2]);
			SetKeyValue (mapent, "angles", stmp);
			DeleteKey (mapent, "pitch");

			if (!strcmp (ValueForKey (mapent, "classname"), "info_sunlight"))
			{
				if (g_numentities == MAX_MAP_ENTITIES)
				{
					Error("g_numentities == MAX_MAP_ENTITIES");
				}
				entity_t *newent = &g_entities[g_numentities++];
				newent->epairs = mapent->epairs;
				SetKeyValue (newent, "classname", "light_environment");
				SetKeyValue (newent, "_fake", "1");
				mapent->epairs = NULL;
			}
		}
	}
#endif
#ifdef ZHLT_ENTITY_LIGHTSHADOW
    for (i = 0; i < g_numentities; i++)
	{
		entity_t *mapent = &g_entities[i];
		if (!strcmp (ValueForKey (mapent, "classname"), "light_shadow")
	#ifdef ZHLT_ENTITY_LIGHTBOUNCE
			|| !strcmp (ValueForKey (mapent, "classname"), "light_bounce")
	#endif
			)
		{
			SetKeyValue (mapent, "convertfrom", ValueForKey (mapent, "classname"));
			SetKeyValue (mapent, "classname", (*ValueForKey (mapent, "convertto")? ValueForKey (mapent, "convertto"): "light"));
			SetKeyValue (mapent, "convertto", "");
		}
	}
#endif
#ifdef ZHLT_ENTITY_LIGHTSURFACE
	// ugly code
	for (i = 0; i < g_numentities; i++)
	{
		entity_t *mapent = &g_entities[i];
		if (!strcmp (ValueForKey (mapent, "classname"), "light_surface"))
		{
			if (!*ValueForKey (mapent, "_tex"))
			{
				SetKeyValue (mapent, "_tex", "                ");
			}
			const char *newclassname = ValueForKey (mapent, "convertto");
			if (!*newclassname)
			{
				SetKeyValue (mapent, "classname", "light");
			}
			else if (strncmp (newclassname, "light", 5))
			{
				Error ("New classname for 'light_surface' should begin with 'light' not '%s'.\n", newclassname);
			}
			else
			{
				SetKeyValue (mapent, "classname", newclassname);
			}
			SetKeyValue (mapent, "convertto", "");
		}
	}
#endif
#ifdef HLCSG_OPTIMIZELIGHTENTITY
#ifdef HLCSG
	extern bool g_nolightopt;
	if (!g_nolightopt)
	{
		int i, j;
		int count = 0;
		bool *lightneedcompare = (bool *)malloc (g_numentities * sizeof (bool));
		hlassume (lightneedcompare != NULL, assume_NoMemory);
		memset (lightneedcompare, 0, g_numentities * sizeof(bool));
		for (i = g_numentities - 1; i > -1; i--)
		{
			entity_t *ent = &g_entities[i];
			const char *classname = ValueForKey (ent, "classname");
			const char *targetname = ValueForKey (ent, "targetname");
			int style = IntForKey (ent, "style");
			if (!targetname[0] || strcmp (classname, "light") && strcmp (classname, "light_spot") && strcmp (classname, "light_environment"))
				continue;
			for (j = i + 1; j < g_numentities; j++)
			{
				if (!lightneedcompare[j])
					continue;
				entity_t *ent2 = &g_entities[j];
				const char *targetname2 = ValueForKey (ent2, "targetname");
				int style2 = IntForKey (ent2, "style");
				if (style == style2 && !strcmp (targetname, targetname2))
					break;
			}
			if (j < g_numentities)
			{
				DeleteKey (ent, "targetname");
				count++;
			}
			else
			{
				lightneedcompare[i] = true;
			}
		}
		if (count > 0)
		{
			Log ("%d redundant named lights optimized.\n", count);
		}
		free (lightneedcompare);
	}
#endif
#endif
    for (i = 0; i < g_numentities; i++)
    {
        ep = g_entities[i].epairs;
        if (!ep)
        {
            continue;                                      // ent got removed
        }

        strcat(end, "{\n");
        end += 2;

        for (ep = g_entities[i].epairs; ep; ep = ep->next)
        {
            sprintf(line, "\"%s\" \"%s\"\n", ep->key, ep->value);
            strcat(end, line);
            end += strlen(line);
        }
        strcat(end, "}\n");
        end += 2;

        if (end > buf + MAX_MAP_ENTSTRING)
        {
            Error("Entity text too long");
        }
    }
    g_entdatasize = end - buf + 1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x1068, %rsp           # imm = 0x1068
movb $0x0, 0x829c78(%rip)    # 0x8314d0
movl 0x2017be5(%rip), %r15d  # 0x201f444
testl %r15d, %r15d
jle 0x7e94
leaq 0x14e63(%rip), %rbp     # 0x1c6d2
leaq 0x14d8c(%rip), %r13     # 0x1c602
xorl %r12d, %r12d
movq %rbp, %r14
leaq (%r12,%r12,4), %rax
leaq 0x2017bc9(%rip), %rcx   # 0x201f450
leaq (%rcx,%rax,8), %rdx
movq %rdx, (%rsp)
leaq (%rcx,%rax,8), %rbx
addq $0x20, %rbx
movq %rbx, %rbp
movq (%rbp), %rbp
testq %rbp, %rbp
je 0x78b9
movq 0x8(%rbp), %rdi
movq %r13, %rsi
callq 0x4440
testl %eax, %eax
jne 0x789a
movq 0x10(%rbp), %rdi
jmp 0x78c0
leaq 0x163e9(%rip), %rdi     # 0x1dca9
leaq 0x14df7(%rip), %rsi     # 0x1c6be
callq 0x4440
testl %eax, %eax
movq %r14, %rbp
je 0x7913
movq %rbx, %rbp
movq (%rbp), %rbp
testq %rbp, %rbp
je 0x78f5
movq 0x8(%rbp), %rdi
movq %r13, %rsi
callq 0x4440
testl %eax, %eax
jne 0x78d6
movq 0x10(%rbp), %rdi
jmp 0x78fc
leaq 0x163ad(%rip), %rdi     # 0x1dca9
leaq 0x14da9(%rip), %rsi     # 0x1c6ac
callq 0x4440
testl %eax, %eax
movq %r14, %rbp
jne 0x7bb8
movl $0x0, 0x10(%rsp)
movq $0x0, 0x8(%rsp)
movq %rbx, %r15
movq (%r15), %r15
testq %r15, %r15
je 0x7945
movq 0x8(%r15), %rdi
movq %rbp, %rsi
callq 0x4440
testl %eax, %eax
jne 0x7927
movq 0x10(%r15), %rdi
jmp 0x794c
leaq 0x1635d(%rip), %rdi     # 0x1dca9
leaq 0x14d86(%rip), %rsi     # 0x1c6d9
leaq 0x8(%rsp), %rdx
leaq 0xc(%rsp), %rcx
leaq 0x10(%rsp), %r8
xorl %eax, %eax
callq 0x42e0
movq (%rsp), %rdi
leaq 0x14d6e(%rip), %rsi     # 0x1c6e2
callq 0x81cc
cvtsd2ss %xmm0, %xmm0
ucomiss 0x1472c(%rip), %xmm0    # 0x1c0b0
jne 0x7988
jnp 0x798e
movss %xmm0, 0x8(%rsp)
movq %rbx, %r15
movq (%r15), %r15
testq %r15, %r15
je 0x79b3
movq 0x8(%r15), %rdi
leaq 0x14d44(%rip), %rsi     # 0x1c6e8
callq 0x4440
testl %eax, %eax
jne 0x7991
movq 0x10(%r15), %rdi
jmp 0x79ba
leaq 0x162ef(%rip), %rdi     # 0x1dca9
cmpb $0x0, (%rdi)
je 0x7ab4
callq 0x820b
testq %rax, %rax
je 0x7ab4
movq %rax, %r15
xorl %eax, %eax
movl %eax, 0x68(%rsp)
movq %rax, 0x60(%rsp)
movl %eax, 0x20(%rsp)
movq %rax, 0x18(%rsp)
movq %rbx, %rbp
movq (%rbp), %rbp
testq %rbp, %rbp
je 0x7a0e
movq 0x8(%rbp), %rdi
leaq 0x1a11e(%rip), %rsi     # 0x21b1d
callq 0x4440
testl %eax, %eax
jne 0x79eb
movq 0x10(%rbp), %rdi
jmp 0x7a15
leaq 0x16294(%rip), %rdi     # 0x1dca9
leaq 0x14cbd(%rip), %rsi     # 0x1c6d9
leaq 0x60(%rsp), %rdx
leaq 0x64(%rsp), %rcx
leaq 0x68(%rsp), %r8
xorl %eax, %eax
callq 0x42e0
addq $0x20, %r15
movq %r14, %rbp
movq (%r15), %r15
testq %r15, %r15
je 0x7a5b
movq 0x8(%r15), %rdi
leaq 0x1a0d1(%rip), %rsi     # 0x21b1d
callq 0x4440
testl %eax, %eax
jne 0x7a39
movq 0x10(%r15), %rdi
jmp 0x7a62
leaq 0x16247(%rip), %rdi     # 0x1dca9
leaq 0x14c70(%rip), %rsi     # 0x1c6d9
leaq 0x18(%rsp), %rdx
leaq 0x1c(%rsp), %rcx
leaq 0x20(%rsp), %r8
xorl %eax, %eax
callq 0x42e0
movsd 0x18(%rsp), %xmm0
movsd 0x60(%rsp), %xmm1
subps %xmm1, %xmm0
movlps %xmm0, 0x50(%rsp)
movss 0x20(%rsp), %xmm0
subss 0x68(%rsp), %xmm0
movss %xmm0, 0x58(%rsp)
leaq 0x8(%rsp), %rdi
leaq 0x50(%rsp), %rsi
callq 0x76df
xorps %xmm0, %xmm0
cvtss2sd 0x8(%rsp), %xmm0
xorps %xmm1, %xmm1
cvtss2sd 0xc(%rsp), %xmm1
cvtss2sd 0x10(%rsp), %xmm2
movl $0x400, %esi            # imm = 0x400
leaq 0x60(%rsp), %r15
movq %r15, %rdi
leaq 0x14c0f(%rip), %rdx     # 0x1c6ef
movb $0x3, %al
callq 0x8a47
movq (%rsp), %r14
movq %r14, %rdi
movq %rbp, %rsi
movq %r15, %rdx
callq 0x757d
movq %r14, %rdi
leaq 0x14bdf(%rip), %rsi     # 0x1c6e2
callq 0x7623
movq %rbx, %r14
movq (%r14), %r14
testq %r14, %r14
je 0x7b29
movq 0x8(%r14), %rdi
movq %r13, %rsi
callq 0x4440
testl %eax, %eax
jne 0x7b0b
movq 0x10(%r14), %rdi
jmp 0x7b30
leaq 0x16179(%rip), %rdi     # 0x1dca9
leaq 0x14b87(%rip), %rsi     # 0x1c6be
callq 0x4440
testl %eax, %eax
jne 0x7bb1
movl 0x20178fe(%rip), %eax   # 0x201f444
cmpl $0x4000, %eax           # imm = 0x4000
jne 0x7b61
leaq 0x14a65(%rip), %rdi     # 0x1c5b9
xorl %eax, %eax
callq 0xa164
movl 0x20178e3(%rip), %eax   # 0x201f444
leal 0x1(%rax), %ecx
movl %ecx, 0x20178da(%rip)   # 0x201f444
cltq
leaq (%rax,%rax,4), %rax
leaq 0x20178d9(%rip), %rcx   # 0x201f450
leaq (%rcx,%rax,8), %r14
movq (%rbx), %rax
movq %rax, 0x20(%r14)
movq %r14, %rdi
movq %r13, %rsi
leaq 0x14b1d(%rip), %rdx     # 0x1c6ac
callq 0x757d
movq %r14, %rdi
leaq 0x14b2e(%rip), %rsi     # 0x1c6cc
leaq 0x15ed5(%rip), %rdx     # 0x1da7a
callq 0x757d
movq $0x0, (%rbx)
movl 0x201788c(%rip), %r15d  # 0x201f444
incq %r12
movslq %r15d, %rax
cmpq %rax, %r12
jl 0x7879
testl %r15d, %r15d
jle 0x7e94
xorl %r14d, %r14d
leaq 0x14a28(%rip), %r12     # 0x1c602
leaq 0x14a8d(%rip), %r13     # 0x1c66e
leaq (%r14,%r14,4), %rax
leaq 0x2017864(%rip), %rcx   # 0x201f450
leaq (%rcx,%rax,8), %rdx
movq %rdx, (%rsp)
leaq (%rcx,%rax,8), %rbp
addq $0x20, %rbp
movq %rbp, %rbx
movq (%rbx), %rbx
testq %rbx, %rbx
je 0x7c1d
movq 0x8(%rbx), %rdi
movq %r12, %rsi
callq 0x4440
testl %eax, %eax
jne 0x7bff
movq 0x10(%rbx), %rdi
jmp 0x7c24
leaq 0x16085(%rip), %rdi     # 0x1dca9
leaq 0x14a67(%rip), %rsi     # 0x1c692
callq 0x4440
testl %eax, %eax
je 0x7c70
movq %rbp, %rbx
movq (%rbx), %rbx
testq %rbx, %rbx
je 0x7c55
movq 0x8(%rbx), %rdi
movq %r12, %rsi
callq 0x4440
testl %eax, %eax
jne 0x7c37
movq 0x10(%rbx), %rdi
jmp 0x7c5c
leaq 0x1604d(%rip), %rdi     # 0x1dca9
leaq 0x14a3c(%rip), %rsi     # 0x1c69f
callq 0x4440
testl %eax, %eax
jne 0x7d29
movq %rbp, %rbx
movq (%rsp), %r15
movq (%rbx), %rbx
testq %rbx, %rbx
je 0x7c95
movq 0x8(%rbx), %rdi
movq %r12, %rsi
callq 0x4440
testl %eax, %eax
jne 0x7c77
movq 0x10(%rbx), %rdx
jmp 0x7c9c
leaq 0x1600d(%rip), %rdx     # 0x1dca9
movq %r15, %rdi
leaq 0x149e0(%rip), %rsi     # 0x1c686
callq 0x757d
movq %rbp, %rbx
movq (%rbx), %rbx
testq %rbx, %rbx
je 0x7ccc
movq 0x8(%rbx), %rdi
movq %r13, %rsi
callq 0x4440
testl %eax, %eax
jne 0x7cae
movq 0x10(%rbx), %rax
jmp 0x7cd3
leaq 0x15fd6(%rip), %rax     # 0x1dca9
cmpb $0x0, (%rax)
leaq 0x149e9(%rip), %rdx     # 0x1c6c6
je 0x7d05
movq (%rbp), %rbp
testq %rbp, %rbp
je 0x7cfe
movq 0x8(%rbp), %rdi
movq %r13, %rsi
callq 0x4440
testl %eax, %eax
jne 0x7cdf
movq 0x10(%rbp), %rdx
jmp 0x7d05
leaq 0x15fa4(%rip), %rdx     # 0x1dca9
movq %r15, %rdi
movq %r12, %rsi
callq 0x757d
movq %r15, %rdi
movq %r13, %rsi
leaq 0x15f8c(%rip), %rdx     # 0x1dca9
callq 0x757d
movl 0x201771b(%rip), %r15d  # 0x201f444
incq %r14
movslq %r15d, %rax
cmpq %rax, %r14
jl 0x7be1
testl %r15d, %r15d
jle 0x7e94
leaq 0x148ba(%rip), %r13     # 0x1c602
leaq 0x1491f(%rip), %r12     # 0x1c66e
xorl %ebp, %ebp
leaq (,%rbp,4), %rax
addq %rbp, %rax
leaq 0x20176ed(%rip), %rcx   # 0x201f450
leaq (%rcx,%rax,8), %rdx
movq %rdx, (%rsp)
leaq (%rcx,%rax,8), %r14
addq $0x20, %r14
movq %r14, %rbx
movq (%rbx), %rbx
testq %rbx, %rbx
je 0x7d94
movq 0x8(%rbx), %rdi
movq %r13, %rsi
callq 0x4440
testl %eax, %eax
jne 0x7d76
movq 0x10(%rbx), %rdi
jmp 0x7d9b
leaq 0x15f0e(%rip), %rdi     # 0x1dca9
leaq 0x148d6(%rip), %rsi     # 0x1c678
callq 0x4440
testl %eax, %eax
jne 0x7e85
movq %r14, %rbx
leaq 0x148b0(%rip), %r15     # 0x1c669
movq (%rbx), %rbx
testq %rbx, %rbx
je 0x7dd7
movq 0x8(%rbx), %rdi
movq %r15, %rsi
callq 0x4440
testl %eax, %eax
jne 0x7db9
movq 0x10(%rbx), %rax
jmp 0x7dde
leaq 0x15ecb(%rip), %rax     # 0x1dca9
cmpb $0x0, (%rax)
jne 0x7df6
movq (%rsp), %rdi
movq %r15, %rsi
leaq 0x14907(%rip), %rdx     # 0x1c6f8
callq 0x757d
movq (%r14), %r14
testq %r14, %r14
je 0x7e14
movq 0x8(%r14), %rdi
movq %r12, %rsi
callq 0x4440
testl %eax, %eax
jne 0x7df6
movq 0x10(%r14), %rbx
jmp 0x7e1b
leaq 0x15e8e(%rip), %rbx     # 0x1dca9
cmpb $0x0, (%rbx)
movq (%rsp), %r14
je 0x7e4f
movl $0x5, %edx
movq %rbx, %rdi
leaq 0x14893(%rip), %rsi     # 0x1c6c6
callq 0x41a0
testl %eax, %eax
je 0x7e5e
leaq 0x148c6(%rip), %rdi     # 0x1c709
movq %rbx, %rsi
xorl %eax, %eax
callq 0xa164
jmp 0x7e6c
movq %r14, %rdi
movq %r13, %rsi
leaq 0x1486a(%rip), %rdx     # 0x1c6c6
jmp 0x7e67
movq %r14, %rdi
movq %r13, %rsi
movq %rbx, %rdx
callq 0x757d
movq %r14, %rdi
movq %r12, %rsi
leaq 0x15e30(%rip), %rdx     # 0x1dca9
callq 0x757d
movl 0x20175bf(%rip), %r15d  # 0x201f444
incq %rbp
movslq %r15d, %rax
cmpq %rax, %rbp
jl 0x7d51
leaq 0x61c57b7(%rip), %rax   # 0x61cd652
cmpb $0x0, (%rax)
jne 0x80b5
movslq %r15d, %rdi
callq 0x4420
movq %rax, %rbx
xorl %edi, %edi
testq %rax, %rax
setne %dil
movl $0x1, %esi
callq 0xa91d
movslq 0x201757b(%rip), %r15   # 0x201f444
movq %rbx, (%rsp)
movq %rbx, %rdi
xorl %esi, %esi
movq %r15, %rdx
callq 0x41c0
testq %r15, %r15
jle 0x80a5
movl $0x0, 0x14(%rsp)
leaq 0x1485e(%rip), %r13     # 0x1c750
leaq 0x14709(%rip), %rbp     # 0x1c602
movq %r15, %r12
decq %r15
leaq (%r15,%r15,4), %rax
leaq 0x2017546(%rip), %rcx   # 0x201f450
leaq (%rcx,%rax,8), %rdx
movq %rdx, 0x40(%rsp)
leaq (%rcx,%rax,8), %rbx
addq $0x20, %rbx
movq %rbx, %r14
movq (%r14), %r14
testq %r14, %r14
je 0x7f3c
movq 0x8(%r14), %rdi
movq %rbp, %rsi
callq 0x4440
testl %eax, %eax
jne 0x7f1e
movq 0x10(%r14), %r14
jmp 0x7f43
leaq 0x15d66(%rip), %r14     # 0x1dca9
movq (%rbx), %rbx
testq %rbx, %rbx
je 0x7f61
movq 0x8(%rbx), %rdi
movq %r13, %rsi
callq 0x4440
testl %eax, %eax
jne 0x7f43
movq 0x10(%rbx), %rbx
jmp 0x7f68
leaq 0x15d41(%rip), %rbx     # 0x1dca9
movq 0x40(%rsp), %rdi
leaq 0x18dfa(%rip), %rsi     # 0x20d6e
callq 0x7678
movl %eax, 0x34(%rsp)
cmpb $0x0, (%rbx)
je 0x806b
movq %r14, %rdi
leaq 0x14736(%rip), %rsi     # 0x1c6c6
callq 0x4440
testl %eax, %eax
je 0x7fc3
movq %r14, %rdi
leaq 0x147b8(%rip), %rsi     # 0x1c75b
callq 0x4440
testl %eax, %eax
je 0x7fc3
movq %r14, %rdi
leaq 0x146f6(%rip), %rsi     # 0x1c6ac
callq 0x4440
testl %eax, %eax
jne 0x806b
movq %rbx, 0x48(%rsp)
movq %r15, 0x38(%rsp)
movslq 0x2017470(%rip), %r15   # 0x201f444
movq %r12, 0x28(%rsp)
cmpq %r15, %r12
jge 0x8058
movq 0x28(%rsp), %r12
movq (%rsp), %rax
cmpb $0x1, (%rax,%r12)
jne 0x8050
leaq (%r12,%r12,4), %rax
leaq 0x2017457(%rip), %rcx   # 0x201f450
leaq (%rcx,%rax,8), %r14
leaq (%rcx,%rax,8), %rbx
addq $0x20, %rbx
movq (%rbx), %rbx
testq %rbx, %rbx
je 0x8023
movq 0x8(%rbx), %rdi
movq %r13, %rsi
callq 0x4440
testl %eax, %eax
jne 0x8005
movq 0x10(%rbx), %rbx
jmp 0x802a
leaq 0x15c7f(%rip), %rbx     # 0x1dca9
movq %r14, %rdi
leaq 0x18d3a(%rip), %rsi     # 0x20d6e
callq 0x7678
cmpl %eax, 0x34(%rsp)
jne 0x8050
movq 0x48(%rsp), %rdi
movq %rbx, %rsi
callq 0x4440
testl %eax, %eax
je 0x8077
incq %r12
cmpl %r12d, %r15d
jg 0x7fe3
movq (%rsp), %rax
movq 0x38(%rsp), %r15
movb $0x1, (%rax,%r15)
movq 0x28(%rsp), %r12
cmpq $0x1, %r12
jg 0x7ef9
jmp 0x808f
movq 0x40(%rsp), %rdi
movq %r13, %rsi
callq 0x7623
incl 0x14(%rsp)
movq 0x38(%rsp), %r15
jmp 0x8066
movl 0x14(%rsp), %esi
testl %esi, %esi
jle 0x80a5
leaq 0x146c8(%rip), %rdi     # 0x1c766
xorl %eax, %eax
callq 0x9e76
movq (%rsp), %rdi
callq 0x4390
movl 0x201738f(%rip), %r15d  # 0x201f444
testl %r15d, %r15d
jle 0x819f
leaq 0x82940b(%rip), %r13    # 0x8314d0
leaq 0x146c3(%rip), %rbx     # 0x1c78f
leaq 0x60(%rsp), %r14
xorl %edx, %edx
movq %r13, %r12
xorl %r15d, %r15d
leaq (%rdx,%rdx,4), %rax
leaq 0x201736c(%rip), %rcx   # 0x201f450
movq 0x20(%rcx,%rax,8), %rbp
testq %rbp, %rbp
je 0x8186
movq %rdx, (%rsp)
movq %r12, %rdi
callq 0x4180
movw $0xa7b, (%r12,%rax)     # imm = 0xA7B
movb $0x0, 0x2(%r12,%rax)
leaq (%r15,%r13), %r12
addq $0x2, %r12
addq $0x2, %r15
movq 0x8(%rbp), %rdx
movq 0x10(%rbp), %rcx
movq %r14, %rdi
movq %rbx, %rsi
xorl %eax, %eax
callq 0x40c0
movq %r12, %rdi
movq %r14, %rsi
callq 0x4570
movq %r14, %rdi
callq 0x4180
addq %rax, %r15
leaq (%r15,%r13), %r12
movq (%rbp), %rbp
testq %rbp, %rbp
jne 0x8117
movq %r12, %rdi
callq 0x4180
movw $0xa7d, (%r12,%rax)     # imm = 0xA7D
movb $0x0, 0x2(%r12,%rax)
leaq 0x2(%r15), %r12
cmpq $0x1fffff, %r15         # imm = 0x1FFFFF
jl 0x817f
leaq 0x14625(%rip), %rdi     # 0x1c79d
xorl %eax, %eax
callq 0xa164
movq (%rsp), %rdx
movq %r12, %r15
incq %rdx
leaq (%r15,%r13), %r12
movslq 0x20172b0(%rip), %rax   # 0x201f444
cmpq %rax, %rdx
jl 0x80d9
jmp 0x81a6
leaq 0x82932a(%rip), %r12    # 0x8314d0
leaq 0x829323(%rip), %rax    # 0x8314d0
subl %eax, %r12d
incl %r12d
movl %r12d, 0x82930a(%rip)   # 0x8314c4
addq $0x1068, %rsp           # imm = 0x1068
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq