#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 */

/* Variables and functions */
int /*<<< orphan*/ correct_month(char *, int *);
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, char *);
int main() {
  char egn[12];
  int helper = 1;
  scanf("%s", egn);
  if (egn[0] == '0' && egn[1] == '0') {
    if (egn[2] < 50 || egn[2] > 53)
      helper = 0;
  } else {
    if (egn[2] < 48 || egn[2] > 53)
      helper = 0;
    if (egn[3] > 50)
      helper = 0;
    correct_month(egn, &helper);
  }
  printf("%d", helper);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x14(%rbp)
lea    -0x10(%rbp),%rsi
lea    0xeaf(%rip),%rdi
call   1050 <scanf@plt>
movsbl -0x10(%rbp),%eax
cmp    $0x30,%eax
jne    1196 <main+0x66>
movsbl -0xf(%rbp),%eax
cmp    $0x30,%eax
jne    1196 <main+0x66>
movsbl -0xe(%rbp),%eax
cmp    $0x32,%eax
jl     118a <main+0x5a>
movsbl -0xe(%rbp),%eax
cmp    $0x35,%eax
jle    1191 <main+0x61>
movl   $0x0,-0x14(%rbp)
jmp    11d8 <main+0xa8>
movsbl -0xe(%rbp),%eax
cmp    $0x30,%eax
jl     11b0 <main+0x80>
movsbl -0xe(%rbp),%eax
cmp    $0x35,%eax
jle    11b7 <main+0x87>
movl   $0x0,-0x14(%rbp)
movsbl -0xd(%rbp),%eax
cmp    $0x32,%eax
jle    11cb <main+0x9b>
movl   $0x0,-0x14(%rbp)
lea    -0x10(%rbp),%rdi
lea    -0x14(%rbp),%rsi
call   1040 <correct_month@plt>
mov    -0x14(%rbp),%esi
lea    0xe21(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
movl   $0x1,0x8(%rsp)
lea    0xebd(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1050 <scanf@plt>
mov    0xe(%rsp),%al
add    $0xca,%al
cmpb   $0x30,0xc(%rsp)
jne    1176 <main+0x46>
cmpb   $0x30,0xd(%rsp)
jne    1176 <main+0x46>
mov    $0x1,%esi
cmp    $0xfb,%al
ja     11a4 <main+0x74>
movl   $0x0,0x8(%rsp)
xor    %esi,%esi
jmp    11a4 <main+0x74>
cmp    $0xf9,%al
ja     1182 <main+0x52>
movl   $0x0,0x8(%rsp)
cmpb   $0x33,0xf(%rsp)
jl     1191 <main+0x61>
movl   $0x0,0x8(%rsp)
lea    0xc(%rsp),%rdi
lea    0x8(%rsp),%rsi
call   1040 <correct_month@plt>
mov    0x8(%rsp),%esi
lea    0xe58(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
@.str.1 = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [12 x i8]
%3 = alloca i32
store i32 0, i32* %1
store i32 1, i32* %3
%4 = getelementptr inbounds [12 x i8], [12 x i8]* %2, i64 0, i64 0
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = getelementptr inbounds [12 x i8], [12 x i8]* %2, i64 0, i64 0
%7 = load i8, i8* %6
%8 = sext i8 %7 to i32
%9 = icmp eq i32 %8, 48
br i1 %9, label %10, label %27
10: ; preds = %0
%11 = getelementptr inbounds [12 x i8], [12 x i8]* %2, i64 0, i64 1
%12 = load i8, i8* %11
%13 = sext i8 %12 to i32
%14 = icmp eq i32 %13, 48
br i1 %14, label %15, label %27
15: ; preds = %10
%16 = getelementptr inbounds [12 x i8], [12 x i8]* %2, i64 0, i64 2
%17 = load i8, i8* %16
%18 = sext i8 %17 to i32
%19 = icmp slt i32 %18, 50
br i1 %19, label %25, label %20
20: ; preds = %15
%21 = getelementptr inbounds [12 x i8], [12 x i8]* %2, i64 0, i64 2
%22 = load i8, i8* %21
%23 = sext i8 %22 to i32
%24 = icmp sgt i32 %23, 53
br i1 %24, label %25, label %26
25: ; preds = %20, %15
store i32 0, i32* %3
br label %26
26: ; preds = %25, %20
br label %47
27: ; preds = %10, %0
%28 = getelementptr inbounds [12 x i8], [12 x i8]* %2, i64 0, i64 2
%29 = load i8, i8* %28
%30 = sext i8 %29 to i32
%31 = icmp slt i32 %30, 48
br i1 %31, label %37, label %32
32: ; preds = %27
%33 = getelementptr inbounds [12 x i8], [12 x i8]* %2, i64 0, i64 2
%34 = load i8, i8* %33
%35 = sext i8 %34 to i32
%36 = icmp sgt i32 %35, 53
br i1 %36, label %37, label %38
37: ; preds = %32, %27
store i32 0, i32* %3
br label %38
38: ; preds = %37, %32
%39 = getelementptr inbounds [12 x i8], [12 x i8]* %2, i64 0, i64 3
%40 = load i8, i8* %39
%41 = sext i8 %40 to i32
%42 = icmp sgt i32 %41, 50
br i1 %42, label %43, label %44
43: ; preds = %38
store i32 0, i32* %3
br label %44
44: ; preds = %43, %38
%45 = getelementptr inbounds [12 x i8], [12 x i8]* %2, i64 0, i64 0
%46 = call i32 @correct_month(i8* %45, i32* %3)
br label %47
47: ; preds = %44, %26
%48 = load i32, i32* %3
%49 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %48)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
@.str.1 = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca [12 x i8]
%2 = alloca i32
%3 = getelementptr inbounds [12 x i8], [12 x i8]* %1, i64 0, i64 0
%4 = bitcast i32* %2 to i8*
store i32 1, i32* %2
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %3)
%6 = load i8, i8* %3
%7 = icmp eq i8 %6, 48
%8 = getelementptr inbounds [12 x i8], [12 x i8]* %1, i64 0, i64 1
%9 = load i8, i8* %8
%10 = icmp eq i8 %9, 48
%11 = select i1 %7, i1 %10, i1 false
%12 = getelementptr inbounds [12 x i8], [12 x i8]* %1, i64 0, i64 2
%13 = load i8, i8* %12
%14 = add i8 %13, -54
br i1 %11, label %15, label %18
15: ; preds = %0
%16 = icmp ult i8 %14, -4
br i1 %16, label %17, label %29
17: ; preds = %15
store i32 0, i32* %2
br label %29
18: ; preds = %0
%19 = icmp ult i8 %14, -6
br i1 %19, label %20, label %21
20: ; preds = %18
store i32 0, i32* %2
br label %21
21: ; preds = %18, %20
%22 = getelementptr inbounds [12 x i8], [12 x i8]* %1, i64 0, i64 3
%23 = load i8, i8* %22
%24 = icmp sgt i8 %23, 50
br i1 %24, label %25, label %26
25: ; preds = %21
store i32 0, i32* %2
br label %26
26: ; preds = %25, %21
%27 = call i32 @correct_month(i8* %3, i32* %2)
%28 = load i32, i32* %2
br label %29
29: ; preds = %17, %15, %26
%30 = phi i32 [ 0, %17 ], [ 1, %15 ], [ %28, %26 ]
%31 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %30)
ret i32 0
}