// File: /workspace/github_cpp_makefile_star2_O1/Luthaf[P]zeopp/v_network.cc
// Function: voronoi_network::search_previous_rect(double, double, double, int&, int&, int&, int&, int&)
bool voronoi_network::search_previous_rect(double x,double y,double z,int &ijk,int &q,int &ci,int &cj,int &ck) {	
	int k=step_int(z*zsp);
	if(k<0||k>=nz) {
		ck=step_div(k,nz);
		z-=ck*bz;y-=ck*byz;x-=ck*bxz;k-=ck*nz;
	} else ck=0;

	int j=step_int(y*ysp);
	if(j<0||j>=ny) {
		cj=step_div(j,ny);
		y-=cj*by;x-=cj*bxy;j-=cj*ny;
	} else cj=0;

	ijk=step_int(x*xsp);
	if(ijk<0||ijk>=nx) {
		ci=step_div(ijk,nx);
		x-=ci*bx;ijk-=ci*nx;
	} else ci=0;

	ijk+=nx*(j+ny*k);double *pp(pts[ijk]);
	for(q=0;q<ptsc[ijk];q++,pp+=4)
		if(fabs(*pp-x)<net_tol&&fabs(pp[1]-y)<net_tol&&fabs(pp[2]-z)<net_tol) return true;
	return false;
}

// Assembly:
pushq %rbx
movq %rdx, %rbx
movsd 0x50(%rdi), %xmm3
mulsd %xmm2, %xmm3
xorpd %xmm4, %xmm4
xorl %eax, %eax
ucomisd %xmm3, %xmm4
seta %al
cvttsd2si %xmm3, %r10d
subl %eax, %r10d
setns %al
movl 0x38(%rdi), %r11d
cmpl %r11d, %r10d
setl %dl
testb %dl, %al
je 0x8219a
movl $0x0, (%r9)
jmp 0x821e6
testl %r10d, %r10d
js 0x821a8
movl %r10d, %eax
cltd
idivl %r11d
jmp 0x821b2
leal 0x1(%r10), %eax
cltd
idivl %r11d
decl %eax
movl %eax, (%r9)
xorps %xmm3, %xmm3
cvtsi2sd %eax, %xmm3
movsd 0x28(%rdi), %xmm4
mulsd %xmm3, %xmm4
subsd %xmm4, %xmm2
movsd 0x20(%rdi), %xmm4
mulsd %xmm3, %xmm4
subsd %xmm4, %xmm1
mulsd 0x18(%rdi), %xmm3
subsd %xmm3, %xmm0
imull 0x38(%rdi), %eax
subl %eax, %r10d
movsd 0x48(%rdi), %xmm3
mulsd %xmm1, %xmm3
xorpd %xmm4, %xmm4
xorl %eax, %eax
ucomisd %xmm3, %xmm4
seta %al
cvttsd2si %xmm3, %r11d
subl %eax, %r11d
setns %al
movl 0x34(%rdi), %r9d
cmpl %r9d, %r11d
setl %dl
testb %dl, %al
je 0x8221e
movl $0x0, (%r8)
jmp 0x8225d
testl %r11d, %r11d
js 0x8222c
movl %r11d, %eax
cltd
idivl %r9d
jmp 0x82236
leal 0x1(%r11), %eax
cltd
idivl %r9d
decl %eax
movl %eax, (%r8)
xorps %xmm3, %xmm3
cvtsi2sd %eax, %xmm3
movsd 0x10(%rdi), %xmm4
mulsd %xmm3, %xmm4
subsd %xmm4, %xmm1
mulsd 0x8(%rdi), %xmm3
subsd %xmm3, %xmm0
imull 0x34(%rdi), %eax
subl %eax, %r11d
movsd 0x40(%rdi), %xmm3
mulsd %xmm0, %xmm3
xorpd %xmm4, %xmm4
xorl %edx, %edx
ucomisd %xmm3, %xmm4
seta %dl
cvttsd2si %xmm3, %eax
subl %edx, %eax
movl %eax, (%rsi)
setns %dl
movl 0x30(%rdi), %r8d
cmpl %r8d, %eax
setl %r9b
testb %r9b, %dl
je 0x82296
movl $0x0, (%rcx)
jmp 0x822bf
testl %eax, %eax
js 0x822a0
cltd
idivl %r8d
jmp 0x822a8
incl %eax
cltd
idivl %r8d
decl %eax
movl %eax, (%rcx)
xorps %xmm3, %xmm3
cvtsi2sd %eax, %xmm3
mulsd (%rdi), %xmm3
imull 0x30(%rdi), %eax
subsd %xmm3, %xmm0
subl %eax, (%rsi)
movslq 0x30(%rdi), %rax
imull 0x34(%rdi), %r10d
addl %r11d, %r10d
movslq %r10d, %rcx
imulq %rax, %rcx
movslq (%rsi), %rax
addq %rcx, %rax
movl %eax, (%rsi)
movq 0x60(%rdi), %rcx
movq (%rcx,%rax,8), %rcx
movl $0x0, (%rbx)
movq 0x70(%rdi), %rdx
movslq (%rsi), %rax
cmpl $0x0, (%rdx,%rax,4)
setg %al
jle 0x82356
movsd 0x58(%rdi), %xmm3
addq $0x10, %rcx
xorl %edi, %edi
movapd 0xccd85(%rip), %xmm4    # 0x14f090
movsd -0x10(%rcx), %xmm5
subsd %xmm0, %xmm5
andpd %xmm4, %xmm5
ucomisd %xmm5, %xmm3
jbe 0x82343
movsd -0x8(%rcx), %xmm5
subsd %xmm1, %xmm5
andpd %xmm4, %xmm5
ucomisd %xmm5, %xmm3
jbe 0x82343
movsd (%rcx), %xmm5
subsd %xmm2, %xmm5
andpd %xmm4, %xmm5
ucomisd %xmm5, %xmm3
ja 0x82356
incl %edi
movl %edi, (%rbx)
movslq (%rsi), %rax
addq $0x20, %rcx
cmpl (%rdx,%rax,4), %edi
setl %al
jl 0x8230b
andb $0x1, %al
popq %rbx
retq