#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 /*<<< orphan*/ error(char *);
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ free(char *);
long getInt(char *);
char *malloc(long);
int /*<<< orphan*/ pexit(char *);
int /*<<< orphan*/ printf(char *, ...);
void *sbrk(int /*<<< orphan*/);
int /*<<< orphan*/ usage();
int main(int argc, char *argv[]) {
  char *ptr[(1000000)];
  long freeStep, freeMin, freeMax, blockSize, numAllocs, j;
  void *breakp, *breakp_iter;
  if (argc < 3)
    usage();
  numAllocs = getInt(argv[1]);
  blockSize = getInt(argv[2]);
  freeStep = (argc > 3) ? getInt(argv[3]) : 1;
  freeMin = (argc > 4) ? getInt(argv[4]) : 1;
  freeMax = (argc > 5) ? getInt(argv[5]) : numAllocs;
  if (freeMax > numAllocs)
    error("freeMax > numAllocs");
  breakp = sbrk(0);
  printf("%50s%10p\n", "Initial program break:", breakp);
  printf("Allocating %ld * %ld bytes\n", numAllocs, blockSize);
  for (j = 0; j < numAllocs; ++j) {
    ptr[j] = malloc(blockSize);
    if (ptr[j] == NULL)
      pexit("malloc");
    breakp_iter = sbrk(0);
    if (breakp_iter != breakp) {
      printf("(%ld)%50s%10p\n", j + 1, "=> Program break now at", breakp_iter);
      breakp = breakp_iter;
    }
  }
  printf("%50s%10p\n", "Program break is now:", sbrk(0));
  printf("Freeing blocks from %ld to %ld in steps of %ld\n", freeMin, freeMax,
         freeStep);
  for (j = freeMin - 1; j < freeMax; j += freeStep)
    free(ptr[j]);
  printf("%50s%10p\n", "After free(), program break is:", sbrk(0));
  exit(EXIT_SUCCESS);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x7a1270,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x3,-0x8(%rbp)
jge    11ba <main+0x2a>
mov    $0x0,%al
call   1070 <usage@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1090 <getInt@plt>
mov    %rax,-0x7a1238(%rbp)
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
call   1090 <getInt@plt>
mov    %rax,-0x7a1230(%rbp)
cmpl   $0x3,-0x8(%rbp)
jle    1205 <main+0x75>
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rdi
call   1090 <getInt@plt>
mov    %rax,-0x7a1258(%rbp)
jmp    1216 <main+0x86>
mov    $0x1,%eax
mov    %rax,-0x7a1258(%rbp)
jmp    1216 <main+0x86>
mov    -0x7a1258(%rbp),%rax
mov    %rax,-0x7a1218(%rbp)
cmpl   $0x4,-0x8(%rbp)
jle    1247 <main+0xb7>
mov    -0x10(%rbp),%rax
mov    0x20(%rax),%rdi
call   1090 <getInt@plt>
mov    %rax,-0x7a1260(%rbp)
jmp    1258 <main+0xc8>
mov    $0x1,%eax
mov    %rax,-0x7a1260(%rbp)
jmp    1258 <main+0xc8>
mov    -0x7a1260(%rbp),%rax
mov    %rax,-0x7a1220(%rbp)
cmpl   $0x5,-0x8(%rbp)
jle    1289 <main+0xf9>
mov    -0x10(%rbp),%rax
mov    0x28(%rax),%rdi
call   1090 <getInt@plt>
mov    %rax,-0x7a1268(%rbp)
jmp    1297 <main+0x107>
mov    -0x7a1238(%rbp),%rax
mov    %rax,-0x7a1268(%rbp)
mov    -0x7a1268(%rbp),%rax
mov    %rax,-0x7a1228(%rbp)
mov    -0x7a1228(%rbp),%rax
cmp    -0x7a1238(%rbp),%rax
jle    12c5 <main+0x135>
lea    0xd40(%rip),%rdi
call   1080 <error@plt>
xor    %edi,%edi
call   1050 <sbrk@plt>
mov    %rax,-0x7a1248(%rbp)
mov    -0x7a1248(%rbp),%rdx
lea    0xd72(%rip),%rdi
lea    0xd2c(%rip),%rsi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x7a1238(%rbp),%rsi
mov    -0x7a1230(%rbp),%rdx
lea    0xd27(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movq   $0x0,-0x7a1240(%rbp)
mov    -0x7a1240(%rbp),%rax
cmp    -0x7a1238(%rbp),%rax
jge    13dd <main+0x24d>
mov    -0x7a1230(%rbp),%rdi
call   1060 <malloc@plt>
mov    %rax,%rcx
mov    -0x7a1240(%rbp),%rax
mov    %rcx,-0x7a1210(%rbp,%rax,8)
ff
mov    -0x7a1240(%rbp),%rax
cmpq   $0x0,-0x7a1210(%rbp,%rax,8)
jne    136a <main+0x1da>
lea    0xce2(%rip),%rdi
call   10b0 <pexit@plt>
xor    %edi,%edi
call   1050 <sbrk@plt>
mov    %rax,-0x7a1250(%rbp)
mov    -0x7a1250(%rbp),%rax
cmp    -0x7a1248(%rbp),%rax
je     13c1 <main+0x231>
mov    -0x7a1240(%rbp),%rsi
add    $0x1,%rsi
mov    -0x7a1250(%rbp),%rcx
lea    0xca9(%rip),%rdi
lea    0xcb1(%rip),%rdx
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x7a1250(%rbp),%rax
mov    %rax,-0x7a1248(%rbp)
jmp    13c6 <main+0x236>
mov    -0x7a1240(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x7a1240(%rbp)
jmp    1316 <main+0x186>
xor    %edi,%edi
call   1050 <sbrk@plt>
mov    %rax,%rdx
lea    0xc65(%rip),%rdi
lea    0xc80(%rip),%rsi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x7a1220(%rbp),%rsi
mov    -0x7a1228(%rbp),%rdx
mov    -0x7a1218(%rbp),%rcx
lea    0xc73(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x7a1220(%rbp),%rax
sub    $0x1,%rax
mov    %rax,-0x7a1240(%rbp)
mov    -0x7a1240(%rbp),%rax
cmp    -0x7a1228(%rbp),%rax
jge    1473 <main+0x2e3>
mov    -0x7a1240(%rbp),%rax
mov    -0x7a1210(%rbp,%rax,8),%rdi
ff
call   1030 <free@plt>
mov    -0x7a1218(%rbp),%rax
add    -0x7a1240(%rbp),%rax
mov    %rax,-0x7a1240(%rbp)
jmp    1431 <main+0x2a1>
xor    %edi,%edi
call   1050 <sbrk@plt>
mov    %rax,%rdx
lea    0xbcf(%rip),%rdi
lea    0xc30(%rip),%rsi
mov    $0x0,%al
call   1040 <printf@plt>
mov    0x2b47(%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,%r14
mov    %edi,%ebp
cmp    $0x2,%edi
jg     11b2 <main+0x22>
xor    %eax,%eax
call   1070 <usage@plt>
mov    0x8(%r14),%rdi
call   1090 <getInt@plt>
mov    %rax,%r12
mov    0x10(%r14),%rdi
call   1090 <getInt@plt>
mov    %rax,%r13
mov    $0x1,%ebx
cmp    $0x4,%ebp
jl     121b <main+0x8b>
mov    0x18(%r14),%rdi
call   1090 <getInt@plt>
mov    %rax,%r15
cmp    $0x4,%ebp
mov    %rax,0x8(%rsp)
je     122b <main+0x9b>
mov    0x20(%r14),%rdi
call   1090 <getInt@plt>
mov    %rax,%rbx
cmp    $0x6,%ebp
jb     122b <main+0x9b>
mov    0x28(%r14),%rdi
call   1090 <getInt@plt>
mov    %rax,(%rsp)
cmp    %r12,%rax
jle    122f <main+0x9f>
lea    0xdec(%rip),%rdi
call   1080 <error@plt>
jmp    122f <main+0x9f>
mov    %r12,(%rsp)
mov    $0x1,%eax
mov    %rax,0x8(%rsp)
jmp    122f <main+0x9f>
mov    %r12,(%rsp)
xor    %edi,%edi
call   1050 <sbrk@plt>
mov    %rax,%r15
lea    0xe13(%rip),%rdi
lea    0xdcd(%rip),%rsi
mov    %rax,%rdx
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xdd3(%rip),%rdi
mov    %r12,%rsi
mov    %r13,%rdx
xor    %eax,%eax
call   1040 <printf@plt>
test   %r12,%r12
jle    12df <main+0x14f>
neg    %r12
mov    $0x1,%r14d
jmp    1292 <main+0x102>
cs nopw 0x0(%rax,%rax,1)
nop
lea    (%r12,%r14,1),%rax
add    $0x1,%rax
add    $0x1,%r14
cmp    $0x1,%rax
je     12df <main+0x14f>
mov    %r13,%rdi
call   1060 <malloc@plt>
mov    %rax,0x8(%rsp,%r14,8)
test   %rax,%rax
jne    12b0 <main+0x120>
lea    0xd9c(%rip),%rdi
call   10b0 <pexit@plt>
xor    %edi,%edi
call   1050 <sbrk@plt>
cmp    %r15,%rax
je     1280 <main+0xf0>
mov    %rax,%rbp
lea    0xd88(%rip),%rdi
mov    %r14,%rsi
lea    0xd8d(%rip),%rdx
mov    %rax,%rcx
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbp,%r15
jmp    1280 <main+0xf0>
xor    %edi,%edi
call   1050 <sbrk@plt>
lea    0xd66(%rip),%rdi
lea    0xd81(%rip),%rsi
mov    %rax,%rdx
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xd86(%rip),%rdi
mov    %rbx,%rsi
mov    (%rsp),%r14
mov    %r14,%rdx
mov    0x8(%rsp),%rbp
mov    %rbp,%rcx
xor    %eax,%eax
call   1040 <printf@plt>
cmp    %r14,%rbx
jg     1342 <main+0x1b2>
add    $0xffffffffffffffff,%rbx
nopw   0x0(%rax,%rax,1)
mov    0x10(%rsp,%rbx,8),%rdi
call   1030 <free@plt>
add    %rbp,%rbx
cmp    %r14,%rbx
jl     1330 <main+0x1a0>
xor    %edi,%edi
call   1050 <sbrk@plt>
lea    0xd03(%rip),%rdi
lea    0xd64(%rip),%rsi
mov    %rax,%rdx
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x2c78(%rip),%rax
mov    (%rax),%edi
call   10a0 <exit@plt>

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

LLVM IR (-O2):
@.str = [20 x i8] c"freeMax > numAllocs\00"
@.str.1 = [10 x i8] c"%50s%10p\0A\00"
@.str.2 = [23 x i8] c"Initial program break:\00"
@.str.3 = [28 x i8] c"Allocating %ld * %ld bytes\0A\00"
@.str.4 = [7 x i8] c"malloc\00"
@.str.5 = [15 x i8] c"(%ld)%50s%10p\0A\00"
@.str.6 = [24 x i8] c"=> Program break now at\00"
@.str.7 = [22 x i8] c"Program break is now:\00"
@.str.8 = [48 x i8] c"Freeing blocks from %ld to %ld in steps of %ld\0A\00"
@.str.9 = [32 x i8] c"After free(), program break is:\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 %6, label %8
6: ; preds = %2
%7 = tail call i32 (...) @usage()
br label %8
8: ; preds = %6, %2
%9 = getelementptr inbounds i8*, i8** %1, i64 1
%10 = load i8*, i8** %9
%11 = tail call i64 @getInt(i8* %10)
%12 = getelementptr inbounds i8*, i8** %1, i64 2
%13 = load i8*, i8** %12
%14 = tail call i64 @getInt(i8* %13)
%15 = icmp sgt i32 %0, 3
br i1 %15, label %16, label %33
16: ; preds = %8
%17 = getelementptr inbounds i8*, i8** %1, i64 3
%18 = load i8*, i8** %17
%19 = tail call i64 @getInt(i8* %18)
%20 = icmp eq i32 %0, 4
br i1 %20, label %33, label %21
21: ; preds = %16
%22 = getelementptr inbounds i8*, i8** %1, i64 4
%23 = load i8*, i8** %22
%24 = tail call i64 @getInt(i8* %23)
%25 = icmp ugt i32 %0, 5
br i1 %25, label %26, label %33
26: ; preds = %21
%27 = getelementptr inbounds i8*, i8** %1, i64 5
%28 = load i8*, i8** %27
%29 = tail call i64 @getInt(i8* %28)
%30 = icmp sgt i64 %29, %11
br i1 %30, label %31, label %33
31: ; preds = %26
%32 = tail call i32 @error(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
br label %33
33: ; preds = %8, %16, %21, %31, %26
%34 = phi i64 [ %29, %31 ], [ %29, %26 ], [ %11, %21 ], [ %11, %16 ], [ %11, %8 ]
%35 = phi i64 [ %19, %31 ], [ %19, %26 ], [ %19, %21 ], [ %19, %16 ], [ 1, %8 ]
%36 = phi i64 [ %24, %31 ], [ %24, %26 ], [ %24, %21 ], [ 1, %16 ], [ 1, %8 ]
%37 = tail call i8* @sbrk(i32 0)
%38 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.2, i64 0, i64 0), i8* %37)
%39 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @.str.3, i64 0, i64 0), i64 %11, i64 %14)
%40 = icmp sgt i64 %11, 0
br i1 %40, label %41, label %58
41: ; preds = %33, %55
%42 = phi i64 [ %52, %55 ], [ 0, %33 ]
%43 = phi i8* [ %56, %55 ], [ %37, %33 ]
%44 = tail call i8* @malloc(i64 %14)
%45 = getelementptr inbounds [1000000 x i8*], [1000000 x i8*]* %3, i64 0, i64 %42
store i8* %44, i8** %45
%46 = icmp eq i8* %44, null
br i1 %46, label %47, label %49
47: ; preds = %41
%48 = tail call i32 @pexit(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0))
br label %49
49: ; preds = %47, %41
%50 = tail call i8* @sbrk(i32 0)
%51 = icmp eq i8* %50, %43
%52 = add nuw nsw i64 %42, 1
br i1 %51, label %55, label %53
53: ; preds = %49
%54 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.5, i64 0, i64 0), i64 %52, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.6, i64 0, i64 0), i8* %50)
br label %55
55: ; preds = %49, %53
%56 = phi i8* [ %50, %53 ], [ %43, %49 ]
%57 = icmp eq i64 %52, %11
br i1 %57, label %58, label %41
58: ; preds = %55, %33
%59 = tail call i8* @sbrk(i32 0)
%60 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.7, i64 0, i64 0), i8* %59)
%61 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([48 x i8], [48 x i8]* @.str.8, i64 0, i64 0), i64 %36, i64 %34, i64 %35)
%62 = icmp sgt i64 %36, %34
br i1 %62, label %72, label %63
63: ; preds = %58
%64 = add nsw i64 %36, -1
br label %65
65: ; preds = %63, %65
%66 = phi i64 [ %70, %65 ], [ %64, %63 ]
%67 = getelementptr inbounds [1000000 x i8*], [1000000 x i8*]* %3, i64 0, i64 %66
%68 = load i8*, i8** %67
%69 = tail call i32 @free(i8* %68)
%70 = add nsw i64 %66, %35
%71 = icmp slt i64 %70, %34
br i1 %71, label %65, label %72
72: ; preds = %65, %58
%73 = tail call i8* @sbrk(i32 0)
%74 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.9, i64 0, i64 0), i8* %73)
%75 = load i32, i32* @EXIT_SUCCESS
%76 = tail call i32 @exit(i32 %75)
unreachable
}