// File: /workspace/github_c_makefile_star2_O3/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 $0x198, %rsp            # imm = 0x198
movss %xmm5, -0x6c(%rbp)
movss %xmm4, -0x68(%rbp)
movss %xmm3, -0x64(%rbp)
movss %xmm2, -0x70(%rbp)
movss %xmm1, -0x60(%rbp)
movss %xmm0, -0x5c(%rbp)
movq %r9, %r13
movl %r8d, -0x9c(%rbp)
movq %rcx, -0xe0(%rbp)
movq %rdx, -0x88(%rbp)
movq %rsi, -0x98(%rbp)
movq %rdi, -0x58(%rbp)
movl 0x28(%rbp), %ebx
leaq 0x350ae(%rip), %rdi     # 0x593d5
callq 0x2090
movq %rbx, %rcx
testl %ecx, %ecx
jle 0x243b2
leaq (,%rcx,8), %rbx
xorl %r14d, %r14d
movq -0x58(%rbp), %r15
movq (%r15,%r14,8), %rdi
xorl %esi, %esi
movq %rbx, %rdx
callq 0x2110
movl 0x28(%rbp), %ecx
incq %r14
cmpq %r14, %rcx
jne 0x24342
movq %rsp, %r15
leaq 0xf(,%rcx,8), %rax
andq $-0x10, %rax
subq %rax, %r15
movq %r15, %rsp
movq %rsp, %r12
subq %rax, %r12
movq %r12, %rsp
testl %ecx, %ecx
jle 0x243d0
xorl %ebx, %ebx
movl 0x30(%rbp), %r14d
movl %r14d, %edi
movl $0x3, %esi
callq 0x49804
movq %rax, (%r15,%rbx,8)
movl %r14d, %edi
movl $0x3, %esi
callq 0x49804
movl 0x28(%rbp), %ecx
movq %rax, (%r12,%rbx,8)
incq %rbx
cmpq %rbx, %rcx
jne 0x24383
jmp 0x243d0
movq %rsp, %r15
leaq 0xf(,%rcx,8), %rax
andq $-0x10, %rax
subq %rax, %r15
movq %r15, %rsp
movq %rsp, %r12
subq %rax, %r12
movq %r12, %rsp
cmpl $0x0, 0x48(%rbp)
movq %r12, -0xc0(%rbp)
movq %r15, -0xa8(%rbp)
movq %r13, -0xd8(%rbp)
je 0x24515
cmpq $0x0, -0x88(%rbp)
je 0x2458e
testl %ecx, %ecx
jle 0x248a2
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 0x244fa
imulq $0x158, %rsi, %r9       # imm = 0x158
movq (%r15,%rsi,8), %rdi
movq (%r12,%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 0x2447f
movq (%r15,%r9,8), %r14
movq (%r14,%r10,8), %r14
movq (%r12,%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 0x2445c
jmp 0x24493
xorl %r14d, %r14d
movq %rdx, (%r11,%r14,8)
movq %rdx, (%rbx,%r14,8)
incq %r14
cmpq $0x3, %r14
jne 0x24482
movq -0x88(%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 0x244aa
incq %r10
cmpq %rax, %r10
movq -0xc0(%rbp), %r12
movq -0xa8(%rbp), %r15
jne 0x2443c
incq %rsi
addq $0x158, %rcx            # imm = 0x158
movl 0x28(%rbp), %edi
cmpq %rdi, %rsi
jne 0x24416
jmp 0x248a2
testl %ecx, %ecx
jle 0x248a2
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 0x24577
movq %rsi, %rdi
movq (%r15,%rdi,8), %r8
movq (%r8,%rsi,8), %r8
movq (%r12,%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 0x2454d
incq %rdi
cmpq %rcx, %rdi
jne 0x2453a
incq %rsi
addq $0x158, %rdx            # imm = 0x158
movl 0x28(%rbp), %edi
cmpq %rdi, %rsi
jne 0x24532
jmp 0x248a2
leaq 0x34e63(%rip), %rdi     # 0x593f8
callq 0x2090
movl 0x28(%rbp), %ecx
movq %rsp, -0x108(%rbp)
movq %rsp, %rbx
leaq 0xf(,%rcx,8), %rax
andq $-0x10, %rax
subq %rax, %rbx
movq %rbx, %rsp
movq %rsp, %rdx
subq %rax, %rdx
movq %rdx, -0x30(%rbp)
movq %rdx, %rsp
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
movl %eax, -0x180(%rbp)
movl %eax, -0x160(%rbp)
movl %eax, -0x100(%rbp)
movl %eax, -0x140(%rbp)
testl %ecx, %ecx
jle 0x24894
leaq (,%rcx,8), %rax
movq %rax, -0x120(%rbp)
movq 0x18(%rbp), %rax
leaq 0x48(%rax), %rcx
movq %rcx, -0x118(%rbp)
addq $0x60, %rax
movq %rax, -0x110(%rbp)
xorl %r14d, %r14d
movq -0x30(%rbp), %r13
movq %r13, %rdi
xorl %esi, %esi
movq -0x120(%rbp), %rdx
callq 0x2110
leaq -0x180(%rbp), %rdi
leaq -0x160(%rbp), %rsi
leaq -0x100(%rbp), %rdx
leaq -0x140(%rbp), %rcx
movq 0x18(%rbp), %r8
movl %r14d, %r9d
movl 0x28(%rbp), %eax
pushq %rax
movl 0x20(%rbp), %eax
pushq %rax
callq 0x256c4
movl 0x28(%rbp), %ecx
addq $0x10, %rsp
movq (%r15,%r14,8), %rsi
movq %r14, -0x128(%rbp)
movq (%r12,%r14,8), %rdi
movslq -0x180(%rbp), %r8
movl -0x160(%rbp), %r9d
movl -0x100(%rbp), %r10d
testl %r10d, %r10d
sets %al
movl -0x140(%rbp), %r12d
cmpl %r12d, %r10d
setg %r11b
movl %r10d, %edx
orb %al, %r11b
movb %r11b, -0x80(%rbp)
imulq $0x158, %r8, %r11       # imm = 0x158
movq -0x118(%rbp), %rax
leaq (%rax,%r11), %r14
movq %r14, -0x38(%rbp)
movl %r9d, -0x48(%rbp)
movl %r9d, %r14d
subl %r8d, %r14d
incl %r14d
decl %r10d
movl %r10d, -0x3c(%rbp)
leaq (,%rdx,8), %r9
addq %r13, %r9
movq %r9, -0xb0(%rbp)
imulq $0x158, %rdx, %rdx      # imm = 0x158
leaq (%rax,%rdx), %r9
movq -0x110(%rbp), %rax
addq %rax, %r11
movq %r11, -0x78(%rbp)
addq %rax, %rdx
movq %rdx, -0xd0(%rbp)
movq %r8, -0x50(%rbp)
leaq (,%r8,8), %r15
addq %r13, %r15
movq -0x38(%rbp), %r8
xorl %r13d, %r13d
movq %rsi, -0xb8(%rbp)
movq %rdi, -0xc8(%rbp)
movl -0x48(%rbp), %eax
cmpl %eax, -0x50(%rbp)
jg 0x2474d
movq %r8, %rax
xorl %edx, %edx
movsd (%rax), %xmm0
movsd %xmm0, (%r15,%rdx,8)
incq %rdx
addq $0x158, %rax            # imm = 0x158
cmpl %edx, %r14d
jne 0x24735
movq %r8, -0x38(%rbp)
cmpb $0x0, -0x80(%rbp)
jne 0x2477d
movq %r9, %rax
movq -0xb0(%rbp), %rsi
movl -0x3c(%rbp), %edx
movsd (%rax), %xmm0
movsd %xmm0, (%rsi)
incl %edx
addq $0x8, %rsi
addq $0x158, %rax            # imm = 0x158
cmpl %edx, %r12d
jg 0x24764
movq %r9, -0x90(%rbp)
movq %rbx, %rdi
movq -0x98(%rbp), %rsi
movq -0x30(%rbp), %rdx
callq 0x49a2e
movl 0x28(%rbp), %ecx
xorl %eax, %eax
movq -0xb8(%rbp), %rsi
movsd (%rbx,%rax,8), %xmm0
movq (%rsi,%rax,8), %rdx
movsd %xmm0, (%rdx,%r13,8)
incq %rax
cmpq %rax, %rcx
jne 0x247a3
movl -0x48(%rbp), %eax
cmpl %eax, -0x50(%rbp)
jg 0x247e0
movq -0x78(%rbp), %rax
xorl %edx, %edx
movsd (%rax), %xmm0
movsd %xmm0, (%r15,%rdx,8)
incq %rdx
addq $0x158, %rax            # imm = 0x158
cmpl %edx, %r14d
jne 0x247c8
cmpb $0x0, -0x80(%rbp)
jne 0x24810
movq -0xd0(%rbp), %rax
movq -0xb0(%rbp), %rsi
movl -0x3c(%rbp), %edx
movsd (%rax), %xmm0
movsd %xmm0, (%rsi)
incl %edx
addq $0x8, %rsi
addq $0x158, %rax            # imm = 0x158
cmpl %edx, %r12d
jg 0x247f7
movq %rbx, %rdi
movq -0x98(%rbp), %rsi
movq -0x30(%rbp), %rdx
callq 0x49a2e
movl 0x28(%rbp), %ecx
xorl %eax, %eax
movq -0xc8(%rbp), %rdi
movsd (%rbx,%rax,8), %xmm0
movq (%rdi,%rax,8), %rdx
movsd %xmm0, (%rdx,%r13,8)
incq %rax
cmpq %rax, %rcx
jne 0x2482f
incq %r13
movq -0x38(%rbp), %r8
addq $0x8, %r8
movq -0x90(%rbp), %r9
addq $0x8, %r9
addq $0x8, -0x78(%rbp)
addq $0x8, -0xd0(%rbp)
cmpq $0x3, %r13
jne 0x24728
movq -0x128(%rbp), %r14
incq %r14
cmpq %rcx, %r14
movq -0xc0(%rbp), %r12
movq -0xa8(%rbp), %r15
jne 0x24617
movq -0x108(%rbp), %rsp
movq -0xd8(%rbp), %r13
movl 0x30(%rbp), %edi
movl $0x3, %esi
callq 0x49804
movq %rax, -0xb8(%rbp)
movl 0x40(%rbp), %eax
movq %rax, %rcx
movl %ecx, %eax
movq %rax, -0xb0(%rbp)
movq %rsp, %rdi
leaq 0xf(,%rax,4), %rax
andq $-0x10, %rax
subq %rax, %rdi
movq %rdi, %rsp
testl %ecx, %ecx
movq %rdi, -0xc8(%rbp)
jle 0x248fb
movq -0xb0(%rbp), %rax
leaq (,%rax,4), %rdx
xorl %esi, %esi
callq 0x2110
movl -0x9c(%rbp), %ecx
testl %ecx, %ecx
jle 0x24b85
movl 0x30(%rbp), %eax
movl %eax, %eax
movq %rax, -0x48(%rbp)
movl %ecx, %eax
movq %rax, -0xd0(%rbp)
xorl %edi, %edi
movl $0x0, -0x3c(%rbp)
imulq $0xc8, %rdi, %r14
movq -0xe0(%rbp), %rsi
movslq (%rsi,%r14), %rax
imulq $0x70, %rax, %rax
movslq 0x4(%rsi,%r14), %rcx
imulq $0x70, %rcx, %rcx
movslq 0x6c(%r13,%rax), %rdx
cmpl 0x6c(%r13,%rcx), %edx
movq %rdi, -0x90(%rbp)
jne 0x24962
movq -0xc8(%rbp), %rdi
incl (%rdi,%rdx,4)
jmp 0x24965
incl -0x3c(%rbp)
addq %r13, %rax
movl 0x5c(%rax), %edx
testl %edx, %edx
jns 0x24985
movl 0x58(%rax), %edx
movq -0xb8(%rbp), %rdi
movq %rdi, -0x30(%rbp)
movq %rdi, -0x50(%rbp)
testl %edx, %edx
js 0x24997
movl %edx, %edx
movq (%r15,%rdx,8), %rdi
movq %rdi, -0x50(%rbp)
movq (%r12,%rdx,8), %rdx
movq %rdx, -0x30(%rbp)
addq %r13, %rcx
movl 0x5c(%rcx), %edx
testl %edx, %edx
jns 0x249b2
movl 0x58(%rcx), %edx
movq -0xb8(%rbp), %r13
movq %r13, %rbx
testl %edx, %edx
js 0x249bc
movl %edx, %edx
movq (%r15,%rdx,8), %r13
movq (%r12,%rdx,8), %rbx
addq %rsi, %r14
movups (%rax), %xmm0
movaps %xmm0, -0x1c0(%rbp)
movq 0x10(%rax), %rdx
movq %rdx, -0x1b0(%rbp)
movups (%rcx), %xmm0
movaps %xmm0, -0x1a0(%rbp)
movq 0x10(%rcx), %rdx
movq %rdx, -0x190(%rbp)
xorl %edx, %edx
movsd (%rcx,%rdx,8), %xmm0
subsd (%rax,%rdx,8), %xmm0
movsd %xmm0, -0x100(%rbp,%rdx,8)
incq %rdx
cmpq $0x3, %rdx
jne 0x249eb
leaq -0x140(%rbp), %rdi
leaq -0x1a0(%rbp), %rsi
leaq -0x1c0(%rbp), %rdx
callq 0x103bb
movq %rsp, -0x78(%rbp)
movq %rsp, %r15
movq -0x48(%rbp), %rax
leaq 0xf(,%rax,8), %rax
andq $-0x10, %rax
subq %rax, %r15
movq %r15, %rsp
movl 0x30(%rbp), %eax
testl %eax, %eax
movq -0x58(%rbp), %r10
jle 0x24b53
movsd 0x28(%r14), %xmm3
movsd -0x100(%rbp), %xmm0
movsd -0xf8(%rbp), %xmm1
movsd -0xf0(%rbp), %xmm2
mulsd %xmm1, %xmm1
mulsd %xmm0, %xmm0
addsd %xmm1, %xmm0
mulsd %xmm2, %xmm2
addsd %xmm0, %xmm2
divsd %xmm2, %xmm3
movsd %xmm3, -0x80(%rbp)
movl $0x1, %r14d
xorl %r12d, %r12d
movq (%r13,%r12,8), %rax
movq -0x50(%rbp), %rcx
movq (%rcx,%r12,8), %rcx
movq (%rbx,%r12,8), %rdx
movq -0x30(%rbp), %rsi
movq (%rsi,%r12,8), %rsi
xorl %edi, %edi
movsd (%rax,%rdi), %xmm0
subsd (%rcx,%rdi), %xmm0
movsd %xmm0, -0x180(%rbp,%rdi)
movsd (%rdx,%rdi), %xmm0
subsd (%rsi,%rdi), %xmm0
movsd %xmm0, -0x160(%rbp,%rdi)
addq $0x8, %rdi
cmpq $0x18, %rdi
jne 0x24aac
leaq -0x140(%rbp), %rdi
leaq -0x180(%rbp), %rsi
callq 0x10433
movsd %xmm0, -0x38(%rbp)
leaq -0x100(%rbp), %rdi
leaq -0x160(%rbp), %rsi
callq 0x10433
movsd -0x38(%rbp), %xmm1
subsd %xmm0, %xmm1
movsd %xmm1, (%r15,%r12,8)
mulsd -0x80(%rbp), %xmm1
xorl %eax, %eax
movq -0x58(%rbp), %r10
movq (%r10,%rax,8), %rcx
movsd (%r15,%rax,8), %xmm0
mulsd %xmm1, %xmm0
addsd (%rcx,%r12,8), %xmm0
movsd %xmm0, (%rcx,%r12,8)
incq %rax
cmpq %rax, %r14
jne 0x24b21
incq %r12
incq %r14
cmpq -0x48(%rbp), %r12
jne 0x24a91
movq -0x78(%rbp), %rsp
movq -0x90(%rbp), %rdi
incq %rdi
cmpq -0xd0(%rbp), %rdi
movq -0xd8(%rbp), %r13
movq -0xc0(%rbp), %r12
movq -0xa8(%rbp), %r15
jne 0x24924
jmp 0x24b90
movl $0x0, -0x3c(%rbp)
movq -0x58(%rbp), %r10
movl 0x40(%rbp), %eax
testl %eax, %eax
jle 0x24bfd
movq 0x38(%rbp), %r14
addq $0x34, %r14
xorl %r15d, %r15d
movq -0xb0(%rbp), %r13
movq -0xc8(%rbp), %rbx
movsbl (%r14), %edx
movl (%rbx,%r15,4), %ecx
leaq 0x340f9(%rip), %rdi     # 0x58cb8
movl %r15d, %esi
xorl %eax, %eax
callq 0x20f0
incq %r15
addq $0x70, %r14
cmpq %r15, %r13
jne 0x24bb0
movl 0x40(%rbp), %eax
cmpl $0x1, %eax
movq -0x58(%rbp), %r10
movq -0xa8(%rbp), %r15
je 0x24bfd
leaq 0x340e6(%rip), %rdi     # 0x58cd5
movl -0x3c(%rbp), %esi
xorl %eax, %eax
callq 0x20f0
movq -0x58(%rbp), %r10
xorps %xmm0, %xmm0
movss -0x6c(%rbp), %xmm1
ucomiss %xmm0, %xmm1
jne 0x24d0a
jp 0x24d0a
movss -0x68(%rbp), %xmm1
ucomiss %xmm0, %xmm1
jne 0x24d0a
jp 0x24d0a
movss -0x64(%rbp), %xmm1
ucomiss %xmm0, %xmm1
jne 0x24d0a
jp 0x24d0a
movss -0x60(%rbp), %xmm1
ucomiss %xmm0, %xmm1
jne 0x24d0a
jp 0x24d0a
movss -0x5c(%rbp), %xmm1
ucomiss %xmm0, %xmm1
jne 0x24d0a
jp 0x24d0a
movss -0x70(%rbp), %xmm1
ucomiss %xmm0, %xmm1
jne 0x24d0a
jp 0x24d0a
movl 0x30(%rbp), %eax
testl %eax, %eax
jle 0x24caf
movl 0x30(%rbp), %eax
movl %eax, %eax
xorl %ecx, %ecx
testq %rcx, %rcx
je 0x24ca7
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 0x24c91
incq %rcx
cmpq %rax, %rcx
jne 0x24c86
cmpl $0x0, 0x5465a(%rip)     # 0x79310
jne 0x25299
movq -0xb8(%rbp), %rdi
movl 0x30(%rbp), %r14d
movl %r14d, %esi
callq 0x496ae
movl 0x28(%rbp), %eax
testl %eax, %eax
jle 0x24cfb
xorl %ebx, %ebx
movq (%r15,%rbx,8), %rdi
movl %r14d, %esi
callq 0x496ae
movq (%r12,%rbx,8), %rdi
movl %r14d, %esi
callq 0x496ae
incq %rbx
movl 0x28(%rbp), %eax
cmpq %rbx, %rax
jne 0x24cd8
leaq -0x28(%rbp), %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x34716(%rip), %rdi     # 0x59427
callq 0x2090
cmpl $0x0, 0x48(%rbp)
je 0x24fef
cmpq $0x0, -0x88(%rbp)
movl 0x28(%rbp), %ecx
je 0x25073
movl 0x30(%rbp), %eax
testl %eax, %eax
jle 0x2527c
xorps %xmm0, %xmm0
cvtss2sd -0x70(%rbp), %xmm0
xorps %xmm1, %xmm1
cvtss2sd -0x60(%rbp), %xmm1
cvtss2sd -0x5c(%rbp), %xmm2
cvtss2sd -0x64(%rbp), %xmm3
cvtss2sd -0x6c(%rbp), %xmm4
cvtss2sd -0x68(%rbp), %xmm5
movl %eax, %eax
movl $0x1, %ecx
xorl %edx, %edx
leaq 0x33df8(%rip), %rsi     # 0x58b68
xorpd %xmm6, %xmm6
movq -0x88(%rbp), %rdi
movq (%rdi,%rdx,8), %rdi
xorl %r8d, %r8d
movl 0x28(%rbp), %r9d
testl %r9d, %r9d
jle 0x24ea4
movq -0x88(%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 0x24df5
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 0x24e8c
cmpl $0x61, %ebx
jne 0x24e8c
movss (%rdi,%r10,4), %xmm14
mulss (%r9,%r10,4), %xmm14
cvtss2sd %xmm14, %xmm14
addsd %xmm14, %xmm8
jmp 0x24e8c
movss (%rdi,%r10,4), %xmm14
mulss (%r9,%r10,4), %xmm14
cvtss2sd %xmm14, %xmm14
addsd %xmm14, %xmm11
jmp 0x24e8c
movss (%rdi,%r10,4), %xmm14
mulss (%r9,%r10,4), %xmm14
cvtss2sd %xmm14, %xmm14
addsd %xmm14, %xmm7
jmp 0x24e8c
movss (%rdi,%r10,4), %xmm14
mulss (%r9,%r10,4), %xmm14
cvtss2sd %xmm14, %xmm14
addsd %xmm14, %xmm12
jmp 0x24e8c
movss (%rdi,%r10,4), %xmm14
mulss (%r9,%r10,4), %xmm14
cvtss2sd %xmm14, %xmm14
addsd %xmm14, %xmm9
jmp 0x24e8c
movss (%rdi,%r10,4), %xmm14
mulss (%r9,%r10,4), %xmm14
cvtss2sd %xmm14, %xmm14
addsd %xmm14, %xmm10
addq $0x158, %r11            # imm = 0x158
incq %r10
movl 0x28(%rbp), %ebx
cmpq %r10, %rbx
jne 0x24dc3
jmp 0x24ec6
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 -0x58(%rbp), %r10
movq (%r10,%r8,8), %r9
addsd (%r9,%rdx,8), %xmm7
movsd %xmm7, (%r9,%rdx,8)
incq %r8
cmpq %rcx, %r8
jne 0x24d82
incq %rdx
incq %rcx
cmpq %rax, %rdx
jne 0x24d74
jmp 0x24c78
movl 0x28(%rbp), %eax
testl %eax, %eax
movq -0x58(%rbp), %r10
jle 0x24c78
xorl %eax, %eax
leaq 0x33bd9(%rip), %rcx     # 0x58be0
movq 0x18(%rbp), %rdx
movzbl (%rdx), %esi
leal -0x66(%rsi), %edi
cmpl $0xe, %edi
ja 0x2502b
movslq (%rcx,%rdi,4), %rsi
addq %rcx, %rsi
movss -0x70(%rbp), %xmm0
jmpq *%rsi
movss -0x6c(%rbp), %xmm0
jmp 0x2504a
movss -0x68(%rbp), %xmm0
cmpl $0x61, %esi
je 0x2504a
jmp 0x2505c
movss -0x64(%rbp), %xmm0
jmp 0x2504a
movss -0x5c(%rbp), %xmm0
jmp 0x2504a
movss -0x60(%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
movl 0x28(%rbp), %esi
cmpq %rax, %rsi
jne 0x2500b
jmp 0x24c78
movq %rsp, -0x30(%rbp)
movq %rsp, %rbx
leaq 0xf(,%rcx,8), %rax
andq $-0x10, %rax
subq %rax, %rbx
movq %rbx, %rsp
movq %rsp, %rdx
subq %rax, %rdx
movq %rdx, %rsp
movq %rsp, %r15
subq %rax, %r15
movq %r15, %rsp
testl %ecx, %ecx
jle 0x25261
leaq (,%rcx,8), %r13
xorl %r14d, %r14d
movq $0x0, (%rdx,%r14,8)
movl $0x1, %edi
movq %r13, %rsi
movq %rdx, %r12
callq 0x2180
movq %r12, %rdx
movl 0x28(%rbp), %r8d
movq %rax, (%r15,%r14,8)
incq %r14
cmpq %r14, %r8
jne 0x250b1
testl %r8d, %r8d
jle 0x25261
xorps %xmm0, %xmm0
cvtss2sd -0x64(%rbp), %xmm0
movsd %xmm0, -0x50(%rbp)
xorps %xmm0, %xmm0
cvtss2sd -0x5c(%rbp), %xmm0
movsd %xmm0, -0x48(%rbp)
xorps %xmm0, %xmm0
cvtss2sd -0x70(%rbp), %xmm0
movsd %xmm0, -0x38(%rbp)
xorps %xmm0, %xmm0
cvtss2sd -0x68(%rbp), %xmm0
movsd %xmm0, -0x78(%rbp)
xorps %xmm0, %xmm0
cvtss2sd -0x6c(%rbp), %xmm0
movsd %xmm0, -0x80(%rbp)
xorps %xmm0, %xmm0
cvtss2sd -0x60(%rbp), %xmm0
movsd %xmm0, -0x90(%rbp)
xorl %r14d, %r14d
imulq $0x158, %r14, %rax      # imm = 0x158
movq 0x18(%rbp), %rcx
movzbl (%rcx,%rax), %eax
leal -0x66(%rax), %ecx
cmpl $0xe, %ecx
ja 0x25167
leaq 0x33a4d(%rip), %rsi     # 0x58ba4
movslq (%rsi,%rcx,4), %rax
addq %rsi, %rax
jmpq *%rax
movsd -0x38(%rbp), %xmm0
jmp 0x25198
cmpl $0x61, %eax
jne 0x25173
movsd -0x78(%rbp), %xmm0
jmp 0x25198
movsd (%rdx,%r14,8), %xmm0
jmp 0x2519e
movsd -0x80(%rbp), %xmm0
jmp 0x25198
movsd -0x50(%rbp), %xmm0
jmp 0x25198
movsd -0x48(%rbp), %xmm0
jmp 0x25198
movsd -0x90(%rbp), %xmm0
movsd %xmm0, (%rdx,%r14,8)
ucomisd 0x2bfd2(%rip), %xmm0    # 0x51178
jne 0x251aa
jnp 0x251e4
movq %rbx, %rdi
movq -0x98(%rbp), %rsi
movl %r8d, %ecx
callq 0x49a2e
movl 0x28(%rbp), %r8d
xorl %eax, %eax
movsd (%rbx,%rax,8), %xmm0
movq (%r15,%rax,8), %rcx
movsd %xmm0, (%rcx,%r14,8)
incq %rax
cmpq %rax, %r8
jne 0x251c2
movq %r12, %rdx
movq $0x0, (%r12,%r14,8)
incq %r14
cmpq %r8, %r14
jne 0x25139
testl %r8d, %r8d
jle 0x25261
movl $0x1, %r14d
xorl %r12d, %r12d
movq (%r15,%r12,8), %rdx
movq %rbx, %rdi
movq -0x98(%rbp), %rsi
movl %r8d, %ecx
callq 0x49a2e
xorl %eax, %eax
movq -0x58(%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, %r14
jne 0x2521a
incq %r12
incq %r14
movl 0x28(%rbp), %r8d
cmpq %r8, %r12
jne 0x251fe
testl %r8d, %r8d
jle 0x25261
xorl %ebx, %ebx
movq (%r15,%rbx,8), %rdi
callq 0x2050
incq %rbx
movl 0x28(%rbp), %eax
cmpq %rbx, %rax
jne 0x2524d
movq -0x30(%rbp), %rsp
movq -0x58(%rbp), %r10
movq -0xc0(%rbp), %r12
movq -0xa8(%rbp), %r15
jmp 0x24c78
cmpl $0x0, 0x5408d(%rip)     # 0x79310
je 0x24cbc
leaq 0x341d3(%rip), %rdi     # 0x59463
movl $0x0, -0x48(%rbp)
jmp 0x252cb
cmpl $0x0, 0x48(%rbp)
jne 0x252ab
leaq 0x3419f(%rip), %rdi     # 0x59445
callq 0x2090
cmpq $0x0, -0x88(%rbp)
sete %al
movl %eax, -0x48(%rbp)
leaq 0x32f59(%rip), %rax     # 0x58219
leaq 0x3419c(%rip), %rdi     # 0x59463
cmoveq %rax, %rdi
callq 0x2090
leaq 0x33a16(%rip), %rdi     # 0x58ced
xorl %eax, %eax
callq 0x20f0
cmpl $0x0, -0x9c(%rbp)
movq -0xe0(%rbp), %r12
jle 0x25329
movl -0x9c(%rbp), %eax
imulq $0xc8, %rax, %r14
xorl %r15d, %r15d
leaq 0x339f5(%rip), %rbx     # 0x58cfa
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 0x25305
movl $0xa, %edi
callq 0x2060
movl 0x30(%rbp), %eax
movq %rax, %r14
leal -0x14(%rax), %ebx
leaq 0x34142(%rip), %rdi     # 0x59485
callq 0x2090
leal -0x13(%r14), %eax
movl %eax, -0x38(%rbp)
movslq %eax, %r12
movl 0x28(%rbp), %eax
leal 0x12(%rax), %ecx
movl %ecx, -0x78(%rbp)
movslq %ebx, %r13
cltq
movslq %r14d, %r15
decq %rax
movq %rax, -0x80(%rbp)
xorl %r14d, %r14d
leaq 0x2cf15(%rip), %rbx     # 0x52289
movq %r13, -0x30(%rbp)
movq %r12, -0x90(%rbp)
cmpq -0x80(%rbp), %r13
setl %al
andb -0x48(%rbp), %al
cmpb $0x1, %al
jne 0x253c1
movl 0x30(%rbp), %eax
addl %r14d, %eax
movl -0x78(%rbp), %ecx
subl %eax, %ecx
leaq 0x8(,%rcx,8), %rdx
movq -0x90(%rbp), %rax
leaq (%r14,%rax), %rdi
shlq $0x3, %rdi
movq -0x98(%rbp), %rax
addq (%rax,%r13,8), %rdi
xorl %esi, %esi
callq 0x2110
movq %r14, -0x50(%rbp)
cmpq -0x30(%rbp), %r13
jl 0x25417
movq -0x30(%rbp), %r14
movl 0x28(%rbp), %esi
testl %esi, %esi
jle 0x25402
movq -0x98(%rbp), %rcx
movq (%rcx,%r13,8), %rax
movq (%rcx,%r14,8), %rcx
xorps %xmm0, %xmm0
xorl %edx, %edx
movsd (%rax,%rdx,8), %xmm1
mulsd (%rcx,%rdx,8), %xmm1
addsd %xmm1, %xmm0
incq %rdx
cmpq %rdx, %rsi
jne 0x253ea
jmp 0x25405
xorps %xmm0, %xmm0
movq %rbx, %rdi
movb $0x1, %al
callq 0x20f0
incq %r14
cmpl %r12d, %r14d
jne 0x253cf
movl $0xa, %edi
callq 0x2060
incq %r13
movq -0x50(%rbp), %r14
incq %r14
incq %r12
cmpq %r15, %r13
jl 0x2537f
cmpb $0x0, -0x48(%rbp)
movq -0x98(%rbp), %r13
jne 0x254cc
leaq 0x34052(%rip), %rdi     # 0x594a1
callq 0x2090
leaq 0x338aa(%rip), %rbx     # 0x58d05
movq -0x30(%rbp), %r14
cmpq -0x30(%rbp), %r14
jl 0x254b7
movq -0x30(%rbp), %r12
movl 0x28(%rbp), %esi
testl %esi, %esi
jle 0x254a1
movq -0x88(%rbp), %rax
movq (%rax,%r14,8), %rax
xorps %xmm0, %xmm0
xorl %ecx, %ecx
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 0x25480
jmp 0x254a4
xorps %xmm0, %xmm0
movq %rbx, %rdi
movb $0x1, %al
callq 0x20f0
incq %r12
cmpl %r12d, -0x38(%rbp)
jne 0x25469
movl $0xa, %edi
callq 0x2060
incq %r14
incl -0x38(%rbp)
cmpq %r15, %r14
jl 0x2545f
leaq 0x33fe6(%rip), %rdi     # 0x594b9
callq 0x2090
leaq 0x3318e(%rip), %rbx     # 0x5866d
movq -0x30(%rbp), %r14
movq -0x30(%rbp), %r12
movq -0xa8(%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 0x254fb
ucomisd 0x2bc5f(%rip), %xmm0    # 0x51178
jb 0x25521
sqrtsd %xmm0, %xmm0
jmp 0x25526
callq 0x22a0
movq %rbx, %rdi
movb $0x1, %al
callq 0x20f0
incq %r12
cmpq %r15, %r12
jl 0x254e7
movl $0xa, %edi
callq 0x2060
incq %r14
cmpq %r15, %r14
jl 0x254e3
leaq 0x33f76(%rip), %rdi     # 0x594c7
callq 0x2090
leaq 0x33110(%rip), %rbx     # 0x5866d
leaq 0x337a7(%rip), %r12     # 0x58d0b
movq -0x30(%rbp), %r14
movq -0x30(%rbp), %r13
movq -0xc0(%rbp), %rax
movq (%rax,%r13,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 0x25580
ucomisd 0x2bbda(%rip), %xmm0    # 0x51178
jb 0x255a6
sqrtsd %xmm0, %xmm0
jmp 0x255ab
callq 0x22a0
movq %rbx, %rdi
movb $0x1, %al
callq 0x20f0
incq %r13
cmpq %r15, %r13
jl 0x2556c
imulq $0x158, %r14, %rax      # imm = 0x158
movq 0x18(%rbp), %rcx
leaq (%rcx,%rax), %rdi
addq $0x60, %rdi
movq %rdi, %rsi
callq 0x10433
ucomisd 0x2bb98(%rip), %xmm0    # 0x51178
jb 0x255e8
sqrtsd %xmm0, %xmm0
jmp 0x255ed
callq 0x22a0
movq %r12, %rdi
movb $0x1, %al
callq 0x20f0
movl $0xa, %edi
callq 0x2060
incq %r14
cmpq %r15, %r14
jl 0x25568
movq %r15, -0x50(%rbp)
leaq 0x33ec6(%rip), %rdi     # 0x594de
callq 0x2090
movl $0x1, -0x38(%rbp)
movq -0x30(%rbp), %r12
movq -0x58(%rbp), %rbx
cmpq -0x30(%rbp), %r12
leaq 0x2cc52(%rip), %r15     # 0x52289
jl 0x2565d
movl -0x38(%rbp), %r13d
movq -0x30(%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 0x25641
movl $0xa, %edi
callq 0x2060
incq %r12
incl -0x38(%rbp)
cmpq -0x50(%rbp), %r12
jl 0x2562c
leaq 0x33698(%rip), %rdi     # 0x58d12
xorl %eax, %eax
callq 0x20f0
movl $0x58, %r14d
leaq 0x362a8(%rip), %rbx     # 0x5b936
movq -0xd8(%rbp), %r15
movl (%r15,%r14), %esi
movq %rbx, %rdi
xorl %eax, %eax
callq 0x20f0
addq $0x70, %r14
cmpq $0x2c18, %r14           # imm = 0x2C18
jne 0x25695
movl $0xa, %edi
callq 0x2060
movl $0x8, %edi
callq 0x2280