// File: /workspace/github_cpp_makefile_star2_O2/lionalion[P]clusterization/clust_w2v.cpp
// Function: main
int main(int argc, char * argv[])
{
	if (argc < 7 || argc > 15) {error ("number of argv isn't correct: -fl input_file -w2v classes_w2v -n N -th1 n -th2 n -th3 n -th4 n -out output_file!\n"
		"format input_file - IDdocs(numbers)\\ttext\n"
		"format classes_w2v - word\\tclass\\tweight\n"
		"n - the numbers of docs in one epoch; default eof\n"
		"th1 - the min numbers of w2v classes  in claster; default = 4;\n"
		"th2 - the proximity of clasters 0-1; default = 0.7;\n"
		"th3 - the min numbers of docs in clasters; default = 3;\n"
		"th4 - the similarity of clasters according to the docs; default = 0.6;\n"
		);
		exit(0);}
	string line;
	string strText;
	char * namefile; 
	char * w2vfile; 
	ofstream out;
	int epo=-1;
	int th1=0; 
	float th2=0; 
	int th3=0;
	float th4=0;

	string  argum = argv [1];
	if ("-fl" == argum)
		namefile = argv [2];
	else{
		error ("No input file! First argument: -fl input");
		exit(0);
	}
	string  arguw = argv [3];
	if ("-w2v" == arguw)
		w2vfile = argv [4];
	else{
		error ("No w2v file! Second argument: -w2v inw2v");
		exit(0);
	}
	string outFile;
	bool flgoutfile = false;
	for (int i=5; i< argc-1; i++){
		string  snum = argv [i];
		if ("-out" == snum){
				outFile = (argv[i+1]);
				flgoutfile = true;
				i++;
		}
		else if ("-n" == snum){
			epo = atoi (argv[i+1]);
			i++;
		}
		else if ("-th1" == snum){
			th1 = atoi (argv[i+1]);
			i++;
		}
		else if ("-th2" == snum){
			th2 = atof (argv[i+1]);
			i++;
		}
		else if ("-th3" == snum){
			th3 = atoi (argv[i+1]);
			i++;
		}
		else if ("-th4" == snum){
			th4 = atof (argv[i+1]);
			i++;
		}
	}
	//default 
	if (th1==0)
		th1=4;
	if (th2==0)
		th2=0.7;
	if (th3==0)
		th3=3;
	if (th4==0)
		th4=0.6;

	if (flgoutfile == false){
			error ("no output file!");
			exit(0);
	}
	else
		out.open(outFile.c_str());

	map <string, string> w2v;

	ifstream myfile(namefile, ifstream::in );
	if (!myfile) {
		error ("No intext file!",namefile); 	
		exit (1);
	}
	ifstream wfile(w2vfile, ifstream::in);
	if (!wfile) {
		error ("No inw2v file!",w2vfile); 	
		exit (1);
	}

	if (wfile.is_open()){		
	
		while (getline(wfile, line)) {
			string strCls;
			string strWrd;
			int nPosTab;
			int nPosEnd = line.length();
			int nPos=0;
			while (nPos < line.length()){
				nPosTab = line.find('\t', nPos);
				if (nPosEnd==-1)
					nPosEnd=line.length();
				if (-1 != nPosTab  )		{
					strWrd = line.substr(nPos,nPosTab-nPos);		
					strCls = line.substr(nPosTab-nPos+1,nPosEnd-nPos);
					nPos=nPosEnd+1;
				}
				else if (nPos != nPosEnd) {
					error("format is not correct!");
					exit(1);
				}				
			}
			w2v.insert ( std::pair<string,string>(strWrd,strCls) );
		}
	}
		
	std::vector < std::vector < int > > vOutIdStr;
	std::vector < std::vector <std::map<int,float> > > vOutMapCls;
	std::vector < std::vector < int > > vIdStr;
	std::vector < int > vId;
	std::vector < std::vector <std::map<int,float> > > vMapCls;
	std::vector < std::map <int,float> > vCls; 
	int idstr;
	int cntepo=0;
	if (myfile.is_open()){				
		while (getline(myfile, line)) {
			cntepo++;
			std::map <int,float> cls;
			int cntmap=0;
			string strWrd;
			string strID;
			int nPosTab;
			int nPosSpace;
			int nPosEnd = line.length();
			int nPos=0;			
			while (nPos < line.length()){
				nPosTab = line.find('\t', nPos);
				nPosSpace = line.find(' ', nPos);
				if (nPosEnd==-1)
					nPosEnd=line.length();
				else if (-1 != nPosTab  && nPosTab < nPosEnd)		{
					strID = line.substr(nPos,nPosTab-nPos);		
					char *buffer = new char[strID.length() + 1];
					strcpy(buffer,  strID.c_str());
					idstr = strtod(buffer,NULL);
					nPos=nPosTab+1;
				}
				else if (-1 != nPosSpace  && nPosSpace < nPosEnd)		{
					strWrd = line.substr(nPos,nPosSpace-nPos);		
					nPos=nPosSpace+1;
				}
				else if (-1 == nPosSpace && nPos <= nPosEnd)	{
					strWrd = line.substr(nPos,nPosEnd-nPos);
					nPos=nPosEnd+1;
				}
				else if (nPos != nPosEnd) {
					error("format is not correct!");
					exit(1);
				}
				if (strWrd != "" ){
					std::multimap<string,string>::const_iterator itMap = w2v.begin();
					itMap = w2v.find(strWrd);
					if(itMap != w2v.end() ){						
						string strTmp = (*itMap).second;
						int n=0;
						int nTab;
						int nEnd=strTmp.length();
						float wgt;
						int ncls;
						string strCh;
						while (n < strTmp.length()){
							nTab = strTmp.find('\t', n);
							if (-1 != nTab  && nTab < nEnd)		{
								strCh = strTmp.substr(n,nTab-n);		
								char *buffer = new char[strCh.length() + 1];
								strcpy(buffer, strCh.c_str());
								ncls = strtod(buffer,NULL);
								n=nTab+1;
							}
							else if (-1 == nTab && n <= nEnd)	{
								strCh = strTmp.substr(n,nEnd-n);
								char *buffer = new char[strCh.length() + 1];
								strcpy(buffer,  strCh.c_str());
								wgt = strtod(buffer,NULL);
								n=nEnd+1;
							}
						}
							
						if (0==cntmap){
							cls.insert ( std::pair<int,float>(ncls,wgt) );
							cntmap=1;
						}
						else{
							std::map<int,float>::const_iterator it = cls.begin();
							it = cls.find(ncls);
							if(it != cls.end() ){	
								cls.at(ncls) = (*it).second+wgt;								
							}
							else{
								cls.insert ( std::pair<int,float>(ncls,wgt) );
							}
						}					
					}
				}	
			}
			if (cls.size()+1 > th1){
				vCls.push_back( cls );	
				vId.push_back( idstr );
			}

			if (epo != -1 && cntepo > epo ){
				cout << "." ;
				firstClast(vCls, vId, th2,  vMapCls, vIdStr);
				vCls.clear();
				vId.clear();
				postClast (vIdStr,vMapCls, th3, th4, vOutIdStr, vOutMapCls);
				vIdStr.clear();
				vMapCls.clear();	
				if (vOutIdStr.size() != vOutMapCls.size() ){
					error("something strange: size of outID and outMap is't equal!");
					exit(1);
				}	
				cntepo=0;
			}			
		} //end while
	} //close file
	if(vCls.size()==0 ){
		error ("No words or other lang!\n");
		exit(0);
	}
	else if ( epo == -1 ){
		cout << "beginning clasterization \n" ;
		firstClast(vCls, vId, th2,  vMapCls, vIdStr);
		vCls.clear();
		vId.clear();
		cout << "post clastering \n" ;
		postClast (vIdStr,vMapCls, th3, th4, vOutIdStr, vOutMapCls);
		vIdStr.clear();
		vMapCls.clear();	
		if (vOutIdStr.size() != vOutMapCls.size() ){
			error("something strange: size of outID and outMap is't equal!");
			exit(1);
		}			
	}
	else{
		cout << "\npost clastering \n" ;
		std::vector < std::vector < int > > vOutIdStr_epo;
		std::vector < std::vector <std::map<int,float> > > vOutMapCls_epo;
		postClast (vOutIdStr,vOutMapCls, th3, th4, vOutIdStr_epo, vOutMapCls_epo);
		vOutIdStr.clear();
		vOutMapCls.clear();	
		vOutIdStr.resize(vOutIdStr_epo.size());
		vOutIdStr=vOutIdStr_epo;
		vOutMapCls.resize(vOutMapCls_epo.size());
		vOutMapCls=vOutMapCls_epo;
		if (vOutIdStr.size() != vOutMapCls.size() ){
			error("something strange: size of outID and outMap is't equal!");
			exit(1);
		}		
	}
	//out vOutIdStr,vOutMapCls
	for (int c=0; c<vOutMapCls.size(); c++){
		out <<  c << ": " ;
		for (int x=0; x<vOutMapCls[c].size(); x++){
			std::map<int,float> ::const_iterator it = vOutMapCls[c][x].begin(); it != vOutMapCls[c][x].end(); ++it;
			out <<  vOutIdStr[c][x] << " " << (*it).second  << "; ";
		}			
		out <<  "\n" ;
	}
	out << endl;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xa08, %rsp            # imm = 0xA08
movl %edi, %r15d
leal -0x10(%r15), %eax
cmpl $-0xa, %eax
jbe 0x3dcb
movq %rsi, %r14
leaq -0x140(%rbp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
xorl %ecx, %ecx
movb %cl, (%rax)
leaq -0x3d8(%rbp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
movb %cl, (%rax)
leaq -0xa28(%rbp), %rdi
callq 0x22e0
movq 0x8(%r14), %rsi
leaq -0x3c8(%rbp), %rdi
leaq -0x620(%rbp), %rdx
callq 0x41f0
leaq 0x4489(%rip), %rdi      # 0x71f5
leaq -0x3c8(%rbp), %rsi
callq 0x422b
testb %al, %al
je 0x3dde
movq 0x10(%r14), %rbx
movq 0x18(%r14), %rsi
leaq -0x3a8(%rbp), %rdi
leaq -0x620(%rbp), %rdx
callq 0x41f0
movq %rbx, -0xc8(%rbp)
leaq 0x4479(%rip), %rdi      # 0x7222
leaq -0x3a8(%rbp), %rsi
callq 0x422b
testb %al, %al
je 0x3df1
movq 0x20(%r14), %rax
movq %rax, -0x108(%rbp)
leaq -0x348(%rbp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
movb $0x0, (%rax)
decl %r15d
pushq $-0x1
popq %rax
movl %eax, -0x44(%rbp)
movl $0x0, -0x38(%rbp)
xorpd %xmm0, %xmm0
movapd %xmm0, -0x1e0(%rbp)
pushq $0x5
popq %rbx
leaq -0x620(%rbp), %r13
movapd %xmm0, -0xa0(%rbp)
movl $0x0, -0x2c(%rbp)
movl $0x0, -0x30(%rbp)
cmpl %r15d, %ebx
jge 0x2f3a
movslq %ebx, %r12
movq (%r14,%r12,8), %rsi
movq %r13, %rdi
leaq -0x828(%rbp), %rdx
callq 0x41f0
leaq 0x4413(%rip), %rdi      # 0x7250
movq %r13, %rsi
callq 0x422b
testb %al, %al
je 0x2e66
movq 0x8(%r14,%r12,8), %rsi
leaq -0x358(%rbp), %rdi
callq 0x2330
incl %ebx
movb $0x1, %al
movl %eax, -0x38(%rbp)
jmp 0x2f2b
leaq 0x43e8(%rip), %rdi      # 0x7255
movq %r13, %rsi
callq 0x422b
testb %al, %al
je 0x2e8d
incl %ebx
movq 0x8(%r14,%r12,8), %rdi
callq 0x22b0
movl %eax, -0x44(%rbp)
jmp 0x2f2b
leaq 0x43c4(%rip), %rdi      # 0x7258
movq %r13, %rsi
callq 0x422b
testb %al, %al
je 0x2eb1
incl %ebx
movq 0x8(%r14,%r12,8), %rdi
callq 0x22b0
movl %eax, -0x30(%rbp)
jmp 0x2f2b
leaq 0x43a5(%rip), %rdi      # 0x725d
movq %r13, %rsi
callq 0x422b
testb %al, %al
je 0x2edd
incl %ebx
movq 0x8(%r14,%r12,8), %rdi
callq 0x2230
cvtsd2ss %xmm0, %xmm0
movaps %xmm0, -0xa0(%rbp)
jmp 0x2f2b
leaq 0x437e(%rip), %rdi      # 0x7262
movq %r13, %rsi
callq 0x422b
testb %al, %al
je 0x2f01
incl %ebx
movq 0x8(%r14,%r12,8), %rdi
callq 0x22b0
movl %eax, -0x2c(%rbp)
jmp 0x2f2b
leaq 0x435f(%rip), %rdi      # 0x7267
movq %r13, %rsi
callq 0x422b
testb %al, %al
je 0x2f2b
incl %ebx
movq 0x8(%r14,%r12,8), %rdi
callq 0x2230
cvtsd2ss %xmm0, %xmm0
movaps %xmm0, -0x1e0(%rbp)
movq %r13, %rdi
callq 0x20f0
incl %ebx
jmp 0x2e17
movl -0x30(%rbp), %eax
testl %eax, %eax
pushq $0x4
popq %r14
cmovnel %eax, %r14d
movl -0x2c(%rbp), %ecx
testl %ecx, %ecx
pushq $0x3
popq %rax
cmovnel %ecx, %eax
movl %eax, -0x40(%rbp)
testb $0x1, -0x38(%rbp)
je 0x3e04
movq -0x358(%rbp), %rsi
leaq -0xa28(%rbp), %rdi
pushq $0x10
popq %rdx
callq 0x2050
movq -0xc8(%rbp), %rbx
leaq -0x380(%rbp), %rax
andl $0x0, (%rax)
andq $0x0, 0x8(%rax)
movq %rax, 0x10(%rax)
movq %rax, 0x18(%rax)
andq $0x0, 0x20(%rax)
leaq -0x620(%rbp), %rdi
pushq $0x8
popq %rdx
movq %rbx, %rsi
callq 0x2320
movq -0x620(%rbp), %rax
movq -0x18(%rax), %rax
testb $0x5, -0x600(%rbp,%rax)
jne 0x3e17
movl %r14d, -0x38(%rbp)
leaq -0x828(%rbp), %rdi
pushq $0x8
popq %rdx
movq -0x108(%rbp), %rbx
movq %rbx, %rsi
callq 0x2320
movq -0x828(%rbp), %rax
movq -0x18(%rax), %rax
testb $0x5, -0x808(%rbp,%rax)
jne 0x3e26
leaq -0x7b0(%rbp), %rdi
callq 0x2080
testb %al, %al
je 0x3170
leaq -0x150(%rbp), %r14
leaq -0x828(%rbp), %rdi
movq %r14, %rsi
callq 0x2070
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
testb $0x5, 0x20(%rax,%rcx)
jne 0x3170
leaq -0x60(%rbp), %rax
movq %rax, -0x70(%rbp)
andq $0x0, -0x68(%rbp)
xorl %r15d, %r15d
leaq -0xf0(%rbp), %rax
movq %rax, -0x100(%rbp)
andq $0x0, -0xf8(%rbp)
movb %r15b, -0x60(%rbp)
movb %r15b, -0xf0(%rbp)
movq -0x148(%rbp), %rax
movl %eax, %r12d
movslq %r15d, %r13
cmpq %r13, %rax
jbe 0x3125
movq %r14, %rdi
pushq $0x9
popq %rsi
movq %r13, %rdx
callq 0x2250
movq %rax, %rbx
cmpl $-0x1, %r12d
movq -0x148(%rbp), %rax
cmovel %eax, %r12d
cmpl $-0x1, %ebx
jne 0x30ab
cmpl %r15d, %r12d
je 0x3073
jmp 0x3d9c
subl %r13d, %ebx
movslq %ebx, %rcx
movq %r14, %rsi
leaq -0x1d0(%rbp), %r14
movq %r14, %rdi
movq %r13, %rdx
callq 0x21d0
leaq -0x100(%rbp), %rdi
movq %r14, %rsi
callq 0x2220
movq %r14, %rdi
callq 0x20f0
incl %ebx
movslq %ebx, %rdx
movl %r12d, %eax
subl %r15d, %eax
movslq %eax, %rcx
movq %r14, %rdi
leaq -0x150(%rbp), %rsi
movq %rsi, %rbx
callq 0x21d0
leaq -0x70(%rbp), %rdi
movq %r14, %rsi
callq 0x2220
movq %r14, %rdi
callq 0x20f0
leal 0x1(%r12), %r15d
movq -0x148(%rbp), %rax
movq %rbx, %r14
jmp 0x3070
leaq -0x1d0(%rbp), %rbx
movq %rbx, %rdi
leaq -0x100(%rbp), %rsi
leaq -0x70(%rbp), %rdx
callq 0x4244
leaq -0x388(%rbp), %rdi
movq %rbx, %rsi
callq 0x5678
movq %rbx, %rdi
callq 0x427a
leaq -0x100(%rbp), %rdi
callq 0x20f0
leaq -0x70(%rbp), %rdi
callq 0x20f0
jmp 0x3014
xorpd %xmm0, %xmm0
movapd %xmm0, -0xc0(%rbp)
andq $0x0, -0xb0(%rbp)
movapd %xmm0, -0x90(%rbp)
andq $0x0, -0x80(%rbp)
movapd %xmm0, -0x190(%rbp)
andq $0x0, -0x180(%rbp)
movapd %xmm0, -0xe0(%rbp)
andq $0x0, -0xd0(%rbp)
movapd %xmm0, -0x170(%rbp)
andq $0x0, -0x160(%rbp)
movapd %xmm0, -0x130(%rbp)
andq $0x0, -0x120(%rbp)
leaq -0x5a8(%rbp), %rdi
callq 0x2080
leaq 0x4108(%rip), %rcx      # 0x72ec
movq %rcx, -0x1e8(%rbp)
testb %al, %al
je 0x3e56
xorps %xmm1, %xmm1
movaps -0xa0(%rbp), %xmm3
movaps %xmm3, %xmm2
cmpeqss %xmm1, %xmm2
movss 0x3df7(%rip), %xmm0     # 0x7004
andps %xmm2, %xmm0
andnps %xmm3, %xmm2
orps %xmm0, %xmm2
movaps %xmm2, -0x290(%rbp)
movaps -0x1e0(%rbp), %xmm2
cmpeqss %xmm2, %xmm1
movss 0x3dd7(%rip), %xmm0     # 0x7008
andps %xmm1, %xmm0
andnps %xmm2, %xmm1
orps %xmm0, %xmm1
movaps %xmm1, -0x250(%rbp)
movslq -0x38(%rbp), %rax
movq %rax, -0x258(%rbp)
xorl %ebx, %ebx
leaq -0x150(%rbp), %r14
pushq $0x20
popq %r12
leaq -0x338(%rbp), %r15
leaq -0x200(%rbp), %r13
leaq -0x620(%rbp), %rdi
movq %r14, %rsi
callq 0x2070
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
testb $0x5, 0x20(%rax,%rcx)
jne 0x391d
andl $0x0, -0x1c8(%rbp)
andq $0x0, -0x1c0(%rbp)
leaq -0x1c8(%rbp), %rax
movq %rax, -0x1b8(%rbp)
movq %rax, -0x1b0(%rbp)
andq $0x0, -0x1a8(%rbp)
leaq -0x60(%rbp), %rax
movq %rax, -0x70(%rbp)
andq $0x0, -0x68(%rbp)
movq %rbx, -0x108(%rbp)
leal 0x1(%rbx), %eax
movl %eax, -0xc8(%rbp)
xorl %ecx, %ecx
movb %cl, -0x60(%rbp)
leaq -0xf0(%rbp), %rax
movq %rax, -0x100(%rbp)
andq $0x0, -0xf8(%rbp)
movl $0x0, -0x1e0(%rbp)
movb %cl, -0xf0(%rbp)
movq -0x148(%rbp), %rax
movl %eax, %ecx
movq %rcx, -0xa0(%rbp)
movl $0x0, -0x2c(%rbp)
movslq -0x2c(%rbp), %rbx
cmpq %rbx, %rax
jbe 0x3770
movq %r14, %rdi
pushq $0x9
popq %rsi
movq %rbx, %rdx
callq 0x2250
movq %rax, %r13
movq %r14, %rdi
movl %r12d, %esi
movq %rbx, %rdx
callq 0x2250
cmpl $-0x1, -0xa0(%rbp)
je 0x33d9
movq %rax, %r15
cmpl $-0x1, %r13d
je 0x33e8
cmpl %r13d, -0xa0(%rbp)
jle 0x33e8
movl %r13d, %eax
subl -0x2c(%rbp), %eax
movslq %eax, %rcx
leaq -0x240(%rbp), %r15
movq %r15, %rdi
movq %r14, %rsi
movq %rbx, %rdx
callq 0x21d0
leaq -0x100(%rbp), %rdi
movq %r15, %rsi
callq 0x2220
movq %r15, %rdi
callq 0x20f0
movq -0xf8(%rbp), %rdi
incq %rdi
callq 0x2030
movq %rax, %rbx
movq -0x100(%rbp), %rsi
movq %rax, %rdi
callq 0x2190
movq %rbx, %rdi
xorl %esi, %esi
callq 0x2150
cvttsd2si %xmm0, %eax
movl %eax, -0x10c(%rbp)
incl %r13d
movl %r13d, -0x2c(%rbp)
jmp 0x3438
movl -0x148(%rbp), %eax
movq %rax, -0xa0(%rbp)
jmp 0x3438
cmpl $-0x1, %r15d
je 0x3667
cmpl %r15d, -0xa0(%rbp)
jle 0x3667
movl %r15d, %eax
subl -0x2c(%rbp), %eax
movslq %eax, %rcx
leaq -0x240(%rbp), %r13
movq %r13, %rdi
movq %r14, %rsi
movq %rbx, %rdx
callq 0x21d0
leaq -0x70(%rbp), %rdi
movq %r13, %rsi
callq 0x2220
movq %r13, %rdi
callq 0x20f0
incl %r15d
movl %r15d, -0x2c(%rbp)
leaq -0x200(%rbp), %r13
leaq -0x70(%rbp), %rdi
leaq 0x3ee8(%rip), %rsi      # 0x7332
callq 0x429a
leaq -0x338(%rbp), %r15
testb %al, %al
je 0x3764
leaq -0x388(%rbp), %rdi
leaq -0x70(%rbp), %rsi
callq 0x592a
leaq -0x380(%rbp), %rcx
cmpq %rcx, %rax
je 0x3764
addq $0x40, %rax
leaq -0x240(%rbp), %rdi
movq %rax, %rsi
callq 0x2260
movq -0x238(%rbp), %r13
leaq -0x210(%rbp), %rax
movq %rax, -0x220(%rbp)
andq $0x0, -0x218(%rbp)
movb $0x0, -0x210(%rbp)
leal 0x1(%r13), %eax
movl %eax, -0x38(%rbp)
xorl %r14d, %r14d
movq %r13, %rax
movslq %r14d, %r15
cmpq %r15, %rax
jbe 0x35ed
leaq -0x240(%rbp), %r12
movq %r12, %rdi
pushq $0x9
popq %rsi
movq %r15, %rdx
callq 0x2250
movq %rax, %rbx
cmpl $-0x1, %ebx
sete %al
cmpl %r13d, %ebx
setge %cl
orb %al, %cl
jne 0x3563
movl %ebx, %eax
subl %r14d, %eax
movslq %eax, %rcx
leaq -0x278(%rbp), %r14
movq %r14, %rdi
movq %r12, %rsi
movq %r15, %rdx
callq 0x21d0
leaq -0x220(%rbp), %rdi
movq %r14, %rsi
callq 0x2220
movq %r14, %rdi
callq 0x20f0
movq -0x218(%rbp), %rdi
incq %rdi
callq 0x2030
movq %rax, %r15
movq -0x220(%rbp), %rsi
movq %rax, %rdi
callq 0x2190
movq %r15, %rdi
xorl %esi, %esi
callq 0x2150
cvttsd2si %xmm0, %eax
movl %eax, -0x3c(%rbp)
incl %ebx
movl %ebx, %r14d
jmp 0x35e1
cmpl $-0x1, %ebx
setne %cl
movl %r13d, %eax
subl %r14d, %eax
setl %dl
orb %cl, %dl
jne 0x35e1
movslq %eax, %rcx
leaq -0x278(%rbp), %rbx
movq %rbx, %rdi
leaq -0x240(%rbp), %rsi
movq %r15, %rdx
callq 0x21d0
leaq -0x220(%rbp), %rdi
movq %rbx, %rsi
callq 0x2220
movq %rbx, %rdi
callq 0x20f0
movq -0x218(%rbp), %rdi
incq %rdi
callq 0x2030
movq %rax, %rbx
movq -0x220(%rbp), %rsi
movq %rax, %rdi
callq 0x2190
movq %rbx, %rdi
xorl %esi, %esi
callq 0x2150
cvtsd2ss %xmm0, %xmm0
movss %xmm0, -0x30(%rbp)
movl -0x38(%rbp), %r14d
movq -0x238(%rbp), %rax
jmp 0x34c2
cmpl $0x0, -0x1e0(%rbp)
leaq -0x338(%rbp), %r15
je 0x36c5
leaq -0x1d0(%rbp), %rdi
leaq -0x3c(%rbp), %rsi
callq 0x5552
leaq -0x150(%rbp), %r14
pushq $0x20
popq %r12
leaq -0x278(%rbp), %rsi
leaq -0x200(%rbp), %r13
leaq -0x1c8(%rbp), %rcx
cmpq %rcx, %rax
je 0x3721
movss 0x24(%rax), %xmm0
movss %xmm0, -0x38(%rbp)
leaq -0x1d0(%rbp), %rdi
leaq -0x3c(%rbp), %rsi
callq 0x42a8
movss -0x38(%rbp), %xmm0
addss -0x30(%rbp), %xmm0
movss %xmm0, (%rax)
jmp 0x3743
cmpl $-0x1, %r15d
jne 0x3702
movq -0xa0(%rbp), %rax
subl -0x2c(%rbp), %eax
jl 0x3702
movslq %eax, %rcx
leaq -0x240(%rbp), %r15
movq %r15, %rdi
movq %r14, %rsi
movq %rbx, %rdx
callq 0x21d0
leaq -0x200(%rbp), %r13
leaq -0x70(%rbp), %rdi
movq %r15, %rsi
callq 0x2220
movq %r15, %rdi
callq 0x20f0
movq -0xa0(%rbp), %rax
incl %eax
movl %eax, -0x2c(%rbp)
jmp 0x343f
movl -0x3c(%rbp), %eax
movl %eax, -0x278(%rbp)
movss -0x30(%rbp), %xmm0
movss %xmm0, -0x274(%rbp)
leaq -0x1d0(%rbp), %rdi
leaq -0x278(%rbp), %rsi
callq 0x59b4
leaq -0x150(%rbp), %r14
pushq $0x20
popq %r12
leaq -0x200(%rbp), %r13
jmp 0x3743
movq -0xa0(%rbp), %rax
cmpl -0x2c(%rbp), %eax
movl %eax, -0x2c(%rbp)
leaq -0x200(%rbp), %r13
je 0x343f
jmp 0x3daf
movl -0x3c(%rbp), %eax
movl %eax, -0x278(%rbp)
movss -0x30(%rbp), %xmm0
movss %xmm0, -0x274(%rbp)
leaq -0x1d0(%rbp), %rdi
callq 0x59b4
leaq -0x220(%rbp), %rdi
callq 0x20f0
leaq -0x240(%rbp), %rdi
callq 0x20f0
pushq $0x1
popq %rax
movl %eax, -0x1e0(%rbp)
movq -0x148(%rbp), %rax
jmp 0x3313
movq -0x1a8(%rbp), %rax
incq %rax
cmpq -0x258(%rbp), %rax
leaq -0x418(%rbp), %rbx
jbe 0x37b0
leaq -0x130(%rbp), %rdi
leaq -0x1d0(%rbp), %rsi
callq 0x41a6
leaq -0xe0(%rbp), %rdi
leaq -0x10c(%rbp), %rsi
callq 0x4180
movl -0x44(%rbp), %ecx
cmpl $-0x1, %ecx
sete %al
cmpl %ecx, -0x108(%rbp)
setl %cl
orb %al, %cl
jne 0x38ef
movq 0x77ff(%rip), %rdi      # 0xafd0
leaq 0x3ada(%rip), %rsi      # 0x72b2
callq 0x21a0
movq %rbx, %rdi
leaq -0x130(%rbp), %rsi
callq 0x42e0
movq %r15, %rdi
leaq -0xe0(%rbp), %rsi
callq 0x433a
movq %rbx, %rdi
movq %r15, %rsi
movapd -0x290(%rbp), %xmm0
leaq -0x170(%rbp), %rdx
leaq -0x190(%rbp), %rcx
callq 0x2971
movq %r15, %rdi
callq 0x4954
movq %rbx, %rdi
callq 0x4392
leaq -0x130(%rbp), %rdi
callq 0x41e2
movq -0xe0(%rbp), %rax
cmpq %rax, -0xd8(%rbp)
je 0x384f
movq %rax, -0xd8(%rbp)
movq %r13, %rdi
leaq -0x190(%rbp), %rsi
callq 0x43be
leaq -0x400(%rbp), %rbx
movq %rbx, %rdi
leaq -0x170(%rbp), %rsi
callq 0x4418
movq %r13, %rdi
movq %rbx, %rsi
movl -0x40(%rbp), %edx
movapd -0x250(%rbp), %xmm0
leaq -0xc0(%rbp), %rcx
leaq -0x90(%rbp), %r8
callq 0x24ba
movq %rbx, %rdi
callq 0x4472
movq %r13, %rdi
callq 0x449e
leaq -0x190(%rbp), %rdi
callq 0x44ca
leaq -0x170(%rbp), %rdi
callq 0x44d8
movq -0xb8(%rbp), %rax
subq -0xc0(%rbp), %rax
movq -0x88(%rbp), %rcx
subq -0x90(%rbp), %rcx
movl $0x0, -0xc8(%rbp)
cmpq %rcx, %rax
jne 0x3dc2
leaq -0x100(%rbp), %rdi
callq 0x20f0
leaq -0x70(%rbp), %rdi
callq 0x20f0
leaq -0x1d0(%rbp), %rdi
callq 0x470c
movl -0xc8(%rbp), %eax
movl %eax, %ebx
jmp 0x3267
movq -0x128(%rbp), %rax
cmpq -0x130(%rbp), %rax
je 0x3e56
cmpl $-0x1, -0x44(%rbp)
je 0x3a90
movq 0x768e(%rip), %rdi      # 0xafd0
leaq 0x39d7(%rip), %rsi      # 0x7320
callq 0x21a0
xorpd %xmm0, %xmm0
movapd %xmm0, -0x1d0(%rbp)
andq $0x0, -0x1c0(%rbp)
movapd %xmm0, -0x70(%rbp)
andq $0x0, -0x60(%rbp)
leaq -0x2c0(%rbp), %rdi
leaq -0xc0(%rbp), %rsi
callq 0x43be
leaq -0x2a8(%rbp), %rdi
leaq -0x90(%rbp), %rsi
callq 0x4418
leaq -0x2c0(%rbp), %rdi
leaq -0x2a8(%rbp), %rsi
leaq -0x1d0(%rbp), %rcx
leaq -0x70(%rbp), %r8
movl -0x40(%rbp), %edx
movapd -0x250(%rbp), %xmm0
callq 0x24ba
leaq -0x2a8(%rbp), %rdi
callq 0x4472
leaq -0x2c0(%rbp), %rdi
callq 0x449e
leaq -0xc0(%rbp), %rbx
movq %rbx, %rdi
callq 0x44ca
leaq -0x90(%rbp), %rdi
callq 0x44d8
movq -0x1c8(%rbp), %rax
subq -0x1d0(%rbp), %rax
cqto
pushq $0x18
popq %rcx
idivq %rcx
movq %rbx, %rdi
movq %rax, %rsi
callq 0x40fc
leaq -0xc0(%rbp), %rdi
leaq -0x1d0(%rbp), %rsi
callq 0x44e6
movq -0x68(%rbp), %rax
subq -0x70(%rbp), %rax
cqto
pushq $0x18
popq %rcx
idivq %rcx
leaq -0x90(%rbp), %rdi
movq %rax, %rsi
callq 0x413e
leaq -0x90(%rbp), %rdi
leaq -0x70(%rbp), %rsi
callq 0x45c4
movq -0xb8(%rbp), %rax
subq -0xc0(%rbp), %rax
movq -0x88(%rbp), %rcx
subq -0x90(%rbp), %rcx
cmpq %rcx, %rax
jne 0x3e35
leaq -0x70(%rbp), %rdi
callq 0x4472
leaq -0x1d0(%rbp), %rdi
callq 0x449e
jmp 0x3be7
movq 0x7539(%rip), %rdi      # 0xafd0
leaq 0x3867(%rip), %rsi      # 0x7305
callq 0x21a0
leaq -0x320(%rbp), %rdi
leaq -0x130(%rbp), %rsi
callq 0x42e0
leaq -0x308(%rbp), %rdi
leaq -0xe0(%rbp), %rsi
callq 0x433a
leaq -0x320(%rbp), %rdi
leaq -0x308(%rbp), %rsi
leaq -0x170(%rbp), %rdx
leaq -0x190(%rbp), %rcx
movapd -0x290(%rbp), %xmm0
callq 0x2971
leaq -0x308(%rbp), %rdi
callq 0x4954
leaq -0x320(%rbp), %rdi
callq 0x4392
leaq -0x130(%rbp), %rdi
callq 0x41e2
movq -0xe0(%rbp), %rax
cmpq %rax, -0xd8(%rbp)
je 0x3b2d
movq %rax, -0xd8(%rbp)
movq 0x749c(%rip), %rdi      # 0xafd0
leaq 0x37e6(%rip), %rsi      # 0x7321
callq 0x21a0
leaq -0x2f0(%rbp), %rdi
leaq -0x190(%rbp), %rsi
callq 0x43be
leaq -0x2d8(%rbp), %rdi
leaq -0x170(%rbp), %rsi
callq 0x4418
leaq -0x2f0(%rbp), %rdi
leaq -0x2d8(%rbp), %rsi
leaq -0xc0(%rbp), %rcx
leaq -0x90(%rbp), %r8
movl -0x40(%rbp), %edx
movapd -0x250(%rbp), %xmm0
callq 0x24ba
leaq -0x2d8(%rbp), %rdi
callq 0x4472
leaq -0x2f0(%rbp), %rdi
callq 0x449e
leaq -0x190(%rbp), %rdi
callq 0x44ca
leaq -0x170(%rbp), %rdi
callq 0x44d8
movq -0xb8(%rbp), %rax
subq -0xc0(%rbp), %rax
movq -0x88(%rbp), %rcx
subq -0x90(%rbp), %rcx
cmpq %rcx, %rax
jne 0x3e48
xorl %ebx, %ebx
leaq -0xa28(%rbp), %r14
movq -0x88(%rbp), %rax
subq -0x90(%rbp), %rax
cqto
pushq $0x18
popq %rcx
idivq %rcx
cmpq %rbx, %rax
jbe 0x3cc8
movq %r14, %rdi
movl %ebx, %esi
callq 0x22f0
movq %rax, %rdi
leaq 0x3710(%rip), %rsi      # 0x7333
callq 0x21a0
movq %rbx, -0x38(%rbp)
imulq $0x18, %rbx, %r12
pushq $0x6
popq %r13
xorl %ebx, %ebx
movq -0x90(%rbp), %rax
movq (%rax,%r12), %rcx
movq 0x8(%rax,%r12), %rax
subq %rcx, %rax
cqto
pushq $0x30
popq %rsi
idivq %rsi
cmpq %rbx, %rax
jbe 0x3cad
movq (%rcx,%r13,4), %rdi
callq 0x21f0
movq %rax, %r15
movq -0xc0(%rbp), %rax
movq (%rax,%r12), %rax
movl (%rax,%rbx,4), %esi
movq %r14, %rdi
callq 0x22f0
movq %rax, %rdi
leaq 0x36b2(%rip), %rsi      # 0x7334
callq 0x21a0
movss 0x24(%r15), %xmm0
movq %rax, %rdi
callq 0x2140
movq %rax, %rdi
leaq 0x3697(%rip), %rsi      # 0x7336
callq 0x21a0
incq %rbx
addq $0xc, %r13
jmp 0x3c36
movq %r14, %rdi
leaq 0x367a(%rip), %rsi      # 0x7331
callq 0x21a0
movq -0x38(%rbp), %rbx
incq %rbx
jmp 0x3bf0
leaq -0xa28(%rbp), %rdi
callq 0x2100
leaq -0x130(%rbp), %rdi
callq 0x4392
leaq -0x170(%rbp), %rdi
callq 0x4472
leaq -0xe0(%rbp), %rdi
callq 0x4954
leaq -0x190(%rbp), %rdi
callq 0x449e
leaq -0x90(%rbp), %rdi
callq 0x4472
leaq -0xc0(%rbp), %rdi
callq 0x449e
leaq -0x828(%rbp), %rdi
callq 0x2090
leaq -0x620(%rbp), %rdi
callq 0x2090
leaq -0x388(%rbp), %rdi
callq 0x4768
leaq -0x358(%rbp), %rdi
callq 0x20f0
leaq -0x3a8(%rbp), %rdi
callq 0x20f0
leaq -0x3c8(%rbp), %rdi
callq 0x20f0
leaq -0xa28(%rbp), %rdi
callq 0x2290
leaq -0x3e8(%rbp), %rdi
callq 0x20f0
leaq -0x150(%rbp), %rdi
callq 0x20f0
xorl %eax, %eax
addq $0xa08, %rsp            # imm = 0xA08
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x34f8(%rip), %rdi      # 0x729b
leaq 0x3588(%rip), %rsi      # 0x7332
callq 0x247c
leaq 0x34e5(%rip), %rdi      # 0x729b
leaq 0x3575(%rip), %rsi      # 0x7332
callq 0x247c
leaq 0x34eb(%rip), %rdi      # 0x72b4
jmp 0x3db6
leaq 0x323a(%rip), %rdi      # 0x700c
leaq 0x3559(%rip), %rsi      # 0x7332
callq 0x247c
leaq 0x3414(%rip), %rdi      # 0x71f9
leaq 0x3546(%rip), %rsi      # 0x7332
callq 0x247c
leaq 0x342f(%rip), %rdi      # 0x7227
leaq 0x3533(%rip), %rsi      # 0x7332
callq 0x247c
leaq 0x3461(%rip), %rdi      # 0x726c
leaq 0x3520(%rip), %rsi      # 0x7332
callq 0x247c
leaq 0x345e(%rip), %rdi      # 0x727c
movq %rbx, %rsi
callq 0x247c
leaq 0x345f(%rip), %rdi      # 0x728c
movq %rbx, %rsi
callq 0x247c
leaq 0x3478(%rip), %rdi      # 0x72b4
leaq 0x34ef(%rip), %rsi      # 0x7332
callq 0x247c
leaq 0x3465(%rip), %rax      # 0x72b4
movq %rax, -0x1e8(%rbp)
leaq 0x34d5(%rip), %rsi      # 0x7332
movq -0x1e8(%rbp), %rdi
callq 0x247c
movq %rax, %rbx
leaq -0x2d8(%rbp), %rdi
callq 0x4472
jmp 0x3e7d
movq %rax, %rbx
leaq -0x2f0(%rbp), %rdi
jmp 0x3f21
movq %rax, %rbx
leaq -0x308(%rbp), %rdi
callq 0x4954
jmp 0x3e9d
movq %rax, %rbx
leaq -0x320(%rbp), %rdi
callq 0x4392
jmp 0x4040
movq %rax, %rbx
leaq -0x2a8(%rbp), %rdi
callq 0x4472
jmp 0x3ec2
movq %rax, %rbx
leaq -0x2c0(%rbp), %rdi
callq 0x449e
jmp 0x3f11
jmp 0x3fab
jmp 0x3ed7
movq %rax, %rbx
jmp 0x4094
movq %rax, %rbx
jmp 0x40a0
movq %rax, %rbx
jmp 0x40b8
jmp 0x3ef1
movq %rax, %rbx
jmp 0x40c4
movq %rax, %rbx
jmp 0x40d0
movq %rax, %rbx
jmp 0x40dc
jmp 0x3fb3
movq %rax, %rbx
leaq -0x70(%rbp), %rdi
callq 0x4472
leaq -0x1d0(%rbp), %rdi
callq 0x449e
jmp 0x4040
jmp 0x3ffd
jmp 0x3fd5
jmp 0x3fd5
movq %rax, %rbx
jmp 0x3f53
movq %rax, %rbx
jmp 0x3f73
movq %rax, %rbx
leaq -0x338(%rbp), %rdi
callq 0x4954
leaq -0x418(%rbp), %rdi
callq 0x4392
jmp 0x401f
movq %rax, %rbx
leaq -0x400(%rbp), %rdi
callq 0x4472
leaq -0x200(%rbp), %rdi
callq 0x449e
jmp 0x401f
movq %rax, %rbx
leaq -0x1d0(%rbp), %rdi
callq 0x427a
jmp 0x3fd8
jmp 0x3fd5
movq %rax, %rbx
leaq -0x620(%rbp), %rdi
callq 0x20f0
jmp 0x40ac
movq %rax, %rbx
jmp 0x4088
movq %rax, %rbx
jmp 0x40ac
jmp 0x3ffd
jmp 0x4004
jmp 0x3ff4
jmp 0x3ff4
jmp 0x3ff4
jmp 0x3ffd
jmp 0x4004
jmp 0x4004
jmp 0x3ff4
jmp 0x4004
jmp 0x3ff4
jmp 0x3ff4
jmp 0x3ff4
movq %rax, %rbx
leaq -0x100(%rbp), %rdi
callq 0x20f0
leaq -0x70(%rbp), %rdi
callq 0x20f0
jmp 0x4088
jmp 0x3ff4
movq %rax, %rbx
jmp 0x401f
jmp 0x4004
jmp 0x4004
movq %rax, %rbx
jmp 0x4040
jmp 0x4004
movq %rax, %rbx
leaq -0x220(%rbp), %rdi
callq 0x20f0
leaq -0x240(%rbp), %rdi
callq 0x20f0
leaq -0x100(%rbp), %rdi
callq 0x20f0
leaq -0x70(%rbp), %rdi
callq 0x20f0
leaq -0x1d0(%rbp), %rdi
callq 0x470c
leaq -0x130(%rbp), %rdi
callq 0x4392
leaq -0x170(%rbp), %rdi
callq 0x4472
leaq -0xe0(%rbp), %rdi
callq 0x4954
leaq -0x190(%rbp), %rdi
callq 0x449e
leaq -0x90(%rbp), %rdi
callq 0x4472
leaq -0xc0(%rbp), %rdi
callq 0x449e
leaq -0x828(%rbp), %rdi
callq 0x2090
leaq -0x620(%rbp), %rdi
callq 0x2090
leaq -0x388(%rbp), %rdi
callq 0x4768
leaq -0x358(%rbp), %rdi
callq 0x20f0
leaq -0x3a8(%rbp), %rdi
callq 0x20f0
leaq -0x3c8(%rbp), %rdi
callq 0x20f0
leaq -0xa28(%rbp), %rdi
callq 0x2290
leaq -0x3e8(%rbp), %rdi
callq 0x20f0
leaq -0x150(%rbp), %rdi
callq 0x20f0
movq %rbx, %rdi
callq 0x2300