// File: /workspace/github_c_makefile_star2_O2/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, %r15d
movq %rdx, %r14
movq %rsi, %r13
movq %rdi, 0x18(%rsp)
movq 0x158(%rsp), %rdx
leaq 0x2ccb2(%rip), %rsi     # 0x52fbd
leaq 0x50(%rsp), %rbx
movq %rbx, %rdi
xorl %eax, %eax
callq 0x2260
leaq 0x2ae2f(%rip), %rsi     # 0x51150
movq %rbx, %rdi
callq 0x2210
movq %rax, %r12
leaq 0x25974(%rip), %rdi     # 0x4bca7
movq %rbx, %rsi
xorl %eax, %eax
callq 0x20f0
movq %r13, 0x8(%rsp)
testq %r13, %r13
setne %al
movq %r14, 0x10(%rsp)
testq %r14, %r14
setne %bl
andb %al, %bl
cmpb $0x1, %bl
jne 0x263f6
movq 0x168(%rsp), %r13
movq 0x160(%rsp), %r14
movsbl 0x170(%rsp), %edx
leaq 0x2cc4b(%rip), %rsi     # 0x52fc8
movq %r12, %rdi
xorl %eax, %eax
callq 0x2190
cvtss2sd (%rsp), %xmm0
cvtss2sd 0x4(%rsp), %xmm1
leaq 0x2cc4e(%rip), %rsi     # 0x52fe7
movq %r12, %rdi
movq %r14, %rdx
movb $0x2, %al
callq 0x2190
cvtss2sd (%r13), %xmm0
leaq 0x2cc52(%rip), %rsi     # 0x53005
movq %r12, %rdi
movb $0x1, %al
callq 0x2190
cvtss2sd 0x4(%r13), %xmm0
leaq 0x2cc52(%rip), %rsi     # 0x5301c
movq %r12, %rdi
movb $0x1, %al
callq 0x2190
cvtss2sd 0x8(%r13), %xmm0
leaq 0x2cc54(%rip), %rsi     # 0x53035
movq %r12, %rdi
movb $0x1, %al
callq 0x2190
leaq 0x2cc5a(%rip), %rdi     # 0x5304c
pushq $0x35
jmp 0x263ff
leaq 0x2cc85(%rip), %rdi     # 0x53082
pushq $0x21
popq %rsi
pushq $0x1
popq %rdx
movq %r12, %rcx
callq 0x2280
xorl %eax, %eax
testl %r15d, %r15d
cmovlel %eax, %r15d
movq 0x150(%rsp), %rbp
leaq 0x30(%rsp), %r13
xorl %r14d, %r14d
cmpq %r15, %r14
je 0x264f7
movq 0x28(%rsp), %rax
movslq (%rax,%r14,4), %rax
imulq $0x70, %rax, %rax
movq 0x20(%rsp), %rcx
movslq 0x64(%rcx,%rax), %rcx
shlq $0x5, %rcx
leaq (%rcx,%rbp), %rax
addq %rbp, %rcx
addq $0xd, %rcx
pushq $0x5
popq %rdx
testl %edx, %edx
js 0x2646a
movl %edx, %esi
cmpb $0x20, (%rcx,%rsi)
jne 0x2646a
movb $0x0, (%rcx,%rsi)
decl %edx
jmp 0x26456
xorl %esi, %esi
cmpq $0x6, %rsi
je 0x2647d
cmpb $0x20, (%rcx,%rsi)
jne 0x2647d
incq %rsi
jmp 0x2646c
movsbl 0x13(%rax), %edx
addq %rsi, %rcx
movsbl 0xc(%rax), %r8d
movq %r13, %rdi
leaq 0x29d87(%rip), %rsi     # 0x5021a
xorl %eax, %eax
callq 0x2260
movq 0x18(%rsp), %rax
cvtss2sd (%rax,%r14,4), %xmm0
movq %r12, %rdi
leaq 0x2cbf5(%rip), %rsi     # 0x530a4
movq %r13, %rdx
movb $0x1, %al
callq 0x2190
testb %bl, %bl
je 0x264e4
movq 0x8(%rsp), %rax
cvtss2sd (%rax,%r14,4), %xmm0
movq 0x10(%rsp), %rax
cvtss2sd (%rax,%r14,4), %xmm1
movq %r12, %rdi
leaq 0x2cbcf(%rip), %rsi     # 0x530ac
movb $0x2, %al
callq 0x2190
pushq $0xa
popq %rdi
movq %r12, %rsi
callq 0x2140
incq %r14
jmp 0x26424
movq %r12, %rdi
callq 0x20c0
addq $0x118, %rsp            # imm = 0x118
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq