#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__ add_random(int, double, int, int, int, int, int);
int /*<<< orphan*/ printf(char *);
int larger_tests() {
  int rv = 0;
  int e;
  printf("\nAdd 10M elements and verify (0.00001)\n");
  rv += add_random(10000000, 0.00001, 10000000, 0, 1, 32, 1);
  printf("\nChecking collision rates with filters from 100K to 1M (0.001)\n");
  for (e = 100000; e <= 1000000; e += 100) {
    rv += add_random(e, 0.001, e, 1, 1, 8, 1);
  }
  return rv;
}


x86 assembly (clang, -O0):
<larger_tests>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rdi
call   1040 <printf@plt>
mov    $0x989680,%esi
movsd  0xeb8(%rip),%xmm0
xor    %edx,%edx
mov    $0x1,%r9d
mov    $0x20,%r8d
mov    %esi,%edi
mov    %r9d,%ecx
call   1030 <add_random@plt>
mov    %rax,%rcx
movslq -0x4(%rbp),%rax
add    %rcx,%rax
mov    %eax,-0x4(%rbp)
lea    0xec4(%rip),%rdi
call   1040 <printf@plt>
movl   $0x186a0,-0x8(%rbp)
cmpl   $0xf4240,-0x8(%rbp)
jg     11cd <larger_tests+0xad>
mov    -0x8(%rbp),%edi
mov    -0x8(%rbp),%esi
movsd  0xe6d(%rip),%xmm0
mov    $0x1,%r9d
mov    $0x8,%r8d
mov    %r9d,%edx
mov    %r9d,%ecx
call   1030 <add_random@plt>
mov    %rax,%rcx
movslq -0x4(%rbp),%rax
add    %rcx,%rax
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%eax
add    $0x64,%eax
mov    %eax,-0x8(%rbp)
jmp    1180 <larger_tests+0x60>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<larger_tests>:
push   %rbp
push   %rbx
push   %rax
lea    0xee6(%rip),%rdi
call   1040 <puts@plt>
movsd  0xec9(%rip),%xmm0
mov    $0x989680,%edi
mov    $0x989680,%esi
xor    %edx,%edx
mov    $0x1,%ecx
mov    $0x20,%r8d
mov    $0x1,%r9d
call   1030 <add_random@plt>
mov    %rax,%rbx
lea    0xed4(%rip),%rdi
call   1040 <puts@plt>
mov    $0x1863c,%ebp
nopl   (%rax)
add    $0x64,%ebp
mov    %ebp,%edi
movsd  0xe8b(%rip),%xmm0
mov    %ebp,%esi
mov    $0x1,%edx
mov    $0x1,%ecx
mov    $0x8,%r8d
mov    $0x1,%r9d
call   1030 <add_random@plt>
movslq %ebx,%rbx
add    %rax,%rbx
cmp    $0xf41dd,%ebp
jb     1170 <larger_tests+0x50>
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [40 x i8] c"\0AAdd 10M elements and verify (0.00001)\0A\00"
@.str.1 = [64 x i8] c"\0AChecking collision rates with filters from 100K to 1M (0.001)\0A\00"
define i32 @larger_tests() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0))
%4 = call i64 @add_random(i32 10000000, double 1.000000e-05, i32 10000000, i32 0, i32 1, i32 32, i32 1)
%5 = load i32, i32* %1
%6 = sext i32 %5 to i64
%7 = add nsw i64 %6, %4
%8 = trunc i64 %7 to i32
store i32 %8, i32* %1
%9 = call i32 @printf(i8* getelementptr inbounds ([64 x i8], [64 x i8]* @.str.1, i64 0, i64 0))
store i32 100000, i32* %2
br label %10
10: ; preds = %21, %0
%11 = load i32, i32* %2
%12 = icmp sle i32 %11, 1000000
br i1 %12, label %13, label %24
13: ; preds = %10
%14 = load i32, i32* %2
%15 = load i32, i32* %2
%16 = call i64 @add_random(i32 %14, double 1.000000e-03, i32 %15, i32 1, i32 1, i32 8, i32 1)
%17 = load i32, i32* %1
%18 = sext i32 %17 to i64
%19 = add nsw i64 %18, %16
%20 = trunc i64 %19 to i32
store i32 %20, i32* %1
br label %21
21: ; preds = %13
%22 = load i32, i32* %2
%23 = add nsw i32 %22, 100
store i32 %23, i32* %2
br label %10
24: ; preds = %10
%25 = load i32, i32* %1
ret i32 %25
}

LLVM IR (-O2):
@str = [39 x i8] c"\0AAdd 10M elements and verify (0.00001)\00"
@str.2 = [63 x i8] c"\0AChecking collision rates with filters from 100K to 1M (0.001)\00"
define i32 @larger_tests() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @str, i64 0, i64 0))
%2 = tail call i64 @add_random(i32 10000000, double 1.000000e-05, i32 10000000, i32 0, i32 1, i32 32, i32 1)
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([63 x i8], [63 x i8]* @str.2, i64 0, i64 0))
br label %4
4: ; preds = %0, %4
%5 = phi i32 [ 100000, %0 ], [ %11, %4 ]
%6 = phi i64 [ %2, %0 ], [ %10, %4 ]
%7 = tail call i64 @add_random(i32 %5, double 1.000000e-03, i32 %5, i32 1, i32 1, i32 8, i32 1)
%8 = shl i64 %6, 32
%9 = ashr exact i64 %8, 32
%10 = add nsw i64 %7, %9
%11 = add nuw nsw i32 %5, 100
%12 = icmp ult i32 %5, 999901
br i1 %12, label %4, label %13
13: ; preds = %4
%14 = trunc i64 %10 to i32
ret i32 %14
}