// File: /workspace/github_c_makefile_star2_O3/ugobas[P]tnm/interactions_tnm.c
// Function: Check_store_HB
int Check_store_HB(struct interaction *Int_list, int *N_int,
		   atom *atoms, int i_AA, int i_A, int i_D, int rA,
		   float d2)
{
  float cos_tau=Bond_angle(atoms[i_AA].r, atoms[i_A].r, atoms[i_D].r);
  if(cos_tau > COS_DAA)return(0);
  float d_DAA=Dist2(atoms[i_AA].r, atoms[i_D].r);
  Int_list[*N_int].type=1;   Int_list[*N_int].sec_der=1;
  Int_list[*N_int].r0=sqrt(d_DAA); 
  if(rA==1){
    Int_list[*N_int].i1=i_AA; Int_list[*N_int].i2=i_D;
  }else{
    Int_list[*N_int].i1=i_D;  Int_list[*N_int].i2=i_AA;
  }
  (*N_int)++;
  Int_list[*N_int].type=2; Int_list[*N_int].sec_der=ENE_HB;
  if(rA==1){
    Int_list[*N_int].i1=i_A; Int_list[*N_int].i2=i_D;
  }else{
    Int_list[*N_int].i1=i_D; Int_list[*N_int].i2=i_A;
  }
  Int_list[*N_int].r0=sqrt(d2);
  (*N_int)++;
  return(1);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movaps %xmm0, %xmm6
movl %r8d, %r15d
movq %rsi, %rbx
movq %rdi, %r14
movslq %ecx, %rax
imulq $0x70, %rax, %r13
addq %rdx, %r13
movslq %r9d, %rax
imulq $0x70, %rax, %rbp
addq %rdx, %rbp
testq %rdx, %rdx
je 0x18d3b
movslq %r15d, %rax
imulq $0x70, %rax, %rax
movsd (%r13), %xmm0
movsd 0x8(%r13), %xmm2
movhpd (%rbp), %xmm0           # xmm0 = xmm0[0],mem[0]
movsd 0x10(%r13), %xmm1
movsd (%rdx,%rax), %xmm3
movsd 0x8(%rdx,%rax), %xmm4
movsd 0x10(%rdx,%rax), %xmm5
unpcklpd %xmm3, %xmm3            # xmm3 = xmm3[0,0]
subpd %xmm3, %xmm0
movhpd 0x8(%rbp), %xmm2        # xmm2 = xmm2[0],mem[0]
unpcklpd %xmm4, %xmm4            # xmm4 = xmm4[0,0]
subpd %xmm4, %xmm2
movhpd 0x10(%rbp), %xmm1       # xmm1 = xmm1[0],mem[0]
unpcklpd %xmm5, %xmm5            # xmm5 = xmm5[0,0]
subpd %xmm5, %xmm1
movapd %xmm2, %xmm3
unpckhpd %xmm2, %xmm3            # xmm3 = xmm3[1],xmm2[1]
mulsd %xmm2, %xmm3
movapd %xmm0, %xmm4
unpckhpd %xmm0, %xmm4            # xmm4 = xmm4[1],xmm0[1]
mulsd %xmm0, %xmm4
addsd %xmm3, %xmm4
movapd %xmm1, %xmm3
unpckhpd %xmm1, %xmm3            # xmm3 = xmm3[1],xmm1[1]
mulsd %xmm1, %xmm3
addsd %xmm4, %xmm3
mulpd %xmm2, %xmm2
mulpd %xmm0, %xmm0
addpd %xmm2, %xmm0
mulpd %xmm1, %xmm1
addpd %xmm0, %xmm1
movapd %xmm1, %xmm0
unpckhpd %xmm1, %xmm0            # xmm0 = xmm0[1],xmm1[1]
mulsd %xmm1, %xmm0
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jb 0x18d40
sqrtsd %xmm0, %xmm0
jmp 0x18d6d
xorps %xmm0, %xmm0
jmp 0x18d78
movss %xmm6, 0x8(%rsp)
movl %r9d, 0xc(%rsp)
movl %ecx, %r12d
movapd %xmm3, 0x10(%rsp)
callq 0x22a0
movapd 0x10(%rsp), %xmm3
movl %r12d, %ecx
movl 0xc(%rsp), %r9d
movss 0x8(%rsp), %xmm6
divsd %xmm0, %xmm3
xorps %xmm0, %xmm0
cvtsd2ss %xmm3, %xmm0
leaq 0x4f879(%rip), %rdx     # 0x685f8
xorl %eax, %eax
ucomiss (%rdx), %xmm0
ja 0x18edd
movsd (%r13), %xmm0
movsd 0x8(%r13), %xmm1
mulsd 0x8(%rbp), %xmm1
mulsd (%rbp), %xmm0
movsd 0x10(%r13), %xmm2
mulsd 0x10(%rbp), %xmm2
addsd %xmm1, %xmm0
addsd %xmm0, %xmm2
xorps %xmm0, %xmm0
cvtsd2ss %xmm2, %xmm0
movl 0x60(%rsp), %ebp
movslq (%rbx), %rax
imulq $0xc8, %rax, %rax
movl $0x1, 0xc0(%r14,%rax)
movslq (%rbx), %rax
imulq $0xc8, %rax, %rax
movabsq $0x3ff0000000000000, %rdx # imm = 0x3FF0000000000000
movq %rdx, 0x28(%r14,%rax)
cvtss2sd %xmm0, %xmm0
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jb 0x18e01
sqrtsd %xmm0, %xmm0
jmp 0x18e22
movss %xmm6, 0x8(%rsp)
movl %r9d, %r12d
movl %ecx, %r13d
callq 0x22a0
xorpd %xmm1, %xmm1
movl %r13d, %ecx
movl %r12d, %r9d
movss 0x8(%rsp), %xmm6
movslq (%rbx), %rax
imulq $0xc8, %rax, %rax
cmpl $0x1, %ebp
movl %r9d, %edx
cmovel %ecx, %edx
cmovel %r9d, %ecx
movsd %xmm0, 0x20(%r14,%rax)
movl %edx, (%r14,%rax)
movslq (%rbx), %rax
movl %r9d, %esi
cmovel %r15d, %esi
cmovel %r9d, %r15d
imulq $0xc8, %rax, %rax
movl %ecx, 0x4(%r14,%rax)
movslq (%rbx), %rax
leal 0x1(%rax), %edx
movl %edx, (%rbx)
imulq $0xc8, %rax, %rax
movl $0x2, 0x188(%rax,%r14)
leaq 0x4f770(%rip), %rax     # 0x685f0
xorps %xmm0, %xmm0
cvtss2sd (%rax), %xmm0
movslq (%rbx), %rax
imulq $0xc8, %rax, %rax
movsd %xmm0, 0x28(%r14,%rax)
movl %esi, (%r14,%rax)
movslq (%rbx), %rax
imulq $0xc8, %rax, %rax
movl %r15d, 0x4(%r14,%rax)
xorps %xmm0, %xmm0
cvtss2sd %xmm6, %xmm0
ucomisd %xmm1, %xmm0
jb 0x18ebe
sqrtsd %xmm0, %xmm0
jmp 0x18ec3
callq 0x22a0
movslq (%rbx), %rax
imulq $0xc8, %rax, %rcx
movsd %xmm0, 0x20(%r14,%rcx)
incl %eax
movl %eax, (%rbx)
movl $0x1, %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq