// File: /workspace/github_c_makefile_star2_O0/ComplexNetworks-DCC-FCUP[P]gtrieScanner/nauty/naugraph.c
// Function: bestcell(unsigned int*, int*, int*, int, int, int, int)
static int
bestcell(graph *g, int *lab, int *ptn, int level, int tc_level, int m, int n)
{
	int i;
	set *gp;
	setword setword1,setword2;
	int v1,v2,nnt;

#if !MAXN 
	DYNALLOC1(permutation,workperm,workperm_sz,n,"bestcell"); 
	DYNALLOC1(set,workset,workset_sz,m,"bestcell"); 
	DYNALLOC1(int,bucket,bucket_sz,n+2,"bestcell"); 
#endif

   /* find non-singleton cells: put starts in workperm[0..nnt-1] */

	i = nnt = 0;

	while (i < n)
	{
	    if (ptn[i] > level)
	    {
	        workperm[nnt++] = i;
	        while (ptn[i] > level) ++i;
	    }
	    ++i;
	}

	if (nnt == 0) return n;

	/* set bucket[i] to # non-trivial neighbours of n.s. cell i */

	for (i = nnt; --i >= 0;) bucket[i] = 0;

	for (v2 = 1; v2 < nnt; ++v2)
	{
	    EMPTYSET(workset,m);
	    i = workperm[v2] - 1;
	    do
	    {
	        ++i;
	        ADDELEMENT(workset,lab[i]);
	    }
	    while (ptn[i] > level);
	    for (v1 = 0; v1 < v2; ++v1)
	    {
	        gp = GRAPHROW(g,lab[workperm[v1]],m);
#if  MAXM==1
	        setword1 = *workset & *gp;
	        setword2 = *workset & ~*gp;
#else
	        setword1 = setword2 = 0;
	        for (i = m; --i >= 0;)
	        {
	            setword1 |= workset[i] & gp[i];
	            setword2 |= workset[i] & ~gp[i];
	        }
#endif
	        if (setword1 != 0 && setword2 != 0)
	        {
	            ++bucket[v1];
	            ++bucket[v2];
	        }
	    }
	}

	/* find first greatest bucket value */

	v1 = 0;
	v2 = bucket[0];
	for (i = 1; i < nnt; ++i)
	    if (bucket[i] > v2)
	    {
	        v1 = i;
	        v2 = bucket[i];
	    }

	return (int)workperm[v1];
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movl 0x10(%rbp), %eax
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movl %ecx, -0x24(%rbp)
movl %r8d, -0x28(%rbp)
movl %r9d, -0x2c(%rbp)
movslq 0x10(%rbp), %rax
cmpq 0x1dbd3(%rip), %rax     # 0x3d540
jbe 0x1f9b8
cmpq $0x0, 0x1dbc9(%rip)     # 0x3d540
je 0x1f985
movq 0x1dbc8(%rip), %rdi     # 0x3d548
callq 0x3320
movslq 0x10(%rbp), %rax
movq %rax, 0x1dbb0(%rip)     # 0x3d540
movslq 0x10(%rbp), %rdi
shlq $0x2, %rdi
callq 0x3370
movq %rax, 0x1dba4(%rip)     # 0x3d548
cmpq $0x0, %rax
jne 0x1f9b6
leaq 0x1573(%rip), %rdi      # 0x20f24
callq 0x1d260
jmp 0x1f9b8
movslq -0x2c(%rbp), %rax
cmpq 0x1db8d(%rip), %rax     # 0x3d550
jbe 0x1fa0e
cmpq $0x0, 0x1db83(%rip)     # 0x3d550
je 0x1f9db
movq 0x1db82(%rip), %rdi     # 0x3d558
callq 0x3320
movslq -0x2c(%rbp), %rax
movq %rax, 0x1db6a(%rip)     # 0x3d550
movslq -0x2c(%rbp), %rdi
shlq $0x2, %rdi
callq 0x3370
movq %rax, 0x1db5e(%rip)     # 0x3d558
cmpq $0x0, %rax
jne 0x1fa0c
leaq 0x151d(%rip), %rdi      # 0x20f24
callq 0x1d260
jmp 0x1fa0e
movl 0x10(%rbp), %eax
addl $0x2, %eax
cltq
cmpq 0x1db43(%rip), %rax     # 0x3d560
jbe 0x1fa71
cmpq $0x0, 0x1db39(%rip)     # 0x3d560
je 0x1fa35
movq 0x1db38(%rip), %rdi     # 0x3d568
callq 0x3320
movl 0x10(%rbp), %eax
addl $0x2, %eax
cltq
movq %rax, 0x1db1c(%rip)     # 0x3d560
movl 0x10(%rbp), %eax
addl $0x2, %eax
movslq %eax, %rdi
shlq $0x2, %rdi
callq 0x3370
movq %rax, 0x1db0b(%rip)     # 0x3d568
cmpq $0x0, %rax
jne 0x1fa6f
leaq 0x14ba(%rip), %rdi      # 0x20f24
callq 0x1d260
jmp 0x1fa71
movl $0x0, -0x4c(%rbp)
movl $0x0, -0x30(%rbp)
movl -0x30(%rbp), %eax
cmpl 0x10(%rbp), %eax
jge 0x1fada
movq -0x20(%rbp), %rax
movslq -0x30(%rbp), %rcx
movl (%rax,%rcx,4), %eax
cmpl -0x24(%rbp), %eax
jle 0x1facf
movl -0x30(%rbp), %edx
movq 0x1daa7(%rip), %rax     # 0x3d548
movl -0x4c(%rbp), %ecx
movl %ecx, %esi
addl $0x1, %esi
movl %esi, -0x4c(%rbp)
movslq %ecx, %rcx
movl %edx, (%rax,%rcx,4)
movq -0x20(%rbp), %rax
movslq -0x30(%rbp), %rcx
movl (%rax,%rcx,4), %eax
cmpl -0x24(%rbp), %eax
jle 0x1facd
movl -0x30(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x30(%rbp)
jmp 0x1fab2
jmp 0x1facf
movl -0x30(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x30(%rbp)
jmp 0x1fa7f
cmpl $0x0, -0x4c(%rbp)
jne 0x1faeb
movl 0x10(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x1fd29
movl -0x4c(%rbp), %eax
movl %eax, -0x30(%rbp)
movl -0x30(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x30(%rbp)
cmpl $0x0, %eax
jl 0x1fb13
movq 0x1da62(%rip), %rax     # 0x3d568
movslq -0x30(%rbp), %rcx
movl $0x0, (%rax,%rcx,4)
jmp 0x1faf1
movl $0x1, -0x48(%rbp)
movl -0x48(%rbp), %eax
cmpl -0x4c(%rbp), %eax
jge 0x1fcbf
movq 0x1da2b(%rip), %rax     # 0x3d558
movslq -0x2c(%rbp), %rcx
shlq $0x2, %rcx
addq %rcx, %rax
movq %rax, -0x58(%rbp)
movq -0x58(%rbp), %rax
addq $-0x4, %rax
movq %rax, -0x58(%rbp)
cmpq 0x1da09(%rip), %rax     # 0x3d558
jb 0x1fb5d
movq -0x58(%rbp), %rax
movl $0x0, (%rax)
jmp 0x1fb3c
movq 0x1d9e4(%rip), %rax     # 0x3d548
movslq -0x48(%rbp), %rcx
movl (%rax,%rcx,4), %eax
subl $0x1, %eax
movl %eax, -0x30(%rbp)
movl -0x30(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x30(%rbp)
movq -0x18(%rbp), %rax
movslq -0x30(%rbp), %rcx
movl (%rax,%rcx,4), %eax
andl $0x1f, %eax
movslq %eax, %rcx
leaq 0xbd5e(%rip), %rax      # 0x2b8f0
movl (%rax,%rcx,4), %edx
movq 0x1d9bc(%rip), %rax     # 0x3d558
movq -0x18(%rbp), %rcx
movslq -0x30(%rbp), %rsi
movl (%rcx,%rsi,4), %ecx
sarl $0x5, %ecx
movslq %ecx, %rcx
orl (%rax,%rcx,4), %edx
movl %edx, (%rax,%rcx,4)
movq -0x20(%rbp), %rax
movslq -0x30(%rbp), %rcx
movl (%rax,%rcx,4), %eax
cmpl -0x24(%rbp), %eax
jg 0x1fb71
movl $0x0, -0x44(%rbp)
movl -0x44(%rbp), %eax
cmpl -0x48(%rbp), %eax
jge 0x1fcaf
movq -0x10(%rbp), %rax
movq -0x18(%rbp), %rcx
movq 0x1d963(%rip), %rdx     # 0x3d548
movslq -0x44(%rbp), %rsi
movslq (%rdx,%rsi,4), %rdx
movslq (%rcx,%rdx,4), %rcx
movslq -0x2c(%rbp), %rdx
imulq %rdx, %rcx
shlq $0x2, %rcx
addq %rcx, %rax
movq %rax, -0x38(%rbp)
movl $0x0, -0x40(%rbp)
movl $0x0, -0x3c(%rbp)
movl -0x2c(%rbp), %eax
movl %eax, -0x30(%rbp)
movl -0x30(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x30(%rbp)
cmpl $0x0, %eax
jl 0x1fc6b
movq 0x1d92b(%rip), %rax     # 0x3d558
movslq -0x30(%rbp), %rcx
movl (%rax,%rcx,4), %eax
movq -0x38(%rbp), %rcx
movslq -0x30(%rbp), %rdx
andl (%rcx,%rdx,4), %eax
orl -0x3c(%rbp), %eax
movl %eax, -0x3c(%rbp)
movq 0x1d90c(%rip), %rax     # 0x3d558
movslq -0x30(%rbp), %rcx
movl (%rax,%rcx,4), %eax
movq -0x38(%rbp), %rcx
movslq -0x30(%rbp), %rdx
movl (%rcx,%rdx,4), %ecx
xorl $-0x1, %ecx
andl %ecx, %eax
orl -0x40(%rbp), %eax
movl %eax, -0x40(%rbp)
jmp 0x1fc18
cmpl $0x0, -0x3c(%rbp)
je 0x1fc9f
cmpl $0x0, -0x40(%rbp)
je 0x1fc9f
movq 0x1d8ea(%rip), %rax     # 0x3d568
movslq -0x44(%rbp), %rcx
movl (%rax,%rcx,4), %edx
addl $0x1, %edx
movl %edx, (%rax,%rcx,4)
movq 0x1d8d6(%rip), %rax     # 0x3d568
movslq -0x48(%rbp), %rcx
movl (%rax,%rcx,4), %edx
addl $0x1, %edx
movl %edx, (%rax,%rcx,4)
jmp 0x1fca1
movl -0x44(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x44(%rbp)
jmp 0x1fbca
jmp 0x1fcb1
movl -0x48(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x48(%rbp)
jmp 0x1fb1a
movl $0x0, -0x44(%rbp)
movq 0x1d89b(%rip), %rax     # 0x3d568
movl (%rax), %eax
movl %eax, -0x48(%rbp)
movl $0x1, -0x30(%rbp)
movl -0x30(%rbp), %eax
cmpl -0x4c(%rbp), %eax
jge 0x1fd18
movq 0x1d880(%rip), %rax     # 0x3d568
movslq -0x30(%rbp), %rcx
movl (%rax,%rcx,4), %eax
cmpl -0x48(%rbp), %eax
jle 0x1fd0b
movl -0x30(%rbp), %eax
movl %eax, -0x44(%rbp)
movq 0x1d867(%rip), %rax     # 0x3d568
movslq -0x30(%rbp), %rcx
movl (%rax,%rcx,4), %eax
movl %eax, -0x48(%rbp)
jmp 0x1fd0d
movl -0x30(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x30(%rbp)
jmp 0x1fcd9
movq 0x1d829(%rip), %rax     # 0x3d548
movslq -0x44(%rbp), %rcx
movl (%rax,%rcx,4), %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x60, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
nopl (%rax)