void bot_quat_interpolate(const double q0[4], const double q1[4], double u,
                          double result[4]) {
  double cos_omega =
      q0[0] * q1[0] + q0[1] * q1[1] + q0[2] * q1[2] + q0[3] * q1[3];
  if (cos_omega < 0) {
    result[0] = -q0[0];
    result[1] = -q0[1];
    result[2] = -q0[2];
    result[3] = -q0[3];
    cos_omega = -cos_omega;
  } else {
    result[0] = q0[0];
    result[1] = q0[1];
    result[2] = q0[2];
    result[3] = q0[3];
  }
  if (cos_omega > 1)
    cos_omega = 1;
  double omega = acos(cos_omega);
  double sin_omega = sin(omega);
  double a = sin((1 - u) * omega) / sin_omega;
  double b = sin(u * omega) / sin_omega;
  if (fabs(sin_omega) < 1e-6) {
    result[0] = result[0] * (1 - u) + q1[0] * u;
    result[1] = result[1] * (1 - u) + q1[1] * u;
    result[2] = result[2] * (1 - u) + q1[2] * u;
    result[3] = result[3] * (1 - u) + q1[3] * u;
    double s =
        1 / sqrt(((result[0]) * (result[0])) + ((result[1]) * (result[1])) +
                 ((result[2]) * (result[2])) + ((result[3]) * (result[3])));
    result[0] *= s;
    result[1] *= s;
    result[2] *= s;
    result[3] *= s;
  } else {
    result[0] = result[0] * a + q1[0] * b;
    result[1] = result[1] * a + q1[1] * b;
    result[2] = result[2] * a + q1[2] * b;
    result[3] = result[3] * a + q1[3] * b;
  };
}


x86 assembly (clang, -O0):
<bot_quat_interpolate>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movsd  %xmm0,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm2
mov    -0x8(%rbp),%rax
movsd  0x8(%rax),%xmm1
mov    -0x10(%rbp),%rax
mulsd  0x8(%rax),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x8(%rbp),%rax
movsd  0x10(%rax),%xmm1
mov    -0x10(%rbp),%rax
movsd  0x10(%rax),%xmm2
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
mov    -0x8(%rbp),%rax
movsd  0x18(%rax),%xmm0
mov    -0x10(%rbp),%rax
movsd  0x18(%rax),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x28(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x28(%rbp),%xmm0
jbe    1282 <bot_quat_interpolate+0x152>
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mov    -0x20(%rbp),%rax
movsd  %xmm0,(%rax)
mov    -0x8(%rbp),%rax
movsd  0x8(%rax),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mov    -0x20(%rbp),%rax
movsd  %xmm0,0x8(%rax)
mov    -0x8(%rbp),%rax
movsd  0x10(%rax),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mov    -0x20(%rbp),%rax
movsd  %xmm0,0x10(%rax)
mov    -0x8(%rbp),%rax
movsd  0x18(%rax),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mov    -0x20(%rbp),%rax
movsd  %xmm0,0x18(%rax)
movsd  -0x28(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x28(%rbp)
jmp    12c8 <bot_quat_interpolate+0x198>
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x20(%rbp),%rax
movsd  %xmm0,(%rax)
mov    -0x8(%rbp),%rax
movsd  0x8(%rax),%xmm0
mov    -0x20(%rbp),%rax
movsd  %xmm0,0x8(%rax)
mov    -0x8(%rbp),%rax
movsd  0x10(%rax),%xmm0
mov    -0x20(%rbp),%rax
movsd  %xmm0,0x10(%rax)
mov    -0x8(%rbp),%rax
movsd  0x18(%rax),%xmm0
mov    -0x20(%rbp),%rax
movsd  %xmm0,0x18(%rax)
movsd  -0x28(%rbp),%xmm0
movsd  0xd2b(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    12ec <bot_quat_interpolate+0x1bc>
movsd  0xd19(%rip),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x28(%rbp),%xmm0
call   1030 <acos@plt>
movsd  %xmm0,-0x30(%rbp)
movsd  -0x30(%rbp),%xmm0
call   1040 <sin@plt>
movsd  %xmm0,-0x38(%rbp)
movsd  0xcee(%rip),%xmm0
subsd  -0x18(%rbp),%xmm0
mulsd  -0x30(%rbp),%xmm0
call   1040 <sin@plt>
divsd  -0x38(%rbp),%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x18(%rbp),%xmm0
mulsd  -0x30(%rbp),%xmm0
call   1040 <sin@plt>
divsd  -0x38(%rbp),%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  -0x38(%rbp),%xmm1
movaps 0xcc0(%rip),%xmm0
pand   %xmm0,%xmm1
movsd  0xcac(%rip),%xmm0
ucomisd %xmm1,%xmm0
jbe    14fd <bot_quat_interpolate+0x3cd>
mov    -0x20(%rbp),%rax
movsd  (%rax),%xmm0
movsd  0xc8a(%rip),%xmm2
subsd  -0x18(%rbp),%xmm2
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm1
mulsd  -0x18(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x20(%rbp),%rax
movsd  %xmm0,(%rax)
mov    -0x20(%rbp),%rax
movsd  0x8(%rax),%xmm0
movsd  0xc57(%rip),%xmm2
subsd  -0x18(%rbp),%xmm2
mov    -0x10(%rbp),%rax
movsd  0x8(%rax),%xmm1
mulsd  -0x18(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x20(%rbp),%rax
movsd  %xmm0,0x8(%rax)
mov    -0x20(%rbp),%rax
movsd  0x10(%rax),%xmm0
movsd  0xc22(%rip),%xmm2
subsd  -0x18(%rbp),%xmm2
mov    -0x10(%rbp),%rax
movsd  0x10(%rax),%xmm1
mulsd  -0x18(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x20(%rbp),%rax
movsd  %xmm0,0x10(%rax)
mov    -0x20(%rbp),%rax
movsd  0x18(%rax),%xmm0
movsd  0xbed(%rip),%xmm2
subsd  -0x18(%rbp),%xmm2
mov    -0x10(%rbp),%rax
movsd  0x18(%rax),%xmm1
mulsd  -0x18(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x20(%rbp),%rax
movsd  %xmm0,0x18(%rax)
mov    -0x20(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x20(%rbp),%rax
movsd  (%rax),%xmm2
mov    -0x20(%rbp),%rax
movsd  0x8(%rax),%xmm1
mov    -0x20(%rbp),%rax
mulsd  0x8(%rax),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x20(%rbp),%rax
movsd  0x10(%rax),%xmm1
mov    -0x20(%rbp),%rax
movsd  0x10(%rax),%xmm2
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
mov    -0x20(%rbp),%rax
movsd  0x18(%rax),%xmm0
mov    -0x20(%rbp),%rax
movsd  0x18(%rax),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
call   1050 <sqrt@plt>
movaps %xmm0,%xmm1
movsd  0xb5b(%rip),%xmm0
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  -0x50(%rbp),%xmm0
mov    -0x20(%rbp),%rax
mulsd  (%rax),%xmm0
movsd  %xmm0,(%rax)
movsd  -0x50(%rbp),%xmm0
mov    -0x20(%rbp),%rax
mulsd  0x8(%rax),%xmm0
movsd  %xmm0,0x8(%rax)
movsd  -0x50(%rbp),%xmm0
mov    -0x20(%rbp),%rax
mulsd  0x10(%rax),%xmm0
movsd  %xmm0,0x10(%rax)
movsd  -0x50(%rbp),%xmm0
mov    -0x20(%rbp),%rax
mulsd  0x18(%rax),%xmm0
movsd  %xmm0,0x18(%rax)
jmp    15ae <bot_quat_interpolate+0x47e>
mov    -0x20(%rbp),%rax
movsd  (%rax),%xmm0
movsd  -0x40(%rbp),%xmm2
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm1
mulsd  -0x48(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x20(%rbp),%rax
movsd  %xmm0,(%rax)
mov    -0x20(%rbp),%rax
movsd  0x8(%rax),%xmm0
movsd  -0x40(%rbp),%xmm2
mov    -0x10(%rbp),%rax
movsd  0x8(%rax),%xmm1
mulsd  -0x48(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x20(%rbp),%rax
movsd  %xmm0,0x8(%rax)
mov    -0x20(%rbp),%rax
movsd  0x10(%rax),%xmm0
movsd  -0x40(%rbp),%xmm2
mov    -0x10(%rbp),%rax
movsd  0x10(%rax),%xmm1
mulsd  -0x48(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x20(%rbp),%rax
movsd  %xmm0,0x10(%rax)
mov    -0x20(%rbp),%rax
movsd  0x18(%rax),%xmm0
movsd  -0x40(%rbp),%xmm2
mov    -0x10(%rbp),%rax
movsd  0x18(%rax),%xmm1
mulsd  -0x48(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x20(%rbp),%rax
movsd  %xmm0,0x18(%rax)
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bot_quat_interpolate>:
push   %r14
push   %rbx
sub    $0x38,%rsp
mov    %rdx,%rbx
mov    %rsi,%r14
movsd  (%rdi),%xmm4
movsd  0x8(%rdi),%xmm1
mulsd  0x8(%rsi),%xmm1
movsd  (%rsi),%xmm2
mulsd  %xmm4,%xmm2
addsd  %xmm1,%xmm2
movsd  0x10(%rdi),%xmm3
mulsd  0x10(%rsi),%xmm3
addsd  %xmm2,%xmm3
movsd  0x18(%rdi),%xmm1
mulsd  0x18(%rsi),%xmm1
addsd  %xmm3,%xmm1
xorpd  %xmm2,%xmm2
ucomisd %xmm1,%xmm2
movsd  %xmm0,(%rsp)
jbe    11bd <bot_quat_interpolate+0x8d>
movapd 0xe76(%rip),%xmm2
xorpd  %xmm2,%xmm4
movlpd %xmm4,(%rbx)
movsd  0x8(%rdi),%xmm0
xorpd  %xmm2,%xmm0
movlpd %xmm0,0x8(%rbx)
movsd  0x10(%rdi),%xmm0
xorpd  %xmm2,%xmm0
movlpd %xmm0,0x10(%rbx)
movsd  0x18(%rdi),%xmm0
xorpd  %xmm2,%xmm0
xorpd  %xmm2,%xmm1
jmp    11da <bot_quat_interpolate+0xaa>
movsd  %xmm4,(%rbx)
movsd  0x8(%rdi),%xmm0
movsd  %xmm0,0x8(%rbx)
movsd  0x10(%rdi),%xmm0
movsd  %xmm0,0x10(%rbx)
movsd  0x18(%rdi),%xmm0
movsd  %xmm0,0x18(%rbx)
movsd  0xe39(%rip),%xmm0
minsd  %xmm1,%xmm0
call   1030 <acos@plt>
movsd  %xmm0,0x8(%rsp)
call   1040 <sin@plt>
movapd %xmm0,0x20(%rsp)
movsd  0xe17(%rip),%xmm0
subsd  (%rsp),%xmm0
movsd  %xmm0,0x18(%rsp)
mulsd  0x8(%rsp),%xmm0
call   1040 <sin@plt>
movsd  %xmm0,0x10(%rsp)
movsd  0x8(%rsp),%xmm0
mulsd  (%rsp),%xmm0
call   1040 <sin@plt>
movapd 0x20(%rsp),%xmm4
movapd 0xdcd(%rip),%xmm1
andpd  %xmm4,%xmm1
movsd  0xdd9(%rip),%xmm2
ucomisd %xmm1,%xmm2
movsd  (%rbx),%xmm1
movsd  (%r14),%xmm2
jbe    12f5 <bot_quat_interpolate+0x1c5>
movsd  (%rsp),%xmm5
mulsd  %xmm5,%xmm2
movsd  0x18(%rsp),%xmm0
mulsd  %xmm0,%xmm1
addsd  %xmm2,%xmm1
movsd  %xmm1,(%rbx)
movsd  0x8(%r14),%xmm3
mulsd  %xmm5,%xmm3
movsd  0x8(%rbx),%xmm2
mulsd  %xmm0,%xmm2
addsd  %xmm3,%xmm2
movsd  %xmm2,0x8(%rbx)
movsd  0x10(%r14),%xmm4
mulsd  %xmm5,%xmm4
movsd  0x10(%rbx),%xmm3
mulsd  %xmm0,%xmm3
addsd  %xmm4,%xmm3
movsd  %xmm3,0x10(%rbx)
mulsd  0x18(%r14),%xmm5
mulsd  0x18(%rbx),%xmm0
addsd  %xmm5,%xmm0
movsd  %xmm0,0x18(%rbx)
mulsd  %xmm2,%xmm2
mulsd  %xmm1,%xmm1
addsd  %xmm2,%xmm1
mulsd  %xmm3,%xmm3
addsd  %xmm1,%xmm3
mulsd  %xmm0,%xmm0
addsd  %xmm3,%xmm0
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     1360 <bot_quat_interpolate+0x230>
sqrtsd %xmm0,%xmm0
jmp    1365 <bot_quat_interpolate+0x235>
movsd  0x10(%rsp),%xmm3
divsd  %xmm4,%xmm3
divsd  %xmm4,%xmm0
mulsd  %xmm0,%xmm2
mulsd  %xmm3,%xmm1
addsd  %xmm2,%xmm1
movsd  %xmm1,(%rbx)
movsd  0x8(%r14),%xmm1
mulsd  %xmm0,%xmm1
movsd  0x8(%rbx),%xmm2
mulsd  %xmm3,%xmm2
addsd  %xmm1,%xmm2
movsd  %xmm2,0x8(%rbx)
movsd  0x10(%r14),%xmm1
mulsd  %xmm0,%xmm1
movsd  0x10(%rbx),%xmm2
mulsd  %xmm3,%xmm2
addsd  %xmm1,%xmm2
movsd  %xmm2,0x10(%rbx)
mulsd  0x18(%r14),%xmm0
mulsd  0x18(%rbx),%xmm3
addsd  %xmm0,%xmm3
movapd %xmm3,%xmm2
jmp    1398 <bot_quat_interpolate+0x268>
call   1050 <sqrt@plt>
movsd  0xcb3(%rip),%xmm2
divsd  %xmm0,%xmm2
movupd (%rbx),%xmm0
movapd %xmm2,%xmm1
unpcklpd %xmm2,%xmm1
mulpd  %xmm0,%xmm1
movupd %xmm1,(%rbx)
movsd  0x10(%rbx),%xmm0
mulsd  %xmm2,%xmm0
movsd  %xmm0,0x10(%rbx)
mulsd  0x18(%rbx),%xmm2
movsd  %xmm2,0x18(%rbx)
add    $0x38,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define void @bot_quat_interpolate(double* nocapture %0, double* nocapture %1, double %2, double* %3) {
%5 = load double, double* %0
%6 = load double, double* %1
%7 = getelementptr inbounds double, double* %0, i64 1
%8 = load double, double* %7
%9 = getelementptr inbounds double, double* %1, i64 1
%10 = load double, double* %9
%11 = fmul double %8, %10
%12 = tail call double @llvm.fmuladd.f64(double %5, double %6, double %11)
%13 = getelementptr inbounds double, double* %0, i64 2
%14 = load double, double* %13
%15 = getelementptr inbounds double, double* %1, i64 2
%16 = load double, double* %15
%17 = tail call double @llvm.fmuladd.f64(double %14, double %16, double %12)
%18 = getelementptr inbounds double, double* %0, i64 3
%19 = load double, double* %18
%20 = getelementptr inbounds double, double* %1, i64 3
%21 = load double, double* %20
%22 = tail call double @llvm.fmuladd.f64(double %19, double %21, double %17)
%23 = fcmp olt double %22, 0.000000e+00
br i1 %23, label %24, label %35
24: ; preds = %4
%25 = fneg double %5
store double %25, double* %3
%26 = load double, double* %7
%27 = fneg double %26
%28 = getelementptr inbounds double, double* %3, i64 1
store double %27, double* %28
%29 = load double, double* %13
%30 = fneg double %29
%31 = getelementptr inbounds double, double* %3, i64 2
store double %30, double* %31
%32 = load double, double* %18
%33 = fneg double %32
%34 = fneg double %22
br label %41
35: ; preds = %4
store double %5, double* %3
%36 = load double, double* %7
%37 = getelementptr inbounds double, double* %3, i64 1
store double %36, double* %37
%38 = load double, double* %13
%39 = getelementptr inbounds double, double* %3, i64 2
store double %38, double* %39
%40 = load double, double* %18
br label %41
41: ; preds = %35, %24
%42 = phi double [ %33, %24 ], [ %40, %35 ]
%43 = phi double [ %34, %24 ], [ %22, %35 ]
%44 = getelementptr inbounds double, double* %3, i64 3
store double %42, double* %44
%45 = fcmp ogt double %43, 1.000000e+00
%46 = select i1 %45, double 1.000000e+00, double %43
%47 = tail call double @acos(double %46)
%48 = tail call double @sin(double %47)
%49 = fsub double 1.000000e+00, %2
%50 = fmul double %49, %47
%51 = tail call double @sin(double %50)
%52 = fdiv double %51, %48
%53 = fmul double %47, %2
%54 = tail call double @sin(double %53)
%55 = fdiv double %54, %48
%56 = tail call double @llvm.fabs.f64(double %48)
%57 = fcmp olt double %56, 0x3EB0C6F7A0B5ED8D
%58 = load double, double* %3
%59 = load double, double* %1
br i1 %57, label %60, label %93
60: ; preds = %41
%61 = fmul double %59, %2
%62 = tail call double @llvm.fmuladd.f64(double %58, double %49, double %61)
store double %62, double* %3
%63 = getelementptr inbounds double, double* %3, i64 1
%64 = load double, double* %63
%65 = load double, double* %9
%66 = fmul double %65, %2
%67 = tail call double @llvm.fmuladd.f64(double %64, double %49, double %66)
store double %67, double* %63
%68 = getelementptr inbounds double, double* %3, i64 2
%69 = load double, double* %68
%70 = load double, double* %15
%71 = fmul double %70, %2
%72 = tail call double @llvm.fmuladd.f64(double %69, double %49, double %71)
store double %72, double* %68
%73 = load double, double* %44
%74 = load double, double* %20
%75 = fmul double %74, %2
%76 = tail call double @llvm.fmuladd.f64(double %73, double %49, double %75)
store double %76, double* %44
%77 = fmul double %67, %67
%78 = tail call double @llvm.fmuladd.f64(double %62, double %62, double %77)
%79 = tail call double @llvm.fmuladd.f64(double %72, double %72, double %78)
%80 = tail call double @llvm.fmuladd.f64(double %76, double %76, double %79)
%81 = tail call double @sqrt(double %80)
%82 = fdiv double 1.000000e+00, %81
%83 = bitcast double* %3 to <2 x double>*
%84 = load <2 x double>, <2 x double>* %83
%85 = insertelement <2 x double> poison, double %82, i64 0
%86 = shufflevector <2 x double> %85, <2 x double> poison, <2 x i32> zeroinitializer
%87 = fmul <2 x double> %84, %86
%88 = bitcast double* %3 to <2 x double>*
store <2 x double> %87, <2 x double>* %88
%89 = load double, double* %68
%90 = fmul double %82, %89
store double %90, double* %68
%91 = load double, double* %44
%92 = fmul double %82, %91
br label %110
93: ; preds = %41
%94 = fmul double %55, %59
%95 = tail call double @llvm.fmuladd.f64(double %58, double %52, double %94)
store double %95, double* %3
%96 = getelementptr inbounds double, double* %3, i64 1
%97 = load double, double* %96
%98 = load double, double* %9
%99 = fmul double %55, %98
%100 = tail call double @llvm.fmuladd.f64(double %97, double %52, double %99)
store double %100, double* %96
%101 = getelementptr inbounds double, double* %3, i64 2
%102 = load double, double* %101
%103 = load double, double* %15
%104 = fmul double %55, %103
%105 = tail call double @llvm.fmuladd.f64(double %102, double %52, double %104)
store double %105, double* %101
%106 = load double, double* %44
%107 = load double, double* %20
%108 = fmul double %55, %107
%109 = tail call double @llvm.fmuladd.f64(double %106, double %52, double %108)
br label %110
110: ; preds = %93, %60
%111 = phi double [ %109, %93 ], [ %92, %60 ]
store double %111, double* %44
ret void
}