#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 (!(input + 10 == strptime(input, "%Y-%m-%d", &tm) &&
            114 == tm.tm_year && 0 == tm.tm_mon && 4 == tm.tm_mday));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%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),%rax
add    $0xa,%rax
mov    %rax,-0x38(%rbp)
lea    -0x2b(%rbp),%rdi
lea    0xeb6(%rip),%rsi
lea    -0x20(%rbp),%rdx
call   1030 <strptime@plt>
mov    -0x38(%rbp),%rcx
mov    %rax,%rdx
xor    %eax,%eax
cmp    %rdx,%rcx
mov    %al,-0x2c(%rbp)
jne    11a5 <main+0x95>
xor    %eax,%eax
mov    $0x72,%ecx
cmp    -0x20(%rbp),%ecx
mov    %al,-0x2c(%rbp)
jne    11a5 <main+0x95>
xor    %eax,%eax
xor    %ecx,%ecx
cmp    -0x18(%rbp),%rcx
mov    %al,-0x2c(%rbp)
jne    11a5 <main+0x95>
mov    $0x4,%eax
cmp    -0x10(%rbp),%eax
sete   %al
mov    %al,-0x2c(%rbp)
mov    -0x2c(%rbp),%al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x30,%rsp
movabs $0x2d31302d34313032,%rax
30 31 2d
mov    %rax,0x8(%rsp)
movl   $0x34302d,0xf(%rsp)
lea    0x12(%rsp),%rbx
lea    0xed3(%rip),%rsi
lea    0x8(%rsp),%rdi
lea    0x18(%rsp),%rdx
call   1030 <strptime@plt>
cmp    %rax,%rbx
setne  %al
cmpl   $0x72,0x18(%rsp)
setne  %cl
or     %al,%cl
cmpq   $0x0,0x20(%rsp)
setne  %al
cmpl   $0x4,0x28(%rsp)
setne  %dl
or     %al,%dl
or     %cl,%dl
movzbl %dl,%eax
add    $0x30,%rsp
pop    %rbx
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 = getelementptr inbounds i8, i8* %5, i64 10
%7 = getelementptr inbounds [11 x i8], [11 x i8]* %3, i64 0, i64 0
%8 = call i8* @strptime(i8* %7, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), %struct.tm* %2)
%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 114, %12
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 0, %16
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 4, %20
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 = getelementptr inbounds [11 x i8], [11 x i8]* %2, i64 0, i64 10
%6 = call i8* @strptime(i8* %4, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), %struct.tm* %1)
%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
}