#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 */

/* Variables and functions */
double acos(double);
double fabs(double);
int /*<<< orphan*/ memset(double *, int /*<<< orphan*/, int);
double sin(double);
double sqrt(int);
void RotToAxisAng(double R[3][3], double omghat[3], double *theta) {
  double tmp;
  double omg[3] = {0};
  double acosinput = (R[0][0] + R[1][1] + R[2][2] - 1.0) / 2.0;
  if (fabs(acosinput - 1.0) < 1.0E-6) {
    memset(omghat, 0, 3 * sizeof(double));
    *theta = 0.0;
  } else if (acosinput <= -1.0) {
    if ((1.0 + R[2][2]) >= 1.0E-6) {
      omg[0] = 1.0 / sqrt(2 * (1.0 + R[2][2])) * R[0][2];
      omg[1] = 1.0 / sqrt(2 * (1.0 + R[2][2])) * R[1][2];
      omg[2] = 1.0 / sqrt(2 * (1.0 + R[2][2])) * (1.0 + R[2][2]);
    } else if ((1.0 + R[1][1] >= 1.0E-6)) {
      omg[0] = 1.0 / sqrt(2 * (1.0 + R[1][1])) * R[0][1];
      omg[1] = 1.0 / sqrt(2 * (1.0 + R[1][1])) * (1.0 + R[1][1]);
      omg[2] = 1.0 / sqrt(2 * (1.0 + R[1][1])) * R[2][1];
    } else {
      omg[0] = 1.0 / sqrt(2 * (1.0 + R[0][0])) * (1.0 + R[0][0]);
      omg[1] = 1.0 / sqrt(2 * (1.0 + R[0][0])) * R[1][0];
      omg[2] = 1.0 / sqrt(2 * (1.0 + R[0][0])) * R[2][0];
    }
    omghat[0] = omg[0];
    omghat[1] = omg[1];
    omghat[2] = omg[2];
    *theta = 3.14159265358979323846;
  } else {
    *theta = acos(acosinput);
    tmp = 2.0 * sin(*theta);
    omghat[0] = (R[2][1] - R[1][2]) / tmp;
    omghat[1] = (R[0][2] - R[2][0]) / tmp;
    omghat[2] = (R[1][0] - R[0][1]) / tmp;
  }
  return;
}


x86 assembly (clang, -O0):
<RotToAxisAng>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
lea    -0x40(%rbp),%rdi
xor    %esi,%esi
mov    $0x18,%edx
call   1040 <memset@plt>
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x8(%rbp),%rax
addsd  0x20(%rax),%xmm0
mov    -0x8(%rbp),%rax
addsd  0x40(%rax),%xmm0
movsd  0xe82(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  0xe7e(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  -0x48(%rbp),%xmm1
movsd  0xe60(%rip),%xmm0
subsd  %xmm0,%xmm1
movaps 0xe7d(%rip),%xmm0
pand   %xmm0,%xmm1
movsd  0xe41(%rip),%xmm0
ucomisd %xmm1,%xmm0
jbe    11e9 <RotToAxisAng+0xa9>
mov    -0x10(%rbp),%rdi
xor    %esi,%esi
mov    $0x18,%edx
call   1040 <memset@plt>
mov    -0x18(%rbp),%rax
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax)
jmp    15a1 <RotToAxisAng+0x461>
movsd  0xe27(%rip),%xmm0
ucomisd -0x48(%rbp),%xmm0
jb     150a <RotToAxisAng+0x3ca>
mov    -0x8(%rbp),%rax
movsd  0xe00(%rip),%xmm0
addsd  0x40(%rax),%xmm0
movsd  0xdeb(%rip),%xmm1
ucomisd %xmm1,%xmm0
jb     12f9 <RotToAxisAng+0x1b9>
mov    -0x8(%rbp),%rax
movsd  0xddd(%rip),%xmm1
addsd  0x40(%rax),%xmm1
movsd  0xdd8(%rip),%xmm0
mulsd  %xmm1,%xmm0
cvttsd2si %xmm0,%edi
call   1060 <sqrt@plt>
movaps %xmm0,%xmm1
movsd  0xdb8(%rip),%xmm0
divsd  %xmm1,%xmm0
mov    -0x8(%rbp),%rax
mulsd  0x10(%rax),%xmm0
movsd  %xmm0,-0x40(%rbp)
mov    -0x8(%rbp),%rax
movsd  0xd9a(%rip),%xmm1
addsd  0x40(%rax),%xmm1
movsd  0xd95(%rip),%xmm0
mulsd  %xmm1,%xmm0
cvttsd2si %xmm0,%edi
call   1060 <sqrt@plt>
movaps %xmm0,%xmm1
movsd  0xd75(%rip),%xmm0
divsd  %xmm1,%xmm0
mov    -0x8(%rbp),%rax
mulsd  0x28(%rax),%xmm0
movsd  %xmm0,-0x38(%rbp)
mov    -0x8(%rbp),%rax
movsd  0xd57(%rip),%xmm1
addsd  0x40(%rax),%xmm1
movsd  0xd52(%rip),%xmm0
mulsd  %xmm1,%xmm0
cvttsd2si %xmm0,%edi
call   1060 <sqrt@plt>
movaps %xmm0,%xmm1
movsd  0xd32(%rip),%xmm0
divsd  %xmm1,%xmm0
mov    -0x8(%rbp),%rax
movsd  0xd22(%rip),%xmm1
addsd  0x40(%rax),%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x30(%rbp)
jmp    14cc <RotToAxisAng+0x38c>
mov    -0x8(%rbp),%rax
movsd  0xd03(%rip),%xmm0
addsd  0x20(%rax),%xmm0
movsd  0xcee(%rip),%xmm1
ucomisd %xmm1,%xmm0
jb     13f6 <RotToAxisAng+0x2b6>
mov    -0x8(%rbp),%rax
movsd  0xce0(%rip),%xmm1
addsd  0x20(%rax),%xmm1
movsd  0xcdb(%rip),%xmm0
mulsd  %xmm1,%xmm0
cvttsd2si %xmm0,%edi
call   1060 <sqrt@plt>
movaps %xmm0,%xmm1
movsd  0xcbb(%rip),%xmm0
divsd  %xmm1,%xmm0
mov    -0x8(%rbp),%rax
mulsd  0x8(%rax),%xmm0
movsd  %xmm0,-0x40(%rbp)
mov    -0x8(%rbp),%rax
movsd  0xc9d(%rip),%xmm1
addsd  0x20(%rax),%xmm1
movsd  0xc98(%rip),%xmm0
mulsd  %xmm1,%xmm0
cvttsd2si %xmm0,%edi
call   1060 <sqrt@plt>
movaps %xmm0,%xmm1
movsd  0xc78(%rip),%xmm0
divsd  %xmm1,%xmm0
mov    -0x8(%rbp),%rax
movsd  0xc68(%rip),%xmm1
addsd  0x20(%rax),%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x38(%rbp)
mov    -0x8(%rbp),%rax
movsd  0xc4e(%rip),%xmm1
addsd  0x20(%rax),%xmm1
movsd  0xc49(%rip),%xmm0
mulsd  %xmm1,%xmm0
cvttsd2si %xmm0,%edi
call   1060 <sqrt@plt>
movaps %xmm0,%xmm1
movsd  0xc29(%rip),%xmm0
divsd  %xmm1,%xmm0
mov    -0x8(%rbp),%rax
mulsd  0x38(%rax),%xmm0
movsd  %xmm0,-0x30(%rbp)
jmp    14c7 <RotToAxisAng+0x387>
mov    -0x8(%rbp),%rax
movsd  0xc06(%rip),%xmm1
addsd  (%rax),%xmm1
movsd  0xc02(%rip),%xmm0
mulsd  %xmm1,%xmm0
cvttsd2si %xmm0,%edi
call   1060 <sqrt@plt>
movaps %xmm0,%xmm1
movsd  0xbe2(%rip),%xmm0
divsd  %xmm1,%xmm0
mov    -0x8(%rbp),%rax
movsd  0xbd2(%rip),%xmm1
addsd  (%rax),%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x40(%rbp)
mov    -0x8(%rbp),%rax
movsd  0xbb9(%rip),%xmm1
addsd  (%rax),%xmm1
movsd  0xbb5(%rip),%xmm0
mulsd  %xmm1,%xmm0
cvttsd2si %xmm0,%edi
call   1060 <sqrt@plt>
movaps %xmm0,%xmm1
movsd  0xb95(%rip),%xmm0
divsd  %xmm1,%xmm0
mov    -0x8(%rbp),%rax
mulsd  0x18(%rax),%xmm0
movsd  %xmm0,-0x38(%rbp)
mov    -0x8(%rbp),%rax
movsd  0xb77(%rip),%xmm1
addsd  (%rax),%xmm1
movsd  0xb73(%rip),%xmm0
mulsd  %xmm1,%xmm0
cvttsd2si %xmm0,%edi
call   1060 <sqrt@plt>
movaps %xmm0,%xmm1
movsd  0xb53(%rip),%xmm0
divsd  %xmm1,%xmm0
mov    -0x8(%rbp),%rax
mulsd  0x30(%rax),%xmm0
movsd  %xmm0,-0x30(%rbp)
jmp    14cc <RotToAxisAng+0x38c>
movsd  -0x40(%rbp),%xmm0
mov    -0x10(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  -0x38(%rbp),%xmm0
mov    -0x10(%rbp),%rax
movsd  %xmm0,0x8(%rax)
movsd  -0x30(%rbp),%xmm0
mov    -0x10(%rbp),%rax
movsd  %xmm0,0x10(%rax)
mov    -0x18(%rbp),%rax
movsd  0xb1f(%rip),%xmm0
movsd  %xmm0,(%rax)
jmp    159c <RotToAxisAng+0x45c>
movsd  -0x48(%rbp),%xmm0
call   1030 <acos@plt>
mov    -0x18(%rbp),%rax
movsd  %xmm0,(%rax)
mov    -0x18(%rbp),%rax
movsd  (%rax),%xmm0
call   1050 <sin@plt>
movaps %xmm0,%xmm1
movsd  0xadc(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
mov    -0x8(%rbp),%rax
movsd  0x38(%rax),%xmm0
mov    -0x8(%rbp),%rax
subsd  0x28(%rax),%xmm0
divsd  -0x20(%rbp),%xmm0
mov    -0x10(%rbp),%rax
movsd  %xmm0,(%rax)
mov    -0x8(%rbp),%rax
movsd  0x10(%rax),%xmm0
mov    -0x8(%rbp),%rax
subsd  0x30(%rax),%xmm0
divsd  -0x20(%rbp),%xmm0
mov    -0x10(%rbp),%rax
movsd  %xmm0,0x8(%rax)
mov    -0x8(%rbp),%rax
movsd  0x18(%rax),%xmm0
mov    -0x8(%rbp),%rax
subsd  0x8(%rax),%xmm0
divsd  -0x20(%rbp),%xmm0
mov    -0x10(%rbp),%rax
movsd  %xmm0,0x10(%rax)
jmp    15a1 <RotToAxisAng+0x461>
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<RotToAxisAng>:
push   %r15
push   %r14
push   %rbx
sub    $0x20,%rsp
movsd  (%rdi),%xmm1
movsd  0x20(%rdi),%xmm2
movapd %xmm1,%xmm0
addsd  %xmm2,%xmm0
movsd  0x40(%rdi),%xmm3
addsd  %xmm3,%xmm0
movsd  0xe95(%rip),%xmm4
addsd  %xmm4,%xmm0
mulsd  0xe91(%rip),%xmm0
movapd %xmm0,%xmm5
addsd  %xmm4,%xmm5
andpd  0xe99(%rip),%xmm5
mov    %rdx,%r15
mov    %rsi,%r14
movsd  0xe7b(%rip),%xmm6
ucomisd %xmm5,%xmm6
jbe    11b6 <RotToAxisAng+0x76>
mov    %r14,%rdi
xor    %esi,%esi
mov    $0x18,%edx
call   1040 <memset@plt>
movq   $0x0,(%r15)
jmp    1412 <RotToAxisAng+0x2d2>
mov    %rdi,%rbx
ucomisd %xmm0,%xmm4
jae    1212 <RotToAxisAng+0xd2>
call   1030 <acos@plt>
movsd  %xmm0,(%r15)
call   1050 <sin@plt>
addsd  %xmm0,%xmm0
movsd  0x38(%rbx),%xmm1
subsd  0x28(%rbx),%xmm1
divsd  %xmm0,%xmm1
movsd  %xmm1,(%r14)
movsd  0x10(%rbx),%xmm1
subsd  0x30(%rbx),%xmm1
divsd  %xmm0,%xmm1
movsd  %xmm1,0x8(%r14)
movsd  0x18(%rbx),%xmm1
subsd  0x8(%rbx),%xmm1
divsd  %xmm0,%xmm1
movsd  %xmm1,0x10(%r14)
jmp    1412 <RotToAxisAng+0x2d2>
addsd  0xdfe(%rip),%xmm3
ucomisd 0xdee(%rip),%xmm3
jae    12cf <RotToAxisAng+0x18f>
addsd  0xde8(%rip),%xmm2
ucomisd 0xdd8(%rip),%xmm2
jae    136b <RotToAxisAng+0x22b>
addsd  0xdd2(%rip),%xmm1
addsd  %xmm1,%xmm1
cvttsd2si %xmm1,%edi
call   1060 <sqrt@plt>
movapd %xmm0,0x10(%rsp)
movsd  (%rbx),%xmm0
addsd  0xdb3(%rip),%xmm0
movapd %xmm0,(%rsp)
addsd  %xmm0,%xmm0
cvttsd2si %xmm0,%edi
call   1060 <sqrt@plt>
movapd 0x10(%rsp),%xmm1
unpcklpd %xmm0,%xmm1
movapd 0xda7(%rip),%xmm0
divpd  %xmm1,%xmm0
movapd (%rsp),%xmm1
movhpd 0x18(%rbx),%xmm1
mulpd  %xmm0,%xmm1
movapd %xmm1,(%rsp)
movsd  (%rbx),%xmm0
addsd  0xd6c(%rip),%xmm0
addsd  %xmm0,%xmm0
cvttsd2si %xmm0,%edi
call   1060 <sqrt@plt>
movsd  0xd57(%rip),%xmm1
divsd  %xmm0,%xmm1
mulsd  0x30(%rbx),%xmm1
jmp    13f5 <RotToAxisAng+0x2b5>
addsd  %xmm3,%xmm3
cvttsd2si %xmm3,%edi
call   1060 <sqrt@plt>
movapd %xmm0,0x10(%rsp)
movsd  0x40(%rbx),%xmm0
addsd  0xd29(%rip),%xmm0
addsd  %xmm0,%xmm0
cvttsd2si %xmm0,%edi
movsd  0x10(%rbx),%xmm0
movapd %xmm0,(%rsp)
call   1060 <sqrt@plt>
movapd 0x10(%rsp),%xmm1
unpcklpd %xmm0,%xmm1
movapd 0xd18(%rip),%xmm0
divpd  %xmm1,%xmm0
movapd (%rsp),%xmm1
movhpd 0x28(%rbx),%xmm1
mulpd  %xmm0,%xmm1
movapd %xmm1,(%rsp)
movsd  0x40(%rbx),%xmm0
addsd  0xcdc(%rip),%xmm0
addsd  %xmm0,%xmm0
cvttsd2si %xmm0,%edi
call   1060 <sqrt@plt>
movsd  0xcc7(%rip),%xmm2
movapd %xmm2,%xmm1
divsd  %xmm0,%xmm1
addsd  0x40(%rbx),%xmm2
mulsd  %xmm1,%xmm2
movapd %xmm2,%xmm1
jmp    13f5 <RotToAxisAng+0x2b5>
addsd  %xmm2,%xmm2
cvttsd2si %xmm2,%edi
call   1060 <sqrt@plt>
movapd %xmm0,0x10(%rsp)
movsd  0x20(%rbx),%xmm0
addsd  0xc8d(%rip),%xmm0
addsd  %xmm0,%xmm0
cvttsd2si %xmm0,%edi
movsd  0x8(%rbx),%xmm0
movapd %xmm0,(%rsp)
call   1060 <sqrt@plt>
movapd 0x10(%rsp),%xmm1
unpcklpd %xmm0,%xmm1
movapd 0xc7c(%rip),%xmm0
divpd  %xmm1,%xmm0
movsd  0x20(%rbx),%xmm1
addsd  0xc53(%rip),%xmm1
movapd (%rsp),%xmm2
unpcklpd %xmm1,%xmm2
mulpd  %xmm0,%xmm2
movapd %xmm2,(%rsp)
addsd  %xmm1,%xmm1
cvttsd2si %xmm1,%edi
call   1060 <sqrt@plt>
movsd  0xc2c(%rip),%xmm1
divsd  %xmm0,%xmm1
mulsd  0x38(%rbx),%xmm1
movapd (%rsp),%xmm0
movupd %xmm0,(%r14)
movsd  %xmm1,0x10(%r14)
movabs $0x400921fb54442d18,%rax
21 09 40
mov    %rax,(%r15)
add    $0x20,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

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

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