With the White House mulling a new troop surge in Afghanistan, “War Machine,” a dark comedy about the last time we tried this, is exactly what we need right now. On the surface, the feature-length film from writer-director David Michôd — streaming on Netflix starting today — is an examination of post-colonial hubris. Brad Pitt stars as an eerily familiar four-star general tasked with doing what no other foreign military leader could: winning in the storied Southwest Asian graveyard of empires.

But for me, “War Machine” captures the futility and absurdity of the counterinsurgency, or COIN, operations I took part in when I deployed to Helmand in 2010 during the Battle for Marjah. For those who never had to deal with COIN in Afghanistan, it’s pretty straightforward… in theory. First, you clear an area, which means killing the bad guys. Next, you hold the ground you gained. Then, you build infrastructure and maintain ties with the locals. But don’t forget, those bad guys you’re fighting, they’re the friends, relatives, and neighbors of the very people you’re trying to win over, so when you kill one, you turn someone else against you. Think of it like a tricked out version of the Vietnam War’s “hearts and minds” strategy, because, as the movie points out, that worked out so well.

The movie opens in 2009 and follows Army Gen. Glen McMahon, also known by his nom de guerre “the Glenimal.” McMahon is a throwback to the bygone days of Gen. George S. Patton, when men were men, and weren’t judged for it. He’s crass, hard, and shuffles along with a wide gait, a permanent scowl, and one hand curled into a claw clutching an imaginary cigar, as the narrator describes in the first three minutes of the film. This is the man who’s meant to bring the “forever war” to a triumphant close, but instead his career is torpedoed by a Rolling Stone exposé. Sound familiar? It should. The film is loosely based on the late Michael Hastings’ book “The Operators: The Wild and Terrifying Inside Story of America’s War in Afghanistan” — which was actually based on a Rolling Stone article by Hastings that led to the 2010 dismissal of Army Gen. Stanley McChrystal.

“War Machine” relishes in pitting the Pentagon brass against those pesky and meddling politicians, both in the states and in Afghanistan, which you kind of expect to see in a movie centered around the politics of America’s longest war. Where “War Machine” really stands out though, is in its candid portrayal of what it feels like to be an enlisted service member told to go into a hostile province with a plan so dizzyingly complex it takes a flowchart with more lines than an M.C. Escher illustration to explain how it works.

Remember this?

Afghanistan War photo

Like Hastings’ writing, the film is rooted in deadpan humor. When McMahon addresses his command staff, he describes the challenges civilian casualties pose to counterinsurgency operations in Afghanistan as such: “We are here to support the civilian population. Therefore we must avoid killing it at all costs.” He’s not wrong, but it ain’t that simple, and that’s kinda the point of this movie. It talks about COIN as if it were a slow-motion train wreck — everyone else can see what’s going to happen — only the conductor is blissfully, perhaps deliberately, unaware of how it will end.

Related: Want To Watch Brad Pitt Play A Certain General In This New Trailer? Sure You Do »

To put it the way one Marine does during a heated exchange with McMahon: “Seems to me, we're all here with our guns and shit, trying to convince these people that deep down, we're actually really nice guys. I don’t know how to do that when every second one of them, or third one of them, or every tenth one of them is trying to fucking kill me, sir.”

Afghanistan War photo

The look every Marine had during a COIN briefing.Photo courtesy of Netflix

“War Machine” does a decent job of illustrating some of the challenges Marines faced in Marjah during Operation Moshtarak, with the film’s climactic battle appearing to be closely modeled on HBO’s “Battle for Marjah” documentary by Ben Anderson, a journalist who embedded with Bravo Company, 1st Battalion, 6th Marines, the unit I was attached to during the battle.

Though there’s a lot of things war movies will never get right — small unit tactics, uniforms, grooming standards, the list goes on — there was some obvious creative license taken in the film’s depiction of the mission, with one Marine pulling a “Hurt Locker” and running through the streets alone, but many other parts were spot on. Like when the Afghan National Army soldiers have to be shoved through a doorway because they’re unwilling to clear a compound — Marines weren’t allowed to go into a building without members of the Afghan military present — or when the Marines realize that none of their Afghan counterparts speak Pashto, only Dari, even though the ANA was there to help build ties with the local citizens. Also, a lot of the Afghan soldiers were high, all the fucking time. All that stuff actually happened.

The operation was meant to show that COIN would work. It was meant to be Afghan-led, and it was meant to convince the residents of Marjah in particular, the people of Afghanistan at large, and subsequently, people back home in the states, that the war could, and would, be won. It didn’t work out that way in “War Machine,” and many would argue it didn’t work out in real life, either.

While “War Machine” has taken flak for not really knowing what kind of movie it wants to be — lurching back and forth between introspection and gallows humor — it does one thing really well: It talks shit about the people running the war. It may not be fair, in fact, it’s definitely not, but I’m not going to lie, the enlisted Marine in me kind of loves that there’s finally a war movie that calls the brass out on their bullshit.

You can watch “War Machine” on Netflix beginning May 26.