#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 argc, char **argv) {
  char space = 0;
  int c;
  while ((c = getchar()) != EOF) {
    switch (c) {
    case '\\':
      printf("\\\\");
      break;
    case '\b':
      printf("\\b");
      break;
    case '\t':
      printf("\\t");
      break;
    default:
      putchar(c);
      break;
    }
  }
  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)
movb   $0x0,-0x11(%rbp)
mov    $0x0,%al
call   1050 <getchar@plt>
mov    %eax,-0x18(%rbp)
mov    0x2e8d(%rip),%rcx
cmp    (%rcx),%eax
je     11d9 <main+0xa9>
mov    -0x18(%rbp),%eax
mov    %eax,-0x1c(%rbp)
sub    $0x8,%eax
je     11aa <main+0x7a>
jmp    1177 <main+0x47>
mov    -0x1c(%rbp),%eax
sub    $0x9,%eax
je     11bb <main+0x8b>
jmp    1188 <main+0x58>
mov    -0x1c(%rbp),%eax
sub    $0x5c,%eax
jne    11cc <main+0x9c>
jmp    1199 <main+0x69>
lea    0xe60(%rip),%rdi
call   1040 <printf@plt>
jmp    11d4 <main+0xa4>
lea    0xe52(%rip),%rdi
call   1040 <printf@plt>
jmp    11d4 <main+0xa4>
lea    0xe44(%rip),%rdi
call   1040 <printf@plt>
jmp    11d4 <main+0xa4>
mov    -0x18(%rbp),%edi
call   1030 <putchar@plt>
jmp    114a <main+0x1a>
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    $0x9,%eax
je     1170 <main+0x40>
cmp    $0x5c,%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"\\\\\00"
@.str.1 = [3 x i8] c"\\b\00"
@.str.2 = [3 x i8] c"\\t\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8
%7 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i8 0, i8* %6
br label %8
8: ; preds = %23, %2
%9 = call i32 (...) @getchar()
store i32 %9, i32* %7
%10 = load i32, i32* @EOF
%11 = icmp ne i32 %9, %10
br i1 %11, label %12, label %24
12: ; preds = %8
%13 = load i32, i32* %7
switch i32 %13, label %20 [
i32 92, label %14
i32 8, label %16
i32 9, label %18
]
14: ; preds = %12
%15 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
br label %23
16: ; preds = %12
%17 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
br label %23
18: ; preds = %12
%19 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
br label %23
20: ; preds = %12
%21 = load i32, i32* %7
%22 = call i32 @putchar(i32 %21)
br label %23
23: ; preds = %20, %18, %16, %14
br label %8
24: ; preds = %8
ret i32 0
}

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