// File: /workspace/github_cpp_makefile_star2_O2/thierry7100[P]CutOptim/src/Geometry.cpp
// Function: Polygon::Translate(Point const*, int)
Polygon *Polygon::Translate(const Point *pT, int idx_vertex)
{
Polygon *Translated = new Polygon;

    nbTranslatedPoly++;
    nbCreatedTranslatedPoly++;
    Translated->TypePoly = TranslatedPoly;
    Translated->pt_Translation = *pT - _Vertices[idx_vertex];
    Translated->_Vertices = _Vertices;          //      Copy vertice vector
    Translated->nVertices = Translated->_Vertices.size();
    for ( int i = 0; i < nVertices; i++)
    {
        double newx = Translated->_Vertices[i].x + Translated->pt_Translation.x;
        newx = round(newx/precision)*precision;
        Translated->_Vertices[i].x = newx;
        double newy = Translated->_Vertices[i].y + Translated->pt_Translation.y;
        newy = round(newy/precision)*precision;
        Translated->_Vertices[i].y = newy;
    }
    Translated->_Angles = _Angles;
    Translated->poly_area = poly_area;
    Translated->poly_centroid = poly_centroid + Translated->pt_Translation;
    Translated->angle_rotation = angle_rotation;
    Translated->poly_centroid_ok = 1;
    Translated->poly_changed = 0;
    Translated->poly_closed = poly_closed;
    Translated->poly_clockwise = poly_clockwise;
    Translated->BoundingBox.A = BoundingBox.A + Translated->pt_Translation;
    Translated->BoundingBox.B = BoundingBox.B + Translated->pt_Translation;
    Translated->precision = precision;
    return Translated;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movl %edx, %ebp
movq %rsi, %r15
movq %rdi, %rbx
movl $0xc0, %edi
callq 0x8440
movq %rax, %r14
movq %rax, %rdi
callq 0x21f2c
incq 0x2a46c(%rip)           # 0x4da48
incq 0x2a495(%rip)           # 0x4da78
movl $0x3, 0xc(%r14)
leaq 0x10(%rbx), %rsi
movslq %ebp, %rax
movq 0x10(%rbx), %rcx
shlq $0x4, %rax
movupd (%r15), %xmm0
movupd (%rcx,%rax), %xmm1
subpd %xmm1, %xmm0
movupd %xmm0, 0xb0(%r14)
leaq 0x10(%r14), %rdi
callq 0x246f4
movq 0x10(%r14), %r15
movq 0x18(%r14), %rax
subq %r15, %rax
shrq $0x4, %rax
movl %eax, 0x8(%r14)
movslq 0x8(%rbx), %r12
movupd 0xa0(%rbx), %xmm0
unpcklpd %xmm0, %xmm0            # xmm0 = xmm0[0,0]
movapd %xmm0, (%rsp)
xorl %r13d, %r13d
cmpq %r12, %r13
jge 0x2369e
movupd (%r15), %xmm1
movupd 0xb0(%r14), %xmm0
addpd %xmm1, %xmm0
divpd (%rsp), %xmm0
movapd %xmm0, 0x10(%rsp)
callq 0x81a0
movapd %xmm0, 0x20(%rsp)
movapd 0x10(%rsp), %xmm0
unpckhpd %xmm0, %xmm0            # xmm0 = xmm0[1,1]
callq 0x81a0
movapd 0x20(%rsp), %xmm1
unpcklpd %xmm0, %xmm1            # xmm1 = xmm1[0],xmm0[0]
mulpd (%rsp), %xmm1
movupd %xmm1, (%r15)
incq %r13
addq $0x10, %r15
jmp 0x23645
leaq 0x40(%rbx), %rsi
movq %r14, %rdi
addq $0x40, %rdi
callq 0x247c0
movsd 0x78(%rbx), %xmm0
movsd %xmm0, 0x78(%r14)
movl $0x1, 0x90(%r14)
andl $0x0, 0x9c(%r14)
movq 0x94(%rbx), %rax
movq %rax, 0x94(%r14)
movupd 0xb0(%r14), %xmm0
movupd 0x80(%rbx), %xmm1
addpd %xmm0, %xmm1
movupd %xmm1, 0x80(%r14)
movupd 0x58(%rbx), %xmm1
addpd %xmm0, %xmm1
movupd %xmm1, 0x58(%r14)
movupd 0x68(%rbx), %xmm1
addpd %xmm0, %xmm1
movupd %xmm1, 0x68(%r14)
movups 0xa0(%rbx), %xmm0
movups %xmm0, 0xa0(%r14)
movq %r14, %rax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop