// File: /workspace/github_c_makefile_star2_O0/mishun[P]plantri/plantri.c
// Function: extend4
static void 
extend4(EDGE *e, EDGE *list[])

/* Deletes e->next and its inverse and puts a valence 4 vertex into the
   resulting square.
   In list[0..1] the deleted edges are stored. This list must be handed 
   to reduce4() */
{
    register EDGE *work1, *work2, *work3, *work4;

    list[0] = e->next; list[1] = e->next->invers;

    work1 = STAR4(nv);
    work2 = work1+1;
    work3 = work2+1;
    work4 = work3+1;
    firstedge[nv] = work4+1;;

    firstedge[e->start] = e;
 /* make sure firstedge points at a valid edge afterwards */

 /* work1 starts at the beginning of e: */

    work1->start = work1->invers->end = e->start;
    work1->next = e->next->next;
    work1->next->prev = work1;
    work1->prev = e;
    e->next = work1;
 /* the degree of e->start doesn't change */

 /* Now go one edge further around the square: */

    e = e->invers->prev;

    work2->start = work2->invers->end = e->start;
    e->next->prev = work2;
    work2->next = e->next;
    work2->prev = e;
    e->next = work2;
    (degree[e->start])++;

 /* Now we have one edge to jump about again: */
    e = e->invers->prev->prev;

    firstedge[e->start] = e;
 /* Again an edge is deleted... */

    work3->start = work3->invers->end = e->start;
    work3->next = e->next->next;
    work3->next->prev = work3;
    work3->prev = e;
    e->next = work3;
 /* the degree of e->start doesn't change */

 /* Now go again one edge further around the square: */

    e = e->invers->prev;

    work4->start = work4->invers->end = e->start;
    e->next->prev = work4;
    work4->next = e->next;
    work4->prev = e;
    e->next = work4;
    (degree[e->start])++;

    degree[nv] = 4;

 /* Now I have 6 edges and one vertex more */

    ne += 6; 
    nv++;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rcx
movq -0x10(%rbp), %rax
movq %rcx, (%rax)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rax
movq 0x20(%rax), %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x8(%rax)
movl 0x22d4fb(%rip), %eax    # 0x25a620
shll $0x3, %eax
movslq %eax, %rcx
leaq 0x22d4fe(%rip), %rax    # 0x25a630
addq $0x180, %rax            # imm = 0x180
addq $0x8000, %rax           # imm = 0x8000
shlq $0x6, %rcx
addq %rcx, %rax
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rax
addq $0x40, %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
addq $0x40, %rax
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rax
addq $0x40, %rax
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rdx
addq $0x40, %rdx
movslq 0x22d4a4(%rip), %rcx    # 0x25a620
leaq 0x1087d(%rip), %rax     # 0x3da00
movq %rdx, (%rax,%rcx,8)
movq -0x8(%rbp), %rdx
movq -0x8(%rbp), %rax
movslq (%rax), %rcx
leaq 0x10867(%rip), %rax     # 0x3da00
movq %rdx, (%rax,%rcx,8)
movq -0x8(%rbp), %rax
movl (%rax), %ecx
movq -0x18(%rbp), %rax
movq 0x20(%rax), %rax
movl %ecx, 0x4(%rax)
movq -0x18(%rbp), %rax
movl %ecx, (%rax)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rax
movq 0x18(%rax), %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x18(%rax)
movq -0x18(%rbp), %rcx
movq -0x18(%rbp), %rax
movq 0x18(%rax), %rax
movq %rcx, 0x10(%rax)
movq -0x8(%rbp), %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x10(%rax)
movq -0x18(%rbp), %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x18(%rax)
movq -0x8(%rbp), %rax
movq 0x20(%rax), %rax
movq 0x10(%rax), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
movl (%rax), %ecx
movq -0x20(%rbp), %rax
movq 0x20(%rax), %rax
movl %ecx, 0x4(%rax)
movq -0x20(%rbp), %rax
movl %ecx, (%rax)
movq -0x20(%rbp), %rcx
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rax
movq %rcx, 0x10(%rax)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rcx
movq -0x20(%rbp), %rax
movq %rcx, 0x18(%rax)
movq -0x8(%rbp), %rcx
movq -0x20(%rbp), %rax
movq %rcx, 0x10(%rax)
movq -0x20(%rbp), %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x18(%rax)
movq -0x8(%rbp), %rax
movslq (%rax), %rcx
leaq 0x109a3(%rip), %rax     # 0x3dc00
movl (%rax,%rcx,4), %edx
addl $0x1, %edx
leaq 0x10996(%rip), %rax     # 0x3dc00
movl %edx, (%rax,%rcx,4)
movq -0x8(%rbp), %rax
movq 0x20(%rax), %rax
movq 0x10(%rax), %rax
movq 0x10(%rax), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rdx
movq -0x8(%rbp), %rax
movslq (%rax), %rcx
leaq 0x1076d(%rip), %rax     # 0x3da00
movq %rdx, (%rax,%rcx,8)
movq -0x8(%rbp), %rax
movl (%rax), %ecx
movq -0x28(%rbp), %rax
movq 0x20(%rax), %rax
movl %ecx, 0x4(%rax)
movq -0x28(%rbp), %rax
movl %ecx, (%rax)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rax
movq 0x18(%rax), %rcx
movq -0x28(%rbp), %rax
movq %rcx, 0x18(%rax)
movq -0x28(%rbp), %rcx
movq -0x28(%rbp), %rax
movq 0x18(%rax), %rax
movq %rcx, 0x10(%rax)
movq -0x8(%rbp), %rcx
movq -0x28(%rbp), %rax
movq %rcx, 0x10(%rax)
movq -0x28(%rbp), %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x18(%rax)
movq -0x8(%rbp), %rax
movq 0x20(%rax), %rax
movq 0x10(%rax), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
movl (%rax), %ecx
movq -0x30(%rbp), %rax
movq 0x20(%rax), %rax
movl %ecx, 0x4(%rax)
movq -0x30(%rbp), %rax
movl %ecx, (%rax)
movq -0x30(%rbp), %rcx
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rax
movq %rcx, 0x10(%rax)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rcx
movq -0x30(%rbp), %rax
movq %rcx, 0x18(%rax)
movq -0x8(%rbp), %rcx
movq -0x30(%rbp), %rax
movq %rcx, 0x10(%rax)
movq -0x30(%rbp), %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x18(%rax)
movq -0x8(%rbp), %rax
movslq (%rax), %rcx
leaq 0x108a9(%rip), %rax     # 0x3dc00
movl (%rax,%rcx,4), %edx
addl $0x1, %edx
leaq 0x1089c(%rip), %rax     # 0x3dc00
movl %edx, (%rax,%rcx,4)
movslq 0x22d2b2(%rip), %rcx    # 0x25a620
leaq 0x1088b(%rip), %rax     # 0x3dc00
movl $0x4, (%rax,%rcx,4)
movl 0x22d2a2(%rip), %eax    # 0x25a624
addl $0x6, %eax
movl %eax, 0x22d299(%rip)    # 0x25a624
movl 0x22d28f(%rip), %eax    # 0x25a620
addl $0x1, %eax
movl %eax, 0x22d286(%rip)    # 0x25a620
popq %rbp
retq
nopl (%rax)