int intersect_triangle(float orig[3], float dir[3], float vert0[3],
                       float vert1[3], float vert2[3], float *t, float *u,
                       float *v) {
  float edge1[3], edge2[3], tvec[3], pvec[3], qvec[3];
  float det, inv_det;
  edge1[0] = vert1[0] - vert0[0];
  edge1[1] = vert1[1] - vert0[1];
  edge1[2] = vert1[2] - vert0[2];
  ;
  edge2[0] = vert2[0] - vert0[0];
  edge2[1] = vert2[1] - vert0[1];
  edge2[2] = vert2[2] - vert0[2];
  ;
  pvec[0] = dir[1] * edge2[2] - dir[2] * edge2[1];
  pvec[1] = dir[2] * edge2[0] - dir[0] * edge2[2];
  pvec[2] = dir[0] * edge2[1] - dir[1] * edge2[0];
  ;
  det = (edge1[0] * pvec[0] + edge1[1] * pvec[1] + edge1[2] * pvec[2]);
  if (det > -0.000001 && det < 0.000001)
    return 0;
  inv_det = 1.0f / det;
  tvec[0] = orig[0] - vert0[0];
  tvec[1] = orig[1] - vert0[1];
  tvec[2] = orig[2] - vert0[2];
  ;
  *u = (tvec[0] * pvec[0] + tvec[1] * pvec[1] + tvec[2] * pvec[2]) * inv_det;
  if (*u < 0.0 || *u > 1.0)
    return 0;
  qvec[0] = tvec[1] * edge1[2] - tvec[2] * edge1[1];
  qvec[1] = tvec[2] * edge1[0] - tvec[0] * edge1[2];
  qvec[2] = tvec[0] * edge1[1] - tvec[1] * edge1[0];
  ;
  *v = (dir[0] * qvec[0] + dir[1] * qvec[1] + dir[2] * qvec[2]) * inv_det;
  if (*v < 0.0 || *u + *v > 1.0)
    return 0;
  *t = (edge2[0] * qvec[0] + edge2[1] * qvec[1] + edge2[2] * qvec[2]) * inv_det;
  return 1;
}


