#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 */
int /*<<< orphan*/ wait_fifo_flush();
int HashInputCMD(char *s) {
  if (s[0] == 'r')
    return 2;
  if (s[0] == 'w') {
    wait_fifo_flush();
    return 3;
  }
  if (s[0] == 'x')
    return 4;
  if (s[0] == 's')
    return 5;
  if (s[0] == 'a')
    return 6;
  if (s[0] == 'd')
    return 7;
  if (s[0] == 't')
    return 8;
  if (s[0] == 'c')
    return 9;
  if (s[0] == 'f')
    return 10;
  if (s[0] == 'n')
    return 15;
  if (s[0] == 'p')
    return 11;
  if (s[0] == 'l')
    return 12;
  if (s[0] == 'i')
    return 14;
  if (s[0] == 'z')
    return 16;
  if (s[0] == 'm')
    return 17;
  if (s[0] == 'o')
    return 18;
  if (s[0] == 'R')
    return 19;
  if (s[0] == 'S')
    return 20;
  if (s[0] == 'g')
    return 21;
  if (s[0] == 'G')
    return 23;
  if (s[0] == 'h')
    return 23;
  if (s[0] == 'P')
    return 24;
  if (s[0] == 'F') {
    wait_fifo_flush();
    return 23;
  }
  return 0;
}


x86 assembly (clang, -O0):
<HashInputCMD>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x72,%eax
jne    1138 <HashInputCMD+0x28>
movl   $0x2,-0x4(%rbp)
jmp    13b5 <HashInputCMD+0x2a5>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x77,%eax
jne    115b <HashInputCMD+0x4b>
mov    $0x0,%al
call   1030 <wait_fifo_flush@plt>
movl   $0x3,-0x4(%rbp)
jmp    13b5 <HashInputCMD+0x2a5>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x78,%eax
jne    1177 <HashInputCMD+0x67>
movl   $0x4,-0x4(%rbp)
jmp    13b5 <HashInputCMD+0x2a5>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x73,%eax
jne    1193 <HashInputCMD+0x83>
movl   $0x5,-0x4(%rbp)
jmp    13b5 <HashInputCMD+0x2a5>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x61,%eax
jne    11af <HashInputCMD+0x9f>
movl   $0x6,-0x4(%rbp)
jmp    13b5 <HashInputCMD+0x2a5>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x64,%eax
jne    11cb <HashInputCMD+0xbb>
movl   $0x7,-0x4(%rbp)
jmp    13b5 <HashInputCMD+0x2a5>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x74,%eax
jne    11e7 <HashInputCMD+0xd7>
movl   $0x8,-0x4(%rbp)
jmp    13b5 <HashInputCMD+0x2a5>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x63,%eax
jne    1203 <HashInputCMD+0xf3>
movl   $0x9,-0x4(%rbp)
jmp    13b5 <HashInputCMD+0x2a5>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x66,%eax
jne    121f <HashInputCMD+0x10f>
movl   $0xa,-0x4(%rbp)
jmp    13b5 <HashInputCMD+0x2a5>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x6e,%eax
jne    123b <HashInputCMD+0x12b>
movl   $0xf,-0x4(%rbp)
jmp    13b5 <HashInputCMD+0x2a5>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x70,%eax
jne    1257 <HashInputCMD+0x147>
movl   $0xb,-0x4(%rbp)
jmp    13b5 <HashInputCMD+0x2a5>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x6c,%eax
jne    1273 <HashInputCMD+0x163>
movl   $0xc,-0x4(%rbp)
jmp    13b5 <HashInputCMD+0x2a5>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x69,%eax
jne    128f <HashInputCMD+0x17f>
movl   $0xe,-0x4(%rbp)
jmp    13b5 <HashInputCMD+0x2a5>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x7a,%eax
jne    12ab <HashInputCMD+0x19b>
movl   $0x10,-0x4(%rbp)
jmp    13b5 <HashInputCMD+0x2a5>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x6d,%eax
jne    12c7 <HashInputCMD+0x1b7>
movl   $0x11,-0x4(%rbp)
jmp    13b5 <HashInputCMD+0x2a5>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x6f,%eax
jne    12e3 <HashInputCMD+0x1d3>
movl   $0x12,-0x4(%rbp)
jmp    13b5 <HashInputCMD+0x2a5>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x52,%eax
jne    12ff <HashInputCMD+0x1ef>
movl   $0x13,-0x4(%rbp)
jmp    13b5 <HashInputCMD+0x2a5>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x53,%eax
jne    131b <HashInputCMD+0x20b>
movl   $0x14,-0x4(%rbp)
jmp    13b5 <HashInputCMD+0x2a5>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x67,%eax
jne    1337 <HashInputCMD+0x227>
movl   $0x15,-0x4(%rbp)
jmp    13b5 <HashInputCMD+0x2a5>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x47,%eax
jne    1353 <HashInputCMD+0x243>
movl   $0x17,-0x4(%rbp)
jmp    13b5 <HashInputCMD+0x2a5>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x68,%eax
jne    136f <HashInputCMD+0x25f>
movl   $0x17,-0x4(%rbp)
jmp    13b5 <HashInputCMD+0x2a5>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x50,%eax
jne    138b <HashInputCMD+0x27b>
movl   $0x18,-0x4(%rbp)
jmp    13b5 <HashInputCMD+0x2a5>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x46,%eax
jne    13ae <HashInputCMD+0x29e>
mov    $0x0,%al
call   1030 <wait_fifo_flush@plt>
movl   $0x17,-0x4(%rbp)
jmp    13b5 <HashInputCMD+0x2a5>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<HashInputCMD>:
push   %rax
mov    (%rdi),%cl
add    $0xba,%cl
cmp    $0x34,%cl
ja     1141 <HashInputCMD+0x31>
mov    $0x2,%eax
movzbl %cl,%ecx
lea    0xed6(%rip),%rdx
movslq (%rdx,%rcx,4),%rcx
add    %rdx,%rcx
jmp    *%rcx
xor    %eax,%eax
call   1030 <wait_fifo_flush@plt>
mov    $0x17,%eax
pop    %rcx
ret
xor    %eax,%eax
pop    %rcx
ret
mov    $0x18,%eax
pop    %rcx
ret
mov    $0x13,%eax
pop    %rcx
ret
mov    $0x14,%eax
pop    %rcx
ret
mov    $0x6,%eax
pop    %rcx
ret
mov    $0x9,%eax
pop    %rcx
ret
mov    $0x7,%eax
pop    %rcx
ret
mov    $0xa,%eax
pop    %rcx
ret
mov    $0x15,%eax
pop    %rcx
ret
mov    $0xe,%eax
pop    %rcx
ret
mov    $0xc,%eax
pop    %rcx
ret
mov    $0x11,%eax
pop    %rcx
ret
mov    $0xf,%eax
pop    %rcx
ret
mov    $0x12,%eax
pop    %rcx
ret
mov    $0xb,%eax
pop    %rcx
ret
mov    $0x5,%eax
pop    %rcx
ret
mov    $0x8,%eax
pop    %rcx
ret
xor    %eax,%eax
call   1030 <wait_fifo_flush@plt>
mov    $0x3,%eax
pop    %rcx
ret
mov    $0x4,%eax
pop    %rcx
ret
mov    $0x10,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @HashInputCMD(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = getelementptr inbounds i8, i8* %4, i64 0
%6 = load i8, i8* %5
%7 = sext i8 %6 to i32
%8 = icmp eq i32 %7, 114
br i1 %8, label %9, label %10
9: ; preds = %1
store i32 2, i32* %2
br label %167
10: ; preds = %1
%11 = load i8*, i8** %3
%12 = getelementptr inbounds i8, i8* %11, i64 0
%13 = load i8, i8* %12
%14 = sext i8 %13 to i32
%15 = icmp eq i32 %14, 119
br i1 %15, label %16, label %18
16: ; preds = %10
%17 = call i32 (...) @wait_fifo_flush()
store i32 3, i32* %2
br label %167
18: ; preds = %10
%19 = load i8*, i8** %3
%20 = getelementptr inbounds i8, i8* %19, i64 0
%21 = load i8, i8* %20
%22 = sext i8 %21 to i32
%23 = icmp eq i32 %22, 120
br i1 %23, label %24, label %25
24: ; preds = %18
store i32 4, i32* %2
br label %167
25: ; preds = %18
%26 = load i8*, i8** %3
%27 = getelementptr inbounds i8, i8* %26, i64 0
%28 = load i8, i8* %27
%29 = sext i8 %28 to i32
%30 = icmp eq i32 %29, 115
br i1 %30, label %31, label %32
31: ; preds = %25
store i32 5, i32* %2
br label %167
32: ; preds = %25
%33 = load i8*, i8** %3
%34 = getelementptr inbounds i8, i8* %33, i64 0
%35 = load i8, i8* %34
%36 = sext i8 %35 to i32
%37 = icmp eq i32 %36, 97
br i1 %37, label %38, label %39
38: ; preds = %32
store i32 6, i32* %2
br label %167
39: ; preds = %32
%40 = load i8*, i8** %3
%41 = getelementptr inbounds i8, i8* %40, i64 0
%42 = load i8, i8* %41
%43 = sext i8 %42 to i32
%44 = icmp eq i32 %43, 100
br i1 %44, label %45, label %46
45: ; preds = %39
store i32 7, i32* %2
br label %167
46: ; preds = %39
%47 = load i8*, i8** %3
%48 = getelementptr inbounds i8, i8* %47, i64 0
%49 = load i8, i8* %48
%50 = sext i8 %49 to i32
%51 = icmp eq i32 %50, 116
br i1 %51, label %52, label %53
52: ; preds = %46
store i32 8, i32* %2
br label %167
53: ; preds = %46
%54 = load i8*, i8** %3
%55 = getelementptr inbounds i8, i8* %54, i64 0
%56 = load i8, i8* %55
%57 = sext i8 %56 to i32
%58 = icmp eq i32 %57, 99
br i1 %58, label %59, label %60
59: ; preds = %53
store i32 9, i32* %2
br label %167
60: ; preds = %53
%61 = load i8*, i8** %3
%62 = getelementptr inbounds i8, i8* %61, i64 0
%63 = load i8, i8* %62
%64 = sext i8 %63 to i32
%65 = icmp eq i32 %64, 102
br i1 %65, label %66, label %67
66: ; preds = %60
store i32 10, i32* %2
br label %167
67: ; preds = %60
%68 = load i8*, i8** %3
%69 = getelementptr inbounds i8, i8* %68, i64 0
%70 = load i8, i8* %69
%71 = sext i8 %70 to i32
%72 = icmp eq i32 %71, 110
br i1 %72, label %73, label %74
73: ; preds = %67
store i32 15, i32* %2
br label %167
74: ; preds = %67
%75 = load i8*, i8** %3
%76 = getelementptr inbounds i8, i8* %75, i64 0
%77 = load i8, i8* %76
%78 = sext i8 %77 to i32
%79 = icmp eq i32 %78, 112
br i1 %79, label %80, label %81
80: ; preds = %74
store i32 11, i32* %2
br label %167
81: ; preds = %74
%82 = load i8*, i8** %3
%83 = getelementptr inbounds i8, i8* %82, i64 0
%84 = load i8, i8* %83
%85 = sext i8 %84 to i32
%86 = icmp eq i32 %85, 108
br i1 %86, label %87, label %88
87: ; preds = %81
store i32 12, i32* %2
br label %167
88: ; preds = %81
%89 = load i8*, i8** %3
%90 = getelementptr inbounds i8, i8* %89, i64 0
%91 = load i8, i8* %90
%92 = sext i8 %91 to i32
%93 = icmp eq i32 %92, 105
br i1 %93, label %94, label %95
94: ; preds = %88
store i32 14, i32* %2
br label %167
95: ; preds = %88
%96 = load i8*, i8** %3
%97 = getelementptr inbounds i8, i8* %96, i64 0
%98 = load i8, i8* %97
%99 = sext i8 %98 to i32
%100 = icmp eq i32 %99, 122
br i1 %100, label %101, label %102
101: ; preds = %95
store i32 16, i32* %2
br label %167
102: ; preds = %95
%103 = load i8*, i8** %3
%104 = getelementptr inbounds i8, i8* %103, i64 0
%105 = load i8, i8* %104
%106 = sext i8 %105 to i32
%107 = icmp eq i32 %106, 109
br i1 %107, label %108, label %109
108: ; preds = %102
store i32 17, i32* %2
br label %167
109: ; preds = %102
%110 = load i8*, i8** %3
%111 = getelementptr inbounds i8, i8* %110, i64 0
%112 = load i8, i8* %111
%113 = sext i8 %112 to i32
%114 = icmp eq i32 %113, 111
br i1 %114, label %115, label %116
115: ; preds = %109
store i32 18, i32* %2
br label %167
116: ; preds = %109
%117 = load i8*, i8** %3
%118 = getelementptr inbounds i8, i8* %117, i64 0
%119 = load i8, i8* %118
%120 = sext i8 %119 to i32
%121 = icmp eq i32 %120, 82
br i1 %121, label %122, label %123
122: ; preds = %116
store i32 19, i32* %2
br label %167
123: ; preds = %116
%124 = load i8*, i8** %3
%125 = getelementptr inbounds i8, i8* %124, i64 0
%126 = load i8, i8* %125
%127 = sext i8 %126 to i32
%128 = icmp eq i32 %127, 83
br i1 %128, label %129, label %130
129: ; preds = %123
store i32 20, i32* %2
br label %167
130: ; preds = %123
%131 = load i8*, i8** %3
%132 = getelementptr inbounds i8, i8* %131, i64 0
%133 = load i8, i8* %132
%134 = sext i8 %133 to i32
%135 = icmp eq i32 %134, 103
br i1 %135, label %136, label %137
136: ; preds = %130
store i32 21, i32* %2
br label %167
137: ; preds = %130
%138 = load i8*, i8** %3
%139 = getelementptr inbounds i8, i8* %138, i64 0
%140 = load i8, i8* %139
%141 = sext i8 %140 to i32
%142 = icmp eq i32 %141, 71
br i1 %142, label %143, label %144
143: ; preds = %137
store i32 23, i32* %2
br label %167
144: ; preds = %137
%145 = load i8*, i8** %3
%146 = getelementptr inbounds i8, i8* %145, i64 0
%147 = load i8, i8* %146
%148 = sext i8 %147 to i32
%149 = icmp eq i32 %148, 104
br i1 %149, label %150, label %151
150: ; preds = %144
store i32 23, i32* %2
br label %167
151: ; preds = %144
%152 = load i8*, i8** %3
%153 = getelementptr inbounds i8, i8* %152, i64 0
%154 = load i8, i8* %153
%155 = sext i8 %154 to i32
%156 = icmp eq i32 %155, 80
br i1 %156, label %157, label %158
157: ; preds = %151
store i32 24, i32* %2
br label %167
158: ; preds = %151
%159 = load i8*, i8** %3
%160 = getelementptr inbounds i8, i8* %159, i64 0
%161 = load i8, i8* %160
%162 = sext i8 %161 to i32
%163 = icmp eq i32 %162, 70
br i1 %163, label %164, label %166
164: ; preds = %158
%165 = call i32 (...) @wait_fifo_flush()
store i32 23, i32* %2
br label %167
166: ; preds = %158
store i32 0, i32* %2
br label %167
167: ; preds = %166, %164, %157, %150, %143, %136, %129, %122, %115, %108, %101, %94, %87, %80, %73, %66, %59, %52, %45, %38, %31, %24, %16, %9
%168 = load i32, i32* %2
ret i32 %168
}

LLVM IR (-O2):
define i32 @HashInputCMD(i8* nocapture %0) {
%2 = load i8, i8* %0
switch i8 %2, label %27 [
i8 114, label %28
i8 119, label %3
i8 120, label %5
i8 115, label %6
i8 97, label %7
i8 100, label %8
i8 116, label %9
i8 99, label %10
i8 102, label %11
i8 110, label %12
i8 112, label %13
i8 108, label %14
i8 105, label %15
i8 122, label %16
i8 109, label %17
i8 111, label %18
i8 82, label %19
i8 83, label %20
i8 103, label %21
i8 71, label %22
i8 104, label %23
i8 80, label %24
i8 70, label %25
]
3: ; preds = %1
%4 = tail call i32 (...) @wait_fifo_flush()
br label %28
5: ; preds = %1
br label %28
6: ; preds = %1
br label %28
7: ; preds = %1
br label %28
8: ; preds = %1
br label %28
9: ; preds = %1
br label %28
10: ; preds = %1
br label %28
11: ; preds = %1
br label %28
12: ; preds = %1
br label %28
13: ; preds = %1
br label %28
14: ; preds = %1
br label %28
15: ; preds = %1
br label %28
16: ; preds = %1
br label %28
17: ; preds = %1
br label %28
18: ; preds = %1
br label %28
19: ; preds = %1
br label %28
20: ; preds = %1
br label %28
21: ; preds = %1
br label %28
22: ; preds = %1
br label %28
23: ; preds = %1
br label %28
24: ; preds = %1
br label %28
25: ; preds = %1
%26 = tail call i32 (...) @wait_fifo_flush()
br label %28
27: ; preds = %1
br label %28
28: ; preds = %1, %27, %25, %24, %23, %22, %21, %20, %19, %18, %17, %16, %15, %14, %13, %12, %11, %10, %9, %8, %7, %6, %5, %3
%29 = phi i32 [ 3, %3 ], [ 4, %5 ], [ 5, %6 ], [ 6, %7 ], [ 7, %8 ], [ 8, %9 ], [ 9, %10 ], [ 10, %11 ], [ 15, %12 ], [ 11, %13 ], [ 12, %14 ], [ 14, %15 ], [ 16, %16 ], [ 17, %17 ], [ 18, %18 ], [ 19, %19 ], [ 20, %20 ], [ 21, %21 ], [ 23, %22 ], [ 23, %23 ], [ 24, %24 ], [ 23, %25 ], [ 0, %27 ], [ 2, %1 ]
ret i32 %29
}