#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(400000 * sizeof(void *));
  int *dictionary_elem_size = malloc(400000 * sizeof(int));
  int dictionary_ct = 0;
  int data_written = 0;
  for (i = 0; i < 400000; i++) {
    int size = (rand() % (1024 * 100 - 24 + 1)) + 24;
    void *ptr;
    if (realloc_ptr == NULL) {
      ptr = malloc(size);
      data_written = 0;
    } else {
      ptr = realloc(realloc_ptr, size);
      realloc_ptr = NULL;
    }
    if (ptr == NULL) {
      printf("Memory failed to allocate!\n");
      return 1;
    }
    if (rand() % 100 < 95) {
      free(ptr);
    } else {
      if (!data_written) {
        *((void **)ptr) = &dictionary[dictionary_ct];
        data_written = 1;
      }
      if (rand() % 100 < 50)
        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    $0x30d400,%edi
call   1050 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    $0x186a00,%edi
call   1050 <malloc@plt>
mov    %rax,-0x20(%rbp)
movl   $0x0,-0x24(%rbp)
movl   $0x0,-0x28(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x61a80,-0x8(%rbp)
jge    12ef <main+0x19f>
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    11e7 <main+0x97>
mov    -0x2c(%rbp),%edi
call   1050 <malloc@plt>
mov    %rax,-0x38(%rbp)
movl   $0x0,-0x28(%rbp)
jmp    11ff <main+0xaf>
mov    -0x10(%rbp),%rdi
mov    -0x2c(%rbp),%esi
call   1060 <realloc@plt>
mov    %rax,-0x38(%rbp)
movq   $0x0,-0x10(%rbp)
cmpq   $0x0,-0x38(%rbp)
jne    1222 <main+0xd2>
lea    0xdef(%rip),%rdi
call   1040 <printf@plt>
movl   $0x1,-0x4(%rbp)
jmp    13c0 <main+0x270>
mov    $0x0,%al
call   1070 <rand@plt>
mov    $0x64,%ecx
cltd
idiv   %ecx
cmp    $0x5f,%edx
jge    1248 <main+0xf8>
mov    -0x38(%rbp),%rdi
call   1030 <free@plt>
jmp    12dc <main+0x18c>
cmpl   $0x0,-0x28(%rbp)
jne    126f <main+0x11f>
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    $0x32,%edx
jge    1294 <main+0x144>
mov    -0x38(%rbp),%rax
mov    %rax,-0x10(%rbp)
jmp    12d7 <main+0x187>
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    12dc <main+0x18c>
jmp    12e1 <main+0x191>
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     13ad <main+0x25d>
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     1341 <main+0x1f1>
lea    0xcec(%rip),%rdi
call   1040 <printf@plt>
movl   $0x64,-0x4(%rbp)
jmp    13c0 <main+0x270>
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     138e <main+0x23e>
lea    0xcf5(%rip),%rdi
call   1040 <printf@plt>
movl   $0x65,-0x4(%rbp)
jmp    13c0 <main+0x270>
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    12f8 <main+0x1a8>
lea    0xd0e(%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    $0x30d400,%edi
call   1050 <malloc@plt>
mov    %rax,%r12
mov    $0x186a00,%edi
call   1050 <malloc@plt>
mov    %rax,(%rsp)
mov    $0x61a80,%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    $0x5e,%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    $0x32,%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 3200000)
%12 = bitcast i8* %11 to i8**
store i8** %12, i8*** %4
%13 = call i8* @malloc(i32 1600000)
%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 = %86, %0
%16 = load i32, i32* %2
%17 = icmp slt i32 %16, 400000
br i1 %17, label %18, label %89
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 %27
24: ; preds = %18
%25 = load i32, i32* %8
%26 = call i8* @malloc(i32 %25)
store i8* %26, i8** %9
store i32 0, i32* %7
br label %31
27: ; preds = %18
%28 = load i8*, i8** %3
%29 = load i32, i32* %8
%30 = call i8* @realloc(i8* %28, i32 %29)
store i8* %30, i8** %9
store i8* null, i8** %3
br label %31
31: ; preds = %27, %24
%32 = load i8*, i8** %9
%33 = icmp eq i8* %32, null
br i1 %33, label %34, label %36
34: ; preds = %31
%35 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
store i32 1, i32* %1
br label %147
36: ; preds = %31
%37 = call i32 (...) @rand()
%38 = srem i32 %37, 100
%39 = icmp slt i32 %38, 95
br i1 %39, label %40, label %43
40: ; preds = %36
%41 = load i8*, i8** %9
%42 = call i32 @free(i8* %41)
br label %85
43: ; preds = %36
%44 = load i32, i32* %7
%45 = icmp ne i32 %44, 0
br i1 %45, label %54, label %46
46: ; preds = %43
%47 = load i8**, i8*** %4
%48 = load i32, i32* %6
%49 = sext i32 %48 to i64
%50 = getelementptr inbounds i8*, i8** %47, i64 %49
%51 = bitcast i8** %50 to i8*
%52 = load i8*, i8** %9
%53 = bitcast i8* %52 to i8**
store i8* %51, i8** %53
store i32 1, i32* %7
br label %54
54: ; preds = %46, %43
%55 = call i32 (...) @rand()
%56 = srem i32 %55, 100
%57 = icmp slt i32 %56, 50
br i1 %57, label %58, label %60
58: ; preds = %54
%59 = load i8*, i8** %9
store i8* %59, i8** %3
br label %84
60: ; preds = %54
%61 = load i8**, i8*** %4
%62 = load i32, i32* %6
%63 = sext i32 %62 to i64
%64 = getelementptr inbounds i8*, i8** %61, i64 %63
%65 = bitcast i8** %64 to i8*
%66 = load i8*, i8** %9
%67 = load i32, i32* %8
%68 = sext i32 %67 to i64
%69 = getelementptr i8, i8* %66, i64 %68
%70 = getelementptr i8, i8* %69, i64 -8
%71 = bitcast i8* %70 to i8**
store i8* %65, i8** %71
%72 = load i8*, i8** %9
%73 = load i8**, i8*** %4
%74 = load i32, i32* %6
%75 = sext i32 %74 to i64
%76 = getelementptr inbounds i8*, i8** %73, i64 %75
store i8* %72, i8** %76
%77 = load i32, i32* %8
%78 = load i32*, i32** %5
%79 = load i32, i32* %6
%80 = sext i32 %79 to i64
%81 = getelementptr inbounds i32, i32* %78, i64 %80
store i32 %77, i32* %81
%82 = load i32, i32* %6
%83 = add nsw i32 %82, 1
store i32 %83, i32* %6
br label %84
84: ; preds = %60, %58
br label %85
85: ; preds = %84, %40
br label %86
86: ; preds = %85
%87 = load i32, i32* %2
%88 = add nsw i32 %87, 1
store i32 %88, i32* %2
br label %15
89: ; preds = %15
%90 = load i32, i32* %6
%91 = sub nsw i32 %90, 1
store i32 %91, i32* %2
br label %92
92: ; preds = %142, %89
%93 = load i32, i32* %2
%94 = icmp sge i32 %93, 0
br i1 %94, label %95, label %145
95: ; preds = %92
%96 = load i8**, i8*** %4
%97 = load i32, i32* %2
%98 = sext i32 %97 to i64
%99 = getelementptr inbounds i8*, i8** %96, i64 %98
%100 = load i8*, i8** %99
%101 = bitcast i8* %100 to i8**
%102 = load i8*, i8** %101
%103 = load i8**, i8*** %4
%104 = load i32, i32* %2
%105 = sext i32 %104 to i64
%106 = getelementptr inbounds i8*, i8** %103, i64 %105
%107 = bitcast i8** %106 to i8*
%108 = icmp ne i8* %102, %107
br i1 %108, label %109, label %111
109: ; preds = %95
%110 = 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 %147
111: ; preds = %95
%112 = load i8**, i8*** %4
%113 = load i32, i32* %2
%114 = sext i32 %113 to i64
%115 = getelementptr inbounds i8*, i8** %112, i64 %114
%116 = load i8*, i8** %115
%117 = load i32*, i32** %5
%118 = load i32, i32* %2
%119 = sext i32 %118 to i64
%120 = getelementptr inbounds i32, i32* %117, i64 %119
%121 = load i32, i32* %120
%122 = sext i32 %121 to i64
%123 = getelementptr i8, i8* %116, i64 %122
%124 = getelementptr i8, i8* %123, i64 -8
%125 = bitcast i8* %124 to i8**
%126 = load i8*, i8** %125
%127 = load i8**, i8*** %4
%128 = load i32, i32* %2
%129 = sext i32 %128 to i64
%130 = getelementptr inbounds i8*, i8** %127, i64 %129
%131 = bitcast i8** %130 to i8*
%132 = icmp ne i8* %126, %131
br i1 %132, label %133, label %135
133: ; preds = %111
%134 = 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 %147
135: ; preds = %111
%136 = load i8**, i8*** %4
%137 = load i32, i32* %2
%138 = sext i32 %137 to i64
%139 = getelementptr inbounds i8*, i8** %136, i64 %138
%140 = load i8*, i8** %139
%141 = call i32 @free(i8* %140)
br label %142
142: ; preds = %135
%143 = load i32, i32* %2
%144 = add nsw i32 %143, -1
store i32 %144, i32* %2
br label %92
145: ; preds = %92
%146 = 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 %147
147: ; preds = %145, %133, %109, %34
%148 = load i32, i32* %1
ret i32 %148
}

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(3200000) i8* @malloc(i32 3200000)
%2 = bitcast i8* %1 to i8**
%3 = tail call dereferenceable_or_null(1600000) i8* @malloc(i32 1600000)
%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, 95
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, 50
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, 400000
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
}