// File: /workspace/github_c_makefile_star2_O0/ugobas[P]tnm/output_tnm.c
// Function: Print_modes
void Print_modes(int N_print, char *nameout,
		 char *label, int *select,
		 int N, float **Mode, float *collectivity,
		 float *sigma2, double sum_sigma2,
		 struct axe *axe, int naxe,
		 atom *atoms, int natoms,
		 struct residue *seq, int nres,
		 int *atom_num, int N_ref)
{
  int PRINT_ALL=0;
  FILE *file_out; int ia, i=0, cart=0, k=0, j=0, ik=0, ires;
  char outfile[200], xyz[4];

  strcpy(xyz, "xyz");
  sprintf(outfile, "%s.Modes_%s.dat", nameout, label);
  file_out=fopen(outfile, "w");
  printf("Writing normal modes to file %s\n", outfile);

  fprintf(file_out, "# %d degrees of freedom: %s\n", N, label);
  fprintf(file_out, "# Contribution to fluctuation: ");
  for(ia=0; ia<N_print; ia++)
    if((select[ia])||PRINT_ALL)
      fprintf(file_out, "\t%.3g", sigma2[ia]/sum_sigma2);
  fprintf(file_out, "\n");
  fprintf(file_out, "# e_values:                    ");
  for(ia=0; ia<N_print; ia++)
    if((select[ia])||PRINT_ALL)
      fprintf(file_out, "\t%.3g", 1./sigma2[ia]);
  fprintf(file_out, "\n");
  fprintf(file_out, "# collectivity:                ");
  for(ia=0; ia<N_print; ia++)
    if((select[ia])||PRINT_ALL)
      fprintf(file_out, "\t%.3g", collectivity[ia]);
  fprintf(file_out, "\n");

  if(strncmp(label, "Cart", 4)==0)cart=1;
  for(i=0; i<N; i++){
    fprintf(file_out, "%4d", i);
    for(ia=0; ia<N_print; ia++)
      if((select[ia])||PRINT_ALL)
	fprintf(file_out, "\t%11.5g", Mode[ia][i]);
    if(cart==0){
      if(axe[i].type=='f'){fprintf(file_out, "\tphi");}
      else if(axe[i].type=='p'){fprintf(file_out, "\tpsi");}
      else if(axe[i].type=='l'){fprintf(file_out, "\tlen");}
      else if(axe[i].type=='a'){fprintf(file_out, "\tban");}
      else if(axe[i].type=='t'){fprintf(file_out, "\ttan");}
      else{ fprintf(file_out, "\t%c", axe[i].type);}
      sscanf(seq[axe[i].bond->atom->res].pdbres, "%d", &ires);
      fprintf(file_out, "%d\n", ires);
    }else{
      k=i/3; j=i-3*k; ik=atom_num[k];
      sscanf(seq[atoms[ik].res].pdbres, "%d", &ires);
      fprintf(file_out, "\t%s%d%c\n", atoms[ik].name, ires, xyz[j]);
    }
  }

  fclose(file_out);

}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x140, %rsp            # imm = 0x140
movl 0x58(%rbp), %eax
movq 0x50(%rbp), %rax
movl 0x48(%rbp), %eax
movq 0x40(%rbp), %rax
movl 0x38(%rbp), %eax
movq 0x30(%rbp), %rax
movl 0x28(%rbp), %eax
movq 0x20(%rbp), %rax
movq 0x18(%rbp), %rax
movq 0x10(%rbp), %rax
movl %edi, -0x4(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movl %r8d, -0x24(%rbp)
movq %r9, -0x30(%rbp)
movsd %xmm0, -0x38(%rbp)
movl $0x0, -0x3c(%rbp)
movl $0x0, -0x50(%rbp)
movl $0x0, -0x54(%rbp)
movl $0x0, -0x58(%rbp)
movl $0x0, -0x5c(%rbp)
movl $0x0, -0x60(%rbp)
leaq -0x134(%rbp), %rdi
leaq 0x24d7d(%rip), %rsi     # 0x820b0
callq 0x1060
leaq -0x130(%rbp), %rdi
movq -0x10(%rbp), %rdx
movq -0x18(%rbp), %rcx
leaq 0x24d66(%rip), %rsi     # 0x820b4
movb $0x0, %al
callq 0x1200
leaq -0x130(%rbp), %rdi
leaq 0x1f00f(%rip), %rsi     # 0x7c372
callq 0x11b0
movq %rax, -0x48(%rbp)
leaq -0x130(%rbp), %rsi
leaq 0x2118c(%rip), %rdi     # 0x7e506
movb $0x0, %al
callq 0x10d0
movq -0x48(%rbp), %rdi
movl -0x24(%rbp), %edx
movq -0x18(%rbp), %rcx
leaq 0x21194(%rip), %rsi     # 0x7e527
movb $0x0, %al
callq 0x1150
movq -0x48(%rbp), %rdi
leaq 0x24d1f(%rip), %rsi     # 0x820c4
movb $0x0, %al
callq 0x1150
movl $0x0, -0x4c(%rbp)
movl -0x4c(%rbp), %eax
cmpl -0x4(%rbp), %eax
jge 0x5d404
movq -0x20(%rbp), %rax
movslq -0x4c(%rbp), %rcx
cmpl $0x0, (%rax,%rcx,4)
jne 0x5d3cf
cmpl $0x0, -0x3c(%rbp)
je 0x5d3f7
movq -0x48(%rbp), %rdi
movq 0x18(%rbp), %rax
movslq -0x4c(%rbp), %rcx
movss (%rax,%rcx,4), %xmm0
cvtss2sd %xmm0, %xmm0
divsd -0x38(%rbp), %xmm0
leaq 0x1f5ad(%rip), %rsi     # 0x7c99d
movb $0x1, %al
callq 0x1150
jmp 0x5d3f9
movl -0x4c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x4c(%rbp)
jmp 0x5d3b3
movq -0x48(%rbp), %rdi
leaq 0x20c69(%rip), %rsi     # 0x7e078
movb $0x0, %al
callq 0x1150
movq -0x48(%rbp), %rdi
leaq 0x21142(%rip), %rsi     # 0x7e563
movb $0x0, %al
callq 0x1150
movl $0x0, -0x4c(%rbp)
movl -0x4c(%rbp), %eax
cmpl -0x4(%rbp), %eax
jge 0x5d487
movq -0x20(%rbp), %rax
movslq -0x4c(%rbp), %rcx
cmpl $0x0, (%rax,%rcx,4)
jne 0x5d44b
cmpl $0x0, -0x3c(%rbp)
je 0x5d47a
movq -0x48(%rbp), %rdi
movq 0x18(%rbp), %rax
movslq -0x4c(%rbp), %rcx
movss (%rax,%rcx,4), %xmm0
cvtss2sd %xmm0, %xmm1
movsd 0x18be0(%rip), %xmm0    # 0x76048
divsd %xmm1, %xmm0
leaq 0x1f52a(%rip), %rsi     # 0x7c99d
movb $0x1, %al
callq 0x1150
jmp 0x5d47c
movl -0x4c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x4c(%rbp)
jmp 0x5d42f
movq -0x48(%rbp), %rdi
leaq 0x20be6(%rip), %rsi     # 0x7e078
movb $0x0, %al
callq 0x1150
movq -0x48(%rbp), %rdi
leaq 0x24c40(%rip), %rsi     # 0x820e4
movb $0x0, %al
callq 0x1150
movl $0x0, -0x4c(%rbp)
movl -0x4c(%rbp), %eax
cmpl -0x4(%rbp), %eax
jge 0x5d4fe
movq -0x20(%rbp), %rax
movslq -0x4c(%rbp), %rcx
cmpl $0x0, (%rax,%rcx,4)
jne 0x5d4ce
cmpl $0x0, -0x3c(%rbp)
je 0x5d4f1
movq -0x48(%rbp), %rdi
movq 0x10(%rbp), %rax
movslq -0x4c(%rbp), %rcx
movss (%rax,%rcx,4), %xmm0
cvtss2sd %xmm0, %xmm0
leaq 0x1f4b3(%rip), %rsi     # 0x7c99d
movb $0x1, %al
callq 0x1150
jmp 0x5d4f3
movl -0x4c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x4c(%rbp)
jmp 0x5d4b2
movq -0x48(%rbp), %rdi
leaq 0x20b6f(%rip), %rsi     # 0x7e078
movb $0x0, %al
callq 0x1150
movq -0x18(%rbp), %rdi
leaq 0x1a0a1(%rip), %rsi     # 0x775bc
movl $0x4, %edx
callq 0x1050
cmpl $0x0, %eax
jne 0x5d531
movl $0x1, -0x54(%rbp)
movl $0x0, -0x50(%rbp)
movl -0x50(%rbp), %eax
cmpl -0x24(%rbp), %eax
jge 0x5d7d5
movq -0x48(%rbp), %rdi
movl -0x50(%rbp), %edx
leaq 0x21031(%rip), %rsi     # 0x7e583
movb $0x0, %al
callq 0x1150
movl $0x0, -0x4c(%rbp)
movl -0x4c(%rbp), %eax
cmpl -0x4(%rbp), %eax
jge 0x5d5b4
movq -0x20(%rbp), %rax
movslq -0x4c(%rbp), %rcx
cmpl $0x0, (%rax,%rcx,4)
jne 0x5d57c
cmpl $0x0, -0x3c(%rbp)
je 0x5d5a7
movq -0x48(%rbp), %rdi
movq -0x30(%rbp), %rax
movslq -0x4c(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x50(%rbp), %rcx
movss (%rax,%rcx,4), %xmm0
cvtss2sd %xmm0, %xmm0
leaq 0x24b64(%rip), %rsi     # 0x82104
movb $0x1, %al
callq 0x1150
jmp 0x5d5a9
movl -0x4c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x4c(%rbp)
jmp 0x5d560
cmpl $0x0, -0x54(%rbp)
jne 0x5d734
movq 0x20(%rbp), %rax
movslq -0x50(%rbp), %rcx
imulq $0x158, %rcx, %rcx      # imm = 0x158
addq %rcx, %rax
movsbl (%rax), %eax
cmpl $0x66, %eax
jne 0x5d5ef
movq -0x48(%rbp), %rdi
leaq 0x24b29(%rip), %rsi     # 0x8210c
movb $0x0, %al
callq 0x1150
jmp 0x5d6dc
movq 0x20(%rbp), %rax
movslq -0x50(%rbp), %rcx
imulq $0x158, %rcx, %rcx      # imm = 0x158
addq %rcx, %rax
movsbl (%rax), %eax
cmpl $0x70, %eax
jne 0x5d620
movq -0x48(%rbp), %rdi
leaq 0x24afd(%rip), %rsi     # 0x82111
movb $0x0, %al
callq 0x1150
jmp 0x5d6da
movq 0x20(%rbp), %rax
movslq -0x50(%rbp), %rcx
imulq $0x158, %rcx, %rcx      # imm = 0x158
addq %rcx, %rax
movsbl (%rax), %eax
cmpl $0x6c, %eax
jne 0x5d651
movq -0x48(%rbp), %rdi
leaq 0x24ad1(%rip), %rsi     # 0x82116
movb $0x0, %al
callq 0x1150
jmp 0x5d6d8
movq 0x20(%rbp), %rax
movslq -0x50(%rbp), %rcx
imulq $0x158, %rcx, %rcx      # imm = 0x158
addq %rcx, %rax
movsbl (%rax), %eax
cmpl $0x61, %eax
jne 0x5d67f
movq -0x48(%rbp), %rdi
leaq 0x24aa5(%rip), %rsi     # 0x8211b
movb $0x0, %al
callq 0x1150
jmp 0x5d6d6
movq 0x20(%rbp), %rax
movslq -0x50(%rbp), %rcx
imulq $0x158, %rcx, %rcx      # imm = 0x158
addq %rcx, %rax
movsbl (%rax), %eax
cmpl $0x74, %eax
jne 0x5d6ad
movq -0x48(%rbp), %rdi
leaq 0x24a7c(%rip), %rsi     # 0x82120
movb $0x0, %al
callq 0x1150
jmp 0x5d6d4
movq -0x48(%rbp), %rdi
movq 0x20(%rbp), %rax
movslq -0x50(%rbp), %rcx
imulq $0x158, %rcx, %rcx      # imm = 0x158
addq %rcx, %rax
movsbl (%rax), %edx
leaq 0x25568(%rip), %rsi     # 0x82c35
movb $0x0, %al
callq 0x1150
jmp 0x5d6d6
jmp 0x5d6d8
jmp 0x5d6da
jmp 0x5d6dc
movq 0x40(%rbp), %rdi
movq 0x20(%rbp), %rax
movslq -0x50(%rbp), %rcx
imulq $0x158, %rcx, %rcx      # imm = 0x158
addq %rcx, %rax
movq 0x8(%rax), %rax
movq (%rax), %rax
movslq 0x64(%rax), %rax
shlq $0x5, %rax
addq %rax, %rdi
addq $0xd, %rdi
leaq 0x24f9f(%rip), %rsi     # 0x826ae
leaq -0x64(%rbp), %rdx
movb $0x0, %al
callq 0x11a0
movq -0x48(%rbp), %rdi
movl -0x64(%rbp), %edx
leaq 0x22dfb(%rip), %rsi     # 0x80523
movb $0x0, %al
callq 0x1150
jmp 0x5d7c5
movl -0x50(%rbp), %eax
movl $0x3, %ecx
cltd
idivl %ecx
movl %eax, -0x58(%rbp)
movl -0x50(%rbp), %eax
imull $0x3, -0x58(%rbp), %ecx
subl %ecx, %eax
movl %eax, -0x5c(%rbp)
movq 0x50(%rbp), %rax
movslq -0x58(%rbp), %rcx
movl (%rax,%rcx,4), %eax
movl %eax, -0x60(%rbp)
movq 0x40(%rbp), %rdi
movq 0x30(%rbp), %rax
movslq -0x60(%rbp), %rcx
imulq $0x70, %rcx, %rcx
addq %rcx, %rax
movslq 0x64(%rax), %rax
shlq $0x5, %rax
addq %rax, %rdi
addq $0xd, %rdi
leaq 0x24f29(%rip), %rsi     # 0x826ae
leaq -0x64(%rbp), %rdx
movb $0x0, %al
callq 0x11a0
movq -0x48(%rbp), %rdi
movq 0x30(%rbp), %rdx
movslq -0x60(%rbp), %rax
imulq $0x70, %rax, %rax
addq %rax, %rdx
addq $0x18, %rdx
movl -0x64(%rbp), %ecx
movslq -0x5c(%rbp), %rax
movsbl -0x134(%rbp,%rax), %r8d
leaq 0x24967(%rip), %rsi     # 0x82125
movb $0x0, %al
callq 0x1150
jmp 0x5d7c7
movl -0x50(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x50(%rbp)
jmp 0x5d538
movq -0x48(%rbp), %rdi
callq 0x10a0
addq $0x140, %rsp            # imm = 0x140
popq %rbp
retq
nopw (%rax,%rax)