#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 *);
void CheckBrand(char *digits) {
  int i = 6;
  char a[10];
  for (; digits[i] != '-'; i++)
    a[i - 6] = digits[i];
  if (strcmp(a, "933346") == 0)
    printf("\nBluebridge");
  if (strcmp(a, "55583") == 0)
    printf("\nAlyson Books");
  if (strcmp(a, "4210") == 0)
    printf("\nFUNimation Productions, Ltd.");
  if (strcmp(a, "01") == 0)
    printf("\nPyramid Books");
}


x86 assembly (clang, -O0):
<CheckBrand>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x6,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x2d,%eax
je     116d <CheckBrand+0x4d>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,1),%cl
mov    -0xc(%rbp),%eax
sub    $0x6,%eax
cltq
mov    %cl,-0x16(%rbp,%rax,1)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1133 <CheckBrand+0x13>
lea    -0x16(%rbp),%rdi
lea    0xe88(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
jne    1193 <CheckBrand+0x73>
lea    0xe79(%rip),%rdi
call   1030 <printf@plt>
lea    -0x16(%rbp),%rdi
lea    0xe75(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
jne    11b9 <CheckBrand+0x99>
lea    0xe65(%rip),%rdi
call   1030 <printf@plt>
lea    -0x16(%rbp),%rdi
lea    0xe63(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
jne    11df <CheckBrand+0xbf>
lea    0xe52(%rip),%rdi
call   1030 <printf@plt>
lea    -0x16(%rbp),%rdi
lea    0xe60(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
jne    1205 <CheckBrand+0xe5>
lea    0xe4d(%rip),%rdi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CheckBrand>:
sub    $0x18,%rsp
mov    0x6(%rdi),%al
cmp    $0x2d,%al
je     1141 <CheckBrand+0x21>
xor    %ecx,%ecx
nopl   (%rax)
mov    %al,0xe(%rsp,%rcx,1)
movzbl 0x7(%rdi,%rcx,1),%eax
add    $0x1,%rcx
cmp    $0x2d,%al
jne    1130 <CheckBrand+0x10>
lea    0xeb8(%rip),%rsi
lea    0xe(%rsp),%rdi
call   1040 <strcmp@plt>
test   %rax,%rax
jne    1163 <CheckBrand+0x43>
lea    0xea9(%rip),%rdi
call   1030 <printf@plt>
lea    0xea9(%rip),%rsi
lea    0xe(%rsp),%rdi
call   1040 <strcmp@plt>
test   %rax,%rax
jne    1185 <CheckBrand+0x65>
lea    0xe99(%rip),%rdi
call   1030 <printf@plt>
lea    0xe9b(%rip),%rsi
lea    0xe(%rsp),%rdi
call   1040 <strcmp@plt>
test   %rax,%rax
jne    11a7 <CheckBrand+0x87>
lea    0xe8a(%rip),%rdi
call   1030 <printf@plt>
lea    0xe9c(%rip),%rsi
lea    0xe(%rsp),%rdi
call   1040 <strcmp@plt>
test   %rax,%rax
je     11c2 <CheckBrand+0xa2>
add    $0x18,%rsp
ret
lea    0xe84(%rip),%rdi
call   1030 <printf@plt>
add    $0x18,%rsp
ret

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

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