#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 */
struct tm {
  int tm_year;
  scalar_t__ tm_mon;
  int tm_mday;
};

/* Variables and functions */
char const *strptime(char const *, char *, struct tm *);
int main(void) {
  struct tm tm;
  const char input[] = "2014-01-04";
  return !(strptime(input, "%Y-%m-%d", &tm) == input + 10 &&
           tm.tm_year == 114 && tm.tm_mon == 0 && tm.tm_mday == 4);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeda(%rip),%rax
mov    %rax,-0x2b(%rbp)
mov    0xed7(%rip),%ax
mov    %ax,-0x23(%rbp)
mov    0xecf(%rip),%al
mov    %al,-0x21(%rbp)
lea    -0x2b(%rbp),%rdi
lea    0xec2(%rip),%rsi
lea    -0x20(%rbp),%rdx
call   1030 <strptime@plt>
mov    %rax,%rcx
lea    -0x2b(%rbp),%rdx
add    $0xa,%rdx
xor    %eax,%eax
cmp    %rdx,%rcx
mov    %al,-0x2c(%rbp)
jne    1194 <main+0x84>
xor    %eax,%eax
cmpl   $0x72,-0x20(%rbp)
mov    %al,-0x2c(%rbp)
jne    1194 <main+0x84>
xor    %eax,%eax
cmpq   $0x0,-0x18(%rbp)
mov    %al,-0x2c(%rbp)
jne    1194 <main+0x84>
cmpl   $0x4,-0x10(%rbp)
sete   %al
mov    %al,-0x2c(%rbp)
mov    -0x2c(%rbp),%al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x28,%rsp
movabs $0x2d31302d34313032,%rax
30 31 2d
mov    %rax,(%rsp)
movl   $0x34302d,0x7(%rsp)
lea    0xeda(%rip),%rsi
mov    %rsp,%rdi
lea    0x10(%rsp),%rdx
call   1030 <strptime@plt>
lea    0xa(%rsp),%rcx
cmp    %rcx,%rax
setne  %al
cmpl   $0x72,0x10(%rsp)
setne  %cl
or     %al,%cl
cmpq   $0x0,0x18(%rsp)
setne  %al
cmpl   $0x4,0x20(%rsp)
setne  %dl
or     %al,%dl
or     %cl,%dl
movzbl %dl,%eax
add    $0x28,%rsp
ret

LLVM IR (-O0):
%struct.tm = type { i32, i64, i32 }
@__const.main.input = [11 x i8] c"2014-01-04\00"
@.str = [9 x i8] c"%Y-%m-%d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca %struct.tm
%3 = alloca [11 x i8]
store i32 0, i32* %1
%4 = bitcast [11 x i8]* %3 to i8*
%5 = getelementptr inbounds [11 x i8], [11 x i8]* %3, i64 0, i64 0
%6 = call i8* @strptime(i8* %5, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), %struct.tm* %2)
%7 = getelementptr inbounds [11 x i8], [11 x i8]* %3, i64 0, i64 0
%8 = getelementptr inbounds i8, i8* %7, i64 10
%9 = icmp eq i8* %6, %8
br i1 %9, label %10, label %22
10: ; preds = %0
%11 = getelementptr inbounds %struct.tm, %struct.tm* %2, i32 0, i32 0
%12 = load i32, i32* %11
%13 = icmp eq i32 %12, 114
br i1 %13, label %14, label %22
14: ; preds = %10
%15 = getelementptr inbounds %struct.tm, %struct.tm* %2, i32 0, i32 1
%16 = load i64, i64* %15
%17 = icmp eq i64 %16, 0
br i1 %17, label %18, label %22
18: ; preds = %14
%19 = getelementptr inbounds %struct.tm, %struct.tm* %2, i32 0, i32 2
%20 = load i32, i32* %19
%21 = icmp eq i32 %20, 4
br label %22
22: ; preds = %18, %14, %10, %0
%23 = phi i1 [ false, %14 ], [ false, %10 ], [ false, %0 ], [ %21, %18 ]
%24 = xor i1 %23, true
%25 = zext i1 %24 to i32
ret i32 %25
}

LLVM IR (-O2):
%struct.tm = type { i32, i64, i32 }
@__const.main.input = [11 x i8] c"2014-01-04\00"
@.str = [9 x i8] c"%Y-%m-%d\00"
define i32 @main() {
%1 = alloca %struct.tm
%2 = alloca [11 x i8]
%3 = bitcast %struct.tm* %1 to i8*
%4 = getelementptr inbounds [11 x i8], [11 x i8]* %2, i64 0, i64 0
%5 = call i8* @strptime(i8* %4, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), %struct.tm* %1)
%6 = getelementptr inbounds [11 x i8], [11 x i8]* %2, i64 0, i64 10
%7 = icmp ne i8* %5, %6
%8 = getelementptr inbounds %struct.tm, %struct.tm* %1, i64 0, i32 0
%9 = load i32, i32* %8
%10 = icmp ne i32 %9, 114
%11 = select i1 %7, i1 true, i1 %10
%12 = getelementptr inbounds %struct.tm, %struct.tm* %1, i64 0, i32 1
%13 = load i64, i64* %12
%14 = icmp ne i64 %13, 0
%15 = select i1 %11, i1 true, i1 %14
%16 = getelementptr inbounds %struct.tm, %struct.tm* %1, i64 0, i32 2
%17 = load i32, i32* %16
%18 = icmp ne i32 %17, 4
%19 = select i1 %15, i1 true, i1 %18
%20 = zext i1 %19 to i32
ret i32 %20
}