"You have the right to remain silent." "You have the right to a lawyer."

The instructions – given by police every day and simulated on television seemingly every night – appear straightforward enough. In truth, what are known as Miranda warnings have been the subject of legal combat for decades – over how and when they are given, and if and how they are understood.

The latest fierce and complex legal sparring on these questions unfolded on Tuesday in Manhattan Supreme Court, as a judge heard evidence in one of New York City's most prominent recent murder cases.

More than two years ago, at 2:56 p.m. on May 23, 2012, Pedro Hernandez signed a piece of paper saying he understood his rights and was waiving them. He then proceeded to confess to the 1979 murder of a 6-year-old boy named Etan Patz. The confession immediately generated both hope that a notorious missing child case had been solved and worry that the case – in which the confession is virtually the only evidence – would eventually collapse.

On Tuesday, an expert testified that Hernandez, a one-time bodega clerk in the Patz family's Manhattan neighborhood, was of such limited intelligence that it was "highly unlikely" he could have  fully understood the rights he signed away in a New Jersey precinct house more than two years ago. The expert, a forensic psychologist hired by Hernandez's defense, said his review of Hernandez's psychological history, as well as an array of tests he had given to the accused, had led him to conclude Hernandez "functions at the lowest levels of intelligence."

In effect, Dr. Bruce Frumkin testified that Hernandez, innocent or guilty, "didn't know he could invoke his rights" when he confessed to abducting, strangling and disposing of Patz during his morning shift at the bodega back in May 1979. Hernandez's lawyer has asked Justice Maxwell Wiley to declare Hernandez's confession inadmissible, a ruling that, if made, would likely end the case.

Prosecutors with the Manhattan District Attorney's office on Tuesday quickly sought to undercut Frumkin's findings, insisting on Hernandez's guilt, and suggesting they think he has been exaggerating his intellectual deficits and psychiatric issues. Prosecutors have long contended that Hernandez's confession is convincing, and that he was fully aware of his rights when he made it.

Frumkin's testimony reflected the striking amount of scholarship that has been produced on the question of what constitutes a "knowing and intelligent" waiver of one's rights against self-incrimination. He said he has participated in some 700 cases where prosecutors or defense lawyers were seeking to determine if a suspect had been capable of understanding his or her rights before relinquishing them. Frumkin said he had administered roughly a dozen formal psychological tests to Hernandez aimed at helping him make such a determination in this case.

Frumkin testified that it was possible for someone to make a "knowing" waiver of their rights, but not an "intelligent" one. It was possible they could make a knowing and intelligent waiver, and yet not make it voluntarily – most typically in cases of police coercion. A schizophrenic, he said, might well be able to make a knowing and intelligent waiver, while a person afflicted with a low IQ might be incapable of doing so.

In his testimony Tuesday, Frumkin essentially said Hernandez was unable to make a fully responsible waiver of his rights because of both his mental illness and his low intelligence. Frumkin testified that Hernandez, who went on to work as a laborer in New Jersey, marrying twice, had repeatedly been shown to have an IQ in the bottom 2 percent nationwide. One test showed it was 67. Another showed it was 74. Other tests, including those designed specifically to measure competence for understanding and exercising one's legal rights during interrogation, also showed Hernandez was "very deficient compared to other people."

Frumkin also testified that, contrary to the prosecution's claim that Hernandez suffered from nothing more than depression, he also exhibited "psychotic symptoms," and had been found to suffer from other "serious psychological issues." Frumkin testified that a neuropsychologist enlisted to examine Hernandez by his lawyer had found signs of "early dementia." He described a man whose routine at the time of his arrest and interrogation was limited to watching television and driving his daughter to college.

Joan Illuzi-Orbon, the lead prosecutor, challenged Frumkin's techniques in testing and interviewing Hernandez, suggesting he had forced Hernandez to submit to testing despite the fact that he said he lacked his eyeglasses and could not read the test questions. And she suggested his poor scores on the tests might have been the result of design, not authentic intellectual deficits. She is expected to call her own expert witness in the coming days.

Hernandez was questioned by police for more than six hours in 2012 before the authorities turned on a videotape to record his confession. Hernandez's lawyer, Harvey Fishbein, has argued that detectives psychologically manipulated a sick and vulnerable man into confessing during the hours of unrecorded interrogation. Fishbein has also asked Wiley to declare the confession inadmissible because Hernandez was never advised of his rights during those hours of unrecorded questioning.

For more about the disappearance of 6-year-old Etan Patz, a case that frustrated and mystified police for decades, read the story ProPublica produced with WNYC in 2013.