__attribute__((visibility("default"))) char fcitx_utils_escape_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_escape_char>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x2(%rbp)
movsbl -0x2(%rbp),%eax
add    $0xfffffff9,%eax
mov    %eax,%ecx
mov    %rcx,-0x10(%rbp)
sub    $0x14,%eax
ja     117c <fcitx_utils_escape_char+0x7c>
mov    -0x10(%rbp),%rax
lea    0xed5(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movb   $0x61,-0x1(%rbp)
jmp    1182 <fcitx_utils_escape_char+0x82>
movb   $0x62,-0x1(%rbp)
jmp    1182 <fcitx_utils_escape_char+0x82>
movb   $0x66,-0x1(%rbp)
jmp    1182 <fcitx_utils_escape_char+0x82>
movb   $0x6e,-0x1(%rbp)
jmp    1182 <fcitx_utils_escape_char+0x82>
movb   $0x72,-0x1(%rbp)
jmp    1182 <fcitx_utils_escape_char+0x82>
movb   $0x74,-0x1(%rbp)
jmp    1182 <fcitx_utils_escape_char+0x82>
movb   $0x65,-0x1(%rbp)
jmp    1182 <fcitx_utils_escape_char+0x82>
movb   $0x76,-0x1(%rbp)
jmp    1182 <fcitx_utils_escape_char+0x82>
mov    -0x2(%rbp),%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fcitx_utils_escape_char>:
lea    -0x7(%rdi),%ecx
cmp    $0x14,%ecx
ja     112c <fcitx_utils_escape_char+0x2c>
mov    $0x61,%al
lea    0xeef(%rip),%rdx
movslq (%rdx,%rcx,4),%rcx
add    %rdx,%rcx
jmp    *%rcx
mov    $0x62,%al
ret
mov    $0x74,%al
ret
mov    $0x6e,%al
ret
mov    $0x76,%al
ret
mov    $0x66,%al
ret
mov    $0x72,%al
ret
mov    %edi,%eax
ret
mov    $0x65,%al
ret

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