#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*/ printf(char *);
int /*<<< orphan*/ scanf(char *, char *);
int /*<<< orphan*/ strcmp(char *, char *);
unsigned int strlen(char *);
scalar_t__ valid_isbn(char *);
int main() {
  char isbnnum[20];
  char check[6];
  int last = 0;
  scanf("%s", isbnnum);
  if (valid_isbn(isbnnum)) {
    printf("1");
    for (unsigned int i = 0; i < strlen(isbnnum); i++) {
      if (isbnnum[i] == '-') {
        for (int k = 0; k < i - last; k++) {
          check[k] = isbnnum[last + k];
        }
        last = i + 1;
        if (!strcmp(check, "933346")) {
          printf("Bluebridge");
        } else if (!strcmp(check, "55583")) {
          printf("Alyson Books");
        } else if (!strcmp(check, "4210")) {
          printf("FUNimation Productions, Ltd.");
        } else if (!strcmp(check, "01")) {
          printf("Pyramid Books");
        }
      }
    }
  } else {
    printf("0");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x2c(%rbp)
lea    -0x20(%rbp),%rsi
lea    0xe8f(%rip),%rdi
call   1070 <scanf@plt>
lea    -0x20(%rbp),%rdi
call   1040 <valid_isbn@plt>
cmp    $0x0,%rax
je     12db <main+0x18b>
lea    0xebb(%rip),%rdi
call   1050 <printf@plt>
movl   $0x0,-0x30(%rbp)
mov    -0x30(%rbp),%eax
mov    %eax,-0x38(%rbp)
lea    -0x20(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    -0x38(%rbp),%eax
cmp    %ecx,%eax
jae    12d6 <main+0x186>
mov    -0x30(%rbp),%eax
movsbl -0x20(%rbp,%rax,1),%eax
cmp    $0x2d,%eax
jne    12c3 <main+0x173>
movl   $0x0,-0x34(%rbp)
mov    -0x34(%rbp),%eax
mov    -0x30(%rbp),%ecx
sub    -0x2c(%rbp),%ecx
cmp    %ecx,%eax
jae    1203 <main+0xb3>
mov    -0x2c(%rbp),%eax
add    -0x34(%rbp),%eax
cltq
mov    -0x20(%rbp,%rax,1),%cl
movslq -0x34(%rbp),%rax
mov    %cl,-0x26(%rbp,%rax,1)
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    11d0 <main+0x80>
mov    -0x30(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
lea    -0x26(%rbp),%rdi
lea    0xdec(%rip),%rsi
call   1060 <strcmp@plt>
cmp    $0x0,%eax
jne    1236 <main+0xe6>
lea    0xdde(%rip),%rdi
call   1050 <printf@plt>
jmp    12be <main+0x16e>
lea    -0x26(%rbp),%rdi
lea    0xdd4(%rip),%rsi
call   1060 <strcmp@plt>
cmp    $0x0,%eax
jne    1260 <main+0x110>
lea    0xdc5(%rip),%rdi
call   1050 <printf@plt>
jmp    12b9 <main+0x169>
lea    -0x26(%rbp),%rdi
lea    0xdbd(%rip),%rsi
call   1060 <strcmp@plt>
cmp    $0x0,%eax
jne    128a <main+0x13a>
lea    0xdad(%rip),%rdi
call   1050 <printf@plt>
jmp    12b4 <main+0x164>
lea    -0x26(%rbp),%rdi
lea    0xdb5(%rip),%rsi
call   1060 <strcmp@plt>
cmp    $0x0,%eax
jne    12af <main+0x15f>
lea    0xda3(%rip),%rdi
call   1050 <printf@plt>
jmp    12b4 <main+0x164>
jmp    12b9 <main+0x169>
jmp    12be <main+0x16e>
jmp    12c3 <main+0x173>
jmp    12c8 <main+0x178>
mov    -0x30(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x30(%rbp)
jmp    119c <main+0x4c>
jmp    12e7 <main+0x197>
lea    0xd49(%rip),%rdi
call   1050 <printf@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x28,%rsp
lea    0xe7b(%rip),%rdi
lea    0x10(%rsp),%rbx
mov    %rbx,%rsi
call   1090 <scanf@plt>
mov    %rbx,%rdi
call   1050 <valid_isbn@plt>
test   %rax,%rax
je     12ad <main+0x13d>
mov    $0x31,%edi
call   1030 <putchar@plt>
lea    0x10(%rsp),%rdi
call   1040 <strlen@plt>
test   %eax,%eax
je     12b7 <main+0x147>
xor    %r12d,%r12d
lea    0xe3a(%rip),%r14
lea    0xa(%rsp),%rbx
mov    $0x38353535,%r15d
lea    0x10(%rsp),%rbp
xor    %r13d,%r13d
jmp    11f7 <main+0x87>
xchg   %ax,%ax
add    $0x1,%r12
mov    %rbp,%rdi
call   1040 <strlen@plt>
mov    %eax,%eax
cmp    %rax,%r12
jae    12b7 <main+0x147>
cmpb   $0x2d,0x10(%rsp,%r12,1)
jne    11e0 <main+0x70>
cmp    %r12d,%r13d
je     1224 <main+0xb4>
movslq %r13d,%rax
lea    (%rsp,%rax,1),%rsi
add    $0x10,%rsi
not    %r13d
add    %r12d,%r13d
add    $0x1,%r13
mov    %rbx,%rdi
mov    %r13,%rdx
call   1080 <memcpy@plt>
add    $0x1,%r12
mov    %rbx,%rdi
mov    %r14,%rsi
call   1070 <strcmp@plt>
test   %eax,%eax
je     127b <main+0x10b>
mov    0xa(%rsp),%eax
xor    %r15d,%eax
movzwl 0xe(%rsp),%ecx
xor    $0x33,%ecx
or     %eax,%ecx
je     1284 <main+0x114>
mov    0xa(%rsp),%eax
mov    $0x30313234,%ecx
xor    %ecx,%eax
movzbl 0xe(%rsp),%ecx
or     %eax,%ecx
je     128d <main+0x11d>
movzwl 0xa(%rsp),%eax
xor    $0x3130,%eax
movzbl 0xc(%rsp),%ecx
or     %ax,%cx
jne    12a5 <main+0x135>
lea    0xdd4(%rip),%rdi
jmp    12a0 <main+0x130>
lea    0xd88(%rip),%rdi
jmp    12a0 <main+0x130>
lea    0xd90(%rip),%rdi
jmp    12a0 <main+0x130>
lea    0xd99(%rip),%rdi
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
call   1060 <printf@plt>
mov    %r12d,%r13d
jmp    11e4 <main+0x74>
mov    $0x30,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
add    $0x28,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
@.str.1 = [2 x i8] c"1\00"
@.str.2 = [7 x i8] c"933346\00"
@.str.3 = [11 x i8] c"Bluebridge\00"
@.str.4 = [6 x i8] c"55583\00"
@.str.5 = [13 x i8] c"Alyson Books\00"
@.str.6 = [5 x i8] c"4210\00"
@.str.7 = [29 x i8] c"FUNimation Productions, Ltd.\00"
@.str.8 = [3 x i8] c"01\00"
@.str.9 = [14 x i8] c"Pyramid Books\00"
@.str.10 = [2 x i8] c"0\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [20 x i8]
%3 = alloca [6 x i8]
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %4
%7 = getelementptr inbounds [20 x i8], [20 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 [20 x i8], [20 x i8]* %2, i64 0, i64 0
%10 = call i64 @valid_isbn(i8* %9)
%11 = icmp ne i64 %10, 0
br i1 %11, label %12, label %81
12: ; preds = %0
%13 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32 0, i32* %5
br label %14
14: ; preds = %77, %12
%15 = load i32, i32* %5
%16 = getelementptr inbounds [20 x i8], [20 x i8]* %2, i64 0, i64 0
%17 = call i32 @strlen(i8* %16)
%18 = icmp ult i32 %15, %17
br i1 %18, label %19, label %80
19: ; preds = %14
%20 = load i32, i32* %5
%21 = zext i32 %20 to i64
%22 = getelementptr inbounds [20 x i8], [20 x i8]* %2, i64 0, i64 %21
%23 = load i8, i8* %22
%24 = sext i8 %23 to i32
%25 = icmp eq i32 %24, 45
br i1 %25, label %26, label %76
26: ; preds = %19
store i32 0, i32* %6
br label %27
27: ; preds = %43, %26
%28 = load i32, i32* %6
%29 = load i32, i32* %5
%30 = load i32, i32* %4
%31 = sub i32 %29, %30
%32 = icmp ult i32 %28, %31
br i1 %32, label %33, label %46
33: ; preds = %27
%34 = load i32, i32* %4
%35 = load i32, i32* %6
%36 = add nsw i32 %34, %35
%37 = sext i32 %36 to i64
%38 = getelementptr inbounds [20 x i8], [20 x i8]* %2, i64 0, i64 %37
%39 = load i8, i8* %38
%40 = load i32, i32* %6
%41 = sext i32 %40 to i64
%42 = getelementptr inbounds [6 x i8], [6 x i8]* %3, i64 0, i64 %41
store i8 %39, i8* %42
br label %43
43: ; preds = %33
%44 = load i32, i32* %6
%45 = add nsw i32 %44, 1
store i32 %45, i32* %6
br label %27
46: ; preds = %27
%47 = load i32, i32* %5
%48 = add i32 %47, 1
store i32 %48, i32* %4
%49 = getelementptr inbounds [6 x i8], [6 x i8]* %3, i64 0, i64 0
%50 = call i32 @strcmp(i8* %49, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0))
%51 = icmp ne i32 %50, 0
br i1 %51, label %54, label %52
52: ; preds = %46
%53 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.3, i64 0, i64 0))
br label %75
54: ; preds = %46
%55 = getelementptr inbounds [6 x i8], [6 x i8]* %3, i64 0, i64 0
%56 = call i32 @strcmp(i8* %55, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0))
%57 = icmp ne i32 %56, 0
br i1 %57, label %60, label %58
58: ; preds = %54
%59 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.5, i64 0, i64 0))
br label %74
60: ; preds = %54
%61 = getelementptr inbounds [6 x i8], [6 x i8]* %3, i64 0, i64 0
%62 = call i32 @strcmp(i8* %61, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.6, i64 0, i64 0))
%63 = icmp ne i32 %62, 0
br i1 %63, label %66, label %64
64: ; preds = %60
%65 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.7, i64 0, i64 0))
br label %73
66: ; preds = %60
%67 = getelementptr inbounds [6 x i8], [6 x i8]* %3, i64 0, i64 0
%68 = call i32 @strcmp(i8* %67, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.8, i64 0, i64 0))
%69 = icmp ne i32 %68, 0
br i1 %69, label %72, label %70
70: ; preds = %66
%71 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.9, i64 0, i64 0))
br label %72
72: ; preds = %70, %66
br label %73
73: ; preds = %72, %64
br label %74
74: ; preds = %73, %58
br label %75
75: ; preds = %74, %52
br label %76
76: ; preds = %75, %19
br label %77
77: ; preds = %76
%78 = load i32, i32* %5
%79 = add i32 %78, 1
store i32 %79, i32* %5
br label %14
80: ; preds = %14
br label %83
81: ; preds = %0
%82 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.10, i64 0, i64 0))
br label %83
83: ; preds = %81, %80
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
@.str.2 = [7 x i8] c"933346\00"
@.str.3 = [11 x i8] c"Bluebridge\00"
@.str.4 = [6 x i8] c"55583\00"
@.str.5 = [13 x i8] c"Alyson Books\00"
@.str.6 = [5 x i8] c"4210\00"
@.str.7 = [29 x i8] c"FUNimation Productions, Ltd.\00"
@.str.8 = [3 x i8] c"01\00"
@.str.9 = [14 x i8] c"Pyramid Books\00"
define i32 @main() {
%1 = alloca [20 x i8]
%2 = alloca [6 x i8]
%3 = getelementptr inbounds [6 x i8], [6 x i8]* %2, i64 0, i64 0
%4 = getelementptr inbounds [20 x i8], [20 x i8]* %1, i64 0, i64 0
%5 = getelementptr inbounds [6 x i8], [6 x i8]* %2, i64 0, i64 0
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %4)
%7 = call i64 @valid_isbn(i8* %4)
%8 = icmp eq i64 %7, 0
br i1 %8, label %59, label %9
9: ; preds = %0
%10 = call i32 @putchar(i32 49)
%11 = call i32 @strlen(i8* %4)
%12 = icmp eq i32 %11, 0
br i1 %12, label %61, label %13
13: ; preds = %9, %53
%14 = phi i64 [ %54, %53 ], [ 0, %9 ]
%15 = phi i32 [ %55, %53 ], [ 0, %9 ]
%16 = trunc i64 %14 to i32
%17 = getelementptr inbounds [20 x i8], [20 x i8]* %1, i64 0, i64 %14
%18 = load i8, i8* %17
%19 = icmp eq i8 %18, 45
br i1 %19, label %22, label %20
20: ; preds = %13
%21 = add nuw nsw i64 %14, 1
br label %53
22: ; preds = %13
%23 = icmp eq i32 %15, %16
br i1 %23, label %31, label %24
24: ; preds = %22
%25 = sext i32 %15 to i64
%26 = getelementptr [20 x i8], [20 x i8]* %1, i64 0, i64 %25
%27 = xor i32 %15, -1
%28 = add i32 %27, %16
%29 = zext i32 %28 to i64
%30 = add nuw nsw i64 %29, 1
br label %31
31: ; preds = %24, %22
%32 = add nuw nsw i64 %14, 1
%33 = call i32 @strcmp(i8* %5, i8* dereferenceable(7) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0))
%34 = icmp eq i32 %33, 0
%35 = trunc i64 %32 to i32
br i1 %34, label %36, label %38
36: ; preds = %31
%37 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.3, i64 0, i64 0))
br label %53
38: ; preds = %31
%39 = call i32 @bcmp(i8* dereferenceable(6) %5, i8* dereferenceable(6) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0), i64 6)
%40 = icmp eq i32 %39, 0
br i1 %40, label %41, label %43
41: ; preds = %38
%42 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.5, i64 0, i64 0))
br label %53
43: ; preds = %38
%44 = call i32 @bcmp(i8* dereferenceable(5) %5, i8* dereferenceable(5) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.6, i64 0, i64 0), i64 5)
%45 = icmp eq i32 %44, 0
br i1 %45, label %46, label %48
46: ; preds = %43
%47 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @.str.7, i64 0, i64 0))
br label %53
48: ; preds = %43
%49 = call i32 @bcmp(i8* dereferenceable(3) %5, i8* dereferenceable(3) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.8, i64 0, i64 0), i64 3)
%50 = icmp eq i32 %49, 0
br i1 %50, label %51, label %53
51: ; preds = %48
%52 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.9, i64 0, i64 0))
br label %53
53: ; preds = %20, %41, %48, %51, %46, %36
%54 = phi i64 [ %21, %20 ], [ %32, %41 ], [ %32, %48 ], [ %32, %51 ], [ %32, %46 ], [ %32, %36 ]
%55 = phi i32 [ %15, %20 ], [ %35, %41 ], [ %35, %48 ], [ %35, %51 ], [ %35, %46 ], [ %35, %36 ]
%56 = call i32 @strlen(i8* %4)
%57 = zext i32 %56 to i64
%58 = icmp ult i64 %54, %57
br i1 %58, label %13, label %61
59: ; preds = %0
%60 = call i32 @putchar(i32 48)
br label %61
61: ; preds = %53, %9, %59
ret i32 0
}