The filmmakers behind indie action-thriller “Fall” were facing kind of a big freaking problem.

Lionsgate wanted to pick up the movie for U.S. theatrical release. But “Fall,” a vertiginous white-knuckler about two young women who are in danger of plunging from the top of a 2,000-foot-tall radio tower, was rife with F-bombs — which would result in an R rating, cramping the box office take for the small-budget pic.

The producers of “Fall,” which had a production budget of about $3 million, couldn’t afford to reshoot all the scenes in which the petrified tower-climbers screamed “fuck” (along with various permutations).

The solution? Scott Mann, who directed and co-wrote “Fall,” turned to the artificial-intelligence dubbing technology system developed by London-based Flawless, for which he also serves as co-CEO.

According to Mann, the Flawless team in post-production changed more than 30 F-bombs throughout the movie into PG-13-acceptable epithets like “freaking” along with a few other lines of dialogue.

Flawless, founded in 2018, originally designed its TrueSync AI-based system to provide a better dubbing solution for films translated into other languages. Employing the same principles used to create “deepfakes,” TrueSync alters the mouth movements of the actors to match the alternate dialogue being spoken (a process the startup calls “vubbing”). Mann realized the Flawless engine could also be used to clean up the F-words in his movie.

“For a movie like this, we can’t reshoot it. We’re not a big tentpole… we don’t have the resources, we don’t have the time, more than anything else,” Mann said in a behind-the-scenes video feature about the film. “What really saved this movie and brought it into a wider audience was technology.”

“Fall” stars Grace Caroline Currey (“Shazam!”), Virginia Gardner (“Marvel’s Runaways”), Mason Gooding (“Scream”) and Jeffrey Dean Morgan (“The Walking Dead”).

“When we were filming the movie, we didn’t know if we were R or if we were PG-13, so I said the F-word so many times I think Scott wanted to kill me in post when we were trying to get a PG-13 rating,” Gardner said. Currey said she couldn’t tell which of her scenes had been redubbed: “As far as I know, every movement my mouth made in that movie, my mouth made.”

“Now we’re now stuck on this stupid freaking tower in the middle of freaking nowhere,” Gardner’s character, Hunter, says in one visually redubbed scene.

“Fall” opens in theaters Friday, Aug. 12. The MPA gave the final cut of the movie a PG-13 rating for “bloody images, intense peril and strong language.”

Mann and his team shot the film on large-format cameras for Imax screens in the Shadow Mountains, in California’s Mojave Desert. To reshoot the scenes with F-words would have cost millions of dollars and taken several weeks, if not months. The Flawless team did the “neural reshoots” within two weeks, during the final stages of post production, according to Mann.

In “Fall,” best friends Becky (Currey) and Hunter (Gardner) climb an abandoned radio tower to scatter the ashes of Becky’s late husband (Gooding). But when sections of the rickety ladder break off from the dilapidated tower, Becky and Hunter are left stranded. The women’s expert climbing skills — and their friendship — are put to the ultimate test as they wage a desperate fight to survive the elements, vulture attacks and a lack of supplies to get off the tower alive.

Pictured above: Virginia Gardner in “Fall”