In his latest film, “Dirty Grandpa,” Robert De Niro gets friendly with himself while watching porn, performs a bad karaoke version of Ice Cube’s “It Was a Good Day” and sexes up a college girl by dropping onto the bed and saying he’s “fallen and can’t get up.”

Deadline called “Dirty Grandpa” the worst movie De Niro has ever been in. The reviled comedy marks the bottom for an actor who’s been sliding downhill for decades and leaves many once again asking the question, “What the heck has happened to Robert De Niro?”

He used to be known for some of the greatest performances in cinematic history: “Taxi Driver,” “Raging Bull,” “The Godfather Part II.” Now his criteria for picking projects seems to be whether someone has his agent’s phone number or not. (Here it is, in case you’ve got a script: 424-288-2000.)

The decline is probably the result of several complicated factors — although the first one is pretty simple.

“I have a one-word answer: alimony,” says a studio-executive-turned-producer. “When you have alimony to pay, you do projects you wouldn’t think you’d do.”

“When you have alimony to pay, you do projects you wouldn’t think you’d do.” - Former studio executive

Look at our other “The Godfather” alum James Caan, who’s getting divorced. He recently wrote in court papers that he’s being forced to take paycheck film and TV parts “which detract from the 50 years I have spent building my reputation.”

De Niro divorced his first wife, Diahnne Abbott, in 1988. They have two adult children together. He also has twin 21-year-old sons by ex-girlfriend Toukie Smith, as well as a 17-year-old son and 4-year-old daughter with current wife Grace Hightower.

“He has two main criteria when it comes to choosing which projects to take on. If he likes the director or cast members, he will consider the movie, even if the script is weak,” a De Niro associate tells The Post. “Secondly, money. He is very comfortable financially, but he has a lot of overhead.”

“I think he is more concerned with building an inheritance for his children and grandchildren, with his many real estate investments and huge salaries for his comic roles, particularly enhanced since the success of the execrable ‘Fockers’ series,” says James Ursini, author of the biography “Robert De Niro.”

He reportedly collected $20 million for his role in 2010’s “Little Fockers” — exponentially more than he could have made in a small indie.

When the actor ditched his reps at CAA in 2008, a vicious e-mail purportedly from someone within the agency began circulating listing the reasons the actor left. Among them was the allegation that De Niro wanted a $20 million salary as well as a $1 million production fee on every movie.

“He could have concentrated on quality stuff,” the e-mail read, “but instead wanted to keep funding his little empire in New York.” (De Niro returned to CAA in 2010.)

But could he have concentrated solely on “quality stuff“? It’s not like Hollywood is overflowing with roles for a 72-year-old, and to De Niro’s credit, he did appear in three prestige pics — David O. Russell’s “Joy,” “Silver Linings Playbook” and “American Hustle” — over the last few years, but likely didn’t bank much.

“The parts he was offered when he was in his prime are not the same as the parts he gets offered now,” the actor’s associate says. “As stars age, the parts start to dissipate and he does not want to stop working. Movies really are his lifeblood, and if there were a choice of sitting around for several years, waiting for the dream script that might never materialize, or taking on a number of projects to keep him busy and relevant, he’s always going to choose the latter.”

Critics point to 1999’s “Analyze This” as the moment when De Niro’s career began to tip. It marked his first foray into broad comedy and also found him sending up the weighty on-screen persona that earned him Oscars in films including “The Godfather Part II.” The years that followed saw an increasing number of (often repellant) comedies on his résumé, such as 2002’s “Showtime.”

“Robert really doesn’t care about critical reception anymore,” the associate says. “He knows that he has more than proved himself as a formidable actor.”

“Robert really doesn’t care about critical reception anymore. He knows that he has more than proved himself as a formidable actor.” - De Niro associate

It could also be that he just likes comedy. The actor apparently has a sharp sense of humor and enjoys pranks. On the set of 2002’s “Analyze That,” he wanted to punk Mark Behar, who worked security. After De Niro sent Behar to his trailer to pick up some papers, a producer came screaming to Behar that co-star Billy Crystal had collapsed.

Behar found Crystal on the ground with De Niro pounding his chest yelling, “Wake up, you son of a bitch! Don’t you die on me!”

“I was in a bit of shock and somewhat of a panic mode,” Behar tells The Post.

As Behar bent over to check if Crystal was breathing, the comedian suddenly recovered and kissed him.

“Then Robert said, ‘You’re OK, kid. You didn’t panic . . . you passed,’ ” Behar recalls.

The question now is, “Can De Niro’s career recover?” Or will we, the audience, be left hoping he opens his eyes, smiles and says, “ ‘Dirty Grandpa?’ Gotcha!”

Additional reporting by Caroline Hedley