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

/* The main node of the recursion for triangulations with minimum
   degree at least 4.  This is the version keeping track of all the
   non-facial triangles.
   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.
   nft[0..numnft-1] is a list of all the non-facial triangles.
   Edges in the triangles must be in min form.
*/
{
    EDGE *firstedge_save[MAXN];
    EDGE *ext4[MAXE/2],*ext5[MAXE],*extS[MAXF];
    EDGE *good_or[MAXE],*good_mir[MAXE],*e;
    triangle newnft[MAXN];
    int newnumnft;
    int ngood_or,ngood_mir,ngood_ref,ngood_mir_ref;
    int next4,next5,nextS,i;
    int xnbtot,xnbop;
    int hint;

    if (nv == maxnv)
    {
        got_one(nbtot,nbop,3+(numnft==0));
        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);

    if (nv == maxnv-1 && numnft > 0 && minconnec == 4)
        nftlaststep(ext4,&next4,ext5,&next5,nft,numnft);

    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)
                {
                    update_nft_four(nft,numnft,ext4[i],newnft,&newnumnft);
                    got_one(1,1,3+(newnumnft==0));
                }
                else if (ngood_or+ngood_mir==1)
                {
                    update_nft_four(nft,numnft,ext4[i],newnft,&newnumnft);
                    scanmin4c(1,1,nv==splitlevel,ext4[i],newnft,newnumnft);
                }
                else if (canon_edge_oriented(good_or,ngood_or,ngood_ref,
                                           good_mir,ngood_mir,ngood_mir_ref,
                                           degree,numbering,&xnbtot,&xnbop))
                {
                    update_nft_four(nft,numnft,ext4[i],newnft,&newnumnft);
                    scanmin4c(xnbtot,xnbop,nv==splitlevel,ext4[i],
                             newnft,newnumnft);
                }
            }
        }
        reduce_four(ext4[i]);
    }

    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))
                    {
                        update_nft_five(nft,numnft,ext5[i],newnft,&newnumnft);
                        scanmin4c(xnbtot,xnbop,nv==splitlevel,NULL,
                                 newnft,newnumnft);
                    }
                }
            }
	}
        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))
                    {
                        e = extS[i];
                        nft[numnft].e1 = e->min;
                        e = e->invers->prev->prev->prev;
                        nft[numnft].e2 = e->min;
                        e = e->invers->prev->prev->prev;
                        nft[numnft].e3 = e->min;
                        scanmin4c(xnbtot,xnbop,
			   nv>=splitlevel&&nv<=splitlevel+2,NULL,nft,numnft+1);
                    }
                }
            }
        }
        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 $0x34e8, %rsp           # imm = 0x34E8
