#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 CTA_DateTime_JulianToGregorian(double, int *, int *, int *, int *, int *,
                                   int *);
int CTA_DateTime_ModifiedJulianToJulian(double, double *);
int CTA_DateTime_ModifiedJulianToGregorian(double mjd, int *year, int *month,
                                           int *day, int *hour, int *minute,
                                           int *second) {
  int ierr;
  double jd;
  ierr = CTA_DateTime_ModifiedJulianToJulian(mjd, &jd);
  if (ierr == (0)) {
    ierr = CTA_DateTime_JulianToGregorian(jd, year, month, day, hour, minute,
                                          second);
  }
  return ierr;
}


x86 assembly (clang, -O0):
<CTA_DateTime_ModifiedJulianToGregorian>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movsd  %xmm0,-0x8(%rbp)
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
mov    %r8,-0x30(%rbp)
mov    %r9,-0x38(%rbp)
movsd  -0x8(%rbp),%xmm0
lea    -0x48(%rbp),%rdi
call   1030 <CTA_DateTime_ModifiedJulianToJulian@plt>
mov    %eax,-0x3c(%rbp)
cmpl   $0x0,-0x3c(%rbp)
jne    1185 <CTA_DateTime_ModifiedJulianToGregorian+0x65>
movsd  -0x48(%rbp),%xmm0
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
mov    -0x28(%rbp),%rcx
mov    -0x30(%rbp),%r8
mov    -0x38(%rbp),%r9
call   1040 <CTA_DateTime_JulianToGregorian@plt>
mov    %eax,-0x3c(%rbp)
mov    -0x3c(%rbp),%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CTA_DateTime_ModifiedJulianToGregorian>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %r9,%r14
mov    %r8,%r15
mov    %rcx,%r12
mov    %rdx,%r13
mov    %rsi,%rbx
mov    %rdi,%rbp
mov    %rsp,%rdi
call   1030 <CTA_DateTime_ModifiedJulianToJulian@plt>
test   %eax,%eax
jne    1165 <CTA_DateTime_ModifiedJulianToGregorian+0x45>
movsd  (%rsp),%xmm0
mov    %rbp,%rdi
mov    %rbx,%rsi
mov    %r13,%rdx
mov    %r12,%rcx
mov    %r15,%r8
mov    %r14,%r9
call   1040 <CTA_DateTime_JulianToGregorian@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i32 @CTA_DateTime_ModifiedJulianToGregorian(double %0, i32* %1, i32* %2, i32* %3, i32* %4, i32* %5, i32* %6) {
%8 = alloca double
%9 = alloca i32*
%10 = alloca i32*
%11 = alloca i32*
%12 = alloca i32*
%13 = alloca i32*
%14 = alloca i32*
%15 = alloca i32
%16 = alloca double
store double %0, double* %8
store i32* %1, i32** %9
store i32* %2, i32** %10
store i32* %3, i32** %11
store i32* %4, i32** %12
store i32* %5, i32** %13
store i32* %6, i32** %14
%17 = load double, double* %8
%18 = call i32 @CTA_DateTime_ModifiedJulianToJulian(double %17, double* %16)
store i32 %18, i32* %15
%19 = load i32, i32* %15
%20 = icmp eq i32 %19, 0
br i1 %20, label %21, label %30
21: ; preds = %7
%22 = load double, double* %16
%23 = load i32*, i32** %9
%24 = load i32*, i32** %10
%25 = load i32*, i32** %11
%26 = load i32*, i32** %12
%27 = load i32*, i32** %13
%28 = load i32*, i32** %14
%29 = call i32 @CTA_DateTime_JulianToGregorian(double %22, i32* %23, i32* %24, i32* %25, i32* %26, i32* %27, i32* %28)
store i32 %29, i32* %15
br label %30
30: ; preds = %21, %7
%31 = load i32, i32* %15
ret i32 %31
}

LLVM IR (-O2):
define i32 @CTA_DateTime_ModifiedJulianToGregorian(double %0, i32* %1, i32* %2, i32* %3, i32* %4, i32* %5, i32* %6) {
%8 = alloca double
%9 = bitcast double* %8 to i8*
%10 = call i32 @CTA_DateTime_ModifiedJulianToJulian(double %0, double* %8)
%11 = icmp eq i32 %10, 0
br i1 %11, label %12, label %15
12: ; preds = %7
%13 = load double, double* %8
%14 = call i32 @CTA_DateTime_JulianToGregorian(double %13, i32* %1, i32* %2, i32* %3, i32* %4, i32* %5, i32* %6)
br label %15
15: ; preds = %12, %7
%16 = phi i32 [ %14, %12 ], [ %10, %7 ]
ret i32 %16
}