#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 */
char EOF;
char getchar();
int /*<<< orphan*/ printf(char *, ...);
int main(int argc, char **argv) {
  char c;
  while ((c = getchar()) != EOF) {
    if (c == '\n') {
      printf("\\n");
    } else if (c == '\b') {
      printf("\\b");
    } else if (c == '\t') {
      printf("\\t");
    } else if (c == '\\') {
      printf("\\\\");
    } else {
      printf("%c", c);
    }
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %al,-0x11(%rbp)
movsbl %al,%eax
mov    0x2e9e(%rip),%rcx
movsbl (%rcx),%ecx
cmp    %ecx,%eax
je     11fb <main+0xdb>
movsbl -0x11(%rbp),%eax
cmp    $0xa,%eax
jne    1175 <main+0x55>
lea    0xe97(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11f6 <main+0xd6>
movsbl -0x11(%rbp),%eax
cmp    $0x8,%eax
jne    1195 <main+0x75>
lea    0xe7a(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11f1 <main+0xd1>
movsbl -0x11(%rbp),%eax
cmp    $0x9,%eax
jne    11b5 <main+0x95>
lea    0xe5d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11ec <main+0xcc>
movsbl -0x11(%rbp),%eax
cmp    $0x5c,%eax
jne    11d5 <main+0xb5>
lea    0xe40(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11e7 <main+0xc7>
movsbl -0x11(%rbp),%esi
lea    0xe2c(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11ec <main+0xcc>
jmp    11f1 <main+0xd1>
jmp    11f6 <main+0xd6>
jmp    1136 <main+0x16>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
xor    %eax,%eax
call   1050 <getchar@plt>
mov    0x2ea1(%rip),%rbx
cmp    (%rbx),%al
jne    1157 <main+0x27>
xor    %eax,%eax
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret
lea    0xea5(%rip),%r14
lea    0xea1(%rip),%r15
lea    0xe9d(%rip),%r12
lea    0xe8d(%rip),%r13
jmp    1195 <main+0x65>
cs nopw 0x0(%rax,%rax,1)
nop
mov    %r12,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
call   1050 <getchar@plt>
cmp    (%rbx),%al
je     114b <main+0x1b>
cmp    $0x9,%al
jg     11b0 <main+0x80>
cmp    $0x8,%al
je     11c0 <main+0x90>
cmp    $0x9,%al
jne    11d0 <main+0xa0>
mov    %r15,%rdi
jmp    1183 <main+0x53>
cs nopw 0x0(%rax,%rax,1)
cmp    $0x5c,%al
je     1180 <main+0x50>
cmp    $0xa,%al
jne    11d0 <main+0xa0>
mov    %r13,%rdi
jmp    1183 <main+0x53>
nopl   (%rax)
mov    %r14,%rdi
jmp    1183 <main+0x53>
cs nopw 0x0(%rax,%rax,1)
nop
movsbl %al,%edi
call   1030 <putchar@plt>
jmp    118a <main+0x5a>

LLVM IR (-O0):
@EOF = global i8 0
@.str = [3 x i8] c"\\n\00"
@.str.1 = [3 x i8] c"\\b\00"
@.str.2 = [3 x i8] c"\\t\00"
@.str.3 = [3 x i8] c"\\\\\00"
@.str.4 = [3 x i8] c"%c\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
br label %7
7: ; preds = %44, %2
%8 = call signext i8 (...) @getchar()
store i8 %8, i8* %6
%9 = sext i8 %8 to i32
%10 = load i8, i8* @EOF
%11 = sext i8 %10 to i32
%12 = icmp ne i32 %9, %11
br i1 %12, label %13, label %45
13: ; preds = %7
%14 = load i8, i8* %6
%15 = sext i8 %14 to i32
%16 = icmp eq i32 %15, 10
br i1 %16, label %17, label %19
17: ; preds = %13
%18 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
br label %44
19: ; preds = %13
%20 = load i8, i8* %6
%21 = sext i8 %20 to i32
%22 = icmp eq i32 %21, 8
br i1 %22, label %23, label %25
23: ; preds = %19
%24 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
br label %43
25: ; preds = %19
%26 = load i8, i8* %6
%27 = sext i8 %26 to i32
%28 = icmp eq i32 %27, 9
br i1 %28, label %29, label %31
29: ; preds = %25
%30 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
br label %42
31: ; preds = %25
%32 = load i8, i8* %6
%33 = sext i8 %32 to i32
%34 = icmp eq i32 %33, 92
br i1 %34, label %35, label %37
35: ; preds = %31
%36 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0))
br label %41
37: ; preds = %31
%38 = load i8, i8* %6
%39 = sext i8 %38 to i32
%40 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i32 %39)
br label %41
41: ; preds = %37, %35
br label %42
42: ; preds = %41, %29
br label %43
43: ; preds = %42, %23
br label %44
44: ; preds = %43, %17
br label %7
45: ; preds = %7
%46 = load i32, i32* %3
ret i32 %46
}

LLVM IR (-O2):
@EOF = global i8 0
@.str = [3 x i8] c"\\n\00"
@.str.1 = [3 x i8] c"\\b\00"
@.str.2 = [3 x i8] c"\\t\00"
@.str.3 = [3 x i8] c"\\\\\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call signext i8 (...) @getchar()
%4 = load i8, i8* @EOF
%5 = icmp eq i8 %3, %4
br i1 %5, label %23, label %6
6: ; preds = %2, %19
%7 = phi i8 [ %20, %19 ], [ %3, %2 ]
switch i8 %7, label %16 [
i8 10, label %8
i8 8, label %10
i8 9, label %12
i8 92, label %14
]
8: ; preds = %6
%9 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
br label %19
10: ; preds = %6
%11 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
br label %19
12: ; preds = %6
%13 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
br label %19
14: ; preds = %6
%15 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0))
br label %19
16: ; preds = %6
%17 = sext i8 %7 to i32
%18 = tail call i32 @putchar(i32 %17)
br label %19
19: ; preds = %10, %14, %16, %12, %8
%20 = tail call signext i8 (...) @getchar()
%21 = load i8, i8* @EOF
%22 = icmp eq i8 %20, %21
br i1 %22, label %23, label %6
23: ; preds = %19, %2
ret i32 0
}