#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 {
  scalar_t__ tm_isdst;
};

/* Variables and functions */
int /*<<< orphan*/ mktime(struct tm *);
int /*<<< orphan*/ strcat(char *, char *);
int /*<<< orphan*/ strcpy(char *, char const *);
int /*<<< orphan*/ strptime(char *, char *, struct tm *);
time_t makeTsUtc(const char *dateTxt) {
  struct tm t;
  t.tm_isdst = 0;
  char dateTxtGmt[32];
  strcpy(dateTxtGmt, dateTxt);
  strcat(dateTxtGmt, " GMT");
  strptime(dateTxtGmt, "%Y-%m-%d %H:%M:%S %Z", &t);
  return mktime(&t);
}


x86 assembly (clang, -O0):
<makeTsUtc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
lea    -0x30(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
lea    -0x30(%rbp),%rdi
lea    0xe94(%rip),%rsi
call   1050 <strcat@plt>
lea    -0x30(%rbp),%rdi
lea    0xe89(%rip),%rsi
lea    -0x10(%rbp),%rdx
call   1060 <strptime@plt>
lea    -0x10(%rbp),%rdi
call   1040 <mktime@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<makeTsUtc>:
push   %r14
push   %rbx
sub    $0x38,%rsp
mov    %rdi,%rsi
movq   $0x0,0x8(%rsp)
lea    0x10(%rsp),%rbx
mov    %rbx,%rdi
call   1030 <strcpy@plt>
lea    0xe99(%rip),%rsi
mov    %rbx,%rdi
call   1050 <strcat@plt>
lea    0xe8f(%rip),%rsi
lea    0x8(%rsp),%r14
mov    %rbx,%rdi
mov    %r14,%rdx
call   1060 <strptime@plt>
mov    %r14,%rdi
call   1040 <mktime@plt>
add    $0x38,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.tm = type { i64 }
@.str = [5 x i8] c" GMT\00"
@.str.1 = [21 x i8] c"%Y-%m-%d %H:%M:%S %Z\00"
define i32 @makeTsUtc(i8* %0) {
%2 = alloca i8*
%3 = alloca %struct.tm
%4 = alloca [32 x i8]
store i8* %0, i8** %2
%5 = getelementptr inbounds %struct.tm, %struct.tm* %3, i32 0, i32 0
store i64 0, i64* %5
%6 = getelementptr inbounds [32 x i8], [32 x i8]* %4, i64 0, i64 0
%7 = load i8*, i8** %2
%8 = call i32 @strcpy(i8* %6, i8* %7)
%9 = getelementptr inbounds [32 x i8], [32 x i8]* %4, i64 0, i64 0
%10 = call i32 @strcat(i8* %9, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%11 = getelementptr inbounds [32 x i8], [32 x i8]* %4, i64 0, i64 0
%12 = call i32 @strptime(i8* %11, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0), %struct.tm* %3)
%13 = call i32 @mktime(%struct.tm* %3)
ret i32 %13
}

LLVM IR (-O2):
%struct.tm = type { i64 }
@.str = [5 x i8] c" GMT\00"
@.str.1 = [21 x i8] c"%Y-%m-%d %H:%M:%S %Z\00"
define i32 @makeTsUtc(i8* %0) {
%2 = alloca %struct.tm
%3 = alloca [32 x i8]
%4 = bitcast %struct.tm* %2 to i8*
%5 = getelementptr inbounds %struct.tm, %struct.tm* %2, i64 0, i32 0
store i64 0, i64* %5
%6 = getelementptr inbounds [32 x i8], [32 x i8]* %3, i64 0, i64 0
%7 = call i32 @strcpy(i8* %6, i8* %0)
%8 = call i32 @strcat(i8* %6, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%9 = call i32 @strptime(i8* %6, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0), %struct.tm* %2)
%10 = call i32 @mktime(%struct.tm* %2)
ret i32 %10
}