// File: /workspace/github_cpp_makefile_star2_O1/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 0x28(%rsp), %rdi
movq %r14, %rsi
callq 0x40c0a2
movq (%rbx), %rax
cmpq %rax, 0x8(%rbx)
je 0x419fa0
movq %rax, 0x8(%rbx)
movq %rbx, 0x40(%rsp)
movq 0x8(%r14), %rax
cmpq (%r14), %rax
je 0x41a13b
xorl %ebp, %ebp
leaq 0x10(%rsp), %r13
leaq 0xc(%rsp), %rbx
movq 0x10(%rsp), %rax
cmpq %rax, 0x18(%rsp)
je 0x419fcf
movq %rax, 0x18(%rsp)
movl $0x0, 0xc(%rsp)
movq (%r14), %rcx
cmpq %rcx, 0x8(%r14)
je 0x41a05a
xorl %eax, %eax
movss 0x189f0e(%rip), %xmm0   # 0x5a3ef8
movss %xmm0, 0x8(%rsp)
movss (%rcx,%rax,4), %xmm0
movss 0x8(%rsp), %xmm1
ucomiss %xmm0, %xmm1
jb 0x41a03d
jbe 0x41a019
movq 0x10(%rsp), %rcx
cmpq %rcx, 0x18(%rsp)
je 0x41a013
movq %rcx, 0x18(%rsp)
movss %xmm0, 0x8(%rsp)
movq 0x18(%rsp), %rsi
cmpq 0x20(%rsp), %rsi
je 0x41a032
movl %eax, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x18(%rsp)
jmp 0x41a03d
movq %r13, %rdi
movq %rbx, %rdx
callq 0x41490a
movl 0xc(%rsp), %eax
incl %eax
movl %eax, 0xc(%rsp)
movq (%r14), %rcx
movq 0x8(%r14), %rdx
subq %rcx, %rdx
sarq $0x2, %rdx
cmpq %rax, %rdx
ja 0x419ff0
movq 0x10(%rsp), %r12
movq 0x18(%rsp), %r15
movl (%r12), %eax
leaq (%rcx,%rax,4), %rsi
leaq 0x48(%rsp), %rdi
callq 0x41a632
subq %r12, %r15
sarq $0x2, %r15
js 0x41a089
xorps %xmm0, %xmm0
cvtsi2ss %r15, %xmm0
jmp 0x41a0a2
movq %r15, %rcx
shrq %rcx
andl $0x1, %r15d
orq %rcx, %r15
xorps %xmm0, %xmm0
cvtsi2ss %r15, %xmm0
addss %xmm0, %xmm0
movl %ebp, %ecx
xorps %xmm1, %xmm1
cvtsi2ss %rcx, %xmm1
addss %xmm1, %xmm1
addss %xmm0, %xmm1
addss 0x189418(%rip), %xmm1   # 0x5a34d4
mulss 0x18940c(%rip), %xmm1   # 0x5a34d0
movss %xmm1, (%rax)
movq 0x10(%rsp), %rcx
movq 0x18(%rsp), %rdx
subq %rcx, %rdx
je 0x41a128
movl $0x1, %r15d
xorl %eax, %eax
movl (%rcx,%rax,4), %edi
shlq $0x2, %rax
shlq $0x2, %rdi
addq (%r14), %rdi
subq %rax, %rdi
leaq 0x4(%rdi), %rsi
movq 0x8(%r14), %rdx
cmpq %rdx, %rsi
je 0x41a105
subq %rsi, %rdx
callq 0x401020
addq $-0x4, 0x8(%r14)
movl %r15d, %eax
movq 0x10(%rsp), %rcx
movq 0x18(%rsp), %rdx
subq %rcx, %rdx
sarq $0x2, %rdx
incl %r15d
cmpq %rax, %rdx
ja 0x41a0df
jmp 0x41a12c
sarq $0x2, %rdx
addl %edx, %ebp
movq 0x8(%r14), %rax
cmpq (%r14), %rax
jne 0x419fbe
movq 0x28(%rsp), %rdi
cmpq %rdi, 0x30(%rsp)
je 0x41a1a5
movl $0x1, %ebp
xorl %eax, %eax
leaq 0x48(%rsp), %r14
movq 0x40(%rsp), %rbx
leaq (%rdi,%rax,4), %rsi
movq %r14, %rdi
callq 0x41a632
movq 0x8(%rbx), %rsi
cmpq 0x10(%rbx), %rsi
je 0x41a180
movss (%rax), %xmm0
movss %xmm0, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x8(%rbx)
jmp 0x41a18b
movq %rbx, %rdi
movq %rax, %rdx
callq 0x410512
movl %ebp, %eax
movq 0x28(%rsp), %rdi
movq 0x30(%rsp), %rcx
subq %rdi, %rcx
sarq $0x2, %rcx
incl %ebp
cmpq %rax, %rcx
ja 0x41a158
testq %rdi, %rdi
je 0x41a1b7
movq 0x38(%rsp), %rsi
subq %rdi, %rsi
callq 0x41b3a0
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x41a1ce
movq 0x20(%rsp), %rsi
subq %rdi, %rsi
callq 0x41b3a0
leaq 0x48(%rsp), %rdi
callq 0x41a69a
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
jmp 0x41a20a
jmp 0x41a1f0
jmp 0x41a1f0
movq %rax, %rbx
movq 0x28(%rsp), %rdi
testq %rdi, %rdi
je 0x41a20a
movq 0x38(%rsp), %rsi
subq %rdi, %rsi
callq 0x41b3a0
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x41a221
movq 0x20(%rsp), %rsi
subq %rdi, %rsi
callq 0x41b3a0
leaq 0x48(%rsp), %rdi
callq 0x41a69a
movq %rbx, %rdi
callq 0x4c0230