// File: FreeSlave[P]vhlt/hlrad/lightmap.cpp
// Function: TestFaceIntersect(intersecttest_t*, int)
bool TestFaceIntersect (intersecttest_t *t, int facenum)
{
	dface_t *f2 = &g_dfaces[facenum];
	Winding *w = new Winding (*f2);
	int k;
	for (k = 0; k < w->m_NumPoints; k++)
	{
		VectorAdd (w->m_Points[k], g_face_offset[facenum], w->m_Points[k]);
	}
	for (k = 0; k < t->numclipplanes; k++)
	{
		if (!w->Clip (t->clipplanes[k], false
#ifdef ZHLT_WINDING_EPSILON
			, ON_EPSILON*4
#endif
			))
		{
			break;
		}
	}
	bool intersect = w->m_NumPoints > 0;
	delete w;
	return intersect;
}

// Assembly:
subq $0x48, %rsp
movq %rdi, 0x40(%rsp)
movl %esi, 0x3c(%rsp)
movslq 0x3c(%rsp), %rax
leaq (%rax,%rax,4), %rcx
leaq 0x1bbc573(%rip), %rax   # 0x1be6410
leaq (%rax,%rcx,4), %rax
movq %rax, 0x30(%rsp)
movl $0x20, %edi
callq 0x4320
movq %rax, %rdi
movq %rdi, %rax
movq %rax, 0x8(%rsp)
movq 0x30(%rsp), %rsi
movss 0x43cc8(%rip), %xmm0    # 0x6db90
callq 0xf130
jmp 0x29ecf
movq 0x8(%rsp), %rax
movq %rax, 0x28(%rsp)
movl $0x0, 0x18(%rsp)
movl 0x18(%rsp), %eax
movq 0x28(%rsp), %rcx
cmpl 0x8(%rcx), %eax
jae 0x2a006
movq 0x28(%rsp), %rax
movq 0x10(%rax), %rax
movslq 0x18(%rsp), %rcx
imulq $0xc, %rcx, %rcx
addq %rcx, %rax
movss (%rax), %xmm0
movslq 0x3c(%rsp), %rcx
leaq 0x5443af8(%rip), %rax   # 0x546da10
imulq $0xc, %rcx, %rcx
addq %rcx, %rax
addss (%rax), %xmm0
movq 0x28(%rsp), %rax
movq 0x10(%rax), %rax
movslq 0x18(%rsp), %rcx
imulq $0xc, %rcx, %rcx
addq %rcx, %rax
movss %xmm0, (%rax)
movq 0x28(%rsp), %rax
movq 0x10(%rax), %rax
movslq 0x18(%rsp), %rcx
imulq $0xc, %rcx, %rcx
addq %rcx, %rax
movss 0x4(%rax), %xmm0
movslq 0x3c(%rsp), %rcx
leaq 0x5443aae(%rip), %rax   # 0x546da10
imulq $0xc, %rcx, %rcx
addq %rcx, %rax
addss 0x4(%rax), %xmm0
movq 0x28(%rsp), %rax
movq 0x10(%rax), %rax
movslq 0x18(%rsp), %rcx
imulq $0xc, %rcx, %rcx
addq %rcx, %rax
movss %xmm0, 0x4(%rax)
movq 0x28(%rsp), %rax
movq 0x10(%rax), %rax
movslq 0x18(%rsp), %rcx
imulq $0xc, %rcx, %rcx
addq %rcx, %rax
movss 0x8(%rax), %xmm0
movslq 0x3c(%rsp), %rcx
leaq 0x5443a62(%rip), %rax   # 0x546da10
imulq $0xc, %rcx, %rcx
addq %rcx, %rax
addss 0x8(%rax), %xmm0
movq 0x28(%rsp), %rax
movq 0x10(%rax), %rax
movslq 0x18(%rsp), %rcx
imulq $0xc, %rcx, %rcx
addq %rcx, %rax
movss %xmm0, 0x8(%rax)
movl 0x18(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x18(%rsp)
jmp 0x29ee1
movq 0x8(%rsp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x20(%rsp)
movl %eax, 0x1c(%rsp)
movl $0x20, %esi
callq 0x4330
jmp 0x2a08f
movl $0x0, 0x18(%rsp)
movl 0x18(%rsp), %eax
movq 0x40(%rsp), %rcx
cmpl (%rcx), %eax
jge 0x2a059
movq 0x28(%rsp), %rdi
movq 0x40(%rsp), %rax
movq 0x8(%rax), %rsi
movslq 0x18(%rsp), %rax
imulq $0x14, %rax, %rax
addq %rax, %rsi
xorl %edx, %edx
movss 0x43b55(%rip), %xmm0    # 0x6db94
callq 0x10450
testb $0x1, %al
jne 0x2a04a
jmp 0x2a059
jmp 0x2a04c
movl 0x18(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x18(%rsp)
jmp 0x2a00e
movq 0x28(%rsp), %rax
cmpl $0x0, 0x8(%rax)
seta %al
andb $0x1, %al
movb %al, 0x17(%rsp)
movq 0x28(%rsp), %rax
movq %rax, (%rsp)
cmpq $0x0, %rax
je 0x2a084
movq (%rsp), %rdi
movq (%rdi), %rax
callq *0x8(%rax)
movb 0x17(%rsp), %al
andb $0x1, %al
addq $0x48, %rsp
retq
movq 0x20(%rsp), %rdi
callq 0x45c0
nopl (%rax)