A tyrannical state will not care that you are "legally" allowed to own firearms, and rebels do not get rights.
Also, I'll believe the claim that 2A is to prevent tyranny when I see it, because most of the time when you ask someone who supports the 2nd amendment about slave revolts, you tend to find out how little they care about "tyranny"