// File: /workspace/github_c_makefile_star2_O0/ugobas[P]tnm/simulation.c
// Function: Torsional_confchange_RRR
void Torsional_confchange_RRR(double *diff_phi, char *diff_type,
			      struct bond *bonds_ini,
			      struct Jacobian *J, struct Reference Ref1,
			      struct ali_atoms ali_a,
			      double Tors_fluct,
			      atom *atoms1, int natoms1, char *nameout,
			      struct axe *axes, int naxes,
			      struct residue *seq, int nres,
			      struct chain *chains, int Nchain, 
			      atom *atoms2, int natoms2,
			      struct Para_simul Para_simul,
			      struct Normal_Mode *NM, int NMODES)
{
  int IT_MAX=Para_simul.NSTEPS; int i;
  float STEP_MAX=Para_simul.STEP_MAX, STEP_MIN=Para_simul.STEP_MIN;
  float A_MAX=Para_simul.ANGLE;
  int FAIL_MAX=4;
  printf("Interpolating conformation change with steps\n");
  
  // Initial bonds
  Set_bonds_measure(bonds_ini, natoms1, atoms1);
  struct bond bonds[natoms1], bonds_tmp[natoms1];
  Copy_bonds(bonds, bonds_ini, natoms1);
  printf("Internal coordinates of initial structure\n");
  double phi_ini[naxes], phi_opt[naxes]; 
  Internal_coordinates(phi_ini, naxes, bonds_ini, natoms1);
  double diff_phi0[naxes]; for(i=0; i<naxes; i++)diff_phi0[i]=0;

  // Set references 
  /*char SEL[4]="EB"; // "EB" "ALL"
  struct Reference Ref1, Ref2;
  int N_ref=Set_reference(&Ref1, 0, SEL, atoms1, 0, natoms1);
  printf("Change reference atoms to %s n=%d\n",SEL, Ref1.N_ref);
  int N_Cart=3*N_ref; Ref1.N_Cart=N_Cart;
  int first_kin[naxes], last_kin[naxes];
  Change_kin(first_kin, last_kin, axes, naxes, natoms1, Ref1);
  struct Jacobian J; Allocate_Jacobian(&J, naxes, Ref1.N_Cart);
  */
  //int N_ref=Ref1.N_ref;
  int N_ali=ali_a.N_ref, N_Cart=3*N_ali;

  float coord_ref_1[N_Cart], coord_ref_2[N_Cart];
  Write_ref_coord_atom(coord_ref_1, N_ali, atoms1, ali_a.ali1);
  Write_ref_coord_atom(coord_ref_2, N_ali, atoms2, ali_a.ali2);
  float coord1[N_Cart], coord2[N_Cart], coord_pdb[N_Cart];//coord_kin[N_Cart];
  for(i=0; i<N_Cart; i++){
    coord1[i]=coord_ref_1[i]; coord2[i]=coord1[i];
    coord_pdb[i]=coord1[i]; //coord_kin[i]=coord1[i];
  }

  struct Tors Diff; 
  Allocate_tors(&Diff, naxes, N_Cart, naxes); //N_modes

  float *coord_new=coord1, *coord_old=coord2, *mass_ref=Ref1.mass_atom;
  float coord_all[3*natoms1]; Put_coord(coord_all, bonds_ini, natoms1);
  float Ene=Energy_clashes(coord_all, natoms1);

  // Print rmsd
  char namermsd[200];
  sprintf(namermsd, "%s_%s_rmsd.dat", nameout, diff_type);
  FILE *file_rmsd=fopen(namermsd, "w");
  printf("Opening %s\n", namermsd);
  fprintf(file_rmsd,
	  "# Interpolating conformation change with torsional steps\n");
  fprintf(file_rmsd,"# RMSD_step: max= %.2g min= %.2g N.steps %d\n",
	  STEP_MAX, STEP_MIN, IT_MAX);
  //fprintf(file_rmsd,"# max. angular change (end) %.2g\n", D_MAX_MIN);
  fprintf(file_rmsd,"# E_clash(PDB)= %.2g\n", Ene);
  // Superimpose second structure to first one
  float RMSD_kf=rmsd_mclachlan_f(coord_ref_1, coord_ref_2, ali_a.mass, N_ali);
  float RMSD_ki=0, RMSD_step=0, RMSD_opt=RMSD_kf;
  printf("Initial RMSD: %.2f\n\n", RMSD_kf);
  fprintf(file_rmsd,"# RMSD= %.3f Tors_RMSD= %.3f\n", RMSD_kf, Tors_fluct);
  fprintf(file_rmsd,"# RMSD_ki RMSD_kf RMSD_step E_clash factor accept\n");
  fprintf(file_rmsd, "%.3f\t%.3f\t%.3f\t%.2g\t%.2g\t%d\n",
	  RMSD_ki, RMSD_kf, RMSD_step, Ene, 0.0, 1);

  // Opening file for printing PDB
  FILE *file_pdb=NULL;
  float coord_all_1[3*natoms1], mass[natoms1];
  for(i=0; i<natoms1; i++)mass[i]=Mass(atoms1+i);
  if(strcmp(diff_type, "standard")!=0){
    char pdbout[200];
    sprintf(pdbout, "%s_confchange_%s.pdb", nameout, diff_type);
    file_pdb=fopen(pdbout, "w");
    printf("Writing trajectory in PDB format in %s\n", pdbout);
    Print_seqres(file_pdb, chains, Nchain);
    Put_coord(coord_all_1, bonds_ini, natoms1);
    Print_PDB(file_pdb, atoms1, natoms1, coord_all_1, seq, 0, 0.0);
  }
 
  double Mass_tot=0; for(i=0; i<Ref1.N_ref; i++)Mass_tot+=Ref1.mass_atom[i];
  int accept=1, imax=-1, iter, exit, k_fail=0, k_pdb=0,
    fit_fail=0, regression=1; 
  float Lambda=0; int l_Lambda=1; //float rmsd=100
  for(iter=0; iter<IT_MAX; iter++){

    double diff_step[naxes], diff_all[naxes];
    if(regression==1){
      //if(iter)rmsd=rmsd_mclachlan_f(coord_kin, coord_old, mass_ref, N_ali);
      if((iter==0)){//||(rmsd>RMSD_TOL)){
	printf("Computing kinetic energy\n");
	// Kinetic energy must be computed with new atoms!!!!
	//for(i=0;i<N_Cart;i++)coord_kin[i]=coord_old[i];
	atom atoms_t[natoms1]; Copy_atoms_bonds(atoms_t, bonds, natoms1);
	Compute_kinetic(J, axes, naxes, atoms_t, natoms1, Ref1, 0);
	l_Lambda=1;
      }
      for(i=0;i<N_Cart;i++)Diff.Cart[i]=coord_ref_2[i]-coord_old[i];
      if(iter==0){
	if(Convert_cart2torsion_fit(&Diff, Ref1, J, nameout, 'C', &Lambda)<0){
	  printf("WARNING, ridge regression failed\n");
	  accept=0; k_fail++; fit_fail++; goto test;
	}
      }else{
	if(l_Lambda){
	  printf("Computing T+Lambda, Lambda= %.3f\n", Lambda);
	  l_Lambda=0; for(i=0;i<naxes; i++)J->T[i][i]*=(1+Lambda);
	}
	if(Tors_step(&Diff,J->T,J->Jacobian_ar,Ref1.mass_coord,naxes,N_Cart)){
	  printf("WARNING, fast regression failed\n");
	  accept=0; k_fail++; fit_fail++; regression=0; continue;
	}	
      }
      for(i=0; i<naxes; i++)diff_step[i]=Diff.Tors[i];
    }else{
      goto test;
      // Move angles one by one
      imax=Torsional_confchange_1angle(diff_step, naxes, Para_simul.ANGLE,
				       bonds, natoms1, ali_a,
				       coord_ref_1, coord_ref_2,
				       STEP_MIN, RMSD_opt,
				       atoms1, coord_all);
      if(imax<0){
	accept=0; k_fail++; goto test;
      }
      fprintf(file_rmsd, "# 1angle, angle= %.2g i=%d %c:\n",
	      Para_simul.ANGLE, imax, axes[imax].type);
      printf("# angle= %.2g i=%d %c:\n",
	     Para_simul.ANGLE, imax, axes[imax].type);
    }

    float max=0;
    for(i=0; i<naxes; i++)if(fabs(diff_step[i])>max)max=fabs(diff_step[i]);
    if(max>A_MAX){
      float f=A_MAX/max;
      printf("WARNING, too large angle= %.2f ", max);
      printf("Reducing d_phi by a factor %.2g\n", f);
      for(i=0; i<naxes; i++)diff_step[i]*=f;
    }

    float factor=1., reduce_step=1;
    /**/
    while(1){ // loop on amplitudes
      
      // Move atoms
      for(i=0; i<naxes; i++)diff_all[i]=diff_phi0[i]+diff_step[i];
      Copy_bonds(bonds_tmp, bonds_ini, natoms1);
      Build_up(bonds_tmp, natoms1, diff_all, naxes);
      accept=Write_RMSD(&reduce_step, &RMSD_opt, &RMSD_kf,
			STEP_MIN, STEP_MAX, factor, iter, file_rmsd,
			bonds_tmp, coord_all, natoms1, ali_a,
			coord_new,coord_old,coord_ref_1,coord_ref_2);
      if(accept)break;
      factor*=reduce_step;
      if((factor<0.005)||(reduce_step<0.0001)){
	printf("Too small amplitude (%.2g), exiting\n", factor);
	accept=0; break;
      }
      printf("Reducing amplitude by factor %.2g\n", reduce_step);
      if(regression){
	for(i=0; i<naxes; i++)diff_step[i]*=reduce_step;
      }else{
	diff_step[imax]*=reduce_step;
      }

    } // End loop amplitude

      /**/
    /*
      Copy_bonds(bonds_tmp, bonds_ini, natoms1);
      RMSD_kf=Optimize_amplitude(bonds_tmp,&factor,diff_tors,naxes,
				 bonds,natoms1,Ref1, coord_ref_2);
      accept=Write_RMSD(&reduce_step, &RMSD_opt, &RMSD_kf,
			STEP_MIN, STEP_MAX, factor, iter, file_rmsd,
			bonds, coord_all, natoms1, ali_a,
			coord_new,coord_old,coord_ref_1,coord_ref_2);
    
      if(accept && (RMSD_step>STEP_MAX)){ // Reduce factor
	factor*=(STEP_MAX/RMSD_step);
	for(i=0; i<naxes; i++)diff_step[i]*=factor;
	Build_up(bonds, natoms1, diff_tors, naxes);
	accept=Write_RMSD(&reduce_step,&RMSD_opt, &RMSD_kf,
			  STEP_MIN, STEP_MAX, factor, iter, file_rmsd,
			  bonds, coord_all, natoms1, ali_a,
			  coord_new,coord_old,coord_ref_1,coord_ref_2);
      }
      // Switch coordinates
      if(accept)Copy_bonds(bonds_old, bonds, natoms1);
    }
    */
      /**/
  test:
    exit=(RMSD_opt < RMSD_TOL);
    if(accept==0){
      k_fail++;
      if(k_fail>=2)exit=1;
      if(regression){
	fit_fail++; regression=0;
      }else if(fit_fail<FAIL_MAX){
	regression=1;
      }
      if(exit==0)continue;
    }else{
      // Store conformation
      Copy_bonds(bonds, bonds_tmp, natoms1);
      Internal_coordinates(phi_opt, naxes, bonds, natoms1);
      for(i=0; i<naxes; i++)diff_phi0[i]=phi_opt[i]-phi_ini[i];
      k_fail=0;
      if(regression){fit_fail=0;}
      else if(fit_fail<FAIL_MAX){regression=1;}
    }

    // Print PDB
    if(file_pdb){
      float rmsd=rmsd_mclachlan_f(coord_pdb, coord_new, mass_ref, N_ali);
      if((rmsd > Para_simul.PDB_STEP)|| exit){
	k_pdb++;
	for(i=0; i<N_Cart; i++)coord_pdb[i]=coord_new[i];
	RMSD_ki=rmsd_mclachlan_f(coord_all_1, coord_all, mass, natoms1);
	Print_PDB(file_pdb,atoms1,natoms1,coord_all,seq,k_pdb,RMSD_ki);
      }
    }
    printf("\n");
    if(exit){
      printf("Exiting iterations, k_fail= %d fit_fail= %d\n",k_fail,fit_fail);
      break;
    }

    float *tmp=coord_old; coord_old=coord_new; coord_new=tmp;

  }

  // Take final coordinates from bonds
  fprintf(file_rmsd, "# Final RMSD:\n");
  float reduce_step;
  Write_RMSD(&reduce_step, &RMSD_opt, &RMSD_kf, STEP_MIN, 100, // = STEP_MAX
	     1.00, iter, file_rmsd,
	     bonds, coord_all, natoms1, ali_a,
	     coord_new,coord_ref_1,coord_ref_1,coord_ref_2);
  printf("Final RMSD= %.2f\n", RMSD_kf);

  printf("Storing internal coordinates\n");
  Internal_coordinates(phi_opt, naxes, bonds, natoms1);
  for(i=0; i<naxes; i++)diff_phi[i]=phi_opt[i]-phi_ini[i];
  Periodic_angles(diff_phi, axes, naxes);

  Copy_bonds(bonds, bonds_ini, natoms1);
  Build_up(bonds, natoms1, diff_phi, naxes);
  fprintf(file_rmsd, "# Reconstructed RMSD:\n");
  Write_RMSD(&reduce_step, &RMSD_opt, &RMSD_kf, STEP_MIN, 100,
	     1.00, iter, file_rmsd, bonds, coord_all, natoms1,
	     ali_a, coord_new, coord_ref_1,coord_ref_1,coord_ref_2);
  printf("Reconstructed RMSD= %.2f\n", RMSD_kf);

  fclose(file_rmsd);
  if(file_pdb)fclose(file_pdb);
  Empty_tors(Diff);
  //Empty_Ref(&Ref1);
  //Change_kin_back(axes, naxes, first_kin, last_kin);
  //Empty_Jacobian(J);
  Compute_kinetic(J, axes, naxes, atoms1, natoms1, Ref1,0);
  return;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x420, %rsp            # imm = 0x420
movl 0xf0(%rbp), %eax
movq 0xe8(%rbp), %rax
leaq 0xa8(%rbp), %rax
movq %rax, -0x3c8(%rbp)
movl 0xa0(%rbp), %r10d
movq 0x98(%rbp), %r10
movl 0x90(%rbp), %r10d
movq 0x88(%rbp), %r10
movl 0x80(%rbp), %r10d
movq 0x78(%rbp), %r10
movl 0x70(%rbp), %r10d
movq 0x68(%rbp), %r10
movq 0x60(%rbp), %r10
leaq 0x40(%rbp), %r10
movq %r10, -0x3c0(%rbp)
leaq 0x10(%rbp), %r10
movq %r10, -0x3b8(%rbp)
movq %rdi, -0x28(%rbp)
movq %rsi, -0x30(%rbp)
movq %rdx, -0x38(%rbp)
movq %rcx, -0x40(%rbp)
movsd %xmm0, -0x48(%rbp)
movq %r8, -0x50(%rbp)
movl %r9d, -0x54(%rbp)
movl 0x10(%rax), %ecx
movl %ecx, -0x58(%rbp)
movss 0x4(%rax), %xmm0
movss %xmm0, -0x60(%rbp)
movss 0x8(%rax), %xmm0
movss %xmm0, -0x64(%rbp)
movss 0xc(%rax), %xmm0
movss %xmm0, -0x68(%rbp)
movl $0x4, -0x6c(%rbp)
leaq 0x336af(%rip), %rdi     # 0x80704
xorl %eax, %eax
movb %al, -0x399(%rbp)
callq 0x10d0
movq -0x38(%rbp), %rdi
movl -0x54(%rbp), %esi
movq -0x50(%rbp), %rdx
callq 0x1bf00
movl -0x54(%rbp), %eax
movq %rsp, %rcx
movq %rcx, -0x78(%rbp)
movq %rax, %rcx
shlq $0x6, %rcx
leaq (%rcx,%rcx,2), %rcx
movq %rsp, %rdi
subq %rcx, %rdi
movq %rdi, -0x3b0(%rbp)
movq %rdi, %rsp
movq %rax, -0x80(%rbp)
movl -0x54(%rbp), %eax
movq %rax, %rcx
shlq $0x6, %rcx
leaq (%rcx,%rcx,2), %rdx
movq %rsp, %rcx
subq %rdx, %rcx
movq %rcx, -0x3a8(%rbp)
movq %rcx, %rsp
movq %rax, -0x88(%rbp)
movq -0x38(%rbp), %rsi
movl -0x54(%rbp), %edx
callq 0x4adb0
movb -0x399(%rbp), %al
leaq 0x33319(%rip), %rdi     # 0x803f2
callq 0x10d0
movl 0x70(%rbp), %eax
leaq 0xf(,%rax,8), %rcx
andq $-0x10, %rcx
movq %rsp, %rdi
subq %rcx, %rdi
movq %rdi, -0x398(%rbp)
movq %rdi, %rsp
movq %rax, -0x90(%rbp)
movl 0x70(%rbp), %eax
leaq 0xf(,%rax,8), %rdx
andq $-0x10, %rdx
movq %rsp, %rcx
subq %rdx, %rcx
movq %rcx, -0x390(%rbp)
movq %rcx, %rsp
movq %rax, -0x98(%rbp)
movl 0x70(%rbp), %esi
movq -0x38(%rbp), %rdx
movl -0x54(%rbp), %ecx
callq 0x1e1e0
movl 0x70(%rbp), %eax
leaq 0xf(,%rax,8), %rdx
andq $-0x10, %rdx
movq %rsp, %rcx
subq %rdx, %rcx
movq %rcx, -0x388(%rbp)
movq %rcx, %rsp
movq %rax, -0xa0(%rbp)
movl $0x0, -0x5c(%rbp)
movl -0x5c(%rbp), %eax
cmpl 0x70(%rbp), %eax
jge 0x4d18c
movq -0x388(%rbp), %rax
movslq -0x5c(%rbp), %rcx
xorps %xmm0, %xmm0
movsd %xmm0, (%rax,%rcx,8)
movl -0x5c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x5c(%rbp)
jmp 0x4d166
movq -0x3c0(%rbp), %rax
movl 0x18(%rax), %ecx
movl %ecx, -0xa4(%rbp)
movl -0xa4(%rbp), %edx
movl %edx, %ecx
leal (%rcx,%rcx,2), %ecx
movl %ecx, -0xa8(%rbp)
movl -0xa8(%rbp), %ecx
leaq 0xf(,%rcx,4), %rdx
andq $-0x10, %rdx
movq %rsp, %rdi
subq %rdx, %rdi
movq %rdi, -0x3f0(%rbp)
movq %rdi, %rsp
movq %rcx, -0xb0(%rbp)
movl -0xa8(%rbp), %ecx
leaq 0xf(,%rcx,4), %rsi
andq $-0x10, %rsi
movq %rsp, %rdx
subq %rsi, %rdx
movq %rdx, -0x3e8(%rbp)
movq %rdx, %rsp
movq %rcx, -0xb8(%rbp)
movl -0xa4(%rbp), %esi
movq -0x50(%rbp), %rdx
movq (%rax), %rcx
callq 0x4a130
movq -0x3c0(%rbp), %rax
movq -0x3e8(%rbp), %rdi
movl -0xa4(%rbp), %esi
movq 0x98(%rbp), %rdx
movq 0x8(%rax), %rcx
callq 0x4a130
movl -0xa8(%rbp), %eax
leaq 0xf(,%rax,4), %rdx
andq $-0x10, %rdx
movq %rsp, %rcx
subq %rdx, %rcx
movq %rcx, -0x3e0(%rbp)
movq %rcx, %rsp
movq %rax, -0xc0(%rbp)
movl -0xa8(%rbp), %eax
leaq 0xf(,%rax,4), %rdx
andq $-0x10, %rdx
movq %rsp, %rcx
subq %rdx, %rcx
movq %rcx, -0x3d8(%rbp)
movq %rcx, %rsp
movq %rax, -0xc8(%rbp)
movl -0xa8(%rbp), %eax
leaq 0xf(,%rax,4), %rdx
andq $-0x10, %rdx
movq %rsp, %rcx
subq %rdx, %rcx
movq %rcx, -0x3d0(%rbp)
movq %rcx, %rsp
movq %rax, -0xd0(%rbp)
movl $0x0, -0x5c(%rbp)
movl -0x5c(%rbp), %eax
cmpl -0xa8(%rbp), %eax
jge 0x4d31f
movq -0x3d0(%rbp), %rax
movq -0x3e0(%rbp), %rcx
movq -0x3d8(%rbp), %rdx
movq -0x3f0(%rbp), %rsi
movslq -0x5c(%rbp), %rdi
movss (%rsi,%rdi,4), %xmm0
movslq -0x5c(%rbp), %rsi
movss %xmm0, (%rcx,%rsi,4)
movslq -0x5c(%rbp), %rsi
movss (%rcx,%rsi,4), %xmm0
movslq -0x5c(%rbp), %rsi
movss %xmm0, (%rdx,%rsi,4)
movslq -0x5c(%rbp), %rdx
movss (%rcx,%rdx,4), %xmm0
movslq -0x5c(%rbp), %rcx
movss %xmm0, (%rax,%rcx,4)
movl -0x5c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x5c(%rbp)
jmp 0x4d2b7
movl 0x70(%rbp), %ecx
movl -0xa8(%rbp), %edx
leaq -0x110(%rbp), %rdi
movl %ecx, %esi
callq 0x163a0
movq -0x3e0(%rbp), %rdx
movq -0x3d8(%rbp), %rcx
movq -0x3b8(%rbp), %rax
movq %rdx, -0x118(%rbp)
movq %rcx, -0x120(%rbp)
movq 0x10(%rax), %rax
movq %rax, -0x128(%rbp)
movl -0x54(%rbp), %ecx
movl %ecx, %eax
leal (%rax,%rax,2), %eax
leaq 0xf(,%rax,4), %rcx
andq $-0x10, %rcx
movq %rsp, %rdi
subq %rcx, %rdi
movq %rdi, -0x418(%rbp)
movq %rdi, %rsp
movq %rax, -0x130(%rbp)
movq -0x38(%rbp), %rsi
movl -0x54(%rbp), %edx
callq 0x49770
movq -0x418(%rbp), %rdi
movl -0x54(%rbp), %esi
callq 0x49810
movss %xmm0, -0x134(%rbp)
movq 0x60(%rbp), %rdx
movq -0x30(%rbp), %rcx
leaq 0x3305c(%rip), %rsi     # 0x8041d
xorl %eax, %eax
movb %al, -0x401(%rbp)
leaq -0x200(%rbp), %rdi
movq %rdi, -0x410(%rbp)
callq 0x1200
movq -0x410(%rbp), %rdi
leaq 0x2ef88(%rip), %rsi     # 0x7c372
callq 0x11b0
movq -0x410(%rbp), %rsi
movq %rax, %rcx
movb -0x401(%rbp), %al
movq %rcx, -0x208(%rbp)
leaq 0x3301f(%rip), %rdi     # 0x8042c
callq 0x10d0
movb -0x401(%rbp), %al
movq -0x208(%rbp), %rdi
leaq 0x3330c(%rip), %rsi     # 0x80732
callq 0x1150
movq -0x208(%rbp), %rdi
movss -0x60(%rbp), %xmm0
cvtss2sd %xmm0, %xmm0
movss -0x64(%rbp), %xmm1
cvtss2sd %xmm1, %xmm1
movl -0x58(%rbp), %edx
leaq 0x3331e(%rip), %rsi     # 0x8076c
movb $0x2, %al
movb %al, -0x402(%rbp)
callq 0x1150
movq -0x208(%rbp), %rdi
movss -0x134(%rbp), %xmm0
cvtss2sd %xmm0, %xmm0
leaq 0x33029(%rip), %rsi     # 0x8049e
movb $0x1, %al
movb %al, -0x403(%rbp)
callq 0x1150
movq -0x3f0(%rbp), %rdi
movq -0x3e8(%rbp), %rsi
movq -0x3c0(%rbp), %rax
movq 0x10(%rax), %rdx
movl -0xa4(%rbp), %ecx
callq 0x70af0
movb -0x403(%rbp), %al
cvtsd2ss %xmm0, %xmm0
movss %xmm0, -0x20c(%rbp)
movl $0x0, -0x210(%rbp)
movl $0x0, -0x214(%rbp)
movss -0x20c(%rbp), %xmm0
movss %xmm0, -0x218(%rbp)
movss -0x20c(%rbp), %xmm0
cvtss2sd %xmm0, %xmm0
leaq 0x32fc5(%rip), %rdi     # 0x804b4
callq 0x10d0
movb -0x402(%rbp), %al
movq -0x208(%rbp), %rdi
movss -0x20c(%rbp), %xmm0
cvtss2sd %xmm0, %xmm0
movsd -0x48(%rbp), %xmm1
leaq 0x33280(%rip), %rsi     # 0x80799
callq 0x1150
movb -0x401(%rbp), %al
movq -0x208(%rbp), %rdi
leaq 0x32fa5(%rip), %rsi     # 0x804d7
callq 0x1150
movq -0x208(%rbp), %rdi
movss -0x210(%rbp), %xmm0
cvtss2sd %xmm0, %xmm0
movss -0x20c(%rbp), %xmm1
cvtss2sd %xmm1, %xmm1
movss -0x214(%rbp), %xmm2
cvtss2sd %xmm2, %xmm2
movss -0x134(%rbp), %xmm3
cvtss2sd %xmm3, %xmm3
leaq 0x32f95(%rip), %rsi     # 0x8050a
xorps %xmm4, %xmm4
movl $0x1, %edx
movb $0x5, %al
callq 0x1150
movq $0x0, -0x220(%rbp)
movl -0x54(%rbp), %ecx
movl %ecx, %eax
leal (%rax,%rax,2), %eax
leaq 0xf(,%rax,4), %rdx
andq $-0x10, %rdx
movq %rsp, %rcx
subq %rdx, %rcx
movq %rcx, -0x400(%rbp)
movq %rcx, %rsp
movq %rax, -0x228(%rbp)
movl -0x54(%rbp), %eax
leaq 0xf(,%rax,4), %rdx
andq $-0x10, %rdx
movq %rsp, %rcx
subq %rdx, %rcx
movq %rcx, -0x3f8(%rbp)
movq %rcx, %rsp
movq %rax, -0x230(%rbp)
movl $0x0, -0x5c(%rbp)
movl -0x5c(%rbp), %eax
cmpl -0x54(%rbp), %eax
jge 0x4d61e
movq -0x50(%rbp), %rdi
movslq -0x5c(%rbp), %rax
imulq $0x70, %rax, %rax
addq %rax, %rdi
callq 0x351c0
movq -0x3f8(%rbp), %rax
movslq -0x5c(%rbp), %rcx
movss %xmm0, (%rax,%rcx,4)
movl -0x5c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x5c(%rbp)
jmp 0x4d5e7
movq -0x30(%rbp), %rdi
leaq 0x32efe(%rip), %rsi     # 0x80527
callq 0x1140
cmpl $0x0, %eax
je 0x4d6d3
leaq -0x300(%rbp), %rdi
movq 0x60(%rbp), %rdx
movq -0x30(%rbp), %rcx
leaq 0x32ee3(%rip), %rsi     # 0x80530
movb $0x0, %al
callq 0x1200
leaq -0x300(%rbp), %rdi
leaq 0x2ed10(%rip), %rsi     # 0x7c372
callq 0x11b0
movq %rax, -0x220(%rbp)
leaq -0x300(%rbp), %rsi
leaq 0x32ec9(%rip), %rdi     # 0x80545
movb $0x0, %al
callq 0x10d0
movq -0x220(%rbp), %rdi
movq 0x88(%rbp), %rsi
movl 0x90(%rbp), %edx
callq 0x49fb0
movq -0x400(%rbp), %rdi
movq -0x38(%rbp), %rsi
movl -0x54(%rbp), %edx
callq 0x49770
movq -0x400(%rbp), %rcx
movq -0x220(%rbp), %rdi
movq -0x50(%rbp), %rsi
movl -0x54(%rbp), %edx
movq 0x78(%rbp), %r8
xorl %r9d, %r9d
xorps %xmm0, %xmm0
callq 0x49a60
xorps %xmm0, %xmm0
movsd %xmm0, -0x308(%rbp)
movl $0x0, -0x5c(%rbp)
movq -0x3b8(%rbp), %rcx
movl -0x5c(%rbp), %eax
cmpl (%rcx), %eax
jge 0x4d726
movq -0x3b8(%rbp), %rax
movq 0x10(%rax), %rax
movslq -0x5c(%rbp), %rcx
movss (%rax,%rcx,4), %xmm0
cvtss2sd %xmm0, %xmm0
addsd -0x308(%rbp), %xmm0
movsd %xmm0, -0x308(%rbp)
movl -0x5c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x5c(%rbp)
jmp 0x4d6e5
movl $0x1, -0x30c(%rbp)
movl $0xffffffff, -0x310(%rbp) # imm = 0xFFFFFFFF
movl $0x0, -0x31c(%rbp)
movl $0x0, -0x320(%rbp)
movl $0x0, -0x324(%rbp)
movl $0x1, -0x328(%rbp)
xorps %xmm0, %xmm0
movss %xmm0, -0x32c(%rbp)
movl $0x1, -0x330(%rbp)
movl $0x0, -0x314(%rbp)
movl -0x314(%rbp), %eax
cmpl -0x58(%rbp), %eax
jge 0x4e14d
movl 0x70(%rbp), %eax
movq %rsp, %rcx
movq %rcx, -0x338(%rbp)
leaq 0xf(,%rax,8), %rdx
andq $-0x10, %rdx
movq %rsp, %rcx
subq %rdx, %rcx
movq %rcx, -0x428(%rbp)
movq %rcx, %rsp
movq %rax, -0x340(%rbp)
movl 0x70(%rbp), %eax
leaq 0xf(,%rax,8), %rdx
andq $-0x10, %rdx
movq %rsp, %rcx
subq %rdx, %rcx
movq %rcx, -0x420(%rbp)
movq %rcx, %rsp
movq %rax, -0x348(%rbp)
cmpl $0x1, -0x328(%rbp)
jne 0x4dacc
cmpl $0x0, -0x314(%rbp)
jne 0x4d8a2
leaq 0x32fb0(%rip), %rdi     # 0x807b7
xorl %eax, %eax
callq 0x10d0
movq -0x3b0(%rbp), %rsi
movl -0x54(%rbp), %eax
movq %rsp, %rcx
movq %rcx, -0x350(%rbp)
imulq $0x70, %rax, %rcx
movq %rsp, %rdi
subq %rcx, %rdi
movq %rdi, -0x430(%rbp)
movq %rdi, %rsp
movq %rax, -0x358(%rbp)
movl -0x54(%rbp), %edx
callq 0x4e480
movq -0x3b8(%rbp), %rax
movq -0x430(%rbp), %rcx
movq -0x40(%rbp), %rdi
movq 0x68(%rbp), %rsi
movl 0x70(%rbp), %edx
movl -0x54(%rbp), %r8d
xorl %r9d, %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)
xorl %r9d, %r9d
callq 0x2dc70
addq $0x30, %rsp
movl $0x1, -0x330(%rbp)
movq -0x350(%rbp), %rax
movq %rax, %rsp
movl $0x0, -0x5c(%rbp)
movl -0x5c(%rbp), %eax
cmpl -0xa8(%rbp), %eax
jge 0x4d8ef
movq -0x3e8(%rbp), %rax
movslq -0x5c(%rbp), %rcx
movss (%rax,%rcx,4), %xmm0
movq -0x120(%rbp), %rax
movslq -0x5c(%rbp), %rcx
subss (%rax,%rcx,4), %xmm0
movq -0x108(%rbp), %rax
movslq -0x5c(%rbp), %rcx
movss %xmm0, (%rax,%rcx,4)
movl -0x5c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x5c(%rbp)
jmp 0x4d8a9
cmpl $0x0, -0x314(%rbp)
jne 0x4d989
movq -0x3b8(%rbp), %rax
movq -0x40(%rbp), %rsi
movq 0x60(%rbp), %rdx
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 -0x110(%rbp), %rdi
movl $0x43, %ecx
leaq -0x32c(%rbp), %r8
callq 0x36270
addq $0x30, %rsp
cmpl $0x0, %eax
jge 0x4d984
leaq 0x32e81(%rip), %rdi     # 0x807d1
movb $0x0, %al
callq 0x10d0
movl $0x0, -0x30c(%rbp)
movl -0x31c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x31c(%rbp)
movl -0x324(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x324(%rbp)
jmp 0x4de46
jmp 0x4da8c
cmpl $0x0, -0x330(%rbp)
je 0x4da04
movss -0x32c(%rbp), %xmm0
cvtss2sd %xmm0, %xmm0
leaq 0x32e4e(%rip), %rdi     # 0x807f3
movb $0x1, %al
callq 0x10d0
movl $0x0, -0x330(%rbp)
movl $0x0, -0x5c(%rbp)
movl -0x5c(%rbp), %eax
cmpl 0x70(%rbp), %eax
jge 0x4da02
movss 0x286c3(%rip), %xmm0    # 0x76090
addss -0x32c(%rbp), %xmm0
cvtss2sd %xmm0, %xmm0
movq -0x40(%rbp), %rax
movq 0x20(%rax), %rax
movslq -0x5c(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x5c(%rbp), %rcx
mulsd (%rax,%rcx,8), %xmm0
movsd %xmm0, (%rax,%rcx,8)
movl -0x5c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x5c(%rbp)
jmp 0x4d9bd
jmp 0x4da04
movq -0x3b8(%rbp), %rax
movq -0x40(%rbp), %rcx
movq 0x20(%rcx), %rsi
movq -0x40(%rbp), %rcx
movq 0x10(%rcx), %rdx
movq 0x18(%rax), %rcx
movl 0x70(%rbp), %r8d
movl -0xa8(%rbp), %r9d
leaq -0x110(%rbp), %rdi
callq 0x4e530
cmpl $0x0, %eax
je 0x4da8a
leaq 0x32dd3(%rip), %rdi     # 0x80815
movb $0x0, %al
callq 0x10d0
movl $0x0, -0x30c(%rbp)
movl -0x31c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x31c(%rbp)
movl -0x324(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x324(%rbp)
movl $0x0, -0x328(%rbp)
movl $0x10, -0x35c(%rbp)
jmp 0x4e10c
jmp 0x4da8c
movl $0x0, -0x5c(%rbp)
movl -0x5c(%rbp), %eax
cmpl 0x70(%rbp), %eax
jge 0x4daca
movq -0x428(%rbp), %rax
movq -0xf8(%rbp), %rcx
movslq -0x5c(%rbp), %rdx
movss (%rcx,%rdx,4), %xmm0
cvtss2sd %xmm0, %xmm0
movslq -0x5c(%rbp), %rcx
movsd %xmm0, (%rax,%rcx,8)
movl -0x5c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x5c(%rbp)
jmp 0x4da93
jmp 0x4dad1
jmp 0x4de46
xorps %xmm0, %xmm0
movss %xmm0, -0x360(%rbp)
movl $0x0, -0x5c(%rbp)
movl -0x5c(%rbp), %eax
cmpl 0x70(%rbp), %eax
jge 0x4db4c
movq -0x428(%rbp), %rax
movslq -0x5c(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm0
movaps 0x2e98e(%rip), %xmm1    # 0x7c490
pand %xmm1, %xmm0
movss -0x360(%rbp), %xmm1
cvtss2sd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jbe 0x4db3f
movq -0x428(%rbp), %rax
movslq -0x5c(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm0
movaps 0x2e961(%rip), %xmm1    # 0x7c490
pand %xmm1, %xmm0
cvtsd2ss %xmm0, %xmm0
movss %xmm0, -0x360(%rbp)
jmp 0x4db41
movl -0x5c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x5c(%rbp)
jmp 0x4dae3
movss -0x360(%rbp), %xmm0
ucomiss -0x68(%rbp), %xmm0
jbe 0x4dbe4
movss -0x68(%rbp), %xmm0
divss -0x360(%rbp), %xmm0
movss %xmm0, -0x364(%rbp)
movss -0x360(%rbp), %xmm0
cvtss2sd %xmm0, %xmm0
leaq 0x329e7(%rip), %rdi     # 0x8056d
movb $0x1, %al
callq 0x10d0
movss -0x364(%rbp), %xmm0
cvtss2sd %xmm0, %xmm0
leaq 0x329ed(%rip), %rdi     # 0x8058d
movb $0x1, %al
callq 0x10d0
movl $0x0, -0x5c(%rbp)
movl -0x5c(%rbp), %eax
cmpl 0x70(%rbp), %eax
jge 0x4dbe2
movq -0x428(%rbp), %rax
movss -0x364(%rbp), %xmm0
cvtss2sd %xmm0, %xmm0
movslq -0x5c(%rbp), %rcx
mulsd (%rax,%rcx,8), %xmm0
movsd %xmm0, (%rax,%rcx,8)
movl -0x5c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x5c(%rbp)
jmp 0x4dbae
jmp 0x4dbe4
movss 0x284a4(%rip), %xmm0    # 0x76090
movss %xmm0, -0x368(%rbp)
movss 0x28494(%rip), %xmm0    # 0x76090
movss %xmm0, -0x36c(%rbp)
jmp 0x4dc06
movl $0x0, -0x5c(%rbp)
movl -0x5c(%rbp), %eax
cmpl 0x70(%rbp), %eax
jge 0x4dc50
movq -0x420(%rbp), %rax
movq -0x428(%rbp), %rcx
movq -0x388(%rbp), %rdx
movslq -0x5c(%rbp), %rsi
movsd (%rdx,%rsi,8), %xmm0
movslq -0x5c(%rbp), %rdx
addsd (%rcx,%rdx,8), %xmm0
movslq -0x5c(%rbp), %rcx
movsd %xmm0, (%rax,%rcx,8)
movl -0x5c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x5c(%rbp)
jmp 0x4dc0d
movq -0x3c0(%rbp), %r14
movq -0x418(%rbp), %r12
movq -0x3a8(%rbp), %rdi
movq -0x38(%rbp), %rsi
movl -0x54(%rbp), %edx
callq 0x4adb0
movq -0x420(%rbp), %rdx
movq -0x3a8(%rbp), %rdi
movl -0x54(%rbp), %esi
movl 0x70(%rbp), %ecx
callq 0x1c4f0
movq -0x3a8(%rbp), %r9
movq -0x3f0(%rbp), %r10
movq -0x3e8(%rbp), %rax
movss -0x64(%rbp), %xmm0
movss -0x60(%rbp), %xmm1
movss -0x368(%rbp), %xmm2
movl -0x314(%rbp), %ecx
movq -0x208(%rbp), %r8
movl -0x54(%rbp), %r15d
movq -0x118(%rbp), %rbx
movq -0x120(%rbp), %r11
leaq -0x36c(%rbp), %rdi
leaq -0x218(%rbp), %rsi
leaq -0x20c(%rbp), %rdx
subq $0x50, %rsp
movq %r12, (%rsp)
movl %r15d, 0x8(%rsp)
movq (%r14), %r15
movq %r15, 0x10(%rsp)
movq 0x8(%r14), %r15
movq %r15, 0x18(%rsp)
movq 0x10(%r14), %r15
movq %r15, 0x20(%rsp)
movq 0x18(%r14), %r14
movq %r14, 0x28(%rsp)
movq %rbx, 0x30(%rsp)
movq %r11, 0x38(%rsp)
movq %r10, 0x40(%rsp)
movq %rax, 0x48(%rsp)
callq 0x4cc70
addq $0x50, %rsp
movl %eax, -0x30c(%rbp)
cmpl $0x0, -0x30c(%rbp)
je 0x4dd46
jmp 0x4de44
movss -0x36c(%rbp), %xmm0
mulss -0x368(%rbp), %xmm0
movss %xmm0, -0x368(%rbp)
movss -0x368(%rbp), %xmm0
cvtss2sd %xmm0, %xmm1
movsd 0x2dd0e(%rip), %xmm0    # 0x7ba80
ucomisd %xmm1, %xmm0
ja 0x4dd92
movss -0x36c(%rbp), %xmm0
cvtss2sd %xmm0, %xmm1
movsd 0x2ce8c(%rip), %xmm0    # 0x7ac18
ucomisd %xmm1, %xmm0
jbe 0x4ddbb
movss -0x368(%rbp), %xmm0
cvtss2sd %xmm0, %xmm0
leaq 0x32809(%rip), %rdi     # 0x805ae
movb $0x1, %al
callq 0x10d0
movl $0x0, -0x30c(%rbp)
jmp 0x4de44
movss -0x36c(%rbp), %xmm0
cvtss2sd %xmm0, %xmm0
leaq 0x32805(%rip), %rdi     # 0x805d3
movb $0x1, %al
callq 0x10d0
cmpl $0x0, -0x328(%rbp)
je 0x4de1b
movl $0x0, -0x5c(%rbp)
movl -0x5c(%rbp), %eax
cmpl 0x70(%rbp), %eax
jge 0x4de19
movq -0x428(%rbp), %rax
movss -0x36c(%rbp), %xmm0
cvtss2sd %xmm0, %xmm0
movslq -0x5c(%rbp), %rcx
mulsd (%rax,%rcx,8), %xmm0
movsd %xmm0, (%rax,%rcx,8)
movl -0x5c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x5c(%rbp)
jmp 0x4dde5
jmp 0x4de3f
movq -0x428(%rbp), %rax
movss -0x36c(%rbp), %xmm0
cvtss2sd %xmm0, %xmm0
movslq -0x310(%rbp), %rcx
mulsd (%rax,%rcx,8), %xmm0
movsd %xmm0, (%rax,%rcx,8)
jmp 0x4dc04
jmp 0x4de46
movss -0x218(%rbp), %xmm1
movss 0x3e02a(%rip), %xmm0    # 0x8be80
ucomiss %xmm1, %xmm0
seta %al
andb $0x1, %al
movzbl %al, %eax
movl %eax, -0x318(%rbp)
cmpl $0x0, -0x30c(%rbp)
jne 0x4deea
movl -0x31c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x31c(%rbp)
cmpl $0x2, -0x31c(%rbp)
jl 0x4de92
movl $0x1, -0x318(%rbp)
cmpl $0x0, -0x328(%rbp)
je 0x4deb6
movl -0x324(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x324(%rbp)
movl $0x0, -0x328(%rbp)
jmp 0x4decd
movl -0x324(%rbp), %eax
cmpl -0x6c(%rbp), %eax
jge 0x4decb
movl $0x1, -0x328(%rbp)
jmp 0x4decd
cmpl $0x0, -0x318(%rbp)
jne 0x4dee5
movl $0x10, -0x35c(%rbp)
jmp 0x4e10c
jmp 0x4df9b
movq -0x3b0(%rbp), %rdi
movq -0x3a8(%rbp), %rsi
movl -0x54(%rbp), %edx
callq 0x4adb0
movq -0x390(%rbp), %rdi
movq -0x3b0(%rbp), %rdx
movl 0x70(%rbp), %esi
movl -0x54(%rbp), %ecx
callq 0x1e1e0
movl $0x0, -0x5c(%rbp)
movl -0x5c(%rbp), %eax
cmpl 0x70(%rbp), %eax
jge 0x4df63
movq -0x388(%rbp), %rax
movq -0x398(%rbp), %rcx
movq -0x390(%rbp), %rdx
movslq -0x5c(%rbp), %rsi
movsd (%rdx,%rsi,8), %xmm0
movslq -0x5c(%rbp), %rdx
subsd (%rcx,%rdx,8), %xmm0
movslq -0x5c(%rbp), %rcx
movsd %xmm0, (%rax,%rcx,8)
movl -0x5c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x5c(%rbp)
jmp 0x4df20
movl $0x0, -0x31c(%rbp)
cmpl $0x0, -0x328(%rbp)
je 0x4df82
movl $0x0, -0x324(%rbp)
jmp 0x4df99
movl -0x324(%rbp), %eax
cmpl -0x6c(%rbp), %eax
jge 0x4df97
movl $0x1, -0x328(%rbp)
jmp 0x4df99
jmp 0x4df9b
cmpq $0x0, -0x220(%rbp)
je 0x4e09b
movq -0x3d0(%rbp), %rdi
movq -0x118(%rbp), %rsi
movq -0x128(%rbp), %rdx
movl -0xa4(%rbp), %ecx
callq 0x70af0
movq -0x3c8(%rbp), %rax
cvtsd2ss %xmm0, %xmm0
movss %xmm0, -0x370(%rbp)
movss -0x370(%rbp), %xmm0
ucomiss 0x1c(%rax), %xmm0
ja 0x4dff7
cmpl $0x0, -0x318(%rbp)
je 0x4e099
movl -0x320(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x320(%rbp)
movl $0x0, -0x5c(%rbp)
movl -0x5c(%rbp), %eax
cmpl -0xa8(%rbp), %eax
jge 0x4e043
movq -0x3d0(%rbp), %rax
movq -0x118(%rbp), %rcx
movslq -0x5c(%rbp), %rdx
movss (%rcx,%rdx,4), %xmm0
movslq -0x5c(%rbp), %rcx
movss %xmm0, (%rax,%rcx,4)
movl -0x5c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x5c(%rbp)
jmp 0x4e00d
movq -0x418(%rbp), %rsi
movq -0x3f8(%rbp), %rdx
movq -0x400(%rbp), %rdi
movl -0x54(%rbp), %ecx
callq 0x70af0
movq -0x418(%rbp), %rcx
cvtsd2ss %xmm0, %xmm0
movss %xmm0, -0x210(%rbp)
movq -0x220(%rbp), %rdi
movq -0x50(%rbp), %rsi
movl -0x54(%rbp), %edx
movq 0x78(%rbp), %r8
movl -0x320(%rbp), %r9d
movss -0x210(%rbp), %xmm0
callq 0x49a60
jmp 0x4e09b
leaq 0x2ffd6(%rip), %rdi     # 0x7e078
movb $0x0, %al
callq 0x10d0
cmpl $0x0, -0x318(%rbp)
je 0x4e0d8
movl -0x31c(%rbp), %esi
movl -0x324(%rbp), %edx
leaq 0x32771(%rip), %rdi     # 0x80836
movb $0x0, %al
callq 0x10d0
movl $0xe, -0x35c(%rbp)
jmp 0x4e10c
movq -0x120(%rbp), %rax
movq %rax, -0x378(%rbp)
movq -0x118(%rbp), %rax
movq %rax, -0x120(%rbp)
movq -0x378(%rbp), %rax
movq %rax, -0x118(%rbp)
movl $0x0, -0x35c(%rbp)
movq -0x338(%rbp), %rax
movq %rax, %rsp
movl -0x35c(%rbp), %eax
movl %eax, -0x434(%rbp)
testl %eax, %eax
je 0x4e137
jmp 0x4e128
movl -0x434(%rbp), %eax
subl $0xe, %eax
je 0x4e14d
jmp 0x4e135
jmp 0x4e139
jmp 0x4e139
movl -0x314(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x314(%rbp)
jmp 0x4d781
movq -0x3c0(%rbp), %rbx
movq -0x418(%rbp), %r15
movq -0x208(%rbp), %rdi
leaq 0x324ad(%rip), %rsi     # 0x80616
movb $0x0, %al
callq 0x1150
movq -0x3f0(%rbp), %r10
movq -0x3b0(%rbp), %r9
movq -0x3e8(%rbp), %rax
movss -0x64(%rbp), %xmm0
movl -0x314(%rbp), %ecx
movq -0x208(%rbp), %r8
movl -0x54(%rbp), %r14d
movq -0x118(%rbp), %r11
leaq -0x37c(%rbp), %rdi
leaq -0x218(%rbp), %rsi
leaq -0x20c(%rbp), %rdx
movss 0x27ef1(%rip), %xmm1    # 0x760b0
movss 0x27ec9(%rip), %xmm2    # 0x76090
subq $0x50, %rsp
movq %r15, (%rsp)
movl %r14d, 0x8(%rsp)
movq (%rbx), %r14
movq %r14, 0x10(%rsp)
movq 0x8(%rbx), %r14
movq %r14, 0x18(%rsp)
movq 0x10(%rbx), %r14
movq %r14, 0x20(%rsp)
movq 0x18(%rbx), %rbx
movq %rbx, 0x28(%rsp)
movq %r11, 0x30(%rsp)
movq %r10, 0x38(%rsp)
movq %r10, 0x40(%rsp)
movq %rax, 0x48(%rsp)
callq 0x4cc70
addq $0x50, %rsp
movss -0x20c(%rbp), %xmm0
cvtss2sd %xmm0, %xmm0
leaq 0x323fe(%rip), %rdi     # 0x80625
movb $0x1, %al
callq 0x10d0
leaq 0x32402(%rip), %rdi     # 0x80637
movb $0x0, %al
callq 0x10d0
movq -0x390(%rbp), %rdi
movq -0x3b0(%rbp), %rdx
movl 0x70(%rbp), %esi
movl -0x54(%rbp), %ecx
callq 0x1e1e0
movl $0x0, -0x5c(%rbp)
movl -0x5c(%rbp), %eax
cmpl 0x70(%rbp), %eax
jge 0x4e29c
movq -0x398(%rbp), %rax
movq -0x390(%rbp), %rcx
movslq -0x5c(%rbp), %rdx
movsd (%rcx,%rdx,8), %xmm0
movslq -0x5c(%rbp), %rcx
subsd (%rax,%rcx,8), %xmm0
movq -0x28(%rbp), %rax
movslq -0x5c(%rbp), %rcx
movsd %xmm0, (%rax,%rcx,8)
movl -0x5c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x5c(%rbp)
jmp 0x4e25c
movq -0x3c0(%rbp), %rbx
movq -0x418(%rbp), %r15
movq -0x28(%rbp), %rdi
movq 0x68(%rbp), %rsi
movl 0x70(%rbp), %edx
callq 0x44010
movq -0x3b0(%rbp), %rdi
movq -0x38(%rbp), %rsi
movl -0x54(%rbp), %edx
callq 0x4adb0
movq -0x3b0(%rbp), %rdi
movl -0x54(%rbp), %esi
movq -0x28(%rbp), %rdx
movl 0x70(%rbp), %ecx
callq 0x1c4f0
movq -0x208(%rbp), %rdi
leaq 0x32364(%rip), %rsi     # 0x80655
movb $0x0, %al
callq 0x1150
movq -0x3b0(%rbp), %r9
movq -0x3f0(%rbp), %r10
movq -0x3e8(%rbp), %rax
movss -0x64(%rbp), %xmm0
movl -0x314(%rbp), %ecx
movq -0x208(%rbp), %r8
movl -0x54(%rbp), %r14d
movq -0x118(%rbp), %r11
leaq -0x37c(%rbp), %rdi
leaq -0x218(%rbp), %rsi
leaq -0x20c(%rbp), %rdx
movss 0x27d69(%rip), %xmm1    # 0x760b0
movss 0x27d41(%rip), %xmm2    # 0x76090
subq $0x50, %rsp
movq %r15, (%rsp)
movl %r14d, 0x8(%rsp)
movq (%rbx), %r14
movq %r14, 0x10(%rsp)
movq 0x8(%rbx), %r14
movq %r14, 0x18(%rsp)
movq 0x10(%rbx), %r14
movq %r14, 0x20(%rsp)
movq 0x18(%rbx), %rbx
movq %rbx, 0x28(%rsp)
movq %r11, 0x30(%rsp)
movq %r10, 0x38(%rsp)
movq %r10, 0x40(%rsp)
movq %rax, 0x48(%rsp)
callq 0x4cc70
addq $0x50, %rsp
movss -0x20c(%rbp), %xmm0
cvtss2sd %xmm0, %xmm0
leaq 0x324b4(%rip), %rdi     # 0x80863
movb $0x1, %al
callq 0x10d0
movq -0x208(%rbp), %rdi
callq 0x10a0
cmpq $0x0, -0x220(%rbp)
je 0x4e3d8
movq -0x220(%rbp), %rdi
callq 0x10a0
subq $0x40, %rsp
movups -0x110(%rbp), %xmm0
movups -0x100(%rbp), %xmm1
movups -0xf0(%rbp), %xmm2
movups -0xe0(%rbp), %xmm3
movq %rsp, %rax
movups %xmm3, 0x30(%rax)
movups %xmm2, 0x20(%rax)
movups %xmm1, 0x10(%rax)
movups %xmm0, (%rax)
callq 0x16450
movq -0x3b8(%rbp), %rax
addq $0x40, %rsp
movq -0x40(%rbp), %rdi
movq 0x68(%rbp), %rsi
movl 0x70(%rbp), %edx
movq -0x50(%rbp), %rcx
movl -0x54(%rbp), %r8d
xorl %r9d, %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)
xorl %r9d, %r9d
callq 0x2dc70
addq $0x30, %rsp
movl $0x1, -0x35c(%rbp)
movq -0x78(%rbp), %rax
movq %rax, %rsp
leaq -0x20(%rbp), %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
nopw (%rax,%rax)