#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 main() {
  int lines, c, spaces, tabs;
  spaces = tabs = lines = 0;
  while ((c = getchar()) != EOF) {
    if (c == '\t')
      printf("\\t");
    if (c == '\b')
      printf("\b");
    if (c != '\b' || c != '\t')
      printf("%c", c);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0x14(%rbp)
movl   $0x0,-0x10(%rbp)
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %eax,-0xc(%rbp)
mov    0x2e93(%rip),%rcx
cmp    (%rcx),%eax
je     11b7 <main+0x97>
cmpl   $0x9,-0xc(%rbp)
jne    1175 <main+0x55>
lea    0xe92(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
cmpl   $0x8,-0xc(%rbp)
jne    118d <main+0x6d>
lea    0xe7d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
cmpl   $0x8,-0xc(%rbp)
jne    11a1 <main+0x81>
cmpl   $0x9,-0xc(%rbp)
je     11b2 <main+0x92>
mov    -0xc(%rbp),%esi
lea    0xe5a(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1144 <main+0x24>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
xor    %eax,%eax
call   1050 <getchar@plt>
mov    0x2ea5(%rip),%r15
cmp    (%r15),%eax
jne    1150 <main+0x20>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %r15
ret
mov    %eax,%ebx
lea    0xea7(%rip),%r14
jmp    117f <main+0x4f>
nopl   0x0(%rax,%rax,1)
mov    $0x8,%edi
call   1030 <putchar@plt>
mov    %ebx,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
call   1050 <getchar@plt>
mov    %eax,%ebx
cmp    (%r15),%eax
je     1148 <main+0x18>
cmp    $0x8,%ebx
je     1160 <main+0x30>
cmp    $0x9,%ebx
jne    116a <main+0x3a>
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
jmp    116a <main+0x3a>

LLVM IR (-O0):
@EOF = global i32 0
@.str = [3 x i8] c"\\t\00"
@.str.1 = [2 x i8] c"\08\00"
@.str.2 = [3 x i8] c"%c\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
store i32 0, i32* %5
store i32 0, i32* %4
br label %6
6: ; preds = %29, %0
%7 = call i32 (...) @getchar()
store i32 %7, i32* %3
%8 = load i32, i32* @EOF
%9 = icmp ne i32 %7, %8
br i1 %9, label %10, label %30
10: ; preds = %6
%11 = load i32, i32* %3
%12 = icmp eq i32 %11, 9
br i1 %12, label %13, label %15
13: ; preds = %10
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
br label %15
15: ; preds = %13, %10
%16 = load i32, i32* %3
%17 = icmp eq i32 %16, 8
br i1 %17, label %18, label %20
18: ; preds = %15
%19 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
br label %20
20: ; preds = %18, %15
%21 = load i32, i32* %3
%22 = icmp ne i32 %21, 8
br i1 %22, label %26, label %23
23: ; preds = %20
%24 = load i32, i32* %3
%25 = icmp ne i32 %24, 9
br i1 %25, label %26, label %29
26: ; preds = %23, %20
%27 = load i32, i32* %3
%28 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32 %27)
br label %29
29: ; preds = %26, %23
br label %6
30: ; preds = %6
ret i32 0
}

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