#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 asin(double);
double cos(double);
int fabs(double);
double sin(double);
void lmattoang(double *r, double *a) {
  double temp;
  temp = -r[5];
  if (fabs(temp) > 1)
    temp = (temp > 0) - (temp < 0);
  a[1] = asin(temp);
  if (fabs(cos(a[1])) > 1e-30) {
    temp = r[3] / cos(a[1]);
    if (fabs(temp) > 1)
      temp = (temp > 0) - (temp < 0);
    a[0] = asin(temp);
    if (cos(a[0]) * cos(a[1]) * r[4] < 0)
      a[0] = 3.14159265358979323846264338327950 - a[0];
    temp = r[2] / cos(a[1]);
    if (fabs(temp) > 1)
      temp = (temp > 0) - (temp < 0);
    a[2] = asin(temp);
    if (cos(a[2]) * cos(a[1]) * r[8] < 0)
      a[2] = 3.14159265358979323846264338327950 - a[2];
    if (fabs(sin(a[1]) * sin(a[2]) * sin(a[0]) + cos(a[2]) * cos(a[0]) - r[0]) >
            1e-30 ||
        fabs(sin(a[1]) * sin(a[2]) * cos(a[0]) - cos(a[2]) * sin(a[0]) - r[1]) >
            1e-30) {
      a[0] = 3.14159265358979323846264338327950 + a[0];
      a[1] = 3.14159265358979323846264338327950 - a[1];
      a[2] = 3.14159265358979323846264338327950 + a[2];
    }
  } else {
    a[2] = 0;
    temp = r[0];
    if (fabs(temp) > 1)
      temp = (temp > 0) - (temp < 0);
    a[0] = acos(temp);
    if (fabs(-sin(a[0]) - r[1]) > 1e-30)
      a[0] *= -1;
  }
}


