#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 */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
char EOF;
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
char fgetc(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ perror(char *);
int /*<<< orphan*/ putchar(char);
int /*<<< orphan*/ stderr;
int main(int argc, char *argv[]) {
  int i;
  char ch;
  FILE *in;
  if (argc < 2) {
    fprintf(stderr, "Error: Missing input file(s).\n");
    exit(1);
  }
  for (i = 1; i < argc; i++) {
    in = fopen(argv[i], "r");
    if (in == NULL) {
      perror(argv[i]);
      continue;
    }
    while ((ch = fgetc(in)) != EOF) {
      if (ch == '\t') {
        putchar('\\');
        putchar('t');
      } else if (ch == '\b') {
        putchar('\\');
        putchar('b');
      } else if (ch == '\\') {
        putchar('\\');
        putchar('\\');
      } else {
        putchar(ch);
      }
    }
    fclose(in);
  }
  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)
cmpl   $0x2,-0x8(%rbp)
jge    11af <main+0x3f>
mov    0x2e41(%rip),%rax
mov    (%rax),%edi
lea    0xe60(%rip),%rsi
call   1060 <fprintf@plt>
mov    $0x1,%edi
call   1090 <exit@plt>
movl   $0x1,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    12c6 <main+0x156>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
lea    0xe4a(%rip),%rsi
call   1070 <fopen@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    11ff <main+0x8f>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1080 <perror@plt>
jmp    12b8 <main+0x148>
jmp    1204 <main+0x94>
mov    -0x20(%rbp),%rdi
call   1050 <fgetc@plt>
mov    %al,-0x15(%rbp)
movsbl %al,%eax
mov    0x2dce(%rip),%rcx
movsbl (%rcx),%ecx
cmp    %ecx,%eax
je     12af <main+0x13f>
movsbl -0x15(%rbp),%eax
cmp    $0x9,%eax
jne    124b <main+0xdb>
mov    $0x5c,%edi
call   1030 <putchar@plt>
mov    $0x74,%edi
call   1030 <putchar@plt>
jmp    12aa <main+0x13a>
movsbl -0x15(%rbp),%eax
cmp    $0x8,%eax
jne    1271 <main+0x101>
mov    $0x5c,%edi
call   1030 <putchar@plt>
mov    $0x62,%edi
call   1030 <putchar@plt>
jmp    12a5 <main+0x135>
movsbl -0x15(%rbp),%eax
cmp    $0x5c,%eax
jne    1297 <main+0x127>
mov    $0x5c,%edi
call   1030 <putchar@plt>
mov    $0x5c,%edi
call   1030 <putchar@plt>
jmp    12a0 <main+0x130>
movsbl -0x15(%rbp),%edi
call   1030 <putchar@plt>
jmp    12a5 <main+0x135>
jmp    12aa <main+0x13a>
jmp    1204 <main+0x94>
mov    -0x20(%rbp),%rdi
call   1040 <fclose@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    11b6 <main+0x46>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
cmp    $0x2,%edi
jl     1243 <main+0xd3>
mov    %rsi,%r15
mov    %edi,%r13d
mov    $0x1,%ebp
mov    0x2e52(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
mov    (%r15,%rbp,8),%rdi
lea    0xe74(%rip),%rsi
call   1070 <fopen@plt>
test   %rax,%rax
je     1227 <main+0xb7>
mov    %rax,%r12
jmp    11d4 <main+0x64>
nopw   0x0(%rax,%rax,1)
mov    $0x5c,%bl
mov    $0x5c,%edi
call   1030 <putchar@plt>
movsbl %bl,%edi
call   1030 <putchar@plt>
mov    %r12,%rdi
call   1050 <fgetc@plt>
mov    %eax,%ebx
cmp    (%r14),%al
je     1210 <main+0xa0>
cmp    $0x5c,%bl
je     11c0 <main+0x50>
cmp    $0x9,%bl
je     1200 <main+0x90>
cmp    $0x8,%bl
jne    11cc <main+0x5c>
mov    $0x62,%bl
jmp    11c2 <main+0x52>
cs nopw 0x0(%rax,%rax,1)
mov    $0x74,%bl
jmp    11c2 <main+0x52>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %r12,%rdi
call   1040 <fclose@plt>
add    $0x1,%rbp
cmp    %r13,%rbp
jne    11a0 <main+0x30>
jmp    1232 <main+0xc2>
mov    (%r15,%rbp,8),%rdi
call   1080 <perror@plt>
jmp    1218 <main+0xa8>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    0x2d8e(%rip),%rax
mov    (%rax),%edi
lea    0xdad(%rip),%rsi
call   1060 <fprintf@plt>
mov    $0x1,%edi
call   1090 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [31 x i8] c"Error: Missing input file(s).\0A\00"
@.str.1 = [2 x i8] c"r\00"
@EOF = global i8 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i8
%8 = alloca i32*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%9 = load i32, i32* %4
%10 = icmp slt i32 %9, 2
br i1 %10, label %11, label %15
11: ; preds = %2
%12 = load i32, i32* @stderr
%13 = call i32 @fprintf(i32 %12, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
%14 = call i32 @exit(i32 1)
unreachable
15: ; preds = %2
store i32 1, i32* %6
br label %16
16: ; preds = %74, %15
%17 = load i32, i32* %6
%18 = load i32, i32* %4
%19 = icmp slt i32 %17, %18
br i1 %19, label %20, label %77
20: ; preds = %16
%21 = load i8**, i8*** %5
%22 = load i32, i32* %6
%23 = sext i32 %22 to i64
%24 = getelementptr inbounds i8*, i8** %21, i64 %23
%25 = load i8*, i8** %24
%26 = call i32* @fopen(i8* %25, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %26, i32** %8
%27 = load i32*, i32** %8
%28 = icmp eq i32* %27, null
br i1 %28, label %29, label %36
29: ; preds = %20
%30 = load i8**, i8*** %5
%31 = load i32, i32* %6
%32 = sext i32 %31 to i64
%33 = getelementptr inbounds i8*, i8** %30, i64 %32
%34 = load i8*, i8** %33
%35 = call i32 @perror(i8* %34)
br label %74
36: ; preds = %20
br label %37
37: ; preds = %70, %36
%38 = load i32*, i32** %8
%39 = call signext i8 @fgetc(i32* %38)
store i8 %39, i8* %7
%40 = sext i8 %39 to i32
%41 = load i8, i8* @EOF
%42 = sext i8 %41 to i32
%43 = icmp ne i32 %40, %42
br i1 %43, label %44, label %71
44: ; preds = %37
%45 = load i8, i8* %7
%46 = sext i8 %45 to i32
%47 = icmp eq i32 %46, 9
br i1 %47, label %48, label %51
48: ; preds = %44
%49 = call i32 @putchar(i8 signext 92)
%50 = call i32 @putchar(i8 signext 116)
br label %70
51: ; preds = %44
%52 = load i8, i8* %7
%53 = sext i8 %52 to i32
%54 = icmp eq i32 %53, 8
br i1 %54, label %55, label %58
55: ; preds = %51
%56 = call i32 @putchar(i8 signext 92)
%57 = call i32 @putchar(i8 signext 98)
br label %69
58: ; preds = %51
%59 = load i8, i8* %7
%60 = sext i8 %59 to i32
%61 = icmp eq i32 %60, 92
br i1 %61, label %62, label %65
62: ; preds = %58
%63 = call i32 @putchar(i8 signext 92)
%64 = call i32 @putchar(i8 signext 92)
br label %68
65: ; preds = %58
%66 = load i8, i8* %7
%67 = call i32 @putchar(i8 signext %66)
br label %68
68: ; preds = %65, %62
br label %69
69: ; preds = %68, %55
br label %70
70: ; preds = %69, %48
br label %37
71: ; preds = %37
%72 = load i32*, i32** %8
%73 = call i32 @fclose(i32* %72)
br label %74
74: ; preds = %71, %29
%75 = load i32, i32* %6
%76 = add nsw i32 %75, 1
store i32 %76, i32* %6
br label %16
77: ; preds = %16
ret i32 0
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [31 x i8] c"Error: Missing input file(s).\0A\00"
@.str.1 = [2 x i8] c"r\00"
@EOF = global i8 0
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp slt i32 %0, 2
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = zext i32 %0 to i64
br label %10
6: ; preds = %2
%7 = load i32, i32* @stderr
%8 = tail call i32 @fprintf(i32 %7, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
%9 = tail call i32 @exit(i32 1)
unreachable
10: ; preds = %4, %38
%11 = phi i64 [ 1, %4 ], [ %39, %38 ]
%12 = getelementptr inbounds i8*, i8** %1, i64 %11
%13 = load i8*, i8** %12
%14 = tail call i32* @fopen(i8* %13, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%15 = icmp eq i32* %14, null
br i1 %15, label %20, label %16
16: ; preds = %10
%17 = tail call signext i8 @fgetc(i32* %14)
%18 = load i8, i8* @EOF
%19 = icmp eq i8 %17, %18
br i1 %19, label %36, label %23
20: ; preds = %10
%21 = load i8*, i8** %12
%22 = tail call i32 @perror(i8* %21)
br label %38
23: ; preds = %16, %30
%24 = phi i8 [ %33, %30 ], [ %17, %16 ]
switch i8 %24, label %30 [
i8 9, label %27
i8 8, label %25
i8 92, label %26
]
25: ; preds = %23
br label %27
26: ; preds = %23
br label %27
27: ; preds = %23, %26, %25
%28 = phi i8 [ 92, %26 ], [ 98, %25 ], [ 116, %23 ]
%29 = tail call i32 @putchar(i8 signext 92)
br label %30
30: ; preds = %27, %23
%31 = phi i8 [ %24, %23 ], [ %28, %27 ]
%32 = tail call i32 @putchar(i8 signext %31)
%33 = tail call signext i8 @fgetc(i32* %14)
%34 = load i8, i8* @EOF
%35 = icmp eq i8 %33, %34
br i1 %35, label %36, label %23
36: ; preds = %30, %16
%37 = tail call i32 @fclose(i32* %14)
br label %38
38: ; preds = %36, %20
%39 = add nuw nsw i64 %11, 1
%40 = icmp eq i64 %39, %5
br i1 %40, label %41, label %10
41: ; preds = %38
ret i32 0
}