// File: /workspace/github_c_makefile_star2_O0/ugobas[P]tnm/nma.c
// Function: Compute_force
void Compute_force(struct Tors *Force, float *cc, struct Normal_Mode NM)
{
  // Compute force from projection of conformation change on normal modes
  int i, a;
  Force->Cart=malloc(NM.N_Cart*sizeof(float));
  for(i=0; i<NM.N_Cart; i++)Force->Cart[i]=0;
  Force->Tors=malloc(NM.N_axes*sizeof(float));
  Force->MW_Tors=malloc(NM.N_axes*sizeof(float));
  for(i=0; i<NM.N_axes; i++){Force->Tors[i]=0; Force->MW_Tors[i]=0;}
  Force->coeff=malloc(NM.N*sizeof(float));
  for(a=0; a<NM.N_relevant; a++){
    if((NM.select[a]==0)||(NM.sigma2[a]==0))continue;
    float c=NM.omega2[a]*cc[a];
    float *x=NM.Cart[a], *u=NM.Tors[a], *w=NM.MW_Tors[a];
    for(i=0; i<NM.N_Cart; i++){Force->Cart[i]+=c*(*x); x++;}
    for(i=0; i<NM.N_axes; i++){
      Force->Tors[i]+=c*(*u); u++;
      Force->MW_Tors[i]+=c*(*w); w++;
    }
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
leaq 0x10(%rbp), %rax
movq %rax, -0x40(%rbp)
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movslq 0xc(%rax), %rdi
shlq $0x2, %rdi
callq 0x1180
movq %rax, %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x8(%rax)
movl $0x0, -0x14(%rbp)
movq -0x40(%rbp), %rcx
movl -0x14(%rbp), %eax
cmpl 0xc(%rcx), %eax
jge 0x3a992
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
movslq -0x14(%rbp), %rcx
xorps %xmm0, %xmm0
movss %xmm0, (%rax,%rcx,4)
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0x3a967
movq -0x40(%rbp), %rax
movslq 0x8(%rax), %rdi
shlq $0x2, %rdi
callq 0x1180
movq %rax, %rdx
movq -0x40(%rbp), %rax
movq -0x8(%rbp), %rcx
movq %rdx, 0x18(%rcx)
movslq 0x8(%rax), %rdi
shlq $0x2, %rdi
callq 0x1180
movq %rax, %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x10(%rax)
movl $0x0, -0x14(%rbp)
movq -0x40(%rbp), %rcx
movl -0x14(%rbp), %eax
cmpl 0x8(%rcx), %eax
jge 0x3aa10
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rax
movslq -0x14(%rbp), %rcx
xorps %xmm0, %xmm0
movss %xmm0, (%rax,%rcx,4)
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movslq -0x14(%rbp), %rcx
xorps %xmm0, %xmm0
movss %xmm0, (%rax,%rcx,4)
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0x3a9d1
movq -0x40(%rbp), %rax
movslq (%rax), %rdi
shlq $0x2, %rdi
callq 0x1180
movq %rax, %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x20(%rax)
movl $0x0, -0x18(%rbp)
movq -0x40(%rbp), %rcx
movl -0x18(%rbp), %eax
cmpl 0x10(%rcx), %eax
jge 0x3abbe
movq -0x40(%rbp), %rax
movq 0xc0(%rax), %rax
movslq -0x18(%rbp), %rcx
cmpl $0x0, (%rax,%rcx,4)
je 0x3aa72
movq -0x40(%rbp), %rax
movq 0x28(%rax), %rax
movslq -0x18(%rbp), %rcx
movss (%rax,%rcx,4), %xmm0
xorps %xmm1, %xmm1
ucomiss %xmm1, %xmm0
jne 0x3aa77
jp 0x3aa77
jmp 0x3abb0
movq -0x40(%rbp), %rax
movq 0x20(%rax), %rcx
movslq -0x18(%rbp), %rdx
movss (%rcx,%rdx,4), %xmm0
movq -0x10(%rbp), %rcx
movslq -0x18(%rbp), %rdx
mulss (%rcx,%rdx,4), %xmm0
movss %xmm0, -0x1c(%rbp)
movq 0x38(%rax), %rcx
movslq -0x18(%rbp), %rdx
movq (%rcx,%rdx,8), %rcx
movq %rcx, -0x28(%rbp)
movq 0x40(%rax), %rcx
movslq -0x18(%rbp), %rdx
movq (%rcx,%rdx,8), %rcx
movq %rcx, -0x30(%rbp)
movq 0x48(%rax), %rax
movslq -0x18(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, -0x38(%rbp)
movl $0x0, -0x14(%rbp)
movq -0x40(%rbp), %rcx
movl -0x14(%rbp), %eax
cmpl 0xc(%rcx), %eax
jge 0x3ab1f
movss -0x1c(%rbp), %xmm0
movq -0x28(%rbp), %rax
movss (%rax), %xmm2
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
movslq -0x14(%rbp), %rcx
movss (%rax,%rcx,4), %xmm1
mulss %xmm2, %xmm0
addss %xmm1, %xmm0
movss %xmm0, (%rax,%rcx,4)
movq -0x28(%rbp), %rax
addq $0x4, %rax
movq %rax, -0x28(%rbp)
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0x3aad1
movl $0x0, -0x14(%rbp)
movq -0x40(%rbp), %rcx
movl -0x14(%rbp), %eax
cmpl 0x8(%rcx), %eax
jge 0x3abae
movss -0x1c(%rbp), %xmm0
movq -0x30(%rbp), %rax
movss (%rax), %xmm2
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rax
movslq -0x14(%rbp), %rcx
movss (%rax,%rcx,4), %xmm1
mulss %xmm2, %xmm0
addss %xmm1, %xmm0
movss %xmm0, (%rax,%rcx,4)
movq -0x30(%rbp), %rax
addq $0x4, %rax
movq %rax, -0x30(%rbp)
movss -0x1c(%rbp), %xmm0
movq -0x38(%rbp), %rax
movss (%rax), %xmm2
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movslq -0x14(%rbp), %rcx
movss (%rax,%rcx,4), %xmm1
mulss %xmm2, %xmm0
addss %xmm1, %xmm0
movss %xmm0, (%rax,%rcx,4)
movq -0x38(%rbp), %rax
addq $0x4, %rax
movq %rax, -0x38(%rbp)
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0x3ab26
jmp 0x3abb0
movl -0x18(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x18(%rbp)
jmp 0x3aa32
addq $0x40, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)