#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_lunar_longitude(double);
double AstAlg_mean_solar_longitude(double);
double M_PI;
double cos(double);
double sin(double);
void AstAlg_nutation_corr(double jd, double *slong_corr, double *obliq_corr) {
  double slong, lunlong, omega;
  static double last_jd, last_slcorr, last_oblcorr;
  if (jd == last_jd) {
    *slong_corr = last_slcorr;
    *obliq_corr = last_oblcorr;
  }
  slong = (M_PI / 180.0) * AstAlg_mean_solar_longitude(jd);
  lunlong = (M_PI / 180.0) * AstAlg_mean_lunar_longitude(jd);
  omega = (M_PI / 180.0) * AstAlg_lunar_ascending_node(jd);
  *slong_corr = -17.20 * sin(omega) - 1.32 * sin(2.0 * slong) -
                0.23 * sin(2.0 * lunlong) + 0.21 * sin(2.0 * omega);
  *slong_corr = *slong_corr / 3600.0;
  *obliq_corr = 9.20 * cos(omega) + 0.57 * cos(2.0 * slong) +
                0.10 * cos(2.0 * lunlong) - 0.09 * cos(2.0 * omega);
  *obliq_corr = *obliq_corr / 3600.0;
  last_jd = jd;
  last_slcorr = *slong_corr;
  last_oblcorr = *obliq_corr;
  return;
}


x86 assembly (clang, -O0):
<AstAlg_nutation_corr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
movsd  %xmm0,-0x8(%rbp)
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
ucomisd 0x2edb(%rip),%xmm0
jne    11a1 <AstAlg_nutation_corr+0x51>
jp     11a1 <AstAlg_nutation_corr+0x51>
movsd  0x2ecf(%rip),%xmm0
mov    -0x10(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  0x2ec7(%rip),%xmm0
mov    -0x18(%rbp),%rax
movsd  %xmm0,(%rax)
mov    0x2e40(%rip),%rax
movsd  (%rax),%xmm0
movsd  0xe9c(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x78(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <AstAlg_mean_solar_longitude@plt>
movaps %xmm0,%xmm1
movsd  -0x78(%rbp),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
mov    0x2e09(%rip),%rax
movsd  (%rax),%xmm0
movsd  0xe65(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x70(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1040 <AstAlg_mean_lunar_longitude@plt>
movaps %xmm0,%xmm1
movsd  -0x70(%rbp),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x28(%rbp)
mov    0x2dd2(%rip),%rax
movsd  (%rax),%xmm0
movsd  0xe2e(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x68(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1060 <AstAlg_lunar_ascending_node@plt>
movaps %xmm0,%xmm1
movsd  -0x68(%rbp),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x30(%rbp),%xmm0
call   1050 <sin@plt>
movsd  %xmm0,-0x60(%rbp)
movsd  0xdb3(%rip),%xmm0
mulsd  -0x20(%rbp),%xmm0
call   1050 <sin@plt>
movaps %xmm0,%xmm2
movsd  -0x60(%rbp),%xmm0
movsd  0xdd1(%rip),%xmm1
mulsd  %xmm2,%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
movsd  0xda6(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x58(%rbp)
movsd  0xd61(%rip),%xmm0
mulsd  -0x28(%rbp),%xmm0
call   1050 <sin@plt>
movsd  -0x58(%rbp),%xmm1
movsd  0xd72(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  0xd35(%rip),%xmm0
mulsd  -0x30(%rbp),%xmm0
call   1050 <sin@plt>
movsd  -0x50(%rbp),%xmm1
movsd  0xd3e(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x10(%rbp),%rax
movsd  %xmm0,(%rax)
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
movsd  0xcee(%rip),%xmm1
divsd  %xmm1,%xmm0
mov    -0x10(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  -0x30(%rbp),%xmm0
call   1070 <cos@plt>
movsd  %xmm0,-0x48(%rbp)
movsd  0xcdb(%rip),%xmm0
mulsd  -0x20(%rbp),%xmm0
call   1070 <cos@plt>
movaps %xmm0,%xmm2
movsd  -0x48(%rbp),%xmm0
movsd  0xcd9(%rip),%xmm1
mulsd  %xmm2,%xmm1
movsd  0xcc5(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  0xca0(%rip),%xmm0
mulsd  -0x28(%rbp),%xmm0
call   1070 <cos@plt>
movsd  -0x40(%rbp),%xmm1
movsd  0xc91(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  0xc74(%rip),%xmm0
mulsd  -0x30(%rbp),%xmm0
call   1070 <cos@plt>
movsd  -0x38(%rbp),%xmm1
movsd  0xc55(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x18(%rbp),%rax
movsd  %xmm0,(%rax)
mov    -0x18(%rbp),%rax
movsd  (%rax),%xmm0
movsd  0xc2d(%rip),%xmm1
divsd  %xmm1,%xmm0
mov    -0x18(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,0x2c64(%rip)
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,0x2c5c(%rip)
mov    -0x18(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,0x2c54(%rip)
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<AstAlg_nutation_corr>:
push   %r15
push   %r14
push   %rbx
sub    $0x30,%rsp
mov    %rsi,%r14
mov    %rdi,%r15
movsd  0x2ee9(%rip),%xmm1
ucomisd %xmm0,%xmm1
jne    1189 <AstAlg_nutation_corr+0x39>
jp     1189 <AstAlg_nutation_corr+0x39>
movsd  0x2ee1(%rip),%xmm1
movsd  %xmm1,(%r15)
movsd  0x2edc(%rip),%xmm1
movsd  %xmm1,(%r14)
mov    0x2e58(%rip),%rbx
movsd  (%rbx),%xmm1
divsd  0xe64(%rip),%xmm1
movsd  %xmm1,0x8(%rsp)
movsd  %xmm0,0x18(%rsp)
call   1030 <AstAlg_mean_solar_longitude@plt>
mulsd  0x8(%rsp),%xmm0
movsd  %xmm0,0x8(%rsp)
movsd  (%rbx),%xmm0
divsd  0xe3b(%rip),%xmm0
movsd  %xmm0,0x10(%rsp)
movsd  0x18(%rsp),%xmm0
call   1040 <AstAlg_mean_lunar_longitude@plt>
mulsd  0x10(%rsp),%xmm0
movsd  %xmm0,0x10(%rsp)
movsd  (%rbx),%xmm0
divsd  0xe12(%rip),%xmm0
movsd  %xmm0,(%rsp)
movsd  0x18(%rsp),%xmm0
call   1060 <AstAlg_lunar_ascending_node@plt>
mulsd  (%rsp),%xmm0
movsd  %xmm0,0x20(%rsp)
call   1050 <sin@plt>
movsd  %xmm0,(%rsp)
movsd  0x8(%rsp),%xmm0
addsd  %xmm0,%xmm0
movsd  %xmm0,0x8(%rsp)
call   1050 <sin@plt>
mulsd  0xdd8(%rip),%xmm0
movsd  (%rsp),%xmm1
mulsd  0xdd3(%rip),%xmm1
addsd  %xmm0,%xmm1
movsd  %xmm1,(%rsp)
movsd  0x10(%rsp),%xmm0
addsd  %xmm0,%xmm0
movsd  %xmm0,0x10(%rsp)
call   1050 <sin@plt>
mulsd  0xdb5(%rip),%xmm0
addsd  (%rsp),%xmm0
movsd  %xmm0,(%rsp)
movsd  0x20(%rsp),%xmm0
addsd  %xmm0,%xmm0
movsd  %xmm0,0x28(%rsp)
call   1050 <sin@plt>
mulsd  0xd96(%rip),%xmm0
addsd  (%rsp),%xmm0
divsd  0xd91(%rip),%xmm0
movsd  %xmm0,(%r15)
movsd  0x20(%rsp),%xmm0
call   1070 <cos@plt>
movsd  %xmm0,(%rsp)
movsd  0x8(%rsp),%xmm0
call   1070 <cos@plt>
mulsd  0xd71(%rip),%xmm0
movsd  (%rsp),%xmm1
mulsd  0xd6c(%rip),%xmm1
addsd  %xmm0,%xmm1
movsd  %xmm1,(%rsp)
movsd  0x10(%rsp),%xmm0
call   1070 <cos@plt>
mulsd  0xd58(%rip),%xmm0
addsd  (%rsp),%xmm0
movsd  %xmm0,0x8(%rsp)
movsd  0x28(%rsp),%xmm0
call   1070 <cos@plt>
mulsd  0xd42(%rip),%xmm0
addsd  0x8(%rsp),%xmm0
divsd  0xd14(%rip),%xmm0
movsd  %xmm0,(%r14)
movsd  0x18(%rsp),%xmm1
movsd  %xmm1,0x2d29(%rip)
movsd  (%r15),%xmm1
movsd  %xmm1,0x2d24(%rip)
movsd  %xmm0,0x2d24(%rip)
add    $0x30,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@AstAlg_nutation_corr.last_jd = internal global double 0.000000e+00
@AstAlg_nutation_corr.last_slcorr = internal global double 0.000000e+00
@AstAlg_nutation_corr.last_oblcorr = internal global double 0.000000e+00
@M_PI = global double 0.000000e+00
define void @AstAlg_nutation_corr(double %0, double* %1, double* %2) {
%4 = alloca double
%5 = alloca double*
%6 = alloca double*
%7 = alloca double
%8 = alloca double
%9 = alloca double
store double %0, double* %4
store double* %1, double** %5
store double* %2, double** %6
%10 = load double, double* %4
%11 = load double, double* @AstAlg_nutation_corr.last_jd
%12 = fcmp oeq double %10, %11
br i1 %12, label %13, label %18
13: ; preds = %3
%14 = load double, double* @AstAlg_nutation_corr.last_slcorr
%15 = load double*, double** %5
store double %14, double* %15
%16 = load double, double* @AstAlg_nutation_corr.last_oblcorr
%17 = load double*, double** %6
store double %16, double* %17
br label %18
18: ; preds = %13, %3
%19 = load double, double* @M_PI
%20 = fdiv double %19, 1.800000e+02
%21 = load double, double* %4
%22 = call double @AstAlg_mean_solar_longitude(double %21)
%23 = fmul double %20, %22
store double %23, double* %7
%24 = load double, double* @M_PI
%25 = fdiv double %24, 1.800000e+02
%26 = load double, double* %4
%27 = call double @AstAlg_mean_lunar_longitude(double %26)
%28 = fmul double %25, %27
store double %28, double* %8
%29 = load double, double* @M_PI
%30 = fdiv double %29, 1.800000e+02
%31 = load double, double* %4
%32 = call double @AstAlg_lunar_ascending_node(double %31)
%33 = fmul double %30, %32
store double %33, double* %9
%34 = load double, double* %9
%35 = call double @sin(double %34)
%36 = load double, double* %7
%37 = fmul double 2.000000e+00, %36
%38 = call double @sin(double %37)
%39 = fmul double 1.320000e+00, %38
%40 = fneg double %39
%41 = call double @llvm.fmuladd.f64(double -1.720000e+01, double %35, double %40)
%42 = load double, double* %8
%43 = fmul double 2.000000e+00, %42
%44 = call double @sin(double %43)
%45 = call double @llvm.fmuladd.f64(double -2.300000e-01, double %44, double %41)
%46 = load double, double* %9
%47 = fmul double 2.000000e+00, %46
%48 = call double @sin(double %47)
%49 = call double @llvm.fmuladd.f64(double 2.100000e-01, double %48, double %45)
%50 = load double*, double** %5
store double %49, double* %50
%51 = load double*, double** %5
%52 = load double, double* %51
%53 = fdiv double %52, 3.600000e+03
%54 = load double*, double** %5
store double %53, double* %54
%55 = load double, double* %9
%56 = call double @cos(double %55)
%57 = load double, double* %7
%58 = fmul double 2.000000e+00, %57
%59 = call double @cos(double %58)
%60 = fmul double 5.700000e-01, %59
%61 = call double @llvm.fmuladd.f64(double 0x4022666666666666, double %56, double %60)
%62 = load double, double* %8
%63 = fmul double 2.000000e+00, %62
%64 = call double @cos(double %63)
%65 = call double @llvm.fmuladd.f64(double 1.000000e-01, double %64, double %61)
%66 = load double, double* %9
%67 = fmul double 2.000000e+00, %66
%68 = call double @cos(double %67)
%69 = call double @llvm.fmuladd.f64(double 0xBFB70A3D70A3D70A, double %68, double %65)
%70 = load double*, double** %6
store double %69, double* %70
%71 = load double*, double** %6
%72 = load double, double* %71
%73 = fdiv double %72, 3.600000e+03
%74 = load double*, double** %6
store double %73, double* %74
%75 = load double, double* %4
store double %75, double* @AstAlg_nutation_corr.last_jd
%76 = load double*, double** %5
%77 = load double, double* %76
store double %77, double* @AstAlg_nutation_corr.last_slcorr
%78 = load double*, double** %6
%79 = load double, double* %78
store double %79, double* @AstAlg_nutation_corr.last_oblcorr
ret void
}

LLVM IR (-O2):
@AstAlg_nutation_corr.last_jd = internal unnamed_addr global double 0.000000e+00
@AstAlg_nutation_corr.last_slcorr = internal unnamed_addr global double 0.000000e+00
@AstAlg_nutation_corr.last_oblcorr = internal unnamed_addr global double 0.000000e+00
@M_PI = global double 0.000000e+00
define void @AstAlg_nutation_corr(double %0, double* nocapture %1, double* nocapture %2) {
%4 = load double, double* @AstAlg_nutation_corr.last_jd
%5 = fcmp oeq double %4, %0
br i1 %5, label %6, label %9
6: ; preds = %3
%7 = load double, double* @AstAlg_nutation_corr.last_slcorr
store double %7, double* %1
%8 = load double, double* @AstAlg_nutation_corr.last_oblcorr
store double %8, double* %2
br label %9
9: ; preds = %6, %3
%10 = load double, double* @M_PI
%11 = fdiv double %10, 1.800000e+02
%12 = tail call double @AstAlg_mean_solar_longitude(double %0)
%13 = fmul double %11, %12
%14 = load double, double* @M_PI
%15 = fdiv double %14, 1.800000e+02
%16 = tail call double @AstAlg_mean_lunar_longitude(double %0)
%17 = fmul double %15, %16
%18 = load double, double* @M_PI
%19 = fdiv double %18, 1.800000e+02
%20 = tail call double @AstAlg_lunar_ascending_node(double %0)
%21 = fmul double %19, %20
%22 = tail call double @sin(double %21)
%23 = fmul double %13, 2.000000e+00
%24 = tail call double @sin(double %23)
%25 = fmul double %24, -1.320000e+00
%26 = tail call double @llvm.fmuladd.f64(double %22, double -1.720000e+01, double %25)
%27 = fmul double %17, 2.000000e+00
%28 = tail call double @sin(double %27)
%29 = tail call double @llvm.fmuladd.f64(double %28, double -2.300000e-01, double %26)
%30 = fmul double %21, 2.000000e+00
%31 = tail call double @sin(double %30)
%32 = tail call double @llvm.fmuladd.f64(double %31, double 2.100000e-01, double %29)
%33 = fdiv double %32, 3.600000e+03
store double %33, double* %1
%34 = tail call double @cos(double %21)
%35 = tail call double @cos(double %23)
%36 = fmul double %35, 5.700000e-01
%37 = tail call double @llvm.fmuladd.f64(double %34, double 0x4022666666666666, double %36)
%38 = tail call double @cos(double %27)
%39 = tail call double @llvm.fmuladd.f64(double %38, double 1.000000e-01, double %37)
%40 = tail call double @cos(double %30)
%41 = tail call double @llvm.fmuladd.f64(double %40, double 0xBFB70A3D70A3D70A, double %39)
%42 = fdiv double %41, 3.600000e+03
store double %42, double* %2
store double %0, double* @AstAlg_nutation_corr.last_jd
%43 = load double, double* %1
store double %43, double* @AstAlg_nutation_corr.last_slcorr
store double %42, double* @AstAlg_nutation_corr.last_oblcorr
ret void
}