Google's lawyers — and any lawyer reading the complaint in the equal pay suit against the company alongside the class-action suit filed by former employee James Damore last week — probably feel like they are going through the looking glass.

Damore's complaint alleges the tech behemoth engaged in illegal discrimination and retaliation against him and others based on their status as a conservative white males. Simultaneously, Google also faces another lawsuit and a government investigation over whether it has systematically underpaid women.

Damore, however, asserts in his complaint that he was fired because he refused to accept the company’s views about diversity and/or because he opposed Google’s use of “illegal racial and gender quotas and preferences” in hiring.

James Damore and his attorney, Harmeet Dhillon, in San Francisco on January 8, 2018. Michael Liedtke / AP

Many of Damore’s claims rest on the premise that Google was violating the law by maintaining "rigid" hiring quotas for women and minorities. But private companies are allowed to take race and gender into account during hiring in a flexible way, particularly to remedy groups’ underrepresentation in their workforces. And Damore’s more specific allegations about Google’s hiring practices don’t necessarily support his claim that they were too rigid. For example, he faults a Google manager for using a version of the Rooney Rule, reportedly telling Damore that “For each position we have open [we] work on getting multiple candidates including a diversity candidate.” But taking steps to ensure a diverse hiring pool is not the same as maintaining an illegal hiring quota, and encouraging women and racial minorities to compete for jobs isn’t the same as guaranteeing they will be hired.

Get the think newsletter. This site is protected by recaptcha

Meanwhile, in the wage discrimination case, lawyers and the federal government are arguing that the company systematically discriminates against women when it comes to both pay and opportunities. The lawsuit raises equal pay claims and alleges that women at Google were routinely hired into lower paid and lower status jobs — not because they were less ambitious or skilled than their male colleagues, as Damore alleged in the now-infamous manifesto for which he was allegedly fired, but because of biased hiring and promotion. And a federal Department of Labor regional director testified in court that the agency had “found systemic compensation disparities against women pretty much across the entire workforce,” calling those disparities “quite extreme, even in this industry.”

So Damore sees Google’s celebration of “departments, such as the sales department, where women comprised more than 50% of the workforce” as evidence of an illegal hiring quota at Google, but equal pay case plaintiff Kelli Wisuri alleges that women comprised half of some sales-related jobs because those were low-pay, low-status jobs into which Google channeled women, even when they were qualified for more advanced positions.

In other words, what Damore sees as evidence of anti-male sentiment, Wisuri cites as evidence of Google’s bias against women.

Damore's complaint also characterizes conservatives as “political dissidents” at Google who faced a hostile work environment and difficulty landing positions within the company. “Exhibit A” in Damore’s complaint is the aforementioned ten-page manifesto that he authored last July, which went viral and sparked a firestorm of negative publicity. Re-reading Damore’s screed, it's easy to understand the negative reactions: Relying on a list of controversial or debunked studies, it argues against the idea that “gender gaps imply sexism,” instead suggesting that the men’s innate “higher drive for status” explains the dearth of woman in tech.

Both Google and Damore seem to agree that Damore was fired because of the memo, but they disagree about the source of Google’s objection to it. In an all-staff note, CEO Sundar Pichai focused his objection to the memo on its effects on women at Google: “To suggest a group of our colleagues have traits that make them less biologically suited to that work is offensive and not OK. It is contrary to our basic values.” In other words, Google says that Damore was fired not for being a conservative, but for undermining his women colleagues and making it harder for them to do their jobs.

In one way, Damore is lucky that Google is located in California, which is one of only a handful of states that bans private employers from punishing workers for their political views; there is no analogous protection for private-sector employees’ political advocacy under federal law. His claims have all been made under California’s employment law; absent from Damore’s complaint are any federal law claims. Presumably, this is to keep the case out of federal court, where legal obstacles — including a Supreme Court decision authored by no less than conservative icon Antonin Scalia — could have been the death of Damore’s attempt to bring his case as a class action.

But even in relatively employee- and plaintiff-friendly California, Damore faces an uphill climb. First, the right to hold or advocate for political beliefs at work is not limitless: it will have to be reconciled with Google’s own rights to express its views, as well as its obligations to all employees under employment law.

That Google is simultaneously being sued for discriminating against both women and men is not as unusual as it may seem: When employers attempt to remedy imbalances in their workforce by adopting affirmative action plans, it is almost inevitable that some applicants and employees will feel that the plans go too far.

But, as Damore may soon discover, employment discrimination lawsuits are extremely difficult to win, as both substantive law and court procedures are stacked against plaintiffs — and gender and political affiliation have nothing to do with it.

Charlotte Garden is an associate professor at Seattle University School of Law.