#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 M_PI;
double acos(double);
double pow(double, double);
double sqrt(double);
void ellipseangle_original(double *r, double a, double z, int n,
                           double *answer) {
  int i;
  if ((a == 0)) {
    for (i = 0; i < n; i++) {
      *(answer + i) = 0.0;
    }
  } else if (z == 0) {
    for (i = 0; i < n; i++) {
      if (*(r + i) < a)
        *(answer + i) = M_PI;
      else
        *(answer + i) = 0.0;
    }
  } else {
    double b = a * sqrt(1.0 - z * z / (1 - a * a));
    double bminusz = b - z;
    double zsquared = z * z;
    double asquared = a * a;
    double A = pow(a / b, 2.0) - 1.0;
    double ri, yp, halfD;
    for (i = 0; i < n; i++) {
      ri = *(r + i);
      if (ri <= bminusz) {
        *(answer + i) = M_PI;
      } else if (-bminusz < ri) {
        halfD = z * z - A * (ri * ri - zsquared - asquared);
        if (halfD < 0.0) {
          *(answer + i) = 0.0;
        } else {
          yp = (-z + sqrt(halfD)) / A;
          if (yp > -b) {
            *(answer + i) = acos((z - yp) / ri);
          } else {
            *(answer + i) = 0.0;
          }
        }
      } else {
        *(answer + i) = 0.0;
      }
    }
  }
  return;
}


