That is, if you wish to solve it.
I am not for banning any guns just for the sake of banning. The most horrific crimes are these mass gun murders and the military style weapons, designed for no other purpose than to kill a lot of people in a short period of time, is the weapon of choice.
On the other side of that, no one actually needs these military style weapons with the only real exception being the police. For people who want the occasional experience of shooting targets with these weapons, you can have them in some kind of club environment where they can be rented and used to shoot targets.
So there's your starting point.
With respect to handguns, that is a separate argument and in my opinion a little more difficult.