// File: /workspace/github_c_makefile_star2_O2/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 $0x28, %rsp
movq %rsi, %rbx
movzwl (%rsi), %esi
movzwl 0x4(%rbx), %ecx
movzwl %cx, %r8d
movzwl 0x6(%rbx), %eax
movzwl 0x2(%rdi), %r9d
incq %r9
addq $0xa4, %rdi
pushq $0x1
popq %r10
cmpq %r9, %r10
je 0x5fd4
xorl %r11d, %r11d
cmpq $0x90, %r11
je 0x5fc8
movb $0x0, -0x3(%rdi,%r11)
andq $0x0, -0xc(%rdi,%r11)
movw $0x1, (%rdi,%r11)
addq $0x30, %r11
jmp 0x5fa6
incq %r10
addq $0x90, %rdi
jmp 0x5f9e
movq 0x28(%rdx), %rdi
movb $0x1, %r9b
movb %r9b, 0x11(%rdi)
movb %r9b, 0x11(%rdx)
movw $0x1, 0x14(%rdx)
movw %cx, 0x14(%rdi)
leaq -0x2(%r8), %r10
decq %r8
xorl %r11d, %r11d
leaq 0x1(%r11), %r12
movzwl (%rbx), %r14d
cmpq %r14, %r12
jae 0x609e
movq 0x28(%rdx), %rdx
movq 0x18(%rdx), %rdx
movq 0x28(%rdx), %r15
movb %r9b, 0x11(%r15)
movb %r9b, 0x11(%rdx)
leaq 0x2(%r11), %r14
movw %r14w, 0x14(%rdx)
movq 0x20(%rdx), %r13
movq %r12, 0x8(%r13)
movq 0x18(%rdx), %r13
movq %r12, 0x8(%r13)
movq %r12, 0x8(%rdx)
leal 0x1(%r11), %ebp
movw %bp, 0x14(%r15)
cmpq %r11, %r8
je 0x604e
movw $0x246, 0x14(%r13)      # imm = 0x246
movzwl (%rbx), %r12d
cmpq %r12, %r14
jae 0x6096
movq 0x20(%r15), %rdx
movq 0x28(%rdx), %r12
movb %r9b, 0x11(%r12)
movb %r9b, 0x11(%rdx)
movq 0x20(%rdx), %r15
movq %r14, 0x8(%r15)
movq 0x18(%rdx), %r13
movq %r14, 0x8(%r13)
movq %r14, 0x8(%rdx)
leal 0x3(%r11), %ebp
movw %bp, 0x14(%rdx)
movw %r14w, 0x14(%r12)
cmpq %r11, %r10
je 0x6096
movw $0x246, 0x14(%r15)      # imm = 0x246
movq %r14, %r11
jmp 0x5ff7
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 0x60d8
testb $0x1, %al
jne 0x60e4
movq 0x20(%rdx), %rax
movq 0x28(%rax), %rdx
jmp 0x60ea
testb $0x1, %al
jne 0x60ea
movq 0x18(%rdx), %rax
movq 0x28(%rax), %rdx
addq $0x18, %rdx
jmp 0x60ee
addq $0x20, %rdx
movq (%rsi), %r15
movq (%rdx), %r14
leaq 0xc(%rsp), %r12
movq %r12, %rsi
callq 0x5c73
movl (%r12), %r12d
leaq 0x1c(%rsp), %r13
movq %rax, %rdi
movq %r13, %rsi
movl %r12d, %edx
callq 0x5eaa
leaq 0x8(%rbx), %rsi
movq %r13, %rdi
movl %r12d, %edx
callq 0x2337
testl %eax, %eax
js 0x61d3
pushq $0x1
popq %rbp
jne 0x61d5
movslq %r12d, %r13
leaq 0x4(%r13), %rax
movq %rax, 0x10(%rsp)
leaq 0xc(%rsp), %r12
movq %r15, %rdi
movq %r12, %rsi
callq 0x5c73
movl (%r12), %r15d
leaq 0x1c(%rsp), %r12
movq %rax, %rdi
movq %r12, %rsi
movl %r15d, %edx
callq 0x5eaa
leaq (%rbx,%r13,2), %rsi
addq $0x8, %rsi
movq %r12, %rdi
movl %r15d, %edx
callq 0x2337
testl %eax, %eax
js 0x61d3
jne 0x61d5
addl 0x10(%rsp), %r15d
leaq 0xc(%rsp), %r12
movq %r14, %rdi
movq %r12, %rsi
callq 0x5c73
movl (%r12), %ebp
leaq 0x1c(%rsp), %r14
movq %rax, %rdi
movq %r14, %rsi
movl %ebp, %edx
callq 0x5eaa
movslq %r15d, %rax
leaq (%rbx,%rax,2), %rsi
movq %r14, %rdi
movl %ebp, %edx
callq 0x2337
movl $0x0, %ebp
testl %eax, %eax
js 0x61d5
xorl %ebp, %ebp
cmpl $0x1, %eax
adcl $0x1, %ebp
jmp 0x61d5
xorl %ebp, %ebp
movl %ebp, %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq