Apple on Thursday filed a motion to vacate the Federal Bureau of Investigation's order that it help unlock an iPhone used by one of the San Bernardino shooters.

In the 65-page document, Apple outlined many reasons why it felt it shouldn't comply with the government's request. One of these is that doing so would violate its rights under the First Amendment.

"This amounts to compelled speech and viewpoint discrimination in violation of the First Amendment," the filing said. In other words, the government's request that Apple write and authorize a program that circumvents iPhone security would essentially force Apple to say, in code, something with which it fundamentally does not agree.

Wayne Giampietro, a Chicago-based lawyer and longtime member of the First Amendment Lawyer's Association, said that Apple is absolutely on solid ground with its argument.

"There are a lot of cases saying that the government cannot compel private people to say things," he said. A farmer, for example, can't be forced by the government to contribute to groups that promote farming or agriculture.

"The government can't make people do things that they don't want to do," he said. "I think that's broader than the First Amendment, but that's certainly a big part of it."

And as for the assertion that code is, essentially, speech? Giampietro said Apple's on strong footing there as well.

"I don’t see any difference between code and any kind of expression," he said.  "It’s a way that people communicate."

That's certainly Apple's view. The Apple filing contains a statement from its manager of user privacy, Erik Neuenschwander, who compares coding to any other creative process.

"There are a number of ways to write code to accomplish a given task, some more efficient and more elegant than others," he wrote. "Moreover, writing software is an iterative, revision intensive, and mentally challenging task, just like writing essays, whitepapers, memos and even poems."

Apple's filing also cited several court cases where code has been treated as speech, including a 2001 case, Universal City Studios, Inc. v. Corley, which was eventually heard by the U.S. Court of Appeals for the Second Circuit. That ruling states:

Communication does not lose constitutional protection as "speech" simply because it is expressed in the language of computer code. Mathematical formulae and musical scores are written in "code," i.e., symbolic notations not comprehensible to the uninitiated, and yet both are covered by the First Amendment.

That ruling did, however, say that the "scope of protection" for code still needed to be determined.

Giampietro also said that the Supreme Court has ruled that some software can be speech, finding in 2010 that video games are protected by the First Amendment in the same way that literature and film are.

But the question of whether code itself is speech has been a contested issue in the past, particularly sparked in debates over encryption and intellectual property. Games are a storytelling medium in a way operating systems are not, some have argued. The Supreme Court has never given a definitive opinion on this issue, and the debate is still ongoing.

Speaking more broadly, Giampietro also noted that he believes there are serious privacy and safety implications at play if this case sets a precedent allowing the government to compel companies to create products  for them.

"Can [the government] then say 'make me a better atomic bomb?' It can't compel anybody to do whatever it wants on its whim," he said.