// File: /workspace/github_c_makefile_star2_O1/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 $0x328, %rsp            # imm = 0x328
movl %r9d, %ebx
movq %r8, %r12
movsd %xmm0, -0xb8(%rbp)
movq %rcx, -0xc0(%rbp)
movq %rdx, %r14
movq %rsi, -0x40(%rbp)
movq %rdi, -0x138(%rbp)
movl 0xb8(%rbp), %eax
movl %eax, -0x78(%rbp)
movss 0xac(%rbp), %xmm0
movss %xmm0, -0xd4(%rbp)
movss 0xb0(%rbp), %xmm0
movss %xmm0, -0x7c(%rbp)
movss 0xb4(%rbp), %xmm0
movss %xmm0, -0xcc(%rbp)
leaq 0x26355(%rip), %rdi     # 0x5bca4
callq 0x2090
movq %r14, %rdi
movl %ebx, %esi
movq %r12, %rdx
callq 0x1512b
movq %r14, %rcx
movl %ebx, %eax
movq %rsp, %r13
movq %rax, -0xc8(%rbp)
shlq $0x6, %rax
leaq (%rax,%rax,2), %rax
subq %rax, %r13
movq %r13, %rsp
movq %rsp, %r14
subq %rax, %r14
movq %r14, %rsp
movq $0x0, 0x28(%r13)
movq %rbx, -0x30(%rbp)
testl %ebx, %ebx
movq %rcx, -0x60(%rbp)
jle 0x359ef
xorl %ebx, %ebx
xorl %r15d, %r15d
leaq (%rcx,%rbx), %rsi
leaq (%rbx,%r13), %rdi
movl $0xc0, %edx
callq 0x21a0
movq -0x60(%rbp), %rcx
testl %r15d, %r15d
je 0x359df
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 %r15d
addq $0xc0, %rbx
cmpl %r15d, -0x30(%rbp)
jne 0x359a0
leaq 0x262db(%rip), %rdi     # 0x5bcd1
callq 0x2090
movl 0x70(%rbp), %ebx
movl %ebx, %eax
movq %rax, -0x70(%rbp)
movl %ebx, %esi
movq %rsp, %rdi
leaq 0xf(,%rax,8), %r15
andq $-0x10, %r15
subq %r15, %rdi
movq %rdi, %rsp
movq %rsp, %rax
subq %r15, %rax
movq %rax, -0xf0(%rbp)
movq %rax, %rsp
movq %rdi, -0x140(%rbp)
movq -0x60(%rbp), %rdx
movq -0x30(%rbp), %rcx
callq 0x16e07
movq %rsp, %rbx
movq %r15, -0x170(%rbp)
subq %r15, %rbx
movq -0x70(%rbp), %rax
movq %rbx, %rsp
cmpl $0x0, 0x70(%rbp)
jle 0x35a6b
leaq (,%rax,8), %rdx
movq %rbx, %rdi
xorl %esi, %esi
callq 0x2110
movq %rbx, -0x128(%rbp)
leaq 0x40(%rbp), %rax
movslq 0x18(%rax), %r15
leal (%r15,%r15,2), %eax
movq %rax, -0xe8(%rbp)
leaq 0xf(,%rax,4), %rax
andq $-0x10, %rax
movq %rsp, %rcx
subq %rax, %rcx
movq %rcx, -0xa8(%rbp)
movq %rcx, %rsp
movq %rsp, %r10
subq %rax, %r10
movq %r10, %rsp
testq %r15, %r15
jle 0x35aee
leaq 0x40(%rbp), %rcx
movq (%rcx), %rcx
xorl %edx, %edx
movq -0xa8(%rbp), %rsi
movslq (%rcx,%rdx,4), %rdi
imulq $0x70, %rdi, %r8
addq %r12, %r8
xorl %edi, %edi
xorps %xmm0, %xmm0
cvtsd2ss (%r8,%rdi,2), %xmm0
movss %xmm0, (%rsi,%rdi)
addq $0x4, %rdi
cmpl $0xc, %edi
jne 0x35acc
incq %rdx
addq %rdi, %rsi
cmpq %r15, %rdx
jne 0x35abf
testl %r15d, %r15d
jle 0x35b39
movq 0x98(%rbp), %rcx
leaq 0x40(%rbp), %rdx
movq 0x8(%rdx), %rdx
xorl %esi, %esi
movq %r10, %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 0x35b15
incq %rsi
addq %r8, %rdi
cmpq %r15, %rsi
jne 0x35b07
movq %r10, -0x50(%rbp)
movq %r13, -0x100(%rbp)
movq %r12, -0xe0(%rbp)
movq %rsp, %r13
subq %rax, %r13
movq %r13, %rsp
movq %rsp, %r12
subq %rax, %r12
movq %r12, %rsp
movq %rsp, %rbx
subq %rax, %rbx
movq %rbx, %rsp
testl %r15d, %r15d
movq %r15, -0x118(%rbp)
movq -0xe8(%rbp), %rdx
movq %r13, -0x90(%rbp)
jle 0x35bd4
cmpl $0x2, %edx
movl $0x1, %r13d
cmovgel %edx, %r13d
shlq $0x2, %r13
movq -0x90(%rbp), %rdi
movq -0xa8(%rbp), %r15
movq %r15, %rsi
movq %r13, %rdx
callq 0x21a0
movq %r12, %rdi
movq %r15, %rsi
movq %r13, %rdx
callq 0x21a0
movq %rbx, %rdi
movq %r15, %rsi
movq -0x118(%rbp), %r15
movq %r13, %rdx
callq 0x21a0
movq -0xe8(%rbp), %rdx
movq %r12, -0x58(%rbp)
movq %rbx, -0x148(%rbp)
leaq -0x1b0(%rbp), %rdi
movl 0x70(%rbp), %ecx
movl %ecx, %esi
callq 0x11454
movq -0x30(%rbp), %rcx
leal (%rcx,%rcx,2), %eax
leaq 0xf(,%rax,4), %r12
andq $-0x10, %r12
movq %rsp, %rax
subq %r12, %rax
movq %rax, -0xb0(%rbp)
movq %rax, %rsp
testl %ecx, %ecx
movq -0x60(%rbp), %rdi
movq -0x40(%rbp), %rbx
jle 0x35c69
leaq 0x8(%rdi), %rax
xorl %ecx, %ecx
movq -0xb0(%rbp), %rdx
leaq (%rcx,%rcx,2), %rsi
shlq $0x6, %rsi
cmpl $0x0, 0x20(%rdi,%rsi)
js 0x35c69
xorl %esi, %esi
xorps %xmm0, %xmm0
cvtsd2ss (%rax,%rsi,2), %xmm0
movss %xmm0, (%rdx,%rsi)
addq $0x4, %rsi
cmpq $0xc, %rsi
jne 0x35c3d
incq %rcx
addq $0xc0, %rax
addq %rsi, %rdx
cmpq -0xc8(%rbp), %rcx
jne 0x35c2c
leaq 0x10(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x168(%rbp)
movq -0xb0(%rbp), %rdi
movq -0x30(%rbp), %rsi
callq 0x32b71
movss %xmm0, -0x48(%rbp)
leaq 0x254b1(%rip), %rsi     # 0x5b145
leaq -0x350(%rbp), %r13
movq %r13, %rdi
movq 0x60(%rbp), %rdx
movq %rbx, %rcx
xorl %eax, %eax
callq 0x2260
leaq 0x2158d(%rip), %rsi     # 0x57240
movq %r13, %rdi
callq 0x2210
movq %rax, %rbx
leaq 0x2548f(%rip), %rdi     # 0x5b154
movq %r13, %rsi
xorl %eax, %eax
callq 0x20f0
leaq 0x25738(%rip), %rdi     # 0x5b40e
movl $0x39, %esi
movl $0x1, %edx
movq %rbx, %rcx
callq 0x2280
xorps %xmm0, %xmm0
cvtss2sd -0xd4(%rbp), %xmm0
cvtss2sd -0x7c(%rbp), %xmm1
leaq 0x25749(%rip), %rsi     # 0x5b448
movq %rbx, %rdi
movl -0x78(%rbp), %edx
movb $0x2, %al
callq 0x2190
xorps %xmm0, %xmm0
cvtss2sd -0x48(%rbp), %xmm0
movsd %xmm0, -0x68(%rbp)
leaq 0x254a6(%rip), %rsi     # 0x5b1c6
movq %rbx, %rdi
movb $0x1, %al
callq 0x2190
leaq 0x40(%rbp), %rax
movq 0x10(%rax), %rdx
movq -0xa8(%rbp), %rdi
movq -0x50(%rbp), %rsi
movl %r15d, %ecx
callq 0x4e010
cvtsd2ss %xmm0, %xmm0
movss %xmm0, -0x9c(%rbp)
movss %xmm0, -0x80(%rbp)
cvtss2sd %xmm0, %xmm0
movsd %xmm0, -0x48(%rbp)
leaq 0x25476(%rip), %rdi     # 0x5b1dc
movb $0x1, %al
callq 0x20f0
leaq 0x25701(%rip), %rsi     # 0x5b475
movq %rbx, %rdi
movsd -0x48(%rbp), %xmm0
movsd -0xb8(%rbp), %xmm1
movb $0x2, %al
callq 0x2190
leaq 0x2546d(%rip), %rdi     # 0x5b1ff
movl $0x32, %esi
movl $0x1, %edx
movq %rbx, %rcx
callq 0x2280
leaq 0x25487(%rip), %rsi     # 0x5b232
xorps %xmm0, %xmm0
xorpd %xmm2, %xmm2
xorps %xmm4, %xmm4
movq %rbx, -0x120(%rbp)
movq %rbx, %rdi
movsd -0x48(%rbp), %xmm1
movsd -0x68(%rbp), %xmm3
movl $0x1, %edx
movb $0x5, %al
callq 0x2190
movq %rsp, %rax
subq %r12, %rax
movq %rax, -0x108(%rbp)
movq %rax, %rsp
movq %rsp, %r15
movq -0xc8(%rbp), %r12
leaq 0xf(,%r12,4), %rax
andq $-0x10, %rax
subq %rax, %r15
movq %r15, %rsp
cmpl $0x0, -0x30(%rbp)
jle 0x35e2a
xorl %ebx, %ebx
movq -0xe0(%rbp), %r13
movq %r13, %rdi
callq 0x25e79
movss %xmm0, (%r15,%rbx,4)
incq %rbx
addq $0x70, %r13
cmpq %rbx, %r12
jne 0x35e10
movq %r15, -0x160(%rbp)
leaq 0x25417(%rip), %rsi     # 0x5b24f
movq -0x40(%rbp), %rbx
movq %rbx, %rdi
callq 0x2180
movq $0x0, -0x48(%rbp)
testl %eax, %eax
je 0x35f3b
movl 0x90(%rbp), %r12d
leaq 0x253f6(%rip), %rsi     # 0x5b258
leaq -0x280(%rbp), %r13
movq %r13, %rdi
movq 0x60(%rbp), %rdx
movq %rbx, %rcx
xorl %eax, %eax
callq 0x2260
leaq 0x213bf(%rip), %rsi     # 0x57240
movq %r13, %rdi
callq 0x2210
movq %rax, %r15
leaq 0x253da(%rip), %rdi     # 0x5b26d
movq %r13, %rsi
xorl %eax, %eax
callq 0x20f0
movq %r15, %rdi
movq 0x88(%rbp), %rsi
movl %r12d, %edx
callq 0x3301f
cmpl $0x0, -0x30(%rbp)
movq -0x100(%rbp), %r12
movq -0x60(%rbp), %rdi
movq -0x70(%rbp), %rbx
movq -0xf0(%rbp), %r13
jle 0x35f15
leaq 0x8(%rdi), %rax
xorl %ecx, %ecx
movq -0x108(%rbp), %rdx
leaq (%rcx,%rcx,2), %rsi
shlq $0x6, %rsi
cmpl $0x0, 0x20(%rdi,%rsi)
js 0x35f15
xorl %esi, %esi
xorps %xmm0, %xmm0
cvtsd2ss (%rax,%rsi,2), %xmm0
movss %xmm0, (%rdx,%rsi)
addq $0x4, %rsi
cmpq $0xc, %rsi
jne 0x35ee9
incq %rcx
addq $0xc0, %rax
addq %rsi, %rdx
cmpq -0xc8(%rbp), %rcx
jne 0x35ed8
xorps %xmm0, %xmm0
movq %r15, %rdi
movq -0xe0(%rbp), %rsi
movq -0x30(%rbp), %rdx
movq -0x108(%rbp), %rcx
movq 0x78(%rbp), %r8
xorl %r9d, %r9d
callq 0x32c92
jmp 0x35f50
xorl %r15d, %r15d
movq -0x100(%rbp), %r12
movq -0x70(%rbp), %rbx
movq -0xf0(%rbp), %r13
movl $0x0, -0x280(%rbp)
cmpl $0x0, -0x78(%rbp)
movq -0x50(%rbp), %rdx
movq -0x58(%rbp), %rsi
movq %r15, -0x110(%rbp)
jle 0x36834
movq -0xe8(%rbp), %rax
cmpl $0x2, %eax
movl $0x1, %edi
cmovgel %eax, %edi
movl $0x1, %r8d
leaq 0x8(%r12), %rax
movq %rax, -0x150(%rbp)
imulq $0x70, -0xc8(%rbp), %rax
movq %rax, -0x158(%rbp)
movq $0x0, -0x48(%rbp)
movl $0x1, -0x74(%rbp)
movl $0x1, -0x68(%rbp)
movl $0x0, -0x34(%rbp)
movl $0x0, -0xd0(%rbp)
xorl %r9d, %r9d
movl 0x70(%rbp), %r15d
movq %rdi, -0x88(%rbp)
movq %rsp, -0xf8(%rbp)
movq %rsp, %r12
movq -0x170(%rbp), %rax
subq %rax, %r12
movq %r12, %rsp
movq %rsp, %r13
subq %rax, %r13
movq %r13, %rsp
cmpl $0x1, -0x68(%rbp)
movq %rsi, -0x58(%rbp)
jne 0x3654d
cmpl $0x0, -0x48(%rbp)
movq %r9, -0x98(%rbp)
jne 0x360ce
leaq 0x25cda(%rip), %rdi     # 0x5bcfb
callq 0x2090
movq %rsp, -0x40(%rbp)
movq %rsp, %rcx
imulq $0x70, -0xc8(%rbp), %rax
subq %rax, %rcx
movq %rcx, %rsp
cmpl $0x0, -0x30(%rbp)
movq -0x158(%rbp), %rdi
jle 0x36071
xorl %eax, %eax
movq -0x150(%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 0x36051
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 -0xc0(%rbp), %rdi
movq 0x68(%rbp), %rsi
movl %r15d, %edx
movq -0x30(%rbp), %r8
xorl %r9d, %r9d
callq 0x20fb0
addq $0x30, %rsp
movl $0x1, -0x74(%rbp)
movq -0x40(%rbp), %rsp
movq -0x50(%rbp), %rdx
movq -0x58(%rbp), %rsi
movq -0x88(%rbp), %rdi
cmpl $0x0, -0x118(%rbp)
jle 0x360f7
movq -0x1a8(%rbp), %rax
xorl %ecx, %ecx
movss (%rdx,%rcx,4), %xmm0
subss (%rsi,%rcx,4), %xmm0
movss %xmm0, (%rax,%rcx,4)
incq %rcx
cmpq %rcx, %rdi
jne 0x360e0
cmpl $0x0, -0x48(%rbp)
je 0x361d5
cmpl $0x0, -0x74(%rbp)
je 0x36160
xorps %xmm0, %xmm0
cvtss2sd -0x280(%rbp), %xmm0
leaq 0x2537a(%rip), %rdi     # 0x5b493
movb $0x1, %al
callq 0x20f0
testl %r15d, %r15d
jle 0x36160
movss -0x280(%rbp), %xmm0
addss 0x1aedb(%rip), %xmm0    # 0x51010
cvtss2sd %xmm0, %xmm0
movq -0xc0(%rbp), %rax
movq 0x20(%rax), %rax
xorl %ecx, %ecx
movq (%rax,%rcx,8), %rdx
movsd (%rdx,%rcx,8), %xmm1
mulsd %xmm0, %xmm1
movsd %xmm1, (%rdx,%rcx,8)
incq %rcx
cmpq %rcx, %rbx
jne 0x36146
movq -0xc0(%rbp), %rax
movq 0x10(%rax), %rdx
movq 0x20(%rax), %rsi
leaq 0x10(%rbp), %rax
movq 0x18(%rax), %rcx
leaq -0x1b0(%rbp), %rdi
movl %r15d, %r8d
movq -0xe8(%rbp), %r9
callq 0x36b6c
testl %eax, %eax
je 0x36255
leaq 0x25b78(%rip), %rdi     # 0x5bd14
callq 0x2090
movq -0x98(%rbp), %r9
incl %r9d
incl -0x34(%rbp)
movl $0x0, -0x68(%rbp)
movl $0x0, -0x74(%rbp)
xorl %r8d, %r8d
xorl %eax, %eax
movq -0x58(%rbp), %rcx
movq -0x50(%rbp), %rdx
movq -0x88(%rbp), %rdi
jmp 0x36685
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 -0x1b0(%rbp), %rdi
movq -0xc0(%rbp), %rsi
movq 0x60(%rbp), %rdx
movl $0x43, %ecx
leaq -0x280(%rbp), %r8
callq 0x26810
addq $0x30, %rsp
testl %eax, %eax
jns 0x3625c
leaq 0x25b08(%rip), %rdi     # 0x5bd34
callq 0x2090
movq -0x98(%rbp), %r9
incl %r9d
incl -0x34(%rbp)
xorl %r8d, %r8d
movq -0x50(%rbp), %rdx
movq -0x58(%rbp), %rsi
movq -0x88(%rbp), %rdi
jmp 0x3654d
movl $0x0, -0x74(%rbp)
testl %r15d, %r15d
movq -0x60(%rbp), %rdx
jle 0x36284
movq -0x198(%rbp), %rax
xorl %ecx, %ecx
xorps %xmm0, %xmm0
cvtss2sd (%rax,%rcx,4), %xmm0
movsd %xmm0, (%r12,%rcx,8)
incq %rcx
cmpq %rcx, %rbx
jne 0x3626e
xorps %xmm0, %xmm0
testl %r15d, %r15d
jle 0x362c3
xorl %eax, %eax
movsd (%r12,%rax,8), %xmm1
movapd %xmm1, %xmm2
andpd 0x21090(%rip), %xmm2    # 0x57330
xorps %xmm3, %xmm3
cvtss2sd %xmm0, %xmm3
ucomisd %xmm3, %xmm2
jbe 0x362bb
xorps %xmm0, %xmm0
cvtsd2ss %xmm1, %xmm0
andps 0x21065(%rip), %xmm0    # 0x57320
incq %rax
cmpq %rax, %rbx
jne 0x3628e
ucomiss -0xcc(%rbp), %xmm0
jbe 0x36332
movss -0xcc(%rbp), %xmm1
divss %xmm0, %xmm1
movss %xmm1, -0x40(%rbp)
cvtss2sd %xmm0, %xmm0
leaq 0x24fad(%rip), %rdi     # 0x5b295
movb $0x1, %al
callq 0x20f0
xorps %xmm0, %xmm0
cvtss2sd -0x40(%rbp), %xmm0
movsd %xmm0, -0x40(%rbp)
leaq 0x24fb2(%rip), %rdi     # 0x5b2b5
movb $0x1, %al
callq 0x20f0
movsd -0x40(%rbp), %xmm1
movq -0x60(%rbp), %rdx
testl %r15d, %r15d
jle 0x36332
xorl %eax, %eax
movsd (%r12,%rax,8), %xmm0
mulsd %xmm1, %xmm0
movsd %xmm0, (%r12,%rax,8)
incq %rax
cmpq %rax, %rbx
jne 0x3631a
movl $0x3f800000, -0xd8(%rbp) # imm = 0x3F800000
movss 0x1accc(%rip), %xmm1    # 0x51010
movq -0x128(%rbp), %rcx
testl %r15d, %r15d
jle 0x3636c
xorl %eax, %eax
movsd (%rcx,%rax,8), %xmm0
addsd (%r12,%rax,8), %xmm0
movsd %xmm0, (%r13,%rax,8)
incq %rax
cmpq %rax, %rbx
jne 0x36352
movss %xmm1, -0x40(%rbp)
movq $0x0, 0x28(%r14)
cmpl $0x0, -0x30(%rbp)
jle 0x363d0
xorl %r15d, %r15d
xorl %ebx, %ebx
leaq (%rdx,%r15), %rsi
leaq (%r14,%r15), %rdi
movl $0xc0, %edx
callq 0x21a0
movq -0x60(%rbp), %rdx
testl %ebx, %ebx
je 0x363c2
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 %r14, %rax
movq %rax, 0x28(%r14,%r15)
incl %ebx
addq $0xc0, %r15
cmpl %ebx, -0x30(%rbp)
jne 0x36384
movq %r14, %rdi
movq -0x30(%rbp), %rbx
movl %ebx, %esi
movq %r13, %rdx
movl 0x70(%rbp), %r15d
movl %r15d, %ecx
callq 0x154bb
subq $0x50, %rsp
leaq 0x40(%rbp), %rax
movups (%rax), %xmm0
movups 0x10(%rax), %xmm1
movups %xmm1, 0x20(%rsp)
movups %xmm0, 0x10(%rsp)
movq -0x50(%rbp), %rax
movq %rax, 0x48(%rsp)
movq -0xa8(%rbp), %rax
movq %rax, 0x40(%rsp)
movq -0x58(%rbp), %rax
movq %rax, 0x38(%rsp)
movq -0x90(%rbp), %rax
movq %rax, 0x30(%rsp)
movl %ebx, 0x8(%rsp)
movq -0xb0(%rbp), %rax
movq %rax, (%rsp)
leaq -0xd8(%rbp), %rdi
leaq -0x80(%rbp), %rsi
leaq -0x9c(%rbp), %rdx
movss -0x7c(%rbp), %xmm0
movss -0xd4(%rbp), %xmm1
movss -0x40(%rbp), %xmm2
movq -0x48(%rbp), %rcx
movq -0x120(%rbp), %r8
movq %r14, %r9
callq 0x3551f
addq $0x50, %rsp
testl %eax, %eax
jne 0x36530
movss -0xd8(%rbp), %xmm1
movss -0x40(%rbp), %xmm3
mulss %xmm1, %xmm3
xorps %xmm0, %xmm0
cvtss2sd %xmm3, %xmm0
movsd 0x204c3(%rip), %xmm2    # 0x56960
ucomisd %xmm0, %xmm2
ja 0x3651d
movaps %xmm3, %xmm2
xorps %xmm3, %xmm3
cvtss2sd %xmm1, %xmm3
movsd 0x1f6cb(%rip), %xmm1    # 0x55b80
ucomisd %xmm3, %xmm1
ja 0x3651d
leaq 0x24e39(%rip), %rdi     # 0x5b2fb
movsd %xmm3, -0xb8(%rbp)
movaps %xmm3, %xmm0
movb $0x1, %al
movss %xmm2, -0x40(%rbp)
callq 0x20f0
movss -0x40(%rbp), %xmm1
testl %r15d, %r15d
movq -0x60(%rbp), %rdx
movq -0x70(%rbp), %rbx
movq -0x128(%rbp), %rcx
jle 0x3634b
xorl %eax, %eax
movsd -0xb8(%rbp), %xmm2
movsd (%r12,%rax,8), %xmm0
mulsd %xmm2, %xmm0
movsd %xmm0, (%r12,%rax,8)
incq %rax
cmpq %rax, %rbx
jne 0x36500
jmp 0x3634b
leaq 0x24db2(%rip), %rdi     # 0x5b2d6
movb $0x1, %al
callq 0x20f0
xorl %r8d, %r8d
jmp 0x36533
movl %eax, %r8d
movq -0x50(%rbp), %rdx
movq -0x70(%rbp), %rbx
movq -0x58(%rbp), %rsi
movq -0x88(%rbp), %rdi
movq -0x98(%rbp), %r9
movss -0x80(%rbp), %xmm0
movss 0x32962(%rip), %xmm1    # 0x68ebc
ucomiss %xmm0, %xmm1
seta %r12b
movl %r8d, -0xb8(%rbp)
testl %r8d, %r8d
movq -0x100(%rbp), %r13
je 0x3663b
movq $0x0, 0x28(%r13)
cmpl $0x0, -0x30(%rbp)
jle 0x365d3
xorl %r15d, %r15d
xorl %ebx, %ebx
leaq (%r14,%r15), %rsi
leaq (%r15,%r13), %rdi
movl $0xc0, %edx
callq 0x21a0
testl %ebx, %ebx
je 0x365c5
movq 0x28(%r14,%r15), %rax
subq %r14, %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 0x3658b
movq -0xf0(%rbp), %rdi
movl 0x70(%rbp), %r15d
movl %r15d, %esi
movq %r13, %rdx
movq %rdi, %r13
movq -0x30(%rbp), %rcx
callq 0x16e07
testl %r15d, %r15d
movq -0x70(%rbp), %rbx
movq -0x140(%rbp), %rcx
movq -0x128(%rbp), %rdx
jle 0x36622
xorl %eax, %eax
movsd (%r13,%rax,8), %xmm0
subsd (%rcx,%rax,8), %xmm0
movsd %xmm0, (%rdx,%rax,8)
incq %rax
cmpq %rax, %rbx
jne 0x36609
xorl %r13d, %r13d
cmpl $0x0, -0x68(%rbp)
je 0x36691
movl $0x0, -0x40(%rbp)
movl $0x1, -0x68(%rbp)
jmp 0x366a8
leal 0x1(%r9), %r13d
xorl %r10d, %r10d
cmpl $0x0, -0x68(%rbp)
sete %al
setne %r10b
movl -0x34(%rbp), %r8d
cmpl $0x4, %r8d
setl %cl
addl %r8d, %r10d
movl %r10d, -0x40(%rbp)
andb %al, %cl
movzbl %cl, %eax
movl %eax, -0x68(%rbp)
movb $0x1, %r12b
testl %r9d, %r9d
jg 0x366a8
xorl %eax, %eax
ucomiss %xmm0, %xmm1
ja 0x366a8
movl %r13d, %r9d
movl -0x40(%rbp), %ecx
movl %ecx, -0x34(%rbp)
xorl %r8d, %r8d
movq %rsi, %rcx
movq -0xf8(%rbp), %rsi
jmp 0x36802
xorl %eax, %eax
movl -0x34(%rbp), %r13d
cmpl $0x4, %r13d
setl %al
movl %eax, -0x68(%rbp)
movl %r13d, -0x40(%rbp)
xorl %r13d, %r13d
cmpq $0x0, -0x110(%rbp)
je 0x36796
movl %r13d, -0x98(%rbp)
movq -0x148(%rbp), %rdi
movq -0x90(%rbp), %rsi
movq -0x168(%rbp), %rdx
movq -0x118(%rbp), %r13
movl %r13d, %ecx
callq 0x4e010
cvtsd2ss %xmm0, %xmm0
leaq 0xa8(%rbp), %rax
ucomiss 0x1c(%rax), %xmm0
seta %al
movb %r12b, -0x34(%rbp)
orb %r12b, %al
testb $0x1, %al
je 0x3678b
testl %r13d, %r13d
movq -0x90(%rbp), %rcx
movq -0x148(%rbp), %rdx
movq -0x88(%rbp), %rsi
jle 0x36730
xorl %eax, %eax
movss (%rcx,%rax,4), %xmm0
movss %xmm0, (%rdx,%rax,4)
incq %rax
cmpq %rax, %rsi
jne 0x3671e
movl -0xd0(%rbp), %r12d
incl %r12d
movq -0x108(%rbp), %rdi
movq -0xb0(%rbp), %r13
movq %r13, %rsi
movq -0x160(%rbp), %rdx
movq -0x30(%rbp), %rbx
movl %ebx, %ecx
callq 0x4e010
cvtsd2ss %xmm0, %xmm0
movq -0x110(%rbp), %rdi
movq -0xe0(%rbp), %rsi
movl %ebx, %edx
movq %r13, %rcx
movq 0x78(%rbp), %r8
movl %r12d, -0xd0(%rbp)
movl %r12d, %r9d
callq 0x32c92
movq -0x70(%rbp), %rbx
movb -0x34(%rbp), %r12b
movl -0x98(%rbp), %r13d
movl $0xa, %edi
callq 0x2060
testb %r12b, %r12b
je 0x367cc
leaq 0x24d09(%rip), %rdi     # 0x5b4b5
movl %r13d, %esi
movl -0x40(%rbp), %r12d
movl %r12d, %edx
xorl %eax, %eax
callq 0x20f0
movb $0x1, %al
movl %r13d, %r9d
movl %r12d, -0x34(%rbp)
movq -0x58(%rbp), %rcx
jmp 0x367e9
xorl %eax, %eax
movl %r13d, %r9d
movl -0x40(%rbp), %ecx
movl %ecx, -0x34(%rbp)
movq -0x90(%rbp), %rcx
movq -0x58(%rbp), %rdx
movq %rdx, -0x90(%rbp)
movq -0x50(%rbp), %rdx
movq -0x88(%rbp), %rdi
movq -0xf8(%rbp), %rsi
movl -0xb8(%rbp), %r8d
movq %rsi, %rsp
testb %al, %al
movq -0x100(%rbp), %r12
movq -0xf0(%rbp), %r13
jne 0x36834
movq -0x48(%rbp), %rax
incl %eax
movq %rcx, %rsi
movq %rax, -0x48(%rbp)
cmpl -0x78(%rbp), %eax
jne 0x35fdb
movl -0x78(%rbp), %eax
movq %rax, -0x48(%rbp)
leaq 0x24b03(%rip), %rdi     # 0x5b33e
movl $0xe, %esi
movl $0x1, %edx
movq -0x120(%rbp), %r15
movq %r15, %rcx
callq 0x2280
subq $0x50, %rsp
leaq 0x40(%rbp), %rax
movups (%rax), %xmm0
movups 0x10(%rax), %xmm1
movups %xmm1, 0x20(%rsp)
movups %xmm0, 0x10(%rsp)
movq -0x50(%rbp), %rax
movq %rax, 0x48(%rsp)
movq -0xa8(%rbp), %rax
movq %rax, 0x40(%rsp)
movq %rax, 0x38(%rsp)
movq -0x90(%rbp), %rax
movq %rax, 0x30(%rsp)
movq -0x30(%rbp), %rbx
movl %ebx, 0x8(%rsp)
movq -0xb0(%rbp), %rax
movq %rax, (%rsp)
leaq -0x12c(%rbp), %rdi
leaq -0x80(%rbp), %rsi
leaq -0x9c(%rbp), %r14
movss 0x1a754(%rip), %xmm1    # 0x51014
movss 0x1a748(%rip), %xmm2    # 0x51010
movq %r14, %rdx
movss -0x7c(%rbp), %xmm0
movq -0x48(%rbp), %rcx
movq %r15, %r8
movq %r12, %r9
callq 0x3551f
addq $0x50, %rsp
xorps %xmm0, %xmm0
cvtss2sd (%r14), %xmm0
leaq 0x24a5b(%rip), %rdi     # 0x5b34d
movb $0x1, %al
callq 0x20f0
leaq 0x25455(%rip), %rdi     # 0x5bd55
callq 0x2090
movq %r13, %rdi
movl 0x70(%rbp), %r14d
movl %r14d, %esi
movq %r12, %rdx
movl %ebx, %ecx
callq 0x16e07
testl %r14d, %r14d
movq -0x138(%rbp), %rdi
movq -0x70(%rbp), %rcx
movq -0x140(%rbp), %rdx
jle 0x3694b
xorl %eax, %eax
movsd (%r13,%rax,8), %xmm0
subsd (%rdx,%rax,8), %xmm0
movsd %xmm0, (%rdi,%rax,8)
incq %rax
cmpq %rax, %rcx
jne 0x36932
movq 0x68(%rbp), %rsi
movl 0x70(%rbp), %edx
callq 0x2f0aa
movq $0x0, 0x28(%r12)
cmpl $0x0, -0x30(%rbp)
movq -0x60(%rbp), %rcx
movq -0x110(%rbp), %r15
jle 0x369c5
xorl %ebx, %ebx
xorl %r14d, %r14d
leaq (%rcx,%rbx), %rsi
leaq (%r12,%rbx), %rdi
movl $0xc0, %edx
callq 0x21a0
movq -0x60(%rbp), %rcx
testl %r14d, %r14d
je 0x369b5
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 %r12, %rax
movq %rax, 0x28(%r12,%rbx)
incl %r14d
addq $0xc0, %rbx
cmpl %r14d, -0x30(%rbp)
jne 0x36976
movq %r12, %rdi
movq -0x30(%rbp), %rbx
movl %ebx, %esi
movq -0x138(%rbp), %rdx
movl 0x70(%rbp), %ecx
callq 0x154bb
leaq 0x2497b(%rip), %rdi     # 0x5b35f
movl $0x16, %esi
movl $0x1, %edx
movq -0x120(%rbp), %r13
movq %r13, %rcx
callq 0x2280
subq $0x50, %rsp
leaq 0x40(%rbp), %rax
movups (%rax), %xmm0
movups 0x10(%rax), %xmm1
movups %xmm1, 0x20(%rsp)
movups %xmm0, 0x10(%rsp)
movq -0x50(%rbp), %rax
movq %rax, 0x48(%rsp)
movq -0xa8(%rbp), %rax
movq %rax, 0x40(%rsp)
movq %rax, 0x38(%rsp)
movq -0x90(%rbp), %rax
movq %rax, 0x30(%rsp)
movl %ebx, 0x8(%rsp)
movq -0xb0(%rbp), %rax
movq %rax, (%rsp)
leaq -0x12c(%rbp), %rdi
leaq -0x80(%rbp), %rsi
leaq -0x9c(%rbp), %r14
movss 0x1a5af(%rip), %xmm1    # 0x51014
movss 0x1a5a3(%rip), %xmm2    # 0x51010
movq %r14, %rdx
movss -0x7c(%rbp), %xmm0
movq -0x48(%rbp), %rcx
movq %r13, %r8
movq %r12, %r9
callq 0x3551f
addq $0x50, %rsp
xorps %xmm0, %xmm0
cvtss2sd (%r14), %xmm0
leaq 0x24a4b(%rip), %rdi     # 0x5b4e2
movb $0x1, %al
callq 0x20f0
movq %r13, %rdi
callq 0x20c0
testq %r15, %r15
je 0x36ab3
movq %r15, %rdi
callq 0x20c0
subq $0x40, %rsp
movups -0x1b0(%rbp), %xmm0
movups -0x1a0(%rbp), %xmm1
movups -0x190(%rbp), %xmm2
movups -0x180(%rbp), %xmm3
movups %xmm3, 0x30(%rsp)
movups %xmm2, 0x20(%rsp)
movups %xmm1, 0x10(%rsp)
movups %xmm0, (%rsp)
callq 0x114b1
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 -0xc0(%rbp), %rdi
movq 0x68(%rbp), %rsi
movl 0x70(%rbp), %edx
movq -0xe0(%rbp), %rcx
movq -0x30(%rbp), %r8
xorl %r9d, %r9d
callq 0x20fb0
leaq -0x28(%rbp), %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq