#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*/ diff_3d(double *, double *, double *);
int /*<<< orphan*/ mat_mult_3d(double *, double *, double *);
double norm_2d(double *);
double norm_3d(double *);
void projmatrix(double *out, double *x0_3, double *x1_3) {
  double a[3];
  double r2d, r3d;
  double m1[9];
  double m2[9];
  double *m;
  if (x0_3) {
    if (x1_3) {
      diff_3d(a, x1_3, x0_3);
    } else {
      a[0] = -x0_3[0];
      a[1] = -x0_3[1];
      a[2] = -x0_3[2];
    }
  } else {
    if (x1_3) {
      a[0] = x1_3[0];
      a[1] = x1_3[1];
      a[2] = x1_3[2];
    } else {
      int i;
      for (i = 0; i < 9; i++) {
        out[i] = ((i % 4) == 0);
      }
      return;
    }
  }
  r2d = norm_2d(a);
  r3d = norm_3d(a);
  if (r2d == 0) {
    m = out;
    if (a[2] >= 0) {
      *(m++) = 1;
      *(m++) = 0;
      *(m++) = 0;
      *(m++) = 0;
      *(m++) = 1;
      *(m++) = 0;
      *(m++) = 0;
      *(m++) = 0;
      *(m++) = 1;
    } else {
      *(m++) = -1;
      *(m++) = 0;
      *(m++) = 0;
      *(m++) = 0;
      *(m++) = 1;
      *(m++) = 0;
      *(m++) = 0;
      *(m++) = 0;
      *(m++) = -1;
    }
    return;
  }
  m = m1;
  *(m++) = a[0] / r2d;
  *(m++) = a[1] / r2d;
  *(m++) = 0;
  *(m++) = -a[1] / r2d;
  *(m++) = a[0] / r2d;
  *(m++) = 0;
  *(m++) = 0;
  *(m++) = 0;
  *(m) = 1;
  m = m2;
  *(m++) = a[2] / r3d;
  *(m++) = 0;
  *(m++) = -r2d / r3d;
  *(m++) = 0;
  *(m++) = 1;
  *(m++) = 0;
  *(m++) = r2d / r3d;
  *(m++) = 0;
  *(m) = a[2] / r3d;
  mat_mult_3d(out, m2, m1);
}


x86 assembly (clang, -O0):
<projmatrix>:
push   %rbp
mov    %rsp,%rbp
sub    $0xf0,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     11f6 <projmatrix+0xb6>
cmpq   $0x0,-0x18(%rbp)
je     1183 <projmatrix+0x43>
lea    -0x30(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x10(%rbp),%rdx
call   1060 <diff_3d@plt>
jmp    11f1 <projmatrix+0xb1>
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x30(%rbp)
mov    -0x10(%rbp),%rax
movsd  0x8(%rax),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x28(%rbp)
mov    -0x10(%rbp),%rax
movsd  0x10(%rax),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x20(%rbp)
jmp    1291 <projmatrix+0x151>
cmpq   $0x0,-0x18(%rbp)
je     122f <projmatrix+0xef>
mov    -0x18(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x30(%rbp)
mov    -0x18(%rbp),%rax
movsd  0x8(%rax),%xmm0
movsd  %xmm0,-0x28(%rbp)
mov    -0x18(%rbp),%rax
movsd  0x10(%rax),%xmm0
movsd  %xmm0,-0x20(%rbp)
jmp    128c <projmatrix+0x14c>
movl   $0x0,-0xec(%rbp)
cmpl   $0x9,-0xec(%rbp)
jge    1287 <projmatrix+0x147>
mov    -0xec(%rbp),%eax
mov    $0x4,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
sete   %al
and    $0x1,%al
movzbl %al,%eax
cvtsi2sd %eax,%xmm0
mov    -0x8(%rbp),%rax
movslq -0xec(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0xec(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xec(%rbp)
jmp    1239 <projmatrix+0xf9>
jmp    1781 <projmatrix+0x641>
jmp    1291 <projmatrix+0x151>
lea    -0x30(%rbp),%rdi
call   1050 <norm_2d@plt>
movsd  %xmm0,-0x38(%rbp)
lea    -0x30(%rbp),%rdi
call   1030 <norm_3d@plt>
movsd  %xmm0,-0x40(%rbp)
movsd  -0x38(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    1502 <projmatrix+0x3c2>
jp     1502 <projmatrix+0x3c2>
mov    -0x8(%rbp),%rax
mov    %rax,-0xe8(%rbp)
movsd  -0x20(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     13f2 <projmatrix+0x2b2>
mov    -0xe8(%rbp),%rax
mov    %rax,%rcx
add    $0x8,%rcx
mov    %rcx,-0xe8(%rbp)
movsd  0xd01(%rip),%xmm0
movsd  %xmm0,(%rax)
mov    -0xe8(%rbp),%rax
mov    %rax,%rcx
add    $0x8,%rcx
mov    %rcx,-0xe8(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax)
mov    -0xe8(%rbp),%rax
mov    %rax,%rcx
add    $0x8,%rcx
mov    %rcx,-0xe8(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax)
mov    -0xe8(%rbp),%rax
mov    %rax,%rcx
add    $0x8,%rcx
mov    %rcx,-0xe8(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax)
mov    -0xe8(%rbp),%rax
mov    %rax,%rcx
add    $0x8,%rcx
mov    %rcx,-0xe8(%rbp)
movsd  0xc8c(%rip),%xmm0
movsd  %xmm0,(%rax)
mov    -0xe8(%rbp),%rax
mov    %rax,%rcx
add    $0x8,%rcx
mov    %rcx,-0xe8(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax)
mov    -0xe8(%rbp),%rax
mov    %rax,%rcx
add    $0x8,%rcx
mov    %rcx,-0xe8(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax)
mov    -0xe8(%rbp),%rax
mov    %rax,%rcx
add    $0x8,%rcx
mov    %rcx,-0xe8(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax)
mov    -0xe8(%rbp),%rax
mov    %rax,%rcx
add    $0x8,%rcx
mov    %rcx,-0xe8(%rbp)
movsd  0xc17(%rip),%xmm0
movsd  %xmm0,(%rax)
jmp    14fd <projmatrix+0x3bd>
mov    -0xe8(%rbp),%rax
mov    %rax,%rcx
add    $0x8,%rcx
mov    %rcx,-0xe8(%rbp)
movsd  0xbf9(%rip),%xmm0
movsd  %xmm0,(%rax)
mov    -0xe8(%rbp),%rax
mov    %rax,%rcx
add    $0x8,%rcx
mov    %rcx,-0xe8(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax)
mov    -0xe8(%rbp),%rax
mov    %rax,%rcx
add    $0x8,%rcx
mov    %rcx,-0xe8(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax)
mov    -0xe8(%rbp),%rax
mov    %rax,%rcx
add    $0x8,%rcx
mov    %rcx,-0xe8(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax)
mov    -0xe8(%rbp),%rax
mov    %rax,%rcx
add    $0x8,%rcx
mov    %rcx,-0xe8(%rbp)
movsd  0xb7c(%rip),%xmm0
movsd  %xmm0,(%rax)
mov    -0xe8(%rbp),%rax
mov    %rax,%rcx
add    $0x8,%rcx
mov    %rcx,-0xe8(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax)
mov    -0xe8(%rbp),%rax
mov    %rax,%rcx
add    $0x8,%rcx
mov    %rcx,-0xe8(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax)
mov    -0xe8(%rbp),%rax
mov    %rax,%rcx
add    $0x8,%rcx
mov    %rcx,-0xe8(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax)
mov    -0xe8(%rbp),%rax
mov    %rax,%rcx
add    $0x8,%rcx
mov    %rcx,-0xe8(%rbp)
movsd  0xb0f(%rip),%xmm0
movsd  %xmm0,(%rax)
jmp    1781 <projmatrix+0x641>
lea    -0x90(%rbp),%rax
mov    %rax,-0xe8(%rbp)
movsd  -0x30(%rbp),%xmm0
divsd  -0x38(%rbp),%xmm0
mov    -0xe8(%rbp),%rax
mov    %rax,%rcx
add    $0x8,%rcx
mov    %rcx,-0xe8(%rbp)
movsd  %xmm0,(%rax)
movsd  -0x28(%rbp),%xmm0
divsd  -0x38(%rbp),%xmm0
mov    -0xe8(%rbp),%rax
mov    %rax,%rcx
add    $0x8,%rcx
mov    %rcx,-0xe8(%rbp)
movsd  %xmm0,(%rax)
mov    -0xe8(%rbp),%rax
mov    %rax,%rcx
add    $0x8,%rcx
mov    %rcx,-0xe8(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax)
movsd  -0x28(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
divsd  -0x38(%rbp),%xmm0
mov    -0xe8(%rbp),%rax
mov    %rax,%rcx
add    $0x8,%rcx
mov    %rcx,-0xe8(%rbp)
movsd  %xmm0,(%rax)
movsd  -0x30(%rbp),%xmm0
divsd  -0x38(%rbp),%xmm0
mov    -0xe8(%rbp),%rax
mov    %rax,%rcx
add    $0x8,%rcx
mov    %rcx,-0xe8(%rbp)
movsd  %xmm0,(%rax)
mov    -0xe8(%rbp),%rax
mov    %rax,%rcx
add    $0x8,%rcx
mov    %rcx,-0xe8(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax)
mov    -0xe8(%rbp),%rax
mov    %rax,%rcx
add    $0x8,%rcx
mov    %rcx,-0xe8(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax)
mov    -0xe8(%rbp),%rax
mov    %rax,%rcx
add    $0x8,%rcx
mov    %rcx,-0xe8(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax)
mov    -0xe8(%rbp),%rax
movsd  0x9ce(%rip),%xmm0
movsd  %xmm0,(%rax)
lea    -0xe0(%rbp),%rax
mov    %rax,-0xe8(%rbp)
movsd  -0x20(%rbp),%xmm0
divsd  -0x40(%rbp),%xmm0
mov    -0xe8(%rbp),%rax
mov    %rax,%rcx
add    $0x8,%rcx
mov    %rcx,-0xe8(%rbp)
movsd  %xmm0,(%rax)
mov    -0xe8(%rbp),%rax
mov    %rax,%rcx
add    $0x8,%rcx
mov    %rcx,-0xe8(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax)
movsd  -0x38(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
divsd  -0x40(%rbp),%xmm0
mov    -0xe8(%rbp),%rax
mov    %rax,%rcx
add    $0x8,%rcx
mov    %rcx,-0xe8(%rbp)
movsd  %xmm0,(%rax)
mov    -0xe8(%rbp),%rax
mov    %rax,%rcx
add    $0x8,%rcx
mov    %rcx,-0xe8(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax)
mov    -0xe8(%rbp),%rax
mov    %rax,%rcx
add    $0x8,%rcx
mov    %rcx,-0xe8(%rbp)
movsd  0x90a(%rip),%xmm0
movsd  %xmm0,(%rax)
mov    -0xe8(%rbp),%rax
mov    %rax,%rcx
add    $0x8,%rcx
mov    %rcx,-0xe8(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax)
movsd  -0x38(%rbp),%xmm0
divsd  -0x40(%rbp),%xmm0
mov    -0xe8(%rbp),%rax
mov    %rax,%rcx
add    $0x8,%rcx
mov    %rcx,-0xe8(%rbp)
movsd  %xmm0,(%rax)
mov    -0xe8(%rbp),%rax
mov    %rax,%rcx
add    $0x8,%rcx
mov    %rcx,-0xe8(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax)
movsd  -0x20(%rbp),%xmm0
divsd  -0x40(%rbp),%xmm0
mov    -0xe8(%rbp),%rax
movsd  %xmm0,(%rax)
mov    -0x8(%rbp),%rdi
lea    -0xe0(%rbp),%rsi
lea    -0x90(%rbp),%rdx
call   1040 <mat_mult_3d@plt>
add    $0xf0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<projmatrix>:
push   %r14
push   %rbx
sub    $0xc8,%rsp
mov    %rdi,%r14
test   %rsi,%rsi
je     116a <projmatrix+0x2a>
mov    %rsi,%rax
test   %rdx,%rdx
je     1187 <projmatrix+0x47>
mov    %rsp,%rdi
mov    %rdx,%rsi
mov    %rax,%rdx
call   1060 <diff_3d@plt>
jmp    11ab <projmatrix+0x6b>
test   %rdx,%rdx
je     1338 <projmatrix+0x1f8>
movups (%rdx),%xmm0
movaps %xmm0,(%rsp)
movsd  0x10(%rdx),%xmm0
movsd  %xmm0,0x10(%rsp)
jmp    11ab <projmatrix+0x6b>
movupd (%rax),%xmm0
movapd 0xe6d(%rip),%xmm1
xorpd  %xmm1,%xmm0
movapd %xmm0,(%rsp)
movsd  0x10(%rax),%xmm0
xorpd  %xmm1,%xmm0
movlpd %xmm0,0x10(%rsp)
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1050 <norm_2d@plt>
movapd %xmm0,0x20(%rsp)
mov    %rbx,%rdi
call   1030 <norm_3d@plt>
movapd 0x20(%rsp),%xmm4
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm4
jne    121a <projmatrix+0xda>
jp     121a <projmatrix+0xda>
movsd  0x10(%rsp),%xmm0
lea    0x8(%r14),%rax
ucomisd %xmm1,%xmm0
jae    1303 <projmatrix+0x1c3>
movabs $0xbff0000000000000,%rcx
mov    %rcx,(%r14)
xorpd  %xmm0,%xmm0
movupd %xmm0,(%rax)
movq   $0x0,0x10(%rax)
movabs $0x3ff0000000000000,%rax
mov    %rax,0x20(%r14)
jmp    1324 <projmatrix+0x1e4>
movapd (%rsp),%xmm1
movapd %xmm4,%xmm2
unpcklpd %xmm4,%xmm2
movapd %xmm1,%xmm3
divpd  %xmm2,%xmm3
movapd %xmm3,0x80(%rsp)
movq   $0x0,0x90(%rsp)
unpckhpd %xmm1,%xmm1
movapd 0xdb0(%rip),%xmm2
xorpd  %xmm2,%xmm1
divsd  %xmm4,%xmm1
movsd  %xmm1,0x98(%rsp)
movlpd %xmm3,0xa0(%rsp)
xorpd  %xmm1,%xmm1
movupd %xmm1,0xa8(%rsp)
movq   $0x0,0xb8(%rsp)
movabs $0x3ff0000000000000,%rax
mov    %rax,0xc0(%rsp)
movsd  0x10(%rsp),%xmm3
divsd  %xmm0,%xmm3
movsd  %xmm3,0x30(%rsp)
movq   $0x0,0x38(%rsp)
xorpd  %xmm4,%xmm2
divsd  %xmm0,%xmm2
movsd  %xmm2,0x40(%rsp)
movhpd 0xd4c(%rip),%xmm1
movupd %xmm1,0x48(%rsp)
movq   $0x0,0x58(%rsp)
divsd  %xmm0,%xmm4
movsd  %xmm4,0x60(%rsp)
movq   $0x0,0x68(%rsp)
movsd  %xmm3,0x70(%rsp)
lea    0x30(%rsp),%rsi
lea    0x80(%rsp),%rdx
mov    %r14,%rdi
call   1040 <mat_mult_3d@plt>
jmp    136d <projmatrix+0x22d>
movabs $0x3ff0000000000000,%rcx
mov    %rcx,(%r14)
xorpd  %xmm0,%xmm0
movupd %xmm0,(%rax)
movq   $0x0,0x10(%rax)
mov    %rcx,0x20(%r14)
movupd %xmm0,0x28(%r14)
movq   $0x0,0x38(%r14)
mov    %rcx,0x40(%r14)
jmp    136d <projmatrix+0x22d>
movabs $0x3ff0000000000000,%rax
mov    %rax,(%r14)
xorpd  %xmm0,%xmm0
movupd %xmm0,0x8(%r14)
movq   $0x0,0x18(%r14)
mov    %rax,0x20(%r14)
movupd %xmm0,0x28(%r14)
movq   $0x0,0x38(%r14)
mov    %rax,0x40(%r14)
add    $0xc8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @projmatrix(double* %0, double* %1, double* %2) {
%4 = alloca double*
%5 = alloca double*
%6 = alloca double*
%7 = alloca [3 x double]
%8 = alloca double
%9 = alloca double
%10 = alloca [9 x double]
%11 = alloca [9 x double]
%12 = alloca double*
%13 = alloca i32
store double* %0, double** %4
store double* %1, double** %5
store double* %2, double** %6
%14 = load double*, double** %5
%15 = icmp ne double* %14, null
br i1 %15, label %16, label %41
16: ; preds = %3
%17 = load double*, double** %6
%18 = icmp ne double* %17, null
br i1 %18, label %19, label %24
19: ; preds = %16
%20 = getelementptr inbounds [3 x double], [3 x double]* %7, i64 0, i64 0
%21 = load double*, double** %6
%22 = load double*, double** %5
%23 = call i32 @diff_3d(double* %20, double* %21, double* %22)
br label %40
24: ; preds = %16
%25 = load double*, double** %5
%26 = getelementptr inbounds double, double* %25, i64 0
%27 = load double, double* %26
%28 = fneg double %27
%29 = getelementptr inbounds [3 x double], [3 x double]* %7, i64 0, i64 0
store double %28, double* %29
%30 = load double*, double** %5
%31 = getelementptr inbounds double, double* %30, i64 1
%32 = load double, double* %31
%33 = fneg double %32
%34 = getelementptr inbounds [3 x double], [3 x double]* %7, i64 0, i64 1
store double %33, double* %34
%35 = load double*, double** %5
%36 = getelementptr inbounds double, double* %35, i64 2
%37 = load double, double* %36
%38 = fneg double %37
%39 = getelementptr inbounds [3 x double], [3 x double]* %7, i64 0, i64 2
store double %38, double* %39
br label %40
40: ; preds = %24, %19
br label %76
41: ; preds = %3
%42 = load double*, double** %6
%43 = icmp ne double* %42, null
br i1 %43, label %44, label %57
44: ; preds = %41
%45 = load double*, double** %6
%46 = getelementptr inbounds double, double* %45, i64 0
%47 = load double, double* %46
%48 = getelementptr inbounds [3 x double], [3 x double]* %7, i64 0, i64 0
store double %47, double* %48
%49 = load double*, double** %6
%50 = getelementptr inbounds double, double* %49, i64 1
%51 = load double, double* %50
%52 = getelementptr inbounds [3 x double], [3 x double]* %7, i64 0, i64 1
store double %51, double* %52
%53 = load double*, double** %6
%54 = getelementptr inbounds double, double* %53, i64 2
%55 = load double, double* %54
%56 = getelementptr inbounds [3 x double], [3 x double]* %7, i64 0, i64 2
store double %55, double* %56
br label %75
57: ; preds = %41
store i32 0, i32* %13
br label %58
58: ; preds = %71, %57
%59 = load i32, i32* %13
%60 = icmp slt i32 %59, 9
br i1 %60, label %61, label %74
61: ; preds = %58
%62 = load i32, i32* %13
%63 = srem i32 %62, 4
%64 = icmp eq i32 %63, 0
%65 = zext i1 %64 to i32
%66 = sitofp i32 %65 to double
%67 = load double*, double** %4
%68 = load i32, i32* %13
%69 = sext i32 %68 to i64
%70 = getelementptr inbounds double, double* %67, i64 %69
store double %66, double* %70
br label %71
71: ; preds = %61
%72 = load i32, i32* %13
%73 = add nsw i32 %72, 1
store i32 %73, i32* %13
br label %58
74: ; preds = %58
br label %200
75: ; preds = %44
br label %76
76: ; preds = %75, %40
%77 = getelementptr inbounds [3 x double], [3 x double]* %7, i64 0, i64 0
%78 = call double @norm_2d(double* %77)
store double %78, double* %8
%79 = getelementptr inbounds [3 x double], [3 x double]* %7, i64 0, i64 0
%80 = call double @norm_3d(double* %79)
store double %80, double* %9
%81 = load double, double* %8
%82 = fcmp oeq double %81, 0.000000e+00
br i1 %82, label %83, label %127
83: ; preds = %76
%84 = load double*, double** %4
store double* %84, double** %12
%85 = getelementptr inbounds [3 x double], [3 x double]* %7, i64 0, i64 2
%86 = load double, double* %85
%87 = fcmp oge double %86, 0.000000e+00
br i1 %87, label %88, label %107
88: ; preds = %83
%89 = load double*, double** %12
%90 = getelementptr inbounds double, double* %89, i32 1
store double* %90, double** %12
store double 1.000000e+00, double* %89
%91 = load double*, double** %12
%92 = getelementptr inbounds double, double* %91, i32 1
store double* %92, double** %12
store double 0.000000e+00, double* %91
%93 = load double*, double** %12
%94 = getelementptr inbounds double, double* %93, i32 1
store double* %94, double** %12
store double 0.000000e+00, double* %93
%95 = load double*, double** %12
%96 = getelementptr inbounds double, double* %95, i32 1
store double* %96, double** %12
store double 0.000000e+00, double* %95
%97 = load double*, double** %12
%98 = getelementptr inbounds double, double* %97, i32 1
store double* %98, double** %12
store double 1.000000e+00, double* %97
%99 = load double*, double** %12
%100 = getelementptr inbounds double, double* %99, i32 1
store double* %100, double** %12
store double 0.000000e+00, double* %99
%101 = load double*, double** %12
%102 = getelementptr inbounds double, double* %101, i32 1
store double* %102, double** %12
store double 0.000000e+00, double* %101
%103 = load double*, double** %12
%104 = getelementptr inbounds double, double* %103, i32 1
store double* %104, double** %12
store double 0.000000e+00, double* %103
%105 = load double*, double** %12
%106 = getelementptr inbounds double, double* %105, i32 1
store double* %106, double** %12
store double 1.000000e+00, double* %105
br label %126
107: ; preds = %83
%108 = load double*, double** %12
%109 = getelementptr inbounds double, double* %108, i32 1
store double* %109, double** %12
store double -1.000000e+00, double* %108
%110 = load double*, double** %12
%111 = getelementptr inbounds double, double* %110, i32 1
store double* %111, double** %12
store double 0.000000e+00, double* %110
%112 = load double*, double** %12
%113 = getelementptr inbounds double, double* %112, i32 1
store double* %113, double** %12
store double 0.000000e+00, double* %112
%114 = load double*, double** %12
%115 = getelementptr inbounds double, double* %114, i32 1
store double* %115, double** %12
store double 0.000000e+00, double* %114
%116 = load double*, double** %12
%117 = getelementptr inbounds double, double* %116, i32 1
store double* %117, double** %12
store double 1.000000e+00, double* %116
%118 = load double*, double** %12
%119 = getelementptr inbounds double, double* %118, i32 1
store double* %119, double** %12
store double 0.000000e+00, double* %118
%120 = load double*, double** %12
%121 = getelementptr inbounds double, double* %120, i32 1
store double* %121, double** %12
store double 0.000000e+00, double* %120
%122 = load double*, double** %12
%123 = getelementptr inbounds double, double* %122, i32 1
store double* %123, double** %12
store double 0.000000e+00, double* %122
%124 = load double*, double** %12
%125 = getelementptr inbounds double, double* %124, i32 1
store double* %125, double** %12
store double -1.000000e+00, double* %124
br label %126
126: ; preds = %107, %88
br label %200
127: ; preds = %76
%128 = getelementptr inbounds [9 x double], [9 x double]* %10, i64 0, i64 0
store double* %128, double** %12
%129 = getelementptr inbounds [3 x double], [3 x double]* %7, i64 0, i64 0
%130 = load double, double* %129
%131 = load double, double* %8
%132 = fdiv double %130, %131
%133 = load double*, double** %12
%134 = getelementptr inbounds double, double* %133, i32 1
store double* %134, double** %12
store double %132, double* %133
%135 = getelementptr inbounds [3 x double], [3 x double]* %7, i64 0, i64 1
%136 = load double, double* %135
%137 = load double, double* %8
%138 = fdiv double %136, %137
%139 = load double*, double** %12
%140 = getelementptr inbounds double, double* %139, i32 1
store double* %140, double** %12
store double %138, double* %139
%141 = load double*, double** %12
%142 = getelementptr inbounds double, double* %141, i32 1
store double* %142, double** %12
store double 0.000000e+00, double* %141
%143 = getelementptr inbounds [3 x double], [3 x double]* %7, i64 0, i64 1
%144 = load double, double* %143
%145 = fneg double %144
%146 = load double, double* %8
%147 = fdiv double %145, %146
%148 = load double*, double** %12
%149 = getelementptr inbounds double, double* %148, i32 1
store double* %149, double** %12
store double %147, double* %148
%150 = getelementptr inbounds [3 x double], [3 x double]* %7, i64 0, i64 0
%151 = load double, double* %150
%152 = load double, double* %8
%153 = fdiv double %151, %152
%154 = load double*, double** %12
%155 = getelementptr inbounds double, double* %154, i32 1
store double* %155, double** %12
store double %153, double* %154
%156 = load double*, double** %12
%157 = getelementptr inbounds double, double* %156, i32 1
store double* %157, double** %12
store double 0.000000e+00, double* %156
%158 = load double*, double** %12
%159 = getelementptr inbounds double, double* %158, i32 1
store double* %159, double** %12
store double 0.000000e+00, double* %158
%160 = load double*, double** %12
%161 = getelementptr inbounds double, double* %160, i32 1
store double* %161, double** %12
store double 0.000000e+00, double* %160
%162 = load double*, double** %12
store double 1.000000e+00, double* %162
%163 = getelementptr inbounds [9 x double], [9 x double]* %11, i64 0, i64 0
store double* %163, double** %12
%164 = getelementptr inbounds [3 x double], [3 x double]* %7, i64 0, i64 2
%165 = load double, double* %164
%166 = load double, double* %9
%167 = fdiv double %165, %166
%168 = load double*, double** %12
%169 = getelementptr inbounds double, double* %168, i32 1
store double* %169, double** %12
store double %167, double* %168
%170 = load double*, double** %12
%171 = getelementptr inbounds double, double* %170, i32 1
store double* %171, double** %12
store double 0.000000e+00, double* %170
%172 = load double, double* %8
%173 = fneg double %172
%174 = load double, double* %9
%175 = fdiv double %173, %174
%176 = load double*, double** %12
%177 = getelementptr inbounds double, double* %176, i32 1
store double* %177, double** %12
store double %175, double* %176
%178 = load double*, double** %12
%179 = getelementptr inbounds double, double* %178, i32 1
store double* %179, double** %12
store double 0.000000e+00, double* %178
%180 = load double*, double** %12
%181 = getelementptr inbounds double, double* %180, i32 1
store double* %181, double** %12
store double 1.000000e+00, double* %180
%182 = load double*, double** %12
%183 = getelementptr inbounds double, double* %182, i32 1
store double* %183, double** %12
store double 0.000000e+00, double* %182
%184 = load double, double* %8
%185 = load double, double* %9
%186 = fdiv double %184, %185
%187 = load double*, double** %12
%188 = getelementptr inbounds double, double* %187, i32 1
store double* %188, double** %12
store double %186, double* %187
%189 = load double*, double** %12
%190 = getelementptr inbounds double, double* %189, i32 1
store double* %190, double** %12
store double 0.000000e+00, double* %189
%191 = getelementptr inbounds [3 x double], [3 x double]* %7, i64 0, i64 2
%192 = load double, double* %191
%193 = load double, double* %9
%194 = fdiv double %192, %193
%195 = load double*, double** %12
store double %194, double* %195
%196 = load double*, double** %4
%197 = getelementptr inbounds [9 x double], [9 x double]* %11, i64 0, i64 0
%198 = getelementptr inbounds [9 x double], [9 x double]* %10, i64 0, i64 0
%199 = call i32 @mat_mult_3d(double* %196, double* %197, double* %198)
br label %200
200: ; preds = %127, %126, %74
ret void
}

LLVM IR (-O2):
define void @projmatrix(double* %0, double* %1, double* %2) {
%4 = alloca [3 x double]
%5 = alloca [9 x double]
%6 = alloca [9 x double]
%7 = bitcast [3 x double]* %4 to i8*
%8 = bitcast [9 x double]* %5 to i8*
%9 = bitcast [9 x double]* %6 to i8*
%10 = icmp eq double* %1, null
%11 = icmp eq double* %2, null
br i1 %10, label %25, label %12
12: ; preds = %3
br i1 %11, label %16, label %13
13: ; preds = %12
%14 = getelementptr inbounds [3 x double], [3 x double]* %4, i64 0, i64 0
%15 = call i32 @diff_3d(double* %14, double* %2, double* %1)
br label %40
16: ; preds = %12
%17 = bitcast double* %1 to <2 x double>*
%18 = load <2 x double>, <2 x double>* %17
%19 = fneg <2 x double> %18
%20 = bitcast [3 x double]* %4 to <2 x double>*
store <2 x double> %19, <2 x double>* %20
%21 = getelementptr inbounds double, double* %1, i64 2
%22 = load double, double* %21
%23 = fneg double %22
%24 = getelementptr inbounds [3 x double], [3 x double]* %4, i64 0, i64 2
store double %23, double* %24
br label %40
25: ; preds = %3
br i1 %11, label %26, label %33
26: ; preds = %25
store double 1.000000e+00, double* %0
%27 = getelementptr inbounds double, double* %0, i64 1
%28 = getelementptr inbounds double, double* %0, i64 4
%29 = bitcast double* %27 to i8*
store double 1.000000e+00, double* %28
%30 = getelementptr inbounds double, double* %0, i64 5
%31 = getelementptr inbounds double, double* %0, i64 8
%32 = bitcast double* %30 to i8*
store double 1.000000e+00, double* %31
br label %96
33: ; preds = %25
%34 = bitcast double* %2 to <2 x double>*
%35 = load <2 x double>, <2 x double>* %34
%36 = bitcast [3 x double]* %4 to <2 x double>*
store <2 x double> %35, <2 x double>* %36
%37 = getelementptr inbounds double, double* %2, i64 2
%38 = load double, double* %37
%39 = getelementptr inbounds [3 x double], [3 x double]* %4, i64 0, i64 2
store double %38, double* %39
br label %40
40: ; preds = %13, %16, %33
%41 = getelementptr inbounds [3 x double], [3 x double]* %4, i64 0, i64 0
%42 = call double @norm_2d(double* %41)
%43 = call double @norm_3d(double* %41)
%44 = fcmp oeq double %42, 0.000000e+00
br i1 %44, label %45, label %62
45: ; preds = %40
%46 = getelementptr inbounds [3 x double], [3 x double]* %4, i64 0, i64 2
%47 = load double, double* %46
%48 = fcmp ult double %47, 0.000000e+00
%49 = getelementptr inbounds double, double* %0, i64 1
br i1 %48, label %56, label %50
50: ; preds = %45
store double 1.000000e+00, double* %0
%51 = getelementptr inbounds double, double* %0, i64 4
%52 = getelementptr inbounds double, double* %0, i64 5
%53 = bitcast double* %49 to i8*
store double 1.000000e+00, double* %51
%54 = getelementptr inbounds double, double* %0, i64 8
%55 = bitcast double* %52 to i8*
store double 1.000000e+00, double* %54
br label %96
56: ; preds = %45
store double -1.000000e+00, double* %0
%57 = getelementptr inbounds double, double* %0, i64 4
%58 = getelementptr inbounds double, double* %0, i64 5
%59 = bitcast double* %49 to i8*
store double 1.000000e+00, double* %57
%60 = getelementptr inbounds double, double* %0, i64 8
%61 = bitcast double* %58 to i8*
store double -1.000000e+00, double* %60
br label %96
62: ; preds = %40
%63 = getelementptr inbounds [9 x double], [9 x double]* %5, i64 0, i64 0
%64 = bitcast [3 x double]* %4 to <2 x double>*
%65 = load <2 x double>, <2 x double>* %64
%66 = insertelement <2 x double> poison, double %42, i64 0
%67 = shufflevector <2 x double> %66, <2 x double> poison, <2 x i32> zeroinitializer
%68 = fdiv <2 x double> %65, %67
%69 = getelementptr inbounds [9 x double], [9 x double]* %5, i64 0, i64 2
%70 = bitcast [9 x double]* %5 to <2 x double>*
store <2 x double> %68, <2 x double>* %70
%71 = getelementptr inbounds [9 x double], [9 x double]* %5, i64 0, i64 3
store double 0.000000e+00, double* %69
%72 = extractelement <2 x double> %65, i64 1
%73 = fneg double %72
%74 = fdiv double %73, %42
%75 = getelementptr inbounds [9 x double], [9 x double]* %5, i64 0, i64 4
store double %74, double* %71
%76 = getelementptr inbounds [9 x double], [9 x double]* %5, i64 0, i64 5
%77 = extractelement <2 x double> %68, i64 0
store double %77, double* %75
%78 = getelementptr inbounds [9 x double], [9 x double]* %5, i64 0, i64 8
%79 = bitcast double* %76 to i8*
store double 1.000000e+00, double* %78
%80 = getelementptr inbounds [9 x double], [9 x double]* %6, i64 0, i64 0
%81 = getelementptr inbounds [3 x double], [3 x double]* %4, i64 0, i64 2
%82 = load double, double* %81
%83 = fdiv double %82, %43
%84 = getelementptr inbounds [9 x double], [9 x double]* %6, i64 0, i64 1
store double %83, double* %80
%85 = getelementptr inbounds [9 x double], [9 x double]* %6, i64 0, i64 2
store double 0.000000e+00, double* %84
%86 = fneg double %42
%87 = fdiv double %86, %43
%88 = getelementptr inbounds [9 x double], [9 x double]* %6, i64 0, i64 3
store double %87, double* %85
%89 = getelementptr inbounds [9 x double], [9 x double]* %6, i64 0, i64 5
%90 = bitcast double* %88 to <2 x double>*
store <2 x double> <double 0.000000e+00, double 1.000000e+00>, <2 x double>* %90
%91 = getelementptr inbounds [9 x double], [9 x double]* %6, i64 0, i64 6
store double 0.000000e+00, double* %89
%92 = fdiv double %42, %43
%93 = getelementptr inbounds [9 x double], [9 x double]* %6, i64 0, i64 7
store double %92, double* %91
%94 = getelementptr inbounds [9 x double], [9 x double]* %6, i64 0, i64 8
store double 0.000000e+00, double* %93
store double %83, double* %94
%95 = call i32 @mat_mult_3d(double* %0, double* %80, double* %63)
br label %96
96: ; preds = %26, %50, %56, %62
ret void
}