LED problem

What does it do?
The LEDs can all be driven thru the IO pins shown:

D1 = 1, D0 = 0 turns on LED1
D1 = 0, D0 = 1 turns on LED2
D1 = D0 turns LED1 & LED2 off
same for 3,4 5,6 7,8
What's the AND gate do that couldn't be done with another IO pin instead?