// File: /workspace/github_cpp_makefile_star2_O2/thierry7100[P]CutOptim/src/SvgDoc.cpp
// Function: SvgDoc::OptimizeLevel(Polygon*, std::__cxx11::list<NSVGpath*, std::allocator<NSVGpath*>>, std::__cxx11::list<NSVGpath*, std::allocator<NSVGpath*>>, int, double, double, double&, double, int, int, int)
NSVGpath *SvgDoc::OptimizeLevel(Polygon *FixedPolyHull, std::list<NSVGpath *> FixedList, std::list<NSVGpath *> CurFloating, int num_rot, double StepAngle, 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 << ", Cost is " << Cost << ", 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 = -1;            //   Impossible value

    double tmpPolygonArea = FixedArea + WorkingFloatingEntry->LargePolygon->area();
    int nPreviousVertices = getFixedNbVertex(FixedList);            //  Number of vertices of all polygons before this one
    if ( debug_level > 1 )
    {
        OutDebug << "Polygon to be placed : " << WorkingFloatingEntry->id << "  has " << WorkingFloatingEntry->LargePolygon->nVertices << " vertices.\n";
    }
    //  Build a cache object which will speed up computation if not yet present
    if (UseCache && WorkingFloatingEntry->CachePoly == NULL )
    {
        WorkingFloatingEntry->CachePoly = new CachePosition(WorkingFloatingEntry->LargePolygon->nVertices, num_rot, nPreviousVertices);
        if ( debug_level > 1 )
        {
            OutDebug << "Create cache object for polygon " << WorkingFloatingEntry->id << "  with " << WorkingFloatingEntry->LargePolygon->nVertices*num_rot*nPreviousVertices << " entries.\n";
        }
    }
    else if ( UseCache and debug_level > 1)
    {
        OutDebug << "Cache object for polygon " << WorkingFloatingEntry->id << "  is already present \n";
    }
#ifdef UNDEF
    if ( FloatPolygon == 2)
    {
        OutDebug << "Cache object for Polygon 2=" << WorkingFloatingEntry->CachePoly << " cache value for 0/3/2 = " << WorkingFloatingEntry->CachePoly->isOKPlaced(3, 0, 2, &trans_rot_p)<< "\n";
    }
#endif
    //  Try each possible angle
    int iRot = 0;
    for ( double angle = 0; angle < 2*M_PI - 0.001; angle += StepAngle, iRot++)
    {
        if ( debug_level > 1 )
            OutDebug << "L" << LevelOptimize << ": Rotation set to " << round(angle*180/M_PI) << "\n";
        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();

        //  Then 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;
            // For each vertex of this placed polygon
            for ( int i = 0; i < curFixed->nVertices-1; iFixedVertex++, i++)
            {
                if ( debug_level > 0 )
                    OutDebug << std::flush;
                //  Try all vertices of the floating polygon, and select the best
                for (int j = 0; j < rot_p->nVertices-1; j++)
                {
                    //  Use cache if available
                    trans_rot_p = NULL;
                    int Cached = 0;
                    //  If we use cache and only if the path is fixed, look for cache status
                    if ( UseCache && path->isFixed )
                    {
                        Cached = WorkingFloatingEntry->CachePoly->isOKPlaced(j, iRot, iFixedVertex, &trans_rot_p);
#if DEBUG_CACHE > 0
                        OutDebug << "isOKPlaced(idx=" << j << ", iRot=" << iRot << ", iFixedVertex=" << iFixedVertex << ") return " << Cached << '\n' << std::flush;
#endif // DEBUG_CACHE
                    }
#ifdef UNDEF
                    if ( FloatPolygon == 2 && iRot == 1 && FixedPolygon == 0 && i == 0 && j == 1)
                    {
                        OutDebug << "Breakpoint reached!\n";
                        OutDebug.flush();
                    }
#endif
                    if ( Cached < 0 )       //  Cache says impossible !
                    {
                        CacheHit_KO++;
                        if ( debug_level > 2 )
                            OutDebug << "Cache says placement polygon " << FloatPolygon << " vertex " << j << " on vertex " << i << " of Polygon " << FixedPolygon << "(" << iFixedVertex << ")" << "impossible " << *curFixed->GetVertex(i) << "\n";
                        continue;           //  Goto next vertex...
                    }
                    else if ( Cached == 0 )
                    {
                        CacheMiss++;        // Not yet in cache, check angles first
                        //  No need to check angles when cached, because we test against a fixed polygon, and this test is included in the cache result
                        nbCheckAngles++;
                        if ( rot_p->nVertices == 0 )
                        {
                            cerr << " rot_p (" << rot_p << ") invalid with 0 vertices, level =" << LevelOptimize << " Float poly = " << FloatPolygon << "\n";
                        }
                        if (CheckAngles(rot_p, j, curFixed, i) == 0)
                        {
                            //  Impossible, invalid cache entry if polygon is fixed
                            if ( UseCache && path->isFixed )
                            {
                                WorkingFloatingEntry->CachePoly->addOKPlaced(j, iRot, iFixedVertex, NULL);
#if DEBUG_CACHE > 0
                                OutDebug << "CheckAngle NOK, invalidate entry (idx=" << j << ", iRot=" << iRot << ", iFixedVertex=" << iFixedVertex << ")\n" << std::flush;
#endif // DEBUG_CACHE

                            }
                            if ( debug_level > 2 )
                                OutDebug << "Placement polygon " << FloatPolygon << " vertex " << j << " on vertex " << i << " of Polygon " << FixedPolygon << " impossible " << *curFixed->GetVertex(i) << ", reason angle mismatch\n";
                            continue;    //  Not possible go to next without further processing
                        }
                        //  Compute polygon translated and rotated...
                        trans_rot_p = rot_p->Translate(curFixed->GetVertex(i), j);
                        nbTranslation++;
                        trans_rot_p->CalcSegments();
                    }
                    else
                    {
                        CacheHit_OK++;
                    }

                    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 " << j << " on vertex " << i << " of Polygon " << FixedPolygon << " impossible " << *curFixed->GetVertex(i) << ", 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->addOKPlaced(j, iRot, iFixedVertex, NULL);
#if DEBUG_CACHE > 0
                                OutDebug << "PlacementNotPossible NOK, invalidate entry (idx=" << j << ", iRot=" << iRot << ", iFixedVertex=" << iFixedVertex << ")\n" << std::flush;
#endif // DEBUG_CACHE
                            }
                            //  And free memory of polygon translated / rotated
                            delete trans_rot_p;
                            trans_rot_p = NULL;
                        }
                        //  Free memory associated with polygon only if not cached
                        if ( Cached == 0 && trans_rot_p != NULL )
                        {
                            delete trans_rot_p;
                            trans_rot_p = NULL;
                        }

                        nbPlacementImpossible++;
                        if ( rot_p->nVertices == 0 )
                        {
                            cerr << " rot_p (" << rot_p << ") invalid with 0 vertices, level =" << LevelOptimize << " Float poly = " << FloatPolygon << "\n";
                        }
                        continue;
                    }
                    if ( path->isFixed && Cached == 0)        //  If current vertex belongs to a fixed path, cache value
                    {
                        if ( UseCache )
                        {
                            WorkingFloatingEntry->CachePoly->addOKPlaced(j, iRot, iFixedVertex, trans_rot_p);
#if DEBUG_CACHE > 0
                            OutDebug << "PlacementNotPossible OK, validate entry (idx=" << j << ", iRot=" << iRot << ", iFixedVertex=" << iFixedVertex << ")\n" << std::flush;
#endif // DEBUG_CACHE
                            Cached = 1;
                        }
#ifdef UNDEF
                        if ( LevelOptimize == 1 && FloatPolygon == 2 && iRot == 0 && iFixedVertex == 2 && j == 3 )
                        {
                            OutDebug << "iRot=0, Vertex 3 of Polygon 2 placed on vertex 2 of polygon 0, add cache entry "  << trans_rot_p << "\n";
                            Polygon *TestPoly = NULL;
                            int TestCache = WorkingFloatingEntry->CachePoly->isOKPlaced(j, iRot, iFixedVertex, &TestPoly);
                            OutDebug << "Check Cached=" << TestCache << " Value Cached=" << TestPoly << "\n";
                        }
#endif
                    }
                    //  Compute cost function
                    //  We will use the Hull area and a factor of the bounding box.
                    //  As the Hull and bounding box 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);
                    Rectangle tmpOverall = Hull2BoundingBox(FixedHull);
                    double CurrentCost = tmpHullArea + RectCostFactor*tmpOverall.get_area();
                    if ( debug_level > 1)
                        OutDebug << "  Vertex " << j << " on " << i << " of polygon " << FixedPolygon << " Hull area " << tmpHullArea << " Cost " << CurrentCost << "--> DiffArea=" << CurrentCost - 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() && CurrentCost >= InBestCost )
                    {
                        OutDebug << "L" << LevelOptimize << ", CurrentCost (" << CurrentCost << ") larger than input best values (" << InBestCost << ") no need to process other polygons in list\n";
                    }
                    if ( debug_level > 1 && !tmpFloatList.empty() && CurrentCost >= BestCost )
                    {
                        OutDebug << "L" << LevelOptimize << ", CurrentCost (" << CurrentCost << ") larger than current best values (" << BestCost << ") no need to process other polygons in list\n";
                    }
                    if ( !tmpFloatList.empty() && (CurrentCost <= InBestCost && CurrentCost <= BestCost) ) //  To go deeper, we need something in list and cost lower than previous min
                    {
                        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 = OptimizeLevel(WorkingFloatingEntry->LargeConvexHull, tmpFixedList, tmpFloatList, num_rot, StepAngle, tmpFixedArea, CurrentCost, BestCost, FloatPolygon+1, nbFixedPoly, LevelOptimize - 1);
                        if ( Res == NULL )
                        {
                            //  Placement impossible, make sure that CurrentCost will be greater than BestCost
                            CurrentCost = BestCost + 10;
                        }
                        //  After return, the CurrentCost is updated
                        if ( debug_level > 1 )
                        {
                            OutDebug << "-----   Returning at level " << LevelOptimize << ",  Cost is " << CurrentCost << "\n";
                        }
                    }

                    if ( CurrentCost < BestCost  )
                    {   //  Yes record new best value and corresponding position
                        if ( CurrentCost < tmpPolygonArea )
                        {
                            cerr << "Internal error, hull area is lower than polygon area!\n";
                        }
                        //else
                        {
                            BestCost = CurrentCost;
                            BestAngle = angle;
                            BestTranslation = trans_rot_p->getTranslation();
                            Best_i = i;
                            Best_j = j;
                            Best_Poly = FixedPolygon;
                            if ( debug_level > 1 )
                            {
                                OutDebug << "L" << LevelOptimize << ", new best found placing polygon " << FloatPolygon << "\n";
                                OutDebug << "      Vertex " << j << " on vertex " << i << " of polygon " <<  FixedPolygon << "\n";
                                OutDebug << "      Rotation=" << round(angle*180/M_PI) << " Translation " << BestTranslation << " from " << *(rot_p->GetVertex(j)) << " to " <<  *(curFixed->GetVertex(i)) << "\n";
                                OutDebug << "      Hull area:" << tmpHullArea << "  Cost:" << CurrentCost << " 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->nVertices == 0 )
    {
        cerr << " rot_p (" << rot_p << ") invalid with 0 vertices, level =" << LevelOptimize << " Float poly = " << FloatPolygon << "\n";
    }
    if ( rot_p != NULL ) delete rot_p;
    rot_p = NULL;
    //  Place polygon at BestAngle and Best Translation
    if ( BestAngle < 0 )
    {
        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  << "(" << WorkingFloatingEntry->id << ") 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;
            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 $0x2b8, %rsp            # imm = 0x2B8
movsd %xmm2, 0x88(%rsp)
movq %r9, 0xb8(%rsp)
movsd %xmm1, 0xd8(%rsp)
movsd %xmm0, 0x140(%rsp)
movl %r8d, 0x78(%rsp)
movq %rcx, 0x70(%rsp)
movq %rdx, 0xd0(%rsp)
movq %rsi, %rbx
movq %rdi, %r13
andq $0x0, 0x30(%rsp)
xorpd %xmm0, %xmm0
movapd %xmm0, 0xa0(%rsp)
andq $0x0, 0xb0(%rsp)
movapd %xmm0, 0x170(%rsp)
andq $0x0, 0x180(%rsp)
movapd %xmm0, 0x150(%rsp)
movapd %xmm0, 0x160(%rsp)
cmpl $0x2, 0x60(%rdi)
jl 0x2bae1
leaq 0x68(%r13), %r14
leaq 0xbbd0(%rip), %rsi      # 0x375af
movq %r14, %rdi
callq 0x8420
movq %rax, %rdi
movl 0x300(%rsp), %esi
callq 0x8740
leaq 0xbbca(%rip), %rsi      # 0x375c7
movq %rax, %rdi
callq 0x8420
movq %rax, %r15
movq %rbx, %rdi
callq 0x22296
movq %r15, %rdi
callq 0x86b0
leaq 0xbbba(%rip), %rsi      # 0x375d9
movq %rax, %rdi
callq 0x8420
movq %rax, %rdi
movsd 0xd8(%rsp), %xmm0
callq 0x86b0
leaq 0xbba7(%rip), %rsi      # 0x375e6
movq %r14, %rdi
callq 0x8420
movq 0xb8(%rsp), %rcx
movsd (%rcx), %xmm0
movq %rax, %rdi
callq 0x86b0
leaq 0xbb8f(%rip), %rsi      # 0x375f1
movq %rax, %rdi
callq 0x8420
movq %rax, %rdi
movsd 0x88(%rsp), %xmm0
callq 0x86b0
leaq 0xb80a(%rip), %rsi      # 0x3728c
movq %rax, %rdi
callq 0x8420
leaq 0xbb6e(%rip), %rsi      # 0x375ff
movq %r14, %rdi
callq 0x8420
movq 0x70(%rsp), %rcx
movq 0x10(%rcx), %rsi
movq %rax, %rdi
callq 0x8310
leaq 0xbb60(%rip), %rsi      # 0x37611
movq %rax, %rdi
callq 0x8420
movq 0x70(%rsp), %rcx
movq (%rcx), %rcx
movl $0x90, %esi
addq 0x10(%rcx), %rsi
movq %rax, %rdi
callq 0x8420
leaq 0xb7b3(%rip), %rsi      # 0x3728c
movq %rax, %rdi
callq 0x8420
leaq 0x10(%rbx), %rsi
leaq 0x100(%rsp), %rdi
callq 0x21456
leaq 0xa0(%rsp), %rdi
leaq 0x100(%rsp), %r14
movq %r14, %rsi
callq 0x24bf4
movq %r14, %rdi
callq 0x2150c
movq %rbx, %rdi
callq 0x233aa
leaq 0x100(%rsp), %rdi
movq %rbx, %rsi
callq 0x2329a
movupd 0x100(%rsp), %xmm0
movupd 0x110(%rsp), %xmm1
movapd %xmm1, 0x210(%rsp)
movapd %xmm0, 0x200(%rsp)
movq 0x70(%rsp), %rdi
movq (%rdi), %rax
movq 0x10(%rax), %rax
movq %rax, 0x8(%rsp)
callq 0x333de
movq 0x8(%rsp), %rax
movq 0x68(%rax), %rdi
callq 0x22296
movsd %xmm0, 0xc8(%rsp)
leaq 0x2a0(%rsp), %rdi
movq 0xd0(%rsp), %rsi
callq 0x333a4
leaq 0x2a0(%rsp), %r14
movq %r14, %rsi
callq 0x2d754
movl %eax, %ebx
movq %r14, %rdi
callq 0x33458
cmpl $0x2, 0x60(%r13)
jl 0x2bc05
leaq 0x68(%r13), %rdi
leaq 0xba60(%rip), %rsi      # 0x3761c
callq 0x8420
movl $0x90, %esi
addq 0x8(%rsp), %rsi
movq %rax, %rdi
callq 0x8420
leaq 0xba5a(%rip), %rsi      # 0x37634
movq %rax, %rdi
callq 0x8420
movq 0x8(%rsp), %rcx
movq 0x68(%rcx), %rcx
movl 0x8(%rcx), %esi
movq %rax, %rdi
callq 0x8740
leaq 0xba3e(%rip), %rsi      # 0x3763b
movq %rax, %rdi
callq 0x8420
movl 0x64(%r13), %eax
testl %eax, %eax
je 0x2bc1c
movq 0x8(%rsp), %r15
cmpq $0x0, 0x88(%r15)
je 0x2bc5d
testl %eax, %eax
je 0x2bcec
cmpl $0x2, 0x60(%r13)
jl 0x2bcec
leaq 0x68(%r13), %rdi
leaq 0xba41(%rip), %rsi      # 0x3767b
callq 0x8420
movl $0x90, %esi
addq 0x8(%rsp), %rsi
movq %rax, %rdi
callq 0x8420
leaq 0xba3d(%rip), %rsi      # 0x37695
jmp 0x2bce4
pushq $0x38
popq %rdi
callq 0x8440
movq %rax, %r14
movq 0x68(%r15), %rax
movl 0x8(%rax), %esi
movq %r14, %rdi
movl 0x78(%rsp), %edx
movl %ebx, %ecx
callq 0x20eb4
movq 0x8(%rsp), %rax
movq %r14, 0x88(%rax)
cmpl $0x2, 0x60(%r13)
jl 0x2bcec
leaq 0x68(%r13), %rdi
leaq 0xb9ac(%rip), %rsi      # 0x37647
callq 0x8420
movl $0x90, %esi
addq 0x8(%rsp), %rsi
movq %rax, %rdi
callq 0x8420
leaq 0xb9af(%rip), %rsi      # 0x37668
movq %rax, %rdi
callq 0x8420
movq 0x8(%rsp), %rcx
movq 0x68(%rcx), %rcx
imull 0x78(%rsp), %ebx
imull 0x8(%rcx), %ebx
movq %rax, %rdi
movl %ebx, %esi
callq 0x8740
leaq 0xb98c(%rip), %rsi      # 0x37670
movq %rax, %rdi
callq 0x8420
movl 0x2f0(%rsp), %ecx
movsd 0xc8(%rsp), %xmm0
addsd 0xd8(%rsp), %xmm0
movsd %xmm0, 0xc8(%rsp)
leaq 0x68(%r13), %rax
movq %rax, 0x10(%rsp)
leal 0x1(%rcx), %eax
movq %rax, 0x1a8(%rsp)
movl 0x300(%rsp), %eax
decl %eax
movq %rax, 0x1a0(%rsp)
movsd 0xa4fd(%rip), %xmm0     # 0x36238
movsd %xmm0, 0x40(%rsp)
pushq $-0x1
popq %rax
movsd 0xa454(%rip), %xmm0     # 0x361a0
movsd %xmm0, 0xc0(%rsp)
movq $0x0, 0x90(%rsp)
xorpd %xmm0, %xmm0
movl %eax, 0x7c(%rsp)
movl %eax, 0x84(%rsp)
movl %eax, 0x80(%rsp)
xorl %r14d, %r14d
movsd %xmm0, 0x60(%rsp)
movsd 0xa4a8(%rip), %xmm1     # 0x36230
ucomisd %xmm0, %xmm1
jbe 0x2d072
cmpl $0x2, 0x60(%r13)
jl 0x2bdfd
movq 0x10(%rsp), %rdi
leaq 0x924f(%rip), %rsi      # 0x34ff4
callq 0x8420
movq %rax, %rdi
movl 0x300(%rsp), %esi
callq 0x8740
movq %rax, %rdi
leaq 0xb8e9(%rip), %rsi      # 0x376ac
callq 0x8420
movq %rax, %rbx
movsd 0x60(%rsp), %xmm0
mulsd 0xa3f7(%rip), %xmm0     # 0x361d0
divsd 0x823f(%rip), %xmm0     # 0x34020
callq 0x81a0
movq %rbx, %rdi
callq 0x86b0
movq %rax, %rdi
leaq 0xb494(%rip), %rsi      # 0x3728c
callq 0x8420
testq %r14, %r14
je 0x2be0b
movq (%r14), %rax
movq %r14, %rdi
callq *0x8(%rax)
movq 0x8(%rsp), %rax
movq 0x68(%rax), %rdi
movsd 0x60(%rsp), %xmm0
callq 0x23738
movq %rax, %r14
incq 0x278(%r13)
movq %rax, %rdi
callq 0x23c0c
movq %r14, %rdi
callq 0x2404a
movsd 0x60(%rsp), %xmm0
mulsd 0xa389(%rip), %xmm0     # 0x361d0
divsd 0x81d1(%rip), %xmm0     # 0x34020
callq 0x81a0
movsd %xmm0, 0x198(%rsp)
movl $0x0, 0x3c(%rsp)
movq 0xd0(%rsp), %rax
movl $0x0, 0x1c(%rsp)
movq %r14, 0x28(%rsp)
movq (%rax), %rax
cmpq 0xd0(%rsp), %rax
je 0x2d04c
movq %rax, 0x190(%rsp)
movq 0x10(%rax), %rax
movq %rax, 0xe0(%rsp)
movq 0x78(%rax), %rax
movq %rax, 0x68(%rsp)
xorl %ebx, %ebx
movq 0x68(%rsp), %rax
movslq 0x8(%rax), %rax
decq %rax
cmpq %rax, %rbx
jge 0x2d03b
cmpl $0x0, 0x60(%r13)
jle 0x2bed0
movq 0x10(%rsp), %rdi
callq 0x8320
movq %rbx, 0x20(%rsp)
xorl %r14d, %r14d
movq $0x0, 0x148(%rsp)
xorl %ebp, %ebp
movq 0x28(%rsp), %rax
movslq 0x8(%rax), %rax
leaq -0x1(%rax), %rcx
cmpq %rcx, %rbp
jge 0x2d025
andq $0x0, 0x30(%rsp)
cmpl $0x0, 0x64(%r13)
je 0x2c048
movq 0xe0(%rsp), %rcx
cmpl $0x0, 0x80(%rcx)
je 0x2c048
movq 0x8(%rsp), %rax
movq 0x88(%rax), %rdi
movl %ebp, %esi
movq 0x90(%rsp), %rdx
movl 0x3c(%rsp), %ecx
leaq 0x30(%rsp), %r8
callq 0x20fca
movl %eax, 0x48(%rsp)
cmpl $0x0, 0x48(%rsp)
js 0x2bf66
je 0x2c040
incq 0x2a8(%r13)
xorl %r15d, %r15d
jmp 0x2c262
incq 0x2b0(%r13)
cmpl $0x3, 0x60(%r13)
jl 0x2c617
movq 0x10(%rsp), %rdi
leaq 0xb73b(%rip), %rsi      # 0x376bf
callq 0x8420
movq %rax, %rdi
movl 0x2f0(%rsp), %esi
callq 0x8740
movq %rax, %rdi
leaq 0xba4d(%rip), %rsi      # 0x379ef
callq 0x8420
movq %rax, %rdi
movl %ebp, %esi
callq 0x8740
movq %rax, %rdi
leaq 0xbbb6(%rip), %rsi      # 0x37b71
callq 0x8420
movq %rax, %rdi
movq 0x20(%rsp), %rsi
callq 0x8740
movq %rax, %rdi
leaq 0xb706(%rip), %rsi      # 0x376dd
callq 0x8420
movq %rax, %rdi
movl 0x1c(%rsp), %esi
callq 0x8740
movq %rax, %rdi
leaq 0xa5a0(%rip), %rsi      # 0x36592
callq 0x8420
movq %rax, %rdi
movl 0x3c(%rsp), %esi
callq 0x8740
movq %rax, %rdi
leaq 0x90eb(%rip), %rsi      # 0x350f8
callq 0x8420
movq %rax, %rdi
leaq 0xb70a(%rip), %rsi      # 0x37726
callq 0x8420
movq 0x20(%rsp), %rsi
shlq $0x4, %rsi
movq 0x68(%rsp), %rcx
addq 0x10(%rcx), %rsi
movq %rax, %rdi
callq 0x333fd
jmp 0x2c608
movq 0x28(%rsp), %rax
movl 0x8(%rax), %eax
incq 0x2a0(%r13)
incq 0x280(%r13)
testl %eax, %eax
jne 0x2c0c5
movq 0x20f87(%rip), %rdi     # 0x4cfe8
leaq 0xb682(%rip), %rsi      # 0x376ea
callq 0x8420
movq %rax, %rdi
movq 0x28(%rsp), %rsi
callq 0x8370
movq %rax, %rdi
leaq 0xb66f(%rip), %rsi      # 0x376f3
callq 0x8420
movq %rax, %rdi
movl 0x300(%rsp), %esi
callq 0x8740
movq %rax, %rdi
leaq 0xb674(%rip), %rsi      # 0x37716
callq 0x8420
movq %rax, %rdi
movl 0x2f0(%rsp), %esi
callq 0x8740
movq %rax, %rdi
leaq 0xb1cc(%rip), %rsi      # 0x3728c
callq 0x8420
testq %r14, %r14
je 0x2c0e0
movq 0x28(%rsp), %rax
movq 0x40(%rax), %rax
leaq (%rax,%r14), %rcx
addq $-0x8, %rcx
addq %r14, %rax
jmp 0x2c0f5
movq 0x28(%rsp), %rax
movslq 0x8(%rax), %rcx
movq 0x40(%rax), %rax
leaq (%rax,%rcx,8), %rcx
addq $-0x10, %rcx
movsd (%rcx), %xmm0
addsd 0x7f1f(%rip), %xmm0     # 0x34020
movapd %xmm0, %xmm1
addsd 0xa11b(%rip), %xmm1     # 0x36228
movq 0x20(%rsp), %rsi
testq %rsi, %rsi
je 0x2c12e
movq 0x68(%rsp), %rcx
movq 0x40(%rcx), %rdx
leaq (%rdx,%rsi,8), %rcx
leaq (%rdx,%rsi,8), %rdx
addq $-0x8, %rdx
jmp 0x2c143
movq 0x68(%rsp), %rcx
movslq 0x8(%rcx), %rdx
movq 0x40(%rcx), %rcx
leaq (%rcx,%rdx,8), %rdx
addq $-0x10, %rdx
movsd 0x7ed5(%rip), %xmm3     # 0x34020
movapd %xmm3, %xmm2
cmpltsd %xmm0, %xmm2
andpd %xmm2, %xmm1
andnpd %xmm0, %xmm2
orpd %xmm1, %xmm2
movsd (%rax), %xmm0
movsd %xmm0, 0x48(%rsp)
movsd (%rdx), %xmm0
addsd %xmm3, %xmm0
movapd %xmm0, %xmm1
addsd 0xa0aa(%rip), %xmm1     # 0x36228
cmpltsd %xmm0, %xmm3
andpd %xmm3, %xmm1
andnpd %xmm0, %xmm3
orpd %xmm1, %xmm3
movsd (%rcx), %xmm1
movapd %xmm3, 0x50(%rsp)
movapd %xmm3, %xmm0
movsd %xmm1, 0x98(%rsp)
movapd %xmm2, 0xf0(%rsp)
callq 0x2aa3a
testb %al, %al
je 0x2c436
movapd 0x50(%rsp), %xmm0
movsd 0x98(%rsp), %xmm1
movsd 0x48(%rsp), %xmm2
callq 0x2aa3a
testb %al, %al
je 0x2c436
movapd 0xf0(%rsp), %xmm0
movsd 0x48(%rsp), %xmm1
movapd 0x50(%rsp), %xmm2
callq 0x2aa3a
testb %al, %al
je 0x2c436
movapd 0xf0(%rsp), %xmm0
movsd 0x48(%rsp), %xmm1
movsd 0x98(%rsp), %xmm2
callq 0x2aa3a
testb %al, %al
je 0x2c436
movq 0x20(%rsp), %rsi
shlq $0x4, %rsi
movq 0x68(%rsp), %rax
addq 0x10(%rax), %rsi
movq 0x28(%rsp), %rdi
movl %ebp, %edx
callq 0x235aa
movq %rax, 0x30(%rsp)
incq 0x270(%r13)
movq %rax, %rdi
callq 0x2404a
movl $0x0, 0x48(%rsp)
movb $0x1, %r15b
movq 0x8(%rsp), %rax
movupd (%rax), %xmm0
movapd %xmm0, 0x160(%rsp)
movq 0x68(%rax), %rdi
callq 0x233aa
movapd %xmm0, %xmm2
movapd %xmm1, %xmm5
movq 0x30(%rsp), %rax
movsd 0xb0(%rax), %xmm3
movsd 0xb8(%rax), %xmm4
leaq 0x160(%rsp), %rdi
movsd 0x60(%rsp), %xmm0
movapd %xmm2, %xmm1
movapd %xmm5, %xmm2
callq 0x33062
movq 0x30(%rsp), %r12
leaq 0x258(%rsp), %rdi
movq 0xd0(%rsp), %rsi
callq 0x333a4
movq %r13, %rdi
movq %r12, %rsi
leaq 0x258(%rsp), %rbx
movq %rbx, %rdx
leaq 0x200(%rsp), %rcx
leaq 0x160(%rsp), %r8
movl 0x48(%rsp), %r9d
callq 0x2d770
movl %eax, %r12d
movq %rbx, %rdi
callq 0x33458
testl %r12d, %r12d
je 0x2c520
cmpl $0x3, 0x60(%r13)
jl 0x2c3db
movq 0x10(%rsp), %rdi
leaq 0xb8c0(%rip), %rsi      # 0x37be5
callq 0x8420
movq %rax, %rdi
movl 0x2f0(%rsp), %esi
callq 0x8740
movq %rax, %rdi
leaq 0xb6ac(%rip), %rsi      # 0x379ef
callq 0x8420
movq %rax, %rdi
movl %ebp, %esi
callq 0x8740
movq %rax, %rdi
leaq 0xb815(%rip), %rsi      # 0x37b71
callq 0x8420
movq %rax, %rdi
movq 0x20(%rsp), %rsi
callq 0x8740
movq %rax, %rdi
leaq 0xb365(%rip), %rsi      # 0x376dd
callq 0x8420
movq %rax, %rdi
movl 0x1c(%rsp), %esi
callq 0x8740
movq %rax, %rdi
leaq 0xb392(%rip), %rsi      # 0x37725
callq 0x8420
movq 0x20(%rsp), %rsi
shlq $0x4, %rsi
movq 0x68(%rsp), %rcx
addq 0x10(%rcx), %rsi
movq %rax, %rdi
callq 0x333fd
movq %rax, %rdi
leaq 0xb38f(%rip), %rsi      # 0x3774b
callq 0x8420
movq %rax, %rdi
movl %r12d, %esi
callq 0x8740
movq %rax, %rdi
leaq 0xaeb6(%rip), %rsi      # 0x3728c
callq 0x8420
testb $0x10, %r12b
je 0x2c57a
movq 0xe0(%rsp), %rax
cmpl $0x0, 0x80(%rax)
je 0x2c57a
cmpl $0x0, 0x64(%r13)
je 0x2c423
movq 0x8(%rsp), %rax
movq 0x88(%rax), %rdi
movl %ebp, %esi
movq 0x90(%rsp), %rdx
movl 0x3c(%rsp), %ecx
xorl %r8d, %r8d
callq 0x21022
movq 0x30(%rsp), %rdi
testq %rdi, %rdi
jne 0x2c58e
jmp 0x2c594
cmpl $0x0, 0x64(%r13)
je 0x2c470
movq 0xe0(%rsp), %rax
cmpl $0x0, 0x80(%rax)
je 0x2c470
movq 0x8(%rsp), %rax
movq 0x88(%rax), %rdi
movl %ebp, %esi
movq 0x90(%rsp), %rdx
movl 0x3c(%rsp), %ecx
xorl %r8d, %r8d
callq 0x21022
cmpl $0x3, 0x60(%r13)
jl 0x2c617
movq 0x10(%rsp), %rdi
leaq 0xb75e(%rip), %rsi      # 0x37be5
callq 0x8420
movq %rax, %rdi
movl 0x2f0(%rsp), %esi
callq 0x8740
movq %rax, %rdi
leaq 0xb54a(%rip), %rsi      # 0x379ef
callq 0x8420
movq %rax, %rdi
movl %ebp, %esi
callq 0x8740
movq %rax, %rdi
leaq 0xb6b3(%rip), %rsi      # 0x37b71
callq 0x8420
movq %rax, %rdi
movq 0x20(%rsp), %rsi
callq 0x8740
movq %rax, %rdi
leaq 0xb203(%rip), %rsi      # 0x376dd
callq 0x8420
movq %rax, %rdi
movl 0x1c(%rsp), %esi
callq 0x8740
movq %rax, %rdi
leaq 0xb230(%rip), %rsi      # 0x37725
callq 0x8420
movq 0x20(%rsp), %rsi
shlq $0x4, %rsi
movq 0x68(%rsp), %rcx
addq 0x10(%rcx), %rsi
movq %rax, %rdi
callq 0x333fd
leaq 0xb217(%rip), %rsi      # 0x37732
jmp 0x2c60f
movq 0xe0(%rsp), %rax
cmpl $0x0, 0x80(%rax)
sete %al
xorb $0x1, %r15b
orb %al, %r15b
jne 0x2c634
cmpl $0x0, 0x64(%r13)
je 0x2c62c
movq 0x8(%rsp), %rax
movq 0x88(%rax), %rdi
movq 0x30(%rsp), %r8
movl %ebp, %esi
movq 0x90(%rsp), %rdx
movl 0x3c(%rsp), %ecx
callq 0x21022
pushq $0x1
popq %rax
movl %eax, 0x48(%rsp)
jmp 0x2c634
movq 0x30(%rsp), %rdi
testq %rdi, %rdi
setne %al
andb %al, %r15b
cmpb $0x1, %r15b
jne 0x2c59a
movq (%rdi), %rax
callq *0x8(%rax)
andq $0x0, 0x30(%rsp)
incq 0x298(%r13)
movq 0x28(%rsp), %rax
cmpl $0x0, 0x8(%rax)
jne 0x2c617
movq 0x20a35(%rip), %rdi     # 0x4cfe8
leaq 0xb130(%rip), %rsi      # 0x376ea
callq 0x8420
movq %rax, %rdi
movq 0x28(%rsp), %rsi
callq 0x8370
movq %rax, %rdi
leaq 0xb11d(%rip), %rsi      # 0x376f3
callq 0x8420
movq %rax, %rdi
movl 0x300(%rsp), %esi
callq 0x8740
movq %rax, %rdi
leaq 0xb122(%rip), %rsi      # 0x37716
callq 0x8420
movq %rax, %rdi
movl 0x2f0(%rsp), %esi
callq 0x8740
leaq 0xac7d(%rip), %rsi      # 0x3728c
movq %rax, %rdi
callq 0x8420
incq %rbp
addq $0x10, 0x148(%rsp)
addq $0x8, %r14
jmp 0x2bee6
movl $0x0, 0x48(%rsp)
movq 0x30(%rsp), %rsi
addq $0x10, %rsi
leaq 0x100(%rsp), %rbx
movq %rbx, %rdi
callq 0x21456
leaq 0x240(%rsp), %r15
movq %r15, %rdi
leaq 0xa0(%rsp), %rsi
movq %rbx, %rdx
callq 0x212e4
movq %rbx, %rdi
callq 0x2150c
movq %r15, %rdi
callq 0x2135d
movsd %xmm0, 0x98(%rsp)
movq %rbx, %rdi
leaq 0xa0(%rsp), %rsi
callq 0x213d3
movsd 0x110(%rsp), %xmm0
movsd 0x118(%rsp), %xmm1
subsd 0x100(%rsp), %xmm0
subsd 0x108(%rsp), %xmm1
mulsd %xmm0, %xmm1
andpd 0x996f(%rip), %xmm1     # 0x36030
mulsd 0x38(%r13), %xmm1
addsd 0x98(%rsp), %xmm1
movapd %xmm1, 0x50(%rsp)
movsd %xmm1, 0xe8(%rsp)
cmpl $0x2, 0x60(%r13)
jl 0x2c7ae
movq 0x10(%rsp), %rdi
leaq 0xb231(%rip), %rsi      # 0x37927
callq 0x8420
movq %rax, %rdi
movl %ebp, %esi
callq 0x8740
movq %rax, %rdi
leaq 0xb046(%rip), %rsi      # 0x37755
callq 0x8420
movq %rax, %rdi
movq 0x20(%rsp), %rsi
callq 0x8740
movq %rax, %rdi
leaq 0xb02f(%rip), %rsi      # 0x3775a
callq 0x8420
movq %rax, %rdi
movl 0x1c(%rsp), %esi
callq 0x8740
movq %rax, %rdi
leaq 0xb021(%rip), %rsi      # 0x37767
callq 0x8420
movq %rax, %rdi
movsd 0x98(%rsp), %xmm0
callq 0x86b0
movq %rax, %rdi
leaq 0xb00d(%rip), %rsi      # 0x37773
callq 0x8420
movq %rax, %rdi
movapd 0x50(%rsp), %xmm0
callq 0x86b0
movq %rax, %rdi
leaq 0xaff7(%rip), %rsi      # 0x3777a
callq 0x8420
movapd 0x50(%rsp), %xmm0
subsd 0xc8(%rsp), %xmm0
movq %rax, %rdi
callq 0x86b0
movq %rax, %rdi
leaq 0xaae3(%rip), %rsi      # 0x3728c
callq 0x8420
leaq 0x128(%rsp), %rdi
movq 0x70(%rsp), %rsi
callq 0x333a4
leaq 0x1e8(%rsp), %rbx
movq %rbx, %rdi
movq 0xd0(%rsp), %rsi
callq 0x333a4
movq %rbx, %rdi
leaq 0x8(%rsp), %rsi
callq 0x3314c
movq 0x8(%rsp), %rax
movq 0x78(%rax), %rdi
testq %rdi, %rdi
je 0x2c7fe
movq (%rdi), %rax
callq *0x8(%rax)
movq 0x8(%rsp), %rax
movq 0x70(%rax), %rdi
testq %rdi, %rdi
je 0x2c812
movq (%rdi), %rax
callq *0x8(%rax)
movq 0x8(%rsp), %rax
movq 0x30(%rsp), %rcx
movups 0xb0(%rcx), %xmm0
movaps %xmm0, 0x1d0(%rsp)
movq 0x68(%rax), %rdi
movsd 0x60(%rsp), %xmm0
leaq 0x1d0(%rsp), %rsi
callq 0x2399a
movq 0x8(%rsp), %rcx
movq %rax, 0x78(%rcx)
movq %rax, %rdi
callq 0x23c0c
movq 0x8(%rsp), %rax
movq 0x78(%rax), %rdi
callq 0x2404a
movq 0x8(%rsp), %rax
movq 0x68(%rax), %rdi
callq 0x22296
movsd %xmm0, 0xf0(%rsp)
movq 0x8(%rsp), %rax
movq 0x78(%rax), %rsi
addq $0x10, %rsi
leaq 0x288(%rsp), %rbx
movq %rbx, %rdi
callq 0x21456
leaq 0x1b0(%rsp), %r15
movq %r15, %rdi
leaq 0xa0(%rsp), %rsi
movq %rbx, %rdx
callq 0x212e4
leaq 0x170(%rsp), %rdi
movq %r15, %rsi
callq 0x24bf4
movq %r15, %rdi
callq 0x2150c
movq %rbx, %rdi
callq 0x2150c
movl $0xc0, %edi
callq 0x8440
movq %rax, %r12
movq %rax, %rdi
leaq 0x170(%rsp), %rsi
callq 0x21f86
movq 0x8(%rsp), %rax
movq %r12, 0x70(%rax)
movq %r12, %rdi
callq 0x2328a
cmpl $0x2, 0x60(%r13)
movq 0x128(%rsp), %rax
jl 0x2ca39
leaq 0x128(%rsp), %rcx
cmpq %rcx, %rax
je 0x2c9ad
movapd 0x50(%rsp), %xmm0
ucomisd 0x88(%rsp), %xmm0
jb 0x2c9ad
movq 0x10(%rsp), %rdi
leaq 0x86ba(%rip), %rsi      # 0x34ff4
callq 0x8420
movq %rax, %rdi
movl 0x300(%rsp), %esi
callq 0x8740
movq %rax, %rdi
leaq 0xae30(%rip), %rsi      # 0x37788
callq 0x8420
movq %rax, %rdi
movapd 0x50(%rsp), %xmm0
callq 0x86b0
movq %rax, %rdi
leaq 0xae23(%rip), %rsi      # 0x37798
callq 0x8420
movq %rax, %rdi
movsd 0x88(%rsp), %xmm0
callq 0x86b0
movq %rax, %rdi
leaq 0xae25(%rip), %rsi      # 0x377ba
callq 0x8420
movq 0x128(%rsp), %rax
cmpl $0x2, 0x60(%r13)
jl 0x2ca39
leaq 0x128(%rsp), %rcx
cmpq %rcx, %rax
je 0x2ca39
movapd 0x50(%rsp), %xmm0
ucomisd 0x40(%rsp), %xmm0
jb 0x2ca39
movq 0x10(%rsp), %rdi
leaq 0x8620(%rip), %rsi      # 0x34ff4
callq 0x8420
movq %rax, %rdi
movl 0x300(%rsp), %esi
callq 0x8740
movq %rax, %rdi
leaq 0xad96(%rip), %rsi      # 0x37788
callq 0x8420
movq %rax, %rdi
movapd 0x50(%rsp), %xmm0
callq 0x86b0
movq %rax, %rdi
leaq 0xadd8(%rip), %rsi      # 0x377e7
callq 0x8420
movq %rax, %rdi
movsd 0x40(%rsp), %xmm0
callq 0x86b0
movq %rax, %rdi
leaq 0xad8e(%rip), %rsi      # 0x377ba
callq 0x8420
movq 0x128(%rsp), %rax
leaq 0x128(%rsp), %rcx
cmpq %rcx, %rax
je 0x2cd1c
movsd 0x88(%rsp), %xmm0
ucomisd 0x50(%rsp), %xmm0
jb 0x2cd1c
movsd 0x40(%rsp), %xmm0
ucomisd 0x50(%rsp), %xmm0
jb 0x2cd1c
movsd 0xf0(%rsp), %xmm0
addsd 0xd8(%rsp), %xmm0
movsd %xmm0, 0xf0(%rsp)
cmpl $0x2, 0x60(%r13)
jl 0x2cbb2
movq 0x10(%rsp), %rdi
leaq 0xad68(%rip), %rsi      # 0x3780b
callq 0x8420
movq %rax, %rdi
leaq 0x1d0(%rsp), %rsi
callq 0x333fd
movq %rax, %rdi
leaq 0xaf14(%rip), %rsi      # 0x379d6
callq 0x8420
movq %rax, %rdi
movl 0x2f0(%rsp), %esi
callq 0x8740
movq %rax, %rdi
leaq 0xa7ac(%rip), %rsi      # 0x3728c
callq 0x8420
movq 0x10(%rsp), %rdi
leaq 0xad3c(%rip), %rsi      # 0x3782d
callq 0x8420
movq 0xa8(%rsp), %rsi
subq 0xa0(%rsp), %rsi
sarq $0x4, %rsi
movq %rax, %rdi
callq 0x8310
movq %rax, %rdi
leaq 0xad22(%rip), %rsi      # 0x3783e
callq 0x8420
movq %rax, %r12
leaq 0xa0(%rsp), %rdi
callq 0x2135d
movq %r12, %rdi
callq 0x86b0
movq %rax, %rdi
leaq 0xad0c(%rip), %rsi      # 0x3784f
callq 0x8420
movq %rax, %rdi
movsd 0xf0(%rsp), %xmm0
callq 0x86b0
movq %rax, %rdi
leaq 0xa729(%rip), %rsi      # 0x3728c
callq 0x8420
movq 0x10(%rsp), %rdi
leaq 0xacf0(%rip), %rsi      # 0x37864
callq 0x8420
movq %rax, %r12
movq 0x8(%rsp), %rax
movq 0x70(%rax), %rdi
callq 0x22296
movq %r12, %rdi
callq 0x86b0
movq %rax, %rdi
leaq 0xa6f0(%rip), %rsi      # 0x3728c
callq 0x8420
movq 0x10(%rsp), %rdi
leaq 0xacd0(%rip), %rsi      # 0x3787d
callq 0x8420
leaq 0x1b0(%rsp), %rdi
leaq 0xa0(%rsp), %rsi
callq 0x213d3
movupd 0x1b0(%rsp), %xmm0
movupd 0x1c0(%rsp), %xmm1
movapd %xmm1, 0x210(%rsp)
movapd %xmm0, 0x200(%rsp)
movq 0x8(%rsp), %rax
movq 0x70(%rax), %r12
leaq 0x228(%rsp), %rdi
leaq 0x1e8(%rsp), %rsi
callq 0x333a4
leaq 0x270(%rsp), %r15
movq %r15, %rdi
leaq 0x128(%rsp), %rsi
callq 0x333a4
subq $0x8, %rsp
movq %r13, %rdi
movq %r12, %rsi
leaq 0x230(%rsp), %rbx
movq %rbx, %rdx
movq %r15, %rcx
movl 0x80(%rsp), %r8d
movsd 0x148(%rsp), %xmm0
movsd 0xf8(%rsp), %xmm1
leaq 0xf0(%rsp), %r9
movsd 0x48(%rsp), %xmm2
pushq 0x1a8(%rsp)
movl 0x308(%rsp), %eax
pushq %rax
pushq 0x1c0(%rsp)
callq 0x2b93e
addq $0x20, %rsp
movq %rax, %r12
movq %r15, %rdi
callq 0x33458
movq %rbx, %rdi
callq 0x33458
testq %r12, %r12
jne 0x2ccaf
movsd 0x40(%rsp), %xmm0
addsd 0x7372(%rip), %xmm0     # 0x34018
movsd %xmm0, 0xe8(%rsp)
cmpl $0x1, 0x60(%r13)
jle 0x2cd0d
movq 0x10(%rsp), %rdi
leaq 0xabe0(%rip), %rsi      # 0x378a2
callq 0x8420
movq %rax, %rdi
movl 0x300(%rsp), %esi
callq 0x8740
movq %rax, %rdi
leaq 0xabde(%rip), %rsi      # 0x378be
callq 0x8420
movsd 0xe8(%rsp), %xmm0
movq %rax, %rdi
movapd %xmm0, 0x50(%rsp)
callq 0x86b0
movq %rax, %rdi
leaq 0xa586(%rip), %rsi      # 0x3728c
callq 0x8420
jmp 0x2cd1c
movsd 0xe8(%rsp), %xmm0
movapd %xmm0, 0x50(%rsp)
movsd 0x40(%rsp), %xmm0
movapd 0x50(%rsp), %xmm1
ucomisd %xmm1, %xmm0
jbe 0x2cf68
movsd 0xc8(%rsp), %xmm0
ucomisd %xmm1, %xmm0
jbe 0x2cd54
movq 0x202a0(%rip), %rdi     # 0x4cfe8
leaq 0xab7b(%rip), %rsi      # 0x378ca
callq 0x8420
movq 0x30(%rsp), %rax
movupd 0xb0(%rax), %xmm0
movapd %xmm0, 0x150(%rsp)
cmpl $0x1, 0x60(%r13)
jle 0x2cf32
movq 0x10(%rsp), %rdi
leaq 0x8273(%rip), %rsi      # 0x34ff4
callq 0x8420
movq %rax, %rdi
movl 0x300(%rsp), %esi
callq 0x8740
movq %rax, %rdi
leaq 0xab62(%rip), %rsi      # 0x37901
callq 0x8420
movq %rax, %rdi
movl 0x2f0(%rsp), %esi
callq 0x8740
movq %rax, %rdi
leaq 0xa4cf(%rip), %rsi      # 0x3728c
callq 0x8420
movq 0x10(%rsp), %rdi
leaq 0xab55(%rip), %rsi      # 0x37923
callq 0x8420
movq %rax, %rdi
movl %ebp, %esi
callq 0x8740
movq %rax, %rdi
leaq 0xad8a(%rip), %rsi      # 0x37b71
callq 0x8420
movq %rax, %rdi
movq 0x20(%rsp), %rsi
callq 0x8740
movq %rax, %rdi
leaq 0xa957(%rip), %rsi      # 0x3775a
callq 0x8420
movq %rax, %rdi
movl 0x1c(%rsp), %esi
callq 0x8740
movq %rax, %rdi
leaq 0xa46e(%rip), %rsi      # 0x3728c
callq 0x8420
movq 0x10(%rsp), %rdi
leaq 0xab02(%rip), %rsi      # 0x37931
callq 0x8420
movq %rax, %rdi
movsd 0x198(%rsp), %xmm0
callq 0x86b0
movq %rax, %rdi
leaq 0xaaf2(%rip), %rsi      # 0x37941
callq 0x8420
movq %rax, %rdi
leaq 0x150(%rsp), %rsi
callq 0x333fd
movq %rax, %rdi
leaq 0xaae1(%rip), %rsi      # 0x3794f
callq 0x8420
movq 0x28(%rsp), %rcx
movq 0x10(%rcx), %rsi
addq 0x148(%rsp), %rsi
movq %rax, %rdi
callq 0x333fd
movq %rax, %rdi
leaq 0xa42a(%rip), %rsi      # 0x372c0
callq 0x8420
movq 0x20(%rsp), %rsi
shlq $0x4, %rsi
movq 0x68(%rsp), %rcx
addq 0x10(%rcx), %rsi
movq %rax, %rdi
callq 0x333fd
movq %rax, %rdi
leaq 0xa3cd(%rip), %rsi      # 0x3728c
callq 0x8420
movq 0x10(%rsp), %rdi
leaq 0xaa86(%rip), %rsi      # 0x37956
callq 0x8420
movq %rax, %rdi
movsd 0x98(%rsp), %xmm0
callq 0x86b0
movq %rax, %rdi
leaq 0xaa77(%rip), %rsi      # 0x37967
callq 0x8420
movq %rax, %rdi
movapd 0x50(%rsp), %xmm0
callq 0x86b0
movq %rax, %rdi
leaq 0xaa62(%rip), %rsi      # 0x3796f
callq 0x8420
movq %rax, %rdi
movsd 0xc8(%rsp), %xmm0
callq 0x86b0
movq %rax, %rdi
leaq 0xa35f(%rip), %rsi      # 0x3728c
callq 0x8420
movsd 0x60(%rsp), %xmm0
movsd %xmm0, 0xc0(%rsp)
movl 0x1c(%rsp), %eax
movl %eax, 0x84(%rsp)
movl %ebp, 0x7c(%rsp)
movq 0x20(%rsp), %rax
movl %eax, 0x80(%rsp)
movapd 0x50(%rsp), %xmm0
movsd %xmm0, 0x40(%rsp)
cmpl $0x0, 0x48(%rsp)
jne 0x2cff9
movq 0x30(%rsp), %rdi
testq %rdi, %rdi
je 0x2cf83
movq (%rdi), %rax
callq *0x8(%rax)
movq 0x28(%rsp), %rax
cmpl $0x0, 0x8(%rax)
jne 0x2cff9
movq 0x20053(%rip), %rdi     # 0x4cfe8
leaq 0xa74e(%rip), %rsi      # 0x376ea
callq 0x8420
movq %rax, %rdi
movq 0x28(%rsp), %rsi
callq 0x8370
movq %rax, %rdi
leaq 0xa73b(%rip), %rsi      # 0x376f3
callq 0x8420
movq %rax, %rdi
movl 0x300(%rsp), %esi
callq 0x8740
movq %rax, %rdi
leaq 0xa740(%rip), %rsi      # 0x37716
callq 0x8420
movq %rax, %rdi
movl 0x2f0(%rsp), %esi
callq 0x8740
movq %rax, %rdi
leaq 0xa298(%rip), %rsi      # 0x3728c
callq 0x8420
leaq 0x1e8(%rsp), %rdi
callq 0x33458
leaq 0x128(%rsp), %rdi
callq 0x33458
leaq 0x240(%rsp), %rdi
callq 0x2150c
jmp 0x2c617
incl 0x3c(%rsp)
movq 0x20(%rsp), %rbx
incq %rbx
movq 0x28(%rsp), %r14
jmp 0x2beaa
incl 0x1c(%rsp)
movq 0x190(%rsp), %rax
jmp 0x2be7a
movsd 0x60(%rsp), %xmm0
addsd 0x140(%rsp), %xmm0
movq 0x90(%rsp), %rax
incl %eax
movq %rax, 0x90(%rsp)
jmp 0x2bd7a
cmpl $0x0, 0x8(%r14)
jne 0x2d0e2
movq 0x1ff68(%rip), %rdi     # 0x4cfe8
leaq 0xa663(%rip), %rsi      # 0x376ea
callq 0x8420
movq %rax, %rdi
movq %r14, %rsi
callq 0x8370
leaq 0xa655(%rip), %rsi      # 0x376f3
movq %rax, %rdi
callq 0x8420
movq %rax, %rdi
movl 0x300(%rsp), %esi
callq 0x8740
leaq 0xa65a(%rip), %rsi      # 0x37716
movq %rax, %rdi
callq 0x8420
movq %rax, %rdi
movl 0x2f0(%rsp), %esi
callq 0x8740
leaq 0xa1b2(%rip), %rsi      # 0x3728c
movq %rax, %rdi
callq 0x8420
movq (%r14), %rax
movq %r14, %rdi
callq *0x8(%rax)
xorpd %xmm0, %xmm0
ucomisd 0xc0(%rsp), %xmm0
jbe 0x2d116
movabsq $0x4a511b0ec57e649a, %rax # imm = 0x4A511B0EC57E649A
movq 0xb8(%rsp), %rcx
movq %rax, (%rcx)
xorl %ebx, %ebx
jmp 0x2d5e7
movsd 0x40(%rsp), %xmm0
ucomisd 0x88(%rsp), %xmm0
jbe 0x2d192
movq 0xb8(%rsp), %rax
movsd %xmm0, (%rax)
cmpl $0x2, 0x60(%r13)
jl 0x2d5e2
leaq 0xa839(%rip), %rsi      # 0x3797e
movq 0x10(%rsp), %rdi
callq 0x8420
movq %rax, %rdi
movl 0x300(%rsp), %esi
callq 0x8740
leaq 0xa820(%rip), %rsi      # 0x37985
movq %rax, %rdi
callq 0x8420
movq %rax, %rdi
movsd 0x88(%rsp), %xmm0
callq 0x86b0
leaq 0xa816(%rip), %rsi      # 0x3799b
movq %rax, %rdi
callq 0x8420
jmp 0x2d5e2
movq 0x8(%rsp), %rax
movq 0x78(%rax), %rdi
testq %rdi, %rdi
je 0x2d1ab
movq (%rdi), %rax
callq *0x8(%rax)
movq 0x8(%rsp), %rax
movq 0x70(%rax), %rdi
testq %rdi, %rdi
je 0x2d1bf
movq (%rdi), %rax
callq *0x8(%rax)
movq 0x8(%rsp), %rax
movq 0x68(%rax), %rdi
leaq 0x150(%rsp), %rsi
movsd 0xc0(%rsp), %xmm0
callq 0x2399a
movq 0x8(%rsp), %rcx
movq %rax, 0x78(%rcx)
movq %rax, %rdi
callq 0x23c0c
movq 0x8(%rsp), %rax
movq 0x78(%rax), %rdi
callq 0x2404a
movq 0x8(%rsp), %rax
movq 0x78(%rax), %rdi
callq 0x22296
movsd %xmm0, 0x28(%rsp)
movq 0x8(%rsp), %rax
movq 0x78(%rax), %rsi
addq $0x10, %rsi
leaq 0x1b0(%rsp), %rdi
callq 0x21456
leaq 0x100(%rsp), %rdi
leaq 0xa0(%rsp), %rsi
leaq 0x1b0(%rsp), %rdx
callq 0x212e4
leaq 0xa0(%rsp), %rdi
leaq 0x100(%rsp), %rbx
movq %rbx, %rsi
callq 0x24bf4
movq %rbx, %rdi
callq 0x2150c
leaq 0x1b0(%rsp), %rdi
callq 0x2150c
movl $0xc0, %edi
callq 0x8440
movq %rax, %r14
leaq 0xa0(%rsp), %rsi
movq %rax, %rdi
callq 0x21f86
movq 0x8(%rsp), %rax
movq %r14, 0x70(%rax)
movq %r14, %rdi
callq 0x2328a
movq 0x8(%rsp), %rax
movq 0x70(%rax), %rdi
callq 0x233aa
movq 0xb8(%rsp), %rax
movsd 0x40(%rsp), %xmm0
movsd %xmm0, (%rax)
cmpl $0x0, 0x60(%r13)
jle 0x2d5e2
leaq 0xa6ae(%rip), %rsi      # 0x3797e
movq 0x10(%rsp), %rdi
callq 0x8420
movq %rax, %rdi
movl 0x300(%rsp), %esi
callq 0x8740
leaq 0xa6ca(%rip), %rsi      # 0x379ba
movq %rax, %rdi
callq 0x8420
leaq 0x150(%rsp), %rsi
movq %rax, %rdi
callq 0x333fd
leaq 0xa6c3(%rip), %rsi      # 0x379d2
movq %rax, %rdi
callq 0x8420
movq %rax, %rbx
movsd 0xc0(%rsp), %xmm0
mulsd 0x8ea5(%rip), %xmm0     # 0x361d0
divsd 0x6ced(%rip), %xmm0     # 0x34020
callq 0x81a0
movq %rbx, %rdi
callq 0x86b0
leaq 0xa68d(%rip), %rsi      # 0x379d4
movq %rax, %rdi
callq 0x8420
movq %rax, %rdi
movl 0x2f0(%rsp), %esi
callq 0x8740
leaq 0x922d(%rip), %rsi      # 0x36592
movq %rax, %rdi
callq 0x8420
movl $0x90, %esi
addq 0x8(%rsp), %rsi
movq %rax, %rdi
callq 0x8420
leaq 0xa65d(%rip), %rsi      # 0x379e3
movq %rax, %rdi
callq 0x8420
movq %rax, %rdi
movl 0x7c(%rsp), %esi
callq 0x8740
leaq 0xa7d0(%rip), %rsi      # 0x37b71
movq %rax, %rdi
callq 0x8420
movq %rax, %rdi
movl 0x80(%rsp), %esi
callq 0x8740
leaq 0xa39b(%rip), %rsi      # 0x3775a
movq %rax, %rdi
callq 0x8420
movq %rax, %rdi
movl 0x84(%rsp), %esi
callq 0x8740
leaq 0x9eaf(%rip), %rsi      # 0x3728c
movq %rax, %rdi
callq 0x8420
leaq 0xa441(%rip), %rsi      # 0x3782d
movq 0x10(%rsp), %rdi
callq 0x8420
movq 0xa8(%rsp), %rsi
subq 0xa0(%rsp), %rsi
sarq $0x4, %rsi
movq %rax, %rdi
callq 0x8310
leaq 0xa425(%rip), %rsi      # 0x3783e
movq %rax, %rdi
callq 0x8420
movq %rax, %rbx
leaq 0xa0(%rsp), %rdi
callq 0x2135d
movq %rbx, %rdi
callq 0x86b0
leaq 0xa40f(%rip), %rsi      # 0x3784f
movq %rax, %rdi
callq 0x8420
movsd 0x28(%rsp), %xmm0
addsd 0xd8(%rsp), %xmm0
movq %rax, %rdi
callq 0x86b0
leaq 0x9e26(%rip), %rsi      # 0x3728c
movq %rax, %rdi
callq 0x8420
leaq 0xa3ef(%rip), %rsi      # 0x37864
movq 0x10(%rsp), %rdi
callq 0x8420
movq %rax, %rbx
movq 0x8(%rsp), %rax
movq 0x70(%rax), %rdi
callq 0x22296
movq %rbx, %rdi
callq 0x86b0
leaq 0xa559(%rip), %rsi      # 0x379f8
movq %rax, %rdi
callq 0x8420
movq 0xb8(%rsp), %rcx
movsd (%rcx), %xmm0
movq %rax, %rdi
callq 0x86b0
leaq 0x9dca(%rip), %rsi      # 0x3728c
movq %rax, %rdi
callq 0x8420
leaq 0xa52f(%rip), %rsi      # 0x37a00
movq 0x10(%rsp), %rdi
callq 0x8420
movq 0x70(%rsp), %rcx
movq 0x10(%rcx), %rsi
movq %rax, %rdi
callq 0x8310
leaq 0x9d99(%rip), %rsi      # 0x3728c
movq %rax, %rdi
callq 0x8420
pushq $0x1
popq %rbx
leaq 0xa52e(%rip), %rbp      # 0x37a33
leaq 0x9d80(%rip), %r14      # 0x3728c
movq 0x70(%rsp), %r12
movq (%r12), %r12
cmpq 0x70(%rsp), %r12
je 0x2d5e2
movq 0x10(%r12), %r13
movq 0x10(%rsp), %rdi
leaq 0xa4e3(%rip), %rsi      # 0x37a14
callq 0x8420
movq %rax, %rdi
movl %ebx, %esi
callq 0x8740
movq %rax, %rdi
leaq 0xa4d4(%rip), %rsi      # 0x37a1e
callq 0x8420
movq 0x78(%r13), %rcx
movupd 0xb0(%rcx), %xmm0
movapd %xmm0, 0x100(%rsp)
movq %rax, %rdi
leaq 0x100(%rsp), %rsi
callq 0x333fd
movq %rax, %rdi
leaq 0xa4af(%rip), %rsi      # 0x37a2d
callq 0x8420
movq %rax, %r15
movq 0x78(%r13), %rax
movsd 0xa8(%rax), %xmm0
mulsd 0x8c36(%rip), %xmm0     # 0x361d0
divsd 0x6a7e(%rip), %xmm0     # 0x34020
callq 0x81a0
movq %r15, %rdi
callq 0x86b0
movq 0x10(%rsp), %rdi
movq %rbp, %rsi
callq 0x8420
movq %rax, %r15
movq 0x70(%r13), %rdi
callq 0x22296
movq %r15, %rdi
callq 0x86b0
movq %rax, %rdi
movq %r14, %rsi
callq 0x8420
incl %ebx
jmp 0x2d511
movq 0x8(%rsp), %rbx
leaq 0x170(%rsp), %rdi
callq 0x2150c
leaq 0xa0(%rsp), %rdi
callq 0x2150c
movq %rbx, %rax
addq $0x2b8, %rsp            # imm = 0x2B8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movl $0xc0, %esi
jmp 0x2d63b
movq %rax, %rbx
leaq 0x1b0(%rsp), %rdi
jmp 0x2d727
jmp 0x2d72e
movq %rax, %rbx
pushq $0x38
popq %rsi
movq %r14, %rdi
callq 0x8450
jmp 0x2d731
jmp 0x2d72e
jmp 0x2d72e
jmp 0x2d72e
jmp 0x2d72e
jmp 0x2d72e
jmp 0x2d72e
jmp 0x2d72e
jmp 0x2d72e
jmp 0x2d72e
jmp 0x2d72e
jmp 0x2d72e
movq %rax, %rbx
leaq 0x270(%rsp), %rdi
callq 0x33458
jmp 0x2d694
movq %rax, %rbx
leaq 0x228(%rsp), %rdi
callq 0x33458
jmp 0x2d705
jmp 0x2d702
jmp 0x2d6fd
movq %rax, %rbx
movl $0xc0, %esi
movq %r12, %rdi
callq 0x8450
jmp 0x2d705
movq %rax, %rbx
leaq 0x288(%rsp), %rdi
callq 0x2150c
jmp 0x2d705
jmp 0x2d702
jmp 0x2d6fd
jmp 0x2d6fd
movq %rax, %rbx
leaq 0x100(%rsp), %rdi
jmp 0x2d727
jmp 0x2d702
movq %rax, %rbx
jmp 0x2d712
jmp 0x2d72e
jmp 0x2d702
movq %rax, %rbx
leaq 0x258(%rsp), %rdi
callq 0x33458
jmp 0x2d731
jmp 0x2d702
movq %rax, %rbx
jmp 0x2d71f
movq %rax, %rbx
leaq 0x1e8(%rsp), %rdi
callq 0x33458
leaq 0x128(%rsp), %rdi
callq 0x33458
leaq 0x240(%rsp), %rdi
callq 0x2150c
jmp 0x2d731
movq %rax, %rbx
leaq 0x170(%rsp), %rdi
callq 0x2150c
leaq 0xa0(%rsp), %rdi
callq 0x2150c
movq %rbx, %rdi
callq 0x8770
nop