// File: /workspace/github_c_makefile_star2_O0/mishun[P]plantri/plantri.c
// Function: extend_bip_P
static void
extend_bip_P(EDGE *ref)

/* This routine is the implementation of the P-operation in Batagelj's paper.
   It inserts two new vertices -- nv and nv+1. The reference edge ref is
   the one starting at the vertex to be split that will (always) become a 
   valency 4 vertex neighbouring the one in the center. 


       a
      / \
  ---b---c---e  The edge c-->e is the reference edge
      \ /
       d

The operations can only be understood by drawing a picture containing the edge
numbers as initialized in init_P_op().
*/
{
    EDGE *rp, *rn; /* reference->prev and reference->next */
    EDGE *start, *work, *work2;
    int buffer; 

    start=P_op(nv);
    rp=ref->prev; rn=ref->next;

    firstedge[ref->start]=rn; /* just in case ref was "firstedge" */
    ref->start=ref->invers->end=nv; ref->next=start+4; ref->prev=start+2;
    degree[nv]=degree[nv+1]=4;
    firstedge[nv]=start; firstedge[nv+1]=start+1;


    buffer=rn->end;
    degree[buffer]+=2;
    work=start+4; work->end=buffer; work->prev=ref;
    work2=rn->invers->next;
    /*work=start+5;*/ work++;
      work->start=buffer; work->next=work2; work2->prev=work;
    work2=rn->invers;
    /*work=start+6;*/ work++;
      work->start=buffer; work->prev=work2; work2->next=work;
    /*(start+7)*/ work++; work->end=buffer;

    buffer=rn->start;
    /*work=start+8;*/ work++;
      work->start=buffer; work->prev=rp; work->next=rn; rn->prev=rp->next=work;
    /*(start+9)*/ work++; work->end=buffer;

    buffer=rp->end;
    degree[buffer]+=2;
    work2=rp->invers->prev;
    /*work=start+10;*/ work++;
      work->start=buffer; work->next=rp->invers; rp->invers->prev=work;
    /*(start+11)*/ work++; work->end=buffer;
    work=start+3; work->start=buffer; work->prev=work2; work2->next=work; 
    /*work=start+2;*/ work--; work->end=buffer; work->next=ref; 

    nv += 2;
    ne += 12;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
imull $0xc, 0x227dd1(%rip), %eax # 0x25a620
movslq %eax, %rcx
leaq 0x227dd7(%rip), %rax    # 0x25a630
addq $0x600, %rax            # imm = 0x600
shlq $0x6, %rcx
addq %rcx, %rax
movq %rax, -0x20(%rbp)
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rax
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rdx
movq -0x8(%rbp), %rax
movslq (%rax), %rcx
leaq 0xb16c(%rip), %rax      # 0x3da00
movq %rdx, (%rax,%rcx,8)
movl 0x227d82(%rip), %ecx    # 0x25a620
movq -0x8(%rbp), %rax
movq 0x20(%rax), %rax
movl %ecx, 0x4(%rax)
movq -0x8(%rbp), %rax
movl %ecx, (%rax)
movq -0x20(%rbp), %rcx
addq $0x100, %rcx            # imm = 0x100
movq -0x8(%rbp), %rax
movq %rcx, 0x18(%rax)
movq -0x20(%rbp), %rcx
addq $0x80, %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x10(%rax)
movl 0x227d45(%rip), %eax    # 0x25a620
addl $0x1, %eax
movslq %eax, %rcx
leaq 0xb318(%rip), %rax      # 0x3dc00
movl $0x4, (%rax,%rcx,4)
movslq 0x227d2a(%rip), %rcx    # 0x25a620
leaq 0xb303(%rip), %rax      # 0x3dc00
movl $0x4, (%rax,%rcx,4)
movq -0x20(%rbp), %rdx
movslq 0x227d11(%rip), %rcx    # 0x25a620
leaq 0xb0ea(%rip), %rax      # 0x3da00
movq %rdx, (%rax,%rcx,8)
movq -0x20(%rbp), %rdx
addq $0x40, %rdx
movl 0x227cf8(%rip), %eax    # 0x25a620
addl $0x1, %eax
movslq %eax, %rcx
leaq 0xb0cb(%rip), %rax      # 0x3da00
movq %rdx, (%rax,%rcx,8)
movq -0x18(%rbp), %rax
movl 0x4(%rax), %eax
movl %eax, -0x34(%rbp)
movslq -0x34(%rbp), %rcx
leaq 0xb2b2(%rip), %rax      # 0x3dc00
movl (%rax,%rcx,4), %edx
addl $0x2, %edx
leaq 0xb2a5(%rip), %rax      # 0x3dc00
movl %edx, (%rax,%rcx,4)
movq -0x20(%rbp), %rax
addq $0x100, %rax            # imm = 0x100
movq %rax, -0x28(%rbp)
movl -0x34(%rbp), %ecx
movq -0x28(%rbp), %rax
movl %ecx, 0x4(%rax)
movq -0x8(%rbp), %rcx
movq -0x28(%rbp), %rax
movq %rcx, 0x10(%rax)
movq -0x18(%rbp), %rax
movq 0x20(%rax), %rax
movq 0x18(%rax), %rax
movq %rax, -0x30(%rbp)
movq -0x28(%rbp), %rax
addq $0x40, %rax
movq %rax, -0x28(%rbp)
movl -0x34(%rbp), %ecx
movq -0x28(%rbp), %rax
movl %ecx, (%rax)
movq -0x30(%rbp), %rcx
movq -0x28(%rbp), %rax
movq %rcx, 0x18(%rax)
movq -0x28(%rbp), %rcx
movq -0x30(%rbp), %rax
movq %rcx, 0x10(%rax)
movq -0x18(%rbp), %rax
movq 0x20(%rax), %rax
movq %rax, -0x30(%rbp)
movq -0x28(%rbp), %rax
addq $0x40, %rax
movq %rax, -0x28(%rbp)
movl -0x34(%rbp), %ecx
movq -0x28(%rbp), %rax
movl %ecx, (%rax)
movq -0x30(%rbp), %rcx
movq -0x28(%rbp), %rax
movq %rcx, 0x10(%rax)
movq -0x28(%rbp), %rcx
movq -0x30(%rbp), %rax
movq %rcx, 0x18(%rax)
movq -0x28(%rbp), %rax
addq $0x40, %rax
movq %rax, -0x28(%rbp)
movl -0x34(%rbp), %ecx
movq -0x28(%rbp), %rax
movl %ecx, 0x4(%rax)
movq -0x18(%rbp), %rax
movl (%rax), %eax
movl %eax, -0x34(%rbp)
movq -0x28(%rbp), %rax
addq $0x40, %rax
movq %rax, -0x28(%rbp)
movl -0x34(%rbp), %ecx
movq -0x28(%rbp), %rax
movl %ecx, (%rax)
movq -0x10(%rbp), %rcx
movq -0x28(%rbp), %rax
movq %rcx, 0x10(%rax)
movq -0x18(%rbp), %rcx
movq -0x28(%rbp), %rax
movq %rcx, 0x18(%rax)
movq -0x28(%rbp), %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x18(%rax)
movq -0x18(%rbp), %rax
movq %rcx, 0x10(%rax)
movq -0x28(%rbp), %rax
addq $0x40, %rax
movq %rax, -0x28(%rbp)
movl -0x34(%rbp), %ecx
movq -0x28(%rbp), %rax
movl %ecx, 0x4(%rax)
movq -0x10(%rbp), %rax
movl 0x4(%rax), %eax
movl %eax, -0x34(%rbp)
movslq -0x34(%rbp), %rcx
leaq 0xb17d(%rip), %rax      # 0x3dc00
movl (%rax,%rcx,4), %edx
addl $0x2, %edx
leaq 0xb170(%rip), %rax      # 0x3dc00
movl %edx, (%rax,%rcx,4)
movq -0x10(%rbp), %rax
movq 0x20(%rax), %rax
movq 0x10(%rax), %rax
movq %rax, -0x30(%rbp)
movq -0x28(%rbp), %rax
addq $0x40, %rax
movq %rax, -0x28(%rbp)
movl -0x34(%rbp), %ecx
movq -0x28(%rbp), %rax
movl %ecx, (%rax)
movq -0x10(%rbp), %rax
movq 0x20(%rax), %rcx
movq -0x28(%rbp), %rax
movq %rcx, 0x18(%rax)
movq -0x28(%rbp), %rcx
movq -0x10(%rbp), %rax
movq 0x20(%rax), %rax
movq %rcx, 0x10(%rax)
movq -0x28(%rbp), %rax
addq $0x40, %rax
movq %rax, -0x28(%rbp)
movl -0x34(%rbp), %ecx
movq -0x28(%rbp), %rax
movl %ecx, 0x4(%rax)
movq -0x20(%rbp), %rax
addq $0xc0, %rax
movq %rax, -0x28(%rbp)
movl -0x34(%rbp), %ecx
movq -0x28(%rbp), %rax
movl %ecx, (%rax)
movq -0x30(%rbp), %rcx
movq -0x28(%rbp), %rax
movq %rcx, 0x10(%rax)
movq -0x28(%rbp), %rcx
movq -0x30(%rbp), %rax
movq %rcx, 0x18(%rax)
movq -0x28(%rbp), %rax
addq $-0x40, %rax
movq %rax, -0x28(%rbp)
movl -0x34(%rbp), %ecx
movq -0x28(%rbp), %rax
movl %ecx, 0x4(%rax)
movq -0x8(%rbp), %rcx
movq -0x28(%rbp), %rax
movq %rcx, 0x18(%rax)
movl 0x227adb(%rip), %eax    # 0x25a620
addl $0x2, %eax
movl %eax, 0x227ad2(%rip)    # 0x25a620
movl 0x227ad0(%rip), %eax    # 0x25a624
addl $0xc, %eax
movl %eax, 0x227ac7(%rip)    # 0x25a624
popq %rbp
retq
nop