// File: /workspace/github_cpp_makefile_star2_O3/micahcc[P]polygon_skeleton/voronoi.cpp
// Function: BeachCompare::operator()(Intersection const&, Intersection const&) const
bool operator()(const Intersection& lhs, const Intersection& rhs) const
    {
        // Compares the x index of thwo intersections. In the case where a point
        // is missing (nullptr), there is no intersection (or intersection is at
        // positive or negative infinity, if right or left point is nullptr,
        // respectively)
        std::cerr << "<<<Comparing: ("
            << lhs.pt_left << ", " << lhs.pt_right << ", " << ") to ("
            << rhs.pt_left << ", " << rhs.pt_right << ", " << ")" << std::endl;
        if(lhs.pt_left)
            std::cerr << "<<<Left Point 0: " << *lhs.pt_left << std::endl;
        if(lhs.pt_right)
            std::cerr << "<<<Left Point 1: " << *lhs.pt_right << std::endl;
        if(rhs.pt_left)
            std::cerr << "<<<Right Point 0: " << *rhs.pt_left << std::endl;
        if(rhs.pt_right)
            std::cerr << "<<<Right Point 1: " << *rhs.pt_right << std::endl;
        std::cerr << "<<<Using sweep = " << *sweep_y << std::endl;
        bool lhs_n_infinite = lhs.pt_left == nullptr;
        bool lhs_p_infinite = lhs.pt_right == nullptr;
        bool rhs_n_infinite = rhs.pt_left == nullptr;
        bool rhs_p_infinite = rhs.pt_right == nullptr;

        bool result;
        if((lhs_p_infinite && rhs_n_infinite) ||
                (lhs_p_infinite && rhs_p_infinite) ||
                (lhs_n_infinite && rhs_n_infinite)) {
            // Obviously +infinity !< -infinity and
            // if both inputs have an infinite side in the same direction, then
            // both intersections are dummy boundaries and therefore one can't
            // be less than the other
            result = false;
        } else if(lhs_n_infinite || rhs_p_infinite) {
            // -infinity < rhs => true
            result = true;
        } else if(lhs_p_infinite || rhs_n_infinite) {
            // lhs < -infinity => false
            result = false;
        } else if(lhs.pt_left == rhs.pt_left && lhs.pt_right == rhs.pt_right) {
            // intersection of the exact same to parabolas, by definition this
            // equal and therefore not less
            result = false;
        } else if(lhs.pt_right == rhs.pt_left && lhs.pt_left == rhs.pt_right) {
            // the order of the parabolas determines the sign. So the same two
            // parabolas does not mean the same intersection.
            result = getSign(lhs) < getSign(rhs);
        } else if(lhs.pt_left == lhs.pt_right) {
            // Special case, intersection of two identical points is assumed to
            // be just the x value of the double-point intersection
            assert(rhs.pt_left != rhs.pt_right);
            assert(!(lhs_n_infinite || lhs_p_infinite || rhs_n_infinite ||
                        rhs_p_infinite));
            Point right = getIntersection(*sweep_y, rhs);
            result = lhs.pt_left->x < right.x;
        } else if(rhs.pt_left == rhs.pt_right) {
            // Special case, intersection of two identical points is assumed to
            // be just the x value of the double-point intersection
            assert(lhs.pt_left != lhs.pt_right);
            assert(!(lhs_n_infinite || lhs_p_infinite || rhs_n_infinite ||
                        rhs_p_infinite));
            Point left  = getIntersection(*sweep_y, lhs);
            result = left.x < rhs.pt_left->x;
        } else {
            // get intersection of left two parabolas, and compare x with
            // intersection of right two
            assert(!(lhs_n_infinite || lhs_p_infinite || rhs_n_infinite || rhs_p_infinite));
            std::cerr << "<<<Computing intersections" << std::endl;
            Point left  = getIntersection(*sweep_y, lhs);
            Point right = getIntersection(*sweep_y, rhs);
            std::cerr << "<<<" << (left.x < right.x) << std::endl;
            result = left.x < right.x;
        }

        std::cerr << "<<<" << result << std::endl;
        return result;
    }

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, -0x40(%rbp)
movq 0x9758(%rip), %r12      # 0x13ff0
leaq 0x5274(%rip), %rsi      # 0xfb13
movl $0xf, %edx
movq %r12, %rdi
callq 0x3270
movq (%r14), %rsi
movq %r12, %rdi
callq 0x31b0
movq %rax, %r15
leaq 0x477a(%rip), %r13      # 0xf03b
movl $0x2, %edx
movq %rax, %rdi
movq %r13, %rsi
callq 0x3270
movq 0x8(%r14), %rsi
movq %r15, %rdi
callq 0x31b0
movq %rax, %r15
movl $0x2, %edx
movq %rax, %rdi
movq %r13, %rsi
callq 0x3270
leaq 0x522c(%rip), %rsi      # 0xfb23
movl $0x6, %edx
movq %r15, %rdi
callq 0x3270
movq (%rbx), %rsi
movq %r15, %rdi
callq 0x31b0
movq %rax, %r15
movl $0x2, %edx
movq %rax, %rdi
movq %r13, %rsi
callq 0x3270
movq 0x8(%rbx), %rsi
movq %r15, %rdi
callq 0x31b0
movq %rax, %r15
movl $0x2, %edx
movq %rax, %rdi
movq %r13, %rsi
callq 0x3270
leaq 0x509d(%rip), %rsi      # 0xf9e5
movl $0x1, %edx
movq %r15, %rdi
callq 0x3270
movq (%r15), %rax
movq -0x18(%rax), %rdi
addq %r15, %rdi
movl $0xa, %esi
callq 0x3220
movsbl %al, %esi
movq %r15, %rdi
callq 0x3030
movq %rax, %rdi
callq 0x3160
cmpq $0x0, (%r14)
je 0xa9c9
leaq 0x51a1(%rip), %rsi      # 0xfb2a
movl $0x11, %edx
movq %r12, %rdi
callq 0x3270
movq (%r14), %rsi
movq %r12, %rdi
callq 0x6f7e
movq (%r12), %rax
movq -0x18(%rax), %rdi
addq %r12, %rdi
movl $0xa, %esi
callq 0x3220
movsbl %al, %esi
movq %r12, %rdi
callq 0x3030
movq %rax, %rdi
callq 0x3160
cmpq $0x0, 0x8(%r14)
je 0xaa18
leaq 0x5165(%rip), %rsi      # 0xfb3c
movl $0x11, %edx
movq %r12, %rdi
callq 0x3270
movq 0x8(%r14), %rsi
movq %r12, %rdi
callq 0x6f7e
movq (%r12), %rax
movq -0x18(%rax), %rdi
addq %r12, %rdi
movl $0xa, %esi
callq 0x3220
movsbl %al, %esi
movq %r12, %rdi
callq 0x3030
movq %rax, %rdi
callq 0x3160
cmpq $0x0, (%rbx)
movq -0x40(%rbp), %r13
je 0xaa69
leaq 0x5125(%rip), %rsi      # 0xfb4e
movl $0x12, %edx
movq %r12, %rdi
callq 0x3270
movq (%rbx), %rsi
movq %r12, %rdi
callq 0x6f7e
movq (%r12), %rax
movq -0x18(%rax), %rdi
addq %r12, %rdi
movl $0xa, %esi
callq 0x3220
movsbl %al, %esi
movq %r12, %rdi
callq 0x3030
movq %rax, %rdi
callq 0x3160
cmpq $0x0, 0x8(%rbx)
je 0xaab8
leaq 0x50ea(%rip), %rsi      # 0xfb61
movl $0x12, %edx
movq %r12, %rdi
callq 0x3270
movq 0x8(%rbx), %rsi
movq %r12, %rdi
callq 0x6f7e
movq (%r12), %rax
movq -0x18(%rax), %rdi
addq %r12, %rdi
movl $0xa, %esi
callq 0x3220
movsbl %al, %esi
movq %r12, %rdi
callq 0x3030
movq %rax, %rdi
callq 0x3160
movq 0x9531(%rip), %r15      # 0x13ff0
leaq 0x50ae(%rip), %rsi      # 0xfb74
movl $0x11, %edx
movq %r15, %rdi
callq 0x3270
movq (%r13), %rax
cvtss2sd (%rax), %xmm0
movq %r15, %rdi
callq 0x3320
movq %rax, %r15
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r15, %rdi
movl $0xa, %esi
callq 0x3220
movsbl %al, %esi
movq %r15, %rdi
callq 0x3030
movq %rax, %rdi
callq 0x3160
movq (%r14), %rdx
movq 0x8(%r14), %rsi
testq %rsi, %rsi
sete %dil
movq (%rbx), %rax
movq 0x8(%rbx), %rcx
testq %rax, %rax
sete %r8b
testq %rcx, %rcx
sete %r9b
orb %r8b, %r9b
andb %dil, %r9b
movq %rdx, %rdi
orq %rax, %rdi
sete %dil
orb %r9b, %dil
je 0xab4a
xorl %r12d, %r12d
jmp 0xab60
testq %rcx, %rcx
sete %dil
testq %rdx, %rdx
sete %r8b
orb %dil, %r8b
movb $0x1, %r12b
je 0xabc6
movq 0x9489(%rip), %rbx      # 0x13ff0
leaq 0x4838(%rip), %rsi      # 0xf3a6
movl $0x3, %edx
movq %rbx, %rdi
callq 0x3270
movzbl %r12b, %r14d
movq %rbx, %rdi
movl %r14d, %esi
callq 0x3350
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x3220
movsbl %al, %esi
movq %rbx, %rdi
callq 0x3030
movq %rax, %rdi
callq 0x3160
movl %r14d, %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
testq %rax, %rax
sete %dil
testq %rsi, %rsi
sete %r8b
orb %dil, %r8b
jne 0xab45
movq %rdx, %rdi
xorq %rax, %rdi
movq %rsi, %r8
xorq %rcx, %r8
orq %rdi, %r8
je 0xab45
movq %rsi, %rdi
xorq %rax, %rdi
movq %rdx, %r8
xorq %rcx, %r8
orq %rdi, %r8
jne 0xac21
movq %r14, %rdi
callq 0x6553
movss %xmm0, -0x40(%rbp)
movq %rbx, %rdi
callq 0x6553
ucomiss -0x40(%rbp), %xmm0
jmp 0xacf1
cmpq %rsi, %rdx
je 0xacba
cmpq %rcx, %rax
je 0xacd7
movq %r13, %r15
movq 0x93b3(%rip), %r13      # 0x13ff0
leaq 0x4fae(%rip), %rsi      # 0xfbf2
movl $0x1a, %edx
movq %r13, %rdi
callq 0x3270
movq %r13, %rdi
callq 0x30d0
movq (%r15), %rax
movss (%rax), %xmm0
movq %r14, %rdi
callq 0x65a2
movaps %xmm0, -0x50(%rbp)
movq (%r15), %rax
movss (%rax), %xmm0
movq %rbx, %rdi
callq 0x65a2
movaps %xmm0, -0x40(%rbp)
leaq 0x4720(%rip), %rsi      # 0xf3a6
movl $0x3, %edx
movq %r13, %rdi
callq 0x3270
xorl %r12d, %r12d
movaps -0x40(%rbp), %xmm0
ucomiss -0x50(%rbp), %xmm0
seta %r12b
movq %r13, %rdi
movl %r12d, %esi
callq 0x3350
movq %rax, %rdi
callq 0x30d0
jmp 0xab60
cmpq %rcx, %rax
je 0xacfa
movq (%r13), %rax
movss (%rax), %xmm0
movq %rbx, %rdi
callq 0x65a2
movq (%r14), %rax
ucomiss (%rax), %xmm0
jmp 0xacf1
movq (%r13), %rax
movss (%rax), %xmm0
movq %r14, %rdi
callq 0x65a2
movq (%rbx), %rax
movss (%rax), %xmm1
ucomiss %xmm0, %xmm1
seta %r12b
jmp 0xab60
leaq 0x4e85(%rip), %rdi      # 0xfb86
leaq 0x45f2(%rip), %rsi      # 0xf2fa
leaq 0x4e93(%rip), %rcx      # 0xfba2
movl $0x90, %edx
callq 0x3140
nop