#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 const);
double atan2(double const, int);
double cbrt(double const);
double const cos(double const);
double fabs(double const);
double const sin(double);
double sqrt(double const);
double angle_to_ellipse(const double a, const double b, const double x,
                        const double y, double *dist) {
  const double fy = fabs(y), fx = fabs(x);
  double lat;
  if (x == 0.) {
    lat =
        3.1415926535897932384626433832795028841971693993751058209749445923 / 2.;
    if (dist)
      *dist = fy - a;
  } else {
    const double c_squared = a * a - b * b;
    const double e = (b * fy - c_squared) / (a * fx);
    const double f = (b * fy + c_squared) / (a * fx);
    const double p = (4. / 3.) * (e * f + 1.);
    const double q = 2. * (e * e - f * f);
    const double d = p * p * p + q * q;
    double v, g, t;
    if (d >= 0.) {
      const double sqrt_d = sqrt(d);
      v = cbrt(sqrt_d - q) - cbrt(sqrt_d + q);
    } else {
      const double sqp = sqrt(-p);
      const double temp_ang = acos(q / (sqp * p));
      v = 2. * sqp * cos(temp_ang / 3.);
    }
    g = (sqrt(e * e + v) + e) * .5;
    t = sqrt(g * g + (f - v * g) / (2. * g - e)) - g;
    lat = atan2(a * (1. - t * t), 2. * b * t);
    if (dist)
      *dist = (fx - a * t) * cos(lat) + (fy - b) * sin(lat);
  }
  if (x < 0.)
    lat = 3.1415926535897932384626433832795028841971693993751058209749445923 -
          lat;
  if (y < 0.)
    lat = -lat;
  return (lat);
}


x86 assembly (clang, -O0):
<angle_to_ellipse>:
push   %rbp
mov    %rsp,%rbp
sub    $0xd0,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  %xmm3,-0x20(%rbp)
mov    %rdi,-0x28(%rbp)
movsd  -0x20(%rbp),%xmm0
movaps 0xe71(%rip),%xmm1
pand   %xmm1,%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x18(%rbp),%xmm0
movaps 0xe5c(%rip),%xmm1
pand   %xmm1,%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  -0x18(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    11f4 <angle_to_ellipse+0x94>
jp     11f4 <angle_to_ellipse+0x94>
movsd  0xe6b(%rip),%xmm0
movsd  %xmm0,-0x40(%rbp)
cmpq   $0x0,-0x28(%rbp)
je     11ef <angle_to_ellipse+0x8f>
movsd  -0x30(%rbp),%xmm0
subsd  -0x8(%rbp),%xmm0
mov    -0x28(%rbp),%rax
movsd  %xmm0,(%rax)
jmp    15e0 <angle_to_ellipse+0x480>
movsd  -0x8(%rbp),%xmm0
movsd  -0x8(%rbp),%xmm2
movsd  -0x10(%rbp),%xmm1
mulsd  -0x10(%rbp),%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  -0x30(%rbp),%xmm2
movsd  -0x48(%rbp),%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  -0x8(%rbp),%xmm1
mulsd  -0x38(%rbp),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  -0x30(%rbp),%xmm2
movsd  -0x48(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  -0x8(%rbp),%xmm1
mulsd  -0x38(%rbp),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x58(%rbp)
movsd  -0x50(%rbp),%xmm1
movsd  -0x58(%rbp),%xmm0
mulsd  %xmm0,%xmm1
movsd  0xd73(%rip),%xmm0
addsd  %xmm0,%xmm1
movsd  0xd5f(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x60(%rbp)
movsd  -0x50(%rbp),%xmm1
movsd  -0x50(%rbp),%xmm2
movsd  -0x58(%rbp),%xmm0
mulsd  -0x58(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  0xd13(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x68(%rbp)
movsd  -0x60(%rbp),%xmm0
mulsd  -0x60(%rbp),%xmm0
movsd  -0x60(%rbp),%xmm2
movsd  -0x68(%rbp),%xmm1
mulsd  -0x68(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x70(%rbp)
movsd  -0x70(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     1395 <angle_to_ellipse+0x235>
movsd  -0x70(%rbp),%xmm0
call   1080 <sqrt@plt>
movsd  %xmm0,-0x90(%rbp)
ff
movsd  -0x90(%rbp),%xmm0
ff
subsd  -0x68(%rbp),%xmm0
call   1060 <cbrt@plt>
movsd  %xmm0,-0xa8(%rbp)
ff
movsd  -0x90(%rbp),%xmm0
ff
addsd  -0x68(%rbp),%xmm0
call   1060 <cbrt@plt>
movaps %xmm0,%xmm1
movsd  -0xa8(%rbp),%xmm0
ff
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x78(%rbp)
jmp    1426 <angle_to_ellipse+0x2c6>
movsd  -0x60(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
call   1080 <sqrt@plt>
movsd  %xmm0,-0x98(%rbp)
ff
movsd  -0x68(%rbp),%xmm0
movsd  -0x98(%rbp),%xmm1
ff
mulsd  -0x60(%rbp),%xmm1
divsd  %xmm1,%xmm0
call   1040 <acos@plt>
movsd  %xmm0,-0xa0(%rbp)
ff
movsd  0xc27(%rip),%xmm0
mulsd  -0x98(%rbp),%xmm0
ff
movsd  %xmm0,-0xb0(%rbp)
ff
movsd  -0xa0(%rbp),%xmm0
movsd  0xc1f(%rip),%xmm1
divsd  %xmm1,%xmm0
call   1070 <cos@plt>
movaps %xmm0,%xmm1
movsd  -0xb0(%rbp),%xmm0
ff
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x78(%rbp)
movsd  -0x50(%rbp),%xmm0
movsd  -0x50(%rbp),%xmm2
movsd  -0x78(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
call   1080 <sqrt@plt>
addsd  -0x50(%rbp),%xmm0
movsd  0xbe1(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x80(%rbp)
movsd  -0x80(%rbp),%xmm0
movsd  -0x80(%rbp),%xmm2
movsd  -0x58(%rbp),%xmm3
movsd  -0x78(%rbp),%xmm1
movsd  -0x80(%rbp),%xmm4
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm4,%xmm1
addsd  %xmm3,%xmm1
movsd  -0x80(%rbp),%xmm3
movsd  -0x50(%rbp),%xmm4
movq   %xmm4,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm4
addsd  %xmm3,%xmm3
addsd  %xmm4,%xmm3
divsd  %xmm3,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
call   1080 <sqrt@plt>
subsd  -0x80(%rbp),%xmm0
movsd  %xmm0,-0x88(%rbp)
ff
movsd  -0x8(%rbp),%xmm0
movsd  -0x88(%rbp),%xmm1
ff
movsd  -0x88(%rbp),%xmm2
ff
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm1
movsd  0xb11(%rip),%xmm2
addsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
movsd  0xaf1(%rip),%xmm1
mulsd  -0x10(%rbp),%xmm1
mulsd  -0x88(%rbp),%xmm1
ff
cvttsd2si %xmm1,%edi
call   1030 <atan2@plt>
movsd  %xmm0,-0x40(%rbp)
cmpq   $0x0,-0x28(%rbp)
je     15db <angle_to_ellipse+0x47b>
movsd  -0x38(%rbp),%xmm1
movsd  -0x8(%rbp),%xmm0
movsd  -0x88(%rbp),%xmm2
ff
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0xb8(%rbp)
ff
movsd  -0x40(%rbp),%xmm0
call   1070 <cos@plt>
movsd  %xmm0,-0xc0(%rbp)
ff
movsd  -0x30(%rbp),%xmm0
subsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0xc8(%rbp)
ff
movsd  -0x40(%rbp),%xmm0
call   1050 <sin@plt>
movsd  -0xc8(%rbp),%xmm1
ff
movsd  -0xc0(%rbp),%xmm2
ff
movaps %xmm0,%xmm3
movsd  -0xb8(%rbp),%xmm0
ff
mulsd  %xmm3,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x28(%rbp),%rax
movsd  %xmm0,(%rax)
jmp    15e0 <angle_to_ellipse+0x480>
xorps  %xmm0,%xmm0
ucomisd -0x18(%rbp),%xmm0
jbe    1600 <angle_to_ellipse+0x4a0>
movsd  0xa4a(%rip),%xmm0
subsd  -0x40(%rbp),%xmm0
movsd  %xmm0,-0x40(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x20(%rbp),%xmm0
jbe    162f <angle_to_ellipse+0x4cf>
movsd  -0x40(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x40(%rbp),%xmm0
add    $0xd0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<angle_to_ellipse>:
push   %rbx
sub    $0xa0,%rsp
mov    %rdi,%rbx
movapd %xmm0,%xmm9
movapd 0xe88(%rip),%xmm5
movapd %xmm3,%xmm4
andpd  %xmm5,%xmm4
xorpd  %xmm8,%xmm8
ucomisd %xmm8,%xmm2
jne    11a9 <angle_to_ellipse+0x49>
jp     11a9 <angle_to_ellipse+0x49>
test   %rbx,%rbx
je     128c <angle_to_ellipse+0x12c>
subsd  %xmm9,%xmm4
movsd  0xea4(%rip),%xmm5
jmp    14a6 <angle_to_ellipse+0x346>
movapd %xmm2,0x80(%rsp)
andpd  %xmm2,%xmm5
movapd %xmm1,%xmm0
mulsd  %xmm1,%xmm0
movapd %xmm9,%xmm2
mulsd  %xmm9,%xmm2
subsd  %xmm0,%xmm2
movapd %xmm1,%xmm0
mulsd  %xmm4,%xmm0
movapd %xmm0,%xmm7
subsd  %xmm2,%xmm7
movapd %xmm5,%xmm6
mulsd  %xmm9,%xmm6
divsd  %xmm6,%xmm7
addsd  %xmm2,%xmm0
divsd  %xmm6,%xmm0
movapd %xmm7,%xmm6
mulsd  %xmm0,%xmm6
addsd  0xe1f(%rip),%xmm6
mulsd  0xe1f(%rip),%xmm6
movsd  %xmm0,0x8(%rsp)
mulsd  %xmm0,%xmm0
movsd  %xmm7,0x78(%rsp)
mulsd  %xmm7,%xmm7
movsd  %xmm7,0x70(%rsp)
subsd  %xmm0,%xmm7
addsd  %xmm7,%xmm7
movapd %xmm6,%xmm0
mulsd  %xmm6,%xmm0
movapd %xmm7,%xmm2
mulsd  %xmm7,%xmm2
mulsd  %xmm6,%xmm0
addsd  %xmm2,%xmm0
ucomisd %xmm8,%xmm0
movapd %xmm3,0x90(%rsp)
movapd %xmm4,0x50(%rsp)
movapd %xmm5,0x40(%rsp)
movsd  %xmm1,0x28(%rsp)
movsd  %xmm9,0x30(%rsp)
jae    1299 <angle_to_ellipse+0x139>
movapd 0xd9c(%rip),%xmm0
xorpd  %xmm6,%xmm0
movsd  0xdb0(%rip),%xmm2
ucomisd %xmm6,%xmm2
jb     12af <angle_to_ellipse+0x14f>
sqrtsd %xmm0,%xmm0
jmp    12cc <angle_to_ellipse+0x16c>
movsd  0xdb4(%rip),%xmm5
jmp    14aa <angle_to_ellipse+0x34a>
xorpd  %xmm2,%xmm2
ucomisd %xmm2,%xmm0
movsd  %xmm7,0x20(%rsp)
jb     130c <angle_to_ellipse+0x1ac>
sqrtsd %xmm0,%xmm0
jmp    1317 <angle_to_ellipse+0x1b7>
movsd  %xmm7,0x20(%rsp)
movapd %xmm6,0x10(%rsp)
call   1080 <sqrt@plt>
movapd 0x10(%rsp),%xmm6
movsd  0x20(%rsp),%xmm7
movsd  %xmm0,0x10(%rsp)
mulsd  %xmm0,%xmm6
divsd  %xmm6,%xmm7
movapd %xmm7,%xmm0
call   1040 <acos@plt>
movsd  0x10(%rsp),%xmm1
addsd  %xmm1,%xmm1
movsd  %xmm1,0x10(%rsp)
divsd  0xd3d(%rip),%xmm0
call   1070 <cos@plt>
movapd %xmm0,%xmm3
mulsd  0x10(%rsp),%xmm3
jmp    1347 <angle_to_ellipse+0x1e7>
call   1080 <sqrt@plt>
movsd  0x20(%rsp),%xmm7
movsd  %xmm0,0x68(%rsp)
subsd  %xmm7,%xmm0
call   1060 <cbrt@plt>
movsd  %xmm0,0x10(%rsp)
movsd  0x20(%rsp),%xmm0
addsd  0x68(%rsp),%xmm0
call   1060 <cbrt@plt>
movsd  0x10(%rsp),%xmm3
subsd  %xmm0,%xmm3
movsd  0x70(%rsp),%xmm0
addsd  %xmm3,%xmm0
xorpd  %xmm5,%xmm5
ucomisd %xmm5,%xmm0
jb     1361 <angle_to_ellipse+0x201>
sqrtsd %xmm0,%xmm4
jmp    137a <angle_to_ellipse+0x21a>
movsd  %xmm3,0x10(%rsp)
call   1080 <sqrt@plt>
xorpd  %xmm5,%xmm5
movsd  0x10(%rsp),%xmm3
movapd %xmm0,%xmm4
movsd  0x78(%rsp),%xmm2
addsd  %xmm2,%xmm4
mulsd  0xcb4(%rip),%xmm4
mulsd  %xmm4,%xmm3
movsd  0x8(%rsp),%xmm1
subsd  %xmm3,%xmm1
movapd %xmm4,%xmm0
addsd  %xmm4,%xmm0
subsd  %xmm2,%xmm0
divsd  %xmm0,%xmm1
movapd %xmm4,%xmm0
mulsd  %xmm4,%xmm0
addsd  %xmm1,%xmm0
ucomisd %xmm5,%xmm0
jb     13c5 <angle_to_ellipse+0x265>
xorps  %xmm5,%xmm5
sqrtsd %xmm0,%xmm5
jmp    13da <angle_to_ellipse+0x27a>
movsd  %xmm4,0x8(%rsp)
call   1080 <sqrt@plt>
movsd  0x8(%rsp),%xmm4
movapd %xmm0,%xmm5
movsd  0x28(%rsp),%xmm2
movsd  0x30(%rsp),%xmm3
subsd  %xmm4,%xmm5
movapd %xmm5,%xmm1
mulsd  %xmm5,%xmm1
movsd  0xc26(%rip),%xmm0
subsd  %xmm1,%xmm0
mulsd  %xmm3,%xmm0
movapd %xmm2,%xmm1
addsd  %xmm2,%xmm1
movsd  %xmm5,0x8(%rsp)
mulsd  %xmm5,%xmm1
cvttsd2si %xmm1,%edi
call   1030 <atan2@plt>
movapd %xmm0,%xmm5
test   %rbx,%rbx
je     14f9 <angle_to_ellipse+0x399>
movsd  0x30(%rsp),%xmm1
mulsd  0x8(%rsp),%xmm1
movapd 0x40(%rsp),%xmm0
subsd  %xmm1,%xmm0
movapd %xmm0,0x40(%rsp)
movapd %xmm5,%xmm0
movapd %xmm5,0x30(%rsp)
call   1070 <cos@plt>
movsd  %xmm0,0x8(%rsp)
movapd 0x50(%rsp),%xmm0
subsd  0x28(%rsp),%xmm0
movapd %xmm0,0x50(%rsp)
movapd 0x30(%rsp),%xmm0
call   1050 <sin@plt>
movapd 0x30(%rsp),%xmm5
mulsd  0x50(%rsp),%xmm0
movsd  0x8(%rsp),%xmm4
mulsd  0x40(%rsp),%xmm4
addsd  %xmm0,%xmm4
movapd 0x90(%rsp),%xmm3
movapd 0x80(%rsp),%xmm2
movsd  %xmm4,(%rbx)
movsd  0xb9e(%rip),%xmm0
subsd  %xmm5,%xmm0
xorpd  %xmm1,%xmm1
cmpltsd %xmm1,%xmm2
andpd  %xmm2,%xmm0
andnpd %xmm5,%xmm2
orpd   %xmm0,%xmm2
movapd 0xb3d(%rip),%xmm0
xorpd  %xmm2,%xmm0
cmpltsd %xmm1,%xmm3
movapd %xmm3,%xmm1
andnpd %xmm2,%xmm1
andpd  %xmm0,%xmm3
orpd   %xmm1,%xmm3
movapd %xmm3,%xmm0
add    $0xa0,%rsp
pop    %rbx
ret
movapd 0x90(%rsp),%xmm3
movapd 0x80(%rsp),%xmm2
jmp    14aa <angle_to_ellipse+0x34a>

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

LLVM IR (-O2):
define double @angle_to_ellipse(double %0, double %1, double %2, double %3, double* writeonly %4) {
%6 = tail call double @llvm.fabs.f64(double %3)
%7 = tail call double @llvm.fabs.f64(double %2)
%8 = fcmp oeq double %2, 0.000000e+00
br i1 %8, label %9, label %13
9: ; preds = %5
%10 = icmp eq double* %4, null
br i1 %10, label %83, label %11
11: ; preds = %9
%12 = fsub double %6, %0
br label %80
13: ; preds = %5
%14 = fneg double %1
%15 = fmul double %14, %1
%16 = tail call double @llvm.fmuladd.f64(double %0, double %0, double %15)
%17 = fneg double %16
%18 = tail call double @llvm.fmuladd.f64(double %1, double %6, double %17)
%19 = fmul double %7, %0
%20 = fdiv double %18, %19
%21 = tail call double @llvm.fmuladd.f64(double %1, double %6, double %16)
%22 = fdiv double %21, %19
%23 = tail call double @llvm.fmuladd.f64(double %20, double %22, double 1.000000e+00)
%24 = fmul double %23, 0x3FF5555555555555
%25 = fneg double %22
%26 = fmul double %22, %25
%27 = tail call double @llvm.fmuladd.f64(double %20, double %20, double %26)
%28 = fmul double %27, 2.000000e+00
%29 = fmul double %24, %24
%30 = fmul double %28, %28
%31 = tail call double @llvm.fmuladd.f64(double %29, double %24, double %30)
%32 = fcmp ult double %31, 0.000000e+00
br i1 %32, label %40, label %33
33: ; preds = %13
%34 = tail call double @sqrt(double %31)
%35 = fsub double %34, %28
%36 = tail call double @cbrt(double %35)
%37 = fadd double %28, %34
%38 = tail call double @cbrt(double %37)
%39 = fsub double %36, %38
br label %50
40: ; preds = %13
%41 = fneg double %24
%42 = tail call double @sqrt(double %41)
%43 = fmul double %24, %42
%44 = fdiv double %28, %43
%45 = tail call double @acos(double %44)
%46 = fmul double %42, 2.000000e+00
%47 = fdiv double %45, 3.000000e+00
%48 = tail call double @cos(double %47)
%49 = fmul double %46, %48
br label %50
50: ; preds = %40, %33
%51 = phi double [ %39, %33 ], [ %49, %40 ]
%52 = tail call double @llvm.fmuladd.f64(double %20, double %20, double %51)
%53 = tail call double @sqrt(double %52)
%54 = fadd double %20, %53
%55 = fmul double %54, 5.000000e-01
%56 = fneg double %51
%57 = tail call double @llvm.fmuladd.f64(double %56, double %55, double %22)
%58 = fneg double %20
%59 = tail call double @llvm.fmuladd.f64(double %55, double 2.000000e+00, double %58)
%60 = fdiv double %57, %59
%61 = tail call double @llvm.fmuladd.f64(double %55, double %55, double %60)
%62 = tail call double @sqrt(double %61)
%63 = fsub double %62, %55
%64 = fneg double %63
%65 = tail call double @llvm.fmuladd.f64(double %64, double %63, double 1.000000e+00)
%66 = fmul double %65, %0
%67 = fmul double %1, 2.000000e+00
%68 = fmul double %67, %63
%69 = fptosi double %68 to i32
%70 = tail call double @atan2(double %66, i32 %69)
%71 = icmp eq double* %4, null
br i1 %71, label %83, label %72
72: ; preds = %50
%73 = fneg double %0
%74 = tail call double @llvm.fmuladd.f64(double %73, double %63, double %7)
%75 = tail call double @cos(double %70)
%76 = fsub double %6, %1
%77 = tail call double @sin(double %70)
%78 = fmul double %76, %77
%79 = tail call double @llvm.fmuladd.f64(double %74, double %75, double %78)
br label %80
80: ; preds = %11, %72
%81 = phi double [ %79, %72 ], [ %12, %11 ]
%82 = phi double [ %70, %72 ], [ 0x3FF921FB54442D18, %11 ]
store double %81, double* %4
br label %83
83: ; preds = %80, %50, %9
%84 = phi double [ 0x3FF921FB54442D18, %9 ], [ %70, %50 ], [ %82, %80 ]
%85 = fcmp olt double %2, 0.000000e+00
%86 = fsub double 0x400921FB54442D18, %84
%87 = select i1 %85, double %86, double %84
%88 = fcmp olt double %3, 0.000000e+00
%89 = fneg double %87
%90 = select i1 %88, double %89, double %87
ret double %90
}