// File: /workspace/github_cpp_makefile_star2_O3/millanek[P]Dsuite/./Dsuite_utils.h
// Function: TrioDinfo::testIfStrongSitesUniformlyDistributed(int, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
double testIfStrongSitesUniformlyDistributed(int arrangement, string type = "allSites") {
        std::vector<int> linearStrongPosVector;
        
        switch (arrangement) {
            case P3isTrios2_Dpositive:
                if (type == "allSites") {
                    linearStrongPosVector.assign(linearStrongABBApos[0].begin(),linearStrongABBApos[0].end());
                } else if (type == "strongSitesOnly") {
                    linearStrongPosVector.assign(linearStrongABBAposStrongSitesOnly[0].begin(),linearStrongABBAposStrongSitesOnly[0].end());
                }
                break;
            case P3isTrios2_Dnegative:
                if (type == "allSites") {
                    linearStrongPosVector.assign(linearStrongBABApos[0].begin(),linearStrongBABApos[0].end());
                } else if (type == "strongSitesOnly") {
                    linearStrongPosVector.assign(linearStrongBABAposStrongSitesOnly[0].begin(),linearStrongBABAposStrongSitesOnly[0].end());
                }
                break;
            case P3isTrios1_Dpositive:
                if (type == "allSites") {
                    linearStrongPosVector.assign(linearStrongABBApos[1].begin(),linearStrongABBApos[1].end());
                } else if (type == "strongSitesOnly") {
                    linearStrongPosVector.assign(linearStrongABBAposStrongSitesOnly[1].begin(),linearStrongABBAposStrongSitesOnly[1].end());
                }
                break;
            case P3isTrios1_Dnegative:
                if (type == "allSites") {
                    linearStrongPosVector.assign(linearStrongBABApos[1].begin(),linearStrongBABApos[1].end());
                } else if (type == "strongSitesOnly") {
                    linearStrongPosVector.assign(linearStrongBABAposStrongSitesOnly[1].begin(),linearStrongBABAposStrongSitesOnly[1].end());
                }
                break;
            case P3isTrios0_Dpositive:
                if (type == "allSites") {
                    linearStrongPosVector.assign(linearStrongABBApos[2].begin(),linearStrongABBApos[2].end());
                } else if (type == "strongSitesOnly") {
                    linearStrongPosVector.assign(linearStrongABBAposStrongSitesOnly[2].begin(),linearStrongABBAposStrongSitesOnly[2].end());
                }
                break;
            case P3isTrios0_Dnegative:
                if (type == "allSites") {
                    linearStrongPosVector.assign(linearStrongBABApos[2].begin(),linearStrongBABApos[2].end());
                } else if (type == "strongSitesOnly") {
                    linearStrongPosVector.assign(linearStrongBABAposStrongSitesOnly[2].begin(),linearStrongBABAposStrongSitesOnly[2].end());
                }
                break;
        }
        
        if(linearStrongPosVector.size() < 2) {
           // KSpvalForStrongSites = 1;
            return 1.0;
        } else {
        
            std::vector<double> linearStrongPosVector0to1(linearStrongPosVector.size(),0.0);
            for (int i = 0; i < linearStrongPosVector0to1.size(); i++) {
                linearStrongPosVector0to1[i] = (double)linearStrongPosVector[i]/(double)linearStrongPosVector.back();
            }
           // print_vector(linearStrongPosVector0to1, std::cout, ',');
            
            double KSpvalForStrongSitesOneSample = ks_test_of_uniformity(linearStrongPosVector0to1, std::cerr, false);
            return KSpvalForStrongSitesOneSample;
        }
    }

// Assembly:
pushq %r14
pushq %rbx
subq $0x68, %rsp
xorpd %xmm0, %xmm0
movapd %xmm0, 0x10(%rsp)
movq $0x0, 0x20(%rsp)
decl %esi
cmpl $0x5, %esi
ja 0x2058a
movq %rdx, %r14
movq %rdi, %rbx
leaq 0x21f0e(%rip), %rax     # 0x422f0
movslq (%rax,%rsi,4), %rcx
addq %rax, %rcx
jmpq *%rcx
leaq 0x22403(%rip), %rsi     # 0x427f5
movq %r14, %rdi
callq 0x70f0
testl %eax, %eax
je 0x20555
leaq 0x223f5(%rip), %rsi     # 0x427fe
movq %r14, %rdi
callq 0x70f0
testl %eax, %eax
jne 0x2058a
movq 0x138(%rbx), %rcx
jmp 0x20565
leaq 0x223c9(%rip), %rsi     # 0x427f5
movq %r14, %rdi
callq 0x70f0
testl %eax, %eax
je 0x20532
leaq 0x223bb(%rip), %rsi     # 0x427fe
movq %r14, %rdi
callq 0x70f0
testl %eax, %eax
jne 0x2058a
movq 0x138(%rbx), %rax
jmp 0x20572
leaq 0x2238f(%rip), %rsi     # 0x427f5
movq %r14, %rdi
callq 0x70f0
testl %eax, %eax
je 0x2053b
leaq 0x22381(%rip), %rsi     # 0x427fe
movq %r14, %rdi
callq 0x70f0
testl %eax, %eax
jne 0x2058a
movq 0x138(%rbx), %rax
jmp 0x2054b
leaq 0x22355(%rip), %rsi     # 0x427f5
movq %r14, %rdi
callq 0x70f0
testl %eax, %eax
je 0x20544
leaq 0x22347(%rip), %rsi     # 0x427fe
movq %r14, %rdi
callq 0x70f0
testl %eax, %eax
jne 0x2058a
movq 0x150(%rbx), %rax
jmp 0x2054b
leaq 0x2231e(%rip), %rsi     # 0x427f5
movq %r14, %rdi
callq 0x70f0
testl %eax, %eax
je 0x2055e
leaq 0x22314(%rip), %rsi     # 0x427fe
movq %r14, %rdi
callq 0x70f0
testl %eax, %eax
jne 0x2058a
movq 0x150(%rbx), %rcx
jmp 0x20565
leaq 0x222eb(%rip), %rsi     # 0x427f5
movq %r14, %rdi
callq 0x70f0
testl %eax, %eax
je 0x2056b
leaq 0x222e1(%rip), %rsi     # 0x427fe
movq %r14, %rdi
callq 0x70f0
testl %eax, %eax
jne 0x2058a
movq 0x150(%rbx), %rax
jmp 0x20572
movq 0x108(%rbx), %rax
jmp 0x20572
movq 0x108(%rbx), %rax
jmp 0x2054b
movq 0x120(%rbx), %rax
leaq 0x18(%rax), %rcx
addq $0x20, %rax
jmp 0x2057a
movq 0x108(%rbx), %rcx
jmp 0x20565
movq 0x120(%rbx), %rcx
leaq 0x8(%rcx), %rax
jmp 0x2057a
movq 0x120(%rbx), %rax
leaq 0x30(%rax), %rcx
addq $0x38, %rax
movq (%rcx), %rsi
movq (%rax), %rdx
leaq 0x10(%rsp), %rdi
callq 0x20a6a
movq 0x10(%rsp), %rdi
movq 0x18(%rsp), %rsi
subq %rdi, %rsi
sarq $0x2, %rsi
cmpq $0x2, %rsi
jae 0x205b4
movsd 0x20ec7(%rip), %xmm0    # 0x41470
movsd %xmm0, 0x28(%rsp)
jmp 0x20672
leaq 0x60(%rsp), %rdx
movq $0x0, (%rdx)
leaq 0x30(%rsp), %rdi
leaq 0xf(%rsp), %rcx
callq 0xed0a
movq 0x30(%rsp), %rax
movq 0x38(%rsp), %rcx
subq %rax, %rcx
je 0x20617
sarq $0x3, %rcx
movq 0x10(%rsp), %rdx
movq 0x18(%rsp), %rsi
xorps %xmm0, %xmm0
cvtsi2sdl -0x4(%rsi), %xmm0
cmpq $0x1, %rcx
adcq $0x0, %rcx
xorl %esi, %esi
xorps %xmm1, %xmm1
cvtsi2sdl (%rdx,%rsi,4), %xmm1
divsd %xmm0, %xmm1
movsd %xmm1, (%rax,%rsi,8)
incq %rsi
cmpq %rsi, %rcx
jne 0x205fe
leaq 0x48(%rsp), %rdi
leaq 0x30(%rsp), %rsi
callq 0xd408
movq 0x379bb(%rip), %rsi     # 0x57fe8
leaq 0x48(%rsp), %rdi
xorl %edx, %edx
callq 0x3e3fb
movsd %xmm0, 0x28(%rsp)
movq 0x48(%rsp), %rdi
testq %rdi, %rdi
je 0x20656
movq 0x58(%rsp), %rsi
subq %rdi, %rsi
callq 0x7420
movq 0x30(%rsp), %rdi
testq %rdi, %rdi
je 0x2066d
movq 0x40(%rsp), %rsi
subq %rdi, %rsi
callq 0x7420
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x20684
movq 0x20(%rsp), %rsi
subq %rdi, %rsi
callq 0x7420
movsd 0x28(%rsp), %xmm0
addq $0x68, %rsp
popq %rbx
popq %r14
retq
movq %rax, %rbx
movq 0x48(%rsp), %rdi
testq %rdi, %rdi
je 0x206b1
movq 0x58(%rsp), %rsi
subq %rdi, %rsi
callq 0x7420
jmp 0x206b1
movq %rax, %rbx
movq 0x30(%rsp), %rdi
testq %rdi, %rdi
je 0x206cf
movq 0x40(%rsp), %rsi
subq %rdi, %rsi
callq 0x7420
jmp 0x206cf
jmp 0x206cc
movq %rax, %rbx
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x206e6
movq 0x20(%rsp), %rsi
subq %rdi, %rsi
callq 0x7420
movq %rbx, %rdi
callq 0x7740