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

/* Variables and functions */
scalar_t__ mktime(struct tm *);
int /*<<< orphan*/ sscanf(char *, char *, int *);
int /*<<< orphan*/ strncpy(char *, char *, int);
long isotime(char *t_obs) {
  int year, month, day;
  int hour, minute, second;
  char s_year[5], s_month[3], s_day[3];
  char s_hour[3], s_minute[3], s_second[3];
  struct tm unix_time;
  time_t t_obs_secs;
  strncpy(s_year, t_obs, 4);
  strncpy(s_month, t_obs + 5, 2);
  strncpy(s_day, t_obs + 8, 2);
  strncpy(s_hour, t_obs + 11, 2);
  strncpy(s_minute, t_obs + 14, 2);
  strncpy(s_second, t_obs + 17, 2);
  s_year[4] = '\0';
  s_month[2] = '\0';
  s_day[2] = '\0';
  s_hour[2] = '\0';
  s_minute[2] = '\0';
  s_second[2] = '\0';
  sscanf(s_year, "%d", &year);
  sscanf(s_month, "%d", &month);
  sscanf(s_day, "%d", &day);
  sscanf(s_hour, "%d", &hour);
  sscanf(s_minute, "%d", &minute);
  sscanf(s_second, "%d", &second);
  unix_time.tm_year = year - 1900;
  unix_time.tm_mon = month - 1;
  unix_time.tm_mday = day;
  unix_time.tm_hour = hour;
  unix_time.tm_min = minute;
  unix_time.tm_sec = second;
  unix_time.tm_isdst = 0;
  t_obs_secs = mktime(&unix_time);
  return (long)t_obs_secs;
}


x86 assembly (clang, -O0):
<isotime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0x25(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    $0x4,%edx
call   1030 <strncpy@plt>
lea    -0x28(%rbp),%rdi
mov    -0x8(%rbp),%rsi
add    $0x5,%rsi
mov    $0x2,%edx
call   1030 <strncpy@plt>
lea    -0x2b(%rbp),%rdi
mov    -0x8(%rbp),%rsi
add    $0x8,%rsi
mov    $0x2,%edx
call   1030 <strncpy@plt>
lea    -0x2e(%rbp),%rdi
mov    -0x8(%rbp),%rsi
add    $0xb,%rsi
mov    $0x2,%edx
call   1030 <strncpy@plt>
lea    -0x31(%rbp),%rdi
mov    -0x8(%rbp),%rsi
add    $0xe,%rsi
mov    $0x2,%edx
call   1030 <strncpy@plt>
lea    -0x34(%rbp),%rdi
mov    -0x8(%rbp),%rsi
add    $0x11,%rsi
mov    $0x2,%edx
call   1030 <strncpy@plt>
movb   $0x0,-0x21(%rbp)
movb   $0x0,-0x26(%rbp)
movb   $0x0,-0x29(%rbp)
movb   $0x0,-0x2c(%rbp)
movb   $0x0,-0x2f(%rbp)
movb   $0x0,-0x32(%rbp)
lea    -0x25(%rbp),%rdi
lea    0xe21(%rip),%rsi
lea    -0xc(%rbp),%rdx
call   1040 <sscanf@plt>
lea    -0x28(%rbp),%rdi
lea    0xe0d(%rip),%rsi
lea    -0x10(%rbp),%rdx
call   1040 <sscanf@plt>
lea    -0x2b(%rbp),%rdi
lea    0xdf9(%rip),%rsi
lea    -0x14(%rbp),%rdx
call   1040 <sscanf@plt>
lea    -0x2e(%rbp),%rdi
lea    0xde5(%rip),%rsi
lea    -0x18(%rbp),%rdx
call   1040 <sscanf@plt>
lea    -0x31(%rbp),%rdi
lea    0xdd1(%rip),%rsi
lea    -0x1c(%rbp),%rdx
call   1040 <sscanf@plt>
lea    -0x34(%rbp),%rdi
lea    0xdbd(%rip),%rsi
lea    -0x20(%rbp),%rdx
call   1040 <sscanf@plt>
mov    -0xc(%rbp),%eax
sub    $0x76c,%eax
mov    %eax,-0x58(%rbp)
mov    -0x10(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x54(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x50(%rbp)
mov    -0x18(%rbp),%eax
mov    %eax,-0x4c(%rbp)
mov    -0x1c(%rbp),%eax
mov    %eax,-0x48(%rbp)
mov    -0x20(%rbp),%eax
mov    %eax,-0x44(%rbp)
movq   $0x0,-0x40(%rbp)
lea    -0x58(%rbp),%rdi
call   1050 <mktime@plt>
mov    %rax,-0x60(%rbp)
mov    -0x60(%rbp),%rax
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isotime>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x58,%rsp
mov    %rdi,%r14
lea    0x1b(%rsp),%rdi
mov    %r14,%rsi
mov    $0x4,%edx
call   1030 <strncpy@plt>
lea    0x5(%r14),%rsi
lea    0xc(%rsp),%rdi
mov    $0x2,%edx
call   1030 <strncpy@plt>
lea    0x8(%r14),%rsi
lea    0x18(%rsp),%r12
mov    %r12,%rdi
mov    $0x2,%edx
call   1030 <strncpy@plt>
lea    0xb(%r14),%rsi
lea    0x15(%rsp),%r13
mov    %r13,%rdi
mov    $0x2,%edx
call   1030 <strncpy@plt>
lea    0xe(%r14),%rsi
lea    0x12(%rsp),%r15
mov    %r15,%rdi
mov    $0x2,%edx
call   1030 <strncpy@plt>
add    $0x11,%r14
lea    0xf(%rsp),%rbp
mov    %rbp,%rdi
mov    %r14,%rsi
mov    $0x2,%edx
call   1030 <strncpy@plt>
movb   $0x0,0x1f(%rsp)
movb   $0x0,0xe(%rsp)
movb   $0x0,0x1a(%rsp)
movb   $0x0,0x17(%rsp)
movb   $0x0,0x14(%rsp)
movb   $0x0,0x11(%rsp)
lea    0xe1a(%rip),%rbx
lea    0x34(%rsp),%rdx
lea    0x1b(%rsp),%rdi
mov    %rbx,%rsi
call   1040 <sscanf@plt>
lea    0x30(%rsp),%rdx
lea    0xc(%rsp),%rdi
mov    %rbx,%rsi
call   1040 <sscanf@plt>
lea    0x2c(%rsp),%rdx
mov    %r12,%rdi
mov    %rbx,%rsi
call   1040 <sscanf@plt>
lea    0x28(%rsp),%rdx
mov    %r13,%rdi
mov    %rbx,%rsi
call   1040 <sscanf@plt>
lea    0x24(%rsp),%rdx
mov    %r15,%rdi
mov    %rbx,%rsi
call   1040 <sscanf@plt>
lea    0x20(%rsp),%rdx
mov    %rbp,%rdi
mov    %rbx,%rsi
call   1040 <sscanf@plt>
mov    $0xfffff894,%eax
add    0x34(%rsp),%eax
mov    %eax,0x38(%rsp)
mov    0x30(%rsp),%eax
add    $0xffffffff,%eax
mov    %eax,0x3c(%rsp)
mov    0x2c(%rsp),%eax
mov    %eax,0x40(%rsp)
mov    0x28(%rsp),%eax
mov    %eax,0x44(%rsp)
mov    0x24(%rsp),%eax
mov    %eax,0x48(%rsp)
mov    0x20(%rsp),%eax
mov    %eax,0x4c(%rsp)
movq   $0x0,0x50(%rsp)
lea    0x38(%rsp),%rdi
call   1050 <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, i32, i32, i32, i32, i32, i64 }
@.str = [3 x i8] c"%d\00"
define i64 @isotime(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca [5 x i8]
%10 = alloca [3 x i8]
%11 = alloca [3 x i8]
%12 = alloca [3 x i8]
%13 = alloca [3 x i8]
%14 = alloca [3 x i8]
%15 = alloca %struct.tm
%16 = alloca i64
store i8* %0, i8** %2
%17 = getelementptr inbounds [5 x i8], [5 x i8]* %9, i64 0, i64 0
%18 = load i8*, i8** %2
%19 = call i32 @strncpy(i8* %17, i8* %18, i32 4)
%20 = getelementptr inbounds [3 x i8], [3 x i8]* %10, i64 0, i64 0
%21 = load i8*, i8** %2
%22 = getelementptr inbounds i8, i8* %21, i64 5
%23 = call i32 @strncpy(i8* %20, i8* %22, i32 2)
%24 = getelementptr inbounds [3 x i8], [3 x i8]* %11, i64 0, i64 0
%25 = load i8*, i8** %2
%26 = getelementptr inbounds i8, i8* %25, i64 8
%27 = call i32 @strncpy(i8* %24, i8* %26, i32 2)
%28 = getelementptr inbounds [3 x i8], [3 x i8]* %12, i64 0, i64 0
%29 = load i8*, i8** %2
%30 = getelementptr inbounds i8, i8* %29, i64 11
%31 = call i32 @strncpy(i8* %28, i8* %30, i32 2)
%32 = getelementptr inbounds [3 x i8], [3 x i8]* %13, i64 0, i64 0
%33 = load i8*, i8** %2
%34 = getelementptr inbounds i8, i8* %33, i64 14
%35 = call i32 @strncpy(i8* %32, i8* %34, i32 2)
%36 = getelementptr inbounds [3 x i8], [3 x i8]* %14, i64 0, i64 0
%37 = load i8*, i8** %2
%38 = getelementptr inbounds i8, i8* %37, i64 17
%39 = call i32 @strncpy(i8* %36, i8* %38, i32 2)
%40 = getelementptr inbounds [5 x i8], [5 x i8]* %9, i64 0, i64 4
store i8 0, i8* %40
%41 = getelementptr inbounds [3 x i8], [3 x i8]* %10, i64 0, i64 2
store i8 0, i8* %41
%42 = getelementptr inbounds [3 x i8], [3 x i8]* %11, i64 0, i64 2
store i8 0, i8* %42
%43 = getelementptr inbounds [3 x i8], [3 x i8]* %12, i64 0, i64 2
store i8 0, i8* %43
%44 = getelementptr inbounds [3 x i8], [3 x i8]* %13, i64 0, i64 2
store i8 0, i8* %44
%45 = getelementptr inbounds [3 x i8], [3 x i8]* %14, i64 0, i64 2
store i8 0, i8* %45
%46 = getelementptr inbounds [5 x i8], [5 x i8]* %9, i64 0, i64 0
%47 = call i32 @sscanf(i8* %46, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %3)
%48 = getelementptr inbounds [3 x i8], [3 x i8]* %10, i64 0, i64 0
%49 = call i32 @sscanf(i8* %48, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %4)
%50 = getelementptr inbounds [3 x i8], [3 x i8]* %11, i64 0, i64 0
%51 = call i32 @sscanf(i8* %50, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %5)
%52 = getelementptr inbounds [3 x i8], [3 x i8]* %12, i64 0, i64 0
%53 = call i32 @sscanf(i8* %52, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %6)
%54 = getelementptr inbounds [3 x i8], [3 x i8]* %13, i64 0, i64 0
%55 = call i32 @sscanf(i8* %54, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %7)
%56 = getelementptr inbounds [3 x i8], [3 x i8]* %14, i64 0, i64 0
%57 = call i32 @sscanf(i8* %56, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %8)
%58 = load i32, i32* %3
%59 = sub nsw i32 %58, 1900
%60 = getelementptr inbounds %struct.tm, %struct.tm* %15, i32 0, i32 0
store i32 %59, i32* %60
%61 = load i32, i32* %4
%62 = sub nsw i32 %61, 1
%63 = getelementptr inbounds %struct.tm, %struct.tm* %15, i32 0, i32 1
store i32 %62, i32* %63
%64 = load i32, i32* %5
%65 = getelementptr inbounds %struct.tm, %struct.tm* %15, i32 0, i32 2
store i32 %64, i32* %65
%66 = load i32, i32* %6
%67 = getelementptr inbounds %struct.tm, %struct.tm* %15, i32 0, i32 3
store i32 %66, i32* %67
%68 = load i32, i32* %7
%69 = getelementptr inbounds %struct.tm, %struct.tm* %15, i32 0, i32 4
store i32 %68, i32* %69
%70 = load i32, i32* %8
%71 = getelementptr inbounds %struct.tm, %struct.tm* %15, i32 0, i32 5
store i32 %70, i32* %71
%72 = getelementptr inbounds %struct.tm, %struct.tm* %15, i32 0, i32 6
store i64 0, i64* %72
%73 = call i64 @mktime(%struct.tm* %15)
store i64 %73, i64* %16
%74 = load i64, i64* %16
ret i64 %74
}

LLVM IR (-O2):
%struct.tm = type { i32, i32, i32, i32, i32, i32, i64 }
@.str = [3 x i8] c"%d\00"
define i64 @isotime(i8* %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca [5 x i8]
%9 = alloca [3 x i8]
%10 = alloca [3 x i8]
%11 = alloca [3 x i8]
%12 = alloca [3 x i8]
%13 = alloca [3 x i8]
%14 = alloca %struct.tm
%15 = bitcast i32* %2 to i8*
%16 = bitcast i32* %3 to i8*
%17 = bitcast i32* %4 to i8*
%18 = bitcast i32* %5 to i8*
%19 = bitcast i32* %6 to i8*
%20 = bitcast i32* %7 to i8*
%21 = getelementptr inbounds [5 x i8], [5 x i8]* %8, i64 0, i64 0
%22 = getelementptr inbounds [3 x i8], [3 x i8]* %9, i64 0, i64 0
%23 = getelementptr inbounds [3 x i8], [3 x i8]* %10, i64 0, i64 0
%24 = getelementptr inbounds [3 x i8], [3 x i8]* %11, i64 0, i64 0
%25 = getelementptr inbounds [3 x i8], [3 x i8]* %12, i64 0, i64 0
%26 = getelementptr inbounds [3 x i8], [3 x i8]* %13, i64 0, i64 0
%27 = bitcast %struct.tm* %14 to i8*
%28 = call i32 @strncpy(i8* %21, i8* %0, i32 4)
%29 = getelementptr inbounds i8, i8* %0, i64 5
%30 = call i32 @strncpy(i8* %22, i8* %29, i32 2)
%31 = getelementptr inbounds i8, i8* %0, i64 8
%32 = call i32 @strncpy(i8* %23, i8* %31, i32 2)
%33 = getelementptr inbounds i8, i8* %0, i64 11
%34 = call i32 @strncpy(i8* %24, i8* %33, i32 2)
%35 = getelementptr inbounds i8, i8* %0, i64 14
%36 = call i32 @strncpy(i8* %25, i8* %35, i32 2)
%37 = getelementptr inbounds i8, i8* %0, i64 17
%38 = call i32 @strncpy(i8* %26, i8* %37, i32 2)
%39 = getelementptr inbounds [5 x i8], [5 x i8]* %8, i64 0, i64 4
store i8 0, i8* %39
%40 = getelementptr inbounds [3 x i8], [3 x i8]* %9, i64 0, i64 2
store i8 0, i8* %40
%41 = getelementptr inbounds [3 x i8], [3 x i8]* %10, i64 0, i64 2
store i8 0, i8* %41
%42 = getelementptr inbounds [3 x i8], [3 x i8]* %11, i64 0, i64 2
store i8 0, i8* %42
%43 = getelementptr inbounds [3 x i8], [3 x i8]* %12, i64 0, i64 2
store i8 0, i8* %43
%44 = getelementptr inbounds [3 x i8], [3 x i8]* %13, i64 0, i64 2
store i8 0, i8* %44
%45 = call i32 @sscanf(i8* %21, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%46 = call i32 @sscanf(i8* %22, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %3)
%47 = call i32 @sscanf(i8* %23, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %4)
%48 = call i32 @sscanf(i8* %24, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %5)
%49 = call i32 @sscanf(i8* %25, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %6)
%50 = call i32 @sscanf(i8* %26, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %7)
%51 = load i32, i32* %2
%52 = add nsw i32 %51, -1900
%53 = getelementptr inbounds %struct.tm, %struct.tm* %14, i64 0, i32 0
store i32 %52, i32* %53
%54 = load i32, i32* %3
%55 = add nsw i32 %54, -1
%56 = getelementptr inbounds %struct.tm, %struct.tm* %14, i64 0, i32 1
store i32 %55, i32* %56
%57 = load i32, i32* %4
%58 = getelementptr inbounds %struct.tm, %struct.tm* %14, i64 0, i32 2
store i32 %57, i32* %58
%59 = load i32, i32* %5
%60 = getelementptr inbounds %struct.tm, %struct.tm* %14, i64 0, i32 3
store i32 %59, i32* %60
%61 = load i32, i32* %6
%62 = getelementptr inbounds %struct.tm, %struct.tm* %14, i64 0, i32 4
store i32 %61, i32* %62
%63 = load i32, i32* %7
%64 = getelementptr inbounds %struct.tm, %struct.tm* %14, i64 0, i32 5
store i32 %63, i32* %64
%65 = getelementptr inbounds %struct.tm, %struct.tm* %14, i64 0, i32 6
store i64 0, i64* %65
%66 = call i64 @mktime(%struct.tm* %14)
ret i64 %66
}