#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*/ Rodrigues(double *, double *, double *, double, double,
                             double, double);
double acos(double);
double atan2(double, double);
double sqrt(double);
void GetAngles(double x, double y, double z, double vx, double vy, double vz,
               double Lambda, double Phi, double *theta, double *gamma) {
  double r, xstar, ystar, zstar, v, d;
  r = sqrt(x * x + y * y + z * z);
  v = sqrt(vx * vx + vy * vy + vz * vz);
  x /= r;
  y /= r;
  z /= r;
  vx /= v;
  vy /= v;
  vz /= v;
  xstar = -x;
  ystar = -y;
  zstar = -z;
  if ((Lambda != 0) || (Phi != 0)) {
    double vlon, vlonx, vlony, vlonz;
    double vlat, vlatx, vlaty, vlatz;
    vlonx = (y * vz - z * vy);
    vlony = (z * vx - x * vz);
    vlonz = (x * vy - y * vx);
    vlon = sqrt(vlonx * vlonx + vlony * vlony + vlonz * vlonz);
    vlonx /= vlon;
    vlony /= vlon;
    vlonz /= vlon;
    Rodrigues(&xstar, &ystar, &zstar, vlonx, vlony, vlonz, Lambda);
    vlatx = (vlony * zstar - vlonz * ystar);
    vlaty = (vlonz * xstar - vlonx * zstar);
    vlatz = (vlonx * ystar - vlony * xstar);
    vlat = sqrt(vlatx * vlatx + vlaty * vlaty + vlatz * vlatz);
    vlatx /= vlat;
    vlaty /= vlat;
    vlatz /= vlat;
    Rodrigues(&xstar, &ystar, &zstar, vlatx, vlaty, vlatz, Phi);
  }
  d = sqrt(xstar * xstar + ystar * ystar);
  *gamma = atan2(ystar, xstar) + acos(-1.);
  if (zstar <= 0)
    *theta = acos(d);
  else
    *theta = -acos(d);
}


