#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 acos(double);
double sin(double);
int arGetAngle(double rot[3][3], double *wa, double *wb, double *wc) {
  double a, b, c;
  double sina, cosa, sinb, cosb, sinc, cosc;
  if (rot[2][2] > 1.0) {
    rot[2][2] = 1.0;
  } else if (rot[2][2] < -1.0) {
    rot[2][2] = -1.0;
  }
  cosb = rot[2][2];
  b = acos(cosb);
  sinb = sin(b);
  if (b >= 0.000001 || b <= -0.000001) {
    cosa = rot[0][2] / sinb;
    sina = rot[1][2] / sinb;
    if (cosa > 1.0) {
      cosa = 1.0;
      sina = 0.0;
    }
    if (cosa < -1.0) {
      cosa = -1.0;
      sina = 0.0;
    }
    if (sina > 1.0) {
      sina = 1.0;
      cosa = 0.0;
    }
    if (sina < -1.0) {
      sina = -1.0;
      cosa = 0.0;
    }
    a = acos(cosa);
    if (sina < 0)
      a = -a;
    sinc = (rot[2][1] * rot[0][2] - rot[2][0] * rot[1][2]) /
           (rot[0][2] * rot[0][2] + rot[1][2] * rot[1][2]);
    cosc = -(rot[0][2] * rot[2][0] + rot[1][2] * rot[2][1]) /
           (rot[0][2] * rot[0][2] + rot[1][2] * rot[1][2]);
    if (cosc > 1.0) {
      cosc = 1.0;
      sinc = 0.0;
    }
    if (cosc < -1.0) {
      cosc = -1.0;
      sinc = 0.0;
    }
    if (sinc > 1.0) {
      sinc = 1.0;
      cosc = 0.0;
    }
    if (sinc < -1.0) {
      sinc = -1.0;
      cosc = 0.0;
    }
    c = acos(cosc);
    if (sinc < 0)
      c = -c;
  } else {
    a = b = 0.0;
    cosa = cosb = 1.0;
    sina = sinb = 0.0;
    cosc = rot[0][0];
    sinc = rot[1][0];
    if (cosc > 1.0) {
      cosc = 1.0;
      sinc = 0.0;
    }
    if (cosc < -1.0) {
      cosc = -1.0;
      sinc = 0.0;
    }
    if (sinc > 1.0) {
      sinc = 1.0;
      cosc = 0.0;
    }
    if (sinc < -1.0) {
      sinc = -1.0;
      cosc = 0.0;
    }
    c = acos(cosc);
    if (sinc < 0)
      c = -c;
  }
  *wa = a;
  *wb = b;
  *wc = c;
  return 0;
}


x86 assembly (clang, -O0):
<arGetAngle>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rax
movsd  0x40(%rax),%xmm0
movsd  0xeb7(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    1169 <arGetAngle+0x49>
mov    -0x8(%rbp),%rax
movsd  0xea1(%rip),%xmm0
movsd  %xmm0,0x40(%rax)
jmp    1196 <arGetAngle+0x76>
mov    -0x8(%rbp),%rax
movsd  0xe93(%rip),%xmm0
ucomisd 0x40(%rax),%xmm0
jbe    1191 <arGetAngle+0x71>
mov    -0x8(%rbp),%rax
movsd  0xe7c(%rip),%xmm0
movsd  %xmm0,0x40(%rax)
jmp    1196 <arGetAngle+0x76>
mov    -0x8(%rbp),%rax
movsd  0x40(%rax),%xmm0
movsd  %xmm0,-0x58(%rbp)
movsd  -0x58(%rbp),%xmm0
call   1030 <acos@plt>
movsd  %xmm0,-0x30(%rbp)
movsd  -0x30(%rbp),%xmm0
call   1040 <sin@plt>
movsd  %xmm0,-0x50(%rbp)
movsd  -0x30(%rbp),%xmm0
movsd  0xe41(%rip),%xmm1
ucomisd %xmm1,%xmm0
jae    11ec <arGetAngle+0xcc>
movsd  0xe37(%rip),%xmm0
ucomisd -0x30(%rbp),%xmm0
jb     14d3 <arGetAngle+0x3b3>
mov    -0x8(%rbp),%rax
movsd  0x10(%rax),%xmm0
divsd  -0x50(%rbp),%xmm0
movsd  %xmm0,-0x48(%rbp)
mov    -0x8(%rbp),%rax
movsd  0x28(%rax),%xmm0
divsd  -0x50(%rbp),%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x48(%rbp),%xmm0
movsd  0xde1(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    123e <arGetAngle+0x11e>
movsd  0xdcf(%rip),%xmm0
movsd  %xmm0,-0x48(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  0xdc2(%rip),%xmm0
ucomisd -0x48(%rbp),%xmm0
jbe    1266 <arGetAngle+0x146>
movsd  0xdaf(%rip),%xmm0
movsd  %xmm0,-0x48(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x40(%rbp),%xmm0
movsd  0xd8d(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    1292 <arGetAngle+0x172>
movsd  0xd7b(%rip),%xmm0
movsd  %xmm0,-0x40(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  0xd6e(%rip),%xmm0
ucomisd -0x40(%rbp),%xmm0
jbe    12ba <arGetAngle+0x19a>
movsd  0xd5b(%rip),%xmm0
movsd  %xmm0,-0x40(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  -0x48(%rbp),%xmm0
call   1030 <acos@plt>
movsd  %xmm0,-0x28(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x40(%rbp),%xmm0
jbe    12f8 <arGetAngle+0x1d8>
movsd  -0x28(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x28(%rbp)
mov    -0x8(%rbp),%rax
movsd  0x38(%rax),%xmm0
mov    -0x8(%rbp),%rax
movsd  0x10(%rax),%xmm2
mov    -0x8(%rbp),%rax
movsd  0x30(%rax),%xmm1
mov    -0x8(%rbp),%rax
mulsd  0x28(%rax),%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x8(%rbp),%rax
movsd  0x10(%rax),%xmm1
mov    -0x8(%rbp),%rax
movsd  0x10(%rax),%xmm3
mov    -0x8(%rbp),%rax
movsd  0x28(%rax),%xmm2
mov    -0x8(%rbp),%rax
mulsd  0x28(%rax),%xmm2
mulsd  %xmm3,%xmm1
addsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x60(%rbp)
mov    -0x8(%rbp),%rax
movsd  0x10(%rax),%xmm0
mov    -0x8(%rbp),%rax
movsd  0x30(%rax),%xmm2
mov    -0x8(%rbp),%rax
movsd  0x28(%rax),%xmm1
mov    -0x8(%rbp),%rax
mulsd  0x38(%rax),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mov    -0x8(%rbp),%rax
movsd  0x10(%rax),%xmm1
mov    -0x8(%rbp),%rax
movsd  0x10(%rax),%xmm3
mov    -0x8(%rbp),%rax
movsd  0x28(%rax),%xmm2
mov    -0x8(%rbp),%rax
mulsd  0x28(%rax),%xmm2
mulsd  %xmm3,%xmm1
addsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x68(%rbp)
movsd  -0x68(%rbp),%xmm0
movsd  0xc0b(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    1414 <arGetAngle+0x2f4>
movsd  0xbf9(%rip),%xmm0
movsd  %xmm0,-0x68(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x60(%rbp)
movsd  0xbec(%rip),%xmm0
ucomisd -0x68(%rbp),%xmm0
jbe    143c <arGetAngle+0x31c>
movsd  0xbd9(%rip),%xmm0
movsd  %xmm0,-0x68(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x60(%rbp)
movsd  -0x60(%rbp),%xmm0
movsd  0xbb7(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    1468 <arGetAngle+0x348>
movsd  0xba5(%rip),%xmm0
movsd  %xmm0,-0x60(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x68(%rbp)
movsd  0xb98(%rip),%xmm0
ucomisd -0x60(%rbp),%xmm0
jbe    1490 <arGetAngle+0x370>
movsd  0xb85(%rip),%xmm0
movsd  %xmm0,-0x60(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x68(%rbp)
movsd  -0x68(%rbp),%xmm0
call   1030 <acos@plt>
movsd  %xmm0,-0x38(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x60(%rbp),%xmm0
jbe    14ce <arGetAngle+0x3ae>
movsd  -0x38(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x38(%rbp)
jmp    1613 <arGetAngle+0x4f3>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x30(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  0xb15(%rip),%xmm0
movsd  %xmm0,-0x58(%rbp)
movsd  0xb08(%rip),%xmm0
movsd  %xmm0,-0x48(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x50(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x40(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x68(%rbp)
mov    -0x8(%rbp),%rax
movsd  0x18(%rax),%xmm0
movsd  %xmm0,-0x60(%rbp)
movsd  -0x68(%rbp),%xmm0
movsd  0xacb(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    1554 <arGetAngle+0x434>
movsd  0xab9(%rip),%xmm0
movsd  %xmm0,-0x68(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x60(%rbp)
movsd  0xaac(%rip),%xmm0
ucomisd -0x68(%rbp),%xmm0
jbe    157c <arGetAngle+0x45c>
movsd  0xa99(%rip),%xmm0
movsd  %xmm0,-0x68(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x60(%rbp)
movsd  -0x60(%rbp),%xmm0
movsd  0xa77(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    15a8 <arGetAngle+0x488>
movsd  0xa65(%rip),%xmm0
movsd  %xmm0,-0x60(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x68(%rbp)
movsd  0xa58(%rip),%xmm0
ucomisd -0x60(%rbp),%xmm0
jbe    15d0 <arGetAngle+0x4b0>
movsd  0xa45(%rip),%xmm0
movsd  %xmm0,-0x60(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x68(%rbp)
movsd  -0x68(%rbp),%xmm0
call   1030 <acos@plt>
movsd  %xmm0,-0x38(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x60(%rbp),%xmm0
jbe    160e <arGetAngle+0x4ee>
movsd  -0x38(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x38(%rbp)
jmp    1613 <arGetAngle+0x4f3>
movsd  -0x28(%rbp),%xmm0
mov    -0x10(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  -0x30(%rbp),%xmm0
mov    -0x18(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  -0x38(%rbp),%xmm0
mov    -0x20(%rbp),%rax
movsd  %xmm0,(%rax)
xor    %eax,%eax
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<arGetAngle>:
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x28,%rsp
mov    %rcx,%r14
mov    %rdx,%r15
mov    %rsi,%r12
mov    %rdi,%rbx
movsd  0x40(%rdi),%xmm0
movsd  0xebc(%rip),%xmm1
ucomisd %xmm1,%xmm0
ja     1158 <arGetAngle+0x38>
movsd  0xeb6(%rip),%xmm1
ucomisd %xmm0,%xmm1
jbe    1161 <arGetAngle+0x41>
movsd  %xmm1,0x40(%rbx)
movapd %xmm1,%xmm0
call   1030 <acos@plt>
movsd  %xmm0,0x8(%rsp)
call   1040 <sin@plt>
movsd  0x8(%rsp),%xmm2
ucomisd 0xe91(%rip),%xmm2
jae    1220 <arGetAngle+0x100>
movsd  0xe8b(%rip),%xmm1
ucomisd %xmm2,%xmm1
jae    1220 <arGetAngle+0x100>
movsd  (%rbx),%xmm1
movsd  0xe5d(%rip),%xmm0
movapd %xmm0,%xmm2
minsd  %xmm1,%xmm2
movapd %xmm0,%xmm3
cmpltsd %xmm1,%xmm3
movsd  0xe4c(%rip),%xmm1
movapd %xmm1,%xmm4
maxsd  %xmm2,%xmm4
cmpltsd %xmm1,%xmm2
movsd  0x18(%rbx),%xmm5
andnpd %xmm5,%xmm2
andnpd %xmm2,%xmm3
movapd %xmm0,%xmm2
minsd  %xmm3,%xmm2
movapd %xmm1,%xmm5
maxsd  %xmm2,%xmm5
movsd  %xmm5,0x8(%rsp)
cmpltsd %xmm3,%xmm0
cmpltsd %xmm1,%xmm2
andnpd %xmm4,%xmm2
andnpd %xmm2,%xmm0
call   1030 <acos@plt>
xorpd  %xmm2,%xmm2
ucomisd 0x8(%rsp),%xmm2
jbe    1217 <arGetAngle+0xf7>
xorpd  0xe19(%rip),%xmm0
xorpd  %xmm1,%xmm1
jmp    13b1 <arGetAngle+0x291>
movsd  0x10(%rbx),%xmm1
movsd  0x28(%rbx),%xmm2
divsd  %xmm0,%xmm1
divsd  %xmm0,%xmm2
movsd  0xdc6(%rip),%xmm4
movapd %xmm4,%xmm0
minsd  %xmm1,%xmm0
movsd  0xdbe(%rip),%xmm5
movapd %xmm5,%xmm3
maxsd  %xmm0,%xmm3
cmpltsd %xmm5,%xmm0
andnpd %xmm2,%xmm0
movapd %xmm4,%xmm2
cmpltsd %xmm1,%xmm2
andnpd %xmm0,%xmm2
movapd %xmm4,%xmm1
minsd  %xmm2,%xmm1
movapd %xmm5,%xmm0
maxsd  %xmm1,%xmm0
movapd %xmm0,0x10(%rsp)
movapd %xmm4,%xmm0
cmpltsd %xmm2,%xmm0
cmpltsd %xmm5,%xmm1
andnpd %xmm3,%xmm1
andnpd %xmm1,%xmm0
call   1030 <acos@plt>
movapd 0xd8f(%rip),%xmm7
xorpd  %xmm1,%xmm1
movapd 0x10(%rsp),%xmm2
cmpltsd %xmm1,%xmm2
movapd %xmm2,%xmm1
andnpd %xmm0,%xmm1
xorpd  %xmm7,%xmm0
andpd  %xmm2,%xmm0
orpd   %xmm1,%xmm0
movapd %xmm0,0x10(%rsp)
movsd  0x38(%rbx),%xmm2
movsd  0x30(%rbx),%xmm3
movsd  0x10(%rbx),%xmm1
movsd  0x28(%rbx),%xmm4
movapd %xmm2,%xmm5
unpcklpd %xmm1,%xmm5
movapd %xmm1,%xmm6
mulsd  %xmm3,%xmm1
xorpd  %xmm7,%xmm3
unpcklpd %xmm4,%xmm3
mulsd  %xmm4,%xmm2
unpcklpd %xmm4,%xmm4
mulpd  %xmm4,%xmm3
unpcklpd %xmm6,%xmm6
mulpd  %xmm5,%xmm6
addpd  %xmm3,%xmm6
movapd %xmm6,%xmm3
unpckhpd %xmm6,%xmm3
divsd  %xmm3,%xmm6
addsd  %xmm2,%xmm1
xorpd  %xmm7,%xmm1
divsd  %xmm3,%xmm1
movsd  0xcd2(%rip),%xmm4
movapd %xmm4,%xmm0
minsd  %xmm1,%xmm0
movsd  0xcca(%rip),%xmm3
movapd %xmm3,%xmm2
maxsd  %xmm0,%xmm2
cmpltsd %xmm3,%xmm0
movapd %xmm3,%xmm5
andnpd %xmm6,%xmm0
movapd %xmm4,%xmm3
cmpltsd %xmm1,%xmm3
andnpd %xmm0,%xmm3
movapd %xmm4,%xmm0
minsd  %xmm3,%xmm0
movapd %xmm5,%xmm1
maxsd  %xmm0,%xmm1
movsd  %xmm1,0x20(%rsp)
cmpltsd %xmm3,%xmm4
cmpltsd %xmm5,%xmm0
andnpd %xmm2,%xmm0
andnpd %xmm0,%xmm4
movapd %xmm4,%xmm0
call   1030 <acos@plt>
xorpd  %xmm1,%xmm1
ucomisd 0x20(%rsp),%xmm1
jbe    13a5 <arGetAngle+0x285>
xorpd  0xc8b(%rip),%xmm0
movsd  0x8(%rsp),%xmm1
movapd 0x10(%rsp),%xmm2
movsd  %xmm2,(%r12)
movsd  %xmm1,(%r15)
movsd  %xmm0,(%r14)
xor    %eax,%eax
add    $0x28,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

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

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