If William (stay, not) ………………….. ……….up so late last night, he (be, not) ………………….. ……….late for class this morning.
If William (stay, not) …………HADN’T STAYED ………….. ……….up so late last night, he (be, not) …………WOULDN’T HAVE BEEN…………….. ……….late for class this morning.