#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 */
typedef int uint;

/* Variables and functions */
int check_kbitArray(int, int);
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ srand(int /*<<< orphan*/);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
int main(int argc, char **argv) {
  srand(time(NULL));
  uint i;
  for (i = 2; i < 62; i++) {
    int err = check_kbitArray(10000000, i);
    if (err) {
      printf("\n kBitArray_Long fails with random its of %d bits, please check",
             i);
      exit(0);
    }
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   1050 <time@plt>
mov    %eax,%edi
call   1040 <srand@plt>
movl   $0x2,-0x14(%rbp)
cmpl   $0x3e,-0x14(%rbp)
jge    11ca <main+0x7a>
mov    -0x14(%rbp),%esi
mov    $0x989680,%edi
call   1070 <check_kbitArray@plt>
mov    %eax,-0x18(%rbp)
cmpl   $0x0,-0x18(%rbp)
je     11b7 <main+0x67>
mov    -0x14(%rbp),%esi
lea    0xe55(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1060 <exit@plt>
jmp    11bc <main+0x6c>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    117d <main+0x2d>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %edi,%edi
call   1050 <time@plt>
mov    %eax,%edi
call   1040 <srand@plt>
mov    $0x2,%ebx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    $0x989680,%edi
mov    %ebx,%esi
call   1070 <check_kbitArray@plt>
test   %eax,%eax
jne    118c <main+0x3c>
add    $0x1,%ebx
cmp    $0x3e,%ebx
jne    1170 <main+0x20>
xor    %eax,%eax
pop    %rbx
ret
lea    0xe6d(%rip),%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
xor    %edi,%edi
call   1060 <exit@plt>

LLVM IR (-O0):
@.str = [64 x i8] c"\0A kBitArray_Long fails with random its of %d bits, please check\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = call i32 @time(i32* null)
%9 = call i32 @srand(i32 %8)
store i32 2, i32* %6
br label %10
10: ; preds = %23, %2
%11 = load i32, i32* %6
%12 = icmp slt i32 %11, 62
br i1 %12, label %13, label %26
13: ; preds = %10
%14 = load i32, i32* %6
%15 = call i32 @check_kbitArray(i32 10000000, i32 %14)
store i32 %15, i32* %7
%16 = load i32, i32* %7
%17 = icmp ne i32 %16, 0
br i1 %17, label %18, label %22
18: ; preds = %13
%19 = load i32, i32* %6
%20 = call i32 @printf(i8* getelementptr inbounds ([64 x i8], [64 x i8]* @.str, i64 0, i64 0), i32 %19)
%21 = call i32 @exit(i32 0)
unreachable
22: ; preds = %13
br label %23
23: ; preds = %22
%24 = load i32, i32* %6
%25 = add nsw i32 %24, 1
store i32 %25, i32* %6
br label %10
26: ; preds = %10
%27 = load i32, i32* %3
ret i32 %27
}

LLVM IR (-O2):
@.str = [64 x i8] c"\0A kBitArray_Long fails with random its of %d bits, please check\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @time(i32* null)
%4 = tail call i32 @srand(i32 %3)
br label %5
5: ; preds = %2, %12
%6 = phi i32 [ 2, %2 ], [ %13, %12 ]
%7 = tail call i32 @check_kbitArray(i32 10000000, i32 %6)
%8 = icmp eq i32 %7, 0
br i1 %8, label %12, label %9
9: ; preds = %5
%10 = tail call i32 @printf(i8* getelementptr inbounds ([64 x i8], [64 x i8]* @.str, i64 0, i64 0), i32 %6)
%11 = tail call i32 @exit(i32 0)
unreachable
12: ; preds = %5
%13 = add nuw nsw i32 %6, 1
%14 = icmp eq i32 %13, 62
br i1 %14, label %15, label %5
15: ; preds = %12
ret i32 0
}