// File: myudelson[P]hmm-scalable/HMMProblem.cpp
// Function: HMMProblem::predict(double*, char const*, signed char*, int*, int*, int*, int*, int*, HMMProblem**, signed char, signed char*)
void HMMProblem::predict(NUMBER* metrics, const char *filename, NPAR* dat_obs, NCAT *dat_group, NCAT *dat_skill, NCAT *dat_skill_stacked, NCAT *dat_skill_rcount, NDAT *dat_skill_rix, HMMProblem **hmms, NPAR nhmms, NPAR *hmm_idx) {
	NDAT t;
	NCAT g, k;
//	NCAT it;
	NPAR i, j, m, o, isTarget = 0;
	
	NPAR nS = hmms[0]->p->nS, nO = hmms[0]->p->nO;
	NCAT nK = hmms[0]->p->nK, nG = hmms[0]->p->nG;
	NDAT N  = hmms[0]->p->N;
	NDAT N_null  = hmms[0]->p->N_null;
	char f_multiskill = hmms[0]->p->multiskill;
	char f_update_known = hmms[0]->p->update_known;
	char f_update_unknown = hmms[0]->p->update_unknown;
	int f_predictions = hmms[0]->p->predictions;
	int f_metrics_target_obs = hmms[0]->p->metrics_target_obs;
	for(i=1; i<nhmms; i++) {
		if( nS != hmms[i]->p->nS || nO != hmms[i]->p->nO || nK != hmms[i]->p->nK ||
		   nG != hmms[i]->p->nG || N != hmms[i]->p->N || N_null != hmms[i]->p->N_null ||
		   f_multiskill != hmms[i]->p->multiskill ||
		   f_update_known != hmms[i]->p->update_known ||
		   f_update_unknown != hmms[i]->p->update_unknown ||
		   f_predictions != hmms[i]->p->predictions ||
		   f_metrics_target_obs != hmms[i]->p->metrics_target_obs) {
			fprintf(stderr,"Error! One of count variables (N, N_null, nS, nO, nK, nG) or flags (multiskill, predictions, metrics_target_obs, update_known, update_unknown) does not have the same value across multiple models\n");
			exit(1);
		}
	}
	
	NUMBER *local_pred = init1D<NUMBER>(nO); // local prediction
	NUMBER *pLe = init1D<NUMBER>(nS);// p(L|evidence);
	NUMBER pLe_denom; // p(L|evidence) denominator
	NUMBER ***group_skill_map = init3D<NUMBER>(nG, nK, nS);//UNBOOST
//   ::boost::numeric::ublas::mapped_matrix<NUMBER*> gsm (nG, nK);//BOOST
	
	NUMBER ll = 0.0, ll_no_null = 0.0, rmse = 0.0, rmse_no_null = 0.0, accuracy = 0.0, accuracy_no_null = 0.0;
	NUMBER p;
	
//	NUMBER *dat_predict = Calloc(NUMBER, N * nO);
	
	
	FILE *fid = NULL; // file for storing prediction should that be necessary
	if(f_predictions>0) {
		fid = fopen(filename,"w");
		if(fid == NULL)
		{
			fprintf(stderr,"Can't write output model file %s\n",filename);
			exit(1);
		}
	}
	
	// initialize
	struct data* dt = new struct data;
	NDAT count = 0;
//	NDAT d = 0;
	HMMProblem *hmm;
    
    // call to global pre-process
    hmms[0]->preprocessglobal(); // nothing for BKT, computes Elo values for Elo-based
	
	for(t=0; t<N; t++) {
//		output_this = true;
		o = dat_obs[t];
		g = dat_group[t];
		dt->g = g;
        dt->t = t; // statefulness
		
		hmm = (nhmms==1)?hmms[0]:hmms[hmm_idx[t]]; // if just one hmm, use 0's, otherwise take the index value
		
		isTarget = hmm->p->metrics_target_obs == o;
		NCAT *ar;
		int n;
		if(f_multiskill==0) {
			k = dat_skill[t];
			ar = &k;
			n = 1;
		} else {
			k = dat_skill_stacked[ dat_skill_rix[t] ];
			ar = &dat_skill_stacked[ dat_skill_rix[t] ];
			n = dat_skill_rcount[t];
		}
		
//		// prescriptive pretest
//		it = this->p->dat_item[t];
//		string item_s = this->p->map_step_bwd->find((NCAT)it)->second;
//		std::size_t found_prev = 0, found = item_s.find("PINIT-MANUAL-SET");
//		if (found!=std::string::npos) { // set manually
//			// find last divider
//			found = item_s.find("__");
//			while(found!=std::string::npos) {
//				found_prev = found;
//				found = item_s.find("__", found+1);
//			}
//			// get number
//			NUMBER newPLearn = (NUMBER)atof( item_s.substr(found_prev+2, item_s.length()-2).c_str() );
//			group_skill_map[g][ ar[0] ][0] = newPLearn;
//			for(i=1; i<nS; i++) {
//				group_skill_map[g][ ar[0] ][i] = (1-newPLearn)/(nS-1);
//			}
//			continue;
//		}
		
		// deal with null skill
		if(ar[0]<0) { // if no skill label
			isTarget = hmm->null_skill_obs==o;
			rmse += pow(isTarget - hmm->null_obs_ratio[f_metrics_target_obs],2);
			accuracy += isTarget == (hmm->null_obs_ratio[f_metrics_target_obs]==maxn(hmm->null_obs_ratio,nO) && hmm->null_obs_ratio[f_metrics_target_obs] > 1/nO);
//			rmse += pow(isTarget - hmm->null_skill_obs_prob,2);
//			accuracy += isTarget == (hmm->null_skill_obs_prob>=0.5);
			ll -= isTarget*safelog(hmm->null_skill_obs_prob) + (1-isTarget)*safelog(1 - hmm->null_skill_obs_prob);
            if(f_predictions>0 /*&& output_this*/) { // write predictions file if it was opened
                for(m=0; m<nO; m++) {
                    fprintf(fid,"%12.10f%s",hmm->null_obs_ratio[m],(m<(nO-1))?"\t":"\n");
    //				d = (NDAT)m*N + t;
    //				dat_predict[ d ] = hmm->null_obs_ratio[m];
                }
            }
			continue;
		}
		// check if {g,k}'s were initialized
		for(int l=0; l<n; l++) {
			k = ar[l];
//          NUMBER *z = gsm(g,k); //BOOST
//          if( z==NULL )//BOOST
			if( group_skill_map[g][k][0]==0)//UNBOOST
			{
				dt->k = k;
//                NUMBER * pLbit = Calloc(NUMBER, nS);//BOOST
				
				for(i=0; i<nS; i++) {
					group_skill_map[g][k][i] = hmm->getPI(dt,i);//UNBOOST
//                    pLbit[i] = hmm->getPI(dt,i);//BOOST
					count++;
				}
//              gsm(g,k) = pLbit; //BOOST
			}// pLo/pL not set
		}// for all skills at this transaction
		
		// produce prediction and copy to result
//        hmm->producePCorrect(group_skill_map, local_pred, ar, n, dt); //UNBOOST
        hmm->producePCorrect(group_skill_map, local_pred, t); //UNBOOST
//		hmm->producePCorrectBoost(&gsm, local_pred, t); //BOOST
		projectsimplex(local_pred, nO); // addition to make sure there's not side effects
		
        // write prediction out (before pKnown update)
        if(f_predictions>0 /*&& output_this*/) { // write predictions file if it was opened
            for(m=0; m<nO; m++) {
                fprintf(fid,"%12.10f%s",local_pred[m],(m<(nO-1))?"\t": ((f_predictions==1)?"\n":"\t") );// if we print states of KCs, continut
                //				d = (NDAT)m*N + t;
                //				dat_predict[ d ] = local_pred[m];
            }
            if(f_predictions==2) { // if we print out states of KC's as welll
                for(int l=0; l<n; l++) { // all KC here
                    fprintf(fid,"%12.10f%s",group_skill_map[g][ ar[l] ][0], (l==(n-1) && l==(n-1))?"\n":"\t"); // nnon boost // if end of all states: end line//UNBOOST
                    //					fprintf(fid,"%12.10f%s",gsm(g, ar[l] )[0], (l==(n-1) && l==(n-1))?"\n":"\t"); // if end of all states: end line //BOOST
                }
            }
        }
        
		// if necessary guess the obsevaion using Pi and B
		if(f_update_known=='g') {
			NUMBER max_local_pred=0;
			NPAR ix_local_pred=0;
			for(m=0; m<nO; m++) {
				if( local_pred[m]>max_local_pred ) {
					max_local_pred = local_pred[m];
					ix_local_pred = m;
				}
			}
			o = ix_local_pred;
		}
		
        hmm->postprocesslocal(isTarget,local_pred[f_metrics_target_obs], t);
        
		// update pL
		for(int l=0; l<n; l++) {
			k = ar[l];
			dt->k = k;
//          NUMBER* pLbit = gsm(g,k); //BOOST
			
			if(o>-1) { // known observations //
				// update p(L)
				pLe_denom = 0.0;
				// 1. pLe =  (L .* B(:,o)) ./ ( L'*B(:,o)+1e-8 );
				for(i=0; i<nS; i++)
					pLe_denom += group_skill_map[g][k][i] * hmm->getB(dt,i,o);  // TODO: this is local_pred[o]!!!//UNBOOST
//                  pLe_denom += pLbit[i] * hmm->getB(dt,i,o); //BOOST
				for(i=0; i<nS; i++)
					pLe[i] = group_skill_map[g][k][i] * hmm->getB(dt,i,o) / safe0num(pLe_denom); //UNBOOST
//                  pLe[i] = pLbit[i] * hmm->getB(dt,i,o) / safe0num(pLe_denom); //BOOST
				// 2. L = (pLe'*A)';
				for(i=0; i<nS; i++)
					group_skill_map[g][k][i]= 0.0; //UNBOOST
//                  pLbit[i]= 0.0; //BOOST
                for(j=0; j<nS; j++)
                    for(i=0; i<nS; i++)
                        group_skill_map[g][k][j] += pLe[i] * hmm->getA(dt,i,j);//A[i][j]; //UNBOOST
//                    pLbit[j] += pLe[i] * hmm->getA(dt,i,j);//A[i][j]; //BOOST
			} else { // unknown observation
				// 2. L = (pL'*A)';
				for(i=0; i<nS; i++)
					pLe[i] = group_skill_map[g][k][i]; // copy first; //UNBOOST
//                  pLe[i] = pLbit[i]; // copy first; //BOOST
				for(i=0; i<nS; i++)
					group_skill_map[g][k][i] = 0.0; // erase old value //UNBOOST
//                  pLbit[i] = 0.0; // erase old value //BOOST
				for(j=0; j<nS; j++)
					for(i=0; i<nS; i++)
						group_skill_map[g][k][j] += pLe[i] * hmm->getA(dt,i,j);//UNBOOST
//               pLbit[j] += pLe[i] * hmm->getA(dt,i,j);//BOOST
			}// observations
			projectsimplex(group_skill_map[g][k], nS); // addition to make sure there's not side effects //UNBOOST
//            projectsimplex(pLbit, nS); // addition to make sure there's not side effects //BOOST
		}

        // write prediction out (AFTER pKnown update)
        if(f_predictions>0 /*&& output_this*/) { // write predictions file if it was opened
            if(f_predictions==3) { // if we print out states of KC's as welll
                for(int l=0; l<n; l++) { // all KC here
                    fprintf(fid,"%12.10f%s",group_skill_map[g][ ar[l] ][0], (l==(n-1) && l==(n-1))?"\n":"\t"); // nnon boost // if end of all states: end line//UNBOOST
                    //                    fprintf(fid,"%12.10f%s",gsm(g, ar[l] )[0], (l==(n-1) && l==(n-1))?"\n":"\t"); // if end of all states: end line //BOOST
                }
            }
        }
        
        
		rmse += pow(isTarget-local_pred[f_metrics_target_obs],2);
		rmse_no_null += pow(isTarget-local_pred[f_metrics_target_obs],2);
		accuracy += isTarget == (local_pred[f_metrics_target_obs]==maxn(local_pred,nO) && local_pred[f_metrics_target_obs]>1/nO);
		accuracy_no_null += isTarget == (local_pred[f_metrics_target_obs]==maxn(local_pred,nO) && local_pred[f_metrics_target_obs]>1/nO);
		p = safe01num(local_pred[f_metrics_target_obs]);
		ll -= safelog(  p)*   isTarget  +  safelog(1-p)*(1-isTarget);
		ll_no_null -= safelog(  p)*   isTarget  +  safelog(1-p)*(1-isTarget);
		
		// temporary experimental
//		for(int l=0; hmm->p->per_kc_rmse_acc && hmm->p->kc_counts!=NULL && l<n; l++) {
//			k = ar[l];
//			hmm->p->kc_counts[k]++;
//			hmm->p->kc_rmse[k] += pow(isTarget-local_pred[hmm->p->metrics_target_obs],2);
//			hmm->p->kc_acc[k]  += isTarget == (local_pred[hmm->p->metrics_target_obs]>=0.5);
//		}
	} // for all data
	
	// temporary experimental
//	for(int k=0; hmm->p->per_kc_rmse_acc && hmm->p->kc_counts!=NULL && k<nK; k++) {
//		hmm->p->kc_rmse[k] = sqrt(hmm->p->kc_rmse[k] / hmm->p->kc_counts[k]);
//		hmm->p->kc_acc[k]  =      hmm->p->kc_acc[k]  / hmm->p->kc_counts[k];
//	}
	
	delete(dt);
	free(local_pred);
	free(pLe);
	free3D<NUMBER>(group_skill_map, nG, nK);//UNBOOST
	
//    gsm.clear();//BOOST
//    typedef boost::numeric::ublas::mapped_matrix<NUMBER *>::iterator1 it1_t;//BOOST
//    typedef boost::numeric::ublas::mapped_matrix<NUMBER *>::iterator2 it2_t;//BOOST
//    for (it1_t itgsm1 = gsm.begin1(); itgsm1 != gsm.end1(); itgsm1++)//BOOST
//       for (it2_t itgsm2 = itgsm1.begin(); itgsm2 != itgsm1.end(); itgsm2++)//BOOST
//           free( gsm( itgsm2.index1(), itgsm2.index2() ) );//BOOST
	
	rmse = sqrt(rmse / N);
	rmse_no_null = sqrt(rmse_no_null / (N - N_null));
	if(metrics != NULL) {
		metrics[0] = ll;
		metrics[1] = ll_no_null;
		metrics[2] = rmse;
		metrics[3] = rmse_no_null;
		metrics[4] = accuracy/N;
		metrics[5] = accuracy_no_null/(N-N_null);
	}
	
	
//	if(f_predictions>0) { // close predictions file if it was opened
//		ofstream fout(filename,ios::out);
//		char str[1024];
//		if(!fout)
//		{
//			fprintf(stderr,"WARNINT! Failed to open output prediction file %s for writing\n",filename);
//			//exit(1); // do not exit with error
//		}
//		
//		for(NDAT t=0; t<N; t++) {
//			for(m=0; m<nO; m++) {
//				d = (NDAT)m*N + t;
//				sprintf(str,"%12.10f%s",dat_predict[d],(m<(nO-1))?"\t": ((f_predictions==1)?"\n":"\t") );
//				fout << str;
//			}
////			if(f_predictions==2) { // if we print out states of KC's as welll
////				if(f_multiskill==0) {
////					k = dat_skill[t];
////					ar = &k;
////					v = dat_known[t];
////					var = &v;
////					n = 1;
////				} else {
////					k = dat_skill_stacked[ dat_skill_rix[t] ];
////					ar = &dat_skill_stacked[ dat_skill_rix[t] ];
////					v = dat_known_stacked[ dat_skill_rix[t] ];
////					var = &dat_known_stacked[ dat_skill_rix[t] ];
////					n = dat_skill_rcount[t];
////				}
////				for(int l=0; l<n && ar[0]>-1; l++) { // all KC here
////					sprintf(str,"%12.10f%s",var[l], (l==(n-1) && l==(n-1))?"\n":"\t");
////					fout << str;
////				}
////			}
//		}
//		fout.close();
//	}
//	free(dat_predict);
//	
	
	if(f_predictions>0) // close predictions file if it was opened
		fclose(fid);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x220, %rsp            # imm = 0x220
movq 0x30(%rbp), %rax
movb 0x28(%rbp), %al
movq 0x20(%rbp), %rax
movq 0x18(%rbp), %rax
movq 0x10(%rbp), %rax
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq %r8, -0x28(%rbp)
movq %r9, -0x30(%rbp)
movb $0x0, -0x41(%rbp)
movq 0x20(%rbp), %rax
movq (%rax), %rax
movq 0x88(%rax), %rax
movb 0x8b8(%rax), %al
movb %al, -0x42(%rbp)
movq 0x20(%rbp), %rax
movq (%rax), %rax
movq 0x88(%rax), %rax
movb 0x8b9(%rax), %al
movb %al, -0x43(%rbp)
movq 0x20(%rbp), %rax
movq (%rax), %rax
movq 0x88(%rax), %rax
movl 0x8c0(%rax), %eax
movl %eax, -0x48(%rbp)
movq 0x20(%rbp), %rax
movq (%rax), %rax
movq 0x88(%rax), %rax
movl 0x8bc(%rax), %eax
movl %eax, -0x4c(%rbp)
movq 0x20(%rbp), %rax
movq (%rax), %rax
movq 0x88(%rax), %rax
movl 0x8b0(%rax), %eax
movl %eax, -0x50(%rbp)
movq 0x20(%rbp), %rax
movq (%rax), %rax
movq 0x88(%rax), %rax
movl 0x8cc(%rax), %eax
movl %eax, -0x54(%rbp)
movq 0x20(%rbp), %rax
movq (%rax), %rax
movq 0x88(%rax), %rax
movb 0x918(%rax), %al
movb %al, -0x55(%rbp)
movq 0x20(%rbp), %rax
movq (%rax), %rax
movq 0x88(%rax), %rax
movb 0x64(%rax), %al
movb %al, -0x56(%rbp)
movq 0x20(%rbp), %rax
movq (%rax), %rax
movq 0x88(%rax), %rax
movb 0x65(%rax), %al
movb %al, -0x57(%rbp)
movq 0x20(%rbp), %rax
movq (%rax), %rax
movq 0x88(%rax), %rax
movl 0x60(%rax), %eax
movl %eax, -0x5c(%rbp)
movq 0x20(%rbp), %rax
movq (%rax), %rax
movq 0x88(%rax), %rax
movsbl 0x5c(%rax), %eax
movl %eax, -0x60(%rbp)
movb $0x1, -0x3d(%rbp)
movsbl -0x3d(%rbp), %eax
movsbl 0x28(%rbp), %ecx
cmpl %ecx, %eax
jge 0x1d6a9
movsbl -0x42(%rbp), %eax
movq 0x20(%rbp), %rcx
movsbq -0x3d(%rbp), %rdx
movq (%rcx,%rdx,8), %rcx
movq 0x88(%rcx), %rcx
movsbl 0x8b8(%rcx), %ecx
cmpl %ecx, %eax
jne 0x1d678
movsbl -0x43(%rbp), %eax
movq 0x20(%rbp), %rcx
movsbq -0x3d(%rbp), %rdx
movq (%rcx,%rdx,8), %rcx
movq 0x88(%rcx), %rcx
movsbl 0x8b9(%rcx), %ecx
cmpl %ecx, %eax
jne 0x1d678
movl -0x48(%rbp), %eax
movq 0x20(%rbp), %rcx
movsbq -0x3d(%rbp), %rdx
movq (%rcx,%rdx,8), %rcx
movq 0x88(%rcx), %rcx
cmpl 0x8c0(%rcx), %eax
jne 0x1d678
movl -0x4c(%rbp), %eax
movq 0x20(%rbp), %rcx
movsbq -0x3d(%rbp), %rdx
movq (%rcx,%rdx,8), %rcx
movq 0x88(%rcx), %rcx
cmpl 0x8bc(%rcx), %eax
jne 0x1d678
movl -0x50(%rbp), %eax
movq 0x20(%rbp), %rcx
movsbq -0x3d(%rbp), %rdx
movq (%rcx,%rdx,8), %rcx
movq 0x88(%rcx), %rcx
cmpl 0x8b0(%rcx), %eax
jne 0x1d678
movl -0x54(%rbp), %eax
movq 0x20(%rbp), %rcx
movsbq -0x3d(%rbp), %rdx
movq (%rcx,%rdx,8), %rcx
movq 0x88(%rcx), %rcx
cmpl 0x8cc(%rcx), %eax
jne 0x1d678
movsbl -0x55(%rbp), %eax
movq 0x20(%rbp), %rcx
movsbq -0x3d(%rbp), %rdx
movq (%rcx,%rdx,8), %rcx
movq 0x88(%rcx), %rcx
movsbl 0x918(%rcx), %ecx
cmpl %ecx, %eax
jne 0x1d678
movsbl -0x56(%rbp), %eax
movq 0x20(%rbp), %rcx
movsbq -0x3d(%rbp), %rdx
movq (%rcx,%rdx,8), %rcx
movq 0x88(%rcx), %rcx
movsbl 0x64(%rcx), %ecx
cmpl %ecx, %eax
jne 0x1d678
movsbl -0x57(%rbp), %eax
movq 0x20(%rbp), %rcx
movsbq -0x3d(%rbp), %rdx
movq (%rcx,%rdx,8), %rcx
movq 0x88(%rcx), %rcx
movsbl 0x65(%rcx), %ecx
cmpl %ecx, %eax
jne 0x1d678
movl -0x5c(%rbp), %eax
movq 0x20(%rbp), %rcx
movsbq -0x3d(%rbp), %rdx
movq (%rcx,%rdx,8), %rcx
movq 0x88(%rcx), %rcx
cmpl 0x60(%rcx), %eax
jne 0x1d678
movl -0x60(%rbp), %eax
movq 0x20(%rbp), %rcx
movsbq -0x3d(%rbp), %rdx
movq (%rcx,%rdx,8), %rcx
movq 0x88(%rcx), %rcx
movsbl 0x5c(%rcx), %ecx
cmpl %ecx, %eax
je 0x1d69a
movq 0x3d959(%rip), %rax     # 0x5afd8
movq (%rax), %rdi
leaq 0x32f53(%rip), %rsi     # 0x505dc
movb $0x0, %al
callq 0x5440
movl $0x1, %edi
callq 0x5390
jmp 0x1d69c
movb -0x3d(%rbp), %al
addb $0x1, %al
movb %al, -0x3d(%rbp)
jmp 0x1d4f0
movsbl -0x43(%rbp), %edi
callq 0xc410
movq %rax, -0x68(%rbp)
movsbl -0x42(%rbp), %edi
callq 0xc410
movq %rax, -0x70(%rbp)
movl -0x4c(%rbp), %edi
movl -0x48(%rbp), %esi
movsbl -0x42(%rbp), %edx
callq 0x11310
movq %rax, -0x80(%rbp)
xorps %xmm0, %xmm0
movsd %xmm0, -0x88(%rbp)
xorps %xmm0, %xmm0
movsd %xmm0, -0x90(%rbp)
xorps %xmm0, %xmm0
movsd %xmm0, -0x98(%rbp)
xorps %xmm0, %xmm0
movsd %xmm0, -0xa0(%rbp)
xorps %xmm0, %xmm0
movsd %xmm0, -0xa8(%rbp)
xorps %xmm0, %xmm0
movsd %xmm0, -0xb0(%rbp)
movq $0x0, -0xc0(%rbp)
cmpl $0x0, -0x5c(%rbp)
jle 0x1d772
movq -0x10(%rbp), %rdi
leaq 0x32e56(%rip), %rsi     # 0x5058a
callq 0x5370
movq %rax, -0xc0(%rbp)
cmpq $0x0, -0xc0(%rbp)
jne 0x1d770
movq 0x3d887(%rip), %rax     # 0x5afd8
movq (%rax), %rdi
movq -0x10(%rbp), %rdx
leaq 0x32e2d(%rip), %rsi     # 0x5058c
movb $0x0, %al
callq 0x5440
movl $0x1, %edi
callq 0x5390
jmp 0x1d772
movl $0x60, %edi
callq 0x52d0
movq %rax, -0xc8(%rbp)
movl $0x0, -0xcc(%rbp)
movq 0x20(%rbp), %rax
movq (%rax), %rdi
movq (%rdi), %rax
callq *0x60(%rax)
movl $0x0, -0x34(%rbp)
movl -0x34(%rbp), %eax
cmpl -0x50(%rbp), %eax
jge 0x1e5ca
movq -0x18(%rbp), %rax
movslq -0x34(%rbp), %rcx
movb (%rax,%rcx), %al
movb %al, -0x40(%rbp)
movq -0x20(%rbp), %rax
movslq -0x34(%rbp), %rcx
movl (%rax,%rcx,4), %eax
movl %eax, -0x38(%rbp)
movl -0x38(%rbp), %ecx
movq -0xc8(%rbp), %rax
movl %ecx, 0x5c(%rax)
movl -0x34(%rbp), %ecx
movq -0xc8(%rbp), %rax
movl %ecx, 0x8(%rax)
movsbl 0x28(%rbp), %eax
cmpl $0x1, %eax
jne 0x1d7fc
movq 0x20(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x110(%rbp)
jmp 0x1d818
movq 0x20(%rbp), %rax
movq 0x30(%rbp), %rcx
movslq -0x34(%rbp), %rdx
movsbq (%rcx,%rdx), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, -0x110(%rbp)
movq -0x110(%rbp), %rax
movq %rax, -0xd8(%rbp)
movq -0xd8(%rbp), %rax
movq 0x88(%rax), %rax
movsbl 0x5c(%rax), %eax
movsbl -0x40(%rbp), %ecx
cmpl %ecx, %eax
sete %al
andb $0x1, %al
movb %al, -0x41(%rbp)
movsbl -0x55(%rbp), %eax
cmpl $0x0, %eax
jne 0x1d874
movq -0x28(%rbp), %rax
movslq -0x34(%rbp), %rcx
movl (%rax,%rcx,4), %eax
movl %eax, -0x3c(%rbp)
leaq -0x3c(%rbp), %rax
movq %rax, -0xe0(%rbp)
movl $0x1, -0xe4(%rbp)
jmp 0x1d8b9
movq -0x30(%rbp), %rax
movq 0x18(%rbp), %rcx
movslq -0x34(%rbp), %rdx
movslq (%rcx,%rdx,4), %rcx
movl (%rax,%rcx,4), %eax
movl %eax, -0x3c(%rbp)
movq -0x30(%rbp), %rax
movq 0x18(%rbp), %rcx
movslq -0x34(%rbp), %rdx
movslq (%rcx,%rdx,4), %rcx
shlq $0x2, %rcx
addq %rcx, %rax
movq %rax, -0xe0(%rbp)
movq 0x10(%rbp), %rax
movslq -0x34(%rbp), %rcx
movl (%rax,%rcx,4), %eax
movl %eax, -0xe4(%rbp)
movq -0xe0(%rbp), %rax
cmpl $0x0, (%rax)
jge 0x1db1e
movq -0xd8(%rbp), %rax
movsd 0x28(%rax), %xmm0
movsbl -0x40(%rbp), %eax
cvtsi2sd %eax, %xmm1
ucomisd %xmm1, %xmm0
sete %al
setnp %cl
andb %cl, %al
andb $0x1, %al
movb %al, -0x41(%rbp)
movsbl -0x41(%rbp), %eax
cvtsi2sd %eax, %xmm0
movq -0xd8(%rbp), %rax
movq 0x18(%rax), %rax
movslq -0x60(%rbp), %rcx
subsd (%rax,%rcx,8), %xmm0
movl $0x2, %edi
callq 0xf6b0
addsd -0x98(%rbp), %xmm0
movsd %xmm0, -0x98(%rbp)
movsbl -0x41(%rbp), %eax
movl %eax, -0x124(%rbp)
movq -0xd8(%rbp), %rax
movq 0x18(%rax), %rax
movslq -0x60(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm0
movsd %xmm0, -0x120(%rbp)
movq -0xd8(%rbp), %rax
movq 0x18(%rax), %rdi
movsbl -0x43(%rbp), %esi
callq 0x9d80
movaps %xmm0, %xmm1
movsd -0x120(%rbp), %xmm0
xorl %eax, %eax
ucomisd %xmm1, %xmm0
movb %al, -0x111(%rbp)
jne 0x1d9aa
jp 0x1d9aa
movq -0xd8(%rbp), %rax
movq 0x18(%rax), %rax
movslq -0x60(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm0
movsbl -0x43(%rbp), %ecx
movl $0x1, %eax
cltd
idivl %ecx
cvtsi2sd %eax, %xmm1
ucomisd %xmm1, %xmm0
seta %al
movb %al, -0x111(%rbp)
movl -0x124(%rbp), %eax
movb -0x111(%rbp), %cl
andb $0x1, %cl
movzbl %cl, %ecx
cmpl %ecx, %eax
sete %al
andb $0x1, %al
movzbl %al, %eax
cvtsi2sd %eax, %xmm0
addsd -0xa8(%rbp), %xmm0
movsd %xmm0, -0xa8(%rbp)
movsbl -0x41(%rbp), %eax
cvtsi2sd %eax, %xmm0
movsd %xmm0, -0x140(%rbp)
movq -0xd8(%rbp), %rax
movsd 0x30(%rax), %xmm0
callq 0x9ae0
movsd %xmm0, -0x138(%rbp)
movsbl -0x41(%rbp), %ecx
movl $0x1, %eax
subl %ecx, %eax
cvtsi2sd %eax, %xmm0
movsd %xmm0, -0x130(%rbp)
movq -0xd8(%rbp), %rax
movsd 0x31fdf(%rip), %xmm0    # 0x4fa08
subsd 0x30(%rax), %xmm0
callq 0x9ae0
movsd -0x140(%rbp), %xmm1
movsd -0x138(%rbp), %xmm2
movaps %xmm0, %xmm3
movsd -0x130(%rbp), %xmm0
mulsd %xmm3, %xmm0
mulsd %xmm2, %xmm1
addsd %xmm0, %xmm1
movsd -0x88(%rbp), %xmm0
subsd %xmm1, %xmm0
movsd %xmm0, -0x88(%rbp)
cmpl $0x0, -0x5c(%rbp)
jle 0x1db19
movb $0x0, -0x3f(%rbp)
movsbl -0x3f(%rbp), %eax
movsbl -0x43(%rbp), %ecx
cmpl %ecx, %eax
jge 0x1db17
movq -0xc0(%rbp), %rax
movq %rax, -0x150(%rbp)
movq -0xd8(%rbp), %rax
movq 0x18(%rax), %rax
movsbq -0x3f(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm0
movsd %xmm0, -0x148(%rbp)
movsbl -0x3f(%rbp), %eax
movsbl -0x43(%rbp), %ecx
subl $0x1, %ecx
cmpl %ecx, %eax
jge 0x1dad6
leaq 0x331ad(%rip), %rax     # 0x50c7a
movq %rax, -0x158(%rbp)
jmp 0x1dae6
leaq 0x31ec8(%rip), %rax     # 0x4f9a5
movq %rax, -0x158(%rbp)
jmp 0x1dae6
movsd -0x148(%rbp), %xmm0
movq -0x150(%rbp), %rdi
movq -0x158(%rbp), %rdx
leaq 0x32e60(%rip), %rsi     # 0x50963
movb $0x1, %al
callq 0x5440
movb -0x3f(%rbp), %al
addb $0x1, %al
movb %al, -0x3f(%rbp)
jmp 0x1da7c
jmp 0x1db19
jmp 0x1e5bc
movl $0x0, -0xe8(%rbp)
movl -0xe8(%rbp), %eax
cmpl -0xe4(%rbp), %eax
jge 0x1dbf7
movq -0xe0(%rbp), %rax
movslq -0xe8(%rbp), %rcx
movl (%rax,%rcx,4), %eax
movl %eax, -0x3c(%rbp)
movq -0x80(%rbp), %rax
movslq -0x38(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x3c(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movsd (%rax), %xmm0
xorps %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jne 0x1dbe1
jp 0x1dbe1
movl -0x3c(%rbp), %ecx
movq -0xc8(%rbp), %rax
movl %ecx, 0x58(%rax)
movb $0x0, -0x3d(%rbp)
movsbl -0x3d(%rbp), %eax
movsbl -0x42(%rbp), %ecx
cmpl %ecx, %eax
jge 0x1dbdf
movq -0xd8(%rbp), %rdi
movq -0xc8(%rbp), %rsi
movb -0x3d(%rbp), %cl
movq (%rdi), %rax
movsbl %cl, %edx
callq *0x10(%rax)
movq -0x80(%rbp), %rax
movslq -0x38(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x3c(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movsbq -0x3d(%rbp), %rcx
movsd %xmm0, (%rax,%rcx,8)
movl -0xcc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xcc(%rbp)
movb -0x3d(%rbp), %al
addb $0x1, %al
movb %al, -0x3d(%rbp)
jmp 0x1db82
jmp 0x1dbe1
jmp 0x1dbe3
movl -0xe8(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xe8(%rbp)
jmp 0x1db28
movq -0xd8(%rbp), %rdi
movq -0x80(%rbp), %rsi
movq -0x68(%rbp), %rdx
movl -0x34(%rbp), %ecx
movq (%rdi), %rax
callq *0x50(%rax)
movq -0x68(%rbp), %rdi
movsbl -0x43(%rbp), %esi
callq 0x7980
cmpl $0x0, -0x5c(%rbp)
jle 0x1ddc6
movb $0x0, -0x3f(%rbp)
movsbl -0x3f(%rbp), %eax
movsbl -0x43(%rbp), %ecx
cmpl %ecx, %eax
jge 0x1dce2
movq -0xc0(%rbp), %rax
movq %rax, -0x168(%rbp)
movq -0x68(%rbp), %rax
movsbq -0x3f(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm0
movsd %xmm0, -0x160(%rbp)
movsbl -0x3f(%rbp), %eax
movsbl -0x43(%rbp), %ecx
subl $0x1, %ecx
cmpl %ecx, %eax
jge 0x1dc7d
leaq 0x33006(%rip), %rax     # 0x50c7a
movq %rax, -0x170(%rbp)
jmp 0x1dcb1
cmpl $0x1, -0x5c(%rbp)
jne 0x1dc93
leaq 0x31d1b(%rip), %rax     # 0x4f9a5
movq %rax, -0x178(%rbp)
jmp 0x1dca3
leaq 0x32fe0(%rip), %rax     # 0x50c7a
movq %rax, -0x178(%rbp)
jmp 0x1dca3
movq -0x178(%rbp), %rax
movq %rax, -0x170(%rbp)
movsd -0x160(%rbp), %xmm0
movq -0x168(%rbp), %rdi
movq -0x170(%rbp), %rdx
leaq 0x32c95(%rip), %rsi     # 0x50963
movb $0x1, %al
callq 0x5440
movb -0x3f(%rbp), %al
addb $0x1, %al
movb %al, -0x3f(%rbp)
jmp 0x1dc2a
cmpl $0x2, -0x5c(%rbp)
jne 0x1ddc4
movl $0x0, -0xec(%rbp)
movl -0xec(%rbp), %eax
cmpl -0xe4(%rbp), %eax
jge 0x1ddc2
movq -0xc0(%rbp), %rax
movq %rax, -0x188(%rbp)
movq -0x80(%rbp), %rax
movslq -0x38(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq -0xe0(%rbp), %rcx
movslq -0xec(%rbp), %rdx
movslq (%rcx,%rdx,4), %rcx
movq (%rax,%rcx,8), %rax
movsd (%rax), %xmm0
movsd %xmm0, -0x180(%rbp)
movl -0xec(%rbp), %eax
movl -0xe4(%rbp), %ecx
subl $0x1, %ecx
cmpl %ecx, %eax
jne 0x1dd7a
movl -0xec(%rbp), %eax
movl -0xe4(%rbp), %ecx
subl $0x1, %ecx
cmpl %ecx, %eax
jne 0x1dd7a
leaq 0x31c34(%rip), %rax     # 0x4f9a5
movq %rax, -0x190(%rbp)
jmp 0x1dd8a
leaq 0x32ef9(%rip), %rax     # 0x50c7a
movq %rax, -0x190(%rbp)
jmp 0x1dd8a
movsd -0x180(%rbp), %xmm0
movq -0x188(%rbp), %rdi
movq -0x190(%rbp), %rdx
leaq 0x32bbc(%rip), %rsi     # 0x50963
movb $0x1, %al
callq 0x5440
movl -0xec(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xec(%rbp)
jmp 0x1dcf6
jmp 0x1ddc4
jmp 0x1ddc6
movsbl -0x56(%rbp), %eax
cmpl $0x67, %eax
jne 0x1de3d
xorps %xmm0, %xmm0
movsd %xmm0, -0xf8(%rbp)
movb $0x0, -0xf9(%rbp)
movb $0x0, -0x3f(%rbp)
movsbl -0x3f(%rbp), %eax
movsbl -0x43(%rbp), %ecx
cmpl %ecx, %eax
jge 0x1de34
movq -0x68(%rbp), %rax
movsbq -0x3f(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm0
ucomisd -0xf8(%rbp), %xmm0
jbe 0x1de28
movq -0x68(%rbp), %rax
movsbq -0x3f(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm0
movsd %xmm0, -0xf8(%rbp)
movb -0x3f(%rbp), %al
movb %al, -0xf9(%rbp)
jmp 0x1de2a
movb -0x3f(%rbp), %al
addb $0x1, %al
movb %al, -0x3f(%rbp)
jmp 0x1dde5
movb -0xf9(%rbp), %al
movb %al, -0x40(%rbp)
movq -0xd8(%rbp), %rdi
movsbl -0x41(%rbp), %eax
cvtsi2sd %eax, %xmm0
movq -0x68(%rbp), %rax
movslq -0x60(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm1
movl -0x34(%rbp), %esi
movq (%rdi), %rax
callq *0x58(%rax)
movl $0x0, -0x100(%rbp)
movl -0x100(%rbp), %eax
cmpl -0xe4(%rbp), %eax
jge 0x1e222
movq -0xe0(%rbp), %rax
movslq -0x100(%rbp), %rcx
movl (%rax,%rcx,4), %eax
movl %eax, -0x3c(%rbp)
movl -0x3c(%rbp), %ecx
movq -0xc8(%rbp), %rax
movl %ecx, 0x58(%rax)
movsbl -0x40(%rbp), %eax
cmpl $-0x1, %eax
jle 0x1e0c2
xorps %xmm0, %xmm0
movsd %xmm0, -0x78(%rbp)
movb $0x0, -0x3d(%rbp)
movsbl -0x3d(%rbp), %eax
movsbl -0x42(%rbp), %ecx
cmpl %ecx, %eax
jge 0x1df31
movq -0x80(%rbp), %rax
movslq -0x38(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x3c(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movsbq -0x3d(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm0
movsd %xmm0, -0x198(%rbp)
movq -0xd8(%rbp), %rdi
movq -0xc8(%rbp), %rsi
movb -0x3d(%rbp), %dl
movb -0x40(%rbp), %cl
movq (%rdi), %rax
movsbl %dl, %edx
movsbl %cl, %ecx
callq *0x20(%rax)
movaps %xmm0, %xmm2
movsd -0x198(%rbp), %xmm0
movsd -0x78(%rbp), %xmm1
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, -0x78(%rbp)
movb -0x3d(%rbp), %al
addb $0x1, %al
movb %al, -0x3d(%rbp)
jmp 0x1deb8
movb $0x0, -0x3d(%rbp)
movsbl -0x3d(%rbp), %eax
movsbl -0x42(%rbp), %ecx
cmpl %ecx, %eax
jge 0x1dfd6
movq -0x80(%rbp), %rax
movslq -0x38(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x3c(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movsbq -0x3d(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm0
movsd %xmm0, -0x1a8(%rbp)
movq -0xd8(%rbp), %rdi
movq -0xc8(%rbp), %rsi
movb -0x3d(%rbp), %dl
movb -0x40(%rbp), %cl
movq (%rdi), %rax
movsbl %dl, %edx
movsbl %cl, %ecx
callq *0x20(%rax)
movaps %xmm0, %xmm1
movsd -0x1a8(%rbp), %xmm0
mulsd %xmm1, %xmm0
movsd %xmm0, -0x1a0(%rbp)
movsd -0x78(%rbp), %xmm0
callq 0x9a40
movaps %xmm0, %xmm1
movsd -0x1a0(%rbp), %xmm0
divsd %xmm1, %xmm0
movq -0x70(%rbp), %rax
movsbq -0x3d(%rbp), %rcx
movsd %xmm0, (%rax,%rcx,8)
movb -0x3d(%rbp), %al
addb $0x1, %al
movb %al, -0x3d(%rbp)
jmp 0x1df35
movb $0x0, -0x3d(%rbp)
movsbl -0x3d(%rbp), %eax
movsbl -0x42(%rbp), %ecx
cmpl %ecx, %eax
jge 0x1e011
movq -0x80(%rbp), %rax
movslq -0x38(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x3c(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movsbq -0x3d(%rbp), %rcx
xorps %xmm0, %xmm0
movsd %xmm0, (%rax,%rcx,8)
movb -0x3d(%rbp), %al
addb $0x1, %al
movb %al, -0x3d(%rbp)
jmp 0x1dfda
movb $0x0, -0x3e(%rbp)
movsbl -0x3e(%rbp), %eax
movsbl -0x42(%rbp), %ecx
cmpl %ecx, %eax
jge 0x1e0bd
movb $0x0, -0x3d(%rbp)
movsbl -0x3d(%rbp), %eax
movsbl -0x42(%rbp), %ecx
cmpl %ecx, %eax
jge 0x1e0ae
movq -0x70(%rbp), %rax
movsbq -0x3d(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm0
movsd %xmm0, -0x1b0(%rbp)
movq -0xd8(%rbp), %rdi
movq -0xc8(%rbp), %rsi
movb -0x3d(%rbp), %dl
movb -0x3e(%rbp), %cl
movq (%rdi), %rax
movsbl %dl, %edx
movsbl %cl, %ecx
callq *0x18(%rax)
movaps %xmm0, %xmm2
movsd -0x1b0(%rbp), %xmm0
movq -0x80(%rbp), %rax
movslq -0x38(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x3c(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movsbq -0x3e(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm1
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, (%rax,%rcx,8)
movb -0x3d(%rbp), %al
addb $0x1, %al
movb %al, -0x3d(%rbp)
jmp 0x1e029
jmp 0x1e0b0
movb -0x3e(%rbp), %al
addb $0x1, %al
movb %al, -0x3e(%rbp)
jmp 0x1e015
jmp 0x1e1f1
movb $0x0, -0x3d(%rbp)
movsbl -0x3d(%rbp), %eax
movsbl -0x42(%rbp), %ecx
cmpl %ecx, %eax
jge 0x1e108
movq -0x80(%rbp), %rax
movslq -0x38(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x3c(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movsbq -0x3d(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm0
movq -0x70(%rbp), %rax
movsbq -0x3d(%rbp), %rcx
movsd %xmm0, (%rax,%rcx,8)
movb -0x3d(%rbp), %al
addb $0x1, %al
movb %al, -0x3d(%rbp)
jmp 0x1e0c6
movb $0x0, -0x3d(%rbp)
movsbl -0x3d(%rbp), %eax
movsbl -0x42(%rbp), %ecx
cmpl %ecx, %eax
jge 0x1e143
movq -0x80(%rbp), %rax
movslq -0x38(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x3c(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movsbq -0x3d(%rbp), %rcx
xorps %xmm0, %xmm0
movsd %xmm0, (%rax,%rcx,8)
movb -0x3d(%rbp), %al
addb $0x1, %al
movb %al, -0x3d(%rbp)
jmp 0x1e10c
movb $0x0, -0x3e(%rbp)
movsbl -0x3e(%rbp), %eax
movsbl -0x42(%rbp), %ecx
cmpl %ecx, %eax
jge 0x1e1ef
movb $0x0, -0x3d(%rbp)
movsbl -0x3d(%rbp), %eax
movsbl -0x42(%rbp), %ecx
cmpl %ecx, %eax
jge 0x1e1e0
movq -0x70(%rbp), %rax
movsbq -0x3d(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm0
movsd %xmm0, -0x1b8(%rbp)
movq -0xd8(%rbp), %rdi
movq -0xc8(%rbp), %rsi
movb -0x3d(%rbp), %dl
movb -0x3e(%rbp), %cl
movq (%rdi), %rax
movsbl %dl, %edx
movsbl %cl, %ecx
callq *0x18(%rax)
movaps %xmm0, %xmm2
movsd -0x1b8(%rbp), %xmm0
movq -0x80(%rbp), %rax
movslq -0x38(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x3c(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movsbq -0x3e(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm1
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, (%rax,%rcx,8)
movb -0x3d(%rbp), %al
addb $0x1, %al
movb %al, -0x3d(%rbp)
jmp 0x1e15b
jmp 0x1e1e2
movb -0x3e(%rbp), %al
addb $0x1, %al
movb %al, -0x3e(%rbp)
jmp 0x1e147
jmp 0x1e1f1
movq -0x80(%rbp), %rax
movslq -0x38(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x3c(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
movsbl -0x42(%rbp), %esi
callq 0x7980
movl -0x100(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x100(%rbp)
jmp 0x1de6c
cmpl $0x0, -0x5c(%rbp)
jle 0x1e310
cmpl $0x3, -0x5c(%rbp)
jne 0x1e30e
movl $0x0, -0x104(%rbp)
movl -0x104(%rbp), %eax
cmpl -0xe4(%rbp), %eax
jge 0x1e30c
movq -0xc0(%rbp), %rax
movq %rax, -0x1c8(%rbp)
movq -0x80(%rbp), %rax
movslq -0x38(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq -0xe0(%rbp), %rcx
movslq -0x104(%rbp), %rdx
movslq (%rcx,%rdx,4), %rcx
movq (%rax,%rcx,8), %rax
movsd (%rax), %xmm0
movsd %xmm0, -0x1c0(%rbp)
movl -0x104(%rbp), %eax
movl -0xe4(%rbp), %ecx
subl $0x1, %ecx
cmpl %ecx, %eax
jne 0x1e2c4
movl -0x104(%rbp), %eax
movl -0xe4(%rbp), %ecx
subl $0x1, %ecx
cmpl %ecx, %eax
jne 0x1e2c4
leaq 0x316ea(%rip), %rax     # 0x4f9a5
movq %rax, -0x1d0(%rbp)
jmp 0x1e2d4
leaq 0x329af(%rip), %rax     # 0x50c7a
movq %rax, -0x1d0(%rbp)
jmp 0x1e2d4
movsd -0x1c0(%rbp), %xmm0
movq -0x1c8(%rbp), %rdi
movq -0x1d0(%rbp), %rdx
leaq 0x32672(%rip), %rsi     # 0x50963
movb $0x1, %al
callq 0x5440
movl -0x104(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x104(%rbp)
jmp 0x1e240
jmp 0x1e30e
jmp 0x1e310
movsbl -0x41(%rbp), %eax
cvtsi2sd %eax, %xmm0
movq -0x68(%rbp), %rax
movslq -0x60(%rbp), %rcx
subsd (%rax,%rcx,8), %xmm0
movl $0x2, %edi
callq 0xf6b0
addsd -0x98(%rbp), %xmm0
movsd %xmm0, -0x98(%rbp)
movsbl -0x41(%rbp), %eax
cvtsi2sd %eax, %xmm0
movq -0x68(%rbp), %rax
movslq -0x60(%rbp), %rcx
subsd (%rax,%rcx,8), %xmm0
movl $0x2, %edi
callq 0xf6b0
addsd -0xa0(%rbp), %xmm0
movsd %xmm0, -0xa0(%rbp)
movsbl -0x41(%rbp), %eax
movl %eax, -0x1e4(%rbp)
movq -0x68(%rbp), %rax
movslq -0x60(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm0
movsd %xmm0, -0x1e0(%rbp)
movq -0x68(%rbp), %rdi
movsbl -0x43(%rbp), %esi
callq 0x9d80
movaps %xmm0, %xmm1
movsd -0x1e0(%rbp), %xmm0
xorl %eax, %eax
ucomisd %xmm1, %xmm0
movb %al, -0x1d1(%rbp)
jne 0x1e3df
jp 0x1e3df
movq -0x68(%rbp), %rax
movslq -0x60(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm0
movsbl -0x43(%rbp), %ecx
movl $0x1, %eax
cltd
idivl %ecx
cvtsi2sd %eax, %xmm1
ucomisd %xmm1, %xmm0
seta %al
movb %al, -0x1d1(%rbp)
movl -0x1e4(%rbp), %eax
movb -0x1d1(%rbp), %cl
andb $0x1, %cl
movzbl %cl, %ecx
cmpl %ecx, %eax
sete %al
andb $0x1, %al
movzbl %al, %eax
cvtsi2sd %eax, %xmm0
addsd -0xa8(%rbp), %xmm0
movsd %xmm0, -0xa8(%rbp)
movsbl -0x41(%rbp), %eax
movl %eax, -0x1f4(%rbp)
movq -0x68(%rbp), %rax
movslq -0x60(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm0
movsd %xmm0, -0x1f0(%rbp)
movq -0x68(%rbp), %rdi
movsbl -0x43(%rbp), %esi
callq 0x9d80
movaps %xmm0, %xmm1
movsd -0x1f0(%rbp), %xmm0
xorl %eax, %eax
ucomisd %xmm1, %xmm0
movb %al, -0x1e5(%rbp)
jne 0x1e480
jp 0x1e480
movq -0x68(%rbp), %rax
movslq -0x60(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm0
movsbl -0x43(%rbp), %ecx
movl $0x1, %eax
cltd
idivl %ecx
cvtsi2sd %eax, %xmm1
ucomisd %xmm1, %xmm0
seta %al
movb %al, -0x1e5(%rbp)
movl -0x1f4(%rbp), %eax
movb -0x1e5(%rbp), %cl
andb $0x1, %cl
movzbl %cl, %ecx
cmpl %ecx, %eax
sete %al
andb $0x1, %al
movzbl %al, %eax
cvtsi2sd %eax, %xmm0
addsd -0xb0(%rbp), %xmm0
movsd %xmm0, -0xb0(%rbp)
movq -0x68(%rbp), %rax
movslq -0x60(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm0
callq 0x99d0
movsd %xmm0, -0xb8(%rbp)
movsd -0xb8(%rbp), %xmm0
callq 0x9ae0
movsd %xmm0, -0x218(%rbp)
movsbl -0x41(%rbp), %eax
cvtsi2sd %eax, %xmm0
movsd %xmm0, -0x210(%rbp)
movsd 0x31511(%rip), %xmm0    # 0x4fa08
subsd -0xb8(%rbp), %xmm0
callq 0x9ae0
movsd -0x218(%rbp), %xmm1
movsd -0x210(%rbp), %xmm2
movsbl -0x41(%rbp), %ecx
movl $0x1, %eax
subl %ecx, %eax
cvtsi2sd %eax, %xmm3
mulsd %xmm3, %xmm0
mulsd %xmm2, %xmm1
addsd %xmm0, %xmm1
movsd -0x88(%rbp), %xmm0
subsd %xmm1, %xmm0
movsd %xmm0, -0x88(%rbp)
movsd -0xb8(%rbp), %xmm0
callq 0x9ae0
movsd %xmm0, -0x208(%rbp)
movsbl -0x41(%rbp), %eax
cvtsi2sd %eax, %xmm0
movsd %xmm0, -0x200(%rbp)
movsd 0x31498(%rip), %xmm0    # 0x4fa08
subsd -0xb8(%rbp), %xmm0
callq 0x9ae0
movsd -0x208(%rbp), %xmm1
movsd -0x200(%rbp), %xmm2
movsbl -0x41(%rbp), %ecx
movl $0x1, %eax
subl %ecx, %eax
cvtsi2sd %eax, %xmm3
mulsd %xmm3, %xmm0
mulsd %xmm2, %xmm1
addsd %xmm0, %xmm1
movsd -0x90(%rbp), %xmm0
subsd %xmm1, %xmm0
movsd %xmm0, -0x90(%rbp)
movl -0x34(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x34(%rbp)
jmp 0x1d7a1
movq -0xc8(%rbp), %rax
movq %rax, -0x220(%rbp)
cmpq $0x0, %rax
je 0x1e5ef
movq -0x220(%rbp), %rdi
movl $0x60, %esi
callq 0x52e0
movq -0x68(%rbp), %rdi
callq 0x5380
movq -0x70(%rbp), %rdi
callq 0x5380
movq -0x80(%rbp), %rdi
movl -0x4c(%rbp), %esi
movl -0x48(%rbp), %edx
callq 0x11290
movsd -0x98(%rbp), %xmm0
cvtsi2sdl -0x50(%rbp), %xmm1
divsd %xmm1, %xmm0
callq 0x5220
movsd %xmm0, -0x98(%rbp)
movsd -0xa0(%rbp), %xmm0
movl -0x50(%rbp), %eax
subl -0x54(%rbp), %eax
cvtsi2sd %eax, %xmm1
divsd %xmm1, %xmm0
callq 0x5220
movsd %xmm0, -0xa0(%rbp)
cmpq $0x0, -0x8(%rbp)
je 0x1e6d4
movsd -0x88(%rbp), %xmm0
movq -0x8(%rbp), %rax
movsd %xmm0, (%rax)
movsd -0x90(%rbp), %xmm0
movq -0x8(%rbp), %rax
movsd %xmm0, 0x8(%rax)
movsd -0x98(%rbp), %xmm0
movq -0x8(%rbp), %rax
movsd %xmm0, 0x10(%rax)
movsd -0xa0(%rbp), %xmm0
movq -0x8(%rbp), %rax
movsd %xmm0, 0x18(%rax)
movsd -0xa8(%rbp), %xmm0
cvtsi2sdl -0x50(%rbp), %xmm1
divsd %xmm1, %xmm0
movq -0x8(%rbp), %rax
movsd %xmm0, 0x20(%rax)
movsd -0xb0(%rbp), %xmm0
movl -0x50(%rbp), %eax
subl -0x54(%rbp), %eax
cvtsi2sd %eax, %xmm1
divsd %xmm1, %xmm0
movq -0x8(%rbp), %rax
movsd %xmm0, 0x28(%rax)
cmpl $0x0, -0x5c(%rbp)
jle 0x1e6e6
movq -0xc0(%rbp), %rdi
callq 0x52c0
addq $0x220, %rsp            # imm = 0x220
popq %rbp
retq
nop