#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 */
typedef int /*<<< orphan*/ time_t;
struct tm {
  void *tm_isdst;
  void *tm_sec;
  void *tm_min;
  void *tm_hour;
  void *tm_mday;
  void *tm_mon;
  void *tm_year;
};
typedef void *int32_t;

/* Variables and functions */
int /*<<< orphan*/ mktime(struct tm *);
time_t MakeTimeT(int32_t year, int32_t month, int32_t day, int32_t hour,
                 int32_t minute, int32_t second, int32_t isDst) {
  struct tm currentTm;
  currentTm.tm_year = year - 1900;
  currentTm.tm_mon = month - 1;
  currentTm.tm_mday = day;
  currentTm.tm_hour = hour;
  currentTm.tm_min = minute;
  currentTm.tm_sec = second;
  currentTm.tm_isdst = isDst;
  return mktime(&currentTm);
}


x86 assembly (clang, -O0):
<MakeTimeT>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
mov    0x10(%rbp),%rax
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
mov    -0x8(%rbp),%rax
add    $0xfffffffffffff894,%rax
mov    %rax,-0x38(%rbp)
mov    -0x10(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x40(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x48(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,-0x50(%rbp)
mov    -0x28(%rbp),%rax
mov    %rax,-0x58(%rbp)
mov    -0x30(%rbp),%rax
mov    %rax,-0x60(%rbp)
mov    0x10(%rbp),%rax
mov    %rax,-0x68(%rbp)
lea    -0x68(%rbp),%rdi
call   1030 <mktime@plt>
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<MakeTimeT>:
sub    $0x38,%rsp
mov    0x40(%rsp),%rax
movq   %rdi,%xmm0
movq   %rsi,%xmm1
punpcklqdq %xmm0,%xmm1
paddq  0xed1(%rip),%xmm1
movdqu %xmm1,0x28(%rsp)
mov    %rdx,0x20(%rsp)
mov    %rcx,0x18(%rsp)
mov    %r8,0x10(%rsp)
mov    %r9,0x8(%rsp)
mov    %rax,(%rsp)
mov    %rsp,%rdi
call   1030 <mktime@plt>
add    $0x38,%rsp
ret

LLVM IR (-O0):
%struct.tm = type { i8*, i8*, i8*, i8*, i8*, i8*, i8* }
define i32 @MakeTimeT(i8* %0, i8* %1, i8* %2, i8* %3, i8* %4, i8* %5, i8* %6) {
%8 = alloca i8*
%9 = alloca i8*
%10 = alloca i8*
%11 = alloca i8*
%12 = alloca i8*
%13 = alloca i8*
%14 = alloca i8*
%15 = alloca %struct.tm
store i8* %0, i8** %8
store i8* %1, i8** %9
store i8* %2, i8** %10
store i8* %3, i8** %11
store i8* %4, i8** %12
store i8* %5, i8** %13
store i8* %6, i8** %14
%16 = load i8*, i8** %8
%17 = getelementptr i8, i8* %16, i64 -1900
%18 = getelementptr inbounds %struct.tm, %struct.tm* %15, i32 0, i32 6
store i8* %17, i8** %18
%19 = load i8*, i8** %9
%20 = getelementptr i8, i8* %19, i64 -1
%21 = getelementptr inbounds %struct.tm, %struct.tm* %15, i32 0, i32 5
store i8* %20, i8** %21
%22 = load i8*, i8** %10
%23 = getelementptr inbounds %struct.tm, %struct.tm* %15, i32 0, i32 4
store i8* %22, i8** %23
%24 = load i8*, i8** %11
%25 = getelementptr inbounds %struct.tm, %struct.tm* %15, i32 0, i32 3
store i8* %24, i8** %25
%26 = load i8*, i8** %12
%27 = getelementptr inbounds %struct.tm, %struct.tm* %15, i32 0, i32 2
store i8* %26, i8** %27
%28 = load i8*, i8** %13
%29 = getelementptr inbounds %struct.tm, %struct.tm* %15, i32 0, i32 1
store i8* %28, i8** %29
%30 = load i8*, i8** %14
%31 = getelementptr inbounds %struct.tm, %struct.tm* %15, i32 0, i32 0
store i8* %30, i8** %31
%32 = call i32 @mktime(%struct.tm* %15)
ret i32 %32
}

LLVM IR (-O2):
%struct.tm = type { i8*, i8*, i8*, i8*, i8*, i8*, i8* }
define i32 @MakeTimeT(i8* %0, i8* %1, i8* %2, i8* %3, i8* %4, i8* %5, i8* %6) {
%8 = alloca %struct.tm
%9 = bitcast %struct.tm* %8 to i8*
%10 = insertelement <2 x i8*> poison, i8* %1, i64 0
%11 = insertelement <2 x i8*> %10, i8* %0, i64 1
%12 = getelementptr i8, <2 x i8*> %11, <2 x i64> <i64 -1, i64 -1900>
%13 = getelementptr inbounds %struct.tm, %struct.tm* %8, i64 0, i32 5
%14 = bitcast i8** %13 to <2 x i8*>*
store <2 x i8*> %12, <2 x i8*>* %14
%15 = getelementptr inbounds %struct.tm, %struct.tm* %8, i64 0, i32 4
store i8* %2, i8** %15
%16 = getelementptr inbounds %struct.tm, %struct.tm* %8, i64 0, i32 3
store i8* %3, i8** %16
%17 = getelementptr inbounds %struct.tm, %struct.tm* %8, i64 0, i32 2
store i8* %4, i8** %17
%18 = getelementptr inbounds %struct.tm, %struct.tm* %8, i64 0, i32 1
store i8* %5, i8** %18
%19 = getelementptr inbounds %struct.tm, %struct.tm* %8, i64 0, i32 0
store i8* %6, i8** %19
%20 = call i32 @mktime(%struct.tm* %8)
ret i32 %20
}