// File: /workspace/github_c_makefile_star2_O3/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 %r13
pushq %r12
pushq %rbx
subq $0x318, %rsp            # imm = 0x318
movl %r9d, %ebx
movq %r8, %r14
movsd %xmm0, -0xd0(%rbp)
movq %rcx, -0xb8(%rbp)
movq %rdx, %r12
movq %rsi, -0x38(%rbp)
movq %rdi, -0x138(%rbp)
movl 0x70(%rbp), %r15d
movl 0xb8(%rbp), %eax
movl %eax, -0x70(%rbp)
movss 0xac(%rbp), %xmm0
movss %xmm0, -0xe4(%rbp)
movss 0xb0(%rbp), %xmm0
movss %xmm0, -0x74(%rbp)
movss 0xb4(%rbp), %xmm0
movss %xmm0, -0xe0(%rbp)
leaq 0x26551(%rip), %rdi     # 0x5bc5c
callq 0x2090
movq %r12, %rdi
movl %ebx, %esi
movq %r14, -0xb0(%rbp)
movq %r14, %rdx
callq 0x14cf3
movq %r12, %rcx
movl %ebx, %eax
movq %rsp, %r13
movq %rax, -0x58(%rbp)
shlq $0x6, %rax
leaq (%rax,%rax,2), %rax
subq %rax, %r13
movq %r13, %rsp
movq %rsp, %r12
subq %rax, %r12
movq %r12, %rsp
movq $0x0, 0x28(%r13)
movq %rbx, -0x30(%rbp)
testl %ebx, %ebx
movq %rcx, -0x68(%rbp)
jle 0x357af
xorl %ebx, %ebx
xorl %r14d, %r14d
leaq (%rcx,%rbx), %rsi
leaq (%rbx,%r13), %rdi
movl $0xc0, %edx
callq 0x21b0
movq -0x68(%rbp), %rcx
testl %r14d, %r14d
je 0x3579f
movq 0x28(%rcx,%rbx), %rax
subq %rcx, %rax
shrq $0x6, %rax
imull $0xaaaaaaab, %eax, %eax # imm = 0xAAAAAAAB
cltq
leaq (%rax,%rax,2), %rax
shlq $0x6, %rax
addq %r13, %rax
movq %rax, 0x28(%r13,%rbx)
incl %r14d
addq $0xc0, %rbx
cmpl %r14d, -0x30(%rbp)
jne 0x35760
leaq 0x264d3(%rip), %rdi     # 0x5bc89
callq 0x2090
movl %r15d, %r14d
movq %rsp, %rdi
leaq 0xf(,%r14,8), %rbx
andq $-0x10, %rbx
subq %rbx, %rdi
movq %rdi, %rsp
movq %rsp, %rax
subq %rbx, %rax
movq %rax, -0x128(%rbp)
movq %rax, %rsp
movq %rdi, -0x130(%rbp)
movl %r15d, %esi
movq -0x68(%rbp), %rdx
movq -0x30(%rbp), %rcx
callq 0x16806
movq %rsp, %rdi
movq %rbx, -0x160(%rbp)
subq %rbx, %rdi
movq %rdi, %rsp
testl %r15d, %r15d
movq %rdi, -0x118(%rbp)
jle 0x35825
leaq (,%r14,8), %rdx
xorl %esi, %esi
callq 0x2110
movq %r14, -0xa8(%rbp)
leaq 0x40(%rbp), %r11
movslq 0x18(%r11), %rbx
leal (%rbx,%rbx,2), %edx
leaq 0xf(,%rdx,4), %rax
andq $-0x10, %rax
movq %rsp, %rdi
subq %rax, %rdi
movq %rdi, %rsp
movq %rsp, %rcx
subq %rax, %rcx
movq %rcx, -0x60(%rbp)
movq %rcx, %rsp
testq %rbx, %rbx
movq %r13, -0x98(%rbp)
movq %rdi, -0xd8(%rbp)
movq %rbx, -0x110(%rbp)
movq %rdx, -0x100(%rbp)
jle 0x3597e
movq %rdx, %r13
movq 0x98(%rbp), %rcx
movq (%r11), %rdx
xorl %esi, %esi
movq -0xb0(%rbp), %r10
movslq (%rdx,%rsi,4), %r8
imulq $0x70, %r8, %r9
addq %r10, %r9
xorl %r8d, %r8d
xorps %xmm0, %xmm0
cvtsd2ss (%r9,%r8,2), %xmm0
movss %xmm0, (%rdi,%r8)
addq $0x4, %r8
cmpl $0xc, %r8d
jne 0x358a2
incq %rsi
addq %r8, %rdi
cmpq %rbx, %rsi
jne 0x35894
movq 0x8(%r11), %rdx
xorl %esi, %esi
movq -0x60(%rbp), %rdi
movslq (%rdx,%rsi,4), %r8
imulq $0x70, %r8, %r9
addq %rcx, %r9
xorl %r8d, %r8d
xorps %xmm0, %xmm0
cvtsd2ss (%r9,%r8,2), %xmm0
movss %xmm0, (%rdi,%r8)
addq $0x4, %r8
cmpl $0xc, %r8d
jne 0x358de
incq %rsi
addq %r8, %rdi
cmpq %rbx, %rsi
jne 0x358d0
movq %rsp, %rdi
subq %rax, %rdi
movq %rdi, %rsp
movq %rsp, %r15
subq %rax, %r15
movq %r15, %rsp
movq %rsp, %r14
subq %rax, %r14
movq %r14, %rsp
testl %ebx, %ebx
movq %rdi, -0x80(%rbp)
movq %r14, -0x108(%rbp)
movq %r15, -0x88(%rbp)
jle 0x359ad
movq %r13, %rax
cmpl $0x2, %eax
movl $0x1, %r13d
cmovgel %eax, %r13d
shlq $0x2, %r13
movq -0xd8(%rbp), %rbx
movq %rbx, %rsi
movq %r13, %rdx
callq 0x21b0
movq %r15, %rdi
movq %rbx, %rsi
movq %r13, %rdx
callq 0x21b0
movq %r14, %rdi
movq %rbx, %rsi
movq %r13, %rdx
callq 0x21b0
movq -0x100(%rbp), %rdx
jmp 0x359b0
movq %rsp, %rcx
subq %rax, %rcx
movq %rcx, -0x80(%rbp)
movq %rcx, %rsp
movq %rsp, %rcx
subq %rax, %rcx
movq %rcx, -0x88(%rbp)
movq %rcx, %rsp
movq %rsp, %rcx
subq %rax, %rcx
movq %rcx, -0x108(%rbp)
movq %rcx, %rsp
jmp 0x359b4
movq %r13, %rdx
movl 0x70(%rbp), %r15d
leaq -0x1a0(%rbp), %rdi
movl %r15d, %esi
movl %r15d, %ecx
callq 0x10f90
movq -0x30(%rbp), %rcx
leal (%rcx,%rcx,2), %eax
leaq 0xf(,%rax,4), %r14
andq $-0x10, %r14
movq %rsp, %rax
subq %r14, %rax
movq %rax, -0xa0(%rbp)
movq %rax, %rsp
testl %ecx, %ecx
movq -0x68(%rbp), %rdi
movq -0x58(%rbp), %rbx
jle 0x35a3b
leaq 0x8(%rdi), %rax
xorl %ecx, %ecx
movq -0xa0(%rbp), %rdx
leaq (%rcx,%rcx,2), %rsi
shlq $0x6, %rsi
cmpl $0x0, 0x20(%rdi,%rsi)
js 0x35a3b
xorl %esi, %esi
xorps %xmm0, %xmm0
cvtsd2ss (%rax,%rsi,2), %xmm0
movss %xmm0, (%rdx,%rsi)
addq $0x4, %rsi
cmpq $0xc, %rsi
jne 0x35a13
incq %rcx
addq $0xc0, %rax
addq %rsi, %rdx
cmpq %rbx, %rcx
jne 0x35a02
leaq 0x10(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x158(%rbp)
movq -0xa0(%rbp), %rdi
movq -0x30(%rbp), %r15
movl %r15d, %esi
callq 0x3273e
movss %xmm0, -0x50(%rbp)
leaq 0x25694(%rip), %rsi     # 0x5b0fd
leaq -0x340(%rbp), %r13
movq %r13, %rdi
movq 0x60(%rbp), %rdx
movq -0x38(%rbp), %rcx
xorl %eax, %eax
callq 0x2270
leaq 0x21777(%rip), %rsi     # 0x57200
movq %r13, %rdi
callq 0x2220
movq %rax, %rbx
leaq 0x25671(%rip), %rdi     # 0x5b10c
movq %r13, %rsi
xorl %eax, %eax
callq 0x20f0
leaq 0x2591a(%rip), %rdi     # 0x5b3c6
movl $0x39, %esi
movl $0x1, %edx
movq %rbx, %rcx
callq 0x2290
xorps %xmm0, %xmm0
cvtss2sd -0xe4(%rbp), %xmm0
cvtss2sd -0x74(%rbp), %xmm1
leaq 0x2592b(%rip), %rsi     # 0x5b400
movq %rbx, %rdi
movl -0x70(%rbp), %edx
movb $0x2, %al
callq 0x21a0
xorps %xmm0, %xmm0
cvtss2sd -0x50(%rbp), %xmm0
movsd %xmm0, -0xf0(%rbp)
leaq 0x25685(%rip), %rsi     # 0x5b17e
movq %rbx, %rdi
movb $0x1, %al
callq 0x21a0
leaq 0x40(%rbp), %rax
movq 0x10(%rax), %rdx
movq -0xd8(%rbp), %rdi
movq -0x60(%rbp), %rsi
movq -0x110(%rbp), %rcx
callq 0x4dfa0
cvtsd2ss %xmm0, %xmm0
movss %xmm0, -0x78(%rbp)
movss %xmm0, -0x44(%rbp)
cvtss2sd %xmm0, %xmm0
movsd %xmm0, -0x50(%rbp)
leaq 0x25654(%rip), %rdi     # 0x5b194
movb $0x1, %al
callq 0x20f0
leaq 0x258df(%rip), %rsi     # 0x5b42d
movq %rbx, %rdi
movsd -0x50(%rbp), %xmm0
movsd -0xd0(%rbp), %xmm1
movb $0x2, %al
callq 0x21a0
leaq 0x2564b(%rip), %rdi     # 0x5b1b7
movl $0x32, %esi
movl $0x1, %edx
movq %rbx, %rcx
callq 0x2290
leaq 0x25665(%rip), %rsi     # 0x5b1ea
xorps %xmm0, %xmm0
xorpd %xmm2, %xmm2
xorps %xmm4, %xmm4
movq %rbx, -0xd0(%rbp)
movq %rbx, %rdi
movsd -0x50(%rbp), %xmm1
movsd -0xf0(%rbp), %xmm3
movl $0x1, %edx
movb $0x5, %al
callq 0x21a0
movq -0x58(%rbp), %rcx
movq %rsp, %rax
subq %r14, %rax
movq %rax, -0xf8(%rbp)
movq %rax, %rsp
movq %rsp, %r14
leaq 0xf(,%rcx,4), %rax
andq $-0x10, %rax
subq %rax, %r14
movq %r14, %rsp
testl %r15d, %r15d
jle 0x35c09
xorl %ebx, %ebx
movq -0xb0(%rbp), %r13
movq %r13, %rdi
movq %rcx, %r15
callq 0x25a4d
movq %r15, %rcx
movss %xmm0, (%r14,%rbx,4)
incq %rbx
addq $0x70, %r13
cmpq %rbx, %r15
jne 0x35be9
movq %r14, -0x150(%rbp)
leaq 0x255f0(%rip), %rsi     # 0x5b207
movq -0x38(%rbp), %rbx
movq %rbx, %rdi
callq 0x2190
testl %eax, %eax
je 0x35d15
movl 0x90(%rbp), %r14d
movq 0x88(%rbp), %r15
leaq 0x255d0(%rip), %rsi     # 0x5b210
leaq -0x270(%rbp), %r13
movq %r13, %rdi
movq 0x60(%rbp), %rdx
movq %rbx, %rcx
xorl %eax, %eax
callq 0x2270
leaq 0x215a1(%rip), %rsi     # 0x57200
movq %r13, %rdi
callq 0x2220
movq %rax, %rbx
leaq 0x255b4(%rip), %rdi     # 0x5b225
movq %r13, %rsi
xorl %eax, %eax
callq 0x20f0
movq %rbx, -0xc0(%rbp)
movq %rbx, %rdi
movq %r15, %rsi
movl %r14d, %edx
callq 0x32bec
cmpl $0x0, -0x30(%rbp)
movq -0x98(%rbp), %r13
movq -0x68(%rbp), %rdi
movq -0x58(%rbp), %rbx
jle 0x35ceb
leaq 0x8(%rdi), %rax
xorl %ecx, %ecx
movq -0xf8(%rbp), %rdx
leaq (%rcx,%rcx,2), %rsi
shlq $0x6, %rsi
cmpl $0x0, 0x20(%rdi,%rsi)
js 0x35ceb
xorl %esi, %esi
xorps %xmm0, %xmm0
cvtsd2ss (%rax,%rsi,2), %xmm0
movss %xmm0, (%rdx,%rsi)
addq $0x4, %rsi
cmpq $0xc, %rsi
jne 0x35cc3
incq %rcx
addq $0xc0, %rax
addq %rsi, %rdx
cmpq %rbx, %rcx
jne 0x35cb2
xorps %xmm0, %xmm0
movq -0xc0(%rbp), %rdi
movq -0xb0(%rbp), %rsi
movq -0x30(%rbp), %rdx
movq -0xf8(%rbp), %rcx
movq 0x78(%rbp), %r8
xorl %r9d, %r9d
callq 0x3285f
jmp 0x35d2b
movq $0x0, -0xc0(%rbp)
movq -0x98(%rbp), %r13
movq -0x58(%rbp), %rbx
movl 0x70(%rbp), %r15d
movl $0x0, -0x270(%rbp)
cmpl $0x0, -0x70(%rbp)
movq -0x60(%rbp), %r8
movq -0x100(%rbp), %rax
movq -0x88(%rbp), %r9
jle 0x365ce
cmpl $0x2, %eax
movl $0x1, -0x38(%rbp)
movl $0x1, %r10d
cmovgel %eax, %r10d
leaq 0x8(%r13), %rax
movq %rax, -0x140(%rbp)
imulq $0x70, %rbx, %rax
movq %rax, -0x148(%rbp)
xorl %ebx, %ebx
movl $0x1, -0x6c(%rbp)
movl $0x1, %ecx
movl $0x0, -0x40(%rbp)
movl $0x0, -0xdc(%rbp)
movl $0x0, -0x3c(%rbp)
movq %r10, -0xc8(%rbp)
movq %rsp, -0xf0(%rbp)
movq %rsp, %r14
movq -0x160(%rbp), %rax
subq %rax, %r14
movq %r14, %rsp
movq %rsp, %r13
subq %rax, %r13
movq %r13, %rsp
cmpl $0x1, %ecx
movq %r9, -0x88(%rbp)
movq %rbx, -0x58(%rbp)
jne 0x35f43
movl %ecx, -0x8c(%rbp)
testl %ebx, %ebx
jne 0x35e9d
leaq 0x25ebe(%rip), %rdi     # 0x5bcb3
callq 0x2090
movq %rsp, -0x38(%rbp)
movq %rsp, %rcx
movq -0x148(%rbp), %rdi
subq %rdi, %rcx
movq %rcx, %rsp
cmpl $0x0, -0x30(%rbp)
jle 0x35e3d
xorl %eax, %eax
movq -0x140(%rbp), %rdx
movq 0x10(%rdx), %rsi
movq %rsi, 0x10(%rcx,%rax)
movups (%rdx), %xmm0
movups %xmm0, (%rcx,%rax)
addq $0xc0, %rdx
addq $0x70, %rax
cmpq %rax, %rdi
jne 0x35e1d
subq $0x30, %rsp
leaq 0x10(%rbp), %rax
movups (%rax), %xmm0
movupd 0x10(%rax), %xmm1
movupd 0x20(%rax), %xmm2
movupd %xmm2, 0x20(%rsp)
movupd %xmm1, 0x10(%rsp)
movups %xmm0, (%rsp)
movq -0xb8(%rbp), %rdi
movq 0x68(%rbp), %rsi
movl %r15d, %edx
movq -0x30(%rbp), %r8
xorl %r9d, %r9d
callq 0x20900
addq $0x30, %rsp
movl $0x1, -0x6c(%rbp)
movq -0x38(%rbp), %rsp
movq -0x60(%rbp), %r8
movq -0x88(%rbp), %r9
movq -0xc8(%rbp), %r10
cmpl $0x0, -0x110(%rbp)
jle 0x35ec8
movq -0x198(%rbp), %rax
xorl %ecx, %ecx
movss (%r8,%rcx,4), %xmm0
subss (%r9,%rcx,4), %xmm0
movss %xmm0, (%rax,%rcx,4)
incq %rcx
cmpq %rcx, %r10
jne 0x35eaf
testl %ebx, %ebx
je 0x35f67
cmpl $0x0, -0x6c(%rbp)
je 0x35fe2
xorps %xmm0, %xmm0
cvtss2sd -0x270(%rbp), %xmm0
leaq 0x2555f(%rip), %rdi     # 0x5b44b
movb $0x1, %al
callq 0x20f0
movq -0xb8(%rbp), %rdx
movq 0x20(%rdx), %rsi
testl %r15d, %r15d
jle 0x35fed
movss -0x270(%rbp), %xmm0
addss 0x1b205(%rip), %xmm0    # 0x5111c
cvtss2sd %xmm0, %xmm0
xorl %eax, %eax
movq -0xa8(%rbp), %rdi
movq (%rsi,%rax,8), %rcx
movsd (%rcx,%rax,8), %xmm1
mulsd %xmm0, %xmm1
movsd %xmm1, (%rcx,%rax,8)
incq %rax
cmpq %rax, %rdi
jne 0x35f24
jmp 0x35fed
movss 0x32f71(%rip), %xmm0    # 0x68ebc
ucomiss -0x44(%rbp), %xmm0
seta %al
cmpl $0x0, -0x38(%rbp)
je 0x35fd4
movb %al, -0x50(%rbp)
movq -0x98(%rbp), %r13
jmp 0x363c0
subq $0x30, %rsp
leaq 0x10(%rbp), %rax
movups (%rax), %xmm0
movupd 0x10(%rax), %xmm1
movupd 0x20(%rax), %xmm2
movupd %xmm2, 0x20(%rsp)
movupd %xmm1, 0x10(%rsp)
movups %xmm0, (%rsp)
leaq -0x1a0(%rbp), %rdi
movq -0xb8(%rbp), %rsi
movq 0x60(%rbp), %rdx
movl $0x43, %ecx
leaq -0x270(%rbp), %r8
callq 0x26388
addq $0x30, %rsp
testl %eax, %eax
jns 0x36049
leaq 0x25d2a(%rip), %rdi     # 0x5bcec
callq 0x2090
movl -0x3c(%rbp), %ecx
incl %ecx
incl -0x40(%rbp)
jmp 0x36329
movl %ecx, -0x8c(%rbp)
movl -0x3c(%rbp), %ecx
jmp 0x3634a
movq -0xb8(%rbp), %rdx
movq 0x20(%rdx), %rsi
movq 0x10(%rdx), %rdx
leaq 0x10(%rbp), %rax
movq 0x18(%rax), %rcx
leaq -0x1a0(%rbp), %rdi
movl %r15d, %r8d
movq -0x100(%rbp), %r9
callq 0x36928
testl %eax, %eax
je 0x36042
leaq 0x25cb2(%rip), %rdi     # 0x5bccc
callq 0x2090
incl -0x3c(%rbp)
incl -0x40(%rbp)
xorl %r13d, %r13d
movl $0x0, -0x6c(%rbp)
movl $0x0, -0x38(%rbp)
movq -0x88(%rbp), %rax
jmp 0x3659c
movl $0x0, -0x6c(%rbp)
xorps %xmm0, %xmm0
testl %r15d, %r15d
movq -0x68(%rbp), %rdx
movq -0xa8(%rbp), %rsi
jle 0x360ba
movq -0x188(%rbp), %rax
xorl %ecx, %ecx
xorps %xmm1, %xmm1
cvtss2sd (%rax,%rcx,4), %xmm1
movsd %xmm1, (%r14,%rcx,8)
incq %rcx
cmpq %rcx, %rsi
jne 0x36065
testl %r15d, %r15d
jle 0x360ba
xorps %xmm0, %xmm0
xorl %eax, %eax
movsd (%r14,%rax,8), %xmm1
movapd %xmm1, %xmm2
andpd 0x21259(%rip), %xmm2    # 0x572f0
xorps %xmm3, %xmm3
cvtss2sd %xmm0, %xmm3
ucomisd %xmm3, %xmm2
jbe 0x360b2
xorps %xmm0, %xmm0
cvtsd2ss %xmm1, %xmm0
andps 0x2122e(%rip), %xmm0    # 0x572e0
incq %rax
cmpq %rax, %rsi
jne 0x36085
ucomiss -0xe0(%rbp), %xmm0
jbe 0x36130
movss -0xe0(%rbp), %xmm1
divss %xmm0, %xmm1
movss %xmm1, -0x38(%rbp)
cvtss2sd %xmm0, %xmm0
leaq 0x2516e(%rip), %rdi     # 0x5b24d
movb $0x1, %al
callq 0x20f0
xorps %xmm0, %xmm0
cvtss2sd -0x38(%rbp), %xmm0
movsd %xmm0, -0x38(%rbp)
leaq 0x25173(%rip), %rdi     # 0x5b26d
movb $0x1, %al
callq 0x20f0
movsd -0x38(%rbp), %xmm1
movq -0xa8(%rbp), %rsi
movq -0x68(%rbp), %rdx
testl %r15d, %r15d
jle 0x36130
xorl %eax, %eax
movsd (%r14,%rax,8), %xmm0
mulsd %xmm1, %xmm0
movsd %xmm0, (%r14,%rax,8)
incq %rax
cmpq %rax, %rsi
jne 0x36118
movl $0x3f800000, -0xe8(%rbp) # imm = 0x3F800000
movss 0x1afda(%rip), %xmm1    # 0x5111c
movq -0x118(%rbp), %rcx
testl %r15d, %r15d
jle 0x3616a
xorl %eax, %eax
movsd (%rcx,%rax,8), %xmm0
addsd (%r14,%rax,8), %xmm0
movsd %xmm0, (%r13,%rax,8)
incq %rax
cmpq %rax, %rsi
jne 0x36150
movss %xmm1, -0x38(%rbp)
movq $0x0, 0x28(%r12)
cmpl $0x0, -0x30(%rbp)
jle 0x361cf
xorl %r15d, %r15d
xorl %ebx, %ebx
leaq (%rdx,%r15), %rsi
leaq (%r12,%r15), %rdi
movl $0xc0, %edx
callq 0x21b0
movq -0x68(%rbp), %rdx
testl %ebx, %ebx
je 0x361c1
movq 0x28(%rdx,%r15), %rax
subq %rdx, %rax
shrq $0x6, %rax
imull $0xaaaaaaab, %eax, %eax # imm = 0xAAAAAAAB
cltq
leaq (%rax,%rax,2), %rax
shlq $0x6, %rax
addq %r12, %rax
movq %rax, 0x28(%r12,%r15)
incl %ebx
addq $0xc0, %r15
cmpl %ebx, -0x30(%rbp)
jne 0x36183
movq %r12, %rdi
movq -0x30(%rbp), %rbx
movl %ebx, %esi
movq %r13, %rdx
movl 0x70(%rbp), %r15d
movl %r15d, %ecx
callq 0x15083
subq $0x50, %rsp
leaq 0x40(%rbp), %rax
movups (%rax), %xmm0
movups 0x10(%rax), %xmm1
movups %xmm1, 0x20(%rsp)
movups %xmm0, 0x10(%rsp)
movq -0x60(%rbp), %rax
movq %rax, 0x48(%rsp)
movq -0xd8(%rbp), %rax
movq %rax, 0x40(%rsp)
movq -0x88(%rbp), %rax
movq %rax, 0x38(%rsp)
movq -0x80(%rbp), %rax
movq %rax, 0x30(%rsp)
movl %ebx, 0x8(%rsp)
movq -0xa0(%rbp), %rax
movq %rax, (%rsp)
leaq -0xe8(%rbp), %rdi
leaq -0x44(%rbp), %rsi
leaq -0x78(%rbp), %rdx
movss -0x74(%rbp), %xmm0
movss -0xe4(%rbp), %xmm1
movss -0x38(%rbp), %xmm2
movq -0x58(%rbp), %rbx
movl %ebx, %ecx
movq -0xd0(%rbp), %r8
movq %r12, %r9
callq 0x3526e
addq $0x50, %rsp
testl %eax, %eax
jne 0x3639c
movss -0xe8(%rbp), %xmm1
movss -0x38(%rbp), %xmm3
mulss %xmm1, %xmm3
xorps %xmm0, %xmm0
cvtss2sd %xmm3, %xmm0
movsd 0x206b5(%rip), %xmm2    # 0x56950
ucomisd %xmm0, %xmm2
ja 0x36318
movaps %xmm3, %xmm2
xorps %xmm3, %xmm3
cvtss2sd %xmm1, %xmm3
movsd 0x1f915(%rip), %xmm1    # 0x55bc8
ucomisd %xmm3, %xmm1
ja 0x36318
leaq 0x24ff3(%rip), %rdi     # 0x5b2b3
movsd %xmm3, -0x50(%rbp)
movaps %xmm3, %xmm0
movb $0x1, %al
movss %xmm2, -0x38(%rbp)
callq 0x20f0
movss -0x38(%rbp), %xmm1
testl %r15d, %r15d
movq -0x68(%rbp), %rdx
movq -0xa8(%rbp), %rsi
movq -0x118(%rbp), %rcx
jle 0x36149
xorl %eax, %eax
movsd -0x50(%rbp), %xmm2
movsd (%r14,%rax,8), %xmm0
mulsd %xmm2, %xmm0
movsd %xmm0, (%r14,%rax,8)
incq %rax
cmpq %rax, %rsi
jne 0x362fb
jmp 0x36149
leaq 0x24f6f(%rip), %rdi     # 0x5b28e
movb $0x1, %al
callq 0x20f0
movl -0x3c(%rbp), %ecx
movss 0x32b8b(%rip), %xmm0    # 0x68ebc
ucomiss -0x44(%rbp), %xmm0
seta %al
movq -0x60(%rbp), %r8
movq -0x88(%rbp), %r9
movq -0xc8(%rbp), %r10
movl -0x40(%rbp), %edx
leal 0x1(%rcx), %esi
movl %esi, -0x3c(%rbp)
xorl %r11d, %r11d
cmpl $0x0, -0x8c(%rbp)
sete %sil
setne %r11b
cmpl $0x4, %edx
setl %dil
addl %edx, %r11d
movl %r11d, -0x40(%rbp)
andb %sil, %dil
movl $0x0, -0x38(%rbp)
movzbl %dil, %r13d
movb $0x1, %r14b
testl %ecx, %ecx
jg 0x3649c
testb %al, %al
jne 0x3649c
movq %r9, %rax
jmp 0x365a7
movss 0x32b18(%rip), %xmm0    # 0x68ebc
ucomiss -0x44(%rbp), %xmm0
seta -0x50(%rbp)
movl $0x1, -0x38(%rbp)
movq -0x98(%rbp), %r13
movl -0x8c(%rbp), %ecx
movl %ecx, %r14d
movq $0x0, 0x28(%r13)
cmpl $0x0, -0x30(%rbp)
jle 0x3641e
xorl %r15d, %r15d
xorl %ebx, %ebx
leaq (%r12,%r15), %rsi
leaq (%r15,%r13), %rdi
movl $0xc0, %edx
callq 0x21b0
testl %ebx, %ebx
je 0x36410
movq 0x28(%r12,%r15), %rax
subq %r12, %rax
shrq $0x6, %rax
imull $0xaaaaaaab, %eax, %eax # imm = 0xAAAAAAAB
cltq
leaq (%rax,%rax,2), %rax
shlq $0x6, %rax
addq %r13, %rax
movq %rax, 0x28(%r13,%r15)
incl %ebx
addq $0xc0, %r15
cmpl %ebx, -0x30(%rbp)
jne 0x363d6
movq -0x128(%rbp), %rbx
movq %rbx, %rdi
movl 0x70(%rbp), %r15d
movl %r15d, %esi
movq %r13, %rdx
movq -0x30(%rbp), %rcx
callq 0x16806
testl %r15d, %r15d
movq -0xa8(%rbp), %rcx
movq -0x130(%rbp), %rdx
movq -0x118(%rbp), %rsi
jle 0x3646e
xorl %eax, %eax
movsd (%rbx,%rax,8), %xmm0
subsd (%rdx,%rax,8), %xmm0
movsd %xmm0, (%rsi,%rax,8)
incq %rax
cmpq %rax, %rcx
jne 0x36457
movl $0x1, %r13d
movl $0x0, -0x3c(%rbp)
testl %r14d, %r14d
movq -0x58(%rbp), %rbx
je 0x3648d
movl $0x0, -0x40(%rbp)
jmp 0x36498
xorl %r13d, %r13d
cmpl $0x4, -0x40(%rbp)
setl %r13b
movb -0x50(%rbp), %r14b
cmpq $0x0, -0xc0(%rbp)
je 0x3657e
movq -0x108(%rbp), %rdi
movq -0x80(%rbp), %rsi
movq -0x158(%rbp), %rdx
movq -0x110(%rbp), %rbx
movl %ebx, %ecx
callq 0x4dfa0
cvtsd2ss %xmm0, %xmm0
leaq 0xa8(%rbp), %rax
ucomiss 0x1c(%rax), %xmm0
seta %al
orb %r14b, %al
testb $0x1, %al
je 0x3657a
movb %r14b, -0x50(%rbp)
testl %ebx, %ebx
movq -0x80(%rbp), %rcx
movq -0x108(%rbp), %rdx
movq -0xc8(%rbp), %rsi
jle 0x36515
xorl %eax, %eax
movss (%rcx,%rax,4), %xmm0
movss %xmm0, (%rdx,%rax,4)
incq %rax
cmpq %rax, %rsi
jne 0x36503
movl -0xdc(%rbp), %r15d
incl %r15d
movq -0xf8(%rbp), %rdi
movq -0xa0(%rbp), %r14
movq %r14, %rsi
movq -0x150(%rbp), %rdx
movq -0x30(%rbp), %rbx
movl %ebx, %ecx
callq 0x4dfa0
cvtsd2ss %xmm0, %xmm0
movq -0xc0(%rbp), %rdi
movq -0xb0(%rbp), %rsi
movl %ebx, %edx
movq %r14, %rcx
movq 0x78(%rbp), %r8
movl %r15d, -0xdc(%rbp)
movl %r15d, %r9d
callq 0x3285f
movq -0x58(%rbp), %rbx
movl 0x70(%rbp), %r15d
movb -0x50(%rbp), %r14b
jmp 0x3657e
movq -0x58(%rbp), %rbx
movl $0xa, %edi
callq 0x2060
testb %r14b, %r14b
jne 0x365d3
movq -0x80(%rbp), %rax
movq -0x88(%rbp), %rcx
movq %rcx, -0x80(%rbp)
movq -0x60(%rbp), %r8
movq -0xc8(%rbp), %r10
movq -0xf0(%rbp), %rsp
incl %ebx
movq %rax, %r9
movl %r13d, %ecx
cmpl -0x70(%rbp), %ebx
jne 0x35dac
movl -0x70(%rbp), %eax
movl %eax, %r14d
movq -0x98(%rbp), %r13
jmp 0x365f8
xorl %r14d, %r14d
jmp 0x365f8
leaq 0x24e93(%rip), %rdi     # 0x5b46d
movl -0x3c(%rbp), %esi
movl -0x40(%rbp), %edx
xorl %eax, %eax
callq 0x20f0
movq -0xf0(%rbp), %rsp
movq -0x98(%rbp), %r13
movq %rbx, %r14
leaq 0x24cf7(%rip), %rdi     # 0x5b2f6
movl $0xe, %esi
movl $0x1, %edx
movq -0xd0(%rbp), %r12
movq %r12, %rcx
callq 0x2290
subq $0x50, %rsp
leaq 0x40(%rbp), %rax
movups (%rax), %xmm0
movups 0x10(%rax), %xmm1
movups %xmm1, 0x20(%rsp)
movups %xmm0, 0x10(%rsp)
movq -0x60(%rbp), %rax
movq %rax, 0x48(%rsp)
movq -0xd8(%rbp), %rax
movq %rax, 0x40(%rsp)
movq %rax, 0x38(%rsp)
movq -0x80(%rbp), %rax
movq %rax, 0x30(%rsp)
movq -0x30(%rbp), %rbx
movl %ebx, 0x8(%rsp)
movq -0xa0(%rbp), %rax
movq %rax, (%rsp)
leaq -0x11c(%rbp), %rdi
leaq -0x44(%rbp), %rsi
leaq -0x78(%rbp), %rdx
movss 0x1aaa2(%rip), %xmm1    # 0x51120
movss 0x1aa96(%rip), %xmm2    # 0x5111c
movss -0x74(%rbp), %xmm0
movq %r14, -0x58(%rbp)
movl %r14d, %ecx
movq %r12, %r8
movq %r13, %r9
callq 0x3526e
addq $0x50, %rsp
leaq -0x78(%rbp), %rax
xorps %xmm0, %xmm0
cvtss2sd (%rax), %xmm0
leaq 0x24c52(%rip), %rdi     # 0x5b305
movb $0x1, %al
callq 0x20f0
leaq 0x2564c(%rip), %rdi     # 0x5bd0d
callq 0x2090
movq -0x128(%rbp), %r14
movq %r14, %rdi
movl %r15d, %esi
movq %r13, %rdx
movl %ebx, %ecx
callq 0x16806
testl %r15d, %r15d
movq -0x138(%rbp), %r12
movq -0xa8(%rbp), %rcx
movq -0x130(%rbp), %rdx
jle 0x36712
xorl %eax, %eax
movsd (%r14,%rax,8), %xmm0
subsd (%rdx,%rax,8), %xmm0
movsd %xmm0, (%r12,%rax,8)
incq %rax
cmpq %rax, %rcx
jne 0x366f9
movq %r12, %rdi
movq 0x68(%rbp), %rsi
movl %r15d, %edx
callq 0x2eddc
movq $0x0, 0x28(%r13)
cmpl $0x0, -0x30(%rbp)
movq -0x68(%rbp), %rcx
jle 0x36787
xorl %ebx, %ebx
xorl %r14d, %r14d
leaq (%rcx,%rbx), %rsi
leaq (%rbx,%r13), %rdi
movl $0xc0, %edx
callq 0x21b0
movq -0x68(%rbp), %rcx
testl %r14d, %r14d
je 0x36777
movq 0x28(%rcx,%rbx), %rax
subq %rcx, %rax
shrq $0x6, %rax
imull $0xaaaaaaab, %eax, %eax # imm = 0xAAAAAAAB
cltq
leaq (%rax,%rax,2), %rax
shlq $0x6, %rax
addq %r13, %rax
movq %rax, 0x28(%r13,%rbx)
incl %r14d
addq $0xc0, %rbx
cmpl %r14d, -0x30(%rbp)
jne 0x36738
movq %r13, %rdi
movq -0x30(%rbp), %rbx
movl %ebx, %esi
movq %r12, %rdx
movl %r15d, %ecx
callq 0x15083
leaq 0x24b75(%rip), %rdi     # 0x5b317
movl $0x16, %esi
movl $0x1, %edx
movq -0xd0(%rbp), %r12
movq %r12, %rcx
callq 0x2290
subq $0x50, %rsp
leaq 0x40(%rbp), %rax
movups (%rax), %xmm0
movups 0x10(%rax), %xmm1
movups %xmm1, 0x20(%rsp)
movups %xmm0, 0x10(%rsp)
movq -0x60(%rbp), %rax
movq %rax, 0x48(%rsp)
movq -0xd8(%rbp), %rax
movq %rax, 0x40(%rsp)
movq %rax, 0x38(%rsp)
movq -0x80(%rbp), %rax
movq %rax, 0x30(%rsp)
movl %ebx, 0x8(%rsp)
movq -0xa0(%rbp), %rax
movq %rax, (%rsp)
leaq -0x11c(%rbp), %rdi
leaq -0x44(%rbp), %rsi
leaq -0x78(%rbp), %r14
movss 0x1a903(%rip), %xmm1    # 0x51120
movss 0x1a8f7(%rip), %xmm2    # 0x5111c
movq %r14, %rdx
movss -0x74(%rbp), %xmm0
movq -0x58(%rbp), %rcx
movq %r12, %r8
movq %r13, %r9
callq 0x3526e
addq $0x50, %rsp
xorps %xmm0, %xmm0
cvtss2sd (%r14), %xmm0
leaq 0x24c4b(%rip), %rdi     # 0x5b49a
movb $0x1, %al
callq 0x20f0
movq %r12, %rdi
callq 0x20c0
movq -0xc0(%rbp), %rdi
testq %rdi, %rdi
je 0x3686f
callq 0x20c0
subq $0x40, %rsp
movups -0x1a0(%rbp), %xmm0
movups -0x190(%rbp), %xmm1
movups -0x180(%rbp), %xmm2
movups -0x170(%rbp), %xmm3
movups %xmm3, 0x30(%rsp)
movups %xmm2, 0x20(%rsp)
movups %xmm1, 0x10(%rsp)
movups %xmm0, (%rsp)
callq 0x10fed
addq $0x10, %rsp
leaq 0x10(%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 -0xb8(%rbp), %rdi
movq 0x68(%rbp), %rsi
movl %r15d, %edx
movq -0xb0(%rbp), %rcx
movq -0x30(%rbp), %r8
xorl %r9d, %r9d
callq 0x20900
leaq -0x28(%rbp), %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq