#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */

/* Variables and functions */
int /*<<< orphan*/ note(char *);
int simple_c_escape(int symbol) {
  switch (symbol) {
  case 'n':
    symbol = 10;
    break;
  case 'r':
    symbol = 13;
    break;
  case 't':
    symbol = 9;
    break;
  case 'v':
    symbol = 11;
    break;
  case 'f':
    symbol = 12;
    break;
  case 'b':
    symbol = 8;
    break;
  case 'a':
    symbol = 7;
    break;
  case '\"':
  case '\'':
  case '\\':
    break;
  default:
    note("extra \\escape value in line");
  }
  return symbol;
}


x86 assembly (clang, -O0):
<simple_c_escape>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0xffffffde,%eax
mov    %eax,%ecx
mov    %rcx,-0x10(%rbp)
sub    $0x54,%eax
ja     119d <simple_c_escape+0x8d>
mov    -0x10(%rbp),%rax
lea    0xec5(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movl   $0xa,-0x4(%rbp)
jmp    11a9 <simple_c_escape+0x99>
movl   $0xd,-0x4(%rbp)
jmp    11a9 <simple_c_escape+0x99>
movl   $0x9,-0x4(%rbp)
jmp    11a9 <simple_c_escape+0x99>
movl   $0xb,-0x4(%rbp)
jmp    11a9 <simple_c_escape+0x99>
movl   $0xc,-0x4(%rbp)
jmp    11a9 <simple_c_escape+0x99>
movl   $0x8,-0x4(%rbp)
jmp    11a9 <simple_c_escape+0x99>
movl   $0x7,-0x4(%rbp)
jmp    11a9 <simple_c_escape+0x99>
jmp    11a9 <simple_c_escape+0x99>
lea    0xfb0(%rip),%rdi
call   1030 <note@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<simple_c_escape>:
push   %rbx
mov    %edi,%ebx
lea    -0x22(%rbx),%eax
cmp    $0x54,%eax
ja     1132 <simple_c_escape+0x22>
lea    0xede(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    $0x7,%ebx
jmp    1168 <simple_c_escape+0x58>
lea    0x101b(%rip),%rdi
call   1030 <note@plt>
jmp    1168 <simple_c_escape+0x58>
mov    $0x8,%ebx
jmp    1168 <simple_c_escape+0x58>
mov    $0xc,%ebx
jmp    1168 <simple_c_escape+0x58>
mov    $0xa,%ebx
jmp    1168 <simple_c_escape+0x58>
mov    $0xd,%ebx
jmp    1168 <simple_c_escape+0x58>
mov    $0x9,%ebx
jmp    1168 <simple_c_escape+0x58>
mov    $0xb,%ebx
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [28 x i8] c"extra \\escape value in line\00"
define i32 @simple_c_escape(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
switch i32 %3, label %12 [
i32 110, label %4
i32 114, label %5
i32 116, label %6
i32 118, label %7
i32 102, label %8
i32 98, label %9
i32 97, label %10
i32 34, label %11
i32 39, label %11
i32 92, label %11
]
4: ; preds = %1
store i32 10, i32* %2
br label %14
5: ; preds = %1
store i32 13, i32* %2
br label %14
6: ; preds = %1
store i32 9, i32* %2
br label %14
7: ; preds = %1
store i32 11, i32* %2
br label %14
8: ; preds = %1
store i32 12, i32* %2
br label %14
9: ; preds = %1
store i32 8, i32* %2
br label %14
10: ; preds = %1
store i32 7, i32* %2
br label %14
11: ; preds = %1, %1, %1
br label %14
12: ; preds = %1
%13 = call i32 @note(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
br label %14
14: ; preds = %12, %11, %10, %9, %8, %7, %6, %5, %4
%15 = load i32, i32* %2
ret i32 %15
}

LLVM IR (-O2):
@.str = [28 x i8] c"extra \\escape value in line\00"
define i32 @simple_c_escape(i32 %0) {
switch i32 %0, label %9 [
i32 110, label %2
i32 114, label %3
i32 116, label %4
i32 118, label %5
i32 102, label %6
i32 98, label %7
i32 97, label %8
i32 34, label %11
i32 39, label %11
i32 92, label %11
]
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
%10 = tail call i32 @note(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
br label %11
11: ; preds = %1, %1, %1, %9, %8, %7, %6, %5, %4, %3, %2
%12 = phi i32 [ %0, %9 ], [ %0, %1 ], [ %0, %1 ], [ %0, %1 ], [ 7, %8 ], [ 8, %7 ], [ 12, %6 ], [ 11, %5 ], [ 9, %4 ], [ 13, %3 ], [ 10, %2 ]
ret i32 %12
}