// File: 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
movq %rsp, %rbp
subq $0x130, %rsp            # imm = 0x130
movq %rdi, -0xd0(%rbp)
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
leaq -0x40(%rbp), %rdi
callq 0x42b410
movl $0x0, -0x44(%rbp)
movl $0x0, -0x4c(%rbp)
leaq -0x68(%rbp), %rdi
callq 0x41f7d0
movq -0xd0(%rbp), %rsi
leaq -0x80(%rbp), %rdi
callq 0x410770
jmp 0x42aa2c
movq -0x10(%rbp), %rdi
callq 0x428210
movq -0xd0(%rbp), %rdi
callq 0x40fbc0
cmpq $0x0, %rax
jbe 0x42ad47
movss 0x18c499(%rip), %xmm0   # 0x5b6eec
movss %xmm0, -0x48(%rbp)
leaq -0x68(%rbp), %rdi
callq 0x4281f0
movl $0x0, -0x90(%rbp)
movq -0xd0(%rbp), %rdi
movl -0x90(%rbp), %eax
movq %rax, -0xd8(%rbp)
callq 0x40fbc0
movq %rax, %rcx
movq -0xd8(%rbp), %rax
cmpq %rcx, %rax
jae 0x42ab68
movq -0xd0(%rbp), %rdi
movl -0x90(%rbp), %eax
movl %eax, %esi
callq 0x40b8d0
movss (%rax), %xmm1
movss -0x48(%rbp), %xmm0
ucomiss %xmm1, %xmm0
jb 0x42ab52
movq -0xd0(%rbp), %rdi
movl -0x90(%rbp), %eax
movl %eax, %esi
callq 0x40b8d0
movss (%rax), %xmm1
movss -0x48(%rbp), %xmm0
ucomiss %xmm1, %xmm0
jbe 0x42ab1e
leaq -0x68(%rbp), %rdi
callq 0x4281f0
movq -0xd0(%rbp), %rdi
movl -0x90(%rbp), %eax
movl %eax, %esi
callq 0x40b8d0
movss (%rax), %xmm0
movss %xmm0, -0x48(%rbp)
jmp 0x42ab1e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x88(%rbp)
movl %eax, -0x8c(%rbp)
jmp 0x42adf3
leaq -0x68(%rbp), %rdi
leaq -0x90(%rbp), %rsi
callq 0x41f970
jmp 0x42ab30
jmp 0x42ab52
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x88(%rbp)
movl %eax, -0x8c(%rbp)
leaq -0x80(%rbp), %rdi
callq 0x40c2b0
jmp 0x42adf3
jmp 0x42ab54
movl -0x90(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x90(%rbp)
jmp 0x42aa6b
movl -0x44(%rbp), %eax
cvtsi2ss %rax, %xmm0
movss %xmm0, -0xec(%rbp)
leaq -0x68(%rbp), %rdi
movq %rdi, -0xe8(%rbp)
callq 0x420d40
movq %rax, %rdx
shrq %rdx
movl %eax, %ecx
andl $0x1, %ecx
orq %rdx, %rcx
cvtsi2ss %rcx, %xmm0
addss %xmm0, %xmm0
cvtsi2ss %rax, %xmm1
movss %xmm1, -0xe0(%rbp)
testq %rax, %rax
movss %xmm0, -0xdc(%rbp)
js 0x42abc9
movss -0xe0(%rbp), %xmm0
movss %xmm0, -0xdc(%rbp)
movq -0xe8(%rbp), %rdi
movss -0xec(%rbp), %xmm0
movss -0xdc(%rbp), %xmm1
addss %xmm0, %xmm0
addss %xmm1, %xmm0
movss 0x18b8cc(%rip), %xmm1   # 0x5b64bc
addss %xmm1, %xmm0
movss 0x18c2f4(%rip), %xmm1   # 0x5b6ef0
mulss %xmm1, %xmm0
movss %xmm0, -0x4c(%rbp)
movss -0x4c(%rbp), %xmm0
movss %xmm0, -0xfc(%rbp)
xorl %eax, %eax
movl %eax, %esi
callq 0x40b8b0
movq -0xd0(%rbp), %rdi
movl (%rax), %eax
movl %eax, %esi
callq 0x40b8d0
movq %rax, %rsi
leaq -0x40(%rbp), %rdi
callq 0x42b430
movq %rax, -0xf8(%rbp)
jmp 0x42ac40
movq -0xf8(%rbp), %rax
movss -0xfc(%rbp), %xmm0
movss %xmm0, (%rax)
movl $0x0, -0x94(%rbp)
movl -0x94(%rbp), %eax
movq %rax, -0x108(%rbp)
leaq -0x68(%rbp), %rdi
callq 0x420d40
movq %rax, %rcx
movq -0x108(%rbp), %rax
cmpq %rcx, %rax
jae 0x42ad2d
movq -0xd0(%rbp), %rdi
callq 0x40fac0
movq %rax, -0xb8(%rbp)
movl -0x94(%rbp), %eax
movl %eax, %esi
leaq -0x68(%rbp), %rdi
callq 0x40b8b0
movl (%rax), %eax
movl %eax, %esi
leaq -0xb8(%rbp), %rdi
callq 0x41b130
movq %rax, -0xb0(%rbp)
movl -0x94(%rbp), %eax
movl %eax, %esi
leaq -0xb0(%rbp), %rdi
callq 0x40fe50
movq %rax, -0xa8(%rbp)
leaq -0xa0(%rbp), %rdi
leaq -0xa8(%rbp), %rsi
callq 0x4168b0
movq -0xd0(%rbp), %rdi
movq -0xa0(%rbp), %rsi
callq 0x42b510
movq %rax, -0x110(%rbp)
jmp 0x42ad0b
movq -0x110(%rbp), %rax
movq %rax, -0xc0(%rbp)
movl -0x94(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x94(%rbp)
jmp 0x42ac5d
leaq -0x68(%rbp), %rdi
callq 0x420d40
movq %rax, %rcx
movl -0x44(%rbp), %eax
addq %rcx, %rax
movl %eax, -0x44(%rbp)
jmp 0x42aa35
movl $0x0, -0xc4(%rbp)
movl -0xc4(%rbp), %eax
movq %rax, -0x118(%rbp)
leaq -0x80(%rbp), %rdi
callq 0x40fbc0
movq %rax, %rcx
movq -0x118(%rbp), %rax
cmpq %rcx, %rax
jae 0x42adcf
movq -0x10(%rbp), %rax
movq %rax, -0x128(%rbp)
movl -0xc4(%rbp), %eax
movl %eax, %esi
leaq -0x80(%rbp), %rdi
callq 0x40b8d0
movq %rax, %rsi
leaq -0x40(%rbp), %rdi
callq 0x42b430
movq %rax, -0x120(%rbp)
jmp 0x42ada7
movq -0x120(%rbp), %rsi
movq -0x128(%rbp), %rdi
callq 0x416240
jmp 0x42adbc
jmp 0x42adbe
movl -0xc4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xc4(%rbp)
jmp 0x42ad51
leaq -0x80(%rbp), %rdi
callq 0x40c2b0
leaq -0x68(%rbp), %rdi
callq 0x41f8b0
leaq -0x40(%rbp), %rdi
callq 0x42b580
addq $0x130, %rsp            # imm = 0x130
popq %rbp
retq
leaq -0x68(%rbp), %rdi
callq 0x41f8b0
leaq -0x40(%rbp), %rdi
callq 0x42b580
movq -0x88(%rbp), %rdi
callq 0x4d3c10
nopw %cs:(%rax,%rax)