def version_to_int(version: str):
    """
    >>> version_to_int('3.2.1')
    30201

    >>> version_to_int('30.2.1')
    300201

    >>> version_to_int('2.1')
    201

    >>> version_to_int('2.x.1')
    20001

    >>> version_to_int('4.10.25')
    41025
    """
    parts = version.split('.')
    result = 0
    for i, part in enumerate(reversed(parts)):
        try:
            x = int(part)
            result += x * 100 ** i
        except ValueError:
            pass
    return result