#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 */
struct stat {
  int st_size;
};

/* Variables and functions */
int O_CREAT;
int /*<<< orphan*/ O_RDONLY;
int O_TRUNC;
int O_WRONLY;
int /*<<< orphan*/ close(int);
int /*<<< orphan*/ free(unsigned char *);
unsigned char *malloc(int);
int open(char *const, int, ...);
int /*<<< orphan*/ printf(char *, ...);
int read(int, unsigned char *, int);
int stat(char *const, struct stat *);
int write(int, ...);
int main(int argc, char *const argv[]) {
  int err, ifd, ofd, i, j, tmp;
  struct stat st;
  unsigned char *buf = NULL;
  buf = malloc(258048);
  if (buf == NULL) {
    printf("no mem\n");
    goto out_free;
  }
  err = stat(argv[1], &st);
  if (err < 0) {
    printf("stat failed on \"%s\"", argv[1]);
    goto out_free;
  }
  ifd = open(argv[1], O_RDONLY);
  if (ifd == -1) {
    printf("cannot open \"%s\"", argv[1]);
    goto out_close;
  }
  ofd = open(argv[2], O_WRONLY | O_TRUNC | O_CREAT, 0644);
  if (ofd == -1) {
    printf("cannot create \"%s\"", argv[2]);
    goto out_close;
  }
  tmp = st.st_size / 258048;
  for (i = 0; i < tmp; i++) {
    err = read(ifd, buf, 258048);
    if (err != 258048) {
      printf("read error\n");
      goto out_close1;
    }
    for (j = 0; j < 258048; j++)
      if (buf[j] != 0xff)
        break;
    if (j == 258048)
      continue;
    err = write(ofd, &i, sizeof(unsigned int));
    if (err != sizeof(unsigned int)) {
      printf("write error\n");
      goto out_close1;
    }
    err = write(ofd, buf, 258048);
    if (err != 258048) {
      printf("write error\n");
      goto out_close1;
    }
  }
  free(buf);
  close(ifd);
  close(ofd);
  return 0;
out_close1:
  close(ofd);
out_close:
  close(ifd);
out_free:
  free(buf);
  return -1;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x38(%rbp)
mov    $0x3f000,%edi
call   1090 <malloc@plt>
mov    %rax,-0x38(%rbp)
cmpq   $0x0,-0x38(%rbp)
jne    11ca <main+0x4a>
lea    0xe42(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
jmp    13f9 <main+0x279>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    -0x30(%rbp),%rsi
call   1080 <stat@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jge    1203 <main+0x83>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rsi
lea    0xe11(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
jmp    13f9 <main+0x279>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
mov    0x2dc6(%rip),%rax
mov    (%rax),%esi
mov    $0x0,%al
call   10a0 <open@plt>
mov    %eax,-0x18(%rbp)
cmpl   $0xffffffff,-0x18(%rbp)
jne    1243 <main+0xc3>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rsi
lea    0xde5(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
jmp    13f1 <main+0x271>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
mov    0x2d6e(%rip),%rax
mov    (%rax),%esi
mov    0x2d95(%rip),%rax
or     (%rax),%esi
mov    0x2d94(%rip),%rax
or     (%rax),%esi
mov    $0x1a4,%edx
mov    $0x0,%al
call   10a0 <open@plt>
mov    %eax,-0x1c(%rbp)
cmpl   $0xffffffff,-0x1c(%rbp)
jne    129a <main+0x11a>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rsi
lea    0xd9f(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
jmp    13f1 <main+0x271>
mov    -0x30(%rbp),%eax
mov    $0x3f000,%ecx
cltd
idiv   %ecx
mov    %eax,-0x28(%rbp)
movl   $0x0,-0x20(%rbp)
mov    -0x20(%rbp),%eax
cmp    -0x28(%rbp),%eax
jge    13c4 <main+0x244>
mov    -0x18(%rbp),%edi
mov    -0x38(%rbp),%rsi
mov    $0x3f000,%edx
call   1070 <read@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x3f000,-0x14(%rbp)
je     12ef <main+0x16f>
lea    0xd5d(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
jmp    13e9 <main+0x269>
movl   $0x0,-0x24(%rbp)
cmpl   $0x3f000,-0x24(%rbp)
jge    1332 <main+0x1b2>
mov    -0x38(%rbp),%rax
movslq -0x24(%rbp),%rcx
movzbl (%rax,%rcx,1),%eax
cmp    $0xff,%eax
je     131f <main+0x19f>
jmp    1332 <main+0x1b2>
jmp    1324 <main+0x1a4>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    12f6 <main+0x176>
cmpl   $0x3f000,-0x24(%rbp)
jne    1344 <main+0x1c4>
jmp    13b6 <main+0x236>
mov    -0x1c(%rbp),%edi
lea    -0x20(%rbp),%rsi
mov    $0x4,%edx
mov    $0x0,%al
call   1040 <write@plt>
mov    %eax,-0x14(%rbp)
movslq -0x14(%rbp),%rax
cmp    $0x4,%rax
je     137b <main+0x1fb>
lea    0xcdd(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
jmp    13e9 <main+0x269>
mov    -0x1c(%rbp),%edi
mov    -0x38(%rbp),%rsi
mov    $0x3f000,%edx
mov    $0x0,%al
call   1040 <write@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x3f000,-0x14(%rbp)
je     13b1 <main+0x231>
lea    0xca7(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
jmp    13e9 <main+0x269>
jmp    13b6 <main+0x236>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    12af <main+0x12f>
mov    -0x38(%rbp),%rdi
call   1030 <free@plt>
mov    -0x18(%rbp),%edi
call   1060 <close@plt>
mov    -0x1c(%rbp),%edi
call   1060 <close@plt>
movl   $0x0,-0x4(%rbp)
jmp    1409 <main+0x289>
mov    -0x1c(%rbp),%edi
call   1060 <close@plt>
mov    -0x18(%rbp),%edi
call   1060 <close@plt>
mov    -0x38(%rbp),%rdi
call   1030 <free@plt>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
mov    %rsi,%rbp
mov    $0x3f000,%edi
call   10a0 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
je     1337 <main+0x1a7>
mov    0x8(%rbp),%rdi
lea    0x10(%rsp),%rsi
call   1090 <stat@plt>
mov    0x8(%rbp),%rcx
test   %eax,%eax
js     1345 <main+0x1b5>
mov    0x2e00(%rip),%rax
mov    (%rax),%esi
mov    %rcx,%rdi
xor    %eax,%eax
call   10b0 <open@plt>
mov    %eax,%r14d
cmp    $0xffffffff,%eax
je     1358 <main+0x1c8>
mov    0x2dc9(%rip),%rax
mov    0x2df2(%rip),%rcx
mov    (%rcx),%esi
or     (%rax),%esi
mov    0x10(%rbp),%rdi
mov    0x2deb(%rip),%rax
or     (%rax),%esi
mov    $0x1a4,%edx
xor    %eax,%eax
call   10b0 <open@plt>
cmp    $0xffffffff,%eax
je     1365 <main+0x1d5>
mov    %eax,%r13d
movslq 0x10(%rsp),%rax
movl   $0x0,0xc(%rsp)
cmp    $0x3f000,%rax
jl     131b <main+0x18b>
imul   $0xffffffff82082083,%rax,%rbp
shr    $0x20,%rbp
add    %eax,%ebp
mov    %ebp,%eax
shr    $0x1f,%eax
sar    $0x11,%ebp
add    %eax,%ebp
lea    0xde6(%rip),%r15
lea    0xc(%rsp),%r12
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %r14d,%edi
mov    %rbx,%rsi
mov    $0x3f000,%edx
call   1080 <read@plt>
cmp    $0x3f000,%eax
jne    13a2 <main+0x212>
mov    $0x5,%eax
cmpb   $0xff,-0x5(%rbx,%rax,1)
jne    12d0 <main+0x140>
cmpb   $0xff,-0x4(%rbx,%rax,1)
jne    12d0 <main+0x140>
cmpb   $0xff,-0x3(%rbx,%rax,1)
jne    12d0 <main+0x140>
cmpb   $0xff,-0x2(%rbx,%rax,1)
jne    12d0 <main+0x140>
cmpb   $0xff,-0x1(%rbx,%rax,1)
jne    12d0 <main+0x140>
cmpb   $0xff,(%rbx,%rax,1)
jne    12d0 <main+0x140>
add    $0x6,%rax
cmp    $0x3f005,%rax
jne    1290 <main+0x100>
jmp    1308 <main+0x178>
nopw   0x0(%rax,%rax,1)
mov    $0x4,%edx
mov    %r13d,%edi
mov    %r12,%rsi
xor    %eax,%eax
call   1050 <write@plt>
cmp    $0x4,%eax
jne    139b <main+0x20b>
mov    %r13d,%edi
mov    %rbx,%rsi
mov    $0x3f000,%edx
xor    %eax,%eax
call   1050 <write@plt>
cmp    $0x3f000,%eax
jne    139b <main+0x20b>
mov    0xc(%rsp),%eax
add    $0x1,%eax
mov    %eax,0xc(%rsp)
cmp    %ebp,%eax
jl     1270 <main+0xe0>
mov    %rbx,%rdi
call   1030 <free@plt>
mov    %r14d,%edi
call   1070 <close@plt>
mov    %r13d,%edi
call   1070 <close@plt>
xor    %eax,%eax
jmp    138c <main+0x1fc>
lea    0xd11(%rip),%rdi
call   1040 <puts@plt>
jmp    137f <main+0x1ef>
lea    0xcb4(%rip),%rdi
mov    %rcx,%rsi
xor    %eax,%eax
call   1060 <printf@plt>
jmp    137f <main+0x1ef>
mov    0x8(%rbp),%rsi
lea    0xcb1(%rip),%rdi
jmp    1370 <main+0x1e0>
mov    0x10(%rbp),%rsi
lea    0xcb5(%rip),%rdi
xor    %eax,%eax
call   1060 <printf@plt>
mov    %r14d,%edi
call   1070 <close@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
mov    $0xffffffff,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0xc96(%rip),%r15
mov    %r15,%rdi
call   1040 <puts@plt>
mov    %r13d,%edi
call   1070 <close@plt>
jmp    1377 <main+0x1e7>

LLVM IR (-O0):
%struct.stat = type { i32 }
@.str = [8 x i8] c"no mem\0A\00"
@.str.1 = [20 x i8] c"stat failed on \22%s\22\00"
@O_RDONLY = global i32 0
@.str.2 = [17 x i8] c"cannot open \22%s\22\00"
@O_WRONLY = global i32 0
@O_TRUNC = global i32 0
@O_CREAT = global i32 0
@.str.3 = [19 x i8] c"cannot create \22%s\22\00"
@.str.4 = [12 x i8] c"read error\0A\00"
@.str.5 = [13 x i8] c"write error\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca %struct.stat
%13 = alloca i8*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i8* null, i8** %13
%14 = call i8* @malloc(i32 258048)
store i8* %14, i8** %13
%15 = load i8*, i8** %13
%16 = icmp eq i8* %15, null
br i1 %16, label %17, label %19
17: ; preds = %2
%18 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
br label %131
19: ; preds = %2
%20 = load i8**, i8*** %5
%21 = getelementptr inbounds i8*, i8** %20, i64 1
%22 = load i8*, i8** %21
%23 = call i32 @stat(i8* %22, %struct.stat* %12)
store i32 %23, i32* %6
%24 = load i32, i32* %6
%25 = icmp slt i32 %24, 0
br i1 %25, label %26, label %31
26: ; preds = %19
%27 = load i8**, i8*** %5
%28 = getelementptr inbounds i8*, i8** %27, i64 1
%29 = load i8*, i8** %28
%30 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i8* %29)
br label %131
31: ; preds = %19
%32 = load i8**, i8*** %5
%33 = getelementptr inbounds i8*, i8** %32, i64 1
%34 = load i8*, i8** %33
%35 = load i32, i32* @O_RDONLY
%36 = call i32 (i8*, i32, ...) @open(i8* %34, i32 %35)
store i32 %36, i32* %7
%37 = load i32, i32* %7
%38 = icmp eq i32 %37, -1
br i1 %38, label %39, label %44
39: ; preds = %31
%40 = load i8**, i8*** %5
%41 = getelementptr inbounds i8*, i8** %40, i64 1
%42 = load i8*, i8** %41
%43 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0), i8* %42)
br label %128
44: ; preds = %31
%45 = load i8**, i8*** %5
%46 = getelementptr inbounds i8*, i8** %45, i64 2
%47 = load i8*, i8** %46
%48 = load i32, i32* @O_WRONLY
%49 = load i32, i32* @O_TRUNC
%50 = or i32 %48, %49
%51 = load i32, i32* @O_CREAT
%52 = or i32 %50, %51
%53 = call i32 (i8*, i32, ...) @open(i8* %47, i32 %52, i32 420)
store i32 %53, i32* %8
%54 = load i32, i32* %8
%55 = icmp eq i32 %54, -1
br i1 %55, label %56, label %61
56: ; preds = %44
%57 = load i8**, i8*** %5
%58 = getelementptr inbounds i8*, i8** %57, i64 2
%59 = load i8*, i8** %58
%60 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.3, i64 0, i64 0), i8* %59)
br label %128
61: ; preds = %44
%62 = getelementptr inbounds %struct.stat, %struct.stat* %12, i32 0, i32 0
%63 = load i32, i32* %62
%64 = sdiv i32 %63, 258048
store i32 %64, i32* %11
store i32 0, i32* %9
br label %65
65: ; preds = %115, %61
%66 = load i32, i32* %9
%67 = load i32, i32* %11
%68 = icmp slt i32 %66, %67
br i1 %68, label %69, label %118
69: ; preds = %65
%70 = load i32, i32* %7
%71 = load i8*, i8** %13
%72 = call i32 @read(i32 %70, i8* %71, i32 258048)
store i32 %72, i32* %6
%73 = load i32, i32* %6
%74 = icmp ne i32 %73, 258048
br i1 %74, label %75, label %77
75: ; preds = %69
%76 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.4, i64 0, i64 0))
br label %125
77: ; preds = %69
store i32 0, i32* %10
br label %78
78: ; preds = %91, %77
%79 = load i32, i32* %10
%80 = icmp slt i32 %79, 258048
br i1 %80, label %81, label %94
81: ; preds = %78
%82 = load i8*, i8** %13
%83 = load i32, i32* %10
%84 = sext i32 %83 to i64
%85 = getelementptr inbounds i8, i8* %82, i64 %84
%86 = load i8, i8* %85
%87 = zext i8 %86 to i32
%88 = icmp ne i32 %87, 255
br i1 %88, label %89, label %90
89: ; preds = %81
br label %94
90: ; preds = %81
br label %91
91: ; preds = %90
%92 = load i32, i32* %10
%93 = add nsw i32 %92, 1
store i32 %93, i32* %10
br label %78
94: ; preds = %89, %78
%95 = load i32, i32* %10
%96 = icmp eq i32 %95, 258048
br i1 %96, label %97, label %98
97: ; preds = %94
br label %115
98: ; preds = %94
%99 = load i32, i32* %8
%100 = call i32 (i32, ...) @write(i32 %99, i32* %9, i64 4)
store i32 %100, i32* %6
%101 = load i32, i32* %6
%102 = sext i32 %101 to i64
%103 = icmp ne i64 %102, 4
br i1 %103, label %104, label %106
104: ; preds = %98
%105 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.5, i64 0, i64 0))
br label %125
106: ; preds = %98
%107 = load i32, i32* %8
%108 = load i8*, i8** %13
%109 = call i32 (i32, ...) @write(i32 %107, i8* %108, i32 258048)
store i32 %109, i32* %6
%110 = load i32, i32* %6
%111 = icmp ne i32 %110, 258048
br i1 %111, label %112, label %114
112: ; preds = %106
%113 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.5, i64 0, i64 0))
br label %125
114: ; preds = %106
br label %115
115: ; preds = %114, %97
%116 = load i32, i32* %9
%117 = add nsw i32 %116, 1
store i32 %117, i32* %9
br label %65
118: ; preds = %65
%119 = load i8*, i8** %13
%120 = call i32 @free(i8* %119)
%121 = load i32, i32* %7
%122 = call i32 @close(i32 %121)
%123 = load i32, i32* %8
%124 = call i32 @close(i32 %123)
store i32 0, i32* %3
br label %134
125: ; preds = %112, %104, %75
%126 = load i32, i32* %8
%127 = call i32 @close(i32 %126)
br label %128
128: ; preds = %125, %56, %39
%129 = load i32, i32* %7
%130 = call i32 @close(i32 %129)
br label %131
131: ; preds = %128, %26, %17
%132 = load i8*, i8** %13
%133 = call i32 @free(i8* %132)
store i32 -1, i32* %3
br label %134
134: ; preds = %131, %118
%135 = load i32, i32* %3
ret i32 %135
}

LLVM IR (-O2):
%struct.stat = type { i32 }
@.str.1 = [20 x i8] c"stat failed on \22%s\22\00"
@O_RDONLY = global i32 0
@.str.2 = [17 x i8] c"cannot open \22%s\22\00"
@O_WRONLY = global i32 0
@O_TRUNC = global i32 0
@O_CREAT = global i32 0
@.str.3 = [19 x i8] c"cannot create \22%s\22\00"
@str.6 = [12 x i8] c"write error\00"
@str.7 = [11 x i8] c"read error\00"
@str.8 = [7 x i8] c"no mem\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca i32
%4 = alloca %struct.stat
%5 = bitcast i32* %3 to i8*
%6 = bitcast %struct.stat* %4 to i8*
%7 = tail call dereferenceable_or_null(258048) i8* @malloc(i32 258048)
%8 = icmp eq i8* %7, null
br i1 %8, label %9, label %11
9: ; preds = %2
%10 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str.8, i64 0, i64 0))
br label %100
11: ; preds = %2
%12 = getelementptr inbounds i8*, i8** %1, i64 1
%13 = load i8*, i8** %12
%14 = call i32 @stat(i8* %13, %struct.stat* %4)
%15 = icmp slt i32 %14, 0
%16 = load i8*, i8** %12
br i1 %15, label %17, label %19
17: ; preds = %11
%18 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i8* %16)
br label %100
19: ; preds = %11
%20 = load i32, i32* @O_RDONLY
%21 = tail call i32 (i8*, i32, ...) @open(i8* %16, i32 %20)
%22 = icmp eq i32 %21, -1
br i1 %22, label %23, label %26
23: ; preds = %19
%24 = load i8*, i8** %12
%25 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0), i8* %24)
br label %98
26: ; preds = %19
%27 = getelementptr inbounds i8*, i8** %1, i64 2
%28 = load i8*, i8** %27
%29 = load i32, i32* @O_WRONLY
%30 = load i32, i32* @O_TRUNC
%31 = or i32 %30, %29
%32 = load i32, i32* @O_CREAT
%33 = or i32 %31, %32
%34 = tail call i32 (i8*, i32, ...) @open(i8* %28, i32 %33, i32 420)
%35 = icmp eq i32 %34, -1
br i1 %35, label %36, label %39
36: ; preds = %26
%37 = load i8*, i8** %27
%38 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str.3, i64 0, i64 0), i8* %37)
br label %98
39: ; preds = %26
%40 = getelementptr inbounds %struct.stat, %struct.stat* %4, i64 0, i32 0
%41 = load i32, i32* %40
%42 = sdiv i32 %41, 258048
store i32 0, i32* %3
%43 = icmp sgt i32 %41, 258047
br i1 %43, label %44, label %90
44: ; preds = %39, %86
%45 = call i32 @read(i32 %21, i8* %7, i32 258048)
%46 = icmp eq i32 %45, 258048
br i1 %46, label %47, label %94
47: ; preds = %44, %77
%48 = phi i64 [ %78, %77 ], [ 0, %44 ]
%49 = getelementptr inbounds i8, i8* %7, i64 %48
%50 = load i8, i8* %49
%51 = icmp eq i8 %50, -1
br i1 %51, label %52, label %80
52: ; preds = %47
%53 = or i64 %48, 1
%54 = getelementptr inbounds i8, i8* %7, i64 %53
%55 = load i8, i8* %54
%56 = icmp eq i8 %55, -1
br i1 %56, label %57, label %80
57: ; preds = %52
%58 = add nuw nsw i64 %48, 2
%59 = getelementptr inbounds i8, i8* %7, i64 %58
%60 = load i8, i8* %59
%61 = icmp eq i8 %60, -1
br i1 %61, label %62, label %80
62: ; preds = %57
%63 = add nuw nsw i64 %48, 3
%64 = getelementptr inbounds i8, i8* %7, i64 %63
%65 = load i8, i8* %64
%66 = icmp eq i8 %65, -1
br i1 %66, label %67, label %80
67: ; preds = %62
%68 = add nuw nsw i64 %48, 4
%69 = getelementptr inbounds i8, i8* %7, i64 %68
%70 = load i8, i8* %69
%71 = icmp eq i8 %70, -1
br i1 %71, label %72, label %80
72: ; preds = %67
%73 = add nuw nsw i64 %48, 5
%74 = getelementptr inbounds i8, i8* %7, i64 %73
%75 = load i8, i8* %74
%76 = icmp eq i8 %75, -1
br i1 %76, label %77, label %80
77: ; preds = %72
%78 = add nuw nsw i64 %48, 6
%79 = icmp eq i64 %78, 258048
br i1 %79, label %86, label %47
80: ; preds = %72, %67, %62, %57, %52, %47
%81 = call i32 (i32, ...) @write(i32 %34, i32* %3, i64 4)
%82 = icmp eq i32 %81, 4
br i1 %82, label %83, label %94
83: ; preds = %80
%84 = call i32 (i32, ...) @write(i32 %34, i8* %7, i32 258048)
%85 = icmp eq i32 %84, 258048
br i1 %85, label %86, label %94
86: ; preds = %77, %83
%87 = load i32, i32* %3
%88 = add nsw i32 %87, 1
store i32 %88, i32* %3
%89 = icmp slt i32 %88, %42
br i1 %89, label %44, label %90
90: ; preds = %86, %39
%91 = call i32 @free(i8* %7)
%92 = call i32 @close(i32 %21)
%93 = call i32 @close(i32 %34)
br label %102
94: ; preds = %83, %80, %44
%95 = phi i8* [ getelementptr inbounds ([11 x i8], [11 x i8]* @str.7, i64 0, i64 0), %44 ], [ getelementptr inbounds ([12 x i8], [12 x i8]* @str.6, i64 0, i64 0), %80 ], [ getelementptr inbounds ([12 x i8], [12 x i8]* @str.6, i64 0, i64 0), %83 ]
%96 = call i32 @puts(i8* dereferenceable(1) %95)
%97 = call i32 @close(i32 %34)
br label %98
98: ; preds = %94, %36, %23
%99 = call i32 @close(i32 %21)
br label %100
100: ; preds = %98, %17, %9
%101 = call i32 @free(i8* %7)
br label %102
102: ; preds = %100, %90
%103 = phi i32 [ -1, %100 ], [ 0, %90 ]
ret i32 %103
}