#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 const *);
bool isReservedWord(const char *word) {
  static const char *reservedWords[] = {
      "!",  "{",   "}",  "case", "do",   "done",  "elif",  "else", "esac",
      "fi", "for", "if", "in",   "then", "until", "while", NULL};
  size_t i = 0;
  while (reservedWords[i]) {
    if (strcmp(word, reservedWords[i]) == 0)
      return true;
    i++;
  }
  return false;
}


x86 assembly (clang, -O0):
<isReservedWord>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%rcx
lea    0x2f01(%rip),%rax
cmpq   $0x0,(%rax,%rcx,8)
je     1179 <isReservedWord+0x69>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rcx
lea    0x2ee7(%rip),%rax
mov    (%rax,%rcx,8),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
jne    1168 <isReservedWord+0x58>
movl   $0x1,-0x4(%rbp)
jmp    1180 <isReservedWord+0x70>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1124 <isReservedWord+0x14>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isReservedWord>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
lea    0xee3(%rip),%rsi
call   1030 <strcmp@plt>
mov    $0x1,%ebp
test   %rax,%rax
je     1280 <isReservedWord+0x170>
lea    0xecb(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcmp@plt>
test   %rax,%rax
je     1280 <isReservedWord+0x170>
lea    0xeb5(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcmp@plt>
test   %rax,%rax
je     1280 <isReservedWord+0x170>
lea    0xe9f(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcmp@plt>
test   %rax,%rax
je     1280 <isReservedWord+0x170>
lea    0xe8c(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcmp@plt>
test   %rax,%rax
je     1280 <isReservedWord+0x170>
lea    0xe77(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcmp@plt>
test   %rax,%rax
je     1280 <isReservedWord+0x170>
lea    0xe64(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcmp@plt>
test   %rax,%rax
je     1280 <isReservedWord+0x170>
lea    0xe51(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcmp@plt>
test   %rax,%rax
je     1280 <isReservedWord+0x170>
lea    0xe3e(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcmp@plt>
test   %rax,%rax
je     1280 <isReservedWord+0x170>
lea    0xe2b(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcmp@plt>
test   %rax,%rax
je     1280 <isReservedWord+0x170>
lea    0xe1a(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcmp@plt>
test   %rax,%rax
je     1280 <isReservedWord+0x170>
lea    0xdf6(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcmp@plt>
test   %rax,%rax
je     1280 <isReservedWord+0x170>
lea    0xdf6(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcmp@plt>
test   %rax,%rax
je     1280 <isReservedWord+0x170>
lea    0xde5(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcmp@plt>
test   %rax,%rax
je     1280 <isReservedWord+0x170>
lea    0xdd6(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcmp@plt>
test   %rax,%rax
je     1280 <isReservedWord+0x170>
lea    0xdc8(%rip),%rsi
mov    %rbx,%rdi
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):
@isReservedWord.reservedWords = internal global [17 x i8*] [i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i32 0, i32 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i32 0, i32 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i32 0, i32 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.5, i32 0, i32 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.6, i32 0, i32 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.7, i32 0, i32 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.8, i32 0, i32 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.9, i32 0, i32 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.10, i32 0, i32 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.11, i32 0, i32 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.12, i32 0, i32 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.13, i32 0, i32 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.14, i32 0, i32 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.15, i32 0, i32 0), i8* null]
@.str = [2 x i8] c"!\00"
@.str.1 = [2 x i8] c"{\00"
@.str.2 = [2 x i8] c"}\00"
@.str.3 = [5 x i8] c"case\00"
@.str.4 = [3 x i8] c"do\00"
@.str.5 = [5 x i8] c"done\00"
@.str.6 = [5 x i8] c"elif\00"
@.str.7 = [5 x i8] c"else\00"
@.str.8 = [5 x i8] c"esac\00"
@.str.9 = [3 x i8] c"fi\00"
@.str.10 = [4 x i8] c"for\00"
@.str.11 = [3 x i8] c"if\00"
@.str.12 = [3 x i8] c"in\00"
@.str.13 = [5 x i8] c"then\00"
@.str.14 = [6 x i8] c"until\00"
@.str.15 = [6 x i8] c"while\00"
define i32 @isReservedWord(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 0, i64* %4
br label %5
5: ; preds = %18, %1
%6 = load i64, i64* %4
%7 = getelementptr inbounds [17 x i8*], [17 x i8*]* @isReservedWord.reservedWords, i64 0, i64 %6
%8 = load i8*, i8** %7
%9 = icmp ne i8* %8, null
br i1 %9, label %10, label %21
10: ; preds = %5
%11 = load i8*, i8** %3
%12 = load i64, i64* %4
%13 = getelementptr inbounds [17 x i8*], [17 x i8*]* @isReservedWord.reservedWords, i64 0, i64 %12
%14 = load i8*, i8** %13
%15 = call i64 @strcmp(i8* %11, i8* %14)
%16 = icmp eq i64 %15, 0
br i1 %16, label %17, label %18
17: ; preds = %10
store i32 1, i32* %2
br label %22
18: ; preds = %10
%19 = load i64, i64* %4
%20 = add i64 %19, 1
store i64 %20, i64* %4
br label %5
21: ; preds = %5
store i32 0, i32* %2
br label %22
22: ; preds = %21, %17
%23 = load i32, i32* %2
ret i32 %23
}

LLVM IR (-O2):
@.str = [2 x i8] c"!\00"
@.str.1 = [2 x i8] c"{\00"
@.str.2 = [2 x i8] c"}\00"
@.str.3 = [5 x i8] c"case\00"
@.str.4 = [3 x i8] c"do\00"
@.str.5 = [5 x i8] c"done\00"
@.str.6 = [5 x i8] c"elif\00"
@.str.7 = [5 x i8] c"else\00"
@.str.8 = [5 x i8] c"esac\00"
@.str.9 = [3 x i8] c"fi\00"
@.str.10 = [4 x i8] c"for\00"
@.str.11 = [3 x i8] c"if\00"
@.str.12 = [3 x i8] c"in\00"
@.str.13 = [5 x i8] c"then\00"
@.str.14 = [6 x i8] c"until\00"
@.str.15 = [6 x i8] c"while\00"
define i32 @isReservedWord(i8* %0) {
%2 = tail call i64 @strcmp(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i64 %2, 0
br i1 %3, label %50, label %4
4: ; preds = %1
%5 = tail call i64 @strcmp(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%6 = icmp eq i64 %5, 0
br i1 %6, label %50, label %7
7: ; preds = %4
%8 = tail call i64 @strcmp(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%9 = icmp eq i64 %8, 0
br i1 %9, label %50, label %10
10: ; preds = %7
%11 = tail call i64 @strcmp(i8* %0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0))
%12 = icmp eq i64 %11, 0
br i1 %12, label %50, label %13
13: ; preds = %10
%14 = tail call i64 @strcmp(i8* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0))
%15 = icmp eq i64 %14, 0
br i1 %15, label %50, label %16
16: ; preds = %13
%17 = tail call i64 @strcmp(i8* %0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.5, i64 0, i64 0))
%18 = icmp eq i64 %17, 0
br i1 %18, label %50, label %19
19: ; preds = %16
%20 = tail call i64 @strcmp(i8* %0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.6, i64 0, i64 0))
%21 = icmp eq i64 %20, 0
br i1 %21, label %50, label %22
22: ; preds = %19
%23 = tail call i64 @strcmp(i8* %0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.7, i64 0, i64 0))
%24 = icmp eq i64 %23, 0
br i1 %24, label %50, label %25
25: ; preds = %22
%26 = tail call i64 @strcmp(i8* %0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.8, i64 0, i64 0))
%27 = icmp eq i64 %26, 0
br i1 %27, label %50, label %28
28: ; preds = %25
%29 = tail call i64 @strcmp(i8* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.9, i64 0, i64 0))
%30 = icmp eq i64 %29, 0
br i1 %30, label %50, label %31
31: ; preds = %28
%32 = tail call i64 @strcmp(i8* %0, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.10, i64 0, i64 0))
%33 = icmp eq i64 %32, 0
br i1 %33, label %50, label %34
34: ; preds = %31
%35 = tail call i64 @strcmp(i8* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.11, i64 0, i64 0))
%36 = icmp eq i64 %35, 0
br i1 %36, label %50, label %37
37: ; preds = %34
%38 = tail call i64 @strcmp(i8* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.12, i64 0, i64 0))
%39 = icmp eq i64 %38, 0
br i1 %39, label %50, label %40
40: ; preds = %37
%41 = tail call i64 @strcmp(i8* %0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.13, i64 0, i64 0))
%42 = icmp eq i64 %41, 0
br i1 %42, label %50, label %43
43: ; preds = %40
%44 = tail call i64 @strcmp(i8* %0, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.14, i64 0, i64 0))
%45 = icmp eq i64 %44, 0
br i1 %45, label %50, label %46
46: ; preds = %43
%47 = tail call i64 @strcmp(i8* %0, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.15, i64 0, i64 0))
%48 = icmp eq i64 %47, 0
%49 = zext i1 %48 to i32
br label %50
50: ; preds = %46, %43, %40, %37, %34, %31, %28, %25, %22, %19, %16, %13, %10, %7, %4, %1
%51 = phi i32 [ 1, %1 ], [ 1, %4 ], [ 1, %7 ], [ 1, %10 ], [ 1, %13 ], [ 1, %16 ], [ 1, %19 ], [ 1, %22 ], [ 1, %25 ], [ 1, %28 ], [ 1, %31 ], [ 1, %34 ], [ 1, %37 ], [ 1, %40 ], [ 1, %43 ], [ %49, %46 ]
ret i32 %51
}