// File: /workspace/github_cpp_makefile_star2_O1/lionalion[P]clusterization/clust_w2v.cpp
// Function: firstClast(std::vector<std::map<int, float, std::less<int>, std::allocator<std::pair<int const, float>>>, std::allocator<std::map<int, float, std::less<int>, std::allocator<std::pair<int const, float>>>>>, std::vector<int, std::allocator<int>>, float, std::vector<std::vector<std::map<int, float, std::less<int>, std::allocator<std::pair<int const, float>>>, std::allocator<std::map<int, float, std::less<int>, std::allocator<std::pair<int const, float>>>>>, std::allocator<std::vector<std::map<int, float, std::less<int>, std::allocator<std::pair<int const, float>>>, std::allocator<std::map<int, float, std::less<int>, std::allocator<std::pair<int const, float>>>>>>>&, std::vector<std::vector<int, std::allocator<int>>, std::allocator<std::vector<int, std::allocator<int>>>>&)
void firstClast (std::vector < std::map <int,float> > vCls, std::vector < int > vId, float th2, std::vector < std::vector <std::map<int,float> > > & vMapCls, std::vector < std::vector < int > > & vIdStr){
	std::multimap<int,int>  vMapRang;
	for (int id=0; id<vCls.size(); id++)
		vMapRang.insert(std::pair<int,int>(vCls[id].size(),id));

	int cnt=0;
	for ( std::multimap<int,int>::const_reverse_iterator fst = vMapRang.rbegin(); fst != vMapRang.rend(); ++fst){	
		
		bool flg=false;
		for (int a=0; a<vIdStr.size();a++){
			for (int b=0; b<vIdStr[a].size();b++){
				int tmp=(*fst).second;
				if(vId[ (*fst).second ] == vIdStr[a][b]){
					flg=true;
					break;
				}
			}
			if (flg==true)
				break;
		}
		
		if (flg==false){
			vMapCls.resize(vMapCls.size()+1);
			vIdStr.resize(vIdStr.size()+1);
			vMapCls[cnt].push_back(vCls[ (*fst).second ]);
			vIdStr[cnt].push_back(vId[(*fst).second ]);

			for ( std::multimap<int,int>::const_reverse_iterator scnd = fst; scnd != vMapRang.rend(); ++scnd){
				if (fst!=scnd){
					std::map<int,float>::const_iterator itv = vCls[ (*fst).second ].begin();			
					int comp=0;
					for ( std::map<int,float>::const_iterator itr = vCls[ (*scnd).second ].begin(); itr != vCls[ (*scnd).second ].end(); ++itr){
						std::map<int,float>::const_iterator itv = vCls[ (*fst).second ].begin();
						itv = vCls[ (*fst).second ].find( (*itr).first );
						if(itv != vCls[ (*fst).second ].end() )
							comp++;
					}
					
					if( vCls[ (*fst).second ].size()*th2 < comp){
						vMapCls[cnt].push_back(vCls[ (*scnd).second ]);
						vIdStr[cnt].push_back(vId[(*scnd).second ]);
					}
				}
			}
			cnt++;
		}
	}
	vCls.clear();	
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x98, %rsp
movq %rcx, -0x40(%rbp)
movq %rdx, -0x48(%rbp)
movss %xmm0, -0x64(%rbp)
movq %rsi, -0x50(%rbp)
leaq -0xb8(%rbp), %r12
movl $0x0, (%r12)
xorl %eax, %eax
movq %rax, 0x8(%r12)
movq %r12, 0x10(%r12)
movq %r12, 0x18(%r12)
movq %rax, 0x20(%r12)
movq (%rdi), %rax
movq %rdi, -0x30(%rbp)
cmpq %rax, 0x8(%rdi)
je 0x2baf
movl $0x28, %ebx
xorl %r15d, %r15d
leaq -0xc0(%rbp), %r14
leaq -0x78(%rbp), %r13
movl (%rax,%rbx), %eax
movl %eax, -0x78(%rbp)
movl %r15d, -0x74(%rbp)
movq %r14, %rdi
movq %r13, %rsi
callq 0x5490
incq %r15
movq -0x30(%rbp), %rcx
movq (%rcx), %rax
movq 0x8(%rcx), %rcx
subq %rax, %rcx
sarq $0x4, %rcx
movabsq $-0x5555555555555555, %rdx # imm = 0xAAAAAAAAAAAAAAAB
imulq %rdx, %rcx
addq $0x30, %rbx
cmpq %r15, %rcx
ja 0x2b6e
cmpq -0xa8(%rbp), %r12
je 0x2ef6
movl $0x0, -0x34(%rbp)
movq -0x40(%rbp), %rax
movq (%rax), %rcx
movq 0x8(%rax), %r14
movq %rcx, -0x60(%rbp)
subq %rcx, %r14
movq %r12, -0x58(%rbp)
je 0x2c68
sarq $0x3, %r14
movabsq $-0x5555555555555555, %rax # imm = 0xAAAAAAAAAAAAAAAB
imulq %rax, %r14
xorl %ebx, %ebx
xorl %r12d, %r12d
leaq (%rbx,%rbx,2), %rax
movq -0x60(%rbp), %rcx
movq (%rcx,%rax,8), %r13
movq 0x8(%rcx,%rax,8), %r15
subq %r13, %r15
je 0x2c4c
sarq $0x2, %r15
movq -0x58(%rbp), %rdi
callq 0x2130
movl $0x1, %esi
movslq 0x24(%rax), %rax
movq -0x50(%rbp), %rcx
movq (%rcx), %rcx
movl (%rcx,%rax,4), %eax
movl $0x1, %ecx
movzbl %r12b, %r12d
cmpl -0x4(%r13,%rcx,4), %eax
cmovel %esi, %r12d
je 0x2c4c
leaq 0x1(%rcx), %rdx
cmpq %rcx, %r15
movq %rdx, %rcx
ja 0x2c31
testb $0x1, %r12b
jne 0x2c5a
incq %rbx
cmpq %rbx, %r14
ja 0x2bf6
testb $0x1, %r12b
movq -0x58(%rbp), %r12
jne 0x2ede
movq -0x48(%rbp), %rdi
movq 0x8(%rdi), %rsi
subq (%rdi), %rsi
sarq $0x3, %rsi
movabsq $-0x5555555555555555, %rax # imm = 0xAAAAAAAAAAAAAAAB
imulq %rax, %rsi
incq %rsi
callq 0x4a38
movq -0x40(%rbp), %rdi
movq 0x8(%rdi), %rsi
subq (%rdi), %rsi
sarq $0x3, %rsi
movabsq $-0x5555555555555555, %rax # imm = 0xAAAAAAAAAAAAAAAB
imulq %rax, %rsi
incq %rsi
callq 0x49f4
movslq -0x34(%rbp), %rax
leaq (%rax,%rax,2), %rax
movq %rax, -0x70(%rbp)
leaq (,%rax,8), %rcx
movq -0x48(%rbp), %rax
movq (%rax), %r14
movq %rcx, -0x80(%rbp)
addq %rcx, %r14
movq %r12, %rdi
callq 0x2130
movslq 0x24(%rax), %rax
leaq (%rax,%rax,2), %rsi
shlq $0x4, %rsi
movq -0x30(%rbp), %rax
addq (%rax), %rsi
movq %r14, %rdi
callq 0x4ab0
movq -0x40(%rbp), %rax
movq (%rax), %rax
movq -0x70(%rbp), %rcx
leaq (%rax,%rcx,8), %r14
movq %r12, %rdi
callq 0x2130
movslq 0x24(%rax), %rdx
shlq $0x2, %rdx
movq -0x50(%rbp), %rax
addq (%rax), %rdx
movq 0x8(%r14), %rsi
cmpq 0x10(%r14), %rsi
je 0x2d35
movl (%rdx), %eax
movl %eax, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x8(%r14)
jmp 0x2d3d
movq %r14, %rdi
callq 0x599a
movq %r12, %rbx
cmpq -0xa8(%rbp), %r12
je 0x2edb
cmpq %rbx, %r12
je 0x2ec3
movq %r12, %rdi
callq 0x2130
movslq 0x24(%rax), %rax
movq -0x30(%rbp), %rcx
movq (%rcx), %r13
leaq (%rax,%rax,2), %r15
shlq $0x4, %r15
addq %r13, %r15
movq %rbx, %rdi
callq 0x2130
movslq 0x24(%rax), %rax
leaq (%rax,%rax,2), %rdx
shlq $0x4, %rdx
leaq (%rdx,%r13), %r14
addq $0x8, %r14
movq 0x10(%r14), %rax
cmpq %r14, %rax
je 0x2e2f
movq %rdx, -0x88(%rbp)
movq %r13, -0x90(%rbp)
movq %rbx, -0x60(%rbp)
movq 0x10(%r15), %r12
leaq 0x8(%r15), %rbx
xorl %r13d, %r13d
movq %rbx, %rcx
testq %r12, %r12
je 0x2de2
movl 0x20(%rax), %edx
movq %r12, %rsi
movq %rbx, %rcx
xorl %edi, %edi
cmpl %edx, 0x20(%rsi)
setl %dil
cmovgeq %rsi, %rcx
movq 0x10(%rsi,%rdi,8), %rsi
testq %rsi, %rsi
jne 0x2dcb
movq %rbx, %rdx
cmpq %rbx, %rcx
je 0x2df7
movl 0x20(%rax), %edx
cmpl 0x20(%rcx), %edx
cmovlq %rbx, %rcx
movq %rcx, %rdx
xorl %ecx, %ecx
cmpq %rbx, %rdx
setne %cl
addl %ecx, %r13d
movq %rax, %rdi
callq 0x2230
cmpq %r14, %rax
jne 0x2dba
xorps %xmm0, %xmm0
cvtsi2ss %r13d, %xmm0
movq -0x58(%rbp), %r12
movq -0x60(%rbp), %rbx
movq -0x90(%rbp), %r13
movq -0x88(%rbp), %rdx
jmp 0x2e32
xorps %xmm0, %xmm0
movq 0x28(%r15), %rax
testq %rax, %rax
js 0x2e45
xorps %xmm1, %xmm1
cvtsi2ss %rax, %xmm1
jmp 0x2e5d
movq %rax, %rcx
shrq %rcx
andl $0x1, %eax
orq %rcx, %rax
xorps %xmm1, %xmm1
cvtsi2ss %rax, %xmm1
addss %xmm1, %xmm1
mulss -0x64(%rbp), %xmm1
ucomiss %xmm1, %xmm0
jbe 0x2ec3
addq %rdx, %r13
movq -0x48(%rbp), %rax
movq (%rax), %rdi
addq -0x80(%rbp), %rdi
movq %r13, %rsi
callq 0x4ab0
movq -0x40(%rbp), %rax
movq (%rax), %rax
movq -0x70(%rbp), %rcx
leaq (%rax,%rcx,8), %r14
movq %rbx, %rdi
callq 0x2130
movslq 0x24(%rax), %rdx
shlq $0x2, %rdx
movq -0x50(%rbp), %rax
addq (%rax), %rdx
movq 0x8(%r14), %rsi
cmpq 0x10(%r14), %rsi
je 0x2ebb
movl (%rdx), %eax
movl %eax, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x8(%r14)
jmp 0x2ec3
movq %r14, %rdi
callq 0x599a
movq %rbx, %rdi
callq 0x2130
movq %rax, %rbx
cmpq -0xa8(%rbp), %rax
jne 0x2d4d
incl -0x34(%rbp)
movq %r12, %rdi
callq 0x2130
movq %rax, %r12
cmpq -0xa8(%rbp), %rax
jne 0x2bc3
movq -0x30(%rbp), %rax
movq (%rax), %rbx
movq 0x8(%rax), %r15
cmpq %rbx, %r15
je 0x2f22
movq %rbx, %r14
movq %r14, %rdi
callq 0x52e8
addq $0x30, %r14
cmpq %r15, %r14
jne 0x2f09
movq -0x30(%rbp), %rax
movq %rbx, 0x8(%rax)
leaq -0xc0(%rbp), %rdi
callq 0x528a
addq $0x98, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x2f44
jmp 0x2f44
movq %rax, %rbx
leaq -0xc0(%rbp), %rdi
callq 0x528a
movq %rbx, %rdi
callq 0x2340