#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 *, char *);
int /*<<< orphan*/ putchar(int);
void appear_tabs_and_backslashes() {
  int c;
  while ((c = getchar()) != EOF) {
    switch (c) {
    case '\t':
      printf("%s", "\\t");
    case '\b':
      printf("%s", "\\b");
    case '\\':
      printf("%s", "\\");
      break;
    default:
      putchar(c);
    }
  }
}


x86 assembly (clang, -O0):
<appear_tabs_and_backslashes>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1050 <getchar@plt>
mov    %eax,-0x4(%rbp)
mov    0x2e9f(%rip),%rcx
cmp    (%rcx),%eax
je     11d2 <appear_tabs_and_backslashes+0xa2>
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
sub    $0x8,%eax
je     119a <appear_tabs_and_backslashes+0x6a>
jmp    1165 <appear_tabs_and_backslashes+0x35>
mov    -0x8(%rbp),%eax
sub    $0x9,%eax
je     1187 <appear_tabs_and_backslashes+0x57>
jmp    1176 <appear_tabs_and_backslashes+0x46>
mov    -0x8(%rbp),%eax
sub    $0x5c,%eax
je     11ad <appear_tabs_and_backslashes+0x7d>
jmp    11c5 <appear_tabs_and_backslashes+0x95>
lea    0xe72(%rip),%rdi
lea    0xe6e(%rip),%rsi
call   1040 <printf@plt>
lea    0xe5f(%rip),%rdi
lea    0xe5e(%rip),%rsi
call   1040 <printf@plt>
lea    0xe4c(%rip),%rdi
lea    0xe4e(%rip),%rsi
call   1040 <printf@plt>
jmp    11cd <appear_tabs_and_backslashes+0x9d>
mov    -0x4(%rbp),%edi
call   1030 <putchar@plt>
jmp    1138 <appear_tabs_and_backslashes+0x8>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<appear_tabs_and_backslashes>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
xor    %eax,%eax
call   1050 <getchar@plt>
mov    0x2ea1(%rip),%r13
cmp    0x0(%r13),%eax
jne    1157 <appear_tabs_and_backslashes+0x27>
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret
lea    0xea2(%rip),%rbx
lea    0xea1(%rip),%r14
lea    0xe9d(%rip),%r15
lea    0xe90(%rip),%r12
jmp    11ae <appear_tabs_and_backslashes+0x7e>
cs nopw 0x0(%rax,%rax,1)
nop
mov    %rbx,%rdi
mov    %r12,%rsi
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
call   1040 <printf@plt>
xor    %eax,%eax
call   1050 <getchar@plt>
cmp    0x0(%r13),%eax
je     114d <appear_tabs_and_backslashes+0x1d>
cmp    $0x8,%eax
je     118b <appear_tabs_and_backslashes+0x5b>
cmp    $0x5c,%eax
je     1196 <appear_tabs_and_backslashes+0x66>
cmp    $0x9,%eax
je     1180 <appear_tabs_and_backslashes+0x50>
mov    %eax,%edi
call   1030 <putchar@plt>
jmp    11a1 <appear_tabs_and_backslashes+0x71>

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

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