__attribute__((visibility("default"))) char fcitx_utils_unescape_char(char c) {
  switch (c) {
  case 'a':
    return '\a';
  case 'b':
    return '\b';
  case 'f':
    return '\f';
  case 'n':
    return '\n';
  case 'r':
    return '\r';
  case 't':
    return '\t';
  case 'e':
    return '\e';
  case 'v':
    return '\v';
  }
  return c;
}


x86 assembly (clang, -O0):
<fcitx_utils_unescape_char>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x2(%rbp)
movsbl -0x2(%rbp),%eax
add    $0xffffff9f,%eax
mov    %eax,%ecx
mov    %rcx,-0x10(%rbp)
sub    $0x15,%eax
ja     117c <fcitx_utils_unescape_char+0x7c>
mov    -0x10(%rbp),%rax
lea    0xed5(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movb   $0x7,-0x1(%rbp)
jmp    1182 <fcitx_utils_unescape_char+0x82>
movb   $0x8,-0x1(%rbp)
jmp    1182 <fcitx_utils_unescape_char+0x82>
movb   $0xc,-0x1(%rbp)
jmp    1182 <fcitx_utils_unescape_char+0x82>
movb   $0xa,-0x1(%rbp)
jmp    1182 <fcitx_utils_unescape_char+0x82>
movb   $0xd,-0x1(%rbp)
jmp    1182 <fcitx_utils_unescape_char+0x82>
movb   $0x9,-0x1(%rbp)
jmp    1182 <fcitx_utils_unescape_char+0x82>
movb   $0x1b,-0x1(%rbp)
jmp    1182 <fcitx_utils_unescape_char+0x82>
movb   $0xb,-0x1(%rbp)
jmp    1182 <fcitx_utils_unescape_char+0x82>
mov    -0x2(%rbp),%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fcitx_utils_unescape_char>:
lea    -0x61(%rdi),%ecx
cmp    $0x15,%ecx
ja     111d <fcitx_utils_unescape_char+0x1d>
mov    $0x7,%al
lea    0xeef(%rip),%rdx
movslq (%rdx,%rcx,4),%rcx
add    %rdx,%rcx
jmp    *%rcx
mov    $0x8,%al
ret
mov    %edi,%eax
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 @fcitx_utils_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 %14 [
i32 97, label %6
i32 98, label %7
i32 102, label %8
i32 110, label %9
i32 114, label %10
i32 116, label %11
i32 101, label %12
i32 118, label %13
]
6: ; preds = %1
store i8 7, i8* %2
br label %16
7: ; preds = %1
store i8 8, i8* %2
br label %16
8: ; preds = %1
store i8 12, i8* %2
br label %16
9: ; preds = %1
store i8 10, i8* %2
br label %16
10: ; preds = %1
store i8 13, i8* %2
br label %16
11: ; preds = %1
store i8 9, i8* %2
br label %16
12: ; preds = %1
store i8 27, i8* %2
br label %16
13: ; preds = %1
store i8 11, i8* %2
br label %16
14: ; preds = %1
%15 = load i8, i8* %3
store i8 %15, i8* %2
br label %16
16: ; preds = %14, %13, %12, %11, %10, %9, %8, %7, %6
%17 = load i8, i8* %2
ret i8 %17
}

LLVM IR (-O2):
define signext i8 @fcitx_utils_unescape_char(i8 signext %0) {
%2 = sext i8 %0 to i32
switch i32 %2, label %10 [
i32 97, label %11
i32 98, label %3
i32 102, label %4
i32 110, label %5
i32 114, label %6
i32 116, label %7
i32 101, label %8
i32 118, label %9
]
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
%12 = phi i8 [ %0, %10 ], [ 11, %9 ], [ 27, %8 ], [ 9, %7 ], [ 13, %6 ], [ 10, %5 ], [ 12, %4 ], [ 8, %3 ], [ 7, %1 ]
ret i8 %12
}