// File: /workspace/github_c_makefile_star2_O0/mishun[P]plantri/plantri.c
// Function: min5c4_5_legal
static void
min5c4_5_legal(EDGE *ref, EDGE **on4, int non4, EDGE **good, int *ngood)

/* e is the reference edge of a min5-5-expansion that has just been done.
   on4[0..non4-1] are the min forms of all edges on nf-4-cycles.
   There are no nf-3-cycles.
   Create in good[0..*ngood-1] a list of directed edges in the form
   required by canon_edge().
*/

{
    long bestdeg;
    EDGE *e,*elast;
    int i,ng;

    ng = 0;
    if (legal_5_min5_reduction(ref,on4,non4)) good[ng++] = ref;
    if (legal_5_min5_reduction(ref->invers,on4,non4)) good[ng++] = ref->invers;

    bestdeg = MAX(degree[ref->start],degree[ref->end]);

    for (i = 0; i < nv; ++i)
    if (degree[i] == 5)
    {
	e = elast = firstedge[i];
	do
	{
	    if (degree[e->end] >= bestdeg && e != ref && e != ref->invers
                                         && legal_5_min5_reduction(e,on4,non4))
	    {
		if (degree[e->end] > bestdeg)
		{
		    *ngood = 0;
		    return;
		}
		else
		    good[ng++] = e;
	    }
	    e = e->next;
	} while (e != elast);
    }

    *ngood = ng;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
movq %rcx, -0x20(%rbp)
movq %r8, -0x28(%rbp)
movl $0x0, -0x48(%rbp)
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movl -0x14(%rbp), %edx
callq 0x26d60
cmpl $0x0, %eax
je 0x26021
movq -0x8(%rbp), %rdx
movq -0x20(%rbp), %rax
movl -0x48(%rbp), %ecx
movl %ecx, %esi
addl $0x1, %esi
movl %esi, -0x48(%rbp)
movslq %ecx, %rcx
movq %rdx, (%rax,%rcx,8)
movq -0x8(%rbp), %rax
movq 0x20(%rax), %rdi
movq -0x10(%rbp), %rsi
movl -0x14(%rbp), %edx
callq 0x26d60
cmpl $0x0, %eax
je 0x26058
movq -0x8(%rbp), %rax
movq 0x20(%rax), %rdx
movq -0x20(%rbp), %rax
movl -0x48(%rbp), %ecx
movl %ecx, %esi
addl $0x1, %esi
movl %esi, -0x48(%rbp)
movslq %ecx, %rcx
movq %rdx, (%rax,%rcx,8)
movq -0x8(%rbp), %rax
movslq (%rax), %rcx
leaq 0x17b9a(%rip), %rax     # 0x3dc00
movl (%rax,%rcx,4), %eax
movq -0x8(%rbp), %rcx
movslq 0x4(%rcx), %rdx
leaq 0x17b88(%rip), %rcx     # 0x3dc00
cmpl (%rcx,%rdx,4), %eax
jge 0x26094
movq -0x8(%rbp), %rax
movslq 0x4(%rax), %rcx
leaq 0x17b74(%rip), %rax     # 0x3dc00
movl (%rax,%rcx,4), %eax
movl %eax, -0x4c(%rbp)
jmp 0x260a8
movq -0x8(%rbp), %rax
movslq (%rax), %rcx
leaq 0x17b5e(%rip), %rax     # 0x3dc00
movl (%rax,%rcx,4), %eax
movl %eax, -0x4c(%rbp)
movl -0x4c(%rbp), %eax
cltq
movq %rax, -0x30(%rbp)
movl $0x0, -0x44(%rbp)
movl -0x44(%rbp), %eax
cmpl 0x23455f(%rip), %eax    # 0x25a620
jge 0x261a6
movslq -0x44(%rbp), %rcx
leaq 0x17b2e(%rip), %rax     # 0x3dc00
cmpl $0x5, (%rax,%rcx,4)
jne 0x26196
movslq -0x44(%rbp), %rcx
leaq 0x17919(%rip), %rax     # 0x3da00
movq (%rax,%rcx,8), %rax
movq %rax, -0x40(%rbp)
movq %rax, -0x38(%rbp)
movq -0x38(%rbp), %rax
movslq 0x4(%rax), %rcx
leaq 0x17afe(%rip), %rax     # 0x3dc00
movslq (%rax,%rcx,4), %rax
cmpq -0x30(%rbp), %rax
jl 0x2617a
movq -0x38(%rbp), %rax
cmpq -0x8(%rbp), %rax
je 0x2617a
movq -0x38(%rbp), %rax
movq -0x8(%rbp), %rcx
cmpq 0x20(%rcx), %rax
je 0x2617a
movq -0x38(%rbp), %rdi
movq -0x10(%rbp), %rsi
movl -0x14(%rbp), %edx
callq 0x26d60
cmpl $0x0, %eax
je 0x2617a
movq -0x38(%rbp), %rax
movslq 0x4(%rax), %rcx
leaq 0x17ab8(%rip), %rax     # 0x3dc00
movslq (%rax,%rcx,4), %rax
cmpq -0x30(%rbp), %rax
jle 0x2615e
movq -0x28(%rbp), %rax
movl $0x0, (%rax)
jmp 0x261af
movq -0x38(%rbp), %rdx
movq -0x20(%rbp), %rax
movl -0x48(%rbp), %ecx
movl %ecx, %esi
addl $0x1, %esi
movl %esi, -0x48(%rbp)
movslq %ecx, %rcx
movq %rdx, (%rax,%rcx,8)
jmp 0x2617a
movq -0x38(%rbp), %rax
movq 0x18(%rax), %rax
movq %rax, -0x38(%rbp)
movq -0x38(%rbp), %rax
cmpq -0x40(%rbp), %rax
jne 0x260f3
jmp 0x26196
jmp 0x26198
movl -0x44(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x44(%rbp)
jmp 0x260b8
movl -0x48(%rbp), %ecx
movq -0x28(%rbp), %rax
movl %ecx, (%rax)
addq $0x50, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)