// File: /workspace/github_c_makefile_star2_O3/mishun[P]plantri/plantri.c
// Function: construct_numb_mirror
static void 
construct_numb_mirror(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; /* The first entry of the numbering list */
    limit = numbering+ne-1;  /* Last valid entry of the numbering list */

    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->prev; run != temp; run = run->prev)
    /* 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->prev; run != temp; run = run->prev)
    /* 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 0x19ce4(%rip), %eax     # 0x26090
leal 0x1(%rax), %edx
movl %edx, 0x19cdb(%rip)     # 0x26090
cmpl $0x7530, %eax           # imm = 0x7530
jl 0xc3de
movl $0x1, 0x19cca(%rip)     # 0x26090
leaq 0x27e863(%rip), %rdi    # 0x28ac30
movl $0x100, %edx            # imm = 0x100
xorl %esi, %esi
callq 0x1030
movl $0x1, %edx
movslq 0x23822f(%rip), %rcx    # 0x244614
movslq (%r14), %r9
leaq 0x27e841(%rip), %rsi    # 0x28ac30
movl %edx, (%rsi,%r9,4)
movslq 0x4(%r14), %r8
movl $0x1, %eax
movl $0x1, %edi
cmpl %r8d, %r9d
je 0xc418
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 0x2381e6(%rip), %r8d    # 0x244610
cmpl %r8d, %edi
jge 0xc4b7
movl $0x1, %eax
movq 0x10(%r14), %r9
cmpq %r14, %r9
je 0xc46a
movslq 0x4(%r9), %r10
cmpl %edx, (%rsi,%r10,4)
je 0xc45c
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 0x10(%r9), %r9
jmp 0xc43c
cmpq %rcx, %rbx
je 0xc481
cltq
movq (%rsp,%rax,8), %r14
movq %r14, 0x8(%rbx)
addq $0x8, %rbx
incl %eax
jmp 0xc484
movq %rcx, %rbx
cmpl %r8d, %edi
jl 0xc438
jmp 0xc4b7
movq 0x10(%r14), %rdx
cmpq %r14, %rdx
je 0xc4a2
movq %rdx, 0x8(%rbx)
addq $0x8, %rbx
movq 0x10(%rdx), %rdx
jmp 0xc48f
cmpq %rcx, %rbx
je 0xc4b7
cltq
movq (%rsp,%rax,8), %r14
movq %r14, 0x8(%rbx)
addq $0x8, %rbx
incl %eax
cmpq %rcx, %rbx
jne 0xc48b
addq $0x208, %rsp            # imm = 0x208
popq %rbx
popq %r14
retq