#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__ strcasecmp(char const *, char *);
int str2token(const char *s) {
  int i = 0;
  struct {
    char *txt;
    int tkn;
  } token[] = {
      {"MENU", 1},        {"FORM", 2},     {"TITLE", 4},    {"LABEL", 7},
      {"OUTPUT", 8},      {"TYPE", 9},     {"WIDTH", 10},   {"MAX_VALUES", 11},
      {"MIN_VALUES", 12}, {"REQUIRE", 13}, {"FLOOR", 14},   {"CEILING", 15},
      {"PATTERN", 16},    {"ECHO", 17},    {"FIND", 18},    {"EDIT", 19},
      {"CONSTANT", 20},   {"VERIFY", 21},  {"LIST", 32},    {"TEXT", 22},
      {"INTEGER", 23},    {"FLOAT", 24},   {"BOOLEAN", 25}, {"TRUE", 28},
      {"FALSE", 29},      {"ON", 28},      {"OFF", 29},     {"YES", 28},
      {"NO", 29},         {"NULL", 35},    {"NONE", 35},    {"VALUE", 33},
      {"FIELD", 30},      {"ITEM", 31},    {NULL, 0}};
  for (i = 0; NULL != token[i].txt; i++) {
    if (0 == strcasecmp(s, token[i].txt)) {
      return (token[i].tkn);
    }
  }
  return (0);
}


x86 assembly (clang, -O0):
<str2token>:
push   %rbp
mov    %rsp,%rbp
sub    $0x250,%rsp
mov    %rdi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
lea    -0x250(%rbp),%rdi
lea    0x2aac(%rip),%rsi
mov    $0x230,%edx
call   1040 <memcpy@plt>
movl   $0x0,-0x14(%rbp)
movslq -0x14(%rbp),%rax
lea    -0x250(%rbp),%rcx
shl    $0x4,%rax
add    %rax,%rcx
xor    %eax,%eax
cmp    (%rcx),%rax
je     11ce <str2token+0xae>
mov    -0x10(%rbp),%rdi
movslq -0x14(%rbp),%rcx
lea    -0x250(%rbp),%rax
shl    $0x4,%rcx
add    %rcx,%rax
mov    (%rax),%rsi
call   1030 <strcasecmp@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    %rcx,%rax
jne    11bb <str2token+0x9b>
movslq -0x14(%rbp),%rcx
lea    -0x250(%rbp),%rax
shl    $0x4,%rcx
add    %rcx,%rax
mov    0x8(%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    11d5 <str2token+0xb5>
jmp    11c0 <str2token+0xa0>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1155 <str2token+0x35>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x250,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<str2token>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r14
mov    $0x8,%ebx
lea    0x2acc(%rip),%r15
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    -0x8(%rbx,%r15,1),%rsi
mov    %r14,%rdi
call   1030 <strcasecmp@plt>
test   %rax,%rax
je     1153 <str2token+0x43>
add    $0x10,%rbx
cmp    $0x228,%rbx
jne    1130 <str2token+0x20>
xor    %eax,%eax
jmp    1157 <str2token+0x47>
mov    (%rbx,%r15,1),%eax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
%struct.anon = type { i8*, i32 }
@.str = [5 x i8] c"MENU\00"
@.str.1 = [5 x i8] c"FORM\00"
@.str.2 = [6 x i8] c"TITLE\00"
@.str.3 = [6 x i8] c"LABEL\00"
@.str.4 = [7 x i8] c"OUTPUT\00"
@.str.5 = [5 x i8] c"TYPE\00"
@.str.6 = [6 x i8] c"WIDTH\00"
@.str.7 = [11 x i8] c"MAX_VALUES\00"
@.str.8 = [11 x i8] c"MIN_VALUES\00"
@.str.9 = [8 x i8] c"REQUIRE\00"
@.str.10 = [6 x i8] c"FLOOR\00"
@.str.11 = [8 x i8] c"CEILING\00"
@.str.12 = [8 x i8] c"PATTERN\00"
@.str.13 = [5 x i8] c"ECHO\00"
@.str.14 = [5 x i8] c"FIND\00"
@.str.15 = [5 x i8] c"EDIT\00"
@.str.16 = [9 x i8] c"CONSTANT\00"
@.str.17 = [7 x i8] c"VERIFY\00"
@.str.18 = [5 x i8] c"LIST\00"
@.str.19 = [5 x i8] c"TEXT\00"
@.str.20 = [8 x i8] c"INTEGER\00"
@.str.21 = [6 x i8] c"FLOAT\00"
@.str.22 = [8 x i8] c"BOOLEAN\00"
@.str.23 = [5 x i8] c"TRUE\00"
@.str.24 = [6 x i8] c"FALSE\00"
@.str.25 = [3 x i8] c"ON\00"
@.str.26 = [4 x i8] c"OFF\00"
@.str.27 = [4 x i8] c"YES\00"
@.str.28 = [3 x i8] c"NO\00"
@.str.29 = [5 x i8] c"NULL\00"
@.str.30 = [5 x i8] c"NONE\00"
@.str.31 = [6 x i8] c"VALUE\00"
@.str.32 = [6 x i8] c"FIELD\00"
@.str.33 = [5 x i8] c"ITEM\00"
@__const.str2token.token = [35 x %struct.anon] [%struct.anon { i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i32 0, i32 0), i32 1 }, %struct.anon { i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i32 0, i32 0), i32 2 }, %struct.anon { i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i32 0, i32 0), i32 4 }, %struct.anon { i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i32 0, i32 0), i32 7 }, %struct.anon { i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i32 0, i32 0), i32 8 }, %struct.anon { i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.5, i32 0, i32 0), i32 9 }, %struct.anon { i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.6, i32 0, i32 0), i32 10 }, %struct.anon { i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.7, i32 0, i32 0), i32 11 }, %struct.anon { i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.8, i32 0, i32 0), i32 12 }, %struct.anon { i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.9, i32 0, i32 0), i32 13 }, %struct.anon { i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.10, i32 0, i32 0), i32 14 }, %struct.anon { i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.11, i32 0, i32 0), i32 15 }, %struct.anon { i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.12, i32 0, i32 0), i32 16 }, %struct.anon { i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.13, i32 0, i32 0), i32 17 }, %struct.anon { i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.14, i32 0, i32 0), i32 18 }, %struct.anon { i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.15, i32 0, i32 0), i32 19 }, %struct.anon { i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.16, i32 0, i32 0), i32 20 }, %struct.anon { i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.17, i32 0, i32 0), i32 21 }, %struct.anon { i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.18, i32 0, i32 0), i32 32 }, %struct.anon { i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.19, i32 0, i32 0), i32 22 }, %struct.anon { i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.20, i32 0, i32 0), i32 23 }, %struct.anon { i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.21, i32 0, i32 0), i32 24 }, %struct.anon { i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.22, i32 0, i32 0), i32 25 }, %struct.anon { i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.23, i32 0, i32 0), i32 28 }, %struct.anon { i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.24, i32 0, i32 0), i32 29 }, %struct.anon { i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.25, i32 0, i32 0), i32 28 }, %struct.anon { i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.26, i32 0, i32 0), i32 29 }, %struct.anon { i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.27, i32 0, i32 0), i32 28 }, %struct.anon { i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.28, i32 0, i32 0), i32 29 }, %struct.anon { i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.29, i32 0, i32 0), i32 35 }, %struct.anon { i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.30, i32 0, i32 0), i32 35 }, %struct.anon { i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.31, i32 0, i32 0), i32 33 }, %struct.anon { i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.32, i32 0, i32 0), i32 30 }, %struct.anon { i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.33, i32 0, i32 0), i32 31 }, %struct.anon zeroinitializer]
define i32 @str2token(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i32
%5 = alloca [35 x %struct.anon]
store i8* %0, i8** %3
store i32 0, i32* %4
%6 = bitcast [35 x %struct.anon]* %5 to i8*
store i32 0, i32* %4
br label %7
7: ; preds = %30, %1
%8 = load i32, i32* %4
%9 = sext i32 %8 to i64
%10 = getelementptr inbounds [35 x %struct.anon], [35 x %struct.anon]* %5, i64 0, i64 %9
%11 = getelementptr inbounds %struct.anon, %struct.anon* %10, i32 0, i32 0
%12 = load i8*, i8** %11
%13 = icmp ne i8* null, %12
br i1 %13, label %14, label %33
14: ; preds = %7
%15 = load i8*, i8** %3
%16 = load i32, i32* %4
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds [35 x %struct.anon], [35 x %struct.anon]* %5, i64 0, i64 %17
%19 = getelementptr inbounds %struct.anon, %struct.anon* %18, i32 0, i32 0
%20 = load i8*, i8** %19
%21 = call i64 @strcasecmp(i8* %15, i8* %20)
%22 = icmp eq i64 0, %21
br i1 %22, label %23, label %29
23: ; preds = %14
%24 = load i32, i32* %4
%25 = sext i32 %24 to i64
%26 = getelementptr inbounds [35 x %struct.anon], [35 x %struct.anon]* %5, i64 0, i64 %25
%27 = getelementptr inbounds %struct.anon, %struct.anon* %26, i32 0, i32 1
%28 = load i32, i32* %27
store i32 %28, i32* %2
br label %34
29: ; preds = %14
br label %30
30: ; preds = %29
%31 = load i32, i32* %4
%32 = add nsw i32 %31, 1
store i32 %32, i32* %4
br label %7
33: ; preds = %7
store i32 0, i32* %2
br label %34
34: ; preds = %33, %23
%35 = load i32, i32* %2
ret i32 %35
}

LLVM IR (-O2):
%struct.anon = type { i8*, i32 }
@.str = [5 x i8] c"MENU\00"
@.str.1 = [5 x i8] c"FORM\00"
@.str.2 = [6 x i8] c"TITLE\00"
@.str.3 = [6 x i8] c"LABEL\00"
@.str.4 = [7 x i8] c"OUTPUT\00"
@.str.5 = [5 x i8] c"TYPE\00"
@.str.6 = [6 x i8] c"WIDTH\00"
@.str.7 = [11 x i8] c"MAX_VALUES\00"
@.str.8 = [11 x i8] c"MIN_VALUES\00"
@.str.9 = [8 x i8] c"REQUIRE\00"
@.str.10 = [6 x i8] c"FLOOR\00"
@.str.11 = [8 x i8] c"CEILING\00"
@.str.12 = [8 x i8] c"PATTERN\00"
@.str.13 = [5 x i8] c"ECHO\00"
@.str.14 = [5 x i8] c"FIND\00"
@.str.15 = [5 x i8] c"EDIT\00"
@.str.16 = [9 x i8] c"CONSTANT\00"
@.str.17 = [7 x i8] c"VERIFY\00"
@.str.18 = [5 x i8] c"LIST\00"
@.str.19 = [5 x i8] c"TEXT\00"
@.str.20 = [8 x i8] c"INTEGER\00"
@.str.21 = [6 x i8] c"FLOAT\00"
@.str.22 = [8 x i8] c"BOOLEAN\00"
@.str.23 = [5 x i8] c"TRUE\00"
@.str.24 = [6 x i8] c"FALSE\00"
@.str.25 = [3 x i8] c"ON\00"
@.str.26 = [4 x i8] c"OFF\00"
@.str.27 = [4 x i8] c"YES\00"
@.str.28 = [3 x i8] c"NO\00"
@.str.29 = [5 x i8] c"NULL\00"
@.str.30 = [5 x i8] c"NONE\00"
@.str.31 = [6 x i8] c"VALUE\00"
@.str.32 = [6 x i8] c"FIELD\00"
@.str.33 = [5 x i8] c"ITEM\00"
@__const.str2token.token = [35 x %struct.anon] [%struct.anon { i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i32 0, i32 0), i32 1 }, %struct.anon { i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i32 0, i32 0), i32 2 }, %struct.anon { i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i32 0, i32 0), i32 4 }, %struct.anon { i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i32 0, i32 0), i32 7 }, %struct.anon { i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i32 0, i32 0), i32 8 }, %struct.anon { i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.5, i32 0, i32 0), i32 9 }, %struct.anon { i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.6, i32 0, i32 0), i32 10 }, %struct.anon { i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.7, i32 0, i32 0), i32 11 }, %struct.anon { i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.8, i32 0, i32 0), i32 12 }, %struct.anon { i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.9, i32 0, i32 0), i32 13 }, %struct.anon { i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.10, i32 0, i32 0), i32 14 }, %struct.anon { i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.11, i32 0, i32 0), i32 15 }, %struct.anon { i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.12, i32 0, i32 0), i32 16 }, %struct.anon { i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.13, i32 0, i32 0), i32 17 }, %struct.anon { i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.14, i32 0, i32 0), i32 18 }, %struct.anon { i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.15, i32 0, i32 0), i32 19 }, %struct.anon { i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.16, i32 0, i32 0), i32 20 }, %struct.anon { i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.17, i32 0, i32 0), i32 21 }, %struct.anon { i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.18, i32 0, i32 0), i32 32 }, %struct.anon { i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.19, i32 0, i32 0), i32 22 }, %struct.anon { i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.20, i32 0, i32 0), i32 23 }, %struct.anon { i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.21, i32 0, i32 0), i32 24 }, %struct.anon { i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.22, i32 0, i32 0), i32 25 }, %struct.anon { i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.23, i32 0, i32 0), i32 28 }, %struct.anon { i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.24, i32 0, i32 0), i32 29 }, %struct.anon { i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.25, i32 0, i32 0), i32 28 }, %struct.anon { i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.26, i32 0, i32 0), i32 29 }, %struct.anon { i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.27, i32 0, i32 0), i32 28 }, %struct.anon { i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.28, i32 0, i32 0), i32 29 }, %struct.anon { i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.29, i32 0, i32 0), i32 35 }, %struct.anon { i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.30, i32 0, i32 0), i32 35 }, %struct.anon { i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.31, i32 0, i32 0), i32 33 }, %struct.anon { i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.32, i32 0, i32 0), i32 30 }, %struct.anon { i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.33, i32 0, i32 0), i32 31 }, %struct.anon zeroinitializer]
define i32 @str2token(i8* nocapture %0) {
br label %2
2: ; preds = %1, %12
%3 = phi i64 [ 0, %1 ], [ %13, %12 ]
%4 = getelementptr inbounds [35 x %struct.anon], [35 x %struct.anon]* @__const.str2token.token, i64 0, i64 %3, i32 0
%5 = load i8*, i8** %4
%6 = tail call i64 @strcasecmp(i8* %0, i8* %5)
%7 = icmp eq i64 %6, 0
br i1 %7, label %8, label %12
8: ; preds = %2
%9 = and i64 %3, 4294967295
%10 = getelementptr inbounds [35 x %struct.anon], [35 x %struct.anon]* @__const.str2token.token, i64 0, i64 %9, i32 1
%11 = load i32, i32* %10
br label %15
12: ; preds = %2
%13 = add nuw nsw i64 %3, 1
%14 = icmp eq i64 %13, 34
br i1 %14, label %15, label %2
15: ; preds = %12, %8
%16 = phi i32 [ %11, %8 ], [ 0, %12 ]
ret i32 %16
}