// File: /workspace/github_c_makefile_star2_O3/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 %esi, %ebp
movl %edi, %r12d
movl 0x227e0b(%rip), %r13d   # 0x244610
movl 0x9a65(%rip), %ebx      # 0x26270
cmpl %ebx, %r13d
jne 0x1c830
movl %r12d, %edi
movl %ebp, %esi
movl $0x3, %edx
addq $0x31b8, %rsp           # imm = 0x31B8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x761c
movl %r9d, %r14d
movq %r8, %r15
testl %ecx, %ecx
je 0x1c888
subl $0x1, 0x26e3df(%rip)    # 0x28ac20
jae 0x1cbdd
movl 0x9a1f(%rip), %eax      # 0x2626c
decl %eax
movl %eax, 0x26e3cb(%rip)    # 0x28ac20
testl %r13d, %r13d
jle 0x1c888
movq %rdx, 0x20(%rsp)
leaq (,%r13,8), %rdx
leaq 0xb182(%rip), %rsi      # 0x279f0
leaq 0x130(%rsp), %rdi
movl %ecx, 0xc(%rsp)
callq 0x1070
movq 0x20(%rsp), %rdx
movl 0xc(%rsp), %ecx
movq %rdx, 0x20(%rsp)
movl %ecx, 0xc(%rsp)
leaq 0x2610(%rsp), %rdx
leaq 0x2c(%rsp), %rcx
leaq 0x1a70(%rsp), %r8
leaq 0x28(%rsp), %r9
movl %r12d, %edi
movl %ebp, %esi
pushq %r14
pushq %r15
callq 0x1cbef
movq 0x30(%rsp), %rdi
addq $0x10, %rsp
testq %rdi, %rdi
sete %al
addl $-0x2, %ebx
cmpl %ebx, %r13d
setg %cl
orb %al, %cl
jne 0x1c934
movq %rdi, %rbx
callq 0x1d325
leaq 0xb30c(%rip), %rdi      # 0x27bf0
leaq 0x8(%rsp), %r12
leaq 0x4(%rsp), %r13
movq %r12, %rsi
movq %r13, %rdx
callq 0x62d6
movl (%r12), %edi
movl (%r13), %esi
movl 0x227d09(%rip), %eax    # 0x244610
movl 0xb0d7(%rip), %ecx      # 0x279e4
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 0x1c7e8
movq %rbx, %rdi
callq 0x1d46b
movslq 0x2c(%rsp), %r13
testq %r13, %r13
jle 0x1caaa
movslq %r14d, %r12
leal 0x1(%r14), %eax
movl %eax, 0x20(%rsp)
xorl %ebp, %ebp
movq 0x2610(%rsp,%rbp,8), %rbx
movq %rbx, %rdi
callq 0x1d325
testl %r14d, %r14d
je 0x1c96b
movq -0x8(%r15,%r12,8), %rax
jmp 0x1c96d
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 0x1d51a
addq $0x10, %rsp
movl 0x14(%rsp), %edx
movl 0x10(%rsp), %r9d
movl %r9d, %eax
addl %edx, %eax
jle 0x1ca96
movl 0x227c57(%rip), %eax    # 0x244610
movl 0x98b1(%rip), %ecx      # 0x26270
xorl %eax, %ecx
orl 0xb019(%rip), %ecx      # 0x279e0
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 0x1c9f9
movl $0x1, %edi
movl $0x1, %esi
movl $0x3, %edx
callq 0x761c
jmp 0x1ca96
leal (%r8,%rsi), %ecx
cmpl $0x1, %ecx
jne 0x1ca29
movq %rbx, (%r15,%r12,8)
movl 0xafd8(%rip), %ecx      # 0x279e4
cmpl %ecx, %eax
sete %dl
incl %ecx
cmpl %ecx, %eax
sete %al
orb %dl, %al
movzbl %al, %ecx
movl $0x1, %edi
movl $0x1, %esi
jmp 0x1ca87
subq $0x8, %rsp
leaq 0xed8(%rsp), %rdi
leaq 0x338(%rsp), %rcx
leaq 0xc(%rsp), %rax
pushq %rax
leaq 0x18(%rsp), %rax
pushq %rax
leaq 0xb1a0(%rip), %rax      # 0x27bf0
pushq %rax
callq 0xc7bb
addq $0x20, %rsp
testl %eax, %eax
je 0x1ca96
movq %rbx, (%r15,%r12,8)
movl 0x8(%rsp), %edi
movl 0x4(%rsp), %esi
movl 0x227ba0(%rip), %eax    # 0x244610
movl 0xaf6e(%rip), %ecx      # 0x279e4
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 0x1c7e8
movq %rbx, %rdi
callq 0x1d46b
incq %rbp
cmpq %rbp, %r13
jne 0x1c94f
movslq 0x28(%rsp), %r15
testq %r15, %r15
jle 0x1cbb2
xorl %r13d, %r13d
leaq 0xed0(%rsp), %rbx
leaq 0x330(%rsp), %r12
xorl %r14d, %r14d
movq 0x1a70(%rsp,%r13,8), %rbp
movq %rbp, %rdi
callq 0x1d9f2
testq %r14, %r14
je 0x1caf3
movq %r14, %rdi
callq 0x1db27
testl %eax, %eax
jne 0x1cb9e
callq 0x1dbab
movq %rax, %r14
testq %rax, %rax
jne 0x1cb9e
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 0x1dc90
addq $0x10, %rsp
movl 0x14(%rsp), %edx
movl 0x10(%rsp), %r9d
movl %r9d, %eax
addl %edx, %eax
jle 0x1cb9b
movl 0x1c(%rsp), %esi
movl 0x18(%rsp), %r8d
subq $0x8, %rsp
movq %rbx, %rdi
movq %r12, %rcx
leaq 0xc(%rsp), %rax
pushq %rax
leaq 0x18(%rsp), %rax
pushq %rax
leaq 0xb08b(%rip), %rax      # 0x27bf0
pushq %rax
callq 0xc7bb
addq $0x20, %rsp
testl %eax, %eax
je 0x1cb9b
movl 0x8(%rsp), %edi
movl 0x4(%rsp), %esi
movl 0x227a8f(%rip), %eax    # 0x244610
xorl %ecx, %ecx
cmpl 0xae5b(%rip), %eax      # 0x279e4
sete %cl
xorl %edx, %edx
leaq 0x30(%rsp), %r8
xorl %r9d, %r9d
callq 0x1c7e8
xorl %r14d, %r14d
movq %rbp, %rdi
callq 0x1deb1
incq %r13
cmpq %r13, %r15
jne 0x1cace
cmpl $0x0, 0xc(%rsp)
je 0x1cbdd
movslq 0x227a50(%rip), %rdx    # 0x244610
testq %rdx, %rdx
jle 0x1cbdd
shlq $0x3, %rdx
leaq 0xae20(%rip), %rdi      # 0x279f0
leaq 0x130(%rsp), %rsi
callq 0x1070
addq $0x31b8, %rsp           # imm = 0x31B8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq