// File: millanek[P]Dsuite/D.cpp
// Function: TestTrioInfo::testIfSitesUniformlyDistributed()
void TestTrioInfo::testIfSitesUniformlyDistributed() {
    // Take care of the splits by random sampling with replacement:
    std::random_device rd;     // only used once to initialise (seed) engine
    std::mt19937 rng(rd());    // random-number engine used (Mersenne-Twister in this case)
    std::uniform_int_distribution<int> uniABBA(0,linearABBApos.back()); // guaranteed unbiased
    std::uniform_int_distribution<int> uniBABA(0,linearBABApos.back()); // guaranteed unbiased
    std::list<int64_t> uniABBAvals; std::list<int64_t> uniBABAvals;
    // uniABBAvals.re(linearABBApos.size()); uniBABAvals.resize(linearBABApos.size());
    
    
    int numUniformSamples = (int)linearABBApos.size(); if (numUniformSamples < 10000) { numUniformSamples = 10000; }
    for (int i = 0; i < numUniformSamples; i++) {
        uniABBAvals.push_back(uniABBA(rng));
    }
    
    numUniformSamples = (int)linearBABApos.size(); if (numUniformSamples < 10000) { numUniformSamples = 10000; }
    for (int i = 0; i < numUniformSamples; i++) {
        uniBABAvals.push_back(uniBABA(rng));
    }
    
    std::list<int64_t> linearABBAposList(linearABBApos.begin(),linearABBApos.end());
    std::list<int64_t> linearBABAposList(linearBABApos.begin(),linearBABApos.end());
    
    ABBA_KSpval = ks_test(uniABBAvals, linearABBAposList, std::cerr, false);
    BABA_KSpval = ks_test(uniBABAvals, linearBABAposList, std::cerr, false);
    
    //double BABApval = ks_test(uniBABAvals, linearBABApos, std::cerr);
    
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x28a0, %rsp           # imm = 0x28A0
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x2860(%rbp)
leaq -0x1390(%rbp), %rdi
movq %rdi, -0x2858(%rbp)
callq 0x111c0
movq -0x2858(%rbp), %rdi
callq 0x11260
movl %eax, -0x284c(%rbp)
jmp 0x1f261
movl -0x284c(%rbp), %eax
movl %eax, %eax
movl %eax, %esi
leaq -0x2718(%rbp), %rdi
callq 0x11280
jmp 0x1f279
movq -0x2860(%rbp), %rdi
addq $0x30, %rdi
callq 0x19eb0
movl (%rax), %edx
leaq -0x272c(%rbp), %rdi
xorl %esi, %esi
callq 0x112b0
jmp 0x1f29b
movq -0x2860(%rbp), %rdi
addq $0x78, %rdi
callq 0x19eb0
movl (%rax), %edx
leaq -0x2734(%rbp), %rdi
xorl %esi, %esi
callq 0x112b0
jmp 0x1f2bd
leaq -0x2750(%rbp), %rdi
callq 0x21cb0
leaq -0x2768(%rbp), %rdi
callq 0x21cb0
movq -0x2860(%rbp), %rdi
addq $0x30, %rdi
callq 0x119e0
movl %eax, -0x276c(%rbp)
cmpl $0x2710, -0x276c(%rbp)  # imm = 0x2710
jge 0x1f31a
movl $0x2710, -0x276c(%rbp)  # imm = 0x2710
jmp 0x1f31a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x2720(%rbp)
movl %eax, -0x2724(%rbp)
jmp 0x1f762
movl $0x0, -0x2770(%rbp)
movl -0x2770(%rbp), %eax
cmpl -0x276c(%rbp), %eax
jge 0x1f39b
leaq -0x272c(%rbp), %rdi
leaq -0x2718(%rbp), %rsi
callq 0x112e0
movl %eax, -0x2864(%rbp)
jmp 0x1f34d
movl -0x2864(%rbp), %eax
cltq
movq %rax, -0x2778(%rbp)
leaq -0x2750(%rbp), %rdi
leaq -0x2778(%rbp), %rsi
callq 0x21cd0
jmp 0x1f371
jmp 0x1f373
movl -0x2770(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x2770(%rbp)
jmp 0x1f324
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x2720(%rbp)
movl %eax, -0x2724(%rbp)
jmp 0x1f74a
movq -0x2860(%rbp), %rdi
addq $0x78, %rdi
callq 0x119e0
movl %eax, -0x276c(%rbp)
cmpl $0x2710, -0x276c(%rbp)  # imm = 0x2710
jge 0x1f3c7
movl $0x2710, -0x276c(%rbp)  # imm = 0x2710
movl $0x0, -0x277c(%rbp)
movl -0x277c(%rbp), %eax
cmpl -0x276c(%rbp), %eax
jge 0x1f431
leaq -0x2734(%rbp), %rdi
leaq -0x2718(%rbp), %rsi
callq 0x112e0
movl %eax, -0x2868(%rbp)
jmp 0x1f3fa
movl -0x2868(%rbp), %eax
cltq
movq %rax, -0x2788(%rbp)
leaq -0x2768(%rbp), %rdi
leaq -0x2788(%rbp), %rsi
callq 0x21cd0
jmp 0x1f41e
jmp 0x1f420
movl -0x277c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x277c(%rbp)
jmp 0x1f3d1
movq -0x2860(%rbp), %rdi
addq $0x30, %rdi
movq %rdi, -0x2878(%rbp)
callq 0x1a030
movq -0x2878(%rbp), %rdi
movq %rax, -0x27a8(%rbp)
callq 0x19e80
movq %rax, -0x27b0(%rbp)
leaq -0x27b1(%rbp), %rdi
movq %rdi, -0x2870(%rbp)
callq 0x21d10
movq -0x2870(%rbp), %rcx
movq -0x27a8(%rbp), %rsi
movq -0x27b0(%rbp), %rdx
leaq -0x27a0(%rbp), %rdi
callq 0x21d30
jmp 0x1f498
leaq -0x27b1(%rbp), %rdi
callq 0x21de0
movq -0x2860(%rbp), %rdi
addq $0x78, %rdi
movq %rdi, -0x2888(%rbp)
callq 0x1a030
movq -0x2888(%rbp), %rdi
movq %rax, -0x27d8(%rbp)
callq 0x19e80
movq %rax, -0x27e0(%rbp)
leaq -0x27e1(%rbp), %rdi
movq %rdi, -0x2880(%rbp)
callq 0x21d10
movq -0x2880(%rbp), %rcx
movq -0x27d8(%rbp), %rsi
movq -0x27e0(%rbp), %rdx
leaq -0x27d0(%rbp), %rdi
callq 0x21d30
jmp 0x1f50b
leaq -0x27e1(%rbp), %rdi
callq 0x21de0
leaq -0x2800(%rbp), %rdi
leaq -0x2750(%rbp), %rsi
callq 0x21e00
jmp 0x1f52c
leaq -0x2818(%rbp), %rdi
leaq -0x27a0(%rbp), %rsi
callq 0x21e00
jmp 0x1f541
movq 0x9faa8(%rip), %rdx     # 0xbeff0
leaq -0x2800(%rbp), %rdi
leaq -0x2818(%rbp), %rsi
xorl %ecx, %ecx
callq 0x83d20
movsd %xmm0, -0x2890(%rbp)
jmp 0x1f567
movq -0x2860(%rbp), %rax
movsd -0x2890(%rbp), %xmm0
movsd %xmm0, 0x308(%rax)
leaq -0x2818(%rbp), %rdi
callq 0x21ea0
leaq -0x2800(%rbp), %rdi
callq 0x21ea0
leaq -0x2830(%rbp), %rdi
leaq -0x2768(%rbp), %rsi
callq 0x21e00
jmp 0x1f5ab
leaq -0x2848(%rbp), %rdi
leaq -0x27d0(%rbp), %rsi
callq 0x21e00
jmp 0x1f5c0
movq 0x9fa29(%rip), %rdx     # 0xbeff0
leaq -0x2830(%rbp), %rdi
leaq -0x2848(%rbp), %rsi
xorl %ecx, %ecx
callq 0x83d20
movsd %xmm0, -0x2898(%rbp)
jmp 0x1f5e6
movq -0x2860(%rbp), %rax
movsd -0x2898(%rbp), %xmm0
movsd %xmm0, 0x310(%rax)
leaq -0x2848(%rbp), %rdi
callq 0x21ea0
leaq -0x2830(%rbp), %rdi
callq 0x21ea0
leaq -0x27d0(%rbp), %rdi
callq 0x21ea0
leaq -0x27a0(%rbp), %rdi
callq 0x21ea0
leaq -0x2768(%rbp), %rdi
callq 0x21ea0
leaq -0x2750(%rbp), %rdi
callq 0x21ea0
leaq -0x1390(%rbp), %rdi
callq 0x11310
addq $0x28a0, %rsp           # imm = 0x28A0
popq %rbp
retq
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x2720(%rbp)
movl %eax, -0x2724(%rbp)
leaq -0x27b1(%rbp), %rdi
callq 0x21de0
jmp 0x1f74a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x2720(%rbp)
movl %eax, -0x2724(%rbp)
leaq -0x27e1(%rbp), %rdi
callq 0x21de0
jmp 0x1f73e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x2720(%rbp)
movl %eax, -0x2724(%rbp)
jmp 0x1f732
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x2720(%rbp)
movl %eax, -0x2724(%rbp)
jmp 0x1f6e6
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x2720(%rbp)
movl %eax, -0x2724(%rbp)
leaq -0x2818(%rbp), %rdi
callq 0x21ea0
leaq -0x2800(%rbp), %rdi
callq 0x21ea0
jmp 0x1f732
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x2720(%rbp)
movl %eax, -0x2724(%rbp)
jmp 0x1f726
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x2720(%rbp)
movl %eax, -0x2724(%rbp)
leaq -0x2848(%rbp), %rdi
callq 0x21ea0
leaq -0x2830(%rbp), %rdi
callq 0x21ea0
leaq -0x27d0(%rbp), %rdi
callq 0x21ea0
leaq -0x27a0(%rbp), %rdi
callq 0x21ea0
leaq -0x2768(%rbp), %rdi
callq 0x21ea0
leaq -0x2750(%rbp), %rdi
callq 0x21ea0
leaq -0x1390(%rbp), %rdi
callq 0x11310
movq -0x2720(%rbp), %rdi
callq 0x8a50
nopw (%rax,%rax)