Reverse-engineering the program from “Chronospatial Computer”, day 17 of Advent of Code 2024.
Size matters at codegolf.stackexchange.com.