// File: /workspace/github_cpp_makefile_star2_O2/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 $0x98, %rsp
movaps %xmm0, 0x70(%rsp)
movq %rdi, %rbx
leaq 0x10(%rdi), %r12
movq %r12, %rdi
callq 0xfa58
movapd 0x70(%rsp), %xmm0
movsd %xmm0, 0x70(%rbx)
movapd 0x5aac(%rip), %xmm4     # 0x12ee0
andpd %xmm0, %xmm4
movsd 0x6298(%rip), %xmm0     # 0x136d8
ucomisd %xmm4, %xmm0
jbe 0xd49e
movq 0xd0(%rbx), %rax
subq 0xc8(%rbx), %rax
shrq $0x3, %rax
movslq %eax, %rsi
movq %r12, %rdi
callq 0xf7b4
xorl %r14d, %r14d
movq 0xc8(%rbx), %rax
movq 0xd0(%rbx), %rcx
subq %rax, %rcx
shrq $0x3, %rcx
movslq %ecx, %rcx
cmpq %rcx, %r14
jge 0xde27
movq (%rax,%r14,8), %rsi
cmpl $0x0, 0x44(%rsi)
jne 0xd499
movq %r12, %rdi
callq 0xf91c
incq %r14
jmp 0xd466
movsd (%rbx), %xmm1
movsd 0x8(%rbx), %xmm0
movsd 0x4bf1(%rip), %xmm2     # 0x120a0
movapd %xmm2, %xmm3
cmpltsd %xmm1, %xmm2
mulsd %xmm1, %xmm1
divsd %xmm1, %xmm3
andpd %xmm2, %xmm3
movsd 0x5af4(%rip), %xmm1     # 0x12fc0
andnpd %xmm1, %xmm2
orpd %xmm3, %xmm2
movlpd %xmm2, 0x90(%rbx)
xorpd %xmm1, %xmm1
ucomisd %xmm0, %xmm1
jae 0xd4f8
movsd 0x61f2(%rip), %xmm1     # 0x136e0
mulsd %xmm4, %xmm1
minsd %xmm0, %xmm1
jmp 0xd500
movsd 0x61e0(%rip), %xmm1     # 0x136e0
movapd %xmm4, 0x80(%rsp)
divsd %xmm4, %xmm1
movsd 0x4b6b(%rip), %xmm0     # 0x12080
subsd %xmm1, %xmm0
callq 0x31f0
movsd 0x4b82(%rip), %xmm1     # 0x120a8
movapd 0x80(%rsp), %xmm2
mulsd %xmm1, %xmm2
divsd %xmm0, %xmm1
minsd %xmm1, %xmm2
movapd %xmm2, 0x80(%rsp)
movsd 0x4b8c(%rip), %xmm0     # 0x120d8
divsd %xmm2, %xmm0
movsd %xmm0, 0x18(%rsp)
callq 0x3090
movsd %xmm0, 0x80(%rbx)
movsd 0x18(%rsp), %xmm0
callq 0x33d0
movsd %xmm0, 0x88(%rbx)
movapd 0x80(%rsp), %xmm0
divsd 0x4b51(%rip), %xmm0     # 0x120d8
movsd %xmm0, 0x98(%rbx)
xorpd %xmm0, %xmm0
ucomisd 0x70(%rsp), %xmm0
jbe 0xd5b3
movsd 0x80(%rbx), %xmm0
xorpd 0x4aa5(%rip), %xmm0     # 0x12050
movlpd %xmm0, 0x80(%rbx)
movq 0xd0(%rbx), %rax
subq 0xc8(%rbx), %rax
shrq $0x2, %rax
movslq %eax, %rsi
andq $-0x2, %rsi
movq %r12, %rdi
callq 0xf7b4
leaq 0x28(%rbx), %rax
movq %rax, 0x18(%rsp)
leaq 0x40(%rbx), %r13
leaq 0x58(%rbx), %rbp
movapd 0x70(%rsp), %xmm0
unpcklpd %xmm0, %xmm0            # xmm0 = xmm0[0,0]
movapd %xmm0, 0x60(%rsp)
xorl %edx, %edx
movq %rbp, 0x30(%rsp)
movq %r12, 0x48(%rsp)
movq %r13, 0x40(%rsp)
movq 0xc8(%rbx), %rax
movq 0xd0(%rbx), %rcx
subq %rax, %rcx
shrq $0x3, %rcx
movslq %ecx, %rcx
cmpq %rcx, %rdx
jge 0xde27
movq %rdx, 0x90(%rsp)
movq (%rax,%rdx,8), %r14
movq 0x18(%rsp), %rdi
movq %r14, %rsi
callq 0x664e
xorpd %xmm0, %xmm0
movq 0x30(%rbx), %r15
subq 0x28(%rbx), %r15
movq %r15, %rax
shrq $0x4, %rax
movq %rax, 0x20(%rsp)
testl %eax, %eax
je 0xdded
ucomisd 0x70(%rsp), %xmm0
jae 0xd776
movq 0x40(%rbx), %rax
cmpq %rax, 0x48(%rbx)
je 0xd67a
movq %rax, 0x48(%rbx)
cmpl $0x1, 0x20(%rsp)
jne 0xd791
cmpl $0x1, 0x40(%r14)
jne 0xd840
pushq $0x1
popq %r14
movsd 0x49e4(%rip), %xmm2     # 0x12080
cvtsi2sd %r14, %xmm0
movapd 0x80(%rsp), %xmm1
ucomisd %xmm0, %xmm1
jb 0xd9ec
movq 0x28(%rbx), %rax
cvtsi2sdq 0x8(%rax), %xmm0
cvtsi2sdq (%rax), %xmm1
unpcklpd %xmm0, %xmm1            # xmm1 = xmm1[0],xmm0[0]
movapd %xmm2, %xmm0
mulpd 0x60(%rsp), %xmm0
addpd %xmm1, %xmm0
movapd %xmm0, %xmm1
cmpltpd 0x492e(%rip), %xmm1     # 0x12010
movapd %xmm2, 0x20(%rsp)
movapd %xmm1, %xmm2
andnpd 0x492c(%rip), %xmm2     # 0x12020
andpd 0x6004(%rip), %xmm1     # 0x13700
orpd %xmm2, %xmm1
addpd %xmm0, %xmm1
cvttsd2si %xmm1, %rax
unpckhpd %xmm1, %xmm1            # xmm1 = xmm1[1,1]
cvttsd2si %xmm1, %rcx
movq %rax, %xmm0
movq %rcx, %xmm1
punpcklqdq %xmm1, %xmm0    # xmm0 = xmm0[0],xmm1[0]
movdqa %xmm0, (%rsp)
movq %r13, %rdi
movq %rsp, %rsi
callq 0x6770
movupd 0x80(%rbx), %xmm0
movapd %xmm0, %xmm1
xorpd 0x490c(%rip), %xmm1     # 0x12050
shufpd $0x2, %xmm0, %xmm1      # xmm1 = xmm1[0],xmm0[1]
shufpd $0x1, %xmm0, %xmm0      # xmm0 = xmm0[1,0]
movapd 0x20(%rsp), %xmm2
unpckhpd %xmm2, %xmm2            # xmm2 = xmm2[1,1]
mulpd %xmm2, %xmm1
movapd 0x20(%rsp), %xmm2
unpcklpd %xmm2, %xmm2            # xmm2 = xmm2[0,0]
mulpd %xmm0, %xmm2
addpd %xmm1, %xmm2
incq %r14
jmp 0xd69c
cmpl $0x3, 0x20(%rsp)
jl 0xdded
cmpl $0x0, 0x44(%r14)
jne 0xdded
jmp 0xd66c
movq 0x58(%rbx), %rax
cmpq %rax, 0x60(%rbx)
je 0xd79f
movq %rax, 0x60(%rbx)
shlq $0x1c, %r15
movq 0x20(%rsp), %r12
movslq %r12d, %rsi
movq %rbp, %rdi
callq 0xfab8
decl %r12d
testl %r12d, %r12d
movl $0x0, %r13d
cmovgl %r12d, %r13d
shlq $0x4, %r13
xorl %ebp, %ebp
cmpq %rbp, %r13
je 0xd804
movq 0x18(%rsp), %rax
movq (%rax), %rdi
leaq (%rdi,%rbp), %rsi
addq $0x10, %rsi
addq %rbp, %rdi
callq 0xcd48
movsd %xmm0, (%rsp)
movsd %xmm1, 0x8(%rsp)
movq 0x30(%rsp), %rdi
movq %rsp, %rsi
callq 0x11472
addq $0x10, %rbp
jmp 0xd7c9
cmpl $0x2, 0x44(%r14)
movslq %r12d, %rdi
movq %rdi, 0x50(%rsp)
jae 0xd968
movq 0x18(%rsp), %rax
movq (%rax), %rsi
shlq $0x4, %rdi
addq %rsi, %rdi
callq 0xcd48
movsd %xmm0, (%rsp)
movsd %xmm1, 0x8(%rsp)
movq 0x30(%rsp), %rbp
jmp 0xd98d
pushq $0x4
popq %rbp
movsd 0x4815(%rip), %xmm0     # 0x12060
movsd %xmm0, 0x20(%rsp)
movapd %xmm0, %xmm7
subl $0x1, %ebp
jb 0xd9ec
movq 0x18(%rsp), %rax
movq (%rax), %rax
cvtsi2sdq (%rax), %xmm0
movsd 0x20(%rsp), %xmm1
movapd 0x70(%rsp), %xmm3
mulsd %xmm3, %xmm1
addsd %xmm0, %xmm1
movapd %xmm1, %xmm0
xorpd %xmm5, %xmm5
cmpltsd %xmm5, %xmm0
movapd %xmm0, %xmm2
movsd 0x5e28(%rip), %xmm6     # 0x136c0
andpd %xmm6, %xmm2
movsd 0x571c(%rip), %xmm4     # 0x12fc0
andnpd %xmm4, %xmm0
orpd %xmm2, %xmm0
addsd %xmm1, %xmm0
cvttsd2si %xmm0, %rcx
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 %r13, %rdi
movq %rsp, %rsi
movapd %xmm7, 0x50(%rsp)
callq 0x6770
xorpd %xmm1, %xmm1
ucomisd 0x20(%rsp), %xmm1
jbe 0xd928
movsd 0x4769(%rip), %xmm0     # 0x12080
movsd %xmm0, 0x20(%rsp)
movapd 0x50(%rsp), %xmm7
jmp 0xd855
movapd 0x50(%rsp), %xmm3
ucomisd %xmm3, %xmm1
ja 0xd942
movsd 0x4724(%rip), %xmm0     # 0x12060
movsd %xmm0, 0x20(%rsp)
movapd %xmm3, %xmm0
cmpltsd %xmm1, %xmm0
movapd %xmm0, %xmm1
movsd 0x4729(%rip), %xmm2     # 0x12080
andpd %xmm2, %xmm1
andnpd %xmm3, %xmm0
orpd %xmm1, %xmm0
jmp 0xd851
movabsq $-0x200000000, %rax     # imm = 0xFFFFFFFE00000000
addq %rax, %r15
movq 0x30(%rsp), %rbp
movq (%rbp), %rax
sarq $0x1c, %r15
movupd (%rax,%r15), %xmm0
movapd %xmm0, (%rsp)
movq %rbp, %rdi
movq %rsp, %rsi
callq 0x11472
movq 0x40(%rsp), %r13
movl 0x44(%r14), %eax
movl %r12d, %r15d
cmpl $0x1, %eax
xorpd %xmm0, %xmm0
je 0xda01
testl %eax, %eax
jne 0xdac3
movl %r12d, (%rsp)
xorl %r12d, %r12d
movq 0x20(%rsp), %rax
testl %eax, %eax
movl $0x0, %ebp
cmovgl %eax, %ebp
cmpl %r12d, %ebp
je 0xd9e7
movl 0x40(%r14), %ecx
movq %rbx, %rdi
movl %r12d, %esi
movq %rsp, %rdx
callq 0xe0a8
incl %r12d
jmp 0xd9cb
movq 0x48(%rsp), %r12
movq %r12, %rdi
movq %r13, %rsi
callq 0xf91c
movq 0x30(%rsp), %rbp
jmp 0xdded
movl %r12d, (%rsp)
xorl %r13d, %r13d
movq 0x20(%rsp), %rax
testl %eax, %eax
movl $0x0, %ebp
cmovgl %eax, %ebp
cmpl %r13d, %ebp
je 0xda33
movl 0x40(%r14), %ecx
movq %rbx, %rdi
movl %r13d, %esi
movq %rsp, %rdx
callq 0xe0a8
incl %r13d
jmp 0xda17
movq 0x48(%rsp), %rdi
movq 0x40(%rsp), %r13
movq %r13, %rsi
callq 0xf91c
movq 0x40(%rbx), %rax
cmpq %rax, 0x48(%rbx)
je 0xda53
movq %rax, 0x48(%rbx)
movq 0x30(%rsp), %rbp
movq (%rbp), %rax
movq 0x50(%rsp), %rcx
shlq $0x4, %rcx
movdqu (%rax,%rcx), %xmm0
shlq $0x4, %r15
addq %rax, %r15
movl %r12d, %ecx
testl %ecx, %ecx
jle 0xda93
movupd -0x10(%r15), %xmm1
xorpd 0x45ca(%rip), %xmm1     # 0x12050
movupd %xmm1, (%r15)
addq $-0x10, %r15
decl %ecx
jmp 0xda74
pxor 0x45b5(%rip), %xmm0     # 0x12050
movdqu %xmm0, (%rax)
andl $0x0, (%rsp)
testl %r12d, %r12d
js 0xdddd
movl 0x40(%r14), %ecx
movq %rbx, %rdi
movl %r12d, %esi
movq %rsp, %rdx
callq 0xe0a8
decl %r12d
jmp 0xdaa3
andl $0x0, 0x3c(%rsp)
pushq $0x1
popq %r13
cmpl %r12d, %r13d
jge 0xdaee
movl 0x40(%r14), %ecx
movq %rbx, %rdi
movl %r13d, %esi
leaq 0x3c(%rsp), %rdx
callq 0xe0a8
xorpd %xmm0, %xmm0
incl %r13d
jmp 0xdacc
movapd %xmm0, (%rsp)
movl 0x44(%r14), %eax
cmpl $0x2, %eax
jne 0xdc1f
movq 0x18(%rsp), %rax
movq (%rax), %rax
movq %rbp, %rcx
movq 0x50(%rsp), %rbp
shlq $0x4, %rbp
cvtsi2sdq 0x8(%rax,%rbp), %xmm0
movq (%rcx), %rcx
xorpd %xmm2, %xmm2
cvtsi2sdq (%rax,%rbp), %xmm1
unpcklpd %xmm0, %xmm1            # xmm1 = xmm1[0],xmm0[0]
movupd (%rcx,%rbp), %xmm0
mulpd 0x60(%rsp), %xmm0
addpd %xmm1, %xmm0
movapd %xmm0, %xmm1
cmpltpd %xmm2, %xmm1
movapd 0x5bb4(%rip), %xmm2     # 0x13700
andpd %xmm1, %xmm2
movapd 0x44c8(%rip), %xmm3     # 0x12020
andnpd %xmm3, %xmm1
orpd %xmm2, %xmm1
addpd %xmm0, %xmm1
cvttsd2si %xmm1, %rax
unpckhpd %xmm1, %xmm1            # xmm1 = xmm1[1,1]
cvttsd2si %xmm1, %rcx
movq %rax, %xmm0
movq %rcx, %xmm1
punpcklqdq %xmm1, %xmm0    # xmm0 = xmm0[0],xmm1[0]
movdqa %xmm0, (%rsp)
movq 0x40(%rsp), %r13
movq %r13, %rdi
movq %rsp, %rsi
callq 0xf8fe
movq 0x18(%rsp), %rax
movq (%rax), %rax
movq 0x30(%rsp), %rdx
cvtsi2sdq 0x8(%rax,%rbp), %xmm0
movq (%rdx), %rcx
cvtsi2sdq (%rax,%rbp), %xmm1
unpcklpd %xmm0, %xmm1            # xmm1 = xmm1[0],xmm0[0]
movupd (%rcx,%rbp), %xmm0
movq %rdx, %rbp
mulpd 0x60(%rsp), %xmm0
subpd %xmm0, %xmm1
movapd %xmm1, %xmm0
cmpltpd 0x443b(%rip), %xmm0     # 0x12010
movapd 0x5b23(%rip), %xmm2     # 0x13700
andpd %xmm0, %xmm2
andnpd 0x4437(%rip), %xmm0     # 0x12020
orpd %xmm2, %xmm0
addpd %xmm1, %xmm0
cvttsd2si %xmm0, %rax
unpckhpd %xmm0, %xmm0            # xmm0 = xmm0[1,1]
cvttsd2si %xmm0, %rcx
movq %rax, %xmm0
movq %rcx, %xmm1
punpcklqdq %xmm1, %xmm0    # xmm0 = xmm0[0],xmm1[0]
movdqa %xmm0, (%rsp)
movq %r13, %rdi
movq %rsp, %rsi
callq 0xf8fe
jmp 0xdc67
andq $0x0, 0x78(%rbx)
movq 0x20(%rsp), %rcx
leal -0x2(%rcx), %edx
movq 0x58(%rbx), %rcx
movq 0x50(%rsp), %rsi
shlq $0x4, %rsi
movdqu (%rcx,%rsi), %xmm0
pxor 0x440a(%rip), %xmm0     # 0x12050
movdqu %xmm0, (%rcx,%rsi)
movq %rbx, %rdi
movl %r12d, %esi
cmpl $0x3, %eax
jne 0xdc5d
callq 0xe2d8
jmp 0xdc62
callq 0xe494
movq 0x40(%rsp), %r13
shlq $0x4, %r15
addq (%rbp), %r15
movl %r12d, %eax
testl %eax, %eax
jle 0xdc91
movupd -0x10(%r15), %xmm0
xorpd 0x43cc(%rip), %xmm0     # 0x12050
movupd %xmm0, (%r15)
addq $-0x10, %r15
decl %eax
jmp 0xdc72
movq (%rbp), %rax
movdqu 0x10(%rax), %xmm0
pxor 0x43ae(%rip), %xmm0     # 0x12050
movdqu %xmm0, (%rax)
movl %r12d, 0x3c(%rsp)
movq 0x20(%rsp), %rax
leal -0x2(%rax), %r12d
testl %r12d, %r12d
jle 0xdcd2
movl 0x40(%r14), %ecx
movq %rbx, %rdi
movl %r12d, %esi
leaq 0x3c(%rsp), %rdx
callq 0xe0a8
decl %r12d
jmp 0xdcb4
movl 0x44(%r14), %eax
cmpl $0x2, %eax
jne 0xddfd
movq 0x18(%rsp), %r14
movq (%r14), %rax
cvtsi2sdq 0x8(%rax), %xmm0
movq (%rbp), %rcx
cvtsi2sdq (%rax), %xmm1
unpcklpd %xmm0, %xmm1            # xmm1 = xmm1[0],xmm0[0]
movupd (%rcx), %xmm0
mulpd 0x60(%rsp), %xmm0
subpd %xmm0, %xmm1
movapd %xmm1, %xmm0
xorpd %xmm2, %xmm2
cmpltpd %xmm2, %xmm0
movapd 0x59e3(%rip), %xmm2     # 0x13700
andpd %xmm0, %xmm2
movapd 0x42f7(%rip), %xmm3     # 0x12020
andnpd %xmm3, %xmm0
orpd %xmm2, %xmm0
addpd %xmm1, %xmm0
cvttsd2si %xmm0, %rax
unpckhpd %xmm0, %xmm0            # xmm0 = xmm0[1,1]
cvttsd2si %xmm0, %rcx
movq %rax, %xmm0
movq %rcx, %xmm1
punpcklqdq %xmm1, %xmm0    # xmm0 = xmm0[0],xmm1[0]
movdqa %xmm0, (%rsp)
movq %r13, %rdi
movq %rsp, %r15
movq %r15, %rsi
callq 0xf8fe
movq (%r14), %rax
cvtsi2sdq 0x8(%rax), %xmm0
movq (%rbp), %rcx
cvtsi2sdq (%rax), %xmm1
unpcklpd %xmm0, %xmm1            # xmm1 = xmm1[0],xmm0[0]
movupd (%rcx), %xmm0
mulpd 0x60(%rsp), %xmm0
addpd %xmm1, %xmm0
movapd %xmm0, %xmm1
cmpltpd 0x427b(%rip), %xmm1     # 0x12010
movapd 0x5963(%rip), %xmm2     # 0x13700
andpd %xmm1, %xmm2
andnpd 0x4277(%rip), %xmm1     # 0x12020
orpd %xmm2, %xmm1
addpd %xmm0, %xmm1
cvttsd2si %xmm1, %rax
unpckhpd %xmm1, %xmm1            # xmm1 = xmm1[1,1]
cvttsd2si %xmm1, %rcx
movq %rax, %xmm0
movq %rcx, %xmm1
punpcklqdq %xmm1, %xmm0    # xmm0 = xmm0[0],xmm1[0]
movdqa %xmm0, (%rsp)
movq %r13, %rdi
movq %r15, %rsi
callq 0xf8fe
movq 0x48(%rsp), %r12
movq %r12, %rdi
movq %r13, %rsi
callq 0xf91c
movq 0x90(%rsp), %rdx
incq %rdx
jmp 0xd606
andq $0x0, 0x78(%rbx)
cmpl $0x3, %eax
movq 0x48(%rsp), %r12
movq %rbx, %rdi
jne 0xde1b
xorl %esi, %esi
pushq $0x1
popq %rdx
callq 0xe2d8
jmp 0xdde2
xorl %esi, %esi
pushq $0x1
popq %rdx
callq 0xe494
jmp 0xdde2
addq $0x98, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop