// File: /workspace/github_cpp_makefile_star2_O1/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 0xdb00
movq %rax, %r12
testb $0x1, %dl
je 0x85f9
movq %r13, %rdi
movq %r15, %rsi
movq %r14, %rdx
callq 0x700e
movaps %xmm0, -0x60(%rbp)
movq $0x0, (%rbx)
leaq 0x8(%rbx), %rdi
movq %rdi, -0x38(%rbp)
leaq -0x50(%rbp), %rdx
movq %rbx, %rsi
callq 0xde8e
movq (%rbx), %rax
movq %rax, 0x20(%r12)
addq $0x28, %r12
movq %r12, %rdi
movq -0x38(%rbp), %rsi
movq %rsi, %r12
callq 0xb77a
movq (%rbx), %rdi
movq -0x30(%rbp), %rax
movq 0xe0(%rax), %rax
subq (%rax), %r13
addq $0x8, %rdi
sarq $0x3, %r13
shrq $0x3, %r13
leaq -0x50(%rbp), %rax
movq %r13, (%rax)
leaq -0x50(%rbp), %rsi
callq 0xe0be
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 0xe0be
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 0xe0be
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 0x8629
movq 0x20(%r12), %rax
testq %rax, %rax
je 0x863b
movq %rax, (%rbx)
movq 0x28(%r12), %rax
movq %rax, 0x8(%rbx)
testq %rax, %rax
je 0x8629
movq 0xb9b5(%rip), %rcx      # 0x13fd0
cmpb $0x0, (%rcx)
je 0x8625
incl 0x8(%rax)
jmp 0x8629
lock
incl 0x8(%rax)
movq %rbx, %rax
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x73b5(%rip), %rdi      # 0xf9f7
leaq 0x6cc1(%rip), %rsi      # 0xf30a
leaq 0x73c7(%rip), %rcx      # 0xfa17
movl $0x3d6, %edx            # imm = 0x3D6
callq 0x3140
jmp 0x865e
jmp 0x865e
movq %rax, %rbx
movq (%r12), %rdi
testq %rdi, %rdi
je 0x866f
callq 0x4fba
movq %rbx, %rdi
callq 0x3390
nop