#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 strlen(char *);
int main() {
  char inp_ISBN[20];
  int final_checksum = 0, x, placeofcheck, i, ISBN_num_count;
  char header1[3] = "978", header2[3] = "979";
  scanf("%s", inp_ISBN);
  for (i = 0; i < 3; i++) {
    if (inp_ISBN[i] != header1[i] && inp_ISBN[i] != header2[i]) {
      printf("0");
      return 0;
    }
  }
  for (i = 0; i < strlen(inp_ISBN) && ISBN_num_count != 13; i++) {
    if (inp_ISBN[i] >= '0' && inp_ISBN[i] <= '9') {
      ISBN_num_count++;
      placeofcheck = i;
    } else {
      if (inp_ISBN[i + 1] == '-') {
        printf("0");
        return 0;
      }
      if (inp_ISBN[i] != '-') {
        printf("0");
        return 0;
      }
    }
  }
  if (ISBN_num_count < 13) {
    printf("0");
    return 0;
  }
  for (i = 0, ISBN_num_count = 0; i < strlen(inp_ISBN) && ISBN_num_count < 12;
       i++) {
    if (inp_ISBN[i] >= '0' && inp_ISBN[i] <= '9') {
      ISBN_num_count++;
      if (ISBN_num_count % 2 == 0) {
        x = (inp_ISBN[i] - '0') * 3;
      }
      if (ISBN_num_count % 2 != 0) {
        x = (inp_ISBN[i] - '0');
      }
      final_checksum = final_checksum + x;
    }
  }
  final_checksum = final_checksum % 10;
  final_checksum = 10 - final_checksum;
  if (final_checksum == (inp_ISBN[placeofcheck] - '0')) {
    printf("1");
  }
  if (inp_ISBN[6] == '9' && inp_ISBN[7] == '3' && inp_ISBN[8] == '3' &&
      inp_ISBN[9] == '3' && inp_ISBN[10] == '4' && inp_ISBN[11] == '6')
    printf("\nBluebridge");
  if (inp_ISBN[6] == '0' && inp_ISBN[7] == '1')
    printf("\nPyramid Books");
  if (inp_ISBN[6] == '5' && inp_ISBN[7] == '5' && inp_ISBN[8] == '5' &&
      inp_ISBN[9] == '8' && inp_ISBN[10] == '3')
    printf("\nAlyson Books");
  if (inp_ISBN[6] == '4' && inp_ISBN[7] == '2' && inp_ISBN[8] == '1' &&
      inp_ISBN[9] == '0')
    printf("\nFUNimation Productions, Ltd.");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x24(%rbp)
mov    0xeb3(%rip),%ax
mov    %ax,-0x37(%rbp)
mov    0xeab(%rip),%al
mov    %al,-0x35(%rbp)
mov    0xea2(%rip),%ax
mov    %ax,-0x3a(%rbp)
mov    0xe9a(%rip),%al
mov    %al,-0x38(%rbp)
lea    -0x20(%rbp),%rsi
lea    0xe8d(%rip),%rdi
call   1050 <scanf@plt>
movl   $0x0,-0x30(%rbp)
cmpl   $0x3,-0x30(%rbp)
jge    11ee <main+0xbe>
movslq -0x30(%rbp),%rax
movsbl -0x20(%rbp,%rax,1),%eax
movslq -0x30(%rbp),%rcx
movsbl -0x37(%rbp,%rcx,1),%ecx
cmp    %ecx,%eax
je     11db <main+0xab>
movslq -0x30(%rbp),%rax
movsbl -0x20(%rbp,%rax,1),%eax
movslq -0x30(%rbp),%rcx
movsbl -0x3a(%rbp,%rcx,1),%ecx
cmp    %ecx,%eax
je     11db <main+0xab>
lea    0xe3f(%rip),%rdi
call   1040 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    1525 <main+0x3f5>
jmp    11e0 <main+0xb0>
mov    -0x30(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x30(%rbp)
jmp    1185 <main+0x55>
movl   $0x0,-0x30(%rbp)
mov    -0x30(%rbp),%eax
mov    %eax,-0x40(%rbp)
lea    -0x20(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x40(%rbp),%ecx
mov    %eax,%edx
xor    %eax,%eax
cmp    %edx,%ecx
mov    %al,-0x3b(%rbp)
jge    1220 <main+0xf0>
cmpl   $0xd,-0x34(%rbp)
setne  %al
mov    %al,-0x3b(%rbp)
mov    -0x3b(%rbp),%al
test   $0x1,%al
jne    1230 <main+0x100>
jmp    12d8 <main+0x1a8>
movslq -0x30(%rbp),%rax
movsbl -0x20(%rbp,%rax,1),%eax
cmp    $0x30,%eax
jl     1268 <main+0x138>
movslq -0x30(%rbp),%rax
movsbl -0x20(%rbp,%rax,1),%eax
cmp    $0x39,%eax
jg     1268 <main+0x138>
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
mov    -0x30(%rbp),%eax
mov    %eax,-0x2c(%rbp)
jmp    12c5 <main+0x195>
mov    -0x30(%rbp),%eax
add    $0x1,%eax
cltq
movsbl -0x20(%rbp,%rax,1),%eax
cmp    $0x2d,%eax
jne    1296 <main+0x166>
lea    0xd84(%rip),%rdi
call   1040 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    1525 <main+0x3f5>
movslq -0x30(%rbp),%rax
movsbl -0x20(%rbp,%rax,1),%eax
cmp    $0x2d,%eax
je     12c0 <main+0x190>
lea    0xd5a(%rip),%rdi
call   1040 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    1525 <main+0x3f5>
jmp    12c5 <main+0x195>
jmp    12ca <main+0x19a>
mov    -0x30(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x30(%rbp)
jmp    11f5 <main+0xc5>
cmpl   $0xd,-0x34(%rbp)
jge    12fa <main+0x1ca>
lea    0xd20(%rip),%rdi
call   1040 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    1525 <main+0x3f5>
movl   $0x0,-0x30(%rbp)
movl   $0x0,-0x34(%rbp)
mov    -0x30(%rbp),%eax
mov    %eax,-0x48(%rbp)
lea    -0x20(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x48(%rbp),%ecx
mov    %eax,%edx
xor    %eax,%eax
cmp    %edx,%ecx
mov    %al,-0x41(%rbp)
jge    1333 <main+0x203>
cmpl   $0xc,-0x34(%rbp)
setl   %al
mov    %al,-0x41(%rbp)
mov    -0x41(%rbp),%al
test   $0x1,%al
jne    1343 <main+0x213>
jmp    13d5 <main+0x2a5>
movslq -0x30(%rbp),%rax
movsbl -0x20(%rbp,%rax,1),%eax
cmp    $0x30,%eax
jl     13c2 <main+0x292>
movslq -0x30(%rbp),%rax
movsbl -0x20(%rbp,%rax,1),%eax
cmp    $0x39,%eax
jg     13c2 <main+0x292>
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
mov    -0x34(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    1396 <main+0x266>
movslq -0x30(%rbp),%rax
movsbl -0x20(%rbp,%rax,1),%eax
sub    $0x30,%eax
imul   $0x3,%eax,%eax
mov    %eax,-0x28(%rbp)
mov    -0x34(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
je     13b9 <main+0x289>
movslq -0x30(%rbp),%rax
movsbl -0x20(%rbp,%rax,1),%eax
sub    $0x30,%eax
mov    %eax,-0x28(%rbp)
mov    -0x24(%rbp),%eax
add    -0x28(%rbp),%eax
mov    %eax,-0x24(%rbp)
jmp    13c7 <main+0x297>
mov    -0x30(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x30(%rbp)
jmp    1308 <main+0x1d8>
mov    -0x24(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %edx,-0x24(%rbp)
mov    $0xa,%eax
sub    -0x24(%rbp),%eax
mov    %eax,-0x24(%rbp)
mov    -0x24(%rbp),%eax
movslq -0x2c(%rbp),%rcx
movsbl -0x20(%rbp,%rcx,1),%ecx
sub    $0x30,%ecx
cmp    %ecx,%eax
jne    1411 <main+0x2e1>
lea    0xbff(%rip),%rdi
call   1040 <printf@plt>
movsbl -0x1a(%rbp),%eax
cmp    $0x39,%eax
jne    146b <main+0x33b>
movsbl -0x19(%rbp),%eax
cmp    $0x33,%eax
jne    146b <main+0x33b>
movsbl -0x18(%rbp),%eax
cmp    $0x33,%eax
jne    146b <main+0x33b>
movsbl -0x17(%rbp),%eax
cmp    $0x33,%eax
jne    146b <main+0x33b>
movsbl -0x16(%rbp),%eax
cmp    $0x34,%eax
jne    146b <main+0x33b>
movsbl -0x15(%rbp),%eax
cmp    $0x36,%eax
jne    146b <main+0x33b>
lea    0xba7(%rip),%rdi
call   1040 <printf@plt>
movsbl -0x1a(%rbp),%eax
cmp    $0x30,%eax
jne    1491 <main+0x361>
movsbl -0x19(%rbp),%eax
cmp    $0x31,%eax
jne    1491 <main+0x361>
lea    0xb8d(%rip),%rdi
call   1040 <printf@plt>
movsbl -0x1a(%rbp),%eax
cmp    $0x35,%eax
jne    14de <main+0x3ae>
movsbl -0x19(%rbp),%eax
cmp    $0x35,%eax
jne    14de <main+0x3ae>
movsbl -0x18(%rbp),%eax
cmp    $0x35,%eax
jne    14de <main+0x3ae>
movsbl -0x17(%rbp),%eax
cmp    $0x38,%eax
jne    14de <main+0x3ae>
movsbl -0x16(%rbp),%eax
cmp    $0x33,%eax
jne    14de <main+0x3ae>
lea    0xb4f(%rip),%rdi
call   1040 <printf@plt>
movsbl -0x1a(%rbp),%eax
cmp    $0x34,%eax
jne    151e <main+0x3ee>
movsbl -0x19(%rbp),%eax
cmp    $0x32,%eax
jne    151e <main+0x3ee>
movsbl -0x18(%rbp),%eax
cmp    $0x31,%eax
jne    151e <main+0x3ee>
movsbl -0x17(%rbp),%eax
cmp    $0x30,%eax
jne    151e <main+0x3ee>
lea    0xb1d(%rip),%rdi
call   1040 <printf@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %rbx
sub    $0x38,%rsp
lea    0xeaf(%rip),%rdi
mov    %rsp,%rsi
call   1060 <scanf@plt>
cmpb   $0x39,(%rsp)
jne    11dd <main+0x9d>
cmpb   $0x37,0x1(%rsp)
jne    11dd <main+0x9d>
mov    0x2(%rsp),%al
and    $0xfe,%al
cmp    $0x38,%al
jne    11dd <main+0x9d>
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1040 <strlen@plt>
mov    %rbx,%rdi
call   1040 <strlen@plt>
test   %eax,%eax
jle    11f4 <main+0xb4>
xor    %ebx,%ebx
mov    $0x1,%ebp
mov    %rsp,%r14
xor    %r15d,%r15d
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
movsbl -0x1(%rsp,%rbp,1),%eax
lea    -0x30(%rax),%ecx
cmp    $0x9,%cl
ja     11c3 <main+0x83>
add    $0x1,%ebx
lea    -0x30(%rax),%ecx
test   $0x1,%bl
lea    -0x90(%rax,%rax,2),%eax
cmovne %ecx,%eax
add    %eax,%r15d
mov    %r14,%rdi
call   1040 <strlen@plt>
cltq
cmp    %rax,%rbp
jge    11f7 <main+0xb7>
add    $0x1,%rbp
cmp    $0xc,%ebx
jl     11a0 <main+0x60>
jmp    11f7 <main+0xb7>
mov    $0x30,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
add    $0x38,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret
xor    %r15d,%r15d
movslq %r15d,%rax
imul   $0x66666667,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x22,%rcx
add    %edx,%ecx
add    %ecx,%ecx
lea    (%rcx,%rcx,4),%ecx
sub    %eax,%ecx
add    $0xa,%ecx
movsbl (%rsp),%eax
add    $0xffffffd0,%eax
cmp    %eax,%ecx
jne    122d <main+0xed>
mov    $0x31,%edi
call   1030 <putchar@plt>
movd   0x6(%rsp),%xmm0
movd   %xmm0,%esi
mov    0xa(%rsp),%bl
mov    0xb(%rsp),%dl
movdqa %xmm0,0x20(%rsp)
mov    0x20(%rsp),%cl
mov    0x21(%rsp),%al
cmp    $0x33333339,%esi
jne    1273 <main+0x133>
cmp    $0x34,%bl
jne    1273 <main+0x133>
cmp    $0x36,%dl
jne    1273 <main+0x133>
lea    0xd9d(%rip),%rdi
call   1050 <printf@plt>
mov    0x6(%rsp),%cl
mov    0x7(%rsp),%al
cmp    $0x30,%cl
jne    1290 <main+0x150>
cmp    $0x31,%al
jne    1290 <main+0x150>
lea    0xd8c(%rip),%rdi
call   1050 <printf@plt>
mov    0x6(%rsp),%cl
mov    0x7(%rsp),%al
mov    0x8(%rsp),%bl
mov    0x9(%rsp),%dl
cmp    $0x35,%cl
jne    12ce <main+0x18e>
cmp    $0x35,%al
jne    12ce <main+0x18e>
cmp    $0x35,%bl
jne    12ce <main+0x18e>
cmp    $0x38,%dl
jne    12ce <main+0x18e>
cmpb   $0x33,0xa(%rsp)
jne    12ce <main+0x18e>
lea    0xd65(%rip),%rdi
call   1050 <printf@plt>
mov    0x6(%rsp),%cl
mov    0x7(%rsp),%al
mov    0x8(%rsp),%bl
mov    0x9(%rsp),%dl
cmp    $0x34,%cl
jne    11e7 <main+0xa7>
cmp    $0x32,%al
jne    11e7 <main+0xa7>
cmp    $0x31,%bl
jne    11e7 <main+0xa7>
cmp    $0x30,%dl
jne    11e7 <main+0xa7>
lea    0xd34(%rip),%rdi
call   1050 <printf@plt>
jmp    11e7 <main+0xa7>

LLVM IR (-O0):
@__const.main.header1 = [3 x i8] c"978"
@__const.main.header2 = [3 x i8] c"979"
@.str = [3 x i8] c"%s\00"
@.str.1 = [2 x i8] c"0\00"
@.str.2 = [2 x i8] c"1\00"
@.str.3 = [12 x i8] c"\0ABluebridge\00"
@.str.4 = [15 x i8] c"\0APyramid Books\00"
@.str.5 = [14 x i8] c"\0AAlyson Books\00"
@.str.6 = [30 x i8] c"\0AFUNimation Productions, Ltd.\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [20 x i8]
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca [3 x i8]
%9 = alloca [3 x i8]
store i32 0, i32* %1
store i32 0, i32* %3
%10 = bitcast [3 x i8]* %8 to i8*
%11 = bitcast [3 x i8]* %9 to i8*
%12 = getelementptr inbounds [20 x i8], [20 x i8]* %2, i64 0, i64 0
%13 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %12)
store i32 0, i32* %6
br label %14
14: ; preds = %44, %0
%15 = load i32, i32* %6
%16 = icmp slt i32 %15, 3
br i1 %16, label %17, label %47
17: ; preds = %14
%18 = load i32, i32* %6
%19 = sext i32 %18 to i64
%20 = getelementptr inbounds [20 x i8], [20 x i8]* %2, i64 0, i64 %19
%21 = load i8, i8* %20
%22 = sext i8 %21 to i32
%23 = load i32, i32* %6
%24 = sext i32 %23 to i64
%25 = getelementptr inbounds [3 x i8], [3 x i8]* %8, i64 0, i64 %24
%26 = load i8, i8* %25
%27 = sext i8 %26 to i32
%28 = icmp ne i32 %22, %27
br i1 %28, label %29, label %43
29: ; preds = %17
%30 = load i32, i32* %6
%31 = sext i32 %30 to i64
%32 = getelementptr inbounds [20 x i8], [20 x i8]* %2, i64 0, i64 %31
%33 = load i8, i8* %32
%34 = sext i8 %33 to i32
%35 = load i32, i32* %6
%36 = sext i32 %35 to i64
%37 = getelementptr inbounds [3 x i8], [3 x i8]* %9, i64 0, i64 %36
%38 = load i8, i8* %37
%39 = sext i8 %38 to i32
%40 = icmp ne i32 %34, %39
br i1 %40, label %41, label %43
41: ; preds = %29
%42 = 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 %272
43: ; preds = %29, %17
br label %44
44: ; preds = %43
%45 = load i32, i32* %6
%46 = add nsw i32 %45, 1
store i32 %46, i32* %6
br label %14
47: ; preds = %14
store i32 0, i32* %6
br label %48
48: ; preds = %97, %47
%49 = load i32, i32* %6
%50 = getelementptr inbounds [20 x i8], [20 x i8]* %2, i64 0, i64 0
%51 = call i32 @strlen(i8* %50)
%52 = icmp slt i32 %49, %51
br i1 %52, label %53, label %56
53: ; preds = %48
%54 = load i32, i32* %7
%55 = icmp ne i32 %54, 13
br label %56
56: ; preds = %53, %48
%57 = phi i1 [ false, %48 ], [ %55, %53 ]
br i1 %57, label %58, label %100
58: ; preds = %56
%59 = load i32, i32* %6
%60 = sext i32 %59 to i64
%61 = getelementptr inbounds [20 x i8], [20 x i8]* %2, i64 0, i64 %60
%62 = load i8, i8* %61
%63 = sext i8 %62 to i32
%64 = icmp sge i32 %63, 48
br i1 %64, label %65, label %76
65: ; preds = %58
%66 = load i32, i32* %6
%67 = sext i32 %66 to i64
%68 = getelementptr inbounds [20 x i8], [20 x i8]* %2, i64 0, i64 %67
%69 = load i8, i8* %68
%70 = sext i8 %69 to i32
%71 = icmp sle i32 %70, 57
br i1 %71, label %72, label %76
72: ; preds = %65
%73 = load i32, i32* %7
%74 = add nsw i32 %73, 1
store i32 %74, i32* %7
%75 = load i32, i32* %6
store i32 %75, i32* %5
br label %96
76: ; preds = %65, %58
%77 = load i32, i32* %6
%78 = add nsw i32 %77, 1
%79 = sext i32 %78 to i64
%80 = getelementptr inbounds [20 x i8], [20 x i8]* %2, i64 0, i64 %79
%81 = load i8, i8* %80
%82 = sext i8 %81 to i32
%83 = icmp eq i32 %82, 45
br i1 %83, label %84, label %86
84: ; preds = %76
%85 = 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 %272
86: ; preds = %76
%87 = load i32, i32* %6
%88 = sext i32 %87 to i64
%89 = getelementptr inbounds [20 x i8], [20 x i8]* %2, i64 0, i64 %88
%90 = load i8, i8* %89
%91 = sext i8 %90 to i32
%92 = icmp ne i32 %91, 45
br i1 %92, label %93, label %95
93: ; preds = %86
%94 = 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 %272
95: ; preds = %86
br label %96
96: ; preds = %95, %72
br label %97
97: ; preds = %96
%98 = load i32, i32* %6
%99 = add nsw i32 %98, 1
store i32 %99, i32* %6
br label %48
100: ; preds = %56
%101 = load i32, i32* %7
%102 = icmp slt i32 %101, 13
br i1 %102, label %103, label %105
103: ; preds = %100
%104 = 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 %272
105: ; preds = %100
store i32 0, i32* %6
store i32 0, i32* %7
br label %106
106: ; preds = %160, %105
%107 = load i32, i32* %6
%108 = getelementptr inbounds [20 x i8], [20 x i8]* %2, i64 0, i64 0
%109 = call i32 @strlen(i8* %108)
%110 = icmp slt i32 %107, %109
br i1 %110, label %111, label %114
111: ; preds = %106
%112 = load i32, i32* %7
%113 = icmp slt i32 %112, 12
br label %114
114: ; preds = %111, %106
%115 = phi i1 [ false, %106 ], [ %113, %111 ]
br i1 %115, label %116, label %163
116: ; preds = %114
%117 = load i32, i32* %6
%118 = sext i32 %117 to i64
%119 = getelementptr inbounds [20 x i8], [20 x i8]* %2, i64 0, i64 %118
%120 = load i8, i8* %119
%121 = sext i8 %120 to i32
%122 = icmp sge i32 %121, 48
br i1 %122, label %123, label %159
123: ; preds = %116
%124 = load i32, i32* %6
%125 = sext i32 %124 to i64
%126 = getelementptr inbounds [20 x i8], [20 x i8]* %2, i64 0, i64 %125
%127 = load i8, i8* %126
%128 = sext i8 %127 to i32
%129 = icmp sle i32 %128, 57
br i1 %129, label %130, label %159
130: ; preds = %123
%131 = load i32, i32* %7
%132 = add nsw i32 %131, 1
store i32 %132, i32* %7
%133 = load i32, i32* %7
%134 = srem i32 %133, 2
%135 = icmp eq i32 %134, 0
br i1 %135, label %136, label %144
136: ; preds = %130
%137 = load i32, i32* %6
%138 = sext i32 %137 to i64
%139 = getelementptr inbounds [20 x i8], [20 x i8]* %2, i64 0, i64 %138
%140 = load i8, i8* %139
%141 = sext i8 %140 to i32
%142 = sub nsw i32 %141, 48
%143 = mul nsw i32 %142, 3
store i32 %143, i32* %4
br label %144
144: ; preds = %136, %130
%145 = load i32, i32* %7
%146 = srem i32 %145, 2
%147 = icmp ne i32 %146, 0
br i1 %147, label %148, label %155
148: ; preds = %144
%149 = load i32, i32* %6
%150 = sext i32 %149 to i64
%151 = getelementptr inbounds [20 x i8], [20 x i8]* %2, i64 0, i64 %150
%152 = load i8, i8* %151
%153 = sext i8 %152 to i32
%154 = sub nsw i32 %153, 48
store i32 %154, i32* %4
br label %155
155: ; preds = %148, %144
%156 = load i32, i32* %3
%157 = load i32, i32* %4
%158 = add nsw i32 %156, %157
store i32 %158, i32* %3
br label %159
159: ; preds = %155, %123, %116
br label %160
160: ; preds = %159
%161 = load i32, i32* %6
%162 = add nsw i32 %161, 1
store i32 %162, i32* %6
br label %106
163: ; preds = %114
%164 = load i32, i32* %3
%165 = srem i32 %164, 10
store i32 %165, i32* %3
%166 = load i32, i32* %3
%167 = sub nsw i32 10, %166
store i32 %167, i32* %3
%168 = load i32, i32* %3
%169 = load i32, i32* %5
%170 = sext i32 %169 to i64
%171 = getelementptr inbounds [20 x i8], [20 x i8]* %2, i64 0, i64 %170
%172 = load i8, i8* %171
%173 = sext i8 %172 to i32
%174 = sub nsw i32 %173, 48
%175 = icmp eq i32 %168, %174
br i1 %175, label %176, label %178
176: ; preds = %163
%177 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
br label %178
178: ; preds = %176, %163
%179 = getelementptr inbounds [20 x i8], [20 x i8]* %2, i64 0, i64 6
%180 = load i8, i8* %179
%181 = sext i8 %180 to i32
%182 = icmp eq i32 %181, 57
br i1 %182, label %183, label %210
183: ; preds = %178
%184 = getelementptr inbounds [20 x i8], [20 x i8]* %2, i64 0, i64 7
%185 = load i8, i8* %184
%186 = sext i8 %185 to i32
%187 = icmp eq i32 %186, 51
br i1 %187, label %188, label %210
188: ; preds = %183
%189 = getelementptr inbounds [20 x i8], [20 x i8]* %2, i64 0, i64 8
%190 = load i8, i8* %189
%191 = sext i8 %190 to i32
%192 = icmp eq i32 %191, 51
br i1 %192, label %193, label %210
193: ; preds = %188
%194 = getelementptr inbounds [20 x i8], [20 x i8]* %2, i64 0, i64 9
%195 = load i8, i8* %194
%196 = sext i8 %195 to i32
%197 = icmp eq i32 %196, 51
br i1 %197, label %198, label %210
198: ; preds = %193
%199 = getelementptr inbounds [20 x i8], [20 x i8]* %2, i64 0, i64 10
%200 = load i8, i8* %199
%201 = sext i8 %200 to i32
%202 = icmp eq i32 %201, 52
br i1 %202, label %203, label %210
203: ; preds = %198
%204 = getelementptr inbounds [20 x i8], [20 x i8]* %2, i64 0, i64 11
%205 = load i8, i8* %204
%206 = sext i8 %205 to i32
%207 = icmp eq i32 %206, 54
br i1 %207, label %208, label %210
208: ; preds = %203
%209 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.3, i64 0, i64 0))
br label %210
210: ; preds = %208, %203, %198, %193, %188, %183, %178
%211 = getelementptr inbounds [20 x i8], [20 x i8]* %2, i64 0, i64 6
%212 = load i8, i8* %211
%213 = sext i8 %212 to i32
%214 = icmp eq i32 %213, 48
br i1 %214, label %215, label %222
215: ; preds = %210
%216 = getelementptr inbounds [20 x i8], [20 x i8]* %2, i64 0, i64 7
%217 = load i8, i8* %216
%218 = sext i8 %217 to i32
%219 = icmp eq i32 %218, 49
br i1 %219, label %220, label %222
220: ; preds = %215
%221 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.4, i64 0, i64 0))
br label %222
222: ; preds = %220, %215, %210
%223 = getelementptr inbounds [20 x i8], [20 x i8]* %2, i64 0, i64 6
%224 = load i8, i8* %223
%225 = sext i8 %224 to i32
%226 = icmp eq i32 %225, 53
br i1 %226, label %227, label %249
227: ; preds = %222
%228 = getelementptr inbounds [20 x i8], [20 x i8]* %2, i64 0, i64 7
%229 = load i8, i8* %228
%230 = sext i8 %229 to i32
%231 = icmp eq i32 %230, 53
br i1 %231, label %232, label %249
232: ; preds = %227
%233 = getelementptr inbounds [20 x i8], [20 x i8]* %2, i64 0, i64 8
%234 = load i8, i8* %233
%235 = sext i8 %234 to i32
%236 = icmp eq i32 %235, 53
br i1 %236, label %237, label %249
237: ; preds = %232
%238 = getelementptr inbounds [20 x i8], [20 x i8]* %2, i64 0, i64 9
%239 = load i8, i8* %238
%240 = sext i8 %239 to i32
%241 = icmp eq i32 %240, 56
br i1 %241, label %242, label %249
242: ; preds = %237
%243 = getelementptr inbounds [20 x i8], [20 x i8]* %2, i64 0, i64 10
%244 = load i8, i8* %243
%245 = sext i8 %244 to i32
%246 = icmp eq i32 %245, 51
br i1 %246, label %247, label %249
247: ; preds = %242
%248 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.5, i64 0, i64 0))
br label %249
249: ; preds = %247, %242, %237, %232, %227, %222
%250 = getelementptr inbounds [20 x i8], [20 x i8]* %2, i64 0, i64 6
%251 = load i8, i8* %250
%252 = sext i8 %251 to i32
%253 = icmp eq i32 %252, 52
br i1 %253, label %254, label %271
254: ; preds = %249
%255 = getelementptr inbounds [20 x i8], [20 x i8]* %2, i64 0, i64 7
%256 = load i8, i8* %255
%257 = sext i8 %256 to i32
%258 = icmp eq i32 %257, 50
br i1 %258, label %259, label %271
259: ; preds = %254
%260 = getelementptr inbounds [20 x i8], [20 x i8]* %2, i64 0, i64 8
%261 = load i8, i8* %260
%262 = sext i8 %261 to i32
%263 = icmp eq i32 %262, 49
br i1 %263, label %264, label %271
264: ; preds = %259
%265 = getelementptr inbounds [20 x i8], [20 x i8]* %2, i64 0, i64 9
%266 = load i8, i8* %265
%267 = sext i8 %266 to i32
%268 = icmp eq i32 %267, 48
br i1 %268, label %269, label %271
269: ; preds = %264
%270 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.6, i64 0, i64 0))
br label %271
271: ; preds = %269, %264, %259, %254, %249
store i32 0, i32* %1
br label %272
272: ; preds = %271, %103, %93, %84, %41
%273 = load i32, i32* %1
ret i32 %273
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
@.str.3 = [12 x i8] c"\0ABluebridge\00"
@.str.4 = [15 x i8] c"\0APyramid Books\00"
@.str.5 = [14 x i8] c"\0AAlyson Books\00"
@.str.6 = [30 x i8] c"\0AFUNimation Productions, Ltd.\00"
define i32 @main() {
%1 = alloca [20 x i8]
%2 = getelementptr inbounds [20 x i8], [20 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 = load i8, i8* %2
%5 = icmp eq i8 %4, 57
%6 = getelementptr inbounds [20 x i8], [20 x i8]* %1, i64 0, i64 1
%7 = load i8, i8* %6
%8 = icmp eq i8 %7, 55
%9 = select i1 %5, i1 %8, i1 false
br i1 %9, label %12, label %10
10: ; preds = %12, %0
%11 = call i32 @putchar(i32 48)
br label %127
12: ; preds = %0
%13 = getelementptr inbounds [20 x i8], [20 x i8]* %1, i64 0, i64 2
%14 = load i8, i8* %13
%15 = and i8 %14, -2
%16 = icmp eq i8 %15, 56
br i1 %16, label %17, label %10
17: ; preds = %12
%18 = call i32 @strlen(i8* %2)
%19 = call i32 @strlen(i8* %2)
%20 = icmp sgt i32 %19, 0
br i1 %20, label %21, label %48
21: ; preds = %17, %39
%22 = phi i64 [ %42, %39 ], [ 0, %17 ]
%23 = phi i32 [ %41, %39 ], [ 0, %17 ]
%24 = phi i32 [ %40, %39 ], [ 0, %17 ]
%25 = getelementptr inbounds [20 x i8], [20 x i8]* %1, i64 0, i64 %22
%26 = load i8, i8* %25
%27 = sext i8 %26 to i32
%28 = add i8 %26, -48
%29 = icmp ult i8 %28, 10
br i1 %29, label %30, label %39
30: ; preds = %21
%31 = add nsw i32 %23, 1
%32 = and i32 %31, 1
%33 = icmp eq i32 %32, 0
%34 = mul nsw i32 %27, 3
%35 = add nsw i32 %34, -144
%36 = add nsw i32 %27, -48
%37 = select i1 %33, i32 %35, i32 %36
%38 = add nsw i32 %37, %24
br label %39
39: ; preds = %21, %30
%40 = phi i32 [ %38, %30 ], [ %24, %21 ]
%41 = phi i32 [ %31, %30 ], [ %23, %21 ]
%42 = add nuw nsw i64 %22, 1
%43 = call i32 @strlen(i8* %2)
%44 = sext i32 %43 to i64
%45 = icmp slt i64 %42, %44
%46 = icmp slt i32 %41, 12
%47 = select i1 %45, i1 %46, i1 false
br i1 %47, label %21, label %48
48: ; preds = %39, %17
%49 = phi i32 [ 0, %17 ], [ %40, %39 ]
%50 = srem i32 %49, 10
%51 = sub nsw i32 10, %50
%52 = load i8, i8* %2
%53 = sext i8 %52 to i32
%54 = add nsw i32 %53, -48
%55 = icmp eq i32 %51, %54
br i1 %55, label %56, label %58
56: ; preds = %48
%57 = call i32 @putchar(i32 49)
br label %58
58: ; preds = %56, %48
%59 = getelementptr inbounds [20 x i8], [20 x i8]* %1, i64 0, i64 6
%60 = getelementptr inbounds [20 x i8], [20 x i8]* %1, i64 0, i64 7
%61 = getelementptr inbounds [20 x i8], [20 x i8]* %1, i64 0, i64 8
%62 = getelementptr inbounds [20 x i8], [20 x i8]* %1, i64 0, i64 9
%63 = bitcast i8* %59 to <4 x i8>*
%64 = load <4 x i8>, <4 x i8>* %63
%65 = freeze <4 x i8> %64
%66 = bitcast <4 x i8> %65 to i32
%67 = icmp eq i32 %66, 858993465
%68 = getelementptr inbounds [20 x i8], [20 x i8]* %1, i64 0, i64 10
%69 = load i8, i8* %68
%70 = icmp eq i8 %69, 52
%71 = select i1 %67, i1 %70, i1 false
%72 = getelementptr inbounds [20 x i8], [20 x i8]* %1, i64 0, i64 11
%73 = load i8, i8* %72
%74 = icmp eq i8 %73, 54
%75 = select i1 %71, i1 %74, i1 false
%76 = extractelement <4 x i8> %65, i64 0
%77 = extractelement <4 x i8> %65, i64 1
br i1 %75, label %78, label %82
78: ; preds = %58
%79 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.3, i64 0, i64 0))
%80 = load i8, i8* %59
%81 = load i8, i8* %60
br label %82
82: ; preds = %78, %58
%83 = phi i8 [ %81, %78 ], [ %77, %58 ]
%84 = phi i8 [ %80, %78 ], [ %76, %58 ]
%85 = icmp eq i8 %84, 48
%86 = icmp eq i8 %83, 49
%87 = select i1 %85, i1 %86, i1 false
br i1 %87, label %88, label %92
88: ; preds = %82
%89 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.4, i64 0, i64 0))
%90 = load i8, i8* %59
%91 = load i8, i8* %60
br label %92
92: ; preds = %88, %82
%93 = phi i8 [ %91, %88 ], [ %83, %82 ]
%94 = phi i8 [ %90, %88 ], [ %84, %82 ]
%95 = icmp eq i8 %94, 53
%96 = icmp eq i8 %93, 53
%97 = select i1 %95, i1 %96, i1 false
%98 = load i8, i8* %61
%99 = icmp eq i8 %98, 53
%100 = select i1 %97, i1 %99, i1 false
%101 = load i8, i8* %62
%102 = icmp eq i8 %101, 56
%103 = select i1 %100, i1 %102, i1 false
%104 = load i8, i8* %68
%105 = icmp eq i8 %104, 51
%106 = select i1 %103, i1 %105, i1 false
br i1 %106, label %107, label %113
107: ; preds = %92
%108 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.5, i64 0, i64 0))
%109 = load i8, i8* %59
%110 = load i8, i8* %60
%111 = load i8, i8* %61
%112 = load i8, i8* %62
br label %113
113: ; preds = %107, %92
%114 = phi i8 [ %112, %107 ], [ %101, %92 ]
%115 = phi i8 [ %111, %107 ], [ %98, %92 ]
%116 = phi i8 [ %110, %107 ], [ %93, %92 ]
%117 = phi i8 [ %109, %107 ], [ %94, %92 ]
%118 = icmp eq i8 %117, 52
%119 = icmp eq i8 %116, 50
%120 = select i1 %118, i1 %119, i1 false
%121 = icmp eq i8 %115, 49
%122 = select i1 %120, i1 %121, i1 false
%123 = icmp eq i8 %114, 48
%124 = select i1 %122, i1 %123, i1 false
br i1 %124, label %125, label %127
125: ; preds = %113
%126 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @.str.6, i64 0, i64 0))
br label %127
127: ; preds = %113, %125, %10
ret i32 0
}