I noticed how over complicated my code was 😞 . This was a part of code where the each bit ( from 0-31 ) were assigned a bit definition name.
The code you attached looks very similar to the old code and does not correspond to the image. Did you attach the right file?
Yes, as you can see, each row can be processed independently, so there is definitely no need for high Aztec pyramids of FOR loops and 3D arrays and such. 😄
(My code was just a quick draft and should be tested for more unusual inputs, of course.)
What is the original representation of the "bits"? (just a U32? a boolean array with 32 elements? etc.). Maybe the original representation can be processed directly, without getting the TRUE positions first.