#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 Frac(double);
double Modulus(double, double);
double ThetaG_JD(double jd) {
  double UT, TU, GMST;
  UT = Frac(jd + 0.5);
  jd = jd - UT;
  TU = (jd - 2451545.0) / 36525;
  GMST = 24110.54841 + TU * (8640184.812866 + TU * (0.093104 - TU * 6.2E-6));
  GMST = Modulus(GMST + 8.6400E4 * 1.00273790934 * UT, 8.6400E4);
  return (6.28318530717958623 * GMST / 8.6400E4);
}


x86 assembly (clang, -O0):
<ThetaG_JD>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  0xf13(%rip),%xmm0
addsd  -0x8(%rbp),%xmm0
call   1030 <Frac@plt>
movsd  %xmm0,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
subsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xee0(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  0xecc(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm2
movq   %xmm2,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm2
movsd  0xe85(%rip),%xmm3
mulsd  %xmm3,%xmm2
movsd  0xe81(%rip),%xmm3
addsd  %xmm3,%xmm2
mulsd  %xmm2,%xmm1
movsd  0xe61(%rip),%xmm2
addsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
movsd  0xe49(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm1
movsd  -0x10(%rbp),%xmm0
movsd  0xe26(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  0xe06(%rip),%xmm1
call   1040 <Modulus@plt>
movsd  %xmm0,-0x20(%rbp)
movsd  0xdfc(%rip),%xmm0
mulsd  -0x20(%rbp),%xmm0
movsd  0xde7(%rip),%xmm1
divsd  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ThetaG_JD>:
push   %rax
movapd %xmm0,%xmm1
movsd  %xmm0,(%rsp)
movsd  0xece(%rip),%xmm0
addsd  %xmm1,%xmm0
call   1030 <Frac@plt>
movsd  (%rsp),%xmm2
subsd  %xmm0,%xmm2
addsd  0xebc(%rip),%xmm2
divsd  0xebc(%rip),%xmm2
movsd  0xebc(%rip),%xmm1
mulsd  %xmm2,%xmm1
addsd  0xeb8(%rip),%xmm1
mulsd  %xmm2,%xmm1
addsd  0xeb4(%rip),%xmm1
mulsd  %xmm2,%xmm1
addsd  0xeb0(%rip),%xmm1
mulsd  0xeb0(%rip),%xmm0
addsd  %xmm1,%xmm0
movsd  0xeac(%rip),%xmm1
call   1040 <Modulus@plt>
mulsd  0xea7(%rip),%xmm0
divsd  0xe97(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @ThetaG_JD(double %0) {
%2 = alloca double
%3 = alloca double
%4 = alloca double
%5 = alloca double
store double %0, double* %2
%6 = load double, double* %2
%7 = fadd double %6, 5.000000e-01
%8 = call double @Frac(double %7)
store double %8, double* %3
%9 = load double, double* %2
%10 = load double, double* %3
%11 = fsub double %9, %10
store double %11, double* %2
%12 = load double, double* %2
%13 = fsub double %12, 0x4142B42C80000000
%14 = fdiv double %13, 3.652500e+04
store double %14, double* %4
%15 = load double, double* %4
%16 = load double, double* %4
%17 = load double, double* %4
%18 = fneg double %17
%19 = call double @llvm.fmuladd.f64(double %18, double 6.200000e-06, double 9.310400e-02)
%20 = call double @llvm.fmuladd.f64(double %16, double %19, double 0x41607AD71A02FF8F)
%21 = call double @llvm.fmuladd.f64(double %15, double %20, double 0x40D78BA3192641B3)
store double %21, double* %5
%22 = load double, double* %5
%23 = load double, double* %3
%24 = call double @llvm.fmuladd.f64(double 0x40F526C8E2C87B73, double %23, double %22)
%25 = call double @Modulus(double %24, double 8.640000e+04)
store double %25, double* %5
%26 = load double, double* %5
%27 = fmul double 0x401921FB54442D18, %26
%28 = fdiv double %27, 8.640000e+04
ret double %28
}

LLVM IR (-O2):
define double @ThetaG_JD(double %0) {
%2 = fadd double %0, 5.000000e-01
%3 = tail call double @Frac(double %2)
%4 = fsub double %0, %3
%5 = fadd double %4, 0xC142B42C80000000
%6 = fdiv double %5, 3.652500e+04
%7 = fneg double %6
%8 = tail call double @llvm.fmuladd.f64(double %7, double 6.200000e-06, double 9.310400e-02)
%9 = tail call double @llvm.fmuladd.f64(double %6, double %8, double 0x41607AD71A02FF8F)
%10 = tail call double @llvm.fmuladd.f64(double %6, double %9, double 0x40D78BA3192641B3)
%11 = tail call double @llvm.fmuladd.f64(double %3, double 0x40F526C8E2C87B73, double %10)
%12 = tail call double @Modulus(double %11, double 8.640000e+04)
%13 = fmul double %12, 0x401921FB54442D18
%14 = fdiv double %13, 8.640000e+04
ret double %14
}