// File: /workspace/github_cpp_makefile_star2_O3/simonrharris[P]SKA/src/sk_distance.cpp
// Function: kmerDistance(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, bool, bool, std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>> const&, int, float, bool)
int kmerDistance(const std::string & prefix, const bool distancefile, const bool clusterfile, const std::vector < std::string > & kmerfiles, const int maxSNPS, const float minMatched, const bool includeSingletons)
{

	const std::chrono::high_resolution_clock::time_point start = std::chrono::high_resolution_clock::now();

	int numfiles=kmerfiles.size();

	std::vector < std::string > sampleNames;
	if (collectSampleNames(kmerfiles, sampleNames)!=0){return 1;}
	int numSamples=sampleNames.size();
	
	std::unordered_map < std::string, std::string > kmerMap;// Create the kmer map
	std::string emptySequence (numSamples , '-');
	int oldkmersize=0;

	std::vector < int > kmerCounts(numSamples, 0);

	std::ifstream fileStream;
	int sampleNum=0;
	for (int s = 0; s < kmerfiles.size(); ++s){
		
		if (openFileStream(kmerfiles[s], fileStream)){return 1;};

		int kmersize;
		std::vector < std::string > names;
		
		readKmerHeader(fileStream, kmersize, names);
		

		if (s==0){
			oldkmersize=kmersize;
		}

		if (kmersize!=oldkmersize){
			std::cout << "kmer files have different kmer sizes\n\n" << std::endl << std::endl;
			return 0;
		}


		char base;
		char kmerbuffer[kmersize*2/3];
		char asciibuffer[int(ceil(float(names.size())/6))];

		while (fileStream.read(asciibuffer, sizeof(asciibuffer))){
			std::string asciibits (asciibuffer, sizeof(asciibuffer));
			std::vector < bool > mybits;
			vectorbool_from_ascii(asciibits, mybits);//read the ascii representation of the taxa to a vector of bools
			
			while (fileStream.peek()!='\n' && fileStream.get(base)){
				base=toupper(base);
				fileStream.read(kmerbuffer, sizeof(kmerbuffer));
				std::string kmer (kmerbuffer, kmersize*2/3);
				for (int i=0; i<names.size(); ++i){ //add the base to all samples that are true in the bitset
					if (mybits[i]){
						kmerCounts[sampleNum+i]++;
					}
				}
				
				std::unordered_map < std::string, std::string >::iterator it = kmerMap.find(kmer);//check if the kmer is in the hash
				if ( it != kmerMap.end() ){//if the kmer is in the hash
					for (int i=0; i<names.size(); ++i){ //add the base to all samples that are true in the bitset
						if (mybits[i]){
							it->second[sampleNum+i]=base;//add the base to the string
						}
					}
				}
				else {
					std::string newsequence = emptySequence;
					for (int i=0; i<names.size(); ++i){ //add the base to all samples that are true in the bitset
						if (mybits[i]){
							newsequence[sampleNum+i] = base;
						}
					}
					kmerMap.insert(std::make_pair(kmer, newsequence));
				}
	    	}
	    	fileStream.ignore(256,'\n');//skip the end ofline character
	    }
	    sampleNum+=int(names.size()); //add the number of samples in the file to the count of total samples
		fileStream.close();
	}
	std::cout << kmerMap.size() << " kmers read from " << numSamples << " samples in " << numfiles << " files" << std::endl;

	std::vector < std::vector < int > > pairwiseSNPs( numSamples , std::vector < int >( numSamples , 0 ) );
	std::vector < std::vector < int > > pairwiseMatches( numSamples , std::vector < int >( numSamples , kmerMap.size() ) );
	std::vector < std::vector < int > > pairwiseNs( numSamples , std::vector < int >( numSamples , 0 ) );
	
	
	std::cout << "Calculating SNP distances" << std::endl;

	std::vector < std::bitset < 1000000 > >  kmerbitvector( numSamples, 0 );
	std::bitset < 1000000 > mykmerbits;
	

	while (kmerMap.size()>0){
		
		std::vector < std::vector < int >  > baseVector (6 , std::vector < int >() ) ;
		std::unordered_map < std::string, std::string >::iterator kmit = kmerMap.begin();
		std::unordered_map < std::string, std::string >::iterator endIter = kmerMap.end();
		int j=0;
	
		for (; kmit!=endIter && j<1000000; ){

			std::fill(baseVector.begin(), baseVector.end(), ( std::vector < int >() ));

			for (int i=0; i<numSamples; ++i){

				baseVector[base_score[kmit->second[i]]].push_back(i);
				if (base_score[kmit->second[i]]==5){
					kmerbitvector[i].set(j);
				}
			}

			if (baseVector[5].size()>0){
				j++;
			}

			for (int k=0; k<4; ++k){
				for (int l=k+1; l<4; ++l){
					for (std::vector < int >::iterator it=baseVector[k].begin(); it!=baseVector[k].end(); ++it){
						for (std::vector < int >::iterator it2=baseVector[l].begin(); it2!=baseVector[l].end(); ++it2){
							//count++;
							if (*it<*it2){
								pairwiseSNPs[*it][*it2]++;
							}
							else {
								pairwiseSNPs[*it2][*it]++;
							}
						}
					}
				}
			}

			kmerMap.erase(kmit++);
		}
		
		for (int i=0; i<numSamples; ++i){
			for (int j=i+1; j<numSamples; ++j){
				mykmerbits = kmerbitvector[i] | kmerbitvector[j];
				pairwiseMatches[i][j]-=mykmerbits.count();
			}
			kmerbitvector[i].reset();
		}
	}

	std::string dotfilename=prefix+".dot";
	std::ofstream dotout(dotfilename);
	dotout << "graph {" << std::endl;

	if (clusterfile){
		std::string clusterfilename=prefix+".clusters.tsv";
		std::ofstream clusterout(clusterfilename);
		std::map <int, int> clusterMap;
		std::vector < std::vector <int> > clusters;
		std::cout << "Printing clusters to " << clusterfilename << std::endl;
		clusterout << "ID\tCluster__autocolour" << std::endl;
		for (int i=0; i<numSamples; ++i){
			std::vector < int > matches;
			matches.push_back(i);
			int matchcount=0;
			for (int j=i+1; j<numSamples; ++j){
				float kmercount=std::min(kmerCounts[i], kmerCounts[j]);
				float percentmatched = float(pairwiseMatches[i][j])/kmercount;
				if (pairwiseSNPs[i][j]<=maxSNPS && percentmatched>=minMatched){
					matchcount++;
					matches.push_back(j);
					float similarity;
					if (maxSNPS>0){
						similarity=((1.0-(float(pairwiseSNPs[i][j])/float(maxSNPS)))*3.0)+1;
					}
					else {
						similarity=1.0;
					}
					dotout << "\t" << sampleNames[i] << " -- " << sampleNames[j] << " [label=\"" << pairwiseSNPs[i][j] << "\" weight=" << similarity << "] ;" << std::endl;
				}
			}
			if (matchcount==0 && includeSingletons){
				dotout << "\t" << sampleNames[i] << " ;" << std::endl; //Need to find somewhere to put this where it does what I want
			}
			int clusternum=clusters.size();
			for ( std::vector < int >::iterator it=matches.begin(); it!=matches.end(); ++it){
				std::map <int, int >::iterator it2 = clusterMap.find(*it);//check if the match is in the hash
				if ( it2 != clusterMap.end() ){//if the match is in the hash
					if (it2->second<clusternum){
						clusternum=it2->second;
					}
				}
			}
			if (clusternum==clusters.size()){
				clusters.push_back(std::vector <int>());
			}
			for ( std::vector < int >::iterator it=matches.begin(); it!=matches.end(); ++it){
				std::map < int, int >::iterator it2 = clusterMap.find(*it);//check if the match is in the hash
				if ( it2 != clusterMap.end() ){//if the match is in the hash
					if (it2->second!=clusternum){
						for ( std::vector < int >::iterator it3=clusters[it2->second].begin(); it3!=clusters[it2->second].end(); ++it3){
							clusters[clusternum].push_back(*it3);
						}
						clusters[it2->second].clear();
					}
				}
				else{
					clusterMap.insert(std::make_pair(*it, clusternum));
					clusters[clusternum].push_back(*it);
				}
			}


			for ( std::vector < int >::iterator it2=clusters[clusternum].begin(); it2!=clusters[clusternum].end(); ++it2){
				std::map < int, int >::iterator it3 = clusterMap.find(*it2);//check if the match is in the hash
				if ( it3 != clusterMap.end() ){
					it3->second=clusternum;//segfault is on this line
				}	
			}

		}
		for ( std::map < int, int >::iterator it=clusterMap.begin(); it!=clusterMap.end(); ++it){
			clusterout << sampleNames[it->first] << "\t" << it->second+1 << "\n";
		}
		clusterout.close();

		int i=0;
		for ( std::vector < std::vector < int > >::iterator it=clusters.begin(); it!=clusters.end(); ++it){
			++i;
			if (it->size()>1){
				std::string clusterfilename=prefix+".cluster."+std::to_string(i)+".txt";
				std::ofstream clusterout(clusterfilename);
				for ( std::vector < int >::iterator it2=it->begin(); it2!=it->end(); ++it2){
					clusterout << sampleNames[*it2] << "\n";
				}
				clusterout.close();
			}
		}
	}

	dotout << "}" << std::endl;
	dotout.close();
	
	if (distancefile){
		std::string distancefilename=prefix+".distances.tsv";
		std::cout << "Printing distances to " << distancefilename << std::endl;
		
		std::ofstream distanceout(distancefilename);
		distanceout << "Sample 1\tSample 2\tMatches\tMismatches\tJaccard Index\tMash-like distance\tSNPs\tSNP distance" <<std::endl;
		for (int i=0; i<numSamples; ++i){
			for (int j=i+1; j<numSamples; ++j){
				float matches=pairwiseMatches[i][j] ;
				float mismatches=(kmerCounts[i]-pairwiseMatches[i][j]+kmerCounts[j]-pairwiseMatches[i][j]);
				float myID=matches/(mismatches+matches);
				float mashlike;
				if (myID==0){
					mashlike=1.0;
				}
				else{
					mashlike=(-1.0/((oldkmersize*2)+1))*log((2*myID)/(1+myID));
				}
				distanceout << sampleNames[i] << "\t" << sampleNames[j] << "\t" << int(matches) << "\t" << int(mismatches) << "\t" << myID << "\t" << mashlike << "\t" << pairwiseSNPs[i][j] << "\t" << pairwiseSNPs[i][j]/matches << std::endl;
			}
		}
		distanceout.close();
	}

	printDuration(start);
	
	return 0;
	
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x3d938, %rsp          # imm = 0x3D938
movl %r9d, -0x16c(%rbp)
movss %xmm0, -0x120(%rbp)
movl %r8d, %r15d
movq %rcx, %rbx
movl %edx, %r12d
movl %esi, %r14d
movq %rdi, -0x118(%rbp)
callq 0x5060
movq %rax, -0x248(%rbp)
movq 0x8(%rbx), %r13
subq (%rbx), %r13
xorps %xmm0, %xmm0
leaq -0x160(%rbp), %rsi
movaps %xmm0, (%rsi)
movq $0x0, 0x10(%rsi)
movq %rbx, -0xa8(%rbp)
movq %rbx, %rdi
movl $0x1, %edx
callq 0x9851
testl %eax, %eax
movl $0x1, %ebx
jne 0x123fe
movq %r13, -0x240(%rbp)
movl %r12d, -0x168(%rbp)
movl %r14d, -0x164(%rbp)
movq -0x158(%rbp), %r13
subq -0x160(%rbp), %r13
shrq $0x5, %r13
leaq -0x268(%rbp), %rax
movq %rax, -0x30(%rax)
movq $0x1, -0x28(%rax)
xorps %xmm0, %xmm0
movups %xmm0, -0x20(%rax)
movl $0x3f800000, -0x10(%rax) # imm = 0x3F800000
movups %xmm0, -0x8(%rax)
movslq %r13d, %r14
leaq -0x1f0(%rbp), %rax
movq %rax, -0x10(%rax)
leaq -0x200(%rbp), %rdi
movq %r14, %rsi
movl $0x2d, %edx
callq 0x5440
leaq -0x3d958(%rbp), %rdx
movl $0x0, (%rdx)
leaq -0x218(%rbp), %rdi
leaq -0x1f110(%rbp), %rcx
movq %r14, %rsi
callq 0xfedc
leaq -0x8c0(%rbp), %rdi
callq 0x5410
movq -0xa8(%rbp), %rcx
movq (%rcx), %rax
cmpq %rax, 0x8(%rcx)
movq %r13, -0x78(%rbp)
movl %r15d, -0xb4(%rbp)
je 0x10b50
movq %r14, -0x238(%rbp)
leaq -0x8c0(%rbp), %r12
leaq -0x60(%rbp), %r15
leaq -0xa0(%rbp), %r13
xorl %edi, %edi
xorl %ebx, %ebx
movl $0x0, -0xb0(%rbp)
movq %rdi, -0x70(%rbp)
shlq $0x5, %rdi
addq %rax, %rdi
movq %r12, %rsi
movl $0x1, %edx
callq 0x7f3f
testl %eax, %eax
jne 0x12327
xorps %xmm0, %xmm0
movaps %xmm0, -0x60(%rbp)
movq $0x0, -0x50(%rbp)
movq %r12, %rdi
leaq -0xe0(%rbp), %rsi
movq %r15, %rdx
callq 0x9684
cmpq $0x0, -0x70(%rbp)
sete %al
movl -0xe0(%rbp), %edx
cmpl %edx, %ebx
sete %cl
orb %al, %cl
je 0x1232e
movq %rsp, %rcx
leal (%rdx,%rdx), %eax
cltq
imulq $0x55555556, %rax, %rsi # imm = 0x55555556
movq %rsi, %rax
shrq $0x3f, %rax
shrq $0x20, %rsi
addl %eax, %esi
movq %rsi, -0x30(%rbp)
leaq 0xf(%rsi), %rax
andq $-0x10, %rax
movq %rsp, %rbx
subq %rax, %rbx
movq %rbx, %rsp
movq -0x58(%rbp), %rax
subq -0x60(%rbp), %rax
sarq $0x5, %rax
movq %rdx, -0xc0(%rbp)
movq %rcx, -0x108(%rbp)
js 0x10711
xorps %xmm0, %xmm0
cvtsi2ss %rax, %xmm0
jmp 0x10729
movq %rax, %rcx
shrq %rcx
andl $0x1, %eax
orq %rcx, %rax
xorps %xmm0, %xmm0
cvtsi2ss %rax, %xmm0
addss %xmm0, %xmm0
divss 0x22f4f(%rip), %xmm0    # 0x33680
callq 0x51e0
cvttss2si %xmm0, %ecx
leaq 0xf(%rcx), %rax
andq $-0x10, %rax
movq %rsp, %rdx
subq %rax, %rdx
movq %rdx, %rsp
movq %rcx, -0x68(%rbp)
movq %rdx, -0x38(%rbp)
leaq (%rdx,%rcx), %rax
movq %rax, -0x110(%rbp)
movslq -0xb0(%rbp), %r15
movq %r13, %r14
movq %r12, %rdi
movq -0x38(%rbp), %rsi
movq -0x68(%rbp), %rdx
callq 0x5480
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
testb $0x5, 0x20(%rax,%rcx)
jne 0x10ac5
leaq -0x6a8(%rbp), %rax
movq %rax, -0x6b8(%rbp)
leaq -0x6b8(%rbp), %r13
movq %r13, %rdi
movq -0x38(%rbp), %rsi
movq -0x110(%rbp), %rdx
callq 0x85fc
xorl %eax, %eax
movq %rax, -0x1f110(%rbp)
movl %eax, -0x1f108(%rbp)
movq %rax, -0x1f100(%rbp)
movl %eax, -0x1f0f8(%rbp)
movq %rax, -0x1f0f0(%rbp)
movq %r13, %rdi
leaq -0x1f110(%rbp), %rsi
callq 0x8993
movq %r14, %r13
movq %r12, %rdi
callq 0x5140
cmpl $0xa, %eax
je 0x10a6d
movq %r12, %rdi
movq %r13, %rsi
callq 0x5500
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
testb $0x5, 0x20(%rax,%rcx)
jne 0x10a6d
movsbl -0xa0(%rbp), %edi
callq 0x56d0
movb %al, -0xa0(%rbp)
movq %r12, %rdi
movq %rbx, %rsi
movq -0x30(%rbp), %rdx
callq 0x5480
movl -0xe0(%rbp), %eax
addl %eax, %eax
cltq
imulq $0x55555556, %rax, %rax # imm = 0x55555556
movq %rax, %rcx
shrq $0x3f, %rcx
shrq $0x20, %rax
addl %ecx, %eax
movslq %eax, %rdx
leaq -0x490(%rbp), %rax
movq %rax, -0x4a0(%rbp)
addq %rbx, %rdx
leaq -0x4a0(%rbp), %rdi
movq %rbx, %rsi
callq 0x85fc
movq -0x58(%rbp), %rax
subq -0x60(%rbp), %rax
je 0x108bf
sarq $0x5, %rax
movq -0x1f110(%rbp), %rcx
cmpq $0x1, %rax
adcq $0x0, %rax
leaq (,%r15,4), %rdx
addq -0x218(%rbp), %rdx
xorl %esi, %esi
movl %esi, %edi
shrl $0x6, %edi
movq (%rcx,%rdi,8), %rdi
btq %rsi, %rdi
jae 0x108b7
incl (%rdx,%rsi,4)
incq %rsi
cmpq %rsi, %rax
jne 0x108a5
leaq -0x298(%rbp), %rdi
leaq -0x4a0(%rbp), %rsi
callq 0xb6d2
testq %rax, %rax
je 0x10931
movq -0x60(%rbp), %rcx
movq -0x58(%rbp), %rdx
cmpq %rcx, %rdx
je 0x10a42
xorl %esi, %esi
movq -0x1f110(%rbp), %rdi
movl %esi, %r8d
shrl $0x6, %r8d
movq (%rdi,%r8,8), %rdi
btq %rsi, %rdi
jae 0x1091a
movb -0xa0(%rbp), %cl
movq 0x28(%rax), %rdx
addq %r15, %rdx
movb %cl, (%rsi,%rdx)
movq -0x60(%rbp), %rcx
movq -0x58(%rbp), %rdx
incq %rsi
movq %rdx, %rdi
subq %rcx, %rdi
sarq $0x5, %rdi
cmpq %rsi, %rdi
ja 0x108ea
jmp 0x10a42
leaq -0x190(%rbp), %rax
movq %rax, -0x1a0(%rbp)
movq -0x200(%rbp), %rsi
movq -0x1f8(%rbp), %rdx
addq %rsi, %rdx
leaq -0x1a0(%rbp), %rdi
callq 0x8566
movq -0x60(%rbp), %rax
movq -0x58(%rbp), %rcx
cmpq %rax, %rcx
leaq -0x3d958(%rbp), %rdi
je 0x109b7
xorl %edx, %edx
movq -0x1f110(%rbp), %rsi
movl %edx, %r8d
shrl $0x6, %r8d
movq (%rsi,%r8,8), %rsi
btq %rdx, %rsi
jae 0x109a5
movb -0xa0(%rbp), %al
movq -0x1a0(%rbp), %rcx
addq %r15, %rcx
movb %al, (%rdx,%rcx)
movq -0x60(%rbp), %rax
movq -0x58(%rbp), %rcx
incq %rdx
movq %rcx, %rsi
subq %rax, %rsi
sarq $0x5, %rsi
cmpq %rdx, %rsi
ja 0x10972
leaq -0x4a0(%rbp), %rsi
leaq -0x1a0(%rbp), %rdx
movq %rdi, %r14
callq 0x12a7e
leaq -0x298(%rbp), %rdi
movq %r14, %rsi
callq 0xb7ea
movq -0x3d938(%rbp), %rdi
leaq -0x3d928(%rbp), %rax
cmpq %rax, %rdi
je 0x109fe
movq -0x3d928(%rbp), %rsi
incq %rsi
callq 0x53c0
movq -0x3d958(%rbp), %rdi
leaq -0x3d948(%rbp), %rax
cmpq %rax, %rdi
je 0x10a20
movq -0x3d948(%rbp), %rsi
incq %rsi
callq 0x53c0
movq -0x1a0(%rbp), %rdi
leaq -0x190(%rbp), %rax
cmpq %rax, %rdi
je 0x10a42
movq -0x190(%rbp), %rsi
incq %rsi
callq 0x53c0
movq -0x4a0(%rbp), %rdi
leaq -0x490(%rbp), %rax
cmpq %rax, %rdi
je 0x107e7
movq -0x490(%rbp), %rsi
incq %rsi
callq 0x53c0
jmp 0x107e7
movl $0x100, %esi            # imm = 0x100
movq %r12, %rdi
movl $0xa, %edx
callq 0x5220
movq -0x1f110(%rbp), %rdi
testq %rdi, %rdi
je 0x10a9a
movq -0x1f0f0(%rbp), %rsi
subq %rdi, %rsi
callq 0x53c0
movq -0x6b8(%rbp), %rdi
leaq -0x6a8(%rbp), %rax
cmpq %rax, %rdi
je 0x10765
movq -0x6a8(%rbp), %rsi
incq %rsi
callq 0x53c0
jmp 0x10765
movq -0x60(%rbp), %r13
movq -0x58(%rbp), %rbx
movq %r12, %rdi
callq 0x50b0
movq -0x108(%rbp), %rsp
leaq -0x60(%rbp), %r15
movq %r15, %rdi
callq 0xab8e
subq %r13, %rbx
shrq $0x5, %rbx
addl %ebx, -0xb0(%rbp)
movq -0x70(%rbp), %rdi
incq %rdi
movq -0xa8(%rbp), %rcx
movq (%rcx), %rax
movq 0x8(%rcx), %rcx
subq %rax, %rcx
sarq $0x5, %rcx
movq -0xc0(%rbp), %rdx
movl %edx, %ebx
cmpq %rdi, %rcx
movq %r14, %r13
ja 0x1065e
leal 0x1(,%rdx,2), %eax
xorps %xmm0, %xmm0
cvtsi2sd %eax, %xmm0
movsd %xmm0, -0x1c8(%rbp)
movq -0x78(%rbp), %r13
movl -0xb4(%rbp), %r15d
movq -0x238(%rbp), %r14
jmp 0x10b60
movsd 0x22710(%rip), %xmm0    # 0x33268
movsd %xmm0, -0x1c8(%rbp)
movq -0x280(%rbp), %rsi
movq 0x30452(%rip), %rdi     # 0x40fc0
callq 0x5240
movq %rax, %rbx
leaq 0x22e1e(%rip), %rsi     # 0x3399b
movl $0x11, %edx
movq %rax, %rdi
callq 0x5420
movq %rbx, %rdi
movl %r13d, %esi
callq 0x5690
movq %rax, %rbx
leaq 0x22911(%rip), %rsi     # 0x334b0
movl $0xc, %edx
movq %rax, %rdi
callq 0x5420
movq -0x240(%rbp), %rsi
shrq $0x5, %rsi
movq %rbx, %rdi
callq 0x5690
movq %rax, %rbx
leaq 0x23f28(%rip), %rsi     # 0x34af1
movl $0x6, %edx
movq %rax, %rdi
callq 0x5420
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x53a0
movsbl %al, %esi
movq %rbx, %rdi
callq 0x5030
movq %rax, %rdi
callq 0x5250
leaq -0x1f110(%rbp), %rdx
movl $0x0, (%rdx)
leaq -0x3d958(%rbp), %rdi
leaq -0x6b8(%rbp), %rcx
movq %r14, %rsi
callq 0xfedc
leaq -0x1e0(%rbp), %rdi
leaq -0x3d958(%rbp), %rdx
leaq -0x4a0(%rbp), %rcx
movq %r14, %rsi
callq 0x128de
movq -0x3d958(%rbp), %rdi
testq %rdi, %rdi
je 0x10c58
movq -0x3d948(%rbp), %rsi
subq %rdi, %rsi
callq 0x53c0
movl -0x280(%rbp), %eax
leaq -0x1f110(%rbp), %rdx
movl %eax, (%rdx)
leaq -0x3d958(%rbp), %rdi
leaq -0x6b8(%rbp), %rcx
movq %r14, %rsi
callq 0xfedc
leaq -0x260(%rbp), %rdi
leaq -0x3d958(%rbp), %rdx
leaq -0x4a0(%rbp), %rcx
movq %r14, %rsi
callq 0x128de
movq -0x3d958(%rbp), %rdi
testq %rdi, %rdi
je 0x10cb5
movq -0x3d948(%rbp), %rsi
subq %rdi, %rsi
callq 0x53c0
leaq -0x1f110(%rbp), %rdx
movl $0x0, (%rdx)
leaq -0x3d958(%rbp), %rdi
leaq -0x6b8(%rbp), %rcx
movq %r14, %rsi
callq 0xfedc
leaq -0x4b8(%rbp), %rdi
leaq -0x3d958(%rbp), %rdx
leaq -0x4a0(%rbp), %rcx
movq %r14, %rsi
callq 0x128de
movq -0x3d958(%rbp), %rdi
testq %rdi, %rdi
je 0x10d10
movq -0x3d948(%rbp), %rsi
subq %rdi, %rsi
callq 0x53c0
movq 0x302a9(%rip), %rbx     # 0x40fc0
leaq 0x22c8f(%rip), %rsi     # 0x339ad
movl $0x19, %edx
movq %rbx, %rdi
callq 0x5420
movq (%rbx), %rax
addq -0x18(%rax), %rbx
movq %rbx, %rdi
movl $0xa, %esi
callq 0x53a0
movsbl %al, %esi
movq 0x30277(%rip), %rdi     # 0x40fc0
callq 0x5030
movq %rax, %rdi
callq 0x5250
leaq -0x3d958(%rbp), %rbx
movl $0x1e848, %edx          # imm = 0x1E848
movq %rbx, %rdi
xorl %esi, %esi
callq 0x51d0
leaq -0x230(%rbp), %rdi
leaq -0x1f110(%rbp), %rcx
movq %r14, %rsi
movq %rbx, %rdx
callq 0x12976
leaq -0x3d958(%rbp), %rdi
movl $0x1e848, %edx          # imm = 0x1E848
xorl %esi, %esi
callq 0x51d0
cmpq $0x0, -0x280(%rbp)
je 0x111db
movslq %r13d, %rax
movq %rax, -0x108(%rbp)
movl %eax, %ebx
andl $0x7fffffff, %ebx       # imm = 0x7FFFFFFF
leaq -0x6b8(%rbp), %r14
movq %rbx, -0x110(%rbp)
xorps %xmm0, %xmm0
movaps %xmm0, -0x1f110(%rbp)
movq $0x0, -0x1f100(%rbp)
movl $0x6, %esi
movq %r14, %rdi
leaq -0x1f110(%rbp), %r14
movq %r14, %rdx
leaq -0x4a0(%rbp), %rcx
callq 0x128de
movq -0x1f110(%rbp), %rdi
testq %rdi, %rdi
je 0x10e14
movq -0x1f100(%rbp), %rsi
subq %rdi, %rsi
callq 0x53c0
xorl %r12d, %r12d
movq -0x288(%rbp), %r15
testq %r15, %r15
je 0x11026
cmpl $0xf4240, %r12d         # imm = 0xF4240
jae 0x11026
movq %r15, -0x30(%rbp)
movl %r12d, -0x38(%rbp)
movq -0x6b8(%rbp), %r12
movq -0x6b0(%rbp), %r15
xorps %xmm0, %xmm0
movaps %xmm0, -0x1f110(%rbp)
movq $0x0, -0x1f100(%rbp)
cmpq %r15, %r12
je 0x10e93
movq %r12, %rdi
movq %r14, %rsi
callq 0x12d0e
addq $0x18, %r12
cmpq %r15, %r12
jne 0x10e64
movq -0x1f110(%rbp), %rdi
testq %rdi, %rdi
je 0x10e93
movq -0x1f100(%rbp), %rsi
subq %rdi, %rsi
callq 0x53c0
movl $0x0, -0x1f110(%rbp)
testl %r13d, %r13d
jle 0x10f48
movl $0x1, %r15d
movl -0x38(%rbp), %ecx
shlq %cl, %r15
movl %ecx, %r12d
shrl $0x6, %r12d
movq -0x30(%rbp), %rax
movq 0x28(%rax), %rax
xorl %ecx, %ecx
movslq %ecx, %rdx
movsbq (%rax,%rdx), %rdx
leaq 0x3056e(%rip), %rsi     # 0x41440
movsbq (%rsi,%rdx), %rdx
movq -0x6b8(%rbp), %rsi
leaq (%rdx,%rdx,2), %rdx
leaq (%rsi,%rdx,8), %rdi
movq 0x8(%rdi), %rsi
cmpq 0x10(%rdi), %rsi
je 0x10efc
movl %ecx, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x8(%rdi)
jmp 0x10f0c
movq %r14, %rdx
callq 0xdeae
movq -0x30(%rbp), %rax
movq 0x28(%rax), %rax
movslq -0x1f110(%rbp), %rcx
movsbq (%rax,%rcx), %rdx
leaq 0x30521(%rip), %rsi     # 0x41440
cmpb $0x5, (%rsi,%rdx)
jne 0x10f37
imulq $0x1e848, %rcx, %rdx    # imm = 0x1E848
addq -0x230(%rbp), %rdx
orq %r15, (%rdx,%r12,8)
incl %ecx
movl %ecx, -0x1f110(%rbp)
cmpl %r13d, %ecx
jl 0x10ec3
movq -0x6b8(%rbp), %rcx
movq 0x80(%rcx), %rax
xorl %edx, %edx
cmpq 0x78(%rcx), %rax
setne %dl
movl %edx, -0x68(%rbp)
movl $0x1, %edx
xorl %esi, %esi
cmpq $0x2, %rsi
ja 0x10fe4
leaq (%rsi,%rsi,2), %rax
movq (%rcx,%rax,8), %rdi
movq 0x8(%rcx,%rax,8), %r8
movq %rdx, %r9
cmpq %r8, %rdi
je 0x10fdb
leaq (%r9,%r9,2), %r10
movq (%rcx,%r10,8), %rax
movq 0x8(%rcx,%r10,8), %r11
movq %rdi, %r15
cmpq %r11, %rax
je 0x10fd2
movq -0x1e0(%rbp), %r12
movq %rax, %r10
movl (%r15), %r14d
movl (%r10), %ebx
cmpl %ebx, %r14d
movl %ebx, %r13d
cmovll %r14d, %r13d
cmovgl %r14d, %ebx
movslq %r13d, %r14
leaq (%r14,%r14,2), %r14
movslq %ebx, %rbx
movq (%r12,%r14,8), %r14
incl (%r14,%rbx,4)
addq $0x4, %r10
cmpq %r11, %r10
jne 0x10fa3
addq $0x4, %r15
cmpq %r8, %r15
jne 0x10f94
incq %r9
cmpq $0x4, %r9
jne 0x10f7f
incq %rsi
incq %rdx
cmpq $0x4, %rsi
jne 0x10f69
movl -0x38(%rbp), %r12d
addl -0x68(%rbp), %r12d
movq -0x30(%rbp), %rsi
movq (%rsi), %r15
leaq -0x298(%rbp), %rdi
callq 0xc7ce
movq -0x78(%rbp), %r13
movq -0x110(%rbp), %rbx
leaq -0x1f110(%rbp), %r14
jmp 0x10e1e
testl %r13d, %r13d
jle 0x111b3
movq -0x230(%rbp), %rax
movq -0x260(%rbp), %rcx
movq %rcx, -0xa8(%rbp)
movq %rax, -0x70(%rbp)
addq $0x1e848, %rax          # imm = 0x1E848
movq %rax, -0xb0(%rbp)
movl $0x1, %eax
movq %rax, -0xc0(%rbp)
xorl %ecx, %ecx
movq %rcx, -0x38(%rbp)
leaq 0x1(%rcx), %rax
movq %rax, -0x68(%rbp)
cmpq -0x108(%rbp), %rax
jge 0x11178
movq -0x38(%rbp), %rax
imulq $0x1e848, %rax, %r13    # imm = 0x1E848
addq -0x70(%rbp), %r13
leaq (%rax,%rax,2), %rax
movq -0xa8(%rbp), %rcx
movq (%rcx,%rax,8), %rax
movq %rax, -0x30(%rbp)
movq -0xb0(%rbp), %r12
movq -0xc0(%rbp), %r15
movl $0x1e848, %edx          # imm = 0x1E848
movq %r14, %rdi
movq %r13, %rsi
callq 0x5320
xorl %eax, %eax
movq (%r12,%rax,8), %rcx
orq %rcx, -0x1f110(%rbp,%rax,8)
incq %rax
cmpq $0x3d09, %rax           # imm = 0x3D09
jne 0x110be
movl $0x1e848, %edx          # imm = 0x1E848
leaq -0x3d958(%rbp), %rdi
movq %r14, %rsi
callq 0x5320
xorl %ecx, %ecx
xorl %eax, %eax
movabsq $0x5555555555555555, %rdi # imm = 0x5555555555555555
movabsq $0x3333333333333333, %r8 # imm = 0x3333333333333333
movabsq $0xf0f0f0f0f0f0f0f, %r9 # imm = 0xF0F0F0F0F0F0F0F
movabsq $0x101010101010101, %r10 # imm = 0x101010101010101
movq -0x3d958(%rbp,%rcx,8), %rdx
movq %rdx, %rsi
shrq %rsi
andq %rdi, %rsi
subq %rsi, %rdx
movq %rdx, %rsi
andq %r8, %rsi
shrq $0x2, %rdx
andq %r8, %rdx
addq %rsi, %rdx
movq %rdx, %rsi
shrq $0x4, %rsi
addq %rdx, %rsi
andq %r9, %rsi
imulq %r10, %rsi
shrq $0x38, %rsi
addq %rsi, %rax
incq %rcx
cmpq $0x3d09, %rcx           # imm = 0x3D09
jne 0x11115
movq -0x30(%rbp), %rcx
subl %eax, (%rcx,%r15,4)
incq %r15
addq $0x1e848, %r12          # imm = 0x1E848
cmpq %rbx, %r15
jne 0x110ac
imulq $0x1e848, -0x38(%rbp), %rdi # imm = 0x1E848
addq -0x70(%rbp), %rdi
movl $0x1e848, %edx          # imm = 0x1E848
xorl %esi, %esi
callq 0x51d0
incq -0xc0(%rbp)
movl $0x1e848, %eax          # imm = 0x1E848
addq %rax, -0xb0(%rbp)
movq -0x68(%rbp), %rax
movq %rax, %rcx
cmpq %rbx, %rax
jne 0x11063
leaq -0x6b8(%rbp), %r14
movq %r14, %rdi
callq 0x12a2a
cmpq $0x0, -0x280(%rbp)
movl -0xb4(%rbp), %r15d
movq -0x78(%rbp), %r13
jne 0x10dc6
leaq -0x50(%rbp), %r14
movq %r14, -0x10(%r14)
movq -0x118(%rbp), %rax
movq (%rax), %rsi
movq 0x8(%rax), %rdx
addq %rsi, %rdx
leaq -0x60(%rbp), %rdi
callq 0x8566
leaq 0x227c3(%rip), %rsi     # 0x339c7
leaq -0x60(%rbp), %rdi
callq 0x5710
leaq -0x1f110(%rbp), %rdi
leaq -0x60(%rbp), %rsi
movl $0x10, %edx
callq 0x5720
leaq 0x227a3(%rip), %rsi     # 0x339cc
leaq -0x1f110(%rbp), %rbx
movl $0x7, %edx
movq %rbx, %rdi
callq 0x5420
movq -0x1f110(%rbp), %rax
addq -0x18(%rax), %rbx
movq %rbx, %rdi
movl $0xa, %esi
callq 0x53a0
movsbl %al, %esi
leaq -0x1f110(%rbp), %rdi
callq 0x5030
movq %rax, %rdi
callq 0x5250
cmpb $0x0, -0x168(%rbp)
je 0x11e18
leaq -0xd0(%rbp), %r12
movq %r12, -0x10(%r12)
movq -0x118(%rbp), %rax
movq (%rax), %rsi
movq 0x8(%rax), %rdx
addq %rsi, %rdx
leaq -0xe0(%rbp), %rdi
callq 0x8566
leaq 0x2272b(%rip), %rsi     # 0x339d4
leaq -0xe0(%rbp), %rdi
callq 0x5710
leaq -0x6b8(%rbp), %rdi
leaq -0xe0(%rbp), %rsi
movl $0x10, %edx
callq 0x5720
leaq -0x198(%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 %rax, -0x130(%rbp)
xorps %xmm0, %xmm0
movaps %xmm0, -0x140(%rbp)
movq 0x2fcb6(%rip), %rdi     # 0x40fc0
leaq 0x226d1(%rip), %rsi     # 0x339e2
movl $0x15, %edx
callq 0x5420
movq -0xe0(%rbp), %rsi
movq -0xd8(%rbp), %rdx
movq 0x2fc90(%rip), %rdi     # 0x40fc0
callq 0x5420
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x53a0
movsbl %al, %esi
movq %rbx, %rdi
callq 0x5030
movq %rax, %rdi
callq 0x5250
leaq 0x22692(%rip), %rsi     # 0x339f8
leaq -0x6b8(%rbp), %rbx
movl $0x16, %edx
movq %rbx, %rdi
callq 0x5420
movq -0x6b8(%rbp), %rax
addq -0x18(%rax), %rbx
movq %rbx, %rdi
movl $0xa, %esi
callq 0x53a0
movsbl %al, %esi
leaq -0x6b8(%rbp), %rdi
callq 0x5030
movq %rax, %rdi
callq 0x5250
movl $0x0, -0x100(%rbp)
testl %r13d, %r13d
jle 0x119ac
xorps %xmm0, %xmm0
cvtsi2ss %r15d, %xmm0
movss %xmm0, -0x38(%rbp)
xorps %xmm0, %xmm0
movaps %xmm0, -0x4a0(%rbp)
movq $0x0, -0x490(%rbp)
leaq -0x4a0(%rbp), %rdi
xorl %esi, %esi
leaq -0x100(%rbp), %rdx
callq 0xdeae
movl -0x100(%rbp), %eax
incl %eax
movl %eax, -0xa0(%rbp)
movb $0x1, %cl
cmpl %r13d, %eax
jge 0x11643
xorl %r14d, %r14d
movslq -0x100(%rbp), %rsi
movslq %eax, %rcx
movq -0x1e0(%rbp), %rdi
leaq (%rsi,%rsi,2), %rdx
movq (%rdi,%rdx,8), %rdi
cmpl %r15d, (%rdi,%rcx,4)
jg 0x1162c
movq -0x260(%rbp), %rdi
movq -0x218(%rbp), %r8
movl (%r8,%rsi,4), %esi
movl (%r8,%rcx,4), %r8d
cmpl %esi, %r8d
cmovll %r8d, %esi
movq (%rdi,%rdx,8), %rdx
xorps %xmm0, %xmm0
cvtsi2ssl (%rdx,%rcx,4), %xmm0
xorps %xmm1, %xmm1
cvtsi2ss %esi, %xmm1
divss %xmm1, %xmm0
ucomiss -0x120(%rbp), %xmm0
jb 0x1162c
movq -0x498(%rbp), %rsi
cmpq -0x490(%rbp), %rsi
je 0x11492
movl %eax, (%rsi)
addq $0x4, %rsi
movq %rsi, -0x498(%rbp)
jmp 0x114a5
leaq -0x4a0(%rbp), %rdi
leaq -0xa0(%rbp), %rdx
callq 0xdeae
movsd 0x21dbb(%rip), %xmm2    # 0x33268
movsd %xmm2, -0x30(%rbp)
testl %r15d, %r15d
jle 0x11509
movslq -0x100(%rbp), %rax
movq -0x1e0(%rbp), %rcx
leaq (%rax,%rax,2), %rax
movslq -0xa0(%rbp), %rdx
movq (%rcx,%rax,8), %rax
xorps %xmm0, %xmm0
cvtsi2ssl (%rax,%rdx,4), %xmm0
divss -0x38(%rbp), %xmm0
cvtss2sd %xmm0, %xmm0
movapd %xmm2, %xmm1
subsd %xmm0, %xmm1
mulsd 0x22473(%rip), %xmm1    # 0x33968
addsd %xmm2, %xmm1
xorps %xmm0, %xmm0
cvtsd2ss %xmm1, %xmm0
cvtss2sd %xmm0, %xmm0
movsd %xmm0, -0x30(%rbp)
movl $0x1, %edx
leaq -0x1f110(%rbp), %rdi
leaq 0x22d85(%rip), %rsi     # 0x342a1
callq 0x5420
movslq -0x100(%rbp), %rax
movq -0x160(%rbp), %rcx
shlq $0x5, %rax
movq (%rcx,%rax), %rsi
movq 0x8(%rcx,%rax), %rdx
leaq -0x1f110(%rbp), %rdi
callq 0x5420
movq %rax, %rbx
movl $0x4, %edx
movq %rax, %rdi
leaq 0x224b5(%rip), %rsi     # 0x33a0f
callq 0x5420
movslq -0xa0(%rbp), %rax
movq -0x160(%rbp), %rcx
shlq $0x5, %rax
movq (%rcx,%rax), %rsi
movq 0x8(%rcx,%rax), %rdx
movq %rbx, %rdi
callq 0x5420
movq %rax, %rbx
movl $0x9, %edx
movq %rax, %rdi
leaq 0x22480(%rip), %rsi     # 0x33a14
callq 0x5420
movslq -0x100(%rbp), %rax
movq -0x1e0(%rbp), %rcx
leaq (%rax,%rax,2), %rax
movslq -0xa0(%rbp), %rdx
movq (%rcx,%rax,8), %rax
movl (%rax,%rdx,4), %esi
movq %rbx, %rdi
callq 0x5690
movq %rax, %rbx
movl $0x9, %edx
movq %rax, %rdi
leaq 0x2244b(%rip), %rsi     # 0x33a1e
callq 0x5420
movq %rbx, %rdi
movsd -0x30(%rbp), %xmm0
callq 0x5610
movq %rax, %rbx
movl $0x3, %edx
movq %rax, %rdi
leaq 0x22431(%rip), %rsi     # 0x33a28
callq 0x5420
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x53a0
movsbl %al, %esi
movq %rbx, %rdi
callq 0x5030
movq %rax, %rdi
callq 0x5250
incl %r14d
movl -0xa0(%rbp), %eax
incl %eax
movl %eax, -0xa0(%rbp)
cmpl %r13d, %eax
jl 0x1140f
testl %r14d, %r14d
sete %cl
testb %cl, -0x16c(%rbp)
je 0x116c8
movl $0x1, %edx
leaq -0x1f110(%rbp), %rdi
leaq 0x22c43(%rip), %rsi     # 0x342a1
callq 0x5420
movslq -0x100(%rbp), %rax
movq -0x160(%rbp), %rcx
shlq $0x5, %rax
movq (%rcx,%rax), %rsi
movq 0x8(%rcx,%rax), %rdx
leaq -0x1f110(%rbp), %rdi
callq 0x5420
movq %rax, %rbx
movl $0x2, %edx
movq %rax, %rdi
leaq 0x2238d(%rip), %rsi     # 0x33a29
callq 0x5420
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x53a0
movsbl %al, %esi
movq %rbx, %rdi
callq 0x5030
movq %rax, %rdi
callq 0x5250
movq -0x138(%rbp), %rcx
subq -0x140(%rbp), %rcx
sarq $0x3, %rcx
movabsq $-0x5555555555555555, %rax # imm = 0xAAAAAAAAAAAAAAAB
imulq %rax, %rcx
movq -0x4a0(%rbp), %rbx
movq -0x498(%rbp), %rax
cmpq %rax, %rbx
je 0x11762
movq -0x190(%rbp), %rdx
movl %ecx, %r13d
movq %rbx, %rsi
testq %rdx, %rdx
je 0x11757
movl (%rsi), %edi
movq %rdx, %r14
movq %r12, %r9
movq %r9, %r8
movq %r14, %r10
movl 0x20(%r14), %r11d
xorl %r14d, %r14d
cmpl %edi, %r11d
setl %r14b
movq %r10, %r9
cmovlq %r8, %r9
movq 0x10(%r10,%r14,8), %r14
testq %r14, %r14
jne 0x11715
cmpq %r12, %r9
je 0x11757
cmpl %edi, %r11d
cmovlq %r8, %r10
cmpl 0x20(%r10), %edi
jl 0x11757
movl 0x24(%r9), %edi
cmpl %r13d, %edi
cmovll %edi, %r13d
addq $0x4, %rsi
cmpq %rax, %rsi
jne 0x11708
jmp 0x11765
movl %ecx, %r13d
movslq %r13d, %r15
cmpq %r15, %rcx
jne 0x117be
xorps %xmm0, %xmm0
movaps %xmm0, -0xa0(%rbp)
movq $0x0, -0x90(%rbp)
leaq -0x140(%rbp), %rdi
leaq -0xa0(%rbp), %rsi
callq 0x12df2
movq -0xa0(%rbp), %rdi
testq %rdi, %rdi
je 0x117b0
movq -0x90(%rbp), %rsi
subq %rdi, %rsi
callq 0x53c0
movq -0x4a0(%rbp), %rbx
movq -0x498(%rbp), %rax
movq %r13, -0x30(%rbp)
cmpq %rax, %rbx
je 0x118f4
movq -0x30(%rbp), %r13
shlq $0x20, %r13
movq -0x190(%rbp), %rdi
movl (%rbx), %eax
testq %rdi, %rdi
je 0x11821
leaq -0x198(%rbp), %r12
movq %r12, %rcx
movq %rdi, %rdx
movl 0x20(%rdi), %esi
xorl %edi, %edi
cmpl %eax, %esi
setl %dil
movq %rdx, %r12
cmovlq %rcx, %r12
movq 0x10(%rdx,%rdi,8), %rdi
testq %rdi, %rdi
jne 0x117e8
leaq -0x198(%rbp), %rdi
cmpq %rdi, %r12
je 0x11821
cmpl %eax, %esi
cmovlq %rcx, %rdx
cmpl 0x20(%rdx), %eax
jge 0x1186f
orq %r13, %rax
movq %rax, -0xa0(%rbp)
leaq -0x1a0(%rbp), %rdi
leaq -0xa0(%rbp), %rsi
callq 0x12fcc
movq -0x140(%rbp), %rax
leaq (%r15,%r15,2), %rcx
leaq (%rax,%rcx,8), %rdi
movq 0x8(%rdi), %rsi
cmpq 0x10(%rdi), %rsi
je 0x11865
movl (%rbx), %eax
movl %eax, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x8(%rdi)
jmp 0x118e3
movq %rbx, %rdx
callq 0xdeae
jmp 0x118e3
movslq 0x24(%r12), %rcx
cmpl -0x30(%rbp), %ecx
je 0x118e3
movq -0x140(%rbp), %rax
leaq (%rcx,%rcx,2), %rcx
movq (%rax,%rcx,8), %r14
cmpq 0x8(%rax,%rcx,8), %r14
je 0x118e3
leaq (%r15,%r15,2), %rcx
leaq (%rax,%rcx,8), %rdi
movq 0x8(%rdi), %rsi
cmpq 0x10(%rdi), %rsi
je 0x118b0
movl (%r14), %ecx
movl %ecx, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x8(%rdi)
jmp 0x118bf
movq %r14, %rdx
callq 0xdeae
movq -0x140(%rbp), %rax
addq $0x4, %r14
movslq 0x24(%r12), %rcx
leaq (%rcx,%rcx,2), %rcx
cmpq 0x8(%rax,%rcx,8), %r14
jne 0x1188f
leaq (%rax,%rcx,8), %rax
movq (%rax), %rcx
cmpq %rcx, %r14
je 0x118e3
movq %rcx, 0x8(%rax)
addq $0x4, %rbx
cmpq -0x498(%rbp), %rbx
jne 0x117d3
movq -0x140(%rbp), %rcx
leaq (%r15,%r15,2), %rdx
movq (%rcx,%rdx,8), %rax
movq 0x8(%rcx,%rdx,8), %rcx
cmpq %rcx, %rax
movq -0x78(%rbp), %r13
movl -0xb4(%rbp), %r15d
leaq -0x198(%rbp), %r12
je 0x1197a
movq -0x190(%rbp), %rdx
testq %rdx, %rdx
je 0x11971
movl (%rax), %esi
movq %rdx, %r11
movq %r12, %rdi
movq %rdi, %r8
movq %r11, %r9
movl 0x20(%r11), %r10d
xorl %r11d, %r11d
cmpl %esi, %r10d
setl %r11b
movq %r9, %rdi
cmovlq %r8, %rdi
movq 0x10(%r9,%r11,8), %r11
testq %r11, %r11
jne 0x11933
cmpq %r12, %rdi
je 0x11971
cmpl %esi, %r10d
cmovlq %r8, %r9
cmpl 0x20(%r9), %esi
jl 0x11971
movq -0x30(%rbp), %rsi
movl %esi, 0x24(%rdi)
addq $0x4, %rax
cmpq %rcx, %rax
jne 0x11926
movq -0x4a0(%rbp), %rdi
testq %rdi, %rdi
je 0x11995
movq -0x490(%rbp), %rsi
subq %rdi, %rsi
callq 0x53c0
movl -0x100(%rbp), %eax
incl %eax
movl %eax, -0x100(%rbp)
cmpl %r13d, %eax
jl 0x113c9
movq -0x188(%rbp), %rbx
cmpq %r12, %rbx
je 0x11a2a
leaq 0x228e2(%rip), %r15     # 0x342a1
leaq 0x21fd3(%rip), %r14     # 0x33999
movslq 0x20(%rbx), %rax
movq -0x160(%rbp), %rcx
shlq $0x5, %rax
movq (%rcx,%rax), %rsi
movq 0x8(%rcx,%rax), %rdx
leaq -0x6b8(%rbp), %rdi
callq 0x5420
movq %rax, %r13
movl $0x1, %edx
movq %rax, %rdi
movq %r15, %rsi
callq 0x5420
movl 0x24(%rbx), %esi
incl %esi
movq %r13, %rdi
callq 0x5690
movl $0x1, %edx
movq %rax, %rdi
movq %r14, %rsi
callq 0x5420
movq %rbx, %rdi
callq 0x5270
movq %rax, %rbx
cmpq %r12, %rax
jne 0x119c6
leaq -0x6b8(%rbp), %rdi
callq 0x5530
movq -0x78(%rbp), %r13
movq -0x140(%rbp), %r15
movq -0x138(%rbp), %rax
cmpq %rax, %r15
je 0x11da4
movq 0x2f558(%rip), %rcx     # 0x40fb0
movq (%rcx), %rdx
movq %rdx, -0x38(%rbp)
movq 0x18(%rcx), %rcx
movq %rcx, -0x68(%rbp)
xorl %r12d, %r12d
leaq -0x4a0(%rbp), %r14
leaq 0x21f21(%rip), %rbx     # 0x33999
leal 0x1(%r12), %ecx
movl %ecx, -0x30(%rbp)
movq 0x8(%r15), %rcx
subq (%r15), %rcx
cmpq $0x5, %rcx
jb 0x11d91
leaq -0xf0(%rbp), %rax
movq %rax, -0x100(%rbp)
movq -0x118(%rbp), %rax
movq (%rax), %rsi
movq 0x8(%rax), %rdx
addq %rsi, %rdx
leaq -0x100(%rbp), %r13
movq %r13, %rdi
callq 0x8566
movq %r13, %rdi
leaq 0x21f63(%rip), %rsi     # 0x33a2c
callq 0x5710
movl $0x1, %r13d
cmpl $0x9, %r12d
leaq -0x1b0(%rbp), %r12
jb 0x11b28
movl $0x4, %r13d
movl -0x30(%rbp), %eax
cmpl $0x63, %eax
jbe 0x11b1f
cmpl $0x3e7, %eax            # imm = 0x3E7
jbe 0x11b25
cmpl $0x2710, %eax           # imm = 0x2710
jb 0x11b28
movl %eax, %ecx
movl $0xd1b71759, %edx       # imm = 0xD1B71759
imulq %rdx, %rcx
shrq $0x2d, %rcx
addl $0x4, %r13d
cmpl $0x1869f, %eax          # imm = 0x1869F
movl %ecx, %eax
ja 0x11aea
addl $-0x3, %r13d
jmp 0x11b28
addl $-0x2, %r13d
jmp 0x11b28
decl %r13d
movl %r13d, %esi
movq %r12, -0x1c0(%rbp)
leaq -0x1c0(%rbp), %rdi
movl $0x2d, %edx
callq 0x5440
movq -0x1c0(%rbp), %rdi
movl %r13d, %esi
movl -0x30(%rbp), %edx
callq 0x12ae1
movq -0x100(%rbp), %rcx
movl $0xf, %edi
leaq -0xf0(%rbp), %rax
cmpq %rax, %rcx
je 0x11b74
movq -0xf0(%rbp), %rdi
movq -0xf8(%rbp), %r8
movq -0x1c0(%rbp), %rsi
movq -0x1b8(%rbp), %rdx
leaq (%rdx,%r8), %rax
cmpq %rdi, %rax
movq -0x78(%rbp), %r13
jbe 0x11bac
movl $0xf, %edi
cmpq %r12, %rsi
je 0x11ba7
movq -0x1b0(%rbp), %rdi
cmpq %rdi, %rax
jbe 0x11bba
leaq -0x100(%rbp), %rdi
callq 0x5110
jmp 0x11bca
leaq -0x1c0(%rbp), %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x5400
leaq -0x490(%rbp), %rsi
movq %rsi, -0x4a0(%rbp)
movq (%rax), %rdx
leaq 0x10(%rax), %rcx
cmpq %rcx, %rdx
je 0x11bf7
movq %rdx, -0x4a0(%rbp)
movq (%rcx), %rdx
movq %rdx, -0x490(%rbp)
jmp 0x11bfd
movups (%rcx), %xmm0
movups %xmm0, (%rsi)
movq %rax, %rdx
addq $0x8, %rdx
movq 0x8(%rax), %rsi
movq %rsi, -0x498(%rbp)
movq %rcx, (%rax)
movq $0x0, (%rdx)
movb $0x0, (%rcx)
movq %r14, %rdi
leaq 0x21e10(%rip), %rsi     # 0x33a36
callq 0x5710
leaq -0x90(%rbp), %rsi
movq %rsi, -0xa0(%rbp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x11c5b
movq %rdx, -0xa0(%rbp)
movq (%rcx), %rdx
movq %rdx, -0x90(%rbp)
jmp 0x11c61
movups (%rcx), %xmm0
movups %xmm0, (%rsi)
movq 0x8(%rax), %rdx
movq %rdx, -0x98(%rbp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq -0x4a0(%rbp), %rdi
leaq -0x490(%rbp), %rax
cmpq %rax, %rdi
je 0x11c9d
movq -0x490(%rbp), %rsi
incq %rsi
callq 0x53c0
movq -0x1c0(%rbp), %rdi
cmpq %r12, %rdi
je 0x11cb8
movq -0x1b0(%rbp), %rsi
incq %rsi
callq 0x53c0
movq -0x100(%rbp), %rdi
leaq -0xf0(%rbp), %rax
cmpq %rax, %rdi
je 0x11cda
movq -0xf0(%rbp), %rsi
incq %rsi
callq 0x53c0
movq %r14, %rdi
leaq -0xa0(%rbp), %rsi
movl $0x10, %edx
callq 0x5720
movq (%r15), %r12
cmpq 0x8(%r15), %r12
je 0x11d2d
movslq (%r12), %rax
movq -0x160(%rbp), %rcx
shlq $0x5, %rax
movq (%rcx,%rax), %rsi
movq 0x8(%rcx,%rax), %rdx
movq %r14, %rdi
callq 0x5420
movl $0x1, %edx
movq %rax, %rdi
movq %rbx, %rsi
callq 0x5420
addq $0x4, %r12
jmp 0x11cf1
movq %r14, %rdi
callq 0x5530
movq -0x38(%rbp), %rax
movq %rax, -0x4a0(%rbp)
movq -0x18(%rax), %rax
movq -0x68(%rbp), %rcx
movq %rcx, -0x4a0(%rbp,%rax)
leaq -0x498(%rbp), %rdi
callq 0x5330
leaq -0x3a8(%rbp), %rdi
callq 0x5120
movq -0xa0(%rbp), %rdi
leaq -0x90(%rbp), %rax
cmpq %rax, %rdi
je 0x11d8a
movq -0x90(%rbp), %rsi
incq %rsi
callq 0x53c0
movq -0x138(%rbp), %rax
addq $0x18, %r15
movl -0x30(%rbp), %ecx
movl %ecx, %r12d
cmpq %rax, %r15
jne 0x11a78
leaq -0x140(%rbp), %rdi
callq 0x12a2a
leaq -0x1a0(%rbp), %rdi
callq 0x12b4e
movq 0x2f1ed(%rip), %rax     # 0x40fb0
movq (%rax), %rcx
movq 0x18(%rax), %rax
leaq -0x6b0(%rbp), %rdi
movq %rcx, -0x8(%rdi)
movq -0x18(%rcx), %rcx
movq %rax, -0x6b8(%rbp,%rcx)
callq 0x5330
leaq -0x5c0(%rbp), %rdi
callq 0x5120
movq -0xe0(%rbp), %rdi
leaq -0xd0(%rbp), %rax
cmpq %rax, %rdi
je 0x11e14
movq -0xd0(%rbp), %rsi
incq %rsi
callq 0x53c0
leaq -0x50(%rbp), %r14
leaq 0x21c1c(%rip), %rsi     # 0x33a3b
leaq -0x1f110(%rbp), %rbx
movl $0x1, %edx
movq %rbx, %rdi
callq 0x5420
movq -0x1f110(%rbp), %rax
addq -0x18(%rax), %rbx
movq %rbx, %rdi
movl $0xa, %esi
callq 0x53a0
movsbl %al, %esi
leaq -0x1f110(%rbp), %rdi
callq 0x5030
movq %rax, %rdi
callq 0x5250
leaq -0x1f110(%rbp), %rdi
callq 0x5530
cmpb $0x0, -0x164(%rbp)
je 0x1228c
leaq -0x490(%rbp), %r15
movq %r15, -0x10(%r15)
movq -0x118(%rbp), %rax
movq (%rax), %rsi
movq 0x8(%rax), %rdx
addq %rsi, %rdx
leaq -0x4a0(%rbp), %rdi
callq 0x8566
leaq 0x21b93(%rip), %rsi     # 0x33a3d
leaq -0x4a0(%rbp), %rdi
callq 0x5710
movq 0x2f103(%rip), %rdi     # 0x40fc0
leaq 0x21b88(%rip), %rsi     # 0x33a4c
movl $0x16, %edx
callq 0x5420
movq -0x4a0(%rbp), %rsi
movq -0x498(%rbp), %rdx
movq 0x2f0dd(%rip), %rdi     # 0x40fc0
callq 0x5420
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x53a0
movsbl %al, %esi
movq %rbx, %rdi
callq 0x5030
movq %rax, %rdi
callq 0x5250
leaq -0x6b8(%rbp), %rdi
leaq -0x4a0(%rbp), %rsi
movl $0x10, %edx
callq 0x5720
leaq 0x21b32(%rip), %rsi     # 0x33a63
leaq -0x6b8(%rbp), %rbx
movl $0x57, %edx
movq %rbx, %rdi
callq 0x5420
movq -0x6b8(%rbp), %rax
addq -0x18(%rax), %rbx
movq %rbx, %rdi
movl $0xa, %esi
callq 0x53a0
movsbl %al, %esi
leaq -0x6b8(%rbp), %rdi
callq 0x5030
movq %rax, %rdi
callq 0x5250
testl %r13d, %r13d
jle 0x12224
movsd 0x212db(%rip), %xmm0    # 0x33260
divsd -0x1c8(%rbp), %xmm0
movsd %xmm0, -0xc0(%rbp)
andl $0x7fffffff, %r13d      # imm = 0x7FFFFFFF
leaq -0x1(%r13), %rax
movq %rax, -0xa8(%rbp)
movq $0x0, -0x120(%rbp)
leaq 0x222e8(%rip), %r14     # 0x342a1
xorl %eax, %eax
movq %r13, -0x78(%rbp)
movq %rax, -0x70(%rbp)
incq %rax
movq %rax, -0x108(%rbp)
cmpq %r13, %rax
jae 0x12201
movq -0x70(%rbp), %rax
leaq (%rax,%rax,2), %r12
shlq $0x5, %rax
movq %rax, -0xb0(%rbp)
movq -0xa8(%rbp), %rbx
movq -0x120(%rbp), %r13
movq -0x260(%rbp), %rax
movq (%rax,%r12,8), %rax
movl 0x4(%rax,%r13), %eax
cvtsi2ss %eax, %xmm1
movq -0x218(%rbp), %rcx
movq -0x70(%rbp), %rdx
movl (%rcx,%rdx,4), %edx
addl %eax, %eax
subl %eax, %edx
addl 0x4(%rcx,%r13), %edx
cvtsi2ss %edx, %xmm2
movaps %xmm1, %xmm0
movss %xmm2, -0x110(%rbp)
addss %xmm2, %xmm0
movss %xmm1, -0x30(%rbp)
divss %xmm0, %xmm1
movss %xmm1, -0x38(%rbp)
ucomiss 0x21926(%rip), %xmm1    # 0x33970
movsd 0x21216(%rip), %xmm0    # 0x33268
movsd %xmm0, -0x68(%rbp)
jne 0x1205b
jnp 0x12091
movss -0x38(%rbp), %xmm1
movaps %xmm1, %xmm0
addss %xmm1, %xmm0
addss 0x20f95(%rip), %xmm1    # 0x33004
divss %xmm1, %xmm0
cvtss2sd %xmm0, %xmm0
callq 0x5300
mulsd -0xc0(%rbp), %xmm0
cvtsd2ss %xmm0, %xmm0
cvtss2sd %xmm0, %xmm0
movsd %xmm0, -0x68(%rbp)
movq -0x160(%rbp), %rax
movq -0xb0(%rbp), %rcx
movq (%rax,%rcx), %rsi
movq 0x8(%rax,%rcx), %rdx
leaq -0x6b8(%rbp), %rdi
callq 0x5420
movq %rax, %r15
movl $0x1, %edx
movq %rax, %rdi
movq %r14, %rsi
callq 0x5420
movq -0x160(%rbp), %rax
movq 0x20(%rax,%r13,8), %rsi
movq 0x28(%rax,%r13,8), %rdx
movq %r15, %rdi
callq 0x5420
movq %rax, %r15
movl $0x1, %edx
movq %rax, %rdi
movq %r14, %rsi
callq 0x5420
cvttss2si -0x30(%rbp), %esi
movq %r15, %rdi
callq 0x5690
movq %rax, %r15
movl $0x1, %edx
movq %rax, %rdi
movq %r14, %rsi
callq 0x5420
cvttss2si -0x110(%rbp), %esi
movq %r15, %rdi
callq 0x5690
movq %rax, %r15
movl $0x1, %edx
movq %rax, %rdi
movq %r14, %rsi
callq 0x5420
xorps %xmm0, %xmm0
cvtss2sd -0x38(%rbp), %xmm0
movq %r15, %rdi
callq 0x5610
movq %rax, %r15
movl $0x1, %edx
movq %rax, %rdi
movq %r14, %rsi
callq 0x5420
movq %r15, %rdi
movsd -0x68(%rbp), %xmm0
callq 0x5610
movq %rax, %r15
movl $0x1, %edx
movq %rax, %rdi
movq %r14, %rsi
callq 0x5420
movq -0x1e0(%rbp), %rax
movq (%rax,%r12,8), %rax
movl 0x4(%rax,%r13), %esi
movq %r15, %rdi
callq 0x5690
movq %rax, %r15
movl $0x1, %edx
movq %rax, %rdi
movq %r14, %rsi
callq 0x5420
movq -0x1e0(%rbp), %rax
movq (%rax,%r12,8), %rax
xorps %xmm0, %xmm0
cvtsi2ssl 0x4(%rax,%r13), %xmm0
divss -0x30(%rbp), %xmm0
cvtss2sd %xmm0, %xmm0
movq %r15, %rdi
callq 0x5610
movq %rax, %r15
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r15, %rdi
movl $0xa, %esi
callq 0x53a0
movsbl %al, %esi
movq %r15, %rdi
callq 0x5030
movq %rax, %rdi
callq 0x5250
addq $0x4, %r13
decq %rbx
jne 0x11ff7
addq $0x4, -0x120(%rbp)
decq -0xa8(%rbp)
movq -0x78(%rbp), %r13
movq -0x108(%rbp), %rax
cmpq %r13, %rax
jne 0x11fbf
leaq -0x6b8(%rbp), %rdi
callq 0x5530
movq 0x2ed79(%rip), %rax     # 0x40fb0
movq (%rax), %rcx
movq 0x18(%rax), %rax
leaq -0x6b0(%rbp), %rdi
movq %rcx, -0x8(%rdi)
movq -0x18(%rcx), %rcx
movq %rax, -0x6b8(%rbp,%rcx)
callq 0x5330
leaq -0x5c0(%rbp), %rdi
callq 0x5120
movq -0x4a0(%rbp), %rdi
leaq -0x490(%rbp), %rax
cmpq %rax, %rdi
leaq -0x50(%rbp), %r14
je 0x1228c
movq -0x490(%rbp), %rsi
incq %rsi
callq 0x53c0
movq -0x248(%rbp), %rdi
callq 0x8320
movq 0x2ed11(%rip), %rax     # 0x40fb0
movq (%rax), %rcx
movq 0x18(%rax), %rax
leaq -0x1f108(%rbp), %rdi
movq %rcx, -0x8(%rdi)
movq -0x18(%rcx), %rcx
movq %rax, -0x1f110(%rbp,%rcx)
callq 0x5330
leaq -0x1f018(%rbp), %rdi
callq 0x5120
movq -0x60(%rbp), %rdi
cmpq %r14, %rdi
je 0x122e3
movq -0x50(%rbp), %rsi
incq %rsi
callq 0x53c0
movq -0x230(%rbp), %rdi
testq %rdi, %rdi
je 0x122fe
movq -0x220(%rbp), %rsi
subq %rdi, %rsi
callq 0x53c0
leaq -0x4b8(%rbp), %rdi
callq 0x12a2a
leaq -0x260(%rbp), %rdi
callq 0x12a2a
leaq -0x1e0(%rbp), %rdi
callq 0x12a2a
jmp 0x123a7
movl $0x1, %ebx
jmp 0x123a9
movq 0x2ec8b(%rip), %rbx     # 0x40fc0
leaq 0x21638(%rip), %rsi     # 0x33974
movl $0x26, %edx
movq %rbx, %rdi
callq 0x5420
movq (%rbx), %rax
addq -0x18(%rax), %rbx
movq %rbx, %rdi
movl $0xa, %esi
callq 0x53a0
movsbl %al, %esi
movq 0x2ec59(%rip), %rdi     # 0x40fc0
callq 0x5030
movq %rax, %rdi
callq 0x5250
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x53a0
movsbl %al, %esi
movq %rbx, %rdi
callq 0x5030
movq %rax, %rdi
callq 0x5250
leaq -0x60(%rbp), %rdi
callq 0xab8e
xorl %ebx, %ebx
leaq -0x8c0(%rbp), %rdi
callq 0x50d0
movq -0x218(%rbp), %rdi
testq %rdi, %rdi
je 0x123d0
movq -0x208(%rbp), %rsi
subq %rdi, %rsi
callq 0x53c0
movq -0x200(%rbp), %rdi
leaq -0x1f0(%rbp), %rax
cmpq %rax, %rdi
je 0x123f2
movq -0x1f0(%rbp), %rsi
incq %rsi
callq 0x53c0
leaq -0x298(%rbp), %rdi
callq 0xddf4
leaq -0x160(%rbp), %rdi
callq 0xab8e
movl %ebx, %eax
leaq -0x28(%rbp), %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x12518
jmp 0x12518
jmp 0x125ea
movq %rax, %rbx
leaq -0x50(%rbp), %r14
leaq -0xd0(%rbp), %r15
jmp 0x126c4
movq %rax, %rbx
movq -0xe0(%rbp), %rdi
cmpq %r12, %rdi
jne 0x126d4
jmp 0x12756
jmp 0x125ea
jmp 0x1245c
movq %rax, %rbx
jmp 0x12762
movq %rax, %rbx
jmp 0x127d5
jmp 0x12525
movq %rax, %rbx
movq -0x3d958(%rbp), %rdi
testq %rdi, %rdi
je 0x127fc
movq -0x3d948(%rbp), %rsi
subq %rdi, %rsi
callq 0x53c0
jmp 0x127fc
movq %rax, %rbx
jmp 0x127fc
movq %rax, %rbx
movq -0x3d958(%rbp), %rdi
testq %rdi, %rdi
je 0x12808
movq -0x3d948(%rbp), %rsi
subq %rdi, %rsi
callq 0x53c0
jmp 0x12808
movq %rax, %rbx
jmp 0x12808
movq %rax, %rbx
movq -0x3d958(%rbp), %rdi
testq %rdi, %rdi
je 0x12874
movq -0x3d948(%rbp), %rsi
subq %rdi, %rsi
callq 0x53c0
jmp 0x12874
jmp 0x125f6
movq %rax, %rbx
jmp 0x12880
movq %rax, %rbx
jmp 0x1289b
movq %rax, %rbx
jmp 0x128bd
jmp 0x12721
movq %rax, %rbx
jmp 0x1273b
jmp 0x1266f
movq %rax, %rbx
jmp 0x127f0
movq %rax, %rbx
jmp 0x128c9
jmp 0x1262f
movq %rax, %rbx
jmp 0x1263e
movq %rax, %rbx
movq -0x4a0(%rbp), %rdi
leaq -0x490(%rbp), %rax
cmpq %rax, %rdi
je 0x1256c
movq -0x490(%rbp), %rsi
incq %rsi
callq 0x53c0
jmp 0x1256c
movq %rax, %rbx
movq -0x1c0(%rbp), %rdi
leaq -0x1b0(%rbp), %rax
cmpq %rax, %rdi
je 0x12595
movq -0x1b0(%rbp), %rsi
incq %rsi
callq 0x53c0
jmp 0x12595
jmp 0x12592
movq %rax, %rbx
movq -0x100(%rbp), %rdi
leaq -0xf0(%rbp), %rax
cmpq %rax, %rdi
je 0x12660
movq -0xf0(%rbp), %rsi
jmp 0x12658
jmp 0x12624
movq %rax, %rbx
movq -0xa0(%rbp), %rdi
testq %rdi, %rdi
je 0x1267a
movq -0x90(%rbp), %rsi
subq %rdi, %rsi
callq 0x53c0
jmp 0x1267a
jmp 0x12624
jmp 0x125f6
jmp 0x12677
movq %rax, %rbx
jmp 0x12756
jmp 0x1266f
jmp 0x1266f
movq %rax, %rbx
jmp 0x12874
jmp 0x12677
movq %rax, %rbx
movq -0x1f110(%rbp), %rdi
testq %rdi, %rdi
je 0x127d5
movq -0x1f100(%rbp), %rsi
subq %rdi, %rsi
jmp 0x12772
jmp 0x12677
movq %rax, %rbx
jmp 0x12660
jmp 0x12677
jmp 0x12677
jmp 0x12677
movq %rax, %rbx
leaq -0x4a0(%rbp), %rdi
callq 0x55a0
movq -0xa0(%rbp), %rdi
leaq -0x90(%rbp), %rax
cmpq %rax, %rdi
je 0x12660
movq -0x90(%rbp), %rsi
incq %rsi
callq 0x53c0
leaq -0x50(%rbp), %r14
leaq -0xd0(%rbp), %r15
jmp 0x126a0
jmp 0x1266f
movq %rax, %rbx
jmp 0x1286b
movq %rax, %rbx
leaq -0x50(%rbp), %r14
leaq -0xd0(%rbp), %r15
movq -0x4a0(%rbp), %rdi
testq %rdi, %rdi
je 0x126a0
movq -0x490(%rbp), %rsi
subq %rdi, %rsi
callq 0x53c0
leaq -0x140(%rbp), %rdi
callq 0x12a2a
leaq -0x1a0(%rbp), %rdi
callq 0x12b4e
leaq -0x6b8(%rbp), %rdi
callq 0x55a0
movq -0xe0(%rbp), %rdi
cmpq %r15, %rdi
je 0x12756
movq -0xd0(%rbp), %rsi
jmp 0x1274e
jmp 0x12779
jmp 0x12816
movq %rax, %rbx
leaq -0x3d958(%rbp), %rdi
callq 0xaaf0
jmp 0x126fb
movq %rax, %rbx
movq -0x1a0(%rbp), %rdi
leaq -0x190(%rbp), %rax
cmpq %rax, %rdi
je 0x12781
movq -0x190(%rbp), %rsi
incq %rsi
callq 0x53c0
jmp 0x12781
jmp 0x1277e
movq %rax, %rbx
leaq -0x6b8(%rbp), %rdi
callq 0x55a0
leaq -0x50(%rbp), %r14
leaq -0x490(%rbp), %r15
movq -0x4a0(%rbp), %rdi
cmpq %r15, %rdi
je 0x12756
movq -0x490(%rbp), %rsi
incq %rsi
callq 0x53c0
leaq -0x1f110(%rbp), %rdi
callq 0x55a0
movq -0x60(%rbp), %rdi
cmpq %r14, %rdi
je 0x127d5
movq -0x50(%rbp), %rsi
incq %rsi
callq 0x53c0
jmp 0x127d5
movq %rax, %rbx
jmp 0x127c9
movq %rax, %rbx
movq -0x4a0(%rbp), %rdi
leaq -0x490(%rbp), %rax
cmpq %rax, %rdi
je 0x12819
movq -0x490(%rbp), %rsi
incq %rsi
callq 0x53c0
jmp 0x12819
jmp 0x12816
movq %rax, %rbx
movq -0x1f110(%rbp), %rdi
testq %rdi, %rdi
je 0x127c9
movq -0x1f100(%rbp), %rsi
subq %rdi, %rsi
callq 0x53c0
leaq -0x6b8(%rbp), %rdi
callq 0x12a2a
movq -0x230(%rbp), %rdi
testq %rdi, %rdi
je 0x127f0
movq -0x220(%rbp), %rsi
subq %rdi, %rsi
callq 0x53c0
leaq -0x4b8(%rbp), %rdi
callq 0x12a2a
leaq -0x260(%rbp), %rdi
callq 0x12a2a
leaq -0x1e0(%rbp), %rdi
callq 0x12a2a
jmp 0x12874
movq %rax, %rbx
movq -0x1f110(%rbp), %rdi
testq %rdi, %rdi
je 0x12849
movq -0x1f0f0(%rbp), %rsi
subq %rdi, %rsi
callq 0x53c0
movq $0x0, -0x1f110(%rbp)
movl $0x0, -0x1f108(%rbp)
movq -0x6b8(%rbp), %rdi
leaq -0x6a8(%rbp), %rax
cmpq %rax, %rdi
je 0x1286b
movq -0x6a8(%rbp), %rsi
incq %rsi
callq 0x53c0
leaq -0x60(%rbp), %rdi
callq 0xab8e
leaq -0x8c0(%rbp), %rdi
callq 0x50d0
movq -0x218(%rbp), %rdi
testq %rdi, %rdi
je 0x1289b
movq -0x208(%rbp), %rsi
subq %rdi, %rsi
callq 0x53c0
leaq -0x1f0(%rbp), %rax
movq -0x200(%rbp), %rdi
cmpq %rax, %rdi
je 0x128bd
movq -0x1f0(%rbp), %rsi
incq %rsi
callq 0x53c0
leaq -0x298(%rbp), %rdi
callq 0xddf4
leaq -0x160(%rbp), %rdi
callq 0xab8e
movq %rbx, %rdi
callq 0x56a0
nop