import re


def clean_file(text: str) -> str:
  """Prepares the file for parsing.

  In particular, removes comments and macros from text
  Additionally, moves pointer asterisks next to its type

  Args:
    text: The contents of the text file to prepare

  Returns:
    The cleaned up file contents.
  """

  result = text
  result = re.sub(r"//.*?\n", "", result, flags=re.S)
  result = re.sub(r"/\*.*?\*/", "", result, flags=re.S)
  result = re.sub(r"#.*?\n", "", result, flags=re.S)
  result = result.replace(" *", "* ")
  return result