// File: /workspace/github_c_makefile_star2_O1/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 0x18771
movq 0x10(%rdi), %rcx
movq 0x10(%rcx), %rcx
movslq 0x4(%rcx), %rdx
leaq 0xf594(%rip), %rcx      # 0x27bf0
xorl %ebx, %ebx
cmpl $0x6, (%rcx,%rdx,4)
jl 0x188e3
movq 0x10(%rax), %rdx
movq 0x10(%rdx), %rdx
movslq 0x4(%rdx), %rdx
cmpl $0x6, (%rcx,%rdx,4)
jl 0x188e3
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 0xd9ec(%rip), %eax      # 0x26098
leal 0x1(%rax), %ecx
movl %ecx, 0xd9e3(%rip)      # 0x26098
cmpl $0x7530, %eax           # imm = 0x7530
jl 0x186d9
movl $0x1, 0xd9d2(%rip)      # 0x26098
leaq 0x272563(%rip), %rdi    # 0x28ac30
movl $0x100, %edx            # imm = 0x100
xorl %esi, %esi
callq 0x1030
movq 0x10(%r15), %rax
movq 0x10(%rax), %rax
movq 0x10(%rax), %rax
movq 0x10(%rax), %rax
cmpq %r15, %rax
je 0x1870b
movl 0xd9a4(%rip), %ecx      # 0x26098
leaq 0x272535(%rip), %rdx    # 0x28ac30
movslq 0x4(%rax), %rsi
movl %ecx, (%rdx,%rsi,4)
movq 0x10(%rax), %rax
cmpq %r15, %rax
jne 0x186fb
movq 0x20(%r15), %rax
movq 0x18(%rax), %rcx
movq 0x18(%rcx), %rcx
movq 0x18(%rcx), %rcx
cmpq %rax, %rcx
je 0x1873d
movl 0xd972(%rip), %edx      # 0x26098
leaq 0x272503(%rip), %rsi    # 0x28ac30
movslq 0x4(%rcx), %rdi
movl %edx, (%rsi,%rdi,4)
movq 0x18(%rcx), %rcx
cmpq %rax, %rcx
jne 0x1872d
movq 0x10(%r14), %rax
movq 0x10(%rax), %rax
movq 0x10(%rax), %rcx
movl 0xd949(%rip), %edx      # 0x26098
leaq 0x2724da(%rip), %rax    # 0x28ac30
movq 0x10(%rcx), %rcx
cmpq %r14, %rcx
je 0x18892
movslq 0x4(%rcx), %rsi
cmpl %edx, (%rax,%rsi,4)
jne 0x18756
jmp 0x188e3
movq 0x18(%rdi), %rcx
movq 0x18(%rcx), %rcx
movslq 0x4(%rcx), %rdx
leaq 0xf46c(%rip), %rcx      # 0x27bf0
xorl %ebx, %ebx
cmpl $0x6, (%rcx,%rdx,4)
jl 0x188e3
movq 0x18(%rax), %rdx
movq 0x18(%rdx), %rdx
movslq 0x4(%rdx), %rdx
cmpl $0x6, (%rcx,%rdx,4)
jl 0x188e3
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 0xd8c4(%rip), %eax      # 0x26098
leal 0x1(%rax), %ecx
movl %ecx, 0xd8bb(%rip)      # 0x26098
cmpl $0x7530, %eax           # imm = 0x7530
jl 0x18801
movl $0x1, 0xd8aa(%rip)      # 0x26098
leaq 0x27243b(%rip), %rdi    # 0x28ac30
movl $0x100, %edx            # imm = 0x100
xorl %esi, %esi
callq 0x1030
movq 0x18(%r15), %rax
movq 0x18(%rax), %rax
movq 0x18(%rax), %rax
movq 0x18(%rax), %rax
cmpq %r15, %rax
je 0x18833
movl 0xd87c(%rip), %ecx      # 0x26098
leaq 0x27240d(%rip), %rdx    # 0x28ac30
movslq 0x4(%rax), %rsi
movl %ecx, (%rdx,%rsi,4)
movq 0x18(%rax), %rax
cmpq %r15, %rax
jne 0x18823
movq 0x20(%r15), %rax
movq 0x10(%rax), %rcx
movq 0x10(%rcx), %rcx
movq 0x10(%rcx), %rcx
cmpq %rax, %rcx
je 0x18865
movl 0xd84a(%rip), %edx      # 0x26098
leaq 0x2723db(%rip), %rsi    # 0x28ac30
movslq 0x4(%rcx), %rdi
movl %edx, (%rsi,%rdi,4)
movq 0x10(%rcx), %rcx
cmpq %rax, %rcx
jne 0x18855
movq 0x18(%r14), %rax
movq 0x18(%rax), %rax
movq 0x18(%rax), %rcx
movl 0xd821(%rip), %edx      # 0x26098
leaq 0x2723b2(%rip), %rax    # 0x28ac30
movq 0x18(%rcx), %rcx
cmpq %r14, %rcx
je 0x188b8
movslq 0x4(%rcx), %rsi
cmpl %edx, (%rax,%rsi,4)
jne 0x1887e
jmp 0x188e3
movq 0x20(%r14), %rcx
movq 0x18(%rcx), %rdx
movq 0x18(%rdx), %rdx
movl 0xd7f4(%rip), %esi      # 0x26098
movq 0x18(%rdx), %rdx
cmpq %rcx, %rdx
je 0x188de
movslq 0x4(%rdx), %rdi
cmpl %esi, (%rax,%rdi,4)
jne 0x188a4
jmp 0x188e3
movq 0x20(%r14), %rcx
movq 0x10(%rcx), %rdx
movq 0x10(%rdx), %rdx
movl 0xd7ce(%rip), %esi      # 0x26098
movq 0x10(%rdx), %rdx
cmpq %rcx, %rdx
je 0x188de
movslq 0x4(%rdx), %rdi
cmpl %esi, (%rax,%rdi,4)
jne 0x188ca
jmp 0x188e3
movl $0x1, %ebx
movl %ebx, %eax
popq %rbx
popq %r14
popq %r15
retq