Requires the court to commit a defendant to the custody of the sheriff when such defendant is charged with an offense under the penal law involving the use or possession of a firearm, and such firearm is not legally registered, licensed or possessed in accordance with section 400.00 of the penal law.