I am rather surprised, Dante.
"Well-regulated", in the language of the day, did not mean "with lots of rules and oversight applied". It simply meant something that functioned correctly. I recall coming across a mid-19th century reference to a "well-regulated [pocket] watch". It didn't mean that there was a body of laws detailing how the watch behaved, and public officials tasked with overseeing the watch's behavior. It just meant that the watch told the correct time.
And the first clause is not conditional, it is simply explanatory.
To put it in modern words: "A well-armed public being necessary to the security of a free state, the right of the people to keep and bear arms shall not be infringed."
The first clause does not contradict the second clause, it enhances it.
I say "a well-armed public" because the militia itself is simply the armed public, and "well-" because it is the simplest way to indicate that this public is not poorly armed but is properly armed - armed in a way that they can overcome a military force sent against them. Armed with weapons sufficient to make the militia a functional fighting force - which is to say, "well-regulated".
You might also say that the 2nd Amendment is about the Sovereignty of the People. America is established on the notion that governance is only valid with the consent of the governed. The militia is the means by which the people enforce that fundamental American principle.
Of course Mr. Lincoln scuppered that, with the same war that made him the first U.S. president to ever enslave free men - to fight for him. (Every prior war had been fought entirely with volunteer armies.) Mr. Lincoln was opposed to the idea of "government by the people, for the people", and so he invaded those nations that had formerly been constituent members of the federation he then headed, and with overwhelming numbers managed to subdue them for a time, dealing a serious blow to the principle of self-government in America.
It might be said that the militia system was not sufficient to prevent that invasion, but it did a fairly good job considering the circumstances of opposing an enemy with far superior numbers, far superior weaponry, and a much larger industrial base (which had been largely subsidized by decades of tariffs on Southern exports and imports) in what was essentially the first modern war. What is more, Mr. Lincoln's success was partially reversed in the Insurgency that followed the war - an insurgency that was essentially fought covertly by the militia - and an insurgency fought by a people whose economy had already been devastated and whose infrastructure had been largely destroyed. (No wonder that the government schools never teach this part of history!) Turns out the militia is fairly effective after all.
Now all that said, some restrictions are not awful. The proposed ban on bump stocks, for one. A bump stock makes a rifle a less effective killing machine, and as such its common use would decrease the effectiveness of the militia. I have no objection to banning bump stocks for that reason. I don't think such a ban is necessary, but whatever.
Incidentally, while Supreme Court decisions are important for practical reasons, they do not actually determine which laws are Constitutional. That is merely a tradition ... that was begun by the Supreme Court! There is no specific procedure for determining whether a law in Constitutional, so under the 10th Amendment we must presume that that power is reserved to the States, or the People, respectively. (In fact, the requirement for jury trials reflects this: the system of trial by a jury of one's peers is all about allowing the People to effectively nullify bad laws, in what is known as "jury nullification". The principle is well known and historically documented, but of course the courts and the government have done their best to hide this fact from the American people, and particularly from jurors, because this reduces the ability of the government to coerce the People. In fairness, there have been times when jurors clearly abused this right in order to prevent justice - but as we have seen during the "war on drugs" avoiding this aspect of jury trials is not something to be taken lightly.)