`return 32 + value ? bsf(cast(uint)value) : 32;` I think, in case the high mask is 0.