[K/N] CastsOptimization: fixed a bug in control flow merging