// File: /workspace/github_c_makefile_star2_O0/mishun[P]plantri/plantri.c
// Function: testcanon_first_init_mirror
static void
testcanon_first_init_mirror(EDGE *givenedge, int representation[],
			    int colour[])

/* Tests whether starting from a given edge and constructing the code in
   "->prev" direction, an automorphism or even a better representation can
   be found. A better representation will be completely constructed and
   returned in "representation".  It works pretty similar to testcanon except
   for obviously necessary changes, so for extensive comments see testcanon */
{
    register EDGE *run;
    register int vertex;
    EDGE *temp;  
    EDGE *startedge[MAXN+1]; 
    int number[MAXN], i; 
    int last_number, actual_number;
 
    for (i = 0; i < nv; i++) number[i] = 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)
    {  
        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; 
                *representation = colour[vertex]; }
            else *representation = number[vertex]; 
            representation++;
          }
        *representation = 0;
        representation++;
        temp = startedge[actual_number];  actual_number++;
    }

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

    return;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x2d0, %rsp            # imm = 0x2D0
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movl $0x0, -0x344(%rbp)
movl -0x344(%rbp), %eax
cmpl 0x247763(%rip), %eax    # 0x25a620
jge 0x12ee2
movslq -0x344(%rbp), %rax
movl $0x0, -0x340(%rbp,%rax,4)
movl -0x344(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x344(%rbp)
jmp 0x12eb1
movq -0x8(%rbp), %rax
movslq (%rax), %rax
movl $0x1, -0x340(%rbp,%rax,4)
movq -0x8(%rbp), %rax
movl (%rax), %eax
movq -0x8(%rbp), %rcx
cmpl 0x4(%rcx), %eax
je 0x12f31
movq -0x8(%rbp), %rax
movslq 0x4(%rax), %rax
movl $0x2, -0x340(%rbp,%rax,4)
movl $0x2, -0x348(%rbp)
movq -0x8(%rbp), %rax
movq 0x20(%rax), %rax
movq %rax, -0x238(%rbp)
jmp 0x12f3b
movl $0x1, -0x348(%rbp)
movl $0x1, -0x34c(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x30(%rbp)
movl -0x348(%rbp), %eax
cmpl 0x2476c7(%rip), %eax    # 0x25a620
jge 0x13046
movq -0x30(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
cmpq -0x30(%rbp), %rax
je 0x13009
movq -0x20(%rbp), %rax
movl 0x4(%rax), %eax
movl %eax, -0x24(%rbp)
movslq -0x24(%rbp), %rax
cmpl $0x0, -0x340(%rbp,%rax,4)
jne 0x12fdb
movq -0x20(%rbp), %rax
movq 0x20(%rax), %rcx
movslq -0x348(%rbp), %rax
movq %rcx, -0x240(%rbp,%rax,8)
movl -0x348(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x348(%rbp)
movl -0x348(%rbp), %ecx
movslq -0x24(%rbp), %rax
movl %ecx, -0x340(%rbp,%rax,4)
movq -0x18(%rbp), %rax
movslq -0x24(%rbp), %rcx
movl (%rax,%rcx,4), %ecx
movq -0x10(%rbp), %rax
movl %ecx, (%rax)
jmp 0x12fec
movslq -0x24(%rbp), %rax
movl -0x340(%rbp,%rax,4), %ecx
movq -0x10(%rbp), %rax
movl %ecx, (%rax)
movq -0x10(%rbp), %rax
addq $0x4, %rax
movq %rax, -0x10(%rbp)
movq -0x20(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x20(%rbp)
jmp 0x12f6b
movq -0x10(%rbp), %rax
movl $0x0, (%rax)
movq -0x10(%rbp), %rax
addq $0x4, %rax
movq %rax, -0x10(%rbp)
movslq -0x34c(%rbp), %rax
movq -0x240(%rbp,%rax,8), %rax
movq %rax, -0x30(%rbp)
movl -0x34c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x34c(%rbp)
jmp 0x12f4d
jmp 0x13048
movl -0x34c(%rbp), %eax
cmpl 0x2475cc(%rip), %eax    # 0x25a620
jg 0x130dc
movq -0x30(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
cmpq -0x30(%rbp), %rax
je 0x1309f
movq -0x20(%rbp), %rax
movslq 0x4(%rax), %rax
movl -0x340(%rbp,%rax,4), %ecx
movq -0x10(%rbp), %rax
movl %ecx, (%rax)
movq -0x10(%rbp), %rax
addq $0x4, %rax
movq %rax, -0x10(%rbp)
movq -0x20(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x20(%rbp)
jmp 0x13066
movq -0x10(%rbp), %rax
movl $0x0, (%rax)
movq -0x10(%rbp), %rax
addq $0x4, %rax
movq %rax, -0x10(%rbp)
movslq -0x34c(%rbp), %rax
movq -0x240(%rbp,%rax,8), %rax
movq %rax, -0x30(%rbp)
movl -0x34c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x34c(%rbp)
jmp 0x13048
addq $0x2d0, %rsp            # imm = 0x2D0
popq %rbp
retq
nopw %cs:(%rax,%rax)