#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_sec;
  int tm_min;
  int tm_hour;
  int tm_mday;
  int tm_mon;
  int tm_year;
  int tm_wday;
  int tm_yday;
  int tm_isdst;
};

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void print_tm_fields(struct tm *ltime) {
  printf("sec=%d\n", ltime->tm_sec);
  printf("mon=%d\n", ltime->tm_min);
  printf("hour=%d\n", ltime->tm_hour);
  printf("mday=%d\n", ltime->tm_mday);
  printf("mon=%d\n", ltime->tm_mon);
  printf("year=%d\n", ltime->tm_year);
  printf("wday=%d\n", ltime->tm_wday);
  printf("yday=%d\n", ltime->tm_yday);
  printf("isdst=%d\n", ltime->tm_isdst);
}


x86 assembly (clang, -O0):
<print_tm_fields>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%esi
lea    0xed7(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%rax
mov    0x4(%rax),%esi
lea    0xecc(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%esi
lea    0xec1(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%rax
mov    0xc(%rax),%esi
lea    0xeb7(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%rax
mov    0x10(%rax),%esi
lea    0xe93(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%rax
mov    0x14(%rax),%esi
lea    0xe9a(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%rax
mov    0x18(%rax),%esi
lea    0xe90(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%rax
mov    0x1c(%rax),%esi
lea    0xe86(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%rax
mov    0x20(%rax),%esi
lea    0xe7c(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_tm_fields>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    (%rdi),%esi
lea    0xee0(%rip),%rdi
call   1030 <printf@plt>
mov    0x4(%rbx),%esi
lea    0xed9(%rip),%r14
mov    %r14,%rdi
call   1030 <printf@plt>
mov    0x8(%rbx),%esi
lea    0xecf(%rip),%rdi
call   1030 <printf@plt>
mov    0xc(%rbx),%esi
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
mov    0x10(%rbx),%esi
mov    %r14,%rdi
call   1030 <printf@plt>
mov    0x14(%rbx),%esi
lea    0xeb8(%rip),%rdi
call   1030 <printf@plt>
mov    0x18(%rbx),%esi
lea    0xeb2(%rip),%rdi
call   1030 <printf@plt>
mov    0x1c(%rbx),%esi
lea    0xeac(%rip),%rdi
call   1030 <printf@plt>
mov    0x20(%rbx),%esi
lea    0xea6(%rip),%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <printf@plt>

LLVM IR (-O0):
%struct.tm = type { i32, i32, i32, i32, i32, i32, i32, i32, i32 }
@.str = [8 x i8] c"sec=%d\0A\00"
@.str.1 = [8 x i8] c"mon=%d\0A\00"
@.str.2 = [9 x i8] c"hour=%d\0A\00"
@.str.3 = [9 x i8] c"mday=%d\0A\00"
@.str.4 = [9 x i8] c"year=%d\0A\00"
@.str.5 = [9 x i8] c"wday=%d\0A\00"
@.str.6 = [9 x i8] c"yday=%d\0A\00"
@.str.7 = [10 x i8] c"isdst=%d\0A\00"
define void @print_tm_fields(%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 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %5)
%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 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i32 %9)
%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 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0), i32 %13)
%15 = load %struct.tm*, %struct.tm** %2
%16 = getelementptr inbounds %struct.tm, %struct.tm* %15, i32 0, i32 3
%17 = load i32, i32* %16
%18 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0), i32 %17)
%19 = load %struct.tm*, %struct.tm** %2
%20 = getelementptr inbounds %struct.tm, %struct.tm* %19, i32 0, i32 4
%21 = load i32, i32* %20
%22 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i32 %21)
%23 = load %struct.tm*, %struct.tm** %2
%24 = getelementptr inbounds %struct.tm, %struct.tm* %23, i32 0, i32 5
%25 = load i32, i32* %24
%26 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.4, i64 0, i64 0), i32 %25)
%27 = load %struct.tm*, %struct.tm** %2
%28 = getelementptr inbounds %struct.tm, %struct.tm* %27, i32 0, i32 6
%29 = load i32, i32* %28
%30 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.5, i64 0, i64 0), i32 %29)
%31 = load %struct.tm*, %struct.tm** %2
%32 = getelementptr inbounds %struct.tm, %struct.tm* %31, i32 0, i32 7
%33 = load i32, i32* %32
%34 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.6, i64 0, i64 0), i32 %33)
%35 = load %struct.tm*, %struct.tm** %2
%36 = getelementptr inbounds %struct.tm, %struct.tm* %35, i32 0, i32 8
%37 = load i32, i32* %36
%38 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.7, i64 0, i64 0), i32 %37)
ret void
}

LLVM IR (-O2):
%struct.tm = type { i32, i32, i32, i32, i32, i32, i32, i32, i32 }
@.str = [8 x i8] c"sec=%d\0A\00"
@.str.1 = [8 x i8] c"mon=%d\0A\00"
@.str.2 = [9 x i8] c"hour=%d\0A\00"
@.str.3 = [9 x i8] c"mday=%d\0A\00"
@.str.4 = [9 x i8] c"year=%d\0A\00"
@.str.5 = [9 x i8] c"wday=%d\0A\00"
@.str.6 = [9 x i8] c"yday=%d\0A\00"
@.str.7 = [10 x i8] c"isdst=%d\0A\00"
define void @print_tm_fields(%struct.tm* nocapture %0) {
%2 = getelementptr inbounds %struct.tm, %struct.tm* %0, i64 0, i32 0
%3 = load i32, i32* %2
%4 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = getelementptr inbounds %struct.tm, %struct.tm* %0, i64 0, i32 1
%6 = load i32, i32* %5
%7 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i32 %6)
%8 = getelementptr inbounds %struct.tm, %struct.tm* %0, i64 0, i32 2
%9 = load i32, i32* %8
%10 = tail call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0), i32 %9)
%11 = getelementptr inbounds %struct.tm, %struct.tm* %0, i64 0, i32 3
%12 = load i32, i32* %11
%13 = tail call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0), i32 %12)
%14 = getelementptr inbounds %struct.tm, %struct.tm* %0, i64 0, i32 4
%15 = load i32, i32* %14
%16 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i32 %15)
%17 = getelementptr inbounds %struct.tm, %struct.tm* %0, i64 0, i32 5
%18 = load i32, i32* %17
%19 = tail call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.4, i64 0, i64 0), i32 %18)
%20 = getelementptr inbounds %struct.tm, %struct.tm* %0, i64 0, i32 6
%21 = load i32, i32* %20
%22 = tail call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.5, i64 0, i64 0), i32 %21)
%23 = getelementptr inbounds %struct.tm, %struct.tm* %0, i64 0, i32 7
%24 = load i32, i32* %23
%25 = tail call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.6, i64 0, i64 0), i32 %24)
%26 = getelementptr inbounds %struct.tm, %struct.tm* %0, i64 0, i32 8
%27 = load i32, i32* %26
%28 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.7, i64 0, i64 0), i32 %27)
ret void
}