// File: /workspace/github_c_makefile_star2_O1/sheneman[P]clearcut/clearcut.c
// Function: NJ_check
static inline
int 
NJ_check(NJ_ARGS *nj_args,
	 DMAT *dmat,
	 long int a,
	 long int b,
	 float min,
	 int additivity) {


  long int i, size;
  float *ptr, *val, *r2;
  

  /* some aliases for speed and readability reasons */
  val  = dmat->val;
  r2   = dmat->r2;
  size = dmat->size;


  /* now determine if joining a, b will result in broken distances */
  if(additivity) {
    if(!NJ_check_additivity(dmat, a, b)) {
      return(0);
    }
  }

  /* scan the horizontal of row b, punt if anything < min */
  ptr = &(val[NJ_MAP(b, b+1, size)]);  
  for(i=b+1;i<size;i++) {
    if( NJ_FLT_LT( (*ptr - (r2[b] + r2[i])), min) ) {
      return(0);
    }
    ptr++;
  }

  /* scan the vertical component of row a, punt if anything < min */
  if(nj_args->norandom) {  /* if we are doing random joins, we checked this */
    ptr = val + a;
    for(i=0;i<a;i++) {
      if( NJ_FLT_LT( (*ptr - (r2[i] + r2[a])), min) ) {
	return(0);
      }
      ptr += size-i-1;
    }
  }

  /* scan the vertical component of row b, punt if anything < min */
  ptr = val + b;
  for(i=0;i<b;i++) {
    if( NJ_FLT_LT( (*ptr - (r2[i] + r2[b])), min) && i!=a) {
      return(0);
    }
    ptr += size-i-1;
  }

  return(1);
}

// Assembly:
pushq %rbx
movq 0x8(%rsi), %r9
movq 0x18(%rsi), %r10
movq 0x30(%rsi), %rsi
testl %r8d, %r8d
je 0x430e
leaq -0x1(%r9), %rax
cmpq %rcx, %rax
jne 0x421e
xorl %eax, %eax
testq %rdx, %rdx
jne 0x4222
cmpq $0x1, %rcx
sete %al
incq %rax
jmp 0x4222
leaq 0x1(%rcx), %rax
leaq (%r9,%r9), %r8
movq %rdx, %r11
notq %r11
leaq (%r11,%r9,2), %r11
imulq %rdx, %r11
movq %r11, %rbx
shrq $0x3f, %rbx
addq %r11, %rbx
andq $-0x2, %rbx
leaq (%r10,%rbx,2), %r11
movss (%r11,%rcx,4), %xmm3
movss (%rsi,%rdx,4), %xmm4
movss (%rsi,%rcx,4), %xmm1
movaps %xmm4, %xmm2
subss %xmm1, %xmm2
addss %xmm3, %xmm2
movss 0x3da7(%rip), %xmm5     # 0x8010
mulss %xmm5, %xmm2
subss %xmm4, %xmm1
addss %xmm3, %xmm1
mulss %xmm5, %xmm1
cmpq %rcx, %rax
jle 0x42a7
leaq (%r11,%rax,4), %r11
movq %rcx, %rbx
notq %rbx
addq %rbx, %r8
imulq %rcx, %r8
movq %r8, %rbx
shrq $0x3f, %rbx
addq %r8, %rbx
andq $-0x2, %rbx
leaq (%r10,%rbx,2), %r8
leaq (%r8,%rax,4), %rax
jmp 0x42ce
movq %rax, %r11
notq %r11
addq %r11, %r8
imulq %rax, %r8
movq %r8, %rax
shrq $0x3f, %rax
addq %r8, %rax
andq $-0x2, %rax
leaq (%r10,%rax,2), %rax
leaq (%rax,%rdx,4), %r11
leaq (%rax,%rcx,4), %rax
movss (%r11), %xmm3
subss %xmm2, %xmm3
movss (%rax), %xmm2
movaps %xmm2, %xmm4
subss %xmm1, %xmm4
addss %xmm3, %xmm4
mulss 0x3d22(%rip), %xmm4     # 0x8010
addss %xmm1, %xmm4
subss %xmm4, %xmm2
andps 0x3d23(%rip), %xmm2     # 0x8020
movss 0x3d03(%rip), %xmm1     # 0x8008
ucomiss %xmm2, %xmm1
ja 0x430e
xorl %eax, %eax
popq %rbx
retq
leaq 0x1(%rcx), %rax
cmpq %r9, %rax
jge 0x4377
movq %rcx, %r8
notq %r8
leaq (%r8,%r9,2), %r8
imulq %rcx, %r8
movq %r8, %r11
shrq $0x3f, %r11
addq %r8, %r11
andq $-0x2, %r11
leaq (%r10,%r11,2), %r8
movss (%rsi,%rcx,4), %xmm1
movaps 0x3cdd(%rip), %xmm2     # 0x8020
movss 0x3cbd(%rip), %xmm3     # 0x8008
movss (%r8,%rax,4), %xmm4
movss (%rsi,%rax,4), %xmm5
addss %xmm1, %xmm5
subss %xmm5, %xmm4
ucomiss %xmm4, %xmm0
jbe 0x436f
subss %xmm0, %xmm4
andps %xmm2, %xmm4
ucomiss %xmm4, %xmm3
jbe 0x430a
incq %rax
cmpq %rax, %r9
jne 0x434b
cmpl $0x0, 0x38(%rdi)
sete %al
testq %rdx, %rdx
setle %dil
orb %al, %dil
jne 0x43e1
leaq (%r10,%rdx,4), %rdi
movss (%rsi,%rdx,4), %xmm1
leaq -0x1(%r9), %r8
xorl %eax, %eax
movaps 0x3c80(%rip), %xmm2     # 0x8020
movss 0x3c60(%rip), %xmm3     # 0x8008
xorl %r11d, %r11d
movss (%rdi), %xmm4
movss (%rsi,%r11,4), %xmm5
addss %xmm1, %xmm5
subss %xmm5, %xmm4
ucomiss %xmm4, %xmm0
jbe 0x43d2
subss %xmm0, %xmm4
andps %xmm2, %xmm4
ucomiss %xmm4, %xmm3
jbe 0x430c
leaq (%rdi,%r8,4), %rdi
incq %r11
decq %r8
cmpq %r11, %rdx
jne 0x43ab
movl $0x1, %eax
testq %rcx, %rcx
jle 0x430c
leaq (%r10,%rcx,4), %rdi
movss (%rsi,%rcx,4), %xmm1
decq %r9
xorl %r8d, %r8d
movaps 0x3c1b(%rip), %xmm2     # 0x8020
movss 0x3bfb(%rip), %xmm3     # 0x8008
cmpq %r8, %rdx
je 0x4439
movss (%rdi), %xmm4
movss (%rsi,%r8,4), %xmm5
addss %xmm1, %xmm5
subss %xmm5, %xmm4
ucomiss %xmm4, %xmm0
jbe 0x4439
subss %xmm0, %xmm4
andps %xmm2, %xmm4
ucomiss %xmm4, %xmm3
jbe 0x430a
leaq (%rdi,%r9,4), %rdi
incq %r8
decq %r9
cmpq %r8, %rcx
jne 0x440d
jmp 0x430c