// File: /workspace/github_cpp_makefile_star2_O3/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 0xaacc
leaq 0x70(%rbx), %r14
movq 0x88(%rbx), %rsi
movq 0x20(%rsi), %r15
movq %r14, %rdi
callq 0x12b28
movq %rbx, %rdi
movq %r15, %rsi
callq 0xab20
movq %rbx, %rdi
callq 0xaeea
movq %rbx, %rdi
xorl %esi, %esi
callq 0xaf38
cmpq $0x0, 0x98(%rbx)
je 0xa9dd
movq 0x88(%rbx), %rsi
movq 0x20(%rsi), %r12
movq %r14, %rdi
callq 0x12b28
movq %rbx, %rdi
movq %r15, %rsi
movq %r12, %rdx
callq 0xafb4
testb %al, %al
je 0xaae3
movq %rbx, %rdi
movq %r12, %rsi
callq 0xb080
cmpq $0x0, 0x98(%rbx)
movq %r12, %r15
jne 0xa963
movq (%rbx), %rax
movq -0x18(%rax), %rax
cmpq $0x0, 0x8(%rbx,%rax)
movq %r12, %r15
jne 0xa963
movq 0x8(%rbx), %r14
movq 0x10(%rbx), %r12
movq %r12, 0x10(%rsp)
subq %r14, %r12
je 0xaa5c
sarq $0x3, %r12
movb 0xbc(%rbx), %al
movb %al, 0xf(%rsp)
cmpq $0x1, %r12
adcq $0x0, %r12
xorl %r13d, %r13d
movq (%r14,%r13,8), %rdi
movq 0x18(%rdi), %rbp
testq %rbp, %rbp
je 0xaa54
cmpb $0x0, 0x5(%rdi)
jne 0xaa54
movb 0x4(%rdi), %r15b
xorb 0xf(%rsp), %r15b
callq 0x86a5
ucomisd 0xac9f(%rip), %xmm0     # 0x156d0
seta %al
cmpb %al, %r15b
jne 0xaa54
movq %rbp, %rax
movq 0x18(%rax), %rcx
movq 0x20(%rax), %rdx
movq %rdx, 0x18(%rax)
movq %rcx, 0x20(%rax)
movq %rcx, %rax
cmpq %rbp, %rcx
jne 0xaa3c
incq %r13
cmpq %r12, %r13
jne 0xaa08
movq 0x20(%rbx), %rax
cmpq 0x28(%rbx), %rax
movq 0x10(%rsp), %rcx
je 0xaa7b
movq %rbx, %rdi
callq 0xb3c6
movq 0x8(%rbx), %r14
movq 0x10(%rbx), %rcx
cmpq %r14, %rcx
je 0xaab6
xorl %r12d, %r12d
movq (%r14,%r12,8), %rsi
cmpq $0x0, 0x18(%rsi)
je 0xaaa4
cmpb $0x0, 0x5(%rsi)
jne 0xaaa4
movq %rbx, %rdi
callq 0xb812
movq 0x8(%rbx), %r14
movq 0x10(%rbx), %rcx
incq %r12
movq %rcx, %rax
subq %r14, %rax
sarq $0x3, %rax
cmpq %rax, %r12
jb 0xaa83
movb $0x1, %bpl
cmpb $0x0, 0xbe(%rbx)
je 0xaae5
movq %rbx, %rdi
callq 0xb9aa
jmp 0xaae5
xorl %ebp, %ebp
jmp 0xaaf5
jmp 0xaad6
jmp 0xaad6
jmp 0xaad6
movq %rax, %rdi
callq 0x30d0
callq 0x3350
xorl %ebp, %ebp
movq %rbx, %rdi
callq 0xbb36
movq %rbx, %rdi
callq 0xaeea
movl %ebp, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq