// File: /workspace/github_c_makefile_star2_O0/mishun[P]plantri/plantri.c
// Function: compute_code_mirror
static void
compute_code_mirror(unsigned char code[])
 
/* In the case of no double edges -- that is when the identifications are
   clear -- there is no problem in just returning the inverse order of
   the previously computed code. Nevertheless in the case where edge 
   identifications must be made via the spanning tree described in the code,
   this is not that easy, so we can as well just compute mirror code just
   like the normal code computed before.

   In case code_edge is not NULL, its start is numbered 1 and its
   end is numbered 0.
*/
{
    register EDGE *run;
    register int vertex;
    EDGE *temp;  
    EDGE *startedge[MAXN+1]; 
    int number[MAXN+1], i; 
    int last_number, actual_number;
    EDGE *givenedge;

    for (i = 0; i < nv; i++) number[i] = 0;

    *code=nv; code++;
    if (code_edge==NULL) givenedge=firstedge[0]; 
    else { givenedge=code_edge->invers; number[nv]=0; }
    number[givenedge->start] = 1; 
    if (givenedge->start != givenedge->end)
      {
	number[givenedge->end] = 2;
	last_number = 2;
	startedge[1] = givenedge->invers;
      }
    else  last_number = 1;  

    actual_number = 1;
    temp = givenedge;

    while (last_number < nv)
    {   *code=number[temp->end]; code++;
        for (run = temp->prev; run != temp; run = run->prev)
          { vertex = run->end;
            if (!number[vertex])
              { startedge[last_number] = run->invers;
                last_number++; number[vertex] = last_number; 
                *code = last_number; }
            else *code = number[vertex]; 
            code++;
          }
        *code = 0;  code++;
        temp = startedge[actual_number];  actual_number++;
    }

    while (actual_number <= nv) 
    {  	*code=number[temp->end]; code++;
        for (run = temp->prev; run != temp; run = run->prev)
          { 
            *code = number[run->end]; code++;
          }
        *code = 0;
        code++;
        temp = startedge[actual_number];  actual_number++;
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x2e0, %rsp            # imm = 0x2E0
movq %rdi, -0x8(%rbp)
movl $0x0, -0x344(%rbp)
movl -0x344(%rbp), %eax
cmpl 0x24f8fb(%rip), %eax    # 0x25a620
jge 0xad4a
movslq -0x344(%rbp), %rax
movl $0x0, -0x340(%rbp,%rax,4)
movl -0x344(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x344(%rbp)
jmp 0xad19
movl 0x24f8d0(%rip), %eax    # 0x25a620
movb %al, %cl
movq -0x8(%rbp), %rax
movb %cl, (%rax)
movq -0x8(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x8(%rbp)
cmpq $0x0, 0x24f8bc(%rip)    # 0x25a628
jne 0xad7e
movq 0x32c8b(%rip), %rax     # 0x3da00
movq %rax, -0x358(%rbp)
jmp 0xada2
movq 0x24f8a3(%rip), %rax    # 0x25a628
movq 0x20(%rax), %rax
movq %rax, -0x358(%rbp)
movslq 0x24f889(%rip), %rax    # 0x25a620
movl $0x0, -0x340(%rbp,%rax,4)
movq -0x358(%rbp), %rax
movslq (%rax), %rax
movl $0x1, -0x340(%rbp,%rax,4)
movq -0x358(%rbp), %rax
movl (%rax), %eax
movq -0x358(%rbp), %rcx
cmpl 0x4(%rcx), %eax
je 0xae00
movq -0x358(%rbp), %rax
movslq 0x4(%rax), %rax
movl $0x2, -0x340(%rbp,%rax,4)
movl $0x2, -0x348(%rbp)
movq -0x358(%rbp), %rax
movq 0x20(%rax), %rax
movq %rax, -0x228(%rbp)
jmp 0xae0a
movl $0x1, -0x348(%rbp)
movl $0x1, -0x34c(%rbp)
movq -0x358(%rbp), %rax
movq %rax, -0x20(%rbp)
movl -0x348(%rbp), %eax
cmpl 0x24f7f5(%rip), %eax    # 0x25a620
jge 0xaf37
movq -0x20(%rbp), %rax
movslq 0x4(%rax), %rax
movl -0x340(%rbp,%rax,4), %eax
movb %al, %cl
movq -0x8(%rbp), %rax
movb %cl, (%rax)
movq -0x8(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x8(%rbp)
movq -0x20(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rax
cmpq -0x20(%rbp), %rax
je 0xaefd
movq -0x10(%rbp), %rax
movl 0x4(%rax), %eax
movl %eax, -0x14(%rbp)
movslq -0x14(%rbp), %rax
cmpl $0x0, -0x340(%rbp,%rax,4)
jne 0xaecd
movq -0x10(%rbp), %rax
movq 0x20(%rax), %rcx
movslq -0x348(%rbp), %rax
movq %rcx, -0x230(%rbp,%rax,8)
movl -0x348(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x348(%rbp)
movl -0x348(%rbp), %ecx
movslq -0x14(%rbp), %rax
movl %ecx, -0x340(%rbp,%rax,4)
movl -0x348(%rbp), %eax
movb %al, %cl
movq -0x8(%rbp), %rax
movb %cl, (%rax)
jmp 0xaee0
movslq -0x14(%rbp), %rax
movl -0x340(%rbp,%rax,4), %eax
movb %al, %cl
movq -0x8(%rbp), %rax
movb %cl, (%rax)
movq -0x8(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x8(%rbp)
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x10(%rbp)
jmp 0xae60
movq -0x8(%rbp), %rax
movb $0x0, (%rax)
movq -0x8(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x8(%rbp)
movslq -0x34c(%rbp), %rax
movq -0x230(%rbp,%rax,8), %rax
movq %rax, -0x20(%rbp)
movl -0x34c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x34c(%rbp)
jmp 0xae1f
jmp 0xaf39
movl -0x34c(%rbp), %eax
cmpl 0x24f6db(%rip), %eax    # 0x25a620
jg 0xafef
movq -0x20(%rbp), %rax
movslq 0x4(%rax), %rax
movl -0x340(%rbp,%rax,4), %eax
movb %al, %cl
movq -0x8(%rbp), %rax
movb %cl, (%rax)
movq -0x8(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x8(%rbp)
movq -0x20(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rax
cmpq -0x20(%rbp), %rax
je 0xafb5
movq -0x10(%rbp), %rax
movslq 0x4(%rax), %rax
movl -0x340(%rbp,%rax,4), %eax
movb %al, %cl
movq -0x8(%rbp), %rax
movb %cl, (%rax)
movq -0x8(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x8(%rbp)
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x10(%rbp)
jmp 0xaf7a
movq -0x8(%rbp), %rax
movb $0x0, (%rax)
movq -0x8(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x8(%rbp)
movslq -0x34c(%rbp), %rax
movq -0x230(%rbp,%rax,8), %rax
movq %rax, -0x20(%rbp)
movl -0x34c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x34c(%rbp)
jmp 0xaf39
addq $0x2e0, %rsp            # imm = 0x2E0
popq %rbp
retq
nopl (%rax,%rax)