#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*/ TimeJulianToYMDHMS(double, int *, int *, int *, int *, int *,
                                      double *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
int /*<<< orphan*/ stdout;
int main(int argc, char *argv[]) {
  int yr, mo, dy, hr, mt;
  double sc;
  double tval = 2452516;
  TimeJulianToYMDHMS(tval, &yr, &mo, &dy, &hr, &mt, &sc);
  fprintf(stdout, "TimeJulianToYMDHMS\n");
  fprintf(stdout, "Tval: %d\n", (int)tval);
  fprintf(stdout, "Time: %.4d-%.2d-%.2d %.2d:%.2d:%.2d\n", yr, mo, dy, hr, mt,
          (int)sc);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movsd  0xec2(%rip),%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  -0x38(%rbp),%xmm0
lea    -0x14(%rbp),%rdi
lea    -0x18(%rbp),%rsi
lea    -0x1c(%rbp),%rdx
lea    -0x20(%rbp),%rcx
lea    -0x24(%rbp),%r8
lea    -0x30(%rbp),%r9
call   1030 <TimeJulianToYMDHMS@plt>
mov    0x2e74(%rip),%rax
mov    (%rax),%edi
lea    0xe93(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    0x2e5d(%rip),%rax
mov    (%rax),%edi
cvttsd2si -0x38(%rbp),%edx
lea    0xe8b(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    0x2e41(%rip),%rax
mov    (%rax),%edi
mov    -0x14(%rbp),%edx
mov    -0x18(%rbp),%ecx
mov    -0x1c(%rbp),%r8d
mov    -0x20(%rbp),%r9d
mov    -0x24(%rbp),%r10d
cvttsd2si -0x30(%rbp),%eax
lea    0xe67(%rip),%rsi
mov    %r10d,(%rsp)
mov    %eax,0x8(%rsp)
mov    $0x0,%al
call   1040 <fprintf@plt>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x20,%rsp
movsd  0xed3(%rip),%xmm0
lea    0x14(%rsp),%rdi
lea    0x10(%rsp),%rsi
lea    0xc(%rsp),%rdx
lea    0x8(%rsp),%rcx
lea    0x4(%rsp),%r8
lea    0x18(%rsp),%r9
call   1030 <TimeJulianToYMDHMS@plt>
mov    0x2e89(%rip),%rbx
mov    (%rbx),%edi
lea    0xea8(%rip),%rsi
xor    %eax,%eax
call   1040 <fprintf@plt>
mov    (%rbx),%edi
lea    0xeac(%rip),%rsi
mov    $0x256c24,%edx
xor    %eax,%eax
call   1040 <fprintf@plt>
mov    (%rbx),%edi
mov    0x14(%rsp),%edx
mov    0x10(%rsp),%ecx
mov    0xc(%rsp),%r8d
mov    0x8(%rsp),%r9d
mov    0x4(%rsp),%r10d
cvttsd2si 0x18(%rsp),%ebx
lea    0xe84(%rip),%rsi
xor    %eax,%eax
push   %rbx
push   %r10
call   1040 <fprintf@plt>
add    $0x10,%rsp
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@stdout = global i32 0
@.str = [20 x i8] c"TimeJulianToYMDHMS\0A\00"
@.str.1 = [10 x i8] c"Tval: %d\0A\00"
@.str.2 = [37 x i8] c"Time: %.4d-%.2d-%.2d %.2d:%.2d:%.2d\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca double
%12 = alloca double
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store double 0x4142B61200000000, double* %12
%13 = load double, double* %12
%14 = call i32 @TimeJulianToYMDHMS(double %13, i32* %6, i32* %7, i32* %8, i32* %9, i32* %10, double* %11)
%15 = load i32, i32* @stdout
%16 = call i32 (i32, i8*, ...) @fprintf(i32 %15, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%17 = load i32, i32* @stdout
%18 = load double, double* %12
%19 = fptosi double %18 to i32
%20 = call i32 (i32, i8*, ...) @fprintf(i32 %17, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i32 %19)
%21 = load i32, i32* @stdout
%22 = load i32, i32* %6
%23 = load i32, i32* %7
%24 = load i32, i32* %8
%25 = load i32, i32* %9
%26 = load i32, i32* %10
%27 = load double, double* %11
%28 = fptosi double %27 to i32
%29 = call i32 (i32, i8*, ...) @fprintf(i32 %21, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.2, i64 0, i64 0), i32 %22, i32 %23, i32 %24, i32 %25, i32 %26, i32 %28)
ret i32 0
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [20 x i8] c"TimeJulianToYMDHMS\0A\00"
@.str.1 = [10 x i8] c"Tval: %d\0A\00"
@.str.2 = [37 x i8] c"Time: %.4d-%.2d-%.2d %.2d:%.2d:%.2d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca double
%9 = bitcast i32* %3 to i8*
%10 = bitcast i32* %4 to i8*
%11 = bitcast i32* %5 to i8*
%12 = bitcast i32* %6 to i8*
%13 = bitcast i32* %7 to i8*
%14 = bitcast double* %8 to i8*
%15 = call i32 @TimeJulianToYMDHMS(double 0x4142B61200000000, i32* %3, i32* %4, i32* %5, i32* %6, i32* %7, double* %8)
%16 = load i32, i32* @stdout
%17 = call i32 (i32, i8*, ...) @fprintf(i32 %16, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%18 = load i32, i32* @stdout
%19 = call i32 (i32, i8*, ...) @fprintf(i32 %18, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i32 2452516)
%20 = load i32, i32* @stdout
%21 = load i32, i32* %3
%22 = load i32, i32* %4
%23 = load i32, i32* %5
%24 = load i32, i32* %6
%25 = load i32, i32* %7
%26 = load double, double* %8
%27 = fptosi double %26 to i32
%28 = call i32 (i32, i8*, ...) @fprintf(i32 %20, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.2, i64 0, i64 0), i32 %21, i32 %22, i32 %23, i32 %24, i32 %25, i32 %27)
ret i32 0
}