// File: Luthaf[P]zeopp/voro++/src/cell.cc
// Function: voro::voronoicell_base::definite_min(int&, int&, double&, double&, unsigned int&)
bool voronoicell_base::definite_min(int &lp,int &us,double &l,double &u,unsigned int &lw) {
	int tp=up,ts,qp=0;
	unsigned int qw;
	double q;

	// Check to see whether point up is a well-defined maximum. Otherwise
	// any neighboring vertices of up that are marginal need to be
	// followed, to see if they lead to a better maximum.
	for(ts=0;ts<nu[tp];ts++) {
		qp=ed[tp][ts];
		m_test(qp,q);
		if(q<u+big_tol) break;
	}
	if(ts==nu[tp]) return true;

	// The point tp is marginal, so it will be necessary to do the
	// flood-fill search. Mark the point tp and the point qp, and search
	// any remaining neighbors of the point tp.
	int *stackp=ds+1;
	flip(up);
	flip(qp);
	*ds=qp;
	ts++;
	while(ts<nu[tp]) {
		qp=ed[tp][ts];
		m_test(qp,q);
		if(q<u+big_tol) {
			if(stackp==stacke) add_memory_ds();
			*(stackp++)=lp;
			flip(lp);
		}
		ts++;
	}

	// Consider additional marginal points, starting with the original
	// point qp
	int *spp=ds;
	while(spp<stackp) {
		tp=*(spp++);
		for(ts=0;ts<nu[tp];ts++) {
			qp=ed[tp][ts];

			// Skip the point if it's already marked
			if(ed[qp][nu[qp]<<1]<0) continue;
			qw=m_test(qp,q);

			// This point is a better minimum. Reset markers and
			// return true.
			if(q<u) {
				flip(up);
				up=tp;
				us=ts;
				m_test(up,u);
				lp=qp;
				lw=qw;
				l=q;
				while(stackp>ds) flip(*(--stackp));
				return false;
			}

			// The point is marginal and therefore must also be
			// considered
			if(q<u+big_tol) {
				if(stackp==stacke) {
					int nn=stackp-spp;
					add_memory_ds();
					spp=stackp-nn;
				}
				*(stackp++)=qp;
				flip(qp);
			}
		}
	}

	// Reset markers and return false
	flip(up);
	while(stackp>ds) flip(*(--stackp));
	return true;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x70, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq %rcx, -0x28(%rbp)
movq %r8, -0x30(%rbp)
movq %r9, -0x38(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x70(%rbp)
movl 0x20(%rax), %eax
movl %eax, -0x3c(%rbp)
movl $0x0, -0x44(%rbp)
movl $0x0, -0x40(%rbp)
movq -0x70(%rbp), %rcx
movl -0x40(%rbp), %eax
movq 0x30(%rcx), %rcx
movslq -0x3c(%rbp), %rdx
cmpl (%rcx,%rdx,4), %eax
jge 0x9941
movq -0x70(%rbp), %rdi
movq 0x28(%rdi), %rax
movslq -0x3c(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x40(%rbp), %rcx
movl (%rax,%rcx,4), %eax
movl %eax, -0x44(%rbp)
movl -0x44(%rbp), %esi
leaq -0x50(%rbp), %rdx
callq 0xf860
movq -0x70(%rbp), %rax
movsd -0x50(%rbp), %xmm1
movq -0x30(%rbp), %rcx
movsd (%rcx), %xmm0
addsd 0x58(%rax), %xmm0
ucomisd %xmm1, %xmm0
jbe 0x9934
jmp 0x9941
jmp 0x9936
movl -0x40(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x40(%rbp)
jmp 0x98dc
movq -0x70(%rbp), %rcx
movl -0x40(%rbp), %eax
movq 0x30(%rcx), %rcx
movslq -0x3c(%rbp), %rdx
cmpl (%rcx,%rdx,4), %eax
jne 0x995e
movb $0x1, -0x1(%rbp)
jmp 0x9c42
movq -0x70(%rbp), %rdi
movq 0x78(%rdi), %rax
addq $0x4, %rax
movq %rax, -0x58(%rbp)
movl 0x20(%rdi), %esi
callq 0x15ea0
movq -0x70(%rbp), %rdi
movl -0x44(%rbp), %esi
callq 0x15ea0
movq -0x70(%rbp), %rax
movl -0x44(%rbp), %ecx
movq 0x78(%rax), %rax
movl %ecx, (%rax)
movl -0x40(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x40(%rbp)
movq -0x70(%rbp), %rcx
movl -0x40(%rbp), %eax
movq 0x30(%rcx), %rcx
movslq -0x3c(%rbp), %rdx
cmpl (%rcx,%rdx,4), %eax
jge 0x9a40
movq -0x70(%rbp), %rdi
movq 0x28(%rdi), %rax
movslq -0x3c(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x40(%rbp), %rcx
movl (%rax,%rcx,4), %eax
movl %eax, -0x44(%rbp)
movl -0x44(%rbp), %esi
leaq -0x50(%rbp), %rdx
callq 0xf860
movq -0x70(%rbp), %rax
movsd -0x50(%rbp), %xmm1
movq -0x30(%rbp), %rcx
movsd (%rcx), %xmm0
addsd 0x58(%rax), %xmm0
ucomisd %xmm1, %xmm0
jbe 0x9a32
movq -0x70(%rbp), %rcx
movq -0x58(%rbp), %rax
cmpq 0x88(%rcx), %rax
jne 0x9a0c
movq -0x70(%rbp), %rdi
callq 0x6ff0
movq -0x70(%rbp), %rdi
movq -0x18(%rbp), %rax
movl (%rax), %ecx
movq -0x58(%rbp), %rax
movq %rax, %rdx
addq $0x4, %rdx
movq %rdx, -0x58(%rbp)
movl %ecx, (%rax)
movq -0x18(%rbp), %rax
movl (%rax), %esi
callq 0x15ea0
movl -0x40(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x40(%rbp)
jmp 0x9998
movq -0x70(%rbp), %rax
movq 0x78(%rax), %rax
movq %rax, -0x60(%rbp)
movq -0x60(%rbp), %rax
cmpq -0x58(%rbp), %rax
jae 0x9c07
movq -0x60(%rbp), %rax
movq %rax, %rcx
addq $0x4, %rcx
movq %rcx, -0x60(%rbp)
movl (%rax), %eax
movl %eax, -0x3c(%rbp)
movl $0x0, -0x40(%rbp)
movq -0x70(%rbp), %rcx
movl -0x40(%rbp), %eax
movq 0x30(%rcx), %rcx
movslq -0x3c(%rbp), %rdx
cmpl (%rcx,%rdx,4), %eax
jge 0x9c02
movq -0x70(%rbp), %rcx
movq 0x28(%rcx), %rax
movslq -0x3c(%rbp), %rdx
movq (%rax,%rdx,8), %rax
movslq -0x40(%rbp), %rdx
movl (%rax,%rdx,4), %eax
movl %eax, -0x44(%rbp)
movq 0x28(%rcx), %rax
movslq -0x44(%rbp), %rdx
movq (%rax,%rdx,8), %rax
movq 0x30(%rcx), %rcx
movslq -0x44(%rbp), %rdx
movl (%rcx,%rdx,4), %ecx
shll %ecx
movslq %ecx, %rcx
cmpl $0x0, (%rax,%rcx,4)
jge 0x9ace
jmp 0x9bf4
movq -0x70(%rbp), %rdi
movl -0x44(%rbp), %esi
leaq -0x50(%rbp), %rdx
callq 0xf860
movl %eax, -0x48(%rbp)
movsd -0x50(%rbp), %xmm1
movq -0x30(%rbp), %rax
movsd (%rax), %xmm0
ucomisd %xmm1, %xmm0
jbe 0x9b72
movq -0x70(%rbp), %rdi
movl 0x20(%rdi), %esi
callq 0x15ea0
movq -0x70(%rbp), %rdi
movl -0x3c(%rbp), %eax
movl %eax, 0x20(%rdi)
movl -0x40(%rbp), %ecx
movq -0x20(%rbp), %rax
movl %ecx, (%rax)
movl 0x20(%rdi), %esi
movq -0x30(%rbp), %rdx
callq 0xf860
movl -0x44(%rbp), %ecx
movq -0x18(%rbp), %rax
movl %ecx, (%rax)
movl -0x48(%rbp), %ecx
movq -0x38(%rbp), %rax
movl %ecx, (%rax)
movsd -0x50(%rbp), %xmm0
movq -0x28(%rbp), %rax
movsd %xmm0, (%rax)
movq -0x70(%rbp), %rcx
movq -0x58(%rbp), %rax
cmpq 0x78(%rcx), %rax
jbe 0x9b69
movq -0x70(%rbp), %rdi
movq -0x58(%rbp), %rax
movq %rax, %rcx
addq $-0x4, %rcx
movq %rcx, -0x58(%rbp)
movl -0x4(%rax), %esi
callq 0x15ea0
jmp 0x9b3e
movb $0x0, -0x1(%rbp)
jmp 0x9c42
movq -0x70(%rbp), %rax
movsd -0x50(%rbp), %xmm1
movq -0x30(%rbp), %rcx
movsd (%rcx), %xmm0
addsd 0x58(%rax), %xmm0
ucomisd %xmm1, %xmm0
jbe 0x9bf2
movq -0x70(%rbp), %rcx
movq -0x58(%rbp), %rax
cmpq 0x88(%rcx), %rax
jne 0x9bd2
movq -0x70(%rbp), %rdi
movq -0x58(%rbp), %rax
movq -0x60(%rbp), %rcx
subq %rcx, %rax
sarq $0x2, %rax
movl %eax, -0x64(%rbp)
callq 0x6ff0
movq -0x58(%rbp), %rax
movslq -0x64(%rbp), %rdx
xorl %ecx, %ecx
subq %rdx, %rcx
shlq $0x2, %rcx
addq %rcx, %rax
movq %rax, -0x60(%rbp)
movq -0x70(%rbp), %rdi
movl -0x44(%rbp), %ecx
movq -0x58(%rbp), %rax
movq %rax, %rdx
addq $0x4, %rdx
movq %rdx, -0x58(%rbp)
movl %ecx, (%rax)
movl -0x44(%rbp), %esi
callq 0x15ea0
jmp 0x9bf4
movl -0x40(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x40(%rbp)
jmp 0x9a75
jmp 0x9a4c
movq -0x70(%rbp), %rdi
movl 0x20(%rdi), %esi
callq 0x15ea0
movq -0x70(%rbp), %rcx
movq -0x58(%rbp), %rax
cmpq 0x78(%rcx), %rax
jbe 0x9c3e
movq -0x70(%rbp), %rdi
movq -0x58(%rbp), %rax
movq %rax, %rcx
addq $-0x4, %rcx
movq %rcx, -0x58(%rbp)
movl -0x4(%rax), %esi
callq 0x15ea0
jmp 0x9c13
movb $0x1, -0x1(%rbp)
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0x70, %rsp
popq %rbp
retq
nopl (%rax)