// File: /workspace/github_c_makefile_star2_O1/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 0x239353(%rip), %ecx    # 0x244614
movl %ecx, %eax
shrl $0x1f, %eax
addl %ecx, %eax
sarl %eax
subl 0x239340(%rip), %eax    # 0x244610
addl $0x2, %eax
movb %al, (%rdi)
movl 0x1adb9(%rip), %ecx     # 0x26094
leal 0x2(%rcx), %edx
movl %edx, 0x1adb0(%rip)     # 0x26094
cmpl $0x752f, %ecx           # imm = 0x752F
jl 0xb316
movl $0x2, 0x1ad9e(%rip)     # 0x26094
movl $0x30, %ecx
leaq 0x23931e(%rip), %rdx    # 0x244620
movl $0x0, (%rcx,%rdx)
addq $0x40, %rcx
cmpq $0x46630, %rcx          # imm = 0x46630
jne 0xb302
subq $0x368, %rsp            # imm = 0x368
movq 0x2392f4(%rip), %rcx    # 0x244618
leaq 0x20(%rcx), %rdx
testq %rcx, %rcx
leaq 0x1c6be(%rip), %rcx     # 0x279f0
cmovneq %rdx, %rcx
movq (%rcx), %rcx
movl 0x1ad55(%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 0xb342
movq 0x20(%rcx), %r9
movl $0x1, %edx
movl $0x1, %r8d
cmpl %esi, 0x30(%r9)
jge 0xb395
movq %r9, %r8
movl %esi, 0x30(%r8)
movl $0x2, 0x8(%r8)
movq 0x20(%r8), %r8
movq 0x10(%r8), %r8
cmpq %r9, %r8
jne 0xb371
movq %rcx, -0x78(%rsp)
movl $0x2, %r8d
movq 0x20(%rcx), %rcx
cmpl %eax, %r8d
jge 0xb40e
movl $0x1, %edx
movb 0x8(%rcx), %r9b
movb %r9b, 0x1(%rdi)
addq $0x2, %rdi
movq 0x10(%rcx), %r9
movq 0x20(%r9), %r9
cmpq %rcx, %r9
je 0xb3fe
cmpl %esi, 0x30(%r9)
jge 0xb3ee
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 0xb3d4
movl %r10d, %r8d
jmp 0xb3f2
movl 0x8(%r9), %r10d
movb %r10b, (%rdi)
incq %rdi
movq 0x10(%r9), %r9
jmp 0xb3b3
movb $0x0, (%rdi)
movq -0x80(%rsp,%rdx,8), %rcx
incq %rdx
cmpl %eax, %r8d
jl 0xb3a3
incq %rdi
cmpl %eax, %edx
jg 0xb461
movl %edx, %edx
movb 0x8(%rcx), %sil
movb %sil, (%rdi)
movq 0x10(%rcx), %r8
leaq 0x1(%rdi), %rsi
movq 0x20(%r8), %r8
cmpq %rcx, %r8
je 0xb44a
movb 0x8(%r8), %dil
movb %dil, (%rsi)
movq 0x10(%r8), %rdi
incq %rsi
movq 0x20(%rdi), %r8
cmpq %rcx, %r8
jne 0xb42f
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 0xb417
addq $0x368, %rsp            # imm = 0x368
retq