#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 /*<<< orphan*/, int, int, int);
scalar_t__ basic();
char *bloom_version();
int /*<<< orphan*/ printf(char *, char *);
int basic_tests() {
  int rv = 0;
  rv += basic();
  rv += add_random(5002, 0.01, 5000, 0, 1, 32, 1);
  rv += add_random(10000, 0.1, 10000, 0, 1, 32, 1);
  rv += add_random(10000, 0.01, 10000, 0, 1, 32, 1);
  rv += add_random(10000, 0.001, 10000, 0, 1, 32, 1);
  rv += add_random(10000, 0.0001, 10000, 0, 1, 32, 1);
  rv += add_random(1000000, 0.0001, 1000000, 0, 1, 32, 1);
  printf("\nBrought to you by libbloom-%s\n", bloom_version());
  return 0;
}


x86 assembly (clang, -O0):
<basic_tests>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1060 <basic@plt>
mov    %rax,%rcx
movslq -0x4(%rbp),%rax
add    %rcx,%rax
mov    %eax,-0x4(%rbp)
mov    $0x138a,%edi
movsd  0xea0(%rip),%xmm0
mov    $0x1388,%esi
xor    %edx,%edx
mov    $0x1,%r9d
mov    $0x20,%r8d
mov    %r9d,%ecx
call   1030 <add_random@plt>
mov    %rax,%rcx
movslq -0x4(%rbp),%rax
add    %rcx,%rax
mov    %eax,-0x4(%rbp)
mov    $0x2710,%esi
movsd  0xe73(%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)
mov    $0x2710,%esi
movsd  0xe39(%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)
mov    $0x2710,%esi
movsd  0xdff(%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)
mov    $0x2710,%esi
movsd  0xdc5(%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)
mov    $0xf4240,%esi
movsd  0xd93(%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)
mov    $0x0,%al
call   1040 <bloom_version@plt>
mov    %rax,%rsi
lea    0xd7d(%rip),%rdi
call   1050 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<basic_tests>:
push   %rax
xor    %eax,%eax
call   1060 <basic@plt>
movsd  0xeb0(%rip),%xmm0
mov    $0x138a,%edi
mov    $0x1388,%esi
xor    %edx,%edx
mov    $0x1,%ecx
mov    $0x20,%r8d
mov    $0x1,%r9d
call   1030 <add_random@plt>
movsd  0xe8e(%rip),%xmm0
mov    $0x2710,%edi
mov    $0x2710,%esi
xor    %edx,%edx
mov    $0x1,%ecx
mov    $0x20,%r8d
mov    $0x1,%r9d
call   1030 <add_random@plt>
mov    $0x2710,%edi
movsd  0xe57(%rip),%xmm0
mov    $0x2710,%esi
xor    %edx,%edx
mov    $0x1,%ecx
mov    $0x20,%r8d
mov    $0x1,%r9d
call   1030 <add_random@plt>
movsd  0xe42(%rip),%xmm0
mov    $0x2710,%edi
mov    $0x2710,%esi
xor    %edx,%edx
mov    $0x1,%ecx
mov    $0x20,%r8d
mov    $0x1,%r9d
call   1030 <add_random@plt>
movsd  0xe20(%rip),%xmm0
mov    $0x2710,%edi
mov    $0x2710,%esi
xor    %edx,%edx
mov    $0x1,%ecx
mov    $0x20,%r8d
mov    $0x1,%r9d
call   1030 <add_random@plt>
mov    $0xf4240,%edi
movsd  0xdf1(%rip),%xmm0
mov    $0xf4240,%esi
xor    %edx,%edx
mov    $0x1,%ecx
mov    $0x20,%r8d
mov    $0x1,%r9d
call   1030 <add_random@plt>
xor    %eax,%eax
call   1040 <bloom_version@plt>
lea    0xdce(%rip),%rdi
mov    %rax,%rsi
call   1050 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [32 x i8] c"\0ABrought to you by libbloom-%s\0A\00"
define i32 @basic_tests() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i64 (...) @basic()
%3 = load i32, i32* %1
%4 = sext i32 %3 to i64
%5 = add nsw i64 %4, %2
%6 = trunc i64 %5 to i32
store i32 %6, i32* %1
%7 = call i64 @add_random(i32 5002, double 1.000000e-02, i32 5000, i32 0, i32 1, i32 32, i32 1)
%8 = load i32, i32* %1
%9 = sext i32 %8 to i64
%10 = add nsw i64 %9, %7
%11 = trunc i64 %10 to i32
store i32 %11, i32* %1
%12 = call i64 @add_random(i32 10000, double 1.000000e-01, i32 10000, i32 0, i32 1, i32 32, i32 1)
%13 = load i32, i32* %1
%14 = sext i32 %13 to i64
%15 = add nsw i64 %14, %12
%16 = trunc i64 %15 to i32
store i32 %16, i32* %1
%17 = call i64 @add_random(i32 10000, double 1.000000e-02, i32 10000, i32 0, i32 1, i32 32, i32 1)
%18 = load i32, i32* %1
%19 = sext i32 %18 to i64
%20 = add nsw i64 %19, %17
%21 = trunc i64 %20 to i32
store i32 %21, i32* %1
%22 = call i64 @add_random(i32 10000, double 1.000000e-03, i32 10000, i32 0, i32 1, i32 32, i32 1)
%23 = load i32, i32* %1
%24 = sext i32 %23 to i64
%25 = add nsw i64 %24, %22
%26 = trunc i64 %25 to i32
store i32 %26, i32* %1
%27 = call i64 @add_random(i32 10000, double 1.000000e-04, i32 10000, i32 0, i32 1, i32 32, i32 1)
%28 = load i32, i32* %1
%29 = sext i32 %28 to i64
%30 = add nsw i64 %29, %27
%31 = trunc i64 %30 to i32
store i32 %31, i32* %1
%32 = call i64 @add_random(i32 1000000, double 1.000000e-04, i32 1000000, i32 0, i32 1, i32 32, i32 1)
%33 = load i32, i32* %1
%34 = sext i32 %33 to i64
%35 = add nsw i64 %34, %32
%36 = trunc i64 %35 to i32
store i32 %36, i32* %1
%37 = call i8* (...) @bloom_version()
%38 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i8* %37)
ret i32 0
}

LLVM IR (-O2):
@.str = [32 x i8] c"\0ABrought to you by libbloom-%s\0A\00"
define i32 @basic_tests() {
%1 = tail call i64 (...) @basic()
%2 = tail call i64 @add_random(i32 5002, double 1.000000e-02, i32 5000, i32 0, i32 1, i32 32, i32 1)
%3 = tail call i64 @add_random(i32 10000, double 1.000000e-01, i32 10000, i32 0, i32 1, i32 32, i32 1)
%4 = tail call i64 @add_random(i32 10000, double 1.000000e-02, i32 10000, i32 0, i32 1, i32 32, i32 1)
%5 = tail call i64 @add_random(i32 10000, double 1.000000e-03, i32 10000, i32 0, i32 1, i32 32, i32 1)
%6 = tail call i64 @add_random(i32 10000, double 1.000000e-04, i32 10000, i32 0, i32 1, i32 32, i32 1)
%7 = tail call i64 @add_random(i32 1000000, double 1.000000e-04, i32 1000000, i32 0, i32 1, i32 32, i32 1)
%8 = tail call i8* (...) @bloom_version()
%9 = tail call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i8* %8)
ret i32 0
}