// File: /workspace/github_cpp_makefile_star2_O2/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
andq $0x0, 0x20(%rsp)
xorpd %xmm0, %xmm0
movapd %xmm0, 0x10(%rsp)
decl %esi
cmpl $0x5, %esi
ja 0x1b657
movq %rdx, %r14
movq %rdi, %rbx
leaq 0x1bdd9(%rip), %rax     # 0x37280
movslq (%rax,%rsi,4), %rcx
addq %rax, %rcx
jmpq *%rcx
leaq 0x1c2ce(%rip), %rsi     # 0x37785
movq %r14, %rdi
callq 0x813d
testb %al, %al
je 0x1b5e9
movq 0x108(%rbx), %rcx
jmp 0x1b61f
leaq 0x1c2ab(%rip), %rsi     # 0x37785
movq %r14, %rdi
callq 0x813d
testb %al, %al
je 0x1b582
movq 0x108(%rbx), %rax
jmp 0x1b63f
leaq 0x1c288(%rip), %rsi     # 0x37785
movq %r14, %rdi
callq 0x813d
testb %al, %al
je 0x1b5a5
movq 0x108(%rbx), %rax
jmp 0x1b5df
leaq 0x1c265(%rip), %rsi     # 0x37785
movq %r14, %rdi
callq 0x813d
testb %al, %al
je 0x1b5c5
movq 0x120(%rbx), %rax
jmp 0x1b5df
leaq 0x1c242(%rip), %rsi     # 0x37785
movq %r14, %rdi
callq 0x813d
testb %al, %al
je 0x1b605
movq 0x120(%rbx), %rcx
jmp 0x1b61f
leaq 0x1c21f(%rip), %rsi     # 0x37785
movq %r14, %rdi
callq 0x813d
testb %al, %al
je 0x1b625
movq 0x120(%rbx), %rax
jmp 0x1b63f
leaq 0x1c205(%rip), %rsi     # 0x3778e
movq %r14, %rdi
callq 0x813d
testb %al, %al
je 0x1b657
movq 0x138(%rbx), %rax
jmp 0x1b63f
leaq 0x1c1e2(%rip), %rsi     # 0x3778e
movq %r14, %rdi
callq 0x813d
testb %al, %al
je 0x1b657
movq 0x138(%rbx), %rax
jmp 0x1b5df
leaq 0x1c1c2(%rip), %rsi     # 0x3778e
movq %r14, %rdi
callq 0x813d
testb %al, %al
je 0x1b657
movq 0x150(%rbx), %rax
leaq 0x18(%rax), %rcx
addq $0x20, %rax
jmp 0x1b647
leaq 0x1c19e(%rip), %rsi     # 0x3778e
movq %r14, %rdi
callq 0x813d
testb %al, %al
je 0x1b657
movq 0x138(%rbx), %rcx
jmp 0x1b61f
leaq 0x1c182(%rip), %rsi     # 0x3778e
movq %r14, %rdi
callq 0x813d
testb %al, %al
je 0x1b657
movq 0x150(%rbx), %rcx
leaq 0x8(%rcx), %rax
jmp 0x1b647
leaq 0x1c162(%rip), %rsi     # 0x3778e
movq %r14, %rdi
callq 0x813d
testb %al, %al
je 0x1b657
movq 0x150(%rbx), %rax
leaq 0x30(%rax), %rcx
addq $0x38, %rax
movq (%rcx), %rsi
movq (%rax), %rdx
leaq 0x10(%rsp), %rdi
callq 0x1b9b4
movq 0x18(%rsp), %rsi
subq 0x10(%rsp), %rsi
sarq $0x2, %rsi
cmpq $0x2, %rsi
jae 0x1b67e
movsd 0x1adfd(%rip), %xmm0    # 0x36470
movsd %xmm0, 0x28(%rsp)
jmp 0x1b70c
leaq 0x60(%rsp), %rdx
andq $0x0, (%rdx)
leaq 0x30(%rsp), %rdi
leaq 0xf(%rsp), %rcx
callq 0xce00
movq 0x30(%rsp), %rax
movq 0x38(%rsp), %rcx
subq %rax, %rcx
sarq $0x3, %rcx
movq 0x10(%rsp), %rdx
movq 0x18(%rsp), %rsi
xorl %edi, %edi
cmpq %rdi, %rcx
jbe 0x1b6d0
cvtsi2sdl (%rdx,%rdi,4), %xmm0
cvtsi2sdl -0x4(%rsi), %xmm1
divsd %xmm1, %xmm0
movsd %xmm0, (%rax,%rdi,8)
incq %rdi
jmp 0x1b6b3
leaq 0x48(%rsp), %rdi
leaq 0x30(%rsp), %rsi
callq 0xba2e
movq 0x35902(%rip), %rsi     # 0x50fe8
leaq 0x48(%rsp), %rdi
xorl %edx, %edx
callq 0x33af8
movsd %xmm0, 0x28(%rsp)
leaq 0x48(%rsp), %rdi
callq 0xc17e
leaq 0x30(%rsp), %rdi
callq 0xc17e
leaq 0x10(%rsp), %rdi
callq 0xc1b2
movsd 0x28(%rsp), %xmm0
addq $0x68, %rsp
popq %rbx
popq %r14
retq
movq %rax, %rbx
leaq 0x48(%rsp), %rdi
callq 0xc17e
jmp 0x1b736
movq %rax, %rbx
leaq 0x30(%rsp), %rdi
callq 0xc17e
jmp 0x1b747
jmp 0x1b744
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0xc1b2
movq %rbx, %rdi
callq 0x7750