// File: /workspace/github_c_makefile_star2_O3/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, (%rsp)
movss %xmm0, 0x4(%rsp)
movq %r9, 0x28(%rsp)
movq %r8, 0x20(%rsp)
movl %ecx, %r13d
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, 0x18(%rsp)
movq 0x158(%rsp), %rdx
leaq 0x302a5(%rip), %rsi     # 0x5905d
leaq 0x50(%rsp), %r15
movq %r15, %rdi
xorl %eax, %eax
callq 0x2270
leaq 0x2e432(%rip), %rsi     # 0x57200
movq %r15, %rdi
callq 0x2220
movq %rax, %rbp
leaq 0x28f6f(%rip), %rdi     # 0x51d4f
movq %r15, %rsi
xorl %eax, %eax
callq 0x20f0
movq %r14, 0x8(%rsp)
testq %r14, %r14
setne %al
movq %rbx, 0x10(%rsp)
testq %rbx, %rbx
setne %r15b
andb %al, %r15b
cmpb $0x1, %r15b
jne 0x28eb4
movq 0x168(%rsp), %rbx
movq 0x160(%rsp), %r12
movsbl 0x170(%rsp), %edx
leaq 0x3023b(%rip), %rsi     # 0x59068
movq %rbp, %rdi
xorl %eax, %eax
callq 0x21a0
xorps %xmm0, %xmm0
cvtss2sd (%rsp), %xmm0
xorps %xmm1, %xmm1
cvtss2sd 0x4(%rsp), %xmm1
leaq 0x30238(%rip), %rsi     # 0x59087
movq %rbp, %rdi
movq %r12, %rdx
movb $0x2, %al
callq 0x21a0
xorps %xmm0, %xmm0
cvtss2sd (%rbx), %xmm0
leaq 0x3023b(%rip), %rsi     # 0x590a5
movq %rbp, %rdi
movb $0x1, %al
callq 0x21a0
xorps %xmm0, %xmm0
cvtss2sd 0x4(%rbx), %xmm0
leaq 0x30239(%rip), %rsi     # 0x590bc
movq %rbp, %rdi
movb $0x1, %al
callq 0x21a0
xorps %xmm0, %xmm0
cvtss2sd 0x8(%rbx), %xmm0
leaq 0x30239(%rip), %rsi     # 0x590d5
movq %rbp, %rdi
movb $0x1, %al
callq 0x21a0
leaq 0x3023f(%rip), %rdi     # 0x590ec
movl $0x35, %esi
jmp 0x28ec0
leaq 0x30267(%rip), %rdi     # 0x59122
movl $0x21, %esi
movl $0x1, %edx
movq %rbp, %rcx
callq 0x2290
testl %r13d, %r13d
jle 0x28fc7
movq 0x150(%rsp), %rbx
movl %r13d, %r14d
leaq 0x30(%rsp), %r12
xorl %r13d, %r13d
movq 0x28(%rsp), %rax
movslq (%rax,%r13,4), %rax
imulq $0x70, %rax, %rax
movq 0x20(%rsp), %rcx
movslq 0x64(%rcx,%rax), %rcx
shlq $0x5, %rcx
leaq (%rbx,%rcx), %rax
addq %rbx, %rcx
addq $0xd, %rcx
movl $0x5, %edx
movl %edx, %edx
cmpb $0x20, (%rcx,%rdx)
jne 0x28f25
movb $0x0, (%rcx,%rdx)
addl $-0x1, %edx
jb 0x28f14
xorl %esi, %esi
cmpb $0x20, (%rcx,%rsi)
jne 0x28f3b
incq %rsi
cmpq $0x6, %rsi
jne 0x28f27
movl $0x6, %esi
movsbl 0x13(%rax), %edx
movl %esi, %esi
addq %rsi, %rcx
movsbl 0xc(%rax), %r8d
movq %r12, %rdi
leaq 0x2d38f(%rip), %rsi     # 0x562e2
xorl %eax, %eax
callq 0x2270
movq 0x18(%rsp), %rax
xorps %xmm0, %xmm0
cvtss2sd (%rax,%r13,4), %xmm0
movq %rbp, %rdi
leaq 0x301d2(%rip), %rsi     # 0x59144
movq %r12, %rdx
movb $0x1, %al
callq 0x21a0
testb %r15b, %r15b
je 0x28fae
movq 0x8(%rsp), %rax
xorps %xmm0, %xmm0
cvtss2sd (%rax,%r13,4), %xmm0
movq 0x10(%rsp), %rax
xorps %xmm1, %xmm1
cvtss2sd (%rax,%r13,4), %xmm1
movq %rbp, %rdi
leaq 0x301a5(%rip), %rsi     # 0x5914c
movb $0x2, %al
callq 0x21a0
movl $0xa, %edi
movq %rbp, %rsi
callq 0x2140
incq %r13
cmpq %r14, %r13
jne 0x28ee9
movq %rbp, %rdi
callq 0x20c0
addq $0x118, %rsp            # imm = 0x118
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq