// File: /workspace/github_c_makefile_star2_O0/mishun[P]plantri/plantri.c
// Function: compute_dual_edgecode
static void
compute_dual_edgecode(unsigned char code[], int *length, int *headerlength)
 
/* See compute_edgecode. It directly computes the code of the dual.
   In case code_edge is given, the first list of edges corresponds
   to the vertex representing the outer face.
*/

{
    register EDGE *run, *start;
    int i,j ; 
    int edgenumber, limitnv;

    RESETMARKS;

    if (missing_vertex>=0) limitnv=nv+1; else limitnv=nv;

    i=ne+(ne/2)-nv+1;

    if (i<256) { *code=i; code++; *length=i+1; *headerlength=1;}
    else 
      { *code=0; code++;
        *code=(2<<4)+1; code++;
	*code=i>>8; code++;
	*code=i&255; code++;
	*headerlength=4;
	*length=i+4;
      }

    if (code_edge==NULL) start=firstedge[0]; 
    else { start=code_edge; }
    run=start;
    edgenumber=0;
    do
      {
	if (ISMARKED(run)) { *code=run->index; code++; }
	else /* so the other side has not yet been visited */
	  { 
	    MARKLO(run->invers); 
          /* numbered but left hand face not yet listed. In case of bridges it can even
	     happen for the first face that the other side is already marked high.*/
	    //run->index is never used in the future
	    run->invers->index=*code=edgenumber; code++;
	    edgenumber++;
	  }
	MARKHI(run); /* is numbered and face on the left has already been listed */
	run=run->prev->invers;
      } while (run!=start);
    *code=255; code++;

    /* that was to make sure that in the case of disc triangulations the right start
       is taken -- now the rest */


    for (i=0;i<limitnv;i++)
      if (i!=missing_vertex)
      for (j=0, start=firstedge[i]; j<degree[i]; j++, start=start->next)
	if (!ISMARKEDHI(start))/* a new face to be coded */
	    {  run=start;
	    do
	      {
		if (ISMARKED(run)) { *code=run->index; code++;}
		else /* so the other side has not yet been visited */
		  {
		  MARKLO(run->invers); 
		  run->invers->index=*code=edgenumber; code++;
		  edgenumber++;
		  }
		MARKHI(run);
		run=run->prev->invers;
	      } while (run!=start);
	    *code=255; code++;
	    }
    return;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movl 0x2f90e(%rip), %eax     # 0x3c084
addl $0x2, %eax
movl %eax, 0x2f905(%rip)     # 0x3c084
cmpl $0x7530, %eax           # imm = 0x7530
jle 0xc7c6
movl $0x2, 0x2f8f4(%rip)     # 0x3c084
movl $0x0, -0x3c(%rbp)
cmpl $0x1198, -0x3c(%rbp)    # imm = 0x1198
jge 0xc7c4
movslq -0x3c(%rbp), %rcx
leaq 0x24de85(%rip), %rax    # 0x25a630
shlq $0x6, %rcx
addq %rcx, %rax
movl $0x0, 0x30(%rax)
movl -0x3c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x3c(%rbp)
jmp 0xc797
jmp 0xc7c6
cmpl $0x0, 0x2f8b3(%rip)     # 0x3c080
jl 0xc7dd
movl 0x24de4b(%rip), %eax    # 0x25a620
addl $0x1, %eax
movl %eax, -0x38(%rbp)
jmp 0xc7e6
movl 0x24de3d(%rip), %eax    # 0x25a620
movl %eax, -0x38(%rbp)
movl 0x24de38(%rip), %eax    # 0x25a624
movl %eax, -0x40(%rbp)
movl 0x24de2f(%rip), %eax    # 0x25a624
movl $0x2, %ecx
cltd
idivl %ecx
movl %eax, %ecx
movl -0x40(%rbp), %eax
addl %ecx, %eax
subl 0x24de16(%rip), %eax    # 0x25a620
addl $0x1, %eax
movl %eax, -0x2c(%rbp)
cmpl $0x100, -0x2c(%rbp)     # imm = 0x100
jge 0xc848
movl -0x2c(%rbp), %eax
movb %al, %cl
movq -0x8(%rbp), %rax
movb %cl, (%rax)
movq -0x8(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x8(%rbp)
movl -0x2c(%rbp), %ecx
addl $0x1, %ecx
movq -0x10(%rbp), %rax
movl %ecx, (%rax)
movq -0x18(%rbp), %rax
movl $0x1, (%rax)
jmp 0xc8ba
movq -0x8(%rbp), %rax
movb $0x0, (%rax)
movq -0x8(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
movb $0x21, (%rax)
movq -0x8(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x8(%rbp)
movl -0x2c(%rbp), %eax
sarl $0x8, %eax
movb %al, %cl
movq -0x8(%rbp), %rax
movb %cl, (%rax)
movq -0x8(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x8(%rbp)
movl -0x2c(%rbp), %eax
andl $0xff, %eax
movb %al, %cl
movq -0x8(%rbp), %rax
movb %cl, (%rax)
movq -0x8(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x8(%rbp)
movq -0x18(%rbp), %rax
movl $0x4, (%rax)
movl -0x2c(%rbp), %ecx
addl $0x4, %ecx
movq -0x10(%rbp), %rax
movl %ecx, (%rax)
cmpq $0x0, 0x24dd66(%rip)    # 0x25a628
jne 0xc8d1
movq 0x31135(%rip), %rax     # 0x3da00
movq %rax, -0x28(%rbp)
jmp 0xc8dc
movq 0x24dd50(%rip), %rax    # 0x25a628
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rax
movq %rax, -0x20(%rbp)
movl $0x0, -0x34(%rbp)
movq -0x20(%rbp), %rax
movl 0x30(%rax), %eax
cmpl 0x2f78c(%rip), %eax     # 0x3c084
jl 0xc917
movq -0x20(%rbp), %rax
movl 0x34(%rax), %eax
movb %al, %cl
movq -0x8(%rbp), %rax
movb %cl, (%rax)
movq -0x8(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x8(%rbp)
jmp 0xc954
movl 0x2f767(%rip), %ecx     # 0x3c084
movq -0x20(%rbp), %rax
movq 0x20(%rax), %rax
movl %ecx, 0x30(%rax)
movl -0x34(%rbp), %eax
movq -0x8(%rbp), %rcx
movb %al, (%rcx)
movzbl %al, %ecx
movq -0x20(%rbp), %rax
movq 0x20(%rax), %rax
movl %ecx, 0x34(%rax)
movq -0x8(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x8(%rbp)
movl -0x34(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x34(%rbp)
movl 0x2f72a(%rip), %ecx     # 0x3c084
addl $0x1, %ecx
movq -0x20(%rbp), %rax
movl %ecx, 0x30(%rax)
movq -0x20(%rbp), %rax
movq 0x10(%rax), %rax
movq 0x20(%rax), %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
cmpq -0x28(%rbp), %rax
jne 0xc8eb
movq -0x8(%rbp), %rax
movb $-0x1, (%rax)
movq -0x8(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x8(%rbp)
movl $0x0, -0x2c(%rbp)
movl -0x2c(%rbp), %eax
cmpl -0x38(%rbp), %eax
jge 0xcadb
movl -0x2c(%rbp), %eax
cmpl 0x2f6cf(%rip), %eax     # 0x3c080
je 0xcacb
movl $0x0, -0x30(%rbp)
movslq -0x2c(%rbp), %rcx
leaq 0x31037(%rip), %rax     # 0x3da00
movq (%rax,%rcx,8), %rax
movq %rax, -0x28(%rbp)
movl -0x30(%rbp), %eax
movslq -0x2c(%rbp), %rdx
leaq 0x31221(%rip), %rcx     # 0x3dc00
cmpl (%rcx,%rdx,4), %eax
jge 0xcac9
movq -0x28(%rbp), %rax
movl 0x30(%rax), %eax
cmpl 0x2f68f(%rip), %eax     # 0x3c084
jg 0xcaad
movq -0x28(%rbp), %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
movl 0x30(%rax), %eax
cmpl 0x2f674(%rip), %eax     # 0x3c084
jl 0xca2f
movq -0x20(%rbp), %rax
movl 0x34(%rax), %eax
movb %al, %cl
movq -0x8(%rbp), %rax
movb %cl, (%rax)
movq -0x8(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x8(%rbp)
jmp 0xca6c
movl 0x2f64f(%rip), %ecx     # 0x3c084
movq -0x20(%rbp), %rax
movq 0x20(%rax), %rax
movl %ecx, 0x30(%rax)
movl -0x34(%rbp), %eax
movq -0x8(%rbp), %rcx
movb %al, (%rcx)
movzbl %al, %ecx
movq -0x20(%rbp), %rax
movq 0x20(%rax), %rax
movl %ecx, 0x34(%rax)
movq -0x8(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x8(%rbp)
movl -0x34(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x34(%rbp)
movl 0x2f612(%rip), %ecx     # 0x3c084
addl $0x1, %ecx
movq -0x20(%rbp), %rax
movl %ecx, 0x30(%rax)
movq -0x20(%rbp), %rax
movq 0x10(%rax), %rax
movq 0x20(%rax), %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
cmpq -0x28(%rbp), %rax
jne 0xca03
movq -0x8(%rbp), %rax
movb $-0x1, (%rax)
movq -0x8(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x8(%rbp)
jmp 0xcaaf
movl -0x30(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x30(%rbp)
movq -0x28(%rbp), %rax
movq 0x18(%rax), %rax
movq %rax, -0x28(%rbp)
jmp 0xc9d1
jmp 0xcacb
jmp 0xcacd
movl -0x2c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x2c(%rbp)
jmp 0xc99c
popq %rbp
retq
nopl (%rax)