Abstracting map operation over traversal out of x64::generate_func into utility method for usage elsewhere.