// File: /workspace/github_c_makefile_star2_O2/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, %rbp
movq %r8, %rbx
movq %rdx, %r15
movl %esi, 0xc(%rsp)
movq %rdi, %r12
movq 0x50(%rsp), %rax
movq %rax, 0x10(%rsp)
andl $0x0, 0x8(%rsp)
leaq 0x1451a(%rip), %rsi     # 0x51150
movq %r9, %rdi
callq 0x2210
movq %rax, %r14
leaq 0xf05f(%rip), %rdi      # 0x4bca7
xorl %r13d, %r13d
movq %rbp, %rsi
xorl %eax, %eax
callq 0x20f0
leaq 0x1a227(%rip), %rsi     # 0x56e83
pushq $0x1
popq %rdx
movq %r14, %rdi
movq 0x10(%rsp), %rcx
xorl %eax, %eax
callq 0x2190
movl 0xc(%rsp), %eax
testl %eax, %eax
movl $0x0, %ebp
cmovgl %eax, %ebp
xorps %xmm1, %xmm1
cmpq %r13, %rbp
je 0x3cc96
movss (%r15,%r13,4), %xmm0
maxss %xmm1, %xmm0
incq %r13
movaps %xmm0, %xmm1
jmp 0x3cc7f
movss 0xe376(%rip), %xmm0     # 0x4b014
divss %xmm1, %xmm0
xorl %eax, %eax
cmpq %rax, %rbp
je 0x3ccbe
movss (%r15,%rax,4), %xmm1
mulss %xmm0, %xmm1
movss %xmm1, (%r15,%rax,4)
incq %rax
jmp 0x3cca4
negq %rbp
addq $0x8, %r12
pushq $0x1
popq %r13
movq %rbp, %rax
addq %r13, %rax
cmpq $0x1, %rax
je 0x3cd8a
movzbl -0x8(%r12), %eax
cmpl $0x70, %eax
je 0x3cd34
cmpl $0x66, %eax
jne 0x3cd7b
movq (%r12), %rax
movq 0x28(%rax), %rax
movq (%rax), %rdi
movss -0x4(%r15,%r13,4), %xmm0
leaq 0x8(%rsp), %rsi
movq %rbx, %rdx
movq %r14, %rcx
callq 0x3cb67
movss -0x4(%r15,%r13,4), %xmm0
cmpl 0xc(%rsp), %r13d
jge 0x3cd2b
addss (%r15,%r13,4), %xmm0
mulss 0x12de9(%rip), %xmm0    # 0x4fb14
movq (%r12), %rax
movq (%rax), %rdi
jmp 0x3cd6b
cmpl $0x0, 0x8(%rsp)
jne 0x3cd5d
movq (%r12), %rax
movq 0x28(%rax), %rax
movq (%rax), %rdi
movss -0x4(%r15,%r13,4), %xmm0
leaq 0x8(%rsp), %rsi
movq %rbx, %rdx
movq %r14, %rcx
callq 0x3cb67
movq (%r12), %rax
movq (%rax), %rdi
movss -0x4(%r15,%r13,4), %xmm0
leaq 0x8(%rsp), %rsi
movq %rbx, %rdx
movq %r14, %rcx
callq 0x3cb67
incq %r13
addq $0x158, %r12            # imm = 0x158
jmp 0x3ccc9
leaq 0x16421(%rip), %rdi     # 0x531b2
pushq $0x7
popq %rsi
pushq $0x1
popq %rdx
movq %r14, %rcx
callq 0x2280
movq %r14, %rdi
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x20c0