#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*/ DegreeToRadian(double);
double Mod360Degree(double);
double sin(int /*<<< orphan*/);
double CalcMoonLongitudePerturbation(double dt, double Lp, double F) {
  double T = dt;
  double A1 = 119.75 + 131.849 * T;
  double A2 = 53.09 + 479264.290 * T;
  A1 = Mod360Degree(A1);
  A2 = Mod360Degree(A2);
  double result = 3958.0 * sin(DegreeToRadian(A1));
  result += (1962.0 * sin(DegreeToRadian(Lp - F)));
  result += (318.0 * sin(DegreeToRadian(A2)));
  return result;
}


x86 assembly (clang, -O0):
<CalcMoonLongitudePerturbation>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
movsd  0xeca(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xec6(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x20(%rbp),%xmm0
movsd  0xe98(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xe94(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x28(%rbp),%xmm0
call   1030 <Mod360Degree@plt>
movsd  %xmm0,-0x28(%rbp)
movsd  -0x30(%rbp),%xmm0
call   1030 <Mod360Degree@plt>
movsd  %xmm0,-0x30(%rbp)
movsd  -0x28(%rbp),%xmm0
call   1050 <DegreeToRadian@plt>
mov    %eax,%edi
call   1040 <sin@plt>
movaps %xmm0,%xmm1
movsd  0xe41(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  -0x10(%rbp),%xmm0
subsd  -0x18(%rbp),%xmm0
call   1050 <DegreeToRadian@plt>
mov    %eax,%edi
call   1040 <sin@plt>
movsd  -0x38(%rbp),%xmm1
movsd  0xe0d(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  -0x30(%rbp),%xmm0
call   1050 <DegreeToRadian@plt>
mov    %eax,%edi
call   1040 <sin@plt>
movsd  -0x38(%rbp),%xmm1
movsd  0xdda(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  -0x38(%rbp),%xmm0
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CalcMoonLongitudePerturbation>:
sub    $0x28,%rsp
movsd  %xmm2,0x18(%rsp)
movsd  %xmm1,0x20(%rsp)
movapd %xmm0,%xmm1
movsd  0xeb4(%rip),%xmm0
mulsd  %xmm1,%xmm0
addsd  0xeb0(%rip),%xmm0
mulsd  0xeb0(%rip),%xmm1
addsd  0xeb0(%rip),%xmm1
movsd  %xmm1,0x10(%rsp)
call   1030 <Mod360Degree@plt>
movsd  %xmm0,0x8(%rsp)
movsd  0x10(%rsp),%xmm0
call   1030 <Mod360Degree@plt>
movsd  %xmm0,0x10(%rsp)
movsd  0x8(%rsp),%xmm0
call   1050 <DegreeToRadian@plt>
mov    %eax,%edi
call   1040 <sin@plt>
mulsd  0xe7c(%rip),%xmm0
movsd  %xmm0,0x8(%rsp)
movsd  0x20(%rsp),%xmm0
subsd  0x18(%rsp),%xmm0
call   1050 <DegreeToRadian@plt>
mov    %eax,%edi
call   1040 <sin@plt>
mulsd  0xe5e(%rip),%xmm0
addsd  0x8(%rsp),%xmm0
movsd  %xmm0,0x18(%rsp)
movsd  0x10(%rsp),%xmm0
call   1050 <DegreeToRadian@plt>
mov    %eax,%edi
call   1040 <sin@plt>
mulsd  0xe40(%rip),%xmm0
addsd  0x18(%rsp),%xmm0
add    $0x28,%rsp
ret

LLVM IR (-O0):
define double @CalcMoonLongitudePerturbation(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
%7 = alloca double
%8 = alloca double
%9 = alloca double
%10 = alloca double
store double %0, double* %4
store double %1, double* %5
store double %2, double* %6
%11 = load double, double* %4
store double %11, double* %7
%12 = load double, double* %7
%13 = call double @llvm.fmuladd.f64(double 1.318490e+02, double %12, double 1.197500e+02)
store double %13, double* %8
%14 = load double, double* %7
%15 = call double @llvm.fmuladd.f64(double 0x411D408128F5C28F, double %14, double 5.309000e+01)
store double %15, double* %9
%16 = load double, double* %8
%17 = call double @Mod360Degree(double %16)
store double %17, double* %8
%18 = load double, double* %9
%19 = call double @Mod360Degree(double %18)
store double %19, double* %9
%20 = load double, double* %8
%21 = call i32 @DegreeToRadian(double %20)
%22 = call double @sin(i32 %21)
%23 = fmul double 3.958000e+03, %22
store double %23, double* %10
%24 = load double, double* %5
%25 = load double, double* %6
%26 = fsub double %24, %25
%27 = call i32 @DegreeToRadian(double %26)
%28 = call double @sin(i32 %27)
%29 = load double, double* %10
%30 = call double @llvm.fmuladd.f64(double 1.962000e+03, double %28, double %29)
store double %30, double* %10
%31 = load double, double* %9
%32 = call i32 @DegreeToRadian(double %31)
%33 = call double @sin(i32 %32)
%34 = load double, double* %10
%35 = call double @llvm.fmuladd.f64(double 3.180000e+02, double %33, double %34)
store double %35, double* %10
%36 = load double, double* %10
ret double %36
}

LLVM IR (-O2):
define double @CalcMoonLongitudePerturbation(double %0, double %1, double %2) {
%4 = tail call double @llvm.fmuladd.f64(double %0, double 1.318490e+02, double 1.197500e+02)
%5 = tail call double @llvm.fmuladd.f64(double %0, double 0x411D408128F5C28F, double 5.309000e+01)
%6 = tail call double @Mod360Degree(double %4)
%7 = tail call double @Mod360Degree(double %5)
%8 = tail call i32 @DegreeToRadian(double %6)
%9 = tail call double @sin(i32 %8)
%10 = fmul double %9, 3.958000e+03
%11 = fsub double %1, %2
%12 = tail call i32 @DegreeToRadian(double %11)
%13 = tail call double @sin(i32 %12)
%14 = tail call double @llvm.fmuladd.f64(double %13, double 1.962000e+03, double %10)
%15 = tail call i32 @DegreeToRadian(double %7)
%16 = tail call double @sin(i32 %15)
%17 = tail call double @llvm.fmuladd.f64(double %16, double 3.180000e+02, double %14)
ret double %17
}