// File: 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
movq %rsp, %rbp
subq $0xb0, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x98(%rbp)
movl $0xc0, %edi
callq 0x9550
movq %rax, %rdi
movq %rdi, %rax
movq %rax, -0x90(%rbp)
callq 0x5e600
jmp 0x61b5f
movq -0x98(%rbp), %rdi
movq -0x90(%rbp), %rax
movq %rax, -0x20(%rbp)
movq 0x56ff0(%rip), %rax     # 0xb8b68
addq $0x1, %rax
movq %rax, 0x56fe5(%rip)     # 0xb8b68
movq 0x5700e(%rip), %rax     # 0xb8b98
addq $0x1, %rax
movq %rax, 0x57003(%rip)     # 0xb8b98
movq -0x20(%rbp), %rax
movl $0x3, 0xc(%rax)
movq -0x10(%rbp), %rax
movq %rax, -0xa0(%rbp)
addq $0x10, %rdi
movslq -0x14(%rbp), %rsi
callq 0x63990
movq -0xa0(%rbp), %rdi
movq %rax, %rsi
callq 0x63e00
movq -0x98(%rbp), %rsi
movsd %xmm0, -0x40(%rbp)
movsd %xmm1, -0x38(%rbp)
movq -0x20(%rbp), %rax
movq -0x40(%rbp), %rcx
movq %rcx, 0xb0(%rax)
movq -0x38(%rbp), %rcx
movq %rcx, 0xb8(%rax)
addq $0x10, %rsi
movq -0x20(%rbp), %rdi
addq $0x10, %rdi
callq 0x642a0
movq -0x20(%rbp), %rdi
addq $0x10, %rdi
callq 0x5add0
movl %eax, %ecx
movq -0x20(%rbp), %rax
movl %ecx, 0x8(%rax)
movl $0x0, -0x44(%rbp)
movq -0x98(%rbp), %rcx
movl -0x44(%rbp), %eax
cmpl 0x8(%rcx), %eax
jge 0x61d65
movq -0x20(%rbp), %rdi
addq $0x10, %rdi
movslq -0x44(%rbp), %rsi
callq 0x63990
movq %rax, %rcx
movq -0x98(%rbp), %rax
movsd (%rcx), %xmm0
movq -0x20(%rbp), %rcx
addsd 0xb0(%rcx), %xmm0
movsd %xmm0, -0x50(%rbp)
movsd -0x50(%rbp), %xmm0
divsd 0xa0(%rax), %xmm0
callq 0x9220
movq -0x98(%rbp), %rax
mulsd 0xa0(%rax), %xmm0
movsd %xmm0, -0x50(%rbp)
movsd -0x50(%rbp), %xmm0
movsd %xmm0, -0xb0(%rbp)
movq -0x20(%rbp), %rdi
addq $0x10, %rdi
movslq -0x44(%rbp), %rsi
callq 0x63990
movsd -0xb0(%rbp), %xmm0
movsd %xmm0, (%rax)
movq -0x20(%rbp), %rdi
addq $0x10, %rdi
movslq -0x44(%rbp), %rsi
callq 0x63990
movq %rax, %rcx
movq -0x98(%rbp), %rax
movsd 0x8(%rcx), %xmm0
movq -0x20(%rbp), %rcx
addsd 0xb8(%rcx), %xmm0
movsd %xmm0, -0x58(%rbp)
movsd -0x58(%rbp), %xmm0
divsd 0xa0(%rax), %xmm0
callq 0x9220
movq -0x98(%rbp), %rax
mulsd 0xa0(%rax), %xmm0
movsd %xmm0, -0x58(%rbp)
movsd -0x58(%rbp), %xmm0
movsd %xmm0, -0xa8(%rbp)
movq -0x20(%rbp), %rdi
addq $0x10, %rdi
movslq -0x44(%rbp), %rsi
callq 0x63990
movsd -0xa8(%rbp), %xmm0
movsd %xmm0, 0x8(%rax)
movl -0x44(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x44(%rbp)
jmp 0x61c20
movq -0x90(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
movl $0xc0, %esi
callq 0x9560
jmp 0x61ec1
movq -0x98(%rbp), %rsi
addq $0x40, %rsi
movq -0x20(%rbp), %rdi
addq $0x40, %rdi
callq 0x644f0
movq -0x98(%rbp), %rdi
movsd 0x78(%rdi), %xmm0
movq -0x20(%rbp), %rax
movsd %xmm0, 0x78(%rax)
addq $0x80, %rdi
movq -0x20(%rbp), %rsi
addq $0xb0, %rsi
callq 0x63d60
movq -0x98(%rbp), %rdi
movsd %xmm0, -0x68(%rbp)
movsd %xmm1, -0x60(%rbp)
movq -0x20(%rbp), %rax
movq -0x68(%rbp), %rcx
movq %rcx, 0x80(%rax)
movq -0x60(%rbp), %rcx
movq %rcx, 0x88(%rax)
movsd 0xa8(%rdi), %xmm0
movq -0x20(%rbp), %rax
movsd %xmm0, 0xa8(%rax)
movq -0x20(%rbp), %rax
movl $0x1, 0x90(%rax)
movq -0x20(%rbp), %rax
movl $0x0, 0x9c(%rax)
movl 0x98(%rdi), %ecx
movq -0x20(%rbp), %rax
movl %ecx, 0x98(%rax)
movl 0x94(%rdi), %ecx
movq -0x20(%rbp), %rax
movl %ecx, 0x94(%rax)
addq $0x58, %rdi
movq -0x20(%rbp), %rsi
addq $0xb0, %rsi
callq 0x63d60
movq -0x98(%rbp), %rdi
movsd %xmm0, -0x78(%rbp)
movsd %xmm1, -0x70(%rbp)
movq -0x20(%rbp), %rax
movq -0x78(%rbp), %rcx
movq %rcx, 0x58(%rax)
movq -0x70(%rbp), %rcx
movq %rcx, 0x60(%rax)
addq $0x58, %rdi
addq $0x10, %rdi
movq -0x20(%rbp), %rsi
addq $0xb0, %rsi
callq 0x63d60
movq -0x98(%rbp), %rax
movsd %xmm0, -0x88(%rbp)
movsd %xmm1, -0x80(%rbp)
movq -0x20(%rbp), %rcx
movq -0x88(%rbp), %rdx
movq %rdx, 0x68(%rcx)
movq -0x80(%rbp), %rdx
movq %rdx, 0x70(%rcx)
movsd 0xa0(%rax), %xmm0
movq -0x20(%rbp), %rax
movsd %xmm0, 0xa0(%rax)
movq -0x20(%rbp), %rax
addq $0xb0, %rsp
popq %rbp
retq
movq -0x28(%rbp), %rdi
callq 0x9960
nopw (%rax,%rax)