#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 atan(double);
double ln_deg_to_rad(double);
int /*<<< orphan*/ ln_rad_to_deg(double);
double ln_range_degrees(int /*<<< orphan*/);
double sqrt(double);
double tan(double);
double ln_get_ell_true_anomaly(double e, double E) {
  double v;
  E = ln_deg_to_rad(E);
  v = sqrt((1.0 + e) / (1.0 - e)) * tan(E / 2.0);
  v = 2.0 * atan(v);
  v = ln_range_degrees(ln_rad_to_deg(v));
  return v;
}


x86 assembly (clang, -O0):
<ln_get_ell_true_anomaly>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
call   1070 <ln_deg_to_rad@plt>
movsd  %xmm0,-0x10(%rbp)
movsd  0xe7f(%rip),%xmm0
addsd  -0x8(%rbp),%xmm0
movsd  0xe72(%rip),%xmm1
subsd  -0x8(%rbp),%xmm1
divsd  %xmm1,%xmm0
call   1080 <sqrt@plt>
movsd  %xmm0,-0x20(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  0xe4a(%rip),%xmm1
divsd  %xmm1,%xmm0
call   1060 <tan@plt>
movaps %xmm0,%xmm1
movsd  -0x20(%rbp),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
call   1040 <atan@plt>
movaps %xmm0,%xmm1
movsd  0xe1b(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
call   1050 <ln_rad_to_deg@plt>
mov    %eax,%edi
call   1030 <ln_range_degrees@plt>
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ln_get_ell_true_anomaly>:
sub    $0x18,%rsp
movsd  %xmm0,0x8(%rsp)
movapd %xmm1,%xmm0
call   1070 <ln_deg_to_rad@plt>
movapd %xmm0,%xmm2
movsd  0xe81(%rip),%xmm1
movsd  0x8(%rsp),%xmm3
movapd %xmm3,%xmm0
addsd  %xmm1,%xmm0
subsd  %xmm3,%xmm1
divsd  %xmm1,%xmm0
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     11a5 <ln_get_ell_true_anomaly+0x45>
sqrtsd %xmm0,%xmm0
jmp    11b6 <ln_get_ell_true_anomaly+0x56>
movsd  %xmm2,0x10(%rsp)
call   1080 <sqrt@plt>
movsd  0x10(%rsp),%xmm2
movsd  %xmm0,0x8(%rsp)
mulsd  0xe44(%rip),%xmm2
movapd %xmm2,%xmm0
call   1060 <tan@plt>
mulsd  0x8(%rsp),%xmm0
call   1040 <atan@plt>
addsd  %xmm0,%xmm0
call   1050 <ln_rad_to_deg@plt>
mov    %eax,%edi
add    $0x18,%rsp
jmp    1030 <ln_range_degrees@plt>

LLVM IR (-O0):
define double @ln_get_ell_true_anomaly(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* %4
%7 = call double @ln_deg_to_rad(double %6)
store double %7, double* %4
%8 = load double, double* %3
%9 = fadd double 1.000000e+00, %8
%10 = load double, double* %3
%11 = fsub double 1.000000e+00, %10
%12 = fdiv double %9, %11
%13 = call double @sqrt(double %12)
%14 = load double, double* %4
%15 = fdiv double %14, 2.000000e+00
%16 = call double @tan(double %15)
%17 = fmul double %13, %16
store double %17, double* %5
%18 = load double, double* %5
%19 = call double @atan(double %18)
%20 = fmul double 2.000000e+00, %19
store double %20, double* %5
%21 = load double, double* %5
%22 = call i32 @ln_rad_to_deg(double %21)
%23 = call double @ln_range_degrees(i32 %22)
store double %23, double* %5
%24 = load double, double* %5
ret double %24
}

LLVM IR (-O2):
define double @ln_get_ell_true_anomaly(double %0, double %1) {
%3 = tail call double @ln_deg_to_rad(double %1)
%4 = fadd double %0, 1.000000e+00
%5 = fsub double 1.000000e+00, %0
%6 = fdiv double %4, %5
%7 = tail call double @sqrt(double %6)
%8 = fmul double %3, 5.000000e-01
%9 = tail call double @tan(double %8)
%10 = fmul double %7, %9
%11 = tail call double @atan(double %10)
%12 = fmul double %11, 2.000000e+00
%13 = tail call i32 @ln_rad_to_deg(double %12)
%14 = tail call double @ln_range_degrees(i32 %13)
ret double %14
}