#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 fabs(double);
double near_parabolic(const double ecc_anom, const double e) {
  const double anom2 = (e > 1. ? ecc_anom * ecc_anom : -ecc_anom * ecc_anom);
  double term = e * anom2 * ecc_anom / 6.;
  double rval = (1. - e) * ecc_anom - term;
  unsigned n = 4;
  while (fabs(term) > 1e-15) {
    term *= anom2 / (double)(n * (n + 1));
    rval -= term;
    n += 2;
  }
  return (rval);
}


x86 assembly (clang, -O0):
<near_parabolic>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  0xed1(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    114d <near_parabolic+0x3d>
movsd  -0x8(%rbp),%xmm0
mulsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x38(%rbp)
jmp    1173 <near_parabolic+0x63>
movsd  -0x8(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  -0x38(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
mulsd  -0x18(%rbp),%xmm0
mulsd  -0x8(%rbp),%xmm0
movsd  0xe74(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  0xe5b(%rip),%xmm0
subsd  -0x10(%rbp),%xmm0
movsd  -0x8(%rbp),%xmm2
movsd  -0x20(%rbp),%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x28(%rbp)
movl   $0x4,-0x2c(%rbp)
movsd  -0x20(%rbp),%xmm0
call   1030 <fabs@plt>
cvtsi2sd %eax,%xmm0
movsd  0xe1b(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    1243 <near_parabolic+0x133>
movsd  -0x18(%rbp),%xmm0
mov    -0x2c(%rbp),%eax
mov    %eax,%ecx
add    $0x1,%ecx
imul   %ecx,%eax
cvtsi2sd %rax,%xmm1
divsd  %xmm1,%xmm0
mulsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm1
movsd  -0x28(%rbp),%xmm0
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x28(%rbp)
mov    -0x2c(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0x2c(%rbp)
jmp    11df <near_parabolic+0xcf>
movsd  -0x28(%rbp),%xmm0
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<near_parabolic>:
push   %rbx
sub    $0x30,%rsp
movapd 0xee3(%rip),%xmm2
xorpd  %xmm0,%xmm2
movsd  0xee7(%rip),%xmm4
movapd %xmm4,%xmm5
cmpltsd %xmm1,%xmm5
movapd %xmm5,%xmm3
andpd  %xmm0,%xmm3
andnpd %xmm2,%xmm5
orpd   %xmm3,%xmm5
mulsd  %xmm0,%xmm5
movapd %xmm5,0x20(%rsp)
mulsd  %xmm1,%xmm5
mulsd  %xmm0,%xmm5
divsd  0xebc(%rip),%xmm5
subsd  %xmm1,%xmm4
mulsd  %xmm0,%xmm4
subsd  %xmm5,%xmm4
movsd  %xmm4,0x8(%rsp)
movapd %xmm5,0x10(%rsp)
movapd %xmm5,%xmm0
call   1030 <fabs@plt>
test   %eax,%eax
jle    11ea <near_parabolic+0xda>
mov    $0x5,%ebx
movsd  0x8(%rsp),%xmm0
movapd 0x10(%rsp),%xmm3
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
lea    -0x1(%rbx),%eax
imul   %ebx,%eax
xorps  %xmm2,%xmm2
cvtsi2sd %rax,%xmm2
movapd 0x20(%rsp),%xmm1
divsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm3
movapd %xmm3,0x10(%rsp)
subsd  %xmm3,%xmm0
movsd  %xmm0,0x8(%rsp)
movapd %xmm3,%xmm0
call   1030 <fabs@plt>
movapd 0x10(%rsp),%xmm3
movsd  0x8(%rsp),%xmm0
add    $0x2,%ebx
test   %eax,%eax
jg     11a0 <near_parabolic+0x90>
jmp    11f0 <near_parabolic+0xe0>
movsd  0x8(%rsp),%xmm0
add    $0x30,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define double @near_parabolic(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca double
%6 = alloca double
%7 = alloca double
%8 = alloca i32
store double %0, double* %3
store double %1, double* %4
%9 = load double, double* %4
%10 = fcmp ogt double %9, 1.000000e+00
br i1 %10, label %11, label %15
11: ; preds = %2
%12 = load double, double* %3
%13 = load double, double* %3
%14 = fmul double %12, %13
br label %20
15: ; preds = %2
%16 = load double, double* %3
%17 = fneg double %16
%18 = load double, double* %3
%19 = fmul double %17, %18
br label %20
20: ; preds = %15, %11
%21 = phi double [ %14, %11 ], [ %19, %15 ]
store double %21, double* %5
%22 = load double, double* %4
%23 = load double, double* %5
%24 = fmul double %22, %23
%25 = load double, double* %3
%26 = fmul double %24, %25
%27 = fdiv double %26, 6.000000e+00
store double %27, double* %6
%28 = load double, double* %4
%29 = fsub double 1.000000e+00, %28
%30 = load double, double* %3
%31 = load double, double* %6
%32 = fneg double %31
%33 = call double @llvm.fmuladd.f64(double %29, double %30, double %32)
store double %33, double* %7
store i32 4, i32* %8
br label %34
34: ; preds = %39, %20
%35 = load double, double* %6
%36 = call i32 @fabs(double %35)
%37 = sitofp i32 %36 to double
%38 = fcmp ogt double %37, 1.000000e-15
br i1 %38, label %39, label %54
39: ; preds = %34
%40 = load double, double* %5
%41 = load i32, i32* %8
%42 = load i32, i32* %8
%43 = add i32 %42, 1
%44 = mul i32 %41, %43
%45 = uitofp i32 %44 to double
%46 = fdiv double %40, %45
%47 = load double, double* %6
%48 = fmul double %47, %46
store double %48, double* %6
%49 = load double, double* %6
%50 = load double, double* %7
%51 = fsub double %50, %49
store double %51, double* %7
%52 = load i32, i32* %8
%53 = add i32 %52, 2
store i32 %53, i32* %8
br label %34
54: ; preds = %34
%55 = load double, double* %7
ret double %55
}

LLVM IR (-O2):
define double @near_parabolic(double %0, double %1) {
%3 = fcmp ogt double %1, 1.000000e+00
%4 = fneg double %0
%5 = select i1 %3, double %0, double %4
%6 = fmul double %5, %0
%7 = fmul double %6, %1
%8 = fmul double %7, %0
%9 = fdiv double %8, 6.000000e+00
%10 = fsub double 1.000000e+00, %1
%11 = fneg double %9
%12 = tail call double @llvm.fmuladd.f64(double %10, double %0, double %11)
%13 = tail call i32 @fabs(double %9)
%14 = icmp sgt i32 %13, 0
br i1 %14, label %15, label %28
15: ; preds = %2, %15
%16 = phi i32 [ %25, %15 ], [ 4, %2 ]
%17 = phi double [ %24, %15 ], [ %12, %2 ]
%18 = phi double [ %23, %15 ], [ %9, %2 ]
%19 = or i32 %16, 1
%20 = mul i32 %19, %16
%21 = uitofp i32 %20 to double
%22 = fdiv double %6, %21
%23 = fmul double %18, %22
%24 = fsub double %17, %23
%25 = add i32 %16, 2
%26 = tail call i32 @fabs(double %23)
%27 = icmp sgt i32 %26, 0
br i1 %27, label %15, label %28
28: ; preds = %15, %2
%29 = phi double [ %12, %2 ], [ %24, %15 ]
ret double %29
}