// File: /workspace/github_c_makefile_star2_O1/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, 0x2cc(%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 0x4808f(%rip), %rdi     # 0x51cdb
movq %r12, %rsi
xorl %eax, %eax
callq 0x20f0
leaq 0x4d5e3(%rip), %rsi     # 0x57240
movq %r12, %rdi
callq 0x2210
xorps %xmm0, %xmm0
cvtsi2ssl 0x601b0(%rip), %xmm0 # 0x69e20
movq %rax, %r12
divss 0x5d5ad(%rip), %xmm0    # 0x67228
movss %xmm0, 0x2d8(%rsp)
leaq 0x53a0a(%rip), %rsi     # 0x5d695
movq %rax, %rdi
movq %r15, %rdx
xorl %eax, %eax
callq 0x2190
leaq 0x4829d(%rip), %rsi     # 0x51f3c
movq %r12, %rdi
movq %rbx, %rdx
movl 0x438(%rsp), %ebx
xorl %eax, %eax
callq 0x2190
leaq 0x4829c(%rip), %rsi     # 0x51f56
movq %r12, %rdi
movl %r14d, 0x2d0(%rsp)
movl %r14d, %edx
xorl %eax, %eax
callq 0x2190
leaq 0x4829a(%rip), %rsi     # 0x51f70
movq %r12, %rdi
movl %ebx, %edx
xorl %eax, %eax
callq 0x2190
xorps %xmm0, %xmm0
cvtss2sd 0x2d4(%rsp), %xmm0
leaq 0x48295(%rip), %rsi     # 0x51f8a
movq %r12, %rdi
movb $0x1, %al
callq 0x2190
movl 0x340(%rsp), %edx
leaq 0x48299(%rip), %rsi     # 0x51fa6
movq %r12, %rdi
xorl %eax, %eax
callq 0x2190
leaq 0x482a2(%rip), %rsi     # 0x51fc0
movq %r12, %rdi
movl 0x650(%rsp), %edx
xorl %eax, %eax
callq 0x2190
subl %r13d, %ebp
leaq 0x482a1(%rip), %rsi     # 0x51fda
movq %r12, %rdi
movl %ebp, %edx
xorl %eax, %eax
callq 0x2190
leaq 0x482a8(%rip), %rsi     # 0x51ff4
movq %r12, %rdi
movl 0x428(%rsp), %edx
xorl %eax, %eax
callq 0x2190
leaq 0x482aa(%rip), %rsi     # 0x5200e
movq %r12, %rdi
movl 0x458(%rsp), %edx
xorl %eax, %eax
callq 0x2190
leaq 0x482ac(%rip), %rsi     # 0x52028
movq %r12, %rdi
movl 0x460(%rsp), %edx
xorl %eax, %eax
callq 0x2190
leaq 0x482ae(%rip), %rsi     # 0x52042
movq %r12, %rdi
movl 0x468(%rsp), %edx
xorl %eax, %eax
callq 0x2190
leaq 0x482b0(%rip), %rsi     # 0x5205c
movq %r12, %rdi
movl 0x440(%rsp), %edx
xorl %eax, %eax
callq 0x2190
leaq 0x482b2(%rip), %rsi     # 0x52076
movq %r12, %rdi
movl 0x448(%rsp), %edx
xorl %eax, %eax
callq 0x2190
movss 0x2cc(%rsp), %xmm1
xorps %xmm0, %xmm0
ucomiss %xmm0, %xmm1
jb 0x9dfe
xorps %xmm0, %xmm0
cvtss2sd %xmm1, %xmm0
leaq 0x4829c(%rip), %rsi     # 0x52090
movq %r12, %rdi
movb $0x1, %al
callq 0x2190
xorps %xmm0, %xmm0
cvtsi2ss %ebx, %xmm0
cmpl $0x2, 0x2d0(%rsp)
jl 0x9e39
movl 0x450(%rsp), %edx
leaq 0x4828f(%rip), %rsi     # 0x520ac
movq %r12, %rdi
xorl %eax, %eax
movss %xmm0, 0x2cc(%rsp)
callq 0x2190
movss 0x2cc(%rsp), %xmm0
movl 0x628(%rsp), %ebx
leaq 0x550(%rsp), %r13
movl 0x540(%rsp), %r15d
leaq 0x470(%rsp), %rbp
leaq 0x340(%rsp), %r14
subss 0x2d8(%rsp), %xmm0
movss %xmm0, 0x2cc(%rsp)
xorps %xmm0, %xmm0
cvtss2sd 0x5f1f7(%rip), %xmm0    # 0x69074
xorps %xmm1, %xmm1
cvtss2sd 0x5f1f0(%rip), %xmm1    # 0x69078
leaq 0x48238(%rip), %rsi     # 0x520c7
movq %r12, %rdi
movb $0x2, %al
callq 0x2190
movss 0x5d2ef(%rip), %xmm0    # 0x67190
xorps %xmm1, %xmm1
ucomiss %xmm1, %xmm0
jbe 0x9ebe
cvtss2sd %xmm0, %xmm0
leaq 0x48231(%rip), %rsi     # 0x520e5
movq %r12, %rdi
movb $0x1, %al
callq 0x2190
xorps %xmm0, %xmm0
cvtss2sd 0x2cc(%rsp), %xmm0
leaq 0x48232(%rip), %rsi     # 0x52103
movq %r12, %rdi
movb $0x1, %al
callq 0x2190
leaq 0x4823d(%rip), %rsi     # 0x5211f
movq %r12, %rdi
movsd 0x2f8(%rsp), %xmm0
movb $0x1, %al
callq 0x2190
movl $0x1a, %ecx
movq %rsp, %rdi
movq %r14, %rsi
rep  movsq (%rsi), %es:(%rdi)
leaq 0x1c0(%rsp), %rdi
movl $0x1a, %ecx
movq %r13, %rsi
rep  movsq (%rsi), %es:(%rdi)
leaq 0xd8(%rsp), %rdi
movl $0x1a, %ecx
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 %ebx, 0x298(%rsp)
movl 0x620(%rsp), %ebx
movl %ebx, 0x290(%rsp)
movl 0x548(%rsp), %ebx
movl %ebx, 0x1b8(%rsp)
movl %r15d, 0x1a8(%rsp)
movl 0x2d0(%rsp), %eax
movl %eax, 0xd0(%rsp)
xorl %edi, %edi
movq %r12, %rsi
movq 0x300(%rsp), %rdx
movq 0x410(%rsp), %rcx
movl 0x420(%rsp), %r13d
movl %r13d, %r8d
movl 0x438(%rsp), %r15d
movl %r15d, %r9d
movsd 0x2e0(%rsp), %xmm0
movsd 0x2e8(%rsp), %xmm1
callq 0xa1b4
movsd %xmm0, 0x5efb0(%rip)    # 0x68fa8
xorps %xmm0, %xmm0
cvtss2sd 0x2dc(%rsp), %xmm0
leaq 0x48130(%rip), %rsi     # 0x5213b
movq %r12, %rdi
movb $0x1, %al
callq 0x2190
leaq 0x5259b(%rip), %rdi     # 0x5c5b7
movl $0x2, %esi
movl $0x1, %edx
movq %r12, %rcx
callq 0x2280
cmpl $0x0, 0x5ef9b(%rip)     # 0x68fd0
je 0xa14b
movl $0x1a, %ecx
movq %rsp, %rdi
movq %r14, %rsi
rep  movsq (%rsi), %es:(%rdi)
movl $0x1a, %ecx
leaq 0x1c0(%rsp), %rdi
leaq 0x550(%rsp), %rsi
rep  movsq (%rsi), %es:(%rdi)
movl $0x1a, %ecx
leaq 0xd8(%rsp), %rdi
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 0x620(%rsp), %eax
movl %eax, 0x290(%rsp)
movl %ebx, 0x1b8(%rsp)
movl 0x540(%rsp), %eax
movl %eax, 0x1a8(%rsp)
movl 0x2d0(%rsp), %eax
movl %eax, 0xd0(%rsp)
movl %r13d, %r8d
movl $0x1, %edi
movl %r15d, %r9d
movq %r12, %rsi
movq 0x2f0(%rsp), %rdx
movq 0x410(%rsp), %rcx
movsd 0x2e0(%rsp), %xmm0
movsd 0x2e8(%rsp), %xmm1
callq 0xa1b4
leaq 0x5247e(%rip), %rdi     # 0x5c5b7
movl $0x2, %esi
movl $0x1, %edx
movq %r12, %rcx
callq 0x2280
movq %r12, %rdi
callq 0x20c0
movsd 0x5ee4d(%rip), %xmm0    # 0x68fa8
addq $0x308, %rsp            # imm = 0x308
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq