// File: /workspace/github_c_makefile_star2_O3/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 0x23928f(%rip), %ecx    # 0x244614
movl %ecx, %eax
shrl $0x1f, %eax
addl %ecx, %eax
sarl %eax
subl 0x23927c(%rip), %eax    # 0x244610
addl $0x2, %eax
movb %al, (%rdi)
movl 0x1aced(%rip), %ecx     # 0x2608c
leal 0x2(%rcx), %edx
movl %edx, 0x1ace4(%rip)     # 0x2608c
cmpl $0x752f, %ecx           # imm = 0x752F
jl 0xb3df
movl $0x2, 0x1acd2(%rip)     # 0x2608c
movl $0x30, %ecx
leaq 0x23925a(%rip), %rdx    # 0x244620
movl $0x0, (%rcx,%rdx)
addq $0x40, %rcx
cmpq $0x46630, %rcx          # imm = 0x46630
jne 0xb3c6
movl $0x2, %edx
subq $0x368, %rsp            # imm = 0x368
movq 0x23922b(%rip), %rcx    # 0x244618
leaq 0x20(%rcx), %rsi
testq %rcx, %rcx
leaq 0x1c5f5(%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 0xb405
movq 0x20(%r8), %rcx
movl $0x1, %esi
cmpl %edx, 0x30(%rcx)
jge 0xb457
movq %rcx, %r9
movl %edx, 0x30(%r9)
movl $0x2, 0x8(%r9)
movq 0x20(%r9), %r9
movq 0x10(%r9), %r9
cmpq %rcx, %r9
jne 0xb42d
movq %r8, -0x78(%rsp)
movq 0x20(%r8), %rcx
movl $0x2, %r8d
jmp 0xb45d
movl $0x1, %r8d
cmpl %eax, %r8d
jge 0xb4d2
movl $0x1, %esi
movb 0x8(%rcx), %r9b
movb %r9b, 0x1(%rdi)
addq $0x2, %rdi
movq 0x10(%rcx), %r9
movq 0x20(%r9), %r9
cmpq %rcx, %r9
je 0xb4c2
cmpl %edx, 0x30(%r9)
jge 0xb4b2
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 0xb498
movl %r10d, %r8d
jmp 0xb4b6
movl 0x8(%r9), %r10d
movb %r10b, (%rdi)
incq %rdi
movq 0x10(%r9), %r9
jmp 0xb477
movb $0x0, (%rdi)
movq -0x80(%rsp,%rsi,8), %rcx
incq %rsi
cmpl %eax, %r8d
jl 0xb467
incq %rdi
cmpl %eax, %esi
jg 0xb525
movl %esi, %edx
movb 0x8(%rcx), %sil
movb %sil, (%rdi)
movq 0x10(%rcx), %r8
leaq 0x1(%rdi), %rsi
movq 0x20(%r8), %r8
cmpq %rcx, %r8
je 0xb50e
movb 0x8(%r8), %dil
movb %dil, (%rsi)
movq 0x10(%r8), %rdi
incq %rsi
movq 0x20(%rdi), %r8
cmpq %rcx, %r8
jne 0xb4f3
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 0xb4db
addq $0x368, %rsp            # imm = 0x368
retq