Refactor libcall/intrinsic handling.