Super and massive AGB stars - IV. Final fates - Initial to final mass relation