Can't remember the title, but the game is maybe 10+ years old. MC master is super abusive and they basically learn magic to become her master instead. Multiple endings, I think depending on what type of magic you study.