If it appear that the prisoner has been legally committed for crime or if the prisoner appears, by the testimony offered with the return upon the hearing thereof, to be guilty of crime, although the commitment is irregular, the court or judge before whom the prisoner is brought shall release the prisoner on bail, if bailable and good bail be offered, or shall remand the prisoner.
Wis. Stat. § 782.23