// File: /workspace/github_c_makefile_star2_O2/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 %rdx, -0x50(%rbp)
movq %rdi, %r14
movq 0x248(%rbp), %rdx
leaq 0xf0(%rbp), %r15
leaq 0xb0(%rbp), %rbx
cmpl $0x0, 0x258(%rbp)
movq %rsi, -0x80(%rbp)
movq %r9, -0x38(%rbp)
je 0x293a8
leaq 0x2a119(%rip), %rsi     # 0x534ac
leaq -0x190(%rbp), %rdi
xorl %eax, %eax
callq 0x2260
movl $0x88, %eax
jmp 0x293ba
leaq -0x190(%rbp), %rdi
movq %rdx, %rsi
callq 0x2080
pushq $0x28
popq %rax
movq (%r15,%rax), %rax
movq %rax, -0xc8(%rbp)
movl 0x1c(%rbx), %r12d
movq 0x10(%rbx), %rdx
movl 0x18(%rbx), %ecx
movq 0x28(%rbp), %r13
movq %r13, %rdi
movq 0x58(%rbp), %rbx
movq %rbx, %rsi
callq 0x47a64
xorl %eax, %eax
testl %r12d, %r12d
movl $0x0, %ecx
movl %r12d, -0x40(%rbp)
cmovgl %r12d, %ecx
cmpq %rax, %rcx
je 0x29414
movss (%rbx,%rax,4), %xmm1
subss (%r13,%rax,4), %xmm1
movq 0x8(%r14), %rdx
movss %xmm1, (%rdx,%rax,4)
incq %rax
jmp 0x293f5
cvtsd2ss %xmm0, %xmm0
movss %xmm0, -0x84(%rbp)
cvtss2sd %xmm0, %xmm0
leaq 0x2a81d(%rip), %rdi     # 0x53c48
movsd %xmm0, -0x78(%rbp)
movb $0x1, %al
callq 0x20f0
leaq 0x80(%rbp), %rax
movl 0x4(%rax), %eax
pushq $0x3
popq %rcx
cltd
idivl %ecx
leaq 0xb0(%rbp), %rcx
movl 0x18(%rcx), %edx
leaq 0x2a812(%rip), %rdi     # 0x53c6a
movl %eax, %esi
xorl %eax, %eax
callq 0x20f0
movl 0x8(%r15), %eax
movq %rax, -0x60(%rbp)
cmpq $0x0, 0x4afa7(%rip)     # 0x74418
jne 0x2956b
pushq $0x48
popq %rdi
callq 0x21d0
movq %rax, 0x4af92(%rip)     # 0x74418
leaq 0x80(%rbp), %r15
movl 0x4(%r15), %edx
movq %rax, %rdi
movq -0x60(%rbp), %r13
movl %r13d, %esi
callq 0x210c7
movq %rsp, -0x30(%rbp)
movq %rsp, %r12
leaq 0xf(,%r13,4), %rax
andq $-0x10, %rax
subq %rax, %r12
movq %r12, %rsp
movq %rsp, %rbx
subq %rax, %rbx
movq %rbx, %rsp
subq $0x30, %rsp
movups (%r15), %xmm0
movups 0x10(%r15), %xmm1
movups 0x20(%r15), %xmm2
movups %xmm2, 0x20(%rsp)
movups %xmm1, 0x10(%rsp)
movups %xmm0, (%rsp)
movq %r12, %rdi
movq %rbx, %rsi
movq -0x50(%rbp), %r15
movq %r15, %rdx
movl %r13d, %ecx
movl 0x48(%rbp), %r8d
callq 0x34062
addq $0x30, %rsp
movq 0x4af12(%rip), %rdi     # 0x74418
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)
pushq $0x1
popq %r9
movq %r15, %rsi
movl %r13d, %edx
movq 0x20(%rbp), %rcx
movl 0x48(%rbp), %r8d
callq 0x1eb7c
addq $0x30, %rsp
movq 0x4aecc(%rip), %rcx     # 0x74418
movl %eax, 0x8(%rcx)
movq %r15, %rdi
movl %r13d, %esi
movq %r12, %rdx
movq %rbx, %rcx
callq 0x34037
movq -0x30(%rbp), %rsp
leaq 0xf0(%rbp), %r15
cmpl $0x0, 0x258(%rbp)
je 0x2959f
cmpl $0x0, 0x1c0(%rbp)
je 0x29779
leaq 0x2a533(%rip), %rsi     # 0x53abb
movq -0x38(%rbp), %rdi
callq 0x2210
movq %rax, %r15
movl 0x230(%rbp), %ebx
jmp 0x29818
movl (%r15), %esi
movl 0x8(%r15), %edx
movl 0xc(%r15), %ecx
leaq 0x4ae6f(%rip), %rdi     # 0x74420
callq 0x21414
movl 0x8(%r15), %edi
movq 0x4ae57(%rip), %rax     # 0x74418
movq 0x20(%rax), %rsi
movq 0x4ae74(%rip), %rdx     # 0x74440
movq 0x4ae8d(%rip), %rcx     # 0x74460
pushq $0x1
popq %r8
callq 0x444de
movq -0x60(%rbp), %rax
cvtsi2ss %eax, %xmm0
movss %xmm0, -0x30(%rbp)
cvtsi2ssl -0x40(%rbp), %xmm0
movss %xmm0, -0x40(%rbp)
xorl %r12d, %r12d
testl %eax, %eax
movl $0x0, %ebx
cmovgl %eax, %ebx
movslq (%r15), %rax
cmpq %rax, %r12
jge 0x29574
movq 0x4aecd(%rip), %rax     # 0x744e0
movl $0x1, (%rax,%r12,4)
movq 0x4ae1e(%rip), %rax     # 0x74440
movss (%rax,%r12,4), %xmm0
movq 0x4ae19(%rip), %rax     # 0x74448
movss %xmm0, (%rax,%r12,4)
cvtss2sd %xmm0, %xmm0
ucomisd 0x21a0f(%rip), %xmm0    # 0x4b050
jb 0x29649
sqrtsd %xmm0, %xmm0
jmp 0x2964e
callq 0x2290
movq -0x50(%rbp), %r13
movsd 0x219ee(%rip), %xmm1    # 0x4b048
divsd %xmm0, %xmm1
cvtsd2ss %xmm1, %xmm0
movq 0x4adcf(%rip), %rax     # 0x74438
movss %xmm0, (%rax,%r12,4)
movq 0x4adea(%rip), %rax     # 0x74460
movq (%rax,%r12,8), %rsi
xorl %eax, %eax
cmpq %rax, %rbx
je 0x29694
movss (%rsi,%rax,4), %xmm1
mulss %xmm0, %xmm1
movss %xmm1, (%rsi,%rax,4)
incq %rax
jmp 0x2967c
movq 0x4adcd(%rip), %rax     # 0x74468
movq (%rax,%r12,8), %rdi
movq 0x4ad72(%rip), %rdx     # 0x74418
callq 0x23e8f
movq 0x4ada6(%rip), %rax     # 0x74458
movq (%rax,%r12,8), %rdi
movq 0x4ada3(%rip), %rax     # 0x74460
movq (%rax,%r12,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 %r13, %rcx
movq -0x60(%rbp), %r13
movl %r13d, %r8d
movl %r12d, %r9d
callq 0x235a3
addq $0x30, %rsp
movq 0x4ad5a(%rip), %rax     # 0x74460
movq (%rax,%r12,8), %rdi
movl %r13d, %esi
callq 0x100f2
divss -0x30(%rbp), %xmm0
movq 0x4ad72(%rip), %rax     # 0x74490
movss %xmm0, (%rax,%r12,4)
movq 0x4ad3d(%rip), %rax     # 0x74468
movq (%rax,%r12,8), %rdi
movl %r13d, %esi
callq 0x100f2
divss -0x30(%rbp), %xmm0
movq 0x4ad55(%rip), %rax     # 0x74498
movss %xmm0, (%rax,%r12,4)
movq 0x4ad08(%rip), %rax     # 0x74458
movq (%rax,%r12,8), %rdi
movl 0x4acd2(%rip), %esi     # 0x7442c
callq 0x100f2
divss -0x40(%rbp), %xmm0
movq 0x4ad1d(%rip), %rax     # 0x74488
movss %xmm0, (%rax,%r12,4)
incq %r12
jmp 0x29600
leaq 0x279d0(%rip), %rsi     # 0x51150
movq -0x38(%rbp), %rbx
movq %rbx, %rdi
callq 0x2210
movq %rax, %r15
leaq 0x22511(%rip), %rdi     # 0x4bca7
movq %rbx, %rsi
xorl %eax, %eax
callq 0x20f0
cmpl $0x0, 0x258(%rbp)
movl 0x230(%rbp), %ebx
jne 0x29818
leaq 0x22752(%rip), %rsi     # 0x4bf08
movq %r15, %rdi
movq 0x10(%rbp), %rdx
xorl %eax, %eax
callq 0x2190
leaq 0x22771(%rip), %rsi     # 0x4bf3c
movq %r15, %rdi
movl 0x38(%rbp), %edx
xorl %eax, %eax
callq 0x2190
leaq 0x22793(%rip), %rsi     # 0x4bf72
movq %r15, %rdi
movl 0xe8(%rbp), %edx
xorl %eax, %eax
callq 0x2190
leaq 0x22832(%rip), %rsi     # 0x4c028
movq %r15, %rdi
movl 0x40(%rbp), %edx
xorl %eax, %eax
callq 0x2190
leaq 0x2ccd5(%rip), %rdi     # 0x564df
pushq $0x2
popq %rsi
pushq $0x1
popq %rdx
movq %r15, %rcx
callq 0x2280
leaq 0x1c8(%rbp), %r12
movl 0x258(%rbp), %eax
orl %ebx, %eax
jne 0x298bf
leaq 0x2a469(%rip), %rdi     # 0x53c9d
pushq $0x16
popq %rsi
pushq $0x1
popq %rdx
movq %r15, %rcx
callq 0x2280
cvtss2sd (%r12), %xmm0
leaq 0x2a465(%rip), %rsi     # 0x53cb4
movq %r15, %rdi
movb $0x1, %al
callq 0x2190
cvtss2sd 0x4(%r12), %xmm0
leaq 0x2a469(%rip), %rsi     # 0x53cd0
movq %r15, %rdi
movb $0x1, %al
callq 0x2190
movl 0x10(%r12), %edx
leaq 0x2a46f(%rip), %rsi     # 0x53cec
movq %r15, %rdi
xorl %eax, %eax
callq 0x2190
cmpl $0x0, 0x20(%r12)
je 0x298bf
cvtss2sd 0x8(%r12), %xmm0
leaq 0x2a469(%rip), %rsi     # 0x53d06
movq %r15, %rdi
movb $0x1, %al
callq 0x2190
cvtss2sd 0xc(%r12), %xmm0
leaq 0x2a46d(%rip), %rsi     # 0x53d22
movq %r15, %rdi
movb $0x1, %al
callq 0x2190
movq %r15, -0x48(%rbp)
leaq -0xcc(%rbp), %r15
andl $0x0, (%r15)
subq $0x8, %rsp
leaq -0x190(%rbp), %rax
leaq -0x128(%rbp), %rbx
movq %r15, %rdi
movq %rbx, %rsi
movq 0xe0(%rbp), %rdx
movq 0x50(%rbp), %rcx
movl 0x78(%rbp), %r8d
movl 0x68(%rbp), %r9d
pushq %rax
callq 0x156c8
popq %rax
popq %rcx
movq (%rbx), %rdx
movl (%r15), %ecx
movq 0x18(%r12), %r8
movq 0xd0(%rbp), %r13
movq %r13, %rdi
movl 0xd8(%rbp), %r12d
movl %r12d, %esi
callq 0x1d554
movss %xmm0, -0x40(%rbp)
movq %r13, %rdi
movl %r12d, %esi
movq 0x30(%rbp), %rdx
callq 0x1d812
movss %xmm0, -0x38(%rbp)
movq (%rbx), %rdi
movl (%r15), %esi
movq 0x60(%rbp), %rdx
callq 0x1d812
movss %xmm0, -0x30(%rbp)
movq (%rbx), %rdi
callq 0x2050
movl 0x230(%rbp), %edx
testl %edx, %edx
je 0x29991
leaq 0x2a3d3(%rip), %rsi     # 0x53d3e
movq -0x48(%rbp), %r13
movq %r13, %rdi
movl %edx, %ebx
xorl %eax, %eax
callq 0x2190
cmpl $0x0, 0x258(%rbp)
leaq 0x80(%rbp), %r12
jne 0x29a26
jmp 0x299bb
movl %edx, %ebx
cmpl $0x0, 0x258(%rbp)
movq -0x48(%rbp), %r13
leaq 0x80(%rbp), %r12
jne 0x29a26
leaq 0x2a3aa(%rip), %rsi     # 0x53d58
movq %r13, %rdi
movl 0x70(%rbp), %edx
xorl %eax, %eax
callq 0x2190
movl 0x38(%rbp), %eax
subl 0x68(%rbp), %eax
cvtsi2ss %eax, %xmm0
movss -0x30(%rbp), %xmm1
subss -0x38(%rbp), %xmm1
mulss -0x68(%rbp), %xmm0
subss %xmm0, %xmm1
movss %xmm1, -0x30(%rbp)
cvtss2sd -0x40(%rbp), %xmm0
leaq 0x2a389(%rip), %rsi     # 0x53d72
movq %r13, %rdi
movb $0x1, %al
callq 0x2190
cvtss2sd -0x30(%rbp), %xmm0
leaq 0x2a38f(%rip), %rsi     # 0x53d8e
movq %r13, %rdi
movb $0x1, %al
callq 0x2190
leaq 0x2a39a(%rip), %rsi     # 0x53daa
leaq 0x3a719(%rip), %rdx     # 0x64130
movq %r13, %rdi
movsd -0x78(%rbp), %xmm0
movb $0x1, %al
callq 0x2190
cmpq $0x0, 0x238(%rbp)
movq 0x20(%rbp), %rcx
movl %ebx, %esi
je 0x29b17
movq %rsp, %r15
movl 0x38(%rbp), %esi
movl %esi, %eax
movq %rsp, %rbx
leaq 0xf(,%rax,4), %rax
andq $-0x10, %rax
subq %rax, %rbx
movq %rbx, %rsp
movq 0x8(%r14), %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 0x25669(%rip), %r8      # 0x4f0ee
movq %rbx, %rdi
callq 0x2a51d
addq $0x30, %rsp
testl %eax, %eax
je 0x29b0e
leaq -0x260(%rbp), %rcx
leaq -0x2d0(%rbp), %r8
movq 0x238(%rbp), %rdi
movq %rbx, %rsi
movl %eax, %edx
callq 0xfe18
movss %xmm0, -0x30(%rbp)
leaq 0x2a304(%rip), %rdi     # 0x53dc4
pushq $0x15
popq %rsi
pushq $0x1
popq %rbx
movq %rbx, %rdx
movq %r13, %rcx
callq 0x2280
cmpl $0x0, 0x258(%rbp)
leaq 0x2a301(%rip), %rax     # 0x53de0
leaq 0x2a2f4(%rip), %rdi     # 0x53dda
cmoveq %rax, %rdi
pushq $0x5
popq %rsi
movq %rbx, %rdx
movq %r13, %rcx
callq 0x2280
cvtss2sd -0x30(%rbp), %xmm0
leaq 0x2a1e1(%rip), %rsi     # 0x53ce5
movq %r13, %rdi
movb $0x1, %al
callq 0x2190
movq %r15, %rsp
movl 0x230(%rbp), %esi
testl %esi, %esi
jne 0x29b57
leaq 0x2a2c4(%rip), %rsi     # 0x53de6
leaq -0x2d0(%rbp), %rbx
movq %rbx, %rdi
movq 0x248(%rbp), %rdx
xorl %eax, %eax
callq 0x2260
leaq 0x2760f(%rip), %rsi     # 0x51150
movq %rbx, %rdi
callq 0x2210
movq %rax, %rdi
callq 0x20c0
movl 0x230(%rbp), %esi
andl $0x0, -0x90(%rbp)
movslq 0x4(%r12), %rax
movq 0x18(%r12), %rcx
xorps %xmm0, %xmm0
xorl %edx, %edx
leaq 0xf0(%rbp), %r12
movq 0x30(%rbp), %rbx
cmpq %rax, %rdx
jge 0x29b8c
cvtss2sd (%rcx,%rdx,4), %xmm1
addsd %xmm1, %xmm0
addq $0x3, %rdx
jmp 0x29b78
xorps %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jb 0x29b9b
sqrtsd %xmm0, %xmm0
jmp 0x29ba6
callq 0x2290
movl 0x230(%rbp), %esi
movq %rsp, -0xa8(%rbp)
testl %esi, %esi
setne %al
cmpl $0x0, 0x250(%rbp)
sete %cl
orb %al, %cl
andl $0x0, -0x54(%rbp)
movzbl %cl, %r9d
xorl $0x5, %r9d
leal 0xf(,%r9,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, %rcx
subq %rax, %rcx
movq %rcx, -0x30(%rbp)
movq %rcx, %rsp
movq %rsp, %rcx
subq %rax, %rcx
movq %rcx, -0x38(%rbp)
movq %rcx, %rsp
movl (%r12), %eax
movq %rsp, %r12
leaq 0xf(,%rax,4), %rax
andq $-0x10, %rax
subq %rax, %r12
movq %r12, %rsp
movq %rsp, %r8
movq -0x60(%rbp), %rcx
leaq 0xf(,%rcx,8), %rax
andq $-0x10, %rax
subq %rax, %r8
movq %r8, %rsp
xorl %eax, %eax
testl %ecx, %ecx
movl $0x0, %edx
cmovgl %ecx, %edx
cmpq %rax, %rdx
je 0x29c60
movq 0x18(%r14), %rcx
cvtss2sd (%rcx,%rax,4), %xmm1
movsd %xmm1, (%r8,%rax,8)
incq %rax
jmp 0x29c47
cvtsd2ss %xmm0, %xmm0
movss %xmm0, -0x8c(%rbp)
pushq $-0x1
popq %rax
movl %eax, -0x6c(%rbp)
leaq -0x120(%rbp), %rdi
xorl %r13d, %r13d
movq %rdx, -0xa0(%rbp)
movq %r9, -0x78(%rbp)
movq %r8, -0x98(%rbp)
movq %r14, -0xc0(%rbp)
cmpl %r9d, %r13d
je 0x2a1aa
testl %esi, %esi
je 0x29ca7
incl %r13d
jmp 0x29c95
cmpl $0x0, 0x4a762(%rip)     # 0x74410
je 0x29cd9
cmpl $0x1, %r13d
je 0x29ca2
cmpl $0x2, %r13d
ja 0x29ce7
je 0x29f51
cmpl $0x1, %r13d
je 0x29ca2
movl $0x746946, -0x120(%rbp) # imm = 0x746946
movb $0x4f, %al
jmp 0x29f75
cmpl $0x3, %r13d
ja 0x29cb6
cmpl $0x2, %r13d
jne 0x29ca2
jmp 0x29cb6
cmpl $0x3, %r13d
jne 0x29d88
movups 0x2a185(%rip), %xmm0    # 0x53e7d
movups %xmm0, -0x102(%rbp)
movups 0x2a169(%rip), %xmm0    # 0x53e6f
movaps %xmm0, -0x110(%rbp)
movupd 0x2a14a(%rip), %xmm0    # 0x53e5f
movapd %xmm0, -0x120(%rbp)
movl 0x78(%rbp), %edi
movq 0x50(%rbp), %rsi
movq 0x60(%rbp), %rdx
callq 0x14356
movq %rax, %r14
movq -0x80(%rbp), %r15
movq %r15, %rdi
movl 0x48(%rbp), %ebx
movl %ebx, %esi
movq 0x20(%rbp), %rdx
callq 0x139f6
movq %r14, %rdi
movl 0x78(%rbp), %esi
movq 0x50(%rbp), %rdx
callq 0x139f6
subq $0x8, %rsp
movq -0x98(%rbp), %rdi
movq -0x60(%rbp), %rsi
movq %r15, %rdx
movq %r14, %rcx
movl %ebx, %r8d
xorl %r9d, %r9d
pushq $0x0
callq 0x35418
popq %rcx
popq %rdx
movq %r14, %rdi
callq 0x2050
movq %r15, %r14
jmp 0x2a007
movq -0x48(%rbp), %rdi
callq 0x21e0
leaq 0x2ae9e(%rip), %rdi     # 0x54c36
callq 0x2090
movups 0x2a0e9(%rip), %xmm0    # 0x53e8d
movaps %xmm0, -0x120(%rbp)
movups 0x2a0eb(%rip), %xmm0    # 0x53e9d
movaps %xmm0, -0x110(%rbp)
movups 0x2a0e6(%rip), %xmm0    # 0x53ea6
movups %xmm0, -0x107(%rbp)
callq 0x20b0
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 0x4a61b(%rip), %rcx     # 0x74418
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)
leaq 0x80(%rbp), %r15
movups (%r15), %xmm0
movups 0x10(%r15), %xmm1
movups 0x20(%r15), %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 %rbx, 0x68(%rsp)
movq -0x60(%rbp), %rax
movl %eax, 0x60(%rsp)
movq -0x80(%rbp), %r14
movq -0x50(%rbp), %rax
movq %rax, 0x58(%rsp)
leaq -0x190(%rbp), %rax
movq %rax, 0x50(%rsp)
xorps %xmm1, %xmm1
movq -0x98(%rbp), %rdi
leaq 0x29fbd(%rip), %rsi     # 0x53ebd
movq %r14, %rdx
movsd 0x26975(%rip), %xmm0    # 0x50880
movq 0x20(%rbp), %r8
movl 0x48(%rbp), %r9d
callq 0x30799
addq $0xf0, %rsp
callq 0x20b0
cvtsi2sd %rax, %xmm0
subsd -0xb8(%rbp), %xmm0
divsd 0x2695f(%rip), %xmm0    # 0x50898
leaq 0x29f84(%rip), %rdi     # 0x53ec4
movb $0x1, %al
callq 0x20f0
callq 0x20b0
jmp 0x2a00e
movl $0x746946, -0x120(%rbp) # imm = 0x746946
callq 0x20d0
movl $0x52525220, -0x120(%rbp,%rax) # imm = 0x52525220
movb $0x0, -0x11c(%rbp,%rax)
movb $0x43, %al
movzbl %al, %r15d
leaq -0x260(%rbp), %rbx
movq %rbx, %rdi
leaq 0x29e73(%rip), %rsi     # 0x53dfd
movl %r15d, %edx
xorl %eax, %eax
callq 0x2260
leaq -0x120(%rbp), %rdi
movq %rbx, %rsi
callq 0x2240
leaq 0x29e5c(%rip), %rdi     # 0x53e06
movl %r15d, %esi
xorl %eax, %eax
callq 0x20f0
movq 0x4a45d(%rip), %rsi     # 0x74418
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 %r14, %rdi
movq 0x10(%rbp), %rdx
movl %r15d, %ecx
leaq -0x90(%rbp), %r8
callq 0x23c8c
addq $0x30, %rsp
testl %eax, %eax
js 0x2a16e
movq -0x80(%rbp), %r14
leaq 0x80(%rbp), %r15
movq -0x48(%rbp), %rbx
leaq 0x29eda(%rip), %rdi     # 0x53ef3
pushq $0x1e
popq %rsi
pushq $0x1
popq %rdx
movq %rbx, %rcx
callq 0x2280
movq 0x4a3ea(%rip), %rax     # 0x74418
subq $0xc0, %rsp
movups (%r15), %xmm0
movups 0x10(%r15), %xmm1
movups 0x20(%r15), %xmm2
movups %xmm2, 0x50(%rsp)
movups %xmm1, 0x40(%rsp)
movups %xmm0, 0x30(%rsp)
movl 0x258(%rbp), %ecx
movl %ecx, 0xa0(%rsp)
leaq -0x2d0(%rbp), %rcx
movq %rcx, 0x98(%rsp)
movq %rbx, 0x90(%rsp)
leaq -0x120(%rbp), %r15
movq %r15, 0x88(%rsp)
movq -0x50(%rbp), %rcx
movq %rcx, 0x78(%rsp)
movq 0x30(%rbp), %rbx
movq %rbx, 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 %r14, 0x18(%rsp)
leaq 0xf0(%rbp), %rcx
movq %rcx, 0x10(%rsp)
andl $0x0, 0xb0(%rsp)
movq %rax, 0x8(%rsp)
andl $0x0, 0x80(%rsp)
movq -0xc0(%rbp), %r14
movq %r14, (%rsp)
leaq -0x54(%rbp), %rdi
movq -0x38(%rbp), %rsi
movq -0x40(%rbp), %rdx
movq -0x68(%rbp), %rcx
movq -0x30(%rbp), %r8
movq 0x240(%rbp), %r9
movss -0x8c(%rbp), %xmm0
callq 0x2a60c
movq %r15, %rdi
addq $0xc0, %rsp
cmpl $0x2, %r13d
movl 0x230(%rbp), %esi
movq -0x78(%rbp), %r9
jne 0x29ca2
movl -0x54(%rbp), %r8d
leaq 0xf0(%rbp), %rax
movl (%rax), %eax
testl %eax, %eax
movl $0x0, %ecx
cmovlel %ecx, %eax
xorl %ecx, %ecx
cmpq %rcx, %rax
je 0x2a162
movq 0x20(%r14), %rdx
movss (%rdx,%rcx,4), %xmm0
movss %xmm0, (%r12,%rcx,4)
incq %rcx
jmp 0x2a149
decl %r8d
movl %r8d, -0x6c(%rbp)
jmp 0x29ca2
leaq 0x29cc4(%rip), %rdi     # 0x53e39
pushq $0x25
popq %rsi
pushq $0x1
popq %rdx
movq -0x48(%rbp), %rcx
callq 0x2280
leaq 0x2aad7(%rip), %rdi     # 0x54c62
callq 0x2090
movl 0x230(%rbp), %esi
movq -0x78(%rbp), %r9
leaq -0x120(%rbp), %rdi
movq 0x30(%rbp), %rbx
jmp 0x29ca2
movq -0x48(%rbp), %rdi
callq 0x20c0
movl 0x230(%rbp), %r15d
movl -0x6c(%rbp), %eax
testl %eax, %eax
movq -0x40(%rbp), %rbx
js 0x2a252
movl %eax, %r13d
movq -0x38(%rbp), %rax
movq (%rax,%r13,8), %rsi
leaq 0x29d37(%rip), %rdi     # 0x53f12
xorl %r15d, %r15d
xorl %eax, %eax
callq 0x20f0
leaq 0xf0(%rbp), %rcx
movl (%rcx), %eax
movq 0x30(%rcx), %rcx
testl %eax, %eax
cmovlel %r15d, %eax
cmpq %r15, %rax
je 0x2a226
movss (%r12,%r15,4), %xmm0
movq 0x20(%r14), %rdx
movss %xmm0, (%rdx,%r15,4)
movq -0x30(%rbp), %rdx
movq (%rdx,%r13,8), %rdx
movss (%rdx,%r15,4), %xmm0
movss %xmm0, (%rcx,%r15,4)
incq %r15
jmp 0x2a1f8
xorl %eax, %eax
movl 0x230(%rbp), %r15d
movq -0xa0(%rbp), %rdx
cmpq %rax, %rdx
je 0x2a252
movq (%rbx,%r13,8), %rcx
movss (%rcx,%rax,4), %xmm0
movq 0x18(%r14), %rcx
movss %xmm0, (%rcx,%rax,4)
incq %rax
jmp 0x2a236
testl %r15d, %r15d
movq -0x68(%rbp), %r13
je 0x2a2d6
movq 0x4a1b6(%rip), %rsi     # 0x74418
subq $0x50, %rsp
pushq $0x9
popq %rcx
movq %rsp, %rdi
rep  movsq (%rsi), %es:(%rdi)
callq 0x21113
addq $0x50, %rsp
movq 0x4a199(%rip), %rdi     # 0x74418
callq 0x2050
andq $0x0, 0x4a18c(%rip)     # 0x74418
cmpl $0x0, 0x258(%rbp)
je 0x2a2b8
subq $0xd0, %rsp
leaq 0x4a17d(%rip), %rsi     # 0x74420
pushq $0x1a
popq %rcx
movq %rsp, %rdi
rep  movsq (%rsi), %es:(%rdi)
callq 0x215b7
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
cmpq $0x0, 0x248(%rbp)
setne %al
movl -0x54(%rbp), %r15d
cmpl $0x2, %r15d
setge %cl
testb %cl, %al
je 0x2a386
movl %r15d, %r12d
leaq 0x29c32(%rip), %rsi     # 0x53f30
leaq -0x260(%rbp), %r14
leaq -0x190(%rbp), %rdx
movq %r14, %rdi
xorl %eax, %eax
callq 0x2260
leaq 0x29c2b(%rip), %rdi     # 0x53f48
movq %r14, %rsi
xorl %eax, %eax
callq 0x20f0
leaq 0x26e22(%rip), %rsi     # 0x51150
movq %r14, %rdi
callq 0x2210
movq %rax, %r14
leaq 0xf0(%rbp), %rax
movl (%rax), %edx
leaq 0x29c1f(%rip), %rsi     # 0x53f68
movq %r14, %rdi
movq %r15, -0x50(%rbp)
movl %r15d, %ecx
xorl %eax, %eax
callq 0x2190
leaq 0x29c32(%rip), %r15     # 0x53f93
xorl %r13d, %r13d
cmpq %r13, %r12
je 0x2a395
movq -0x38(%rbp), %rax
movq (%rax,%r13,8), %rcx
incq %r13
movq %r14, %rdi
movq %r15, %rsi
movl %r13d, %edx
xorl %eax, %eax
callq 0x2190
jmp 0x2a364
xorl %r12d, %r12d
testl %r15d, %r15d
cmovgl %r15d, %r12d
jmp 0x2a4dc
leaq 0x29c08(%rip), %rdi     # 0x53fa4
pushq $0x6
popq %rsi
pushq $0x1
popq %rdx
movq %r14, %rcx
callq 0x2280
movq -0x50(%rbp), %rax
movl %eax, %r13d
xorl %r15d, %r15d
subl $0x1, %r13d
jb 0x2a3d7
leal 0x2(%r15), %edx
incl %r15d
movq %r14, %rdi
leaq 0x29be0(%rip), %rsi     # 0x53fab
movl %r15d, %ecx
xorl %eax, %eax
callq 0x2190
jmp 0x2a3b4
movq -0x50(%rbp), %r15
leal 0x2(%r15), %edx
leaq 0x29bd0(%rip), %rsi     # 0x53fb6
movq %r14, %rdi
xorl %eax, %eax
callq 0x2190
cmpl $0x0, 0x258(%rbp)
jne 0x2a411
addl $0x3, %r15d
leaq 0x29bc0(%rip), %rsi     # 0x53fc4
movq %r14, %rdi
movl %r15d, %edx
xorl %eax, %eax
callq 0x2190
pushq $0xa
popq %rdi
movq %r14, %rsi
callq 0x2140
leaq 0x29bac(%rip), %r13     # 0x53fcf
xorl %r15d, %r15d
leaq 0xf0(%rbp), %rax
movslq (%rax), %rax
cmpq %rax, %r15
jge 0x2a4d0
movq %r14, %rdi
leaq 0x2cde8(%rip), %rsi     # 0x5722b
movl %r15d, %edx
xorl %eax, %eax
callq 0x2190
xorl %ebx, %ebx
cmpq %rbx, %r12
je 0x2a474
movq -0x30(%rbp), %rax
movq (%rax,%rbx,8), %rax
cvtss2sd (%rax,%r15,4), %xmm0
movq %r14, %rdi
movq %r13, %rsi
movb $0x1, %al
callq 0x2190
incq %rbx
jmp 0x2a44f
movq -0xc8(%rbp), %rax
cvtss2sd (%rax,%r15,4), %xmm0
movq %r14, %rdi
leaq 0x27359(%rip), %rsi     # 0x517e4
movb $0x1, %al
callq 0x2190
cmpl $0x0, 0x258(%rbp)
jne 0x2a4b9
movq 0x49fa6(%rip), %rax     # 0x74448
cvtss2sd (%rax,%r15,4), %xmm0
movq %r14, %rdi
leaq 0x27332(%rip), %rsi     # 0x517e4
movb $0x1, %al
callq 0x2190
pushq $0xa
popq %rdi
movq %r14, %rsi
callq 0x2140
incq %r15
movq -0x40(%rbp), %rbx
jmp 0x2a426
movq %r14, %rdi
callq 0x20c0
movq -0x68(%rbp), %r13
movl %r12d, %r14d
xorl %r15d, %r15d
movq -0x38(%rbp), %r12
cmpq %r15, %r14
je 0x2a25b
movq -0x30(%rbp), %rax
movq (%rax,%r15,8), %rdi
callq 0x2050
movq (%rbx,%r15,8), %rdi
callq 0x2050
movq (%r13,%r15,8), %rdi
callq 0x2050
movq (%r12,%r15,8), %rdi
callq 0x2050
incq %r15
jmp 0x2a4e6