int Numbervalue(char c) {
  int s = 0;
  switch (c) {
  case 'a':
    s = 1;
    break;
  case 'b':
    s = 2;
    break;
  case 'c':
    s = 3;
    break;
  case 'd':
    s = 1;
    break;
  case 'e':
    s = 2;
    break;
  case 'f':
    s = 3;
    break;
  case 'g':
    s = 1;
    break;
  case 'h':
    s = 2;
    break;
  case 'i':
    s = 3;
    break;
  case 'j':
    s = 1;
    break;
  case 'k':
    s = 2;
    break;
  case 'l':
    s = 3;
    break;
  case 'm':
    s = 1;
    break;
  case 'n':
    s = 2;
    break;
  case 'o':
    s = 3;
    break;
  case 'p':
    s = 1;
    break;
  case 'q':
    s = 2;
    break;
  case 'r':
    s = 3;
    break;
  case 's':
    s = 4;
    break;
  case 't':
    s = 1;
    break;
  case 'u':
    s = 2;
    break;
  case 'v':
    s = 3;
    break;
  case 'w':
    s = 1;
    break;
  case 'x':
    s = 2;
    break;
  case 'y':
    s = 3;
    break;
  case 'z':
    s = 4;
    break;
  case ' ':
    s = 1;
    break;
  default:
    s = 0;
  }
  return s;
}


x86 assembly (clang, -O0):
<Numbervalue>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movl   $0x0,-0x8(%rbp)
movsbl -0x1(%rbp),%eax
add    $0xffffffe0,%eax
mov    %eax,%ecx
mov    %rcx,-0x10(%rbp)
sub    $0x5a,%eax
ja     127f <Numbervalue+0x17f>
mov    -0x10(%rbp),%rax
lea    0xece(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movl   $0x1,-0x8(%rbp)
jmp    1286 <Numbervalue+0x186>
movl   $0x2,-0x8(%rbp)
jmp    1286 <Numbervalue+0x186>
movl   $0x3,-0x8(%rbp)
jmp    1286 <Numbervalue+0x186>
movl   $0x1,-0x8(%rbp)
jmp    1286 <Numbervalue+0x186>
movl   $0x2,-0x8(%rbp)
jmp    1286 <Numbervalue+0x186>
movl   $0x3,-0x8(%rbp)
jmp    1286 <Numbervalue+0x186>
movl   $0x1,-0x8(%rbp)
jmp    1286 <Numbervalue+0x186>
movl   $0x2,-0x8(%rbp)
jmp    1286 <Numbervalue+0x186>
movl   $0x3,-0x8(%rbp)
jmp    1286 <Numbervalue+0x186>
movl   $0x1,-0x8(%rbp)
jmp    1286 <Numbervalue+0x186>
movl   $0x2,-0x8(%rbp)
jmp    1286 <Numbervalue+0x186>
movl   $0x3,-0x8(%rbp)
jmp    1286 <Numbervalue+0x186>
movl   $0x1,-0x8(%rbp)
jmp    1286 <Numbervalue+0x186>
movl   $0x2,-0x8(%rbp)
jmp    1286 <Numbervalue+0x186>
movl   $0x3,-0x8(%rbp)
jmp    1286 <Numbervalue+0x186>
movl   $0x1,-0x8(%rbp)
jmp    1286 <Numbervalue+0x186>
movl   $0x2,-0x8(%rbp)
jmp    1286 <Numbervalue+0x186>
movl   $0x3,-0x8(%rbp)
jmp    1286 <Numbervalue+0x186>
movl   $0x4,-0x8(%rbp)
jmp    1286 <Numbervalue+0x186>
movl   $0x1,-0x8(%rbp)
jmp    1286 <Numbervalue+0x186>
movl   $0x2,-0x8(%rbp)
jmp    1286 <Numbervalue+0x186>
movl   $0x3,-0x8(%rbp)
jmp    1286 <Numbervalue+0x186>
movl   $0x1,-0x8(%rbp)
jmp    1286 <Numbervalue+0x186>
movl   $0x2,-0x8(%rbp)
jmp    1286 <Numbervalue+0x186>
movl   $0x3,-0x8(%rbp)
jmp    1286 <Numbervalue+0x186>
movl   $0x4,-0x8(%rbp)
jmp    1286 <Numbervalue+0x186>
movl   $0x1,-0x8(%rbp)
jmp    1286 <Numbervalue+0x186>
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Numbervalue>:
add    $0xffffffe0,%edi
cmp    $0x5a,%edi
ja     1130 <Numbervalue+0x30>
mov    $0x1,%eax
lea    0xeec(%rip),%rcx
movslq (%rcx,%rdi,4),%rdx
add    %rcx,%rdx
jmp    *%rdx
ret
mov    $0x2,%eax
ret
mov    $0x3,%eax
ret
mov    $0x4,%eax
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @Numbervalue(i8 signext %0) {
%2 = alloca i8
%3 = alloca i32
store i8 %0, i8* %2
store i32 0, i32* %3
%4 = load i8, i8* %2
%5 = sext i8 %4 to i32
switch i32 %5, label %33 [
i32 97, label %6
i32 98, label %7
i32 99, label %8
i32 100, label %9
i32 101, label %10
i32 102, label %11
i32 103, label %12
i32 104, label %13
i32 105, label %14
i32 106, label %15
i32 107, label %16
i32 108, label %17
i32 109, label %18
i32 110, label %19
i32 111, label %20
i32 112, label %21
i32 113, label %22
i32 114, label %23
i32 115, label %24
i32 116, label %25
i32 117, label %26
i32 118, label %27
i32 119, label %28
i32 120, label %29
i32 121, label %30
i32 122, label %31
i32 32, label %32
]
6: ; preds = %1
store i32 1, i32* %3
br label %34
7: ; preds = %1
store i32 2, i32* %3
br label %34
8: ; preds = %1
store i32 3, i32* %3
br label %34
9: ; preds = %1
store i32 1, i32* %3
br label %34
10: ; preds = %1
store i32 2, i32* %3
br label %34
11: ; preds = %1
store i32 3, i32* %3
br label %34
12: ; preds = %1
store i32 1, i32* %3
br label %34
13: ; preds = %1
store i32 2, i32* %3
br label %34
14: ; preds = %1
store i32 3, i32* %3
br label %34
15: ; preds = %1
store i32 1, i32* %3
br label %34
16: ; preds = %1
store i32 2, i32* %3
br label %34
17: ; preds = %1
store i32 3, i32* %3
br label %34
18: ; preds = %1
store i32 1, i32* %3
br label %34
19: ; preds = %1
store i32 2, i32* %3
br label %34
20: ; preds = %1
store i32 3, i32* %3
br label %34
21: ; preds = %1
store i32 1, i32* %3
br label %34
22: ; preds = %1
store i32 2, i32* %3
br label %34
23: ; preds = %1
store i32 3, i32* %3
br label %34
24: ; preds = %1
store i32 4, i32* %3
br label %34
25: ; preds = %1
store i32 1, i32* %3
br label %34
26: ; preds = %1
store i32 2, i32* %3
br label %34
27: ; preds = %1
store i32 3, i32* %3
br label %34
28: ; preds = %1
store i32 1, i32* %3
br label %34
29: ; preds = %1
store i32 2, i32* %3
br label %34
30: ; preds = %1
store i32 3, i32* %3
br label %34
31: ; preds = %1
store i32 4, i32* %3
br label %34
32: ; preds = %1
store i32 1, i32* %3
br label %34
33: ; preds = %1
store i32 0, i32* %3
br label %34
34: ; preds = %33, %32, %31, %30, %29, %28, %27, %26, %25, %24, %23, %22, %21, %20, %19, %18, %17, %16, %15, %14, %13, %12, %11, %10, %9, %8, %7, %6
%35 = load i32, i32* %3
ret i32 %35
}

LLVM IR (-O2):
define i32 @Numbervalue(i8 signext %0) {
%2 = sext i8 %0 to i32
switch i32 %2, label %21 [
i32 97, label %22
i32 98, label %3
i32 99, label %4
i32 100, label %22
i32 101, label %5
i32 102, label %6
i32 103, label %22
i32 104, label %7
i32 105, label %8
i32 106, label %22
i32 107, label %9
i32 108, label %10
i32 109, label %22
i32 110, label %11
i32 111, label %12
i32 112, label %22
i32 113, label %13
i32 114, label %14
i32 115, label %15
i32 116, label %22
i32 117, label %16
i32 118, label %17
i32 119, label %22
i32 120, label %18
i32 121, label %19
i32 122, label %20
i32 32, label %22
]
3: ; preds = %1
br label %22
4: ; preds = %1
br label %22
5: ; preds = %1
br label %22
6: ; preds = %1
br label %22
7: ; preds = %1
br label %22
8: ; preds = %1
br label %22
9: ; preds = %1
br label %22
10: ; preds = %1
br label %22
11: ; preds = %1
br label %22
12: ; preds = %1
br label %22
13: ; preds = %1
br label %22
14: ; preds = %1
br label %22
15: ; preds = %1
br label %22
16: ; preds = %1
br label %22
17: ; preds = %1
br label %22
18: ; preds = %1
br label %22
19: ; preds = %1
br label %22
20: ; preds = %1
br label %22
21: ; preds = %1
br label %22
22: ; preds = %1, %1, %1, %1, %1, %1, %1, %1, %1, %21, %20, %19, %18, %17, %16, %15, %14, %13, %12, %11, %10, %9, %8, %7, %6, %5, %4, %3
%23 = phi i32 [ 0, %21 ], [ 4, %20 ], [ 3, %19 ], [ 2, %18 ], [ 3, %17 ], [ 2, %16 ], [ 4, %15 ], [ 3, %14 ], [ 2, %13 ], [ 3, %12 ], [ 2, %11 ], [ 3, %10 ], [ 2, %9 ], [ 3, %8 ], [ 2, %7 ], [ 3, %6 ], [ 2, %5 ], [ 3, %4 ], [ 2, %3 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ]
ret i32 %23
}