// File: /workspace/github_cpp_makefile_star2_O2/micahcc[P]polygon_skeleton/voronoi.cpp
// Function: CircleQueue::insert(double, Intersection const&, Intersection const&)
void insert(double sweep_y, const Intersection& left_int, const Intersection& right_int)
    {
        if(left_int.pt_left == nullptr) return;
        if(right_int.pt_right == nullptr) return;
        if((left_int.pt_left == right_int.pt_left &&
                left_int.pt_right == right_int.pt_right) ||
                (left_int.pt_left == right_int.pt_right &&
                left_int.pt_right == right_int.pt_left)) {
            // if there are only 2 unique points, there should be no event
            return;
        }

        std::cerr << "<<<Inserting Event: ("
            << left_int.pt_left << ", " << left_int.pt_right << ") and ("
            << right_int.pt_left << ", " << right_int.pt_right << ")"
            << std::endl;
        assert(left_int.pt_left);
        assert(left_int.pt_right);
        assert(right_int.pt_left);
        assert(right_int.pt_right);
        std::cerr << "<<<Left Point 0: " << *left_int.pt_left << std::endl;
        std::cerr << "<<<Left Point 1: " << *left_int.pt_right << std::endl;
        std::cerr << "<<<Right Point 0: " << *right_int.pt_left << std::endl;
        std::cerr << "<<<Right Point 1: " << *right_int.pt_right << std::endl;

        //assert(left_int.pt_right == right_int.pt_left);
        auto ptA = left_int.pt_left;
        auto ptB = left_int.pt_right;
        auto ptC = right_int.pt_right;

        CircleEvent evt;
        evt.circle = solveCircle(*ptA, *ptB, *ptC);
        evt.left_int = left_int;
        evt.right_int = right_int;

        // if this is going to happen behind the current sweep, then don't
        // insert. This is effectively a new event behind the beach
        if(evt.circle.center.y - evt.circle.radius > sweep_y)
            return;

        // There can only be 1 circle point for 3 points, ensure that these two
        // intersection actually meet at the circle, othwise don't creat the
        // event
        auto left_int_pt = getIntersection(
                evt.circle.center.y - evt.circle.radius, left_int);
        auto right_int_pt = getIntersection(
                evt.circle.center.y - evt.circle.radius, left_int);
        double d1 = distance2d(left_int_pt, evt.circle.center);
        double d2 = distance2d(right_int_pt, evt.circle.center);
        if(d1 > evt.circle.radius|| d2 > evt.circle.radius) {
            // the intersections should essentially be at the center of the
            // center of the circle. In diverging intersections the distances
            // from the center to intersections will far exceed the radius of
            // the circle.
            return;
        }
        m_queue.insert(evt);
    }

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x68, %rsp
movq (%rsi), %rax
testq %rax, %rax
je 0x929f
movq %rdx, %r15
movq 0x8(%rdx), %rcx
testq %rcx, %rcx
je 0x929f
movq %rsi, %r14
movq %rdi, %rbx
movq (%r15), %rdx
movq %rax, %rdi
xorq %rdx, %rdi
movq 0x8(%rsi), %rsi
movq %rsi, %r8
xorq %rcx, %r8
orq %rdi, %r8
je 0x929f
xorq %rcx, %rax
xorq %rdx, %rsi
orq %rax, %rsi
je 0x929f
movsd %xmm0, -0x30(%rbp)
movq 0xaf54(%rip), %rdi      # 0x13ff0
leaq 0x4bcd(%rip), %rsi      # 0xdc70
callq 0x31f0
movq (%r14), %rsi
movq %rax, %rdi
callq 0x3190
leaq 0x3fcd(%rip), %r12      # 0xd087
movq %rax, %rdi
movq %r12, %rsi
callq 0x31f0
movq 0x8(%r14), %rsi
movq %rax, %rdi
callq 0x3190
leaq 0x4bae(%rip), %rsi      # 0xdc86
movq %rax, %rdi
callq 0x31f0
movq (%r15), %rsi
movq %rax, %rdi
callq 0x3190
movq %rax, %rdi
movq %r12, %rsi
callq 0x31f0
movq 0x8(%r15), %rsi
movq %rax, %rdi
callq 0x3190
leaq 0x48ec(%rip), %rsi      # 0xd9f5
movq %rax, %rdi
callq 0x31f0
movq %rax, %rdi
callq 0x30d0
cmpq $0x0, (%r14)
je 0x92ae
cmpq $0x0, 0x8(%r14)
je 0x92cd
cmpq $0x0, (%r15)
je 0x92ec
cmpq $0x0, 0x8(%r15)
je 0x930b
movq 0xaea6(%rip), %r12      # 0x13ff0
leaq 0x49e9(%rip), %rsi      # 0xdb3a
movq %r12, %rdi
callq 0x31f0
movq %rax, %r13
movq (%r14), %rsi
movq %rax, %rdi
callq 0x62cf
movq %r13, %rdi
callq 0x30d0
leaq 0x49d6(%rip), %rsi      # 0xdb4c
movq %r12, %rdi
callq 0x31f0
movq %rax, %r13
movq 0x8(%r14), %rsi
movq %rax, %rdi
callq 0x62cf
movq %r13, %rdi
callq 0x30d0
leaq 0x49c2(%rip), %rsi      # 0xdb5e
movq %r12, %rdi
callq 0x31f0
movq %rax, %r13
movq (%r15), %rsi
movq %rax, %rdi
callq 0x62cf
movq %r13, %rdi
callq 0x30d0
leaq 0x49b0(%rip), %rsi      # 0xdb71
movq %r12, %rdi
callq 0x31f0
movq %rax, %r12
movq 0x8(%r15), %rsi
movq %rax, %rdi
callq 0x62cf
movq %r12, %rdi
callq 0x30d0
movq (%r14), %rdi
movq 0x8(%r14), %rsi
movq 0x8(%r15), %rdx
callq 0x6309
movaps %xmm0, %xmm2
shufps $0x55, %xmm0, %xmm0     # xmm0 = xmm0[1,1,1,1]
movlps %xmm2, -0x70(%rbp)
movss %xmm1, -0x68(%rbp)
movups (%r14), %xmm3
movaps %xmm3, -0x90(%rbp)
movups (%r15), %xmm3
movaps %xmm3, -0x80(%rbp)
subss %xmm1, %xmm0
cvtss2sd %xmm0, %xmm3
ucomisd -0x30(%rbp), %xmm3
ja 0x929f
movq %r14, %rdi
movss %xmm1, -0x30(%rbp)
movaps %xmm2, -0x60(%rbp)
movaps %xmm0, -0x40(%rbp)
callq 0x5aa2
movaps %xmm0, -0x50(%rbp)
movaps -0x40(%rbp), %xmm0
movq %r14, %rdi
callq 0x5aa2
movaps -0x60(%rbp), %xmm3
movss -0x30(%rbp), %xmm2
movaps -0x50(%rbp), %xmm4
subps %xmm3, %xmm4
movaps %xmm4, %xmm1
mulps %xmm4, %xmm1
shufps $0x55, %xmm1, %xmm1     # xmm1 = xmm1[1,1,1,1]
mulss %xmm4, %xmm4
addss %xmm1, %xmm4
sqrtss %xmm4, %xmm1
ucomiss %xmm2, %xmm1
ja 0x929f
subps %xmm3, %xmm0
movaps %xmm0, %xmm1
mulps %xmm0, %xmm1
shufps $0x55, %xmm1, %xmm1     # xmm1 = xmm1[1,1,1,1]
mulss %xmm0, %xmm0
addss %xmm1, %xmm0
sqrtss %xmm0, %xmm0
ucomiss %xmm2, %xmm0
ja 0x929f
leaq -0x90(%rbp), %rsi
movq %rbx, %rdi
callq 0x972a
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x4390(%rip), %rdi      # 0xd645
leaq 0x404e(%rip), %rsi      # 0xd30a
leaq 0x49cb(%rip), %rcx      # 0xdc8e
movl $0xf3, %edx
callq 0x3130
leaq 0x4345(%rip), %rdi      # 0xd619
leaq 0x402f(%rip), %rsi      # 0xd30a
leaq 0x49ac(%rip), %rcx      # 0xdc8e
movl $0xf4, %edx
callq 0x3130
leaq 0x43ad(%rip), %rdi      # 0xd6a0
leaq 0x4010(%rip), %rsi      # 0xd30a
leaq 0x498d(%rip), %rcx      # 0xdc8e
movl $0xf5, %edx
callq 0x3130
leaq 0x43fe(%rip), %rdi      # 0xd710
leaq 0x3ff1(%rip), %rsi      # 0xd30a
leaq 0x496e(%rip), %rcx      # 0xdc8e
movl $0xf6, %edx
callq 0x3130