// File: /workspace/github_c_makefile_star2_O0/ugobas[P]tnm/screened_interactions.c
// Function: Axis_distance
int Axis_distance(float *d2_nb, float *d2_bo, float S2_NB, float S2_BO,
		  struct store *store1, float d2_ij,
		  atom *atom_i, atom *atom_j, atom *atoms)
{
  int resi=atom_i->res, resj=atom_j->res;
  float d2, d2_jk, d2_c;
  while(store1 != NULL){
    if(store1->x > d2_ij)break;
    atom *atom_k=atoms+store1->i;
    if(atom_k!=atom_j){
      d2_jk=Dist2(atom_j->r, atom_k->r);
      if(d2_jk >= d2_ij)goto next1;
      if(d2_jk > store1->x){
	d2_c=Scalar(atom_j->r, atom_i->r, atom_k->r);
	d2=d2_jk-d2_c*d2_c/d2_ij; 
      }else{
	d2_c=Scalar(atom_i->r, atom_j->r, atom_k->r);
	d2=store1->x-d2_c*d2_c/d2_ij;
      }
      if(d2 < S2_NB){
	int bond=Bond(atom_k->res, resi, store1->x, resj, d2_jk);
	if(bond){
	  if(d2 < S2_BO){*d2_bo=d2; return(1);}
	}else{
	  if(d2 < S2_NB){*d2_nb=d2; return(1);}
	}
      }
    }
  next1:
    store1=store1->next;
  }
  return(0);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x70, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movss %xmm0, -0x1c(%rbp)
movss %xmm1, -0x20(%rbp)
movq %rdx, -0x28(%rbp)
movss %xmm2, -0x2c(%rbp)
movq %rcx, -0x38(%rbp)
movq %r8, -0x40(%rbp)
movq %r9, -0x48(%rbp)
movq -0x38(%rbp), %rax
movl 0x64(%rax), %eax
movl %eax, -0x4c(%rbp)
movq -0x40(%rbp), %rax
movl 0x64(%rax), %eax
movl %eax, -0x50(%rbp)
cmpq $0x0, -0x28(%rbp)
je 0x2d5d0
movq -0x28(%rbp), %rax
movss 0x4(%rax), %xmm0
ucomiss -0x2c(%rbp), %xmm0
jbe 0x2d472
jmp 0x2d5d0
movq -0x48(%rbp), %rax
movq -0x28(%rbp), %rcx
movslq (%rcx), %rcx
imulq $0x70, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0x68(%rbp)
movq -0x68(%rbp), %rax
cmpq -0x40(%rbp), %rax
je 0x2d5bd
movq -0x40(%rbp), %rdi
movq -0x68(%rbp), %rsi
callq 0x2db20
movss %xmm0, -0x58(%rbp)
movss -0x58(%rbp), %xmm0
ucomiss -0x2c(%rbp), %xmm0
jb 0x2d4b8
jmp 0x2d5bf
movss -0x58(%rbp), %xmm0
movq -0x28(%rbp), %rax
ucomiss 0x4(%rax), %xmm0
jbe 0x2d4fc
movq -0x40(%rbp), %rdi
movq -0x38(%rbp), %rsi
movq -0x68(%rbp), %rdx
callq 0x2dbd0
movss %xmm0, -0x5c(%rbp)
movss -0x58(%rbp), %xmm0
movss -0x5c(%rbp), %xmm1
mulss -0x5c(%rbp), %xmm1
divss -0x2c(%rbp), %xmm1
subss %xmm1, %xmm0
movss %xmm0, -0x54(%rbp)
jmp 0x2d533
movq -0x38(%rbp), %rdi
movq -0x40(%rbp), %rsi
movq -0x68(%rbp), %rdx
callq 0x2dbd0
movss %xmm0, -0x5c(%rbp)
movq -0x28(%rbp), %rax
movss 0x4(%rax), %xmm0
movss -0x5c(%rbp), %xmm1
mulss -0x5c(%rbp), %xmm1
divss -0x2c(%rbp), %xmm1
subss %xmm1, %xmm0
movss %xmm0, -0x54(%rbp)
movss -0x54(%rbp), %xmm1
movss -0x1c(%rbp), %xmm0
ucomiss %xmm1, %xmm0
jbe 0x2d5bb
movq -0x68(%rbp), %rax
movl 0x64(%rax), %edi
movl -0x4c(%rbp), %esi
movq -0x28(%rbp), %rax
movss 0x4(%rax), %xmm0
movl -0x50(%rbp), %edx
movss -0x58(%rbp), %xmm1
callq 0x21a70
movl %eax, -0x6c(%rbp)
cmpl $0x0, -0x6c(%rbp)
je 0x2d592
movss -0x54(%rbp), %xmm1
movss -0x20(%rbp), %xmm0
ucomiss %xmm1, %xmm0
jbe 0x2d590
movss -0x54(%rbp), %xmm0
movq -0x18(%rbp), %rax
movss %xmm0, (%rax)
movl $0x1, -0x4(%rbp)
jmp 0x2d5d7
jmp 0x2d5b9
movss -0x54(%rbp), %xmm1
movss -0x1c(%rbp), %xmm0
ucomiss %xmm1, %xmm0
jbe 0x2d5b7
movss -0x54(%rbp), %xmm0
movq -0x10(%rbp), %rax
movss %xmm0, (%rax)
movl $0x1, -0x4(%rbp)
jmp 0x2d5d7
jmp 0x2d5b9
jmp 0x2d5bb
jmp 0x2d5bd
jmp 0x2d5bf
movq -0x28(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x28(%rbp)
jmp 0x2d453
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x70, %rsp
popq %rbp
retq