#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;
};

/* Variables and functions */
int mktime(struct tm *);
int /*<<< orphan*/ printf(char *, int);
int main() {
  struct tm t;
  t.tm_sec = 1;
  t.tm_min = 2;
  t.tm_hour = 3;
  t.tm_mday = 29;
  t.tm_mon = 2;
  t.tm_year = 100;
  printf("%d\n", mktime(&t));
  t.tm_mday = 1;
  t.tm_mon = 3;
  t.tm_year = 102;
  printf("%d\n", mktime(&t));
  t.tm_mday = 1;
  t.tm_mon = 6;
  t.tm_year = 102;
  printf("%d\n", mktime(&t));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x20(%rbp)
movl   $0x2,-0x1c(%rbp)
movl   $0x3,-0x18(%rbp)
movl   $0x1d,-0x14(%rbp)
movl   $0x2,-0x10(%rbp)
movl   $0x64,-0xc(%rbp)
lea    -0x20(%rbp),%rdi
call   1040 <mktime@plt>
mov    %eax,%esi
lea    0xe95(%rip),%rdi
call   1030 <printf@plt>
movl   $0x1,-0x14(%rbp)
movl   $0x3,-0x10(%rbp)
movl   $0x66,-0xc(%rbp)
lea    -0x20(%rbp),%rdi
call   1040 <mktime@plt>
mov    %eax,%esi
lea    0xe69(%rip),%rdi
call   1030 <printf@plt>
movl   $0x1,-0x14(%rbp)
movl   $0x6,-0x10(%rbp)
movl   $0x66,-0xc(%rbp)
lea    -0x20(%rbp),%rdi
call   1040 <mktime@plt>
mov    %eax,%esi
lea    0xe3d(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x18,%rsp
movaps 0xed2(%rip),%xmm0
movups %xmm0,(%rsp)
movabs $0x6400000002,%rax
mov    %rax,0x10(%rsp)
mov    %rsp,%r14
mov    %r14,%rdi
call   1040 <mktime@plt>
lea    0xebd(%rip),%rbx
mov    %rbx,%rdi
mov    %eax,%esi
call   1030 <printf@plt>
movabs $0x300000001,%rax
mov    %rax,0xc(%rsp)
movl   $0x66,0x14(%rsp)
mov    %r14,%rdi
call   1040 <mktime@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1030 <printf@plt>
movabs $0x600000001,%rax
mov    %rax,0xc(%rsp)
movl   $0x66,0x14(%rsp)
mov    %r14,%rdi
call   1040 <mktime@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.tm = type { i32, i32, i32, i32, i32, i32 }
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca %struct.tm
store i32 0, i32* %1
%3 = getelementptr inbounds %struct.tm, %struct.tm* %2, i32 0, i32 0
store i32 1, i32* %3
%4 = getelementptr inbounds %struct.tm, %struct.tm* %2, i32 0, i32 1
store i32 2, i32* %4
%5 = getelementptr inbounds %struct.tm, %struct.tm* %2, i32 0, i32 2
store i32 3, i32* %5
%6 = getelementptr inbounds %struct.tm, %struct.tm* %2, i32 0, i32 3
store i32 29, i32* %6
%7 = getelementptr inbounds %struct.tm, %struct.tm* %2, i32 0, i32 4
store i32 2, i32* %7
%8 = getelementptr inbounds %struct.tm, %struct.tm* %2, i32 0, i32 5
store i32 100, i32* %8
%9 = call i32 @mktime(%struct.tm* %2)
%10 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %9)
%11 = getelementptr inbounds %struct.tm, %struct.tm* %2, i32 0, i32 3
store i32 1, i32* %11
%12 = getelementptr inbounds %struct.tm, %struct.tm* %2, i32 0, i32 4
store i32 3, i32* %12
%13 = getelementptr inbounds %struct.tm, %struct.tm* %2, i32 0, i32 5
store i32 102, i32* %13
%14 = call i32 @mktime(%struct.tm* %2)
%15 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %14)
%16 = getelementptr inbounds %struct.tm, %struct.tm* %2, i32 0, i32 3
store i32 1, i32* %16
%17 = getelementptr inbounds %struct.tm, %struct.tm* %2, i32 0, i32 4
store i32 6, i32* %17
%18 = getelementptr inbounds %struct.tm, %struct.tm* %2, i32 0, i32 5
store i32 102, i32* %18
%19 = call i32 @mktime(%struct.tm* %2)
%20 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %19)
ret i32 0
}

LLVM IR (-O2):
%struct.tm = type { i32, i32, i32, i32, i32, i32 }
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca %struct.tm
%2 = bitcast %struct.tm* %1 to i8*
%3 = getelementptr inbounds %struct.tm, %struct.tm* %1, i64 0, i32 0
store i32 1, i32* %3
%4 = getelementptr inbounds %struct.tm, %struct.tm* %1, i64 0, i32 1
store i32 2, i32* %4
%5 = getelementptr inbounds %struct.tm, %struct.tm* %1, i64 0, i32 2
store i32 3, i32* %5
%6 = getelementptr inbounds %struct.tm, %struct.tm* %1, i64 0, i32 3
store i32 29, i32* %6
%7 = getelementptr inbounds %struct.tm, %struct.tm* %1, i64 0, i32 4
store i32 2, i32* %7
%8 = getelementptr inbounds %struct.tm, %struct.tm* %1, i64 0, i32 5
store i32 100, i32* %8
%9 = call i32 @mktime(%struct.tm* %1)
%10 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %9)
store i32 1, i32* %6
store i32 3, i32* %7
store i32 102, i32* %8
%11 = call i32 @mktime(%struct.tm* %1)
%12 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %11)
store i32 1, i32* %6
store i32 6, i32* %7
store i32 102, i32* %8
%13 = call i32 @mktime(%struct.tm* %1)
%14 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %13)
ret i32 0
}