#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 */
char EOF;
char getchar();
int /*<<< orphan*/ putchar(char);
int main(int argc, char *argv[]) {
  char c;
  while ((c = getchar()) != EOF) {
    switch (c) {
    case '\t':
      putchar('\\');
      putchar('t');
      break;
    case '\b':
      putchar('\\');
      putchar('b');
      break;
    case '\\':
      putchar('\\');
      putchar('\\');
      break;
    default:
      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)
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %al,-0x11(%rbp)
movsbl %al,%eax
mov    0x2e9e(%rip),%rcx
movsbl (%rcx),%ecx
cmp    %ecx,%eax
je     11e5 <main+0xc5>
movsbl -0x11(%rbp),%eax
mov    %eax,-0x18(%rbp)
sub    $0x8,%eax
je     11a5 <main+0x85>
jmp    116a <main+0x4a>
mov    -0x18(%rbp),%eax
sub    $0x9,%eax
je     118c <main+0x6c>
jmp    117b <main+0x5b>
mov    -0x18(%rbp),%eax
sub    $0x5c,%eax
je     11be <main+0x9e>
jmp    11d7 <main+0xb7>
mov    $0x5c,%edi
call   1030 <putchar@plt>
mov    $0x74,%edi
call   1030 <putchar@plt>
jmp    11e0 <main+0xc0>
mov    $0x5c,%edi
call   1030 <putchar@plt>
mov    $0x62,%edi
call   1030 <putchar@plt>
jmp    11e0 <main+0xc0>
mov    $0x5c,%edi
call   1030 <putchar@plt>
mov    $0x5c,%edi
call   1030 <putchar@plt>
jmp    11e0 <main+0xc0>
movsbl -0x11(%rbp),%edi
call   1030 <putchar@plt>
jmp    1136 <main+0x16>
xor    %eax,%eax
add    $0x20,%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),%al
jne    1141 <main+0x21>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret
mov    %eax,%ebx
jmp    1172 <main+0x52>
cs nopw 0x0(%rax,%rax,1)
nop
mov    $0x74,%bl
mov    $0x5c,%edi
call   1030 <putchar@plt>
movsbl %bl,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
call   1040 <getchar@plt>
mov    %eax,%ebx
cmp    (%r14),%al
je     1137 <main+0x17>
movsbl %bl,%eax
cmp    $0x5c,%eax
je     1190 <main+0x70>
cmp    $0x9,%eax
je     1150 <main+0x30>
cmp    $0x8,%eax
jne    115c <main+0x3c>
mov    $0x62,%bl
jmp    1152 <main+0x32>
nopl   0x0(%rax,%rax,1)
mov    $0x5c,%bl
jmp    1152 <main+0x32>

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

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