// File: /workspace/github_c_makefile_star2_O0/ugobas[P]tnm/nma.c
// Function: Torsional_force
void Torsional_force(struct Tors Force, struct Tors *Diff, double **Hessian,
		     int N_axes, int N_ref, int *atom_num,
		     float **Jacobian_ar, int N_int,
		     struct interaction *Int_list, atom *atoms, int natoms)
{
  int N_Cart=3*N_ref, i, j, a; double sum;
  for(i=0; i<N_axes; i++){
    sum=0;
    for(j=0; j<N_axes; j++)sum += Hessian[i][j]*Diff->MW_Tors[j];
    Force.Tors[i]=sum;
  }
  // Cartesian force fr= HrJDelta_theta
  float dr[N_Cart];
  for(i=0; i<N_Cart; i++){
    sum=0; for(a=0; a<N_axes; a++)sum+=Jacobian_ar[a][i]*Diff->Tors[a];
    dr[i]=sum;
  }
  double **H=Allocate_mat2_d(N_Cart, N_Cart);
  Compute_Hessian_ANM(H,N_ref,atom_num,Int_list,N_int,atoms,natoms);
  for(i=0; i<N_Cart; i++){
    sum=0; for(j=0; j<N_Cart; j++)sum += H[i][j]*dr[j];
    Force.Cart[i]=sum;
  }
  Empty_matrix_d(H, N_Cart);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x70, %rsp
movl 0x68(%rbp), %eax
movq 0x60(%rbp), %rax
movq 0x58(%rbp), %rax
movl 0x50(%rbp), %eax
leaq 0x10(%rbp), %rax
movq %rax, -0x60(%rbp)
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
movl %ecx, -0x18(%rbp)
movq %r8, -0x20(%rbp)
movq %r9, -0x28(%rbp)
imull $0x3, -0x18(%rbp), %eax
movl %eax, -0x2c(%rbp)
movl $0x0, -0x30(%rbp)
movl -0x30(%rbp), %eax
cmpl -0x14(%rbp), %eax
jge 0x3ad54
xorps %xmm0, %xmm0
movsd %xmm0, -0x40(%rbp)
movl $0x0, -0x34(%rbp)
movl -0x34(%rbp), %eax
cmpl -0x14(%rbp), %eax
jge 0x3ad2c
movq -0x10(%rbp), %rax
movslq -0x30(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x34(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm0
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movslq -0x34(%rbp), %rcx
movss (%rax,%rcx,4), %xmm1
cvtss2sd %xmm1, %xmm2
movsd -0x40(%rbp), %xmm1
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, -0x40(%rbp)
movl -0x34(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x34(%rbp)
jmp 0x3acdd
movq -0x60(%rbp), %rax
movsd -0x40(%rbp), %xmm0
cvtsd2ss %xmm0, %xmm0
movq 0x18(%rax), %rax
movslq -0x30(%rbp), %rcx
movss %xmm0, (%rax,%rcx,4)
movl -0x30(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x30(%rbp)
jmp 0x3acc2
movl -0x2c(%rbp), %eax
movq %rsp, %rcx
movq %rcx, -0x48(%rbp)
leaq 0xf(,%rax,4), %rdx
andq $-0x10, %rdx
movq %rsp, %rcx
subq %rdx, %rcx
movq %rcx, -0x68(%rbp)
movq %rcx, %rsp
movq %rax, -0x50(%rbp)
movl $0x0, -0x30(%rbp)
movl -0x30(%rbp), %eax
cmpl -0x2c(%rbp), %eax
jge 0x3ae01
xorps %xmm0, %xmm0
movsd %xmm0, -0x40(%rbp)
movl $0x0, -0x38(%rbp)
movl -0x38(%rbp), %eax
cmpl -0x14(%rbp), %eax
jge 0x3ade0
movq -0x28(%rbp), %rax
movslq -0x38(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x30(%rbp), %rcx
movss (%rax,%rcx,4), %xmm0
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rax
movslq -0x38(%rbp), %rcx
mulss (%rax,%rcx,4), %xmm0
cvtss2sd %xmm0, %xmm0
addsd -0x40(%rbp), %xmm0
movsd %xmm0, -0x40(%rbp)
movl -0x38(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x38(%rbp)
jmp 0x3ad99
movq -0x68(%rbp), %rax
movsd -0x40(%rbp), %xmm0
cvtsd2ss %xmm0, %xmm0
movslq -0x30(%rbp), %rcx
movss %xmm0, (%rax,%rcx,4)
movl -0x30(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x30(%rbp)
jmp 0x3ad82
movl -0x2c(%rbp), %edi
movl -0x2c(%rbp), %esi
callq 0x694a0
movq %rax, -0x58(%rbp)
movq -0x58(%rbp), %rdi
movl -0x18(%rbp), %esi
movq -0x20(%rbp), %rdx
movq 0x58(%rbp), %rcx
movl 0x50(%rbp), %r8d
movq 0x60(%rbp), %r9
movl 0x68(%rbp), %eax
subq $0x10, %rsp
movl %eax, (%rsp)
callq 0x323a0
addq $0x10, %rsp
movl $0x0, -0x30(%rbp)
movl -0x30(%rbp), %eax
cmpl -0x2c(%rbp), %eax
jge 0x3aecf
xorps %xmm0, %xmm0
movsd %xmm0, -0x40(%rbp)
movl $0x0, -0x34(%rbp)
movl -0x34(%rbp), %eax
cmpl -0x2c(%rbp), %eax
jge 0x3aea7
movq -0x68(%rbp), %rax
movq -0x58(%rbp), %rcx
movslq -0x30(%rbp), %rdx
movq (%rcx,%rdx,8), %rcx
movslq -0x34(%rbp), %rdx
movsd (%rcx,%rdx,8), %xmm0
movslq -0x34(%rbp), %rcx
movss (%rax,%rcx,4), %xmm1
cvtss2sd %xmm1, %xmm2
movsd -0x40(%rbp), %xmm1
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, -0x40(%rbp)
movl -0x34(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x34(%rbp)
jmp 0x3ae5c
movq -0x60(%rbp), %rax
movsd -0x40(%rbp), %xmm0
cvtsd2ss %xmm0, %xmm0
movq 0x8(%rax), %rax
movslq -0x30(%rbp), %rcx
movss %xmm0, (%rax,%rcx,4)
movl -0x30(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x30(%rbp)
jmp 0x3ae41
movq -0x58(%rbp), %rdi
movl -0x2c(%rbp), %esi
callq 0x692a0
movq -0x48(%rbp), %rax
movq %rax, %rsp
movq %rbp, %rsp
popq %rbp
retq
nopw (%rax,%rax)