#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 rtc_time {
  int tm_year;
  int tm_mon;
  int tm_mday;
  int tm_hour;
  int tm_min;
  int tm_sec;
};

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int, int, int, int, int);
void print_tm(struct rtc_time *tm) {
  int year = tm->tm_year + (1900);
  printf("\t%d-%d-%d %d:%d:%d\n", year, tm->tm_mon, tm->tm_mday, tm->tm_hour,
         tm->tm_min, tm->tm_sec);
}


x86 assembly (clang, -O0):
<print_tm>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
add    $0x76c,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%esi
mov    -0x8(%rbp),%rax
mov    0x4(%rax),%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    0xea7(%rip),%rdi
mov    %eax,(%rsp)
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

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

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

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