// File: /workspace/github_c_makefile_star2_O2/mishun[P]plantri/plantri.c
// Function: testcanon_mirror
static int 
testcanon_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. Comments see testcanon -- it is exactly the same except for 
   the orientation */
{
    EDGE *temp, *run;  
    EDGE *startedge[MAXN+1];
    int number[MAXN], i; 
    int last_number, actual_number, vertex;

    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;
                vertex = colour[vertex]; }
            else vertex = number[vertex];
            if (vertex > (*representation)) return 0;
            if (vertex < (*representation)) return 2;
            representation++; 
          }
        if ((*representation) != 0) return 2; 
        representation++;
        temp = startedge[actual_number];  actual_number++; 
    }

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

    return 1;
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x288, %rsp            # imm = 0x288
movl 0x2373e6(%rip), %eax    # 0x242600
xorl %ecx, %ecx
testl %eax, %eax
movl $0x0, %r8d
cmovgl %eax, %r8d
cmpq %rcx, %r8
je 0xb237
andl $0x0, -0x80(%rsp,%rcx,4)
incq %rcx
jmp 0xb228
movslq (%rdi), %r9
movl $0x1, -0x80(%rsp,%r9,4)
movslq 0x4(%rdi), %r8
movl $0x2, %ecx
cmpl %r8d, %r9d
jne 0xb259
movl $0x1, %r10d
jmp 0xb271
movl $0x2, -0x80(%rsp,%r8,4)
movq 0x20(%rdi), %r8
movq %r8, 0x88(%rsp)
movl %ecx, %r10d
movabsq $0x1, %r8
xorl %r9d, %r9d
cmpl %eax, %r10d
jge 0xb2de
addq $0x4, %rsi
movq %rdi, %r11
movq 0x10(%r11), %r11
cmpq %rdi, %r11
je 0xb2c8
movslq 0x4(%r11), %r14
movl -0x80(%rsp,%r14,4), %ebx
testl %ebx, %ebx
jne 0xb2bb
movq 0x20(%r11), %rbx
movslq %r10d, %r10
movq %rbx, 0x80(%rsp,%r10,8)
incl %r10d
movl %r10d, -0x80(%rsp,%r14,4)
movl (%rdx,%r14,4), %ebx
cmpl -0x4(%rsi), %ebx
jg 0xb330
jl 0xb32c
addq $0x4, %rsi
jmp 0xb28a
cmpl $0x0, -0x4(%rsi)
jne 0xb32c
movq 0x80(%rsp,%r8,8), %rdi
incq %r8
incl %r9d
jmp 0xb27e
cmpl %r9d, %eax
cmovgl %eax, %r9d
incl %r9d
movl $0x1, %eax
cmpq %r9, %r8
je 0xb332
addq $0x4, %rsi
movq %rdi, %rdx
movq 0x10(%rdx), %rdx
cmpq %rdi, %rdx
je 0xb319
movslq 0x4(%rdx), %r10
movl -0x4(%rsi), %r11d
cmpl %r11d, -0x80(%rsp,%r10,4)
jg 0xb330
jl 0xb32c
addq $0x4, %rsi
jmp 0xb2f9
cmpl $0x0, -0x4(%rsi)
jne 0xb32c
movq 0x80(%rsp,%r8,8), %rdi
incq %r8
jmp 0xb2ed
movl %ecx, %eax
jmp 0xb332
xorl %eax, %eax
addq $0x288, %rsp            # imm = 0x288
popq %rbx
popq %r14
retq