// File: /workspace/github_c_makefile_star2_O0/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 $0x528, %rsp            # imm = 0x528
movl 0x258(%rbp), %eax
movl 0x250(%rbp), %eax
movq 0x248(%rbp), %rax
movq 0x240(%rbp), %rax
movq 0x238(%rbp), %rax
movl 0x230(%rbp), %eax
leaq 0x1f0(%rbp), %rax
movq %rax, -0x4a0(%rbp)
leaq 0x1c8(%rbp), %rax
movq %rax, -0x498(%rbp)
movl 0x1c0(%rbp), %eax
leaq 0xf0(%rbp), %rax
movq %rax, -0x490(%rbp)
movl 0xe8(%rbp), %eax
movq 0xe0(%rbp), %rax
movl 0xd8(%rbp), %eax
movq 0xd0(%rbp), %rax
leaq 0xb0(%rbp), %rax
movq %rax, -0x488(%rbp)
leaq 0x80(%rbp), %rax
movq %rax, -0x480(%rbp)
movl 0x78(%rbp), %eax
movl 0x70(%rbp), %eax
movl 0x68(%rbp), %eax
movq 0x60(%rbp), %rax
movq 0x58(%rbp), %rax
movq 0x50(%rbp), %rax
movl 0x48(%rbp), %eax
movl 0x40(%rbp), %eax
movl 0x38(%rbp), %eax
movq 0x30(%rbp), %rax
movq 0x28(%rbp), %rax
movq 0x20(%rbp), %rax
movq 0x18(%rbp), %rax
movq 0x10(%rbp), %rax
movq %rdi, -0x30(%rbp)
movq %rsi, -0x38(%rbp)
movq %rdx, -0x40(%rbp)
movq %rcx, -0x48(%rbp)
movl %r8d, -0x4c(%rbp)
movq %r9, -0x58(%rbp)
movss %xmm0, -0x5c(%rbp)
cmpl $0x0, 0x258(%rbp)
jne 0x3f919
leaq -0xc0(%rbp), %rdi
movq 0x248(%rbp), %rdx
leaq 0x3caa0(%rip), %rsi     # 0x7c39e
movb $0x0, %al
callq 0x1200
movq -0x490(%rbp), %rax
movq 0x28(%rax), %rax
movq %rax, -0xc8(%rbp)
jmp 0x3f94a
leaq -0xc0(%rbp), %rdi
movq 0x248(%rbp), %rdx
leaq 0x3ecda(%rip), %rsi     # 0x7e608
movb $0x0, %al
callq 0x1200
movq -0x490(%rbp), %rax
movq 0x88(%rax), %rax
movq %rax, -0xc8(%rbp)
movq -0x488(%rbp), %rax
movl 0x1c(%rax), %ecx
movl %ecx, -0xcc(%rbp)
movq 0x28(%rbp), %rdi
movq 0x58(%rbp), %rsi
movq 0x10(%rax), %rdx
movl 0x18(%rax), %ecx
callq 0x70af0
cvtsd2ss %xmm0, %xmm0
movss %xmm0, -0xd4(%rbp)
movl $0x0, -0xd0(%rbp)
movl -0xd0(%rbp), %eax
cmpl -0xcc(%rbp), %eax
jge 0x3f9d7
movq 0x58(%rbp), %rax
movslq -0xd0(%rbp), %rcx
movss (%rax,%rcx,4), %xmm0
movq 0x28(%rbp), %rax
movslq -0xd0(%rbp), %rcx
subss (%rax,%rcx,4), %xmm0
movq -0x30(%rbp), %rax
movq 0x8(%rax), %rax
movslq -0xd0(%rbp), %rcx
movss %xmm0, (%rax,%rcx,4)
movl -0xd0(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xd0(%rbp)
jmp 0x3f984
movss -0xd4(%rbp), %xmm0
cvtss2sd %xmm0, %xmm0
leaq 0x3f386(%rip), %rdi     # 0x7ed70
movb $0x1, %al
callq 0x10d0
movq -0x480(%rbp), %rax
movl 0x4(%rax), %eax
movl $0x3, %ecx
cltd
idivl %ecx
movl %eax, %esi
movq -0x488(%rbp), %rax
movl 0x18(%rax), %edx
leaq 0x3f37c(%rip), %rdi     # 0x7ed92
movb $0x0, %al
callq 0x10d0
movq -0x490(%rbp), %rax
movl 0x8(%rax), %eax
movl %eax, -0xd8(%rbp)
cmpq $0x0, 0x5c9a3(%rip)     # 0x9c3d8
jne 0x3fb81
movl $0x48, %edi
callq 0x1180
movq %rax, %rcx
movq -0x480(%rbp), %rax
movq %rcx, 0x5c982(%rip)     # 0x9c3d8
movq 0x5c97b(%rip), %rdi     # 0x9c3d8
movl -0xd8(%rbp), %esi
movl 0x4(%rax), %edx
callq 0x31560
movq -0x480(%rbp), %rax
movl -0xd8(%rbp), %ecx
movq %rsp, %rdx
movq %rdx, -0xe0(%rbp)
leaq 0xf(,%rcx,4), %rdx
andq $-0x10, %rdx
movq %rsp, %rdi
subq %rdx, %rdi
movq %rdi, -0x4b0(%rbp)
movq %rdi, %rsp
movq %rcx, -0xe8(%rbp)
movl -0xd8(%rbp), %ecx
leaq 0xf(,%rcx,4), %rdx
andq $-0x10, %rdx
movq %rsp, %rsi
subq %rdx, %rsi
movq %rsi, -0x4a8(%rbp)
movq %rsi, %rsp
movq %rcx, -0xf0(%rbp)
movq -0x40(%rbp), %rdx
movl -0xd8(%rbp), %ecx
movl 0x48(%rbp), %r8d
subq $0x30, %rsp
movups (%rax), %xmm0
movups 0x10(%rax), %xmm1
movups 0x20(%rax), %xmm2
movq %rsp, %rax
movups %xmm2, 0x20(%rax)
movups %xmm1, 0x10(%rax)
movups %xmm0, (%rax)
callq 0x50690
movq -0x480(%rbp), %rax
addq $0x30, %rsp
movq 0x5c8c8(%rip), %rdi     # 0x9c3d8
movq -0x40(%rbp), %rsi
movl -0xd8(%rbp), %edx
movq 0x20(%rbp), %rcx
movl 0x48(%rbp), %r8d
subq $0x30, %rsp
movups (%rax), %xmm0
movups 0x10(%rax), %xmm1
movups 0x20(%rax), %xmm2
movq %rsp, %rax
movups %xmm2, 0x20(%rax)
movups %xmm1, 0x10(%rax)
movups %xmm0, (%rax)
movl $0x1, %r9d
callq 0x2dc70
movq -0x4b0(%rbp), %rdx
movq -0x4a8(%rbp), %rcx
addq $0x30, %rsp
movl %eax, %esi
movq 0x5c873(%rip), %rax     # 0x9c3d8
movl %esi, 0x8(%rax)
movq -0x40(%rbp), %rdi
movl -0xd8(%rbp), %esi
callq 0x50600
movq -0xe0(%rbp), %rax
movq %rax, %rsp
movl $0x0, -0xf4(%rbp)
cmpl $0x0, 0x258(%rbp)
jne 0x40137
movq -0x490(%rbp), %rax
movl (%rax), %esi
movl 0x8(%rax), %edx
movl 0xc(%rax), %ecx
leaq 0x5c832(%rip), %rdi     # 0x9c3e0
callq 0x31ba0
movq -0x490(%rbp), %rax
movl 0x8(%rax), %edi
movq 0x5c814(%rip), %rax     # 0x9c3d8
movq 0x20(%rax), %rsi
movq 0x5c831(%rip), %rdx     # 0x9c400
movq 0x5c84a(%rip), %rcx     # 0x9c420
movl $0x1, %r8d
callq 0x6ac30
movq $0x0, -0x100(%rbp)
cmpl $0x0, -0xf4(%rbp)
je 0x3fc6a
leaq -0x170(%rbp), %rdi
movq 0x248(%rbp), %rdx
leaq 0x3f1bb(%rip), %rsi     # 0x7edc5
movb $0x0, %al
callq 0x1200
leaq -0x170(%rbp), %rdi
leaq 0x3c753(%rip), %rsi     # 0x7c372
callq 0x11b0
movq %rax, -0x100(%rbp)
leaq -0x170(%rbp), %rsi
leaq 0x378b5(%rip), %rdi     # 0x774ee
movb $0x0, %al
callq 0x10d0
movq -0x100(%rbp), %rdi
leaq 0x3f189(%rip), %rsi     # 0x7edd7
movb $0x0, %al
callq 0x1150
movq -0x100(%rbp), %rdi
leaq 0x3f197(%rip), %rsi     # 0x7edfa
movb $0x0, %al
callq 0x1150
movl $0x0, -0xd0(%rbp)
movq -0x490(%rbp), %rcx
movl -0xd0(%rbp), %eax
cmpl (%rcx), %eax
jge 0x40120
movq 0x5c810(%rip), %rax     # 0x9c4a0
movslq -0xd0(%rbp), %rcx
movl $0x1, (%rax,%rcx,4)
movq 0x5c75b(%rip), %rax     # 0x9c400
movslq -0xd0(%rbp), %rcx
movss (%rax,%rcx,4), %xmm0
movq 0x5c750(%rip), %rax     # 0x9c408
movslq -0xd0(%rbp), %rcx
movss %xmm0, (%rax,%rcx,4)
movq 0x5c735(%rip), %rax     # 0x9c400
movslq -0xd0(%rbp), %rcx
movss (%rax,%rcx,4), %xmm0
cvtss2sd %xmm0, %xmm0
callq 0x1220
movaps %xmm0, %xmm1
movsd 0x3635d(%rip), %xmm0    # 0x76048
divsd %xmm1, %xmm0
cvtsd2ss %xmm0, %xmm0
movq 0x5c6fe(%rip), %rax     # 0x9c3f8
movslq -0xd0(%rbp), %rcx
movss %xmm0, (%rax,%rcx,4)
movq 0x5c6eb(%rip), %rax     # 0x9c3f8
movslq -0xd0(%rbp), %rcx
movss (%rax,%rcx,4), %xmm0
movss %xmm0, -0x174(%rbp)
movq 0x5c6f8(%rip), %rax     # 0x9c420
movslq -0xd0(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, -0x180(%rbp)
movl $0x0, -0x184(%rbp)
movl -0x184(%rbp), %eax
cmpl -0xd8(%rbp), %eax
jge 0x3fd83
movss -0x174(%rbp), %xmm0
movq -0x180(%rbp), %rax
movslq -0x184(%rbp), %rcx
mulss (%rax,%rcx,4), %xmm0
movss %xmm0, (%rax,%rcx,4)
movl -0x184(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x184(%rbp)
jmp 0x3fd44
movq 0x5c69e(%rip), %rax     # 0x9c428
movslq -0xd0(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
movq 0x5c684(%rip), %rax     # 0x9c420
movslq -0xd0(%rbp), %rcx
movq (%rax,%rcx,8), %rsi
movq 0x5c62a(%rip), %rdx     # 0x9c3d8
callq 0x36550
movq -0x480(%rbp), %rax
movq 0x5c657(%rip), %rcx     # 0x9c418
movslq -0xd0(%rbp), %rdx
movq (%rcx,%rdx,8), %rdi
movq 0x20(%rbp), %rsi
movq 0x5c649(%rip), %rcx     # 0x9c420
movslq -0xd0(%rbp), %rdx
movq (%rcx,%rdx,8), %rdx
movq -0x40(%rbp), %rcx
movl -0xd8(%rbp), %r8d
movl -0xd0(%rbp), %r9d
subq $0x30, %rsp
movups (%rax), %xmm0
movups 0x10(%rax), %xmm1
movups 0x20(%rax), %xmm2
movq %rsp, %rax
movups %xmm2, 0x20(%rax)
movups %xmm1, 0x10(%rax)
movups %xmm0, (%rax)
callq 0x35540
addq $0x30, %rsp
movq 0x5c5ff(%rip), %rax     # 0x9c420
movslq -0xd0(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
movl -0xd8(%rbp), %esi
callq 0x15dc0
cvtsi2ssl -0xd8(%rbp), %xmm1
divss %xmm1, %xmm0
movq 0x5c606(%rip), %rax     # 0x9c450
movslq -0xd0(%rbp), %rcx
movss %xmm0, (%rax,%rcx,4)
movq 0x5c5cb(%rip), %rax     # 0x9c428
movslq -0xd0(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
movl -0xd8(%rbp), %esi
callq 0x15dc0
cvtsi2ssl -0xd8(%rbp), %xmm1
divss %xmm1, %xmm0
movq 0x5c5d2(%rip), %rax     # 0x9c458
movslq -0xd0(%rbp), %rcx
movss %xmm0, (%rax,%rcx,4)
movq 0x5c57f(%rip), %rax     # 0x9c418
movslq -0xd0(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
movl 0x5c542(%rip), %esi     # 0x9c3ec
callq 0x15dc0
cvtsi2ssl -0xcc(%rbp), %xmm1
divss %xmm1, %xmm0
movq 0x5c586(%rip), %rax     # 0x9c448
movslq -0xd0(%rbp), %rcx
movss %xmm0, (%rax,%rcx,4)
cmpl $0x0, -0xf4(%rbp)
je 0x4010a
xorps %xmm0, %xmm0
movsd %xmm0, -0x190(%rbp)
movl $0x0, -0x19c(%rbp)
movq 0x5c529(%rip), %rax     # 0x9c420
movslq -0xd0(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, -0x1a8(%rbp)
xorps %xmm0, %xmm0
movsd %xmm0, -0x1b0(%rbp)
movl $0x0, -0x1a0(%rbp)
movq -0x490(%rbp), %rcx
movl -0x1a0(%rbp), %eax
cmpl (%rcx), %eax
jge 0x3fffb
movq -0x490(%rbp), %rax
movq -0x1a8(%rbp), %rdi
movq 0x40(%rax), %rcx
movslq -0x1a0(%rbp), %rdx
movq (%rcx,%rdx,8), %rsi
movl 0x8(%rax), %edx
callq 0x15480
movq -0x490(%rbp), %rax
cvtss2sd %xmm0, %xmm0
movsd %xmm0, -0x198(%rbp)
movsd -0x198(%rbp), %xmm0
mulsd -0x198(%rbp), %xmm0
movsd %xmm0, -0x198(%rbp)
movsd -0x198(%rbp), %xmm0
movq 0x20(%rax), %rax
movslq -0x1a0(%rbp), %rcx
movss (%rax,%rcx,4), %xmm1
cvtss2sd %xmm1, %xmm2
movsd -0x1b0(%rbp), %xmm1
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, -0x1b0(%rbp)
movsd -0x198(%rbp), %xmm0
ucomisd -0x190(%rbp), %xmm0
jbe 0x3ffe5
movsd -0x198(%rbp), %xmm0
movsd %xmm0, -0x190(%rbp)
movl -0x1a0(%rbp), %eax
movl %eax, -0x19c(%rbp)
jmp 0x3ffe7
movl -0x1a0(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1a0(%rbp)
jmp 0x3ff1e
movsd -0x1b0(%rbp), %xmm1
movq 0x5c3f6(%rip), %rax     # 0x9c400
movslq -0xd0(%rbp), %rcx
movss (%rax,%rcx,4), %xmm0
cvtss2sd %xmm0, %xmm0
mulsd %xmm0, %xmm1
movq 0x5c3db(%rip), %rax     # 0x9c400
movslq -0xd0(%rbp), %rcx
movss (%rax,%rcx,4), %xmm0
cvtss2sd %xmm0, %xmm0
mulsd %xmm0, %xmm1
movsd 0x36007(%rip), %xmm0    # 0x76048
divsd %xmm1, %xmm0
cvtsd2ss %xmm0, %xmm0
movq 0x5c3b8(%rip), %rax     # 0x9c408
movslq -0xd0(%rbp), %rcx
movss %xmm0, (%rax,%rcx,4)
movq 0x5c3e5(%rip), %rax     # 0x9c448
movslq -0xd0(%rbp), %rcx
movss (%rax,%rcx,4), %xmm0
cvtss2sd %xmm0, %xmm1
movsd 0x3c3a5(%rip), %xmm0    # 0x7c420
ucomisd %xmm1, %xmm0
jbe 0x4009c
movq 0x5c380(%rip), %rax     # 0x9c408
movslq -0xd0(%rbp), %rcx
movss 0x36005(%rip), %xmm0    # 0x7609c
movss %xmm0, (%rax,%rcx,4)
movq -0x100(%rbp), %rdi
movl -0xd0(%rbp), %edx
movq 0x5c358(%rip), %rax     # 0x9c408
movslq -0xd0(%rbp), %rcx
movss (%rax,%rcx,4), %xmm0
cvtss2sd %xmm0, %xmm0
movq 0x5c381(%rip), %rax     # 0x9c448
movslq -0xd0(%rbp), %rcx
movss (%rax,%rcx,4), %xmm1
cvtss2sd %xmm1, %xmm1
movq 0x5c372(%rip), %rax     # 0x9c450
movslq -0xd0(%rbp), %rcx
movss (%rax,%rcx,4), %xmm2
cvtss2sd %xmm2, %xmm2
movl -0x19c(%rbp), %ecx
movsd -0x190(%rbp), %xmm3
leaq 0x3ed2a(%rip), %rsi     # 0x7ee2d
movb $0x4, %al
callq 0x1150
jmp 0x4010c
movl -0xd0(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xd0(%rbp)
jmp 0x3fc74
cmpl $0x0, -0xf4(%rbp)
je 0x40135
movq -0x100(%rbp), %rdi
callq 0x10a0
jmp 0x40137
cmpl $0x0, 0x1c0(%rbp)
je 0x4015c
movq -0x58(%rbp), %rdi
leaq 0x3eaff(%rip), %rsi     # 0x7ec4a
callq 0x11b0
movq %rax, -0x1b8(%rbp)
jmp 0x40209
movq -0x58(%rbp), %rdi
leaq 0x3c20b(%rip), %rsi     # 0x7c372
callq 0x11b0
movq %rax, -0x1b8(%rbp)
movq -0x58(%rbp), %rsi
leaq 0x37370(%rip), %rdi     # 0x774ee
movb $0x0, %al
callq 0x10d0
cmpl $0x0, 0x258(%rbp)
jne 0x40207
movq -0x1b8(%rbp), %rdi
movq 0x10(%rbp), %rdx
leaq 0x375f3(%rip), %rsi     # 0x77793
movb $0x0, %al
callq 0x1150
movq -0x1b8(%rbp), %rdi
movl 0x38(%rbp), %edx
leaq 0x3760f(%rip), %rsi     # 0x777c7
movb $0x0, %al
callq 0x1150
movq -0x1b8(%rbp), %rdi
movl 0xe8(%rbp), %edx
leaq 0x3762a(%rip), %rsi     # 0x777fd
movb $0x0, %al
callq 0x1150
movq -0x1b8(%rbp), %rdi
movl 0x40(%rbp), %edx
leaq 0x376c8(%rip), %rsi     # 0x778b3
movb $0x0, %al
callq 0x1150
movq -0x1b8(%rbp), %rdi
leaq 0x4171d(%rip), %rsi     # 0x8191d
movb $0x0, %al
callq 0x1150
jmp 0x40209
cmpl $0x0, 0x230(%rbp)
jne 0x402f9
cmpl $0x0, 0x258(%rbp)
jne 0x402f9
movq -0x1b8(%rbp), %rdi
leaq 0x3ec17(%rip), %rsi     # 0x7ee48
movb $0x0, %al
callq 0x1150
movq -0x498(%rbp), %rax
movq -0x1b8(%rbp), %rdi
movss (%rax), %xmm0
cvtss2sd %xmm0, %xmm0
leaq 0x3ec0a(%rip), %rsi     # 0x7ee5f
movb $0x1, %al
callq 0x1150
movq -0x498(%rbp), %rax
movq -0x1b8(%rbp), %rdi
movss 0x4(%rax), %xmm0
cvtss2sd %xmm0, %xmm0
leaq 0x3ec01(%rip), %rsi     # 0x7ee7b
movb $0x1, %al
callq 0x1150
movq -0x498(%rbp), %rax
movq -0x1b8(%rbp), %rdi
movl 0x10(%rax), %edx
leaq 0x3ebfe(%rip), %rsi     # 0x7ee97
movb $0x0, %al
callq 0x1150
movq -0x498(%rbp), %rax
cmpl $0x0, 0x20(%rax)
je 0x402f7
movq -0x498(%rbp), %rax
movq -0x1b8(%rbp), %rdi
movss 0x8(%rax), %xmm0
cvtss2sd %xmm0, %xmm0
leaq 0x3ebe6(%rip), %rsi     # 0x7eeb1
movb $0x1, %al
callq 0x1150
movq -0x498(%rbp), %rax
movq -0x1b8(%rbp), %rdi
movss 0xc(%rax), %xmm0
cvtss2sd %xmm0, %xmm0
leaq 0x3ebdd(%rip), %rsi     # 0x7eecd
movb $0x1, %al
callq 0x1150
jmp 0x402f9
movl $0x0, -0x1bc(%rbp)
movq 0xe0(%rbp), %rdx
movq 0x50(%rbp), %rcx
movl 0x78(%rbp), %r8d
movl 0x68(%rbp), %r9d
leaq -0xc0(%rbp), %rax
leaq -0x1bc(%rbp), %rdi
leaq -0x1c8(%rbp), %rsi
subq $0x10, %rsp
movq %rax, (%rsp)
callq 0x1ef30
movq -0x498(%rbp), %rax
addq $0x10, %rsp
movq 0xd0(%rbp), %rdi
movl 0xd8(%rbp), %esi
movq -0x1c8(%rbp), %rdx
movl -0x1bc(%rbp), %ecx
movq 0x18(%rax), %r8
callq 0x2b8a0
movss %xmm0, -0x1cc(%rbp)
movq 0xd0(%rbp), %rdi
movl 0xd8(%rbp), %esi
movq 0x30(%rbp), %rdx
callq 0x2bd20
movss %xmm0, -0x1d0(%rbp)
movq -0x1c8(%rbp), %rdi
movl -0x1bc(%rbp), %esi
movq 0x60(%rbp), %rdx
callq 0x2bd20
movss %xmm0, -0x1d4(%rbp)
movss -0x1d4(%rbp), %xmm1
subss -0x1d0(%rbp), %xmm1
movl 0x38(%rbp), %eax
subl 0x68(%rbp), %eax
cvtsi2ss %eax, %xmm0
movss -0x5c(%rbp), %xmm2
movd %xmm0, %eax
xorl $0x80000000, %eax       # imm = 0x80000000
movd %eax, %xmm0
mulss %xmm2, %xmm0
addss %xmm1, %xmm0
movss %xmm0, -0x1d8(%rbp)
movq -0x1c8(%rbp), %rdi
callq 0x1040
cmpl $0x0, 0x230(%rbp)
je 0x40418
movq -0x1b8(%rbp), %rdi
movl 0x230(%rbp), %edx
leaq 0x3eada(%rip), %rsi     # 0x7eee9
movb $0x0, %al
callq 0x1150
jmp 0x4043b
cmpl $0x0, 0x258(%rbp)
jne 0x40439
movq -0x1b8(%rbp), %rdi
movl 0x70(%rbp), %edx
leaq 0x3ead1(%rip), %rsi     # 0x7ef03
movb $0x0, %al
callq 0x1150
jmp 0x4043b
cmpl $0x0, 0x258(%rbp)
jne 0x404ae
movq -0x1b8(%rbp), %rdi
movss -0x1cc(%rbp), %xmm0
cvtss2sd %xmm0, %xmm0
leaq 0x3eabf(%rip), %rsi     # 0x7ef1d
movb $0x1, %al
callq 0x1150
movq -0x1b8(%rbp), %rdi
movss -0x1d8(%rbp), %xmm0
cvtss2sd %xmm0, %xmm0
leaq 0x3eaba(%rip), %rsi     # 0x7ef39
movb $0x1, %al
callq 0x1150
movq -0x1b8(%rbp), %rdi
movss -0xd4(%rbp), %xmm0
cvtss2sd %xmm0, %xmm0
leaq 0x3eab5(%rip), %rsi     # 0x7ef55
leaq 0x4bc49(%rip), %rdx     # 0x8c0f0
movb $0x1, %al
callq 0x1150
cmpq $0x0, 0x238(%rbp)
je 0x405e6
movq -0x480(%rbp), %rax
movl 0x38(%rbp), %ecx
movq %rsp, %rdx
movq %rdx, -0x1e0(%rbp)
leaq 0xf(,%rcx,4), %rdx
andq $-0x10, %rdx
movq %rsp, %rdi
subq %rdx, %rdi
movq %rdi, -0x4b8(%rbp)
movq %rdi, %rsp
movq %rcx, -0x1e8(%rbp)
movl 0x38(%rbp), %esi
movq -0x30(%rbp), %rcx
movq 0x8(%rcx), %rdx
movq 0x20(%rbp), %rcx
subq $0x30, %rsp
movups (%rax), %xmm0
movups 0x10(%rax), %xmm1
movups 0x20(%rax), %xmm2
movq %rsp, %rax
movups %xmm2, 0x20(%rax)
movups %xmm1, 0x10(%rax)
movups %xmm0, (%rax)
leaq 0x35de2(%rip), %r8      # 0x76308
callq 0x41570
addq $0x30, %rsp
movl %eax, -0x1ec(%rbp)
cmpl $0x0, -0x1ec(%rbp)
je 0x405dc
movq -0x4b8(%rbp), %rsi
movq 0x238(%rbp), %rdi
movl -0x1ec(%rbp), %edx
leaq -0x1f0(%rbp), %rcx
leaq -0x1f4(%rbp), %r8
callq 0x15750
movss %xmm0, -0x1f8(%rbp)
movq -0x1b8(%rbp), %rdi
leaq 0x3e9f0(%rip), %rsi     # 0x7ef6f
movb $0x0, %al
callq 0x1150
cmpl $0x0, 0x258(%rbp)
je 0x405a6
movq -0x1b8(%rbp), %rdi
leaq 0x37411(%rip), %rsi     # 0x779ae
movb $0x0, %al
callq 0x1150
jmp 0x405bb
movq -0x1b8(%rbp), %rdi
leaq 0x3e9d1(%rip), %rsi     # 0x7ef85
movb $0x0, %al
callq 0x1150
movq -0x1b8(%rbp), %rdi
movss -0x1f8(%rbp), %xmm0
cvtss2sd %xmm0, %xmm0
leaq 0x3e8bb(%rip), %rsi     # 0x7ee90
movb $0x1, %al
callq 0x1150
movq -0x1e0(%rbp), %rax
movq %rax, %rsp
cmpl $0x0, 0x230(%rbp)
jne 0x40631
leaq -0x260(%rbp), %rdi
movq 0x248(%rbp), %rdx
leaq 0x3e987(%rip), %rsi     # 0x7ef8b
movb $0x0, %al
callq 0x1200
leaq -0x260(%rbp), %rdi
leaq 0x3bd59(%rip), %rsi     # 0x7c372
callq 0x11b0
movq %rax, -0x268(%rbp)
movq -0x268(%rbp), %rdi
callq 0x10a0
xorps %xmm0, %xmm0
movss %xmm0, -0x26c(%rbp)
xorps %xmm0, %xmm0
movsd %xmm0, -0x278(%rbp)
movl $0x0, -0xd0(%rbp)
movq -0x480(%rbp), %rcx
movl -0xd0(%rbp), %eax
cmpl 0x4(%rcx), %eax
jge 0x4069f
movq -0x480(%rbp), %rax
movq 0x18(%rax), %rax
movslq -0xd0(%rbp), %rcx
movss (%rax,%rcx,4), %xmm0
cvtss2sd %xmm0, %xmm0
addsd -0x278(%rbp), %xmm0
movsd %xmm0, -0x278(%rbp)
movl -0xd0(%rbp), %eax
addl $0x3, %eax
movl %eax, -0xd0(%rbp)
jmp 0x40651
movsd -0x278(%rbp), %xmm0
callq 0x1220
movsd %xmm0, -0x280(%rbp)
movl $0x5, -0x284(%rbp)
movl $0x2, -0x288(%rbp)
movl $0xffffffff, -0x28c(%rbp) # imm = 0xFFFFFFFF
cmpl $0x0, 0x230(%rbp)
jne 0x406e4
cmpl $0x0, 0x250(%rbp)
jne 0x406ee
movl $0x4, -0x284(%rbp)
movq -0x490(%rbp), %rax
movl $0x0, -0x290(%rbp)
movl -0x284(%rbp), %ecx
movq %rsp, %rdx
movq %rdx, -0x298(%rbp)
leaq 0xf(,%rcx,8), %rsi
andq $-0x10, %rsi
movq %rsp, %rdx
subq %rsi, %rdx
movq %rdx, -0x4e8(%rbp)
movq %rdx, %rsp
movq %rcx, -0x2a0(%rbp)
movl -0x284(%rbp), %ecx
leaq 0xf(,%rcx,8), %rsi
andq $-0x10, %rsi
movq %rsp, %rdx
subq %rsi, %rdx
movq %rdx, -0x4e0(%rbp)
movq %rdx, %rsp
movq %rcx, -0x2a8(%rbp)
movl -0x284(%rbp), %ecx
leaq 0xf(,%rcx,8), %rsi
andq $-0x10, %rsi
movq %rsp, %rdx
subq %rsi, %rdx
movq %rdx, -0x4d8(%rbp)
movq %rdx, %rsp
movq %rcx, -0x2b0(%rbp)
movl -0x284(%rbp), %ecx
leaq 0xf(,%rcx,8), %rsi
andq $-0x10, %rsi
movq %rsp, %rdx
subq %rsi, %rdx
movq %rdx, -0x4d0(%rbp)
movq %rdx, %rsp
movq %rcx, -0x2b8(%rbp)
movl (%rax), %eax
leaq 0xf(,%rax,4), %rdx
andq $-0x10, %rdx
movq %rsp, %rcx
subq %rdx, %rcx
movq %rcx, -0x4c8(%rbp)
movq %rcx, %rsp
movq %rax, -0x318(%rbp)
movl -0xd8(%rbp), %eax
leaq 0xf(,%rax,8), %rdx
andq $-0x10, %rdx
movq %rsp, %rcx
subq %rdx, %rcx
movq %rcx, -0x4c0(%rbp)
movq %rcx, %rsp
movq %rax, -0x320(%rbp)
movl $0x0, -0xd0(%rbp)
movl -0xd0(%rbp), %eax
cmpl -0xd8(%rbp), %eax
jge 0x4084f
movq -0x4c0(%rbp), %rax
movq -0x30(%rbp), %rcx
movq 0x18(%rcx), %rcx
movslq -0xd0(%rbp), %rdx
movss (%rcx,%rdx,4), %xmm0
cvtss2sd %xmm0, %xmm0
movslq -0xd0(%rbp), %rcx
movsd %xmm0, (%rax,%rcx,8)
movl -0xd0(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xd0(%rbp)
jmp 0x40805
movl $0x0, -0x324(%rbp)
movl -0x324(%rbp), %eax
cmpl -0x284(%rbp), %eax
jge 0x41041
cmpl $0x0, 0x230(%rbp)
je 0x40879
jmp 0x4102d
cmpl $0x0, 0x5bb50(%rip)     # 0x9c3d0
jne 0x40899
cmpl $0x0, -0x324(%rbp)
je 0x40894
cmpl $0x3, -0x324(%rbp)
jne 0x40899
jmp 0x4102d
cmpl $0x1, -0x324(%rbp)
jne 0x408a7
jmp 0x4102d
cmpl $0x3, -0x324(%rbp)
jge 0x409e9
movb $0x58, -0x32d(%rbp)
cmpl $0x0, -0x324(%rbp)
jne 0x408cd
movb $0x4f, -0x32d(%rbp)
jmp 0x408f6
cmpl $0x1, -0x324(%rbp)
jne 0x408e2
movb $0x4d, -0x32d(%rbp)
jmp 0x4102d
cmpl $0x2, -0x324(%rbp)
jne 0x408f2
movb $0x43, -0x32d(%rbp)
jmp 0x408f4
jmp 0x408f6
leaq -0x310(%rbp), %rdi
leaq 0x3e699(%rip), %rsi     # 0x7ef9d
movb $0x0, %al
callq 0x1200
cmpl $0x0, -0x324(%rbp)
je 0x40927
leaq -0x310(%rbp), %rdi
leaq 0x3e67f(%rip), %rsi     # 0x7efa1
callq 0x11e0
leaq -0x360(%rbp), %rdi
movsbl -0x32d(%rbp), %edx
leaq 0x3e66a(%rip), %rsi     # 0x7efa6
movb $0x0, %al
callq 0x1200
leaq -0x310(%rbp), %rdi
leaq -0x360(%rbp), %rsi
callq 0x11e0
movsbl -0x32d(%rbp), %esi
leaq 0x3e64b(%rip), %rdi     # 0x7efaf
movb $0x0, %al
callq 0x10d0
movq -0x480(%rbp), %rcx
movq -0x30(%rbp), %rdi
movq 0x5ba5b(%rip), %rsi     # 0x9c3d8
movq 0x10(%rbp), %rdx
movb -0x32d(%rbp), %al
subq $0x30, %rsp
movups (%rcx), %xmm0
movups 0x10(%rcx), %xmm1
movups 0x20(%rcx), %xmm2
movq %rsp, %rcx
movups %xmm2, 0x20(%rcx)
movups %xmm1, 0x10(%rcx)
movups %xmm0, (%rcx)
movsbl %al, %ecx
leaq -0x26c(%rbp), %r8
callq 0x36270
addq $0x30, %rsp
cmpl $0x0, %eax
jge 0x409e4
movq -0x1b8(%rbp), %rdi
leaq 0x3e618(%rip), %rsi     # 0x7efe2
movb $0x0, %al
callq 0x1150
leaq 0x3e60a(%rip), %rdi     # 0x7efe2
movb $0x0, %al
callq 0x10d0
jmp 0x4102d
jmp 0x40ce1
cmpl $0x3, -0x324(%rbp)
jne 0x40a89
leaq -0x310(%rbp), %rdi
leaq 0x3e604(%rip), %rsi     # 0x7f008
movb $0x0, %al
callq 0x1200
movl 0x78(%rbp), %edi
movq 0x50(%rbp), %rsi
movq 0x60(%rbp), %rdx
callq 0x1ce20
movq %rax, -0x368(%rbp)
movq -0x38(%rbp), %rdi
movl 0x48(%rbp), %esi
movq 0x20(%rbp), %rdx
callq 0x1bf00
movq -0x368(%rbp), %rdi
movl 0x78(%rbp), %esi
movq 0x50(%rbp), %rdx
callq 0x1bf00
movq -0x4c0(%rbp), %rdi
movl -0xd8(%rbp), %esi
movq -0x38(%rbp), %rdx
movq -0x368(%rbp), %rcx
movl 0x48(%rbp), %r8d
xorl %r9d, %r9d
subq $0x10, %rsp
movl $0x0, (%rsp)
callq 0x52a30
addq $0x10, %rsp
movq -0x368(%rbp), %rdi
callq 0x1040
jmp 0x40cdf
cmpl $0x4, -0x324(%rbp)
jne 0x40cdd
movq -0x1b8(%rbp), %rdi
callq 0x1190
leaq 0x3e58d(%rip), %rdi     # 0x7f036
movb $0x0, %al
callq 0x10d0
leaq -0x310(%rbp), %rdi
leaq 0x3e5a5(%rip), %rsi     # 0x7f063
movb $0x0, %al
callq 0x1200
movsd 0x3afab(%rip), %xmm0    # 0x7ba78
movsd %xmm0, -0x370(%rbp)
callq 0x1090
movq -0x490(%rbp), %rcx
cvtsi2sd %rax, %xmm0
movsd %xmm0, -0x378(%rbp)
movl (%rcx), %eax
movl %eax, -0x37c(%rbp)
movl -0x37c(%rbp), %eax
cmpl (%rcx), %eax
jle 0x40b0f
movq -0x490(%rbp), %rax
movl (%rax), %eax
movl %eax, -0x37c(%rbp)
movq -0x490(%rbp), %rax
xorps %xmm0, %xmm0
movss %xmm0, -0x3a4(%rbp)
movq %rax, -0x388(%rbp)
leaq -0x3a0(%rbp), %rdi
leaq 0x3e556(%rip), %rsi     # 0x7f08c
callq 0x1060
movq -0x4a0(%rbp), %rax
movq -0x38(%rbp), %rdx
movq 0x5b88b(%rip), %rcx     # 0x9c3d8
movq %rcx, -0x4f0(%rbp)
movq 0x20(%rbp), %r8
movl 0x48(%rbp), %r9d
leaq -0xc0(%rbp), %rsi
movq -0x40(%rbp), %r10
movl -0xd8(%rbp), %r11d
movq 0x30(%rbp), %rbx
movl 0x38(%rbp), %r14d
movq -0x48(%rbp), %r15
movl -0x4c(%rbp), %r12d
movq 0x50(%rbp), %r13
movl 0x78(%rbp), %edi
movq -0x388(%rbp), %rcx
movq %rcx, -0x4f8(%rbp)
leaq -0x3a0(%rbp), %rcx
movq %rcx, -0x500(%rbp)
movl -0x37c(%rbp), %ecx
movss -0x3a4(%rbp), %xmm1
subq $0xf0, %rsp
movups (%rax), %xmm0
movups 0x10(%rax), %xmm2
movups 0x20(%rax), %xmm3
movups 0x2c(%rax), %xmm4
movq %rsp, %rax
movq %rax, -0x508(%rbp)
movups %xmm4, 0xc4(%rax)
movups %xmm3, 0xb8(%rax)
movups %xmm2, 0xa8(%rax)
movups %xmm0, 0x98(%rax)
movq -0x488(%rbp), %rax
movups (%rax), %xmm0
movups 0x10(%rax), %xmm2
movq -0x508(%rbp), %rax
movups %xmm2, 0x40(%rax)
movups %xmm0, 0x30(%rax)
movq -0x480(%rbp), %rax
movups (%rax), %xmm0
movups 0x10(%rax), %xmm2
movups 0x20(%rax), %xmm3
movq -0x508(%rbp), %rax
movups %xmm3, 0x20(%rax)
movups %xmm2, 0x10(%rax)
movups %xmm0, (%rax)
movl %ecx, 0xe8(%rax)
movq -0x500(%rbp), %rcx
movq %rcx, 0xe0(%rax)
movq -0x4f8(%rbp), %rcx
movq %rcx, 0xd8(%rax)
movq -0x4f0(%rbp), %rcx
movl %edi, 0x90(%rax)
movq -0x4c0(%rbp), %rdi
movq %r13, 0x88(%rax)
movl %r12d, 0x80(%rax)
movq %r15, 0x78(%rax)
movl %r14d, 0x70(%rax)
movq %rbx, 0x68(%rax)
movl %r11d, 0x60(%rax)
movq %r10, 0x58(%rax)
movq %rsi, 0x50(%rax)
leaq 0x3e404(%rip), %rsi     # 0x7f093
movsd 0x35389(%rip), %xmm0    # 0x76020
callq 0x4b550
addq $0xf0, %rsp
callq 0x1090
cvtsi2sd %rax, %xmm0
subsd -0x378(%rbp), %xmm0
divsd -0x370(%rbp), %xmm0
leaq 0x3e3d6(%rip), %rdi     # 0x7f09a
movb $0x1, %al
callq 0x10d0
callq 0x1090
cvtsi2sd %rax, %xmm0
movsd %xmm0, -0x378(%rbp)
jmp 0x40cdf
jmp 0x40ce1
jmp 0x40ce3
movq -0x1b8(%rbp), %rdi
leaq 0x3e3d8(%rip), %rsi     # 0x7f0c9
movb $0x0, %al
callq 0x1150
movq 0x240(%rbp), %r9
movq -0x30(%rbp), %rdi
movq 0x5b6ce(%rip), %r10     # 0x9c3d8
movsd -0x280(%rbp), %xmm0
cvtsd2ss %xmm0, %xmm0
movq -0x38(%rbp), %rbx
movq 0x20(%rbp), %r14
movl 0x48(%rbp), %r15d
movq 0x28(%rbp), %r12
movq 0x58(%rbp), %r13
movq 0x30(%rbp), %rax
movq %rax, -0x510(%rbp)
movq -0x40(%rbp), %rdx
movl 0x230(%rbp), %esi
leaq -0x310(%rbp), %r8
movq -0x1b8(%rbp), %r11
leaq -0x260(%rbp), %rax
movq %rax, -0x518(%rbp)
movl 0x258(%rbp), %eax
movl %eax, -0x51c(%rbp)
movq 0x248(%rbp), %rcx
xorl %eax, %eax
movq -0x480(%rbp), %rax
subq $0xc0, %rsp
movups (%rax), %xmm1
movups 0x10(%rax), %xmm2
movups 0x20(%rax), %xmm3
movq %rsp, %rax
movq %rax, -0x528(%rbp)
movups %xmm3, 0x50(%rax)
movups %xmm2, 0x40(%rax)
movups %xmm1, 0x30(%rax)
movq %rcx, 0xa8(%rax)
movl -0x51c(%rbp), %ecx
movl %ecx, 0xa0(%rax)
movq -0x518(%rbp), %rcx
movq %rcx, 0x98(%rax)
movq -0x510(%rbp), %rcx
movq %r11, 0x90(%rax)
movq -0x490(%rbp), %r11
movq %r8, 0x88(%rax)
movq -0x4d8(%rbp), %r8
movl %esi, 0x80(%rax)
movq -0x4d0(%rbp), %rsi
movq %rdx, 0x78(%rax)
movq -0x4e8(%rbp), %rdx
movq %rcx, 0x70(%rax)
movq -0x4e0(%rbp), %rcx
movq %r13, 0x68(%rax)
movq %r12, 0x60(%rax)
movl %r15d, 0x28(%rax)
movq %r14, 0x20(%rax)
movq %rbx, 0x18(%rax)
movq %r11, 0x10(%rax)
movq %r10, 0x8(%rax)
movq %rdi, (%rax)
movl $0x0, 0xb0(%rax)
leaq -0x290(%rbp), %rdi
callq 0x416d0
addq $0xc0, %rsp
cmpl $0x0, -0xf4(%rbp)
je 0x40fb9
cmpl $0x0, 0x258(%rbp)
jne 0x40fb9
movq -0x1b8(%rbp), %rdi
leaq 0x3e27e(%rip), %rsi     # 0x7f0e8
movb $0x0, %al
callq 0x1150
movq -0x480(%rbp), %rax
movq 0x240(%rbp), %r9
movq -0x30(%rbp), %rdi
movq 0x5b54e(%rip), %r10     # 0x9c3d8
movsd -0x280(%rbp), %xmm0
cvtsd2ss %xmm0, %xmm0
movq -0x38(%rbp), %r11
movq 0x20(%rbp), %rbx
movl 0x48(%rbp), %r14d
movq 0x28(%rbp), %r15
movq 0x58(%rbp), %r12
movq 0x30(%rbp), %r13
movq -0x40(%rbp), %rcx
movq %rcx, -0x530(%rbp)
movl 0x230(%rbp), %edx
leaq -0x310(%rbp), %rsi
movq -0x1b8(%rbp), %r8
leaq -0x260(%rbp), %rcx
movq %rcx, -0x538(%rbp)
movl 0x258(%rbp), %ecx
movl %ecx, -0x53c(%rbp)
movq 0x248(%rbp), %rcx
subq $0xc0, %rsp
movups (%rax), %xmm1
movups 0x10(%rax), %xmm2
movups 0x20(%rax), %xmm3
movq %rsp, %rax
movq %rax, -0x548(%rbp)
movups %xmm3, 0x50(%rax)
movups %xmm2, 0x40(%rax)
movups %xmm1, 0x30(%rax)
movq %rcx, 0xa8(%rax)
movl -0x53c(%rbp), %ecx
movl %ecx, 0xa0(%rax)
movq -0x538(%rbp), %rcx
movq %rcx, 0x98(%rax)
movq -0x530(%rbp), %rcx
movq %r8, 0x90(%rax)
movq -0x4d8(%rbp), %r8
movq %rsi, 0x88(%rax)
movq -0x4d0(%rbp), %rsi
movl %edx, 0x80(%rax)
movq -0x4e8(%rbp), %rdx
movq %rcx, 0x78(%rax)
movq -0x4e0(%rbp), %rcx
movq %r13, 0x70(%rax)
movq %r12, 0x68(%rax)
movq %r15, 0x60(%rax)
movl %r14d, 0x28(%rax)
movq %rbx, 0x20(%rax)
movq %r11, 0x18(%rax)
leaq 0x5b44f(%rip), %r11     # 0x9c3e0
movq %r11, 0x10(%rax)
movq %r10, 0x8(%rax)
movq %rdi, (%rax)
movl $0x1, 0xb0(%rax)
leaq -0x290(%rbp), %rdi
callq 0x416d0
addq $0xc0, %rsp
movl -0x324(%rbp), %eax
cmpl -0x288(%rbp), %eax
jne 0x4102b
movl -0x290(%rbp), %eax
subl $0x1, %eax
movl %eax, -0x28c(%rbp)
movl $0x0, -0xd0(%rbp)
movq -0x490(%rbp), %rcx
movl -0xd0(%rbp), %eax
cmpl (%rcx), %eax
jge 0x41029
movq -0x4c8(%rbp), %rax
movq -0x30(%rbp), %rcx
movq 0x20(%rcx), %rcx
movslq -0xd0(%rbp), %rdx
movss (%rcx,%rdx,4), %xmm0
movslq -0xd0(%rbp), %rcx
movss %xmm0, (%rax,%rcx,4)
movl -0xd0(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xd0(%rbp)
jmp 0x40fe0
jmp 0x4102b
jmp 0x4102d
movl -0x324(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x324(%rbp)
jmp 0x40859
movq -0x1b8(%rbp), %rdi
callq 0x10a0
cmpl $0x0, -0x28c(%rbp)
jl 0x4115f
movq -0x4d0(%rbp), %rax
movslq -0x28c(%rbp), %rcx
movq (%rax,%rcx,8), %rsi
leaq 0x3e092(%rip), %rdi     # 0x7f105
movb $0x0, %al
callq 0x10d0
movl $0x0, -0xd0(%rbp)
movq -0x490(%rbp), %rcx
movl -0xd0(%rbp), %eax
cmpl (%rcx), %eax
jge 0x41102
movq -0x490(%rbp), %rax
movq -0x4d8(%rbp), %rcx
movq -0x4c8(%rbp), %rdx
movslq -0xd0(%rbp), %rsi
movss (%rdx,%rsi,4), %xmm0
movq -0x30(%rbp), %rdx
movq 0x20(%rdx), %rdx
movslq -0xd0(%rbp), %rsi
movss %xmm0, (%rdx,%rsi,4)
movslq -0x28c(%rbp), %rdx
movq (%rcx,%rdx,8), %rcx
movslq -0xd0(%rbp), %rdx
movss (%rcx,%rdx,4), %xmm0
movq 0x30(%rax), %rax
movslq -0xd0(%rbp), %rcx
movss %xmm0, (%rax,%rcx,4)
movl -0xd0(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xd0(%rbp)
jmp 0x41084
movl $0x0, -0xd0(%rbp)
movl -0xd0(%rbp), %eax
cmpl -0xd8(%rbp), %eax
jge 0x4115d
movq -0x4e8(%rbp), %rax
movslq -0x28c(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0xd0(%rbp), %rcx
movss (%rax,%rcx,4), %xmm0
movq -0x30(%rbp), %rax
movq 0x18(%rax), %rax
movslq -0xd0(%rbp), %rcx
movss %xmm0, (%rax,%rcx,4)
movl -0xd0(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xd0(%rbp)
jmp 0x4110c
jmp 0x4115f
cmpl $0x0, 0x230(%rbp)
jne 0x414c8
cmpq $0x0, 0x248(%rbp)
je 0x41441
cmpl $0x1, -0x290(%rbp)
jle 0x41441
leaq -0x470(%rbp), %rdi
leaq -0xc0(%rbp), %rdx
leaq 0x3df87(%rip), %rsi     # 0x7f123
movb $0x0, %al
callq 0x1200
leaq -0x470(%rbp), %rsi
leaq 0x3df8a(%rip), %rdi     # 0x7f13b
movb $0x0, %al
callq 0x10d0
leaq -0x470(%rbp), %rdi
leaq 0x3b1ac(%rip), %rsi     # 0x7c372
callq 0x11b0
movq %rax, %rcx
movq -0x490(%rbp), %rax
movq %rcx, -0x1b8(%rbp)
movq -0x1b8(%rbp), %rdi
movl (%rax), %edx
movl -0x290(%rbp), %ecx
leaq 0x3df69(%rip), %rsi     # 0x7f15b
movb $0x0, %al
callq 0x1150
movl $0x0, -0xd0(%rbp)
movl -0xd0(%rbp), %eax
cmpl -0x290(%rbp), %eax
jge 0x41252
movq -0x4d0(%rbp), %rax
movq -0x1b8(%rbp), %rdi
movl -0xd0(%rbp), %edx
addl $0x1, %edx
movslq -0xd0(%rbp), %rcx
movq (%rax,%rcx,8), %rcx
leaq 0x3df4c(%rip), %rsi     # 0x7f186
movb $0x0, %al
callq 0x1150
movl -0xd0(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xd0(%rbp)
jmp 0x41203
movq -0x1b8(%rbp), %rdi
leaq 0x3df37(%rip), %rsi     # 0x7f197
movb $0x0, %al
callq 0x1150
movl $0x0, -0xd0(%rbp)
movl -0xd0(%rbp), %eax
cmpl -0x290(%rbp), %eax
jge 0x412b7
movq -0x1b8(%rbp), %rdi
movl -0xd0(%rbp), %edx
addl $0x2, %edx
movl -0xd0(%rbp), %ecx
addl $0x1, %ecx
leaq 0x3deff(%rip), %rsi     # 0x7f19e
movb $0x0, %al
callq 0x1150
movl -0xd0(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xd0(%rbp)
jmp 0x41271
movq -0x1b8(%rbp), %rdi
movl -0xd0(%rbp), %edx
addl $0x2, %edx
leaq 0x3dedb(%rip), %rsi     # 0x7f1a9
movb $0x0, %al
callq 0x1150
cmpl $0x0, 0x258(%rbp)
jne 0x412fc
movq -0x1b8(%rbp), %rdi
movl -0xd0(%rbp), %edx
addl $0x3, %edx
leaq 0x3dec2(%rip), %rsi     # 0x7f1b7
movb $0x0, %al
callq 0x1150
movq -0x1b8(%rbp), %rdi
leaq 0x3cd6e(%rip), %rsi     # 0x7e078
movb $0x0, %al
callq 0x1150
movl $0x0, -0x474(%rbp)
movq -0x490(%rbp), %rcx
movl -0x474(%rbp), %eax
cmpl (%rcx), %eax
jge 0x41435
movq -0x1b8(%rbp), %rdi
movl -0x474(%rbp), %edx
leaq 0x4136a(%rip), %rsi     # 0x826ae
movb $0x0, %al
callq 0x1150
movl $0x0, -0xd0(%rbp)
movl -0xd0(%rbp), %eax
cmpl -0x290(%rbp), %eax
jge 0x413ab
movq -0x4d8(%rbp), %rax
movq -0x1b8(%rbp), %rdi
movslq -0xd0(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x474(%rbp), %rcx
movss (%rax,%rcx,4), %xmm0
cvtss2sd %xmm0, %xmm0
leaq 0x3de2f(%rip), %rsi     # 0x7f1c2
movb $0x1, %al
callq 0x1150
movl -0xd0(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xd0(%rbp)
jmp 0x41355
movq -0x1b8(%rbp), %rdi
movq -0xc8(%rbp), %rax
movslq -0x474(%rbp), %rcx
movss (%rax,%rcx,4), %xmm0
cvtss2sd %xmm0, %xmm0
leaq 0x3b5cd(%rip), %rsi     # 0x7c99d
movb $0x1, %al
callq 0x1150
cmpl $0x0, 0x258(%rbp)
jne 0x4140c
movq -0x1b8(%rbp), %rdi
movq 0x5b01a(%rip), %rax     # 0x9c408
movslq -0x474(%rbp), %rcx
movss (%rax,%rcx,4), %xmm0
cvtss2sd %xmm0, %xmm0
leaq 0x3b598(%rip), %rsi     # 0x7c99d
movb $0x1, %al
callq 0x1150
movq -0x1b8(%rbp), %rdi
leaq 0x3cc5e(%rip), %rsi     # 0x7e078
movb $0x0, %al
callq 0x1150
movl -0x474(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x474(%rbp)
jmp 0x4131b
movq -0x1b8(%rbp), %rdi
callq 0x10a0
movl $0x0, -0xd0(%rbp)
movl -0xd0(%rbp), %eax
cmpl -0x290(%rbp), %eax
jge 0x414c6
movq -0x4d8(%rbp), %rax
movslq -0xd0(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
callq 0x1040
movq -0x4e8(%rbp), %rax
movslq -0xd0(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
callq 0x1040
movq -0x4e0(%rbp), %rax
movslq -0xd0(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
callq 0x1040
movq -0x4d0(%rbp), %rax
movslq -0xd0(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
callq 0x1040
movl -0xd0(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xd0(%rbp)
jmp 0x4144b
jmp 0x414c8
movq 0x5af09(%rip), %rcx     # 0x9c3d8
subq $0x50, %rsp
movq 0x40(%rcx), %rdx
movq %rsp, %rax
movq %rdx, 0x40(%rax)
movups (%rcx), %xmm0
movups 0x10(%rcx), %xmm1
movups 0x20(%rcx), %xmm2
movups 0x30(%rcx), %xmm3
movups %xmm3, 0x30(%rax)
movups %xmm2, 0x20(%rax)
movups %xmm1, 0x10(%rax)
movups %xmm0, (%rax)
callq 0x31600
addq $0x50, %rsp
movq 0x5aecc(%rip), %rdi     # 0x9c3d8
callq 0x1040
movq $0x0, 0x5aebc(%rip) # 0x9c3d8
cmpl $0x0, 0x258(%rbp)
je 0x4154a
subq $0xd0, %rsp
leaq 0x5aead(%rip), %rsi     # 0x9c3e0
movq %rsp, %rdi
movl $0x1a, %ecx
rep  movsq (%rsi), %es:(%rdi)
callq 0x31ec0
addq $0xd0, %rsp
movss -0xd4(%rbp), %xmm0
movq -0x298(%rbp), %rax
movq %rax, %rsp
leaq -0x28(%rbp), %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nopl (%rax,%rax)