// File: umatin[P]LogarithmicErrorRegression/benchmark.cpp
// Function: main
int main(int argc, char *argv[]){
    srand(time(NULL));

    std::vector<double> data = parse_arguments(argc, argv);

    std::string data_name = argv[1];
    std::string outfile = "results/benchmark.csv";
    int num_lookups = 1000000;
    
    std::vector<double> lookups;
    lookups.resize(num_lookups);
    for (int i = 0; i < lookups.size(); i++){
        lookups[i] = data[rand()%data.size()];
    }

    benchmark_regression<simple_linear_regression_stable>(data,lookups,"SLR",data_name,outfile);
    benchmark_regression<create_regression_tournament_selection<LogNorm>>(data,lookups,"LogTE",data_name,outfile);
    benchmark_regression<create_regression_tournament_selection<FastDiscreteLogNorm>>(data,lookups,"DLogTE",data_name,outfile);
    benchmark_regression<build_regression_direct_descent>(data,lookups,"2P",data_name,outfile);
    benchmark_regression<theil_sen>(data,lookups,"TheilSen",data_name,outfile);
    benchmark_regression<create_regression_optimal<L1Norm>>(data,lookups,"LAD",data_name,outfile);
}

// Assembly:
subq $0x388, %rsp            # imm = 0x388
movl $0x0, 0x384(%rsp)
movl %edi, 0x380(%rsp)
movq %rsi, 0x378(%rsp)
xorl %eax, %eax
movl %eax, %edi
callq 0x21e0
movl %eax, %edi
callq 0x2200
movl 0x380(%rsp), %esi
movq 0x378(%rsp), %rdx
leaq 0x360(%rsp), %rdi
callq 0x3cd0
movq 0x378(%rsp), %rax
movq 0x8(%rax), %rax
movq %rax, 0x60(%rsp)
leaq 0x33f(%rsp), %rdi
movq %rdi, 0x68(%rsp)
callq 0x23c0
movq 0x60(%rsp), %rsi
movq 0x68(%rsp), %rdx
leaq 0x340(%rsp), %rdi
callq 0x73f0
jmp 0x59b9
leaq 0x33f(%rsp), %rdi
callq 0x2260
leaq 0x307(%rsp), %rdi
movq %rdi, 0x58(%rsp)
callq 0x23c0
movq 0x58(%rsp), %rdx
leaq 0xf7bf(%rip), %rsi      # 0x151a3
leaq 0x308(%rsp), %rdi
callq 0x73f0
jmp 0x59f3
leaq 0x307(%rsp), %rdi
callq 0x2260
movl $0xf4240, 0x300(%rsp) # imm = 0xF4240
leaq 0x2e8(%rsp), %rdi
movq %rdi, 0x50(%rsp)
callq 0x69c0
movq 0x50(%rsp), %rdi
movslq 0x300(%rsp), %rsi
callq 0x74b0
jmp 0x5a31
movl $0x0, 0x2e4(%rsp)
movslq 0x2e4(%rsp), %rax
movq %rax, 0x48(%rsp)
leaq 0x2e8(%rsp), %rdi
callq 0x6400
movq %rax, %rcx
movq 0x48(%rsp), %rax
cmpq %rcx, %rax
jae 0x5b41
callq 0x2080
cltq
movq %rax, 0x38(%rsp)
leaq 0x360(%rsp), %rdi
callq 0x6400
movq %rax, %rcx
movq 0x38(%rsp), %rax
xorl %edx, %edx
divq %rcx
movq %rdx, %rsi
leaq 0x360(%rsp), %rdi
callq 0x6390
vmovsd (%rax), %xmm0
vmovsd %xmm0, 0x40(%rsp)
movslq 0x2e4(%rsp), %rsi
leaq 0x2e8(%rsp), %rdi
callq 0x6390
vmovsd 0x40(%rsp), %xmm0
vmovsd %xmm0, (%rax)
movl 0x2e4(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x2e4(%rsp)
jmp 0x5a3c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x330(%rsp)
movl %eax, 0x32c(%rsp)
leaq 0x33f(%rsp), %rdi
callq 0x2260
jmp 0x6368
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x330(%rsp)
movl %eax, 0x32c(%rsp)
leaq 0x307(%rsp), %rdi
callq 0x2260
jmp 0x635b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x330(%rsp)
movl %eax, 0x32c(%rsp)
jmp 0x6341
leaq 0x2bf(%rsp), %rdi
movq %rdi, 0x30(%rsp)
callq 0x23c0
movq 0x30(%rsp), %rdx
leaq 0xf65a(%rip), %rsi      # 0x151b9
leaq 0x2c0(%rsp), %rdi
callq 0x73f0
jmp 0x5b6e
leaq 0x298(%rsp), %rdi
leaq 0x340(%rsp), %rsi
callq 0x20c0
jmp 0x5b85
leaq 0x278(%rsp), %rdi
leaq 0x308(%rsp), %rsi
callq 0x20c0
jmp 0x5b9c
leaq 0x360(%rsp), %rdi
leaq 0x2e8(%rsp), %rsi
leaq 0x2c0(%rsp), %rdx
leaq 0x298(%rsp), %rcx
leaq 0x278(%rsp), %r8
callq 0x7550
jmp 0x5bcb
leaq 0x278(%rsp), %rdi
callq 0x2120
leaq 0x298(%rsp), %rdi
callq 0x2120
leaq 0x2c0(%rsp), %rdi
callq 0x2120
leaq 0x2bf(%rsp), %rdi
callq 0x2260
leaq 0x257(%rsp), %rdi
movq %rdi, 0x28(%rsp)
callq 0x23c0
movq 0x28(%rsp), %rdx
leaq 0xf5a1(%rip), %rsi      # 0x151be
leaq 0x258(%rsp), %rdi
callq 0x73f0
jmp 0x5c2c
leaq 0x230(%rsp), %rdi
leaq 0x340(%rsp), %rsi
callq 0x20c0
jmp 0x5c43
leaq 0x210(%rsp), %rdi
leaq 0x308(%rsp), %rsi
callq 0x20c0
jmp 0x5c5a
leaq 0x360(%rsp), %rdi
leaq 0x2e8(%rsp), %rsi
leaq 0x258(%rsp), %rdx
leaq 0x230(%rsp), %rcx
leaq 0x210(%rsp), %r8
callq 0x7dd0
jmp 0x5c89
leaq 0x210(%rsp), %rdi
callq 0x2120
leaq 0x230(%rsp), %rdi
callq 0x2120
leaq 0x258(%rsp), %rdi
callq 0x2120
leaq 0x257(%rsp), %rdi
callq 0x2260
leaq 0x1ef(%rsp), %rdi
movq %rdi, 0x20(%rsp)
callq 0x23c0
movq 0x20(%rsp), %rdx
leaq 0xf4e2(%rip), %rsi      # 0x151bd
leaq 0x1f0(%rsp), %rdi
callq 0x73f0
jmp 0x5cea
leaq 0x1c8(%rsp), %rdi
leaq 0x340(%rsp), %rsi
callq 0x20c0
jmp 0x5d01
leaq 0x1a8(%rsp), %rdi
leaq 0x308(%rsp), %rsi
callq 0x20c0
jmp 0x5d18
leaq 0x360(%rsp), %rdi
leaq 0x2e8(%rsp), %rsi
leaq 0x1f0(%rsp), %rdx
leaq 0x1c8(%rsp), %rcx
leaq 0x1a8(%rsp), %r8
callq 0x8650
jmp 0x5d47
leaq 0x1a8(%rsp), %rdi
callq 0x2120
leaq 0x1c8(%rsp), %rdi
callq 0x2120
leaq 0x1f0(%rsp), %rdi
callq 0x2120
leaq 0x1ef(%rsp), %rdi
callq 0x2260
leaq 0x187(%rsp), %rdi
movq %rdi, 0x18(%rsp)
callq 0x23c0
movq 0x18(%rsp), %rdx
leaq 0xf42b(%rip), %rsi      # 0x151c4
leaq 0x188(%rsp), %rdi
callq 0x73f0
jmp 0x5da8
leaq 0x160(%rsp), %rdi
leaq 0x340(%rsp), %rsi
callq 0x20c0
jmp 0x5dbf
leaq 0x140(%rsp), %rdi
leaq 0x308(%rsp), %rsi
callq 0x20c0
jmp 0x5dd6
leaq 0x360(%rsp), %rdi
leaq 0x2e8(%rsp), %rsi
leaq 0x188(%rsp), %rdx
leaq 0x160(%rsp), %rcx
leaq 0x140(%rsp), %r8
callq 0x8ed0
jmp 0x5e05
leaq 0x140(%rsp), %rdi
callq 0x2120
leaq 0x160(%rsp), %rdi
callq 0x2120
leaq 0x188(%rsp), %rdi
callq 0x2120
leaq 0x187(%rsp), %rdi
callq 0x2260
leaq 0x11f(%rsp), %rdi
movq %rdi, 0x10(%rsp)
callq 0x23c0
movq 0x10(%rsp), %rdx
leaq 0xf370(%rip), %rsi      # 0x151c7
leaq 0x120(%rsp), %rdi
callq 0x73f0
jmp 0x5e66
leaq 0xf8(%rsp), %rdi
leaq 0x340(%rsp), %rsi
callq 0x20c0
jmp 0x5e7d
leaq 0xd8(%rsp), %rdi
leaq 0x308(%rsp), %rsi
callq 0x20c0
jmp 0x5e94
leaq 0x360(%rsp), %rdi
leaq 0x2e8(%rsp), %rsi
leaq 0x120(%rsp), %rdx
leaq 0xf8(%rsp), %rcx
leaq 0xd8(%rsp), %r8
callq 0x9750
jmp 0x5ec3
leaq 0xd8(%rsp), %rdi
callq 0x2120
leaq 0xf8(%rsp), %rdi
callq 0x2120
leaq 0x120(%rsp), %rdi
callq 0x2120
leaq 0x11f(%rsp), %rdi
callq 0x2260
leaq 0xb7(%rsp), %rdi
movq %rdi, 0x8(%rsp)
callq 0x23c0
movq 0x8(%rsp), %rdx
leaq 0xf2bb(%rip), %rsi      # 0x151d0
leaq 0xb8(%rsp), %rdi
callq 0x73f0
jmp 0x5f24
leaq 0x90(%rsp), %rdi
leaq 0x340(%rsp), %rsi
callq 0x20c0
jmp 0x5f3b
leaq 0x70(%rsp), %rdi
leaq 0x308(%rsp), %rsi
callq 0x20c0
jmp 0x5f4f
leaq 0x360(%rsp), %rdi
leaq 0x2e8(%rsp), %rsi
leaq 0xb8(%rsp), %rdx
leaq 0x90(%rsp), %rcx
leaq 0x70(%rsp), %r8
callq 0x9fd0
jmp 0x5f7b
leaq 0x70(%rsp), %rdi
callq 0x2120
leaq 0x90(%rsp), %rdi
callq 0x2120
leaq 0xb8(%rsp), %rdi
callq 0x2120
leaq 0xb7(%rsp), %rdi
callq 0x2260
leaq 0x2e8(%rsp), %rdi
callq 0x6560
leaq 0x308(%rsp), %rdi
callq 0x2120
leaq 0x340(%rsp), %rdi
callq 0x2120
leaq 0x360(%rsp), %rdi
callq 0x6560
movl 0x384(%rsp), %eax
addq $0x388, %rsp            # imm = 0x388
retq
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x330(%rsp)
movl %eax, 0x32c(%rsp)
jmp 0x606c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x330(%rsp)
movl %eax, 0x32c(%rsp)
jmp 0x605f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x330(%rsp)
movl %eax, 0x32c(%rsp)
jmp 0x6052
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x330(%rsp)
movl %eax, 0x32c(%rsp)
leaq 0x278(%rsp), %rdi
callq 0x2120
leaq 0x298(%rsp), %rdi
callq 0x2120
leaq 0x2c0(%rsp), %rdi
callq 0x2120
leaq 0x2bf(%rsp), %rdi
callq 0x2260
jmp 0x6341
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x330(%rsp)
movl %eax, 0x32c(%rsp)
jmp 0x60fb
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x330(%rsp)
movl %eax, 0x32c(%rsp)
jmp 0x60ee
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x330(%rsp)
movl %eax, 0x32c(%rsp)
jmp 0x60e1
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x330(%rsp)
movl %eax, 0x32c(%rsp)
leaq 0x210(%rsp), %rdi
callq 0x2120
leaq 0x230(%rsp), %rdi
callq 0x2120
leaq 0x258(%rsp), %rdi
callq 0x2120
leaq 0x257(%rsp), %rdi
callq 0x2260
jmp 0x6341
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x330(%rsp)
movl %eax, 0x32c(%rsp)
jmp 0x618a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x330(%rsp)
movl %eax, 0x32c(%rsp)
jmp 0x617d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x330(%rsp)
movl %eax, 0x32c(%rsp)
jmp 0x6170
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x330(%rsp)
movl %eax, 0x32c(%rsp)
leaq 0x1a8(%rsp), %rdi
callq 0x2120
leaq 0x1c8(%rsp), %rdi
callq 0x2120
leaq 0x1f0(%rsp), %rdi
callq 0x2120
leaq 0x1ef(%rsp), %rdi
callq 0x2260
jmp 0x6341
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x330(%rsp)
movl %eax, 0x32c(%rsp)
jmp 0x6219
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x330(%rsp)
movl %eax, 0x32c(%rsp)
jmp 0x620c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x330(%rsp)
movl %eax, 0x32c(%rsp)
jmp 0x61ff
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x330(%rsp)
movl %eax, 0x32c(%rsp)
leaq 0x140(%rsp), %rdi
callq 0x2120
leaq 0x160(%rsp), %rdi
callq 0x2120
leaq 0x188(%rsp), %rdi
callq 0x2120
leaq 0x187(%rsp), %rdi
callq 0x2260
jmp 0x6341
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x330(%rsp)
movl %eax, 0x32c(%rsp)
jmp 0x62a8
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x330(%rsp)
movl %eax, 0x32c(%rsp)
jmp 0x629b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x330(%rsp)
movl %eax, 0x32c(%rsp)
jmp 0x628e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x330(%rsp)
movl %eax, 0x32c(%rsp)
leaq 0xd8(%rsp), %rdi
callq 0x2120
leaq 0xf8(%rsp), %rdi
callq 0x2120
leaq 0x120(%rsp), %rdi
callq 0x2120
leaq 0x11f(%rsp), %rdi
callq 0x2260
jmp 0x6341
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x330(%rsp)
movl %eax, 0x32c(%rsp)
jmp 0x6334
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x330(%rsp)
movl %eax, 0x32c(%rsp)
jmp 0x6327
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x330(%rsp)
movl %eax, 0x32c(%rsp)
jmp 0x631a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x330(%rsp)
movl %eax, 0x32c(%rsp)
leaq 0x70(%rsp), %rdi
callq 0x2120
leaq 0x90(%rsp), %rdi
callq 0x2120
leaq 0xb8(%rsp), %rdi
callq 0x2120
leaq 0xb7(%rsp), %rdi
callq 0x2260
leaq 0x2e8(%rsp), %rdi
callq 0x6560
leaq 0x308(%rsp), %rdi
callq 0x2120
leaq 0x340(%rsp), %rdi
callq 0x2120
leaq 0x360(%rsp), %rdi
callq 0x6560
movq 0x330(%rsp), %rdi
callq 0x23b0
nopw %cs:(%rax,%rax)
nopl (%rax)