If you've never wondered, you're probably a liar.
Recently posted on YouTube, this looks to be an M-4 carbine, a short-barreled military-style variant of the AR-15. More interesting than the muzzle flash and the actual arc of the slug out of the barrel is the side shot. Here, you get to really see the mechanical action that operates a "machine gun": gas blowback from the firing sends the bolt and carrier in reverse, extracting and ejecting the just-used bullet casing—with a hot ember tumbling from its tip—and then cycling the next bullet up and forward for firing.
Geeky video narration provided by "the Slow-Mo Guys," whose shots of guns firing underwater from last year are freakin' mesmerizing, if nominally educational.