It shall not be lawful for any court or judge, on a second writ of habeas corpus, to discharge any person, if he is clearly and specifically charged in the warrant of commitment with a criminal offense; but the court or judge shall, on the return of such second writ, have power only to admit such person to bail, where the offense is bailable by law, or remand him to prison where the offense is not bailable, or where such person shall fail to give the bail required.
SDCL 21-27-27