// File: 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 %rbp
movq %rsp, %rbp
subq $0x1d0, %rsp            # imm = 0x1D0
movl %edi, -0x4(%rbp)
movq %rsi, -0x10(%rbp)
movl -0x4(%rbp), %edi
movq -0x10(%rbp), %rsi
callq 0xd3040
movl $0x208, %edi            # imm = 0x208
callq 0xa5d0
movq %rax, -0x110(%rbp)
movq %rax, -0x118(%rbp)
leaq 0xc82a3(%rip), %rdi     # 0x19ad50
callq 0xa220
movq -0x110(%rbp), %rdi
movq %rax, %rsi
movl $0x8, %edx
callq 0xab90
jmp 0xd2ac8
movq -0x118(%rbp), %rax
movq %rax, -0x18(%rbp)
leaq -0x40(%rbp), %rdi
callq 0x48410
leaq -0x60(%rbp), %rdi
callq 0xa820
movq -0x18(%rbp), %rdi
leaq -0x60(%rbp), %rsi
callq 0xa0d0
movq %rax, -0x120(%rbp)
jmp 0xd2afb
movq -0x120(%rbp), %rdi
movq (%rdi), %rax
movq -0x18(%rax), %rax
addq %rax, %rdi
callq 0xa740
movb %al, -0x121(%rbp)
jmp 0xd2b19
movb -0x121(%rbp), %al
testb $0x1, %al
jne 0xd2b25
jmp 0xd2b89
leaq -0x60(%rbp), %rdi
callq 0xb75e0
movsd %xmm0, -0x130(%rbp)
jmp 0xd2b38
movsd -0x130(%rbp), %xmm0
movsd %xmm0, -0x68(%rbp)
leaq -0x40(%rbp), %rdi
leaq -0x68(%rbp), %rsi
callq 0x48450
jmp 0xd2b54
jmp 0xd2ae5
movq -0x118(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x20(%rbp)
movl %eax, -0x24(%rbp)
movl $0x208, %esi            # imm = 0x208
callq 0xa5e0
jmp 0xd302b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x20(%rbp)
movl %eax, -0x24(%rbp)
jmp 0xd3019
movq 0xc6428(%rip), %rdi     # 0x198fb8
leaq 0x72f59(%rip), %rsi     # 0x145af0
callq 0xa5c0
movq %rax, -0x138(%rbp)
jmp 0xd2ba5
leaq -0x80(%rbp), %rdi
leaq -0x40(%rbp), %rsi
callq 0x53120
jmp 0xd2bb4
leaq -0x80(%rbp), %rdi
callq 0xcad90
movsd %xmm0, -0x140(%rbp)
jmp 0xd2bc7
movsd -0x140(%rbp), %xmm0
movq -0x138(%rbp), %rdi
callq 0xabd0
movq %rax, -0x148(%rbp)
jmp 0xd2be4
movq -0x148(%rbp), %rdi
movq 0xc6396(%rip), %rsi     # 0x198f88
callq 0xa610
jmp 0xd2bf9
leaq -0x80(%rbp), %rdi
callq 0x3ecb0
leaq -0x98(%rbp), %rdi
callq 0x48410
leaq 0xc815b(%rip), %rdi     # 0x19ad70
leaq 0x632c3(%rip), %rsi     # 0x135edf
callq 0x50eb0
movb %al, -0x149(%rbp)
jmp 0xd2c29
movb -0x149(%rbp), %al
testb $0x1, %al
jne 0xd2c38
jmp 0xd2f17
movl $0x208, %edi            # imm = 0x208
callq 0xa5d0
movq %rax, -0x158(%rbp)
jmp 0xd2c4b
leaq 0xc811e(%rip), %rdi     # 0x19ad70
callq 0xa220
movq -0x158(%rbp), %rdi
movq %rax, %rsi
movl $0x8, %edx
callq 0xab90
jmp 0xd2c6d
movq -0x158(%rbp), %rax
movq %rax, -0xa0(%rbp)
movq -0xa0(%rbp), %rdi
leaq -0x60(%rbp), %rsi
callq 0xa0d0
movq %rax, -0x160(%rbp)
jmp 0xd2c94
movq -0x160(%rbp), %rdi
movq (%rdi), %rax
movq -0x18(%rax), %rax
addq %rax, %rdi
callq 0xa740
movb %al, -0x161(%rbp)
jmp 0xd2cb2
movb -0x161(%rbp), %al
testb $0x1, %al
jne 0xd2cc1
jmp 0xd2d48
leaq -0x60(%rbp), %rdi
callq 0xb75e0
movsd %xmm0, -0x170(%rbp)
jmp 0xd2cd4
movsd -0x170(%rbp), %xmm0
movsd %xmm0, -0xa8(%rbp)
leaq -0x98(%rbp), %rdi
leaq -0xa8(%rbp), %rsi
callq 0x48450
jmp 0xd2cf9
jmp 0xd2c7b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x20(%rbp)
movl %eax, -0x24(%rbp)
leaq -0x80(%rbp), %rdi
callq 0x3ecb0
jmp 0xd3019
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x20(%rbp)
movl %eax, -0x24(%rbp)
jmp 0xd300d
movq -0x158(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x20(%rbp)
movl %eax, -0x24(%rbp)
movl $0x208, %esi            # imm = 0x208
callq 0xa5e0
jmp 0xd300d
movq 0xc6269(%rip), %rdi     # 0x198fb8
leaq 0x72db0(%rip), %rsi     # 0x145b06
callq 0xa5c0
movq %rax, -0x178(%rbp)
jmp 0xd2d64
leaq -0xc0(%rbp), %rdi
leaq -0x40(%rbp), %rsi
callq 0x53120
jmp 0xd2d76
leaq -0xd8(%rbp), %rdi
leaq -0x98(%rbp), %rsi
callq 0x53120
jmp 0xd2d8b
leaq -0xc0(%rbp), %rdi
leaq -0xd8(%rbp), %rsi
xorps %xmm0, %xmm0
callq 0xc99e0
movsd %xmm0, -0x180(%rbp)
jmp 0xd2dab
movsd -0x180(%rbp), %xmm0
movq -0x178(%rbp), %rdi
callq 0xabd0
movq %rax, -0x188(%rbp)
jmp 0xd2dc8
movq -0x188(%rbp), %rdi
movq 0xc61b2(%rip), %rsi     # 0x198f88
callq 0xa610
jmp 0xd2ddd
leaq -0xd8(%rbp), %rdi
callq 0x3ecb0
leaq -0xc0(%rbp), %rdi
callq 0x3ecb0
movq 0xc61bc(%rip), %rdi     # 0x198fb8
leaq 0x72d21(%rip), %rsi     # 0x145b24
callq 0xa5c0
movq %rax, -0x190(%rbp)
jmp 0xd2e11
leaq -0xf0(%rbp), %rdi
leaq -0x40(%rbp), %rsi
callq 0x53120
jmp 0xd2e23
leaq -0x108(%rbp), %rdi
leaq -0x98(%rbp), %rsi
callq 0x53120
jmp 0xd2e38
leaq -0xf0(%rbp), %rdi
leaq -0x108(%rbp), %rsi
movsd 0x70a02(%rip), %xmm0    # 0x143850
callq 0xc99e0
movsd %xmm0, -0x198(%rbp)
jmp 0xd2e5d
movsd -0x198(%rbp), %xmm0
movq -0x190(%rbp), %rdi
callq 0xabd0
movq %rax, -0x1a0(%rbp)
jmp 0xd2e7a
movq -0x1a0(%rbp), %rdi
movq 0xc6100(%rip), %rsi     # 0x198f88
callq 0xa610
jmp 0xd2e8f
leaq -0x108(%rbp), %rdi
callq 0x3ecb0
leaq -0xf0(%rbp), %rdi
callq 0x3ecb0
jmp 0xd2f17
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x20(%rbp)
movl %eax, -0x24(%rbp)
jmp 0xd2ecf
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x20(%rbp)
movl %eax, -0x24(%rbp)
leaq -0xd8(%rbp), %rdi
callq 0x3ecb0
leaq -0xc0(%rbp), %rdi
callq 0x3ecb0
jmp 0xd300d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x20(%rbp)
movl %eax, -0x24(%rbp)
jmp 0xd2f06
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x20(%rbp)
movl %eax, -0x24(%rbp)
leaq -0x108(%rbp), %rdi
callq 0x3ecb0
leaq -0xf0(%rbp), %rdi
callq 0x3ecb0
jmp 0xd300d
movq 0xc609a(%rip), %rdi     # 0x198fb8
leaq 0x72c20(%rip), %rsi     # 0x145b45
callq 0xa5c0
movq %rax, -0x1a8(%rbp)
jmp 0xd2f33
movsd 0x6d8fd(%rip), %xmm1    # 0x140838
movaps %xmm1, %xmm0
callq 0x84860
movsd %xmm0, -0x1b0(%rbp)
jmp 0xd2f4d
movsd -0x1b0(%rbp), %xmm0
movq -0x1a8(%rbp), %rdi
callq 0xabd0
movq %rax, -0x1b8(%rbp)
jmp 0xd2f6a
movq -0x1b8(%rbp), %rdi
movq 0xc6010(%rip), %rsi     # 0x198f88
callq 0xa610
jmp 0xd2f7f
movq 0xc6032(%rip), %rdi     # 0x198fb8
leaq 0x72bda(%rip), %rsi     # 0x145b67
callq 0xa5c0
movq %rax, -0x1c0(%rbp)
jmp 0xd2f9b
movsd 0x72b45(%rip), %xmm0    # 0x145ae8
callq 0x70380
movsd %xmm0, -0x1c8(%rbp)
jmp 0xd2fb2
movsd -0x1c8(%rbp), %xmm0
movq -0x1c0(%rbp), %rdi
callq 0xabd0
movq %rax, -0x1d0(%rbp)
jmp 0xd2fcf
movq -0x1d0(%rbp), %rdi
movq 0xc5fab(%rip), %rsi     # 0x198f88
callq 0xa610
jmp 0xd2fe4
leaq -0x98(%rbp), %rdi
callq 0x3ecb0
leaq -0x60(%rbp), %rdi
callq 0xac88
leaq -0x40(%rbp), %rdi
callq 0x3ecb0
xorl %eax, %eax
addq $0x1d0, %rsp            # imm = 0x1D0
popq %rbp
retq
leaq -0x98(%rbp), %rdi
callq 0x3ecb0
leaq -0x60(%rbp), %rdi
callq 0xac88
leaq -0x40(%rbp), %rdi
callq 0x3ecb0
movq -0x20(%rbp), %rdi
callq 0xab50
nopw %cs:(%rax,%rax)