do not emit unnecessary casts on internal function calls