(b) Notwithstanding the provisions of subsection (a) or (c) of this section or any other provision of this code to the contrary, when any person is convicted of first degree murder or second degree murder or a violation of section three, article eight-b of this chapter and it is determined, as provided in section nineteen of this article, that such person had been before convicted in this state of first degree murder, second degree murder or a violation of section three, article eight-b of said chapter or has been so convicted under any law of the United States or any other state for an offense which has the same elements as any offense described in this subsection, such person shall be punished by confinement in the state correctional facility for life and is not eligible for parole.
(c) When it is determined, as provided in section nineteen of this article, that such person shall have been twice before convicted in the United States of a crime punishable by confinement in a penitentiary, the person shall be sentenced to be confined in the state correctional facility for life.