quark_bmw512 optimizations
don't copy constant array
small quark optimizations
add includes and error checks