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

/* The main node of the recursion for triangulations with minimum
   degree at least 4.
   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 dosplit==TRUE, this is the place to do splitting (if any).
   Splitting is a bit more complicated because the S operation adds
   three vertices.
   If this graph was made with a four-operation, the reference edge of
   that operation is lastfour.  If not, lastfour=NULL.
*/
{
    EDGE *firstedge_save[MAXN];
    EDGE *ext4[MAXE/2],*ext5[MAXE],*extS[MAXF];
    EDGE *good_or[MAXE],*good_mir[MAXE];
    int ngood_or,ngood_mir,ngood_ref,ngood_mir_ref;
    int next4,next5,nextS,i;
    int xnbtot,xnbop;
    int hint;

    if (nv == maxnv)
    {
        if (pswitch) startpolyscan(nbtot,nbop);
	else         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_MIN4
    if (!(PRE_FILTER_MIN4)) return;
#endif

#ifndef FIND_EXTENSIONS_MIN4
#define FIND_EXTENSIONS_MIN4 find_extensions_min4
#endif

    FIND_EXTENSIONS_MIN4(nbtot,nbop,ext4,&next4,ext5,&next5,extS,&nextS,
			 lastfour);

    for (i = 0; i < next4; ++i)
    {
        extend_four(ext4[i]);
#ifdef FAST_FILTER_MIN4
        if (FAST_FILTER_MIN4)
#endif 
        {
	    min4_four_legal(ext4[i],good_or,&ngood_or,&ngood_ref,
		         good_mir,&ngood_mir,&ngood_mir_ref);
    
            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)
    		    scanmin4(1,1,nv==splitlevel,ext4[i]);
	        else if (canon_edge_oriented(good_or,ngood_or,ngood_ref,
                                           good_mir,ngood_mir,ngood_mir_ref,
                                           degree,numbering,&xnbtot,&xnbop))
	            scanmin4(xnbtot,xnbop,nv==splitlevel,ext4[i]);
	    }
	}
	reduce_four(ext4[i]);
    }

    /* hint = lastfour ? lastfour->start : -1; */
    hint = -1;
    for (i = 0; i < next5; ++i)
    {
        extend_five(ext5[i]);
#ifdef FAST_FILTER_MIN4
        if (FAST_FILTER_MIN4)
#endif 
        {
            if (hint < 0 || !is_min4_four_centre(hint))
	        hint = min4_four_centre();
	    if (hint < 0)
	    {
                min4_five_legal(ext5[i],good_or,&ngood_or,&ngood_ref,
                                good_mir,&ngood_mir,&ngood_mir_ref);
                if (ngood_ref+ngood_mir_ref > 0)
                {
                    if (canon_edge_oriented(good_or,ngood_or,ngood_ref,
                                            good_mir,ngood_mir,ngood_mir_ref,
                                            degree,numbering,&xnbtot,&xnbop))
                    scanmin4(xnbtot,xnbop,nv==splitlevel,NULL);
                }
	    }
	}
        reduce_five(ext5[i]);
    }

    for (i = 0; i < nextS; ++i)
    {
        extend_S(extS[i]);
#ifdef FAST_FILTER_MIN4
        if (FAST_FILTER_MIN4)
#endif 
        {
            if (degree5_vertex() < 0 && min4_four_centre() < 0)
            {
                min4_S_legal(extS[i],good_or,&ngood_or,&ngood_ref,
                             good_mir,&ngood_mir,&ngood_mir_ref);
                if (ngood_ref+ngood_mir_ref > 0)
                {
                    if (canon_edge_oriented(good_or,ngood_or,ngood_ref,
                                            good_mir,ngood_mir,ngood_mir_ref,
                                            zero,numbering,&xnbtot,&xnbop))
                    scanmin4(xnbtot,xnbop,
			     nv>=splitlevel&&nv<=splitlevel+2,NULL);
                    }
            }
        }
        reduce_S(extS[i]);
    }

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

// Assembly:
movq %rcx, %rax
movl 0x232fce(%rip), %ecx    # 0x242600
cmpl 0x14c28(%rip), %ecx     # 0x24260
jne 0xf64f
cmpb $0x1, 0x14b57(%rip)     # 0x24198
je 0x111f3
pushq $0x3
popq %rdx
jmp 0x658a
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x2ec8, %rsp           # imm = 0x2EC8
testl %edx, %edx
je 0xf6aa
subl $0x1, 0x2795a5(%rip)    # 0x288c10
jae 0xfa33
movl 0x14be4(%rip), %r8d     # 0x2425c
decl %r8d
movl %r8d, 0x27958e(%rip)    # 0x288c10
xorl %r10d, %r10d
testl %ecx, %ecx
cmovlel %r10d, %ecx
shlq $0x3, %rcx
leaq 0x1634a(%rip), %r8      # 0x259e0
cmpq %r10, %rcx
je 0xf6aa
movq (%r10,%r8), %r9
movq %r9, 0x30(%rsp,%r10)
addq $0x8, %r10
jmp 0xf696
movl %edx, 0x20(%rsp)
subq $0x8, %rsp
leaq 0x2c(%rsp), %r10
leaq 0x238(%rsp), %r11
leaq 0x618(%rsp), %rdx
leaq 0x34(%rsp), %rbx
leaq 0x2328(%rsp), %r8
leaq 0x30(%rsp), %r9
movq %rbx, %rcx
pushq %rax
pushq %r10
pushq %r11
callq 0x175c0
addq $0x20, %rsp
movl (%rbx), %r15d
xorl %r12d, %r12d
testl %r15d, %r15d
cmovlel %r12d, %r15d
leaq 0x1780(%rsp), %r14
leaq 0xbe0(%rsp), %r13
leaq 0x18(%rsp), %rbp
cmpq %r12, %r15
je 0xf813
movq 0x610(%rsp,%r12,8), %rbx
movq %rbx, %rdi
callq 0x17f1f
subq $0x8, %rsp
movq %rbx, %rdi
movq %r14, %rsi
leaq 0x24(%rsp), %rdx
leaq 0x1c(%rsp), %rcx
movq %r13, %r8
movq %rbp, %r9
leaq 0x18(%rsp), %rax
pushq %rax
callq 0x18018
popq %rax
popq %rcx
movl 0x14(%rsp), %edx
movl 0x10(%rsp), %r9d
movl %r9d, %eax
addl %edx, %eax
jle 0xf803
movl 0x232e9a(%rip), %eax    # 0x242600
movl 0x14af4(%rip), %ecx     # 0x24260
xorl %eax, %ecx
orl 0x1625c(%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 0xf79c
pushq $0x1
popq %rdi
movl %edi, %esi
pushq $0x3
popq %rdx
callq 0x658a
jmp 0xf803
leal (%r8,%rsi), %ecx
cmpl $0x1, %ecx
jne 0xf7b7
xorl %edx, %edx
cmpl 0x16227(%rip), %eax     # 0x259d4
sete %dl
pushq $0x1
popq %rdi
movl %edi, %esi
jmp 0xf7fb
subq $0x8, %rsp
movq %r14, %rdi
movq %r13, %rcx
leaq 0x10(%rsp), %rax
pushq %rax
leaq 0x1c(%rsp), %rax
pushq %rax
leaq 0x1640c(%rip), %rax     # 0x25be0
pushq %rax
callq 0xb886
addq $0x20, %rsp
testl %eax, %eax
je 0xf803
movl 0xc(%rsp), %edi
movl 0x8(%rsp), %esi
movl 0x232e10(%rip), %eax    # 0x242600
xorl %edx, %edx
cmpl 0x161dc(%rip), %eax     # 0x259d4
sete %dl
movq %rbx, %rcx
callq 0xf629
movq %rbx, %rdi
callq 0x184ad
incq %r12
jmp 0xf70c
movl 0x28(%rsp), %r15d
xorl %r13d, %r13d
testl %r15d, %r15d
cmovlel %r13d, %r15d
pushq $-0x1
popq %rbp
leaq 0x1780(%rsp), %rbx
leaq 0xbe0(%rsp), %r12
cmpq %r13, %r15
je 0xf907
movq 0x2320(%rsp,%r13,8), %r14
movq %r14, %rdi
callq 0x1853b
testl %ebp, %ebp
js 0xf85d
movl %ebp, %edi
callq 0x18695
testl %eax, %eax
jne 0xf868
callq 0x186ef
movl %eax, %ebp
testl %eax, %eax
js 0xf875
movq %r14, %rdi
callq 0x1897a
incq %r13
jmp 0xf835
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 0x18766
popq %rax
popq %rcx
movl 0x14(%rsp), %edx
movl 0x10(%rsp), %r9d
movl %r9d, %eax
addl %edx, %eax
jle 0xf868
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 0x1630c(%rip), %rax     # 0x25be0
pushq %rax
callq 0xb886
addq $0x20, %rsp
testl %eax, %eax
je 0xf868
movl 0xc(%rsp), %edi
movl 0x8(%rsp), %esi
movl 0x232d10(%rip), %eax    # 0x242600
xorl %edx, %edx
cmpl 0x160dc(%rip), %eax     # 0x259d4
sete %dl
xorl %ecx, %ecx
callq 0xf629
jmp 0xf868
movl 0x24(%rsp), %r14d
xorl %r15d, %r15d
testl %r14d, %r14d
cmovlel %r15d, %r14d
leaq 0x1780(%rsp), %rbx
leaq 0xbe0(%rsp), %r12
leaq 0x18(%rsp), %r13
cmpq %r15, %r14
je 0xfa00
movq 0x230(%rsp,%r15,8), %rbp
movq %rbp, %rdi
callq 0x18a40
callq 0x18ba3
testl %eax, %eax
jns 0xf956
callq 0x186ef
testl %eax, %eax
js 0xf963
movq %rbp, %rdi
callq 0x18daa
incq %r15
jmp 0xf92b
subq $0x8, %rsp
movq %rbp, %rdi
movq %rbx, %rsi
leaq 0x24(%rsp), %rdx
leaq 0x1c(%rsp), %rcx
movq %r12, %r8
movq %r13, %r9
leaq 0x18(%rsp), %rax
pushq %rax
callq 0x18bcd
popq %rax
popq %rcx
movl 0x14(%rsp), %edx
movl 0x10(%rsp), %r9d
movl %r9d, %eax
addl %edx, %eax
jle 0xf956
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 0x49f1a0(%rip), %rax    # 0x4aeb60
pushq %rax
callq 0xb886
addq $0x20, %rsp
testl %eax, %eax
je 0xf956
movl 0xc(%rsp), %edi
movl 0x8(%rsp), %esi
movl 0x232c24(%rip), %eax    # 0x242600
movl 0x15ff2(%rip), %ecx     # 0x259d4
cmpl %ecx, %eax
setge %dl
addl $0x2, %ecx
cmpl %ecx, %eax
setle %al
andb %dl, %al
movzbl %al, %edx
xorl %ecx, %ecx
callq 0xf629
jmp 0xf956
cmpl $0x0, 0x20(%rsp)
je 0xfa33
movl 0x232bf3(%rip), %eax    # 0x242600
xorl %ecx, %ecx
testl %eax, %eax
cmovlel %ecx, %eax
shlq $0x3, %rax
leaq 0x15fc1(%rip), %rdx     # 0x259e0
cmpq %rcx, %rax
je 0xfa33
movq 0x30(%rsp,%rcx), %rsi
movq %rsi, (%rcx,%rdx)
addq $0x8, %rcx
jmp 0xfa1f
addq $0x2ec8, %rsp           # imm = 0x2EC8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq