#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_isdst;
  void *tm_sec;
  void *tm_min;
  void *tm_hour;
  void *tm_mday;
  void *tm_mon;
  void *tm_year;
};

/* Variables and functions */
void *atoi(int /*<<< orphan*/);
int /*<<< orphan*/ mktime(struct tm *);
int /*<<< orphan*/ strncpy(char *, char *, int);
time_t getTime(char s[], int y, int m, int d, int hr, int mn, int sc, int os) {
  char temp[16];
  struct tm t_tm;
  time_t t_time;
  t_tm.tm_year = atoi(strncpy(temp, s + y, 4)) - 1900;
  temp[2] = '\0';
  t_tm.tm_mon = atoi(strncpy(temp, s + m, 2)) - 1;
  t_tm.tm_mday = atoi(strncpy(temp, s + d, 2));
  t_tm.tm_hour = atoi(strncpy(temp, s + hr, 2));
  t_tm.tm_min = atoi(strncpy(temp, s + mn, 2));
  t_tm.tm_sec = atoi(strncpy(temp, s + sc, 2)) + os;
  t_tm.tm_isdst = -1;
  t_time = mktime(&t_tm);
  return t_time;
}


x86 assembly (clang, -O0):
<getTime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
mov    0x18(%rbp),%eax
mov    0x10(%rbp),%eax
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8d,-0x18(%rbp)
mov    %r9d,-0x1c(%rbp)
lea    -0x30(%rbp),%rdi
mov    -0x8(%rbp),%rsi
movslq -0xc(%rbp),%rax
add    %rax,%rsi
mov    $0x4,%edx
call   1030 <strncpy@plt>
mov    %eax,%edi
call   1050 <atoi@plt>
add    $0xfffffffffffff894,%rax
mov    %rax,-0x38(%rbp)
movb   $0x0,-0x2e(%rbp)
lea    -0x30(%rbp),%rdi
mov    -0x8(%rbp),%rsi
movslq -0x10(%rbp),%rax
add    %rax,%rsi
mov    $0x2,%edx
call   1030 <strncpy@plt>
mov    %eax,%edi
call   1050 <atoi@plt>
add    $0xffffffffffffffff,%rax
mov    %rax,-0x40(%rbp)
lea    -0x30(%rbp),%rdi
mov    -0x8(%rbp),%rsi
movslq -0x14(%rbp),%rax
add    %rax,%rsi
mov    $0x2,%edx
call   1030 <strncpy@plt>
mov    %eax,%edi
call   1050 <atoi@plt>
mov    %rax,-0x48(%rbp)
lea    -0x30(%rbp),%rdi
mov    -0x8(%rbp),%rsi
movslq -0x18(%rbp),%rax
add    %rax,%rsi
mov    $0x2,%edx
call   1030 <strncpy@plt>
mov    %eax,%edi
call   1050 <atoi@plt>
mov    %rax,-0x50(%rbp)
lea    -0x30(%rbp),%rdi
mov    -0x8(%rbp),%rsi
movslq -0x1c(%rbp),%rax
add    %rax,%rsi
mov    $0x2,%edx
call   1030 <strncpy@plt>
mov    %eax,%edi
call   1050 <atoi@plt>
mov    %rax,-0x58(%rbp)
lea    -0x30(%rbp),%rdi
mov    -0x8(%rbp),%rsi
movslq 0x10(%rbp),%rax
add    %rax,%rsi
mov    $0x2,%edx
call   1030 <strncpy@plt>
mov    %eax,%edi
call   1050 <atoi@plt>
movslq 0x18(%rbp),%rcx
add    %rcx,%rax
mov    %rax,-0x60(%rbp)
movl   $0xffffffff,-0x68(%rbp)
lea    -0x68(%rbp),%rdi
call   1040 <mktime@plt>
mov    %eax,-0x6c(%rbp)
mov    -0x6c(%rbp),%eax
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getTime>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x58,%rsp
mov    %r9d,0x4(%rsp)
mov    %r8d,(%rsp)
mov    %ecx,%ebp
mov    %edx,%r12d
mov    %rdi,%rbx
movslq 0x98(%rsp),%rax
mov    %rax,0x8(%rsp)
movslq 0x90(%rsp),%r14
movslq %esi,%rsi
add    %rdi,%rsi
lea    0x10(%rsp),%r15
mov    %r15,%rdi
mov    $0x4,%edx
call   1030 <strncpy@plt>
mov    %eax,%edi
call   1050 <atoi@plt>
mov    %rax,%r13
movb   $0x0,0x12(%rsp)
movslq %r12d,%rsi
add    %rbx,%rsi
mov    %r15,%rdi
mov    $0x2,%edx
call   1030 <strncpy@plt>
mov    %eax,%edi
call   1050 <atoi@plt>
movq   %r13,%xmm0
movq   %rax,%xmm1
punpcklqdq %xmm0,%xmm1
paddq  0xe45(%rip),%xmm1
movdqu %xmm1,0x48(%rsp)
movslq %ebp,%rsi
add    %rbx,%rsi
mov    %r15,%rdi
mov    $0x2,%edx
call   1030 <strncpy@plt>
mov    %eax,%edi
call   1050 <atoi@plt>
mov    %rax,0x40(%rsp)
movslq (%rsp),%rsi
add    %rbx,%rsi
mov    %r15,%rdi
mov    $0x2,%edx
call   1030 <strncpy@plt>
mov    %eax,%edi
call   1050 <atoi@plt>
mov    %rax,0x38(%rsp)
movslq 0x4(%rsp),%rsi
add    %rbx,%rsi
mov    %r15,%rdi
mov    $0x2,%edx
call   1030 <strncpy@plt>
mov    %eax,%edi
call   1050 <atoi@plt>
mov    %rax,0x30(%rsp)
add    %rbx,%r14
mov    %r15,%rdi
mov    %r14,%rsi
mov    $0x2,%edx
call   1030 <strncpy@plt>
mov    %eax,%edi
call   1050 <atoi@plt>
add    0x8(%rsp),%rax
mov    %rax,0x28(%rsp)
movl   $0xffffffff,0x20(%rsp)
ff
lea    0x20(%rsp),%rdi
call   1040 <mktime@plt>
add    $0x58,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
%struct.tm = type { i32, i8*, i8*, i8*, i8*, i8*, i8* }
define i32 @getTime(i8* %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5, i32 %6, i32 %7) {
%9 = alloca i8*
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
%15 = alloca i32
%16 = alloca i32
%17 = alloca [16 x i8]
%18 = alloca %struct.tm
%19 = alloca i32
store i8* %0, i8** %9
store i32 %1, i32* %10
store i32 %2, i32* %11
store i32 %3, i32* %12
store i32 %4, i32* %13
store i32 %5, i32* %14
store i32 %6, i32* %15
store i32 %7, i32* %16
%20 = getelementptr inbounds [16 x i8], [16 x i8]* %17, i64 0, i64 0
%21 = load i8*, i8** %9
%22 = load i32, i32* %10
%23 = sext i32 %22 to i64
%24 = getelementptr inbounds i8, i8* %21, i64 %23
%25 = call i32 @strncpy(i8* %20, i8* %24, i32 4)
%26 = call i8* @atoi(i32 %25)
%27 = getelementptr i8, i8* %26, i64 -1900
%28 = getelementptr inbounds %struct.tm, %struct.tm* %18, i32 0, i32 6
store i8* %27, i8** %28
%29 = getelementptr inbounds [16 x i8], [16 x i8]* %17, i64 0, i64 2
store i8 0, i8* %29
%30 = getelementptr inbounds [16 x i8], [16 x i8]* %17, i64 0, i64 0
%31 = load i8*, i8** %9
%32 = load i32, i32* %11
%33 = sext i32 %32 to i64
%34 = getelementptr inbounds i8, i8* %31, i64 %33
%35 = call i32 @strncpy(i8* %30, i8* %34, i32 2)
%36 = call i8* @atoi(i32 %35)
%37 = getelementptr i8, i8* %36, i64 -1
%38 = getelementptr inbounds %struct.tm, %struct.tm* %18, i32 0, i32 5
store i8* %37, i8** %38
%39 = getelementptr inbounds [16 x i8], [16 x i8]* %17, i64 0, i64 0
%40 = load i8*, i8** %9
%41 = load i32, i32* %12
%42 = sext i32 %41 to i64
%43 = getelementptr inbounds i8, i8* %40, i64 %42
%44 = call i32 @strncpy(i8* %39, i8* %43, i32 2)
%45 = call i8* @atoi(i32 %44)
%46 = getelementptr inbounds %struct.tm, %struct.tm* %18, i32 0, i32 4
store i8* %45, i8** %46
%47 = getelementptr inbounds [16 x i8], [16 x i8]* %17, i64 0, i64 0
%48 = load i8*, i8** %9
%49 = load i32, i32* %13
%50 = sext i32 %49 to i64
%51 = getelementptr inbounds i8, i8* %48, i64 %50
%52 = call i32 @strncpy(i8* %47, i8* %51, i32 2)
%53 = call i8* @atoi(i32 %52)
%54 = getelementptr inbounds %struct.tm, %struct.tm* %18, i32 0, i32 3
store i8* %53, i8** %54
%55 = getelementptr inbounds [16 x i8], [16 x i8]* %17, i64 0, i64 0
%56 = load i8*, i8** %9
%57 = load i32, i32* %14
%58 = sext i32 %57 to i64
%59 = getelementptr inbounds i8, i8* %56, i64 %58
%60 = call i32 @strncpy(i8* %55, i8* %59, i32 2)
%61 = call i8* @atoi(i32 %60)
%62 = getelementptr inbounds %struct.tm, %struct.tm* %18, i32 0, i32 2
store i8* %61, i8** %62
%63 = getelementptr inbounds [16 x i8], [16 x i8]* %17, i64 0, i64 0
%64 = load i8*, i8** %9
%65 = load i32, i32* %15
%66 = sext i32 %65 to i64
%67 = getelementptr inbounds i8, i8* %64, i64 %66
%68 = call i32 @strncpy(i8* %63, i8* %67, i32 2)
%69 = call i8* @atoi(i32 %68)
%70 = load i32, i32* %16
%71 = sext i32 %70 to i64
%72 = getelementptr i8, i8* %69, i64 %71
%73 = getelementptr inbounds %struct.tm, %struct.tm* %18, i32 0, i32 1
store i8* %72, i8** %73
%74 = getelementptr inbounds %struct.tm, %struct.tm* %18, i32 0, i32 0
store i32 -1, i32* %74
%75 = call i32 @mktime(%struct.tm* %18)
store i32 %75, i32* %19
%76 = load i32, i32* %19
ret i32 %76
}

LLVM IR (-O2):
%struct.tm = type { i32, i8*, i8*, i8*, i8*, i8*, i8* }
define i32 @getTime(i8* %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5, i32 %6, i32 %7) {
%9 = alloca [16 x i8]
%10 = alloca %struct.tm
%11 = getelementptr inbounds [16 x i8], [16 x i8]* %9, i64 0, i64 0
%12 = bitcast %struct.tm* %10 to i8*
%13 = sext i32 %1 to i64
%14 = getelementptr inbounds i8, i8* %0, i64 %13
%15 = call i32 @strncpy(i8* %11, i8* %14, i32 4)
%16 = call i8* @atoi(i32 %15)
%17 = getelementptr inbounds [16 x i8], [16 x i8]* %9, i64 0, i64 2
store i8 0, i8* %17
%18 = sext i32 %2 to i64
%19 = getelementptr inbounds i8, i8* %0, i64 %18
%20 = call i32 @strncpy(i8* %11, i8* %19, i32 2)
%21 = call i8* @atoi(i32 %20)
%22 = insertelement <2 x i8*> poison, i8* %21, i64 0
%23 = insertelement <2 x i8*> %22, i8* %16, i64 1
%24 = getelementptr i8, <2 x i8*> %23, <2 x i64> <i64 -1, i64 -1900>
%25 = getelementptr inbounds %struct.tm, %struct.tm* %10, i64 0, i32 5
%26 = bitcast i8** %25 to <2 x i8*>*
store <2 x i8*> %24, <2 x i8*>* %26
%27 = sext i32 %3 to i64
%28 = getelementptr inbounds i8, i8* %0, i64 %27
%29 = call i32 @strncpy(i8* %11, i8* %28, i32 2)
%30 = call i8* @atoi(i32 %29)
%31 = getelementptr inbounds %struct.tm, %struct.tm* %10, i64 0, i32 4
store i8* %30, i8** %31
%32 = sext i32 %4 to i64
%33 = getelementptr inbounds i8, i8* %0, i64 %32
%34 = call i32 @strncpy(i8* %11, i8* %33, i32 2)
%35 = call i8* @atoi(i32 %34)
%36 = getelementptr inbounds %struct.tm, %struct.tm* %10, i64 0, i32 3
store i8* %35, i8** %36
%37 = sext i32 %5 to i64
%38 = getelementptr inbounds i8, i8* %0, i64 %37
%39 = call i32 @strncpy(i8* %11, i8* %38, i32 2)
%40 = call i8* @atoi(i32 %39)
%41 = getelementptr inbounds %struct.tm, %struct.tm* %10, i64 0, i32 2
store i8* %40, i8** %41
%42 = sext i32 %6 to i64
%43 = getelementptr inbounds i8, i8* %0, i64 %42
%44 = call i32 @strncpy(i8* %11, i8* %43, i32 2)
%45 = call i8* @atoi(i32 %44)
%46 = sext i32 %7 to i64
%47 = getelementptr i8, i8* %45, i64 %46
%48 = getelementptr inbounds %struct.tm, %struct.tm* %10, i64 0, i32 1
store i8* %47, i8** %48
%49 = getelementptr inbounds %struct.tm, %struct.tm* %10, i64 0, i32 0
store i32 -1, i32* %49
%50 = call i32 @mktime(%struct.tm* %10)
ret i32 %50
}