from typing import Sequence


def variant_to_pair(variant: str) -> Sequence[str]:
    """Given a variant, splits it into an OS and ABI pair
    
    Parameters
    ----------
    variant : str
        The variant received as input to the script (e.g. windows-win64)

    Returns
    -------
    Sequence[str]
        A 2 item sequence containing the OS at position 0 and, if applicable, the ABI at position 1 (otherwise empty string)
    """

    if variant == "linux" or variant == "centos6":
        return [variant, "x86_64"]
    
    if variant == "macosx":
        return ["macos", "x86_64"]

    if variant == "ios":
        return ["ios", ""]

    first_dash = variant.index("-")
    osname = variant[0:first_dash]
    abi = variant[first_dash+1:]
    if osname == "android":
        return [osname, abi]
    
    if abi.find("win64") != -1:
        return ["windows", abi.replace("win64", "x86_64")]
    elif abi.find("win32") != -1:
        return ["windows", abi.replace("win32", "x86")]
    else:
        return [osname, abi]