#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 CalcMoonLatitudePerturbation(double dt, double Lp, double F, double Mp) {
  double T = dt;
  double A1 = 119.75 + 131.849 * T;
  double A3 = 313.45 + 481266.484 * T;
  A1 = Mod360Degree(A1);
  A3 = Mod360Degree(A3);
  double result = -2235.0 * sin(DegreeToRadian(Lp));
  result += (382.0 * sin(DegreeToRadian(A3)));
  result += (175.0 * sin(DegreeToRadian(A1 - F)));
  result += (175.0 * sin(DegreeToRadian(A1 + F)));
  result += (127.0 * sin(DegreeToRadian(Lp - Mp)));
  result += (115.0 * sin(DegreeToRadian(Lp + Mp)));
  return result;
}


x86 assembly (clang, -O0):
<CalcMoonLatitudePerturbation>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  %xmm3,-0x20(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x28(%rbp),%xmm0
movsd  0xed5(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xed1(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x28(%rbp),%xmm0
movsd  0xea3(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xe9f(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  -0x30(%rbp),%xmm0
call   1030 <Mod360Degree@plt>
movsd  %xmm0,-0x30(%rbp)
movsd  -0x38(%rbp),%xmm0
call   1030 <Mod360Degree@plt>
movsd  %xmm0,-0x38(%rbp)
movsd  -0x10(%rbp),%xmm0
call   1050 <DegreeToRadian@plt>
mov    %eax,%edi
call   1040 <sin@plt>
movaps %xmm0,%xmm1
movsd  0xe4c(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x38(%rbp),%xmm0
call   1050 <DegreeToRadian@plt>
mov    %eax,%edi
call   1040 <sin@plt>
movsd  -0x40(%rbp),%xmm1
movsd  0xe1d(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x30(%rbp),%xmm0
subsd  -0x18(%rbp),%xmm0
call   1050 <DegreeToRadian@plt>
mov    %eax,%edi
call   1040 <sin@plt>
movsd  -0x40(%rbp),%xmm1
movsd  0xde5(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x30(%rbp),%xmm0
addsd  -0x18(%rbp),%xmm0
call   1050 <DegreeToRadian@plt>
mov    %eax,%edi
call   1040 <sin@plt>
movsd  -0x40(%rbp),%xmm1
movsd  0xdb5(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x10(%rbp),%xmm0
subsd  -0x20(%rbp),%xmm0
call   1050 <DegreeToRadian@plt>
mov    %eax,%edi
call   1040 <sin@plt>
movsd  -0x40(%rbp),%xmm1
movsd  0xd7d(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x10(%rbp),%xmm0
addsd  -0x20(%rbp),%xmm0
call   1050 <DegreeToRadian@plt>
mov    %eax,%edi
call   1040 <sin@plt>
movsd  -0x40(%rbp),%xmm1
movsd  0xd45(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x40(%rbp),%xmm0
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CalcMoonLatitudePerturbation>:
sub    $0x38,%rsp
movsd  %xmm3,0x28(%rsp)
movsd  %xmm2,0x10(%rsp)
movsd  %xmm1,0x18(%rsp)
movapd %xmm0,%xmm1
movsd  0xeae(%rip),%xmm0
mulsd  %xmm1,%xmm0
addsd  0xeaa(%rip),%xmm0
mulsd  0xeaa(%rip),%xmm1
addsd  0xeaa(%rip),%xmm1
movsd  %xmm1,0x8(%rsp)
call   1030 <Mod360Degree@plt>
movsd  %xmm0,0x20(%rsp)
movsd  0x8(%rsp),%xmm0
call   1030 <Mod360Degree@plt>
movsd  %xmm0,0x8(%rsp)
movsd  0x18(%rsp),%xmm0
call   1050 <DegreeToRadian@plt>
mov    %eax,%edi
call   1040 <sin@plt>
mulsd  0xe76(%rip),%xmm0
movsd  %xmm0,0x30(%rsp)
movsd  0x8(%rsp),%xmm0
call   1050 <DegreeToRadian@plt>
mov    %eax,%edi
call   1040 <sin@plt>
mulsd  0xe5e(%rip),%xmm0
addsd  0x30(%rsp),%xmm0
movsd  %xmm0,0x8(%rsp)
movsd  0x20(%rsp),%xmm0
subsd  0x10(%rsp),%xmm0
call   1050 <DegreeToRadian@plt>
mov    %eax,%edi
call   1040 <sin@plt>
mulsd  0xe3a(%rip),%xmm0
addsd  0x8(%rsp),%xmm0
movsd  %xmm0,0x8(%rsp)
movsd  0x20(%rsp),%xmm0
addsd  0x10(%rsp),%xmm0
call   1050 <DegreeToRadian@plt>
mov    %eax,%edi
call   1040 <sin@plt>
mulsd  0xe0e(%rip),%xmm0
addsd  0x8(%rsp),%xmm0
movsd  %xmm0,0x10(%rsp)
movsd  0x18(%rsp),%xmm0
subsd  0x28(%rsp),%xmm0
call   1050 <DegreeToRadian@plt>
mov    %eax,%edi
call   1040 <sin@plt>
mulsd  0xdea(%rip),%xmm0
addsd  0x10(%rsp),%xmm0
movsd  %xmm0,0x10(%rsp)
movsd  0x18(%rsp),%xmm0
addsd  0x28(%rsp),%xmm0
call   1050 <DegreeToRadian@plt>
mov    %eax,%edi
call   1040 <sin@plt>
mulsd  0xdc6(%rip),%xmm0
addsd  0x10(%rsp),%xmm0
add    $0x38,%rsp
ret

LLVM IR (-O0):
define double @CalcMoonLatitudePerturbation(double %0, double %1, double %2, double %3) {
%5 = alloca double
%6 = alloca double
%7 = alloca double
%8 = alloca double
%9 = alloca double
%10 = alloca double
%11 = alloca double
%12 = alloca double
store double %0, double* %5
store double %1, double* %6
store double %2, double* %7
store double %3, double* %8
%13 = load double, double* %5
store double %13, double* %9
%14 = load double, double* %9
%15 = call double @llvm.fmuladd.f64(double 1.318490e+02, double %14, double 1.197500e+02)
store double %15, double* %10
%16 = load double, double* %9
%17 = call double @llvm.fmuladd.f64(double 0x411D5FC9EF9DB22D, double %16, double 3.134500e+02)
store double %17, double* %11
%18 = load double, double* %10
%19 = call double @Mod360Degree(double %18)
store double %19, double* %10
%20 = load double, double* %11
%21 = call double @Mod360Degree(double %20)
store double %21, double* %11
%22 = load double, double* %6
%23 = call i32 @DegreeToRadian(double %22)
%24 = call double @sin(i32 %23)
%25 = fmul double -2.235000e+03, %24
store double %25, double* %12
%26 = load double, double* %11
%27 = call i32 @DegreeToRadian(double %26)
%28 = call double @sin(i32 %27)
%29 = load double, double* %12
%30 = call double @llvm.fmuladd.f64(double 3.820000e+02, double %28, double %29)
store double %30, double* %12
%31 = load double, double* %10
%32 = load double, double* %7
%33 = fsub double %31, %32
%34 = call i32 @DegreeToRadian(double %33)
%35 = call double @sin(i32 %34)
%36 = load double, double* %12
%37 = call double @llvm.fmuladd.f64(double 1.750000e+02, double %35, double %36)
store double %37, double* %12
%38 = load double, double* %10
%39 = load double, double* %7
%40 = fadd double %38, %39
%41 = call i32 @DegreeToRadian(double %40)
%42 = call double @sin(i32 %41)
%43 = load double, double* %12
%44 = call double @llvm.fmuladd.f64(double 1.750000e+02, double %42, double %43)
store double %44, double* %12
%45 = load double, double* %6
%46 = load double, double* %8
%47 = fsub double %45, %46
%48 = call i32 @DegreeToRadian(double %47)
%49 = call double @sin(i32 %48)
%50 = load double, double* %12
%51 = call double @llvm.fmuladd.f64(double 1.270000e+02, double %49, double %50)
store double %51, double* %12
%52 = load double, double* %6
%53 = load double, double* %8
%54 = fadd double %52, %53
%55 = call i32 @DegreeToRadian(double %54)
%56 = call double @sin(i32 %55)
%57 = load double, double* %12
%58 = call double @llvm.fmuladd.f64(double 1.150000e+02, double %56, double %57)
store double %58, double* %12
%59 = load double, double* %12
ret double %59
}

LLVM IR (-O2):
define double @CalcMoonLatitudePerturbation(double %0, double %1, double %2, double %3) {
%5 = tail call double @llvm.fmuladd.f64(double %0, double 1.318490e+02, double 1.197500e+02)
%6 = tail call double @llvm.fmuladd.f64(double %0, double 0x411D5FC9EF9DB22D, double 3.134500e+02)
%7 = tail call double @Mod360Degree(double %5)
%8 = tail call double @Mod360Degree(double %6)
%9 = tail call i32 @DegreeToRadian(double %1)
%10 = tail call double @sin(i32 %9)
%11 = fmul double %10, -2.235000e+03
%12 = tail call i32 @DegreeToRadian(double %8)
%13 = tail call double @sin(i32 %12)
%14 = tail call double @llvm.fmuladd.f64(double %13, double 3.820000e+02, double %11)
%15 = fsub double %7, %2
%16 = tail call i32 @DegreeToRadian(double %15)
%17 = tail call double @sin(i32 %16)
%18 = tail call double @llvm.fmuladd.f64(double %17, double 1.750000e+02, double %14)
%19 = fadd double %7, %2
%20 = tail call i32 @DegreeToRadian(double %19)
%21 = tail call double @sin(i32 %20)
%22 = tail call double @llvm.fmuladd.f64(double %21, double 1.750000e+02, double %18)
%23 = fsub double %1, %3
%24 = tail call i32 @DegreeToRadian(double %23)
%25 = tail call double @sin(i32 %24)
%26 = tail call double @llvm.fmuladd.f64(double %25, double 1.270000e+02, double %22)
%27 = fadd double %1, %3
%28 = tail call i32 @DegreeToRadian(double %27)
%29 = tail call double @sin(i32 %28)
%30 = tail call double @llvm.fmuladd.f64(double %29, double 1.150000e+02, double %26)
ret double %30
}