// File: /workspace/github_c_makefile_star2_O3/ugobas[P]tnm/output_tnm.c
// Function: Print_mode_summary
void Print_mode_summary(char *nameout, char *label, struct Normal_Mode NM,
			float M_sqrt,int anharmonic,float xkappa)
{ 
  int i;
  FILE *file_out; char outfile[200];
  sprintf(outfile, "%s.%s.dat", nameout, label);
  file_out=fopen(outfile, "w");
  printf("Writing %s\n", outfile);
  float kappa=Collectivity_norm1(NM.sigma2, NM.N);
  fprintf(file_out, "# Reciprocal collectivity of fluctuations=  %.1f\n",kappa);
  fprintf(file_out, "# kappa=  %.3f\n",xkappa);
  //float N_sqrt=sqrt(NM.N_Cart/3);

  double norm=0; for(i=0; i<NM.N; i++)norm+=NM.sigma2[i];
  if(anharmonic){
    double Anhar_ene=0, Anhar_str=0;
    for(i=0; i<NM.N; i++){
      if(NM.sigma2[i]==0)continue;
      Anhar_ene+=NM.Anharmonicity[i]*NM.sigma2[i];
      Anhar_str+=NM.Anharm_struct[i]*NM.sigma2[i];
    }
    fprintf(file_out, "# Frequency weighted anharmonicity (ene)= %.3f\n",
	  Anhar_ene/norm);
    fprintf(file_out, "# Frequency weighted anharmonicity (str)= %.3f\n",
	    Anhar_str/norm);
  }

  fprintf(file_out, "# Frequency reported in internal units: %.3f ps^(-1),"
	  " kT/h/ is %.3g internal units (om-2)= %.3g\n",
	  Freq_unit, 0.385/Freq_unit, Freq_unit*Freq_unit/0.1482);
  fprintf(file_out,"#mode pc_therm cumul ");
  fprintf(file_out,"om-2(harm) ");
  if(anharmonic)fprintf(file_out, "om-2(corr) om-2(anha) ");
  fprintf(file_out," RMSD  Coll_cart");
  if(NM.MW_Tors_coll)fprintf(file_out, " Coll_MW");
  if(NM.Tors_coll)fprintf(file_out, " Coll_tors");
  fprintf(file_out, " Max_dev_atom");
  /*fprintf(file_out, " Anharmonicity_(ene) Anharmonicity_(str)");
    fprintf(file_out, " Max_RMSD(DE<E_THR*E_nat)"); //, E_THR*/
  fprintf(file_out, "\n");

  double sum=0;
  for(i=0; i<NM.N; i++){
    if(NM.select[i]==0)fprintf(file_out, "#");
    sum+=NM.sigma2[i];
    fprintf(file_out, "%5d  %6.4f %5.3f  ",i, NM.sigma2[i]/norm, sum/norm);
    fprintf(file_out, "%7.4g ",NM.sigma2[i]);
    if(anharmonic){
      fprintf(file_out,"%7.4g %7.4g  ",
	      xkappa*NM.sigma2_anhar[i],NM.sigma2_anhar[i]);
    }
    fprintf(file_out, " %7.3g", 1./(M_sqrt*NM.omega[i]));
    fprintf(file_out, "  %5.3f", NM.Cart_coll[i]);
    if(NM.MW_Tors_coll)fprintf(file_out, " %5.3f", NM.MW_Tors_coll[i]);
    if(NM.Tors_coll)fprintf(file_out, " %5.3f", NM.Tors_coll[i]);
    fprintf(file_out, "  %5.3f", NM.Max_dev[i]);
    /*fprintf(file_out, " %.3f", NM.Anharmonicity[i]);
    fprintf(file_out, " %.3f", NM.Anharm_struct[i]);
    fprintf(file_out, " %.3f", NM.Max_RMSD[i]);*/
    fprintf(file_out, "\n");
  }
  fclose(file_out);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x128, %rsp            # imm = 0x128
movss %xmm1, (%rsp)
movl %edx, %ebp
movss %xmm0, 0x14(%rsp)
movq %rsi, %rcx
movq %rdi, %rdx
leaq 0x160(%rsp), %r12
leaq 0x1b43c(%rip), %rsi     # 0x5ce21
leaq 0x60(%rsp), %r14
movq %r14, %rdi
xorl %eax, %eax
callq 0x2270
leaq 0x15805(%rip), %rsi     # 0x57200
movq %r14, %rdi
callq 0x2220
movq %rax, %rbx
leaq 0x10342(%rip), %rdi     # 0x51d4f
movq %r14, %rsi
xorl %eax, %eax
callq 0x20f0
movq 0x28(%r12), %r14
movslq (%r12), %r15
movq %r14, %rdi
movl %r15d, %esi
callq 0x10b2f
cvtss2sd %xmm0, %xmm0
leaq 0x17832(%rip), %rsi     # 0x59268
movq %rbx, %rdi
movb $0x1, %al
callq 0x21a0
xorps %xmm0, %xmm0
cvtss2sd (%rsp), %xmm0
leaq 0x18ce5(%rip), %rsi     # 0x5a734
movq %rbx, %rdi
movb $0x1, %al
callq 0x21a0
testq %r15, %r15
movq %r15, 0x18(%rsp)
jle 0x41ad9
xorpd %xmm4, %xmm4
xorl %eax, %eax
xorps %xmm0, %xmm0
cvtss2sd (%r14,%rax,4), %xmm0
addsd %xmm0, %xmm4
incq %rax
cmpq %rax, %r15
jne 0x41a69
testl %ebp, %ebp
je 0x41ae9
testl %r15d, %r15d
jle 0x41b6b
movq 0x98(%r12), %rax
movq 0xa0(%r12), %rcx
xorpd %xmm5, %xmm5
xorl %edx, %edx
xorps %xmm0, %xmm0
movss (%r14,%rdx,4), %xmm1
ucomiss %xmm0, %xmm1
jne 0x41ab1
jnp 0x41acc
shufps $0x0, %xmm1, %xmm1      # xmm1 = xmm1[0,0,0,0]
movss (%rcx,%rdx,4), %xmm2
movss (%rax,%rdx,4), %xmm3
unpcklps %xmm2, %xmm3            # xmm3 = xmm3[0],xmm2[0],xmm3[1],xmm2[1]
mulps %xmm1, %xmm3
cvtps2pd %xmm3, %xmm1
addpd %xmm1, %xmm5
incq %rdx
cmpq %rdx, %r15
jne 0x41aa4
jmp 0x41b6f
xorpd %xmm5, %xmm5
xorpd %xmm4, %xmm4
testl %ebp, %ebp
jne 0x41b6f
movsd %xmm4, 0x8(%rsp)
leaq 0x256a6(%rip), %rax     # 0x6719c
movss (%rax), %xmm2
xorps %xmm0, %xmm0
cvtss2sd %xmm2, %xmm0
movsd 0x18197(%rip), %xmm1    # 0x59ca0
divsd %xmm0, %xmm1
mulss %xmm2, %xmm2
cvtss2sd %xmm2, %xmm2
divsd 0x1818b(%rip), %xmm2    # 0x59ca8
leaq 0x18c20(%rip), %rsi     # 0x5a744
movq %rbx, %rdi
movb $0x3, %al
callq 0x21a0
leaq 0x1b356(%rip), %rdi     # 0x5ce8b
movl $0x15, %esi
movl $0x1, %edx
movq %rbx, %rcx
callq 0x2290
leaq 0x18c70(%rip), %rdi     # 0x5a7be
movl $0xb, %esi
movl $0x1, %edx
movq %rbx, %rcx
callq 0x2290
movb $0x1, %al
movl %eax, 0x4(%rsp)
jmp 0x41c47
xorpd %xmm5, %xmm5
movapd %xmm5, 0x20(%rsp)
movsd %xmm4, 0x8(%rsp)
movapd %xmm5, %xmm0
divsd %xmm4, %xmm0
leaq 0x1b2a1(%rip), %rsi     # 0x5ce2b
movq %rbx, %rdi
movb $0x1, %al
callq 0x21a0
movapd 0x20(%rsp), %xmm0
unpckhpd %xmm0, %xmm0            # xmm0 = xmm0[1,1]
divsd 0x8(%rsp), %xmm0
leaq 0x1b2b0(%rip), %rsi     # 0x5ce5b
movq %rbx, %rdi
movb $0x1, %al
callq 0x21a0
leaq 0x255e0(%rip), %rax     # 0x6719c
movss (%rax), %xmm2
xorps %xmm0, %xmm0
cvtss2sd %xmm2, %xmm0
movsd 0x180d1(%rip), %xmm1    # 0x59ca0
divsd %xmm0, %xmm1
mulss %xmm2, %xmm2
cvtss2sd %xmm2, %xmm2
divsd 0x180c5(%rip), %xmm2    # 0x59ca8
leaq 0x18b5a(%rip), %rsi     # 0x5a744
movq %rbx, %rdi
movb $0x3, %al
callq 0x21a0
leaq 0x1b290(%rip), %rdi     # 0x5ce8b
movl $0x15, %esi
movl $0x1, %edx
movq %rbx, %rcx
callq 0x2290
leaq 0x18baa(%rip), %rdi     # 0x5a7be
movl $0xb, %esi
movl $0x1, %edx
movq %rbx, %rcx
callq 0x2290
leaq 0x18b9d(%rip), %rdi     # 0x5a7ca
movl $0x16, %esi
movl $0x1, %edx
movq %rbx, %rcx
callq 0x2290
movl $0x0, 0x4(%rsp)
leaq 0x18b95(%rip), %rdi     # 0x5a7e3
movl $0x10, %esi
movl $0x1, %edx
movq %rbx, %rcx
callq 0x2290
movq 0x78(%r12), %r13
testq %r13, %r13
je 0x41c83
leaq 0x18b84(%rip), %rdi     # 0x5a7f5
movl $0x8, %esi
movl $0x1, %edx
movq %rbx, %rcx
callq 0x2290
movq 0x70(%r12), %r15
testq %r15, %r15
je 0x41ca6
leaq 0x18b6b(%rip), %rdi     # 0x5a7ff
movl $0xa, %esi
movl $0x1, %edx
movq %rbx, %rcx
callq 0x2290
leaq 0x1b1f4(%rip), %rdi     # 0x5cea1
movl $0xd, %esi
movl $0x1, %edx
movq %rbx, %rcx
callq 0x2290
movl $0xa, %edi
movq %rbx, %rsi
callq 0x2140
cmpl $0x0, 0x18(%rsp)
jle 0x41e8b
movq 0xc0(%r12), %rax
movq %rax, 0x58(%rsp)
movq 0x88(%r12), %rax
movq %rax, 0x38(%rsp)
movq 0x18(%r12), %rax
movq %rax, 0x50(%rsp)
movq 0x68(%r12), %rax
movq %rax, 0x48(%rsp)
movq 0x80(%r12), %rax
movq %rax, 0x40(%rsp)
xorps %xmm0, %xmm0
movsd %xmm0, 0x20(%rsp)
xorl %r12d, %r12d
leaq 0x18b5c(%rip), %rbp     # 0x5a881
movq 0x58(%rsp), %rax
cmpl $0x0, (%rax,%r12,4)
jne 0x41d3e
movl $0x23, %edi
movq %rbx, %rsi
callq 0x2140
xorps %xmm0, %xmm0
cvtss2sd (%r14,%r12,4), %xmm0
movsd 0x20(%rsp), %xmm1
addsd %xmm0, %xmm1
movsd 0x8(%rsp), %xmm2
divsd %xmm2, %xmm0
movsd %xmm1, 0x20(%rsp)
divsd %xmm2, %xmm1
movq %rbx, %rdi
leaq 0x1b140(%rip), %rsi     # 0x5ceaf
movl %r12d, %edx
movb $0x2, %al
callq 0x21a0
xorps %xmm0, %xmm0
cvtss2sd (%r14,%r12,4), %xmm0
movq %rbx, %rdi
leaq 0x1b136(%rip), %rsi     # 0x5cec2
movb $0x1, %al
callq 0x21a0
cmpb $0x0, 0x4(%rsp)
jne 0x41dc6
movq 0x38(%rsp), %rax
movss (%rax,%r12,4), %xmm0
xorps %xmm1, %xmm1
cvtss2sd %xmm0, %xmm1
mulss (%rsp), %xmm0
cvtss2sd %xmm0, %xmm0
movq %rbx, %rdi
leaq 0x1b10a(%rip), %rsi     # 0x5cec9
movb $0x2, %al
callq 0x21a0
movq 0x50(%rsp), %rax
movss (%rax,%r12,4), %xmm0
mulss 0x14(%rsp), %xmm0
xorps %xmm1, %xmm1
cvtss2sd %xmm0, %xmm1
movsd 0xf362(%rip), %xmm0     # 0x51148
divsd %xmm1, %xmm0
movq %rbx, %rdi
leaq 0x1b0e3(%rip), %rsi     # 0x5ced7
movb $0x1, %al
callq 0x21a0
movq 0x48(%rsp), %rax
xorps %xmm0, %xmm0
cvtss2sd (%rax,%r12,4), %xmm0
movq %rbx, %rdi
movq %rbp, %rsi
movb $0x1, %al
callq 0x21a0
testq %r13, %r13
je 0x41e36
xorps %xmm0, %xmm0
cvtss2sd (%r13,%r12,4), %xmm0
movq %rbx, %rdi
leaq 0x18a53(%rip), %rsi     # 0x5a882
movb $0x1, %al
callq 0x21a0
testq %r15, %r15
je 0x41e55
xorps %xmm0, %xmm0
cvtss2sd (%r15,%r12,4), %xmm0
movq %rbx, %rdi
leaq 0x18a34(%rip), %rsi     # 0x5a882
movb $0x1, %al
callq 0x21a0
movq 0x40(%rsp), %rax
xorps %xmm0, %xmm0
cvtss2sd (%rax,%r12,4), %xmm0
movq %rbx, %rdi
movq %rbp, %rsi
movb $0x1, %al
callq 0x21a0
movl $0xa, %edi
movq %rbx, %rsi
callq 0x2140
incq %r12
cmpq %r12, 0x18(%rsp)
jne 0x41d25
movq %rbx, %rdi
callq 0x20c0
addq $0x128, %rsp            # imm = 0x128
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq