#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*/ putchar(int);
main() {
  int c;
  c = getchar();
  while (c != EOF) {
    if (c == '\b') {
      putchar(92);
      putchar('b');
      c = getchar();
    } else if (c == '\t') {
      putchar(92);
      putchar('t');
      c = getchar();
    } else if (c == '\\') {
      putchar(92);
      putchar(92);
      c = getchar();
    }
    putchar(c);
    c = getchar();
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    0x2ea5(%rip),%rcx
cmp    (%rcx),%eax
je     11ee <main+0xce>
cmpl   $0x8,-0x8(%rbp)
jne    1178 <main+0x58>
mov    $0x5c,%edi
call   1030 <putchar@plt>
mov    $0x62,%edi
call   1030 <putchar@plt>
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %eax,-0x8(%rbp)
jmp    11d7 <main+0xb7>
cmpl   $0x9,-0x8(%rbp)
jne    11a5 <main+0x85>
mov    $0x5c,%edi
call   1030 <putchar@plt>
mov    $0x74,%edi
call   1030 <putchar@plt>
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %eax,-0x8(%rbp)
jmp    11d2 <main+0xb2>
cmpl   $0x5c,-0x8(%rbp)
jne    11cd <main+0xad>
mov    $0x5c,%edi
call   1030 <putchar@plt>
mov    $0x5c,%edi
call   1030 <putchar@plt>
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %eax,-0x8(%rbp)
jmp    11d2 <main+0xb2>
jmp    11d7 <main+0xb7>
mov    -0x8(%rbp),%edi
call   1030 <putchar@plt>
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %eax,-0x8(%rbp)
jmp    1139 <main+0x19>
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
jmp    116b <main+0x4b>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    $0x5c,%ebx
mov    $0x5c,%edi
call   1030 <putchar@plt>
mov    %ebx,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
call   1040 <getchar@plt>
mov    %eax,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
call   1040 <getchar@plt>
cmp    (%r14),%eax
je     1197 <main+0x77>
cmp    $0x8,%eax
je     1190 <main+0x70>
cmp    $0x5c,%eax
je     1140 <main+0x20>
cmp    $0x9,%eax
jne    115d <main+0x3d>
mov    $0x74,%ebx
jmp    1145 <main+0x25>
cs nopw 0x0(%rax,%rax,1)
mov    $0x62,%ebx
jmp    1145 <main+0x25>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@EOF = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 (...) @getchar()
store i32 %3, i32* %2
br label %4
4: ; preds = %31, %0
%5 = load i32, i32* %2
%6 = load i32, i32* @EOF
%7 = icmp ne i32 %5, %6
br i1 %7, label %8, label %35
8: ; preds = %4
%9 = load i32, i32* %2
%10 = icmp eq i32 %9, 8
br i1 %10, label %11, label %15
11: ; preds = %8
%12 = call i32 @putchar(i32 92)
%13 = call i32 @putchar(i32 98)
%14 = call i32 (...) @getchar()
store i32 %14, i32* %2
br label %31
15: ; preds = %8
%16 = load i32, i32* %2
%17 = icmp eq i32 %16, 9
br i1 %17, label %18, label %22
18: ; preds = %15
%19 = call i32 @putchar(i32 92)
%20 = call i32 @putchar(i32 116)
%21 = call i32 (...) @getchar()
store i32 %21, i32* %2
br label %30
22: ; preds = %15
%23 = load i32, i32* %2
%24 = icmp eq i32 %23, 92
br i1 %24, label %25, label %29
25: ; preds = %22
%26 = call i32 @putchar(i32 92)
%27 = call i32 @putchar(i32 92)
%28 = call i32 (...) @getchar()
store i32 %28, i32* %2
br label %29
29: ; preds = %25, %22
br label %30
30: ; preds = %29, %18
br label %31
31: ; preds = %30, %11
%32 = load i32, i32* %2
%33 = call i32 @putchar(i32 %32)
%34 = call i32 (...) @getchar()
store i32 %34, i32* %2
br label %4
35: ; preds = %4
%36 = load i32, i32* %1
ret i32 %36
}

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 %19, label %4
4: ; preds = %0, %13
%5 = phi i32 [ %16, %13 ], [ %1, %0 ]
switch i32 %5, label %13 [
i32 8, label %8
i32 9, label %6
i32 92, label %7
]
6: ; preds = %4
br label %8
7: ; preds = %4
br label %8
8: ; preds = %4, %7, %6
%9 = phi i32 [ 116, %6 ], [ 92, %7 ], [ 98, %4 ]
%10 = tail call i32 @putchar(i32 92)
%11 = tail call i32 @putchar(i32 %9)
%12 = tail call i32 (...) @getchar()
br label %13
13: ; preds = %8, %4
%14 = phi i32 [ %5, %4 ], [ %12, %8 ]
%15 = tail call i32 @putchar(i32 %14)
%16 = tail call i32 (...) @getchar()
%17 = load i32, i32* @EOF
%18 = icmp eq i32 %16, %17
br i1 %18, label %19, label %4
19: ; preds = %13, %0
ret i32 0
}