#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(void) {
  int c;
  while ((c = getchar()) != EOF) {
    if (c == '\b' || c == '\t' || c == '\\') {
      if (c == '\b') {
        putchar('\\');
        printf("b");
      }
      if (c == '\t') {
        putchar('\\');
        printf("t");
      }
      if (c == '\\') {
        putchar('\\');
        putchar('\\');
      }
    }
    if (c != '\n' || c != '\t' || c != '\\')
      putchar(c);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1050 <getchar@plt>
mov    %eax,-0x8(%rbp)
mov    0x2e98(%rip),%rcx
cmp    (%rcx),%eax
je     1204 <main+0xd4>
cmpl   $0x8,-0x8(%rbp)
je     1176 <main+0x46>
cmpl   $0x9,-0x8(%rbp)
je     1176 <main+0x46>
cmpl   $0x5c,-0x8(%rbp)
jne    11d9 <main+0xa9>
cmpl   $0x8,-0x8(%rbp)
jne    1196 <main+0x66>
mov    $0x5c,%edi
call   1030 <putchar@plt>
lea    0xe6f(%rip),%rdi
call   1040 <printf@plt>
cmpl   $0x9,-0x8(%rbp)
jne    11b6 <main+0x86>
mov    $0x5c,%edi
call   1030 <putchar@plt>
lea    0xe51(%rip),%rdi
call   1040 <printf@plt>
cmpl   $0x5c,-0x8(%rbp)
jne    11d4 <main+0xa4>
mov    $0x5c,%edi
call   1030 <putchar@plt>
mov    $0x5c,%edi
call   1030 <putchar@plt>
jmp    11d9 <main+0xa9>
cmpl   $0xa,-0x8(%rbp)
jne    11f7 <main+0xc7>
cmpl   $0x9,-0x8(%rbp)
jne    11f7 <main+0xc7>
cmpl   $0x5c,-0x8(%rbp)
je     11ff <main+0xcf>
mov    -0x8(%rbp),%edi
call   1030 <putchar@plt>
jmp    113f <main+0xf>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
xor    %eax,%eax
call   1040 <getchar@plt>
mov    0x2eb6(%rip),%r14
cmp    (%r14),%eax
jne    1141 <main+0x21>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret
mov    %eax,%ebx
jmp    1179 <main+0x59>
cs nopw 0x0(%rax,%rax,1)
nop
mov    $0x5c,%edi
call   1030 <putchar@plt>
mov    $0x74,%edi
call   1030 <putchar@plt>
mov    %ebx,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
call   1040 <getchar@plt>
mov    %eax,%ebx
cmp    (%r14),%eax
je     1137 <main+0x17>
cmp    $0x5c,%ebx
je     11a0 <main+0x80>
cmp    $0x9,%ebx
je     1150 <main+0x30>
cmp    $0x8,%ebx
jne    1164 <main+0x44>
mov    $0x5c,%edi
call   1030 <putchar@plt>
mov    $0x62,%edi
jmp    115f <main+0x3f>
nopl   0x0(%rax)
mov    $0x5c,%edi
call   1030 <putchar@plt>
mov    $0x5c,%edi
jmp    115f <main+0x3f>

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

LLVM IR (-O2):
@EOF = global i32 0
define i32 @main() {
%1 = tail call i32 (...) @getchar()
%2 = load i32, i32* @EOF
%3 = icmp eq i32 %1, %2
br i1 %3, label %20, label %4
4: ; preds = %0, %15
%5 = phi i32 [ %17, %15 ], [ %1, %0 ]
switch i32 %5, label %15 [
i32 8, label %6
i32 9, label %9
i32 92, label %12
]
6: ; preds = %4
%7 = tail call i32 @putchar(i32 92)
%8 = tail call i32 @putchar(i32 98)
br label %15
9: ; preds = %4
%10 = tail call i32 @putchar(i32 92)
%11 = tail call i32 @putchar(i32 116)
br label %15
12: ; preds = %4
%13 = tail call i32 @putchar(i32 92)
%14 = tail call i32 @putchar(i32 92)
br label %15
15: ; preds = %9, %6, %12, %4
%16 = tail call i32 @putchar(i32 %5)
%17 = tail call i32 (...) @getchar()
%18 = load i32, i32* @EOF
%19 = icmp eq i32 %17, %18
br i1 %19, label %20, label %4
20: ; preds = %15, %0
ret i32 0
}