// File: /workspace/github_cpp_makefile_star2_O2/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 0x6109d
andl $0x0, (%r9)
unpcklpd %xmm1, %xmm0            # xmm0 = xmm0[0],xmm1[0]
jmp 0x610e5
testl %r10d, %r10d
js 0x610ab
movl %r10d, %eax
cltd
idivl %r11d
jmp 0x610b5
leal 0x1(%r10), %eax
cltd
idivl %r11d
decl %eax
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 0x6111e
andl $0x0, (%r8)
jmp 0x61155
testl %r11d, %r11d
js 0x6112c
movl %r11d, %eax
cltd
idivl %r9d
jmp 0x61136
leal 0x1(%r11), %eax
cltd
idivl %r9d
decl %eax
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 0x61191
andl $0x0, (%rcx)
movl (%rsi), %ecx
movapd %xmm0, %xmm1
jmp 0x611bf
testl %eax, %eax
js 0x6119b
cltd
idivl %r8d
jmp 0x611a3
incl %eax
cltd
idivl %r8d
decl %eax
movl %eax, (%rcx)
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), %rax
andl $0x0, (%rbx)
movq 0x70(%rdi), %rcx
movsd 0x58(%rdi), %xmm3
unpckhpd %xmm0, %xmm0            # xmm0 = xmm0[1,1]
addq $0x10, %rax
xorl %edx, %edx
movapd 0x9aea5(%rip), %xmm4    # 0xfc0a0
movslq (%rsi), %rdi
movl (%rcx,%rdi,4), %edi
cmpl %edi, %edx
jge 0x61247
movsd -0x10(%rax), %xmm5
subsd %xmm1, %xmm5
andpd %xmm4, %xmm5
ucomisd %xmm5, %xmm3
jbe 0x6123d
movsd -0x8(%rax), %xmm5
subsd %xmm0, %xmm5
andpd %xmm4, %xmm5
ucomisd %xmm5, %xmm3
jbe 0x6123d
movsd (%rax), %xmm5
subsd %xmm2, %xmm5
andpd %xmm4, %xmm5
ucomisd %xmm5, %xmm3
ja 0x61247
incl %edx
movl %edx, (%rbx)
addq $0x20, %rax
jmp 0x611fb
cmpl %edi, %edx
setl %al
popq %rbx
retq