// File: thierry7100[P]CutOptim/src/SvgDoc.cpp
// Function: SvgDoc::WritePlacedPath(std::ostream&, NSVGpath*, NSVGpath*, NSVGshape*, int)
void SvgDoc::WritePlacedPath(ostream &Out, NSVGpath *ref_path, NSVGpath *out_path, NSVGshape *shape, int hasgroup)
{
    if (hasgroup)
        Out << "   ";
    Out << "    <path" << endl;
    //  Line style from SVG file
    Out << std::hex;
    if (hasgroup)
        Out << "   ";
    Out << "       style=\"fill:none;stroke:#" << setw(6) << setfill('0') << std::hex << (shape->stroke.color&0xFFFFFF);
    Out << std::dec;
    Out << ";stroke-width:" << shape->strokeWidth << "\"" << endl;
    // Get transformation values (rotation and translation) from reference path
    double angle = ref_path->PlacedPolygon->getRotation();
    Point PtTrans = ref_path->PlacedPolygon->getTranslation();
    Point Centroid = ref_path->PlacedPolygon->getCentroid() - PtTrans;      //  Should get centroid of unplaced polygon
    //  Then write path
    Point Start = Point(out_path->StartX, out_path->StartY);
    Start.Transform(angle, Centroid, PtTrans);
    if ( hasgroup )
        Out << "   ";
    Out << "       d=\"M " << Start.x << "," << Start.y;
    NSVGPathElt *Elt = out_path->PathElts;
    for (int i = 0; i < out_path->nElts; i++)
    {
        if ( Elt->Type == NSVG_PATH_BEZIER_C )
        {
            Point EltEnd = Point(Elt->EndX, Elt->EndY);
            EltEnd.Transform(angle, Centroid, PtTrans);
            Point EltBzCtrl1 = Point(Elt->BzCtrl1X, Elt->BzCtrl1Y);
            EltBzCtrl1.Transform(angle, Centroid, PtTrans);
            Point EltBzCtrl2 = Point(Elt->BzCtrl2X, Elt->BzCtrl2Y);
            EltBzCtrl2.Transform(angle, Centroid, PtTrans);
            Out << " C " << EltBzCtrl1.x << "," << EltBzCtrl1.y << "," << EltBzCtrl2.x << "," << EltBzCtrl2.y << "," << EltEnd.x << "," << EltEnd.y;
        }
        else
        {
            Point EltEnd = Point(Elt->EndX, Elt->EndY);
            EltEnd.Transform(angle, Centroid, PtTrans);
            Out << " L " << EltEnd.x << "," << EltEnd.y;
        }
        Elt = Elt->next;
    }
    if ( out_path->closed == 1 )
    {
        Out << " z";
    }
    Out << "\"" << endl;
    if ( hasgroup )
        Out << "   ";
    Out << "       id=\"Placed_" << out_path->id << "\"" << endl;
    if ( hasgroup )
        Out << "   ";
    Out << "       inkscape:connector-curvature=\"0\" />" << endl;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x180, %rsp            # imm = 0x180
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq %r8, -0x28(%rbp)
movl %r9d, -0x2c(%rbp)
cmpl $0x0, -0x2c(%rbp)
je 0x6b9e9
movq -0x10(%rbp), %rdi
leaq 0x16f42(%rip), %rsi     # 0x82926
callq 0x9530
movq -0x10(%rbp), %rdi
leaq 0x18faf(%rip), %rsi     # 0x849a3
callq 0x9530
movq %rax, %rdi
movq 0x4c545(%rip), %rsi     # 0xb7f48
callq 0x9590
movq -0x10(%rbp), %rdi
leaq -0x35ed3(%rip), %rsi    # 0x35b40
callq 0x91a0
cmpl $0x0, -0x2c(%rbp)
je 0x6ba2e
movq -0x10(%rbp), %rdi
leaq 0x16efd(%rip), %rsi     # 0x82926
callq 0x9530
movq -0x10(%rbp), %rdi
leaq 0x18f74(%rip), %rsi     # 0x849ad
callq 0x9530
movq %rax, -0x180(%rbp)
movl $0x6, %edi
callq 0x7fc70
movq -0x180(%rbp), %rdi
movl %eax, -0x30(%rbp)
movl -0x30(%rbp), %esi
callq 0x9640
movq %rax, -0x178(%rbp)
movl $0x30, %edi
callq 0x7fc90
movq -0x178(%rbp), %rdi
movb %al, -0x31(%rbp)
movzbl -0x31(%rbp), %esi
callq 0x9830
movq %rax, %rdi
leaq -0x35f4f(%rip), %rsi    # 0x35b40
callq 0x91a0
movq %rax, %rdi
movq -0x28(%rbp), %rax
movl 0x58(%rax), %esi
andl $0xffffff, %esi         # imm = 0xFFFFFF
callq 0x9740
movq -0x10(%rbp), %rdi
leaq 0x141fc(%rip), %rsi     # 0x7fcb0
callq 0x91a0
movq -0x10(%rbp), %rdi
leaq 0x19155(%rip), %rsi     # 0x84c19
callq 0x9530
movq %rax, %rdi
movq -0x28(%rbp), %rax
movsd 0x68(%rax), %xmm0
callq 0x9a30
movq %rax, %rdi
leaq 0x18f0c(%rip), %rsi     # 0x849f0
callq 0x9530
movq %rax, %rdi
movq 0x4c455(%rip), %rsi     # 0xb7f48
callq 0x9590
movq -0x18(%rbp), %rax
movq 0x78(%rax), %rdi
callq 0x7fd60
movsd %xmm0, -0x40(%rbp)
movq -0x18(%rbp), %rax
movq 0x78(%rax), %rdi
callq 0x7fd80
movsd %xmm0, -0x50(%rbp)
movsd %xmm1, -0x48(%rbp)
movq -0x18(%rbp), %rax
movq 0x78(%rax), %rdi
callq 0x615a0
movsd %xmm0, -0x70(%rbp)
movsd %xmm1, -0x68(%rbp)
leaq -0x70(%rbp), %rdi
leaq -0x50(%rbp), %rsi
callq 0x63e00
movsd %xmm0, -0x60(%rbp)
movsd %xmm1, -0x58(%rbp)
movq -0x20(%rbp), %rax
movsd (%rax), %xmm0
movq -0x20(%rbp), %rax
movsd 0x8(%rax), %xmm1
leaq -0x80(%rbp), %rdi
callq 0x5b520
movsd -0x40(%rbp), %xmm0
movq -0x60(%rbp), %rax
movq %rax, -0x90(%rbp)
movq -0x58(%rbp), %rax
movq %rax, -0x88(%rbp)
movq -0x50(%rbp), %rax
movq %rax, -0xa0(%rbp)
movq -0x48(%rbp), %rax
movq %rax, -0x98(%rbp)
movsd -0x90(%rbp), %xmm1
movsd -0x88(%rbp), %xmm2
movsd -0xa0(%rbp), %xmm3
movsd -0x98(%rbp), %xmm4
leaq -0x80(%rbp), %rdi
callq 0x7fdb0
cmpl $0x0, -0x2c(%rbp)
je 0x6bbd9
movq -0x10(%rbp), %rdi
leaq 0x16d52(%rip), %rsi     # 0x82926
callq 0x9530
movq -0x10(%rbp), %rdi
leaq 0x18dea(%rip), %rsi     # 0x849ce
callq 0x9530
movq %rax, %rdi
movsd -0x80(%rbp), %xmm0
callq 0x9a30
movq %rax, %rdi
leaq 0x16d24(%rip), %rsi     # 0x82924
callq 0x9530
movq %rax, %rdi
movsd -0x78(%rbp), %xmm0
callq 0x9a30
movq -0x20(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0xa8(%rbp)
movl $0x0, -0xac(%rbp)
movl -0xac(%rbp), %eax
movq -0x20(%rbp), %rcx
cmpl 0x18(%rcx), %eax
jge 0x6bf77
movq -0xa8(%rbp), %rax
cmpl $0x1, (%rax)
jne 0x6be91
movq -0xa8(%rbp), %rax
movsd 0x8(%rax), %xmm0
movq -0xa8(%rbp), %rax
movsd 0x10(%rax), %xmm1
leaq -0xc0(%rbp), %rdi
callq 0x5b520
movsd -0x40(%rbp), %xmm0
movq -0x60(%rbp), %rax
movq %rax, -0xd0(%rbp)
movq -0x58(%rbp), %rax
movq %rax, -0xc8(%rbp)
movq -0x50(%rbp), %rax
movq %rax, -0xe0(%rbp)
movq -0x48(%rbp), %rax
movq %rax, -0xd8(%rbp)
movsd -0xd0(%rbp), %xmm1
movsd -0xc8(%rbp), %xmm2
movsd -0xe0(%rbp), %xmm3
movsd -0xd8(%rbp), %xmm4
leaq -0xc0(%rbp), %rdi
callq 0x7fdb0
movq -0xa8(%rbp), %rax
movsd 0x18(%rax), %xmm0
movq -0xa8(%rbp), %rax
movsd 0x20(%rax), %xmm1
leaq -0xf0(%rbp), %rdi
callq 0x5b520
movsd -0x40(%rbp), %xmm0
movq -0x60(%rbp), %rax
movq %rax, -0x100(%rbp)
movq -0x58(%rbp), %rax
movq %rax, -0xf8(%rbp)
movq -0x50(%rbp), %rax
movq %rax, -0x110(%rbp)
movq -0x48(%rbp), %rax
movq %rax, -0x108(%rbp)
movsd -0x100(%rbp), %xmm1
movsd -0xf8(%rbp), %xmm2
movsd -0x110(%rbp), %xmm3
movsd -0x108(%rbp), %xmm4
leaq -0xf0(%rbp), %rdi
callq 0x7fdb0
movq -0xa8(%rbp), %rax
movsd 0x28(%rax), %xmm0
movq -0xa8(%rbp), %rax
movsd 0x30(%rax), %xmm1
leaq -0x120(%rbp), %rdi
callq 0x5b520
movsd -0x40(%rbp), %xmm0
movq -0x60(%rbp), %rax
movq %rax, -0x130(%rbp)
movq -0x58(%rbp), %rax
movq %rax, -0x128(%rbp)
movq -0x50(%rbp), %rax
movq %rax, -0x140(%rbp)
movq -0x48(%rbp), %rax
movq %rax, -0x138(%rbp)
movsd -0x130(%rbp), %xmm1
movsd -0x128(%rbp), %xmm2
movsd -0x140(%rbp), %xmm3
movsd -0x138(%rbp), %xmm4
leaq -0x120(%rbp), %rdi
callq 0x7fdb0
movq -0x10(%rbp), %rdi
leaq 0x18bff(%rip), %rsi     # 0x849db
callq 0x9530
movq %rax, %rdi
movsd -0xf0(%rbp), %xmm0
callq 0x9a30
movq %rax, %rdi
leaq 0x16b29(%rip), %rsi     # 0x82924
callq 0x9530
movq %rax, %rdi
movsd -0xe8(%rbp), %xmm0
callq 0x9a30
movq %rax, %rdi
leaq 0x16b0a(%rip), %rsi     # 0x82924
callq 0x9530
movq %rax, %rdi
movsd -0x120(%rbp), %xmm0
callq 0x9a30
movq %rax, %rdi
leaq 0x16aeb(%rip), %rsi     # 0x82924
callq 0x9530
movq %rax, %rdi
movsd -0x118(%rbp), %xmm0
callq 0x9a30
movq %rax, %rdi
leaq 0x16acc(%rip), %rsi     # 0x82924
callq 0x9530
movq %rax, %rdi
movsd -0xc0(%rbp), %xmm0
callq 0x9a30
movq %rax, %rdi
leaq 0x16aad(%rip), %rsi     # 0x82924
callq 0x9530
movq %rax, %rdi
movsd -0xb8(%rbp), %xmm0
callq 0x9a30
jmp 0x6bf51
movq -0xa8(%rbp), %rax
movsd 0x8(%rax), %xmm0
movq -0xa8(%rbp), %rax
movsd 0x10(%rax), %xmm1
leaq -0x150(%rbp), %rdi
callq 0x5b520
movsd -0x40(%rbp), %xmm0
movq -0x60(%rbp), %rax
movq %rax, -0x160(%rbp)
movq -0x58(%rbp), %rax
movq %rax, -0x158(%rbp)
movq -0x50(%rbp), %rax
movq %rax, -0x170(%rbp)
movq -0x48(%rbp), %rax
movq %rax, -0x168(%rbp)
movsd -0x160(%rbp), %xmm1
movsd -0x158(%rbp), %xmm2
movsd -0x170(%rbp), %xmm3
movsd -0x168(%rbp), %xmm4
leaq -0x150(%rbp), %rdi
callq 0x7fdb0
movq -0x10(%rbp), %rdi
leaq 0x18ac2(%rip), %rsi     # 0x849df
callq 0x9530
movq %rax, %rdi
movsd -0x150(%rbp), %xmm0
callq 0x9a30
movq %rax, %rdi
leaq 0x169e8(%rip), %rsi     # 0x82924
callq 0x9530
movq %rax, %rdi
movsd -0x148(%rbp), %xmm0
callq 0x9a30
movq -0xa8(%rbp), %rax
movq 0x38(%rax), %rax
movq %rax, -0xa8(%rbp)
movl -0xac(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xac(%rbp)
jmp 0x6bc2b
movq -0x20(%rbp), %rax
cmpl $0x1, 0x1c(%rax)
jne 0x6bf91
movq -0x10(%rbp), %rdi
leaq 0x18a57(%rip), %rsi     # 0x849e3
callq 0x9530
movq -0x10(%rbp), %rdi
leaq 0x18a54(%rip), %rsi     # 0x849f0
callq 0x9530
movq %rax, %rdi
movq 0x4bf9d(%rip), %rsi     # 0xb7f48
callq 0x9590
cmpl $0x0, -0x2c(%rbp)
je 0x6bfc6
movq -0x10(%rbp), %rdi
leaq 0x16965(%rip), %rsi     # 0x82926
callq 0x9530
movq -0x10(%rbp), %rdi
leaq 0x18a4c(%rip), %rsi     # 0x84a1d
callq 0x9530
movq %rax, %rdi
movq -0x20(%rbp), %rsi
addq $0x90, %rsi
callq 0x9530
movq %rax, %rdi
leaq 0x189fd(%rip), %rsi     # 0x849f0
callq 0x9530
movq %rax, %rdi
movq 0x4bf46(%rip), %rsi     # 0xb7f48
callq 0x9590
cmpl $0x0, -0x2c(%rbp)
je 0x6c01d
movq -0x10(%rbp), %rdi
leaq 0x1690e(%rip), %rsi     # 0x82926
callq 0x9530
movq -0x10(%rbp), %rdi
leaq 0x189ca(%rip), %rsi     # 0x849f2
callq 0x9530
movq %rax, %rdi
movq 0x4bf11(%rip), %rsi     # 0xb7f48
callq 0x9590
addq $0x180, %rsp            # imm = 0x180
popq %rbp
retq
nopw %cs:(%rax,%rax)