// File: /workspace/github_cpp_makefile_star2_O1/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(%rdi), %rbx
movq 0x8(%rsi), %r12
subq (%rsi), %r12
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)
movq 0x8(%rdi), %rsi
movq %r14, %rdx
movq %rbx, %rcx
callq 0x410cee
leaq 0x30(%rsp), %rdi
movq 0x8(%rdi), %rsi
movq (%r15), %rdx
movq 0x8(%r15), %rcx
callq 0x410cee
leaq 0x50(%rsp), %rdi
leaq 0x30(%rsp), %rsi
callq 0x40c0a2
leaq 0x50(%rsp), %rdi
leaq 0x10(%rsp), %rsi
callq 0x419f48
subq %r14, %rbx
shrq $0x2, %rbx
shrq $0x2, %r12
movq 0x50(%rsp), %rdi
testq %rdi, %rdi
je 0x41a2ce
movq 0x60(%rsp), %rsi
subq %rdi, %rsi
callq 0x41b3a0
testl %ebx, %ebx
je 0x41a2ed
movq 0x10(%rsp), %rax
movl %ebx, %ecx
xorps %xmm0, %xmm0
xorl %edx, %edx
addss (%rax,%rdx,4), %xmm0
incq %rdx
cmpq %rdx, %rcx
jne 0x41a2de
jmp 0x41a2f0
xorps %xmm0, %xmm0
leal (%rbx,%r12), %eax
incl %eax
movl %eax, %ecx
imull %ebx, %ecx
cvtsi2sd %rcx, %xmm1
mulsd 0x189c00(%rip), %xmm1   # 0x5a3f08
imull %ebx, %r12d
imull %eax, %r12d
cvtsd2ss %xmm1, %xmm1
addss %xmm0, %xmm1
xorps %xmm0, %xmm0
cvtsi2sd %r12, %xmm0
divsd 0x189be8(%rip), %xmm0   # 0x5a3f10
cvtss2sd %xmm1, %xmm2
xorps %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jb 0x41a33b
sqrtsd %xmm0, %xmm0
jmp 0x41a34c
movsd %xmm2, 0x8(%rsp)
callq 0x4bacb0
movsd 0x8(%rsp), %xmm2
divsd %xmm0, %xmm2
xorps %xmm0, %xmm0
cvtsd2ss %xmm2, %xmm0
andps 0x189bd2(%rip), %xmm0   # 0x5a3f30
xorps %xmm1, %xmm1
movss %xmm1, 0x8(%rsp)
ucomiss 0x189b8e(%rip), %xmm0   # 0x5a3efc
jae 0x41a3dc
movss 0x189b88(%rip), %xmm1   # 0x5a3f00
mulss %xmm0, %xmm1
cvttss2si %xmm1, %eax
mulss 0x189b7c(%rip), %xmm0   # 0x5a3f04
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 0x189b82(%rip), %rdx    # 0x5a3f40
addq %rax, %rdx
movsd 0x189b4f(%rip), %xmm0   # 0x5a3f18
subsd (%rdx,%rcx,8), %xmm0
addsd %xmm0, %xmm0
cvtsd2ss %xmm0, %xmm0
movss %xmm0, 0x8(%rsp)
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x41a3f3
movq 0x20(%rsp), %rsi
subq %rdi, %rsi
callq 0x41b3a0
movq 0x30(%rsp), %rdi
testq %rdi, %rdi
je 0x41a40a
movq 0x40(%rsp), %rsi
subq %rdi, %rsi
callq 0x41b3a0
movss 0x8(%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 0x41a43f
movq 0x60(%rsp), %rsi
subq %rdi, %rsi
callq 0x41b3a0
jmp 0x41a43f
jmp 0x41a43c
jmp 0x41a43c
movq %rax, %rbx
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x41a456
movq 0x20(%rsp), %rsi
subq %rdi, %rsi
callq 0x41b3a0
movq 0x30(%rsp), %rdi
testq %rdi, %rdi
je 0x41a46d
movq 0x40(%rsp), %rsi
subq %rdi, %rsi
callq 0x41b3a0
movq %rbx, %rdi
callq 0x4c0230