We have said until know that concerning the question which auxiliary verb to use (essere or avere) it is irrelevant if there is a modal verb (can, must, may, etc.) or not. The auxiliary verb to use depense only on the main verb. If the main verb requires essere (simplifying we can say that this is the case with all intransitive verbs) we use essere as well if there is a modal verb and when the main verb requires avere, we use avere.
I can have buy a car. Ho potuto comprare una macchina.
I can have gone to Rome. Sono potuto andare a Roma.
But this rule doesn't apply if there a reflexive pronoun. In the case that there is a reflexive pronoun we have to distinguish between two situations, because if there is a modal verb there is an infinitive as well and so we have two possibilities. We can add the reflexive pronoun to the infinitive (Posso vedermi) or we can put in front of the modal verb (Mi posso vedere). If we put the reflexive pronoun in front of the modal verb we conjugate always with essere. It doesn't matter in this case with which auxiliary verb the main verb is normally conjugated. It is, in this case, always conjugated with essere. But if we add the reflexive pronoun to the infinitive, we must conjugate the "normal" way. If the main verb requires essere, we must conjugate with essere and if it requires avere, we must conjugate with avere.
I can have buy for myself a car. Mi sono potuto comprare una macchina.
I can have stoped. Mi sono potuto fermare.
but: (in the case that the reflexive pronoun is added to the infinitiv)
I can have buy for myself a car. Ho potuto comprarmi una macchina.