// File: /workspace/github_c_makefile_star2_O1/ugobas[P]tnm/output_tnm.c
// Function: Print_tors_fluct
void Print_tors_fluct(struct axe *axe, int N_axes, float *fluct,
		      atom *atoms, struct residue *seq,
		      char *name, char *type)
{
  float MAX_B=100.0, f; int i, ia=0, n=1;
  FILE *file_out=fopen(name, "w");
  printf("Writing %s\n", name);
  fprintf(file_out, "MODEL %d  B_factor = %s\n", n, type);

  { // Normalize such that max_fluctuation = MAX_B
    float max_f=0, norm;
    for(i=0; i<N_axes; i++)if(fluct[i]>max_f)max_f=fluct[i];
    norm=MAX_B/max_f;
    for(i=0; i<N_axes; i++)fluct[i]*=norm;
  }

  for(i=0; i<N_axes; i++){
    if(axe[i].type=='f'){
      Print_atom(axe[i].bond->previous->atom, &ia, fluct[i], seq, file_out);
      f=fluct[i]; if(i+1<N_axes)f=0.5*(f+fluct[i+1]);
      Print_atom(axe[i].bond->atom, &ia, f, seq, file_out);
    }else if(axe[i].type=='p'){
      if(ia==0)
	Print_atom(axe[i].bond->previous->atom, &ia, fluct[i], seq, file_out);
      Print_atom(axe[i].bond->atom, &ia, fluct[i], seq, file_out);
    }
  }
  fprintf(file_out, "ENDMDL\n");
  fclose(file_out);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %r9, %r13
movq %r8, 0x10(%rsp)
movq %rdx, %r14
movl %esi, %ebx
movq %rdi, %r12
movq 0x50(%rsp), %rbp
movl $0x0, 0xc(%rsp)
leaq 0x1513e(%rip), %rsi     # 0x57240
movq %r9, %rdi
callq 0x2210
movq %rax, %r15
leaq 0xfbc7(%rip), %rdi      # 0x51cdb
movq %r13, %rsi
xorl %eax, %eax
callq 0x20f0
leaq 0x1ae2e(%rip), %rsi     # 0x5cf53
movq %r15, %rdi
movl $0x1, %edx
movq %rbp, %rcx
xorl %eax, %eax
callq 0x2190
movl %ebx, %ebp
testl %ebx, %ebx
jle 0x42159
xorps %xmm1, %xmm1
xorl %eax, %eax
movss (%r14,%rax,4), %xmm0
maxss %xmm1, %xmm0
incq %rax
movaps %xmm0, %xmm1
cmpq %rax, %rbp
jne 0x42142
jmp 0x4215c
xorps %xmm0, %xmm0
testl %ebx, %ebx
jle 0x42186
movss 0xeeac(%rip), %xmm1     # 0x51014
divss %xmm0, %xmm1
xorl %eax, %eax
movss (%r14,%rax,4), %xmm0
mulss %xmm1, %xmm0
movss %xmm0, (%r14,%rax,4)
incq %rax
cmpq %rax, %rbp
jne 0x4216e
testl %ebx, %ebx
jle 0x4225e
addq $0x8, %r12
movq %rbp, %r13
negq %r13
movl $0x1, %ebx
movzbl -0x8(%r12), %eax
cmpl $0x70, %eax
je 0x421f8
cmpl $0x66, %eax
jne 0x42243
movq (%r12), %rax
movq 0x28(%rax), %rax
movq (%rax), %rdi
movss -0x4(%r14,%rbx,4), %xmm0
leaq 0xc(%rsp), %rsi
movq 0x10(%rsp), %rdx
movq %r15, %rcx
callq 0x42038
movss -0x4(%r14,%rbx,4), %xmm0
cmpq %rbp, %rbx
jae 0x421ef
addss (%r14,%rbx,4), %xmm0
mulss 0x1398d(%rip), %xmm0    # 0x55b7c
movq (%r12), %rax
movq (%rax), %rdi
jmp 0x42231
cmpl $0x0, 0xc(%rsp)
jne 0x42223
movq (%r12), %rax
movq 0x28(%rax), %rax
movq (%rax), %rdi
movss -0x4(%r14,%rbx,4), %xmm0
leaq 0xc(%rsp), %rsi
movq 0x10(%rsp), %rdx
movq %r15, %rcx
callq 0x42038
movq (%r12), %rax
movq (%rax), %rdi
movss -0x4(%r14,%rbx,4), %xmm0
leaq 0xc(%rsp), %rsi
movq 0x10(%rsp), %rdx
movq %r15, %rcx
callq 0x42038
addq $0x158, %r12            # imm = 0x158
leaq (%rbx,%r13), %rax
incq %rax
incq %rbx
cmpq $0x1, %rax
jne 0x4219d
leaq 0x17040(%rip), %rdi     # 0x592a5
movl $0x7, %esi
movl $0x1, %edx
movq %r15, %rcx
callq 0x2280
movq %r15, %rdi
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x20c0