URGENT HELP NEEDED: Vitem 5 visa expiry

Hi,

I am an Indian and I work for a tech company in Sao Paulo. I would be leaving my job soon and have a couple of queries about it.
1. How many day after I quit would my visa he cancelled?
2. After my visa is cancelled, how many days do I have to leave the country?

I am being forced to quit the company at short notice, and needs to make plans accordingly. So I would highly appreciate a quick guidance.

What do your visa and your RNE/CIE (or CRNM, if you registered with the Federal Police after 2017) say about expiration?  I don't see anything in the relevant legislation that automatically cancels your visa and your CRNM if you lose your job.  I'm not an attorney, so this is just an observation, not legal advice.
The Federal Police are usually pretty good about answering questions over the phone, without asking for identifying information.  If you call them, say that you're in Brazil on a VITEM V, and ask them what your status is if you leave your job, they'll probably tell you.