// File: /workspace/github_c_makefile_star2_O0/mishun[P]plantri/plantri.c
// Function: find_feasible_flips
static void
find_feasible_flips(EDGE *flip[], EDGE *mate[], int count, int feasible[],
                                                        int nbtot)

/* For i=0..count-1, set feasible[i]=1 if flip[i] is the first in its
   edge orbit in flip[0..count-1], and feasible[i]=0 otherwise.
   Also set feasible[i]=0 if flip[i] will definitely have a worse
   colour than mate[i] after flipping. */

{
    int i;
    EDGE **nb0,**nb,**nblim;
    int flipside1,flipside2,flipcol;
    int mateside1,mateside2,matecol;

    if (nbtot == 1) 
        for (i = 0; i < count; ++i) feasible[i] = 1;
    else
    {
        nb0 = (EDGE**)numbering[0];
        nblim = (EDGE**)numbering[nbtot];
        for (i = 0; i < ne; ++i) nb0[i]->index = i;

        RESETMARKS;
    
        for (i = 0; i < count; ++i)
        {
            nb = nb0 + flip[i]->index;
            if (!ISMARKEDLO(*nb))
            {
                feasible[i] = 1;
                for ( ; nb < nblim; nb += MAXE) MARKLO((*nb)->min);
            }
            else
                feasible[i] = 0;
        }
    }

    for (i = 0; i < count; ++i)
        if (feasible[i])
        {
            mateside1 = mate[i]->next->end;
            mateside2 = mate[i]->prev->end;
            flipside1 = flip[i]->start;
            flipside2 = flip[i]->end;
 
            flipcol = degree[flipside1] + degree[flipside2] - 2;
            matecol = degree[mateside1] + degree[mateside2];
     
            if (matecol < flipcol)
                feasible[i] = 0;
            else
            { 
                if (mateside1 == flipside1 || mateside1 == flipside2)
                    --matecol;
                if (mateside2 == flipside1 || mateside2 == flipside2)
                    --matecol;
     
                if (matecol < flipcol) feasible[i] = 0;
            }
        }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
movq %rcx, -0x20(%rbp)
movl %r8d, -0x24(%rbp)
cmpl $0x1, -0x24(%rbp)
jne 0x2e7db
movl $0x0, -0x28(%rbp)
movl -0x28(%rbp), %eax
cmpl -0x14(%rbp), %eax
jge 0x2e7d6
movq -0x20(%rbp), %rax
movslq -0x28(%rbp), %rcx
movl $0x1, (%rax,%rcx,4)
movl -0x28(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x28(%rbp)
jmp 0x2e7b4
jmp 0x2e928
leaq 0xf51e(%rip), %rax      # 0x3dd00
movq %rax, -0x30(%rbp)
movslq -0x24(%rbp), %rcx
leaq 0xf50f(%rip), %rax      # 0x3dd00
imulq $0xba0, %rcx, %rcx      # imm = 0xBA0
addq %rcx, %rax
movq %rax, -0x40(%rbp)
movl $0x0, -0x28(%rbp)
movl -0x28(%rbp), %eax
cmpl 0x22be15(%rip), %eax    # 0x25a624
jge 0x2e82e
movl -0x28(%rbp), %ecx
movq -0x30(%rbp), %rax
movslq -0x28(%rbp), %rdx
movq (%rax,%rdx,8), %rax
movl %ecx, 0x34(%rax)
movl -0x28(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x28(%rbp)
jmp 0x2e806
movl 0xd850(%rip), %eax      # 0x3c084
addl $0x2, %eax
movl %eax, 0xd847(%rip)      # 0x3c084
cmpl $0x7530, %eax           # imm = 0x7530
jle 0x2e884
movl $0x2, 0xd836(%rip)      # 0x3c084
movl $0x0, -0x5c(%rbp)
cmpl $0x1198, -0x5c(%rbp)    # imm = 0x1198
jge 0x2e882
movslq -0x5c(%rbp), %rcx
leaq 0x22bdc7(%rip), %rax    # 0x25a630
shlq $0x6, %rcx
addq %rcx, %rax
movl $0x0, 0x30(%rax)
movl -0x5c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x5c(%rbp)
jmp 0x2e855
jmp 0x2e884
movl $0x0, -0x28(%rbp)
movl -0x28(%rbp), %eax
cmpl -0x14(%rbp), %eax
jge 0x2e926
movq -0x30(%rbp), %rax
movq -0x8(%rbp), %rcx
movslq -0x28(%rbp), %rdx
movq (%rcx,%rdx,8), %rcx
movslq 0x34(%rcx), %rcx
shlq $0x3, %rcx
addq %rcx, %rax
movq %rax, -0x38(%rbp)
movq -0x38(%rbp), %rax
movq (%rax), %rax
movl 0x30(%rax), %eax
cmpl 0xd7be(%rip), %eax      # 0x3c084
je 0x2e907
movq -0x20(%rbp), %rax
movslq -0x28(%rbp), %rcx
movl $0x1, (%rax,%rcx,4)
movq -0x38(%rbp), %rax
cmpq -0x40(%rbp), %rax
jae 0x2e905
movl 0xd79d(%rip), %ecx      # 0x3c084
movq -0x38(%rbp), %rax
movq (%rax), %rax
movq 0x28(%rax), %rax
movl %ecx, 0x30(%rax)
movq -0x38(%rbp), %rax
addq $0xba0, %rax            # imm = 0xBA0
movq %rax, -0x38(%rbp)
jmp 0x2e8d7
jmp 0x2e916
movq -0x20(%rbp), %rax
movslq -0x28(%rbp), %rcx
movl $0x0, (%rax,%rcx,4)
jmp 0x2e918
movl -0x28(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x28(%rbp)
jmp 0x2e88b
jmp 0x2e928
movl $0x0, -0x28(%rbp)
movl -0x28(%rbp), %eax
cmpl -0x14(%rbp), %eax
jge 0x2ea53
movq -0x20(%rbp), %rax
movslq -0x28(%rbp), %rcx
cmpl $0x0, (%rax,%rcx,4)
je 0x2ea43
movq -0x10(%rbp), %rax
movslq -0x28(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq 0x18(%rax), %rax
movl 0x4(%rax), %eax
movl %eax, -0x50(%rbp)
movq -0x10(%rbp), %rax
movslq -0x28(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq 0x10(%rax), %rax
movl 0x4(%rax), %eax
movl %eax, -0x54(%rbp)
movq -0x8(%rbp), %rax
movslq -0x28(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movl (%rax), %eax
movl %eax, -0x44(%rbp)
movq -0x8(%rbp), %rax
movslq -0x28(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movl 0x4(%rax), %eax
movl %eax, -0x48(%rbp)
movslq -0x44(%rbp), %rcx
leaq 0xf259(%rip), %rax      # 0x3dc00
movl (%rax,%rcx,4), %eax
movslq -0x48(%rbp), %rdx
leaq 0xf24b(%rip), %rcx      # 0x3dc00
addl (%rcx,%rdx,4), %eax
subl $0x2, %eax
movl %eax, -0x4c(%rbp)
movslq -0x50(%rbp), %rcx
leaq 0xf237(%rip), %rax      # 0x3dc00
movl (%rax,%rcx,4), %eax
movslq -0x54(%rbp), %rdx
leaq 0xf229(%rip), %rcx      # 0x3dc00
addl (%rcx,%rdx,4), %eax
movl %eax, -0x58(%rbp)
movl -0x58(%rbp), %eax
cmpl -0x4c(%rbp), %eax
jge 0x2e9f6
movq -0x20(%rbp), %rax
movslq -0x28(%rbp), %rcx
movl $0x0, (%rax,%rcx,4)
jmp 0x2ea41
movl -0x50(%rbp), %eax
cmpl -0x44(%rbp), %eax
je 0x2ea06
movl -0x50(%rbp), %eax
cmpl -0x48(%rbp), %eax
jne 0x2ea0f
movl -0x58(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x58(%rbp)
movl -0x54(%rbp), %eax
cmpl -0x44(%rbp), %eax
je 0x2ea1f
movl -0x54(%rbp), %eax
cmpl -0x48(%rbp), %eax
jne 0x2ea28
movl -0x58(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x58(%rbp)
movl -0x58(%rbp), %eax
cmpl -0x4c(%rbp), %eax
jge 0x2ea3f
movq -0x20(%rbp), %rax
movslq -0x28(%rbp), %rcx
movl $0x0, (%rax,%rcx,4)
jmp 0x2ea41
jmp 0x2ea43
jmp 0x2ea45
movl -0x28(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x28(%rbp)
jmp 0x2e92f
popq %rbp
retq
nopw %cs:(%rax,%rax)