This patch optimizes the prolog and epilog code to reduce the number of