// File: /workspace/github_c_makefile_star2_O2/mishun[P]plantri/plantri.c
// Function: scanbipartite
static void
scanbipartite(int nbtot, int nbop, EDGE *wheelrim, int dosplit,
              EDGE *Pedges[], int nPedges)

/* The main node of the recursion for bipartite triangulations
   As this procedure is entered, nv,ne,degree etc are set for some graph,
   and nbtot/nbop are the values returned by canon() for that graph.
   If wheelrim != NULL, the input is a double wheel and *wheelrim is
   one of the edges on the rim.
   If dosplit==TRUE, this is the place to do splitting (if any).
   Splitting is a bit more complicated because the P operation adds
   two vertices.
   Pedges[0..nPedges-1] are edges of the graph that were reference
   edges for P-operations in ancestors of this graph.  They may not
   be reference edges for P-reductions now, but at least they are edges.
   However, if nPedges>0, we can say that certainly Pedges[nPedges-1]
   is a P-operation that was just done.
*/
{
    EDGE *firstedge_save[MAXN];
    EDGE *extP[MAXE],*extQ[MAXE];
    EDGE *good_or[MAXE],*good_mir[MAXE];
    int ngood_or,ngood_mir,ngood_ref,ngood_mir_ref;
    int nextP,nextQ,i;
    int xnbtot,xnbop;
    EDGE *hint,*newPedges[MAXN/2];

    if (nv == maxnv)
    {
	got_one(nbtot,nbop,3);
	return;
    }

    if (dosplit)
    {
#ifdef SPLITTEST
        ADDBIG(splitcases,1);
        return;
#endif
        if (splitcount-- != 0) return;
        splitcount = mod - 1;

        for (i = 0; i < nv; ++i) firstedge_save[i] = firstedge[i];
    }

#ifdef PRE_FILTER_BIP
    if (!(PRE_FILTER_BIP)) return;
#endif

#ifndef FIND_EXTENSIONS_BIP
#define FIND_EXTENSIONS_BIP find_extensions_bip
#endif

    FIND_EXTENSIONS_BIP(nbtot,nbop,extP,&nextP,extQ,&nextQ,Pedges,nPedges);

    if (wheelrim && nv <= maxnv-2)
    {
        extend_bip_P(wheelrim);
#ifdef FAST_FILTER_BIP
        if (FAST_FILTER_BIP)
#endif  
        {
            (void)canon(degree,numbering,&xnbtot,&xnbop);
            scanbipartite(xnbtot,xnbop,wheelrim,
                          nv==splitlevel||nv==splitlevel+1,Pedges,0);
	}
        reduce_bip_P(wheelrim);
    }

    for (i = 0; i < nextP; ++i)
    {
        extend_bip_P(extP[i]);
#ifdef FAST_FILTER_BIP
        if (FAST_FILTER_BIP)
#endif 
        {
	    bip_P_legal(extP[i],good_or,&ngood_or,&ngood_ref,
		        good_mir,&ngood_mir,&ngood_mir_ref,
		        nPedges?Pedges[nPedges-1]:NULL);
            if (ngood_ref+ngood_mir_ref > 0)
	    {
	        if (nv == maxnv && !needgroup && ngood_or == ngood_ref
                                                && ngood_mir == ngood_mir_ref)
		    got_one(1,1,3);
	        else if (ngood_or+ngood_mir==1)
	        {
    		    Pedges[nPedges] = extP[i];
    		    scanbipartite(1,1,NULL,
                          nv==splitlevel||nv==splitlevel+1,Pedges,nPedges+1);
	        }
	        else if (canon_edge_oriented(good_or,ngood_or,ngood_ref,
                                           good_mir,ngood_mir,ngood_mir_ref,
                                           degree,numbering,&xnbtot,&xnbop))
	        {
		    Pedges[nPedges] = extP[i];
	            scanbipartite(xnbtot,xnbop,NULL,
                         nv==splitlevel||nv==splitlevel+1,Pedges,nPedges+1);
	        }
	    }
	}
	reduce_bip_P(extP[i]);
    }

    hint = NULL;
    for (i = 0; i < nextQ; ++i)
    {
        extend_bip_Q(extQ[i]);
#ifdef FAST_FILTER_BIP
        if (FAST_FILTER_BIP)
#endif 
        {
            if (!hint || !is_bip_P(hint)) hint = has_bip_P();

            if (!hint)
	    {
	        bip_Q_legal(extQ[i],good_or,&ngood_or,&ngood_ref,
                            good_mir,&ngood_mir,&ngood_mir_ref);
                if (ngood_ref+ngood_mir_ref > 0
                    && canon_edge_oriented(good_or,ngood_or,ngood_ref,
                                           good_mir,ngood_mir,ngood_mir_ref,
                                           degree,numbering,&xnbtot,&xnbop))
	           scanbipartite(xnbtot,xnbop,NULL,nv==splitlevel,newPedges,0);
	    }
	}
	reduce_bip_Q(extQ[i]);
    }

    if (dosplit)
        for (i = 0; i < nv; ++i) firstedge[i] = firstedge_save[i];
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x31b8, %rsp           # imm = 0x31B8
movl 0x2277e5(%rip), %ebp    # 0x242600
movl 0x943e(%rip), %r12d     # 0x24260
cmpl %r12d, %ebp
jne 0x1ae40
pushq $0x3
popq %rdx
addq $0x31b8, %rsp           # imm = 0x31B8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x658a
movl %r9d, %r14d
movq %r8, %r15
movq %rdx, %rbx
testl %ecx, %ecx
je 0x1ae98
subl $0x1, 0x26ddbc(%rip)    # 0x288c10
jae 0x1b1de
movl 0x93fc(%rip), %eax      # 0x2425c
decl %eax
movl %eax, 0x26dda8(%rip)    # 0x288c10
xorl %eax, %eax
testl %ebp, %ebp
movl $0x0, %r9d
cmovgl %ebp, %r9d
shlq $0x3, %r9
leaq 0xab5f(%rip), %rdx      # 0x259e0
cmpq %rax, %r9
je 0x1ae98
movq (%rax,%rdx), %r8
movq %r8, 0x130(%rsp,%rax)
addq $0x8, %rax
jmp 0x1ae81
movl %ecx, 0x24(%rsp)
leaq 0x2610(%rsp), %rdx
leaq 0x2c(%rsp), %rcx
leaq 0x1a70(%rsp), %r8
leaq 0x28(%rsp), %r9
pushq %r14
pushq %r15
callq 0x1b1f0
popq %rax
popq %rcx
testq %rbx, %rbx
sete %al
addl $-0x2, %r12d
cmpl %r12d, %ebp
setg %cl
orb %al, %cl
jne 0x1af34
movq %rbx, %rdi
callq 0x1b8c5
leaq 0xacfc(%rip), %rdi      # 0x25be0
leaq 0xc(%rsp), %r12
leaq 0x8(%rsp), %r13
movq %r12, %rsi
movq %r13, %rdx
callq 0x52ed
movl (%r12), %edi
movl (%r13), %esi
movl 0x2276f9(%rip), %eax    # 0x242600
movl 0xaac7(%rip), %ecx      # 0x259d4
cmpl %ecx, %eax
sete %dl
incl %ecx
cmpl %ecx, %eax
sete %al
orb %dl, %al
movzbl %al, %ecx
movq %rbx, %rdx
movq %r15, %r8
xorl %r9d, %r9d
callq 0x1ae04
movq %rbx, %rdi
callq 0x1ba0a
movl 0x2c(%rsp), %r13d
movslq %r14d, %r12
xorl %ebp, %ebp
testl %r13d, %r13d
cmovlel %ebp, %r13d
leal 0x1(%r14), %eax
movl %eax, 0x20(%rsp)
cmpq %rbp, %r13
je 0x1b09f
movq 0x2610(%rsp,%rbp,8), %rbx
movq %rbx, %rdi
callq 0x1b8c5
testl %r14d, %r14d
je 0x1af72
movq -0x8(%r15,%r12,8), %rax
jmp 0x1af74
xorl %eax, %eax
movq %rbx, %rdi
leaq 0xed0(%rsp), %rsi
leaq 0x1c(%rsp), %rdx
leaq 0x14(%rsp), %rcx
leaq 0x330(%rsp), %r8
leaq 0x18(%rsp), %r9
pushq %rax
leaq 0x18(%rsp), %rax
pushq %rax
callq 0x1bab9
popq %rax
popq %rcx
movl 0x14(%rsp), %edx
movl 0x10(%rsp), %r9d
movl %r9d, %eax
addl %edx, %eax
jle 0x1b08f
movl 0x227642(%rip), %eax    # 0x242600
movl 0x929c(%rip), %ecx      # 0x24260
xorl %eax, %ecx
orl 0xaa04(%rip), %ecx      # 0x259d0
movl 0x1c(%rsp), %esi
movl %esi, %edi
xorl %edx, %edi
orl %ecx, %edi
movl 0x18(%rsp), %r8d
movl %r8d, %ecx
xorl %r9d, %ecx
orl %edi, %ecx
jne 0x1aff7
pushq $0x1
popq %rdi
movl %edi, %esi
pushq $0x3
popq %rdx
callq 0x658a
jmp 0x1b08f
leal (%r8,%rsi), %ecx
cmpl $0x1, %ecx
jne 0x1b022
movq %rbx, (%r15,%r12,8)
movl 0xa9ca(%rip), %ecx      # 0x259d4
cmpl %ecx, %eax
sete %dl
incl %ecx
cmpl %ecx, %eax
sete %al
orb %dl, %al
movzbl %al, %ecx
pushq $0x1
popq %rdi
movl %edi, %esi
jmp 0x1b080
subq $0x8, %rsp
leaq 0xed8(%rsp), %rdi
leaq 0x338(%rsp), %rcx
leaq 0x10(%rsp), %rax
pushq %rax
leaq 0x1c(%rsp), %rax
pushq %rax
leaq 0xab97(%rip), %rax      # 0x25be0
pushq %rax
callq 0xb886
addq $0x20, %rsp
testl %eax, %eax
je 0x1b08f
movq %rbx, (%r15,%r12,8)
movl 0xc(%rsp), %edi
movl 0x8(%rsp), %esi
movl 0x227597(%rip), %eax    # 0x242600
movl 0xa965(%rip), %ecx      # 0x259d4
cmpl %ecx, %eax
sete %dl
incl %ecx
cmpl %ecx, %eax
sete %al
orb %dl, %al
movzbl %al, %ecx
xorl %edx, %edx
movq %r15, %r8
movl 0x20(%rsp), %r9d
callq 0x1ae04
movq %rbx, %rdi
callq 0x1ba0a
incq %rbp
jmp 0x1af4d
movl 0x28(%rsp), %r15d
xorl %r13d, %r13d
testl %r15d, %r15d
cmovlel %r13d, %r15d
leaq 0xed0(%rsp), %rbx
leaq 0x330(%rsp), %r12
xorl %r14d, %r14d
cmpq %r13, %r15
je 0x1b1a8
movq 0x1a70(%rsp,%r13,8), %rbp
movq %rbp, %rdi
callq 0x1bf9c
testq %r14, %r14
je 0x1b0ef
movq %r14, %rdi
callq 0x1c0d0
testl %eax, %eax
jne 0x1b198
callq 0x1c153
movq %rax, %r14
testq %rax, %rax
jne 0x1b198
subq $0x8, %rsp
movq %rbp, %rdi
movq %rbx, %rsi
leaq 0x24(%rsp), %rdx
leaq 0x1c(%rsp), %rcx
movq %r12, %r8
leaq 0x20(%rsp), %r9
leaq 0x18(%rsp), %rax
pushq %rax
callq 0x1c238
popq %rax
popq %rcx
movl 0x14(%rsp), %edx
movl 0x10(%rsp), %r9d
movl %r9d, %eax
addl %edx, %eax
jle 0x1b195
movl 0x1c(%rsp), %esi
movl 0x18(%rsp), %r8d
subq $0x8, %rsp
movq %rbx, %rdi
movq %r12, %rcx
leaq 0x10(%rsp), %rax
pushq %rax
leaq 0x1c(%rsp), %rax
pushq %rax
leaq 0xaa81(%rip), %rax      # 0x25be0
pushq %rax
callq 0xb886
addq $0x20, %rsp
testl %eax, %eax
je 0x1b195
movl 0xc(%rsp), %edi
movl 0x8(%rsp), %esi
movl 0x227485(%rip), %eax    # 0x242600
xorl %ecx, %ecx
cmpl 0xa851(%rip), %eax      # 0x259d4
sete %cl
xorl %edx, %edx
leaq 0x30(%rsp), %r8
xorl %r9d, %r9d
callq 0x1ae04
xorl %r14d, %r14d
movq %rbp, %rdi
callq 0x1c453
incq %r13
jmp 0x1b0c1
cmpl $0x0, 0x24(%rsp)
je 0x1b1de
movl 0x22744b(%rip), %eax    # 0x242600
xorl %ecx, %ecx
testl %eax, %eax
cmovlel %ecx, %eax
shlq $0x3, %rax
leaq 0xa819(%rip), %rdx      # 0x259e0
cmpq %rcx, %rax
je 0x1b1de
movq 0x130(%rsp,%rcx), %rsi
movq %rsi, (%rcx,%rdx)
addq $0x8, %rcx
jmp 0x1b1c7
addq $0x31b8, %rsp           # imm = 0x31B8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq