// File: /workspace/github_c_makefile_star2_O1/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 $0x18, %rsp
movaps %xmm0, %xmm8
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 0x19520
movslq %r15d, %rax
imulq $0x70, %rax, %rax
movsd (%r13), %xmm2
movsd 0x8(%r13), %xmm5
movsd (%rdx,%rax), %xmm0
movsd 0x8(%rdx,%rax), %xmm4
subsd %xmm0, %xmm2
movsd (%rbp), %xmm1
movsd 0x8(%rbp), %xmm3
subsd %xmm0, %xmm1
subsd %xmm4, %xmm5
subsd %xmm4, %xmm3
movsd 0x10(%r13), %xmm4
movsd 0x10(%rdx,%rax), %xmm6
subsd %xmm6, %xmm4
movsd 0x10(%rbp), %xmm0
subsd %xmm6, %xmm0
movapd %xmm5, %xmm6
mulsd %xmm3, %xmm6
movapd %xmm2, %xmm7
mulsd %xmm1, %xmm7
addsd %xmm6, %xmm7
movapd %xmm4, %xmm6
mulsd %xmm0, %xmm6
addsd %xmm7, %xmm6
mulsd %xmm5, %xmm5
mulsd %xmm2, %xmm2
addsd %xmm5, %xmm2
mulsd %xmm4, %xmm4
addsd %xmm2, %xmm4
mulsd %xmm3, %xmm3
mulsd %xmm1, %xmm1
addsd %xmm3, %xmm1
mulsd %xmm0, %xmm0
addsd %xmm1, %xmm0
mulsd %xmm4, %xmm0
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jb 0x19525
sqrtsd %xmm0, %xmm0
jmp 0x19554
xorps %xmm0, %xmm0
jmp 0x1955f
movss %xmm8, 0x8(%rsp)
movl %r9d, 0xc(%rsp)
movl %ecx, %r12d
movsd %xmm6, 0x10(%rsp)
callq 0x2290
movsd 0x10(%rsp), %xmm6
movl %r12d, %ecx
movl 0xc(%rsp), %r9d
movss 0x8(%rsp), %xmm8
divsd %xmm0, %xmm6
xorps %xmm0, %xmm0
cvtsd2ss %xmm6, %xmm0
leaq 0x4f092(%rip), %rdx     # 0x685f8
xorl %eax, %eax
ucomiss (%rdx), %xmm0
ja 0x196c7
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 0x50(%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 0x195e8
sqrtsd %xmm0, %xmm0
jmp 0x1960b
movss %xmm8, 0x8(%rsp)
movl %r9d, %r12d
movl %ecx, %r13d
callq 0x2290
xorpd %xmm1, %xmm1
movl %r13d, %ecx
movl %r12d, %r9d
movss 0x8(%rsp), %xmm8
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 0x4ef87(%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 %xmm8, %xmm0
ucomisd %xmm1, %xmm0
jb 0x196a8
sqrtsd %xmm0, %xmm0
jmp 0x196ad
callq 0x2290
movslq (%rbx), %rax
imulq $0xc8, %rax, %rcx
movsd %xmm0, 0x20(%r14,%rcx)
incl %eax
movl %eax, (%rbx)
movl $0x1, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq