#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 */
typedef double time_t;
struct tm {
  int tm_year;
  int tm_mon;
  int tm_mday;
  int tm_hour;
  int tm_min;
  double tm_sec;
};

/* Variables and functions */
double floor(double);
struct tm *gmtime(double *);
void TimeEpochToYMDHMS(double tme, int *yr, int *mo, int *dy, int *hr, int *mn,
                       double *sc) {
  time_t clock;
  struct tm *tm;
  clock = floor(tme);
  tm = gmtime(&clock);
  *yr = tm->tm_year + 1900;
  *mo = tm->tm_mon + 1;
  *dy = tm->tm_mday;
  *hr = tm->tm_hour;
  *mn = tm->tm_min;
  *sc = tm->tm_sec + (tme - floor(tme));
}


x86 assembly (clang, -O0):
<TimeEpochToYMDHMS>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%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
call   1040 <floor@plt>
movsd  %xmm0,-0x40(%rbp)
lea    -0x40(%rbp),%rdi
call   1030 <gmtime@plt>
mov    %rax,-0x48(%rbp)
mov    -0x48(%rbp),%rax
mov    (%rax),%ecx
add    $0x76c,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x48(%rbp),%rax
mov    0x4(%rax),%ecx
add    $0x1,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x48(%rbp),%rax
mov    0x8(%rax),%ecx
mov    -0x20(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x48(%rbp),%rax
mov    0xc(%rax),%ecx
mov    -0x28(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x48(%rbp),%rax
mov    0x10(%rax),%ecx
mov    -0x30(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x48(%rbp),%rax
movsd  0x18(%rax),%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x58(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1040 <floor@plt>
movsd  -0x58(%rbp),%xmm1
movaps %xmm0,%xmm2
movsd  -0x50(%rbp),%xmm0
subsd  %xmm2,%xmm1
addsd  %xmm1,%xmm0
mov    -0x38(%rbp),%rax
movsd  %xmm0,(%rax)
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<TimeEpochToYMDHMS>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
mov    %r9,%r14
mov    %r8,%r15
mov    %rcx,%r12
mov    %rdx,%r13
mov    %rsi,%rbx
mov    %rdi,%rbp
movsd  %xmm0,0x8(%rsp)
call   1040 <floor@plt>
movsd  %xmm0,(%rsp)
movsd  %xmm0,0x10(%rsp)
lea    0x10(%rsp),%rdi
call   1030 <gmtime@plt>
mov    $0x76c,%ecx
add    (%rax),%ecx
mov    %ecx,0x0(%rbp)
mov    0x4(%rax),%ecx
add    $0x1,%ecx
mov    %ecx,(%rbx)
mov    0x8(%rax),%ecx
mov    %ecx,0x0(%r13)
mov    0xc(%rax),%ecx
mov    %ecx,(%r12)
mov    0x10(%rax),%ecx
mov    %ecx,(%r15)
movsd  0x8(%rsp),%xmm0
subsd  (%rsp),%xmm0
addsd  0x18(%rax),%xmm0
movsd  %xmm0,(%r14)
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
%struct.tm = type { i32, i32, i32, i32, i32, double }
define void @TimeEpochToYMDHMS(double %0, i32* %1, i32* %2, i32* %3, i32* %4, i32* %5, double* %6) {
%8 = alloca double
%9 = alloca i32*
%10 = alloca i32*
%11 = alloca i32*
%12 = alloca i32*
%13 = alloca i32*
%14 = alloca double*
%15 = alloca double
%16 = alloca %struct.tm*
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 double* %6, double** %14
%17 = load double, double* %8
%18 = call double @llvm.floor.f64(double %17)
store double %18, double* %15
%19 = call %struct.tm* @gmtime(double* %15)
store %struct.tm* %19, %struct.tm** %16
%20 = load %struct.tm*, %struct.tm** %16
%21 = getelementptr inbounds %struct.tm, %struct.tm* %20, i32 0, i32 0
%22 = load i32, i32* %21
%23 = add nsw i32 %22, 1900
%24 = load i32*, i32** %9
store i32 %23, i32* %24
%25 = load %struct.tm*, %struct.tm** %16
%26 = getelementptr inbounds %struct.tm, %struct.tm* %25, i32 0, i32 1
%27 = load i32, i32* %26
%28 = add nsw i32 %27, 1
%29 = load i32*, i32** %10
store i32 %28, i32* %29
%30 = load %struct.tm*, %struct.tm** %16
%31 = getelementptr inbounds %struct.tm, %struct.tm* %30, i32 0, i32 2
%32 = load i32, i32* %31
%33 = load i32*, i32** %11
store i32 %32, i32* %33
%34 = load %struct.tm*, %struct.tm** %16
%35 = getelementptr inbounds %struct.tm, %struct.tm* %34, i32 0, i32 3
%36 = load i32, i32* %35
%37 = load i32*, i32** %12
store i32 %36, i32* %37
%38 = load %struct.tm*, %struct.tm** %16
%39 = getelementptr inbounds %struct.tm, %struct.tm* %38, i32 0, i32 4
%40 = load i32, i32* %39
%41 = load i32*, i32** %13
store i32 %40, i32* %41
%42 = load %struct.tm*, %struct.tm** %16
%43 = getelementptr inbounds %struct.tm, %struct.tm* %42, i32 0, i32 5
%44 = load double, double* %43
%45 = load double, double* %8
%46 = load double, double* %8
%47 = call double @llvm.floor.f64(double %46)
%48 = fsub double %45, %47
%49 = fadd double %44, %48
%50 = load double*, double** %14
store double %49, double* %50
ret void
}

LLVM IR (-O2):
%struct.tm = type { i32, i32, i32, i32, i32, double }
define void @TimeEpochToYMDHMS(double %0, i32* nocapture writeonly %1, i32* nocapture writeonly %2, i32* nocapture writeonly %3, i32* nocapture writeonly %4, i32* nocapture writeonly %5, double* nocapture writeonly %6) {
%8 = alloca double
%9 = bitcast double* %8 to i8*
%10 = tail call double @llvm.floor.f64(double %0)
store double %10, double* %8
%11 = call %struct.tm* @gmtime(double* %8)
%12 = getelementptr inbounds %struct.tm, %struct.tm* %11, i64 0, i32 0
%13 = load i32, i32* %12
%14 = add nsw i32 %13, 1900
store i32 %14, i32* %1
%15 = getelementptr inbounds %struct.tm, %struct.tm* %11, i64 0, i32 1
%16 = load i32, i32* %15
%17 = add nsw i32 %16, 1
store i32 %17, i32* %2
%18 = getelementptr inbounds %struct.tm, %struct.tm* %11, i64 0, i32 2
%19 = load i32, i32* %18
store i32 %19, i32* %3
%20 = getelementptr inbounds %struct.tm, %struct.tm* %11, i64 0, i32 3
%21 = load i32, i32* %20
store i32 %21, i32* %4
%22 = getelementptr inbounds %struct.tm, %struct.tm* %11, i64 0, i32 4
%23 = load i32, i32* %22
store i32 %23, i32* %5
%24 = getelementptr inbounds %struct.tm, %struct.tm* %11, i64 0, i32 5
%25 = load double, double* %24
%26 = fsub double %0, %10
%27 = fadd double %26, %25
store double %27, double* %6
ret void
}