// File: /workspace/github_cpp_makefile_star2_O1/thierry7100[P]CutOptim/src/SvgDoc.cpp
// Function: SvgDoc::OptimizeLevelFreeRot(Polygon*, std::__cxx11::list<NSVGpath*, std::allocator<NSVGpath*>>, std::__cxx11::list<NSVGpath*, std::allocator<NSVGpath*>>, double, double&, double, int, int, int)
NSVGpath *SvgDoc::OptimizeLevelFreeRot(Polygon *FixedPolyHull, std::list<NSVGpath *> FixedList, std::list<NSVGpath *> CurFloating, double FixedArea,
                                double &Cost, double InBestCost, int FloatPolygon, int nbFixedPoly, int LevelOptimize)
{
Polygon *rot_p = NULL;
Polygon *trans_rot_p = NULL;
vector<Point> FixedHull;
vector<Point> tmpFixedHull;
double BestCost = 1e100;
int Best_i = -1, Best_j = -1;
int Best_Poly = -1;
double BestAngle;
Point BestTranslation;
Point OverAllCentroid;
Rectangle OverAll;
int Reason;
int FixedPolygon = 0;
Point RefPoint;

    if ( debug_level > 1 )
    {
        OutDebug << "Entering OptimizeLevel(" << LevelOptimize <<  "): FixedHullArea " <<  FixedPolyHull->area() << " Fixed area " << FixedArea;
        OutDebug << " InBestCost=" << InBestCost << "\n";
        OutDebug << "Elements in list:" << CurFloating.size() << " first is " << CurFloating.front()->id << "\n";
    }
    FixedHull = FixedPolyHull->GetVertices();
    OverAllCentroid = FixedPolyHull->getCentroid();
    OverAll = FixedPolyHull->GetBoundingBox();

    NSVGpath *WorkingFloatingEntry = CurFloating.front();
    //  And remove element from temporary floating list
    CurFloating.pop_front();
    BestCost = 1e100;          //  Very large, each try should be better
    BestAngle = -500;            //   Impossible value
    if ( debug_level > 1 )
    {
        OutDebug << "Polygon to be placed : " << WorkingFloatingEntry->id << "  has " << WorkingFloatingEntry->LargePolygon->nVertices << " vertices.\n";
    }
    double tmpPolygonArea = FixedArea + WorkingFloatingEntry->LargePolygon->area();
    int nPreviousVertices = getFixedNbVertex(FixedList);            //  Number of vertices of all polygons before this one
    //  Build a cache object which will speed up computation if not yet present
    if ( UseCache && WorkingFloatingEntry->CachePoly == NULL )
    {
        //  Use 4 for num_rot because 4 possibilities will be tested, even if 2 at most are possible.
        WorkingFloatingEntry->CachePoly = new CachePosition(WorkingFloatingEntry->LargePolygon->nVertices, 4, nPreviousVertices);
    }
    //  Precomputing of segments and angle to save time
    WorkingFloatingEntry->LargePolygon->ComputeAngles();     //  Compute angles to be more efficient later
    WorkingFloatingEntry->LargePolygon->CalcSegments();

    //  Try all vertices of all placed polygons
    FixedPolygon = 0;
    int iFixedVertex = 0;
    for (std::list<NSVGpath *>::iterator it=FixedList.begin(); it != FixedList.end(); ++it, FixedPolygon++)
    {
        //  Get next placed polygon
        NSVGpath *path = *it;
        Polygon  *curFixed = path->PlacedPolygon;
        if ( debug_level > 2 )
        {
            OutDebug << "\n\n-------    Trying matching polygon " << FloatPolygon << " with Polygon " << FixedPolygon << "\n";
        }
        // For each vertex of this placed polygon
        for ( int iVFixed = 0; iVFixed < curFixed->nVertices-1; iFixedVertex++, iVFixed++)
        {
            double angle = 0;
            if ( debug_level > 2 )
            {
                OutDebug << "\nTrying on vertex " << iVFixed << " of fixed polygon\n";
            }
            //  Try all vertices of the floating polygon, and select the best
            for (int iVFloat = 0; iVFloat < WorkingFloatingEntry->LargePolygon->nVertices-1; iVFloat++)
            {
                if ( debug_level > 3 )
                {
                    OutDebug << "\nTrying with vertex " << iVFloat << " on vertex " << iVFixed << "\n";
                }
                //  For each case, try 4 angles. Angles are computed such as edge of flaot polygon are aligned to edge of fixed polygon with matching vertex.
                //  As there is 2 edges for each vertex, there are 4 possible angles, even if at most 2 will be possible
                for ( int iRot = 0; iRot < 4; iRot++)
                {
                    //  Use cache if available

                    trans_rot_p = NULL;
                    int Cached = 0;
                    if ( UseCache && path->isFixed )
                        WorkingFloatingEntry->CachePoly->isOKPlacedFreeRot(iVFloat, iRot, iFixedVertex, &trans_rot_p);
                    if ( Cached < 0 )       //  Cache says impossible !
                    {
                        CacheHit_KO++;
                        if ( debug_level > 2 )
                            OutDebug << "Cache says placement polygon " << FloatPolygon << " vertex " << iVFloat << " on vertex " << iVFixed << " of Polygon " << FixedPolygon << "(" << iFixedVertex << ")" << "impossible " << *curFixed->GetVertex(iVFixed) << "\n";
                        continue;           //  Goto next vertex...
                    }
                    else if ( Cached == 0 )
                    {
                        CacheMiss++;        // Not yet in cache, check angles first
                        nbCheckAngles++;
                        angle = 0;
                        //  Compute angle associated with floating polygon vertex j placed on vertex i of fixed polygon curFixed polygon (index i_rot)
                        //  If not possible, invalidate cache
                        int Res = ComputeFreeRotAngle(WorkingFloatingEntry->LargePolygon, iVFloat, curFixed, iVFixed, iRot, angle);
                        if ( debug_level > 3 )
                        {
                            OutDebug << "iRot =" << iRot << " angle=" << round(angle * 180 / M_PI);
                            OutDebug << "  ComputeFreeRotAngle: Res=" << Res << "\n";
                        }
                        if ( Res == 0)
                        {
                            //  Impossible, invalid cache entry
                            if ( UseCache && path->isFixed )
                                WorkingFloatingEntry->CachePoly->addOKPlacedFreeRot(iVFloat, iRot, iFixedVertex, NULL);
                            if ( debug_level > 2 )
                                OutDebug << "ComputeFreeRotAngle: Placement polygon " << FloatPolygon << " vertex " << iVFloat << " with rotation " << angle << "(" << iRot << ")" << " on vertex " << iVFixed << " of Polygon " << FixedPolygon << " impossible " << *curFixed->GetVertex(iVFixed) << ", reason angle mismatch\n";
                            continue;    //  Not possible goto next without further processing
                        }
                        //  Compute polygon translated and rotated...
                        if ( rot_p ) delete rot_p;
                        rot_p = WorkingFloatingEntry->LargePolygon->Rotate(angle);
                        nbRotation++;
                        rot_p->ComputeAngles();     //  Compute angles to be more efficient later
                        rot_p->CalcSegments();
                        trans_rot_p = rot_p->Translate(curFixed->GetVertex(iVFixed), iVFloat);
                        nbTranslation++;
                        trans_rot_p->CalcSegments();
                    }
                    else
                    {
                        CacheHit_OK++;
                        angle = trans_rot_p->getRotation();
                    }

                    RefPoint = Point(WorkingFloatingEntry->StartX, WorkingFloatingEntry->StartY);
                    RefPoint.Transform(angle, WorkingFloatingEntry->LargePolygon->getCentroid(), trans_rot_p->getTranslation());
                    if ( (Reason = PlacementNotPossible(trans_rot_p, FixedList, &OverAll, &RefPoint, Cached)) )
                    {
                        if ( debug_level > 2 )
                            OutDebug << "Placement polygon " << FloatPolygon << " vertex " << iVFloat << " on vertex " << iVFixed << " of Polygon " << FixedPolygon << " impossible " << *curFixed->GetVertex(iVFixed) << ", reason " << Reason << "\n";
                        //  If impossible due to conflict with fixed polygon, invalidate cache entry
                        if ( path->isFixed && (Reason & FIXED_BIT) != 0 )
                        {
                            if ( UseCache )
                                WorkingFloatingEntry->CachePoly->addOKPlacedFreeRot(iVFloat, iRot, iFixedVertex, NULL);
                            delete trans_rot_p;
                            trans_rot_p = NULL;
                        }
                        //  Free memory associated with polygon
                        if ( Cached == 0 && trans_rot_p != NULL )
                        {
                            delete trans_rot_p;
                            trans_rot_p = NULL;
                        }

                        nbPlacementImpossible++;
                        continue;
                    }
                    if ( path->isFixed && Cached == 0)        //  If current vertex belongs to a fixed path, cache value
                    {
                        if ( UseCache )
                        {
                            WorkingFloatingEntry->CachePoly->addOKPlacedFreeRot(iVFloat, iRot, iFixedVertex, trans_rot_p);
                            Cached = 1;
                        }
                    }
                    //  Compute cost function
                    //  We will use only the Hull area.
                    //  As the Hull will only grow with subsequent calls, if a temp value is greater than the best one, no need to process further polygons
                    vector<Point> tmpHull = CombineHull(FixedHull, trans_rot_p->GetVertices());
                    double tmpHullArea = HullArea(tmpHull);
                    if ( debug_level > 1)
                        OutDebug << "  Vertex " << iVFloat << " on " << iVFixed << " of polygon " << FixedPolygon << " Hull area " << tmpHullArea << "--> DiffArea=" << tmpHullArea - tmpPolygonArea << "\n";
                    //  In this case, call again this function but with a list without the first element
                    //  First copy the list, the first element has already been removed
                    std::list<NSVGpath *> tmpFloatList = CurFloating;
                    //  Then add this element, as placed to the fixed list.
                    std::list<NSVGpath *> tmpFixedList = FixedList;
                    tmpFixedList.push_back(WorkingFloatingEntry);
                    //  Move Polygon at its place, but before delete existing polygon to save memory
                    if ( WorkingFloatingEntry->PlacedPolygon ) delete WorkingFloatingEntry->PlacedPolygon;
                    if ( WorkingFloatingEntry->LargeConvexHull ) delete WorkingFloatingEntry->LargeConvexHull;
                    Point temp_pT = trans_rot_p->getTranslation();
                    WorkingFloatingEntry->PlacedPolygon = WorkingFloatingEntry->LargePolygon->Transform(angle, &temp_pT);
                    WorkingFloatingEntry->PlacedPolygon->ComputeAngles();
                    WorkingFloatingEntry->PlacedPolygon->CalcSegments();
                    //  Update variables for Fixed polygons lists
                    double tmpFixedArea = FixedArea + WorkingFloatingEntry->LargePolygon->area();
                    tmpFixedHull = CombineHull(FixedHull, WorkingFloatingEntry->PlacedPolygon->GetVertices());
                    WorkingFloatingEntry->LargeConvexHull = new Polygon(tmpFixedHull);
                    WorkingFloatingEntry->LargeConvexHull->ReCalcArea();
                    if ( debug_level > 1 && !tmpFloatList.empty() && tmpHullArea >= InBestCost )
                    {
                        OutDebug << " TmpHullarea (" << tmpHullArea << ") larger than input best values (" << InBestCost << ") no need to process other polygons in list\n";
                    }
                    if ( debug_level > 1 && !tmpFloatList.empty() && tmpHullArea >= BestCost )
                    {
                        OutDebug << " TmpHullarea (" << tmpHullArea << ") larger than current best values (" << BestCost << ") no need to process other polygons in list\n";
                    }
                    if ( !tmpFloatList.empty() && (tmpHullArea <= InBestCost && tmpHullArea <= BestCost) ) //  No need to go deeper, if nothing in list or cost already too high
                    {
                        if ( debug_level > 1 )
                        {
                            OutDebug << "  Applying current translation : " << temp_pT << " to polygon " << FloatPolygon << "\n";
                            OutDebug << "  new hull with " << FixedHull.size() << " vertices, area " << HullArea(FixedHull) << " Fixed polygon area " << tmpFixedArea <<"\n";
                            OutDebug << "  LargeConvexHull area :" << WorkingFloatingEntry->LargeConvexHull->area() << "\n";
                            OutDebug << "  Then call Optimize level again...\n";
                        }
                        OverAll = Hull2BoundingBox(FixedHull);
                        //  Then call Optimize level if the floating list is non empty
                        NSVGpath *Res = OptimizeLevelFreeRot(WorkingFloatingEntry->LargeConvexHull, tmpFixedList, tmpFloatList, tmpFixedArea, tmpHullArea, BestCost, FloatPolygon+1, nbFixedPoly, LevelOptimize - 1);
                        if ( Res == NULL )
                        {
                            //  Not possible, make sure that tmpHullArea will be greater than BestCost
                            tmpHullArea = BestCost + 10;
                        }
                        //  After return, the tmpHullArea is updated
                        if ( debug_level > 1 )
                        {
                            OutDebug << "-----   Returning at level " << LevelOptimize << ",  Cost is " << tmpHullArea << "\n";
                        }
                    }
                    if ( tmpHullArea < BestCost  )
                    {   //  Yes record new best value and corresponding position
                        BestCost = tmpHullArea;
                        BestAngle = angle;
                        BestTranslation = trans_rot_p->getTranslation();
                        Best_i = iVFixed;
                        Best_j = iVFloat;
                        Best_Poly = FixedPolygon;
                        if ( debug_level > 1 )
                        {
                            OutDebug << "New best found placing polygon " << FloatPolygon << "\n";
                            OutDebug << "  Vertex " << iVFloat << " on vertex " << iVFixed << " of polygon " <<  FixedPolygon << "\n";
                            OutDebug << " Rotation=" << round(angle*180/M_PI) << " Translation " << BestTranslation << " from " << *(rot_p->GetVertex(iVFloat)) << " to " <<  *(curFixed->GetVertex(iVFixed)) << "\n";
                            OutDebug << "  Hull area:" << tmpHullArea << " Polygon area:" << tmpPolygonArea << "\n";

                        }
                    }
                    if ( Cached == 0 )
                    {
                        delete trans_rot_p;     //  No need to keep, free memory
                        if ( rot_p->nVertices == 0 )
                        {
                            cerr << " rot_p (" << rot_p << ") invalid with 0 vertices, level =" << LevelOptimize << " Float poly = " << FloatPolygon << "\n";
                        }
                    }
               }
            }
         }
    }
    //  Do some cleaning...
    if ( rot_p != NULL ) delete rot_p;
    rot_p = NULL;
    //  Place polygon at BestAngle and Best Translation
    if ( BestAngle < -100 )
    {
        Cost = 1.0e50;        //      Return a large cost, all possible solutions will be better than this one
        return NULL;
    }
    if ( BestCost > InBestCost )    //  Not better at this level
    {
        Cost = BestCost;
        if ( debug_level > 1 )
        {
            OutDebug << "Level " << LevelOptimize << " No better move than " <<  InBestCost << " found, return at upper level\n";
        }
        return WorkingFloatingEntry;
    }
    if ( WorkingFloatingEntry->PlacedPolygon ) delete WorkingFloatingEntry->PlacedPolygon;
    if ( WorkingFloatingEntry->LargeConvexHull ) delete WorkingFloatingEntry->LargeConvexHull;
    WorkingFloatingEntry->PlacedPolygon = WorkingFloatingEntry->LargePolygon->Transform(BestAngle, &BestTranslation);
    WorkingFloatingEntry->PlacedPolygon->ComputeAngles();
    WorkingFloatingEntry->PlacedPolygon->CalcSegments();
    FixedArea += WorkingFloatingEntry->PlacedPolygon->area();
    FixedHull = CombineHull(FixedHull, WorkingFloatingEntry->PlacedPolygon->GetVertices());
    WorkingFloatingEntry->LargeConvexHull = new Polygon(FixedHull);
    WorkingFloatingEntry->LargeConvexHull->ReCalcArea();
    WorkingFloatingEntry->LargeConvexHull->getCentroid();
    Cost = BestCost;
    if ( debug_level > 0 )
    {
        OutDebug << "Level " << LevelOptimize << ": Applying best move : " << BestTranslation << "/" << round(BestAngle*180/M_PI) << "° to polygon " << FloatPolygon << " will place vertex " << Best_j << " on vertex " << Best_i << " of polygon " << Best_Poly << "\n";
        OutDebug << "  new hull with " << FixedHull.size() << " vertices, area " << HullArea(FixedHull) << " Fixed polygon area " << FixedArea <<"\n";
        OutDebug << "  LargeConvexHull area :" << WorkingFloatingEntry->LargeConvexHull->area() << " Cost= " << Cost << "\n";
        OutDebug << "  CurFloating.Size=" << CurFloating.size() << "\n";
        int idx_list = 1;
        for (std::list<NSVGpath *>::iterator it=CurFloating.begin(); it != CurFloating.end() ; ++it, idx_list++)
        {
            NSVGpath  *lPath = *it;
            if ( lPath->PlacedPolygon == NULL )
            {
                OutDebug << "Element " << idx_list << "Not placed\n";
            }
            else
            {
                OutDebug << " Element " << idx_list << ": Translation=" << lPath->PlacedPolygon->getTranslation() << " rot=" << round(lPath->PlacedPolygon->getRotation()*180/M_PI) ;
                OutDebug << " Hull area=" << lPath->LargeConvexHull->area() << "\n";
            }
        }
    }
    return WorkingFloatingEntry;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x278, %rsp            # imm = 0x278
movq %r9, 0x68(%rsp)
movsd %xmm1, 0xd0(%rsp)
movq %r8, %r13
movsd %xmm0, 0xe8(%rsp)
movq %rcx, 0xb0(%rsp)
movq %rdx, 0xd8(%rsp)
movq %rsi, %r14
movq %rdi, %rbx
xorl %eax, %eax
movq %rax, 0x20(%rsp)
movq %rax, 0xa0(%rsp)
xorpd %xmm0, %xmm0
movapd %xmm0, 0x90(%rsp)
movq %rax, 0x150(%rsp)
movapd %xmm0, 0x140(%rsp)
movapd %xmm0, 0x1a0(%rsp)
movapd %xmm0, 0x1f0(%rsp)
movapd %xmm0, 0x1e0(%rsp)
movapd %xmm0, 0x160(%rsp)
cmpl $0x2, 0x60(%rdi)
jl 0x36c21
leaq 0x68(%rbx), %r15
leaq 0x9a54(%rip), %rsi      # 0x40553
movl $0x17, %edx
movq %r15, %rdi
callq 0x74d0
movq %r15, %rdi
movl 0x2b8(%rsp), %esi
callq 0x7710
movq %rax, %r12
leaq 0x9a46(%rip), %rsi      # 0x4056b
movl $0x11, %edx
movq %rax, %rdi
callq 0x74d0
movq %r14, %rdi
callq 0x26926
movq %r12, %rdi
callq 0x7680
movq %rax, %r12
leaq 0x9a31(%rip), %rsi      # 0x4057d
movl $0xc, %edx
movq %rax, %rdi
callq 0x74d0
movq %r12, %rdi
movsd 0xe8(%rsp), %xmm0
callq 0x7680
leaq 0x9a25(%rip), %rsi      # 0x40596
movl $0xc, %edx
movq %r15, %rdi
callq 0x74d0
movq %r15, %rdi
movsd 0xd0(%rsp), %xmm0
callq 0x7680
leaq 0x969a(%rip), %rsi      # 0x40230
movl $0x1, %edx
movq %rax, %rdi
callq 0x74d0
leaq 0x99f9(%rip), %rsi      # 0x405a3
movl $0x11, %edx
movq %r15, %rdi
callq 0x74d0
movq 0xb0(%rsp), %rax
movq 0x10(%rax), %rsi
movq %r15, %rdi
callq 0x72f0
movq %rax, %r15
leaq 0x99e0(%rip), %rsi      # 0x405b5
movl $0xa, %edx
movq %rax, %rdi
callq 0x74d0
movq 0xb0(%rsp), %rax
movq (%rax), %rax
movl $0x90, %r12d
addq 0x10(%rax), %r12
movq %r12, %rdi
callq 0x71d0
movq %r15, %rdi
movq %r12, %rsi
movq %rax, %rdx
callq 0x74d0
leaq 0x961c(%rip), %rsi      # 0x40230
movl $0x1, %edx
movq %r15, %rdi
callq 0x74d0
leaq 0x10(%r14), %rsi
leaq 0x70(%rsp), %rdi
callq 0x25bd8
movq 0x90(%rsp), %rdi
movq 0xa0(%rsp), %rsi
movq 0x70(%rsp), %rax
movq %rax, 0x90(%rsp)
movupd 0x78(%rsp), %xmm0
movupd %xmm0, 0x98(%rsp)
xorpd %xmm0, %xmm0
movapd %xmm0, 0x70(%rsp)
movq $0x0, 0x80(%rsp)
testq %rdi, %rdi
je 0x36c7e
subq %rdi, %rsi
callq 0x7440
movq 0x70(%rsp), %rdi
testq %rdi, %rdi
je 0x36c98
movq 0x80(%rsp), %rsi
subq %rdi, %rsi
callq 0x7440
movq %r14, %rdi
callq 0x283b4
leaq 0x70(%rsp), %rdi
movq %r14, %rsi
callq 0x2822c
movupd 0x70(%rsp), %xmm0
movupd 0x80(%rsp), %xmm1
movapd %xmm1, 0x1f0(%rsp)
movapd %xmm0, 0x1e0(%rsp)
movq 0xb0(%rsp), %rax
movq (%rax), %r14
movq 0x10(%r14), %r12
decq 0x10(%rax)
movq %r14, %rdi
callq 0x76a0
movl $0x18, %esi
movq %r14, %rdi
callq 0x7440
cmpl $0x2, 0x60(%rbx)
jl 0x36d6a
leaq 0x68(%rbx), %r14
leaq 0x98b9(%rip), %rsi      # 0x405c0
movl $0x17, %edx
movq %r14, %rdi
callq 0x74d0
leaq 0x90(%r12), %r15
movq %r15, %rdi
callq 0x71d0
movq %r14, %rdi
movq %r15, %rsi
movq %rax, %rdx
callq 0x74d0
leaq 0x989f(%rip), %rsi      # 0x405d8
movl $0x6, %edx
movq %r14, %rdi
callq 0x74d0
movq 0x68(%r12), %rax
movl 0x8(%rax), %esi
movq %r14, %rdi
callq 0x7710
leaq 0x9882(%rip), %rsi      # 0x405df
movl $0xb, %edx
movq %rax, %rdi
callq 0x74d0
movq 0x68(%r12), %rdi
callq 0x26926
movsd %xmm0, 0xf0(%rsp)
leaq 0x260(%rsp), %r14
movq %r14, %rdi
movq 0xd8(%rsp), %rsi
callq 0x3c91c
movq 0x260(%rsp), %rdi
xorl %ebp, %ebp
cmpq %r14, %rdi
je 0x36dbd
movq %rdi, %rax
movq 0x10(%rax), %rcx
movq (%rax), %rdx
movq 0x68(%rcx), %rax
addl 0x8(%rax), %ebp
movq %rdx, %rax
cmpq %r14, %rdx
jne 0x36da7
cmpq %r14, %rdi
je 0x36dd7
movq (%rdi), %r15
movl $0x18, %esi
callq 0x7440
movq %r15, %rdi
cmpq %r14, %r15
jne 0x36dc2
cmpl $0x0, 0x64(%rbx)
je 0x36e14
cmpq $0x0, 0x88(%r12)
jne 0x36e14
movl $0x38, %edi
callq 0x7430
movq %rax, %r14
movq 0x68(%r12), %rax
movl 0x8(%rax), %esi
movq %r14, %rdi
movl $0x4, %edx
movl %ebp, %ecx
callq 0x253e4
movq %r14, 0x88(%r12)
movq 0x68(%r12), %rdi
callq 0x28f26
movq 0x68(%r12), %rdi
callq 0x297a6
movq %r13, 0x1b0(%rsp)
movq %r12, 0x8(%rsp)
movq 0xd8(%rsp), %rax
movq (%rax), %rcx
movq $0x0, 0x50(%rsp)
cmpq %rax, %rcx
je 0x38263
movsd 0xf0(%rsp), %xmm0
addsd 0xe8(%rsp), %xmm0
movsd %xmm0, 0xf0(%rsp)
leaq 0x68(%rbx), %rax
movq %rax, (%rsp)
movq 0x68(%rsp), %rax
incl %eax
movl %eax, 0x13c(%rsp)
movl 0x2b8(%rsp), %eax
leal -0x1(%rax), %eax
movq %rax, 0x1c0(%rsp)
movsd 0x835b(%rip), %xmm0     # 0x3f1f8
movsd %xmm0, 0xc8(%rsp)
movl $0xffffffff, 0x64(%rsp) # imm = 0xFFFFFFFF
movsd 0x832a(%rip), %xmm0     # 0x3f1e0
movsd %xmm0, 0x38(%rsp)
leaq 0x9c95(%rip), %r14      # 0x40b58
leaq 0x248(%rsp), %r13
movq $0x0, 0x48(%rsp)
movl $0xffffffff, 0x5c(%rsp) # imm = 0xFFFFFFFF
movl $0xffffffff, 0x60(%rsp) # imm = 0xFFFFFFFF
movl $0x0, 0x44(%rsp)
movq %rcx, 0x1b8(%rsp)
movq 0x10(%rcx), %rax
movq %rax, 0xf8(%rsp)
movq 0x78(%rax), %rax
movq %rax, 0xb8(%rsp)
cmpl $0x3, 0x60(%rbx)
jl 0x36f6d
movl $0x25, %edx
movq (%rsp), %rdi
leaq 0x9bb7(%rip), %rsi      # 0x40ad9
callq 0x74d0
movq (%rsp), %rdi
movq 0x68(%rsp), %rsi
callq 0x7710
movq %rax, %r15
movl $0xe, %edx
movq %rax, %rdi
leaq 0x9bb8(%rip), %rsi      # 0x40aff
callq 0x74d0
movq %r15, %rdi
movq 0x50(%rsp), %rsi
callq 0x7710
movl $0x1, %edx
movq %rax, %rdi
leaq 0x92c8(%rip), %rsi      # 0x40230
callq 0x74d0
movq 0xb8(%rsp), %rax
cmpl $0x2, 0x8(%rax)
jl 0x3823c
movq $0x0, 0x18(%rsp)
movq $0x0, 0xc0(%rsp)
cmpl $0x3, 0x60(%rbx)
jl 0x36fd1
movl $0x12, %edx
movq (%rsp), %rdi
leaq 0x9b64(%rip), %rsi      # 0x40b0e
callq 0x74d0
movq (%rsp), %rdi
movq 0x18(%rsp), %rsi
callq 0x7710
movl $0x12, %edx
movq %rax, %rdi
leaq 0x9b55(%rip), %rsi      # 0x40b21
callq 0x74d0
movq 0x8(%rsp), %rax
movq 0x68(%rax), %rax
cmpl $0x2, 0x8(%rax)
jl 0x38213
movq $0x0, 0x10(%rsp)
cmpl $0x4, 0x60(%rbx)
jl 0x3704e
movl $0x14, %edx
movq (%rsp), %rdi
leaq 0x9b31(%rip), %rsi      # 0x40b34
callq 0x74d0
movq (%rsp), %rdi
movq 0x10(%rsp), %rsi
callq 0x7710
movq %rax, %r15
movl $0xb, %edx
movq %rax, %rdi
leaq 0x9aed(%rip), %rsi      # 0x40b15
callq 0x74d0
movq %r15, %rdi
movq 0x18(%rsp), %rsi
callq 0x7710
movl $0x1, %edx
movq %rax, %rdi
leaq 0x91e7(%rip), %rsi      # 0x40230
callq 0x74d0
xorl %r15d, %r15d
movq $0x0, 0x20(%rsp)
cmpl $0x0, 0x64(%rbx)
je 0x37093
movq 0xf8(%rsp), %rax
cmpl $0x0, 0x80(%rax)
je 0x37093
movq 0x8(%rsp), %rax
movq 0x88(%rax), %rdi
movq 0x10(%rsp), %rsi
movl %r15d, %edx
movl 0x44(%rsp), %ecx
leaq 0x20(%rsp), %r8
callq 0x255c0
incq 0x2a0(%rbx)
incq 0x280(%rbx)
movq $0x0, 0xc0(%rsp)
movq 0x8(%rsp), %rax
movq 0x68(%rax), %rdi
movq 0x10(%rsp), %rsi
movq 0xb8(%rsp), %rdx
movq 0x18(%rsp), %rcx
movl %r15d, %r8d
leaq 0xc0(%rsp), %r9
callq 0x31c28
movzbl %al, %ebp
cmpl $0x4, 0x60(%rbx)
jl 0x37173
movl $0x6, %edx
movq (%rsp), %rdi
leaq 0x9a54(%rip), %rsi      # 0x40b49
callq 0x74d0
movq (%rsp), %rdi
movl %r15d, %esi
callq 0x7710
movq %rax, %r12
movl $0x7, %edx
movq %rax, %rdi
leaq 0x9a38(%rip), %rsi      # 0x40b50
callq 0x74d0
movsd 0xc0(%rsp), %xmm0
mulsd 0x804a(%rip), %xmm0     # 0x3f178
divsd 0x5eea(%rip), %xmm0     # 0x3d020
callq 0x71c0
movq %r12, %rdi
callq 0x7680
movl $0x1b, %edx
movq (%rsp), %rdi
movq %r14, %rsi
callq 0x74d0
movq (%rsp), %rdi
movl %ebp, %esi
callq 0x7710
movl $0x1, %edx
movq %rax, %rdi
leaq 0x90c2(%rip), %rsi      # 0x40230
callq 0x74d0
testl %ebp, %ebp
je 0x371ff
movq 0x48(%rsp), %rdi
testq %rdi, %rdi
je 0x3718b
movq (%rdi), %rax
callq *0x8(%rax)
movq 0x8(%rsp), %rax
movq 0x68(%rax), %rdi
movsd 0xc0(%rsp), %xmm0
callq 0x28904
movq %rax, 0x48(%rsp)
incq 0x278(%rbx)
movq 0x48(%rsp), %rdi
callq 0x28f26
movq 0x48(%rsp), %rdi
callq 0x297a6
movq 0x18(%rsp), %rsi
shlq $0x4, %rsi
movq 0xb8(%rsp), %rax
addq 0x10(%rax), %rsi
movq 0x48(%rsp), %rdi
movq 0x10(%rsp), %rdx
callq 0x2869e
movq %rax, 0x20(%rsp)
incq 0x270(%rbx)
movq %rax, %rdi
callq 0x297a6
jmp 0x37375
cmpl $0x0, 0x64(%rbx)
je 0x37236
movq 0xf8(%rsp), %rax
cmpl $0x0, 0x80(%rax)
je 0x37236
movq 0x8(%rsp), %rax
movq 0x88(%rax), %rdi
movq 0x10(%rsp), %rsi
movl %r15d, %edx
movl 0x44(%rsp), %ecx
xorl %r8d, %r8d
callq 0x255f0
cmpl $0x3, 0x60(%rbx)
jl 0x37375
movl $0x27, %edx
movq (%rsp), %rdi
leaq 0x9924(%rip), %rsi      # 0x40b74
callq 0x74d0
movq (%rsp), %rdi
movq 0x68(%rsp), %rsi
callq 0x7710
movq %rax, %r12
movl $0x8, %edx
movq %rax, %rdi
leaq 0x971e(%rip), %rsi      # 0x40993
callq 0x74d0
movq %r12, %rdi
movq 0x10(%rsp), %rsi
callq 0x7710
movq %rax, %r12
movl $0xf, %edx
movq %rax, %rdi
leaq 0x9776(%rip), %rsi      # 0x40a0f
callq 0x74d0
movsd 0xc0(%rsp), %xmm0
movq %r12, %rdi
callq 0x7680
movq %rax, %r12
movl $0x1, %edx
movq %rax, %rdi
leaq 0x8275(%rip), %rsi      # 0x3f536
callq 0x74d0
movq %r12, %rdi
movl %r15d, %esi
callq 0x7710
movq %rax, %r12
movl $0x1, %edx
movq %rax, %rdi
leaq 0x6e15(%rip), %rsi      # 0x3e0f8
callq 0x74d0
movl $0xb, %edx
movq %r12, %rdi
leaq 0x981e(%rip), %rsi      # 0x40b15
callq 0x74d0
movq %r12, %rdi
movq 0x18(%rsp), %rsi
callq 0x7710
movq %rax, %r12
movl $0xc, %edx
movq %rax, %rdi
leaq 0x9366(%rip), %rsi      # 0x40681
callq 0x74d0
movq %r12, %rdi
movq 0x50(%rsp), %rsi
callq 0x7710
movq %rax, %r12
movl $0xc, %edx
movq %rax, %rdi
leaq 0x938a(%rip), %rsi      # 0x406c9
callq 0x74d0
movq 0x18(%rsp), %rsi
shlq $0x4, %rsi
movq 0xb8(%rsp), %rax
addq 0x10(%rax), %rsi
movq %r12, %rdi
callq 0x3c96c
movl $0x18, %edx
movq %rax, %rdi
leaq 0x9366(%rip), %rsi      # 0x406d6
callq 0x74d0
testl %ebp, %ebp
je 0x381e0
movq 0x8(%rsp), %rax
movups (%rax), %xmm0
movaps %xmm0, 0x160(%rsp)
movsd 0xc0(%rsp), %xmm0
movsd %xmm0, 0x30(%rsp)
movq 0x68(%rax), %rdi
callq 0x283b4
movq 0x20(%rsp), %rax
movsd 0xb0(%rax), %xmm2
movsd %xmm2, 0xe0(%rsp)
movsd %xmm0, 0x1d0(%rsp)
movsd 0xb8(%rax), %xmm0
movsd %xmm0, 0x28(%rsp)
movsd 0x30(%rsp), %xmm0
movsd %xmm1, 0x1c8(%rsp)
callq 0x7790
movsd %xmm0, 0x1d8(%rsp)
movsd 0x30(%rsp), %xmm0
callq 0x70f0
movapd %xmm0, %xmm3
movsd 0x160(%rsp), %xmm0
movsd 0x168(%rsp), %xmm1
movsd 0x1d0(%rsp), %xmm5
subsd %xmm5, %xmm0
movsd 0x1c8(%rsp), %xmm4
subsd %xmm4, %xmm1
movapd %xmm3, %xmm2
mulsd %xmm1, %xmm2
mulsd %xmm0, %xmm3
movsd 0x1d8(%rsp), %xmm6
mulsd %xmm6, %xmm0
subsd %xmm2, %xmm0
addsd %xmm5, %xmm0
addsd 0xe0(%rsp), %xmm0
mulsd %xmm6, %xmm1
addsd %xmm1, %xmm3
addsd %xmm4, %xmm3
addsd 0x28(%rsp), %xmm3
movsd %xmm3, 0x28(%rsp)
movsd 0x7c54(%rip), %xmm1     # 0x3f0c8
divsd %xmm1, %xmm0
callq 0x71c0
movsd 0x7c43(%rip), %xmm1     # 0x3f0c8
mulsd %xmm1, %xmm0
movsd %xmm0, 0xe0(%rsp)
movsd 0x28(%rsp), %xmm0
divsd %xmm1, %xmm0
callq 0x71c0
mulsd 0x7c1f(%rip), %xmm0     # 0x3f0c8
movsd 0xe0(%rsp), %xmm1
movsd %xmm1, 0x160(%rsp)
movsd %xmm0, 0x168(%rsp)
movq 0x20(%rsp), %r12
movq %r13, %rdi
movq 0xd8(%rsp), %rsi
callq 0x3c91c
movq %rbx, %rdi
movq %r12, %rsi
movq %r13, %rdx
leaq 0x1e0(%rsp), %rcx
leaq 0x160(%rsp), %r8
xorl %r9d, %r9d
callq 0x354b6
movl %eax, %ebp
movq 0x248(%rsp), %rdi
cmpq %r13, %rdi
je 0x3751e
movq (%rdi), %r12
movl $0x18, %esi
callq 0x7440
movq %r12, %rdi
cmpq %r13, %r12
jne 0x37509
testl %ebp, %ebp
je 0x376a3
cmpl $0x3, 0x60(%rbx)
jl 0x37628
movl $0x12, %edx
movq (%rsp), %rdi
leaq 0x9649(%rip), %rsi      # 0x40b89
callq 0x74d0
movq (%rsp), %rdi
movq 0x68(%rsp), %rsi
callq 0x7710
movq %rax, %r12
movl $0x8, %edx
movq %rax, %rdi
leaq 0x942e(%rip), %rsi      # 0x40993
callq 0x74d0
movq %r12, %rdi
movq 0x10(%rsp), %rsi
callq 0x7710
movq %rax, %r12
movl $0xb, %edx
movq %rax, %rdi
leaq 0x958c(%rip), %rsi      # 0x40b15
callq 0x74d0
movq %r12, %rdi
movq 0x18(%rsp), %rsi
callq 0x7710
movq %rax, %r12
movl $0xc, %edx
movq %rax, %rdi
leaq 0x90d4(%rip), %rsi      # 0x40681
callq 0x74d0
movq %r12, %rdi
movq 0x50(%rsp), %rsi
callq 0x7710
movq %rax, %r12
movl $0xc, %edx
movq %rax, %rdi
leaq 0x90f8(%rip), %rsi      # 0x406c9
callq 0x74d0
movq 0x18(%rsp), %rsi
shlq $0x4, %rsi
movq 0xb8(%rsp), %rax
addq 0x10(%rax), %rsi
movq %r12, %rdi
callq 0x3c96c
movq %rax, %r12
movl $0x9, %edx
movq %rax, %rdi
leaq 0x90ea(%rip), %rsi      # 0x406ef
callq 0x74d0
movq %r12, %rdi
movl %ebp, %esi
callq 0x7710
movl $0x1, %edx
movq %rax, %rdi
leaq 0x8c0d(%rip), %rsi      # 0x40230
callq 0x74d0
testb $0x10, %bpl
je 0x3767e
movq 0xf8(%rsp), %rax
cmpl $0x0, 0x80(%rax)
je 0x3767e
cmpl $0x0, 0x64(%rbx)
je 0x37665
movq 0x8(%rsp), %rax
movq 0x88(%rax), %rdi
movq 0x10(%rsp), %rsi
movl %r15d, %edx
movl 0x44(%rsp), %ecx
xorl %r8d, %r8d
callq 0x255f0
movq 0x20(%rsp), %rdi
testq %rdi, %rdi
je 0x37675
movq (%rdi), %rax
callq *0x8(%rax)
movq $0x0, 0x20(%rsp)
movq 0x20(%rsp), %rdi
testq %rdi, %rdi
je 0x37697
movq (%rdi), %rax
callq *0x8(%rax)
movq $0x0, 0x20(%rsp)
incq 0x298(%rbx)
jmp 0x381e0
movq 0xf8(%rsp), %rax
cmpl $0x0, 0x80(%rax)
sete %al
cmpl $0x0, 0x64(%rbx)
sete %cl
orb %al, %cl
movb %cl, 0xe0(%rsp)
jne 0x376e9
movq 0x8(%rsp), %rax
movq 0x88(%rax), %rdi
movq 0x20(%rsp), %r8
movq 0x10(%rsp), %rsi
movl %r15d, %edx
movl 0x44(%rsp), %ecx
callq 0x255f0
movq 0x20(%rsp), %rsi
addq $0x10, %rsi
leaq 0x70(%rsp), %r12
movq %r12, %rdi
callq 0x25bd8
leaq 0x120(%rsp), %rdi
leaq 0x90(%rsp), %rsi
movq %r12, %rdx
callq 0x2598b
movq 0x70(%rsp), %rdi
testq %rdi, %rdi
je 0x37731
movq 0x80(%rsp), %rsi
subq %rdi, %rsi
callq 0x7440
leaq 0x120(%rsp), %rdi
callq 0x25a4b
movsd %xmm0, 0x28(%rsp)
movsd 0x28(%rsp), %xmm0
movsd %xmm0, 0x100(%rsp)
cmpl $0x2, 0x60(%rbx)
jl 0x3782f
movl $0x9, %edx
movq (%rsp), %rdi
leaq 0x915e(%rip), %rsi      # 0x408cb
callq 0x74d0
movq (%rsp), %rdi
movq 0x10(%rsp), %rsi
callq 0x7710
movq %rax, %r12
movl $0x4, %edx
movq %rax, %rdi
leaq 0x8f67(%rip), %rsi      # 0x406f9
callq 0x74d0
movq %r12, %rdi
movq 0x18(%rsp), %rsi
callq 0x7710
movq %rax, %r12
movl $0xc, %edx
movq %rax, %rdi
leaq 0x8f48(%rip), %rsi      # 0x406fe
callq 0x74d0
movq %r12, %rdi
movq 0x50(%rsp), %rsi
callq 0x7710
movq %rax, %r12
movl $0xb, %edx
movq %rax, %rdi
leaq 0x8f31(%rip), %rsi      # 0x4070b
callq 0x74d0
movq %r12, %rdi
movsd 0x28(%rsp), %xmm0
callq 0x7680
movq %rax, %r12
movl $0xd, %edx
movq %rax, %rdi
leaq 0x8f1f(%rip), %rsi      # 0x4071e
callq 0x74d0
movsd 0x28(%rsp), %xmm0
subsd 0xf0(%rsp), %xmm0
movq %r12, %rdi
callq 0x7680
movl $0x1, %edx
movq %rax, %rdi
leaq 0x8a06(%rip), %rsi      # 0x40230
callq 0x74d0
leaq 0x108(%rsp), %rdi
movq 0xb0(%rsp), %rsi
callq 0x3c91c
leaq 0x170(%rsp), %rdi
movq 0xd8(%rsp), %rsi
callq 0x3c91c
movl $0x18, %edi
callq 0x7430
movq 0x8(%rsp), %r12
movq %r12, 0x10(%rax)
movq %rax, %rdi
leaq 0x170(%rsp), %rsi
callq 0x7080
incq 0x180(%rsp)
movq 0x78(%r12), %rdi
testq %rdi, %rdi
je 0x37894
movq (%rdi), %rax
callq *0x8(%rax)
movq 0x8(%rsp), %rax
movq 0x70(%rax), %rdi
testq %rdi, %rdi
je 0x378a8
movq (%rdi), %rax
callq *0x8(%rax)
movq 0x20(%rsp), %rax
movups 0xb0(%rax), %xmm0
movups %xmm0, 0x220(%rsp)
movq 0x8(%rsp), %r12
movq 0x68(%r12), %rdi
movsd 0x30(%rsp), %xmm0
leaq 0x220(%rsp), %rsi
callq 0x28c08
movq %rax, 0x78(%r12)
movq %rax, %rdi
callq 0x28f26
movq 0x78(%r12), %rdi
callq 0x297a6
movq 0x68(%r12), %rdi
callq 0x26926
movsd %xmm0, 0x30(%rsp)
movq 0x8(%rsp), %rax
movq 0x78(%rax), %rsi
addq $0x10, %rsi
leaq 0x208(%rsp), %r12
movq %r12, %rdi
callq 0x25bd8
leaq 0x70(%rsp), %rdi
leaq 0x90(%rsp), %rsi
movq %r12, %rdx
callq 0x2598b
movq 0x140(%rsp), %rdi
movq 0x150(%rsp), %rsi
movq 0x70(%rsp), %rax
movq %rax, 0x140(%rsp)
movupd 0x78(%rsp), %xmm0
movupd %xmm0, 0x148(%rsp)
xorpd %xmm0, %xmm0
movapd %xmm0, 0x70(%rsp)
movq $0x0, 0x80(%rsp)
testq %rdi, %rdi
je 0x37981
subq %rdi, %rsi
callq 0x7440
movq 0x70(%rsp), %rdi
testq %rdi, %rdi
je 0x3799b
movq 0x80(%rsp), %rsi
subq %rdi, %rsi
callq 0x7440
movq 0x208(%rsp), %rdi
testq %rdi, %rdi
je 0x379b8
movq 0x218(%rsp), %rsi
subq %rdi, %rsi
callq 0x7440
movl $0xc0, %edi
callq 0x7430
movq %rax, %r12
movq %rax, %rdi
leaq 0x140(%rsp), %rsi
callq 0x2658a
movq 0x8(%rsp), %rax
movq %r12, 0x70(%rax)
movq %r12, %rdi
callq 0x2821c
cmpl $0x2, 0x60(%rbx)
jl 0x37a78
leaq 0x108(%rsp), %rax
cmpq %rax, 0x108(%rsp)
sete %al
movsd 0x28(%rsp), %xmm0
ucomisd 0xd0(%rsp), %xmm0
jb 0x37a78
testb %al, %al
jne 0x37a78
movl $0xe, %edx
movq (%rsp), %rdi
leaq 0x9174(%rip), %rsi      # 0x40b9c
callq 0x74d0
movq (%rsp), %rdi
movsd 0x28(%rsp), %xmm0
callq 0x7680
movq %rax, %r12
movl $0x21, %edx
movq %rax, %rdi
leaq 0x8cee(%rip), %rsi      # 0x4073c
callq 0x74d0
movq %r12, %rdi
movsd 0xd0(%rsp), %xmm0
callq 0x7680
movl $0x2c, %edx
movq %rax, %rdi
leaq 0x8ceb(%rip), %rsi      # 0x4075e
callq 0x74d0
cmpl $0x2, 0x60(%rbx)
jl 0x37afb
leaq 0x108(%rsp), %rax
cmpq %rax, 0x108(%rsp)
je 0x37afb
movsd 0x28(%rsp), %xmm0
ucomisd 0x38(%rsp), %xmm0
jb 0x37afb
movl $0xe, %edx
movq (%rsp), %rdi
leaq 0x90ee(%rip), %rsi      # 0x40b9c
callq 0x74d0
movq (%rsp), %rdi
movsd 0x28(%rsp), %xmm0
callq 0x7680
movq %rax, %r12
movl $0x23, %edx
movq %rax, %rdi
leaq 0x8cb7(%rip), %rsi      # 0x4078b
callq 0x74d0
movq %r12, %rdi
movsd 0x38(%rsp), %xmm0
callq 0x7680
movl $0x2c, %edx
movq %rax, %rdi
leaq 0x8c68(%rip), %rsi      # 0x4075e
callq 0x74d0
leaq 0x108(%rsp), %rax
cmpq %rax, 0x108(%rsp)
je 0x37e28
movsd 0xd0(%rsp), %xmm0
ucomisd 0x28(%rsp), %xmm0
jb 0x37e28
movsd 0x38(%rsp), %xmm0
ucomisd 0x28(%rsp), %xmm0
jb 0x37e28
movsd 0x30(%rsp), %xmm0
addsd 0xe8(%rsp), %xmm0
movsd %xmm0, 0x30(%rsp)
cmpl $0x2, 0x60(%rbx)
jl 0x37ca1
movl $0x21, %edx
movq (%rsp), %rdi
leaq 0x8c48(%rip), %rsi      # 0x407af
callq 0x74d0
movq (%rsp), %rdi
leaq 0x220(%rsp), %rsi
callq 0x3c96c
movq %rax, %r12
movl $0xc, %edx
movq %rax, %rdi
leaq 0x8deb(%rip), %rsi      # 0x4097a
callq 0x74d0
movq %r12, %rdi
movq 0x68(%rsp), %rsi
callq 0x7710
movl $0x1, %edx
movq %rax, %rdi
leaq 0x8680(%rip), %rsi      # 0x40230
callq 0x74d0
movl $0x10, %edx
movq (%rsp), %rdi
leaq 0x8c0c(%rip), %rsi      # 0x407d1
callq 0x74d0
movq 0x98(%rsp), %rsi
subq 0x90(%rsp), %rsi
sarq $0x4, %rsi
movq (%rsp), %rdi
callq 0x72f0
movq %rax, %r12
movl $0x10, %edx
movq %rax, %rdi
leaq 0x8be9(%rip), %rsi      # 0x407e2
callq 0x74d0
leaq 0x90(%rsp), %rdi
callq 0x25a4b
movq %r12, %rdi
callq 0x7680
movq %rax, %r12
movl $0x14, %edx
movq %rax, %rdi
leaq 0x8bce(%rip), %rsi      # 0x407f3
callq 0x74d0
movq %r12, %rdi
movsd 0x30(%rsp), %xmm0
callq 0x7680
movl $0x1, %edx
movq %rax, %rdi
leaq 0x85e9(%rip), %rsi      # 0x40230
callq 0x74d0
movl $0x18, %edx
movq (%rsp), %rdi
leaq 0x8bac(%rip), %rsi      # 0x40808
callq 0x74d0
movq 0x8(%rsp), %rax
movq 0x70(%rax), %rdi
callq 0x26926
movq (%rsp), %rdi
callq 0x7680
movl $0x1, %edx
movq %rax, %rdi
leaq 0x85a9(%rip), %rsi      # 0x40230
callq 0x74d0
movl $0x24, %edx
movq (%rsp), %rdi
leaq 0x8b85(%rip), %rsi      # 0x40821
callq 0x74d0
leaq 0x70(%rsp), %rdi
leaq 0x90(%rsp), %rsi
callq 0x25ac8
movupd 0x70(%rsp), %xmm0
movupd 0x80(%rsp), %xmm1
movapd %xmm1, 0x1f0(%rsp)
movapd %xmm0, 0x1e0(%rsp)
movq 0x8(%rsp), %rax
movq 0x70(%rax), %r12
leaq 0x188(%rsp), %rdi
leaq 0x170(%rsp), %rsi
callq 0x3c91c
leaq 0x230(%rsp), %r14
movq %r14, %rdi
leaq 0x108(%rsp), %rsi
callq 0x3c91c
movq %rbx, %rdi
movq %r12, %rsi
leaq 0x188(%rsp), %rdx
movq %r14, %rcx
movsd 0x30(%rsp), %xmm0
leaq 0x100(%rsp), %r8
movsd 0x38(%rsp), %xmm1
movl 0x13c(%rsp), %r9d
pushq 0x1c0(%rsp)
movl 0x2b8(%rsp), %eax
pushq %rax
callq 0x36a58
addq $0x10, %rsp
movq %rax, %rbp
movq 0x230(%rsp), %rdi
cmpq %r14, %rdi
je 0x37d74
movq (%rdi), %r12
movl $0x18, %esi
callq 0x7440
movq %r12, %rdi
cmpq %r14, %r12
jne 0x37d5f
movq 0x188(%rsp), %rdi
leaq 0x188(%rsp), %r14
cmpq %r14, %rdi
je 0x37d9e
movq (%rdi), %r12
movl $0x18, %esi
callq 0x7440
movq %r12, %rdi
cmpq %r14, %r12
jne 0x37d89
testq %rbp, %rbp
jne 0x37dba
movsd 0x38(%rsp), %xmm0
addsd 0x5267(%rip), %xmm0     # 0x3d018
movsd %xmm0, 0x100(%rsp)
cmpl $0x2, 0x60(%rbx)
leaq 0x8d93(%rip), %r14      # 0x40b58
jl 0x37e28
movl $0x1b, %edx
movq (%rsp), %rdi
leaq 0x8a6f(%rip), %rsi      # 0x40846
callq 0x74d0
movq (%rsp), %rdi
movl 0x2b8(%rsp), %esi
callq 0x7710
movq %rax, %r12
movl $0xb, %edx
movq %rax, %rdi
leaq 0x8a64(%rip), %rsi      # 0x40862
callq 0x74d0
movsd 0x100(%rsp), %xmm0
movq %r12, %rdi
callq 0x7680
movl $0x1, %edx
movq %rax, %rdi
leaq 0x840d(%rip), %rsi      # 0x40230
callq 0x74d0
movsd 0x100(%rsp), %xmm1
movsd 0x38(%rsp), %xmm0
movsd %xmm1, 0x30(%rsp)
ucomisd %xmm1, %xmm0
jbe 0x380bb
movsd 0xc0(%rsp), %xmm0
movsd %xmm0, 0xc8(%rsp)
movq 0x20(%rsp), %rax
movupd 0xb0(%rax), %xmm0
movapd %xmm0, 0x1a0(%rsp)
cmpl $0x2, 0x60(%rbx)
jl 0x38094
movl $0x1f, %edx
movq (%rsp), %rdi
leaq 0x8d22(%rip), %rsi      # 0x40bab
callq 0x74d0
movq (%rsp), %rdi
movq 0x68(%rsp), %rsi
callq 0x7710
movl $0x1, %edx
movq %rax, %rdi
leaq 0x8385(%rip), %rsi      # 0x40230
callq 0x74d0
movl $0x9, %edx
movq (%rsp), %rdi
leaq 0x8a0b(%rip), %rsi      # 0x408cb
callq 0x74d0
movq (%rsp), %rdi
movq 0x10(%rsp), %rsi
callq 0x7710
movq %rax, %r12
movl $0xb, %edx
movq %rax, %rdi
leaq 0x8c30(%rip), %rsi      # 0x40b15
callq 0x74d0
movq %r12, %rdi
movq 0x18(%rsp), %rsi
callq 0x7710
movq %rax, %r12
movl $0xc, %edx
movq %rax, %rdi
leaq 0x87f5(%rip), %rsi      # 0x406fe
callq 0x74d0
movq %r12, %rdi
movq 0x50(%rsp), %rsi
callq 0x7710
movl $0x1, %edx
movq %rax, %rdi
leaq 0x8306(%rip), %rsi      # 0x40230
callq 0x74d0
movl $0xa, %edx
movq (%rsp), %rdi
leaq 0x899b(%rip), %rsi      # 0x408da
callq 0x74d0
movsd 0xc8(%rsp), %xmm0
mulsd 0x7223(%rip), %xmm0     # 0x3f178
divsd 0x50c3(%rip), %xmm0     # 0x3d020
callq 0x71c0
movq (%rsp), %rdi
callq 0x7680
movq %rax, %r12
movl $0xd, %edx
movq %rax, %rdi
leaq 0x8968(%rip), %rsi      # 0x408e5
callq 0x74d0
movq %r12, %rdi
leaq 0x1a0(%rsp), %rsi
callq 0x3c96c
movq %rax, %r12
movl $0x6, %edx
movq %rax, %rdi
leaq 0x894f(%rip), %rsi      # 0x408f3
callq 0x74d0
movq 0x10(%rsp), %rsi
shlq $0x4, %rsi
movq 0x48(%rsp), %rax
addq 0x10(%rax), %rsi
movq %r12, %rdi
callq 0x3c96c
movq %rax, %r12
movl $0x4, %edx
movq %rax, %rdi
leaq 0x828f(%rip), %rsi      # 0x40264
callq 0x74d0
movq 0x18(%rsp), %rsi
shlq $0x4, %rsi
movq 0xb8(%rsp), %rax
addq 0x10(%rax), %rsi
movq %r12, %rdi
callq 0x3c96c
movl $0x1, %edx
movq %rax, %rdi
leaq 0x822a(%rip), %rsi      # 0x40230
callq 0x74d0
movl $0xc, %edx
movq (%rsp), %rdi
leaq 0x88e3(%rip), %rsi      # 0x408fe
callq 0x74d0
movq (%rsp), %rdi
movsd 0x30(%rsp), %xmm0
callq 0x7680
movq %rax, %r12
movl $0xe, %edx
movq %rax, %rdi
leaq 0x88d2(%rip), %rsi      # 0x40913
callq 0x74d0
movq %r12, %rdi
movsd 0xf0(%rsp), %xmm0
callq 0x7680
movl $0x1, %edx
movq %rax, %rdi
leaq 0x81ca(%rip), %rsi      # 0x40230
callq 0x74d0
movq 0x50(%rsp), %rax
movl %eax, 0x60(%rsp)
movq 0x10(%rsp), %rax
movl %eax, 0x5c(%rsp)
movq 0x18(%rsp), %rax
movl %eax, 0x64(%rsp)
movsd 0x30(%rsp), %xmm0
movsd %xmm0, 0x38(%rsp)
jmp 0x380bb
movq 0x50(%rsp), %rax
movl %eax, 0x60(%rsp)
movq 0x10(%rsp), %rax
movl %eax, 0x5c(%rsp)
movq 0x18(%rsp), %rax
movl %eax, 0x64(%rsp)
movsd 0x30(%rsp), %xmm0
movsd %xmm0, 0x38(%rsp)
cmpb $0x0, 0xe0(%rsp)
je 0x3816f
movq 0x20(%rsp), %rdi
testq %rdi, %rdi
je 0x380d9
movq (%rdi), %rax
callq *0x8(%rax)
movq 0x48(%rsp), %rax
cmpl $0x0, 0x8(%rax)
jne 0x3816f
movl $0x8, %edx
movq 0x19eec(%rip), %rdi     # 0x51fe0
leaq 0x8593(%rip), %rsi      # 0x4068e
callq 0x74d0
movq 0x19ed9(%rip), %rdi     # 0x51fe0
movq 0x48(%rsp), %rsi
callq 0x7350
movq %rax, %r12
movl $0x22, %edx
movq %rax, %rdi
leaq 0x8574(%rip), %rsi      # 0x40697
callq 0x74d0
movq %r12, %rdi
movl 0x2b8(%rsp), %esi
callq 0x7710
movq %rax, %r12
movl $0xe, %edx
movq %rax, %rdi
leaq 0x8571(%rip), %rsi      # 0x406ba
callq 0x74d0
movq %r12, %rdi
movq 0x68(%rsp), %rsi
callq 0x7710
movl $0x1, %edx
movq %rax, %rdi
leaq 0x80c6(%rip), %rsi      # 0x40230
callq 0x74d0
movq 0x170(%rsp), %rdi
leaq 0x170(%rsp), %rbp
cmpq %rbp, %rdi
je 0x38199
movq (%rdi), %r12
movl $0x18, %esi
callq 0x7440
movq %r12, %rdi
cmpq %rbp, %r12
jne 0x38184
movq 0x108(%rsp), %rdi
leaq 0x108(%rsp), %rbp
cmpq %rbp, %rdi
je 0x381c3
movq (%rdi), %r12
movl $0x18, %esi
callq 0x7440
movq %r12, %rdi
cmpq %rbp, %r12
jne 0x381ae
movq 0x120(%rsp), %rdi
testq %rdi, %rdi
je 0x381e0
movq 0x130(%rsp), %rsi
subq %rdi, %rsi
callq 0x7440
incl %r15d
cmpl $0x4, %r15d
jne 0x37051
movq 0x10(%rsp), %rdx
incq %rdx
movq 0x8(%rsp), %rax
movq 0x68(%rax), %rax
movslq 0x8(%rax), %rax
decq %rax
movq %rdx, 0x10(%rsp)
cmpq %rax, %rdx
jl 0x36fed
incl 0x44(%rsp)
movq 0x18(%rsp), %rdx
incq %rdx
movq 0xb8(%rsp), %rax
movslq 0x8(%rax), %rax
decq %rax
movq %rdx, 0x18(%rsp)
cmpq %rax, %rdx
jl 0x36f88
movq 0x50(%rsp), %rax
incl %eax
movq %rax, 0x50(%rsp)
movq 0x1b8(%rsp), %rcx
movq (%rcx), %rcx
cmpq 0xd8(%rsp), %rcx
jne 0x36eec
jmp 0x382a3
movsd 0x6f75(%rip), %xmm0     # 0x3f1e0
movsd %xmm0, 0x38(%rsp)
movl $0xffffffff, 0x60(%rsp) # imm = 0xFFFFFFFF
movsd 0x6f77(%rip), %xmm0     # 0x3f1f8
movsd %xmm0, 0xc8(%rsp)
movl $0xffffffff, 0x5c(%rsp) # imm = 0xFFFFFFFF
movl $0xffffffff, 0x64(%rsp) # imm = 0xFFFFFFFF
movq $0x0, 0x48(%rsp)
movq 0x48(%rsp), %rdi
testq %rdi, %rdi
je 0x382b3
movq (%rdi), %rax
callq *0x8(%rax)
movsd 0x6f45(%rip), %xmm0     # 0x3f200
ucomisd 0xc8(%rsp), %xmm0
movq 0x8(%rsp), %r12
movq 0x1b0(%rsp), %r15
jbe 0x38332
movabsq $0x4a511b0ec57e649a, %rax # imm = 0x4A511B0EC57E649A
movq %rax, (%r15)
xorl %r12d, %r12d
movq 0x140(%rsp), %rdi
testq %rdi, %rdi
je 0x38300
movq 0x150(%rsp), %rsi
subq %rdi, %rsi
callq 0x7440
movq 0x90(%rsp), %rdi
testq %rdi, %rdi
je 0x3831d
movq 0xa0(%rsp), %rsi
subq %rdi, %rsi
callq 0x7440
movq %r12, %rax
addq $0x278, %rsp            # imm = 0x278
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movsd 0x38(%rsp), %xmm0
ucomisd 0xd0(%rsp), %xmm0
jbe 0x383b6
movsd %xmm0, (%r15)
cmpl $0x2, 0x60(%rbx)
jl 0x382e3
addq $0x68, %rbx
leaq 0x85c9(%rip), %rsi      # 0x40922
movl $0x6, %edx
movq %rbx, %rdi
callq 0x74d0
movq %rbx, %rdi
movl 0x2b8(%rsp), %esi
callq 0x7710
movq %rax, %rbx
leaq 0x85aa(%rip), %rsi      # 0x40929
movl $0x15, %edx
movq %rax, %rdi
callq 0x74d0
movq %rbx, %rdi
movsd 0xd0(%rsp), %xmm0
callq 0x7680
leaq 0x859b(%rip), %rsi      # 0x4093f
movl $0x1e, %edx
movq %rax, %rdi
callq 0x74d0
jmp 0x382e3
movq 0x78(%r12), %rdi
testq %rdi, %rdi
je 0x383c6
movq (%rdi), %rax
callq *0x8(%rax)
movq 0x70(%r12), %rdi
testq %rdi, %rdi
je 0x383d6
movq (%rdi), %rax
callq *0x8(%rax)
movq 0x68(%r12), %rdi
leaq 0x1a0(%rsp), %rsi
movsd 0xc8(%rsp), %xmm0
callq 0x28c08
movq %rax, 0x78(%r12)
movq %rax, %rdi
callq 0x28f26
movq 0x78(%r12), %rdi
callq 0x297a6
movq 0x78(%r12), %rdi
callq 0x26926
movsd %xmm0, (%rsp)
movq 0x78(%r12), %rsi
addq $0x10, %rsi
leaq 0x120(%rsp), %rdi
callq 0x25bd8
leaq 0x70(%rsp), %rdi
leaq 0x90(%rsp), %rsi
leaq 0x120(%rsp), %rdx
callq 0x2598b
movq 0x90(%rsp), %rdi
movq 0xa0(%rsp), %rsi
movq 0x70(%rsp), %rax
movq %rax, 0x90(%rsp)
movupd 0x78(%rsp), %xmm0
movupd %xmm0, 0x98(%rsp)
xorpd %xmm0, %xmm0
movapd %xmm0, 0x70(%rsp)
movq $0x0, 0x80(%rsp)
testq %rdi, %rdi
je 0x38496
subq %rdi, %rsi
callq 0x7440
movq 0x70(%rsp), %rdi
testq %rdi, %rdi
je 0x384b0
movq 0x80(%rsp), %rsi
subq %rdi, %rsi
callq 0x7440
movq 0x120(%rsp), %rdi
testq %rdi, %rdi
je 0x384cd
movq 0x130(%rsp), %rsi
subq %rdi, %rsi
callq 0x7440
movl $0xc0, %edi
callq 0x7430
movq %rax, %r14
leaq 0x90(%rsp), %rsi
movq %rax, %rdi
callq 0x2658a
movq %r14, 0x70(%r12)
movq %r14, %rdi
callq 0x2821c
movq 0x70(%r12), %rdi
callq 0x283b4
movsd 0x38(%rsp), %xmm0
movsd %xmm0, (%r15)
cmpl $0x0, 0x60(%rbx)
jle 0x382e3
addq $0x68, %rbx
leaq 0x8401(%rip), %rsi      # 0x40922
movl $0x6, %edx
movq %rbx, %rdi
callq 0x74d0
movq %rbx, %rdi
movl 0x2b8(%rsp), %esi
callq 0x7710
movq %rax, %r14
leaq 0x8417(%rip), %rsi      # 0x4095e
movl $0x17, %edx
movq %rax, %rdi
callq 0x74d0
leaq 0x1a0(%rsp), %rsi
movq %r14, %rdi
callq 0x3c96c
movq %rax, %r14
leaq 0x8408(%rip), %rsi      # 0x40976
movl $0x1, %edx
movq %rax, %rdi
callq 0x74d0
movsd 0xc8(%rsp), %xmm0
mulsd 0x6bec(%rip), %xmm0     # 0x3f178
divsd 0x4a8c(%rip), %xmm0     # 0x3d020
callq 0x71c0
movq %r14, %rdi
callq 0x7680
movq %rax, %r14
leaq 0x83cd(%rip), %rsi      # 0x40978
movl $0xe, %edx
movq %rax, %rdi
callq 0x74d0
movq %r14, %rdi
movq 0x68(%rsp), %rsi
callq 0x7710
movq %rax, %r14
leaq 0x83b9(%rip), %rsi      # 0x40988
movl $0x13, %edx
movq %rax, %rdi
callq 0x74d0
movq %r14, %rdi
movl 0x5c(%rsp), %esi
callq 0x7710
movq %rax, %r14
leaq 0x8523(%rip), %rsi      # 0x40b15
movl $0xb, %edx
movq %rax, %rdi
callq 0x74d0
movq %r14, %rdi
movl 0x64(%rsp), %esi
callq 0x7710
movq %rax, %r14
leaq 0x80e9(%rip), %rsi      # 0x406fe
movl $0xc, %edx
movq %rax, %rdi
callq 0x74d0
movq %r14, %rdi
movl 0x60(%rsp), %esi
callq 0x7710
leaq 0x7bfb(%rip), %rsi      # 0x40230
movl $0x1, %edx
movq %rax, %rdi
callq 0x74d0
leaq 0x8188(%rip), %rsi      # 0x407d1
movl $0x10, %edx
movq %rbx, %rdi
callq 0x74d0
movq 0x98(%rsp), %rsi
subq 0x90(%rsp), %rsi
sarq $0x4, %rsi
movq %rbx, %rdi
callq 0x72f0
movq %rax, %r14
leaq 0x8166(%rip), %rsi      # 0x407e2
movl $0x10, %edx
movq %rax, %rdi
callq 0x74d0
leaq 0x90(%rsp), %rdi
callq 0x25a4b
movq %r14, %rdi
callq 0x7680
movq %rax, %r14
leaq 0x814b(%rip), %rsi      # 0x407f3
movl $0x14, %edx
movq %rax, %rdi
callq 0x74d0
movsd (%rsp), %xmm0
addsd 0xe8(%rsp), %xmm0
movq %r14, %rdi
callq 0x7680
leaq 0x7b5e(%rip), %rsi      # 0x40230
movl $0x1, %edx
movq %rax, %rdi
callq 0x74d0
leaq 0x8122(%rip), %rsi      # 0x40808
movl $0x18, %edx
movq %rbx, %rdi
callq 0x74d0
movq 0x70(%r12), %rdi
callq 0x26926
movq %rbx, %rdi
callq 0x7680
movq %rax, %r14
leaq 0x828d(%rip), %rsi      # 0x4099c
movl $0x7, %edx
movq %rax, %rdi
callq 0x74d0
movsd (%r15), %xmm0
movq %r14, %rdi
callq 0x7680
leaq 0x7b00(%rip), %rsi      # 0x40230
movl $0x1, %edx
movq %rax, %rdi
callq 0x74d0
leaq 0x8260(%rip), %rsi      # 0x409a4
movl $0x13, %edx
movq %rbx, %rdi
callq 0x74d0
movq 0xb0(%rsp), %rax
movq 0x10(%rax), %rsi
movq %rbx, %rdi
callq 0x72f0
leaq 0x7ac4(%rip), %rsi      # 0x40230
movl $0x1, %edx
movq %rax, %rdi
callq 0x74d0
movq 0xb0(%rsp), %rax
movq (%rax), %r15
cmpq %rax, %r15
je 0x382e3
movl $0x1, %ebp
leaq 0x823e(%rip), %r13      # 0x409d7
movq 0x10(%r15), %r12
cmpq $0x0, 0x78(%r12)
je 0x3886f
movl $0x9, %edx
movq %rbx, %rdi
leaq 0x8200(%rip), %rsi      # 0x409b8
callq 0x74d0
movq %rbx, %rdi
movl %ebp, %esi
callq 0x7710
movq %rax, %r14
movl $0xe, %edx
movq %rax, %rdi
leaq 0x81e9(%rip), %rsi      # 0x409c2
callq 0x74d0
movq 0x78(%r12), %rax
movupd 0xb0(%rax), %xmm0
movupd %xmm0, 0x70(%rsp)
movq %r14, %rdi
leaq 0x70(%rsp), %rsi
callq 0x3c96c
movq %rax, %r14
movl $0x5, %edx
movq %rax, %rdi
leaq 0x81c1(%rip), %rsi      # 0x409d1
callq 0x74d0
movq 0x78(%r12), %rax
movsd 0xa8(%rax), %xmm0
mulsd 0x694e(%rip), %xmm0     # 0x3f178
divsd 0x47ee(%rip), %xmm0     # 0x3d020
callq 0x71c0
movq %r14, %rdi
callq 0x7680
movl $0xb, %edx
movq %rbx, %rdi
movq %r13, %rsi
callq 0x74d0
movq 0x70(%r12), %rdi
callq 0x26926
movq %rbx, %rdi
callq 0x7680
movl $0x1, %edx
leaq 0x79c3(%rip), %rsi      # 0x40230
jmp 0x38899
movl $0x8, %edx
movq %rbx, %rdi
leaq 0x813b(%rip), %rsi      # 0x409b9
callq 0x74d0
movq %rbx, %rdi
movl %ebp, %esi
callq 0x7710
movl $0xb, %edx
leaq 0x8332(%rip), %rsi      # 0x40bcb
movq %rax, %rdi
callq 0x74d0
incl %ebp
movq (%r15), %r15
cmpq 0xb0(%rsp), %r15
jne 0x38799
movq 0x8(%rsp), %r12
jmp 0x382e3
movq %rax, %rbx
movl $0xc0, %esi
jmp 0x388da
jmp 0x38a29
jmp 0x38ab6
movq %rax, %rbx
movl $0x38, %esi
movq %r14, %rdi
jmp 0x38aad
jmp 0x38ab6
jmp 0x38ab6
jmp 0x38ab6
jmp 0x38ab6
jmp 0x38ab6
jmp 0x38ab6
jmp 0x38ab6
jmp 0x38ab6
jmp 0x38ab6
jmp 0x38ab6
jmp 0x38ab6
jmp 0x38ab6
jmp 0x38a2e
movq %rax, %rbx
movq 0x230(%rsp), %rdi
cmpq %r14, %rdi
je 0x38958
movq %r14, %r12
leaq 0x188(%rsp), %r15
movq (%rdi), %r14
movl $0x18, %esi
callq 0x7440
movq %r14, %rdi
cmpq %r12, %r14
jne 0x3893e
jmp 0x38960
movq %rax, %rbx
leaq 0x188(%rsp), %r15
movq 0x188(%rsp), %rdi
cmpq %r15, %rdi
je 0x38a31
movq (%rdi), %r14
movl $0x18, %esi
callq 0x7440
movq %r14, %rdi
cmpq %r15, %r14
jne 0x38971
jmp 0x38a31
jmp 0x38ab6
jmp 0x38a2e
movq %rax, %rbx
jmp 0x38a63
movq %rax, %rbx
movq 0x208(%rsp), %rdi
testq %rdi, %rdi
je 0x38a31
movq 0x218(%rsp), %rsi
subq %rdi, %rsi
jmp 0x389f0
jmp 0x38a2e
movq %rax, %rbx
movq 0x70(%rsp), %rdi
testq %rdi, %rdi
je 0x38ab9
movq 0x80(%rsp), %rsi
jmp 0x38aaa
jmp 0x38ab6
jmp 0x38a29
movq %rax, %rbx
movl $0xc0, %esi
movq %r12, %rdi
callq 0x7440
jmp 0x38a31
jmp 0x38a2e
movq %rax, %rbx
movq 0x248(%rsp), %rdi
cmpq %r13, %rdi
je 0x38ab9
movq (%rdi), %r14
movl $0x18, %esi
callq 0x7440
movq %r14, %rdi
cmpq %r13, %r14
jne 0x38a0d
jmp 0x38ab9
jmp 0x38a2e
movq %rax, %rbx
jmp 0x38a95
movq %rax, %rbx
movq 0x170(%rsp), %rdi
leaq 0x170(%rsp), %rax
cmpq %rax, %rdi
je 0x38a63
leaq 0x170(%rsp), %r15
movq (%rdi), %r14
movl $0x18, %esi
callq 0x7440
movq %r14, %rdi
cmpq %r15, %r14
jne 0x38a4e
movq 0x108(%rsp), %rdi
leaq 0x108(%rsp), %rax
cmpq %rax, %rdi
je 0x38a95
leaq 0x108(%rsp), %r15
movq (%rdi), %r14
movl $0x18, %esi
callq 0x7440
movq %r14, %rdi
cmpq %r15, %r14
jne 0x38a80
movq 0x120(%rsp), %rdi
testq %rdi, %rdi
je 0x38ab9
movq 0x130(%rsp), %rsi
subq %rdi, %rsi
callq 0x7440
jmp 0x38ab9
jmp 0x38ab6
movq %rax, %rbx
movq 0x140(%rsp), %rdi
testq %rdi, %rdi
je 0x38ad6
movq 0x150(%rsp), %rsi
subq %rdi, %rsi
callq 0x7440
movq 0x90(%rsp), %rdi
testq %rdi, %rdi
je 0x38af3
movq 0xa0(%rsp), %rsi
subq %rdi, %rsi
callq 0x7440
movq %rbx, %rdi
callq 0x7730