refactor : moving code from bench/dm.c to src/spasm_dm.c