#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 *);
scalar_t__ strcmp(char *, char const *);
char *strtok(char *, char *);
int main() {
  char array[100];
  char *pch;
  scanf("%s", array);
  int m = 0;
  int charcount = 0;
  for (m = 0; array[m]; m++) {
    if (array[m] != ' ') {
      charcount++;
    }
  }
  charcount = charcount - 4;
  if (charcount != 13) {
    printf("0\n");
    return 0;
  }
  pch = strtok(array, " ,.-");
  const char *words[6] = {"978", "979", "933346", "55583", "4210", "01"};
  if (strcmp(pch, words[0]) == 0) {
    printf("1\n");
    pch = strtok(NULL, " ,.-");
    pch = strtok(NULL, " ,.-");
    if (strcmp(pch, words[2]) == 0) {
      printf("Bluebridge\n");
    }
    if (strcmp(pch, words[3]) == 0) {
      printf("Alyson Books\n");
    }
    if (strcmp(pch, words[4]) == 0) {
      printf("FUNimation Productions, Ltd.\n");
    }
    if (strcmp(pch, words[5]) == 0) {
      printf("Pyramid Books\n");
    }
  } else {
    printf("0\n");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xb0,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x70(%rbp),%rsi
lea    0xe93(%rip),%rdi
call   1060 <scanf@plt>
movl   $0x0,-0x7c(%rbp)
movl   $0x0,-0x80(%rbp)
movl   $0x0,-0x7c(%rbp)
movslq -0x7c(%rbp),%rax
cmpb   $0x0,-0x70(%rbp,%rax,1)
je     11c4 <main+0x74>
movslq -0x7c(%rbp),%rax
movsbl -0x70(%rbp,%rax,1),%eax
cmp    $0x20,%eax
je     11b1 <main+0x61>
mov    -0x80(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x80(%rbp)
jmp    11b6 <main+0x66>
mov    -0x7c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x7c(%rbp)
jmp    1187 <main+0x37>
mov    -0x80(%rbp),%eax
sub    $0x4,%eax
mov    %eax,-0x80(%rbp)
cmpl   $0xd,-0x80(%rbp)
je     11ef <main+0x9f>
lea    0xe25(%rip),%rdi
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    1368 <main+0x218>
lea    -0x70(%rbp),%rdi
lea    0xe0c(%rip),%rsi
call   1070 <strtok@plt>
mov    %rax,-0x78(%rbp)
lea    -0xb0(%rbp),%rdi
xor    %esi,%esi
mov    $0x30,%edx
call   1040 <memset@plt>
lea    0xdee(%rip),%rax
mov    %rax,-0xb0(%rbp)
lea    0xde4(%rip),%rax
mov    %rax,-0xa8(%rbp)
lea    0xdda(%rip),%rax
mov    %rax,-0xa0(%rbp)
lea    0xdd3(%rip),%rax
mov    %rax,-0x98(%rbp)
lea    0xdcb(%rip),%rax
mov    %rax,-0x90(%rbp)
lea    0xdc2(%rip),%rax
mov    %rax,-0x88(%rbp)
mov    -0x78(%rbp),%rdi
mov    -0xb0(%rbp),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%rax
jne    1355 <main+0x205>
lea    0xd9d(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
mov    %eax,%edi
lea    0xd6b(%rip),%rsi
call   1070 <strtok@plt>
mov    %rax,-0x78(%rbp)
xor    %eax,%eax
mov    %eax,%edi
lea    0xd57(%rip),%rsi
call   1070 <strtok@plt>
mov    %rax,-0x78(%rbp)
mov    -0x78(%rbp),%rdi
mov    -0xa0(%rbp),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%rax
jne    12de <main+0x18e>
lea    0xd52(%rip),%rdi
call   1030 <printf@plt>
mov    -0x78(%rbp),%rdi
mov    -0x98(%rbp),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%rax
jne    1304 <main+0x1b4>
lea    0xd38(%rip),%rdi
call   1030 <printf@plt>
mov    -0x78(%rbp),%rdi
mov    -0x90(%rbp),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%rax
jne    132a <main+0x1da>
lea    0xd20(%rip),%rdi
call   1030 <printf@plt>
mov    -0x78(%rbp),%rdi
mov    -0x88(%rbp),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%rax
jne    1350 <main+0x200>
lea    0xd18(%rip),%rdi
call   1030 <printf@plt>
jmp    1361 <main+0x211>
lea    0xca7(%rip),%rdi
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0xb0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x70,%rsp
lea    0xeb4(%rip),%rdi
mov    %rsp,%rbx
mov    %rbx,%rsi
call   1050 <scanf@plt>
xor    %eax,%eax
jmp    1167 <main+0x27>
nopl   0x0(%rax,%rax,1)
add    $0x1,%eax
add    $0x1,%rbx
movzbl (%rbx),%ecx
cmp    $0x20,%cl
je     1163 <main+0x23>
test   %cl,%cl
jne    1160 <main+0x20>
lea    0xea2(%rip),%rbx
cmp    $0x11,%eax
jne    11a2 <main+0x62>
lea    0xe7d(%rip),%rsi
mov    %rsp,%rdi
call   1060 <strtok@plt>
lea    0xe73(%rip),%rsi
mov    %rax,%rdi
call   1040 <strcmp@plt>
test   %rax,%rax
je     11b2 <main+0x72>
mov    %rbx,%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x70,%rsp
pop    %rbx
ret
lea    0xe66(%rip),%rdi
call   1030 <puts@plt>
lea    0xe3e(%rip),%rbx
xor    %edi,%edi
mov    %rbx,%rsi
call   1060 <strtok@plt>
xor    %edi,%edi
mov    %rbx,%rsi
call   1060 <strtok@plt>
mov    %rax,%rbx
lea    0xe29(%rip),%rsi
mov    %rax,%rdi
call   1040 <strcmp@plt>
test   %rax,%rax
jne    11fc <main+0xbc>
lea    0xe62(%rip),%rdi
call   1030 <puts@plt>
lea    0xe10(%rip),%rsi
mov    %rbx,%rdi
call   1040 <strcmp@plt>
test   %rax,%rax
jne    121c <main+0xdc>
lea    0xe35(%rip),%rdi
call   1030 <puts@plt>
lea    0xdf6(%rip),%rsi
mov    %rbx,%rdi
call   1040 <strcmp@plt>
test   %rax,%rax
jne    123c <main+0xfc>
lea    0xdf8(%rip),%rdi
call   1030 <puts@plt>
lea    0xddb(%rip),%rsi
mov    %rbx,%rdi
call   1040 <strcmp@plt>
test   %rax,%rax
jne    11aa <main+0x6a>
lea    0xdc6(%rip),%rbx
jmp    11a2 <main+0x62>

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

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
@.str.2 = [5 x i8] c" ,.-\00"
@.str.3 = [4 x i8] c"978\00"
@.str.5 = [7 x i8] c"933346\00"
@.str.6 = [6 x i8] c"55583\00"
@.str.7 = [5 x i8] c"4210\00"
@.str.8 = [3 x i8] c"01\00"
@str.14 = [2 x i8] c"1\00"
@str.15 = [14 x i8] c"Pyramid Books\00"
@str.16 = [29 x i8] c"FUNimation Productions, Ltd.\00"
@str.17 = [13 x i8] c"Alyson Books\00"
@str.18 = [11 x i8] c"Bluebridge\00"
@str.19 = [2 x i8] c"0\00"
define i32 @main() {
%1 = alloca [100 x i8]
%2 = getelementptr inbounds [100 x i8], [100 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)
br label %4
4: ; preds = %11, %0
%5 = phi i64 [ %13, %11 ], [ 0, %0 ]
%6 = phi i32 [ %12, %11 ], [ 0, %0 ]
%7 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 %5
%8 = load i8, i8* %7
switch i8 %8, label %9 [
i8 0, label %14
i8 32, label %11
]
9: ; preds = %4
%10 = add nsw i32 %6, 1
br label %11
11: ; preds = %4, %9
%12 = phi i32 [ %10, %9 ], [ %6, %4 ]
%13 = add nuw i64 %5, 1
br label %4
14: ; preds = %4
%15 = icmp eq i32 %6, 17
br i1 %15, label %16, label %41
16: ; preds = %14
%17 = call i8* @strtok(i8* %2, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
%18 = call i64 @strcmp(i8* %17, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0))
%19 = icmp eq i64 %18, 0
br i1 %19, label %20, label %41
20: ; preds = %16
%21 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str.14, i64 0, i64 0))
%22 = call i8* @strtok(i8* null, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
%23 = call i8* @strtok(i8* null, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
%24 = call i64 @strcmp(i8* %23, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.5, i64 0, i64 0))
%25 = icmp eq i64 %24, 0
br i1 %25, label %26, label %28
26: ; preds = %20
%27 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @str.18, i64 0, i64 0))
br label %28
28: ; preds = %26, %20
%29 = call i64 @strcmp(i8* %23, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.6, i64 0, i64 0))
%30 = icmp eq i64 %29, 0
br i1 %30, label %31, label %33
31: ; preds = %28
%32 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str.17, i64 0, i64 0))
br label %33
33: ; preds = %31, %28
%34 = call i64 @strcmp(i8* %23, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.7, i64 0, i64 0))
%35 = icmp eq i64 %34, 0
br i1 %35, label %36, label %38
36: ; preds = %33
%37 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @str.16, i64 0, i64 0))
br label %38
38: ; preds = %36, %33
%39 = call i64 @strcmp(i8* %23, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.8, i64 0, i64 0))
%40 = icmp eq i64 %39, 0
br i1 %40, label %41, label %44
41: ; preds = %16, %38, %14
%42 = phi i8* [ getelementptr inbounds ([2 x i8], [2 x i8]* @str.19, i64 0, i64 0), %14 ], [ getelementptr inbounds ([14 x i8], [14 x i8]* @str.15, i64 0, i64 0), %38 ], [ getelementptr inbounds ([2 x i8], [2 x i8]* @str.19, i64 0, i64 0), %16 ]
%43 = call i32 @puts(i8* dereferenceable(1) %42)
br label %44
44: ; preds = %41, %38
ret i32 0
}