// File: /workspace/github_cpp_makefile_star2_O3/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 0x70(%rsp), %rdx
movb %bpl, (%rdx)
leaq 0x98(%rsp), %rdi
leaq 0x8(%rsp), %r14
movq %r14, %rcx
callq 0x3464
movq 0x48(%rbx), %rax
subq 0x40(%rbx), %rax
sarq $0x3, %rax
movabsq $-0x5555555555555555, %rsi # imm = 0xAAAAAAAAAAAAAAAB
imulq %rax, %rsi
movb %bpl, (%r14)
leaq 0x70(%rsp), %rdi
leaq 0x8(%rsp), %rdx
leaq 0x7(%rsp), %rcx
callq 0x3464
leaq 0x40(%rbx), %r14
movq 0x28(%rbx), %rdx
movq 0x30(%rbx), %rsi
subq %rdx, %rsi
je 0x19a3
sarq $0x3, %rsi
imulq %r15, %rsi
movq (%r14), %rdi
xorl %eax, %eax
movq 0x70(%rsp), %r8
movq 0x98(%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 0x1975
cmpl $0x2, 0x4(%rdi,%r13,8)
ja 0x198c
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 0x195e
incq %rax
movl %eax, %ecx
addq $0x48, %rdx
cmpq %rcx, %rsi
ja 0x193c
leaq 0x48(%rsp), %rdi
leaq 0x70(%rsp), %rsi
callq 0x359e
leaq 0x8(%rsp), %rdi
leaq 0x48(%rsp), %rdx
movq %r14, %rsi
callq 0x34cc
movq 0x48(%rsp), %rdi
testq %rdi, %rdi
je 0x19f4
movq 0x68(%rsp), %rsi
subq %rdi, %rsi
callq 0x1100
xorl %eax, %eax
movq %rax, 0x48(%rsp)
movl %eax, 0x50(%rsp)
movq %rax, 0x58(%rsp)
movl %eax, 0x60(%rsp)
movq %rax, 0x68(%rsp)
leaq 0x20(%rsp), %rdi
leaq 0x98(%rsp), %rsi
callq 0x359e
leaq 0x28(%rbx), %rsi
leaq 0xc0(%rsp), %rdi
leaq 0x20(%rsp), %rdx
callq 0x362f
movq 0xc0(%rsp), %rdi
testq %rdi, %rdi
je 0x1a39
movq 0xd0(%rsp), %rsi
subq %rdi, %rsi
callq 0x1100
movq 0x20(%rsp), %rdi
testq %rdi, %rdi
je 0x1a69
movq 0x40(%rsp), %rsi
subq %rdi, %rsi
callq 0x1100
xorl %eax, %eax
movq %rax, 0x20(%rsp)
movl %eax, 0x28(%rsp)
movq %rax, 0x30(%rsp)
movl %eax, 0x38(%rsp)
movq %rax, 0x40(%rsp)
movq 0x28(%rbx), %rax
movq 0x30(%rbx), %rcx
subq %rax, %rcx
je 0x1acb
sarq $0x3, %rcx
imulq %r15, %rcx
movq 0x8(%rsp), %rdx
movq (%r14), %rsi
xorl %edi, %edi
movdqa 0x45a0(%rip), %xmm0     # 0x6030
xorl %r8d, %r8d
movl (%rax,%r8,4), %r9d
movl (%rdx,%r9,4), %r9d
movl %r9d, (%rax,%r8,4)
leaq (%r9,%r9,2), %r9
movq (%rsi,%r9,8), %xmm1
paddd %xmm0, %xmm1
movq %xmm1, (%rsi,%r9,8)
incq %r8
cmpq $0x3, %r8
jne 0x1a93
incq %rdi
movl %edi, %r8d
addq $0x48, %rax
cmpq %r8, %rcx
ja 0x1a90
leaq 0x10(%rbx), %rdi
movq 0x10(%rbx), %rax
movq 0x18(%rbx), %rsi
subq %rax, %rsi
sarq $0x5, %rsi
cmpq $0x4, %rsi
jb 0x1b2f
movl $0x3, %edx
movl $0x4, %ecx
shlq $0x5, %rdx
leal -0x4(%rcx), %esi
shlq $0x5, %rsi
movl (%rax,%rdx), %r8d
movl %r8d, (%rax,%rsi)
movups 0x8(%rax,%rdx), %xmm0
movups %xmm0, 0x8(%rax,%rsi)
movq 0x18(%rax,%rdx), %xmm0
movq %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 0x1aee
addq $-0x3, %rsi
callq 0x3758
movq 0x8(%rsp), %rdi
testq %rdi, %rdi
je 0x1b4f
movq 0x18(%rsp), %rsi
subq %rdi, %rsi
callq 0x1100
movq 0x70(%rsp), %rdi
testq %rdi, %rdi
je 0x1b69
movq 0x90(%rsp), %rsi
subq %rdi, %rsi
callq 0x1100
movq 0x98(%rsp), %rdi
testq %rdi, %rdi
je 0x1b86
movq 0xb8(%rsp), %rsi
subq %rdi, %rsi
callq 0x1100
addq $0xd8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq 0x20(%rsp), %rsi
testq %rsi, %rsi
je 0x1bd7
leaq 0x20(%rsp), %rdi
callq 0x11fe
jmp 0x1bd7
movq %rax, %rbx
movq 0x48(%rsp), %rsi
testq %rsi, %rsi
je 0x1bee
leaq 0x48(%rsp), %rdi
callq 0x11d0
jmp 0x1bee
movq %rax, %rbx
jmp 0x1bee
movq %rax, %rbx
jmp 0x1c1f
movq %rax, %rbx
movq 0x8(%rsp), %rdi
testq %rdi, %rdi
je 0x1bee
movq 0x18(%rsp), %rsi
subq %rdi, %rsi
callq 0x1100
movq 0x70(%rsp), %rdi
testq %rdi, %rdi
je 0x1c1f
movq 0x90(%rsp), %rsi
subq %rdi, %rsi
callq 0x1100
xorl %eax, %eax
movq %rax, 0x70(%rsp)
movl $0x0, 0x78(%rsp)
movq %rax, 0x80(%rsp)
movq 0x98(%rsp), %rdi
testq %rdi, %rdi
je 0x1c3c
movq 0xb8(%rsp), %rsi
subq %rdi, %rsi
callq 0x1100
movq %rbx, %rdi
callq 0x11a0