Refactor generation of vm filenames and asm filename.