// File: /workspace/github_cpp_makefile_star2_O2/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq %r9, 0x38(%rsp)
movq %r8, %r13
movq %rcx, 0x40(%rsp)
movq %rdx, 0x30(%rsp)
movq %rsi, 0x18(%rsp)
movq %rdi, %rbx
leaq 0x20(%rdi), %rax
movq %rax, 0x28(%rsp)
movslq 0x20(%rdi), %r12
xorl %r15d, %r15d
movq %rsp, %r14
xorl %ebp, %ebp
movq 0x30(%rbx), %rax
movslq (%rax,%r12,4), %rcx
cmpq %rcx, %r15
jge 0x67d6
movq 0x28(%rbx), %rax
movq (%rax,%r12,8), %rax
movl (%rax,%r15,4), %ebp
movq %rbx, %rdi
movl %ebp, %esi
movq %r14, %rdx
callq 0xa0b0
movsd (%r13), %xmm0
addsd 0x58(%rbx), %xmm0
ucomisd (%rsp), %xmm0
ja 0x67ce
incq %r15
jmp 0x6791
movq 0x30(%rbx), %rax
movl (%rax,%r12,4), %ecx
movb $0x1, %al
cmpl %r15d, %ecx
je 0x699e
movq 0x78(%rbx), %r14
movl 0x20(%rbx), %esi
movq %rbx, %rdi
callq 0xe00a
movq %rbx, %rdi
movl %ebp, %esi
callq 0xe00a
movq 0x78(%rbx), %rax
movl %ebp, (%rax)
movq %rsp, %rbp
addq $0x4, %r14
movq 0x30(%rbx), %rax
leal 0x1(%r15), %ecx
cmpl %ecx, (%rax,%r12,4)
jle 0x6867
movq 0x28(%rbx), %rax
movq (%rax,%r12,8), %rax
movl 0x4(%rax,%r15,4), %esi
movq %rbx, %rdi
movq %rbp, %rdx
callq 0xa0b0
movsd (%r13), %xmm0
addsd 0x58(%rbx), %xmm0
incq %r15
ucomisd (%rsp), %xmm0
jbe 0x6807
cmpq 0x88(%rbx), %r14
jne 0x6853
movq %rbx, %rdi
callq 0x543c
movq 0x18(%rsp), %rax
movl (%rax), %esi
movl %esi, (%r14)
movq %rbx, %rdi
callq 0xe00a
jmp 0x6803
movq 0x78(%rbx), %rdx
movq %r13, 0x20(%rsp)
cmpq %r14, %rdx
jae 0x69ad
movl (%rdx), %ecx
addq $0x4, %rdx
movq %rdx, 0x8(%rsp)
movl %ecx, 0x14(%rsp)
movslq %ecx, %r13
xorl %r15d, %r15d
movslq (%rax,%r13,4), %rcx
cmpq %rcx, %r15
jge 0x6933
movq 0x28(%rbx), %rcx
movq (%rcx,%r13,8), %rdx
movslq (%rdx,%r15,4), %rbp
movq (%rcx,%rbp,8), %rcx
movl (%rax,%rbp,4), %eax
addl %eax, %eax
cltq
cmpl $0x0, (%rcx,%rax,4)
js 0x6927
movq %rbx, %rdi
movl %ebp, %esi
movq %rsp, %rdx
callq 0xa0b0
movl %eax, %r12d
movsd (%rsp), %xmm0
movq 0x20(%rsp), %rax
movsd (%rax), %xmm1
ucomisd %xmm0, %xmm1
ja 0x693d
addsd 0x58(%rbx), %xmm1
ucomisd %xmm0, %xmm1
jbe 0x6927
cmpq 0x88(%rbx), %r14
jne 0x6916
movq %r14, %r12
subq 0x8(%rsp), %r12
movq %rbx, %rdi
callq 0x543c
shrq $0x2, %r12
movslq %r12d, %rax
shlq $0x2, %rax
movq %r14, %rcx
subq %rax, %rcx
movq %rcx, 0x8(%rsp)
movl %ebp, (%r14)
addq $0x4, %r14
movq %rbx, %rdi
movl %ebp, %esi
callq 0xe00a
incq %r15
movq 0x30(%rbx), %rax
jmp 0x688e
movq 0x8(%rsp), %rdx
jmp 0x6870
movl 0x20(%rbx), %esi
movq %rbx, %rdi
callq 0xe00a
movl 0x14(%rsp), %eax
movl %eax, 0x20(%rbx)
movq 0x30(%rsp), %rax
movl %r15d, (%rax)
movl 0x20(%rbx), %esi
movq %rbx, %rdi
movq 0x20(%rsp), %rdx
callq 0xa0b0
movq 0x18(%rsp), %rax
movl %ebp, (%rax)
movq 0x38(%rsp), %rax
movl %r12d, (%rax)
movsd (%rsp), %xmm0
movq 0x40(%rsp), %rax
movsd %xmm0, (%rax)
cmpq 0x78(%rbx), %r14
jbe 0x699c
movl -0x4(%r14), %esi
addq $-0x4, %r14
movq %rbx, %rdi
callq 0xe00a
jmp 0x6984
xorl %eax, %eax
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x4(%r14), %r15
movq 0x28(%rsp), %rax
movl (%rax), %esi
movq %rbx, %rdi
callq 0xe00a
addq $-0x4, %r14
addq $-0x4, %r15
movq %r14, %rax
cmpq 0x78(%rbx), %r15
ja 0x69b6
movb $0x1, %al
jmp 0x699e
nop