#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 {
  int tm_year;
  int tm_mon;
  int tm_mday;
  int tm_hour;
  int tm_min;
  int tm_sec;
  int tm_isdst;
};

/* Variables and functions */
int /*<<< orphan*/ mktime(struct tm *);
scalar_t__ strtol(char *, char **, int);
time_t strdt2tmt(char *yyyy, char *mm, char *dd, char *hh, char *min,
                 char *sec) {
  time_t tm_t;
  struct tm dtm;
  char *end;
  dtm.tm_year = ((int)strtol(yyyy, &end, 10)) - 1900;
  dtm.tm_mon = ((int)strtol(mm, &end, 10)) - 1;
  dtm.tm_mday = ((int)strtol(dd, &end, 10));
  dtm.tm_hour = ((int)strtol(hh, &end, 10));
  dtm.tm_min = ((int)strtol(min, &end, 10));
  dtm.tm_sec = ((int)strtol(sec, &end, 10));
  dtm.tm_isdst = -1;
  tm_t = mktime(&dtm);
  return tm_t;
}


x86 assembly (clang, -O0):
<strdt2tmt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
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),%rdi
lea    -0x58(%rbp),%rsi
mov    $0xa,%edx
call   1030 <strtol@plt>
sub    $0x76c,%eax
mov    %eax,-0x50(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x58(%rbp),%rsi
mov    $0xa,%edx
call   1030 <strtol@plt>
sub    $0x1,%eax
mov    %eax,-0x4c(%rbp)
mov    -0x18(%rbp),%rdi
lea    -0x58(%rbp),%rsi
mov    $0xa,%edx
call   1030 <strtol@plt>
mov    %eax,-0x48(%rbp)
mov    -0x20(%rbp),%rdi
lea    -0x58(%rbp),%rsi
mov    $0xa,%edx
call   1030 <strtol@plt>
mov    %eax,-0x44(%rbp)
mov    -0x28(%rbp),%rdi
lea    -0x58(%rbp),%rsi
mov    $0xa,%edx
call   1030 <strtol@plt>
mov    %eax,-0x40(%rbp)
mov    -0x30(%rbp),%rdi
lea    -0x58(%rbp),%rsi
mov    $0xa,%edx
call   1030 <strtol@plt>
mov    %eax,-0x3c(%rbp)
movl   $0xffffffff,-0x38(%rbp)
lea    -0x50(%rbp),%rdi
call   1040 <mktime@plt>
mov    %eax,-0x34(%rbp)
mov    -0x34(%rbp),%eax
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strdt2tmt>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x28,%rsp
mov    %r9,%r14
mov    %r8,%r15
mov    %rcx,%r12
mov    %rdx,%r13
mov    %rsi,%rbp
lea    0x20(%rsp),%rbx
mov    %rbx,%rsi
mov    $0xa,%edx
call   1030 <strtol@plt>
add    $0xfffff894,%eax
mov    %eax,(%rsp)
mov    %rbp,%rdi
mov    %rbx,%rsi
mov    $0xa,%edx
call   1030 <strtol@plt>
add    $0xffffffff,%eax
mov    %eax,0x4(%rsp)
mov    %r13,%rdi
mov    %rbx,%rsi
mov    $0xa,%edx
call   1030 <strtol@plt>
mov    %eax,0x8(%rsp)
mov    %r12,%rdi
mov    %rbx,%rsi
mov    $0xa,%edx
call   1030 <strtol@plt>
mov    %eax,0xc(%rsp)
mov    %r15,%rdi
mov    %rbx,%rsi
mov    $0xa,%edx
call   1030 <strtol@plt>
mov    %eax,0x10(%rsp)
mov    %r14,%rdi
mov    %rbx,%rsi
mov    $0xa,%edx
call   1030 <strtol@plt>
mov    %eax,0x14(%rsp)
movl   $0xffffffff,0x18(%rsp)
ff
mov    %rsp,%rdi
call   1040 <mktime@plt>
add    $0x28,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
%struct.tm = type { i32, i32, i32, i32, i32, i32, i32 }
define i32 @strdt2tmt(i8* %0, i8* %1, i8* %2, i8* %3, i8* %4, i8* %5) {
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca i8*
%10 = alloca i8*
%11 = alloca i8*
%12 = alloca i8*
%13 = alloca i32
%14 = alloca %struct.tm
%15 = alloca i8*
store i8* %0, i8** %7
store i8* %1, i8** %8
store i8* %2, i8** %9
store i8* %3, i8** %10
store i8* %4, i8** %11
store i8* %5, i8** %12
%16 = load i8*, i8** %7
%17 = call i64 @strtol(i8* %16, i8** %15, i32 10)
%18 = trunc i64 %17 to i32
%19 = sub nsw i32 %18, 1900
%20 = getelementptr inbounds %struct.tm, %struct.tm* %14, i32 0, i32 0
store i32 %19, i32* %20
%21 = load i8*, i8** %8
%22 = call i64 @strtol(i8* %21, i8** %15, i32 10)
%23 = trunc i64 %22 to i32
%24 = sub nsw i32 %23, 1
%25 = getelementptr inbounds %struct.tm, %struct.tm* %14, i32 0, i32 1
store i32 %24, i32* %25
%26 = load i8*, i8** %9
%27 = call i64 @strtol(i8* %26, i8** %15, i32 10)
%28 = trunc i64 %27 to i32
%29 = getelementptr inbounds %struct.tm, %struct.tm* %14, i32 0, i32 2
store i32 %28, i32* %29
%30 = load i8*, i8** %10
%31 = call i64 @strtol(i8* %30, i8** %15, i32 10)
%32 = trunc i64 %31 to i32
%33 = getelementptr inbounds %struct.tm, %struct.tm* %14, i32 0, i32 3
store i32 %32, i32* %33
%34 = load i8*, i8** %11
%35 = call i64 @strtol(i8* %34, i8** %15, i32 10)
%36 = trunc i64 %35 to i32
%37 = getelementptr inbounds %struct.tm, %struct.tm* %14, i32 0, i32 4
store i32 %36, i32* %37
%38 = load i8*, i8** %12
%39 = call i64 @strtol(i8* %38, i8** %15, i32 10)
%40 = trunc i64 %39 to i32
%41 = getelementptr inbounds %struct.tm, %struct.tm* %14, i32 0, i32 5
store i32 %40, i32* %41
%42 = getelementptr inbounds %struct.tm, %struct.tm* %14, i32 0, i32 6
store i32 -1, i32* %42
%43 = call i32 @mktime(%struct.tm* %14)
store i32 %43, i32* %13
%44 = load i32, i32* %13
ret i32 %44
}

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