// File: /workspace/github_cpp_makefile_star2_O3/ChnMasterOG[P]KmerGO2/stats_ml/stats.cpp
// Function: getrank(std::vector<float, std::allocator<float>>, std::vector<float, std::allocator<float>>&)
void getrank(std::vector<float> group, std::vector<float>& grouprank)
{
	std::map<float, float> mapIndex;
	uint32_t int_rank = 0;
	float min_data, float_rank = 0;
	std::vector<uint32_t> min_data_index;
	std::vector<float> group_s = group;
	grouprank.clear();

	while (group.size() > 0)
	{
		min_data = 999999;
		min_data_index.clear();
		for (uint32_t i = 0; i < group.size(); i++)
		{
			if (group[i] <= min_data)
			{
				if (group[i] < min_data) {
					min_data_index.clear();
					min_data = group[i];
				}
				min_data_index.push_back(i);
			}
		}
		float_rank = (2 * (float)int_rank + min_data_index.size() + 1) / 2;
		mapIndex[group[min_data_index[0]]] = float_rank;
		for (uint32_t i = 0; i < min_data_index.size(); i++)
		{	
			group.erase(group.begin() + min_data_index[i] - i);
		}
		int_rank += min_data_index.size();
	}

	for (uint32_t i = 0; i < group_s.size(); i++)
	{
		grouprank.push_back(mapIndex[group_s[i]]);
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x78, %rsp
movq %rsi, %rbx
movq %rdi, %r14
leaq 0x50(%rsp), %rax
movl $0x0, (%rax)
xorl %ecx, %ecx
movq %rcx, 0x8(%rax)
movq %rax, 0x10(%rax)
movq %rax, 0x18(%rax)
movq %rcx, 0x20(%rax)
movq %rcx, 0x20(%rsp)
xorps %xmm0, %xmm0
movaps %xmm0, 0x10(%rsp)
leaq 0x30(%rsp), %rdi
movq %r14, %rsi
callq 0x40bdce
movq (%rbx), %rax
cmpq %rax, 0x8(%rbx)
je 0x419a30
movq %rax, 0x8(%rbx)
movq (%r14), %rax
movq 0x8(%r14), %rdx
cmpq %rax, %rdx
je 0x419be2
xorl %r12d, %r12d
xorl %r15d, %r15d
xorl %ebp, %ebp
cmpq %r15, %r12
je 0x419a55
movq %r15, 0x18(%rsp)
movq %r15, %r12
movl $0x0, 0xc(%rsp)
cmpq %rax, %rdx
je 0x419aff
xorl %ecx, %ecx
movss 0x189484(%rip), %xmm0   # 0x5a2ef4
leaq 0x10(%rsp), %r15
leaq 0xc(%rsp), %r12
movss (%rax,%rcx,4), %xmm1
movss %xmm1, 0x8(%rsp)
ucomiss %xmm1, %xmm0
jb 0x419adc
movq 0x18(%rsp), %rdi
jbe 0x419aa2
movq 0x10(%rsp), %rsi
cmpq %rsi, %rdi
je 0x419aad
movq %rsi, 0x18(%rsp)
jmp 0x419ab0
movq %rdi, %rsi
movss %xmm0, 0x8(%rsp)
jmp 0x419ab0
movq %rdi, %rsi
cmpq 0x20(%rsp), %rsi
je 0x419ac4
movl %ecx, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x18(%rsp)
jmp 0x419ad6
movq %r15, %rdi
movq %r12, %rdx
callq 0x41455e
movq (%r14), %rax
movq 0x8(%r14), %rdx
movss 0x8(%rsp), %xmm0
movl 0xc(%rsp), %ecx
incl %ecx
movl %ecx, 0xc(%rsp)
movq %rdx, %rsi
subq %rax, %rsi
sarq $0x2, %rsi
cmpq %rcx, %rsi
ja 0x419a7a
movq 0x10(%rsp), %r15
movq 0x18(%rsp), %r12
movl (%r15), %ecx
leaq (%rax,%rcx,4), %rsi
leaq 0x48(%rsp), %rdi
callq 0x41a0ac
subq %r15, %r12
sarq $0x2, %r12
js 0x419b23
xorps %xmm0, %xmm0
cvtsi2ss %r12, %xmm0
jmp 0x419b3c
movq %r12, %rcx
shrq %rcx
andl $0x1, %r12d
orq %rcx, %r12
xorps %xmm0, %xmm0
cvtsi2ss %r12, %xmm0
addss %xmm0, %xmm0
movl %ebp, %ecx
xorps %xmm1, %xmm1
cvtsi2ss %rcx, %xmm1
addss %xmm1, %xmm1
addss %xmm0, %xmm1
addss 0x188982(%rip), %xmm1   # 0x5a24d8
mulss 0x188976(%rip), %xmm1   # 0x5a24d4
movss %xmm1, (%rax)
movq 0x10(%rsp), %r15
movq 0x18(%rsp), %r12
movq %r12, %rax
movq 0x8(%r14), %rdx
subq %r15, %rax
je 0x419bd0
movl $0x1, %r13d
xorl %ecx, %ecx
movl (%r15,%rcx,4), %edi
shlq $0x2, %rdi
addq (%r14), %rdi
shlq $0x2, %rcx
subq %rcx, %rdi
leaq 0x4(%rdi), %rsi
cmpq %rdx, %rsi
je 0x419bb1
subq %rsi, %rdx
callq 0x401020
movq 0x8(%r14), %rdx
movq 0x10(%rsp), %r15
movq 0x18(%rsp), %r12
addq $-0x4, %rdx
movq %rdx, 0x8(%r14)
movl %r13d, %ecx
movq %r12, %rax
subq %r15, %rax
sarq $0x2, %rax
incl %r13d
cmpq %rcx, %rax
ja 0x419b80
jmp 0x419bd4
sarq $0x2, %rax
addl %eax, %ebp
movq (%r14), %rax
cmpq %rax, %rdx
jne 0x419a48
movq 0x30(%rsp), %rdi
cmpq %rdi, 0x38(%rsp)
je 0x419c47
movl $0x1, %ebp
xorl %eax, %eax
leaq 0x48(%rsp), %r14
leaq (%rdi,%rax,4), %rsi
movq %r14, %rdi
callq 0x41a0ac
movq 0x8(%rbx), %rsi
cmpq 0x10(%rbx), %rsi
je 0x419c22
movss (%rax), %xmm0
movss %xmm0, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x8(%rbx)
jmp 0x419c2d
movq %rbx, %rdi
movq %rax, %rdx
callq 0x4101ee
movl %ebp, %eax
movq 0x30(%rsp), %rdi
movq 0x38(%rsp), %rcx
subq %rdi, %rcx
sarq $0x2, %rcx
incl %ebp
cmpq %rax, %rcx
ja 0x419bfa
testq %rdi, %rdi
je 0x419c59
movq 0x40(%rsp), %rsi
subq %rdi, %rsi
callq 0x41ae90
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x419c70
movq 0x20(%rsp), %rsi
subq %rdi, %rsi
callq 0x41ae90
leaq 0x48(%rsp), %rdi
callq 0x41a116
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
jmp 0x419cac
jmp 0x419c92
jmp 0x419c92
movq %rax, %rbx
movq 0x30(%rsp), %rdi
testq %rdi, %rdi
je 0x419cac
movq 0x40(%rsp), %rsi
subq %rdi, %rsi
callq 0x41ae90
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x419cc3
movq 0x20(%rsp), %rsi
subq %rdi, %rsi
callq 0x41ae90
leaq 0x48(%rsp), %rdi
callq 0x41a116
movq %rbx, %rdi
callq 0x4bfce0