// File: /workspace/github_cpp_makefile_star2_O3/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x198, %rsp            # imm = 0x198
movl %r8d, 0x38(%rsp)
movl %ecx, 0x8(%rsp)
movq %rdx, 0x60(%rsp)
movq %rsi, %r12
movq %rdi, %r13
movq (%rdi), %rbp
movq 0x8(%rdi), %rbx
movq (%rsi), %r14
movq 0x8(%rsi), %r15
movq %r15, %rsi
subq %r14, %rsi
sarq $0x4, %rsi
pxor %xmm0, %xmm0
leaq 0x40(%rsp), %rdi
movdqa %xmm0, (%rdi)
movq $0x0, 0x10(%rdi)
movq %rsi, 0x18(%rsp)
callq 0x11d92
movq %rbx, %rax
subq %rbp, %rax
sarq $0x4, %rax
movq %rax, 0x10(%rsp)
cmpb $0x0, 0x8(%rsp)
movq %rbp, 0x78(%rsp)
movq %rbx, 0x70(%rsp)
je 0x11098
cmpq %r14, %r15
je 0x111a0
movq 0x18(%rsp), %rax
cmpq $0x1, %rax
adcq $0x0, %rax
movq %rax, 0x8(%rsp)
xorl %r14d, %r14d
pxor %xmm0, %xmm0
movdqa %xmm0, 0x80(%rsp)
movq $0x0, 0x90(%rsp)
leaq 0x80(%rsp), %rdi
movq 0x10(%rsp), %rsi
callq 0x11e70
movq (%r13), %rax
cmpq %rax, 0x8(%r13)
je 0x11056
movq %r14, %r15
shlq $0x4, %r15
xorl %ebp, %ebp
xorl %ebx, %ebx
movq (%r12), %rcx
movdqu (%rcx,%r15), %xmm0
movdqu (%rax,%rbp), %xmm1
paddq %xmm0, %xmm1
movdqa %xmm1, 0x20(%rsp)
movq 0x88(%rsp), %rsi
cmpq 0x90(%rsp), %rsi
je 0x11029
movdqa 0x20(%rsp), %xmm0
movdqu %xmm0, (%rsi)
addq $0x10, 0x88(%rsp)
jmp 0x1103b
leaq 0x80(%rsp), %rdi
leaq 0x20(%rsp), %rdx
callq 0x72ce
incq %rbx
movq (%r13), %rax
movq 0x8(%r13), %rcx
subq %rax, %rcx
sarq $0x4, %rcx
addq $0x10, %rbp
cmpq %rcx, %rbx
jb 0x10fe9
leaq 0x40(%rsp), %rdi
leaq 0x80(%rsp), %rsi
callq 0x11f18
movq 0x80(%rsp), %rdi
testq %rdi, %rdi
je 0x11085
movq 0x90(%rsp), %rsi
subq %rdi, %rsi
callq 0x3220
incq %r14
cmpq 0x8(%rsp), %r14
jne 0x10fa9
jmp 0x111a0
cmpq %r14, %r15
je 0x111a0
movq 0x18(%rsp), %rax
cmpq $0x1, %rax
adcq $0x0, %rax
movq %rax, 0x8(%rsp)
xorl %r14d, %r14d
pxor %xmm0, %xmm0
movdqa %xmm0, 0x80(%rsp)
movq $0x0, 0x90(%rsp)
leaq 0x80(%rsp), %rdi
movq 0x10(%rsp), %rsi
callq 0x11e70
movq (%r13), %rax
cmpq %rax, 0x8(%r13)
je 0x11163
movq %r14, %r15
shlq $0x4, %r15
xorl %ebp, %ebp
xorl %ebx, %ebx
movq (%r12), %rcx
movdqu (%rcx,%r15), %xmm0
movdqu (%rax,%rbp), %xmm1
psubq %xmm1, %xmm0
movdqa %xmm0, 0x20(%rsp)
movq 0x88(%rsp), %rsi
cmpq 0x90(%rsp), %rsi
je 0x11136
movdqa 0x20(%rsp), %xmm0
movdqu %xmm0, (%rsi)
addq $0x10, 0x88(%rsp)
jmp 0x11148
leaq 0x80(%rsp), %rdi
leaq 0x20(%rsp), %rdx
callq 0x72ce
incq %rbx
movq (%r13), %rax
movq 0x8(%r13), %rcx
subq %rax, %rcx
sarq $0x4, %rcx
addq $0x10, %rbp
cmpq %rcx, %rbx
jb 0x110f6
leaq 0x40(%rsp), %rdi
leaq 0x80(%rsp), %rsi
callq 0x11f18
movq 0x80(%rsp), %rdi
testq %rdi, %rdi
je 0x11192
movq 0x90(%rsp), %rsi
subq %rdi, %rsi
callq 0x3220
incq %r14
cmpq 0x8(%rsp), %r14
jne 0x110b6
pxor %xmm0, %xmm0
leaq 0x20(%rsp), %rdi
movdqa %xmm0, (%rdi)
movq $0x0, 0x10(%rdi)
movl 0x38(%rsp), %ebp
movzbl %bpl, %eax
movq 0x18(%rsp), %rbx
addq %rbx, %rax
movq 0x10(%rsp), %rcx
leaq 0x1(%rcx), %rsi
imulq %rax, %rsi
callq 0x11d92
xorb $0x1, %bpl
movzbl %bpl, %eax
subq %rax, %rbx
movq %rbx, 0x68(%rsp)
je 0x1144e
movq 0x10(%rsp), %rax
cmpq $0x1, %rax
adcq $0x0, %rax
movq %rax, 0x38(%rsp)
xorl %r12d, %r12d
leaq 0x80(%rsp), %r13
leaq 0x1(%r12), %rax
movq %rax, 0x8(%rsp)
movq 0x70(%rsp), %rax
cmpq 0x78(%rsp), %rax
je 0x1143b
xorl %ebp, %ebp
pxor %xmm0, %xmm0
movdqa %xmm0, 0x80(%rsp)
movq $0x0, 0x90(%rsp)
movl $0x4, %esi
movq %r13, %rdi
callq 0x11e70
movq %r12, %rax
xorl %edx, %edx
divq 0x18(%rsp)
movq 0x40(%rsp), %rcx
leaq (%rdx,%rdx,2), %r15
movq %rbp, %rax
xorl %edx, %edx
divq 0x10(%rsp)
movq %rdx, %r14
shlq $0x4, %r14
movq (%rcx,%r15,8), %rdx
addq %r14, %rdx
movq 0x88(%rsp), %rsi
cmpq 0x90(%rsp), %rsi
je 0x112a7
movdqu (%rdx), %xmm0
movdqu %xmm0, (%rsi)
movq 0x88(%rsp), %rsi
addq $0x10, %rsi
movq %rsi, 0x88(%rsp)
jmp 0x112b7
movq %r13, %rdi
callq 0x12168
movq 0x88(%rsp), %rsi
movq 0x8(%rsp), %rax
xorl %edx, %edx
divq 0x18(%rsp)
movq 0x40(%rsp), %rax
leaq (%rdx,%rdx,2), %rbx
addq (%rax,%rbx,8), %r14
cmpq 0x90(%rsp), %rsi
je 0x112f9
movdqu (%r14), %xmm0
movdqu %xmm0, (%rsi)
movq 0x88(%rsp), %rsi
addq $0x10, %rsi
movq %rsi, 0x88(%rsp)
jmp 0x1130c
movq %r13, %rdi
movq %r14, %rdx
callq 0x12168
movq 0x88(%rsp), %rsi
movq 0x40(%rsp), %rcx
incq %rbp
movq %rbp, %rax
xorl %edx, %edx
divq 0x10(%rsp)
movq %rdx, %r14
shlq $0x4, %r14
movq (%rcx,%rbx,8), %rdx
addq %r14, %rdx
cmpq 0x90(%rsp), %rsi
je 0x11354
movdqu (%rdx), %xmm0
movdqu %xmm0, (%rsi)
movq 0x88(%rsp), %rsi
addq $0x10, %rsi
movq %rsi, 0x88(%rsp)
jmp 0x11364
movq %r13, %rdi
callq 0x12168
movq 0x88(%rsp), %rsi
movq 0x40(%rsp), %rax
addq (%rax,%r15,8), %r14
cmpq 0x90(%rsp), %rsi
je 0x1138b
movdqu (%r14), %xmm0
movdqu %xmm0, (%rsi)
addq $0x10, 0x88(%rsp)
jmp 0x11396
movq %r13, %rdi
movq %r14, %rdx
callq 0x12168
movq %r13, %rdi
callq 0x862b
ucomisd 0x432a(%rip), %xmm0     # 0x156d0
jae 0x11406
movq 0x80(%rsp), %rax
movq 0x88(%rsp), %rcx
cmpq %rcx, %rax
setne %dl
addq $-0x10, %rcx
cmpq %rax, %rcx
seta %sil
andb %dl, %sil
cmpb $0x1, %sil
jne 0x11406
addq $0x10, %rax
movups -0x10(%rax), %xmm0
movaps %xmm0, 0x180(%rsp)
movups (%rcx), %xmm0
movups %xmm0, -0x10(%rax)
movapd 0x180(%rsp), %xmm0
movupd %xmm0, (%rcx)
addq $-0x10, %rcx
leaq 0x10(%rax), %rdx
cmpq %rcx, %rax
movq %rdx, %rax
jb 0x113d6
leaq 0x20(%rsp), %rdi
movq %r13, %rsi
callq 0x11f18
movq 0x80(%rsp), %rdi
testq %rdi, %rdi
je 0x11430
movq 0x90(%rsp), %rsi
subq %rdi, %rsi
callq 0x3220
cmpq 0x38(%rsp), %rbp
jne 0x11226
movq 0x8(%rsp), %rax
movq %rax, %r12
cmpq 0x68(%rsp), %rax
jne 0x1120a
leaq 0x140(%rsp), %rbx
pxor %xmm0, %xmm0
movdqu %xmm0, 0x20(%rbx)
xorl %eax, %eax
movq %rax, 0x30(%rbx)
movdqu %xmm0, 0x8(%rbx)
leaq 0xa847(%rip), %rcx      # 0x1bcb8
movq %rcx, -0xc0(%rbx)
leaq 0xa881(%rip), %rcx      # 0x1bd00
movq %rcx, (%rbx)
leaq 0xf8(%rsp), %rcx
movl $0x0, (%rcx)
movq %rax, 0x8(%rcx)
movdqu %xmm0, -0x70(%rcx)
movdqu %xmm0, -0x60(%rcx)
movdqu %xmm0, -0x50(%rcx)
movdqu %xmm0, -0x40(%rcx)
movdqu %xmm0, -0x30(%rcx)
movdqu %xmm0, -0x20(%rcx)
movq %rcx, 0x10(%rcx)
movq %rcx, 0x18(%rcx)
movb %al, 0x60(%rcx)
movdqu %xmm0, 0x20(%rcx)
movdqu %xmm0, 0x29(%rcx)
movb %al, 0x44(%rcx)
movb %al, 0x46(%rcx)
movw $0x0, 0x38(%rbx)
movq 0x20(%rsp), %rsi
cmpq %rsi, 0x28(%rsp)
je 0x11522
xorl %r14d, %r14d
movabsq $-0x5555555555555555, %r15 # imm = 0xAAAAAAAAAAAAAAAB
xorl %r12d, %r12d
addq %r14, %rsi
movq %rbx, %rdi
xorl %edx, %edx
movl $0x1, %ecx
callq 0x985a
incq %r12
movq 0x20(%rsp), %rsi
movq 0x28(%rsp), %rax
subq %rsi, %rax
sarq $0x3, %rax
imulq %r15, %rax
addq $0x18, %r14
cmpq %rax, %r12
jb 0x114ef
leaq 0x80(%rsp), %rdi
movl $0x1, %esi
movq 0x60(%rsp), %rdx
movl $0x1, %ecx
movl $0x1, %r8d
callq 0xa41c
leaq 0xa7d5(%rip), %rsi      # 0x1bd20
leaq 0x80(%rsp), %rdi
callq 0xa258
movq %rbx, %rdi
callq 0x9440
leaq 0x20(%rsp), %rdi
callq 0x727a
leaq 0x40(%rsp), %rdi
callq 0x727a
addq $0x198, %rsp            # imm = 0x198
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x11592
movq %rax, %r14
jmp 0x115fb
movq %rax, %r14
jmp 0x11605
movq %rax, %r14
leaq 0xa784(%rip), %rsi      # 0x1bd20
leaq 0x80(%rsp), %rdi
callq 0xa258
movq %rbx, %rdi
callq 0x9440
jmp 0x115fb
jmp 0x115b9
jmp 0x115b9
jmp 0x115b9
movq %rax, %r14
movq 0x80(%rsp), %rdi
testq %rdi, %rdi
je 0x11605
movq 0x90(%rsp), %rsi
subq %rdi, %rsi
callq 0x3220
jmp 0x11605
movq %rax, %r14
movq 0x80(%rsp), %rdi
testq %rdi, %rdi
je 0x115fb
movq 0x90(%rsp), %rsi
subq %rdi, %rsi
callq 0x3220
leaq 0x20(%rsp), %rdi
callq 0x727a
leaq 0x40(%rsp), %rdi
callq 0x727a
movq %r14, %rdi
callq 0x3380