BENGHAZI, Libya - Salam Mahmud no longer flinches when he hears gunfire in the streets of Benghazi, the de facto capital of rebels fighting to oust veteran Libyan strongman Moammar Gaddafi.
"We are so used to celebratory shootings in Benghazi that no one reacts so we fail to react when crimes are being committed," said the merchant.
Benghazi has run through a rollercoaster of emotions to the soundtrack of gunfire since anti-government protests erupted on February 17 -- from trigger-happy euphoria at the hope of victory to sheer fear when the regime's tanks rumbled to the edge of the city in mid-March before being halted by Western air strikes.
As ragtag rebels stream back into the city, making way for trained soldiers to continue the fight against loyalist troops, Benghazi confronts the sizeable task of countering criminality in a city flooded with weapons.
"Before February 17, there were no guns in the city but since then even children can own them," said Jamal Benur, a former civil cases judge and district attorney.
The prisons of Libya's second city were emptied in the upheaval of the uprising and many former detainees have dashed to the frontline capitalizing on their newfound freedom to join the fight to overthrow Gaddafi.
"There were 3,000 prisoners in Benghazi before the uprising -- petty criminals, murderers -- but they were released," said Benur, adding that only 102 people are currently behind bars.
"Some of the released are fighting on the frontline and others have died in combat. They have been extremely brave so we will not put them back in prison," he said.
A man carrying documents and a Kalashnikov enters the judge's office.
"This is one of our investigative judges. He is forced to go out armed, because one never knows," says Benur with a smile before signing the papers.
Many of Benghazi's judges, he explains, are multi-purpose, handling a spectrum of legal matters that range from conducting criminal investigations to settling family and tribal disputes.
The Mediterranean city had 280 judges before the outbreak of the insurgency but now that the dust has settled in the rebel bastion, only 70 continue to apply the law, sticking to the existing civil and penal code as a reference.
"Globally, there is less criminality than before although disputes are increasingly settled through the barrel of a gun or, more commonly, through stabbing," he said.
Khaled al-Mughaspi, medical examiner at the hospital of Jalaa, told AFP the number of civilians shot dead has almost doubled as more people use weapons to settle personal, family or tribal scores.
"There used to be 10 to 15 deaths in a period of three months. Now there are between 20 and 25," he said in reference to non-combat deaths.
Particularly troubling among those killed are the bodies or four former members of Gaddafi's security forces, including two ex-interrogators.
They were found shot at point blank range, some of them with traces of torture, and their deaths have raised fears that Benghazi may be in for a wave of bloody purges.
The body of Khaled al-Masdur, found at the end of March, revealed bruises on the chest and shoulders as well as the traces of handcuffs around his wrists.
"He was shot at close range," said the coroner.
Prosecutor Benur speculates the perpetrators may have been "Islamists or rebels" and stresses that either way "these crimes should not go unpunished" because "they stain the image of the revolution."
"We know that in Misrata rebels executed Gaddafi's soldiers but that must stop. If not, what will distinguish us from Gaddafi?" he asked, referring to Libya's third city which was under a devastating loyalist siege for more than two months.
For now, the administration of justice is chaotic as police, rebels and revolutionary committees compete for the mantle of authority as residents seek justice from those who have "proved themselves" during the insurgency.
"Men are more important than structures," said the judge who is battling to uproot the apparatchik mentality of Gaddafi's era.
"It was easier in the anarchic beginning," said a member of the rebel National Transitional Council who wished to remain anonymous.
"We are trying to put something into place here but we must deal with incompetent people who do not respect the decisions of the council or are overly zealous in their application of the rules," he said.
Nasser al-Amali has already experienced the headaches that come with a rebel administration that is still in its infancy.
"The police stopped my brother Walid and confiscated his car," he says.
For two weeks, and despite the court order, the police refused to return the car until a group of rebels intervened on the owner's behalf.
When the vehicle was finally returned, it was missing the bumper and licence plate, rare commodities in Benghazi, Nasser said.