// File: /workspace/github_c_makefile_star2_O0/mishun[P]plantri/plantri.c
// Function: min5_b_legal
static void
min5_b_legal(EDGE *ref, int mirror, EDGE *good_or[], int *ngood_or,
   int *ngood_ref, EDGE *good_mir[], int *ngood_mir, int *ngood_mir_ref)

/* The B-operation with reference edge *ref and side mirror has just been
   performed.
   Make a list in good_or[0..*ngood_or-1] of the reference edges of
   legal B-reductions (oriented editions) that might be canonical,
   with the first *ngood_ref of those being ref.
   Make a list in good_mir[0..*ngood_mir-1] of the
   reference edges of legal four-reductions (mirror-image editions)
   that might be canonical, with the first *ngood_mir_ref of those being
   ref->next.
   *ngood_ref and *ngood_mir_ref might each be 0-2.  If they are
   both 0, nothing else need be correct.
   All the edges in good_or[] and good_mir[] must start with the same
   vertex degree and end with the same vertex degree (actually, colour
   as passed to canon_edge_oriented).
   This procedure does NOT determine that there are no A-reductions.
*/
{
    EDGE *e,*elast;
    int nor,nmir,i;

    ref = ref->min;
    nor = nmir = 0;

    if (!mirror)
    {
	good_or[nor++] = ref;
	good_or[nor++] = ref->invers;
    }
    else
    {
	good_mir[nmir++] = ref;
	good_mir[nmir++] = ref->invers;
    }

    *ngood_ref = nor;
    *ngood_mir_ref = nmir;

    RESETMARKS;
    MARKLO(ref);

    for (i = 0; i < nv; ++i)
    if (degree[i] == 5)
    {
	e = elast = firstedge[i];
	do
	{
	    if (e == e->min && !ISMARKEDLO(e) && degree[e->prev->end] == 5
			&& degree[e->end] == 5 && degree[e->next->end] == 5)
	    {
		if (is_valid_min5_b(e,FALSE))
		{   
        	    good_or[nor++] = e;
        	    good_or[nor++] = e->invers;
    		}
		if (is_valid_min5_b(e,TRUE))
		{   
        	    good_mir[nmir++] = e;
        	    good_mir[nmir++] = e->invers;
		}
	    }
	    e = e->next;
	} while (e != elast);
    }

    if (nor > *ngood_ref || nmir > *ngood_mir_ref)
        prune_oriented_lists(good_or,&nor,ngood_ref,
                             good_mir,&nmir,ngood_mir_ref);

    *ngood_or = nor;
    *ngood_mir = nmir;    
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq 0x18(%rbp), %rax
movq 0x10(%rbp), %rax
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq %r8, -0x28(%rbp)
movq %r9, -0x30(%rbp)
movq -0x8(%rbp), %rax
movq 0x28(%rax), %rax
movq %rax, -0x8(%rbp)
movl $0x0, -0x48(%rbp)
movl $0x0, -0x44(%rbp)
cmpl $0x0, -0xc(%rbp)
jne 0x1ef21
movq -0x8(%rbp), %rdx
movq -0x18(%rbp), %rax
movl -0x44(%rbp), %ecx
movl %ecx, %esi
addl $0x1, %esi
movl %esi, -0x44(%rbp)
movslq %ecx, %rcx
movq %rdx, (%rax,%rcx,8)
movq -0x8(%rbp), %rax
movq 0x20(%rax), %rdx
movq -0x18(%rbp), %rax
movl -0x44(%rbp), %ecx
movl %ecx, %esi
addl $0x1, %esi
movl %esi, -0x44(%rbp)
movslq %ecx, %rcx
movq %rdx, (%rax,%rcx,8)
jmp 0x1ef59
movq -0x8(%rbp), %rdx
movq -0x30(%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), %rdx
movq -0x30(%rbp), %rax
movl -0x48(%rbp), %ecx
movl %ecx, %esi
addl $0x1, %esi
movl %esi, -0x48(%rbp)
movslq %ecx, %rcx
movq %rdx, (%rax,%rcx,8)
movl -0x44(%rbp), %ecx
movq -0x28(%rbp), %rax
movl %ecx, (%rax)
movl -0x48(%rbp), %ecx
movq 0x18(%rbp), %rax
movl %ecx, (%rax)
movl 0x1d113(%rip), %eax     # 0x3c084
addl $0x2, %eax
movl %eax, 0x1d10a(%rip)     # 0x3c084
cmpl $0x7530, %eax           # imm = 0x7530
jle 0x1efc1
movl $0x2, 0x1d0f9(%rip)     # 0x3c084
movl $0x0, -0x50(%rbp)
cmpl $0x1198, -0x50(%rbp)    # imm = 0x1198
jge 0x1efbf
movslq -0x50(%rbp), %rcx
leaq 0x23b68a(%rip), %rax    # 0x25a630
shlq $0x6, %rcx
addq %rcx, %rax
movl $0x0, 0x30(%rax)
movl -0x50(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x50(%rbp)
jmp 0x1ef92
jmp 0x1efc1
movl 0x1d0bd(%rip), %ecx     # 0x3c084
movq -0x8(%rbp), %rax
movl %ecx, 0x30(%rax)
movl $0x0, -0x4c(%rbp)
movl -0x4c(%rbp), %eax
cmpl 0x23b642(%rip), %eax    # 0x25a620
jge 0x1f149
movslq -0x4c(%rbp), %rcx
leaq 0x1ec11(%rip), %rax     # 0x3dc00
cmpl $0x5, (%rax,%rcx,4)
jne 0x1f139
movslq -0x4c(%rbp), %rcx
leaq 0x1e9fc(%rip), %rax     # 0x3da00
movq (%rax,%rcx,8), %rax
movq %rax, -0x40(%rbp)
movq %rax, -0x38(%rbp)
movq -0x38(%rbp), %rax
movq -0x38(%rbp), %rcx
cmpq 0x28(%rcx), %rax
jne 0x1f11d
movq -0x38(%rbp), %rax
movl 0x30(%rax), %eax
cmpl 0x1d055(%rip), %eax     # 0x3c084
je 0x1f11d
movq -0x38(%rbp), %rax
movq 0x10(%rax), %rax
movslq 0x4(%rax), %rcx
leaq 0x1ebb8(%rip), %rax     # 0x3dc00
cmpl $0x5, (%rax,%rcx,4)
jne 0x1f11d
movq -0x38(%rbp), %rax
movslq 0x4(%rax), %rcx
leaq 0x1eb9f(%rip), %rax     # 0x3dc00
cmpl $0x5, (%rax,%rcx,4)
jne 0x1f11d
movq -0x38(%rbp), %rax
movq 0x18(%rax), %rax
movslq 0x4(%rax), %rcx
leaq 0x1eb82(%rip), %rax     # 0x3dc00
cmpl $0x5, (%rax,%rcx,4)
jne 0x1f11d
movq -0x38(%rbp), %rdi
xorl %esi, %esi
callq 0x27b10
cmpl $0x0, %eax
je 0x1f0d0
movq -0x38(%rbp), %rdx
movq -0x18(%rbp), %rax
movl -0x44(%rbp), %ecx
movl %ecx, %esi
addl $0x1, %esi
movl %esi, -0x44(%rbp)
movslq %ecx, %rcx
movq %rdx, (%rax,%rcx,8)
movq -0x38(%rbp), %rax
movq 0x20(%rax), %rdx
movq -0x18(%rbp), %rax
movl -0x44(%rbp), %ecx
movl %ecx, %esi
addl $0x1, %esi
movl %esi, -0x44(%rbp)
movslq %ecx, %rcx
movq %rdx, (%rax,%rcx,8)
movq -0x38(%rbp), %rdi
movl $0x1, %esi
callq 0x27b10
cmpl $0x0, %eax
je 0x1f11b
movq -0x38(%rbp), %rdx
movq -0x30(%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 -0x38(%rbp), %rax
movq 0x20(%rax), %rdx
movq -0x30(%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 0x1f11d
movq -0x38(%rbp), %rax
movq 0x18(%rax), %rax
movq %rax, -0x38(%rbp)
movq -0x38(%rbp), %rax
cmpq -0x40(%rbp), %rax
jne 0x1f010
jmp 0x1f139
jmp 0x1f13b
movl -0x4c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x4c(%rbp)
jmp 0x1efd5
movl -0x44(%rbp), %eax
movq -0x28(%rbp), %rcx
cmpl (%rcx), %eax
jg 0x1f15f
movl -0x48(%rbp), %eax
movq 0x18(%rbp), %rcx
cmpl (%rcx), %eax
jle 0x1f17c
movq -0x18(%rbp), %rdi
movq -0x28(%rbp), %rdx
movq -0x30(%rbp), %rcx
movq 0x18(%rbp), %r9
leaq -0x44(%rbp), %rsi
leaq -0x48(%rbp), %r8
callq 0x12be0
movl -0x44(%rbp), %ecx
movq -0x20(%rbp), %rax
movl %ecx, (%rax)
movl -0x48(%rbp), %ecx
movq 0x10(%rbp), %rax
movl %ecx, (%rax)
addq $0x50, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)