// File: /workspace/github_cpp_makefile_star2_O1/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 0x9828(%rip), %r12      # 0x13ff0
leaq 0x5354(%rip), %rsi      # 0xfb23
movl $0xf, %edx
movq %r12, %rdi
callq 0x3280
movq (%r14), %rsi
movq %r12, %rdi
callq 0x31b0
movq %rax, %r15
leaq 0x484a(%rip), %r13      # 0xf03b
movl $0x2, %edx
movq %rax, %rdi
movq %r13, %rsi
callq 0x3280
movq 0x8(%r14), %rsi
movq %r15, %rdi
callq 0x31b0
movq %rax, %r15
movl $0x2, %edx
movq %rax, %rdi
movq %r13, %rsi
callq 0x3280
leaq 0x530c(%rip), %rsi      # 0xfb33
movl $0x6, %edx
movq %r15, %rdi
callq 0x3280
movq (%rbx), %rsi
movq %r15, %rdi
callq 0x31b0
movq %rax, %r15
movl $0x2, %edx
movq %rax, %rdi
movq %r13, %rsi
callq 0x3280
movq 0x8(%rbx), %rsi
movq %r15, %rdi
callq 0x31b0
movq %rax, %r15
movl $0x2, %edx
movq %rax, %rdi
movq %r13, %rsi
callq 0x3280
leaq 0x517d(%rip), %rsi      # 0xf9f5
movl $0x1, %edx
movq %r15, %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
cmpq $0x0, (%r14)
je 0xa8f9
leaq 0x5281(%rip), %rsi      # 0xfb3a
movl $0x11, %edx
movq %r12, %rdi
callq 0x3280
movq (%r14), %rsi
movq %r12, %rdi
callq 0x6fc0
movq (%r12), %rax
movq -0x18(%rax), %rdi
addq %r12, %rdi
movl $0xa, %esi
callq 0x3230
movsbl %al, %esi
movq %r12, %rdi
callq 0x3030
movq %rax, %rdi
callq 0x3160
cmpq $0x0, 0x8(%r14)
je 0xa948
leaq 0x5245(%rip), %rsi      # 0xfb4c
movl $0x11, %edx
movq %r12, %rdi
callq 0x3280
movq 0x8(%r14), %rsi
movq %r12, %rdi
callq 0x6fc0
movq (%r12), %rax
movq -0x18(%rax), %rdi
addq %r12, %rdi
movl $0xa, %esi
callq 0x3230
movsbl %al, %esi
movq %r12, %rdi
callq 0x3030
movq %rax, %rdi
callq 0x3160
cmpq $0x0, (%rbx)
movq -0x40(%rbp), %r13
je 0xa999
leaq 0x5205(%rip), %rsi      # 0xfb5e
movl $0x12, %edx
movq %r12, %rdi
callq 0x3280
movq (%rbx), %rsi
movq %r12, %rdi
callq 0x6fc0
movq (%r12), %rax
movq -0x18(%rax), %rdi
addq %r12, %rdi
movl $0xa, %esi
callq 0x3230
movsbl %al, %esi
movq %r12, %rdi
callq 0x3030
movq %rax, %rdi
callq 0x3160
cmpq $0x0, 0x8(%rbx)
je 0xa9e8
leaq 0x51ca(%rip), %rsi      # 0xfb71
movl $0x12, %edx
movq %r12, %rdi
callq 0x3280
movq 0x8(%rbx), %rsi
movq %r12, %rdi
callq 0x6fc0
movq (%r12), %rax
movq -0x18(%rax), %rdi
addq %r12, %rdi
movl $0xa, %esi
callq 0x3230
movsbl %al, %esi
movq %r12, %rdi
callq 0x3030
movq %rax, %rdi
callq 0x3160
movq 0x9601(%rip), %r15      # 0x13ff0
leaq 0x518e(%rip), %rsi      # 0xfb84
movl $0x11, %edx
movq %r15, %rdi
callq 0x3280
movq (%r13), %rax
cvtss2sd (%rax), %xmm0
movq %r15, %rdi
callq 0x3330
movq %rax, %r15
movq (%rax), %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
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 0xaa7a
xorl %r12d, %r12d
jmp 0xaa90
testq %rcx, %rcx
sete %dil
testq %rdx, %rdx
sete %r8b
orb %dil, %r8b
movb $0x1, %r12b
je 0xaaf6
movq 0x9559(%rip), %rbx      # 0x13ff0
leaq 0x4918(%rip), %rsi      # 0xf3b6
movl $0x3, %edx
movq %rbx, %rdi
callq 0x3280
movzbl %r12b, %r14d
movq %rbx, %rdi
movl %r14d, %esi
callq 0x3360
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x3230
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 0xaa75
movq %rdx, %rdi
xorq %rax, %rdi
movq %rsi, %r8
xorq %rcx, %r8
orq %rdi, %r8
je 0xaa75
movq %rsi, %rdi
xorq %rax, %rdi
movq %rdx, %r8
xorq %rcx, %r8
orq %rdi, %r8
jne 0xab51
movq %r14, %rdi
callq 0x6579
movss %xmm0, -0x40(%rbp)
movq %rbx, %rdi
callq 0x6579
ucomiss -0x40(%rbp), %xmm0
jmp 0xac21
cmpq %rsi, %rdx
je 0xabea
cmpq %rcx, %rax
je 0xac07
movq %r13, %r15
movq 0x9483(%rip), %r13      # 0x13ff0
leaq 0x508e(%rip), %rsi      # 0xfc02
movl $0x1a, %edx
movq %r13, %rdi
callq 0x3280
movq %r13, %rdi
callq 0x30d0
movq (%r15), %rax
movss (%rax), %xmm0
movq %r14, %rdi
callq 0x65c8
movaps %xmm0, -0x50(%rbp)
movq (%r15), %rax
movss (%rax), %xmm0
movq %rbx, %rdi
callq 0x65c8
movaps %xmm0, -0x40(%rbp)
leaq 0x4800(%rip), %rsi      # 0xf3b6
movl $0x3, %edx
movq %r13, %rdi
callq 0x3280
xorl %r12d, %r12d
movaps -0x40(%rbp), %xmm0
ucomiss -0x50(%rbp), %xmm0
seta %r12b
movq %r13, %rdi
movl %r12d, %esi
callq 0x3360
movq %rax, %rdi
callq 0x30d0
jmp 0xaa90
cmpq %rcx, %rax
je 0xac2a
movq (%r13), %rax
movss (%rax), %xmm0
movq %rbx, %rdi
callq 0x65c8
movq (%r14), %rax
ucomiss (%rax), %xmm0
jmp 0xac21
movq (%r13), %rax
movss (%rax), %xmm0
movq %r14, %rdi
callq 0x65c8
movq (%rbx), %rax
movss (%rax), %xmm1
ucomiss %xmm0, %xmm1
seta %r12b
jmp 0xaa90
leaq 0x4f65(%rip), %rdi      # 0xfb96
leaq 0x46d2(%rip), %rsi      # 0xf30a
leaq 0x4f73(%rip), %rcx      # 0xfbb2
movl $0x90, %edx
callq 0x3140
nop