What is the function of the gametophyte generation of the fern plant?

produces reproductive organs which produce a zygote
produces meiospores which grow into a sporophyte plant
produces a new fern asexually
grows as a diploid fern