// File: /workspace/github_cpp_makefile_star2_O1/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 $0x18, %rsp
movl %edx, %ebp
movq %rsi, %r15
movq %rdi, %rbx
movl $0xc0, %edi
callq 0x7430
movq %rax, %r14
leaq 0x295d8(%rip), %rax     # 0x51ca0
movq %rax, (%r14)
leaq 0x10(%r14), %r12
xorl %r13d, %r13d
movl %r13d, 0x8(%r14)
movl $0x8c, %edx
movq %r12, %rdi
xorl %esi, %esi
callq 0x7270
xorps %xmm0, %xmm0
movups %xmm0, 0xb0(%r14)
movl $0x1, 0x9c(%r14)
movq $0x0, 0xa8(%r14)
movabsq $0x3f1a36e2eb1c432d, %rax # imm = 0x3F1A36E2EB1C432D
incq 0x2a2e9(%rip)           # 0x52a00
movq %rax, 0xa0(%r14)
incq 0x2a30b(%rip)           # 0x52a30
movl %r13d, 0xc(%r14)
incq 0x2a2e8(%rip)           # 0x52a18
incq 0x2a311(%rip)           # 0x52a48
movl $0x3, 0xc(%r14)
leaq 0x10(%rbx), %rsi
movslq %ebp, %rax
movq 0x10(%rbx), %rcx
shlq $0x4, %rax
movsd (%r15), %xmm0
movsd 0x8(%r15), %xmm1
subsd (%rcx,%rax), %xmm0
subsd 0x8(%rcx,%rax), %xmm1
movsd %xmm0, 0xb0(%r14)
movsd %xmm1, 0xb8(%r14)
movq %r12, %rdi
callq 0x29d7a
movq 0x10(%r14), %r15
movq 0x18(%r14), %rax
subq %r15, %rax
shrq $0x4, %rax
movl %eax, 0x8(%r14)
movslq 0x8(%rbx), %r12
testq %r12, %r12
jle 0x28814
movsd 0xa0(%rbx), %xmm0
movsd %xmm0, 0x8(%rsp)
shlq $0x4, %r12
xorl %r13d, %r13d
movsd (%r15,%r13), %xmm0
movsd 0x8(%r15,%r13), %xmm1
movsd %xmm1, 0x10(%rsp)
addsd 0xb0(%r14), %xmm0
divsd 0x8(%rsp), %xmm0
callq 0x71c0
movsd 0x8(%rsp), %xmm1
mulsd %xmm1, %xmm0
movsd %xmm0, (%r15,%r13)
movsd 0x10(%rsp), %xmm0
addsd 0xb8(%r14), %xmm0
divsd %xmm1, %xmm0
callq 0x71c0
mulsd 0x8(%rsp), %xmm0
movsd %xmm0, 0x8(%r15,%r13)
addq $0x10, %r13
cmpq %r13, %r12
jne 0x287af
leaq 0x40(%rbx), %rsi
movq %r14, %rdi
addq $0x40, %rdi
callq 0x29e66
movsd 0x78(%rbx), %xmm0
movsd %xmm0, 0x78(%r14)
movsd 0xb0(%r14), %xmm0
movsd 0xb8(%r14), %xmm1
movsd 0x80(%rbx), %xmm2
addsd %xmm0, %xmm2
movsd 0x88(%rbx), %xmm3
addsd %xmm1, %xmm3
movsd %xmm2, 0x80(%r14)
movsd %xmm3, 0x88(%r14)
movsd 0xa8(%rbx), %xmm2
movsd %xmm2, 0xa8(%r14)
movl $0x1, 0x90(%r14)
movl $0x0, 0x9c(%r14)
movl 0x98(%rbx), %eax
movl %eax, 0x98(%r14)
movl 0x94(%rbx), %eax
movl %eax, 0x94(%r14)
movsd 0x58(%rbx), %xmm2
addsd %xmm0, %xmm2
movsd 0x60(%rbx), %xmm3
addsd %xmm1, %xmm3
movsd %xmm2, 0x58(%r14)
movsd %xmm3, 0x60(%r14)
addsd 0x68(%rbx), %xmm0
addsd 0x70(%rbx), %xmm1
movsd %xmm0, 0x68(%r14)
movsd %xmm1, 0x70(%r14)
movsd 0xa0(%rbx), %xmm0
movsd %xmm0, 0xa0(%r14)
movq %r14, %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop