#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*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int getchar();
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ putchar(int);
int escape_sequence(void) {
  int c;
  c = getchar();
  switch (c) {
  case '\\':
  case '\'':
  case 'n':
  case 't':
  case 'a':
  case 'b':
  case 'v':
  case '"':
  case '?':
  case '0':
    putchar('\\');
    putchar(c);
    return 0;
  default:
    printf("\nEscape Sequence unknown\n");
    exit(EXIT_FAILURE);
  }
}


x86 assembly (clang, -O0):
<escape_sequence>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
xor    %eax,%eax
call   1050 <getchar@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0xffffffde,%eax
mov    %eax,%ecx
mov    %rcx,-0x10(%rbp)
sub    $0x54,%eax
ja     1195 <escape_sequence+0x55>
mov    -0x10(%rbp),%rax
lea    0xe8e(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    $0x5c,%edi
call   1030 <putchar@plt>
mov    -0x4(%rbp),%edi
call   1030 <putchar@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret
lea    0xfb8(%rip),%rdi
call   1040 <printf@plt>
mov    0x2e38(%rip),%rax
mov    (%rax),%edi
call   1060 <exit@plt>

x86 assembly (clang, -O2):
<escape_sequence>:
push   %rbx
xor    %eax,%eax
call   1050 <getchar@plt>
mov    %eax,%ebx
lea    -0x22(%rbx),%eax
cmp    $0x54,%eax
ja     1177 <escape_sequence+0x37>
lea    0xea7(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    $0x5c,%edi
call   1030 <putchar@plt>
mov    %ebx,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
pop    %rbx
ret
lea    0xfd6(%rip),%rdi
call   1040 <puts@plt>
mov    0x2e56(%rip),%rax
mov    (%rax),%edi
call   1060 <exit@plt>

LLVM IR (-O0):
@.str = [26 x i8] c"\0AEscape Sequence unknown\0A\00"
@EXIT_FAILURE = global i32 0
define i32 @escape_sequence() {
%1 = alloca i32
%2 = call i32 (...) @getchar()
store i32 %2, i32* %1
%3 = load i32, i32* %1
switch i32 %3, label %8 [
i32 92, label %4
i32 39, label %4
i32 110, label %4
i32 116, label %4
i32 97, label %4
i32 98, label %4
i32 118, label %4
i32 34, label %4
i32 63, label %4
i32 48, label %4
]
4: ; preds = %0, %0, %0, %0, %0, %0, %0, %0, %0, %0
%5 = call i32 @putchar(i32 92)
%6 = load i32, i32* %1
%7 = call i32 @putchar(i32 %6)
ret i32 0
8: ; preds = %0
%9 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
%10 = load i32, i32* @EXIT_FAILURE
%11 = call i32 @exit(i32 %10)
unreachable
}

LLVM IR (-O2):
@EXIT_FAILURE = global i32 0
@str = [25 x i8] c"\0AEscape Sequence unknown\00"
define i32 @escape_sequence() {
%1 = tail call i32 (...) @getchar()
switch i32 %1, label %5 [
i32 92, label %2
i32 39, label %2
i32 110, label %2
i32 116, label %2
i32 97, label %2
i32 98, label %2
i32 118, label %2
i32 34, label %2
i32 63, label %2
i32 48, label %2
]
2: ; preds = %0, %0, %0, %0, %0, %0, %0, %0, %0, %0
%3 = tail call i32 @putchar(i32 92)
%4 = tail call i32 @putchar(i32 %1)
ret i32 0
5: ; preds = %0
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @str, i64 0, i64 0))
%7 = load i32, i32* @EXIT_FAILURE
%8 = tail call i32 @exit(i32 %7)
unreachable
}