// File: /workspace/github_cpp_makefile_star2_O2/millanek[P]evo/process_vcf_stats_testing.cpp
// Function: statsTestingMain(int, char**)
int statsTestingMain(int argc, char** argv) {
    parseStatsTestingOptions(argc, argv);
    // Open connections to read from the vcf and reference genome files
    std::ifstream* inFile = new std::ifstream(opt::inputFile.c_str());
    
    std::vector<double> vc;
    
    std::string line;
    while (getline(*inFile, line)) {
        vc.push_back(convertToDouble(line));
    }
    
    std::cout << "Standard deviation1: " << std_dev(vc) << std::endl;
    
    std::vector<double> vc2;
    if (opt::secondFile != "") {
        std::ifstream* sFile = new std::ifstream(opt::secondFile.c_str());
        while (getline(*sFile, line)) {
            vc2.push_back(convertToDouble(line));
        }
        
        //std::cout << "two sample t-statistic (d = 0): " << two_sample_t(vc, vc2) << std::endl;
        std::cout << "two sample p-value (d != 0): " << two_sample_t(vc, vc2) << std::endl;
        std::cout << "two sample p-value (d > 0.001): " << two_sample_t(vc, vc2, 0.001) << std::endl;
    }
    
    std::cout << "chi_square stat (df=3,chi_sq=3): " << chisq_cdf(3.0, 3.0) << std::endl;
    
    
    std::cout << "Factorial of 5 is: " << factorial(5) << std::endl;
    
    return 0; 
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0xd8, %rsp
callq 0x68184
movl $0x208, %edi            # imm = 0x208
callq 0x8490
movq %rax, %r14
movq 0x76a71(%rip), %rsi     # 0xde890
pushq $0x8
popq %rdx
movq %rax, %rdi
callq 0x8890
xorps %xmm0, %xmm0
leaq 0x20(%rsp), %rbx
andq $0x0, 0x10(%rbx)
leaq 0xc8(%rsp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
movaps %xmm0, (%rbx)
movb $0x0, (%rax)
leaq 0xb8(%rsp), %r15
movq %rsp, %r12
movq %r14, %rdi
movq %r15, %rsi
callq 0x80a0
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
testb $0x5, 0x20(%rax,%rcx)
jne 0x67e8c
movq %r15, %rdi
callq 0x5a2ff
movsd %xmm0, (%rsp)
movq %rbx, %rdi
movq %r12, %rsi
callq 0x2af10
jmp 0x67e59
movq 0x75125(%rip), %rdi     # 0xdcfb8
leaq 0x4170a(%rip), %rsi     # 0xa95a4
callq 0x8480
movq %rax, %rbx
leaq 0xa0(%rsp), %rdi
leaq 0x20(%rsp), %rsi
callq 0x2f816
leaq 0xa0(%rsp), %rdi
callq 0x633d7
movq %rbx, %rdi
callq 0x8750
movq %rax, %rdi
callq 0x8230
leaq 0xa0(%rsp), %rdi
callq 0x2b43c
xorps %xmm0, %xmm0
movaps %xmm0, (%rsp)
andq $0x0, 0x10(%rsp)
leaq 0x769be(%rip), %rdi     # 0xde8b0
leaq 0x31f26(%rip), %rsi     # 0x99e1f
callq 0x2ea9b
testb %al, %al
je 0x68047
movl $0x208, %edi            # imm = 0x208
callq 0x8490
movq %rax, %r14
movq 0x76996(%rip), %rsi     # 0xde8b0
pushq $0x8
popq %rdx
movq %rax, %rdi
callq 0x8890
leaq 0xb8(%rsp), %rbx
movq %rsp, %r15
leaq 0x38(%rsp), %r12
movq %r14, %rdi
movq %rbx, %rsi
callq 0x80a0
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
testb $0x5, 0x20(%rax,%rcx)
jne 0x67f69
movq %rbx, %rdi
callq 0x5a2ff
movsd %xmm0, 0x38(%rsp)
movq %r15, %rdi
movq %r12, %rsi
callq 0x2af10
jmp 0x67f35
movq 0x75048(%rip), %rdi     # 0xdcfb8
leaq 0x41643(%rip), %rsi     # 0xa95ba
callq 0x8480
movq %rax, %rbx
leaq 0x88(%rsp), %rdi
leaq 0x20(%rsp), %rsi
callq 0x2f816
leaq 0x70(%rsp), %rdi
movq %rsp, %rsi
callq 0x2f816
leaq 0x88(%rsp), %rdi
leaq 0x70(%rsp), %rsi
xorps %xmm0, %xmm0
callq 0x62d92
movq %rbx, %rdi
callq 0x8750
movq %rax, %rdi
callq 0x8230
leaq 0x70(%rsp), %rdi
callq 0x2b43c
leaq 0x88(%rsp), %rdi
callq 0x2b43c
movq 0x74fd7(%rip), %rdi     # 0xdcfb8
leaq 0x415f0(%rip), %rsi     # 0xa95d8
callq 0x8480
movq %rax, %rbx
leaq 0x58(%rsp), %rdi
leaq 0x20(%rsp), %rsi
callq 0x2f816
leaq 0x40(%rsp), %rdi
movq %rsp, %rsi
callq 0x2f816
leaq 0x58(%rsp), %rdi
leaq 0x40(%rsp), %rsi
movsd 0x3f342(%rip), %xmm0    # 0xa7360
callq 0x62d92
movq %rbx, %rdi
callq 0x8750
movq %rax, %rdi
callq 0x8230
leaq 0x40(%rsp), %rdi
callq 0x2b43c
leaq 0x58(%rsp), %rdi
callq 0x2b43c
movq 0x74f6a(%rip), %rdi     # 0xdcfb8
leaq 0x415a4(%rip), %rsi     # 0xa95f9
callq 0x8480
movq %rax, %rbx
movsd 0x3c203(%rip), %xmm0    # 0xa4268
movaps %xmm0, %xmm1
callq 0x43f6f
movq %rbx, %rdi
callq 0x8750
movq %rax, %rdi
callq 0x8230
movq 0x74f34(%rip), %rdi     # 0xdcfb8
leaq 0x41590(%rip), %rsi     # 0xa961b
callq 0x8480
movq %rax, %rbx
movsd 0x3c1d5(%rip), %xmm0    # 0xa4270
callq 0x8080
movq %rbx, %rdi
callq 0x8750
movq %rax, %rdi
callq 0x8230
movq %rsp, %rdi
callq 0x2b43c
leaq 0xb8(%rsp), %rdi
callq 0x8978
leaq 0x20(%rsp), %rdi
callq 0x2b43c
xorl %eax, %eax
addq $0xd8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
movq %rax, %rbx
jmp 0x6811b
movq %rax, %rbx
jmp 0x6812f
movq %rax, %rbx
movl $0x208, %esi            # imm = 0x208
movq %r14, %rdi
callq 0x84a0
jmp 0x68156
movq %rax, %rbx
movl $0x208, %esi            # imm = 0x208
movq %r14, %rdi
callq 0x84a0
jmp 0x6817c
movq %rax, %rbx
leaq 0x40(%rsp), %rdi
callq 0x2b43c
leaq 0x58(%rsp), %rdi
jmp 0x68137
movq %rax, %rbx
leaq 0x70(%rsp), %rdi
callq 0x2b43c
leaq 0x88(%rsp), %rdi
callq 0x2b43c
jmp 0x68156
jmp 0x68162
jmp 0x68153
movq %rax, %rbx
leaq 0xa0(%rsp), %rdi
jmp 0x68159
jmp 0x68153
jmp 0x68153
movq %rax, %rbx
movq %rsp, %rdi
callq 0x2b43c
jmp 0x68165
jmp 0x68162
movq %rax, %rbx
leaq 0xb8(%rsp), %rdi
callq 0x8978
leaq 0x20(%rsp), %rdi
callq 0x2b43c
movq %rbx, %rdi
callq 0x8870