Converts calling the state machine into a function pointer call in order to be able to more easily share code when adding an AVX-512 scatter and an AVX2 gather state machine.
The patch also fixes 2 minor assertion bugs and another minor state machine bug where we did not skip unknown instructions.
Issue: #2985 (closed)