#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*/ free(void *);
void *malloc(int);
int /*<<< orphan*/ printf(char *);
int rand();
void *realloc(void *, int);
int main() {
  malloc(1);
  int i;
  void *realloc_ptr = NULL;
  void **dictionary = malloc(90000 * sizeof(void *));
  int *dictionary_elem_size = malloc(90000 * sizeof(int));
  int dictionary_ct = 0;
  int data_written = 0;
  for (i = 0; i < 90000; i++) {
    int size = (rand() % (1024 * 100 - 24 + 1)) + 24;
    void *ptr;
    if (realloc_ptr == NULL) {
      ptr = malloc(size);
      malloc(1);
      data_written = 0;
    } else {
      ptr = realloc(realloc_ptr, size);
      malloc(1);
      realloc_ptr = NULL;
    }
    if (ptr == NULL) {
      printf("Memory failed to allocate!\n");
      return 1;
    }
    if (rand() % 100 < 30)
      free(ptr);
    else {
      if (!data_written) {
        *((void **)ptr) = &dictionary[dictionary_ct];
        data_written = 1;
      }
      if (rand() % 100 < 80)
        realloc_ptr = ptr;
      else {
        *((void **)(ptr + size - sizeof(void *))) = &dictionary[dictionary_ct];
        dictionary[dictionary_ct] = ptr;
        dictionary_elem_size[dictionary_ct] = size;
        dictionary_ct++;
      }
    }
  }
  for (i = dictionary_ct - 1; i >= 0; i--) {
    if (*((void **)dictionary[i]) != &dictionary[i]) {
      printf("Memory failed to contain correct data after many allocations "
             "(beginning of segment)!\n");
      return 100;
    }
    if (*((void **)(dictionary[i] + dictionary_elem_size[i] -
                    sizeof(void *))) != &dictionary[i]) {
      printf("Memory failed to contain correct data after many allocations "
             "(end of segment)!\n");
      return 101;
    }
    free(dictionary[i]);
  }
  printf("Memory was allocated and freed!\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x1,%edi
call   1050 <malloc@plt>
movq   $0x0,-0x10(%rbp)
mov    $0xafc80,%edi
call   1050 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    $0x57e40,%edi
call   1050 <malloc@plt>
mov    %rax,-0x20(%rbp)
movl   $0x0,-0x24(%rbp)
movl   $0x0,-0x28(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x15f90,-0x8(%rbp)
jge    1303 <main+0x1b3>
mov    $0x0,%al
call   1070 <rand@plt>
mov    $0x18fe9,%ecx
cltd
idiv   %ecx
add    $0x18,%edx
mov    %edx,-0x2c(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    11f1 <main+0xa1>
mov    -0x2c(%rbp),%edi
call   1050 <malloc@plt>
mov    %rax,-0x38(%rbp)
mov    $0x1,%edi
call   1050 <malloc@plt>
movl   $0x0,-0x28(%rbp)
jmp    1213 <main+0xc3>
mov    -0x10(%rbp),%rdi
mov    -0x2c(%rbp),%esi
call   1060 <realloc@plt>
mov    %rax,-0x38(%rbp)
mov    $0x1,%edi
call   1050 <malloc@plt>
movq   $0x0,-0x10(%rbp)
cmpq   $0x0,-0x38(%rbp)
jne    1236 <main+0xe6>
lea    0xddb(%rip),%rdi
call   1040 <printf@plt>
movl   $0x1,-0x4(%rbp)
jmp    13d4 <main+0x284>
mov    $0x0,%al
call   1070 <rand@plt>
mov    $0x64,%ecx
cltd
idiv   %ecx
cmp    $0x1e,%edx
jge    125c <main+0x10c>
mov    -0x38(%rbp),%rdi
call   1030 <free@plt>
jmp    12f0 <main+0x1a0>
cmpl   $0x0,-0x28(%rbp)
jne    1283 <main+0x133>
mov    -0x18(%rbp),%rcx
movslq -0x24(%rbp),%rax
shl    $0x3,%rax
add    %rax,%rcx
mov    -0x38(%rbp),%rax
mov    %rcx,(%rax)
movl   $0x1,-0x28(%rbp)
mov    $0x0,%al
call   1070 <rand@plt>
mov    $0x64,%ecx
cltd
idiv   %ecx
cmp    $0x50,%edx
jge    12a8 <main+0x158>
mov    -0x38(%rbp),%rax
mov    %rax,-0x10(%rbp)
jmp    12eb <main+0x19b>
mov    -0x18(%rbp),%rdx
movslq -0x24(%rbp),%rax
shl    $0x3,%rax
add    %rax,%rdx
mov    -0x38(%rbp),%rax
movslq -0x2c(%rbp),%rcx
mov    %rdx,-0x8(%rax,%rcx,1)
mov    -0x38(%rbp),%rdx
mov    -0x18(%rbp),%rax
movslq -0x24(%rbp),%rcx
mov    %rdx,(%rax,%rcx,8)
mov    -0x2c(%rbp),%edx
mov    -0x20(%rbp),%rax
movslq -0x24(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    12f0 <main+0x1a0>
jmp    12f5 <main+0x1a5>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    11a2 <main+0x52>
mov    -0x24(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jl     13c1 <main+0x271>
mov    -0x18(%rbp),%rax
movslq -0x8(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
mov    (%rax),%rax
mov    -0x18(%rbp),%rcx
movslq -0x8(%rbp),%rdx
shl    $0x3,%rdx
add    %rdx,%rcx
cmp    %rcx,%rax
je     1355 <main+0x205>
lea    0xcd8(%rip),%rdi
call   1040 <printf@plt>
movl   $0x64,-0x4(%rbp)
jmp    13d4 <main+0x284>
mov    -0x18(%rbp),%rax
movslq -0x8(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
mov    -0x20(%rbp),%rcx
movslq -0x8(%rbp),%rdx
movslq (%rcx,%rdx,4),%rcx
mov    -0x8(%rax,%rcx,1),%rax
mov    -0x18(%rbp),%rcx
movslq -0x8(%rbp),%rdx
shl    $0x3,%rdx
add    %rdx,%rcx
cmp    %rcx,%rax
je     13a2 <main+0x252>
lea    0xce1(%rip),%rdi
call   1040 <printf@plt>
movl   $0x65,-0x4(%rbp)
jmp    13d4 <main+0x284>
mov    -0x18(%rbp),%rax
movslq -0x8(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <free@plt>
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
jmp    130c <main+0x1bc>
lea    0xcfa(%rip),%rdi
call   1040 <printf@plt>
movl   $0x0,-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
push   %rax
mov    $0xafc80,%edi
call   1050 <malloc@plt>
mov    %rax,%r12
mov    $0x57e40,%edi
call   1050 <malloc@plt>
mov    %rax,(%rsp)
mov    $0x15f90,%r14d
xor    %r15d,%r15d
xor    %ebp,%ebp
xor    %r13d,%r13d
jmp    11a5 <main+0x55>
cs nopw 0x0(%rax,%rax,1)
mov    %r13,%rdi
call   1030 <free@plt>
xor    %r13d,%r13d
add    $0xffffffff,%r14d
je     12a0 <main+0x150>
xor    %eax,%eax
call   1070 <rand@plt>
cltq
imul   $0x51f03b41,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x2f,%rcx
add    %edx,%ecx
imul   $0x18fe9,%ecx,%ecx
sub    %ecx,%eax
movslq %eax,%rbx
add    $0x18,%rbx
test   %r13,%r13
je     11f0 <main+0xa0>
mov    %r13,%rdi
mov    %ebx,%esi
call   1060 <realloc@plt>
mov    %rax,%r13
test   %r13,%r13
jne    1206 <main+0xb6>
jmp    1291 <main+0x141>
nopl   (%rax)
mov    %ebx,%edi
call   1050 <malloc@plt>
mov    %rax,%r13
xor    %r15d,%r15d
test   %r13,%r13
je     1291 <main+0x141>
xor    %eax,%eax
call   1070 <rand@plt>
cltq
imul   $0x51eb851f,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x25,%rcx
add    %edx,%ecx
imul   $0x64,%ecx,%ecx
sub    %ecx,%eax
cmp    $0x1d,%eax
jle    1190 <main+0x40>
test   %r15d,%r15d
jne    1241 <main+0xf1>
movslq %ebp,%rax
lea    (%r12,%rax,8),%rax
mov    %rax,0x0(%r13)
xor    %eax,%eax
call   1070 <rand@plt>
cltq
imul   $0x51eb851f,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x25,%rcx
add    %edx,%ecx
imul   $0x64,%ecx,%ecx
sub    %ecx,%eax
mov    $0x1,%r15d
cmp    $0x50,%eax
jl     119b <main+0x4b>
movslq %ebp,%rax
lea    (%r12,%rax,8),%rcx
mov    %rcx,-0x8(%r13,%rbx,1)
mov    %r13,(%r12,%rax,8)
mov    (%rsp),%rcx
mov    %ebx,(%rcx,%rax,4)
add    $0x1,%ebp
jmp    1198 <main+0x48>
mov    $0x1,%r13d
lea    0xe26(%rip),%rbx
jmp    1317 <main+0x1c7>
xor    %r13d,%r13d
lea    0xd56(%rip),%r14
test   %ebp,%ebp
jle    1301 <main+0x1b1>
mov    %ebp,%ebp
add    $0x1,%rbp
lea    0xdb4(%rip),%rbx
lea    0xd5e(%rip),%r15
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
lea    -0x2(%rbp),%eax
lea    (%r12,%rax,8),%rdx
mov    (%r12,%rax,8),%rdi
mov    (%rdi),%rcx
cmp    %rdx,%rcx
jne    1306 <main+0x1b6>
mov    (%rsp),%rdx
movslq (%rdx,%rax,4),%rax
cmp    %rcx,-0x8(%rdi,%rax,1)
jne    130e <main+0x1be>
call   1030 <free@plt>
add    $0xffffffffffffffff,%rbp
cmp    $0x1,%rbp
ja     12d0 <main+0x180>
mov    %r14,%rbx
jmp    1317 <main+0x1c7>
mov    $0x64,%r13d
jmp    1317 <main+0x1c7>
mov    $0x65,%r13d
mov    %r15,%rbx
mov    %rbx,%rdi
call   1040 <puts@plt>
mov    %r13d,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [28 x i8] c"Memory failed to allocate!\0A\00"
@.str.1 = [86 x i8] c"Memory failed to contain correct data after many allocations (beginning of segment)!\0A\00"
@.str.2 = [80 x i8] c"Memory failed to contain correct data after many allocations (end of segment)!\0A\00"
@.str.3 = [33 x i8] c"Memory was allocated and freed!\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i8**
%5 = alloca i32*
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i8*
store i32 0, i32* %1
%10 = call i8* @malloc(i32 1)
store i8* null, i8** %3
%11 = call i8* @malloc(i32 720000)
%12 = bitcast i8* %11 to i8**
store i8** %12, i8*** %4
%13 = call i8* @malloc(i32 360000)
%14 = bitcast i8* %13 to i32*
store i32* %14, i32** %5
store i32 0, i32* %6
store i32 0, i32* %7
store i32 0, i32* %2
br label %15
15: ; preds = %88, %0
%16 = load i32, i32* %2
%17 = icmp slt i32 %16, 90000
br i1 %17, label %18, label %91
18: ; preds = %15
%19 = call i32 (...) @rand()
%20 = srem i32 %19, 102377
%21 = add nsw i32 %20, 24
store i32 %21, i32* %8
%22 = load i8*, i8** %3
%23 = icmp eq i8* %22, null
br i1 %23, label %24, label %28
24: ; preds = %18
%25 = load i32, i32* %8
%26 = call i8* @malloc(i32 %25)
store i8* %26, i8** %9
%27 = call i8* @malloc(i32 1)
store i32 0, i32* %7
br label %33
28: ; preds = %18
%29 = load i8*, i8** %3
%30 = load i32, i32* %8
%31 = call i8* @realloc(i8* %29, i32 %30)
store i8* %31, i8** %9
%32 = call i8* @malloc(i32 1)
store i8* null, i8** %3
br label %33
33: ; preds = %28, %24
%34 = load i8*, i8** %9
%35 = icmp eq i8* %34, null
br i1 %35, label %36, label %38
36: ; preds = %33
%37 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
store i32 1, i32* %1
br label %149
38: ; preds = %33
%39 = call i32 (...) @rand()
%40 = srem i32 %39, 100
%41 = icmp slt i32 %40, 30
br i1 %41, label %42, label %45
42: ; preds = %38
%43 = load i8*, i8** %9
%44 = call i32 @free(i8* %43)
br label %87
45: ; preds = %38
%46 = load i32, i32* %7
%47 = icmp ne i32 %46, 0
br i1 %47, label %56, label %48
48: ; preds = %45
%49 = load i8**, i8*** %4
%50 = load i32, i32* %6
%51 = sext i32 %50 to i64
%52 = getelementptr inbounds i8*, i8** %49, i64 %51
%53 = bitcast i8** %52 to i8*
%54 = load i8*, i8** %9
%55 = bitcast i8* %54 to i8**
store i8* %53, i8** %55
store i32 1, i32* %7
br label %56
56: ; preds = %48, %45
%57 = call i32 (...) @rand()
%58 = srem i32 %57, 100
%59 = icmp slt i32 %58, 80
br i1 %59, label %60, label %62
60: ; preds = %56
%61 = load i8*, i8** %9
store i8* %61, i8** %3
br label %86
62: ; preds = %56
%63 = load i8**, i8*** %4
%64 = load i32, i32* %6
%65 = sext i32 %64 to i64
%66 = getelementptr inbounds i8*, i8** %63, i64 %65
%67 = bitcast i8** %66 to i8*
%68 = load i8*, i8** %9
%69 = load i32, i32* %8
%70 = sext i32 %69 to i64
%71 = getelementptr i8, i8* %68, i64 %70
%72 = getelementptr i8, i8* %71, i64 -8
%73 = bitcast i8* %72 to i8**
store i8* %67, i8** %73
%74 = load i8*, i8** %9
%75 = load i8**, i8*** %4
%76 = load i32, i32* %6
%77 = sext i32 %76 to i64
%78 = getelementptr inbounds i8*, i8** %75, i64 %77
store i8* %74, i8** %78
%79 = load i32, i32* %8
%80 = load i32*, i32** %5
%81 = load i32, i32* %6
%82 = sext i32 %81 to i64
%83 = getelementptr inbounds i32, i32* %80, i64 %82
store i32 %79, i32* %83
%84 = load i32, i32* %6
%85 = add nsw i32 %84, 1
store i32 %85, i32* %6
br label %86
86: ; preds = %62, %60
br label %87
87: ; preds = %86, %42
br label %88
88: ; preds = %87
%89 = load i32, i32* %2
%90 = add nsw i32 %89, 1
store i32 %90, i32* %2
br label %15
91: ; preds = %15
%92 = load i32, i32* %6
%93 = sub nsw i32 %92, 1
store i32 %93, i32* %2
br label %94
94: ; preds = %144, %91
%95 = load i32, i32* %2
%96 = icmp sge i32 %95, 0
br i1 %96, label %97, label %147
97: ; preds = %94
%98 = load i8**, i8*** %4
%99 = load i32, i32* %2
%100 = sext i32 %99 to i64
%101 = getelementptr inbounds i8*, i8** %98, i64 %100
%102 = load i8*, i8** %101
%103 = bitcast i8* %102 to i8**
%104 = load i8*, i8** %103
%105 = load i8**, i8*** %4
%106 = load i32, i32* %2
%107 = sext i32 %106 to i64
%108 = getelementptr inbounds i8*, i8** %105, i64 %107
%109 = bitcast i8** %108 to i8*
%110 = icmp ne i8* %104, %109
br i1 %110, label %111, label %113
111: ; preds = %97
%112 = call i32 @printf(i8* getelementptr inbounds ([86 x i8], [86 x i8]* @.str.1, i64 0, i64 0))
store i32 100, i32* %1
br label %149
113: ; preds = %97
%114 = load i8**, i8*** %4
%115 = load i32, i32* %2
%116 = sext i32 %115 to i64
%117 = getelementptr inbounds i8*, i8** %114, i64 %116
%118 = load i8*, i8** %117
%119 = load i32*, i32** %5
%120 = load i32, i32* %2
%121 = sext i32 %120 to i64
%122 = getelementptr inbounds i32, i32* %119, i64 %121
%123 = load i32, i32* %122
%124 = sext i32 %123 to i64
%125 = getelementptr i8, i8* %118, i64 %124
%126 = getelementptr i8, i8* %125, i64 -8
%127 = bitcast i8* %126 to i8**
%128 = load i8*, i8** %127
%129 = load i8**, i8*** %4
%130 = load i32, i32* %2
%131 = sext i32 %130 to i64
%132 = getelementptr inbounds i8*, i8** %129, i64 %131
%133 = bitcast i8** %132 to i8*
%134 = icmp ne i8* %128, %133
br i1 %134, label %135, label %137
135: ; preds = %113
%136 = call i32 @printf(i8* getelementptr inbounds ([80 x i8], [80 x i8]* @.str.2, i64 0, i64 0))
store i32 101, i32* %1
br label %149
137: ; preds = %113
%138 = load i8**, i8*** %4
%139 = load i32, i32* %2
%140 = sext i32 %139 to i64
%141 = getelementptr inbounds i8*, i8** %138, i64 %140
%142 = load i8*, i8** %141
%143 = call i32 @free(i8* %142)
br label %144
144: ; preds = %137
%145 = load i32, i32* %2
%146 = add nsw i32 %145, -1
store i32 %146, i32* %2
br label %94
147: ; preds = %94
%148 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.3, i64 0, i64 0))
store i32 0, i32* %1
br label %149
149: ; preds = %147, %135, %111, %36
%150 = load i32, i32* %1
ret i32 %150
}

LLVM IR (-O2):
@str = [32 x i8] c"Memory was allocated and freed!\00"
@str.4 = [79 x i8] c"Memory failed to contain correct data after many allocations (end of segment)!\00"
@str.5 = [85 x i8] c"Memory failed to contain correct data after many allocations (beginning of segment)!\00"
@str.6 = [27 x i8] c"Memory failed to allocate!\00"
define i32 @main() {
%1 = tail call dereferenceable_or_null(720000) i8* @malloc(i32 720000)
%2 = bitcast i8* %1 to i8**
%3 = tail call dereferenceable_or_null(360000) i8* @malloc(i32 360000)
%4 = bitcast i8* %3 to i32*
br label %9
5: ; preds = %51
%6 = icmp sgt i32 %53, 0
br i1 %6, label %7, label %79
7: ; preds = %5
%8 = zext i32 %53 to i64
br label %57
9: ; preds = %0, %51
%10 = phi i32 [ 0, %0 ], [ %54, %51 ]
%11 = phi i32 [ 0, %0 ], [ %53, %51 ]
%12 = phi i32 [ 0, %0 ], [ %55, %51 ]
%13 = phi i8* [ null, %0 ], [ %52, %51 ]
%14 = tail call i32 (...) @rand()
%15 = srem i32 %14, 102377
%16 = add nsw i32 %15, 24
%17 = icmp eq i8* %13, null
br i1 %17, label %18, label %20
18: ; preds = %9
%19 = tail call i8* @malloc(i32 %16)
br label %22
20: ; preds = %9
%21 = tail call i8* @realloc(i8* %13, i32 %16)
br label %22
22: ; preds = %20, %18
%23 = phi i32 [ 0, %18 ], [ %10, %20 ]
%24 = phi i8* [ %19, %18 ], [ %21, %20 ]
%25 = icmp eq i8* %24, null
br i1 %25, label %79, label %26
26: ; preds = %22
%27 = tail call i32 (...) @rand()
%28 = srem i32 %27, 100
%29 = icmp slt i32 %28, 30
br i1 %29, label %30, label %32
30: ; preds = %26
%31 = tail call i32 @free(i8* %24)
br label %51
32: ; preds = %26
%33 = icmp eq i32 %23, 0
br i1 %33, label %34, label %38
34: ; preds = %32
%35 = sext i32 %11 to i64
%36 = getelementptr inbounds i8*, i8** %2, i64 %35
%37 = bitcast i8* %24 to i8***
store i8** %36, i8*** %37
br label %38
38: ; preds = %34, %32
%39 = tail call i32 (...) @rand()
%40 = srem i32 %39, 100
%41 = icmp slt i32 %40, 80
br i1 %41, label %51, label %42
42: ; preds = %38
%43 = sext i32 %11 to i64
%44 = getelementptr inbounds i8*, i8** %2, i64 %43
%45 = sext i32 %16 to i64
%46 = getelementptr i8, i8* %24, i64 -8
%47 = getelementptr i8, i8* %46, i64 %45
%48 = bitcast i8* %47 to i8***
store i8** %44, i8*** %48
store i8* %24, i8** %44
%49 = getelementptr inbounds i32, i32* %4, i64 %43
store i32 %16, i32* %49
%50 = add nsw i32 %11, 1
br label %51
51: ; preds = %30, %42, %38
%52 = phi i8* [ %24, %38 ], [ null, %42 ], [ null, %30 ]
%53 = phi i32 [ %11, %38 ], [ %50, %42 ], [ %11, %30 ]
%54 = phi i32 [ 1, %38 ], [ 1, %42 ], [ %23, %30 ]
%55 = add nuw nsw i32 %12, 1
%56 = icmp eq i32 %55, 90000
br i1 %56, label %5, label %9
57: ; preds = %7, %76
%58 = phi i64 [ %8, %7 ], [ %59, %76 ]
%59 = add nsw i64 %58, -1
%60 = and i64 %59, 4294967295
%61 = getelementptr inbounds i8*, i8** %2, i64 %60
%62 = load i8*, i8** %61
%63 = bitcast i8* %62 to i8**
%64 = load i8*, i8** %63
%65 = bitcast i8** %61 to i8*
%66 = icmp eq i8* %64, %65
br i1 %66, label %67, label %79
67: ; preds = %57
%68 = getelementptr inbounds i32, i32* %4, i64 %60
%69 = load i32, i32* %68
%70 = sext i32 %69 to i64
%71 = getelementptr i8, i8* %62, i64 -8
%72 = getelementptr i8, i8* %71, i64 %70
%73 = bitcast i8* %72 to i8**
%74 = load i8*, i8** %73
%75 = icmp eq i8* %74, %64
br i1 %75, label %76, label %79
76: ; preds = %67
%77 = tail call i32 @free(i8* %62)
%78 = icmp ugt i64 %58, 1
br i1 %78, label %57, label %79
79: ; preds = %22, %76, %67, %57, %5
%80 = phi i8* [ getelementptr inbounds ([32 x i8], [32 x i8]* @str, i64 0, i64 0), %5 ], [ getelementptr inbounds ([85 x i8], [85 x i8]* @str.5, i64 0, i64 0), %57 ], [ getelementptr inbounds ([79 x i8], [79 x i8]* @str.4, i64 0, i64 0), %67 ], [ getelementptr inbounds ([32 x i8], [32 x i8]* @str, i64 0, i64 0), %76 ], [ getelementptr inbounds ([27 x i8], [27 x i8]* @str.6, i64 0, i64 0), %22 ]
%81 = phi i32 [ 0, %5 ], [ 100, %57 ], [ 101, %67 ], [ 0, %76 ], [ 1, %22 ]
%82 = tail call i32 @puts(i8* dereferenceable(1) %80)
ret i32 %81
}