#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*/ printf(char *, int);
int /*<<< orphan*/ puts(char *);
int /*<<< orphan*/ srand(int /*<<< orphan*/);
int /*<<< orphan*/ test_all_pvals(int *, int *, int, int, int);
int /*<<< orphan*/ time(int /*<<< orphan*/);
int main(void) {
  int pvals[] = {1,  2,  3,  5,  7,  11, 13, 17, 19,
                 23, 29, 31, 33, 35, 37, 39, 41, 43};
  int i, collisions[15];
  srand(time(0));
  for (i = 0; i < 15; i++)
    printf("%d\t", pvals[i]);
  puts("\n");
  for (i = 0; i < 10; i++)
    test_all_pvals(pvals, collisions, 15, 500, 200);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x50(%rbp),%rdi
lea    0xe83(%rip),%rsi
mov    $0x48,%edx
call   1070 <memcpy@plt>
xor    %edi,%edi
call   1080 <time@plt>
mov    %eax,%edi
call   1060 <srand@plt>
movl   $0x0,-0x54(%rbp)
cmpl   $0xf,-0x54(%rbp)
jge    11c8 <main+0x68>
movslq -0x54(%rbp),%rax
mov    -0x50(%rbp,%rax,4),%esi
lea    0xe93(%rip),%rdi
call   1040 <printf@plt>
mov    -0x54(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x54(%rbp)
jmp    119c <main+0x3c>
lea    0xe7d(%rip),%rdi
call   1030 <puts@plt>
movl   $0x0,-0x54(%rbp)
cmpl   $0xa,-0x54(%rbp)
jge    1213 <main+0xb3>
lea    -0x50(%rbp),%rdi
lea    -0x90(%rbp),%rsi
mov    $0xf,%edx
mov    $0x1f4,%ecx
mov    $0xc8,%r8d
call   1050 <test_all_pvals@plt>
mov    -0x54(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x54(%rbp)
jmp    11db <main+0x7b>
xor    %eax,%eax
add    $0x90,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x98,%rsp
mov    0xedf(%rip),%rax
mov    %rax,0x40(%rsp)
movaps 0xec3(%rip),%xmm0
movaps %xmm0,0x30(%rsp)
movaps 0xea7(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movaps 0xe8b(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xe6f(%rip),%xmm0
movaps %xmm0,(%rsp)
xor    %edi,%edi
call   1070 <time@plt>
mov    %eax,%edi
call   1060 <srand@plt>
lea    0xe9e(%rip),%rbx
mov    %rbx,%rdi
mov    $0x1,%esi
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    $0x2,%esi
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    $0x3,%esi
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    $0x5,%esi
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    $0x7,%esi
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    $0xb,%esi
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    $0xd,%esi
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    $0x11,%esi
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    $0x13,%esi
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    $0x17,%esi
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    $0x1d,%esi
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    $0x1f,%esi
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    $0x21,%esi
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    $0x23,%esi
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    $0x25,%esi
call   1040 <printf@plt>
lea    0xdd8(%rip),%rdi
call   1030 <puts@plt>
mov    %rsp,%rbx
lea    0x50(%rsp),%r14
mov    %rbx,%rdi
mov    %r14,%rsi
mov    $0xf,%edx
mov    $0x1f4,%ecx
mov    $0xc8,%r8d
call   1050 <test_all_pvals@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    $0xf,%edx
mov    $0x1f4,%ecx
mov    $0xc8,%r8d
call   1050 <test_all_pvals@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    $0xf,%edx
mov    $0x1f4,%ecx
mov    $0xc8,%r8d
call   1050 <test_all_pvals@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    $0xf,%edx
mov    $0x1f4,%ecx
mov    $0xc8,%r8d
call   1050 <test_all_pvals@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    $0xf,%edx
mov    $0x1f4,%ecx
mov    $0xc8,%r8d
call   1050 <test_all_pvals@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    $0xf,%edx
mov    $0x1f4,%ecx
mov    $0xc8,%r8d
call   1050 <test_all_pvals@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    $0xf,%edx
mov    $0x1f4,%ecx
mov    $0xc8,%r8d
call   1050 <test_all_pvals@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    $0xf,%edx
mov    $0x1f4,%ecx
mov    $0xc8,%r8d
call   1050 <test_all_pvals@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    $0xf,%edx
mov    $0x1f4,%ecx
mov    $0xc8,%r8d
call   1050 <test_all_pvals@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    $0xf,%edx
mov    $0x1f4,%ecx
mov    $0xc8,%r8d
call   1050 <test_all_pvals@plt>
xor    %eax,%eax
add    $0x98,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@__const.main.pvals = [18 x i32] [i32 1, i32 2, i32 3, i32 5, i32 7, i32 11, i32 13, i32 17, i32 19, i32 23, i32 29, i32 31, i32 33, i32 35, i32 37, i32 39, i32 41, i32 43]
@.str = [4 x i8] c"%d\09\00"
@.str.1 = [2 x i8] c"\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [18 x i32]
%3 = alloca i32
%4 = alloca [15 x i32]
store i32 0, i32* %1
%5 = bitcast [18 x i32]* %2 to i8*
%6 = call i32 @time(i32 0)
%7 = call i32 @srand(i32 %6)
store i32 0, i32* %3
br label %8
8: ; preds = %17, %0
%9 = load i32, i32* %3
%10 = icmp slt i32 %9, 15
br i1 %10, label %11, label %20
11: ; preds = %8
%12 = load i32, i32* %3
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds [18 x i32], [18 x i32]* %2, i64 0, i64 %13
%15 = load i32, i32* %14
%16 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %15)
br label %17
17: ; preds = %11
%18 = load i32, i32* %3
%19 = add nsw i32 %18, 1
store i32 %19, i32* %3
br label %8
20: ; preds = %8
%21 = call i32 @puts(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32 0, i32* %3
br label %22
22: ; preds = %29, %20
%23 = load i32, i32* %3
%24 = icmp slt i32 %23, 10
br i1 %24, label %25, label %32
25: ; preds = %22
%26 = getelementptr inbounds [18 x i32], [18 x i32]* %2, i64 0, i64 0
%27 = getelementptr inbounds [15 x i32], [15 x i32]* %4, i64 0, i64 0
%28 = call i32 @test_all_pvals(i32* %26, i32* %27, i32 15, i32 500, i32 200)
br label %29
29: ; preds = %25
%30 = load i32, i32* %3
%31 = add nsw i32 %30, 1
store i32 %31, i32* %3
br label %22
32: ; preds = %22
ret i32 0
}

LLVM IR (-O2):
@__const.main.pvals = [18 x i32] [i32 1, i32 2, i32 3, i32 5, i32 7, i32 11, i32 13, i32 17, i32 19, i32 23, i32 29, i32 31, i32 33, i32 35, i32 37, i32 39, i32 41, i32 43]
@.str = [4 x i8] c"%d\09\00"
@.str.1 = [2 x i8] c"\0A\00"
define i32 @main() {
%1 = alloca [18 x i32]
%2 = alloca [15 x i32]
%3 = bitcast [18 x i32]* %1 to i8*
%4 = bitcast [15 x i32]* %2 to i8*
%5 = tail call i32 @time(i32 0)
%6 = tail call i32 @srand(i32 %5)
%7 = getelementptr inbounds [18 x i32], [18 x i32]* %1, i64 0, i64 0
%8 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 1)
%9 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 2)
%10 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 3)
%11 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 5)
%12 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 7)
%13 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 11)
%14 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 13)
%15 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 17)
%16 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 19)
%17 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 23)
%18 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 29)
%19 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 31)
%20 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 33)
%21 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 35)
%22 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 37)
%23 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%24 = getelementptr inbounds [15 x i32], [15 x i32]* %2, i64 0, i64 0
%25 = call i32 @test_all_pvals(i32* %7, i32* %24, i32 15, i32 500, i32 200)
%26 = call i32 @test_all_pvals(i32* %7, i32* %24, i32 15, i32 500, i32 200)
%27 = call i32 @test_all_pvals(i32* %7, i32* %24, i32 15, i32 500, i32 200)
%28 = call i32 @test_all_pvals(i32* %7, i32* %24, i32 15, i32 500, i32 200)
%29 = call i32 @test_all_pvals(i32* %7, i32* %24, i32 15, i32 500, i32 200)
%30 = call i32 @test_all_pvals(i32* %7, i32* %24, i32 15, i32 500, i32 200)
%31 = call i32 @test_all_pvals(i32* %7, i32* %24, i32 15, i32 500, i32 200)
%32 = call i32 @test_all_pvals(i32* %7, i32* %24, i32 15, i32 500, i32 200)
%33 = call i32 @test_all_pvals(i32* %7, i32* %24, i32 15, i32 500, i32 200)
%34 = call i32 @test_all_pvals(i32* %7, i32* %24, i32 15, i32 500, i32 200)
ret i32 0
}