#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_min;
  scalar_t__ tm_hour;
  int tm_mday;
  scalar_t__ tm_mon;
  int tm_year;
  scalar_t__ tm_yday;
  scalar_t__ tm_wday;
  scalar_t__ tm_sec;
};

/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
void *atoi(char *);
int /*<<< orphan*/ dohelp(int);
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
int /*<<< orphan*/ mktime(struct tm *);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ strcpy(char *, char const *);
int strlen(char *);
int /*<<< orphan*/ validday(int, int, int);
time_t parsetimestring(const char *timestr) {
  char dts[16];
  struct tm dt;
  dt.tm_sec = 0;
  dt.tm_min = 0;
  dt.tm_hour = 0;
  dt.tm_wday = 0;
  dt.tm_yday = 0;
  strcpy(dts, timestr);
  switch (strlen(dts)) {
  case 12:
    dt.tm_min = atoi(&dts[10]);
    if ((dt.tm_min < 0) || (dt.tm_min > 59)) {
      fprintf(stderr, "Illegal value for minutes: %d\n", dt.tm_min);
      dohelp(1);
    }
    dts[10] = '\0';
  case 10:
    dt.tm_hour = atoi(&dts[8]);
    if ((dt.tm_hour < 0) || (dt.tm_hour > 23)) {
      fprintf(stderr, "Illegal value for hours: %d\n", dt.tm_hour);
      dohelp(1);
    }
    dts[8] = '\0';
  case 8:
    dt.tm_mday = atoi(&dts[6]);
    if ((dt.tm_mday < 1) || (dt.tm_mday > 31)) {
      fprintf(stderr, "Illegal value for days: %d\n", dt.tm_mday);
      dohelp(1);
    }
    dts[6] = '\0';
    dt.tm_mon = atoi(&dts[4]) - 1;
    if ((dt.tm_mon < 0) || (dt.tm_mon > 11)) {
      fprintf(stderr, "Illegal value for months: %d\n", dt.tm_mon + 1);
      dohelp(1);
    }
    dts[4] = '\0';
    dt.tm_year = atoi(dts) - 1900;
    break;
  default:
    fprintf(stderr, "%s is not formatted correctly\n", dts);
    dohelp(1);
    break;
  }
  if (!(validday(dt.tm_year + 1900, dt.tm_mon + 1, dt.tm_mday))) {
    fprintf(stderr,
            "For the year %d, month %d, %d"
            " days is invalid\n",
            dt.tm_year + 1900, dt.tm_mon + 1, dt.tm_mday);
    exit(EXIT_FAILURE);
  }
  return mktime(&dt);
}


x86 assembly (clang, -O0):
<parsetimestring>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x28(%rbp)
movq   $0x0,-0x60(%rbp)
movq   $0x0,-0x58(%rbp)
movq   $0x0,-0x30(%rbp)
movq   $0x0,-0x38(%rbp)
mov    -0x8(%rbp),%rsi
lea    -0x20(%rbp),%rdi
mov    %rdi,-0x70(%rbp)
call   1030 <strcpy@plt>
mov    -0x70(%rbp),%rdi
call   1050 <strlen@plt>
mov    %eax,%ecx
mov    %ecx,-0x64(%rbp)
sub    $0x8,%eax
je     12a3 <parsetimestring+0x123>
jmp    11e1 <parsetimestring+0x61>
mov    -0x64(%rbp),%eax
sub    $0xa,%eax
je     1253 <parsetimestring+0xd3>
jmp    11f2 <parsetimestring+0x72>
mov    -0x64(%rbp),%eax
sub    $0xc,%eax
jne    135e <parsetimestring+0x1de>
jmp    1203 <parsetimestring+0x83>
lea    -0x20(%rbp),%rdi
add    $0xa,%rdi
call   1090 <atoi@plt>
mov    %rax,-0x60(%rbp)
cmpq   $0x0,-0x60(%rbp)
jl     122a <parsetimestring+0xaa>
cmpq   $0x3b,-0x60(%rbp)
jle    124f <parsetimestring+0xcf>
mov    0x2daf(%rip),%rax
mov    (%rax),%edi
mov    -0x60(%rbp),%rdx
lea    0xdc2(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
mov    $0x1,%edi
call   1040 <dohelp@plt>
movb   $0x0,-0x16(%rbp)
lea    -0x20(%rbp),%rdi
add    $0x8,%rdi
call   1090 <atoi@plt>
mov    %rax,-0x58(%rbp)
cmpq   $0x0,-0x58(%rbp)
jl     127a <parsetimestring+0xfa>
cmpq   $0x17,-0x58(%rbp)
jle    129f <parsetimestring+0x11f>
mov    0x2d5f(%rip),%rax
mov    (%rax),%edi
mov    -0x58(%rbp),%rdx
lea    0xd91(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
mov    $0x1,%edi
call   1040 <dohelp@plt>
movb   $0x0,-0x18(%rbp)
lea    -0x20(%rbp),%rdi
add    $0x6,%rdi
call   1090 <atoi@plt>
mov    %eax,-0x50(%rbp)
cmpl   $0x1,-0x50(%rbp)
jl     12c7 <parsetimestring+0x147>
cmpl   $0x1f,-0x50(%rbp)
jle    12eb <parsetimestring+0x16b>
mov    0x2d12(%rip),%rax
mov    (%rax),%edi
mov    -0x50(%rbp),%edx
lea    0xd62(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
mov    $0x1,%edi
call   1040 <dohelp@plt>
movb   $0x0,-0x1a(%rbp)
lea    -0x20(%rbp),%rdi
add    $0x4,%rdi
call   1090 <atoi@plt>
add    $0xffffffffffffffff,%rax
mov    %rax,-0x48(%rbp)
cmpq   $0x0,-0x48(%rbp)
jl     131a <parsetimestring+0x19a>
cmpq   $0xb,-0x48(%rbp)
jle    1343 <parsetimestring+0x1c3>
mov    0x2cbf(%rip),%rax
mov    (%rax),%edi
mov    -0x48(%rbp),%rdx
add    $0x1,%rdx
lea    0xd26(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
mov    $0x1,%edi
call   1040 <dohelp@plt>
movb   $0x0,-0x1c(%rbp)
lea    -0x20(%rbp),%rdi
call   1090 <atoi@plt>
add    $0xfffffffffffff894,%rax
mov    %eax,-0x40(%rbp)
jmp    1383 <parsetimestring+0x203>
mov    0x2c7b(%rip),%rax
mov    (%rax),%edi
lea    -0x20(%rbp),%rdx
lea    0xd04(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
mov    $0x1,%edi
call   1040 <dohelp@plt>
mov    -0x40(%rbp),%edi
add    $0x76c,%edi
mov    -0x48(%rbp),%rax
add    $0x1,%rax
mov    %eax,%esi
mov    -0x50(%rbp),%edx
call   1080 <validday@plt>
cmp    $0x0,%eax
jne    13e1 <parsetimestring+0x261>
mov    0x2c32(%rip),%rax
mov    (%rax),%edi
mov    -0x40(%rbp),%edx
add    $0x76c,%edx
mov    -0x48(%rbp),%rcx
add    $0x1,%rcx
mov    -0x50(%rbp),%r8d
lea    0xcc9(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
mov    0x2bfe(%rip),%rax
mov    (%rax),%edi
call   10a0 <exit@plt>
lea    -0x60(%rbp),%rdi
call   1070 <mktime@plt>
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<parsetimestring>:
push   %r15
push   %r14
push   %rbx
sub    $0x50,%rsp
mov    %rdi,%rsi
xorps  %xmm0,%xmm0
movaps %xmm0,0x10(%rsp)
movups %xmm0,0x38(%rsp)
movq   $0x0,0x48(%rsp)
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1030 <strcpy@plt>
mov    %rbx,%rdi
call   1050 <strlen@plt>
cmp    $0x8,%eax
je     1252 <parsetimestring+0xd2>
cmp    $0xa,%eax
je     120f <parsetimestring+0x8f>
cmp    $0xc,%eax
jne    1349 <parsetimestring+0x1c9>
lea    0xa(%rsp),%rdi
call   1090 <atoi@plt>
mov    %rax,0x10(%rsp)
test   %rax,%rax
js     11e6 <parsetimestring+0x66>
cmp    $0x3c,%rax
jl     120a <parsetimestring+0x8a>
mov    0x2df3(%rip),%rcx
mov    (%rcx),%edi
lea    0xe0a(%rip),%rsi
mov    %rax,%rdx
xor    %eax,%eax
call   1060 <fprintf@plt>
mov    $0x1,%edi
call   1040 <dohelp@plt>
movb   $0x0,0xa(%rsp)
lea    0x8(%rsp),%rdi
call   1090 <atoi@plt>
mov    %rax,0x18(%rsp)
test   %rax,%rax
js     1229 <parsetimestring+0xa9>
cmp    $0x18,%rax
jl     124d <parsetimestring+0xcd>
mov    0x2db0(%rip),%rcx
mov    (%rcx),%edi
lea    0xde6(%rip),%rsi
mov    %rax,%rdx
xor    %eax,%eax
call   1060 <fprintf@plt>
mov    $0x1,%edi
call   1040 <dohelp@plt>
movb   $0x0,0x8(%rsp)
lea    0x6(%rsp),%rdi
call   1090 <atoi@plt>
mov    %rax,%r14
mov    %r14d,0x20(%rsp)
add    $0xffffffe0,%eax
cmp    $0xffffffe0,%eax
ja     1290 <parsetimestring+0x110>
mov    0x2d6d(%rip),%rax
mov    (%rax),%edi
lea    0xdc0(%rip),%rsi
mov    %r14d,%edx
xor    %eax,%eax
call   1060 <fprintf@plt>
mov    $0x1,%edi
call   1040 <dohelp@plt>
movb   $0x0,0x6(%rsp)
lea    0x4(%rsp),%rdi
call   1090 <atoi@plt>
mov    %rax,%rbx
add    $0xffffffffffffffff,%rbx
mov    %rbx,0x28(%rsp)
js     12b3 <parsetimestring+0x133>
cmp    $0xc,%rbx
jl     12d8 <parsetimestring+0x158>
mov    0x2d26(%rip),%rax
mov    (%rax),%edi
lea    0x1(%rbx),%rdx
lea    0xd91(%rip),%rsi
xor    %eax,%eax
call   1060 <fprintf@plt>
mov    $0x1,%edi
call   1040 <dohelp@plt>
movb   $0x0,0x4(%rsp)
mov    %rsp,%rdi
call   1090 <atoi@plt>
mov    %rax,%r15
add    $0xfffff894,%eax
mov    %eax,0x30(%rsp)
lea    0x1(%rbx),%esi
mov    %r15d,%edi
mov    %r14d,%edx
call   1080 <validday@plt>
test   %eax,%eax
je     1317 <parsetimestring+0x197>
lea    0x10(%rsp),%rdi
call   1070 <mktime@plt>
add    $0x50,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret
mov    0x2cc2(%rip),%rax
mov    (%rax),%edi
add    $0x1,%rbx
lea    0xd6a(%rip),%rsi
mov    %r15d,%edx
mov    %rbx,%rcx
mov    %r14d,%r8d
xor    %eax,%eax
call   1060 <fprintf@plt>
mov    0x2c96(%rip),%rax
mov    (%rax),%edi
call   10a0 <exit@plt>
mov    0x2c90(%rip),%rax
mov    (%rax),%edi
lea    0xd1d(%rip),%rsi
mov    %rsp,%rdx
xor    %eax,%eax
call   1060 <fprintf@plt>
mov    $0x1,%edi
call   1040 <dohelp@plt>

LLVM IR (-O0):
%struct.tm = type { i64, i64, i32, i64, i32, i64, i64, i64 }
@stderr = global i32 0
@.str = [31 x i8] c"Illegal value for minutes: %d\0A\00"
@.str.1 = [29 x i8] c"Illegal value for hours: %d\0A\00"
@.str.2 = [28 x i8] c"Illegal value for days: %d\0A\00"
@.str.3 = [30 x i8] c"Illegal value for months: %d\0A\00"
@.str.4 = [31 x i8] c"%s is not formatted correctly\0A\00"
@.str.5 = [47 x i8] c"For the year %d, month %d, %d days is invalid\0A\00"
@EXIT_FAILURE = global i32 0
define i32 @parsetimestring(i8* %0) {
%2 = alloca i8*
%3 = alloca [16 x i8]
%4 = alloca %struct.tm
store i8* %0, i8** %2
%5 = getelementptr inbounds %struct.tm, %struct.tm* %4, i32 0, i32 7
store i64 0, i64* %5
%6 = getelementptr inbounds %struct.tm, %struct.tm* %4, i32 0, i32 0
store i64 0, i64* %6
%7 = getelementptr inbounds %struct.tm, %struct.tm* %4, i32 0, i32 1
store i64 0, i64* %7
%8 = getelementptr inbounds %struct.tm, %struct.tm* %4, i32 0, i32 6
store i64 0, i64* %8
%9 = getelementptr inbounds %struct.tm, %struct.tm* %4, i32 0, i32 5
store i64 0, i64* %9
%10 = getelementptr inbounds [16 x i8], [16 x i8]* %3, i64 0, i64 0
%11 = load i8*, i8** %2
%12 = call i32 @strcpy(i8* %10, i8* %11)
%13 = getelementptr inbounds [16 x i8], [16 x i8]* %3, i64 0, i64 0
%14 = call i32 @strlen(i8* %13)
switch i32 %14, label %101 [
i32 12, label %15
i32 10, label %35
i32 8, label %55
]
15: ; preds = %1
%16 = getelementptr inbounds [16 x i8], [16 x i8]* %3, i64 0, i64 10
%17 = call i8* @atoi(i8* %16)
%18 = ptrtoint i8* %17 to i64
%19 = getelementptr inbounds %struct.tm, %struct.tm* %4, i32 0, i32 0
store i64 %18, i64* %19
%20 = getelementptr inbounds %struct.tm, %struct.tm* %4, i32 0, i32 0
%21 = load i64, i64* %20
%22 = icmp slt i64 %21, 0
br i1 %22, label %27, label %23
23: ; preds = %15
%24 = getelementptr inbounds %struct.tm, %struct.tm* %4, i32 0, i32 0
%25 = load i64, i64* %24
%26 = icmp sgt i64 %25, 59
br i1 %26, label %27, label %33
27: ; preds = %23, %15
%28 = load i32, i32* @stderr
%29 = getelementptr inbounds %struct.tm, %struct.tm* %4, i32 0, i32 0
%30 = load i64, i64* %29
%31 = call i32 (i32, i8*, ...) @fprintf(i32 %28, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i64 %30)
%32 = call i32 @dohelp(i32 1)
br label %33
33: ; preds = %27, %23
%34 = getelementptr inbounds [16 x i8], [16 x i8]* %3, i64 0, i64 10
store i8 0, i8* %34
br label %35
35: ; preds = %1, %33
%36 = getelementptr inbounds [16 x i8], [16 x i8]* %3, i64 0, i64 8
%37 = call i8* @atoi(i8* %36)
%38 = ptrtoint i8* %37 to i64
%39 = getelementptr inbounds %struct.tm, %struct.tm* %4, i32 0, i32 1
store i64 %38, i64* %39
%40 = getelementptr inbounds %struct.tm, %struct.tm* %4, i32 0, i32 1
%41 = load i64, i64* %40
%42 = icmp slt i64 %41, 0
br i1 %42, label %47, label %43
43: ; preds = %35
%44 = getelementptr inbounds %struct.tm, %struct.tm* %4, i32 0, i32 1
%45 = load i64, i64* %44
%46 = icmp sgt i64 %45, 23
br i1 %46, label %47, label %53
47: ; preds = %43, %35
%48 = load i32, i32* @stderr
%49 = getelementptr inbounds %struct.tm, %struct.tm* %4, i32 0, i32 1
%50 = load i64, i64* %49
%51 = call i32 (i32, i8*, ...) @fprintf(i32 %48, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0), i64 %50)
%52 = call i32 @dohelp(i32 1)
br label %53
53: ; preds = %47, %43
%54 = getelementptr inbounds [16 x i8], [16 x i8]* %3, i64 0, i64 8
store i8 0, i8* %54
br label %55
55: ; preds = %1, %53
%56 = getelementptr inbounds [16 x i8], [16 x i8]* %3, i64 0, i64 6
%57 = call i8* @atoi(i8* %56)
%58 = ptrtoint i8* %57 to i32
%59 = getelementptr inbounds %struct.tm, %struct.tm* %4, i32 0, i32 2
store i32 %58, i32* %59
%60 = getelementptr inbounds %struct.tm, %struct.tm* %4, i32 0, i32 2
%61 = load i32, i32* %60
%62 = icmp slt i32 %61, 1
br i1 %62, label %67, label %63
63: ; preds = %55
%64 = getelementptr inbounds %struct.tm, %struct.tm* %4, i32 0, i32 2
%65 = load i32, i32* %64
%66 = icmp sgt i32 %65, 31
br i1 %66, label %67, label %73
67: ; preds = %63, %55
%68 = load i32, i32* @stderr
%69 = getelementptr inbounds %struct.tm, %struct.tm* %4, i32 0, i32 2
%70 = load i32, i32* %69
%71 = call i32 (i32, i8*, ...) @fprintf(i32 %68, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.2, i64 0, i64 0), i32 %70)
%72 = call i32 @dohelp(i32 1)
br label %73
73: ; preds = %67, %63
%74 = getelementptr inbounds [16 x i8], [16 x i8]* %3, i64 0, i64 6
store i8 0, i8* %74
%75 = getelementptr inbounds [16 x i8], [16 x i8]* %3, i64 0, i64 4
%76 = call i8* @atoi(i8* %75)
%77 = getelementptr i8, i8* %76, i64 -1
%78 = ptrtoint i8* %77 to i64
%79 = getelementptr inbounds %struct.tm, %struct.tm* %4, i32 0, i32 3
store i64 %78, i64* %79
%80 = getelementptr inbounds %struct.tm, %struct.tm* %4, i32 0, i32 3
%81 = load i64, i64* %80
%82 = icmp slt i64 %81, 0
br i1 %82, label %87, label %83
83: ; preds = %73
%84 = getelementptr inbounds %struct.tm, %struct.tm* %4, i32 0, i32 3
%85 = load i64, i64* %84
%86 = icmp sgt i64 %85, 11
br i1 %86, label %87, label %94
87: ; preds = %83, %73
%88 = load i32, i32* @stderr
%89 = getelementptr inbounds %struct.tm, %struct.tm* %4, i32 0, i32 3
%90 = load i64, i64* %89
%91 = add nsw i64 %90, 1
%92 = call i32 (i32, i8*, ...) @fprintf(i32 %88, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.3, i64 0, i64 0), i64 %91)
%93 = call i32 @dohelp(i32 1)
br label %94
94: ; preds = %87, %83
%95 = getelementptr inbounds [16 x i8], [16 x i8]* %3, i64 0, i64 4
store i8 0, i8* %95
%96 = getelementptr inbounds [16 x i8], [16 x i8]* %3, i64 0, i64 0
%97 = call i8* @atoi(i8* %96)
%98 = getelementptr i8, i8* %97, i64 -1900
%99 = ptrtoint i8* %98 to i32
%100 = getelementptr inbounds %struct.tm, %struct.tm* %4, i32 0, i32 4
store i32 %99, i32* %100
br label %106
101: ; preds = %1
%102 = load i32, i32* @stderr
%103 = getelementptr inbounds [16 x i8], [16 x i8]* %3, i64 0, i64 0
%104 = call i32 (i32, i8*, ...) @fprintf(i32 %102, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.4, i64 0, i64 0), i8* %103)
%105 = call i32 @dohelp(i32 1)
br label %106
106: ; preds = %101, %94
%107 = getelementptr inbounds %struct.tm, %struct.tm* %4, i32 0, i32 4
%108 = load i32, i32* %107
%109 = add nsw i32 %108, 1900
%110 = getelementptr inbounds %struct.tm, %struct.tm* %4, i32 0, i32 3
%111 = load i64, i64* %110
%112 = add nsw i64 %111, 1
%113 = trunc i64 %112 to i32
%114 = getelementptr inbounds %struct.tm, %struct.tm* %4, i32 0, i32 2
%115 = load i32, i32* %114
%116 = call i32 @validday(i32 %109, i32 %113, i32 %115)
%117 = icmp ne i32 %116, 0
br i1 %117, label %131, label %118
118: ; preds = %106
%119 = load i32, i32* @stderr
%120 = getelementptr inbounds %struct.tm, %struct.tm* %4, i32 0, i32 4
%121 = load i32, i32* %120
%122 = add nsw i32 %121, 1900
%123 = getelementptr inbounds %struct.tm, %struct.tm* %4, i32 0, i32 3
%124 = load i64, i64* %123
%125 = add nsw i64 %124, 1
%126 = getelementptr inbounds %struct.tm, %struct.tm* %4, i32 0, i32 2
%127 = load i32, i32* %126
%128 = call i32 (i32, i8*, ...) @fprintf(i32 %119, i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.5, i64 0, i64 0), i32 %122, i64 %125, i32 %127)
%129 = load i32, i32* @EXIT_FAILURE
%130 = call i32 @exit(i32 %129)
unreachable
131: ; preds = %106
%132 = call i32 @mktime(%struct.tm* %4)
ret i32 %132
}

LLVM IR (-O2):
%struct.tm = type { i64, i64, i32, i64, i32, i64, i64, i64 }
@stderr = global i32 0
@.str = [31 x i8] c"Illegal value for minutes: %d\0A\00"
@.str.1 = [29 x i8] c"Illegal value for hours: %d\0A\00"
@.str.2 = [28 x i8] c"Illegal value for days: %d\0A\00"
@.str.3 = [30 x i8] c"Illegal value for months: %d\0A\00"
@.str.4 = [31 x i8] c"%s is not formatted correctly\0A\00"
@.str.5 = [47 x i8] c"For the year %d, month %d, %d days is invalid\0A\00"
@EXIT_FAILURE = global i32 0
define i32 @parsetimestring(i8* %0) {
%2 = alloca [16 x i8]
%3 = alloca %struct.tm
%4 = getelementptr inbounds [16 x i8], [16 x i8]* %2, i64 0, i64 0
%5 = bitcast %struct.tm* %3 to i8*
%6 = getelementptr inbounds %struct.tm, %struct.tm* %3, i64 0, i32 1
%7 = getelementptr inbounds %struct.tm, %struct.tm* %3, i64 0, i32 5
%8 = bitcast %struct.tm* %3 to i8*
%9 = bitcast i64* %7 to i8*
%10 = call i32 @strcpy(i8* %4, i8* %0)
%11 = call i32 @strlen(i8* %4)
switch i32 %11, label %74 [
i32 12, label %12
i32 10, label %25
i32 8, label %37
]
12: ; preds = %1
%13 = getelementptr inbounds %struct.tm, %struct.tm* %3, i64 0, i32 0
%14 = getelementptr inbounds [16 x i8], [16 x i8]* %2, i64 0, i64 10
%15 = call i8* @atoi(i8* %14)
%16 = ptrtoint i8* %15 to i64
store i64 %16, i64* %13
%17 = icmp slt i8* %15, null
%18 = icmp sgt i8* %15, inttoptr (i64 59 to i8*)
%19 = or i1 %17, %18
br i1 %19, label %20, label %24
20: ; preds = %12
%21 = load i32, i32* @stderr
%22 = call i32 (i32, i8*, ...) @fprintf(i32 %21, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i64 %16)
%23 = call i32 @dohelp(i32 1)
br label %24
24: ; preds = %12, %20
store i8 0, i8* %14
br label %25
25: ; preds = %1, %24
%26 = getelementptr inbounds [16 x i8], [16 x i8]* %2, i64 0, i64 8
%27 = call i8* @atoi(i8* %26)
%28 = ptrtoint i8* %27 to i64
store i64 %28, i64* %6
%29 = icmp slt i8* %27, null
%30 = icmp sgt i8* %27, inttoptr (i64 23 to i8*)
%31 = or i1 %29, %30
br i1 %31, label %32, label %36
32: ; preds = %25
%33 = load i32, i32* @stderr
%34 = call i32 (i32, i8*, ...) @fprintf(i32 %33, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0), i64 %28)
%35 = call i32 @dohelp(i32 1)
br label %36
36: ; preds = %25, %32
store i8 0, i8* %26
br label %37
37: ; preds = %1, %36
%38 = getelementptr inbounds [16 x i8], [16 x i8]* %2, i64 0, i64 6
%39 = call i8* @atoi(i8* %38)
%40 = ptrtoint i8* %39 to i64
%41 = trunc i64 %40 to i32
%42 = getelementptr inbounds %struct.tm, %struct.tm* %3, i64 0, i32 2
store i32 %41, i32* %42
%43 = add i32 %41, -32
%44 = icmp ult i32 %43, -31
br i1 %44, label %45, label %49
45: ; preds = %37
%46 = load i32, i32* @stderr
%47 = call i32 (i32, i8*, ...) @fprintf(i32 %46, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.2, i64 0, i64 0), i32 %41)
%48 = call i32 @dohelp(i32 1)
br label %49
49: ; preds = %37, %45
store i8 0, i8* %38
%50 = getelementptr inbounds [16 x i8], [16 x i8]* %2, i64 0, i64 4
%51 = call i8* @atoi(i8* %50)
%52 = getelementptr i8, i8* %51, i64 -1
%53 = ptrtoint i8* %52 to i64
%54 = getelementptr inbounds %struct.tm, %struct.tm* %3, i64 0, i32 3
store i64 %53, i64* %54
%55 = icmp slt i8* %52, null
%56 = icmp sgt i8* %52, inttoptr (i64 11 to i8*)
%57 = or i1 %55, %56
br i1 %57, label %58, label %63
58: ; preds = %49
%59 = load i32, i32* @stderr
%60 = add nsw i64 %53, 1
%61 = call i32 (i32, i8*, ...) @fprintf(i32 %59, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.3, i64 0, i64 0), i64 %60)
%62 = call i32 @dohelp(i32 1)
br label %63
63: ; preds = %49, %58
store i8 0, i8* %50
%64 = call i8* @atoi(i8* %4)
%65 = getelementptr i8, i8* %64, i64 -1900
%66 = ptrtoint i8* %65 to i64
%67 = trunc i64 %66 to i32
%68 = getelementptr inbounds %struct.tm, %struct.tm* %3, i64 0, i32 4
store i32 %67, i32* %68
%69 = add i32 %67, 1900
%70 = trunc i64 %53 to i32
%71 = add i32 %70, 1
%72 = call i32 @validday(i32 %69, i32 %71, i32 %41)
%73 = icmp eq i32 %72, 0
br i1 %73, label %78, label %84
74: ; preds = %1
%75 = load i32, i32* @stderr
%76 = call i32 (i32, i8*, ...) @fprintf(i32 %75, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.4, i64 0, i64 0), i8* %4)
%77 = call i32 @dohelp(i32 1)
unreachable
78: ; preds = %63
%79 = load i32, i32* @stderr
%80 = add nsw i64 %53, 1
%81 = call i32 (i32, i8*, ...) @fprintf(i32 %79, i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.5, i64 0, i64 0), i32 %69, i64 %80, i32 %41)
%82 = load i32, i32* @EXIT_FAILURE
%83 = call i32 @exit(i32 %82)
unreachable
84: ; preds = %63
%85 = call i32 @mktime(%struct.tm* %3)
ret i32 %85
}