#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*/ keyword;

/* Variables and functions */
int lookup_keyword(char *, char const **, int);
int /*<<< orphan*/ printf(char *, int);
int main() {
  const char *keyword[] = {"do",     "for",   "if",   "register", "return",
                           "switch", "while", "case", "static"};
  printf("%d\n", lookup_keyword("return", keyword,
                                (sizeof(keyword) / sizeof(*keyword))));
  printf("%d\n",
         lookup_keyword("main", keyword, (sizeof(keyword) / sizeof(*keyword))));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
lea    -0x50(%rbp),%rdi
lea    0x2c8d(%rip),%rsi
mov    $0x48,%edx
call   1040 <memcpy@plt>
lea    -0x50(%rbp),%rsi
lea    0xebb(%rip),%rdi
mov    $0x9,%edx
call   1050 <lookup_keyword@plt>
mov    %eax,%esi
lea    0xec8(%rip),%rdi
call   1030 <printf@plt>
lea    -0x50(%rbp),%rsi
lea    0xebc(%rip),%rdi
mov    $0x9,%edx
call   1050 <lookup_keyword@plt>
mov    %eax,%esi
lea    0xea5(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x48,%rsp
mov    0x2ce2(%rip),%rax
mov    %rax,0x40(%rsp)
movaps 0x2cc6(%rip),%xmm0
movaps %xmm0,0x30(%rsp)
movaps 0x2caa(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movaps 0x2c8e(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0x2c72(%rip),%xmm0
movaps %xmm0,(%rsp)
lea    0xeaa(%rip),%rdi
mov    %rsp,%r14
mov    %r14,%rsi
mov    $0x9,%edx
call   1040 <lookup_keyword@plt>
lea    0xeb3(%rip),%rbx
mov    %rbx,%rdi
mov    %eax,%esi
call   1030 <printf@plt>
lea    0xea6(%rip),%rdi
mov    %r14,%rsi
mov    $0x9,%edx
call   1040 <lookup_keyword@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x48,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [3 x i8] c"do\00"
@.str.1 = [4 x i8] c"for\00"
@.str.2 = [3 x i8] c"if\00"
@.str.3 = [9 x i8] c"register\00"
@.str.4 = [7 x i8] c"return\00"
@.str.5 = [7 x i8] c"switch\00"
@.str.6 = [6 x i8] c"while\00"
@.str.7 = [5 x i8] c"case\00"
@.str.8 = [7 x i8] c"static\00"
@__const.main.keyword = [9 x i8*] [i8* getelementptr inbounds ([3 x i8], [3 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 ([3 x i8], [3 x i8]* @.str.2, i32 0, i32 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i32 0, i32 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i32 0, i32 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.5, i32 0, i32 0), i8* getelementptr inbounds ([6 x i8], [6 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 ([7 x i8], [7 x i8]* @.str.8, i32 0, i32 0)]
@.str.9 = [4 x i8] c"%d\0A\00"
@.str.10 = [5 x i8] c"main\00"
define i32 @main() {
%1 = alloca [9 x i8*]
%2 = bitcast [9 x i8*]* %1 to i8*
%3 = getelementptr inbounds [9 x i8*], [9 x i8*]* %1, i64 0, i64 0
%4 = call i32 @lookup_keyword(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0), i8** %3, i32 9)
%5 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.9, i64 0, i64 0), i32 %4)
%6 = getelementptr inbounds [9 x i8*], [9 x i8*]* %1, i64 0, i64 0
%7 = call i32 @lookup_keyword(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.10, i64 0, i64 0), i8** %6, i32 9)
%8 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.9, i64 0, i64 0), i32 %7)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"do\00"
@.str.1 = [4 x i8] c"for\00"
@.str.2 = [3 x i8] c"if\00"
@.str.3 = [9 x i8] c"register\00"
@.str.4 = [7 x i8] c"return\00"
@.str.5 = [7 x i8] c"switch\00"
@.str.6 = [6 x i8] c"while\00"
@.str.7 = [5 x i8] c"case\00"
@.str.8 = [7 x i8] c"static\00"
@__const.main.keyword = [9 x i8*] [i8* getelementptr inbounds ([3 x i8], [3 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 ([3 x i8], [3 x i8]* @.str.2, i32 0, i32 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i32 0, i32 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i32 0, i32 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.5, i32 0, i32 0), i8* getelementptr inbounds ([6 x i8], [6 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 ([7 x i8], [7 x i8]* @.str.8, i32 0, i32 0)]
@.str.9 = [4 x i8] c"%d\0A\00"
@.str.10 = [5 x i8] c"main\00"
define i32 @main() {
%1 = alloca [9 x i8*]
%2 = bitcast [9 x i8*]* %1 to i8*
%3 = getelementptr inbounds [9 x i8*], [9 x i8*]* %1, i64 0, i64 0
%4 = call i32 @lookup_keyword(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0), i8** %3, i32 9)
%5 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.9, i64 0, i64 0), i32 %4)
%6 = call i32 @lookup_keyword(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.10, i64 0, i64 0), i8** %3, i32 9)
%7 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.9, i64 0, i64 0), i32 %6)
ret i32 0
}