#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 *, char *);
int str2reg(char *s) {
  if ((strcasecmp((s), ("a")) == 0))
    return 0x00;
  if ((strcasecmp((s), ("b")) == 0))
    return 0x01;
  if ((strcasecmp((s), ("c")) == 0))
    return 0x02;
  if ((strcasecmp((s), ("x")) == 0))
    return 0x03;
  if ((strcasecmp((s), ("y")) == 0))
    return 0x04;
  if ((strcasecmp((s), ("z")) == 0))
    return 0x05;
  if ((strcasecmp((s), ("i")) == 0))
    return 0x06;
  if ((strcasecmp((s), ("j")) == 0))
    return 0x07;
  if ((strcasecmp((s), ("pop")) == 0) || (strcasecmp((s), ("push")) == 0))
    return 0x18;
  if ((strcasecmp((s), ("peek")) == 0))
    return 0x19;
  if ((strcasecmp((s), ("pick")) == 0))
    return 0x1a;
  if ((strcasecmp((s), ("sp")) == 0))
    return 0x1b;
  if ((strcasecmp((s), ("pc")) == 0))
    return 0x1c;
  if ((strcasecmp((s), ("ex")) == 0))
    return 0x1d;
  return 0;
}


x86 assembly (clang, -O0):
<str2reg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xed9(%rip),%rsi
call   1030 <strcasecmp@plt>
cmp    $0x0,%rax
jne    1142 <str2reg+0x32>
movl   $0x0,-0x4(%rbp)
jmp    1351 <str2reg+0x241>
mov    -0x10(%rbp),%rdi
lea    0xeb5(%rip),%rsi
call   1030 <strcasecmp@plt>
cmp    $0x0,%rax
jne    1168 <str2reg+0x58>
movl   $0x1,-0x4(%rbp)
jmp    1351 <str2reg+0x241>
mov    -0x10(%rbp),%rdi
lea    0xeb0(%rip),%rsi
call   1030 <strcasecmp@plt>
cmp    $0x0,%rax
jne    118e <str2reg+0x7e>
movl   $0x2,-0x4(%rbp)
jmp    1351 <str2reg+0x241>
mov    -0x10(%rbp),%rdi
lea    0xe8d(%rip),%rsi
call   1030 <strcasecmp@plt>
cmp    $0x0,%rax
jne    11b4 <str2reg+0xa4>
movl   $0x3,-0x4(%rbp)
jmp    1351 <str2reg+0x241>
mov    -0x10(%rbp),%rdi
lea    0xe45(%rip),%rsi
call   1030 <strcasecmp@plt>
cmp    $0x0,%rax
jne    11da <str2reg+0xca>
movl   $0x4,-0x4(%rbp)
jmp    1351 <str2reg+0x241>
mov    -0x10(%rbp),%rdi
lea    0xe21(%rip),%rsi
call   1030 <strcasecmp@plt>
cmp    $0x0,%rax
jne    1200 <str2reg+0xf0>
movl   $0x5,-0x4(%rbp)
jmp    1351 <str2reg+0x241>
mov    -0x10(%rbp),%rdi
lea    0xdfd(%rip),%rsi
call   1030 <strcasecmp@plt>
cmp    $0x0,%rax
jne    1226 <str2reg+0x116>
movl   $0x6,-0x4(%rbp)
jmp    1351 <str2reg+0x241>
mov    -0x10(%rbp),%rdi
lea    0xdd9(%rip),%rsi
call   1030 <strcasecmp@plt>
cmp    $0x0,%rax
jne    124c <str2reg+0x13c>
movl   $0x7,-0x4(%rbp)
jmp    1351 <str2reg+0x241>
mov    -0x10(%rbp),%rdi
lea    0xdb5(%rip),%rsi
call   1030 <strcasecmp@plt>
cmp    $0x0,%rax
je     1280 <str2reg+0x170>
mov    -0x10(%rbp),%rdi
lea    0xd9f(%rip),%rsi
call   1030 <strcasecmp@plt>
cmp    $0x0,%rax
jne    128c <str2reg+0x17c>
movl   $0x18,-0x4(%rbp)
jmp    1351 <str2reg+0x241>
mov    -0x10(%rbp),%rdi
lea    0xd7e(%rip),%rsi
call   1030 <strcasecmp@plt>
cmp    $0x0,%rax
jne    12b2 <str2reg+0x1a2>
movl   $0x19,-0x4(%rbp)
jmp    1351 <str2reg+0x241>
mov    -0x10(%rbp),%rdi
lea    0xd5d(%rip),%rsi
call   1030 <strcasecmp@plt>
cmp    $0x0,%rax
jne    12d8 <str2reg+0x1c8>
movl   $0x1a,-0x4(%rbp)
jmp    1351 <str2reg+0x241>
mov    -0x10(%rbp),%rdi
lea    0xd3c(%rip),%rsi
call   1030 <strcasecmp@plt>
cmp    $0x0,%rax
jne    12fe <str2reg+0x1ee>
movl   $0x1b,-0x4(%rbp)
jmp    1351 <str2reg+0x241>
mov    -0x10(%rbp),%rdi
lea    0xd19(%rip),%rsi
call   1030 <strcasecmp@plt>
cmp    $0x0,%rax
jne    1324 <str2reg+0x214>
movl   $0x1c,-0x4(%rbp)
jmp    1351 <str2reg+0x241>
mov    -0x10(%rbp),%rdi
lea    0xcf6(%rip),%rsi
call   1030 <strcasecmp@plt>
cmp    $0x0,%rax
jne    134a <str2reg+0x23a>
movl   $0x1d,-0x4(%rbp)
jmp    1351 <str2reg+0x241>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<str2reg>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
lea    0xee3(%rip),%rsi
call   1030 <strcasecmp@plt>
test   %rax,%rax
je     127e <str2reg+0x16e>
lea    0xed0(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcasecmp@plt>
test   %rax,%rax
je     1282 <str2reg+0x172>
lea    0xed9(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcasecmp@plt>
test   %rax,%rax
je     1289 <str2reg+0x179>
lea    0xec4(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcasecmp@plt>
test   %rax,%rax
je     1290 <str2reg+0x180>
lea    0xe8a(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcasecmp@plt>
test   %rax,%rax
je     1297 <str2reg+0x187>
lea    0xe74(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcasecmp@plt>
test   %rax,%rax
je     129e <str2reg+0x18e>
lea    0xe5e(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcasecmp@plt>
test   %rax,%rax
je     12a5 <str2reg+0x195>
lea    0xe48(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcasecmp@plt>
test   %rax,%rax
je     12ac <str2reg+0x19c>
lea    0xe32(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcasecmp@plt>
mov    $0x18,%ebp
test   %rax,%rax
je     12b1 <str2reg+0x1a1>
lea    0xe19(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcasecmp@plt>
test   %rax,%rax
je     12b1 <str2reg+0x1a1>
lea    0xe06(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcasecmp@plt>
test   %rax,%rax
je     12ba <str2reg+0x1aa>
lea    0xdf3(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcasecmp@plt>
test   %rax,%rax
je     12c1 <str2reg+0x1b1>
lea    0xde0(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcasecmp@plt>
test   %rax,%rax
je     12c8 <str2reg+0x1b8>
lea    0xdcf(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcasecmp@plt>
test   %rax,%rax
je     12cf <str2reg+0x1bf>
lea    0xdbe(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcasecmp@plt>
xor    %ecx,%ecx
test   %rax,%rax
mov    $0x1d,%ebp
cmovne %ecx,%ebp
jmp    12b1 <str2reg+0x1a1>
xor    %ebp,%ebp
jmp    12b1 <str2reg+0x1a1>
mov    $0x1,%ebp
jmp    12b1 <str2reg+0x1a1>
mov    $0x2,%ebp
jmp    12b1 <str2reg+0x1a1>
mov    $0x3,%ebp
jmp    12b1 <str2reg+0x1a1>
mov    $0x4,%ebp
jmp    12b1 <str2reg+0x1a1>
mov    $0x5,%ebp
jmp    12b1 <str2reg+0x1a1>
mov    $0x6,%ebp
jmp    12b1 <str2reg+0x1a1>
mov    $0x7,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret
mov    $0x19,%ebp
jmp    12b1 <str2reg+0x1a1>
mov    $0x1a,%ebp
jmp    12b1 <str2reg+0x1a1>
mov    $0x1b,%ebp
jmp    12b1 <str2reg+0x1a1>
mov    $0x1c,%ebp
jmp    12b1 <str2reg+0x1a1>

LLVM IR (-O0):
@.str = [2 x i8] c"a\00"
@.str.1 = [2 x i8] c"b\00"
@.str.2 = [2 x i8] c"c\00"
@.str.3 = [2 x i8] c"x\00"
@.str.4 = [2 x i8] c"y\00"
@.str.5 = [2 x i8] c"z\00"
@.str.6 = [2 x i8] c"i\00"
@.str.7 = [2 x i8] c"j\00"
@.str.8 = [4 x i8] c"pop\00"
@.str.9 = [5 x i8] c"push\00"
@.str.10 = [5 x i8] c"peek\00"
@.str.11 = [5 x i8] c"pick\00"
@.str.12 = [3 x i8] c"sp\00"
@.str.13 = [3 x i8] c"pc\00"
@.str.14 = [3 x i8] c"ex\00"
define i32 @str2reg(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = call i64 @strcasecmp(i8* %4, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%6 = icmp eq i64 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %1
store i32 0, i32* %2
br label %78
8: ; preds = %1
%9 = load i8*, i8** %3
%10 = call i64 @strcasecmp(i8* %9, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%11 = icmp eq i64 %10, 0
br i1 %11, label %12, label %13
12: ; preds = %8
store i32 1, i32* %2
br label %78
13: ; preds = %8
%14 = load i8*, i8** %3
%15 = call i64 @strcasecmp(i8* %14, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%16 = icmp eq i64 %15, 0
br i1 %16, label %17, label %18
17: ; preds = %13
store i32 2, i32* %2
br label %78
18: ; preds = %13
%19 = load i8*, i8** %3
%20 = call i64 @strcasecmp(i8* %19, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%21 = icmp eq i64 %20, 0
br i1 %21, label %22, label %23
22: ; preds = %18
store i32 3, i32* %2
br label %78
23: ; preds = %18
%24 = load i8*, i8** %3
%25 = call i64 @strcasecmp(i8* %24, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
%26 = icmp eq i64 %25, 0
br i1 %26, label %27, label %28
27: ; preds = %23
store i32 4, i32* %2
br label %78
28: ; preds = %23
%29 = load i8*, i8** %3
%30 = call i64 @strcasecmp(i8* %29, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0))
%31 = icmp eq i64 %30, 0
br i1 %31, label %32, label %33
32: ; preds = %28
store i32 5, i32* %2
br label %78
33: ; preds = %28
%34 = load i8*, i8** %3
%35 = call i64 @strcasecmp(i8* %34, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.6, i64 0, i64 0))
%36 = icmp eq i64 %35, 0
br i1 %36, label %37, label %38
37: ; preds = %33
store i32 6, i32* %2
br label %78
38: ; preds = %33
%39 = load i8*, i8** %3
%40 = call i64 @strcasecmp(i8* %39, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.7, i64 0, i64 0))
%41 = icmp eq i64 %40, 0
br i1 %41, label %42, label %43
42: ; preds = %38
store i32 7, i32* %2
br label %78
43: ; preds = %38
%44 = load i8*, i8** %3
%45 = call i64 @strcasecmp(i8* %44, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.8, i64 0, i64 0))
%46 = icmp eq i64 %45, 0
br i1 %46, label %51, label %47
47: ; preds = %43
%48 = load i8*, i8** %3
%49 = call i64 @strcasecmp(i8* %48, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.9, i64 0, i64 0))
%50 = icmp eq i64 %49, 0
br i1 %50, label %51, label %52
51: ; preds = %47, %43
store i32 24, i32* %2
br label %78
52: ; preds = %47
%53 = load i8*, i8** %3
%54 = call i64 @strcasecmp(i8* %53, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.10, i64 0, i64 0))
%55 = icmp eq i64 %54, 0
br i1 %55, label %56, label %57
56: ; preds = %52
store i32 25, i32* %2
br label %78
57: ; preds = %52
%58 = load i8*, i8** %3
%59 = call i64 @strcasecmp(i8* %58, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.11, i64 0, i64 0))
%60 = icmp eq i64 %59, 0
br i1 %60, label %61, label %62
61: ; preds = %57
store i32 26, i32* %2
br label %78
62: ; preds = %57
%63 = load i8*, i8** %3
%64 = call i64 @strcasecmp(i8* %63, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.12, i64 0, i64 0))
%65 = icmp eq i64 %64, 0
br i1 %65, label %66, label %67
66: ; preds = %62
store i32 27, i32* %2
br label %78
67: ; preds = %62
%68 = load i8*, i8** %3
%69 = call i64 @strcasecmp(i8* %68, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.13, i64 0, i64 0))
%70 = icmp eq i64 %69, 0
br i1 %70, label %71, label %72
71: ; preds = %67
store i32 28, i32* %2
br label %78
72: ; preds = %67
%73 = load i8*, i8** %3
%74 = call i64 @strcasecmp(i8* %73, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.14, i64 0, i64 0))
%75 = icmp eq i64 %74, 0
br i1 %75, label %76, label %77
76: ; preds = %72
store i32 29, i32* %2
br label %78
77: ; preds = %72
store i32 0, i32* %2
br label %78
78: ; preds = %77, %76, %71, %66, %61, %56, %51, %42, %37, %32, %27, %22, %17, %12, %7
%79 = load i32, i32* %2
ret i32 %79
}

LLVM IR (-O2):
@.str = [2 x i8] c"a\00"
@.str.1 = [2 x i8] c"b\00"
@.str.2 = [2 x i8] c"c\00"
@.str.3 = [2 x i8] c"x\00"
@.str.4 = [2 x i8] c"y\00"
@.str.5 = [2 x i8] c"z\00"
@.str.6 = [2 x i8] c"i\00"
@.str.7 = [2 x i8] c"j\00"
@.str.8 = [4 x i8] c"pop\00"
@.str.9 = [5 x i8] c"push\00"
@.str.10 = [5 x i8] c"peek\00"
@.str.11 = [5 x i8] c"pick\00"
@.str.12 = [3 x i8] c"sp\00"
@.str.13 = [3 x i8] c"pc\00"
@.str.14 = [3 x i8] c"ex\00"
define i32 @str2reg(i8* nocapture %0) {
%2 = tail call i64 @strcasecmp(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 %47, label %4
4: ; preds = %1
%5 = tail call i64 @strcasecmp(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 %47, label %7
7: ; preds = %4
%8 = tail call i64 @strcasecmp(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 %47, label %10
10: ; preds = %7
%11 = tail call i64 @strcasecmp(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%12 = icmp eq i64 %11, 0
br i1 %12, label %47, label %13
13: ; preds = %10
%14 = tail call i64 @strcasecmp(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
%15 = icmp eq i64 %14, 0
br i1 %15, label %47, label %16
16: ; preds = %13
%17 = tail call i64 @strcasecmp(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0))
%18 = icmp eq i64 %17, 0
br i1 %18, label %47, label %19
19: ; preds = %16
%20 = tail call i64 @strcasecmp(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.6, i64 0, i64 0))
%21 = icmp eq i64 %20, 0
br i1 %21, label %47, label %22
22: ; preds = %19
%23 = tail call i64 @strcasecmp(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.7, i64 0, i64 0))
%24 = icmp eq i64 %23, 0
br i1 %24, label %47, label %25
25: ; preds = %22
%26 = tail call i64 @strcasecmp(i8* %0, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.8, i64 0, i64 0))
%27 = icmp eq i64 %26, 0
br i1 %27, label %47, label %28
28: ; preds = %25
%29 = tail call i64 @strcasecmp(i8* %0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.9, i64 0, i64 0))
%30 = icmp eq i64 %29, 0
br i1 %30, label %47, label %31
31: ; preds = %28
%32 = tail call i64 @strcasecmp(i8* %0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.10, i64 0, i64 0))
%33 = icmp eq i64 %32, 0
br i1 %33, label %47, label %34
34: ; preds = %31
%35 = tail call i64 @strcasecmp(i8* %0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.11, i64 0, i64 0))
%36 = icmp eq i64 %35, 0
br i1 %36, label %47, label %37
37: ; preds = %34
%38 = tail call i64 @strcasecmp(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 %47, label %40
40: ; preds = %37
%41 = tail call i64 @strcasecmp(i8* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.13, i64 0, i64 0))
%42 = icmp eq i64 %41, 0
br i1 %42, label %47, label %43
43: ; preds = %40
%44 = tail call i64 @strcasecmp(i8* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.14, i64 0, i64 0))
%45 = icmp eq i64 %44, 0
%46 = select i1 %45, i32 29, i32 0
br label %47
47: ; preds = %43, %40, %37, %34, %31, %25, %28, %22, %19, %16, %13, %10, %7, %4, %1
%48 = phi i32 [ 0, %1 ], [ 1, %4 ], [ 2, %7 ], [ 3, %10 ], [ 4, %13 ], [ 5, %16 ], [ 6, %19 ], [ 7, %22 ], [ 24, %28 ], [ 24, %25 ], [ 25, %31 ], [ 26, %34 ], [ 27, %37 ], [ 28, %40 ], [ %46, %43 ]
ret i32 %48
}