SECOND AMENDED AND RESTATED LOAN AGREEMENT