#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
int /*<<< orphan*/ CrossProduct(float const *, float const *, float *);
float VectorMagnitude(float const *);
float fabsf(float);
uint8_t RotFrom2Vectors(const float v1b[3], const float v1e[3],
                        const float v2b[3], const float v2e[3],
                        float Rbe[3][3]) {
  float Rib[3][3], Rie[3][3];
  float mag;
  uint8_t i, j, k;
  for (i = 0; i < 3; i++) {
    for (j = 0; j < 3; j++)
      Rbe[i][j] = 0;
    Rbe[i][i] = 1;
  }
  mag = VectorMagnitude(v1b);
  if (fabsf(mag) < 1e-30f)
    return (-1);
  for (i = 0; i < 3; i++)
    Rib[0][i] = v1b[i] / mag;
  mag = VectorMagnitude(v1e);
  if (fabsf(mag) < 1e-30f)
    return (-1);
  for (i = 0; i < 3; i++)
    Rie[0][i] = v1e[i] / mag;
  CrossProduct(v1b, v2b, &Rib[1][0]);
  mag = VectorMagnitude(&Rib[1][0]);
  if (fabsf(mag) < 1e-30f)
    return (-1);
  for (i = 0; i < 3; i++)
    Rib[1][i] = Rib[1][i] / mag;
  CrossProduct(v1e, v2e, &Rie[1][0]);
  mag = VectorMagnitude(&Rie[1][0]);
  if (fabsf(mag) < 1e-30f)
    return (-1);
  for (i = 0; i < 3; i++)
    Rie[1][i] = Rie[1][i] / mag;
  CrossProduct(&Rib[0][0], &Rib[1][0], &Rib[2][0]);
  CrossProduct(&Rie[0][0], &Rie[1][0], &Rie[2][0]);
  for (i = 0; i < 3; i++)
    for (j = 0; j < 3; j++) {
      Rbe[i][j] = 0;
      for (k = 0; k < 3; k++)
        Rbe[i][j] += Rib[k][i] * Rie[k][j];
    }
  return 1;
}


x86 assembly (clang, -O0):
<RotFrom2Vectors>:
push   %rbp
mov    %rsp,%rbp
sub    $0xa0,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
mov    %r8,-0x30(%rbp)
movl   $0x0,-0x98(%rbp)
cmpl   $0x3,-0x98(%rbp)
jge    11dc <RotFrom2Vectors+0xbc>
movl   $0x0,-0x9c(%rbp)
cmpl   $0x3,-0x9c(%rbp)
jge    11a2 <RotFrom2Vectors+0x82>
mov    -0x30(%rbp),%rax
movslq -0x98(%rbp),%rcx
imul   $0xc,%rcx,%rcx
add    %rcx,%rax
movslq -0x9c(%rbp),%rcx
xorps  %xmm0,%xmm0
movss  %xmm0,(%rax,%rcx,4)
mov    -0x9c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x9c(%rbp)
jmp    1160 <RotFrom2Vectors+0x40>
mov    -0x30(%rbp),%rax
movslq -0x98(%rbp),%rcx
imul   $0xc,%rcx,%rcx
add    %rcx,%rax
movslq -0x98(%rbp),%rcx
movss  0xe41(%rip),%xmm0
movss  %xmm0,(%rax,%rcx,4)
mov    -0x98(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x98(%rbp)
jmp    1149 <RotFrom2Vectors+0x29>
mov    -0x10(%rbp),%rdi
call   1040 <VectorMagnitude@plt>
movss  %xmm0,-0x94(%rbp)
ff
movss  -0x94(%rbp),%xmm1
ff
movaps 0xe14(%rip),%xmm0
pand   %xmm0,%xmm1
movss  0xdf8(%rip),%xmm0
ucomiss %xmm1,%xmm0
jbe    121d <RotFrom2Vectors+0xfd>
movl   $0xffffffff,-0x4(%rbp)
jmp    15b3 <RotFrom2Vectors+0x493>
movl   $0x0,-0x98(%rbp)
cmpl   $0x3,-0x98(%rbp)
jge    126d <RotFrom2Vectors+0x14d>
mov    -0x10(%rbp),%rax
movslq -0x98(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm0
divss  -0x94(%rbp),%xmm0
ff
movslq -0x98(%rbp),%rax
movss  %xmm0,-0x60(%rbp,%rax,4)
mov    -0x98(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x98(%rbp)
jmp    1227 <RotFrom2Vectors+0x107>
mov    -0x18(%rbp),%rdi
call   1040 <VectorMagnitude@plt>
movss  %xmm0,-0x94(%rbp)
ff
movss  -0x94(%rbp),%xmm1
ff
movaps 0xd83(%rip),%xmm0
pand   %xmm0,%xmm1
movss  0xd67(%rip),%xmm0
ucomiss %xmm1,%xmm0
jbe    12ae <RotFrom2Vectors+0x18e>
movl   $0xffffffff,-0x4(%rbp)
jmp    15b3 <RotFrom2Vectors+0x493>
movl   $0x0,-0x98(%rbp)
cmpl   $0x3,-0x98(%rbp)
jge    1301 <RotFrom2Vectors+0x1e1>
mov    -0x18(%rbp),%rax
movslq -0x98(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm0
divss  -0x94(%rbp),%xmm0
ff
movslq -0x98(%rbp),%rax
movss  %xmm0,-0x90(%rbp,%rax,4)
ff ff
mov    -0x98(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x98(%rbp)
jmp    12b8 <RotFrom2Vectors+0x198>
mov    -0x10(%rbp),%rdi
mov    -0x20(%rbp),%rsi
lea    -0x60(%rbp),%rdx
add    $0xc,%rdx
call   1030 <CrossProduct@plt>
lea    -0x60(%rbp),%rdi
add    $0xc,%rdi
call   1040 <VectorMagnitude@plt>
movss  %xmm0,-0x94(%rbp)
ff
movss  -0x94(%rbp),%xmm1
ff
movaps 0xcd6(%rip),%xmm0
pand   %xmm0,%xmm1
movss  0xcba(%rip),%xmm0
ucomiss %xmm1,%xmm0
jbe    135b <RotFrom2Vectors+0x23b>
movl   $0xffffffff,-0x4(%rbp)
jmp    15b3 <RotFrom2Vectors+0x493>
movl   $0x0,-0x98(%rbp)
cmpl   $0x3,-0x98(%rbp)
jge    13a8 <RotFrom2Vectors+0x288>
movslq -0x98(%rbp),%rax
movss  -0x54(%rbp,%rax,4),%xmm0
divss  -0x94(%rbp),%xmm0
ff
movslq -0x98(%rbp),%rax
movss  %xmm0,-0x54(%rbp,%rax,4)
mov    -0x98(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x98(%rbp)
jmp    1365 <RotFrom2Vectors+0x245>
mov    -0x18(%rbp),%rdi
mov    -0x28(%rbp),%rsi
lea    -0x90(%rbp),%rdx
add    $0xc,%rdx
call   1030 <CrossProduct@plt>
lea    -0x90(%rbp),%rdi
add    $0xc,%rdi
call   1040 <VectorMagnitude@plt>
movss  %xmm0,-0x94(%rbp)
ff
movss  -0x94(%rbp),%xmm1
ff
movaps 0xc29(%rip),%xmm0
pand   %xmm0,%xmm1
movss  0xc0d(%rip),%xmm0
ucomiss %xmm1,%xmm0
jbe    1408 <RotFrom2Vectors+0x2e8>
movl   $0xffffffff,-0x4(%rbp)
jmp    15b3 <RotFrom2Vectors+0x493>
movl   $0x0,-0x98(%rbp)
cmpl   $0x3,-0x98(%rbp)
jge    145b <RotFrom2Vectors+0x33b>
movslq -0x98(%rbp),%rax
movss  -0x84(%rbp,%rax,4),%xmm0
ff ff
divss  -0x94(%rbp),%xmm0
ff
movslq -0x98(%rbp),%rax
movss  %xmm0,-0x84(%rbp,%rax,4)
ff ff
mov    -0x98(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x98(%rbp)
jmp    1412 <RotFrom2Vectors+0x2f2>
lea    -0x60(%rbp),%rdi
lea    -0x60(%rbp),%rsi
add    $0xc,%rsi
lea    -0x60(%rbp),%rdx
add    $0x18,%rdx
call   1030 <CrossProduct@plt>
lea    -0x90(%rbp),%rdi
lea    -0x90(%rbp),%rsi
add    $0xc,%rsi
lea    -0x90(%rbp),%rdx
add    $0x18,%rdx
call   1030 <CrossProduct@plt>
movl   $0x0,-0x98(%rbp)
cmpl   $0x3,-0x98(%rbp)
jge    15ac <RotFrom2Vectors+0x48c>
movl   $0x0,-0x9c(%rbp)
cmpl   $0x3,-0x9c(%rbp)
jge    1593 <RotFrom2Vectors+0x473>
mov    -0x30(%rbp),%rax
movslq -0x98(%rbp),%rcx
imul   $0xc,%rcx,%rcx
add    %rcx,%rax
movslq -0x9c(%rbp),%rcx
xorps  %xmm0,%xmm0
movss  %xmm0,(%rax,%rcx,4)
movl   $0x0,-0xa0(%rbp)
cmpl   $0x3,-0xa0(%rbp)
jge    157a <RotFrom2Vectors+0x45a>
movslq -0xa0(%rbp),%rcx
lea    -0x60(%rbp),%rax
imul   $0xc,%rcx,%rcx
add    %rcx,%rax
movslq -0x98(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm0
movslq -0xa0(%rbp),%rcx
lea    -0x90(%rbp),%rax
imul   $0xc,%rcx,%rcx
add    %rcx,%rax
movslq -0x9c(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm2
mov    -0x30(%rbp),%rax
movslq -0x98(%rbp),%rcx
imul   $0xc,%rcx,%rcx
add    %rcx,%rax
movslq -0x9c(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
movss  %xmm0,(%rax,%rcx,4)
mov    -0xa0(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xa0(%rbp)
jmp    14ef <RotFrom2Vectors+0x3cf>
jmp    157f <RotFrom2Vectors+0x45f>
mov    -0x9c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x9c(%rbp)
jmp    14b7 <RotFrom2Vectors+0x397>
jmp    1598 <RotFrom2Vectors+0x478>
mov    -0x98(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x98(%rbp)
jmp    14a0 <RotFrom2Vectors+0x380>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0xa0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<RotFrom2Vectors>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x58,%rsp
mov    %r8,%rbx
mov    %rcx,%r14
mov    %rdx,%r13
mov    %rsi,%rbp
mov    %rdi,%r12
xorps  %xmm0,%xmm0
movups %xmm0,0x4(%r8)
movl   $0x3f800000,(%r8)
movl   $0x0,0x14(%r8)
movl   $0x3f800000,0x10(%r8)
3f
movq   $0x0,0x18(%r8)
movl   $0x3f800000,0x20(%r8)
3f
call   1040 <VectorMagnitude@plt>
movaps 0xe88(%rip),%xmm1
andps  %xmm0,%xmm1
mov    $0xffffffff,%r15d
movss  0xe87(%rip),%xmm2
ucomiss %xmm1,%xmm2
ja     14c5 <RotFrom2Vectors+0x3a5>
movss  (%r12),%xmm1
divss  %xmm0,%xmm1
movss  %xmm1,0x30(%rsp)
movss  0x4(%r12),%xmm1
divss  %xmm0,%xmm1
movss  %xmm1,0x34(%rsp)
movss  0x8(%r12),%xmm1
divss  %xmm0,%xmm1
movss  %xmm1,0x38(%rsp)
mov    %rbp,%rdi
call   1040 <VectorMagnitude@plt>
movaps 0xe2d(%rip),%xmm1
andps  %xmm0,%xmm1
movss  0xe32(%rip),%xmm2
ucomiss %xmm1,%xmm2
ja     14c5 <RotFrom2Vectors+0x3a5>
movss  0x0(%rbp),%xmm1
divss  %xmm0,%xmm1
movss  %xmm1,(%rsp)
movss  0x4(%rbp),%xmm1
divss  %xmm0,%xmm1
movss  %xmm1,0x4(%rsp)
movss  0x8(%rbp),%xmm1
divss  %xmm0,%xmm1
movss  %xmm1,0x8(%rsp)
lea    0x3c(%rsp),%rax
mov    %r12,%rdi
mov    %r13,%rsi
mov    %rax,%r13
mov    %rax,%rdx
call   1030 <CrossProduct@plt>
mov    %r13,%rdi
call   1040 <VectorMagnitude@plt>
movss  0xdd7(%rip),%xmm2
movaps 0xdc0(%rip),%xmm1
andps  %xmm0,%xmm1
ucomiss %xmm1,%xmm2
ja     14c5 <RotFrom2Vectors+0x3a5>
movss  0x3c(%rsp),%xmm1
movss  0x40(%rsp),%xmm2
divss  %xmm0,%xmm1
movss  %xmm1,0x3c(%rsp)
divss  %xmm0,%xmm2
movss  %xmm2,0x40(%rsp)
movss  0x44(%rsp),%xmm1
divss  %xmm0,%xmm1
movss  %xmm1,0x44(%rsp)
lea    0xc(%rsp),%r12
mov    %rbp,%rdi
mov    %r14,%rsi
mov    %r12,%rdx
call   1030 <CrossProduct@plt>
mov    %r12,%rdi
call   1040 <VectorMagnitude@plt>
movaps 0xd62(%rip),%xmm1
andps  %xmm0,%xmm1
movss  0xd67(%rip),%xmm2
ucomiss %xmm1,%xmm2
ja     14c5 <RotFrom2Vectors+0x3a5>
movss  0xc(%rsp),%xmm1
movss  0x10(%rsp),%xmm2
divss  %xmm0,%xmm1
movss  %xmm1,0xc(%rsp)
divss  %xmm0,%xmm2
movss  %xmm2,0x10(%rsp)
movss  0x14(%rsp),%xmm1
divss  %xmm0,%xmm1
movss  %xmm1,0x14(%rsp)
lea    0x48(%rsp),%rdx
lea    0x30(%rsp),%rdi
mov    %r13,%rsi
call   1030 <CrossProduct@plt>
lea    0x18(%rsp),%rdx
mov    %rsp,%rdi
mov    %r12,%rsi
call   1030 <CrossProduct@plt>
movss  0xc(%rsp),%xmm7
movss  0x18(%rsp),%xmm0
movss  (%rsp),%xmm1
movss  0x4(%rsp),%xmm14
movss  0x10(%rsp),%xmm12
movss  0x1c(%rsp),%xmm13
movss  0x8(%rsp),%xmm10
movss  0x14(%rsp),%xmm9
movss  0x20(%rsp),%xmm8
movss  0x30(%rsp),%xmm3
movss  0x3c(%rsp),%xmm4
movaps %xmm3,%xmm6
mulss  %xmm1,%xmm6
xorps  %xmm11,%xmm11
addss  %xmm11,%xmm6
movaps %xmm4,%xmm2
mulss  %xmm7,%xmm2
addss  %xmm6,%xmm2
movss  0x48(%rsp),%xmm5
movaps %xmm5,%xmm6
mulss  %xmm0,%xmm6
addss  %xmm2,%xmm6
movss  %xmm6,(%rbx)
movaps %xmm3,%xmm2
mulss  %xmm14,%xmm2
addss  %xmm11,%xmm2
movaps %xmm4,%xmm6
mulss  %xmm12,%xmm6
addss  %xmm2,%xmm6
movaps %xmm5,%xmm2
mulss  %xmm13,%xmm2
addss  %xmm6,%xmm2
movss  %xmm2,0x4(%rbx)
mulss  %xmm10,%xmm3
addss  %xmm11,%xmm3
mulss  %xmm9,%xmm4
addss  %xmm3,%xmm4
mulss  %xmm8,%xmm5
addss  %xmm4,%xmm5
movss  %xmm5,0x8(%rbx)
movss  0x34(%rsp),%xmm6
movss  0x40(%rsp),%xmm2
movaps %xmm6,%xmm3
mulss  %xmm1,%xmm3
addss  %xmm11,%xmm3
movaps %xmm2,%xmm4
mulss  %xmm7,%xmm4
addss  %xmm3,%xmm4
movss  0x4c(%rsp),%xmm3
movaps %xmm3,%xmm5
mulss  %xmm0,%xmm5
addss  %xmm4,%xmm5
movss  %xmm5,0xc(%rbx)
movaps %xmm6,%xmm4
mulss  %xmm14,%xmm4
addss  %xmm11,%xmm4
movaps %xmm2,%xmm5
mulss  %xmm12,%xmm5
addss  %xmm4,%xmm5
movaps %xmm3,%xmm4
mulss  %xmm13,%xmm4
addss  %xmm5,%xmm4
movss  %xmm4,0x10(%rbx)
mulss  %xmm10,%xmm6
addss  %xmm11,%xmm6
mulss  %xmm9,%xmm2
addss  %xmm6,%xmm2
mulss  %xmm8,%xmm3
addss  %xmm2,%xmm3
movss  %xmm3,0x14(%rbx)
movss  0x38(%rsp),%xmm6
movss  0x44(%rsp),%xmm2
mulss  %xmm6,%xmm1
addss  %xmm11,%xmm1
mulss  %xmm2,%xmm7
addss  %xmm1,%xmm7
movss  0x50(%rsp),%xmm1
mulss  %xmm1,%xmm0
addss  %xmm7,%xmm0
movss  %xmm0,0x18(%rbx)
mulss  %xmm6,%xmm14
addss  %xmm11,%xmm14
mulss  %xmm2,%xmm12
addss  %xmm14,%xmm12
mulss  %xmm1,%xmm13
addss  %xmm12,%xmm13
movss  %xmm13,0x1c(%rbx)
mulss  %xmm10,%xmm6
addss  %xmm11,%xmm6
mulss  %xmm9,%xmm2
addss  %xmm6,%xmm2
mulss  %xmm8,%xmm1
addss  %xmm2,%xmm1
movss  %xmm1,0x20(%rbx)
mov    $0x1,%r15d
mov    %r15d,%eax
add    $0x58,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i32 @RotFrom2Vectors(float* %0, float* %1, float* %2, float* %3, [3 x float]* %4) {
%6 = alloca i32
%7 = alloca float*
%8 = alloca float*
%9 = alloca float*
%10 = alloca float*
%11 = alloca [3 x float]*
%12 = alloca [3 x [3 x float]]
%13 = alloca [3 x [3 x float]]
%14 = alloca float
%15 = alloca i32
%16 = alloca i32
%17 = alloca i32
store float* %0, float** %7
store float* %1, float** %8
store float* %2, float** %9
store float* %3, float** %10
store [3 x float]* %4, [3 x float]** %11
store i32 0, i32* %15
br label %18
18: ; preds = %44, %5
%19 = load i32, i32* %15
%20 = icmp slt i32 %19, 3
br i1 %20, label %21, label %47
21: ; preds = %18
store i32 0, i32* %16
br label %22
22: ; preds = %33, %21
%23 = load i32, i32* %16
%24 = icmp slt i32 %23, 3
br i1 %24, label %25, label %36
25: ; preds = %22
%26 = load [3 x float]*, [3 x float]** %11
%27 = load i32, i32* %15
%28 = sext i32 %27 to i64
%29 = getelementptr inbounds [3 x float], [3 x float]* %26, i64 %28
%30 = load i32, i32* %16
%31 = sext i32 %30 to i64
%32 = getelementptr inbounds [3 x float], [3 x float]* %29, i64 0, i64 %31
store float 0.000000e+00, float* %32
br label %33
33: ; preds = %25
%34 = load i32, i32* %16
%35 = add nsw i32 %34, 1
store i32 %35, i32* %16
br label %22
36: ; preds = %22
%37 = load [3 x float]*, [3 x float]** %11
%38 = load i32, i32* %15
%39 = sext i32 %38 to i64
%40 = getelementptr inbounds [3 x float], [3 x float]* %37, i64 %39
%41 = load i32, i32* %15
%42 = sext i32 %41 to i64
%43 = getelementptr inbounds [3 x float], [3 x float]* %40, i64 0, i64 %42
store float 1.000000e+00, float* %43
br label %44
44: ; preds = %36
%45 = load i32, i32* %15
%46 = add nsw i32 %45, 1
store i32 %46, i32* %15
br label %18
47: ; preds = %18
%48 = load float*, float** %7
%49 = call float @VectorMagnitude(float* %48)
store float %49, float* %14
%50 = load float, float* %14
%51 = call float @llvm.fabs.f32(float %50)
%52 = fcmp olt float %51, 0x39B4484C00000000
br i1 %52, label %53, label %54
53: ; preds = %47
store i32 -1, i32* %6
br label %232
54: ; preds = %47
store i32 0, i32* %15
br label %55
55: ; preds = %70, %54
%56 = load i32, i32* %15
%57 = icmp slt i32 %56, 3
br i1 %57, label %58, label %73
58: ; preds = %55
%59 = load float*, float** %7
%60 = load i32, i32* %15
%61 = sext i32 %60 to i64
%62 = getelementptr inbounds float, float* %59, i64 %61
%63 = load float, float* %62
%64 = load float, float* %14
%65 = fdiv float %63, %64
%66 = getelementptr inbounds [3 x [3 x float]], [3 x [3 x float]]* %12, i64 0, i64 0
%67 = load i32, i32* %15
%68 = sext i32 %67 to i64
%69 = getelementptr inbounds [3 x float], [3 x float]* %66, i64 0, i64 %68
store float %65, float* %69
br label %70
70: ; preds = %58
%71 = load i32, i32* %15
%72 = add nsw i32 %71, 1
store i32 %72, i32* %15
br label %55
73: ; preds = %55
%74 = load float*, float** %8
%75 = call float @VectorMagnitude(float* %74)
store float %75, float* %14
%76 = load float, float* %14
%77 = call float @llvm.fabs.f32(float %76)
%78 = fcmp olt float %77, 0x39B4484C00000000
br i1 %78, label %79, label %80
79: ; preds = %73
store i32 -1, i32* %6
br label %232
80: ; preds = %73
store i32 0, i32* %15
br label %81
81: ; preds = %96, %80
%82 = load i32, i32* %15
%83 = icmp slt i32 %82, 3
br i1 %83, label %84, label %99
84: ; preds = %81
%85 = load float*, float** %8
%86 = load i32, i32* %15
%87 = sext i32 %86 to i64
%88 = getelementptr inbounds float, float* %85, i64 %87
%89 = load float, float* %88
%90 = load float, float* %14
%91 = fdiv float %89, %90
%92 = getelementptr inbounds [3 x [3 x float]], [3 x [3 x float]]* %13, i64 0, i64 0
%93 = load i32, i32* %15
%94 = sext i32 %93 to i64
%95 = getelementptr inbounds [3 x float], [3 x float]* %92, i64 0, i64 %94
store float %91, float* %95
br label %96
96: ; preds = %84
%97 = load i32, i32* %15
%98 = add nsw i32 %97, 1
store i32 %98, i32* %15
br label %81
99: ; preds = %81
%100 = load float*, float** %7
%101 = load float*, float** %9
%102 = getelementptr inbounds [3 x [3 x float]], [3 x [3 x float]]* %12, i64 0, i64 1
%103 = getelementptr inbounds [3 x float], [3 x float]* %102, i64 0, i64 0
%104 = call i32 @CrossProduct(float* %100, float* %101, float* %103)
%105 = getelementptr inbounds [3 x [3 x float]], [3 x [3 x float]]* %12, i64 0, i64 1
%106 = getelementptr inbounds [3 x float], [3 x float]* %105, i64 0, i64 0
%107 = call float @VectorMagnitude(float* %106)
store float %107, float* %14
%108 = load float, float* %14
%109 = call float @llvm.fabs.f32(float %108)
%110 = fcmp olt float %109, 0x39B4484C00000000
br i1 %110, label %111, label %112
111: ; preds = %99
store i32 -1, i32* %6
br label %232
112: ; preds = %99
store i32 0, i32* %15
br label %113
113: ; preds = %128, %112
%114 = load i32, i32* %15
%115 = icmp slt i32 %114, 3
br i1 %115, label %116, label %131
116: ; preds = %113
%117 = getelementptr inbounds [3 x [3 x float]], [3 x [3 x float]]* %12, i64 0, i64 1
%118 = load i32, i32* %15
%119 = sext i32 %118 to i64
%120 = getelementptr inbounds [3 x float], [3 x float]* %117, i64 0, i64 %119
%121 = load float, float* %120
%122 = load float, float* %14
%123 = fdiv float %121, %122
%124 = getelementptr inbounds [3 x [3 x float]], [3 x [3 x float]]* %12, i64 0, i64 1
%125 = load i32, i32* %15
%126 = sext i32 %125 to i64
%127 = getelementptr inbounds [3 x float], [3 x float]* %124, i64 0, i64 %126
store float %123, float* %127
br label %128
128: ; preds = %116
%129 = load i32, i32* %15
%130 = add nsw i32 %129, 1
store i32 %130, i32* %15
br label %113
131: ; preds = %113
%132 = load float*, float** %8
%133 = load float*, float** %10
%134 = getelementptr inbounds [3 x [3 x float]], [3 x [3 x float]]* %13, i64 0, i64 1
%135 = getelementptr inbounds [3 x float], [3 x float]* %134, i64 0, i64 0
%136 = call i32 @CrossProduct(float* %132, float* %133, float* %135)
%137 = getelementptr inbounds [3 x [3 x float]], [3 x [3 x float]]* %13, i64 0, i64 1
%138 = getelementptr inbounds [3 x float], [3 x float]* %137, i64 0, i64 0
%139 = call float @VectorMagnitude(float* %138)
store float %139, float* %14
%140 = load float, float* %14
%141 = call float @llvm.fabs.f32(float %140)
%142 = fcmp olt float %141, 0x39B4484C00000000
br i1 %142, label %143, label %144
143: ; preds = %131
store i32 -1, i32* %6
br label %232
144: ; preds = %131
store i32 0, i32* %15
br label %145
145: ; preds = %160, %144
%146 = load i32, i32* %15
%147 = icmp slt i32 %146, 3
br i1 %147, label %148, label %163
148: ; preds = %145
%149 = getelementptr inbounds [3 x [3 x float]], [3 x [3 x float]]* %13, i64 0, i64 1
%150 = load i32, i32* %15
%151 = sext i32 %150 to i64
%152 = getelementptr inbounds [3 x float], [3 x float]* %149, i64 0, i64 %151
%153 = load float, float* %152
%154 = load float, float* %14
%155 = fdiv float %153, %154
%156 = getelementptr inbounds [3 x [3 x float]], [3 x [3 x float]]* %13, i64 0, i64 1
%157 = load i32, i32* %15
%158 = sext i32 %157 to i64
%159 = getelementptr inbounds [3 x float], [3 x float]* %156, i64 0, i64 %158
store float %155, float* %159
br label %160
160: ; preds = %148
%161 = load i32, i32* %15
%162 = add nsw i32 %161, 1
store i32 %162, i32* %15
br label %145
163: ; preds = %145
%164 = getelementptr inbounds [3 x [3 x float]], [3 x [3 x float]]* %12, i64 0, i64 0
%165 = getelementptr inbounds [3 x float], [3 x float]* %164, i64 0, i64 0
%166 = getelementptr inbounds [3 x [3 x float]], [3 x [3 x float]]* %12, i64 0, i64 1
%167 = getelementptr inbounds [3 x float], [3 x float]* %166, i64 0, i64 0
%168 = getelementptr inbounds [3 x [3 x float]], [3 x [3 x float]]* %12, i64 0, i64 2
%169 = getelementptr inbounds [3 x float], [3 x float]* %168, i64 0, i64 0
%170 = call i32 @CrossProduct(float* %165, float* %167, float* %169)
%171 = getelementptr inbounds [3 x [3 x float]], [3 x [3 x float]]* %13, i64 0, i64 0
%172 = getelementptr inbounds [3 x float], [3 x float]* %171, i64 0, i64 0
%173 = getelementptr inbounds [3 x [3 x float]], [3 x [3 x float]]* %13, i64 0, i64 1
%174 = getelementptr inbounds [3 x float], [3 x float]* %173, i64 0, i64 0
%175 = getelementptr inbounds [3 x [3 x float]], [3 x [3 x float]]* %13, i64 0, i64 2
%176 = getelementptr inbounds [3 x float], [3 x float]* %175, i64 0, i64 0
%177 = call i32 @CrossProduct(float* %172, float* %174, float* %176)
store i32 0, i32* %15
br label %178
178: ; preds = %228, %163
%179 = load i32, i32* %15
%180 = icmp slt i32 %179, 3
br i1 %180, label %181, label %231
181: ; preds = %178
store i32 0, i32* %16
br label %182
182: ; preds = %224, %181
%183 = load i32, i32* %16
%184 = icmp slt i32 %183, 3
br i1 %184, label %185, label %227
185: ; preds = %182
%186 = load [3 x float]*, [3 x float]** %11
%187 = load i32, i32* %15
%188 = sext i32 %187 to i64
%189 = getelementptr inbounds [3 x float], [3 x float]* %186, i64 %188
%190 = load i32, i32* %16
%191 = sext i32 %190 to i64
%192 = getelementptr inbounds [3 x float], [3 x float]* %189, i64 0, i64 %191
store float 0.000000e+00, float* %192
store i32 0, i32* %17
br label %193
193: ; preds = %220, %185
%194 = load i32, i32* %17
%195 = icmp slt i32 %194, 3
br i1 %195, label %196, label %223
196: ; preds = %193
%197 = load i32, i32* %17
%198 = sext i32 %197 to i64
%199 = getelementptr inbounds [3 x [3 x float]], [3 x [3 x float]]* %12, i64 0, i64 %198
%200 = load i32, i32* %15
%201 = sext i32 %200 to i64
%202 = getelementptr inbounds [3 x float], [3 x float]* %199, i64 0, i64 %201
%203 = load float, float* %202
%204 = load i32, i32* %17
%205 = sext i32 %204 to i64
%206 = getelementptr inbounds [3 x [3 x float]], [3 x [3 x float]]* %13, i64 0, i64 %205
%207 = load i32, i32* %16
%208 = sext i32 %207 to i64
%209 = getelementptr inbounds [3 x float], [3 x float]* %206, i64 0, i64 %208
%210 = load float, float* %209
%211 = load [3 x float]*, [3 x float]** %11
%212 = load i32, i32* %15
%213 = sext i32 %212 to i64
%214 = getelementptr inbounds [3 x float], [3 x float]* %211, i64 %213
%215 = load i32, i32* %16
%216 = sext i32 %215 to i64
%217 = getelementptr inbounds [3 x float], [3 x float]* %214, i64 0, i64 %216
%218 = load float, float* %217
%219 = call float @llvm.fmuladd.f32(float %203, float %210, float %218)
store float %219, float* %217
br label %220
220: ; preds = %196
%221 = load i32, i32* %17
%222 = add nsw i32 %221, 1
store i32 %222, i32* %17
br label %193
223: ; preds = %193
br label %224
224: ; preds = %223
%225 = load i32, i32* %16
%226 = add nsw i32 %225, 1
store i32 %226, i32* %16
br label %182
227: ; preds = %182
br label %228
228: ; preds = %227
%229 = load i32, i32* %15
%230 = add nsw i32 %229, 1
store i32 %230, i32* %15
br label %178
231: ; preds = %178
store i32 1, i32* %6
br label %232
232: ; preds = %231, %143, %111, %79, %53
%233 = load i32, i32* %6
ret i32 %233
}

LLVM IR (-O2):
define i32 @RotFrom2Vectors(float* %0, float* %1, float* %2, float* %3, [3 x float]* nocapture %4) {
%6 = alloca [3 x [3 x float]]
%7 = alloca [3 x [3 x float]]
%8 = bitcast [3 x [3 x float]]* %6 to i8*
%9 = bitcast [3 x [3 x float]]* %7 to i8*
%10 = getelementptr [3 x float], [3 x float]* %4, i64 0, i64 0
%11 = getelementptr inbounds [3 x float], [3 x float]* %4, i64 0, i64 1
%12 = bitcast float* %11 to i64*
store i64 0, i64* %12
store float 1.000000e+00, float* %10
%13 = getelementptr [3 x float], [3 x float]* %4, i64 1, i64 0
%14 = bitcast float* %13 to i8*
%15 = getelementptr inbounds [3 x float], [3 x float]* %4, i64 1, i64 1
store float 1.000000e+00, float* %15
%16 = getelementptr [3 x float], [3 x float]* %4, i64 2, i64 0
%17 = bitcast float* %16 to i64*
store i64 0, i64* %17
%18 = getelementptr inbounds [3 x float], [3 x float]* %4, i64 2, i64 2
store float 1.000000e+00, float* %18
%19 = tail call float @VectorMagnitude(float* %0)
%20 = tail call float @llvm.fabs.f32(float %19)
%21 = fcmp olt float %20, 0x39B4484C00000000
br i1 %21, label %146, label %22
22: ; preds = %5
%23 = load float, float* %0
%24 = fdiv float %23, %19
%25 = getelementptr inbounds [3 x [3 x float]], [3 x [3 x float]]* %6, i64 0, i64 0, i64 0
store float %24, float* %25
%26 = getelementptr inbounds float, float* %0, i64 1
%27 = load float, float* %26
%28 = fdiv float %27, %19
%29 = getelementptr inbounds [3 x [3 x float]], [3 x [3 x float]]* %6, i64 0, i64 0, i64 1
store float %28, float* %29
%30 = getelementptr inbounds float, float* %0, i64 2
%31 = load float, float* %30
%32 = fdiv float %31, %19
%33 = getelementptr inbounds [3 x [3 x float]], [3 x [3 x float]]* %6, i64 0, i64 0, i64 2
store float %32, float* %33
%34 = tail call float @VectorMagnitude(float* %1)
%35 = tail call float @llvm.fabs.f32(float %34)
%36 = fcmp olt float %35, 0x39B4484C00000000
br i1 %36, label %146, label %37
37: ; preds = %22
%38 = load float, float* %1
%39 = fdiv float %38, %34
%40 = getelementptr inbounds [3 x [3 x float]], [3 x [3 x float]]* %7, i64 0, i64 0, i64 0
store float %39, float* %40
%41 = getelementptr inbounds float, float* %1, i64 1
%42 = load float, float* %41
%43 = fdiv float %42, %34
%44 = getelementptr inbounds [3 x [3 x float]], [3 x [3 x float]]* %7, i64 0, i64 0, i64 1
store float %43, float* %44
%45 = getelementptr inbounds float, float* %1, i64 2
%46 = load float, float* %45
%47 = fdiv float %46, %34
%48 = getelementptr inbounds [3 x [3 x float]], [3 x [3 x float]]* %7, i64 0, i64 0, i64 2
store float %47, float* %48
%49 = getelementptr inbounds [3 x [3 x float]], [3 x [3 x float]]* %6, i64 0, i64 1, i64 0
%50 = call i32 @CrossProduct(float* %0, float* %2, float* %49)
%51 = call float @VectorMagnitude(float* %49)
%52 = call float @llvm.fabs.f32(float %51)
%53 = fcmp olt float %52, 0x39B4484C00000000
br i1 %53, label %146, label %54
54: ; preds = %37
%55 = load float, float* %49
%56 = fdiv float %55, %51
store float %56, float* %49
%57 = getelementptr inbounds [3 x [3 x float]], [3 x [3 x float]]* %6, i64 0, i64 1, i64 1
%58 = load float, float* %57
%59 = fdiv float %58, %51
store float %59, float* %57
%60 = getelementptr inbounds [3 x [3 x float]], [3 x [3 x float]]* %6, i64 0, i64 1, i64 2
%61 = load float, float* %60
%62 = fdiv float %61, %51
store float %62, float* %60
%63 = getelementptr inbounds [3 x [3 x float]], [3 x [3 x float]]* %7, i64 0, i64 1, i64 0
%64 = call i32 @CrossProduct(float* %1, float* %3, float* %63)
%65 = call float @VectorMagnitude(float* %63)
%66 = call float @llvm.fabs.f32(float %65)
%67 = fcmp olt float %66, 0x39B4484C00000000
br i1 %67, label %146, label %68
68: ; preds = %54
%69 = load float, float* %63
%70 = fdiv float %69, %65
store float %70, float* %63
%71 = getelementptr inbounds [3 x [3 x float]], [3 x [3 x float]]* %7, i64 0, i64 1, i64 1
%72 = load float, float* %71
%73 = fdiv float %72, %65
store float %73, float* %71
%74 = getelementptr inbounds [3 x [3 x float]], [3 x [3 x float]]* %7, i64 0, i64 1, i64 2
%75 = load float, float* %74
%76 = fdiv float %75, %65
store float %76, float* %74
%77 = getelementptr inbounds [3 x [3 x float]], [3 x [3 x float]]* %6, i64 0, i64 2, i64 0
%78 = call i32 @CrossProduct(float* %25, float* %49, float* %77)
%79 = getelementptr inbounds [3 x [3 x float]], [3 x [3 x float]]* %7, i64 0, i64 2, i64 0
%80 = call i32 @CrossProduct(float* %40, float* %63, float* %79)
%81 = load float, float* %40
%82 = load float, float* %63
%83 = load float, float* %79
%84 = load float, float* %44
%85 = load float, float* %71
%86 = getelementptr inbounds [3 x [3 x float]], [3 x [3 x float]]* %7, i64 0, i64 2, i64 1
%87 = load float, float* %86
%88 = load float, float* %48
%89 = load float, float* %74
%90 = getelementptr inbounds [3 x [3 x float]], [3 x [3 x float]]* %7, i64 0, i64 2, i64 2
%91 = load float, float* %90
%92 = getelementptr inbounds [3 x [3 x float]], [3 x [3 x float]]* %6, i64 0, i64 0, i64 0
%93 = getelementptr inbounds [3 x float], [3 x float]* %4, i64 0, i64 0
%94 = load float, float* %92
%95 = call float @llvm.fmuladd.f32(float %94, float %81, float 0.000000e+00)
%96 = getelementptr inbounds [3 x [3 x float]], [3 x [3 x float]]* %6, i64 0, i64 1, i64 0
%97 = load float, float* %96
%98 = call float @llvm.fmuladd.f32(float %97, float %82, float %95)
%99 = getelementptr inbounds [3 x [3 x float]], [3 x [3 x float]]* %6, i64 0, i64 2, i64 0
%100 = load float, float* %99
%101 = call float @llvm.fmuladd.f32(float %100, float %83, float %98)
store float %101, float* %93
%102 = getelementptr inbounds [3 x float], [3 x float]* %4, i64 0, i64 1
%103 = call float @llvm.fmuladd.f32(float %94, float %84, float 0.000000e+00)
%104 = call float @llvm.fmuladd.f32(float %97, float %85, float %103)
%105 = call float @llvm.fmuladd.f32(float %100, float %87, float %104)
store float %105, float* %102
%106 = getelementptr inbounds [3 x float], [3 x float]* %4, i64 0, i64 2
%107 = call float @llvm.fmuladd.f32(float %94, float %88, float 0.000000e+00)
%108 = call float @llvm.fmuladd.f32(float %97, float %89, float %107)
%109 = call float @llvm.fmuladd.f32(float %100, float %91, float %108)
store float %109, float* %106
%110 = getelementptr inbounds [3 x [3 x float]], [3 x [3 x float]]* %6, i64 0, i64 0, i64 1
%111 = getelementptr inbounds [3 x float], [3 x float]* %4, i64 1, i64 0
%112 = load float, float* %110
%113 = call float @llvm.fmuladd.f32(float %112, float %81, float 0.000000e+00)
%114 = getelementptr inbounds [3 x [3 x float]], [3 x [3 x float]]* %6, i64 0, i64 1, i64 1
%115 = load float, float* %114
%116 = call float @llvm.fmuladd.f32(float %115, float %82, float %113)
%117 = getelementptr inbounds [3 x [3 x float]], [3 x [3 x float]]* %6, i64 0, i64 2, i64 1
%118 = load float, float* %117
%119 = call float @llvm.fmuladd.f32(float %118, float %83, float %116)
store float %119, float* %111
%120 = getelementptr inbounds [3 x float], [3 x float]* %4, i64 1, i64 1
%121 = call float @llvm.fmuladd.f32(float %112, float %84, float 0.000000e+00)
%122 = call float @llvm.fmuladd.f32(float %115, float %85, float %121)
%123 = call float @llvm.fmuladd.f32(float %118, float %87, float %122)
store float %123, float* %120
%124 = getelementptr inbounds [3 x float], [3 x float]* %4, i64 1, i64 2
%125 = call float @llvm.fmuladd.f32(float %112, float %88, float 0.000000e+00)
%126 = call float @llvm.fmuladd.f32(float %115, float %89, float %125)
%127 = call float @llvm.fmuladd.f32(float %118, float %91, float %126)
store float %127, float* %124
%128 = getelementptr inbounds [3 x [3 x float]], [3 x [3 x float]]* %6, i64 0, i64 0, i64 2
%129 = getelementptr inbounds [3 x float], [3 x float]* %4, i64 2, i64 0
%130 = load float, float* %128
%131 = call float @llvm.fmuladd.f32(float %130, float %81, float 0.000000e+00)
%132 = getelementptr inbounds [3 x [3 x float]], [3 x [3 x float]]* %6, i64 0, i64 1, i64 2
%133 = load float, float* %132
%134 = call float @llvm.fmuladd.f32(float %133, float %82, float %131)
%135 = getelementptr inbounds [3 x [3 x float]], [3 x [3 x float]]* %6, i64 0, i64 2, i64 2
%136 = load float, float* %135
%137 = call float @llvm.fmuladd.f32(float %136, float %83, float %134)
store float %137, float* %129
%138 = getelementptr inbounds [3 x float], [3 x float]* %4, i64 2, i64 1
%139 = call float @llvm.fmuladd.f32(float %130, float %84, float 0.000000e+00)
%140 = call float @llvm.fmuladd.f32(float %133, float %85, float %139)
%141 = call float @llvm.fmuladd.f32(float %136, float %87, float %140)
store float %141, float* %138
%142 = getelementptr inbounds [3 x float], [3 x float]* %4, i64 2, i64 2
%143 = call float @llvm.fmuladd.f32(float %130, float %88, float 0.000000e+00)
%144 = call float @llvm.fmuladd.f32(float %133, float %89, float %143)
%145 = call float @llvm.fmuladd.f32(float %136, float %91, float %144)
store float %145, float* %142
br label %146
146: ; preds = %68, %54, %37, %22, %5
%147 = phi i32 [ -1, %5 ], [ -1, %22 ], [ -1, %37 ], [ -1, %54 ], [ 1, %68 ]
ret i32 %147
}