// File: /workspace/github_c_makefile_star2_O0/mishun[P]plantri/plantri.c
// Function: mirror_of_edgecode
static void
mirror_of_edgecode(unsigned char newcode[], unsigned char oldcode[], 
			int preserve, int totallength, int headerlength)
{
  /* copies oldcode to newcode by reversing the rotational order inside
     the lists. In case "preserve" is not 0, it is made sure that the
     face on the left hand side of edge 1 starting at the vertex corresponding
     to the first list is the same afterwards when interpreting the output
     in clockwise order both times 

     In case of "preserve" the routine relies on the first entry of oldcode
     except the vertexnumber being 1. This is guaranteed by compute_edgecode.

*/

  int i, number[MAXE/2];
  unsigned char *run,*start,*end, *last;

  last=newcode+totallength;

  for (i=0;i<headerlength;i++) newcode[i]=oldcode[i];
  
  if (!preserve)
    { newcode+=headerlength;
      start=end=oldcode+headerlength-1;
      while(newcode<last)
	{
	  for (run=end+1; *run!=255; run++);
	  end=run;
	  for (run--; run!=start; run--, newcode++) *newcode=*run;
	  *newcode=255; newcode++;
	  start=end;
	}
      return;
    }

  /* else -- do preserve the face */

  for (i=0; i<ne/2; i++) number[i]=i;
  if (oldcode[headerlength]!=0) 
    { fprintf(stderr,"Problem in mirror_of_edgecode -- read function description.\n");
      exit(1); }
  for (run=oldcode+headerlength;*run!=255;run++); 
  end=run;
  run--;
  number[0]=*run; number[*run]=0;
  newcode+=headerlength;
  for ( ; run!=(oldcode+headerlength-1); run--) { *newcode=number[*run]; newcode++; }
  *newcode=255; newcode++;
  start=end;

  while(newcode<last)
    {
      for (run=end+1; *run!=255; run++);
      end=run;
      for ( run--; run!=start; run--, newcode++) *newcode=number[*run];
      *newcode=255; newcode++;
      start=end;
    }
  return;

}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x340, %rsp            # imm = 0x340
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
movl %ecx, -0x18(%rbp)
movl %r8d, -0x1c(%rbp)
movq -0x8(%rbp), %rax
movslq -0x18(%rbp), %rcx
addq %rcx, %rax
movq %rax, -0x330(%rbp)
movl $0x0, -0x20(%rbp)
movl -0x20(%rbp), %eax
cmpl -0x1c(%rbp), %eax
jge 0xc3ef
movq -0x10(%rbp), %rax
movslq -0x20(%rbp), %rcx
movb (%rax,%rcx), %dl
movq -0x8(%rbp), %rax
movslq -0x20(%rbp), %rcx
movb %dl, (%rax,%rcx)
movl -0x20(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x20(%rbp)
jmp 0xc3c6
cmpl $0x0, -0x14(%rbp)
jne 0xc4fb
movl -0x1c(%rbp), %ecx
movq -0x8(%rbp), %rax
movslq %ecx, %rcx
addq %rcx, %rax
movq %rax, -0x8(%rbp)
movq -0x10(%rbp), %rax
movslq -0x1c(%rbp), %rcx
addq %rcx, %rax
addq $-0x1, %rax
movq %rax, -0x328(%rbp)
movq %rax, -0x320(%rbp)
movq -0x8(%rbp), %rax
cmpq -0x330(%rbp), %rax
jae 0xc4f6
movq -0x328(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x318(%rbp)
movq -0x318(%rbp), %rax
movzbl (%rax), %eax
cmpl $0xff, %eax
je 0xc471
jmp 0xc45d
movq -0x318(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x318(%rbp)
jmp 0xc44a
movq -0x318(%rbp), %rax
movq %rax, -0x328(%rbp)
movq -0x318(%rbp), %rax
addq $-0x1, %rax
movq %rax, -0x318(%rbp)
movq -0x318(%rbp), %rax
cmpq -0x320(%rbp), %rax
je 0xc4d0
movq -0x318(%rbp), %rax
movb (%rax), %cl
movq -0x8(%rbp), %rax
movb %cl, (%rax)
movq -0x318(%rbp), %rax
addq $-0x1, %rax
movq %rax, -0x318(%rbp)
movq -0x8(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x8(%rbp)
jmp 0xc491
movq -0x8(%rbp), %rax
movb $-0x1, (%rax)
movq -0x8(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x8(%rbp)
movq -0x328(%rbp), %rax
movq %rax, -0x320(%rbp)
jmp 0xc427
jmp 0xc750
movl $0x0, -0x20(%rbp)
movl -0x20(%rbp), %eax
movl %eax, -0x334(%rbp)
movl 0x24e113(%rip), %eax    # 0x25a624
movl $0x2, %ecx
cltd
idivl %ecx
movl %eax, %ecx
movl -0x334(%rbp), %eax
cmpl %ecx, %eax
jge 0xc53e
movl -0x20(%rbp), %ecx
movslq -0x20(%rbp), %rax
movl %ecx, -0x310(%rbp,%rax,4)
movl -0x20(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x20(%rbp)
jmp 0xc502
movq -0x10(%rbp), %rax
movslq -0x1c(%rbp), %rcx
movzbl (%rax,%rcx), %eax
cmpl $0x0, %eax
je 0xc571
movq 0x2faa2(%rip), %rax     # 0x3bff8
movq (%rax), %rdi
leaq 0x2bf10(%rip), %rsi     # 0x38470
movb $0x0, %al
callq 0x1060
movl $0x1, %edi
callq 0x10c0
movq -0x10(%rbp), %rax
movslq -0x1c(%rbp), %rcx
addq %rcx, %rax
movq %rax, -0x318(%rbp)
movq -0x318(%rbp), %rax
movzbl (%rax), %eax
cmpl $0xff, %eax
je 0xc5aa
jmp 0xc596
movq -0x318(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x318(%rbp)
jmp 0xc583
movq -0x318(%rbp), %rax
movq %rax, -0x328(%rbp)
movq -0x318(%rbp), %rax
addq $-0x1, %rax
movq %rax, -0x318(%rbp)
movq -0x318(%rbp), %rax
movzbl (%rax), %eax
movl %eax, -0x310(%rbp)
movq -0x318(%rbp), %rax
movzbl (%rax), %eax
movl $0x0, -0x310(%rbp,%rax,4)
movl -0x1c(%rbp), %ecx
movq -0x8(%rbp), %rax
movslq %ecx, %rcx
addq %rcx, %rax
movq %rax, -0x8(%rbp)
movq -0x318(%rbp), %rax
movq -0x10(%rbp), %rcx
movslq -0x1c(%rbp), %rdx
addq %rdx, %rcx
addq $-0x1, %rcx
cmpq %rcx, %rax
je 0xc654
movq -0x318(%rbp), %rax
movzbl (%rax), %eax
movl -0x310(%rbp,%rax,4), %eax
movb %al, %cl
movq -0x8(%rbp), %rax
movb %cl, (%rax)
movq -0x8(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x8(%rbp)
movq -0x318(%rbp), %rax
addq $-0x1, %rax
movq %rax, -0x318(%rbp)
jmp 0xc600
movq -0x8(%rbp), %rax
movb $-0x1, (%rax)
movq -0x8(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x8(%rbp)
movq -0x328(%rbp), %rax
movq %rax, -0x320(%rbp)
movq -0x8(%rbp), %rax
cmpq -0x330(%rbp), %rax
jae 0xc74e
movq -0x328(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x318(%rbp)
movq -0x318(%rbp), %rax
movzbl (%rax), %eax
cmpl $0xff, %eax
je 0xc6bf
jmp 0xc6ab
movq -0x318(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x318(%rbp)
jmp 0xc698
movq -0x318(%rbp), %rax
movq %rax, -0x328(%rbp)
movq -0x318(%rbp), %rax
addq $-0x1, %rax
movq %rax, -0x318(%rbp)
movq -0x318(%rbp), %rax
cmpq -0x320(%rbp), %rax
je 0xc728
movq -0x318(%rbp), %rax
movzbl (%rax), %eax
movl -0x310(%rbp,%rax,4), %eax
movb %al, %cl
movq -0x8(%rbp), %rax
movb %cl, (%rax)
movq -0x318(%rbp), %rax
addq $-0x1, %rax
movq %rax, -0x318(%rbp)
movq -0x8(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x8(%rbp)
jmp 0xc6df
movq -0x8(%rbp), %rax
movb $-0x1, (%rax)
movq -0x8(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x8(%rbp)
movq -0x328(%rbp), %rax
movq %rax, -0x320(%rbp)
jmp 0xc675
jmp 0xc750
addq $0x340, %rsp            # imm = 0x340
popq %rbp
retq
nopl (%rax)