#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*/ add_and_test(int, double, int, int /*<<< orphan*/);
double atof(char *);
int atoi(char *);
int /*<<< orphan*/ basic();
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ strncmp(char *, char *, int);
int main(int argc, char **argv) {
  if (argc == 1) {
    basic();
    exit(0);
  }
  if (!strncmp(argv[1], "-E", 2)) {
    if (argc != 4) {
      printf("-E COUNT ERROR\n");
      printf("Will do runs adding COUNT elements into bloom filter.\n");
      printf("Initial bloom filter size is COUNT, then increasing.\n");
      printf("Will run until stopped...\n");
      exit(0);
    }
    int count = atoi(argv[2]);
    double error = atof(argv[3]);
    int capacity = count;
    while (1) {
      add_and_test(capacity, error, count, 0);
      capacity += 1;
    }
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x1,-0x4(%rbp)
jne    1197 <main+0x27>
mov    $0x0,%al
call   1090 <basic@plt>
xor    %edi,%edi
call   1080 <exit@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xe5a(%rip),%rsi
mov    $0x2,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%eax
jne    1245 <main+0xd5>
cmpl   $0x4,-0x4(%rbp)
je     11fa <main+0x8a>
lea    0xe39(%rip),%rdi
call   1050 <printf@plt>
lea    0xe3d(%rip),%rdi
call   1050 <printf@plt>
lea    0xe68(%rip),%rdi
call   1050 <printf@plt>
lea    0xe92(%rip),%rdi
call   1050 <printf@plt>
xor    %edi,%edi
call   1080 <exit@plt>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
call   1070 <atoi@plt>
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rdi
call   1040 <atof@plt>
movsd  %xmm0,-0x20(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x24(%rbp)
mov    -0x24(%rbp),%edi
movsd  -0x20(%rbp),%xmm0
mov    -0x14(%rbp),%esi
xor    %edx,%edx
call   1060 <add_and_test@plt>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x28(%rbp)
mov    %eax,-0x24(%rbp)
jmp    1222 <main+0xb2>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
cmp    $0x1,%edi
je     11d5 <main+0x65>
mov    %rsi,%rbx
mov    %edi,%ebp
mov    0x8(%rsi),%rdi
lea    0xe78(%rip),%rsi
mov    $0x2,%edx
call   1030 <strncmp@plt>
test   %eax,%eax
je     119f <main+0x2f>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret
cmp    $0x4,%ebp
jne    11e3 <main+0x73>
mov    0x10(%rbx),%rdi
call   1070 <atoi@plt>
mov    %eax,%ebp
mov    0x18(%rbx),%rdi
call   1050 <atof@plt>
movsd  %xmm0,(%rsp)
mov    %ebp,%ebx
nop
mov    %ebx,%edi
movsd  (%rsp),%xmm0
mov    %ebp,%esi
xor    %edx,%edx
call   1060 <add_and_test@plt>
add    $0x1,%ebx
jmp    11c0 <main+0x50>
xor    %eax,%eax
call   1090 <basic@plt>
xor    %edi,%edi
call   1080 <exit@plt>
lea    0xe19(%rip),%rdi
call   1040 <puts@plt>
lea    0xe1c(%rip),%rdi
call   1040 <puts@plt>
lea    0xe46(%rip),%rdi
call   1040 <puts@plt>
lea    0xe6f(%rip),%rdi
call   1040 <puts@plt>
xor    %edi,%edi
call   1080 <exit@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"-E\00"
@.str.1 = [16 x i8] c"-E COUNT ERROR\0A\00"
@.str.2 = [55 x i8] c"Will do runs adding COUNT elements into bloom filter.\0A\00"
@.str.3 = [54 x i8] c"Initial bloom filter size is COUNT, then increasing.\0A\00"
@.str.4 = [27 x i8] c"Will run until stopped...\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
%5 = alloca i32
%6 = alloca double
%7 = alloca i32
store i32 %0, i32* %3
store i8** %1, i8*** %4
%8 = load i32, i32* %3
%9 = icmp eq i32 %8, 1
br i1 %9, label %10, label %13
10: ; preds = %2
%11 = call i32 (...) @basic()
%12 = call i32 @exit(i32 0)
unreachable
13: ; preds = %2
%14 = load i8**, i8*** %4
%15 = getelementptr inbounds i8*, i8** %14, i64 1
%16 = load i8*, i8** %15
%17 = call i32 @strncmp(i8* %16, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 2)
%18 = icmp ne i32 %17, 0
br i1 %18, label %45, label %19
19: ; preds = %13
%20 = load i32, i32* %3
%21 = icmp ne i32 %20, 4
br i1 %21, label %22, label %28
22: ; preds = %19
%23 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0))
%24 = call i32 @printf(i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str.2, i64 0, i64 0))
%25 = call i32 @printf(i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str.3, i64 0, i64 0))
%26 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.4, i64 0, i64 0))
%27 = call i32 @exit(i32 0)
unreachable
28: ; preds = %19
%29 = load i8**, i8*** %4
%30 = getelementptr inbounds i8*, i8** %29, i64 2
%31 = load i8*, i8** %30
%32 = call i32 @atoi(i8* %31)
store i32 %32, i32* %5
%33 = load i8**, i8*** %4
%34 = getelementptr inbounds i8*, i8** %33, i64 3
%35 = load i8*, i8** %34
%36 = call double @atof(i8* %35)
store double %36, double* %6
%37 = load i32, i32* %5
store i32 %37, i32* %7
br label %38
38: ; preds = %28, %38
%39 = load i32, i32* %7
%40 = load double, double* %6
%41 = load i32, i32* %5
%42 = call i32 @add_and_test(i32 %39, double %40, i32 %41, i32 0)
%43 = load i32, i32* %7
%44 = add nsw i32 %43, 1
store i32 %44, i32* %7
br label %38
45: ; preds = %13
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"-E\00"
@str = [15 x i8] c"-E COUNT ERROR\00"
@str.5 = [54 x i8] c"Will do runs adding COUNT elements into bloom filter.\00"
@str.6 = [53 x i8] c"Initial bloom filter size is COUNT, then increasing.\00"
@str.7 = [26 x i8] c"Will run until stopped...\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp eq i32 %0, 1
br i1 %3, label %4, label %7
4: ; preds = %2
%5 = tail call i32 (...) @basic()
%6 = tail call i32 @exit(i32 0)
unreachable
7: ; preds = %2
%8 = getelementptr inbounds i8*, i8** %1, i64 1
%9 = load i8*, i8** %8
%10 = tail call i32 @strncmp(i8* %9, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 2)
%11 = icmp eq i32 %10, 0
br i1 %11, label %12, label %31
12: ; preds = %7
%13 = icmp eq i32 %0, 4
br i1 %13, label %20, label %14
14: ; preds = %12
%15 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str, i64 0, i64 0))
%16 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([54 x i8], [54 x i8]* @str.5, i64 0, i64 0))
%17 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([53 x i8], [53 x i8]* @str.6, i64 0, i64 0))
%18 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @str.7, i64 0, i64 0))
%19 = tail call i32 @exit(i32 0)
unreachable
20: ; preds = %12
%21 = getelementptr inbounds i8*, i8** %1, i64 2
%22 = load i8*, i8** %21
%23 = tail call i32 @atoi(i8* %22)
%24 = getelementptr inbounds i8*, i8** %1, i64 3
%25 = load i8*, i8** %24
%26 = tail call double @atof(i8* %25)
br label %27
27: ; preds = %27, %20
%28 = phi i32 [ %23, %20 ], [ %30, %27 ]
%29 = tail call i32 @add_and_test(i32 %28, double %26, i32 %23, i32 0)
%30 = add nsw i32 %28, 1
br label %27
31: ; preds = %7
ret i32 0
}