#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*/ ctime2jd(double, double *);
int /*<<< orphan*/ ctime2jdtt(double, double *);
double eraGmst00(double, double, double, double);
int /*<<< orphan*/ jdutc2jdut1(double *, double, double *);
double ctime2gmst(double ctime, double dut1, int accuracy) {
  double jd_utc[2], jd_ut1[2], jd_tt[2];
  ctime2jd(ctime, jd_utc);
  if (!accuracy) {
    jdutc2jdut1(jd_utc, dut1, jd_ut1);
    ctime2jdtt(ctime, jd_tt);
    return eraGmst00(jd_ut1[0], jd_ut1[1], jd_tt[0], jd_tt[1]);
  } else {
    return eraGmst00(jd_utc[0], jd_utc[1], jd_utc[0], jd_utc[1]);
  }
}


x86 assembly (clang, -O0):
<ctime2gmst>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
mov    %edi,-0x1c(%rbp)
movsd  -0x10(%rbp),%xmm0
lea    -0x30(%rbp),%rdi
call   1040 <ctime2jd@plt>
cmpl   $0x0,-0x1c(%rbp)
jne    11b0 <ctime2gmst+0x70>
lea    -0x30(%rbp),%rdi
movsd  -0x18(%rbp),%xmm0
lea    -0x40(%rbp),%rsi
call   1060 <jdutc2jdut1@plt>
movsd  -0x10(%rbp),%xmm0
lea    -0x50(%rbp),%rdi
call   1030 <ctime2jdtt@plt>
movsd  -0x40(%rbp),%xmm0
movsd  -0x38(%rbp),%xmm1
movsd  -0x50(%rbp),%xmm2
movsd  -0x48(%rbp),%xmm3
call   1050 <eraGmst00@plt>
movsd  %xmm0,-0x8(%rbp)
jmp    11ce <ctime2gmst+0x8e>
movsd  -0x30(%rbp),%xmm0
movsd  -0x28(%rbp),%xmm1
movsd  -0x30(%rbp),%xmm2
movsd  -0x28(%rbp),%xmm3
call   1050 <eraGmst00@plt>
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ctime2gmst>:
push   %rbx
sub    $0x40,%rsp
mov    %edi,%ebx
movsd  %xmm1,0x10(%rsp)
mov    %rsp,%rdi
movsd  %xmm0,0x18(%rsp)
call   1040 <ctime2jd@plt>
test   %ebx,%ebx
je     1172 <ctime2gmst+0x32>
movsd  (%rsp),%xmm0
movsd  0x8(%rsp),%xmm1
movaps %xmm0,%xmm2
movaps %xmm1,%xmm3
jmp    11ad <ctime2gmst+0x6d>
mov    %rsp,%rdi
lea    0x30(%rsp),%rsi
movsd  0x10(%rsp),%xmm0
call   1060 <jdutc2jdut1@plt>
lea    0x20(%rsp),%rdi
movsd  0x18(%rsp),%xmm0
call   1030 <ctime2jdtt@plt>
movsd  0x30(%rsp),%xmm0
movsd  0x38(%rsp),%xmm1
movsd  0x20(%rsp),%xmm2
movsd  0x28(%rsp),%xmm3
call   1050 <eraGmst00@plt>
add    $0x40,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define double @ctime2gmst(double %0, double %1, i32 %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
%7 = alloca i32
%8 = alloca [2 x double]
%9 = alloca [2 x double]
%10 = alloca [2 x double]
store double %0, double* %5
store double %1, double* %6
store i32 %2, i32* %7
%11 = load double, double* %5
%12 = getelementptr inbounds [2 x double], [2 x double]* %8, i64 0, i64 0
%13 = call i32 @ctime2jd(double %11, double* %12)
%14 = load i32, i32* %7
%15 = icmp ne i32 %14, 0
br i1 %15, label %33, label %16
16: ; preds = %3
%17 = getelementptr inbounds [2 x double], [2 x double]* %8, i64 0, i64 0
%18 = load double, double* %6
%19 = getelementptr inbounds [2 x double], [2 x double]* %9, i64 0, i64 0
%20 = call i32 @jdutc2jdut1(double* %17, double %18, double* %19)
%21 = load double, double* %5
%22 = getelementptr inbounds [2 x double], [2 x double]* %10, i64 0, i64 0
%23 = call i32 @ctime2jdtt(double %21, double* %22)
%24 = getelementptr inbounds [2 x double], [2 x double]* %9, i64 0, i64 0
%25 = load double, double* %24
%26 = getelementptr inbounds [2 x double], [2 x double]* %9, i64 0, i64 1
%27 = load double, double* %26
%28 = getelementptr inbounds [2 x double], [2 x double]* %10, i64 0, i64 0
%29 = load double, double* %28
%30 = getelementptr inbounds [2 x double], [2 x double]* %10, i64 0, i64 1
%31 = load double, double* %30
%32 = call double @eraGmst00(double %25, double %27, double %29, double %31)
store double %32, double* %4
br label %43
33: ; preds = %3
%34 = getelementptr inbounds [2 x double], [2 x double]* %8, i64 0, i64 0
%35 = load double, double* %34
%36 = getelementptr inbounds [2 x double], [2 x double]* %8, i64 0, i64 1
%37 = load double, double* %36
%38 = getelementptr inbounds [2 x double], [2 x double]* %8, i64 0, i64 0
%39 = load double, double* %38
%40 = getelementptr inbounds [2 x double], [2 x double]* %8, i64 0, i64 1
%41 = load double, double* %40
%42 = call double @eraGmst00(double %35, double %37, double %39, double %41)
store double %42, double* %4
br label %43
43: ; preds = %33, %16
%44 = load double, double* %4
ret double %44
}

LLVM IR (-O2):
define double @ctime2gmst(double %0, double %1, i32 %2) {
%4 = alloca [2 x double]
%5 = alloca [2 x double]
%6 = alloca [2 x double]
%7 = bitcast [2 x double]* %4 to i8*
%8 = bitcast [2 x double]* %5 to i8*
%9 = bitcast [2 x double]* %6 to i8*
%10 = getelementptr inbounds [2 x double], [2 x double]* %4, i64 0, i64 0
%11 = call i32 @ctime2jd(double %0, double* %10)
%12 = icmp eq i32 %2, 0
br i1 %12, label %13, label %25
13: ; preds = %3
%14 = getelementptr inbounds [2 x double], [2 x double]* %5, i64 0, i64 0
%15 = call i32 @jdutc2jdut1(double* %10, double %1, double* %14)
%16 = getelementptr inbounds [2 x double], [2 x double]* %6, i64 0, i64 0
%17 = call i32 @ctime2jdtt(double %0, double* %16)
%18 = load double, double* %14
%19 = getelementptr inbounds [2 x double], [2 x double]* %5, i64 0, i64 1
%20 = load double, double* %19
%21 = load double, double* %16
%22 = getelementptr inbounds [2 x double], [2 x double]* %6, i64 0, i64 1
%23 = load double, double* %22
%24 = call double @eraGmst00(double %18, double %20, double %21, double %23)
br label %30
25: ; preds = %3
%26 = load double, double* %10
%27 = getelementptr inbounds [2 x double], [2 x double]* %4, i64 0, i64 1
%28 = load double, double* %27
%29 = call double @eraGmst00(double %26, double %28, double %26, double %28)
br label %30
30: ; preds = %25, %13
%31 = phi double [ %29, %25 ], [ %24, %13 ]
ret double %31
}