// File: /workspace/github_c_makefile_star2_O3/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 0x19e15(%rip), %eax     # 0x26090
leal 0x1(%rax), %edx
movl %edx, 0x19e0c(%rip)     # 0x26090
cmpl $0x7530, %eax           # imm = 0x7530
jl 0xc2ad
movl $0x1, 0x19dfb(%rip)     # 0x26090
leaq 0x27e994(%rip), %rdi    # 0x28ac30
movl $0x100, %edx            # imm = 0x100
xorl %esi, %esi
callq 0x1030
movl $0x1, %edx
movslq 0x238360(%rip), %rcx    # 0x244614
movslq (%r14), %r9
leaq 0x27e972(%rip), %rsi    # 0x28ac30
movl %edx, (%rsi,%r9,4)
movslq 0x4(%r14), %r8
movl $0x1, %eax
movl $0x1, %edi
cmpl %r8d, %r9d
je 0xc2e7
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 0x238317(%rip), %r8d    # 0x244610
cmpl %r8d, %edi
jge 0xc386
movl $0x1, %eax
movq 0x18(%r14), %r9
cmpq %r14, %r9
je 0xc339
movslq 0x4(%r9), %r10
cmpl %edx, (%rsi,%r10,4)
je 0xc32b
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 0xc30b
cmpq %rcx, %rbx
je 0xc350
cltq
movq (%rsp,%rax,8), %r14
movq %r14, 0x8(%rbx)
addq $0x8, %rbx
incl %eax
jmp 0xc353
movq %rcx, %rbx
cmpl %r8d, %edi
jl 0xc307
jmp 0xc386
movq 0x18(%r14), %rdx
cmpq %r14, %rdx
je 0xc371
movq %rdx, 0x8(%rbx)
addq $0x8, %rbx
movq 0x18(%rdx), %rdx
jmp 0xc35e
cmpq %rcx, %rbx
je 0xc386
cltq
movq (%rsp,%rax,8), %r14
movq %r14, 0x8(%rbx)
addq $0x8, %rbx
incl %eax
cmpq %rcx, %rbx
jne 0xc35a
addq $0x208, %rsp            # imm = 0x208
popq %rbx
popq %r14
retq