// File: /workspace/github_c_makefile_star2_O1/mishun[P]plantri/plantri.c
// Function: extend_min5_b
static EDGE*
extend_min5_b(EDGE *e, int do_mirror)

/* extends a graph in the way given by the type b extension for
   5-connected triangulations. The edge e must start and end at
   a vertex of degree 5.

   It returns the edge characterizing this operation.

*/

{

  EDGE *ei, *e2, *e2i, *e3, *e3i, *e4, *e5i;
  EDGE *start, *run, *work1, *work2, *work3;
  int end2, center1, center2, start3;


if (!do_mirror)
  {
  ei=e->invers;
  work2=e->next;
  work3=work2->next;
  e3i=work3->next;
  e3=e3i->invers;
  e5i=e3->next;
  work1=ei->prev;
  e2=work1->prev;
  e2i=e2->invers;
  e4=e2i->prev;

  center1=e->end;
  center2=e->start;
  start3=e3->start;
  end2=e2->end;

  start=min5_b0(nv);

  work1->start=work1->invers->end=nv;
  firstedge[nv]=work1;
  degree[nv]=5;

  work2->start=work2->invers->end=work3->start=work3->invers->end=nv+1;
  firstedge[nv+1]=work2;
  degree[nv+1]=5;

  firstedge[center1]=ei;
  firstedge[center2]=e;

  /* The degree at center1 and center2 remains unchanged */


  start->start=end2;
  start->prev=e4; e4->next=start;
  start->next=e2i; e2i->prev=start;
  (degree[end2])++;

  run=start+1; 
  run->end=end2; run->next=work1; work1->prev=run;

  run++; /*2*/
  run->start=(run+1)->end=center1; 
  run->prev=e2; e2->next=run;
  run->next=ei; ei->prev=run;

  run+=2; /*4*/
  run->start=(run+1)->end=center2;
  run->prev=e; e->next=run;

  run+=2; /*6*/
  run->next=work2; work2->prev=run;

  run++; /*7*/ 
  run->prev=work1; work1->next=run;

  run++; /*8*/
  run->start=(run+1)->end=center2;
  run->next=e3i; e3i->prev=run;

  run+=2; /*10*/
  run->start=start3;
  run->next=e5i; e5i->prev=run;
  run->prev=e3; e3->next=run;

  run++; /*11*/
  run->end=start3;
  run->prev=work3; work3->next=run;
  degree[start3]++;

  nv+=2; ne+=12;

  return (start+4); /* is the smaller one */
  }

 else /* do_mirror=1*/
  {
  ei=e->invers;
  work2=e->prev;
  work3=work2->prev;
  e3i=work3->prev;
  e3=e3i->invers;
  e5i=e3->prev;
  work1=ei->next;
  e2=work1->next;
  e2i=e2->invers;
  e4=e2i->next;

  center1=e->end;
  center2=e->start;
  start3=e3->start;
  end2=e2->end;

  start=min5_b1(nv);

  work1->start=work1->invers->end=nv;
  firstedge[nv]=work1;
  degree[nv]=5;

  work2->start=work2->invers->end=work3->start=work3->invers->end=nv+1;
  firstedge[nv+1]=work2;
  degree[nv+1]=5;

  firstedge[center1]=ei;
  firstedge[center2]=e;

  /* The degree at center1 and center2 remains unchanged */


  start->start=end2;
  start->next=e4; e4->prev=start;
  start->prev=e2i; e2i->next=start;
  (degree[end2])++;

  run=start+1; 
  run->end=end2; run->prev=work1; work1->next=run;

  run++; /*2*/
  run->start=(run+1)->end=center1; 
  run->next=e2; e2->prev=run;
  run->prev=ei; ei->next=run;

  run+=2; /*4*/
  run->start=(run+1)->end=center2;
  run->next=e; e->prev=run;

  run+=2; /*6*/
  run->prev=work2; work2->next=run;

  run++; /*7*/ 
  run->next=work1; work1->prev=run;

  run++; /*8*/
  run->start=(run+1)->end=center2;
  run->prev=e3i; e3i->next=run;

  run+=2; /*10*/
  run->start=start3;
  run->prev=e5i; e5i->next=run;
  run->next=e3; e3->prev=run;

  run++; /*11*/
  run->end=start3;
  run->next=work3; work3->prev=run;
  degree[start3]++;

  nv+=2; ne+=12;

  return (start+4); /* is the smaller one */
  }

}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq 0x20(%rdi), %r11
movl (%rdi), %eax
movl 0x4(%rdi), %ecx
movslq %ecx, %rcx
movq %rcx, -0x8(%rsp)
movslq %eax, %r8
testl %esi, %esi
je 0x13a32
movq 0x10(%rdi), %r15
movq 0x10(%r15), %rsi
movq 0x10(%rsi), %rax
movq %rax, -0x18(%rsp)
movq 0x20(%rax), %rcx
movq %rcx, -0x20(%rsp)
movq 0x10(%rcx), %rax
movq %rax, -0x10(%rsp)
movq 0x18(%r11), %r12
movq 0x18(%r12), %r13
movq 0x20(%r12), %rax
movq 0x20(%r13), %rbx
movq 0x18(%rbx), %r14
movl (%rcx), %ecx
movl %ecx, -0x24(%rsp)
movslq 0x4(%r13), %r10
movslq 0x230d3f(%rip), %rcx    # 0x244610
movl %ecx, 0x4(%rax)
movl %ecx, (%r12)
leaq 0x14111(%rip), %rax     # 0x279f0
movq %r12, (%rax,%rcx,8)
leaq 0x14306(%rip), %rdx     # 0x27bf0
movl $0x5, %r9d
movl %r9d, (%rdx,%rcx,4)
movq %rdx, %r9
leaq 0x1(%rcx), %rbp
movq 0x20(%rsi), %rdx
movl %ebp, 0x4(%rdx)
movl %ebp, (%rsi)
movq 0x20(%r15), %rdx
movl %ebp, 0x4(%rdx)
movl %ebp, (%r15)
movl $0x5, %edx
movl %edx, 0x4(%r9,%rcx,4)
movq %r15, 0x8(%rax,%rcx,8)
movq -0x8(%rsp), %r9
movq %r11, (%rax,%r9,8)
movq %rdi, (%rax,%r8,8)
leaq (%rcx,%rcx,2), %rbp
shlq $0x8, %rbp
leaq 0x230ce7(%rip), %rdx    # 0x244620
leaq (%rdx,%rbp), %rax
addq $0xd500, %rax           # imm = 0xD500
movl %r10d, (%rax)
movq %r14, 0x18(%rax)
movq %rax, 0x10(%r14)
movq %rbx, 0x10(%rax)
movq %rax, 0x18(%rbx)
leaq 0x14293(%rip), %rbx     # 0x27bf0
incl (%rbx,%r10,4)
leaq (%rdx,%rbp), %rbx
addq $0xd540, %rbx           # imm = 0xD540
movl %r10d, 0x4(%rbx)
movq %r12, 0x10(%rbx)
movq %rbx, 0x18(%r12)
leaq 0xd580(%rbp,%rdx), %r10
movl %r9d, 0x44(%r10)
movl %r9d, (%r10)
movq %r13, 0x18(%r10)
movq %r10, 0x10(%r13)
movq %r11, 0x10(%r10)
movq %r10, 0x18(%r11)
leaq 0xd600(%rbp,%rdx), %r9
movl %r8d, 0x44(%r9)
movl %r8d, (%r9)
movq %rdi, 0x18(%r9)
movq %r9, 0x10(%rdi)
leaq 0xd680(%rbp,%rdx), %rdi
movq %r15, 0x10(%rdi)
movq %rdi, 0x18(%r15)
leaq 0xd6c0(%rbp,%rdx), %rdi
movq %r12, 0x18(%rdi)
movq %rdi, 0x10(%r12)
leaq 0xd700(%rbp,%rdx), %rdi
movl %r8d, 0x44(%rdi)
movl %r8d, (%rdi)
movq -0x18(%rsp), %r8
movq %r8, 0x10(%rdi)
movq %rdi, 0x18(%r8)
leaq 0xd780(%rbp,%rdx), %rdi
movl -0x24(%rsp), %r9d
movl %r9d, (%rdi)
movq -0x10(%rsp), %r8
movq %r8, 0x10(%rdi)
movq %rdi, 0x18(%r8)
movq -0x20(%rsp), %r8
movq %r8, 0x18(%rdi)
movq %rdi, 0x10(%r8)
movl %r9d, %edi
leaq 0xd7c0(%rbp,%rdx), %rdx
movl %r9d, 0x4(%rdx)
movq %rsi, 0x18(%rdx)
movq %rdx, 0x10(%rsi)
jmp 0x13bd1
movq 0x18(%rdi), %r15
movq 0x18(%r15), %r9
movq 0x18(%r9), %rax
movq %rax, -0x18(%rsp)
movq 0x20(%rax), %rcx
movq %rcx, -0x20(%rsp)
movq 0x18(%rcx), %rax
movq %rax, -0x10(%rsp)
movq 0x10(%r11), %r12
movq 0x10(%r12), %r13
movq 0x20(%r12), %rax
movq 0x20(%r13), %rbx
movq 0x10(%rbx), %r14
movl (%rcx), %ecx
movl %ecx, -0x24(%rsp)
movslq 0x4(%r13), %rsi
movslq 0x230b94(%rip), %rcx    # 0x244610
movl %ecx, 0x4(%rax)
movl %ecx, (%r12)
leaq 0x13f66(%rip), %rax     # 0x279f0
movq %r12, (%rax,%rcx,8)
leaq 0x1415b(%rip), %rdx     # 0x27bf0
movl $0x5, %r10d
movl %r10d, (%rdx,%rcx,4)
movq %rdx, %r10
leaq 0x1(%rcx), %rbp
movq 0x20(%r9), %rdx
movl %ebp, 0x4(%rdx)
movl %ebp, (%r9)
movq 0x20(%r15), %rdx
movl %ebp, 0x4(%rdx)
movl %ebp, (%r15)
movl $0x5, %edx
movl %edx, 0x4(%r10,%rcx,4)
movq %r15, 0x8(%rax,%rcx,8)
movq -0x8(%rsp), %rdx
movq %r11, (%rax,%rdx,8)
movq %rdi, (%rax,%r8,8)
leaq (%rcx,%rcx,2), %rbp
shlq $0x8, %rbp
leaq 0x230b3b(%rip), %r10    # 0x244620
leaq (%r10,%rbp), %rax
addq $0x3900, %rax           # imm = 0x3900
movl %esi, (%rax)
movq %r14, 0x10(%rax)
movq %rax, 0x18(%r14)
movq %rbx, 0x18(%rax)
movq %rax, 0x10(%rbx)
leaq 0x140e8(%rip), %rbx     # 0x27bf0
incl (%rbx,%rsi,4)
leaq (%r10,%rbp), %rbx
addq $0x3940, %rbx           # imm = 0x3940
movl %esi, 0x4(%rbx)
movq %r12, 0x18(%rbx)
movq %rbx, 0x10(%r12)
leaq 0x3980(%rbp,%r10), %rsi
movl %edx, 0x44(%rsi)
movl %edx, (%rsi)
movq %r13, 0x10(%rsi)
movq %rsi, 0x18(%r13)
movq %r11, 0x18(%rsi)
movq %rsi, 0x10(%r11)
leaq 0x3a00(%rbp,%r10), %rsi
movl %r8d, 0x44(%rsi)
movl %r8d, (%rsi)
movq %rdi, 0x10(%rsi)
movq %rsi, 0x18(%rdi)
movl -0x24(%rsp), %edi
leaq 0x3a80(%rbp,%r10), %rsi
movq %r15, 0x18(%rsi)
movq %rsi, 0x10(%r15)
leaq 0x3ac0(%rbp,%r10), %rsi
movq %r12, 0x10(%rsi)
movq %rsi, 0x18(%r12)
leaq 0x3b00(%rbp,%r10), %rsi
movl %r8d, 0x44(%rsi)
movl %r8d, (%rsi)
movq -0x18(%rsp), %rdx
movq %rdx, 0x18(%rsi)
movq %rsi, 0x10(%rdx)
leaq 0x3b80(%rbp,%r10), %rsi
movl %edi, (%rsi)
movq -0x10(%rsp), %rdx
movq %rdx, 0x18(%rsi)
movq %rsi, 0x10(%rdx)
movq -0x20(%rsp), %rdx
movq %rdx, 0x10(%rsi)
movq %rsi, 0x18(%rdx)
leaq (%r10,%rbp), %rdx
addq $0x3bc0, %rdx           # imm = 0x3BC0
movl %edi, 0x4(%rdx)
movq %r9, 0x10(%rdx)
movq %rdx, 0x18(%r9)
movslq %edi, %rdx
leaq 0x14015(%rip), %rsi     # 0x27bf0
incl (%rsi,%rdx,4)
addl $0xc, 0x230a2f(%rip)    # 0x244614
addl $0x2, %ecx
movl %ecx, 0x230a22(%rip)    # 0x244610
addq $0x100, %rax            # imm = 0x100
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq