// File: /workspace/github_c_makefile_star2_O1/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:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x2ec8, %rsp           # imm = 0x2EC8
movl %edx, %r15d
movl %esi, %ebx
movl %edi, %ebp
movl 0x233f2f(%rip), %edx    # 0x244610
cmpl 0x15b89(%rip), %edx     # 0x26270
jne 0x10710
cmpb $0x1, 0x15ab8(%rip)     # 0x261a8
jne 0x10b18
movl %ebp, %edi
movl %ebx, %esi
addq $0x2ec8, %rsp           # imm = 0x2EC8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x123b3
movq %rcx, %r14
testl %r15d, %r15d
je 0x1074c
subl $0x1, 0x27a501(%rip)    # 0x28ac20
jae 0x10b06
movl 0x15b41(%rip), %eax     # 0x2626c
decl %eax
movl %eax, 0x27a4ed(%rip)    # 0x28ac20
testl %edx, %edx
jle 0x1074c
shlq $0x3, %rdx
leaq 0x172ae(%rip), %rsi     # 0x279f0
leaq 0x30(%rsp), %rdi
callq 0x1080
movl %r15d, 0x20(%rsp)
subq $0x8, %rsp
leaq 0x2c(%rsp), %rax
leaq 0x238(%rsp), %r10
leaq 0x618(%rsp), %rdx
leaq 0x34(%rsp), %r15
leaq 0x2328(%rsp), %r8
leaq 0x30(%rsp), %r9
movl %ebp, %edi
movl %ebx, %esi
movq %r15, %rcx
pushq %r14
pushq %rax
pushq %r10
callq 0x18c37
addq $0x20, %rsp
movslq (%r15), %r15
testq %r15, %r15
jle 0x108c5
xorl %r12d, %r12d
leaq 0x1780(%rsp), %r14
leaq 0xbe0(%rsp), %r13
leaq 0x18(%rsp), %rbp
movq 0x610(%rsp,%r12,8), %rbx
movq %rbx, %rdi
callq 0x19632
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 0x19735
addq $0x10, %rsp
movl 0x14(%rsp), %edx
movl 0x10(%rsp), %r9d
movl %r9d, %eax
addl %edx, %eax
jle 0x108b1
movl 0x233e08(%rip), %eax    # 0x244610
movl 0x15a62(%rip), %ecx     # 0x26270
xorl %eax, %ecx
orl 0x171ca(%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 0x10845
movl $0x1, %edi
movl $0x1, %esi
movl $0x3, %edx
callq 0x76f0
jmp 0x108b1
leal (%r8,%rsi), %ecx
cmpl $0x1, %ecx
jne 0x10865
xorl %edx, %edx
cmpl 0x1718e(%rip), %eax     # 0x279e4
sete %dl
movl $0x1, %edi
movl $0x1, %esi
jmp 0x108a9
subq $0x8, %rsp
movq %r14, %rdi
movq %r13, %rcx
leaq 0x10(%rsp), %rax
pushq %rax
leaq 0x1c(%rsp), %rax
pushq %rax
leaq 0x1736e(%rip), %rax     # 0x27bf0
pushq %rax
callq 0xc654
addq $0x20, %rsp
testl %eax, %eax
je 0x108b1
movl 0xc(%rsp), %edi
movl 0x8(%rsp), %esi
movl 0x233d72(%rip), %eax    # 0x244610
xorl %edx, %edx
cmpl 0x1713e(%rip), %eax     # 0x279e4
sete %dl
movq %rbx, %rcx
callq 0x106c3
movq %rbx, %rdi
callq 0x19b77
incq %r12
cmpq %r12, %r15
jne 0x107b5
movslq 0x28(%rsp), %r12
testq %r12, %r12
jle 0x109c2
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
xorl %r13d, %r13d
leaq 0x1780(%rsp), %r14
leaq 0xbe0(%rsp), %rbx
movq 0x2320(%rsp,%r13,8), %r15
movq %r15, %rdi
callq 0x19c06
testl %ebp, %ebp
js 0x1090a
movl %ebp, %edi
callq 0x19d6b
testl %eax, %eax
jne 0x10911
callq 0x19dcc
movl %eax, %ebp
testl %ebp, %ebp
js 0x1092a
movq %r15, %rdi
callq 0x1a055
incq %r13
cmpq %r13, %r12
jne 0x108eb
jmp 0x109c2
subq $0x8, %rsp
movq %r15, %rdi
movq %r14, %rsi
leaq 0x24(%rsp), %rdx
leaq 0x1c(%rsp), %rcx
movq %rbx, %r8
leaq 0x20(%rsp), %r9
leaq 0x18(%rsp), %rax
pushq %rax
callq 0x19e49
addq $0x10, %rsp
movl 0x14(%rsp), %edx
movl 0x10(%rsp), %r9d
movl %r9d, %eax
addl %edx, %eax
jle 0x10915
movl 0x1c(%rsp), %esi
movl 0x18(%rsp), %r8d
subq $0x8, %rsp
movq %r14, %rdi
movq %rbx, %rcx
leaq 0x10(%rsp), %rax
pushq %rax
leaq 0x1c(%rsp), %rax
pushq %rax
leaq 0x17265(%rip), %rax     # 0x27bf0
pushq %rax
callq 0xc654
addq $0x20, %rsp
testl %eax, %eax
je 0x10915
movl 0xc(%rsp), %edi
movl 0x8(%rsp), %esi
movl 0x233c65(%rip), %eax    # 0x244610
xorl %edx, %edx
cmpl 0x17031(%rip), %eax     # 0x279e4
sete %dl
xorl %ecx, %ecx
callq 0x106c3
jmp 0x10915
movslq 0x24(%rsp), %r15
testq %r15, %r15
jle 0x10ade
xorl %r12d, %r12d
leaq 0x17216(%rip), %rbp     # 0x27bf0
leaq 0x1780(%rsp), %r14
leaq 0xbe0(%rsp), %r13
movq 0x230(%rsp,%r12,8), %rbx
movq %rbx, %rdi
callq 0x1a120
movslq 0x233c0f(%rip), %rax    # 0x244610
testq %rax, %rax
jle 0x10a1b
shlq $0x2, %rax
xorl %ecx, %ecx
cmpl $0x5, (%rcx,%rbp)
je 0x10a24
addq $0x4, %rcx
cmpq %rcx, %rax
jne 0x10a0c
callq 0x19dcc
testl %eax, %eax
js 0x10a39
movq %rbx, %rdi
callq 0x1a46e
incq %r12
cmpq %r15, %r12
jne 0x109ea
jmp 0x10ade
subq $0x8, %rsp
movq %rbx, %rdi
movq %r14, %rsi
leaq 0x24(%rsp), %rdx
leaq 0x1c(%rsp), %rcx
movq %r13, %r8
leaq 0x20(%rsp), %r9
leaq 0x18(%rsp), %rax
pushq %rax
callq 0x1a284
addq $0x10, %rsp
movl 0x14(%rsp), %edx
movl 0x10(%rsp), %r9d
movl %r9d, %eax
addl %edx, %eax
jle 0x10a24
movl 0x1c(%rsp), %esi
movl 0x18(%rsp), %r8d
subq $0x8, %rsp
movq %r14, %rdi
movq %r13, %rcx
leaq 0x10(%rsp), %rax
pushq %rax
leaq 0x1c(%rsp), %rax
pushq %rax
leaq 0x4a00d6(%rip), %rax    # 0x4b0b70
pushq %rax
callq 0xc654
addq $0x20, %rsp
testl %eax, %eax
je 0x10a24
movl 0xc(%rsp), %edi
movl 0x8(%rsp), %esi
movl 0x233b56(%rip), %eax    # 0x244610
movl 0x16f24(%rip), %ecx     # 0x279e4
cmpl %ecx, %eax
setge %dl
addl $0x2, %ecx
cmpl %ecx, %eax
setle %al
andb %dl, %al
movzbl %al, %edx
xorl %ecx, %ecx
callq 0x106c3
jmp 0x10a24
cmpl $0x0, 0x20(%rsp)
je 0x10b06
movslq 0x233b24(%rip), %rdx    # 0x244610
testq %rdx, %rdx
jle 0x10b06
shlq $0x3, %rdx
leaq 0x16ef4(%rip), %rdi     # 0x279f0
leaq 0x30(%rsp), %rsi
callq 0x1080
addq $0x2ec8, %rsp           # imm = 0x2EC8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl %ebp, %edi
movl %ebx, %esi
movl $0x3, %edx
addq $0x2ec8, %rsp           # imm = 0x2EC8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x76f0