fix handling of function attributes + optimize out pointer parameters