// File: thierry7100[P]CutOptim/src/SvgDoc.cpp
// Function: SvgDoc::Optimize(double, int, int, int)
double SvgDoc::Optimize(double StepAngle, int OptimizingLevel, int FirstPos, int Flag_file)
{
std::list<NSVGpath *> FloatingPaths = listPath;          //  All path are floating
std::list<NSVGpath *> FixedPath;
std::list<NSVGpath *> CurFloating;
Polygon *FixedPolyHull;
double BestCost = 1e100;
clock_t StartOptimize;
clock_t StartLevel;
clock_t LastLevel;
int NotPlaced = 0;
int num_rot = int((2*M_PI-0.001) / StepAngle) + 1;

    LastLevel = StartOptimize = clock();
    if ( debug_level > 0 )
    {
        OutDebug << "Time: " << fixed <<  ((double) 1000.0*(StartOptimize - StartClock))/CLOCKS_PER_SEC << "ms Enter Optimize with Optimizing level set to " << OptimizingLevel << endl;
    }
    //  First remove largest polygon from floating list
    NSVGpath *First = FloatingPaths.front();
    FloatingPaths.pop_front();
    //  Place first polygon, specific algorithm
    if ( debug_level > 0 )
    {
        OutDebug << "-----   Placing first polygon (" << First->id << ") -----------\n";
    }
    First->PlacedPolygon = PlaceFirst(First->LargePolygon, FirstPos, StepAngle);
    //  Check placement OK ! Should stay in the sheet.
    if ( First->PlacedPolygon == NULL )
    {
        cerr << "Unable to place first polygon, too large for sheet\n";
        if ( debug_level > 0 )
        {
            OutDebug << "Optimize : Unable to place first polygon, too large for sheet\n";
        }
        if ( Flag_file )
        {
            cout << "Unable to complete optimization, Unable to place first polygon, too large for sheet\n";
        }
        return 0;
    }
    //  Compute slopes of all edges of first polygon
    //  Should be done after polygon is placed because rotation change angles
    First->PlacedPolygon->ComputeAngles();
    First->PlacedPolygon->CalcSegments();
    First->isFixed = true;                                  //  OK Now !
    double FixedArea = First->PlacedPolygon->area();

    FixedPolyHull = First->LargeConvexHull = First->PlacedPolygon->ConvexHull();
    FixedPath.push_back(First);
    int idxPoly = 1;
    while ( !FloatingPaths.empty() )
    {
        StartLevel = clock();
        if ( debug_level > 0 )
        {
            OutDebug << "--------------------   Placing Polygon " << idxPoly << ": " << FloatingPaths.front()->id << "  ------------------------------\n";
            OutDebug << "Elapsed time " << ((double)1000.0*(StartLevel - StartOptimize))/CLOCKS_PER_SEC;
            OutDebug << "ms, for last polygon " << ((double)1000.0*(StartLevel - LastLevel))/CLOCKS_PER_SEC << "ms\n";
        }
        LastLevel = StartLevel;
        //  Prepare a list with at most OptimizingLevel elements which is a copy of the OptimizingLevel first elements
        int index = 0;
        for (std::list<NSVGpath *>::iterator it=FloatingPaths.begin(); it != FloatingPaths.end() && index < OptimizingLevel; ++it, index++)
        {
            CurFloating.push_back(*it);         //  Put OptimizingLevel elements in working list
        }
        //  Limit optimizing level when number of ploygon is low
        if ( OptimizingLevel > index ) OptimizingLevel = index ;

        NSVGpath *NewFixed = OptimizeLevel(FixedPolyHull, FixedPath, CurFloating, num_rot, StepAngle, FixedArea, BestCost, 1e100, idxPoly, idxPoly-1, OptimizingLevel);
        if ( NewFixed != NULL )                 //  If NULL, couldn't be placed, continue with next one.
        {
            NewFixed->isFixed = true;
            FixedPath.push_back(NewFixed);    //    Put it in fixed list
            //  Could (and should) free cache memory for this one
            if ( NewFixed->CachePoly != NULL)
                delete NewFixed->CachePoly;
            NewFixed->CachePoly = NULL;
            FixedArea += NewFixed->LargePolygon->area();
            FixedPolyHull = NewFixed->LargeConvexHull;
        }
        else
        {
            NotPlaced++;                    //  COunt not placed elements
            cerr << "Unable to place polygon " << idxPoly << "\n";
            if ( debug_level > 0)
            {
                OutDebug << "######   Unable to place polygon " << idxPoly << ", aborting\n";
            }
        }

        FloatingPaths.pop_front();          //  Remove first in list
        CurFloating.clear();                //  Erase list before creating new one
        idxPoly++;
        if ( Flag_file )
        {
            StartLevel = clock();
            cout << "Polygon " << idxPoly << "  Not placed " << NotPlaced << "  Elapsed time " << ((double)1000.0*(StartLevel - LastLevel))/CLOCKS_PER_SEC << "\n";
#if CHECK_MEM > 0
            cout << " mem Poly_empty=" << nbEmptyPoly << "/" << nbCreatedEmptyPoly <<  " mem Poly_Vector=" << nbVectorPoly << "/" << nbCreatedVectorPoly;
            cout <<  " Rot_Poly=" << nbRotatedPoly << "/" << nbCreatedRotatedPoly;
            cout <<  " Trans_Poly=" << nbTranslatedPoly << "/" << nbCreatedTranslatedPoly;
//            cout <<  " Transformed_Poly=" << nbTransformedPoly << "/" << nbCreatedTransformedPoly;
            cout <<  " Cached_Poly=" << nbCachedPoly << "/" << nbCreatedCachedPoly;
            cout << "\n";
#endif
        }
    }
    if ( debug_level > 0 )
    {
        OutDebug << "Optimization finished, elapsed time " << ((double) (clock() - StartOptimize)) / CLOCKS_PER_SEC << "s\n";
        OutDebug << "nbRotation: " << nbRotation << "\n";
        OutDebug << "nbTranslation: " << nbTranslation << "\n";
        OutDebug << "nbPointInPoly: " << nbPointInPoly << "\n";
        OutDebug << "nbIntersectPoly: " << nbIntersectPoly << "\n";
        OutDebug << "nbPlacementImpossible: " << nbPlacementImpossible << "\n";
        OutDebug << "nbCheckAngles=" << nbCheckAngles << "\n";
        OutDebug << "CacheMiss=" << CacheMiss << "\n";
        OutDebug << "CacheHit OK=" << CacheHit_OK<< "\n";
        OutDebug << "CacheHit KO=" << CacheHit_KO<< "\n";
    }
    if ( Flag_file )
    {
        cout << "Optimization finished, cost " << BestCost << " elapsed time " << ((double) (clock() - StartOptimize)) / CLOCKS_PER_SEC << "\n";
        cout << "Performance stats :\n";
        cout << "nbTranslation=" << nbTranslation << "\n";
        cout << "nbRotation=" << nbRotation << "\n";
        cout << "nbCheckAngles=" << nbCheckAngles << "\n";
        cout << "nbPointInPoly=" << nbPointInPoly << "\n";
        cout << "nbIntersectPoly=" << nbIntersectPoly << "\n";
        cout << "nbPlacementImpossible=" << nbPlacementImpossible << "\n";
        cout << "CacheMiss=" << CacheMiss << "\n";
        cout << "CacheHit OK=" << CacheHit_OK<< "\n";
        cout << "CacheHit KO=" << CacheHit_KO<< "\n";
        if ( NotPlaced == 0 )
        {
            cout << "All elements have been successfully placed \n";
        }
        else
        {
            cout << NotPlaced << " elements couldn't have been placed \n";
        }
    }
    return BestCost;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x390, %rsp            # imm = 0x390
movq %rdi, -0x10(%rbp)
movsd %xmm0, -0x18(%rbp)
movl %esi, -0x1c(%rbp)
movl %edx, -0x20(%rbp)
movl %ecx, -0x24(%rbp)
movq -0x10(%rbp), %rsi
movq %rsi, -0x120(%rbp)
addq $0x20, %rsi
leaq -0x40(%rbp), %rdi
callq 0x805c0
leaq -0x58(%rbp), %rdi
callq 0x7fd20
leaq -0x70(%rbp), %rdi
callq 0x7fd20
movsd 0x16211(%rip), %xmm0    # 0x841b0
movsd %xmm0, -0x80(%rbp)
movl $0x0, -0x9c(%rbp)
movsd 0x161f2(%rip), %xmm0    # 0x841a8
divsd -0x18(%rbp), %xmm0
cvttsd2si %xmm0, %eax
addl $0x1, %eax
movl %eax, -0xa0(%rbp)
callq 0x93c0
movq %rax, %rcx
movq -0x120(%rbp), %rax
movq %rcx, -0x88(%rbp)
movq %rcx, -0x98(%rbp)
cmpl $0x0, 0x60(%rax)
jle 0x6e0d7
movq -0x120(%rbp), %rdi
addq $0x68, %rdi
leaq 0x172cf(%rip), %rsi     # 0x852d0
callq 0x9530
movq %rax, -0x128(%rbp)
jmp 0x6e00f
movq -0x128(%rbp), %rdi
leaq 0x11ed3(%rip), %rsi     # 0x7fef0
callq 0x91a0
movq %rax, -0x130(%rbp)
jmp 0x6e02b
movq -0x130(%rbp), %rdi
movq -0x120(%rbp), %rcx
movq -0x88(%rbp), %rax
movq 0x268(%rcx), %rcx
subq %rcx, %rax
cvtsi2sd %rax, %xmm0
movsd 0x16121(%rip), %xmm1    # 0x84178
mulsd %xmm1, %xmm0
movsd 0x1610d(%rip), %xmm1    # 0x84170
divsd %xmm1, %xmm0
callq 0x9a30
movq %rax, -0x138(%rbp)
jmp 0x6e075
movq -0x138(%rbp), %rdi
leaq 0x17254(%rip), %rsi     # 0x852d7
callq 0x9530
movq %rax, -0x140(%rbp)
jmp 0x6e091
movq -0x140(%rbp), %rdi
movl -0x1c(%rbp), %esi
callq 0x9930
movq %rax, -0x148(%rbp)
jmp 0x6e0a9
movq -0x148(%rbp), %rdi
movq 0x49e91(%rip), %rsi     # 0xb7f48
callq 0x9590
jmp 0x6e0be
jmp 0x6e0d7
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xa8(%rbp)
movl %eax, -0xac(%rbp)
jmp 0x6f095
leaq -0x40(%rbp), %rdi
callq 0x80680
movq (%rax), %rax
movq %rax, -0xb8(%rbp)
leaq -0x40(%rbp), %rdi
callq 0x806b0
movq -0x120(%rbp), %rax
cmpl $0x0, 0x60(%rax)
jle 0x6e15a
movq -0x120(%rbp), %rdi
addq $0x68, %rdi
leaq 0x171f5(%rip), %rsi     # 0x85307
callq 0x9530
movq %rax, -0x150(%rbp)
jmp 0x6e120
movq -0x150(%rbp), %rdi
movq -0xb8(%rbp), %rsi
addq $0x90, %rsi
callq 0x9530
movq %rax, -0x158(%rbp)
jmp 0x6e143
movq -0x158(%rbp), %rdi
leaq 0x171d6(%rip), %rsi     # 0x85327
callq 0x9530
jmp 0x6e158
jmp 0x6e15a
movq -0x120(%rbp), %rdi
movq -0xb8(%rbp), %rax
movq 0x68(%rax), %rsi
movl -0x20(%rbp), %edx
movsd -0x18(%rbp), %xmm0
callq 0x6f0c0
movq %rax, -0x160(%rbp)
jmp 0x6e182
movq -0x160(%rbp), %rcx
movq -0xb8(%rbp), %rax
movq %rcx, 0x78(%rax)
movq -0xb8(%rbp), %rax
cmpq $0x0, 0x78(%rax)
jne 0x6e213
movq 0x49e3f(%rip), %rdi     # 0xb7fe8
leaq 0x171e6(%rip), %rsi     # 0x85396
callq 0x9530
jmp 0x6e1b7
movq -0x120(%rbp), %rax
cmpl $0x0, 0x60(%rax)
jle 0x6e1df
movq -0x120(%rbp), %rdi
addq $0x68, %rdi
leaq 0x17160(%rip), %rsi     # 0x85336
callq 0x9530
jmp 0x6e1dd
jmp 0x6e1df
cmpl $0x0, -0x24(%rbp)
je 0x6e1fc
movq 0x49da4(%rip), %rdi     # 0xb7f90
leaq 0x17182(%rip), %rsi     # 0x85375
callq 0x9530
jmp 0x6e1fa
jmp 0x6e1fc
xorps %xmm0, %xmm0
movsd %xmm0, -0x8(%rbp)
movl $0x1, -0xbc(%rbp)
jmp 0x6f06c
movq -0xb8(%rbp), %rax
movq 0x78(%rax), %rdi
callq 0x62930
jmp 0x6e225
movq -0xb8(%rbp), %rax
movq 0x78(%rax), %rdi
callq 0x63030
jmp 0x6e237
movq -0xb8(%rbp), %rax
movl $0x1, 0x80(%rax)
movq -0xb8(%rbp), %rax
movq 0x78(%rax), %rdi
callq 0x5ed10
movsd %xmm0, -0x168(%rbp)
jmp 0x6e262
movsd -0x168(%rbp), %xmm0
movsd %xmm0, -0xc8(%rbp)
movq -0xb8(%rbp), %rax
movq 0x78(%rax), %rdi
callq 0x614a0
movq %rax, -0x170(%rbp)
jmp 0x6e28b
movq -0x170(%rbp), %rax
movq -0xb8(%rbp), %rcx
movq %rax, 0x70(%rcx)
movq %rax, -0x78(%rbp)
leaq -0x58(%rbp), %rdi
leaq -0xb8(%rbp), %rsi
callq 0x7ff70
jmp 0x6e2b3
movl $0x1, -0xcc(%rbp)
leaq -0x40(%rbp), %rdi
callq 0x806e0
xorb $-0x1, %al
testb $0x1, %al
jne 0x6e2d1
jmp 0x6e8c0
callq 0x93c0
movq %rax, %rcx
movq -0x120(%rbp), %rax
movq %rcx, -0x90(%rbp)
cmpl $0x0, 0x60(%rax)
jle 0x6e45b
movq -0x120(%rbp), %rdi
addq $0x68, %rdi
leaq 0x170c7(%rip), %rsi     # 0x853ca
callq 0x9530
movq %rax, -0x178(%rbp)
jmp 0x6e311
movq -0x178(%rbp), %rdi
movl -0xcc(%rbp), %esi
callq 0x9930
movq %rax, -0x180(%rbp)
jmp 0x6e32c
movq -0x180(%rbp), %rdi
leaq 0x17339(%rip), %rsi     # 0x85673
callq 0x9530
movq %rax, -0x188(%rbp)
jmp 0x6e348
leaq -0x40(%rbp), %rdi
callq 0x80680
movq -0x188(%rbp), %rdi
movq (%rax), %rsi
addq $0x90, %rsi
callq 0x9530
movq %rax, -0x190(%rbp)
jmp 0x6e370
movq -0x190(%rbp), %rdi
leaq 0x17074(%rip), %rsi     # 0x853f2
callq 0x9530
jmp 0x6e385
movq -0x120(%rbp), %rdi
addq $0x68, %rdi
leaq 0x170c5(%rip), %rsi     # 0x8545c
callq 0x9530
movq %rax, -0x198(%rbp)
jmp 0x6e3a5
movq -0x198(%rbp), %rdi
movq -0x90(%rbp), %rax
movq -0x88(%rbp), %rcx
subq %rcx, %rax
cvtsi2sd %rax, %xmm0
movsd 0x15dae(%rip), %xmm1    # 0x84178
mulsd %xmm1, %xmm0
movsd 0x15d9a(%rip), %xmm1    # 0x84170
divsd %xmm1, %xmm0
callq 0x9a30
jmp 0x6e3e1
movq -0x120(%rbp), %rdi
addq $0x68, %rdi
leaq 0x17021(%rip), %rsi     # 0x85414
callq 0x9530
movq %rax, -0x1a0(%rbp)
jmp 0x6e401
movq -0x1a0(%rbp), %rdi
movq -0x90(%rbp), %rax
movq -0x98(%rbp), %rcx
subq %rcx, %rax
cvtsi2sd %rax, %xmm0
movsd 0x15d52(%rip), %xmm1    # 0x84178
mulsd %xmm1, %xmm0
movsd 0x15d3e(%rip), %xmm1    # 0x84170
divsd %xmm1, %xmm0
callq 0x9a30
movq %rax, -0x1a8(%rbp)
jmp 0x6e444
movq -0x1a8(%rbp), %rdi
leaq 0x163b4(%rip), %rsi     # 0x84806
callq 0x9530
jmp 0x6e459
jmp 0x6e45b
movq -0x90(%rbp), %rax
movq %rax, -0x98(%rbp)
movl $0x0, -0xd0(%rbp)
leaq -0x40(%rbp), %rdi
callq 0x803f0
movq %rax, -0xd8(%rbp)
leaq -0x40(%rbp), %rdi
callq 0x80450
movq %rax, -0xe0(%rbp)
leaq -0xd8(%rbp), %rdi
leaq -0xe0(%rbp), %rsi
callq 0x80420
movb %al, %cl
xorl %eax, %eax
testb $0x1, %cl
movb %al, -0x1a9(%rbp)
jne 0x6e4b7
jmp 0x6e4c9
movl -0xd0(%rbp), %eax
cmpl -0x1c(%rbp), %eax
setl %al
movb %al, -0x1a9(%rbp)
movb -0x1a9(%rbp), %al
testb $0x1, %al
jne 0x6e4d5
jmp 0x6e511
leaq -0xd8(%rbp), %rdi
callq 0x80480
movq %rax, %rsi
leaq -0x70(%rbp), %rdi
callq 0x7ff70
jmp 0x6e4ef
jmp 0x6e4f1
leaq -0xd8(%rbp), %rdi
callq 0x80570
movl -0xd0(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xd0(%rbp)
jmp 0x6e483
movl -0x1c(%rbp), %eax
cmpl -0xd0(%rbp), %eax
jle 0x6e525
movl -0xd0(%rbp), %eax
movl %eax, -0x1c(%rbp)
movq -0x78(%rbp), %rax
movq %rax, -0x1b8(%rbp)
leaq -0x100(%rbp), %rdi
leaq -0x58(%rbp), %rsi
callq 0x805c0
jmp 0x6e542
leaq -0x118(%rbp), %rdi
leaq -0x70(%rbp), %rsi
callq 0x805c0
jmp 0x6e554
movq -0x1b8(%rbp), %rsi
movq -0x120(%rbp), %rdi
movl -0xa0(%rbp), %r8d
movsd -0x18(%rbp), %xmm0
movsd -0xc8(%rbp), %xmm1
movl -0xcc(%rbp), %ecx
movl %ecx, %edx
decl %edx
movl -0x1c(%rbp), %r9d
movq %rsp, %rax
movl %r9d, 0x10(%rax)
movl %edx, 0x8(%rax)
movl %ecx, (%rax)
leaq -0x100(%rbp), %rdx
leaq -0x118(%rbp), %rcx
leaq -0x80(%rbp), %r9
movsd 0x15c06(%rip), %xmm2    # 0x841b0
callq 0x6f3b0
movq %rax, -0x1c0(%rbp)
jmp 0x6e5b8
leaq -0x118(%rbp), %rdi
callq 0x7fd40
leaq -0x100(%rbp), %rdi
callq 0x7fd40
movq -0x1c0(%rbp), %rax
movq %rax, -0xe8(%rbp)
cmpq $0x0, -0xe8(%rbp)
je 0x6e6e5
movq -0xe8(%rbp), %rax
movl $0x1, 0x80(%rax)
leaq -0x58(%rbp), %rdi
leaq -0xe8(%rbp), %rsi
callq 0x7ff70
jmp 0x6e60f
movq -0xe8(%rbp), %rax
cmpq $0x0, 0x88(%rax)
je 0x6e68d
movq -0xe8(%rbp), %rax
movq 0x88(%rax), %rax
movq %rax, -0x1c8(%rbp)
cmpq $0x0, %rax
je 0x6e648
movq -0x1c8(%rbp), %rdi
movq (%rdi), %rax
callq *0x8(%rax)
jmp 0x6e68d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xa8(%rbp)
movl %eax, -0xac(%rbp)
jmp 0x6e67c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xa8(%rbp)
movl %eax, -0xac(%rbp)
leaq -0x118(%rbp), %rdi
callq 0x7fd40
leaq -0x100(%rbp), %rdi
callq 0x7fd40
jmp 0x6f095
movq -0xe8(%rbp), %rax
movq $0x0, 0x88(%rax)
movq -0xe8(%rbp), %rax
movq 0x68(%rax), %rdi
callq 0x5ed10
movsd %xmm0, -0x1d0(%rbp)
jmp 0x6e6b9
movsd -0x1d0(%rbp), %xmm0
addsd -0xc8(%rbp), %xmm0
movsd %xmm0, -0xc8(%rbp)
movq -0xe8(%rbp), %rax
movq 0x70(%rax), %rax
movq %rax, -0x78(%rbp)
jmp 0x6e7a0
movl -0x9c(%rbp), %eax
incl %eax
movl %eax, -0x9c(%rbp)
movq 0x498ee(%rip), %rdi     # 0xb7fe8
leaq 0x16d32(%rip), %rsi     # 0x85433
callq 0x9530
movq %rax, -0x1d8(%rbp)
jmp 0x6e70f
movq -0x1d8(%rbp), %rdi
movl -0xcc(%rbp), %esi
callq 0x9930
movq %rax, -0x1e0(%rbp)
jmp 0x6e72a
movq -0x1e0(%rbp), %rdi
leaq 0x16b83(%rip), %rsi     # 0x852bb
callq 0x9530
jmp 0x6e73f
movq -0x120(%rbp), %rax
cmpl $0x0, 0x60(%rax)
jle 0x6e79e
movq -0x120(%rbp), %rdi
addq $0x68, %rdi
leaq 0x16ccc(%rip), %rsi     # 0x8542a
callq 0x9530
movq %rax, -0x1e8(%rbp)
jmp 0x6e76c
movq -0x1e8(%rbp), %rdi
movl -0xcc(%rbp), %esi
callq 0x9930
movq %rax, -0x1f0(%rbp)
jmp 0x6e787
movq -0x1f0(%rbp), %rdi
leaq 0x15d90(%rip), %rsi     # 0x84525
callq 0x9530
jmp 0x6e79c
jmp 0x6e79e
jmp 0x6e7a0
leaq -0x40(%rbp), %rdi
callq 0x806b0
leaq -0x70(%rbp), %rdi
callq 0x80700
movl -0xcc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xcc(%rbp)
cmpl $0x0, -0x24(%rbp)
je 0x6e8bb
callq 0x93c0
movq %rax, -0x90(%rbp)
movq 0x497b2(%rip), %rdi     # 0xb7f90
leaq 0x17389(%rip), %rsi     # 0x85b6e
callq 0x9530
movq %rax, -0x1f8(%rbp)
jmp 0x6e7f3
movq -0x1f8(%rbp), %rdi
movl -0xcc(%rbp), %esi
callq 0x9930
movq %rax, -0x200(%rbp)
jmp 0x6e80e
movq -0x200(%rbp), %rdi
leaq 0x16c30(%rip), %rsi     # 0x8544c
callq 0x9530
movq %rax, -0x208(%rbp)
jmp 0x6e82a
movq -0x208(%rbp), %rdi
movl -0x9c(%rbp), %esi
callq 0x9930
movq %rax, -0x210(%rbp)
jmp 0x6e845
movq -0x210(%rbp), %rdi
leaq 0x16c07(%rip), %rsi     # 0x8545a
callq 0x9530
movq %rax, -0x218(%rbp)
jmp 0x6e861
movq -0x218(%rbp), %rdi
movq -0x90(%rbp), %rax
movq -0x98(%rbp), %rcx
subq %rcx, %rax
cvtsi2sd %rax, %xmm0
movsd 0x158f2(%rip), %xmm1    # 0x84178
mulsd %xmm1, %xmm0
movsd 0x158de(%rip), %xmm1    # 0x84170
divsd %xmm1, %xmm0
callq 0x9a30
movq %rax, -0x220(%rbp)
jmp 0x6e8a4
movq -0x220(%rbp), %rdi
leaq 0x16a09(%rip), %rsi     # 0x852bb
callq 0x9530
jmp 0x6e8b9
jmp 0x6e8bb
jmp 0x6e2bd
movq -0x120(%rbp), %rax
cmpl $0x0, 0x60(%rax)
jle 0x6ec55
movq -0x120(%rbp), %rdi
addq $0x68, %rdi
leaq 0x16b87(%rip), %rsi     # 0x8546a
callq 0x9530
movq %rax, -0x228(%rbp)
jmp 0x6e8f1
callq 0x93c0
movq -0x228(%rbp), %rdi
movq -0x88(%rbp), %rcx
subq %rcx, %rax
cvtsi2sd %rax, %xmm0
movsd 0x1585c(%rip), %xmm1    # 0x84170
divsd %xmm1, %xmm0
callq 0x9a30
movq %rax, -0x230(%rbp)
jmp 0x6e926
movq -0x230(%rbp), %rdi
leaq 0x15dd7(%rip), %rsi     # 0x8470b
callq 0x9530
jmp 0x6e93b
movq -0x120(%rbp), %rdi
addq $0x68, %rdi
leaq 0x16b42(%rip), %rsi     # 0x8548f
callq 0x9530
movq %rax, -0x238(%rbp)
jmp 0x6e95b
movq -0x238(%rbp), %rdi
movq -0x120(%rbp), %rax
movq 0x278(%rax), %rsi
callq 0x99d0
movq %rax, -0x240(%rbp)
jmp 0x6e97e
movq -0x240(%rbp), %rdi
leaq 0x1692f(%rip), %rsi     # 0x852bb
callq 0x9530
jmp 0x6e993
movq -0x120(%rbp), %rdi
addq $0x68, %rdi
leaq 0x16af7(%rip), %rsi     # 0x8549c
callq 0x9530
movq %rax, -0x248(%rbp)
jmp 0x6e9b3
movq -0x248(%rbp), %rdi
movq -0x120(%rbp), %rax
movq 0x270(%rax), %rsi
callq 0x99d0
movq %rax, -0x250(%rbp)
jmp 0x6e9d6
movq -0x250(%rbp), %rdi
leaq 0x168d7(%rip), %rsi     # 0x852bb
callq 0x9530
jmp 0x6e9eb
movq -0x120(%rbp), %rdi
addq $0x68, %rdi
leaq 0x16aaf(%rip), %rsi     # 0x854ac
callq 0x9530
movq %rax, -0x258(%rbp)
jmp 0x6ea0b
movq -0x258(%rbp), %rdi
movq -0x120(%rbp), %rax
movq 0x288(%rax), %rsi
callq 0x99d0
movq %rax, -0x260(%rbp)
jmp 0x6ea2e
movq -0x260(%rbp), %rdi
leaq 0x1687f(%rip), %rsi     # 0x852bb
callq 0x9530
jmp 0x6ea43
movq -0x120(%rbp), %rdi
addq $0x68, %rdi
leaq 0x16a67(%rip), %rsi     # 0x854bc
callq 0x9530
movq %rax, -0x268(%rbp)
jmp 0x6ea63
movq -0x268(%rbp), %rdi
movq -0x120(%rbp), %rax
movq 0x290(%rax), %rsi
callq 0x99d0
movq %rax, -0x270(%rbp)
jmp 0x6ea86
movq -0x270(%rbp), %rdi
leaq 0x16827(%rip), %rsi     # 0x852bb
callq 0x9530
jmp 0x6ea9b
movq -0x120(%rbp), %rdi
addq $0x68, %rdi
leaq 0x16a21(%rip), %rsi     # 0x854ce
callq 0x9530
movq %rax, -0x278(%rbp)
jmp 0x6eabb
movq -0x278(%rbp), %rdi
movq -0x120(%rbp), %rax
movq 0x298(%rax), %rsi
callq 0x99d0
movq %rax, -0x280(%rbp)
jmp 0x6eade
movq -0x280(%rbp), %rdi
leaq 0x167cf(%rip), %rsi     # 0x852bb
callq 0x9530
jmp 0x6eaf3
movq -0x120(%rbp), %rdi
addq $0x68, %rdi
leaq 0x169e1(%rip), %rsi     # 0x854e6
callq 0x9530
movq %rax, -0x288(%rbp)
jmp 0x6eb13
movq -0x288(%rbp), %rdi
movq -0x120(%rbp), %rax
movq 0x280(%rax), %rsi
callq 0x99d0
movq %rax, -0x290(%rbp)
jmp 0x6eb36
movq -0x290(%rbp), %rdi
leaq 0x16777(%rip), %rsi     # 0x852bb
callq 0x9530
jmp 0x6eb4b
movq -0x120(%rbp), %rdi
addq $0x68, %rdi
leaq 0x16998(%rip), %rsi     # 0x854f5
callq 0x9530
movq %rax, -0x298(%rbp)
jmp 0x6eb6b
movq -0x298(%rbp), %rdi
movq -0x120(%rbp), %rax
movq 0x2a0(%rax), %rsi
callq 0x99d0
movq %rax, -0x2a0(%rbp)
jmp 0x6eb8e
movq -0x2a0(%rbp), %rdi
leaq 0x1671f(%rip), %rsi     # 0x852bb
callq 0x9530
jmp 0x6eba3
movq -0x120(%rbp), %rdi
addq $0x68, %rdi
leaq 0x1694b(%rip), %rsi     # 0x85500
callq 0x9530
movq %rax, -0x2a8(%rbp)
jmp 0x6ebc3
movq -0x2a8(%rbp), %rdi
movq -0x120(%rbp), %rax
movq 0x2a8(%rax), %rsi
callq 0x99d0
movq %rax, -0x2b0(%rbp)
jmp 0x6ebe6
movq -0x2b0(%rbp), %rdi
leaq 0x166c7(%rip), %rsi     # 0x852bb
callq 0x9530
jmp 0x6ebfb
movq -0x120(%rbp), %rdi
addq $0x68, %rdi
leaq 0x16900(%rip), %rsi     # 0x8550d
callq 0x9530
movq %rax, -0x2b8(%rbp)
jmp 0x6ec1b
movq -0x2b8(%rbp), %rdi
movq -0x120(%rbp), %rax
movq 0x2b0(%rax), %rsi
callq 0x99d0
movq %rax, -0x2c0(%rbp)
jmp 0x6ec3e
movq -0x2c0(%rbp), %rdi
leaq 0x1666f(%rip), %rsi     # 0x852bb
callq 0x9530
jmp 0x6ec53
jmp 0x6ec55
cmpl $0x0, -0x24(%rbp)
je 0x6f058
movq 0x4932a(%rip), %rdi     # 0xb7f90
leaq 0x168ad(%rip), %rsi     # 0x8551a
callq 0x9530
movq %rax, -0x2c8(%rbp)
jmp 0x6ec7b
movq -0x2c8(%rbp), %rdi
movsd -0x80(%rbp), %xmm0
callq 0x9a30
movq %rax, -0x2d0(%rbp)
jmp 0x6ec95
movq -0x2d0(%rbp), %rdi
leaq 0x167dd(%rip), %rsi     # 0x85480
callq 0x9530
movq %rax, -0x2d8(%rbp)
jmp 0x6ecb1
callq 0x93c0
movq -0x2d8(%rbp), %rdi
movq -0x88(%rbp), %rcx
subq %rcx, %rax
cvtsi2sd %rax, %xmm0
movsd 0x1549c(%rip), %xmm1    # 0x84170
divsd %xmm1, %xmm0
callq 0x9a30
movq %rax, -0x2e0(%rbp)
jmp 0x6ece6
movq -0x2e0(%rbp), %rdi
leaq 0x165c7(%rip), %rsi     # 0x852bb
callq 0x9530
jmp 0x6ecfb
movq 0x4928e(%rip), %rdi     # 0xb7f90
leaq 0x1682e(%rip), %rsi     # 0x85537
callq 0x9530
jmp 0x6ed10
movq 0x49279(%rip), %rdi     # 0xb7f90
leaq 0x1682e(%rip), %rsi     # 0x8554c
callq 0x9530
movq %rax, -0x2e8(%rbp)
jmp 0x6ed2c
movq -0x2e8(%rbp), %rdi
movq -0x120(%rbp), %rax
movq 0x270(%rax), %rsi
callq 0x99d0
movq %rax, -0x2f0(%rbp)
jmp 0x6ed4f
movq -0x2f0(%rbp), %rdi
leaq 0x1655e(%rip), %rsi     # 0x852bb
callq 0x9530
jmp 0x6ed64
movq 0x49225(%rip), %rdi     # 0xb7f90
leaq 0x167e9(%rip), %rsi     # 0x8555b
callq 0x9530
movq %rax, -0x2f8(%rbp)
jmp 0x6ed80
movq -0x2f8(%rbp), %rdi
movq -0x120(%rbp), %rax
movq 0x278(%rax), %rsi
callq 0x99d0
movq %rax, -0x300(%rbp)
jmp 0x6eda3
movq -0x300(%rbp), %rdi
leaq 0x1650a(%rip), %rsi     # 0x852bb
callq 0x9530
jmp 0x6edb8
movq 0x491d1(%rip), %rdi     # 0xb7f90
leaq 0x16720(%rip), %rsi     # 0x854e6
callq 0x9530
movq %rax, -0x308(%rbp)
jmp 0x6edd4
movq -0x308(%rbp), %rdi
movq -0x120(%rbp), %rax
movq 0x280(%rax), %rsi
callq 0x99d0
movq %rax, -0x310(%rbp)
jmp 0x6edf7
movq -0x310(%rbp), %rdi
leaq 0x164b6(%rip), %rsi     # 0x852bb
callq 0x9530
jmp 0x6ee0c
movq 0x4917d(%rip), %rdi     # 0xb7f90
leaq 0x1674d(%rip), %rsi     # 0x85567
callq 0x9530
movq %rax, -0x318(%rbp)
jmp 0x6ee28
movq -0x318(%rbp), %rdi
movq -0x120(%rbp), %rax
movq 0x288(%rax), %rsi
callq 0x99d0
movq %rax, -0x320(%rbp)
jmp 0x6ee4b
movq -0x320(%rbp), %rdi
leaq 0x16462(%rip), %rsi     # 0x852bb
callq 0x9530
jmp 0x6ee60
movq 0x49129(%rip), %rdi     # 0xb7f90
leaq 0x16708(%rip), %rsi     # 0x85576
callq 0x9530
movq %rax, -0x328(%rbp)
jmp 0x6ee7c
movq -0x328(%rbp), %rdi
movq -0x120(%rbp), %rax
movq 0x290(%rax), %rsi
callq 0x99d0
movq %rax, -0x330(%rbp)
jmp 0x6ee9f
movq -0x330(%rbp), %rdi
leaq 0x1640e(%rip), %rsi     # 0x852bb
callq 0x9530
jmp 0x6eeb4
movq 0x490d5(%rip), %rdi     # 0xb7f90
leaq 0x166c5(%rip), %rsi     # 0x85587
callq 0x9530
movq %rax, -0x338(%rbp)
jmp 0x6eed0
movq -0x338(%rbp), %rdi
movq -0x120(%rbp), %rax
movq 0x298(%rax), %rsi
callq 0x99d0
movq %rax, -0x340(%rbp)
jmp 0x6eef3
movq -0x340(%rbp), %rdi
leaq 0x163ba(%rip), %rsi     # 0x852bb
callq 0x9530
jmp 0x6ef08
movq 0x49081(%rip), %rdi     # 0xb7f90
leaq 0x165df(%rip), %rsi     # 0x854f5
callq 0x9530
movq %rax, -0x348(%rbp)
jmp 0x6ef24
movq -0x348(%rbp), %rdi
movq -0x120(%rbp), %rax
movq 0x2a0(%rax), %rsi
callq 0x99d0
movq %rax, -0x350(%rbp)
jmp 0x6ef47
movq -0x350(%rbp), %rdi
leaq 0x16366(%rip), %rsi     # 0x852bb
callq 0x9530
jmp 0x6ef5c
movq 0x4902d(%rip), %rdi     # 0xb7f90
leaq 0x16596(%rip), %rsi     # 0x85500
callq 0x9530
movq %rax, -0x358(%rbp)
jmp 0x6ef78
movq -0x358(%rbp), %rdi
movq -0x120(%rbp), %rax
movq 0x2a8(%rax), %rsi
callq 0x99d0
movq %rax, -0x360(%rbp)
jmp 0x6ef9b
movq -0x360(%rbp), %rdi
leaq 0x16312(%rip), %rsi     # 0x852bb
callq 0x9530
jmp 0x6efb0
movq 0x48fd9(%rip), %rdi     # 0xb7f90
leaq 0x1654f(%rip), %rsi     # 0x8550d
callq 0x9530
movq %rax, -0x368(%rbp)
jmp 0x6efcc
movq -0x368(%rbp), %rdi
movq -0x120(%rbp), %rax
movq 0x2b0(%rax), %rsi
callq 0x99d0
movq %rax, -0x370(%rbp)
jmp 0x6efef
movq -0x370(%rbp), %rdi
leaq 0x162be(%rip), %rsi     # 0x852bb
callq 0x9530
jmp 0x6f004
cmpl $0x0, -0x9c(%rbp)
jne 0x6f024
movq 0x48f7c(%rip), %rdi     # 0xb7f90
leaq 0x16583(%rip), %rsi     # 0x8559e
callq 0x9530
jmp 0x6f022
jmp 0x6f056
movl -0x9c(%rbp), %esi
movq 0x48f5f(%rip), %rdi     # 0xb7f90
callq 0x9930
movq %rax, -0x378(%rbp)
jmp 0x6f03f
movq -0x378(%rbp), %rdi
leaq 0x1657e(%rip), %rsi     # 0x855cb
callq 0x9530
jmp 0x6f054
jmp 0x6f056
jmp 0x6f058
movsd -0x80(%rbp), %xmm0
movsd %xmm0, -0x8(%rbp)
movl $0x1, -0xbc(%rbp)
leaq -0x70(%rbp), %rdi
callq 0x7fd40
leaq -0x58(%rbp), %rdi
callq 0x7fd40
leaq -0x40(%rbp), %rdi
callq 0x7fd40
movsd -0x8(%rbp), %xmm0
addq $0x390, %rsp            # imm = 0x390
popq %rbp
retq
leaq -0x70(%rbp), %rdi
callq 0x7fd40
leaq -0x58(%rbp), %rdi
callq 0x7fd40
leaq -0x40(%rbp), %rdi
callq 0x7fd40
movq -0xa8(%rbp), %rdi
callq 0x9960
nopl (%rax)