// File: /workspace/github_cpp_makefile_star2_O1/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 $0x68, %rsp
movq %r8, %r12
movq %rcx, %r14
movq %rdx, %r15
movq %rsi, %rbp
movl %r9d, 0x3c(%rsp)
testl %r9d, %r9d
je 0x2f651
leaq 0xe2dd(%rip), %r13      # 0x3d8ba
movl $0x3, %edx
movq %rbp, %rdi
movq %r13, %rsi
callq 0x74d0
leaq 0x10324(%rip), %rsi     # 0x3f918
movl $0x9, %edx
movq %rbp, %rdi
callq 0x74d0
movq (%rbp), %rax
movq -0x18(%rax), %rdi
addq %rbp, %rdi
movl $0xa, %esi
callq 0x73f0
movsbl %al, %esi
movq %rbp, %rdi
callq 0x7050
movq %rax, %rdi
callq 0x7300
movq (%rbp), %rax
movq -0x18(%rax), %rax
movl 0x18(%rbp,%rax), %ecx
andl $-0x4b, %ecx
orl $0x8, %ecx
movl %ecx, 0x18(%rbp,%rax)
movl $0x3, %edx
movq %rbp, %rdi
movq %r13, %rsi
callq 0x74d0
jmp 0x2f6a3
leaq 0x102c0(%rip), %rsi     # 0x3f918
movl $0x9, %edx
movq %rbp, %rdi
callq 0x74d0
movq (%rbp), %rax
movq -0x18(%rax), %rdi
addq %rbp, %rdi
movl $0xa, %esi
callq 0x73f0
movsbl %al, %esi
movq %rbp, %rdi
callq 0x7050
movq %rax, %rdi
callq 0x7300
movq (%rbp), %rax
movq -0x18(%rax), %rax
movl 0x18(%rbp,%rax), %ecx
andl $-0x4b, %ecx
orl $0x8, %ecx
movl %ecx, 0x18(%rbp,%rax)
leaq 0x10278(%rip), %rsi     # 0x3f922
movl $0x20, %edx
movq %rbp, %rdi
callq 0x74d0
movq (%rbp), %rax
movq -0x18(%rax), %rcx
movq $0x6, 0x10(%rbp,%rcx)
movq -0x18(%rax), %rax
leaq (%rax,%rbp), %rbx
cmpb $0x0, 0xe1(%rbp,%rax)
jne 0x2f6f4
movq %rbx, %rdi
movl $0x20, %esi
callq 0x73f0
movb %al, 0xe0(%rbx)
movb $0x1, 0xe1(%rbx)
movb $0x30, 0xe0(%rbx)
movq (%rbp), %rax
movq -0x18(%rax), %rax
movl 0x18(%rbp,%rax), %ecx
andl $-0x4b, %ecx
orl $0x8, %ecx
movl %ecx, 0x18(%rbp,%rax)
movl 0x58(%r12), %esi
andl $0xffffff, %esi         # imm = 0xFFFFFF
movq %rbp, %rdi
callq 0x72f0
movq (%rbp), %rax
movq -0x18(%rax), %rax
movl 0x18(%rbp,%rax), %ecx
andl $-0x4b, %ecx
orl $0x2, %ecx
movl %ecx, 0x18(%rbp,%rax)
leaq 0x1044d(%rip), %rsi     # 0x3fb8e
movl $0xe, %edx
movq %rbp, %rdi
callq 0x74d0
movsd 0x68(%r12), %xmm0
movq %rbp, %rdi
callq 0x7680
movq %rax, %rbx
leaq 0x101fe(%rip), %rsi     # 0x3f965
movl $0x1, %edx
movq %rax, %rdi
callq 0x74d0
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x73f0
movsbl %al, %esi
movq %rbx, %rdi
callq 0x7050
movq %rax, %rdi
callq 0x7300
movq 0x78(%r15), %rdi
movsd 0xa8(%rdi), %xmm0
movsd %xmm0, 0x18(%rsp)
movsd 0xb0(%rdi), %xmm0
movsd %xmm0, 0x30(%rsp)
movsd 0xb8(%rdi), %xmm0
movsd %xmm0, 0x28(%rsp)
callq 0x283b4
subsd 0x30(%rsp), %xmm0
movsd %xmm0, 0x48(%rsp)
subsd 0x28(%rsp), %xmm1
movsd %xmm1, 0x40(%rsp)
movsd (%r14), %xmm0
movsd %xmm0, 0x8(%rsp)
movsd 0x8(%r14), %xmm0
movsd %xmm0, (%rsp)
movsd 0x18(%rsp), %xmm0
callq 0x7790
movsd %xmm0, 0x10(%rsp)
movsd 0x18(%rsp), %xmm0
callq 0x70f0
movapd %xmm0, %xmm2
movsd 0x8(%rsp), %xmm5
movsd 0x48(%rsp), %xmm6
subsd %xmm6, %xmm5
movsd 0x40(%rsp), %xmm3
movsd (%rsp), %xmm0
subsd %xmm3, %xmm0
movapd %xmm2, %xmm1
mulsd %xmm0, %xmm1
movapd %xmm0, %xmm4
movapd %xmm5, %xmm0
movsd 0x10(%rsp), %xmm7
mulsd %xmm7, %xmm0
subsd %xmm1, %xmm0
addsd %xmm6, %xmm0
addsd 0x30(%rsp), %xmm0
mulsd %xmm7, %xmm4
mulsd %xmm5, %xmm2
addsd %xmm4, %xmm2
addsd %xmm3, %xmm2
addsd 0x28(%rsp), %xmm2
movsd %xmm2, 0x10(%rsp)
divsd 0xf841(%rip), %xmm0     # 0x3f0c8
callq 0x71c0
movsd %xmm0, (%rsp)
movsd 0x10(%rsp), %xmm0
divsd 0xf829(%rip), %xmm0     # 0x3f0c8
callq 0x71c0
movsd 0xf81c(%rip), %xmm1     # 0x3f0c8
movsd (%rsp), %xmm2
mulsd %xmm1, %xmm2
movsd %xmm2, (%rsp)
mulsd %xmm1, %xmm0
movsd %xmm0, 0x10(%rsp)
cmpl $0x0, 0x3c(%rsp)
je 0x2f8df
leaq 0xdfe8(%rip), %rsi      # 0x3d8ba
movl $0x3, %edx
movq %rbp, %rdi
callq 0x74d0
leaq 0x1005d(%rip), %rsi     # 0x3f943
movl $0xc, %edx
movq %rbp, %rdi
callq 0x74d0
movq %rbp, %rdi
movsd (%rsp), %xmm0
callq 0x7680
movq %rax, %rbx
leaq 0xdfae(%rip), %rsi      # 0x3d8b8
movl $0x1, %edx
movq %rax, %rdi
callq 0x74d0
movq %rbx, %rdi
movsd 0x10(%rsp), %xmm0
callq 0x7680
cmpl $0x0, 0x18(%r14)
jle 0x2fcda
leaq 0x10(%r14), %r15
xorl %r13d, %r13d
leaq 0xdf7a(%rip), %r12      # 0x3d8b8
movq (%r15), %r15
movl (%r15), %ebx
movsd 0x8(%r15), %xmm0
movsd %xmm0, 0x10(%rsp)
movsd 0x10(%r15), %xmm0
movsd %xmm0, (%rsp)
movsd 0x18(%rsp), %xmm0
callq 0x7790
movsd %xmm0, 0x8(%rsp)
movsd 0x18(%rsp), %xmm0
callq 0x70f0
movapd %xmm0, %xmm4
movsd 0x48(%rsp), %xmm3
movsd 0x10(%rsp), %xmm6
subsd %xmm3, %xmm6
movsd 0x40(%rsp), %xmm2
movsd (%rsp), %xmm0
subsd %xmm2, %xmm0
movapd %xmm4, %xmm1
mulsd %xmm0, %xmm1
movapd %xmm0, %xmm5
movapd %xmm6, %xmm0
movsd 0x8(%rsp), %xmm7
mulsd %xmm7, %xmm0
subsd %xmm1, %xmm0
addsd %xmm3, %xmm0
addsd 0x30(%rsp), %xmm0
mulsd %xmm7, %xmm5
mulsd %xmm6, %xmm4
addsd %xmm5, %xmm4
addsd %xmm2, %xmm4
addsd 0x28(%rsp), %xmm4
movsd %xmm4, (%rsp)
movsd 0xf6e3(%rip), %xmm1     # 0x3f0c8
divsd %xmm1, %xmm0
callq 0x71c0
movsd %xmm0, 0x10(%rsp)
movsd (%rsp), %xmm0
divsd 0xf6c7(%rip), %xmm0     # 0x3f0c8
callq 0x71c0
movsd %xmm0, (%rsp)
cmpl $0x1, %ebx
jne 0x2fc6a
movsd 0x18(%r15), %xmm0
movsd %xmm0, 0x58(%rsp)
movsd 0x20(%r15), %xmm0
movsd %xmm0, 0x8(%rsp)
movsd 0x18(%rsp), %xmm0
callq 0x7790
movsd %xmm0, 0x20(%rsp)
movsd 0x18(%rsp), %xmm0
callq 0x70f0
movapd %xmm0, %xmm4
movsd 0x48(%rsp), %xmm0
movsd 0x58(%rsp), %xmm6
subsd %xmm0, %xmm6
movapd %xmm0, %xmm3
movsd 0x40(%rsp), %xmm0
movsd 0x8(%rsp), %xmm5
subsd %xmm0, %xmm5
movapd %xmm0, %xmm2
movapd %xmm4, %xmm1
mulsd %xmm5, %xmm1
movapd %xmm6, %xmm0
movsd 0x20(%rsp), %xmm7
mulsd %xmm7, %xmm0
subsd %xmm1, %xmm0
addsd %xmm3, %xmm0
addsd 0x30(%rsp), %xmm0
mulsd %xmm7, %xmm5
mulsd %xmm6, %xmm4
addsd %xmm5, %xmm4
addsd %xmm2, %xmm4
addsd 0x28(%rsp), %xmm4
movsd %xmm4, 0x8(%rsp)
movsd 0xf60c(%rip), %xmm1     # 0x3f0c8
divsd %xmm1, %xmm0
callq 0x71c0
movsd 0xf5fb(%rip), %xmm1     # 0x3f0c8
mulsd %xmm1, %xmm0
movsd %xmm0, 0x58(%rsp)
movsd 0x8(%rsp), %xmm0
divsd %xmm1, %xmm0
callq 0x71c0
mulsd 0xf5da(%rip), %xmm0     # 0x3f0c8
movsd %xmm0, 0x8(%rsp)
movsd 0x28(%r15), %xmm0
movsd %xmm0, 0x50(%rsp)
movsd 0x30(%r15), %xmm0
movsd %xmm0, 0x20(%rsp)
movsd 0x18(%rsp), %xmm0
callq 0x7790
movsd %xmm0, 0x60(%rsp)
movsd 0x18(%rsp), %xmm0
callq 0x70f0
movapd %xmm0, %xmm4
movsd 0x48(%rsp), %xmm3
movsd 0x50(%rsp), %xmm6
subsd %xmm3, %xmm6
movsd 0x40(%rsp), %xmm2
movsd 0x20(%rsp), %xmm0
subsd %xmm2, %xmm0
movapd %xmm4, %xmm1
mulsd %xmm0, %xmm1
movapd %xmm0, %xmm5
movapd %xmm6, %xmm0
movsd 0x60(%rsp), %xmm7
mulsd %xmm7, %xmm0
subsd %xmm1, %xmm0
addsd %xmm3, %xmm0
addsd 0x30(%rsp), %xmm0
mulsd %xmm7, %xmm5
mulsd %xmm6, %xmm4
addsd %xmm5, %xmm4
addsd %xmm2, %xmm4
addsd 0x28(%rsp), %xmm4
movsd %xmm4, 0x20(%rsp)
divsd 0xf530(%rip), %xmm0     # 0x3f0c8
callq 0x71c0
movapd %xmm0, %xmm1
movsd 0xf51f(%rip), %xmm2     # 0x3f0c8
mulsd %xmm2, %xmm1
movsd %xmm1, 0x50(%rsp)
movsd 0x20(%rsp), %xmm0
divsd %xmm2, %xmm0
callq 0x71c0
mulsd 0xf4fe(%rip), %xmm0     # 0x3f0c8
movsd %xmm0, 0x20(%rsp)
movl $0x3, %edx
movq %rbp, %rdi
leaq 0xfd71(%rip), %rsi      # 0x3f950
callq 0x74d0
movq %rbp, %rdi
movsd 0x58(%rsp), %xmm0
callq 0x7680
movq %rax, %rbx
movl $0x1, %edx
movq %rax, %rdi
movq %r12, %rsi
callq 0x74d0
movq %rbx, %rdi
movsd 0x8(%rsp), %xmm0
callq 0x7680
movq %rax, %rbx
movl $0x1, %edx
movq %rax, %rdi
movq %r12, %rsi
callq 0x74d0
movq %rbx, %rdi
movsd 0x50(%rsp), %xmm0
callq 0x7680
movq %rax, %rbx
movl $0x1, %edx
movq %rax, %rdi
movq %r12, %rsi
callq 0x74d0
movq %rbx, %rdi
movsd 0x20(%rsp), %xmm0
callq 0x7680
movq %rax, %rbx
movl $0x1, %edx
movq %rax, %rdi
movq %r12, %rsi
callq 0x74d0
jmp 0x2fc81
movl $0x3, %edx
movq %rbp, %rdi
leaq 0xfcdb(%rip), %rsi      # 0x3f954
callq 0x74d0
movq %rbp, %rbx
movsd 0xf43f(%rip), %xmm1     # 0x3f0c8
movsd 0x10(%rsp), %xmm0
mulsd %xmm1, %xmm0
movsd (%rsp), %xmm2
mulsd %xmm1, %xmm2
movsd %xmm2, (%rsp)
movq %rbx, %rdi
callq 0x7680
movq %rax, %rbx
movl $0x1, %edx
movq %rax, %rdi
movq %r12, %rsi
callq 0x74d0
movq %rbx, %rdi
movsd (%rsp), %xmm0
callq 0x7680
addq $0x38, %r15
incl %r13d
cmpl 0x18(%r14), %r13d
jl 0x2f93e
cmpl $0x1, 0x1c(%r14)
jne 0x2fcf5
leaq 0xfc70(%rip), %rsi      # 0x3f958
movl $0x2, %edx
movq %rbp, %rdi
callq 0x74d0
leaq 0xfc69(%rip), %rsi      # 0x3f965
movl $0x1, %edx
movq %rbp, %rdi
callq 0x74d0
movq (%rbp), %rax
movq -0x18(%rax), %rdi
addq %rbp, %rdi
movl $0xa, %esi
callq 0x73f0
movsbl %al, %esi
movq %rbp, %rdi
callq 0x7050
movq %rax, %rdi
callq 0x7300
cmpl $0x0, 0x3c(%rsp)
je 0x2fdd2
leaq 0xdb77(%rip), %r15      # 0x3d8ba
movl $0x3, %edx
movq %rbp, %rdi
movq %r15, %rsi
callq 0x74d0
leaq 0xfc38(%rip), %rsi      # 0x3f992
movl $0x12, %edx
movq %rbp, %rdi
callq 0x74d0
addq $0x90, %r14
movq %r14, %rdi
callq 0x71d0
movq %rbp, %rdi
movq %r14, %rsi
movq %rax, %rdx
callq 0x74d0
leaq 0xfbda(%rip), %rsi      # 0x3f965
movl $0x1, %edx
movq %rbp, %rdi
callq 0x74d0
movq (%rbp), %rax
movq -0x18(%rax), %rdi
addq %rbp, %rdi
movl $0xa, %esi
callq 0x73f0
movsbl %al, %esi
movq %rbp, %rdi
callq 0x7050
movq %rax, %rdi
callq 0x7300
movl $0x3, %edx
movq %rbp, %rdi
movq %r15, %rsi
callq 0x74d0
jmp 0x2fe3f
leaq 0xfbb9(%rip), %rsi      # 0x3f992
movl $0x12, %edx
movq %rbp, %rdi
callq 0x74d0
addq $0x90, %r14
movq %r14, %rdi
callq 0x71d0
movq %rbp, %rdi
movq %r14, %rsi
movq %rax, %rdx
callq 0x74d0
leaq 0xfb5b(%rip), %rsi      # 0x3f965
movl $0x1, %edx
movq %rbp, %rdi
callq 0x74d0
movq (%rbp), %rax
movq -0x18(%rax), %rdi
addq %rbp, %rdi
movl $0xa, %esi
callq 0x73f0
movsbl %al, %esi
movq %rbp, %rdi
callq 0x7050
movq %rax, %rdi
callq 0x7300
leaq 0xfb21(%rip), %rsi      # 0x3f967
movl $0x2a, %edx
movq %rbp, %rdi
callq 0x74d0
movq (%rbp), %rax
movq -0x18(%rax), %rdi
addq %rbp, %rdi
movl $0xa, %esi
callq 0x73f0
movsbl %al, %esi
movq %rbp, %rdi
callq 0x7050
movq %rax, %rdi
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x7300
nop