#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() {
  char c;
  do {
    c = getchar();
    if (c == '\t' || c == '\b' || c == '\\') {
      putchar('\\');
      if (c == '\t')
        putchar('t');
      if (c == '\b')
        putchar('b');
      if (c == '\\')
        putchar('\\');
    } else {
      putchar(c);
    }
  } while (c != EOF);
  return 0;
}


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    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
cmp    $0x9,%eax
je     1160 <main+0x40>
movsbl -0x5(%rbp),%eax
cmp    $0x8,%eax
je     1160 <main+0x40>
movsbl -0x5(%rbp),%eax
cmp    $0x5c,%eax
jne    11b4 <main+0x94>
mov    $0x5c,%edi
call   1030 <putchar@plt>
movsbl -0x5(%rbp),%eax
cmp    $0x9,%eax
jne    1181 <main+0x61>
mov    $0x74,%edi
call   1030 <putchar@plt>
movsbl -0x5(%rbp),%eax
cmp    $0x8,%eax
jne    1198 <main+0x78>
mov    $0x62,%edi
call   1030 <putchar@plt>
movsbl -0x5(%rbp),%eax
cmp    $0x5c,%eax
jne    11af <main+0x8f>
mov    $0x5c,%edi
call   1030 <putchar@plt>
jmp    11bd <main+0x9d>
movsbl -0x5(%rbp),%edi
call   1030 <putchar@plt>
jmp    11c2 <main+0xa2>
movsbl -0x5(%rbp),%eax
mov    0x2e1b(%rip),%rcx
movsbl (%rcx),%ecx
cmp    %ecx,%eax
jne    112f <main+0xf>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
mov    0x2ebd(%rip),%r14
jmp    113c <main+0x1c>
mov    $0x74,%al
movsbl %al,%edi
call   1030 <putchar@plt>
cmp    (%r14),%bl
je     1174 <main+0x54>
xor    %eax,%eax
call   1040 <getchar@plt>
mov    %eax,%ebx
lea    -0x8(%rbx),%eax
cmp    $0x2,%al
jb     1153 <main+0x33>
mov    %ebx,%eax
cmp    $0x5c,%bl
jne    112f <main+0xf>
mov    $0x5c,%edi
call   1030 <putchar@plt>
cmp    $0x5c,%bl
je     1170 <main+0x50>
cmp    $0x9,%bl
je     112d <main+0xd>
cmp    $0x8,%bl
jne    1137 <main+0x17>
mov    $0x62,%al
jmp    112f <main+0xf>
mov    $0x5c,%al
jmp    112f <main+0xf>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

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