Ivory Coast have secured their passage through to the semi-finals of the Africa Cup of Nations after a 3-1 win over tournament favourites Algeria.