// File: /workspace/github_c_makefile_star2_O0/mishun[P]plantri/fullgen.c
// Function: berechne_sequenz
void berechne_sequenz(SEQUENZ *sq, SEQUENZ altsq, int start,int f_ecke)
/* berechnet die neue sequenz startend bei der Kante start */
/* geht fest davon aus, dass 2 mal nach innen hintereinander nicht vorkommt */
/* zwei der Kanten-Eintraege koennen noch nicht belegt werden (die ersten beiden) */
/* start ist der laufindex */
{
int i, j, k, laenge,alt_laenge;
int *sequenz; 
int puffer[13];
char *kan;
KANTE **sqkanten;
KANTE *kpuffer[13];


sequenz=sq->sequenz;
kan=sq->k_marks;
sqkanten=sq->kanten;

alt_laenge=altsq.laenge;
sq->laenge= alt_laenge-f_ecke;
laenge=sq->laenge;

for (i=0; i<alt_laenge; i++) { puffer[i]=puffer[i+alt_laenge]=altsq.sequenz[i];
			       kpuffer[i]=kpuffer[i+alt_laenge]=altsq.kanten[i]; }

if (puffer[start]==0) { fprintf(stderr,"Berechne_sequenz should not be called for 0-gaps ! \n");
                        exit(5); }

if (f_ecke==0)
  { if (laenge==1) sequenz[0]=puffer[0]+1;
    else 
    if (laenge==2)
         { if (puffer[start]>1) { sequenz[0]=puffer[start]-1; sequenz[1]=puffer[start+1]+2; }
	      else { sequenz[1]=0; sequenz[0]=puffer[start+1]+2; }
	 }
    else /* d.h. laenge > 2 */
      { if (puffer[start]>1)
	  {
	    sequenz[0]= puffer[start]-1;
	    sequenz[1]= puffer[start+1]+1;
	    sequenz[laenge-1]=puffer[start+laenge-1]+1;
	    sqkanten[laenge-1]=kpuffer[start+laenge-1];
	    for (j=2; j<laenge-1; j++) { sequenz[j]=puffer[start+j];
					 sqkanten[j]=kpuffer[start+j]; }
	  }
	else /* d.h. die luecke hat laenge 1 */
	  {
	    sequenz[laenge-1]= 0;
	    sequenz[0]= puffer[start+1]+1;
	    sequenz[laenge-2]=puffer[start+laenge-1]+1;
	    sqkanten[laenge-2]=kpuffer[start+laenge-1];
	    for (j=1; j<laenge-2; j++) { sequenz[j]=puffer[start+j+1];
					 sqkanten[j]=kpuffer[start+j+1]; }
	  }
      } /* ende laenge > 2 */
  } /* ende 0 Fuenfecke */

else
if (f_ecke==1)
  { if (laenge==0) sequenz[0]=puffer[0]+1;
    else
    if (laenge==1) sequenz[0]=puffer[0]+puffer[1]+1;
    else 
    if (laenge==2)
          { sequenz[0]=puffer[start] + puffer[start+1]; sequenz[1]=puffer[start+2]+1;
	    sqkanten[1]=kpuffer[start+2];}
    else /* d.h. laenge > 2 */
      { sequenz[0]= puffer[start]+puffer[start+1];
	sequenz[laenge-1]=puffer[start+laenge]+1;
	sqkanten[laenge-1]=kpuffer[start+laenge];
	for (j=1; j<laenge-1; j++) { sequenz[j]=puffer[start+j+1];
				     sqkanten[j]=kpuffer[start+j+1]; }
      }
  } /* ende 1 Fuenfecke */

else /* d.h. f_ecke==2 */
  { if (laenge==0) sequenz[0]=puffer[0]+puffer[1]+1;
    else { fprintf(stderr,"ERROR: Two 5-gons not leading to 0-Sequence !\n");
	   exit(6); }
  } /* ende 2 Fuenfecke */

if (sequenz[0]==0) /* nur im Fall eines einzelnen 6-Ecks moeglich */
  { puffer[0]=sequenz[0];
    for (i=0; i<laenge-1; i++) sequenz[i]=sequenz[i+1]; sequenz[laenge-1]=puffer[0];
    for (i=1; i<laenge-1; i++) sqkanten[i]=sqkanten[i+1]; }



if (laenge==0) { sequenz[1]=leer; kan[0]=1; return; }

sequenz[laenge]=leer;

kan[0]=sequenz_kanonisch(sequenz);

for (i=1; i < laenge; i++)
  { for (j=i, k=0; j<laenge; j++, k++) puffer[k]=sequenz[j];
    for (j=0; j<i; j++, k++) puffer[k]=sequenz[j];
    puffer[k]=leer;
    kan[i]=sequenz_kanonisch(puffer);
  }

}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x100, %rsp            # imm = 0x100
leaq 0x10(%rbp), %rax
movq %rax, -0xf8(%rbp)
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movl %edx, -0x10(%rbp)
movq -0x8(%rbp), %rcx
addq $0x4, %rcx
movq %rcx, -0x30(%rbp)
movq -0x8(%rbp), %rcx
addq $0x58, %rcx
movq %rcx, -0x78(%rbp)
movq -0x8(%rbp), %rcx
addq $0x20, %rcx
movq %rcx, -0x80(%rbp)
movl (%rax), %eax
movl %eax, -0x24(%rbp)
movl -0x24(%rbp), %ecx
subl -0x10(%rbp), %ecx
movq -0x8(%rbp), %rax
movl %ecx, (%rax)
movq -0x8(%rbp), %rax
movl (%rax), %eax
movl %eax, -0x20(%rbp)
movl $0x0, -0x14(%rbp)
movl -0x14(%rbp), %eax
cmpl -0x24(%rbp), %eax
jge 0x4be1
movq -0xf8(%rbp), %rax
movslq -0x14(%rbp), %rcx
movl 0x4(%rax,%rcx,4), %edx
movl -0x14(%rbp), %ecx
addl -0x24(%rbp), %ecx
movslq %ecx, %rcx
movl %edx, -0x70(%rbp,%rcx,4)
movslq -0x14(%rbp), %rcx
movl %edx, -0x70(%rbp,%rcx,4)
movslq -0x14(%rbp), %rcx
movq 0x20(%rax,%rcx,8), %rcx
movl -0x14(%rbp), %eax
addl -0x24(%rbp), %eax
cltq
movq %rcx, -0xf0(%rbp,%rax,8)
movslq -0x14(%rbp), %rax
movq %rcx, -0xf0(%rbp,%rax,8)
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0x4b85
movslq -0xc(%rbp), %rax
cmpl $0x0, -0x70(%rbp,%rax,4)
jne 0x4c0e
movq 0x17405(%rip), %rax     # 0x1bff8
movq (%rax), %rdi
leaq 0x1399a(%rip), %rsi     # 0x18597
movb $0x0, %al
callq 0x1080
movl $0x5, %edi
callq 0x1120
cmpl $0x0, -0x10(%rbp)
jne 0x4e33
cmpl $0x1, -0x20(%rbp)
jne 0x4c2f
movl -0x70(%rbp), %ecx
addl $0x1, %ecx
movq -0x30(%rbp), %rax
movl %ecx, (%rax)
jmp 0x4e2e
cmpl $0x2, -0x20(%rbp)
jne 0x4c8e
movslq -0xc(%rbp), %rax
cmpl $0x1, -0x70(%rbp,%rax,4)
jle 0x4c69
movslq -0xc(%rbp), %rax
movl -0x70(%rbp,%rax,4), %ecx
subl $0x1, %ecx
movq -0x30(%rbp), %rax
movl %ecx, (%rax)
movl -0xc(%rbp), %eax
addl $0x1, %eax
cltq
movl -0x70(%rbp,%rax,4), %ecx
addl $0x2, %ecx
movq -0x30(%rbp), %rax
movl %ecx, 0x4(%rax)
jmp 0x4c89
movq -0x30(%rbp), %rax
movl $0x0, 0x4(%rax)
movl -0xc(%rbp), %eax
addl $0x1, %eax
cltq
movl -0x70(%rbp,%rax,4), %ecx
addl $0x2, %ecx
movq -0x30(%rbp), %rax
movl %ecx, (%rax)
jmp 0x4e2c
movslq -0xc(%rbp), %rax
cmpl $0x1, -0x70(%rbp,%rax,4)
jle 0x4d61
movslq -0xc(%rbp), %rax
movl -0x70(%rbp,%rax,4), %ecx
subl $0x1, %ecx
movq -0x30(%rbp), %rax
movl %ecx, (%rax)
movl -0xc(%rbp), %eax
addl $0x1, %eax
cltq
movl -0x70(%rbp,%rax,4), %ecx
addl $0x1, %ecx
movq -0x30(%rbp), %rax
movl %ecx, 0x4(%rax)
movl -0xc(%rbp), %eax
addl -0x20(%rbp), %eax
subl $0x1, %eax
cltq
movl -0x70(%rbp,%rax,4), %edx
addl $0x1, %edx
movq -0x30(%rbp), %rax
movl -0x20(%rbp), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
movl %edx, (%rax,%rcx,4)
movl -0xc(%rbp), %eax
addl -0x20(%rbp), %eax
subl $0x1, %eax
cltq
movq -0xf0(%rbp,%rax,8), %rdx
movq -0x80(%rbp), %rax
movl -0x20(%rbp), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
movq %rdx, (%rax,%rcx,8)
movl $0x2, -0x18(%rbp)
movl -0x18(%rbp), %eax
movl -0x20(%rbp), %ecx
subl $0x1, %ecx
cmpl %ecx, %eax
jge 0x4d5c
movl -0xc(%rbp), %eax
addl -0x18(%rbp), %eax
cltq
movl -0x70(%rbp,%rax,4), %edx
movq -0x30(%rbp), %rax
movslq -0x18(%rbp), %rcx
movl %edx, (%rax,%rcx,4)
movl -0xc(%rbp), %eax
addl -0x18(%rbp), %eax
cltq
movq -0xf0(%rbp,%rax,8), %rdx
movq -0x80(%rbp), %rax
movslq -0x18(%rbp), %rcx
movq %rdx, (%rax,%rcx,8)
movl -0x18(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x18(%rbp)
jmp 0x4d11
jmp 0x4e2a
movq -0x30(%rbp), %rax
movl -0x20(%rbp), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
movl $0x0, (%rax,%rcx,4)
movl -0xc(%rbp), %eax
addl $0x1, %eax
cltq
movl -0x70(%rbp,%rax,4), %ecx
addl $0x1, %ecx
movq -0x30(%rbp), %rax
movl %ecx, (%rax)
movl -0xc(%rbp), %eax
addl -0x20(%rbp), %eax
subl $0x1, %eax
cltq
movl -0x70(%rbp,%rax,4), %edx
addl $0x1, %edx
movq -0x30(%rbp), %rax
movl -0x20(%rbp), %ecx
subl $0x2, %ecx
movslq %ecx, %rcx
movl %edx, (%rax,%rcx,4)
movl -0xc(%rbp), %eax
addl -0x20(%rbp), %eax
subl $0x1, %eax
cltq
movq -0xf0(%rbp,%rax,8), %rdx
movq -0x80(%rbp), %rax
movl -0x20(%rbp), %ecx
subl $0x2, %ecx
movslq %ecx, %rcx
movq %rdx, (%rax,%rcx,8)
movl $0x1, -0x18(%rbp)
movl -0x18(%rbp), %eax
movl -0x20(%rbp), %ecx
subl $0x2, %ecx
cmpl %ecx, %eax
jge 0x4e28
movl -0xc(%rbp), %eax
addl -0x18(%rbp), %eax
addl $0x1, %eax
cltq
movl -0x70(%rbp,%rax,4), %edx
movq -0x30(%rbp), %rax
movslq -0x18(%rbp), %rcx
movl %edx, (%rax,%rcx,4)
movl -0xc(%rbp), %eax
addl -0x18(%rbp), %eax
addl $0x1, %eax
cltq
movq -0xf0(%rbp,%rax,8), %rdx
movq -0x80(%rbp), %rax
movslq -0x18(%rbp), %rcx
movq %rdx, (%rax,%rcx,8)
movl -0x18(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x18(%rbp)
jmp 0x4dd7
jmp 0x4e2a
jmp 0x4e2c
jmp 0x4e2e
jmp 0x4fb8
cmpl $0x1, -0x10(%rbp)
jne 0x4f7b
cmpl $0x0, -0x20(%rbp)
jne 0x4e54
movl -0x70(%rbp), %ecx
addl $0x1, %ecx
movq -0x30(%rbp), %rax
movl %ecx, (%rax)
jmp 0x4f79
cmpl $0x1, -0x20(%rbp)
jne 0x4e6e
movl -0x70(%rbp), %ecx
addl -0x6c(%rbp), %ecx
addl $0x1, %ecx
movq -0x30(%rbp), %rax
movl %ecx, (%rax)
jmp 0x4f77
cmpl $0x2, -0x20(%rbp)
jne 0x4ec1
movslq -0xc(%rbp), %rax
movl -0x70(%rbp,%rax,4), %ecx
movl -0xc(%rbp), %eax
addl $0x1, %eax
cltq
addl -0x70(%rbp,%rax,4), %ecx
movq -0x30(%rbp), %rax
movl %ecx, (%rax)
movl -0xc(%rbp), %eax
addl $0x2, %eax
cltq
movl -0x70(%rbp,%rax,4), %ecx
addl $0x1, %ecx
movq -0x30(%rbp), %rax
movl %ecx, 0x4(%rax)
movl -0xc(%rbp), %eax
addl $0x2, %eax
cltq
movq -0xf0(%rbp,%rax,8), %rcx
movq -0x80(%rbp), %rax
movq %rcx, 0x8(%rax)
jmp 0x4f75
movslq -0xc(%rbp), %rax
movl -0x70(%rbp,%rax,4), %ecx
movl -0xc(%rbp), %eax
addl $0x1, %eax
cltq
addl -0x70(%rbp,%rax,4), %ecx
movq -0x30(%rbp), %rax
movl %ecx, (%rax)
movl -0xc(%rbp), %eax
addl -0x20(%rbp), %eax
cltq
movl -0x70(%rbp,%rax,4), %edx
addl $0x1, %edx
movq -0x30(%rbp), %rax
movl -0x20(%rbp), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
movl %edx, (%rax,%rcx,4)
movl -0xc(%rbp), %eax
addl -0x20(%rbp), %eax
cltq
movq -0xf0(%rbp,%rax,8), %rdx
movq -0x80(%rbp), %rax
movl -0x20(%rbp), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
movq %rdx, (%rax,%rcx,8)
movl $0x1, -0x18(%rbp)
movl -0x18(%rbp), %eax
movl -0x20(%rbp), %ecx
subl $0x1, %ecx
cmpl %ecx, %eax
jge 0x4f73
movl -0xc(%rbp), %eax
addl -0x18(%rbp), %eax
addl $0x1, %eax
cltq
movl -0x70(%rbp,%rax,4), %edx
movq -0x30(%rbp), %rax
movslq -0x18(%rbp), %rcx
movl %edx, (%rax,%rcx,4)
movl -0xc(%rbp), %eax
addl -0x18(%rbp), %eax
addl $0x1, %eax
cltq
movq -0xf0(%rbp,%rax,8), %rdx
movq -0x80(%rbp), %rax
movslq -0x18(%rbp), %rcx
movq %rdx, (%rax,%rcx,8)
movl -0x18(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x18(%rbp)
jmp 0x4f22
jmp 0x4f75
jmp 0x4f77
jmp 0x4f79
jmp 0x4fb6
cmpl $0x0, -0x20(%rbp)
jne 0x4f92
movl -0x70(%rbp), %ecx
addl -0x6c(%rbp), %ecx
addl $0x1, %ecx
movq -0x30(%rbp), %rax
movl %ecx, (%rax)
jmp 0x4fb4
movq 0x1705f(%rip), %rax     # 0x1bff8
movq (%rax), %rdi
leaq 0x13629(%rip), %rsi     # 0x185cc
movb $0x0, %al
callq 0x1080
movl $0x6, %edi
callq 0x1120
jmp 0x4fb6
jmp 0x4fb8
movq -0x30(%rbp), %rax
cmpl $0x0, (%rax)
jne 0x5059
movq -0x30(%rbp), %rax
movl (%rax), %eax
movl %eax, -0x70(%rbp)
movl $0x0, -0x14(%rbp)
movl -0x14(%rbp), %eax
movl -0x20(%rbp), %ecx
subl $0x1, %ecx
cmpl %ecx, %eax
jge 0x5008
movq -0x30(%rbp), %rax
movl -0x14(%rbp), %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
movl (%rax,%rcx,4), %edx
movq -0x30(%rbp), %rax
movslq -0x14(%rbp), %rcx
movl %edx, (%rax,%rcx,4)
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0x4fd5
movl -0x70(%rbp), %edx
movq -0x30(%rbp), %rax
movl -0x20(%rbp), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
movl %edx, (%rax,%rcx,4)
movl $0x1, -0x14(%rbp)
movl -0x14(%rbp), %eax
movl -0x20(%rbp), %ecx
subl $0x1, %ecx
cmpl %ecx, %eax
jge 0x5057
movq -0x80(%rbp), %rax
movl -0x14(%rbp), %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rdx
movq -0x80(%rbp), %rax
movslq -0x14(%rbp), %rcx
movq %rdx, (%rax,%rcx,8)
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0x5022
jmp 0x5059
cmpl $0x0, -0x20(%rbp)
jne 0x5076
movq -0x30(%rbp), %rax
movl $0xfffe, 0x4(%rax)      # imm = 0xFFFE
movq -0x78(%rbp), %rax
movb $0x1, (%rax)
jmp 0x514b
movq -0x30(%rbp), %rax
movslq -0x20(%rbp), %rcx
movl $0xfffe, (%rax,%rcx,4)  # imm = 0xFFFE
movq -0x30(%rbp), %rdi
callq 0x49a0
movb %al, %cl
movq -0x78(%rbp), %rax
movb %cl, (%rax)
movl $0x1, -0x14(%rbp)
movl -0x14(%rbp), %eax
cmpl -0x20(%rbp), %eax
jge 0x514b
movl -0x14(%rbp), %eax
movl %eax, -0x18(%rbp)
movl $0x0, -0x1c(%rbp)
movl -0x18(%rbp), %eax
cmpl -0x20(%rbp), %eax
jge 0x50e5
movq -0x30(%rbp), %rax
movslq -0x18(%rbp), %rcx
movl (%rax,%rcx,4), %ecx
movslq -0x1c(%rbp), %rax
movl %ecx, -0x70(%rbp,%rax,4)
movl -0x18(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x18(%rbp)
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0x50b6
movl $0x0, -0x18(%rbp)
movl -0x18(%rbp), %eax
cmpl -0x14(%rbp), %eax
jge 0x511b
movq -0x30(%rbp), %rax
movslq -0x18(%rbp), %rcx
movl (%rax,%rcx,4), %ecx
movslq -0x1c(%rbp), %rax
movl %ecx, -0x70(%rbp,%rax,4)
movl -0x18(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x18(%rbp)
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0x50ec
movslq -0x1c(%rbp), %rax
movl $0xfffe, -0x70(%rbp,%rax,4) # imm = 0xFFFE
leaq -0x70(%rbp), %rdi
callq 0x49a0
movb %al, %dl
movq -0x78(%rbp), %rax
movslq -0x14(%rbp), %rcx
movb %dl, (%rax,%rcx)
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0x509d
addq $0x100, %rsp            # imm = 0x100
popq %rbp
retq
nopw %cs:(%rax,%rax)