#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*/ printf(char *, ...);
int main(int argc, char **argv) {
  char cChar = 0;
  int iFlag = 0;
  printf("This program funtion is, replace '\\b''\\t''\\\\', so input some "
         "character:\n");
  while ((cChar = getchar()) != EOF) {
    iFlag = 0;
    if (cChar == '\t') {
      printf("\\t");
      iFlag = 1;
    }
    if (cChar == '\b') {
      printf("\\b");
      iFlag = 1;
    }
    if (cChar == '\\') {
      printf("\\\\");
      iFlag = 1;
    }
    if (iFlag != 1) {
      printf("%c", cChar);
    }
  }
  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)
movb   $0x0,-0x11(%rbp)
movl   $0x0,-0x18(%rbp)
lea    0xeb8(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %al,-0x11(%rbp)
movsbl %al,%eax
mov    0x2e85(%rip),%rcx
movsbl (%rcx),%ecx
cmp    %ecx,%eax
je     11fc <main+0xdc>
movl   $0x0,-0x18(%rbp)
movsbl -0x11(%rbp),%eax
cmp    $0x9,%eax
jne    1197 <main+0x77>
lea    0xec0(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x1,-0x18(%rbp)
movsbl -0x11(%rbp),%eax
cmp    $0x8,%eax
jne    11b9 <main+0x99>
lea    0xea1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x1,-0x18(%rbp)
movsbl -0x11(%rbp),%eax
cmp    $0x5c,%eax
jne    11db <main+0xbb>
lea    0xe82(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x1,-0x18(%rbp)
cmpl   $0x1,-0x18(%rbp)
je     11f7 <main+0xd7>
movsbl -0x11(%rbp),%esi
lea    0xe62(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    114f <main+0x2f>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
lea    0xeba(%rip),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
call   1060 <getchar@plt>
mov    0x2e86(%rip),%rbx
cmp    (%rbx),%al
jne    1174 <main+0x34>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret
lea    0xe88(%rip),%r14
lea    0xe84(%rip),%r12
lea    0xe77(%rip),%r15
jmp    11a5 <main+0x65>
nopl   0x0(%rax,%rax,1)
mov    %r12,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
xor    %eax,%eax
call   1060 <getchar@plt>
cmp    (%rbx),%al
je     1166 <main+0x26>
cmp    $0x8,%al
je     11c0 <main+0x80>
cmp    $0x5c,%al
je     1190 <main+0x50>
cmp    $0x9,%al
jne    11d0 <main+0x90>
mov    %r15,%rdi
jmp    1193 <main+0x53>
cs nopw 0x0(%rax,%rax,1)
mov    %r14,%rdi
jmp    1193 <main+0x53>
cs nopw 0x0(%rax,%rax,1)
nop
movsbl %al,%edi
call   1030 <putchar@plt>
jmp    119a <main+0x5a>

LLVM IR (-O0):
@.str = [73 x i8] c"This program funtion is, replace '\\b''\\t''\\\\', so input some character:\0A\00"
@EOF = global i8 0
@.str.1 = [3 x i8] c"\\t\00"
@.str.2 = [3 x i8] c"\\b\00"
@.str.3 = [3 x i8] c"\\\\\00"
@.str.4 = [3 x i8] c"%c\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8
%7 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i8 0, i8* %6
store i32 0, i32* %7
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([73 x i8], [73 x i8]* @.str, i64 0, i64 0))
br label %9
9: ; preds = %40, %2
%10 = call signext i8 (...) @getchar()
store i8 %10, i8* %6
%11 = sext i8 %10 to i32
%12 = load i8, i8* @EOF
%13 = sext i8 %12 to i32
%14 = icmp ne i32 %11, %13
br i1 %14, label %15, label %41
15: ; preds = %9
store i32 0, i32* %7
%16 = load i8, i8* %6
%17 = sext i8 %16 to i32
%18 = icmp eq i32 %17, 9
br i1 %18, label %19, label %21
19: ; preds = %15
%20 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
store i32 1, i32* %7
br label %21
21: ; preds = %19, %15
%22 = load i8, i8* %6
%23 = sext i8 %22 to i32
%24 = icmp eq i32 %23, 8
br i1 %24, label %25, label %27
25: ; preds = %21
%26 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
store i32 1, i32* %7
br label %27
27: ; preds = %25, %21
%28 = load i8, i8* %6
%29 = sext i8 %28 to i32
%30 = icmp eq i32 %29, 92
br i1 %30, label %31, label %33
31: ; preds = %27
%32 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0))
store i32 1, i32* %7
br label %33
33: ; preds = %31, %27
%34 = load i32, i32* %7
%35 = icmp ne i32 %34, 1
br i1 %35, label %36, label %40
36: ; preds = %33
%37 = load i8, i8* %6
%38 = sext i8 %37 to i32
%39 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i32 %38)
br label %40
40: ; preds = %36, %33
br label %9
41: ; preds = %9
ret i32 0
}

LLVM IR (-O2):
@EOF = global i8 0
@.str.1 = [3 x i8] c"\\t\00"
@.str.2 = [3 x i8] c"\\b\00"
@.str.3 = [3 x i8] c"\\\\\00"
@str = [72 x i8] c"This program funtion is, replace '\\b''\\t''\\\\', so input some character:\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([72 x i8], [72 x i8]* @str, i64 0, i64 0))
%4 = tail call signext i8 (...) @getchar()
%5 = load i8, i8* @EOF
%6 = icmp eq i8 %4, %5
br i1 %6, label %22, label %7
7: ; preds = %2, %18
%8 = phi i8 [ %19, %18 ], [ %4, %2 ]
switch i8 %8, label %15 [
i8 9, label %9
i8 8, label %11
i8 92, label %13
]
9: ; preds = %7
%10 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
br label %18
11: ; preds = %7
%12 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
br label %18
13: ; preds = %7
%14 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0))
br label %18
15: ; preds = %7
%16 = sext i8 %8 to i32
%17 = tail call i32 @putchar(i32 %16)
br label %18
18: ; preds = %11, %9, %13, %15
%19 = tail call signext i8 (...) @getchar()
%20 = load i8, i8* @EOF
%21 = icmp eq i8 %19, %20
br i1 %21, label %22, label %7
22: ; preds = %18, %2
ret i32 0
}