// File: /workspace/github_c_makefile_star2_O0/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:
pushq %rbp
movq %rsp, %rbp
subq $0x5b0, %rsp            # imm = 0x5B0
movq %rdi, -0x8(%rbp)
movl 0x24f60f(%rip), %eax    # 0x25a624
movl $0x2, %ecx
cltd
idivl %ecx
addl $0x2, %eax
subl 0x24f5fa(%rip), %eax    # 0x25a620
movl %eax, -0x620(%rbp)
movl -0x620(%rbp), %eax
movb %al, %cl
movq -0x8(%rbp), %rax
movb %cl, (%rax)
movq -0x8(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x8(%rbp)
movl 0x31038(%rip), %eax     # 0x3c084
addl $0x2, %eax
movl %eax, 0x3102f(%rip)     # 0x3c084
cmpl $0x7530, %eax           # imm = 0x7530
jle 0xb0ab
movl $0x2, 0x3101e(%rip)     # 0x3c084
movl $0x0, -0x62c(%rbp)
cmpl $0x1198, -0x62c(%rbp)   # imm = 0x1198
jge 0xb0a9
movslq -0x62c(%rbp), %rcx
leaq 0x24f5a6(%rip), %rax    # 0x25a630
shlq $0x6, %rcx
addq %rcx, %rax
movl $0x0, 0x30(%rax)
movl -0x62c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x62c(%rbp)
jmp 0xb070
jmp 0xb0ab
movl $0x0, -0x614(%rbp)
movl -0x614(%rbp), %eax
cmpl -0x620(%rbp), %eax
jge 0xb0e6
movslq -0x614(%rbp), %rax
movl $0x0, -0x610(%rbp,%rax,4)
movl -0x614(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x614(%rbp)
jmp 0xb0b5
cmpq $0x0, 0x24f53a(%rip)    # 0x25a628
jne 0xb100
movq 0x32909(%rip), %rax     # 0x3da00
movq %rax, -0x628(%rbp)
jmp 0xb112
movq 0x24f521(%rip), %rax    # 0x25a628
movq 0x20(%rax), %rax
movq %rax, -0x628(%rbp)
movq -0x628(%rbp), %rax
movq %rax, -0x10(%rbp)
movl 0x30f61(%rip), %ecx     # 0x3c084
movq -0x10(%rbp), %rax
movl %ecx, 0x30(%rax)
movq -0x10(%rbp), %rax
movl $0x1, 0x8(%rax)
movq -0x10(%rbp), %rax
movq 0x20(%rax), %rax
movq 0x10(%rax), %rax
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rax
cmpq -0x628(%rbp), %rax
jne 0xb11d
movq -0x628(%rbp), %rax
movq 0x20(%rax), %rax
movl 0x30(%rax), %eax
cmpl 0x30f1e(%rip), %eax     # 0x3c084
jge 0xb1c7
movq -0x628(%rbp), %rax
movq 0x20(%rax), %rax
movq %rax, -0x10(%rbp)
movq %rax, -0x18(%rbp)
movl 0x30f03(%rip), %ecx     # 0x3c084
movq -0x18(%rbp), %rax
movl %ecx, 0x30(%rax)
movq -0x18(%rbp), %rax
movl $0x2, 0x8(%rax)
movq -0x18(%rbp), %rax
movq 0x20(%rax), %rax
movq 0x10(%rax), %rax
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rax
cmpq -0x10(%rbp), %rax
jne 0xb17b
movl $0x2, -0x618(%rbp)
movq -0x628(%rbp), %rax
movq %rax, -0x408(%rbp)
jmp 0xb1d1
movl $0x1, -0x618(%rbp)
movl $0x1, -0x61c(%rbp)
movq -0x628(%rbp), %rax
movq 0x20(%rax), %rax
movq %rax, -0x20(%rbp)
movl -0x618(%rbp), %eax
cmpl -0x620(%rbp), %eax
jge 0xb320
movq -0x20(%rbp), %rax
movl 0x8(%rax), %eax
movb %al, %cl
movq -0x8(%rbp), %rax
movb %cl, (%rax)
movq -0x8(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x8(%rbp)
movq -0x20(%rbp), %rax
movq 0x10(%rax), %rax
movq 0x20(%rax), %rax
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rax
cmpq -0x20(%rbp), %rax
je 0xb2e6
movq -0x10(%rbp), %rax
movl 0x30(%rax), %eax
cmpl 0x30e42(%rip), %eax     # 0x3c084
jge 0xb2b6
movq -0x10(%rbp), %rax
movq 0x20(%rax), %rcx
movslq -0x618(%rbp), %rax
movq %rcx, -0x410(%rbp,%rax,8)
movl -0x618(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x618(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x18(%rbp)
movl 0x30e0c(%rip), %ecx     # 0x3c084
movq -0x18(%rbp), %rax
movl %ecx, 0x30(%rax)
movl -0x618(%rbp), %ecx
movq -0x18(%rbp), %rax
movl %ecx, 0x8(%rax)
movq -0x18(%rbp), %rax
movq 0x20(%rax), %rax
movq 0x10(%rax), %rax
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rax
cmpq -0x10(%rbp), %rax
jne 0xb272
movl -0x618(%rbp), %eax
movb %al, %cl
movq -0x8(%rbp), %rax
movb %cl, (%rax)
jmp 0xb2c5
movq -0x10(%rbp), %rax
movl 0x8(%rax), %eax
movb %al, %cl
movq -0x8(%rbp), %rax
movb %cl, (%rax)
movq -0x8(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x8(%rbp)
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
movq 0x20(%rax), %rax
movq %rax, -0x10(%rbp)
jmp 0xb227
movq -0x8(%rbp), %rax
movb $0x0, (%rax)
movq -0x8(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x8(%rbp)
movslq -0x61c(%rbp), %rax
movq -0x410(%rbp,%rax,8), %rax
movq %rax, -0x20(%rbp)
movl -0x61c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x61c(%rbp)
jmp 0xb1ea
jmp 0xb322
movl -0x61c(%rbp), %eax
cmpl -0x620(%rbp), %eax
jg 0xb3d0
movq -0x20(%rbp), %rax
movl 0x8(%rax), %eax
movb %al, %cl
movq -0x8(%rbp), %rax
movb %cl, (%rax)
movq -0x8(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x8(%rbp)
movq -0x20(%rbp), %rax
movq 0x10(%rax), %rax
movq 0x20(%rax), %rax
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rax
cmpq -0x20(%rbp), %rax
je 0xb396
movq -0x10(%rbp), %rax
movl 0x8(%rax), %eax
movb %al, %cl
movq -0x8(%rbp), %rax
movb %cl, (%rax)
movq -0x8(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x8(%rbp)
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
movq 0x20(%rax), %rax
movq %rax, -0x10(%rbp)
jmp 0xb35f
movq -0x8(%rbp), %rax
movb $0x0, (%rax)
movq -0x8(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x8(%rbp)
movslq -0x61c(%rbp), %rax
movq -0x410(%rbp,%rax,8), %rax
movq %rax, -0x20(%rbp)
movl -0x61c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x61c(%rbp)
jmp 0xb322
addq $0x5b0, %rsp            # imm = 0x5B0
popq %rbp
retq
nopl (%rax)