int serdisp_goldelox_translate_rescode(unsigned char code) {
  switch (code) {
  case 0x22:
    return 220;
  case 0x28:
    return 128;
  case 0x32:
    return 320;
  case 0x60:
    return 160;
  case 0x64:
    return 64;
  case 0x76:
    return 176;
  case 0x96:
    return 96;
  default:
    return 0;
  }
}


x86 assembly (clang, -O0):
<serdisp_goldelox_translate_rescode>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movzbl -0x5(%rbp),%eax
mov    %eax,-0xc(%rbp)
sub    $0x22,%eax
je     1187 <serdisp_goldelox_translate_rescode+0x87>
jmp    111f <serdisp_goldelox_translate_rescode+0x1f>
mov    -0xc(%rbp),%eax
sub    $0x28,%eax
je     1193 <serdisp_goldelox_translate_rescode+0x93>
jmp    1130 <serdisp_goldelox_translate_rescode+0x30>
mov    -0xc(%rbp),%eax
sub    $0x32,%eax
je     119f <serdisp_goldelox_translate_rescode+0x9f>
jmp    1141 <serdisp_goldelox_translate_rescode+0x41>
mov    -0xc(%rbp),%eax
sub    $0x60,%eax
je     11ab <serdisp_goldelox_translate_rescode+0xab>
jmp    1152 <serdisp_goldelox_translate_rescode+0x52>
mov    -0xc(%rbp),%eax
sub    $0x64,%eax
je     11b7 <serdisp_goldelox_translate_rescode+0xb7>
jmp    1163 <serdisp_goldelox_translate_rescode+0x63>
mov    -0xc(%rbp),%eax
sub    $0x76,%eax
je     11c3 <serdisp_goldelox_translate_rescode+0xc3>
jmp    1174 <serdisp_goldelox_translate_rescode+0x74>
mov    -0xc(%rbp),%eax
sub    $0x96,%eax
je     11cf <serdisp_goldelox_translate_rescode+0xcf>
jmp    11db <serdisp_goldelox_translate_rescode+0xdb>
movl   $0xdc,-0x4(%rbp)
jmp    11e2 <serdisp_goldelox_translate_rescode+0xe2>
movl   $0x80,-0x4(%rbp)
jmp    11e2 <serdisp_goldelox_translate_rescode+0xe2>
movl   $0x140,-0x4(%rbp)
jmp    11e2 <serdisp_goldelox_translate_rescode+0xe2>
movl   $0xa0,-0x4(%rbp)
jmp    11e2 <serdisp_goldelox_translate_rescode+0xe2>
movl   $0x40,-0x4(%rbp)
jmp    11e2 <serdisp_goldelox_translate_rescode+0xe2>
movl   $0xb0,-0x4(%rbp)
jmp    11e2 <serdisp_goldelox_translate_rescode+0xe2>
movl   $0x60,-0x4(%rbp)
jmp    11e2 <serdisp_goldelox_translate_rescode+0xe2>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<serdisp_goldelox_translate_rescode>:
cmp    $0x31,%dil
jle    111e <serdisp_goldelox_translate_rescode+0x1e>
cmp    $0x63,%dil
jg     1136 <serdisp_goldelox_translate_rescode+0x36>
cmp    $0x32,%dil
je     1148 <serdisp_goldelox_translate_rescode+0x48>
cmp    $0x60,%dil
jne    115a <serdisp_goldelox_translate_rescode+0x5a>
mov    $0xa0,%eax
ret
cmp    $0x96,%dil
je     114e <serdisp_goldelox_translate_rescode+0x4e>
cmp    $0x22,%dil
je     115d <serdisp_goldelox_translate_rescode+0x5d>
cmp    $0x28,%dil
jne    115a <serdisp_goldelox_translate_rescode+0x5a>
mov    $0x80,%eax
ret
cmp    $0x64,%dil
je     1154 <serdisp_goldelox_translate_rescode+0x54>
cmp    $0x76,%dil
jne    115a <serdisp_goldelox_translate_rescode+0x5a>
mov    $0xb0,%eax
ret
mov    $0x140,%eax
ret
mov    $0x60,%eax
ret
mov    $0x40,%eax
ret
xor    %eax,%eax
ret
mov    $0xdc,%eax
ret

LLVM IR (-O0):
define i32 @serdisp_goldelox_translate_rescode(i8 zeroext %0) {
%2 = alloca i32
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = zext i8 %4 to i32
switch i32 %5, label %13 [
i32 34, label %6
i32 40, label %7
i32 50, label %8
i32 96, label %9
i32 100, label %10
i32 118, label %11
i32 150, label %12
]
6: ; preds = %1
store i32 220, i32* %2
br label %14
7: ; preds = %1
store i32 128, i32* %2
br label %14
8: ; preds = %1
store i32 320, i32* %2
br label %14
9: ; preds = %1
store i32 160, i32* %2
br label %14
10: ; preds = %1
store i32 64, i32* %2
br label %14
11: ; preds = %1
store i32 176, i32* %2
br label %14
12: ; preds = %1
store i32 96, i32* %2
br label %14
13: ; preds = %1
store i32 0, i32* %2
br label %14
14: ; preds = %13, %12, %11, %10, %9, %8, %7, %6
%15 = load i32, i32* %2
ret i32 %15
}

LLVM IR (-O2):
define i32 @serdisp_goldelox_translate_rescode(i8 zeroext %0) {
switch i8 %0, label %8 [
i8 34, label %9
i8 40, label %2
i8 50, label %3
i8 96, label %4
i8 100, label %5
i8 118, label %6
i8 -106, label %7
]
2: ; preds = %1
br label %9
3: ; preds = %1
br label %9
4: ; preds = %1
br label %9
5: ; preds = %1
br label %9
6: ; preds = %1
br label %9
7: ; preds = %1
br label %9
8: ; preds = %1
br label %9
9: ; preds = %1, %8, %7, %6, %5, %4, %3, %2
%10 = phi i32 [ 0, %8 ], [ 96, %7 ], [ 176, %6 ], [ 64, %5 ], [ 160, %4 ], [ 320, %3 ], [ 128, %2 ], [ 220, %1 ]
ret i32 %10
}