// File: /workspace/github_c_makefile_star2_O3/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:
movl 0x2390e1(%rip), %ecx    # 0x244614
movl %ecx, %eax
shrl $0x1f, %eax
addl %ecx, %eax
sarl %eax
subl 0x2390ce(%rip), %eax    # 0x244610
addl $0x2, %eax
movb %al, (%rdi)
movl 0x1ab3f(%rip), %ecx     # 0x2608c
leal 0x2(%rcx), %edx
movl %edx, 0x1ab36(%rip)     # 0x2608c
cmpl $0x752f, %ecx           # imm = 0x752F
jl 0xb58d
movl $0x2, 0x1ab24(%rip)     # 0x2608c
movl $0x30, %ecx
leaq 0x2390ac(%rip), %rdx    # 0x244620
movl $0x0, (%rcx,%rdx)
addq $0x40, %rcx
cmpq $0x46630, %rcx          # imm = 0x46630
jne 0xb574
movl $0x2, %edx
subq $0x368, %rsp            # imm = 0x368
movq 0x23907d(%rip), %rcx    # 0x244618
leaq 0x20(%rcx), %rsi
testq %rcx, %rcx
leaq 0x1c447(%rip), %rcx     # 0x279f0
cmovneq %rsi, %rcx
movq (%rcx), %r8
movq %r8, %rcx
movl %edx, 0x30(%rcx)
movl $0x1, 0x8(%rcx)
movq 0x20(%rcx), %rcx
movq 0x10(%rcx), %rcx
cmpq %r8, %rcx
jne 0xb5b3
movq 0x20(%r8), %rcx
movl $0x1, %esi
cmpl %edx, 0x30(%rcx)
jge 0xb605
movq %rcx, %r9
movl %edx, 0x30(%r9)
movl $0x2, 0x8(%r9)
movq 0x20(%r9), %r9
movq 0x10(%r9), %r9
cmpq %rcx, %r9
jne 0xb5db
movq %r8, -0x78(%rsp)
movq 0x20(%r8), %rcx
movl $0x2, %r8d
jmp 0xb60b
movl $0x1, %r8d
cmpl %eax, %r8d
jge 0xb680
movl $0x1, %esi
movb 0x8(%rcx), %r9b
movb %r9b, 0x1(%rdi)
addq $0x2, %rdi
movq 0x20(%rcx), %r9
movq 0x18(%r9), %r9
cmpq %rcx, %r9
je 0xb670
cmpl %edx, 0x30(%r9)
jge 0xb660
movq 0x20(%r9), %r11
movslq %r8d, %r10
movq %r11, -0x80(%rsp,%r10,8)
incl %r10d
movq %r9, %r8
movl %edx, 0x30(%r8)
movl %r10d, 0x8(%r8)
movq 0x20(%r8), %r8
movq 0x10(%r8), %r8
cmpq %r9, %r8
jne 0xb646
movl %r10d, %r8d
jmp 0xb664
movl 0x8(%r9), %r10d
movb %r10b, (%rdi)
incq %rdi
movq 0x20(%r9), %r9
jmp 0xb625
movb $0x0, (%rdi)
movq -0x80(%rsp,%rsi,8), %rcx
incq %rsi
cmpl %eax, %r8d
jl 0xb615
incq %rdi
cmpl %eax, %esi
jg 0xb6d3
movl %esi, %edx
movb 0x8(%rcx), %sil
movb %sil, (%rdi)
movq 0x20(%rcx), %r8
leaq 0x1(%rdi), %rsi
movq 0x18(%r8), %r8
cmpq %rcx, %r8
je 0xb6bc
movb 0x8(%r8), %dil
movb %dil, (%rsi)
movq 0x20(%r8), %rdi
incq %rsi
movq 0x18(%rdi), %r8
cmpq %rcx, %r8
jne 0xb6a1
leaq -0x1(%rsi), %rdi
movb $0x0, (%rsi)
addq $0x2, %rdi
movq -0x80(%rsp,%rdx,8), %rcx
leaq 0x1(%rdx), %rsi
cmpl %edx, %eax
movq %rsi, %rdx
jg 0xb689
addq $0x368, %rsp            # imm = 0x368
retq