Solution cide works, but is slow. According to the subreddit, pt 2 is meant to be an exercise in optimization. Turns out the assembly instructions do a factorial, i.e 7! and 12! and adds a salt (5840). Got that spoiled. :)