// File: /workspace/github_c_makefile_star2_O3/mishun[P]plantri/fullgen.c
// Function: brille_reko
int brille_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].noleft=0;
						       map[i][j].mininame=1; }

/* markieren der Brille: */

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

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

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

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

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

vergleichsanfang=4;
anfang=suchestart_reko( startkante1, &fuenfecke);
reko_patch(anfang,testcode,fuenfecke);
if ((test=codecmp_kn(testcode,code+vergleichsanfang,fuenfecke))<0) return(0);
if (test>0) return(1);
vergleichsanfang+=fuenfecke;
anfang=suchestart_reko( startkante2, &fuenfecke);
reko_patch(anfang,testcode,fuenfecke);
if ((test=codecmp_kn(testcode,code+vergleichsanfang,fuenfecke))<0) return(0);
if (test>0) return(1);
vergleichsanfang+=fuenfecke;
anfang=suchestart_reko( startkante3, &fuenfecke);
reko_patch(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 0x810b
addq $0xa4, %rdi
movl $0x1, %r9d
xorl %r10d, %r10d
movb $0x0, -0x3(%rdi,%r10)
movq $0x0, -0xc(%rdi,%r10)
movw $0x1, (%rdi,%r10)
addq $0x30, %r10
cmpq $0x90, %r10
jne 0x80d5
leaq 0x1(%r9), %r10
addq $0x90, %rdi
cmpq %r8, %r9
movq %r10, %r9
jne 0x80d2
movq 0x28(%rdx), %rdi
movb $0x1, %r8b
movb %r8b, 0x11(%rdi)
movb %r8b, 0x11(%rdx)
movw $0x1, 0x14(%rdx)
movw %cx, 0x14(%rdi)
cmpw $0x2, (%rbx)
jb 0x81e2
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 0x18(%rdx), %rdx
movq 0x28(%rdx), %r15
movb %r8b, 0x11(%r15)
movb %r8b, 0x11(%rdx)
addq $0x2, %r11
movw %r11w, 0x14(%rdx)
movq 0x20(%rdx), %r12
movq %r13, 0x8(%r12)
movq 0x18(%rdx), %r12
movq %r13, 0x8(%r12)
movq %r13, 0x8(%rdx)
movw %r13w, 0x14(%r15)
cmpq %r14, %r10
je 0x8189
movw $0x246, 0x14(%r12)      # imm = 0x246
movzwl (%rbx), %r12d
cmpq %r12, %r11
jae 0x81d1
movq 0x20(%r15), %rdx
movq 0x28(%rdx), %r12
movb %r8b, 0x11(%r12)
movb %r8b, 0x11(%rdx)
movq 0x20(%rdx), %r15
movq %r11, 0x8(%r15)
movq 0x18(%rdx), %r13
movq %r11, 0x8(%r13)
movq %r11, 0x8(%rdx)
leal 0x3(%r14), %ebp
movw %bp, 0x14(%rdx)
movw %r11w, 0x14(%r12)
cmpq %r14, %r9
je 0x81d1
movw $0x246, 0x14(%r15)      # imm = 0x246
movzwl (%rbx), %r15d
addq $0x3, %r14
cmpq %r15, %r14
jb 0x813d
subl %eax, %esi
movw %si, 0x14(%rdx)
movq 0x18(%rdi), %rsi
addq $0x20, %rdi
movq 0x28(%rsi), %rsi
addq $0x18, %rsi
testb $0x1, %cl
movq %rdi, %rcx
cmoveq %rsi, %rcx
cmoveq %rdi, %rsi
movq (%rcx), %rdi
testb $0x1, (%rbx)
jne 0x821c
testb $0x1, %al
jne 0x8228
movq 0x20(%rdx), %rax
movq 0x28(%rax), %rdx
jmp 0x822e
testb $0x1, %al
jne 0x822e
movq 0x18(%rdx), %rax
movq 0x28(%rax), %rdx
addq $0x18, %rdx
jmp 0x8232
addq $0x20, %rdx
movq (%rsi), %r15
movq (%rdx), %r14
movq %rsp, %r12
movq %r12, %rsi
callq 0x7cf5
movl (%r12), %r12d
leaq 0x4(%rsp), %r13
movq %rax, %rdi
movq %r13, %rsi
movl %r12d, %edx
callq 0x7fc9
movzwl (%r13), %eax
movzwl 0x8(%rbx), %ecx
cmpw %cx, %ax
sete %dl
cmpl $0x1, %r12d
setne %sil
andb %dl, %sil
cmpb $0x1, %sil
jne 0x829b
leal -0x2(%r12), %edx
xorl %esi, %esi
movzwl 0x6(%rsp,%rsi,2), %eax
movzwl 0xa(%rbx,%rsi,2), %ecx
cmpw %cx, %ax
jne 0x829b
leaq 0x1(%rsi), %rdi
cmpl %esi, %edx
movq %rdi, %rsi
jne 0x8281
cmpw %cx, %ax
jae 0x82a7
xorl %ebp, %ebp
jmp 0x83c8
movl $0x1, %ebp
jne 0x83c8
movslq %r12d, %r13
leaq 0x4(%r13), %rax
movq %rax, 0x10(%rsp)
movq %rsp, %r12
movq %r15, %rdi
movq %r12, %rsi
callq 0x7cf5
movl (%r12), %r15d
leaq 0x4(%rsp), %r12
movq %rax, %rdi
movq %r12, %rsi
movl %r15d, %edx
callq 0x7fc9
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 0x8331
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 0x8331
leaq 0x1(%rdi), %r8
cmpl %edi, %edx
movq %r8, %rdi
jne 0x8318
cmpw %cx, %ax
jb 0x82a0
jne 0x83c8
addl 0x10(%rsp), %r15d
movq %rsp, %r12
movq %r14, %rdi
movq %r12, %rsi
callq 0x7cf5
movl (%r12), %r14d
leaq 0x4(%rsp), %r12
movq %rax, %rdi
movq %r12, %rsi
movl %r14d, %edx
callq 0x7fc9
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 0x83b6
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 0x83b6
leaq 0x1(%rsi), %rdi
cmpl %esi, %r14d
movq %rdi, %rsi
jne 0x839c
movl $0x0, %ebp
cmpw %cx, %ax
jb 0x83c8
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