#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 */
#define EOF 128
int getchar();
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ putchar(int);
int main(void) {
  int c;
  do {
    switch (c = getchar()) {
    case '\t':
      printf("\\t");
      break;
    case '\b':
      printf("\\b");
      break;
    case '\\':
      printf("\\\\");
      break;
    case EOF:
      break;
    default:
      putchar(c);
      break;
    }
  } while (c != EOF);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
xor    %eax,%eax
call   1050 <getchar@plt>
mov    %eax,-0x8(%rbp)
mov    %eax,%ecx
mov    %ecx,-0xc(%rbp)
sub    $0x8,%eax
je     11a2 <main+0x72>
jmp    115c <main+0x2c>
mov    -0xc(%rbp),%eax
sub    $0x9,%eax
je     1191 <main+0x61>
jmp    116d <main+0x3d>
mov    -0xc(%rbp),%eax
sub    $0x5c,%eax
je     11b3 <main+0x83>
jmp    117e <main+0x4e>
mov    -0xc(%rbp),%eax
sub    $0x80,%eax
je     11c4 <main+0x94>
jmp    11c9 <main+0x99>
lea    0xe68(%rip),%rdi
call   1040 <printf@plt>
jmp    11d1 <main+0xa1>
lea    0xe5a(%rip),%rdi
call   1040 <printf@plt>
jmp    11d1 <main+0xa1>
lea    0xe4c(%rip),%rdi
call   1040 <printf@plt>
jmp    11d1 <main+0xa1>
jmp    11d1 <main+0xa1>
mov    -0x8(%rbp),%edi
call   1030 <putchar@plt>
jmp    11d6 <main+0xa6>
cmpl   $0x80,-0x8(%rbp)
jne    113f <main+0xf>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
lea    0xec5(%rip),%r14
lea    0xebb(%rip),%r15
lea    0xeba(%rip),%rbx
jmp    1160 <main+0x30>
xchg   %ax,%ax
mov    %r14,%rdi
call   1040 <printf@plt>
cmp    $0x80,%ebp
je     11a1 <main+0x71>
xor    %eax,%eax
call   1050 <getchar@plt>
mov    %eax,%ebp
cmp    $0x5b,%eax
jg     1180 <main+0x50>
cmp    $0x8,%ebp
je     1150 <main+0x20>
cmp    $0x9,%ebp
jne    1192 <main+0x62>
mov    %r15,%rdi
jmp    1153 <main+0x23>
nopl   (%rax)
cmp    $0x5c,%ebp
jne    118a <main+0x5a>
mov    %rbx,%rdi
jmp    1153 <main+0x23>
cmp    $0x80,%ebp
je     11a1 <main+0x71>
mov    %ebp,%edi
call   1030 <putchar@plt>
cmp    $0x80,%ebp
jne    1160 <main+0x30>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [3 x i8] c"\\t\00"
@.str.1 = [3 x i8] c"\\b\00"
@.str.2 = [3 x i8] c"\\\\\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
br label %3
3: ; preds = %16, %0
%4 = call i32 (...) @getchar()
store i32 %4, i32* %2
switch i32 %4, label %12 [
i32 9, label %5
i32 8, label %7
i32 92, label %9
i32 128, label %11
]
5: ; preds = %3
%6 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
br label %15
7: ; preds = %3
%8 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
br label %15
9: ; preds = %3
%10 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
br label %15
11: ; preds = %3
br label %15
12: ; preds = %3
%13 = load i32, i32* %2
%14 = call i32 @putchar(i32 %13)
br label %15
15: ; preds = %12, %11, %9, %7, %5
br label %16
16: ; preds = %15
%17 = load i32, i32* %2
%18 = icmp ne i32 %17, 128
br i1 %18, label %3, label %19
19: ; preds = %16
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"\\t\00"
@.str.1 = [3 x i8] c"\\b\00"
@.str.2 = [3 x i8] c"\\\\\00"
define i32 @main() {
br label %1
1: ; preds = %11, %0
%2 = tail call i32 (...) @getchar()
switch i32 %2, label %9 [
i32 9, label %3
i32 8, label %5
i32 92, label %7
i32 128, label %13
]
3: ; preds = %1
%4 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
br label %11
5: ; preds = %1
%6 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
br label %11
7: ; preds = %1
%8 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
br label %11
9: ; preds = %1
%10 = tail call i32 @putchar(i32 %2)
br label %11
11: ; preds = %3, %5, %7, %9
%12 = icmp eq i32 %2, 128
br i1 %12, label %13, label %1
13: ; preds = %1, %11
ret i32 0
}