// File: /workspace/github_c_makefile_star2_O1/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 0x2391a5(%rip), %ecx    # 0x244614
movl %ecx, %eax
shrl $0x1f, %eax
addl %ecx, %eax
sarl %eax
subl 0x239192(%rip), %eax    # 0x244610
addl $0x2, %eax
movb %al, (%rdi)
movl 0x1ac0b(%rip), %ecx     # 0x26094
leal 0x2(%rcx), %edx
movl %edx, 0x1ac02(%rip)     # 0x26094
cmpl $0x752f, %ecx           # imm = 0x752F
jl 0xb4c4
movl $0x2, 0x1abf0(%rip)     # 0x26094
movl $0x30, %ecx
leaq 0x239170(%rip), %rdx    # 0x244620
movl $0x0, (%rcx,%rdx)
addq $0x40, %rcx
cmpq $0x46630, %rcx          # imm = 0x46630
jne 0xb4b0
subq $0x368, %rsp            # imm = 0x368
movq 0x239146(%rip), %rcx    # 0x244618
leaq 0x20(%rcx), %rdx
testq %rcx, %rcx
leaq 0x1c510(%rip), %rcx     # 0x279f0
cmovneq %rdx, %rcx
movq (%rcx), %rcx
movl 0x1aba7(%rip), %esi     # 0x26094
movq %rcx, %rdx
movl %esi, 0x30(%rdx)
movl $0x1, 0x8(%rdx)
movq 0x20(%rdx), %rdx
movq 0x10(%rdx), %rdx
cmpq %rcx, %rdx
jne 0xb4f0
movq 0x20(%rcx), %r9
movl $0x1, %edx
movl $0x1, %r8d
cmpl %esi, 0x30(%r9)
jge 0xb543
movq %r9, %r8
movl %esi, 0x30(%r8)
movl $0x2, 0x8(%r8)
movq 0x20(%r8), %r8
movq 0x10(%r8), %r8
cmpq %r9, %r8
jne 0xb51f
movq %rcx, -0x78(%rsp)
movl $0x2, %r8d
movq 0x20(%rcx), %rcx
cmpl %eax, %r8d
jge 0xb5bc
movl $0x1, %edx
movb 0x8(%rcx), %r9b
movb %r9b, 0x1(%rdi)
addq $0x2, %rdi
movq 0x20(%rcx), %r9
movq 0x18(%r9), %r9
cmpq %rcx, %r9
je 0xb5ac
cmpl %esi, 0x30(%r9)
jge 0xb59c
movq 0x20(%r9), %r11
movslq %r8d, %r10
movq %r11, -0x80(%rsp,%r10,8)
incl %r10d
movq %r9, %r8
movl %esi, 0x30(%r8)
movl %r10d, 0x8(%r8)
movq 0x20(%r8), %r8
movq 0x10(%r8), %r8
cmpq %r9, %r8
jne 0xb582
movl %r10d, %r8d
jmp 0xb5a0
movl 0x8(%r9), %r10d
movb %r10b, (%rdi)
incq %rdi
movq 0x20(%r9), %r9
jmp 0xb561
movb $0x0, (%rdi)
movq -0x80(%rsp,%rdx,8), %rcx
incq %rdx
cmpl %eax, %r8d
jl 0xb551
incq %rdi
cmpl %eax, %edx
jg 0xb60f
movl %edx, %edx
movb 0x8(%rcx), %sil
movb %sil, (%rdi)
movq 0x20(%rcx), %r8
leaq 0x1(%rdi), %rsi
movq 0x18(%r8), %r8
cmpq %rcx, %r8
je 0xb5f8
movb 0x8(%r8), %dil
movb %dil, (%rsi)
movq 0x20(%r8), %rdi
incq %rsi
movq 0x18(%rdi), %r8
cmpq %rcx, %r8
jne 0xb5dd
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 0xb5c5
addq $0x368, %rsp            # imm = 0x368
retq