// File: Luthaf[P]zeopp/voro++/src/cell.cc
// Function: voro::voronoicell_neighbor::check_facets()
void voronoicell_neighbor::check_facets() {
	int i,j,k,l,m,q;
	for(i=1;i<p;i++) for(j=0;j<nu[i];j++) {
		k=ed[i][j];
		if(k>=0) {
			ed[i][j]=-1-k;
			q=ne[i][j];
			l=cycle_up(ed[i][nu[i]+j],k);
			do {
				m=ed[k][l];
				ed[k][l]=-1-m;
				if(ne[k][l]!=q) fprintf(stderr,"Facet error at (%d,%d)=%d, started from (%d,%d)=%d\n",k,l,ne[k][l],i,j,q);
				l=cycle_up(ed[k][nu[k]+l],m);
				k=m;
			} while (k!=i);
		}
	}
	reset_edges();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x28(%rbp)
movl $0x1, -0xc(%rbp)
movq -0x28(%rbp), %rcx
movl -0xc(%rbp), %eax
cmpl 0x1c(%rcx), %eax
jge 0xe4f0
movl $0x0, -0x10(%rbp)
movq -0x28(%rbp), %rcx
movl -0x10(%rbp), %eax
movq 0x30(%rcx), %rcx
movslq -0xc(%rbp), %rdx
cmpl (%rcx,%rdx,4), %eax
jge 0xe4e0
movq -0x28(%rbp), %rax
movq 0x28(%rax), %rax
movslq -0xc(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x10(%rbp), %rcx
movl (%rax,%rcx,4), %eax
movl %eax, -0x14(%rbp)
cmpl $0x0, -0x14(%rbp)
jl 0xe4d0
movq -0x28(%rbp), %rdi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
subl -0x14(%rbp), %edx
movq 0x28(%rdi), %rax
movslq -0xc(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x10(%rbp), %rcx
movl %edx, (%rax,%rcx,4)
movq 0xf0(%rdi), %rax
movslq -0xc(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x10(%rbp), %rcx
movl (%rax,%rcx,4), %eax
movl %eax, -0x20(%rbp)
movq 0x28(%rdi), %rax
movslq -0xc(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq 0x30(%rdi), %rcx
movslq -0xc(%rbp), %rdx
movl (%rcx,%rdx,4), %ecx
addl -0x10(%rbp), %ecx
movslq %ecx, %rcx
movl (%rax,%rcx,4), %esi
movl -0x14(%rbp), %edx
callq 0x15f00
movl %eax, -0x18(%rbp)
movq -0x28(%rbp), %rax
movq 0x28(%rax), %rcx
movslq -0x14(%rbp), %rdx
movq (%rcx,%rdx,8), %rcx
movslq -0x18(%rbp), %rdx
movl (%rcx,%rdx,4), %ecx
movl %ecx, -0x1c(%rbp)
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
subl -0x1c(%rbp), %esi
movq 0x28(%rax), %rcx
movslq -0x14(%rbp), %rdx
movq (%rcx,%rdx,8), %rcx
movslq -0x18(%rbp), %rdx
movl %esi, (%rcx,%rdx,4)
movq 0xf0(%rax), %rax
movslq -0x14(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x18(%rbp), %rcx
movl (%rax,%rcx,4), %eax
cmpl -0x20(%rbp), %eax
je 0xe48d
movq -0x28(%rbp), %rax
movq 0x57b94(%rip), %rcx     # 0x65fe0
movq (%rcx), %rdi
movl -0x14(%rbp), %edx
movl -0x18(%rbp), %ecx
movq 0xf0(%rax), %rax
movslq -0x14(%rbp), %rsi
movq (%rax,%rsi,8), %rax
movslq -0x18(%rbp), %rsi
movl (%rax,%rsi,4), %r8d
movl -0xc(%rbp), %r9d
movl -0x10(%rbp), %r10d
movl -0x20(%rbp), %eax
leaq 0x496a2(%rip), %rsi     # 0x57b20
movl %r10d, (%rsp)
movl %eax, 0x8(%rsp)
movb $0x0, %al
callq 0x21a0
movq -0x28(%rbp), %rdi
movq 0x28(%rdi), %rax
movslq -0x14(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq 0x30(%rdi), %rcx
movslq -0x14(%rbp), %rdx
movl (%rcx,%rdx,4), %ecx
addl -0x18(%rbp), %ecx
movslq %ecx, %rcx
movl (%rax,%rcx,4), %esi
movl -0x1c(%rbp), %edx
callq 0x15f00
movl %eax, -0x18(%rbp)
movl -0x1c(%rbp), %eax
movl %eax, -0x14(%rbp)
movl -0x14(%rbp), %eax
cmpl -0xc(%rbp), %eax
jne 0xe3f1
jmp 0xe4d0
jmp 0xe4d2
movl -0x10(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x10(%rbp)
jmp 0xe352
jmp 0xe4e2
movl -0xc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xc(%rbp)
jmp 0xe33b
movq -0x28(%rbp), %rdi
callq 0x15f40
addq $0x40, %rsp
popq %rbp
retq
nop