#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 c, state = 0;
  while ((c = getchar()) != EOF) {
    if (c != ' ' && state == 1) {
      state = 0;
    }
    if (c == '\t') {
      state = 1;
      printf("\\t");
    } else if (c == '\b') {
      printf("\\b");
    } else if (c == '\\') {
      printf("\\");
    }
    if (state == 0) {
      putchar(c);
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0xc(%rbp)
mov    $0x0,%al
call   1050 <getchar@plt>
mov    %eax,-0x8(%rbp)
mov    0x2e91(%rip),%rcx
cmp    (%rcx),%eax
je     11ee <main+0xbe>
cmpl   $0x20,-0x8(%rbp)
je     117a <main+0x4a>
cmpl   $0x1,-0xc(%rbp)
jne    117a <main+0x4a>
movl   $0x0,-0xc(%rbp)
cmpl   $0x9,-0x8(%rbp)
jne    119c <main+0x6c>
movl   $0x1,-0xc(%rbp)
lea    0xe6e(%rip),%rdi
call   1040 <printf@plt>
jmp    11d7 <main+0xa7>
cmpl   $0x8,-0x8(%rbp)
jne    11b7 <main+0x87>
lea    0xe56(%rip),%rdi
call   1040 <printf@plt>
jmp    11d2 <main+0xa2>
cmpl   $0x5c,-0x8(%rbp)
jne    11cd <main+0x9d>
lea    0xe3e(%rip),%rdi
call   1040 <printf@plt>
jmp    11d2 <main+0xa2>
jmp    11d7 <main+0xa7>
cmpl   $0x0,-0xc(%rbp)
jne    11e9 <main+0xb9>
mov    -0x8(%rbp),%edi
call   1030 <putchar@plt>
jmp    1146 <main+0x16>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
xor    %r12d,%r12d
xor    %eax,%eax
call   1050 <getchar@plt>
mov    0x2e9c(%rip),%r13
cmp    0x0(%r13),%eax
jne    1163 <main+0x33>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    %eax,%ebp
lea    0xe97(%rip),%r14
lea    0xe8d(%rip),%r15
xor    %ebx,%ebx
jmp    119c <main+0x6c>
nopw   0x0(%rax,%rax,1)
mov    %r15,%rdi
call   1040 <printf@plt>
mov    $0x1,%ebx
xor    %eax,%eax
call   1050 <getchar@plt>
mov    %eax,%ebp
cmp    0x0(%r13),%eax
je     1152 <main+0x22>
mov    %ebx,%eax
cmp    $0x1,%ebx
cmove  %r12d,%ebx
cmp    $0x20,%ebp
cmove  %eax,%ebx
cmp    $0x8,%ebp
je     11d0 <main+0xa0>
cmp    $0x5c,%ebp
je     11c0 <main+0x90>
cmp    $0x9,%ebp
je     1180 <main+0x50>
jmp    11ca <main+0x9a>
nopl   0x0(%rax)
mov    $0x5c,%edi
call   1030 <putchar@plt>
test   %ebx,%ebx
jne    118d <main+0x5d>
jmp    11dc <main+0xac>
mov    %r14,%rdi
call   1040 <printf@plt>
test   %ebx,%ebx
jne    118d <main+0x5d>
mov    %ebp,%edi
call   1030 <putchar@plt>
xor    %ebx,%ebx
jmp    118d <main+0x5d>

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