Look at the way the first amendment is written For Instance :  "or the right of the people peaceably to assemble, and to petition the Government for a redress of grievances."
The comma separates 2 distinct thoughts and rights.
1) "the right of the people peaceably to assemble"
2) "the right of the people to petition the Government for a redress of grievances"
.
Those are 2 separate things, in the same sentence, separated by a comma. It does NOT read or mean that the people can only assemble if they are trying to petition the Government.  and it does NOT mean that if you want to redress grievances, you must first assemble.
.
Now, understand the 2nd amendment is written the same exact way, 2 separate thoughts and rights in the same sentence, separated by a comma.  The first part is not dependent on the 2nd part, and the 2nd part is not dependent on the first part, they are separate.  Several of the amendments are written like that.