// File: /workspace/github_cpp_makefile_star2_O1/thierry7100[P]CutOptim/src/SvgDoc.cpp
// Function: SvgDoc::TransformPaths(double, bool)
void SvgDoc::TransformPaths(double flat_factor, bool KeepNested)
{
    int nShape, nPath;

    nShape = 0;
    if ( SvgData == NULL ) return;
    if ( debug_level > 0 )
    {
        OutDebug << "Entering TransformPaths\n" << std::flush;
    }
	for (NSVGshape *shape = SvgData->shapes; shape != NULL; shape = shape->next, nShape++)
	{
        nPath = 0;
        if ( debug_level > 0 )
        {
            OutDebug << "Shape " << nShape << " id:" << shape->id << " Stroke[" << (int) shape->stroke.type << " " << setw(6) << setfill('0') << std::hex << (shape->stroke.color&0xFFFFFF) << std::dec << "] width:" << shape->strokeWidth << "\n" << std::flush;
        }
        //  Transform each path to a polygon
		for (NSVGpath *path = shape->paths; path != NULL; path = path->next, nPath++)
		{
            snprintf(path->id, 99, "%s_%d", shape->id, nPath);
            path->id[99] = 0;
            //  Walk through the path and delete vertices which have trange coordinates (nan)
            //  This has been observed in some cases.
            //  Indeed vertices are very close in these cases, so it is safe to remove vertex with nan coordinates.
            //  However, this can't be the first one.
            int StrangeControlPoints = 0;
            int StrangeEndPoints = 0;
            NSVGPathElt *Elt = path->PathElts;
            NSVGPathElt *PrevElt = NULL;
            for (int i = 0; i < path->nElts; i++)
            {
                int ShouldDelete = 0;
                if ( isnan(Elt->EndX) || isnan(Elt->EndY) )
                {
                    StrangeEndPoints++;
                    ShouldDelete = 1;
                }
                if ( isnan(Elt->BzCtrl1X) || isnan(Elt->BzCtrl1Y) || isnan(Elt->BzCtrl2X) || isnan(Elt->BzCtrl2Y) )
                {
                    StrangeControlPoints++;
                    ShouldDelete = 1;
                }
                if ( ShouldDelete )
                {
                    if ( PrevElt == NULL )
                    {
                        if ( debug_level > 0 )OutDebug << "nan encoutered as first element in path, aborting\n";
                        cerr << "nan encoutered as first element in path, aborting\n";
                        exit(1);
                    }
                    //  Remove vertex
                    path->nElts--;
                    PrevElt->next = Elt->next;
                    Elt = Elt->next;
                    continue;
                }
                PrevElt = Elt;
                Elt = Elt->next;
            }

            if ( debug_level > 2)
            {
                OutDebug << "Before Transform path, Shape " << nShape << " Path " << nPath << " with " << path->nElts << " HasBezier:" << path->hasBezier << "\n";
                OutDebug << "Path has " << StrangeEndPoints << " StrangeEndPoints and "<< StrangeControlPoints << " StrangeControlPoints (removed)\n";
                OutDebug << "Starting point=" << path->StartX << "," << path->StartY << "\n";
                OutDebug << "  Bounds (" << path->bounds[0] << "," << path->bounds[1] << ") --> (" << path->bounds[2] << "," << path->bounds[3] << "\n";
                NSVGPathElt *Elt = path->PathElts;
                for (int i = 0; i < path->nElts; i++)
                {
                    OutDebug << "   Elt " << i << " type " << Elt->Type << " EndPoint=(" << Elt->EndX << "," << Elt->EndY;
                    OutDebug << ")  Control points (" << Elt->BzCtrl1X << "," << Elt->BzCtrl1Y << ") and (" << Elt->BzCtrl2X << "," <<  Elt->BzCtrl2Y << ")\n";
                    Elt = Elt->next;
                }
                OutDebug << std::flush;
            }
			if ( path->closed == 0 )
			{
                if ( debug_level > 0 )
                {
                    OutDebug << "Path is NOT closed, skip !\n";
                }
                //  Path is not closed, do NOT process
                continue;
			}
            //  If path has bezier curves, break them in small segments, if not copy data to polyline path
            SplitBezierCurves(path, flat_factor*flat_factor);
            if ( debug_level > 2 )
            {
                OutDebug << "After flatening bezier, Shape " << nShape << " Path " << nPath << " with " << path->nElts << " HasBezier:" << path->hasBezier << "\n";
                OutDebug << "  Start (" << path->PolyLine->StartX << "," << path->PolyLine->StartY << ") Bounds (" << path->bounds[0] << "," << path->bounds[1] << ") --> (" << path->bounds[2] << "," << path->bounds[3] << "\n";
                NSVGPathElt *Elt = path->PolyLine->PathElts;
                for (int i = 0; i < path->PolyLine->nElts; i++)
                {
                    OutDebug << "   Elt " << i << " type " << Elt->Type << " EndPoint=(" << Elt->EndX << "," << Elt->EndY;
                    OutDebug << ")  Control points (" << Elt->BzCtrl1X << "," << Elt->BzCtrl1Y << ") and (" << Elt->BzCtrl2X << "," <<  Elt->BzCtrl2Y << ")\n";
                    Elt = Elt->next;
                }
            }

            SimplifyPath(path->PolyLine, flat_factor*flat_factor);

            if ( debug_level > 2 )
            {
                OutDebug << "After Simplification, Shape " << nShape << " Path " << nPath << " with " << path->nElts << " HasBezier:" << path->hasBezier << "\n";
                OutDebug << "  Start (" << path->PolyLine->StartX << "," << path->PolyLine->StartY << ") Bounds (" << path->bounds[0] << "," << path->bounds[1] << ") --> (" << path->bounds[2] << "," << path->bounds[3] << "\n";
                NSVGPathElt *Elt = path->PolyLine->PathElts;
                for (int i = 0; i < path->PolyLine->nElts; i++)
                {
                    OutDebug << "   Elt " << i << " type " << Elt->Type << " EndPoint=(" << Elt->EndX << "," << Elt->EndY;
                    OutDebug << ")  Control points (" << Elt->BzCtrl1X << "," << Elt->BzCtrl1Y << ") and (" << Elt->BzCtrl2X << "," <<  Elt->BzCtrl2Y << ")\n";
                    Elt = Elt->next;
                }
            }
            //  Create polygon structure
            path->ClosePolygon = new Polygon();
            Path2Polygon(path->ClosePolygon, path->PolyLine);
            if ( debug_level > 1 )
            {
                OutDebug << "Adding polygon " << nPath << " new name " << path->id << " with " << path->ClosePolygon->nVertices << " vertices, area:" << path->ClosePolygon->area() << "mm²\n";
            }
            if ( path->ClosePolygon->isClockWise() )
            {
                if ( debug_level  > 1 )
                {
                    OutDebug << "Polygon is clockwise, make it counter clockwise\n";
                }
                path->ClosePolygon->Reverse();
            }
		}
		if ( debug_level > 0)
            OutDebug << std::flush;
	}
	if ( KeepNested )
	{
        nShape = 0;
        //  Second pass, check if a path is included in an other one
        if ( debug_level > 0 )
        {
            OutDebug << "Transform paths pass 2 : checking if paths are included in other ones\n";
        }
        for (NSVGshape *shape = SvgData->shapes; shape != NULL; shape = shape->next, nShape++)
        {
            nPath = 0;
            NSVGpath *OldPath = NULL;
            NSVGpath *next_path = NULL;
            //  For each path of the shape, check if it is included in a larger o
            for (NSVGpath *path = shape->paths; path != NULL; path = next_path, nPath++)
            {
                next_path = path->next;     //  Memorize value, because will be modified if path is removed
                if ( RemoveIfIncluded(path, shape, OldPath, nShape, nPath) == 0 )
                {
                //  Not removed, new OldPath now. IF removed, DO NOT change OldPath, as the current entry has been moved
                    OldPath = path;
                }
            }
        }
	}
    if ( debug_level > 0 )
    {
        OutDebug << "End of Transform paths\n" << std::flush;
    }

}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xe8, %rsp
cmpq $0x0, 0x8(%rdi)
je 0x2e611
movq %rdi, %r12
movsd %xmm0, 0x20(%rsp)
movl %esi, 0x34(%rsp)
cmpl $0x0, 0x60(%rdi)
jle 0x2d27e
leaq 0x68(%r12), %rbx
leaq 0x121d7(%rip), %rsi     # 0x3f440
movl $0x18, %edx
movq %rbx, %rdi
callq 0x74d0
movq %rbx, %rdi
callq 0x7300
movq 0x8(%r12), %rax
movq 0x10(%rax), %r13
testq %r13, %r13
movq %r12, 0x18(%rsp)
je 0x2e55a
leaq 0x68(%r12), %r14
movsd 0x20(%rsp), %xmm0
mulsd %xmm0, %xmm0
movsd %xmm0, 0x20(%rsp)
movl $0x0, 0x10(%rsp)
cmpl $0x0, 0x60(%r12)
jle 0x2d409
movl $0x6, %edx
movq %r14, %rdi
leaq 0x121f3(%rip), %rsi     # 0x3f4c0
callq 0x74d0
movq %r14, %rdi
movl 0x10(%rsp), %esi
callq 0x7710
movq %rax, %rbx
movl $0x4, %edx
movq %rax, %rdi
leaq 0x12169(%rip), %rsi     # 0x3f459
callq 0x74d0
movq %r13, %rdi
callq 0x71d0
movq %rbx, %rdi
movq %r13, %rsi
movq %rax, %rdx
callq 0x74d0
movl $0x8, %edx
movq %rbx, %rdi
leaq 0x12144(%rip), %rsi     # 0x3f45e
callq 0x74d0
movsbl 0x50(%r13), %esi
movq %rbx, %rdi
callq 0x7710
movq %rax, %rbx
movl $0x1, %edx
movq %rax, %rdi
leaq 0x1055d(%rip), %rsi     # 0x3d89b
callq 0x74d0
movq (%rbx), %rax
movq -0x18(%rax), %rcx
movq $0x6, 0x10(%rbx,%rcx)
movq -0x18(%rax), %rax
leaq (%rbx,%rax), %r15
cmpb $0x0, 0xe1(%rbx,%rax)
jne 0x2d381
movq %r15, %rdi
movl $0x20, %esi
callq 0x73f0
movb %al, 0xe0(%r15)
movb $0x1, 0xe1(%r15)
movb $0x30, 0xe0(%r15)
movq (%rbx), %rax
movq -0x18(%rax), %rax
movl 0x18(%rbx,%rax), %ecx
andl $-0x4b, %ecx
orl $0x8, %ecx
movl %ecx, 0x18(%rbx,%rax)
movl 0x58(%r13), %esi
andl $0xffffff, %esi         # imm = 0xFFFFFF
movq %rbx, %rdi
callq 0x72f0
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rax
movl 0x18(%rbx,%rax), %ecx
andl $-0x4b, %ecx
orl $0x2, %ecx
movl %ecx, 0x18(%rbx,%rax)
movl $0x8, %edx
movq %rbx, %rdi
leaq 0x12090(%rip), %rsi     # 0x3f467
callq 0x74d0
movsd 0x68(%r13), %xmm0
movq %rbx, %rdi
callq 0x7680
movq %rax, %rbx
movl $0x1, %edx
movq %rax, %rdi
leaq 0x12e34(%rip), %rsi     # 0x40230
callq 0x74d0
movq %rbx, %rdi
callq 0x7300
movq 0xf0(%r13), %r15
testq %r15, %r15
je 0x2e536
xorl %r8d, %r8d
movq %r13, 0x38(%rsp)
leaq 0x90(%r15), %rdi
movl $0x63, %esi
movq %rdi, 0x80(%rsp)
leaq 0x12034(%rip), %rdx     # 0x3f470
movq %r13, %rcx
movl %r8d, 0x14(%rsp)
xorl %eax, %eax
callq 0x7670
movb $0x0, 0xf3(%r15)
leaq 0x10(%r15), %r13
movq %r15, 0x8(%rsp)
movl 0x18(%r15), %eax
movl $0x0, %r15d
movl $0x0, %ebx
testl %eax, %eax
jle 0x2d510
xorl %ecx, %ecx
movq %r13, %rdi
xorl %edx, %edx
xorl %ebx, %ebx
xorl %r15d, %r15d
movq (%rdi), %rsi
movsd 0x8(%rsi), %xmm0
ucomisd %xmm0, %xmm0
jp 0x2d507
movsd 0x10(%rsi), %xmm0
xorl %edi, %edi
ucomisd %xmm0, %xmm0
jp 0x2d507
movsd 0x18(%rsi), %xmm0
ucomisd %xmm0, %xmm0
jp 0x2d4fd
movsd 0x20(%rsi), %xmm0
ucomisd %xmm0, %xmm0
jp 0x2d4fd
movsd 0x28(%rsi), %xmm0
ucomisd %xmm0, %xmm0
jp 0x2d4fd
movsd 0x30(%rsi), %xmm0
ucomisd %xmm0, %xmm0
jp 0x2d4fd
testl %edi, %edi
je 0x2d4ee
testq %rdx, %rdx
je 0x2e623
decl %eax
movq 0x8(%rsp), %rdi
movl %eax, 0x18(%rdi)
movq 0x38(%rsi), %rdi
addq $0x38, %rsi
movq %rdi, 0x38(%rdx)
movq %rsi, %rdi
jmp 0x2d4f5
leaq 0x38(%rsi), %rdi
movq %rsi, %rdx
incl %ecx
cmpl %eax, %ecx
jl 0x2d47f
jmp 0x2d510
incl %r15d
movl $0x1, %edi
jmp 0x2d4c6
incl %ebx
movl $0x1, %edi
jmp 0x2d49a
cmpl $0x2, 0x60(%r12)
jle 0x2d872
movl $0x1d, %edx
movq %r14, %rdi
leaq 0x11f7e(%rip), %rsi     # 0x3f4a9
callq 0x74d0
movq %r14, %rdi
movl 0x10(%rsp), %esi
callq 0x7710
movq %rax, %r12
movl $0x6, %edx
movq %rax, %rdi
leaq 0x12c86(%rip), %rsi     # 0x401d4
callq 0x74d0
movq %r12, %rdi
movl 0x14(%rsp), %esi
callq 0x7710
movq %rax, %r12
movl $0x6, %edx
movq %rax, %rdi
leaq 0x1309c(%rip), %rsi     # 0x4060d
callq 0x74d0
movq 0x8(%rsp), %rbp
movl 0x18(%rbp), %esi
movq %r12, %rdi
callq 0x7710
movq %rax, %r12
movl $0xb, %edx
movq %rax, %rdi
leaq 0x11f2f(%rip), %rsi     # 0x3f4c7
callq 0x74d0
movl 0x20(%rbp), %esi
movq %r12, %rdi
callq 0x7710
movl $0x1, %edx
movq %rax, %rdi
leaq 0x12c79(%rip), %rsi     # 0x40230
callq 0x74d0
movl $0x9, %edx
movq %r14, %rdi
leaq 0x11f08(%rip), %rsi     # 0x3f4d3
callq 0x74d0
movq %r14, %rdi
movl %ebx, %esi
callq 0x7710
movq %rax, %rbx
movl $0x16, %edx
movq %rax, %rdi
leaq 0x11ef1(%rip), %rsi     # 0x3f4dd
callq 0x74d0
movq %rbx, %rdi
movl %r15d, %esi
callq 0x7710
movl $0x20, %edx
movq %rax, %rdi
leaq 0x11ee9(%rip), %rsi     # 0x3f4f4
callq 0x74d0
movl $0xf, %edx
movq %r14, %rdi
leaq 0x11ef6(%rip), %rsi     # 0x3f515
callq 0x74d0
movsd (%rbp), %xmm0
movq %r14, %rdi
callq 0x7680
movq %rax, %rbx
movl $0x1, %edx
movq %rax, %rdi
leaq 0x10275(%rip), %r12     # 0x3d8b8
movq %r12, %rsi
callq 0x74d0
movsd 0x8(%rbp), %xmm0
movq %rbx, %rdi
callq 0x7680
movl $0x1, %edx
movq %rax, %rdi
leaq 0x12bc9(%rip), %rsi     # 0x40230
callq 0x74d0
movl $0xa, %edx
movq %r14, %rdi
leaq 0x11eaa(%rip), %rsi     # 0x3f525
callq 0x74d0
movsd 0x28(%rbp), %xmm0
movq %r14, %rdi
callq 0x7680
movq %rax, %rbx
movl $0x1, %edx
movq %rax, %rdi
movq %r12, %rsi
callq 0x74d0
movsd 0x30(%rbp), %xmm0
movq %rbx, %rdi
callq 0x7680
movq %rax, %rbx
movl $0x7, %edx
movq %rax, %rdi
leaq 0x11e71(%rip), %rsi     # 0x3f530
callq 0x74d0
movsd 0x38(%rbp), %xmm0
movq %rbx, %rdi
callq 0x7680
movq %rax, %rbx
movl $0x1, %edx
movq %rax, %rdi
movq %r12, %rsi
callq 0x74d0
movsd 0x40(%rbp), %xmm0
movq %rbx, %rdi
callq 0x7680
movl $0x1, %edx
movq %rax, %rdi
leaq 0x12b30(%rip), %rsi     # 0x40230
callq 0x74d0
cmpl $0x0, 0x18(%rbp)
leaq 0x11e30(%rip), %r12     # 0x3f540
leaq 0x11e30(%rip), %rbp     # 0x3f547
jle 0x2d86a
xorl %ebx, %ebx
movq (%r13), %r13
movl $0x7, %edx
movq %r14, %rdi
leaq 0x11e06(%rip), %rsi     # 0x3f538
callq 0x74d0
movq %r14, %rdi
movl %ebx, %esi
callq 0x7710
movq %rax, %r15
movl $0x6, %edx
movq %rax, %rdi
movq %r12, %rsi
callq 0x74d0
movl (%r13), %esi
movq %r15, %rdi
callq 0x7710
movq %rax, %r15
movl $0xb, %edx
movq %rax, %rdi
movq %rbp, %rsi
callq 0x74d0
movsd 0x8(%r13), %xmm0
movq %r15, %rdi
callq 0x7680
movq %rax, %r15
movl $0x1, %edx
movq %rax, %rdi
movq %r12, %rbp
leaq 0x10122(%rip), %r12     # 0x3d8b8
movq %r12, %rsi
callq 0x74d0
movsd 0x10(%r13), %xmm0
movq %r15, %rdi
callq 0x7680
movl $0x13, %edx
movq %r14, %rdi
leaq 0x11d98(%rip), %rsi     # 0x3f553
callq 0x74d0
movsd 0x18(%r13), %xmm0
movq %r14, %rdi
callq 0x7680
movq %rax, %r15
movl $0x1, %edx
movq %rax, %rdi
movq %r12, %rsi
callq 0x74d0
movsd 0x20(%r13), %xmm0
movq %r15, %rdi
callq 0x7680
movq %rax, %r15
movl $0x7, %edx
movq %rax, %rdi
leaq 0x11d66(%rip), %rsi     # 0x3f567
callq 0x74d0
movsd 0x28(%r13), %xmm0
movq %r15, %rdi
callq 0x7680
movq %rax, %r15
movl $0x1, %edx
movq %rax, %rdi
movq %r12, %rsi
movq %rbp, %r12
leaq 0x11d1b(%rip), %rbp     # 0x3f547
callq 0x74d0
movsd 0x30(%r13), %xmm0
movq %r15, %rdi
leaq 0x11cd1(%rip), %r15     # 0x3f512
callq 0x7680
movl $0x2, %edx
movq %rax, %rdi
movq %r15, %rsi
callq 0x74d0
movq 0x8(%rsp), %rcx
addq $0x38, %r13
incl %ebx
cmpl 0x18(%rcx), %ebx
jl 0x2d71f
movq %r14, %rdi
callq 0x7300
movq 0x8(%rsp), %r15
movl 0x1c(%r15), %r12d
testl %r12d, %r12d
je 0x2dcfb
movq 0x10(%r15), %rbx
movl $0xf8, %edi
callq 0x7580
movq %r15, %rcx
movq %rax, %r15
movq %rax, 0x50(%rcx)
movsd (%rcx), %xmm0
movsd %xmm0, 0x60(%rsp)
movsd %xmm0, (%rax)
movsd 0x8(%rcx), %xmm0
movsd %xmm0, 0x28(%rsp)
movsd %xmm0, 0x8(%rax)
movl 0x18(%rcx), %eax
movl %eax, 0x18(%r15)
xorl %eax, %eax
movq %rax, 0x48(%r15)
movq %r15, 0x50(%r15)
movq %rax, 0x60(%r15)
movl $0x0, 0x20(%r15)
movl %r12d, 0x1c(%r15)
testq %rbx, %rbx
je 0x2d935
leaq 0x10(%r15), %r12
xorl %r13d, %r13d
movl $0x40, %edi
callq 0x7580
leaq 0x38(%r13), %rcx
testq %r13, %r13
movupd (%rbx), %xmm0
movups 0x10(%rbx), %xmm1
movups 0x20(%rbx), %xmm2
movupd 0x30(%rbx), %xmm3
movupd %xmm3, 0x30(%rax)
movupd %xmm0, (%rax)
movups %xmm1, 0x10(%rax)
movups %xmm2, 0x20(%rax)
movq $0x0, 0x38(%rax)
cmoveq %r12, %rcx
movq %rax, (%rcx)
movq 0x38(%rbx), %rbx
movq %rax, %r13
testq %rbx, %rbx
jne 0x2d8e7
xorps %xmm0, %xmm0
cvtsd2ss 0x60(%rsp), %xmm0
xorps %xmm1, %xmm1
cvtsd2ss 0x28(%rsp), %xmm1
movq 0x10(%r15), %rbx
testq %rbx, %rbx
je 0x2dd2a
movaps %xmm0, 0x40(%rsp)
movaps %xmm0, %xmm5
movaps %xmm1, 0x50(%rsp)
movaps %xmm1, %xmm4
movq 0x18(%rsp), %r12
movsd 0x20(%rsp), %xmm6
leaq 0xff42(%rip), %r13      # 0x3d8b8
movaps %xmm5, 0xc0(%rsp)
movaps %xmm4, 0xd0(%rsp)
xorps %xmm11, %xmm11
cvtss2sd %xmm0, %xmm11
xorps %xmm12, %xmm12
cvtss2sd %xmm1, %xmm12
movsd %xmm11, 0x90(%rsp)
movsd %xmm12, 0x88(%rsp)
cmpl $0x1, (%rbx)
jne 0x2dc58
movsd 0x8(%rbx), %xmm10
movsd 0x10(%rbx), %xmm7
movapd %xmm10, %xmm1
subsd %xmm11, %xmm1
movaps %xmm12, %xmm0
subsd %xmm7, %xmm0
movaps %xmm12, %xmm2
mulsd %xmm10, %xmm2
movapd %xmm11, %xmm3
mulsd %xmm7, %xmm3
subsd %xmm2, %xmm3
movsd 0x18(%rbx), %xmm9
movsd 0x20(%rbx), %xmm8
movapd %xmm1, %xmm4
mulsd %xmm8, %xmm4
movapd %xmm0, %xmm2
mulsd %xmm9, %xmm2
addsd %xmm4, %xmm2
addsd %xmm3, %xmm2
mulsd %xmm2, %xmm2
movapd %xmm1, %xmm4
mulsd %xmm1, %xmm4
movapd %xmm0, %xmm5
mulsd %xmm0, %xmm5
addsd %xmm4, %xmm5
divsd %xmm5, %xmm2
movsd 0x28(%rbx), %xmm13
movsd 0x30(%rbx), %xmm4
mulsd %xmm4, %xmm1
mulsd %xmm13, %xmm0
addsd %xmm1, %xmm0
addsd %xmm3, %xmm0
mulsd %xmm0, %xmm0
divsd %xmm5, %xmm0
movapd %xmm2, %xmm3
cmpunordsd %xmm2, %xmm3
movapd %xmm3, %xmm1
andpd %xmm0, %xmm1
maxsd %xmm2, %xmm0
andnpd %xmm0, %xmm3
orpd %xmm1, %xmm3
ucomisd %xmm3, %xmm6
jb 0x2da7c
movl $0x0, (%rbx)
jmp 0x2dc4e
movl $0x40, %edi
movapd %xmm3, 0x60(%rsp)
movsd %xmm7, 0x28(%rsp)
movsd %xmm8, 0xa8(%rsp)
movsd %xmm9, 0xa0(%rsp)
movsd %xmm10, 0x98(%rsp)
movsd %xmm4, 0xb8(%rsp)
movsd %xmm13, 0xb0(%rsp)
callq 0x7580
movsd 0x88(%rsp), %xmm12
movsd 0x90(%rsp), %xmm11
movq 0x38(%rbx), %rcx
movq %rcx, 0x38(%rax)
movq %rax, 0x38(%rbx)
movl $0x1, (%rax)
movsd 0x98(%rsp), %xmm0
movsd %xmm0, 0x8(%rax)
movsd 0xa0(%rsp), %xmm6
movapd %xmm6, %xmm0
addsd %xmm11, %xmm0
movsd 0x1152f(%rip), %xmm3    # 0x3f040
mulsd %xmm3, %xmm0
xorps %xmm4, %xmm4
cvtsd2ss %xmm0, %xmm4
movsd 0xa8(%rsp), %xmm1
movapd %xmm1, %xmm0
addsd %xmm12, %xmm0
mulsd %xmm3, %xmm0
xorps %xmm5, %xmm5
cvtsd2ss %xmm0, %xmm5
movsd 0xb0(%rsp), %xmm2
movapd %xmm6, %xmm0
addsd %xmm2, %xmm0
mulsd %xmm3, %xmm0
cvtsd2ss %xmm0, %xmm0
movsd 0xb8(%rsp), %xmm6
addsd %xmm6, %xmm1
mulsd %xmm3, %xmm1
cvtsd2ss %xmm1, %xmm1
movsd 0x28(%rsp), %xmm7
movsd %xmm7, 0x10(%rax)
addsd 0x8(%rbx), %xmm2
mulsd %xmm3, %xmm2
cvtsd2ss %xmm2, %xmm2
addsd 0x10(%rbx), %xmm6
mulsd %xmm3, %xmm6
xorps %xmm3, %xmm3
cvtsd2ss %xmm6, %xmm3
xorps %xmm6, %xmm6
cvtss2sd %xmm4, %xmm6
addss %xmm0, %xmm4
movss 0x1185d(%rip), %xmm10   # 0x3f400
mulss %xmm10, %xmm4
xorps %xmm7, %xmm7
cvtss2sd %xmm5, %xmm7
addss %xmm1, %xmm5
mulss %xmm10, %xmm5
addss %xmm2, %xmm0
mulss %xmm10, %xmm0
addss %xmm3, %xmm1
mulss %xmm10, %xmm1
cvtss2sd %xmm4, %xmm8
addss %xmm0, %xmm4
mulss %xmm10, %xmm4
cvtss2sd %xmm5, %xmm9
addss %xmm1, %xmm5
mulss %xmm10, %xmm5
cvtss2sd %xmm4, %xmm4
movsd %xmm4, 0x8(%rbx)
xorps %xmm4, %xmm4
cvtss2sd %xmm5, %xmm4
movsd %xmm4, 0x10(%rbx)
movsd %xmm6, 0x18(%rbx)
movsd 0x20(%rsp), %xmm6
movsd %xmm7, 0x20(%rbx)
movsd %xmm8, 0x28(%rbx)
movsd %xmm9, 0x30(%rbx)
cvtss2sd %xmm0, %xmm0
movsd %xmm0, 0x18(%rax)
xorps %xmm0, %xmm0
cvtss2sd %xmm1, %xmm0
movsd %xmm0, 0x20(%rax)
xorps %xmm0, %xmm0
cvtss2sd %xmm2, %xmm0
movsd %xmm0, 0x28(%rax)
xorps %xmm0, %xmm0
cvtss2sd %xmm3, %xmm0
movapd 0x60(%rsp), %xmm3
movsd %xmm0, 0x30(%rax)
incl 0x18(%r15)
ucomisd %xmm3, %xmm6
jb 0x2d9ac
xorps %xmm0, %xmm0
cvtsd2ss 0x8(%rbx), %xmm0
xorps %xmm1, %xmm1
cvtsd2ss 0x10(%rbx), %xmm1
movaps %xmm0, %xmm2
movaps 0x40(%rsp), %xmm4
minss %xmm4, %xmm2
cmpunordss %xmm4, %xmm4
movaps %xmm4, %xmm3
andps %xmm0, %xmm3
andnps %xmm2, %xmm4
orps %xmm3, %xmm4
movaps %xmm4, 0x40(%rsp)
movaps %xmm0, %xmm2
movaps 0xc0(%rsp), %xmm5
maxss %xmm5, %xmm2
cmpunordss %xmm5, %xmm5
movaps %xmm5, %xmm3
andps %xmm0, %xmm3
andnps %xmm2, %xmm5
orps %xmm3, %xmm5
movaps %xmm1, %xmm2
movaps 0x50(%rsp), %xmm4
minss %xmm4, %xmm2
cmpunordss %xmm4, %xmm4
movaps %xmm4, %xmm3
andps %xmm1, %xmm3
andnps %xmm2, %xmm4
orps %xmm3, %xmm4
movaps %xmm4, 0x50(%rsp)
movaps %xmm1, %xmm2
movaps 0xd0(%rsp), %xmm4
maxss %xmm4, %xmm2
cmpunordss %xmm4, %xmm4
movaps %xmm4, %xmm3
andps %xmm1, %xmm3
andnps %xmm2, %xmm4
orps %xmm3, %xmm4
movq 0x38(%rbx), %rbx
testq %rbx, %rbx
jne 0x2d976
jmp 0x2dd46
movq 0x18(%rsp), %r12
cmpl $0x0, 0x60(%r12)
movq 0x38(%rsp), %r13
jle 0x2e521
movl $0x1b, %edx
movq %r14, %rdi
leaq 0x1184f(%rip), %rsi     # 0x3f56f
callq 0x74d0
jmp 0x2e521
movaps %xmm1, %xmm4
movaps %xmm1, 0x50(%rsp)
movaps %xmm0, %xmm5
movaps %xmm0, 0x40(%rsp)
movq 0x18(%rsp), %r12
leaq 0xfb72(%rip), %r13      # 0x3d8b8
xorps %xmm0, %xmm0
cvtss2sd 0x40(%rsp), %xmm0
movsd %xmm0, 0x28(%r15)
xorps %xmm0, %xmm0
cvtss2sd 0x50(%rsp), %xmm0
movsd %xmm0, 0x30(%r15)
xorps %xmm0, %xmm0
cvtss2sd %xmm5, %xmm0
movsd %xmm0, 0x38(%r15)
xorps %xmm0, %xmm0
cvtss2sd %xmm4, %xmm0
movsd %xmm0, 0x40(%r15)
cmpl $0x3, 0x60(%r12)
leaq 0x11787(%rip), %rbp     # 0x3f512
movq 0x8(%rsp), %r15
jl 0x2e091
movl $0x1e, %edx
movq %r14, %rdi
leaq 0x117e6(%rip), %rsi     # 0x3f58b
callq 0x74d0
movq %r14, %rdi
movl 0x10(%rsp), %esi
callq 0x7710
movq %rax, %rbx
movl $0x6, %edx
movq %rax, %rdi
leaq 0x1240c(%rip), %rsi     # 0x401d4
callq 0x74d0
movq %rbx, %rdi
movl 0x14(%rsp), %esi
callq 0x7710
movq %rax, %rbx
movl $0x6, %edx
movq %rax, %rdi
leaq 0x12822(%rip), %rsi     # 0x4060d
callq 0x74d0
movl 0x18(%r15), %esi
movq %rbx, %rdi
callq 0x7710
movq %rax, %rbx
movl $0xb, %edx
movq %rax, %rdi
leaq 0x116b9(%rip), %rsi     # 0x3f4c7
callq 0x74d0
movl 0x20(%r15), %esi
movq %rbx, %rdi
callq 0x7710
movl $0x1, %edx
movq %rax, %rdi
leaq 0x12402(%rip), %r15     # 0x40230
movq %r15, %rsi
callq 0x74d0
movl $0x9, %edx
movq %r14, %rdi
leaq 0x11765(%rip), %rsi     # 0x3f5aa
callq 0x74d0
movq 0x8(%rsp), %rax
movq 0x50(%rax), %rax
movsd (%rax), %xmm0
movq %r14, %rdi
callq 0x7680
movq %rax, %rbx
movl $0x1, %edx
movq %rax, %rdi
movq %r13, %rsi
callq 0x74d0
movq 0x8(%rsp), %rax
movq 0x50(%rax), %rax
movsd 0x8(%rax), %xmm0
movq %rbx, %rdi
callq 0x7680
movq %rax, %rbx
movl $0xa, %edx
movq %rax, %rdi
leaq 0x1171a(%rip), %rsi     # 0x3f5b4
callq 0x74d0
movq 0x8(%rsp), %rax
movsd 0x28(%rax), %xmm0
movq %rbx, %rdi
callq 0x7680
movq %rax, %rbx
movl $0x1, %edx
movq %rax, %rdi
movq %r13, %rsi
callq 0x74d0
movq 0x8(%rsp), %rax
movsd 0x30(%rax), %xmm0
movq %rbx, %rdi
callq 0x7680
movq %rax, %rbx
movl $0x7, %edx
movq %rax, %rdi
leaq 0x11648(%rip), %rsi     # 0x3f530
callq 0x74d0
movq 0x8(%rsp), %rax
movsd 0x38(%rax), %xmm0
movq %rbx, %rdi
callq 0x7680
movq %rax, %rbx
movl $0x1, %edx
movq %rax, %rdi
movq %r13, %rsi
callq 0x74d0
movq 0x8(%rsp), %rax
movsd 0x40(%rax), %xmm0
movq %rbx, %rdi
callq 0x7680
movl $0x1, %edx
movq %rax, %rdi
movq %r15, %rsi
movq 0x8(%rsp), %r15
callq 0x74d0
movq 0x50(%r15), %r12
cmpl $0x0, 0x18(%r12)
jle 0x2e091
addq $0x10, %r12
xorl %ebx, %ebx
movq (%r12), %r12
movl $0x7, %edx
movq %r14, %rdi
leaq 0x115d6(%rip), %rsi     # 0x3f538
callq 0x74d0
movq %r14, %rdi
movl %ebx, %esi
callq 0x7710
movq %rax, %r15
movl $0x6, %edx
movq %rax, %rdi
leaq 0x115bd(%rip), %rsi     # 0x3f540
callq 0x74d0
movl (%r12), %esi
movq %r15, %rdi
callq 0x7710
movq %rax, %r15
movl $0xb, %edx
movq %rax, %rdi
leaq 0x115a1(%rip), %rsi     # 0x3f547
callq 0x74d0
movsd 0x8(%r12), %xmm0
movq %r15, %rdi
callq 0x7680
movq %rax, %r15
movl $0x1, %edx
movq %rax, %rdi
movq %r13, %rsi
callq 0x74d0
movsd 0x10(%r12), %xmm0
movq %r15, %rdi
callq 0x7680
movl $0x13, %edx
movq %r14, %rdi
leaq 0x11568(%rip), %rsi     # 0x3f553
callq 0x74d0
movsd 0x18(%r12), %xmm0
movq %r14, %rdi
callq 0x7680
movq %rax, %r15
movl $0x1, %edx
movq %rax, %rdi
movq %r13, %rsi
callq 0x74d0
movsd 0x20(%r12), %xmm0
movq %r15, %rdi
callq 0x7680
movq %rax, %r15
movl $0x7, %edx
movq %rax, %rdi
leaq 0x11534(%rip), %rsi     # 0x3f567
callq 0x74d0
movsd 0x28(%r12), %xmm0
movq %r15, %rdi
callq 0x7680
movq %rax, %r15
movl $0x1, %edx
movq %rax, %rdi
movq %r13, %rsi
callq 0x74d0
movsd 0x30(%r12), %xmm0
movq %r15, %rdi
movq 0x8(%rsp), %r15
callq 0x7680
movl $0x2, %edx
movq %rax, %rdi
movq %rbp, %rsi
callq 0x74d0
addq $0x38, %r12
incl %ebx
movq 0x50(%r15), %rax
cmpl 0x18(%rax), %ebx
jl 0x2df4f
movq 0x50(%r15), %rsi
movsd 0x20(%rsp), %xmm0
callq 0x2d094
movq 0x18(%rsp), %rax
cmpl $0x3, 0x60(%rax)
jl 0x2e3aa
movl $0x1c, %edx
movq %r14, %rdi
leaq 0x11501(%rip), %rsi     # 0x3f5bf
callq 0x74d0
movq %r14, %rdi
movl 0x10(%rsp), %esi
callq 0x7710
movq %rax, %rbx
movl $0x6, %edx
movq %rax, %rdi
leaq 0x120f3(%rip), %rsi     # 0x401d4
callq 0x74d0
movq %rbx, %rdi
movl 0x14(%rsp), %esi
callq 0x7710
movq %rax, %rbx
movl $0x6, %edx
movq %rax, %rdi
leaq 0x12509(%rip), %rsi     # 0x4060d
callq 0x74d0
movl 0x18(%r15), %esi
movq %rbx, %rdi
callq 0x7710
movq %rax, %rbx
movl $0xb, %edx
movq %rax, %rdi
leaq 0x113a0(%rip), %rsi     # 0x3f4c7
callq 0x74d0
movl 0x20(%r15), %esi
movq %rbx, %rdi
callq 0x7710
movl $0x1, %edx
movq %rax, %rdi
leaq 0x120e9(%rip), %r15     # 0x40230
movq %r15, %rsi
callq 0x74d0
movl $0x9, %edx
movq %r14, %rdi
leaq 0x1144c(%rip), %rsi     # 0x3f5aa
callq 0x74d0
movq 0x8(%rsp), %rax
movq 0x50(%rax), %rax
movsd (%rax), %xmm0
movq %r14, %rdi
callq 0x7680
movq %rax, %rbx
movl $0x1, %edx
movq %rax, %rdi
movq %r13, %rsi
callq 0x74d0
movq 0x8(%rsp), %rax
movq 0x50(%rax), %rax
movsd 0x8(%rax), %xmm0
movq %rbx, %rdi
callq 0x7680
movq %rax, %rbx
movl $0xa, %edx
movq %rax, %rdi
leaq 0x11401(%rip), %rsi     # 0x3f5b4
callq 0x74d0
movq 0x8(%rsp), %rax
movsd 0x28(%rax), %xmm0
movq %rbx, %rdi
callq 0x7680
movq %rax, %rbx
movl $0x1, %edx
movq %rax, %rdi
movq %r13, %rsi
callq 0x74d0
movq 0x8(%rsp), %rax
movsd 0x30(%rax), %xmm0
movq %rbx, %rdi
callq 0x7680
movq %rax, %rbx
movl $0x7, %edx
movq %rax, %rdi
leaq 0x1132f(%rip), %rsi     # 0x3f530
callq 0x74d0
movq 0x8(%rsp), %rax
movsd 0x38(%rax), %xmm0
movq %rbx, %rdi
callq 0x7680
movq %rax, %rbx
movl $0x1, %edx
movq %rax, %rdi
movq %r13, %rsi
callq 0x74d0
movq 0x8(%rsp), %rax
movsd 0x40(%rax), %xmm0
movq %rbx, %rdi
callq 0x7680
movl $0x1, %edx
movq %rax, %rdi
movq %r15, %rsi
movq 0x8(%rsp), %r15
callq 0x74d0
movq 0x50(%r15), %r12
cmpl $0x0, 0x18(%r12)
jle 0x2e3aa
addq $0x10, %r12
xorl %ebx, %ebx
movq (%r12), %r12
movl $0x7, %edx
movq %r14, %rdi
leaq 0x112bd(%rip), %rsi     # 0x3f538
callq 0x74d0
movq %r14, %rdi
movl %ebx, %esi
callq 0x7710
movq %rax, %r15
movl $0x6, %edx
movq %rax, %rdi
leaq 0x112a4(%rip), %rsi     # 0x3f540
callq 0x74d0
movl (%r12), %esi
movq %r15, %rdi
callq 0x7710
movq %rax, %r15
movl $0xb, %edx
movq %rax, %rdi
leaq 0x11288(%rip), %rsi     # 0x3f547
callq 0x74d0
movsd 0x8(%r12), %xmm0
movq %r15, %rdi
callq 0x7680
movq %rax, %r15
movl $0x1, %edx
movq %rax, %rdi
movq %r13, %rsi
callq 0x74d0
movsd 0x10(%r12), %xmm0
movq %r15, %rdi
callq 0x7680
movl $0x13, %edx
movq %r14, %rdi
leaq 0x1124f(%rip), %rsi     # 0x3f553
callq 0x74d0
movsd 0x18(%r12), %xmm0
movq %r14, %rdi
callq 0x7680
movq %rax, %r15
movl $0x1, %edx
movq %rax, %rdi
movq %r13, %rsi
callq 0x74d0
movsd 0x20(%r12), %xmm0
movq %r15, %rdi
callq 0x7680
movq %rax, %r15
movl $0x7, %edx
movq %rax, %rdi
leaq 0x1121b(%rip), %rsi     # 0x3f567
callq 0x74d0
movsd 0x28(%r12), %xmm0
movq %r15, %rdi
callq 0x7680
movq %rax, %r15
movl $0x1, %edx
movq %rax, %rdi
movq %r13, %rsi
callq 0x74d0
movsd 0x30(%r12), %xmm0
movq %r15, %rdi
movq 0x8(%rsp), %r15
callq 0x7680
movl $0x2, %edx
movq %rax, %rdi
movq %rbp, %rsi
callq 0x74d0
addq $0x38, %r12
incl %ebx
movq 0x50(%r15), %rax
cmpl 0x18(%rax), %ebx
jl 0x2e268
movl $0xc0, %edi
callq 0x7430
movq %rax, %rbx
movq %rax, %rdi
callq 0x2651c
movq %rbx, 0x60(%r15)
movq 0x50(%r15), %r15
movq 0x10(%r15), %r12
xorpd %xmm0, %xmm0
movapd %xmm0, 0x70(%rsp)
movupd (%r15), %xmm0
movapd %xmm0, 0x70(%rsp)
movq %rbx, %rdi
leaq 0x70(%rsp), %rbp
movq %rbp, %rsi
callq 0x266b0
cmpl $0x0, 0x18(%r15)
jle 0x2e420
xorl %r13d, %r13d
movupd 0x8(%r12), %xmm0
movapd %xmm0, 0x70(%rsp)
movq %rbx, %rdi
movq %rbp, %rsi
callq 0x266b0
movq 0x38(%r12), %r12
incl %r13d
cmpl 0x18(%r15), %r13d
jl 0x2e3fa
movq 0x18(%rsp), %r12
cmpl $0x2, 0x60(%r12)
movq 0x8(%rsp), %r15
jl 0x2e4ea
movl $0xf, %edx
movq %r14, %rdi
leaq 0x11197(%rip), %rsi     # 0x3f5dc
callq 0x74d0
movq %r14, %rdi
movl 0x14(%rsp), %esi
callq 0x7710
movq %rax, %rbx
movl $0xa, %edx
movq %rax, %rdi
leaq 0x11184(%rip), %rsi     # 0x3f5ec
callq 0x74d0
movq 0x80(%rsp), %r13
movq %r13, %rdi
callq 0x71d0
movq %rbx, %rdi
movq %r13, %rsi
movq %rax, %rdx
callq 0x74d0
movl $0x6, %edx
movq %rbx, %rdi
leaq 0x12173(%rip), %rsi     # 0x4060d
callq 0x74d0
movq 0x60(%r15), %rax
movl 0x8(%rax), %esi
movq %rbx, %rdi
callq 0x7710
movq %rax, %rbx
movl $0x10, %edx
movq %rax, %rdi
leaq 0x11137(%rip), %rsi     # 0x3f5f7
callq 0x74d0
movq 0x60(%r15), %rdi
callq 0x26926
movq %rbx, %rdi
callq 0x7680
movl $0x5, %edx
movq %rax, %rdi
leaq 0x11123(%rip), %rsi     # 0x3f608
callq 0x74d0
movq 0x60(%r15), %rax
cmpl $0x0, 0x94(%rax)
movq 0x38(%rsp), %r13
je 0x2e521
cmpl $0x2, 0x60(%r12)
jl 0x2e518
movl $0x30, %edx
movq %r14, %rdi
leaq 0x110fb(%rip), %rsi     # 0x3f60e
callq 0x74d0
movq 0x60(%r15), %rdi
callq 0x26b80
movl 0x14(%rsp), %r8d
incl %r8d
movq 0x48(%r15), %r15
testq %r15, %r15
jne 0x2d421
cmpl $0x0, 0x60(%r12)
jle 0x2e546
movq %r14, %rdi
callq 0x7300
incl 0x10(%rsp)
movq 0xf8(%r13), %r13
testq %r13, %r13
jne 0x2d2b2
cmpb $0x0, 0x34(%rsp)
je 0x2e5e6
movq 0x18(%rsp), %rbx
cmpl $0x0, 0x60(%rbx)
jle 0x2e585
leaq 0x68(%rbx), %rdi
leaq 0x110c4(%rip), %rsi     # 0x3f63f
movl $0x46, %edx
callq 0x74d0
movq 0x8(%rbx), %rax
movq 0x10(%rax), %rbx
testq %rbx, %rbx
je 0x2e5e6
xorl %ebp, %ebp
movq 0xf0(%rbx), %r13
testq %r13, %r13
je 0x2e5d8
xorl %r15d, %r15d
xorl %r14d, %r14d
movq %r13, %r12
movq 0x48(%r13), %r13
movq 0x18(%rsp), %rdi
movq %r12, %rsi
movq %rbx, %rdx
movq %r15, %rcx
movl %ebp, %r8d
movl %r14d, %r9d
callq 0x2e674
testl %eax, %eax
je 0x2e5cd
movq %r15, %r12
incl %r14d
movq %r12, %r15
testq %r13, %r13
jne 0x2e5a6
incl %ebp
movq 0xf8(%rbx), %rbx
testq %rbx, %rbx
jne 0x2e594
movq 0x18(%rsp), %rbx
cmpl $0x0, 0x60(%rbx)
jle 0x2e611
addq $0x68, %rbx
leaq 0x1108a(%rip), %rsi     # 0x3f686
movl $0x17, %edx
movq %rbx, %rdi
callq 0x74d0
movq %rbx, %rdi
callq 0x7300
addq $0xe8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
cmpl $0x0, 0x60(%r12)
jle 0x2e63f
leaq 0x10e44(%rip), %rsi     # 0x3f476
movl $0x32, %edx
movq %r14, %rdi
callq 0x74d0
movq 0x2399a(%rip), %rdi     # 0x51fe0
leaq 0x10e29(%rip), %rsi     # 0x3f476
callq 0x7410
movl $0x1, %edi
callq 0x7530
movq %rax, %r14
movl $0xc0, %esi
movq %rbx, %rdi
callq 0x7440
movq %r14, %rdi
callq 0x7730