#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 */
int /*<<< orphan*/ printf(char *, int, int, int, int, int, int);
void print_tm(struct tm *p) {
  printf("%02d/%02d/%02d-%02d:%02d:%02d", p->tm_year + 1900, p->tm_mon + 1,
         p->tm_mday, p->tm_hour, p->tm_min, p->tm_sec);
}


x86 assembly (clang, -O0):
<print_tm>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-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    0xea9(%rip),%rdi
mov    %eax,(%rsp)
call   1030 <printf@plt>
add    $0x10,%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
add    $0x1,%edx
mov    0xc(%rdi),%r8d
mov    0x10(%rdi),%r9d
mov    0x14(%rdi),%eax
mov    %eax,(%rsp)
lea    0xeca(%rip),%rdi
call   1030 <printf@plt>
pop    %rax
ret

LLVM IR (-O0):
%struct.tm = type { i32, i32, i32, i32, i32, i32 }
@.str = [30 x i8] c"%02d/%02d/%02d-%02d:%02d:%02d\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 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 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 = [30 x i8] c"%02d/%02d/%02d-%02d:%02d:%02d\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 = tail call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i32 %4, i32 %7, i32 %9, i32 %11, i32 %13, i32 %15)
ret void
}