// File: /workspace/github_c_makefile_star2_O2/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 $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 0x6547
xorl %r11d, %r11d
cmpq $0x90, %r11
je 0x653b
movb $0x0, -0x2(%rdi,%r11)
andq $0x0, -0xc(%rdi,%r11)
movw $0x1, (%rdi,%r11)
addq $0x30, %r11
jmp 0x6519
incq %r10
addq $0x90, %rdi
jmp 0x6511
movq 0x28(%rdx), %rdi
movb $0x1, %r9b
movb %r9b, 0x12(%rdi)
movb %r9b, 0x12(%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 0x6611
movq 0x28(%rdx), %rdx
movq 0x20(%rdx), %rdx
movq 0x28(%rdx), %r15
movb %r9b, 0x12(%r15)
movb %r9b, 0x12(%rdx)
leaq 0x2(%r11), %r14
movw %r14w, 0x14(%rdx)
movq 0x20(%rdx), %r13
movq %r12, 0x8(%r13)
movq 0x18(%rdx), %rbp
movq %r12, 0x8(%rbp)
movq %r12, 0x8(%rdx)
leal 0x1(%r11), %ebp
movw %bp, 0x14(%r15)
cmpq %r11, %r8
je 0x65c1
movw $0x246, 0x14(%r13)      # imm = 0x246
movzwl (%rbx), %r12d
cmpq %r12, %r14
jae 0x6609
movq 0x18(%r15), %rdx
movq 0x28(%rdx), %r12
movb %r9b, 0x12(%r12)
movb %r9b, 0x12(%rdx)
movq 0x20(%rdx), %r15
movq %r14, 0x8(%r15)
movq 0x18(%rdx), %r15
movq %r14, 0x8(%r15)
movq %r14, 0x8(%rdx)
leal 0x3(%r11), %ebp
movw %bp, 0x14(%rdx)
movw %r14w, 0x14(%r12)
cmpq %r11, %r10
je 0x6609
movw $0x246, 0x14(%r15)      # imm = 0x246
movq %r14, %r11
jmp 0x656a
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 0x664b
testb $0x1, %al
jne 0x6657
movq 0x18(%rdx), %rax
movq 0x28(%rax), %rdx
jmp 0x665d
testb $0x1, %al
jne 0x665d
movq 0x20(%rdx), %rax
movq 0x28(%rax), %rdx
addq $0x20, %rdx
jmp 0x6661
addq $0x18, %rdx
movq (%rsi), %r15
movq (%rdx), %r14
leaq 0xc(%rsp), %r12
movq %r12, %rsi
callq 0x61e6
movl (%r12), %r12d
leaq 0x1c(%rsp), %r13
movq %rax, %rdi
movq %r13, %rsi
movl %r12d, %edx
callq 0x641d
leaq 0x8(%rbx), %rsi
movq %r13, %rdi
movl %r12d, %edx
callq 0x2337
testl %eax, %eax
js 0x6746
pushq $0x1
popq %rbp
jne 0x6748
movslq %r12d, %r13
leaq 0x4(%r13), %rax
movq %rax, 0x10(%rsp)
leaq 0xc(%rsp), %r12
movq %r15, %rdi
movq %r12, %rsi
callq 0x61e6
movl (%r12), %r15d
leaq 0x1c(%rsp), %r12
movq %rax, %rdi
movq %r12, %rsi
movl %r15d, %edx
callq 0x641d
leaq (%rbx,%r13,2), %rsi
addq $0x8, %rsi
movq %r12, %rdi
movl %r15d, %edx
callq 0x2337
testl %eax, %eax
js 0x6746
jne 0x6748
addl 0x10(%rsp), %r15d
leaq 0xc(%rsp), %r12
movq %r14, %rdi
movq %r12, %rsi
callq 0x61e6
movl (%r12), %ebp
leaq 0x1c(%rsp), %r14
movq %rax, %rdi
movq %r14, %rsi
movl %ebp, %edx
callq 0x641d
movslq %r15d, %rax
leaq (%rbx,%rax,2), %rsi
movq %r14, %rdi
movl %ebp, %edx
callq 0x2337
movl $0x0, %ebp
testl %eax, %eax
js 0x6748
xorl %ebp, %ebp
cmpl $0x1, %eax
adcl $0x1, %ebp
jmp 0x6748
xorl %ebp, %ebp
movl %ebp, %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq