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


l1=code[2]; l2=code[3]; 
l1_p_l2 = l1+l2;

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_p_l2;

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_p_l2) 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_p_l2) run->prev->mininame=aussen;
      }
  }

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

/* l1 ist immer >= 3, also geht das folgende: */

if (l1_p_l2%2) { startkante1=anfangskante->invers->prev; 
		 startkante3=startkante1->prev->invers->next;
		 if (l2>1) startkante2=anfangskante->next->invers->prev;
		 else /* dann ist l3 > 1 */
		   startkante2=anfangskante->prev->invers->next; }
   else
               { startkante3=anfangskante->invers->prev; 
		 startkante1=startkante3->prev->invers->next;
		 if (l2>1) startkante2=anfangskante->prev->invers->next;
		 else /* dann ist l3 > 1 */
		   startkante2=anfangskante->next->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 0x4(%rsi), %esi
movzwl %si, %ecx
movzwl 0x6(%rbx), %eax
movzwl 0x2(%rdi), %r8d
incq %r8
addq $0xa4, %rdi
pushq $0x1
popq %r9
cmpq %r8, %r9
je 0x6a57
xorl %r10d, %r10d
cmpq $0x90, %r10
je 0x6a4b
movb $0x0, -0x2(%rdi,%r10)
andq $0x0, -0xc(%rdi,%r10)
movw $0x1, (%rdi,%r10)
addq $0x30, %r10
jmp 0x6a29
incq %r9
addq $0x90, %rdi
jmp 0x6a21
movl %eax, 0x10(%rsp)
addl %eax, %ecx
movq 0x28(%rdx), %rdi
movb $0x1, %r8b
movb %r8b, 0x12(%rdi)
movb %r8b, 0x12(%rdx)
movw $0x1, 0x14(%rdx)
movw %cx, 0x14(%rdi)
leaq -0x2(%rcx), %r9
leaq -0x1(%rcx), %r10
xorl %r14d, %r14d
movq %rdx, %r11
leaq 0x1(%r14), %r13
movzwl (%rbx), %r15d
cmpq %r15, %r13
jae 0x6b2e
movq 0x28(%r11), %r11
movq 0x20(%r11), %r11
movq 0x28(%r11), %r12
movb %r8b, 0x12(%r12)
movb %r8b, 0x12(%r11)
leaq 0x2(%r14), %r15
movw %r15w, 0x14(%r11)
movq 0x20(%r11), %rbp
movq %r13, 0x8(%rbp)
movq 0x18(%r11), %rax
movq %r13, 0x8(%rax)
movq %r13, 0x8(%r11)
leal 0x1(%r14), %eax
movw %ax, 0x14(%r12)
cmpq %r14, %r10
je 0x6adc
movw $0x246, 0x14(%rbp)      # imm = 0x246
movzwl (%rbx), %eax
cmpq %rax, %r15
jae 0x6b26
movq 0x18(%r12), %r11
movq 0x28(%r11), %rax
movb %r8b, 0x12(%rax)
movb %r8b, 0x12(%r11)
movq 0x20(%r11), %r12
movq %r15, 0x8(%r12)
movq 0x18(%r11), %r12
movq %r15, 0x8(%r12)
movq %r15, 0x8(%r11)
leal 0x3(%r14), %ebp
movw %bp, 0x14(%r11)
movw %r15w, 0x14(%rax)
cmpq %r14, %r9
je 0x6b26
movw $0x246, 0x14(%r12)      # imm = 0x246
movq %r15, %r14
jmp 0x6a84
movw %si, 0x14(%r11)
movq 0x18(%rdi), %rsi
movq 0x18(%rsi), %rax
movq 0x28(%rax), %rax
movq 0x20(%rax), %r14
testb $0x1, %cl
jne 0x6b70
xorl %ecx, %ecx
xorl %eax, %eax
cmpw $0x2, 0x10(%rsp)
setae %cl
setb %al
leaq 0x18(,%rax,8), %rax
leaq 0x18(,%rcx,8), %rcx
movq %r14, %rdi
movq %rsi, %r14
jmp 0x6b93
xorl %ecx, %ecx
xorl %eax, %eax
cmpw $0x2, 0x10(%rsp)
setb %cl
setae %al
leaq 0x18(,%rax,8), %rax
leaq 0x18(,%rcx,8), %rcx
movq %rsi, %rdi
movq (%rdx,%rax), %rax
movq 0x28(%rax), %rax
movq (%rax,%rcx), %r15
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 0x6c7e
pushq $0x1
popq %rbp
jne 0x6c80
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 0x6c7e
jne 0x6c80
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 0x6c80
xorl %ebp, %ebp
cmpl $0x1, %eax
adcl $0x1, %ebp
jmp 0x6c80
xorl %ebp, %ebp
movl %ebp, %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq