If a crime carries a mandatory punishment, that punishment is fixed by law for all cases, in contrast to crimes for which the judge or magistrate has to decide the punishment for each particular case.
这里for引导原因状语从句?那么which指代crime?which引导定语从句?这句话for which这里有点搞不清楚。