def get_func_name(s):
  """
  Gets the function name from a string.

  E.g. "void func(type f1)" -> "func"
  """
  pre_open_paren_str = s.split('(')[0]
  if ' ' not in pre_open_paren_str:
    return pre_open_paren_str

  return pre_open_paren_str[pre_open_paren_str.rindex(' ') + 1:]