isbuiltin(s, p) char *s;
int *p;
{
  static struct {
    char *kw;
    int type;
    int token;
  } tab[] = {"atan2", 273, 500, "close",  279, 307, "cos",    273, 501,
             "exp",   273, 502, "gsub",   280, 508, "index",  279, 503,
             "int",   273, 504, "length", 279, 505, "log",    273, 506,
             "match", 279, 509, "sin",    273, 511, "sqrt",   273, 513,
             "rand",  273, 507, "srand",  273, 514, "split",  279, 512,
             "sub",   280, 510, "substr", 279, 515, "system", 279, 347,
             "",      0,   0};
  register int i;
  for (i = 0; tab[i].token; i++)
    if (strcmp(tab[i].kw, s) == 0)
      break;
  *p = tab[i].token;
  return tab[i].type;
}


x86 assembly (clang, -O0):
<isbuiltin>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
movslq -0x14(%rbp),%rcx
lea    0x2efe(%rip),%rax
shl    $0x4,%rcx
add    %rcx,%rax
cmpl   $0x0,0xc(%rax)
je     1182 <isbuiltin+0x72>
movslq -0x14(%rbp),%rcx
lea    0x2ee2(%rip),%rax
shl    $0x4,%rcx
add    %rcx,%rax
mov    (%rax),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%eax
jne    116f <isbuiltin+0x5f>
jmp    1182 <isbuiltin+0x72>
jmp    1174 <isbuiltin+0x64>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1127 <isbuiltin+0x17>
movslq -0x14(%rbp),%rcx
lea    0x2ea3(%rip),%rax
shl    $0x4,%rcx
add    %rcx,%rax
mov    0xc(%rax),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
movslq -0x14(%rbp),%rcx
lea    0x2e88(%rip),%rax
shl    $0x4,%rcx
add    %rcx,%rax
mov    0x8(%rax),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isbuiltin>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
lea    0xedf(%rip),%rdi
mov    %rbx,%rsi
call   1030 <strcmp@plt>
test   %eax,%eax
je     12be <isbuiltin+0x1ae>
lea    0xece(%rip),%rdi
mov    %rbx,%rsi
call   1030 <strcmp@plt>
test   %eax,%eax
je     12c2 <isbuiltin+0x1b2>
lea    0xebd(%rip),%rdi
mov    %rbx,%rsi
call   1030 <strcmp@plt>
test   %eax,%eax
je     12c9 <isbuiltin+0x1b9>
lea    0xeaa(%rip),%rdi
mov    %rbx,%rsi
call   1030 <strcmp@plt>
test   %eax,%eax
je     12d0 <isbuiltin+0x1c0>
lea    0xe97(%rip),%rdi
mov    %rbx,%rsi
call   1030 <strcmp@plt>
test   %eax,%eax
je     12d7 <isbuiltin+0x1c7>
lea    0xe85(%rip),%rdi
mov    %rbx,%rsi
call   1030 <strcmp@plt>
test   %eax,%eax
je     12de <isbuiltin+0x1ce>
lea    0xe74(%rip),%rdi
mov    %rbx,%rsi
call   1030 <strcmp@plt>
test   %eax,%eax
je     12e5 <isbuiltin+0x1d5>
lea    0xe61(%rip),%rdi
mov    %rbx,%rsi
call   1030 <strcmp@plt>
test   %eax,%eax
je     12ec <isbuiltin+0x1dc>
lea    0xe51(%rip),%rdi
mov    %rbx,%rsi
call   1030 <strcmp@plt>
test   %eax,%eax
je     12f3 <isbuiltin+0x1e3>
lea    0xe3e(%rip),%rdi
mov    %rbx,%rsi
call   1030 <strcmp@plt>
test   %eax,%eax
je     12fa <isbuiltin+0x1ea>
lea    0xe2d(%rip),%rdi
mov    %rbx,%rsi
call   1030 <strcmp@plt>
test   %eax,%eax
je     1301 <isbuiltin+0x1f1>
lea    0xe1a(%rip),%rdi
mov    %rbx,%rsi
call   1030 <strcmp@plt>
test   %eax,%eax
je     1308 <isbuiltin+0x1f8>
lea    0xe09(%rip),%rdi
mov    %rbx,%rsi
call   1030 <strcmp@plt>
test   %eax,%eax
je     130f <isbuiltin+0x1ff>
lea    0xdf1(%rip),%rdi
mov    %rbx,%rsi
call   1030 <strcmp@plt>
test   %eax,%eax
je     1316 <isbuiltin+0x206>
lea    0xde0(%rip),%rdi
mov    %rbx,%rsi
call   1030 <strcmp@plt>
test   %eax,%eax
je     131d <isbuiltin+0x20d>
lea    0xd9b(%rip),%rdi
mov    %rbx,%rsi
call   1030 <strcmp@plt>
test   %eax,%eax
je     1324 <isbuiltin+0x214>
lea    0xdb8(%rip),%rdi
mov    %rbx,%rsi
call   1030 <strcmp@plt>
test   %eax,%eax
je     132b <isbuiltin+0x21b>
lea    0xda8(%rip),%rdi
mov    %rbx,%rsi
call   1030 <strcmp@plt>
cmp    $0x1,%eax
mov    $0x12,%ecx
sbb    $0x0,%rcx
jmp    1330 <isbuiltin+0x220>
xor    %ecx,%ecx
jmp    1330 <isbuiltin+0x220>
mov    $0x1,%ecx
jmp    1330 <isbuiltin+0x220>
mov    $0x2,%ecx
jmp    1330 <isbuiltin+0x220>
mov    $0x3,%ecx
jmp    1330 <isbuiltin+0x220>
mov    $0x4,%ecx
jmp    1330 <isbuiltin+0x220>
mov    $0x5,%ecx
jmp    1330 <isbuiltin+0x220>
mov    $0x6,%ecx
jmp    1330 <isbuiltin+0x220>
mov    $0x7,%ecx
jmp    1330 <isbuiltin+0x220>
mov    $0x8,%ecx
jmp    1330 <isbuiltin+0x220>
mov    $0x9,%ecx
jmp    1330 <isbuiltin+0x220>
mov    $0xa,%ecx
jmp    1330 <isbuiltin+0x220>
mov    $0xb,%ecx
jmp    1330 <isbuiltin+0x220>
mov    $0xc,%ecx
jmp    1330 <isbuiltin+0x220>
mov    $0xd,%ecx
jmp    1330 <isbuiltin+0x220>
mov    $0xe,%ecx
jmp    1330 <isbuiltin+0x220>
mov    $0xf,%ecx
jmp    1330 <isbuiltin+0x220>
mov    $0x10,%ecx
shl    $0x4,%rcx
lea    0x29b5(%rip),%rdx
mov    0x8(%rcx,%rdx,1),%eax
mov    0xc(%rcx,%rdx,1),%ecx
mov    %ecx,(%r14)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.anon = type { i8*, i32, i32 }
@isbuiltin.tab = internal global [19 x %struct.anon] [%struct.anon { i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i32 0, i32 0), i32 273, i32 500 }, %struct.anon { i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i32 0, i32 0), i32 279, i32 307 }, %struct.anon { i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i32 0, i32 0), i32 273, i32 501 }, %struct.anon { i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i32 0, i32 0), i32 273, i32 502 }, %struct.anon { i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i32 0, i32 0), i32 280, i32 508 }, %struct.anon { i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.5, i32 0, i32 0), i32 279, i32 503 }, %struct.anon { i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.6, i32 0, i32 0), i32 273, i32 504 }, %struct.anon { i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.7, i32 0, i32 0), i32 279, i32 505 }, %struct.anon { i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.8, i32 0, i32 0), i32 273, i32 506 }, %struct.anon { i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.9, i32 0, i32 0), i32 279, i32 509 }, %struct.anon { i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.10, i32 0, i32 0), i32 273, i32 511 }, %struct.anon { i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.11, i32 0, i32 0), i32 273, i32 513 }, %struct.anon { i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.12, i32 0, i32 0), i32 273, i32 507 }, %struct.anon { i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.13, i32 0, i32 0), i32 273, i32 514 }, %struct.anon { i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.14, i32 0, i32 0), i32 279, i32 512 }, %struct.anon { i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.15, i32 0, i32 0), i32 280, i32 510 }, %struct.anon { i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.16, i32 0, i32 0), i32 279, i32 515 }, %struct.anon { i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.17, i32 0, i32 0), i32 279, i32 347 }, %struct.anon { i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.18, i32 0, i32 0), i32 0, i32 0 }]
@.str = [6 x i8] c"atan2\00"
@.str.1 = [6 x i8] c"close\00"
@.str.2 = [4 x i8] c"cos\00"
@.str.3 = [4 x i8] c"exp\00"
@.str.4 = [5 x i8] c"gsub\00"
@.str.5 = [6 x i8] c"index\00"
@.str.6 = [4 x i8] c"int\00"
@.str.7 = [7 x i8] c"length\00"
@.str.8 = [4 x i8] c"log\00"
@.str.9 = [6 x i8] c"match\00"
@.str.10 = [4 x i8] c"sin\00"
@.str.11 = [5 x i8] c"sqrt\00"
@.str.12 = [5 x i8] c"rand\00"
@.str.13 = [6 x i8] c"srand\00"
@.str.14 = [6 x i8] c"split\00"
@.str.15 = [4 x i8] c"sub\00"
@.str.16 = [7 x i8] c"substr\00"
@.str.17 = [7 x i8] c"system\00"
@.str.18 = [1 x i8] zeroinitializer
define i32 @isbuiltin(i8* %0, i32* %1) {
%3 = alloca i8*
%4 = alloca i32*
%5 = alloca i32
store i8* %0, i8** %3
store i32* %1, i32** %4
store i32 0, i32* %5
br label %6
6: ; preds = %24, %2
%7 = load i32, i32* %5
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds [19 x %struct.anon], [19 x %struct.anon]* @isbuiltin.tab, i64 0, i64 %8
%10 = getelementptr inbounds %struct.anon, %struct.anon* %9, i32 0, i32 2
%11 = load i32, i32* %10
%12 = icmp ne i32 %11, 0
br i1 %12, label %13, label %27
13: ; preds = %6
%14 = load i32, i32* %5
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds [19 x %struct.anon], [19 x %struct.anon]* @isbuiltin.tab, i64 0, i64 %15
%17 = getelementptr inbounds %struct.anon, %struct.anon* %16, i32 0, i32 0
%18 = load i8*, i8** %17
%19 = load i8*, i8** %3
%20 = call i32 @strcmp(i8* %18, i8* %19)
%21 = icmp eq i32 %20, 0
br i1 %21, label %22, label %23
22: ; preds = %13
br label %27
23: ; preds = %13
br label %24
24: ; preds = %23
%25 = load i32, i32* %5
%26 = add nsw i32 %25, 1
store i32 %26, i32* %5
br label %6
27: ; preds = %22, %6
%28 = load i32, i32* %5
%29 = sext i32 %28 to i64
%30 = getelementptr inbounds [19 x %struct.anon], [19 x %struct.anon]* @isbuiltin.tab, i64 0, i64 %29
%31 = getelementptr inbounds %struct.anon, %struct.anon* %30, i32 0, i32 2
%32 = load i32, i32* %31
%33 = load i32*, i32** %4
store i32 %32, i32* %33
%34 = load i32, i32* %5
%35 = sext i32 %34 to i64
%36 = getelementptr inbounds [19 x %struct.anon], [19 x %struct.anon]* @isbuiltin.tab, i64 0, i64 %35
%37 = getelementptr inbounds %struct.anon, %struct.anon* %36, i32 0, i32 1
%38 = load i32, i32* %37
ret i32 %38
}

LLVM IR (-O2):
%struct.anon = type { i8*, i32, i32 }
@isbuiltin.tab = internal unnamed_addr constant [19 x %struct.anon] [%struct.anon { i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i32 0, i32 0), i32 273, i32 500 }, %struct.anon { i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i32 0, i32 0), i32 279, i32 307 }, %struct.anon { i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i32 0, i32 0), i32 273, i32 501 }, %struct.anon { i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i32 0, i32 0), i32 273, i32 502 }, %struct.anon { i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i32 0, i32 0), i32 280, i32 508 }, %struct.anon { i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.5, i32 0, i32 0), i32 279, i32 503 }, %struct.anon { i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.6, i32 0, i32 0), i32 273, i32 504 }, %struct.anon { i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.7, i32 0, i32 0), i32 279, i32 505 }, %struct.anon { i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.8, i32 0, i32 0), i32 273, i32 506 }, %struct.anon { i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.9, i32 0, i32 0), i32 279, i32 509 }, %struct.anon { i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.10, i32 0, i32 0), i32 273, i32 511 }, %struct.anon { i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.11, i32 0, i32 0), i32 273, i32 513 }, %struct.anon { i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.12, i32 0, i32 0), i32 273, i32 507 }, %struct.anon { i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.13, i32 0, i32 0), i32 273, i32 514 }, %struct.anon { i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.14, i32 0, i32 0), i32 279, i32 512 }, %struct.anon { i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.15, i32 0, i32 0), i32 280, i32 510 }, %struct.anon { i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.16, i32 0, i32 0), i32 279, i32 515 }, %struct.anon { i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.17, i32 0, i32 0), i32 279, i32 347 }, %struct.anon { i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.18, i32 0, i32 0), i32 0, i32 0 }]
@.str = [6 x i8] c"atan2\00"
@.str.1 = [6 x i8] c"close\00"
@.str.2 = [4 x i8] c"cos\00"
@.str.3 = [4 x i8] c"exp\00"
@.str.4 = [5 x i8] c"gsub\00"
@.str.5 = [6 x i8] c"index\00"
@.str.6 = [4 x i8] c"int\00"
@.str.7 = [7 x i8] c"length\00"
@.str.8 = [4 x i8] c"log\00"
@.str.9 = [6 x i8] c"match\00"
@.str.10 = [4 x i8] c"sin\00"
@.str.11 = [5 x i8] c"sqrt\00"
@.str.12 = [5 x i8] c"rand\00"
@.str.13 = [6 x i8] c"srand\00"
@.str.14 = [6 x i8] c"split\00"
@.str.15 = [4 x i8] c"sub\00"
@.str.16 = [7 x i8] c"substr\00"
@.str.17 = [7 x i8] c"system\00"
@.str.18 = [1 x i8] zeroinitializer
define i32 @isbuiltin(i8* nocapture %0, i32* nocapture writeonly %1) {
%3 = tail call i32 @strcmp(i8* dereferenceable(6) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* dereferenceable(1) %0)
%4 = icmp eq i32 %3, 0
br i1 %4, label %57, label %5
5: ; preds = %2
%6 = tail call i32 @strcmp(i8* dereferenceable(6) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8* dereferenceable(1) %0)
%7 = icmp eq i32 %6, 0
br i1 %7, label %57, label %8
8: ; preds = %5
%9 = tail call i32 @strcmp(i8* dereferenceable(4) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i8* dereferenceable(1) %0)
%10 = icmp eq i32 %9, 0
br i1 %10, label %57, label %11
11: ; preds = %8
%12 = tail call i32 @strcmp(i8* dereferenceable(4) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i8* dereferenceable(1) %0)
%13 = icmp eq i32 %12, 0
br i1 %13, label %57, label %14
14: ; preds = %11
%15 = tail call i32 @strcmp(i8* dereferenceable(5) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0), i8* dereferenceable(1) %0)
%16 = icmp eq i32 %15, 0
br i1 %16, label %57, label %17
17: ; preds = %14
%18 = tail call i32 @strcmp(i8* dereferenceable(6) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.5, i64 0, i64 0), i8* dereferenceable(1) %0)
%19 = icmp eq i32 %18, 0
br i1 %19, label %57, label %20
20: ; preds = %17
%21 = tail call i32 @strcmp(i8* dereferenceable(4) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.6, i64 0, i64 0), i8* dereferenceable(1) %0)
%22 = icmp eq i32 %21, 0
br i1 %22, label %57, label %23
23: ; preds = %20
%24 = tail call i32 @strcmp(i8* dereferenceable(7) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.7, i64 0, i64 0), i8* dereferenceable(1) %0)
%25 = icmp eq i32 %24, 0
br i1 %25, label %57, label %26
26: ; preds = %23
%27 = tail call i32 @strcmp(i8* dereferenceable(4) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.8, i64 0, i64 0), i8* dereferenceable(1) %0)
%28 = icmp eq i32 %27, 0
br i1 %28, label %57, label %29
29: ; preds = %26
%30 = tail call i32 @strcmp(i8* dereferenceable(6) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.9, i64 0, i64 0), i8* dereferenceable(1) %0)
%31 = icmp eq i32 %30, 0
br i1 %31, label %57, label %32
32: ; preds = %29
%33 = tail call i32 @strcmp(i8* dereferenceable(4) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.10, i64 0, i64 0), i8* dereferenceable(1) %0)
%34 = icmp eq i32 %33, 0
br i1 %34, label %57, label %35
35: ; preds = %32
%36 = tail call i32 @strcmp(i8* dereferenceable(5) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.11, i64 0, i64 0), i8* dereferenceable(1) %0)
%37 = icmp eq i32 %36, 0
br i1 %37, label %57, label %38
38: ; preds = %35
%39 = tail call i32 @strcmp(i8* dereferenceable(5) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.12, i64 0, i64 0), i8* dereferenceable(1) %0)
%40 = icmp eq i32 %39, 0
br i1 %40, label %57, label %41
41: ; preds = %38
%42 = tail call i32 @strcmp(i8* dereferenceable(6) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.13, i64 0, i64 0), i8* dereferenceable(1) %0)
%43 = icmp eq i32 %42, 0
br i1 %43, label %57, label %44
44: ; preds = %41
%45 = tail call i32 @strcmp(i8* dereferenceable(6) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.14, i64 0, i64 0), i8* dereferenceable(1) %0)
%46 = icmp eq i32 %45, 0
br i1 %46, label %57, label %47
47: ; preds = %44
%48 = tail call i32 @strcmp(i8* dereferenceable(4) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.15, i64 0, i64 0), i8* dereferenceable(1) %0)
%49 = icmp eq i32 %48, 0
br i1 %49, label %57, label %50
50: ; preds = %47
%51 = tail call i32 @strcmp(i8* dereferenceable(7) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.16, i64 0, i64 0), i8* dereferenceable(1) %0)
%52 = icmp eq i32 %51, 0
br i1 %52, label %57, label %53
53: ; preds = %50
%54 = tail call i32 @strcmp(i8* dereferenceable(7) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.17, i64 0, i64 0), i8* dereferenceable(1) %0)
%55 = icmp eq i32 %54, 0
%56 = select i1 %55, i64 17, i64 18
br label %57
57: ; preds = %53, %50, %47, %44, %41, %38, %35, %32, %29, %26, %23, %20, %17, %14, %11, %8, %5, %2
%58 = phi i64 [ 0, %2 ], [ 1, %5 ], [ 2, %8 ], [ 3, %11 ], [ 4, %14 ], [ 5, %17 ], [ 6, %20 ], [ 7, %23 ], [ 8, %26 ], [ 9, %29 ], [ 10, %32 ], [ 11, %35 ], [ 12, %38 ], [ 13, %41 ], [ 14, %44 ], [ 15, %47 ], [ 16, %50 ], [ %56, %53 ]
%59 = getelementptr inbounds [19 x %struct.anon], [19 x %struct.anon]* @isbuiltin.tab, i64 0, i64 %58, i32 2
%60 = load i32, i32* %59
store i32 %60, i32* %1
%61 = getelementptr inbounds [19 x %struct.anon], [19 x %struct.anon]* @isbuiltin.tab, i64 0, i64 %58, i32 1
%62 = load i32, i32* %61
ret i32 %62
}