// File: /workspace/github_c_makefile_star2_O0/mishun[P]plantri/plantri.c
// Function: find_extensions_min4
static void
find_extensions_min4(int nbtot, int nbop, EDGE *ext4[], int *next4,
   EDGE *ext5[], int *next5, EDGE *extS[], int *nextS, EDGE *known)

/* Determine the inequivalent places to make extensions, for the
   ordinary triangulations of minimum degree 4.  The results are
   put in the arrays ext4[0..*next4-1], etc..
   nbtot and nbop are the usual group parameters.

   If known!=NULL, it is the reference edge of a known four-reduction.
*/
{
    register int i,k;
    register EDGE *e,*e1,*elast;
    EDGE **nb,**nb0,**nblim,**nboplim;
    int manycentres;

    find_extensions_min4_four(nbtot,ext4,next4,known);

    manycentres = has_3_four_centres();

    if (nbtot == 1)
    {
      /* five-extensions, trivial group */

	if (manycentres)
	    *next5 = 0;
	else if (known)
	{
	    k = 0;
	    for (i = 0, e = known; i < 4; ++i, e = e->next)
	    if (degree[e->end] >= 6)
	    {
		ext5[k++] = e->invers->prev->invers;
		ext5[k++] = e->invers->next->next->invers;
	    }
	    *next5 = k;
	}
	else
	{
	    k = 0;
	    for (i = 0; i < nv; ++i)
	    if (degree[i] >= 6)
	    {
	        e = elast = firstedge[i];
                do
                {
                    ext5[k++] = e->invers;
                    e = e->next;
                } while (e != elast);
            }
            *next5 = k;
	}

      /* S-extensions, trivial group */

        k = 0;
	if (nv <= maxnv-3)
	{
            for (i = 0; i < nv; ++i)
            {
                e = elast = firstedge[i];
                do
                {
                    e1 = e->invers->prev;
                    if (e1 > e)
                    {
                        e1 = e1->invers->prev;
                        if (e1 > e) extS[k++] = e;
                    }
                    e = e->next;
                } while (e != elast);
            }
	}
	*nextS = k;
    }
    else    
    {
      /* five-extensions, non-trivial group */
    
	if (manycentres)
	    *next5 = 0;
	else
	{
            nboplim = (EDGE**)numbering[nbop==0?nbtot:nbop];
            nblim = (EDGE**)numbering[nbtot];

            RESETMARKS;
	    k = 0;
            nb0 = (EDGE**)numbering[0];
            for (i = 0; i < ne; ++i, ++nb0)
            {
                e = *nb0;
                if (!ISMARKEDLO(e) && degree[e->start] >= 6)
                {
                    ext5[k++] = e->next->invers;
    
                    nb = nb0 + MAXE;
                    for (; nb < nboplim; nb += MAXE) MARKLO(*nb);
                    for (; nb < nblim; nb += MAXE) MARKLO((*nb)->prev);
                }
            }
	    *next5 = k;
	}

      /* S-extensions, non-trivial group */

        k = 0;
	if (nv <= maxnv-3)
        {
	    nb0 = (EDGE**)numbering[0];
            nboplim = (EDGE**)numbering[nbop==0?nbtot:nbop];
            nblim = (EDGE**)numbering[nbtot];
	    RESETMARKS;

	    for (i = 0; i < ne; ++i) nb0[i]->index = i;

            for (i = 0; i < ne; ++i)
            {
                e = nb0[i];
                if (ISMARKEDLO(e)) continue;
                extS[k++] = e;
            
                for (nb = nb0 + i; nb < nboplim; nb += MAXE) MARKLO(*nb);

                for (; nb < nblim; nb += MAXE) MARKLO((*nb)->invers);

                e1 = e->invers->prev;
                for (nb = nb0 + e1->index; nb < nboplim; nb += MAXE)
                    MARKLO(*nb);
    
                for (; nb < nblim; nb += MAXE) MARKLO((*nb)->invers);
        
                e1 = e1->invers->prev;
                for (nb = nb0 + e1->index; nb < nboplim; nb += MAXE)
                    MARKLO(*nb);
    
                for (; nb < nblim; nb += MAXE) MARKLO((*nb)->invers);
            }
	}
	*nextS = k;
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x80, %rsp
movq 0x20(%rbp), %rax
movq 0x18(%rbp), %rax
movq 0x10(%rbp), %rax
movl %edi, -0x4(%rbp)
movl %esi, -0x8(%rbp)
movq %rdx, -0x10(%rbp)
movq %rcx, -0x18(%rbp)
movq %r8, -0x20(%rbp)
movq %r9, -0x28(%rbp)
movl -0x4(%rbp), %edi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
movq 0x20(%rbp), %rcx
callq 0x2ac30
callq 0x2b620
movl %eax, -0x6c(%rbp)
cmpl $0x1, -0x4(%rbp)
jne 0x288d2
cmpl $0x0, -0x6c(%rbp)
je 0x286b8
movq -0x28(%rbp), %rax
movl $0x0, (%rax)
jmp 0x28801
cmpq $0x0, 0x20(%rbp)
je 0x28772
movl $0x0, -0x30(%rbp)
movl $0x0, -0x2c(%rbp)
movq 0x20(%rbp), %rax
movq %rax, -0x38(%rbp)
cmpl $0x4, -0x2c(%rbp)
jge 0x28764
movq -0x38(%rbp), %rax
movslq 0x4(%rax), %rcx
leaq 0x1550e(%rip), %rax     # 0x3dc00
cmpl $0x6, (%rax,%rcx,4)
jl 0x28748
movq -0x38(%rbp), %rax
movq 0x20(%rax), %rax
movq 0x10(%rax), %rax
movq 0x20(%rax), %rdx
movq -0x20(%rbp), %rax
movl -0x30(%rbp), %ecx
movl %ecx, %esi
addl $0x1, %esi
movl %esi, -0x30(%rbp)
movslq %ecx, %rcx
movq %rdx, (%rax,%rcx,8)
movq -0x38(%rbp), %rax
movq 0x20(%rax), %rax
movq 0x18(%rax), %rax
movq 0x18(%rax), %rax
movq 0x20(%rax), %rdx
movq -0x20(%rbp), %rax
movl -0x30(%rbp), %ecx
movl %ecx, %esi
addl $0x1, %esi
movl %esi, -0x30(%rbp)
movslq %ecx, %rcx
movq %rdx, (%rax,%rcx,8)
jmp 0x2874a
movl -0x2c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x2c(%rbp)
movq -0x38(%rbp), %rax
movq 0x18(%rax), %rax
movq %rax, -0x38(%rbp)
jmp 0x286d9
movl -0x30(%rbp), %ecx
movq -0x28(%rbp), %rax
movl %ecx, (%rax)
jmp 0x287ff
movl $0x0, -0x30(%rbp)
movl $0x0, -0x2c(%rbp)
movl -0x2c(%rbp), %eax
cmpl 0x231e97(%rip), %eax    # 0x25a620
jge 0x287f6
movslq -0x2c(%rbp), %rcx
leaq 0x1546a(%rip), %rax     # 0x3dc00
cmpl $0x6, (%rax,%rcx,4)
jl 0x287e9
movslq -0x2c(%rbp), %rcx
leaq 0x15259(%rip), %rax     # 0x3da00
movq (%rax,%rcx,8), %rax
movq %rax, -0x48(%rbp)
movq %rax, -0x38(%rbp)
movq -0x38(%rbp), %rax
movq 0x20(%rax), %rdx
movq -0x20(%rbp), %rax
movl -0x30(%rbp), %ecx
movl %ecx, %esi
addl $0x1, %esi
movl %esi, -0x30(%rbp)
movslq %ecx, %rcx
movq %rdx, (%rax,%rcx,8)
movq -0x38(%rbp), %rax
movq 0x18(%rax), %rax
movq %rax, -0x38(%rbp)
movq -0x38(%rbp), %rax
cmpq -0x48(%rbp), %rax
jne 0x287b3
jmp 0x287e9
jmp 0x287eb
movl -0x2c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x2c(%rbp)
jmp 0x28780
movl -0x30(%rbp), %ecx
movq -0x28(%rbp), %rax
movl %ecx, (%rax)
jmp 0x28801
movl $0x0, -0x30(%rbp)
movl 0x231e12(%rip), %eax    # 0x25a620
movl 0x13a6c(%rip), %ecx     # 0x3c280
subl $0x3, %ecx
cmpl %ecx, %eax
jg 0x288c4
movl $0x0, -0x2c(%rbp)
movl -0x2c(%rbp), %eax
cmpl 0x231df1(%rip), %eax    # 0x25a620
jge 0x288c2
movslq -0x2c(%rbp), %rcx
leaq 0x151c0(%rip), %rax     # 0x3da00
movq (%rax,%rcx,8), %rax
movq %rax, -0x48(%rbp)
movq %rax, -0x38(%rbp)
movq -0x38(%rbp), %rax
movq 0x20(%rax), %rax
movq 0x10(%rax), %rax
movq %rax, -0x40(%rbp)
movq -0x40(%rbp), %rax
cmpq -0x38(%rbp), %rax
jbe 0x2889c
movq -0x40(%rbp), %rax
movq 0x20(%rax), %rax
movq 0x10(%rax), %rax
movq %rax, -0x40(%rbp)
movq -0x40(%rbp), %rax
cmpq -0x38(%rbp), %rax
jbe 0x2889a
movq -0x38(%rbp), %rdx
movq 0x10(%rbp), %rax
movl -0x30(%rbp), %ecx
movl %ecx, %esi
addl $0x1, %esi
movl %esi, -0x30(%rbp)
movslq %ecx, %rcx
movq %rdx, (%rax,%rcx,8)
jmp 0x2889c
movq -0x38(%rbp), %rax
movq 0x18(%rax), %rax
movq %rax, -0x38(%rbp)
movq -0x38(%rbp), %rax
cmpq -0x48(%rbp), %rax
jne 0x2884c
jmp 0x288b4
movl -0x2c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x2c(%rbp)
jmp 0x28826
jmp 0x288c4
movl -0x30(%rbp), %ecx
movq 0x18(%rbp), %rax
movl %ecx, (%rax)
jmp 0x28d68
cmpl $0x0, -0x6c(%rbp)
je 0x288e7
movq -0x28(%rbp), %rax
movl $0x0, (%rax)
jmp 0x28a94
cmpl $0x0, -0x8(%rbp)
jne 0x288f5
movl -0x4(%rbp), %eax
movl %eax, -0x78(%rbp)
jmp 0x288fb
movl -0x8(%rbp), %eax
movl %eax, -0x78(%rbp)
movl -0x78(%rbp), %eax
movslq %eax, %rcx
leaq 0x153f8(%rip), %rax     # 0x3dd00
imulq $0xba0, %rcx, %rcx      # imm = 0xBA0
addq %rcx, %rax
movq %rax, -0x68(%rbp)
movslq -0x4(%rbp), %rcx
leaq 0x153df(%rip), %rax     # 0x3dd00
imulq $0xba0, %rcx, %rcx      # imm = 0xBA0
addq %rcx, %rax
movq %rax, -0x60(%rbp)
movl 0x1374f(%rip), %eax     # 0x3c084
addl $0x2, %eax
movl %eax, 0x13746(%rip)     # 0x3c084
cmpl $0x7530, %eax           # imm = 0x7530
jle 0x28985
movl $0x2, 0x13735(%rip)     # 0x3c084
movl $0x0, -0x70(%rbp)
cmpl $0x1198, -0x70(%rbp)    # imm = 0x1198
jge 0x28983
movslq -0x70(%rbp), %rcx
leaq 0x231cc6(%rip), %rax    # 0x25a630
shlq $0x6, %rcx
addq %rcx, %rax
movl $0x0, 0x30(%rax)
movl -0x70(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x70(%rbp)
jmp 0x28956
jmp 0x28985
movl $0x0, -0x30(%rbp)
leaq 0x1536d(%rip), %rax     # 0x3dd00
movq %rax, -0x58(%rbp)
movl $0x0, -0x2c(%rbp)
movl -0x2c(%rbp), %eax
cmpl 0x231c7d(%rip), %eax    # 0x25a624
jge 0x28a8b
movq -0x58(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x38(%rbp)
movq -0x38(%rbp), %rax
movl 0x30(%rax), %eax
cmpl 0x136bf(%rip), %eax     # 0x3c084
je 0x28a6f
movq -0x38(%rbp), %rax
movslq (%rax), %rcx
leaq 0x15227(%rip), %rax     # 0x3dc00
cmpl $0x6, (%rax,%rcx,4)
jl 0x28a6f
movq -0x38(%rbp), %rax
movq 0x18(%rax), %rax
movq 0x20(%rax), %rdx
movq -0x20(%rbp), %rax
movl -0x30(%rbp), %ecx
movl %ecx, %esi
addl $0x1, %esi
movl %esi, -0x30(%rbp)
movslq %ecx, %rcx
movq %rdx, (%rax,%rcx,8)
movq -0x58(%rbp), %rax
addq $0xba0, %rax            # imm = 0xBA0
movq %rax, -0x50(%rbp)
movq -0x50(%rbp), %rax
cmpq -0x68(%rbp), %rax
jae 0x28a3d
movl 0x13661(%rip), %ecx     # 0x3c084
movq -0x50(%rbp), %rax
movq (%rax), %rax
movl %ecx, 0x30(%rax)
movq -0x50(%rbp), %rax
addq $0xba0, %rax            # imm = 0xBA0
movq %rax, -0x50(%rbp)
jmp 0x28a13
jmp 0x28a3f
movq -0x50(%rbp), %rax
cmpq -0x60(%rbp), %rax
jae 0x28a6d
movl 0x13635(%rip), %ecx     # 0x3c084
movq -0x50(%rbp), %rax
movq (%rax), %rax
movq 0x10(%rax), %rax
movl %ecx, 0x30(%rax)
movq -0x50(%rbp), %rax
addq $0xba0, %rax            # imm = 0xBA0
movq %rax, -0x50(%rbp)
jmp 0x28a3f
jmp 0x28a6f
jmp 0x28a71
movl -0x2c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x2c(%rbp)
movq -0x58(%rbp), %rax
addq $0x8, %rax
movq %rax, -0x58(%rbp)
jmp 0x2899e
movl -0x30(%rbp), %ecx
movq -0x28(%rbp), %rax
movl %ecx, (%rax)
movl $0x0, -0x30(%rbp)
movl 0x231b7f(%rip), %eax    # 0x25a620
movl 0x137d9(%rip), %ecx     # 0x3c280
subl $0x3, %ecx
cmpl %ecx, %eax
jg 0x28d5f
leaq 0x15247(%rip), %rax     # 0x3dd00
movq %rax, -0x58(%rbp)
cmpl $0x0, -0x8(%rbp)
jne 0x28acb
movl -0x4(%rbp), %eax
movl %eax, -0x7c(%rbp)
jmp 0x28ad1
movl -0x8(%rbp), %eax
movl %eax, -0x7c(%rbp)
movl -0x7c(%rbp), %eax
movslq %eax, %rcx
leaq 0x15222(%rip), %rax     # 0x3dd00
imulq $0xba0, %rcx, %rcx      # imm = 0xBA0
addq %rcx, %rax
movq %rax, -0x68(%rbp)
movslq -0x4(%rbp), %rcx
leaq 0x15209(%rip), %rax     # 0x3dd00
imulq $0xba0, %rcx, %rcx      # imm = 0xBA0
addq %rcx, %rax
movq %rax, -0x60(%rbp)
movl 0x13579(%rip), %eax     # 0x3c084
addl $0x2, %eax
movl %eax, 0x13570(%rip)     # 0x3c084
cmpl $0x7530, %eax           # imm = 0x7530
jle 0x28b5b
movl $0x2, 0x1355f(%rip)     # 0x3c084
movl $0x0, -0x74(%rbp)
cmpl $0x1198, -0x74(%rbp)    # imm = 0x1198
jge 0x28b59
movslq -0x74(%rbp), %rcx
leaq 0x231af0(%rip), %rax    # 0x25a630
shlq $0x6, %rcx
addq %rcx, %rax
movl $0x0, 0x30(%rax)
movl -0x74(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x74(%rbp)
jmp 0x28b2c
jmp 0x28b5b
movl $0x0, -0x2c(%rbp)
movl -0x2c(%rbp), %eax
cmpl 0x231ab9(%rip), %eax    # 0x25a624
jge 0x28b8a
movl -0x2c(%rbp), %ecx
movq -0x58(%rbp), %rax
movslq -0x2c(%rbp), %rdx
movq (%rax,%rdx,8), %rax
movl %ecx, 0x34(%rax)
movl -0x2c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x2c(%rbp)
jmp 0x28b62
movl $0x0, -0x2c(%rbp)
movl -0x2c(%rbp), %eax
cmpl 0x231a8a(%rip), %eax    # 0x25a624
jge 0x28d5d
movq -0x58(%rbp), %rax
movslq -0x2c(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, -0x38(%rbp)
movq -0x38(%rbp), %rax
movl 0x30(%rax), %eax
cmpl 0x134c7(%rip), %eax     # 0x3c084
jne 0x28bc4
jmp 0x28d4f
movq -0x38(%rbp), %rdx
movq 0x10(%rbp), %rax
movl -0x30(%rbp), %ecx
movl %ecx, %esi
addl $0x1, %esi
movl %esi, -0x30(%rbp)
movslq %ecx, %rcx
movq %rdx, (%rax,%rcx,8)
movq -0x58(%rbp), %rax
movslq -0x2c(%rbp), %rcx
shlq $0x3, %rcx
addq %rcx, %rax
movq %rax, -0x50(%rbp)
movq -0x50(%rbp), %rax
cmpq -0x68(%rbp), %rax
jae 0x28c1b
movl 0x13483(%rip), %ecx     # 0x3c084
movq -0x50(%rbp), %rax
movq (%rax), %rax
movl %ecx, 0x30(%rax)
movq -0x50(%rbp), %rax
addq $0xba0, %rax            # imm = 0xBA0
movq %rax, -0x50(%rbp)
jmp 0x28bf1
jmp 0x28c1d
movq -0x50(%rbp), %rax
cmpq -0x60(%rbp), %rax
jae 0x28c4b
movl 0x13457(%rip), %ecx     # 0x3c084
movq -0x50(%rbp), %rax
movq (%rax), %rax
movq 0x20(%rax), %rax
movl %ecx, 0x30(%rax)
movq -0x50(%rbp), %rax
addq $0xba0, %rax            # imm = 0xBA0
movq %rax, -0x50(%rbp)
jmp 0x28c1d
movq -0x38(%rbp), %rax
movq 0x20(%rax), %rax
movq 0x10(%rax), %rax
movq %rax, -0x40(%rbp)
movq -0x58(%rbp), %rax
movq -0x40(%rbp), %rcx
movslq 0x34(%rcx), %rcx
shlq $0x3, %rcx
addq %rcx, %rax
movq %rax, -0x50(%rbp)
movq -0x50(%rbp), %rax
cmpq -0x68(%rbp), %rax
jae 0x28c9c
movl 0x13402(%rip), %ecx     # 0x3c084
movq -0x50(%rbp), %rax
movq (%rax), %rax
movl %ecx, 0x30(%rax)
movq -0x50(%rbp), %rax
addq $0xba0, %rax            # imm = 0xBA0
movq %rax, -0x50(%rbp)
jmp 0x28c72
jmp 0x28c9e
movq -0x50(%rbp), %rax
cmpq -0x60(%rbp), %rax
jae 0x28ccc
movl 0x133d6(%rip), %ecx     # 0x3c084
movq -0x50(%rbp), %rax
movq (%rax), %rax
movq 0x20(%rax), %rax
movl %ecx, 0x30(%rax)
movq -0x50(%rbp), %rax
addq $0xba0, %rax            # imm = 0xBA0
movq %rax, -0x50(%rbp)
jmp 0x28c9e
movq -0x40(%rbp), %rax
movq 0x20(%rax), %rax
movq 0x10(%rax), %rax
movq %rax, -0x40(%rbp)
movq -0x58(%rbp), %rax
movq -0x40(%rbp), %rcx
movslq 0x34(%rcx), %rcx
shlq $0x3, %rcx
addq %rcx, %rax
movq %rax, -0x50(%rbp)
movq -0x50(%rbp), %rax
cmpq -0x68(%rbp), %rax
jae 0x28d1d
movl 0x13381(%rip), %ecx     # 0x3c084
movq -0x50(%rbp), %rax
movq (%rax), %rax
movl %ecx, 0x30(%rax)
movq -0x50(%rbp), %rax
addq $0xba0, %rax            # imm = 0xBA0
movq %rax, -0x50(%rbp)
jmp 0x28cf3
jmp 0x28d1f
movq -0x50(%rbp), %rax
cmpq -0x60(%rbp), %rax
jae 0x28d4d
movl 0x13355(%rip), %ecx     # 0x3c084
movq -0x50(%rbp), %rax
movq (%rax), %rax
movq 0x20(%rax), %rax
movl %ecx, 0x30(%rax)
movq -0x50(%rbp), %rax
addq $0xba0, %rax            # imm = 0xBA0
movq %rax, -0x50(%rbp)
jmp 0x28d1f
jmp 0x28d4f
movl -0x2c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x2c(%rbp)
jmp 0x28b91
jmp 0x28d5f
movl -0x30(%rbp), %ecx
movq 0x18(%rbp), %rax
movl %ecx, (%rax)
addq $0x80, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)