// File: /workspace/github_c_makefile_star2_O0/mishun[P]plantri/plantri.c
// Function: compute_dual_code_mirror
static void
compute_dual_code_mirror(unsigned char code[])
 
/* works like compute_code_mirror -- only for the dual */

{
    register EDGE *run, *run2;
    EDGE *temp;  
    EDGE *startedge[MAXF+1]; 
    int number[MAXF+1], i; 
    int last_number, actual_number;
    int nf;
    EDGE *givenedge;

    nf=2+(ne/2)-nv;
    *code=nf; code++;
    RESETMARKS; /* The face on the right has already been numbered
                   if and only if it is marked. */
    for (i = 0; i < nf; i++) number[i] = 0;
 
    if (code_edge==NULL) givenedge=firstedge[0];
    else givenedge=code_edge->invers;

    run=givenedge;
    do { MARKLO(run); run->rightface=1; run=run->invers->prev;
       } while (run!=givenedge);
    if (!ISMARKED(givenedge->invers)) /* no loop in the dual at this point */
      { run2=run=givenedge->invers;
        do { MARKLO(run2); run2->rightface=2; run2=run2->invers->prev;
           } while (run2!=run);
	last_number = 2;
	startedge[1] = givenedge; /* the startedge has the face it
				     belongs to on the LEFT */
      }
    else  last_number = 1;  

    actual_number = 1;
    temp = givenedge->invers;

    while (last_number < nf)
    {   
        *code= temp->rightface; code++;
        for (run = temp->invers->next; run != temp; run = run->invers->next)
	  /* run also has the face it runs around on the left */
          { if (!ISMARKED(run))
	    { startedge[last_number] = run->invers;
              last_number++;
	      run2=run;
	      do
		{ MARKLO(run2); run2->rightface=last_number;
		  run2=run2->invers->prev;
                } while (run2!=run);
	      *code = last_number;
	    }
	  else *code=run->rightface;
	  code++;
	  }
        *code = 0;  code++;
        temp = startedge[actual_number];  actual_number++;
    }

    while (actual_number <= nf) 
    {  	*code=temp->rightface; code++;
        for (run = temp->invers->next; run != temp; run = run->invers->next)
          { 
            *code = run->rightface; code++;
          }
        *code = 0;
        code++;
        temp = startedge[actual_number];  actual_number++;
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x5b0, %rsp            # imm = 0x5B0
movq %rdi, -0x8(%rbp)
movl 0x24f22f(%rip), %eax    # 0x25a624
movl $0x2, %ecx
cltd
idivl %ecx
addl $0x2, %eax
subl 0x24f21a(%rip), %eax    # 0x25a620
movl %eax, -0x620(%rbp)
movl -0x620(%rbp), %eax
movb %al, %cl
movq -0x8(%rbp), %rax
movb %cl, (%rax)
movq -0x8(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x8(%rbp)
movl 0x30c58(%rip), %eax     # 0x3c084
addl $0x2, %eax
movl %eax, 0x30c4f(%rip)     # 0x3c084
cmpl $0x7530, %eax           # imm = 0x7530
jle 0xb48b
movl $0x2, 0x30c3e(%rip)     # 0x3c084
movl $0x0, -0x62c(%rbp)
cmpl $0x1198, -0x62c(%rbp)   # imm = 0x1198
jge 0xb489
movslq -0x62c(%rbp), %rcx
leaq 0x24f1c6(%rip), %rax    # 0x25a630
shlq $0x6, %rcx
addq %rcx, %rax
movl $0x0, 0x30(%rax)
movl -0x62c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x62c(%rbp)
jmp 0xb450
jmp 0xb48b
movl $0x0, -0x614(%rbp)
movl -0x614(%rbp), %eax
cmpl -0x620(%rbp), %eax
jge 0xb4c6
movslq -0x614(%rbp), %rax
movl $0x0, -0x610(%rbp,%rax,4)
movl -0x614(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x614(%rbp)
jmp 0xb495
cmpq $0x0, 0x24f15a(%rip)    # 0x25a628
jne 0xb4e0
movq 0x32529(%rip), %rax     # 0x3da00
movq %rax, -0x628(%rbp)
jmp 0xb4f2
movq 0x24f141(%rip), %rax    # 0x25a628
movq 0x20(%rax), %rax
movq %rax, -0x628(%rbp)
movq -0x628(%rbp), %rax
movq %rax, -0x10(%rbp)
movl 0x30b81(%rip), %ecx     # 0x3c084
movq -0x10(%rbp), %rax
movl %ecx, 0x30(%rax)
movq -0x10(%rbp), %rax
movl $0x1, 0x8(%rax)
movq -0x10(%rbp), %rax
movq 0x20(%rax), %rax
movq 0x10(%rax), %rax
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rax
cmpq -0x628(%rbp), %rax
jne 0xb4fd
movq -0x628(%rbp), %rax
movq 0x20(%rax), %rax
movl 0x30(%rax), %eax
cmpl 0x30b3e(%rip), %eax     # 0x3c084
jge 0xb5a7
movq -0x628(%rbp), %rax
movq 0x20(%rax), %rax
movq %rax, -0x10(%rbp)
movq %rax, -0x18(%rbp)
movl 0x30b23(%rip), %ecx     # 0x3c084
movq -0x18(%rbp), %rax
movl %ecx, 0x30(%rax)
movq -0x18(%rbp), %rax
movl $0x2, 0x8(%rax)
movq -0x18(%rbp), %rax
movq 0x20(%rax), %rax
movq 0x10(%rax), %rax
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rax
cmpq -0x10(%rbp), %rax
jne 0xb55b
movl $0x2, -0x618(%rbp)
movq -0x628(%rbp), %rax
movq %rax, -0x408(%rbp)
jmp 0xb5b1
movl $0x1, -0x618(%rbp)
movl $0x1, -0x61c(%rbp)
movq -0x628(%rbp), %rax
movq 0x20(%rax), %rax
movq %rax, -0x20(%rbp)
movl -0x618(%rbp), %eax
cmpl -0x620(%rbp), %eax
jge 0xb700
movq -0x20(%rbp), %rax
movl 0x8(%rax), %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 0x20(%rax), %rax
movq 0x18(%rax), %rax
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rax
cmpq -0x20(%rbp), %rax
je 0xb6c6
movq -0x10(%rbp), %rax
movl 0x30(%rax), %eax
cmpl 0x30a62(%rip), %eax     # 0x3c084
jge 0xb696
movq -0x10(%rbp), %rax
movq 0x20(%rax), %rcx
movslq -0x618(%rbp), %rax
movq %rcx, -0x410(%rbp,%rax,8)
movl -0x618(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x618(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x18(%rbp)
movl 0x30a2c(%rip), %ecx     # 0x3c084
movq -0x18(%rbp), %rax
movl %ecx, 0x30(%rax)
movl -0x618(%rbp), %ecx
movq -0x18(%rbp), %rax
movl %ecx, 0x8(%rax)
movq -0x18(%rbp), %rax
movq 0x20(%rax), %rax
movq 0x10(%rax), %rax
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rax
cmpq -0x10(%rbp), %rax
jne 0xb652
movl -0x618(%rbp), %eax
movb %al, %cl
movq -0x8(%rbp), %rax
movb %cl, (%rax)
jmp 0xb6a5
movq -0x10(%rbp), %rax
movl 0x8(%rax), %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 0x20(%rax), %rax
movq 0x18(%rax), %rax
movq %rax, -0x10(%rbp)
jmp 0xb607
movq -0x8(%rbp), %rax
movb $0x0, (%rax)
movq -0x8(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x8(%rbp)
movslq -0x61c(%rbp), %rax
movq -0x410(%rbp,%rax,8), %rax
movq %rax, -0x20(%rbp)
movl -0x61c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x61c(%rbp)
jmp 0xb5ca
jmp 0xb702
movl -0x61c(%rbp), %eax
cmpl -0x620(%rbp), %eax
jg 0xb7b0
movq -0x20(%rbp), %rax
movl 0x8(%rax), %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 0x20(%rax), %rax
movq 0x18(%rax), %rax
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rax
cmpq -0x20(%rbp), %rax
je 0xb776
movq -0x10(%rbp), %rax
movl 0x8(%rax), %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 0x20(%rax), %rax
movq 0x18(%rax), %rax
movq %rax, -0x10(%rbp)
jmp 0xb73f
movq -0x8(%rbp), %rax
movb $0x0, (%rax)
movq -0x8(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x8(%rbp)
movslq -0x61c(%rbp), %rax
movq -0x410(%rbp,%rax,8), %rax
movq %rax, -0x20(%rbp)
movl -0x61c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x61c(%rbp)
jmp 0xb702
addq $0x5b0, %rsp            # imm = 0x5B0
popq %rbp
retq
nopl (%rax)