// File: /workspace/github_cpp_makefile_star2_O3/melop[P]admixem/simulation.cpp
// Function: PerformExport(int, int, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, int, int, int, int, double)
void PerformExport(int nGen, int nRep, string sExportFolder, int nPop1Size, int nPop2Size, int nPop3Size, int nMarkerNum, double nRandSeed) {

	Random::Set(nRandSeed);
	string sOutFolder = SimulConfig.GetConfig("OutputFolder");
	sExportFolder = sExportFolder + "/Gen" + convertInt(nGen);
	fnMakeDir(sExportFolder.c_str());

	ofstream fPriorAlleleFreq, fOutcomeVars, fGenotypes, fEtaPriors, fLoci, fSampledMarkers;// Create priorallelefreqs.txt
	//fPriorAlleleFreq.open(sExportFolder + "/priorallelefreqs.txt");
	//fOutcomeVars.open(sExportFolder + "/outcomevars.txt");
	//fGenotypes.open(sExportFolder + "/genotypes.txt");
	//fEtaPriors.open(sExportFolder + "/etapriors.txt");
	fLoci.open((sExportFolder + "/lociChr.txt").c_str());
	fSampledMarkers.open("sampledmarkers.txt"); // this is an instruction to the php script regarding what markers to draw

	ifstream fMarkers, fPhenotypes;
	/*char szCurrGen[100];
	_itoa(nGen , szCurrGen, 10);
	*/
	string sGenHeader = sOutFolder;
	sGenHeader = (nRep==0)? sGenHeader : (sGenHeader + "_") + fnIntToString(nRep);
	sGenHeader = sGenHeader + "/Gen";
	sGenHeader = sGenHeader + fnIntToString(nGen);//szCurrGen;

	fMarkers.open((sGenHeader + "_markers.txt").c_str() , ios_base::in );

	fPhenotypes.open((sGenHeader + "_phenotypes.txt").c_str() , ios_base::in );
	//convert the phenotype file to outcomevars.txt
	string sCmd = "php export_phenotype.php -- -s \"" + sGenHeader + "_phenotypes.txt\" -o \"" + sExportFolder + "/outcomevars.txt\"";
	printf("Calling: %s ...\n", sCmd.c_str());
	system(sCmd.c_str());

	//write loci.txt file
	printf("Writing locus information...\n");
	fLoci << "\"LocusName\"\t\"NumberOfAlleles\"\t\"cM\"\t\"Chr\"" <<endl; // Header
	
	fLoci << fixed << showpoint; 
	fLoci << setprecision(6);
	

	//vector<vector<int>> vRandomMarkerSubset;
	vector<map<double, double> > * pvMarkerMapDistance = SimulConfig.pMarkerConfig->GetMpMarkerMapDistance(2); // use average map distance

	size_t nTotalChrSize = pvMarkerMapDistance->size();
	for( size_t nChr=0; nChr < nTotalChrSize ; nChr++) {
		map<double, double> * pmMarkerMapDistanceOnChr = & (pvMarkerMapDistance->at(nChr));
		size_t nCurrMarker = 1;
		size_t nSampledMarkerCount = 1;
		double nPrevMarkerPos=0.0;

		double nExpectedMarkerNumOnChr = (double)nMarkerNum * SimulConfig.pMarkerConfig->GetChrToGenomeRatio( nChr );
		double nProbToKeep = nExpectedMarkerNumOnChr / (double)pmMarkerMapDistanceOnChr->size();

		for (map<double,double>::iterator itMarker = pmMarkerMapDistanceOnChr->begin(); itMarker!=pmMarkerMapDistanceOnChr->end(); ++itMarker) {

			if (UniformGen.Next() <= nProbToKeep) {

				double nCurrPos = itMarker->second; // itMarker->first  * 10.0e-6;

				fLoci << "chr" << (nChr+1) << "_" << nCurrMarker << "\t2\t";
				fSampledMarkers << nChr << "\t" << ( nCurrMarker -1 ) << "\t" << nCurrPos << endl;
			
				if ((nSampledMarkerCount==1)) {
				
					fLoci << "NA\t"; 
				}
				else {
				
					fLoci <<  (nCurrPos - nPrevMarkerPos) << "\t";
					
				
				}
				nPrevMarkerPos = nCurrPos ;
				fLoci << (nChr+1) << endl;
				nSampledMarkerCount++;
			}
			else {
				//nPrevMarkerPos += itMarker->first; //accumulate distance
			}

			nCurrMarker++;
		}
	}

	fSampledMarkers.close();

	sCmd = "php export_genotype.php -- -s \"" + sGenHeader + "_markers.txt\" -o \"" + sExportFolder + "\" -i sampledmarkers.txt -pop1 100000 -pop2 100000 -pop3 999999";
	printf("Calling: %s ...\n", sCmd.c_str());
	system(sCmd.c_str());



	/*
	string sLn;
	int iLn = 0;
	if (std::getline(fPhenotypes, sLn)) {// Header

	}

	else {
		printf("Phenotype output error.\n");
		return;
	}

	while(std::getline(fPhenotypes, sLn)) {
		
		int nId, nPop, nSex, nFatherId, nMotherId;
		sscanf(sLn.c_str(), "%[^\t] %[^\t] %[^\t] %[^\t] %[^\t] %*[^\n]", &nId, &nPop, &nSex, &nFatherId, &nMotherId);
		string sPrelude
		iLn++;
	}
	*/
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x1198, %rsp           # imm = 0x1198
movq %rdx, 0x20(%rsp)
movl %esi, %r15d
movl %edi, %ebx
callq 0xbcea
leaq 0x178(%rsp), %r12
movq %r12, -0x10(%r12)
leaq 0x4cde(%rip), %rsi      # 0x36cbf
leaq 0x4ce3(%rip), %rdx      # 0x36ccb
leaq 0x168(%rsp), %r14
movq %r14, %rdi
callq 0xa91c
leaq 0x16909(%rip), %rsi     # 0x48908
leaq 0x148(%rsp), %rdi
movq %r14, %rdx
callq 0x1023e
movq 0x168(%rsp), %rdi
cmpq %r12, %rdi
je 0x3202c
movq 0x178(%rsp), %rsi
incq %rsi
callq 0x7390
leaq 0x5a0(%rsp), %r12
movq %r12, -0x10(%r12)
movq 0x20(%rsp), %rax
movq (%rax), %rsi
movq 0x8(%rax), %rdx
addq %rsi, %rdx
leaq 0x590(%rsp), %rdi
callq 0xa9b2
leaq 0x5061(%rip), %rsi      # 0x370bd
leaq 0x590(%rsp), %rdi
callq 0x76f0
leaq 0x798(%rsp), %rdi
movl %ebx, %esi
callq 0x33239
movq 0x590(%rsp), %rcx
movq 0x598(%rsp), %r8
movq 0x7a0(%rsp), %rdx
leaq (%rdx,%r8), %rax
movl $0xf, %edi
cmpq %r12, %rcx
je 0x320a6
movq 0x5a0(%rsp), %rdi
movq 0x798(%rsp), %rsi
cmpq %rdi, %rax
jbe 0x320d2
leaq 0x7a8(%rsp), %r9
movl $0xf, %edi
cmpq %r9, %rsi
je 0x320cd
movq 0x7a8(%rsp), %rdi
cmpq %rdi, %rax
jbe 0x320e1
leaq 0x590(%rsp), %rdi
callq 0x7110
jmp 0x320f2
leaq 0x798(%rsp), %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x73e0
leaq 0x198(%rsp), %rdx
movq %rdx, -0x10(%rdx)
movq (%rax), %rsi
leaq 0x10(%rax), %rcx
cmpq %rcx, %rsi
je 0x3211f
movq %rsi, 0x188(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x198(%rsp)
jmp 0x32127
movupd (%rcx), %xmm0
movupd %xmm0, (%rdx)
movq %rax, %rdx
addq $0x8, %rdx
movq 0x8(%rax), %rsi
movq %rsi, 0x190(%rsp)
movq %rcx, (%rax)
movq $0x0, (%rdx)
movb $0x0, (%rcx)
leaq 0x188(%rsp), %r14
movq 0x20(%rsp), %rdi
movq %r14, %rsi
callq 0x7460
movq (%r14), %rdi
leaq 0x198(%rsp), %r14
cmpq %r14, %rdi
je 0x3217c
movq 0x198(%rsp), %rsi
incq %rsi
callq 0x7390
leaq 0x7a8(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x3219d
movq 0x7a8(%rsp), %rsi
incq %rsi
callq 0x7390
movq 0x590(%rsp), %rdi
cmpq %r12, %rdi
je 0x321ba
movq 0x5a0(%rsp), %rsi
incq %rsi
callq 0x7390
movq 0x20(%rsp), %rax
movq (%rax), %rdi
callq 0x31b35
leaq 0x798(%rsp), %rdi
callq 0x7650
leaq 0xf98(%rsp), %rdi
callq 0x7650
leaq 0xd98(%rsp), %rdi
callq 0x7650
leaq 0xb98(%rsp), %rdi
callq 0x7650
leaq 0x390(%rsp), %rdi
callq 0x7650
leaq 0x998(%rsp), %rdi
callq 0x7650
leaq 0x188(%rsp), %rdi
movq %r14, (%rdi)
movq 0x20(%rsp), %rax
movq (%rax), %rsi
movq 0x8(%rax), %rdx
addq %rsi, %rdx
callq 0xa9b2
leaq 0x4e87(%rip), %rsi      # 0x370c2
leaq 0x188(%rsp), %rdi
callq 0x76f0
movq 0x188(%rsp), %rsi
leaq 0x390(%rsp), %rdi
movl $0x10, %edx
callq 0x7070
movq 0x188(%rsp), %rdi
cmpq %r14, %rdi
je 0x3227f
movq 0x198(%rsp), %rsi
incq %rsi
callq 0x7390
leaq 0x4e49(%rip), %rsi      # 0x370cf
leaq 0x998(%rsp), %rdi
movl $0x10, %edx
callq 0x7070
leaq 0x188(%rsp), %rdi
callq 0x73f0
leaq 0x590(%rsp), %rdi
callq 0x73f0
leaq 0x38(%rsp), %rax
movq %rax, -0x10(%rax)
movq 0x148(%rsp), %rsi
movq 0x150(%rsp), %rdx
addq %rsi, %rdx
leaq 0x28(%rsp), %rdi
callq 0xa9b2
testl %r15d, %r15d
je 0x32394
leaq 0xc8(%rsp), %r14
movq %r14, -0x10(%r14)
movq 0x28(%rsp), %rsi
movq 0x30(%rsp), %rdx
addq %rsi, %rdx
leaq 0xb8(%rsp), %rdi
callq 0xa9b2
leaq 0x2f18(%rip), %rsi      # 0x35226
leaq 0xb8(%rsp), %rdi
callq 0x76f0
leaq 0xe0(%rsp), %rdi
movl %r15d, %esi
callq 0x29776
movq 0xb8(%rsp), %rcx
movq 0xc0(%rsp), %r8
movq 0xe8(%rsp), %rdx
leaq (%rdx,%r8), %rax
movl $0xf, %edi
cmpq %r14, %rcx
je 0x32359
movq 0xc8(%rsp), %rdi
movq 0xe0(%rsp), %rsi
cmpq %rdi, %rax
jbe 0x32385
leaq 0xf0(%rsp), %r9
movl $0xf, %edi
cmpq %r9, %rsi
je 0x32380
movq 0xf0(%rsp), %rdi
cmpq %rdi, %rax
jbe 0x323b4
leaq 0xb8(%rsp), %rdi
callq 0x7110
jmp 0x323c5
leaq 0x10(%rsp), %rax
movq %rax, -0x10(%rax)
movq 0x28(%rsp), %rsi
movq 0x30(%rsp), %rdx
addq %rsi, %rdx
movq %rsp, %rdi
callq 0xa9b2
jmp 0x3240d
leaq 0xe0(%rsp), %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x73e0
leaq 0x10(%rsp), %rdx
movq %rdx, -0x10(%rdx)
movq (%rax), %rsi
leaq 0x10(%rax), %rcx
cmpq %rcx, %rsi
je 0x323e8
movq %rsi, (%rsp)
movq (%rcx), %rdx
movq %rdx, 0x10(%rsp)
jmp 0x323f0
movupd (%rcx), %xmm0
movupd %xmm0, (%rdx)
movq %rax, %rdx
addq $0x8, %rdx
movq 0x8(%rax), %rsi
movq %rsi, 0x8(%rsp)
movq %rcx, (%rax)
movq $0x0, (%rdx)
movb $0x0, (%rcx)
leaq 0x28(%rsp), %rdi
movq %rsp, %r14
movq %r14, %rsi
callq 0x7460
movq (%r14), %rdi
leaq 0x10(%rsp), %rax
cmpq %rax, %rdi
je 0x32437
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x7390
testl %r15d, %r15d
je 0x3247e
leaq 0xf0(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x3245d
movq 0xf0(%rsp), %rsi
incq %rsi
callq 0x7390
leaq 0xc8(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x3247e
movq 0xc8(%rsp), %rsi
incq %rsi
callq 0x7390
movq %rsp, %rdi
leaq 0x10(%rsp), %rax
movq %rax, (%rdi)
movq 0x28(%rsp), %rsi
movq 0x30(%rsp), %rdx
addq %rsi, %rdx
callq 0xa9b2
leaq 0x4c1b(%rip), %rsi      # 0x370bd
movq %rsp, %rdi
callq 0x76f0
leaq 0x28(%rsp), %rdi
movq %rsp, %r14
movq %r14, %rsi
callq 0x7460
movq (%r14), %rdi
leaq 0x10(%rsp), %rax
cmpq %rax, %rdi
je 0x324d4
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x7390
leaq 0x68(%rsp), %rdi
movl %ebx, %esi
callq 0x29776
movq 0x28(%rsp), %rcx
movq 0x30(%rsp), %r8
leaq 0x68(%rsp), %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x73e0
leaq 0x10(%rsp), %r14
movq %r14, (%rsp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x3251e
movq %rdx, (%rsp)
movq (%rcx), %rdx
movq %rdx, 0x10(%rsp)
jmp 0x32527
movupd (%rcx), %xmm0
movupd %xmm0, (%r14)
movq 0x8(%rax), %rdx
movq %rsp, %rbx
movq %rdx, 0x8(%rbx)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
leaq 0x28(%rsp), %rdi
movq %rbx, %rsi
callq 0x7460
movq (%rbx), %rdi
cmpq %r14, %rdi
je 0x32563
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x7390
leaq 0x78(%rsp), %rbx
movq -0x10(%rbx), %rdi
cmpq %rbx, %rdi
je 0x3257e
movq 0x78(%rsp), %rsi
incq %rsi
callq 0x7390
movq %rsp, %rdi
leaq 0x10(%rsp), %rax
movq %rax, (%rdi)
movq 0x28(%rsp), %rsi
movq 0x30(%rsp), %rdx
addq %rsi, %rdx
callq 0xa9b2
leaq 0x4810(%rip), %rsi      # 0x36db2
movq %rsp, %rdi
callq 0x76f0
movq (%rsp), %rsi
leaq 0x188(%rsp), %rdi
movl $0x8, %edx
callq 0x7200
movq (%rsp), %rdi
leaq 0x10(%rsp), %rax
cmpq %rax, %rdi
je 0x325db
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x7390
movq %rsp, %rdi
leaq 0x10(%rsp), %rax
movq %rax, (%rdi)
movq 0x28(%rsp), %rsi
movq 0x30(%rsp), %rdx
addq %rsi, %rdx
callq 0xa9b2
leaq 0x47cb(%rip), %rsi      # 0x36dca
movq %rsp, %rdi
callq 0x76f0
movq (%rsp), %rsi
leaq 0x590(%rsp), %rdi
movl $0x8, %edx
callq 0x7200
movq (%rsp), %rdi
leaq 0x10(%rsp), %rax
cmpq %rax, %rdi
je 0x32638
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x7390
leaq 0x4aa3(%rip), %rsi      # 0x370e2
leaq 0x98(%rsp), %rdi
leaq 0x28(%rsp), %rdx
callq 0x9a1b
leaq 0x4aab(%rip), %rsi      # 0x37103
leaq 0x98(%rsp), %rdi
callq 0x76f0
leaq 0x58(%rsp), %rsi
movq %rsi, -0x10(%rsi)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x3268c
movq %rdx, 0x48(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x58(%rsp)
jmp 0x32694
movupd (%rcx), %xmm0
movupd %xmm0, (%rsi)
movq 0x8(%rax), %rdx
leaq 0x48(%rsp), %rdi
movq %rdx, 0x8(%rdi)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq 0x20(%rsp), %rax
movq (%rax), %rsi
movq 0x8(%rax), %rdx
callq 0x7110
movq %rbx, 0x68(%rsp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x326e4
movq %rdx, 0x68(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x78(%rsp)
jmp 0x326ec
movupd (%rcx), %xmm0
movupd %xmm0, (%rbx)
movq 0x8(%rax), %rdx
leaq 0x68(%rsp), %rdi
movq %rdx, 0x8(%rdi)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
leaq 0x4a0a(%rip), %rsi      # 0x37119
callq 0x76f0
leaq 0x10(%rsp), %rsi
movq %rsi, (%rsp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x3273a
movq %rdx, (%rsp)
movq (%rcx), %rdx
movq %rdx, 0x10(%rsp)
jmp 0x32742
movupd (%rcx), %xmm0
movupd %xmm0, (%rsi)
movq 0x8(%rax), %rdx
movq %rdx, 0x8(%rsp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq 0x68(%rsp), %rdi
cmpq %rbx, %rdi
je 0x32771
movq 0x78(%rsp), %rsi
incq %rsi
callq 0x7390
movq 0x48(%rsp), %rdi
leaq 0x58(%rsp), %rax
cmpq %rax, %rdi
je 0x3278d
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x7390
leaq 0xa8(%rsp), %rbp
movq -0x10(%rbp), %rdi
cmpq %rbp, %rdi
je 0x327ae
movq 0xa8(%rsp), %rsi
incq %rsi
callq 0x7390
movq (%rsp), %rsi
leaq 0x4972(%rip), %rdi      # 0x3712b
xorl %eax, %eax
callq 0x7060
movq (%rsp), %rdi
callq 0x7300
leaq 0x4b2d(%rip), %rdi      # 0x372fd
callq 0x7560
leaq 0x4960(%rip), %rsi      # 0x3713c
leaq 0x390(%rsp), %rbx
movl $0x28, %edx
movq %rbx, %rdi
callq 0x7400
movq 0x390(%rsp), %rax
addq -0x18(%rax), %rbx
movq %rbx, %rdi
movl $0xa, %esi
callq 0x7350
movsbl %al, %esi
leaq 0x390(%rsp), %rdi
callq 0x7040
movq %rax, %rdi
callq 0x7260
movq 0x390(%rsp), %rax
movq -0x18(%rax), %rcx
movl $0xfffffefb, %edx       # imm = 0xFFFFFEFB
andl 0x3a8(%rsp,%rcx), %edx
orl $0x4, %edx
movl %edx, 0x3a8(%rsp,%rcx)
movq -0x18(%rax), %rcx
orl $0x400, 0x3a8(%rsp,%rcx) # imm = 0x400
movq -0x18(%rax), %rax
movq $0x6, 0x398(%rsp,%rax)
leaq 0x1609e(%rip), %rax     # 0x48908
movq (%rax), %rdi
movl $0x2, %esi
callq 0x109b6
movq 0x8(%rax), %rcx
movq %rax, 0x110(%rsp)
subq (%rax), %rcx
je 0x32b7b
movq %rcx, %rax
sarq $0x4, %rax
movabsq $-0x5555555555555555, %rcx # imm = 0xAAAAAAAAAAAAAAAB
imulq %rcx, %rax
cvtsi2sdl 0x11d0(%rsp), %xmm0
movsd %xmm0, 0x100(%rsp)
cmpq $0x1, %rax
adcq $0x0, %rax
movq %rax, 0x108(%rsp)
xorl %r14d, %r14d
movq 0x110(%rsp), %rax
movq (%rax), %rbx
movq 0x8(%rax), %rdx
subq %rbx, %rdx
sarq $0x4, %rdx
movabsq $-0x5555555555555555, %rax # imm = 0xAAAAAAAAAAAAAAAB
imulq %rax, %rdx
cmpq %r14, %rdx
jbe 0x32ef8
leaq 0x1600e(%rip), %rax     # 0x48908
movq (%rax), %rdi
movl %r14d, %esi
callq 0x109d6
leaq (%r14,%r14,2), %rax
shlq $0x4, %rax
addq %rax, %rbx
addq $0x8, %rbx
movsd 0x20(%rbx), %xmm2
unpcklps 0x3440(%rip), %xmm2     # xmm2 = xmm2[0],mem[0],xmm2[1],mem[1]
subpd 0x3448(%rip), %xmm2     # 0x35d70
movq %r14, %rax
movq 0x10(%rbx), %r14
movq %rax, 0x118(%rsp)
incq %rax
movq %rax, 0x88(%rsp)
cmpq %rbx, %r14
je 0x32b62
mulsd 0x100(%rsp), %xmm0
movapd %xmm2, %xmm1
unpckhpd %xmm2, %xmm1            # xmm1 = xmm1[1],xmm2[1]
addsd %xmm2, %xmm1
divsd %xmm1, %xmm0
movsd %xmm0, 0x120(%rsp)
movl $0x1, %r12d
xorpd %xmm0, %xmm0
movsd %xmm0, 0xd8(%rsp)
xorl %r13d, %r13d
leaq 0x160b6(%rip), %rdi     # 0x48a40
callq 0xbba0
leaq 0x1(%r13), %rbp
movsd 0x120(%rsp), %xmm1
ucomisd %xmm0, %xmm1
jb 0x32b43
movsd 0x28(%r14), %xmm0
movsd %xmm0, 0x90(%rsp)
movl $0x3, %edx
leaq 0x390(%rsp), %rdi
leaq 0x25a4(%rip), %rsi      # 0x34f6d
callq 0x7400
leaq 0x390(%rsp), %rdi
movq 0x88(%rsp), %rsi
callq 0x7250
movq %rax, %r15
movl $0x1, %edx
movq %rax, %rdi
leaq 0x2831(%rip), %rsi      # 0x35226
callq 0x7400
movq %r15, %rdi
movq %rbp, %rsi
callq 0x7250
movl $0x3, %edx
movq %rax, %rdi
leaq 0x4751(%rip), %rsi      # 0x37165
callq 0x7400
leaq 0x998(%rsp), %rdi
movq 0x118(%rsp), %rsi
callq 0x7250
movq %rax, %r15
movl $0x1, %edx
movq %rax, %rdi
leaq 0x25f8(%rip), %rsi      # 0x35038
callq 0x7400
movq %r15, %rdi
movq %r13, %rsi
callq 0x7250
movq %rax, %r15
movl $0x1, %edx
movq %rax, %rdi
leaq 0x25d6(%rip), %rsi      # 0x35038
callq 0x7400
movq %r15, %rdi
movsd 0x90(%rsp), %xmm0
callq 0x75c0
movq %rax, %r13
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r13, %rdi
movl $0xa, %esi
callq 0x7350
movsbl %al, %esi
movq %r13, %rdi
callq 0x7040
movq %rax, %rdi
callq 0x7260
movl $0x3, %edx
leaq 0x390(%rsp), %rax
leaq 0x46b3(%rip), %rsi      # 0x37169
cmpq $0x1, %r12
je 0x32ae7
movsd 0x90(%rsp), %xmm0
subsd 0xd8(%rsp), %xmm0
leaq 0x390(%rsp), %rdi
callq 0x75c0
movl $0x1, %edx
leaq 0x2551(%rip), %rsi      # 0x35038
movq %rax, %rdi
callq 0x7400
leaq 0x390(%rsp), %rdi
movq 0x88(%rsp), %rsi
callq 0x7250
movq %rax, %r13
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r13, %rdi
movl $0xa, %esi
callq 0x7350
movsbl %al, %esi
movq %r13, %rdi
callq 0x7040
movq %rax, %rdi
callq 0x7260
incq %r12
movsd 0x90(%rsp), %xmm0
movsd %xmm0, 0xd8(%rsp)
movq %r14, %rdi
callq 0x7270
movq %rax, %r14
movq %rbp, %r13
cmpq %rbx, %rax
leaq 0xa8(%rsp), %rbp
jne 0x32983
movq 0x88(%rsp), %rax
movq %rax, %r14
cmpq 0x108(%rsp), %rax
jne 0x328c6
leaq 0x998(%rsp), %rbx
movq %rbx, %rdi
callq 0x74e0
leaq 0x45db(%rip), %rsi      # 0x3716d
leaq 0x128(%rsp), %rdi
leaq 0x28(%rsp), %rdx
callq 0x9a1b
leaq 0x45e2(%rip), %rsi      # 0x3718d
leaq 0x128(%rsp), %rdi
callq 0x76f0
movq %rbp, 0x98(%rsp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x32be4
movq %rdx, 0x98(%rsp)
movq (%rcx), %rdx
movq %rdx, 0xa8(%rsp)
jmp 0x32bed
movupd (%rcx), %xmm0
movupd %xmm0, (%rbp)
movq 0x8(%rax), %rdx
leaq 0x98(%rsp), %rdi
movq %rdx, 0x8(%rdi)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq 0x20(%rsp), %rax
movq (%rax), %rsi
movq 0x8(%rax), %rdx
callq 0x7110
leaq 0x58(%rsp), %rsi
movq %rsi, 0x48(%rsp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x32c45
movq %rdx, 0x48(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x58(%rsp)
jmp 0x32c4d
movupd (%rcx), %xmm0
movupd %xmm0, (%rsi)
movq 0x8(%rax), %rdx
leaq 0x48(%rsp), %rdi
movq %rdx, 0x8(%rdi)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
leaq 0x4530(%rip), %rsi      # 0x371a0
callq 0x76f0
leaq 0x78(%rsp), %r15
movq %r15, 0x68(%rsp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x32c9d
movq %rdx, 0x68(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x78(%rsp)
jmp 0x32ca6
movupd (%rcx), %xmm0
movupd %xmm0, (%r15)
movq 0x8(%rax), %rdx
leaq 0x68(%rsp), %r14
movq %rdx, 0x8(%r14)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq %rsp, %rdi
movq %r14, %rsi
callq 0x7460
movq (%r14), %rdi
cmpq %r15, %rdi
je 0x32ce2
movq 0x78(%rsp), %rsi
incq %rsi
callq 0x7390
movq 0x48(%rsp), %rdi
leaq 0x58(%rsp), %rax
cmpq %rax, %rdi
je 0x32cfe
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x7390
movq 0x98(%rsp), %rdi
cmpq %rbp, %rdi
je 0x32d1b
movq 0xa8(%rsp), %rsi
incq %rsi
callq 0x7390
leaq 0x138(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x32d3c
movq 0x138(%rsp), %rsi
incq %rsi
callq 0x7390
movq (%rsp), %rsi
leaq 0x43e4(%rip), %rdi      # 0x3712b
xorl %eax, %eax
callq 0x7060
movq (%rsp), %rdi
callq 0x7300
movq (%rsp), %rdi
leaq 0x10(%rsp), %rax
cmpq %rax, %rdi
je 0x32d72
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x7390
movq 0x28(%rsp), %rdi
leaq 0x38(%rsp), %rax
cmpq %rax, %rdi
je 0x32d8e
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x7390
leaq 0x590(%rsp), %rdi
callq 0x70d0
leaq 0x188(%rsp), %rdi
callq 0x70d0
movq 0x15199(%rip), %rax     # 0x47f48
movq (%rax), %r14
movq 0x18(%rax), %r15
leaq 0x9a0(%rsp), %rdi
movq %r14, -0x8(%rdi)
movq -0x18(%r14), %rax
movq %r15, 0x998(%rsp,%rax)
callq 0x72f0
movl $0xf8, %r12d
addq %r12, %rbx
movq %rbx, %rdi
callq 0x7120
leaq 0x398(%rsp), %rdi
movq %r14, -0x8(%rdi)
movq -0x18(%r14), %rax
movq %r15, 0x390(%rsp,%rax)
callq 0x72f0
leaq 0x390(%rsp), %rdi
addq %r12, %rdi
callq 0x7120
leaq 0xba0(%rsp), %rdi
movq %r14, -0x8(%rdi)
movq -0x18(%r14), %rax
movq %r15, 0xb98(%rsp,%rax)
callq 0x72f0
leaq 0xb98(%rsp), %rdi
addq %r12, %rdi
callq 0x7120
leaq 0xda0(%rsp), %rdi
movq %r14, -0x8(%rdi)
movq -0x18(%r14), %rax
movq %r15, 0xd98(%rsp,%rax)
callq 0x72f0
leaq 0xd98(%rsp), %rdi
addq %r12, %rdi
callq 0x7120
leaq 0xfa0(%rsp), %rdi
movq %r14, -0x8(%rdi)
movq -0x18(%r14), %rax
movq %r15, 0xf98(%rsp,%rax)
callq 0x72f0
leaq 0xf98(%rsp), %rdi
addq %r12, %rdi
callq 0x7120
leaq 0x7a0(%rsp), %rdi
movq %r14, -0x8(%rdi)
movq -0x18(%r14), %rax
movq %r15, 0x798(%rsp,%rax)
callq 0x72f0
leaq 0x798(%rsp), %rdi
addq %r12, %rdi
callq 0x7120
leaq 0x158(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x32ee6
movq 0x158(%rsp), %rsi
incq %rsi
callq 0x7390
addq $0x1198, %rsp           # imm = 0x1198
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x2cc7(%rip), %rdi      # 0x35bc6
movq %r14, %rsi
xorl %eax, %eax
callq 0x7530
jmp 0x33083
movq %rax, %rbx
leaq 0xf0(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x32f39
movq 0xf0(%rsp), %rsi
incq %rsi
callq 0x7390
jmp 0x32f39
jmp 0x32f36
movq %rax, %rbx
movq 0xb8(%rsp), %rdi
cmpq %r14, %rdi
je 0x3318f
movq 0xc8(%rsp), %rsi
jmp 0x33187
jmp 0x33083
movq %rax, %rbx
movq 0x48(%rsp), %rdi
leaq 0x58(%rsp), %rax
cmpq %rax, %rdi
je 0x32f80
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x7390
jmp 0x32f80
movq %rax, %rbx
movq 0x98(%rsp), %rdi
leaq 0xa8(%rsp), %rax
cmpq %rax, %rdi
je 0x32faa
movq 0xa8(%rsp), %rsi
incq %rsi
callq 0x7390
jmp 0x32faa
movq %rax, %rbx
leaq 0x138(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x33174
movq 0x138(%rsp), %rsi
incq %rsi
callq 0x7390
jmp 0x33174
jmp 0x33171
jmp 0x33171
movq %rbx, %rcx
movq %rax, %rbx
movq 0x68(%rsp), %rdi
cmpq %rcx, %rdi
je 0x33000
movq 0x78(%rsp), %rsi
incq %rsi
callq 0x7390
jmp 0x33000
movq %rax, %rbx
movq 0x48(%rsp), %rdi
leaq 0x58(%rsp), %rax
cmpq %rax, %rdi
je 0x33021
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x7390
jmp 0x33021
movq %rax, %rbx
leaq 0xa8(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x3318f
movq 0xa8(%rsp), %rsi
jmp 0x33187
jmp 0x33083
jmp 0x33171
jmp 0x33171
jmp 0x33083
jmp 0x33171
jmp 0x33171
jmp 0x33083
movq %rax, %rbx
leaq 0x78(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x3318f
movq 0x78(%rsp), %rsi
jmp 0x33187
jmp 0x33083
jmp 0x33171
movq %rax, %rbx
jmp 0x3318f
movq %rax, %rbx
jmp 0x331ab
movq %rax, %rbx
jmp 0x331b8
jmp 0x330ca
jmp 0x330ca
jmp 0x330a1
movq %rax, %rbx
movq 0x188(%rsp), %rdi
cmpq %r14, %rdi
je 0x331c5
movq 0x198(%rsp), %rsi
incq %rsi
callq 0x7390
jmp 0x331c5
movq %rax, %rbx
jmp 0x331c5
movq %rax, %rbx
jmp 0x331d2
movq %rax, %rbx
jmp 0x331df
movq %rax, %rbx
jmp 0x331ec
movq %rax, %rbx
jmp 0x331f9
movq %rax, %rbx
jmp 0x33206
jmp 0x3314f
jmp 0x3314f
movq %rax, %rbx
leaq 0x7a8(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x33129
movq 0x7a8(%rsp), %rsi
incq %rsi
callq 0x7390
jmp 0x33129
jmp 0x33126
movq %rax, %rbx
movq 0x590(%rsp), %rdi
cmpq %r12, %rdi
je 0x33213
movq 0x5a0(%rsp), %rsi
incq %rsi
callq 0x7390
jmp 0x33213
movq %rax, %rbx
jmp 0x33213
movq %rax, %rbx
movq 0x168(%rsp), %rdi
jmp 0x33220
jmp 0x33171
jmp 0x33171
jmp 0x33171
jmp 0x33171
jmp 0x33171
movq %rax, %rbx
movq (%rsp), %rdi
leaq 0x10(%rsp), %rax
cmpq %rax, %rdi
je 0x3318f
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x7390
movq 0x28(%rsp), %rdi
leaq 0x38(%rsp), %rax
cmpq %rax, %rdi
je 0x331ab
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x7390
leaq 0x590(%rsp), %rdi
callq 0x70d0
leaq 0x188(%rsp), %rdi
callq 0x70d0
leaq 0x998(%rsp), %rdi
callq 0x7520
leaq 0x390(%rsp), %rdi
callq 0x7520
leaq 0xb98(%rsp), %rdi
callq 0x7520
leaq 0xd98(%rsp), %rdi
callq 0x7520
leaq 0xf98(%rsp), %rdi
callq 0x7520
leaq 0x798(%rsp), %rdi
callq 0x7520
leaq 0x158(%rsp), %r12
movq -0x10(%r12), %rdi
cmpq %r12, %rdi
je 0x33231
movq (%r12), %rsi
incq %rsi
callq 0x7390
movq %rbx, %rdi
callq 0x76a0