// File: /workspace/github_cpp_makefile_star2_O3/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xc8, %rsp
movl %ecx, 0x24(%rsp)
movl %edx, %ebp
movl %esi, %r13d
movq %rdi, %rbx
leaq 0x20(%rdi), %rsi
leaq 0x30(%rsp), %rdi
callq 0x3b844
leaq 0x80(%rsp), %rcx
movq %rcx, 0x8(%rcx)
movq %rcx, (%rcx)
xorl %eax, %eax
movq %rax, 0x10(%rcx)
leaq 0x48(%rsp), %r12
movq %r12, 0x8(%r12)
movq %r12, (%r12)
movq %rax, 0x10(%r12)
movabsq $0x54b249ad2594c37d, %rax # imm = 0x54B249AD2594C37D
movq %rax, 0x70(%rsp)
callq 0x72f0
movq %rax, 0x28(%rsp)
movq %rbx, (%rsp)
cmpl $0x0, 0x60(%rbx)
jle 0x34fc9
movq (%rsp), %rax
leaq 0x68(%rax), %rbx
leaq 0xa3a9(%rip), %rsi      # 0x3f2ce
movl $0x6, %edx
movq %rbx, %rdi
callq 0x74e0
movq (%rsp), %rdx
movq 0x68(%rdx), %rax
movq -0x18(%rax), %rax
movl $0xfffffefb, %ecx       # imm = 0xFFFFFEFB
andl 0x80(%rdx,%rax), %ecx
orl $0x4, %ecx
movl %ecx, 0x80(%rdx,%rax)
movq 0x28(%rsp), %rax
subq 0x268(%rdx), %rax
cvtsi2sd %rax, %xmm0
mulsd 0x70a3(%rip), %xmm0     # 0x3c010
divsd 0x92d3(%rip), %xmm0     # 0x3e248
movq %rbx, %rdi
callq 0x7690
movq %rax, %rbx
leaq 0xa34e(%rip), %rsi      # 0x3f2d5
movl $0x2f, %edx
movq %rax, %rdi
callq 0x74e0
movq %rbx, %rdi
movl %r13d, %esi
callq 0x7720
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x7400
movsbl %al, %esi
movq %rbx, %rdi
callq 0x7050
movq %rax, %rdi
callq 0x7310
movq 0x30(%rsp), %rbx
movq 0x10(%rbx), %r14
decq 0x40(%rsp)
movq %rbx, %rdi
callq 0x76b0
movl $0x18, %esi
movq %rbx, %rdi
callq 0x7450
movq (%rsp), %rax
cmpl $0x0, 0x60(%rax)
jle 0x35043
movq (%rsp), %rax
leaq 0x68(%rax), %rbx
leaq 0xa300(%rip), %rsi      # 0x3f305
movl $0x1f, %edx
movq %rbx, %rdi
callq 0x74e0
leaq 0x90(%r14), %r15
movq %r15, %rdi
callq 0x71d0
movq %rbx, %rdi
movq %r15, %rsi
movq %rax, %rdx
callq 0x74e0
leaq 0xa2ef(%rip), %rsi      # 0x3f325
movl $0xe, %edx
movq %rbx, %rdi
callq 0x74e0
movq 0x68(%r14), %rsi
movsd 0x9231(%rip), %xmm0     # 0x3e280
movq (%rsp), %rdi
movl %ebp, %edx
callq 0x31fcc
movq %rax, 0x78(%r14)
testq %rax, %rax
jne 0x35087
movq 0x68(%r14), %rsi
movsd 0x9219(%rip), %xmm0     # 0x3e288
movq (%rsp), %rdi
movl %ebp, %edx
callq 0x31fcc
movq %rax, 0x78(%r14)
testq %rax, %rax
je 0x35c01
movq %rax, %rdi
callq 0x2870c
movq 0x78(%r14), %rdi
callq 0x28f40
movl $0x1, 0x80(%r14)
movq 0x78(%r14), %rdi
callq 0x266bc
movsd %xmm0, 0x68(%rsp)
movq 0x78(%r14), %rdi
callq 0x27c4e
movq %rax, %r15
movq %rax, 0x70(%r14)
movl $0x18, %edi
callq 0x7440
movq %r14, 0x10(%rax)
leaq 0x80(%rsp), %rbx
movq %rax, %rdi
movq %rbx, %rsi
callq 0x7080
incq 0x10(%rbx)
leaq 0x30(%rsp), %rax
cmpq %rax, 0x30(%rsp)
je 0x355b5
movq %r15, 0x78(%rsp)
movq (%rsp), %rax
addq $0x68, %rax
movq %rax, 0x18(%rsp)
movl $0x0, 0x14(%rsp)
movl $0x1, %eax
movq %rax, 0x8(%rsp)
leaq 0xb0(%rsp), %r12
leaq 0x98(%rsp), %rbp
movq 0x28(%rsp), %r14
callq 0x72f0
movq %rax, 0x60(%rsp)
movq (%rsp), %rax
cmpl $0x0, 0x60(%rax)
jle 0x35252
movl $0x36, %edx
movq 0x18(%rsp), %rdi
leaq 0xa9cd(%rip), %rsi      # 0x3fb26
callq 0x74e0
movq 0x18(%rsp), %rdi
movq 0x8(%rsp), %rsi
callq 0x7720
movq %rax, %rbx
movl $0x2, %edx
movq %rax, %rdi
leaq 0xa4f2(%rip), %rsi      # 0x3f671
callq 0x74e0
movq 0x30(%rsp), %rax
movq 0x10(%rax), %r15
movl $0x90, %eax
addq %rax, %r15
movq %r15, %rdi
callq 0x71d0
movq %rbx, %rdi
movq %r15, %rsi
movq %rax, %rdx
callq 0x74e0
movl $0x21, %edx
movq %rbx, %rdi
leaq 0xa236(%rip), %rsi      # 0x3f3f0
callq 0x74e0
movl $0xd, %edx
movq 0x18(%rsp), %rdi
leaq 0xa28a(%rip), %rsi      # 0x3f45a
callq 0x74e0
movq 0x60(%rsp), %rax
subq 0x28(%rsp), %rax
cvtsi2sd %rax, %xmm0
mulsd 0x6e24(%rip), %xmm0     # 0x3c010
divsd 0x9054(%rip), %xmm0     # 0x3e248
movq 0x18(%rsp), %rdi
callq 0x7690
movl $0x15, %edx
movq 0x18(%rsp), %rdi
leaq 0xa203(%rip), %rsi      # 0x3f412
callq 0x74e0
movq 0x60(%rsp), %rax
subq %r14, %rax
xorps %xmm0, %xmm0
cvtsi2sd %rax, %xmm0
mulsd 0x6de4(%rip), %xmm0     # 0x3c010
divsd 0x9014(%rip), %xmm0     # 0x3e248
movq 0x18(%rsp), %rdi
callq 0x7690
movl $0x3, %edx
movq %rax, %rdi
leaq 0x95cd(%rip), %rsi      # 0x3e81a
callq 0x74e0
movq 0x30(%rsp), %r14
xorl %ebx, %ebx
leaq 0x30(%rsp), %rax
cmpq %rax, %r14
je 0x352a2
testl %r13d, %r13d
jle 0x352a2
xorl %ebx, %ebx
movl $0x18, %edi
callq 0x7440
movq 0x10(%r14), %rcx
movq %rcx, 0x10(%rax)
movq %rax, %rdi
leaq 0x48(%rsp), %rsi
callq 0x7080
incq 0x58(%rsp)
incl %ebx
movq (%r14), %r14
leaq 0x30(%rsp), %rax
cmpq %rax, %r14
je 0x352a2
cmpl %r13d, %ebx
jl 0x3526a
cmpl %r13d, %ebx
cmovll %ebx, %r13d
movq %r12, %rdi
leaq 0x80(%rsp), %rsi
callq 0x3b844
movq %rbp, %rdi
leaq 0x48(%rsp), %rsi
callq 0x3b844
movq 0x8(%rsp), %r9
leal -0x1(%r9), %eax
movq (%rsp), %rdi
movq 0x78(%rsp), %rsi
movq %r12, %rdx
movq %rbp, %rcx
movsd 0x68(%rsp), %xmm0
leaq 0x70(%rsp), %r8
movsd 0x8f87(%rip), %xmm1     # 0x3e278
pushq %r13
pushq %rax
callq 0x35d48
addq $0x10, %rsp
movq %rax, %rbx
movq 0x98(%rsp), %rdi
cmpq %rbp, %rdi
je 0x35322
movq (%rdi), %r14
movl $0x18, %esi
callq 0x7450
movq %r14, %rdi
cmpq %rbp, %r14
jne 0x3530d
movq 0xb0(%rsp), %rdi
cmpq %r12, %rdi
je 0x35344
movq (%rdi), %r14
movl $0x18, %esi
callq 0x7450
movq %r14, %rdi
cmpq %r12, %r14
jne 0x3532f
testq %rbx, %rbx
je 0x353bd
movl $0x1, 0x80(%rbx)
movl $0x18, %edi
callq 0x7440
movq %rbx, 0x10(%rax)
movq %rax, %rdi
leaq 0x80(%rsp), %rsi
callq 0x7080
incq 0x90(%rsp)
movq 0x88(%rbx), %rdi
testq %rdi, %rdi
je 0x3538b
movq (%rdi), %rax
callq *0x8(%rax)
movq $0x0, 0x88(%rbx)
movq 0x68(%rbx), %rdi
callq 0x266bc
movsd 0x68(%rsp), %xmm1
addsd %xmm0, %xmm1
movsd %xmm1, 0x68(%rsp)
movq 0x70(%rbx), %rax
movq %rax, 0x78(%rsp)
jmp 0x35441
movl $0x18, %edx
movq 0x1bc17(%rip), %rdi     # 0x50fe0
leaq 0xa061(%rip), %rsi      # 0x3f431
callq 0x74e0
movq 0x1bc04(%rip), %rdi     # 0x50fe0
movq 0x8(%rsp), %rsi
callq 0x7720
movl $0x1, %edx
movq %rax, %rdi
leaq 0x9ed7(%rip), %rsi      # 0x3f2cc
callq 0x74e0
incl 0x14(%rsp)
movq (%rsp), %rax
cmpl $0x0, 0x60(%rax)
jle 0x35441
movl $0x21, %edx
movq 0x18(%rsp), %rdi
leaq 0xa00f(%rip), %rsi      # 0x3f428
callq 0x74e0
movq 0x18(%rsp), %rdi
movq 0x8(%rsp), %rsi
callq 0x7720
movl $0xb, %edx
movq %rax, %rdi
leaq 0x90fd(%rip), %rsi      # 0x3e539
callq 0x74e0
cmpl $0x0, 0x24(%rsp)
je 0x3553c
callq 0x72f0
movq %rax, %rbx
movl $0x17, %edx
movq 0x1bb30(%rip), %rdi     # 0x50f90
leaq 0xa6f6(%rip), %rsi      # 0x3fb5d
callq 0x74e0
movq 0x1bb1d(%rip), %rdi     # 0x50f90
movq 0x8(%rsp), %rsi
callq 0x7720
movq %rax, %r15
movl $0x1, %edx
movq %rax, %rdi
leaq 0x9143(%rip), %rsi      # 0x3e5d2
callq 0x74e0
movq 0x30(%rsp), %rax
movq 0x10(%rax), %r14
movl $0x90, %eax
addq %rax, %r14
movq %r14, %rdi
callq 0x71d0
movq %r15, %rdi
movq %r14, %rsi
movq %rax, %rdx
callq 0x74e0
movl $0x1, %edx
movq %r15, %rdi
leaq 0x7c2e(%rip), %rsi      # 0x3d0f8
callq 0x74e0
movl $0xd, %edx
movq %r15, %rdi
leaq 0x9f6c(%rip), %rsi      # 0x3f44a
callq 0x74e0
movq %r15, %rdi
movl 0x14(%rsp), %esi
callq 0x7720
movq %rax, %r15
movl $0xf, %edx
movq %rax, %rdi
leaq 0x9f57(%rip), %rsi      # 0x3f458
callq 0x74e0
subq 0x60(%rsp), %rbx
cvtsi2sd %rbx, %xmm0
mulsd 0x6af8(%rip), %xmm0     # 0x3c010
divsd 0x8d28(%rip), %xmm0     # 0x3e248
movq %r15, %rdi
callq 0x7690
movl $0x1, %edx
movq %rax, %rdi
leaq 0x9d95(%rip), %rsi      # 0x3f2cc
callq 0x74e0
movq 0x30(%rsp), %rbx
decq 0x40(%rsp)
movq %rbx, %rdi
callq 0x76b0
movl $0x18, %esi
movq %rbx, %rdi
callq 0x7450
movq 0x48(%rsp), %rdi
leaq 0x48(%rsp), %r14
cmpq %r14, %rdi
je 0x3557f
movq (%rdi), %rbx
movl $0x18, %esi
callq 0x7450
movq %rbx, %rdi
cmpq %r14, %rbx
jne 0x3556a
movq %r14, 0x50(%rsp)
movq %r14, 0x48(%rsp)
movq $0x0, 0x58(%rsp)
movq 0x8(%rsp), %rax
incl %eax
movq %rax, 0x8(%rsp)
movq 0x60(%rsp), %r14
leaq 0x30(%rsp), %rax
cmpq %rax, 0x30(%rsp)
jne 0x35130
jmp 0x355bd
movl $0x0, 0x14(%rsp)
movq (%rsp), %rax
cmpl $0x0, 0x60(%rax)
leaq 0x48(%rsp), %r12
movl 0x14(%rsp), %ebp
jle 0x35839
movq (%rsp), %rax
leaq 0x68(%rax), %r15
leaq 0x9e85(%rip), %rsi      # 0x3f468
movl $0x24, %edx
movq %r15, %rdi
callq 0x74e0
callq 0x72f0
subq 0x28(%rsp), %rax
xorps %xmm0, %xmm0
cvtsi2sd %rax, %xmm0
divsd 0x8c3e(%rip), %xmm0     # 0x3e248
movq %r15, %rdi
callq 0x7690
leaq 0x9106(%rip), %rsi      # 0x3e71f
movl $0x2, %edx
movq %rax, %rdi
callq 0x74e0
leaq 0x9e60(%rip), %rsi      # 0x3f48d
movl $0xc, %edx
movq %r15, %rdi
callq 0x74e0
movq (%rsp), %rax
movq 0x278(%rax), %rsi
movq %r15, %rdi
callq 0x73e0
leaq 0x9c78(%rip), %rsi      # 0x3f2cc
movl $0x1, %edx
movq %rax, %rdi
callq 0x74e0
leaq 0x9e32(%rip), %rsi      # 0x3f49a
movl $0xf, %edx
movq %r15, %rdi
callq 0x74e0
movq (%rsp), %rax
movq 0x270(%rax), %rsi
movq %r15, %rdi
callq 0x73e0
leaq 0x9c3d(%rip), %rsi      # 0x3f2cc
movl $0x1, %edx
movq %rax, %rdi
callq 0x74e0
leaq 0x9e07(%rip), %rsi      # 0x3f4aa
movl $0xf, %edx
movq %r15, %rdi
callq 0x74e0
movq (%rsp), %rax
movq 0x288(%rax), %rsi
movq %r15, %rdi
callq 0x73e0
leaq 0x9c02(%rip), %rsi      # 0x3f2cc
movl $0x1, %edx
movq %rax, %rdi
callq 0x74e0
leaq 0x9ddc(%rip), %rsi      # 0x3f4ba
movl $0x11, %edx
movq %r15, %rdi
callq 0x74e0
movq (%rsp), %rax
movq 0x290(%rax), %rsi
movq %r15, %rdi
callq 0x73e0
leaq 0x9bc7(%rip), %rsi      # 0x3f2cc
movl $0x1, %edx
movq %rax, %rdi
callq 0x74e0
leaq 0x9db3(%rip), %rsi      # 0x3f4cc
movl $0x17, %edx
movq %r15, %rdi
callq 0x74e0
movq (%rsp), %rax
movq 0x298(%rax), %rsi
movq %r15, %rdi
callq 0x73e0
leaq 0x9b8c(%rip), %rsi      # 0x3f2cc
movl $0x1, %edx
movq %rax, %rdi
callq 0x74e0
leaq 0x9d90(%rip), %rsi      # 0x3f4e4
movl $0xe, %edx
movq %r15, %rdi
callq 0x74e0
movq (%rsp), %rax
movq 0x280(%rax), %rsi
movq %r15, %rdi
callq 0x73e0
leaq 0x9b51(%rip), %rsi      # 0x3f2cc
movl $0x1, %edx
movq %rax, %rdi
callq 0x74e0
leaq 0x9d64(%rip), %rsi      # 0x3f4f3
movl $0xa, %edx
movq %r15, %rdi
callq 0x74e0
movq (%rsp), %rax
movq 0x2a0(%rax), %rsi
movq %r15, %rdi
callq 0x73e0
leaq 0x9b16(%rip), %rsi      # 0x3f2cc
movl $0x1, %edx
movq %rax, %rdi
callq 0x74e0
leaq 0x9d34(%rip), %rsi      # 0x3f4fe
movl $0xc, %edx
movq %r15, %rdi
callq 0x74e0
movq (%rsp), %rax
movq 0x2a8(%rax), %rsi
movq %r15, %rdi
callq 0x73e0
leaq 0x9adb(%rip), %rsi      # 0x3f2cc
movl $0x1, %edx
movq %rax, %rdi
callq 0x74e0
leaq 0x9d06(%rip), %rsi      # 0x3f50b
movl $0xc, %edx
movq %r15, %rdi
callq 0x74e0
movq (%rsp), %rax
movq 0x2b0(%rax), %rsi
movq %r15, %rdi
callq 0x73e0
leaq 0x9aa0(%rip), %rsi      # 0x3f2cc
movl $0x1, %edx
movq %rax, %rdi
callq 0x74e0
cmpl $0x0, 0x24(%rsp)
je 0x35b5a
movq 0x1b745(%rip), %rdi     # 0x50f90
leaq 0x9cc6(%rip), %rsi      # 0x3f518
movl $0x1c, %edx
callq 0x74e0
movsd 0x70(%rsp), %xmm0
movq 0x1b727(%rip), %rdi     # 0x50f90
movsd %xmm0, 0x8(%rsp)
callq 0x7690
movq %rax, %rbx
leaq 0x9c00(%rip), %rsi      # 0x3f47e
movl $0xe, %edx
movq %rax, %rdi
callq 0x74e0
callq 0x72f0
subq 0x28(%rsp), %rax
xorps %xmm0, %xmm0
cvtsi2sd %rax, %xmm0
divsd 0x89a3(%rip), %xmm0     # 0x3e248
movq %rbx, %rdi
callq 0x7690
leaq 0x9a18(%rip), %rsi      # 0x3f2cc
movl $0x1, %edx
movq %rax, %rdi
callq 0x74e0
movq 0x1b6c8(%rip), %rdi     # 0x50f90
leaq 0x9c66(%rip), %rsi      # 0x3f535
movl $0x14, %edx
callq 0x74e0
movq 0x1b6b0(%rip), %rdi     # 0x50f90
leaq 0x9c63(%rip), %rsi      # 0x3f54a
movl $0xe, %edx
callq 0x74e0
movq (%rsp), %rax
movq 0x270(%rax), %rsi
movq 0x1b68d(%rip), %rdi     # 0x50f90
callq 0x73e0
leaq 0x99bd(%rip), %rsi      # 0x3f2cc
movl $0x1, %edx
movq %rax, %rdi
callq 0x74e0
movq 0x1b66d(%rip), %rdi     # 0x50f90
leaq 0x9c2f(%rip), %rsi      # 0x3f559
movl $0xb, %edx
callq 0x74e0
movq (%rsp), %rax
movq 0x278(%rax), %rsi
movq 0x1b64a(%rip), %rdi     # 0x50f90
callq 0x73e0
leaq 0x997a(%rip), %rsi      # 0x3f2cc
movl $0x1, %edx
movq %rax, %rdi
callq 0x74e0
movq 0x1b62a(%rip), %rdi     # 0x50f90
leaq 0x9b77(%rip), %rsi      # 0x3f4e4
movl $0xe, %edx
callq 0x74e0
movq (%rsp), %rax
movq 0x280(%rax), %rsi
movq 0x1b607(%rip), %rdi     # 0x50f90
callq 0x73e0
leaq 0x9937(%rip), %rsi      # 0x3f2cc
movl $0x1, %edx
movq %rax, %rdi
callq 0x74e0
movq 0x1b5e7(%rip), %rdi     # 0x50f90
leaq 0x9bb5(%rip), %rsi      # 0x3f565
movl $0xe, %edx
callq 0x74e0
movq (%rsp), %rax
movq 0x288(%rax), %rsi
movq 0x1b5c4(%rip), %rdi     # 0x50f90
callq 0x73e0
leaq 0x98f4(%rip), %rsi      # 0x3f2cc
movl $0x1, %edx
movq %rax, %rdi
callq 0x74e0
movq 0x1b5a4(%rip), %rdi     # 0x50f90
leaq 0x9b81(%rip), %rsi      # 0x3f574
movl $0x10, %edx
callq 0x74e0
movq (%rsp), %rax
movq 0x290(%rax), %rsi
movq 0x1b581(%rip), %rdi     # 0x50f90
callq 0x73e0
leaq 0x98b1(%rip), %rsi      # 0x3f2cc
movl $0x1, %edx
movq %rax, %rdi
callq 0x74e0
movq 0x1b561(%rip), %rdi     # 0x50f90
leaq 0x9b4f(%rip), %rsi      # 0x3f585
movl $0x16, %edx
callq 0x74e0
movq (%rsp), %rax
movq 0x298(%rax), %rsi
movq 0x1b53e(%rip), %rdi     # 0x50f90
callq 0x73e0
leaq 0x986e(%rip), %rsi      # 0x3f2cc
movl $0x1, %edx
movq %rax, %rdi
callq 0x74e0
movq 0x1b51e(%rip), %rdi     # 0x50f90
leaq 0x9a7a(%rip), %rsi      # 0x3f4f3
movl $0xa, %edx
callq 0x74e0
movq (%rsp), %rax
movq 0x2a0(%rax), %rsi
movq 0x1b4fb(%rip), %rdi     # 0x50f90
callq 0x73e0
leaq 0x982b(%rip), %rsi      # 0x3f2cc
movl $0x1, %edx
movq %rax, %rdi
callq 0x74e0
movq 0x1b4db(%rip), %rdi     # 0x50f90
leaq 0x9a42(%rip), %rsi      # 0x3f4fe
movl $0xc, %edx
callq 0x74e0
movq (%rsp), %rax
movq 0x2a8(%rax), %rsi
movq 0x1b4b8(%rip), %rdi     # 0x50f90
callq 0x73e0
leaq 0x97e8(%rip), %rsi      # 0x3f2cc
movl $0x1, %edx
movq %rax, %rdi
callq 0x74e0
movq 0x1b498(%rip), %rdi     # 0x50f90
leaq 0x9a0c(%rip), %rsi      # 0x3f50b
movl $0xc, %edx
callq 0x74e0
movq (%rsp), %rax
movq 0x2b0(%rax), %rsi
movq 0x1b475(%rip), %rbx     # 0x50f90
movq %rbx, %rdi
callq 0x73e0
leaq 0x97a2(%rip), %rsi      # 0x3f2cc
movl $0x1, %edx
movq %rax, %rdi
callq 0x74e0
testl %ebp, %ebp
je 0x35b68
movq 0x1b44e(%rip), %rdi     # 0x50f90
movl %ebp, %esi
callq 0x7720
movq %rax, %rbx
movl $0x25, %edx
leaq 0x9a71(%rip), %rsi      # 0x3f5c9
jmp 0x35b74
movsd 0x70(%rsp), %xmm0
movsd %xmm0, 0x8(%rsp)
jmp 0x35b7c
movl $0x2c, %edx
leaq 0x9a28(%rip), %rsi      # 0x3f59c
movq %rbx, %rdi
callq 0x74e0
movq 0x48(%rsp), %rdi
cmpq %r12, %rdi
je 0x35b9b
movq (%rdi), %rbx
movl $0x18, %esi
callq 0x7450
movq %rbx, %rdi
cmpq %r12, %rbx
jne 0x35b86
movq 0x80(%rsp), %rdi
leaq 0x80(%rsp), %r14
cmpq %r14, %rdi
je 0x35bc5
movq (%rdi), %rbx
movl $0x18, %esi
callq 0x7450
movq %rbx, %rdi
cmpq %r14, %rbx
jne 0x35bb0
movq 0x30(%rsp), %rdi
leaq 0x30(%rsp), %r14
cmpq %r14, %rdi
je 0x35be9
movq (%rdi), %rbx
movl $0x18, %esi
callq 0x7450
movq %rbx, %rdi
cmpq %r14, %rbx
jne 0x35bd4
movsd 0x8(%rsp), %xmm0
addq $0xc8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x1b3d8(%rip), %rdi     # 0x50fe0
leaq 0x9785(%rip), %rsi      # 0x3f394
movl $0x33, %edx
callq 0x74e0
movq (%rsp), %rax
cmpl $0x0, 0x60(%rax)
jle 0x35c3c
movq (%rsp), %rdi
addq $0x68, %rdi
leaq 0x9702(%rip), %rsi      # 0x3f334
movl $0x3e, %edx
callq 0x74e0
xorpd %xmm0, %xmm0
movsd %xmm0, 0x8(%rsp)
cmpl $0x0, 0x24(%rsp)
je 0x35b7c
movq 0x1b338(%rip), %rdi     # 0x50f90
leaq 0x9714(%rip), %rsi      # 0x3f373
movl $0x54, %edx
callq 0x74e0
jmp 0x35b7c
jmp 0x35cc2
jmp 0x35cc2
jmp 0x35cc2
movq %rax, %r15
jmp 0x35c9e
movq %rax, %r15
movq 0x98(%rsp), %rdi
cmpq %rbp, %rdi
je 0x35c9e
movq (%rdi), %rbx
movl $0x18, %esi
callq 0x7450
movq %rbx, %rdi
cmpq %rbp, %rbx
jne 0x35c89
movq 0xb0(%rsp), %rdi
cmpq %r12, %rdi
je 0x35cce
movq (%rdi), %rbx
movl $0x18, %esi
callq 0x7450
movq %rbx, %rdi
cmpq %r12, %rbx
jne 0x35cab
jmp 0x35cce
movq %rax, %r15
jmp 0x35cd3
jmp 0x35ccb
jmp 0x35ccb
movq %rax, %r15
leaq 0x48(%rsp), %r12
movq 0x48(%rsp), %rdi
cmpq %r12, %rdi
je 0x35cf2
movq (%rdi), %rbx
movl $0x18, %esi
callq 0x7450
movq %rbx, %rdi
cmpq %r12, %rbx
jne 0x35cdd
movq 0x80(%rsp), %rdi
leaq 0x80(%rsp), %r14
cmpq %r14, %rdi
je 0x35d1c
movq (%rdi), %rbx
movl $0x18, %esi
callq 0x7450
movq %rbx, %rdi
cmpq %r14, %rbx
jne 0x35d07
movq 0x30(%rsp), %rdi
leaq 0x30(%rsp), %r14
cmpq %r14, %rdi
je 0x35d40
movq (%rdi), %rbx
movl $0x18, %esi
callq 0x7450
movq %rbx, %rdi
cmpq %r14, %rbx
jne 0x35d2b
movq %r15, %rdi
callq 0x7740