#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 *);
scalar_t__ strcmp(char *, char *);
char *strtok(char *, char *);
void print_publisher(char *isbn) {
  int i = 0;
  char *temp;
  temp = strtok(isbn, "-");
  while (temp != NULL) {
    i++;
    if (i <= 3) {
      if (strcmp(temp, "933346") == 0) {
        printf("\nBluebridge");
      } else if (strcmp(temp, "55583") == 0) {
        printf("\nAlyson Books");
      } else if (strcmp(temp, "4210") == 0) {
        printf("\nFUNimation Productions, Ltd.");
      } else if (strcmp(temp, "01") == 0) {
        printf("\nPyramid Books");
      }
    } else {
      return;
    }
    temp = strtok(NULL, "-");
  }
}


x86 assembly (clang, -O0):
<print_publisher>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xeb2(%rip),%rsi
call   1050 <strtok@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     124e <print_publisher+0x11e>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x3,-0xc(%rbp)
jg     1230 <print_publisher+0x100>
mov    -0x18(%rbp),%rdi
lea    0xe82(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
jne    11a0 <print_publisher+0x70>
lea    0xe73(%rip),%rdi
call   1030 <printf@plt>
jmp    122b <print_publisher+0xfb>
mov    -0x18(%rbp),%rdi
lea    0xe6a(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
jne    11cb <print_publisher+0x9b>
lea    0xe5a(%rip),%rdi
call   1030 <printf@plt>
jmp    1226 <print_publisher+0xf6>
mov    -0x18(%rbp),%rdi
lea    0xe53(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
jne    11f6 <print_publisher+0xc6>
lea    0xe42(%rip),%rdi
call   1030 <printf@plt>
jmp    1221 <print_publisher+0xf1>
mov    -0x18(%rbp),%rdi
lea    0xe4b(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
jne    121c <print_publisher+0xec>
lea    0xe38(%rip),%rdi
call   1030 <printf@plt>
jmp    1221 <print_publisher+0xf1>
jmp    1226 <print_publisher+0xf6>
jmp    122b <print_publisher+0xfb>
jmp    1235 <print_publisher+0x105>
jmp    124e <print_publisher+0x11e>
xor    %eax,%eax
mov    %eax,%edi
lea    0xdc0(%rip),%rsi
call   1050 <strtok@plt>
mov    %rax,-0x18(%rbp)
jmp    1157 <print_publisher+0x27>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_publisher>:
push   %rbx
lea    0xec8(%rip),%rsi
call   1050 <strtok@plt>
test   %rax,%rax
je     12c0 <print_publisher+0x190>
mov    %rax,%rbx
lea    0xeb2(%rip),%rsi
mov    %rax,%rdi
call   1040 <strcmp@plt>
test   %rax,%rax
je     11a2 <print_publisher+0x72>
lea    0xeb1(%rip),%rsi
mov    %rbx,%rdi
call   1040 <strcmp@plt>
test   %rax,%rax
je     11ab <print_publisher+0x7b>
lea    0xeb1(%rip),%rsi
mov    %rbx,%rdi
call   1040 <strcmp@plt>
test   %rax,%rax
je     11b4 <print_publisher+0x84>
lea    0xec0(%rip),%rsi
mov    %rbx,%rdi
call   1040 <strcmp@plt>
test   %rax,%rax
jne    11c0 <print_publisher+0x90>
lea    0xeaf(%rip),%rdi
jmp    11bb <print_publisher+0x8b>
lea    0xe60(%rip),%rdi
jmp    11bb <print_publisher+0x8b>
lea    0xe69(%rip),%rdi
jmp    11bb <print_publisher+0x8b>
lea    0xe73(%rip),%rdi
call   1030 <printf@plt>
lea    0xe39(%rip),%rsi
xor    %edi,%edi
call   1050 <strtok@plt>
test   %rax,%rax
je     12c0 <print_publisher+0x190>
mov    %rax,%rbx
lea    0xe21(%rip),%rsi
mov    %rax,%rdi
call   1040 <strcmp@plt>
test   %rax,%rax
je     1233 <print_publisher+0x103>
lea    0xe20(%rip),%rsi
mov    %rbx,%rdi
call   1040 <strcmp@plt>
test   %rax,%rax
je     123c <print_publisher+0x10c>
lea    0xe20(%rip),%rsi
mov    %rbx,%rdi
call   1040 <strcmp@plt>
test   %rax,%rax
je     1245 <print_publisher+0x115>
lea    0xe2f(%rip),%rsi
mov    %rbx,%rdi
call   1040 <strcmp@plt>
test   %rax,%rax
jne    1251 <print_publisher+0x121>
lea    0xe1e(%rip),%rdi
jmp    124c <print_publisher+0x11c>
lea    0xdcf(%rip),%rdi
jmp    124c <print_publisher+0x11c>
lea    0xdd8(%rip),%rdi
jmp    124c <print_publisher+0x11c>
lea    0xde2(%rip),%rdi
call   1030 <printf@plt>
lea    0xda8(%rip),%rsi
xor    %edi,%edi
call   1050 <strtok@plt>
test   %rax,%rax
je     12c0 <print_publisher+0x190>
mov    %rax,%rbx
lea    0xd94(%rip),%rsi
mov    %rax,%rdi
call   1040 <strcmp@plt>
test   %rax,%rax
je     12c2 <print_publisher+0x192>
lea    0xd93(%rip),%rsi
mov    %rbx,%rdi
call   1040 <strcmp@plt>
test   %rax,%rax
je     12cb <print_publisher+0x19b>
lea    0xd93(%rip),%rsi
mov    %rbx,%rdi
call   1040 <strcmp@plt>
test   %rax,%rax
je     12d4 <print_publisher+0x1a4>
lea    0xda2(%rip),%rsi
mov    %rbx,%rdi
call   1040 <strcmp@plt>
test   %rax,%rax
jne    12e0 <print_publisher+0x1b0>
lea    0xd91(%rip),%rdi
jmp    12db <print_publisher+0x1ab>
pop    %rbx
ret
lea    0xd40(%rip),%rdi
jmp    12db <print_publisher+0x1ab>
lea    0xd49(%rip),%rdi
jmp    12db <print_publisher+0x1ab>
lea    0xd53(%rip),%rdi
call   1030 <printf@plt>
lea    0xd19(%rip),%rsi
xor    %edi,%edi
pop    %rbx
jmp    1050 <strtok@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"-\00"
@.str.1 = [7 x i8] c"933346\00"
@.str.2 = [12 x i8] c"\0ABluebridge\00"
@.str.3 = [6 x i8] c"55583\00"
@.str.4 = [14 x i8] c"\0AAlyson Books\00"
@.str.5 = [5 x i8] c"4210\00"
@.str.6 = [30 x i8] c"\0AFUNimation Productions, Ltd.\00"
@.str.7 = [3 x i8] c"01\00"
@.str.8 = [15 x i8] c"\0APyramid Books\00"
define void @print_publisher(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i8*
store i8* %0, i8** %2
store i32 0, i32* %3
%5 = load i8*, i8** %2
%6 = call i8* @strtok(i8* %5, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i8* %6, i8** %4
br label %7
7: ; preds = %44, %1
%8 = load i8*, i8** %4
%9 = icmp ne i8* %8, null
br i1 %9, label %10, label %46
10: ; preds = %7
%11 = load i32, i32* %3
%12 = add nsw i32 %11, 1
store i32 %12, i32* %3
%13 = load i32, i32* %3
%14 = icmp sle i32 %13, 3
br i1 %14, label %15, label %43
15: ; preds = %10
%16 = load i8*, i8** %4
%17 = call i64 @strcmp(i8* %16, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
%18 = icmp eq i64 %17, 0
br i1 %18, label %19, label %21
19: ; preds = %15
%20 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0))
br label %42
21: ; preds = %15
%22 = load i8*, i8** %4
%23 = call i64 @strcmp(i8* %22, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0))
%24 = icmp eq i64 %23, 0
br i1 %24, label %25, label %27
25: ; preds = %21
%26 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.4, i64 0, i64 0))
br label %41
27: ; preds = %21
%28 = load i8*, i8** %4
%29 = call i64 @strcmp(i8* %28, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.5, i64 0, i64 0))
%30 = icmp eq i64 %29, 0
br i1 %30, label %31, label %33
31: ; preds = %27
%32 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.6, i64 0, i64 0))
br label %40
33: ; preds = %27
%34 = load i8*, i8** %4
%35 = call i64 @strcmp(i8* %34, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.7, i64 0, i64 0))
%36 = icmp eq i64 %35, 0
br i1 %36, label %37, label %39
37: ; preds = %33
%38 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.8, i64 0, i64 0))
br label %39
39: ; preds = %37, %33
br label %40
40: ; preds = %39, %31
br label %41
41: ; preds = %40, %25
br label %42
42: ; preds = %41, %19
br label %44
43: ; preds = %10
br label %46
44: ; preds = %42
%45 = call i8* @strtok(i8* null, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i8* %45, i8** %4
br label %7
46: ; preds = %43, %7
ret void
}

LLVM IR (-O2):
@.str = [2 x i8] c"-\00"
@.str.1 = [7 x i8] c"933346\00"
@.str.2 = [12 x i8] c"\0ABluebridge\00"
@.str.3 = [6 x i8] c"55583\00"
@.str.4 = [14 x i8] c"\0AAlyson Books\00"
@.str.5 = [5 x i8] c"4210\00"
@.str.6 = [30 x i8] c"\0AFUNimation Productions, Ltd.\00"
@.str.7 = [3 x i8] c"01\00"
@.str.8 = [15 x i8] c"\0APyramid Books\00"
define void @print_publisher(i8* %0) {
%2 = tail call i8* @strtok(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i8* %2, null
br i1 %3, label %57, label %4
4: ; preds = %1
%5 = tail call i64 @strcmp(i8* %2, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
%6 = icmp eq i64 %5, 0
br i1 %6, label %16, label %7
7: ; preds = %4
%8 = tail call i64 @strcmp(i8* %2, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0))
%9 = icmp eq i64 %8, 0
br i1 %9, label %16, label %10
10: ; preds = %7
%11 = tail call i64 @strcmp(i8* %2, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.5, i64 0, i64 0))
%12 = icmp eq i64 %11, 0
br i1 %12, label %16, label %13
13: ; preds = %10
%14 = tail call i64 @strcmp(i8* %2, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.7, i64 0, i64 0))
%15 = icmp eq i64 %14, 0
br i1 %15, label %16, label %19
16: ; preds = %13, %10, %7, %4
%17 = phi i8* [ getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0), %4 ], [ getelementptr inbounds ([14 x i8], [14 x i8]* @.str.4, i64 0, i64 0), %7 ], [ getelementptr inbounds ([30 x i8], [30 x i8]* @.str.6, i64 0, i64 0), %10 ], [ getelementptr inbounds ([15 x i8], [15 x i8]* @.str.8, i64 0, i64 0), %13 ]
%18 = tail call i32 @printf(i8* dereferenceable(1) %17)
br label %19
19: ; preds = %16, %13
%20 = tail call i8* @strtok(i8* null, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%21 = icmp eq i8* %20, null
br i1 %21, label %57, label %22
22: ; preds = %19
%23 = tail call i64 @strcmp(i8* %20, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
%24 = icmp eq i64 %23, 0
br i1 %24, label %34, label %25
25: ; preds = %22
%26 = tail call i64 @strcmp(i8* %20, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0))
%27 = icmp eq i64 %26, 0
br i1 %27, label %34, label %28
28: ; preds = %25
%29 = tail call i64 @strcmp(i8* %20, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.5, i64 0, i64 0))
%30 = icmp eq i64 %29, 0
br i1 %30, label %34, label %31
31: ; preds = %28
%32 = tail call i64 @strcmp(i8* %20, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.7, i64 0, i64 0))
%33 = icmp eq i64 %32, 0
br i1 %33, label %34, label %37
34: ; preds = %31, %28, %25, %22
%35 = phi i8* [ getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0), %22 ], [ getelementptr inbounds ([14 x i8], [14 x i8]* @.str.4, i64 0, i64 0), %25 ], [ getelementptr inbounds ([30 x i8], [30 x i8]* @.str.6, i64 0, i64 0), %28 ], [ getelementptr inbounds ([15 x i8], [15 x i8]* @.str.8, i64 0, i64 0), %31 ]
%36 = tail call i32 @printf(i8* dereferenceable(1) %35)
br label %37
37: ; preds = %34, %31
%38 = tail call i8* @strtok(i8* null, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%39 = icmp eq i8* %38, null
br i1 %39, label %57, label %40
40: ; preds = %37
%41 = tail call i64 @strcmp(i8* %38, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
%42 = icmp eq i64 %41, 0
br i1 %42, label %52, label %43
43: ; preds = %40
%44 = tail call i64 @strcmp(i8* %38, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0))
%45 = icmp eq i64 %44, 0
br i1 %45, label %52, label %46
46: ; preds = %43
%47 = tail call i64 @strcmp(i8* %38, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.5, i64 0, i64 0))
%48 = icmp eq i64 %47, 0
br i1 %48, label %52, label %49
49: ; preds = %46
%50 = tail call i64 @strcmp(i8* %38, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.7, i64 0, i64 0))
%51 = icmp eq i64 %50, 0
br i1 %51, label %52, label %55
52: ; preds = %49, %46, %43, %40
%53 = phi i8* [ getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0), %40 ], [ getelementptr inbounds ([14 x i8], [14 x i8]* @.str.4, i64 0, i64 0), %43 ], [ getelementptr inbounds ([30 x i8], [30 x i8]* @.str.6, i64 0, i64 0), %46 ], [ getelementptr inbounds ([15 x i8], [15 x i8]* @.str.8, i64 0, i64 0), %49 ]
%54 = tail call i32 @printf(i8* dereferenceable(1) %53)
br label %55
55: ; preds = %52, %49
%56 = tail call i8* @strtok(i8* null, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
br label %57
57: ; preds = %55, %19, %37, %1
ret void
}