#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 */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
scalar_t__ feof(int /*<<< orphan*/ *);
char fgetc(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
int /*<<< orphan*/ fputc(char, int /*<<< orphan*/ *);
int /*<<< orphan*/ free(char *);
char *malloc(size_t);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ stdout;
int /*<<< orphan*/ strcat(char *, char *);
int /*<<< orphan*/ strcpy(char *, char *);
size_t strlen(char *);
int main(int argc, char **argv) {
  char *filename = NULL;
  char *filename2 = NULL;
  FILE *in;
  FILE *out;
  char buffer[3];
  size_t len;
  int retval = 0;
  if (argc < 2) {
    fprintf(stderr, "You must give a filename on the command line.\n");
    retval = 1;
    goto end;
  }
  len = strlen(argv[1]);
  filename = malloc(len + 1);
  filename2 = malloc(len + 5);
  if (filename == NULL || filename2 == NULL) {
    fprintf(stderr, "Cannot allocate memory.\n");
    retval = 1;
    goto end;
  }
  strcpy(filename, argv[1]);
  strcpy(filename2, filename);
  strcat(filename2 + len, ".txt");
  fprintf(stdout, "Processing file <%s>:\n", filename);
  fprintf(stdout, "Pass 1... ");
  in = fopen(filename, "rb");
  if (in == NULL) {
    fprintf(stderr, "Unable to open this file: <%s>\n", filename);
    retval = 1;
    goto end;
  }
  out = fopen(filename2, "wb");
  if (out == NULL) {
    fclose(in);
    fprintf(stderr, "Unable to open this file: <%s>\n", filename2);
    retval = 1;
    goto end;
  }
  while (!feof(in)) {
    buffer[0] = fgetc(in);
    if (feof(in))
      break;
    buffer[1] = fgetc(in);
    if (feof(in)) {
      fputc(buffer[0], out);
      break;
    }
    if (buffer[0] == '\b') {
      continue;
    }
    if (buffer[1] == '\b') {
      fputc(fgetc(in), out);
      continue;
    }
    fputc(buffer[0], out);
    fputc(buffer[1], out);
  }
  fprintf(stdout, "Done.\n");
  fclose(in);
  fclose(out);
end:
  free(filename2);
  free(filename);
  return retval;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
movq   $0x0,-0x20(%rbp)
movl   $0x0,-0x44(%rbp)
cmpl   $0x2,-0x8(%rbp)
jge    120a <main+0x5a>
mov    0x2df2(%rip),%rax
mov    (%rax),%edi
lea    0xe09(%rip),%rsi
mov    $0x0,%al
call   1090 <fprintf@plt>
movl   $0x1,-0x44(%rbp)
jmp    146f <main+0x2bf>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1060 <strlen@plt>
mov    %rax,-0x40(%rbp)
mov    -0x40(%rbp),%rdi
add    $0x1,%rdi
call   10b0 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x40(%rbp),%rdi
add    $0x5,%rdi
call   10b0 <malloc@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1253 <main+0xa3>
cmpq   $0x0,-0x20(%rbp)
jne    1276 <main+0xc6>
mov    0x2d86(%rip),%rax
mov    (%rax),%edi
lea    0xdcc(%rip),%rsi
mov    $0x0,%al
call   1090 <fprintf@plt>
movl   $0x1,-0x44(%rbp)
jmp    146f <main+0x2bf>
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rsi
call   1040 <strcpy@plt>
mov    -0x20(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1040 <strcpy@plt>
mov    -0x20(%rbp),%rdi
add    -0x40(%rbp),%rdi
lea    0xda5(%rip),%rsi
call   10d0 <strcat@plt>
mov    0x2d29(%rip),%rax
mov    (%rax),%edi
mov    -0x18(%rbp),%rdx
lea    0xd91(%rip),%rsi
mov    $0x0,%al
call   1090 <fprintf@plt>
mov    0x2d0e(%rip),%rax
mov    (%rax),%edi
lea    0xd91(%rip),%rsi
mov    $0x0,%al
call   1090 <fprintf@plt>
mov    -0x18(%rbp),%rdi
lea    0xd8a(%rip),%rsi
call   10c0 <fopen@plt>
mov    %rax,-0x28(%rbp)
cmpq   $0x0,-0x28(%rbp)
jne    1320 <main+0x170>
mov    0x2ce0(%rip),%rax
mov    (%rax),%edi
mov    -0x18(%rbp),%rdx
lea    0xd65(%rip),%rsi
mov    $0x0,%al
call   1090 <fprintf@plt>
movl   $0x1,-0x44(%rbp)
jmp    146f <main+0x2bf>
mov    -0x20(%rbp),%rdi
lea    0xd67(%rip),%rsi
call   10c0 <fopen@plt>
mov    %rax,-0x30(%rbp)
cmpq   $0x0,-0x30(%rbp)
jne    136f <main+0x1bf>
mov    -0x28(%rbp),%rdi
call   1050 <fclose@plt>
mov    0x2c91(%rip),%rax
mov    (%rax),%edi
mov    -0x20(%rbp),%rdx
lea    0xd16(%rip),%rsi
mov    $0x0,%al
call   1090 <fprintf@plt>
movl   $0x1,-0x44(%rbp)
jmp    146f <main+0x2bf>
jmp    1374 <main+0x1c4>
mov    -0x28(%rbp),%rdi
call   10a0 <feof@plt>
cmp    $0x0,%rax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    1393 <main+0x1e3>
jmp    1446 <main+0x296>
mov    -0x28(%rbp),%rdi
call   1070 <fgetc@plt>
mov    %al,-0x33(%rbp)
mov    -0x28(%rbp),%rdi
call   10a0 <feof@plt>
cmp    $0x0,%rax
je     13b7 <main+0x207>
jmp    1446 <main+0x296>
mov    -0x28(%rbp),%rdi
call   1070 <fgetc@plt>
mov    %al,-0x32(%rbp)
mov    -0x28(%rbp),%rdi
call   10a0 <feof@plt>
cmp    $0x0,%rax
je     13ea <main+0x23a>
mov    -0x33(%rbp),%al
mov    -0x30(%rbp),%rsi
movsbl %al,%edi
call   1080 <fputc@plt>
jmp    1446 <main+0x296>
movsbl -0x33(%rbp),%eax
cmp    $0x8,%eax
jne    13fc <main+0x24c>
jmp    1374 <main+0x1c4>
movsbl -0x32(%rbp),%eax
cmp    $0x8,%eax
jne    1423 <main+0x273>
mov    -0x28(%rbp),%rdi
call   1070 <fgetc@plt>
mov    -0x30(%rbp),%rsi
movsbl %al,%edi
call   1080 <fputc@plt>
jmp    1374 <main+0x1c4>
mov    -0x33(%rbp),%al
mov    -0x30(%rbp),%rsi
movsbl %al,%edi
call   1080 <fputc@plt>
mov    -0x32(%rbp),%al
mov    -0x30(%rbp),%rsi
movsbl %al,%edi
call   1080 <fputc@plt>
jmp    1374 <main+0x1c4>
mov    0x2b8b(%rip),%rax
mov    (%rax),%edi
lea    0xc3f(%rip),%rsi
mov    $0x0,%al
call   1090 <fprintf@plt>
mov    -0x28(%rbp),%rdi
call   1050 <fclose@plt>
mov    -0x30(%rbp),%rdi
call   1050 <fclose@plt>
mov    -0x20(%rbp),%rdi
call   1030 <free@plt>
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
mov    -0x44(%rbp),%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
cmp    $0x1,%edi
jg     11e7 <main+0x37>
mov    0x2e19(%rip),%rax
mov    (%rax),%edi
lea    0xe30(%rip),%rsi
xor    %r14d,%r14d
xor    %eax,%eax
call   1090 <fprintf@plt>
mov    $0x1,%ebp
xor    %r15d,%r15d
jmp    13b0 <main+0x200>
mov    0x8(%rsi),%rbp
mov    %rbp,%rdi
call   1060 <strlen@plt>
mov    %rax,%rbx
lea    0x1(%rax),%rdi
call   10b0 <malloc@plt>
mov    %rax,%r15
lea    0x5(%rbx),%rdi
call   10b0 <malloc@plt>
mov    %rax,%r14
test   %r15,%r15
je     131f <main+0x16f>
test   %r14,%r14
je     131f <main+0x16f>
mov    %r15,%rdi
mov    %rbp,%rsi
call   1040 <strcpy@plt>
mov    %r14,%rdi
mov    %r15,%rsi
call   1040 <strcpy@plt>
mov    %r14,%rdi
add    %rbx,%rdi
lea    0xe05(%rip),%rsi
call   10d0 <strcat@plt>
mov    0x2d89(%rip),%rbx
mov    (%rbx),%edi
lea    0xdf5(%rip),%rsi
mov    %r15,%rdx
xor    %eax,%eax
call   1090 <fprintf@plt>
mov    (%rbx),%edi
lea    0xdf9(%rip),%rsi
xor    %eax,%eax
call   1090 <fprintf@plt>
lea    0xdf6(%rip),%rsi
mov    %r15,%rdi
call   10c0 <fopen@plt>
test   %rax,%rax
je     133d <main+0x18d>
mov    %rax,%r13
lea    0xdfe(%rip),%rsi
mov    %r14,%rdi
call   10c0 <fopen@plt>
test   %rax,%rax
je     1352 <main+0x1a2>
mov    %rax,%r12
mov    %r13,%rdi
call   10a0 <feof@plt>
test   %rax,%rax
jne    1387 <main+0x1d7>
mov    %r13,%rdi
call   1070 <fgetc@plt>
mov    %eax,%ebp
mov    %r13,%rdi
call   10a0 <feof@plt>
test   %rax,%rax
jne    1387 <main+0x1d7>
mov    %r13,%rdi
call   1070 <fgetc@plt>
mov    %eax,%ebx
mov    %r13,%rdi
call   10a0 <feof@plt>
test   %rax,%rax
jne    137b <main+0x1cb>
cmp    $0x8,%bpl
je     12a8 <main+0xf8>
cmp    $0x8,%bl
jne    1306 <main+0x156>
mov    %r13,%rdi
call   1070 <fgetc@plt>
mov    %eax,%ebx
jmp    1312 <main+0x162>
movsbl %bpl,%edi
mov    %r12,%rsi
call   1080 <fputc@plt>
movsbl %bl,%edi
mov    %r12,%rsi
call   1080 <fputc@plt>
jmp    12a8 <main+0xf8>
mov    0x2cba(%rip),%rax
mov    (%rax),%edi
lea    0xd00(%rip),%rsi
xor    %eax,%eax
call   1090 <fprintf@plt>
mov    $0x1,%ebp
jmp    13b0 <main+0x200>
mov    0x2c9c(%rip),%rax
mov    (%rax),%edi
lea    0xd25(%rip),%rsi
mov    %r15,%rdx
jmp    136d <main+0x1bd>
mov    %r13,%rdi
call   1050 <fclose@plt>
mov    0x2c7f(%rip),%rax
mov    (%rax),%edi
lea    0xd08(%rip),%rsi
mov    %r14,%rdx
xor    %eax,%eax
call   1090 <fprintf@plt>
mov    $0x1,%ebp
jmp    13b0 <main+0x200>
movsbl %bpl,%edi
mov    %r12,%rsi
call   1080 <fputc@plt>
mov    0x2c4a(%rip),%rax
mov    (%rax),%edi
lea    0xcfe(%rip),%rsi
xor    %ebp,%ebp
xor    %eax,%eax
call   1090 <fprintf@plt>
mov    %r13,%rdi
call   1050 <fclose@plt>
mov    %r12,%rdi
call   1050 <fclose@plt>
mov    %r14,%rdi
call   1030 <free@plt>
mov    %r15,%rdi
call   1030 <free@plt>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [47 x i8] c"You must give a filename on the command line.\0A\00"
@.str.1 = [25 x i8] c"Cannot allocate memory.\0A\00"
@.str.2 = [5 x i8] c".txt\00"
@stdout = global i32 0
@.str.3 = [23 x i8] c"Processing file <%s>:\0A\00"
@.str.4 = [11 x i8] c"Pass 1... \00"
@.str.5 = [3 x i8] c"rb\00"
@.str.6 = [32 x i8] c"Unable to open this file: <%s>\0A\00"
@.str.7 = [3 x i8] c"wb\00"
@.str.8 = [7 x i8] c"Done.\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i32*
%9 = alloca i32*
%10 = alloca [3 x i8]
%11 = alloca i64
%12 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i8* null, i8** %6
store i8* null, i8** %7
store i32 0, i32* %12
%13 = load i32, i32* %4
%14 = icmp slt i32 %13, 2
br i1 %14, label %15, label %18
15: ; preds = %2
%16 = load i32, i32* @stderr
%17 = call i32 (i32, i8*, ...) @fprintf(i32 %16, i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
store i32 1, i32* %12
br label %132
18: ; preds = %2
%19 = load i8**, i8*** %5
%20 = getelementptr inbounds i8*, i8** %19, i64 1
%21 = load i8*, i8** %20
%22 = call i64 @strlen(i8* %21)
store i64 %22, i64* %11
%23 = load i64, i64* %11
%24 = add i64 %23, 1
%25 = call i8* @malloc(i64 %24)
store i8* %25, i8** %6
%26 = load i64, i64* %11
%27 = add i64 %26, 5
%28 = call i8* @malloc(i64 %27)
store i8* %28, i8** %7
%29 = load i8*, i8** %6
%30 = icmp eq i8* %29, null
br i1 %30, label %34, label %31
31: ; preds = %18
%32 = load i8*, i8** %7
%33 = icmp eq i8* %32, null
br i1 %33, label %34, label %37
34: ; preds = %31, %18
%35 = load i32, i32* @stderr
%36 = call i32 (i32, i8*, ...) @fprintf(i32 %35, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0))
store i32 1, i32* %12
br label %132
37: ; preds = %31
%38 = load i8*, i8** %6
%39 = load i8**, i8*** %5
%40 = getelementptr inbounds i8*, i8** %39, i64 1
%41 = load i8*, i8** %40
%42 = call i32 @strcpy(i8* %38, i8* %41)
%43 = load i8*, i8** %7
%44 = load i8*, i8** %6
%45 = call i32 @strcpy(i8* %43, i8* %44)
%46 = load i8*, i8** %7
%47 = load i64, i64* %11
%48 = getelementptr inbounds i8, i8* %46, i64 %47
%49 = call i32 @strcat(i8* %48, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
%50 = load i32, i32* @stdout
%51 = load i8*, i8** %6
%52 = call i32 (i32, i8*, ...) @fprintf(i32 %50, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.3, i64 0, i64 0), i8* %51)
%53 = load i32, i32* @stdout
%54 = call i32 (i32, i8*, ...) @fprintf(i32 %53, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.4, i64 0, i64 0))
%55 = load i8*, i8** %6
%56 = call i32* @fopen(i8* %55, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0))
store i32* %56, i32** %8
%57 = load i32*, i32** %8
%58 = icmp eq i32* %57, null
br i1 %58, label %59, label %63
59: ; preds = %37
%60 = load i32, i32* @stderr
%61 = load i8*, i8** %6
%62 = call i32 (i32, i8*, ...) @fprintf(i32 %60, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.6, i64 0, i64 0), i8* %61)
store i32 1, i32* %12
br label %132
63: ; preds = %37
%64 = load i8*, i8** %7
%65 = call i32* @fopen(i8* %64, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.7, i64 0, i64 0))
store i32* %65, i32** %9
%66 = load i32*, i32** %9
%67 = icmp eq i32* %66, null
br i1 %67, label %68, label %74
68: ; preds = %63
%69 = load i32*, i32** %8
%70 = call i32 @fclose(i32* %69)
%71 = load i32, i32* @stderr
%72 = load i8*, i8** %7
%73 = call i32 (i32, i8*, ...) @fprintf(i32 %71, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.6, i64 0, i64 0), i8* %72)
store i32 1, i32* %12
br label %132
74: ; preds = %63
br label %75
75: ; preds = %116, %111, %105, %74
%76 = load i32*, i32** %8
%77 = call i64 @feof(i32* %76)
%78 = icmp ne i64 %77, 0
%79 = xor i1 %78, true
br i1 %79, label %80, label %125
80: ; preds = %75
%81 = load i32*, i32** %8
%82 = call signext i8 @fgetc(i32* %81)
%83 = getelementptr inbounds [3 x i8], [3 x i8]* %10, i64 0, i64 0
store i8 %82, i8* %83
%84 = load i32*, i32** %8
%85 = call i64 @feof(i32* %84)
%86 = icmp ne i64 %85, 0
br i1 %86, label %87, label %88
87: ; preds = %80
br label %125
88: ; preds = %80
%89 = load i32*, i32** %8
%90 = call signext i8 @fgetc(i32* %89)
%91 = getelementptr inbounds [3 x i8], [3 x i8]* %10, i64 0, i64 1
store i8 %90, i8* %91
%92 = load i32*, i32** %8
%93 = call i64 @feof(i32* %92)
%94 = icmp ne i64 %93, 0
br i1 %94, label %95, label %100
95: ; preds = %88
%96 = getelementptr inbounds [3 x i8], [3 x i8]* %10, i64 0, i64 0
%97 = load i8, i8* %96
%98 = load i32*, i32** %9
%99 = call i32 @fputc(i8 signext %97, i32* %98)
br label %125
100: ; preds = %88
%101 = getelementptr inbounds [3 x i8], [3 x i8]* %10, i64 0, i64 0
%102 = load i8, i8* %101
%103 = sext i8 %102 to i32
%104 = icmp eq i32 %103, 8
br i1 %104, label %105, label %106
105: ; preds = %100
br label %75
106: ; preds = %100
%107 = getelementptr inbounds [3 x i8], [3 x i8]* %10, i64 0, i64 1
%108 = load i8, i8* %107
%109 = sext i8 %108 to i32
%110 = icmp eq i32 %109, 8
br i1 %110, label %111, label %116
111: ; preds = %106
%112 = load i32*, i32** %8
%113 = call signext i8 @fgetc(i32* %112)
%114 = load i32*, i32** %9
%115 = call i32 @fputc(i8 signext %113, i32* %114)
br label %75
116: ; preds = %106
%117 = getelementptr inbounds [3 x i8], [3 x i8]* %10, i64 0, i64 0
%118 = load i8, i8* %117
%119 = load i32*, i32** %9
%120 = call i32 @fputc(i8 signext %118, i32* %119)
%121 = getelementptr inbounds [3 x i8], [3 x i8]* %10, i64 0, i64 1
%122 = load i8, i8* %121
%123 = load i32*, i32** %9
%124 = call i32 @fputc(i8 signext %122, i32* %123)
br label %75
125: ; preds = %95, %87, %75
%126 = load i32, i32* @stdout
%127 = call i32 (i32, i8*, ...) @fprintf(i32 %126, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.8, i64 0, i64 0))
%128 = load i32*, i32** %8
%129 = call i32 @fclose(i32* %128)
%130 = load i32*, i32** %9
%131 = call i32 @fclose(i32* %130)
br label %132
132: ; preds = %125, %68, %59, %34, %15
%133 = load i8*, i8** %7
%134 = call i32 @free(i8* %133)
%135 = load i8*, i8** %6
%136 = call i32 @free(i8* %135)
%137 = load i32, i32* %12
ret i32 %137
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [47 x i8] c"You must give a filename on the command line.\0A\00"
@.str.1 = [25 x i8] c"Cannot allocate memory.\0A\00"
@.str.2 = [5 x i8] c".txt\00"
@stdout = global i32 0
@.str.3 = [23 x i8] c"Processing file <%s>:\0A\00"
@.str.4 = [11 x i8] c"Pass 1... \00"
@.str.5 = [3 x i8] c"rb\00"
@.str.6 = [32 x i8] c"Unable to open this file: <%s>\0A\00"
@.str.7 = [3 x i8] c"wb\00"
@.str.8 = [7 x i8] c"Done.\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp slt i32 %0, 2
br i1 %3, label %4, label %7
4: ; preds = %2
%5 = load i32, i32* @stderr
%6 = tail call i32 (i32, i8*, ...) @fprintf(i32 %5, i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
br label %74
7: ; preds = %2
%8 = getelementptr inbounds i8*, i8** %1, i64 1
%9 = load i8*, i8** %8
%10 = tail call i64 @strlen(i8* dereferenceable(1) %9)
%11 = add i64 %10, 1
%12 = tail call i8* @malloc(i64 %11)
%13 = add i64 %10, 5
%14 = tail call i8* @malloc(i64 %13)
%15 = icmp eq i8* %12, null
%16 = icmp eq i8* %14, null
%17 = or i1 %15, %16
br i1 %17, label %18, label %21
18: ; preds = %7
%19 = load i32, i32* @stderr
%20 = tail call i32 (i32, i8*, ...) @fprintf(i32 %19, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0))
br label %74
21: ; preds = %7
%22 = tail call i32 @strcpy(i8* %12, i8* %9)
%23 = tail call i32 @strcpy(i8* %14, i8* %12)
%24 = getelementptr inbounds i8, i8* %14, i64 %10
%25 = tail call i32 @strcat(i8* %24, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
%26 = load i32, i32* @stdout
%27 = tail call i32 (i32, i8*, ...) @fprintf(i32 %26, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.3, i64 0, i64 0), i8* %12)
%28 = load i32, i32* @stdout
%29 = tail call i32 (i32, i8*, ...) @fprintf(i32 %28, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.4, i64 0, i64 0))
%30 = tail call i32* @fopen(i8* %12, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0))
%31 = icmp eq i32* %30, null
br i1 %31, label %32, label %35
32: ; preds = %21
%33 = load i32, i32* @stderr
%34 = tail call i32 (i32, i8*, ...) @fprintf(i32 %33, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.6, i64 0, i64 0), i8* %12)
br label %74
35: ; preds = %21
%36 = tail call i32* @fopen(i8* %14, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.7, i64 0, i64 0))
%37 = icmp eq i32* %36, null
br i1 %37, label %41, label %38
38: ; preds = %35
%39 = tail call i64 @feof(i32* %30)
%40 = icmp eq i64 %39, 0
br i1 %40, label %45, label %69
41: ; preds = %35
%42 = tail call i32 @fclose(i32* %30)
%43 = load i32, i32* @stderr
%44 = tail call i32 (i32, i8*, ...) @fprintf(i32 %43, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.6, i64 0, i64 0), i8* %14)
br label %74
45: ; preds = %38, %64
%46 = tail call signext i8 @fgetc(i32* %30)
%47 = tail call i64 @feof(i32* %30)
%48 = icmp eq i64 %47, 0
br i1 %48, label %49, label %69
49: ; preds = %45
%50 = tail call signext i8 @fgetc(i32* %30)
%51 = tail call i64 @feof(i32* %30)
%52 = icmp eq i64 %51, 0
br i1 %52, label %55, label %53
53: ; preds = %49
%54 = tail call i32 @fputc(i8 signext %46, i32* %36)
br label %69
55: ; preds = %49
%56 = icmp eq i8 %46, 8
br i1 %56, label %64, label %57
57: ; preds = %55
%58 = icmp eq i8 %50, 8
br i1 %58, label %59, label %67
59: ; preds = %57
%60 = tail call signext i8 @fgetc(i32* %30)
br label %61
61: ; preds = %67, %59
%62 = phi i8 [ %60, %59 ], [ %50, %67 ]
%63 = tail call i32 @fputc(i8 signext %62, i32* %36)
br label %64
64: ; preds = %61, %55
%65 = tail call i64 @feof(i32* %30)
%66 = icmp eq i64 %65, 0
br i1 %66, label %45, label %69
67: ; preds = %57
%68 = tail call i32 @fputc(i8 signext %46, i32* %36)
br label %61
69: ; preds = %64, %45, %38, %53
%70 = load i32, i32* @stdout
%71 = tail call i32 (i32, i8*, ...) @fprintf(i32 %70, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.8, i64 0, i64 0))
%72 = tail call i32 @fclose(i32* %30)
%73 = tail call i32 @fclose(i32* %36)
br label %74
74: ; preds = %69, %41, %32, %18, %4
%75 = phi i8* [ null, %4 ], [ %14, %18 ], [ %14, %32 ], [ %14, %41 ], [ %14, %69 ]
%76 = phi i8* [ null, %4 ], [ %12, %18 ], [ %12, %32 ], [ %12, %41 ], [ %12, %69 ]
%77 = phi i32 [ 1, %4 ], [ 1, %18 ], [ 1, %32 ], [ 1, %41 ], [ 0, %69 ]
%78 = tail call i32 @free(i8* %75)
%79 = tail call i32 @free(i8* %76)
ret i32 %77
}