“ROSEWATER”: Then they came for me…

How ironic, then, that “Rosewater,” the true tale of a Western journalist caught in the Kafkaesque world of Iranian justice, was made by one of America’s funniest men — “The Daily Show’s” Jon Stewart.

In 2009 Newsweek sent London-based Maziar Bahari to his native Iran to cover that country’s presidential election. The stories he filed provided a sympathetic look at young activists opposing the repressive religious regime. Then he upped the ante by daring to suggest that the election was rigged in favor of hard-liner Mahmoud Ahmadinejad.

Soon thereafter Bahari was pulled from his bed by police, charged with espionage and forced to endure four months of interrogation that ranged from the rigorous to the ridiculous.

A key piece of the prosecution’s evidence was an interview Bahari gave to an American television show. Comedy Central’s “The Daily Show,” to be precise. The “interview” was a typical example of that program’s satiric skewering — only the Iranian authorities failed to recognize it as comedy.

At least part of Stewart’s motivation in taking a summer off from his TV career and making his feature writing/directing debut was his regret that “The Daily Show” contributed to Bahari’s ordeal.

But this subject matter also dovetails nicely with Stewart’s longstanding disdain for absolutism and dogmatism, both of which are in plentiful supply in Iran. At “Rosewater’s” core is the conflict between rigid authority and nose-tweaking resistance.

Not that this is a funny film — what Bahari went through was too grim for that. But it is ultimately a celebration of the liberating power of satire. After all, if you can still laugh, then the bastards haven’t won.

Drawing from Bahari’s memoir Then They Came for Me, Stewart’s film arrives in two parts.

In the first half, Bahari (Mexican actor Gael Garcia Bernal) says goodbye to his pregnant wife in London and lands in Teheran. He immediately is hustled off by a gypsy cab driver (Dimitri Leonidas) who becomes his chauffeur and introduces him to the young opponents of Ahmadinejad who have filled the rooftop of their building with illegal satellite dishes.

This part of the film has a sort of torn-from-the-headlines immediacy: Political rallies. Subversive activities. The election. Rioting.

The second half is practically a two-man play between Bahari and his police interrogator, a fellow he dubs Rosewater (Danish actor Kim Bodnia) because of the scent of his cologne.

The film is hugely effective in depicting the terror and paranoia Bahari experienced.

He spent most of his time blindfolded and in solitary.

He was dragged out daily to undergo interrogation — a bit of slapping around but mostly of the psychological variety (the authorities wanted wanted Bahari unbruised and healthy for his inevitable televised confession).

Rosewater, who is more accustomed to using his fists than his head, frets that his career is on the line if he cannot break Bahari. And it’s pretty obvious that the cop is outmatched…at one point he demands to know if this Chekov the prisoner writes so admiringly of in his diary is another spy.

When Bahari’s editors and his wife cannily blow up his imprisonment into an international incident, the Iranians have no choice but to cut their losses.

Most of the choices Stewart has made are solid. For example, at various times the ghosts of Bahari’s dead father and sister — both committed dissidents — appear to him in his cell to provide counsel and encouragement. It’s possible to see how someone under such stress might conjure up these intimates as a support mechanism.

Somewhat iffy, though, are Stewart’s efforts to visually juice up the film with a plethora of special effects.

For instance, when Bahari walks the streets of Teheran, shop windows light up like giant TV screens, filled with news footage or artsy montages. When the political opposition spreads news via Twitter or other electronic pathways, Stewart shows a crowded street with electric blue text messages popping up over the heads of passersby (a similar technique was employed earlier this year in “Chef”).

This may be trying bit too hard.

But for the most part “Rosewater” is very effective — well acted, tension-filled, and slyly iconoclastic. Say hello to Jon Stewart, movie director.