// File: RasmusFonseca[P]PDBCluster/main.cpp
// Function: main
int main(int argc, char** argv)
{
	//Print usage
	if( argc==1 ){
		cout<<"Usage: "<<endl<<argv[0]<<" -name <atomtype1> [-name <atomtype2> ..] -clusteringType <distSum|maxDistSum|maxDist> -firstRes <int> -lastRes <int> -clusters <integer> [list of pdb-files]"<<endl;
		cout<<"or: "<<endl<<argv[0]<<" -name <atomtype1> [-name <atomtype2> ..] -dumpDistances <filename>"<<endl;
		cout<<"Example of running k-centers for k=10:"<<endl;
		cout<<argv[0]<<" -name CA -name CB -clusteringType maxDist -clusters 10 sample1.pdb sample2.pdb sample3.pdb ..."<<endl;
		cout<<endl;
		cout<<"Standard value for -name is C4' and CA"<<endl;
		cout<<"Standard value for -clusteringType is distSum"<<endl;
		cout<<"Standard value for -clusters is 10"<<endl;
		cout<<"Standard value for -firstRes is -10000000"<<endl;
		cout<<"Standard value for -lastRes is 10000000"<<endl;
		cout<<endl;
		cout<<"\"-clusteringType distSum\" will perform standard k-medoids clustering where the cost associated with a set of medoids is the average distance from each member to its nearest medoid."<<endl;
		cout<<"\"-clusteringType maxDistSum\" will perform a variant of k-centers clustering where the cost associated with a set of medoids is the average distance from each medoid to its furthest associated member."<<endl;
		cout<<"\"-clusteringType maxDist\" will perform k-centers clustering where the cost associated with a set of medoids is the largest distance from any site to the nearest medoid."<<endl;
		cout<<"For all clustering types, the dRMSD metric is used to indicate the distance between two structures. If -dumpDistances is specified no clustering is performed, the structure dRMSD distance matrix is just written to the specified file."<<endl;
		exit(0);
	}

	//Parse arguments
	vector<string> atomTypes;
	vector<string> files;
	string distFileName;
	int clusters = 10;
	int clusteringType = 0;
	int firstRes = -10000000;
	int lastRes = 10000000;
	for(int i=1;i<argc;i++){
		string arg(argv[i]);
		if( arg=="-name" ){
			string nextArg(argv[++i]);
			atomTypes.push_back(nextArg);
		}else if( arg=="-clusteringType" ){
			string nextArg(argv[++i]);
			if(nextArg=="distSum") clusteringType = 0;
			if(nextArg=="maxDistSum") clusteringType = 1;
			if(nextArg=="maxDist") clusteringType = 2;
		}else if( arg=="-dumpDistances" ){
			string nextArg(argv[++i]);
			distFileName = nextArg;
		}else if( arg=="-clusters" ){
			clusters = atoi(argv[++i]);
		}else if( arg=="-firstRes" ){
			firstRes = atoi(argv[++i]);
		}else if( arg=="-lastRes" ){
			lastRes = atoi(argv[++i]);
		}else if( arg[0]=='-' ){
			cerr<<"Unknown argument: "<<arg<<endl;
			exit(-1);
		}else{
			files.push_back(arg);
		}
	}
	if(atomTypes.empty()){
		atomTypes.push_back("C4'");
		atomTypes.push_back("CA");
	}


	double start_cpu = get_cpu_time();
	double start_wall = get_wall_time();

	vector<Matrix*> strucMatrices;
	cout<<"Reading pdb-files"<<endl;
	fillMatrices(files, atomTypes, firstRes, lastRes, strucMatrices);

	cout<<"Filling matrix"<<endl;
	int s = strucMatrices.size();
	Matrix allDists(s,s);
	for(int i=0; i<s; i++){
		for(int j=i+1; j<s; j++){
			double d = strucMatrices[i]->getDifferenceSum(strucMatrices[j]);
			allDists.set(i,j,d);
			allDists.set(j,i,d);
		}
	}

	//If -dumpDistances was specified distFileName will be nonempty and we only print the distances and exit
	if(!distFileName.empty()){
		cout<<"Writing distances to "<<distFileName<<endl;
		//Check if all files are of the format "newpdb_.*.pdb"
		bool newpdbFiles = true;
		for(unsigned int i=0;i<files.size();i++){
			size_t pos1 = files[i].find("newpdb_");
			size_t pos2 = files[i].find(".pdb", pos1);
			if(pos1==string::npos || pos2==string::npos || pos2<pos1){
				newpdbFiles = false;
				break;
			}
		}

		
		ofstream distFile;
		distFile.open(distFileName);
		if(newpdbFiles){
			for(int i=0; i<s; i++){
				size_t pos1 = files[i].find("newpdb_");
				size_t pos2 = files[i].find(".pdb",pos1);
				string id_i = files[i].substr(pos1+7, pos2-pos1-7); 
				for(int j=i+1; j<s; j++){
					pos1 = files[j].find("newpdb_");
					pos2 = files[j].find(".pdb",pos1);
					string id_j = files[j].substr(pos1+7, pos2-pos1-7); 
					distFile<<id_i<<" "<<id_j<<" "<<allDists.get(i,j)<<endl;
				}
			}
		}else{
			for(int i=0; i<s; i++){
				for(int j=i+1; j<s; j++){
					distFile<<files[i]<<" "<<files[j]<<" "<<allDists.get(i,j)<<endl;
				}
			}
		}
		distFile.close();

		//ofstream distFile;
		//distFile.open(distFileName);
		//for(int i=0; i<s; i++){
		//	for(int j=i+1; j<s; j++){
		//		distFile<<i<<" "<<j<<" "<<allDists.get(i,j)<<endl;
		//	}
		//}
		//distFile.close();
		exit(0);
	}

	if(clusters>s){
		cerr<<"Cannot find "<<clusters<<" clusters in "<<s<<" structures"<<endl;
		exit(-1);
	}

	cout<<"Clustering"<<endl;
	vector<int> medoids;
	for(int i=0;i<clusters;i++){
		int val = rand()%s;
		while(contains(medoids, val)) val=rand()%s;
		medoids.push_back(val);
		//medoids.push_back(rand()%s);
		//medoids.push_back(i);
	}

	//Partitioning around medoids: http://en.wikipedia.org/wiki/K-medoids
	double oldCost = -1, cost = medoidCosts(medoids, allDists, clusteringType);
	while(cost!=oldCost){
		oldCost = cost;
		for(int i=0;i<clusters;i++){
			int medoid = medoids[i];
			for(int j=0;j<s;j++){
				if( contains(medoids,j) ) continue;
				medoids[i] = j;
				double newCost = medoidCosts(medoids, allDists, clusteringType );
				if(newCost<cost){
					cost=newCost;
					medoid = j;
					cout<<"Improved cost: "<<newCost<<endl;
				}
			}
			medoids[i] = medoid;
		}
	}
	sort(medoids.begin(), medoids.end());
	double end_cpu = get_cpu_time();
	double end_wall = get_wall_time();
	cout<<"CPU-time : "<<(end_cpu-start_cpu)<<" seconds"<<endl;
	cout<<"Wall-time: "<<(end_wall-start_wall)<<" seconds"<<endl;

	cout<<"Clusters:"<<endl;
	for(unsigned int i=0;i<files.size();i++){
		double min = 1000000000.0;
		int minMed = -1;

		for(unsigned int j=0;j<medoids.size();j++){
			int m = medoids[j];
			double d = allDists.get(m,i);
			if( d<min ) { min = d; minMed = j; }
		}
		cout<<files[i]<<" "<<minMed<<endl;

	}
	cout<<"Medoids:"<<endl;
	for( int m=0;m<clusters;m++)
		cout<<files[medoids[m]]<<endl;

	return 0;
}

// Assembly:
subq $0x708, %rsp            # imm = 0x708
movl $0x0, 0x704(%rsp)
movl %edi, 0x700(%rsp)
movq %rsi, 0x6f8(%rsp)
cmpl $0x1, 0x700(%rsp)
jne 0x40db
movq 0xb14a(%rip), %rdi      # 0xefd0
leaq 0x72a2(%rip), %rsi      # 0xb12f
callq 0x2210
movq %rax, %rdi
movq 0xb124(%rip), %rsi      # 0xefc0
callq 0x2240
movq %rax, %rdi
movq 0x6f8(%rsp), %rax
movq (%rax), %rsi
callq 0x2210
movq %rax, %rdi
leaq 0x7279(%rip), %rsi      # 0xb137
callq 0x2210
movq %rax, %rdi
movq 0xb0f3(%rip), %rsi      # 0xefc0
callq 0x2240
movq 0xb0f7(%rip), %rdi      # 0xefd0
leaq 0x72f5(%rip), %rsi      # 0xb1d5
callq 0x2210
movq %rax, %rdi
movq 0xb0d1(%rip), %rsi      # 0xefc0
callq 0x2240
movq %rax, %rdi
movq 0x6f8(%rsp), %rax
movq (%rax), %rsi
callq 0x2210
movq %rax, %rdi
leaq 0x72c9(%rip), %rsi      # 0xb1da
callq 0x2210
movq %rax, %rdi
movq 0xb0a0(%rip), %rsi      # 0xefc0
callq 0x2240
movq 0xb0a4(%rip), %rdi      # 0xefd0
leaq 0x72eb(%rip), %rsi      # 0xb21e
callq 0x2210
movq %rax, %rdi
movq 0xb07e(%rip), %rsi      # 0xefc0
callq 0x2240
movq 0x6f8(%rsp), %rax
movq (%rax), %rsi
movq 0xb077(%rip), %rdi      # 0xefd0
callq 0x2210
movq %rax, %rdi
leaq 0x72dd(%rip), %rsi      # 0xb245
callq 0x2210
movq %rax, %rdi
movq 0xb049(%rip), %rsi      # 0xefc0
callq 0x2240
movq 0xb04d(%rip), %rdi      # 0xefd0
movq 0xb036(%rip), %rsi      # 0xefc0
callq 0x2240
movq 0xb03a(%rip), %rdi      # 0xefd0
leaq 0x7308(%rip), %rsi      # 0xb2a5
callq 0x2210
movq %rax, %rdi
movq 0xb014(%rip), %rsi      # 0xefc0
callq 0x2240
movq 0xb018(%rip), %rdi      # 0xefd0
leaq 0x730d(%rip), %rsi      # 0xb2cc
callq 0x2210
movq %rax, %rdi
movq 0xaff2(%rip), %rsi      # 0xefc0
callq 0x2240
movq 0xaff6(%rip), %rdi      # 0xefd0
leaq 0x7319(%rip), %rsi      # 0xb2fa
callq 0x2210
movq %rax, %rdi
movq 0xafd0(%rip), %rsi      # 0xefc0
callq 0x2240
movq 0xafd4(%rip), %rdi      # 0xefd0
leaq 0x731a(%rip), %rsi      # 0xb31d
callq 0x2210
movq %rax, %rdi
movq 0xafae(%rip), %rsi      # 0xefc0
callq 0x2240
movq 0xafb2(%rip), %rdi      # 0xefd0
leaq 0x7322(%rip), %rsi      # 0xb347
callq 0x2210
movq %rax, %rdi
movq 0xaf8c(%rip), %rsi      # 0xefc0
callq 0x2240
movq 0xaf90(%rip), %rdi      # 0xefd0
movq 0xaf79(%rip), %rsi      # 0xefc0
callq 0x2240
movq 0xaf7d(%rip), %rdi      # 0xefd0
leaq 0x7315(%rip), %rsi      # 0xb36f
callq 0x2210
movq %rax, %rdi
movq 0xaf57(%rip), %rsi      # 0xefc0
callq 0x2240
movq 0xaf5b(%rip), %rdi      # 0xefd0
leaq 0x73a8(%rip), %rsi      # 0xb424
callq 0x2210
movq %rax, %rdi
movq 0xaf35(%rip), %rsi      # 0xefc0
callq 0x2240
movq 0xaf39(%rip), %rdi      # 0xefd0
leaq 0x744e(%rip), %rsi      # 0xb4ec
callq 0x2210
movq %rax, %rdi
movq 0xaf13(%rip), %rsi      # 0xefc0
callq 0x2240
movq 0xaf17(%rip), %rdi      # 0xefd0
leaq 0x74d5(%rip), %rsi      # 0xb595
callq 0x2210
movq %rax, %rdi
movq 0xaef1(%rip), %rsi      # 0xefc0
callq 0x2240
xorl %edi, %edi
callq 0x2280
leaq 0x6e0(%rsp), %rdi
callq 0x5dd0
leaq 0x6c8(%rsp), %rdi
callq 0x5dd0
leaq 0x6a8(%rsp), %rdi
callq 0x22f0
movl $0xa, 0x6a4(%rsp)
movl $0x0, 0x6a0(%rsp)
movl $0xff676980, 0x69c(%rsp) # imm = 0xFF676980
movl $0x989680, 0x698(%rsp) # imm = 0x989680
movl $0x1, 0x694(%rsp)
movl 0x694(%rsp), %eax
cmpl 0x700(%rsp), %eax
jge 0x4786
movq 0x6f8(%rsp), %rax
movslq 0x694(%rsp), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, 0x218(%rsp)
leaq 0x66f(%rsp), %rdi
movq %rdi, 0x220(%rsp)
callq 0x23d0
movq 0x218(%rsp), %rsi
movq 0x220(%rsp), %rdx
leaq 0x670(%rsp), %rdi
callq 0x22e0
jmp 0x419d
leaq 0x66f(%rsp), %rdi
callq 0x2250
leaq 0x74ce(%rip), %rsi      # 0xb67f
leaq 0x670(%rsp), %rdi
callq 0x5bf0
movb %al, 0x217(%rsp)
jmp 0x41c7
movb 0x217(%rsp), %al
testb $0x1, %al
jne 0x41d7
jmp 0x42f4
movq 0x6f8(%rsp), %rax
movslq 0x694(%rsp), %rcx
movl %ecx, %edx
incl %edx
movl %edx, 0x694(%rsp)
movq 0x8(%rax,%rcx,8), %rax
movq %rax, 0x200(%rsp)
leaq 0x637(%rsp), %rdi
movq %rdi, 0x208(%rsp)
callq 0x23d0
movq 0x200(%rsp), %rsi
movq 0x208(%rsp), %rdx
leaq 0x638(%rsp), %rdi
callq 0x22e0
jmp 0x4233
leaq 0x637(%rsp), %rdi
callq 0x2250
leaq 0x6e0(%rsp), %rdi
leaq 0x638(%rsp), %rsi
callq 0x5de0
jmp 0x4257
leaq 0x638(%rsp), %rdi
callq 0x2160
jmp 0x4751
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x660(%rsp)
movl %eax, 0x65c(%rsp)
leaq 0x66f(%rsp), %rdi
callq 0x2250
jmp 0x59e3
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x660(%rsp)
movl %eax, 0x65c(%rsp)
jmp 0x4774
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x660(%rsp)
movl %eax, 0x65c(%rsp)
leaq 0x637(%rsp), %rdi
callq 0x2250
jmp 0x4774
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x660(%rsp)
movl %eax, 0x65c(%rsp)
leaq 0x638(%rsp), %rdi
callq 0x2160
jmp 0x4774
leaq 0x738a(%rip), %rsi      # 0xb685
leaq 0x670(%rsp), %rdi
callq 0x5bf0
movb %al, 0x1ff(%rsp)
jmp 0x4311
movb 0x1ff(%rsp), %al
testb $0x1, %al
jne 0x4321
jmp 0x4489
movq 0x6f8(%rsp), %rax
movslq 0x694(%rsp), %rcx
movl %ecx, %edx
incl %edx
movl %edx, 0x694(%rsp)
movq 0x8(%rax,%rcx,8), %rax
movq %rax, 0x1e8(%rsp)
leaq 0x60f(%rsp), %rdi
movq %rdi, 0x1f0(%rsp)
callq 0x23d0
movq 0x1e8(%rsp), %rsi
movq 0x1f0(%rsp), %rdx
leaq 0x610(%rsp), %rdi
callq 0x22e0
jmp 0x437d
leaq 0x60f(%rsp), %rdi
callq 0x2250
leaq 0x6f61(%rip), %rsi      # 0xb2f2
leaq 0x610(%rsp), %rdi
callq 0x5bf0
movb %al, 0x1e7(%rsp)
jmp 0x43a7
movb 0x1e7(%rsp), %al
testb $0x1, %al
jne 0x43b4
jmp 0x440d
movl $0x0, 0x6a0(%rsp)
jmp 0x440d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x660(%rsp)
movl %eax, 0x65c(%rsp)
leaq 0x60f(%rsp), %rdi
callq 0x2250
jmp 0x4774
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x660(%rsp)
movl %eax, 0x65c(%rsp)
leaq 0x610(%rsp), %rdi
callq 0x2160
jmp 0x4774
leaq 0x7281(%rip), %rsi      # 0xb695
leaq 0x610(%rsp), %rdi
callq 0x5bf0
movb %al, 0x1e6(%rsp)
jmp 0x442a
movb 0x1e6(%rsp), %al
testb $0x1, %al
jne 0x4437
jmp 0x4442
movl $0x1, 0x6a0(%rsp)
leaq 0x7257(%rip), %rsi      # 0xb6a0
leaq 0x610(%rsp), %rdi
callq 0x5bf0
movb %al, 0x1e5(%rsp)
jmp 0x445f
movb 0x1e5(%rsp), %al
testb $0x1, %al
jne 0x446c
jmp 0x4477
movl $0x2, 0x6a0(%rsp)
leaq 0x610(%rsp), %rdi
callq 0x2160
jmp 0x474f
leaq 0x7218(%rip), %rsi      # 0xb6a8
leaq 0x670(%rsp), %rdi
callq 0x5bf0
movb %al, 0x1e4(%rsp)
jmp 0x44a6
movb 0x1e4(%rsp), %al
testb $0x1, %al
jne 0x44b6
jmp 0x4594
movq 0x6f8(%rsp), %rax
movslq 0x694(%rsp), %rcx
movl %ecx, %edx
incl %edx
movl %edx, 0x694(%rsp)
movq 0x8(%rax,%rcx,8), %rax
movq %rax, 0x1d0(%rsp)
leaq 0x5e7(%rsp), %rdi
movq %rdi, 0x1d8(%rsp)
callq 0x23d0
movq 0x1d0(%rsp), %rsi
movq 0x1d8(%rsp), %rdx
leaq 0x5e8(%rsp), %rdi
callq 0x22e0
jmp 0x4512
leaq 0x5e7(%rsp), %rdi
callq 0x2250
leaq 0x6a8(%rsp), %rdi
leaq 0x5e8(%rsp), %rsi
callq 0x2040
jmp 0x4536
leaq 0x5e8(%rsp), %rdi
callq 0x2160
jmp 0x474d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x660(%rsp)
movl %eax, 0x65c(%rsp)
leaq 0x5e7(%rsp), %rdi
callq 0x2250
jmp 0x4774
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x660(%rsp)
movl %eax, 0x65c(%rsp)
leaq 0x5e8(%rsp), %rdi
callq 0x2160
jmp 0x4774
leaq 0x711c(%rip), %rsi      # 0xb6b7
leaq 0x670(%rsp), %rdi
callq 0x5bf0
movb %al, 0x1cf(%rsp)
jmp 0x45b1
movb 0x1cf(%rsp), %al
testb $0x1, %al
jne 0x45be
jmp 0x45ef
movq 0x6f8(%rsp), %rax
movl 0x694(%rsp), %ecx
addl $0x1, %ecx
movl %ecx, 0x694(%rsp)
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rdi
callq 0x2340
movl %eax, 0x6a4(%rsp)
jmp 0x474b
leaq 0x70cb(%rip), %rsi      # 0xb6c1
leaq 0x670(%rsp), %rdi
callq 0x5bf0
movb %al, 0x1ce(%rsp)
jmp 0x460c
movb 0x1ce(%rsp), %al
testb $0x1, %al
jne 0x4619
jmp 0x464a
movq 0x6f8(%rsp), %rax
movl 0x694(%rsp), %ecx
addl $0x1, %ecx
movl %ecx, 0x694(%rsp)
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rdi
callq 0x2340
movl %eax, 0x69c(%rsp)
jmp 0x4749
leaq 0x707a(%rip), %rsi      # 0xb6cb
leaq 0x670(%rsp), %rdi
callq 0x5bf0
movb %al, 0x1cd(%rsp)
jmp 0x4667
movb 0x1cd(%rsp), %al
testb $0x1, %al
jne 0x4674
jmp 0x46a5
movq 0x6f8(%rsp), %rax
movl 0x694(%rsp), %ecx
addl $0x1, %ecx
movl %ecx, 0x694(%rsp)
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rdi
callq 0x2340
movl %eax, 0x698(%rsp)
jmp 0x4747
xorl %eax, %eax
movl %eax, %esi
leaq 0x670(%rsp), %rdi
callq 0x2410
movq %rax, 0x1c0(%rsp)
jmp 0x46c0
movq 0x1c0(%rsp), %rax
movsbl (%rax), %eax
cmpl $0x2d, %eax
jne 0x472c
movq 0xa919(%rip), %rdi      # 0xeff0
leaq 0x6ff6(%rip), %rsi      # 0xb6d4
callq 0x2210
movq %rax, 0x1b8(%rsp)
jmp 0x46ed
movq 0x1b8(%rsp), %rdi
leaq 0x670(%rsp), %rsi
callq 0x21f0
movq %rax, 0x1b0(%rsp)
jmp 0x470c
movq 0x1b0(%rsp), %rdi
movq 0xa8a5(%rip), %rsi      # 0xefc0
callq 0x2240
jmp 0x4722
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
callq 0x2280
leaq 0x6c8(%rsp), %rdi
leaq 0x670(%rsp), %rsi
callq 0x5de0
jmp 0x4743
jmp 0x4745
jmp 0x4747
jmp 0x4749
jmp 0x474b
jmp 0x474d
jmp 0x474f
jmp 0x4751
leaq 0x670(%rsp), %rdi
callq 0x2160
movl 0x694(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x694(%rsp)
jmp 0x4139
leaq 0x670(%rsp), %rdi
callq 0x2160
jmp 0x59e3
leaq 0x6e0(%rsp), %rdi
callq 0x5e50
testb $0x1, %al
jne 0x479c
jmp 0x48fb
leaq 0x5bf(%rsp), %rdi
movq %rdi, 0x1a8(%rsp)
callq 0x23d0
movq 0x1a8(%rsp), %rdx
leaq 0x6f27(%rip), %rsi      # 0xb6e7
leaq 0x5c0(%rsp), %rdi
callq 0x22e0
jmp 0x47cf
leaq 0x6e0(%rsp), %rdi
leaq 0x5c0(%rsp), %rsi
callq 0x5ea0
jmp 0x47e6
leaq 0x5c0(%rsp), %rdi
callq 0x2160
leaq 0x5bf(%rsp), %rdi
callq 0x2250
leaq 0x597(%rsp), %rdi
movq %rdi, 0x1a0(%rsp)
callq 0x23d0
movq 0x1a0(%rsp), %rdx
leaq 0x6aa5(%rip), %rsi      # 0xb2c9
leaq 0x598(%rsp), %rdi
callq 0x22e0
jmp 0x4833
leaq 0x6e0(%rsp), %rdi
leaq 0x598(%rsp), %rsi
callq 0x5ea0
jmp 0x484a
leaq 0x598(%rsp), %rdi
callq 0x2160
leaq 0x597(%rsp), %rdi
callq 0x2250
jmp 0x48fb
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x660(%rsp)
movl %eax, 0x65c(%rsp)
jmp 0x48a0
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x660(%rsp)
movl %eax, 0x65c(%rsp)
leaq 0x5c0(%rsp), %rdi
callq 0x2160
leaq 0x5bf(%rsp), %rdi
callq 0x2250
jmp 0x59e3
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x660(%rsp)
movl %eax, 0x65c(%rsp)
jmp 0x48e9
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x660(%rsp)
movl %eax, 0x65c(%rsp)
leaq 0x598(%rsp), %rdi
callq 0x2160
leaq 0x597(%rsp), %rdi
callq 0x2250
jmp 0x59e3
callq 0x3e30
movsd %xmm0, 0x588(%rsp)
callq 0x3de0
movsd %xmm0, 0x580(%rsp)
leaq 0x568(%rsp), %rdi
callq 0x5ed0
movq 0xa6a5(%rip), %rdi      # 0xefd0
leaq 0x6db9(%rip), %rsi      # 0xb6eb
callq 0x2210
movq %rax, 0x198(%rsp)
jmp 0x4941
movq 0x198(%rsp), %rdi
movq 0xa670(%rip), %rsi      # 0xefc0
callq 0x2240
jmp 0x4957
movl 0x69c(%rsp), %edx
movl 0x698(%rsp), %ecx
leaq 0x6c8(%rsp), %rdi
leaq 0x6e0(%rsp), %rsi
leaq 0x568(%rsp), %r8
callq 0x2b60
jmp 0x4984
movq 0xa645(%rip), %rdi      # 0xefd0
leaq 0x6d6b(%rip), %rsi      # 0xb6fd
callq 0x2210
movq %rax, 0x190(%rsp)
jmp 0x49a1
movq 0x190(%rsp), %rdi
movq 0xa610(%rip), %rsi      # 0xefc0
callq 0x2240
jmp 0x49b7
leaq 0x568(%rsp), %rdi
callq 0x5ee0
movl %eax, 0x564(%rsp)
movl 0x564(%rsp), %edx
leaq 0x550(%rsp), %rdi
movl %edx, %esi
callq 0x25a0
jmp 0x49e3
movl $0x0, 0x54c(%rsp)
movl 0x54c(%rsp), %eax
cmpl 0x564(%rsp), %eax
jge 0x4b3f
movl 0x54c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x548(%rsp)
movl 0x548(%rsp), %eax
cmpl 0x564(%rsp), %eax
jge 0x4b27
movslq 0x54c(%rsp), %rsi
leaq 0x568(%rsp), %rdi
movq %rdi, 0x178(%rsp)
callq 0x5f00
movq 0x178(%rsp), %rdi
movq (%rax), %rax
movq %rax, 0x180(%rsp)
movslq 0x548(%rsp), %rsi
callq 0x5f00
movq 0x180(%rsp), %rdi
movq (%rax), %rsi
callq 0x2920
movsd %xmm0, 0x188(%rsp)
jmp 0x4a7f
movsd 0x188(%rsp), %xmm0
movsd %xmm0, 0x540(%rsp)
movl 0x54c(%rsp), %esi
movl 0x548(%rsp), %edx
movsd 0x540(%rsp), %xmm0
leaq 0x550(%rsp), %rdi
callq 0x2820
jmp 0x4ab7
movl 0x548(%rsp), %esi
movl 0x54c(%rsp), %edx
movsd 0x540(%rsp), %xmm0
leaq 0x550(%rsp), %rdi
callq 0x2820
jmp 0x4add
jmp 0x4adf
movl 0x548(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x548(%rsp)
jmp 0x4a13
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x660(%rsp)
movl %eax, 0x65c(%rsp)
jmp 0x59d6
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x660(%rsp)
movl %eax, 0x65c(%rsp)
jmp 0x59c9
jmp 0x4b29
movl 0x54c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x54c(%rsp)
jmp 0x49ee
leaq 0x6a8(%rsp), %rdi
callq 0x2380
testb $0x1, %al
jne 0x5191
movq 0xa475(%rip), %rdi      # 0xefd0
leaq 0x6baa(%rip), %rsi      # 0xb70c
callq 0x2210
movq %rax, 0x170(%rsp)
jmp 0x4b71
movq 0x170(%rsp), %rdi
leaq 0x6a8(%rsp), %rsi
callq 0x21f0
movq %rax, 0x168(%rsp)
jmp 0x4b90
movq 0x168(%rsp), %rdi
movq 0xa421(%rip), %rsi      # 0xefc0
callq 0x2240
jmp 0x4ba6
movb $0x1, 0x53f(%rsp)
movl $0x0, 0x538(%rsp)
movl 0x538(%rsp), %eax
movq %rax, 0x160(%rsp)
leaq 0x6c8(%rsp), %rdi
callq 0x5bb0
movq %rax, %rcx
movq 0x160(%rsp), %rax
cmpq %rcx, %rax
jae 0x4c99
movl 0x538(%rsp), %eax
movl %eax, %esi
leaq 0x6c8(%rsp), %rdi
callq 0x5bd0
movq %rax, %rdi
leaq 0x6b19(%rip), %rsi      # 0xb722
xorl %eax, %eax
movl %eax, %edx
callq 0x2400
movq %rax, 0x530(%rsp)
movl 0x538(%rsp), %eax
movl %eax, %esi
leaq 0x6c8(%rsp), %rdi
callq 0x5bd0
movq %rax, %rdi
movq 0x530(%rsp), %rdx
leaq 0x6ae8(%rip), %rsi      # 0xb72a
callq 0x2400
movq %rax, 0x528(%rsp)
cmpq $-0x1, 0x530(%rsp)
je 0x4c77
cmpq $-0x1, 0x528(%rsp)
je 0x4c77
movq 0x528(%rsp), %rax
cmpq 0x530(%rsp), %rax
jae 0x4c81
movb $0x0, 0x53f(%rsp)
jmp 0x4c99
jmp 0x4c83
movl 0x538(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x538(%rsp)
jmp 0x4bb9
leaq 0x328(%rsp), %rdi
callq 0x2390
jmp 0x4ca8
leaq 0x328(%rsp), %rdi
leaq 0x6a8(%rsp), %rsi
movl $0x10, %edx
callq 0x2110
jmp 0x4cc4
testb $0x1, 0x53f(%rsp)
je 0x4ffd
movl $0x0, 0x324(%rsp)
movl 0x324(%rsp), %eax
cmpl 0x564(%rsp), %eax
jge 0x4ff8
movslq 0x324(%rsp), %rsi
leaq 0x6c8(%rsp), %rdi
movq %rdi, 0x158(%rsp)
callq 0x5bd0
movq %rax, %rdi
leaq 0x6a0a(%rip), %rsi      # 0xb722
xorl %eax, %eax
movl %eax, %edx
callq 0x2400
movq 0x158(%rsp), %rdi
movq %rax, 0x318(%rsp)
movslq 0x324(%rsp), %rsi
callq 0x5bd0
movq %rax, %rdi
movq 0x318(%rsp), %rdx
leaq 0x69da(%rip), %rsi      # 0xb72a
callq 0x2400
movq 0x158(%rsp), %rdi
movq %rax, 0x310(%rsp)
movslq 0x324(%rsp), %rsi
callq 0x5bd0
movq %rax, %rsi
movq 0x318(%rsp), %rax
movq %rax, %rdx
addq $0x7, %rdx
movq 0x310(%rsp), %rcx
subq %rax, %rcx
addq $-0x7, %rcx
leaq 0x2f0(%rsp), %rdi
callq 0x2230
jmp 0x4da2
movl 0x324(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x2ec(%rsp)
movl 0x2ec(%rsp), %eax
cmpl 0x564(%rsp), %eax
jge 0x4fc3
movslq 0x2ec(%rsp), %rsi
leaq 0x6c8(%rsp), %rdi
movq %rdi, 0x150(%rsp)
callq 0x5bd0
movq %rax, %rdi
leaq 0x6934(%rip), %rsi      # 0xb722
xorl %eax, %eax
movl %eax, %edx
callq 0x2400
movq 0x150(%rsp), %rdi
movq %rax, 0x318(%rsp)
movslq 0x2ec(%rsp), %rsi
callq 0x5bd0
movq %rax, %rdi
movq 0x318(%rsp), %rdx
leaq 0x6904(%rip), %rsi      # 0xb72a
callq 0x2400
movq 0x150(%rsp), %rdi
movq %rax, 0x310(%rsp)
movslq 0x2ec(%rsp), %rsi
callq 0x5bd0
movq %rax, %rsi
movq 0x318(%rsp), %rax
movq %rax, %rdx
addq $0x7, %rdx
movq 0x310(%rsp), %rcx
subq %rax, %rcx
addq $-0x7, %rcx
leaq 0x2c8(%rsp), %rdi
callq 0x2230
jmp 0x4e78
leaq 0x328(%rsp), %rdi
leaq 0x2f0(%rsp), %rsi
callq 0x21f0
movq %rax, 0x148(%rsp)
jmp 0x4e97
movq 0x148(%rsp), %rdi
leaq 0x68d5(%rip), %rsi      # 0xb77b
callq 0x2210
movq %rax, 0x140(%rsp)
jmp 0x4eb5
movq 0x140(%rsp), %rdi
leaq 0x2c8(%rsp), %rsi
callq 0x21f0
movq %rax, 0x138(%rsp)
jmp 0x4ed4
movq 0x138(%rsp), %rdi
leaq 0x6898(%rip), %rsi      # 0xb77b
callq 0x2210
movq %rax, 0x130(%rsp)
jmp 0x4ef2
movl 0x324(%rsp), %esi
movl 0x2ec(%rsp), %edx
leaq 0x550(%rsp), %rdi
callq 0x2730
movsd %xmm0, 0x128(%rsp)
jmp 0x4f18
movsd 0x128(%rsp), %xmm0
movq 0x130(%rsp), %rdi
callq 0x23f0
movq %rax, 0x120(%rsp)
jmp 0x4f38
movq 0x120(%rsp), %rdi
movq 0xa079(%rip), %rsi      # 0xefc0
callq 0x2240
jmp 0x4f4e
leaq 0x2c8(%rsp), %rdi
callq 0x2160
movl 0x2ec(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x2ec(%rsp)
jmp 0x4db3
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x660(%rsp)
movl %eax, 0x65c(%rsp)
jmp 0x517f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x660(%rsp)
movl %eax, 0x65c(%rsp)
jmp 0x4fe6
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x660(%rsp)
movl %eax, 0x65c(%rsp)
leaq 0x2c8(%rsp), %rdi
callq 0x2160
jmp 0x4fe6
leaq 0x2f0(%rsp), %rdi
callq 0x2160
movl 0x324(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x324(%rsp)
jmp 0x4cdd
leaq 0x2f0(%rsp), %rdi
callq 0x2160
jmp 0x517f
jmp 0x5169
movl $0x0, 0x2c4(%rsp)
movl 0x2c4(%rsp), %eax
cmpl 0x564(%rsp), %eax
jge 0x5167
movl 0x2c4(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x2c0(%rsp)
movl 0x2c0(%rsp), %eax
cmpl 0x564(%rsp), %eax
jge 0x514f
movslq 0x2c4(%rsp), %rsi
leaq 0x6c8(%rsp), %rdi
callq 0x5bd0
movq %rax, %rsi
leaq 0x328(%rsp), %rdi
callq 0x21f0
movq %rax, 0x118(%rsp)
jmp 0x5070
movq 0x118(%rsp), %rdi
leaq 0x66fc(%rip), %rsi      # 0xb77b
callq 0x2210
movq %rax, 0x110(%rsp)
jmp 0x508e
movslq 0x2c0(%rsp), %rsi
leaq 0x6c8(%rsp), %rdi
callq 0x5bd0
movq 0x110(%rsp), %rdi
movq %rax, %rsi
callq 0x21f0
movq %rax, 0x108(%rsp)
jmp 0x50bd
movq 0x108(%rsp), %rdi
leaq 0x66af(%rip), %rsi      # 0xb77b
callq 0x2210
movq %rax, 0x100(%rsp)
jmp 0x50db
movl 0x2c4(%rsp), %esi
movl 0x2c0(%rsp), %edx
leaq 0x550(%rsp), %rdi
callq 0x2730
movsd %xmm0, 0xf8(%rsp)
jmp 0x5101
movsd 0xf8(%rsp), %xmm0
movq 0x100(%rsp), %rdi
callq 0x23f0
movq %rax, 0xf0(%rsp)
jmp 0x5121
movq 0xf0(%rsp), %rdi
movq 0x9e90(%rip), %rsi      # 0xefc0
callq 0x2240
jmp 0x5137
jmp 0x5139
movl 0x2c0(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x2c0(%rsp)
jmp 0x502d
jmp 0x5151
movl 0x2c4(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x2c4(%rsp)
jmp 0x5008
jmp 0x5169
leaq 0x328(%rsp), %rdi
callq 0x2300
jmp 0x5178
xorl %edi, %edi
callq 0x2280
leaq 0x328(%rsp), %rdi
callq 0x2320
jmp 0x59c9
movl 0x6a4(%rsp), %eax
cmpl 0x564(%rsp), %eax
jle 0x525a
movq 0x9e44(%rip), %rdi      # 0xeff0
leaq 0x657c(%rip), %rsi      # 0xb72f
callq 0x2210
movq %rax, 0xe8(%rsp)
jmp 0x51c2
movq 0xe8(%rsp), %rdi
movl 0x6a4(%rsp), %esi
callq 0x23a0
movq %rax, 0xe0(%rsp)
jmp 0x51e0
movq 0xe0(%rsp), %rdi
leaq 0x654d(%rip), %rsi      # 0xb73c
callq 0x2210
movq %rax, 0xd8(%rsp)
jmp 0x51fe
movq 0xd8(%rsp), %rdi
movl 0x564(%rsp), %esi
callq 0x23a0
movq %rax, 0xd0(%rsp)
jmp 0x521c
movq 0xd0(%rsp), %rdi
leaq 0x651f(%rip), %rsi      # 0xb74a
callq 0x2210
movq %rax, 0xc8(%rsp)
jmp 0x523a
movq 0xc8(%rsp), %rdi
movq 0x9d77(%rip), %rsi      # 0xefc0
callq 0x2240
jmp 0x5250
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
callq 0x2280
movq 0x9d6f(%rip), %rdi      # 0xefd0
leaq 0x64ee(%rip), %rsi      # 0xb756
callq 0x2210
movq %rax, 0xc0(%rsp)
jmp 0x5277
movq 0xc0(%rsp), %rdi
movq 0x9d3a(%rip), %rsi      # 0xefc0
callq 0x2240
jmp 0x528d
leaq 0x2a8(%rsp), %rdi
callq 0x5f20
movl $0x0, 0x2a4(%rsp)
movl 0x2a4(%rsp), %eax
cmpl 0x6a4(%rsp), %eax
jge 0x5352
callq 0x2090
cltd
idivl 0x564(%rsp)
movl %edx, 0x2a0(%rsp)
movl 0x2a0(%rsp), %esi
leaq 0x2a8(%rsp), %rdi
callq 0x37a0
testb $0x1, %al
jne 0x52e7
jmp 0x52fd
callq 0x2090
cltd
idivl 0x564(%rsp)
movl %edx, 0x2a0(%rsp)
jmp 0x52cd
leaq 0x2a8(%rsp), %rdi
leaq 0x2a0(%rsp), %rsi
callq 0x5f30
jmp 0x5314
jmp 0x5316
movl 0x2a4(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x2a4(%rsp)
jmp 0x52a5
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x660(%rsp)
movl %eax, 0x65c(%rsp)
leaq 0x2a8(%rsp), %rdi
callq 0x6040
jmp 0x59c9
movabsq $-0x4010000000000000, %rax # imm = 0xBFF0000000000000
movq %rax, 0x298(%rsp)
movl 0x6a0(%rsp), %edx
leaq 0x2a8(%rsp), %rdi
leaq 0x550(%rsp), %rsi
callq 0x3d30
movsd %xmm0, 0xb8(%rsp)
jmp 0x538b
movsd 0xb8(%rsp), %xmm0
movsd %xmm0, 0x290(%rsp)
movsd 0x290(%rsp), %xmm0
ucomisd 0x298(%rsp), %xmm0
jne 0x53b8
jp 0x53b8
jmp 0x559e
movsd 0x290(%rsp), %xmm0
movsd %xmm0, 0x298(%rsp)
movl $0x0, 0x28c(%rsp)
movl 0x28c(%rsp), %eax
cmpl 0x6a4(%rsp), %eax
jge 0x5599
movslq 0x28c(%rsp), %rsi
leaq 0x2a8(%rsp), %rdi
callq 0x5db0
movl (%rax), %eax
movl %eax, 0x288(%rsp)
movl $0x0, 0x284(%rsp)
movl 0x284(%rsp), %eax
cmpl 0x564(%rsp), %eax
jge 0x5557
movl 0x284(%rsp), %esi
leaq 0x2a8(%rsp), %rdi
callq 0x37a0
testb $0x1, %al
jne 0x5440
jmp 0x5445
jmp 0x5541
movl 0x284(%rsp), %eax
movl %eax, 0xa4(%rsp)
movslq 0x28c(%rsp), %rsi
leaq 0x2a8(%rsp), %rdi
movq %rdi, 0xa8(%rsp)
callq 0x5db0
movl 0xa4(%rsp), %ecx
movq 0xa8(%rsp), %rdi
movl %ecx, (%rax)
movl 0x6a0(%rsp), %edx
leaq 0x550(%rsp), %rsi
callq 0x3d30
movsd %xmm0, 0xb0(%rsp)
jmp 0x54a0
movsd 0xb0(%rsp), %xmm0
movsd %xmm0, 0x278(%rsp)
movsd 0x278(%rsp), %xmm1
movsd 0x290(%rsp), %xmm0
ucomisd %xmm1, %xmm0
jbe 0x553f
movsd 0x278(%rsp), %xmm0
movsd %xmm0, 0x290(%rsp)
movl 0x284(%rsp), %eax
movl %eax, 0x288(%rsp)
movq 0x9adf(%rip), %rdi      # 0xefd0
leaq 0x6269(%rip), %rsi      # 0xb761
callq 0x2210
movq %rax, 0x98(%rsp)
jmp 0x5507
movq 0x98(%rsp), %rdi
movsd 0x278(%rsp), %xmm0
callq 0x23f0
movq %rax, 0x90(%rsp)
jmp 0x5527
movq 0x90(%rsp), %rdi
movq 0x9a8a(%rip), %rsi      # 0xefc0
callq 0x2240
jmp 0x553d
jmp 0x553f
jmp 0x5541
movl 0x284(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x284(%rsp)
jmp 0x5412
movl 0x288(%rsp), %eax
movl %eax, 0x8c(%rsp)
movslq 0x28c(%rsp), %rsi
leaq 0x2a8(%rsp), %rdi
callq 0x5db0
movl 0x8c(%rsp), %ecx
movl %ecx, (%rax)
movl 0x28c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x28c(%rsp)
jmp 0x53d5
jmp 0x539d
leaq 0x2a8(%rsp), %rdi
movq %rdi, 0x80(%rsp)
callq 0x5fe0
movq 0x80(%rsp), %rdi
movq %rax, 0x270(%rsp)
callq 0x6010
movq %rax, 0x268(%rsp)
movq 0x270(%rsp), %rdi
movq 0x268(%rsp), %rsi
callq 0x5fa0
jmp 0x55e7
callq 0x3e30
movsd %xmm0, 0x260(%rsp)
callq 0x3de0
movsd %xmm0, 0x258(%rsp)
movq 0x99c6(%rip), %rdi      # 0xefd0
leaq 0x6160(%rip), %rsi      # 0xb771
callq 0x2210
movq %rax, 0x78(%rsp)
jmp 0x561d
movq 0x78(%rsp), %rdi
movsd 0x260(%rsp), %xmm0
movsd 0x588(%rsp), %xmm1
subsd %xmm1, %xmm0
callq 0x23f0
movq %rax, 0x70(%rsp)
jmp 0x5644
movq 0x70(%rsp), %rdi
leaq 0x612d(%rip), %rsi      # 0xb77d
callq 0x2210
movq %rax, 0x68(%rsp)
jmp 0x565c
movq 0x68(%rsp), %rdi
movq 0x9958(%rip), %rsi      # 0xefc0
callq 0x2240
jmp 0x566f
movq 0x995a(%rip), %rdi      # 0xefd0
leaq 0x6109(%rip), %rsi      # 0xb786
callq 0x2210
movq %rax, 0x60(%rsp)
jmp 0x5689
movq 0x60(%rsp), %rdi
movsd 0x258(%rsp), %xmm0
movsd 0x580(%rsp), %xmm1
subsd %xmm1, %xmm0
callq 0x23f0
movq %rax, 0x58(%rsp)
jmp 0x56b0
movq 0x58(%rsp), %rdi
leaq 0x60c1(%rip), %rsi      # 0xb77d
callq 0x2210
movq %rax, 0x50(%rsp)
jmp 0x56c8
movq 0x50(%rsp), %rdi
movq 0x98ec(%rip), %rsi      # 0xefc0
callq 0x2240
jmp 0x56db
movq 0x98ee(%rip), %rdi      # 0xefd0
leaq 0x60a9(%rip), %rsi      # 0xb792
callq 0x2210
movq %rax, 0x48(%rsp)
jmp 0x56f5
movq 0x48(%rsp), %rdi
movq 0x98bf(%rip), %rsi      # 0xefc0
callq 0x2240
jmp 0x5708
movl $0x0, 0x254(%rsp)
movl 0x254(%rsp), %eax
movq %rax, 0x40(%rsp)
leaq 0x6c8(%rsp), %rdi
callq 0x5bb0
movq %rax, %rcx
movq 0x40(%rsp), %rax
cmpq %rcx, %rax
jae 0x58b6
movsd 0x5963(%rip), %xmm0     # 0xb0a8
movsd %xmm0, 0x248(%rsp)
movl $0xffffffff, 0x244(%rsp) # imm = 0xFFFFFFFF
movl $0x0, 0x240(%rsp)
movl 0x240(%rsp), %eax
movq %rax, 0x38(%rsp)
leaq 0x2a8(%rsp), %rdi
callq 0x5d90
movq %rax, %rcx
movq 0x38(%rsp), %rax
cmpq %rcx, %rax
jae 0x582f
movl 0x240(%rsp), %eax
movl %eax, %esi
leaq 0x2a8(%rsp), %rdi
callq 0x5db0
movl (%rax), %eax
movl %eax, 0x23c(%rsp)
movl 0x23c(%rsp), %esi
movl 0x254(%rsp), %edx
leaq 0x550(%rsp), %rdi
callq 0x2730
movsd %xmm0, 0x30(%rsp)
jmp 0x57d0
movsd 0x30(%rsp), %xmm0
movsd %xmm0, 0x230(%rsp)
movsd 0x230(%rsp), %xmm1
movsd 0x248(%rsp), %xmm0
ucomisd %xmm1, %xmm0
jbe 0x5817
movsd 0x230(%rsp), %xmm0
movsd %xmm0, 0x248(%rsp)
movl 0x240(%rsp), %eax
movl %eax, 0x244(%rsp)
jmp 0x5819
movl 0x240(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x240(%rsp)
jmp 0x5764
movl 0x254(%rsp), %eax
movl %eax, %esi
leaq 0x6c8(%rsp), %rdi
callq 0x5bd0
movq %rax, %rsi
movq 0x9781(%rip), %rdi      # 0xefd0
callq 0x21f0
movq %rax, 0x28(%rsp)
jmp 0x585b
movq 0x28(%rsp), %rdi
leaq 0x5f14(%rip), %rsi      # 0xb77b
callq 0x2210
movq %rax, 0x20(%rsp)
jmp 0x5873
movq 0x20(%rsp), %rdi
movl 0x244(%rsp), %esi
callq 0x23a0
movq %rax, 0x18(%rsp)
jmp 0x588b
movq 0x18(%rsp), %rdi
movq 0x9729(%rip), %rsi      # 0xefc0
callq 0x2240
jmp 0x589e
jmp 0x58a0
movl 0x254(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x254(%rsp)
jmp 0x5713
movq 0x9713(%rip), %rdi      # 0xefd0
leaq 0x5ed8(%rip), %rsi      # 0xb79c
callq 0x2210
movq %rax, 0x10(%rsp)
jmp 0x58d0
movq 0x10(%rsp), %rdi
movq 0x96e4(%rip), %rsi      # 0xefc0
callq 0x2240
jmp 0x58e3
movl $0x0, 0x22c(%rsp)
movl 0x22c(%rsp), %eax
cmpl 0x6a4(%rsp), %eax
jge 0x5961
movslq 0x22c(%rsp), %rsi
leaq 0x2a8(%rsp), %rdi
callq 0x5db0
movslq (%rax), %rsi
leaq 0x6c8(%rsp), %rdi
callq 0x5bd0
movq %rax, %rsi
movq 0x96a3(%rip), %rdi      # 0xefd0
callq 0x21f0
movq %rax, 0x8(%rsp)
jmp 0x5939
movq 0x8(%rsp), %rdi
movq 0x967b(%rip), %rsi      # 0xefc0
callq 0x2240
jmp 0x594c
jmp 0x594e
movl 0x22c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x22c(%rsp)
jmp 0x58ee
movl $0x0, 0x704(%rsp)
leaq 0x2a8(%rsp), %rdi
callq 0x6040
leaq 0x550(%rsp), %rdi
callq 0x26e0
leaq 0x568(%rsp), %rdi
callq 0x60a0
leaq 0x6a8(%rsp), %rdi
callq 0x2160
leaq 0x6c8(%rsp), %rdi
callq 0x6100
leaq 0x6e0(%rsp), %rdi
callq 0x6100
movl 0x704(%rsp), %eax
addq $0x708, %rsp            # imm = 0x708
retq
leaq 0x550(%rsp), %rdi
callq 0x26e0
leaq 0x568(%rsp), %rdi
callq 0x60a0
leaq 0x6a8(%rsp), %rdi
callq 0x2160
leaq 0x6c8(%rsp), %rdi
callq 0x6100
leaq 0x6e0(%rsp), %rdi
callq 0x6100
movq 0x660(%rsp), %rdi
callq 0x23c0
nopw (%rax,%rax)