// File: /workspace/github_c_makefile_star2_O2/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:
movq 0x20(%rdi), %rcx
testl %esi, %esi
je 0x170bb
movq 0x10(%rdi), %rax
movq 0x10(%rax), %rax
movslq 0x4(%rax), %rsi
leaq 0xebb7(%rip), %rdx      # 0x25be0
xorl %eax, %eax
cmpl $0x6, (%rdx,%rsi,4)
jl 0x17272
movq 0x10(%rcx), %rsi
movq 0x10(%rsi), %rsi
movslq 0x4(%rsi), %rsi
cmpl $0x6, (%rdx,%rsi,4)
jl 0x17272
movq 0x18(%rdi), %rdx
movq 0x18(%rdx), %rdx
movq 0x20(%rdx), %rdx
movq 0x18(%rdx), %rdx
movq 0x18(%rdx), %r8
movq 0x18(%rcx), %rcx
movq 0x18(%rcx), %rcx
movq 0x20(%rcx), %rcx
movq 0x18(%rcx), %rcx
movq 0x18(%rcx), %rdx
movl 0xd007(%rip), %esi      # 0x24080
leal 0x1(%rsi), %ecx
movl %ecx, 0xcffe(%rip)      # 0x24080
cmpl $0x7530, %esi           # imm = 0x7530
jl 0x1715d
movl $0x1, 0xcfe8(%rip)      # 0x24080
xorl %esi, %esi
pushq $0x1
popq %rcx
leaq 0x271b7c(%rip), %rdi    # 0x288c20
cmpq $0x100, %rsi            # imm = 0x100
je 0x1715d
andl $0x0, (%rsi,%rdi)
addq $0x4, %rsi
jmp 0x170a4
movq 0x18(%rdi), %rax
movq 0x18(%rax), %rax
movslq 0x4(%rax), %rsi
leaq 0xeb12(%rip), %rdx      # 0x25be0
xorl %eax, %eax
cmpl $0x6, (%rdx,%rsi,4)
jl 0x17272
movq 0x18(%rcx), %rsi
movq 0x18(%rsi), %rsi
movslq 0x4(%rsi), %rsi
cmpl $0x6, (%rdx,%rsi,4)
jl 0x17272
movq 0x10(%rdi), %rdx
movq 0x10(%rdx), %rdx
movq 0x20(%rdx), %rdx
movq 0x10(%rdx), %rdx
movq 0x10(%rdx), %rdi
movq 0x10(%rcx), %rcx
movq 0x10(%rcx), %rcx
movq 0x20(%rcx), %rcx
movq 0x10(%rcx), %rcx
movq 0x10(%rcx), %rdx
movl 0xcf62(%rip), %esi      # 0x24080
leal 0x1(%rsi), %ecx
movl %ecx, 0xcf59(%rip)      # 0x24080
cmpl $0x7530, %esi           # imm = 0x7530
jl 0x171c9
movl $0x1, 0xcf43(%rip)      # 0x24080
xorl %esi, %esi
pushq $0x1
popq %rcx
leaq 0x271ad7(%rip), %r8     # 0x288c20
cmpq $0x100, %rsi            # imm = 0x100
je 0x171c9
andl $0x0, (%rsi,%r8)
addq $0x4, %rsi
jmp 0x17149
pushq $0x1
popq %rsi
movq 0x10(%r8), %rdi
movq 0x10(%rdi), %rdi
movq 0x10(%rdi), %r9
leaq 0x271aad(%rip), %rdi    # 0x288c20
movq 0x10(%r9), %r9
cmpq %r8, %r9
je 0x17186
movslq 0x4(%r9), %r10
movl %ecx, (%rdi,%r10,4)
jmp 0x17173
movq 0x20(%r8), %r8
movq 0x18(%r8), %r9
movq 0x18(%r9), %r9
movq 0x18(%r9), %r9
cmpq %r8, %r9
je 0x171a5
movslq 0x4(%r9), %r10
movl %ecx, (%rdi,%r10,4)
jmp 0x17192
movq 0x10(%rdx), %r8
movq 0x10(%r8), %r8
movq 0x10(%r8), %r8
movq 0x10(%r8), %r8
cmpq %rdx, %r8
je 0x1722f
movslq 0x4(%r8), %r9
cmpl %ecx, (%rdi,%r9,4)
jne 0x171b1
jmp 0x17272
movq 0x18(%rdi), %rsi
movq 0x18(%rsi), %rsi
movq 0x18(%rsi), %r8
leaq 0x271a44(%rip), %rsi    # 0x288c20
movq 0x18(%r8), %r8
cmpq %rdi, %r8
je 0x171ef
movslq 0x4(%r8), %r9
movl %ecx, (%rsi,%r9,4)
jmp 0x171dc
movq 0x20(%rdi), %rdi
movq 0x10(%rdi), %r8
movq 0x10(%r8), %r8
movq 0x10(%r8), %r8
cmpq %rdi, %r8
je 0x1720e
movslq 0x4(%r8), %r9
movl %ecx, (%rsi,%r9,4)
jmp 0x171fb
movq 0x18(%rdx), %rdi
movq 0x18(%rdi), %rdi
movq 0x18(%rdi), %rdi
movq 0x18(%rdi), %rdi
cmpq %rdx, %rdi
je 0x17250
movslq 0x4(%rdi), %r8
cmpl %ecx, (%rsi,%r8,4)
jne 0x1721a
jmp 0x17272
movq 0x20(%rdx), %rdx
movq 0x18(%rdx), %r8
movq 0x18(%r8), %r8
movq 0x18(%r8), %r8
cmpq %rdx, %r8
je 0x17273
movslq 0x4(%r8), %r9
cmpl %ecx, (%rdi,%r9,4)
jne 0x1723b
jmp 0x17272
movq 0x20(%rdx), %rdx
movq 0x10(%rdx), %rdi
movq 0x10(%rdi), %r8
pushq $0x1
popq %rdi
movq 0x10(%r8), %r8
cmpq %rdx, %r8
je 0x17276
movslq 0x4(%r8), %r9
cmpl %ecx, (%rsi,%r9,4)
jne 0x1725f
retq
movl %esi, %eax
retq
movl %edi, %eax
retq