// File: /workspace/github_c_makefile_star2_O1/ugobas[P]tnm/nma.c
// Function: Print_B_fact
void Print_B_fact(float *B_TNM, float *B_pred_all, float *B_exp,
		  int N, atom *atoms, int *atom_ref, struct residue *seq,
		  char *name, char *what, float cc, float slope,
		  float *dof, char ridge)
{
  char nameout[200];  int i;
  atom *atom1=NULL;
  FILE *file_out;

  //sprintf(nameout, "%s_%s.dat", name, what);
  sprintf(nameout, "%s.MSF.dat", name);
  file_out=fopen(nameout, "w");
  printf("Writing %s\n", nameout);
  if(B_pred_all && B_exp) {
    fprintf(file_out, "# Ridge regression of type %c\n", ridge);
    fprintf(file_out, "# slope=%.4g corr.=%.3f (%s)\n", slope, cc, what);
    fprintf(file_out, "# Internal_fluct= %.3f", dof[0]);
    fprintf(file_out, " Translation_fluct= %.3f", dof[1]);
    fprintf(file_out, " Rotation_fluct= %.3f\n", dof[2]);
    fprintf(file_out, "# aa_pos_chain pred_msd_int pred_msd_all B/(8pi^2/3)\n");
  }else{
    fprintf(file_out, "# aa_pos_chain pred_msd_internal\n");
  }
  
  for(i=0; i<N; i++){atom1=atoms+atom_ref[i];
    struct residue *r=seq+atom1->res;
    int j;
    for(j=(int)sizeof(r->pdbres)-1; j>=0; j--){
      if(r->pdbres[j]==' '){r->pdbres[j]='\0';}
      else{break;}
    }
    for(j=0; j<(int)sizeof(r->pdbres); j++)
    	if(r->pdbres[j]!=' ')break;
    char name[20];
    sprintf(name, "%c%s%c", r->amm, r->pdbres+j, r->chain);
    fprintf(file_out, "%s\t%.4g", name, B_TNM[i]);
    if(B_pred_all && B_exp)
      fprintf(file_out, "\t%7.3f\t%7.3f", B_pred_all[i], B_exp[i]);
    fprintf(file_out, "\n");
  }
  fclose(file_out);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x118, %rsp            # imm = 0x118
movss %xmm1, 0x8(%rsp)
movss %xmm0, 0xc(%rsp)
movq %r9, 0x28(%rsp)
movq %r8, 0x20(%rsp)
movl %ecx, %r12d
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r13
movq 0x158(%rsp), %rdx
leaq 0x2ffa6(%rip), %rsi     # 0x590b0
leaq 0x50(%rsp), %r15
movq %r15, %rdi
xorl %eax, %eax
callq 0x2260
leaq 0x2e120(%rip), %rsi     # 0x57240
movq %r15, %rdi
callq 0x2210
movq %rax, %rbp
leaq 0x28ba9(%rip), %rdi     # 0x51cdb
movq %r15, %rsi
xorl %eax, %eax
callq 0x20f0
movq %r14, 0x10(%rsp)
testq %r14, %r14
setne %al
movq %rbx, 0x18(%rsp)
testq %rbx, %rbx
setne %r15b
andb %al, %r15b
cmpb $0x1, %r15b
jne 0x2920d
movq 0x168(%rsp), %rbx
movl %r12d, %r14d
movq 0x160(%rsp), %r12
movsbl 0x170(%rsp), %edx
leaq 0x2ff39(%rip), %rsi     # 0x590bb
movq %rbp, %rdi
xorl %eax, %eax
callq 0x2190
xorps %xmm0, %xmm0
cvtss2sd 0x8(%rsp), %xmm0
xorps %xmm1, %xmm1
cvtss2sd 0xc(%rsp), %xmm1
leaq 0x2ff35(%rip), %rsi     # 0x590da
movq %rbp, %rdi
movq %r12, %rdx
movl %r14d, %r12d
movb $0x2, %al
callq 0x2190
xorps %xmm0, %xmm0
cvtss2sd (%rbx), %xmm0
leaq 0x2ff35(%rip), %rsi     # 0x590f8
movq %rbp, %rdi
movb $0x1, %al
callq 0x2190
xorps %xmm0, %xmm0
cvtss2sd 0x4(%rbx), %xmm0
leaq 0x2ff33(%rip), %rsi     # 0x5910f
movq %rbp, %rdi
movb $0x1, %al
callq 0x2190
xorps %xmm0, %xmm0
cvtss2sd 0x8(%rbx), %xmm0
leaq 0x2ff33(%rip), %rsi     # 0x59128
movq %rbp, %rdi
movb $0x1, %al
callq 0x2190
leaq 0x2ff39(%rip), %rdi     # 0x5913f
movl $0x35, %esi
jmp 0x29219
leaq 0x2ff61(%rip), %rdi     # 0x59175
movl $0x21, %esi
movl $0x1, %edx
movq %rbp, %rcx
callq 0x2280
testl %r12d, %r12d
jle 0x29318
movl %r12d, %ebx
leaq 0x30(%rsp), %r12
xorl %r14d, %r14d
movq 0x28(%rsp), %rax
movslq (%rax,%r14,4), %rax
imulq $0x70, %rax, %rax
movq 0x20(%rsp), %rcx
movslq 0x64(%rcx,%rax), %rax
shlq $0x5, %rax
addq 0x150(%rsp), %rax
movl $0x5, %ecx
movl %ecx, %ecx
cmpb $0x20, 0xd(%rax,%rcx)
jne 0x29275
movb $0x0, 0xd(%rax,%rcx)
addl $-0x1, %ecx
jb 0x29262
xorl %ecx, %ecx
cmpb $0x20, 0xd(%rax,%rcx)
jne 0x2928c
incq %rcx
cmpq $0x6, %rcx
jne 0x29277
movl $0x6, %ecx
movsbl 0x13(%rax), %edx
movl %ecx, %ecx
addq %rax, %rcx
addq $0xd, %rcx
movsbl 0xc(%rax), %r8d
movq %r12, %rdi
leaq 0x2d022(%rip), %rsi     # 0x562ca
xorl %eax, %eax
callq 0x2260
xorps %xmm0, %xmm0
cvtss2sd (%r13,%r14,4), %xmm0
movq %rbp, %rdi
leaq 0x2fed4(%rip), %rsi     # 0x59197
movq %r12, %rdx
movb $0x1, %al
callq 0x2190
testb %r15b, %r15b
je 0x292ff
movq 0x10(%rsp), %rax
xorps %xmm0, %xmm0
cvtss2sd (%rax,%r14,4), %xmm0
movq 0x18(%rsp), %rax
xorps %xmm1, %xmm1
cvtss2sd (%rax,%r14,4), %xmm1
movq %rbp, %rdi
leaq 0x2fea7(%rip), %rsi     # 0x5919f
movb $0x2, %al
callq 0x2190
movl $0xa, %edi
movq %rbp, %rsi
callq 0x2140
incq %r14
cmpq %rbx, %r14
jne 0x2923a
movq %rbp, %rdi
callq 0x20c0
addq $0x118, %rsp            # imm = 0x118
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq