Scrambling to get “The Wolf of Wall Street” ready for awards season, Martin Scorsese leaned on the nimble touch of longtime editor Thelma Schoonmaker.

At 73, Schoonmaker has been an essential cog in the director’s moviemaking machine for more than three decades, winning the Oscar for editing on “Raging Bull,” “The Aviator” and “The Departed.” “Wolf” marks Schoonmaker’s 19th collaboration with Scorsese (and the filmmaker’s fifth with Leonardo DiCaprio) and presented a different set of challenges.

The shooting script, based on the memoirs of Jordan Belfort, a corrupt stockbroker, was already 162 pages long. And Scorsese stretched the story further when he asked his actors to freely improvise, resulting in reels of footage that resembled a documentary. The first cut of the film ran four hours.

Even though there was some talk about releasing “Wolf” in two parts, the real solution was to continue trimming throughout the fall. A missed release date in mid-November was followed by a struggle to complete the edit by Christmas. For several months in New York, where they both live, Scorsese and Schoonmaker were attached at the hip, carefully whittling down the opus while jittery Paramount Pictures executives peered over their shoulders.

“The studios are nervous on every movie,” Schoonmaker says. “It never ends, because Marty’s movies are so unusual. He doesn’t repeat himself, so they don’t know what to expect. We have to fight hard to keep them from being ruined. Film students can’t believe that when I tell them, because they think, well it’s Martin Scorsese.”

Schoonmaker, who has edited every Scorsese theatrical feature since 1980’s “Raging Bull,” has perfected a meticulous system with the director over the years. She watches dailies with him, jotting down notes about each take. After shooting wraps, Scorsese joins her in the editing bay. “He loves to edit,” Schoonmaker says. “It’s his favorite part. He feels he makes the movie here.”

Schoonmaker’s office in midtown Manhattan is furnished with a chair for Scorsese with its own remote. While both watch footage on a bigscreen TV, another flatscreen on a side wall is tuned to a muted Turner Classic Movies. “We’re constantly inspired by that,” says Schoonmaker, who adds that Scorsese taught her what she knows about editing.

For his part, Scorsese says he’d be lost without his longtime editor. “She has a loyalty to me and to the film,” the director notes. “And it’s not just about the release date or whether you’re ahead of or behind schedule, you just have to do it and ask: What do I want to say here? She’s the only person I really trust that way.”

Schoonmaker harbored dreams of being a diplomat when she enrolled in the same NYU film school class as the young Scorsese in 1963, and worked on his first pro feature, 1967’s “Who’s That Knocking On My Door.” More than a decade later, they reconnected.

Schoonmaker is something of a celeb among aspiring filmmakers and movie geeks. She’s traveled the world giving lectures on editing, and draws enthusiastic applause on the awards Q&A circuit.

“She’s someone I really respect,” says Margot Robbie, who plays Jordan’s second wife in “Wolf.” “I admire seeing women in those sorts of positions in the industry. It gives me hope and inspiration.”

Scorsese didn’t just greatly influence Schoonmaker’s professional life; he also altered her personal life, introducing her to director friend Michael Powell (“The Red Shoes”), whom she married in 1984. “I fell in love with him immediately,” Schoonmaker says. “We started having lunch and dinner, and then things developed and we had to tell Marty.” When Powell died in 1990 at age 84, Scorsese shut down editing on “Goodfellas” so Schoonmaker could take extended leave.

Powell was a mentor of sorts to Scorsese. “They gave to each other,” Schoonmaker says. “My husband taught Marty so much about directing. He says the films of my husband are in his DNA.”

Schoonmaker still has razor-sharp memories about scenes she edited decades ago. She says the first time she and Scorsese watched a cut of “Raging Bull,” they were so entranced by how good it was, they had no idea how they had made the film. On “Gangs of New York,” Daniel Day-Lewis stayed in character throughout the entire shoot and would call her up as Bill the Butcher and say, “Hello sweetheart, do you want to go look at dailies?” (To watch a video interview with Schoonmaker, go to Variety.com/thewolfofwallstreet.) That was the first time Scorsese worked with DiCaprio, who later brought “Wolf” to him.

The $100-million project, which included 250 extras, was by all accounts a blast to shoot. Scorsese kept chuckling at the takes, as he encouraged his actors to stay in the moment and embellish their lines. He wasn’t the only one giggling. “I was roaring with laughter looking at the dailies,” Schoonmaker recalls. “At one point, my assistants came in and said, ‘What’s the matter?’ ”

One of the first scenes shot was a lunch with Jordan (DiCaprio) and new Wall Street boss (Matthew McConaughey) that opens the movie with a lengthy exchange about masturbation. “I had nine different points I wanted to hit, and then I just started riffing,” McConaughey says.

Another addition was in the form of a prop ­— “the candle in the ass,” Robbie says — in a sex scene with DiCaprio that was in the book but not the script. “I kind of provoked Leo into doing it, and I can’t believe he did,” Robbie continues. “I said if he was committed to the role, then he would do it properly.” DiCaprio worked up the courage to make the suggestion to Scorsese, who loved the idea. “And then the prop man had to light the candle,” says Schoonmaker, who notes that DiCaprio didn’t use a body double for any of his nude scenes.

Schoonmaker says she cut an hour from the film, which runs 179 minutes, by delicately shaving scenes. (A chief criticism of “Wolf” is that it’s still too long.) And she worked with the MPAA to snip parts of an orgy scene after the ratings board objected. Even when she’s disagreed with Scorsese, Schoonmaker concedes that in the end, his instincts are right. She cites “Wolf’s” climactic scenes where DiCaprio, tripped out on quaaludes, crawls to his car, shot in a continuous take. “He didn’t want any coverage. I was worried about it,” she says. “When we screened it, people were roaring.”

As the film entered the final stretch, Schoonmaker was working seven days a week, often as late as 2 a.m. “The endings of movies are always horrendous,” she says, conceding, “This was particularly horrendous,” acknowledging some editing jumps in continuity of the finished product. “Cutting improvisation is really hard, because things don’t match, and you end up with some bad cuts sometimes. But we’d rather have the bad cuts and the great improv,” she adds.
Over the years, other directors have tried to lure her away — to no avail. Asked if she has considered directing a movie on her own, she becomes reflective.
“My job is so wonderful,” Schoonmaker says. “I think if I was working on disappointing films, well maybe. But I get this wonderful treasure trove. How many editors can say that?”

Tim Gray contributed to this report.