unsigned int mel_approx_dtype_by_chars(char first, char second) {
  unsigned int dtype = (0);
  switch (first) {
  case 'M':
  case 'm':
    dtype = (1 << 0);
    break;
  case 'S':
  case 's':
    dtype = (1 << 1);
    break;
  case 'X':
  case 'x':
    dtype = (1 << 2);
    break;
  case 'Y':
  case 'y':
    dtype = (1 << 3);
    break;
  case 'T':
  case 't':
    dtype = (1 << 4);
    break;
  case 'C':
  case 'c':
    dtype = (1 << 5);
    break;
  case 'D':
  case 'd':
    dtype = (1 << 6);
    break;
  case 'R':
  case 'r':
    dtype = (1 << 7);
    break;
  case '.':
    dtype = (1 << 11);
    break;
  case '"':
    dtype = (1 << 25);
    break;
  case 'V':
  case 'v':
    dtype = (1 << 14) | (1 << 12);
    break;
  case 'Z':
  case 'z':
    dtype = (1 << 13) | (1 << 9);
    break;
  case 'K':
  case 'k':
    dtype = (1 << 15) | (1 << 16) | (1 << 10);
    break;
  case 'E':
  case 'e':
    if (second == 'R' || second == 'r') {
      dtype = (1 << 8);
    } else {
      dtype = (1 << 19);
    }
    break;
  case 'H':
  case 'h':
    dtype = (1 << 17) | (1 << 18);
    break;
  case 'P':
  case 'p':
    dtype = (1 << 20);
    break;
  case 'I':
  case 'i':
    dtype = (1 << 21);
    break;
  case 'N':
  case 'n':
    dtype = (1 << 22);
    break;
  case 'U':
  case 'u':
    dtype = (1 << 23);
    break;
  case 'G':
  case 'g':
    dtype = (1 << 24);
    break;
  }
  return (dtype);
}


x86 assembly (clang, -O0):
<mel_approx_dtype_by_chars>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movl   $0x0,-0x8(%rbp)
movsbl -0x1(%rbp),%eax
add    $0xffffffde,%eax
mov    %eax,%ecx
mov    %rcx,-0x10(%rbp)
sub    $0x58,%eax
ja     1252 <mel_approx_dtype_by_chars+0x152>
mov    -0x10(%rbp),%rax
lea    0xec8(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movl   $0x1,-0x8(%rbp)
jmp    1252 <mel_approx_dtype_by_chars+0x152>
movl   $0x2,-0x8(%rbp)
jmp    1252 <mel_approx_dtype_by_chars+0x152>
movl   $0x4,-0x8(%rbp)
jmp    1252 <mel_approx_dtype_by_chars+0x152>
movl   $0x8,-0x8(%rbp)
jmp    1252 <mel_approx_dtype_by_chars+0x152>
movl   $0x10,-0x8(%rbp)
jmp    1252 <mel_approx_dtype_by_chars+0x152>
movl   $0x20,-0x8(%rbp)
jmp    1252 <mel_approx_dtype_by_chars+0x152>
movl   $0x40,-0x8(%rbp)
jmp    1252 <mel_approx_dtype_by_chars+0x152>
movl   $0x80,-0x8(%rbp)
jmp    1252 <mel_approx_dtype_by_chars+0x152>
movl   $0x800,-0x8(%rbp)
jmp    1252 <mel_approx_dtype_by_chars+0x152>
movl   $0x2000000,-0x8(%rbp)
jmp    1252 <mel_approx_dtype_by_chars+0x152>
movl   $0x5000,-0x8(%rbp)
jmp    1252 <mel_approx_dtype_by_chars+0x152>
movl   $0x2200,-0x8(%rbp)
jmp    1252 <mel_approx_dtype_by_chars+0x152>
movl   $0x18400,-0x8(%rbp)
jmp    1252 <mel_approx_dtype_by_chars+0x152>
movsbl -0x2(%rbp),%eax
cmp    $0x52,%eax
je     11f7 <mel_approx_dtype_by_chars+0xf7>
movsbl -0x2(%rbp),%eax
cmp    $0x72,%eax
jne    1203 <mel_approx_dtype_by_chars+0x103>
movl   $0x100,-0x8(%rbp)
jmp    120a <mel_approx_dtype_by_chars+0x10a>
movl   $0x80000,-0x8(%rbp)
jmp    1252 <mel_approx_dtype_by_chars+0x152>
movl   $0x60000,-0x8(%rbp)
jmp    1252 <mel_approx_dtype_by_chars+0x152>
movl   $0x100000,-0x8(%rbp)
jmp    1252 <mel_approx_dtype_by_chars+0x152>
movl   $0x200000,-0x8(%rbp)
jmp    1252 <mel_approx_dtype_by_chars+0x152>
movl   $0x400000,-0x8(%rbp)
jmp    1252 <mel_approx_dtype_by_chars+0x152>
movl   $0x800000,-0x8(%rbp)
jmp    1252 <mel_approx_dtype_by_chars+0x152>
movl   $0x1000000,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mel_approx_dtype_by_chars>:
xor    %eax,%eax
add    $0xffffffde,%edi
cmp    $0x58,%edi
ja     1141 <mel_approx_dtype_by_chars+0x41>
lea    0xeef(%rip),%rcx
movslq (%rcx,%rdi,4),%rdx
add    %rcx,%rdx
jmp    *%rdx
mov    $0x20,%eax
ret
mov    $0x40,%eax
ret
and    $0xdf,%sil
cmp    $0x52,%sil
mov    $0x100,%ecx
mov    $0x80000,%eax
cmove  %ecx,%eax
ret
mov    $0x1000000,%eax
ret
mov    $0x18400,%eax
ret
mov    $0x1,%eax
ret
mov    $0x400000,%eax
ret
mov    $0x100000,%eax
ret
mov    $0x80,%eax
ret
mov    $0x2,%eax
ret
mov    $0x10,%eax
ret
mov    $0x800000,%eax
ret
mov    $0x5000,%eax
ret
mov    $0x4,%eax
ret
mov    $0x8,%eax
ret
mov    $0x60000,%eax
ret
mov    $0x200000,%eax
ret
mov    $0x2200,%eax
ret
mov    $0x2000000,%eax
ret
mov    $0x800,%eax
ret

LLVM IR (-O0):
define i32 @mel_approx_dtype_by_chars(i8 signext %0, i8 signext %1) {
%3 = alloca i8
%4 = alloca i8
%5 = alloca i32
store i8 %0, i8* %3
store i8 %1, i8* %4
store i32 0, i32* %5
%6 = load i8, i8* %3
%7 = sext i8 %6 to i32
switch i32 %7, label %38 [
i32 77, label %8
i32 109, label %8
i32 83, label %9
i32 115, label %9
i32 88, label %10
i32 120, label %10
i32 89, label %11
i32 121, label %11
i32 84, label %12
i32 116, label %12
i32 67, label %13
i32 99, label %13
i32 68, label %14
i32 100, label %14
i32 82, label %15
i32 114, label %15
i32 46, label %16
i32 34, label %17
i32 86, label %18
i32 118, label %18
i32 90, label %19
i32 122, label %19
i32 75, label %20
i32 107, label %20
i32 69, label %21
i32 101, label %21
i32 72, label %32
i32 104, label %32
i32 80, label %33
i32 112, label %33
i32 73, label %34
i32 105, label %34
i32 78, label %35
i32 110, label %35
i32 85, label %36
i32 117, label %36
i32 71, label %37
i32 103, label %37
]
8: ; preds = %2, %2
store i32 1, i32* %5
br label %38
9: ; preds = %2, %2
store i32 2, i32* %5
br label %38
10: ; preds = %2, %2
store i32 4, i32* %5
br label %38
11: ; preds = %2, %2
store i32 8, i32* %5
br label %38
12: ; preds = %2, %2
store i32 16, i32* %5
br label %38
13: ; preds = %2, %2
store i32 32, i32* %5
br label %38
14: ; preds = %2, %2
store i32 64, i32* %5
br label %38
15: ; preds = %2, %2
store i32 128, i32* %5
br label %38
16: ; preds = %2
store i32 2048, i32* %5
br label %38
17: ; preds = %2
store i32 33554432, i32* %5
br label %38
18: ; preds = %2, %2
store i32 20480, i32* %5
br label %38
19: ; preds = %2, %2
store i32 8704, i32* %5
br label %38
20: ; preds = %2, %2
store i32 99328, i32* %5
br label %38
21: ; preds = %2, %2
%22 = load i8, i8* %4
%23 = sext i8 %22 to i32
%24 = icmp eq i32 %23, 82
br i1 %24, label %29, label %25
25: ; preds = %21
%26 = load i8, i8* %4
%27 = sext i8 %26 to i32
%28 = icmp eq i32 %27, 114
br i1 %28, label %29, label %30
29: ; preds = %25, %21
store i32 256, i32* %5
br label %31
30: ; preds = %25
store i32 524288, i32* %5
br label %31
31: ; preds = %30, %29
br label %38
32: ; preds = %2, %2
store i32 393216, i32* %5
br label %38
33: ; preds = %2, %2
store i32 1048576, i32* %5
br label %38
34: ; preds = %2, %2
store i32 2097152, i32* %5
br label %38
35: ; preds = %2, %2
store i32 4194304, i32* %5
br label %38
36: ; preds = %2, %2
store i32 8388608, i32* %5
br label %38
37: ; preds = %2, %2
store i32 16777216, i32* %5
br label %38
38: ; preds = %2, %37, %36, %35, %34, %33, %32, %31, %20, %19, %18, %17, %16, %15, %14, %13, %12, %11, %10, %9, %8
%39 = load i32, i32* %5
ret i32 %39
}

LLVM IR (-O2):
define i32 @mel_approx_dtype_by_chars(i8 signext %0, i8 signext %1) {
%3 = sext i8 %0 to i32
switch i32 %3, label %27 [
i32 77, label %4
i32 109, label %4
i32 83, label %5
i32 115, label %5
i32 88, label %6
i32 120, label %6
i32 89, label %7
i32 121, label %7
i32 84, label %8
i32 116, label %8
i32 67, label %9
i32 99, label %9
i32 68, label %10
i32 100, label %10
i32 82, label %11
i32 114, label %11
i32 46, label %12
i32 34, label %13
i32 86, label %14
i32 118, label %14
i32 90, label %15
i32 122, label %15
i32 75, label %16
i32 107, label %16
i32 69, label %17
i32 101, label %17
i32 72, label %21
i32 104, label %21
i32 80, label %22
i32 112, label %22
i32 73, label %23
i32 105, label %23
i32 78, label %24
i32 110, label %24
i32 85, label %25
i32 117, label %25
i32 71, label %26
i32 103, label %26
]
4: ; preds = %2, %2
br label %27
5: ; preds = %2, %2
br label %27
6: ; preds = %2, %2
br label %27
7: ; preds = %2, %2
br label %27
8: ; preds = %2, %2
br label %27
9: ; preds = %2, %2
br label %27
10: ; preds = %2, %2
br label %27
11: ; preds = %2, %2
br label %27
12: ; preds = %2
br label %27
13: ; preds = %2
br label %27
14: ; preds = %2, %2
br label %27
15: ; preds = %2, %2
br label %27
16: ; preds = %2, %2
br label %27
17: ; preds = %2, %2
%18 = and i8 %1, -33
%19 = icmp eq i8 %18, 82
%20 = select i1 %19, i32 256, i32 524288
br label %27
21: ; preds = %2, %2
br label %27
22: ; preds = %2, %2
br label %27
23: ; preds = %2, %2
br label %27
24: ; preds = %2, %2
br label %27
25: ; preds = %2, %2
br label %27
26: ; preds = %2, %2
br label %27
27: ; preds = %17, %2, %26, %25, %24, %23, %22, %21, %16, %15, %14, %13, %12, %11, %10, %9, %8, %7, %6, %5, %4
%28 = phi i32 [ 0, %2 ], [ 16777216, %26 ], [ 8388608, %25 ], [ 4194304, %24 ], [ 2097152, %23 ], [ 1048576, %22 ], [ 393216, %21 ], [ 99328, %16 ], [ 8704, %15 ], [ 20480, %14 ], [ 33554432, %13 ], [ 2048, %12 ], [ 128, %11 ], [ 64, %10 ], [ 32, %9 ], [ 16, %8 ], [ 8, %7 ], [ 4, %6 ], [ 2, %5 ], [ 1, %4 ], [ %20, %17 ]
ret i32 %28
}