// File: richardposner[P]BioNetFit2/src/code/Particle.cpp
// Function: Particle::calculateFit(bool, unsigned int)
void Particle::calculateFit(bool local, unsigned int mid) {

	//razi TODO: check if the fit calculation is corrent.

	//swarm_->outputError("Particle::calculateFit needs modification");

	bool usingSD = false;
	bool usingMean = false;

	// Construct pointers to the relevant fitting function.
	// This lets us avoid a switch/case or excess conditionals
	// within the calculation loop
	if (swarm_->options.objFunc == 1) {
		objFuncPtr = &Particle::objFunc_sumOfSquares;
	}
	else if (swarm_->options.objFunc == 2) {
		objFuncPtr = &Particle::objFunc_chiSquare;
		usingSD = true;
	}
	else if (swarm_->options.objFunc == 3) {
		objFuncPtr = &Particle::objFunc_divByMeasured;
	}
	else if (swarm_->options.objFunc == 4) {
		objFuncPtr = &Particle::objFunc_divByMean;
		usingMean = true;
	}

	double colSum;
	double setSum;
	double totalSum;
	double divisor;


	//razi: loop over all subparticles associated with models

	unsigned int subParID = calcsubParID(mid);
	if ((mid<0)|| (mid >= swarm_->getNumModels()) || (!getSubParticle(mid)) || (!models.at(mid)) || (dataFiles_.at(mid).empty())){
		outputError("calculateFit Failed. Invalid SubParticle.  PID:"+ toString(id_) + "  model id:" + toString(mid)+ "  subParID:" + toString(subParID)+". Quitting !!!");
	}else{

		totalSum = 0;
		divisor = 0;
		int notfoundCount = 0;
		// Loop through .exp files. Iterator points to string/dataset pair
		for (auto e = swarm_->options.expFiles.begin(); e != swarm_->options.expFiles.end(); ++e){
			if(swarm_->options.verbosity >=4){
				cout << "DATA FILE FOR MID " << mid << " " << e->first << endl;
			}


			if ( dataFiles_.at(mid).find(e->first) == dataFiles_.at(mid).end() ) {
			  // not found
				if(swarm_->options.verbosity >=4){
					cout << "EXPERIMENTAL KEY NOT FOUND IN SIM GDAT FILE: " << e->first << " SKIPING..." << endl;
				}
				continue;
			}

			//razi: we first need to check if the exp file belongs to this subParticle
			if (dataFiles_.at(mid).count(e->first)!=1){
				cout<<"The exp file "<< e->first<< " does not belong to model is:"<<mid<<". try other models."<<endl;
				continue; //Raquel: was a break, making the fit for MID 1 always become zero
			}


			if(swarm_->options.verbosity >=4){
				cout << "RAQUEL PASSED MID " << mid << endl;
			}
			// Loop through .exp columns. Iterator points to column/map pair
			//cout << "exp loop " << e->first << endl;
			setSum = 0;
			if(swarm_->options.verbosity >=4){
				cout << "first: " << e->second->dataCurrent->begin()->first << endl;
				cout << "second " <<  e->second->dataCurrent->begin()->second.begin()->first << endl;
				cout << " third " << e->second->dataCurrent->begin()->second.begin()->second << endl;
			}
			for (std::map<std::string, std::map<double,double> >::iterator exp_col = e->second->dataCurrent->begin(); exp_col != e->second->dataCurrent->end(); ++exp_col) {
				// Loop through timepoints of column.  Iterator points to a timepoint/value pair

				if (usingMean) {
					//cout << "trying to set mean" << endl;
					divisor = e->second->colAverages.at(exp_col->first);
					//cout << "mean set" << endl;
					if(swarm_->options.verbosity >=4){
						cout << "RAQUEL divisor(colmean): " << divisor << endl;
					}
				}

				//cout << "col loop " << exp_col->first << endl;
				colSum = 0;
				for (std::map<double,double>::iterator timepoint = exp_col->second.begin(); timepoint != exp_col->second.end(); ++timepoint) {
					if (std::isnan(timepoint->second)) {
						continue;
					}

					//double exp = timepoint->second;
					//cout << "exp: " << exp << endl;
					if ( dataFiles_.at(mid).at(e->first).at(swarm_->options.smoothing)->dataCurrent->find(exp_col->first) == dataFiles_.at(mid).at(e->first).at(swarm_->options.smoothing)->dataCurrent->end() ) {
					  // not found
						if(swarm_->options.verbosity >=4){
							cout << "EXPERIMENTAL KEY NOT FOUND IN SIM GDAT FILE, exp_col: " << exp_col->first << " SKIPING..." << endl;

						}
						notfoundCount++;

						if((unsigned)notfoundCount>=e->second->dataCurrent->size()){
							if(swarm_->options.verbosity >=4){
								cout << "Went through all EXP columns and didn't find any result in the SIM GDAT, skipping this failed simulation." << endl;
							}

							totalSum=9999;

						}

						continue;
					}

					if ( dataFiles_.at(mid).at(e->first).at(swarm_->options.smoothing)->dataCurrent->at(exp_col->first).find(timepoint->first) == dataFiles_.at(mid).at(e->first).at(swarm_->options.smoothing)->dataCurrent->at(exp_col->first).end() ) {
					  // not found
						if(swarm_->options.verbosity >=4){
							cout << "EXPERIMENTAL KEY NOT FOUND IN SIM GDAT FILE, time_point: " << timepoint->first << " SKIPING..." << endl;
						}
						continue;
					}

					if (swarm_->options.smoothing == 1) {
						//cout << "sim: " << dataFiles_.at(e->first).at(swarm_->options.smoothing)->dataCurrent->at(exp_col->first).at(timepoint->first) << endl;


					}
					else {
						//cout << "sim: " << dataFiles_.at(e->first).at(swarm_->options.smoothing + 1)->dataCurrent->at(exp_col->first).at(timepoint->first) << endl;
					}



					if (usingSD) {
						divisor = e->second->standardDeviations.at(exp_col->first).at(timepoint->first);
						//cout << "divisor: " << divisor << endl;
					}

					double sim;
					// TODO: Introduce fudge tolerance to account for precision loss in simulation control column
					if (swarm_->options.smoothing == 1) {
						if(swarm_->options.verbosity >=4){
							cout << "trying smoothing" << endl;
							cout << "MID: " << mid << " data files size: " << dataFiles_.size() << " e->first: " << e->first << " dataFiles_.at(mid) size: " << dataFiles_.at(mid).size() << " exp_col->first: " << exp_col->first << endl;
							cout << "exp_col->first: " << exp_col->first << " timepoint->first: " << timepoint->first << endl;



						}

						if(swarm_->options.verbosity >=9){

							for(auto keys=dataFiles_.at(mid).at(e->first).begin(); keys!=dataFiles_.at(mid).at(e->first).end(); ++keys){

								cout << "keys: " << keys->first << endl;
								cout << "keys: " << keys->second << endl;

							}
						}

						if(swarm_->options.verbosity >=5){
							cout << "print: " << dataFiles_.at(mid).at(e->first).at(swarm_->options.smoothing+1)->dataCurrent->at(exp_col->first).at(timepoint->first) << endl;
						}
						sim = dataFiles_.at(mid).at(e->first).at(swarm_->options.smoothing)->dataCurrent->at(exp_col->first).at(timepoint->first);
						//cout << dataCurrent->at(exp_col->first).at(timepoint->first) << endl;
						if(swarm_->options.verbosity >=4){
							cout << " [mid] " << mid << " [e->first] " << e->first << " [swarm_->options.smoothing] " << swarm_->options.smoothing << " exp_col->first " << exp_col->first << " timepoint->first " << timepoint->first << endl;
							cout << "done " << endl;
						}
					}
					else {
						if(swarm_->options.verbosity >=4){
							cout << "trying smoothing2 " << endl;
						}
						sim = dataFiles_.at(mid).at(e->first).at(swarm_->options.smoothing+1)->dataCurrent->at(exp_col->first).at(timepoint->first);
						if(swarm_->options.verbosity >=4){
							cout << "done" << endl;
						}
					}
					double sum = 0;
					if(sim != timepoint->second){ //if simulation and experimental values are exactly equal, the difference between them will be zero, so we can skip the objective function
						sum = (this->*objFuncPtr)(sim, timepoint->second, divisor);
					}
					if(swarm_->options.verbosity >= 3){
						cout << "sum = " << sum << " sim =" << sim << " timepoint->second = " << timepoint->second << " divisor = "<< divisor << endl;
						cout << "SUM: " << sum << "MID: " << mid << endl;
					}
					if (swarm_->options.bootstrap) {
						//cout << "all sets: "<< swarm_->bootstrapMaps.size() << endl;
						//cout << "files: " << swarm_->bootstrapMaps[swarm_->bootstrapCounter].size() << endl;
						//cout << "cols: " << (swarm_->bootstrapMaps[swarm_->bootstrapCounter].begin())->first << endl;
						//cout << "tps: " << swarm_->bootstrapMaps[swarm_->bootstrapCounter][exp_col->first][timepoint->first] << endl;
						//cout << "multiplying " << colSum << " by " << swarm_->bootstrapMaps[swarm_->bootstrapCounter - 1][e->first][exp_col->first][timepoint->first] << endl;
						//cout << "m: " << colSum << " by " << swarm_->bootstrapMaps[swarm_->bootstrapCounter].at(e->first).at(exp_col->first).at(timepoint->first) << endl;
						sum *= swarm_->bootstrapMaps[swarm_->bootstrapCounter][e->first][exp_col->first][timepoint->first];
					} //if (swarm_->options.bootstrap)
					colSum += sum;
				} //for through values
				setSum += colSum;
			} //for col loop
			totalSum += setSum;
		}//for (auto e = swarm_->options.expFiles.begin(); e != swarm_->options.expFiles.end(); ++e)
		// Erase our data sets
		dataFiles_.at(mid).clear();
		// Store our fit calc
		if(swarm_->options.verbosity >=4){
			cout << " totalSum " << totalSum << endl;
		}
		if (!local) {
			fitCalcs[mid][currentGeneration_] = pow(totalSum, 0.5);
			if(swarm_->options.verbosity >=4){
				cout << "RAQUEL LOCAL FIT for mid " << mid << ": " << fitCalcs[mid][currentGeneration_] << endl;
			}
		}
		else {
			fitCalcs[mid][-1] = pow(totalSum, 0.5);
			if(swarm_->options.verbosity >=4){
				cout << "RAQUEL GLOBALFIT FIT for mid " << mid << ": " << fitCalcs[mid][-1]<< endl;
			}
		}

		if (swarm_->options.verbosity >= 3) {
			cout << "Fit calculation["<<mid<<"]: " << pow(totalSum, 0.5) << endl;
		}

	} //if(!getSubParticle(mid))
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x460, %rsp            # imm = 0x460
movb %sil, %al
movq %rdi, -0x8(%rbp)
andb $0x1, %al
movb %al, -0x9(%rbp)
movl %edx, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x268(%rbp)
movb $0x0, -0x11(%rbp)
movb $0x0, -0x12(%rbp)
movq 0xa8(%rax), %rax
cmpl $0x1, 0x162c(%rax)
jne 0xa918c
movq -0x268(%rbp), %rax
leaq -0x5e6b(%rip), %rcx     # 0xa3310
movq %rcx, 0x30(%rax)
movq $0x0, 0x38(%rax)
jmp 0xa9231
movq -0x268(%rbp), %rax
movq 0xa8(%rax), %rax
cmpl $0x2, 0x162c(%rax)
jne 0xa91c3
movq -0x268(%rbp), %rax
leaq -0x5e61(%rip), %rcx     # 0xa3350
movq %rcx, 0x30(%rax)
movq $0x0, 0x38(%rax)
movb $0x1, -0x11(%rbp)
jmp 0xa922f
movq -0x268(%rbp), %rax
movq 0xa8(%rax), %rax
cmpl $0x3, 0x162c(%rax)
jne 0xa91f6
movq -0x268(%rbp), %rax
leaq -0x5e58(%rip), %rcx     # 0xa3390
movq %rcx, 0x30(%rax)
movq $0x0, 0x38(%rax)
jmp 0xa922d
movq -0x268(%rbp), %rax
movq 0xa8(%rax), %rax
cmpl $0x4, 0x162c(%rax)
jne 0xa922b
movq -0x268(%rbp), %rax
leaq -0x5d9b(%rip), %rcx     # 0xa3480
movq %rcx, 0x30(%rax)
movq $0x0, 0x38(%rax)
movb $0x1, -0x12(%rbp)
jmp 0xa922d
jmp 0xa922f
jmp 0xa9231
movq -0x268(%rbp), %rdi
movl -0x10(%rbp), %esi
callq 0xac1e0
movl %eax, -0x3c(%rbp)
cmpl $0x0, -0x10(%rbp)
jb 0xa92ce
movq -0x268(%rbp), %rax
movl -0x10(%rbp), %ecx
movl %ecx, -0x26c(%rbp)
movq 0xa8(%rax), %rdi
callq 0x8dec0
movl %eax, %ecx
movl -0x26c(%rbp), %eax
cmpl %ecx, %eax
jae 0xa92ce
movq -0x268(%rbp), %rdi
movl -0x10(%rbp), %esi
callq 0xb2a40
cmpq $0x0, %rax
je 0xa92ce
movq -0x268(%rbp), %rdi
addq $0x78, %rdi
movl -0x10(%rbp), %eax
movl %eax, %esi
callq 0x45190
cmpq $0x0, (%rax)
je 0xa92ce
movq -0x268(%rbp), %rdi
addq $0x90, %rdi
movl -0x10(%rbp), %eax
movl %eax, %esi
callq 0xb3430
movq %rax, %rdi
callq 0xb3a10
testb $0x1, %al
jne 0xa92ce
jmp 0xa954b
movq -0x268(%rbp), %rax
movl 0x40(%rax), %esi
leaq -0x120(%rbp), %rdi
movq %rdi, -0x278(%rbp)
callq 0x17e460
movq -0x278(%rbp), %rdx
leaq 0x132980(%rip), %rsi    # 0x1dbc79
leaq -0x100(%rbp), %rdi
callq 0x8e0f0
jmp 0xa9307
leaq 0x132224(%rip), %rdx    # 0x1db532
leaq -0xe0(%rbp), %rdi
leaq -0x100(%rbp), %rsi
callq 0x441f0
jmp 0xa9323
movl -0x10(%rbp), %esi
leaq -0x150(%rbp), %rdi
callq 0x17e460
jmp 0xa9334
leaq -0xc0(%rbp), %rdi
leaq -0xe0(%rbp), %rsi
leaq -0x150(%rbp), %rdx
callq 0x9c7d0
jmp 0xa9350
leaq 0x131c2d(%rip), %rdx    # 0x1daf84
leaq -0xa0(%rbp), %rdi
leaq -0xc0(%rbp), %rsi
callq 0x441f0
jmp 0xa936c
movl -0x3c(%rbp), %esi
leaq -0x170(%rbp), %rdi
callq 0x17e460
jmp 0xa937d
leaq -0x80(%rbp), %rdi
leaq -0xa0(%rbp), %rsi
leaq -0x170(%rbp), %rdx
callq 0x9c7d0
jmp 0xa9396
leaq 0x1322b0(%rip), %rdx    # 0x1db64d
leaq -0x60(%rbp), %rdi
leaq -0x80(%rbp), %rsi
callq 0x441f0
jmp 0xa93ac
leaq -0x60(%rbp), %rdi
callq 0x17e420
jmp 0xa93b7
leaq -0x60(%rbp), %rdi
callq 0x311e8
leaq -0x80(%rbp), %rdi
callq 0x311e8
leaq -0x170(%rbp), %rdi
callq 0x311e8
leaq -0xa0(%rbp), %rdi
callq 0x311e8
leaq -0xc0(%rbp), %rdi
callq 0x311e8
leaq -0x150(%rbp), %rdi
callq 0x311e8
leaq -0xe0(%rbp), %rdi
callq 0x311e8
leaq -0x100(%rbp), %rdi
callq 0x311e8
leaq -0x120(%rbp), %rdi
callq 0x311e8
jmp 0xaacf8
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x128(%rbp)
movl %eax, -0x12c(%rbp)
jmp 0xa953a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x128(%rbp)
movl %eax, -0x12c(%rbp)
jmp 0xa952e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x128(%rbp)
movl %eax, -0x12c(%rbp)
jmp 0xa9522
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x128(%rbp)
movl %eax, -0x12c(%rbp)
jmp 0xa9516
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x128(%rbp)
movl %eax, -0x12c(%rbp)
jmp 0xa950a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x128(%rbp)
movl %eax, -0x12c(%rbp)
jmp 0xa94fe
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x128(%rbp)
movl %eax, -0x12c(%rbp)
jmp 0xa94f2
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x128(%rbp)
movl %eax, -0x12c(%rbp)
jmp 0xa94e9
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x128(%rbp)
movl %eax, -0x12c(%rbp)
leaq -0x60(%rbp), %rdi
callq 0x311e8
leaq -0x80(%rbp), %rdi
callq 0x311e8
leaq -0x170(%rbp), %rdi
callq 0x311e8
leaq -0xa0(%rbp), %rdi
callq 0x311e8
leaq -0xc0(%rbp), %rdi
callq 0x311e8
leaq -0x150(%rbp), %rdi
callq 0x311e8
leaq -0xe0(%rbp), %rdi
callq 0x311e8
leaq -0x100(%rbp), %rdi
callq 0x311e8
leaq -0x120(%rbp), %rdi
callq 0x311e8
jmp 0xaad01
movq -0x268(%rbp), %rax
xorps %xmm0, %xmm0
movsd %xmm0, -0x30(%rbp)
xorps %xmm0, %xmm0
movsd %xmm0, -0x38(%rbp)
movl $0x0, -0x174(%rbp)
movq 0xa8(%rax), %rdi
addq $0x14c0, %rdi           # imm = 0x14C0
addq $0xa0, %rdi
callq 0x45540
movq %rax, -0x180(%rbp)
movq -0x268(%rbp), %rax
movq 0xa8(%rax), %rdi
addq $0x14c0, %rdi           # imm = 0x14C0
addq $0xa0, %rdi
callq 0x455a0
movq %rax, -0x188(%rbp)
leaq -0x180(%rbp), %rdi
leaq -0x188(%rbp), %rsi
callq 0x45570
testb $0x1, %al
jne 0xa95d1
jmp 0xaaa0f
movq -0x268(%rbp), %rax
movq 0xa8(%rax), %rax
cmpl $0x4, 0x1614(%rax)
jb 0xa9646
movq 0x22b961(%rip), %rdi    # 0x2d4f50
leaq 0x1326b3(%rip), %rsi    # 0x1dbca9
callq 0x2ff50
movq %rax, %rdi
movl -0x10(%rbp), %esi
callq 0x30640
movq %rax, %rdi
leaq 0x13aabf(%rip), %rsi    # 0x1e40cf
callq 0x2ff50
movq %rax, -0x280(%rbp)
leaq -0x180(%rbp), %rdi
callq 0x45950
movq -0x280(%rbp), %rdi
movq %rax, %rsi
callq 0x2f780
movq %rax, %rdi
movq 0x22b987(%rip), %rsi    # 0x2d4fc8
callq 0x30c10
movq -0x268(%rbp), %rdi
addq $0x90, %rdi
movl -0x10(%rbp), %eax
movl %eax, %esi
callq 0xb3430
movq %rax, -0x288(%rbp)
leaq -0x180(%rbp), %rdi
callq 0x45950
movq -0x288(%rbp), %rdi
movq %rax, %rsi
callq 0xb3a60
movq -0x268(%rbp), %rdi
movq %rax, -0x190(%rbp)
addq $0x90, %rdi
movl -0x10(%rbp), %eax
movl %eax, %esi
callq 0xb3430
movq %rax, %rdi
callq 0xb3a90
movq %rax, -0x198(%rbp)
leaq -0x190(%rbp), %rdi
leaq -0x198(%rbp), %rsi
callq 0xb3a30
testb $0x1, %al
jne 0xa96c7
jmp 0xa9736
movq -0x268(%rbp), %rax
movq 0xa8(%rax), %rax
cmpl $0x4, 0x1614(%rax)
jb 0xa9731
movq 0x22b86b(%rip), %rdi    # 0x2d4f50
leaq 0x1325d0(%rip), %rsi    # 0x1dbcbc
callq 0x2ff50
movq %rax, -0x290(%rbp)
leaq -0x180(%rbp), %rdi
callq 0x45950
movq -0x290(%rbp), %rdi
movq %rax, %rsi
callq 0x2f780
movq %rax, %rdi
leaq 0x1325cd(%rip), %rsi    # 0x1dbcea
callq 0x2ff50
movq %rax, %rdi
movq 0x22b89c(%rip), %rsi    # 0x2d4fc8
callq 0x30c10
jmp 0xaa9fe
movq -0x268(%rbp), %rdi
addq $0x90, %rdi
movl -0x10(%rbp), %eax
movl %eax, %esi
callq 0xb3430
movq %rax, -0x298(%rbp)
leaq -0x180(%rbp), %rdi
callq 0x45950
movq -0x298(%rbp), %rdi
movq %rax, %rsi
callq 0xb35c0
cmpq $0x1, %rax
je 0xa97e8
movq 0x22b7d3(%rip), %rdi    # 0x2d4f50
leaq 0x132572(%rip), %rsi    # 0x1dbcf6
callq 0x2ff50
movq %rax, -0x2a0(%rbp)
leaq -0x180(%rbp), %rdi
callq 0x45950
movq -0x2a0(%rbp), %rdi
movq %rax, %rsi
callq 0x2f780
movq %rax, %rdi
leaq 0x13254f(%rip), %rsi    # 0x1dbd04
callq 0x2ff50
movq %rax, %rdi
movl -0x10(%rbp), %esi
callq 0x30640
movq %rax, %rdi
leaq 0x132553(%rip), %rsi    # 0x1dbd22
callq 0x2ff50
movq %rax, %rdi
movq 0x22b7ea(%rip), %rsi    # 0x2d4fc8
callq 0x30c10
jmp 0xaa9fe
movq -0x268(%rbp), %rax
movq 0xa8(%rax), %rax
cmpl $0x4, 0x1614(%rax)
jb 0xa982c
movq 0x22b74a(%rip), %rdi    # 0x2d4f50
leaq 0x132529(%rip), %rsi    # 0x1dbd36
callq 0x2ff50
movq %rax, %rdi
movl -0x10(%rbp), %esi
callq 0x30640
movq %rax, %rdi
movq 0x22b7a1(%rip), %rsi    # 0x2d4fc8
callq 0x30c10
movq -0x268(%rbp), %rax
xorps %xmm0, %xmm0
movsd %xmm0, -0x28(%rbp)
movq 0xa8(%rax), %rax
cmpl $0x4, 0x1614(%rax)
jb 0xa99b9
movq 0x22b6fa(%rip), %rdi    # 0x2d4f50
leaq 0x13261f(%rip), %rsi    # 0x1dbe7c
callq 0x2ff50
movq %rax, -0x2b8(%rbp)
leaq -0x180(%rbp), %rdi
callq 0x45950
movq 0x20(%rax), %rax
movq (%rax), %rdi
callq 0x8e350
movq %rax, -0x1a0(%rbp)
leaq -0x1a0(%rbp), %rdi
callq 0x8e4c0
movq -0x2b8(%rbp), %rdi
movq %rax, %rsi
callq 0x2f780
movq %rax, %rdi
movq 0x22b71b(%rip), %rsi    # 0x2d4fc8
callq 0x30c10
movq 0x22b697(%rip), %rdi    # 0x2d4f50
leaq 0x132489(%rip), %rsi    # 0x1dbd49
callq 0x2ff50
movq %rax, -0x2b0(%rbp)
leaq -0x180(%rbp), %rdi
callq 0x45950
movq 0x20(%rax), %rax
movq (%rax), %rdi
callq 0x8e350
movq %rax, -0x1b0(%rbp)
leaq -0x1b0(%rbp), %rdi
callq 0x8e4c0
movq %rax, %rdi
addq $0x20, %rdi
callq 0x8e4e0
movq %rax, -0x1a8(%rbp)
leaq -0x1a8(%rbp), %rdi
callq 0x8e590
movq -0x2b0(%rbp), %rdi
movsd (%rax), %xmm0
callq 0x30710
movq %rax, %rdi
movq 0x22b698(%rip), %rsi    # 0x2d4fc8
callq 0x30c10
movq 0x22b614(%rip), %rdi    # 0x2d4f50
leaq 0x13240e(%rip), %rsi    # 0x1dbd51
callq 0x2ff50
movq %rax, -0x2a8(%rbp)
leaq -0x180(%rbp), %rdi
callq 0x45950
movq 0x20(%rax), %rax
movq (%rax), %rdi
callq 0x8e350
movq %rax, -0x1c0(%rbp)
leaq -0x1c0(%rbp), %rdi
callq 0x8e4c0
movq %rax, %rdi
addq $0x20, %rdi
callq 0x8e4e0
movq %rax, -0x1b8(%rbp)
leaq -0x1b8(%rbp), %rdi
callq 0x8e590
movq -0x2a8(%rbp), %rdi
movsd 0x8(%rax), %xmm0
callq 0x30710
movq %rax, %rdi
movq 0x22b614(%rip), %rsi    # 0x2d4fc8
callq 0x30c10
leaq -0x180(%rbp), %rdi
callq 0x45950
movq 0x20(%rax), %rax
movq (%rax), %rdi
callq 0x8e350
movq %rax, -0x1c8(%rbp)
leaq -0x180(%rbp), %rdi
callq 0x45950
movq 0x20(%rax), %rax
movq (%rax), %rdi
callq 0x8e3b0
movq %rax, -0x1d0(%rbp)
leaq -0x1c8(%rbp), %rdi
leaq -0x1d0(%rbp), %rsi
callq 0x8e380
testb $0x1, %al
jne 0xa9a13
jmp 0xaa9ef
testb $0x1, -0x12(%rbp)
je 0xa9aa7
leaq -0x180(%rbp), %rdi
callq 0x45950
movq 0x20(%rax), %rax
addq $0x38, %rax
movq %rax, -0x2c0(%rbp)
leaq -0x1c8(%rbp), %rdi
callq 0x8e4c0
movq -0x2c0(%rbp), %rdi
movq %rax, %rsi
callq 0xb3ac0
movq %rax, %rcx
movq -0x268(%rbp), %rax
movsd (%rcx), %xmm0
movsd %xmm0, -0x38(%rbp)
movq 0xa8(%rax), %rax
cmpl $0x4, 0x1614(%rax)
jb 0xa9aa5
movq 0x22b4d3(%rip), %rdi    # 0x2d4f50
leaq 0x1322d5(%rip), %rsi    # 0x1dbd59
callq 0x2ff50
movq %rax, %rdi
movsd -0x38(%rbp), %xmm0
callq 0x30710
movq %rax, %rdi
movq 0x22b528(%rip), %rsi    # 0x2d4fc8
callq 0x30c10
jmp 0xa9aa7
xorps %xmm0, %xmm0
movsd %xmm0, -0x20(%rbp)
leaq -0x1c8(%rbp), %rdi
callq 0x8e4c0
movq %rax, %rdi
addq $0x20, %rdi
callq 0x8e4e0
movq %rax, -0x1d8(%rbp)
leaq -0x1c8(%rbp), %rdi
callq 0x8e4c0
movq %rax, %rdi
addq $0x20, %rdi
callq 0x8e540
movq %rax, -0x1e0(%rbp)
leaq -0x1d8(%rbp), %rdi
leaq -0x1e0(%rbp), %rsi
callq 0x8e510
testb $0x1, %al
jne 0xa9b09
jmp 0xaa9cf
leaq -0x1d8(%rbp), %rdi
callq 0x8e590
movsd 0x8(%rax), %xmm0
callq 0x8e570
testb $0x1, %al
jne 0xa9b25
jmp 0xa9b2a
jmp 0xaa9be
movq -0x268(%rbp), %rdi
addq $0x90, %rdi
movl -0x10(%rbp), %eax
movl %eax, %esi
callq 0xb3430
movq %rax, -0x2d8(%rbp)
leaq -0x180(%rbp), %rdi
callq 0x45950
movq -0x2d8(%rbp), %rdi
movq %rax, %rsi
callq 0xb3b60
movq %rax, %rdi
movq -0x268(%rbp), %rax
movq 0xa8(%rax), %rax
movl 0x1658(%rax), %eax
movl %eax, -0x1ec(%rbp)
leaq -0x1ec(%rbp), %rsi
callq 0xb3c00
movq (%rax), %rax
movq (%rax), %rax
movq %rax, -0x2d0(%rbp)
leaq -0x1c8(%rbp), %rdi
callq 0x8e4c0
movq -0x2d0(%rbp), %rdi
movq %rax, %rsi
callq 0xb3ca0
movq -0x268(%rbp), %rdi
movq %rax, -0x1e8(%rbp)
addq $0x90, %rdi
movl -0x10(%rbp), %eax
movl %eax, %esi
callq 0xb3430
movq %rax, -0x2c8(%rbp)
leaq -0x180(%rbp), %rdi
callq 0x45950
movq -0x2c8(%rbp), %rdi
movq %rax, %rsi
callq 0xb3b60
movq %rax, %rdi
movq -0x268(%rbp), %rax
movq 0xa8(%rax), %rax
movl 0x1658(%rax), %eax
movl %eax, -0x1fc(%rbp)
leaq -0x1fc(%rbp), %rsi
callq 0xb3c00
movq (%rax), %rax
movq (%rax), %rdi
callq 0x8e3b0
movq %rax, -0x1f8(%rbp)
leaq -0x1e8(%rbp), %rdi
leaq -0x1f8(%rbp), %rsi
callq 0x94c90
testb $0x1, %al
jne 0xa9c4d
jmp 0xa9d45
movq -0x268(%rbp), %rax
movq 0xa8(%rax), %rax
cmpl $0x4, 0x1614(%rax)
jb 0xa9cb7
movq 0x22b2e5(%rip), %rdi    # 0x2d4f50
leaq 0x132101(%rip), %rsi    # 0x1dbd73
callq 0x2ff50
movq %rax, -0x2e0(%rbp)
leaq -0x1c8(%rbp), %rdi
callq 0x8e4c0
movq -0x2e0(%rbp), %rdi
movq %rax, %rsi
callq 0x2f780
movq %rax, %rdi
leaq 0x132047(%rip), %rsi    # 0x1dbcea
callq 0x2ff50
movq %rax, %rdi
movq 0x22b316(%rip), %rsi    # 0x2d4fc8
callq 0x30c10
movl -0x174(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x174(%rbp)
movl -0x174(%rbp), %eax
movq %rax, -0x2e8(%rbp)
leaq -0x180(%rbp), %rdi
callq 0x45950
movq 0x20(%rax), %rax
movq (%rax), %rdi
callq 0xb3cd0
movq %rax, %rcx
movq -0x2e8(%rbp), %rax
cmpq %rcx, %rax
jb 0xa9d40
movq -0x268(%rbp), %rax
movq 0xa8(%rax), %rax
cmpl $0x4, 0x1614(%rax)
jb 0xa9d33
movq 0x22b238(%rip), %rdi    # 0x2d4f50
leaq 0x13208b(%rip), %rsi    # 0x1dbdaa
callq 0x2ff50
movq %rax, %rdi
movq 0x22b29a(%rip), %rsi    # 0x2d4fc8
callq 0x30c10
movsd 0x130df5(%rip), %xmm0   # 0x1dab30
movsd %xmm0, -0x30(%rbp)
jmp 0xaa9be
movq -0x268(%rbp), %rdi
addq $0x90, %rdi
movl -0x10(%rbp), %eax
movl %eax, %esi
callq 0xb3430
movq %rax, -0x310(%rbp)
leaq -0x180(%rbp), %rdi
callq 0x45950
movq -0x310(%rbp), %rdi
movq %rax, %rsi
callq 0xb3b60
movq %rax, %rdi
movq -0x268(%rbp), %rax
movq 0xa8(%rax), %rax
movl 0x1658(%rax), %eax
movl %eax, -0x20c(%rbp)
leaq -0x20c(%rbp), %rsi
callq 0xb3c00
movq (%rax), %rax
movq (%rax), %rax
movq %rax, -0x308(%rbp)
leaq -0x1c8(%rbp), %rdi
callq 0x8e4c0
movq -0x308(%rbp), %rdi
movq %rax, %rsi
callq 0xb3cf0
movq %rax, -0x300(%rbp)
leaq -0x1d8(%rbp), %rdi
callq 0x8e590
movq -0x300(%rbp), %rdi
movq %rax, %rsi
callq 0xb3d90
movq -0x268(%rbp), %rdi
movq %rax, -0x208(%rbp)
addq $0x90, %rdi
movl -0x10(%rbp), %eax
movl %eax, %esi
callq 0xb3430
movq %rax, -0x2f8(%rbp)
leaq -0x180(%rbp), %rdi
callq 0x45950
movq -0x2f8(%rbp), %rdi
movq %rax, %rsi
callq 0xb3b60
movq %rax, %rdi
movq -0x268(%rbp), %rax
movq 0xa8(%rax), %rax
movl 0x1658(%rax), %eax
movl %eax, -0x21c(%rbp)
leaq -0x21c(%rbp), %rsi
callq 0xb3c00
movq (%rax), %rax
movq (%rax), %rax
movq %rax, -0x2f0(%rbp)
leaq -0x1c8(%rbp), %rdi
callq 0x8e4c0
movq -0x2f0(%rbp), %rdi
movq %rax, %rsi
callq 0xb3cf0
movq %rax, %rdi
callq 0x8e540
movq %rax, -0x218(%rbp)
leaq -0x208(%rbp), %rdi
leaq -0x218(%rbp), %rsi
callq 0x95910
testb $0x1, %al
jne 0xa9eac
jmp 0xa9f1c
movq -0x268(%rbp), %rax
movq 0xa8(%rax), %rax
cmpl $0x4, 0x1614(%rax)
jb 0xa9f17
movq 0x22b086(%rip), %rdi    # 0x2d4f50
leaq 0x131f43(%rip), %rsi    # 0x1dbe14
callq 0x2ff50
movq %rax, -0x318(%rbp)
leaq -0x1d8(%rbp), %rdi
callq 0x8e590
movq -0x318(%rbp), %rdi
movsd (%rax), %xmm0
callq 0x30710
movq %rax, %rdi
leaq 0x131de7(%rip), %rsi    # 0x1dbcea
callq 0x2ff50
movq %rax, %rdi
movq 0x22b0b6(%rip), %rsi    # 0x2d4fc8
callq 0x30c10
jmp 0xaa9be
movq -0x268(%rbp), %rax
movq 0xa8(%rax), %rax
cmpl $0x1, 0x1658(%rax)
jne 0xa9f35
jmp 0xa9f37
jmp 0xa9f37
testb $0x1, -0x11(%rbp)
je 0xa9f9e
leaq -0x180(%rbp), %rdi
callq 0x45950
movq 0x20(%rax), %rax
addq $0x8, %rax
movq %rax, -0x328(%rbp)
leaq -0x1c8(%rbp), %rdi
callq 0x8e4c0
movq -0x328(%rbp), %rdi
movq %rax, %rsi
callq 0xb3cf0
movq %rax, -0x320(%rbp)
leaq -0x1d8(%rbp), %rdi
callq 0x8e590
movq -0x320(%rbp), %rdi
movq %rax, %rsi
callq 0xb3dc0
movsd (%rax), %xmm0
movsd %xmm0, -0x38(%rbp)
movq -0x268(%rbp), %rax
movq 0xa8(%rax), %rax
cmpl $0x1, 0x1658(%rax)
jne 0xaa5ca
movq -0x268(%rbp), %rax
movq 0xa8(%rax), %rax
cmpl $0x4, 0x1614(%rax)
jb 0xaa178
movq 0x22af75(%rip), %rdi    # 0x2d4f50
leaq 0x131e6c(%rip), %rsi    # 0x1dbe4e
callq 0x2ff50
movq %rax, %rdi
movq 0x22afd7(%rip), %rsi    # 0x2d4fc8
callq 0x30c10
movq 0x22af53(%rip), %rdi    # 0x2d4f50
leaq 0x131e5b(%rip), %rsi    # 0x1dbe5f
callq 0x2ff50
movq %rax, %rdi
movl -0x10(%rbp), %esi
callq 0x30640
movq %rax, %rdi
leaq 0x131e47(%rip), %rsi    # 0x1dbe65
callq 0x2ff50
movq -0x268(%rbp), %rdi
movq %rax, -0x358(%rbp)
addq $0x90, %rdi
callq 0xb3e60
movq -0x358(%rbp), %rdi
movq %rax, %rsi
callq 0x30cf0
movq %rax, %rdi
leaq 0x131e22(%rip), %rsi    # 0x1dbe78
callq 0x2ff50
movq %rax, -0x350(%rbp)
leaq -0x180(%rbp), %rdi
callq 0x45950
movq -0x350(%rbp), %rdi
movq %rax, %rsi
callq 0x2f780
movq %rax, %rdi
leaq 0x131dfd(%rip), %rsi    # 0x1dbe84
callq 0x2ff50
movq -0x268(%rbp), %rdi
movq %rax, -0x348(%rbp)
addq $0x90, %rdi
movl -0x10(%rbp), %eax
movl %eax, %esi
callq 0xb3430
movq %rax, %rdi
callq 0xb3e90
movq -0x348(%rbp), %rdi
movq %rax, %rsi
callq 0x30cf0
movq %rax, %rdi
leaq 0x131dd3(%rip), %rsi    # 0x1dbe9f
callq 0x2ff50
movq %rax, -0x340(%rbp)
leaq -0x1c8(%rbp), %rdi
callq 0x8e4c0
movq -0x340(%rbp), %rdi
movq %rax, %rsi
callq 0x2f780
movq %rax, %rdi
movq 0x22aecb(%rip), %rsi    # 0x2d4fc8
callq 0x30c10
movq 0x22ae47(%rip), %rdi    # 0x2d4f50
leaq 0x131d90(%rip), %rsi    # 0x1dbea0
callq 0x2ff50
movq %rax, -0x338(%rbp)
leaq -0x1c8(%rbp), %rdi
callq 0x8e4c0
movq -0x338(%rbp), %rdi
movq %rax, %rsi
callq 0x2f780
movq %rax, %rdi
leaq 0x131d70(%rip), %rsi    # 0x1dbeb1
callq 0x2ff50
movq %rax, -0x330(%rbp)
leaq -0x1d8(%rbp), %rdi
callq 0x8e590
movq -0x330(%rbp), %rdi
movsd (%rax), %xmm0
callq 0x30710
movq %rax, %rdi
movq 0x22ae55(%rip), %rsi    # 0x2d4fc8
callq 0x30c10
movq -0x268(%rbp), %rax
movq 0xa8(%rax), %rax
cmpl $0x9, 0x1614(%rax)
jb 0xaa2dc
movq -0x268(%rbp), %rdi
addq $0x90, %rdi
movl -0x10(%rbp), %eax
movl %eax, %esi
callq 0xb3430
movq %rax, -0x360(%rbp)
leaq -0x180(%rbp), %rdi
callq 0x45950
movq -0x360(%rbp), %rdi
movq %rax, %rsi
callq 0xb3b60
movq %rax, %rdi
callq 0xb3eb0
movq %rax, -0x230(%rbp)
movq -0x268(%rbp), %rdi
addq $0x90, %rdi
movl -0x10(%rbp), %eax
movl %eax, %esi
callq 0xb3430
movq %rax, -0x368(%rbp)
leaq -0x180(%rbp), %rdi
callq 0x45950
movq -0x368(%rbp), %rdi
movq %rax, %rsi
callq 0xb3b60
movq %rax, %rdi
callq 0xb3f10
movq %rax, -0x238(%rbp)
leaq -0x230(%rbp), %rdi
leaq -0x238(%rbp), %rsi
callq 0xb3ee0
testb $0x1, %al
jne 0xaa241
jmp 0xaa2da
movq 0x22ad08(%rip), %rdi    # 0x2d4f50
leaq 0x131c76(%rip), %rsi    # 0x1dbec5
callq 0x2ff50
movq %rax, -0x378(%rbp)
leaq -0x230(%rbp), %rdi
callq 0xb3f40
movq -0x378(%rbp), %rdi
movl (%rax), %esi
callq 0x2f800
movq %rax, %rdi
movq 0x22ad49(%rip), %rsi    # 0x2d4fc8
callq 0x30c10
movq 0x22acc5(%rip), %rdi    # 0x2d4f50
leaq 0x131c33(%rip), %rsi    # 0x1dbec5
callq 0x2ff50
movq %rax, -0x370(%rbp)
leaq -0x230(%rbp), %rdi
callq 0xb3f40
movq -0x370(%rbp), %rdi
movq 0x8(%rax), %rsi
callq 0x2fff0
movq %rax, %rdi
movq 0x22ad04(%rip), %rsi    # 0x2d4fc8
callq 0x30c10
leaq -0x230(%rbp), %rdi
callq 0xb3f60
jmp 0xaa1dc
jmp 0xaa2dc
movq -0x268(%rbp), %rax
movq 0xa8(%rax), %rax
cmpl $0x5, 0x1614(%rax)
jb 0xaa3e0
movq 0x22ac52(%rip), %rdi    # 0x2d4f50
leaq 0x131bc7(%rip), %rsi    # 0x1dbecc
callq 0x2ff50
movq -0x268(%rbp), %rdi
movq %rax, -0x380(%rbp)
addq $0x90, %rdi
movl -0x10(%rbp), %eax
movl %eax, %esi
callq 0xb3430
movq %rax, -0x398(%rbp)
leaq -0x180(%rbp), %rdi
callq 0x45950
movq -0x398(%rbp), %rdi
movq %rax, %rsi
callq 0xb3b60
movq %rax, %rdi
movq -0x268(%rbp), %rax
movq 0xa8(%rax), %rax
movl 0x1658(%rax), %eax
addl $0x1, %eax
movl %eax, -0x23c(%rbp)
leaq -0x23c(%rbp), %rsi
callq 0xb3c00
movq (%rax), %rax
movq (%rax), %rax
movq %rax, -0x390(%rbp)
leaq -0x1c8(%rbp), %rdi
callq 0x8e4c0
movq -0x390(%rbp), %rdi
movq %rax, %rsi
callq 0xb3cf0
movq %rax, -0x388(%rbp)
leaq -0x1d8(%rbp), %rdi
callq 0x8e590
movq -0x388(%rbp), %rdi
movq %rax, %rsi
callq 0xb3dc0
movq -0x380(%rbp), %rdi
movsd (%rax), %xmm0
callq 0x30710
movq %rax, %rdi
movq 0x22abed(%rip), %rsi    # 0x2d4fc8
callq 0x30c10
movq -0x268(%rbp), %rdi
addq $0x90, %rdi
movl -0x10(%rbp), %eax
movl %eax, %esi
callq 0xb3430
movq %rax, -0x3b0(%rbp)
leaq -0x180(%rbp), %rdi
callq 0x45950
movq -0x3b0(%rbp), %rdi
movq %rax, %rsi
callq 0xb3b60
movq %rax, %rdi
movq -0x268(%rbp), %rax
movq 0xa8(%rax), %rax
movl 0x1658(%rax), %eax
movl %eax, -0x240(%rbp)
leaq -0x240(%rbp), %rsi
callq 0xb3c00
movq (%rax), %rax
movq (%rax), %rax
movq %rax, -0x3a8(%rbp)
leaq -0x1c8(%rbp), %rdi
callq 0x8e4c0
movq -0x3a8(%rbp), %rdi
movq %rax, %rsi
callq 0xb3cf0
movq %rax, -0x3a0(%rbp)
leaq -0x1d8(%rbp), %rdi
callq 0x8e590
movq -0x3a0(%rbp), %rdi
movq %rax, %rsi
callq 0xb3dc0
movq %rax, %rcx
movq -0x268(%rbp), %rax
movsd (%rcx), %xmm0
movsd %xmm0, -0x228(%rbp)
movq 0xa8(%rax), %rax
cmpl $0x4, 0x1614(%rax)
jb 0xaa5c5
movq 0x22aa92(%rip), %rdi    # 0x2d4f50
leaq 0x131a0f(%rip), %rsi    # 0x1dbed4
callq 0x2ff50
movq %rax, %rdi
movl -0x10(%rbp), %esi
callq 0x30640
movq %rax, %rdi
leaq 0x1319fd(%rip), %rsi    # 0x1dbedc
callq 0x2ff50
movq %rax, -0x3c8(%rbp)
leaq -0x180(%rbp), %rdi
callq 0x45950
movq -0x3c8(%rbp), %rdi
movq %rax, %rsi
callq 0x2f780
movq %rax, %rdi
leaq 0x1319d9(%rip), %rsi    # 0x1dbee9
callq 0x2ff50
movq %rax, %rdi
movq -0x268(%rbp), %rax
movq 0xa8(%rax), %rax
movl 0x1658(%rax), %esi
callq 0x30640
movq %rax, %rdi
leaq 0x1319cc(%rip), %rsi    # 0x1dbf07
callq 0x2ff50
movq %rax, -0x3c0(%rbp)
leaq -0x1c8(%rbp), %rdi
callq 0x8e4c0
movq -0x3c0(%rbp), %rdi
movq %rax, %rsi
callq 0x2f780
movq %rax, %rdi
leaq 0x1319ac(%rip), %rsi    # 0x1dbf18
callq 0x2ff50
movq %rax, -0x3b8(%rbp)
leaq -0x1d8(%rbp), %rdi
callq 0x8e590
movq -0x3b8(%rbp), %rdi
movsd (%rax), %xmm0
callq 0x30710
movq %rax, %rdi
movq 0x22aa2a(%rip), %rsi    # 0x2d4fc8
callq 0x30c10
movq 0x22a9a6(%rip), %rdi    # 0x2d4f50
leaq 0x13197a(%rip), %rsi    # 0x1dbf2b
callq 0x2ff50
movq %rax, %rdi
movq 0x22aa08(%rip), %rsi    # 0x2d4fc8
callq 0x30c10
jmp 0xaa6fd
movq -0x268(%rbp), %rax
movq 0xa8(%rax), %rax
cmpl $0x4, 0x1614(%rax)
jb 0xaa603
movq 0x22a968(%rip), %rdi    # 0x2d4f50
leaq 0x131942(%rip), %rsi    # 0x1dbf31
callq 0x2ff50
movq %rax, %rdi
movq 0x22a9ca(%rip), %rsi    # 0x2d4fc8
callq 0x30c10
movq -0x268(%rbp), %rdi
addq $0x90, %rdi
movl -0x10(%rbp), %eax
movl %eax, %esi
callq 0xb3430
movq %rax, -0x3e0(%rbp)
leaq -0x180(%rbp), %rdi
callq 0x45950
movq -0x3e0(%rbp), %rdi
movq %rax, %rsi
callq 0xb3b60
movq %rax, %rdi
movq -0x268(%rbp), %rax
movq 0xa8(%rax), %rax
movl 0x1658(%rax), %eax
addl $0x1, %eax
movl %eax, -0x244(%rbp)
leaq -0x244(%rbp), %rsi
callq 0xb3c00
movq (%rax), %rax
movq (%rax), %rax
movq %rax, -0x3d8(%rbp)
leaq -0x1c8(%rbp), %rdi
callq 0x8e4c0
movq -0x3d8(%rbp), %rdi
movq %rax, %rsi
callq 0xb3cf0
movq %rax, -0x3d0(%rbp)
leaq -0x1d8(%rbp), %rdi
callq 0x8e590
movq -0x3d0(%rbp), %rdi
movq %rax, %rsi
callq 0xb3dc0
movq %rax, %rcx
movq -0x268(%rbp), %rax
movsd (%rcx), %xmm0
movsd %xmm0, -0x228(%rbp)
movq 0xa8(%rax), %rax
cmpl $0x4, 0x1614(%rax)
jb 0xaa6fb
movq 0x22a870(%rip), %rdi    # 0x2d4f50
leaq 0x133b15(%rip), %rsi    # 0x1de1fc
callq 0x2ff50
movq %rax, %rdi
movq 0x22a8d2(%rip), %rsi    # 0x2d4fc8
callq 0x30c10
jmp 0xaa6fd
xorps %xmm0, %xmm0
movsd %xmm0, -0x250(%rbp)
movsd -0x228(%rbp), %xmm0
movsd %xmm0, -0x3e8(%rbp)
leaq -0x1d8(%rbp), %rdi
callq 0x8e590
movsd -0x3e8(%rbp), %xmm0
ucomisd 0x8(%rax), %xmm0
jne 0xaa73a
jp 0xaa73a
jmp 0xaa7eb
movq -0x268(%rbp), %rcx
movq 0x30(%rcx), %rax
movq %rax, -0x3f8(%rbp)
movq 0x38(%rcx), %rdx
addq %rdx, %rcx
movq %rcx, -0x3f0(%rbp)
andq $0x1, %rax
cmpq $0x0, %rax
je 0xaa786
movq -0x3f8(%rbp), %rcx
movq -0x3f0(%rbp), %rax
movq (%rax), %rax
subq $0x1, %rcx
movq (%rax,%rcx), %rax
movq %rax, -0x400(%rbp)
jmp 0xaa794
movq -0x3f8(%rbp), %rax
movq %rax, -0x400(%rbp)
movq -0x400(%rbp), %rax
movq %rax, -0x408(%rbp)
movsd -0x228(%rbp), %xmm0
movsd %xmm0, -0x410(%rbp)
leaq -0x1d8(%rbp), %rdi
callq 0x8e590
movq -0x3f0(%rbp), %rdi
movsd -0x410(%rbp), %xmm0
movq %rax, %rcx
movq -0x408(%rbp), %rax
movsd 0x8(%rcx), %xmm1
movsd -0x38(%rbp), %xmm2
callq *%rax
movsd %xmm0, -0x250(%rbp)
movq -0x268(%rbp), %rax
movq 0xa8(%rax), %rax
cmpl $0x3, 0x1614(%rax)
jb 0xaa8f2
movq 0x22a743(%rip), %rdi    # 0x2d4f50
leaq 0x131730(%rip), %rsi    # 0x1dbf44
callq 0x2ff50
movq %rax, %rdi
movsd -0x250(%rbp), %xmm0
callq 0x30710
movq %rax, %rdi
leaq 0x131718(%rip), %rsi    # 0x1dbf4b
callq 0x2ff50
movq %rax, %rdi
movsd -0x228(%rbp), %xmm0
callq 0x30710
movq %rax, %rdi
leaq 0x131700(%rip), %rsi    # 0x1dbf52
callq 0x2ff50
movq %rax, -0x418(%rbp)
leaq -0x1d8(%rbp), %rdi
callq 0x8e590
movq -0x418(%rbp), %rdi
movsd 0x8(%rax), %xmm0
callq 0x30710
movq %rax, %rdi
leaq 0x1316e3(%rip), %rsi    # 0x1dbf68
callq 0x2ff50
movq %rax, %rdi
movsd -0x38(%rbp), %xmm0
callq 0x30710
movq %rax, %rdi
movq 0x22a727(%rip), %rsi    # 0x2d4fc8
callq 0x30c10
movq 0x22a6a3(%rip), %rdi    # 0x2d4f50
leaq 0x1316c0(%rip), %rsi    # 0x1dbf74
callq 0x2ff50
movq %rax, %rdi
movsd -0x250(%rbp), %xmm0
callq 0x30710
movq %rax, %rdi
leaq 0x13158c(%rip), %rsi    # 0x1dbe5f
callq 0x2ff50
movq %rax, %rdi
movl -0x10(%rbp), %esi
callq 0x30640
movq %rax, %rdi
movq 0x22a6db(%rip), %rsi    # 0x2d4fc8
callq 0x30c10
movq -0x268(%rbp), %rax
movq 0xa8(%rax), %rax
cmpl $0x0, 0x1638(%rax)
je 0xaa9ac
movq -0x268(%rbp), %rax
movq 0xa8(%rax), %rax
movq %rax, %rdi
addq $0x38, %rdi
movl 0x13ec(%rax), %eax
movl %eax, %esi
callq 0xb3f90
movq %rax, -0x430(%rbp)
leaq -0x180(%rbp), %rdi
callq 0x45950
movq -0x430(%rbp), %rdi
movq %rax, %rsi
callq 0xb3fb0
movq %rax, -0x428(%rbp)
leaq -0x1c8(%rbp), %rdi
callq 0x8e4c0
movq -0x428(%rbp), %rdi
movq %rax, %rsi
callq 0xb4090
movq %rax, -0x420(%rbp)
leaq -0x1d8(%rbp), %rdi
callq 0x8e590
movq -0x420(%rbp), %rdi
movq %rax, %rsi
callq 0xb4170
movl (%rax), %eax
cvtsi2sd %rax, %xmm0
mulsd -0x250(%rbp), %xmm0
movsd %xmm0, -0x250(%rbp)
movsd -0x250(%rbp), %xmm0
addsd -0x20(%rbp), %xmm0
movsd %xmm0, -0x20(%rbp)
leaq -0x1d8(%rbp), %rdi
callq 0x8e5e0
jmp 0xa9ace
movsd -0x20(%rbp), %xmm0
addsd -0x28(%rbp), %xmm0
movsd %xmm0, -0x28(%rbp)
leaq -0x1c8(%rbp), %rdi
callq 0x8e6f0
jmp 0xa99d8
movsd -0x28(%rbp), %xmm0
addsd -0x30(%rbp), %xmm0
movsd %xmm0, -0x30(%rbp)
leaq -0x180(%rbp), %rdi
callq 0x459b0
jmp 0xa958d
movq -0x268(%rbp), %rdi
addq $0x90, %rdi
movl -0x10(%rbp), %eax
movl %eax, %esi
callq 0xb3430
movq %rax, %rdi
callq 0xb4250
movq -0x268(%rbp), %rax
movq 0xa8(%rax), %rax
cmpl $0x4, 0x1614(%rax)
jb 0xaaa75
movq 0x22a503(%rip), %rdi    # 0x2d4f50
leaq 0x131526(%rip), %rsi    # 0x1dbf7a
callq 0x2ff50
movq %rax, %rdi
movsd -0x30(%rbp), %xmm0
callq 0x30710
movq %rax, %rdi
movq 0x22a558(%rip), %rsi    # 0x2d4fc8
callq 0x30c10
testb $0x1, -0x9(%rbp)
jne 0xaab89
movsd -0x30(%rbp), %xmm0
movsd 0x12e764(%rip), %xmm1   # 0x1d91f0
callq 0x2f8c0
movq -0x268(%rbp), %rdi
movsd %xmm0, -0x438(%rbp)
addq $0x18, %rdi
movl -0x10(%rbp), %eax
movl %eax, %esi
callq 0xb4270
movq %rax, %rdi
movq -0x268(%rbp), %rax
movl 0xb0(%rax), %eax
movl %eax, -0x254(%rbp)
leaq -0x254(%rbp), %rsi
callq 0xb2f50
movsd -0x438(%rbp), %xmm0
movq %rax, %rcx
movq -0x268(%rbp), %rax
movsd %xmm0, (%rcx)
movq 0xa8(%rax), %rax
cmpl $0x4, 0x1614(%rax)
jb 0xaab84
movq 0x22a44f(%rip), %rdi    # 0x2d4f50
leaq 0x13147d(%rip), %rsi    # 0x1dbf85
callq 0x2ff50
movq %rax, %rdi
movl -0x10(%rbp), %esi
callq 0x30640
movq %rax, %rdi
leaq 0x12948f(%rip), %rsi    # 0x1d3fb1
callq 0x2ff50
movq -0x268(%rbp), %rdi
movq %rax, -0x440(%rbp)
addq $0x18, %rdi
movl -0x10(%rbp), %eax
movl %eax, %esi
callq 0xb4270
movq %rax, %rdi
movq -0x268(%rbp), %rax
movl 0xb0(%rax), %eax
movl %eax, -0x258(%rbp)
leaq -0x258(%rbp), %rsi
callq 0xb2f50
movq -0x440(%rbp), %rdi
movsd (%rax), %xmm0
callq 0x30710
movq %rax, %rdi
movq 0x22a449(%rip), %rsi    # 0x2d4fc8
callq 0x30c10
jmp 0xaac7e
movsd -0x30(%rbp), %xmm0
movsd 0x12e65a(%rip), %xmm1   # 0x1d91f0
callq 0x2f8c0
movq -0x268(%rbp), %rdi
movsd %xmm0, -0x448(%rbp)
addq $0x18, %rdi
movl -0x10(%rbp), %eax
movl %eax, %esi
callq 0xb4270
movq %rax, %rdi
movl $0xffffffff, -0x25c(%rbp) # imm = 0xFFFFFFFF
leaq -0x25c(%rbp), %rsi
callq 0xb2f50
movsd -0x448(%rbp), %xmm0
movq %rax, %rcx
movq -0x268(%rbp), %rax
movsd %xmm0, (%rcx)
movq 0xa8(%rax), %rax
cmpl $0x4, 0x1614(%rax)
jb 0xaac7c
movq 0x22a34e(%rip), %rdi    # 0x2d4f50
leaq 0x131396(%rip), %rsi    # 0x1dbf9f
callq 0x2ff50
movq %rax, %rdi
movl -0x10(%rbp), %esi
callq 0x30640
movq %rax, %rdi
leaq 0x12938e(%rip), %rsi    # 0x1d3fb1
callq 0x2ff50
movq -0x268(%rbp), %rdi
movq %rax, -0x450(%rbp)
addq $0x18, %rdi
movl -0x10(%rbp), %eax
movl %eax, %esi
callq 0xb4270
movq %rax, %rdi
movl $0xffffffff, -0x260(%rbp) # imm = 0xFFFFFFFF
leaq -0x260(%rbp), %rsi
callq 0xb2f50
movq -0x450(%rbp), %rdi
movsd (%rax), %xmm0
callq 0x30710
movq %rax, %rdi
movq 0x22a351(%rip), %rsi    # 0x2d4fc8
callq 0x30c10
jmp 0xaac7e
movq -0x268(%rbp), %rax
movq 0xa8(%rax), %rax
cmpl $0x3, 0x1614(%rax)
jb 0xaacf6
movq 0x22a2b4(%rip), %rdi    # 0x2d4f50
leaq 0x13131a(%rip), %rsi    # 0x1dbfbd
callq 0x2ff50
movq %rax, %rdi
movl -0x10(%rbp), %esi
callq 0x30640
movq %rax, %rdi
leaq 0x15ad1a(%rip), %rsi    # 0x2059d7
callq 0x2ff50
movq %rax, -0x458(%rbp)
movsd -0x30(%rbp), %xmm0
movsd 0x12e51a(%rip), %xmm1   # 0x1d91f0
callq 0x2f8c0
movq -0x458(%rbp), %rdi
callq 0x30710
movq %rax, %rdi
movq 0x22a2d7(%rip), %rsi    # 0x2d4fc8
callq 0x30c10
jmp 0xaacf8
addq $0x460, %rsp            # imm = 0x460
popq %rbp
retq
movq -0x128(%rbp), %rdi
callq 0x30170
nopl (%rax)