x86 assembly (clang, -O0):
<intersect_triangle>:
push   %rbp
mov    %rsp,%rbp
mov    0x18(%rbp),%rax
mov    0x10(%rbp),%rax
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
mov    %r8,-0x30(%rbp)
mov    %r9,-0x38(%rbp)
mov    -0x28(%rbp),%rax
movss  (%rax),%xmm0
mov    -0x20(%rbp),%rax
subss  (%rax),%xmm0
movss  %xmm0,-0x44(%rbp)
mov    -0x28(%rbp),%rax
movss  0x4(%rax),%xmm0
mov    -0x20(%rbp),%rax
subss  0x4(%rax),%xmm0
movss  %xmm0,-0x40(%rbp)
mov    -0x28(%rbp),%rax
movss  0x8(%rax),%xmm0
mov    -0x20(%rbp),%rax
subss  0x8(%rax),%xmm0
movss  %xmm0,-0x3c(%rbp)
mov    -0x30(%rbp),%rax
movss  (%rax),%xmm0
mov    -0x20(%rbp),%rax
subss  (%rax),%xmm0
movss  %xmm0,-0x50(%rbp)
mov    -0x30(%rbp),%rax
movss  0x4(%rax),%xmm0
mov    -0x20(%rbp),%rax
subss  0x4(%rax),%xmm0
movss  %xmm0,-0x4c(%rbp)
mov    -0x30(%rbp),%rax
movss  0x8(%rax),%xmm0
mov    -0x20(%rbp),%rax
subss  0x8(%rax),%xmm0
movss  %xmm0,-0x48(%rbp)
mov    -0x18(%rbp),%rax
movss  0x4(%rax),%xmm0
movss  -0x48(%rbp),%xmm2
mov    -0x18(%rbp),%rax
movss  0x8(%rax),%xmm1
mulss  -0x4c(%rbp),%xmm1
movd   %xmm1,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
movss  %xmm0,-0x68(%rbp)
mov    -0x18(%rbp),%rax
movss  0x8(%rax),%xmm0
movss  -0x50(%rbp),%xmm2
mov    -0x18(%rbp),%rax
movss  (%rax),%xmm1
mulss  -0x48(%rbp),%xmm1
movd   %xmm1,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
movss  %xmm0,-0x64(%rbp)
mov    -0x18(%rbp),%rax
movss  (%rax),%xmm0
movss  -0x4c(%rbp),%xmm2
mov    -0x18(%rbp),%rax
movss  0x4(%rax),%xmm1
mulss  -0x50(%rbp),%xmm1
movd   %xmm1,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
movss  %xmm0,-0x60(%rbp)
movss  -0x44(%rbp),%xmm1
movss  -0x68(%rbp),%xmm2
movss  -0x40(%rbp),%xmm0
mulss  -0x64(%rbp),%xmm0
mulss  %xmm2,%xmm1
addss  %xmm0,%xmm1
movss  -0x3c(%rbp),%xmm0
movss  -0x60(%rbp),%xmm2
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
movss  %xmm0,-0x78(%rbp)
movss  -0x78(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xd72(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    12bf <intersect_triangle+0x1bf>
movss  -0x78(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xd5f(%rip),%xmm0
ucomisd %xmm1,%xmm0
jbe    12bf <intersect_triangle+0x1bf>
movl   $0x0,-0x4(%rbp)
jmp    14ef <intersect_triangle+0x3ef>
movss  0xd51(%rip),%xmm0
divss  -0x78(%rbp),%xmm0
movss  %xmm0,-0x7c(%rbp)
mov    -0x10(%rbp),%rax
movss  (%rax),%xmm0
mov    -0x20(%rbp),%rax
subss  (%rax),%xmm0
movss  %xmm0,-0x5c(%rbp)
mov    -0x10(%rbp),%rax
movss  0x4(%rax),%xmm0
mov    -0x20(%rbp),%rax
subss  0x4(%rax),%xmm0
movss  %xmm0,-0x58(%rbp)
mov    -0x10(%rbp),%rax
movss  0x8(%rax),%xmm0
mov    -0x20(%rbp),%rax
subss  0x8(%rax),%xmm0
movss  %xmm0,-0x54(%rbp)
movss  -0x5c(%rbp),%xmm1
movss  -0x68(%rbp),%xmm2
movss  -0x58(%rbp),%xmm0
mulss  -0x64(%rbp),%xmm0
mulss  %xmm2,%xmm1
addss  %xmm0,%xmm1
movss  -0x54(%rbp),%xmm0
movss  -0x60(%rbp),%xmm2
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
mulss  -0x7c(%rbp),%xmm0
mov    0x10(%rbp),%rax
movss  %xmm0,(%rax)
mov    0x10(%rbp),%rax
movss  (%rax),%xmm0
cvtss2sd %xmm0,%xmm1
xorps  %xmm0,%xmm0
ucomisd %xmm1,%xmm0
ja     1386 <intersect_triangle+0x286>
mov    0x10(%rbp),%rax
movss  (%rax),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xc94(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    1392 <intersect_triangle+0x292>
movl   $0x0,-0x4(%rbp)
jmp    14ef <intersect_triangle+0x3ef>
movss  -0x58(%rbp),%xmm0
movss  -0x3c(%rbp),%xmm2
movss  -0x54(%rbp),%xmm1
mulss  -0x40(%rbp),%xmm1
movd   %xmm1,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
movss  %xmm0,-0x74(%rbp)
movss  -0x54(%rbp),%xmm0
movss  -0x44(%rbp),%xmm2
movss  -0x5c(%rbp),%xmm1
mulss  -0x3c(%rbp),%xmm1
movd   %xmm1,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
movss  %xmm0,-0x70(%rbp)
movss  -0x5c(%rbp),%xmm0
movss  -0x40(%rbp),%xmm2
movss  -0x58(%rbp),%xmm1
mulss  -0x44(%rbp),%xmm1
movd   %xmm1,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
movss  %xmm0,-0x6c(%rbp)
mov    -0x18(%rbp),%rax
movss  (%rax),%xmm1
movss  -0x74(%rbp),%xmm2
mov    -0x18(%rbp),%rax
movss  0x4(%rax),%xmm0
mulss  -0x70(%rbp),%xmm0
mulss  %xmm2,%xmm1
addss  %xmm0,%xmm1
mov    -0x18(%rbp),%rax
movss  0x8(%rax),%xmm0
movss  -0x6c(%rbp),%xmm2
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
mulss  -0x7c(%rbp),%xmm0
mov    0x18(%rbp),%rax
movss  %xmm0,(%rax)
mov    0x18(%rbp),%rax
movss  (%rax),%xmm0
cvtss2sd %xmm0,%xmm1
xorps  %xmm0,%xmm0
ucomisd %xmm1,%xmm0
ja     14a1 <intersect_triangle+0x3a1>
mov    0x10(%rbp),%rax
movss  (%rax),%xmm0
mov    0x18(%rbp),%rax
addss  (%rax),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xb79(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    14ad <intersect_triangle+0x3ad>
movl   $0x0,-0x4(%rbp)
jmp    14ef <intersect_triangle+0x3ef>
movss  -0x50(%rbp),%xmm1
movss  -0x74(%rbp),%xmm2
movss  -0x4c(%rbp),%xmm0
mulss  -0x70(%rbp),%xmm0
mulss  %xmm2,%xmm1
addss  %xmm0,%xmm1
movss  -0x48(%rbp),%xmm0
movss  -0x6c(%rbp),%xmm2
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
mulss  -0x7c(%rbp),%xmm0
mov    -0x38(%rbp),%rax
movss  %xmm0,(%rax)
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<intersect_triangle>:
movss  (%rdx),%xmm8
movss  0x4(%rdx),%xmm15
movss  (%rcx),%xmm14
movss  0x4(%rcx),%xmm13
subss  %xmm8,%xmm14
subss  %xmm15,%xmm13
movss  0x8(%rcx),%xmm5
movss  0x8(%rdx),%xmm7
subss  %xmm7,%xmm5
movss  (%r8),%xmm9
movss  0x4(%r8),%xmm10
subss  %xmm8,%xmm9
subss  %xmm15,%xmm10
movss  0x8(%r8),%xmm12
subss  %xmm7,%xmm12
movss  (%rsi),%xmm6
movss  0x4(%rsi),%xmm1
movss  0x8(%rsi),%xmm4
movaps %xmm10,%xmm0
mulss  %xmm4,%xmm0
movaps %xmm9,%xmm3
mulss  %xmm1,%xmm3
mulss  %xmm12,%xmm1
subss  %xmm0,%xmm1
movaps %xmm12,%xmm0
mulss  %xmm6,%xmm0
mulss  %xmm9,%xmm4
subss  %xmm0,%xmm4
mulss  %xmm10,%xmm6
subss  %xmm3,%xmm6
movaps %xmm13,%xmm0
mulss  %xmm4,%xmm0
movaps %xmm14,%xmm2
mulss  %xmm1,%xmm2
addss  %xmm0,%xmm2
movaps %xmm5,%xmm3
mulss  %xmm6,%xmm3
addss  %xmm2,%xmm3
xorps  %xmm0,%xmm0
cvtss2sd %xmm3,%xmm0
xor    %eax,%eax
ucomisd 0xe41(%rip),%xmm0
jbe    11d0 <intersect_triangle+0xd0>
movsd  0xe3f(%rip),%xmm2
ucomisd %xmm0,%xmm2
jbe    11d0 <intersect_triangle+0xd0>
ret
mov    0x8(%rsp),%rcx
movss  0xe33(%rip),%xmm2
divss  %xmm3,%xmm2
movss  (%rdi),%xmm11
movss  0x4(%rdi),%xmm3
subss  %xmm8,%xmm11
subss  %xmm15,%xmm3
movss  0x8(%rdi),%xmm0
subss  %xmm7,%xmm0
mulss  %xmm3,%xmm4
mulss  %xmm11,%xmm1
addss  %xmm4,%xmm1
mulss  %xmm0,%xmm6
addss  %xmm1,%xmm6
mulss  %xmm2,%xmm6
movss  %xmm6,(%rcx)
xorps  %xmm1,%xmm1
ucomiss %xmm6,%xmm1
ja     11cf <intersect_triangle+0xcf>
ucomiss 0xde6(%rip),%xmm6
ja     11cf <intersect_triangle+0xcf>
movaps %xmm2,%xmm4
mov    0x10(%rsp),%rdx
movaps %xmm13,%xmm2
mulss  %xmm0,%xmm2
movaps %xmm3,%xmm1
mulss  %xmm5,%xmm1
subss  %xmm2,%xmm1
mulss  %xmm11,%xmm5
mulss  %xmm14,%xmm0
subss  %xmm5,%xmm0
mulss  %xmm3,%xmm14
mulss  %xmm13,%xmm11
subss  %xmm14,%xmm11
movss  0x4(%rsi),%xmm2
mulss  %xmm0,%xmm2
movss  (%rsi),%xmm3
mulss  %xmm1,%xmm3
addss  %xmm2,%xmm3
movss  0x8(%rsi),%xmm2
mulss  %xmm11,%xmm2
addss  %xmm3,%xmm2
mulss  %xmm4,%xmm2
movss  %xmm2,(%rdx)
xorps  %xmm3,%xmm3
ucomiss %xmm2,%xmm3
ja     11cf <intersect_triangle+0xcf>
addss  (%rcx),%xmm2
ucomiss 0xd6a(%rip),%xmm2
ja     11cf <intersect_triangle+0xcf>
mulss  %xmm0,%xmm10
mulss  %xmm1,%xmm9
addss  %xmm10,%xmm9
mulss  %xmm11,%xmm12
addss  %xmm9,%xmm12
mulss  %xmm12,%xmm4
movss  %xmm4,(%r9)
mov    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @intersect_triangle(float* %0, float* %1, float* %2, float* %3, float* %4, float* %5, float* %6, float* %7) {
%9 = alloca i32
%10 = alloca float*
%11 = alloca float*
%12 = alloca float*
%13 = alloca float*
%14 = alloca float*
%15 = alloca float*
%16 = alloca float*
%17 = alloca float*
%18 = alloca [3 x float]
%19 = alloca [3 x float]
%20 = alloca [3 x float]
%21 = alloca [3 x float]
%22 = alloca [3 x float]
%23 = alloca float
%24 = alloca float
store float* %0, float** %10
store float* %1, float** %11
store float* %2, float** %12
store float* %3, float** %13
store float* %4, float** %14
store float* %5, float** %15
store float* %6, float** %16
store float* %7, float** %17
%25 = load float*, float** %13
%26 = getelementptr inbounds float, float* %25, i64 0
%27 = load float, float* %26
%28 = load float*, float** %12
%29 = getelementptr inbounds float, float* %28, i64 0
%30 = load float, float* %29
%31 = fsub float %27, %30
%32 = getelementptr inbounds [3 x float], [3 x float]* %18, i64 0, i64 0
store float %31, float* %32
%33 = load float*, float** %13
%34 = getelementptr inbounds float, float* %33, i64 1
%35 = load float, float* %34
%36 = load float*, float** %12
%37 = getelementptr inbounds float, float* %36, i64 1
%38 = load float, float* %37
%39 = fsub float %35, %38
%40 = getelementptr inbounds [3 x float], [3 x float]* %18, i64 0, i64 1
store float %39, float* %40
%41 = load float*, float** %13
%42 = getelementptr inbounds float, float* %41, i64 2
%43 = load float, float* %42
%44 = load float*, float** %12
%45 = getelementptr inbounds float, float* %44, i64 2
%46 = load float, float* %45
%47 = fsub float %43, %46
%48 = getelementptr inbounds [3 x float], [3 x float]* %18, i64 0, i64 2
store float %47, float* %48
%49 = load float*, float** %14
%50 = getelementptr inbounds float, float* %49, i64 0
%51 = load float, float* %50
%52 = load float*, float** %12
%53 = getelementptr inbounds float, float* %52, i64 0
%54 = load float, float* %53
%55 = fsub float %51, %54
%56 = getelementptr inbounds [3 x float], [3 x float]* %19, i64 0, i64 0
store float %55, float* %56
%57 = load float*, float** %14
%58 = getelementptr inbounds float, float* %57, i64 1
%59 = load float, float* %58
%60 = load float*, float** %12
%61 = getelementptr inbounds float, float* %60, i64 1
%62 = load float, float* %61
%63 = fsub float %59, %62
%64 = getelementptr inbounds [3 x float], [3 x float]* %19, i64 0, i64 1
store float %63, float* %64
%65 = load float*, float** %14
%66 = getelementptr inbounds float, float* %65, i64 2
%67 = load float, float* %66
%68 = load float*, float** %12
%69 = getelementptr inbounds float, float* %68, i64 2
%70 = load float, float* %69
%71 = fsub float %67, %70
%72 = getelementptr inbounds [3 x float], [3 x float]* %19, i64 0, i64 2
store float %71, float* %72
%73 = load float*, float** %11
%74 = getelementptr inbounds float, float* %73, i64 1
%75 = load float, float* %74
%76 = getelementptr inbounds [3 x float], [3 x float]* %19, i64 0, i64 2
%77 = load float, float* %76
%78 = load float*, float** %11
%79 = getelementptr inbounds float, float* %78, i64 2
%80 = load float, float* %79
%81 = getelementptr inbounds [3 x float], [3 x float]* %19, i64 0, i64 1
%82 = load float, float* %81
%83 = fmul float %80, %82
%84 = fneg float %83
%85 = call float @llvm.fmuladd.f32(float %75, float %77, float %84)
%86 = getelementptr inbounds [3 x float], [3 x float]* %21, i64 0, i64 0
store float %85, float* %86
%87 = load float*, float** %11
%88 = getelementptr inbounds float, float* %87, i64 2
%89 = load float, float* %88
%90 = getelementptr inbounds [3 x float], [3 x float]* %19, i64 0, i64 0
%91 = load float, float* %90
%92 = load float*, float** %11
%93 = getelementptr inbounds float, float* %92, i64 0
%94 = load float, float* %93
%95 = getelementptr inbounds [3 x float], [3 x float]* %19, i64 0, i64 2
%96 = load float, float* %95
%97 = fmul float %94, %96
%98 = fneg float %97
%99 = call float @llvm.fmuladd.f32(float %89, float %91, float %98)
%100 = getelementptr inbounds [3 x float], [3 x float]* %21, i64 0, i64 1
store float %99, float* %100
%101 = load float*, float** %11
%102 = getelementptr inbounds float, float* %101, i64 0
%103 = load float, float* %102
%104 = getelementptr inbounds [3 x float], [3 x float]* %19, i64 0, i64 1
%105 = load float, float* %104
%106 = load float*, float** %11
%107 = getelementptr inbounds float, float* %106, i64 1
%108 = load float, float* %107
%109 = getelementptr inbounds [3 x float], [3 x float]* %19, i64 0, i64 0
%110 = load float, float* %109
%111 = fmul float %108, %110
%112 = fneg float %111
%113 = call float @llvm.fmuladd.f32(float %103, float %105, float %112)
%114 = getelementptr inbounds [3 x float], [3 x float]* %21, i64 0, i64 2
store float %113, float* %114
%115 = getelementptr inbounds [3 x float], [3 x float]* %18, i64 0, i64 0
%116 = load float, float* %115
%117 = getelementptr inbounds [3 x float], [3 x float]* %21, i64 0, i64 0
%118 = load float, float* %117
%119 = getelementptr inbounds [3 x float], [3 x float]* %18, i64 0, i64 1
%120 = load float, float* %119
%121 = getelementptr inbounds [3 x float], [3 x float]* %21, i64 0, i64 1
%122 = load float, float* %121
%123 = fmul float %120, %122
%124 = call float @llvm.fmuladd.f32(float %116, float %118, float %123)
%125 = getelementptr inbounds [3 x float], [3 x float]* %18, i64 0, i64 2
%126 = load float, float* %125
%127 = getelementptr inbounds [3 x float], [3 x float]* %21, i64 0, i64 2
%128 = load float, float* %127
%129 = call float @llvm.fmuladd.f32(float %126, float %128, float %124)
store float %129, float* %23
%130 = load float, float* %23
%131 = fpext float %130 to double
%132 = fcmp ogt double %131, 0xBEB0C6F7A0B5ED8D
br i1 %132, label %133, label %138
133: ; preds = %8
%134 = load float, float* %23
%135 = fpext float %134 to double
%136 = fcmp olt double %135, 0x3EB0C6F7A0B5ED8D
br i1 %136, label %137, label %138
137: ; preds = %133
store i32 0, i32* %9
br label %283
138: ; preds = %133, %8
%139 = load float, float* %23
%140 = fdiv float 1.000000e+00, %139
store float %140, float* %24
%141 = load float*, float** %10
%142 = getelementptr inbounds float, float* %141, i64 0
%143 = load float, float* %142
%144 = load float*, float** %12
%145 = getelementptr inbounds float, float* %144, i64 0
%146 = load float, float* %145
%147 = fsub float %143, %146
%148 = getelementptr inbounds [3 x float], [3 x float]* %20, i64 0, i64 0
store float %147, float* %148
%149 = load float*, float** %10
%150 = getelementptr inbounds float, float* %149, i64 1
%151 = load float, float* %150
%152 = load float*, float** %12
%153 = getelementptr inbounds float, float* %152, i64 1
%154 = load float, float* %153
%155 = fsub float %151, %154
%156 = getelementptr inbounds [3 x float], [3 x float]* %20, i64 0, i64 1
store float %155, float* %156
%157 = load float*, float** %10
%158 = getelementptr inbounds float, float* %157, i64 2
%159 = load float, float* %158
%160 = load float*, float** %12
%161 = getelementptr inbounds float, float* %160, i64 2
%162 = load float, float* %161
%163 = fsub float %159, %162
%164 = getelementptr inbounds [3 x float], [3 x float]* %20, i64 0, i64 2
store float %163, float* %164
%165 = getelementptr inbounds [3 x float], [3 x float]* %20, i64 0, i64 0
%166 = load float, float* %165
%167 = getelementptr inbounds [3 x float], [3 x float]* %21, i64 0, i64 0
%168 = load float, float* %167
%169 = getelementptr inbounds [3 x float], [3 x float]* %20, i64 0, i64 1
%170 = load float, float* %169
%171 = getelementptr inbounds [3 x float], [3 x float]* %21, i64 0, i64 1
%172 = load float, float* %171
%173 = fmul float %170, %172
%174 = call float @llvm.fmuladd.f32(float %166, float %168, float %173)
%175 = getelementptr inbounds [3 x float], [3 x float]* %20, i64 0, i64 2
%176 = load float, float* %175
%177 = getelementptr inbounds [3 x float], [3 x float]* %21, i64 0, i64 2
%178 = load float, float* %177
%179 = call float @llvm.fmuladd.f32(float %176, float %178, float %174)
%180 = load float, float* %24
%181 = fmul float %179, %180
%182 = load float*, float** %16
store float %181, float* %182
%183 = load float*, float** %16
%184 = load float, float* %183
%185 = fpext float %184 to double
%186 = fcmp olt double %185, 0.000000e+00
br i1 %186, label %192, label %187
187: ; preds = %138
%188 = load float*, float** %16
%189 = load float, float* %188
%190 = fpext float %189 to double
%191 = fcmp ogt double %190, 1.000000e+00
br i1 %191, label %192, label %193
192: ; preds = %187, %138
store i32 0, i32* %9
br label %283
193: ; preds = %187
%194 = getelementptr inbounds [3 x float], [3 x float]* %20, i64 0, i64 1
%195 = load float, float* %194
%196 = getelementptr inbounds [3 x float], [3 x float]* %18, i64 0, i64 2
%197 = load float, float* %196
%198 = getelementptr inbounds [3 x float], [3 x float]* %20, i64 0, i64 2
%199 = load float, float* %198
%200 = getelementptr inbounds [3 x float], [3 x float]* %18, i64 0, i64 1
%201 = load float, float* %200
%202 = fmul float %199, %201
%203 = fneg float %202
%204 = call float @llvm.fmuladd.f32(float %195, float %197, float %203)
%205 = getelementptr inbounds [3 x float], [3 x float]* %22, i64 0, i64 0
store float %204, float* %205
%206 = getelementptr inbounds [3 x float], [3 x float]* %20, i64 0, i64 2
%207 = load float, float* %206
%208 = getelementptr inbounds [3 x float], [3 x float]* %18, i64 0, i64 0
%209 = load float, float* %208
%210 = getelementptr inbounds [3 x float], [3 x float]* %20, i64 0, i64 0
%211 = load float, float* %210
%212 = getelementptr inbounds [3 x float], [3 x float]* %18, i64 0, i64 2
%213 = load float, float* %212
%214 = fmul float %211, %213
%215 = fneg float %214
%216 = call float @llvm.fmuladd.f32(float %207, float %209, float %215)
%217 = getelementptr inbounds [3 x float], [3 x float]* %22, i64 0, i64 1
store float %216, float* %217
%218 = getelementptr inbounds [3 x float], [3 x float]* %20, i64 0, i64 0
%219 = load float, float* %218
%220 = getelementptr inbounds [3 x float], [3 x float]* %18, i64 0, i64 1
%221 = load float, float* %220
%222 = getelementptr inbounds [3 x float], [3 x float]* %20, i64 0, i64 1
%223 = load float, float* %222
%224 = getelementptr inbounds [3 x float], [3 x float]* %18, i64 0, i64 0
%225 = load float, float* %224
%226 = fmul float %223, %225
%227 = fneg float %226
%228 = call float @llvm.fmuladd.f32(float %219, float %221, float %227)
%229 = getelementptr inbounds [3 x float], [3 x float]* %22, i64 0, i64 2
store float %228, float* %229
%230 = load float*, float** %11
%231 = getelementptr inbounds float, float* %230, i64 0
%232 = load float, float* %231
%233 = getelementptr inbounds [3 x float], [3 x float]* %22, i64 0, i64 0
%234 = load float, float* %233
%235 = load float*, float** %11
%236 = getelementptr inbounds float, float* %235, i64 1
%237 = load float, float* %236
%238 = getelementptr inbounds [3 x float], [3 x float]* %22, i64 0, i64 1
%239 = load float, float* %238
%240 = fmul float %237, %239
%241 = call float @llvm.fmuladd.f32(float %232, float %234, float %240)
%242 = load float*, float** %11
%243 = getelementptr inbounds float, float* %242, i64 2
%244 = load float, float* %243
%245 = getelementptr inbounds [3 x float], [3 x float]* %22, i64 0, i64 2
%246 = load float, float* %245
%247 = call float @llvm.fmuladd.f32(float %244, float %246, float %241)
%248 = load float, float* %24
%249 = fmul float %247, %248
%250 = load float*, float** %17
store float %249, float* %250
%251 = load float*, float** %17
%252 = load float, float* %251
%253 = fpext float %252 to double
%254 = fcmp olt double %253, 0.000000e+00
br i1 %254, label %263, label %255
255: ; preds = %193
%256 = load float*, float** %16
%257 = load float, float* %256
%258 = load float*, float** %17
%259 = load float, float* %258
%260 = fadd float %257, %259
%261 = fpext float %260 to double
%262 = fcmp ogt double %261, 1.000000e+00
br i1 %262, label %263, label %264
263: ; preds = %255, %193
store i32 0, i32* %9
br label %283
264: ; preds = %255
%265 = getelementptr inbounds [3 x float], [3 x float]* %19, i64 0, i64 0
%266 = load float, float* %265
%267 = getelementptr inbounds [3 x float], [3 x float]* %22, i64 0, i64 0
%268 = load float, float* %267
%269 = getelementptr inbounds [3 x float], [3 x float]* %19, i64 0, i64 1
%270 = load float, float* %269
%271 = getelementptr inbounds [3 x float], [3 x float]* %22, i64 0, i64 1
%272 = load float, float* %271
%273 = fmul float %270, %272
%274 = call float @llvm.fmuladd.f32(float %266, float %268, float %273)
%275 = getelementptr inbounds [3 x float], [3 x float]* %19, i64 0, i64 2
%276 = load float, float* %275
%277 = getelementptr inbounds [3 x float], [3 x float]* %22, i64 0, i64 2
%278 = load float, float* %277
%279 = call float @llvm.fmuladd.f32(float %276, float %278, float %274)
%280 = load float, float* %24
%281 = fmul float %279, %280
%282 = load float*, float** %15
store float %281, float* %282
store i32 1, i32* %9
br label %283
283: ; preds = %264, %263, %192, %137
%284 = load i32, i32* %9
ret i32 %284
}

LLVM IR (-O2):
define i32 @intersect_triangle(float* nocapture %0, float* nocapture %1, float* nocapture %2, float* nocapture %3, float* nocapture %4, float* nocapture writeonly %5, float* nocapture %6, float* nocapture writeonly %7) {
%9 = load float, float* %3
%10 = load float, float* %2
%11 = fsub float %9, %10
%12 = getelementptr inbounds float, float* %3, i64 1
%13 = load float, float* %12
%14 = getelementptr inbounds float, float* %2, i64 1
%15 = load float, float* %14
%16 = fsub float %13, %15
%17 = getelementptr inbounds float, float* %3, i64 2
%18 = load float, float* %17
%19 = getelementptr inbounds float, float* %2, i64 2
%20 = load float, float* %19
%21 = fsub float %18, %20
%22 = load float, float* %4
%23 = fsub float %22, %10
%24 = getelementptr inbounds float, float* %4, i64 1
%25 = load float, float* %24
%26 = fsub float %25, %15
%27 = getelementptr inbounds float, float* %4, i64 2
%28 = load float, float* %27
%29 = fsub float %28, %20
%30 = getelementptr inbounds float, float* %1, i64 1
%31 = load float, float* %30
%32 = getelementptr inbounds float, float* %1, i64 2
%33 = load float, float* %32
%34 = fneg float %33
%35 = fmul float %26, %34
%36 = tail call float @llvm.fmuladd.f32(float %31, float %29, float %35)
%37 = load float, float* %1
%38 = fneg float %37
%39 = fmul float %29, %38
%40 = tail call float @llvm.fmuladd.f32(float %33, float %23, float %39)
%41 = fneg float %31
%42 = fmul float %23, %41
%43 = tail call float @llvm.fmuladd.f32(float %37, float %26, float %42)
%44 = fmul float %16, %40
%45 = tail call float @llvm.fmuladd.f32(float %11, float %36, float %44)
%46 = tail call float @llvm.fmuladd.f32(float %21, float %43, float %45)
%47 = fpext float %46 to double
%48 = fcmp ogt double %47, 0xBEB0C6F7A0B5ED8D
%49 = fcmp olt double %47, 0x3EB0C6F7A0B5ED8D
%50 = and i1 %48, %49
br i1 %50, label %95, label %51
51: ; preds = %8
%52 = fdiv float 1.000000e+00, %46
%53 = load float, float* %0
%54 = fsub float %53, %10
%55 = getelementptr inbounds float, float* %0, i64 1
%56 = load float, float* %55
%57 = fsub float %56, %15
%58 = getelementptr inbounds float, float* %0, i64 2
%59 = load float, float* %58
%60 = fsub float %59, %20
%61 = fmul float %40, %57
%62 = tail call float @llvm.fmuladd.f32(float %54, float %36, float %61)
%63 = tail call float @llvm.fmuladd.f32(float %60, float %43, float %62)
%64 = fmul float %52, %63
store float %64, float* %6
%65 = fcmp olt float %64, 0.000000e+00
%66 = fcmp ogt float %64, 1.000000e+00
%67 = or i1 %65, %66
br i1 %67, label %95, label %68
68: ; preds = %51
%69 = fneg float %60
%70 = fmul float %16, %69
%71 = tail call float @llvm.fmuladd.f32(float %57, float %21, float %70)
%72 = fneg float %54
%73 = fmul float %21, %72
%74 = tail call float @llvm.fmuladd.f32(float %60, float %11, float %73)
%75 = fneg float %57
%76 = fmul float %11, %75
%77 = tail call float @llvm.fmuladd.f32(float %54, float %16, float %76)
%78 = load float, float* %1
%79 = load float, float* %30
%80 = fmul float %74, %79
%81 = tail call float @llvm.fmuladd.f32(float %78, float %71, float %80)
%82 = load float, float* %32
%83 = tail call float @llvm.fmuladd.f32(float %82, float %77, float %81)
%84 = fmul float %52, %83
store float %84, float* %7
%85 = fcmp olt float %84, 0.000000e+00
br i1 %85, label %95, label %86
86: ; preds = %68
%87 = load float, float* %6
%88 = fadd float %84, %87
%89 = fcmp ogt float %88, 1.000000e+00
br i1 %89, label %95, label %90
90: ; preds = %86
%91 = fmul float %26, %74
%92 = tail call float @llvm.fmuladd.f32(float %23, float %71, float %91)
%93 = tail call float @llvm.fmuladd.f32(float %29, float %77, float %92)
%94 = fmul float %52, %93
store float %94, float* %5
br label %95
95: ; preds = %68, %86, %51, %8, %90
%96 = phi i32 [ 1, %90 ], [ 0, %8 ], [ 0, %51 ], [ 0, %86 ], [ 0, %68 ]
ret i32 %96
}