#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 */
double AstAlg_lunar_ascending_node(double);
double AstAlg_mean_obliquity(double);
double M_PI;
double cos(double);
double AstAlg_apparent_obliquity(double jd) {
  static double last_jd, last_eps;
  if (jd == last_jd)
    return last_eps;
  last_jd = jd;
  last_eps = AstAlg_mean_obliquity(jd) +
             0.00256 * cos((M_PI / 180.0) * AstAlg_lunar_ascending_node(jd));
  return last_eps;
}


x86 assembly (clang, -O0):
<AstAlg_apparent_obliquity>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
ucomisd 0x2ef6(%rip),%xmm0
jne    1168 <AstAlg_apparent_obliquity+0x38>
jp     1168 <AstAlg_apparent_obliquity+0x38>
movsd  0x2eea(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    11e5 <AstAlg_apparent_obliquity+0xb5>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,0x2ecb(%rip)
movsd  -0x10(%rbp),%xmm0
call   1030 <AstAlg_mean_obliquity@plt>
movsd  %xmm0,-0x18(%rbp)
mov    0x2e5d(%rip),%rax
movsd  (%rax),%xmm0
movsd  0xe71(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x10(%rbp),%xmm0
call   1040 <AstAlg_lunar_ascending_node@plt>
movaps %xmm0,%xmm1
movsd  -0x20(%rbp),%xmm0
mulsd  %xmm1,%xmm0
call   1050 <cos@plt>
movsd  -0x18(%rbp),%xmm1
movsd  0xe38(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,0x2e70(%rip)
movsd  0x2e68(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<AstAlg_apparent_obliquity>:
sub    $0x18,%rsp
movsd  0x2f04(%rip),%xmm1
ucomisd %xmm0,%xmm1
jne    1151 <AstAlg_apparent_obliquity+0x21>
jp     1151 <AstAlg_apparent_obliquity+0x21>
movsd  0x2efc(%rip),%xmm0
add    $0x18,%rsp
ret
movsd  %xmm0,0x2ee7(%rip)
movsd  %xmm0,0x8(%rsp)
call   1030 <AstAlg_mean_obliquity@plt>
movsd  %xmm0,0x10(%rsp)
mov    0x2e77(%rip),%rax
movsd  (%rax),%xmm0
divsd  0xe83(%rip),%xmm0
movsd  %xmm0,(%rsp)
movsd  0x8(%rsp),%xmm0
call   1040 <AstAlg_lunar_ascending_node@plt>
mulsd  (%rsp),%xmm0
call   1050 <cos@plt>
mulsd  0xe69(%rip),%xmm0
addsd  0x10(%rsp),%xmm0
movsd  %xmm0,0x2e9b(%rip)
add    $0x18,%rsp
ret

LLVM IR (-O0):
@AstAlg_apparent_obliquity.last_jd = internal global double 0.000000e+00
@AstAlg_apparent_obliquity.last_eps = internal global double 0.000000e+00
@M_PI = global double 0.000000e+00
define double @AstAlg_apparent_obliquity(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %3
%4 = load double, double* %3
%5 = load double, double* @AstAlg_apparent_obliquity.last_jd
%6 = fcmp oeq double %4, %5
br i1 %6, label %7, label %9
7: ; preds = %1
%8 = load double, double* @AstAlg_apparent_obliquity.last_eps
store double %8, double* %2
br label %21
9: ; preds = %1
%10 = load double, double* %3
store double %10, double* @AstAlg_apparent_obliquity.last_jd
%11 = load double, double* %3
%12 = call double @AstAlg_mean_obliquity(double %11)
%13 = load double, double* @M_PI
%14 = fdiv double %13, 1.800000e+02
%15 = load double, double* %3
%16 = call double @AstAlg_lunar_ascending_node(double %15)
%17 = fmul double %14, %16
%18 = call double @cos(double %17)
%19 = call double @llvm.fmuladd.f64(double 2.560000e-03, double %18, double %12)
store double %19, double* @AstAlg_apparent_obliquity.last_eps
%20 = load double, double* @AstAlg_apparent_obliquity.last_eps
store double %20, double* %2
br label %21
21: ; preds = %9, %7
%22 = load double, double* %2
ret double %22
}

LLVM IR (-O2):
@AstAlg_apparent_obliquity.last_jd = internal unnamed_addr global double 0.000000e+00
@AstAlg_apparent_obliquity.last_eps = internal unnamed_addr global double 0.000000e+00
@M_PI = global double 0.000000e+00
define double @AstAlg_apparent_obliquity(double %0) {
%2 = load double, double* @AstAlg_apparent_obliquity.last_jd
%3 = fcmp oeq double %2, %0
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = load double, double* @AstAlg_apparent_obliquity.last_eps
br label %14
6: ; preds = %1
store double %0, double* @AstAlg_apparent_obliquity.last_jd
%7 = tail call double @AstAlg_mean_obliquity(double %0)
%8 = load double, double* @M_PI
%9 = fdiv double %8, 1.800000e+02
%10 = tail call double @AstAlg_lunar_ascending_node(double %0)
%11 = fmul double %9, %10
%12 = tail call double @cos(double %11)
%13 = tail call double @llvm.fmuladd.f64(double %12, double 2.560000e-03, double %7)
store double %13, double* @AstAlg_apparent_obliquity.last_eps
br label %14
14: ; preds = %6, %4
%15 = phi double [ %5, %4 ], [ %13, %6 ]
ret double %15
}