// File: /workspace/github_cpp_makefile_star2_O1/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 0x1fc5c
movq %rdx, %r14
movq %rdi, %rbx
leaq 0x217ac(%rip), %rax     # 0x41260
movslq (%rax,%rsi,4), %rcx
addq %rax, %rcx
jmpq *%rcx
leaq 0x21ca1(%rip), %rsi     # 0x41765
movq %r14, %rdi
callq 0x70f0
testl %eax, %eax
je 0x1fc27
leaq 0x21c93(%rip), %rsi     # 0x4176e
movq %r14, %rdi
callq 0x70f0
testl %eax, %eax
jne 0x1fc5c
movq 0x138(%rbx), %rcx
jmp 0x1fc37
leaq 0x21c67(%rip), %rsi     # 0x41765
movq %r14, %rdi
callq 0x70f0
testl %eax, %eax
je 0x1fc04
leaq 0x21c59(%rip), %rsi     # 0x4176e
movq %r14, %rdi
callq 0x70f0
testl %eax, %eax
jne 0x1fc5c
movq 0x138(%rbx), %rax
jmp 0x1fc44
leaq 0x21c2d(%rip), %rsi     # 0x41765
movq %r14, %rdi
callq 0x70f0
testl %eax, %eax
je 0x1fc0d
leaq 0x21c1f(%rip), %rsi     # 0x4176e
movq %r14, %rdi
callq 0x70f0
testl %eax, %eax
jne 0x1fc5c
movq 0x138(%rbx), %rax
jmp 0x1fc1d
leaq 0x21bf3(%rip), %rsi     # 0x41765
movq %r14, %rdi
callq 0x70f0
testl %eax, %eax
je 0x1fc16
leaq 0x21be5(%rip), %rsi     # 0x4176e
movq %r14, %rdi
callq 0x70f0
testl %eax, %eax
jne 0x1fc5c
movq 0x150(%rbx), %rax
jmp 0x1fc1d
leaq 0x21bbc(%rip), %rsi     # 0x41765
movq %r14, %rdi
callq 0x70f0
testl %eax, %eax
je 0x1fc30
leaq 0x21bb2(%rip), %rsi     # 0x4176e
movq %r14, %rdi
callq 0x70f0
testl %eax, %eax
jne 0x1fc5c
movq 0x150(%rbx), %rcx
jmp 0x1fc37
leaq 0x21b89(%rip), %rsi     # 0x41765
movq %r14, %rdi
callq 0x70f0
testl %eax, %eax
je 0x1fc3d
leaq 0x21b7f(%rip), %rsi     # 0x4176e
movq %r14, %rdi
callq 0x70f0
testl %eax, %eax
jne 0x1fc5c
movq 0x150(%rbx), %rax
jmp 0x1fc44
movq 0x108(%rbx), %rax
jmp 0x1fc44
movq 0x108(%rbx), %rax
jmp 0x1fc1d
movq 0x120(%rbx), %rax
leaq 0x18(%rax), %rcx
addq $0x20, %rax
jmp 0x1fc4c
movq 0x108(%rbx), %rcx
jmp 0x1fc37
movq 0x120(%rbx), %rcx
leaq 0x8(%rcx), %rax
jmp 0x1fc4c
movq 0x120(%rbx), %rax
leaq 0x30(%rax), %rcx
addq $0x38, %rax
movq (%rcx), %rsi
movq (%rax), %rdx
leaq 0x10(%rsp), %rdi
callq 0x2013a
movq 0x18(%rsp), %rsi
subq 0x10(%rsp), %rsi
sarq $0x2, %rsi
cmpq $0x2, %rsi
jae 0x1fc83
movsd 0x207f8(%rip), %xmm0    # 0x40470
movsd %xmm0, 0x28(%rsp)
jmp 0x1fd3c
leaq 0x60(%rsp), %rdx
movq $0x0, (%rdx)
leaq 0x30(%rsp), %rdi
leaq 0xf(%rsp), %rcx
callq 0xebec
movq 0x30(%rsp), %rax
movq 0x38(%rsp), %rcx
subq %rax, %rcx
je 0x1fce6
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 0x1fccd
leaq 0x48(%rsp), %rdi
leaq 0x30(%rsp), %rsi
callq 0xd4a2
movq 0x372ec(%rip), %rsi     # 0x56fe8
leaq 0x48(%rsp), %rdi
xorl %edx, %edx
callq 0x3d9bd
movsd %xmm0, 0x28(%rsp)
movq 0x48(%rsp), %rdi
testq %rdi, %rdi
je 0x1fd25
movq 0x58(%rsp), %rsi
subq %rdi, %rsi
callq 0x7420
movq 0x30(%rsp), %rdi
testq %rdi, %rdi
je 0x1fd3c
movq 0x40(%rsp), %rsi
subq %rdi, %rsi
callq 0x7420
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x1fd53
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 0x1fd80
movq 0x58(%rsp), %rsi
subq %rdi, %rsi
callq 0x7420
jmp 0x1fd80
movq %rax, %rbx
movq 0x30(%rsp), %rdi
testq %rdi, %rdi
je 0x1fd9e
movq 0x40(%rsp), %rsi
subq %rdi, %rsi
callq 0x7420
jmp 0x1fd9e
jmp 0x1fd9b
movq %rax, %rbx
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x1fdb5
movq 0x20(%rsp), %rsi
subq %rdi, %rsi
callq 0x7420
movq %rbx, %rdi
callq 0x7740