(a) If a defendant is charged with capital murder, with the permission of the court the prosecuting attorney may waive the death penalty.
(b) In a case described in subsection (a) of this section, if the defendant pleads guilty to capital murder or is found guilty of capital murder after trial to the court or to a jury, the trial court shall sentence the defendant to life imprisonment without parole.