// File: /workspace/github_cpp_makefile_star2_O3/sunweilun[P]Delaunay/Mesh.cpp
// Function: Mesh::updateConfGraph(unsigned int, unsigned int)
void Mesh::updateConfGraph(unsigned vIndex, unsigned tIndex)
{
    unsigned startEdgeIndex = MAX_UINT;
    for(unsigned i=0; i<3; i++)
    {
        unsigned ei = triangles[tIndex].eIndices[i];
        if(halfEdges[ei].vIndices[0] == vIndex)
            startEdgeIndex = ei;
    }

    unsigned eIndex = startEdgeIndex;

    std::unordered_set<unsigned> confVertIndices;
    do
    {
        Triangle &t = triangles[halfEdges[eIndex].tIndex];
        confVertIndices.insert(t.confVertIndices.begin(), t.confVertIndices.end());

        t.confVertIndices.clear();
        unsigned &neighborIndex = halfEdges[eIndex].neighborIndex;
        eIndex = halfEdges[neighborIndex].nextIndex;
    }
    while(eIndex != startEdgeIndex);

    confVertIndices.erase(vIndex);

    for(auto it = confVertIndices.begin(); it != confVertIndices.end(); it++)
    {
        do
        {
            unsigned triIndex = halfEdges[eIndex].tIndex;
            if(inTriangle(triIndex, vertices[*it].pos))
            {
                vertices[*it].confTriIndex = triIndex;
                triangles[triIndex].confVertIndices.insert(*it);
                eIndex = startEdgeIndex;
                break;
            }
            unsigned &neighborIndex = halfEdges[eIndex].neighborIndex;
            eIndex = halfEdges[neighborIndex].nextIndex;
        }
        while(eIndex != startEdgeIndex);
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x68, %rsp
movq %rdi, %rbx
movl %esi, 0x24(%rsp)
movl %edx, %eax
leaq (%rax,%rax,8), %rcx
shlq $0x3, %rcx
addq 0x28(%rdi), %rcx
movq 0x40(%rdi), %rax
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
xorl %edx, %edx
movl (%rcx,%rdx,4), %edi
leaq (%rdi,%rdi,2), %r8
cmpl %esi, (%rax,%r8,8)
cmovel %edi, %ebp
incq %rdx
cmpq $0x3, %rdx
jne 0x2842
leaq 0x60(%rsp), %rcx
movq %rcx, -0x30(%rcx)
movq $0x1, -0x28(%rcx)
xorps %xmm0, %xmm0
movups %xmm0, -0x20(%rcx)
movl $0x3f800000, -0x10(%rcx) # imm = 0x3F800000
movups %xmm0, -0x8(%rcx)
leaq 0x30(%rsp), %r14
leaq 0x18(%rsp), %r15
movl %ebp, %ecx
movl %ecx, %ecx
leaq (%rcx,%rcx,2), %rcx
movq %rcx, 0x10(%rsp)
movl 0x8(%rax,%rcx,8), %eax
movq 0x28(%rbx), %rcx
leaq (%rax,%rax,8), %r12
movq %rcx, 0x8(%rsp)
movq 0x20(%rcx,%r12,8), %r13
movq %r14, 0x18(%rsp)
testq %r13, %r13
je 0x28c8
leaq 0x8(%r13), %rsi
movq %r14, %rdi
movq %r15, %rdx
callq 0x5136
movq (%r13), %r13
jmp 0x28ae
movq 0x8(%rsp), %rax
leaq (%rax,%r12,8), %rdi
addq $0x10, %rdi
callq 0x3850
movq 0x40(%rbx), %rax
movq 0x10(%rsp), %rcx
movl 0x14(%rax,%rcx,8), %ecx
leaq (%rcx,%rcx,2), %rcx
movl 0xc(%rax,%rcx,8), %ecx
cmpl %ebp, %ecx
jne 0x2888
leaq 0x30(%rsp), %rdi
leaq 0x24(%rsp), %rsi
callq 0x53be
movq 0x40(%rsp), %rcx
testq %rcx, %rcx
je 0x29b0
movq 0x10(%rbx), %rax
movq 0x40(%rbx), %r15
leaq 0x8(%rcx), %rdx
movq %rdx, 0x8(%rsp)
movq %rcx, 0x10(%rsp)
movl 0x8(%rcx), %ecx
shlq $0x5, %rcx
leaq (%rax,%rcx), %rdx
movq %rdx, 0x28(%rsp)
leaq (%rax,%rcx), %r12
addq $0x8, %r12
movl %ebp, %eax
movl %eax, %eax
leaq (%rax,%rax,2), %r14
movl 0x8(%r15,%r14,8), %r13d
movq %rbx, %rdi
movl %r13d, %esi
movq %r12, %rdx
callq 0x1c44
testb %al, %al
jne 0x2973
leaq (%r15,%r14,8), %rax
movl 0x14(%rax), %eax
leaq (%rax,%rax,2), %rax
movl 0xc(%r15,%rax,8), %eax
cmpl %ebp, %eax
jne 0x2940
jmp 0x29a3
movq 0x28(%rsp), %rax
movl %r13d, (%rax)
movq 0x28(%rbx), %rax
leaq (,%r13,8), %rcx
addq %r13, %rcx
leaq 0x10(%rax,%rcx,8), %rdi
movq %rdi, 0x18(%rsp)
movq 0x8(%rsp), %rsi
leaq 0x18(%rsp), %rdx
callq 0x5136
movq 0x10(%rsp), %rcx
movq (%rcx), %rcx
jmp 0x2907
leaq 0x30(%rsp), %rdi
callq 0x382a
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x29cd
jmp 0x29cd
movq %rax, %rbx
leaq 0x30(%rsp), %rdi
callq 0x382a
movq %rbx, %rdi
callq 0x11a0