// File: /workspace/github_cpp_makefile_star2_O2/umatin[P]LogarithmicErrorRegression/./src/helpers/io_handler.h
// Function: parse_arguments(int, char**)
std::vector<double> parse_arguments(int argc, char *argv[]){
    if(argc < 3){
        std::cout << "Specify Dataset and Size" << std::endl;
        std::cout << "Available option are:" << std::endl;
        std::cout << "path_to_dataset" << std::endl;
        std::cout << "rand" << std::endl;
        std::cout << "normal" << std::endl;
        std::cout << "lognormal" << std::endl;
        std::cout << "randint" << std::endl;
        std::cout << "debug" << std::endl;
        std::cout << "exp" << std::endl;
        std::cout << "outlier" << std::endl;
        exit(0);
    }
    
    long num_data = strtol(argv[2], nullptr, 0);
    std::vector<double> data;

    std::random_device rd;
    std::mt19937 gen(rd());
    
    if(strcmp(argv[1],"rand") == 0){
        std::uniform_real_distribution<double> dis(0, 2147483647);
        for (long i = 0; i < num_data; i++){
            data.push_back(dis(gen));
        }
    }
    else if(strcmp(argv[1],"normal") == 0){
        std::normal_distribution<double> dis(0.0,4.0);
        for (long i = 0; i < num_data; i++){
            data.push_back(dis(gen));
        }
    }
    else if(strcmp(argv[1],"lognormal") == 0){
        std::lognormal_distribution<double> dis(0.0, 4.0);
        for (long i = 0; i < num_data; i++){
            data.push_back(dis(gen));
        }
    }
    else if(strcmp(argv[1],"randint") == 0){
        for (long i = 0; i < num_data; i++){
            long val = rand();
            data.push_back(val);
        }
    }
    else if(strcmp(argv[1],"debug") == 0){
        for (long i = 0; i < num_data; i++){
            long val = rand()%30;
            data.push_back(val);
        }
    }
    else if(strcmp(argv[1],"randfixed") == 0){
        for (long i = 0; i < num_data; i++){
            std::uniform_real_distribution<double> dis(0, 10000);
            data.push_back(dis(gen));
        }
    }
    else if(strcmp(argv[1],"exp") == 0){
        for (long i = 0; i < num_data; i++){
            long val = std::pow(2,i);
            data.push_back(val);
        }
    }
    else if(strcmp(argv[1],"manual") == 0){
        for (long i = 2; i < argc; i++){
            data.push_back(strtol(argv[i], nullptr, 0));
        }
        std::cout << data.size() << std::endl;
        std::sort(data.begin(), data.end());
        return data;
    }
    else if(strcmp(argv[1],"outlier") == 0){
        int num_outliers = 1;
        for (long i = 0; i < num_data - num_outliers; i++){
            std::uniform_real_distribution<double> dis(0, 100000);
            data.push_back(dis(gen));
        }
        for (long i = 0; i < num_outliers; i++){
            std::uniform_real_distribution<double> dis(200000000000000, 300000000000000);
            data.push_back(dis(gen));
        }
    }
    else{
        if (cache_data.size() == 0){
            std::cout << argv[1] << "\n";
            cache_data = load_data<u_int64_t>(argv[1]);
        }

        data.reserve(num_data);
        std::uniform_int_distribution<long> dis(0, std::max<long>((long)cache_data.size()-1-num_data, 0));
        int start = dis(gen);
        for(long i = 0; cache_data[i] < LONG_MAX && i < num_data && i < cache_data.size(); i++){
            data.push_back((double)cache_data[start+i]);
        }
    }
    std::sort(data.begin(), data.end());
    //data.erase( unique( data.begin(), data.end() ), data.end() );
    //std::sort(data.begin(), data.end());
    return data;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x2978, %rsp           # imm = 0x2978
cmpl $0x2, %esi
jle 0x32ef
movq %rdi, %rbx
movq 0x10(%rdx), %rdi
movq %rdx, %r15
movl %esi, %ebp
xorl %esi, %esi
xorl %edx, %edx
callq 0x2280
andq $0x0, 0x10(%rbx)
vxorpd %xmm0, %xmm0, %xmm0
movq %rax, %r14
vmovupd %xmm0, (%rbx)
leaq 0x15f0(%rsp), %rdi
callq 0x40f6
leaq 0x15f0(%rsp), %rdi
callq 0x2260
movl %eax, %esi
leaq 0x268(%rsp), %rdi
callq 0x6690
movq 0x8(%r15), %r12
leaq 0x6490(%rip), %rsi      # 0x91bb
movq %r12, %rdi
callq 0x2270
testl %eax, %eax
je 0x2f98
leaq 0x6481(%rip), %rsi      # 0x91c3
movq %r12, %rdi
callq 0x2270
testl %eax, %eax
je 0x2fef
leaq 0x6467(%rip), %rsi      # 0x91c0
movq %r12, %rdi
callq 0x2270
testl %eax, %eax
je 0x3050
leaq 0x645a(%rip), %rsi      # 0x91ca
movq %r12, %rdi
callq 0x2270
testl %eax, %eax
je 0x30b0
leaq 0x644b(%rip), %rsi      # 0x91d2
movq %r12, %rdi
callq 0x2270
testl %eax, %eax
je 0x30e7
leaq 0x6446(%rip), %rsi      # 0x91e4
movq %r12, %rdi
callq 0x2270
testl %eax, %eax
je 0x3124
leaq 0x6423(%rip), %rsi      # 0x91d8
movq %r12, %rdi
callq 0x2270
testl %eax, %eax
je 0x3188
leaq 0x6422(%rip), %rsi      # 0x91ee
movq %r12, %rdi
callq 0x2270
testl %eax, %eax
je 0x31cf
leaq 0x63f9(%rip), %rsi      # 0x91dc
movq %r12, %rdi
callq 0x2270
testl %eax, %eax
je 0x322c
movq 0xa40e(%rip), %rax      # 0xd208
cmpq 0xa3ff(%rip), %rax      # 0xd200
jne 0x2ee2
movq 0xa1c2(%rip), %rdi      # 0xcfd0
movq %r12, %rsi
callq 0x2200
leaq 0x63d8(%rip), %rsi      # 0x91f5
movq %rax, %rdi
callq 0x2200
movq 0x8(%r15), %rsi
leaq 0x8(%rsp), %rdi
leaq 0x60(%rsp), %rdx
callq 0x4326
andq $0x0, 0x50(%rsp)
vxorpd %xmm0, %xmm0, %xmm0
vmovapd %xmm0, 0x40(%rsp)
leaq 0x60(%rsp), %rdi
leaq 0x8(%rsp), %rsi
pushq $0x4
popq %rdx
callq 0x22f0
leaq 0xd8(%rsp), %rdi
callq 0x2050
testb %al, %al
je 0x33e3
leaq 0x60(%rsp), %rdi
leaq 0x28(%rsp), %rsi
pushq $0x8
popq %rdx
callq 0x2240
movq 0x28(%rsp), %rsi
leaq 0x40(%rsp), %rdi
callq 0x6ffa
movq 0x28(%rsp), %rdx
movq 0x40(%rsp), %rsi
shlq $0x3, %rdx
leaq 0x60(%rsp), %rdi
callq 0x2240
leaq 0x60(%rsp), %rdi
callq 0x2040
leaq 0x60(%rsp), %rdi
callq 0x2060
leaq 0x8(%rsp), %rdi
callq 0x20c0
leaq 0x40(%rsp), %r15
leaq 0xa32e(%rip), %rdi      # 0xd200
movq %r15, %rsi
callq 0x71e0
movq %r15, %rdi
callq 0x665c
movq %rbx, %rdi
movq %r14, %rsi
callq 0x4164
movq 0xa314(%rip), %rax      # 0xd208
leaq 0x60(%rsp), %rdi
movq %r14, %rcx
notq %rcx
subq 0xa2fa(%rip), %rax      # 0xd200
andq $0x0, (%rdi)
sarq $0x3, %rax
addq %rax, %rcx
movq %rcx, %rax
sarq $0x3f, %rax
andnq %rcx, %rax, %rax
movq %rax, 0x8(%rdi)
leaq 0x268(%rsp), %rsi
callq 0x41fa
movslq %eax, %r12
movabsq $0x7ffffffffffffffe, %rbp # imm = 0x7FFFFFFFFFFFFFFE
leaq 0x8(%rsp), %r15
xorl %r13d, %r13d
shlq $0x3, %r12
movq 0xa2b2(%rip), %rax      # 0xd200
cmpq %rbp, (%rax,%r13,8)
ja 0x32be
cmpq %r14, %r13
jge 0x32be
movq 0xa2a0(%rip), %rcx      # 0xd208
subq %rax, %rcx
sarq $0x3, %rcx
cmpq %rcx, %r13
jae 0x32be
addq %r12, %rax
vcvtusi2sdq (%rax,%r13,8), %xmm1, %xmm0
vmovsd %xmm0, 0x8(%rsp)
movq %rbx, %rdi
movq %r15, %rsi
callq 0x6936
incq %r13
jmp 0x2f47
vxorpd %xmm0, %xmm0, %xmm0
vmovhpd 0x6094(%rip), %xmm0, %xmm0 # xmm0 = xmm0[0],mem[0]
movq %r14, %rax
sarq $0x3f, %rax
leaq 0x60(%rsp), %r15
leaq 0x8(%rsp), %r12
andnq %r14, %rax, %r13
leaq 0x268(%rsp), %r14
vmovapd %xmm0, (%r15)
subq $0x1, %r13
jb 0x32be
movq %r15, %rdi
movq %r14, %rsi
callq 0x414c
vmovsd %xmm0, 0x8(%rsp)
movq %rbx, %rdi
movq %r12, %rsi
callq 0x6936
jmp 0x2fc7
vxorpd %xmm0, %xmm0, %xmm0
vmovhpd 0x6035(%rip), %xmm0, %xmm0 # xmm0 = xmm0[0],mem[0]
leaq 0x60(%rsp), %r15
movq %r14, %rax
sarq $0x3f, %rax
leaq 0x8(%rsp), %r12
andnq %r14, %rax, %r13
leaq 0x268(%rsp), %r14
vmovapd %xmm0, (%r15)
andq $0x0, 0x10(%r15)
movb $0x0, 0x18(%r15)
subq $0x1, %r13
jb 0x32be
movq %r15, %rdi
movq %r14, %rsi
callq 0x4154
vmovsd %xmm0, 0x8(%rsp)
movq %rbx, %rdi
movq %r12, %rsi
callq 0x6936
jmp 0x3028
vmovapd 0x6048(%rip), %ymm0     # 0x90a0
leaq 0x60(%rsp), %r15
movq %r14, %rax
sarq $0x3f, %rax
leaq 0x8(%rsp), %r12
andnq %r14, %rax, %r13
leaq 0x268(%rsp), %r14
vmovupd %ymm0, (%r15)
andq $0x0, 0x20(%r15)
movb $0x0, 0x28(%r15)
subq $0x1, %r13
jb 0x32be
movq %r15, %rdi
movq %r14, %rsi
vzeroupper
callq 0x415c
vmovsd %xmm0, 0x8(%rsp)
movq %rbx, %rdi
movq %r12, %rsi
callq 0x6936
jmp 0x3085
movq %r14, %rax
sarq $0x3f, %rax
andnq %r14, %rax, %r15
leaq 0x60(%rsp), %r14
subq $0x1, %r15
jb 0x32be
callq 0x2070
vcvtsi2sd %eax, %xmm1, %xmm0
vmovsd %xmm0, 0x60(%rsp)
movq %rbx, %rdi
movq %r14, %rsi
callq 0x6936
jmp 0x30c1
movq %r14, %rax
sarq $0x3f, %rax
andnq %r14, %rax, %r15
pushq $0x1e
popq %rbp
leaq 0x60(%rsp), %r14
subq $0x1, %r15
jb 0x32be
callq 0x2070
cltd
idivl %ebp
vcvtsi2sd %edx, %xmm1, %xmm0
vmovsd %xmm0, 0x60(%rsp)
movq %rbx, %rdi
movq %r14, %rsi
callq 0x6936
jmp 0x30fb
vxorpd %xmm0, %xmm0, %xmm0
vmovhpd 0x5ef8(%rip), %xmm0, %xmm0 # xmm0 = xmm0[0],mem[0]
movq %r14, %rax
sarq $0x3f, %rax
leaq 0x268(%rsp), %r15
leaq 0x8(%rsp), %r12
andnq %r14, %rax, %r13
leaq 0x60(%rsp), %r14
vmovapd %xmm0, 0x30(%rsp)
subq $0x1, %r13
jb 0x32be
vmovapd 0x30(%rsp), %xmm0
vmovapd %xmm0, 0x60(%rsp)
movq %r14, %rdi
movq %r15, %rsi
callq 0x414c
vmovsd %xmm0, 0x8(%rsp)
movq %rbx, %rdi
movq %r12, %rsi
callq 0x6936
jmp 0x3154
movq %r14, %rax
sarq $0x3f, %rax
xorl %r12d, %r12d
andnq %r14, %rax, %r15
leaq 0x60(%rsp), %r14
cmpq %r12, %r15
je 0x32be
vcvtsi2sd %r12, %xmm1, %xmm0
callq 0x21b0
vcvttsd2si %xmm0, %rax
vcvtsi2sd %rax, %xmm1, %xmm0
vmovsd %xmm0, 0x60(%rsp)
movq %rbx, %rdi
movq %r14, %rsi
callq 0x6936
incq %r12
jmp 0x319c
movl %ebp, %r12d
pushq $0x2
popq %r13
leaq 0x60(%rsp), %r14
cmpq %r13, %r12
je 0x3208
movq (%r15,%r13,8), %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x2280
vcvtsi2sd %rax, %xmm1, %xmm0
vmovsd %xmm0, 0x60(%rsp)
movq %rbx, %rdi
movq %r14, %rsi
callq 0x6936
incq %r13
jmp 0x31db
movq 0x8(%rbx), %rsi
subq (%rbx), %rsi
sarq $0x3, %rsi
movq 0x9db6(%rip), %rdi      # 0xcfd0
callq 0x2120
movq %rax, %rdi
callq 0x20e0
jmp 0x32be
cmpq $0x2, %r14
pushq $0x1
popq %r13
vxorpd %xmm0, %xmm0, %xmm0
vmovhpd 0x5de0(%rip), %xmm0, %xmm0 # xmm0 = xmm0[0],mem[0]
cmovgeq %r14, %r13
leaq 0x60(%rsp), %r14
leaq 0x268(%rsp), %r15
leaq 0x8(%rsp), %r12
decq %r13
vmovapd %xmm0, 0x30(%rsp)
subq $0x1, %r13
jb 0x328f
vmovapd 0x30(%rsp), %xmm0
vmovapd %xmm0, 0x60(%rsp)
movq %r14, %rdi
movq %r15, %rsi
callq 0x414c
vmovsd %xmm0, 0x8(%rsp)
movq %rbx, %rdi
movq %r12, %rsi
callq 0x6936
jmp 0x325f
vmovapd 0x5de9(%rip), %xmm0     # 0x9080
leaq 0x60(%rsp), %rdi
vmovapd %xmm0, (%rdi)
leaq 0x268(%rsp), %rsi
callq 0x414c
leaq 0x8(%rsp), %rsi
vmovsd %xmm0, (%rsi)
movq %rbx, %rdi
callq 0x6936
movq (%rbx), %rdi
movq 0x8(%rbx), %rsi
vzeroupper
callq 0x6b99
leaq 0x15f0(%rsp), %rdi
callq 0x4202
movq %rbx, %rax
addq $0x2978, %rsp           # imm = 0x2978
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x9cda(%rip), %rbx      # 0xcfd0
leaq 0x5e7f(%rip), %rsi      # 0x917c
movq %rbx, %rdi
callq 0x2200
movq %rax, %rdi
callq 0x20e0
leaq 0x5e81(%rip), %rsi      # 0x9195
movq %rbx, %rdi
callq 0x2200
movq %rax, %rdi
callq 0x20e0
leaq 0x5e80(%rip), %rsi      # 0x91ab
movq %rbx, %rdi
callq 0x2200
movq %rax, %rdi
callq 0x20e0
leaq 0x5e79(%rip), %rsi      # 0x91bb
movq %rbx, %rdi
callq 0x2200
movq %rax, %rdi
callq 0x20e0
leaq 0x5e6a(%rip), %rsi      # 0x91c3
movq %rbx, %rdi
callq 0x2200
movq %rax, %rdi
callq 0x20e0
leaq 0x5e50(%rip), %rsi      # 0x91c0
movq %rbx, %rdi
callq 0x2200
movq %rax, %rdi
callq 0x20e0
leaq 0x5e43(%rip), %rsi      # 0x91ca
movq %rbx, %rdi
callq 0x2200
movq %rax, %rdi
callq 0x20e0
leaq 0x5e34(%rip), %rsi      # 0x91d2
movq %rbx, %rdi
callq 0x2200
movq %rax, %rdi
callq 0x20e0
leaq 0x5e23(%rip), %rsi      # 0x91d8
movq %rbx, %rdi
callq 0x2200
movq %rax, %rdi
callq 0x20e0
leaq 0x5e10(%rip), %rsi      # 0x91dc
movq %rbx, %rdi
callq 0x2200
movq %rax, %rdi
callq 0x20e0
xorl %edi, %edi
callq 0x2230
movq 0x9c06(%rip), %rdi      # 0xcff0
leaq 0x5e83(%rip), %rsi      # 0x9274
callq 0x2200
leaq 0x8(%rsp), %rsi
movq %rax, %rdi
callq 0x21a0
movq %rax, %rdi
callq 0x20e0
pushq $0x1
popq %rdi
callq 0x2230
jmp 0x3420
movq %rax, %r14
jmp 0x342d
jmp 0x345c
jmp 0x345c
jmp 0x345c
leaq 0x60(%rsp), %rdi
movq %rax, %r14
callq 0x2060
leaq 0x40(%rsp), %rdi
callq 0x665c
leaq 0x8(%rsp), %rdi
callq 0x20c0
jmp 0x345f
jmp 0x345c
jmp 0x345c
jmp 0x345c
jmp 0x345c
movq %rax, %r14
jmp 0x346c
jmp 0x345c
jmp 0x345c
jmp 0x345c
jmp 0x345c
jmp 0x345c
jmp 0x345c
movq %rax, %r14
leaq 0x15f0(%rsp), %rdi
callq 0x4202
movq %rbx, %rdi
callq 0x6034
movq %r14, %rdi
callq 0x2340