// File: /workspace/github_c_makefile_star2_O3/mishun[P]plantri/plantri.c
// Function: is_valid_min5_b
static int
is_valid_min5_b(EDGE *ref, int mirror)

/* Check if the B-reduction (ref,mirror) is valid.  The important
   things are that two vertices have degree >= 6 and there are no
   non-facial 5-cycles that will become non-facial 4-cycles.
   It is assumed that the ends and sides of ref have degree 5.
*/

{
    EDGE *e1,*e2,*e,*refi;

    refi = ref->invers;

    if (!mirror)
    {
	if (degree[ref->next->next->end] < 6
				         || degree[refi->next->next->end] < 6)
	    return FALSE;
	e1 = ref->prev->prev->invers->prev->prev;
	e2 = refi->prev->prev->invers->prev->prev;

	RESETMARKS_V;

	for (e = e1->next->next->next->next; e != e1; e = e->next)
	    MARK_V(e->end);
	e1 = e1->invers;
	for (e = e1->prev->prev->prev; e != e1; e = e->prev)
	    MARK_V(e->end);

	for (e = e2->next->next->next->next; e != e2; e = e->next)
	    if (ISMARKED_V(e->end)) return FALSE;
	e2 = e2->invers;
        for (e = e2->prev->prev->prev; e != e2; e = e->prev)
            if (ISMARKED_V(e->end)) return FALSE;
    }
    else
    {
        if (degree[ref->prev->prev->end] < 6
                                         || degree[refi->prev->prev->end] < 6)
            return FALSE;
        e1 = ref->next->next->invers->next->next;
        e2 = refi->next->next->invers->next->next;

        RESETMARKS_V;  

	for (e = e1->prev->prev->prev->prev; e != e1; e = e->prev)
            MARK_V(e->end);
        e1 = e1->invers;
        for (e = e1->next->next->next; e != e1; e = e->next)
            MARK_V(e->end);

        for (e = e2->prev->prev->prev->prev; e != e2; e = e->prev)
            if (ISMARKED_V(e->end)) return FALSE;
        e2 = e2->invers;
        for (e = e2->next->next->next; e != e2; e = e->next)
            if (ISMARKED_V(e->end)) return FALSE;
    }

    return TRUE;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq 0x20(%rdi), %rax
testl %esi, %esi
je 0x18816
movq 0x10(%rdi), %rcx
movq 0x10(%rcx), %rcx
movslq 0x4(%rcx), %rdx
leaq 0xf4e3(%rip), %rcx      # 0x27bf0
xorl %ebx, %ebx
cmpl $0x6, (%rcx,%rdx,4)
jl 0x18970
movq 0x10(%rax), %rdx
movq 0x10(%rdx), %rdx
movslq 0x4(%rdx), %rdx
cmpl $0x6, (%rcx,%rdx,4)
jl 0x18970
movq 0x18(%rdi), %rcx
movq 0x18(%rcx), %rcx
movq 0x20(%rcx), %rcx
movq 0x18(%rcx), %rcx
movq 0x18(%rcx), %r15
movq 0x18(%rax), %rax
movq 0x18(%rax), %rax
movq 0x20(%rax), %rax
movq 0x18(%rax), %rax
movq 0x18(%rax), %r14
movl 0xd933(%rip), %ecx      # 0x26090
leal 0x1(%rcx), %eax
movl %eax, 0xd92a(%rip)      # 0x26090
cmpl $0x7530, %ecx           # imm = 0x7530
jl 0x18790
movl $0x1, 0xd918(%rip)      # 0x26090
leaq 0x2724b1(%rip), %rdi    # 0x28ac30
movl $0x100, %edx            # imm = 0x100
xorl %esi, %esi
callq 0x1030
movl $0x1, %eax
movq 0x10(%r15), %rcx
movq 0x10(%rcx), %rcx
movq 0x10(%rcx), %rcx
movq 0x10(%rcx), %rcx
cmpq %r15, %rcx
je 0x187bc
leaq 0x272484(%rip), %rdx    # 0x28ac30
movslq 0x4(%rcx), %rsi
movl %eax, (%rdx,%rsi,4)
movq 0x10(%rcx), %rcx
cmpq %r15, %rcx
jne 0x187ac
movq 0x20(%r15), %rcx
movq 0x18(%rcx), %rdx
movq 0x18(%rdx), %rdx
movq 0x18(%rdx), %rdx
cmpq %rcx, %rdx
je 0x187e8
leaq 0x272458(%rip), %rsi    # 0x28ac30
movslq 0x4(%rdx), %rdi
movl %eax, (%rsi,%rdi,4)
movq 0x18(%rdx), %rdx
cmpq %rcx, %rdx
jne 0x187d8
movq 0x10(%r14), %rcx
movq 0x10(%rcx), %rcx
movq 0x10(%rcx), %rdx
leaq 0x272435(%rip), %rcx    # 0x28ac30
movq 0x10(%rdx), %rdx
cmpq %r14, %rdx
je 0x1892b
movslq 0x4(%rdx), %rsi
cmpl %eax, (%rcx,%rsi,4)
jne 0x187fb
jmp 0x18970
movq 0x18(%rdi), %rcx
movq 0x18(%rcx), %rcx
movslq 0x4(%rcx), %rdx
leaq 0xf3c7(%rip), %rcx      # 0x27bf0
xorl %ebx, %ebx
cmpl $0x6, (%rcx,%rdx,4)
jl 0x18970
movq 0x18(%rax), %rdx
movq 0x18(%rdx), %rdx
movslq 0x4(%rdx), %rdx
cmpl $0x6, (%rcx,%rdx,4)
jl 0x18970
movq 0x10(%rdi), %rcx
movq 0x10(%rcx), %rcx
movq 0x20(%rcx), %rcx
movq 0x10(%rcx), %rcx
movq 0x10(%rcx), %r15
movq 0x10(%rax), %rax
movq 0x10(%rax), %rax
movq 0x20(%rax), %rax
movq 0x10(%rax), %rax
movq 0x10(%rax), %r14
movl 0xd817(%rip), %ecx      # 0x26090
leal 0x1(%rcx), %eax
movl %eax, 0xd80e(%rip)      # 0x26090
cmpl $0x7530, %ecx           # imm = 0x7530
jl 0x188ac
movl $0x1, 0xd7fc(%rip)      # 0x26090
leaq 0x272395(%rip), %rdi    # 0x28ac30
movl $0x100, %edx            # imm = 0x100
xorl %esi, %esi
callq 0x1030
movl $0x1, %eax
movq 0x18(%r15), %rcx
movq 0x18(%rcx), %rcx
movq 0x18(%rcx), %rcx
movq 0x18(%rcx), %rcx
cmpq %r15, %rcx
je 0x188d8
leaq 0x272368(%rip), %rdx    # 0x28ac30
movslq 0x4(%rcx), %rsi
movl %eax, (%rdx,%rsi,4)
movq 0x18(%rcx), %rcx
cmpq %r15, %rcx
jne 0x188c8
movq 0x20(%r15), %rcx
movq 0x10(%rcx), %rdx
movq 0x10(%rdx), %rdx
movq 0x10(%rdx), %rdx
cmpq %rcx, %rdx
je 0x18904
leaq 0x27233c(%rip), %rsi    # 0x28ac30
movslq 0x4(%rdx), %rdi
movl %eax, (%rsi,%rdi,4)
movq 0x10(%rdx), %rdx
cmpq %rcx, %rdx
jne 0x188f4
movq 0x18(%r14), %rcx
movq 0x18(%rcx), %rcx
movq 0x18(%rcx), %rdx
leaq 0x272319(%rip), %rcx    # 0x28ac30
movq 0x18(%rdx), %rdx
cmpq %r14, %rdx
je 0x1894b
movslq 0x4(%rdx), %rsi
cmpl %eax, (%rcx,%rsi,4)
jne 0x18917
jmp 0x18970
movq 0x20(%r14), %rdx
movq 0x18(%rdx), %rsi
movq 0x18(%rsi), %rsi
movq 0x18(%rsi), %rsi
cmpq %rdx, %rsi
je 0x1896b
movslq 0x4(%rsi), %rdi
cmpl %eax, (%rcx,%rdi,4)
jne 0x18937
jmp 0x18970
movq 0x20(%r14), %rdx
movq 0x10(%rdx), %rsi
movq 0x10(%rsi), %rsi
movq 0x10(%rsi), %rsi
cmpq %rdx, %rsi
je 0x1896b
movslq 0x4(%rsi), %rdi
cmpl %eax, (%rcx,%rdi,4)
jne 0x18957
jmp 0x18970
movl $0x1, %ebx
movl %ebx, %eax
popq %rbx
popq %r14
popq %r15
retq