// File: /workspace/github_cpp_makefile_star2_O1/hzeller[P]gcode-multi-shell-extrude/third_party/clipper.cpp
// Function: ClipperLib::ClipperOffset::DoOffset(double)
void ClipperOffset::DoOffset(double delta)
{
  m_destPolys.clear();
  m_delta = delta;

  //if Zero offset, just copy any CLOSED polygons to m_p and return ...
  if (NEAR_ZERO(delta)) 
  {
    m_destPolys.reserve(m_polyNodes.ChildCount());
    for (int i = 0; i < m_polyNodes.ChildCount(); i++)
    {
      PolyNode& node = *m_polyNodes.Childs[i];
      if (node.m_endtype == etClosedPolygon)
        m_destPolys.push_back(node.Contour);
    }
    return;
  }

  //see offset_triginometry3.svg in the documentation folder ...
  if (MiterLimit > 2) m_miterLim = 2/(MiterLimit * MiterLimit);
  else m_miterLim = 0.5;

  double y;
  if (ArcTolerance <= 0.0) y = def_arc_tolerance;
  else if (ArcTolerance > std::fabs(delta) * def_arc_tolerance) 
    y = std::fabs(delta) * def_arc_tolerance;
  else y = ArcTolerance;
  //see offset_triginometry2.svg in the documentation folder ...
  double steps = pi / std::acos(1 - y / std::fabs(delta));
  if (steps > std::fabs(delta) * pi) 
    steps = std::fabs(delta) * pi;  //ie excessive precision check
  m_sin = std::sin(two_pi / steps);
  m_cos = std::cos(two_pi / steps);
  m_StepsPerRad = steps / two_pi;
  if (delta < 0.0) m_sin = -m_sin;

  m_destPolys.reserve(m_polyNodes.ChildCount() * 2);
  for (int i = 0; i < m_polyNodes.ChildCount(); i++)
  {
    PolyNode& node = *m_polyNodes.Childs[i];
    m_srcPoly = node.Contour;

    int len = (int)m_srcPoly.size();
    if (len == 0 || (delta <= 0 && (len < 3 || node.m_endtype != etClosedPolygon)))
        continue;

    m_destPoly.clear();
    if (len == 1)
    {
      if (node.m_jointype == jtRound)
      {
        double X = 1.0, Y = 0.0;
        for (cInt j = 1; j <= steps; j++)
        {
          m_destPoly.push_back(IntPoint(
            Round(m_srcPoly[0].X + X * delta),
            Round(m_srcPoly[0].Y + Y * delta)));
          double X2 = X;
          X = X * m_cos - m_sin * Y;
          Y = X2 * m_sin + Y * m_cos;
        }
      }
      else
      {
        double X = -1.0, Y = -1.0;
        for (int j = 0; j < 4; ++j)
        {
          m_destPoly.push_back(IntPoint(
            Round(m_srcPoly[0].X + X * delta),
            Round(m_srcPoly[0].Y + Y * delta)));
          if (X < 0) X = 1;
          else if (Y < 0) Y = 1;
          else X = -1;
        }
      }
      m_destPolys.push_back(m_destPoly);
      continue;
    }
    //build m_normals ...
    m_normals.clear();
    m_normals.reserve(len);
    for (int j = 0; j < len - 1; ++j)
      m_normals.push_back(GetUnitNormal(m_srcPoly[j], m_srcPoly[j + 1]));
    if (node.m_endtype == etClosedLine || node.m_endtype == etClosedPolygon)
      m_normals.push_back(GetUnitNormal(m_srcPoly[len - 1], m_srcPoly[0]));
    else
      m_normals.push_back(DoublePoint(m_normals[len - 2]));

    if (node.m_endtype == etClosedPolygon)
    {
      int k = len - 1;
      for (int j = 0; j < len; ++j)
        OffsetPoint(j, k, node.m_jointype);
      m_destPolys.push_back(m_destPoly);
    }
    else if (node.m_endtype == etClosedLine)
    {
      int k = len - 1;
      for (int j = 0; j < len; ++j)
        OffsetPoint(j, k, node.m_jointype);
      m_destPolys.push_back(m_destPoly);
      m_destPoly.clear();
      //re-build m_normals ...
      DoublePoint n = m_normals[len -1];
      for (int j = len - 1; j > 0; j--)
        m_normals[j] = DoublePoint(-m_normals[j - 1].X, -m_normals[j - 1].Y);
      m_normals[0] = DoublePoint(-n.X, -n.Y);
      k = 0;
      for (int j = len - 1; j >= 0; j--)
        OffsetPoint(j, k, node.m_jointype);
      m_destPolys.push_back(m_destPoly);
    }
    else
    {
      int k = 0;
      for (int j = 1; j < len - 1; ++j)
        OffsetPoint(j, k, node.m_jointype);

      IntPoint pt1;
      if (node.m_endtype == etOpenButt)
      {
        int j = len - 1;
        pt1 = IntPoint((cInt)Round(m_srcPoly[j].X + m_normals[j].X *
          delta), (cInt)Round(m_srcPoly[j].Y + m_normals[j].Y * delta));
        m_destPoly.push_back(pt1);
        pt1 = IntPoint((cInt)Round(m_srcPoly[j].X - m_normals[j].X *
          delta), (cInt)Round(m_srcPoly[j].Y - m_normals[j].Y * delta));
        m_destPoly.push_back(pt1);
      }
      else
      {
        int j = len - 1;
        k = len - 2;
        m_sinA = 0;
        m_normals[j] = DoublePoint(-m_normals[j].X, -m_normals[j].Y);
        if (node.m_endtype == etOpenSquare)
          DoSquare(j, k);
        else
          DoRound(j, k);
      }

      //re-build m_normals ...
      for (int j = len - 1; j > 0; j--)
        m_normals[j] = DoublePoint(-m_normals[j - 1].X, -m_normals[j - 1].Y);
      m_normals[0] = DoublePoint(-m_normals[1].X, -m_normals[1].Y);

      k = len - 1;
      for (int j = k - 1; j > 0; --j) OffsetPoint(j, k, node.m_jointype);

      if (node.m_endtype == etOpenButt)
      {
        pt1 = IntPoint((cInt)Round(m_srcPoly[0].X - m_normals[0].X * delta),
          (cInt)Round(m_srcPoly[0].Y - m_normals[0].Y * delta));
        m_destPoly.push_back(pt1);
        pt1 = IntPoint((cInt)Round(m_srcPoly[0].X + m_normals[0].X * delta),
          (cInt)Round(m_srcPoly[0].Y + m_normals[0].Y * delta));
        m_destPoly.push_back(pt1);
      }
      else
      {
        k = 1;
        m_sinA = 0;
        if (node.m_endtype == etOpenSquare)
          DoSquare(0, 1);
        else
          DoRound(0, 1);
      }
      m_destPolys.push_back(m_destPoly);
    }
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x88, %rsp
movaps %xmm0, 0x50(%rsp)
movq %rdi, %rbx
leaq 0x10(%rdi), %rbp
movq 0x10(%rdi), %rsi
movq %rbp, %rdi
callq 0x12f88
movapd 0x50(%rsp), %xmm0
movsd %xmm0, 0x70(%rbx)
movapd 0x58d8(%rip), %xmm4     # 0x14e90
andpd %xmm0, %xmm4
movsd 0x60ac(%rip), %xmm0     # 0x15670
ucomisd %xmm4, %xmm0
jbe 0xf63e
movq 0xd0(%rbx), %rax
subq 0xc8(%rbx), %rax
shrq $0x3, %rax
movslq %eax, %rsi
movq %rbp, %rdi
callq 0x12334
movq 0xd0(%rbx), %rax
subq 0xc8(%rbx), %rax
shrq $0x3, %rax
testl %eax, %eax
jle 0x10246
xorl %r14d, %r14d
movq 0xc8(%rbx), %rax
movq (%rax,%r14,8), %rsi
cmpl $0x0, 0x44(%rsi)
jne 0xf61d
movq %rbp, %rdi
callq 0x124c2
movq 0xd0(%rbx), %rax
subq 0xc8(%rbx), %rax
incq %r14
shrq $0x3, %rax
cltq
cmpq %rax, %r14
jl 0xf604
jmp 0x10246
movsd (%rbx), %xmm1
movsd 0x8(%rbx), %xmm0
movsd 0x49f1(%rip), %xmm2     # 0x14040
movapd %xmm2, %xmm3
cmpltsd %xmm1, %xmm2
mulsd %xmm1, %xmm1
divsd %xmm1, %xmm3
andpd %xmm2, %xmm3
movsd 0x49ac(%rip), %xmm1     # 0x14018
andnpd %xmm1, %xmm2
orpd %xmm3, %xmm2
movlpd %xmm2, 0x90(%rbx)
xorpd %xmm1, %xmm1
ucomisd %xmm0, %xmm1
jae 0xf698
movsd 0x5fea(%rip), %xmm1     # 0x15678
mulsd %xmm4, %xmm1
minsd %xmm0, %xmm1
jmp 0xf6a0
movsd 0x5fd8(%rip), %xmm1     # 0x15678
movapd %xmm4, 0x70(%rsp)
divsd %xmm4, %xmm1
movsd 0x4976(%rip), %xmm0     # 0x14028
subsd %xmm1, %xmm0
callq 0x31e0
movsd 0x4985(%rip), %xmm1     # 0x14048
movapd 0x70(%rsp), %xmm2
mulsd %xmm1, %xmm2
divsd %xmm0, %xmm1
minsd %xmm1, %xmm2
movapd %xmm2, 0x70(%rsp)
movsd 0x4995(%rip), %xmm0     # 0x14078
divsd %xmm2, %xmm0
movsd %xmm0, 0x20(%rsp)
callq 0x3090
movsd %xmm0, 0x80(%rbx)
movsd 0x20(%rsp), %xmm0
callq 0x33c0
movsd %xmm0, 0x88(%rbx)
movapd 0x70(%rsp), %xmm0
divsd 0x495d(%rip), %xmm0     # 0x14078
movsd %xmm0, 0x98(%rbx)
xorpd %xmm0, %xmm0
ucomisd 0x50(%rsp), %xmm0
jbe 0xf747
movsd 0x80(%rbx), %xmm0
xorpd 0x4981(%rip), %xmm0     # 0x140c0
movlpd %xmm0, 0x80(%rbx)
movq 0xd0(%rbx), %rax
subq 0xc8(%rbx), %rax
shrq $0x2, %rax
movslq %eax, %rsi
andq $-0x2, %rsi
movq %rbp, %rdi
callq 0x12334
movq 0xd0(%rbx), %rax
subq 0xc8(%rbx), %rax
shrq $0x3, %rax
testl %eax, %eax
jle 0x10246
leaq 0x28(%rbx), %r13
leaq 0x40(%rbx), %rax
movq %rax, 0x28(%rsp)
leaq 0x58(%rbx), %rax
movq %rax, 0x30(%rsp)
xorl %r14d, %r14d
movq %rbp, 0x38(%rsp)
movq %r13, 0x60(%rsp)
movq 0xc8(%rbx), %rax
movq (%rax,%r14,8), %rsi
movq %r13, %rdi
movq %rsi, 0x20(%rsp)
callq 0x749a
xorpd %xmm5, %xmm5
movq 0x30(%rbx), %r12
subq 0x28(%rbx), %r12
movq %r12, %r15
shrq $0x4, %r15
testl %r15d, %r15d
je 0x10226
ucomisd 0x50(%rsp), %xmm5
jae 0xf977
movq 0x40(%rbx), %rax
cmpq %rax, 0x48(%rbx)
je 0xf7f3
movq %rax, 0x48(%rbx)
cmpl $0x1, %r15d
movapd 0x70(%rsp), %xmm0
movsd 0x4813(%rip), %xmm4     # 0x14018
movsd 0x5e53(%rip), %xmm6     # 0x15660
jne 0xf995
movq %r14, %r12
movq 0x20(%rsp), %rax
cmpl $0x1, 0x40(%rax)
jne 0xfa59
ucomisd 0x47fb(%rip), %xmm0     # 0x14028
movq 0x28(%rsp), %r15
jb 0xfb99
xorpd %xmm7, %xmm7
movl $0x2, %r14d
movsd 0x47dd(%rip), %xmm8     # 0x14028
movq 0x28(%rbx), %rax
xorps %xmm0, %xmm0
cvtsi2sdq (%rax), %xmm0
movapd %xmm8, %xmm1
movapd 0x50(%rsp), %xmm3
mulsd %xmm3, %xmm1
addsd %xmm0, %xmm1
movapd %xmm1, %xmm0
cmpltsd %xmm5, %xmm0
movapd %xmm0, %xmm2
andpd %xmm6, %xmm2
andnpd %xmm4, %xmm0
orpd %xmm2, %xmm0
addsd %xmm1, %xmm0
cvttsd2si %xmm0, %rcx
xorps %xmm0, %xmm0
cvtsi2sdq 0x8(%rax), %xmm0
movapd %xmm7, %xmm1
mulsd %xmm3, %xmm1
addsd %xmm0, %xmm1
movapd %xmm1, %xmm0
cmpltsd %xmm5, %xmm0
movapd %xmm0, %xmm2
andpd %xmm6, %xmm2
andnpd %xmm4, %xmm0
orpd %xmm2, %xmm0
addsd %xmm1, %xmm0
cvttsd2si %xmm0, %rax
movq %rcx, (%rsp)
movq %rax, 0x8(%rsp)
movq 0x48(%rbx), %rsi
cmpq 0x50(%rbx), %rsi
je 0xf8e6
movupd (%rsp), %xmm0
movupd %xmm0, (%rsi)
addq $0x10, 0x48(%rbx)
jmp 0xf91f
movq %r15, %rdi
movq %rsp, %rdx
movsd %xmm7, 0x20(%rsp)
movsd %xmm8, 0x40(%rsp)
callq 0x75d4
movsd 0x40(%rsp), %xmm8
movsd 0x20(%rsp), %xmm7
movsd 0x5d4d(%rip), %xmm6     # 0x15660
xorpd %xmm5, %xmm5
movsd 0x46f9(%rip), %xmm4     # 0x14018
movsd 0x80(%rbx), %xmm0
movsd 0x88(%rbx), %xmm1
movapd %xmm7, %xmm2
mulsd %xmm0, %xmm2
movapd %xmm8, %xmm3
mulsd %xmm1, %xmm3
subsd %xmm2, %xmm3
mulsd %xmm1, %xmm7
mulsd %xmm0, %xmm8
addsd %xmm8, %xmm7
xorps %xmm0, %xmm0
cvtsi2sd %r14, %xmm0
incq %r14
movapd 0x70(%rsp), %xmm1
ucomisd %xmm0, %xmm1
movapd %xmm3, %xmm8
jae 0xf84b
jmp 0xfb99
cmpl $0x3, %r15d
jl 0x10226
movq 0x20(%rsp), %rax
cmpl $0x0, 0x44(%rax)
jne 0x10226
jmp 0xf7e5
movq %r14, 0x40(%rsp)
movq 0x58(%rbx), %rax
cmpq %rax, 0x60(%rbx)
je 0xf9a8
movq %rax, 0x60(%rbx)
movslq %r15d, %rsi
movq 0x30(%rsp), %rdi
callq 0x12584
leal -0x1(%r15), %r13d
cmpl $0x2, %r15d
jl 0xfa14
movl %r13d, %ebp
xorl %r14d, %r14d
movq 0x28(%rbx), %rdi
leaq (%rdi,%r14), %rsi
addq $0x10, %rsi
addq %r14, %rdi
callq 0xeba4
movsd %xmm0, (%rsp)
movsd %xmm1, 0x8(%rsp)
movq 0x60(%rbx), %rsi
cmpq 0x68(%rbx), %rsi
je 0xf9fe
movupd (%rsp), %xmm0
movupd %xmm0, (%rsi)
addq $0x10, 0x60(%rbx)
jmp 0xfa0b
movq 0x30(%rsp), %rdi
movq %rsp, %rdx
callq 0x13b2e
addq $0x10, %r14
decq %rbp
jne 0xf9c5
movq 0x20(%rsp), %rax
cmpl $0x2, 0x44(%rax)
jae 0xfbac
movslq %r13d, %rdi
movq 0x28(%rbx), %rsi
shlq $0x4, %rdi
addq %rsi, %rdi
callq 0xeba4
movsd %xmm0, (%rsp)
movsd %xmm1, 0x8(%rsp)
movq 0x60(%rbx), %rsi
cmpq 0x68(%rbx), %rsi
je 0xfbec
movupd (%rsp), %xmm0
jmp 0xfbe1
movl $0x4, %r14d
movsd 0x45a9(%rip), %xmm0     # 0x14010
movapd %xmm0, %xmm8
movapd %xmm0, %xmm7
movq 0x28(%rsp), %r15
movq 0x28(%rbx), %rax
xorps %xmm0, %xmm0
cvtsi2sdq (%rax), %xmm0
movapd %xmm7, %xmm1
movapd 0x50(%rsp), %xmm3
mulsd %xmm3, %xmm1
addsd %xmm0, %xmm1
movapd %xmm1, %xmm0
cmpltsd %xmm5, %xmm0
movapd %xmm0, %xmm2
andpd %xmm6, %xmm2
andnpd %xmm4, %xmm0
orpd %xmm2, %xmm0
addsd %xmm1, %xmm0
cvttsd2si %xmm0, %rcx
xorps %xmm0, %xmm0
cvtsi2sdq 0x8(%rax), %xmm0
movapd %xmm8, %xmm1
mulsd %xmm3, %xmm1
addsd %xmm0, %xmm1
movapd %xmm1, %xmm0
cmpltsd %xmm5, %xmm0
movapd %xmm0, %xmm2
andpd %xmm6, %xmm2
andnpd %xmm4, %xmm0
orpd %xmm2, %xmm0
addsd %xmm1, %xmm0
cvttsd2si %xmm0, %rax
movq %rcx, (%rsp)
movq %rax, 0x8(%rsp)
movq 0x48(%rbx), %rsi
cmpq 0x50(%rbx), %rsi
je 0xfb10
movupd (%rsp), %xmm0
movupd %xmm0, (%rsi)
addq $0x10, 0x48(%rbx)
jmp 0xfb49
movq %r15, %rdi
movq %rsp, %rdx
movsd %xmm7, 0x20(%rsp)
movapd %xmm8, 0x40(%rsp)
callq 0x75d4
movapd 0x40(%rsp), %xmm8
movsd 0x20(%rsp), %xmm7
movsd 0x5b23(%rip), %xmm6     # 0x15660
xorpd %xmm5, %xmm5
movsd 0x44cf(%rip), %xmm4     # 0x14018
ucomisd %xmm7, %xmm5
jbe 0xfb59
movsd 0x44d1(%rip), %xmm7     # 0x14028
jmp 0xfb90
ucomisd %xmm8, %xmm5
ja 0xfb68
movsd 0x44a8(%rip), %xmm7     # 0x14010
movapd %xmm8, %xmm0
cmpltsd %xmm5, %xmm0
movapd %xmm0, %xmm1
movsd 0x44aa(%rip), %xmm2     # 0x14028
andpd %xmm2, %xmm1
andnpd %xmm8, %xmm0
orpd %xmm1, %xmm0
movapd %xmm0, %xmm8
decl %r14d
jne 0xfa75
movq %rbp, %rdi
movq %r15, %rsi
callq 0x124c2
movq %r12, %r14
jmp 0x10226
shlq $0x1c, %r12
movabsq $-0x200000000, %rax     # imm = 0xFFFFFFFE00000000
addq %rax, %r12
movq 0x58(%rbx), %rax
sarq $0x1c, %r12
movupd (%rax,%r12), %xmm0
movapd %xmm0, (%rsp)
movq 0x60(%rbx), %rsi
cmpq 0x68(%rbx), %rsi
je 0xfbec
addq %r12, %rax
movupd (%rax), %xmm0
movupd %xmm0, (%rsi)
addq $0x10, 0x60(%rbx)
jmp 0xfbf9
movq 0x30(%rsp), %rdi
movq %rsp, %rdx
callq 0x13b2e
movq 0x40(%rsp), %r14
movq 0x20(%rsp), %rax
movl 0x44(%rax), %eax
cmpl $0x1, %eax
je 0xfc5c
testl %eax, %eax
jne 0xfd4b
movl %r13d, (%rsp)
testl %r15d, %r15d
movq %rsp, %r13
movq 0x20(%rsp), %rbp
jle 0xfc40
xorl %r12d, %r12d
movl 0x40(%rbp), %ecx
movq %rbx, %rdi
movl %r12d, %esi
movq %r13, %rdx
callq 0x1059c
incl %r12d
cmpl %r12d, %r15d
jne 0xfc27
movq 0x38(%rsp), %rbp
movq %rbp, %rdi
movq 0x28(%rsp), %rsi
callq 0x124c2
movq 0x60(%rsp), %r13
jmp 0x10226
movl %r13d, (%rsp)
testl %r15d, %r15d
movq %rsp, %r14
movq 0x20(%rsp), %rbp
jle 0xfc89
xorl %r12d, %r12d
movl 0x40(%rbp), %ecx
movq %rbx, %rdi
movl %r12d, %esi
movq %r14, %rdx
callq 0x1059c
incl %r12d
cmpl %r12d, %r15d
jne 0xfc70
movq 0x38(%rsp), %rbp
movq %rbp, %rdi
movq 0x28(%rsp), %r14
movq %r14, %rsi
callq 0x124c2
movq 0x40(%rbx), %rax
cmpq %rax, 0x48(%rbx)
je 0xfcac
movq %rax, 0x48(%rbx)
movslq %r13d, %rcx
movq 0x30(%rsp), %rax
movq (%rax), %rax
shlq $0x4, %rcx
movsd (%rax,%rcx), %xmm0
movsd 0x8(%rax,%rcx), %xmm1
cmpl $0x2, %r15d
movapd 0x43ee(%rip), %xmm3     # 0x140c0
jl 0xfcfc
movl %r13d, %edx
leaq 0x1(%rdx), %rcx
shlq $0x4, %rdx
addq %rax, %rdx
movupd -0x10(%rdx), %xmm2
xorpd %xmm3, %xmm2
movupd %xmm2, (%rdx)
addq $-0x10, %rdx
decq %rcx
cmpq $0x1, %rcx
jg 0xfce2
unpcklpd %xmm1, %xmm0            # xmm0 = xmm0[0],xmm1[0]
xorpd %xmm3, %xmm0
movupd %xmm0, (%rax)
movl $0x0, (%rsp)
testl %r15d, %r15d
movq %rsp, %r12
movq 0x20(%rsp), %r13
jle 0xfd36
decl %r15d
movl 0x40(%r13), %ecx
movq %rbx, %rdi
movl %r15d, %esi
movq %r12, %rdx
callq 0x1059c
testl %r15d, %r15d
jg 0xfd1c
movq %rbp, %rdi
movq %r14, %rsi
callq 0x124c2
movq 0x60(%rsp), %r13
jmp 0x10221
movl %r13d, 0x6c(%rsp)
movl $0x0, 0x1c(%rsp)
cmpl $0x3, %r15d
leaq 0x1c(%rsp), %r13
movq 0x20(%rsp), %rbp
jl 0xfd9b
movl $0x2, %r14d
subl %r15d, %r14d
movl $0x1, %r12d
movl 0x40(%rbp), %ecx
movq %rbx, %rdi
movl %r12d, %esi
movq %r13, %rdx
callq 0x1059c
leal (%r14,%r12), %eax
incl %eax
movl %r12d, %ecx
incl %ecx
movl %ecx, %r12d
cmpl $0x1, %eax
jne 0xfd77
xorpd %xmm0, %xmm0
movapd %xmm0, (%rsp)
movl 0x44(%rbp), %eax
movl 0x6c(%rsp), %r13d
movslq %r13d, %r12
cmpl $0x2, %eax
jne 0xfe7c
shlq $0x4, %r12
movq 0x28(%rbx), %rax
movq 0x58(%rbx), %rcx
xorps %xmm0, %xmm0
cvtsi2sdq (%rax,%r12), %xmm0
movsd (%rcx,%r12), %xmm1
movapd 0x50(%rsp), %xmm3
mulsd %xmm3, %xmm1
addsd %xmm0, %xmm1
movapd %xmm1, %xmm0
xorpd %xmm5, %xmm5
cmpltsd %xmm5, %xmm0
movapd %xmm0, %xmm2
movsd 0x5866(%rip), %xmm6     # 0x15660
andpd %xmm6, %xmm2
movsd 0x4212(%rip), %xmm4     # 0x14018
andnpd %xmm4, %xmm0
orpd %xmm2, %xmm0
addsd %xmm1, %xmm0
cvttsd2si %xmm0, %rdx
xorps %xmm0, %xmm0
cvtsi2sdq 0x8(%rax,%r12), %xmm0
movsd 0x8(%rcx,%r12), %xmm1
mulsd %xmm3, %xmm1
addsd %xmm0, %xmm1
movapd %xmm1, %xmm0
cmpltsd %xmm5, %xmm0
movapd %xmm0, %xmm2
andpd %xmm6, %xmm2
andnpd %xmm4, %xmm0
orpd %xmm2, %xmm0
addsd %xmm1, %xmm0
cvttsd2si %xmm0, %rax
movq %rdx, (%rsp)
movq %rax, 0x8(%rsp)
movq 0x48(%rbx), %rsi
cmpq 0x50(%rbx), %rsi
je 0xfee9
movapd (%rsp), %xmm0
movupd %xmm0, (%rsi)
addq $0x10, 0x48(%rbx)
jmp 0xff0a
leal -0x2(%r15), %edx
movl %edx, 0x1c(%rsp)
movq $0x0, 0x78(%rbx)
movq 0x58(%rbx), %rcx
shlq $0x4, %r12
movsd (%rcx,%r12), %xmm0
movsd 0x8(%rcx,%r12), %xmm1
movapd 0x4217(%rip), %xmm2     # 0x140c0
xorpd %xmm2, %xmm0
xorpd %xmm2, %xmm1
movlpd %xmm0, (%rcx,%r12)
movlpd %xmm1, 0x8(%rcx,%r12)
movq %rbx, %rdi
movl %r13d, %esi
cmpl $0x3, %eax
jne 0xfed0
callq 0x1086c
jmp 0xfed5
callq 0x10a92
movq 0x28(%rsp), %r14
leaq 0x1c(%rsp), %r12
movq 0x38(%rsp), %rbp
jmp 0xffce
movq 0x28(%rsp), %rdi
movq %rsp, %rdx
callq 0x1270c
movsd 0x5762(%rip), %xmm6     # 0x15660
xorpd %xmm5, %xmm5
movsd 0x410e(%rip), %xmm4     # 0x14018
movq 0x38(%rsp), %rbp
movq 0x28(%rbx), %rax
movq 0x58(%rbx), %rcx
xorps %xmm0, %xmm0
cvtsi2sdq (%rax,%r12), %xmm0
movsd (%rcx,%r12), %xmm1
movapd 0x50(%rsp), %xmm3
mulsd %xmm3, %xmm1
subsd %xmm1, %xmm0
movapd %xmm0, %xmm1
cmpltsd %xmm5, %xmm1
movapd %xmm1, %xmm2
andpd %xmm6, %xmm2
andnpd %xmm4, %xmm1
orpd %xmm2, %xmm1
addsd %xmm0, %xmm1
cvttsd2si %xmm1, %rdx
xorps %xmm0, %xmm0
cvtsi2sdq 0x8(%rax,%r12), %xmm0
movsd 0x8(%rcx,%r12), %xmm1
mulsd %xmm3, %xmm1
subsd %xmm1, %xmm0
movapd %xmm0, %xmm1
cmpltsd %xmm5, %xmm1
movapd %xmm1, %xmm2
andpd %xmm6, %xmm2
andnpd %xmm4, %xmm1
orpd %xmm2, %xmm1
addsd %xmm0, %xmm1
cvttsd2si %xmm1, %rax
movq %rdx, (%rsp)
movq %rax, 0x8(%rsp)
movq 0x48(%rbx), %rsi
cmpq 0x50(%rbx), %rsi
je 0xffb9
movapd (%rsp), %xmm0
movupd %xmm0, (%rsi)
addq $0x10, 0x48(%rbx)
movq 0x28(%rsp), %r14
jmp 0xffc9
movq 0x28(%rsp), %r14
movq %r14, %rdi
movq %rsp, %rdx
callq 0x1270c
leaq 0x1c(%rsp), %r12
cmpl $0x2, %r15d
movapd 0x40e6(%rip), %xmm1     # 0x140c0
jl 0x10009
movl %r13d, %ecx
leaq 0x1(%rcx), %rax
shlq $0x4, %rcx
movq 0x30(%rsp), %rdx
addq (%rdx), %rcx
movupd -0x10(%rcx), %xmm0
xorpd %xmm1, %xmm0
movupd %xmm0, (%rcx)
addq $-0x10, %rcx
decq %rax
cmpq $0x1, %rax
jg 0xffef
movq 0x30(%rsp), %rax
movq (%rax), %rax
movupd 0x10(%rax), %xmm0
xorpd %xmm1, %xmm0
movupd %xmm0, (%rax)
movl %r13d, 0x1c(%rsp)
cmpl $0x3, %r15d
movq 0x20(%rsp), %r15
jl 0x10049
decl %r13d
movl 0x40(%r15), %ecx
movq %rbx, %rdi
movl %r13d, %esi
movq %r12, %rdx
callq 0x1059c
cmpl $0x1, %r13d
jg 0x1002e
movl 0x44(%r15), %eax
cmpl $0x2, %eax
jne 0x1010e
movq 0x28(%rbx), %rax
movq 0x58(%rbx), %rcx
xorps %xmm0, %xmm0
cvtsi2sdq (%rax), %xmm0
movsd (%rcx), %xmm1
movapd 0x50(%rsp), %xmm3
mulsd %xmm3, %xmm1
subsd %xmm1, %xmm0
movapd %xmm0, %xmm1
xorpd %xmm5, %xmm5
cmpltsd %xmm5, %xmm1
movapd %xmm1, %xmm2
movsd 0x55cf(%rip), %xmm6     # 0x15660
andpd %xmm6, %xmm2
movsd 0x3f7b(%rip), %xmm4     # 0x14018
andnpd %xmm4, %xmm1
orpd %xmm2, %xmm1
addsd %xmm0, %xmm1
cvttsd2si %xmm1, %rdx
xorps %xmm0, %xmm0
cvtsi2sdq 0x8(%rax), %xmm0
movsd 0x8(%rcx), %xmm1
mulsd %xmm3, %xmm1
subsd %xmm1, %xmm0
movapd %xmm0, %xmm1
cmpltsd %xmm5, %xmm1
movapd %xmm1, %xmm2
andpd %xmm6, %xmm2
andnpd %xmm4, %xmm1
orpd %xmm2, %xmm1
addsd %xmm0, %xmm1
cvttsd2si %xmm1, %rax
movq %rdx, (%rsp)
movq %rax, 0x8(%rsp)
movq 0x48(%rbx), %rsi
cmpq 0x50(%rbx), %rsi
movq 0x60(%rsp), %r13
je 0x1014d
movapd (%rsp), %xmm0
movupd %xmm0, (%rsi)
addq $0x10, 0x48(%rbx)
jmp 0x1016c
movl $0x1, 0x1c(%rsp)
movq $0x0, 0x78(%rbx)
cmpl $0x3, %eax
movq 0x60(%rsp), %r13
movq %rbx, %rdi
jne 0x1013c
xorl %esi, %esi
movl $0x1, %edx
callq 0x1086c
jmp 0x10216
xorl %esi, %esi
movl $0x1, %edx
callq 0x10a92
jmp 0x10216
movq %r14, %rdi
movq %rsp, %rdx
callq 0x1270c
movsd 0x5500(%rip), %xmm6     # 0x15660
xorpd %xmm5, %xmm5
movsd 0x3eac(%rip), %xmm4     # 0x14018
movq 0x28(%rbx), %rax
movq 0x58(%rbx), %rcx
xorps %xmm0, %xmm0
cvtsi2sdq (%rax), %xmm0
movsd (%rcx), %xmm1
movapd 0x50(%rsp), %xmm3
mulsd %xmm3, %xmm1
addsd %xmm0, %xmm1
movapd %xmm1, %xmm0
cmpltsd %xmm5, %xmm0
movapd %xmm0, %xmm2
andpd %xmm6, %xmm2
andnpd %xmm4, %xmm0
orpd %xmm2, %xmm0
addsd %xmm1, %xmm0
cvttsd2si %xmm0, %rdx
xorps %xmm0, %xmm0
cvtsi2sdq 0x8(%rax), %xmm0
movsd 0x8(%rcx), %xmm1
mulsd %xmm3, %xmm1
addsd %xmm0, %xmm1
movapd %xmm1, %xmm0
cmpltsd %xmm5, %xmm0
movapd %xmm0, %xmm2
andpd %xmm6, %xmm2
andnpd %xmm4, %xmm0
orpd %xmm2, %xmm0
addsd %xmm1, %xmm0
cvttsd2si %xmm0, %rax
movq %rdx, (%rsp)
movq %rax, 0x8(%rsp)
movq 0x48(%rbx), %rsi
cmpq 0x50(%rbx), %rsi
je 0x1020b
movapd (%rsp), %xmm0
movupd %xmm0, (%rsi)
addq $0x10, 0x48(%rbx)
jmp 0x10216
movq %r14, %rdi
movq %rsp, %rdx
callq 0x1270c
movq %rbp, %rdi
movq %r14, %rsi
callq 0x124c2
movq 0x40(%rsp), %r14
movq 0xd0(%rbx), %rax
subq 0xc8(%rbx), %rax
incq %r14
shrq $0x3, %rax
cltq
cmpq %rax, %r14
jl 0xf7a5
addq $0x88, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq