// File: /workspace/github_cpp_makefile_star2_O1/micahcc[P]polygon_skeleton/voronoi.cpp
// Function: Voronoi::Implementation::addEdge(std::shared_ptr<Voronoi::Node>, std::shared_ptr<Voronoi::Node>)
Voronoi::Edge::Ptr Voronoi::Implementation::addEdge(
        Node::Ptr nodeA,
        Node::Ptr nodeB)
{
    // the edges parents are the parents in common between the two input nodes
    std::set<size_t> common;
    std::set_intersection(
            nodeA->parents.begin(), nodeA->parents.end(),
            nodeB->parents.begin(), nodeB->parents.end(),
            std::inserter(common, common.begin()));

    auto out = std::make_shared<Edge>();
    out->parents = common;
    out->nodes[0] = nodeA;
    out->nodes[1] = nodeB;
    std::cerr << "adding edge!" << std::endl;
    std::cerr << "edge = [" << nodeA->x << ", " << nodeA->y << ";"
        << nodeB->x << ", " << nodeB->y << "]" << std::endl;
    m_edges.push_back(out);
    return out;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rcx, %r15
movq %rdx, %r12
movq %rsi, %r14
movq %rdi, %rbx
leaq -0x58(%rbp), %r9
movl $0x0, (%r9)
xorl %eax, %eax
movq %rax, 0x8(%r9)
movq %r9, 0x10(%r9)
movq %r9, 0x18(%r9)
movq %rax, 0x20(%r9)
movq (%rdx), %rsi
movq 0x20(%rsi), %rdi
addq $0x10, %rsi
movq (%rcx), %rcx
movq 0x20(%rcx), %rdx
addq $0x10, %rcx
leaq -0x60(%rbp), %r8
callq 0xe2cd
leaq -0x29(%rbp), %rsi
movq %rbx, %rdi
callq 0xe4f4
movq (%rbx), %rdi
leaq -0x60(%rbp), %rsi
callq 0xb7c0
movq (%rbx), %rdi
movq (%r12), %rax
movq %rax, 0x30(%rdi)
addq $0x38, %rdi
leaq 0x8(%r12), %rsi
callq 0xb77a
movq (%rbx), %rdi
movq (%r15), %rax
movq %rax, 0x40(%rdi)
addq $0x48, %rdi
leaq 0x8(%r15), %rsi
callq 0xb77a
movq 0xa2a0(%rip), %r13      # 0x13ff0
leaq 0x5d73(%rip), %rsi      # 0xfaca
movl $0xc, %edx
movq %r13, %rdi
callq 0x3280
movq (%r13), %rax
addq -0x18(%rax), %r13
movq %r13, %rdi
movl $0xa, %esi
callq 0x3230
movsbl %al, %esi
movq 0xa26d(%rip), %rdi      # 0x13ff0
callq 0x3030
movq %rax, %rdi
callq 0x3160
movq 0xa259(%rip), %rdi      # 0x13ff0
leaq 0x5d39(%rip), %rsi      # 0xfad7
movl $0x8, %edx
callq 0x3280
movq (%r12), %rax
cvtss2sd (%rax), %xmm0
movq 0xa239(%rip), %rdi      # 0x13ff0
callq 0x3330
movq %rax, %r13
leaq 0x5275(%rip), %rsi      # 0xf03b
movl $0x2, %edx
movq %rax, %rdi
callq 0x3280
movq (%r12), %rax
xorps %xmm0, %xmm0
cvtss2sd 0x4(%rax), %xmm0
movq %r13, %rdi
callq 0x3330
movq %rax, %r12
leaq 0x59e9(%rip), %rsi      # 0xf7da
movl $0x1, %edx
movq %rax, %rdi
callq 0x3280
movq (%r15), %rax
xorps %xmm0, %xmm0
cvtss2sd (%rax), %xmm0
movq %r12, %rdi
callq 0x3330
movq %rax, %r12
leaq 0x5221(%rip), %rsi      # 0xf03b
movl $0x2, %edx
movq %rax, %rdi
callq 0x3280
movq (%r15), %rax
xorps %xmm0, %xmm0
cvtss2sd 0x4(%rax), %xmm0
movq %r12, %rdi
callq 0x3330
movq %rax, %r15
leaq 0x5985(%rip), %rsi      # 0xf7c9
movl $0x1, %edx
movq %rax, %rdi
callq 0x3280
movq (%r15), %rax
movq -0x18(%rax), %rdi
addq %r15, %rdi
movl $0xa, %esi
callq 0x3230
movsbl %al, %esi
movq %r15, %rdi
callq 0x3030
movq %rax, %rdi
callq 0x3160
addq $0xc8, %r14
movq %r14, %rdi
movq %rbx, %rsi
callq 0xb216
leaq -0x60(%rbp), %rdi
callq 0xbaa0
movq %rbx, %rax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %r14
jmp 0x9ebb
movq %rax, %r14
movq 0x8(%rbx), %rdi
testq %rdi, %rdi
je 0x9ebb
callq 0x4fba
leaq -0x60(%rbp), %rdi
callq 0xbaa0
movq %r14, %rdi
callq 0x3390