// File: /workspace/github_cpp_makefile_star2_O2/Luthaf[P]zeopp/voro++/src/cell.cc
// Function: voro::voronoicell_base::definite_max(int&, int&, double&, double&, unsigned int&)
bool voronoicell_base::definite_max(int &lp,int &ls,double &l,double &u,unsigned int &uw) {
	int tp=lp,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>l-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(lp);
	flip(qp);
	*ds=qp;
	ts++;
	while(ts<nu[tp]) {
		qp=ed[tp][ts];
		m_test(qp,q);
		if(q>l-big_tol) {
			if(stackp==stacke) add_memory_ds();
			*(stackp++)=up;
			flip(up);
		}
		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 maximum. Reset markers and
			// return true.
			if(q>l) {
				flip(lp);
				lp=tp;
				ls=ts;
				m_test(lp,l);
				up=qp;
				uw=qw;
				u=q;
				while(stackp>ds) flip(*(--stackp));
				return false;
			}

			// The point is marginal and therefore must also be
			// considered
			if(q>l-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(lp);
	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, 0x40(%rsp)
movq %rcx, 0x10(%rsp)
movq %rdx, 0x30(%rsp)
movq %rsi, %r13
movq %rdi, %rbx
movslq (%rsi), %r12
xorl %r15d, %r15d
leaq 0x8(%rsp), %r14
xorl %ebp, %ebp
movq 0x30(%rbx), %rax
movslq (%rax,%r12,4), %rcx
cmpq %rcx, %r15
jge 0x6546
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 0x8(%rsp), %xmm0
movq 0x10(%rsp), %rax
movsd (%rax), %xmm1
subsd 0x58(%rbx), %xmm1
ucomisd %xmm1, %xmm0
ja 0x653e
incq %r15
jmp 0x64f9
movq 0x30(%rbx), %rax
movl (%rax,%r12,4), %ecx
movb $0x1, %al
cmpl %r15d, %ecx
je 0x671d
movq 0x78(%rbx), %r14
movl (%r13), %esi
movq %rbx, %rdi
callq 0xe00a
movq %rbx, %rdi
movl %ebp, %esi
callq 0xe00a
movq 0x78(%rbx), %rax
movl %ebp, (%rax)
leaq 0x8(%rsp), %rbp
addq $0x4, %r14
movq 0x30(%rbx), %rax
leal 0x1(%r15), %ecx
cmpl %ecx, (%rax,%r12,4)
jle 0x65de
movq 0x28(%rbx), %rax
movq (%rax,%r12,8), %rax
movl 0x4(%rax,%r15,4), %esi
movq %rbx, %rdi
movq %rbp, %rdx
callq 0xa0b0
movq 0x10(%rsp), %rax
movsd (%rax), %xmm0
subsd 0x58(%rbx), %xmm0
movsd 0x8(%rsp), %xmm1
incq %r15
ucomisd %xmm0, %xmm1
jbe 0x657a
cmpq 0x88(%rbx), %r14
jne 0x65ce
movq %rbx, %rdi
callq 0x543c
movl 0x20(%rbx), %esi
movl %esi, (%r14)
movq %rbx, %rdi
callq 0xe00a
jmp 0x6576
movq %r13, 0x28(%rsp)
movq 0x78(%rbx), %rdx
cmpq %r14, %rdx
jae 0x672c
movl (%rdx), %ecx
addq $0x4, %rdx
movq %rdx, 0x18(%rsp)
movl %ecx, 0x24(%rsp)
movslq %ecx, %r13
xorl %r12d, %r12d
movslq (%rax,%r13,4), %rcx
cmpq %rcx, %r12
jge 0x66ad
movq 0x28(%rbx), %rcx
movq (%rcx,%r13,8), %rdx
movslq (%rdx,%r12,4), %rbp
movq (%rcx,%rbp,8), %rcx
movl (%rax,%rbp,4), %eax
addl %eax, %eax
cltq
cmpl $0x0, (%rcx,%rax,4)
js 0x66a1
movq %rbx, %rdi
movl %ebp, %esi
leaq 0x8(%rsp), %rdx
callq 0xa0b0
movl %eax, %r15d
movsd 0x8(%rsp), %xmm0
movq 0x10(%rsp), %rax
movsd (%rax), %xmm1
ucomisd %xmm1, %xmm0
ja 0x66b7
subsd 0x58(%rbx), %xmm1
ucomisd %xmm1, %xmm0
jbe 0x66a1
cmpq 0x88(%rbx), %r14
jne 0x6690
movq %r14, %r15
subq 0x18(%rsp), %r15
movq %rbx, %rdi
callq 0x543c
shrq $0x2, %r15
movslq %r15d, %rax
shlq $0x2, %rax
movq %r14, %rcx
subq %rax, %rcx
movq %rcx, 0x18(%rsp)
movl %ebp, (%r14)
addq $0x4, %r14
movq %rbx, %rdi
movl %ebp, %esi
callq 0xe00a
incq %r12
movq 0x30(%rbx), %rax
jmp 0x6605
movq 0x18(%rsp), %rdx
jmp 0x65e7
movq 0x28(%rsp), %r13
movl (%r13), %esi
movq %rbx, %rdi
callq 0xe00a
movl 0x24(%rsp), %eax
movl %eax, (%r13)
movq 0x30(%rsp), %rax
movl %r12d, (%rax)
movl (%r13), %esi
movq %rbx, %rdi
movq 0x10(%rsp), %rdx
callq 0xa0b0
movl %ebp, 0x20(%rbx)
movq 0x38(%rsp), %rax
movl %r15d, (%rax)
movsd 0x8(%rsp), %xmm0
movq 0x40(%rsp), %rax
movsd %xmm0, (%rax)
cmpq 0x78(%rbx), %r14
jbe 0x671b
movl -0x4(%r14), %esi
addq $-0x4, %r14
movq %rbx, %rdi
callq 0xe00a
jmp 0x6703
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 0x6735
movb $0x1, %al
jmp 0x671d