char lookUpKBCode(const char scanCode) {
  switch (scanCode) {
  case 0x1C:
    return 'a';
  case 0x32:
    return 'b';
  case 0x21:
    return 'c';
  case 0x23:
    return 'd';
  case 0x24:
    return 'e';
  case 0x2B:
    return 'f';
  case 0x34:
    return 'g';
  case 0x33:
    return 'h';
  case 0x43:
    return 'i';
  case 0x3B:
    return 'j';
  case 0x42:
    return 'k';
  case 0x4B:
    return 'l';
  case 0x3A:
    return 'm';
  case 0x31:
    return 'n';
  case 0x44:
    return 'o';
  case 0x4D:
    return 'p';
  case 0x15:
    return 'q';
  case 0x2D:
    return 'r';
  case 0x1B:
    return 's';
  case 0x2C:
    return 't';
  case 0x3C:
    return 'u';
  case 0x2A:
    return 'v';
  case 0x1D:
    return 'w';
  case 0x22:
    return 'x';
  case 0x35:
    return 'y';
  case 0x1A:
    return 'z';
  case 0x45:
    return '0';
  case 0x16:
    return '1';
  case 0x1E:
    return '2';
  case 0x26:
    return '3';
  case 0x25:
    return '4';
  case 0x2E:
    return '5';
  case 0x36:
    return '6';
  case 0x3D:
    return '7';
  case 0x3E:
    return '8';
  case 0x46:
    return '9';
  case 0x5A:
    return '\n';
  case 0x29:
    return ' ';
  default:
    return '&';
  }
}


x86 assembly (clang, -O0):
<lookUpKBCode>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x2(%rbp)
movsbl -0x2(%rbp),%eax
add    $0xffffffeb,%eax
mov    %eax,%ecx
mov    %rcx,-0x10(%rbp)
sub    $0x45,%eax
ja     128a <lookUpKBCode+0x18a>
mov    -0x10(%rbp),%rax
lea    0xed5(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movb   $0x61,-0x1(%rbp)
jmp    128e <lookUpKBCode+0x18e>
movb   $0x62,-0x1(%rbp)
jmp    128e <lookUpKBCode+0x18e>
movb   $0x63,-0x1(%rbp)
jmp    128e <lookUpKBCode+0x18e>
movb   $0x64,-0x1(%rbp)
jmp    128e <lookUpKBCode+0x18e>
movb   $0x65,-0x1(%rbp)
jmp    128e <lookUpKBCode+0x18e>
movb   $0x66,-0x1(%rbp)
jmp    128e <lookUpKBCode+0x18e>
movb   $0x67,-0x1(%rbp)
jmp    128e <lookUpKBCode+0x18e>
movb   $0x68,-0x1(%rbp)
jmp    128e <lookUpKBCode+0x18e>
movb   $0x69,-0x1(%rbp)
jmp    128e <lookUpKBCode+0x18e>
movb   $0x6a,-0x1(%rbp)
jmp    128e <lookUpKBCode+0x18e>
movb   $0x6b,-0x1(%rbp)
jmp    128e <lookUpKBCode+0x18e>
movb   $0x6c,-0x1(%rbp)
jmp    128e <lookUpKBCode+0x18e>
movb   $0x6d,-0x1(%rbp)
jmp    128e <lookUpKBCode+0x18e>
movb   $0x6e,-0x1(%rbp)
jmp    128e <lookUpKBCode+0x18e>
movb   $0x6f,-0x1(%rbp)
jmp    128e <lookUpKBCode+0x18e>
movb   $0x70,-0x1(%rbp)
jmp    128e <lookUpKBCode+0x18e>
movb   $0x71,-0x1(%rbp)
jmp    128e <lookUpKBCode+0x18e>
movb   $0x72,-0x1(%rbp)
jmp    128e <lookUpKBCode+0x18e>
movb   $0x73,-0x1(%rbp)
jmp    128e <lookUpKBCode+0x18e>
movb   $0x74,-0x1(%rbp)
jmp    128e <lookUpKBCode+0x18e>
movb   $0x75,-0x1(%rbp)
jmp    128e <lookUpKBCode+0x18e>
movb   $0x76,-0x1(%rbp)
jmp    128e <lookUpKBCode+0x18e>
movb   $0x77,-0x1(%rbp)
jmp    128e <lookUpKBCode+0x18e>
movb   $0x78,-0x1(%rbp)
jmp    128e <lookUpKBCode+0x18e>
movb   $0x79,-0x1(%rbp)
jmp    128e <lookUpKBCode+0x18e>
movb   $0x7a,-0x1(%rbp)
jmp    128e <lookUpKBCode+0x18e>
movb   $0x30,-0x1(%rbp)
jmp    128e <lookUpKBCode+0x18e>
movb   $0x31,-0x1(%rbp)
jmp    128e <lookUpKBCode+0x18e>
movb   $0x32,-0x1(%rbp)
jmp    128e <lookUpKBCode+0x18e>
movb   $0x33,-0x1(%rbp)
jmp    128e <lookUpKBCode+0x18e>
movb   $0x34,-0x1(%rbp)
jmp    128e <lookUpKBCode+0x18e>
movb   $0x35,-0x1(%rbp)
jmp    128e <lookUpKBCode+0x18e>
movb   $0x36,-0x1(%rbp)
jmp    128e <lookUpKBCode+0x18e>
movb   $0x37,-0x1(%rbp)
jmp    128e <lookUpKBCode+0x18e>
movb   $0x38,-0x1(%rbp)
jmp    128e <lookUpKBCode+0x18e>
movb   $0x39,-0x1(%rbp)
jmp    128e <lookUpKBCode+0x18e>
movb   $0xa,-0x1(%rbp)
jmp    128e <lookUpKBCode+0x18e>
movb   $0x20,-0x1(%rbp)
jmp    128e <lookUpKBCode+0x18e>
movb   $0x26,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<lookUpKBCode>:
movslq %edi,%rcx
add    $0xffffffffffffffeb,%rcx
mov    $0x26,%al
cmp    $0x45,%ecx
ja     1118 <lookUpKBCode+0x18>
lea    0xeeb(%rip),%rax
mov    (%rcx,%rax,1),%al
ret

LLVM IR (-O0):
define signext i8 @lookUpKBCode(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 %44 [
i32 28, label %6
i32 50, label %7
i32 33, label %8
i32 35, label %9
i32 36, label %10
i32 43, label %11
i32 52, label %12
i32 51, label %13
i32 67, label %14
i32 59, label %15
i32 66, label %16
i32 75, label %17
i32 58, label %18
i32 49, label %19
i32 68, label %20
i32 77, label %21
i32 21, label %22
i32 45, label %23
i32 27, label %24
i32 44, label %25
i32 60, label %26
i32 42, label %27
i32 29, label %28
i32 34, label %29
i32 53, label %30
i32 26, label %31
i32 69, label %32
i32 22, label %33
i32 30, label %34
i32 38, label %35
i32 37, label %36
i32 46, label %37
i32 54, label %38
i32 61, label %39
i32 62, label %40
i32 70, label %41
i32 90, label %42
i32 41, label %43
]
6: ; preds = %1
store i8 97, i8* %2
br label %45
7: ; preds = %1
store i8 98, i8* %2
br label %45
8: ; preds = %1
store i8 99, i8* %2
br label %45
9: ; preds = %1
store i8 100, i8* %2
br label %45
10: ; preds = %1
store i8 101, i8* %2
br label %45
11: ; preds = %1
store i8 102, i8* %2
br label %45
12: ; preds = %1
store i8 103, i8* %2
br label %45
13: ; preds = %1
store i8 104, i8* %2
br label %45
14: ; preds = %1
store i8 105, i8* %2
br label %45
15: ; preds = %1
store i8 106, i8* %2
br label %45
16: ; preds = %1
store i8 107, i8* %2
br label %45
17: ; preds = %1
store i8 108, i8* %2
br label %45
18: ; preds = %1
store i8 109, i8* %2
br label %45
19: ; preds = %1
store i8 110, i8* %2
br label %45
20: ; preds = %1
store i8 111, i8* %2
br label %45
21: ; preds = %1
store i8 112, i8* %2
br label %45
22: ; preds = %1
store i8 113, i8* %2
br label %45
23: ; preds = %1
store i8 114, i8* %2
br label %45
24: ; preds = %1
store i8 115, i8* %2
br label %45
25: ; preds = %1
store i8 116, i8* %2
br label %45
26: ; preds = %1
store i8 117, i8* %2
br label %45
27: ; preds = %1
store i8 118, i8* %2
br label %45
28: ; preds = %1
store i8 119, i8* %2
br label %45
29: ; preds = %1
store i8 120, i8* %2
br label %45
30: ; preds = %1
store i8 121, i8* %2
br label %45
31: ; preds = %1
store i8 122, i8* %2
br label %45
32: ; preds = %1
store i8 48, i8* %2
br label %45
33: ; preds = %1
store i8 49, i8* %2
br label %45
34: ; preds = %1
store i8 50, i8* %2
br label %45
35: ; preds = %1
store i8 51, i8* %2
br label %45
36: ; preds = %1
store i8 52, i8* %2
br label %45
37: ; preds = %1
store i8 53, i8* %2
br label %45
38: ; preds = %1
store i8 54, i8* %2
br label %45
39: ; preds = %1
store i8 55, i8* %2
br label %45
40: ; preds = %1
store i8 56, i8* %2
br label %45
41: ; preds = %1
store i8 57, i8* %2
br label %45
42: ; preds = %1
store i8 10, i8* %2
br label %45
43: ; preds = %1
store i8 32, i8* %2
br label %45
44: ; preds = %1
store i8 38, i8* %2
br label %45
45: ; preds = %44, %43, %42, %41, %40, %39, %38, %37, %36, %35, %34, %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
%46 = load i8, i8* %2
ret i8 %46
}

LLVM IR (-O2):
@switch.table.lookUpKBCode = [70 x i8] c"q1&&&zsaw2&&cxde43&& vftr5&&nbhgy6&&&mju78&&&kio09&&&&l&p&&&&&&&&&&&&\0A"
define signext i8 @lookUpKBCode(i8 signext %0) {
%2 = sext i8 %0 to i32
%3 = add nsw i32 %2, -21
%4 = icmp ult i32 %3, 70
br i1 %4, label %5, label %9
5: ; preds = %1
%6 = sext i32 %3 to i64
%7 = getelementptr inbounds [70 x i8], [70 x i8]* @switch.table.lookUpKBCode, i64 0, i64 %6
%8 = load i8, i8* %7
br label %9
9: ; preds = %1, %5
%10 = phi i8 [ %8, %5 ], [ 38, %1 ]
ret i8 %10
}