def clean_line(line):
    """Strip whitespace off a line and separate out the comment, if any."""
    if "//" in line:
        line, _sep, comment = line.partition("//")
    if "/*" in line:
        line, _sep, comment = line.partition("/*")
        comment, _sep, _trash = comment.partition("*/")
    else:
        comment = ""

    return line.strip(), comment.strip()