// File: /workspace/github_c_makefile_star2_O0/ugobas[P]tnm/buildup.c
// Function: Trajectory
void Trajectory(atom *atoms, int natoms, struct axe *axes, int naxe,
		float **Tors_mode, int imode, float fact, int nmove,
		struct bond *bonds)
{
  int iter, i, iatom, j;

  Set_bonds_measure(bonds, natoms, atoms);
  double d_phi[naxe];
  for(i=0; i<naxe; i++)d_phi[i]=Tors_mode[imode][i]*fact;

  atom *atommove=malloc(natoms*sizeof(atom));
  for(iter=0; iter<nmove; iter++){
    Build_up(bonds, natoms, d_phi, naxe);
    double r2=0; float x;
    for(i=0; i<natoms; i++){
      struct bond *bond=bonds+i;
      if(bond->i_atom<0)break;
      iatom=bond->i_atom;
      for(j=0; j<3; j++){
	atommove[i].r[j]=bonds[i].r[j];
	x=atommove[i].r[j]-atoms[iatom].r[j];
	r2+=x*x;
      }
      // printf("%3d %s %.4f\n", i, bond->name, x);
    }
    printf("mode %2d step %3d d2=%.4f\n", imode, iter, r2);
  }
  free(atommove);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x80, %rsp
movq 0x18(%rbp), %rax
movl 0x10(%rbp), %eax
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq %rdx, -0x18(%rbp)
movl %ecx, -0x1c(%rbp)
movq %r8, -0x28(%rbp)
movl %r9d, -0x2c(%rbp)
movss %xmm0, -0x30(%rbp)
movq 0x18(%rbp), %rdi
movl -0xc(%rbp), %esi
movq -0x8(%rbp), %rdx
callq 0x1bf00
movl -0x1c(%rbp), %eax
movq %rsp, %rcx
movq %rcx, -0x48(%rbp)
leaq 0xf(,%rax,8), %rdx
andq $-0x10, %rdx
movq %rsp, %rcx
subq %rdx, %rcx
movq %rcx, -0x78(%rbp)
movq %rcx, %rsp
movq %rax, -0x50(%rbp)
movl $0x0, -0x38(%rbp)
movl -0x38(%rbp), %eax
cmpl -0x1c(%rbp), %eax
jge 0x1bd89
movq -0x78(%rbp), %rax
movq -0x28(%rbp), %rcx
movslq -0x2c(%rbp), %rdx
movq (%rcx,%rdx,8), %rcx
movslq -0x38(%rbp), %rdx
movss (%rcx,%rdx,4), %xmm0
mulss -0x30(%rbp), %xmm0
cvtss2sd %xmm0, %xmm0
movslq -0x38(%rbp), %rcx
movsd %xmm0, (%rax,%rcx,8)
movl -0x38(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x38(%rbp)
jmp 0x1bd4b
movslq -0xc(%rbp), %rax
imulq $0x70, %rax, %rdi
callq 0x1180
movq %rax, -0x58(%rbp)
movl $0x0, -0x34(%rbp)
movl -0x34(%rbp), %eax
cmpl 0x10(%rbp), %eax
jge 0x1bee5
movq -0x78(%rbp), %rdx
movq 0x18(%rbp), %rdi
movl -0xc(%rbp), %esi
movl -0x1c(%rbp), %ecx
callq 0x1c4f0
xorps %xmm0, %xmm0
movsd %xmm0, -0x60(%rbp)
movl $0x0, -0x38(%rbp)
movl -0x38(%rbp), %eax
cmpl -0xc(%rbp), %eax
jge 0x1bebe
movq 0x18(%rbp), %rax
movslq -0x38(%rbp), %rcx
imulq $0xc0, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0x70(%rbp)
movq -0x70(%rbp), %rax
cmpl $0x0, 0x20(%rax)
jge 0x1be00
jmp 0x1bebe
movq -0x70(%rbp), %rax
movl 0x20(%rax), %eax
movl %eax, -0x3c(%rbp)
movl $0x0, -0x40(%rbp)
cmpl $0x3, -0x40(%rbp)
jge 0x1beae
movq 0x18(%rbp), %rax
movslq -0x38(%rbp), %rcx
imulq $0xc0, %rcx, %rcx
addq %rcx, %rax
movslq -0x40(%rbp), %rcx
movsd 0x8(%rax,%rcx,8), %xmm0
movq -0x58(%rbp), %rax
movslq -0x38(%rbp), %rcx
imulq $0x70, %rcx, %rcx
addq %rcx, %rax
movslq -0x40(%rbp), %rcx
movsd %xmm0, (%rax,%rcx,8)
movq -0x58(%rbp), %rax
movslq -0x38(%rbp), %rcx
imulq $0x70, %rcx, %rcx
addq %rcx, %rax
movslq -0x40(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm0
movq -0x8(%rbp), %rax
movslq -0x3c(%rbp), %rcx
imulq $0x70, %rcx, %rcx
addq %rcx, %rax
movslq -0x40(%rbp), %rcx
subsd (%rax,%rcx,8), %xmm0
cvtsd2ss %xmm0, %xmm0
movss %xmm0, -0x64(%rbp)
movss -0x64(%rbp), %xmm0
mulss -0x64(%rbp), %xmm0
cvtss2sd %xmm0, %xmm0
addsd -0x60(%rbp), %xmm0
movsd %xmm0, -0x60(%rbp)
movl -0x40(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x40(%rbp)
jmp 0x1be11
jmp 0x1beb0
movl -0x38(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x38(%rbp)
jmp 0x1bdcf
movl -0x2c(%rbp), %esi
movl -0x34(%rbp), %edx
movsd -0x60(%rbp), %xmm0
leaq 0x5fbbc(%rip), %rdi     # 0x7ba8c
movb $0x1, %al
callq 0x10d0
movl -0x34(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x34(%rbp)
jmp 0x1bda1
movq -0x58(%rbp), %rdi
callq 0x1040
movq -0x48(%rbp), %rax
movq %rax, %rsp
movq %rbp, %rsp
popq %rbp
retq
nopw (%rax,%rax)