#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 cos(double);
int /*<<< orphan*/ precess(double, double, double *, double *);
double sin(double);
double tan(double);
void heliocorr(double jd, double ra, double dec, double *hcp) {
  double e;
  double n;
  double g;
  double L;
  double l;
  double R;
  double X, Y;
  double cdec, sdec;
  double cra, sra;
  precess((2451545.0 - 2415020.0), jd - 2415020.0, &ra, &dec);
  cdec = cos(dec);
  sdec = sin(dec);
  cra = cos(ra);
  sra = sin(ra);
  n = jd - 2451545.0;
  e = ((23.439 - 0.0000004 * n) * 3.141592653589793 / 180.);
  g = ((357.528) * 3.141592653589793 / 180.) +
      ((0.9856003) * 3.141592653589793 / 180.) * n;
  L = ((280.461) * 3.141592653589793 / 180.) +
      ((0.9856474) * 3.141592653589793 / 180.) * n;
  l = L + ((1.915) * 3.141592653589793 / 180.) * sin(g) +
      ((0.02) * 3.141592653589793 / 180.) * sin(2.0 * g);
  R = 1.00014 - 0.01671 * cos(g) - 0.00014 * cos(2.0 * g);
  X = R * cos(l);
  Y = R * cos(e) * sin(l);
  *hcp = 0.0057755 * (cdec * cra * X + (cdec * sra + tan(e) * sdec) * Y);
}


x86 assembly (clang, -O0):
<heliocorr>:
push   %rbp
mov    %rsp,%rbp
sub    $0xd0,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
mov    %rdi,-0x20(%rbp)
movsd  -0x8(%rbp),%xmm1
movsd  0xf1d(%rip),%xmm0
subsd  %xmm0,%xmm1
movsd  0xf09(%rip),%xmm0
lea    -0x10(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1040 <precess@plt>
movsd  -0x18(%rbp),%xmm0
call   1060 <cos@plt>
movsd  %xmm0,-0x68(%rbp)
movsd  -0x18(%rbp),%xmm0
call   1030 <sin@plt>
movsd  %xmm0,-0x70(%rbp)
movsd  -0x10(%rbp),%xmm0
call   1060 <cos@plt>
movsd  %xmm0,-0x78(%rbp)
movsd  -0x10(%rbp),%xmm0
call   1030 <sin@plt>
movsd  %xmm0,-0x80(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xeab(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x30(%rbp),%xmm0
movsd  0xe85(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xe81(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  0xe65(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xe51(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x30(%rbp),%xmm0
movsd  0xe2b(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xe27(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  -0x30(%rbp),%xmm0
movsd  0xdf9(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xdf5(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x40(%rbp),%xmm0
movsd  %xmm0,-0xd0(%rbp)
ff
movsd  -0x38(%rbp),%xmm0
call   1030 <sin@plt>
movsd  -0xd0(%rbp),%xmm1
ff
movsd  0xdb5(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0xc8(%rbp)
ff
movsd  0xd7d(%rip),%xmm0
mulsd  -0x38(%rbp),%xmm0
call   1030 <sin@plt>
movsd  -0xc8(%rbp),%xmm1
ff
movsd  0xd7b(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  -0x38(%rbp),%xmm0
call   1060 <cos@plt>
movsd  0xd4c(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xd48(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0xc0(%rbp)
ff
movsd  0xd24(%rip),%xmm0
mulsd  -0x38(%rbp),%xmm0
call   1060 <cos@plt>
movsd  -0xc0(%rbp),%xmm1
ff
movsd  0xd02(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  -0x50(%rbp),%xmm0
movsd  %xmm0,-0xb8(%rbp)
ff
movsd  -0x48(%rbp),%xmm0
call   1060 <cos@plt>
movaps %xmm0,%xmm1
movsd  -0xb8(%rbp),%xmm0
ff
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x58(%rbp)
movsd  -0x50(%rbp),%xmm0
movsd  %xmm0,-0xb0(%rbp)
ff
movsd  -0x28(%rbp),%xmm0
call   1060 <cos@plt>
movaps %xmm0,%xmm1
movsd  -0xb0(%rbp),%xmm0
ff
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0xa8(%rbp)
ff
movsd  -0x48(%rbp),%xmm0
call   1030 <sin@plt>
movaps %xmm0,%xmm1
movsd  -0xa8(%rbp),%xmm0
ff
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x60(%rbp)
movsd  -0x68(%rbp),%xmm0
mulsd  -0x78(%rbp),%xmm0
movsd  %xmm0,-0x98(%rbp)
ff
movsd  -0x58(%rbp),%xmm0
movsd  %xmm0,-0x90(%rbp)
ff
movsd  -0x68(%rbp),%xmm0
movsd  %xmm0,-0x88(%rbp)
ff
movsd  -0x80(%rbp),%xmm0
movsd  %xmm0,-0xa0(%rbp)
ff
movsd  -0x28(%rbp),%xmm0
call   1050 <tan@plt>
movsd  -0xa0(%rbp),%xmm4
ff
movsd  -0x98(%rbp),%xmm1
ff
movsd  -0x90(%rbp),%xmm2
ff
movaps %xmm0,%xmm3
movsd  -0x88(%rbp),%xmm0
ff
mulsd  -0x70(%rbp),%xmm3
mulsd  %xmm4,%xmm0
addsd  %xmm3,%xmm0
mulsd  -0x60(%rbp),%xmm0
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  0xbee(%rip),%xmm0
mulsd  %xmm1,%xmm0
mov    -0x20(%rbp),%rax
movsd  %xmm0,(%rax)
add    $0xd0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<heliocorr>:
push   %rbx
sub    $0x50,%rsp
mov    %rdi,%rbx
movsd  %xmm0,(%rsp)
movsd  %xmm1,0x28(%rsp)
movsd  %xmm2,0x20(%rsp)
movsd  0xe9f(%rip),%xmm1
addsd  %xmm0,%xmm1
movsd  0xe9b(%rip),%xmm0
lea    0x28(%rsp),%rdi
lea    0x20(%rsp),%rsi
call   1040 <precess@plt>
movsd  0x20(%rsp),%xmm0
call   1060 <cos@plt>
movsd  %xmm0,0x38(%rsp)
movsd  0x20(%rsp),%xmm0
call   1030 <sin@plt>
movsd  %xmm0,0x48(%rsp)
movsd  0x28(%rsp),%xmm0
call   1060 <cos@plt>
movsd  %xmm0,0x18(%rsp)
movsd  0x28(%rsp),%xmm0
call   1030 <sin@plt>
movsd  %xmm0,0x40(%rsp)
movsd  (%rsp),%xmm1
addsd  0xe43(%rip),%xmm1
movsd  0xe43(%rip),%xmm0
mulsd  %xmm1,%xmm0
addsd  0xe3f(%rip),%xmm0
mulsd  0xe3f(%rip),%xmm0
divsd  0xe3f(%rip),%xmm0
movsd  %xmm0,0x30(%rsp)
movsd  0xe39(%rip),%xmm0
mulsd  %xmm1,%xmm0
addsd  0xe35(%rip),%xmm0
movsd  %xmm0,0x8(%rsp)
mulsd  0xe2f(%rip),%xmm1
addsd  0xe2f(%rip),%xmm1
movsd  %xmm1,(%rsp)
call   1030 <sin@plt>
mulsd  0xe25(%rip),%xmm0
addsd  (%rsp),%xmm0
movsd  %xmm0,(%rsp)
movsd  0x8(%rsp),%xmm0
addsd  %xmm0,%xmm0
movsd  %xmm0,0x10(%rsp)
call   1030 <sin@plt>
mulsd  0xe06(%rip),%xmm0
addsd  (%rsp),%xmm0
movsd  %xmm0,(%rsp)
movsd  0x8(%rsp),%xmm0
call   1060 <cos@plt>
mulsd  0xdf1(%rip),%xmm0
addsd  0xdf1(%rip),%xmm0
movsd  %xmm0,0x8(%rsp)
movsd  0x10(%rsp),%xmm0
call   1060 <cos@plt>
mulsd  0xde0(%rip),%xmm0
addsd  0x8(%rsp),%xmm0
movsd  %xmm0,0x8(%rsp)
movsd  (%rsp),%xmm0
call   1060 <cos@plt>
mulsd  0x8(%rsp),%xmm0
movsd  %xmm0,0x10(%rsp)
movsd  0x30(%rsp),%xmm0
call   1060 <cos@plt>
mulsd  0x8(%rsp),%xmm0
movsd  %xmm0,0x8(%rsp)
movsd  (%rsp),%xmm0
call   1030 <sin@plt>
mulsd  0x8(%rsp),%xmm0
movsd  %xmm0,(%rsp)
movsd  0x18(%rsp),%xmm0
mulsd  0x38(%rsp),%xmm0
mulsd  0x10(%rsp),%xmm0
movsd  %xmm0,0x18(%rsp)
movsd  0x30(%rsp),%xmm0
call   1050 <tan@plt>
mulsd  0x48(%rsp),%xmm0
movsd  0x40(%rsp),%xmm1
mulsd  0x38(%rsp),%xmm1
addsd  %xmm0,%xmm1
mulsd  (%rsp),%xmm1
addsd  0x18(%rsp),%xmm1
mulsd  0xd4e(%rip),%xmm1
movsd  %xmm1,(%rbx)
add    $0x50,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define void @heliocorr(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
%13 = alloca double
%14 = alloca double
%15 = alloca double
%16 = alloca double
%17 = alloca double
%18 = alloca double
%19 = alloca double
%20 = alloca double
store double %0, double* %5
store double %1, double* %6
store double %2, double* %7
store double* %3, double** %8
%21 = load double, double* %5
%22 = fsub double %21, 2.415020e+06
%23 = call i32 @precess(double 3.652500e+04, double %22, double* %6, double* %7)
%24 = load double, double* %7
%25 = call double @cos(double %24)
store double %25, double* %17
%26 = load double, double* %7
%27 = call double @sin(double %26)
store double %27, double* %18
%28 = load double, double* %6
%29 = call double @cos(double %28)
store double %29, double* %19
%30 = load double, double* %6
%31 = call double @sin(double %30)
store double %31, double* %20
%32 = load double, double* %5
%33 = fsub double %32, 0x4142B42C80000000
store double %33, double* %10
%34 = load double, double* %10
%35 = call double @llvm.fmuladd.f64(double -4.000000e-07, double %34, double 2.343900e+01)
%36 = fmul double %35, 0x400921FB54442D18
%37 = fdiv double %36, 1.800000e+02
store double %37, double* %9
%38 = load double, double* %10
%39 = call double @llvm.fmuladd.f64(double 0x3F919D64B035FA36, double %38, double 0x4018F5CD3F424640)
store double %39, double* %11
%40 = load double, double* %10
%41 = call double @llvm.fmuladd.f64(double 0x3F919D9BDAEC741A, double %40, double 0x40139472754D8290)
store double %41, double* %12
%42 = load double, double* %12
%43 = load double, double* %11
%44 = call double @sin(double %43)
%45 = call double @llvm.fmuladd.f64(double 0x3FA11CD3A1D2F16B, double %44, double %42)
%46 = load double, double* %11
%47 = fmul double 2.000000e+00, %46
%48 = call double @sin(double %47)
%49 = call double @llvm.fmuladd.f64(double 0x3F36E05A695F8191, double %48, double %45)
store double %49, double* %13
%50 = load double, double* %11
%51 = call double @cos(double %50)
%52 = call double @llvm.fmuladd.f64(double -1.671000e-02, double %51, double 1.000140e+00)
%53 = load double, double* %11
%54 = fmul double 2.000000e+00, %53
%55 = call double @cos(double %54)
%56 = call double @llvm.fmuladd.f64(double -1.400000e-04, double %55, double %52)
store double %56, double* %14
%57 = load double, double* %14
%58 = load double, double* %13
%59 = call double @cos(double %58)
%60 = fmul double %57, %59
store double %60, double* %15
%61 = load double, double* %14
%62 = load double, double* %9
%63 = call double @cos(double %62)
%64 = fmul double %61, %63
%65 = load double, double* %13
%66 = call double @sin(double %65)
%67 = fmul double %64, %66
store double %67, double* %16
%68 = load double, double* %17
%69 = load double, double* %19
%70 = fmul double %68, %69
%71 = load double, double* %15
%72 = load double, double* %17
%73 = load double, double* %20
%74 = load double, double* %9
%75 = call double @tan(double %74)
%76 = load double, double* %18
%77 = fmul double %75, %76
%78 = call double @llvm.fmuladd.f64(double %72, double %73, double %77)
%79 = load double, double* %16
%80 = fmul double %78, %79
%81 = call double @llvm.fmuladd.f64(double %70, double %71, double %80)
%82 = fmul double 5.775500e-03, %81
%83 = load double*, double** %8
store double %82, double* %83
ret void
}

LLVM IR (-O2):
define void @heliocorr(double %0, double %1, double %2, double* nocapture writeonly %3) {
%5 = alloca double
%6 = alloca double
store double %1, double* %5
store double %2, double* %6
%7 = fadd double %0, -2.415020e+06
%8 = call i32 @precess(double 3.652500e+04, double %7, double* %5, double* %6)
%9 = load double, double* %6
%10 = call double @cos(double %9)
%11 = load double, double* %6
%12 = call double @sin(double %11)
%13 = load double, double* %5
%14 = call double @cos(double %13)
%15 = load double, double* %5
%16 = call double @sin(double %15)
%17 = fadd double %0, 0xC142B42C80000000
%18 = call double @llvm.fmuladd.f64(double %17, double -4.000000e-07, double 2.343900e+01)
%19 = fmul double %18, 0x400921FB54442D18
%20 = fdiv double %19, 1.800000e+02
%21 = call double @llvm.fmuladd.f64(double %17, double 0x3F919D64B035FA36, double 0x4018F5CD3F424640)
%22 = call double @llvm.fmuladd.f64(double %17, double 0x3F919D9BDAEC741A, double 0x40139472754D8290)
%23 = call double @sin(double %21)
%24 = call double @llvm.fmuladd.f64(double %23, double 0x3FA11CD3A1D2F16B, double %22)
%25 = fmul double %21, 2.000000e+00
%26 = call double @sin(double %25)
%27 = call double @llvm.fmuladd.f64(double %26, double 0x3F36E05A695F8191, double %24)
%28 = call double @cos(double %21)
%29 = call double @llvm.fmuladd.f64(double %28, double -1.671000e-02, double 1.000140e+00)
%30 = call double @cos(double %25)
%31 = call double @llvm.fmuladd.f64(double %30, double -1.400000e-04, double %29)
%32 = call double @cos(double %27)
%33 = fmul double %31, %32
%34 = call double @cos(double %20)
%35 = fmul double %31, %34
%36 = call double @sin(double %27)
%37 = fmul double %35, %36
%38 = fmul double %10, %14
%39 = call double @tan(double %20)
%40 = fmul double %12, %39
%41 = call double @llvm.fmuladd.f64(double %10, double %16, double %40)
%42 = fmul double %37, %41
%43 = call double @llvm.fmuladd.f64(double %38, double %33, double %42)
%44 = fmul double %43, 5.775500e-03
store double %44, double* %3
ret void
}