#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 PATH_MAX;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ getOpts(int, char **, int *, char *, char *);
int /*<<< orphan*/ launchJobs(char *, char *, char **, int);
int /*<<< orphan*/ printf(char *, int, int, int, int, char *, int, int, char *);
int main(int argc, char *argv[], char *envp[]) {
  int verbose = 0;
  char filename[PATH_MAX];
  char outputFolder[PATH_MAX];
  getOpts(argc, argv, &verbose, filename, outputFolder);
  if (verbose > 1)
    printf("Parameters set on build time:\n"
           "MAX_JOBS=[%d]\n"
           "BUFSIZE=[%d]\n"
           "MAX_ARGS=[%d]\n"
           "MAX_ALIAS_LEN=[%d]\n"
           "DEFAULT_FOLDER=[%s]\n"
           "SLEEP_TIME_US=[%d]\n"
           "US_TO_SHOW_ON_DEBUG=[%d]\n"
           "RESULTS_BASENAME=[%s]\n",
           1024, 1024, 100, 50, "/tmp", 1000, 1000000, "bgrunner.results.csv");
  launchJobs(filename, outputFolder, envp, verbose);
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    0x2e88(%rip),%rax
mov    (%rax),%ecx
mov    %ecx,%edx
mov    %rsp,%rcx
mov    %rcx,-0x28(%rbp)
mov    %rdx,%rsi
add    $0xf,%rsi
and    $0xfffffffffffffff0,%rsi
mov    %rsp,%rcx
sub    %rsi,%rcx
mov    %rcx,-0x48(%rbp)
mov    %rcx,%rsp
mov    %rdx,-0x30(%rbp)
mov    (%rax),%eax
mov    %rax,%rdx
add    $0xf,%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%r8
sub    %rdx,%r8
mov    %r8,-0x40(%rbp)
mov    %r8,%rsp
mov    %rax,-0x38(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
lea    -0x1c(%rbp),%rdx
call   1030 <getOpts@plt>
cmpl   $0x1,-0x1c(%rbp)
jle    120f <main+0xcf>
lea    0xe32(%rip),%rdi
mov    $0x400,%edx
mov    $0x64,%ecx
mov    $0x32,%r8d
lea    0xecc(%rip),%r9
lea    0xeca(%rip),%rax
sub    $0x20,%rsp
mov    %edx,%esi
movl   $0x3e8,(%rsp)
movl   $0xf4240,0x8(%rsp)
mov    %rax,0x10(%rsp)
call   1040 <printf@plt>
add    $0x20,%rsp
mov    -0x40(%rbp),%rsi
mov    -0x48(%rbp),%rdi
mov    -0x18(%rbp),%rdx
mov    -0x1c(%rbp),%ecx
call   1050 <launchJobs@plt>
xor    %edi,%edi
call   1060 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rbp
mov    %rsp,%rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rdx,%r14
movl   $0x0,-0x1c(%rbp)
mov    0x2e95(%rip),%rax
mov    (%rax),%eax
mov    %rsp,%r15
add    $0xf,%rax
and    $0xfffffffffffffff0,%rax
sub    %rax,%r15
mov    %r15,%rsp
mov    %rsp,%rbx
sub    %rax,%rbx
mov    %rbx,%rsp
lea    -0x1c(%rbp),%rdx
mov    %r15,%rcx
mov    %rbx,%r8
call   1030 <getOpts@plt>
mov    -0x1c(%rbp),%ecx
cmp    $0x2,%ecx
jl     11d3 <main+0x93>
sub    $0x8,%rsp
lea    0xf1d(%rip),%rax
lea    0xe60(%rip),%rdi
lea    0xf0a(%rip),%r9
mov    $0x400,%esi
mov    $0x400,%edx
mov    $0x64,%ecx
mov    $0x32,%r8d
push   %rax
push   $0xf4240
push   $0x3e8
call   1040 <printf@plt>
add    $0x20,%rsp
mov    -0x1c(%rbp),%ecx
mov    %r15,%rdi
mov    %rbx,%rsi
mov    %r14,%rdx
call   1050 <launchJobs@plt>
xor    %edi,%edi
call   1060 <exit@plt>

LLVM IR (-O0):
@PATH_MAX = global i32 0
@.str = [177 x i8] c"Parameters set on build time:\0AMAX_JOBS=[%d]\0ABUFSIZE=[%d]\0AMAX_ARGS=[%d]\0AMAX_ALIAS_LEN=[%d]\0ADEFAULT_FOLDER=[%s]\0ASLEEP_TIME_US=[%d]\0AUS_TO_SHOW_ON_DEBUG=[%d]\0ARESULTS_BASENAME=[%s]\0A\00"
@.str.1 = [5 x i8] c"/tmp\00"
@.str.2 = [21 x i8] c"bgrunner.results.csv\00"
define i32 @main(i32 %0, i8** %1, i8** %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8**
%7 = alloca i8**
%8 = alloca i32
%9 = alloca i8*
%10 = alloca i64
%11 = alloca i64
store i32 0, i32* %4
store i32 %0, i32* %5
store i8** %1, i8*** %6
store i8** %2, i8*** %7
store i32 0, i32* %8
%12 = load i32, i32* @PATH_MAX
%13 = zext i32 %12 to i64
%14 = call i8* @llvm.stacksave()
store i8* %14, i8** %9
%15 = alloca i8, i64 %13
store i64 %13, i64* %10
%16 = load i32, i32* @PATH_MAX
%17 = zext i32 %16 to i64
%18 = alloca i8, i64 %17
store i64 %17, i64* %11
%19 = load i32, i32* %5
%20 = load i8**, i8*** %6
%21 = call i32 @getOpts(i32 %19, i8** %20, i32* %8, i8* %15, i8* %18)
%22 = load i32, i32* %8
%23 = icmp sgt i32 %22, 1
br i1 %23, label %24, label %26
24: ; preds = %3
%25 = call i32 @printf(i8* getelementptr inbounds ([177 x i8], [177 x i8]* @.str, i64 0, i64 0), i32 1024, i32 1024, i32 100, i32 50, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 1000, i32 1000000, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.2, i64 0, i64 0))
br label %26
26: ; preds = %24, %3
%27 = load i8**, i8*** %7
%28 = load i32, i32* %8
%29 = call i32 @launchJobs(i8* %15, i8* %18, i8** %27, i32 %28)
%30 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@PATH_MAX = global i32 0
@.str = [177 x i8] c"Parameters set on build time:\0AMAX_JOBS=[%d]\0ABUFSIZE=[%d]\0AMAX_ARGS=[%d]\0AMAX_ALIAS_LEN=[%d]\0ADEFAULT_FOLDER=[%s]\0ASLEEP_TIME_US=[%d]\0AUS_TO_SHOW_ON_DEBUG=[%d]\0ARESULTS_BASENAME=[%s]\0A\00"
@.str.1 = [5 x i8] c"/tmp\00"
@.str.2 = [21 x i8] c"bgrunner.results.csv\00"
define i32 @main(i32 %0, i8** %1, i8** %2) {
%4 = alloca i32
%5 = bitcast i32* %4 to i8*
store i32 0, i32* %4
%6 = load i32, i32* @PATH_MAX
%7 = zext i32 %6 to i64
%8 = alloca i8, i64 %7
%9 = alloca i8, i64 %7
%10 = call i32 @getOpts(i32 %0, i8** %1, i32* %4, i8* %8, i8* %9)
%11 = load i32, i32* %4
%12 = icmp sgt i32 %11, 1
br i1 %12, label %13, label %16
13: ; preds = %3
%14 = call i32 @printf(i8* getelementptr inbounds ([177 x i8], [177 x i8]* @.str, i64 0, i64 0), i32 1024, i32 1024, i32 100, i32 50, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 1000, i32 1000000, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.2, i64 0, i64 0))
%15 = load i32, i32* %4
br label %16
16: ; preds = %13, %3
%17 = phi i32 [ %15, %13 ], [ %11, %3 ]
%18 = call i32 @launchJobs(i8* %8, i8* %9, i8** %2, i32 %17)
%19 = call i32 @exit(i32 0)
unreachable
}