#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 */
int /*<<< orphan*/ decompose_cartesian_vectors(double **, double *, double *,
                                               double *);
int /*<<< orphan*/ test_double(int, double, double const, char *);
void test_decompose_cartesian_vectors() {
  double b[3][3];
  b[0][0] = 1;
  b[0][1] = 2;
  b[0][2] = 0;
  b[1][0] = 0;
  b[1][1] = 1;
  b[1][2] = 0;
  b[2][0] = 1;
  b[2][1] = 1;
  b[2][2] = 1;
  double v1[3], v2[3], v3[3];
  decompose_cartesian_vectors(b, v1, v2, v3);
  const double tol = 1E-6;
  double c1[3], c2[3], c3[3];
  for (int i = 0; i < 3; ++i) {
    c1[i] = c2[i] = c3[i] = 0;
    for (int j = 0; j < 3; ++j) {
      c1[i] += v1[j] * b[j][i];
      c2[i] += v2[j] * b[j][i];
      c3[i] += v3[j] * b[j][i];
    }
  }
  test_double(1, c1[0], tol, "DCV1_0");
  test_double(0, c1[1], tol, "DCV1_1");
  test_double(0, c1[2], tol, "DCV1_2");
  test_double(0, c2[0], tol, "DCV2_0");
  test_double(1, c2[1], tol, "DCV2_1");
  test_double(0, c2[2], tol, "DCV2_2");
  test_double(0, c3[0], tol, "DCV3_0");
  test_double(0, c3[1], tol, "DCV3_1");
  test_double(1, c3[2], tol, "DCV3_2");
}


x86 assembly (clang, -O0):
<test_decompose_cartesian_vectors>:
push   %rbp
mov    %rsp,%rbp
sub    $0x120,%rsp
movsd  0xed5(%rip),%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  0xed0(%rip),%xmm0
movsd  %xmm0,-0x48(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x40(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  0xeab(%rip),%xmm0
movsd  %xmm0,-0x30(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  0xe96(%rip),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  0xe89(%rip),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  0xe7c(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
lea    -0x50(%rbp),%rdi
lea    -0x70(%rbp),%rsi
lea    -0x90(%rbp),%rdx
lea    -0xb0(%rbp),%rcx
call   1030 <decompose_cartesian_vectors@plt>
movsd  0xe4c(%rip),%xmm0
movsd  %xmm0,-0xb8(%rbp)
ff
movl   $0x0,-0x114(%rbp)
cmpl   $0x3,-0x114(%rbp)
jge    133a <test_decompose_cartesian_vectors+0x21a>
movslq -0x114(%rbp),%rax
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x110(%rbp,%rax,8)
ff ff
movslq -0x114(%rbp),%rax
xorps  %xmm0,%xmm0
movsd  %xmm0,-0xf0(%rbp,%rax,8)
ff ff
movslq -0x114(%rbp),%rax
xorps  %xmm0,%xmm0
movsd  %xmm0,-0xd0(%rbp,%rax,8)
ff ff
movl   $0x0,-0x118(%rbp)
cmpl   $0x3,-0x118(%rbp)
jge    1321 <test_decompose_cartesian_vectors+0x201>
movslq -0x118(%rbp),%rax
movsd  -0x70(%rbp,%rax,8),%xmm0
movslq -0x118(%rbp),%rcx
lea    -0x50(%rbp),%rax
imul   $0x18,%rcx,%rcx
add    %rcx,%rax
movslq -0x114(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm2
movslq -0x114(%rbp),%rax
movsd  -0xd0(%rbp,%rax,8),%xmm1
ff ff
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0xd0(%rbp,%rax,8)
ff ff
movslq -0x118(%rbp),%rax
movsd  -0x90(%rbp,%rax,8),%xmm0
ff ff
movslq -0x118(%rbp),%rcx
lea    -0x50(%rbp),%rax
imul   $0x18,%rcx,%rcx
add    %rcx,%rax
movslq -0x114(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm2
movslq -0x114(%rbp),%rax
movsd  -0xf0(%rbp,%rax,8),%xmm1
ff ff
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0xf0(%rbp,%rax,8)
ff ff
movslq -0x118(%rbp),%rax
movsd  -0xb0(%rbp,%rax,8),%xmm0
ff ff
movslq -0x118(%rbp),%rcx
lea    -0x50(%rbp),%rax
imul   $0x18,%rcx,%rcx
add    %rcx,%rax
movslq -0x114(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm2
movslq -0x114(%rbp),%rax
movsd  -0x110(%rbp,%rax,8),%xmm1
ff ff
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x110(%rbp,%rax,8)
ff ff
mov    -0x118(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x118(%rbp)
jmp    1216 <test_decompose_cartesian_vectors+0xf6>
jmp    1326 <test_decompose_cartesian_vectors+0x206>
mov    -0x114(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x114(%rbp)
jmp    11c6 <test_decompose_cartesian_vectors+0xa6>
movsd  -0xd0(%rbp),%xmm0
ff
mov    $0x1,%edi
movsd  0xcb1(%rip),%xmm1
lea    0xcc2(%rip),%rsi
call   1040 <test_double@plt>
movsd  -0xc8(%rbp),%xmm0
ff
xor    %edi,%edi
movsd  0xc93(%rip),%xmm1
lea    0xcab(%rip),%rsi
call   1040 <test_double@plt>
movsd  -0xc0(%rbp),%xmm0
ff
xor    %edi,%edi
movsd  0xc75(%rip),%xmm1
lea    0xc94(%rip),%rsi
call   1040 <test_double@plt>
movsd  -0xf0(%rbp),%xmm0
ff
xor    %edi,%edi
movsd  0xc57(%rip),%xmm1
lea    0xc7d(%rip),%rsi
call   1040 <test_double@plt>
movsd  -0xe8(%rbp),%xmm0
ff
mov    $0x1,%edi
movsd  0xc36(%rip),%xmm1
lea    0xc63(%rip),%rsi
call   1040 <test_double@plt>
movsd  -0xe0(%rbp),%xmm0
ff
xor    %edi,%edi
movsd  0xc18(%rip),%xmm1
lea    0xc4c(%rip),%rsi
call   1040 <test_double@plt>
movsd  -0x110(%rbp),%xmm0
ff
xor    %edi,%edi
movsd  0xbfa(%rip),%xmm1
lea    0xc35(%rip),%rsi
call   1040 <test_double@plt>
movsd  -0x108(%rbp),%xmm0
ff
xor    %edi,%edi
movsd  0xbdc(%rip),%xmm1
lea    0xc1e(%rip),%rsi
call   1040 <test_double@plt>
movsd  -0x100(%rbp),%xmm0
ff
mov    $0x1,%edi
movsd  0xbbb(%rip),%xmm1
lea    0xc04(%rip),%rsi
call   1040 <test_double@plt>
add    $0x120,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_decompose_cartesian_vectors>:
sub    $0xe8,%rsp
movaps 0xed2(%rip),%xmm0
movaps %xmm0,0x40(%rsp)
xorps  %xmm0,%xmm0
movaps %xmm0,0x50(%rsp)
movsd  0xedd(%rip),%xmm0
movaps %xmm0,0x60(%rsp)
movaps 0xec1(%rip),%xmm0
movaps %xmm0,0x70(%rsp)
movabs $0x3ff0000000000000,%rax
mov    %rax,0x80(%rsp)
lea    0x40(%rsp),%rdi
lea    0xd0(%rsp),%rsi
lea    0xb0(%rsp),%rdx
lea    0x90(%rsp),%rcx
call   1030 <decompose_cartesian_vectors@plt>
movsd  0xd0(%rsp),%xmm12
movsd  0xd8(%rsp),%xmm9
movsd  0x40(%rsp),%xmm0
movsd  0x48(%rsp),%xmm7
movapd %xmm12,%xmm4
mulsd  %xmm0,%xmm4
xorpd  %xmm8,%xmm8
addsd  %xmm8,%xmm4
movsd  0xb0(%rsp),%xmm2
movsd  0xb8(%rsp),%xmm10
movapd %xmm2,%xmm5
mulsd  %xmm0,%xmm5
addsd  %xmm8,%xmm5
movsd  0x90(%rsp),%xmm6
movsd  0x98(%rsp),%xmm11
mulsd  %xmm6,%xmm0
addsd  %xmm8,%xmm0
movsd  0x58(%rsp),%xmm3
movapd %xmm9,%xmm1
mulsd  %xmm3,%xmm1
addsd  %xmm4,%xmm1
movapd %xmm10,%xmm4
mulsd  %xmm3,%xmm4
addsd  %xmm5,%xmm4
mulsd  %xmm11,%xmm3
addsd  %xmm0,%xmm3
movsd  0xe0(%rsp),%xmm15
movsd  0x70(%rsp),%xmm5
movapd %xmm15,%xmm0
mulsd  %xmm5,%xmm0
addsd  %xmm1,%xmm0
movsd  0xc0(%rsp),%xmm14
movapd %xmm14,%xmm1
mulsd  %xmm5,%xmm1
addsd  %xmm4,%xmm1
movsd  %xmm1,0x30(%rsp)
movsd  0xa0(%rsp),%xmm13
mulsd  %xmm13,%xmm5
addsd  %xmm3,%xmm5
movsd  %xmm5,0x38(%rsp)
movapd %xmm12,%xmm1
mulsd  %xmm7,%xmm1
addsd  %xmm8,%xmm1
movsd  0x60(%rsp),%xmm3
movapd %xmm9,%xmm4
mulsd  %xmm3,%xmm4
addsd  %xmm1,%xmm4
movapd %xmm2,%xmm1
mulsd  %xmm7,%xmm1
addsd  %xmm8,%xmm1
movapd %xmm10,%xmm5
mulsd  %xmm3,%xmm5
addsd  %xmm1,%xmm5
mulsd  %xmm6,%xmm7
addsd  %xmm8,%xmm7
mulsd  %xmm11,%xmm3
addsd  %xmm7,%xmm3
movsd  0x78(%rsp),%xmm1
movapd %xmm15,%xmm7
mulsd  %xmm1,%xmm7
addsd  %xmm4,%xmm7
movsd  %xmm7,0x10(%rsp)
movapd %xmm14,%xmm4
mulsd  %xmm1,%xmm4
addsd  %xmm5,%xmm4
movsd  %xmm4,0x20(%rsp)
mulsd  %xmm13,%xmm1
addsd  %xmm3,%xmm1
movsd  %xmm1,0x28(%rsp)
movsd  0x50(%rsp),%xmm1
mulsd  %xmm1,%xmm12
mulsd  %xmm1,%xmm2
mulsd  %xmm1,%xmm6
addsd  %xmm8,%xmm12
addsd  %xmm8,%xmm2
addsd  %xmm8,%xmm6
movsd  0x68(%rsp),%xmm1
mulsd  %xmm1,%xmm9
addsd  %xmm12,%xmm9
mulsd  %xmm1,%xmm10
addsd  %xmm2,%xmm10
mulsd  %xmm1,%xmm11
addsd  %xmm6,%xmm11
movsd  0x80(%rsp),%xmm1
mulsd  %xmm1,%xmm15
addsd  %xmm9,%xmm15
movsd  %xmm15,(%rsp)
mulsd  %xmm1,%xmm14
addsd  %xmm10,%xmm14
movsd  %xmm14,0x8(%rsp)
mulsd  %xmm1,%xmm13
addsd  %xmm11,%xmm13
movsd  %xmm13,0x18(%rsp)
lea    0xcad(%rip),%rsi
movsd  0xc9d(%rip),%xmm1
mov    $0x1,%edi
call   1040 <test_double@plt>
lea    0xc9b(%rip),%rsi
xor    %edi,%edi
movsd  0x10(%rsp),%xmm0
movsd  0xc7c(%rip),%xmm1
call   1040 <test_double@plt>
lea    0xc86(%rip),%rsi
xor    %edi,%edi
movsd  (%rsp),%xmm0
movsd  0xc61(%rip),%xmm1
call   1040 <test_double@plt>
lea    0xc72(%rip),%rsi
xor    %edi,%edi
movsd  0x30(%rsp),%xmm0
movsd  0xc45(%rip),%xmm1
call   1040 <test_double@plt>
lea    0xc5d(%rip),%rsi
mov    $0x1,%edi
movsd  0x20(%rsp),%xmm0
movsd  0xc26(%rip),%xmm1
call   1040 <test_double@plt>
lea    0xc45(%rip),%rsi
xor    %edi,%edi
movsd  0x8(%rsp),%xmm0
movsd  0xc0a(%rip),%xmm1
call   1040 <test_double@plt>
lea    0xc30(%rip),%rsi
xor    %edi,%edi
movsd  0x38(%rsp),%xmm0
movsd  0xbee(%rip),%xmm1
call   1040 <test_double@plt>
lea    0xc1b(%rip),%rsi
xor    %edi,%edi
movsd  0x28(%rsp),%xmm0
movsd  0xbd2(%rip),%xmm1
call   1040 <test_double@plt>
lea    0xc06(%rip),%rsi
mov    $0x1,%edi
movsd  0x18(%rsp),%xmm0
movsd  0xbb3(%rip),%xmm1
call   1040 <test_double@plt>
add    $0xe8,%rsp
ret

LLVM IR (-O0):
@.str = [7 x i8] c"DCV1_0\00"
@.str.1 = [7 x i8] c"DCV1_1\00"
@.str.2 = [7 x i8] c"DCV1_2\00"
@.str.3 = [7 x i8] c"DCV2_0\00"
@.str.4 = [7 x i8] c"DCV2_1\00"
@.str.5 = [7 x i8] c"DCV2_2\00"
@.str.6 = [7 x i8] c"DCV3_0\00"
@.str.7 = [7 x i8] c"DCV3_1\00"
@.str.8 = [7 x i8] c"DCV3_2\00"
define void @test_decompose_cartesian_vectors() {
%1 = alloca [3 x [3 x double]]
%2 = alloca [3 x double]
%3 = alloca [3 x double]
%4 = alloca [3 x double]
%5 = alloca double
%6 = alloca [3 x double]
%7 = alloca [3 x double]
%8 = alloca [3 x double]
%9 = alloca i32
%10 = alloca i32
%11 = getelementptr inbounds [3 x [3 x double]], [3 x [3 x double]]* %1, i64 0, i64 0
%12 = getelementptr inbounds [3 x double], [3 x double]* %11, i64 0, i64 0
store double 1.000000e+00, double* %12
%13 = getelementptr inbounds [3 x [3 x double]], [3 x [3 x double]]* %1, i64 0, i64 0
%14 = getelementptr inbounds [3 x double], [3 x double]* %13, i64 0, i64 1
store double 2.000000e+00, double* %14
%15 = getelementptr inbounds [3 x [3 x double]], [3 x [3 x double]]* %1, i64 0, i64 0
%16 = getelementptr inbounds [3 x double], [3 x double]* %15, i64 0, i64 2
store double 0.000000e+00, double* %16
%17 = getelementptr inbounds [3 x [3 x double]], [3 x [3 x double]]* %1, i64 0, i64 1
%18 = getelementptr inbounds [3 x double], [3 x double]* %17, i64 0, i64 0
store double 0.000000e+00, double* %18
%19 = getelementptr inbounds [3 x [3 x double]], [3 x [3 x double]]* %1, i64 0, i64 1
%20 = getelementptr inbounds [3 x double], [3 x double]* %19, i64 0, i64 1
store double 1.000000e+00, double* %20
%21 = getelementptr inbounds [3 x [3 x double]], [3 x [3 x double]]* %1, i64 0, i64 1
%22 = getelementptr inbounds [3 x double], [3 x double]* %21, i64 0, i64 2
store double 0.000000e+00, double* %22
%23 = getelementptr inbounds [3 x [3 x double]], [3 x [3 x double]]* %1, i64 0, i64 2
%24 = getelementptr inbounds [3 x double], [3 x double]* %23, i64 0, i64 0
store double 1.000000e+00, double* %24
%25 = getelementptr inbounds [3 x [3 x double]], [3 x [3 x double]]* %1, i64 0, i64 2
%26 = getelementptr inbounds [3 x double], [3 x double]* %25, i64 0, i64 1
store double 1.000000e+00, double* %26
%27 = getelementptr inbounds [3 x [3 x double]], [3 x [3 x double]]* %1, i64 0, i64 2
%28 = getelementptr inbounds [3 x double], [3 x double]* %27, i64 0, i64 2
store double 1.000000e+00, double* %28
%29 = getelementptr inbounds [3 x [3 x double]], [3 x [3 x double]]* %1, i64 0, i64 0
%30 = bitcast [3 x double]* %29 to double**
%31 = getelementptr inbounds [3 x double], [3 x double]* %2, i64 0, i64 0
%32 = getelementptr inbounds [3 x double], [3 x double]* %3, i64 0, i64 0
%33 = getelementptr inbounds [3 x double], [3 x double]* %4, i64 0, i64 0
%34 = call i32 @decompose_cartesian_vectors(double** %30, double* %31, double* %32, double* %33)
store double 0x3EB0C6F7A0B5ED8D, double* %5
store i32 0, i32* %9
br label %35
35: ; preds = %104, %0
%36 = load i32, i32* %9
%37 = icmp slt i32 %36, 3
br i1 %37, label %38, label %107
38: ; preds = %35
%39 = load i32, i32* %9
%40 = sext i32 %39 to i64
%41 = getelementptr inbounds [3 x double], [3 x double]* %8, i64 0, i64 %40
store double 0.000000e+00, double* %41
%42 = load i32, i32* %9
%43 = sext i32 %42 to i64
%44 = getelementptr inbounds [3 x double], [3 x double]* %7, i64 0, i64 %43
store double 0.000000e+00, double* %44
%45 = load i32, i32* %9
%46 = sext i32 %45 to i64
%47 = getelementptr inbounds [3 x double], [3 x double]* %6, i64 0, i64 %46
store double 0.000000e+00, double* %47
store i32 0, i32* %10
br label %48
48: ; preds = %100, %38
%49 = load i32, i32* %10
%50 = icmp slt i32 %49, 3
br i1 %50, label %51, label %103
51: ; preds = %48
%52 = load i32, i32* %10
%53 = sext i32 %52 to i64
%54 = getelementptr inbounds [3 x double], [3 x double]* %2, i64 0, i64 %53
%55 = load double, double* %54
%56 = load i32, i32* %10
%57 = sext i32 %56 to i64
%58 = getelementptr inbounds [3 x [3 x double]], [3 x [3 x double]]* %1, i64 0, i64 %57
%59 = load i32, i32* %9
%60 = sext i32 %59 to i64
%61 = getelementptr inbounds [3 x double], [3 x double]* %58, i64 0, i64 %60
%62 = load double, double* %61
%63 = load i32, i32* %9
%64 = sext i32 %63 to i64
%65 = getelementptr inbounds [3 x double], [3 x double]* %6, i64 0, i64 %64
%66 = load double, double* %65
%67 = call double @llvm.fmuladd.f64(double %55, double %62, double %66)
store double %67, double* %65
%68 = load i32, i32* %10
%69 = sext i32 %68 to i64
%70 = getelementptr inbounds [3 x double], [3 x double]* %3, i64 0, i64 %69
%71 = load double, double* %70
%72 = load i32, i32* %10
%73 = sext i32 %72 to i64
%74 = getelementptr inbounds [3 x [3 x double]], [3 x [3 x double]]* %1, i64 0, i64 %73
%75 = load i32, i32* %9
%76 = sext i32 %75 to i64
%77 = getelementptr inbounds [3 x double], [3 x double]* %74, i64 0, i64 %76
%78 = load double, double* %77
%79 = load i32, i32* %9
%80 = sext i32 %79 to i64
%81 = getelementptr inbounds [3 x double], [3 x double]* %7, i64 0, i64 %80
%82 = load double, double* %81
%83 = call double @llvm.fmuladd.f64(double %71, double %78, double %82)
store double %83, double* %81
%84 = load i32, i32* %10
%85 = sext i32 %84 to i64
%86 = getelementptr inbounds [3 x double], [3 x double]* %4, i64 0, i64 %85
%87 = load double, double* %86
%88 = load i32, i32* %10
%89 = sext i32 %88 to i64
%90 = getelementptr inbounds [3 x [3 x double]], [3 x [3 x double]]* %1, i64 0, i64 %89
%91 = load i32, i32* %9
%92 = sext i32 %91 to i64
%93 = getelementptr inbounds [3 x double], [3 x double]* %90, i64 0, i64 %92
%94 = load double, double* %93
%95 = load i32, i32* %9
%96 = sext i32 %95 to i64
%97 = getelementptr inbounds [3 x double], [3 x double]* %8, i64 0, i64 %96
%98 = load double, double* %97
%99 = call double @llvm.fmuladd.f64(double %87, double %94, double %98)
store double %99, double* %97
br label %100
100: ; preds = %51
%101 = load i32, i32* %10
%102 = add nsw i32 %101, 1
store i32 %102, i32* %10
br label %48
103: ; preds = %48
br label %104
104: ; preds = %103
%105 = load i32, i32* %9
%106 = add nsw i32 %105, 1
store i32 %106, i32* %9
br label %35
107: ; preds = %35
%108 = getelementptr inbounds [3 x double], [3 x double]* %6, i64 0, i64 0
%109 = load double, double* %108
%110 = call i32 @test_double(i32 1, double %109, double 0x3EB0C6F7A0B5ED8D, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%111 = getelementptr inbounds [3 x double], [3 x double]* %6, i64 0, i64 1
%112 = load double, double* %111
%113 = call i32 @test_double(i32 0, double %112, double 0x3EB0C6F7A0B5ED8D, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
%114 = getelementptr inbounds [3 x double], [3 x double]* %6, i64 0, i64 2
%115 = load double, double* %114
%116 = call i32 @test_double(i32 0, double %115, double 0x3EB0C6F7A0B5ED8D, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0))
%117 = getelementptr inbounds [3 x double], [3 x double]* %7, i64 0, i64 0
%118 = load double, double* %117
%119 = call i32 @test_double(i32 0, double %118, double 0x3EB0C6F7A0B5ED8D, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0))
%120 = getelementptr inbounds [3 x double], [3 x double]* %7, i64 0, i64 1
%121 = load double, double* %120
%122 = call i32 @test_double(i32 1, double %121, double 0x3EB0C6F7A0B5ED8D, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0))
%123 = getelementptr inbounds [3 x double], [3 x double]* %7, i64 0, i64 2
%124 = load double, double* %123
%125 = call i32 @test_double(i32 0, double %124, double 0x3EB0C6F7A0B5ED8D, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.5, i64 0, i64 0))
%126 = getelementptr inbounds [3 x double], [3 x double]* %8, i64 0, i64 0
%127 = load double, double* %126
%128 = call i32 @test_double(i32 0, double %127, double 0x3EB0C6F7A0B5ED8D, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.6, i64 0, i64 0))
%129 = getelementptr inbounds [3 x double], [3 x double]* %8, i64 0, i64 1
%130 = load double, double* %129
%131 = call i32 @test_double(i32 0, double %130, double 0x3EB0C6F7A0B5ED8D, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.7, i64 0, i64 0))
%132 = getelementptr inbounds [3 x double], [3 x double]* %8, i64 0, i64 2
%133 = load double, double* %132
%134 = call i32 @test_double(i32 1, double %133, double 0x3EB0C6F7A0B5ED8D, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.8, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"DCV1_0\00"
@.str.1 = [7 x i8] c"DCV1_1\00"
@.str.2 = [7 x i8] c"DCV1_2\00"
@.str.3 = [7 x i8] c"DCV2_0\00"
@.str.4 = [7 x i8] c"DCV2_1\00"
@.str.5 = [7 x i8] c"DCV2_2\00"
@.str.6 = [7 x i8] c"DCV3_0\00"
@.str.7 = [7 x i8] c"DCV3_1\00"
@.str.8 = [7 x i8] c"DCV3_2\00"
define void @test_decompose_cartesian_vectors() {
%1 = alloca [3 x [3 x double]]
%2 = alloca [3 x double]
%3 = alloca [3 x double]
%4 = alloca [3 x double]
%5 = bitcast [3 x [3 x double]]* %1 to i8*
%6 = getelementptr inbounds [3 x [3 x double]], [3 x [3 x double]]* %1, i64 0, i64 0, i64 0
%7 = getelementptr inbounds [3 x [3 x double]], [3 x [3 x double]]* %1, i64 0, i64 0, i64 1
%8 = bitcast [3 x [3 x double]]* %1 to <2 x double>*
store <2 x double> <double 1.000000e+00, double 2.000000e+00>, <2 x double>* %8
%9 = getelementptr inbounds [3 x [3 x double]], [3 x [3 x double]]* %1, i64 0, i64 0, i64 2
%10 = getelementptr inbounds [3 x [3 x double]], [3 x [3 x double]]* %1, i64 0, i64 1, i64 0
%11 = getelementptr inbounds [3 x [3 x double]], [3 x [3 x double]]* %1, i64 0, i64 1, i64 1
%12 = bitcast double* %9 to i8*
%13 = getelementptr inbounds [3 x [3 x double]], [3 x [3 x double]]* %1, i64 0, i64 1, i64 2
%14 = bitcast double* %11 to <2 x double>*
store <2 x double> <double 1.000000e+00, double 0.000000e+00>, <2 x double>* %14
%15 = getelementptr inbounds [3 x [3 x double]], [3 x [3 x double]]* %1, i64 0, i64 2, i64 0
%16 = getelementptr inbounds [3 x [3 x double]], [3 x [3 x double]]* %1, i64 0, i64 2, i64 1
%17 = bitcast double* %15 to <2 x double>*
store <2 x double> <double 1.000000e+00, double 1.000000e+00>, <2 x double>* %17
%18 = getelementptr inbounds [3 x [3 x double]], [3 x [3 x double]]* %1, i64 0, i64 2, i64 2
store double 1.000000e+00, double* %18
%19 = bitcast [3 x double]* %2 to i8*
%20 = bitcast [3 x double]* %3 to i8*
%21 = bitcast [3 x double]* %4 to i8*
%22 = bitcast [3 x [3 x double]]* %1 to double**
%23 = getelementptr inbounds [3 x double], [3 x double]* %2, i64 0, i64 0
%24 = getelementptr inbounds [3 x double], [3 x double]* %3, i64 0, i64 0
%25 = getelementptr inbounds [3 x double], [3 x double]* %4, i64 0, i64 0
%26 = call i32 @decompose_cartesian_vectors(double** %22, double* %23, double* %24, double* %25)
%27 = load double, double* %23
%28 = load double, double* %6
%29 = call double @llvm.fmuladd.f64(double %27, double %28, double 0.000000e+00)
%30 = load double, double* %24
%31 = call double @llvm.fmuladd.f64(double %30, double %28, double 0.000000e+00)
%32 = load double, double* %25
%33 = call double @llvm.fmuladd.f64(double %32, double %28, double 0.000000e+00)
%34 = getelementptr inbounds [3 x double], [3 x double]* %2, i64 0, i64 1
%35 = load double, double* %34
%36 = load double, double* %10
%37 = call double @llvm.fmuladd.f64(double %35, double %36, double %29)
%38 = getelementptr inbounds [3 x double], [3 x double]* %3, i64 0, i64 1
%39 = load double, double* %38
%40 = call double @llvm.fmuladd.f64(double %39, double %36, double %31)
%41 = getelementptr inbounds [3 x double], [3 x double]* %4, i64 0, i64 1
%42 = load double, double* %41
%43 = call double @llvm.fmuladd.f64(double %42, double %36, double %33)
%44 = getelementptr inbounds [3 x double], [3 x double]* %2, i64 0, i64 2
%45 = load double, double* %44
%46 = load double, double* %15
%47 = call double @llvm.fmuladd.f64(double %45, double %46, double %37)
%48 = getelementptr inbounds [3 x double], [3 x double]* %3, i64 0, i64 2
%49 = load double, double* %48
%50 = call double @llvm.fmuladd.f64(double %49, double %46, double %40)
%51 = getelementptr inbounds [3 x double], [3 x double]* %4, i64 0, i64 2
%52 = load double, double* %51
%53 = call double @llvm.fmuladd.f64(double %52, double %46, double %43)
%54 = load double, double* %7
%55 = call double @llvm.fmuladd.f64(double %27, double %54, double 0.000000e+00)
%56 = call double @llvm.fmuladd.f64(double %30, double %54, double 0.000000e+00)
%57 = call double @llvm.fmuladd.f64(double %32, double %54, double 0.000000e+00)
%58 = load double, double* %11
%59 = call double @llvm.fmuladd.f64(double %35, double %58, double %55)
%60 = call double @llvm.fmuladd.f64(double %39, double %58, double %56)
%61 = call double @llvm.fmuladd.f64(double %42, double %58, double %57)
%62 = load double, double* %16
%63 = call double @llvm.fmuladd.f64(double %45, double %62, double %59)
%64 = call double @llvm.fmuladd.f64(double %49, double %62, double %60)
%65 = call double @llvm.fmuladd.f64(double %52, double %62, double %61)
%66 = load double, double* %9
%67 = call double @llvm.fmuladd.f64(double %27, double %66, double 0.000000e+00)
%68 = call double @llvm.fmuladd.f64(double %30, double %66, double 0.000000e+00)
%69 = call double @llvm.fmuladd.f64(double %32, double %66, double 0.000000e+00)
%70 = load double, double* %13
%71 = call double @llvm.fmuladd.f64(double %35, double %70, double %67)
%72 = call double @llvm.fmuladd.f64(double %39, double %70, double %68)
%73 = call double @llvm.fmuladd.f64(double %42, double %70, double %69)
%74 = load double, double* %18
%75 = call double @llvm.fmuladd.f64(double %45, double %74, double %71)
%76 = call double @llvm.fmuladd.f64(double %49, double %74, double %72)
%77 = call double @llvm.fmuladd.f64(double %52, double %74, double %73)
%78 = call i32 @test_double(i32 1, double %47, double 0x3EB0C6F7A0B5ED8D, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%79 = call i32 @test_double(i32 0, double %63, double 0x3EB0C6F7A0B5ED8D, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
%80 = call i32 @test_double(i32 0, double %75, double 0x3EB0C6F7A0B5ED8D, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0))
%81 = call i32 @test_double(i32 0, double %50, double 0x3EB0C6F7A0B5ED8D, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0))
%82 = call i32 @test_double(i32 1, double %64, double 0x3EB0C6F7A0B5ED8D, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0))
%83 = call i32 @test_double(i32 0, double %76, double 0x3EB0C6F7A0B5ED8D, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.5, i64 0, i64 0))
%84 = call i32 @test_double(i32 0, double %53, double 0x3EB0C6F7A0B5ED8D, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.6, i64 0, i64 0))
%85 = call i32 @test_double(i32 0, double %65, double 0x3EB0C6F7A0B5ED8D, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.7, i64 0, i64 0))
%86 = call i32 @test_double(i32 1, double %77, double 0x3EB0C6F7A0B5ED8D, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.8, i64 0, i64 0))
ret void
}