The code was broken completely. Need to iterate over the whole mask and process the submasks correctly, check if they form full indentity and adjust indices correctly. Fixes https://github.com/llvm/llvm-project/issues/106126