Generates functions to copy local values to the global heap
