// File: /workspace/github_cpp_makefile_star2_O3/ChnMasterOG[P]KmerGO2/stats_ml/stats.cpp
// Function: ranksums(std::vector<float, std::allocator<float>>&, std::vector<float, std::allocator<float>>&)
float ranksums(std::vector<float>& group1, std::vector<float>& group2)
{
	uint32_t n1 = group1.size(), n2 = group2.size();
	uint32_t i;
	float s = 0;
	std::vector<float> alldata;
	std::vector<float> ranked_data;

	alldata.insert(alldata.end(), group1.begin(), group1.end());
	alldata.insert(alldata.end(), group2.begin(), group2.end());

	getrank(alldata, ranked_data);
	for (i = 0; i < n1; i++) s += ranked_data[i];
	float expected = n1 * (n1 + n2 + 1) / 2.0;
	float z = (s - expected) / sqrt(n1 * n2 * (n1 + n2 + 1) / 12.0);

	if (fabs(z) >= 5.0) return 0.0;
	else
	{
		return 2 * (1 - normdist[(int)(fabs(z) * 10)][(int)(fabs(z) * 100) % 10]);
	}
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x68, %rsp
movq %rsi, %r15
movq (%rdi), %r14
movq 0x8(%rsi), %r12
subq (%rsi), %r12
movq 0x8(%rdi), %rbx
xorl %eax, %eax
leaq 0x30(%rsp), %rdi
movq %rax, 0x10(%rdi)
xorps %xmm0, %xmm0
movaps %xmm0, (%rdi)
movq %rax, 0x20(%rsp)
movaps %xmm0, 0x10(%rsp)
xorl %esi, %esi
movq %r14, %rdx
movq %rbx, %rcx
callq 0x4109a6
leaq 0x30(%rsp), %rdi
movq 0x8(%rdi), %rsi
movq (%r15), %rdx
movq 0x8(%r15), %rcx
callq 0x4109a6
leaq 0x50(%rsp), %rdi
leaq 0x30(%rsp), %rsi
callq 0x40bdce
leaq 0x50(%rsp), %rdi
leaq 0x10(%rsp), %rsi
callq 0x4199d8
subq %r14, %rbx
shrq $0x2, %rbx
shrq $0x2, %r12
movq 0x50(%rsp), %rdi
testq %rdi, %rdi
je 0x419d6e
movq 0x60(%rsp), %rsi
subq %rdi, %rsi
callq 0x41ae90
xorps %xmm0, %xmm0
movss %xmm0, 0xc(%rsp)
testl %ebx, %ebx
je 0x419d91
movq 0x10(%rsp), %rax
movl %ebx, %ecx
xorl %edx, %edx
addss (%rax,%rdx,4), %xmm0
incq %rdx
cmpq %rdx, %rcx
jne 0x419d84
leal (%rbx,%r12), %eax
incl %eax
imull %ebx, %r12d
imull %eax, %r12d
imull %ebx, %eax
cvtsi2sd %rax, %xmm1
mulsd 0x189159(%rip), %xmm1   # 0x5a2f08
cvtsd2ss %xmm1, %xmm1
addss %xmm0, %xmm1
xorps %xmm0, %xmm0
cvtss2sd %xmm1, %xmm0
xorps %xmm1, %xmm1
cvtsi2sd %r12, %xmm1
divsd 0x189142(%rip), %xmm1   # 0x5a2f10
sqrtsd %xmm1, %xmm1
divsd %xmm1, %xmm0
cvtsd2ss %xmm0, %xmm0
andps 0x18914f(%rip), %xmm0   # 0x5a2f30
ucomiss 0x189110(%rip), %xmm0   # 0x5a2ef8
jae 0x419e56
movss 0x18910a(%rip), %xmm1   # 0x5a2efc
mulss %xmm0, %xmm1
cvttss2si %xmm1, %eax
mulss 0x1890fe(%rip), %xmm0   # 0x5a2f00
cltq
cvttss2si %xmm0, %ecx
movslq %ecx, %rcx
imulq $0x66666667, %rcx, %rdx # imm = 0x66666667
movq %rdx, %rsi
shrq $0x3f, %rsi
sarq $0x22, %rdx
addl %esi, %edx
addl %edx, %edx
leal (%rdx,%rdx,4), %edx
subl %edx, %ecx
movslq %ecx, %rcx
leaq (%rax,%rax,4), %rax
shlq $0x4, %rax
leaq 0x189108(%rip), %rdx    # 0x5a2f40
addq %rax, %rdx
movsd 0x1890d5(%rip), %xmm0   # 0x5a2f18
subsd (%rdx,%rcx,8), %xmm0
addsd %xmm0, %xmm0
cvtsd2ss %xmm0, %xmm0
movss %xmm0, 0xc(%rsp)
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x419e6d
movq 0x20(%rsp), %rsi
subq %rdi, %rsi
callq 0x41ae90
movq 0x30(%rsp), %rdi
testq %rdi, %rdi
je 0x419e84
movq 0x40(%rsp), %rsi
subq %rdi, %rsi
callq 0x41ae90
movss 0xc(%rsp), %xmm0
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
movq %rax, %rbx
movq 0x50(%rsp), %rdi
testq %rdi, %rdi
je 0x419eb9
movq 0x60(%rsp), %rsi
subq %rdi, %rsi
callq 0x41ae90
jmp 0x419eb9
jmp 0x419eb6
jmp 0x419eb6
movq %rax, %rbx
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x419ed0
movq 0x20(%rsp), %rsi
subq %rdi, %rsi
callq 0x41ae90
movq 0x30(%rsp), %rdi
testq %rdi, %rdi
je 0x419ee7
movq 0x40(%rsp), %rsi
subq %rdi, %rsi
callq 0x41ae90
movq %rbx, %rdi
callq 0x4bfce0