// File: /workspace/github_cpp_makefile_star2_O1/hzeller[P]gcode-multi-shell-extrude/third_party/clipper.cpp
// Function: ClipperLib::Clipper::ExecuteInternal()
bool Clipper::ExecuteInternal()
{
  bool succeeded = true;
  try {
    Reset();
    if (!m_CurrentLM) return false;
    cInt botY = PopScanbeam();
    do {
      InsertLocalMinimaIntoAEL(botY);
      ClearGhostJoins();
      ProcessHorizontals(false);
      if (m_Scanbeam.empty()) break;
      cInt topY = PopScanbeam();
      succeeded = ProcessIntersections(botY, topY);
      if (!succeeded) break;
      ProcessEdgesAtTopOfScanbeam(topY);
      botY = topY;
    } while (!m_Scanbeam.empty() || m_CurrentLM);
  }
  catch(...) 
  {
    succeeded = false;
  }

  if (succeeded)
  {
    //fix orientations ...
    for (PolyOutList::size_type i = 0; i < m_PolyOuts.size(); ++i)
    {
      OutRec *outRec = m_PolyOuts[i];
      if (!outRec->Pts || outRec->IsOpen) continue;
      if ((outRec->IsHole ^ m_ReverseOutput) == (Area(*outRec) > 0))
        ReversePolyPtLinks(outRec->Pts);
    }

    if (!m_Joins.empty()) JoinCommonEdges();

    //unfortunately FixupOutPolygon() must be done after JoinCommonEdges()
    for (PolyOutList::size_type i = 0; i < m_PolyOuts.size(); ++i)
    {
      OutRec *outRec = m_PolyOuts[i];
      if (outRec->Pts && !outRec->IsOpen)
        FixupOutPolygon(*outRec);
    }

    if (m_StrictSimple) DoSimplePolygons();
  }

  ClearJoins();
  ClearGhostJoins();
  return succeeded;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdi, %rbx
movq (%rdi), %rax
callq *0x10(%rax)
movq (%rbx), %rax
movq -0x18(%rax), %rax
cmpq $0x0, 0x8(%rbx,%rax)
je 0xaddc
leaq 0x70(%rbx), %r14
movq 0x88(%rbx), %rsi
movq 0x20(%rsi), %r15
movq %r14, %rdi
callq 0x130e4
movb $0x1, %bpl
movq %rbx, %rdi
movq %r15, %rsi
callq 0xae28
movq %rbx, %rdi
callq 0xb1de
movq %rbx, %rdi
xorl %esi, %esi
callq 0xb232
cmpq $0x0, 0x98(%rbx)
je 0xacdc
movq 0x88(%rbx), %rsi
movq 0x20(%rsi), %r12
movq %r14, %rdi
callq 0x130e4
movq %rbx, %rdi
movq %r15, %rsi
movq %r12, %rdx
callq 0xb2ae
movl %eax, %ebp
testb %al, %al
je 0xacbe
movq %rbx, %rdi
movq %r12, %rsi
callq 0xb388
movq %r12, %r15
testb %bpl, %bpl
je 0xacdc
cmpq $0x0, 0x98(%rbx)
jne 0xac62
movq (%rbx), %rax
movq -0x18(%rax), %rax
cmpq $0x0, 0x8(%rbx,%rax)
jne 0xac62
testb $0x1, %bpl
je 0xadca
movq 0x8(%rbx), %rsi
movq 0x10(%rbx), %r15
subq %rsi, %r15
je 0xad6a
sarq $0x3, %r15
movb 0xbc(%rbx), %al
movb %al, 0xf(%rsp)
cmpq $0x1, %r15
adcq $0x0, %r15
xorl %r13d, %r13d
movq %rsi, 0x10(%rsp)
movq (%rsi,%r13,8), %rdi
movq 0x18(%rdi), %r12
testq %r12, %r12
je 0xad62
cmpb $0x0, 0x5(%rdi)
jne 0xad62
movb 0x4(%rdi), %r14b
xorb 0xf(%rsp), %r14b
callq 0x89a7
movq 0x10(%rsp), %rsi
ucomisd 0x92c9(%rip), %xmm0     # 0x14008
seta %al
cmpb %al, %r14b
jne 0xad62
movq %r12, %rax
movq 0x18(%rax), %rcx
movq 0x20(%rax), %rdx
movq %rdx, 0x18(%rax)
movq %rcx, 0x20(%rax)
movq %rcx, %rax
cmpq %r12, %rcx
jne 0xad4a
incq %r13
cmpq %r15, %r13
jne 0xad11
movq 0x20(%rbx), %rax
cmpq 0x28(%rbx), %rax
je 0xad7c
movq %rbx, %rdi
callq 0xb6f2
movq 0x8(%rbx), %rax
cmpq %rax, 0x10(%rbx)
je 0xadb9
xorl %r14d, %r14d
movq (%rax,%r14,8), %rsi
cmpq $0x0, 0x18(%rsi)
je 0xada2
cmpb $0x0, 0x5(%rsi)
jne 0xada2
movq %rbx, %rdi
callq 0xbb22
incq %r14
movq 0x8(%rbx), %rax
movq 0x10(%rbx), %rcx
subq %rax, %rcx
sarq $0x3, %rcx
cmpq %rcx, %r14
jb 0xad89
cmpb $0x0, 0xbe(%rbx)
je 0xadca
movq %rbx, %rdi
callq 0xbd04
movq %rbx, %rdi
callq 0xbeaa
movq %rbx, %rdi
callq 0xb1de
jmp 0xadde
xorl %ebp, %ebp
andb $0x1, %bpl
movl %ebp, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0xadf9
jmp 0xadf9
jmp 0xadf9
movq %rax, %rdi
callq 0x30d0
callq 0x3350
xorl %ebp, %ebp
jmp 0xacdc
nop