#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 */
scalar_t__ checker(char *);
int /*<<< orphan*/ fgets(char *, int, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ stdin;
int strlen(char *);
int main() {
  char str[12];
  int valid_id = 0;
  fgets(str, 12, stdin);
  if (strlen(str) == 10) {
    if (checker(str)) {
      valid_id = 1;
    }
  }
  printf("%d", valid_id);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x14(%rbp)
lea    -0x10(%rbp),%rdi
mov    0x2e87(%rip),%rax
mov    (%rax),%edx
mov    $0xc,%esi
call   1050 <fgets@plt>
lea    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
cmp    $0xa,%eax
jne    119e <main+0x5e>
lea    -0x10(%rbp),%rdi
call   1060 <checker@plt>
cmp    $0x0,%rax
je     1199 <main+0x59>
movl   $0x1,-0x14(%rbp)
jmp    119e <main+0x5e>
mov    -0x14(%rbp),%esi
lea    0xe58(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
mov    0x2e9c(%rip),%rax
mov    (%rax),%edx
lea    0x4(%rsp),%rbx
mov    %rbx,%rdi
mov    $0xc,%esi
call   1050 <fgets@plt>
mov    %rbx,%rdi
call   1030 <strlen@plt>
xor    %esi,%esi
cmp    $0xa,%eax
jne    1182 <main+0x42>
lea    0x4(%rsp),%rdi
call   1060 <checker@plt>
xor    %esi,%esi
test   %rax,%rax
setne  %sil
lea    0xe77(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@stdin = global i32 0
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca [12 x i8]
%2 = getelementptr inbounds [12 x i8], [12 x i8]* %1, i64 0, i64 0
%3 = load i32, i32* @stdin
%4 = call i32 @fgets(i8* %2, i32 12, i32 %3)
%5 = call i32 @strlen(i8* %2)
%6 = icmp eq i32 %5, 10
br i1 %6, label %7, label %11
7: ; preds = %0
%8 = call i64 @checker(i8* %2)
%9 = icmp ne i64 %8, 0
%10 = zext i1 %9 to i32
br label %11
11: ; preds = %7, %0
%12 = phi i32 [ 0, %0 ], [ %10, %7 ]
%13 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %12)
ret i32 0
}