#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;
  int tm_wday;
  int tm_yday;
  int tm_isdst;
};

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int, int, int, int, int, int, int, int);
void print_tm(struct tm *t) {
  printf("%04d-%02d-%02d %02d:%02d:%02d (week day %d) (year day %d) (day time "
         "saving %d)\n",
         t->tm_year + 1900, t->tm_mon + 1, t->tm_mday, t->tm_hour, t->tm_min,
         t->tm_sec, t->tm_wday, t->tm_yday + 1, t->tm_isdst);
}


x86 assembly (clang, -O0):
<print_tm>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
sub    $0x28,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%esi
add    $0x76c,%esi
mov    -0x10(%rbp),%rax
mov    0x4(%rax),%edx
add    $0x1,%edx
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%ecx
mov    -0x10(%rbp),%rax
mov    0xc(%rax),%r8d
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%r9d
mov    -0x10(%rbp),%rax
mov    0x14(%rax),%ebx
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%r11d
mov    -0x10(%rbp),%rax
mov    0x1c(%rax),%r10d
add    $0x1,%r10d
mov    -0x10(%rbp),%rax
mov    0x20(%rax),%eax
lea    0xe8d(%rip),%rdi
mov    %ebx,(%rsp)
mov    %r11d,0x8(%rsp)
mov    %r10d,0x10(%rsp)
mov    %eax,0x18(%rsp)
call   1030 <printf@plt>
add    $0x28,%rsp
pop    %rbx
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_tm>:
push   %rbx
mov    $0x76c,%esi
add    (%rdi),%esi
mov    0x4(%rdi),%edx
mov    0x8(%rdi),%ecx
add    $0x1,%edx
mov    0xc(%rdi),%r8d
mov    0x10(%rdi),%r9d
mov    0x14(%rdi),%r10d
mov    0x18(%rdi),%r11d
mov    0x1c(%rdi),%eax
add    $0x1,%eax
mov    0x20(%rdi),%ebx
lea    0xebf(%rip),%rdi
push   %rbx
push   %rax
push   %r11
push   %r10
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.tm = type { i32, i32, i32, i32, i32, i32, i32, i32, i32 }
@.str = [80 x i8] c"%04d-%02d-%02d %02d:%02d:%02d (week day %d) (year day %d) (day time saving %d)\0A\00"
define void @print_tm(%struct.tm* %0) {
%2 = alloca %struct.tm*
store %struct.tm* %0, %struct.tm** %2
%3 = load %struct.tm*, %struct.tm** %2
%4 = getelementptr inbounds %struct.tm, %struct.tm* %3, i32 0, i32 0
%5 = load i32, i32* %4
%6 = add nsw i32 %5, 1900
%7 = load %struct.tm*, %struct.tm** %2
%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** %2
%12 = getelementptr inbounds %struct.tm, %struct.tm* %11, i32 0, i32 2
%13 = load i32, i32* %12
%14 = load %struct.tm*, %struct.tm** %2
%15 = getelementptr inbounds %struct.tm, %struct.tm* %14, i32 0, i32 3
%16 = load i32, i32* %15
%17 = load %struct.tm*, %struct.tm** %2
%18 = getelementptr inbounds %struct.tm, %struct.tm* %17, i32 0, i32 4
%19 = load i32, i32* %18
%20 = load %struct.tm*, %struct.tm** %2
%21 = getelementptr inbounds %struct.tm, %struct.tm* %20, i32 0, i32 5
%22 = load i32, i32* %21
%23 = load %struct.tm*, %struct.tm** %2
%24 = getelementptr inbounds %struct.tm, %struct.tm* %23, i32 0, i32 6
%25 = load i32, i32* %24
%26 = load %struct.tm*, %struct.tm** %2
%27 = getelementptr inbounds %struct.tm, %struct.tm* %26, i32 0, i32 7
%28 = load i32, i32* %27
%29 = add nsw i32 %28, 1
%30 = load %struct.tm*, %struct.tm** %2
%31 = getelementptr inbounds %struct.tm, %struct.tm* %30, i32 0, i32 8
%32 = load i32, i32* %31
%33 = call i32 @printf(i8* getelementptr inbounds ([80 x i8], [80 x i8]* @.str, i64 0, i64 0), i32 %6, i32 %10, i32 %13, i32 %16, i32 %19, i32 %22, i32 %25, i32 %29, i32 %32)
ret void
}

LLVM IR (-O2):
%struct.tm = type { i32, i32, i32, i32, i32, i32, i32, i32, i32 }
@.str = [80 x i8] c"%04d-%02d-%02d %02d:%02d:%02d (week day %d) (year day %d) (day time saving %d)\0A\00"
define void @print_tm(%struct.tm* nocapture %0) {
%2 = getelementptr inbounds %struct.tm, %struct.tm* %0, i64 0, i32 0
%3 = load i32, i32* %2
%4 = add nsw i32 %3, 1900
%5 = getelementptr inbounds %struct.tm, %struct.tm* %0, i64 0, i32 1
%6 = load i32, i32* %5
%7 = add nsw i32 %6, 1
%8 = getelementptr inbounds %struct.tm, %struct.tm* %0, i64 0, i32 2
%9 = load i32, i32* %8
%10 = getelementptr inbounds %struct.tm, %struct.tm* %0, i64 0, i32 3
%11 = load i32, i32* %10
%12 = getelementptr inbounds %struct.tm, %struct.tm* %0, i64 0, i32 4
%13 = load i32, i32* %12
%14 = getelementptr inbounds %struct.tm, %struct.tm* %0, i64 0, i32 5
%15 = load i32, i32* %14
%16 = getelementptr inbounds %struct.tm, %struct.tm* %0, i64 0, i32 6
%17 = load i32, i32* %16
%18 = getelementptr inbounds %struct.tm, %struct.tm* %0, i64 0, i32 7
%19 = load i32, i32* %18
%20 = add nsw i32 %19, 1
%21 = getelementptr inbounds %struct.tm, %struct.tm* %0, i64 0, i32 8
%22 = load i32, i32* %21
%23 = tail call i32 @printf(i8* getelementptr inbounds ([80 x i8], [80 x i8]* @.str, i64 0, i64 0), i32 %4, i32 %7, i32 %9, i32 %11, i32 %13, i32 %15, i32 %17, i32 %20, i32 %22)
ret void
}