#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*/ exit(int);
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
scalar_t__ feof(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
scalar_t__ fread(char *, int, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ fwrite(char *, int, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ printf(char *);
int main(void) {
  FILE *p0 = NULL;
  FILE *p1 = NULL;
  FILE *p2 = NULL;
  FILE *p3 = NULL;
  char c = '%';
  int i = 0;
  p0 = fopen("answer.txt", "w+");
  if (NULL == p0) {
    printf("p0: Open error!\n");
    exit(0);
  }
  p1 = fopen("top.txt", "r");
  if (NULL == p1) {
    printf("p1: Open error!\n");
    fclose(p0);
    exit(1);
  }
  i = 0;
  while (1) {
    if (fread(&c, 1, 1, p1) <= 0) {
      break;
    }
    if (c == '\n') {
      if (++i == 1)
        continue;
    }
    fwrite(&c, 1, 1, p0);
  }
  fwrite("\t", 1, 1, p0);
  fwrite("\t", 1, 1, p0);
  p2 = fopen("title.txt", "r");
  if (NULL == p2) {
    printf("p2: Open error!");
    fclose(p0);
    fclose(p1);
    exit(2);
  }
  while (1) {
    fread(&c, 1, 1, p2);
    if (feof(p2)) {
      break;
    }
    fwrite(&c, 1, 1, p0);
  }
  i = 0;
  while (i++ < 12) {
    fwrite("\t", 1, 1, p0);
  }
  p3 = fopen("../pictures/url.txt", "r");
  if (NULL == p3) {
    printf("p3: Open error!\n");
    fclose(p0);
    fclose(p1);
    fclose(p2);
    exit(3);
  }
  while (1) {
    fread(&c, 1, 1, p3);
    if (feof(p3)) {
      break;
    }
    if (c == '\n') {
      fwrite("\t", 1, 1, p0);
      continue;
    }
    fwrite(&c, 1, 1, p0);
  }
  fclose(p0);
  fclose(p1);
  fclose(p2);
  fclose(p3);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
movq   $0x0,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
movq   $0x0,-0x20(%rbp)
movq   $0x0,-0x28(%rbp)
movb   $0x25,-0x29(%rbp)
movl   $0x0,-0x30(%rbp)
lea    0xe4f(%rip),%rdi
lea    0xe53(%rip),%rsi
call   1070 <fopen@plt>
mov    %rax,-0x10(%rbp)
xor    %eax,%eax
cmp    -0x10(%rbp),%rax
jne    11e0 <main+0x70>
lea    0xe3a(%rip),%rdi
call   1050 <printf@plt>
xor    %edi,%edi
call   1080 <exit@plt>
lea    0xe38(%rip),%rdi
lea    0xe39(%rip),%rsi
call   1070 <fopen@plt>
mov    %rax,-0x18(%rbp)
xor    %eax,%eax
cmp    -0x18(%rbp),%rax
jne    1222 <main+0xb2>
lea    0xe1f(%rip),%rdi
call   1050 <printf@plt>
mov    -0x10(%rbp),%rdi
call   1040 <fclose@plt>
mov    $0x1,%edi
call   1080 <exit@plt>
movl   $0x0,-0x30(%rbp)
mov    -0x18(%rbp),%rcx
lea    -0x29(%rbp),%rdi
mov    $0x1,%edx
mov    %edx,%esi
call   1030 <fread@plt>
cmp    $0x0,%rax
jg     124c <main+0xdc>
jmp    128e <main+0x11e>
movsbl -0x29(%rbp),%eax
cmp    $0xa,%eax
jne    1275 <main+0x105>
mov    -0x30(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x30(%rbp)
cmp    $0x1,%eax
jne    1270 <main+0x100>
jmp    1229 <main+0xb9>
jmp    1275 <main+0x105>
mov    -0x10(%rbp),%rcx
lea    -0x29(%rbp),%rdi
mov    $0x1,%edx
mov    %edx,%esi
call   1090 <fwrite@plt>
jmp    1229 <main+0xb9>
mov    -0x10(%rbp),%rcx
lea    0xda1(%rip),%rdi
mov    $0x1,%edx
mov    %edx,%esi
call   1090 <fwrite@plt>
mov    -0x10(%rbp),%rcx
lea    0xd8a(%rip),%rdi
mov    $0x1,%edx
mov    %edx,%esi
call   1090 <fwrite@plt>
lea    0xd79(%rip),%rdi
lea    0xd5d(%rip),%rsi
call   1070 <fopen@plt>
mov    %rax,-0x20(%rbp)
xor    %eax,%eax
cmp    -0x20(%rbp),%rax
jne    1307 <main+0x197>
lea    0xd60(%rip),%rdi
call   1050 <printf@plt>
mov    -0x10(%rbp),%rdi
call   1040 <fclose@plt>
mov    -0x18(%rbp),%rdi
call   1040 <fclose@plt>
mov    $0x2,%edi
call   1080 <exit@plt>
jmp    130c <main+0x19c>
mov    -0x20(%rbp),%rcx
lea    -0x29(%rbp),%rdi
mov    $0x1,%edx
mov    %edx,%esi
call   1030 <fread@plt>
mov    -0x20(%rbp),%rdi
call   1060 <feof@plt>
cmp    $0x0,%rax
je     1338 <main+0x1c8>
jmp    1351 <main+0x1e1>
mov    -0x10(%rbp),%rcx
lea    -0x29(%rbp),%rdi
mov    $0x1,%edx
mov    %edx,%esi
call   1090 <fwrite@plt>
jmp    130c <main+0x19c>
movl   $0x0,-0x30(%rbp)
mov    -0x30(%rbp),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,-0x30(%rbp)
cmp    $0xc,%eax
jge    1388 <main+0x218>
mov    -0x10(%rbp),%rcx
lea    0xcc3(%rip),%rdi
mov    $0x1,%edx
mov    %edx,%esi
call   1090 <fwrite@plt>
jmp    1358 <main+0x1e8>
lea    0xcc7(%rip),%rdi
lea    0xc91(%rip),%rsi
call   1070 <fopen@plt>
mov    %rax,-0x28(%rbp)
xor    %eax,%eax
cmp    -0x28(%rbp),%rax
jne    13dc <main+0x26c>
lea    0xcb8(%rip),%rdi
call   1050 <printf@plt>
mov    -0x10(%rbp),%rdi
call   1040 <fclose@plt>
mov    -0x18(%rbp),%rdi
call   1040 <fclose@plt>
mov    -0x20(%rbp),%rdi
call   1040 <fclose@plt>
mov    $0x3,%edi
call   1080 <exit@plt>
jmp    13e1 <main+0x271>
mov    -0x28(%rbp),%rcx
lea    -0x29(%rbp),%rdi
mov    $0x1,%edx
mov    %edx,%esi
call   1030 <fread@plt>
mov    -0x28(%rbp),%rdi
call   1060 <feof@plt>
cmp    $0x0,%rax
je     140d <main+0x29d>
jmp    144f <main+0x2df>
movsbl -0x29(%rbp),%eax
cmp    $0xa,%eax
jne    1436 <main+0x2c6>
mov    -0x10(%rbp),%rcx
lea    0xc15(%rip),%rdi
mov    $0x1,%edx
mov    %edx,%esi
call   1090 <fwrite@plt>
jmp    13e1 <main+0x271>
mov    -0x10(%rbp),%rcx
lea    -0x29(%rbp),%rdi
mov    $0x1,%edx
mov    %edx,%esi
call   1090 <fwrite@plt>
jmp    13e1 <main+0x271>
mov    -0x10(%rbp),%rdi
call   1040 <fclose@plt>
mov    -0x18(%rbp),%rdi
call   1040 <fclose@plt>
mov    -0x20(%rbp),%rdi
call   1040 <fclose@plt>
mov    -0x28(%rbp),%rdi
call   1040 <fclose@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
movb   $0x25,0x7(%rsp)
lea    0xe69(%rip),%rdi
lea    0xe6d(%rip),%rsi
call   1090 <fopen@plt>
test   %rax,%rax
je     1428 <main+0x2a8>
mov    %rax,%r12
lea    0xe58(%rip),%rdi
lea    0xe59(%rip),%rsi
call   1090 <fopen@plt>
test   %rax,%rax
je     143b <main+0x2bb>
mov    %rax,%r14
lea    0x7(%rsp),%rdi
mov    $0x1,%esi
mov    $0x1,%edx
mov    %rax,%rcx
call   1040 <fread@plt>
test   %rax,%rax
jle    123a <main+0xba>
xor    %ebp,%ebp
lea    0x7(%rsp),%rbx
jmp    1225 <main+0xa5>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
add    $0x1,%ebp
mov    %r12,%rsi
call   1070 <fputc@plt>
mov    %rbx,%rdi
mov    $0x1,%esi
mov    $0x1,%edx
mov    %r14,%rcx
call   1040 <fread@plt>
test   %rax,%rax
jle    123a <main+0xba>
movsbl 0x7(%rsp),%edi
cmp    $0xa,%edi
jne    1203 <main+0x83>
test   %ebp,%ebp
jne    1200 <main+0x80>
mov    $0x1,%ebp
jmp    120b <main+0x8b>
mov    $0x9,%edi
mov    %r12,%rsi
call   1070 <fputc@plt>
mov    $0x9,%edi
mov    %r12,%rsi
call   1070 <fputc@plt>
lea    0xdbd(%rip),%rdi
lea    0xdb4(%rip),%rsi
call   1090 <fopen@plt>
test   %rax,%rax
je     1459 <main+0x2d9>
mov    %rax,%r15
lea    0x7(%rsp),%rdi
mov    $0x1,%esi
mov    $0x1,%edx
mov    %rax,%rcx
call   1040 <fread@plt>
mov    %r15,%rdi
call   1080 <feof@plt>
test   %rax,%rax
jne    12cf <main+0x14f>
lea    0x7(%rsp),%rbx
nopl   0x0(%rax)
movsbl 0x7(%rsp),%edi
mov    %r12,%rsi
call   1070 <fputc@plt>
mov    %rbx,%rdi
mov    $0x1,%esi
mov    $0x1,%edx
mov    %r15,%rcx
call   1040 <fread@plt>
mov    %r15,%rdi
call   1080 <feof@plt>
test   %rax,%rax
je     12a0 <main+0x120>
mov    $0x9,%edi
mov    %r12,%rsi
call   1070 <fputc@plt>
mov    $0x9,%edi
mov    %r12,%rsi
call   1070 <fputc@plt>
mov    $0x9,%edi
mov    %r12,%rsi
call   1070 <fputc@plt>
mov    $0x9,%edi
mov    %r12,%rsi
call   1070 <fputc@plt>
mov    $0x9,%edi
mov    %r12,%rsi
call   1070 <fputc@plt>
mov    $0x9,%edi
mov    %r12,%rsi
call   1070 <fputc@plt>
mov    $0x9,%edi
mov    %r12,%rsi
call   1070 <fputc@plt>
mov    $0x9,%edi
mov    %r12,%rsi
call   1070 <fputc@plt>
mov    $0x9,%edi
mov    %r12,%rsi
call   1070 <fputc@plt>
mov    $0x9,%edi
mov    %r12,%rsi
call   1070 <fputc@plt>
mov    $0x9,%edi
mov    %r12,%rsi
call   1070 <fputc@plt>
mov    $0x9,%edi
mov    %r12,%rsi
call   1070 <fputc@plt>
lea    0xcc0(%rip),%rdi
lea    0xc9d(%rip),%rsi
call   1090 <fopen@plt>
test   %rax,%rax
je     147f <main+0x2ff>
mov    %rax,%rbx
lea    0x7(%rsp),%rdi
mov    $0x1,%esi
mov    $0x1,%edx
mov    %rax,%rcx
call   1040 <fread@plt>
mov    %rbx,%rdi
call   1080 <feof@plt>
test   %rax,%rax
jne    13f7 <main+0x277>
mov    $0x9,%ebp
lea    0x7(%rsp),%r13
nopl   0x0(%rax,%rax,1)
movzbl 0x7(%rsp),%eax
cmp    $0xa,%al
cmove  %ebp,%eax
movsbl %al,%edi
mov    %r12,%rsi
call   1070 <fputc@plt>
mov    %r13,%rdi
mov    $0x1,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1040 <fread@plt>
mov    %rbx,%rdi
call   1080 <feof@plt>
test   %rax,%rax
je     13c0 <main+0x240>
mov    %r12,%rdi
call   1050 <fclose@plt>
mov    %r14,%rdi
call   1050 <fclose@plt>
mov    %r15,%rdi
call   1050 <fclose@plt>
mov    %rbx,%rdi
call   1050 <fclose@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0xc37(%rip),%rdi
call   1030 <puts@plt>
xor    %edi,%edi
call   10a0 <exit@plt>
lea    0xc14(%rip),%rdi
call   1030 <puts@plt>
mov    %r12,%rdi
call   1050 <fclose@plt>
mov    $0x1,%edi
call   10a0 <exit@plt>
lea    0xbc2(%rip),%rdi
call   1060 <printf@plt>
mov    %r12,%rdi
call   1050 <fclose@plt>
mov    %r14,%rdi
call   1050 <fclose@plt>
mov    $0x2,%edi
call   10a0 <exit@plt>
lea    0xbc0(%rip),%rdi
call   1030 <puts@plt>
mov    %r12,%rdi
call   1050 <fclose@plt>
mov    %r14,%rdi
call   1050 <fclose@plt>
mov    %r15,%rdi
call   1050 <fclose@plt>
mov    $0x3,%edi
call   10a0 <exit@plt>

LLVM IR (-O0):
@.str = [11 x i8] c"answer.txt\00"
@.str.1 = [3 x i8] c"w+\00"
@.str.2 = [17 x i8] c"p0: Open error!\0A\00"
@.str.3 = [8 x i8] c"top.txt\00"
@.str.4 = [2 x i8] c"r\00"
@.str.5 = [17 x i8] c"p1: Open error!\0A\00"
@.str.6 = [2 x i8] c"\09\00"
@.str.7 = [10 x i8] c"title.txt\00"
@.str.8 = [16 x i8] c"p2: Open error!\00"
@.str.9 = [20 x i8] c"../pictures/url.txt\00"
@.str.10 = [17 x i8] c"p3: Open error!\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32*
%3 = alloca i32*
%4 = alloca i32*
%5 = alloca i32*
%6 = alloca i8
%7 = alloca i32
store i32 0, i32* %1
store i32* null, i32** %2
store i32* null, i32** %3
store i32* null, i32** %4
store i32* null, i32** %5
store i8 37, i8* %6
store i32 0, i32* %7
%8 = call i32* @fopen(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
store i32* %8, i32** %2
%9 = load i32*, i32** %2
%10 = icmp eq i32* null, %9
br i1 %10, label %11, label %14
11: ; preds = %0
%12 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0))
%13 = call i32 @exit(i32 0)
unreachable
14: ; preds = %0
%15 = call i32* @fopen(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
store i32* %15, i32** %3
%16 = load i32*, i32** %3
%17 = icmp eq i32* null, %16
br i1 %17, label %18, label %23
18: ; preds = %14
%19 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.5, i64 0, i64 0))
%20 = load i32*, i32** %2
%21 = call i32 @fclose(i32* %20)
%22 = call i32 @exit(i32 1)
unreachable
23: ; preds = %14
store i32 0, i32* %7
br label %24
24: ; preds = %23, %37, %39
%25 = load i32*, i32** %3
%26 = call i64 @fread(i8* %6, i32 1, i32 1, i32* %25)
%27 = icmp sle i64 %26, 0
br i1 %27, label %28, label %29
28: ; preds = %24
br label %42
29: ; preds = %24
%30 = load i8, i8* %6
%31 = sext i8 %30 to i32
%32 = icmp eq i32 %31, 10
br i1 %32, label %33, label %39
33: ; preds = %29
%34 = load i32, i32* %7
%35 = add nsw i32 %34, 1
store i32 %35, i32* %7
%36 = icmp eq i32 %35, 1
br i1 %36, label %37, label %38
37: ; preds = %33
br label %24
38: ; preds = %33
br label %39
39: ; preds = %38, %29
%40 = load i32*, i32** %2
%41 = call i32 @fwrite(i8* %6, i32 1, i32 1, i32* %40)
br label %24
42: ; preds = %28
%43 = load i32*, i32** %2
%44 = call i32 @fwrite(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.6, i64 0, i64 0), i32 1, i32 1, i32* %43)
%45 = load i32*, i32** %2
%46 = call i32 @fwrite(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.6, i64 0, i64 0), i32 1, i32 1, i32* %45)
%47 = call i32* @fopen(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.7, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
store i32* %47, i32** %4
%48 = load i32*, i32** %4
%49 = icmp eq i32* null, %48
br i1 %49, label %50, label %57
50: ; preds = %42
%51 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.8, i64 0, i64 0))
%52 = load i32*, i32** %2
%53 = call i32 @fclose(i32* %52)
%54 = load i32*, i32** %3
%55 = call i32 @fclose(i32* %54)
%56 = call i32 @exit(i32 2)
unreachable
57: ; preds = %42
br label %58
58: ; preds = %57, %65
%59 = load i32*, i32** %4
%60 = call i64 @fread(i8* %6, i32 1, i32 1, i32* %59)
%61 = load i32*, i32** %4
%62 = call i64 @feof(i32* %61)
%63 = icmp ne i64 %62, 0
br i1 %63, label %64, label %65
64: ; preds = %58
br label %68
65: ; preds = %58
%66 = load i32*, i32** %2
%67 = call i32 @fwrite(i8* %6, i32 1, i32 1, i32* %66)
br label %58
68: ; preds = %64
store i32 0, i32* %7
br label %69
69: ; preds = %73, %68
%70 = load i32, i32* %7
%71 = add nsw i32 %70, 1
store i32 %71, i32* %7
%72 = icmp slt i32 %70, 12
br i1 %72, label %73, label %76
73: ; preds = %69
%74 = load i32*, i32** %2
%75 = call i32 @fwrite(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.6, i64 0, i64 0), i32 1, i32 1, i32* %74)
br label %69
76: ; preds = %69
%77 = call i32* @fopen(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.9, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
store i32* %77, i32** %5
%78 = load i32*, i32** %5
%79 = icmp eq i32* null, %78
br i1 %79, label %80, label %89
80: ; preds = %76
%81 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.10, i64 0, i64 0))
%82 = load i32*, i32** %2
%83 = call i32 @fclose(i32* %82)
%84 = load i32*, i32** %3
%85 = call i32 @fclose(i32* %84)
%86 = load i32*, i32** %4
%87 = call i32 @fclose(i32* %86)
%88 = call i32 @exit(i32 3)
unreachable
89: ; preds = %76
br label %90
90: ; preds = %89, %101, %104
%91 = load i32*, i32** %5
%92 = call i64 @fread(i8* %6, i32 1, i32 1, i32* %91)
%93 = load i32*, i32** %5
%94 = call i64 @feof(i32* %93)
%95 = icmp ne i64 %94, 0
br i1 %95, label %96, label %97
96: ; preds = %90
br label %107
97: ; preds = %90
%98 = load i8, i8* %6
%99 = sext i8 %98 to i32
%100 = icmp eq i32 %99, 10
br i1 %100, label %101, label %104
101: ; preds = %97
%102 = load i32*, i32** %2
%103 = call i32 @fwrite(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.6, i64 0, i64 0), i32 1, i32 1, i32* %102)
br label %90
104: ; preds = %97
%105 = load i32*, i32** %2
%106 = call i32 @fwrite(i8* %6, i32 1, i32 1, i32* %105)
br label %90
107: ; preds = %96
%108 = load i32*, i32** %2
%109 = call i32 @fclose(i32* %108)
%110 = load i32*, i32** %3
%111 = call i32 @fclose(i32* %110)
%112 = load i32*, i32** %4
%113 = call i32 @fclose(i32* %112)
%114 = load i32*, i32** %5
%115 = call i32 @fclose(i32* %114)
ret i32 0
}

LLVM IR (-O2):
@.str = [11 x i8] c"answer.txt\00"
@.str.1 = [3 x i8] c"w+\00"
@.str.3 = [8 x i8] c"top.txt\00"
@.str.4 = [2 x i8] c"r\00"
@.str.7 = [10 x i8] c"title.txt\00"
@.str.8 = [16 x i8] c"p2: Open error!\00"
@.str.9 = [20 x i8] c"../pictures/url.txt\00"
@str = [16 x i8] c"p3: Open error!\00"
@str.11 = [16 x i8] c"p1: Open error!\00"
@str.12 = [16 x i8] c"p0: Open error!\00"
define i32 @main() {
%1 = alloca i8
store i8 37, i8* %1
%2 = tail call i32* @fopen(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%3 = icmp eq i32* %2, null
br i1 %3, label %4, label %7
4: ; preds = %0
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str.12, i64 0, i64 0))
%6 = tail call i32 @exit(i32 0)
unreachable
7: ; preds = %0
%8 = tail call i32* @fopen(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
%9 = icmp eq i32* %8, null
br i1 %9, label %13, label %10
10: ; preds = %7
%11 = call i64 @fread(i8* %1, i32 1, i32 1, i32* %8)
%12 = icmp slt i64 %11, 1
br i1 %12, label %32, label %17
13: ; preds = %7
%14 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str.11, i64 0, i64 0))
%15 = tail call i32 @fclose(i32* %2)
%16 = tail call i32 @exit(i32 1)
unreachable
17: ; preds = %10, %28
%18 = phi i32 [ %29, %28 ], [ 0, %10 ]
%19 = load i8, i8* %1
%20 = icmp eq i8 %19, 10
br i1 %20, label %21, label %24
21: ; preds = %17
%22 = add nsw i32 %18, 1
%23 = icmp eq i32 %18, 0
br i1 %23, label %28, label %24
24: ; preds = %21, %17
%25 = phi i32 [ %22, %21 ], [ %18, %17 ]
%26 = sext i8 %19 to i32
%27 = tail call i32 @fputc(i32 %26, i32* %2)
br label %28
28: ; preds = %24, %21
%29 = phi i32 [ 1, %21 ], [ %25, %24 ]
%30 = call i64 @fread(i8* %1, i32 1, i32 1, i32* %8)
%31 = icmp slt i64 %30, 1
br i1 %31, label %32, label %17
32: ; preds = %28, %10
%33 = tail call i32 @fputc(i32 9, i32* %2)
%34 = tail call i32 @fputc(i32 9, i32* %2)
%35 = tail call i32* @fopen(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.7, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
%36 = icmp eq i32* %35, null
br i1 %36, label %41, label %37
37: ; preds = %32
%38 = call i64 @fread(i8* %1, i32 1, i32 1, i32* %35)
%39 = tail call i64 @feof(i32* %35)
%40 = icmp eq i64 %39, 0
br i1 %40, label %61, label %46
41: ; preds = %32
%42 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.8, i64 0, i64 0))
%43 = tail call i32 @fclose(i32* %2)
%44 = tail call i32 @fclose(i32* %8)
%45 = tail call i32 @exit(i32 2)
unreachable
46: ; preds = %61, %37
%47 = tail call i32 @fputc(i32 9, i32* %2)
%48 = tail call i32 @fputc(i32 9, i32* %2)
%49 = tail call i32 @fputc(i32 9, i32* %2)
%50 = tail call i32 @fputc(i32 9, i32* %2)
%51 = tail call i32 @fputc(i32 9, i32* %2)
%52 = tail call i32 @fputc(i32 9, i32* %2)
%53 = tail call i32 @fputc(i32 9, i32* %2)
%54 = tail call i32 @fputc(i32 9, i32* %2)
%55 = tail call i32 @fputc(i32 9, i32* %2)
%56 = tail call i32 @fputc(i32 9, i32* %2)
%57 = tail call i32 @fputc(i32 9, i32* %2)
%58 = tail call i32 @fputc(i32 9, i32* %2)
%59 = tail call i32* @fopen(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.9, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
%60 = icmp eq i32* %59, null
br i1 %60, label %72, label %68
61: ; preds = %37, %61
%62 = load i8, i8* %1
%63 = sext i8 %62 to i32
%64 = tail call i32 @fputc(i32 %63, i32* %2)
%65 = call i64 @fread(i8* %1, i32 1, i32 1, i32* %35)
%66 = tail call i64 @feof(i32* %35)
%67 = icmp eq i64 %66, 0
br i1 %67, label %61, label %46
68: ; preds = %46
%69 = call i64 @fread(i8* %1, i32 1, i32 1, i32* %59)
%70 = tail call i64 @feof(i32* %59)
%71 = icmp eq i64 %70, 0
br i1 %71, label %78, label %87
72: ; preds = %46
%73 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str, i64 0, i64 0))
%74 = tail call i32 @fclose(i32* %2)
%75 = tail call i32 @fclose(i32* %8)
%76 = tail call i32 @fclose(i32* %35)
%77 = tail call i32 @exit(i32 3)
unreachable
78: ; preds = %68, %78
%79 = load i8, i8* %1
%80 = icmp eq i8 %79, 10
%81 = select i1 %80, i8 9, i8 %79
%82 = sext i8 %81 to i32
%83 = tail call i32 @fputc(i32 %82, i32* %2)
%84 = call i64 @fread(i8* %1, i32 1, i32 1, i32* %59)
%85 = tail call i64 @feof(i32* %59)
%86 = icmp eq i64 %85, 0
br i1 %86, label %78, label %87
87: ; preds = %78, %68
%88 = tail call i32 @fclose(i32* %2)
%89 = tail call i32 @fclose(i32* %8)
%90 = tail call i32 @fclose(i32* %35)
%91 = tail call i32 @fclose(i32* %59)
ret i32 0
}