#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 EOF;
int getchar();
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ putchar(int);
int main(int arc, char *argv[]) {
  int c = 0;
  while ((c = getchar()) != EOF) {
    if (c == '\t') {
      printf("\\t");
      continue;
    }
    if (c == '\b') {
      printf("\\b");
      continue;
    }
    if (c == '\\') {
      printf("\\\\");
      continue;
    }
    putchar(c);
  }
  return 0;
}


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)
movl   $0x0,-0x14(%rbp)
mov    $0x0,%al
call   1050 <getchar@plt>
mov    %eax,-0x14(%rbp)
mov    0x2e8a(%rip),%rcx
cmp    (%rcx),%eax
je     11c4 <main+0x94>
cmpl   $0x9,-0x14(%rbp)
jne    1181 <main+0x51>
lea    0xe89(%rip),%rdi
call   1040 <printf@plt>
jmp    114d <main+0x1d>
cmpl   $0x8,-0x14(%rbp)
jne    119c <main+0x6c>
lea    0xe71(%rip),%rdi
call   1040 <printf@plt>
jmp    114d <main+0x1d>
cmpl   $0x5c,-0x14(%rbp)
jne    11b7 <main+0x87>
lea    0xe59(%rip),%rdi
call   1040 <printf@plt>
jmp    114d <main+0x1d>
mov    -0x14(%rbp),%edi
call   1030 <putchar@plt>
jmp    114d <main+0x1d>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
xor    %eax,%eax
call   1050 <getchar@plt>
mov    0x2ea2(%rip),%rbx
cmp    (%rbx),%eax
jne    1158 <main+0x28>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret
lea    0xea4(%rip),%r14
lea    0xea0(%rip),%r12
lea    0xe93(%rip),%r15
jmp    1183 <main+0x53>
nop
mov    %r12,%rdi
call   1040 <printf@plt>
xor    %eax,%eax
call   1050 <getchar@plt>
cmp    (%rbx),%eax
je     114a <main+0x1a>
cmp    $0x8,%eax
je     11a0 <main+0x70>
cmp    $0x5c,%eax
je     1170 <main+0x40>
cmp    $0x9,%eax
jne    11b0 <main+0x80>
mov    %r15,%rdi
jmp    1173 <main+0x43>
nopw   0x0(%rax,%rax,1)
mov    %r14,%rdi
jmp    1173 <main+0x43>
cs nopw 0x0(%rax,%rax,1)
nop
mov    %eax,%edi
call   1030 <putchar@plt>
jmp    1178 <main+0x48>

LLVM IR (-O0):
@EOF = global i32 0
@.str = [3 x i8] c"\\t\00"
@.str.1 = [3 x i8] c"\\b\00"
@.str.2 = [3 x i8] c"\\\\\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %6
br label %7
7: ; preds = %26, %24, %19, %14, %2
%8 = call i32 (...) @getchar()
store i32 %8, i32* %6
%9 = load i32, i32* @EOF
%10 = icmp ne i32 %8, %9
br i1 %10, label %11, label %29
11: ; preds = %7
%12 = load i32, i32* %6
%13 = icmp eq i32 %12, 9
br i1 %13, label %14, label %16
14: ; preds = %11
%15 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
br label %7
16: ; preds = %11
%17 = load i32, i32* %6
%18 = icmp eq i32 %17, 8
br i1 %18, label %19, label %21
19: ; preds = %16
%20 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
br label %7
21: ; preds = %16
%22 = load i32, i32* %6
%23 = icmp eq i32 %22, 92
br i1 %23, label %24, label %26
24: ; preds = %21
%25 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
br label %7
26: ; preds = %21
%27 = load i32, i32* %6
%28 = call i32 @putchar(i32 %27)
br label %7
29: ; preds = %7
ret i32 0
}

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