// File: /workspace/github_cpp_makefile_star2_O3/Luthaf[P]zeopp/v_network.cc
// Function: voronoi_network::search_previous(double, double, double, double, double, int&, int&, int&, int&, int&)
bool voronoi_network::search_previous(double gx,double gy,double x,double y,double z,int &ijk,int &q,int &pi,int &pj,int &pk) {
	int ai=step_int((gx-net_tol)*xsp),bi=step_int((gx+net_tol)*xsp);
	int aj=step_int((gy-net_tol)*ysp),bj=step_int((gy+net_tol)*ysp);
	int ak=step_int((z-net_tol)*zsp),bk=step_int((z+net_tol)*zsp);
	int i,j,k,mi,mj,mk;
	double px,py,pz,px2,py2,px3,*pp;

	for(k=ak;k<=bk;k++) {
		pk=step_div(k,nz);px=pk*bxz;py=pk*byz;pz=pk*bz;mk=k-nz*pk;
		for(j=aj;j<=bj;j++) {
			pj=step_div(j,ny);px2=px+pj*bxy;py2=py+pj*by;mj=j-ny*pj;
			for(i=ai;i<=bi;i++) {
				pi=step_div(i,nx);px3=px2+pi*bx;mi=i-nx*pi;
				ijk=mi+nx*(mj+ny*mk);
				pp=pts[ijk];
				for(q=0;q<ptsc[ijk];q++,pp+=4) if(fabs(*pp+px3-x)<net_tol&&fabs(pp[1]+py2-y)<net_tol&&fabs(pp[2]+pz-z)<net_tol) return true;
			}
		}
	}
	return false;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %r8, -0x10(%rsp)
movq %rcx, -0x8(%rsp)
movsd 0x58(%rdi), %xmm5
movupd 0x50(%rdi), %xmm6
movapd %xmm4, %xmm7
subsd %xmm5, %xmm7
movapd %xmm5, %xmm8
addsd %xmm4, %xmm8
unpcklpd %xmm8, %xmm7            # xmm7 = xmm7[0],xmm8[0]
unpcklpd %xmm6, %xmm6            # xmm6 = xmm6[0,0]
mulpd %xmm7, %xmm6
cvttpd2dq %xmm6, %xmm8
xorpd %xmm7, %xmm7
cmpltpd %xmm7, %xmm6
shufps $0xe8, %xmm6, %xmm6     # xmm6 = xmm6[0,2,2,3]
paddd %xmm8, %xmm6
movd %xmm6, %r11d
pshufd $0x55, %xmm6, %xmm6     # xmm6 = xmm6[1,1,1,1]
movd %xmm6, %eax
movl %eax, -0x34(%rsp)
cmpl %eax, %r11d
jle 0x809d5
xorl %ebx, %ebx
andb $0x1, %bl
movl %ebx, %eax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rdx, %r10
unpcklpd %xmm1, %xmm0            # xmm0 = xmm0[0],xmm1[0]
movapd %xmm5, %xmm6
unpcklpd %xmm5, %xmm6            # xmm6 = xmm6[0],xmm5[0]
movapd %xmm0, %xmm9
subpd %xmm6, %xmm9
movupd 0x40(%rdi), %xmm1
mulpd %xmm1, %xmm9
cvttpd2dq %xmm9, %xmm8
cmpltpd %xmm7, %xmm9
shufps $0xe8, %xmm9, %xmm9     # xmm9 = xmm9[0,2,2,3]
paddd %xmm8, %xmm9
addpd %xmm0, %xmm6
mulpd %xmm1, %xmm6
cvttpd2dq %xmm6, %xmm0
cmpltpd %xmm7, %xmm6
shufps $0xe8, %xmm6, %xmm6     # xmm6 = xmm6[0,2,2,3]
paddd %xmm0, %xmm6
movsd 0x18(%rdi), %xmm0
movsd %xmm0, -0x20(%rsp)
movsd 0x20(%rdi), %xmm1
movsd 0x28(%rdi), %xmm0
movsd %xmm0, -0x28(%rsp)
movsd 0x8(%rdi), %xmm7
movsd 0x10(%rdi), %xmm8
pshufd $0x55, %xmm9, %xmm10    # xmm10 = xmm9[1,1,1,1]
movd %xmm9, -0x3c(%rsp)
pcmpgtd %xmm6, %xmm9
pshufd $0x50, %xmm9, %xmm9     # xmm9 = xmm9[0,0,1,1]
movmskpd %xmm9, %eax
movl %eax, -0x30(%rsp)
shrb %al
movb %al, -0x41(%rsp)
movd %xmm10, -0x40(%rsp)
pshufd $0x55, %xmm6, %xmm9     # xmm9 = xmm6[1,1,1,1]
movd %xmm9, -0x38(%rsp)
movd %xmm6, -0x2c(%rsp)
movb $0x1, %bl
movapd 0xcc608(%rip), %xmm9    # 0x14d0a0
movq %r9, -0x18(%rsp)
movl 0x38(%rdi), %r8d
testl %r11d, %r11d
js 0x80aaf
movl %r11d, %eax
cltd
idivl %r8d
jmp 0x80ab9
leal 0x1(%r11), %eax
cltd
idivl %r8d
decl %eax
movl %eax, (%r9)
cmpb $0x0, -0x41(%rsp)
je 0x80ade
leal 0x1(%r11), %eax
cmpl -0x34(%rsp), %r11d
setl %bl
movl %eax, %r11d
movq -0x18(%rsp), %r9
jne 0x80a9d
jmp 0x809c5
xorps %xmm10, %xmm10
cvtsi2sd %eax, %xmm10
movsd -0x20(%rsp), %xmm11
mulsd %xmm10, %xmm11
movapd %xmm1, %xmm12
mulsd %xmm10, %xmm12
mulsd -0x28(%rsp), %xmm10
imull 0x38(%rdi), %eax
movl %r11d, %r9d
subl %eax, %r9d
movsd (%rdi), %xmm13
movq 0x60(%rdi), %r8
movq 0x70(%rdi), %r13
movl -0x40(%rsp), %eax
movl %eax, %r14d
movl 0x34(%rdi), %r15d
testl %r14d, %r14d
js 0x80b34
movl %r14d, %eax
cltd
idivl %r15d
jmp 0x80b3e
leal 0x1(%r14), %eax
cltd
idivl %r15d
decl %eax
movq -0x10(%rsp), %rcx
movl %eax, (%rcx)
testb $0x1, -0x30(%rsp)
je 0x80b5f
leal 0x1(%r14), %eax
cmpl -0x38(%rsp), %r14d
movl %eax, %r14d
jne 0x80b22
jmp 0x80ac3
xorps %xmm14, %xmm14
cvtsi2sd %eax, %xmm14
movapd %xmm14, %xmm15
mulsd %xmm7, %xmm15
addsd %xmm11, %xmm15
mulsd %xmm8, %xmm14
imull 0x34(%rdi), %eax
addsd %xmm12, %xmm14
movl %r14d, %r12d
subl %eax, %r12d
movl -0x3c(%rsp), %eax
movl %eax, %r15d
movl 0x30(%rdi), %ebp
testl %r15d, %r15d
js 0x80ba2
movl %r15d, %eax
cltd
idivl %ebp
jmp 0x80bab
leal 0x1(%r15), %eax
cltd
idivl %ebp
decl %eax
movq -0x8(%rsp), %rcx
movl %eax, (%rcx)
movl 0x30(%rdi), %edx
movl 0x34(%rdi), %ebp
imull %r9d, %ebp
addl %r12d, %ebp
imull %edx, %ebp
imull %eax, %edx
movl %r15d, %ecx
subl %edx, %ecx
addl %ecx, %ebp
movl %ebp, (%rsi)
movslq %ebp, %rcx
movq (%r8,%rcx,8), %rdx
movl $0x0, (%r10)
movslq (%rsi), %rcx
cmpl $0x0, (%r13,%rcx,4)
jle 0x80c5e
xorps %xmm6, %xmm6
cvtsi2sd %eax, %xmm6
mulsd %xmm13, %xmm6
addsd %xmm15, %xmm6
addq $0x10, %rdx
xorl %eax, %eax
movsd -0x10(%rdx), %xmm0
addsd %xmm6, %xmm0
subsd %xmm2, %xmm0
andpd %xmm9, %xmm0
ucomisd %xmm0, %xmm5
jbe 0x80c4b
movsd -0x8(%rdx), %xmm0
addsd %xmm14, %xmm0
subsd %xmm3, %xmm0
andpd %xmm9, %xmm0
ucomisd %xmm0, %xmm5
jbe 0x80c4b
movsd (%rdx), %xmm0
addsd %xmm10, %xmm0
subsd %xmm4, %xmm0
andpd %xmm9, %xmm0
ucomisd %xmm0, %xmm5
ja 0x809c5
incl %eax
movl %eax, (%r10)
movslq (%rsi), %rcx
addq $0x20, %rdx
cmpl (%r13,%rcx,4), %eax
jl 0x80bfe
leal 0x1(%r15), %eax
cmpl -0x2c(%rsp), %r15d
movl %eax, %r15d
jne 0x80b92
jmp 0x80b4c
nop