// File: /workspace/github_c_makefile_star2_O1/mishun[P]plantri/plantri.c
// Function: construct_numb
static void
construct_numb(EDGE *givenedge, EDGE *numbering[])

/* Starts at givenedge and writes the edges in the well defined order 
   into the list.  Works like testcanon. Look there for comments. */
{
    EDGE *temp, **tail, **limit, *run;  
    EDGE *startedge[MAXN+1]; 
    int last_number, actual_number, vertex;

    RESETMARKS_V;

    tail = numbering; 
    limit = numbering+ne-1;  

    MARK_V(givenedge->start); 
    if (givenedge->start != givenedge->end)
      {
	MARK_V(givenedge->end);
	last_number = 2;
	startedge[1] = givenedge->invers;
      }
    else last_number = 1; 

    actual_number = 1;
    temp = *tail = givenedge;

    while (last_number < nv)
    {  
        for (run = temp->next; run != temp; run = run->next)
    /* this loop marks all edges around temp->origin. */
          { vertex = run->end;
            if (!ISMARKED_V(vertex))
              { startedge[last_number] = run->invers;
                last_number++; MARK_V(vertex); }
                tail++; *tail = run; 
          }
          if (tail != limit)
            { tail++;
              *tail = temp = startedge[actual_number];  actual_number++; }
    }

    while (tail != limit) 
                /* Now we know that all numbers have been given */
    {  
        for (run = temp->next; run != temp; run = run->next)
    /* this loop marks all edges around temp->origin. */
          { tail++; *tail = run; }
        if (tail != limit)
        { 
       /* Next vertex to explore: */
            tail++;
            *tail = temp = startedge[actual_number];  actual_number++; }
    }
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x208, %rsp            # imm = 0x208
movq %rsi, %rbx
movq %rdi, %r14
movl 0x19f4f(%rip), %eax     # 0x26098
leal 0x1(%rax), %ecx
movl %ecx, 0x19f46(%rip)     # 0x26098
cmpl $0x7530, %eax           # imm = 0x7530
jl 0xc176
movl $0x1, 0x19f35(%rip)     # 0x26098
leaq 0x27eac6(%rip), %rdi    # 0x28ac30
movl $0x100, %edx            # imm = 0x100
xorl %esi, %esi
callq 0x1030
movslq 0x238497(%rip), %rcx    # 0x244614
movl 0x19f15(%rip), %edx     # 0x26098
movslq (%r14), %r9
leaq 0x27eaa3(%rip), %rsi    # 0x28ac30
movl %edx, (%rsi,%r9,4)
movslq 0x4(%r14), %r8
movl $0x1, %eax
movl $0x1, %edi
cmpl %r8d, %r9d
je 0xc1b6
movl %edx, (%rsi,%r8,4)
movq 0x20(%r14), %rdi
movq %rdi, 0x8(%rsp)
movl $0x2, %edi
leaq (%rbx,%rcx,8), %rcx
addq $-0x8, %rcx
movq %r14, (%rbx)
movl 0x238448(%rip), %r8d    # 0x244610
cmpl %r8d, %edi
jge 0xc24c
movl $0x1, %eax
movq 0x18(%r14), %r9
cmpq %r14, %r9
je 0xc204
movslq 0x4(%r9), %r10
cmpl %edx, (%rsi,%r10,4)
je 0xc1f6
movq 0x20(%r9), %r11
movslq %edi, %rdi
movq %r11, (%rsp,%rdi,8)
incl %edi
movl %edx, (%rsi,%r10,4)
movq %r9, 0x8(%rbx)
addq $0x8, %rbx
movq 0x18(%r9), %r9
jmp 0xc1d6
cmpq %rcx, %rbx
je 0xc219
cltq
movq (%rsp,%rax,8), %r14
movq %r14, 0x8(%rbx)
addq $0x8, %rbx
incl %eax
cmpl %r8d, %edi
jl 0xc1d2
jmp 0xc24c
movq 0x18(%r14), %rdx
cmpq %r14, %rdx
je 0xc237
movq %rdx, 0x8(%rbx)
addq $0x8, %rbx
movq 0x18(%rdx), %rdx
jmp 0xc224
cmpq %rcx, %rbx
je 0xc24c
cltq
movq (%rsp,%rax,8), %r14
movq %r14, 0x8(%rbx)
addq $0x8, %rbx
incl %eax
cmpq %rcx, %rbx
jne 0xc220
addq $0x208, %rsp            # imm = 0x208
popq %rbx
popq %r14
retq