#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 */
scalar_t__ strcmp(char const *, char *);
int is_fac_branch(char *branch) {
  const char *br[] = {"MEB", "PEB", "KEB", "LEB", "EEB", "PKB", "CEB"};
  int i;
  for (i = 0; i < 7; i++) {
    if (strcmp(br[i], branch) == 0)
      return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<is_fac_branch>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
mov    %rdi,-0x10(%rbp)
lea    -0x50(%rbp),%rdi
lea    0x2ca9(%rip),%rsi
mov    $0x38,%edx
call   1040 <memcpy@plt>
movl   $0x0,-0x54(%rbp)
cmpl   $0x7,-0x54(%rbp)
jge    118d <is_fac_branch+0x6d>
movslq -0x54(%rbp),%rax
mov    -0x50(%rbp,%rax,8),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
jne    117a <is_fac_branch+0x5a>
movl   $0x1,-0x4(%rbp)
jmp    1194 <is_fac_branch+0x74>
jmp    117f <is_fac_branch+0x5f>
mov    -0x54(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x54(%rbp)
jmp    1148 <is_fac_branch+0x28>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_fac_branch>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
lea    0xee3(%rip),%rdi
mov    %rbx,%rsi
call   1030 <strcmp@plt>
mov    $0x1,%ebp
test   %rax,%rax
je     11ab <is_fac_branch+0x9b>
lea    0xece(%rip),%rdi
mov    %rbx,%rsi
call   1030 <strcmp@plt>
test   %rax,%rax
je     11ab <is_fac_branch+0x9b>
lea    0xebe(%rip),%rdi
mov    %rbx,%rsi
call   1030 <strcmp@plt>
test   %rax,%rax
je     11ab <is_fac_branch+0x9b>
lea    0xeae(%rip),%rdi
mov    %rbx,%rsi
call   1030 <strcmp@plt>
test   %rax,%rax
je     11ab <is_fac_branch+0x9b>
lea    0xe9e(%rip),%rdi
mov    %rbx,%rsi
call   1030 <strcmp@plt>
test   %rax,%rax
je     11ab <is_fac_branch+0x9b>
lea    0xe8e(%rip),%rdi
mov    %rbx,%rsi
call   1030 <strcmp@plt>
test   %rax,%rax
je     11ab <is_fac_branch+0x9b>
lea    0xe7e(%rip),%rdi
mov    %rbx,%rsi
call   1030 <strcmp@plt>
xor    %ebp,%ebp
test   %rax,%rax
sete   %bpl
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [4 x i8] c"MEB\00"
@.str.1 = [4 x i8] c"PEB\00"
@.str.2 = [4 x i8] c"KEB\00"
@.str.3 = [4 x i8] c"LEB\00"
@.str.4 = [4 x i8] c"EEB\00"
@.str.5 = [4 x i8] c"PKB\00"
@.str.6 = [4 x i8] c"CEB\00"
@__const.is_fac_branch.br = [7 x i8*] [i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i32 0, i32 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i32 0, i32 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i32 0, i32 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i32 0, i32 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i32 0, i32 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i32 0, i32 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.6, i32 0, i32 0)]
define i32 @is_fac_branch(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca [7 x i8*]
%5 = alloca i32
store i8* %0, i8** %3
%6 = bitcast [7 x i8*]* %4 to i8*
store i32 0, i32* %5
br label %7
7: ; preds = %20, %1
%8 = load i32, i32* %5
%9 = icmp slt i32 %8, 7
br i1 %9, label %10, label %23
10: ; preds = %7
%11 = load i32, i32* %5
%12 = sext i32 %11 to i64
%13 = getelementptr inbounds [7 x i8*], [7 x i8*]* %4, i64 0, i64 %12
%14 = load i8*, i8** %13
%15 = load i8*, i8** %3
%16 = call i64 @strcmp(i8* %14, i8* %15)
%17 = icmp eq i64 %16, 0
br i1 %17, label %18, label %19
18: ; preds = %10
store i32 1, i32* %2
br label %24
19: ; preds = %10
br label %20
20: ; preds = %19
%21 = load i32, i32* %5
%22 = add nsw i32 %21, 1
store i32 %22, i32* %5
br label %7
23: ; preds = %7
store i32 0, i32* %2
br label %24
24: ; preds = %23, %18
%25 = load i32, i32* %2
ret i32 %25
}

LLVM IR (-O2):
@.str = [4 x i8] c"MEB\00"
@.str.1 = [4 x i8] c"PEB\00"
@.str.2 = [4 x i8] c"KEB\00"
@.str.3 = [4 x i8] c"LEB\00"
@.str.4 = [4 x i8] c"EEB\00"
@.str.5 = [4 x i8] c"PKB\00"
@.str.6 = [4 x i8] c"CEB\00"
define i32 @is_fac_branch(i8* %0) {
%2 = tail call i64 @strcmp(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %23, label %4
4: ; preds = %1
%5 = tail call i64 @strcmp(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %0)
%6 = icmp eq i64 %5, 0
br i1 %6, label %23, label %7
7: ; preds = %4
%8 = tail call i64 @strcmp(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i8* %0)
%9 = icmp eq i64 %8, 0
br i1 %9, label %23, label %10
10: ; preds = %7
%11 = tail call i64 @strcmp(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i8* %0)
%12 = icmp eq i64 %11, 0
br i1 %12, label %23, label %13
13: ; preds = %10
%14 = tail call i64 @strcmp(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), i8* %0)
%15 = icmp eq i64 %14, 0
br i1 %15, label %23, label %16
16: ; preds = %13
%17 = tail call i64 @strcmp(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0), i8* %0)
%18 = icmp eq i64 %17, 0
br i1 %18, label %23, label %19
19: ; preds = %16
%20 = tail call i64 @strcmp(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.6, i64 0, i64 0), i8* %0)
%21 = icmp eq i64 %20, 0
%22 = zext i1 %21 to i32
br label %23
23: ; preds = %19, %16, %13, %10, %7, %4, %1
%24 = phi i32 [ 1, %1 ], [ 1, %4 ], [ 1, %7 ], [ 1, %10 ], [ 1, %13 ], [ 1, %16 ], [ %22, %19 ]
ret i32 %24
}