x86 assembly (clang, -O0):
<ellipseangle_original>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
mov    %rdi,-0x8(%rbp)
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
mov    %esi,-0x1c(%rbp)
mov    %rdx,-0x28(%rbp)
movsd  -0x10(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    119e <ellipseangle_original+0x6e>
jp     119e <ellipseangle_original+0x6e>
movl   $0x0,-0x2c(%rbp)
mov    -0x2c(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jge    1199 <ellipseangle_original+0x69>
mov    -0x28(%rbp),%rax
movslq -0x2c(%rbp),%rcx
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
jmp    116f <ellipseangle_original+0x3f>
jmp    14d6 <ellipseangle_original+0x3a6>
movsd  -0x18(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    122a <ellipseangle_original+0xfa>
jp     122a <ellipseangle_original+0xfa>
movl   $0x0,-0x2c(%rbp)
mov    -0x2c(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jge    1225 <ellipseangle_original+0xf5>
mov    -0x8(%rbp),%rax
movslq -0x2c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm1
movsd  -0x10(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    1202 <ellipseangle_original+0xd2>
mov    0x2dfc(%rip),%rax
movsd  (%rax),%xmm0
mov    -0x28(%rbp),%rax
movslq -0x2c(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
jmp    1212 <ellipseangle_original+0xe2>
mov    -0x28(%rbp),%rax
movslq -0x2c(%rbp),%rcx
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
jmp    1217 <ellipseangle_original+0xe7>
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
jmp    11bd <ellipseangle_original+0x8d>
jmp    14d1 <ellipseangle_original+0x3a1>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x78(%rbp)
movsd  -0x18(%rbp),%xmm1
mulsd  -0x18(%rbp),%xmm1
movsd  -0x10(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm2
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm2,%xmm0
movsd  0xd95(%rip),%xmm2
addsd  %xmm2,%xmm0
divsd  %xmm0,%xmm1
movsd  0xd85(%rip),%xmm0
subsd  %xmm1,%xmm0
call   1050 <sqrt@plt>
movaps %xmm0,%xmm1
movsd  -0x78(%rbp),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  -0x38(%rbp),%xmm0
subsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x18(%rbp),%xmm0
mulsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  -0x10(%rbp),%xmm0
mulsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  -0x10(%rbp),%xmm0
divsd  -0x38(%rbp),%xmm0
movsd  0xd34(%rip),%xmm1
call   1040 <pow@plt>
movsd  0xd1f(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x58(%rbp)
movl   $0x0,-0x2c(%rbp)
mov    -0x2c(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jge    14cc <ellipseangle_original+0x39c>
mov    -0x8(%rbp),%rax
movslq -0x2c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x60(%rbp)
movsd  -0x60(%rbp),%xmm1
movsd  -0x40(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jb     1340 <ellipseangle_original+0x210>
mov    0x2cbe(%rip),%rax
movsd  (%rax),%xmm0
mov    -0x28(%rbp),%rax
movslq -0x2c(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
jmp    14b9 <ellipseangle_original+0x389>
movsd  -0x40(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
movsd  -0x60(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    14a4 <ellipseangle_original+0x374>
movsd  -0x18(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm2
movsd  -0x58(%rbp),%xmm1
movsd  -0x60(%rbp),%xmm3
movsd  -0x60(%rbp),%xmm5
movsd  -0x48(%rbp),%xmm4
movq   %xmm4,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm4
mulsd  %xmm5,%xmm3
addsd  %xmm4,%xmm3
subsd  -0x50(%rbp),%xmm3
mulsd  %xmm3,%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x70(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x70(%rbp),%xmm0
jbe    13f8 <ellipseangle_original+0x2c8>
mov    -0x28(%rbp),%rax
movslq -0x2c(%rbp),%rcx
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
jmp    149f <ellipseangle_original+0x36f>
movsd  -0x18(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x80(%rbp)
movsd  -0x70(%rbp),%xmm0
call   1050 <sqrt@plt>
movaps %xmm0,%xmm1
movsd  -0x80(%rbp),%xmm0
addsd  %xmm1,%xmm0
divsd  -0x58(%rbp),%xmm0
movsd  %xmm0,-0x68(%rbp)
movsd  -0x68(%rbp),%xmm0
movsd  -0x38(%rbp),%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
ucomisd %xmm1,%xmm0
jbe    148a <ellipseangle_original+0x35a>
movsd  -0x18(%rbp),%xmm0
subsd  -0x68(%rbp),%xmm0
divsd  -0x60(%rbp),%xmm0
call   1030 <acos@plt>
mov    -0x28(%rbp),%rax
movslq -0x2c(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
jmp    149a <ellipseangle_original+0x36a>
mov    -0x28(%rbp),%rax
movslq -0x2c(%rbp),%rcx
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
jmp    149f <ellipseangle_original+0x36f>
jmp    14b4 <ellipseangle_original+0x384>
mov    -0x28(%rbp),%rax
movslq -0x2c(%rbp),%rcx
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
jmp    14b9 <ellipseangle_original+0x389>
jmp    14be <ellipseangle_original+0x38e>
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
jmp    12f1 <ellipseangle_original+0x1c1>
jmp    14d1 <ellipseangle_original+0x3a1>
jmp    14d6 <ellipseangle_original+0x3a6>
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ellipseangle_original>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0xa0,%rsp
mov    %rdx,%rbx
mov    %esi,%ebp
movapd %xmm0,%xmm4
xorpd  %xmm0,%xmm0
ucomisd %xmm0,%xmm4
jne    1178 <ellipseangle_original+0x48>
jp     1178 <ellipseangle_original+0x48>
test   %ebp,%ebp
jle    1168 <ellipseangle_original+0x38>
mov    %ebp,%edx
shl    $0x3,%rdx
mov    %rbx,%rdi
xor    %esi,%esi
call   1040 <memset@plt>
add    $0xa0,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret
mov    %rdi,%r14
ucomisd %xmm0,%xmm1
jne    1220 <ellipseangle_original+0xf0>
jp     1220 <ellipseangle_original+0xf0>
test   %ebp,%ebp
jle    1168 <ellipseangle_original+0x38>
mov    %ebp,%eax
cmp    $0x4,%ebp
jae    1285 <ellipseangle_original+0x155>
xor    %ecx,%ecx
mov    %rcx,%rdx
not    %rdx
test   $0x1,%al
je     11c9 <ellipseangle_original+0x99>
movsd  (%r14,%rcx,8),%xmm0
mov    0x2e35(%rip),%rsi
cmpltsd %xmm4,%xmm0
movsd  (%rsi),%xmm1
andpd  %xmm0,%xmm1
movlpd %xmm1,(%rbx,%rcx,8)
or     $0x1,%rcx
add    %rax,%rdx
je     1168 <ellipseangle_original+0x38>
mov    0x2e13(%rip),%rdx
cs nopw 0x0(%rax,%rax,1)
nop
movsd  (%r14,%rcx,8),%xmm0
cmpltsd %xmm4,%xmm0
movsd  (%rdx),%xmm1
andpd  %xmm0,%xmm1
movlpd %xmm1,(%rbx,%rcx,8)
movsd  0x8(%r14,%rcx,8),%xmm0
cmpltsd %xmm4,%xmm0
movsd  (%rdx),%xmm1
andpd  %xmm0,%xmm1
movlpd %xmm1,0x8(%rbx,%rcx,8)
add    $0x2,%rcx
cmp    %rcx,%rax
jne    11e0 <ellipseangle_original+0xb0>
jmp    1168 <ellipseangle_original+0x38>
movapd %xmm1,%xmm9
mulsd  %xmm1,%xmm9
movapd %xmm4,%xmm8
mulsd  %xmm4,%xmm8
movsd  0xdc4(%rip),%xmm0
movapd %xmm0,%xmm3
subsd  %xmm8,%xmm3
movapd %xmm9,%xmm2
divsd  %xmm3,%xmm2
subsd  %xmm2,%xmm0
xorpd  %xmm2,%xmm2
ucomisd %xmm2,%xmm0
movsd  %xmm1,0x8(%rsp)
movapd %xmm9,0x30(%rsp)
movapd %xmm8,0x20(%rsp)
jb     1365 <ellipseangle_original+0x235>
sqrtsd %xmm0,%xmm0
test   %ebp,%ebp
jg     1392 <ellipseangle_original+0x262>
jmp    1168 <ellipseangle_original+0x38>
lea    (%rbx,%rax,8),%rcx
lea    (%r14,%rax,8),%rdx
cmp    %rbx,%rdx
seta   %dil
cmp    %r14,%rcx
seta   %r9b
mov    0x2d46(%rip),%r8
lea    0x8(%r8),%rdx
cmp    %rdx,%rbx
setb   %dl
cmp    %r8,%rcx
seta   %sil
xor    %ecx,%ecx
test   %r9b,%dil
jne    119c <ellipseangle_original+0x6c>
and    %sil,%dl
jne    119c <ellipseangle_original+0x6c>
mov    %eax,%ecx
and    $0xfffffffc,%ecx
movapd %xmm4,%xmm0
unpcklpd %xmm4,%xmm0
lea    -0x4(%rcx),%rdx
mov    %rdx,%rbp
shr    $0x2,%rbp
add    $0x1,%rbp
test   %rdx,%rdx
je     1535 <ellipseangle_original+0x405>
mov    %rbp,%rdi
and    $0xfffffffffffffffe,%rdi
movsd  (%r8),%xmm1
unpcklpd %xmm1,%xmm1
xor    %esi,%esi
xchg   %ax,%ax
movupd (%r14,%rsi,8),%xmm2
movupd 0x10(%r14,%rsi,8),%xmm3
cmpltpd %xmm0,%xmm2
cmpltpd %xmm0,%xmm3
andpd  %xmm1,%xmm2
andpd  %xmm1,%xmm3
movupd %xmm2,(%rbx,%rsi,8)
movupd %xmm3,0x10(%rbx,%rsi,8)
movupd 0x20(%r14,%rsi,8),%xmm2
movupd 0x30(%r14,%rsi,8),%xmm3
cmpltpd %xmm0,%xmm2
cmpltpd %xmm0,%xmm3
andpd  %xmm1,%xmm2
andpd  %xmm1,%xmm3
movupd %xmm2,0x20(%rbx,%rsi,8)
movupd %xmm3,0x30(%rbx,%rsi,8)
add    $0x8,%rsi
add    $0xfffffffffffffffe,%rdi
jne    1300 <ellipseangle_original+0x1d0>
jmp    1537 <ellipseangle_original+0x407>
movapd %xmm4,0x10(%rsp)
call   1050 <sqrt@plt>
movapd 0x20(%rsp),%xmm8
movapd 0x30(%rsp),%xmm9
movsd  0x8(%rsp),%xmm1
movapd 0x10(%rsp),%xmm4
test   %ebp,%ebp
jle    1168 <ellipseangle_original+0x38>
movapd %xmm0,%xmm2
mulsd  %xmm4,%xmm2
movapd %xmm2,%xmm3
subsd  %xmm1,%xmm3
divsd  %xmm2,%xmm4
mulsd  %xmm4,%xmm4
addsd  0xc56(%rip),%xmm4
movapd 0xc66(%rip),%xmm0
movapd %xmm3,%xmm7
xorpd  %xmm0,%xmm7
movapd %xmm9,%xmm10
xorpd  %xmm0,%xmm10
movapd %xmm4,%xmm6
xorpd  %xmm0,%xmm6
xorpd  %xmm0,%xmm2
movapd %xmm2,0x90(%rsp)
mov    %ebp,%r15d
xor    %ebp,%ebp
mov    0x2bfb(%rip),%r12
movapd %xmm4,0x10(%rsp)
movapd %xmm3,0x80(%rsp)
movapd %xmm7,0x70(%rsp)
movapd %xmm10,0x60(%rsp)
movapd %xmm6,0x50(%rsp)
jmp    1438 <ellipseangle_original+0x308>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movsd  (%r12),%xmm5
movsd  %xmm5,(%rbx,%rbp,8)
add    $0x1,%rbp
cmp    %rbp,%r15
je     1168 <ellipseangle_original+0x38>
movsd  (%r14,%rbp,8),%xmm2
ucomisd %xmm2,%xmm3
jae    1420 <ellipseangle_original+0x2f0>
xorpd  %xmm5,%xmm5
ucomisd %xmm7,%xmm2
jbe    1426 <ellipseangle_original+0x2f6>
movapd %xmm2,%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm10,%xmm0
subsd  %xmm8,%xmm0
mulsd  %xmm6,%xmm0
addsd  %xmm9,%xmm0
xorpd  %xmm5,%xmm5
ucomisd %xmm0,%xmm5
ja     1426 <ellipseangle_original+0x2f6>
ucomisd 0xb95(%rip),%xmm0
jb     1483 <ellipseangle_original+0x353>
sqrtsd %xmm0,%xmm0
jmp    14ce <ellipseangle_original+0x39e>
movsd  %xmm2,0x48(%rsp)
call   1050 <sqrt@plt>
xorpd  %xmm5,%xmm5
movsd  0x48(%rsp),%xmm2
movapd 0x50(%rsp),%xmm6
movapd 0x60(%rsp),%xmm10
movapd 0x70(%rsp),%xmm7
movapd 0x80(%rsp),%xmm3
movapd 0x20(%rsp),%xmm8
movapd 0x30(%rsp),%xmm9
movsd  0x8(%rsp),%xmm1
movapd 0x10(%rsp),%xmm4
subsd  %xmm1,%xmm0
divsd  %xmm4,%xmm0
ucomisd 0x90(%rsp),%xmm0
jbe    1426 <ellipseangle_original+0x2f6>
subsd  %xmm0,%xmm1
divsd  %xmm2,%xmm1
movapd %xmm1,%xmm0
call   1030 <acos@plt>
movapd 0x50(%rsp),%xmm6
movapd 0x60(%rsp),%xmm10
movapd 0x70(%rsp),%xmm7
movapd 0x80(%rsp),%xmm3
movapd 0x20(%rsp),%xmm8
movapd 0x30(%rsp),%xmm9
movsd  0x8(%rsp),%xmm1
movapd 0x10(%rsp),%xmm4
movapd %xmm0,%xmm5
jmp    1426 <ellipseangle_original+0x2f6>
xor    %esi,%esi
test   $0x1,%bpl
je     1570 <ellipseangle_original+0x440>
movupd (%r14,%rsi,8),%xmm1
movupd 0x10(%r14,%rsi,8),%xmm2
cmpltpd %xmm0,%xmm1
cmpltpd %xmm0,%xmm2
movsd  (%r8),%xmm0
unpcklpd %xmm0,%xmm0
andpd  %xmm0,%xmm1
andpd  %xmm2,%xmm0
movupd %xmm1,(%rbx,%rsi,8)
movupd %xmm0,0x10(%rbx,%rsi,8)
cmp    %rax,%rcx
je     1168 <ellipseangle_original+0x38>
jmp    119c <ellipseangle_original+0x6c>

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

LLVM IR (-O2):
@M_PI = global double 0.000000e+00
define void @ellipseangle_original(double* nocapture %0, double %1, double %2, i32 %3, double* nocapture writeonly %4) {
%6 = bitcast double* %4 to i8*
%7 = fcmp oeq double %1, 0.000000e+00
br i1 %7, label %8, label %13
8: ; preds = %5
%9 = icmp sgt i32 %3, 0
br i1 %9, label %10, label %196
10: ; preds = %8
%11 = zext i32 %3 to i64
%12 = shl nuw nsw i64 %11, 3
br label %196
13: ; preds = %5
%14 = fcmp oeq double %2, 0.000000e+00
br i1 %14, label %15, label %147
15: ; preds = %13
%16 = icmp sgt i32 %3, 0
br i1 %16, label %17, label %196
17: ; preds = %15
%18 = zext i32 %3 to i64
%19 = icmp ult i32 %3, 4
br i1 %19, label %113, label %20
20: ; preds = %17
%21 = getelementptr double, double* %4, i64 %18
%22 = getelementptr double, double* %0, i64 %18
%23 = icmp ugt double* %22, %4
%24 = icmp ugt double* %21, %0
%25 = and i1 %23, %24
%26 = icmp ult double* %4, getelementptr inbounds (double, double* @M_PI, i64 1)
%27 = icmp ugt double* %21, @M_PI
%28 = and i1 %26, %27
%29 = or i1 %25, %28
br i1 %29, label %113, label %30
30: ; preds = %20
%31 = and i64 %18, 4294967292
%32 = insertelement <2 x double> poison, double %1, i64 0
%33 = shufflevector <2 x double> %32, <2 x double> poison, <2 x i32> zeroinitializer
%34 = insertelement <2 x double> poison, double %1, i64 0
%35 = shufflevector <2 x double> %34, <2 x double> poison, <2 x i32> zeroinitializer
%36 = add nsw i64 %31, -4
%37 = lshr exact i64 %36, 2
%38 = add nuw nsw i64 %37, 1
%39 = and i64 %38, 1
%40 = icmp eq i64 %36, 0
br i1 %40, label %88, label %41
41: ; preds = %30
%42 = and i64 %38, 9223372036854775806
%43 = load double, double* @M_PI
%44 = insertelement <2 x double> poison, double %43, i64 0
%45 = shufflevector <2 x double> %44, <2 x double> poison, <2 x i32> zeroinitializer
%46 = insertelement <2 x double> poison, double %43, i64 0
%47 = shufflevector <2 x double> %46, <2 x double> poison, <2 x i32> zeroinitializer
%48 = load double, double* @M_PI
%49 = insertelement <2 x double> poison, double %48, 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 = shufflevector <2 x double> %51, <2 x double> poison, <2 x i32> zeroinitializer
br label %53
53: ; preds = %53, %41
%54 = phi i64 [ 0, %41 ], [ %85, %53 ]
%55 = phi i64 [ 0, %41 ], [ %86, %53 ]
%56 = getelementptr inbounds double, double* %0, i64 %54
%57 = bitcast double* %56 to <2 x double>*
%58 = load <2 x double>, <2 x double>* %57
%59 = getelementptr inbounds double, double* %56, i64 2
%60 = bitcast double* %59 to <2 x double>*
%61 = load <2 x double>, <2 x double>* %60
%62 = fcmp olt <2 x double> %58, %33
%63 = fcmp olt <2 x double> %61, %35
%64 = select <2 x i1> %62, <2 x double> %45, <2 x double> zeroinitializer
%65 = select <2 x i1> %63, <2 x double> %47, <2 x double> zeroinitializer
%66 = getelementptr inbounds double, double* %4, i64 %54
%67 = bitcast double* %66 to <2 x double>*
store <2 x double> %64, <2 x double>* %67
%68 = getelementptr inbounds double, double* %66, i64 2
%69 = bitcast double* %68 to <2 x double>*
store <2 x double> %65, <2 x double>* %69
%70 = or i64 %54, 4
%71 = getelementptr inbounds double, double* %0, i64 %70
%72 = bitcast double* %71 to <2 x double>*
%73 = load <2 x double>, <2 x double>* %72
%74 = getelementptr inbounds double, double* %71, i64 2
%75 = bitcast double* %74 to <2 x double>*
%76 = load <2 x double>, <2 x double>* %75
%77 = fcmp olt <2 x double> %73, %33
%78 = fcmp olt <2 x double> %76, %35
%79 = select <2 x i1> %77, <2 x double> %50, <2 x double> zeroinitializer
%80 = select <2 x i1> %78, <2 x double> %52, <2 x double> zeroinitializer
%81 = getelementptr inbounds double, double* %4, i64 %70
%82 = bitcast double* %81 to <2 x double>*
store <2 x double> %79, <2 x double>* %82
%83 = getelementptr inbounds double, double* %81, i64 2
%84 = bitcast double* %83 to <2 x double>*
store <2 x double> %80, <2 x double>* %84
%85 = add nuw i64 %54, 8
%86 = add i64 %55, 2
%87 = icmp eq i64 %86, %42
br i1 %87, label %88, label %53
88: ; preds = %53, %30
%89 = phi i64 [ 0, %30 ], [ %85, %53 ]
%90 = icmp eq i64 %39, 0
br i1 %90, label %111, label %91
91: ; preds = %88
%92 = getelementptr inbounds double, double* %0, i64 %89
%93 = bitcast double* %92 to <2 x double>*
%94 = load <2 x double>, <2 x double>* %93
%95 = getelementptr inbounds double, double* %92, i64 2
%96 = bitcast double* %95 to <2 x double>*
%97 = load <2 x double>, <2 x double>* %96
%98 = fcmp olt <2 x double> %94, %33
%99 = fcmp olt <2 x double> %97, %35
%100 = load double, double* @M_PI
%101 = insertelement <2 x double> poison, double %100, i64 0
%102 = shufflevector <2 x double> %101, <2 x double> poison, <2 x i32> zeroinitializer
%103 = insertelement <2 x double> poison, double %100, i64 0
%104 = shufflevector <2 x double> %103, <2 x double> poison, <2 x i32> zeroinitializer
%105 = select <2 x i1> %98, <2 x double> %102, <2 x double> zeroinitializer
%106 = select <2 x i1> %99, <2 x double> %104, <2 x double> zeroinitializer
%107 = getelementptr inbounds double, double* %4, i64 %89
%108 = bitcast double* %107 to <2 x double>*
store <2 x double> %105, <2 x double>* %108
%109 = getelementptr inbounds double, double* %107, i64 2
%110 = bitcast double* %109 to <2 x double>*
store <2 x double> %106, <2 x double>* %110
br label %111
111: ; preds = %88, %91
%112 = icmp eq i64 %31, %18
br i1 %112, label %196, label %113
113: ; preds = %20, %17, %111
%114 = phi i64 [ 0, %20 ], [ 0, %17 ], [ %31, %111 ]
%115 = xor i64 %114, -1
%116 = and i64 %18, 1
%117 = icmp eq i64 %116, 0
br i1 %117, label %126, label %118
118: ; preds = %113
%119 = getelementptr inbounds double, double* %0, i64 %114
%120 = load double, double* %119
%121 = fcmp olt double %120, %1
%122 = load double, double* @M_PI
%123 = select i1 %121, double %122, double 0.000000e+00
%124 = getelementptr inbounds double, double* %4, i64 %114
store double %123, double* %124
%125 = or i64 %114, 1
br label %126
126: ; preds = %118, %113
%127 = phi i64 [ %114, %113 ], [ %125, %118 ]
%128 = sub nsw i64 0, %18
%129 = icmp eq i64 %115, %128
br i1 %129, label %196, label %130
130: ; preds = %126, %130
%131 = phi i64 [ %145, %130 ], [ %127, %126 ]
%132 = getelementptr inbounds double, double* %0, i64 %131
%133 = load double, double* %132
%134 = fcmp olt double %133, %1
%135 = load double, double* @M_PI
%136 = select i1 %134, double %135, double 0.000000e+00
%137 = getelementptr inbounds double, double* %4, i64 %131
store double %136, double* %137
%138 = add nuw nsw i64 %131, 1
%139 = getelementptr inbounds double, double* %0, i64 %138
%140 = load double, double* %139
%141 = fcmp olt double %140, %1
%142 = load double, double* @M_PI
%143 = select i1 %141, double %142, double 0.000000e+00
%144 = getelementptr inbounds double, double* %4, i64 %138
store double %143, double* %144
%145 = add nuw nsw i64 %131, 2
%146 = icmp eq i64 %145, %18
br i1 %146, label %196, label %130
147: ; preds = %13
%148 = fmul double %2, %2
%149 = fneg double %1
%150 = tail call double @llvm.fmuladd.f64(double %149, double %1, double 1.000000e+00)
%151 = fdiv double %148, %150
%152 = fsub double 1.000000e+00, %151
%153 = tail call double @sqrt(double %152)
%154 = fmul double %153, %1
%155 = fsub double %154, %2
%156 = fmul double %1, %1
%157 = fdiv double %1, %154
%158 = fmul double %157, %157
%159 = fadd double %158, -1.000000e+00
%160 = icmp sgt i32 %3, 0
br i1 %160, label %161, label %196
161: ; preds = %147
%162 = fneg double %155
%163 = fneg double %148
%164 = fneg double %159
%165 = fneg double %154
%166 = zext i32 %3 to i64
br label %167
167: ; preds = %161, %191
%168 = phi i64 [ 0, %161 ], [ %194, %191 ]
%169 = getelementptr inbounds double, double* %0, i64 %168
%170 = load double, double* %169
%171 = fcmp ugt double %170, %155
br i1 %171, label %174, label %172
172: ; preds = %167
%173 = load double, double* @M_PI
br label %191
174: ; preds = %167
%175 = fcmp ogt double %170, %162
br i1 %175, label %176, label %191
176: ; preds = %174
%177 = tail call double @llvm.fmuladd.f64(double %170, double %170, double %163)
%178 = fsub double %177, %156
%179 = fmul double %178, %164
%180 = tail call double @llvm.fmuladd.f64(double %2, double %2, double %179)
%181 = fcmp olt double %180, 0.000000e+00
br i1 %181, label %191, label %182
182: ; preds = %176
%183 = tail call double @sqrt(double %180)
%184 = fsub double %183, %2
%185 = fdiv double %184, %159
%186 = fcmp ogt double %185, %165
br i1 %186, label %187, label %191
187: ; preds = %182
%188 = fsub double %2, %185
%189 = fdiv double %188, %170
%190 = tail call double @acos(double %189)
br label %191
191: ; preds = %174, %182, %176, %172, %187
%192 = phi double [ %173, %172 ], [ %190, %187 ], [ 0.000000e+00, %176 ], [ 0.000000e+00, %182 ], [ 0.000000e+00, %174 ]
%193 = getelementptr inbounds double, double* %4, i64 %168
store double %192, double* %193
%194 = add nuw nsw i64 %168, 1
%195 = icmp eq i64 %194, %166
br i1 %195, label %196, label %167
196: ; preds = %191, %126, %130, %111, %10, %147, %15, %8
ret void
}