// File: FreeSlave[P]vhlt/common/winding.cpp
// Function: Winding::getArea() const
vec_t           Winding::getArea() const
{
    unsigned int    i;
    vec3_t          d1, d2, cross;
    vec_t           total;

    //hlassert(m_NumPoints >= 3);

    total = 0.0;
    if (m_NumPoints >= 3)
    {
        for (i = 2; i < m_NumPoints; i++)
        {
            VectorSubtract(m_Points[i - 1], m_Points[0], d1);
            VectorSubtract(m_Points[i], m_Points[0], d2);
            CrossProduct(d1, d2, cross);
            total += 0.5 * VectorLength(cross);
        }
    }
    return total;
}

// Assembly:
subq $0x78, %rsp
movq %rdi, 0x70(%rsp)
movq 0x70(%rsp), %rax
movq %rax, (%rsp)
xorps %xmm0, %xmm0
movsd %xmm0, 0x8(%rsp)
cmpl $0x3, 0x8(%rax)
jb 0xe43d
movl $0x2, 0x6c(%rsp)
movq (%rsp), %rcx
movl 0x6c(%rsp), %eax
cmpl 0x8(%rcx), %eax
jae 0xe43b
movq (%rsp), %rax
movq 0x10(%rax), %rcx
movl 0x6c(%rsp), %edx
subl $0x1, %edx
movl %edx, %edx
imulq $0x18, %rdx, %rdx
addq %rdx, %rcx
movsd (%rcx), %xmm0
movq 0x10(%rax), %rcx
subsd (%rcx), %xmm0
movsd %xmm0, 0x50(%rsp)
movq 0x10(%rax), %rcx
movl 0x6c(%rsp), %edx
subl $0x1, %edx
movl %edx, %edx
imulq $0x18, %rdx, %rdx
addq %rdx, %rcx
movsd 0x8(%rcx), %xmm0
movq 0x10(%rax), %rcx
subsd 0x8(%rcx), %xmm0
movsd %xmm0, 0x58(%rsp)
movq 0x10(%rax), %rcx
movl 0x6c(%rsp), %edx
subl $0x1, %edx
movl %edx, %edx
imulq $0x18, %rdx, %rdx
addq %rdx, %rcx
movsd 0x10(%rcx), %xmm0
movq 0x10(%rax), %rcx
subsd 0x10(%rcx), %xmm0
movsd %xmm0, 0x60(%rsp)
movq 0x10(%rax), %rcx
movl 0x6c(%rsp), %edx
imulq $0x18, %rdx, %rdx
addq %rdx, %rcx
movsd (%rcx), %xmm0
movq 0x10(%rax), %rcx
subsd (%rcx), %xmm0
movsd %xmm0, 0x30(%rsp)
movq 0x10(%rax), %rcx
movl 0x6c(%rsp), %edx
imulq $0x18, %rdx, %rdx
addq %rdx, %rcx
movsd 0x8(%rcx), %xmm0
movq 0x10(%rax), %rcx
subsd 0x8(%rcx), %xmm0
movsd %xmm0, 0x38(%rsp)
movq 0x10(%rax), %rcx
movl 0x6c(%rsp), %edx
imulq $0x18, %rdx, %rdx
addq %rdx, %rcx
movsd 0x10(%rcx), %xmm0
movq 0x10(%rax), %rax
subsd 0x10(%rax), %xmm0
movsd %xmm0, 0x40(%rsp)
movsd 0x58(%rsp), %xmm0
movsd 0x40(%rsp), %xmm2
movsd 0x60(%rsp), %xmm1
mulsd 0x38(%rsp), %xmm1
movq %xmm1, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm1
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, 0x10(%rsp)
movsd 0x60(%rsp), %xmm0
movsd 0x30(%rsp), %xmm2
movsd 0x50(%rsp), %xmm1
mulsd 0x40(%rsp), %xmm1
movq %xmm1, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm1
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, 0x18(%rsp)
movsd 0x50(%rsp), %xmm0
movsd 0x38(%rsp), %xmm2
movsd 0x58(%rsp), %xmm1
mulsd 0x30(%rsp), %xmm1
movq %xmm1, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm1
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, 0x20(%rsp)
movsd 0x10(%rsp), %xmm1
movsd 0x10(%rsp), %xmm2
movsd 0x18(%rsp), %xmm0
mulsd 0x18(%rsp), %xmm0
mulsd %xmm2, %xmm1
addsd %xmm0, %xmm1
movsd 0x20(%rsp), %xmm0
movsd 0x20(%rsp), %xmm2
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
callq 0x42f0
movsd 0x8(%rsp), %xmm1
movsd 0x1f063(%rip), %xmm2    # 0x2d480
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, 0x8(%rsp)
movl 0x6c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x6c(%rsp)
jmp 0xe22d
jmp 0xe43d
movsd 0x8(%rsp), %xmm0
addq $0x78, %rsp
retq
nopl (%rax,%rax)