// File: /workspace/github_c_makefile_star2_O2/ugobas[P]tnm/main_tnm.c
// Function: Print_summary
double Print_summary(char *name_out, char *name1, char *parameters, int Nchain,
		     struct Normal_Mode NM,
		     char *out_B1, char *out_B2, float Tors_fluct,
		     struct axe *axes, int N_axes, int N_main,
		     int Nskip, int N_atoms, int N_res, int N_diso,
		     int N_int, int N_inter, float Cont_overlap,
		     int N_disc_coll, int N_disc_freq, int N_disc_out,
		     float mass_sum,
		     struct Normal_Mode NM_unfold,
		     int N_int_unfold, double E_cont_unfold, int FOLDING,
		     struct Normal_Mode NM_apo, int N_int_inter,
		     double Econt_holo, double Econt_bind, int BINDING,
		     float *mass_coord, int *Cart_interface, int N_Cart_inter,
		     int *rigid_inter, int N_rigid)
{
  FILE *file_out;

  printf("Writing %s\n", name_out);
  file_out=fopen(name_out, "w");

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

  fprintf(file_out, "%s\n", parameters);
  fprintf(file_out, "protein               %s\n", name1);
  fprintf(file_out, "Nchain                %d\n", Nchain);
  fprintf(file_out, "Nres                  %d\n", N_res);
  fprintf(file_out, "Mass                  %.0f\n", mass_sum);
  fprintf(file_out, "Degrees of freedom    %d\n", NM.N);
  fprintf(file_out, "Rigid Deg of freed    %d\n", N_rigid);
  fprintf(file_out, "Side chain            %d\n", N_axes-N_main);
  fprintf(file_out, "Skipped main chain    %d\n", Nskip);
  fprintf(file_out, "Discarded modes coll. %d\n", N_disc_coll);
  fprintf(file_out, "Discarded modes freq. %d\n", N_disc_freq);
  fprintf(file_out, "Discarded modes outl. %d\n", N_disc_out);
  fprintf(file_out, "Disordered gaps       %d\n", N_diso);
  fprintf(file_out, "Native interactions   %d\n", N_int);
  if(Cont_overlap >= 0)
    fprintf(file_out, "Overlap with MIN int. %.3f\n", Cont_overlap);
  if(Nchain>1)fprintf(file_out, "Interchain contacts    %d\n", N_inter);
  fprintf(file_out, "Force constant at %.1fA %.4g\n", C0, KAPPA);
  if(TEMPERATURE>0)
    fprintf(file_out, "Temperature:          %.3g K\n", TEMPERATURE);
  fprintf(file_out, "Estimated surface     %.4g\n", Surf);
  fprintf(file_out, "Contact energy        %.4g\n", Econt_holo);

  int anharmonic=0;
  G_NM_holo=
    Print_thermal(anharmonic, file_out, NM, out_B1, axes, N_main, N_res,Nchain,
		  NM_unfold, N_int_unfold, N_int, E_cont_unfold, FOLDING,
		  NM_apo, N_int_inter, Econt_bind, BINDING, 
		  mass_coord,Cart_interface,N_Cart_inter,rigid_inter,N_rigid);
  fprintf(file_out, "Torsional_RMSD_Harm   %.3f\n", Tors_fluct);
  fprintf(file_out, "#\n");

  if(ANHARMONIC){
    anharmonic=1;
    Print_thermal(anharmonic, file_out, NM, out_B2, axes,N_main,N_res,Nchain,
		  NM_unfold, N_int_unfold, N_int, E_cont_unfold, FOLDING,
		  NM_apo, N_int_inter, Econt_bind, BINDING, 
		  mass_coord,Cart_interface,N_Cart_inter,rigid_inter,N_rigid);
    fprintf(file_out, "#\n");
  }
  fclose(file_out);
  return(G_NM_holo);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x308, %rsp            # imm = 0x308
movsd %xmm5, 0x2e8(%rsp)
movsd %xmm4, 0x2f8(%rsp)
movsd %xmm3, 0x2e0(%rsp)
movss %xmm2, 0x2d4(%rsp)
movss %xmm1, 0x2d0(%rsp)
movss %xmm0, 0x2dc(%rsp)
movq %r9, 0x2f0(%rsp)
movq %r8, 0x300(%rsp)
movl %ecx, %r14d
movq %rdx, %r15
movq %rsi, %rbx
movq %rdi, %r12
movl 0x420(%rsp), %r13d
movl 0x418(%rsp), %ebp
leaq 0x42586(%rip), %rdi     # 0x4bca7
movq %r12, %rsi
xorl %eax, %eax
callq 0x20f0
leaq 0x47a1e(%rip), %rsi     # 0x51150
movq %r12, %rdi
callq 0x2210
cvtsi2ssl 0x5b6de(%rip), %xmm0 # 0x64e20
movq %rax, %r12
divss 0x58adb(%rip), %xmm0    # 0x62228
movss %xmm0, 0x2d8(%rsp)
leaq 0x4de78(%rip), %rsi     # 0x575d5
movq %rax, %rdi
movq %r15, %rdx
xorl %eax, %eax
callq 0x2190
leaq 0x42797(%rip), %rsi     # 0x4bf08
movq %r12, %rdi
movq %rbx, %rdx
movl 0x438(%rsp), %ebx
xorl %eax, %eax
callq 0x2190
leaq 0x42796(%rip), %rsi     # 0x4bf22
movq %r12, %rdi
movl %r14d, %edx
xorl %eax, %eax
callq 0x2190
leaq 0x4279c(%rip), %rsi     # 0x4bf3c
movq %r12, %rdi
movl %ebx, %edx
xorl %eax, %eax
callq 0x2190
cvtss2sd 0x2d4(%rsp), %xmm0
leaq 0x4279a(%rip), %rsi     # 0x4bf56
movq %r12, %rdi
movb $0x1, %al
callq 0x2190
movl 0x340(%rsp), %edx
leaq 0x4279e(%rip), %rsi     # 0x4bf72
movq %r12, %rdi
xorl %eax, %eax
callq 0x2190
leaq 0x427a7(%rip), %rsi     # 0x4bf8c
movq %r12, %rdi
movl 0x650(%rsp), %edx
xorl %eax, %eax
callq 0x2190
subl %r13d, %ebp
leaq 0x427a6(%rip), %rsi     # 0x4bfa6
movq %r12, %rdi
movl %ebp, %edx
xorl %eax, %eax
callq 0x2190
leaq 0x427ad(%rip), %rsi     # 0x4bfc0
movq %r12, %rdi
movl 0x428(%rsp), %edx
xorl %eax, %eax
callq 0x2190
leaq 0x427af(%rip), %rsi     # 0x4bfda
movq %r12, %rdi
movl 0x458(%rsp), %edx
xorl %eax, %eax
callq 0x2190
leaq 0x427b1(%rip), %rsi     # 0x4bff4
movq %r12, %rdi
movl 0x460(%rsp), %edx
xorl %eax, %eax
callq 0x2190
leaq 0x427b3(%rip), %rsi     # 0x4c00e
movq %r12, %rdi
movl 0x468(%rsp), %edx
xorl %eax, %eax
callq 0x2190
leaq 0x427b5(%rip), %rsi     # 0x4c028
movq %r12, %rdi
movl 0x440(%rsp), %edx
xorl %eax, %eax
callq 0x2190
leaq 0x427b7(%rip), %rsi     # 0x4c042
movq %r12, %rdi
movl 0x448(%rsp), %edx
xorl %eax, %eax
callq 0x2190
movss 0x2d0(%rsp), %xmm1
xorps %xmm0, %xmm0
ucomiss %xmm0, %xmm1
jb 0x98c2
cvtss2sd %xmm1, %xmm0
leaq 0x427a4(%rip), %rsi     # 0x4c05c
movq %r12, %rdi
movb $0x1, %al
callq 0x2190
cvtsi2ss %ebx, %xmm0
cmpl $0x2, %r14d
jl 0x98f6
movl 0x450(%rsp), %edx
leaq 0x4279e(%rip), %rsi     # 0x4c078
movq %r12, %rdi
xorl %eax, %eax
movss %xmm0, 0x2d0(%rsp)
callq 0x2190
movss 0x2d0(%rsp), %xmm0
movl 0x628(%rsp), %r13d
leaq 0x550(%rsp), %rbx
leaq 0x470(%rsp), %rbp
leaq 0x340(%rsp), %r15
subss 0x2d8(%rsp), %xmm0
movss %xmm0, 0x2d0(%rsp)
cvtss2sd 0x5a744(%rip), %xmm0    # 0x64074
cvtss2sd 0x5a740(%rip), %xmm1    # 0x64078
leaq 0x42754(%rip), %rsi     # 0x4c093
movq %r12, %rdi
movb $0x2, %al
callq 0x2190
movss 0x5883f(%rip), %xmm0    # 0x62190
xorps %xmm1, %xmm1
ucomiss %xmm1, %xmm0
jbe 0x996e
cvtss2sd %xmm0, %xmm0
leaq 0x4274d(%rip), %rsi     # 0x4c0b1
movq %r12, %rdi
movb $0x1, %al
callq 0x2190
cvtss2sd 0x2d0(%rsp), %xmm0
leaq 0x42751(%rip), %rsi     # 0x4c0cf
movq %r12, %rdi
movb $0x1, %al
callq 0x2190
leaq 0x4275c(%rip), %rsi     # 0x4c0eb
movq %r12, %rdi
movsd 0x2f8(%rsp), %xmm0
movb $0x1, %al
callq 0x2190
pushq $0x1a
popq %rax
movq %rax, %rcx
movq %rsp, %rdi
movq %r15, %rsi
rep  movsq (%rsi), %es:(%rdi)
leaq 0x1c0(%rsp), %rdi
movq %rax, %rcx
movq %rbx, %rsi
rep  movsq (%rsi), %es:(%rdi)
leaq 0xd8(%rsp), %rdi
movq %rax, %rcx
movq %rbp, %rsi
rep  movsq (%rsi), %es:(%rdi)
movl 0x650(%rsp), %ebp
movl %ebp, 0x2c0(%rsp)
movq 0x648(%rsp), %rax
movq %rax, 0x2b8(%rsp)
movl 0x640(%rsp), %eax
movl %eax, 0x2b0(%rsp)
movq 0x638(%rsp), %rax
movq %rax, 0x2a8(%rsp)
movq 0x630(%rsp), %rax
movq %rax, 0x2a0(%rsp)
movl %r13d, 0x298(%rsp)
movl 0x620(%rsp), %r13d
movl %r13d, 0x290(%rsp)
movl 0x548(%rsp), %eax
movl %eax, 0x1b8(%rsp)
movl 0x540(%rsp), %eax
movl %eax, 0x1a8(%rsp)
movl %r14d, 0xd0(%rsp)
xorl %edi, %edi
movq %r12, %rsi
movq 0x300(%rsp), %rdx
movq 0x410(%rsp), %rcx
movl 0x420(%rsp), %ebx
movl %ebx, %r8d
movl 0x438(%rsp), %r15d
movl %r15d, %r9d
movsd 0x2e0(%rsp), %xmm0
movsd 0x2e8(%rsp), %xmm1
callq 0x9c4c
movsd %xmm0, 0x5a504(%rip)    # 0x63fa8
cvtss2sd 0x2dc(%rsp), %xmm0
leaq 0x42653(%rip), %rsi     # 0x4c107
movq %r12, %rdi
movb $0x1, %al
callq 0x2190
leaq 0x4ca1a(%rip), %rdi     # 0x564df
pushq $0x2
popq %rsi
pushq $0x1
popq %rdx
movq %r12, %rcx
callq 0x2280
cmpl $0x0, 0x5a4f6(%rip)     # 0x63fd0
je 0x9be7
pushq $0x1a
popq %rax
movq %rax, %rcx
movq %rsp, %rdi
leaq 0x340(%rsp), %rsi
rep  movsq (%rsi), %es:(%rdi)
leaq 0x1c0(%rsp), %rdi
movq %rax, %rcx
leaq 0x550(%rsp), %rsi
rep  movsq (%rsi), %es:(%rdi)
leaq 0xd8(%rsp), %rdi
movq %rax, %rcx
leaq 0x470(%rsp), %rsi
rep  movsq (%rsi), %es:(%rdi)
movl %ebp, 0x2c0(%rsp)
movq 0x648(%rsp), %rax
movq %rax, 0x2b8(%rsp)
movl 0x640(%rsp), %eax
movl %eax, 0x2b0(%rsp)
movq 0x638(%rsp), %rax
movq %rax, 0x2a8(%rsp)
movq 0x630(%rsp), %rax
movq %rax, 0x2a0(%rsp)
movl 0x628(%rsp), %eax
movl %eax, 0x298(%rsp)
movl %r13d, 0x290(%rsp)
movl 0x548(%rsp), %eax
movl %eax, 0x1b8(%rsp)
movl 0x540(%rsp), %eax
movl %eax, 0x1a8(%rsp)
movl %r14d, 0xd0(%rsp)
pushq $0x1
popq %rdi
movl %ebx, %r8d
movl %r15d, %r9d
movq %r12, %rsi
movq 0x2f0(%rsp), %rdx
movq 0x410(%rsp), %rcx
movsd 0x2e0(%rsp), %xmm0
movsd 0x2e8(%rsp), %xmm1
callq 0x9c4c
leaq 0x4c906(%rip), %rdi     # 0x564df
pushq $0x2
popq %rsi
pushq $0x1
popq %rdx
movq %r12, %rcx
callq 0x2280
movq %r12, %rdi
callq 0x20c0
movsd 0x5a3b1(%rip), %xmm0    # 0x63fa8
addq $0x308, %rsp            # imm = 0x308
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq