// File: thierry7100[P]CutOptim/src/SvgDoc.cpp
// Function: SvgDoc::OptimizeFreeRot(int, int, int)
double SvgDoc::OptimizeFreeRot(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;

    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";
    }
    //  In this mode (free rotation), try first with rotation angles of 90°
    First->PlacedPolygon = PlaceFirst(First->LargePolygon, FirstPos, M_PI/2.0);
    if ( First->PlacedPolygon == NULL )     //  If not OK, try with 9°
        First->PlacedPolygon = PlaceFirst(First->LargePolygon, FirstPos, M_PI/20.0);
    //  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 (Free rotation)" << 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 = OptimizeLevelFreeRot(FixedPolyHull, FixedPath, CurFloating, 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";
            }
        }

        if ( Flag_file )
        {
            StartLevel = clock();
            cout << "FreeRotOptim : Polygon " << idxPoly << "(" << FloatingPaths.front()->id << ")" << "  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
        }
        FloatingPaths.pop_front();          //  Remove first in list
        CurFloating.clear();                //  Erase list before creating new one
        idxPoly++;
    }
    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 $0x3a0, %rsp            # imm = 0x3A0
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
movl %edx, -0x18(%rbp)
movl %ecx, -0x1c(%rbp)
movq -0x10(%rbp), %rsi
movq %rsi, -0x118(%rbp)
addq $0x20, %rsi
leaq -0x38(%rbp), %rdi
callq 0x805c0
leaq -0x50(%rbp), %rdi
callq 0x7fd20
leaq -0x68(%rbp), %rdi
callq 0x7fd20
movsd 0x110a6(%rip), %xmm0    # 0x841b0
movsd %xmm0, -0x78(%rbp)
movl $0x0, -0x94(%rbp)
callq 0x93c0
movq %rax, %rcx
movq -0x118(%rbp), %rax
movq %rcx, -0x80(%rbp)
movq %rcx, -0x90(%rbp)
cmpl $0x0, 0x60(%rax)
jle 0x73222
movq -0x118(%rbp), %rdi
addq $0x68, %rdi
leaq 0x12181(%rip), %rsi     # 0x852d0
callq 0x9530
movq %rax, -0x120(%rbp)
jmp 0x7315d
movq -0x120(%rbp), %rdi
leaq 0xcd85(%rip), %rsi      # 0x7fef0
callq 0x91a0
movq %rax, -0x128(%rbp)
jmp 0x73179
movq -0x128(%rbp), %rdi
movq -0x118(%rbp), %rcx
movq -0x80(%rbp), %rax
movq 0x268(%rcx), %rcx
subq %rcx, %rax
cvtsi2sd %rax, %xmm0
movsd 0x10fd6(%rip), %xmm1    # 0x84178
mulsd %xmm1, %xmm0
movsd 0x10fc2(%rip), %xmm1    # 0x84170
divsd %xmm1, %xmm0
callq 0x9a30
movq %rax, -0x130(%rbp)
jmp 0x731c0
movq -0x130(%rbp), %rdi
leaq 0x12109(%rip), %rsi     # 0x852d7
callq 0x9530
movq %rax, -0x138(%rbp)
jmp 0x731dc
movq -0x138(%rbp), %rdi
movl -0x14(%rbp), %esi
callq 0x9930
movq %rax, -0x140(%rbp)
jmp 0x731f4
movq -0x140(%rbp), %rdi
movq 0x44d46(%rip), %rsi     # 0xb7f48
callq 0x9590
jmp 0x73209
jmp 0x73222
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xa0(%rbp)
movl %eax, -0xa4(%rbp)
jmp 0x74276
leaq -0x38(%rbp), %rdi
callq 0x80680
movq (%rax), %rax
movq %rax, -0xb0(%rbp)
leaq -0x38(%rbp), %rdi
callq 0x806b0
movq -0x118(%rbp), %rax
cmpl $0x0, 0x60(%rax)
jle 0x732a5
movq -0x118(%rbp), %rdi
addq $0x68, %rdi
leaq 0x120aa(%rip), %rsi     # 0x85307
callq 0x9530
movq %rax, -0x148(%rbp)
jmp 0x7326b
movq -0x148(%rbp), %rdi
movq -0xb0(%rbp), %rsi
addq $0x90, %rsi
callq 0x9530
movq %rax, -0x150(%rbp)
jmp 0x7328e
movq -0x150(%rbp), %rdi
leaq 0x1208b(%rip), %rsi     # 0x85327
callq 0x9530
jmp 0x732a3
jmp 0x732a5
movq -0x118(%rbp), %rdi
movq -0xb0(%rbp), %rax
movq 0x68(%rax), %rsi
movl -0x18(%rbp), %edx
movsd 0x10f06(%rip), %xmm0    # 0x841c8
callq 0x6f0c0
movq %rax, -0x158(%rbp)
jmp 0x732d0
movq -0x158(%rbp), %rcx
movq -0xb0(%rbp), %rax
movq %rcx, 0x78(%rax)
movq -0xb0(%rbp), %rax
cmpq $0x0, 0x78(%rax)
jne 0x7332d
movq -0x118(%rbp), %rdi
movq -0xb0(%rbp), %rax
movq 0x68(%rax), %rsi
movl -0x18(%rbp), %edx
movsd 0x10ec3(%rip), %xmm0    # 0x841d0
callq 0x6f0c0
movq %rax, -0x160(%rbp)
jmp 0x7331b
movq -0x160(%rbp), %rcx
movq -0xb0(%rbp), %rax
movq %rcx, 0x78(%rax)
movq -0xb0(%rbp), %rax
cmpq $0x0, 0x78(%rax)
jne 0x733ac
movq 0x44ca6(%rip), %rdi     # 0xb7fe8
leaq 0x1204d(%rip), %rsi     # 0x85396
callq 0x9530
jmp 0x73350
movq -0x118(%rbp), %rax
cmpl $0x0, 0x60(%rax)
jle 0x73378
movq -0x118(%rbp), %rdi
addq $0x68, %rdi
leaq 0x11fc7(%rip), %rsi     # 0x85336
callq 0x9530
jmp 0x73376
jmp 0x73378
cmpl $0x0, -0x1c(%rbp)
je 0x73395
movq 0x44c0b(%rip), %rdi     # 0xb7f90
leaq 0x11fe9(%rip), %rsi     # 0x85375
callq 0x9530
jmp 0x73393
jmp 0x73395
xorps %xmm0, %xmm0
movsd %xmm0, -0x8(%rbp)
movl $0x1, -0xb4(%rbp)
jmp 0x7424d
movq -0xb0(%rbp), %rax
movq 0x78(%rax), %rdi
callq 0x62930
jmp 0x733be
movq -0xb0(%rbp), %rax
movq 0x78(%rax), %rdi
callq 0x63030
jmp 0x733d0
movq -0xb0(%rbp), %rax
movl $0x1, 0x80(%rax)
movq -0xb0(%rbp), %rax
movq 0x78(%rax), %rdi
callq 0x5ed10
movsd %xmm0, -0x168(%rbp)
jmp 0x733fb
movsd -0x168(%rbp), %xmm0
movsd %xmm0, -0xc0(%rbp)
movq -0xb0(%rbp), %rax
movq 0x78(%rax), %rdi
callq 0x614a0
movq %rax, -0x170(%rbp)
jmp 0x73424
movq -0x170(%rbp), %rax
movq -0xb0(%rbp), %rcx
movq %rax, 0x70(%rcx)
movq %rax, -0x70(%rbp)
leaq -0x50(%rbp), %rdi
leaq -0xb0(%rbp), %rsi
callq 0x7ff70
jmp 0x7344c
movl $0x1, -0xc4(%rbp)
leaq -0x38(%rbp), %rdi
callq 0x806e0
xorb $-0x1, %al
testb $0x1, %al
jne 0x7346a
jmp 0x73aa7
callq 0x93c0
movq %rax, %rcx
movq -0x118(%rbp), %rax
movq %rcx, -0x88(%rbp)
cmpl $0x0, 0x60(%rax)
jle 0x735f1
movq -0x118(%rbp), %rdi
addq $0x68, %rdi
leaq 0x1268c(%rip), %rsi     # 0x85b28
callq 0x9530
movq %rax, -0x178(%rbp)
jmp 0x734aa
movq -0x178(%rbp), %rdi
movl -0xc4(%rbp), %esi
callq 0x9930
movq %rax, -0x180(%rbp)
jmp 0x734c5
movq -0x180(%rbp), %rdi
leaq 0x121a0(%rip), %rsi     # 0x85673
callq 0x9530
movq %rax, -0x188(%rbp)
jmp 0x734e1
leaq -0x38(%rbp), %rdi
callq 0x80680
movq -0x188(%rbp), %rdi
movq (%rax), %rsi
addq $0x90, %rsi
callq 0x9530
movq %rax, -0x190(%rbp)
jmp 0x73509
movq -0x190(%rbp), %rdi
leaq 0x11edb(%rip), %rsi     # 0x853f2
callq 0x9530
jmp 0x7351e
movq -0x118(%rbp), %rdi
addq $0x68, %rdi
leaq 0x11f2c(%rip), %rsi     # 0x8545c
callq 0x9530
movq %rax, -0x198(%rbp)
jmp 0x7353e
movq -0x198(%rbp), %rdi
movq -0x88(%rbp), %rax
movq -0x80(%rbp), %rcx
subq %rcx, %rax
cvtsi2sd %rax, %xmm0
movsd 0x10c18(%rip), %xmm1    # 0x84178
mulsd %xmm1, %xmm0
movsd 0x10c04(%rip), %xmm1    # 0x84170
divsd %xmm1, %xmm0
callq 0x9a30
jmp 0x73577
movq -0x118(%rbp), %rdi
addq $0x68, %rdi
leaq 0x11e8b(%rip), %rsi     # 0x85414
callq 0x9530
movq %rax, -0x1a0(%rbp)
jmp 0x73597
movq -0x1a0(%rbp), %rdi
movq -0x88(%rbp), %rax
movq -0x90(%rbp), %rcx
subq %rcx, %rax
cvtsi2sd %rax, %xmm0
movsd 0x10bbc(%rip), %xmm1    # 0x84178
mulsd %xmm1, %xmm0
movsd 0x10ba8(%rip), %xmm1    # 0x84170
divsd %xmm1, %xmm0
callq 0x9a30
movq %rax, -0x1a8(%rbp)
jmp 0x735da
movq -0x1a8(%rbp), %rdi
leaq 0x1121e(%rip), %rsi     # 0x84806
callq 0x9530
jmp 0x735ef
jmp 0x735f1
movq -0x88(%rbp), %rax
movq %rax, -0x90(%rbp)
movl $0x0, -0xc8(%rbp)
leaq -0x38(%rbp), %rdi
callq 0x803f0
movq %rax, -0xd0(%rbp)
leaq -0x38(%rbp), %rdi
callq 0x80450
movq %rax, -0xd8(%rbp)
leaq -0xd0(%rbp), %rdi
leaq -0xd8(%rbp), %rsi
callq 0x80420
movb %al, %cl
xorl %eax, %eax
testb $0x1, %cl
movb %al, -0x1a9(%rbp)
jne 0x7364d
jmp 0x7365f
movl -0xc8(%rbp), %eax
cmpl -0x14(%rbp), %eax
setl %al
movb %al, -0x1a9(%rbp)
movb -0x1a9(%rbp), %al
testb $0x1, %al
jne 0x7366b
jmp 0x736a7
leaq -0xd0(%rbp), %rdi
callq 0x80480
movq %rax, %rsi
leaq -0x68(%rbp), %rdi
callq 0x7ff70
jmp 0x73685
jmp 0x73687
leaq -0xd0(%rbp), %rdi
callq 0x80570
movl -0xc8(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xc8(%rbp)
jmp 0x73619
movl -0x14(%rbp), %eax
cmpl -0xc8(%rbp), %eax
jle 0x736bb
movl -0xc8(%rbp), %eax
movl %eax, -0x14(%rbp)
movq -0x70(%rbp), %rax
movq %rax, -0x1b8(%rbp)
leaq -0xf8(%rbp), %rdi
leaq -0x50(%rbp), %rsi
callq 0x805c0
jmp 0x736d8
leaq -0x110(%rbp), %rdi
leaq -0x68(%rbp), %rsi
callq 0x805c0
jmp 0x736ea
movq -0x1b8(%rbp), %rsi
movq -0x118(%rbp), %rdi
movsd -0xc0(%rbp), %xmm0
movl -0xc4(%rbp), %r9d
movl %r9d, %ecx
decl %ecx
movl -0x14(%rbp), %edx
movq %rsp, %rax
movl %edx, 0x8(%rax)
movl %ecx, (%rax)
leaq -0xf8(%rbp), %rdx
leaq -0x110(%rbp), %rcx
leaq -0x78(%rbp), %r8
movsd 0x10a7f(%rip), %xmm1    # 0x841b0
callq 0x742a0
movq %rax, -0x1c0(%rbp)
jmp 0x7373f
leaq -0x110(%rbp), %rdi
callq 0x7fd40
leaq -0xf8(%rbp), %rdi
callq 0x7fd40
movq -0x1c0(%rbp), %rax
movq %rax, -0xe0(%rbp)
cmpq $0x0, -0xe0(%rbp)
je 0x7386c
movq -0xe0(%rbp), %rax
movl $0x1, 0x80(%rax)
leaq -0x50(%rbp), %rdi
leaq -0xe0(%rbp), %rsi
callq 0x7ff70
jmp 0x73796
movq -0xe0(%rbp), %rax
cmpq $0x0, 0x88(%rax)
je 0x73814
movq -0xe0(%rbp), %rax
movq 0x88(%rax), %rax
movq %rax, -0x1c8(%rbp)
cmpq $0x0, %rax
je 0x737cf
movq -0x1c8(%rbp), %rdi
movq (%rdi), %rax
callq *0x8(%rax)
jmp 0x73814
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xa0(%rbp)
movl %eax, -0xa4(%rbp)
jmp 0x73803
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xa0(%rbp)
movl %eax, -0xa4(%rbp)
leaq -0x110(%rbp), %rdi
callq 0x7fd40
leaq -0xf8(%rbp), %rdi
callq 0x7fd40
jmp 0x74276
movq -0xe0(%rbp), %rax
movq $0x0, 0x88(%rax)
movq -0xe0(%rbp), %rax
movq 0x68(%rax), %rdi
callq 0x5ed10
movsd %xmm0, -0x1d0(%rbp)
jmp 0x73840
movsd -0x1d0(%rbp), %xmm0
addsd -0xc0(%rbp), %xmm0
movsd %xmm0, -0xc0(%rbp)
movq -0xe0(%rbp), %rax
movq 0x70(%rax), %rax
movq %rax, -0x70(%rbp)
jmp 0x73927
movl -0x94(%rbp), %eax
incl %eax
movl %eax, -0x94(%rbp)
movq 0x44767(%rip), %rdi     # 0xb7fe8
leaq 0x11bab(%rip), %rsi     # 0x85433
callq 0x9530
movq %rax, -0x1d8(%rbp)
jmp 0x73896
movq -0x1d8(%rbp), %rdi
movl -0xc4(%rbp), %esi
callq 0x9930
movq %rax, -0x1e0(%rbp)
jmp 0x738b1
movq -0x1e0(%rbp), %rdi
leaq 0x119fc(%rip), %rsi     # 0x852bb
callq 0x9530
jmp 0x738c6
movq -0x118(%rbp), %rax
cmpl $0x0, 0x60(%rax)
jle 0x73925
movq -0x118(%rbp), %rdi
addq $0x68, %rdi
leaq 0x11b45(%rip), %rsi     # 0x8542a
callq 0x9530
movq %rax, -0x1e8(%rbp)
jmp 0x738f3
movq -0x1e8(%rbp), %rdi
movl -0xc4(%rbp), %esi
callq 0x9930
movq %rax, -0x1f0(%rbp)
jmp 0x7390e
movq -0x1f0(%rbp), %rdi
leaq 0x10c09(%rip), %rsi     # 0x84525
callq 0x9530
jmp 0x73923
jmp 0x73925
jmp 0x73927
cmpl $0x0, -0x1c(%rbp)
je 0x73a81
callq 0x93c0
movq %rax, -0x88(%rbp)
movq 0x4464c(%rip), %rdi     # 0xb7f90
leaq 0x12214(%rip), %rsi     # 0x85b5f
callq 0x9530
movq %rax, -0x1f8(%rbp)
jmp 0x73959
movq -0x1f8(%rbp), %rdi
movl -0xc4(%rbp), %esi
callq 0x9930
movq %rax, -0x200(%rbp)
jmp 0x73974
movq -0x200(%rbp), %rdi
leaq 0x10c3c(%rip), %rsi     # 0x845be
callq 0x9530
movq %rax, -0x208(%rbp)
jmp 0x73990
leaq -0x38(%rbp), %rdi
callq 0x80680
movq -0x208(%rbp), %rdi
movq (%rax), %rsi
addq $0x90, %rsi
callq 0x9530
movq %rax, -0x210(%rbp)
jmp 0x739b8
movq -0x210(%rbp), %rdi
leaq 0xf79e(%rip), %rsi      # 0x83164
callq 0x9530
movq %rax, -0x218(%rbp)
jmp 0x739d4
movq -0x218(%rbp), %rdi
leaq 0x11a6a(%rip), %rsi     # 0x8544c
callq 0x9530
movq %rax, -0x220(%rbp)
jmp 0x739f0
movq -0x220(%rbp), %rdi
movl -0x94(%rbp), %esi
callq 0x9930
movq %rax, -0x228(%rbp)
jmp 0x73a0b
movq -0x228(%rbp), %rdi
leaq 0x11a41(%rip), %rsi     # 0x8545a
callq 0x9530
movq %rax, -0x230(%rbp)
jmp 0x73a27
movq -0x230(%rbp), %rdi
movq -0x88(%rbp), %rax
movq -0x90(%rbp), %rcx
subq %rcx, %rax
cvtsi2sd %rax, %xmm0
movsd 0x1072c(%rip), %xmm1    # 0x84178
mulsd %xmm1, %xmm0
movsd 0x10718(%rip), %xmm1    # 0x84170
divsd %xmm1, %xmm0
callq 0x9a30
movq %rax, -0x238(%rbp)
jmp 0x73a6a
movq -0x238(%rbp), %rdi
leaq 0x11843(%rip), %rsi     # 0x852bb
callq 0x9530
jmp 0x73a7f
jmp 0x73a81
leaq -0x38(%rbp), %rdi
callq 0x806b0
leaq -0x68(%rbp), %rdi
callq 0x80700
movl -0xc4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xc4(%rbp)
jmp 0x73456
movq -0x118(%rbp), %rax
cmpl $0x0, 0x60(%rax)
jle 0x73e39
movq -0x118(%rbp), %rdi
addq $0x68, %rdi
leaq 0x119a0(%rip), %rsi     # 0x8546a
callq 0x9530
movq %rax, -0x240(%rbp)
jmp 0x73ad8
callq 0x93c0
movq -0x240(%rbp), %rdi
movq -0x80(%rbp), %rcx
subq %rcx, %rax
cvtsi2sd %rax, %xmm0
movsd 0x10678(%rip), %xmm1    # 0x84170
divsd %xmm1, %xmm0
callq 0x9a30
movq %rax, -0x248(%rbp)
jmp 0x73b0a
movq -0x248(%rbp), %rdi
leaq 0x10bf3(%rip), %rsi     # 0x8470b
callq 0x9530
jmp 0x73b1f
movq -0x118(%rbp), %rdi
addq $0x68, %rdi
leaq 0x1195e(%rip), %rsi     # 0x8548f
callq 0x9530
movq %rax, -0x250(%rbp)
jmp 0x73b3f
movq -0x250(%rbp), %rdi
movq -0x118(%rbp), %rax
movq 0x278(%rax), %rsi
callq 0x99d0
movq %rax, -0x258(%rbp)
jmp 0x73b62
movq -0x258(%rbp), %rdi
leaq 0x1174b(%rip), %rsi     # 0x852bb
callq 0x9530
jmp 0x73b77
movq -0x118(%rbp), %rdi
addq $0x68, %rdi
leaq 0x11913(%rip), %rsi     # 0x8549c
callq 0x9530
movq %rax, -0x260(%rbp)
jmp 0x73b97
movq -0x260(%rbp), %rdi
movq -0x118(%rbp), %rax
movq 0x270(%rax), %rsi
callq 0x99d0
movq %rax, -0x268(%rbp)
jmp 0x73bba
movq -0x268(%rbp), %rdi
leaq 0x116f3(%rip), %rsi     # 0x852bb
callq 0x9530
jmp 0x73bcf
movq -0x118(%rbp), %rdi
addq $0x68, %rdi
leaq 0x118cb(%rip), %rsi     # 0x854ac
callq 0x9530
movq %rax, -0x270(%rbp)
jmp 0x73bef
movq -0x270(%rbp), %rdi
movq -0x118(%rbp), %rax
movq 0x288(%rax), %rsi
callq 0x99d0
movq %rax, -0x278(%rbp)
jmp 0x73c12
movq -0x278(%rbp), %rdi
leaq 0x1169b(%rip), %rsi     # 0x852bb
callq 0x9530
jmp 0x73c27
movq -0x118(%rbp), %rdi
addq $0x68, %rdi
leaq 0x11883(%rip), %rsi     # 0x854bc
callq 0x9530
movq %rax, -0x280(%rbp)
jmp 0x73c47
movq -0x280(%rbp), %rdi
movq -0x118(%rbp), %rax
movq 0x290(%rax), %rsi
callq 0x99d0
movq %rax, -0x288(%rbp)
jmp 0x73c6a
movq -0x288(%rbp), %rdi
leaq 0x11643(%rip), %rsi     # 0x852bb
callq 0x9530
jmp 0x73c7f
movq -0x118(%rbp), %rdi
addq $0x68, %rdi
leaq 0x1183d(%rip), %rsi     # 0x854ce
callq 0x9530
movq %rax, -0x290(%rbp)
jmp 0x73c9f
movq -0x290(%rbp), %rdi
movq -0x118(%rbp), %rax
movq 0x298(%rax), %rsi
callq 0x99d0
movq %rax, -0x298(%rbp)
jmp 0x73cc2
movq -0x298(%rbp), %rdi
leaq 0x115eb(%rip), %rsi     # 0x852bb
callq 0x9530
jmp 0x73cd7
movq -0x118(%rbp), %rdi
addq $0x68, %rdi
leaq 0x117fd(%rip), %rsi     # 0x854e6
callq 0x9530
movq %rax, -0x2a0(%rbp)
jmp 0x73cf7
movq -0x2a0(%rbp), %rdi
movq -0x118(%rbp), %rax
movq 0x280(%rax), %rsi
callq 0x99d0
movq %rax, -0x2a8(%rbp)
jmp 0x73d1a
movq -0x2a8(%rbp), %rdi
leaq 0x11593(%rip), %rsi     # 0x852bb
callq 0x9530
jmp 0x73d2f
movq -0x118(%rbp), %rdi
addq $0x68, %rdi
leaq 0x117b4(%rip), %rsi     # 0x854f5
callq 0x9530
movq %rax, -0x2b0(%rbp)
jmp 0x73d4f
movq -0x2b0(%rbp), %rdi
movq -0x118(%rbp), %rax
movq 0x2a0(%rax), %rsi
callq 0x99d0
movq %rax, -0x2b8(%rbp)
jmp 0x73d72
movq -0x2b8(%rbp), %rdi
leaq 0x1153b(%rip), %rsi     # 0x852bb
callq 0x9530
jmp 0x73d87
movq -0x118(%rbp), %rdi
addq $0x68, %rdi
leaq 0x11767(%rip), %rsi     # 0x85500
callq 0x9530
movq %rax, -0x2c0(%rbp)
jmp 0x73da7
movq -0x2c0(%rbp), %rdi
movq -0x118(%rbp), %rax
movq 0x2a8(%rax), %rsi
callq 0x99d0
movq %rax, -0x2c8(%rbp)
jmp 0x73dca
movq -0x2c8(%rbp), %rdi
leaq 0x114e3(%rip), %rsi     # 0x852bb
callq 0x9530
jmp 0x73ddf
movq -0x118(%rbp), %rdi
addq $0x68, %rdi
leaq 0x1171c(%rip), %rsi     # 0x8550d
callq 0x9530
movq %rax, -0x2d0(%rbp)
jmp 0x73dff
movq -0x2d0(%rbp), %rdi
movq -0x118(%rbp), %rax
movq 0x2b0(%rax), %rsi
callq 0x99d0
movq %rax, -0x2d8(%rbp)
jmp 0x73e22
movq -0x2d8(%rbp), %rdi
leaq 0x1148b(%rip), %rsi     # 0x852bb
callq 0x9530
jmp 0x73e37
jmp 0x73e39
cmpl $0x0, -0x1c(%rbp)
je 0x74239
movq 0x44146(%rip), %rdi     # 0xb7f90
leaq 0x116c9(%rip), %rsi     # 0x8551a
callq 0x9530
movq %rax, -0x2e0(%rbp)
jmp 0x73e5f
movq -0x2e0(%rbp), %rdi
movsd -0x78(%rbp), %xmm0
callq 0x9a30
movq %rax, -0x2e8(%rbp)
jmp 0x73e79
movq -0x2e8(%rbp), %rdi
leaq 0x115f9(%rip), %rsi     # 0x85480
callq 0x9530
movq %rax, -0x2f0(%rbp)
jmp 0x73e95
callq 0x93c0
movq -0x2f0(%rbp), %rdi
movq -0x80(%rbp), %rcx
subq %rcx, %rax
cvtsi2sd %rax, %xmm0
movsd 0x102bb(%rip), %xmm1    # 0x84170
divsd %xmm1, %xmm0
callq 0x9a30
movq %rax, -0x2f8(%rbp)
jmp 0x73ec7
movq -0x2f8(%rbp), %rdi
leaq 0x113e6(%rip), %rsi     # 0x852bb
callq 0x9530
jmp 0x73edc
movq 0x440ad(%rip), %rdi     # 0xb7f90
leaq 0x1164d(%rip), %rsi     # 0x85537
callq 0x9530
jmp 0x73ef1
movq 0x44098(%rip), %rdi     # 0xb7f90
leaq 0x1164d(%rip), %rsi     # 0x8554c
callq 0x9530
movq %rax, -0x300(%rbp)
jmp 0x73f0d
movq -0x300(%rbp), %rdi
movq -0x118(%rbp), %rax
movq 0x270(%rax), %rsi
callq 0x99d0
movq %rax, -0x308(%rbp)
jmp 0x73f30
movq -0x308(%rbp), %rdi
leaq 0x1137d(%rip), %rsi     # 0x852bb
callq 0x9530
jmp 0x73f45
movq 0x44044(%rip), %rdi     # 0xb7f90
leaq 0x11608(%rip), %rsi     # 0x8555b
callq 0x9530
movq %rax, -0x310(%rbp)
jmp 0x73f61
movq -0x310(%rbp), %rdi
movq -0x118(%rbp), %rax
movq 0x278(%rax), %rsi
callq 0x99d0
movq %rax, -0x318(%rbp)
jmp 0x73f84
movq -0x318(%rbp), %rdi
leaq 0x11329(%rip), %rsi     # 0x852bb
callq 0x9530
jmp 0x73f99
movq 0x43ff0(%rip), %rdi     # 0xb7f90
leaq 0x1153f(%rip), %rsi     # 0x854e6
callq 0x9530
movq %rax, -0x320(%rbp)
jmp 0x73fb5
movq -0x320(%rbp), %rdi
movq -0x118(%rbp), %rax
movq 0x280(%rax), %rsi
callq 0x99d0
movq %rax, -0x328(%rbp)
jmp 0x73fd8
movq -0x328(%rbp), %rdi
leaq 0x112d5(%rip), %rsi     # 0x852bb
callq 0x9530
jmp 0x73fed
movq 0x43f9c(%rip), %rdi     # 0xb7f90
leaq 0x1156c(%rip), %rsi     # 0x85567
callq 0x9530
movq %rax, -0x330(%rbp)
jmp 0x74009
movq -0x330(%rbp), %rdi
movq -0x118(%rbp), %rax
movq 0x288(%rax), %rsi
callq 0x99d0
movq %rax, -0x338(%rbp)
jmp 0x7402c
movq -0x338(%rbp), %rdi
leaq 0x11281(%rip), %rsi     # 0x852bb
callq 0x9530
jmp 0x74041
movq 0x43f48(%rip), %rdi     # 0xb7f90
leaq 0x11527(%rip), %rsi     # 0x85576
callq 0x9530
movq %rax, -0x340(%rbp)
jmp 0x7405d
movq -0x340(%rbp), %rdi
movq -0x118(%rbp), %rax
movq 0x290(%rax), %rsi
callq 0x99d0
movq %rax, -0x348(%rbp)
jmp 0x74080
movq -0x348(%rbp), %rdi
leaq 0x1122d(%rip), %rsi     # 0x852bb
callq 0x9530
jmp 0x74095
movq 0x43ef4(%rip), %rdi     # 0xb7f90
leaq 0x114e4(%rip), %rsi     # 0x85587
callq 0x9530
movq %rax, -0x350(%rbp)
jmp 0x740b1
movq -0x350(%rbp), %rdi
movq -0x118(%rbp), %rax
movq 0x298(%rax), %rsi
callq 0x99d0
movq %rax, -0x358(%rbp)
jmp 0x740d4
movq -0x358(%rbp), %rdi
leaq 0x111d9(%rip), %rsi     # 0x852bb
callq 0x9530
jmp 0x740e9
movq 0x43ea0(%rip), %rdi     # 0xb7f90
leaq 0x113fe(%rip), %rsi     # 0x854f5
callq 0x9530
movq %rax, -0x360(%rbp)
jmp 0x74105
movq -0x360(%rbp), %rdi
movq -0x118(%rbp), %rax
movq 0x2a0(%rax), %rsi
callq 0x99d0
movq %rax, -0x368(%rbp)
jmp 0x74128
movq -0x368(%rbp), %rdi
leaq 0x11185(%rip), %rsi     # 0x852bb
callq 0x9530
jmp 0x7413d
movq 0x43e4c(%rip), %rdi     # 0xb7f90
leaq 0x113b5(%rip), %rsi     # 0x85500
callq 0x9530
movq %rax, -0x370(%rbp)
jmp 0x74159
movq -0x370(%rbp), %rdi
movq -0x118(%rbp), %rax
movq 0x2a8(%rax), %rsi
callq 0x99d0
movq %rax, -0x378(%rbp)
jmp 0x7417c
movq -0x378(%rbp), %rdi
leaq 0x11131(%rip), %rsi     # 0x852bb
callq 0x9530
jmp 0x74191
movq 0x43df8(%rip), %rdi     # 0xb7f90
leaq 0x1136e(%rip), %rsi     # 0x8550d
callq 0x9530
movq %rax, -0x380(%rbp)
jmp 0x741ad
movq -0x380(%rbp), %rdi
movq -0x118(%rbp), %rax
movq 0x2b0(%rax), %rsi
callq 0x99d0
movq %rax, -0x388(%rbp)
jmp 0x741d0
movq -0x388(%rbp), %rdi
leaq 0x110dd(%rip), %rsi     # 0x852bb
callq 0x9530
jmp 0x741e5
cmpl $0x0, -0x94(%rbp)
jne 0x74205
movq 0x43d9b(%rip), %rdi     # 0xb7f90
leaq 0x113a2(%rip), %rsi     # 0x8559e
callq 0x9530
jmp 0x74203
jmp 0x74237
movl -0x94(%rbp), %esi
movq 0x43d7e(%rip), %rdi     # 0xb7f90
callq 0x9930
movq %rax, -0x390(%rbp)
jmp 0x74220
movq -0x390(%rbp), %rdi
leaq 0x1139d(%rip), %rsi     # 0x855cb
callq 0x9530
jmp 0x74235
jmp 0x74237
jmp 0x74239
movsd -0x78(%rbp), %xmm0
movsd %xmm0, -0x8(%rbp)
movl $0x1, -0xb4(%rbp)
leaq -0x68(%rbp), %rdi
callq 0x7fd40
leaq -0x50(%rbp), %rdi
callq 0x7fd40
leaq -0x38(%rbp), %rdi
callq 0x7fd40
movsd -0x8(%rbp), %xmm0
addq $0x3a0, %rsp            # imm = 0x3A0
popq %rbp
retq
leaq -0x68(%rbp), %rdi
callq 0x7fd40
leaq -0x50(%rbp), %rdi
callq 0x7fd40
leaq -0x38(%rbp), %rdi
callq 0x7fd40
movq -0xa0(%rbp), %rdi
callq 0x9960
nopl (%rax)