// File: /workspace/github_c_makefile_star2_O3/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 0x48128(%rip), %rdi     # 0x51d4f
movq %r12, %rsi
xorl %eax, %eax
callq 0x20f0
leaq 0x4d5c8(%rip), %rsi     # 0x57200
movq %r12, %rdi
callq 0x2220
xorps %xmm0, %xmm0
cvtsi2ssl 0x601d5(%rip), %xmm0 # 0x69e20
movq %rax, %r12
divss 0x5d5d2(%rip), %xmm0    # 0x67228
movss %xmm0, 0x2d8(%rsp)
leaq 0x539ff(%rip), %rsi     # 0x5d665
movq %rax, %rdi
movq %r15, %rdx
xorl %eax, %eax
callq 0x21a0
leaq 0x48336(%rip), %rsi     # 0x51fb0
movq %r12, %rdi
movq %rbx, %rdx
movl 0x438(%rsp), %ebx
xorl %eax, %eax
callq 0x21a0
leaq 0x48335(%rip), %rsi     # 0x51fca
movq %r12, %rdi
movl %r14d, 0x2d0(%rsp)
movl %r14d, %edx
xorl %eax, %eax
callq 0x21a0
leaq 0x48333(%rip), %rsi     # 0x51fe4
movq %r12, %rdi
movl %ebx, %edx
xorl %eax, %eax
callq 0x21a0
xorps %xmm0, %xmm0
cvtss2sd 0x2d4(%rsp), %xmm0
leaq 0x4832e(%rip), %rsi     # 0x51ffe
movq %r12, %rdi
movb $0x1, %al
callq 0x21a0
movl 0x340(%rsp), %edx
leaq 0x48332(%rip), %rsi     # 0x5201a
movq %r12, %rdi
xorl %eax, %eax
callq 0x21a0
leaq 0x4833b(%rip), %rsi     # 0x52034
movq %r12, %rdi
movl 0x650(%rsp), %edx
xorl %eax, %eax
callq 0x21a0
subl %r13d, %ebp
leaq 0x4833a(%rip), %rsi     # 0x5204e
movq %r12, %rdi
movl %ebp, %edx
xorl %eax, %eax
callq 0x21a0
leaq 0x48341(%rip), %rsi     # 0x52068
movq %r12, %rdi
movl 0x428(%rsp), %edx
xorl %eax, %eax
callq 0x21a0
leaq 0x48343(%rip), %rsi     # 0x52082
movq %r12, %rdi
movl 0x458(%rsp), %edx
xorl %eax, %eax
callq 0x21a0
leaq 0x48345(%rip), %rsi     # 0x5209c
movq %r12, %rdi
movl 0x460(%rsp), %edx
xorl %eax, %eax
callq 0x21a0
leaq 0x48347(%rip), %rsi     # 0x520b6
movq %r12, %rdi
movl 0x468(%rsp), %edx
xorl %eax, %eax
callq 0x21a0
leaq 0x48349(%rip), %rsi     # 0x520d0
movq %r12, %rdi
movl 0x440(%rsp), %edx
xorl %eax, %eax
callq 0x21a0
leaq 0x4834b(%rip), %rsi     # 0x520ea
movq %r12, %rdi
movl 0x448(%rsp), %edx
xorl %eax, %eax
callq 0x21a0
movss 0x2cc(%rsp), %xmm1
xorps %xmm0, %xmm0
ucomiss %xmm0, %xmm1
jb 0x9dd9
xorps %xmm0, %xmm0
cvtss2sd %xmm1, %xmm0
leaq 0x48335(%rip), %rsi     # 0x52104
movq %r12, %rdi
movb $0x1, %al
callq 0x21a0
xorps %xmm0, %xmm0
cvtsi2ss %ebx, %xmm0
cmpl $0x2, 0x2d0(%rsp)
jl 0x9e14
movl 0x450(%rsp), %edx
leaq 0x48328(%rip), %rsi     # 0x52120
movq %r12, %rdi
xorl %eax, %eax
movss %xmm0, 0x2cc(%rsp)
callq 0x21a0
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 0x5f21c(%rip), %xmm0    # 0x69074
xorps %xmm1, %xmm1
cvtss2sd 0x5f215(%rip), %xmm1    # 0x69078
leaq 0x482d1(%rip), %rsi     # 0x5213b
movq %r12, %rdi
movb $0x2, %al
callq 0x21a0
movss 0x5d314(%rip), %xmm0    # 0x67190
xorps %xmm1, %xmm1
ucomiss %xmm1, %xmm0
jbe 0x9e99
cvtss2sd %xmm0, %xmm0
leaq 0x482ca(%rip), %rsi     # 0x52159
movq %r12, %rdi
movb $0x1, %al
callq 0x21a0
xorps %xmm0, %xmm0
cvtss2sd 0x2cc(%rsp), %xmm0
leaq 0x482cb(%rip), %rsi     # 0x52177
movq %r12, %rdi
movb $0x1, %al
callq 0x21a0
leaq 0x482d6(%rip), %rsi     # 0x52193
movq %r12, %rdi
movsd 0x2f8(%rsp), %xmm0
movb $0x1, %al
callq 0x21a0
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 0xa18f
movsd %xmm0, 0x5efd5(%rip)    # 0x68fa8
xorps %xmm0, %xmm0
cvtss2sd 0x2dc(%rsp), %xmm0
leaq 0x481c9(%rip), %rsi     # 0x521af
movq %r12, %rdi
movb $0x1, %al
callq 0x21a0
leaq 0x52580(%rip), %rdi     # 0x5c577
movl $0x2, %esi
movl $0x1, %edx
movq %r12, %rcx
callq 0x2290
cmpl $0x0, 0x5efc0(%rip)     # 0x68fd0
je 0xa126
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 0xa18f
leaq 0x52463(%rip), %rdi     # 0x5c577
movl $0x2, %esi
movl $0x1, %edx
movq %r12, %rcx
callq 0x2290
movq %r12, %rdi
callq 0x20c0
movsd 0x5ee72(%rip), %xmm0    # 0x68fa8
addq $0x308, %rsp            # imm = 0x308
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq