// File: /workspace/github_c_makefile_star2_O2/mishun[P]plantri/plantri.c
// Function: compute_dual_code
static void
compute_dual_code(unsigned char code[])
 
/* works like compute_code -- 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->prev->invers; run != temp; run = run->prev->invers)
	  /* 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->prev->invers; run != temp; run = run->prev->invers)
          { 
            *code = run->rightface; code++;
          }
        *code = 0;
        code++;
        temp = startedge[actual_number];  actual_number++;
    }
}

// Assembly:
movl 0x2380eb(%rip), %eax    # 0x242604
movl $0x2, %esi
cltd
idivl %esi
subl 0x2380d9(%rip), %eax    # 0x242600
addl $0x2, %eax
movb %al, (%rdi)
movl 0x19b4a(%rip), %edx     # 0x2407c
leal 0x2(%rdx), %ecx
movl %ecx, 0x19b41(%rip)     # 0x2407c
cmpl $0x752f, %edx           # imm = 0x752F
jl 0xa577
movl $0x2, 0x19b2f(%rip)     # 0x2407c
movabsq $0x30, %rdx
movl $0x2, %ecx
leaq 0x2380ad(%rip), %r8     # 0x242610
cmpq $0x46630, %rdx          # imm = 0x46630
je 0xa577
andl $0x0, (%rdx,%r8)
addq $0x40, %rdx
jmp 0xa563
pushq %rbx
subq $0x370, %rsp            # imm = 0x370
movq 0x238082(%rip), %rdx    # 0x242608
leaq 0x20(%rdx), %r8
testq %rdx, %rdx
leaq 0x1b44c(%rip), %rdx     # 0x259e0
cmovneq %r8, %rdx
movq (%rdx), %r8
movq %r8, %rdx
movl %ecx, 0x30(%rdx)
movl $0x1, 0x8(%rdx)
movq 0x20(%rdx), %rdx
movq 0x10(%rdx), %rdx
cmpq %r8, %rdx
jne 0xa59e
movq 0x20(%r8), %rdx
cmpl %ecx, 0x30(%rdx)
jge 0xa5e1
movq %rdx, %r9
movl %ecx, 0x30(%r9)
movl $0x2, 0x8(%r9)
movq 0x20(%r9), %r9
movq 0x10(%r9), %r9
cmpq %rdx, %r9
jne 0xa5c1
movq %r8, -0x78(%rsp)
jmp 0xa5e6
movl $0x1, %esi
addq $0x20, %r8
movabsq $0x1, %rdx
xorl %r9d, %r9d
movq (%r8), %r8
cmpl %eax, %esi
jge 0xa66a
movb 0x8(%r8), %r10b
movb %r10b, 0x1(%rdi)
addq $0x2, %rdi
movq %r8, %r10
movq 0x10(%r10), %r10
movq 0x20(%r10), %r10
cmpq %r8, %r10
je 0xa657
cmpl %ecx, 0x30(%r10)
jge 0xa64b
movq 0x20(%r10), %rbx
movslq %esi, %r11
movq %rbx, -0x80(%rsp,%r11,8)
incl %r11d
movq %r10, %rsi
movl %ecx, 0x30(%rsi)
movl %r11d, 0x8(%rsi)
movq 0x20(%rsi), %rsi
movq 0x10(%rsi), %rsi
cmpq %r10, %rsi
jne 0xa632
movl %r11d, %esi
jmp 0xa64f
movl 0x8(%r10), %r11d
movb %r11b, (%rdi)
incq %rdi
jmp 0xa60d
movb $0x0, (%rdi)
leaq (%rsp,%rdx,8), %r8
addq $-0x80, %r8
incq %rdx
incl %r9d
jmp 0xa5f7
incq %rdi
cmpl %eax, %r9d
cmovgl %r9d, %eax
incl %eax
cmpq %rax, %rdx
je 0xa6a7
incq %rdi
movq %r8, %rcx
movb 0x8(%rcx), %sil
movb %sil, -0x1(%rdi)
movq 0x10(%rcx), %rcx
movq 0x20(%rcx), %rcx
incq %rdi
cmpq %r8, %rcx
jne 0xa681
movb $0x0, -0x1(%rdi)
movq -0x80(%rsp,%rdx,8), %r8
incq %rdx
jmp 0xa676
addq $0x370, %rsp            # imm = 0x370
popq %rbx
retq