// File: /workspace/github_cpp_makefile_star2_O3/micahcc[P]polygon_skeleton/voronoi.cpp
// Function: Voronoi::Implementation::getNode(Vector const*, Vector const*, Vector const*)
Voronoi::Node::Ptr Voronoi::Implementation::getNode(
        const Point* ptA, const Point* ptB, const Point* ptC)
{
    orderPoints(ptA, ptB, ptC);
    auto result = m_nodes.emplace(std::make_tuple(ptA, ptB, ptC), nullptr);

    // if node exists, just return it
    if(!result.second) {
        assert(result.first->second != nullptr);
        return result.first->second;
    }

    // create and fill out the new node
    auto circle = solveCircle(*ptA, *ptB, *ptC);

    // need to construct a new node and add its parents and location
    auto new_node = std::make_shared<Node>();
    result.first->second = new_node;

    // Add parents
    new_node->parents.insert((ptA - m_points->data()) / sizeof(Point));
    new_node->parents.insert((ptB - m_points->data()) / sizeof(Point));
    new_node->parents.insert((ptC - m_points->data()) / sizeof(Point));

    // Add position
    new_node->x = circle.center.x;
    new_node->y = circle.center.y;

    return new_node;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
cmpq %rcx, %rdx
movq %rcx, %r13
cmovaq %rdx, %r13
cmovaq %rcx, %rdx
cmpq %r8, %r13
movq %r8, %r14
cmovaq %r13, %r14
cmovaq %r8, %r13
cmpq %r13, %rdx
movq %r13, %r15
cmovaq %rdx, %r15
cmovbeq %rdx, %r13
movq %rdi, %rbx
movq %rsi, -0x30(%rbp)
leaq 0x90(%rsi), %rdi
leaq -0x50(%rbp), %rsi
movq %r14, (%rsi)
movq %r15, 0x8(%rsi)
movq %r13, 0x10(%rsi)
leaq -0x68(%rbp), %rdx
movq $0x0, (%rdx)
callq 0xdb52
movq %rax, %r12
testb $0x1, %dl
je 0x85fe
movq %r13, %rdi
movq %r15, %rsi
movq %r14, %rdx
callq 0x6fcc
movaps %xmm0, -0x60(%rbp)
leaq 0x8(%rbx), %rax
movq %rax, -0x38(%rbp)
movl $0xa8, %edi
callq 0x3240
movabsq $0x100000001, %rcx      # imm = 0x100000001
movq %rcx, 0x8(%rax)
leaq 0xb7ef(%rip), %rcx      # 0x13cd8
movq %rcx, (%rax)
leaq 0x10(%rax), %rcx
leaq 0x20(%rax), %rdx
xorps %xmm0, %xmm0
movups %xmm0, 0x30(%rax)
movups %xmm0, 0x60(%rax)
movups %xmm0, 0x10(%rax)
movups %xmm0, 0x20(%rax)
movups %xmm0, 0x40(%rax)
movups %xmm0, 0x50(%rax)
movups %xmm0, 0x70(%rax)
movups %xmm0, 0x80(%rax)
movq %rdx, 0x30(%rax)
movq %rdx, 0x38(%rax)
leaq 0x50(%rax), %rdx
movq %rdx, 0x60(%rax)
movq %rdx, 0x68(%rax)
leaq 0x80(%rax), %rdx
movq %rdx, 0x90(%rax)
movq %rdx, 0x98(%rax)
movq $0x0, 0xa0(%rax)
movq %rax, 0x8(%rbx)
movq %rcx, (%rbx)
movq %rcx, 0x20(%r12)
addq $0x28, %r12
movq %r12, %rdi
movq -0x38(%rbp), %rsi
movq %rsi, %r12
callq 0xb802
movq (%rbx), %rdi
addq $0x8, %rdi
movq -0x30(%rbp), %rax
movq 0xe0(%rax), %rax
subq (%rax), %r13
sarq $0x3, %r13
shrq $0x3, %r13
leaq -0x50(%rbp), %rsi
movq %r13, (%rsi)
callq 0xe046
movq (%rbx), %rdi
addq $0x8, %rdi
movq -0x30(%rbp), %rax
movq 0xe0(%rax), %rax
subq (%rax), %r15
sarq $0x3, %r15
shrq $0x3, %r15
leaq -0x50(%rbp), %rsi
movq %r15, (%rsi)
callq 0xe046
movq (%rbx), %rdi
addq $0x8, %rdi
movq -0x30(%rbp), %rax
movq 0xe0(%rax), %rax
subq (%rax), %r14
sarq $0x3, %r14
shrq $0x3, %r14
leaq -0x50(%rbp), %rsi
movq %r14, (%rsi)
callq 0xe046
movq (%rbx), %rax
movaps -0x60(%rbp), %xmm0
movss %xmm0, (%rax)
shufps $0x55, %xmm0, %xmm0     # xmm0 = xmm0[1,1,1,1]
movss %xmm0, 0x4(%rax)
jmp 0x862e
movq 0x20(%r12), %rax
testq %rax, %rax
je 0x8640
movq %rax, (%rbx)
movq 0x28(%r12), %rax
movq %rax, 0x8(%rbx)
testq %rax, %rax
je 0x862e
movq 0xb9b0(%rip), %rcx      # 0x13fd0
cmpb $0x0, (%rcx)
je 0x862a
incl 0x8(%rax)
jmp 0x862e
lock
incl 0x8(%rax)
movq %rbx, %rax
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x73a0(%rip), %rdi      # 0xf9e7
leaq 0x6cac(%rip), %rsi      # 0xf2fa
leaq 0x73b2(%rip), %rcx      # 0xfa07
movl $0x3d6, %edx            # imm = 0x3D6
callq 0x3140
jmp 0x8663
jmp 0x8663
movq %rax, %rbx
movq (%r12), %rdi
testq %rdi, %rdi
je 0x8674
callq 0x4f9a
movq %rbx, %rdi
callq 0x3380