I have RNE can i live legally if i divorced ????

hi friends!!! . i hope you all will be fine and good and enjoying there life in brazil .. i shall be very glad if anybody guide me ..
i am married here in brazil and recently i got my RNE(Registro Nacional de Estrangeiros) too .. but i am not really happy with my wife .. if i divorced and then can i live here legally or not even now i am with my RNE . 2nd problem that my name is also sheard with my wife too ..how i can climb to my original name again if i get divorced from my wife .. will i can live here or not legally .
what you will recommend me ..

The law permits cancellation of your RNE and permanency until the marriage has been in place for 5 years. While they can cancel your permanency if you divorce before that, they may not take that measure.

The name change issue will pose problems since especially if you have used that name on your RNE because by law you must change all your documents including the Cédula de Identidade Estrangeiro to reflect your present name

its really bad dear.. kindly don't try it because it will cost you a lot with heavy penalty as well as you will be going to ruin your home country name.. why you did marry her ? to getting brazil's nationality ?

Sometimes relationships just don't work out , don't acuse if you don`t know what really happened between them two .
And usually when a person migrates to foreign country with the purpose of getting married there he usually gives up everything back home . So where should that person go if the only place that he recognizes as his home is his ex- wife's country ...? Should he leave behind all over again , his job , his new friend , and everything else ...?
If the PF wants to cancel your RNE you should find an attorney and he will know what to do "The right of Habeas Corpus "  If you haven`t done anything wrong in Brazil there's no reason to be afraid .