#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 check_control_number(char *);
int check_date(char *);
int check_symbols(char *);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, char *);
int main() {
  char serial_number[12];
  scanf("%s", serial_number);
  if (check_symbols(serial_number) == 1) {
    if (check_date(serial_number) == 1) {
      if (check_control_number(serial_number) == 1) {
        printf("1");
        return 0;
      }
    }
  }
  printf("0");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x10(%rbp),%rsi
lea    0xe96(%rip),%rdi
call   1070 <scanf@plt>
lea    -0x10(%rbp),%rdi
call   1030 <check_symbols@plt>
cmp    $0x1,%eax
jne    11c7 <main+0x77>
lea    -0x10(%rbp),%rdi
call   1050 <check_date@plt>
cmp    $0x1,%eax
jne    11c2 <main+0x72>
lea    -0x10(%rbp),%rdi
call   1060 <check_control_number@plt>
cmp    $0x1,%eax
jne    11bd <main+0x6d>
lea    0xe57(%rip),%rdi
call   1040 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    11da <main+0x8a>
jmp    11c2 <main+0x72>
jmp    11c7 <main+0x77>
lea    0xe37(%rip),%rdi
call   1040 <printf@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xea4(%rip),%rdi
lea    0x4(%rsp),%rbx
mov    %rbx,%rsi
call   1070 <scanf@plt>
mov    %rbx,%rdi
call   1040 <check_symbols@plt>
cmp    $0x1,%eax
jne    1199 <main+0x49>
lea    0x4(%rsp),%rdi
call   1050 <check_date@plt>
cmp    $0x1,%eax
jne    1199 <main+0x49>
lea    0x4(%rsp),%rdi
call   1060 <check_control_number@plt>
mov    $0x31,%edi
cmp    $0x1,%eax
je     119e <main+0x4e>
mov    $0x30,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.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]
store i32 0, i32* %1
%3 = getelementptr inbounds [12 x i8], [12 x i8]* %2, i64 0, i64 0
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = getelementptr inbounds [12 x i8], [12 x i8]* %2, i64 0, i64 0
%6 = call i32 @check_symbols(i8* %5)
%7 = icmp eq i32 %6, 1
br i1 %7, label %8, label %20
8: ; preds = %0
%9 = getelementptr inbounds [12 x i8], [12 x i8]* %2, i64 0, i64 0
%10 = call i32 @check_date(i8* %9)
%11 = icmp eq i32 %10, 1
br i1 %11, label %12, label %19
12: ; preds = %8
%13 = getelementptr inbounds [12 x i8], [12 x i8]* %2, i64 0, i64 0
%14 = call i32 @check_control_number(i8* %13)
%15 = icmp eq i32 %14, 1
br i1 %15, label %16, label %18
16: ; preds = %12
%17 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32 0, i32* %1
br label %22
18: ; preds = %12
br label %19
19: ; preds = %18, %8
br label %20
20: ; preds = %19, %0
%21 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
store i32 0, i32* %1
br label %22
22: ; preds = %20, %16
%23 = load i32, i32* %1
ret i32 %23
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define i32 @main() {
%1 = alloca [12 x i8]
%2 = getelementptr inbounds [12 x i8], [12 x i8]* %1, i64 0, i64 0
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %2)
%4 = call i32 @check_symbols(i8* %2)
%5 = icmp eq i32 %4, 1
br i1 %5, label %6, label %12
6: ; preds = %0
%7 = call i32 @check_date(i8* %2)
%8 = icmp eq i32 %7, 1
br i1 %8, label %9, label %12
9: ; preds = %6
%10 = call i32 @check_control_number(i8* %2)
%11 = icmp eq i32 %10, 1
br i1 %11, label %13, label %12
12: ; preds = %6, %9, %0
br label %13
13: ; preds = %9, %12
%14 = phi i32 [ 48, %12 ], [ 49, %9 ]
%15 = call i32 @putchar(i32 %14)
ret i32 0
}