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

/* Variables and functions */
struct tm *get_current_time();
int /*<<< orphan*/ printf(char *, int, int, int, int, int, int);
void print_current_date(void) {
  struct tm *ct = get_current_time();
  printf("%.4d-%.2d-%.2d %.2d:%.2d:%.2d\n", 1900 + ct->tm_year, ct->tm_mon + 1,
         ct->tm_mday, ct->tm_hour, ct->tm_min, ct->tm_sec);
}


x86 assembly (clang, -O0):
<print_current_date>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <get_current_time@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%esi
add    $0x76c,%esi
mov    -0x8(%rbp),%rax
mov    0x4(%rax),%edx
add    $0x1,%edx
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%ecx
mov    -0x8(%rbp),%rax
mov    0xc(%rax),%r8d
mov    -0x8(%rbp),%rax
mov    0x10(%rax),%r9d
mov    -0x8(%rbp),%rax
mov    0x14(%rax),%eax
lea    0xe92(%rip),%rdi
mov    %eax,(%rsp)
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_current_date>:
push   %rax
xor    %eax,%eax
call   1040 <get_current_time@plt>
mov    $0x76c,%esi
add    (%rax),%esi
mov    0x4(%rax),%edx
mov    0x8(%rax),%ecx
add    $0x1,%edx
mov    0xc(%rax),%r8d
mov    0x10(%rax),%r9d
mov    0x14(%rax),%eax
mov    %eax,(%rsp)
lea    0xeb3(%rip),%rdi
call   1030 <printf@plt>
pop    %rax
ret

LLVM IR (-O0):
%struct.tm = type { i32, i32, i32, i32, i32, i32 }
@.str = [31 x i8] c"%.4d-%.2d-%.2d %.2d:%.2d:%.2d\0A\00"
define void @print_current_date() {
%1 = alloca %struct.tm*
%2 = call %struct.tm* (...) @get_current_time()
store %struct.tm* %2, %struct.tm** %1
%3 = load %struct.tm*, %struct.tm** %1
%4 = getelementptr inbounds %struct.tm, %struct.tm* %3, i32 0, i32 0
%5 = load i32, i32* %4
%6 = add nsw i32 1900, %5
%7 = load %struct.tm*, %struct.tm** %1
%8 = getelementptr inbounds %struct.tm, %struct.tm* %7, i32 0, i32 1
%9 = load i32, i32* %8
%10 = add nsw i32 %9, 1
%11 = load %struct.tm*, %struct.tm** %1
%12 = getelementptr inbounds %struct.tm, %struct.tm* %11, i32 0, i32 2
%13 = load i32, i32* %12
%14 = load %struct.tm*, %struct.tm** %1
%15 = getelementptr inbounds %struct.tm, %struct.tm* %14, i32 0, i32 3
%16 = load i32, i32* %15
%17 = load %struct.tm*, %struct.tm** %1
%18 = getelementptr inbounds %struct.tm, %struct.tm* %17, i32 0, i32 4
%19 = load i32, i32* %18
%20 = load %struct.tm*, %struct.tm** %1
%21 = getelementptr inbounds %struct.tm, %struct.tm* %20, i32 0, i32 5
%22 = load i32, i32* %21
%23 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i32 %6, i32 %10, i32 %13, i32 %16, i32 %19, i32 %22)
ret void
}

LLVM IR (-O2):
%struct.tm = type { i32, i32, i32, i32, i32, i32 }
@.str = [31 x i8] c"%.4d-%.2d-%.2d %.2d:%.2d:%.2d\0A\00"
define void @print_current_date() {
%1 = tail call %struct.tm* (...) @get_current_time()
%2 = getelementptr inbounds %struct.tm, %struct.tm* %1, i64 0, i32 0
%3 = load i32, i32* %2
%4 = add nsw i32 %3, 1900
%5 = getelementptr inbounds %struct.tm, %struct.tm* %1, i64 0, i32 1
%6 = load i32, i32* %5
%7 = add nsw i32 %6, 1
%8 = getelementptr inbounds %struct.tm, %struct.tm* %1, i64 0, i32 2
%9 = load i32, i32* %8
%10 = getelementptr inbounds %struct.tm, %struct.tm* %1, i64 0, i32 3
%11 = load i32, i32* %10
%12 = getelementptr inbounds %struct.tm, %struct.tm* %1, i64 0, i32 4
%13 = load i32, i32* %12
%14 = getelementptr inbounds %struct.tm, %struct.tm* %1, i64 0, i32 5
%15 = load i32, i32* %14
%16 = tail call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i32 %4, i32 %7, i32 %9, i32 %11, i32 %13, i32 %15)
ret void
}