def do_overlap(start1: int, endex1: int, start2: int, endex2: int) ->bool:
    """Do ranges overlap?

    Arguments:
        start1 (int):
            Inclusive start index of the first range.

        endex1 (int):
            Exclusive end index of the first range.

        start2 (int):
            Inclusive start index of the second range.

        endex2 (int):
            Exclusive end index of the second range.

    Returns:
        bool: Ranges do overlap.

    Note:
        Start and end of each range are sorted before the final comparison.

    Examples:
        >>> do_overlap(0, 4, 4, 8)
        False

        >>> do_overlap(0, 4, 2, 6)
        True

        >>> do_overlap(4, 0, 2, 6)
        True

        >>> do_overlap(8, 4, 4, 0)
        False
    """
    if start1 > endex1:
        start1, endex1 = endex1, start1
    if start2 > endex2:
        start2, endex2 = endex2, start2
    return endex1 > start2 and endex2 > start1
