#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 control_digit(char *, int *);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, char *);
int valid_Date(char *);
int main() {
  char egn[12];
  int multiplier[9] = {2, 4, 8, 5, 10, 9, 7, 3, 6};
  int ctrdigit, valmonth;
  scanf("%s", egn);
  valmonth = valid_Date(egn);
  ctrdigit = control_digit(egn, multiplier);
  if ((ctrdigit == (egn[9] - '0')) && (valmonth == 1))
    printf("1");
  else
    printf("0");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x40(%rbp),%rdi
lea    0xe96(%rip),%rsi
mov    $0x24,%edx
call   1040 <memcpy@plt>
lea    -0x10(%rbp),%rsi
lea    0xea5(%rip),%rdi
call   1060 <scanf@plt>
lea    -0x10(%rbp),%rdi
call   1050 <valid_Date@plt>
mov    %eax,-0x48(%rbp)
lea    -0x10(%rbp),%rdi
lea    -0x40(%rbp),%rsi
call   1070 <control_digit@plt>
mov    %eax,-0x44(%rbp)
mov    -0x44(%rbp),%eax
movsbl -0x7(%rbp),%ecx
sub    $0x30,%ecx
cmp    %ecx,%eax
jne    11cd <main+0x7d>
cmpl   $0x1,-0x48(%rbp)
jne    11cd <main+0x7d>
lea    0xe64(%rip),%rdi
call   1030 <printf@plt>
jmp    11d9 <main+0x89>
lea    0xe55(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
sub    $0x38,%rsp
mov    0xed4(%rip),%eax
mov    %eax,0x30(%rsp)
movaps 0xeb9(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movaps 0xe9d(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
lea    0xeb5(%rip),%rdi
lea    0x4(%rsp),%rbx
mov    %rbx,%rsi
call   1050 <scanf@plt>
mov    %rbx,%rdi
call   1040 <valid_Date@plt>
mov    %eax,%ebp
lea    0x10(%rsp),%rsi
mov    %rbx,%rdi
call   1060 <control_digit@plt>
movsbl 0xd(%rsp),%ecx
add    $0xffffffd0,%ecx
xor    %eax,%ecx
xor    $0x1,%ebp
xor    %edi,%edi
or     %ecx,%ebp
sete   %dil
or     $0x30,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
add    $0x38,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@__const.main.multiplier = [9 x i32] [i32 2, i32 4, i32 8, i32 5, i32 10, i32 9, i32 7, i32 3, i32 6]
@.str = [3 x i8] c"%s\00"
@.str.1 = [2 x i8] c"1\00"
@.str.2 = [2 x i8] c"0\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [12 x i8]
%3 = alloca [9 x i32]
%4 = alloca i32
%5 = alloca i32
store i32 0, i32* %1
%6 = bitcast [9 x i32]* %3 to i8*
%7 = getelementptr inbounds [12 x i8], [12 x i8]* %2, i64 0, i64 0
%8 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %7)
%9 = getelementptr inbounds [12 x i8], [12 x i8]* %2, i64 0, i64 0
%10 = call i32 @valid_Date(i8* %9)
store i32 %10, i32* %5
%11 = getelementptr inbounds [12 x i8], [12 x i8]* %2, i64 0, i64 0
%12 = getelementptr inbounds [9 x i32], [9 x i32]* %3, i64 0, i64 0
%13 = call i32 @control_digit(i8* %11, i32* %12)
store i32 %13, i32* %4
%14 = load i32, i32* %4
%15 = getelementptr inbounds [12 x i8], [12 x i8]* %2, i64 0, i64 9
%16 = load i8, i8* %15
%17 = sext i8 %16 to i32
%18 = sub nsw i32 %17, 48
%19 = icmp eq i32 %14, %18
br i1 %19, label %20, label %25
20: ; preds = %0
%21 = load i32, i32* %5
%22 = icmp eq i32 %21, 1
br i1 %22, label %23, label %25
23: ; preds = %20
%24 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
br label %27
25: ; preds = %20, %0
%26 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
br label %27
27: ; preds = %25, %23
ret i32 0
}

LLVM IR (-O2):
@__const.main.multiplier = [9 x i32] [i32 2, i32 4, i32 8, i32 5, i32 10, i32 9, i32 7, i32 3, i32 6]
@.str = [3 x i8] c"%s\00"
define i32 @main() {
%1 = alloca [12 x i8]
%2 = alloca [9 x i32]
%3 = getelementptr inbounds [12 x i8], [12 x i8]* %1, i64 0, i64 0
%4 = bitcast [9 x i32]* %2 to i8*
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %3)
%6 = call i32 @valid_Date(i8* %3)
%7 = getelementptr inbounds [9 x i32], [9 x i32]* %2, i64 0, i64 0
%8 = call i32 @control_digit(i8* %3, i32* %7)
%9 = getelementptr inbounds [12 x i8], [12 x i8]* %1, i64 0, i64 9
%10 = load i8, i8* %9
%11 = sext i8 %10 to i32
%12 = add nsw i32 %11, -48
%13 = icmp eq i32 %8, %12
%14 = icmp eq i32 %6, 1
%15 = select i1 %13, i1 %14, i1 false
%16 = select i1 %15, i32 49, i32 48
%17 = call i32 @putchar(i32 %16)
ret i32 0
}