#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(double);
double CalculateSolarTermsByFm(int year, int st) {
  double baseJD = CalculateJulianDay(1900, 1, 1, 0, 0, 0.0) - 1;
  int y = year - 1900;
  double accDay = 365.2422 * y + 6.2 + 15.22 * st - 1.0 * sin(0.262 * st);
  return baseJD + accDay;
}


x86 assembly (clang, -O0):
<CalculateSolarTermsByFm>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%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)
mov    -0x4(%rbp),%eax
sub    $0x76c,%eax
mov    %eax,-0x14(%rbp)
cvtsi2sdl -0x14(%rbp),%xmm1
movsd  0xea4(%rip),%xmm0
mulsd  %xmm0,%xmm1
movsd  0xea0(%rip),%xmm0
addsd  %xmm0,%xmm1
cvtsi2sdl -0x8(%rbp),%xmm0
movsd  0xe7f(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x28(%rbp)
cvtsi2sdl -0x8(%rbp),%xmm1
movsd  0xe5d(%rip),%xmm0
mulsd  %xmm1,%xmm0
call   1040 <sin@plt>
movaps %xmm0,%xmm1
movsd  -0x28(%rbp),%xmm0
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x10(%rbp),%xmm0
addsd  -0x20(%rbp),%xmm0
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CalculateSolarTermsByFm>:
push   %rbp
push   %rbx
sub    $0x18,%rsp
mov    %esi,%ebx
mov    %edi,%ebp
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,0x10(%rsp)
add    $0xfffff894,%ebp
cvtsi2sd %ebp,%xmm1
mulsd  0xe98(%rip),%xmm1
addsd  0xe98(%rip),%xmm1
xorps  %xmm0,%xmm0
cvtsi2sd %ebx,%xmm0
movsd  0xe91(%rip),%xmm2
mulsd  %xmm0,%xmm2
addsd  %xmm1,%xmm2
movsd  %xmm2,0x8(%rsp)
mulsd  0xe83(%rip),%xmm0
call   1040 <sin@plt>
movsd  0x8(%rsp),%xmm1
subsd  %xmm0,%xmm1
addsd  0x10(%rsp),%xmm1
movapd %xmm1,%xmm0
add    $0x18,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define double @CalculateSolarTermsByFm(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca double
%6 = alloca i32
%7 = alloca double
store i32 %0, i32* %3
store i32 %1, i32* %4
%8 = call i32 @CalculateJulianDay(i32 1900, i32 1, i32 1, i32 0, i32 0, double 0.000000e+00)
%9 = sub nsw i32 %8, 1
%10 = sitofp i32 %9 to double
store double %10, double* %5
%11 = load i32, i32* %3
%12 = sub nsw i32 %11, 1900
store i32 %12, i32* %6
%13 = load i32, i32* %6
%14 = sitofp i32 %13 to double
%15 = call double @llvm.fmuladd.f64(double 0x4076D3E00D1B7176, double %14, double 6.200000e+00)
%16 = load i32, i32* %4
%17 = sitofp i32 %16 to double
%18 = call double @llvm.fmuladd.f64(double 1.522000e+01, double %17, double %15)
%19 = load i32, i32* %4
%20 = sitofp i32 %19 to double
%21 = fmul double 2.620000e-01, %20
%22 = call double @sin(double %21)
%23 = call double @llvm.fmuladd.f64(double -1.000000e+00, double %22, double %18)
store double %23, double* %7
%24 = load double, double* %5
%25 = load double, double* %7
%26 = fadd double %24, %25
ret double %26
}

LLVM IR (-O2):
define double @CalculateSolarTermsByFm(i32 %0, i32 %1) {
%3 = tail call i32 @CalculateJulianDay(i32 1900, i32 1, i32 1, i32 0, i32 0, double 0.000000e+00)
%4 = add nsw i32 %3, -1
%5 = sitofp i32 %4 to double
%6 = add nsw i32 %0, -1900
%7 = sitofp i32 %6 to double
%8 = tail call double @llvm.fmuladd.f64(double %7, double 0x4076D3E00D1B7176, double 6.200000e+00)
%9 = sitofp i32 %1 to double
%10 = tail call double @llvm.fmuladd.f64(double %9, double 1.522000e+01, double %8)
%11 = fmul double %9, 2.620000e-01
%12 = tail call double @sin(double %11)
%13 = tail call double @llvm.fmuladd.f64(double %12, double -1.000000e+00, double %10)
%14 = fadd double %13, %5
ret double %14
}