#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*/ fgets(char *, int, int /*<<< orphan*/);
int /*<<< orphan*/ print_publisher(char *);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ stdin;
int /*<<< orphan*/ strcpy(char *, char *);
scalar_t__ valid_isbn(char *);
int main() {
  char isbn[20], reserved[20];
  fgets(isbn, 20 + 1, stdin);
  strcpy(reserved, isbn);
  if (valid_isbn(isbn)) {
    printf("1");
    print_publisher(reserved);
  } else {
    printf("0");
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x20(%rbp),%rdi
mov    0x2e7e(%rip),%rax
mov    (%rax),%edx
mov    $0x15,%esi
call   1060 <fgets@plt>
lea    -0x40(%rbp),%rdi
lea    -0x20(%rbp),%rsi
call   1030 <strcpy@plt>
lea    -0x20(%rbp),%rdi
call   1040 <valid_isbn@plt>
cmp    $0x0,%rax
je     11b0 <main+0x60>
lea    0xe63(%rip),%rdi
call   1050 <printf@plt>
lea    -0x40(%rbp),%rdi
call   1070 <print_publisher@plt>
jmp    11bc <main+0x6c>
lea    0xe4b(%rip),%rdi
call   1050 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x40,%rsp
mov    0x2e8c(%rip),%rax
mov    (%rax),%edx
lea    0x20(%rsp),%rbx
mov    %rbx,%rdi
mov    $0x15,%esi
call   1060 <fgets@plt>
mov    %rsp,%rdi
mov    %rbx,%rsi
call   1040 <strcpy@plt>
mov    %rbx,%rdi
call   1050 <valid_isbn@plt>
test   %rax,%rax
je     119c <main+0x4c>
mov    $0x31,%edi
call   1030 <putchar@plt>
mov    %rsp,%rdi
call   1070 <print_publisher@plt>
jmp    11a6 <main+0x56>
mov    $0x30,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@stdin = global i32 0
@.str = [2 x i8] c"1\00"
@.str.1 = [2 x i8] c"0\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [20 x i8]
%3 = alloca [20 x i8]
store i32 0, i32* %1
%4 = getelementptr inbounds [20 x i8], [20 x i8]* %2, i64 0, i64 0
%5 = load i32, i32* @stdin
%6 = call i32 @fgets(i8* %4, i32 21, i32 %5)
%7 = getelementptr inbounds [20 x i8], [20 x i8]* %3, i64 0, i64 0
%8 = getelementptr inbounds [20 x i8], [20 x i8]* %2, i64 0, i64 0
%9 = call i32 @strcpy(i8* %7, i8* %8)
%10 = getelementptr inbounds [20 x i8], [20 x i8]* %2, i64 0, i64 0
%11 = call i64 @valid_isbn(i8* %10)
%12 = icmp ne i64 %11, 0
br i1 %12, label %13, label %17
13: ; preds = %0
%14 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%15 = getelementptr inbounds [20 x i8], [20 x i8]* %3, i64 0, i64 0
%16 = call i32 @print_publisher(i8* %15)
br label %19
17: ; preds = %0
%18 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
br label %19
19: ; preds = %17, %13
%20 = load i32, i32* %1
ret i32 %20
}

LLVM IR (-O2):
@stdin = global i32 0
define i32 @main() {
%1 = alloca [20 x i8]
%2 = alloca [20 x i8]
%3 = getelementptr inbounds [20 x i8], [20 x i8]* %1, i64 0, i64 0
%4 = getelementptr inbounds [20 x i8], [20 x i8]* %2, i64 0, i64 0
%5 = load i32, i32* @stdin
%6 = call i32 @fgets(i8* %3, i32 21, i32 %5)
%7 = call i32 @strcpy(i8* %4, i8* %3)
%8 = call i64 @valid_isbn(i8* %3)
%9 = icmp eq i64 %8, 0
br i1 %9, label %13, label %10
10: ; preds = %0
%11 = call i32 @putchar(i32 49)
%12 = call i32 @print_publisher(i8* %4)
br label %15
13: ; preds = %0
%14 = call i32 @putchar(i32 48)
br label %15
15: ; preds = %13, %10
ret i32 0
}