movl %r9d, %r12d
movl 0x224fbd(%rip), %ebp    # 0x242600
movl 0x6c16(%rip), %r15d     # 0x24260
cmpl %r15d, %ebp
jne 0x1d66e
xorl %edx, %edx
cmpl $0x1, %r12d
adcl $0x3, %edx
addq $0x34e8, %rsp           # imm = 0x34E8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x658a
movq %r8, %r14
movq %rcx, %rax
testl %edx, %edx
je 0x1d6c3
subl $0x1, 0x26b591(%rip)    # 0x288c10
jae 0x1dd70
movl 0x6bd1(%rip), %ecx      # 0x2425c
decl %ecx
movl %ecx, 0x26b57d(%rip)    # 0x288c10
xorl %ecx, %ecx
testl %ebp, %ebp
movl $0x0, %r10d
cmovgl %ebp, %r10d
shlq $0x3, %r10
leaq 0x8334(%rip), %r8       # 0x259e0
cmpq %rcx, %r10
je 0x1d6c3
movq (%rcx,%r8), %r9
movq %r9, 0x650(%rsp,%rcx)
addq $0x8, %rcx
jmp 0x1d6ac
movl %edx, 0x44(%rsp)
subq $0x8, %rsp
leaq 0x50(%rsp), %r10
leaq 0xe28(%rsp), %r11
leaq 0x858(%rsp), %rdx
leaq 0x54(%rsp), %rbx
leaq 0x2948(%rsp), %r8
leaq 0x34(%rsp), %r9
movq %rbx, %rcx
pushq %rax
pushq %r10
pushq %r11
callq 0x175c0
addq $0x20, %rsp
movl (%rbx), %r13d
movl %r12d, %eax
movq %rax, 0x30(%rsp)
testl %r12d, %r12d
movl %r12d, 0xc(%rsp)
jle 0x1d846
decl %r15d
cmpl %r15d, %ebp
jne 0x1d846
cmpl $0x4, 0x6971(%rip)      # 0x240a0
jne 0x1d846
movl 0x6940(%rip), %r8d      # 0x2407c
movl 0x2c(%rsp), %ecx
xorl %eax, %eax
pushq $0x30
popq %rdx
pushq $0x2
popq %rsi
leaq 0x224ec1(%rip), %rdi    # 0x242610
movq 0x30(%rsp), %r15
cmpq %r15, %rax
je 0x1d83b
cmpl $0x752f, %r8d           # imm = 0x752F
jl 0x1d77d
movq %rdx, %r8
cmpq $0x46630, %r8           # imm = 0x46630
je 0x1d783
andl $0x0, (%r8,%rdi)
addq $0x40, %r8
jmp 0x1d769
addl $0x2, %r8d
jmp 0x1d786
movl %esi, %r8d
imulq $0x18, %rax, %r9
movq (%r14,%r9), %r10
movl %r8d, 0x30(%r10)
movq 0x20(%r10), %r10
movl %r8d, 0x30(%r10)
movq 0x8(%r14,%r9), %r10
movl %r8d, 0x30(%r10)
movq 0x20(%r10), %r10
movl %r8d, 0x30(%r10)
movq 0x10(%r14,%r9), %r9
movl %r8d, 0x30(%r9)
movq 0x20(%r9), %r9
movl %r8d, 0x30(%r9)
xorl %r9d, %r9d
testl %r13d, %r13d
movl %r13d, %r10d
cmovlel %r9d, %r10d
xorl %r13d, %r13d
cmpq %r9, %r10
je 0x1d7f2
movq 0x850(%rsp,%r9,8), %r11
cmpl %r8d, 0x30(%r11)
jne 0x1d7ed
movslq %r13d, %rbx
incl %r13d
movq %r11, 0x850(%rsp,%rbx,8)
incq %r9
jmp 0x1d7cc
xorl %r9d, %r9d
testl %ecx, %ecx
movl %ecx, %r10d
cmovlel %r9d, %r10d
xorl %ecx, %ecx
cmpq %r9, %r10
je 0x1d833
movq 0x2940(%rsp,%r9,8), %r11
cmpl %r8d, 0x30(%r11)
je 0x1d821
movq 0x20(%r11), %rbx
movq 0x10(%rbx), %rbx
cmpl %r8d, 0x30(%rbx)
jne 0x1d82e
movslq %ecx, %rbx
incl %ecx
movq %r11, 0x2940(%rsp,%rbx,8)
incq %r9
jmp 0x1d800
incq %rax
jmp 0x1d754
movl %r8d, 0x683a(%rip)      # 0x2407c
movl %ecx, 0x2c(%rsp)
xorl %ebx, %ebx
testl %r13d, %r13d
cmovlel %ebx, %r13d
leaq 0x1da0(%rsp), %rbp
cmpq %rbx, %r13
je 0x1d9e6
movq 0x850(%rsp,%rbx,8), %r12
movq %r12, %rdi
callq 0x17f1f
subq $0x8, %rsp
movq %r12, %rdi
leaq 0x1208(%rsp), %rsi
leaq 0x2c(%rsp), %rdx
leaq 0x24(%rsp), %rcx
movq %rbp, %r8
leaq 0x28(%rsp), %r9
leaq 0x20(%rsp), %rax
pushq %rax
callq 0x18018
popq %rax
popq %rcx
movl 0x1c(%rsp), %edx
movl 0x18(%rsp), %r9d
movl %r9d, %eax
addl %edx, %eax
jle 0x1d9d6
movl 0x224d47(%rip), %r15d   # 0x242600
movl 0x69a1(%rip), %eax      # 0x24260
xorl %r15d, %eax
orl 0x8108(%rip), %eax      # 0x259d0
movl 0x24(%rsp), %esi
movl %esi, %ecx
xorl %edx, %ecx
orl %eax, %ecx
movl 0x20(%rsp), %r8d
movl %r8d, %eax
xorl %r9d, %eax
orl %ecx, %eax
jne 0x1d916
movq %r14, %rdi
movl 0xc(%rsp), %esi
movq %r12, %rdx
leaq 0x50(%rsp), %rcx
leaq 0x28(%rsp), %r8
callq 0x1dd82
cmpl $0x1, 0x28(%rsp)
movl $0x0, %edx
adcl $0x3, %edx
pushq $0x1
popq %rdi
movl %edi, %esi
callq 0x658a
jmp 0x1d9d6
leal (%r8,%rsi), %eax
cmpl $0x1, %eax
jne 0x1d961
movq %r14, %rdi
movl 0xc(%rsp), %esi
movq %r12, %rdx
leaq 0x50(%rsp), %rbp
movq %rbp, %rcx
leaq 0x28(%rsp), %r8
callq 0x1dd82
xorl %edx, %edx
cmpl 0x8090(%rip), %r15d     # 0x259d4
sete %dl
movl 0x28(%rsp), %r9d
pushq $0x1
popq %rdi
movl %edi, %esi
movq %r12, %rcx
movq %rbp, %r8
leaq 0x1da0(%rsp), %rbp
jmp 0x1d9d1
subq $0x8, %rsp
leaq 0x1208(%rsp), %rdi
movq %rbp, %rcx
leaq 0x18(%rsp), %rax
pushq %rax
leaq 0x24(%rsp), %rax
pushq %rax
leaq 0x825d(%rip), %rax      # 0x25be0
pushq %rax
callq 0xb886
addq $0x20, %rsp
testl %eax, %eax
je 0x1d9d6
movq %r14, %rdi
movl 0xc(%rsp), %esi
movq %r12, %rdx
leaq 0x50(%rsp), %r15
movq %r15, %rcx
leaq 0x28(%rsp), %r8
callq 0x1dd82
movl 0x14(%rsp), %edi
movl 0x10(%rsp), %esi
movl 0x224c45(%rip), %eax    # 0x242600
xorl %edx, %edx
cmpl 0x8011(%rip), %eax      # 0x259d4
sete %dl
movl 0x28(%rsp), %r9d
movq %r12, %rcx
movq %r15, %r8
callq 0x1d629
movq %r12, %rdi
callq 0x184ad
incq %rbx
jmp 0x1d857
movl 0x2c(%rsp), %ebx
xorl %r15d, %r15d
testl %ebx, %ebx
cmovlel %r15d, %ebx
imulq $0x18, 0x30(%rsp), %r12
pushq $-0x1
popq %rbp
movq %rbx, 0x38(%rsp)
movq %r12, 0x30(%rsp)
cmpq %rbx, %r15
je 0x1dbeb
movq 0x2940(%rsp,%r15,8), %r13
movq %r13, %rdi
callq 0x1853b
testl %ebp, %ebp
js 0x1da32
movl %ebp, %edi
callq 0x18695
testl %eax, %eax
jne 0x1dbdb
callq 0x186ef
movl %eax, %ebp
testl %eax, %eax
jns 0x1dbdb
subq $0x8, %rsp
movq %r13, %rdi
leaq 0x1208(%rsp), %rbx
movq %rbx, %rsi
leaq 0x2c(%rsp), %rdx
leaq 0x24(%rsp), %rcx
leaq 0x1da8(%rsp), %r12
movq %r12, %r8
leaq 0x28(%rsp), %r9
leaq 0x20(%rsp), %rax
pushq %rax
callq 0x18766
popq %rax
popq %rcx
movl 0x1c(%rsp), %edx
movl 0x18(%rsp), %r9d
movl %r9d, %eax
addl %edx, %eax
jle 0x1db37
movl 0x24(%rsp), %esi
movl 0x20(%rsp), %r8d
subq $0x8, %rsp
movq %rbx, %rdi
movq %r12, %rcx
leaq 0x18(%rsp), %rax
pushq %rax
leaq 0x24(%rsp), %rax
pushq %rax
leaq 0x812c(%rip), %rax      # 0x25be0
pushq %rax
callq 0xb886
addq $0x20, %rsp
testl %eax, %eax
je 0x1db37
movq 0x18(%r13), %rcx
movq 0x28(%r13), %rax
movq 0x18(%rcx), %rcx
movq 0x28(%rcx), %rcx
xorl %edx, %edx
xorl %r9d, %r9d
movq 0x38(%rsp), %rbx
movq 0x30(%rsp), %r12
cmpq %rdx, %r12
je 0x1db41
movq (%r14,%rdx), %rsi
cmpq %rax, %rsi
je 0x1db31
movq 0x8(%r14,%rdx), %rdi
cmpq %rax, %rdi
je 0x1db31
movq 0x10(%r14,%rdx), %r8
cmpq %rax, %r8
je 0x1db31
cmpq %rcx, %rsi
je 0x1db31
cmpq %rcx, %rdi
je 0x1db31
cmpq %rcx, %r8
je 0x1db31
leaq (%r14,%rdx), %rsi
movslq %r9d, %rdi
incl %r9d
imulq $0x18, %rdi, %rdi
movq 0x10(%rsi), %r8
movq %r8, 0x60(%rsp,%rdi)
movups (%rsi), %xmm0
movups %xmm0, 0x50(%rsp,%rdi)
addq $0x18, %rdx
jmp 0x1dae1
movq 0x38(%rsp), %rbx
jmp 0x1dbdb
testl %r9d, %r9d
je 0x1dbb3
movq 0x10(%r13), %rax
addq $0x10, %rax
xorl %ecx, %ecx
cmpl $0x3, %ecx
je 0x1dbb6
movq (%rax), %rdx
movq 0x18(%rdx), %rax
movq 0x20(%rdx), %rdi
movl 0x4(%rax), %esi
movq 0x18(%rdi), %rdi
movq 0x20(%rdi), %rdi
movq 0x18(%rdi), %r8
movq 0x18(%r8), %r8
movq 0x18(%r8), %r8
cmpq %rdi, %r8
je 0x1dbab
cmpl %esi, 0x4(%r8)
jne 0x1db73
movq 0x28(%r8), %rsi
movslq %r9d, %r9
imulq $0x18, %r9, %rdi
movq %rsi, 0x50(%rsp,%rdi)
movq 0x10(%rdx), %rdx
movq 0x28(%rdx), %rdx
movq %rdx, 0x58(%rsp,%rdi)
movq 0x28(%rax), %rdx
movq %rdx, 0x60(%rsp,%rdi)
incl %r9d
addq $0x18, %rax
incl %ecx
jmp 0x1db50
xorl %r9d, %r9d
movl 0x14(%rsp), %edi
movl 0x10(%rsp), %esi
movl 0x224a3c(%rip), %eax    # 0x242600
xorl %edx, %edx
cmpl 0x7e08(%rip), %eax      # 0x259d4
sete %dl
xorl %ecx, %ecx
leaq 0x50(%rsp), %r8
callq 0x1d629
movq %r13, %rdi
callq 0x1897a
incq %r15
jmp 0x1da06
movl 0x48(%rsp), %r12d
movl 0xc(%rsp), %ecx
movslq %ecx, %rax
imulq $0x18, %rax, %rbp
addq %r14, %rbp
incl %ecx
movl %ecx, 0xc(%rsp)
xorl %ebx, %ebx
testl %r12d, %r12d
cmovlel %ebx, %r12d
leaq 0x1da0(%rsp), %r13
cmpq %rbx, %r12
je 0x1dd3a
movq 0xe20(%rsp,%rbx,8), %r15
movq %r15, %rdi
callq 0x18a40
callq 0x18ba3
testl %eax, %eax
jns 0x1dc40
callq 0x186ef
testl %eax, %eax
js 0x1dc4d
movq %r15, %rdi
callq 0x18daa
incq %rbx
jmp 0x1dc15
subq $0x8, %rsp
movq %r15, %rdi
leaq 0x1208(%rsp), %rsi
leaq 0x2c(%rsp), %rdx
leaq 0x24(%rsp), %rcx
movq %r13, %r8
leaq 0x28(%rsp), %r9
leaq 0x20(%rsp), %rax
pushq %rax
callq 0x18bcd
popq %rax
popq %rcx
movl 0x1c(%rsp), %edx
movl 0x18(%rsp), %r9d
movl %r9d, %eax
addl %edx, %eax
jle 0x1dc40
movl 0x24(%rsp), %esi
movl 0x20(%rsp), %r8d
subq $0x8, %rsp
leaq 0x1208(%rsp), %rdi
movq %r13, %rcx
leaq 0x18(%rsp), %rax
pushq %rax
leaq 0x24(%rsp), %rax
pushq %rax
leaq 0x490eaa(%rip), %rax    # 0x4aeb60
pushq %rax
callq 0xb886
addq $0x20, %rsp
testl %eax, %eax
je 0x1dc40
movq 0x28(%r15), %rax
movq %rax, (%rbp)
movq 0x20(%r15), %rax
movq 0x10(%rax), %rax
movq 0x10(%rax), %rax
movq 0x10(%rax), %rax
movq 0x28(%rax), %rcx
movq %rcx, 0x8(%rbp)
movq 0x20(%rax), %rax
movq 0x10(%rax), %rax
movq 0x10(%rax), %rax
movq 0x10(%rax), %rax
movq 0x28(%rax), %rax
movq %rax, 0x10(%rbp)
movl 0x14(%rsp), %edi
movl 0x10(%rsp), %esi
movl 0x2248f2(%rip), %eax    # 0x242600
movl 0x7cc0(%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
movq %r14, %r8
movl 0xc(%rsp), %r9d
callq 0x1d629
jmp 0x1dc40
cmpl $0x0, 0x44(%rsp)
je 0x1dd70
movl 0x2248b9(%rip), %eax    # 0x242600
xorl %ecx, %ecx
testl %eax, %eax
cmovlel %ecx, %eax
shlq $0x3, %rax
leaq 0x7c87(%rip), %rdx      # 0x259e0
cmpq %rcx, %rax
je 0x1dd70
movq 0x650(%rsp,%rcx), %rsi
movq %rsi, (%rcx,%rdx)
addq $0x8, %rcx
jmp 0x1dd59
addq $0x34e8, %rsp           # imm = 0x34E8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq