// File: 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
subq $0x250, %rsp            # imm = 0x250
movq %rdi, -0x140(%rbp)
movq %rsi, -0x138(%rbp)
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movss %xmm0, -0x14(%rbp)
movq %rdx, -0x20(%rbp)
movq %rcx, -0x28(%rbp)
leaq -0x58(%rbp), %rdi
callq 0x56d0
movl $0x0, -0x5c(%rbp)
movq -0x140(%rbp), %rdi
movslq -0x5c(%rbp), %rax
movq %rax, -0x148(%rbp)
callq 0x5770
movq %rax, %rcx
movq -0x148(%rbp), %rax
cmpq %rcx, %rax
jae 0x311f
movq -0x140(%rbp), %rdi
movslq -0x5c(%rbp), %rsi
callq 0x5b90
movq %rax, %rdi
callq 0x5c80
movq %rax, -0x70(%rbp)
leaq -0x64(%rbp), %rdi
leaq -0x70(%rbp), %rsi
leaq -0x5c(%rbp), %rdx
callq 0x57a0
jmp 0x30d3
leaq -0x58(%rbp), %rdi
leaq -0x64(%rbp), %rsi
callq 0x5720
movq %rax, -0x150(%rbp)
jmp 0x30e9
movq -0x150(%rbp), %rax
movq %rax, -0x88(%rbp)
movl -0x5c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x5c(%rbp)
jmp 0x307e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x78(%rbp)
movl %eax, -0x7c(%rbp)
leaq -0x58(%rbp), %rdi
callq 0x5c60
jmp 0x386b
movl $0x0, -0x8c(%rbp)
leaq -0xa0(%rbp), %rdi
movq %rdi, -0x158(%rbp)
leaq -0x58(%rbp), %rsi
callq 0x57f0
movq -0x158(%rbp), %rsi
leaq -0x98(%rbp), %rdi
callq 0x5820
jmp 0x3155
jmp 0x3157
leaq -0xa8(%rbp), %rdi
movq %rdi, -0x168(%rbp)
leaq -0x58(%rbp), %rsi
callq 0x58a0
movq -0x168(%rbp), %rsi
leaq -0x98(%rbp), %rdi
callq 0x5850
movb %al, -0x159(%rbp)
jmp 0x3189
movb -0x159(%rbp), %al
testb $0x1, %al
jne 0x3198
jmp 0x384d
movb $0x0, -0xa9(%rbp)
movl $0x0, -0xb0(%rbp)
movslq -0xb0(%rbp), %rax
movq %rax, -0x170(%rbp)
movq -0x28(%rbp), %rdi
callq 0x59f0
movq %rax, %rcx
movq -0x170(%rbp), %rax
cmpq %rcx, %rax
jae 0x32e2
movl $0x0, -0xb4(%rbp)
movslq -0xb4(%rbp), %rax
movq %rax, -0x178(%rbp)
movq -0x28(%rbp), %rdi
movslq -0xb0(%rbp), %rsi
callq 0x5940
movq %rax, %rdi
callq 0x58d0
movq %rax, %rcx
movq -0x178(%rbp), %rax
cmpq %rcx, %rax
jae 0x32ba
leaq -0x98(%rbp), %rdi
callq 0x5910
movq %rax, -0x180(%rbp)
jmp 0x322b
movq -0x180(%rbp), %rax
movl 0x4(%rax), %eax
movl %eax, -0xb8(%rbp)
leaq -0x98(%rbp), %rdi
callq 0x5910
movq %rax, -0x188(%rbp)
jmp 0x3250
movq -0x138(%rbp), %rdi
movq -0x188(%rbp), %rax
movslq 0x4(%rax), %rsi
callq 0x58f0
movl (%rax), %eax
movl %eax, -0x18c(%rbp)
movq -0x28(%rbp), %rdi
movslq -0xb0(%rbp), %rsi
callq 0x5940
movq %rax, %rdi
movslq -0xb4(%rbp), %rsi
callq 0x58f0
movq %rax, %rcx
movl -0x18c(%rbp), %eax
cmpl (%rcx), %eax
jne 0x32a4
movb $0x1, -0xa9(%rbp)
jmp 0x32ba
jmp 0x32a6
movl -0xb4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xb4(%rbp)
jmp 0x31dd
movb -0xa9(%rbp), %al
andb $0x1, %al
movzbl %al, %eax
cmpl $0x1, %eax
jne 0x32cc
jmp 0x32e2
jmp 0x32ce
movl -0xb0(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xb0(%rbp)
jmp 0x31a9
movb -0xa9(%rbp), %al
andb $0x1, %al
movzbl %al, %eax
cmpl $0x0, %eax
jne 0x3838
movq -0x20(%rbp), %rdi
movq %rdi, -0x198(%rbp)
callq 0x56f0
movq -0x198(%rbp), %rdi
movq %rax, %rsi
incq %rsi
callq 0x5a20
jmp 0x331a
movq -0x28(%rbp), %rdi
movq %rdi, -0x1a0(%rbp)
callq 0x59f0
movq -0x1a0(%rbp), %rdi
movq %rax, %rsi
incq %rsi
callq 0x5960
jmp 0x333e
movq -0x20(%rbp), %rdi
movslq -0x8c(%rbp), %rsi
callq 0x5750
movq %rax, -0x1b0(%rbp)
leaq -0x98(%rbp), %rdi
callq 0x5910
movq %rax, -0x1a8(%rbp)
jmp 0x336a
movq -0x140(%rbp), %rdi
movq -0x1a8(%rbp), %rax
movslq 0x4(%rax), %rsi
callq 0x5b90
movq -0x1b0(%rbp), %rdi
movq %rax, %rsi
callq 0x5b20
jmp 0x3392
movq -0x28(%rbp), %rdi
movslq -0x8c(%rbp), %rsi
callq 0x5940
movq %rax, -0x1c0(%rbp)
leaq -0x98(%rbp), %rdi
callq 0x5910
movq %rax, -0x1b8(%rbp)
jmp 0x33be
movq -0x138(%rbp), %rdi
movq -0x1b8(%rbp), %rax
movslq 0x4(%rax), %rsi
callq 0x58f0
movq -0x1c0(%rbp), %rdi
movq %rax, %rsi
callq 0x5ab0
jmp 0x33e6
leaq -0xc0(%rbp), %rdi
leaq -0x98(%rbp), %rsi
callq 0x5bb0
jmp 0x33fb
jmp 0x33fd
leaq -0xc8(%rbp), %rdi
movq %rdi, -0x1d0(%rbp)
leaq -0x58(%rbp), %rsi
callq 0x58a0
movq -0x1d0(%rbp), %rsi
leaq -0xc0(%rbp), %rdi
callq 0x5850
movb %al, -0x1c1(%rbp)
jmp 0x342f
movb -0x1c1(%rbp), %al
testb $0x1, %al
jne 0x343e
jmp 0x3829
leaq -0x98(%rbp), %rdi
leaq -0xc0(%rbp), %rsi
callq 0x5ca0
movb %al, -0x1d1(%rbp)
jmp 0x3459
movb -0x1d1(%rbp), %al
testb $0x1, %al
jne 0x3468
jmp 0x3814
leaq -0x98(%rbp), %rdi
callq 0x5910
movq %rax, -0x1e0(%rbp)
jmp 0x347d
movq -0x140(%rbp), %rdi
movq -0x1e0(%rbp), %rax
movslq 0x4(%rax), %rsi
callq 0x5b90
movq %rax, %rdi
callq 0x5cd0
movq %rax, -0xd8(%rbp)
leaq -0xd0(%rbp), %rdi
leaq -0xd8(%rbp), %rsi
callq 0x5d00
movl $0x0, -0xdc(%rbp)
leaq -0xc0(%rbp), %rdi
callq 0x5910
movq %rax, -0x1e8(%rbp)
jmp 0x34d5
movq -0x140(%rbp), %rdi
movq -0x1e8(%rbp), %rax
movslq 0x4(%rax), %rsi
callq 0x5b90
movq %rax, %rdi
callq 0x5cd0
movq %rax, -0xf0(%rbp)
leaq -0xe8(%rbp), %rdi
leaq -0xf0(%rbp), %rsi
callq 0x5d00
leaq -0xc0(%rbp), %rdi
callq 0x5910
movq %rax, -0x1f0(%rbp)
jmp 0x3523
movq -0x140(%rbp), %rdi
movq -0x1f0(%rbp), %rax
movslq 0x4(%rax), %rsi
callq 0x5b90
movq %rax, %rdi
callq 0x5d50
movq %rax, -0x100(%rbp)
leaq -0xf8(%rbp), %rdi
leaq -0x100(%rbp), %rsi
callq 0x5d00
leaq -0xe8(%rbp), %rdi
leaq -0xf8(%rbp), %rsi
callq 0x5d20
testb $0x1, %al
jne 0x3578
jmp 0x36d5
leaq -0x98(%rbp), %rdi
callq 0x5910
movq %rax, -0x1f8(%rbp)
jmp 0x358d
movq -0x140(%rbp), %rdi
movq -0x1f8(%rbp), %rax
movslq 0x4(%rax), %rsi
callq 0x5b90
movq %rax, %rdi
callq 0x5cd0
movq %rax, -0x110(%rbp)
leaq -0x108(%rbp), %rdi
leaq -0x110(%rbp), %rsi
callq 0x5d00
leaq -0x98(%rbp), %rdi
callq 0x5910
movq %rax, -0x200(%rbp)
jmp 0x35db
movq -0x140(%rbp), %rdi
movq -0x200(%rbp), %rax
movslq 0x4(%rax), %rsi
callq 0x5b90
movq %rax, -0x210(%rbp)
leaq -0xe8(%rbp), %rdi
callq 0x5db0
movq -0x210(%rbp), %rdi
movq %rax, %rsi
callq 0x5d80
movq %rax, -0x208(%rbp)
jmp 0x361d
movq -0x208(%rbp), %rax
movq %rax, -0x120(%rbp)
leaq -0x118(%rbp), %rdi
leaq -0x120(%rbp), %rsi
callq 0x5d00
movq -0x118(%rbp), %rax
movq %rax, -0x108(%rbp)
leaq -0x98(%rbp), %rdi
callq 0x5910
movq %rax, -0x218(%rbp)
jmp 0x3661
movq -0x140(%rbp), %rdi
movq -0x218(%rbp), %rax
movslq 0x4(%rax), %rsi
callq 0x5b90
movq %rax, %rdi
callq 0x5d50
movq %rax, -0x130(%rbp)
leaq -0x128(%rbp), %rdi
leaq -0x130(%rbp), %rsi
callq 0x5d00
leaq -0x108(%rbp), %rdi
leaq -0x128(%rbp), %rsi
callq 0x5d20
testb $0x1, %al
jne 0x36b3
jmp 0x36c2
movl -0xdc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xdc(%rbp)
jmp 0x36c4
leaq -0xe8(%rbp), %rdi
callq 0x5de0
jmp 0x350e
leaq -0x98(%rbp), %rdi
callq 0x5910
movq %rax, -0x220(%rbp)
jmp 0x36ea
movq -0x140(%rbp), %rdi
movq -0x220(%rbp), %rax
movslq 0x4(%rax), %rsi
callq 0x5b90
movq %rax, %rdi
callq 0x5c80
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, -0x228(%rbp)
testq %rax, %rax
movss %xmm0, -0x224(%rbp)
js 0x374a
movss -0x228(%rbp), %xmm0
movss %xmm0, -0x224(%rbp)
movss -0x224(%rbp), %xmm1
mulss -0x14(%rbp), %xmm1
cvtsi2ssl -0xdc(%rbp), %xmm0
ucomiss %xmm1, %xmm0
jbe 0x3812
movq -0x20(%rbp), %rdi
movslq -0x8c(%rbp), %rsi
callq 0x5750
movq %rax, -0x238(%rbp)
leaq -0xc0(%rbp), %rdi
callq 0x5910
movq %rax, -0x230(%rbp)
jmp 0x3794
movq -0x140(%rbp), %rdi
movq -0x230(%rbp), %rax
movslq 0x4(%rax), %rsi
callq 0x5b90
movq -0x238(%rbp), %rdi
movq %rax, %rsi
callq 0x5b20
jmp 0x37bc
movq -0x28(%rbp), %rdi
movslq -0x8c(%rbp), %rsi
callq 0x5940
movq %rax, -0x248(%rbp)
leaq -0xc0(%rbp), %rdi
callq 0x5910
movq %rax, -0x240(%rbp)
jmp 0x37e8
movq -0x138(%rbp), %rdi
movq -0x240(%rbp), %rax
movslq 0x4(%rax), %rsi
callq 0x58f0
movq -0x248(%rbp), %rdi
movq %rax, %rsi
callq 0x5ab0
jmp 0x3810
jmp 0x3812
jmp 0x3814
jmp 0x3816
leaq -0xc0(%rbp), %rdi
callq 0x5bd0
jmp 0x3824
jmp 0x33fd
movl -0x8c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x8c(%rbp)
jmp 0x383a
leaq -0x98(%rbp), %rdi
callq 0x5bd0
jmp 0x3848
jmp 0x3157
movq -0x140(%rbp), %rdi
callq 0x5e10
leaq -0x58(%rbp), %rdi
callq 0x5c60
addq $0x250, %rsp            # imm = 0x250
popq %rbp
retq
movq -0x78(%rbp), %rdi
callq 0x23f0
nopw %cs:(%rax,%rax)