iskeywd(s) char *s;
{
  static struct {
    char *kw;
    int token;
  } tab[] = {"BEGIN",  303, "END",    313, "break",    306, "continue", 308,
             "delete", 263, "do",     264, "else",     312, "exit",     316,
             "for",    267, "func",   317, "function", 317, "getline",  269,
             "if",     270, "in",     271, "next",     330, "print",    277,
             "printf", 337, "return", 339, "sprint",   342, "sprintf",  343,
             "while",  282, "",       0,   0};
  register int i;
  for (i = 0; tab[i].token; i++)
    if (strcmp(tab[i].kw, s) == 0)
      break;
  return tab[i].token;
}


x86 assembly (clang, -O0):
<iskeywd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movslq -0xc(%rbp),%rcx
lea    0x2f02(%rip),%rax
shl    $0x4,%rcx
add    %rcx,%rax
cmpl   $0x0,0x8(%rax)
je     117e <iskeywd+0x6e>
movslq -0xc(%rbp),%rcx
lea    0x2ee6(%rip),%rax
shl    $0x4,%rcx
add    %rcx,%rax
mov    (%rax),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%eax
jne    116b <iskeywd+0x5b>
jmp    117e <iskeywd+0x6e>
jmp    1170 <iskeywd+0x60>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1123 <iskeywd+0x13>
movslq -0xc(%rbp),%rcx
lea    0x2ea7(%rip),%rax
shl    $0x4,%rcx
add    %rcx,%rax
mov    0x8(%rax),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<iskeywd>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r14
lea    0x2b91(%rip),%rbx
xor    %r15d,%r15d
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    (%rbx),%rdi
mov    %r14,%rsi
call   1030 <strcmp@plt>
test   %eax,%eax
je     1153 <iskeywd+0x43>
add    $0x1,%r15
add    $0x10,%rbx
cmp    $0x15,%r15
jne    1130 <iskeywd+0x20>
mov    $0x15,%r15d
mov    %r15d,%eax
shl    $0x4,%rax
lea    0x2b4f(%rip),%rcx
mov    0x8(%rax,%rcx,1),%eax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
%struct.anon = type { i8*, i32 }
@iskeywd.tab = internal global [23 x %struct.anon] [%struct.anon { i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i32 0, i32 0), i32 303 }, %struct.anon { i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i32 0, i32 0), i32 313 }, %struct.anon { i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i32 0, i32 0), i32 306 }, %struct.anon { i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i32 0, i32 0), i32 308 }, %struct.anon { i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i32 0, i32 0), i32 263 }, %struct.anon { i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i32 0, i32 0), i32 264 }, %struct.anon { i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.6, i32 0, i32 0), i32 312 }, %struct.anon { i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.7, i32 0, i32 0), i32 316 }, %struct.anon { i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.8, i32 0, i32 0), i32 267 }, %struct.anon { i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.9, i32 0, i32 0), i32 317 }, %struct.anon { i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.10, i32 0, i32 0), i32 317 }, %struct.anon { i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.11, i32 0, i32 0), i32 269 }, %struct.anon { i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.12, i32 0, i32 0), i32 270 }, %struct.anon { i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.13, i32 0, i32 0), i32 271 }, %struct.anon { i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.14, i32 0, i32 0), i32 330 }, %struct.anon { i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.15, i32 0, i32 0), i32 277 }, %struct.anon { i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.16, i32 0, i32 0), i32 337 }, %struct.anon { i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.17, i32 0, i32 0), i32 339 }, %struct.anon { i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.18, i32 0, i32 0), i32 342 }, %struct.anon { i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.19, i32 0, i32 0), i32 343 }, %struct.anon { i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.20, i32 0, i32 0), i32 282 }, %struct.anon { i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.21, i32 0, i32 0), i32 0 }, %struct.anon zeroinitializer]
@.str = [6 x i8] c"BEGIN\00"
@.str.1 = [4 x i8] c"END\00"
@.str.2 = [6 x i8] c"break\00"
@.str.3 = [9 x i8] c"continue\00"
@.str.4 = [7 x i8] c"delete\00"
@.str.5 = [3 x i8] c"do\00"
@.str.6 = [5 x i8] c"else\00"
@.str.7 = [5 x i8] c"exit\00"
@.str.8 = [4 x i8] c"for\00"
@.str.9 = [5 x i8] c"func\00"
@.str.10 = [9 x i8] c"function\00"
@.str.11 = [8 x i8] c"getline\00"
@.str.12 = [3 x i8] c"if\00"
@.str.13 = [3 x i8] c"in\00"
@.str.14 = [5 x i8] c"next\00"
@.str.15 = [6 x i8] c"print\00"
@.str.16 = [7 x i8] c"printf\00"
@.str.17 = [7 x i8] c"return\00"
@.str.18 = [7 x i8] c"sprint\00"
@.str.19 = [8 x i8] c"sprintf\00"
@.str.20 = [6 x i8] c"while\00"
@.str.21 = [1 x i8] zeroinitializer
define i32 @iskeywd(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
store i32 0, i32* %3
br label %4
4: ; preds = %22, %1
%5 = load i32, i32* %3
%6 = sext i32 %5 to i64
%7 = getelementptr inbounds [23 x %struct.anon], [23 x %struct.anon]* @iskeywd.tab, i64 0, i64 %6
%8 = getelementptr inbounds %struct.anon, %struct.anon* %7, i32 0, i32 1
%9 = load i32, i32* %8
%10 = icmp ne i32 %9, 0
br i1 %10, label %11, label %25
11: ; preds = %4
%12 = load i32, i32* %3
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds [23 x %struct.anon], [23 x %struct.anon]* @iskeywd.tab, i64 0, i64 %13
%15 = getelementptr inbounds %struct.anon, %struct.anon* %14, i32 0, i32 0
%16 = load i8*, i8** %15
%17 = load i8*, i8** %2
%18 = call i32 @strcmp(i8* %16, i8* %17)
%19 = icmp eq i32 %18, 0
br i1 %19, label %20, label %21
20: ; preds = %11
br label %25
21: ; preds = %11
br label %22
22: ; preds = %21
%23 = load i32, i32* %3
%24 = add nsw i32 %23, 1
store i32 %24, i32* %3
br label %4
25: ; preds = %20, %4
%26 = load i32, i32* %3
%27 = sext i32 %26 to i64
%28 = getelementptr inbounds [23 x %struct.anon], [23 x %struct.anon]* @iskeywd.tab, i64 0, i64 %27
%29 = getelementptr inbounds %struct.anon, %struct.anon* %28, i32 0, i32 1
%30 = load i32, i32* %29
ret i32 %30
}

LLVM IR (-O2):
%struct.anon = type { i8*, i32 }
@iskeywd.tab = internal unnamed_addr constant [23 x %struct.anon] [%struct.anon { i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i32 0, i32 0), i32 303 }, %struct.anon { i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i32 0, i32 0), i32 313 }, %struct.anon { i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i32 0, i32 0), i32 306 }, %struct.anon { i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i32 0, i32 0), i32 308 }, %struct.anon { i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i32 0, i32 0), i32 263 }, %struct.anon { i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i32 0, i32 0), i32 264 }, %struct.anon { i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.6, i32 0, i32 0), i32 312 }, %struct.anon { i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.7, i32 0, i32 0), i32 316 }, %struct.anon { i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.8, i32 0, i32 0), i32 267 }, %struct.anon { i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.9, i32 0, i32 0), i32 317 }, %struct.anon { i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.10, i32 0, i32 0), i32 317 }, %struct.anon { i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.11, i32 0, i32 0), i32 269 }, %struct.anon { i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.12, i32 0, i32 0), i32 270 }, %struct.anon { i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.13, i32 0, i32 0), i32 271 }, %struct.anon { i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.14, i32 0, i32 0), i32 330 }, %struct.anon { i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.15, i32 0, i32 0), i32 277 }, %struct.anon { i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.16, i32 0, i32 0), i32 337 }, %struct.anon { i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.17, i32 0, i32 0), i32 339 }, %struct.anon { i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.18, i32 0, i32 0), i32 342 }, %struct.anon { i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.19, i32 0, i32 0), i32 343 }, %struct.anon { i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.20, i32 0, i32 0), i32 282 }, %struct.anon { i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.21, i32 0, i32 0), i32 0 }, %struct.anon zeroinitializer]
@.str = [6 x i8] c"BEGIN\00"
@.str.1 = [4 x i8] c"END\00"
@.str.2 = [6 x i8] c"break\00"
@.str.3 = [9 x i8] c"continue\00"
@.str.4 = [7 x i8] c"delete\00"
@.str.5 = [3 x i8] c"do\00"
@.str.6 = [5 x i8] c"else\00"
@.str.7 = [5 x i8] c"exit\00"
@.str.8 = [4 x i8] c"for\00"
@.str.9 = [5 x i8] c"func\00"
@.str.10 = [9 x i8] c"function\00"
@.str.11 = [8 x i8] c"getline\00"
@.str.12 = [3 x i8] c"if\00"
@.str.13 = [3 x i8] c"in\00"
@.str.14 = [5 x i8] c"next\00"
@.str.15 = [6 x i8] c"print\00"
@.str.16 = [7 x i8] c"printf\00"
@.str.17 = [7 x i8] c"return\00"
@.str.18 = [7 x i8] c"sprint\00"
@.str.19 = [8 x i8] c"sprintf\00"
@.str.20 = [6 x i8] c"while\00"
@.str.21 = [1 x i8] zeroinitializer
define i32 @iskeywd(i8* nocapture %0) {
br label %2
2: ; preds = %1, %8
%3 = phi i64 [ 0, %1 ], [ %9, %8 ]
%4 = getelementptr inbounds [23 x %struct.anon], [23 x %struct.anon]* @iskeywd.tab, i64 0, i64 %3, i32 0
%5 = load i8*, i8** %4
%6 = tail call i32 @strcmp(i8* dereferenceable(1) %5, i8* dereferenceable(1) %0)
%7 = icmp eq i32 %6, 0
br i1 %7, label %11, label %8
8: ; preds = %2
%9 = add nuw nsw i64 %3, 1
%10 = icmp eq i64 %9, 21
br i1 %10, label %11, label %2
11: ; preds = %2, %8
%12 = phi i64 [ %3, %2 ], [ 21, %8 ]
%13 = and i64 %12, 4294967295
%14 = getelementptr inbounds [23 x %struct.anon], [23 x %struct.anon]* @iskeywd.tab, i64 0, i64 %13, i32 1
%15 = load i32, i32* %14
ret i32 %15
}