char unescape_char(char c) {
  switch (c) {
  case '\'':
    return '\'';
  case '\"':
    return '\"';
  case '\\':
    return '\\';
  case 'a':
    return '\a';
  case 'b':
    return '\b';
  case 'e':
    return '\e';
  case 'f':
    return '\f';
  case 'n':
    return '\n';
  case 'r':
    return '\r';
  case 't':
    return '\t';
  case 'v':
    return '\v';
  }
  return 0;
}


x86 assembly (clang, -O0):
<unescape_char>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x2(%rbp)
movsbl -0x2(%rbp),%eax
add    $0xffffffde,%eax
mov    %eax,%ecx
mov    %rcx,-0x10(%rbp)
sub    $0x54,%eax
ja     1197 <unescape_char+0x97>
mov    -0x10(%rbp),%rax
lea    0xed5(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movb   $0x27,-0x1(%rbp)
jmp    119b <unescape_char+0x9b>
movb   $0x22,-0x1(%rbp)
jmp    119b <unescape_char+0x9b>
movb   $0x5c,-0x1(%rbp)
jmp    119b <unescape_char+0x9b>
movb   $0x7,-0x1(%rbp)
jmp    119b <unescape_char+0x9b>
movb   $0x8,-0x1(%rbp)
jmp    119b <unescape_char+0x9b>
movb   $0x1b,-0x1(%rbp)
jmp    119b <unescape_char+0x9b>
movb   $0xc,-0x1(%rbp)
jmp    119b <unescape_char+0x9b>
movb   $0xa,-0x1(%rbp)
jmp    119b <unescape_char+0x9b>
movb   $0xd,-0x1(%rbp)
jmp    119b <unescape_char+0x9b>
movb   $0x9,-0x1(%rbp)
jmp    119b <unescape_char+0x9b>
movb   $0xb,-0x1(%rbp)
jmp    119b <unescape_char+0x9b>
movb   $0x0,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<unescape_char>:
add    $0xffffffde,%edi
cmp    $0x54,%edi
ja     111d <unescape_char+0x1d>
mov    $0x27,%al
lea    0xeef(%rip),%rcx
movslq (%rcx,%rdi,4),%rdx
add    %rcx,%rdx
jmp    *%rdx
mov    $0x22,%al
ret
xor    %eax,%eax
ret
mov    $0x5c,%al
ret
mov    $0x7,%al
ret
mov    $0x8,%al
ret
mov    $0x1b,%al
ret
mov    $0xc,%al
ret
mov    $0xa,%al
ret
mov    $0xd,%al
ret
mov    $0x9,%al
ret
mov    $0xb,%al
ret

LLVM IR (-O0):
define signext i8 @unescape_char(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 %17 [
i32 39, label %6
i32 34, label %7
i32 92, label %8
i32 97, label %9
i32 98, label %10
i32 101, label %11
i32 102, label %12
i32 110, label %13
i32 114, label %14
i32 116, label %15
i32 118, label %16
]
6: ; preds = %1
store i8 39, i8* %2
br label %18
7: ; preds = %1
store i8 34, i8* %2
br label %18
8: ; preds = %1
store i8 92, i8* %2
br label %18
9: ; preds = %1
store i8 7, i8* %2
br label %18
10: ; preds = %1
store i8 8, i8* %2
br label %18
11: ; preds = %1
store i8 27, i8* %2
br label %18
12: ; preds = %1
store i8 12, i8* %2
br label %18
13: ; preds = %1
store i8 10, i8* %2
br label %18
14: ; preds = %1
store i8 13, i8* %2
br label %18
15: ; preds = %1
store i8 9, i8* %2
br label %18
16: ; preds = %1
store i8 11, i8* %2
br label %18
17: ; preds = %1
store i8 0, i8* %2
br label %18
18: ; preds = %17, %16, %15, %14, %13, %12, %11, %10, %9, %8, %7, %6
%19 = load i8, i8* %2
ret i8 %19
}

LLVM IR (-O2):
define signext i8 @unescape_char(i8 signext %0) {
%2 = sext i8 %0 to i32
switch i32 %2, label %13 [
i32 39, label %14
i32 34, label %3
i32 92, label %4
i32 97, label %5
i32 98, label %6
i32 101, label %7
i32 102, label %8
i32 110, label %9
i32 114, label %10
i32 116, label %11
i32 118, label %12
]
3: ; preds = %1
br label %14
4: ; preds = %1
br label %14
5: ; preds = %1
br label %14
6: ; preds = %1
br label %14
7: ; preds = %1
br label %14
8: ; preds = %1
br label %14
9: ; preds = %1
br label %14
10: ; preds = %1
br label %14
11: ; preds = %1
br label %14
12: ; preds = %1
br label %14
13: ; preds = %1
br label %14
14: ; preds = %1, %13, %12, %11, %10, %9, %8, %7, %6, %5, %4, %3
%15 = phi i8 [ 0, %13 ], [ 11, %12 ], [ 9, %11 ], [ 13, %10 ], [ 10, %9 ], [ 12, %8 ], [ 27, %7 ], [ 8, %6 ], [ 7, %5 ], [ 92, %4 ], [ 34, %3 ], [ 39, %1 ]
ret i8 %15
}