// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x160, %rsp            # imm = 0x160
movl 0x20(%rbp), %eax
movq 0x18(%rbp), %rax
movl 0x10(%rbp), %eax
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq %rdx, -0x18(%rbp)
movss %xmm0, -0x1c(%rbp)
movss %xmm1, -0x20(%rbp)
movss %xmm2, -0x24(%rbp)
movss %xmm3, -0x28(%rbp)
movss %xmm4, -0x2c(%rbp)
movss %xmm5, -0x30(%rbp)
movq %rcx, -0x38(%rbp)
movl %r8d, -0x3c(%rbp)
movq %r9, -0x48(%rbp)
movq -0x38(%rbp), %rax
movq %rax, -0x138(%rbp)
movl $0x0, -0x124(%rbp)
cmpl $0xa, -0x124(%rbp)
jge 0x5d878
movslq -0x124(%rbp), %rax
movb $0x0, -0x142(%rbp,%rax)
movl -0x124(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x124(%rbp)
jmp 0x5d84f
leaq -0x120(%rbp), %rdi
movq -0x8(%rbp), %rdx
leaq 0x248a4(%rip), %rsi     # 0x8212e
movb $0x0, %al
callq 0x1200
cmpl $0x1, -0xc(%rbp)
jge 0x5d8da
leaq -0x120(%rbp), %rdi
leaq 0x1eacd(%rip), %rsi     # 0x7c372
callq 0x11b0
movq %rax, -0x50(%rbp)
leaq -0x120(%rbp), %rsi
leaq 0x20ae1(%rip), %rdi     # 0x7e39d
movb $0x0, %al
callq 0x10d0
movq -0x50(%rbp), %rdi
leaq 0x2486d(%rip), %rsi     # 0x8213b
movb $0x0, %al
callq 0x1150
jmp 0x5d960
leaq -0x120(%rbp), %rdi
leaq 0x21362(%rip), %rsi     # 0x7ec4a
callq 0x11b0
movq %rax, -0x50(%rbp)
movq -0x50(%rbp), %rdi
movl -0xc(%rbp), %edx
addl $0x1, %edx
leaq 0x20b23(%rip), %rsi     # 0x7e425
movb $0x0, %al
callq 0x1150
movq -0x50(%rbp), %rdi
movl -0xc(%rbp), %edx
movss -0x30(%rbp), %xmm0
cvtss2sd %xmm0, %xmm0
movsd 0x1e6ff(%rip), %xmm1    # 0x7c020
mulsd %xmm1, %xmm0
leaq 0x20a9b(%rip), %rsi     # 0x7e3c7
movb $0x1, %al
callq 0x1150
movq -0x50(%rbp), %rdi
movss -0x20(%rbp), %xmm0
cvtss2sd %xmm0, %xmm0
movss -0x24(%rbp), %xmm1
cvtss2sd %xmm1, %xmm1
movss -0x28(%rbp), %xmm2
cvtss2sd %xmm2, %xmm2
leaq 0x247fe(%rip), %rsi     # 0x82157
movb $0x3, %al
callq 0x1150
movl $0x0, -0x154(%rbp)
movl $0x0, -0x124(%rbp)
movl -0x124(%rbp), %eax
cmpl 0x20(%rbp), %eax
jge 0x5db52
imull $0x3, -0x124(%rbp), %eax
movl %eax, -0x158(%rbp)
movq -0x38(%rbp), %rax
movq 0x18(%rbp), %rcx
movslq -0x124(%rbp), %rdx
movslq (%rcx,%rdx,4), %rcx
imulq $0x70, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0x138(%rbp)
movl $0x0, -0x128(%rbp)
cmpl $0x3, -0x128(%rbp)
jge 0x5da49
movq -0x138(%rbp), %rax
movslq -0x128(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm0
cvtsd2ss %xmm0, %xmm0
movslq -0x128(%rbp), %rax
movss %xmm0, -0x150(%rbp,%rax,4)
cmpl $0x0, -0xc(%rbp)
jl 0x5da33
movq -0x18(%rbp), %rax
movl -0x158(%rbp), %ecx
addl -0x128(%rbp), %ecx
movslq %ecx, %rcx
movss (%rax,%rcx,4), %xmm0
movss -0x1c(%rbp), %xmm2
movslq -0x128(%rbp), %rax
movss -0x150(%rbp,%rax,4), %xmm1
mulss %xmm2, %xmm0
addss %xmm1, %xmm0
movss %xmm0, -0x150(%rbp,%rax,4)
jmp 0x5da35
movl -0x128(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x128(%rbp)
jmp 0x5d9bb
movq -0x138(%rbp), %rax
movl 0x64(%rax), %eax
movl %eax, -0x12c(%rbp)
leaq -0x142(%rbp), %rdi
movq -0x48(%rbp), %rax
movslq -0x12c(%rbp), %rcx
shlq $0x5, %rcx
addq %rcx, %rax
movswl 0x14(%rax), %esi
callq 0x37330
cmpl $0x1869f, -0x154(%rbp)  # imm = 0x1869F
jge 0x5da96
movl -0x154(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x154(%rbp)
movq -0x50(%rbp), %rdi
movl -0x154(%rbp), %edx
movq -0x138(%rbp), %rcx
addq $0x18, %rcx
leaq -0x142(%rbp), %r8
leaq 0x3e8ef(%rip), %rax     # 0x9c3a8
movsbl (%rax), %r9d
movq -0x48(%rbp), %rax
movslq -0x12c(%rbp), %rsi
shlq $0x5, %rsi
addq %rsi, %rax
addq $0xd, %rax
movss -0x150(%rbp), %xmm0
cvtss2sd %xmm0, %xmm0
movss -0x14c(%rbp), %xmm1
cvtss2sd %xmm1, %xmm1
movss -0x148(%rbp), %xmm2
cvtss2sd %xmm2, %xmm2
movq -0x138(%rbp), %rsi
movss 0x1c(%rsi), %xmm3
cvtss2sd %xmm3, %xmm4
leaq 0x20921(%rip), %rsi     # 0x7e42f
movsd 0x18532(%rip), %xmm3    # 0x76048
movq %rax, (%rsp)
movb $0x5, %al
callq 0x1150
movq -0x38(%rbp), %rax
movq -0x138(%rbp), %rcx
movslq 0x4c(%rcx), %rcx
imulq $0x70, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0x138(%rbp)
movl -0x124(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x124(%rbp)
jmp 0x5d974
movq -0x50(%rbp), %rdi
leaq 0x20907(%rip), %rsi     # 0x7e464
movb $0x0, %al
callq 0x1150
movq -0x50(%rbp), %rdi
callq 0x10a0
xorl %eax, %eax
addq $0x160, %rsp            # imm = 0x160
popq %rbp
retq
nopl (%rax,%rax)