// File: /workspace/github_cpp_makefile_star2_O3/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 0x8290f9(%rip), %rax    # 0x850498
movq (%rax), %rax
movslq (%rax), %r14
leaq (,%r14,4), %rax
leaq (%rax,%rax,2), %rbx
movq %rbx, %rdi
callq 0x4400
movq %rax, 0x54d27a0(%rip)   # 0x54f9b60
movq %r14, 0x20(%rsp)
testq %r14, %r14
jle 0x273f7
xorl %eax, %eax
xorl %ecx, %ecx
movq 0x54d278b(%rip), %rdx   # 0x54f9b60
movl %eax, 0x8(%rdx,%rcx)
movq 0x54d2780(%rip), %rdx   # 0x54f9b60
movl %eax, 0x4(%rdx,%rcx)
movq 0x54d2775(%rip), %rdx   # 0x54f9b60
movl %eax, (%rdx,%rcx)
addq $0xc, %rcx
cmpq %rcx, %rbx
jne 0x273ce
leaq 0x2017026(%rip), %rax   # 0x203e424
cmpl $0x0, (%rax)
jle 0x2761b
leaq 0x1719f(%rip), %r12     # 0x3e5ad
xorl %ecx, %ecx
movq %rcx, 0x28(%rsp)
movq %rcx, %rdi
shlq $0x5, %rdi
addq 0x1fbad(%rip), %rdi     # 0x46fd0
movq %rdi, 0x30(%rsp)
leaq 0x101d4(%rip), %rsi     # 0x37603
callq 0x752d
movq %rax, %rdi
leaq 0x14dc5(%rip), %rsi     # 0x3c203
callq 0x4430
testl %eax, %eax
jne 0x27600
movl $0x3, %edi
leaq 0x14dbd(%rip), %rsi     # 0x3c214
xorl %eax, %eax
callq 0xa446
cmpl $0x0, 0x20(%rsp)
jle 0x27600
xorl %ebp, %ebp
movq 0x30(%rsp), %rax
movq 0x18(%rax), %r15
testq %r15, %r15
je 0x275f2
leaq 0x829014(%rip), %rax    # 0x850498
movq (%rax), %rax
movslq 0x4(%rax,%rbp,4), %r14
addq %rax, %r14
leaq (,%rbp,4), %rax
leaq (%rax,%rax,2), %rbx
movq 0x8(%r15), %r13
movq %r13, %rdi
movq %r14, %rsi
callq 0x4310
testl %eax, %eax
je 0x274bb
movq (%r15), %r15
testq %r15, %r15
jne 0x2749b
jmp 0x275f2
movq %r13, %rdi
movq %r12, %rsi
callq 0x4310
testl %eax, %eax
je 0x274ae
movq 0x10(%r15), %rdi
leaq 0x13aa7(%rip), %rsi     # 0x3af7c
leaq 0x18(%rsp), %rdx
leaq 0x10(%rsp), %rcx
leaq 0x8(%rsp), %r8
xorl %eax, %eax
callq 0x42c0
cmpl $0x1, %eax
je 0x2750d
cmpl $0x3, %eax
jne 0x275db
movsd 0x18(%rsp), %xmm0
movsd 0x10(%rsp), %xmm2
movsd 0x8(%rsp), %xmm1
jmp 0x27527
movsd 0x18(%rsp), %xmm1
movsd %xmm1, 0x8(%rsp)
movsd %xmm1, 0x10(%rsp)
movapd %xmm1, %xmm2
movapd %xmm1, %xmm0
xorpd %xmm3, %xmm3
movsd 0x12c35(%rip), %xmm4    # 0x3a168
ucomisd %xmm0, %xmm3
ja 0x275c8
ucomisd %xmm4, %xmm0
ja 0x275c8
ucomisd %xmm2, %xmm3
ja 0x275c8
ucomisd %xmm4, %xmm2
ja 0x275c8
ucomisd %xmm1, %xmm3
ja 0x275c8
ucomisd %xmm4, %xmm1
ja 0x275c8
cvtsd2ss %xmm0, %xmm0
movq 0x54d25f6(%rip), %rax   # 0x54f9b60
movss %xmm0, (%rax,%rbx)
xorps %xmm0, %xmm0
cvtsd2ss 0x10(%rsp), %xmm0
movq 0x54d25e1(%rip), %rax   # 0x54f9b60
movss %xmm0, 0x4(%rax,%rbx)
xorps %xmm0, %xmm0
cvtsd2ss 0x8(%rsp), %xmm0
movq 0x54d25cb(%rip), %rax   # 0x54f9b60
movss %xmm0, 0x8(%rax,%rbx)
movsd 0x18(%rsp), %xmm0
movsd 0x10(%rsp), %xmm1
movsd 0x8(%rsp), %xmm2
movl $0x3, %edi
leaq 0x14cc4(%rip), %rsi     # 0x3c27d
movq %r14, %rdx
movb $0x3, %al
callq 0xa446
jmp 0x274ae
leaq 0x14c8a(%rip), %rdi     # 0x3c259
xorl %eax, %eax
callq 0xa2a6
jmp 0x274ae
movq 0x10(%r15), %rsi
leaq 0x14c51(%rip), %rdi     # 0x3c237
xorl %eax, %eax
callq 0xa2a6
jmp 0x274ae
incq %rbp
cmpq 0x20(%rsp), %rbp
jne 0x2746b
movq 0x28(%rsp), %rcx
incq %rcx
leaq 0x2016e15(%rip), %rax   # 0x203e424
movslq (%rax), %rax
cmpq %rax, %rcx
jl 0x27410
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq