// File: FreeSlave[P]vhlt/hlrad/transparency.cpp
// Function: GetTransparency(unsigned int, unsigned int, float (&) [3], unsigned int&)
void GetTransparency(const unsigned p1, const unsigned p2, vec3_t &trans, unsigned int &next_index)
{
	VectorFill( trans, 1.0 );
	
	for( unsigned i = next_index; i < s_sorted_count; i++ )
	{
		if ( s_sorted_list[i].p1 < p1 )
		{
			continue;
		}
		else if ( s_sorted_list[i].p1 == p1 )
		{
			if ( s_sorted_list[i].p2 < p2 )
			{
				continue;
			}
			else if ( s_sorted_list[i].p2 == p2 )
			{
				VectorCopy( s_trans_list[s_sorted_list[i].data_index], trans );
				next_index = i + 1;
			
				return;
			}
			else //if ( s_sorted_list[i].p2 > p2 )
			{
				next_index = i;
			
				return;
			}
		}
		else //if ( s_sorted_list[i].p1 > p1 )
		{
			next_index = i;
			
			return;
		}
	}
	
	next_index = s_sorted_count;
}

// Assembly:
movl %edi, -0x4(%rsp)
movl %esi, -0x8(%rsp)
movq %rdx, -0x10(%rsp)
movq %rcx, -0x18(%rsp)
movq -0x10(%rsp), %rax
movss 0x3d7d(%rip), %xmm0     # 0x6a04c
movss %xmm0, (%rax)
movq -0x10(%rsp), %rax
movss 0x3d6c(%rip), %xmm0     # 0x6a04c
movss %xmm0, 0x4(%rax)
movq -0x10(%rsp), %rax
movss 0x3d5a(%rip), %xmm0     # 0x6a04c
movss %xmm0, 0x8(%rax)
movq -0x18(%rsp), %rax
movl (%rax), %eax
movl %eax, -0x1c(%rsp)
movl -0x1c(%rsp), %eax
cmpl 0x66c9814(%rip), %eax   # 0x672fb20
jae 0x6645c
movq 0x66c980f(%rip), %rax   # 0x672fb28
movl -0x1c(%rsp), %ecx
imulq $0xc, %rcx, %rcx
addq %rcx, %rax
movl (%rax), %eax
cmpl -0x4(%rsp), %eax
jae 0x66331
jmp 0x6644c
movq 0x66c97f0(%rip), %rax   # 0x672fb28
movl -0x1c(%rsp), %ecx
imulq $0xc, %rcx, %rcx
addq %rcx, %rax
movl (%rax), %eax
cmpl -0x4(%rsp), %eax
jne 0x6643f
movq 0x66c97d2(%rip), %rax   # 0x672fb28
movl -0x1c(%rsp), %ecx
imulq $0xc, %rcx, %rcx
addq %rcx, %rax
movl 0x4(%rax), %eax
cmpl -0x8(%rsp), %eax
jae 0x6636f
jmp 0x6644c
movq 0x66c97b2(%rip), %rax   # 0x672fb28
movl -0x1c(%rsp), %ecx
imulq $0xc, %rcx, %rcx
addq %rcx, %rax
movl 0x4(%rax), %eax
cmpl -0x8(%rsp), %eax
jne 0x66432
movq 0x66c97a3(%rip), %rax   # 0x672fb38
movq 0x66c978c(%rip), %rcx   # 0x672fb28
movl -0x1c(%rsp), %edx
imulq $0xc, %rdx, %rdx
addq %rdx, %rcx
movl 0x8(%rcx), %ecx
imulq $0xc, %rcx, %rcx
addq %rcx, %rax
movss (%rax), %xmm0
movq -0x10(%rsp), %rax
movss %xmm0, (%rax)
movq 0x66c9773(%rip), %rax   # 0x672fb38
movq 0x66c975c(%rip), %rcx   # 0x672fb28
movl -0x1c(%rsp), %edx
imulq $0xc, %rdx, %rdx
addq %rdx, %rcx
movl 0x8(%rcx), %ecx
imulq $0xc, %rcx, %rcx
addq %rcx, %rax
movss 0x4(%rax), %xmm0
movq -0x10(%rsp), %rax
movss %xmm0, 0x4(%rax)
movq 0x66c9741(%rip), %rax   # 0x672fb38
movq 0x66c972a(%rip), %rcx   # 0x672fb28
movl -0x1c(%rsp), %edx
imulq $0xc, %rdx, %rdx
addq %rdx, %rcx
movl 0x8(%rcx), %ecx
imulq $0xc, %rcx, %rcx
addq %rcx, %rax
movss 0x8(%rax), %xmm0
movq -0x10(%rsp), %rax
movss %xmm0, 0x8(%rax)
movl -0x1c(%rsp), %ecx
addl $0x1, %ecx
movq -0x18(%rsp), %rax
movl %ecx, (%rax)
jmp 0x66469
movl -0x1c(%rsp), %ecx
movq -0x18(%rsp), %rax
movl %ecx, (%rax)
jmp 0x66469
movl -0x1c(%rsp), %ecx
movq -0x18(%rsp), %rax
movl %ecx, (%rax)
jmp 0x66469
movl -0x1c(%rsp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rsp)
jmp 0x66302
movl 0x66c96be(%rip), %ecx   # 0x672fb20
movq -0x18(%rsp), %rax
movl %ecx, (%rax)
retq
nopw (%rax,%rax)