// File: /workspace/github_c_makefile_star2_O3/AlexCharlton[P]Hyperscene/src/aabb-tree.c
// Function: doVisible
static void doVisible(AABBtree *tree, Plane *planes, void (*func)(Node *), int planeMask){
    int nextMask = 0;
    int inView = inPlanes(tree, planes, planeMask, &nextMask);
    int i;
    if (inView == INSIDE)
	treeMap(tree, func);
    else if (inView == INTERSECT){
#ifdef DEBUG
        nTrees++;
#endif 
	for (i = 0; i < tree->nodes.size; i++)
	    func(tree->nodes.data[i]);
	for (i = 0; i < 27; i++){
	    AABBtree *child = tree->children[i];
	    if (child)
		doVisible(child, planes, func, nextMask);
	}
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x58, %rsp
movl %ecx, 0x3c(%rsp)
movq %rdx, %rbp
movq %rdi, %r14
movzwl 0xea(%rdi), %ecx
movl $0x1, %eax
shll %cl, %eax
movl %eax, 0x38(%rsp)
shll $0x4, %ecx
movss (%rsi,%rcx), %xmm0
movss 0x4(%rsi,%rcx), %xmm9
movss 0x8(%rsi,%rcx), %xmm14
movq %rsi, 0x48(%rsp)
movss 0xc(%rsi,%rcx), %xmm15
cmpb $0x0, 0x110(%rdi)
movss %xmm0, 0x20(%rsp)
movss %xmm14, 0x10(%rsp)
movss %xmm15, 0xc(%rsp)
movss %xmm9, 0x8(%rsp)
jne 0x7b8b
movq %r14, %rdi
callq 0x8193
movss 0x8(%rsp), %xmm9
movss 0xc(%rsp), %xmm15
movss 0x10(%rsp), %xmm14
movss 0x20(%rsp), %xmm0
cmpw $0x0, 0xe8(%r14)
jne 0x7e04
movq 0x120(%r14), %rbx
cmpq $0x1e, %rbx
jb 0x7e04
movq %rbp, 0x50(%rsp)
leaq 0x118(%r14), %r12
movq %r14, %rdi
callq 0x83ee
movss 0x104(%r14), %xmm0
movss 0x108(%r14), %xmm2
subss 0xf8(%r14), %xmm0
subss 0xfc(%r14), %xmm2
movss 0x10c(%r14), %xmm1
subss 0x100(%r14), %xmm1
movss 0x34cf(%rip), %xmm4     # 0xb0cc
movaps %xmm2, %xmm3
mulss %xmm4, %xmm3
movaps %xmm1, %xmm5
mulss %xmm4, %xmm5
movaps %xmm0, %xmm6
cmpltps %xmm5, %xmm6
movaps %xmm0, %xmm7
cmpltps %xmm3, %xmm7
orps %xmm6, %xmm7
movd %xmm7, %eax
andl $0x1, %eax
xorl $0x7, %eax
mulss %xmm4, %xmm0
movaps %xmm2, %xmm4
cmpltps %xmm0, %xmm4
cmpltps %xmm5, %xmm2
orps %xmm4, %xmm2
movd %xmm2, %ecx
movl %eax, %edx
andl $-0x3, %edx
testb $0x1, %cl
cmovel %eax, %edx
movaps %xmm1, %xmm2
cmpltps %xmm0, %xmm2
cmpltps %xmm3, %xmm1
orps %xmm2, %xmm1
movd %xmm1, %eax
movl %edx, %ecx
andl $0x3, %ecx
testb $0x1, %al
cmovel %edx, %ecx
movw %cx, 0xe8(%r14)
movq %rbx, 0x40(%rsp)
testl %ebx, %ebx
jle 0x7ccb
movq 0x40(%rsp), %r15
andl $0x7fffffff, %r15d      # imm = 0x7FFFFFFF
xorl %ebp, %ebp
movq 0x118(%r14), %rax
movq (%rax,%rbp,8), %r13
movq (%r13), %rsi
movq %r14, %rdi
callq 0x7753
cmpq %r14, %rax
je 0x7cc3
movq %rax, %rbx
movq %rax, %rdi
addq $0x118, %rdi            # imm = 0x118
movq %r13, %rsi
callq 0x4270
movq %rbx, 0x8(%r13)
movq (%r12), %rax
movq $0x0, (%rax,%rbp,8)
incq %rbp
cmpq %rbp, %r15
jne 0x7c82
movq 0x120(%r14), %rax
testq %rax, %rax
movss 0x20(%rsp), %xmm0
movss 0x10(%rsp), %xmm14
movss 0xc(%rsp), %xmm15
movss 0x8(%rsp), %xmm9
movq 0x40(%rsp), %r15
je 0x7d3c
xorl %esi, %esi
xorl %ebx, %ebx
movq (%r12), %rcx
cmpq $0x0, (%rcx,%rsi,8)
je 0x7d0a
incl %ebx
jmp 0x7d34
movq %r12, %rdi
callq 0x40a0
movss 0x8(%rsp), %xmm9
movss 0xc(%rsp), %xmm15
movss 0x10(%rsp), %xmm14
movss 0x20(%rsp), %xmm0
movq 0x120(%r14), %rax
movslq %ebx, %rsi
cmpq %rsi, %rax
ja 0x7cfb
movslq %r15d, %rax
movl $0x1, %ecx
movq 0x50(%rsp), %rbp
movq (%r14,%rcx,8), %rdx
testq %rdx, %rdx
je 0x7d5b
cmpq %rax, 0x120(%rdx)
je 0x7d9d
incq %rcx
cmpq $0x1c, %rcx
jne 0x7d49
movl $0x1, %ebx
movq (%r14,%rbx,8), %rdi
testq %rdi, %rdi
je 0x7d92
callq 0x8193
movss 0x8(%rsp), %xmm9
movss 0xc(%rsp), %xmm15
movss 0x10(%rsp), %xmm14
movss 0x20(%rsp), %xmm0
incq %rbx
cmpq $0x1c, %rbx
jne 0x7d69
jmp 0x7e04
xorl %r15d, %r15d
movq 0x8(%r14,%r15,8), %r13
testq %r13, %r13
je 0x7de0
addq $0x118, %r13            # imm = 0x118
movq %r13, %rdi
callq 0x42d0
testq %rax, %rax
je 0x7de0
movq %rax, %rbx
movq %r12, %rdi
movq %rbx, %rsi
callq 0x4270
movq %r14, 0x8(%rbx)
movq %r13, %rdi
callq 0x42d0
movq %rax, %rbx
testq %rax, %rax
jne 0x7dc1
incq %r15
cmpq $0x1b, %r15
movss 0x20(%rsp), %xmm0
movss 0x10(%rsp), %xmm14
movss 0xc(%rsp), %xmm15
movss 0x8(%rsp), %xmm9
jne 0x7da0
movss 0xf8(%r14), %xmm6
movss 0xfc(%r14), %xmm1
movss 0x100(%r14), %xmm2
movss 0x104(%r14), %xmm3
movss 0x108(%r14), %xmm5
movss 0x10c(%r14), %xmm4
xorl %r12d, %r12d
movl 0x3c(%rsp), %r10d
movl 0x38(%rsp), %ecx
testl %r10d, %ecx
movaps %xmm2, 0x20(%rsp)
movaps %xmm4, 0x10(%rsp)
je 0x7f58
xorps %xmm12, %xmm12
movaps %xmm0, %xmm7
cmpltss %xmm12, %xmm7
movaps %xmm7, %xmm8
andps %xmm6, %xmm8
movaps %xmm7, %xmm10
andnps %xmm3, %xmm10
orps %xmm8, %xmm10
movaps %xmm9, %xmm8
cmpltss %xmm12, %xmm8
movaps %xmm8, %xmm9
andps %xmm1, %xmm9
movaps %xmm8, %xmm11
andnps %xmm5, %xmm11
orps %xmm9, %xmm11
movaps %xmm14, %xmm9
cmpltss %xmm12, %xmm9
movaps %xmm9, %xmm12
andps %xmm2, %xmm12
movaps %xmm9, %xmm13
andnps %xmm4, %xmm13
orps %xmm12, %xmm13
movss 0x8(%rsp), %xmm12
mulss %xmm12, %xmm11
mulss %xmm0, %xmm10
addss %xmm11, %xmm10
xorps %xmm11, %xmm11
mulss %xmm14, %xmm13
addss %xmm10, %xmm13
addss %xmm15, %xmm13
ucomiss %xmm13, %xmm11
movq 0x48(%rsp), %r15
ja 0x812d
movaps %xmm9, %xmm10
andps %xmm4, %xmm10
andnps %xmm2, %xmm9
orps %xmm10, %xmm9
movaps %xmm8, %xmm10
movaps %xmm5, %xmm4
andps %xmm5, %xmm10
movaps %xmm1, %xmm2
andnps %xmm1, %xmm8
orps %xmm10, %xmm8
movaps %xmm7, %xmm10
andps %xmm3, %xmm10
movaps %xmm6, %xmm1
andnps %xmm6, %xmm7
orps %xmm10, %xmm7
mulss %xmm8, %xmm12
mulss %xmm7, %xmm0
addss %xmm12, %xmm0
mulss %xmm9, %xmm14
addss %xmm0, %xmm14
addss %xmm14, %xmm15
ucomiss %xmm15, %xmm11
movl $0x0, %eax
jbe 0x7f68
movl $0x2, %eax
movl %ecx, %r12d
jmp 0x7f68
movaps %xmm5, %xmm4
movaps %xmm1, %xmm2
movaps %xmm6, %xmm1
xorl %eax, %eax
movq 0x48(%rsp), %r15
testl %r10d, %r10d
jle 0x80ba
movzwl 0xea(%r14), %ecx
leaq 0xc(%r15), %rsi
movl $0x1, %edi
xorl %edx, %edx
xorps %xmm15, %xmm15
movaps %xmm4, %xmm5
movaps 0x10(%rsp), %xmm6
cmpq %rdx, %rcx
sete %r8b
testl %r10d, %edi
sete %r9b
orb %r8b, %r9b
jne 0x80a8
movss -0xc(%rsi), %xmm7
movss -0x8(%rsi), %xmm9
movss -0x4(%rsi), %xmm0
movaps %xmm7, %xmm10
cmpltss %xmm15, %xmm10
movaps %xmm10, %xmm11
andps %xmm1, %xmm11
movaps %xmm10, %xmm13
andnps %xmm3, %xmm13
orps %xmm11, %xmm13
movaps %xmm9, %xmm11
cmpltss %xmm15, %xmm11
movaps %xmm11, %xmm12
andps %xmm2, %xmm12
movaps %xmm11, %xmm14
andnps %xmm5, %xmm14
orps %xmm12, %xmm14
movaps %xmm0, %xmm8
cmpltss %xmm15, %xmm8
movaps %xmm8, %xmm15
movaps %xmm3, %xmm4
movaps 0x20(%rsp), %xmm3
andps %xmm3, %xmm15
movaps %xmm8, %xmm12
andnps %xmm6, %xmm12
orps %xmm15, %xmm12
xorps %xmm15, %xmm15
mulss %xmm9, %xmm14
mulss %xmm7, %xmm13
addss %xmm14, %xmm13
mulss %xmm0, %xmm12
addss %xmm13, %xmm12
movss (%rsi), %xmm13
addss %xmm13, %xmm12
ucomiss %xmm12, %xmm15
ja 0x8125
movaps %xmm8, %xmm12
andps %xmm6, %xmm12
andnps %xmm3, %xmm8
orps %xmm12, %xmm8
movaps %xmm11, %xmm12
andps %xmm5, %xmm12
andnps %xmm2, %xmm11
orps %xmm12, %xmm11
movaps %xmm10, %xmm12
andps %xmm4, %xmm12
andnps %xmm1, %xmm10
orps %xmm12, %xmm10
mulss %xmm11, %xmm9
mulss %xmm10, %xmm7
addss %xmm9, %xmm7
mulss %xmm8, %xmm0
addss %xmm7, %xmm0
addss %xmm0, %xmm13
ucomiss %xmm13, %xmm15
movaps %xmm4, %xmm3
jbe 0x80a8
orl %edi, %r12d
movl $0x2, %eax
incq %rdx
addl %edi, %edi
addq $0x10, %rsi
cmpl %r10d, %edi
jle 0x7f90
testl %eax, %eax
je 0x810f
cmpl $0x2, %eax
jne 0x812d
cmpq $0x0, 0x120(%r14)
je 0x80e8
xorl %ebx, %ebx
movq 0x118(%r14), %rax
movq (%rax,%rbx,8), %rdi
callq *%rbp
incq %rbx
cmpq %rbx, 0x120(%r14)
ja 0x80cf
movl $0x1, %ebx
movq (%r14,%rbx,8), %rdi
testq %rdi, %rdi
je 0x8104
movq %r15, %rsi
movq %rbp, %rdx
movl %r12d, %ecx
callq 0x7af8
incq %rbx
cmpq $0x1c, %rbx
jne 0x80ed
jmp 0x812d
movq %r14, %rdi
movq %rbp, %rsi
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x813c
movw %dx, 0xea(%r14)
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq