#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 */

/* Variables and functions */
int /*<<< orphan*/ EXIT_SUCCESS;
int atoi(char *);
int /*<<< orphan*/ errExit(char *, ...);
int /*<<< orphan*/ errno;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ free(char *);
char *malloc(int);
int /*<<< orphan*/ printf(char *, int, ...);
int /*<<< orphan*/ sbrk(int /*<<< orphan*/);
scalar_t__ strcmp(char *, char *);
int strerror(int /*<<< orphan*/);
int main(int argc, char *argv[]) {
  char *ptr[1000000];
  int freeStep, freeMin, freeMax, blockSize, numAllocs, j;
  if (argc < 3 || strcmp(argv[1], "--help") == 0) {
    errExit("Usage: %s num-allocs block-size [step [min [max]]]\n", argv[0]);
  }
  numAllocs = atoi(argv[1]);
  blockSize = atoi(argv[2]);
  freeStep = (argc > 3) ? atoi(argv[3]) : 1;
  freeMin = (argc > 4) ? atoi(argv[4]) : 1;
  freeMax = (argc > 5) ? atoi(argv[5]) : numAllocs;
  if (freeMax > numAllocs) {
    errExit("cannot free more than %d\n", numAllocs);
  }
  printf("Initial program break is at %p\n", sbrk(0));
  printf("Allocating %d * %d bytes\n", numAllocs, blockSize);
  for (j = 0; j < numAllocs; j++) {
    ptr[j] = malloc(blockSize);
    if (ptr[j] == NULL) {
      errExit("error on malloc,%s\n", strerror(errno));
    }
  }
  printf("Program break is now at %p\n", sbrk(0));
  printf("Freeing blocks from %d to %d in steps of %d\n", freeMin, freeMax,
         freeStep);
  for (j = freeMin - 1; j < freeMax; j += freeStep) {
    free(ptr[j]);
  }
  printf("After freeing program break is at %p\n", sbrk(0));
  exit(EXIT_SUCCESS);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x7a1240,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x3,-0x8(%rbp)
jl     11d1 <main+0x41>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xe3e(%rip),%rsi
call   1070 <strcmp@plt>
cmp    $0x0,%rax
jne    11e6 <main+0x56>
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
lea    0xe28(%rip),%rdi
mov    $0x0,%al
call   1040 <errExit@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1090 <atoi@plt>
mov    %eax,-0x7a1224(%rbp)
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
call   1090 <atoi@plt>
mov    %eax,-0x7a1220(%rbp)
cmpl   $0x3,-0x8(%rbp)
jle    122e <main+0x9e>
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rdi
call   1090 <atoi@plt>
mov    %eax,-0x7a122c(%rbp)
jmp    123e <main+0xae>
mov    $0x1,%eax
mov    %eax,-0x7a122c(%rbp)
jmp    123e <main+0xae>
mov    -0x7a122c(%rbp),%eax
mov    %eax,-0x7a1214(%rbp)
cmpl   $0x4,-0x8(%rbp)
jle    126c <main+0xdc>
mov    -0x10(%rbp),%rax
mov    0x20(%rax),%rdi
call   1090 <atoi@plt>
mov    %eax,-0x7a1230(%rbp)
jmp    127c <main+0xec>
mov    $0x1,%eax
mov    %eax,-0x7a1230(%rbp)
jmp    127c <main+0xec>
mov    -0x7a1230(%rbp),%eax
mov    %eax,-0x7a1218(%rbp)
cmpl   $0x5,-0x8(%rbp)
jle    12aa <main+0x11a>
mov    -0x10(%rbp),%rax
mov    0x28(%rax),%rdi
call   1090 <atoi@plt>
mov    %eax,-0x7a1234(%rbp)
jmp    12b6 <main+0x126>
mov    -0x7a1224(%rbp),%eax
mov    %eax,-0x7a1234(%rbp)
mov    -0x7a1234(%rbp),%eax
mov    %eax,-0x7a121c(%rbp)
mov    -0x7a121c(%rbp),%eax
cmp    -0x7a1224(%rbp),%eax
jle    12e8 <main+0x158>
mov    -0x7a1224(%rbp),%esi
lea    0xd5a(%rip),%rdi
mov    $0x0,%al
call   1040 <errExit@plt>
xor    %edi,%edi
call   1060 <sbrk@plt>
mov    %eax,%esi
lea    0xd5d(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x7a1224(%rbp),%esi
mov    -0x7a1220(%rbp),%edx
lea    0xd63(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
movl   $0x0,-0x7a1228(%rbp)
mov    -0x7a1228(%rbp),%eax
cmp    -0x7a1224(%rbp),%eax
jge    139f <main+0x20f>
mov    -0x7a1220(%rbp),%edi
call   1080 <malloc@plt>
mov    %rax,%rcx
movslq -0x7a1228(%rbp),%rax
mov    %rcx,-0x7a1210(%rbp,%rax,8)
ff
movslq -0x7a1228(%rbp),%rax
cmpq   $0x0,-0x7a1210(%rbp,%rax,8)
jne    1386 <main+0x1f6>
mov    0x2c71(%rip),%rax
mov    (%rax),%edi
call   10b0 <strerror@plt>
mov    %eax,%esi
lea    0xd10(%rip),%rdi
mov    $0x0,%al
call   1040 <errExit@plt>
jmp    138b <main+0x1fb>
mov    -0x7a1228(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x7a1228(%rbp)
jmp    1323 <main+0x193>
xor    %edi,%edi
call   1060 <sbrk@plt>
mov    %eax,%esi
lea    0xcf4(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x7a1218(%rbp),%esi
mov    -0x7a121c(%rbp),%edx
mov    -0x7a1214(%rbp),%ecx
lea    0xcf0(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x7a1218(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x7a1228(%rbp)
mov    -0x7a1228(%rbp),%eax
cmp    -0x7a121c(%rbp),%eax
jge    1422 <main+0x292>
movslq -0x7a1228(%rbp),%rax
mov    -0x7a1210(%rbp,%rax,8),%rdi
ff
call   1030 <free@plt>
mov    -0x7a1214(%rbp),%eax
add    -0x7a1228(%rbp),%eax
mov    %eax,-0x7a1228(%rbp)
jmp    13e5 <main+0x255>
xor    %edi,%edi
call   1060 <sbrk@plt>
mov    %eax,%esi
lea    0xcba(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    0x2b98(%rip),%rax
mov    (%rax),%edi
call   10a0 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x7a1218,%rsp
mov    %rsi,%rbx
mov    %edi,%r15d
cmp    $0x3,%edi
jl     11c1 <main+0x31>
mov    0x8(%rbx),%rdi
lea    0xe49(%rip),%rsi
call   1070 <strcmp@plt>
test   %rax,%rax
jne    11d2 <main+0x42>
mov    (%rbx),%rsi
lea    0xe3c(%rip),%rdi
xor    %eax,%eax
call   1040 <errExit@plt>
mov    0x8(%rbx),%rdi
call   1090 <atoi@plt>
mov    %eax,%r13d
mov    0x10(%rbx),%rdi
call   1090 <atoi@plt>
mov    %eax,%ebp
mov    $0x1,%r12d
cmp    $0x4,%r15d
jl     1242 <main+0xb2>
mov    0x18(%rbx),%rdi
call   1090 <atoi@plt>
mov    %eax,%r14d
cmp    $0x4,%r15d
mov    %eax,0xc(%rsp)
je     1251 <main+0xc1>
mov    0x20(%rbx),%rdi
call   1090 <atoi@plt>
mov    %eax,%r12d
cmp    $0x6,%r15d
jb     1251 <main+0xc1>
mov    0x28(%rbx),%rdi
call   1090 <atoi@plt>
mov    %eax,0x8(%rsp)
cmp    %r13d,%eax
jle    1256 <main+0xc6>
lea    0xe05(%rip),%rdi
mov    %r13d,%esi
xor    %eax,%eax
call   1040 <errExit@plt>
jmp    1256 <main+0xc6>
mov    %r13d,0x8(%rsp)
movl   $0x1,0xc(%rsp)
jmp    1256 <main+0xc6>
mov    %r13d,0x8(%rsp)
xor    %edi,%edi
call   1060 <sbrk@plt>
lea    0xdf1(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xe01(%rip),%rdi
mov    %r13d,%esi
mov    %ebp,%edx
xor    %eax,%eax
call   1050 <printf@plt>
test   %r13d,%r13d
jle    12d0 <main+0x140>
mov    %r13d,%ebx
mov    0x2d51(%rip),%r14
lea    0xdf9(%rip),%r13
xor    %r15d,%r15d
jmp    12a9 <main+0x119>
nopl   0x0(%rax,%rax,1)
add    $0x1,%r15
cmp    %r15,%rbx
je     12d0 <main+0x140>
mov    %ebp,%edi
call   1080 <malloc@plt>
mov    %rax,0x10(%rsp,%r15,8)
test   %rax,%rax
jne    12a0 <main+0x110>
mov    (%r14),%edi
call   10b0 <strerror@plt>
mov    %r13,%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1040 <errExit@plt>
jmp    12a0 <main+0x110>
xor    %edi,%edi
call   1060 <sbrk@plt>
lea    0xdc5(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xdd1(%rip),%rdi
mov    %r12d,%esi
mov    0x8(%rsp),%ebp
mov    %ebp,%edx
mov    0xc(%rsp),%r14d
mov    %r14d,%ecx
xor    %eax,%eax
call   1050 <printf@plt>
cmp    %ebp,%r12d
jg     1332 <main+0x1a2>
add    $0xffffffff,%r12d
movslq %r12d,%rbx
movslq %r14d,%r14
movslq %ebp,%rbp
nopl   0x0(%rax,%rax,1)
mov    0x10(%rsp,%rbx,8),%rdi
call   1030 <free@plt>
add    %r14,%rbx
cmp    %rbp,%rbx
jl     1320 <main+0x190>
xor    %edi,%edi
call   1060 <sbrk@plt>
lea    0xdac(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    0x2c88(%rip),%rax
mov    (%rax),%edi
call   10a0 <exit@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"--help\00"
@.str.1 = [52 x i8] c"Usage: %s num-allocs block-size [step [min [max]]]\0A\00"
@.str.2 = [26 x i8] c"cannot free more than %d\0A\00"
@.str.3 = [32 x i8] c"Initial program break is at %p\0A\00"
@.str.4 = [26 x i8] c"Allocating %d * %d bytes\0A\00"
@.str.5 = [20 x i8] c"error on malloc,%s\0A\00"
@errno = global i32 0
@.str.6 = [28 x i8] c"Program break is now at %p\0A\00"
@.str.7 = [45 x i8] c"Freeing blocks from %d to %d in steps of %d\0A\00"
@.str.8 = [38 x i8] c"After freeing program break is at %p\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [1000000 x i8*]
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%13 = load i32, i32* %4
%14 = icmp slt i32 %13, 3
br i1 %14, label %21, label %15
15: ; preds = %2
%16 = load i8**, i8*** %5
%17 = getelementptr inbounds i8*, i8** %16, i64 1
%18 = load i8*, i8** %17
%19 = call i64 @strcmp(i8* %18, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%20 = icmp eq i64 %19, 0
br i1 %20, label %21, label %26
21: ; preds = %15, %2
%22 = load i8**, i8*** %5
%23 = getelementptr inbounds i8*, i8** %22, i64 0
%24 = load i8*, i8** %23
%25 = call i32 (i8*, ...) @errExit(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str.1, i64 0, i64 0), i8* %24)
br label %26
26: ; preds = %21, %15
%27 = load i8**, i8*** %5
%28 = getelementptr inbounds i8*, i8** %27, i64 1
%29 = load i8*, i8** %28
%30 = call i32 @atoi(i8* %29)
store i32 %30, i32* %11
%31 = load i8**, i8*** %5
%32 = getelementptr inbounds i8*, i8** %31, i64 2
%33 = load i8*, i8** %32
%34 = call i32 @atoi(i8* %33)
store i32 %34, i32* %10
%35 = load i32, i32* %4
%36 = icmp sgt i32 %35, 3
br i1 %36, label %37, label %42
37: ; preds = %26
%38 = load i8**, i8*** %5
%39 = getelementptr inbounds i8*, i8** %38, i64 3
%40 = load i8*, i8** %39
%41 = call i32 @atoi(i8* %40)
br label %43
42: ; preds = %26
br label %43
43: ; preds = %42, %37
%44 = phi i32 [ %41, %37 ], [ 1, %42 ]
store i32 %44, i32* %7
%45 = load i32, i32* %4
%46 = icmp sgt i32 %45, 4
br i1 %46, label %47, label %52
47: ; preds = %43
%48 = load i8**, i8*** %5
%49 = getelementptr inbounds i8*, i8** %48, i64 4
%50 = load i8*, i8** %49
%51 = call i32 @atoi(i8* %50)
br label %53
52: ; preds = %43
br label %53
53: ; preds = %52, %47
%54 = phi i32 [ %51, %47 ], [ 1, %52 ]
store i32 %54, i32* %8
%55 = load i32, i32* %4
%56 = icmp sgt i32 %55, 5
br i1 %56, label %57, label %62
57: ; preds = %53
%58 = load i8**, i8*** %5
%59 = getelementptr inbounds i8*, i8** %58, i64 5
%60 = load i8*, i8** %59
%61 = call i32 @atoi(i8* %60)
br label %64
62: ; preds = %53
%63 = load i32, i32* %11
br label %64
64: ; preds = %62, %57
%65 = phi i32 [ %61, %57 ], [ %63, %62 ]
store i32 %65, i32* %9
%66 = load i32, i32* %9
%67 = load i32, i32* %11
%68 = icmp sgt i32 %66, %67
br i1 %68, label %69, label %72
69: ; preds = %64
%70 = load i32, i32* %11
%71 = call i32 (i8*, ...) @errExit(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.2, i64 0, i64 0), i32 %70)
br label %72
72: ; preds = %69, %64
%73 = call i32 @sbrk(i32 0)
%74 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.3, i64 0, i64 0), i32 %73)
%75 = load i32, i32* %11
%76 = load i32, i32* %10
%77 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.4, i64 0, i64 0), i32 %75, i32 %76)
store i32 0, i32* %12
br label %78
78: ; preds = %98, %72
%79 = load i32, i32* %12
%80 = load i32, i32* %11
%81 = icmp slt i32 %79, %80
br i1 %81, label %82, label %101
82: ; preds = %78
%83 = load i32, i32* %10
%84 = call i8* @malloc(i32 %83)
%85 = load i32, i32* %12
%86 = sext i32 %85 to i64
%87 = getelementptr inbounds [1000000 x i8*], [1000000 x i8*]* %6, i64 0, i64 %86
store i8* %84, i8** %87
%88 = load i32, i32* %12
%89 = sext i32 %88 to i64
%90 = getelementptr inbounds [1000000 x i8*], [1000000 x i8*]* %6, i64 0, i64 %89
%91 = load i8*, i8** %90
%92 = icmp eq i8* %91, null
br i1 %92, label %93, label %97
93: ; preds = %82
%94 = load i32, i32* @errno
%95 = call i32 @strerror(i32 %94)
%96 = call i32 (i8*, ...) @errExit(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.5, i64 0, i64 0), i32 %95)
br label %97
97: ; preds = %93, %82
br label %98
98: ; preds = %97
%99 = load i32, i32* %12
%100 = add nsw i32 %99, 1
store i32 %100, i32* %12
br label %78
101: ; preds = %78
%102 = call i32 @sbrk(i32 0)
%103 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.6, i64 0, i64 0), i32 %102)
%104 = load i32, i32* %8
%105 = load i32, i32* %9
%106 = load i32, i32* %7
%107 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.7, i64 0, i64 0), i32 %104, i32 %105, i32 %106)
%108 = load i32, i32* %8
%109 = sub nsw i32 %108, 1
store i32 %109, i32* %12
br label %110
110: ; preds = %120, %101
%111 = load i32, i32* %12
%112 = load i32, i32* %9
%113 = icmp slt i32 %111, %112
br i1 %113, label %114, label %124
114: ; preds = %110
%115 = load i32, i32* %12
%116 = sext i32 %115 to i64
%117 = getelementptr inbounds [1000000 x i8*], [1000000 x i8*]* %6, i64 0, i64 %116
%118 = load i8*, i8** %117
%119 = call i32 @free(i8* %118)
br label %120
120: ; preds = %114
%121 = load i32, i32* %7
%122 = load i32, i32* %12
%123 = add nsw i32 %122, %121
store i32 %123, i32* %12
br label %110
124: ; preds = %110
%125 = call i32 @sbrk(i32 0)
%126 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.8, i64 0, i64 0), i32 %125)
%127 = load i32, i32* @EXIT_SUCCESS
%128 = call i32 @exit(i32 %127)
unreachable
}

LLVM IR (-O2):
@.str = [7 x i8] c"--help\00"
@.str.1 = [52 x i8] c"Usage: %s num-allocs block-size [step [min [max]]]\0A\00"
@.str.2 = [26 x i8] c"cannot free more than %d\0A\00"
@.str.3 = [32 x i8] c"Initial program break is at %p\0A\00"
@.str.4 = [26 x i8] c"Allocating %d * %d bytes\0A\00"
@.str.5 = [20 x i8] c"error on malloc,%s\0A\00"
@errno = global i32 0
@.str.6 = [28 x i8] c"Program break is now at %p\0A\00"
@.str.7 = [45 x i8] c"Freeing blocks from %d to %d in steps of %d\0A\00"
@.str.8 = [38 x i8] c"After freeing program break is at %p\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca [1000000 x i8*]
%4 = bitcast [1000000 x i8*]* %3 to i8*
%5 = icmp slt i32 %0, 3
br i1 %5, label %11, label %6
6: ; preds = %2
%7 = getelementptr inbounds i8*, i8** %1, i64 1
%8 = load i8*, i8** %7
%9 = tail call i64 @strcmp(i8* %8, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%10 = icmp eq i64 %9, 0
br i1 %10, label %11, label %14
11: ; preds = %6, %2
%12 = load i8*, i8** %1
%13 = tail call i32 (i8*, ...) @errExit(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str.1, i64 0, i64 0), i8* %12)
br label %14
14: ; preds = %11, %6
%15 = getelementptr inbounds i8*, i8** %1, i64 1
%16 = load i8*, i8** %15
%17 = tail call i32 @atoi(i8* %16)
%18 = getelementptr inbounds i8*, i8** %1, i64 2
%19 = load i8*, i8** %18
%20 = tail call i32 @atoi(i8* %19)
%21 = icmp sgt i32 %0, 3
br i1 %21, label %22, label %39
22: ; preds = %14
%23 = getelementptr inbounds i8*, i8** %1, i64 3
%24 = load i8*, i8** %23
%25 = tail call i32 @atoi(i8* %24)
%26 = icmp eq i32 %0, 4
br i1 %26, label %39, label %27
27: ; preds = %22
%28 = getelementptr inbounds i8*, i8** %1, i64 4
%29 = load i8*, i8** %28
%30 = tail call i32 @atoi(i8* %29)
%31 = icmp ugt i32 %0, 5
br i1 %31, label %32, label %39
32: ; preds = %27
%33 = getelementptr inbounds i8*, i8** %1, i64 5
%34 = load i8*, i8** %33
%35 = tail call i32 @atoi(i8* %34)
%36 = icmp sgt i32 %35, %17
br i1 %36, label %37, label %39
37: ; preds = %32
%38 = tail call i32 (i8*, ...) @errExit(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.2, i64 0, i64 0), i32 %17)
br label %39
39: ; preds = %14, %22, %27, %37, %32
%40 = phi i32 [ %35, %37 ], [ %35, %32 ], [ %17, %27 ], [ %17, %22 ], [ %17, %14 ]
%41 = phi i32 [ %25, %37 ], [ %25, %32 ], [ %25, %27 ], [ %25, %22 ], [ 1, %14 ]
%42 = phi i32 [ %30, %37 ], [ %30, %32 ], [ %30, %27 ], [ 1, %22 ], [ 1, %14 ]
%43 = tail call i32 @sbrk(i32 0)
%44 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.3, i64 0, i64 0), i32 %43)
%45 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.4, i64 0, i64 0), i32 %17, i32 %20)
%46 = icmp sgt i32 %17, 0
br i1 %46, label %47, label %61
47: ; preds = %39
%48 = zext i32 %17 to i64
br label %49
49: ; preds = %47, %58
%50 = phi i64 [ 0, %47 ], [ %59, %58 ]
%51 = tail call i8* @malloc(i32 %20)
%52 = getelementptr inbounds [1000000 x i8*], [1000000 x i8*]* %3, i64 0, i64 %50
store i8* %51, i8** %52
%53 = icmp eq i8* %51, null
br i1 %53, label %54, label %58
54: ; preds = %49
%55 = load i32, i32* @errno
%56 = tail call i32 @strerror(i32 %55)
%57 = tail call i32 (i8*, ...) @errExit(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.5, i64 0, i64 0), i32 %56)
br label %58
58: ; preds = %49, %54
%59 = add nuw nsw i64 %50, 1
%60 = icmp eq i64 %59, %48
br i1 %60, label %61, label %49
61: ; preds = %58, %39
%62 = tail call i32 @sbrk(i32 0)
%63 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.6, i64 0, i64 0), i32 %62)
%64 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.7, i64 0, i64 0), i32 %42, i32 %40, i32 %41)
%65 = icmp sgt i32 %42, %40
br i1 %65, label %78, label %66
66: ; preds = %61
%67 = add i32 %42, -1
%68 = sext i32 %67 to i64
%69 = sext i32 %41 to i64
%70 = sext i32 %40 to i64
br label %71
71: ; preds = %66, %71
%72 = phi i64 [ %68, %66 ], [ %76, %71 ]
%73 = getelementptr inbounds [1000000 x i8*], [1000000 x i8*]* %3, i64 0, i64 %72
%74 = load i8*, i8** %73
%75 = tail call i32 @free(i8* %74)
%76 = add i64 %72, %69
%77 = icmp slt i64 %76, %70
br i1 %77, label %71, label %78
78: ; preds = %71, %61
%79 = tail call i32 @sbrk(i32 0)
%80 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.8, i64 0, i64 0), i32 %79)
%81 = load i32, i32* @EXIT_SUCCESS
%82 = tail call i32 @exit(i32 %81)
unreachable
}