// File: /workspace/github_cpp_makefile_star2_O3/hzeller[P]gcode-multi-shell-extrude/third_party/clipper.cpp
// Function: ClipperLib::ClipperOffset::Execute(std::vector<std::vector<ClipperLib::IntPoint, std::allocator<ClipperLib::IntPoint>>, std::allocator<std::vector<ClipperLib::IntPoint, std::allocator<ClipperLib::IntPoint>>>>&, double)
void ClipperOffset::Execute(Paths& solution, double delta)
{
  solution.clear();
  FixOrientations();
  DoOffset(delta);
  
  //now clean up 'corners' ...
  Clipper clpr;
  clpr.AddPaths(m_destPolys, ptSubject, true);
  if (delta > 0)
  {
    clpr.Execute(ctUnion, solution, pftPositive, pftPositive);
  }
  else
  {
    IntRect r = clpr.GetBounds();
    Path outer(4);
    outer[0] = IntPoint(r.left - 10, r.bottom + 10);
    outer[1] = IntPoint(r.right + 10, r.bottom + 10);
    outer[2] = IntPoint(r.right + 10, r.top - 10);
    outer[3] = IntPoint(r.left - 10, r.top - 10);

    clpr.AddPath(outer, ptSubject, true);
    clpr.ReverseSolution(true);
    clpr.Execute(ctUnion, solution, pftNegative, pftNegative);
    if (solution.size() > 0) solution.erase(solution.begin());
  }
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x148, %rsp            # imm = 0x148
movsd %xmm0, 0x8(%rsp)
movq %rsi, %r14
movq %rdi, %r15
movq (%rsi), %rsi
movq %r14, %rdi
callq 0x129cc
movq %r15, %rdi
callq 0xed38
movq %r15, %rdi
movsd 0x8(%rsp), %xmm0
callq 0xf180
leaq 0x108(%rsp), %rbx
xorl %eax, %eax
movq %rax, 0x30(%rbx)
xorpd %xmm0, %xmm0
movupd %xmm0, 0x20(%rbx)
movupd %xmm0, 0x8(%rbx)
leaq 0xcd1c(%rip), %rcx      # 0x1bcb8
movq %rcx, -0xc0(%rbx)
leaq 0xcd56(%rip), %rcx      # 0x1bd00
movq %rcx, (%rbx)
leaq 0xc0(%rsp), %rcx
movl $0x0, (%rcx)
movq %rax, 0x8(%rcx)
movupd %xmm0, -0x70(%rcx)
movupd %xmm0, -0x60(%rcx)
movupd %xmm0, -0x50(%rcx)
movupd %xmm0, -0x40(%rcx)
movupd %xmm0, -0x30(%rcx)
movupd %xmm0, -0x20(%rcx)
movq %rcx, 0x10(%rcx)
movq %rcx, 0x18(%rcx)
movb %al, 0x60(%rcx)
movupd %xmm0, 0x20(%rcx)
movupd %xmm0, 0x29(%rcx)
movb %al, 0x44(%rcx)
movb %al, 0x46(%rcx)
movw $0x0, 0x38(%rbx)
addq $0x10, %r15
movq %rbx, %rdi
movq %r15, %rsi
xorl %edx, %edx
movl $0x1, %ecx
callq 0x9e96
xorpd %xmm0, %xmm0
movsd 0x8(%rsp), %xmm1
ucomisd %xmm0, %xmm1
jbe 0xf046
leaq 0x48(%rsp), %rdi
movl $0x1, %esi
movq %r14, %rdx
movl $0x2, %ecx
movl $0x2, %r8d
callq 0xa41c
jmp 0xf11e
leaq 0x48(%rsp), %r12
movq (%r12), %rax
movq -0x18(%rax), %rsi
addq %r12, %rsi
leaq 0x10(%rsp), %rdi
callq 0xa038
movl $0x40, %edi
callq 0x3210
movq %rax, %r15
leaq 0x30(%rsp), %rsi
movq %rax, (%rsi)
addq $0x40, %rax
movq %rax, 0x10(%rsi)
movq %rax, 0x8(%rsi)
movq 0x10(%rsp), %rax
movq 0x28(%rsp), %rcx
addq $-0xa, %rax
addq $0xa, %rcx
movq %rax, (%r15)
movq %rcx, 0x8(%r15)
movq 0x20(%rsp), %rdx
addq $0xa, %rdx
movq %rdx, 0x10(%r15)
movq %rcx, 0x18(%r15)
movq 0x18(%rsp), %rcx
addq $-0xa, %rcx
movq %rdx, 0x20(%r15)
movq %rcx, 0x28(%r15)
movq %rax, 0x30(%r15)
movq %rcx, 0x38(%r15)
movq 0x48(%rsp), %rax
addq -0x18(%rax), %r12
movq %r12, %rdi
xorl %edx, %edx
movl $0x1, %ecx
callq 0x985a
leaq 0x48(%rsp), %rdi
movb $0x1, 0xbc(%rdi)
movl $0x1, %esi
movq %r14, %rdx
movl $0x3, %ecx
movl $0x3, %r8d
callq 0xa41c
movq (%r14), %rsi
cmpq %rsi, 0x8(%r14)
je 0xf111
movq %r14, %rdi
callq 0x13474
movl $0x40, %esi
movq %r15, %rdi
callq 0x3220
leaq 0xcbfb(%rip), %rsi      # 0x1bd20
leaq 0x48(%rsp), %rdi
callq 0xa258
movq %rbx, %rdi
callq 0x9440
addq $0x148, %rsp            # imm = 0x148
popq %rbx
popq %r12
popq %r14
popq %r15
retq
jmp 0xf14a
jmp 0xf15c
movq %rax, %r14
movl $0x40, %esi
movq %r15, %rdi
callq 0x3220
jmp 0xf15f
movq %rax, %r14
leaq 0xcbba(%rip), %rsi      # 0x1bd20
leaq 0x48(%rsp), %rdi
callq 0xa258
movq %rbx, %rdi
callq 0x9440
movq %r14, %rdi
callq 0x3380