#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 CalculateJulianDay(int, int, int, int /*<<< orphan*/, int /*<<< orphan*/,
                       double);
double sin(int);
double CalculateNewMoonByFm(int m) {
  double baseJD = CalculateJulianDay(1900, 1, 1, 0, 0, 0.0) - 1;
  double accDay = 1.6 + 29.5306 * m + 0.4 * sin(1 - 0.45058 * m);
  return baseJD + accDay;
}


x86 assembly (clang, -O0):
<CalculateNewMoonByFm>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x76c,%edi
mov    $0x1,%edx
xor    %r8d,%r8d
xorps  %xmm0,%xmm0
mov    %edx,%esi
mov    %r8d,%ecx
call   1030 <CalculateJulianDay@plt>
sub    $0x1,%eax
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x10(%rbp)
cvtsi2sdl -0x4(%rbp),%xmm0
movsd  0xeba(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xeb6(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
cvtsi2sdl -0x4(%rbp),%xmm0
movsd  0xe88(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xe84(%rip),%xmm1
addsd  %xmm1,%xmm0
cvttsd2si %xmm0,%edi
call   1040 <sin@plt>
movsd  -0x20(%rbp),%xmm1
movsd  0xe5a(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
addsd  -0x18(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CalculateNewMoonByFm>:
push   %rbx
sub    $0x10,%rsp
mov    %edi,%ebx
xorps  %xmm0,%xmm0
mov    $0x76c,%edi
mov    $0x1,%esi
mov    $0x1,%edx
xor    %ecx,%ecx
xor    %r8d,%r8d
call   1030 <CalculateJulianDay@plt>
add    $0xffffffff,%eax
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
movsd  %xmm0,0x8(%rsp)
xorps  %xmm0,%xmm0
cvtsi2sd %ebx,%xmm0
movsd  0xe9e(%rip),%xmm1
mulsd  %xmm0,%xmm1
addsd  0xe9a(%rip),%xmm1
movsd  %xmm1,(%rsp)
mulsd  0xe95(%rip),%xmm0
addsd  0xe95(%rip),%xmm0
cvttsd2si %xmm0,%edi
call   1040 <sin@plt>
mulsd  0xe8c(%rip),%xmm0
addsd  (%rsp),%xmm0
addsd  0x8(%rsp),%xmm0
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define double @CalculateNewMoonByFm(i32 %0) {
%2 = alloca i32
%3 = alloca double
%4 = alloca double
store i32 %0, i32* %2
%5 = call i32 @CalculateJulianDay(i32 1900, i32 1, i32 1, i32 0, i32 0, double 0.000000e+00)
%6 = sub nsw i32 %5, 1
%7 = sitofp i32 %6 to double
store double %7, double* %3
%8 = load i32, i32* %2
%9 = sitofp i32 %8 to double
%10 = call double @llvm.fmuladd.f64(double 2.953060e+01, double %9, double 1.600000e+00)
%11 = load i32, i32* %2
%12 = sitofp i32 %11 to double
%13 = call double @llvm.fmuladd.f64(double -4.505800e-01, double %12, double 1.000000e+00)
%14 = fptosi double %13 to i32
%15 = call double @sin(i32 %14)
%16 = call double @llvm.fmuladd.f64(double 4.000000e-01, double %15, double %10)
store double %16, double* %4
%17 = load double, double* %3
%18 = load double, double* %4
%19 = fadd double %17, %18
ret double %19
}

LLVM IR (-O2):
define double @CalculateNewMoonByFm(i32 %0) {
%2 = tail call i32 @CalculateJulianDay(i32 1900, i32 1, i32 1, i32 0, i32 0, double 0.000000e+00)
%3 = add nsw i32 %2, -1
%4 = sitofp i32 %3 to double
%5 = sitofp i32 %0 to double
%6 = tail call double @llvm.fmuladd.f64(double %5, double 2.953060e+01, double 1.600000e+00)
%7 = tail call double @llvm.fmuladd.f64(double %5, double -4.505800e-01, double 1.000000e+00)
%8 = fptosi double %7 to i32
%9 = tail call double @sin(i32 %8)
%10 = tail call double @llvm.fmuladd.f64(double %9, double 4.000000e-01, double %6)
%11 = fadd double %10, %4
ret double %11
}