#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 fmod(double, int);
double calc_gmst(double jtime) {
  double a;
  double jdelta;
  double gmst;
  jdelta = (jtime - 2451545.) / 36525.;
  a = (24110.54841 + 43200. +
       jdelta * (8640184.812866 + jdelta * (0.093104 + jdelta * (-.0000062)))) /
      (60. * 60. * 24.);
  gmst = fmod(jtime, 1.) + fmod(a, 1.);
  if (gmst > 1.)
    gmst -= 1.;
  return gmst;
}


x86 assembly (clang, -O0):
<calc_gmst>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xf0e(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  0xefa(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm2
movsd  0xeca(%rip),%xmm3
mulsd  %xmm3,%xmm2
movsd  0xec6(%rip),%xmm3
addsd  %xmm3,%xmm2
mulsd  %xmm2,%xmm1
movsd  0xea6(%rip),%xmm2
addsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
movsd  0xe8e(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  0xe7a(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
mov    $0x1,%edi
call   1030 <fmod@plt>
movsd  %xmm0,-0x28(%rbp)
movsd  -0x10(%rbp),%xmm0
mov    $0x1,%edi
call   1030 <fmod@plt>
movaps %xmm0,%xmm1
movsd  -0x28(%rbp),%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
movsd  0xe28(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    11f8 <calc_gmst+0xe8>
movsd  -0x20(%rbp),%xmm0
movsd  0xe11(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<calc_gmst>:
sub    $0x18,%rsp
movsd  0xee4(%rip),%xmm1
addsd  %xmm0,%xmm1
divsd  0xee0(%rip),%xmm1
movsd  0xee0(%rip),%xmm2
mulsd  %xmm1,%xmm2
addsd  0xedc(%rip),%xmm2
mulsd  %xmm1,%xmm2
addsd  0xed8(%rip),%xmm2
mulsd  %xmm1,%xmm2
addsd  0xed4(%rip),%xmm2
divsd  0xed4(%rip),%xmm2
movsd  %xmm2,0x10(%rsp)
mov    $0x1,%edi
call   1030 <fmod@plt>
movsd  %xmm0,0x8(%rsp)
movsd  0x10(%rsp),%xmm0
mov    $0x1,%edi
call   1030 <fmod@plt>
addsd  0x8(%rsp),%xmm0
movsd  0xea8(%rip),%xmm2
addsd  %xmm0,%xmm2
movsd  0xea4(%rip),%xmm1
cmpltsd %xmm0,%xmm1
andpd  %xmm1,%xmm2
andnpd %xmm0,%xmm1
orpd   %xmm2,%xmm1
movapd %xmm1,%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define double @calc_gmst(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 = fsub double %6, 0x4142B42C80000000
%8 = fdiv double %7, 3.652500e+04
store double %8, double* %4
%9 = load double, double* %4
%10 = load double, double* %4
%11 = load double, double* %4
%12 = call double @llvm.fmuladd.f64(double %11, double -6.200000e-06, double 9.310400e-02)
%13 = call double @llvm.fmuladd.f64(double %10, double %12, double 0x41607AD71A02FF8F)
%14 = call double @llvm.fmuladd.f64(double %9, double %13, double 0x40F06EE8C649906D)
%15 = fdiv double %14, 8.640000e+04
store double %15, double* %3
%16 = load double, double* %2
%17 = call double @fmod(double %16, i32 1)
%18 = load double, double* %3
%19 = call double @fmod(double %18, i32 1)
%20 = fadd double %17, %19
store double %20, double* %5
%21 = load double, double* %5
%22 = fcmp ogt double %21, 1.000000e+00
br i1 %22, label %23, label %26
23: ; preds = %1
%24 = load double, double* %5
%25 = fsub double %24, 1.000000e+00
store double %25, double* %5
br label %26
26: ; preds = %23, %1
%27 = load double, double* %5
ret double %27
}

LLVM IR (-O2):
define double @calc_gmst(double %0) {
%2 = fadd double %0, 0xC142B42C80000000
%3 = fdiv double %2, 3.652500e+04
%4 = tail call double @llvm.fmuladd.f64(double %3, double -6.200000e-06, double 9.310400e-02)
%5 = tail call double @llvm.fmuladd.f64(double %3, double %4, double 0x41607AD71A02FF8F)
%6 = tail call double @llvm.fmuladd.f64(double %3, double %5, double 0x40F06EE8C649906D)
%7 = fdiv double %6, 8.640000e+04
%8 = tail call double @fmod(double %0, i32 1)
%9 = tail call double @fmod(double %7, i32 1)
%10 = fadd double %8, %9
%11 = fcmp ogt double %10, 1.000000e+00
%12 = fadd double %10, -1.000000e+00
%13 = select i1 %11, double %12, double %10
ret double %13
}