// File: /workspace/github_cpp_makefile_star2_O1/sunweilun[P]Delaunay/Mesh.cpp
// Function: Mesh::destroyGhostTriangle()
void Mesh::destroyGhostTriangle()
{
    std::vector<bool> ghostTriMap(triangles.size(), false);
    std::vector<bool> ghostEdgeMap(halfEdges.size(), false);
    for(unsigned i=0; i<triangles.size(); i++)
    {
        for(unsigned k=0; k<3; k++)
        {
            unsigned &eIndex = triangles[i].eIndices[k];
            HalfEdge &e = halfEdges[eIndex];
            if(e.vIndices[0] < 3 || e.vIndices[1] < 3)
            {
                ghostEdgeMap[eIndex] = true;
                ghostTriMap[i] = true;
            }
        }
    }
    std::vector<unsigned> indicesMap = lazyDeletion(halfEdges, ghostEdgeMap);
    lazyDeletion(triangles, ghostTriMap);
    for(unsigned i=0; i<triangles.size(); i++)
    {
        for(unsigned k=0; k<3; k++)
        {
            unsigned &eIndex = triangles[i].eIndices[k];
            eIndex = indicesMap[eIndex];
            HalfEdge &e = halfEdges[eIndex];
            e.vIndices[0] -= 3;
            e.vIndices[1] -= 3;
        }
    }

    for(unsigned i=3; i<vertices.size(); i++)
        vertices[i-3] = vertices[i];
    vertices.resize(vertices.size()-3);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xd8, %rsp
movq %rdi, %rbx
movq 0x30(%rdi), %rsi
subq 0x28(%rdi), %rsi
sarq $0x3, %rsi
movabsq $-0x71c71c71c71c71c7, %r15 # imm = 0x8E38E38E38E38E39
imulq %r15, %rsi
xorl %ebp, %ebp
leaq 0x8(%rsp), %rdx
movb %bpl, (%rdx)
leaq 0x30(%rsp), %rdi
leaq 0x58(%rsp), %r14
movq %r14, %rcx
callq 0x360a
movq 0x48(%rbx), %rax
subq 0x40(%rbx), %rax
sarq $0x3, %rax
movabsq $-0x5555555555555555, %rsi # imm = 0xAAAAAAAAAAAAAAAB
imulq %rax, %rsi
movb %bpl, (%r14)
leaq 0x8(%rsp), %rdi
leaq 0x58(%rsp), %rdx
leaq 0x7(%rsp), %rcx
callq 0x360a
leaq 0x40(%rbx), %r14
movq 0x28(%rbx), %rdx
movq 0x30(%rbx), %rsi
subq %rdx, %rsi
je 0x19a9
sarq $0x3, %rsi
imulq %r15, %rsi
movq (%r14), %rdi
xorl %eax, %eax
movq 0x8(%rsp), %r8
movq 0x30(%rsp), %r9
movq %rax, %r10
shrq $0x6, %r10
movl $0x1, %r11d
movl %eax, %ecx
shlq %cl, %r11
xorl %r12d, %r12d
movl (%rdx,%r12,4), %ecx
leaq (%rcx,%rcx,2), %r13
cmpl $0x3, (%rdi,%r13,8)
jb 0x197b
cmpl $0x2, 0x4(%rdi,%r13,8)
ja 0x1992
movl %ecx, %r13d
movl $0x1, %ebp
shlq %cl, %rbp
shrl $0x6, %r13d
orq %rbp, (%r8,%r13,8)
orq %r11, (%r9,%r10,8)
incq %r12
cmpq $0x3, %r12
jne 0x1964
incq %rax
movl %eax, %ecx
addq $0x48, %rdx
cmpq %rcx, %rsi
ja 0x1945
leaq 0x98(%rsp), %rdi
leaq 0x8(%rsp), %rsi
callq 0x3744
leaq 0x58(%rsp), %rdi
leaq 0x98(%rsp), %rdx
movq %r14, %rsi
callq 0x3672
movq 0x98(%rsp), %rdi
testq %rdi, %rdi
je 0x1a15
movq 0xb8(%rsp), %rsi
subq %rdi, %rsi
callq 0x1110
xorl %eax, %eax
movq %rax, 0x98(%rsp)
movl %eax, 0xa0(%rsp)
movq %rax, 0xa8(%rsp)
movl %eax, 0xb0(%rsp)
movq %rax, 0xb8(%rsp)
leaq 0x70(%rsp), %rdi
leaq 0x30(%rsp), %rsi
callq 0x3744
leaq 0x28(%rbx), %rsi
leaq 0xc0(%rsp), %rdi
leaq 0x70(%rsp), %rdx
callq 0x37d5
movq 0xc0(%rsp), %rdi
testq %rdi, %rdi
je 0x1a57
movq 0xd0(%rsp), %rsi
subq %rdi, %rsi
callq 0x1110
movq 0x70(%rsp), %rdi
testq %rdi, %rdi
je 0x1a93
movq 0x90(%rsp), %rsi
subq %rdi, %rsi
callq 0x1110
xorl %eax, %eax
movq %rax, 0x70(%rsp)
movl %eax, 0x78(%rsp)
movq %rax, 0x80(%rsp)
movl %eax, 0x88(%rsp)
movq %rax, 0x90(%rsp)
movq 0x28(%rbx), %rax
movq 0x30(%rbx), %rcx
subq %rax, %rcx
je 0x1ae8
sarq $0x3, %rcx
imulq %r15, %rcx
movq 0x58(%rsp), %rdx
movq (%r14), %rsi
xorl %edi, %edi
xorl %r8d, %r8d
movl (%rax,%r8,4), %r9d
movl (%rdx,%r9,4), %r9d
movl %r9d, (%rax,%r8,4)
leaq (%r9,%r9,2), %r9
addl $-0x3, (%rsi,%r9,8)
addl $-0x3, 0x4(%rsi,%r9,8)
incq %r8
cmpq $0x3, %r8
jne 0x1ab5
incq %rdi
movl %edi, %r8d
addq $0x48, %rax
cmpq %r8, %rcx
ja 0x1ab2
movq 0x10(%rbx), %rax
movq 0x18(%rbx), %rsi
subq %rax, %rsi
sarq $0x5, %rsi
cmpq $0x4, %rsi
jb 0x1b54
movl $0x3, %edx
movl $0x4, %ecx
shlq $0x5, %rdx
leal -0x4(%rcx), %esi
shlq $0x5, %rsi
movl (%rax,%rdx), %edi
movl %edi, (%rax,%rsi)
movsd 0x8(%rax,%rdx), %xmm0
movsd %xmm0, 0x8(%rax,%rsi)
movsd 0x10(%rax,%rdx), %xmm0
movsd %xmm0, 0x10(%rax,%rsi)
movsd 0x18(%rax,%rdx), %xmm0
movsd %xmm0, 0x18(%rax,%rsi)
movl %ecx, %edx
movq 0x10(%rbx), %rax
movq 0x18(%rbx), %rsi
subq %rax, %rsi
sarq $0x5, %rsi
incl %ecx
cmpq %rdx, %rsi
ja 0x1b07
addq $0x10, %rbx
addq $-0x3, %rsi
movq %rbx, %rdi
callq 0x38ec
movq 0x58(%rsp), %rdi
testq %rdi, %rdi
je 0x1b7b
movq 0x68(%rsp), %rsi
subq %rdi, %rsi
callq 0x1110
movq 0x8(%rsp), %rdi
testq %rdi, %rdi
je 0x1bab
movq 0x28(%rsp), %rsi
subq %rdi, %rsi
callq 0x1110
xorl %eax, %eax
movq %rax, 0x8(%rsp)
movl %eax, 0x10(%rsp)
movq %rax, 0x18(%rsp)
movl %eax, 0x20(%rsp)
movq %rax, 0x28(%rsp)
movq 0x30(%rsp), %rdi
testq %rdi, %rdi
je 0x1bdb
movq 0x50(%rsp), %rsi
subq %rdi, %rsi
callq 0x1110
xorl %eax, %eax
movq %rax, 0x30(%rsp)
movl %eax, 0x38(%rsp)
movq %rax, 0x40(%rsp)
movl %eax, 0x48(%rsp)
movq %rax, 0x50(%rsp)
addq $0xd8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq 0x70(%rsp), %rsi
testq %rsi, %rsi
je 0x1c32
leaq 0x70(%rsp), %rdi
callq 0x120e
jmp 0x1c32
movq %rax, %rbx
movq 0x98(%rsp), %rsi
testq %rsi, %rsi
je 0x1c49
leaq 0x98(%rsp), %rdi
callq 0x11e0
jmp 0x1c49
movq %rax, %rbx
jmp 0x1c49
movq %rax, %rbx
jmp 0x1c79
movq %rax, %rbx
movq 0x58(%rsp), %rdi
testq %rdi, %rdi
je 0x1c49
movq 0x68(%rsp), %rsi
subq %rdi, %rsi
callq 0x1110
movq 0x8(%rsp), %rdi
testq %rdi, %rdi
je 0x1c79
movq 0x28(%rsp), %rsi
subq %rdi, %rsi
callq 0x1110
xorl %eax, %eax
movq %rax, 0x8(%rsp)
movl %eax, 0x10(%rsp)
movq %rax, 0x18(%rsp)
movl %eax, 0x20(%rsp)
movq %rax, 0x28(%rsp)
movq 0x30(%rsp), %rdi
testq %rdi, %rdi
je 0x1ca9
movq 0x50(%rsp), %rsi
subq %rdi, %rsi
callq 0x1110
xorl %eax, %eax
movq %rax, 0x30(%rsp)
movl %eax, 0x38(%rsp)
movq %rax, 0x40(%rsp)
movl %eax, 0x48(%rsp)
movq %rax, 0x50(%rsp)
movq %rbx, %rdi
callq 0x11b0
nop