#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 int /*<<< orphan*/ uintmax_t;
typedef int time_t;
struct tm {
  int tm_mday;
  scalar_t__ tm_sec;
  scalar_t__ tm_min;
  scalar_t__ tm_hour;
};
struct timespec {
  int tv_sec;
  int /*<<< orphan*/ tv_nsec;
};

/* Variables and functions */
int /*<<< orphan*/ TIME_UTC;
char *asctime(int /*<<< orphan*/);
double difftime(int, int /*<<< orphan*/);
int /*<<< orphan*/ gmtime(int *);
struct tm *localtime(int *);
int /*<<< orphan*/ mktime(struct tm *);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ puts(char *);
int /*<<< orphan*/ simple_printf(char *, int, char, double, double);
int /*<<< orphan*/ strftime(char *, int, char *, int /*<<< orphan*/);
int time(int *);
int /*<<< orphan*/ timespec_get(struct timespec *, int /*<<< orphan*/);
int main() {
  puts("");
  simple_printf("dcff", 3, 'a', 1.999, 42.5);
  time_t now;
  time(&now);
  struct tm beg;
  beg = *localtime(&now);
  beg.tm_hour = 0;
  beg.tm_min = 0;
  beg.tm_sec = 0;
  beg.tm_mday = 1;
  double seconds = difftime(now, mktime(&beg));
  printf("%.f seconds have passed since the beginning of the months.\n",
         seconds);
  float minutes = seconds / 60;
  float hours = minutes / 60;
  printf("%.f days\n", hours / 24);
  time_t result = time(NULL);
  if (result != -1)
    printf("The current time is %s(%ju seconds since the Epoch)\n",
           asctime(gmtime(&result)), (uintmax_t)result);
  struct timespec ts;
  timespec_get(&ts, TIME_UTC);
  char buff[100];
  strftime(buff, sizeof buff, "%D %T", gmtime(&ts.tv_sec));
  printf("Current time: %s.%09ld UTC\n", buff, ts.tv_nsec);
  puts("");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xc0,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xed6(%rip),%rdi
call   1040 <puts@plt>
lea    0xe4b(%rip),%rdi
mov    $0x3,%esi
mov    $0x61,%edx
movsd  0xe29(%rip),%xmm0
movsd  0xe29(%rip),%xmm1
call   1070 <simple_printf@plt>
lea    -0x8(%rbp),%rdi
call   10a0 <time@plt>
lea    -0x8(%rbp),%rdi
call   1030 <localtime@plt>
mov    (%rax),%rcx
mov    %rcx,-0x28(%rbp)
mov    0x8(%rax),%rcx
mov    %rcx,-0x20(%rbp)
mov    0x10(%rax),%rcx
mov    %rcx,-0x18(%rbp)
mov    0x18(%rax),%rax
mov    %rax,-0x10(%rbp)
movq   $0x0,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
movq   $0x0,-0x20(%rbp)
movl   $0x1,-0x28(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0xb4(%rbp)
lea    -0x28(%rbp),%rdi
call   10b0 <mktime@plt>
mov    -0xb4(%rbp),%edi
mov    %eax,%esi
call   1090 <difftime@plt>
movsd  %xmm0,-0x30(%rbp)
movsd  -0x30(%rbp),%xmm0
lea    0xdb1(%rip),%rdi
mov    $0x1,%al
call   1080 <printf@plt>
movsd  -0x30(%rbp),%xmm0
movsd  0xd80(%rip),%xmm1
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x34(%rbp)
movss  -0x34(%rbp),%xmm0
movss  0xd62(%rip),%xmm1
divss  %xmm1,%xmm0
movss  %xmm0,-0x38(%rbp)
movss  -0x38(%rbp),%xmm0
movss  0xd48(%rip),%xmm1
divss  %xmm1,%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xd9a(%rip),%rdi
mov    $0x1,%al
call   1080 <printf@plt>
xor    %eax,%eax
mov    %eax,%edi
call   10a0 <time@plt>
mov    %eax,-0x3c(%rbp)
cmpl   $0xffffffff,-0x3c(%rbp)
je     1308 <main+0x158>
lea    -0x3c(%rbp),%rdi
call   10d0 <gmtime@plt>
mov    %eax,%edi
call   1060 <asctime@plt>
mov    %rax,%rsi
mov    -0x3c(%rbp),%edx
lea    0xd6a(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
mov    0x2cd1(%rip),%rax
mov    (%rax),%esi
lea    -0x48(%rbp),%rdi
call   1050 <timespec_get@plt>
lea    -0xb0(%rbp),%rax
mov    %rax,-0xc0(%rbp)
lea    -0x48(%rbp),%rdi
call   10d0 <gmtime@plt>
mov    -0xc0(%rbp),%rdi
mov    %eax,%ecx
mov    $0x64,%esi
lea    0xd5a(%rip),%rdx
call   10c0 <strftime@plt>
lea    -0xb0(%rbp),%rsi
mov    -0x44(%rbp),%edx
lea    0xd4a(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
lea    0xd35(%rip),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
add    $0xc0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0xb0,%rsp
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0xe57(%rip),%rdi
movsd  0xe2f(%rip),%xmm0
movsd  0xe2f(%rip),%xmm1
mov    $0x3,%esi
mov    $0x61,%edx
call   1070 <simple_printf@plt>
lea    0xc(%rsp),%rbx
mov    %rbx,%rdi
call   10a0 <time@plt>
mov    %rbx,%rdi
call   1040 <localtime@plt>
mov    (%rax),%rax
mov    %rax,0x20(%rsp)
xorps  %xmm0,%xmm0
movups %xmm0,0x28(%rsp)
movq   $0x0,0x38(%rsp)
movl   $0x1,0x20(%rsp)
mov    0xc(%rsp),%ebx
lea    0x20(%rsp),%rdi
call   10b0 <mktime@plt>
mov    %ebx,%edi
mov    %eax,%esi
call   1090 <difftime@plt>
movsd  %xmm0,0x10(%rsp)
lea    0xde3(%rip),%rdi
mov    $0x1,%al
call   1080 <printf@plt>
movsd  0x10(%rsp),%xmm0
divsd  0xdb9(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
divss  0xdb5(%rip),%xmm0
divss  0xdb1(%rip),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xdeb(%rip),%rdi
mov    $0x1,%al
call   1080 <printf@plt>
xor    %edi,%edi
call   10a0 <time@plt>
mov    %eax,0x8(%rsp)
cmp    $0xffffffff,%eax
je     12b3 <main+0x103>
lea    0x8(%rsp),%rdi
call   10d0 <gmtime@plt>
mov    %eax,%edi
call   1060 <asctime@plt>
mov    0x8(%rsp),%edx
lea    0xdc2(%rip),%rdi
mov    %rax,%rsi
xor    %eax,%eax
call   1080 <printf@plt>
mov    0x2d26(%rip),%rax
mov    (%rax),%esi
lea    0x18(%rsp),%rbx
mov    %rbx,%rdi
call   1050 <timespec_get@plt>
mov    %rbx,%rdi
call   10d0 <gmtime@plt>
lea    0xdc8(%rip),%rdx
lea    0x40(%rsp),%rbx
mov    %rbx,%rdi
mov    $0x64,%esi
mov    %eax,%ecx
call   10c0 <strftime@plt>
mov    0x1c(%rsp),%edx
lea    0xdaf(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1080 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
add    $0xb0,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.tm = type { i32, i64, i64, i64 }
%struct.timespec = type { i32, i32 }
@.str = [1 x i8] zeroinitializer
@.str.1 = [5 x i8] c"dcff\00"
@.str.2 = [60 x i8] c"%.f seconds have passed since the beginning of the months.\0A\00"
@.str.3 = [10 x i8] c"%.f days\0A\00"
@.str.4 = [53 x i8] c"The current time is %s(%ju seconds since the Epoch)\0A\00"
@TIME_UTC = global i32 0
@.str.5 = [6 x i8] c"%D %T\00"
@.str.6 = [28 x i8] c"Current time: %s.%09ld UTC\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca %struct.tm
%4 = alloca double
%5 = alloca float
%6 = alloca float
%7 = alloca i32
%8 = alloca %struct.timespec
%9 = alloca [100 x i8]
store i32 0, i32* %1
%10 = call i32 @puts(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
%11 = call i32 @simple_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 3, i8 signext 97, double 1.999000e+00, double 4.250000e+01)
%12 = call i32 @time(i32* %2)
%13 = call %struct.tm* @localtime(i32* %2)
%14 = bitcast %struct.tm* %3 to i8*
%15 = bitcast %struct.tm* %13 to i8*
%16 = getelementptr inbounds %struct.tm, %struct.tm* %3, i32 0, i32 3
store i64 0, i64* %16
%17 = getelementptr inbounds %struct.tm, %struct.tm* %3, i32 0, i32 2
store i64 0, i64* %17
%18 = getelementptr inbounds %struct.tm, %struct.tm* %3, i32 0, i32 1
store i64 0, i64* %18
%19 = getelementptr inbounds %struct.tm, %struct.tm* %3, i32 0, i32 0
store i32 1, i32* %19
%20 = load i32, i32* %2
%21 = call i32 @mktime(%struct.tm* %3)
%22 = call double @difftime(i32 %20, i32 %21)
store double %22, double* %4
%23 = load double, double* %4
%24 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([60 x i8], [60 x i8]* @.str.2, i64 0, i64 0), double %23)
%25 = load double, double* %4
%26 = fdiv double %25, 6.000000e+01
%27 = fptrunc double %26 to float
store float %27, float* %5
%28 = load float, float* %5
%29 = fdiv float %28, 6.000000e+01
store float %29, float* %6
%30 = load float, float* %6
%31 = fdiv float %30, 2.400000e+01
%32 = fpext float %31 to double
%33 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0), double %32)
%34 = call i32 @time(i32* null)
store i32 %34, i32* %7
%35 = load i32, i32* %7
%36 = icmp ne i32 %35, -1
br i1 %36, label %37, label %42
37: ; preds = %0
%38 = call i32 @gmtime(i32* %7)
%39 = call i8* @asctime(i32 %38)
%40 = load i32, i32* %7
%41 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str.4, i64 0, i64 0), i8* %39, i32 %40)
br label %42
42: ; preds = %37, %0
%43 = load i32, i32* @TIME_UTC
%44 = call i32 @timespec_get(%struct.timespec* %8, i32 %43)
%45 = getelementptr inbounds [100 x i8], [100 x i8]* %9, i64 0, i64 0
%46 = getelementptr inbounds %struct.timespec, %struct.timespec* %8, i32 0, i32 0
%47 = call i32 @gmtime(i32* %46)
%48 = call i32 @strftime(i8* %45, i32 100, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.5, i64 0, i64 0), i32 %47)
%49 = getelementptr inbounds [100 x i8], [100 x i8]* %9, i64 0, i64 0
%50 = getelementptr inbounds %struct.timespec, %struct.timespec* %8, i32 0, i32 1
%51 = load i32, i32* %50
%52 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.6, i64 0, i64 0), i8* %49, i32 %51)
%53 = call i32 @puts(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
%struct.tm = type { i32, i64, i64, i64 }
%struct.timespec = type { i32, i32 }
@.str.1 = [5 x i8] c"dcff\00"
@.str.2 = [60 x i8] c"%.f seconds have passed since the beginning of the months.\0A\00"
@.str.3 = [10 x i8] c"%.f days\0A\00"
@.str.4 = [53 x i8] c"The current time is %s(%ju seconds since the Epoch)\0A\00"
@TIME_UTC = global i32 0
@.str.5 = [6 x i8] c"%D %T\00"
@.str.6 = [28 x i8] c"Current time: %s.%09ld UTC\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca %struct.tm
%3 = alloca i32
%4 = alloca %struct.timespec
%5 = alloca [100 x i8]
%6 = tail call i32 @putchar(i32 10)
%7 = tail call i32 @simple_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 3, i8 signext 97, double 1.999000e+00, double 4.250000e+01)
%8 = bitcast i32* %1 to i8*
%9 = call i32 @time(i32* %1)
%10 = bitcast %struct.tm* %2 to i8*
%11 = call %struct.tm* @localtime(i32* %1)
%12 = bitcast %struct.tm* %11 to i64*
%13 = bitcast %struct.tm* %2 to i64*
%14 = load i64, i64* %12
store i64 %14, i64* %13
%15 = getelementptr inbounds %struct.tm, %struct.tm* %2, i64 0, i32 1
%16 = getelementptr inbounds %struct.tm, %struct.tm* %2, i64 0, i32 0
%17 = bitcast i64* %15 to i8*
store i32 1, i32* %16
%18 = load i32, i32* %1
%19 = call i32 @mktime(%struct.tm* %2)
%20 = call double @difftime(i32 %18, i32 %19)
%21 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([60 x i8], [60 x i8]* @.str.2, i64 0, i64 0), double %20)
%22 = fdiv double %20, 6.000000e+01
%23 = fptrunc double %22 to float
%24 = fdiv float %23, 6.000000e+01
%25 = fdiv float %24, 2.400000e+01
%26 = fpext float %25 to double
%27 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0), double %26)
%28 = bitcast i32* %3 to i8*
%29 = call i32 @time(i32* null)
store i32 %29, i32* %3
%30 = icmp eq i32 %29, -1
br i1 %30, label %36, label %31
31: ; preds = %0
%32 = call i32 @gmtime(i32* %3)
%33 = call i8* @asctime(i32 %32)
%34 = load i32, i32* %3
%35 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([53 x i8], [53 x i8]* @.str.4, i64 0, i64 0), i8* %33, i32 %34)
br label %36
36: ; preds = %31, %0
%37 = bitcast %struct.timespec* %4 to i8*
%38 = load i32, i32* @TIME_UTC
%39 = call i32 @timespec_get(%struct.timespec* %4, i32 %38)
%40 = getelementptr inbounds [100 x i8], [100 x i8]* %5, i64 0, i64 0
%41 = getelementptr inbounds %struct.timespec, %struct.timespec* %4, i64 0, i32 0
%42 = call i32 @gmtime(i32* %41)
%43 = call i32 @strftime(i8* %40, i32 100, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.5, i64 0, i64 0), i32 %42)
%44 = getelementptr inbounds %struct.timespec, %struct.timespec* %4, i64 0, i32 1
%45 = load i32, i32* %44
%46 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @.str.6, i64 0, i64 0), i8* %40, i32 %45)
%47 = call i32 @putchar(i32 10)
ret i32 0
}