#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 */
scalar_t__ malloc(int);
int /*<<< orphan*/ memcpy(int *, int const *, int);
int *realloc(int *, int);
void aggregate_cluster_statistics(int cluster_sizes_total_count_to_merge,
                                  const int *cluster_sizes_to_merge,
                                  const int *cluster_sizes_counts_to_merge,
                                  const int *cluster_sizes_percolated_to_merge,
                                  int *cluster_sizes_total_count,
                                  int **cluster_sizes,
                                  int **cluster_sizes_counts,
                                  int **cluster_sizes_percolated) {
  int i;
  int j;
  int tmp_size;
  char shared;
  if (cluster_sizes_total_count_to_merge == 0 ||
      cluster_sizes_to_merge == NULL) {
    return;
  }
  if (*cluster_sizes_total_count == 0 || *cluster_sizes == NULL) {
    *cluster_sizes_total_count = cluster_sizes_total_count_to_merge;
    *cluster_sizes = (int *)malloc((*cluster_sizes_total_count) * sizeof(int));
    *cluster_sizes_counts =
        (int *)malloc((*cluster_sizes_total_count) * sizeof(int));
    *cluster_sizes_percolated =
        (int *)malloc((*cluster_sizes_total_count) * sizeof(int));
    memcpy(*cluster_sizes, cluster_sizes_to_merge,
           (*cluster_sizes_total_count) * sizeof(int));
    memcpy(*cluster_sizes_counts, cluster_sizes_counts_to_merge,
           (*cluster_sizes_total_count) * sizeof(int));
    memcpy(*cluster_sizes_percolated, cluster_sizes_percolated_to_merge,
           (*cluster_sizes_total_count) * sizeof(int));
    return;
  }
  tmp_size = (*cluster_sizes_total_count) + cluster_sizes_total_count_to_merge;
  *cluster_sizes = realloc(*cluster_sizes, tmp_size * sizeof(int));
  *cluster_sizes_counts =
      realloc(*cluster_sizes_counts, tmp_size * sizeof(int));
  *cluster_sizes_percolated =
      realloc(*cluster_sizes_percolated, tmp_size * sizeof(int));
  for (i = 0; i < cluster_sizes_total_count_to_merge; i++) {
    shared = 0;
    for (j = 0; j < *cluster_sizes_total_count; j++) {
      if (cluster_sizes_to_merge[i] == (*cluster_sizes)[j]) {
        shared = 1;
        (*cluster_sizes_counts)[j] += cluster_sizes_counts_to_merge[i];
        (*cluster_sizes_percolated)[j] += cluster_sizes_percolated_to_merge[i];
        break;
      }
    }
    if (!shared) {
      (*cluster_sizes)[*cluster_sizes_total_count] = cluster_sizes_to_merge[i];
      (*cluster_sizes_counts)[*cluster_sizes_total_count] =
          cluster_sizes_counts_to_merge[i];
      (*cluster_sizes_percolated)[*cluster_sizes_total_count] =
          cluster_sizes_percolated_to_merge[i];
      (*cluster_sizes_total_count) += 1;
    }
  }
  *cluster_sizes =
      realloc(*cluster_sizes, (*cluster_sizes_total_count) * sizeof(int));
  *cluster_sizes_counts = realloc(*cluster_sizes_counts,
                                  (*cluster_sizes_total_count) * sizeof(int));
  *cluster_sizes_percolated = realloc(
      *cluster_sizes_percolated, (*cluster_sizes_total_count) * sizeof(int));
}


x86 assembly (clang, -O0):
<aggregate_cluster_statistics>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    0x18(%rbp),%rax
mov    0x10(%rbp),%rax
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     116c <aggregate_cluster_statistics+0x3c>
cmpq   $0x0,-0x10(%rbp)
jne    1171 <aggregate_cluster_statistics+0x41>
jmp    1436 <aggregate_cluster_statistics+0x306>
mov    -0x28(%rbp),%rax
cmpl   $0x0,(%rax)
je     118c <aggregate_cluster_statistics+0x5c>
mov    -0x30(%rbp),%rax
cmpq   $0x0,(%rax)
jne    1245 <aggregate_cluster_statistics+0x115>
mov    -0x4(%rbp),%ecx
mov    -0x28(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x28(%rbp),%rax
movslq (%rax),%rax
shl    $0x2,%rax
mov    %eax,%edi
call   1040 <malloc@plt>
mov    %rax,%rcx
mov    -0x30(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x28(%rbp),%rax
movslq (%rax),%rax
shl    $0x2,%rax
mov    %eax,%edi
call   1040 <malloc@plt>
mov    %rax,%rcx
mov    0x10(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x28(%rbp),%rax
movslq (%rax),%rax
shl    $0x2,%rax
mov    %eax,%edi
call   1040 <malloc@plt>
mov    %rax,%rcx
mov    0x18(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x30(%rbp),%rax
mov    (%rax),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x28(%rbp),%rax
movslq (%rax),%rax
shl    $0x2,%rax
mov    %eax,%edx
call   1030 <memcpy@plt>
mov    0x10(%rbp),%rax
mov    (%rax),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x28(%rbp),%rax
movslq (%rax),%rax
shl    $0x2,%rax
mov    %eax,%edx
call   1030 <memcpy@plt>
mov    0x18(%rbp),%rax
mov    (%rax),%rdi
mov    -0x20(%rbp),%rsi
mov    -0x28(%rbp),%rax
movslq (%rax),%rax
shl    $0x2,%rax
mov    %eax,%edx
call   1030 <memcpy@plt>
jmp    1436 <aggregate_cluster_statistics+0x306>
mov    -0x28(%rbp),%rax
mov    (%rax),%eax
add    -0x4(%rbp),%eax
mov    %eax,-0x3c(%rbp)
mov    -0x30(%rbp),%rax
mov    (%rax),%rdi
movslq -0x3c(%rbp),%rax
shl    $0x2,%rax
mov    %eax,%esi
call   1050 <realloc@plt>
mov    %rax,%rcx
mov    -0x30(%rbp),%rax
mov    %rcx,(%rax)
mov    0x10(%rbp),%rax
mov    (%rax),%rdi
movslq -0x3c(%rbp),%rax
shl    $0x2,%rax
mov    %eax,%esi
call   1050 <realloc@plt>
mov    %rax,%rcx
mov    0x10(%rbp),%rax
mov    %rcx,(%rax)
mov    0x18(%rbp),%rax
mov    (%rax),%rdi
movslq -0x3c(%rbp),%rax
shl    $0x2,%rax
mov    %eax,%esi
call   1050 <realloc@plt>
mov    %rax,%rcx
mov    0x18(%rbp),%rax
mov    %rcx,(%rax)
movl   $0x0,-0x34(%rbp)
mov    -0x34(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    13cd <aggregate_cluster_statistics+0x29d>
movb   $0x0,-0x3d(%rbp)
movl   $0x0,-0x38(%rbp)
mov    -0x38(%rbp),%eax
mov    -0x28(%rbp),%rcx
cmp    (%rcx),%eax
jge    1351 <aggregate_cluster_statistics+0x221>
mov    -0x10(%rbp),%rax
movslq -0x34(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    -0x30(%rbp),%rcx
mov    (%rcx),%rcx
movslq -0x38(%rbp),%rdx
cmp    (%rcx,%rdx,4),%eax
jne    133e <aggregate_cluster_statistics+0x20e>
movb   $0x1,-0x3d(%rbp)
mov    -0x18(%rbp),%rax
movslq -0x34(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
mov    0x10(%rbp),%rax
mov    (%rax),%rax
movslq -0x38(%rbp),%rcx
add    (%rax,%rcx,4),%edx
mov    %edx,(%rax,%rcx,4)
mov    -0x20(%rbp),%rax
movslq -0x34(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
mov    0x18(%rbp),%rax
mov    (%rax),%rax
movslq -0x38(%rbp),%rcx
add    (%rax,%rcx,4),%edx
mov    %edx,(%rax,%rcx,4)
jmp    1351 <aggregate_cluster_statistics+0x221>
jmp    1343 <aggregate_cluster_statistics+0x213>
mov    -0x38(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x38(%rbp)
jmp    12cf <aggregate_cluster_statistics+0x19f>
cmpb   $0x0,-0x3d(%rbp)
jne    13ba <aggregate_cluster_statistics+0x28a>
mov    -0x10(%rbp),%rax
movslq -0x34(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
mov    -0x30(%rbp),%rax
mov    (%rax),%rax
mov    -0x28(%rbp),%rcx
movslq (%rcx),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x18(%rbp),%rax
movslq -0x34(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
mov    0x10(%rbp),%rax
mov    (%rax),%rax
mov    -0x28(%rbp),%rcx
movslq (%rcx),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x20(%rbp),%rax
movslq -0x34(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
mov    0x18(%rbp),%rax
mov    (%rax),%rax
mov    -0x28(%rbp),%rcx
movslq (%rcx),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x28(%rbp),%rax
mov    (%rax),%ecx
add    $0x1,%ecx
mov    %ecx,(%rax)
jmp    13bf <aggregate_cluster_statistics+0x28f>
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    12b8 <aggregate_cluster_statistics+0x188>
mov    -0x30(%rbp),%rax
mov    (%rax),%rdi
mov    -0x28(%rbp),%rax
movslq (%rax),%rax
shl    $0x2,%rax
mov    %eax,%esi
call   1050 <realloc@plt>
mov    %rax,%rcx
mov    -0x30(%rbp),%rax
mov    %rcx,(%rax)
mov    0x10(%rbp),%rax
mov    (%rax),%rdi
mov    -0x28(%rbp),%rax
movslq (%rax),%rax
shl    $0x2,%rax
mov    %eax,%esi
call   1050 <realloc@plt>
mov    %rax,%rcx
mov    0x10(%rbp),%rax
mov    %rcx,(%rax)
mov    0x18(%rbp),%rax
mov    (%rax),%rdi
mov    -0x28(%rbp),%rax
movslq (%rax),%rax
shl    $0x2,%rax
mov    %eax,%esi
call   1050 <realloc@plt>
mov    %rax,%rcx
mov    0x18(%rbp),%rax
mov    %rcx,(%rax)
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<aggregate_cluster_statistics>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
test   %edi,%edi
je     1322 <aggregate_cluster_statistics+0x1f2>
mov    %rsi,%r13
test   %rsi,%rsi
je     1322 <aggregate_cluster_statistics+0x1f2>
mov    %r8,%r12
mov    %edi,%ebp
mov    %rdx,(%rsp)
mov    %rcx,0x8(%rsp)
mov    0x58(%rsp),%rax
mov    %rax,0x10(%rsp)
mov    0x50(%rsp),%r14
mov    (%r8),%r15d
test   %r15d,%r15d
je     1264 <aggregate_cluster_statistics+0x134>
mov    (%r9),%rdi
test   %rdi,%rdi
je     1264 <aggregate_cluster_statistics+0x134>
add    %ebp,%r15d
shl    $0x2,%r15d
mov    %r15d,%esi
mov    %r9,%rbx
call   1050 <realloc@plt>
mov    %rax,(%rbx)
mov    (%r14),%rdi
mov    %r15d,%esi
call   1050 <realloc@plt>
mov    %rax,(%r14)
mov    0x10(%rsp),%rax
mov    (%rax),%rdi
mov    %r15d,%esi
mov    %rax,%r15
call   1050 <realloc@plt>
mov    %rax,(%r15)
test   %ebp,%ebp
jle    12ec <aggregate_cluster_statistics+0x1bc>
mov    %r15,%r9
mov    %ebp,%r8d
mov    %rbx,%r11
mov    (%rbx),%rdi
xor    %edx,%edx
mov    0x8(%rsp),%r10
mov    (%rsp),%r15
jmp    1226 <aggregate_cluster_statistics+0xf6>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movslq %ebp,%rsi
mov    %ecx,(%rdi,%rsi,4)
mov    (%r15,%rdx,4),%ecx
mov    (%r14),%rsi
movslq (%r12),%rbp
mov    %ecx,(%rsi,%rbp,4)
mov    (%r10,%rdx,4),%ecx
movslq (%r12),%rsi
mov    %ecx,(%rax,%rsi,4)
mov    $0x1,%ecx
mov    %r12,%rsi
add    %ecx,(%rsi)
add    $0x1,%rdx
cmp    %r8,%rdx
je     12e4 <aggregate_cluster_statistics+0x1b4>
mov    (%r12),%ebp
mov    0x0(%r13,%rdx,4),%ecx
test   %ebp,%ebp
jle    11f0 <aggregate_cluster_statistics+0xc0>
lea    0x0(,%rbp,4),%rbx
xor    %esi,%esi
nopl   (%rax)
cmp    (%rdi,%rsi,1),%ecx
je     1250 <aggregate_cluster_statistics+0x120>
add    $0x4,%rsi
cmp    %rsi,%rbx
jne    1240 <aggregate_cluster_statistics+0x110>
jmp    11f0 <aggregate_cluster_statistics+0xc0>
mov    (%r15,%rdx,4),%ecx
mov    (%r14),%rbp
add    %ecx,0x0(%rbp,%rsi,1)
mov    (%r10,%rdx,4),%ecx
add    %rax,%rsi
jmp    1217 <aggregate_cluster_statistics+0xe7>
mov    %ebp,(%r12)
shl    $0x2,%ebp
mov    %ebp,%edi
mov    %r9,%rbx
call   1040 <malloc@plt>
mov    %rax,(%rbx)
mov    (%r12),%edi
shl    $0x2,%edi
call   1040 <malloc@plt>
mov    %rax,(%r14)
mov    (%r12),%edi
shl    $0x2,%edi
call   1040 <malloc@plt>
mov    0x10(%rsp),%rbp
mov    %rax,0x0(%rbp)
mov    (%rbx),%rdi
mov    (%r12),%edx
shl    $0x2,%edx
mov    %r13,%rsi
call   1030 <memcpy@plt>
mov    (%r14),%rdi
mov    (%r12),%edx
shl    $0x2,%edx
mov    (%rsp),%rsi
call   1030 <memcpy@plt>
mov    0x0(%rbp),%rdi
mov    (%r12),%edx
shl    $0x2,%edx
mov    0x8(%rsp),%rsi
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <memcpy@plt>
mov    %r9,%r15
mov    %r11,%rbx
jmp    12ef <aggregate_cluster_statistics+0x1bf>
mov    (%rbx),%rdi
mov    (%r12),%esi
shl    $0x2,%esi
call   1050 <realloc@plt>
mov    %rax,(%rbx)
mov    (%r14),%rdi
mov    (%r12),%esi
shl    $0x2,%esi
call   1050 <realloc@plt>
mov    %rax,(%r14)
mov    (%r15),%rdi
mov    (%r12),%esi
shl    $0x2,%esi
call   1050 <realloc@plt>
mov    %rax,(%r15)
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @aggregate_cluster_statistics(i32 %0, i32* %1, i32* %2, i32* %3, i32* %4, i32** %5, i32** %6, i32** %7) {
%9 = alloca i32
%10 = alloca i32*
%11 = alloca i32*
%12 = alloca i32*
%13 = alloca i32*
%14 = alloca i32**
%15 = alloca i32**
%16 = alloca i32**
%17 = alloca i32
%18 = alloca i32
%19 = alloca i32
%20 = alloca i8
store i32 %0, i32* %9
store i32* %1, i32** %10
store i32* %2, i32** %11
store i32* %3, i32** %12
store i32* %4, i32** %13
store i32** %5, i32*** %14
store i32** %6, i32*** %15
store i32** %7, i32*** %16
%21 = load i32, i32* %9
%22 = icmp eq i32 %21, 0
br i1 %22, label %26, label %23
23: ; preds = %8
%24 = load i32*, i32** %10
%25 = icmp eq i32* %24, null
br i1 %25, label %26, label %27
26: ; preds = %23, %8
br label %242
27: ; preds = %23
%28 = load i32*, i32** %13
%29 = load i32, i32* %28
%30 = icmp eq i32 %29, 0
br i1 %30, label %35, label %31
31: ; preds = %27
%32 = load i32**, i32*** %14
%33 = load i32*, i32** %32
%34 = icmp eq i32* %33, null
br i1 %34, label %35, label %89
35: ; preds = %31, %27
%36 = load i32, i32* %9
%37 = load i32*, i32** %13
store i32 %36, i32* %37
%38 = load i32*, i32** %13
%39 = load i32, i32* %38
%40 = sext i32 %39 to i64
%41 = mul i64 %40, 4
%42 = trunc i64 %41 to i32
%43 = call i64 @malloc(i32 %42)
%44 = inttoptr i64 %43 to i32*
%45 = load i32**, i32*** %14
store i32* %44, i32** %45
%46 = load i32*, i32** %13
%47 = load i32, i32* %46
%48 = sext i32 %47 to i64
%49 = mul i64 %48, 4
%50 = trunc i64 %49 to i32
%51 = call i64 @malloc(i32 %50)
%52 = inttoptr i64 %51 to i32*
%53 = load i32**, i32*** %15
store i32* %52, i32** %53
%54 = load i32*, i32** %13
%55 = load i32, i32* %54
%56 = sext i32 %55 to i64
%57 = mul i64 %56, 4
%58 = trunc i64 %57 to i32
%59 = call i64 @malloc(i32 %58)
%60 = inttoptr i64 %59 to i32*
%61 = load i32**, i32*** %16
store i32* %60, i32** %61
%62 = load i32**, i32*** %14
%63 = load i32*, i32** %62
%64 = load i32*, i32** %10
%65 = load i32*, i32** %13
%66 = load i32, i32* %65
%67 = sext i32 %66 to i64
%68 = mul i64 %67, 4
%69 = trunc i64 %68 to i32
%70 = call i32 @memcpy(i32* %63, i32* %64, i32 %69)
%71 = load i32**, i32*** %15
%72 = load i32*, i32** %71
%73 = load i32*, i32** %11
%74 = load i32*, i32** %13
%75 = load i32, i32* %74
%76 = sext i32 %75 to i64
%77 = mul i64 %76, 4
%78 = trunc i64 %77 to i32
%79 = call i32 @memcpy(i32* %72, i32* %73, i32 %78)
%80 = load i32**, i32*** %16
%81 = load i32*, i32** %80
%82 = load i32*, i32** %12
%83 = load i32*, i32** %13
%84 = load i32, i32* %83
%85 = sext i32 %84 to i64
%86 = mul i64 %85, 4
%87 = trunc i64 %86 to i32
%88 = call i32 @memcpy(i32* %81, i32* %82, i32 %87)
br label %242
89: ; preds = %31
%90 = load i32*, i32** %13
%91 = load i32, i32* %90
%92 = load i32, i32* %9
%93 = add nsw i32 %91, %92
store i32 %93, i32* %19
%94 = load i32**, i32*** %14
%95 = load i32*, i32** %94
%96 = load i32, i32* %19
%97 = sext i32 %96 to i64
%98 = mul i64 %97, 4
%99 = trunc i64 %98 to i32
%100 = call i32* @realloc(i32* %95, i32 %99)
%101 = load i32**, i32*** %14
store i32* %100, i32** %101
%102 = load i32**, i32*** %15
%103 = load i32*, i32** %102
%104 = load i32, i32* %19
%105 = sext i32 %104 to i64
%106 = mul i64 %105, 4
%107 = trunc i64 %106 to i32
%108 = call i32* @realloc(i32* %103, i32 %107)
%109 = load i32**, i32*** %15
store i32* %108, i32** %109
%110 = load i32**, i32*** %16
%111 = load i32*, i32** %110
%112 = load i32, i32* %19
%113 = sext i32 %112 to i64
%114 = mul i64 %113, 4
%115 = trunc i64 %114 to i32
%116 = call i32* @realloc(i32* %111, i32 %115)
%117 = load i32**, i32*** %16
store i32* %116, i32** %117
store i32 0, i32* %17
br label %118
118: ; preds = %211, %89
%119 = load i32, i32* %17
%120 = load i32, i32* %9
%121 = icmp slt i32 %119, %120
br i1 %121, label %122, label %214
122: ; preds = %118
store i8 0, i8* %20
store i32 0, i32* %18
br label %123
123: ; preds = %167, %122
%124 = load i32, i32* %18
%125 = load i32*, i32** %13
%126 = load i32, i32* %125
%127 = icmp slt i32 %124, %126
br i1 %127, label %128, label %170
128: ; preds = %123
%129 = load i32*, i32** %10
%130 = load i32, i32* %17
%131 = sext i32 %130 to i64
%132 = getelementptr inbounds i32, i32* %129, i64 %131
%133 = load i32, i32* %132
%134 = load i32**, i32*** %14
%135 = load i32*, i32** %134
%136 = load i32, i32* %18
%137 = sext i32 %136 to i64
%138 = getelementptr inbounds i32, i32* %135, i64 %137
%139 = load i32, i32* %138
%140 = icmp eq i32 %133, %139
br i1 %140, label %141, label %166
141: ; preds = %128
store i8 1, i8* %20
%142 = load i32*, i32** %11
%143 = load i32, i32* %17
%144 = sext i32 %143 to i64
%145 = getelementptr inbounds i32, i32* %142, i64 %144
%146 = load i32, i32* %145
%147 = load i32**, i32*** %15
%148 = load i32*, i32** %147
%149 = load i32, i32* %18
%150 = sext i32 %149 to i64
%151 = getelementptr inbounds i32, i32* %148, i64 %150
%152 = load i32, i32* %151
%153 = add nsw i32 %152, %146
store i32 %153, i32* %151
%154 = load i32*, i32** %12
%155 = load i32, i32* %17
%156 = sext i32 %155 to i64
%157 = getelementptr inbounds i32, i32* %154, i64 %156
%158 = load i32, i32* %157
%159 = load i32**, i32*** %16
%160 = load i32*, i32** %159
%161 = load i32, i32* %18
%162 = sext i32 %161 to i64
%163 = getelementptr inbounds i32, i32* %160, i64 %162
%164 = load i32, i32* %163
%165 = add nsw i32 %164, %158
store i32 %165, i32* %163
br label %170
166: ; preds = %128
br label %167
167: ; preds = %166
%168 = load i32, i32* %18
%169 = add nsw i32 %168, 1
store i32 %169, i32* %18
br label %123
170: ; preds = %141, %123
%171 = load i8, i8* %20
%172 = icmp ne i8 %171, 0
br i1 %172, label %210, label %173
173: ; preds = %170
%174 = load i32*, i32** %10
%175 = load i32, i32* %17
%176 = sext i32 %175 to i64
%177 = getelementptr inbounds i32, i32* %174, i64 %176
%178 = load i32, i32* %177
%179 = load i32**, i32*** %14
%180 = load i32*, i32** %179
%181 = load i32*, i32** %13
%182 = load i32, i32* %181
%183 = sext i32 %182 to i64
%184 = getelementptr inbounds i32, i32* %180, i64 %183
store i32 %178, i32* %184
%185 = load i32*, i32** %11
%186 = load i32, i32* %17
%187 = sext i32 %186 to i64
%188 = getelementptr inbounds i32, i32* %185, i64 %187
%189 = load i32, i32* %188
%190 = load i32**, i32*** %15
%191 = load i32*, i32** %190
%192 = load i32*, i32** %13
%193 = load i32, i32* %192
%194 = sext i32 %193 to i64
%195 = getelementptr inbounds i32, i32* %191, i64 %194
store i32 %189, i32* %195
%196 = load i32*, i32** %12
%197 = load i32, i32* %17
%198 = sext i32 %197 to i64
%199 = getelementptr inbounds i32, i32* %196, i64 %198
%200 = load i32, i32* %199
%201 = load i32**, i32*** %16
%202 = load i32*, i32** %201
%203 = load i32*, i32** %13
%204 = load i32, i32* %203
%205 = sext i32 %204 to i64
%206 = getelementptr inbounds i32, i32* %202, i64 %205
store i32 %200, i32* %206
%207 = load i32*, i32** %13
%208 = load i32, i32* %207
%209 = add nsw i32 %208, 1
store i32 %209, i32* %207
br label %210
210: ; preds = %173, %170
br label %211
211: ; preds = %210
%212 = load i32, i32* %17
%213 = add nsw i32 %212, 1
store i32 %213, i32* %17
br label %118
214: ; preds = %118
%215 = load i32**, i32*** %14
%216 = load i32*, i32** %215
%217 = load i32*, i32** %13
%218 = load i32, i32* %217
%219 = sext i32 %218 to i64
%220 = mul i64 %219, 4
%221 = trunc i64 %220 to i32
%222 = call i32* @realloc(i32* %216, i32 %221)
%223 = load i32**, i32*** %14
store i32* %222, i32** %223
%224 = load i32**, i32*** %15
%225 = load i32*, i32** %224
%226 = load i32*, i32** %13
%227 = load i32, i32* %226
%228 = sext i32 %227 to i64
%229 = mul i64 %228, 4
%230 = trunc i64 %229 to i32
%231 = call i32* @realloc(i32* %225, i32 %230)
%232 = load i32**, i32*** %15
store i32* %231, i32** %232
%233 = load i32**, i32*** %16
%234 = load i32*, i32** %233
%235 = load i32*, i32** %13
%236 = load i32, i32* %235
%237 = sext i32 %236 to i64
%238 = mul i64 %237, 4
%239 = trunc i64 %238 to i32
%240 = call i32* @realloc(i32* %234, i32 %239)
%241 = load i32**, i32*** %16
store i32* %240, i32** %241
br label %242
242: ; preds = %214, %35, %26
ret void
}

LLVM IR (-O2):
define void @aggregate_cluster_statistics(i32 %0, i32* %1, i32* %2, i32* %3, i32* nocapture %4, i32** nocapture %5, i32** nocapture %6, i32** nocapture %7) {
%9 = icmp eq i32 %0, 0
%10 = icmp eq i32* %1, null
%11 = or i1 %9, %10
br i1 %11, label %117, label %12
12: ; preds = %8
%13 = load i32, i32* %4
%14 = icmp eq i32 %13, 0
br i1 %14, label %18, label %15
15: ; preds = %12
%16 = load i32*, i32** %5
%17 = icmp eq i32* %16, null
br i1 %17, label %18, label %42
18: ; preds = %15, %12
store i32 %0, i32* %4
%19 = shl i32 %0, 2
%20 = tail call i64 @malloc(i32 %19)
%21 = inttoptr i64 %20 to i32*
store i32* %21, i32** %5
%22 = load i32, i32* %4
%23 = shl i32 %22, 2
%24 = tail call i64 @malloc(i32 %23)
%25 = inttoptr i64 %24 to i32*
store i32* %25, i32** %6
%26 = load i32, i32* %4
%27 = shl i32 %26, 2
%28 = tail call i64 @malloc(i32 %27)
%29 = inttoptr i64 %28 to i32*
store i32* %29, i32** %7
%30 = load i32*, i32** %5
%31 = load i32, i32* %4
%32 = shl i32 %31, 2
%33 = tail call i32 @memcpy(i32* %30, i32* %1, i32 %32)
%34 = load i32*, i32** %6
%35 = load i32, i32* %4
%36 = shl i32 %35, 2
%37 = tail call i32 @memcpy(i32* %34, i32* %2, i32 %36)
%38 = load i32*, i32** %7
%39 = load i32, i32* %4
%40 = shl i32 %39, 2
%41 = tail call i32 @memcpy(i32* %38, i32* %3, i32 %40)
br label %117
42: ; preds = %15
%43 = add nsw i32 %13, %0
%44 = shl i32 %43, 2
%45 = tail call i32* @realloc(i32* %16, i32 %44)
store i32* %45, i32** %5
%46 = load i32*, i32** %6
%47 = tail call i32* @realloc(i32* %46, i32 %44)
store i32* %47, i32** %6
%48 = load i32*, i32** %7
%49 = tail call i32* @realloc(i32* %48, i32 %44)
store i32* %49, i32** %7
%50 = icmp sgt i32 %0, 0
br i1 %50, label %53, label %51
51: ; preds = %42
%52 = load i32*, i32** %5
br label %104
53: ; preds = %42
%54 = zext i32 %0 to i64
%55 = load i32*, i32** %5
br label %56
56: ; preds = %53, %97
%57 = phi i64 [ 0, %53 ], [ %102, %97 ]
%58 = load i32, i32* %4
%59 = icmp sgt i32 %58, 0
%60 = getelementptr inbounds i32, i32* %1, i64 %57
%61 = load i32, i32* %60
br i1 %59, label %62, label %83
62: ; preds = %56
%63 = zext i32 %58 to i64
br label %64
64: ; preds = %62, %80
%65 = phi i64 [ 0, %62 ], [ %81, %80 ]
%66 = getelementptr inbounds i32, i32* %55, i64 %65
%67 = load i32, i32* %66
%68 = icmp eq i32 %61, %67
br i1 %68, label %69, label %80
69: ; preds = %64
%70 = and i64 %65, 4294967295
%71 = getelementptr inbounds i32, i32* %2, i64 %57
%72 = load i32, i32* %71
%73 = load i32*, i32** %6
%74 = getelementptr inbounds i32, i32* %73, i64 %70
%75 = load i32, i32* %74
%76 = add nsw i32 %75, %72
store i32 %76, i32* %74
%77 = getelementptr inbounds i32, i32* %3, i64 %57
%78 = load i32, i32* %77
%79 = getelementptr inbounds i32, i32* %49, i64 %70
br label %97
80: ; preds = %64
%81 = add nuw nsw i64 %65, 1
%82 = icmp eq i64 %81, %63
br i1 %82, label %83, label %64
83: ; preds = %80, %56
%84 = sext i32 %58 to i64
%85 = getelementptr inbounds i32, i32* %55, i64 %84
store i32 %61, i32* %85
%86 = getelementptr inbounds i32, i32* %2, i64 %57
%87 = load i32, i32* %86
%88 = load i32*, i32** %6
%89 = load i32, i32* %4
%90 = sext i32 %89 to i64
%91 = getelementptr inbounds i32, i32* %88, i64 %90
store i32 %87, i32* %91
%92 = getelementptr inbounds i32, i32* %3, i64 %57
%93 = load i32, i32* %92
%94 = load i32, i32* %4
%95 = sext i32 %94 to i64
%96 = getelementptr inbounds i32, i32* %49, i64 %95
store i32 %93, i32* %96
br label %97
97: ; preds = %69, %83
%98 = phi i32* [ %79, %69 ], [ %4, %83 ]
%99 = phi i32 [ %78, %69 ], [ 1, %83 ]
%100 = load i32, i32* %98
%101 = add nsw i32 %100, %99
store i32 %101, i32* %98
%102 = add nuw nsw i64 %57, 1
%103 = icmp eq i64 %102, %54
br i1 %103, label %104, label %56
104: ; preds = %97, %51
%105 = phi i32* [ %52, %51 ], [ %55, %97 ]
%106 = load i32, i32* %4
%107 = shl i32 %106, 2
%108 = tail call i32* @realloc(i32* %105, i32 %107)
store i32* %108, i32** %5
%109 = load i32*, i32** %6
%110 = load i32, i32* %4
%111 = shl i32 %110, 2
%112 = tail call i32* @realloc(i32* %109, i32 %111)
store i32* %112, i32** %6
%113 = load i32*, i32** %7
%114 = load i32, i32* %4
%115 = shl i32 %114, 2
%116 = tail call i32* @realloc(i32* %113, i32 %115)
store i32* %116, i32** %7
br label %117
117: ; preds = %8, %104, %18
ret void
}