The comedy envelope has been pushed, pulled, twisted and torn during this current run of smash hit R-rated sex comedies. But “The Change-Up,” the punctuation at the end of the summer of “Bridesmaids,” “Bad Teacher” and “Friends With Benefits,” dares to ask and answer the question that’s been out there since “The 40 Year-Old Virgin” and “Wedding Crashers” kicked off the craze:

How far is too far, and when does amusingly raunchy just seem coarse?

I’d say any time you’ve filmed a script with the phrase “projectile pooping” you’ve arrived at crass. Baby diapering scenes? Sure. Let’s turn them bottom’s up and see — in close, anatomical detail — what pops out. And adults leave little to the bathroom imagination either in this cute and crude romp through the merits of married life as opposed to single life, and vice versa.

“Change-Up” is an adult variation on the old body-switch idea, a “Freaky Friday” with a dose of the freaky deaky. Jason Bateman is Dave, a nose-to-the-grindstone lawyer whose marriage has become a series of “your turn” diaper changes (three kids, twin infants among them) and drives to and from school and after school activities. He’s married to Jamie, played by the vulnerable yet hilariously brassy and bossy Leslie Mann.

Somehow Dave has stayed friends with his polar opposite. Mitch (Ryan Reynolds, channeling his “Van Wilder” past) is a slacker, a pothead actor and womanizer, irresponsible in the extreme and given to shouting inappropriate profanity at Dave’s tiny kids and into Dave’s speaker phone at the office.

A night of drinking leads them to a shared moment at the urinal — in this case, an ornate fountain in one of Atlanta’s parks. They kvetch. They complain. Next thing you know, they’ve said “I wish I had your life” and they’ve switched bodies.

The humor here comes not so much from the Jon Lucas-Scott Moore script or David “Fred Claus” Dobkin’s perfunctory direction of it, but in seeing Bateman, the master of the buttoned-down introverted slow burn, take on the hyper patter of Reynolds. As he fakes his way through the day, we see Dave as a bad lawyer, bad husband and bad father.

His daughter’s getting tripped at ballet? Trip her back. “Always solve your problems with violence!”

Dave, who looks like Mitch, must take on the actor’s next role — reluctantly. He must deal with Mitch’s semi-estranged dad (Alan Arkin, given nothing funny to play). And Mitch, who looks like Dave, must cope with the big business deal his firm has been working on and fight Dave’s ongoing crush on the office hottie, played by Olivia Wilde as a sexy, smart vamp. She doesn’t have the funny or the touching scenes Mann delivers in her wife-and-mother role, but then, Wilde has yet to earn them.

Bateman has the more fun role and makes more of the transition. We don’t get nearly enough of the pitter-patter of Reynolds in the early scenes to make up for how mild-mannered and in-over-his-head he has to play (not nearly as funny) as he takes on Bateman’s acting-as-reacting shtick.

Nudity, sex, raw language and trips to the toilet — while fitfully amusing — are here simply for the shock value. This overlong and overly obvious movie has little flow to it, no comic momentum to take us to the ending we see coming pretty much right at the beginning.

Yes, it’s a body-switch comedy where each character “learns” about himself and the other guy’s life and is the better for it. The trouble with “The Change-Up” is that it doesn’t change-up enough of the formula to render this new.