Given what’s happening at movie theaters this month, it’s hard to fathom that the X-Men and Spider-Man ever occupied the same ecosystem, let alone the mind of creator Stan Lee.

There’s more sheer tonnage of awesomeness in the first 10 minutes of “X-Men: Days of Future Past” than in the entirety of “The Amazing Spider-Man 2.”

And while “Days” is every bit as overstuffed — this thing has mutants the way Donald Sterling has problems — it works in ways “Spider-Man” could only dream of.

In a dystopian future, most of humanity has either been enslaved or killed, with bodies piled by the roadside like freshly plowed snow.

A few remaining mutants — most notably Iceman (Shawn Ashmore), Colossus (Daniel Cudmore) and Kitty Pryde (Ellen Page) — are doing their best to hold off the Sentinels, giant, mutant-hunting robots created by Dr. Bolivar Trask (Peter Dinklage).

It’s all they can do to survive, because the Sentinels adapt to each of their powers, thanks to technology derived from the DNA of shapeshifter Mystique (Jennifer Lawrence).

When Professor Xavier (Patrick Stewart), Magneto (Ian McKellen), Wolverine (Hugh Jackman) and Storm (Halle Berry) show up to help, it’s decided that their best chance for survival is for Kitty to send Wolverine’s consciousness back in time 50 years to his pre-Adamantium, 1973 self. Then he can stop Mystique from killing Trask at the Paris Peace Accords, which rallies the public against mutants and leads to her being captured and experimented on, setting her on a path to supervillainy.

Xavier has been holed up, “Grey Gardens”-style, in his school for mutants with Beast (Nicholas Hoult), having willfully sacrificed his telepathy. Magneto, meanwhile, is imprisoned 100 stories beneath the Pentagon.

Wolverine recruits bratty speedster Quicksilver (Evan Peters) to break Magneto out of his maximum-security hole, and the resulting scene, set to a Jim Croce song, is not only technologically impressive, it’s ridiculously crowd-pleasing and one of the best times you’re likely to have at the movies all summer. You’ll leave wishing Quicksilver had stuck around, now that he’s made up for his superlame introduction in that awful Carl’s Jr. ad.

By crossing the streams of the original “X-Men” trilogy with “X-Men: First Class,” director Bryan Singer (“X-Men,” “X-Men 2”) and writer Simon Kinberg (“First Class”) continue to expand the franchise that was all but given up for dead after the overwhelming stink of “X-Men: The Last Stand.”

The script is a significant reworking of the classic comic storyline that Singer and Kinberg seem to have set in 1973 as much to avoid aging the young “First Class” stars as to treat fans to the site of Wolverine on a waterbed. (The latter doesn’t disappoint.)

With this many mutants, some are bound to get short shrift. You’ll have to be either a big fan or an empath to care much about what happens to Bishop, Blink, Warpath, Sunspot or Toad. But, for the most part, “Days of Future Past” makes you feel invested in its characters in ways “Godzilla” never bothered.

And, as with anything involving time travel, the logic sometimes gets a bit wonky.

Seeing Stewart and McKellen interact, though, is never not a pleasure.

Although “Days of Future Past” offers plenty of winks and nuggets for fanboys, flashbacks should make it accessible for anyone with even a passing knowledge of the “X-Men” franchise. (Speaking of fanboys, unless you are one, there’s little reason to stay for the post-credits scene that sets up 2016’s “X-Men: Apocalypse,” especially if your bladder gets as full as mine.)

The middle 90 minutes or so of “Days of Future Past” are rarely less than captivating.