// File: hzeller[P]gcode-multi-shell-extrude/third_party/clipper.cpp
// Function: ClipperLib::Minkowski(std::vector<ClipperLib::IntPoint, std::allocator<ClipperLib::IntPoint>> const&, std::vector<ClipperLib::IntPoint, std::allocator<ClipperLib::IntPoint>> const&, std::vector<std::vector<ClipperLib::IntPoint, std::allocator<ClipperLib::IntPoint>>, std::allocator<std::vector<ClipperLib::IntPoint, std::allocator<ClipperLib::IntPoint>>>>&, bool, bool)
void Minkowski(const Path& poly, const Path& path, 
  Paths& solution, bool isSum, bool isClosed)
{
  int delta = (isClosed ? 1 : 0);
  size_t polyCnt = poly.size();
  size_t pathCnt = path.size();
  Paths pp;
  pp.reserve(pathCnt);
  if (isSum)
    for (size_t i = 0; i < pathCnt; ++i)
    {
      Path p;
      p.reserve(polyCnt);
      for (size_t j = 0; j < poly.size(); ++j)
        p.push_back(IntPoint(path[i].X + poly[j].X, path[i].Y + poly[j].Y));
      pp.push_back(p);
    }
  else
    for (size_t i = 0; i < pathCnt; ++i)
    {
      Path p;
      p.reserve(polyCnt);
      for (size_t j = 0; j < poly.size(); ++j)
        p.push_back(IntPoint(path[i].X - poly[j].X, path[i].Y - poly[j].Y));
      pp.push_back(p);
    }

  Paths quads; 
  quads.reserve((pathCnt + delta) * (polyCnt + 1));
  for (size_t i = 0; i < pathCnt - 1 + delta; ++i)
    for (size_t j = 0; j < polyCnt; ++j)
    {
      Path quad;
      quad.reserve(4);
      quad.push_back(pp[i % pathCnt][j % polyCnt]);
      quad.push_back(pp[(i + 1) % pathCnt][j % polyCnt]);
      quad.push_back(pp[(i + 1) % pathCnt][(j + 1) % polyCnt]);
      quad.push_back(pp[i % pathCnt][(j + 1) % polyCnt]);
      if (!Orientation(quad)) ReversePath(quad);
      quads.push_back(quad);
    }

  Clipper c;
  c.AddPaths(quads, ptSubject, true);
  c.Execute(ctUnion, solution, pftNonZero, pftNonZero);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x2a0, %rsp            # imm = 0x2A0
movb %r8b, %al
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
andb $0x1, %cl
movb %cl, -0x19(%rbp)
andb $0x1, %al
movb %al, -0x1a(%rbp)
movzbl -0x1a(%rbp), %eax
andl $0x1, %eax
movl %eax, -0x20(%rbp)
movq -0x8(%rbp), %rdi
callq 0xd900
movq %rax, -0x28(%rbp)
movq -0x10(%rbp), %rdi
callq 0xd900
movq %rax, -0x30(%rbp)
leaq -0x48(%rbp), %rdi
movq %rdi, -0x210(%rbp)
callq 0xcb10
movq -0x210(%rbp), %rdi
movq -0x30(%rbp), %rsi
callq 0x21400
jmp 0x1f44b
testb $0x1, -0x19(%rbp)
je 0x1f5bd
movq $0x0, -0x60(%rbp)
movq -0x60(%rbp), %rax
cmpq -0x30(%rbp), %rax
jae 0x1f5b8
leaq -0x78(%rbp), %rdi
movq %rdi, -0x218(%rbp)
callq 0xca90
movq -0x218(%rbp), %rdi
movq -0x28(%rbp), %rsi
callq 0x21500
jmp 0x1f48d
movq $0x0, -0x80(%rbp)
movq -0x80(%rbp), %rax
movq %rax, -0x220(%rbp)
movq -0x8(%rbp), %rdi
callq 0xd900
movq %rax, %rcx
movq -0x220(%rbp), %rax
cmpq %rcx, %rax
jae 0x1f58f
movq -0x10(%rbp), %rdi
movq -0x60(%rbp), %rsi
callq 0x20460
movq (%rax), %rax
movq %rax, -0x238(%rbp)
movq -0x8(%rbp), %rdi
movq -0x80(%rbp), %rsi
callq 0x20460
movq %rax, %rcx
movq -0x238(%rbp), %rax
movq (%rcx), %rcx
addq %rcx, %rax
movq %rax, -0x228(%rbp)
movq -0x10(%rbp), %rdi
movq -0x60(%rbp), %rsi
callq 0x20460
movq 0x8(%rax), %rax
movq %rax, -0x230(%rbp)
movq -0x8(%rbp), %rdi
movq -0x80(%rbp), %rsi
callq 0x20460
movq -0x230(%rbp), %rdx
movq -0x228(%rbp), %rsi
movq 0x8(%rax), %rax
addq %rax, %rdx
leaq -0x90(%rbp), %rdi
callq 0xcae0
jmp 0x1f53f
leaq -0x78(%rbp), %rdi
leaq -0x90(%rbp), %rsi
callq 0xcab0
jmp 0x1f551
jmp 0x1f553
movq -0x80(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x80(%rbp)
jmp 0x1f495
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
jmp 0x1fa9e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
leaq -0x78(%rbp), %rdi
callq 0xcff0
jmp 0x1fa9e
leaq -0x48(%rbp), %rdi
leaq -0x78(%rbp), %rsi
callq 0x21670
jmp 0x1f59e
leaq -0x78(%rbp), %rdi
callq 0xcff0
movq -0x60(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x60(%rbp)
jmp 0x1f45d
jmp 0x1f744
movq $0x0, -0x98(%rbp)
movq -0x98(%rbp), %rax
cmpq -0x30(%rbp), %rax
jae 0x1f742
leaq -0xb0(%rbp), %rdi
movq %rdi, -0x240(%rbp)
callq 0xca90
movq -0x240(%rbp), %rdi
movq -0x28(%rbp), %rsi
callq 0x21500
jmp 0x1f5fe
movq $0x0, -0xb8(%rbp)
movq -0xb8(%rbp), %rax
movq %rax, -0x248(%rbp)
movq -0x8(%rbp), %rdi
callq 0xd900
movq %rax, %rcx
movq -0x248(%rbp), %rax
cmpq %rcx, %rax
jae 0x1f70d
movq -0x10(%rbp), %rdi
movq -0x98(%rbp), %rsi
callq 0x20460
movq (%rax), %rax
movq %rax, -0x260(%rbp)
movq -0x8(%rbp), %rdi
movq -0xb8(%rbp), %rsi
callq 0x20460
movq %rax, %rcx
movq -0x260(%rbp), %rax
movq (%rcx), %rcx
subq %rcx, %rax
movq %rax, -0x250(%rbp)
movq -0x10(%rbp), %rdi
movq -0x98(%rbp), %rsi
callq 0x20460
movq 0x8(%rax), %rax
movq %rax, -0x258(%rbp)
movq -0x8(%rbp), %rdi
movq -0xb8(%rbp), %rsi
callq 0x20460
movq -0x258(%rbp), %rdx
movq -0x250(%rbp), %rsi
movq 0x8(%rax), %rax
subq %rax, %rdx
leaq -0xc8(%rbp), %rdi
callq 0xcae0
jmp 0x1f6c2
leaq -0xb0(%rbp), %rdi
leaq -0xc8(%rbp), %rsi
callq 0xcab0
jmp 0x1f6d7
jmp 0x1f6d9
movq -0xb8(%rbp), %rax
addq $0x1, %rax
movq %rax, -0xb8(%rbp)
jmp 0x1f609
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
leaq -0xb0(%rbp), %rdi
callq 0xcff0
jmp 0x1fa9e
leaq -0x48(%rbp), %rdi
leaq -0xb0(%rbp), %rsi
callq 0x21670
jmp 0x1f71f
leaq -0xb0(%rbp), %rdi
callq 0xcff0
movq -0x98(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x98(%rbp)
jmp 0x1f5c8
jmp 0x1f744
leaq -0xe0(%rbp), %rdi
movq %rdi, -0x268(%rbp)
callq 0xcb10
movq -0x268(%rbp), %rdi
movq -0x30(%rbp), %rsi
movslq -0x20(%rbp), %rax
addq %rax, %rsi
movq -0x28(%rbp), %rax
incq %rax
imulq %rax, %rsi
callq 0x21400
jmp 0x1f77b
movq $0x0, -0xe8(%rbp)
movq -0xe8(%rbp), %rax
movq -0x30(%rbp), %rcx
subq $0x1, %rcx
movslq -0x20(%rbp), %rdx
addq %rdx, %rcx
cmpq %rcx, %rax
jae 0x1f9f2
movq $0x0, -0xf0(%rbp)
movq -0xf0(%rbp), %rax
cmpq -0x28(%rbp), %rax
jae 0x1f9d9
leaq -0x108(%rbp), %rdi
movq %rdi, -0x270(%rbp)
callq 0xca90
movq -0x270(%rbp), %rdi
movl $0x4, %esi
callq 0x21500
jmp 0x1f7e7
movq -0xe8(%rbp), %rax
movq -0x30(%rbp), %rcx
xorl %edx, %edx
movq %rdx, -0x278(%rbp)
divq %rcx
movq %rdx, %rsi
leaq -0x48(%rbp), %rdi
callq 0xcb60
movq -0x278(%rbp), %rdx
movq %rax, %rdi
movq -0xf0(%rbp), %rax
movq -0x28(%rbp), %rcx
divq %rcx
movq %rdx, %rsi
callq 0x21aa0
movq %rax, %rsi
leaq -0x108(%rbp), %rdi
callq 0x21600
jmp 0x1f83b
movq -0xe8(%rbp), %rax
incq %rax
movq -0x30(%rbp), %rcx
xorl %edx, %edx
movq %rdx, -0x280(%rbp)
divq %rcx
movq %rdx, %rsi
leaq -0x48(%rbp), %rdi
callq 0xcb60
movq -0x280(%rbp), %rdx
movq %rax, %rdi
movq -0xf0(%rbp), %rax
movq -0x28(%rbp), %rcx
divq %rcx
movq %rdx, %rsi
callq 0x21aa0
movq %rax, %rsi
leaq -0x108(%rbp), %rdi
callq 0x21600
jmp 0x1f892
movq -0xe8(%rbp), %rax
incq %rax
movq -0x30(%rbp), %rcx
xorl %edx, %edx
movq %rdx, -0x288(%rbp)
divq %rcx
movq %rdx, %rsi
leaq -0x48(%rbp), %rdi
callq 0xcb60
movq -0x288(%rbp), %rdx
movq %rax, %rdi
movq -0xf0(%rbp), %rax
incq %rax
movq -0x28(%rbp), %rcx
divq %rcx
movq %rdx, %rsi
callq 0x21aa0
movq %rax, %rsi
leaq -0x108(%rbp), %rdi
callq 0x21600
jmp 0x1f8ec
movq -0xe8(%rbp), %rax
movq -0x30(%rbp), %rcx
xorl %edx, %edx
movq %rdx, -0x290(%rbp)
divq %rcx
movq %rdx, %rsi
leaq -0x48(%rbp), %rdi
callq 0xcb60
movq -0x290(%rbp), %rdx
movq %rax, %rdi
movq -0xf0(%rbp), %rax
incq %rax
movq -0x28(%rbp), %rcx
divq %rcx
movq %rdx, %rsi
callq 0x21aa0
movq %rax, %rsi
leaq -0x108(%rbp), %rdi
callq 0x21600
jmp 0x1f943
leaq -0x108(%rbp), %rdi
callq 0x10fa0
movb %al, -0x291(%rbp)
jmp 0x1f957
movb -0x291(%rbp), %al
testb $0x1, %al
jne 0x1f9a1
jmp 0x1f963
leaq -0x108(%rbp), %rdi
callq 0x1c2c0
jmp 0x1f971
jmp 0x1f9a1
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
jmp 0x1fa92
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
leaq -0x108(%rbp), %rdi
callq 0xcff0
jmp 0x1fa92
leaq -0xe0(%rbp), %rdi
leaq -0x108(%rbp), %rsi
callq 0x21670
jmp 0x1f9b6
leaq -0x108(%rbp), %rdi
callq 0xcff0
movq -0xf0(%rbp), %rax
addq $0x1, %rax
movq %rax, -0xf0(%rbp)
jmp 0x1f7b0
jmp 0x1f9db
movq -0xe8(%rbp), %rax
addq $0x1, %rax
movq %rax, -0xe8(%rbp)
jmp 0x1f786
leaq -0x208(%rbp), %rdi
xorl %esi, %esi
movl %esi, -0x298(%rbp)
callq 0x14780
movl -0x298(%rbp), %edx
movq -0x208(%rbp), %rax
movq -0x18(%rax), %rax
leaq -0x208(%rbp,%rax), %rdi
leaq -0xe0(%rbp), %rsi
movl $0x1, %ecx
callq 0x141c0
jmp 0x1fa32
movq -0x18(%rbp), %rdx
leaq -0x208(%rbp), %rdi
movl $0x1, %r8d
movl %r8d, %esi
movl %r8d, %ecx
callq 0x14ad0
jmp 0x1fa50
leaq -0x208(%rbp), %rdi
callq 0x14940
leaq -0xe0(%rbp), %rdi
callq 0xcf90
leaq -0x48(%rbp), %rdi
callq 0xcf90
addq $0x2a0, %rsp            # imm = 0x2A0
popq %rbp
retq
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
leaq -0x208(%rbp), %rdi
callq 0x14940
leaq -0xe0(%rbp), %rdi
callq 0xcf90
leaq -0x48(%rbp), %rdi
callq 0xcf90
movq -0x50(%rbp), %rdi
callq 0x3440