// File: /workspace/github_c_makefile_star2_O2/ugobas[P]tnm/output_tnm.c
// Function: Print_PDB_mode_old
int Print_PDB_mode_old(char *nameout, int ia, float *Cart_mode,
		       float Amplitude, float Cart_collectivity,
		       float Tors_collectivity, float MW_Tors_collectivity,
		       float eigen_value, float eigen_B,
		       atom *atoms, int natoms, struct residue *seq, int nres,
		       int *atom_num, int N_ref)
{
//Print_PDB_3(Cart_mode[ia], eigen_value[ia], eigen_B[ia], atoms,
//		  N_ref, atom_ref, seq, file_name, ia);
  FILE *file_out;  char outfile[200];
  //~ FILE * CHAIN[2];
  int i, j, k; atom *atom1=atoms;
  char aaname3[10];   float r[3];
  // Amplitude factors
  //~ float DTHETA=0;
  //~ float AMPL_FACTOR=16; // Amplification with respect to thermal fluctuations
  //~ float AMAX=120;      // New amplitude factor
  //~ float step, dtheta;
  //~ int N_STEP=10; // Number of conformations per normal mode
  //~ int i_step;
  //~ double norm;

  for(i=0; i<10; i++)aaname3[i]='\0';

  // Opening file
  sprintf(outfile, "%s_modes.pdb", nameout);
  if(ia<1){
    file_out=fopen(outfile, "w");
    printf("Writing normal modes in PDB format in %s\n", outfile);
    fprintf(file_out, "MODEL 0:  Native structure\n");
  }else{
    file_out=fopen(outfile, "a");
    fprintf(file_out, "MODEL %d\n", ia+1);
    fprintf(file_out, "REMARK  Normal mode %3d  Percent fluctuation= %.2f",
	    ia, eigen_B*100.0);
    fprintf(file_out,
	    "REMARK Collectivity: "
	    "Cartesian %.3f Torsional %.3f MW_Torsional %.3f\n",
	    Cart_collectivity, Tors_collectivity, MW_Tors_collectivity);
  }

  // Compute and print
  int jatom=0;
  for(i=0; i<N_ref; i++){
    int m=3*i;
    atom1=atoms+atom_num[i];
    for(j=0; j<3; j++){
      r[j]=atom1->r[j];
      if(ia>=0)r[j]+=Cart_mode[m+j]*Amplitude;
    }
    k=atom1->res; Name3(aaname3, seq[k].i_aa);
    if(jatom <99999)jatom++;
    fprintf(file_out,
	    "ATOM  %5d%4s  %3s %c%4s   %8.3f%8.3f%8.3f%6.2f%6.2f\n",
	    jatom, atom1->name, aaname3, chain,
	    seq[k].pdbres,  r[0], r[1], r[2], 1.0, atom1->B_factor);
    atom1=atoms+atom1->i_next;
  }
  fprintf(file_out, "ENDMDL\n");
  fclose(file_out);
  return(0);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x118, %rsp            # imm = 0x118
movq %r9, 0x48(%rsp)
movq %rcx, 0x40(%rsp)
movss %xmm5, 0x1c(%rsp)
movss %xmm3, 0x10(%rsp)
movss %xmm2, 0x8(%rsp)
movss %xmm1, 0x20(%rsp)
movq %rdx, %r15
movl %esi, %r12d
movq %rdi, %rdx
movl 0x160(%rsp), %r14d
xorl %eax, %eax
cmpq $0xa, %rax
je 0x3c35e
movb $0x0, 0x36(%rsp,%rax)
incq %rax
jmp 0x3c34e
movss %xmm0, 0x24(%rsp)
leaq 0x1a9b7(%rip), %rsi     # 0x56d22
leaq 0x50(%rsp), %rdi
xorl %eax, %eax
callq 0x2260
testl %r12d, %r12d
jle 0x3c3f2
leaq 0x17738(%rip), %rsi     # 0x53abb
leaq 0x50(%rsp), %rdi
callq 0x2210
movq %rax, %rbx
leal 0x1(%r12), %edx
leaq 0x16dd7(%rip), %rsi     # 0x53173
movq %rax, %rdi
xorl %eax, %eax
callq 0x2190
cvtss2sd 0x1c(%rsp), %xmm0
mulsd 0x14a7c(%rip), %xmm0    # 0x50e30
leaq 0x16d5a(%rip), %rsi     # 0x53115
movq %rbx, %rdi
movl %r12d, %edx
movb $0x1, %al
callq 0x2190
cvtss2sd 0x20(%rsp), %xmm0
cvtss2sd 0x8(%rsp), %xmm1
cvtss2sd 0x10(%rsp), %xmm2
leaq 0x1a96a(%rip), %rsi     # 0x56d4b
movq %rbx, 0x8(%rsp)
movq %rbx, %rdi
movb $0x3, %al
callq 0x2190
jmp 0x3c434
leaq 0x14d57(%rip), %rsi     # 0x51150
leaq 0x50(%rsp), %rbx
movq %rbx, %rdi
callq 0x2210
movq %rax, %r13
leaq 0x16cdb(%rip), %rdi     # 0x530eb
movq %rbx, %rsi
xorl %eax, %eax
callq 0x20f0
leaq 0x1a90e(%rip), %rdi     # 0x56d2f
pushq $0x1b
popq %rsi
pushq $0x1
popq %rdx
movq %r13, 0x8(%rsp)
movq %r13, %rcx
callq 0x2280
xorl %r13d, %r13d
testl %r14d, %r14d
cmovlel %r13d, %r14d
movq %r14, 0x10(%rsp)
xorl %r14d, %r14d
cmpq 0x10(%rsp), %r13
je 0x3c527
movq 0x158(%rsp), %rax
movslq (%rax,%r13,4), %rax
imulq $0x70, %rax, %rbx
addq 0x40(%rsp), %rbx
xorl %eax, %eax
movss 0x24(%rsp), %xmm2
cmpq $0x3, %rax
je 0x3c49d
cvtsd2ss (%rbx,%rax,8), %xmm0
movss %xmm0, 0x28(%rsp,%rax,4)
testl %r12d, %r12d
js 0x3c498
movss (%r15,%rax,4), %xmm1
mulss %xmm2, %xmm1
addss %xmm0, %xmm1
movss %xmm1, 0x28(%rsp,%rax,4)
incq %rax
jmp 0x3c46e
movslq 0x64(%rbx), %rax
shlq $0x5, %rax
movq 0x48(%rsp), %rcx
leaq (%rcx,%rax), %rbp
addq $0xd, %rbp
movswl 0x7(%rbp), %esi
leaq 0x36(%rsp), %rdi
callq 0x24647
cmpl $0x1869f, %r14d         # imm = 0x1869F
adcl $0x0, %r14d
cvtss2sd 0x28(%rsp), %xmm0
cvtss2sd 0x2c(%rsp), %xmm1
cvtss2sd 0x30(%rsp), %xmm2
leaq 0x37f04(%rip), %rax     # 0x743e8
movsbl (%rax), %r9d
cvtss2sd 0x1c(%rbx), %xmm4
addq $0x18, %rbx
movq %rbp, (%rsp)
movq 0x8(%rsp), %rdi
leaq 0x16c7c(%rip), %rsi     # 0x5317d
movl %r14d, %edx
movq %rbx, %rcx
leaq 0x36(%rsp), %r8
movsd 0xeb34(%rip), %xmm3     # 0x4b048
movb $0x5, %al
callq 0x2190
incq %r13
addq $0xc, %r15
jmp 0x3c446
leaq 0x16c84(%rip), %rdi     # 0x531b2
pushq $0x7
popq %rsi
pushq $0x1
popq %rdx
movq 0x8(%rsp), %rbx
movq %rbx, %rcx
callq 0x2280
movq %rbx, %rdi
callq 0x20c0
xorl %eax, %eax
addq $0x118, %rsp            # imm = 0x118
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq