Any person who is imprisoned or detained in custody on any criminal charge before conviction for want of bail may file a petition for a writ of habeas corpus for the purpose of giving bail, upon averring that fact in the person's petition, without alleging that the person is illegally confined.
NRS 34.530