// File: /workspace/github_cpp_makefile_star2_O2/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 %rbx
pushq %rax
movq %rdi, %rbx
movq (%rdi), %rax
callq *0x10(%rax)
movq (%rbx), %rax
movq -0x18(%rax), %rax
cmpq $0x0, 0x8(%rbx,%rax)
je 0x9bb9
movq %rbx, %rdi
callq 0x9c50
movq %rax, %r14
movq %rbx, %rdi
movq %r14, %rsi
callq 0x9c6a
movq %rbx, %rdi
callq 0x9fd2
movq %rbx, %rdi
xorl %esi, %esi
callq 0xa022
cmpq $0x0, 0x98(%rbx)
je 0x9b62
movq %rbx, %rdi
callq 0x9c50
movq %rax, %r15
movq %rbx, %rdi
movq %r14, %rsi
movq %rax, %rdx
callq 0xa058
testb %al, %al
je 0x9c30
movq %rbx, %rdi
movq %r15, %rsi
callq 0xa11c
cmpq $0x0, 0x98(%rbx)
movq %r15, %r14
jne 0x9af0
movq (%rbx), %rax
movq -0x18(%rax), %rax
cmpq $0x0, 0x8(%rbx,%rax)
movq %r15, %r14
jne 0x9af0
xorl %r15d, %r15d
movq 0x8(%rbx), %rax
movq 0x10(%rbx), %rcx
subq %rax, %rcx
sarq $0x3, %rcx
cmpq %rcx, %r15
jae 0x9bc0
movq (%rax,%r15,8), %rdi
movq 0x18(%rdi), %r14
testq %r14, %r14
je 0x9bb4
cmpb $0x0, 0x5(%rdi)
jne 0x9bb4
movb 0xbc(%rbx), %bpl
xorb 0x4(%rdi), %bpl
callq 0x7c11
ucomisd 0x9b2c(%rip), %xmm0     # 0x136d0
seta %al
cmpb %al, %bpl
jne 0x9bb4
movq %r14, %rdi
callq 0x8299
incq %r15
jmp 0x9b65
xorl %ebp, %ebp
jmp 0x9c42
movq 0x20(%rbx), %rax
cmpq 0x28(%rbx), %rax
je 0x9bd2
movq %rbx, %rdi
callq 0xa3e8
xorl %r14d, %r14d
movq 0x8(%rbx), %rax
movq 0x10(%rbx), %rcx
subq %rax, %rcx
sarq $0x3, %rcx
cmpq %rcx, %r14
jae 0x9c07
movq (%rax,%r14,8), %rsi
cmpq $0x0, 0x18(%rsi)
je 0x9c02
cmpb $0x0, 0x5(%rsi)
jne 0x9c02
movq %rbx, %rdi
callq 0xa6ce
incq %r14
jmp 0x9bd5
movb $0x1, %bpl
cmpb $0x0, 0xbe(%rbx)
je 0x9c32
movq %rbx, %rdi
callq 0xa834
jmp 0x9c32
jmp 0x9c23
jmp 0x9c23
jmp 0x9c23
movq %rax, %rdi
callq 0x30d0
callq 0x3370
xorl %ebp, %ebp
movq %rbx, %rdi
callq 0xa982
movq %rbx, %rdi
callq 0x9fd2
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
nop