#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 ssize_t;

/* Variables and functions */
int /*<<< orphan*/ O_RDONLY;
int /*<<< orphan*/ file_close(int);
int open(char *, int /*<<< orphan*/);
int /*<<< orphan*/ perror(char *);
int read(int, char *, int);
int /*<<< orphan*/ remember_line(char *, int, int *, int *);
int strlen(char *);
int write(int, char *, int);
void file_write(int argc, char *arg) {
  char memory;
  char *buffer = &memory;
  char new_lines[10];
  int file_size = 0, count_found = 0, found = 0, hole_file = 1;
  ssize_t read_return_value;
  int fd = open(arg, O_RDONLY);
  ssize_t write_return_value;
  if (fd < 0) {
    perror("Error while opening");
  }
  do {
    read_return_value = read(fd, buffer, 1);
    if (read_return_value <= 0) {
      if (read_return_value < 0) {
        perror("Error while reading");
      }
      break;
    } else {
      file_size++;
      if (*buffer == '\n') {
        remember_line(new_lines, file_size, &count_found, &hole_file);
      }
    }
  } while ((read_return_value != 0) && (read_return_value != -1));
  file_close(fd);
  file_size = 0;
  int i = 0;
  if (argc > 1) {
    write_return_value = write(1, "\n", strlen("\n"));
    write_return_value = write(1, arg, strlen(arg));
    if (write_return_value < 0) {
      perror("Error while writing");
    }
    write_return_value = write(1, ":\n", strlen(":\n"));
    if (write_return_value < 0) {
      perror("Error while writing");
    }
  }
  fd = open(arg, O_RDONLY);
  if (fd < 0) {
    perror("Error while opening");
  }
  do {
    read_return_value = read(fd, buffer, 1);
    if (read_return_value <= 0) {
      if (read_return_value < 0) {
        perror("Error while reading");
      }
      break;
    } else {
      if (hole_file == 0) {
        file_size++;
        if ((file_size == new_lines[count_found]) || (found == 1)) {
          if ((file_size != new_lines[count_found])) {
            write_return_value = write(1, buffer, 1);
            if (write_return_value < 0) {
              perror("Error while writing");
            }
          }
          found = 1;
        }
      } else {
        write_return_value = write(1, buffer, 1);
        if (write_return_value < 0) {
          perror("Error while writing");
        }
      }
    }
  } while ((read_return_value != 0) && (read_return_value != -1));
}


x86 assembly (clang, -O0):
<file_write>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x11(%rbp),%rax
mov    %rax,-0x20(%rbp)
movl   $0x0,-0x30(%rbp)
movl   $0x0,-0x34(%rbp)
movl   $0x0,-0x38(%rbp)
movl   $0x1,-0x3c(%rbp)
mov    -0x10(%rbp),%rdi
mov    0x2e3a(%rip),%rax
mov    (%rax),%esi
call   1080 <open@plt>
mov    %eax,-0x44(%rbp)
cmpl   $0x0,-0x44(%rbp)
jge    11ce <file_write+0x5e>
lea    0xe37(%rip),%rdi
call   1090 <perror@plt>
jmp    11d3 <file_write+0x63>
mov    -0x44(%rbp),%edi
mov    -0x20(%rbp),%rsi
mov    $0x1,%edx
call   1070 <read@plt>
mov    %eax,-0x40(%rbp)
cmpl   $0x0,-0x40(%rbp)
jg     120c <file_write+0x9c>
cmpl   $0x0,-0x40(%rbp)
jge    1207 <file_write+0x97>
lea    0xe12(%rip),%rdi
call   1090 <perror@plt>
jmp    1267 <file_write+0xf7>
mov    -0x30(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x30(%rbp)
mov    -0x20(%rbp),%rax
movsbl (%rax),%eax
cmp    $0xa,%eax
jne    1239 <file_write+0xc9>
lea    -0x2a(%rbp),%rdi
mov    -0x30(%rbp),%esi
lea    -0x34(%rbp),%rdx
lea    -0x3c(%rbp),%rcx
call   1060 <remember_line@plt>
jmp    123e <file_write+0xce>
jmp    1243 <file_write+0xd3>
xor    %eax,%eax
cmpl   $0x0,-0x40(%rbp)
mov    %al,-0x4d(%rbp)
je     125c <file_write+0xec>
cmpl   $0xffffffff,-0x40(%rbp)
setne  %al
mov    %al,-0x4d(%rbp)
mov    -0x4d(%rbp),%al
test   $0x1,%al
jne    11d3 <file_write+0x63>
mov    -0x44(%rbp),%edi
call   1050 <file_close@plt>
movl   $0x0,-0x30(%rbp)
movl   $0x0,-0x4c(%rbp)
cmpl   $0x1,-0x4(%rbp)
jle    1320 <file_write+0x1b0>
lea    0xdaf(%rip),%rdi
call   1040 <strlen@plt>
mov    %eax,%edx
mov    $0x1,%edi
lea    0xd9c(%rip),%rsi
call   1030 <write@plt>
mov    %eax,-0x48(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x58(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x58(%rbp),%rsi
mov    %eax,%edx
mov    $0x1,%edi
call   1030 <write@plt>
mov    %eax,-0x48(%rbp)
cmpl   $0x0,-0x48(%rbp)
jge    12e3 <file_write+0x173>
lea    0xd4a(%rip),%rdi
call   1090 <perror@plt>
lea    0xd52(%rip),%rdi
call   1040 <strlen@plt>
mov    %eax,%edx
mov    $0x1,%edi
lea    0xd3f(%rip),%rsi
call   1030 <write@plt>
mov    %eax,-0x48(%rbp)
cmpl   $0x0,-0x48(%rbp)
jge    131b <file_write+0x1ab>
lea    0xd12(%rip),%rdi
call   1090 <perror@plt>
jmp    1320 <file_write+0x1b0>
mov    -0x10(%rbp),%rdi
mov    0x2cbd(%rip),%rax
mov    (%rax),%esi
call   1080 <open@plt>
mov    %eax,-0x44(%rbp)
cmpl   $0x0,-0x44(%rbp)
jge    134b <file_write+0x1db>
lea    0xcba(%rip),%rdi
call   1090 <perror@plt>
jmp    1350 <file_write+0x1e0>
mov    -0x44(%rbp),%edi
mov    -0x20(%rbp),%rsi
mov    $0x1,%edx
call   1070 <read@plt>
mov    %eax,-0x40(%rbp)
cmpl   $0x0,-0x40(%rbp)
jg     1389 <file_write+0x219>
cmpl   $0x0,-0x40(%rbp)
jge    1384 <file_write+0x214>
lea    0xc95(%rip),%rdi
call   1090 <perror@plt>
jmp    1464 <file_write+0x2f4>
cmpl   $0x0,-0x3c(%rbp)
jne    1408 <file_write+0x298>
mov    -0x30(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x30(%rbp)
mov    -0x30(%rbp),%eax
movslq -0x34(%rbp),%rcx
movsbl -0x2a(%rbp,%rcx,1),%ecx
cmp    %ecx,%eax
je     13ba <file_write+0x24a>
cmpl   $0x1,-0x38(%rbp)
jne    1403 <file_write+0x293>
mov    -0x30(%rbp),%eax
movslq -0x34(%rbp),%rcx
movsbl -0x2a(%rbp,%rcx,1),%ecx
cmp    %ecx,%eax
je     13fc <file_write+0x28c>
mov    -0x20(%rbp),%rsi
mov    $0x1,%edx
mov    %edx,%edi
call   1030 <write@plt>
mov    %eax,-0x48(%rbp)
cmpl   $0x0,-0x48(%rbp)
jge    13f7 <file_write+0x287>
lea    0xc36(%rip),%rdi
call   1090 <perror@plt>
jmp    13fc <file_write+0x28c>
movl   $0x1,-0x38(%rbp)
jmp    1436 <file_write+0x2c6>
mov    -0x20(%rbp),%rsi
mov    $0x1,%edx
mov    %edx,%edi
call   1030 <write@plt>
mov    %eax,-0x48(%rbp)
cmpl   $0x0,-0x48(%rbp)
jge    1431 <file_write+0x2c1>
lea    0xbfc(%rip),%rdi
call   1090 <perror@plt>
jmp    1436 <file_write+0x2c6>
jmp    143b <file_write+0x2cb>
jmp    1440 <file_write+0x2d0>
xor    %eax,%eax
cmpl   $0x0,-0x40(%rbp)
mov    %al,-0x59(%rbp)
je     1459 <file_write+0x2e9>
cmpl   $0xffffffff,-0x40(%rbp)
setne  %al
mov    %al,-0x59(%rbp)
mov    -0x59(%rbp),%al
test   $0x1,%al
jne    1350 <file_write+0x1e0>
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<file_write>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x28,%rsp
mov    %rsi,%r14
mov    %edi,%r12d
movl   $0x0,0x8(%rsp)
movl   $0x1,0x4(%rsp)
mov    0x2e4d(%rip),%r15
mov    (%r15),%esi
mov    %r14,%rdi
call   1080 <open@plt>
mov    %eax,%ebp
test   %eax,%eax
js     1365 <file_write+0x1f5>
lea    0x3(%rsp),%rsi
mov    $0x1,%ebx
mov    %ebp,%edi
mov    $0x1,%edx
call   1070 <read@plt>
test   %eax,%eax
jle    1230 <file_write+0xc0>
mov    %r12d,0xc(%rsp)
mov    %r14,0x10(%rsp)
lea    0x1e(%rsp),%r12
lea    0x8(%rsp),%r13
lea    0x4(%rsp),%r14
lea    0x3(%rsp),%r15
jmp    1206 <file_write+0x96>
nopw   0x0(%rax,%rax,1)
mov    %ebp,%edi
mov    %r15,%rsi
mov    $0x1,%edx
call   1070 <read@plt>
add    $0x1,%ebx
test   %eax,%eax
jle    121f <file_write+0xaf>
cmpb   $0xa,0x3(%rsp)
jne    11f0 <file_write+0x80>
mov    %r12,%rdi
mov    %ebx,%esi
mov    %r13,%rdx
mov    %r14,%rcx
call   1060 <remember_line@plt>
jmp    11f0 <file_write+0x80>
mov    0x10(%rsp),%r14
mov    0x2dbd(%rip),%r15
mov    0xc(%rsp),%r12d
test   %eax,%eax
js     1376 <file_write+0x206>
mov    %ebp,%edi
call   1050 <file_close@plt>
cmp    $0x2,%r12d
jl     12a8 <file_write+0x138>
lea    0xdf1(%rip),%rbx
mov    %rbx,%rdi
call   1040 <strlen@plt>
mov    $0x1,%edi
mov    %rbx,%rsi
mov    %eax,%edx
call   1030 <write@plt>
mov    %r14,%rdi
call   1040 <strlen@plt>
mov    $0x1,%edi
mov    %r14,%rsi
mov    %eax,%edx
call   1030 <write@plt>
test   %eax,%eax
js     13a6 <file_write+0x236>
lea    0xdb3(%rip),%rbx
mov    %rbx,%rdi
call   1040 <strlen@plt>
mov    $0x1,%edi
mov    %rbx,%rsi
mov    %eax,%edx
call   1030 <write@plt>
test   %eax,%eax
js     13b7 <file_write+0x247>
mov    (%r15),%esi
mov    %r14,%rdi
call   1080 <open@plt>
mov    %eax,%r12d
test   %eax,%eax
js     1387 <file_write+0x217>
lea    0x3(%rsp),%rsi
mov    %r12d,%edi
mov    $0x1,%edx
call   1070 <read@plt>
test   %eax,%eax
jle    1352 <file_write+0x1e2>
xor    %ebp,%ebp
lea    0x3(%rsp),%r14
lea    0xd46(%rip),%r15
xor    %ebx,%ebx
jmp    1315 <file_write+0x1a5>
mov    $0x1,%ebx
mov    $0x1,%edi
mov    %r14,%rsi
mov    $0x1,%edx
call   1030 <write@plt>
test   %eax,%eax
js     1348 <file_write+0x1d8>
mov    %r12d,%edi
mov    %r14,%rsi
mov    $0x1,%edx
call   1070 <read@plt>
test   %eax,%eax
jle    1352 <file_write+0x1e2>
cmpl   $0x0,0x4(%rsp)
jne    12eb <file_write+0x17b>
add    $0x1,%ebp
movslq 0x8(%rsp),%rax
movsbl 0x1e(%rsp,%rax,1),%ecx
cmp    %ecx,%ebp
setne  %dl
cmp    $0x1,%ebx
setne  %al
and    %dl,%al
mov    %eax,%edx
xor    $0x1,%dl
movzbl %dl,%ebx
cmp    %ecx,%ebp
je     1301 <file_write+0x191>
test   %al,%al
je     12e6 <file_write+0x176>
jmp    1301 <file_write+0x191>
mov    %r15,%rdi
call   1090 <perror@plt>
jmp    1301 <file_write+0x191>
test   %eax,%eax
js     1398 <file_write+0x228>
add    $0x28,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0xc94(%rip),%rdi
call   1090 <perror@plt>
jmp    11b0 <file_write+0x40>
lea    0xc97(%rip),%rdi
call   1090 <perror@plt>
jmp    1238 <file_write+0xc8>
lea    0xc72(%rip),%rdi
call   1090 <perror@plt>
jmp    12be <file_write+0x14e>
lea    0xc75(%rip),%rdi
call   1090 <perror@plt>
jmp    1356 <file_write+0x1e6>
lea    0xc7b(%rip),%rdi
call   1090 <perror@plt>
jmp    1282 <file_write+0x112>
lea    0xc6a(%rip),%rdi
call   1090 <perror@plt>
jmp    12a8 <file_write+0x138>

LLVM IR (-O0):
@O_RDONLY = global i32 0
@.str = [20 x i8] c"Error while opening\00"
@.str.1 = [20 x i8] c"Error while reading\00"
@.str.2 = [2 x i8] c"\0A\00"
@.str.3 = [20 x i8] c"Error while writing\00"
@.str.4 = [3 x i8] c":\0A\00"
define void @file_write(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8
%6 = alloca i8*
%7 = alloca [10 x i8]
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
%15 = alloca i32
store i32 %0, i32* %3
store i8* %1, i8** %4
store i8* %5, i8** %6
store i32 0, i32* %8
store i32 0, i32* %9
store i32 0, i32* %10
store i32 1, i32* %11
%16 = load i8*, i8** %4
%17 = load i32, i32* @O_RDONLY
%18 = call i32 @open(i8* %16, i32 %17)
store i32 %18, i32* %13
%19 = load i32, i32* %13
%20 = icmp slt i32 %19, 0
br i1 %20, label %21, label %23
21: ; preds = %2
%22 = call i32 @perror(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
br label %23
23: ; preds = %21, %2
br label %24
24: ; preds = %55, %23
%25 = load i32, i32* %13
%26 = load i8*, i8** %6
%27 = call i32 @read(i32 %25, i8* %26, i32 1)
store i32 %27, i32* %12
%28 = load i32, i32* %12
%29 = icmp sle i32 %28, 0
br i1 %29, label %30, label %36
30: ; preds = %24
%31 = load i32, i32* %12
%32 = icmp slt i32 %31, 0
br i1 %32, label %33, label %35
33: ; preds = %30
%34 = call i32 @perror(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0))
br label %35
35: ; preds = %33, %30
br label %57
36: ; preds = %24
%37 = load i32, i32* %8
%38 = add nsw i32 %37, 1
store i32 %38, i32* %8
%39 = load i8*, i8** %6
%40 = load i8, i8* %39
%41 = sext i8 %40 to i32
%42 = icmp eq i32 %41, 10
br i1 %42, label %43, label %47
43: ; preds = %36
%44 = getelementptr inbounds [10 x i8], [10 x i8]* %7, i64 0, i64 0
%45 = load i32, i32* %8
%46 = call i32 @remember_line(i8* %44, i32 %45, i32* %9, i32* %11)
br label %47
47: ; preds = %43, %36
br label %48
48: ; preds = %47
br label %49
49: ; preds = %48
%50 = load i32, i32* %12
%51 = icmp ne i32 %50, 0
br i1 %51, label %52, label %55
52: ; preds = %49
%53 = load i32, i32* %12
%54 = icmp ne i32 %53, -1
br label %55
55: ; preds = %52, %49
%56 = phi i1 [ false, %49 ], [ %54, %52 ]
br i1 %56, label %24, label %57
57: ; preds = %55, %35
%58 = load i32, i32* %13
%59 = call i32 @file_close(i32 %58)
store i32 0, i32* %8
store i32 0, i32* %15
%60 = load i32, i32* %3
%61 = icmp sgt i32 %60, 1
br i1 %61, label %62, label %81
62: ; preds = %57
%63 = call i32 @strlen(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%64 = call i32 @write(i32 1, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0), i32 %63)
store i32 %64, i32* %14
%65 = load i8*, i8** %4
%66 = load i8*, i8** %4
%67 = call i32 @strlen(i8* %66)
%68 = call i32 @write(i32 1, i8* %65, i32 %67)
store i32 %68, i32* %14
%69 = load i32, i32* %14
%70 = icmp slt i32 %69, 0
br i1 %70, label %71, label %73
71: ; preds = %62
%72 = call i32 @perror(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.3, i64 0, i64 0))
br label %73
73: ; preds = %71, %62
%74 = call i32 @strlen(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0))
%75 = call i32 @write(i32 1, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i32 %74)
store i32 %75, i32* %14
%76 = load i32, i32* %14
%77 = icmp slt i32 %76, 0
br i1 %77, label %78, label %80
78: ; preds = %73
%79 = call i32 @perror(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.3, i64 0, i64 0))
br label %80
80: ; preds = %78, %73
br label %81
81: ; preds = %80, %57
%82 = load i8*, i8** %4
%83 = load i32, i32* @O_RDONLY
%84 = call i32 @open(i8* %82, i32 %83)
store i32 %84, i32* %13
%85 = load i32, i32* %13
%86 = icmp slt i32 %85, 0
br i1 %86, label %87, label %89
87: ; preds = %81
%88 = call i32 @perror(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
br label %89
89: ; preds = %87, %81
br label %90
90: ; preds = %152, %89
%91 = load i32, i32* %13
%92 = load i8*, i8** %6
%93 = call i32 @read(i32 %91, i8* %92, i32 1)
store i32 %93, i32* %12
%94 = load i32, i32* %12
%95 = icmp sle i32 %94, 0
br i1 %95, label %96, label %102
96: ; preds = %90
%97 = load i32, i32* %12
%98 = icmp slt i32 %97, 0
br i1 %98, label %99, label %101
99: ; preds = %96
%100 = call i32 @perror(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0))
br label %101
101: ; preds = %99, %96
br label %154
102: ; preds = %90
%103 = load i32, i32* %11
%104 = icmp eq i32 %103, 0
br i1 %104, label %105, label %136
105: ; preds = %102
%106 = load i32, i32* %8
%107 = add nsw i32 %106, 1
store i32 %107, i32* %8
%108 = load i32, i32* %8
%109 = load i32, i32* %9
%110 = sext i32 %109 to i64
%111 = getelementptr inbounds [10 x i8], [10 x i8]* %7, i64 0, i64 %110
%112 = load i8, i8* %111
%113 = sext i8 %112 to i32
%114 = icmp eq i32 %108, %113
br i1 %114, label %118, label %115
115: ; preds = %105
%116 = load i32, i32* %10
%117 = icmp eq i32 %116, 1
br i1 %117, label %118, label %135
118: ; preds = %115, %105
%119 = load i32, i32* %8
%120 = load i32, i32* %9
%121 = sext i32 %120 to i64
%122 = getelementptr inbounds [10 x i8], [10 x i8]* %7, i64 0, i64 %121
%123 = load i8, i8* %122
%124 = sext i8 %123 to i32
%125 = icmp ne i32 %119, %124
br i1 %125, label %126, label %134
126: ; preds = %118
%127 = load i8*, i8** %6
%128 = call i32 @write(i32 1, i8* %127, i32 1)
store i32 %128, i32* %14
%129 = load i32, i32* %14
%130 = icmp slt i32 %129, 0
br i1 %130, label %131, label %133
131: ; preds = %126
%132 = call i32 @perror(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.3, i64 0, i64 0))
br label %133
133: ; preds = %131, %126
br label %134
134: ; preds = %133, %118
store i32 1, i32* %10
br label %135
135: ; preds = %134, %115
br label %144
136: ; preds = %102
%137 = load i8*, i8** %6
%138 = call i32 @write(i32 1, i8* %137, i32 1)
store i32 %138, i32* %14
%139 = load i32, i32* %14
%140 = icmp slt i32 %139, 0
br i1 %140, label %141, label %143
141: ; preds = %136
%142 = call i32 @perror(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.3, i64 0, i64 0))
br label %143
143: ; preds = %141, %136
br label %144
144: ; preds = %143, %135
br label %145
145: ; preds = %144
br label %146
146: ; preds = %145
%147 = load i32, i32* %12
%148 = icmp ne i32 %147, 0
br i1 %148, label %149, label %152
149: ; preds = %146
%150 = load i32, i32* %12
%151 = icmp ne i32 %150, -1
br label %152
152: ; preds = %149, %146
%153 = phi i1 [ false, %146 ], [ %151, %149 ]
br i1 %153, label %90, label %154
154: ; preds = %152, %101
ret void
}

LLVM IR (-O2):
@O_RDONLY = global i32 0
@.str = [20 x i8] c"Error while opening\00"
@.str.1 = [20 x i8] c"Error while reading\00"
@.str.2 = [2 x i8] c"\0A\00"
@.str.3 = [20 x i8] c"Error while writing\00"
@.str.4 = [3 x i8] c":\0A\00"
define void @file_write(i32 %0, i8* %1) {
%3 = alloca i8
%4 = alloca [10 x i8]
%5 = alloca i32
%6 = alloca i32
%7 = getelementptr inbounds [10 x i8], [10 x i8]* %4, i64 0, i64 0
%8 = bitcast i32* %5 to i8*
store i32 0, i32* %5
%9 = bitcast i32* %6 to i8*
store i32 1, i32* %6
%10 = load i32, i32* @O_RDONLY
%11 = tail call i32 @open(i8* %1, i32 %10)
%12 = icmp slt i32 %11, 0
br i1 %12, label %13, label %15
13: ; preds = %2
%14 = tail call i32 @perror(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
br label %15
15: ; preds = %13, %2
%16 = call i32 @read(i32 %11, i8* %3, i32 1)
%17 = icmp slt i32 %16, 1
br i1 %17, label %18, label %23
18: ; preds = %30, %15
%19 = phi i32 [ %16, %15 ], [ %31, %30 ]
%20 = icmp slt i32 %19, 0
br i1 %20, label %21, label %33
21: ; preds = %18
%22 = call i32 @perror(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0))
br label %33
23: ; preds = %15, %30
%24 = phi i32 [ %25, %30 ], [ 0, %15 ]
%25 = add nuw nsw i32 %24, 1
%26 = load i8, i8* %3
%27 = icmp eq i8 %26, 10
br i1 %27, label %28, label %30
28: ; preds = %23
%29 = call i32 @remember_line(i8* %7, i32 %25, i32* %5, i32* %6)
br label %30
30: ; preds = %28, %23
%31 = call i32 @read(i32 %11, i8* %3, i32 1)
%32 = icmp slt i32 %31, 1
br i1 %32, label %18, label %23
33: ; preds = %18, %21
%34 = call i32 @file_close(i32 %11)
%35 = icmp sgt i32 %0, 1
br i1 %35, label %36, label %50
36: ; preds = %33
%37 = call i32 @strlen(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%38 = call i32 @write(i32 1, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0), i32 %37)
%39 = call i32 @strlen(i8* %1)
%40 = call i32 @write(i32 1, i8* %1, i32 %39)
%41 = icmp slt i32 %40, 0
br i1 %41, label %42, label %44
42: ; preds = %36
%43 = call i32 @perror(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.3, i64 0, i64 0))
br label %44
44: ; preds = %42, %36
%45 = call i32 @strlen(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0))
%46 = call i32 @write(i32 1, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i32 %45)
%47 = icmp slt i32 %46, 0
br i1 %47, label %48, label %50
48: ; preds = %44
%49 = call i32 @perror(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.3, i64 0, i64 0))
br label %50
50: ; preds = %44, %48, %33
%51 = load i32, i32* @O_RDONLY
%52 = call i32 @open(i8* %1, i32 %51)
%53 = icmp slt i32 %52, 0
br i1 %53, label %54, label %56
54: ; preds = %50
%55 = call i32 @perror(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
br label %56
56: ; preds = %54, %50
%57 = call i32 @read(i32 %52, i8* %3, i32 1)
%58 = icmp slt i32 %57, 1
br i1 %58, label %59, label %64
59: ; preds = %93, %56
%60 = phi i32 [ %57, %56 ], [ %96, %93 ]
%61 = icmp slt i32 %60, 0
br i1 %61, label %62, label %98
62: ; preds = %59
%63 = call i32 @perror(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0))
br label %98
64: ; preds = %56, %93
%65 = phi i32 [ %95, %93 ], [ 0, %56 ]
%66 = phi i32 [ %94, %93 ], [ 0, %56 ]
%67 = load i32, i32* %6
%68 = icmp eq i32 %67, 0
br i1 %68, label %69, label %86
69: ; preds = %64
%70 = add nsw i32 %65, 1
%71 = load i32, i32* %5
%72 = sext i32 %71 to i64
%73 = getelementptr inbounds [10 x i8], [10 x i8]* %4, i64 0, i64 %72
%74 = load i8, i8* %73
%75 = sext i8 %74 to i32
%76 = icmp eq i32 %70, %75
%77 = icmp ne i32 %66, 1
%78 = xor i1 %76, true
%79 = select i1 %78, i1 %77, i1 false
%80 = or i1 %76, %79
%81 = xor i1 %79, true
%82 = zext i1 %81 to i32
br i1 %80, label %93, label %83
83: ; preds = %69
%84 = call i32 @write(i32 1, i8* %3, i32 1)
%85 = icmp slt i32 %84, 0
br i1 %85, label %89, label %93
86: ; preds = %64
%87 = call i32 @write(i32 1, i8* %3, i32 1)
%88 = icmp slt i32 %87, 0
br i1 %88, label %89, label %93
89: ; preds = %86, %83
%90 = phi i32 [ 1, %83 ], [ %66, %86 ]
%91 = phi i32 [ %70, %83 ], [ %65, %86 ]
%92 = call i32 @perror(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.3, i64 0, i64 0))
br label %93
93: ; preds = %89, %69, %83, %86
%94 = phi i32 [ %82, %69 ], [ %66, %86 ], [ 1, %83 ], [ %90, %89 ]
%95 = phi i32 [ %70, %69 ], [ %65, %86 ], [ %70, %83 ], [ %91, %89 ]
%96 = call i32 @read(i32 %52, i8* %3, i32 1)
%97 = icmp slt i32 %96, 1
br i1 %97, label %59, label %64
98: ; preds = %59, %62
ret void
}