// File: /workspace/github_cpp_makefile_star2_O2/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 %r14
pushq %rbx
subq $0x148, %rsp            # imm = 0x148
movsd %xmm0, 0x8(%rsp)
movq %rsi, %rbx
movq %rdi, %r14
movq %rsi, %rdi
callq 0xfa58
movq %r14, %rdi
callq 0xd132
movq %r14, %rdi
movsd 0x8(%rsp), %xmm0
callq 0xd3fc
leaq 0x108(%rsp), %rdi
xorpd %xmm0, %xmm0
movupd %xmm0, 0x20(%rdi)
andq $0x0, 0x30(%rdi)
movupd %xmm0, 0x8(%rdi)
leaq 0xda5a(%rip), %rax      # 0x1acb8
movq %rax, -0xc0(%rdi)
leaq 0xda94(%rip), %rax      # 0x1ad00
movq %rax, (%rdi)
leaq 0xc0(%rsp), %rax
andl $0x0, (%rax)
andq $0x0, 0x8(%rax)
movupd %xmm0, -0x70(%rax)
movupd %xmm0, -0x60(%rax)
movupd %xmm0, -0x50(%rax)
movupd %xmm0, -0x40(%rax)
movupd %xmm0, -0x30(%rax)
movupd %xmm0, -0x20(%rax)
movq %rax, 0x10(%rax)
movq %rax, 0x18(%rax)
xorl %ecx, %ecx
movb %cl, 0x60(%rax)
movupd %xmm0, 0x20(%rax)
movupd %xmm0, 0x29(%rax)
movb %cl, 0x44(%rax)
movb %cl, 0x46(%rax)
andw $0x0, 0x38(%rdi)
addq $0x10, %r14
pushq $0x1
popq %rcx
movq %r14, %rsi
xorl %edx, %edx
callq 0x9260
xorpd %xmm0, %xmm0
movsd 0x8(%rsp), %xmm1
ucomisd %xmm0, %xmm1
jbe 0xd2fb
leaq 0x48(%rsp), %rdi
pushq $0x1
popq %rsi
pushq $0x2
popq %rcx
movq %rbx, %rdx
movl %ecx, %r8d
callq 0x96e8
jmp 0xd3bf
leaq 0x48(%rsp), %r14
movq (%r14), %rax
movq -0x18(%rax), %rsi
addq %r14, %rsi
leaq 0x28(%rsp), %rdi
callq 0x93b4
leaq 0x10(%rsp), %rdi
pushq $0x4
popq %rsi
leaq 0x7(%rsp), %rdx
callq 0xfa60
movq 0x28(%rsp), %rax
movq 0x40(%rsp), %rcx
addq $-0xa, %rax
addq $0xa, %rcx
leaq 0x10(%rsp), %rsi
movq (%rsi), %rdx
movq %rax, (%rdx)
movq %rcx, 0x8(%rdx)
movq 0x38(%rsp), %rdi
addq $0xa, %rdi
movq %rdi, 0x10(%rdx)
movq %rcx, 0x18(%rdx)
movq 0x30(%rsp), %rcx
addq $-0xa, %rcx
movq %rdi, 0x20(%rdx)
movq %rcx, 0x28(%rdx)
movq %rax, 0x30(%rdx)
movq %rcx, 0x38(%rdx)
movq 0x48(%rsp), %rax
addq -0x18(%rax), %r14
pushq $0x1
popq %rcx
movq %r14, %rdi
xorl %edx, %edx
callq 0x8cd0
leaq 0x48(%rsp), %rdi
movb $0x1, 0xbc(%rdi)
pushq $0x1
popq %rsi
pushq $0x3
popq %rcx
movq %rbx, %rdx
movl %ecx, %r8d
callq 0x96e8
movq (%rbx), %rsi
cmpq %rsi, 0x8(%rbx)
je 0xd3b5
movq %rbx, %rdi
callq 0xfab2
leaq 0x10(%rsp), %rdi
callq 0x673c
leaq 0x48(%rsp), %rdi
callq 0x961c
addq $0x148, %rsp            # imm = 0x148
popq %rbx
popq %r14
retq
jmp 0xd3d8
jmp 0xd3e7
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x673c
jmp 0xd3ea
movq %rax, %rbx
leaq 0x48(%rsp), %rdi
callq 0x961c
movq %rbx, %rdi
callq 0x33a0