#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*/ SEEK_CUR;
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
scalar_t__ feof(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fread(char *, int, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ fseek(int /*<<< orphan*/ *, 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 = '%';
  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);
  }
  while (c != '\n') {
    fread(&c, 1, 1, p1);
    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);
  }
  fseek(p0, -1, SEEK_CUR);
  int 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)
lea    0xe46(%rip),%rdi
lea    0xe4a(%rip),%rsi
call   1080 <fopen@plt>
mov    %rax,-0x10(%rbp)
xor    %eax,%eax
cmp    -0x10(%rbp),%rax
jne    11e9 <main+0x69>
lea    0xe31(%rip),%rdi
call   1050 <printf@plt>
xor    %edi,%edi
call   1090 <exit@plt>
lea    0xe2f(%rip),%rdi
lea    0xe30(%rip),%rsi
call   1080 <fopen@plt>
mov    %rax,-0x18(%rbp)
xor    %eax,%eax
cmp    -0x18(%rbp),%rax
jne    122b <main+0xab>
lea    0xe16(%rip),%rdi
call   1050 <printf@plt>
mov    -0x10(%rbp),%rdi
call   1040 <fclose@plt>
mov    $0x1,%edi
call   1090 <exit@plt>
jmp    1230 <main+0xb0>
movsbl -0x29(%rbp),%eax
cmp    $0xa,%eax
je     126a <main+0xea>
mov    -0x18(%rbp),%rcx
lea    -0x29(%rbp),%rdi
mov    $0x1,%edx
mov    %edx,%esi
call   1030 <fread@plt>
mov    -0x10(%rbp),%rcx
lea    -0x29(%rbp),%rdi
mov    $0x1,%edx
mov    %edx,%esi
call   10a0 <fwrite@plt>
jmp    1230 <main+0xb0>
mov    -0x10(%rbp),%rcx
lea    0xdc5(%rip),%rdi
mov    $0x1,%edx
mov    %edx,%esi
call   10a0 <fwrite@plt>
mov    -0x10(%rbp),%rcx
lea    0xdae(%rip),%rdi
mov    $0x1,%edx
mov    %edx,%esi
call   10a0 <fwrite@plt>
lea    0xd9d(%rip),%rdi
lea    0xd81(%rip),%rsi
call   1080 <fopen@plt>
mov    %rax,-0x20(%rbp)
xor    %eax,%eax
cmp    -0x20(%rbp),%rax
jne    12e3 <main+0x163>
lea    0xd84(%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   1090 <exit@plt>
jmp    12e8 <main+0x168>
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     1314 <main+0x194>
jmp    132d <main+0x1ad>
mov    -0x10(%rbp),%rcx
lea    -0x29(%rbp),%rdi
mov    $0x1,%edx
mov    %edx,%esi
call   10a0 <fwrite@plt>
jmp    12e8 <main+0x168>
mov    -0x10(%rbp),%rdi
mov    0x2cb0(%rip),%rax
mov    (%rax),%edx
mov    $0xffffffff,%esi
call   1070 <fseek@plt>
movl   $0x0,-0x30(%rbp)
mov    -0x30(%rbp),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,-0x30(%rbp)
cmp    $0xc,%eax
jge    137b <main+0x1fb>
mov    -0x10(%rbp),%rcx
lea    0xcd0(%rip),%rdi
mov    $0x1,%edx
mov    %edx,%esi
call   10a0 <fwrite@plt>
jmp    134b <main+0x1cb>
lea    0xcd4(%rip),%rdi
lea    0xc9e(%rip),%rsi
call   1080 <fopen@plt>
mov    %rax,-0x28(%rbp)
xor    %eax,%eax
cmp    -0x28(%rbp),%rax
jne    13cf <main+0x24f>
lea    0xcc2(%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   1090 <exit@plt>
jmp    13d4 <main+0x254>
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     1400 <main+0x280>
jmp    1442 <main+0x2c2>
movsbl -0x29(%rbp),%eax
cmp    $0xa,%eax
jne    1429 <main+0x2a9>
mov    -0x10(%rbp),%rcx
lea    0xc22(%rip),%rdi
mov    $0x1,%edx
mov    %edx,%esi
call   10a0 <fwrite@plt>
jmp    13d4 <main+0x254>
mov    -0x10(%rbp),%rcx
lea    -0x29(%rbp),%rdi
mov    $0x1,%edx
mov    %edx,%esi
call   10a0 <fwrite@plt>
jmp    13d4 <main+0x254>
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    0xe59(%rip),%rdi
lea    0xe5d(%rip),%rsi
call   10a0 <fopen@plt>
test   %rax,%rax
je     1418 <main+0x288>
mov    %rax,%r12
lea    0xe48(%rip),%rdi
lea    0xe49(%rip),%rsi
call   10a0 <fopen@plt>
test   %rax,%rax
je     142b <main+0x29b>
mov    %rax,%r14
lea    0x7(%rsp),%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %rbx,%rdi
mov    $0x1,%esi
mov    $0x1,%edx
mov    %r14,%rcx
call   1040 <fread@plt>
movsbl 0x7(%rsp),%ebp
mov    %ebp,%edi
mov    %r12,%rsi
call   1070 <fputc@plt>
cmp    $0xa,%ebp
jne    11f0 <main+0x60>
mov    $0x9,%edi
mov    %r12,%rsi
call   1070 <fputc@plt>
mov    $0x9,%edi
mov    %r12,%rsi
call   1070 <fputc@plt>
lea    0xdde(%rip),%rdi
lea    0xdd5(%rip),%rsi
call   10a0 <fopen@plt>
test   %rax,%rax
je     1449 <main+0x2b9>
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    12af <main+0x11f>
lea    0x7(%rsp),%rbx
nopl   0x0(%rax,%rax,1)
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     1280 <main+0xf0>
mov    0x2d32(%rip),%rax
mov    (%rax),%edx
mov    %r12,%rdi
mov    $0xffffffff,%esi
call   1090 <fseek@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>
mov    $0x9,%edi
mov    %r12,%rsi
call   1070 <fputc@plt>
lea    0xcca(%rip),%rdi
lea    0xca7(%rip),%rsi
call   10a0 <fopen@plt>
test   %rax,%rax
je     146f <main+0x2df>
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    13e7 <main+0x257>
mov    $0x9,%ebp
lea    0x7(%rsp),%r13
xchg   %ax,%ax
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     13b0 <main+0x220>
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    0xc44(%rip),%rdi
call   1030 <puts@plt>
xor    %edi,%edi
call   10b0 <exit@plt>
lea    0xc21(%rip),%rdi
call   1030 <puts@plt>
mov    %r12,%rdi
call   1050 <fclose@plt>
mov    $0x1,%edi
call   10b0 <exit@plt>
lea    0xbd2(%rip),%rdi
call   1060 <printf@plt>
mov    %r12,%rdi
call   1050 <fclose@plt>
mov    %r14,%rdi
call   1050 <fclose@plt>
mov    $0x2,%edi
call   10b0 <exit@plt>
lea    0xbcd(%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   10b0 <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"
@SEEK_CUR = global i32 0
@.str.9 = [17 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
%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
br label %24
24: ; preds = %28, %23
%25 = load i8, i8* %6
%26 = sext i8 %25 to i32
%27 = icmp ne i32 %26, 10
br i1 %27, label %28, label %33
28: ; preds = %24
%29 = load i32*, i32** %3
%30 = call i32 @fread(i8* %6, i32 1, i32 1, i32* %29)
%31 = load i32*, i32** %2
%32 = call i32 @fwrite(i8* %6, i32 1, i32 1, i32* %31)
br label %24
33: ; preds = %24
%34 = load i32*, i32** %2
%35 = call i32 @fwrite(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.6, i64 0, i64 0), i32 1, i32 1, i32* %34)
%36 = load i32*, i32** %2
%37 = call i32 @fwrite(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.6, i64 0, i64 0), i32 1, i32 1, i32* %36)
%38 = 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* %38, i32** %4
%39 = load i32*, i32** %4
%40 = icmp eq i32* null, %39
br i1 %40, label %41, label %48
41: ; preds = %33
%42 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.8, i64 0, i64 0))
%43 = load i32*, i32** %2
%44 = call i32 @fclose(i32* %43)
%45 = load i32*, i32** %3
%46 = call i32 @fclose(i32* %45)
%47 = call i32 @exit(i32 2)
unreachable
48: ; preds = %33
br label %49
49: ; preds = %48, %56
%50 = load i32*, i32** %4
%51 = call i32 @fread(i8* %6, i32 1, i32 1, i32* %50)
%52 = load i32*, i32** %4
%53 = call i64 @feof(i32* %52)
%54 = icmp ne i64 %53, 0
br i1 %54, label %55, label %56
55: ; preds = %49
br label %59
56: ; preds = %49
%57 = load i32*, i32** %2
%58 = call i32 @fwrite(i8* %6, i32 1, i32 1, i32* %57)
br label %49
59: ; preds = %55
%60 = load i32*, i32** %2
%61 = load i32, i32* @SEEK_CUR
%62 = call i32 @fseek(i32* %60, i32 -1, i32 %61)
store i32 0, i32* %7
br label %63
63: ; preds = %67, %59
%64 = load i32, i32* %7
%65 = add nsw i32 %64, 1
store i32 %65, i32* %7
%66 = icmp slt i32 %64, 12
br i1 %66, label %67, label %70
67: ; preds = %63
%68 = load i32*, i32** %2
%69 = call i32 @fwrite(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.6, i64 0, i64 0), i32 1, i32 1, i32* %68)
br label %63
70: ; preds = %63
%71 = call i32* @fopen(i8* getelementptr inbounds ([17 x i8], [17 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* %71, i32** %5
%72 = load i32*, i32** %5
%73 = icmp eq i32* null, %72
br i1 %73, label %74, label %83
74: ; preds = %70
%75 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.10, i64 0, i64 0))
%76 = load i32*, i32** %2
%77 = call i32 @fclose(i32* %76)
%78 = load i32*, i32** %3
%79 = call i32 @fclose(i32* %78)
%80 = load i32*, i32** %4
%81 = call i32 @fclose(i32* %80)
%82 = call i32 @exit(i32 3)
unreachable
83: ; preds = %70
br label %84
84: ; preds = %83, %95, %98
%85 = load i32*, i32** %5
%86 = call i32 @fread(i8* %6, i32 1, i32 1, i32* %85)
%87 = load i32*, i32** %5
%88 = call i64 @feof(i32* %87)
%89 = icmp ne i64 %88, 0
br i1 %89, label %90, label %91
90: ; preds = %84
br label %101
91: ; preds = %84
%92 = load i8, i8* %6
%93 = sext i8 %92 to i32
%94 = icmp eq i32 %93, 10
br i1 %94, label %95, label %98
95: ; preds = %91
%96 = load i32*, i32** %2
%97 = call i32 @fwrite(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.6, i64 0, i64 0), i32 1, i32 1, i32* %96)
br label %84
98: ; preds = %91
%99 = load i32*, i32** %2
%100 = call i32 @fwrite(i8* %6, i32 1, i32 1, i32* %99)
br label %84
101: ; preds = %90
%102 = load i32*, i32** %2
%103 = call i32 @fclose(i32* %102)
%104 = load i32*, i32** %3
%105 = call i32 @fclose(i32* %104)
%106 = load i32*, i32** %4
%107 = call i32 @fclose(i32* %106)
%108 = load i32*, i32** %5
%109 = call i32 @fclose(i32* %108)
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"
@SEEK_CUR = global i32 0
@.str.9 = [17 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 %10, label %14
10: ; preds = %7
%11 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str.11, i64 0, i64 0))
%12 = tail call i32 @fclose(i32* %2)
%13 = tail call i32 @exit(i32 1)
unreachable
14: ; preds = %7, %14
%15 = call i32 @fread(i8* %1, i32 1, i32 1, i32* %8)
%16 = load i8, i8* %1
%17 = sext i8 %16 to i32
%18 = tail call i32 @fputc(i32 %17, i32* %2)
%19 = icmp eq i8 %16, 10
br i1 %19, label %20, label %14
20: ; preds = %14
%21 = tail call i32 @fputc(i32 9, i32* %2)
%22 = tail call i32 @fputc(i32 9, i32* %2)
%23 = 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))
%24 = icmp eq i32* %23, null
br i1 %24, label %29, label %25
25: ; preds = %20
%26 = call i32 @fread(i8* %1, i32 1, i32 1, i32* %23)
%27 = tail call i64 @feof(i32* %23)
%28 = icmp eq i64 %27, 0
br i1 %28, label %34, label %41
29: ; preds = %20
%30 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.8, i64 0, i64 0))
%31 = tail call i32 @fclose(i32* %2)
%32 = tail call i32 @fclose(i32* %8)
%33 = tail call i32 @exit(i32 2)
unreachable
34: ; preds = %25, %34
%35 = load i8, i8* %1
%36 = sext i8 %35 to i32
%37 = tail call i32 @fputc(i32 %36, i32* %2)
%38 = call i32 @fread(i8* %1, i32 1, i32 1, i32* %23)
%39 = tail call i64 @feof(i32* %23)
%40 = icmp eq i64 %39, 0
br i1 %40, label %34, label %41
41: ; preds = %34, %25
%42 = load i32, i32* @SEEK_CUR
%43 = tail call i32 @fseek(i32* %2, i32 -1, i32 %42)
%44 = tail call i32 @fputc(i32 9, i32* %2)
%45 = tail call i32 @fputc(i32 9, i32* %2)
%46 = tail call i32 @fputc(i32 9, i32* %2)
%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* @fopen(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.9, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
%57 = icmp eq i32* %56, null
br i1 %57, label %62, label %58
58: ; preds = %41
%59 = call i32 @fread(i8* %1, i32 1, i32 1, i32* %56)
%60 = tail call i64 @feof(i32* %56)
%61 = icmp eq i64 %60, 0
br i1 %61, label %68, label %77
62: ; preds = %41
%63 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str, i64 0, i64 0))
%64 = tail call i32 @fclose(i32* %2)
%65 = tail call i32 @fclose(i32* %8)
%66 = tail call i32 @fclose(i32* %23)
%67 = tail call i32 @exit(i32 3)
unreachable
68: ; preds = %58, %68
%69 = load i8, i8* %1
%70 = icmp eq i8 %69, 10
%71 = select i1 %70, i8 9, i8 %69
%72 = sext i8 %71 to i32
%73 = tail call i32 @fputc(i32 %72, i32* %2)
%74 = call i32 @fread(i8* %1, i32 1, i32 1, i32* %56)
%75 = tail call i64 @feof(i32* %56)
%76 = icmp eq i64 %75, 0
br i1 %76, label %68, label %77
77: ; preds = %68, %58
%78 = tail call i32 @fclose(i32* %2)
%79 = tail call i32 @fclose(i32* %8)
%80 = tail call i32 @fclose(i32* %23)
%81 = tail call i32 @fclose(i32* %56)
ret i32 0
}