char read_lit_char(char *c) {
  switch (c[1]) {
  case '\\':
    switch (c[2]) {
    case 'a':
      return '\a';
      break;
    case 'b':
      return '\b';
      break;
    case 'f':
      return '\f';
      break;
    case 'n':
      return '\n';
      break;
    case 'r':
      return '\r';
      break;
    case 't':
      return '\t';
      break;
    case 'v':
      return '\v';
      break;
    case '\'':
      return '\'';
      break;
    case '\"':
      return '\"';
      break;
    case '\\':
      return '\\';
      break;
    case '?':
      return '\?';
      break;
    default:
      break;
    }
    break;
  default:
    return c[1];
    break;
  }
}


x86 assembly (clang, -O0):
<read_lit_char>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    0x1(%rax),%al
sub    $0x5c,%al
jne    11b7 <read_lit_char+0xb7>
jmp    111c <read_lit_char+0x1c>
mov    -0x10(%rbp),%rax
movsbl 0x2(%rax),%eax
add    $0xffffffde,%eax
mov    %eax,%ecx
mov    %rcx,-0x18(%rbp)
sub    $0x54,%eax
ja     11ad <read_lit_char+0xad>
mov    -0x18(%rbp),%rax
lea    0xebf(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movb   $0x7,-0x1(%rbp)
jmp    11c1 <read_lit_char+0xc1>
movb   $0x8,-0x1(%rbp)
jmp    11c1 <read_lit_char+0xc1>
movb   $0xc,-0x1(%rbp)
jmp    11c1 <read_lit_char+0xc1>
movb   $0xa,-0x1(%rbp)
jmp    11c1 <read_lit_char+0xc1>
movb   $0xd,-0x1(%rbp)
jmp    11c1 <read_lit_char+0xc1>
movb   $0x9,-0x1(%rbp)
jmp    11c1 <read_lit_char+0xc1>
movb   $0xb,-0x1(%rbp)
jmp    11c1 <read_lit_char+0xc1>
movb   $0x27,-0x1(%rbp)
jmp    11c1 <read_lit_char+0xc1>
movb   $0x22,-0x1(%rbp)
jmp    11c1 <read_lit_char+0xc1>
movb   $0x5c,-0x1(%rbp)
jmp    11c1 <read_lit_char+0xc1>
movb   $0x3f,-0x1(%rbp)
jmp    11c1 <read_lit_char+0xc1>
jmp    11b2 <read_lit_char+0xb2>
jmp    11c1 <read_lit_char+0xc1>
mov    -0x10(%rbp),%rax
mov    0x1(%rax),%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_lit_char>:
mov    0x1(%rdi),%al
cmp    $0x5c,%al
jne    112d <read_lit_char+0x2d>
movsbl 0x2(%rdi),%ecx
mov    $0x7,%al
add    $0xffffffde,%ecx
cmp    $0x54,%ecx
ja     112d <read_lit_char+0x2d>
lea    0xee4(%rip),%rdx
movslq (%rdx,%rcx,4),%rcx
add    %rdx,%rcx
jmp    *%rcx
mov    $0x22,%al
ret
mov    $0x27,%al
ret
mov    $0x3f,%al
ret
mov    $0x5c,%al
ret
mov    $0x8,%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 @read_lit_char(i8* %0) {
%2 = alloca i8
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = getelementptr inbounds i8, i8* %4, i64 1
%6 = load i8, i8* %5
%7 = sext i8 %6 to i32
switch i32 %7, label %26 [
i32 92, label %8
]
8: ; preds = %1
%9 = load i8*, i8** %3
%10 = getelementptr inbounds i8, i8* %9, i64 2
%11 = load i8, i8* %10
%12 = sext i8 %11 to i32
switch i32 %12, label %24 [
i32 97, label %13
i32 98, label %14
i32 102, label %15
i32 110, label %16
i32 114, label %17
i32 116, label %18
i32 118, label %19
i32 39, label %20
i32 34, label %21
i32 92, label %22
i32 63, label %23
]
13: ; preds = %8
store i8 7, i8* %2
br label %30
14: ; preds = %8
store i8 8, i8* %2
br label %30
15: ; preds = %8
store i8 12, i8* %2
br label %30
16: ; preds = %8
store i8 10, i8* %2
br label %30
17: ; preds = %8
store i8 13, i8* %2
br label %30
18: ; preds = %8
store i8 9, i8* %2
br label %30
19: ; preds = %8
store i8 11, i8* %2
br label %30
20: ; preds = %8
store i8 39, i8* %2
br label %30
21: ; preds = %8
store i8 34, i8* %2
br label %30
22: ; preds = %8
store i8 92, i8* %2
br label %30
23: ; preds = %8
store i8 63, i8* %2
br label %30
24: ; preds = %8
br label %25
25: ; preds = %24
br label %30
26: ; preds = %1
%27 = load i8*, i8** %3
%28 = getelementptr inbounds i8, i8* %27, i64 1
%29 = load i8, i8* %28
store i8 %29, i8* %2
br label %30
30: ; preds = %13, %14, %15, %16, %17, %18, %19, %20, %21, %22, %23, %26, %25
%31 = load i8, i8* %2
ret i8 %31
}

LLVM IR (-O2):
define signext i8 @read_lit_char(i8* nocapture %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 1
%3 = load i8, i8* %2
%4 = icmp eq i8 %3, 92
br i1 %4, label %5, label %19
5: ; preds = %1
%6 = getelementptr inbounds i8, i8* %0, i64 2
%7 = load i8, i8* %6
%8 = sext i8 %7 to i32
switch i32 %8, label %19 [
i32 63, label %18
i32 98, label %9
i32 102, label %10
i32 110, label %11
i32 114, label %12
i32 116, label %13
i32 118, label %14
i32 39, label %15
i32 34, label %16
i32 92, label %17
]
9: ; preds = %5
br label %19
10: ; preds = %5
br label %19
11: ; preds = %5
br label %19
12: ; preds = %5
br label %19
13: ; preds = %5
br label %19
14: ; preds = %5
br label %19
15: ; preds = %5
br label %19
16: ; preds = %5
br label %19
17: ; preds = %5
br label %19
18: ; preds = %5
br label %19
19: ; preds = %1, %5, %9, %10, %11, %12, %13, %14, %15, %16, %17, %18
%20 = phi i8 [ 63, %18 ], [ 92, %17 ], [ 34, %16 ], [ 39, %15 ], [ 11, %14 ], [ 9, %13 ], [ 13, %12 ], [ 10, %11 ], [ 12, %10 ], [ 8, %9 ], [ 7, %5 ], [ %3, %1 ]
ret i8 %20
}