// File: /workspace/github_c_makefile_star2_O1/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 0x227f99(%rip), %r13d   # 0x244610
movl 0x9bf3(%rip), %ebx      # 0x26270
cmpl %ebx, %r13d
jne 0x1c6a2
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 0x76f0
movl %r9d, %r14d
movq %r8, %r15
testl %ecx, %ecx
je 0x1c6fa
subl $0x1, 0x26e56d(%rip)    # 0x28ac20
jae 0x1ca4d
movl 0x9bad(%rip), %eax      # 0x2626c
decl %eax
movl %eax, 0x26e559(%rip)    # 0x28ac20
testl %r13d, %r13d
jle 0x1c6fa
movq %rdx, 0x20(%rsp)
leaq (,%r13,8), %rdx
leaq 0xb310(%rip), %rsi      # 0x279f0
leaq 0x130(%rsp), %rdi
movl %ecx, 0xc(%rsp)
callq 0x1080
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 0x1ca5f
movq 0x30(%rsp), %rdi
addq $0x10, %rsp
testq %rdi, %rdi
sete %al
addl $-0x2, %ebx
cmpl %ebx, %r13d
setg %cl
orb %al, %cl
jne 0x1c7a6
movq %rdi, %rbx
callq 0x1d1a5
leaq 0xb49a(%rip), %rdi      # 0x27bf0
leaq 0x8(%rsp), %r12
leaq 0x4(%rsp), %r13
movq %r12, %rsi
movq %r13, %rdx
callq 0x6408
movl (%r12), %edi
movl (%r13), %esi
movl 0x227e97(%rip), %eax    # 0x244610
movl 0xb265(%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 0x1c65a
movq %rbx, %rdi
callq 0x1d2eb
movslq 0x2c(%rsp), %r13
testq %r13, %r13
jle 0x1c91c
movslq %r14d, %r12
leal 0x1(%r14), %eax
movl %eax, 0x20(%rsp)
xorl %ebp, %ebp
movq 0x2610(%rsp,%rbp,8), %rbx
movq %rbx, %rdi
callq 0x1d1a5
testl %r14d, %r14d
je 0x1c7dd
movq -0x8(%r15,%r12,8), %rax
jmp 0x1c7df
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 0x1d39a
addq $0x10, %rsp
movl 0x14(%rsp), %edx
movl 0x10(%rsp), %r9d
movl %r9d, %eax
addl %edx, %eax
jle 0x1c908
movl 0x227de5(%rip), %eax    # 0x244610
movl 0x9a3f(%rip), %ecx      # 0x26270
xorl %eax, %ecx
orl 0xb1a7(%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 0x1c86b
movl $0x1, %edi
movl $0x1, %esi
movl $0x3, %edx
callq 0x76f0
jmp 0x1c908
leal (%r8,%rsi), %ecx
cmpl $0x1, %ecx
jne 0x1c89b
movq %rbx, (%r15,%r12,8)
movl 0xb166(%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 0x1c8f9
subq $0x8, %rsp
leaq 0xed8(%rsp), %rdi
leaq 0x338(%rsp), %rcx
leaq 0xc(%rsp), %rax
pushq %rax
leaq 0x18(%rsp), %rax
pushq %rax
leaq 0xb32e(%rip), %rax      # 0x27bf0
pushq %rax
callq 0xc654
addq $0x20, %rsp
testl %eax, %eax
je 0x1c908
movq %rbx, (%r15,%r12,8)
movl 0x8(%rsp), %edi
movl 0x4(%rsp), %esi
movl 0x227d2e(%rip), %eax    # 0x244610
movl 0xb0fc(%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 0x1c65a
movq %rbx, %rdi
callq 0x1d2eb
incq %rbp
cmpq %rbp, %r13
jne 0x1c7c1
movslq 0x28(%rsp), %r15
testq %r15, %r15
jle 0x1ca22
xorl %r13d, %r13d
leaq 0xed0(%rsp), %rbx
leaq 0x330(%rsp), %r12
xorl %ebp, %ebp
movq 0x1a70(%rsp,%r13,8), %r14
movq %r14, %rdi
callq 0x1d880
testq %rbp, %rbp
je 0x1c960
movq %rbp, %rdi
callq 0x1d9ef
testl %eax, %eax
jne 0x1c968
callq 0x1da73
movq %rax, %rbp
testq %rbp, %rbp
je 0x1c982
movq %r14, %rdi
callq 0x1dd64
incq %r13
cmpq %r13, %r15
jne 0x1c93f
jmp 0x1ca22
subq $0x8, %rsp
movq %r14, %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 0x1db58
addq $0x10, %rsp
movl 0x14(%rsp), %edx
movl 0x10(%rsp), %r9d
movl %r9d, %eax
addl %edx, %eax
jle 0x1c96d
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 0xb20d(%rip), %rax      # 0x27bf0
pushq %rax
callq 0xc654
addq $0x20, %rsp
testl %eax, %eax
je 0x1c96d
movl 0x8(%rsp), %edi
movl 0x4(%rsp), %esi
movl 0x227c0d(%rip), %eax    # 0x244610
xorl %ecx, %ecx
cmpl 0xafd9(%rip), %eax      # 0x279e4
sete %cl
xorl %edx, %edx
leaq 0x30(%rsp), %r8
xorl %r9d, %r9d
callq 0x1c65a
jmp 0x1c96d
cmpl $0x0, 0xc(%rsp)
je 0x1ca4d
movslq 0x227be0(%rip), %rdx    # 0x244610
testq %rdx, %rdx
jle 0x1ca4d
shlq $0x3, %rdx
leaq 0xafb0(%rip), %rdi      # 0x279f0
leaq 0x130(%rsp), %rsi
callq 0x1080
addq $0x31b8, %rsp           # imm = 0x31B8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq