// File: /workspace/github_c_makefile_star2_O3/mishun[P]plantri/fullgen.c
// Function: brille_sp_reko
int brille_sp_reko(PLANMAP map,KNOTENTYP *code,KANTE *anfangskante)
{
int i,j, l1, l2, l3, fuenfecke, vergleichsanfang, test;
KANTE *run, *startkante1, *startkante2, *startkante3, *anfang;
KNOTENTYP testcode[6];



l1=code[2]; l3=code[3]; l2=code[0]-l1-l3;

for (i=1; i<=map[0][0].name; i++) for (j=0;j<3; j++) { map[i][j].dummy=map[i][j].noright=0;
						       map[i][j].mininame=1; }

/* markieren der Brille: */

anfangskante->mininame=anfangskante->noright=anfangskante->invers->noright=1;
anfangskante->invers->mininame=l1;

for (i=1, run=anfangskante; i<code[0]; i++)
  { run=run->invers->next; 
    run->noright=run->invers->noright=1;
    run->mininame=i+1;
    run->dummy=run->prev->dummy=run->next->dummy=i;
    run->invers->mininame=i;
    if (i!=l1) run->next->mininame=aussen;
    i++;
    if (i<code[0])
      {
      run=run->invers->prev;
      run->noright=run->invers->noright=1;
      run->dummy=run->prev->dummy=run->next->dummy=i;
      run->mininame=i+1;
      run->invers->mininame=i;
      if (i!=l1) run->prev->mininame=aussen;
      }
  }

/*  reparieren: */ run->mininame=l1+l2;

if (l1%2) { startkante1=anfangskante->invers->prev; 
	    startkante2=anfangskante->invers->next->invers->next; }
   else   { startkante2=anfangskante->invers->prev; 
	    startkante1=anfangskante->invers->next->invers->next; }

if (code[0]%2) /* d.h. der knoten, bei dem run ist, ist gerade */
  { if (l3%2) startkante3=run->prev;
         else startkante3=run->next->invers->next; } 
  else 
  { if (l3%2) startkante3=run->next;
        else  startkante3=run->prev->invers->prev; }


vergleichsanfang=4;
anfang=suchestart_reko_sp( startkante1, &fuenfecke);
reko_patch_sp(anfang,testcode,fuenfecke);
if ((test=codecmp_kn(testcode,code+vergleichsanfang,fuenfecke))<0) return(0);
if (test>0) return(1);
vergleichsanfang+=fuenfecke;
anfang=suchestart_reko_sp( startkante2, &fuenfecke);
reko_patch_sp(anfang,testcode,fuenfecke);
if ((test=codecmp_kn(testcode,code+vergleichsanfang,fuenfecke))<0) return(0);
if (test>0) return(1);
vergleichsanfang+=fuenfecke;
anfang=suchestart_reko_sp( startkante3, &fuenfecke);
reko_patch_sp(anfang,testcode,fuenfecke);
if ((test=codecmp_kn(testcode,code+vergleichsanfang,fuenfecke))<0) return(0);
if (test==0) return(2);

return(1); 
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rsi, %rbx
movzwl (%rsi), %esi
movzwl 0x4(%rbx), %ecx
movzwl 0x6(%rbx), %eax
movzwl 0x2(%rdi), %r8d
testq %r8, %r8
je 0x87ef
addq $0xa4, %rdi
movl $0x1, %r9d
xorl %r10d, %r10d
movb $0x0, -0x2(%rdi,%r10)
movq $0x0, -0xc(%rdi,%r10)
movw $0x1, (%rdi,%r10)
addq $0x30, %r10
cmpq $0x90, %r10
jne 0x87b9
leaq 0x1(%r9), %r10
addq $0x90, %rdi
cmpq %r8, %r9
movq %r10, %r9
jne 0x87b6
movq 0x28(%rdx), %rdi
movb $0x1, %r8b
movb %r8b, 0x12(%rdi)
movb %r8b, 0x12(%rdx)
movw $0x1, 0x14(%rdx)
movw %cx, 0x14(%rdi)
cmpw $0x2, (%rbx)
jb 0x88c5
movzwl %cx, %r9d
leaq -0x1(%r9), %r10
addq $-0x2, %r9
xorl %r11d, %r11d
movq %r11, %r14
leaq 0x1(%r11), %r13
movq 0x28(%rdx), %rdx
movq 0x20(%rdx), %rdx
movq 0x28(%rdx), %r15
movb %r8b, 0x12(%r15)
movb %r8b, 0x12(%rdx)
addq $0x2, %r11
movw %r11w, 0x14(%rdx)
movq 0x20(%rdx), %r12
movq %r13, 0x8(%r12)
movq 0x18(%rdx), %rbp
movq %r13, 0x8(%rbp)
movq %r13, 0x8(%rdx)
movw %r13w, 0x14(%r15)
cmpq %r14, %r10
je 0x886c
movw $0x246, 0x14(%r12)      # imm = 0x246
movzwl (%rbx), %r12d
cmpq %r12, %r11
jae 0x88b4
movq 0x18(%r15), %rdx
movq 0x28(%rdx), %r12
movb %r8b, 0x12(%r12)
movb %r8b, 0x12(%rdx)
movq 0x20(%rdx), %r15
movq %r11, 0x8(%r15)
movq 0x18(%rdx), %r15
movq %r11, 0x8(%r15)
movq %r11, 0x8(%rdx)
leal 0x3(%r14), %ebp
movw %bp, 0x14(%rdx)
movw %r11w, 0x14(%r12)
cmpq %r14, %r9
je 0x88b4
movw $0x246, 0x14(%r15)      # imm = 0x246
movzwl (%rbx), %r15d
addq $0x3, %r14
cmpq %r15, %r14
jb 0x8821
subl %eax, %esi
movw %si, 0x14(%rdx)
movq 0x20(%rdi), %rsi
addq $0x18, %rdi
movq 0x28(%rsi), %rsi
addq $0x20, %rsi
testb $0x1, %cl
movq %rdi, %rcx
cmoveq %rsi, %rcx
cmoveq %rdi, %rsi
movq (%rcx), %rdi
testb $0x1, (%rbx)
jne 0x88ff
testb $0x1, %al
jne 0x890b
movq 0x18(%rdx), %rax
movq 0x28(%rax), %rdx
jmp 0x8911
testb $0x1, %al
jne 0x8911
movq 0x20(%rdx), %rax
movq 0x28(%rax), %rdx
addq $0x20, %rdx
jmp 0x8915
addq $0x18, %rdx
movq (%rsi), %r15
movq (%rdx), %r14
movq %rsp, %r12
movq %r12, %rsi
callq 0x83d9
movl (%r12), %r12d
leaq 0x4(%rsp), %r13
movq %rax, %rdi
movq %r13, %rsi
movl %r12d, %edx
callq 0x86ad
movzwl (%r13), %eax
movzwl 0x8(%rbx), %ecx
cmpw %cx, %ax
sete %dl
cmpl $0x1, %r12d
setne %sil
andb %dl, %sil
cmpb $0x1, %sil
jne 0x897e
leal -0x2(%r12), %edx
xorl %esi, %esi
movzwl 0x6(%rsp,%rsi,2), %eax
movzwl 0xa(%rbx,%rsi,2), %ecx
cmpw %cx, %ax
jne 0x897e
leaq 0x1(%rsi), %rdi
cmpl %esi, %edx
movq %rdi, %rsi
jne 0x8964
cmpw %cx, %ax
jae 0x898a
xorl %ebp, %ebp
jmp 0x8aab
movl $0x1, %ebp
jne 0x8aab
movslq %r12d, %r13
leaq 0x4(%r13), %rax
movq %rax, 0x10(%rsp)
movq %rsp, %r12
movq %r15, %rdi
movq %r12, %rsi
callq 0x83d9
movl (%r12), %r15d
leaq 0x4(%rsp), %r12
movq %rax, %rdi
movq %r12, %rsi
movl %r15d, %edx
callq 0x86ad
movzwl (%r12), %eax
movzwl 0x8(%rbx,%r13,2), %ecx
cmpw %cx, %ax
sete %dl
cmpl $0x1, %r15d
setne %sil
andb %dl, %sil
cmpb $0x1, %sil
jne 0x8a14
leal -0x2(%r15), %edx
movq 0x10(%rsp), %rax
leaq (%rbx,%rax,2), %rsi
addq $0x2, %rsi
xorl %edi, %edi
movzwl 0x6(%rsp,%rdi,2), %eax
movzwl (%rsi,%rdi,2), %ecx
cmpw %cx, %ax
jne 0x8a14
leaq 0x1(%rdi), %r8
cmpl %edi, %edx
movq %r8, %rdi
jne 0x89fb
cmpw %cx, %ax
jb 0x8983
jne 0x8aab
addl 0x10(%rsp), %r15d
movq %rsp, %r12
movq %r14, %rdi
movq %r12, %rsi
callq 0x83d9
movl (%r12), %r14d
leaq 0x4(%rsp), %r12
movq %rax, %rdi
movq %r12, %rsi
movl %r14d, %edx
callq 0x86ad
movslq %r15d, %rdx
movzwl (%r12), %eax
movzwl (%rbx,%rdx,2), %ecx
cmpw %cx, %ax
sete %sil
cmpl $0x1, %r14d
setne %dil
andb %sil, %dil
cmpb $0x1, %dil
jne 0x8a99
addl $-0x2, %r14d
leaq (%rbx,%rdx,2), %rdx
addq $0x2, %rdx
xorl %esi, %esi
movzwl 0x6(%rsp,%rsi,2), %eax
movzwl (%rdx,%rsi,2), %ecx
cmpw %cx, %ax
jne 0x8a99
leaq 0x1(%rsi), %rdi
cmpl %esi, %r14d
movq %rdi, %rsi
jne 0x8a7f
movl $0x0, %ebp
cmpw %cx, %ax
jb 0x8aab
sete %al
movzbl %al, %ebp
incl %ebp
movl %ebp, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq