// File: /workspace/github_cpp_makefile_star2_O2/FreeSlave[P]vhlt/hlrad/qrad.cpp
// Function: ReadTranslucentTextures()
void ReadTranslucentTextures()
{
	int num;
	int i, k;
	entity_t *mapent;
	epair_t *ep;

	num = ((dmiptexlump_t *)g_dtexdata)->nummiptex;
	g_translucenttextures = (vec3_t *)malloc (num * sizeof(vec3_t));
	for (i = 0; i < num; i++)
	{
		VectorClear (g_translucenttextures[i]);
	}
	for (k = 0; k < g_numentities; k++)
	{
		mapent = &g_entities[k];
		if (strcmp(ValueForKey(mapent, "classname"), "info_translucent"))
			continue;
		Developer (DEVELOPER_LEVEL_MESSAGE, "info_translucent 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 r, g, b;
				int count;
				count = sscanf (ep->value, "%lf %lf %lf", &r, &g, &b);
				if (count == 1)
				{
					g = b = r;
				}
				else if (count != 3)
				{
					Warning ("ignore bad translucent value '%s'", ep->value);
					continue;
				}
				if (r < 0.0 || r > 1.0 || g < 0.0 || g > 1.0 || b < 0.0 || b > 1.0)
				{
					Warning ("translucent value should be 0.0-1.0");
					continue;
				}
				g_translucenttextures[i][0] = r;
				g_translucenttextures[i][1] = g;
				g_translucenttextures[i][2] = b;
				Developer (DEVELOPER_LEVEL_MESSAGE, "info_translucent: %s = %f %f %f\n", texname, r, g, b);
			}
		}
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
leaq 0x8294f8(%rip), %rax    # 0x84d4a8
movq (%rax), %rax
movslq (%rax), %rbx
imulq $0xc, %rbx, %rdi
callq 0x4420
movq %rax, 0x54d2baa(%rip)   # 0x54f6b70
xorl %eax, %eax
testl %ebx, %ebx
movl $0x0, %ecx
cmovgl %ebx, %ecx
movq %rcx, 0x30(%rsp)
imulq $0xc, %rcx, %rcx
cmpq %rax, %rcx
je 0x24009
movq 0x54d2b89(%rip), %rdx   # 0x54f6b70
andl $0x0, 0x8(%rdx,%rax)
movq 0x54d2b7d(%rip), %rdx   # 0x54f6b70
andl $0x0, 0x4(%rdx,%rax)
movq 0x54d2b71(%rip), %rdx   # 0x54f6b70
andl $0x0, (%rdx,%rax)
addq $0xc, %rax
jmp 0x23fdb
leaq 0x1551d(%rip), %r12     # 0x3952d
xorl %ecx, %ecx
leaq 0x201741b(%rip), %rax   # 0x203b434
movslq (%rax), %rax
cmpq %rax, %rcx
jge 0x241f0
movq %rcx, 0x28(%rsp)
movq %rcx, %rdi
shlq $0x5, %rdi
addq 0x1ff98(%rip), %rdi     # 0x43fd0
movq %rdi, 0x20(%rsp)
leaq 0xe527(%rip), %rsi      # 0x3256b
callq 0x6929
movq %rax, %rdi
leaq 0x13130(%rip), %rsi     # 0x37183
callq 0x4460
testl %eax, %eax
je 0x24066
movq 0x28(%rsp), %rcx
incq %rcx
jmp 0x24012
pushq $0x3
popq %rdi
leaq 0x13124(%rip), %rsi     # 0x37194
xorl %eax, %eax
callq 0x9045
addq $0x18, 0x20(%rsp)
xorl %r15d, %r15d
cmpq 0x30(%rsp), %r15
je 0x2405c
leaq 0x82941a(%rip), %rax    # 0x84d4a8
movq (%rax), %rax
movslq 0x4(%rax,%r15,4), %rbp
addq %rax, %rbp
imulq $0xc, %r15, %rbx
movq 0x20(%rsp), %r14
movq (%r14), %r14
testq %r14, %r14
je 0x241e8
movq 0x8(%r14), %r13
movq %r13, %rdi
movq %rbp, %rsi
callq 0x4320
testl %eax, %eax
jne 0x240a2
movq %r13, %rdi
movq %r12, %rsi
callq 0x4320
testl %eax, %eax
je 0x240a2
movq 0x10(%r14), %rdi
leaq 0x11e61(%rip), %rsi     # 0x35f3c
leaq 0x18(%rsp), %rdx
leaq 0x10(%rsp), %rcx
leaq 0x8(%rsp), %r8
xorl %eax, %eax
callq 0x42c0
cmpl $0x1, %eax
je 0x24113
cmpl $0x3, %eax
jne 0x241d1
movsd 0x18(%rsp), %xmm0
movsd 0x10(%rsp), %xmm2
movsd 0x8(%rsp), %xmm1
jmp 0x2412d
movsd 0x18(%rsp), %xmm1
movsd %xmm1, 0x8(%rsp)
movsd %xmm1, 0x10(%rsp)
movapd %xmm1, %xmm2
movapd %xmm1, %xmm0
xorpd %xmm3, %xmm3
movsd 0x10f8f(%rip), %xmm4    # 0x350c8
ucomisd %xmm0, %xmm3
ja 0x241be
ucomisd %xmm4, %xmm0
ja 0x241be
ucomisd %xmm2, %xmm3
ja 0x241be
ucomisd %xmm4, %xmm2
ja 0x241be
ucomisd %xmm1, %xmm3
ja 0x241be
ucomisd %xmm4, %xmm1
ja 0x241be
cvtsd2ss %xmm0, %xmm0
movq 0x54d2a08(%rip), %rax   # 0x54f6b70
movss %xmm0, (%rax,%rbx)
cvtsd2ss 0x10(%rsp), %xmm0
movq 0x54d29f6(%rip), %rax   # 0x54f6b70
movss %xmm0, 0x4(%rax,%rbx)
cvtsd2ss 0x8(%rsp), %xmm0
movq 0x54d29e3(%rip), %rax   # 0x54f6b70
movss %xmm0, 0x8(%rax,%rbx)
movsd 0x18(%rsp), %xmm0
movsd 0x10(%rsp), %xmm1
movsd 0x8(%rsp), %xmm2
pushq $0x3
popq %rdi
leaq 0x1304e(%rip), %rsi     # 0x371fd
movq %rbp, %rdx
movb $0x3, %al
callq 0x9045
jmp 0x240a2
leaq 0x13014(%rip), %rdi     # 0x371d9
xorl %eax, %eax
callq 0x8ea5
jmp 0x240a2
movq 0x10(%r14), %rsi
leaq 0x12fdb(%rip), %rdi     # 0x371b7
xorl %eax, %eax
callq 0x8ea5
jmp 0x240a2
incq %r15
jmp 0x24080
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq