#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*/ bootstrapSelect(int, int *);
int *initZeroArray(int);
scalar_t__ mCalloc(int, int);
int **bootFilter(int nBoot, int len) {
  int i;
  int **filters;
  filters = (int **)mCalloc(nBoot, sizeof(int *));
  for (i = 0; i < nBoot; i++) {
    filters[i] = initZeroArray(len);
    bootstrapSelect(len, filters[i]);
  }
  return filters;
}


x86 assembly (clang, -O0):
<bootFilter>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x8,%esi
call   1050 <mCalloc@plt>
mov    %rax,-0x18(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    119b <bootFilter+0x6b>
mov    -0x8(%rbp),%edi
call   1040 <initZeroArray@plt>
mov    %rax,%rdx
mov    -0x18(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    %rdx,(%rax,%rcx,8)
mov    -0x8(%rbp),%edi
mov    -0x18(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,8),%rsi
call   1030 <bootstrapSelect@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1156 <bootFilter+0x26>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bootFilter>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
mov    $0x8,%esi
call   1050 <mCalloc@plt>
mov    %rax,%r14
test   %ebp,%ebp
jle    117e <bootFilter+0x4e>
mov    %ebp,%r15d
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %ebx,%edi
call   1040 <initZeroArray@plt>
mov    %rax,(%r14,%rbp,8)
mov    %ebx,%edi
mov    %rax,%rsi
call   1030 <bootstrapSelect@plt>
add    $0x1,%rbp
cmp    %rbp,%r15
jne    1160 <bootFilter+0x30>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i32** @bootFilter(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32**
store i32 %0, i32* %3
store i32 %1, i32* %4
%7 = load i32, i32* %3
%8 = call i64 @mCalloc(i32 %7, i32 8)
%9 = inttoptr i64 %8 to i32**
store i32** %9, i32*** %6
store i32 0, i32* %5
br label %10
10: ; preds = %28, %2
%11 = load i32, i32* %5
%12 = load i32, i32* %3
%13 = icmp slt i32 %11, %12
br i1 %13, label %14, label %31
14: ; preds = %10
%15 = load i32, i32* %4
%16 = call i32* @initZeroArray(i32 %15)
%17 = load i32**, i32*** %6
%18 = load i32, i32* %5
%19 = sext i32 %18 to i64
%20 = getelementptr inbounds i32*, i32** %17, i64 %19
store i32* %16, i32** %20
%21 = load i32, i32* %4
%22 = load i32**, i32*** %6
%23 = load i32, i32* %5
%24 = sext i32 %23 to i64
%25 = getelementptr inbounds i32*, i32** %22, i64 %24
%26 = load i32*, i32** %25
%27 = call i32 @bootstrapSelect(i32 %21, i32* %26)
br label %28
28: ; preds = %14
%29 = load i32, i32* %5
%30 = add nsw i32 %29, 1
store i32 %30, i32* %5
br label %10
31: ; preds = %10
%32 = load i32**, i32*** %6
ret i32** %32
}

LLVM IR (-O2):
define i32** @bootFilter(i32 %0, i32 %1) {
%3 = tail call i64 @mCalloc(i32 %0, i32 8)
%4 = inttoptr i64 %3 to i32**
%5 = icmp sgt i32 %0, 0
br i1 %5, label %6, label %15
6: ; preds = %2
%7 = zext i32 %0 to i64
br label %8
8: ; preds = %6, %8
%9 = phi i64 [ 0, %6 ], [ %13, %8 ]
%10 = tail call i32* @initZeroArray(i32 %1)
%11 = getelementptr inbounds i32*, i32** %4, i64 %9
store i32* %10, i32** %11
%12 = tail call i32 @bootstrapSelect(i32 %1, i32* %10)
%13 = add nuw nsw i64 %9, 1
%14 = icmp eq i64 %13, %7
br i1 %14, label %15, label %8
15: ; preds = %8, %2
ret i32** %4
}