#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 */
unsigned long atol(char *);
unsigned long long atoll(char *);
char *calloc(unsigned long, int);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ free(char *);
unsigned long fwrite(char *, int, unsigned long, int /*<<< orphan*/ *);
int /*<<< orphan*/ perror(char *);
int /*<<< orphan*/ printf(char *, ...);
int rand();
int /*<<< orphan*/ srand(int);
int time(int /*<<< orphan*/ *);
int main(int argc, char **argv) {
  int seed = time(NULL);
  srand(seed);
  printf("%d\n", argc);
  if (argc != 4) {
    printf("Wrong number of arguments\n");
    return 0;
  }
  char *filename = argv[1];
  char *block_size_s = argv[2];
  char *records_count_s = argv[3];
  printf("Args: %s | %s | %s\n", argv[1], argv[2], argv[3]);
  unsigned long record_size = atol(block_size_s);
  unsigned long long records_count = atoll(records_count_s);
  printf("Creating file %s with %llu records of size %lu\n", filename,
         records_count, record_size);
  FILE *file = fopen(filename, "w");
  if (file == NULL) {
    perror("Error with file.\n");
    exit(1);
  }
  char *record = NULL;
  for (unsigned long long index = 0; index < records_count; index++) {
    record = calloc(record_size, sizeof(char));
    for (int i = 0; i < record_size; i += sizeof(int)) {
      int res = rand();
      for (int a = 0; a < sizeof(int); a++) {
        record[i + a] = res % 256;
        res /= 256;
      }
    }
    if (fwrite(record, sizeof(char), record_size, file) != record_size) {
      perror("Wrong write bytes");
      goto io_error;
    }
    free(record);
    record = NULL;
  }
  if (file != NULL) {
    fclose(file);
  }
  if (record != NULL) {
    free(record);
  }
  return 0;
  exit(0);
io_error:
  if (file != NULL) {
    fclose(file);
    file = NULL;
  }
  if (record != NULL) {
    free(record);
    record = NULL;
  }
  perror("File error.\n");
  exit(1);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   1090 <time@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%edi
call   1060 <srand@plt>
mov    -0x8(%rbp),%esi
lea    0xdfc(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
cmpl   $0x4,-0x8(%rbp)
je     122f <main+0x5f>
lea    0xde8(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    1467 <main+0x297>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rax
mov    %rax,-0x28(%rbp)
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rax
mov    %rax,-0x30(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rsi
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdx
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rcx
lea    0xdad(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x28(%rbp),%rdi
call   10a0 <atol@plt>
mov    %rax,-0x38(%rbp)
mov    -0x30(%rbp),%rdi
call   1080 <atoll@plt>
mov    %rax,-0x40(%rbp)
mov    -0x20(%rbp),%rsi
mov    -0x40(%rbp),%rdx
mov    -0x38(%rbp),%rcx
lea    0xd8d(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x20(%rbp),%rdi
lea    0xdab(%rip),%rsi
call   10b0 <fopen@plt>
mov    %rax,-0x48(%rbp)
cmpq   $0x0,-0x48(%rbp)
jne    12e2 <main+0x112>
lea    0xd92(%rip),%rdi
call   10c0 <perror@plt>
mov    $0x1,%edi
call   10d0 <exit@plt>
movq   $0x0,-0x50(%rbp)
movq   $0x0,-0x58(%rbp)
mov    -0x58(%rbp),%rax
cmp    -0x40(%rbp),%rax
jae    13e5 <main+0x215>
mov    -0x38(%rbp),%rdi
mov    $0x1,%esi
call   1070 <calloc@plt>
mov    %rax,-0x50(%rbp)
movl   $0x0,-0x5c(%rbp)
movslq -0x5c(%rbp),%rax
cmp    -0x38(%rbp),%rax
jae    1392 <main+0x1c2>
mov    $0x0,%al
call   10f0 <rand@plt>
mov    %eax,-0x60(%rbp)
movl   $0x0,-0x64(%rbp)
movslq -0x64(%rbp),%rax
cmp    $0x4,%rax
jae    137d <main+0x1ad>
mov    -0x60(%rbp),%eax
mov    $0x100,%ecx
cltd
idiv   %ecx
mov    -0x50(%rbp),%rax
mov    -0x5c(%rbp),%ecx
add    -0x64(%rbp),%ecx
movslq %ecx,%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x60(%rbp),%eax
mov    $0x100,%ecx
cltd
idiv   %ecx
mov    %eax,-0x60(%rbp)
mov    -0x64(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x64(%rbp)
jmp    1338 <main+0x168>
jmp    1382 <main+0x1b2>
movslq -0x5c(%rbp),%rax
add    $0x4,%rax
mov    %eax,-0x5c(%rbp)
jmp    1319 <main+0x149>
mov    -0x50(%rbp),%rdi
mov    -0x38(%rbp),%rdx
mov    -0x48(%rbp),%rcx
mov    $0x1,%esi
call   10e0 <fwrite@plt>
cmp    -0x38(%rbp),%rax
je     13c3 <main+0x1f3>
lea    0xcbe(%rip),%rdi
call   10c0 <perror@plt>
jmp    1419 <main+0x249>
mov    -0x50(%rbp),%rdi
call   1030 <free@plt>
movq   $0x0,-0x50(%rbp)
mov    -0x58(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x58(%rbp)
jmp    12f2 <main+0x122>
cmpq   $0x0,-0x48(%rbp)
je     13f9 <main+0x229>
mov    -0x48(%rbp),%rdi
call   1040 <fclose@plt>
cmpq   $0x0,-0x50(%rbp)
je     140d <main+0x23d>
mov    -0x50(%rbp),%rdi
call   1030 <free@plt>
movl   $0x0,-0x4(%rbp)
jmp    1467 <main+0x297>
cmpq   $0x0,-0x48(%rbp)
je     1435 <main+0x265>
mov    -0x48(%rbp),%rdi
call   1040 <fclose@plt>
movq   $0x0,-0x48(%rbp)
cmpq   $0x0,-0x50(%rbp)
je     1451 <main+0x281>
mov    -0x50(%rbp),%rdi
call   1030 <free@plt>
movq   $0x0,-0x50(%rbp)
lea    0xc31(%rip),%rdi
call   10c0 <perror@plt>
mov    $0x1,%edi
call   10d0 <exit@plt>
mov    -0x4(%rbp),%eax
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
xor    %edi,%edi
call   10a0 <time@plt>
mov    %eax,%edi
call   1070 <srand@plt>
lea    0xdfb(%rip),%rdi
mov    %ebp,%esi
xor    %eax,%eax
call   1060 <printf@plt>
cmp    $0x4,%ebp
jne    1346 <main+0x166>
mov    0x8(%rbx),%r15
mov    0x10(%rbx),%rbp
mov    0x18(%rbx),%r14
lea    0xdda(%rip),%rdi
mov    %r15,%rsi
mov    %rbp,%rdx
mov    %r14,%rcx
xor    %eax,%eax
call   1060 <printf@plt>
mov    %rbp,%rdi
call   10b0 <atol@plt>
mov    %rax,%r13
mov    %r14,%rdi
call   1090 <atoll@plt>
mov    %rax,%r14
lea    0xdc1(%rip),%rdi
mov    %r15,%rsi
mov    %rax,%rdx
mov    %r13,%rcx
xor    %eax,%eax
call   1060 <printf@plt>
lea    0xdda(%rip),%rsi
mov    %r15,%rdi
call   10c0 <fopen@plt>
test   %rax,%rax
je     139a <main+0x1ba>
mov    %rax,%r15
test   %r14,%r14
je     133c <main+0x15c>
xor    %r12d,%r12d
xchg   %ax,%ax
mov    %r13,%rdi
mov    $0x1,%esi
call   1080 <calloc@plt>
mov    %rax,%rbp
test   %r13,%r13
je     130f <main+0x12f>
xor    %ebx,%ebx
nopw   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1100 <rand@plt>
movslq %ebx,%rbx
mov    %al,0x0(%rbp,%rbx,1)
lea    0xff(%rax),%ecx
mov    %rbx,%rdx
or     $0x1,%rdx
lea    0xffff(%rax),%esi
lea    0xffffff(%rax),%edi
test   %eax,%eax
cmovns %eax,%ecx
cmovns %eax,%esi
mov    %ch,0x0(%rbp,%rdx,1)
cmovns %eax,%edi
shr    $0x10,%esi
mov    %rbx,%rax
or     $0x2,%rax
mov    %sil,0x0(%rbp,%rax,1)
shr    $0x18,%edi
mov    %rbx,%rax
or     $0x3,%rax
mov    %dil,0x0(%rbp,%rax,1)
add    $0x4,%ebx
movslq %ebx,%rax
cmp    %rax,%r13
ja     12b0 <main+0xd0>
mov    %rbp,%rdi
mov    $0x1,%esi
mov    %r13,%rdx
mov    %r15,%rcx
call   10f0 <fwrite@plt>
cmp    %r13,%rax
jne    1363 <main+0x183>
mov    %rbp,%rdi
call   1030 <free@plt>
add    $0x1,%r12
cmp    %r14,%r12
jne    1290 <main+0xb0>
mov    %r15,%rdi
call   1050 <fclose@plt>
jmp    1352 <main+0x172>
lea    0xd2e(%rip),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0xcf2(%rip),%rdi
call   10d0 <perror@plt>
mov    %r15,%rdi
call   1050 <fclose@plt>
test   %rbp,%rbp
je     1384 <main+0x1a4>
mov    %rbp,%rdi
call   1030 <free@plt>
lea    0xce3(%rip),%rdi
call   10d0 <perror@plt>
mov    $0x1,%edi
call   10e0 <exit@plt>
lea    0xca9(%rip),%rdi
jmp    138b <main+0x1ab>

LLVM IR (-O0):
@.str = [4 x i8] c"%d\0A\00"
@.str.1 = [27 x i8] c"Wrong number of arguments\0A\00"
@.str.2 = [20 x i8] c"Args: %s | %s | %s\0A\00"
@.str.3 = [48 x i8] c"Creating file %s with %llu records of size %lu\0A\00"
@.str.4 = [2 x i8] c"w\00"
@.str.5 = [18 x i8] c"Error with file.\0A\00"
@.str.6 = [18 x i8] c"Wrong write bytes\00"
@.str.7 = [13 x i8] c"File error.\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca i8*
%10 = alloca i64
%11 = alloca i64
%12 = alloca i32*
%13 = alloca i8*
%14 = alloca i64
%15 = alloca i32
%16 = alloca i32
%17 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%18 = call i32 @time(i32* null)
store i32 %18, i32* %6
%19 = load i32, i32* %6
%20 = call i32 @srand(i32 %19)
%21 = load i32, i32* %4
%22 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %21)
%23 = load i32, i32* %4
%24 = icmp ne i32 %23, 4
br i1 %24, label %25, label %27
25: ; preds = %2
%26 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0))
store i32 0, i32* %3
br label %145
27: ; preds = %2
%28 = load i8**, i8*** %5
%29 = getelementptr inbounds i8*, i8** %28, i64 1
%30 = load i8*, i8** %29
store i8* %30, i8** %7
%31 = load i8**, i8*** %5
%32 = getelementptr inbounds i8*, i8** %31, i64 2
%33 = load i8*, i8** %32
store i8* %33, i8** %8
%34 = load i8**, i8*** %5
%35 = getelementptr inbounds i8*, i8** %34, i64 3
%36 = load i8*, i8** %35
store i8* %36, i8** %9
%37 = load i8**, i8*** %5
%38 = getelementptr inbounds i8*, i8** %37, i64 1
%39 = load i8*, i8** %38
%40 = load i8**, i8*** %5
%41 = getelementptr inbounds i8*, i8** %40, i64 2
%42 = load i8*, i8** %41
%43 = load i8**, i8*** %5
%44 = getelementptr inbounds i8*, i8** %43, i64 3
%45 = load i8*, i8** %44
%46 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0), i8* %39, i8* %42, i8* %45)
%47 = load i8*, i8** %8
%48 = call i64 @atol(i8* %47)
store i64 %48, i64* %10
%49 = load i8*, i8** %9
%50 = call i64 @atoll(i8* %49)
store i64 %50, i64* %11
%51 = load i8*, i8** %7
%52 = load i64, i64* %11
%53 = load i64, i64* %10
%54 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str.3, i64 0, i64 0), i8* %51, i64 %52, i64 %53)
%55 = load i8*, i8** %7
%56 = call i32* @fopen(i8* %55, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
store i32* %56, i32** %12
%57 = load i32*, i32** %12
%58 = icmp eq i32* %57, null
br i1 %58, label %59, label %62
59: ; preds = %27
%60 = call i32 @perror(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.5, i64 0, i64 0))
%61 = call i32 @exit(i32 1)
unreachable
62: ; preds = %27
store i8* null, i8** %13
store i64 0, i64* %14
br label %63
63: ; preds = %114, %62
%64 = load i64, i64* %14
%65 = load i64, i64* %11
%66 = icmp ult i64 %64, %65
br i1 %66, label %67, label %117
67: ; preds = %63
%68 = load i64, i64* %10
%69 = call i8* @calloc(i64 %68, i32 1)
store i8* %69, i8** %13
store i32 0, i32* %15
br label %70
70: ; preds = %97, %67
%71 = load i32, i32* %15
%72 = sext i32 %71 to i64
%73 = load i64, i64* %10
%74 = icmp ult i64 %72, %73
br i1 %74, label %75, label %102
75: ; preds = %70
%76 = call i32 (...) @rand()
store i32 %76, i32* %16
store i32 0, i32* %17
br label %77
77: ; preds = %93, %75
%78 = load i32, i32* %17
%79 = sext i32 %78 to i64
%80 = icmp ult i64 %79, 4
br i1 %80, label %81, label %96
81: ; preds = %77
%82 = load i32, i32* %16
%83 = srem i32 %82, 256
%84 = trunc i32 %83 to i8
%85 = load i8*, i8** %13
%86 = load i32, i32* %15
%87 = load i32, i32* %17
%88 = add nsw i32 %86, %87
%89 = sext i32 %88 to i64
%90 = getelementptr inbounds i8, i8* %85, i64 %89
store i8 %84, i8* %90
%91 = load i32, i32* %16
%92 = sdiv i32 %91, 256
store i32 %92, i32* %16
br label %93
93: ; preds = %81
%94 = load i32, i32* %17
%95 = add nsw i32 %94, 1
store i32 %95, i32* %17
br label %77
96: ; preds = %77
br label %97
97: ; preds = %96
%98 = load i32, i32* %15
%99 = sext i32 %98 to i64
%100 = add i64 %99, 4
%101 = trunc i64 %100 to i32
store i32 %101, i32* %15
br label %70
102: ; preds = %70
%103 = load i8*, i8** %13
%104 = load i64, i64* %10
%105 = load i32*, i32** %12
%106 = call i64 @fwrite(i8* %103, i32 1, i64 %104, i32* %105)
%107 = load i64, i64* %10
%108 = icmp ne i64 %106, %107
br i1 %108, label %109, label %111
109: ; preds = %102
%110 = call i32 @perror(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.6, i64 0, i64 0))
br label %130
111: ; preds = %102
%112 = load i8*, i8** %13
%113 = call i32 @free(i8* %112)
store i8* null, i8** %13
br label %114
114: ; preds = %111
%115 = load i64, i64* %14
%116 = add i64 %115, 1
store i64 %116, i64* %14
br label %63
117: ; preds = %63
%118 = load i32*, i32** %12
%119 = icmp ne i32* %118, null
br i1 %119, label %120, label %123
120: ; preds = %117
%121 = load i32*, i32** %12
%122 = call i32 @fclose(i32* %121)
br label %123
123: ; preds = %120, %117
%124 = load i8*, i8** %13
%125 = icmp ne i8* %124, null
br i1 %125, label %126, label %129
126: ; preds = %123
%127 = load i8*, i8** %13
%128 = call i32 @free(i8* %127)
br label %129
129: ; preds = %126, %123
store i32 0, i32* %3
br label %145
130: ; preds = %109
%131 = load i32*, i32** %12
%132 = icmp ne i32* %131, null
br i1 %132, label %133, label %136
133: ; preds = %130
%134 = load i32*, i32** %12
%135 = call i32 @fclose(i32* %134)
store i32* null, i32** %12
br label %136
136: ; preds = %133, %130
%137 = load i8*, i8** %13
%138 = icmp ne i8* %137, null
br i1 %138, label %139, label %142
139: ; preds = %136
%140 = load i8*, i8** %13
%141 = call i32 @free(i8* %140)
store i8* null, i8** %13
br label %142
142: ; preds = %139, %136
%143 = call i32 @perror(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.7, i64 0, i64 0))
%144 = call i32 @exit(i32 1)
unreachable
145: ; preds = %129, %25
%146 = load i32, i32* %3
ret i32 %146
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
@.str.2 = [20 x i8] c"Args: %s | %s | %s\0A\00"
@.str.3 = [48 x i8] c"Creating file %s with %llu records of size %lu\0A\00"
@.str.4 = [2 x i8] c"w\00"
@.str.5 = [18 x i8] c"Error with file.\0A\00"
@.str.6 = [18 x i8] c"Wrong write bytes\00"
@.str.7 = [13 x i8] c"File error.\0A\00"
@str = [26 x i8] c"Wrong number of arguments\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = tail call i32 @time(i32* null)
%4 = tail call i32 @srand(i32 %3)
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %0)
%6 = icmp eq i32 %0, 4
br i1 %6, label %9, label %7
7: ; preds = %2
%8 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @str, i64 0, i64 0))
br label %71
9: ; preds = %2
%10 = getelementptr inbounds i8*, i8** %1, i64 1
%11 = load i8*, i8** %10
%12 = getelementptr inbounds i8*, i8** %1, i64 2
%13 = load i8*, i8** %12
%14 = getelementptr inbounds i8*, i8** %1, i64 3
%15 = load i8*, i8** %14
%16 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0), i8* %11, i8* %13, i8* %15)
%17 = tail call i64 @atol(i8* %13)
%18 = tail call i64 @atoll(i8* %15)
%19 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([48 x i8], [48 x i8]* @.str.3, i64 0, i64 0), i8* %11, i64 %18, i64 %17)
%20 = tail call i32* @fopen(i8* %11, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
%21 = icmp eq i32* %20, null
br i1 %21, label %26, label %22
22: ; preds = %9
%23 = icmp eq i64 %18, 0
br i1 %23, label %60, label %24
24: ; preds = %22
%25 = icmp eq i64 %17, 0
br label %29
26: ; preds = %9
%27 = tail call i32 @perror(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.5, i64 0, i64 0))
%28 = tail call i32 @exit(i32 1)
unreachable
29: ; preds = %24, %56
%30 = phi i64 [ 0, %24 ], [ %58, %56 ]
%31 = tail call i8* @calloc(i64 %17, i32 1)
br i1 %25, label %32, label %35
32: ; preds = %35, %29
%33 = tail call i64 @fwrite(i8* %31, i32 1, i64 %17, i32* %20)
%34 = icmp eq i64 %33, %17
br i1 %34, label %56, label %62
35: ; preds = %29, %35
%36 = phi i32 [ %53, %35 ], [ 0, %29 ]
%37 = tail call i32 (...) @rand()
%38 = sext i32 %36 to i64
%39 = trunc i32 %37 to i8
%40 = getelementptr inbounds i8, i8* %31, i64 %38
store i8 %39, i8* %40
%41 = sdiv i32 %37, 256
%42 = trunc i32 %41 to i8
%43 = or i64 %38, 1
%44 = getelementptr inbounds i8, i8* %31, i64 %43
store i8 %42, i8* %44
%45 = sdiv i32 %37, 65536
%46 = trunc i32 %45 to i8
%47 = or i64 %38, 2
%48 = getelementptr inbounds i8, i8* %31, i64 %47
store i8 %46, i8* %48
%49 = sdiv i32 %37, 16777216
%50 = trunc i32 %49 to i8
%51 = or i64 %38, 3
%52 = getelementptr inbounds i8, i8* %31, i64 %51
store i8 %50, i8* %52
%53 = add i32 %36, 4
%54 = sext i32 %53 to i64
%55 = icmp ugt i64 %17, %54
br i1 %55, label %35, label %32
56: ; preds = %32
%57 = tail call i32 @free(i8* %31)
%58 = add nuw i64 %30, 1
%59 = icmp eq i64 %58, %18
br i1 %59, label %60, label %29
60: ; preds = %56, %22
%61 = tail call i32 @fclose(i32* %20)
br label %71
62: ; preds = %32
%63 = tail call i32 @perror(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.6, i64 0, i64 0))
%64 = tail call i32 @fclose(i32* %20)
%65 = icmp eq i8* %31, null
br i1 %65, label %68, label %66
66: ; preds = %62
%67 = tail call i32 @free(i8* %31)
br label %68
68: ; preds = %66, %62
%69 = tail call i32 @perror(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.7, i64 0, i64 0))
%70 = tail call i32 @exit(i32 1)
unreachable
71: ; preds = %60, %7
ret i32 0
}