x86 assembly (clang, -O0):
<GetAngles>:
push   %rbp
mov    %rsp,%rbp
sub    $0xd0,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  %xmm3,-0x20(%rbp)
movsd  %xmm4,-0x28(%rbp)
movsd  %xmm5,-0x30(%rbp)
movsd  %xmm6,-0x38(%rbp)
movsd  %xmm7,-0x40(%rbp)
mov    %rdi,-0x48(%rbp)
mov    %rsi,-0x50(%rbp)
movsd  -0x8(%rbp),%xmm1
movsd  -0x8(%rbp),%xmm2
movsd  -0x10(%rbp),%xmm0
mulsd  -0x10(%rbp),%xmm0
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  -0x18(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
call   1060 <sqrt@plt>
movsd  %xmm0,-0x58(%rbp)
movsd  -0x20(%rbp),%xmm1
movsd  -0x20(%rbp),%xmm2
movsd  -0x28(%rbp),%xmm0
mulsd  -0x28(%rbp),%xmm0
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  -0x30(%rbp),%xmm0
movsd  -0x30(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
call   1060 <sqrt@plt>
movsd  %xmm0,-0x78(%rbp)
movsd  -0x58(%rbp),%xmm1
movsd  -0x8(%rbp),%xmm0
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x58(%rbp),%xmm1
movsd  -0x10(%rbp),%xmm0
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x58(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm0
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x78(%rbp),%xmm1
movsd  -0x20(%rbp),%xmm0
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x78(%rbp),%xmm1
movsd  -0x28(%rbp),%xmm0
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x78(%rbp),%xmm1
movsd  -0x30(%rbp),%xmm0
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x8(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x60(%rbp)
movsd  -0x10(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x68(%rbp)
movsd  -0x18(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x70(%rbp)
movsd  -0x38(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    12f5 <GetAngles+0x1b5>
jp     12f5 <GetAngles+0x1b5>
movsd  -0x40(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    12f5 <GetAngles+0x1b5>
jp     12f5 <GetAngles+0x1b5>
jmp    1607 <GetAngles+0x4c7>
movsd  -0x10(%rbp),%xmm0
movsd  -0x30(%rbp),%xmm2
movsd  -0x18(%rbp),%xmm1
mulsd  -0x28(%rbp),%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x90(%rbp)
ff
movsd  -0x18(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm2
movsd  -0x8(%rbp),%xmm1
mulsd  -0x30(%rbp),%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x98(%rbp)
ff
movsd  -0x8(%rbp),%xmm0
movsd  -0x28(%rbp),%xmm2
movsd  -0x10(%rbp),%xmm1
mulsd  -0x20(%rbp),%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0xa0(%rbp)
ff
movsd  -0x90(%rbp),%xmm1
ff
movsd  -0x90(%rbp),%xmm2
ff
movsd  -0x98(%rbp),%xmm0
ff
mulsd  -0x98(%rbp),%xmm0
ff
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  -0xa0(%rbp),%xmm0
ff
movsd  -0xa0(%rbp),%xmm2
ff
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
call   1060 <sqrt@plt>
movsd  %xmm0,-0x88(%rbp)
ff
movsd  -0x88(%rbp),%xmm1
ff
movsd  -0x90(%rbp),%xmm0
ff
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x90(%rbp)
ff
movsd  -0x88(%rbp),%xmm1
ff
movsd  -0x98(%rbp),%xmm0
ff
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x98(%rbp)
ff
movsd  -0x88(%rbp),%xmm1
ff
movsd  -0xa0(%rbp),%xmm0
ff
divsd  %xmm1,%xmm0
movsd  %xmm0,-0xa0(%rbp)
ff
movsd  -0x90(%rbp),%xmm0
ff
movsd  -0x98(%rbp),%xmm1
ff
movsd  -0xa0(%rbp),%xmm2
ff
movsd  -0x38(%rbp),%xmm3
lea    -0x60(%rbp),%rdi
lea    -0x68(%rbp),%rsi
lea    -0x70(%rbp),%rdx
call   1050 <Rodrigues@plt>
movsd  -0x98(%rbp),%xmm0
ff
movsd  -0x70(%rbp),%xmm2
movsd  -0xa0(%rbp),%xmm1
ff
mulsd  -0x68(%rbp),%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0xb0(%rbp)
ff
movsd  -0xa0(%rbp),%xmm0
ff
movsd  -0x60(%rbp),%xmm2
movsd  -0x90(%rbp),%xmm1
ff
mulsd  -0x70(%rbp),%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0xb8(%rbp)
ff
movsd  -0x90(%rbp),%xmm0
ff
movsd  -0x68(%rbp),%xmm2
movsd  -0x98(%rbp),%xmm1
ff
mulsd  -0x60(%rbp),%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0xc0(%rbp)
ff
movsd  -0xb0(%rbp),%xmm1
ff
movsd  -0xb0(%rbp),%xmm2
ff
movsd  -0xb8(%rbp),%xmm0
ff
mulsd  -0xb8(%rbp),%xmm0
ff
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  -0xc0(%rbp),%xmm0
ff
movsd  -0xc0(%rbp),%xmm2
ff
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
call   1060 <sqrt@plt>
movsd  %xmm0,-0xa8(%rbp)
ff
movsd  -0xa8(%rbp),%xmm1
ff
movsd  -0xb0(%rbp),%xmm0
ff
divsd  %xmm1,%xmm0
movsd  %xmm0,-0xb0(%rbp)
ff
movsd  -0xa8(%rbp),%xmm1
ff
movsd  -0xb8(%rbp),%xmm0
ff
divsd  %xmm1,%xmm0
movsd  %xmm0,-0xb8(%rbp)
ff
movsd  -0xa8(%rbp),%xmm1
ff
movsd  -0xc0(%rbp),%xmm0
ff
divsd  %xmm1,%xmm0
movsd  %xmm0,-0xc0(%rbp)
ff
movsd  -0xb0(%rbp),%xmm0
ff
movsd  -0xb8(%rbp),%xmm1
ff
movsd  -0xc0(%rbp),%xmm2
ff
movsd  -0x40(%rbp),%xmm3
lea    -0x60(%rbp),%rdi
lea    -0x68(%rbp),%rsi
lea    -0x70(%rbp),%rdx
call   1050 <Rodrigues@plt>
movsd  -0x60(%rbp),%xmm0
movsd  -0x60(%rbp),%xmm2
movsd  -0x68(%rbp),%xmm1
mulsd  -0x68(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
call   1060 <sqrt@plt>
movsd  %xmm0,-0x80(%rbp)
movsd  -0x68(%rbp),%xmm0
movsd  -0x60(%rbp),%xmm1
call   1030 <atan2@plt>
movsd  %xmm0,-0xc8(%rbp)
ff
movsd  0x9b4(%rip),%xmm0
call   1040 <acos@plt>
movaps %xmm0,%xmm1
movsd  -0xc8(%rbp),%xmm0
ff
addsd  %xmm1,%xmm0
mov    -0x50(%rbp),%rax
movsd  %xmm0,(%rax)
xorps  %xmm0,%xmm0
ucomisd -0x70(%rbp),%xmm0
jb     168d <GetAngles+0x54d>
movsd  -0x80(%rbp),%xmm0
call   1040 <acos@plt>
mov    -0x48(%rbp),%rax
movsd  %xmm0,(%rax)
jmp    16b6 <GetAngles+0x576>
movsd  -0x80(%rbp),%xmm0
call   1040 <acos@plt>
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mov    -0x48(%rbp),%rax
movsd  %xmm0,(%rax)
add    $0xd0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<GetAngles>:
push   %r14
push   %rbx
sub    $0x98,%rsp
mov    %rsi,%rbx
mov    %rdi,%r14
movsd  %xmm7,0x68(%rsp)
movapd %xmm5,%xmm11
movapd %xmm3,%xmm10
movapd %xmm0,%xmm5
movapd %xmm1,%xmm0
mulsd  %xmm1,%xmm0
movapd %xmm5,%xmm3
mulsd  %xmm5,%xmm3
addsd  %xmm0,%xmm3
movapd %xmm2,%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm3,%xmm0
xorpd  %xmm3,%xmm3
ucomisd %xmm3,%xmm0
movapd %xmm1,0x20(%rsp)
movapd %xmm2,(%rsp)
movsd  %xmm6,0x50(%rsp)
movsd  %xmm4,0x40(%rsp)
movsd  %xmm10,0x60(%rsp)
movsd  %xmm11,0x58(%rsp)
movapd %xmm5,0x70(%rsp)
jb     11c2 <GetAngles+0x82>
xorps  %xmm5,%xmm5
sqrtsd %xmm0,%xmm5
jmp    11e3 <GetAngles+0xa3>
call   1060 <sqrt@plt>
xorpd  %xmm3,%xmm3
movsd  0x58(%rsp),%xmm11
movsd  0x60(%rsp),%xmm10
movsd  0x40(%rsp),%xmm4
movapd %xmm0,%xmm5
movapd %xmm4,%xmm0
mulsd  %xmm4,%xmm0
movapd %xmm10,%xmm1
mulsd  %xmm10,%xmm1
addsd  %xmm0,%xmm1
movapd %xmm11,%xmm0
mulsd  %xmm11,%xmm0
addsd  %xmm1,%xmm0
ucomisd %xmm3,%xmm0
jb     1214 <GetAngles+0xd4>
sqrtsd %xmm0,%xmm9
jmp    1244 <GetAngles+0x104>
movapd %xmm5,0x80(%rsp)
call   1060 <sqrt@plt>
movapd 0x80(%rsp),%xmm5
movsd  0x58(%rsp),%xmm11
movsd  0x60(%rsp),%xmm10
movsd  0x40(%rsp),%xmm4
movapd %xmm0,%xmm9
movapd 0x20(%rsp),%xmm2
movapd (%rsp),%xmm1
movsd  0x50(%rsp),%xmm3
movapd 0x70(%rsp),%xmm0
unpcklpd %xmm0,%xmm2
divsd  %xmm5,%xmm1
unpcklpd %xmm5,%xmm5
divpd  %xmm5,%xmm2
movapd 0xd8d(%rip),%xmm7
movapd %xmm2,%xmm0
xorpd  %xmm7,%xmm0
pshufd $0xee,%xmm0,%xmm6
movq   %xmm6,0x18(%rsp)
movlpd %xmm0,0x10(%rsp)
xorpd  %xmm1,%xmm7
movlpd %xmm7,0x38(%rsp)
xorpd  %xmm8,%xmm8
ucomisd %xmm8,%xmm3
jne    12b7 <GetAngles+0x177>
jp     12b7 <GetAngles+0x177>
movsd  0x68(%rsp),%xmm5
ucomisd %xmm8,%xmm5
jne    12b7 <GetAngles+0x177>
jnp    1465 <GetAngles+0x325>
divsd  %xmm9,%xmm10
divsd  %xmm9,%xmm4
divsd  %xmm9,%xmm11
mulsd  %xmm4,%xmm7
movapd %xmm2,%xmm5
mulsd  %xmm11,%xmm5
addsd  %xmm7,%xmm5
mulsd  %xmm11,%xmm6
mulsd  %xmm10,%xmm1
addsd  %xmm6,%xmm1
mulsd  %xmm10,%xmm0
unpckhpd %xmm2,%xmm2
mulsd  %xmm4,%xmm2
addsd  %xmm0,%xmm2
movapd %xmm1,%xmm0
mulsd  %xmm1,%xmm0
movapd %xmm5,0x40(%rsp)
movapd %xmm5,%xmm4
mulsd  %xmm5,%xmm4
addsd  %xmm0,%xmm4
movapd %xmm2,%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm4,%xmm0
ucomisd %xmm8,%xmm0
jb     1329 <GetAngles+0x1e9>
sqrtsd %xmm0,%xmm0
jmp    134a <GetAngles+0x20a>
movapd %xmm2,0x20(%rsp)
movapd %xmm1,(%rsp)
call   1060 <sqrt@plt>
movsd  0x50(%rsp),%xmm3
movapd (%rsp),%xmm1
movapd 0x20(%rsp),%xmm2
movapd 0x40(%rsp),%xmm4
divsd  %xmm0,%xmm4
movapd %xmm4,0x40(%rsp)
divsd  %xmm0,%xmm1
movapd %xmm1,(%rsp)
divsd  %xmm0,%xmm2
movapd %xmm2,0x20(%rsp)
lea    0x18(%rsp),%rdi
lea    0x10(%rsp),%rsi
lea    0x38(%rsp),%rdx
movapd %xmm4,%xmm0
call   1050 <Rodrigues@plt>
movapd 0x20(%rsp),%xmm3
movsd  0x38(%rsp),%xmm0
movsd  0x10(%rsp),%xmm1
movapd (%rsp),%xmm5
movapd %xmm5,%xmm4
mulsd  %xmm0,%xmm4
movapd 0x40(%rsp),%xmm2
mulsd  %xmm2,%xmm0
mulsd  %xmm1,%xmm2
mulsd  %xmm3,%xmm1
subsd  %xmm1,%xmm4
movsd  0x18(%rsp),%xmm1
mulsd  %xmm1,%xmm3
subsd  %xmm0,%xmm3
movapd %xmm5,%xmm0
mulsd  %xmm1,%xmm0
subsd  %xmm0,%xmm2
movapd %xmm3,%xmm0
mulsd  %xmm3,%xmm0
movapd %xmm4,%xmm1
mulsd  %xmm4,%xmm1
addsd  %xmm0,%xmm1
movapd %xmm2,0x40(%rsp)
movapd %xmm2,%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     140a <GetAngles+0x2ca>
sqrtsd %xmm0,%xmm0
jmp    1425 <GetAngles+0x2e5>
movapd %xmm3,0x20(%rsp)
movapd %xmm4,(%rsp)
call   1060 <sqrt@plt>
movapd (%rsp),%xmm4
movapd 0x20(%rsp),%xmm3
divsd  %xmm0,%xmm4
divsd  %xmm0,%xmm3
movapd 0x40(%rsp),%xmm2
divsd  %xmm0,%xmm2
lea    0x18(%rsp),%rdi
lea    0x10(%rsp),%rsi
lea    0x38(%rsp),%rdx
movapd %xmm4,%xmm0
movapd %xmm3,%xmm1
movsd  0x68(%rsp),%xmm3
call   1050 <Rodrigues@plt>
movsd  0x10(%rsp),%xmm0
movhpd 0x18(%rsp),%xmm0
movapd %xmm0,%xmm1
mulsd  %xmm0,%xmm1
unpckhpd %xmm0,%xmm0
mulsd  %xmm0,%xmm0
addsd  %xmm1,%xmm0
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     1489 <GetAngles+0x349>
sqrtsd %xmm0,%xmm0
jmp    148e <GetAngles+0x34e>
call   1060 <sqrt@plt>
movsd  %xmm0,(%rsp)
movsd  0x10(%rsp),%xmm0
movsd  0x18(%rsp),%xmm1
call   1030 <atan2@plt>
addsd  0xb64(%rip),%xmm0
movsd  %xmm0,(%rbx)
movsd  0x38(%rsp),%xmm0
movaps %xmm0,0x20(%rsp)
movsd  (%rsp),%xmm0
call   1040 <acos@plt>
movapd 0xb33(%rip),%xmm1
xorpd  %xmm0,%xmm1
movapd 0x20(%rsp),%xmm3
cmpnlesd 0xb38(%rip),%xmm3
movapd %xmm3,%xmm2
andnpd %xmm0,%xmm2
andpd  %xmm1,%xmm3
orpd   %xmm2,%xmm3
movlpd %xmm3,(%r14)
add    $0x98,%rsp
pop    %rbx
pop    %r14
ret

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

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