// File: 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 %rbp
movq %rsp, %rbp
subq $0x2c0, %rsp            # imm = 0x2C0
movq %rdx, -0x170(%rbp)
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
movq %rdx, -0x20(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x168(%rbp)
leaq -0x38(%rbp), %rdi
callq 0x17620
movl -0x14(%rbp), %eax
decl %eax
movl %eax, %ecx
movq %rcx, -0x160(%rbp)
subl $0x5, %eax
ja 0x3e147
movq -0x160(%rbp), %rax
leaq 0x4ba02(%rip), %rcx     # 0x893f8
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq -0x170(%rbp), %rdi
leaq 0x4bef0(%rip), %rsi     # 0x898fd
callq 0x9ab0
movb %al, -0x171(%rbp)
jmp 0x3da1a
movb -0x171(%rbp), %al
testb $0x1, %al
jne 0x3da26
jmp 0x3da9f
movq -0x168(%rbp), %rdi
addq $0x108, %rdi            # imm = 0x108
movq %rdi, -0x188(%rbp)
xorl %eax, %eax
movl %eax, %esi
movq %rsi, -0x180(%rbp)
callq 0x368b0
movq %rax, %rdi
callq 0x1a030
movq -0x188(%rbp), %rdi
movq -0x180(%rbp), %rsi
movq %rax, -0x50(%rbp)
callq 0x368b0
movq %rax, %rdi
callq 0x19e80
movq %rax, -0x58(%rbp)
movq -0x50(%rbp), %rsi
movq -0x58(%rbp), %rdx
leaq -0x38(%rbp), %rdi
callq 0x3e910
jmp 0x3da89
jmp 0x3db2d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x3e353
movq -0x170(%rbp), %rdi
leaq 0x4be59(%rip), %rsi     # 0x89906
callq 0x9ab0
movb %al, -0x189(%rbp)
jmp 0x3daba
movb -0x189(%rbp), %al
testb $0x1, %al
jne 0x3dac6
jmp 0x3db2b
movq -0x168(%rbp), %rdi
addq $0x138, %rdi            # imm = 0x138
movq %rdi, -0x1a0(%rbp)
xorl %eax, %eax
movl %eax, %esi
movq %rsi, -0x198(%rbp)
callq 0x368b0
movq %rax, %rdi
callq 0x1a030
movq -0x1a0(%rbp), %rdi
movq -0x198(%rbp), %rsi
movq %rax, -0x60(%rbp)
callq 0x368b0
movq %rax, %rdi
callq 0x19e80
movq %rax, -0x68(%rbp)
movq -0x60(%rbp), %rsi
movq -0x68(%rbp), %rdx
leaq -0x38(%rbp), %rdi
callq 0x3e910
jmp 0x3db29
jmp 0x3db2b
jmp 0x3db2d
jmp 0x3e147
movq -0x170(%rbp), %rdi
leaq 0x4bdbd(%rip), %rsi     # 0x898fd
callq 0x9ab0
movb %al, -0x1a1(%rbp)
jmp 0x3db4d
movb -0x1a1(%rbp), %al
testb $0x1, %al
jne 0x3db59
jmp 0x3dbc1
movq -0x168(%rbp), %rdi
addq $0x120, %rdi            # imm = 0x120
movq %rdi, -0x1b8(%rbp)
xorl %eax, %eax
movl %eax, %esi
movq %rsi, -0x1b0(%rbp)
callq 0x368b0
movq %rax, %rdi
callq 0x1a030
movq -0x1b8(%rbp), %rdi
movq -0x1b0(%rbp), %rsi
movq %rax, -0x70(%rbp)
callq 0x368b0
movq %rax, %rdi
callq 0x19e80
movq %rax, -0x78(%rbp)
movq -0x70(%rbp), %rsi
movq -0x78(%rbp), %rdx
leaq -0x38(%rbp), %rdi
callq 0x3e910
jmp 0x3dbbc
jmp 0x3dc55
movq -0x170(%rbp), %rdi
leaq 0x4bd37(%rip), %rsi     # 0x89906
callq 0x9ab0
movb %al, -0x1b9(%rbp)
jmp 0x3dbdc
movb -0x1b9(%rbp), %al
testb $0x1, %al
jne 0x3dbe8
jmp 0x3dc53
movq -0x168(%rbp), %rdi
addq $0x150, %rdi            # imm = 0x150
movq %rdi, -0x1d0(%rbp)
xorl %eax, %eax
movl %eax, %esi
movq %rsi, -0x1c8(%rbp)
callq 0x368b0
movq %rax, %rdi
callq 0x1a030
movq -0x1d0(%rbp), %rdi
movq -0x1c8(%rbp), %rsi
movq %rax, -0x80(%rbp)
callq 0x368b0
movq %rax, %rdi
callq 0x19e80
movq %rax, -0x88(%rbp)
movq -0x80(%rbp), %rsi
movq -0x88(%rbp), %rdx
leaq -0x38(%rbp), %rdi
callq 0x3e910
jmp 0x3dc51
jmp 0x3dc53
jmp 0x3dc55
jmp 0x3e147
movq -0x170(%rbp), %rdi
leaq 0x4bc95(%rip), %rsi     # 0x898fd
callq 0x9ab0
movb %al, -0x1d1(%rbp)
jmp 0x3dc75
movb -0x1d1(%rbp), %al
testb $0x1, %al
jne 0x3dc81
jmp 0x3dcf6
movq -0x168(%rbp), %rdi
addq $0x108, %rdi            # imm = 0x108
movq %rdi, -0x1e8(%rbp)
movl $0x1, %esi
movq %rsi, -0x1e0(%rbp)
callq 0x368b0
movq %rax, %rdi
callq 0x1a030
movq -0x1e8(%rbp), %rdi
movq -0x1e0(%rbp), %rsi
movq %rax, -0x90(%rbp)
callq 0x368b0
movq %rax, %rdi
callq 0x19e80
movq %rax, -0x98(%rbp)
movq -0x90(%rbp), %rsi
movq -0x98(%rbp), %rdx
leaq -0x38(%rbp), %rdi
callq 0x3e910
jmp 0x3dcf1
jmp 0x3dd91
movq -0x170(%rbp), %rdi
leaq 0x4bc02(%rip), %rsi     # 0x89906
callq 0x9ab0
movb %al, -0x1e9(%rbp)
jmp 0x3dd11
movb -0x1e9(%rbp), %al
testb $0x1, %al
jne 0x3dd1d
jmp 0x3dd8f
movq -0x168(%rbp), %rdi
addq $0x138, %rdi            # imm = 0x138
movq %rdi, -0x200(%rbp)
movl $0x1, %esi
movq %rsi, -0x1f8(%rbp)
callq 0x368b0
movq %rax, %rdi
callq 0x1a030
movq -0x200(%rbp), %rdi
movq -0x1f8(%rbp), %rsi
movq %rax, -0xa0(%rbp)
callq 0x368b0
movq %rax, %rdi
callq 0x19e80
movq %rax, -0xa8(%rbp)
movq -0xa0(%rbp), %rsi
movq -0xa8(%rbp), %rdx
leaq -0x38(%rbp), %rdi
callq 0x3e910
jmp 0x3dd8d
jmp 0x3dd8f
jmp 0x3dd91
jmp 0x3e147
movq -0x170(%rbp), %rdi
leaq 0x4bb59(%rip), %rsi     # 0x898fd
callq 0x9ab0
movb %al, -0x201(%rbp)
jmp 0x3ddb1
movb -0x201(%rbp), %al
testb $0x1, %al
jne 0x3ddbd
jmp 0x3de32
movq -0x168(%rbp), %rdi
addq $0x120, %rdi            # imm = 0x120
movq %rdi, -0x218(%rbp)
movl $0x1, %esi
movq %rsi, -0x210(%rbp)
callq 0x368b0
movq %rax, %rdi
callq 0x1a030
movq -0x218(%rbp), %rdi
movq -0x210(%rbp), %rsi
movq %rax, -0xb0(%rbp)
callq 0x368b0
movq %rax, %rdi
callq 0x19e80
movq %rax, -0xb8(%rbp)
movq -0xb0(%rbp), %rsi
movq -0xb8(%rbp), %rdx
leaq -0x38(%rbp), %rdi
callq 0x3e910
jmp 0x3de2d
jmp 0x3decd
movq -0x170(%rbp), %rdi
leaq 0x4bac6(%rip), %rsi     # 0x89906
callq 0x9ab0
movb %al, -0x219(%rbp)
jmp 0x3de4d
movb -0x219(%rbp), %al
testb $0x1, %al
jne 0x3de59
jmp 0x3decb
movq -0x168(%rbp), %rdi
addq $0x150, %rdi            # imm = 0x150
movq %rdi, -0x230(%rbp)
movl $0x1, %esi
movq %rsi, -0x228(%rbp)
callq 0x368b0
movq %rax, %rdi
callq 0x1a030
movq -0x230(%rbp), %rdi
movq -0x228(%rbp), %rsi
movq %rax, -0xc0(%rbp)
callq 0x368b0
movq %rax, %rdi
callq 0x19e80
movq %rax, -0xc8(%rbp)
movq -0xc0(%rbp), %rsi
movq -0xc8(%rbp), %rdx
leaq -0x38(%rbp), %rdi
callq 0x3e910
jmp 0x3dec9
jmp 0x3decb
jmp 0x3decd
jmp 0x3e147
movq -0x170(%rbp), %rdi
leaq 0x4ba1d(%rip), %rsi     # 0x898fd
callq 0x9ab0
movb %al, -0x231(%rbp)
jmp 0x3deed
movb -0x231(%rbp), %al
testb $0x1, %al
jne 0x3def9
jmp 0x3df6e
movq -0x168(%rbp), %rdi
addq $0x108, %rdi            # imm = 0x108
movq %rdi, -0x248(%rbp)
movl $0x2, %esi
movq %rsi, -0x240(%rbp)
callq 0x368b0
movq %rax, %rdi
callq 0x1a030
movq -0x248(%rbp), %rdi
movq -0x240(%rbp), %rsi
movq %rax, -0xd0(%rbp)
callq 0x368b0
movq %rax, %rdi
callq 0x19e80
movq %rax, -0xd8(%rbp)
movq -0xd0(%rbp), %rsi
movq -0xd8(%rbp), %rdx
leaq -0x38(%rbp), %rdi
callq 0x3e910
jmp 0x3df69
jmp 0x3e009
movq -0x170(%rbp), %rdi
leaq 0x4b98a(%rip), %rsi     # 0x89906
callq 0x9ab0
movb %al, -0x249(%rbp)
jmp 0x3df89
movb -0x249(%rbp), %al
testb $0x1, %al
jne 0x3df95
jmp 0x3e007
movq -0x168(%rbp), %rdi
addq $0x138, %rdi            # imm = 0x138
movq %rdi, -0x260(%rbp)
movl $0x2, %esi
movq %rsi, -0x258(%rbp)
callq 0x368b0
movq %rax, %rdi
callq 0x1a030
movq -0x260(%rbp), %rdi
movq -0x258(%rbp), %rsi
movq %rax, -0xe0(%rbp)
callq 0x368b0
movq %rax, %rdi
callq 0x19e80
movq %rax, -0xe8(%rbp)
movq -0xe0(%rbp), %rsi
movq -0xe8(%rbp), %rdx
leaq -0x38(%rbp), %rdi
callq 0x3e910
jmp 0x3e005
jmp 0x3e007
jmp 0x3e009
jmp 0x3e147
movq -0x170(%rbp), %rdi
leaq 0x4b8e1(%rip), %rsi     # 0x898fd
callq 0x9ab0
movb %al, -0x261(%rbp)
jmp 0x3e029
movb -0x261(%rbp), %al
testb $0x1, %al
jne 0x3e035
jmp 0x3e0aa
movq -0x168(%rbp), %rdi
addq $0x120, %rdi            # imm = 0x120
movq %rdi, -0x278(%rbp)
movl $0x2, %esi
movq %rsi, -0x270(%rbp)
callq 0x368b0
movq %rax, %rdi
callq 0x1a030
movq -0x278(%rbp), %rdi
movq -0x270(%rbp), %rsi
movq %rax, -0xf0(%rbp)
callq 0x368b0
movq %rax, %rdi
callq 0x19e80
movq %rax, -0xf8(%rbp)
movq -0xf0(%rbp), %rsi
movq -0xf8(%rbp), %rdx
leaq -0x38(%rbp), %rdi
callq 0x3e910
jmp 0x3e0a5
jmp 0x3e145
movq -0x170(%rbp), %rdi
leaq 0x4b84e(%rip), %rsi     # 0x89906
callq 0x9ab0
movb %al, -0x279(%rbp)
jmp 0x3e0c5
movb -0x279(%rbp), %al
testb $0x1, %al
jne 0x3e0d1
jmp 0x3e143
movq -0x168(%rbp), %rdi
addq $0x150, %rdi            # imm = 0x150
movq %rdi, -0x290(%rbp)
movl $0x2, %esi
movq %rsi, -0x288(%rbp)
callq 0x368b0
movq %rax, %rdi
callq 0x1a030
movq -0x290(%rbp), %rdi
movq -0x288(%rbp), %rsi
movq %rax, -0x100(%rbp)
callq 0x368b0
movq %rax, %rdi
callq 0x19e80
movq %rax, -0x108(%rbp)
movq -0x100(%rbp), %rsi
movq -0x108(%rbp), %rdx
leaq -0x38(%rbp), %rdi
callq 0x3e910
jmp 0x3e141
jmp 0x3e143
jmp 0x3e145
jmp 0x3e147
leaq -0x38(%rbp), %rdi
callq 0x119e0
cmpq $0x2, %rax
jae 0x3e172
movsd 0x4a34a(%rip), %xmm0    # 0x884a8
movsd %xmm0, -0x8(%rbp)
movl $0x1, -0x10c(%rbp)
jmp 0x3e33c
leaq -0x38(%rbp), %rdi
callq 0x119e0
movq %rax, -0x2a0(%rbp)
movq $0x0, -0x130(%rbp)
leaq -0x131(%rbp), %rdi
movq %rdi, -0x298(%rbp)
callq 0x124c0
movq -0x2a0(%rbp), %rsi
movq -0x298(%rbp), %rcx
leaq -0x128(%rbp), %rdi
leaq -0x130(%rbp), %rdx
callq 0x16150
jmp 0x3e1c3
leaq -0x131(%rbp), %rdi
callq 0x16570
movl $0x0, -0x138(%rbp)
movslq -0x138(%rbp), %rax
movq %rax, -0x2a8(%rbp)
leaq -0x128(%rbp), %rdi
callq 0x10e50
movq %rax, %rcx
movq -0x2a8(%rbp), %rax
cmpq %rcx, %rax
jae 0x3e293
movslq -0x138(%rbp), %rsi
leaq -0x38(%rbp), %rdi
callq 0x115a0
cvtsi2sdl (%rax), %xmm0
movsd %xmm0, -0x2b8(%rbp)
leaq -0x38(%rbp), %rdi
callq 0x19eb0
movsd -0x2b8(%rbp), %xmm0
cvtsi2sdl (%rax), %xmm1
divsd %xmm1, %xmm0
movsd %xmm0, -0x2b0(%rbp)
movslq -0x138(%rbp), %rsi
leaq -0x128(%rbp), %rdi
callq 0x107e0
movsd -0x2b0(%rbp), %xmm0
movsd %xmm0, (%rax)
movl -0x138(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x138(%rbp)
jmp 0x3e1d9
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x131(%rbp), %rdi
callq 0x16570
jmp 0x3e353
leaq -0x158(%rbp), %rdi
leaq -0x128(%rbp), %rsi
callq 0x110a0
jmp 0x3e2a8
movq 0x80d41(%rip), %rsi     # 0xbeff0
leaq -0x158(%rbp), %rdi
xorl %edx, %edx
callq 0x841a0
movsd %xmm0, -0x2c0(%rbp)
jmp 0x3e2c7
leaq -0x158(%rbp), %rdi
callq 0x10930
movsd -0x2c0(%rbp), %xmm0
movsd %xmm0, -0x140(%rbp)
movsd -0x140(%rbp), %xmm0
movsd %xmm0, -0x8(%rbp)
movl $0x1, -0x10c(%rbp)
leaq -0x128(%rbp), %rdi
callq 0x10930
jmp 0x3e33c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x3e32e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x158(%rbp), %rdi
callq 0x10930
leaq -0x128(%rbp), %rdi
callq 0x10930
jmp 0x3e353
leaq -0x38(%rbp), %rdi
callq 0x11a00
movsd -0x8(%rbp), %xmm0
addq $0x2c0, %rsp            # imm = 0x2C0
popq %rbp
retq
leaq -0x38(%rbp), %rdi
callq 0x11a00
movq -0x40(%rbp), %rdi
callq 0x8a50
nopw %cs:(%rax,%rax)
nop