double gmst(jd)
double jd;
{
  double t, theta0;
  t = ((floor(jd + 0.5) - 0.5) - 2415020.0) / 36525.0;
  theta0 = 6.6460656 + 2400.051262 * t + 0.00002581 * t * t;
  t = (jd + 0.5) - (floor(jd + 0.5));
  theta0 += (t * 24.0) * 1.002737908;
  theta0 = (theta0 - 24.0 * (floor(theta0 / 24.0)));
  return theta0;
}


x86 assembly (clang, -O0):
<gmst>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  0xef3(%rip),%xmm0
addsd  -0x8(%rbp),%xmm0
call   1030 <floor@plt>
movsd  0xee1(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  0xefd(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  0xee9(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm1
movsd  0xec3(%rip),%xmm0
mulsd  %xmm0,%xmm1
movsd  0xebf(%rip),%xmm0
addsd  %xmm0,%xmm1
movsd  0xea3(%rip),%xmm0
mulsd  -0x10(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  0xe7c(%rip),%xmm0
addsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  0xe6a(%rip),%xmm0
addsd  -0x8(%rbp),%xmm0
call   1030 <floor@plt>
movaps %xmm0,%xmm1
movsd  -0x28(%rbp),%xmm0
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  0xe37(%rip),%xmm0
mulsd  -0x10(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
movsd  0xe2d(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  0xe01(%rip),%xmm1
divsd  %xmm1,%xmm0
call   1030 <floor@plt>
movsd  -0x20(%rbp),%xmm1
movsd  0xde3(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gmst>:
push   %rax
addsd  0xee7(%rip),%xmm0
movsd  %xmm0,(%rsp)
call   1030 <floor@plt>
movapd %xmm0,%xmm2
movsd  (%rsp),%xmm3
subsd  %xmm0,%xmm3
addsd  0xed0(%rip),%xmm2
addsd  0xed0(%rip),%xmm2
divsd  0xed0(%rip),%xmm2
movsd  0xed0(%rip),%xmm0
mulsd  %xmm2,%xmm0
addsd  0xecc(%rip),%xmm0
movsd  0xecc(%rip),%xmm1
mulsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm2
addsd  %xmm0,%xmm2
movsd  0xec0(%rip),%xmm1
movapd %xmm3,%xmm0
mulsd  %xmm1,%xmm0
mulsd  0xeb8(%rip),%xmm0
addsd  %xmm0,%xmm2
movsd  %xmm2,(%rsp)
divsd  %xmm1,%xmm2
movapd %xmm2,%xmm0
call   1030 <floor@plt>
mulsd  0xea2(%rip),%xmm0
addsd  (%rsp),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @gmst(double %0) {
%2 = alloca double
%3 = alloca double
%4 = alloca double
store double %0, double* %2
%5 = load double, double* %2
%6 = fadd double %5, 5.000000e-01
%7 = call double @llvm.floor.f64(double %6)
%8 = fsub double %7, 5.000000e-01
%9 = fsub double %8, 2.415020e+06
%10 = fdiv double %9, 3.652500e+04
store double %10, double* %3
%11 = load double, double* %3
%12 = call double @llvm.fmuladd.f64(double 0x40A2C01A3F034B0E, double %11, double 0x401A9592387C4850)
%13 = load double, double* %3
%14 = fmul double 2.581000e-05, %13
%15 = load double, double* %3
%16 = call double @llvm.fmuladd.f64(double %14, double %15, double %12)
store double %16, double* %4
%17 = load double, double* %2
%18 = fadd double %17, 5.000000e-01
%19 = load double, double* %2
%20 = fadd double %19, 5.000000e-01
%21 = call double @llvm.floor.f64(double %20)
%22 = fsub double %18, %21
store double %22, double* %3
%23 = load double, double* %3
%24 = fmul double %23, 2.400000e+01
%25 = load double, double* %4
%26 = call double @llvm.fmuladd.f64(double %24, double 0x3FF00B36E7951C7F, double %25)
store double %26, double* %4
%27 = load double, double* %4
%28 = load double, double* %4
%29 = fdiv double %28, 2.400000e+01
%30 = call double @llvm.floor.f64(double %29)
%31 = call double @llvm.fmuladd.f64(double -2.400000e+01, double %30, double %27)
store double %31, double* %4
%32 = load double, double* %4
ret double %32
}

LLVM IR (-O2):
define double @gmst(double %0) {
%2 = fadd double %0, 5.000000e-01
%3 = tail call double @llvm.floor.f64(double %2)
%4 = fadd double %3, -5.000000e-01
%5 = fadd double %4, -2.415020e+06
%6 = fdiv double %5, 3.652500e+04
%7 = tail call double @llvm.fmuladd.f64(double %6, double 0x40A2C01A3F034B0E, double 0x401A9592387C4850)
%8 = fmul double %6, 2.581000e-05
%9 = tail call double @llvm.fmuladd.f64(double %8, double %6, double %7)
%10 = fsub double %2, %3
%11 = fmul double %10, 2.400000e+01
%12 = tail call double @llvm.fmuladd.f64(double %11, double 0x3FF00B36E7951C7F, double %9)
%13 = fdiv double %12, 2.400000e+01
%14 = tail call double @llvm.floor.f64(double %13)
%15 = tail call double @llvm.fmuladd.f64(double %14, double -2.400000e+01, double %12)
ret double %15
}