It is not lawful for any court, on a second order of habeas corpus obtained by such prisoner, to discharge the prisoner, if he or she is clearly and specifically charged in the warrant of commitment with a criminal offense; but the court shall, on the return of such second order, have power only to admit such prisoner to pretrial release where the offense is eligible for pretrial release by law, or remand him or her to prison where the offense is not eligible for pretrial release , or being eligible for pretrial release , where such prisoner fails to comply with the terms of pretrial release .
735 ILCS 5/10-127