The player who controlled Arashin Sovereign when it died chooses whether to put it on the top or bottom of its owner's library. The player may also choose to leave Arashin Sovereign in the graveyard. This choice is made as the ability resolves.
Arashin Sovereign will be put on the top or bottom of that library only if it's still in the graveyard when its ability resolves. If it leaves the graveyard before that point, it will stay in whatever zone it's in, even if it's returned to the graveyard before the ability resolves.