#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 /*<<< orphan*/ EXIT_FAILURE;
double atan2(double, double);
double calcG11(double, double);
double calcH11(double, double);
int /*<<< orphan*/ exit(int /*<<< orphan*/);
double fmod(double, double);
double mag_lon(double et) {
  double fracYearIndex = (et + 3155803200.0) / 157788000.0;
  double fracYear = fmod(fracYearIndex, 1.0);
  double lambda0, g11, h11;
  if (fracYearIndex >= 23) {
    exit(EXIT_FAILURE);
  }
  g11 = calcG11(fracYearIndex, fracYear);
  h11 = calcH11(fracYearIndex, fracYear);
  lambda0 = atan2(h11, g11) + 3.14159265358979323846;
  return lambda0;
}


x86 assembly (clang, -O0):
<mag_lon>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  0xeb3(%rip),%xmm0
addsd  -0x8(%rbp),%xmm0
movsd  0xe9e(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  0xe80(%rip),%xmm1
call   1040 <fmod@plt>
movsd  %xmm0,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  0xe61(%rip),%xmm1
ucomisd %xmm1,%xmm0
jb     11b7 <mag_lon+0x67>
mov    0x2e30(%rip),%rax
mov    (%rax),%edi
call   1070 <exit@plt>
movsd  -0x10(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
call   1060 <calcG11@plt>
movsd  %xmm0,-0x28(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
call   1050 <calcH11@plt>
movsd  %xmm0,-0x30(%rbp)
movsd  -0x30(%rbp),%xmm0
movsd  -0x28(%rbp),%xmm1
call   1030 <atan2@plt>
movsd  0xe2a(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mag_lon>:
sub    $0x18,%rsp
addsd  0xea4(%rip),%xmm0
divsd  0xea4(%rip),%xmm0
movsd  %xmm0,(%rsp)
movsd  0xe9f(%rip),%xmm1
call   1040 <fmod@plt>
movsd  (%rsp),%xmm2
ucomisd 0xe95(%rip),%xmm2
jae    11c6 <mag_lon+0x76>
movapd %xmm0,%xmm1
movapd %xmm2,%xmm0
movsd  %xmm1,0x8(%rsp)
call   1060 <calcG11@plt>
movsd  %xmm0,0x10(%rsp)
movsd  (%rsp),%xmm0
movsd  0x8(%rsp),%xmm1
call   1050 <calcH11@plt>
movsd  0x10(%rsp),%xmm1
call   1030 <atan2@plt>
addsd  0xe5f(%rip),%xmm0
add    $0x18,%rsp
ret
mov    0x2e13(%rip),%rax
mov    (%rax),%edi
call   1070 <exit@plt>

LLVM IR (-O0):
@EXIT_FAILURE = global i32 0
define double @mag_lon(double %0) {
%2 = alloca double
%3 = alloca double
%4 = alloca double
%5 = alloca double
%6 = alloca double
%7 = alloca double
store double %0, double* %2
%8 = load double, double* %2
%9 = fadd double %8, 0x41E7833788000000
%10 = fdiv double %9, 1.577880e+08
store double %10, double* %3
%11 = load double, double* %3
%12 = call double @fmod(double %11, double 1.000000e+00)
store double %12, double* %4
%13 = load double, double* %3
%14 = fcmp oge double %13, 2.300000e+01
br i1 %14, label %15, label %18
15: ; preds = %1
%16 = load i32, i32* @EXIT_FAILURE
%17 = call i32 @exit(i32 %16)
unreachable
18: ; preds = %1
%19 = load double, double* %3
%20 = load double, double* %4
%21 = call double @calcG11(double %19, double %20)
store double %21, double* %6
%22 = load double, double* %3
%23 = load double, double* %4
%24 = call double @calcH11(double %22, double %23)
store double %24, double* %7
%25 = load double, double* %7
%26 = load double, double* %6
%27 = call double @atan2(double %25, double %26)
%28 = fadd double %27, 0x400921FB54442D18
store double %28, double* %5
%29 = load double, double* %5
ret double %29
}

LLVM IR (-O2):
@EXIT_FAILURE = global i32 0
define double @mag_lon(double %0) {
%2 = fadd double %0, 0x41E7833788000000
%3 = fdiv double %2, 1.577880e+08
%4 = tail call double @fmod(double %3, double 1.000000e+00)
%5 = fcmp ult double %3, 2.300000e+01
br i1 %5, label %9, label %6
6: ; preds = %1
%7 = load i32, i32* @EXIT_FAILURE
%8 = tail call i32 @exit(i32 %7)
unreachable
9: ; preds = %1
%10 = tail call double @calcG11(double %3, double %4)
%11 = tail call double @calcH11(double %3, double %4)
%12 = tail call double @atan2(double %11, double %10)
%13 = fadd double %12, 0x400921FB54442D18
ret double %13
}