// File: /workspace/github_cpp_makefile_star2_O1/Luthaf[P]zeopp/voro++/src/cell.cc
// Function: voro::voronoicell_base::search_upward(unsigned int&, int&, int&, int&, double&, double&)
inline bool voronoicell_base::search_upward(unsigned int &uw,int &lp,int &ls,int &us,double &l,double &u) {
	int vs;
	lp=up;l=u;

	// The test point is outside of the cutting space
	for(ls=0;ls<nu[lp];ls++) {
		up=ed[lp][ls];
		uw=m_test(up,u);
		if(u>l) break;
	}
	if(ls==nu[lp]) if(definite_max(lp,ls,l,u,uw)) {
		up=lp;
		return false;
	}

	while(uw==0) {
		//if(++count>=p) failsafe_find(lp,ls,us,l,u);

		// Test all the neighbors of the current point
		// and find the one which is closest to the
		// plane
		vs=ed[lp][nu[lp]+ls];lp=up;l=u;
		for(ls=0;ls<nu[lp];ls++) {
			if(ls==vs) continue;
			up=ed[lp][ls];
			uw=m_test(up,u);
			if(u>l) break;
		}
		if(ls==nu[lp]&&definite_max(lp,ls,l,u,uw)) {
			up=lp;
			return false;
		}
	}
	us=ed[lp][nu[lp]+ls];
	return true;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %r9, %r13
movq %r8, %rbx
movq %rcx, %r14
movq %rdx, %r12
movq %rsi, %rbp
movq %rdi, %r15
movq 0x40(%rsp), %rdx
movl 0x20(%rdi), %eax
movl %eax, (%r12)
movsd (%rdx), %xmm0
movsd %xmm0, (%r9)
movl $0x0, (%rcx)
movq 0x30(%rdi), %rax
movslq (%r12), %rcx
cmpl $0x0, (%rax,%rcx,4)
jle 0xcba6
xorl %eax, %eax
movq 0x28(%r15), %rsi
movq 0x38(%r15), %rdi
movq (%rsi,%rcx,8), %rcx
cltq
movslq (%rcx,%rax,4), %rsi
movl %esi, 0x20(%r15)
movl (%rdi,%rsi,4), %eax
cmpl 0xc0(%r15), %eax
jae 0xcb6d
movq %r15, %rdi
callq 0xa318
movq 0x40(%rsp), %rdx
jmp 0xcb82
movq 0x40(%r15), %rcx
shlq $0x5, %rsi
movsd 0x18(%rcx,%rsi), %xmm0
movsd %xmm0, (%rdx)
andl $0x3, %eax
movl %eax, (%rbp)
movsd (%rdx), %xmm0
ucomisd (%r13), %xmm0
ja 0xcba6
movl (%r14), %eax
incl %eax
movl %eax, (%r14)
movq 0x30(%r15), %rsi
movslq (%r12), %rcx
cmpl (%rsi,%rcx,4), %eax
jl 0xcb3c
movl (%r14), %eax
movq 0x30(%r15), %rcx
movslq (%r12), %rsi
cmpl (%rcx,%rsi,4), %eax
jne 0xcbdc
movq %r15, %rdi
movq %r12, %rsi
movq %r14, %rdx
movq %r13, %rcx
movq 0x40(%rsp), %r8
movq %rbp, %r9
callq 0x7cbe
movq 0x40(%rsp), %rdx
testb %al, %al
jne 0xccd8
movq %rbx, (%rsp)
cmpl $0x0, (%rbp)
jne 0xcce4
movq 0x28(%r15), %rax
movslq (%r12), %rcx
movq (%rax,%rcx,8), %rax
movq 0x30(%r15), %rsi
movslq (%rsi,%rcx,4), %rcx
movslq (%r14), %rsi
addq %rcx, %rsi
movl (%rax,%rsi,4), %ebx
movl 0x20(%r15), %eax
movl %eax, (%r12)
movsd (%rdx), %xmm0
movsd %xmm0, (%r13)
movl $0x0, (%r14)
movq 0x30(%r15), %rax
movslq (%r12), %rcx
cmpl $0x0, (%rax,%rcx,4)
jle 0xcc9e
xorl %eax, %eax
cmpl %ebx, %eax
je 0xcc89
movq 0x28(%r15), %rsi
movq 0x38(%r15), %rdi
movq (%rsi,%rcx,8), %rcx
cltq
movslq (%rcx,%rax,4), %rsi
movl %esi, 0x20(%r15)
movl (%rdi,%rsi,4), %eax
cmpl 0xc0(%r15), %eax
jae 0xcc65
movq %r15, %rdi
callq 0xa318
movq 0x40(%rsp), %rdx
jmp 0xcc7a
movq 0x40(%r15), %rcx
shlq $0x5, %rsi
movsd 0x18(%rcx,%rsi), %xmm0
movsd %xmm0, (%rdx)
andl $0x3, %eax
movl %eax, (%rbp)
movsd (%rdx), %xmm0
ucomisd (%r13), %xmm0
ja 0xcc9e
movl (%r14), %eax
incl %eax
movl %eax, (%r14)
movq 0x30(%r15), %rsi
movslq (%r12), %rcx
cmpl (%rsi,%rcx,4), %eax
jl 0xcc30
movl (%r14), %eax
movq 0x30(%r15), %rcx
movslq (%r12), %rsi
cmpl (%rcx,%rsi,4), %eax
jne 0xcbe0
movq %r15, %rdi
movq %r12, %rsi
movq %r14, %rdx
movq %r13, %rcx
movq 0x40(%rsp), %r8
movq %rbp, %r9
callq 0x7cbe
movq 0x40(%rsp), %rdx
testb %al, %al
je 0xcbe0
movl (%r12), %eax
movl %eax, 0x20(%r15)
xorl %eax, %eax
jmp 0xcd09
movslq (%r12), %rax
movq 0x28(%r15), %rcx
movq 0x30(%r15), %rdx
movq (%rcx,%rax,8), %rcx
movslq (%rdx,%rax,4), %rax
movslq (%r14), %rdx
addq %rax, %rdx
movl (%rcx,%rdx,4), %eax
movq (%rsp), %rcx
movl %eax, (%rcx)
movb $0x1, %al
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq