#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;
  int tm_year;
  int tm_mon;
  int tm_mday;
  int tm_hour;
  int tm_min;
  int tm_sec;
};
typedef int /*<<< orphan*/ btm;

/* Variables and functions */
int /*<<< orphan*/ error(char *, ...);
int /*<<< orphan*/ isdigit(unsigned char const);
int /*<<< orphan*/ memset(struct tm *, int /*<<< orphan*/, int);
int /*<<< orphan*/ mktime(struct tm *);
int sscanf(unsigned char const *, char *, int *, int *, int *);
int strlen(unsigned char const *);
int check_zip_date(const unsigned char *dbuf, const unsigned char *tbuf) {
  int year, month, mday, hour, min, sec;
  struct tm btm;
  time_t tt;
  if (strlen(dbuf) != 10) {
    error("date '%s' is invalid, its length is expected to be 10", dbuf);
    return -1;
  }
  if (!isdigit(dbuf[0]) || !isdigit(dbuf[1]) || !isdigit(dbuf[2]) ||
      !isdigit(dbuf[3]) || dbuf[4] != '-' || !isdigit(dbuf[5]) ||
      !isdigit(dbuf[6]) || dbuf[7] != '-' || !isdigit(dbuf[8]) ||
      !isdigit(dbuf[9])) {
    error("date '%s' is invalid, expected to be in YYYY-MM-DD format", dbuf);
    return -1;
  }
  if (sscanf(dbuf, "%d-%d-%d", &year, &month, &mday) != 3) {
    error("date '%s' is invalid, expected to be in YYYY-MM-DD format", dbuf);
    return -1;
  }
  if (year < 1950 || year > 2100 || month < 1 || month > 12 || mday < 1 ||
      mday > 31) {
    error("date '%s' is invalid", dbuf);
    return -1;
  }
  if (strlen(tbuf) != 8) {
    error("time '%s' is invalid, its length is expected to be 8", tbuf);
    return -1;
  }
  if (!isdigit(tbuf[0]) || !isdigit(tbuf[1]) || tbuf[2] != ':' ||
      !isdigit(tbuf[3]) || !isdigit(tbuf[4]) || tbuf[5] != ':' ||
      !isdigit(tbuf[6]) || !isdigit(tbuf[7])) {
    error("time '%s' is invalid, expected to be in HH:MM:SS format", tbuf);
    return -1;
  }
  if (sscanf(tbuf, "%d:%d:%d", &hour, &min, &sec) != 3) {
    error("time '%s' is invalid, expected to be in HH:MM:SS format", tbuf);
    return -1;
  }
  if (hour < 0 || hour > 23 || min < 0 || min > 60 || sec < 0 || sec > 61) {
    error("time '%s' is invalid");
    return -1;
  }
  memset(&btm, 0, sizeof(btm));
  btm.tm_isdst = -1;
  btm.tm_year = year - 1900;
  btm.tm_mon = month - 1;
  btm.tm_mday = mday;
  btm.tm_hour = hour;
  btm.tm_min = min;
  btm.tm_sec = sec;
  if ((tt = mktime(&btm)) == (time_t)-1) {
    error("date '%s %s' is invalid", dbuf, tbuf);
    return -1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<check_zip_date>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
cmp    $0xa,%eax
je     11a0 <check_zip_date+0x40>
mov    -0x10(%rbp),%rsi
lea    0xe73(%rip),%rdi
mov    $0x0,%al
call   1080 <error@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    153f <check_zip_date+0x3df>
mov    -0x10(%rbp),%rax
movzbl (%rax),%edi
call   1030 <isdigit@plt>
cmp    $0x0,%eax
je     1271 <check_zip_date+0x111>
mov    -0x10(%rbp),%rax
movzbl 0x1(%rax),%edi
call   1030 <isdigit@plt>
cmp    $0x0,%eax
je     1271 <check_zip_date+0x111>
mov    -0x10(%rbp),%rax
movzbl 0x2(%rax),%edi
call   1030 <isdigit@plt>
cmp    $0x0,%eax
je     1271 <check_zip_date+0x111>
mov    -0x10(%rbp),%rax
movzbl 0x3(%rax),%edi
call   1030 <isdigit@plt>
cmp    $0x0,%eax
je     1271 <check_zip_date+0x111>
mov    -0x10(%rbp),%rax
movzbl 0x4(%rax),%eax
cmp    $0x2d,%eax
jne    1271 <check_zip_date+0x111>
mov    -0x10(%rbp),%rax
movzbl 0x5(%rax),%edi
call   1030 <isdigit@plt>
cmp    $0x0,%eax
je     1271 <check_zip_date+0x111>
mov    -0x10(%rbp),%rax
movzbl 0x6(%rax),%edi
call   1030 <isdigit@plt>
cmp    $0x0,%eax
je     1271 <check_zip_date+0x111>
mov    -0x10(%rbp),%rax
movzbl 0x7(%rax),%eax
cmp    $0x2d,%eax
jne    1271 <check_zip_date+0x111>
mov    -0x10(%rbp),%rax
movzbl 0x8(%rax),%edi
call   1030 <isdigit@plt>
cmp    $0x0,%eax
je     1271 <check_zip_date+0x111>
mov    -0x10(%rbp),%rax
movzbl 0x9(%rax),%edi
call   1030 <isdigit@plt>
cmp    $0x0,%eax
jne    128f <check_zip_date+0x12f>
mov    -0x10(%rbp),%rsi
lea    0xdba(%rip),%rdi
mov    $0x0,%al
call   1080 <error@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    153f <check_zip_date+0x3df>
mov    -0x10(%rbp),%rdi
lea    0xdd6(%rip),%rsi
lea    -0x1c(%rbp),%rdx
lea    -0x20(%rbp),%rcx
lea    -0x24(%rbp),%r8
call   1060 <sscanf@plt>
cmp    $0x3,%eax
je     12d2 <check_zip_date+0x172>
mov    -0x10(%rbp),%rsi
lea    0xd77(%rip),%rdi
mov    $0x0,%al
call   1080 <error@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    153f <check_zip_date+0x3df>
cmpl   $0x79e,-0x1c(%rbp)
jl     1314 <check_zip_date+0x1b4>
cmpl   $0x834,-0x1c(%rbp)
jg     1314 <check_zip_date+0x1b4>
cmpl   $0x1,-0x20(%rbp)
jl     1314 <check_zip_date+0x1b4>
cmpl   $0xc,-0x20(%rbp)
jg     1314 <check_zip_date+0x1b4>
cmpl   $0x1,-0x24(%rbp)
jl     1314 <check_zip_date+0x1b4>
cmpl   $0x1f,-0x24(%rbp)
jle    1332 <check_zip_date+0x1d2>
mov    -0x10(%rbp),%rsi
lea    0xd5a(%rip),%rdi
mov    $0x0,%al
call   1080 <error@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    153f <check_zip_date+0x3df>
mov    -0x18(%rbp),%rdi
call   1040 <strlen@plt>
cmp    $0x8,%eax
je     1362 <check_zip_date+0x202>
mov    -0x18(%rbp),%rsi
lea    0xd3f(%rip),%rdi
mov    $0x0,%al
call   1080 <error@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    153f <check_zip_date+0x3df>
mov    -0x18(%rbp),%rax
movzbl (%rax),%edi
call   1030 <isdigit@plt>
cmp    $0x0,%eax
je     1407 <check_zip_date+0x2a7>
mov    -0x18(%rbp),%rax
movzbl 0x1(%rax),%edi
call   1030 <isdigit@plt>
cmp    $0x0,%eax
je     1407 <check_zip_date+0x2a7>
mov    -0x18(%rbp),%rax
movzbl 0x2(%rax),%eax
cmp    $0x3a,%eax
jne    1407 <check_zip_date+0x2a7>
mov    -0x18(%rbp),%rax
movzbl 0x3(%rax),%edi
call   1030 <isdigit@plt>
cmp    $0x0,%eax
je     1407 <check_zip_date+0x2a7>
mov    -0x18(%rbp),%rax
movzbl 0x4(%rax),%edi
call   1030 <isdigit@plt>
cmp    $0x0,%eax
je     1407 <check_zip_date+0x2a7>
mov    -0x18(%rbp),%rax
movzbl 0x5(%rax),%eax
cmp    $0x3a,%eax
jne    1407 <check_zip_date+0x2a7>
mov    -0x18(%rbp),%rax
movzbl 0x6(%rax),%edi
call   1030 <isdigit@plt>
cmp    $0x0,%eax
je     1407 <check_zip_date+0x2a7>
mov    -0x18(%rbp),%rax
movzbl 0x7(%rax),%edi
call   1030 <isdigit@plt>
cmp    $0x0,%eax
jne    1425 <check_zip_date+0x2c5>
mov    -0x18(%rbp),%rsi
lea    0xcb1(%rip),%rdi
mov    $0x0,%al
call   1080 <error@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    153f <check_zip_date+0x3df>
mov    -0x18(%rbp),%rdi
lea    0xccb(%rip),%rsi
lea    -0x28(%rbp),%rdx
lea    -0x2c(%rbp),%rcx
lea    -0x30(%rbp),%r8
call   1060 <sscanf@plt>
cmp    $0x3,%eax
je     1468 <check_zip_date+0x308>
mov    -0x18(%rbp),%rsi
lea    0xc6e(%rip),%rdi
mov    $0x0,%al
call   1080 <error@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    153f <check_zip_date+0x3df>
cmpl   $0x0,-0x28(%rbp)
jl     14a4 <check_zip_date+0x344>
cmpl   $0x17,-0x28(%rbp)
jg     14a4 <check_zip_date+0x344>
cmpl   $0x0,-0x2c(%rbp)
jl     14a4 <check_zip_date+0x344>
cmpl   $0x3c,-0x2c(%rbp)
jg     14a4 <check_zip_date+0x344>
cmpl   $0x0,-0x30(%rbp)
jl     14a4 <check_zip_date+0x344>
cmpl   $0x3d,-0x30(%rbp)
jle    14be <check_zip_date+0x35e>
lea    0xc59(%rip),%rdi
mov    $0x0,%al
call   1080 <error@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    153f <check_zip_date+0x3df>
lea    -0x50(%rbp),%rdi
xor    %esi,%esi
mov    $0x1c,%edx
call   1050 <memset@plt>
movl   $0xffffffff,-0x50(%rbp)
mov    -0x1c(%rbp),%eax
sub    $0x76c,%eax
mov    %eax,-0x4c(%rbp)
mov    -0x20(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x48(%rbp)
mov    -0x24(%rbp),%eax
mov    %eax,-0x44(%rbp)
mov    -0x28(%rbp),%eax
mov    %eax,-0x40(%rbp)
mov    -0x2c(%rbp),%eax
mov    %eax,-0x3c(%rbp)
mov    -0x30(%rbp),%eax
mov    %eax,-0x38(%rbp)
lea    -0x50(%rbp),%rdi
call   1070 <mktime@plt>
mov    %eax,-0x54(%rbp)
cmp    $0xffffffff,%eax
jne    1538 <check_zip_date+0x3d8>
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
lea    0xbf4(%rip),%rdi
mov    $0x0,%al
call   1080 <error@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    153f <check_zip_date+0x3df>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_zip_date>:
push   %rbp
push   %r15
push   %r14
push   %rbx
sub    $0x38,%rsp
mov    %rsi,%r14
mov    %rdi,%rbx
call   1040 <strlen@plt>
cmp    $0xa,%eax
jne    13e1 <check_zip_date+0x281>
movzbl (%rbx),%edi
call   1030 <isdigit@plt>
test   %eax,%eax
je     13ea <check_zip_date+0x28a>
movzbl 0x1(%rbx),%edi
call   1030 <isdigit@plt>
test   %eax,%eax
je     13ea <check_zip_date+0x28a>
movzbl 0x2(%rbx),%edi
call   1030 <isdigit@plt>
test   %eax,%eax
je     13ea <check_zip_date+0x28a>
movzbl 0x3(%rbx),%edi
call   1030 <isdigit@plt>
test   %eax,%eax
je     13ea <check_zip_date+0x28a>
cmpb   $0x2d,0x4(%rbx)
jne    13ea <check_zip_date+0x28a>
movzbl 0x5(%rbx),%edi
call   1030 <isdigit@plt>
test   %eax,%eax
je     13ea <check_zip_date+0x28a>
movzbl 0x6(%rbx),%edi
call   1030 <isdigit@plt>
test   %eax,%eax
je     13ea <check_zip_date+0x28a>
cmpb   $0x2d,0x7(%rbx)
jne    13ea <check_zip_date+0x28a>
movzbl 0x8(%rbx),%edi
call   1030 <isdigit@plt>
test   %eax,%eax
je     13ea <check_zip_date+0x28a>
movzbl 0x9(%rbx),%edi
call   1030 <isdigit@plt>
test   %eax,%eax
je     13ea <check_zip_date+0x28a>
lea    0xe50(%rip),%rsi
lea    0x14(%rsp),%rdx
lea    0x10(%rsp),%rcx
lea    0xc(%rsp),%r8
mov    %rbx,%rdi
call   1060 <sscanf@plt>
cmp    $0x3,%eax
jne    13ea <check_zip_date+0x28a>
mov    $0xfffff7cb,%eax
add    0x14(%rsp),%eax
cmp    $0xffffff69,%eax
jb     140d <check_zip_date+0x2ad>
mov    0x10(%rsp),%eax
test   %eax,%eax
jle    140d <check_zip_date+0x2ad>
cmp    $0xc,%eax
jg     140d <check_zip_date+0x2ad>
mov    0xc(%rsp),%eax
test   %eax,%eax
jle    140d <check_zip_date+0x2ad>
cmp    $0x20,%eax
jge    140d <check_zip_date+0x2ad>
mov    %r14,%rdi
call   1040 <strlen@plt>
cmp    $0x8,%eax
jne    1416 <check_zip_date+0x2b6>
movzbl (%r14),%edi
call   1030 <isdigit@plt>
test   %eax,%eax
je     1422 <check_zip_date+0x2c2>
movzbl 0x1(%r14),%edi
call   1030 <isdigit@plt>
test   %eax,%eax
je     1422 <check_zip_date+0x2c2>
cmpb   $0x3a,0x2(%r14)
jne    1422 <check_zip_date+0x2c2>
movzbl 0x3(%r14),%edi
call   1030 <isdigit@plt>
test   %eax,%eax
je     1422 <check_zip_date+0x2c2>
movzbl 0x4(%r14),%edi
call   1030 <isdigit@plt>
test   %eax,%eax
je     1422 <check_zip_date+0x2c2>
cmpb   $0x3a,0x5(%r14)
jne    1422 <check_zip_date+0x2c2>
movzbl 0x6(%r14),%edi
call   1030 <isdigit@plt>
test   %eax,%eax
je     1422 <check_zip_date+0x2c2>
movzbl 0x7(%r14),%edi
call   1030 <isdigit@plt>
test   %eax,%eax
je     1422 <check_zip_date+0x2c2>
lea    0xde4(%rip),%rsi
lea    0x8(%rsp),%rdx
lea    0x4(%rsp),%rcx
mov    %rsp,%r8
mov    %r14,%rdi
call   1060 <sscanf@plt>
cmp    $0x3,%eax
jne    1422 <check_zip_date+0x2c2>
cmpl   $0x17,0x8(%rsp)
ja     142e <check_zip_date+0x2ce>
mov    0x4(%rsp),%eax
test   %eax,%eax
js     142e <check_zip_date+0x2ce>
cmp    $0x3c,%eax
jg     142e <check_zip_date+0x2ce>
mov    (%rsp),%eax
test   %eax,%eax
js     142e <check_zip_date+0x2ce>
cmp    $0x3e,%eax
jge    142e <check_zip_date+0x2ce>
lea    0x18(%rsp),%r15
xor    %ebp,%ebp
mov    %r15,%rdi
xor    %esi,%esi
mov    $0x1c,%edx
call   1050 <memset@plt>
movl   $0xffffffff,0x18(%rsp)
ff
mov    $0xfffff894,%eax
add    0x14(%rsp),%eax
mov    %eax,0x1c(%rsp)
mov    0x10(%rsp),%eax
add    $0xffffffff,%eax
mov    %eax,0x20(%rsp)
mov    0xc(%rsp),%eax
mov    %eax,0x24(%rsp)
mov    0x8(%rsp),%eax
mov    %eax,0x28(%rsp)
mov    0x4(%rsp),%eax
mov    %eax,0x2c(%rsp)
mov    (%rsp),%eax
mov    %eax,0x30(%rsp)
mov    %r15,%rdi
call   1070 <mktime@plt>
cmp    $0xffffffff,%eax
jne    1400 <check_zip_date+0x2a0>
lea    0xd47(%rip),%rdi
mov    %rbx,%rsi
mov    %r14,%rdx
xor    %eax,%eax
call   1080 <error@plt>
jmp    13fb <check_zip_date+0x29b>
lea    0xc18(%rip),%rdi
jmp    13f1 <check_zip_date+0x291>
lea    0xc45(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1080 <error@plt>
mov    $0xffffffff,%ebp
mov    %ebp,%eax
add    $0x38,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0xc65(%rip),%rdi
jmp    13f1 <check_zip_date+0x291>
lea    0xc71(%rip),%rdi
mov    %r14,%rsi
jmp    13f4 <check_zip_date+0x294>
lea    0xc9a(%rip),%rdi
mov    %r14,%rsi
jmp    13f4 <check_zip_date+0x294>
lea    0xccf(%rip),%rdi
xor    %eax,%eax
call   1080 <error@plt>
jmp    13fb <check_zip_date+0x29b>

LLVM IR (-O0):
%struct.tm = type { i32, i32, i32, i32, i32, i32, i32 }
@.str = [54 x i8] c"date '%s' is invalid, its length is expected to be 10\00"
@.str.1 = [58 x i8] c"date '%s' is invalid, expected to be in YYYY-MM-DD format\00"
@.str.2 = [9 x i8] c"%d-%d-%d\00"
@.str.3 = [21 x i8] c"date '%s' is invalid\00"
@.str.4 = [53 x i8] c"time '%s' is invalid, its length is expected to be 8\00"
@.str.5 = [56 x i8] c"time '%s' is invalid, expected to be in HH:MM:SS format\00"
@.str.6 = [9 x i8] c"%d:%d:%d\00"
@.str.7 = [21 x i8] c"time '%s' is invalid\00"
@.str.8 = [24 x i8] c"date '%s %s' is invalid\00"
define i32 @check_zip_date(i8* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca %struct.tm
%13 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
%14 = load i8*, i8** %4
%15 = call i32 @strlen(i8* %14)
%16 = icmp ne i32 %15, 10
br i1 %16, label %17, label %20
17: ; preds = %2
%18 = load i8*, i8** %4
%19 = call i32 (i8*, ...) @error(i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str, i64 0, i64 0), i8* %18)
store i32 -1, i32* %3
br label %220
20: ; preds = %2
%21 = load i8*, i8** %4
%22 = getelementptr inbounds i8, i8* %21, i64 0
%23 = load i8, i8* %22
%24 = call i32 @isdigit(i8 zeroext %23)
%25 = icmp ne i32 %24, 0
br i1 %25, label %26, label %80
26: ; preds = %20
%27 = load i8*, i8** %4
%28 = getelementptr inbounds i8, i8* %27, i64 1
%29 = load i8, i8* %28
%30 = call i32 @isdigit(i8 zeroext %29)
%31 = icmp ne i32 %30, 0
br i1 %31, label %32, label %80
32: ; preds = %26
%33 = load i8*, i8** %4
%34 = getelementptr inbounds i8, i8* %33, i64 2
%35 = load i8, i8* %34
%36 = call i32 @isdigit(i8 zeroext %35)
%37 = icmp ne i32 %36, 0
br i1 %37, label %38, label %80
38: ; preds = %32
%39 = load i8*, i8** %4
%40 = getelementptr inbounds i8, i8* %39, i64 3
%41 = load i8, i8* %40
%42 = call i32 @isdigit(i8 zeroext %41)
%43 = icmp ne i32 %42, 0
br i1 %43, label %44, label %80
44: ; preds = %38
%45 = load i8*, i8** %4
%46 = getelementptr inbounds i8, i8* %45, i64 4
%47 = load i8, i8* %46
%48 = zext i8 %47 to i32
%49 = icmp ne i32 %48, 45
br i1 %49, label %80, label %50
50: ; preds = %44
%51 = load i8*, i8** %4
%52 = getelementptr inbounds i8, i8* %51, i64 5
%53 = load i8, i8* %52
%54 = call i32 @isdigit(i8 zeroext %53)
%55 = icmp ne i32 %54, 0
br i1 %55, label %56, label %80
56: ; preds = %50
%57 = load i8*, i8** %4
%58 = getelementptr inbounds i8, i8* %57, i64 6
%59 = load i8, i8* %58
%60 = call i32 @isdigit(i8 zeroext %59)
%61 = icmp ne i32 %60, 0
br i1 %61, label %62, label %80
62: ; preds = %56
%63 = load i8*, i8** %4
%64 = getelementptr inbounds i8, i8* %63, i64 7
%65 = load i8, i8* %64
%66 = zext i8 %65 to i32
%67 = icmp ne i32 %66, 45
br i1 %67, label %80, label %68
68: ; preds = %62
%69 = load i8*, i8** %4
%70 = getelementptr inbounds i8, i8* %69, i64 8
%71 = load i8, i8* %70
%72 = call i32 @isdigit(i8 zeroext %71)
%73 = icmp ne i32 %72, 0
br i1 %73, label %74, label %80
74: ; preds = %68
%75 = load i8*, i8** %4
%76 = getelementptr inbounds i8, i8* %75, i64 9
%77 = load i8, i8* %76
%78 = call i32 @isdigit(i8 zeroext %77)
%79 = icmp ne i32 %78, 0
br i1 %79, label %83, label %80
80: ; preds = %74, %68, %62, %56, %50, %44, %38, %32, %26, %20
%81 = load i8*, i8** %4
%82 = call i32 (i8*, ...) @error(i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str.1, i64 0, i64 0), i8* %81)
store i32 -1, i32* %3
br label %220
83: ; preds = %74
%84 = load i8*, i8** %4
%85 = call i32 @sscanf(i8* %84, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0), i32* %6, i32* %7, i32* %8)
%86 = icmp ne i32 %85, 3
br i1 %86, label %87, label %90
87: ; preds = %83
%88 = load i8*, i8** %4
%89 = call i32 (i8*, ...) @error(i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str.1, i64 0, i64 0), i8* %88)
store i32 -1, i32* %3
br label %220
90: ; preds = %83
%91 = load i32, i32* %6
%92 = icmp slt i32 %91, 1950
br i1 %92, label %108, label %93
93: ; preds = %90
%94 = load i32, i32* %6
%95 = icmp sgt i32 %94, 2100
br i1 %95, label %108, label %96
96: ; preds = %93
%97 = load i32, i32* %7
%98 = icmp slt i32 %97, 1
br i1 %98, label %108, label %99
99: ; preds = %96
%100 = load i32, i32* %7
%101 = icmp sgt i32 %100, 12
br i1 %101, label %108, label %102
102: ; preds = %99
%103 = load i32, i32* %8
%104 = icmp slt i32 %103, 1
br i1 %104, label %108, label %105
105: ; preds = %102
%106 = load i32, i32* %8
%107 = icmp sgt i32 %106, 31
br i1 %107, label %108, label %111
108: ; preds = %105, %102, %99, %96, %93, %90
%109 = load i8*, i8** %4
%110 = call i32 (i8*, ...) @error(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.3, i64 0, i64 0), i8* %109)
store i32 -1, i32* %3
br label %220
111: ; preds = %105
%112 = load i8*, i8** %5
%113 = call i32 @strlen(i8* %112)
%114 = icmp ne i32 %113, 8
br i1 %114, label %115, label %118
115: ; preds = %111
%116 = load i8*, i8** %5
%117 = call i32 (i8*, ...) @error(i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str.4, i64 0, i64 0), i8* %116)
store i32 -1, i32* %3
br label %220
118: ; preds = %111
%119 = load i8*, i8** %5
%120 = getelementptr inbounds i8, i8* %119, i64 0
%121 = load i8, i8* %120
%122 = call i32 @isdigit(i8 zeroext %121)
%123 = icmp ne i32 %122, 0
br i1 %123, label %124, label %166
124: ; preds = %118
%125 = load i8*, i8** %5
%126 = getelementptr inbounds i8, i8* %125, i64 1
%127 = load i8, i8* %126
%128 = call i32 @isdigit(i8 zeroext %127)
%129 = icmp ne i32 %128, 0
br i1 %129, label %130, label %166
130: ; preds = %124
%131 = load i8*, i8** %5
%132 = getelementptr inbounds i8, i8* %131, i64 2
%133 = load i8, i8* %132
%134 = zext i8 %133 to i32
%135 = icmp ne i32 %134, 58
br i1 %135, label %166, label %136
136: ; preds = %130
%137 = load i8*, i8** %5
%138 = getelementptr inbounds i8, i8* %137, i64 3
%139 = load i8, i8* %138
%140 = call i32 @isdigit(i8 zeroext %139)
%141 = icmp ne i32 %140, 0
br i1 %141, label %142, label %166
142: ; preds = %136
%143 = load i8*, i8** %5
%144 = getelementptr inbounds i8, i8* %143, i64 4
%145 = load i8, i8* %144
%146 = call i32 @isdigit(i8 zeroext %145)
%147 = icmp ne i32 %146, 0
br i1 %147, label %148, label %166
148: ; preds = %142
%149 = load i8*, i8** %5
%150 = getelementptr inbounds i8, i8* %149, i64 5
%151 = load i8, i8* %150
%152 = zext i8 %151 to i32
%153 = icmp ne i32 %152, 58
br i1 %153, label %166, label %154
154: ; preds = %148
%155 = load i8*, i8** %5
%156 = getelementptr inbounds i8, i8* %155, i64 6
%157 = load i8, i8* %156
%158 = call i32 @isdigit(i8 zeroext %157)
%159 = icmp ne i32 %158, 0
br i1 %159, label %160, label %166
160: ; preds = %154
%161 = load i8*, i8** %5
%162 = getelementptr inbounds i8, i8* %161, i64 7
%163 = load i8, i8* %162
%164 = call i32 @isdigit(i8 zeroext %163)
%165 = icmp ne i32 %164, 0
br i1 %165, label %169, label %166
166: ; preds = %160, %154, %148, %142, %136, %130, %124, %118
%167 = load i8*, i8** %5
%168 = call i32 (i8*, ...) @error(i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str.5, i64 0, i64 0), i8* %167)
store i32 -1, i32* %3
br label %220
169: ; preds = %160
%170 = load i8*, i8** %5
%171 = call i32 @sscanf(i8* %170, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.6, i64 0, i64 0), i32* %9, i32* %10, i32* %11)
%172 = icmp ne i32 %171, 3
br i1 %172, label %173, label %176
173: ; preds = %169
%174 = load i8*, i8** %5
%175 = call i32 (i8*, ...) @error(i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str.5, i64 0, i64 0), i8* %174)
store i32 -1, i32* %3
br label %220
176: ; preds = %169
%177 = load i32, i32* %9
%178 = icmp slt i32 %177, 0
br i1 %178, label %194, label %179
179: ; preds = %176
%180 = load i32, i32* %9
%181 = icmp sgt i32 %180, 23
br i1 %181, label %194, label %182
182: ; preds = %179
%183 = load i32, i32* %10
%184 = icmp slt i32 %183, 0
br i1 %184, label %194, label %185
185: ; preds = %182
%186 = load i32, i32* %10
%187 = icmp sgt i32 %186, 60
br i1 %187, label %194, label %188
188: ; preds = %185
%189 = load i32, i32* %11
%190 = icmp slt i32 %189, 0
br i1 %190, label %194, label %191
191: ; preds = %188
%192 = load i32, i32* %11
%193 = icmp sgt i32 %192, 61
br i1 %193, label %194, label %196
194: ; preds = %191, %188, %185, %182, %179, %176
%195 = call i32 (i8*, ...) @error(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.7, i64 0, i64 0))
store i32 -1, i32* %3
br label %220
196: ; preds = %191
%197 = call i32 @memset(%struct.tm* %12, i32 0, i32 28)
%198 = getelementptr inbounds %struct.tm, %struct.tm* %12, i32 0, i32 0
store i32 -1, i32* %198
%199 = load i32, i32* %6
%200 = sub nsw i32 %199, 1900
%201 = getelementptr inbounds %struct.tm, %struct.tm* %12, i32 0, i32 1
store i32 %200, i32* %201
%202 = load i32, i32* %7
%203 = sub nsw i32 %202, 1
%204 = getelementptr inbounds %struct.tm, %struct.tm* %12, i32 0, i32 2
store i32 %203, i32* %204
%205 = load i32, i32* %8
%206 = getelementptr inbounds %struct.tm, %struct.tm* %12, i32 0, i32 3
store i32 %205, i32* %206
%207 = load i32, i32* %9
%208 = getelementptr inbounds %struct.tm, %struct.tm* %12, i32 0, i32 4
store i32 %207, i32* %208
%209 = load i32, i32* %10
%210 = getelementptr inbounds %struct.tm, %struct.tm* %12, i32 0, i32 5
store i32 %209, i32* %210
%211 = load i32, i32* %11
%212 = getelementptr inbounds %struct.tm, %struct.tm* %12, i32 0, i32 6
store i32 %211, i32* %212
%213 = call i32 @mktime(%struct.tm* %12)
store i32 %213, i32* %13
%214 = icmp eq i32 %213, -1
br i1 %214, label %215, label %219
215: ; preds = %196
%216 = load i8*, i8** %4
%217 = load i8*, i8** %5
%218 = call i32 (i8*, ...) @error(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.8, i64 0, i64 0), i8* %216, i8* %217)
store i32 -1, i32* %3
br label %220
219: ; preds = %196
store i32 0, i32* %3
br label %220
220: ; preds = %219, %215, %194, %173, %166, %115, %108, %87, %80, %17
%221 = load i32, i32* %3
ret i32 %221
}

LLVM IR (-O2):
%struct.tm = type { i32, i32, i32, i32, i32, i32, i32 }
@.str = [54 x i8] c"date '%s' is invalid, its length is expected to be 10\00"
@.str.1 = [58 x i8] c"date '%s' is invalid, expected to be in YYYY-MM-DD format\00"
@.str.2 = [9 x i8] c"%d-%d-%d\00"
@.str.3 = [21 x i8] c"date '%s' is invalid\00"
@.str.4 = [53 x i8] c"time '%s' is invalid, its length is expected to be 8\00"
@.str.5 = [56 x i8] c"time '%s' is invalid, expected to be in HH:MM:SS format\00"
@.str.6 = [9 x i8] c"%d:%d:%d\00"
@.str.7 = [21 x i8] c"time '%s' is invalid\00"
@.str.8 = [24 x i8] c"date '%s %s' is invalid\00"
define i32 @check_zip_date(i8* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca %struct.tm
%10 = bitcast i32* %3 to i8*
%11 = bitcast i32* %4 to i8*
%12 = bitcast i32* %5 to i8*
%13 = bitcast i32* %6 to i8*
%14 = bitcast i32* %7 to i8*
%15 = bitcast i32* %8 to i8*
%16 = bitcast %struct.tm* %9 to i8*
%17 = tail call i32 @strlen(i8* %0)
%18 = icmp eq i32 %17, 10
br i1 %18, label %21, label %19
19: ; preds = %2
%20 = tail call i32 (i8*, ...) @error(i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str, i64 0, i64 0), i8* %0)
br label %176
21: ; preds = %2
%22 = load i8, i8* %0
%23 = tail call i32 @isdigit(i8 zeroext %22)
%24 = icmp eq i32 %23, 0
br i1 %24, label %68, label %25
25: ; preds = %21
%26 = getelementptr inbounds i8, i8* %0, i64 1
%27 = load i8, i8* %26
%28 = tail call i32 @isdigit(i8 zeroext %27)
%29 = icmp eq i32 %28, 0
br i1 %29, label %68, label %30
30: ; preds = %25
%31 = getelementptr inbounds i8, i8* %0, i64 2
%32 = load i8, i8* %31
%33 = tail call i32 @isdigit(i8 zeroext %32)
%34 = icmp eq i32 %33, 0
br i1 %34, label %68, label %35
35: ; preds = %30
%36 = getelementptr inbounds i8, i8* %0, i64 3
%37 = load i8, i8* %36
%38 = tail call i32 @isdigit(i8 zeroext %37)
%39 = icmp eq i32 %38, 0
br i1 %39, label %68, label %40
40: ; preds = %35
%41 = getelementptr inbounds i8, i8* %0, i64 4
%42 = load i8, i8* %41
%43 = icmp eq i8 %42, 45
br i1 %43, label %44, label %68
44: ; preds = %40
%45 = getelementptr inbounds i8, i8* %0, i64 5
%46 = load i8, i8* %45
%47 = tail call i32 @isdigit(i8 zeroext %46)
%48 = icmp eq i32 %47, 0
br i1 %48, label %68, label %49
49: ; preds = %44
%50 = getelementptr inbounds i8, i8* %0, i64 6
%51 = load i8, i8* %50
%52 = tail call i32 @isdigit(i8 zeroext %51)
%53 = icmp eq i32 %52, 0
br i1 %53, label %68, label %54
54: ; preds = %49
%55 = getelementptr inbounds i8, i8* %0, i64 7
%56 = load i8, i8* %55
%57 = icmp eq i8 %56, 45
br i1 %57, label %58, label %68
58: ; preds = %54
%59 = getelementptr inbounds i8, i8* %0, i64 8
%60 = load i8, i8* %59
%61 = tail call i32 @isdigit(i8 zeroext %60)
%62 = icmp eq i32 %61, 0
br i1 %62, label %68, label %63
63: ; preds = %58
%64 = getelementptr inbounds i8, i8* %0, i64 9
%65 = load i8, i8* %64
%66 = tail call i32 @isdigit(i8 zeroext %65)
%67 = icmp eq i32 %66, 0
br i1 %67, label %68, label %70
68: ; preds = %63, %58, %54, %49, %44, %40, %35, %30, %25, %21
%69 = tail call i32 (i8*, ...) @error(i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str.1, i64 0, i64 0), i8* %0)
br label %176
70: ; preds = %63
%71 = call i32 @sscanf(i8* %0, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0), i32* %3, i32* %4, i32* %5)
%72 = icmp eq i32 %71, 3
br i1 %72, label %75, label %73
73: ; preds = %70
%74 = call i32 (i8*, ...) @error(i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str.1, i64 0, i64 0), i8* %0)
br label %176
75: ; preds = %70
%76 = load i32, i32* %3
%77 = add i32 %76, -2101
%78 = icmp ult i32 %77, -151
%79 = load i32, i32* %4
%80 = icmp slt i32 %79, 1
%81 = select i1 %78, i1 true, i1 %80
%82 = icmp sgt i32 %79, 12
%83 = select i1 %81, i1 true, i1 %82
%84 = load i32, i32* %5
%85 = icmp slt i32 %84, 1
%86 = select i1 %83, i1 true, i1 %85
%87 = icmp sgt i32 %84, 31
%88 = select i1 %86, i1 true, i1 %87
br i1 %88, label %89, label %91
89: ; preds = %75
%90 = call i32 (i8*, ...) @error(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.3, i64 0, i64 0), i8* %0)
br label %176
91: ; preds = %75
%92 = call i32 @strlen(i8* %1)
%93 = icmp eq i32 %92, 8
br i1 %93, label %96, label %94
94: ; preds = %91
%95 = call i32 (i8*, ...) @error(i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str.4, i64 0, i64 0), i8* %1)
br label %176
96: ; preds = %91
%97 = load i8, i8* %1
%98 = call i32 @isdigit(i8 zeroext %97)
%99 = icmp eq i32 %98, 0
br i1 %99, label %133, label %100
100: ; preds = %96
%101 = getelementptr inbounds i8, i8* %1, i64 1
%102 = load i8, i8* %101
%103 = call i32 @isdigit(i8 zeroext %102)
%104 = icmp eq i32 %103, 0
br i1 %104, label %133, label %105
105: ; preds = %100
%106 = getelementptr inbounds i8, i8* %1, i64 2
%107 = load i8, i8* %106
%108 = icmp eq i8 %107, 58
br i1 %108, label %109, label %133
109: ; preds = %105
%110 = getelementptr inbounds i8, i8* %1, i64 3
%111 = load i8, i8* %110
%112 = call i32 @isdigit(i8 zeroext %111)
%113 = icmp eq i32 %112, 0
br i1 %113, label %133, label %114
114: ; preds = %109
%115 = getelementptr inbounds i8, i8* %1, i64 4
%116 = load i8, i8* %115
%117 = call i32 @isdigit(i8 zeroext %116)
%118 = icmp eq i32 %117, 0
br i1 %118, label %133, label %119
119: ; preds = %114
%120 = getelementptr inbounds i8, i8* %1, i64 5
%121 = load i8, i8* %120
%122 = icmp eq i8 %121, 58
br i1 %122, label %123, label %133
123: ; preds = %119
%124 = getelementptr inbounds i8, i8* %1, i64 6
%125 = load i8, i8* %124
%126 = call i32 @isdigit(i8 zeroext %125)
%127 = icmp eq i32 %126, 0
br i1 %127, label %133, label %128
128: ; preds = %123
%129 = getelementptr inbounds i8, i8* %1, i64 7
%130 = load i8, i8* %129
%131 = call i32 @isdigit(i8 zeroext %130)
%132 = icmp eq i32 %131, 0
br i1 %132, label %133, label %135
133: ; preds = %128, %123, %119, %114, %109, %105, %100, %96
%134 = call i32 (i8*, ...) @error(i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str.5, i64 0, i64 0), i8* %1)
br label %176
135: ; preds = %128
%136 = call i32 @sscanf(i8* %1, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.6, i64 0, i64 0), i32* %6, i32* %7, i32* %8)
%137 = icmp eq i32 %136, 3
br i1 %137, label %140, label %138
138: ; preds = %135
%139 = call i32 (i8*, ...) @error(i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str.5, i64 0, i64 0), i8* %1)
br label %176
140: ; preds = %135
%141 = load i32, i32* %6
%142 = icmp ugt i32 %141, 23
%143 = load i32, i32* %7
%144 = icmp slt i32 %143, 0
%145 = select i1 %142, i1 true, i1 %144
%146 = icmp sgt i32 %143, 60
%147 = select i1 %145, i1 true, i1 %146
%148 = load i32, i32* %8
%149 = icmp slt i32 %148, 0
%150 = select i1 %147, i1 true, i1 %149
%151 = icmp sgt i32 %148, 61
%152 = select i1 %150, i1 true, i1 %151
br i1 %152, label %153, label %155
153: ; preds = %140
%154 = call i32 (i8*, ...) @error(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.7, i64 0, i64 0))
br label %176
155: ; preds = %140
%156 = call i32 @memset(%struct.tm* %9, i32 0, i32 28)
%157 = getelementptr inbounds %struct.tm, %struct.tm* %9, i64 0, i32 0
store i32 -1, i32* %157
%158 = load i32, i32* %3
%159 = add nsw i32 %158, -1900
%160 = getelementptr inbounds %struct.tm, %struct.tm* %9, i64 0, i32 1
store i32 %159, i32* %160
%161 = load i32, i32* %4
%162 = add nsw i32 %161, -1
%163 = getelementptr inbounds %struct.tm, %struct.tm* %9, i64 0, i32 2
store i32 %162, i32* %163
%164 = load i32, i32* %5
%165 = getelementptr inbounds %struct.tm, %struct.tm* %9, i64 0, i32 3
store i32 %164, i32* %165
%166 = load i32, i32* %6
%167 = getelementptr inbounds %struct.tm, %struct.tm* %9, i64 0, i32 4
store i32 %166, i32* %167
%168 = load i32, i32* %7
%169 = getelementptr inbounds %struct.tm, %struct.tm* %9, i64 0, i32 5
store i32 %168, i32* %169
%170 = load i32, i32* %8
%171 = getelementptr inbounds %struct.tm, %struct.tm* %9, i64 0, i32 6
store i32 %170, i32* %171
%172 = call i32 @mktime(%struct.tm* %9)
%173 = icmp eq i32 %172, -1
br i1 %173, label %174, label %176
174: ; preds = %155
%175 = call i32 (i8*, ...) @error(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.8, i64 0, i64 0), i8* %0, i8* %1)
br label %176
176: ; preds = %155, %174, %153, %138, %133, %94, %89, %73, %68, %19
%177 = phi i32 [ -1, %19 ], [ -1, %68 ], [ -1, %73 ], [ -1, %89 ], [ -1, %94 ], [ -1, %133 ], [ -1, %138 ], [ -1, %153 ], [ -1, %174 ], [ 0, %155 ]
ret i32 %177
}