Portions of this interview with Maggie Gyllenhaal first appeared in The Race Begins issue of TheWrap’s Emmy magazine.

In David Simon and George Pelecanos’ HBO series “The Deuce,” Maggie Gyllenhaal’s character, Candy, starts out as the only hooker on New York’s 42nd Street without a pimp, and ends as an aspiring porn director. It’s not a triumphant arc by any means, but a hard-fought one for both Candy and for the actress who plays her.

Gyllenhaal took a gamble on a story that was in the formative stages and a role that required abundant nudity would prove to be rewarding – and with her input both as an actress and, at her insistence, as a producer helped make “The Deuce” another critical hit for Simon, the creator of “The Wire,” and for HBO.

Also Read: Maggie Gyllenhaal Teeters at Edge of Art and Madness as 'The Kindergarten Teacher' (Exclusive Video)

What stage was “The Deuce” at when you first met with David Simon?

I saw the first three scripts. They were early drafts, and Candy is pretty peripheral until Episode 4. I was pitched on who she was going to be and what she was going to become, but I had never ever gotten involved in a project like that without seeing the script. “The Honorable Woman,” which was also long-form television, all the scripts were entirely written. Deciding to take it on, I knew what I was taking on.

Here, I had no idea. I didn’t have no idea, but I didn’t have enough of an idea to take it on. Particularly since I would be so naked, so much of my body would be required, I wanted to make sure that they wanted my mind as well as my body.

So you came on as a producer. How did Candy’s story evolve after you came on board?

They were pretty clear about where she was going to go. She starts as a sex worker on the street, and by the end of Season 1 she’s a director. but she really is only directing by herself at the very last moment of the last episode. And that was something that really did kind of emerge when we were shooting.

Also Read: 'Ozark' Star Laura Linney on Pushing Jason Bateman to Flesh Out Her Role: 'She Was Basically Just a Wife'

They knew they wanted her to be a producer — they wanted her to be very savvy with money, a really good thinker in terms of how to put things together. And I was like, “She’s an artist, she’s an artist, she’s an artist.” And that is what she became.

What made you take the part even before you saw the final scripts?

The quality of the writing was so good, which was unusual. I really was intrigued by the idea of playing a sex worker as a way of thinking about the way we all encounter sexuality, the way we all trade in sexuality. Also thinking about misogyny and how it’s alive in our culture. It was very intriguing to me, it pulled on me. I just needed a guarantee that I would be involved.

What were your priorities when you came on as a producer?

I think all the way through, I protected Candy. There were places where I felt, “No, that goes off the rails a little.” Even though everyone was trying to tell a story where we were critiquing misogyny and capitalism in America, there were many places where I said, “Hold on, we need to tip it a little this way in order to say what we want to say.”

Also Read: Maggie Gyllenhaal on How 'The Deuce' Uses Porn, Prostitution to Look at Current Political Reality

David and George were very attuned to not objectifying women, not creating what it is that we’re critiquing. But, for instance, I said to David before we started shooting, “Because there are so many depictions in this of transactional sex, performative sex, where a woman is having a loud orgasm in order to get the guy off, I think you need to show what real feminine desire looks like. I think you need to put a real female orgasm in this, in order to contrast what we’re watching through the rest of it.

“Because even though you and I know this is transactional, performative, a lot of the pretend sex people have on TV looks like that. So let’s show them the real thing.”

I told him that I thought we should see Candy masturbate, and he spit his coffee back into his cup. And then I didn’t hear from him again, which is very much what he’s like, and then it just showed up in Episode 5. We shot a scene where Candy has a boyfriend and he doesn’t make her come, so she turns over and makes herself come.

But when I saw the first cut they had taken the orgasm out. And I said, “Oh, my God, what the f— are you thinking?” I didn’t say it like that, but I was like, “Guys, guys, no, no, please.” And they put it back in.

Also Read: 'The Deuce' Star Dominique Fishback on Darlene's 'Questionable' Choices, Big Finale Twist

The show is set in the early 1970s, but the issues of the objectification and exploitation of women are very much in the news now.

We made it during the run-up to the election, and Trump was elected right after we finished shooting. And I think all of this — power, misogyny, what is contemporary feminism, the way sex plays into that — was on everybody’s mind watching the campaigning.

And I also think it’s really interesting: Our show is about transactional sex, and that is what’s really on the table with what’s coming out about Hollywood. How are we all involved in this? How are we pushed into corners and into doing things that we really don’t want to do? How is sex a part of this person’s toolbox or that person’s toolbox? How do you function as a woman when 100 years ago you weren’t allowed to have a credit card or vote, and the only way you could support yourself was by finding a husband?

Also Read: Maggie Gyllenhaal on Hollywood Ageism: I Was Told 37 Is 'Too Old' for a 55-Year-Old Love Interest

Sex has historically been something that women have been backed into having to use to get the things they need. I think it’s interesting to consider it in the most extreme version, which is pornography and sex work. And I just hope that the show will continue to be as unflinching as it has been in exploring the ways in which all of us are complicit.

I don’t believe that there are a few men that need to take responsibility for it. I believe that we live in a broken, misogynistic culture — and in order for it to change, we all have to consider how we have allowed it to get to the place where it is. Every man I know, every single one, has been saying, “Did I do something, have I somehow disrespected a woman sexually in my life?” And I think, “Of course you have.”

We live in a misogynistic culture. If you want it to change, come and join us, and let’s talk it through together and make a shift. I think we’ve all agreed to things that many of us, men and women, no longer want to agree to. And that’s what our show’s about.

So are there things you want for Candy in Season 2?

There’s one thing I really want. And David basically told me, “It’s coming, but you’re not gonna get it until Season 3.”

Read more of TheWrap Emmy magazine’s The Race Begins issue here.