// File: /workspace/github_c_makefile_star2_O0/mishun[P]plantri/fullgen.c
// Function: delete_patch
void delete_patch(PLANMAP map, KANTE *anfang, KNOTENTYP *adresse)
{
int sqlaenge, randlaenge, i, j, knotenverlust;
KANTE *run;

sqlaenge=6-adresse[0];
for (i=2, randlaenge=sqlaenge; i<= 1+sqlaenge; i++) randlaenge+=(2*adresse[i]);

knotenverlust=(3*adresse[0])+randlaenge;
knotenverlust= knotenverlust/2;  /* diese konstruktion nur Sicherheitshalber, damit kein
				    Compiler die Ordnung "erst 3a[0]+r" aufloest */
knotenverlust= knotenverlust+(2*adresse[1])+1-randlaenge;
/*alles nur Euler-Formel*/

map[0][0].name = map[0][0].name - knotenverlust;

for (i=1+sqlaenge; adresse[i]==0; i--);
for ( run=anfang ; i>1 ; i--)
  { if (adresse[i])
      { for (j=0; j < adresse[i]; j++)
	  { 
	    run->name=aussen; run->invers=nil; run = run->next->invers->next->invers->next; }
	run=run->invers->next;
      }
    else { run=run->invers->next; }
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x18(%rbp), %rax
movzwl (%rax), %ecx
movl $0x6, %eax
subl %ecx, %eax
movl %eax, -0x1c(%rbp)
movl $0x2, -0x24(%rbp)
movl -0x1c(%rbp), %eax
movl %eax, -0x20(%rbp)
movl -0x24(%rbp), %eax
movl -0x1c(%rbp), %ecx
addl $0x1, %ecx
cmpl %ecx, %eax
jg 0x1459a
movq -0x18(%rbp), %rax
movslq -0x24(%rbp), %rcx
movzwl (%rax,%rcx,2), %eax
shll %eax
addl -0x20(%rbp), %eax
movl %eax, -0x20(%rbp)
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
jmp 0x1456e
movq -0x18(%rbp), %rax
movzwl (%rax), %eax
imull $0x3, %eax, %eax
addl -0x20(%rbp), %eax
movl %eax, -0x2c(%rbp)
movl -0x2c(%rbp), %eax
movl $0x2, %ecx
cltd
idivl %ecx
movl %eax, -0x2c(%rbp)
movl -0x2c(%rbp), %eax
movq -0x18(%rbp), %rcx
movzwl 0x2(%rcx), %ecx
shll %ecx
addl %ecx, %eax
addl $0x1, %eax
subl -0x20(%rbp), %eax
movl %eax, -0x2c(%rbp)
movq -0x8(%rbp), %rax
movzwl 0x2(%rax), %eax
subl -0x2c(%rbp), %eax
movw %ax, %cx
movq -0x8(%rbp), %rax
movw %cx, 0x2(%rax)
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
movq -0x18(%rbp), %rax
movslq -0x24(%rbp), %rcx
movzwl (%rax,%rcx,2), %eax
cmpl $0x0, %eax
jne 0x1460d
jmp 0x14602
movl -0x24(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x24(%rbp)
jmp 0x145ef
movq -0x10(%rbp), %rax
movq %rax, -0x38(%rbp)
cmpl $0x1, -0x24(%rbp)
jle 0x146b7
movq -0x18(%rbp), %rax
movslq -0x24(%rbp), %rcx
cmpw $0x0, (%rax,%rcx,2)
je 0x14697
movl $0x0, -0x28(%rbp)
movl -0x28(%rbp), %eax
movq -0x18(%rbp), %rcx
movslq -0x24(%rbp), %rdx
movzwl (%rcx,%rdx,2), %ecx
cmpl %ecx, %eax
jge 0x14685
movq -0x38(%rbp), %rax
movw $0x246, 0x2(%rax)       # imm = 0x246
movq -0x38(%rbp), %rax
movq $0x0, 0x28(%rax)
movq -0x38(%rbp), %rax
movq 0x20(%rax), %rax
movq 0x28(%rax), %rax
movq 0x20(%rax), %rax
movq 0x28(%rax), %rax
movq 0x20(%rax), %rax
movq %rax, -0x38(%rbp)
movl -0x28(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x28(%rbp)
jmp 0x14635
movq -0x38(%rbp), %rax
movq 0x28(%rax), %rax
movq 0x20(%rax), %rax
movq %rax, -0x38(%rbp)
jmp 0x146a7
movq -0x38(%rbp), %rax
movq 0x28(%rax), %rax
movq 0x20(%rax), %rax
movq %rax, -0x38(%rbp)
jmp 0x146a9
movl -0x24(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x24(%rbp)
jmp 0x14615
popq %rbp
retq
nopl (%rax)