code to emit function entry duplicated