// File: /workspace/github_c_makefile_star2_O0/mishun[P]plantri/fullgen.c
// Function: berechne_brillenadressen
void berechne_brillenadressen( int l1, int lg, int l3, KNOTENTYP *seg,
			      KNOTENTYP *se3 )
{int l2, zaehler;
 int bogen1, bogen3; 

l2 = lg - l1 - l3;


if ((l1%2) != 0) lg--;

if ((l3 % 2) ==0)   /* l3 gerade */
  { se3[0]=4; se3[2]= (l3-2)/2; se3[3]=0; }
else { se3[0]=5; se3[2]= (l3-1)/2; lg--; }

/* Jetzt die grosse Sequenz: */

if ((l2 % 2) == 0) /* "normale" Brille */
  {
    if (l1%2) /* d.h. ungerade -- bestimmt den Umlaufsinn */
       { if ((lg % 2)==0) seg[2]=lg/2; else seg[2]= (lg-1)/2;
         zaehler=3;
	 if (l3 % 2) { seg[zaehler]=0; zaehler++; }
	 seg[zaehler]= (l2-2)/2; zaehler++; 
	 if (l1 % 2) { seg[zaehler]=0; zaehler++; }
	 seg[0]=8-zaehler;
       }
    else /* d.h. l1 gerade -- anderer Umlaufsinn */
       { if ((lg % 2)==0) seg[2]=lg/2; else seg[2]= (lg-1)/2;
         zaehler=3;
	 if (l1 % 2) { seg[zaehler]=0; zaehler++; }
	 seg[zaehler]= (l2-2)/2; zaehler++; 
	 if (l3 % 2) { seg[zaehler]=0; zaehler++; }
	 seg[0]=8-zaehler;
       }
  }/* ende "normale" Brille */ 
else /* d.h. "verbogene" Brille */
  {
    if (l1%2) bogen1= (l1+l2-2)/2; else bogen1=(l1+l2-1)/2; 
    if (l3%2) bogen3= (l3+l2-2)/2; else bogen3=(l3+l2-1)/2; 
    /* um das gleich kanonisch geordnet zu haben, muss da unterschieden werden */
    if (l1%2){
             /* l1 >= l3 reicht nicht, um die folgende Fallunterscheidung zu vermeiden */
             if ((bogen1 > bogen3) || ((bogen1==bogen3) && ((l3 % 2) == 0)))
	       { seg[2]=bogen1;
		 zaehler=3;
		 if (l3 % 2) { seg[zaehler]=0; zaehler++; }
		 seg[zaehler]=bogen3; zaehler++;
		 if (l1 % 2) { seg[zaehler]=0; zaehler++; }
		 seg[0]=8-zaehler;
	       }
	     else /* d.h. bogen3 kommt zuerst */
	       { seg[2]=bogen3;
		 zaehler=3;
		 if (l1 % 2) { seg[zaehler]=0; zaehler++; }
		 seg[zaehler]=bogen1; zaehler++;
		 if (l3 % 2) { seg[zaehler]=0; zaehler++; }
		 seg[0]=8-zaehler;
	       }
	   }
    else /* d.h. l1 gerade */
      { 
	/* keine Fallunterscheidung, da if immer true durch konvention l1>=l3 */
        /* if ((bogen1 > bogen3) || ((bogen1==bogen3) && ((l1 % 2) == 0))) */
	         seg[2]=bogen1;
		 seg[3]=bogen3; 
		 zaehler=4;
		 if (l3 % 2) { seg[zaehler]=0; zaehler++; }
		 seg[0]=8-zaehler;
       } 
  } /* ende verbogene brille */

}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movl %edi, -0x4(%rbp)
movl %esi, -0x8(%rbp)
movl %edx, -0xc(%rbp)
movq %rcx, -0x18(%rbp)
movq %r8, -0x20(%rbp)
movl -0x8(%rbp), %eax
subl -0x4(%rbp), %eax
subl -0xc(%rbp), %eax
movl %eax, -0x24(%rbp)
movl -0x4(%rbp), %eax
movl $0x2, %ecx
cltd
idivl %ecx
cmpl $0x0, %edx
je 0x13b1a
movl -0x8(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x8(%rbp)
movl -0xc(%rbp), %eax
movl $0x2, %ecx
cltd
idivl %ecx
cmpl $0x0, %edx
jne 0x13b58
movq -0x20(%rbp), %rax
movw $0x4, (%rax)
movl -0xc(%rbp), %eax
subl $0x2, %eax
movl $0x2, %ecx
cltd
idivl %ecx
movw %ax, %cx
movq -0x20(%rbp), %rax
movw %cx, 0x4(%rax)
movq -0x20(%rbp), %rax
movw $0x0, 0x6(%rax)
jmp 0x13b83
movq -0x20(%rbp), %rax
movw $0x5, (%rax)
movl -0xc(%rbp), %eax
subl $0x1, %eax
movl $0x2, %ecx
cltd
idivl %ecx
movw %ax, %cx
movq -0x20(%rbp), %rax
movw %cx, 0x4(%rax)
movl -0x8(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x8(%rbp)
movl -0x24(%rbp), %eax
movl $0x2, %ecx
cltd
idivl %ecx
cmpl $0x0, %edx
jne 0x13d51
movl -0x4(%rbp), %eax
movl $0x2, %ecx
cltd
idivl %ecx
cmpl $0x0, %edx
je 0x13c7e
movl -0x8(%rbp), %eax
movl $0x2, %ecx
cltd
idivl %ecx
cmpl $0x0, %edx
jne 0x13bd3
movl -0x8(%rbp), %eax
movl $0x2, %ecx
cltd
idivl %ecx
movw %ax, %cx
movq -0x18(%rbp), %rax
movw %cx, 0x4(%rax)
jmp 0x13bec
movl -0x8(%rbp), %eax
subl $0x1, %eax
movl $0x2, %ecx
cltd
idivl %ecx
movw %ax, %cx
movq -0x18(%rbp), %rax
movw %cx, 0x4(%rax)
movl $0x3, -0x28(%rbp)
movl -0xc(%rbp), %eax
movl $0x2, %ecx
cltd
idivl %ecx
cmpl $0x0, %edx
je 0x13c1a
movq -0x18(%rbp), %rax
movslq -0x28(%rbp), %rcx
movw $0x0, (%rax,%rcx,2)
movl -0x28(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x28(%rbp)
movl -0x24(%rbp), %eax
subl $0x2, %eax
movl $0x2, %ecx
cltd
idivl %ecx
movw %ax, %dx
movq -0x18(%rbp), %rax
movslq -0x28(%rbp), %rcx
movw %dx, (%rax,%rcx,2)
movl -0x28(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x28(%rbp)
movl -0x4(%rbp), %eax
movl $0x2, %ecx
cltd
idivl %ecx
cmpl $0x0, %edx
je 0x13c67
movq -0x18(%rbp), %rax
movslq -0x28(%rbp), %rcx
movw $0x0, (%rax,%rcx,2)
movl -0x28(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x28(%rbp)
movl $0x8, %eax
subl -0x28(%rbp), %eax
movw %ax, %cx
movq -0x18(%rbp), %rax
movw %cx, (%rax)
jmp 0x13d4c
movl -0x8(%rbp), %eax
movl $0x2, %ecx
cltd
idivl %ecx
cmpl $0x0, %edx
jne 0x13ca6
movl -0x8(%rbp), %eax
movl $0x2, %ecx
cltd
idivl %ecx
movw %ax, %cx
movq -0x18(%rbp), %rax
movw %cx, 0x4(%rax)
jmp 0x13cbf
movl -0x8(%rbp), %eax
subl $0x1, %eax
movl $0x2, %ecx
cltd
idivl %ecx
movw %ax, %cx
movq -0x18(%rbp), %rax
movw %cx, 0x4(%rax)
movl $0x3, -0x28(%rbp)
movl -0x4(%rbp), %eax
movl $0x2, %ecx
cltd
idivl %ecx
cmpl $0x0, %edx
je 0x13ced
movq -0x18(%rbp), %rax
movslq -0x28(%rbp), %rcx
movw $0x0, (%rax,%rcx,2)
movl -0x28(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x28(%rbp)
movl -0x24(%rbp), %eax
subl $0x2, %eax
movl $0x2, %ecx
cltd
idivl %ecx
movw %ax, %dx
movq -0x18(%rbp), %rax
movslq -0x28(%rbp), %rcx
movw %dx, (%rax,%rcx,2)
movl -0x28(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x28(%rbp)
movl -0xc(%rbp), %eax
movl $0x2, %ecx
cltd
idivl %ecx
cmpl $0x0, %edx
je 0x13d3a
movq -0x18(%rbp), %rax
movslq -0x28(%rbp), %rcx
movw $0x0, (%rax,%rcx,2)
movl -0x28(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x28(%rbp)
movl $0x8, %eax
subl -0x28(%rbp), %eax
movw %ax, %cx
movq -0x18(%rbp), %rax
movw %cx, (%rax)
jmp 0x13f86
movl -0x4(%rbp), %eax
movl $0x2, %ecx
cltd
idivl %ecx
cmpl $0x0, %edx
je 0x13d77
movl -0x4(%rbp), %eax
addl -0x24(%rbp), %eax
subl $0x2, %eax
movl $0x2, %ecx
cltd
idivl %ecx
movl %eax, -0x2c(%rbp)
jmp 0x13d8b
movl -0x4(%rbp), %eax
addl -0x24(%rbp), %eax
subl $0x1, %eax
movl $0x2, %ecx
cltd
idivl %ecx
movl %eax, -0x2c(%rbp)
movl -0xc(%rbp), %eax
movl $0x2, %ecx
cltd
idivl %ecx
cmpl $0x0, %edx
je 0x13db1
movl -0xc(%rbp), %eax
addl -0x24(%rbp), %eax
subl $0x2, %eax
movl $0x2, %ecx
cltd
idivl %ecx
movl %eax, -0x30(%rbp)
jmp 0x13dc5
movl -0xc(%rbp), %eax
addl -0x24(%rbp), %eax
subl $0x1, %eax
movl $0x2, %ecx
cltd
idivl %ecx
movl %eax, -0x30(%rbp)
movl -0x4(%rbp), %eax
movl $0x2, %ecx
cltd
idivl %ecx
cmpl $0x0, %edx
je 0x13f28
movl -0x2c(%rbp), %eax
cmpl -0x30(%rbp), %eax
jg 0x13e01
movl -0x2c(%rbp), %eax
cmpl -0x30(%rbp), %eax
jne 0x13e96
movl -0xc(%rbp), %eax
movl $0x2, %ecx
cltd
idivl %ecx
cmpl $0x0, %edx
jne 0x13e96
movl -0x2c(%rbp), %eax
movw %ax, %cx
movq -0x18(%rbp), %rax
movw %cx, 0x4(%rax)
movl $0x3, -0x28(%rbp)
movl -0xc(%rbp), %eax
movl $0x2, %ecx
cltd
idivl %ecx
cmpl $0x0, %edx
je 0x13e3d
movq -0x18(%rbp), %rax
movslq -0x28(%rbp), %rcx
movw $0x0, (%rax,%rcx,2)
movl -0x28(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x28(%rbp)
movl -0x30(%rbp), %eax
movw %ax, %dx
movq -0x18(%rbp), %rax
movslq -0x28(%rbp), %rcx
movw %dx, (%rax,%rcx,2)
movl -0x28(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x28(%rbp)
movl -0x4(%rbp), %eax
movl $0x2, %ecx
cltd
idivl %ecx
cmpl $0x0, %edx
je 0x13e7f
movq -0x18(%rbp), %rax
movslq -0x28(%rbp), %rcx
movw $0x0, (%rax,%rcx,2)
movl -0x28(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x28(%rbp)
movl $0x8, %eax
subl -0x28(%rbp), %eax
movw %ax, %cx
movq -0x18(%rbp), %rax
movw %cx, (%rax)
jmp 0x13f26
movl -0x30(%rbp), %eax
movw %ax, %cx
movq -0x18(%rbp), %rax
movw %cx, 0x4(%rax)
movl $0x3, -0x28(%rbp)
movl -0x4(%rbp), %eax
movl $0x2, %ecx
cltd
idivl %ecx
cmpl $0x0, %edx
je 0x13ed2
movq -0x18(%rbp), %rax
movslq -0x28(%rbp), %rcx
movw $0x0, (%rax,%rcx,2)
movl -0x28(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x28(%rbp)
movl -0x2c(%rbp), %eax
movw %ax, %dx
movq -0x18(%rbp), %rax
movslq -0x28(%rbp), %rcx
movw %dx, (%rax,%rcx,2)
movl -0x28(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x28(%rbp)
movl -0xc(%rbp), %eax
movl $0x2, %ecx
cltd
idivl %ecx
cmpl $0x0, %edx
je 0x13f14
movq -0x18(%rbp), %rax
movslq -0x28(%rbp), %rcx
movw $0x0, (%rax,%rcx,2)
movl -0x28(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x28(%rbp)
movl $0x8, %eax
subl -0x28(%rbp), %eax
movw %ax, %cx
movq -0x18(%rbp), %rax
movw %cx, (%rax)
jmp 0x13f84
movl -0x2c(%rbp), %eax
movw %ax, %cx
movq -0x18(%rbp), %rax
movw %cx, 0x4(%rax)
movl -0x30(%rbp), %eax
movw %ax, %cx
movq -0x18(%rbp), %rax
movw %cx, 0x6(%rax)
movl $0x4, -0x28(%rbp)
movl -0xc(%rbp), %eax
movl $0x2, %ecx
cltd
idivl %ecx
cmpl $0x0, %edx
je 0x13f72
movq -0x18(%rbp), %rax
movslq -0x28(%rbp), %rcx
movw $0x0, (%rax,%rcx,2)
movl -0x28(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x28(%rbp)
movl $0x8, %eax
subl -0x28(%rbp), %eax
movw %ax, %cx
movq -0x18(%rbp), %rax
movw %cx, (%rax)
jmp 0x13f86
popq %rbp
retq
nopl (%rax,%rax)