// File: /workspace/github_c_makefile_star2_O3/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, -0x58(%rbp)
movl %r8d, -0x88(%rbp)
movq %rcx, -0xb0(%rbp)
movq %rsi, %r15
movq %rdi, -0x38(%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 0x2c383
leaq 0x2d1e1(%rip), %rsi     # 0x5954c
leaq -0x190(%rbp), %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0x2270
movl $0x88, %eax
jmp 0x2c397
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 0x4dfa0
cvtsd2ss %xmm0, %xmm1
testq %r13, %r13
jle 0x2c3f4
movq -0x38(%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 0x2c3db
movss %xmm1, -0x84(%rbp)
xorps %xmm0, %xmm0
cvtss2sd %xmm1, %xmm0
leaq 0x2d8de(%rip), %rdi     # 0x59ce8
movsd %xmm0, -0x70(%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 0x2d8c9(%rip), %rdi     # 0x59d0a
xorl %eax, %eax
callq 0x20f0
movl 0x8(%rbx), %ebx
cmpq $0x0, 0x4cfc5(%rip)     # 0x79418
jne 0x2c53d
movl $0x48, %edi
callq 0x21e0
movq %rax, 0x4cfae(%rip)     # 0x79418
leaq 0x80(%rbp), %r14
movl 0x4(%r14), %edx
movq %rax, %rdi
movl %ebx, %esi
callq 0x2321a
movq %rsp, -0x30(%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 0x387ac
addq $0x30, %rsp
movq 0x4cf37(%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 0x20900
addq $0x30, %rsp
movq 0x4cef3(%rip), %rcx     # 0x79418
movl %eax, 0x8(%rcx)
movq -0x60(%rbp), %rdi
movl %ebx, %esi
movq %r15, %rdx
movq %r12, %rcx
callq 0x38782
movq -0x30(%rbp), %rsp
movl 0x1c0(%rbp), %r12d
cmpl $0x0, 0x258(%rbp)
jne 0x2c737
leaq 0xf0(%rbp), %r14
movl (%r14), %esi
movl 0x8(%r14), %edx
movl 0xc(%r14), %ecx
leaq 0x4ceb6(%rip), %rdi     # 0x79420
callq 0x235c4
movl 0x8(%r14), %edi
movq 0x4ce9e(%rip), %rax     # 0x79418
movq 0x20(%rax), %rsi
movq 0x4cebb(%rip), %rdx     # 0x79440
movq 0x4ced4(%rip), %rcx     # 0x79460
movl $0x1, %r8d
callq 0x4a559
cmpl $0x0, (%r14)
movq -0x60(%rbp), %r14
jle 0x2c737
xorps %xmm0, %xmm0
cvtsi2ss %ebx, %xmm0
movss %xmm0, -0x30(%rbp)
xorps %xmm0, %xmm0
cvtsi2ss %r13d, %xmm0
movss %xmm0, -0x40(%rbp)
xorl %r15d, %r15d
movq 0x4cf18(%rip), %rax     # 0x794e0
movl $0x1, (%rax,%r15,4)
movq 0x4ce69(%rip), %rax     # 0x79440
movss (%rax,%r15,4), %xmm0
movq 0x4ce64(%rip), %rax     # 0x79448
movss %xmm0, (%rax,%r15,4)
cvtss2sd %xmm0, %xmm0
ucomisd 0x24b82(%rip), %xmm0    # 0x51178
jb 0x2c5fe
sqrtsd %xmm0, %xmm0
jmp 0x2c603
callq 0x22a0
movsd 0x24b3d(%rip), %xmm1    # 0x51148
divsd %xmm0, %xmm1
xorps %xmm0, %xmm0
cvtsd2ss %xmm1, %xmm0
movq 0x4ce1b(%rip), %rax     # 0x79438
movss %xmm0, (%rax,%r15,4)
movq 0x4ce36(%rip), %rax     # 0x79460
movq (%rax,%r15,8), %rsi
testl %ebx, %ebx
jle 0x2c64a
xorl %eax, %eax
movss (%rsi,%rax,4), %xmm1
mulss %xmm0, %xmm1
movss %xmm1, (%rsi,%rax,4)
incq %rax
cmpq %rax, %rbx
jne 0x2c634
movq 0x4ce17(%rip), %rax     # 0x79468
movq (%rax,%r15,8), %rdi
movq 0x4cdbc(%rip), %rdx     # 0x79418
callq 0x26587
movq 0x4cdf0(%rip), %rax     # 0x79458
movq (%rax,%r15,8), %rdi
movq 0x4cded(%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 0x25c2a
addq $0x30, %rsp
movq 0x4cda8(%rip), %rax     # 0x79460
movq (%rax,%r15,8), %rdi
movl %ebx, %esi
callq 0x10bf3
divss -0x30(%rbp), %xmm0
movq 0x4cdc1(%rip), %rax     # 0x79490
movss %xmm0, (%rax,%r15,4)
movq 0x4cd8c(%rip), %rax     # 0x79468
movq (%rax,%r15,8), %rdi
movl %ebx, %esi
callq 0x10bf3
divss -0x30(%rbp), %xmm0
movq 0x4cda5(%rip), %rax     # 0x79498
movss %xmm0, (%rax,%r15,4)
movq 0x4cd58(%rip), %rax     # 0x79458
movq (%rax,%r15,8), %rdi
movl 0x4cd22(%rip), %esi     # 0x7942c
callq 0x10bf3
divss -0x40(%rbp), %xmm0
movq 0x4cd6d(%rip), %rax     # 0x79488
movss %xmm0, (%rax,%r15,4)
incq %r15
leaq 0xf0(%rbp), %rax
movslq (%rax), %rax
cmpq %rax, %r15
jl 0x2c5c1
movl 0x230(%rbp), %r15d
testl %r12d, %r12d
je 0x2c75c
leaq 0x2d411(%rip), %rsi     # 0x59b5b
movq -0x48(%rbp), %rdi
callq 0x2220
movq %rax, -0x30(%rbp)
jmp 0x2c80c
leaq 0x2aa9d(%rip), %rsi     # 0x57200
movq -0x48(%rbp), %r14
movq %r14, %rdi
callq 0x2220
movq %rax, %r12
leaq 0x255d6(%rip), %rdi     # 0x51d4f
movq %r14, %rsi
xorl %eax, %eax
callq 0x20f0
cmpl $0x0, 0x258(%rbp)
movq %r12, -0x30(%rbp)
jne 0x2c80c
movl 0xe8(%rbp), %r15d
movl 0x40(%rbp), %r14d
leaq 0x2580e(%rip), %rsi     # 0x51fb0
movq %r12, %rdi
movq 0x10(%rbp), %rdx
xorl %eax, %eax
callq 0x21a0
leaq 0x2582d(%rip), %rsi     # 0x51fe4
movq %r12, %rdi
movl 0x38(%rbp), %edx
xorl %eax, %eax
callq 0x21a0
leaq 0x2584f(%rip), %rsi     # 0x5201a
movq %r12, %rdi
movl %r15d, %edx
movl 0x230(%rbp), %r15d
xorl %eax, %eax
callq 0x21a0
leaq 0x258ea(%rip), %rsi     # 0x520d0
movq %r12, %rdi
movl %r14d, %edx
xorl %eax, %eax
callq 0x21a0
leaq 0x2fd7d(%rip), %rdi     # 0x5c577
movl $0x2, %esi
movl $0x1, %edx
movq %r12, %rcx
callq 0x2290
leaq 0x1c8(%rbp), %r12
movq 0xe0(%rbp), %rdx
movq 0xd0(%rbp), %r13
movl 0x258(%rbp), %eax
orl %r15d, %eax
jne 0x2c8e3
leaq 0x2d506(%rip), %rdi     # 0x59d3d
movl $0x16, %esi
movq %rdx, %r15
movl $0x1, %edx
movq -0x30(%rbp), %r14
movq %r14, %rcx
callq 0x2290
xorps %xmm0, %xmm0
cvtss2sd (%r12), %xmm0
leaq 0x2d4f4(%rip), %rsi     # 0x59d54
movq %r14, %rdi
movb $0x1, %al
callq 0x21a0
xorps %xmm0, %xmm0
cvtss2sd 0x4(%r12), %xmm0
leaq 0x2d4f5(%rip), %rsi     # 0x59d70
movq %r14, %rdi
movb $0x1, %al
callq 0x21a0
movl 0x10(%r12), %edx
leaq 0x2d4fb(%rip), %rsi     # 0x59d8c
movq %r14, %rdi
xorl %eax, %eax
callq 0x21a0
movq %r15, %rdx
cmpl $0x0, 0x20(%r12)
je 0x2c8e3
xorps %xmm0, %xmm0
cvtss2sd 0x8(%r12), %xmm0
leaq 0x2d4ef(%rip), %rsi     # 0x59da6
movq -0x30(%rbp), %r14
movq %r14, %rdi
movb $0x1, %al
callq 0x21a0
xorps %xmm0, %xmm0
cvtss2sd 0xc(%r12), %xmm0
leaq 0x2d4ec(%rip), %rsi     # 0x59dc2
movq %r14, %rdi
movb $0x1, %al
callq 0x21a0
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 0x16a20
addq $0x10, %rsp
movq (%r15), %rdx
movl (%r14), %ecx
movq 0x18(%r12), %r8
movq %r13, %rdi
movl 0xd8(%rbp), %r12d
movl %r12d, %esi
callq 0x1f054
movss %xmm0, -0x48(%rbp)
movq %r13, %rdi
movl %r12d, %esi
movq 0x30(%rbp), %rdx
callq 0x1f37e
movss %xmm0, -0x68(%rbp)
movq (%r15), %rdi
movl (%r14), %esi
movq 0x60(%rbp), %rdx
callq 0x1f37e
movss %xmm0, -0x40(%rbp)
movq (%r15), %rdi
callq 0x2050
movl 0x230(%rbp), %edx
testl %edx, %edx
je 0x2c9a3
leaq 0x2d45c(%rip), %rsi     # 0x59dde
movq -0x30(%rbp), %rdi
xorl %eax, %eax
callq 0x21a0
cmpl $0x0, 0x258(%rbp)
leaq 0x80(%rbp), %r12
jne 0x2ca44
jmp 0x2c9cc
cmpl $0x0, 0x258(%rbp)
leaq 0x80(%rbp), %r12
jne 0x2ca44
movl 0x70(%rbp), %edx
leaq 0x2d437(%rip), %rsi     # 0x59df8
movq -0x30(%rbp), %rdi
xorl %eax, %eax
callq 0x21a0
movl 0x38(%rbp), %eax
subl 0x68(%rbp), %eax
xorps %xmm0, %xmm0
cvtsi2ss %eax, %xmm0
movss -0x40(%rbp), %xmm1
subss -0x68(%rbp), %xmm1
mulss -0x58(%rbp), %xmm0
subss %xmm0, %xmm1
movss %xmm1, -0x40(%rbp)
xorps %xmm0, %xmm0
cvtss2sd -0x48(%rbp), %xmm0
leaq 0x2d412(%rip), %rsi     # 0x59e12
movq -0x30(%rbp), %r14
movq %r14, %rdi
movb $0x1, %al
callq 0x21a0
xorps %xmm0, %xmm0
cvtss2sd -0x40(%rbp), %xmm0
leaq 0x2d411(%rip), %rsi     # 0x59e2e
movq %r14, %rdi
movb $0x1, %al
callq 0x21a0
leaq 0x2d41c(%rip), %rsi     # 0x59e4a
leaq 0x3c6fb(%rip), %rdx     # 0x69130
movq %r14, %rdi
movsd -0x70(%rbp), %xmm0
movb $0x1, %al
callq 0x21a0
movq 0x238(%rbp), %r13
testq %r13, %r13
movq 0x20(%rbp), %rcx
je 0x2cb3f
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 -0x38(%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 0x286ef(%rip), %r8      # 0x55196
movq %r14, %rdi
callq 0x2d588
addq $0x30, %rsp
testl %eax, %eax
je 0x2cb3c
leaq -0x260(%rbp), %rcx
leaq -0x2d0(%rbp), %r8
movq %r13, %rdi
movq %r14, %rsi
movl %eax, %edx
callq 0x108db
movss %xmm0, -0x40(%rbp)
leaq 0x2d382(%rip), %rdi     # 0x59e64
movl $0x15, %esi
movl $0x1, %edx
movq -0x30(%rbp), %r14
movq %r14, %rcx
callq 0x2290
cmpl $0x0, 0x258(%rbp)
leaq 0x2d37a(%rip), %rax     # 0x59e80
leaq 0x2d36d(%rip), %rdi     # 0x59e7a
cmoveq %rax, %rdi
movl $0x5, %esi
movl $0x1, %edx
movq %r14, %rcx
callq 0x2290
xorps %xmm0, %xmm0
cvtss2sd -0x40(%rbp), %xmm0
leaq 0x2d253(%rip), %rsi     # 0x59d85
movq %r14, %rdi
movb $0x1, %al
callq 0x21a0
movq %r15, %rsp
movl 0x230(%rbp), %r15d
testl %r15d, %r15d
jne 0x2cb81
leaq 0x2d334(%rip), %rsi     # 0x59e86
leaq -0x2d0(%rbp), %r14
movq %r14, %rdi
movq 0x248(%rbp), %rdx
xorl %eax, %eax
callq 0x2270
leaq 0x2a68f(%rip), %rsi     # 0x57200
movq %r14, %rdi
callq 0x2220
movq %rax, %rdi
callq 0x20c0
movl $0x0, -0x90(%rbp)
movslq 0x4(%r12), %rax
xorps %xmm1, %xmm1
xorps %xmm0, %xmm0
testq %rax, %rax
jle 0x2cbb7
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 0x2cba2
movl 0x250(%rbp), %r14d
ucomisd %xmm1, %xmm0
jb 0x2cbca
sqrtsd %xmm0, %xmm0
jmp 0x2cbcf
callq 0x22a0
movq %rsp, -0xa8(%rbp)
testl %r15d, %r15d
setne %al
testl %r14d, %r14d
sete %cl
orb %al, %cl
movzbl %cl, %eax
xorl $0x5, %eax
movl $0x0, -0x4c(%rbp)
movq %rax, -0x70(%rbp)
leal 0xf(,%rax,8), %eax
andl $-0x10, %eax
movq %rsp, %rcx
subq %rax, %rcx
movq %rcx, -0x40(%rbp)
movq %rcx, %rsp
movq %rsp, %rcx
subq %rax, %rcx
movq %rcx, -0x68(%rbp)
movq %rcx, %rsp
movq %rsp, %r13
subq %rax, %r13
movq %r13, %rsp
movq %rsp, %rcx
subq %rax, %rcx
movq %rcx, -0x58(%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 0x2cc85
movq -0x38(%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 0x2cc70
movq %rsi, -0x98(%rbp)
cvtsd2ss %xmm0, %xmm0
movss %xmm0, -0x8c(%rbp)
movl $0xffffffff, -0x74(%rbp) # imm = 0xFFFFFFFF
xorl %r12d, %r12d
movq %r13, -0x48(%rbp)
movq %rdx, -0xa0(%rbp)
movq -0x70(%rbp), %r14
testl %r15d, %r15d
je 0x2ccc3
incl %r12d
cmpl %r12d, %r14d
jne 0x2ccb1
jmp 0x2d1d5
cmpl $0x0, 0x4c746(%rip)     # 0x79410
je 0x2ccfc
cmpl $0x1, %r12d
je 0x2ccb6
cmpl $0x2, %r12d
ja 0x2cd0a
je 0x2cf88
cmpl $0x1, %r12d
je 0x2ccb6
movl $0x746946, -0x120(%rbp) # imm = 0x746946
movb $0x4f, %al
leaq -0x120(%rbp), %r14
jmp 0x2cfb6
cmpl $0x3, %r12d
ja 0x2ccd2
cmpl $0x2, %r12d
jne 0x2ccb6
jmp 0x2ccd2
cmpl $0x3, %r12d
jne 0x2cdb9
movups 0x2d202(%rip), %xmm0    # 0x59f1d
movups %xmm0, -0x102(%rbp)
movups 0x2d1e6(%rip), %xmm0    # 0x59f0f
movaps %xmm0, -0x110(%rbp)
movupd 0x2d1c7(%rip), %xmm0    # 0x59eff
movapd %xmm0, -0x120(%rbp)
movl 0x78(%rbp), %edi
movq 0x50(%rbp), %rsi
movq 0x60(%rbp), %rdx
callq 0x15645
movq %rax, %r13
movq -0x80(%rbp), %r15
movq %r15, %rdi
movl 0x48(%rbp), %r14d
movl %r14d, %esi
movq 0x20(%rbp), %rdx
callq 0x14cf3
movq %r13, %rdi
movl 0x78(%rbp), %esi
movq 0x50(%rbp), %rdx
callq 0x14cf3
subq $0x8, %rsp
movq -0x98(%rbp), %rdi
movl %ebx, %esi
movq %r15, %rdx
movq %r13, %rcx
movl %r14d, %r8d
xorl %r9d, %r9d
pushq $0x0
callq 0x3a192
addq $0x10, %rsp
movq %r13, %rdi
callq 0x2050
leaq 0x80(%rbp), %r14
movq -0x30(%rbp), %r15
movq 0x30(%rbp), %r13
jmp 0x2d051
movq -0x30(%rbp), %r15
movq %r15, %rdi
callq 0x21f0
leaq 0x2df0a(%rip), %rdi     # 0x5acd6
callq 0x2090
movups 0x2d155(%rip), %xmm0    # 0x59f2d
movaps %xmm0, -0x120(%rbp)
movups 0x2d157(%rip), %xmm0    # 0x59f3d
movaps %xmm0, -0x110(%rbp)
movups 0x2d152(%rip), %xmm0    # 0x59f46
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 0x4c5e4(%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 0x48(%rbp), %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), %r13
movq %r13, 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 0x2d026(%rip), %rsi     # 0x59f5d
movq -0x80(%rbp), %rdx
movsd 0x299ed(%rip), %xmm0    # 0x56930
movq 0x20(%rbp), %r8
callq 0x33eed
addq $0xf0, %rsp
callq 0x20b0
xorps %xmm0, %xmm0
cvtsi2sd %rax, %xmm0
subsd -0xb8(%rbp), %xmm0
divsd 0x299d0(%rip), %xmm0    # 0x56940
leaq 0x2cfed(%rip), %rdi     # 0x59f64
movb $0x1, %al
callq 0x20f0
callq 0x20b0
jmp 0x2d051
movl $0x746946, -0x120(%rbp) # imm = 0x746946
leaq -0x120(%rbp), %r14
movq %r14, %rdi
callq 0x20d0
movl $0x52525220, -0x120(%rbp,%rax) # imm = 0x52525220
movb $0x0, -0x11c(%rbp,%rax)
movb $0x43, %al
movzbl %al, %r13d
leaq -0x260(%rbp), %rdi
leaq 0x2ced5(%rip), %rsi     # 0x59e9d
movl %r13d, %edx
xorl %eax, %eax
callq 0x2270
movq %r14, %rdi
leaq -0x260(%rbp), %rsi
callq 0x2250
leaq 0x2cebe(%rip), %rdi     # 0x59ea6
movl %r13d, %esi
xorl %eax, %eax
callq 0x20f0
movq 0x4c41f(%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 -0x38(%rbp), %rdi
movq 0x10(%rbp), %rdx
movl %r13d, %ecx
leaq -0x90(%rbp), %r8
callq 0x26388
addq $0x30, %rsp
testl %eax, %eax
js 0x2d1a6
movq 0x30(%rbp), %r13
leaq 0x80(%rbp), %r14
movq -0x30(%rbp), %r15
movl $0x1e, %esi
movl $0x1, %edx
leaq 0x2cf31(%rip), %rdi     # 0x59f93
movq %r15, %rcx
callq 0x2290
movq 0x4c3a7(%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 %r15, 0x90(%rsp)
leaq -0x120(%rbp), %rcx
movq %rcx, 0x88(%rsp)
movl %edx, 0x80(%rsp)
movq -0x60(%rbp), %rcx
movq %rcx, 0x78(%rsp)
movq %r13, 0x70(%rsp)
movq 0x58(%rbp), %rcx
movq %rcx, 0x68(%rsp)
movq 0x28(%rbp), %rcx
movq %rcx, 0x60(%rsp)
movl 0x48(%rbp), %ecx
movl %ecx, 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 -0x38(%rbp), %rax
movq %rax, (%rsp)
leaq -0x4c(%rbp), %rdi
movq -0x58(%rbp), %rsi
movq -0x40(%rbp), %rdx
movq -0x68(%rbp), %rcx
movq -0x48(%rbp), %r8
movq 0x240(%rbp), %r9
movss -0x8c(%rbp), %xmm0
callq 0x2d67b
addq $0xc0, %rsp
cmpl $0x2, %r12d
movl 0x230(%rbp), %r15d
movq -0xa0(%rbp), %rdi
movq -0x70(%rbp), %r14
jne 0x2ccb6
movl -0x4c(%rbp), %eax
decl %eax
movl %eax, -0x74(%rbp)
leaq 0xf0(%rbp), %rax
movslq (%rax), %rdx
testq %rdx, %rdx
jle 0x2ccb6
movq -0x38(%rbp), %rax
movq 0x20(%rax), %rsi
shlq $0x2, %rdx
callq 0x21b0
jmp 0x2ccb6
movl $0x25, %esi
movl $0x1, %edx
leaq 0x2cd22(%rip), %rdi     # 0x59ed9
movq -0x30(%rbp), %rcx
callq 0x2290
leaq 0x2db3b(%rip), %rdi     # 0x5ad02
callq 0x2090
movq -0x70(%rbp), %r14
jmp 0x2ccb6
movq -0x30(%rbp), %rdi
callq 0x20c0
movl -0x74(%rbp), %eax
testl %eax, %eax
movq -0x40(%rbp), %r12
js 0x2d27a
movl %eax, %r14d
movq -0x58(%rbp), %rax
movq (%rax,%r14,8), %rsi
leaq 0x2cdb3(%rip), %rdi     # 0x59fb2
xorl %eax, %eax
callq 0x20f0
leaq 0xf0(%rbp), %rax
movslq (%rax), %rax
testq %rax, %rax
movq -0xa0(%rbp), %r8
jle 0x2d256
movq -0x38(%rbp), %rcx
movq 0x20(%rcx), %rcx
movq -0x48(%rbp), %rdx
movq (%rdx,%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 0x2d239
testl %ebx, %ebx
jle 0x2d27a
movq (%r12,%r14,8), %rax
movq -0x38(%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 0x2d268
testl %r15d, %r15d
movq -0x68(%rbp), %r13
movq -0x58(%rbp), %rbx
jne 0x2d506
cmpq $0x0, 0x248(%rbp)
setne %al
movl -0x4c(%rbp), %ecx
movl %ecx, %edx
cmpl $0x2, %ecx
setge %cl
andb %al, %cl
cmpb $0x1, %cl
jne 0x2d4c1
leaq 0x2cd1d(%rip), %rsi     # 0x59fd0
leaq -0x260(%rbp), %r14
movq %rdx, %r12
leaq -0x190(%rbp), %rdx
movq %r14, %rdi
xorl %eax, %eax
callq 0x2270
leaq 0x2cd13(%rip), %rdi     # 0x59fe8
movq %r14, %rsi
xorl %eax, %eax
callq 0x20f0
leaq 0x29f1a(%rip), %rsi     # 0x57200
movq %r14, %rdi
callq 0x2220
movq %rax, %r14
leaq 0xf0(%rbp), %rax
movl (%rax), %edx
leaq 0x2cd07(%rip), %rsi     # 0x5a008
movq %r14, %rdi
movl %r12d, %ecx
xorl %eax, %eax
callq 0x21a0
leaq 0x2cd1e(%rip), %r15     # 0x5a033
xorl %r13d, %r13d
movq (%rbx,%r13,8), %rcx
incq %r13
movq %r14, %rdi
movq %r15, %rsi
movl %r13d, %edx
xorl %eax, %eax
callq 0x21a0
cmpq %r13, %r12
jne 0x2d318
leaq 0x2cd09(%rip), %rdi     # 0x5a044
movl $0x6, %esi
movl $0x1, %edx
movq %r14, %rcx
callq 0x2290
movq %r12, %rbx
movl %r12d, %r15d
negl %r15d
movl $0x1, %r13d
leal 0x1(%r13), %r12d
movq %r14, %rdi
leaq 0x2cce1(%rip), %rsi     # 0x5a04b
movl %r12d, %edx
movl %r13d, %ecx
xorl %eax, %eax
callq 0x21a0
leal (%r15,%r13), %eax
incl %eax
movl %r12d, %r13d
cmpl $0x1, %eax
jne 0x2d35c
leal 0x2(%rbx), %edx
leaq 0x2ccc7(%rip), %rsi     # 0x5a056
movq %r14, %rdi
xorl %eax, %eax
callq 0x21a0
cmpl $0x0, 0x258(%rbp)
jne 0x2d3b6
leal 0x3(%rbx), %edx
leaq 0x2ccb8(%rip), %rsi     # 0x5a064
movq %r14, %rdi
xorl %eax, %eax
callq 0x21a0
movq %rbx, -0x38(%rbp)
movl $0xa, %edi
movq %r14, %rsi
callq 0x2140
leaq 0xf0(%rbp), %rax
cmpl $0x0, (%rax)
jle 0x2d4ad
movq $0x0, -0x30(%rbp)
movq -0x48(%rbp), %rbx
movq -0x38(%rbp), %r12
movq %r14, %rdi
leaq 0x2feca(%rip), %rsi     # 0x5d2bb
movq -0x30(%rbp), %rdx
xorl %eax, %eax
callq 0x21a0
xorl %r15d, %r15d
movq %r14, %r13
leaq 0x2cc66(%rip), %r14     # 0x5a06f
movq (%rbx,%r15,8), %rax
movq -0x30(%rbp), %rcx
xorps %xmm0, %xmm0
cvtss2sd (%rax,%rcx,4), %xmm0
movq %r13, %rdi
movq %r14, %rsi
movb $0x1, %al
callq 0x21a0
incq %r15
cmpq %r15, %r12
jne 0x2d409
movq -0xc0(%rbp), %rax
movq -0x30(%rbp), %rcx
xorps %xmm0, %xmm0
cvtss2sd (%rax,%rcx,4), %xmm0
movq %r13, %rdi
leaq 0x2a439(%rip), %rsi     # 0x57884
movb $0x1, %al
callq 0x21a0
cmpl $0x0, 0x258(%rbp)
movq %r13, %r14
jne 0x2d482
movq 0x4bfe3(%rip), %rax     # 0x79448
movq -0x30(%rbp), %rcx
xorps %xmm0, %xmm0
cvtss2sd (%rax,%rcx,4), %xmm0
movq %r14, %rdi
leaq 0x2a409(%rip), %rsi     # 0x57884
movb $0x1, %al
callq 0x21a0
movl $0xa, %edi
movq %r14, %rsi
callq 0x2140
movq -0x30(%rbp), %rdx
incq %rdx
leaq 0xf0(%rbp), %rax
movslq (%rax), %rax
movq %rdx, -0x30(%rbp)
cmpq %rax, %rdx
jl 0x2d3e7
movq %r14, %rdi
callq 0x20c0
movq -0x68(%rbp), %r13
movq -0x58(%rbp), %rbx
movq -0x38(%rbp), %rdx
testl %edx, %edx
movq -0x48(%rbp), %r15
jle 0x2d506
movq %rbx, %r12
xorl %r14d, %r14d
movq (%r15,%r14,8), %rdi
movq %rdx, %rbx
callq 0x2050
movq -0x40(%rbp), %rax
movq (%rax,%r14,8), %rdi
callq 0x2050
movq (%r13,%r14,8), %rdi
callq 0x2050
movq (%r12,%r14,8), %rdi
callq 0x2050
movq %rbx, %rdx
incq %r14
cmpq %r14, %rbx
jne 0x2d4cf
movq 0x4bf0b(%rip), %rsi     # 0x79418
subq $0x50, %rsp
movl $0x9, %ecx
movq %rsp, %rdi
rep  movsq (%rsi), %es:(%rdi)
callq 0x23266
addq $0x50, %rsp
movq 0x4beec(%rip), %rdi     # 0x79418
callq 0x2050
movq $0x0, 0x4bedc(%rip) # 0x79418
cmpl $0x0, 0x258(%rbp)
je 0x2d56a
subq $0xd0, %rsp
leaq 0x4becd(%rip), %rsi     # 0x79420
movl $0x1a, %ecx
movq %rsp, %rdi
rep  movsq (%rsi), %es:(%rdi)
callq 0x23972
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