// File: /workspace/github_c_makefile_star2_O1/ugobas[P]tnm/confchange.c
// Function: Examine_confchange
float Examine_confchange(struct Tors *Diff,
			 struct bond *bonds, struct axe *axe,
			 struct chain *chains, int Nchain,
			 char *namesumm, char *name1, char *namepdb,
			 atom *atoms1, float *coord_1,
			 struct residue *seq1, int nres1,
			 int N_diso1, int natoms1,
			 atom *atoms2, float *coord_2,
			 struct residue *seq2, int nres2,
			 int N_diso2, int natoms2,
			 struct Reference Ref1, //struct Jacobian *J,
			 struct ali_atoms ali_a,
			 struct interaction *Int_list1, int N_int1,
			 char *INT_TYPE, float s0,
			 int N_modes,  struct Normal_Mode NM,
			 int nprint, struct Ali_score ali, 
			 struct Para_simul Para_simul,
			 //float *diff_phi, float *greedy_phi,
			 int nstruct, float *B_TNM,
			 int *outlier_tors,
			 char *nameout, int PRINT_CHANGE,
			 int anharmonic)
// nstruct = 0 if experimental confchange, = k if simulated structures
{
  char namenew[100]; float *sigma2;
  if(anharmonic==0){
    sprintf(namenew, "%s", nameout);
    sigma2=NM.sigma2;
  }else{
    sprintf(namenew, "%s.anharmonic", nameout);
    sigma2=NM.sigma2_anhar;
  }

  /*
  // Prepare reference atoms
  printf("Preparing to examine conformation change\n");
  if(nstruct==0){
    // Set reference atoms
    Set_reference(&Ref1, 0, "EB", atoms1, 0, natoms1);
    Align_references(Ref1, atoms1);
  }else if(Ref1.atom_num==NULL){
    Set_reference(&Ref1, 0, "EB", atoms1, 0, natoms1);
  }
  // Compute RMSD
  int N_Cart=Ref1.N_Cart; float coord_1[N_Cart], coord_2[N_Cart];
  Write_ref_coord_atom(coord_1, Ref1.N_ref, atoms1, Ref1.atom_num);
  Write_ref_coord_atom(coord_2, Ref1.N_ref, atoms2, Ref2.atom_num);
  */

  int N_Cart=ali_a.N_Cart, i;
  float rmsd=rmsd_mclachlan_f(coord_1, coord_2, ali_a.mass, ali_a.N_ref);
  for (i=0;i<N_Cart;i++)Diff->Cart[i]=coord_2[i]-coord_1[i];

  printf("Examining confchange, RMSD= %.2f\n", rmsd);
  printf("Changing reference atoms from %d (kin) to %d (CC)\n",
	 Ref1.N_Cart/3, ali_a.N_ref);

  // Jacobian matrix
  int naxe=NM.N_axes;
  if(J_CC==NULL){
    J_CC=malloc(1*sizeof(struct Jacobian));
    Allocate_Jacobian(J_CC, naxe, Ref1.N_Cart);
    int first_kin[naxe], last_kin[naxe];
    Change_kin(first_kin, last_kin, axe, naxe, natoms1, Ref1);
    J_CC->N_kin=Compute_kinetic(J_CC, axe, naxe, atoms1, natoms1,Ref1,1);
    Change_kin_back(axe, naxe, first_kin, last_kin);
  }
  // Mass modes
  int MMASS=0;
  if(anharmonic==0){
    Allocate_Normal_modes(&NM_kin, NM.N, NM.N_axes, NM.N_Cart);
    d_Diagonalize(NM.N_axes, J_CC->T, NM_kin.omega2, NM_kin.Tors, 1);
    FILE *file_mode=NULL;
    if(MMASS){
      char out[100]; sprintf(out, "%s.mass_modes.dat", nameout);
      file_mode=fopen(out, "w"); printf("Writing %s\n", out);
      fprintf(file_mode,"# Eigenvectors of the mass matrix\n");
      fprintf(file_mode,"# n 1/<K> Coll_cart Coll_tors most_sim_nor_mod c2\n");
    }
    for(i=0; i<NM.N; i++){
      NM_kin.select[i]=1;
      NM_kin.sigma2[i]=NM_kin.omega2[i];
      NM_kin.omega[i]=1./sqrt(NM_kin.omega2[i]);
      // Normalize so that Tors is orthonormal wrt kinetic energy
      float norm=NM_kin.omega[i], *mode=NM_kin.Tors[i];
      for(int a=0; a<naxe; a++)mode[a]*=norm;
      Compute_MW(NM_kin.MW_Tors[i], NM_kin.Tors[i], J_CC);
      Convert_torsion2cart(NM_kin.Cart[i], atoms1, NM_kin.Tors[i],
			   axe, naxe, Ref1, i);
      NM_kin.Tors_coll[i]=Collectivity_norm2(NM_kin.Tors[i], naxe)/naxe ;
      NM_kin.MW_Tors_coll[i]=Collectivity_norm2(NM_kin.MW_Tors[i],naxe)/naxe;
      NM_kin.Cart_coll[i]=
	Collectivity_norm2(NM_kin.Cart[i], NM_kin.N_Cart)/N_Cart;
      //Predict_fluctuations(&NM_kin, NM_kin.sigma2);
      if(MMASS){
	double cmax=0, c; int imax=0, j; float *mode=NM_kin.Tors[i];
	double sigma2=0;
	for(j=0; j<NM.N; j++){
	  c=Scalar_product(mode, NM.Tors[j], NM.N_axes); c*=c;
	  sigma2+=c*NM.omega2[j];
	  if(c>cmax){cmax=c; imax=j;}
	} 
	NM_kin.sigma2[i]=1./(sigma2*NM_kin.omega2[i]*NM_kin.omega2[i]);
	if(NM_kin.Cart_coll[i]<0.01)NM_kin.sigma2[i]=0.1;
	fprintf(file_mode, "%d\t%.3g\t%.3f\t%.3f\t%d\t%.3g\n",
		i,NM_kin.sigma2[i],NM_kin.Cart_coll[i],NM_kin.Tors_coll[i],
		imax,cmax);
      }
    }
    if(MMASS)fclose(file_mode);
  }


  // Open file for printing, one chain
  FILE *file_out;
  if(nprint){
    file_out=fopen(namesumm, "a");
  }else{
    file_out=fopen(namesumm, "w");
    printf("Writing %s\n", namesumm);
    if(anharmonic==0){
      fprintf(file_out, "protein               %s\n", name1);
      fprintf(file_out, "Nres                  %d\n", nres1);
      fprintf(file_out, "Degrees of freedom    %d\n", N_modes);
      fprintf(file_out, "Disordered gaps       %d\n", N_diso1);
      fprintf(file_out, "#\n");
    }
  }

  // Printing sequence comparison
  if((nstruct==0)&&(anharmonic==0)){
    fprintf(file_out, "# Conformation change\n");
    fprintf(file_out, "seq_id(percent)       %.1f\n", ali.seq_id);
    fprintf(file_out, "align                 %.3f\n", ali.aligned);
    fprintf(file_out, "ngaps                 %d\n", ali.ngaps);
    if(ali.mammoth){
      fprintf(file_out,"psi                   %.1f\n", ali.psi);
      fprintf(file_out,"Mammoth score         %.1f\n", ali.mamm_score);
    }
  }

  // Contact matrix and contact energy
  int N_int2=0; struct interaction *Int_list2;
  Compute_interactions(&N_int2, &Int_list2, INT_TYPE,
		       atoms2, natoms2, nres2, namenew);
  float Cont_overlap=
    Contact_overlap(Int_list1, N_int1, Int_list2, N_int2, ali.alignres);
  float E1=Contact_energy(Int_list1, N_int1, seq1);
  float E2=Contact_energy(Int_list2, N_int2, seq2);
  float DE=E2-E1-(nres1-nres2)*s0;
  free(Int_list2);

  // Printing properties of conformation change
  if(nstruct){
    fprintf(file_out, "Structure             %d\n", nstruct);
  }else if(anharmonic==0){
    fprintf(file_out, "Disordered axis2      %d\n", N_diso2);
  }
  if(anharmonic==0){
    fprintf(file_out, "Contact_overlap       %.3f\n", Cont_overlap);
    fprintf(file_out, "(ECont2-ECont1)       %.3f\n", DE);
    // float rmsd=
    //Torsional_superimposition(atom_str1,atom_str2,NM.N_axes,Ref,J);
    fprintf(file_out, "RMSD %s atoms:      %.2f\n", REF, rmsd);
  }

  if(B_TNM){
    // Compute correlation between Cartesian displacements and conf. change
    float dx2[nres1];
    int n=Select_cc2(dx2, nres1, Diff->Cart, atoms1, Ref1, "CA");
    if(n){
      float slope, off, r=Corr_coeff(B_TNM, dx2, n, &slope, &off);
      fprintf(file_out, "r(therm,change)_Cart_");
      if(anharmonic){fprintf(file_out, "anhar");}
      else{fprintf(file_out, "har  ");}
      fprintf(file_out, " %.3f\n",r);
    }
  }

  /************************* Torsional fits ****************************/
  char name_pdb[100];
  if(nstruct==0){
    sprintf(name_pdb, "%s.Confchange.pdb", nameout);
    FILE *file_pdb=fopen(name_pdb, "w"); fclose(file_pdb); 
  }

  float Lambda=0; //thr=Para_confchange.RMSD_THR, 
  double M_tot=0, M_sqrt;
  for(i=0; i<Ref1.N_Cart; i+=3)M_tot+=Ref1.mass_coord[i];
  M_sqrt=sqrt(M_tot);

  // Different methods to obtain diff_phi
  int max_dphi=5; int istore=2, jstore=-1; // select RRR Cv
  if((nstruct)||(PRINT_CHANGE==0))max_dphi=4; // Do not generate confchange
  int num_dphi=0;
  float *diff_angles[max_dphi], *MW_diff_angles[max_dphi], *c2_alpha[max_dphi];
  char *name_dphi[max_dphi], name[80];
  float coeff[NM.N]; 

  double dphi[naxe]; for(i=0; i<naxe; i++)dphi[i]=Diff->Tors[i];
  for(int i_dphi=0; i_dphi<max_dphi; i_dphi++){ //

    if(nstruct)continue; 
    if((ALL_TYPES==0)&&((i_dphi==0)||(i_dphi==3)))continue;

    if(i_dphi==1){
      continue;
      /*sprintf(name, "Lasso regression");
      Lasso_confchange_fit(Diff, &NM, bonds, atoms1, natoms1, Ref1,
      coord_1, coord_2, name1);*/
      sprintf(name, "Modes fit"); 
      int type=0; // rank by frequency (0) or by overlap (1)?
      int NMODES=10; //10;
      printf("Lasso regression of torsion angle changes\n");
      Mode_confchange_fit(Diff, &NM, bonds, atoms1, natoms1, Ref1, seq1,
			  coord_1, coord_2, M_sqrt, name1, name_pdb,
			  type, NMODES);
      continue;
    }else if(i_dphi<3){
      char type='X'; // Rescaled ridge regression fits
      if(i_dphi==0){type='O';} // Ordinary least squares
      else if(i_dphi==1){type='M'; continue;} // Substituted with Lasso
      else if(i_dphi==2){type='C';}
      sprintf(name, "Fit");
      if(i_dphi)strcat(name, " RRR");
      char tmp[40];
      sprintf(tmp, " type %c", type); strcat(name, tmp);
      printf("Ridge regression type %c of torsion angle changes\n",type);
      if(Convert_cart2torsion_fit(Diff, Ref1, J_CC, name1, type, &Lambda)<0){
	fprintf(file_out, "WARNING, ridge regression has failed\n");
	printf("WARNING, ridge regression has failed\n"); continue;
      }

    }else if(i_dphi==3){
      // Difference of internal coordinates
      sprintf(name, "Differences of torsion angles different bonds");
      struct bond *bonds2=Set_bonds_topology(natoms2, atoms2, seq2);
      Set_bonds_measure(bonds, natoms1, atoms1);
      Set_bonds_measure(bonds2,natoms2, atoms2);
      Change_internal(dphi, naxe, bonds, bonds2, natoms1, 0, 0);
      free(bonds2);
    }else  if(i_dphi==4){
      fflush(file_out);
      printf("Interpolating torsional conformation change\n");
      sprintf(name, "Differences of torsion angles, iterative");
      double nbtops = CLOCKS_PER_SEC, t0=clock();       // time
      // Torsional_confchange_RRR
      int NMODES=NM.N; if(NMODES>NM.N)NMODES=NM.N;
      struct Normal_Mode *Modes; char mode_name[20];
      float cc_thr=0.0; // Filter modes contributing < cc_thr A
      if(1||MMASS==0){Modes=&NM; strcpy(mode_name, "normal");}
      else{Modes=&NM_kin; strcpy(mode_name, "mass");}
      Torsional_confchange(dphi, "greedy", bonds, J_CC, Ref1, ali_a,
			   0.1, atoms1, natoms1, namenew, axe, naxe,seq1,
			   nres1, chains, Nchain, atoms2, natoms2, 
			   Para_simul, Modes, mode_name, NMODES, cc_thr);
      printf("\nMaking conformation change. Time= %.2lf sec.\n",
	     (clock()-t0)/nbtops); t0=clock();
    }
    fprintf(file_out, "### Projection on normal modes");
    Print_diff(&num_dphi, name_dphi, diff_angles, MW_diff_angles, c2_alpha,
	       outlier_tors, Diff, J_CC, &NM, M_sqrt,
	       bonds, atoms1, natoms1, Ref1, coord_1, coord_2,
	       seq1, axe, nstruct, name, file_out, name_pdb,
	       anharmonic, nameout, 0);
    if(MMASS && anharmonic==0){
      fprintf(file_out, "### Projection on mass modes");
      Print_diff(&num_dphi, name_dphi, diff_angles, MW_diff_angles, c2_alpha,
		 outlier_tors, Diff, J_CC, &NM_kin, M_sqrt,
		 bonds, atoms1, natoms1, Ref1, coord_1, coord_2,
		 seq1, axe, nstruct, name, file_out, name_pdb,
		 anharmonic, nameout, 1);
    }
    if(i_dphi==istore){
      jstore=num_dphi-1;
      for(i=0; i<NM.N; i++)coeff[i]=Diff->coeff[i];
    }

  }
  fclose(file_out);

  if(jstore>=0){
    printf("Storing confchange method %s\n", name_dphi[jstore]);
    for(i=0; i<NM.N; i++){
      Diff->coeff[i]=coeff[i];
      NM.confchange2[i]=c2_alpha[jstore][i];
    }
    for(i=0; i<naxe; i++)Diff->Tors[i]=diff_angles[jstore][i];

  }

  if(nstruct==0){

    // Print list of angles and correlations with normal modes
    if(nameout && num_dphi>1){
      /*Print_angular_differences(diff_angles, "", name_dphi, num_dphi,
				namenew, axe, NM.N_axes, seq1);
      Print_angular_differences(MW_diff_angles, "MW", name_dphi, num_dphi,
      namenew, axe, NM.N_axes, seq1);*/
      
      char nameout2[200]; int a;
      sprintf(nameout2, "%s.Mode_projections.dat", namenew);
      printf("Writing mode projections in %s\n", nameout2);
      file_out=fopen(nameout2, "w");
      fprintf(file_out, "# %d modes %d methods for deriving angles\n",
	      NM.N, num_dphi);
      for(i=0; i<num_dphi; i++)
	fprintf(file_out, "# Method %d: %s\n", i+1, name_dphi[i]);
      fprintf(file_out, "#mode ");
      for(i=0; i<num_dphi; i++)fprintf(file_out, " %d=dphi%d", i+2, i+1);
      fprintf(file_out, " %d=1/omega^2", i+2);
      if(anharmonic==0)fprintf(file_out, " %d=mass^2", i+3);
      fprintf(file_out, "\n");
      for(a=0; a<NM.N; a++){
	fprintf(file_out, "%d", a);
	for(i=0; i<num_dphi; i++)fprintf(file_out, "\t%.5f", c2_alpha[i][a]);
	fprintf(file_out, "\t%.3g", sigma2[a]);
	if(anharmonic==0)fprintf(file_out, "\t%.3g", NM_kin.sigma2[a]);
	fprintf(file_out, "\n");
      }
      fclose(file_out);
    }

    for(i=0; i<num_dphi; i++){
      free(c2_alpha[i]);
      free(diff_angles[i]);
      free(MW_diff_angles[i]); //modyves: was never freed
      free(name_dphi[i]);
    }
  }

  Empty_Jacobian(*J_CC);
  // should probably not depend on nstruct==0, since alloc doesn't
  free(J_CC); J_CC=NULL;
  if(anharmonic)Empty_Normal_modes(NM_kin);

  return(rmsd);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x2a8, %rsp            # imm = 0x2A8
movss %xmm0, -0x68(%rbp)
movl %r8d, -0x88(%rbp)
movq %rcx, -0xb0(%rbp)
movq %rsi, %r15
movq %rdi, -0x40(%rbp)
movq 0x248(%rbp), %rax
leaq 0xf0(%rbp), %rbx
leaq 0xb0(%rbp), %r12
cmpl $0x0, 0x258(%rbp)
movq %rdx, -0x60(%rbp)
movq %r9, -0x48(%rbp)
je 0x2c673
leaq 0x2cf49(%rip), %rsi     # 0x595a4
leaq -0x190(%rbp), %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0x2260
movl $0x88, %eax
jmp 0x2c687
leaq -0x190(%rbp), %rdi
movq %rax, %rsi
callq 0x2080
movl $0x28, %eax
movq %r15, -0x80(%rbp)
movq (%rbx,%rax), %rax
movq %rax, -0xc0(%rbp)
movslq 0x1c(%r12), %r13
movq 0x10(%r12), %rdx
movl 0x18(%r12), %ecx
movq 0x28(%rbp), %r14
movq %r14, %rdi
movq 0x58(%rbp), %r15
movq %r15, %rsi
callq 0x4e010
cvtsd2ss %xmm0, %xmm1
testq %r13, %r13
jle 0x2c6e4
movq -0x40(%rbp), %rax
movq 0x8(%rax), %rax
xorl %ecx, %ecx
movss (%r15,%rcx,4), %xmm0
subss (%r14,%rcx,4), %xmm0
movss %xmm0, (%rax,%rcx,4)
incq %rcx
cmpq %rcx, %r13
jne 0x2c6cb
movss %xmm1, -0x84(%rbp)
xorps %xmm0, %xmm0
cvtss2sd %xmm1, %xmm0
leaq 0x2d64a(%rip), %rdi     # 0x59d44
movsd %xmm0, -0x78(%rbp)
movb $0x1, %al
callq 0x20f0
leaq 0x80(%rbp), %rax
movslq 0x4(%rax), %rax
imulq $0x55555556, %rax, %rsi # imm = 0x55555556
movq %rsi, %rax
shrq $0x3f, %rax
shrq $0x20, %rsi
addl %eax, %esi
movl 0x18(%r12), %edx
leaq 0x2d635(%rip), %rdi     # 0x59d66
xorl %eax, %eax
callq 0x20f0
movl 0x8(%rbx), %ebx
cmpq $0x0, 0x4ccd5(%rip)     # 0x79418
jne 0x2c82d
movl $0x48, %edi
callq 0x21d0
movq %rax, 0x4ccbe(%rip)     # 0x79418
leaq 0x80(%rbp), %r14
movl 0x4(%r14), %edx
movq %rax, %rdi
movl %ebx, %esi
callq 0x2382e
movq %rsp, -0x38(%rbp)
movq %rsp, %r15
leaq 0xf(,%rbx,4), %rax
andq $-0x10, %rax
subq %rax, %r15
movq %r15, %rsp
movq %rsp, %r12
subq %rax, %r12
movq %r12, %rsp
subq $0x30, %rsp
movups (%r14), %xmm0
movups 0x10(%r14), %xmm1
movups 0x20(%r14), %xmm2
movups %xmm2, 0x20(%rsp)
movups %xmm1, 0x10(%rsp)
movups %xmm0, (%rsp)
movq %r15, %rdi
movq %r12, %rsi
movq -0x60(%rbp), %rdx
movl %ebx, %ecx
movl 0x48(%rbp), %r8d
callq 0x389ee
addq $0x30, %rsp
movq 0x4cc47(%rip), %rdi     # 0x79418
subq $0x30, %rsp
movups (%r14), %xmm0
movups 0x10(%r14), %xmm1
movups 0x20(%r14), %xmm2
movups %xmm2, 0x20(%rsp)
movups %xmm1, 0x10(%rsp)
movups %xmm0, (%rsp)
movq -0x60(%rbp), %rsi
movl %ebx, %edx
movq 0x20(%rbp), %rcx
movl 0x48(%rbp), %r8d
movl $0x1, %r9d
callq 0x20fb0
addq $0x30, %rsp
movq 0x4cc03(%rip), %rcx     # 0x79418
movl %eax, 0x8(%rcx)
movq -0x60(%rbp), %rdi
movl %ebx, %esi
movq %r15, %rdx
movq %r12, %rcx
callq 0x389c4
movq -0x38(%rbp), %rsp
movl 0x1c0(%rbp), %r12d
cmpl $0x0, 0x258(%rbp)
jne 0x2ca2c
leaq 0xf0(%rbp), %r14
movl (%r14), %esi
movl 0x8(%r14), %edx
movl 0xc(%r14), %ecx
leaq 0x4cbc6(%rip), %rdi     # 0x79420
callq 0x23bd0
movl 0x8(%r14), %edi
movq 0x4cbae(%rip), %rax     # 0x79418
movq 0x20(%rax), %rsi
movq 0x4cbcb(%rip), %rdx     # 0x79440
movq 0x4cbe4(%rip), %rcx     # 0x79460
movl $0x1, %r8d
callq 0x4a4d2
cmpl $0x0, (%r14)
movq -0x60(%rbp), %r14
jle 0x2ca2c
xorps %xmm0, %xmm0
cvtsi2ss %ebx, %xmm0
movss %xmm0, -0x38(%rbp)
xorps %xmm0, %xmm0
cvtsi2ss %r13d, %xmm0
movss %xmm0, -0x50(%rbp)
xorl %r15d, %r15d
movq 0x4cc28(%rip), %rax     # 0x794e0
movl $0x1, (%rax,%r15,4)
movq 0x4cb79(%rip), %rax     # 0x79440
movss (%rax,%r15,4), %xmm0
movq 0x4cb74(%rip), %rcx     # 0x79448
movss %xmm0, (%rcx,%r15,4)
xorps %xmm0, %xmm0
cvtss2sd (%rax,%r15,4), %xmm0
ucomisd 0x24775(%rip), %xmm0    # 0x51060
jb 0x2c8f3
sqrtsd %xmm0, %xmm0
jmp 0x2c8f8
callq 0x2290
movsd 0x24740(%rip), %xmm1    # 0x51040
divsd %xmm0, %xmm1
xorps %xmm0, %xmm0
cvtsd2ss %xmm1, %xmm0
movq 0x4cb26(%rip), %rax     # 0x79438
movss %xmm0, (%rax,%r15,4)
movq 0x4cb41(%rip), %rax     # 0x79460
movq (%rax,%r15,8), %rsi
testl %ebx, %ebx
jle 0x2c93f
xorl %eax, %eax
movss (%rsi,%rax,4), %xmm1
mulss %xmm0, %xmm1
movss %xmm1, (%rsi,%rax,4)
incq %rax
cmpq %rax, %rbx
jne 0x2c929
movq 0x4cb22(%rip), %rax     # 0x79468
movq (%rax,%r15,8), %rdi
movq 0x4cac7(%rip), %rdx     # 0x79418
callq 0x26a1c
movq 0x4cafb(%rip), %rax     # 0x79458
movq (%rax,%r15,8), %rdi
movq 0x4caf8(%rip), %rax     # 0x79460
movq (%rax,%r15,8), %rdx
subq $0x30, %rsp
leaq 0x80(%rbp), %rax
movups (%rax), %xmm0
movups 0x10(%rax), %xmm1
movups 0x20(%rax), %xmm2
movups %xmm2, 0x20(%rsp)
movups %xmm1, 0x10(%rsp)
movups %xmm0, (%rsp)
movq 0x20(%rbp), %rsi
movq %r14, %rcx
movl %ebx, %r8d
movl %r15d, %r9d
callq 0x2607f
addq $0x30, %rsp
movq 0x4cab3(%rip), %rax     # 0x79460
movq (%rax,%r15,8), %rdi
movl %ebx, %esi
callq 0x110b6
divss -0x38(%rbp), %xmm0
movq 0x4cacc(%rip), %rax     # 0x79490
movss %xmm0, (%rax,%r15,4)
movq 0x4ca97(%rip), %rax     # 0x79468
movq (%rax,%r15,8), %rdi
movl %ebx, %esi
callq 0x110b6
divss -0x38(%rbp), %xmm0
movq 0x4cab0(%rip), %rax     # 0x79498
movss %xmm0, (%rax,%r15,4)
movq 0x4ca63(%rip), %rax     # 0x79458
movq (%rax,%r15,8), %rdi
movl 0x4ca2d(%rip), %esi     # 0x7942c
callq 0x110b6
divss -0x50(%rbp), %xmm0
movq 0x4ca78(%rip), %rax     # 0x79488
movss %xmm0, (%rax,%r15,4)
incq %r15
leaq 0xf0(%rbp), %rax
movslq (%rax), %rax
cmpq %rax, %r15
jl 0x2c8b1
testl %r12d, %r12d
je 0x2ca4a
leaq 0x2d17f(%rip), %rsi     # 0x59bb7
movq -0x48(%rbp), %rdi
callq 0x2210
movq %rax, -0x30(%rbp)
jmp 0x2caf3
leaq 0x2a7ef(%rip), %rsi     # 0x57240
movq -0x48(%rbp), %r14
movq %r14, %rdi
callq 0x2210
movq %rax, %r12
leaq 0x25274(%rip), %rdi     # 0x51cdb
movq %r14, %rsi
xorl %eax, %eax
callq 0x20f0
cmpl $0x0, 0x258(%rbp)
movq %r12, -0x30(%rbp)
jne 0x2caf3
movl 0xe8(%rbp), %r15d
movl 0x40(%rbp), %r14d
leaq 0x254ac(%rip), %rsi     # 0x51f3c
movq %r12, %rdi
movq 0x10(%rbp), %rdx
xorl %eax, %eax
callq 0x2190
leaq 0x254cb(%rip), %rsi     # 0x51f70
movq %r12, %rdi
movl 0x38(%rbp), %edx
xorl %eax, %eax
callq 0x2190
leaq 0x254ed(%rip), %rsi     # 0x51fa6
movq %r12, %rdi
movl %r15d, %edx
xorl %eax, %eax
callq 0x2190
leaq 0x2558f(%rip), %rsi     # 0x5205c
movq %r12, %rdi
movl %r14d, %edx
xorl %eax, %eax
callq 0x2190
leaq 0x2fad6(%rip), %rdi     # 0x5c5b7
movl $0x2, %esi
movl $0x1, %edx
movq %r12, %rcx
callq 0x2280
leaq 0x1c8(%rbp), %r12
movq 0xe0(%rbp), %rdx
movq 0xd0(%rbp), %r13
movl 0x258(%rbp), %eax
orl 0x230(%rbp), %eax
jne 0x2cbcd
leaq 0x2d278(%rip), %rdi     # 0x59d99
movl $0x16, %esi
movq %rdx, %r15
movl $0x1, %edx
movq -0x30(%rbp), %r14
movq %r14, %rcx
callq 0x2280
xorps %xmm0, %xmm0
cvtss2sd (%r12), %xmm0
leaq 0x2d266(%rip), %rsi     # 0x59db0
movq %r14, %rdi
movb $0x1, %al
callq 0x2190
xorps %xmm0, %xmm0
cvtss2sd 0x4(%r12), %xmm0
leaq 0x2d267(%rip), %rsi     # 0x59dcc
movq %r14, %rdi
movb $0x1, %al
callq 0x2190
movl 0x10(%r12), %edx
leaq 0x2d26d(%rip), %rsi     # 0x59de8
movq %r14, %rdi
xorl %eax, %eax
callq 0x2190
movq %r15, %rdx
cmpl $0x0, 0x20(%r12)
je 0x2cbcd
xorps %xmm0, %xmm0
cvtss2sd 0x8(%r12), %xmm0
leaq 0x2d261(%rip), %rsi     # 0x59e02
movq -0x30(%rbp), %r14
movq %r14, %rdi
movb $0x1, %al
callq 0x2190
xorps %xmm0, %xmm0
cvtss2sd 0xc(%r12), %xmm0
leaq 0x2d25e(%rip), %rsi     # 0x59e1e
movq %r14, %rdi
movb $0x1, %al
callq 0x2190
movq %r15, %rdx
leaq -0xc4(%rbp), %r14
movl $0x0, (%r14)
subq $0x8, %rsp
leaq -0x190(%rbp), %rax
leaq -0x128(%rbp), %r15
movq %r14, %rdi
movq %r15, %rsi
movq 0x50(%rbp), %rcx
movl 0x78(%rbp), %r8d
movl 0x68(%rbp), %r9d
pushq %rax
callq 0x17020
addq $0x10, %rsp
movq (%r15), %rdx
movl (%r14), %ecx
movq 0x18(%r12), %r8
movq %r13, %rdi
movl 0xd8(%rbp), %r12d
movl %r12d, %esi
callq 0x1f7bc
movss %xmm0, -0x50(%rbp)
movq %r13, %rdi
movl %r12d, %esi
movq 0x30(%rbp), %rdx
callq 0x1face
movss %xmm0, -0x48(%rbp)
movq (%r15), %rdi
movl (%r14), %esi
movq 0x60(%rbp), %rdx
callq 0x1face
movss %xmm0, -0x38(%rbp)
movq (%r15), %rdi
callq 0x2050
movl 0x230(%rbp), %r13d
testl %r13d, %r13d
je 0x2cd0e
leaq 0x2d1c8(%rip), %rsi     # 0x59e3a
movq -0x30(%rbp), %rdi
movl %r13d, %edx
xorl %eax, %eax
callq 0x2190
leaq 0x80(%rbp), %r12
cmpl $0x0, 0x258(%rbp)
jne 0x2cd22
movl 0x38(%rbp), %eax
subl 0x68(%rbp), %eax
xorps %xmm0, %xmm0
cvtsi2ss %eax, %xmm0
movss -0x38(%rbp), %xmm1
subss -0x48(%rbp), %xmm1
mulss -0x68(%rbp), %xmm0
subss %xmm0, %xmm1
movss %xmm1, -0x38(%rbp)
xorps %xmm0, %xmm0
cvtss2sd -0x50(%rbp), %xmm0
leaq 0x2d1a6(%rip), %rsi     # 0x59e6e
movq -0x30(%rbp), %r14
movq %r14, %rdi
movb $0x1, %al
callq 0x2190
xorps %xmm0, %xmm0
cvtss2sd -0x38(%rbp), %xmm0
leaq 0x2d1a5(%rip), %rsi     # 0x59e8a
movq %r14, %rdi
movb $0x1, %al
callq 0x2190
leaq 0x2d1b0(%rip), %rsi     # 0x59ea6
leaq 0x3c433(%rip), %rdx     # 0x69130
movq %r14, %rdi
movsd -0x78(%rbp), %xmm0
movb $0x1, %al
callq 0x2190
jmp 0x2cd22
cmpl $0x0, 0x258(%rbp)
leaq 0x80(%rbp), %r12
je 0x2d870
cmpq $0x0, 0x238(%rbp)
movq 0x20(%rbp), %rcx
je 0x2ce1f
movq %rsp, %r15
movl 0x38(%rbp), %esi
movl %esi, %eax
movq %rsp, %r14
leaq 0xf(,%rax,4), %rax
andq $-0x10, %rax
subq %rax, %r14
movq %r14, %rsp
movq -0x40(%rbp), %rax
movq 0x8(%rax), %rdx
subq $0x30, %rsp
movups (%r12), %xmm0
movups 0x10(%r12), %xmm1
movups 0x20(%r12), %xmm2
movups %xmm2, 0x20(%rsp)
movups %xmm1, 0x10(%rsp)
movups %xmm0, (%rsp)
leaq 0x283e7(%rip), %r8      # 0x5516a
movq %r14, %rdi
callq 0x2d88a
addq $0x30, %rsp
testl %eax, %eax
je 0x2ce1c
leaq -0x260(%rbp), %rcx
leaq -0x2d0(%rbp), %r8
movq 0x238(%rbp), %rdi
movq %r14, %rsi
movl %eax, %edx
callq 0x10d91
movss %xmm0, -0x38(%rbp)
leaq 0x2d0fe(%rip), %rdi     # 0x59ec0
movl $0x15, %esi
movl $0x1, %edx
movq -0x30(%rbp), %r14
movq %r14, %rcx
callq 0x2280
cmpl $0x0, 0x258(%rbp)
leaq 0x2d0f6(%rip), %rax     # 0x59edc
leaq 0x2d0e9(%rip), %rdi     # 0x59ed6
cmoveq %rax, %rdi
movl $0x5, %esi
movl $0x1, %edx
movq %r14, %rcx
callq 0x2280
xorps %xmm0, %xmm0
cvtss2sd -0x38(%rbp), %xmm0
leaq 0x2cfcf(%rip), %rsi     # 0x59de1
movq %r14, %rdi
movb $0x1, %al
callq 0x2190
movq %r15, %rsp
testl %r13d, %r13d
jne 0x2ce5a
leaq 0x2d0b7(%rip), %rsi     # 0x59ee2
leaq -0x2d0(%rbp), %r14
movq %r14, %rdi
movq 0x248(%rbp), %rdx
xorl %eax, %eax
callq 0x2260
leaq 0x2a3f6(%rip), %rsi     # 0x57240
movq %r14, %rdi
callq 0x2210
movq %rax, %rdi
callq 0x20c0
movl $0x0, -0x90(%rbp)
movslq 0x4(%r12), %rax
xorps %xmm1, %xmm1
xorps %xmm0, %xmm0
testq %rax, %rax
jle 0x2ce90
movq 0x18(%r12), %rcx
xorl %edx, %edx
xorps %xmm2, %xmm2
cvtss2sd (%rcx,%rdx,4), %xmm2
addsd %xmm2, %xmm0
addq $0x3, %rdx
cmpq %rax, %rdx
jb 0x2ce7b
movl 0x250(%rbp), %r14d
ucomisd %xmm1, %xmm0
jb 0x2cea3
sqrtsd %xmm0, %xmm0
jmp 0x2cea8
callq 0x2290
movq %rsp, -0xa8(%rbp)
testl %r13d, %r13d
setne %al
testl %r14d, %r14d
sete %cl
orb %al, %cl
movzbl %cl, %r15d
xorl $0x5, %r15d
movl $0x0, -0x54(%rbp)
leal 0xf(,%r15,8), %eax
andl $-0x10, %eax
movq %rsp, %rcx
subq %rax, %rcx
movq %rcx, -0x38(%rbp)
movq %rcx, %rsp
movq %rsp, %rcx
subq %rax, %rcx
movq %rcx, -0x68(%rbp)
movq %rcx, %rsp
movq %rsp, %rcx
subq %rax, %rcx
movq %rcx, -0x50(%rbp)
movq %rcx, %rsp
movq %rsp, %rcx
subq %rax, %rcx
movq %rcx, -0x48(%rbp)
movq %rcx, %rsp
leaq 0xf0(%rbp), %rax
movl (%rax), %eax
movq %rsp, %rdx
leaq 0xf(,%rax,4), %rax
andq $-0x10, %rax
subq %rax, %rdx
movq %rdx, %rsp
movq %rsp, %rsi
leaq 0xf(,%rbx,8), %rax
andq $-0x10, %rax
subq %rax, %rsi
movq %rsi, %rsp
testl %ebx, %ebx
jle 0x2cf61
movq -0x40(%rbp), %rax
movq 0x18(%rax), %rax
xorl %ecx, %ecx
xorps %xmm1, %xmm1
cvtss2sd (%rax,%rcx,4), %xmm1
movsd %xmm1, (%rsi,%rcx,8)
incq %rcx
cmpq %rcx, %rbx
jne 0x2cf4c
movq %rsi, -0x98(%rbp)
cvtsd2ss %xmm0, %xmm0
movss %xmm0, -0x8c(%rbp)
movl $0xffffffff, -0x6c(%rbp) # imm = 0xFFFFFFFF
xorl %r12d, %r12d
movl 0x48(%rbp), %r14d
movq %rdx, -0xa0(%rbp)
movq %r15, -0x78(%rbp)
testl %r13d, %r13d
je 0x2cf9f
incl %r12d
cmpl %r12d, %r15d
jne 0x2cf8d
jmp 0x2d4cb
cmpl $0x0, 0x4c46a(%rip)     # 0x79410
je 0x2cfdc
cmpl $0x1, %r12d
je 0x2cf92
cmpl $0x2, %r12d
ja 0x2cfea
testl %r12d, %r12d
je 0x2d267
cmpl $0x1, %r12d
je 0x2cf92
cmpl $0x2, %r12d
leaq -0x120(%rbp), %r14
jne 0x2d273
movb $0x43, %r13b
jmp 0x2d276
cmpl $0x3, %r12d
ja 0x2cfae
cmpl $0x2, %r12d
jne 0x2cf92
jmp 0x2cfae
cmpl $0x3, %r12d
jne 0x2d099
movups 0x2cf7e(%rip), %xmm0    # 0x59f79
movups %xmm0, -0x102(%rbp)
movups 0x2cf62(%rip), %xmm0    # 0x59f6b
movaps %xmm0, -0x110(%rbp)
movupd 0x2cf43(%rip), %xmm0    # 0x59f5b
movapd %xmm0, -0x120(%rbp)
movl 0x78(%rbp), %edi
movq 0x50(%rbp), %rsi
movq 0x60(%rbp), %rdx
callq 0x15a58
movq %rax, %r15
movq -0x80(%rbp), %r13
movq %r13, %rdi
movl 0x48(%rbp), %r14d
movl %r14d, %esi
movq 0x20(%rbp), %rdx
callq 0x1512b
movq %r15, %rdi
movl 0x78(%rbp), %esi
movq 0x50(%rbp), %rdx
callq 0x1512b
subq $0x8, %rsp
movq -0x98(%rbp), %rdi
movl %ebx, %esi
movq %r13, %rdx
movq %r15, %rcx
movl %r14d, %r8d
xorl %r9d, %r9d
pushq $0x0
callq 0x3a1d3
addq $0x10, %rsp
movq %r15, %rdi
callq 0x2050
leaq 0x80(%rbp), %r14
movq -0x30(%rbp), %r13
movq 0x30(%rbp), %r15
jmp 0x2d33a
movq -0x30(%rbp), %r13
movq %r13, %rdi
callq 0x21e0
leaq 0x2dc86(%rip), %rdi     # 0x5ad32
callq 0x2090
movups 0x2ced1(%rip), %xmm0    # 0x59f89
movaps %xmm0, -0x120(%rbp)
movups 0x2ced3(%rip), %xmm0    # 0x59f99
movaps %xmm0, -0x110(%rbp)
movups 0x2cece(%rip), %xmm0    # 0x59fa2
movups %xmm0, -0x107(%rbp)
callq 0x20b0
xorps %xmm0, %xmm0
cvtsi2sd %rax, %xmm0
movsd %xmm0, -0xb8(%rbp)
leaq 0xf0(%rbp), %rsi
movl (%rsi), %eax
movl $0x6c616d, -0x25d(%rbp) # imm = 0x6C616D
movl $0x6d726f6e, -0x260(%rbp) # imm = 0x6D726F6E
movq 0x4c304(%rip), %rcx     # 0x79418
subq $0xf0, %rsp
leaq 0x1f0(%rbp), %rdx
movups (%rdx), %xmm0
movups 0x10(%rdx), %xmm1
movups 0x20(%rdx), %xmm2
movups 0x2c(%rdx), %xmm3
movups %xmm3, 0xc4(%rsp)
movups %xmm2, 0xb8(%rsp)
movups %xmm1, 0xa8(%rsp)
movups %xmm0, 0x98(%rsp)
leaq 0xb0(%rbp), %rdx
movups (%rdx), %xmm0
movups 0x10(%rdx), %xmm1
movups %xmm1, 0x40(%rsp)
movups %xmm0, 0x30(%rsp)
movl %r14d, %r9d
leaq 0x80(%rbp), %r14
movups (%r14), %xmm0
movups 0x10(%r14), %xmm1
movups 0x20(%r14), %xmm2
movups %xmm2, 0x20(%rsp)
movups %xmm1, 0x10(%rsp)
movups %xmm0, (%rsp)
movl %eax, 0xe8(%rsp)
leaq -0x260(%rbp), %rax
movq %rax, 0xe0(%rsp)
movq %rsi, 0xd8(%rsp)
movl 0x78(%rbp), %eax
movl %eax, 0x90(%rsp)
movq 0x50(%rbp), %rax
movq %rax, 0x88(%rsp)
movl -0x88(%rbp), %eax
movl %eax, 0x80(%rsp)
movq -0xb0(%rbp), %rax
movq %rax, 0x78(%rsp)
movl 0x38(%rbp), %eax
movl %eax, 0x70(%rsp)
movq 0x30(%rbp), %r15
movq %r15, 0x68(%rsp)
movl %ebx, 0x60(%rsp)
movq -0x60(%rbp), %rax
movq %rax, 0x58(%rsp)
leaq -0x190(%rbp), %rax
movq %rax, 0x50(%rsp)
xorps %xmm1, %xmm1
movq -0x98(%rbp), %rdi
leaq 0x2cda3(%rip), %rsi     # 0x59fb9
movq -0x80(%rbp), %rdx
movsd 0x2971e(%rip), %xmm0    # 0x56940
movq 0x20(%rbp), %r8
callq 0x341e8
addq $0xf0, %rsp
callq 0x20b0
xorps %xmm0, %xmm0
cvtsi2sd %rax, %xmm0
subsd -0xb8(%rbp), %xmm0
divsd 0x29701(%rip), %xmm0    # 0x56950
leaq 0x2cd6a(%rip), %rdi     # 0x59fc0
movb $0x1, %al
callq 0x20f0
callq 0x20b0
jmp 0x2d33a
movb $0x4f, %r13b
leaq -0x120(%rbp), %r14
jmp 0x2d276
movb $0x58, %r13b
movl $0x746946, -0x120(%rbp) # imm = 0x746946
testl %r12d, %r12d
je 0x2d2a0
movq %r14, %rdi
callq 0x20d0
movl $0x52525220, -0x120(%rbp,%rax) # imm = 0x52525220
movb $0x0, -0x11c(%rbp,%rax)
movzbl %r13b, %r13d
leaq -0x260(%rbp), %r15
movq %r15, %rdi
leaq 0x2cc44(%rip), %rsi     # 0x59ef9
movl %r13d, %edx
xorl %eax, %eax
callq 0x2260
movq %r14, %rdi
movq %r15, %rsi
callq 0x2240
leaq 0x2cc31(%rip), %rdi     # 0x59f02
movl %r13d, %esi
xorl %eax, %eax
callq 0x20f0
movq 0x4c136(%rip), %rsi     # 0x79418
subq $0x30, %rsp
leaq 0x80(%rbp), %rax
movupd (%rax), %xmm0
movups 0x10(%rax), %xmm1
movups 0x20(%rax), %xmm2
movups %xmm2, 0x20(%rsp)
movups %xmm1, 0x10(%rsp)
movupd %xmm0, (%rsp)
movq -0x40(%rbp), %rdi
movq 0x10(%rbp), %rdx
movl %r13d, %ecx
leaq -0x90(%rbp), %r8
callq 0x26810
addq $0x30, %rsp
testl %eax, %eax
js 0x2d491
movq 0x30(%rbp), %r15
leaq 0x80(%rbp), %r14
movq -0x30(%rbp), %r13
movl $0x1e, %esi
movl $0x1, %edx
leaq 0x2cca4(%rip), %rdi     # 0x59fef
movq %r13, %rcx
callq 0x2280
movq 0x4c0be(%rip), %rax     # 0x79418
subq $0xc0, %rsp
movups (%r14), %xmm0
movups 0x10(%r14), %xmm1
movups 0x20(%r14), %xmm2
movups %xmm2, 0x50(%rsp)
movups %xmm1, 0x40(%rsp)
movups %xmm0, 0x30(%rsp)
xorl %edx, %edx
movl %edx, 0xb0(%rsp)
movl 0x258(%rbp), %ecx
movl %ecx, 0xa0(%rsp)
leaq -0x2d0(%rbp), %rcx
movq %rcx, 0x98(%rsp)
movq %r13, 0x90(%rsp)
leaq -0x120(%rbp), %rcx
movq %rcx, 0x88(%rsp)
movl %edx, 0x80(%rsp)
movq -0x60(%rbp), %rcx
movq %rcx, 0x78(%rsp)
movq %r15, 0x70(%rsp)
movq 0x58(%rbp), %rcx
movq %rcx, 0x68(%rsp)
movq 0x28(%rbp), %rcx
movq %rcx, 0x60(%rsp)
movl 0x48(%rbp), %r14d
movl %r14d, 0x28(%rsp)
movq 0x20(%rbp), %rcx
movq %rcx, 0x20(%rsp)
movq -0x80(%rbp), %rcx
movq %rcx, 0x18(%rsp)
leaq 0xf0(%rbp), %rcx
movq %rcx, 0x10(%rsp)
movq %rax, 0x8(%rsp)
movq -0x40(%rbp), %rax
movq %rax, (%rsp)
leaq -0x54(%rbp), %rdi
movq -0x48(%rbp), %rsi
movq -0x38(%rbp), %rdx
movq -0x68(%rbp), %rcx
movq -0x50(%rbp), %r8
movq 0x240(%rbp), %r9
movss -0x8c(%rbp), %xmm0
callq 0x2d985
addq $0xc0, %rsp
cmpl $0x2, %r12d
movl 0x230(%rbp), %r13d
movq -0xa0(%rbp), %rdi
movq -0x78(%rbp), %r15
jne 0x2cf92
movl -0x54(%rbp), %eax
decl %eax
movl %eax, -0x6c(%rbp)
leaq 0xf0(%rbp), %rax
movslq (%rax), %rdx
testq %rdx, %rdx
jle 0x2cf92
movq -0x40(%rbp), %rax
movq 0x20(%rax), %rsi
shlq $0x2, %rdx
callq 0x21a0
jmp 0x2cf92
movl $0x25, %esi
movl $0x1, %edx
leaq 0x2ca93(%rip), %rdi     # 0x59f35
movq -0x30(%rbp), %rcx
callq 0x2280
leaq 0x2d8ac(%rip), %rdi     # 0x5ad5e
callq 0x2090
movl 0x230(%rbp), %r13d
movq -0x78(%rbp), %r15
movl 0x48(%rbp), %r14d
jmp 0x2cf92
movq -0x30(%rbp), %rdi
callq 0x20c0
movl -0x6c(%rbp), %eax
testl %eax, %eax
movq -0x38(%rbp), %r15
movq -0x50(%rbp), %r12
js 0x2d570
movl %eax, %r14d
movq -0x48(%rbp), %rax
movq (%rax,%r14,8), %rsi
leaq 0x2cb15(%rip), %rdi     # 0x5a00e
xorl %eax, %eax
callq 0x20f0
leaq 0xf0(%rbp), %rax
movslq (%rax), %rax
testq %rax, %rax
movq -0xa0(%rbp), %r8
jle 0x2d54c
movq -0x40(%rbp), %rcx
movq 0x20(%rcx), %rcx
movq (%r12,%r14,8), %rdx
leaq 0xf0(%rbp), %rsi
movq 0x30(%rsi), %rsi
xorl %edi, %edi
movss (%r8,%rdi,4), %xmm0
movss %xmm0, (%rcx,%rdi,4)
movss (%rdx,%rdi,4), %xmm0
movss %xmm0, (%rsi,%rdi,4)
incq %rdi
cmpq %rdi, %rax
jne 0x2d52f
testl %ebx, %ebx
jle 0x2d570
movq (%r15,%r14,8), %rax
movq -0x40(%rbp), %rcx
movq 0x18(%rcx), %rcx
xorl %edx, %edx
movss (%rax,%rdx,4), %xmm0
movss %xmm0, (%rcx,%rdx,4)
incq %rdx
cmpq %rdx, %rbx
jne 0x2d55e
testl %r13d, %r13d
movq -0x68(%rbp), %r14
movq -0x48(%rbp), %rbx
jne 0x2d7ee
movq %r12, %r13
cmpq $0x0, 0x248(%rbp)
setne %al
movl -0x54(%rbp), %ecx
movl %ecx, %r15d
cmpl $0x2, %ecx
setge %cl
andb %al, %cl
cmpb $0x1, %cl
jne 0x2d7b3
leaq 0x2ca7f(%rip), %rsi     # 0x5a02c
leaq -0x260(%rbp), %r14
leaq -0x190(%rbp), %rdx
movq %r14, %rdi
xorl %eax, %eax
callq 0x2260
leaq 0x2ca78(%rip), %rdi     # 0x5a044
movq %r14, %rsi
xorl %eax, %eax
callq 0x20f0
leaq 0x29c63(%rip), %rsi     # 0x57240
movq %r14, %rdi
callq 0x2210
movq %rax, %r14
leaq 0xf0(%rbp), %rax
movl (%rax), %edx
leaq 0x2ca6c(%rip), %rsi     # 0x5a064
movq %r14, %rdi
movl %r15d, %ecx
xorl %eax, %eax
callq 0x2190
leaq 0x2ca83(%rip), %r12     # 0x5a08f
xorl %r13d, %r13d
movq (%rbx,%r13,8), %rcx
incq %r13
movq %r14, %rdi
movq %r12, %rsi
movl %r13d, %edx
xorl %eax, %eax
callq 0x2190
cmpq %r13, %r15
jne 0x2d60f
leaq 0x2ca6e(%rip), %rdi     # 0x5a0a0
movl $0x6, %esi
movl $0x1, %edx
movq %r14, %rcx
callq 0x2280
movl %r15d, %r12d
negl %r12d
movl $0x1, %r13d
leal 0x1(%r13), %ebx
movq %r14, %rdi
leaq 0x2ca49(%rip), %rsi     # 0x5a0a7
movl %ebx, %edx
movl %r13d, %ecx
xorl %eax, %eax
callq 0x2190
leal (%r12,%r13), %eax
incl %eax
movl %ebx, %r13d
cmpl $0x1, %eax
jne 0x2d650
leal 0x2(%r15), %edx
leaq 0x2ca2f(%rip), %rsi     # 0x5a0b2
movq %r14, %rdi
xorl %eax, %eax
callq 0x2190
cmpl $0x0, 0x258(%rbp)
jne 0x2d6ab
leal 0x3(%r15), %edx
leaq 0x2ca1f(%rip), %rsi     # 0x5a0c0
movq %r14, %rdi
xorl %eax, %eax
callq 0x2190
movq %r15, -0x30(%rbp)
movl $0xa, %edi
movq %r14, %rsi
callq 0x2140
leaq 0xf0(%rbp), %rax
cmpl $0x0, (%rax)
jle 0x2d79b
movq -0x30(%rbp), %rax
cmpl $0x2, %eax
movl $0x1, %ecx
cmovgel %eax, %ecx
movq %rcx, -0x40(%rbp)
xorl %r13d, %r13d
movq -0x50(%rbp), %r12
movq %r14, %rdi
leaq 0x2fbfb(%rip), %rsi     # 0x5d2eb
movl %r13d, %edx
xorl %eax, %eax
callq 0x2190
xorl %r15d, %r15d
movq %r14, %rbx
movq -0x40(%rbp), %r14
movq (%r12,%r15,8), %rax
xorps %xmm0, %xmm0
cvtss2sd (%rax,%r13,4), %xmm0
movq %rbx, %rdi
leaq 0x2c9b0(%rip), %rsi     # 0x5a0cb
movb $0x1, %al
callq 0x2190
incq %r15
cmpq %r15, %r14
jne 0x2d704
movq -0xc0(%rbp), %rax
xorps %xmm0, %xmm0
cvtss2sd (%rax,%r13,4), %xmm0
movq %rbx, %rdi
leaq 0x2a180(%rip), %rsi     # 0x578c4
movb $0x1, %al
callq 0x2190
cmpl $0x0, 0x258(%rbp)
movq %rbx, %r14
jne 0x2d778
movq 0x4bcea(%rip), %rax     # 0x79448
xorps %xmm0, %xmm0
cvtss2sd (%rax,%r13,4), %xmm0
movq %r14, %rdi
leaq 0x2a153(%rip), %rsi     # 0x578c4
movb $0x1, %al
callq 0x2190
movl $0xa, %edi
movq %r14, %rsi
callq 0x2140
incq %r13
leaq 0xf0(%rbp), %rax
movslq (%rax), %rax
cmpq %rax, %r13
jl 0x2d6e6
movq %r14, %rdi
callq 0x20c0
movq -0x68(%rbp), %r14
movq -0x50(%rbp), %r13
movq -0x48(%rbp), %rbx
movq -0x30(%rbp), %r15
testl %r15d, %r15d
jle 0x2d7ee
movq %rbx, %r12
xorl %ebx, %ebx
movq (%r13,%rbx,8), %rdi
callq 0x2050
movq -0x38(%rbp), %rax
movq (%rax,%rbx,8), %rdi
callq 0x2050
movq (%r14,%rbx,8), %rdi
callq 0x2050
movq (%r12,%rbx,8), %rdi
callq 0x2050
incq %rbx
cmpq %rbx, %r15
jne 0x2d7bd
movq 0x4bc23(%rip), %rsi     # 0x79418
subq $0x50, %rsp
movl $0x9, %ecx
movq %rsp, %rdi
rep  movsq (%rsi), %es:(%rdi)
callq 0x2387a
addq $0x50, %rsp
movq 0x4bc04(%rip), %rdi     # 0x79418
callq 0x2050
movq $0x0, 0x4bbf4(%rip) # 0x79418
cmpl $0x0, 0x258(%rbp)
je 0x2d852
subq $0xd0, %rsp
leaq 0x4bbe5(%rip), %rsi     # 0x79420
movl $0x1a, %ecx
movq %rsp, %rdi
rep  movsq (%rsi), %es:(%rdi)
callq 0x23da1
addq $0xd0, %rsp
movq -0xa8(%rbp), %rsp
movss -0x84(%rbp), %xmm0
leaq -0x28(%rbp), %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl 0x70(%rbp), %edx
leaq 0x2c5da(%rip), %rsi     # 0x59e54
movq -0x30(%rbp), %rdi
xorl %eax, %eax
callq 0x2190
jmp 0x2cc87