So, there is a scenario (and very probable indeed), where the three teams finish on equal pts and Barca winning on superior h2h over both.
Real winning all their matches (76 + 18 = 94))
ATM winning all but loosing to Barca at Camp Nou(79 + 15 = 94)
Barca dropping 2 pts vs Villareal and winning...