// File: /workspace/github_cpp_makefile_star2_O3/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 0x80eba
movl $0x0, (%r9)
unpcklpd %xmm1, %xmm0            # xmm0 = xmm0[0],xmm1[0]
jmp 0x80f05
testl %r10d, %r10d
js 0x80ec8
movl %r10d, %eax
cltd
idivl %r11d
jmp 0x80ed2
leal 0x1(%r10), %eax
cltd
idivl %r11d
decl %eax
xorps %xmm3, %xmm3
cvtsi2sd %eax, %xmm3
movl %eax, (%r9)
movsd 0x28(%rdi), %xmm4
mulsd %xmm3, %xmm4
subsd %xmm4, %xmm2
movupd 0x18(%rdi), %xmm4
unpcklpd %xmm3, %xmm3            # xmm3 = xmm3[0,0]
mulpd %xmm4, %xmm3
unpcklpd %xmm1, %xmm0            # xmm0 = xmm0[0],xmm1[0]
subpd %xmm3, %xmm0
imull 0x38(%rdi), %eax
subl %eax, %r10d
movapd %xmm0, %xmm1
unpckhpd %xmm0, %xmm1            # xmm1 = xmm1[1],xmm0[1]
mulsd 0x48(%rdi), %xmm1
xorpd %xmm3, %xmm3
xorl %eax, %eax
ucomisd %xmm1, %xmm3
seta %al
cvttsd2si %xmm1, %r11d
subl %eax, %r11d
setns %al
movl 0x34(%rdi), %r9d
cmpl %r9d, %r11d
setl %dl
testb %dl, %al
je 0x80f41
movl $0x0, (%r8)
jmp 0x80f7b
testl %r11d, %r11d
js 0x80f4f
movl %r11d, %eax
cltd
idivl %r9d
jmp 0x80f59
leal 0x1(%r11), %eax
cltd
idivl %r9d
decl %eax
xorps %xmm1, %xmm1
cvtsi2sd %eax, %xmm1
movl %eax, (%r8)
movupd 0x8(%rdi), %xmm3
unpcklpd %xmm1, %xmm1            # xmm1 = xmm1[0,0]
mulpd %xmm3, %xmm1
subpd %xmm1, %xmm0
imull 0x34(%rdi), %eax
subl %eax, %r11d
movsd 0x40(%rdi), %xmm1
mulsd %xmm0, %xmm1
xorpd %xmm3, %xmm3
xorl %edx, %edx
ucomisd %xmm1, %xmm3
seta %dl
cvttsd2si %xmm1, %eax
subl %edx, %eax
movl %eax, (%rsi)
setns %dl
movl 0x30(%rdi), %r8d
cmpl %r8d, %eax
setl %r9b
testb %r9b, %dl
je 0x80fba
movl $0x0, (%rcx)
movl (%rsi), %ecx
movapd %xmm0, %xmm1
jmp 0x80feb
testl %eax, %eax
js 0x80fc4
cltd
idivl %r8d
jmp 0x80fcc
incl %eax
cltd
idivl %r8d
decl %eax
movl %eax, (%rcx)
xorps %xmm3, %xmm3
cvtsi2sd %eax, %xmm3
mulsd (%rdi), %xmm3
movapd %xmm0, %xmm1
imull 0x30(%rdi), %eax
subsd %xmm3, %xmm1
movl (%rsi), %ecx
subl %eax, %ecx
movl %ecx, (%rsi)
imull 0x34(%rdi), %r10d
addl %r11d, %r10d
imull 0x30(%rdi), %r10d
addl %ecx, %r10d
movl %r10d, (%rsi)
movq 0x60(%rdi), %rax
movslq %r10d, %rcx
movq (%rax,%rcx,8), %rcx
movl $0x0, (%rbx)
movq 0x70(%rdi), %rdx
movslq (%rsi), %r8
xorl %eax, %eax
cmpl $0x0, (%rdx,%r8,4)
jle 0x81082
movsd 0x58(%rdi), %xmm3
unpckhpd %xmm0, %xmm0            # xmm0 = xmm0[1,1]
addq $0x10, %rcx
movapd 0xcc06c(%rip), %xmm4    # 0x14d0a0
movsd -0x10(%rcx), %xmm5
subsd %xmm1, %xmm5
andpd %xmm4, %xmm5
ucomisd %xmm5, %xmm3
jbe 0x8106c
movsd -0x8(%rcx), %xmm5
subsd %xmm0, %xmm5
andpd %xmm4, %xmm5
ucomisd %xmm5, %xmm3
jbe 0x8106c
movsd (%rcx), %xmm5
subsd %xmm2, %xmm5
andpd %xmm4, %xmm5
ucomisd %xmm5, %xmm3
ja 0x81080
incl %eax
movl %eax, (%rbx)
movslq (%rsi), %rdi
addq $0x20, %rcx
cmpl (%rdx,%rdi,4), %eax
jl 0x81034
xorl %eax, %eax
jmp 0x81082
movb $0x1, %al
popq %rbx
retq