// File: /workspace/github_c_makefile_star2_O1/ugobas[P]tnm/nma.c
// Function: Compute_Hessian_TNM
void Compute_Hessian_TNM(double **Hessian,  // Output
			 double **T_sqrt, float **T_sqrt_inv,
			 struct interaction *Int_list, int N_int,
			 atom *atoms, int N_atoms, struct axe *axes,
			 int nmain, int N_axes, int N_modes,
			 struct chain *chains, int Nchain, int kinetic,
			 float K_OMEGA, float K_PSI,
			 float K_PHI, float K_CHI,
			 float K_BA, float K_BL)
{


  // Compute transformed jacobian
  // Jtilde_ia = sum_b J_ib T_sqrt_inv_ab = eta_ia X r_i - tau_ia
  // eta_ak = sum_b chi_kb v_b T_sqrt_inv_ab
  // tau_ak = sum_b chi_kb shift_b T_sqrt_inv_ab
  //
  printf("Computing torsional Hessian matrix\n");

  int i, j, k, l, n, a;
  for(i=0; i<N_axes; i++)for(j=0; j<N_axes; j++)Hessian[i][j]=0;

  double **eta_iaj[N_axes], **tau_iaj[N_axes];
  for(i=0; i<N_axes; i++){
    eta_iaj[i]=Allocate_mat2_d(N_modes, 3);
    tau_iaj[i]=Allocate_mat2_d(N_modes, 3);
  }

  if(kinetic==0){
    for(a=0; a<N_axes; a++){
      struct axe *a_axe=axes+a;
      for(i=a; i<N_modes; i++){
	double *eta=eta_iaj[i][a], *tau=tau_iaj[i][a];
	for(j=0; j<3; j++){
	  eta[j]=a_axe->rot[j];
	  tau[j]=a_axe->shift[j];
	}
      }
    }

  }else if(T_sqrt_inv){

    for(i=0; i<N_axes; i++){
      struct axe *i_axe=axes+i;
      // eta_ia = sum_{ini_chain<=b<=i} v_b T_sqrt_inv_ab
      for(a=0; a<N_modes; a++){
	double *eta=eta_iaj[i][a], *tau=tau_iaj[i][a];
	if(i_axe->previous >=0){
	  double *eta_prev=eta_iaj[i_axe->previous][a];
	  double *tau_prev=tau_iaj[i_axe->previous][a];
	  for(j=0; j<3; j++){
	    eta[j]=eta_prev[j]; tau[j]=tau_prev[j];
	  }
	}else{
	  for(j=0; j<3; j++){eta[j]=0; tau[j]=0;}
	}
	for(j=0; j<3; j++){
	  eta[j]+=(i_axe->rot[j])*T_sqrt_inv[a][i];
	  tau[j]+=(i_axe->shift[j])*T_sqrt_inv[a][i];
	}
      }
    }
  }else{   // Cholevsky decomposition has been successfully performed
    // Solve L eta_ia = v(i) by forward substitution
    // Note that v_b(i) =0 for b>rotable_i
    printf("Computing Hessian with Cholevsky decomposition\n");
    double X[N_axes], Y[N_axes];
    int main1=-1, main2=-1, side1=-1, side2=-1;
    for(i=0; i<N_axes; i++){

      for(l=0; l<N_axes; l++)Y[l]=0;
      Axes_path(&main1, &main2, &side1, &side2, axes, i, nmain, N_axes);
      double **eta=eta_iaj[i], **tau=tau_iaj[i];

      for(j=0; j<3; j++){
	for(l=main1; l<=main2; l++)Y[l]=axes[l].rot[j];
	if(side1>=0)for(l=side1; l<=side2; l++)Y[l]=axes[l].rot[j];
	Forward_substitution(X, T_sqrt, Y, N_axes);
	for(a=0; a<N_axes; a++)eta[a][j]=X[a];
	//
	for(l=main1; l<=main2; l++)Y[l]=axes[l].shift[j];
	if(side1>=0)for(l=side1; l<=side2; l++)Y[l]=axes[l].shift[j];
	Forward_substitution(X, T_sqrt, Y, N_axes);
	for(a=0; a<N_axes; a++)tau[a][j]=X[a];
      }
    }
  }

  // Compute Hessian in double precision (only upper diagonal)

  double **zero=Allocate_mat2_d(N_modes, 3);
  int N_cont[Nchain], n_inter=0;
  for(i=0; i<Nchain; i++)N_cont[i]=0;

  for(n=0; n<N_int; n++){
    atom *atom1=atoms+Int_list[n].i1;
    atom *atom2=atoms+Int_list[n].i2;

    if(atom1->chain==atom2->chain){
      N_cont[atom1->chain]++; // Intrachain contact
    }else{
      n_inter++;  // Interchain contact
    }

    // Determine set of rotable axes
    int ilast;
    double **eta_1, **tau_1, **eta_2, **tau_2;
    double eta[3], tau[3];
    if(atom1->last_dof_side >= 0){
      ilast=atom1->last_dof_side;
    }else{
      ilast=atom1->last_dof_main;
    }
    if(ilast>=0){
      eta_1=eta_iaj[ilast];
      tau_1=tau_iaj[ilast];
    }else{
      eta_1=zero; tau_1=zero;
    }

    if(atom2->last_dof_side >= 0){
      ilast=atom2->last_dof_side;
    }else{
      ilast=atom2->last_dof_main;
    }
    if(ilast>=0){
      eta_2=eta_iaj[ilast];
      tau_2=tau_iaj[ilast];
    }else{
      eta_2=zero; tau_2=zero;
    }

    // Compute r_ij/|r_ij|
    double r21[3], cr21[3], r1[3], r2[3];
    for(j=0; j<3; j++){
      r1[j]=atom1->r[j];
      r2[j]=atom2->r[j];
      r21[j]=r2[j]-r1[j];
    }
    Vector_product_d(cr21, r2, r1); //cr21= r2 X r1

    double h=Int_list[n].sec_der;
    h/=(r21[0]*r21[0]+r21[1]*r21[1]+r21[2]*r21[2]);

    double dk[N_modes];
    for(k=0; k< N_modes; k++){
      for(j=0; j<3; j++){
	eta[j]=eta_2[k][j]-eta_1[k][j];
	tau[j]=tau_2[k][j]-tau_1[k][j];    // For kinetic=0 eta,tau=0, wrong!
      }
      dk[k]=Scalar_product_3_d(cr21, eta)- // 03/2023: OK
	Scalar_product_3_d(r21, tau);
      double Hk=h*dk[k];
      for(l=0; l<=k; l++){
	Hessian[l][k] += Hk*dk[l];
      }
    }
  }

  for(i=0; i<Nchain; i++)
    printf("chain %d (%c): %3d contacts\n", i, chains[i].label, N_cont[i]);
  if(Nchain>1)printf("%d interchain contacts\n", n_inter);

  if((K_OMEGA==0)&&(K_PHI==0)&&(K_PSI==0)&&(K_CHI==0)&&(K_BA==0)&&(K_BL==0))
    goto upper_diagonal;

  // Hessian of the torsional potential K(a)*(theta_a-theta0_a)^2
  printf("Computing torsional potential\n");

  if(kinetic==0){
    struct axe *ax=axes;
    for(k=0; k<N_axes; k++){
      if(ax->type=='f'){Hessian[k][k]+=K_PHI;}
      else if(ax->type=='p'){Hessian[k][k]+=K_PSI;}
      else if(ax->type=='l'){Hessian[k][k]+=K_BL;}
      else if(ax->type=='a'){Hessian[k][k]+=K_BA;}
      else if(ax->type=='t'){Hessian[k][k]+=K_PHI;}
      else if(ax->type=='o'){Hessian[k][k]+=K_OMEGA;}
      else if(ax->type=='s'){Hessian[k][k]+=K_CHI;}
      ax++;
    }

  }else if(T_sqrt_inv){
    for(k=0; k<N_modes; k++){
      float *tk=T_sqrt_inv[k];
      for(l=0; l<=k; l++){
	float *tl=T_sqrt_inv[l];
	double H_Phi=0, H_Psi=0, H_Ome=0, H_Chi=0, H_BA=0, H_BL=0, H_BT=0;
	struct axe *ax=axes;
	for(i=0; i<N_axes; i++){
	  if(ax->type=='f'){H_Phi+=tk[i]*tl[i];}
	  else if(ax->type=='p'){H_Psi+=tk[i]*tl[i];}
	  else if(ax->type=='l'){H_BL+=tk[i]*tl[i];}
	  else if(ax->type=='a'){H_BA+=tk[i]*tl[i];}
	  else if(ax->type=='t'){H_BT+=tk[i]*tl[i];}
	  else if(ax->type=='o'){H_Ome+=tk[i]*tl[i];}
	  else if(ax->type=='s'){H_Chi+=tk[i]*tl[i];}
	  ax++;
	}
	double HH=K_PHI*H_Phi;
	if(H_Psi)HH+=K_PSI*H_Psi;
	if(H_Ome)HH+=K_OMEGA*H_Ome;
	if(H_Chi)HH+=K_CHI*H_Chi;
	if(H_BL)HH+=K_BL*H_BL;
	if(H_BA)HH+=K_BA*H_BA;
	if(H_BT)HH+=K_PHI*H_BT;
	Hessian[l][k]+=HH;
      }
    }
  }else{ // Cholevsky decomposition
    double X[N_axes], Y[N_axes], *Y2[N_axes];
    for(i=0; i<N_axes; i++){
      Y[i]=0; Y2[i]=malloc(N_axes*sizeof(double));
      for(k=0; k<N_axes; k++)Y2[i][k]=0;
    }
    for(i=0; i<N_axes; i++){
      char type=axes[i].type;
      if(type=='f'){Y[i]=K_PHI;}
      else if(type=='p'){Y[i]=K_PSI;}
      else if(type=='l'){Y[i]=K_BL;}
      else if(type=='a'){Y[i]=K_BA;}
      else if(type=='t'){Y[i]=K_PHI;}
      else if(type=='o'){Y[i]=K_OMEGA;}
      else if(type=='s'){Y[i]=K_CHI;}
      if(Y[i]){
	Forward_substitution(X, T_sqrt, Y, N_axes);
	for(k=0; k<N_axes; k++)Y2[k][i]=X[k];
	Y[i]=0;
      }
    }
    for(k=0; k<N_axes; k++){
      Forward_substitution(X, T_sqrt, Y2[k], N_axes);
      for(l=0; l<=k; l++)Hessian[l][k]+=X[l];
    }
    for(i=0; i<N_axes; i++)free(Y2[i]);
  }

  // Upper diagonal; store to float
 upper_diagonal:
  for(k=0; k<N_modes; k++){
    for(l=0; l<k; l++){
      Hessian[k][l]=Hessian[l][k];
    }
  }

  if(DBG_NMA){
    // Print
    if(kinetic==0){printf("Kinetic energy not considered\n");}
    if(T_sqrt_inv==NULL){printf("Cholevsky decomposition\n");}
    else{printf("Diagonalization of kinetic energy\n");}
    printf("V''(r^PDB): ");
    for(n=0; n<N_int; n++)
      printf(" %.2g:%.2g", Int_list[n].r0,Int_list[n].sec_der);
    //printf(" %d-%d",Int_list[n].i1, Int_list[n].i2);
    printf("\n");
    int ini=N_modes-20;
    printf("###  Kinetic energy matrix:\n");
    for(k=ini; k<N_modes; k++){
      if(T_sqrt_inv==0)
	for(j=k+1; j<N_axes; j++)T_sqrt[k][j]=0;
      for(l=ini; l<=k; l++){
	double sum=0;
	for(j=0; j<N_axes; j++)
	  sum+=T_sqrt[k][j]*T_sqrt[l][j];
	printf(" %.4g", sum);
      }
      printf("\n");
    }
    if(T_sqrt_inv){
      printf("###  T_sqrt T_sqrt_inv:\n");
      for(k=ini; k<N_modes; k++){
	for(l=ini; l<=k; l++){
	  double sum=0;
	  for(j=0; j<N_axes; j++)
	    sum+=T_sqrt_inv[k][j]*T_sqrt[j][l];
	  printf(" %.4f", sum);
	}
	printf("\n");
      }
    }
    printf("###  |eta_ai|\n");
    for(k=ini; k<N_modes; k++){
      for(i=ini; i<N_modes; i++){
	double sum=0, *eta=eta_iaj[i][k];
	for(j=0; j<3; j++)sum+=eta[j]*eta[j];
	printf("%.2g ",sqrt(sum));
      }
      printf("\n");
    }
    printf("### |tau_ai|   (shift)\n");
    for(k=ini; k<N_modes; k++){
      for(i=ini; i<N_modes; i++){
	double sum=0, *tau=tau_iaj[i][k];
	for(j=0; j<3; j++)sum+=tau[j]*tau[j];
	printf("%.2g ",sqrt(sum));
      }
      printf("  %.3g", sqrt(Scalar_product_3_d(axes[k].shift, axes[k].shift)));
      printf("\n");
    }
    printf("###  Potential energy matrix H~:\n");
    for(k=ini; k<N_modes; k++){
      for(l=ini; l<=k; l++)printf(" %.4g", Hessian[k][l]);
      printf("\n");
    }
    printf("Atoms last dof (mainchain): ");
    for(i=0; i<100; i++)printf("%d ", atoms[i].last_dof_main);
    printf("\n");
    exit(8);
  }

  // Cleaning
  Empty_matrix_d(zero, N_modes);
  for(i=0; i<N_axes; i++){
    Empty_matrix_d(eta_iaj[i], N_modes);
    Empty_matrix_d(tau_iaj[i], N_modes);
  }

}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x1b8, %rsp            # imm = 0x1B8
movss %xmm5, -0x60(%rbp)
movss %xmm4, -0x64(%rbp)
movss %xmm3, -0x5c(%rbp)
movss %xmm2, -0x44(%rbp)
movss %xmm1, -0x58(%rbp)
movss %xmm0, -0x54(%rbp)
movq %r9, %r13
movl %r8d, -0x94(%rbp)
movq %rcx, -0x100(%rbp)
movq %rdx, -0x50(%rbp)
movq %rsi, -0x88(%rbp)
movq %rdi, %r15
movl 0x28(%rbp), %ebx
leaq 0x34cb5(%rip), %rdi     # 0x5942c
callq 0x2090
movl %ebx, %eax
testl %ebx, %ebx
movq %rax, -0x30(%rbp)
jle 0x247ab
leaq (,%rax,8), %rbx
xorl %r14d, %r14d
movq (%r15,%r14,8), %rdi
xorl %esi, %esi
movq %rbx, %rdx
callq 0x2110
movq -0x30(%rbp), %rax
incq %r14
cmpq %r14, %rax
jne 0x24791
movq %r15, -0x70(%rbp)
movl 0x30(%rbp), %r12d
movq %rsp, %r15
leaq 0xf(,%rax,8), %rax
andq $-0x10, %rax
subq %rax, %r15
movq %r15, %rsp
movq %rsp, %r14
movq %rax, -0xf8(%rbp)
subq %rax, %r14
movq %r14, %rsp
movl 0x28(%rbp), %eax
testl %eax, %eax
jle 0x2480c
xorl %ebx, %ebx
movl %r12d, %edi
movl $0x3, %esi
callq 0x49798
movq %rax, (%r15,%rbx,8)
movl %r12d, %edi
movl $0x3, %esi
callq 0x49798
movq %rax, (%r14,%rbx,8)
incq %rbx
cmpq %rbx, -0x30(%rbp)
jne 0x247e1
movq %r15, -0x78(%rbp)
movq %r14, -0x80(%rbp)
cmpl $0x0, 0x48(%rbp)
movq %r13, -0xe0(%rbp)
je 0x24948
cmpq $0x0, -0x50(%rbp)
je 0x249ca
movl 0x28(%rbp), %eax
testl %eax, %eax
jle 0x24cf0
movl 0x30(%rbp), %eax
movl %eax, %eax
movq 0x18(%rbp), %rcx
addq $0x60, %rcx
xorl %edx, %edx
xorl %esi, %esi
movl 0x30(%rbp), %edi
testl %edi, %edi
jle 0x2492f
imulq $0x158, %rsi, %r9       # imm = 0x158
movq -0x78(%rbp), %rdi
movq (%rdi,%rsi,8), %rdi
movq -0x80(%rbp), %r8
movq (%r8,%rsi,8), %r8
movq 0x18(%rbp), %r10
movl 0x2c(%r10,%r9), %r9d
xorl %r10d, %r10d
movq (%rdi,%r10,8), %r11
movq (%r8,%r10,8), %rbx
testl %r9d, %r9d
js 0x248c5
movq -0x78(%rbp), %r14
movq (%r14,%r9,8), %r14
movq (%r14,%r10,8), %r14
movq -0x80(%rbp), %r15
movq (%r15,%r9,8), %r15
movq (%r15,%r10,8), %r15
xorl %r12d, %r12d
movsd (%r14,%r12,8), %xmm0
movsd %xmm0, (%r11,%r12,8)
movsd (%r15,%r12,8), %xmm0
movsd %xmm0, (%rbx,%r12,8)
incq %r12
cmpq $0x3, %r12
jne 0x248a2
jmp 0x248d9
xorl %r14d, %r14d
movq %rdx, (%r11,%r14,8)
movq %rdx, (%rbx,%r14,8)
incq %r14
cmpq $0x3, %r14
jne 0x248c8
movq -0x50(%rbp), %r14
movq (%r14,%r10,8), %r14
xorps %xmm0, %xmm0
cvtss2sd (%r14,%rsi,4), %xmm0
xorl %r14d, %r14d
movsd -0x18(%rcx,%r14,8), %xmm1
mulsd %xmm0, %xmm1
addsd (%r11,%r14,8), %xmm1
movsd %xmm1, (%r11,%r14,8)
movsd (%rcx,%r14,8), %xmm1
mulsd %xmm0, %xmm1
addsd (%rbx,%r14,8), %xmm1
movsd %xmm1, (%rbx,%r14,8)
incq %r14
cmpq $0x3, %r14
jne 0x248ed
incq %r10
cmpq %rax, %r10
jne 0x2487a
incq %rsi
addq $0x158, %rcx            # imm = 0x158
cmpq -0x30(%rbp), %rsi
jne 0x2484c
jmp 0x24cf0
movl 0x28(%rbp), %eax
testl %eax, %eax
movq -0x80(%rbp), %r11
movq -0x78(%rbp), %rbx
jle 0x24cf0
movl 0x30(%rbp), %eax
movq %rax, %rcx
movslq %ecx, %rax
movl %ecx, %ecx
movq 0x18(%rbp), %rdx
addq $0x60, %rdx
xorl %esi, %esi
cmpq %rax, %rsi
jge 0x249b5
movq %rsi, %rdi
movq (%rbx,%rdi,8), %r8
movq (%r8,%rsi,8), %r8
movq (%r11,%rdi,8), %r9
movq (%r9,%rsi,8), %r9
xorl %r10d, %r10d
movsd -0x18(%rdx,%r10,8), %xmm0
movsd %xmm0, (%r8,%r10,8)
movsd (%rdx,%r10,8), %xmm0
movsd %xmm0, (%r9,%r10,8)
incq %r10
cmpq $0x3, %r10
jne 0x2498b
incq %rdi
cmpq %rcx, %rdi
jne 0x24978
incq %rsi
addq $0x158, %rdx            # imm = 0x158
cmpq -0x30(%rbp), %rsi
jne 0x24970
jmp 0x24cf0
leaq 0x34a7e(%rip), %rdi     # 0x5944f
callq 0x2090
movq %rsp, -0x128(%rbp)
movq %rsp, %rbx
movq -0xf8(%rbp), %rax
subq %rax, %rbx
movq %rbx, %rsp
movq %rsp, %rcx
subq %rax, %rcx
movq %rcx, -0x40(%rbp)
movq %rcx, %rsp
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
movl %eax, -0x1a0(%rbp)
movl %eax, -0x180(%rbp)
movl %eax, -0x120(%rbp)
movl %eax, -0x160(%rbp)
movl 0x28(%rbp), %eax
testl %eax, %eax
jle 0x24ce2
movq -0x30(%rbp), %rax
leaq (,%rax,8), %rax
movq %rax, -0x140(%rbp)
movq 0x18(%rbp), %rax
leaq 0x48(%rax), %rcx
movq %rcx, -0x138(%rbp)
addq $0x60, %rax
movq %rax, -0x130(%rbp)
xorl %r14d, %r14d
movq -0x40(%rbp), %r15
movq %r15, %rdi
xorl %esi, %esi
movq -0x140(%rbp), %rdx
callq 0x2110
leaq -0x1a0(%rbp), %rdi
leaq -0x180(%rbp), %rsi
leaq -0x120(%rbp), %rdx
leaq -0x160(%rbp), %rcx
movq 0x18(%rbp), %r8
movl %r14d, %r9d
movl 0x28(%rbp), %eax
pushq %rax
movl 0x20(%rbp), %eax
pushq %rax
callq 0x25ad8
addq $0x10, %rsp
movq -0x78(%rbp), %rax
movq (%rax,%r14,8), %rsi
movq -0x80(%rbp), %rax
movq %r14, -0xd0(%rbp)
movq (%rax,%r14,8), %rdi
movslq -0x1a0(%rbp), %rdx
movl -0x180(%rbp), %r8d
movl -0x120(%rbp), %r9d
testl %r9d, %r9d
sets %al
movl -0x160(%rbp), %r14d
cmpl %r14d, %r9d
setg %r10b
movl %r9d, %ecx
orb %al, %r10b
movb %r10b, -0xb8(%rbp)
imulq $0x158, %rdx, %r10      # imm = 0x158
movq -0x138(%rbp), %rax
leaq (%rax,%r10), %r11
movl %r8d, -0x90(%rbp)
movl %r8d, %r13d
subl %edx, %r13d
incl %r13d
decl %r9d
movl %r9d, -0xa8(%rbp)
leaq (%r15,%rcx,8), %r8
movq %r8, -0xa0(%rbp)
imulq $0x158, %rcx, %rcx      # imm = 0x158
leaq (%rax,%rcx), %r8
movq -0x130(%rbp), %rax
addq %rax, %r10
movq %r10, -0xd8(%rbp)
addq %rax, %rcx
movq %rcx, -0xb0(%rbp)
movq %rdx, -0x38(%rbp)
leaq (%r15,%rdx,8), %r15
xorl %r12d, %r12d
movq %rsi, -0xf0(%rbp)
movq %rdi, -0xe8(%rbp)
movl -0x90(%rbp), %eax
cmpl %eax, -0x38(%rbp)
jg 0x24b86
movq %r11, %rax
xorl %ecx, %ecx
movsd (%rax), %xmm0
movsd %xmm0, (%r15,%rcx,8)
incq %rcx
addq $0x158, %rax            # imm = 0x158
cmpl %ecx, %r13d
jne 0x24b6e
movq %r11, -0xc8(%rbp)
cmpb $0x0, -0xb8(%rbp)
jne 0x24bbf
movq %r8, %rax
movq -0xa0(%rbp), %rcx
movl -0xa8(%rbp), %edx
movsd (%rax), %xmm0
movsd %xmm0, (%rcx)
incl %edx
addq $0x8, %rcx
addq $0x158, %rax            # imm = 0x158
cmpl %edx, %r14d
jg 0x24ba6
movq %r8, -0xc0(%rbp)
movq %rbx, %rdi
movq -0x88(%rbp), %rsi
movq -0x40(%rbp), %rdx
movl 0x28(%rbp), %ecx
callq 0x499a8
xorl %eax, %eax
movq -0x30(%rbp), %rdx
movq -0xf0(%rbp), %rsi
movsd (%rbx,%rax,8), %xmm0
movq (%rsi,%rax,8), %rcx
movsd %xmm0, (%rcx,%r12,8)
incq %rax
cmpq %rax, %rdx
jne 0x24be9
movl -0x90(%rbp), %eax
cmpl %eax, -0x38(%rbp)
jg 0x24c2c
movq -0xd8(%rbp), %rax
xorl %ecx, %ecx
movsd (%rax), %xmm0
movsd %xmm0, (%r15,%rcx,8)
incq %rcx
addq $0x158, %rax            # imm = 0x158
cmpl %ecx, %r13d
jne 0x24c14
cmpb $0x0, -0xb8(%rbp)
jne 0x24c62
movq -0xb0(%rbp), %rax
movq -0xa0(%rbp), %rcx
movl -0xa8(%rbp), %edx
movsd (%rax), %xmm0
movsd %xmm0, (%rcx)
incl %edx
addq $0x8, %rcx
addq $0x158, %rax            # imm = 0x158
cmpl %edx, %r14d
jg 0x24c49
movq %rbx, %rdi
movq -0x88(%rbp), %rsi
movq -0x40(%rbp), %rdx
movl 0x28(%rbp), %ecx
callq 0x499a8
xorl %eax, %eax
movq -0x30(%rbp), %rdx
movq -0xe8(%rbp), %rdi
movsd (%rbx,%rax,8), %xmm0
movq (%rdi,%rax,8), %rcx
movsd %xmm0, (%rcx,%r12,8)
incq %rax
cmpq %rax, %rdx
jne 0x24c85
incq %r12
movq -0xc8(%rbp), %r11
addq $0x8, %r11
movq -0xc0(%rbp), %r8
addq $0x8, %r8
addq $0x8, -0xd8(%rbp)
addq $0x8, -0xb0(%rbp)
cmpq $0x3, %r12
jne 0x24b5e
movq -0xd0(%rbp), %r14
incq %r14
cmpq %rdx, %r14
jne 0x24a52
movq -0x128(%rbp), %rsp
movq -0xe0(%rbp), %r13
movl 0x30(%rbp), %edi
movl $0x3, %esi
callq 0x49798
movq %rax, %r12
movl 0x40(%rbp), %ecx
movl %ecx, %eax
movq %rax, -0xd0(%rbp)
movq %rsp, %rdx
leaq 0xf(,%rax,4), %rax
andq $-0x10, %rax
subq %rax, %rdx
movq %rdx, -0xa8(%rbp)
movq %rdx, %rsp
testl %ecx, %ecx
jle 0x24d49
movq -0xd0(%rbp), %rax
leaq (,%rax,4), %rdx
movq -0xa8(%rbp), %rdi
xorl %esi, %esi
callq 0x2110
movl -0x94(%rbp), %ecx
testl %ecx, %ecx
jle 0x24ff1
movl 0x30(%rbp), %eax
movl %eax, %eax
movl %ecx, %ecx
movq %rcx, -0xf0(%rbp)
xorl %r9d, %r9d
movq %rax, -0xc8(%rbp)
leaq 0xf(,%rax,8), %rax
andq $-0x10, %rax
movq %rax, -0xe8(%rbp)
movl $0x0, -0xa0(%rbp)
movq %r12, -0xb0(%rbp)
imulq $0xc8, %r9, %r14
movq -0x100(%rbp), %r8
movslq (%r8,%r14), %rax
imulq $0x70, %rax, %rax
movslq 0x4(%r8,%r14), %rcx
imulq $0x70, %rcx, %rcx
movslq 0x6c(%r13,%rax), %rdx
cmpl 0x6c(%r13,%rcx), %edx
movq -0x80(%rbp), %rsi
movq -0x78(%rbp), %rdi
movq %r9, -0xc0(%rbp)
jne 0x24dda
movq -0xa8(%rbp), %r9
incl (%r9,%rdx,4)
jmp 0x24de0
incl -0xa0(%rbp)
addq %r13, %rax
movl 0x5c(%rax), %edx
testl %edx, %edx
jns 0x24ded
movl 0x58(%rax), %edx
movq %r12, -0x38(%rbp)
movq %r12, -0x90(%rbp)
testl %edx, %edx
js 0x24e11
movl %edx, %edx
movq (%rdi,%rdx,8), %r9
movq %r9, -0x90(%rbp)
movq (%rsi,%rdx,8), %rdx
movq %rdx, -0x38(%rbp)
addq %r13, %rcx
movl 0x5c(%rcx), %edx
testl %edx, %edx
jns 0x24e1e
movl 0x58(%rcx), %edx
movq %r12, %r15
testl %edx, %edx
js 0x24e2f
movl %edx, %edx
movq (%rdi,%rdx,8), %r12
movq (%rsi,%rdx,8), %r15
addq %r8, %r14
movups (%rax), %xmm0
movaps %xmm0, -0x1e0(%rbp)
movq 0x10(%rax), %rdx
movq %rdx, -0x1d0(%rbp)
movups (%rcx), %xmm0
movaps %xmm0, -0x1c0(%rbp)
movq 0x10(%rcx), %rdx
movq %rdx, -0x1b0(%rbp)
xorl %edx, %edx
movsd (%rcx,%rdx,8), %xmm0
subsd (%rax,%rdx,8), %xmm0
movsd %xmm0, -0x120(%rbp,%rdx,8)
incq %rdx
cmpq $0x3, %rdx
jne 0x24e5e
leaq -0x160(%rbp), %rdi
leaq -0x1c0(%rbp), %rsi
leaq -0x1e0(%rbp), %rdx
callq 0x1086b
movq %rsp, -0xd8(%rbp)
movq %rsp, %rbx
subq -0xe8(%rbp), %rbx
movq %rbx, %rsp
movl 0x30(%rbp), %eax
testl %eax, %eax
jle 0x24fc3
movsd 0x28(%r14), %xmm3
movsd -0x120(%rbp), %xmm0
movsd -0x118(%rbp), %xmm1
movsd -0x110(%rbp), %xmm2
mulsd %xmm1, %xmm1
mulsd %xmm0, %xmm0
addsd %xmm1, %xmm0
mulsd %xmm2, %xmm2
addsd %xmm0, %xmm2
divsd %xmm2, %xmm3
movsd %xmm3, -0xb8(%rbp)
movl $0x1, %r14d
xorl %r13d, %r13d
movq (%r12,%r13,8), %rax
movq -0x90(%rbp), %rcx
movq (%rcx,%r13,8), %rcx
movq (%r15,%r13,8), %rdx
movq -0x38(%rbp), %rsi
movq (%rsi,%r13,8), %rsi
xorl %edi, %edi
movsd (%rax,%rdi), %xmm0
subsd (%rcx,%rdi), %xmm0
movsd %xmm0, -0x1a0(%rbp,%rdi)
movsd (%rdx,%rdi), %xmm0
subsd (%rsi,%rdi), %xmm0
movsd %xmm0, -0x180(%rbp,%rdi)
addq $0x8, %rdi
cmpq $0x18, %rdi
jne 0x24f17
leaq -0x160(%rbp), %rdi
leaq -0x1a0(%rbp), %rsi
callq 0x108e3
movsd %xmm0, -0x40(%rbp)
leaq -0x120(%rbp), %rdi
leaq -0x180(%rbp), %rsi
callq 0x108e3
movsd -0x40(%rbp), %xmm1
subsd %xmm0, %xmm1
movsd %xmm1, (%rbx,%r13,8)
mulsd -0xb8(%rbp), %xmm1
xorl %eax, %eax
movq -0x70(%rbp), %rdx
movq (%rdx,%rax,8), %rcx
movsd (%rbx,%rax,8), %xmm0
mulsd %xmm1, %xmm0
addsd (%rcx,%r13,8), %xmm0
movsd %xmm0, (%rcx,%r13,8)
incq %rax
cmpq %rax, %r14
jne 0x24f8f
incq %r13
incq %r14
cmpq -0xc8(%rbp), %r13
jne 0x24efa
movq -0xd8(%rbp), %rsp
movq -0xc0(%rbp), %r9
incq %r9
cmpq -0xf0(%rbp), %r9
movq -0xe0(%rbp), %r13
movq -0xb0(%rbp), %r12
jne 0x24d93
jmp 0x24ffb
movl $0x0, -0xa0(%rbp)
cmpl $0x0, 0x40(%rbp)
movq -0xd0(%rbp), %r13
movq -0xa8(%rbp), %rbx
jle 0x2503f
movq 0x38(%rbp), %r14
addq $0x34, %r14
xorl %r15d, %r15d
movsbl (%r14), %edx
movl (%rbx,%r15,4), %ecx
leaq 0x33cdb(%rip), %rdi     # 0x58d04
movl %r15d, %esi
xorl %eax, %eax
callq 0x20f0
incq %r15
addq $0x70, %r14
cmpq %r15, %r13
jne 0x2501a
cmpl $0x2, 0x40(%rbp)
jl 0x25059
leaq 0x33cd5(%rip), %rdi     # 0x58d21
movl -0xa0(%rbp), %esi
xorl %eax, %eax
callq 0x20f0
xorps %xmm0, %xmm0
movss -0x60(%rbp), %xmm1
ucomiss %xmm0, %xmm1
movq -0x70(%rbp), %r10
movss -0x44(%rbp), %xmm2
jne 0x2516f
jp 0x2516f
movss -0x64(%rbp), %xmm1
ucomiss %xmm0, %xmm1
jne 0x2516f
jp 0x2516f
movss -0x5c(%rbp), %xmm1
ucomiss %xmm0, %xmm1
jne 0x2516f
jp 0x2516f
movss -0x58(%rbp), %xmm1
ucomiss %xmm0, %xmm1
jne 0x2516f
jp 0x2516f
movss -0x54(%rbp), %xmm1
ucomiss %xmm0, %xmm1
jne 0x2516f
jp 0x2516f
ucomiss %xmm0, %xmm2
jne 0x2516f
jp 0x2516f
movl 0x30(%rbp), %eax
testl %eax, %eax
jle 0x2510f
movl 0x30(%rbp), %eax
movl %eax, %eax
xorl %ecx, %ecx
testq %rcx, %rcx
je 0x25107
movq (%r10,%rcx,8), %rdx
xorl %esi, %esi
movq (%r10,%rsi,8), %rdi
movsd (%rdi,%rcx,8), %xmm0
movsd %xmm0, (%rdx,%rsi,8)
incq %rsi
cmpq %rsi, %rcx
jne 0x250f1
incq %rcx
cmpq %rax, %rcx
jne 0x250e6
cmpl $0x0, 0x541fa(%rip)     # 0x79310
jne 0x2569a
movq %r12, %rdi
movl 0x30(%rbp), %r13d
movl %r13d, %esi
callq 0x49642
movl 0x28(%rbp), %eax
testl %eax, %eax
movq -0x80(%rbp), %r14
movq -0x78(%rbp), %r15
movq -0x30(%rbp), %r12
jle 0x25160
xorl %ebx, %ebx
movq (%r15,%rbx,8), %rdi
movl %r13d, %esi
callq 0x49642
movq (%r14,%rbx,8), %rdi
movl %r13d, %esi
callq 0x49642
incq %rbx
cmpq %rbx, %r12
jne 0x25140
leaq -0x28(%rbp), %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x34308(%rip), %rdi     # 0x5947e
callq 0x2090
cmpl $0x0, 0x48(%rbp)
je 0x25451
cmpq $0x0, -0x50(%rbp)
je 0x254d6
movl 0x30(%rbp), %eax
testl %eax, %eax
movq -0x70(%rbp), %r10
movss -0x44(%rbp), %xmm0
jle 0x250d8
cvtss2sd %xmm0, %xmm0
xorps %xmm1, %xmm1
cvtss2sd -0x58(%rbp), %xmm1
xorps %xmm2, %xmm2
cvtss2sd -0x54(%rbp), %xmm2
cvtss2sd -0x5c(%rbp), %xmm3
cvtss2sd -0x60(%rbp), %xmm4
cvtss2sd -0x64(%rbp), %xmm5
movl 0x30(%rbp), %eax
movl %eax, %eax
movl $0x1, %ecx
xorl %edx, %edx
leaq 0x339be(%rip), %rsi     # 0x58b98
xorpd %xmm6, %xmm6
movq -0x50(%rbp), %rdi
movq (%rdi,%rdx,8), %rdi
xorl %r8d, %r8d
movl 0x28(%rbp), %r9d
testl %r9d, %r9d
jle 0x25306
movq -0x50(%rbp), %r9
movq (%r9,%r8,8), %r9
xorpd %xmm7, %xmm7
xorl %r10d, %r10d
movq 0x18(%rbp), %r11
xorpd %xmm9, %xmm9
xorpd %xmm8, %xmm8
xorpd %xmm10, %xmm10
xorpd %xmm11, %xmm11
xorpd %xmm12, %xmm12
xorpd %xmm13, %xmm13
movzbl (%r11), %ebx
leal -0x66(%rbx), %r14d
cmpl $0xe, %r14d
ja 0x25259
movslq (%rsi,%r14,4), %rbx
addq %rsi, %rbx
jmpq *%rbx
movss (%rdi,%r10,4), %xmm14
mulss (%r9,%r10,4), %xmm14
cvtss2sd %xmm14, %xmm14
addsd %xmm14, %xmm13
jmp 0x252f0
cmpl $0x61, %ebx
jne 0x252f0
movss (%rdi,%r10,4), %xmm14
mulss (%r9,%r10,4), %xmm14
cvtss2sd %xmm14, %xmm14
addsd %xmm14, %xmm8
jmp 0x252f0
movss (%rdi,%r10,4), %xmm14
mulss (%r9,%r10,4), %xmm14
cvtss2sd %xmm14, %xmm14
addsd %xmm14, %xmm11
jmp 0x252f0
movss (%rdi,%r10,4), %xmm14
mulss (%r9,%r10,4), %xmm14
cvtss2sd %xmm14, %xmm14
addsd %xmm14, %xmm7
jmp 0x252f0
movss (%rdi,%r10,4), %xmm14
mulss (%r9,%r10,4), %xmm14
cvtss2sd %xmm14, %xmm14
addsd %xmm14, %xmm12
jmp 0x252f0
movss (%rdi,%r10,4), %xmm14
mulss (%r9,%r10,4), %xmm14
cvtss2sd %xmm14, %xmm14
addsd %xmm14, %xmm9
jmp 0x252f0
movss (%rdi,%r10,4), %xmm14
mulss (%r9,%r10,4), %xmm14
cvtss2sd %xmm14, %xmm14
addsd %xmm14, %xmm10
addq $0x158, %r11            # imm = 0x158
incq %r10
cmpq %r10, -0x30(%rbp)
jne 0x25227
jmp 0x25328
xorpd %xmm13, %xmm13
xorpd %xmm12, %xmm12
xorpd %xmm11, %xmm11
xorpd %xmm10, %xmm10
xorpd %xmm8, %xmm8
xorpd %xmm9, %xmm9
xorpd %xmm7, %xmm7
mulsd %xmm0, %xmm13
movaps %xmm1, %xmm14
mulsd %xmm12, %xmm14
addsd %xmm13, %xmm14
cmpneqsd %xmm6, %xmm12
movapd %xmm12, %xmm15
andnpd %xmm13, %xmm15
andpd %xmm14, %xmm12
orpd %xmm15, %xmm12
movaps %xmm2, %xmm13
mulsd %xmm11, %xmm13
addsd %xmm12, %xmm13
cmpneqsd %xmm6, %xmm11
movapd %xmm11, %xmm14
andnpd %xmm12, %xmm14
andpd %xmm13, %xmm11
orpd %xmm14, %xmm11
movaps %xmm3, %xmm12
mulsd %xmm10, %xmm12
addsd %xmm11, %xmm12
cmpneqsd %xmm6, %xmm10
movapd %xmm10, %xmm13
andnpd %xmm11, %xmm13
andpd %xmm12, %xmm10
orpd %xmm13, %xmm10
movaps %xmm4, %xmm11
mulsd %xmm9, %xmm11
addsd %xmm10, %xmm11
cmpneqsd %xmm6, %xmm9
movapd %xmm9, %xmm12
andnpd %xmm10, %xmm12
andpd %xmm11, %xmm9
orpd %xmm12, %xmm9
movaps %xmm5, %xmm10
mulsd %xmm8, %xmm10
addsd %xmm9, %xmm10
cmpneqsd %xmm6, %xmm8
movapd %xmm8, %xmm11
andnpd %xmm9, %xmm11
andpd %xmm10, %xmm8
orpd %xmm11, %xmm8
movapd %xmm0, %xmm9
mulsd %xmm7, %xmm9
addsd %xmm8, %xmm9
cmpneqsd %xmm6, %xmm7
movapd %xmm7, %xmm10
andnpd %xmm8, %xmm10
andpd %xmm9, %xmm7
orpd %xmm10, %xmm7
movq -0x70(%rbp), %r10
movq (%r10,%r8,8), %r9
addsd (%r9,%rdx,8), %xmm7
movsd %xmm7, (%r9,%rdx,8)
incq %r8
cmpq %rcx, %r8
jne 0x251e9
incq %rdx
incq %rcx
cmpq %rax, %rdx
jne 0x251de
jmp 0x250d8
movl 0x28(%rbp), %eax
testl %eax, %eax
movq -0x70(%rbp), %r10
movss -0x44(%rbp), %xmm1
jle 0x250d8
xorl %eax, %eax
leaq 0x337a2(%rip), %rcx     # 0x58c10
movq 0x18(%rbp), %rdx
movzbl (%rdx), %esi
leal -0x66(%rsi), %edi
cmpl $0xe, %edi
ja 0x25490
movslq (%rcx,%rdi,4), %rsi
addq %rcx, %rsi
movaps %xmm1, %xmm0
jmpq *%rsi
movss -0x60(%rbp), %xmm0
jmp 0x254af
movss -0x64(%rbp), %xmm0
cmpl $0x61, %esi
je 0x254af
jmp 0x254c1
movss -0x5c(%rbp), %xmm0
jmp 0x254af
movss -0x54(%rbp), %xmm0
jmp 0x254af
movss -0x58(%rbp), %xmm0
cvtss2sd %xmm0, %xmm0
movq (%r10,%rax,8), %rsi
addsd (%rsi,%rax,8), %xmm0
movsd %xmm0, (%rsi,%rax,8)
addq $0x158, %rdx            # imm = 0x158
incq %rax
cmpq %rax, -0x30(%rbp)
jne 0x25472
jmp 0x250d8
movq %r12, -0xb0(%rbp)
movq %rsp, -0x40(%rbp)
movq %rsp, %rbx
movq -0xf8(%rbp), %rax
subq %rax, %rbx
movq %rbx, %rsp
movq %rsp, %r15
subq %rax, %r15
movq %r15, %rsp
movq %rsp, %r14
subq %rax, %r14
movq %r14, %rsp
movl 0x28(%rbp), %eax
testl %eax, %eax
movq -0x30(%rbp), %rdx
jle 0x25546
leaq (,%rdx,8), %r12
xorl %r13d, %r13d
movq $0x0, (%r15,%r13,8)
movq %r12, %rdi
callq 0x21d0
movq %rax, (%r14,%r13,8)
movq %rax, %rdi
xorl %esi, %esi
movq %r12, %rdx
callq 0x2110
movq -0x30(%rbp), %rdx
incq %r13
cmpq %r13, %rdx
jne 0x25519
movl 0x28(%rbp), %eax
testl %eax, %eax
movss -0x44(%rbp), %xmm1
jle 0x25611
xorl %r12d, %r12d
leaq 0x33674(%rip), %r13     # 0x58bd4
imulq $0x158, %r12, %rax      # imm = 0x158
movq 0x18(%rbp), %rcx
movzbl (%rcx,%rax), %eax
leal -0x66(%rax), %ecx
cmpl $0xe, %ecx
ja 0x2558b
movslq (%r13,%rcx,4), %rax
addq %r13, %rax
movaps %xmm1, %xmm0
jmpq *%rax
movss -0x60(%rbp), %xmm0
jmp 0x255aa
movss -0x64(%rbp), %xmm0
cmpl $0x61, %eax
je 0x255aa
jmp 0x255b4
movss -0x5c(%rbp), %xmm0
jmp 0x255aa
movss -0x54(%rbp), %xmm0
jmp 0x255aa
movss -0x58(%rbp), %xmm0
cvtss2sd %xmm0, %xmm0
movsd %xmm0, (%r15,%r12,8)
movsd (%r15,%r12,8), %xmm0
ucomisd 0x2ba9e(%rip), %xmm0    # 0x51060
jne 0x255c6
jnp 0x25605
movq %rbx, %rdi
movq -0x88(%rbp), %rsi
movq %r15, %rdx
movl 0x28(%rbp), %ecx
callq 0x499a8
movq -0x30(%rbp), %rdx
xorl %eax, %eax
movsd (%rbx,%rax,8), %xmm0
movq (%r14,%rax,8), %rcx
movsd %xmm0, (%rcx,%r12,8)
incq %rax
cmpq %rax, %rdx
jne 0x255e1
movq $0x0, (%r15,%r12,8)
movss -0x44(%rbp), %xmm1
incq %r12
cmpq %rdx, %r12
jne 0x25560
movl 0x28(%rbp), %eax
testl %eax, %eax
jle 0x25669
movl $0x1, %r15d
xorl %r12d, %r12d
movq (%r14,%r12,8), %rdx
movq %rbx, %rdi
movq -0x88(%rbp), %rsi
movl 0x28(%rbp), %ecx
callq 0x499a8
xorl %eax, %eax
movq -0x70(%rbp), %rdx
movsd (%rbx,%rax,8), %xmm0
movq (%rdx,%rax,8), %rcx
addsd (%rcx,%r12,8), %xmm0
movsd %xmm0, (%rcx,%r12,8)
incq %rax
cmpq %rax, %r15
jne 0x2563d
incq %r12
incq %r15
movq -0x30(%rbp), %rdx
cmpq %rdx, %r12
jne 0x25621
movl 0x28(%rbp), %eax
testl %eax, %eax
jle 0x25686
movq %rdx, %r15
xorl %ebx, %ebx
movq (%r14,%rbx,8), %rdi
callq 0x2050
incq %rbx
cmpq %rbx, %r15
jne 0x25675
movq -0x40(%rbp), %rsp
movq -0x70(%rbp), %r10
movq -0xb0(%rbp), %r12
jmp 0x250d8
cmpl $0x0, 0x48(%rbp)
jne 0x256ac
leaq 0x33df5(%rip), %rdi     # 0x5949c
callq 0x2090
cmpq $0x0, -0x50(%rbp)
leaq 0x32ba1(%rip), %rax     # 0x58259
leaq 0x33dfb(%rip), %rdi     # 0x594ba
cmoveq %rax, %rdi
callq 0x2090
leaq 0x3366a(%rip), %rdi     # 0x58d39
xorl %eax, %eax
callq 0x20f0
cmpl $0x0, -0x94(%rbp)
movq -0x100(%rbp), %r12
jle 0x25721
movl -0x94(%rbp), %eax
imulq $0xc8, %rax, %r14
xorl %r15d, %r15d
leaq 0x33649(%rip), %rbx     # 0x58d46
movsd 0x20(%r12,%r15), %xmm0
movsd 0x28(%r12,%r15), %xmm1
movq %rbx, %rdi
movb $0x2, %al
callq 0x20f0
addq $0xc8, %r15
cmpq %r15, %r14
jne 0x256fd
movl $0xa, %edi
callq 0x2060
movl 0x30(%rbp), %eax
movq %rax, %r14
leal -0x14(%rax), %ebx
leaq 0x33da1(%rip), %rdi     # 0x594dc
callq 0x2090
leal -0x13(%r14), %r12d
movslq %r12d, %rax
movq %rax, -0xc8(%rbp)
movl 0x28(%rbp), %eax
leal 0x12(%rax), %ecx
movl %ecx, -0xc0(%rbp)
movslq %ebx, %rcx
cltq
movslq %r14d, %r15
decq %rax
movq %rax, -0xb8(%rbp)
xorl %r13d, %r13d
leaq 0x2ca9f(%rip), %rbx     # 0x52215
movq %rcx, -0x38(%rbp)
movq %rcx, %r14
movq %r12, -0x40(%rbp)
cmpq $0x0, -0x50(%rbp)
jne 0x257c8
cmpq -0xb8(%rbp), %r14
jge 0x257c8
movl 0x30(%rbp), %eax
addl %r13d, %eax
movl -0xc0(%rbp), %ecx
subl %eax, %ecx
leaq 0x8(,%rcx,8), %rdx
movq -0xc8(%rbp), %rax
leaq (%rax,%r13), %rdi
shlq $0x3, %rdi
movq -0x88(%rbp), %rax
addq (%rax,%r14,8), %rdi
xorl %esi, %esi
callq 0x2110
movq %r13, -0x90(%rbp)
cmpq -0x38(%rbp), %r14
jl 0x25825
movq -0x38(%rbp), %r13
movl 0x28(%rbp), %eax
testl %eax, %eax
jle 0x25810
movq -0x88(%rbp), %rcx
movq (%rcx,%r14,8), %rax
movq (%rcx,%r13,8), %rcx
xorps %xmm0, %xmm0
xorl %edx, %edx
movq -0x30(%rbp), %rsi
movsd (%rax,%rdx,8), %xmm1
mulsd (%rcx,%rdx,8), %xmm1
addsd %xmm1, %xmm0
incq %rdx
cmpq %rdx, %rsi
jne 0x257f8
jmp 0x25813
xorps %xmm0, %xmm0
movq %rbx, %rdi
movb $0x1, %al
callq 0x20f0
incq %r13
cmpl %r12d, %r13d
jne 0x257d9
movl $0xa, %edi
callq 0x2060
incq %r14
movq -0x90(%rbp), %r13
incq %r13
incq %r12
cmpq %r15, %r14
jl 0x25781
cmpq $0x0, -0x50(%rbp)
movq -0x88(%rbp), %r13
je 0x258e6
leaq 0x33c97(%rip), %rdi     # 0x594f8
callq 0x2090
leaq 0x334e4(%rip), %rbx     # 0x58d51
movq -0x38(%rbp), %r14
cmpq -0x38(%rbp), %r14
jl 0x258ca
movq -0x38(%rbp), %r12
movl 0x28(%rbp), %eax
testl %eax, %eax
jle 0x258b4
movq -0x50(%rbp), %rax
movq (%rax,%r14,8), %rax
xorps %xmm0, %xmm0
xorl %ecx, %ecx
movq -0x30(%rbp), %rsi
xorps %xmm1, %xmm1
cvtss2sd (%rax,%rcx,4), %xmm1
movq (%r13,%rcx,8), %rdx
mulsd (%rdx,%r12,8), %xmm1
addsd %xmm1, %xmm0
incq %rcx
cmpq %rcx, %rsi
jne 0x25893
jmp 0x258b7
xorps %xmm0, %xmm0
movq %rbx, %rdi
movb $0x1, %al
callq 0x20f0
incq %r12
cmpl %r12d, -0x40(%rbp)
jne 0x2587b
movl $0xa, %edi
callq 0x2060
incq %r14
movq -0x40(%rbp), %rax
incl %eax
movq %rax, -0x40(%rbp)
cmpq %r15, %r14
jl 0x25871
leaq 0x33c23(%rip), %rdi     # 0x59510
callq 0x2090
leaq 0x32d9e(%rip), %rbx     # 0x58697
movq -0x38(%rbp), %r14
movq -0x38(%rbp), %r12
movq -0x78(%rbp), %rax
movq (%rax,%r12,8), %rax
movq (%rax,%r14,8), %rax
xorps %xmm0, %xmm0
xorl %ecx, %ecx
movsd (%rax,%rcx,8), %xmm1
mulsd %xmm1, %xmm1
addsd %xmm1, %xmm0
incq %rcx
cmpq $0x3, %rcx
jne 0x25912
ucomisd 0x2b730(%rip), %xmm0    # 0x51060
jb 0x25938
sqrtsd %xmm0, %xmm0
jmp 0x2593d
callq 0x2290
movq %rbx, %rdi
movb $0x1, %al
callq 0x20f0
incq %r12
cmpq %r15, %r12
jl 0x25901
movl $0xa, %edi
callq 0x2060
incq %r14
cmpq %r15, %r14
jl 0x258fd
leaq 0x33bb6(%rip), %rdi     # 0x5951e
callq 0x2090
leaq 0x32d23(%rip), %rbx     # 0x58697
leaq 0x333dc(%rip), %r13     # 0x58d57
movq -0x38(%rbp), %r14
movq -0x38(%rbp), %r12
movq -0x80(%rbp), %rax
movq (%rax,%r12,8), %rax
movq (%rax,%r14,8), %rax
xorps %xmm0, %xmm0
xorl %ecx, %ecx
movsd (%rax,%rcx,8), %xmm1
mulsd %xmm1, %xmm1
addsd %xmm1, %xmm0
incq %rcx
cmpq $0x3, %rcx
jne 0x25994
ucomisd 0x2b6ae(%rip), %xmm0    # 0x51060
jb 0x259ba
sqrtsd %xmm0, %xmm0
jmp 0x259bf
callq 0x2290
movq %rbx, %rdi
movb $0x1, %al
callq 0x20f0
incq %r12
cmpq %r15, %r12
jl 0x25983
imulq $0x158, %r14, %rax      # imm = 0x158
movq 0x18(%rbp), %rcx
leaq (%rcx,%rax), %rdi
addq $0x60, %rdi
movq %rdi, %rsi
callq 0x108e3
ucomisd 0x2b66c(%rip), %xmm0    # 0x51060
jb 0x259fc
sqrtsd %xmm0, %xmm0
jmp 0x25a01
callq 0x2290
movq %r13, %rdi
movb $0x1, %al
callq 0x20f0
movl $0xa, %edi
callq 0x2060
incq %r14
cmpq %r15, %r14
jl 0x2597f
movq %r15, -0x40(%rbp)
leaq 0x33b09(%rip), %rdi     # 0x59535
callq 0x2090
movl $0x1, -0x30(%rbp)
movq -0x38(%rbp), %r12
movq -0x70(%rbp), %rbx
cmpq -0x38(%rbp), %r12
leaq 0x2c7ca(%rip), %r15     # 0x52215
jl 0x25a71
movl -0x30(%rbp), %r13d
movq -0x38(%rbp), %r14
movq (%rbx,%r12,8), %rax
movsd (%rax,%r14,8), %xmm0
movq %r15, %rdi
movb $0x1, %al
callq 0x20f0
incq %r14
decl %r13d
jne 0x25a55
movl $0xa, %edi
callq 0x2060
incq %r12
incl -0x30(%rbp)
cmpq -0x40(%rbp), %r12
jl 0x25a40
leaq 0x332d0(%rip), %rdi     # 0x58d5e
xorl %eax, %eax
callq 0x20f0
movl $0x58, %r14d
leaq 0x35edc(%rip), %rbx     # 0x5b97e
movq -0xe0(%rbp), %r15
movl (%r15,%r14), %esi
movq %rbx, %rdi
xorl %eax, %eax
callq 0x20f0
addq $0x70, %r14
cmpq $0x2c18, %r14           # imm = 0x2C18
jne 0x25aa9
movl $0xa, %edi
callq 0x2060
movl $0x8, %edi
callq 0x2270