int json_parser_echar(unsigned char digit) {
  switch (digit) {
  case 'b':
    return ('\b');
  case 't':
    return ('\t');
  case 'n':
    return ('\n');
  case 'f':
    return ('\f');
  case 'r':
    return ('\r');
  case '\"':
    return ('\"');
  case '/':
    return ('/');
  case '\\':
    return ('\\');
  case 'u':
    return ('u');
  default:
    return (-1);
  }
}


x86 assembly (clang, -O0):
<json_parser_echar>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movzbl -0x5(%rbp),%eax
add    $0xffffffde,%eax
mov    %eax,%ecx
mov    %rcx,-0x10(%rbp)
sub    $0x53,%eax
ja     11a0 <json_parser_echar+0xa0>
mov    -0x10(%rbp),%rax
lea    0xed5(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movl   $0x8,-0x4(%rbp)
jmp    11a7 <json_parser_echar+0xa7>
movl   $0x9,-0x4(%rbp)
jmp    11a7 <json_parser_echar+0xa7>
movl   $0xa,-0x4(%rbp)
jmp    11a7 <json_parser_echar+0xa7>
movl   $0xc,-0x4(%rbp)
jmp    11a7 <json_parser_echar+0xa7>
movl   $0xd,-0x4(%rbp)
jmp    11a7 <json_parser_echar+0xa7>
movl   $0x22,-0x4(%rbp)
jmp    11a7 <json_parser_echar+0xa7>
movl   $0x2f,-0x4(%rbp)
jmp    11a7 <json_parser_echar+0xa7>
movl   $0x5c,-0x4(%rbp)
jmp    11a7 <json_parser_echar+0xa7>
movl   $0x75,-0x4(%rbp)
jmp    11a7 <json_parser_echar+0xa7>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<json_parser_echar>:
add    $0xde,%dil
cmp    $0x53,%dil
ja     1129 <json_parser_echar+0x29>
mov    $0x8,%eax
movzbl %dil,%ecx
lea    0xee6(%rip),%rdx
movslq (%rdx,%rcx,4),%rcx
add    %rdx,%rcx
jmp    *%rcx
mov    $0x22,%eax
ret
mov    $0xffffffff,%eax
ret
mov    $0x2f,%eax
ret
mov    $0x5c,%eax
ret
mov    $0xc,%eax
ret
mov    $0xa,%eax
ret
mov    $0xd,%eax
ret
mov    $0x9,%eax
ret
mov    $0x75,%eax
ret

LLVM IR (-O0):
define i32 @json_parser_echar(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 %15 [
i32 98, label %6
i32 116, label %7
i32 110, label %8
i32 102, label %9
i32 114, label %10
i32 34, label %11
i32 47, label %12
i32 92, label %13
i32 117, label %14
]
6: ; preds = %1
store i32 8, i32* %2
br label %16
7: ; preds = %1
store i32 9, i32* %2
br label %16
8: ; preds = %1
store i32 10, i32* %2
br label %16
9: ; preds = %1
store i32 12, i32* %2
br label %16
10: ; preds = %1
store i32 13, i32* %2
br label %16
11: ; preds = %1
store i32 34, i32* %2
br label %16
12: ; preds = %1
store i32 47, i32* %2
br label %16
13: ; preds = %1
store i32 92, i32* %2
br label %16
14: ; preds = %1
store i32 117, i32* %2
br label %16
15: ; preds = %1
store i32 -1, i32* %2
br label %16
16: ; preds = %15, %14, %13, %12, %11, %10, %9, %8, %7, %6
%17 = load i32, i32* %2
ret i32 %17
}

LLVM IR (-O2):
define i32 @json_parser_echar(i8 zeroext %0) {
switch i8 %0, label %10 [
i8 98, label %11
i8 116, label %2
i8 110, label %3
i8 102, label %4
i8 114, label %5
i8 34, label %6
i8 47, label %7
i8 92, label %8
i8 117, label %9
]
2: ; preds = %1
br label %11
3: ; preds = %1
br label %11
4: ; preds = %1
br label %11
5: ; preds = %1
br label %11
6: ; preds = %1
br label %11
7: ; preds = %1
br label %11
8: ; preds = %1
br label %11
9: ; preds = %1
br label %11
10: ; preds = %1
br label %11
11: ; preds = %1, %10, %9, %8, %7, %6, %5, %4, %3, %2
%12 = phi i32 [ -1, %10 ], [ 117, %9 ], [ 92, %8 ], [ 47, %7 ], [ 34, %6 ], [ 13, %5 ], [ 12, %4 ], [ 10, %3 ], [ 9, %2 ], [ 8, %1 ]
ret i32 %12
}