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

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

        a
   |\  /   reference edge nv->a
   | \/nv
   | /\
   |/  \

The operations can only be understood by drawing a picture containing the edge
numbers as initialized in init_P_op().
*/
{
    EDGE *a,*b,*c,*d,*x,*start;
    int dummy, dummy2;

    start=Q_op(nv);

    firstedge[nv]=ref;
    x=ref->next;
    b=ref->prev->invers;
    a=b->prev;

    d=x->next->invers;
    c=d->next;

    ref->start=ref->invers->end=x->start=x->invers->end=nv;

    ref->prev=start+4;

    c->prev=start+1;
    d->next=start+2;
    b->prev=start+3; 
    a->next=start+5;

    dummy=c->start; dummy2=a->start;
    (degree[dummy])+=2; (degree[dummy2])+=2;
    degree[nv]=4; (degree[b->end])-=2;
    start->prev=x; x->next=start; start->end=dummy; start++;
    /*1*/ start->next=c; c->prev=start; start->start=dummy; start++;
    /*2*/ start->prev=d; d->next=start; start->start=dummy;
          start->end=dummy2; start++;
    /*3*/ start->next=b; b->prev=start; start->start=dummy2;
          start->end=dummy; start++;
    /*4*/ start->next=ref; ref->prev=start; start->end=dummy2; start++;
    /*5*/ start->prev=a; a->next=start; start->start=dummy2;

    b=b->invers; d=d->invers;

    firstedge[b->start]=b;
    b->next=d;
    d->prev=b;


    nv++;
    ne+=6;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movslq 0x226c0e(%rip), %rax    # 0x244610
leaq 0x9fe7(%rip), %rcx      # 0x279f0
movq %rdi, (%rcx,%rax,8)
movq 0x10(%rdi), %rdx
movq 0x18(%rdi), %r10
movq 0x20(%rdx), %rdx
movq 0x10(%rdx), %rsi
movq 0x18(%r10), %r8
movq 0x20(%r10), %r9
movq 0x20(%r8), %r8
movq 0x18(%r8), %r11
movl %eax, 0x4(%r9)
movl %eax, (%r10)
movq 0x20(%rdi), %r9
movl %eax, 0x4(%r9)
movl %eax, (%rdi)
movslq (%r11), %rbx
movslq (%rsi), %r9
leaq 0xa1a5(%rip), %r14      # 0x27bf0
addl $0x2, (%r14,%rbx,4)
leaq (%rax,%rax,2), %r15
addl $0x2, (%r14,%r9,4)
shlq $0x7, %r15
leaq 0x226bbc(%rip), %r12    # 0x244620
movl $0x4, (%r14,%rax,4)
movslq 0x4(%rdx), %r13
addl $-0x2, (%r14,%r13,4)
leaq (%r15,%r12), %r14
addq $0xc600, %r14           # imm = 0xC600
leaq 0xc680(%r15,%r12), %r13
movq %r10, -0x70(%r13)
movq %r14, 0x18(%r10)
leaq 0xc640(%r15,%r12), %r10
leaq 0xc6c0(%r15,%r12), %r14
movl %ebx, -0x7c(%r13)
movq %r11, -0x68(%r14)
movq %r10, 0x10(%r11)
leaq 0xc700(%r15,%r12), %r10
leaq 0xc740(%r15,%r12), %r11
movl %ebx, -0x80(%r14)
movq %r8, -0x30(%r14)
movq %r13, 0x18(%r8)
movl %ebx, -0x40(%r14)
movl %r9d, -0x3c(%r14)
movq %rdx, -0x68(%r11)
movq %r14, 0x10(%rdx)
movl %r9d, -0x80(%r11)
movl %ebx, -0x7c(%r11)
movq %rdi, -0x28(%r11)
movq %r10, 0x10(%rdi)
movl %r9d, -0x3c(%r11)
movq %rsi, 0x10(%r11)
movq %r11, 0x18(%rsi)
movl %r9d, (%r11)
movq 0x20(%rdx), %rdx
movq 0x20(%r8), %rsi
movslq (%rdx), %rdi
movq %rdx, (%rcx,%rdi,8)
movq %rsi, 0x18(%rdx)
movq %rdx, 0x10(%rsi)
incl %eax
movl %eax, 0x226afa(%rip)    # 0x244610
addl $0x6, 0x226af7(%rip)    # 0x244614
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq