// File: /workspace/github_cpp_makefile_star2_O2/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x78, %rsp
movl %r9d, %ebp
movq %r8, %r12
movq %rcx, %r14
movq %rdx, %r15
movq %rsi, %rbx
testl %r9d, %r9d
je 0x292df
leaq 0xb61f(%rip), %r13      # 0x348ba
movq %rbx, %rdi
movq %r13, %rsi
callq 0x8420
leaq 0xd6c7(%rip), %rsi      # 0x36974
movq %rbx, %rdi
callq 0x8420
movq %rax, %rdi
callq 0x8200
movq (%rbx), %rax
movq -0x18(%rax), %rax
movl 0x18(%rbx,%rax), %ecx
andl $-0x4b, %ecx
orl $0x8, %ecx
movl %ecx, 0x18(%rbx,%rax)
movq %rbx, %rdi
movq %r13, %rsi
callq 0x8420
jmp 0x2930b
leaq 0xd68e(%rip), %rsi      # 0x36974
movq %rbx, %rdi
callq 0x8420
movq %rax, %rdi
callq 0x8200
movq (%rbx), %rax
movq -0x18(%rax), %rax
movl 0x18(%rbx,%rax), %ecx
andl $-0x4b, %ecx
orl $0x8, %ecx
movl %ecx, 0x18(%rbx,%rax)
leaq 0xd66c(%rip), %rsi      # 0x3697e
movq %rbx, %rdi
callq 0x8420
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
movq $0x6, 0x10(%rax,%rcx)
pushq $0x30
popq %rsi
movq %rax, %rdi
callq 0x8680
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
movl 0x18(%rax,%rcx), %edx
andl $-0x4b, %edx
orl $0x8, %edx
movl %edx, 0x18(%rax,%rcx)
movl 0x58(%r12), %esi
andl $0xffffff, %esi         # imm = 0xFFFFFF
movq %rax, %rdi
callq 0x8310
movq (%rbx), %rax
movq -0x18(%rax), %rax
movl 0x18(%rbx,%rax), %ecx
andl $-0x4b, %ecx
orl $0x2, %ecx
movl %ecx, 0x18(%rbx,%rax)
leaq 0xd871(%rip), %rsi      # 0x36bea
movq %rbx, %rdi
callq 0x8420
movsd 0x68(%r12), %xmm0
movq %rax, %rdi
callq 0x86b0
leaq 0xd62a(%rip), %rsi      # 0x369c1
movq %rax, %rdi
callq 0x8420
movq %rax, %rdi
callq 0x8200
movq 0x78(%r15), %rdi
movsd 0xa8(%rdi), %xmm0
movsd %xmm0, 0x10(%rsp)
movsd 0xb0(%rdi), %xmm0
movsd %xmm0, 0x8(%rsp)
movsd 0xb8(%rdi), %xmm0
movsd %xmm0, (%rsp)
callq 0x233aa
movapd %xmm0, %xmm2
movapd %xmm1, %xmm3
movsd 0x8(%rsp), %xmm5
subsd %xmm5, %xmm2
movsd (%rsp), %xmm4
subsd %xmm4, %xmm3
movups (%r14), %xmm0
leaq 0x60(%rsp), %rdi
movaps %xmm0, (%rdi)
movsd 0x10(%rsp), %xmm0
movsd %xmm2, 0x20(%rsp)
movapd %xmm2, %xmm1
movsd %xmm3, 0x18(%rsp)
movapd %xmm3, %xmm2
movapd %xmm5, %xmm3
callq 0x33062
movl %ebp, 0x2c(%rsp)
testl %ebp, %ebp
je 0x2943a
leaq 0xb488(%rip), %rsi      # 0x348ba
movq %rbx, %rdi
callq 0x8420
leaq 0xd55e(%rip), %rsi      # 0x3699f
movq %rbx, %rdi
callq 0x8420
movsd 0x60(%rsp), %xmm0
movq %rax, %rdi
callq 0x86b0
leaq 0xb45a(%rip), %r15      # 0x348b8
movq %rax, %rdi
movq %r15, %rsi
callq 0x8420
movsd 0x68(%rsp), %xmm0
movq %rax, %rdi
callq 0x86b0
leaq 0x10(%r14), %r13
xorl %ebp, %ebp
leaq 0x30(%rsp), %r12
cmpl 0x18(%r14), %ebp
jge 0x2960c
movq (%r13), %r13
cmpl $0x1, (%r13)
jne 0x2959c
movups 0x8(%r13), %xmm0
movaps %xmm0, 0x30(%rsp)
movq %r12, %rdi
movsd 0x10(%rsp), %xmm0
movsd 0x20(%rsp), %xmm1
movsd 0x18(%rsp), %xmm2
movsd 0x8(%rsp), %xmm3
movsd (%rsp), %xmm4
callq 0x33062
movups 0x18(%r13), %xmm0
movaps %xmm0, 0x50(%rsp)
leaq 0x50(%rsp), %rdi
movsd 0x10(%rsp), %xmm0
movsd 0x20(%rsp), %xmm1
movsd 0x18(%rsp), %xmm2
movsd 0x8(%rsp), %xmm3
movsd (%rsp), %xmm4
callq 0x33062
movups 0x28(%r13), %xmm0
movaps %xmm0, 0x40(%rsp)
leaq 0x40(%rsp), %rdi
movsd 0x10(%rsp), %xmm0
movsd 0x20(%rsp), %xmm1
movsd 0x18(%rsp), %xmm2
movsd 0x8(%rsp), %xmm3
movsd (%rsp), %xmm4
callq 0x33062
movq %rbx, %rdi
leaq 0xd476(%rip), %rsi      # 0x369ac
callq 0x8420
movsd 0x50(%rsp), %xmm0
movq %rax, %rdi
callq 0x86b0
movq %rax, %rdi
movq %r15, %rsi
callq 0x8420
movsd 0x58(%rsp), %xmm0
movq %rax, %rdi
callq 0x86b0
movq %rax, %rdi
movq %r15, %rsi
callq 0x8420
movsd 0x40(%rsp), %xmm0
movq %rax, %rdi
callq 0x86b0
movq %rax, %rdi
movq %r15, %rsi
callq 0x8420
movsd 0x48(%rsp), %xmm0
movq %rax, %rdi
callq 0x86b0
movq %rax, %rdi
movq %r15, %rsi
jmp 0x295d5
movups 0x8(%r13), %xmm0
movaps %xmm0, 0x30(%rsp)
movq %r12, %rdi
movsd 0x10(%rsp), %xmm0
movsd 0x20(%rsp), %xmm1
movsd 0x18(%rsp), %xmm2
movsd 0x8(%rsp), %xmm3
movsd (%rsp), %xmm4
callq 0x33062
movq %rbx, %rdi
leaq 0xd3db(%rip), %rsi      # 0x369b0
callq 0x8420
movsd 0x30(%rsp), %xmm0
movq %rax, %rdi
callq 0x86b0
movq %rax, %rdi
movq %r15, %rsi
callq 0x8420
movsd 0x38(%rsp), %xmm0
movq %rax, %rdi
callq 0x86b0
addq $0x38, %r13
incl %ebp
jmp 0x29482
cmpl $0x1, 0x1c(%r14)
jne 0x29622
leaq 0xd39a(%rip), %rsi      # 0x369b4
movq %rbx, %rdi
callq 0x8420
leaq 0xd398(%rip), %rsi      # 0x369c1
movq %rbx, %rdi
callq 0x8420
movq %rax, %rdi
callq 0x8200
cmpl $0x0, 0x2c(%rsp)
je 0x29697
leaq 0xb273(%rip), %r15      # 0x348ba
movq %rbx, %rdi
movq %r15, %rsi
callq 0x8420
leaq 0xd395(%rip), %rsi      # 0x369ee
movq %rbx, %rdi
callq 0x8420
addq $0x90, %r14
movq %rax, %rdi
movq %r14, %rsi
callq 0x8420
leaq 0xd347(%rip), %rsi      # 0x369c1
movq %rax, %rdi
callq 0x8420
movq %rax, %rdi
callq 0x8200
movq %rbx, %rdi
movq %r15, %rsi
callq 0x8420
jmp 0x296cf
leaq 0xd350(%rip), %rsi      # 0x369ee
movq %rbx, %rdi
callq 0x8420
addq $0x90, %r14
movq %rax, %rdi
movq %r14, %rsi
callq 0x8420
leaq 0xd302(%rip), %rsi      # 0x369c1
movq %rax, %rdi
callq 0x8420
movq %rax, %rdi
callq 0x8200
leaq 0xd2ed(%rip), %rsi      # 0x369c3
movq %rbx, %rdi
callq 0x8420
movq %rax, %rdi
callq 0x8200
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop