#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 */
int /*<<< orphan*/ range(double *, double);
double gmst0(double mj) {
  double T, x;
  T = ((int)(mj - 0.5) + 0.5 - (2451545.0 - 2415020.0)) / 36525.0;
  x = 24110.54841 + (8640184.812866 + (0.093104 - 6.2e-6 * T) * T) * T;
  x /= 3600.0;
  range(&x, 24.0);
  return (x);
}


x86 assembly (clang, -O0):
<gmst0>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xf0e(%rip),%xmm1
subsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
cvtsi2sd %eax,%xmm0
movsd  0xefa(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  0xee6(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  0xeda(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  0xeb4(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xeb0(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  -0x10(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xe8b(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  -0x10(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xe6e(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  0xe50(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
lea    -0x18(%rbp),%rdi
movsd  0xe33(%rip),%xmm0
call   1030 <range@plt>
movsd  -0x18(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gmst0>:
push   %rax
addsd  0xee7(%rip),%xmm0
cvttpd2dq %xmm0,%xmm0
cvtdq2pd %xmm0,%xmm0
addsd  0xedf(%rip),%xmm0
addsd  0xedf(%rip),%xmm0
divsd  0xedf(%rip),%xmm0
movsd  0xedf(%rip),%xmm1
mulsd  %xmm0,%xmm1
addsd  0xedb(%rip),%xmm1
mulsd  %xmm0,%xmm1
addsd  0xed7(%rip),%xmm1
mulsd  %xmm0,%xmm1
addsd  0xed3(%rip),%xmm1
divsd  0xed3(%rip),%xmm1
movsd  %xmm1,(%rsp)
mov    %rsp,%rdi
movsd  0xecb(%rip),%xmm0
call   1030 <range@plt>
movsd  (%rsp),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @gmst0(double %0) {
%2 = alloca double
%3 = alloca double
%4 = alloca double
store double %0, double* %2
%5 = load double, double* %2
%6 = fsub double %5, 5.000000e-01
%7 = fptosi double %6 to i32
%8 = sitofp i32 %7 to double
%9 = fadd double %8, 5.000000e-01
%10 = fsub double %9, 3.652500e+04
%11 = fdiv double %10, 3.652500e+04
store double %11, double* %3
%12 = load double, double* %3
%13 = call double @llvm.fmuladd.f64(double -6.200000e-06, double %12, double 9.310400e-02)
%14 = load double, double* %3
%15 = call double @llvm.fmuladd.f64(double %13, double %14, double 0x41607AD71A02FF8F)
%16 = load double, double* %3
%17 = call double @llvm.fmuladd.f64(double %15, double %16, double 0x40D78BA3192641B3)
store double %17, double* %4
%18 = load double, double* %4
%19 = fdiv double %18, 3.600000e+03
store double %19, double* %4
%20 = call i32 @range(double* %4, double 2.400000e+01)
%21 = load double, double* %4
ret double %21
}

LLVM IR (-O2):
define double @gmst0(double %0) {
%2 = alloca double
%3 = bitcast double* %2 to i8*
%4 = fadd double %0, -5.000000e-01
%5 = fptosi double %4 to i32
%6 = sitofp i32 %5 to double
%7 = fadd double %6, 5.000000e-01
%8 = fadd double %7, -3.652500e+04
%9 = fdiv double %8, 3.652500e+04
%10 = tail call double @llvm.fmuladd.f64(double %9, double -6.200000e-06, double 9.310400e-02)
%11 = tail call double @llvm.fmuladd.f64(double %10, double %9, double 0x41607AD71A02FF8F)
%12 = tail call double @llvm.fmuladd.f64(double %11, double %9, double 0x40D78BA3192641B3)
%13 = fdiv double %12, 3.600000e+03
store double %13, double* %2
%14 = call i32 @range(double* %2, double 2.400000e+01)
%15 = load double, double* %2
ret double %15
}