x86 assembly (clang, -O0):
<lmattoang>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsd  0x28(%rax),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
call   1040 <fabs@plt>
cmp    $0x1,%eax
jle    11cb <lmattoang+0x7b>
movsd  -0x18(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
seta   %al
and    $0x1,%al
movzbl %al,%eax
xorps  %xmm0,%xmm0
ucomisd -0x18(%rbp),%xmm0
seta   %cl
and    $0x1,%cl
movzbl %cl,%ecx
sub    %ecx,%eax
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
call   1060 <asin@plt>
mov    -0x10(%rbp),%rax
movsd  %xmm0,0x8(%rax)
mov    -0x10(%rbp),%rax
movsd  0x8(%rax),%xmm0
call   1070 <cos@plt>
call   1040 <fabs@plt>
cvtsi2sd %eax,%xmm0
movsd  0xe03(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    1570 <lmattoang+0x420>
mov    -0x8(%rbp),%rax
movsd  0x18(%rax),%xmm0
movsd  %xmm0,-0x20(%rbp)
mov    -0x10(%rbp),%rax
movsd  0x8(%rax),%xmm0
call   1070 <cos@plt>
movaps %xmm0,%xmm1
movsd  -0x20(%rbp),%xmm0
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
call   1040 <fabs@plt>
cmp    $0x1,%eax
jle    1277 <lmattoang+0x127>
movsd  -0x18(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
seta   %al
and    $0x1,%al
movzbl %al,%eax
xorps  %xmm0,%xmm0
ucomisd -0x18(%rbp),%xmm0
seta   %cl
and    $0x1,%cl
movzbl %cl,%ecx
sub    %ecx,%eax
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
call   1060 <asin@plt>
mov    -0x10(%rbp),%rax
movsd  %xmm0,(%rax)
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
call   1070 <cos@plt>
movsd  %xmm0,-0x28(%rbp)
mov    -0x10(%rbp),%rax
movsd  0x8(%rax),%xmm0
call   1070 <cos@plt>
movsd  -0x28(%rbp),%xmm1
mulsd  %xmm0,%xmm1
mov    -0x8(%rbp),%rax
mulsd  0x20(%rax),%xmm1
xorps  %xmm0,%xmm0
ucomisd %xmm1,%xmm0
jbe    12e0 <lmattoang+0x190>
mov    -0x10(%rbp),%rax
movsd  0xd3c(%rip),%xmm0
subsd  (%rax),%xmm0
mov    -0x10(%rbp),%rax
movsd  %xmm0,(%rax)
mov    -0x8(%rbp),%rax
movsd  0x10(%rax),%xmm0
movsd  %xmm0,-0x30(%rbp)
mov    -0x10(%rbp),%rax
movsd  0x8(%rax),%xmm0
call   1070 <cos@plt>
movaps %xmm0,%xmm1
movsd  -0x30(%rbp),%xmm0
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
call   1040 <fabs@plt>
cmp    $0x1,%eax
jle    1350 <lmattoang+0x200>
movsd  -0x18(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
seta   %al
and    $0x1,%al
movzbl %al,%eax
xorps  %xmm0,%xmm0
ucomisd -0x18(%rbp),%xmm0
seta   %cl
and    $0x1,%cl
movzbl %cl,%ecx
sub    %ecx,%eax
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
call   1060 <asin@plt>
mov    -0x10(%rbp),%rax
movsd  %xmm0,0x10(%rax)
mov    -0x10(%rbp),%rax
movsd  0x10(%rax),%xmm0
call   1070 <cos@plt>
movsd  %xmm0,-0x38(%rbp)
mov    -0x10(%rbp),%rax
movsd  0x8(%rax),%xmm0
call   1070 <cos@plt>
movsd  -0x38(%rbp),%xmm1
mulsd  %xmm0,%xmm1
mov    -0x8(%rbp),%rax
mulsd  0x40(%rax),%xmm1
xorps  %xmm0,%xmm0
ucomisd %xmm1,%xmm0
jbe    13bd <lmattoang+0x26d>
mov    -0x10(%rbp),%rax
movsd  0xc61(%rip),%xmm0
subsd  0x10(%rax),%xmm0
mov    -0x10(%rbp),%rax
movsd  %xmm0,0x10(%rax)
mov    -0x10(%rbp),%rax
movsd  0x8(%rax),%xmm0
call   1050 <sin@plt>
movsd  %xmm0,-0x58(%rbp)
mov    -0x10(%rbp),%rax
movsd  0x10(%rax),%xmm0
call   1050 <sin@plt>
movaps %xmm0,%xmm1
movsd  -0x58(%rbp),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x40(%rbp)
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
call   1050 <sin@plt>
movsd  %xmm0,-0x48(%rbp)
mov    -0x10(%rbp),%rax
movsd  0x10(%rax),%xmm0
call   1070 <cos@plt>
movsd  %xmm0,-0x50(%rbp)
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
call   1070 <cos@plt>
movsd  -0x50(%rbp),%xmm1
movsd  -0x48(%rbp),%xmm2
movaps %xmm0,%xmm3
movsd  -0x40(%rbp),%xmm0
mulsd  %xmm3,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x8(%rbp),%rax
subsd  (%rax),%xmm0
call   1040 <fabs@plt>
cvtsi2sd %eax,%xmm0
movsd  0xba8(%rip),%xmm1
ucomisd %xmm1,%xmm0
ja     151f <lmattoang+0x3cf>
mov    -0x10(%rbp),%rax
movsd  0x8(%rax),%xmm0
call   1050 <sin@plt>
movsd  %xmm0,-0x78(%rbp)
mov    -0x10(%rbp),%rax
movsd  0x10(%rax),%xmm0
call   1050 <sin@plt>
movaps %xmm0,%xmm1
movsd  -0x78(%rbp),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x60(%rbp)
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
call   1070 <cos@plt>
movsd  %xmm0,-0x68(%rbp)
mov    -0x10(%rbp),%rax
movsd  0x10(%rax),%xmm0
call   1070 <cos@plt>
movsd  %xmm0,-0x70(%rbp)
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
call   1050 <sin@plt>
movsd  -0x70(%rbp),%xmm1
movsd  -0x68(%rbp),%xmm2
movaps %xmm0,%xmm3
movsd  -0x60(%rbp),%xmm0
mulsd  %xmm3,%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x8(%rbp),%rax
subsd  0x8(%rax),%xmm0
call   1040 <fabs@plt>
cvtsi2sd %eax,%xmm0
movsd  0xaeb(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    156b <lmattoang+0x41b>
mov    -0x10(%rbp),%rax
movsd  0xae5(%rip),%xmm0
addsd  (%rax),%xmm0
mov    -0x10(%rbp),%rax
movsd  %xmm0,(%rax)
mov    -0x10(%rbp),%rax
movsd  0xacd(%rip),%xmm0
subsd  0x8(%rax),%xmm0
mov    -0x10(%rbp),%rax
movsd  %xmm0,0x8(%rax)
mov    -0x10(%rbp),%rax
movsd  0xab3(%rip),%xmm0
addsd  0x10(%rax),%xmm0
mov    -0x10(%rbp),%rax
movsd  %xmm0,0x10(%rax)
jmp    163f <lmattoang+0x4ef>
mov    -0x10(%rbp),%rax
xorps  %xmm0,%xmm0
movsd  %xmm0,0x10(%rax)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
call   1040 <fabs@plt>
cmp    $0x1,%eax
jle    15cc <lmattoang+0x47c>
movsd  -0x18(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
seta   %al
and    $0x1,%al
movzbl %al,%eax
xorps  %xmm0,%xmm0
ucomisd -0x18(%rbp),%xmm0
seta   %cl
and    $0x1,%cl
movzbl %cl,%ecx
sub    %ecx,%eax
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
call   1030 <acos@plt>
mov    -0x10(%rbp),%rax
movsd  %xmm0,(%rax)
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
call   1050 <sin@plt>
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mov    -0x8(%rbp),%rax
subsd  0x8(%rax),%xmm0
call   1040 <fabs@plt>
cvtsi2sd %eax,%xmm0
movsd  0x9e4(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    163a <lmattoang+0x4ea>
mov    -0x10(%rbp),%rax
movsd  0x9d6(%rip),%xmm0
mulsd  (%rax),%xmm0
movsd  %xmm0,(%rax)
jmp    163f <lmattoang+0x4ef>
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lmattoang>:
push   %r14
push   %rbx
sub    $0x38,%rsp
mov    %rsi,%rbx
mov    %rdi,%r14
movsd  0x28(%rdi),%xmm1
movapd 0xe96(%rip),%xmm0
movapd %xmm1,0x20(%rsp)
xorpd  %xmm1,%xmm0
movapd %xmm0,(%rsp)
call   1040 <fabs@plt>
movapd (%rsp),%xmm0
cmp    $0x2,%eax
jl     11ad <lmattoang+0x5d>
xorpd  %xmm0,%xmm0
xor    %eax,%eax
movapd 0x20(%rsp),%xmm1
ucomisd %xmm1,%xmm0
seta   %al
xor    %ecx,%ecx
ucomisd %xmm0,%xmm1
seta   %cl
sub    %ecx,%eax
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
call   1060 <asin@plt>
movsd  %xmm0,0x8(%rbx)
call   1070 <cos@plt>
call   1040 <fabs@plt>
test   %eax,%eax
jle    121c <lmattoang+0xcc>
movsd  0x18(%r14),%xmm0
movsd  %xmm0,(%rsp)
movsd  0x8(%rbx),%xmm0
call   1070 <cos@plt>
movsd  (%rsp),%xmm1
divsd  %xmm0,%xmm1
movsd  %xmm1,(%rsp)
movapd %xmm1,%xmm0
call   1040 <fabs@plt>
cmp    $0x2,%eax
jl     1265 <lmattoang+0x115>
xorpd  %xmm0,%xmm0
xor    %eax,%eax
movsd  (%rsp),%xmm1
ucomisd %xmm0,%xmm1
seta   %al
xor    %ecx,%ecx
ucomisd %xmm1,%xmm0
seta   %cl
sub    %ecx,%eax
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
jmp    126a <lmattoang+0x11a>
movq   $0x0,0x10(%rbx)
movsd  (%r14),%xmm0
movsd  %xmm0,(%rsp)
call   1040 <fabs@plt>
cmp    $0x2,%eax
jl     145f <lmattoang+0x30f>
xorpd  %xmm0,%xmm0
xor    %eax,%eax
movsd  (%rsp),%xmm1
ucomisd %xmm0,%xmm1
seta   %al
xor    %ecx,%ecx
ucomisd %xmm1,%xmm0
seta   %cl
sub    %ecx,%eax
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
jmp    1464 <lmattoang+0x314>
movsd  (%rsp),%xmm0
call   1060 <asin@plt>
movsd  %xmm0,(%rbx)
call   1070 <cos@plt>
movsd  %xmm0,(%rsp)
movsd  0x8(%rbx),%xmm0
call   1070 <cos@plt>
mulsd  (%rsp),%xmm0
mulsd  0x20(%r14),%xmm0
xorpd  %xmm1,%xmm1
ucomisd %xmm0,%xmm1
jbe    12ac <lmattoang+0x15c>
movsd  0xd7c(%rip),%xmm0
subsd  (%rbx),%xmm0
movsd  %xmm0,(%rbx)
movsd  0x10(%r14),%xmm0
movsd  %xmm0,(%rsp)
movsd  0x8(%rbx),%xmm0
call   1070 <cos@plt>
movsd  (%rsp),%xmm1
divsd  %xmm0,%xmm1
movsd  %xmm1,(%rsp)
movapd %xmm1,%xmm0
call   1040 <fabs@plt>
cmp    $0x2,%eax
jl     1303 <lmattoang+0x1b3>
xorpd  %xmm0,%xmm0
xor    %eax,%eax
movsd  (%rsp),%xmm1
ucomisd %xmm0,%xmm1
seta   %al
xor    %ecx,%ecx
ucomisd %xmm1,%xmm0
seta   %cl
sub    %ecx,%eax
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
jmp    1308 <lmattoang+0x1b8>
movsd  (%rsp),%xmm0
call   1060 <asin@plt>
movsd  %xmm0,0x10(%rbx)
call   1070 <cos@plt>
movsd  %xmm0,(%rsp)
movsd  0x8(%rbx),%xmm0
call   1070 <cos@plt>
mulsd  (%rsp),%xmm0
mulsd  0x40(%r14),%xmm0
xorpd  %xmm1,%xmm1
ucomisd %xmm0,%xmm1
jbe    134d <lmattoang+0x1fd>
movsd  0xcdd(%rip),%xmm0
subsd  0x10(%rbx),%xmm0
movsd  %xmm0,0x10(%rbx)
movsd  0x8(%rbx),%xmm0
call   1050 <sin@plt>
movsd  %xmm0,(%rsp)
movsd  0x10(%rbx),%xmm0
call   1050 <sin@plt>
mulsd  (%rsp),%xmm0
movsd  %xmm0,(%rsp)
movsd  (%rbx),%xmm0
call   1050 <sin@plt>
movsd  %xmm0,0x20(%rsp)
movsd  0x10(%rbx),%xmm0
call   1070 <cos@plt>
movsd  %xmm0,0x18(%rsp)
movsd  (%rbx),%xmm0
call   1070 <cos@plt>
mulsd  0x18(%rsp),%xmm0
movsd  0x20(%rsp),%xmm1
mulsd  (%rsp),%xmm1
addsd  %xmm1,%xmm0
subsd  (%r14),%xmm0
call   1040 <fabs@plt>
test   %eax,%eax
jg     142e <lmattoang+0x2de>
movsd  0x8(%rbx),%xmm0
call   1050 <sin@plt>
movsd  %xmm0,(%rsp)
movsd  0x10(%rbx),%xmm0
call   1050 <sin@plt>
mulsd  (%rsp),%xmm0
movsd  %xmm0,(%rsp)
movsd  (%rbx),%xmm0
call   1070 <cos@plt>
movsd  %xmm0,0x20(%rsp)
movsd  0x10(%rbx),%xmm0
call   1070 <cos@plt>
movsd  %xmm0,0x18(%rsp)
movsd  (%rbx),%xmm0
call   1050 <sin@plt>
mulsd  0x18(%rsp),%xmm0
movsd  0x20(%rsp),%xmm1
mulsd  (%rsp),%xmm1
subsd  %xmm0,%xmm1
subsd  0x8(%r14),%xmm1
movapd %xmm1,%xmm0
call   1040 <fabs@plt>
test   %eax,%eax
jle    1499 <lmattoang+0x349>
movupd (%rbx),%xmm0
movsd  0xbe6(%rip),%xmm1
movapd 0xbce(%rip),%xmm2
subpd  %xmm0,%xmm2
addpd  %xmm1,%xmm0
shufpd $0x2,%xmm2,%xmm0
movupd %xmm0,(%rbx)
addsd  0x10(%rbx),%xmm1
movsd  %xmm1,0x10(%rbx)
jmp    1499 <lmattoang+0x349>
movsd  (%rsp),%xmm0
call   1030 <acos@plt>
movsd  %xmm0,(%rbx)
call   1050 <sin@plt>
xorpd  0xb86(%rip),%xmm0
subsd  0x8(%r14),%xmm0
call   1040 <fabs@plt>
test   %eax,%eax
jle    1499 <lmattoang+0x349>
movsd  (%rbx),%xmm0
xorpd  0xb6b(%rip),%xmm0
movlpd %xmm0,(%rbx)
add    $0x38,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define void @lmattoang(double* nocapture %0, double* nocapture %1) {
%3 = getelementptr inbounds double, double* %0, i64 5
%4 = load double, double* %3
%5 = fneg double %4
%6 = tail call i32 @fabs(double %5)
%7 = icmp sgt i32 %6, 1
br i1 %7, label %8, label %15
8: ; preds = %2
%9 = fcmp olt double %4, 0.000000e+00
%10 = zext i1 %9 to i32
%11 = fcmp ogt double %4, 0.000000e+00
%12 = sext i1 %11 to i32
%13 = add nsw i32 %12, %10
%14 = sitofp i32 %13 to double
br label %15
15: ; preds = %8, %2
%16 = phi double [ %14, %8 ], [ %5, %2 ]
%17 = tail call double @asin(double %16)
%18 = getelementptr inbounds double, double* %1, i64 1
store double %17, double* %18
%19 = tail call double @cos(double %17)
%20 = tail call i32 @fabs(double %19)
%21 = icmp sgt i32 %20, 0
br i1 %21, label %22, label %128
22: ; preds = %15
%23 = getelementptr inbounds double, double* %0, i64 3
%24 = load double, double* %23
%25 = load double, double* %18
%26 = tail call double @cos(double %25)
%27 = fdiv double %24, %26
%28 = tail call i32 @fabs(double %27)
%29 = icmp sgt i32 %28, 1
br i1 %29, label %30, label %37
30: ; preds = %22
%31 = fcmp ogt double %27, 0.000000e+00
%32 = zext i1 %31 to i32
%33 = fcmp olt double %27, 0.000000e+00
%34 = sext i1 %33 to i32
%35 = add nsw i32 %34, %32
%36 = sitofp i32 %35 to double
br label %37
37: ; preds = %30, %22
%38 = phi double [ %36, %30 ], [ %27, %22 ]
%39 = tail call double @asin(double %38)
store double %39, double* %1
%40 = tail call double @cos(double %39)
%41 = load double, double* %18
%42 = tail call double @cos(double %41)
%43 = fmul double %40, %42
%44 = getelementptr inbounds double, double* %0, i64 4
%45 = load double, double* %44
%46 = fmul double %43, %45
%47 = fcmp olt double %46, 0.000000e+00
br i1 %47, label %48, label %51
48: ; preds = %37
%49 = load double, double* %1
%50 = fsub double 0x400921FB54442D18, %49
store double %50, double* %1
br label %51
51: ; preds = %48, %37
%52 = getelementptr inbounds double, double* %0, i64 2
%53 = load double, double* %52
%54 = load double, double* %18
%55 = tail call double @cos(double %54)
%56 = fdiv double %53, %55
%57 = tail call i32 @fabs(double %56)
%58 = icmp sgt i32 %57, 1
br i1 %58, label %59, label %66
59: ; preds = %51
%60 = fcmp ogt double %56, 0.000000e+00
%61 = zext i1 %60 to i32
%62 = fcmp olt double %56, 0.000000e+00
%63 = sext i1 %62 to i32
%64 = add nsw i32 %63, %61
%65 = sitofp i32 %64 to double
br label %66
66: ; preds = %59, %51
%67 = phi double [ %65, %59 ], [ %56, %51 ]
%68 = tail call double @asin(double %67)
%69 = getelementptr inbounds double, double* %1, i64 2
store double %68, double* %69
%70 = tail call double @cos(double %68)
%71 = load double, double* %18
%72 = tail call double @cos(double %71)
%73 = fmul double %70, %72
%74 = getelementptr inbounds double, double* %0, i64 8
%75 = load double, double* %74
%76 = fmul double %73, %75
%77 = fcmp olt double %76, 0.000000e+00
br i1 %77, label %78, label %81
78: ; preds = %66
%79 = load double, double* %69
%80 = fsub double 0x400921FB54442D18, %79
store double %80, double* %69
br label %81
81: ; preds = %78, %66
%82 = load double, double* %18
%83 = tail call double @sin(double %82)
%84 = load double, double* %69
%85 = tail call double @sin(double %84)
%86 = fmul double %83, %85
%87 = load double, double* %1
%88 = tail call double @sin(double %87)
%89 = load double, double* %69
%90 = tail call double @cos(double %89)
%91 = load double, double* %1
%92 = tail call double @cos(double %91)
%93 = fmul double %90, %92
%94 = tail call double @llvm.fmuladd.f64(double %86, double %88, double %93)
%95 = load double, double* %0
%96 = fsub double %94, %95
%97 = tail call i32 @fabs(double %96)
%98 = icmp sgt i32 %97, 0
br i1 %98, label %119, label %99
99: ; preds = %81
%100 = load double, double* %18
%101 = tail call double @sin(double %100)
%102 = load double, double* %69
%103 = tail call double @sin(double %102)
%104 = fmul double %101, %103
%105 = load double, double* %1
%106 = tail call double @cos(double %105)
%107 = load double, double* %69
%108 = tail call double @cos(double %107)
%109 = load double, double* %1
%110 = tail call double @sin(double %109)
%111 = fneg double %108
%112 = fmul double %110, %111
%113 = tail call double @llvm.fmuladd.f64(double %104, double %106, double %112)
%114 = getelementptr inbounds double, double* %0, i64 1
%115 = load double, double* %114
%116 = fsub double %113, %115
%117 = tail call i32 @fabs(double %116)
%118 = icmp sgt i32 %117, 0
br i1 %118, label %119, label %153
119: ; preds = %99, %81
%120 = bitcast double* %1 to <2 x double>*
%121 = load <2 x double>, <2 x double>* %120
%122 = fadd <2 x double> %121, <double 0x400921FB54442D18, double poison>
%123 = fsub <2 x double> <double poison, double 0x400921FB54442D18>, %121
%124 = shufflevector <2 x double> %122, <2 x double> %123, <2 x i32> <i32 0, i32 3>
%125 = bitcast double* %1 to <2 x double>*
store <2 x double> %124, <2 x double>* %125
%126 = load double, double* %69
%127 = fadd double %126, 0x400921FB54442D18
store double %127, double* %69
br label %153
128: ; preds = %15
%129 = getelementptr inbounds double, double* %1, i64 2
store double 0.000000e+00, double* %129
%130 = load double, double* %0
%131 = tail call i32 @fabs(double %130)
%132 = icmp sgt i32 %131, 1
br i1 %132, label %133, label %140
133: ; preds = %128
%134 = fcmp ogt double %130, 0.000000e+00
%135 = zext i1 %134 to i32
%136 = fcmp olt double %130, 0.000000e+00
%137 = sext i1 %136 to i32
%138 = add nsw i32 %137, %135
%139 = sitofp i32 %138 to double
br label %140
140: ; preds = %133, %128
%141 = phi double [ %139, %133 ], [ %130, %128 ]
%142 = tail call double @acos(double %141)
store double %142, double* %1
%143 = tail call double @sin(double %142)
%144 = fneg double %143
%145 = getelementptr inbounds double, double* %0, i64 1
%146 = load double, double* %145
%147 = fsub double %144, %146
%148 = tail call i32 @fabs(double %147)
%149 = icmp sgt i32 %148, 0
br i1 %149, label %150, label %153
150: ; preds = %140
%151 = load double, double* %1
%152 = fneg double %151
store double %152, double* %1
br label %153
153: ; preds = %140, %150, %99, %119
ret void
}