void build_rotmatrix(double m[4][4], double quat[4]) {
  m[0][0] = ((quat[3]) * (quat[3])) + ((quat[0]) * (quat[0])) -
            ((quat[1]) * (quat[1])) - ((quat[2]) * (quat[2]));
  m[0][1] = 2.0 * (quat[0] * quat[1] - quat[2] * quat[3]);
  m[0][2] = 2.0 * (quat[2] * quat[0] + quat[1] * quat[3]);
  m[0][3] = 0.0;
  m[1][0] = 2.0 * (quat[0] * quat[1] + quat[2] * quat[3]);
  m[1][1] = ((quat[3]) * (quat[3])) - ((quat[0]) * (quat[0])) +
            ((quat[1]) * (quat[1])) - ((quat[2]) * (quat[2]));
  m[1][2] = 2.0 * (quat[1] * quat[2] - quat[0] * quat[3]);
  m[1][3] = 0.0;
  m[2][0] = 2.0 * (quat[2] * quat[0] - quat[1] * quat[3]);
  m[2][1] = 2.0 * (quat[1] * quat[2] + quat[0] * quat[3]);
  m[2][2] = ((quat[3]) * (quat[3])) - ((quat[0]) * (quat[0])) -
            ((quat[1]) * (quat[1])) + ((quat[2]) * (quat[2]));
  m[2][3] = 0.0;
  m[3][0] = 0.0;
  m[3][1] = 0.0;
  m[3][2] = 0.0;
  m[3][3] = 1.0;
}


x86 assembly (clang, -O0):
<build_rotmatrix>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsd  0x18(%rax),%xmm0
mov    -0x10(%rbp),%rax
movsd  0x18(%rax),%xmm2
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm1
mov    -0x10(%rbp),%rax
mulsd  (%rax),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x10(%rbp),%rax
movsd  0x8(%rax),%xmm1
mov    -0x10(%rbp),%rax
movsd  0x8(%rax),%xmm2
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
mov    -0x10(%rbp),%rax
movsd  0x10(%rax),%xmm0
mov    -0x10(%rbp),%rax
movsd  0x10(%rax),%xmm2
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,(%rax)
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm1
mov    -0x10(%rbp),%rax
movsd  0x8(%rax),%xmm2
mov    -0x10(%rbp),%rax
movsd  0x10(%rax),%xmm0
mov    -0x10(%rbp),%rax
mulsd  0x18(%rax),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  0xe1e(%rip),%xmm0
mulsd  %xmm1,%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,0x8(%rax)
mov    -0x10(%rbp),%rax
movsd  0x10(%rax),%xmm1
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm2
mov    -0x10(%rbp),%rax
movsd  0x8(%rax),%xmm0
mov    -0x10(%rbp),%rax
mulsd  0x18(%rax),%xmm0
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  0xdde(%rip),%xmm0
mulsd  %xmm1,%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,0x10(%rax)
mov    -0x8(%rbp),%rax
xorps  %xmm0,%xmm0
movsd  %xmm0,0x18(%rax)
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm1
mov    -0x10(%rbp),%rax
movsd  0x8(%rax),%xmm2
mov    -0x10(%rbp),%rax
movsd  0x10(%rax),%xmm0
mov    -0x10(%rbp),%rax
mulsd  0x18(%rax),%xmm0
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  0xd92(%rip),%xmm0
mulsd  %xmm1,%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,0x20(%rax)
mov    -0x10(%rbp),%rax
movsd  0x18(%rax),%xmm0
mov    -0x10(%rbp),%rax
movsd  0x18(%rax),%xmm2
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm1
mov    -0x10(%rbp),%rax
mulsd  (%rax),%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x10(%rbp),%rax
movsd  0x8(%rax),%xmm1
mov    -0x10(%rbp),%rax
movsd  0x8(%rax),%xmm2
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
mov    -0x10(%rbp),%rax
movsd  0x10(%rax),%xmm0
mov    -0x10(%rbp),%rax
movsd  0x10(%rax),%xmm2
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,0x28(%rax)
mov    -0x10(%rbp),%rax
movsd  0x8(%rax),%xmm1
mov    -0x10(%rbp),%rax
movsd  0x10(%rax),%xmm2
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x10(%rbp),%rax
mulsd  0x18(%rax),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  0xca6(%rip),%xmm0
mulsd  %xmm1,%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,0x30(%rax)
mov    -0x8(%rbp),%rax
xorps  %xmm0,%xmm0
movsd  %xmm0,0x38(%rax)
mov    -0x10(%rbp),%rax
movsd  0x10(%rax),%xmm1
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm2
mov    -0x10(%rbp),%rax
movsd  0x8(%rax),%xmm0
mov    -0x10(%rbp),%rax
mulsd  0x18(%rax),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  0xc43(%rip),%xmm0
mulsd  %xmm1,%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,0x40(%rax)
mov    -0x10(%rbp),%rax
movsd  0x8(%rax),%xmm1
mov    -0x10(%rbp),%rax
movsd  0x10(%rax),%xmm2
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x10(%rbp),%rax
mulsd  0x18(%rax),%xmm0
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  0xc03(%rip),%xmm0
mulsd  %xmm1,%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,0x48(%rax)
mov    -0x10(%rbp),%rax
movsd  0x18(%rax),%xmm0
mov    -0x10(%rbp),%rax
movsd  0x18(%rax),%xmm2
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm1
mov    -0x10(%rbp),%rax
mulsd  (%rax),%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x10(%rbp),%rax
movsd  0x8(%rax),%xmm1
mov    -0x10(%rbp),%rax
movsd  0x8(%rax),%xmm2
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
mov    -0x10(%rbp),%rax
movsd  0x10(%rax),%xmm0
mov    -0x10(%rbp),%rax
movsd  0x10(%rax),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,0x50(%rax)
mov    -0x8(%rbp),%rax
xorps  %xmm0,%xmm0
movsd  %xmm0,0x58(%rax)
mov    -0x8(%rbp),%rax
xorps  %xmm0,%xmm0
movsd  %xmm0,0x60(%rax)
mov    -0x8(%rbp),%rax
xorps  %xmm0,%xmm0
movsd  %xmm0,0x68(%rax)
mov    -0x8(%rbp),%rax
xorps  %xmm0,%xmm0
movsd  %xmm0,0x70(%rax)
mov    -0x8(%rbp),%rax
movsd  0xb1d(%rip),%xmm0
movsd  %xmm0,0x78(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<build_rotmatrix>:
movsd  0x18(%rsi),%xmm0
movsd  (%rsi),%xmm1
movsd  0x8(%rsi),%xmm2
mulsd  %xmm1,%xmm1
mulsd  %xmm0,%xmm0
addsd  %xmm1,%xmm0
mulsd  %xmm2,%xmm2
subsd  %xmm2,%xmm0
movsd  0x10(%rsi),%xmm1
mulsd  %xmm1,%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,(%rdi)
movsd  0x18(%rsi),%xmm0
mulsd  0x10(%rsi),%xmm0
movsd  (%rsi),%xmm1
mulsd  0x8(%rsi),%xmm1
subsd  %xmm0,%xmm1
addsd  %xmm1,%xmm1
movsd  %xmm1,0x8(%rdi)
movsd  0x8(%rsi),%xmm0
movsd  0x10(%rsi),%xmm1
mulsd  0x18(%rsi),%xmm0
mulsd  (%rsi),%xmm1
addsd  %xmm0,%xmm1
addsd  %xmm1,%xmm1
movsd  %xmm1,0x10(%rdi)
movq   $0x0,0x18(%rdi)
movsd  0x10(%rsi),%xmm0
mulsd  0x18(%rsi),%xmm0
movsd  (%rsi),%xmm1
mulsd  0x8(%rsi),%xmm1
addsd  %xmm0,%xmm1
addsd  %xmm1,%xmm1
movsd  %xmm1,0x20(%rdi)
movsd  0x18(%rsi),%xmm0
movsd  (%rsi),%xmm1
movsd  0x8(%rsi),%xmm2
mulsd  %xmm1,%xmm1
mulsd  %xmm0,%xmm0
subsd  %xmm1,%xmm0
mulsd  %xmm2,%xmm2
addsd  %xmm0,%xmm2
movsd  0x10(%rsi),%xmm0
mulsd  %xmm0,%xmm0
subsd  %xmm0,%xmm2
movsd  %xmm2,0x28(%rdi)
movsd  0x8(%rsi),%xmm0
movsd  0x18(%rsi),%xmm1
mulsd  (%rsi),%xmm1
mulsd  0x10(%rsi),%xmm0
subsd  %xmm1,%xmm0
addsd  %xmm0,%xmm0
movsd  %xmm0,0x30(%rdi)
movq   $0x0,0x38(%rdi)
movsd  0x18(%rsi),%xmm0
mulsd  0x8(%rsi),%xmm0
movsd  0x10(%rsi),%xmm1
mulsd  (%rsi),%xmm1
subsd  %xmm0,%xmm1
addsd  %xmm1,%xmm1
movsd  %xmm1,0x40(%rdi)
movsd  (%rsi),%xmm0
movsd  0x8(%rsi),%xmm1
mulsd  0x18(%rsi),%xmm0
mulsd  0x10(%rsi),%xmm1
addsd  %xmm0,%xmm1
addsd  %xmm1,%xmm1
movsd  %xmm1,0x48(%rdi)
movsd  0x18(%rsi),%xmm0
movsd  (%rsi),%xmm1
movsd  0x8(%rsi),%xmm2
mulsd  %xmm1,%xmm1
mulsd  %xmm0,%xmm0
subsd  %xmm1,%xmm0
mulsd  %xmm2,%xmm2
subsd  %xmm2,%xmm0
movsd  0x10(%rsi),%xmm1
mulsd  %xmm1,%xmm1
addsd  %xmm0,%xmm1
movsd  %xmm1,0x50(%rdi)
xorpd  %xmm0,%xmm0
movupd %xmm0,0x58(%rdi)
movupd %xmm0,0x68(%rdi)
movabs $0x3ff0000000000000,%rax
mov    %rax,0x78(%rdi)
ret

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

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