If it appears that the party has been legally committed for any criminal offense, or if he appears, by the testimony offered with the return upon the hearing thereof, to be guilty of such an offense, although the commitment is irregular, the officer before whom such party is brought shall proceed to let such party to bail, if the case be bailable and good bail is offered, or if not, shall forthwith remand such party.
NMS § 44-1-19