// File: /workspace/github_c_makefile_star2_O0/mishun[P]plantri/fullgen.c
// Function: baue_kuppe
void baue_kuppe(PLANMAP map, int bblaenge, FLAECHENTYP code[], KANTE **anfang, int flaechenzahl)
{
int i, puffer, codestelle, zaehler, flaechenzaehler;
KANTE *run;



puffer=2*bblaenge;

if (*anfang==nil) /* d.h. Bauchbinde und obere Kuppe bauen und Anfang zurueckgeben */
  { 
        map[1][0].name=puffer; map[1][0].invers=map[puffer]+1;
	map[1][1].name=aussen; map[1][1].invers=nil;
	map[1][2].name=2; map[1][2].invers=map[2];

   for (i=2; i<2*bblaenge; i++)
      { map[i][0].name=i-1; map[i][0].invers=map[i-1]+2;
	map[i][1].name=i+1; map[i][1].invers=map[i+1];
	map[i][2].name=aussen; map[i][2].invers=nil;
	i++;
        map[i][0].name=i-1; map[i][0].invers=map[i-1]+1;
	map[i][1].name=aussen; map[i][1].invers=nil;
	map[i][2].name=i+1; map[i][2].invers=map[i+1];
      }
	map[puffer][0].name=puffer-1; map[puffer][0].invers=map[puffer-1]+2;
	map[puffer][1].name=1; map[puffer][1].invers=map[1];
	map[puffer][2].name=aussen; map[puffer][2].invers=nil;
	
	map[0][0].name= puffer;
	*anfang=map[2]+2;

	for (run=map[1]+1, zaehler=1; zaehler<= bblaenge*code[0]; zaehler++ )
	  { add_polygon_invers(6, map, run, &run);
	    if (run==nil) { fprintf(stderr,"ERROR: nil-edge while building hexagon rings\n");
			    exit(88); }
	  } 
	flaechenzaehler=zaehler;
	for (codestelle=2, zaehler=1; run != nil; zaehler++, flaechenzaehler++ )
	  { 
	    if ((codestelle<8) && (code[codestelle]==zaehler))
	      { add_polygon_invers(5, map, run, &run); codestelle++; }
	    else add_polygon_invers(6, map, run, &run);
	  } 
        if (flaechenzaehler != flaechenzahl) 
	  { fprintf(stderr,"Baue_Kuppe: Could not insert enough faces: ");
	    fprintf(stderr,"%d instead of %d\n (upper half)\n",flaechenzaehler,flaechenzahl);
	    exit(89); }
      } /* ende if *anfang==nil) */
else /* d.h. untere Kuppe bauen */
  {
  for (run= *anfang, zaehler=1; zaehler <= bblaenge*code[0]; zaehler++ )
      { add_polygon_invers(6, map, run, &run);
	if (run==nil) { fprintf(stderr,"ERROR: nil-edge while building hexagon rings\n");
    		    exit(90); }
      } 
    flaechenzaehler=zaehler;
    for (codestelle=2, zaehler=1; run != nil; zaehler++, flaechenzaehler++ )
      { if ((codestelle<8) && (code[codestelle]==zaehler))
          { add_polygon_invers(5, map, run, &run); codestelle++; }
        else add_polygon_invers(6, map, run, &run);
      }
        if (flaechenzaehler != flaechenzahl) 
	  { fprintf(stderr,"Baue_Kuppe: Could not insert enough faces: ");
	    fprintf(stderr,"%d instead of %d\n (upper half)\n",flaechenzaehler,flaechenzahl);
	    exit(91); }
  } /* ende else */

}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movl %r8d, -0x24(%rbp)
movl -0xc(%rbp), %eax
shll %eax
movl %eax, -0x2c(%rbp)
movq -0x20(%rbp), %rax
cmpq $0x0, (%rax)
jne 0x13164
movl -0x2c(%rbp), %eax
movw %ax, %cx
movq -0x8(%rbp), %rax
movw %cx, 0x92(%rax)
movq -0x8(%rbp), %rcx
movslq -0x2c(%rbp), %rax
imulq $0x90, %rax, %rax
addq %rax, %rcx
addq $0x30, %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0xb8(%rax)
movq -0x8(%rbp), %rax
movw $0x246, 0xc2(%rax)      # imm = 0x246
movq -0x8(%rbp), %rax
movq $0x0, 0xe8(%rax)
movq -0x8(%rbp), %rax
movw $0x2, 0xf2(%rax)
movq -0x8(%rbp), %rcx
addq $0x120, %rcx            # imm = 0x120
movq -0x8(%rbp), %rax
movq %rcx, 0x118(%rax)
movl $0x2, -0x28(%rbp)
movl -0x28(%rbp), %eax
movl -0xc(%rbp), %ecx
shll %ecx
cmpl %ecx, %eax
jge 0x12f3e
movl -0x28(%rbp), %eax
subl $0x1, %eax
movw %ax, %cx
movq -0x8(%rbp), %rax
movslq -0x28(%rbp), %rdx
imulq $0x90, %rdx, %rdx
addq %rdx, %rax
movw %cx, 0x2(%rax)
movq -0x8(%rbp), %rcx
movl -0x28(%rbp), %eax
subl $0x1, %eax
cltq
imulq $0x90, %rax, %rax
addq %rax, %rcx
addq $0x60, %rcx
movq -0x8(%rbp), %rax
movslq -0x28(%rbp), %rdx
imulq $0x90, %rdx, %rdx
addq %rdx, %rax
movq %rcx, 0x28(%rax)
movl -0x28(%rbp), %eax
addl $0x1, %eax
movw %ax, %cx
movq -0x8(%rbp), %rax
movslq -0x28(%rbp), %rdx
imulq $0x90, %rdx, %rdx
addq %rdx, %rax
movw %cx, 0x32(%rax)
movq -0x8(%rbp), %rcx
movl -0x28(%rbp), %eax
addl $0x1, %eax
cltq
imulq $0x90, %rax, %rax
addq %rax, %rcx
movq -0x8(%rbp), %rax
movslq -0x28(%rbp), %rdx
imulq $0x90, %rdx, %rdx
addq %rdx, %rax
movq %rcx, 0x58(%rax)
movq -0x8(%rbp), %rax
movslq -0x28(%rbp), %rcx
imulq $0x90, %rcx, %rcx
addq %rcx, %rax
movw $0x246, 0x62(%rax)      # imm = 0x246
movq -0x8(%rbp), %rax
movslq -0x28(%rbp), %rcx
imulq $0x90, %rcx, %rcx
addq %rcx, %rax
movq $0x0, 0x88(%rax)
movl -0x28(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x28(%rbp)
movl -0x28(%rbp), %eax
subl $0x1, %eax
movw %ax, %cx
movq -0x8(%rbp), %rax
movslq -0x28(%rbp), %rdx
imulq $0x90, %rdx, %rdx
addq %rdx, %rax
movw %cx, 0x2(%rax)
movq -0x8(%rbp), %rcx
movl -0x28(%rbp), %eax
subl $0x1, %eax
cltq
imulq $0x90, %rax, %rax
addq %rax, %rcx
addq $0x30, %rcx
movq -0x8(%rbp), %rax
movslq -0x28(%rbp), %rdx
imulq $0x90, %rdx, %rdx
addq %rdx, %rax
movq %rcx, 0x28(%rax)
movq -0x8(%rbp), %rax
movslq -0x28(%rbp), %rcx
imulq $0x90, %rcx, %rcx
addq %rcx, %rax
movw $0x246, 0x32(%rax)      # imm = 0x246
movq -0x8(%rbp), %rax
movslq -0x28(%rbp), %rcx
imulq $0x90, %rcx, %rcx
addq %rcx, %rax
movq $0x0, 0x58(%rax)
movl -0x28(%rbp), %eax
addl $0x1, %eax
movw %ax, %cx
movq -0x8(%rbp), %rax
movslq -0x28(%rbp), %rdx
imulq $0x90, %rdx, %rdx
addq %rdx, %rax
movw %cx, 0x62(%rax)
movq -0x8(%rbp), %rcx
movl -0x28(%rbp), %eax
addl $0x1, %eax
cltq
imulq $0x90, %rax, %rax
addq %rax, %rcx
movq -0x8(%rbp), %rax
movslq -0x28(%rbp), %rdx
imulq $0x90, %rdx, %rdx
addq %rdx, %rax
movq %rcx, 0x88(%rax)
movl -0x28(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x28(%rbp)
jmp 0x12d79
movl -0x2c(%rbp), %eax
subl $0x1, %eax
movw %ax, %cx
movq -0x8(%rbp), %rax
movslq -0x2c(%rbp), %rdx
imulq $0x90, %rdx, %rdx
addq %rdx, %rax
movw %cx, 0x2(%rax)
movq -0x8(%rbp), %rcx
movl -0x2c(%rbp), %eax
subl $0x1, %eax
cltq
imulq $0x90, %rax, %rax
addq %rax, %rcx
addq $0x60, %rcx
movq -0x8(%rbp), %rax
movslq -0x2c(%rbp), %rdx
imulq $0x90, %rdx, %rdx
addq %rdx, %rax
movq %rcx, 0x28(%rax)
movq -0x8(%rbp), %rax
movslq -0x2c(%rbp), %rcx
imulq $0x90, %rcx, %rcx
addq %rcx, %rax
movw $0x1, 0x32(%rax)
movq -0x8(%rbp), %rcx
addq $0x90, %rcx
movq -0x8(%rbp), %rax
movslq -0x2c(%rbp), %rdx
imulq $0x90, %rdx, %rdx
addq %rdx, %rax
movq %rcx, 0x58(%rax)
movq -0x8(%rbp), %rax
movslq -0x2c(%rbp), %rcx
imulq $0x90, %rcx, %rcx
addq %rcx, %rax
movw $0x246, 0x62(%rax)      # imm = 0x246
movq -0x8(%rbp), %rax
movslq -0x2c(%rbp), %rcx
imulq $0x90, %rcx, %rcx
addq %rcx, %rax
movq $0x0, 0x88(%rax)
movl -0x2c(%rbp), %eax
movw %ax, %cx
movq -0x8(%rbp), %rax
movw %cx, 0x2(%rax)
movq -0x8(%rbp), %rcx
addq $0x120, %rcx            # imm = 0x120
addq $0x60, %rcx
movq -0x20(%rbp), %rax
movq %rcx, (%rax)
movq -0x8(%rbp), %rax
addq $0x90, %rax
addq $0x30, %rax
movq %rax, -0x40(%rbp)
movl $0x1, -0x34(%rbp)
movl -0x34(%rbp), %eax
movl -0xc(%rbp), %ecx
movq -0x18(%rbp), %rdx
movzbl (%rdx), %edx
imull %edx, %ecx
cmpl %ecx, %eax
jg 0x13098
movq -0x8(%rbp), %rsi
movq -0x40(%rbp), %rdx
movl $0x6, %edi
leaq -0x40(%rbp), %rcx
callq 0x12590
cmpq $0x0, -0x40(%rbp)
jne 0x1308b
movq 0x8f88(%rip), %rax      # 0x1bff8
movq (%rax), %rdi
leaq 0x5c63(%rip), %rsi      # 0x18cdd
movb $0x0, %al
callq 0x1080
movl $0x58, %edi
callq 0x1120
jmp 0x1308d
movl -0x34(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x34(%rbp)
jmp 0x13038
movl -0x34(%rbp), %eax
movl %eax, -0x38(%rbp)
movl $0x2, -0x30(%rbp)
movl $0x1, -0x34(%rbp)
cmpq $0x0, -0x40(%rbp)
je 0x13117
cmpl $0x8, -0x30(%rbp)
jge 0x130eb
movq -0x18(%rbp), %rax
movslq -0x30(%rbp), %rcx
movzbl (%rax,%rcx), %eax
cmpl -0x34(%rbp), %eax
jne 0x130eb
movq -0x8(%rbp), %rsi
movq -0x40(%rbp), %rdx
movl $0x5, %edi
leaq -0x40(%rbp), %rcx
callq 0x12590
movl -0x30(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x30(%rbp)
jmp 0x13101
movq -0x8(%rbp), %rsi
movq -0x40(%rbp), %rdx
movl $0x6, %edi
leaq -0x40(%rbp), %rcx
callq 0x12590
jmp 0x13103
movl -0x34(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x34(%rbp)
movl -0x38(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x38(%rbp)
jmp 0x130ac
movl -0x38(%rbp), %eax
cmpl -0x24(%rbp), %eax
je 0x1315f
movq 0x8ed2(%rip), %rax      # 0x1bff8
movq (%rax), %rdi
leaq 0x5bdb(%rip), %rsi      # 0x18d0b
movb $0x0, %al
callq 0x1080
movq 0x8eba(%rip), %rax      # 0x1bff8
movq (%rax), %rdi
movl -0x38(%rbp), %edx
movl -0x24(%rbp), %ecx
leaq 0x5be9(%rip), %rsi      # 0x18d37
movb $0x0, %al
callq 0x1080
movl $0x59, %edi
callq 0x1120
jmp 0x1329f
movq -0x20(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x40(%rbp)
movl $0x1, -0x34(%rbp)
movl -0x34(%rbp), %eax
movl -0xc(%rbp), %ecx
movq -0x18(%rbp), %rdx
movzbl (%rdx), %edx
imull %edx, %ecx
cmpl %ecx, %eax
jg 0x131d6
movq -0x8(%rbp), %rsi
movq -0x40(%rbp), %rdx
movl $0x6, %edi
leaq -0x40(%rbp), %rcx
callq 0x12590
cmpq $0x0, -0x40(%rbp)
jne 0x131c9
movq 0x8e4a(%rip), %rax      # 0x1bff8
movq (%rax), %rdi
leaq 0x5b25(%rip), %rsi      # 0x18cdd
movb $0x0, %al
callq 0x1080
movl $0x5a, %edi
callq 0x1120
jmp 0x131cb
movl -0x34(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x34(%rbp)
jmp 0x13176
movl -0x34(%rbp), %eax
movl %eax, -0x38(%rbp)
movl $0x2, -0x30(%rbp)
movl $0x1, -0x34(%rbp)
cmpq $0x0, -0x40(%rbp)
je 0x13255
cmpl $0x8, -0x30(%rbp)
jge 0x13229
movq -0x18(%rbp), %rax
movslq -0x30(%rbp), %rcx
movzbl (%rax,%rcx), %eax
cmpl -0x34(%rbp), %eax
jne 0x13229
movq -0x8(%rbp), %rsi
movq -0x40(%rbp), %rdx
movl $0x5, %edi
leaq -0x40(%rbp), %rcx
callq 0x12590
movl -0x30(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x30(%rbp)
jmp 0x1323f
movq -0x8(%rbp), %rsi
movq -0x40(%rbp), %rdx
movl $0x6, %edi
leaq -0x40(%rbp), %rcx
callq 0x12590
jmp 0x13241
movl -0x34(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x34(%rbp)
movl -0x38(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x38(%rbp)
jmp 0x131ea
movl -0x38(%rbp), %eax
cmpl -0x24(%rbp), %eax
je 0x1329d
movq 0x8d94(%rip), %rax      # 0x1bff8
movq (%rax), %rdi
leaq 0x5a9d(%rip), %rsi      # 0x18d0b
movb $0x0, %al
callq 0x1080
movq 0x8d7c(%rip), %rax      # 0x1bff8
movq (%rax), %rdi
movl -0x38(%rbp), %edx
movl -0x24(%rbp), %ecx
leaq 0x5aab(%rip), %rsi      # 0x18d37
movb $0x0, %al
callq 0x1080
movl $0x5b, %edi
callq 0x1120
jmp 0x1329f
addq $0x40, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)