#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 sqrt(double);
void cquat_from_matrix_t(double *q, const double *m) {
  double m11 = m[((1) - 1) * (3) + ((1) - 1)];
  double m22 = m[((2) - 1) * (3) + ((2) - 1)];
  double m33 = m[((3) - 1) * (3) + ((3) - 1)];
  double s;
  s = 1.0 + m11 + m22 + m33;
  if (s > 0.1) {
    s = 2.0 * sqrt(s);
    q[3] = s / 4.0;
    q[0] =
        (m[((2) - 1) * (3) + ((3) - 1)] - m[((3) - 1) * (3) + ((2) - 1)]) / s;
    q[1] =
        (m[((3) - 1) * (3) + ((1) - 1)] - m[((1) - 1) * (3) + ((3) - 1)]) / s;
    q[2] =
        (m[((1) - 1) * (3) + ((2) - 1)] - m[((2) - 1) * (3) + ((1) - 1)]) / s;
  } else if ((m11 > m22) && (m11 > m33)) {
    s = 2.0 * sqrt(1.0 + m11 - m22 - m33);
    q[0] = s / 4.0;
    q[1] =
        (m[((2) - 1) * (3) + ((1) - 1)] + m[((1) - 1) * (3) + ((2) - 1)]) / s;
    q[2] =
        (m[((3) - 1) * (3) + ((1) - 1)] + m[((1) - 1) * (3) + ((3) - 1)]) / s;
    q[3] =
        (m[((2) - 1) * (3) + ((3) - 1)] - m[((3) - 1) * (3) + ((2) - 1)]) / s;
  } else if ((m22 > m11) && (m22 > m33)) {
    s = 2.0 * sqrt(1.0 - m11 + m22 - m33);
    q[1] = s / 4.0;
    q[0] =
        (m[((2) - 1) * (3) + ((1) - 1)] + m[((1) - 1) * (3) + ((2) - 1)]) / s;
    q[2] =
        (m[((3) - 1) * (3) + ((2) - 1)] + m[((2) - 1) * (3) + ((3) - 1)]) / s;
    q[3] =
        (m[((3) - 1) * (3) + ((1) - 1)] - m[((1) - 1) * (3) + ((3) - 1)]) / s;
  } else if ((m33 > m11) && (m33 > m22)) {
    s = 2.0 * sqrt(1.0 - m11 - m22 + m33);
    q[2] = s / 4.0;
    q[3] =
        (m[((3) - 1) * (3) + ((1) - 1)] + m[((1) - 1) * (3) + ((3) - 1)]) / s;
    q[0] =
        (m[((3) - 1) * (3) + ((2) - 1)] + m[((2) - 1) * (3) + ((3) - 1)]) / s;
    q[1] =
        (m[((1) - 1) * (3) + ((2) - 1)] - m[((2) - 1) * (3) + ((1) - 1)]) / s;
  }
}


x86 assembly (clang, -O0):
<cquat_from_matrix_t>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movsd  0x20(%rax),%xmm0
movsd  %xmm0,-0x20(%rbp)
mov    -0x10(%rbp),%rax
movsd  0x40(%rax),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  0xeb7(%rip),%xmm0
addsd  -0x18(%rbp),%xmm0
addsd  -0x20(%rbp),%xmm0
addsd  -0x28(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x30(%rbp),%xmm0
movsd  0xe8e(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    1218 <cquat_from_matrix_t+0x108>
movsd  -0x30(%rbp),%xmm0
call   1030 <sqrt@plt>
movaps %xmm0,%xmm1
movsd  0xe87(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x30(%rbp),%xmm0
movsd  0xe69(%rip),%xmm1
divsd  %xmm1,%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,0x18(%rax)
mov    -0x10(%rbp),%rax
movsd  0x28(%rax),%xmm0
mov    -0x10(%rbp),%rax
subsd  0x38(%rax),%xmm0
divsd  -0x30(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,(%rax)
mov    -0x10(%rbp),%rax
movsd  0x30(%rax),%xmm0
mov    -0x10(%rbp),%rax
subsd  0x10(%rax),%xmm0
divsd  -0x30(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,0x8(%rax)
mov    -0x10(%rbp),%rax
movsd  0x8(%rax),%xmm0
mov    -0x10(%rbp),%rax
subsd  0x18(%rax),%xmm0
divsd  -0x30(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,0x10(%rax)
jmp    148c <cquat_from_matrix_t+0x37c>
movsd  -0x18(%rbp),%xmm0
ucomisd -0x20(%rbp),%xmm0
jbe    12e6 <cquat_from_matrix_t+0x1d6>
movsd  -0x18(%rbp),%xmm0
ucomisd -0x28(%rbp),%xmm0
jbe    12e6 <cquat_from_matrix_t+0x1d6>
movsd  0xdc8(%rip),%xmm0
addsd  -0x18(%rbp),%xmm0
subsd  -0x20(%rbp),%xmm0
subsd  -0x28(%rbp),%xmm0
call   1030 <sqrt@plt>
movaps %xmm0,%xmm1
movsd  0xdb9(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x30(%rbp),%xmm0
movsd  0xd9b(%rip),%xmm1
divsd  %xmm1,%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,(%rax)
mov    -0x10(%rbp),%rax
movsd  0x18(%rax),%xmm0
mov    -0x10(%rbp),%rax
addsd  0x8(%rax),%xmm0
divsd  -0x30(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,0x8(%rax)
mov    -0x10(%rbp),%rax
movsd  0x30(%rax),%xmm0
mov    -0x10(%rbp),%rax
addsd  0x10(%rax),%xmm0
divsd  -0x30(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,0x10(%rax)
mov    -0x10(%rbp),%rax
movsd  0x28(%rax),%xmm0
mov    -0x10(%rbp),%rax
subsd  0x38(%rax),%xmm0
divsd  -0x30(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,0x18(%rax)
jmp    1487 <cquat_from_matrix_t+0x377>
movsd  -0x20(%rbp),%xmm0
ucomisd -0x18(%rbp),%xmm0
jbe    13b4 <cquat_from_matrix_t+0x2a4>
movsd  -0x20(%rbp),%xmm0
ucomisd -0x28(%rbp),%xmm0
jbe    13b4 <cquat_from_matrix_t+0x2a4>
movsd  0xcfa(%rip),%xmm0
subsd  -0x18(%rbp),%xmm0
addsd  -0x20(%rbp),%xmm0
subsd  -0x28(%rbp),%xmm0
call   1030 <sqrt@plt>
movaps %xmm0,%xmm1
movsd  0xceb(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x30(%rbp),%xmm0
movsd  0xccd(%rip),%xmm1
divsd  %xmm1,%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,0x8(%rax)
mov    -0x10(%rbp),%rax
movsd  0x18(%rax),%xmm0
mov    -0x10(%rbp),%rax
addsd  0x8(%rax),%xmm0
divsd  -0x30(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,(%rax)
mov    -0x10(%rbp),%rax
movsd  0x38(%rax),%xmm0
mov    -0x10(%rbp),%rax
addsd  0x28(%rax),%xmm0
divsd  -0x30(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,0x10(%rax)
mov    -0x10(%rbp),%rax
movsd  0x30(%rax),%xmm0
mov    -0x10(%rbp),%rax
subsd  0x10(%rax),%xmm0
divsd  -0x30(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,0x18(%rax)
jmp    1482 <cquat_from_matrix_t+0x372>
movsd  -0x28(%rbp),%xmm0
ucomisd -0x18(%rbp),%xmm0
jbe    147d <cquat_from_matrix_t+0x36d>
movsd  -0x28(%rbp),%xmm0
ucomisd -0x20(%rbp),%xmm0
jbe    147d <cquat_from_matrix_t+0x36d>
movsd  0xc2c(%rip),%xmm0
subsd  -0x18(%rbp),%xmm0
subsd  -0x20(%rbp),%xmm0
addsd  -0x28(%rbp),%xmm0
call   1030 <sqrt@plt>
movaps %xmm0,%xmm1
movsd  0xc1d(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x30(%rbp),%xmm0
movsd  0xbff(%rip),%xmm1
divsd  %xmm1,%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,0x10(%rax)
mov    -0x10(%rbp),%rax
movsd  0x30(%rax),%xmm0
mov    -0x10(%rbp),%rax
addsd  0x10(%rax),%xmm0
divsd  -0x30(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,0x18(%rax)
mov    -0x10(%rbp),%rax
movsd  0x38(%rax),%xmm0
mov    -0x10(%rbp),%rax
addsd  0x28(%rax),%xmm0
divsd  -0x30(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,(%rax)
mov    -0x10(%rbp),%rax
movsd  0x8(%rax),%xmm0
mov    -0x10(%rbp),%rax
subsd  0x18(%rax),%xmm0
divsd  -0x30(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,0x8(%rax)
jmp    1482 <cquat_from_matrix_t+0x372>
jmp    1487 <cquat_from_matrix_t+0x377>
jmp    148c <cquat_from_matrix_t+0x37c>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cquat_from_matrix_t>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
movsd  (%rsi),%xmm4
movsd  0x20(%rsi),%xmm3
movsd  0x40(%rsi),%xmm2
movsd  0xed0(%rip),%xmm0
addsd  %xmm4,%xmm0
movapd %xmm0,%xmm1
addsd  %xmm3,%xmm1
addsd  %xmm2,%xmm1
ucomisd 0xec0(%rip),%xmm1
jbe    115d <cquat_from_matrix_t+0x4d>
xorpd  %xmm0,%xmm0
ucomisd %xmm0,%xmm1
jb     11c7 <cquat_from_matrix_t+0xb7>
xorps  %xmm0,%xmm0
sqrtsd %xmm1,%xmm0
jmp    11d0 <cquat_from_matrix_t+0xc0>
ucomisd %xmm3,%xmm4
jbe    1188 <cquat_from_matrix_t+0x78>
ucomisd %xmm2,%xmm4
jbe    1188 <cquat_from_matrix_t+0x78>
subsd  %xmm3,%xmm0
subsd  %xmm2,%xmm0
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     1260 <cquat_from_matrix_t+0x150>
sqrtsd %xmm0,%xmm0
jmp    1265 <cquat_from_matrix_t+0x155>
ucomisd %xmm4,%xmm3
jbe    1221 <cquat_from_matrix_t+0x111>
ucomisd %xmm2,%xmm3
jbe    1221 <cquat_from_matrix_t+0x111>
movsd  0xe5c(%rip),%xmm0
subsd  %xmm4,%xmm0
addsd  %xmm3,%xmm0
subsd  %xmm2,%xmm0
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     12b6 <cquat_from_matrix_t+0x1a6>
sqrtsd %xmm0,%xmm0
jmp    12bb <cquat_from_matrix_t+0x1ab>
movapd %xmm1,%xmm0
call   1030 <sqrt@plt>
addsd  %xmm0,%xmm0
movsd  0xe34(%rip),%xmm1
mulsd  %xmm0,%xmm1
movsd  %xmm1,0x18(%r14)
movsd  0x28(%rbx),%xmm1
subsd  0x38(%rbx),%xmm1
divsd  %xmm0,%xmm1
movsd  %xmm1,(%r14)
movsd  0x30(%rbx),%xmm1
subsd  0x10(%rbx),%xmm1
divsd  %xmm0,%xmm1
movsd  %xmm1,0x8(%r14)
mov    $0x2,%eax
mov    $0x3,%ecx
mov    $0x1,%edx
jmp    135a <cquat_from_matrix_t+0x24a>
ucomisd %xmm4,%xmm2
jbe    136e <cquat_from_matrix_t+0x25e>
ucomisd %xmm3,%xmm2
jbe    136e <cquat_from_matrix_t+0x25e>
movsd  0xdc3(%rip),%xmm0
subsd  %xmm4,%xmm0
subsd  %xmm3,%xmm0
addsd  %xmm2,%xmm0
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     1309 <cquat_from_matrix_t+0x1f9>
sqrtsd %xmm0,%xmm0
jmp    130e <cquat_from_matrix_t+0x1fe>
call   1030 <sqrt@plt>
addsd  %xmm0,%xmm0
movsd  0xd9f(%rip),%xmm1
mulsd  %xmm0,%xmm1
movsd  %xmm1,(%r14)
movsd  0x18(%rbx),%xmm1
addsd  0x8(%rbx),%xmm1
divsd  %xmm0,%xmm1
movsd  %xmm1,0x8(%r14)
movsd  0x30(%rbx),%xmm1
addsd  0x10(%rbx),%xmm1
divsd  %xmm0,%xmm1
movsd  %xmm1,0x10(%r14)
mov    $0x3,%eax
mov    $0x7,%ecx
mov    $0x5,%edx
jmp    135a <cquat_from_matrix_t+0x24a>
call   1030 <sqrt@plt>
addsd  %xmm0,%xmm0
movsd  0xd49(%rip),%xmm1
mulsd  %xmm0,%xmm1
movsd  %xmm1,0x8(%r14)
movsd  0x18(%rbx),%xmm1
addsd  0x8(%rbx),%xmm1
divsd  %xmm0,%xmm1
movsd  %xmm1,(%r14)
movsd  0x38(%rbx),%xmm1
addsd  0x28(%rbx),%xmm1
divsd  %xmm0,%xmm1
movsd  %xmm1,0x10(%r14)
mov    $0x3,%eax
mov    $0x2,%ecx
mov    $0x6,%edx
jmp    135a <cquat_from_matrix_t+0x24a>
call   1030 <sqrt@plt>
addsd  %xmm0,%xmm0
movsd  0xcf6(%rip),%xmm1
mulsd  %xmm0,%xmm1
movsd  %xmm1,0x10(%r14)
movsd  0x30(%rbx),%xmm1
addsd  0x10(%rbx),%xmm1
divsd  %xmm0,%xmm1
movsd  %xmm1,0x18(%r14)
movsd  0x38(%rbx),%xmm1
addsd  0x28(%rbx),%xmm1
divsd  %xmm0,%xmm1
movsd  %xmm1,(%r14)
mov    $0x3,%ecx
mov    $0x1,%edx
mov    $0x1,%eax
movsd  (%rbx,%rdx,8),%xmm1
subsd  (%rbx,%rcx,8),%xmm1
divsd  %xmm0,%xmm1
movsd  %xmm1,(%r14,%rax,8)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

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