#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*/ putchar(char);
int main(int argc, char const *argv[]) {
  int c;
  while ((c = getchar()) != EOF && c != 'a') {
    if (c == '\\') {
      putchar('\\');
      putchar('\\');
    }
    if (c == '\t') {
      putchar('\\');
      putchar('t');
    }
    if (c == '\b') {
      putchar('\\');
      putchar('b');
    }
    if (c == '\n') {
      putchar('\\');
      putchar('n');
    }
  }
  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)
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %eax,%ecx
mov    %ecx,-0x14(%rbp)
xor    %eax,%eax
mov    0x2e9d(%rip),%rdx
cmp    (%rdx),%ecx
mov    %al,-0x15(%rbp)
je     1160 <main+0x40>
cmpl   $0x61,-0x14(%rbp)
setne  %al
mov    %al,-0x15(%rbp)
mov    -0x15(%rbp),%al
test   $0x1,%al
jne    1170 <main+0x50>
jmp    11ed <main+0xcd>
cmpl   $0x5c,-0x14(%rbp)
jne    118e <main+0x6e>
mov    $0x5c,%edi
call   1030 <putchar@plt>
mov    $0x5c,%edi
call   1030 <putchar@plt>
cmpl   $0x9,-0x14(%rbp)
jne    11ac <main+0x8c>
mov    $0x5c,%edi
call   1030 <putchar@plt>
mov    $0x74,%edi
call   1030 <putchar@plt>
cmpl   $0x8,-0x14(%rbp)
jne    11ca <main+0xaa>
mov    $0x5c,%edi
call   1030 <putchar@plt>
mov    $0x62,%edi
call   1030 <putchar@plt>
cmpl   $0xa,-0x14(%rbp)
jne    11e8 <main+0xc8>
mov    $0x5c,%edi
call   1030 <putchar@plt>
mov    $0x6e,%edi
call   1030 <putchar@plt>
jmp    1136 <main+0x16>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
xor    %eax,%eax
call   1040 <getchar@plt>
cmp    $0x61,%eax
je     1192 <main+0x72>
mov    0x2eb1(%rip),%r14
jmp    1159 <main+0x39>
mov    $0x6e,%bl
mov    $0x5c,%edi
call   1030 <putchar@plt>
movzbl %bl,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
call   1040 <getchar@plt>
cmp    $0x61,%eax
je     1192 <main+0x72>
cmp    (%r14),%eax
je     1192 <main+0x72>
cmp    $0x9,%eax
jg     1180 <main+0x60>
cmp    $0x8,%eax
je     118e <main+0x6e>
cmp    $0x9,%eax
jne    114d <main+0x2d>
mov    $0x74,%bl
jmp    113b <main+0x1b>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
cmp    $0xa,%eax
je     1139 <main+0x19>
mov    $0x5c,%bl
cmp    $0x5c,%eax
je     113b <main+0x1b>
jmp    114d <main+0x2d>
mov    $0x62,%bl
jmp    113b <main+0x1b>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@EOF = global i32 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @getchar()
%4 = load i32, i32* @EOF
%5 = icmp ne i32 %3, %4
%6 = icmp ne i32 %3, 97
%7 = and i1 %6, %5
br i1 %7, label %8, label %23
8: ; preds = %2, %17
%9 = phi i32 [ %18, %17 ], [ %3, %2 ]
switch i32 %9, label %17 [
i32 92, label %13
i32 9, label %10
i32 8, label %11
i32 10, label %12
]
10: ; preds = %8
br label %13
11: ; preds = %8
br label %13
12: ; preds = %8
br label %13
13: ; preds = %8, %12, %10, %11
%14 = phi i8 [ 98, %11 ], [ 116, %10 ], [ 110, %12 ], [ 92, %8 ]
%15 = tail call i32 @putchar(i8 signext 92)
%16 = tail call i32 @putchar(i8 signext %14)
br label %17
17: ; preds = %13, %8
%18 = tail call i32 (...) @getchar()
%19 = load i32, i32* @EOF
%20 = icmp ne i32 %18, %19
%21 = icmp ne i32 %18, 97
%22 = and i1 %21, %20
br i1 %22, label %8, label %23
23: ; preds = %17, %2
ret i32 0
}