#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 */
typedef int /*<<< orphan*/ protected;

/* Variables and functions */
int /*<<< orphan*/ strcasecmp(char *, char *);
int bibl_notexify(char *tag) {
  char *protected[] = {"DOI", "URL", "REFNUM", "FILEATTACH", "FILE"};
  int i, nprotected = sizeof(protected) / sizeof(protected[0]);
  for (i = 0; i < nprotected; ++i)
    if (!strcasecmp(tag, protected[i]))
      return 1;
  return 0;
}


x86 assembly (clang, -O0):
<bibl_notexify>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %rdi,-0x10(%rbp)
lea    -0x40(%rbp),%rdi
xor    %esi,%esi
mov    $0x28,%edx
call   1040 <memset@plt>
lea    0xebd(%rip),%rax
mov    %rax,-0x40(%rbp)
lea    0xeb6(%rip),%rax
mov    %rax,-0x38(%rbp)
lea    0xeaf(%rip),%rax
mov    %rax,-0x30(%rbp)
lea    0xeab(%rip),%rax
mov    %rax,-0x28(%rbp)
lea    0xeab(%rip),%rax
mov    %rax,-0x20(%rbp)
movl   $0x5,-0x48(%rbp)
movl   $0x0,-0x44(%rbp)
mov    -0x44(%rbp),%eax
cmp    -0x48(%rbp),%eax
jge    11c7 <bibl_notexify+0xa7>
mov    -0x10(%rbp),%rdi
movslq -0x44(%rbp),%rax
mov    -0x40(%rbp,%rax,8),%rsi
call   1030 <strcasecmp@plt>
cmp    $0x0,%eax
jne    11b4 <bibl_notexify+0x94>
movl   $0x1,-0x4(%rbp)
jmp    11ce <bibl_notexify+0xae>
jmp    11b9 <bibl_notexify+0x99>
mov    -0x44(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x44(%rbp)
jmp    1181 <bibl_notexify+0x61>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bibl_notexify>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
lea    0xee3(%rip),%rsi
call   1030 <strcasecmp@plt>
mov    $0x1,%ebp
test   %eax,%eax
je     117b <bibl_notexify+0x6b>
lea    0xed2(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcasecmp@plt>
test   %eax,%eax
je     117b <bibl_notexify+0x6b>
lea    0xec3(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcasecmp@plt>
test   %eax,%eax
je     117b <bibl_notexify+0x6b>
lea    0xeb7(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcasecmp@plt>
test   %eax,%eax
je     117b <bibl_notexify+0x6b>
lea    0xeaf(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcasecmp@plt>
xor    %ebp,%ebp
test   %eax,%eax
sete   %bpl
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [4 x i8] c"DOI\00"
@.str.1 = [4 x i8] c"URL\00"
@.str.2 = [7 x i8] c"REFNUM\00"
@.str.3 = [11 x i8] c"FILEATTACH\00"
@.str.4 = [5 x i8] c"FILE\00"
define i32 @bibl_notexify(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca [5 x i8*]
%5 = alloca i32
%6 = alloca i32
store i8* %0, i8** %3
%7 = bitcast [5 x i8*]* %4 to i8*
%8 = bitcast i8* %7 to [5 x i8*]*
%9 = getelementptr inbounds [5 x i8*], [5 x i8*]* %8, i32 0, i32 0
store i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i32 0, i32 0), i8** %9
%10 = getelementptr inbounds [5 x i8*], [5 x i8*]* %8, i32 0, i32 1
store i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i32 0, i32 0), i8** %10
%11 = getelementptr inbounds [5 x i8*], [5 x i8*]* %8, i32 0, i32 2
store i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i32 0, i32 0), i8** %11
%12 = getelementptr inbounds [5 x i8*], [5 x i8*]* %8, i32 0, i32 3
store i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.3, i32 0, i32 0), i8** %12
%13 = getelementptr inbounds [5 x i8*], [5 x i8*]* %8, i32 0, i32 4
store i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i32 0, i32 0), i8** %13
store i32 5, i32* %6
store i32 0, i32* %5
br label %14
14: ; preds = %28, %1
%15 = load i32, i32* %5
%16 = load i32, i32* %6
%17 = icmp slt i32 %15, %16
br i1 %17, label %18, label %31
18: ; preds = %14
%19 = load i8*, i8** %3
%20 = load i32, i32* %5
%21 = sext i32 %20 to i64
%22 = getelementptr inbounds [5 x i8*], [5 x i8*]* %4, i64 0, i64 %21
%23 = load i8*, i8** %22
%24 = call i32 @strcasecmp(i8* %19, i8* %23)
%25 = icmp ne i32 %24, 0
br i1 %25, label %27, label %26
26: ; preds = %18
store i32 1, i32* %2
br label %32
27: ; preds = %18
br label %28
28: ; preds = %27
%29 = load i32, i32* %5
%30 = add nsw i32 %29, 1
store i32 %30, i32* %5
br label %14
31: ; preds = %14
store i32 0, i32* %2
br label %32
32: ; preds = %31, %26
%33 = load i32, i32* %2
ret i32 %33
}

LLVM IR (-O2):
@.str = [4 x i8] c"DOI\00"
@.str.1 = [4 x i8] c"URL\00"
@.str.2 = [7 x i8] c"REFNUM\00"
@.str.3 = [11 x i8] c"FILEATTACH\00"
@.str.4 = [5 x i8] c"FILE\00"
define i32 @bibl_notexify(i8* nocapture %0) {
%2 = tail call i32 @strcasecmp(i8* %0, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i32 %2, 0
br i1 %3, label %17, label %4
4: ; preds = %1
%5 = tail call i32 @strcasecmp(i8* %0, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%6 = icmp eq i32 %5, 0
br i1 %6, label %17, label %7
7: ; preds = %4
%8 = tail call i32 @strcasecmp(i8* %0, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0))
%9 = icmp eq i32 %8, 0
br i1 %9, label %17, label %10
10: ; preds = %7
%11 = tail call i32 @strcasecmp(i8* %0, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.3, i64 0, i64 0))
%12 = icmp eq i32 %11, 0
br i1 %12, label %17, label %13
13: ; preds = %10
%14 = tail call i32 @strcasecmp(i8* %0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0))
%15 = icmp eq i32 %14, 0
%16 = zext i1 %15 to i32
br label %17
17: ; preds = %13, %10, %7, %4, %1
%18 = phi i32 [ 1, %1 ], [ 1, %4 ], [ 1, %7 ], [ 1, %10 ], [ %16, %13 ]
ret i32 %18
}