Compile function to trunk code