// File: /workspace/github_cpp_makefile_star2_O1/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 0x12f88
movq %r15, %rdi
callq 0xf10c
movq %r15, %rdi
movsd 0x8(%rsp), %xmm0
callq 0xf57c
leaq 0x108(%rsp), %rbx
xorpd %xmm0, %xmm0
movupd %xmm0, 0x20(%rbx)
xorl %eax, %eax
movq %rax, 0x30(%rbx)
movupd %xmm0, 0x8(%rbx)
leaq 0xc952(%rip), %rcx      # 0x1bcb8
movq %rcx, -0xc0(%rbx)
leaq 0xc98c(%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, 0x29(%rcx)
movupd %xmm0, 0x20(%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 0xa19a
xorpd %xmm0, %xmm0
movsd 0x8(%rsp), %xmm1
ucomisd %xmm0, %xmm1
jbe 0xf410
leaq 0x48(%rsp), %rdi
movl $0x1, %esi
movq %r14, %rdx
movl $0x2, %ecx
movl $0x2, %r8d
callq 0xa738
jmp 0xf51a
leaq 0x48(%rsp), %r12
movq (%r12), %rax
movq -0x18(%rax), %rsi
addq %r12, %rsi
leaq 0x10(%rsp), %rdi
callq 0xa346
xorpd %xmm0, %xmm0
movapd %xmm0, 0x30(%rsp)
movq $0x0, 0x40(%rsp)
movl $0x40, %edi
callq 0x3210
movq %rax, %r15
leaq 0x30(%rsp), %rsi
movq %rax, (%rsi)
movq %rax, 0x8(%rsi)
addq $0x40, %rax
movq %rax, 0x10(%rsi)
xorpd %xmm0, %xmm0
movupd %xmm0, 0x30(%r15)
movupd %xmm0, 0x20(%r15)
movupd %xmm0, 0x10(%r15)
movupd %xmm0, (%r15)
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 0x9b74
leaq 0x48(%rsp), %rdi
movb $0x1, 0xbc(%rdi)
movl $0x1, %esi
movq %r14, %rdx
movl $0x3, %ecx
movl $0x3, %r8d
callq 0xa738
movq (%r14), %rsi
cmpq %rsi, 0x8(%r14)
je 0xf50d
movq %r14, %rdi
callq 0x13a4c
movl $0x40, %esi
movq %r15, %rdi
callq 0x3220
leaq 0xc7ff(%rip), %rsi      # 0x1bd20
leaq 0x48(%rsp), %rdi
callq 0xa574
movq %rbx, %rdi
callq 0x9760
addq $0x148, %rsp            # imm = 0x148
popq %rbx
popq %r12
popq %r14
popq %r15
retq
jmp 0xf546
jmp 0xf558
movq %rax, %r14
movl $0x40, %esi
movq %r15, %rdi
callq 0x3220
jmp 0xf55b
movq %rax, %r14
leaq 0xc7be(%rip), %rsi      # 0x1bd20
leaq 0x48(%rsp), %rdi
callq 0xa574
movq %rbx, %rdi
callq 0x9760
movq %r14, %rdi
callq 0x3380