def is_xfailed(xfail_args, compatible_version, platform, swift_branch):
    """Return whether the specified platform/swift_branch is xfailed."""
    xfail = xfail_args['compatibility'].get(compatible_version, {})
    if '*' in xfail:
        return xfail['*'].split()[0]
    if '*' in xfail.get('branch', {}):
        return xfail['branch']['*'].split()[0]
    if '*' in xfail.get('platform', {}):
        return xfail['platform']['*'].split()[0]
    if swift_branch in xfail.get('branch', {}):
        return xfail['branch'][swift_branch].split()[0]
    if platform in xfail.get('platform', {}):
        return xfail['platform'][platform].split()[0]
    return None