// File: /workspace/github_c_makefile_star2_O0/mishun[P]plantri/plantri.c
// Function: find_start_loops
static void
find_start_loops(EDGE *loop[], int nloops, EDGE *start[],
                 EDGE *start_inv[], int *nstarts)
 
/* loop[0..nloops-1] is a list of all the loops.  A "special" loop is
   one with one face bounded by non-loops and the other face bounded
   by loops.  loop[nloops-1] is known to be special.  If loop[nloops-1]
   does not have the lowest vertex degree of all special loops, return
   with *nstarts=0.  Otherwise, list in start[0..*nstarts-1] all the
   special loops with lowest vertex degree, and in start_inv[0..*nstarts-1]
   their inverses.  The orientations in start[] have a loop in the next
   direction.
*/

{
    int i,nst,mindeg;
    EDGE *e;
 
    e = loop[nloops-1];
    if (e->next->start == e->next->end)
    {
        start[0] = e;
        start_inv[0] = e->invers; 
    }
    else
    {
	start[0] = e->invers;
	start_inv[0] = e;
    }
        
    nst = 1;
    mindeg = degree[start[0]->end];
 
    for (i = nloops-1; --i >= 0;)
    {
        e = loop[i];
        if ((e->next->start == e->next->end)
                         + (e->prev->start == e->prev->end) == 1)
        {
            if (degree[e->end] < mindeg)
            {
                *nstarts = 0;
                return;
            }
            else if (degree[e->end] == mindeg)
	    {
                if (e->next->start == e->next->end)
	        {
		    start[nst] = e;
		    start_inv[nst++] = e->invers;
		}
                else    
                {
		    start_inv[nst] = e;
		    start[nst++] = e->invers;
		}
	    }
        }
    }
 
    *nstarts = nst;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq %r8, -0x28(%rbp)
movq -0x8(%rbp), %rax
movl -0xc(%rbp), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rax
movq %rax, -0x40(%rbp)
movq -0x40(%rbp), %rax
movq 0x18(%rax), %rax
movl (%rax), %eax
movq -0x40(%rbp), %rcx
movq 0x18(%rcx), %rcx
cmpl 0x4(%rcx), %eax
jne 0x303ef
movq -0x40(%rbp), %rcx
movq -0x18(%rbp), %rax
movq %rcx, (%rax)
movq -0x40(%rbp), %rax
movq 0x20(%rax), %rcx
movq -0x20(%rbp), %rax
movq %rcx, (%rax)
jmp 0x30409
movq -0x40(%rbp), %rax
movq 0x20(%rax), %rcx
movq -0x18(%rbp), %rax
movq %rcx, (%rax)
movq -0x40(%rbp), %rcx
movq -0x20(%rbp), %rax
movq %rcx, (%rax)
movl $0x1, -0x30(%rbp)
movq -0x18(%rbp), %rax
movq (%rax), %rax
movslq 0x4(%rax), %rcx
leaq 0xd7de(%rip), %rax      # 0x3dc00
movl (%rax,%rcx,4), %eax
movl %eax, -0x34(%rbp)
movl -0xc(%rbp), %eax
subl $0x1, %eax
movl %eax, -0x2c(%rbp)
movl -0x2c(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x2c(%rbp)
cmpl $0x0, %eax
jl 0x30556
movq -0x8(%rbp), %rax
movslq -0x2c(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, -0x40(%rbp)
movq -0x40(%rbp), %rax
movq 0x18(%rax), %rax
movl (%rax), %eax
movq -0x40(%rbp), %rcx
movq 0x18(%rcx), %rcx
cmpl 0x4(%rcx), %eax
sete %al
andb $0x1, %al
movzbl %al, %eax
movq -0x40(%rbp), %rcx
movq 0x10(%rcx), %rcx
movl (%rcx), %ecx
movq -0x40(%rbp), %rdx
movq 0x10(%rdx), %rdx
cmpl 0x4(%rdx), %ecx
sete %cl
andb $0x1, %cl
movzbl %cl, %ecx
addl %ecx, %eax
cmpl $0x1, %eax
jne 0x30551
movq -0x40(%rbp), %rax
movslq 0x4(%rax), %rcx
leaq 0xd758(%rip), %rax      # 0x3dc00
movl (%rax,%rcx,4), %eax
cmpl -0x34(%rbp), %eax
jge 0x304bf
movq -0x28(%rbp), %rax
movl $0x0, (%rax)
jmp 0x3055f
movq -0x40(%rbp), %rax
movslq 0x4(%rax), %rcx
leaq 0xd732(%rip), %rax      # 0x3dc00
movl (%rax,%rcx,4), %eax
cmpl -0x34(%rbp), %eax
jne 0x3054d
movq -0x40(%rbp), %rax
movq 0x18(%rax), %rax
movl (%rax), %eax
movq -0x40(%rbp), %rcx
movq 0x18(%rcx), %rcx
cmpl 0x4(%rcx), %eax
jne 0x3051d
movq -0x40(%rbp), %rdx
movq -0x18(%rbp), %rax
movslq -0x30(%rbp), %rcx
movq %rdx, (%rax,%rcx,8)
movq -0x40(%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)
jmp 0x3054b
movq -0x40(%rbp), %rdx
movq -0x20(%rbp), %rax
movslq -0x30(%rbp), %rcx
movq %rdx, (%rax,%rcx,8)
movq -0x40(%rbp), %rax
movq 0x20(%rax), %rdx
movq -0x18(%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 0x3054d
jmp 0x3054f
jmp 0x30551
jmp 0x30431
movl -0x30(%rbp), %ecx
movq -0x28(%rbp), %rax
movl %ecx, (%rax)
popq %rbp
retq
nopw %cs:(%rax,%rax)