run `hf saflok decode` twice ... and it will run old decoder one time, and new decoder the other time. Makes it easy to compare side-by-side in this interrim build.
* Small, testable functions
* `set_` functions return boolean so they can indicate out-of-bounds values and similar failures.
* const-correctness for all helper functions
Note: The new functions are NOT used extensively yet ... they still need testing. But they should make the code more self-documenting / readable (if somewhat verbose).
Again, these should have zero impact on resulting
instructions. At the same time, this will enable
static analysis to more accurately validate a buffer
(here `saflock_mfc_data_t`) points to sufficiently
large allocated memory.
Additional validation for `extract_bits()` and
`insert_bits()` will prevent accidental corruptions
(and assert, if assertions are enabled).
These changes also makes the code easier to follow.
This should have zero effect on an optimized build,
as there are effectively zero changes to the instructions.
Rather, this provides greater clarity as to the size of buffers
being passed to various functions, which improves the
long-term maintainability of code, especially when
maintained by someone other than the original author.