// File: /workspace/github_c_makefile_star2_O3/ugobas[P]tnm/main_tnm.c
// Function: Print_thermal
double Print_thermal(int anharmonic, FILE *file_out,
		     struct Normal_Mode NM, char *out_B,
		     struct axe *axes, int N_main,
		     int N_res, int Nchain,
		     struct Normal_Mode NM_unfold,
		     int N_int_unfold, int N_int, 
		     double E_cont_unfold, int FOLDING,
		     struct Normal_Mode NM_apo, int N_int_inter,
		     double Econt_bind, int BINDING,
		     float *mass_coord, int *Cart_interface, int N_Cart_inter,
		     int *rigid_inter, int N_rigid)
{
  float *sigma2; char name[80]="";
  if(anharmonic){
    sigma2=NM.sigma2_anhar; strcpy(name, "anhar");
    fprintf(file_out, "# Anharmonic correction:\n");
  }else{
    sigma2=NM.sigma2;
    fprintf(file_out, "#\n# Harmonic approximation:\n");
  }

  double k_Therm=Collectivity_norm1(sigma2, NM.N); //Renyi
  fprintf(file_out, "Recp.Coll(therm)      %.0f\n", k_Therm);
  /*fprintf(file_out, "Area(therm)           %.3f\n",
    Area_norm1(NM.sigma2, NM.N));*/

  double Mean_Cart_coll=0, sum_w=0; int ia, i;
  for(ia=0; ia<NM.N; ia++){
    float w=sigma2[ia];
    Mean_Cart_coll+=NM.Cart_coll[ia]*w; sum_w+=w;
  }
  if(sum_w)Mean_Cart_coll/=sum_w;
  fprintf(file_out, "Ave_collectivity_NM   %.3f\n", Mean_Cart_coll);
  /*
  Coll_thr_cc=Mean_Cart_coll*0.6666;
  int N_modes_coll=0;
  for(ia=0; ia<NM.N; ia++){
    if((NM.select[ia])&&(NM.Cart_coll[ia] >= Coll_thr_cc))N_modes_coll++;
  }
  fprintf(file_out, "Num.collective_modes  %d\n", N_modes_coll);
  fprintf(file_out, "Threshold_collectivity %.3f\n", Coll_thr_cc);
  */
  double Free_Ene_holo=0, Free_Ene_holo_rigid=0;

  {  /* Harmonic entropy quantum
	h/= 1.055 e-34 J.sec
	h = 6.626 e-34 J.sec
	k_B T at 293K = 1.381 e-23 *293= 4.05e-21 J
	/h/k_BT = 0.260e-13 s^(-1) = 2.6 ps
	h/k_BT = 1.637e-13 s^(-1) = 0.1636 ps
	omega_q = kBT/h/ = 6.1 ps^(-1)
	(agrees with K. Hinsen)

	Our internal units of time are:
	[t]=[m l^2/E]^(1/2)
	Energy unit: kT= 4.05e-21 J at T=293
	Mass unit: Atomic mass 1.66e-27 kg
	mass/Energy: 0.4099e-6 sqrt: 0.64 e-3
	//sqrt(k_B T/M)= sqrt(4.05e-21 J/1.66e-27 Kg)=1562
	length unit = e-10 m
	time unit: 0.64 e-13 = 6.4 e-12 = 6.4 ps
	Frequency unit: 0.156 ps^(-1)
	omega_q = 39 internal units
	1/(omega_q)^2= 0.00065 in internal units 

	Other constants:
	Avogadro number NA= 6.02e+23
	Gas constant R= 8.314 J/(K*mol) 

     */

    double omega_q=6.1*(Temp_comp/293)/Freq_unit;
    double beta_omega=1./omega_q;
    double entropy=
      Compute_entropy(&Free_Ene_holo, &Free_Ene_holo_rigid,
		      NM, sigma2, beta_omega, NULL, NULL, 0, NULL, 0);
    if(anharmonic==0){
      fprintf(file_out,"kT/h=                %.4g\n", omega_q);
    }
    int m=0, k; for(k=0; k<NM.N; k++){if(NM.omega[k]>omega_q)break; m++;}
    fprintf(file_out, "Quantum modes:        %d / %d\n", NM.N-m, NM.N);
    fprintf(file_out, "Entropy per res       %.4g", entropy/N_res);
    if(BINDING){fprintf(file_out, " (holo)");}
    fprintf(file_out, "\n");
    fprintf(file_out, "Free energy per res   %.4g", Free_Ene_holo/N_res);
    if(BINDING){fprintf(file_out, " (holo)");}
    fprintf(file_out, "\n");

    if(FOLDING){
      float *s2_unfold;
      if(anharmonic){s2_unfold=NM_unfold.sigma2_anhar;}
      else{s2_unfold=NM_unfold.sigma2;}
      double Free_Ene_unfold=0, Free_Ene_unfold_rigid=0;
      double entropy_unfold= 
	Compute_entropy(&Free_Ene_unfold, &Free_Ene_unfold_rigid, NM,
			s2_unfold, beta_omega, NULL, NULL, 0, NULL, 0);
      fprintf(file_out, "Unfolded contacts:   %d\n", N_int_unfold);
      fprintf(file_out, "Contact energy unfold %.4g\n", E_cont_unfold);
      fprintf(file_out, "Entropy per res       %.4g (unfolded)\n",
	      (entropy_unfold)/N_res);
      fprintf(file_out, "Free energy per res   %.4g (unfolded)\n",
	      Free_Ene_unfold/N_res);
      double DG_NM_unfold=(Free_Ene_holo-Free_Ene_unfold)/N_res;
      fprintf(file_out, "Unfold free energy NM  %.4g\n", DG_NM_unfold);
      fprintf(file_out, "Unfold entropy NM      %.4g\n",
	      (entropy_unfold-entropy)/N_res);


      //float r0=pow(N_res, 1/3);
      //float c=(float)N_int/(float)N_res;
      //float Surf=(cont_inf -c)*r0*r0;
      float Surf=N_res-N_int_long/cont_inf;


      //float c_1=(float)N_int_unfold/(float)N_res;
      //float Surf_1=(3.94 -c_1)*r0*r0;

      fprintf(file_out, "SASA diff unfold       %.4g\n",
	      N_res-Surf);
    }
  
    if(BINDING){
      float *s2_apo;
      if(anharmonic){s2_apo=NM_apo.sigma2_anhar;}
      else{s2_apo=NM_apo.sigma2;}
      entropy= //double entropy_holo=
	Compute_entropy(&Free_Ene_holo, &Free_Ene_holo_rigid, NM, sigma2,
			beta_omega, mass_coord, Cart_interface, N_Cart_inter,
			rigid_inter, N_rigid);
      double Free_Ene_apo=0, Free_Ene_apo_rigid=0;
      entropy=
	Compute_entropy(&Free_Ene_apo, &Free_Ene_apo_rigid, NM_apo, s2_apo,
			beta_omega, mass_coord, Cart_interface, N_Cart_inter,
			rigid_inter, N_rigid);
      fprintf(file_out, "Interface contacts:   %d\n", N_int_inter);
      fprintf(file_out, "Entropy per res       %.4g (apo, interface)\n",
	      (entropy)/N_res);
      fprintf(file_out, "Free energy per res   %.4g (apo, intern)\n",
	      Free_Ene_apo/N_res);
      fprintf(file_out, "Free energy rigid     %.4g (apo, /nrigid)\n",
	      Free_Ene_apo_rigid/N_rigid);
      DG_NM_internal=(Free_Ene_holo-Free_Ene_apo)/N_res;
      DG_NM_rigid=(Free_Ene_holo_rigid-Free_Ene_apo_rigid)/N_res;
      //N_rigid_inter;
      Free_Ene_holo/=N_res;

      fprintf(file_out, "Binding free energy NM  %.4g (internal, /Nres)\n",
	      DG_NM_internal);
      fprintf(file_out, "Binding free energy NM  %.4g (rigid body, /nrigid)\n",
	      DG_NM_rigid);

      //fprintf(file_out, "Binding entropy NM      %.4g\n",
      //	      entropy_holo-entropy);
      fprintf(file_out, "Binding free energy cont %.4g\n", Econt_bind);

      int N_int=N_cont_long_1+N_cont_long_2+N_int_inter;
      float Surf=N_res_1+N_res_2-N_int/cont_inf;
      float Surf_1=N_res_1-N_cont_long_1/cont_inf;
      float Surf_2=N_res_2-N_cont_long_2/cont_inf;

      fprintf(file_out, "SASA difference          %.4g\n",
	      Surf_1+Surf_2-Surf);
    }
  }

  fprintf(file_out, "%s", out_B);

  // Rigid body degrees of freedom
  if(Nchain>1){
    double tra=0, rot=0, all=0;
    for(ia=0; ia<NM.N; ia++){
      float *v=NM.MW_Tors[ia];
      double tra_ia=0, rot_ia=0;
      for(i=0; i<N_main; i++){
	if(axes[i].rigid){
	  if(axes[i].type=='l'){tra_ia+=(*v)*(*v);}
	  else{rot_ia += (*v)*(*v);}
	}
	v++;
      }
      tra+=tra_ia*sigma2[ia];
      rot+=rot_ia*sigma2[ia];
      all+=sigma2[ia];
    }
    fprintf(file_out, "Fraction_RB_tra       %.3g\n", tra/all);
    fprintf(file_out, "Fraction_RB_rot       %.3g\n", rot/all);
  }
  return(Free_Ene_holo);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x158, %rsp            # imm = 0x158
movsd %xmm1, 0x140(%rsp)
movsd %xmm0, 0x108(%rsp)
movl %r9d, 0xfc(%rsp)
movl %r8d, 0x114(%rsp)
movq %rcx, 0x138(%rsp)
movq %rdx, 0x148(%rsp)
movq %rsi, %rbx
movl %edi, %r13d
leaq 0x190(%rsp), %rbp
testl %edi, %edi
je 0xa1f9
movq 0x88(%rbp), %r15
leaq 0x47fd9(%rip), %rdi     # 0x521cb
movl $0x19, %esi
jmp 0xa209
movq 0x28(%rbp), %r15
leaq 0x47fe1(%rip), %rdi     # 0x521e5
movl $0x1c, %esi
movl $0x1, %edx
movq %rbx, %rcx
callq 0x2290
movl (%rbp), %r12d
movq %r15, %rdi
movl %r12d, %esi
callq 0x10b2f
cvtss2sd %xmm0, %xmm0
leaq 0x47fd2(%rip), %rsi     # 0x52202
movq %rbx, %rdi
movb $0x1, %al
callq 0x21a0
testl %r12d, %r12d
jle 0xa26c
movq 0x68(%rbp), %rax
xorpd %xmm1, %xmm1
xorl %ecx, %ecx
movss (%r15,%rcx,4), %xmm0
movss (%rax,%rcx,4), %xmm2
mulss %xmm0, %xmm2
unpcklps %xmm2, %xmm0            # xmm0 = xmm0[0],xmm2[0],xmm0[1],xmm2[1]
cvtps2pd %xmm0, %xmm0
addpd %xmm0, %xmm1
incq %rcx
cmpq %rcx, %r12
jne 0xa249
jmp 0xa270
xorpd %xmm1, %xmm1
movapd %xmm1, %xmm2
unpckhpd %xmm1, %xmm2            # xmm2 = xmm2[1],xmm1[1]
movapd %xmm2, %xmm3
divsd %xmm1, %xmm3
xorps %xmm0, %xmm0
cmpneqsd %xmm1, %xmm0
andpd %xmm0, %xmm3
andnpd %xmm2, %xmm0
orpd %xmm3, %xmm0
leaq 0x47f83(%rip), %rsi     # 0x5221e
movq %rbx, %rdi
movb $0x1, %al
callq 0x21a0
xorl %r14d, %r14d
leaq 0x100(%rsp), %rax
movq %r14, (%rax)
leaq 0x130(%rsp), %rdx
movss 0x5ced1(%rip), %xmm0    # 0x67194
divss 0x46e61(%rip), %xmm0    # 0x5112c
xorps %xmm1, %xmm1
cvtss2sd %xmm0, %xmm1
mulsd 0x46e8e(%rip), %xmm1    # 0x51168
xorps %xmm0, %xmm0
cvtss2sd 0x5ceb7(%rip), %xmm0    # 0x6719c
movq %r14, (%rdx)
divsd %xmm0, %xmm1
movsd 0x46e54(%rip), %xmm0    # 0x51148
movsd %xmm1, 0xe0(%rsp)
divsd %xmm1, %xmm0
movl $0x1a, %ecx
movq %rsp, %rdi
movq %rbp, %rsi
rep  movsq (%rsi), %es:(%rdi)
movq %r14, 0xd0(%rsp)
movl $0x0, 0xd8(%rsp)
movq %rax, %rdi
movq %rdx, %rsi
movq %r15, %rdx
movsd %xmm0, 0xf0(%rsp)
xorl %ecx, %ecx
xorl %r8d, %r8d
xorl %r9d, %r9d
callq 0xaa74
movsd %xmm0, 0x120(%rsp)
movl %r13d, 0xf8(%rsp)
testl %r13d, %r13d
jne 0xa371
leaq 0x47edc(%rip), %rsi     # 0x5223a
movq %rbx, %rdi
movsd 0xe0(%rsp), %xmm0
movb $0x1, %al
callq 0x21a0
movl 0x428(%rsp), %r13d
testl %r12d, %r12d
jle 0xa3a8
movq 0x18(%rbp), %rax
xorl %r14d, %r14d
movsd 0xe0(%rsp), %xmm1
xorps %xmm0, %xmm0
cvtss2sd (%rax,%r14,4), %xmm0
ucomisd %xmm1, %xmm0
ja 0xa3a8
incq %r14
cmpq %r14, %r12
jne 0xa38e
movl %r12d, %r14d
movl 0x348(%rsp), %ebp
movl %r12d, %edx
subl %r14d, %edx
leaq 0x47e99(%rip), %rsi     # 0x52255
movq %rbx, %rdi
movl %r12d, %ecx
xorl %eax, %eax
callq 0x21a0
xorps %xmm1, %xmm1
cvtsi2sdl 0xfc(%rsp), %xmm1
movsd %xmm1, 0xe0(%rsp)
movsd 0x120(%rsp), %xmm0
divsd %xmm1, %xmm0
leaq 0x47e82(%rip), %rsi     # 0x52274
movq %rbx, %rdi
movb $0x1, %al
callq 0x21a0
testl %r13d, %r13d
je 0xa46d
leaq 0x47e87(%rip), %r14     # 0x5228f
movl $0x7, %esi
movl $0x1, %edx
movq %r14, %rdi
movq %rbx, %rcx
callq 0x2290
movl $0xa, %edi
movq %rbx, %rsi
callq 0x2140
movsd 0x100(%rsp), %xmm0
movsd %xmm0, 0xe8(%rsp)
divsd 0xe0(%rsp), %xmm0
leaq 0x47e4b(%rip), %rsi     # 0x52297
movq %rbx, %rdi
movb $0x1, %al
callq 0x21a0
movl $0x7, %esi
movl $0x1, %edx
movq %r14, %rdi
movq %rbx, %rcx
callq 0x2290
jmp 0xa4a6
movl $0xa, %edi
movq %rbx, %rsi
callq 0x2140
movsd 0x100(%rsp), %xmm0
movsd %xmm0, 0xe8(%rsp)
divsd 0xe0(%rsp), %xmm0
leaq 0x47dfb(%rip), %rsi     # 0x52297
movq %rbx, %rdi
movb $0x1, %al
callq 0x21a0
movl $0xa, %edi
movq %rbx, %rsi
callq 0x2140
testl %ebp, %ebp
je 0xa654
movl 0x338(%rsp), %ebp
leaq 0x268(%rsp), %rax
leaq 0x88(%rax), %rcx
addq $0x28, %rax
cmpl $0x0, 0xf8(%rsp)
cmovneq %rcx, %rax
movq (%rax), %rdx
xorl %r8d, %r8d
leaq 0x150(%rsp), %r14
movq %r8, (%r14)
leaq 0x128(%rsp), %rax
movq %r8, (%rax)
movl $0x1a, %ecx
movq %rsp, %rdi
leaq 0x190(%rsp), %rsi
rep  movsq (%rsi), %es:(%rdi)
movq %r8, 0xd0(%rsp)
movl $0x0, 0xd8(%rsp)
movq %r14, %rdi
movq %rax, %rsi
movsd 0xf0(%rsp), %xmm0
xorl %ecx, %ecx
xorl %r8d, %r8d
xorl %r9d, %r9d
callq 0xaa74
movsd %xmm0, 0x118(%rsp)
leaq 0x47d63(%rip), %rsi     # 0x522b2
movq %rbx, %rdi
movl %ebp, %edx
xorl %eax, %eax
callq 0x21a0
leaq 0x47d69(%rip), %rsi     # 0x522cb
movq %rbx, %rdi
movsd 0x108(%rsp), %xmm0
movb $0x1, %al
callq 0x21a0
movsd 0x118(%rsp), %xmm0
divsd 0xe0(%rsp), %xmm0
leaq 0x47d59(%rip), %rsi     # 0x522e7
movq %rbx, %rdi
movb $0x1, %al
callq 0x21a0
movsd (%r14), %xmm0
movsd %xmm0, 0x108(%rsp)
divsd 0xe0(%rsp), %xmm0
leaq 0x47d58(%rip), %rsi     # 0x5230e
movq %rbx, %rdi
movb $0x1, %al
callq 0x21a0
movsd 0xe8(%rsp), %xmm0
subsd 0x108(%rsp), %xmm0
divsd 0xe0(%rsp), %xmm0
leaq 0x47d53(%rip), %rsi     # 0x52335
movq %rbx, %rdi
movb $0x1, %al
callq 0x21a0
movsd 0x118(%rsp), %xmm0
subsd 0x120(%rsp), %xmm0
divsd 0xe0(%rsp), %xmm0
leaq 0x47d44(%rip), %rsi     # 0x52352
movq %rbx, %rdi
movb $0x1, %al
callq 0x21a0
xorps %xmm0, %xmm0
cvtsi2ssl 0xfc(%rsp), %xmm0
cvtsi2ssl 0x5f7f4(%rip), %xmm1 # 0x69e20
divss 0x5cbf4(%rip), %xmm1    # 0x67228
subss %xmm0, %xmm1
addss %xmm0, %xmm1
xorps %xmm0, %xmm0
cvtss2sd %xmm1, %xmm0
leaq 0x47d25(%rip), %rsi     # 0x5236f
movq %rbx, %rdi
movb $0x1, %al
callq 0x21a0
movl 0x260(%rsp), %ebp
testl %r13d, %r13d
je 0xa942
movl 0x450(%rsp), %edx
movq 0x448(%rsp), %r11
movl 0x440(%rsp), %r9d
movq 0x438(%rsp), %r8
movq 0x430(%rsp), %r10
movl 0x420(%rsp), %r13d
leaq 0x350(%rsp), %r14
leaq 0x88(%r14), %rax
leaq 0x28(%r14), %rcx
cmpl $0x0, 0xf8(%rsp)
cmoveq %rcx, %rax
movq (%rax), %rbp
movl $0x1a, %ecx
movq %rsp, %rdi
leaq 0x190(%rsp), %rsi
rep  movsq (%rsi), %es:(%rdi)
movl %edx, 0xd8(%rsp)
movq %r11, 0xd0(%rsp)
leaq 0x100(%rsp), %rdi
leaq 0x130(%rsp), %rsi
movq %r15, %rdx
movsd 0xf0(%rsp), %xmm0
movq %r10, %rcx
callq 0xaa74
xorl %eax, %eax
leaq 0x150(%rsp), %r8
movq %rax, (%r8)
leaq 0x128(%rsp), %rdx
movq %rax, (%rdx)
movl $0x1a, %ecx
movq %rsp, %rdi
movq %r14, %rsi
rep  movsq (%rsi), %es:(%rdi)
movl 0x450(%rsp), %eax
movl %eax, 0xd8(%rsp)
movq 0x448(%rsp), %rax
movq %rax, 0xd0(%rsp)
movq %r8, %rdi
movq %r8, %r14
movq %rdx, %rsi
movq %rbp, %rdx
movl 0x260(%rsp), %ebp
movsd 0xf0(%rsp), %xmm0
movq 0x430(%rsp), %rcx
movq 0x438(%rsp), %r8
movl 0x440(%rsp), %r9d
callq 0xaa74
movsd %xmm0, 0xe8(%rsp)
leaq 0x47c04(%rip), %rsi     # 0x5238c
movq %rbx, %rdi
movl %r13d, %edx
xorl %eax, %eax
callq 0x21a0
movsd 0xe8(%rsp), %xmm0
divsd 0xe0(%rsp), %xmm0
leaq 0x47bf8(%rip), %rsi     # 0x523a6
movq %rbx, %rdi
movb $0x1, %al
callq 0x21a0
movsd (%r14), %xmm0
movsd %xmm0, 0xe8(%rsp)
divsd 0xe0(%rsp), %xmm0
leaq 0x47bfd(%rip), %rsi     # 0x523d3
movq %rbx, %rdi
movb $0x1, %al
callq 0x21a0
leaq 0x128(%rsp), %rax
movsd (%rax), %xmm0
movsd %xmm0, 0xf0(%rsp)
cvtsi2sdl 0x450(%rsp), %xmm1
divsd %xmm1, %xmm0
leaq 0x47bf4(%rip), %rsi     # 0x523fd
movq %rbx, %rdi
movb $0x1, %al
callq 0x21a0
leaq 0x100(%rsp), %rax
movsd (%rax), %xmm2
movapd %xmm2, %xmm0
subsd 0xe8(%rsp), %xmm0
movsd 0xe0(%rsp), %xmm3
divsd %xmm3, %xmm0
movsd %xmm0, 0x5e76f(%rip)    # 0x68fb0
leaq 0x130(%rsp), %rax
movsd (%rax), %xmm1
subsd 0xf0(%rsp), %xmm1
divsd %xmm3, %xmm1
movsd %xmm1, 0x5e756(%rip)    # 0x68fb8
divsd %xmm3, %xmm2
movsd %xmm2, 0xe8(%rsp)
leaq 0x47bb2(%rip), %rsi     # 0x52428
movq %rbx, %rdi
movb $0x1, %al
callq 0x21a0
movsd 0x5e730(%rip), %xmm0    # 0x68fb8
leaq 0x47bc9(%rip), %rsi     # 0x52458
movq %rbx, %rdi
movb $0x1, %al
callq 0x21a0
leaq 0x47bec(%rip), %rsi     # 0x5248c
movq %rbx, %rdi
movsd 0x140(%rsp), %xmm0
movb $0x1, %al
callq 0x21a0
movl 0x5e863(%rip), %eax     # 0x6911c
movl 0x5e861(%rip), %ecx     # 0x69120
addl %eax, %r13d
movl 0x5e84c(%rip), %edx     # 0x69114
movl 0x5e84a(%rip), %esi     # 0x69118
leal (%rsi,%rdx), %edi
xorps %xmm0, %xmm0
cvtsi2ss %edi, %xmm0
addl %ecx, %r13d
xorps %xmm1, %xmm1
cvtsi2ss %r13d, %xmm1
movss 0x5c93d(%rip), %xmm2    # 0x67228
divss %xmm2, %xmm1
subss %xmm0, %xmm1
movd %esi, %xmm0
movd %edx, %xmm3
punpckldq %xmm0, %xmm3    # xmm3 = xmm3[0],xmm0[0],xmm3[1],xmm0[1]
cvtdq2ps %xmm3, %xmm0
movd %ecx, %xmm3
movd %eax, %xmm4
punpckldq %xmm3, %xmm4    # xmm4 = xmm4[0],xmm3[0],xmm4[1],xmm3[1]
cvtdq2ps %xmm4, %xmm3
shufps $0x0, %xmm2, %xmm2      # xmm2 = xmm2[0,0,0,0]
divps %xmm2, %xmm3
subps %xmm3, %xmm0
movaps %xmm0, %xmm2
shufps $0x55, %xmm0, %xmm2     # xmm2 = xmm2[1,1],xmm0[1,1]
addss %xmm0, %xmm2
addss %xmm1, %xmm2
xorps %xmm0, %xmm0
cvtss2sd %xmm2, %xmm0
leaq 0x47b73(%rip), %rsi     # 0x524ab
movq %rbx, %rdi
movb $0x1, %al
callq 0x21a0
movq 0x148(%rsp), %rdi
movq %rbx, %rsi
callq 0x2100
cmpl $0x2, %ebp
jl 0xaa59
testl %r12d, %r12d
jle 0xaa04
leaq 0x190(%rsp), %rax
movq 0x48(%rax), %rax
movl 0x114(%rsp), %r9d
movl %r9d, %ecx
movq 0x138(%rsp), %r10
addq $0x4, %r10
xorpd %xmm5, %xmm5
xorl %edx, %edx
xorps %xmm4, %xmm4
xorpd %xmm0, %xmm0
xorpd %xmm2, %xmm2
xorpd %xmm1, %xmm1
testl %r9d, %r9d
jle 0xa9dd
movq (%rax,%rdx,8), %rsi
movq %r10, %rdi
xorl %r8d, %r8d
cmpl $0x0, (%rdi)
je 0xa9ce
cmpb $0x6c, -0x4(%rdi)
movss (%rsi,%r8,4), %xmm3
mulss %xmm3, %xmm3
cvtss2sd %xmm3, %xmm3
jne 0xa9ca
addsd %xmm3, %xmm2
jmp 0xa9ce
addsd %xmm3, %xmm1
incq %r8
addq $0x158, %rdi            # imm = 0x158
cmpq %r8, %rcx
jne 0xa9ab
xorps %xmm3, %xmm3
cvtss2sd (%r15,%rdx,4), %xmm3
mulsd %xmm3, %xmm2
addsd %xmm2, %xmm0
mulsd %xmm3, %xmm1
addsd %xmm1, %xmm4
addsd %xmm3, %xmm5
incq %rdx
cmpq %r12, %rdx
jne 0xa994
jmp 0xaa0f
xorpd %xmm0, %xmm0
xorps %xmm4, %xmm4
xorpd %xmm5, %xmm5
movsd %xmm4, 0xf0(%rsp)
movsd %xmm5, 0xe0(%rsp)
divsd %xmm5, %xmm0
leaq 0x47a9e(%rip), %rsi     # 0x524ca
movq %rbx, %rdi
movb $0x1, %al
callq 0x21a0
movsd 0xf0(%rsp), %xmm0
divsd 0xe0(%rsp), %xmm0
leaq 0x47a97(%rip), %rsi     # 0x524e6
movq %rbx, %rdi
movb $0x1, %al
callq 0x21a0
movsd 0xe8(%rsp), %xmm0
addq $0x158, %rsp            # imm = 0x158
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq