// File: hzeller[P]gcode-multi-shell-extrude/third_party/clipper.cpp
// Function: ClipperLib::ClipperBase::AddPath(std::vector<ClipperLib::IntPoint, std::allocator<ClipperLib::IntPoint>> const&, ClipperLib::PolyType, bool)
bool ClipperBase::AddPath(const Path &pg, PolyType PolyTyp, bool Closed)
{
#ifdef use_lines
  if (!Closed && PolyTyp == ptClip)
    throw clipperException("AddPath: Open paths must be subject.");
#else
  if (!Closed)
    throw clipperException("AddPath: Open paths have been disabled.");
#endif

  int highI = (int)pg.size() -1;
  if (Closed) while (highI > 0 && (pg[highI] == pg[0])) --highI;
  while (highI > 0 && (pg[highI] == pg[highI -1])) --highI;
  if ((Closed && highI < 2) || (!Closed && highI < 1)) return false;

  //create a new edge array ...
  TEdge *edges = new TEdge [highI +1];

  bool IsFlat = true;
  //1. Basic (first) edge initialization ...
  try
  {
    edges[1].Curr = pg[1];
    RangeTest(pg[0], m_UseFullRange);
    RangeTest(pg[highI], m_UseFullRange);
    InitEdge(&edges[0], &edges[1], &edges[highI], pg[0]);
    InitEdge(&edges[highI], &edges[0], &edges[highI-1], pg[highI]);
    for (int i = highI - 1; i >= 1; --i)
    {
      RangeTest(pg[i], m_UseFullRange);
      InitEdge(&edges[i], &edges[i+1], &edges[i-1], pg[i]);
    }
  }
  catch(...)
  {
    delete [] edges;
    throw; //range test fails
  }
  TEdge *eStart = &edges[0];

  //2. Remove duplicate vertices, and (when closed) collinear edges ...
  TEdge *E = eStart, *eLoopStop = eStart;
  for (;;)
  {
    if ((E->Curr == E->Next->Curr))
    {
      if (E == E->Next) break;
      if (E == eStart) eStart = E->Next;
      E = RemoveEdge(E);
      eLoopStop = E;
      continue;
    }
    if (E->Prev == E->Next) 
      break; //only two vertices
    else if (Closed &&
      SlopesEqual(E->Prev->Curr, E->Curr, E->Next->Curr, m_UseFullRange) && 
      (!m_PreserveCollinear ||
      !Pt2IsBetweenPt1AndPt3(E->Prev->Curr, E->Curr, E->Next->Curr)))
    {
      //Collinear edges are allowed for open paths but in closed paths
      //the default is to merge adjacent collinear edges into a single edge.
      //However, if the PreserveCollinear property is enabled, only overlapping
      //collinear edges (ie spikes) will be removed from closed paths.
      if (E == eStart) eStart = E->Next;
      E = RemoveEdge(E);
      E = E->Prev;
      eLoopStop = E;
      continue;
    }
    E = E->Next;
    if (E == eLoopStop) break;
  }

  if ((!Closed && (E == E->Next)) || (Closed && (E->Prev == E->Next)))
  {
    delete [] edges;
    return false;
  }

  if (!Closed)
  { 
    m_HasOpenPaths = true;
    eStart->Prev->OutIdx = Skip;
  }

  //3. Do second stage of edge initialization ...
  E = eStart;
  do
  {
    InitEdge2(*E, PolyTyp);
    E = E->Next;
    if (IsFlat && E->Curr.Y != eStart->Curr.Y) IsFlat = false;
  }
  while (E != eStart);

  //4. Finally, add edge bounds to LocalMinima list ...

  //Totally flat paths must be handled differently when adding them
  //to LocalMinima list to avoid endless loops etc ...
  if (IsFlat) 
  {
    if (Closed) 
    {
      delete [] edges;
      return false;
    }
    E->Prev->OutIdx = Skip;
    if (E->Prev->Bot.X < E->Prev->Top.X) ReverseHorizontal(*E->Prev);
    LocalMinima* locMin = new LocalMinima();
    locMin->Next = 0;
    locMin->Y = E->Bot.Y;
    locMin->LeftBound = 0;
    locMin->RightBound = E;
    locMin->RightBound->Side = esRight;
    locMin->RightBound->WindDelta = 0;
    while (E->Next->OutIdx != Skip)
    {
      E->NextInLML = E->Next;
      if (E->Bot.X != E->Prev->Top.X) ReverseHorizontal(*E);
      E = E->Next;
    }
    InsertLocalMinima(locMin);
    m_edges.push_back(edges);
	  return true;
  }

  m_edges.push_back(edges);
  bool clockwise;
  TEdge* EMin = 0;
  for (;;)
  {
    E = FindNextLocMin(E);
    if (E == EMin) break;
    else if (!EMin) EMin = E;

    //E and E.Prev now share a local minima (left aligned if horizontal).
    //Compare their slopes to find which starts which bound ...
    LocalMinima* locMin = new LocalMinima;
    locMin->Next = 0;
    locMin->Y = E->Bot.Y;
    if (E->Dx < E->Prev->Dx) 
    {
      locMin->LeftBound = E->Prev;
      locMin->RightBound = E;
      clockwise = false; //Q.nextInLML = Q.prev
    } else
    {
      locMin->LeftBound = E;
      locMin->RightBound = E->Prev;
      clockwise = true; //Q.nextInLML = Q.next
    }
    locMin->LeftBound->Side = esLeft;
    locMin->RightBound->Side = esRight;

    if (!Closed) locMin->LeftBound->WindDelta = 0;
    else if (locMin->LeftBound->Next == locMin->RightBound)
      locMin->LeftBound->WindDelta = -1;
    else locMin->LeftBound->WindDelta = 1;
    locMin->RightBound->WindDelta = -locMin->LeftBound->WindDelta;

    E = ProcessBound(locMin->LeftBound, clockwise);
    TEdge* E2 = ProcessBound(locMin->RightBound, !clockwise);

    if (locMin->LeftBound->OutIdx == Skip)
      locMin->LeftBound = 0;
    else if (locMin->RightBound->OutIdx == Skip)
      locMin->RightBound = 0;
    InsertLocalMinima(locMin);
    if (!clockwise) E = E2;
  }
  return true;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x1b0, %rsp            # imm = 0x1B0
movb %cl, %al
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movl %edx, -0x1c(%rbp)
andb $0x1, %al
movb %al, -0x1d(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0xe8(%rbp)
testb $0x1, -0x1d(%rbp)
jne 0x136fa
movl $0x28, %edi
callq 0x3110
movq %rax, %rdi
movq %rdi, %rax
movq %rax, -0xf0(%rbp)
leaq 0x1909a(%rip), %rsi     # 0x2c756
callq 0x20830
jmp 0x136c3
movq -0xf0(%rbp), %rdi
leaq 0x2768f(%rip), %rsi     # 0x3ad60
leaq 0xd1f8(%rip), %rdx      # 0x208d0
callq 0x3430
movq -0xf0(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
callq 0x31c0
jmp 0x141af
movq -0x18(%rbp), %rdi
callq 0xd900
subl $0x1, %eax
movl %eax, -0x30(%rbp)
testb $0x1, -0x1d(%rbp)
je 0x1376e
jmp 0x13711
xorl %eax, %eax
cmpl $0x0, -0x30(%rbp)
movb %al, -0xf1(%rbp)
jle 0x13755
movq -0x18(%rbp), %rdi
movslq -0x30(%rbp), %rsi
callq 0x20460
movq %rax, -0x100(%rbp)
movq -0x18(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x20460
movq -0x100(%rbp), %rdi
movq %rax, %rsi
callq 0x20480
movb %al, -0xf1(%rbp)
movb -0xf1(%rbp), %al
testb $0x1, %al
jne 0x13761
jmp 0x1376c
movl -0x30(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x30(%rbp)
jmp 0x13711
jmp 0x1376e
jmp 0x13770
xorl %eax, %eax
cmpl $0x0, -0x30(%rbp)
movb %al, -0x101(%rbp)
jle 0x137b9
movq -0x18(%rbp), %rdi
movslq -0x30(%rbp), %rsi
callq 0x20460
movq %rax, -0x110(%rbp)
movq -0x18(%rbp), %rdi
movl -0x30(%rbp), %eax
subl $0x1, %eax
movslq %eax, %rsi
callq 0x20460
movq -0x110(%rbp), %rdi
movq %rax, %rsi
callq 0x20480
movb %al, -0x101(%rbp)
movb -0x101(%rbp), %al
testb $0x1, %al
jne 0x137c5
jmp 0x137d0
movl -0x30(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x30(%rbp)
jmp 0x13770
testb $0x1, -0x1d(%rbp)
je 0x137dc
cmpl $0x2, -0x30(%rbp)
jl 0x137e8
testb $0x1, -0x1d(%rbp)
jne 0x137f1
cmpl $0x1, -0x30(%rbp)
jge 0x137f1
movb $0x0, -0x1(%rbp)
jmp 0x141a1
movl -0x30(%rbp), %eax
addl $0x1, %eax
cltq
movq %rax, -0x120(%rbp)
movl $0x98, %ecx
mulq %rcx
movq %rax, %rdi
seto %cl
movq $-0x1, %rax
testb $0x1, %cl
cmovneq %rax, %rdi
movq %rdi, -0x128(%rbp)
callq 0x3030
movq %rax, %rcx
movq -0x120(%rbp), %rax
movq %rcx, -0x118(%rbp)
cmpq $0x0, %rax
je 0x1389d
movq -0x118(%rbp), %rax
movq -0x120(%rbp), %rcx
imulq $0x98, %rcx, %rdx
movq %rax, %rcx
addq %rdx, %rcx
movq %rcx, -0x138(%rbp)
movq %rax, -0x130(%rbp)
movq -0x130(%rbp), %rdi
movq %rdi, -0x140(%rbp)
callq 0x20910
jmp 0x1387d
movq -0x138(%rbp), %rcx
movq -0x140(%rbp), %rax
addq $0x98, %rax
cmpq %rcx, %rax
movq %rax, -0x130(%rbp)
jne 0x13868
movq -0x118(%rbp), %rax
movq %rax, -0x38(%rbp)
movb $0x1, -0x39(%rbp)
movq -0x18(%rbp), %rdi
movl $0x1, %esi
callq 0x20460
movq %rax, %rcx
movq -0x38(%rbp), %rax
movups (%rcx), %xmm0
movups %xmm0, 0xa8(%rax)
movq -0x18(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x20460
movq -0xe8(%rbp), %rsi
movq %rax, %rdi
addq $0x18, %rsi
callq 0x12e20
jmp 0x138ed
movq -0x18(%rbp), %rdi
movslq -0x30(%rbp), %rsi
callq 0x20460
movq -0xe8(%rbp), %rsi
movq %rax, %rdi
addq $0x18, %rsi
callq 0x12e20
jmp 0x1390f
movq -0x38(%rbp), %rax
movq %rax, -0x158(%rbp)
movq %rax, %rcx
addq $0x98, %rcx
movq %rcx, -0x150(%rbp)
movslq -0x30(%rbp), %rcx
imulq $0x98, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0x148(%rbp)
movq -0x18(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x20460
movq -0x158(%rbp), %rdi
movq -0x150(%rbp), %rsi
movq -0x148(%rbp), %rdx
movq %rax, %rcx
callq 0x20980
jmp 0x1396c
movq -0x38(%rbp), %rax
movq %rax, -0x168(%rbp)
movslq -0x30(%rbp), %rsi
movl %esi, %ecx
imulq $0x98, %rsi, %rdi
movq %rax, %rdx
addq %rdi, %rdx
movq %rdx, -0x170(%rbp)
decl %ecx
movslq %ecx, %rcx
imulq $0x98, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0x160(%rbp)
movq -0x18(%rbp), %rdi
callq 0x20460
movq -0x170(%rbp), %rdi
movq -0x168(%rbp), %rsi
movq -0x160(%rbp), %rdx
movq %rax, %rcx
callq 0x20980
jmp 0x139cf
movl -0x30(%rbp), %eax
subl $0x1, %eax
movl %eax, -0x40(%rbp)
cmpl $0x1, -0x40(%rbp)
jl 0x13aeb
movq -0x18(%rbp), %rdi
movslq -0x40(%rbp), %rsi
callq 0x20460
movq -0xe8(%rbp), %rsi
movq %rax, %rdi
addq $0x18, %rsi
callq 0x12e20
jmp 0x13a04
movq -0x38(%rbp), %rax
movslq -0x40(%rbp), %rsi
movl %esi, %ecx
imulq $0x98, %rsi, %rdi
movq %rax, %rdx
addq %rdi, %rdx
movq %rdx, -0x188(%rbp)
movl %ecx, %edx
incl %edx
movslq %edx, %rdx
imulq $0x98, %rdx, %rdi
movq %rax, %rdx
addq %rdi, %rdx
movq %rdx, -0x180(%rbp)
decl %ecx
movslq %ecx, %rcx
imulq $0x98, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0x178(%rbp)
movq -0x18(%rbp), %rdi
callq 0x20460
movq -0x188(%rbp), %rdi
movq -0x180(%rbp), %rsi
movq -0x178(%rbp), %rdx
movq %rax, %rcx
callq 0x20980
jmp 0x13a7b
jmp 0x13a7d
movl -0x40(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x40(%rbp)
jmp 0x139d8
movq -0x128(%rbp), %rsi
movq -0x118(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
callq 0x3490
jmp 0x141af
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
movq -0x28(%rbp), %rdi
callq 0x30d0
movq -0x38(%rbp), %rax
movq %rax, -0x190(%rbp)
cmpq $0x0, %rax
je 0x13ae1
movq -0x190(%rbp), %rdi
callq 0x3360
callq 0x33a0
jmp 0x141c0
jmp 0x13b05
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
callq 0x3400
jmp 0x13b00
jmp 0x141af
movq -0x38(%rbp), %rax
movq %rax, -0x48(%rbp)
movq -0x48(%rbp), %rax
movq %rax, -0x50(%rbp)
movq -0x48(%rbp), %rax
movq %rax, -0x58(%rbp)
movq -0x50(%rbp), %rdi
addq $0x10, %rdi
movq -0x50(%rbp), %rax
movq 0x60(%rax), %rsi
addq $0x10, %rsi
callq 0x20480
testb $0x1, %al
jne 0x13b3c
jmp 0x13b7c
movq -0x50(%rbp), %rax
movq -0x50(%rbp), %rcx
cmpq 0x60(%rcx), %rax
jne 0x13b4f
jmp 0x13d14
movq -0x50(%rbp), %rax
cmpq -0x48(%rbp), %rax
jne 0x13b65
movq -0x50(%rbp), %rax
movq 0x60(%rax), %rax
movq %rax, -0x48(%rbp)
movq -0x50(%rbp), %rdi
callq 0x12050
movq %rax, -0x50(%rbp)
movq -0x50(%rbp), %rax
movq %rax, -0x58(%rbp)
jmp 0x13b1d
movq -0x50(%rbp), %rax
movq 0x68(%rax), %rax
movq -0x50(%rbp), %rcx
cmpq 0x60(%rcx), %rax
jne 0x13b93
jmp 0x13d14
testb $0x1, -0x1d(%rbp)
je 0x13cf5
movq -0xe8(%rbp), %rax
movq -0x50(%rbp), %rcx
movq 0x68(%rcx), %rcx
movq 0x10(%rcx), %rdx
movq %rdx, -0x68(%rbp)
movq 0x18(%rcx), %rcx
movq %rcx, -0x60(%rbp)
movq -0x50(%rbp), %rcx
movq 0x10(%rcx), %rdx
movq %rdx, -0x78(%rbp)
movq 0x18(%rcx), %rcx
movq %rcx, -0x70(%rbp)
movq -0x50(%rbp), %rcx
movq 0x60(%rcx), %rcx
movq 0x10(%rcx), %rdx
movq %rdx, -0x88(%rbp)
movq 0x18(%rcx), %rcx
movq %rcx, -0x80(%rbp)
movb 0x18(%rax), %al
movq -0x68(%rbp), %rdi
movq -0x60(%rbp), %rsi
movq -0x78(%rbp), %rdx
movq -0x70(%rbp), %rcx
movq -0x88(%rbp), %r8
movq -0x80(%rbp), %r9
andb $0x1, %al
movzbl %al, %eax
movl %eax, (%rsp)
callq 0x11960
testb $0x1, %al
jne 0x13c1f
jmp 0x13cf5
movq -0xe8(%rbp), %rax
testb $0x1, 0x38(%rax)
je 0x13cb9
movq -0x50(%rbp), %rax
movq 0x68(%rax), %rax
movq 0x10(%rax), %rcx
movq %rcx, -0x98(%rbp)
movq 0x18(%rax), %rax
movq %rax, -0x90(%rbp)
movq -0x50(%rbp), %rax
movq 0x10(%rax), %rcx
movq %rcx, -0xa8(%rbp)
movq 0x18(%rax), %rax
movq %rax, -0xa0(%rbp)
movq -0x50(%rbp), %rax
movq 0x60(%rax), %rax
movq 0x10(%rax), %rcx
movq %rcx, -0xb8(%rbp)
movq 0x18(%rax), %rax
movq %rax, -0xb0(%rbp)
movq -0x98(%rbp), %rdi
movq -0x90(%rbp), %rsi
movq -0xa8(%rbp), %rdx
movq -0xa0(%rbp), %rcx
movq -0xb8(%rbp), %r8
movq -0xb0(%rbp), %r9
callq 0x12a10
testb $0x1, %al
jne 0x13cf5
movq -0x50(%rbp), %rax
cmpq -0x48(%rbp), %rax
jne 0x13ccf
movq -0x50(%rbp), %rax
movq 0x60(%rax), %rax
movq %rax, -0x48(%rbp)
movq -0x50(%rbp), %rdi
callq 0x12050
movq %rax, -0x50(%rbp)
movq -0x50(%rbp), %rax
movq 0x68(%rax), %rax
movq %rax, -0x50(%rbp)
movq -0x50(%rbp), %rax
movq %rax, -0x58(%rbp)
jmp 0x13b1d
jmp 0x13cf7
movq -0x50(%rbp), %rax
movq 0x60(%rax), %rax
movq %rax, -0x50(%rbp)
movq -0x50(%rbp), %rax
cmpq -0x58(%rbp), %rax
jne 0x13d0f
jmp 0x13d14
jmp 0x13b1d
testb $0x1, -0x1d(%rbp)
jne 0x13d28
movq -0x50(%rbp), %rax
movq -0x50(%rbp), %rcx
cmpq 0x60(%rcx), %rax
je 0x13d40
testb $0x1, -0x1d(%rbp)
je 0x13d66
movq -0x50(%rbp), %rax
movq 0x68(%rax), %rax
movq -0x50(%rbp), %rcx
cmpq 0x60(%rcx), %rax
jne 0x13d66
movq -0x38(%rbp), %rax
movq %rax, -0x198(%rbp)
cmpq $0x0, %rax
je 0x13d5d
movq -0x198(%rbp), %rdi
callq 0x3360
movb $0x0, -0x1(%rbp)
jmp 0x141a1
testb $0x1, -0x1d(%rbp)
jne 0x13d86
movq -0xe8(%rbp), %rax
movb $0x1, 0x39(%rax)
movq -0x48(%rbp), %rax
movq 0x68(%rax), %rax
movl $0xfffffffe, 0x5c(%rax) # imm = 0xFFFFFFFE
movq -0x48(%rbp), %rax
movq %rax, -0x50(%rbp)
movq -0x50(%rbp), %rdi
movl -0x1c(%rbp), %esi
callq 0x11fa0
movq -0x50(%rbp), %rax
movq 0x60(%rax), %rax
movq %rax, -0x50(%rbp)
testb $0x1, -0x39(%rbp)
je 0x13dc2
movq -0x50(%rbp), %rax
movq 0x18(%rax), %rax
movq -0x48(%rbp), %rcx
cmpq 0x18(%rcx), %rax
je 0x13dc2
movb $0x0, -0x39(%rbp)
jmp 0x13dc4
movq -0x50(%rbp), %rax
cmpq -0x48(%rbp), %rax
jne 0x13d8e
testb $0x1, -0x39(%rbp)
je 0x13f44
testb $0x1, -0x1d(%rbp)
je 0x13e04
movq -0x38(%rbp), %rax
movq %rax, -0x1a0(%rbp)
cmpq $0x0, %rax
je 0x13dfb
movq -0x1a0(%rbp), %rdi
callq 0x3360
movb $0x0, -0x1(%rbp)
jmp 0x141a1
movq -0x50(%rbp), %rax
movq 0x68(%rax), %rax
movl $0xfffffffe, 0x5c(%rax) # imm = 0xFFFFFFFE
movq -0x50(%rbp), %rax
movq 0x68(%rax), %rax
movq (%rax), %rax
movq -0x50(%rbp), %rcx
movq 0x68(%rcx), %rcx
cmpq 0x20(%rcx), %rax
jge 0x13e39
movq -0x50(%rbp), %rax
movq 0x68(%rax), %rdi
callq 0x20800
movl $0x20, %edi
callq 0x3280
movq %rax, %rdi
movq %rdi, -0x1a8(%rbp)
xorl %esi, %esi
movl $0x20, %edx
callq 0x3140
movq -0x1a8(%rbp), %rax
movq %rax, -0xc0(%rbp)
movq -0xc0(%rbp), %rax
movq $0x0, 0x18(%rax)
movq -0x50(%rbp), %rax
movq 0x8(%rax), %rcx
movq -0xc0(%rbp), %rax
movq %rcx, (%rax)
movq -0xc0(%rbp), %rax
movq $0x0, 0x8(%rax)
movq -0x50(%rbp), %rcx
movq -0xc0(%rbp), %rax
movq %rcx, 0x10(%rax)
movq -0xc0(%rbp), %rax
movq 0x10(%rax), %rax
movl $0x2, 0x4c(%rax)
movq -0xc0(%rbp), %rax
movq 0x10(%rax), %rax
movl $0x0, 0x50(%rax)
movq -0x50(%rbp), %rax
movq 0x60(%rax), %rax
cmpl $-0x2, 0x5c(%rax)
je 0x13f14
movq -0x50(%rbp), %rax
movq 0x60(%rax), %rcx
movq -0x50(%rbp), %rax
movq %rcx, 0x70(%rax)
movq -0x50(%rbp), %rax
movq (%rax), %rax
movq -0x50(%rbp), %rcx
movq 0x68(%rcx), %rcx
cmpq 0x20(%rcx), %rax
je 0x13f06
movq -0x50(%rbp), %rdi
callq 0x20800
movq -0x50(%rbp), %rax
movq 0x60(%rax), %rax
movq %rax, -0x50(%rbp)
jmp 0x13eca
movq -0xe8(%rbp), %rdi
movq -0xc0(%rbp), %rsi
callq 0x135a0
movq -0xe8(%rbp), %rdi
addq $0x20, %rdi
leaq -0x38(%rbp), %rsi
callq 0x209f0
movb $0x1, -0x1(%rbp)
jmp 0x141a1
movq -0xe8(%rbp), %rdi
addq $0x20, %rdi
leaq -0x38(%rbp), %rsi
callq 0x209f0
movq $0x0, -0xd0(%rbp)
movq -0x50(%rbp), %rdi
callq 0x12f20
movq %rax, -0x50(%rbp)
movq -0x50(%rbp), %rax
cmpq -0xd0(%rbp), %rax
jne 0x13f82
jmp 0x1419d
cmpq $0x0, -0xd0(%rbp)
jne 0x13f97
movq -0x50(%rbp), %rax
movq %rax, -0xd0(%rbp)
jmp 0x13f99
movl $0x20, %edi
callq 0x3280
movq %rax, -0xd8(%rbp)
movq -0xd8(%rbp), %rax
movq $0x0, 0x18(%rax)
movq -0x50(%rbp), %rax
movq 0x8(%rax), %rcx
movq -0xd8(%rbp), %rax
movq %rcx, (%rax)
movq -0x50(%rbp), %rax
movsd 0x40(%rax), %xmm1
movq -0x50(%rbp), %rax
movq 0x68(%rax), %rax
movsd 0x40(%rax), %xmm0
ucomisd %xmm1, %xmm0
jbe 0x14012
movq -0x50(%rbp), %rax
movq 0x68(%rax), %rcx
movq -0xd8(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x50(%rbp), %rcx
movq -0xd8(%rbp), %rax
movq %rcx, 0x10(%rax)
movb $0x0, -0xc1(%rbp)
jmp 0x1403b
movq -0x50(%rbp), %rcx
movq -0xd8(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x50(%rbp), %rax
movq 0x68(%rax), %rcx
movq -0xd8(%rbp), %rax
movq %rcx, 0x10(%rax)
movb $0x1, -0xc1(%rbp)
movq -0xd8(%rbp), %rax
movq 0x8(%rax), %rax
movl $0x1, 0x4c(%rax)
movq -0xd8(%rbp), %rax
movq 0x10(%rax), %rax
movl $0x2, 0x4c(%rax)
testb $0x1, -0x1d(%rbp)
jne 0x14079
movq -0xd8(%rbp), %rax
movq 0x8(%rax), %rax
movl $0x0, 0x50(%rax)
jmp 0x140bd
movq -0xd8(%rbp), %rax
movq 0x8(%rax), %rax
movq 0x60(%rax), %rax
movq -0xd8(%rbp), %rcx
cmpq 0x10(%rcx), %rax
jne 0x140a9
movq -0xd8(%rbp), %rax
movq 0x8(%rax), %rax
movl $0xffffffff, 0x50(%rax) # imm = 0xFFFFFFFF
jmp 0x140bb
movq -0xd8(%rbp), %rax
movq 0x8(%rax), %rax
movl $0x1, 0x50(%rax)
jmp 0x140bd
movq -0xe8(%rbp), %rdi
movq -0xd8(%rbp), %rax
movq 0x8(%rax), %rax
xorl %ecx, %ecx
subl 0x50(%rax), %ecx
movq -0xd8(%rbp), %rax
movq 0x10(%rax), %rax
movl %ecx, 0x50(%rax)
movq -0xd8(%rbp), %rax
movq 0x8(%rax), %rsi
movb -0xc1(%rbp), %al
andb $0x1, %al
movzbl %al, %edx
callq 0x13030
movq -0xe8(%rbp), %rdi
movq %rax, -0x50(%rbp)
movq -0xd8(%rbp), %rax
movq 0x10(%rax), %rsi
movb -0xc1(%rbp), %al
xorb $-0x1, %al
movzbl %al, %edx
andl $0x1, %edx
callq 0x13030
movq %rax, -0xe0(%rbp)
movq -0xd8(%rbp), %rax
movq 0x8(%rax), %rax
cmpl $-0x2, 0x5c(%rax)
jne 0x1414f
movq -0xd8(%rbp), %rax
movq $0x0, 0x8(%rax)
jmp 0x14171
movq -0xd8(%rbp), %rax
movq 0x10(%rax), %rax
cmpl $-0x2, 0x5c(%rax)
jne 0x1416f
movq -0xd8(%rbp), %rax
movq $0x0, 0x10(%rax)
jmp 0x14171
movq -0xe8(%rbp), %rdi
movq -0xd8(%rbp), %rsi
callq 0x135a0
testb $0x1, -0xc1(%rbp)
jne 0x14198
movq -0xe0(%rbp), %rax
movq %rax, -0x50(%rbp)
jmp 0x13f63
movb $0x1, -0x1(%rbp)
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0x1b0, %rsp            # imm = 0x1B0
popq %rbp
retq
movq -0x28(%rbp), %rdi
callq 0x3440
movq %rax, %rdi
callq 0x9750