// File: /workspace/github_cpp_makefile_star2_O1/FreeSlave[P]vhlt/hlrad/qrad.cpp
// Function: ReadLightingCone()
void ReadLightingCone ()
{
	int num;
	int i, k;
	entity_t *mapent;
	epair_t *ep;

	num = ((dmiptexlump_t *)g_dtexdata)->nummiptex;
	g_lightingconeinfo = (vec3_t *)malloc (num * sizeof(vec3_t));
	for (i = 0; i < num; i++)
	{
		g_lightingconeinfo[i][0] = 1.0; // default power
		g_lightingconeinfo[i][1] = 1.0; // default scale
	}
	for (k = 0; k < g_numentities; k++)
	{
		mapent = &g_entities[k];
		if (strcmp(ValueForKey(mapent, "classname"), "info_angularfade"))
			continue;
		Developer (DEVELOPER_LEVEL_MESSAGE, "info_angularfade entity detected.\n");
		for (i = 0; i < num; i++)
		{
			const char *texname = ((miptex_t*)(g_dtexdata+((dmiptexlump_t*)g_dtexdata)->dataofs[i]))->name;
			for (ep = mapent->epairs; ep; ep = ep->next)
			{
				if (strcasecmp (ep->key, texname))
					continue;
				if (!strcasecmp (ep->key, "origin"))
					continue;
				double power, scale;
				int count;
				count = sscanf (ep->value, "%lf %lf", &power, &scale);
				if (count == 1)
				{
					scale = 1.0;
				}
				else if (count != 2)
				{
					Warning ("ignore bad angular fade value '%s'", ep->value);
					continue;
				}
				if (power < 0.0 || scale < 0.0)
				{
					Warning ("ignore disallowed angular fade value '%s'", ep->value);
					continue;
				}
				scale *= DefaultScaleForPower (power);
				g_lightingconeinfo[i][0] = power;
				g_lightingconeinfo[i][1] = scale;
				Developer (DEVELOPER_LEVEL_MESSAGE, "info_angularfade: %s = %f %f\n", texname, power, scale);
			}
		}
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
leaq 0x828f87(%rip), %rax    # 0x851498
movq (%rax), %rax
movslq (%rax), %r14
leaq (,%r14,4), %rax
leaq (%rax,%rax,2), %rbx
movq %rbx, %rdi
callq 0x4410
movq %rax, 0x5512656(%rip)   # 0x553ab88
movq %r14, 0x8(%rsp)
testq %r14, %r14
jle 0x28561
xorl %eax, %eax
movl $0x3f800000, %ecx       # imm = 0x3F800000
movq 0x551263e(%rip), %rdx   # 0x553ab88
movl %ecx, (%rdx,%rax)
movq 0x5512634(%rip), %rdx   # 0x553ab88
movl %ecx, 0x4(%rdx,%rax)
addq $0xc, %rax
cmpq %rax, %rbx
jne 0x28543
leaq 0x2016ebc(%rip), %rax   # 0x203f424
cmpl $0x0, (%rax)
jle 0x28741
leaq 0x170b8(%rip), %r12     # 0x3f630
xorl %ecx, %ecx
movq %rcx, 0x18(%rsp)
movq %rcx, %rdi
shlq $0x5, %rdi
addq 0x1fa3b(%rip), %rdi     # 0x47fc8
movq %rdi, 0x20(%rsp)
leaq 0x10072(%rip), %rsi     # 0x3860b
callq 0x7571
movq %rax, %rdi
leaq 0x14d79(%rip), %rsi     # 0x3d321
callq 0x4440
testl %eax, %eax
jne 0x28726
movl $0x3, %edi
leaq 0x14d71(%rip), %rsi     # 0x3d332
xorl %eax, %eax
callq 0xa52e
cmpl $0x0, 0x8(%rsp)
jle 0x28726
xorl %r13d, %r13d
movq 0x20(%rsp), %rax
movq 0x18(%rax), %rbp
testq %rbp, %rbp
je 0x28718
leaq 0x828ea9(%rip), %rax    # 0x851498
movq (%rax), %rax
movslq 0x4(%rax,%r13,4), %rbx
addq %rax, %rbx
leaq (,%r13,4), %rax
leaq (%rax,%rax,2), %r15
movq 0x8(%rbp), %r14
movq %r14, %rdi
movq %rbx, %rsi
callq 0x4320
testl %eax, %eax
je 0x28627
movq (%rbp), %rbp
testq %rbp, %rbp
jne 0x28606
jmp 0x28718
movq %r14, %rdi
movq %r12, %rsi
callq 0x4320
testl %eax, %eax
je 0x28619
movq 0x10(%rbp), %rdi
leaq 0x139bf(%rip), %rsi     # 0x3c000
leaq 0x10(%rsp), %rdx
movq %rsp, %rcx
xorl %eax, %eax
callq 0x42d0
cmpl $0x2, %eax
xorpd %xmm2, %xmm2
je 0x28670
cmpl $0x1, %eax
jne 0x28701
movabsq $0x3ff0000000000000, %rax # imm = 0x3FF0000000000000
movq %rax, (%rsp)
movsd 0x10(%rsp), %xmm1
ucomisd %xmm1, %xmm2
ja 0x286f4
movsd (%rsp), %xmm0
ucomisd %xmm0, %xmm2
ja 0x286f4
cvtsd2ss %xmm1, %xmm1
movaps %xmm1, %xmm2
addss 0xfaa2(%rip), %xmm2     # 0x38138
mulss 0x1340a(%rip), %xmm2    # 0x3baa8
cvtss2sd %xmm2, %xmm2
mulsd %xmm2, %xmm0
movsd %xmm0, (%rsp)
movq 0x55124d6(%rip), %rax   # 0x553ab88
movss %xmm1, (%rax,%r15)
xorps %xmm0, %xmm0
cvtsd2ss (%rsp), %xmm0
movq 0x55124c1(%rip), %rax   # 0x553ab88
movss %xmm0, 0x4(%rax,%r15)
movsd 0x10(%rsp), %xmm0
movsd (%rsp), %xmm1
movl $0x3, %edi
leaq 0x14cbd(%rip), %rsi     # 0x3d3a2
movq %rbx, %rdx
movb $0x2, %al
callq 0xa52e
jmp 0x28619
movq 0x10(%rbp), %rsi
leaq 0x14c79(%rip), %rdi     # 0x3d378
jmp 0x2870c
movq 0x10(%rbp), %rsi
leaq 0x14c49(%rip), %rdi     # 0x3d355
xorl %eax, %eax
callq 0xa38e
jmp 0x28619
incq %r13
cmpq 0x8(%rsp), %r13
jne 0x285d6
movq 0x18(%rsp), %rcx
incq %rcx
leaq 0x2016cef(%rip), %rax   # 0x203f424
movslq (%rax), %rax
cmpq %rax, %rcx
jl 0x2857a
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq