char char_to_code(char c) {
  switch (c) {
  case 0x020:
    return 0x00;
    break;
  case 0x40:
    return 0x03;
    break;
  case 0x70:
    return 0x05;
    break;
  case 0x6E:
    return 0x06;
    break;
  case 0x72:
    return 0x07;
    break;
  case 0x6D:
    return 0x09;
    break;
  case 0x7D:
    return 0x0A;
    break;
  case 0x71:
    return 0x0B;
    break;
  case 0x5D:
    return 0x0C;
    break;
  case 0x6B:
    return 0x0D;
    break;
  case 0x73:
    return 0x0E;
    break;
  case 0x5B:
    return 0x0F;
    break;
  }
  return 0x80;
}


x86 assembly (clang, -O0):
<char_to_code>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x2(%rbp)
movsbl -0x2(%rbp),%eax
add    $0xffffffe0,%eax
mov    %eax,%ecx
mov    %rcx,-0x10(%rbp)
sub    $0x5d,%eax
ja     11a0 <char_to_code+0xa0>
mov    -0x10(%rbp),%rax
lea    0xed5(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movb   $0x0,-0x1(%rbp)
jmp    11a4 <char_to_code+0xa4>
movb   $0x3,-0x1(%rbp)
jmp    11a4 <char_to_code+0xa4>
movb   $0x5,-0x1(%rbp)
jmp    11a4 <char_to_code+0xa4>
movb   $0x6,-0x1(%rbp)
jmp    11a4 <char_to_code+0xa4>
movb   $0x7,-0x1(%rbp)
jmp    11a4 <char_to_code+0xa4>
movb   $0x9,-0x1(%rbp)
jmp    11a4 <char_to_code+0xa4>
movb   $0xa,-0x1(%rbp)
jmp    11a4 <char_to_code+0xa4>
movb   $0xb,-0x1(%rbp)
jmp    11a4 <char_to_code+0xa4>
movb   $0xc,-0x1(%rbp)
jmp    11a4 <char_to_code+0xa4>
movb   $0xd,-0x1(%rbp)
jmp    11a4 <char_to_code+0xa4>
movb   $0xe,-0x1(%rbp)
jmp    11a4 <char_to_code+0xa4>
movb   $0xf,-0x1(%rbp)
jmp    11a4 <char_to_code+0xa4>
movb   $0x80,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<char_to_code>:
add    $0xffffffe0,%edi
cmp    $0x5d,%edi
ja     111d <char_to_code+0x1d>
xor    %eax,%eax
lea    0xeef(%rip),%rcx
movslq (%rcx,%rdi,4),%rdx
add    %rcx,%rdx
jmp    *%rdx
mov    $0x3,%al
ret
mov    $0x80,%al
ret
mov    $0xf,%al
ret
mov    $0xc,%al
ret
mov    $0xd,%al
ret
mov    $0x9,%al
ret
mov    $0x6,%al
ret
mov    $0x5,%al
ret
mov    $0xb,%al
ret
mov    $0x7,%al
ret
mov    $0xe,%al
ret
mov    $0xa,%al
ret

LLVM IR (-O0):
define signext i8 @char_to_code(i8 signext %0) {
%2 = alloca i8
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
switch i32 %5, label %18 [
i32 32, label %6
i32 64, label %7
i32 112, label %8
i32 110, label %9
i32 114, label %10
i32 109, label %11
i32 125, label %12
i32 113, label %13
i32 93, label %14
i32 107, label %15
i32 115, label %16
i32 91, label %17
]
6: ; preds = %1
store i8 0, i8* %2
br label %19
7: ; preds = %1
store i8 3, i8* %2
br label %19
8: ; preds = %1
store i8 5, i8* %2
br label %19
9: ; preds = %1
store i8 6, i8* %2
br label %19
10: ; preds = %1
store i8 7, i8* %2
br label %19
11: ; preds = %1
store i8 9, i8* %2
br label %19
12: ; preds = %1
store i8 10, i8* %2
br label %19
13: ; preds = %1
store i8 11, i8* %2
br label %19
14: ; preds = %1
store i8 12, i8* %2
br label %19
15: ; preds = %1
store i8 13, i8* %2
br label %19
16: ; preds = %1
store i8 14, i8* %2
br label %19
17: ; preds = %1
store i8 15, i8* %2
br label %19
18: ; preds = %1
store i8 -128, i8* %2
br label %19
19: ; preds = %18, %17, %16, %15, %14, %13, %12, %11, %10, %9, %8, %7, %6
%20 = load i8, i8* %2
ret i8 %20
}

LLVM IR (-O2):
define signext i8 @char_to_code(i8 signext %0) {
%2 = sext i8 %0 to i32
switch i32 %2, label %14 [
i32 32, label %15
i32 64, label %3
i32 112, label %4
i32 110, label %5
i32 114, label %6
i32 109, label %7
i32 125, label %8
i32 113, label %9
i32 93, label %10
i32 107, label %11
i32 115, label %12
i32 91, label %13
]
3: ; preds = %1
br label %15
4: ; preds = %1
br label %15
5: ; preds = %1
br label %15
6: ; preds = %1
br label %15
7: ; preds = %1
br label %15
8: ; preds = %1
br label %15
9: ; preds = %1
br label %15
10: ; preds = %1
br label %15
11: ; preds = %1
br label %15
12: ; preds = %1
br label %15
13: ; preds = %1
br label %15
14: ; preds = %1
br label %15
15: ; preds = %1, %14, %13, %12, %11, %10, %9, %8, %7, %6, %5, %4, %3
%16 = phi i8 [ -128, %14 ], [ 15, %13 ], [ 14, %12 ], [ 13, %11 ], [ 12, %10 ], [ 11, %9 ], [ 10, %8 ], [ 9, %7 ], [ 7, %6 ], [ 6, %5 ], [ 5, %4 ], [ 3, %3 ], [ 0, %1 ]
ret i8 %16
}