// File: /workspace/github_c_makefile_star2_O1/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 0x19e26(%rip), %eax     # 0x26098
leal 0x1(%rax), %ecx
movl %ecx, 0x19e1d(%rip)     # 0x26098
cmpl $0x7530, %eax           # imm = 0x7530
jl 0xc29f
movl $0x1, 0x19e0c(%rip)     # 0x26098
leaq 0x27e99d(%rip), %rdi    # 0x28ac30
movl $0x100, %edx            # imm = 0x100
xorl %esi, %esi
callq 0x1030
movslq 0x23836e(%rip), %rcx    # 0x244614
movl 0x19dec(%rip), %edx     # 0x26098
movslq (%r14), %r9
leaq 0x27e97a(%rip), %rsi    # 0x28ac30
movl %edx, (%rsi,%r9,4)
movslq 0x4(%r14), %r8
movl $0x1, %eax
movl $0x1, %edi
cmpl %r8d, %r9d
je 0xc2df
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 0x23831f(%rip), %r8d    # 0x244610
cmpl %r8d, %edi
jge 0xc375
movl $0x1, %eax
movq 0x10(%r14), %r9
cmpq %r14, %r9
je 0xc32d
movslq 0x4(%r9), %r10
cmpl %edx, (%rsi,%r10,4)
je 0xc31f
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 0xc2ff
cmpq %rcx, %rbx
je 0xc342
cltq
movq (%rsp,%rax,8), %r14
movq %r14, 0x8(%rbx)
addq $0x8, %rbx
incl %eax
cmpl %r8d, %edi
jl 0xc2fb
jmp 0xc375
movq 0x10(%r14), %rdx
cmpq %r14, %rdx
je 0xc360
movq %rdx, 0x8(%rbx)
addq $0x8, %rbx
movq 0x10(%rdx), %rdx
jmp 0xc34d
cmpq %rcx, %rbx
je 0xc375
cltq
movq (%rsp,%rax,8), %r14
movq %r14, 0x8(%rbx)
addq $0x8, %rbx
incl %eax
cmpq %rcx, %rbx
jne 0xc349
addq $0x208, %rsp            # imm = 0x208
popq %rbx
popq %r14
retq